Print this page
4786 emlxs shouldn't abuse ddi_get_time(9f)


   6  * You may not use this file except in compliance with the License.
   7  *
   8  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
   9  * or http://www.opensolaris.org/os/licensing.
  10  * See the License for the specific language governing permissions
  11  * and limitations under the License.
  12  *
  13  * When distributing Covered Code, include this CDDL HEADER in each
  14  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  15  * If applicable, add the following below this CDDL HEADER, with the
  16  * fields enclosed by brackets "[]" replaced with your own identifying
  17  * information: Portions Copyright [yyyy] [name of copyright owner]
  18  *
  19  * CDDL HEADER END
  20  */
  21 
  22 /*
  23  * Copyright 2010 Emulex.  All rights reserved.
  24  * Use is subject to license terms.
  25  */



  26 
  27 #ifndef _EMLXS_FC_H
  28 #define _EMLXS_FC_H
  29 
  30 #ifdef  __cplusplus
  31 extern "C" {
  32 #endif
  33 
  34 typedef struct emlxs_buf
  35 {
  36         fc_packet_t             *pkt;           /* scsi_pkt reference */
  37         struct emlxs_port       *port;          /* pointer to port */
  38         void                    *bmp;           /* Save the buffer pointer */
  39                                                 /* list for later use. */
  40         struct emlxs_buf        *fc_fwd;        /* Use it by chip_Q */
  41         struct emlxs_buf        *fc_bkwd;       /* Use it by chip_Q */
  42         struct emlxs_buf        *next;          /* Use it when the iodone */
  43         struct emlxs_node       *node;
  44         void                    *channel;       /* Save channel and used by */
  45                                                 /* abort */


2023 
2024 #define EMLXS_HBA_T  1  /* flag emlxs_hba_t is already typedefed */
2025 
2026 #ifdef MSI_SUPPORT
2027 #define EMLXS_INTR_INIT(_hba, _m)               emlxs_msi_init(_hba, _m)
2028 #define EMLXS_INTR_UNINIT(_hba)                 emlxs_msi_uninit(_hba)
2029 #define EMLXS_INTR_ADD(_hba)                    emlxs_msi_add(_hba)
2030 #define EMLXS_INTR_REMOVE(_hba)                 emlxs_msi_remove(_hba)
2031 #else
2032 #define EMLXS_INTR_INIT(_hba, _m)               emlxs_intx_init(_hba, _m)
2033 #define EMLXS_INTR_UNINIT(_hba)                 emlxs_intx_uninit(_hba)
2034 #define EMLXS_INTR_ADD(_hba)                    emlxs_intx_add(_hba)
2035 #define EMLXS_INTR_REMOVE(_hba)                 emlxs_intx_remove(_hba)
2036 #endif  /* MSI_SUPPORT */
2037 
2038 
2039 /* Power Management Component */
2040 #define EMLXS_PM_ADAPTER        0
2041 
2042 
2043 #define DRV_TIME        (uint32_t)(ddi_get_time() - emlxs_device.drv_timestamp)
2044 
2045 #define HBA                     port->hba
2046 #define PPORT                   hba->port[0]
2047 #define VPORT(x)                hba->port[x]
2048 #define EMLXS_TIMER_LOCK        hba->timer_lock
2049 #define VPD                     hba->vpd
2050 #define CFG                     hba->config[0]
2051 #define LOG                     hba->log
2052 #define EVENTQ                  hba->event_queue
2053 #define EMLXS_MBOX_LOCK         hba->mbox_lock
2054 #define EMLXS_MBOX_CV           hba->mbox_lock_cv
2055 #define EMLXS_LINKUP_LOCK       hba->linkup_lock
2056 #define EMLXS_LINKUP_CV         hba->linkup_lock_cv
2057 #define EMLXS_TX_CHANNEL_LOCK   hba->channel_tx_lock /* ring txq lock */
2058 #define EMLXS_MEMGET_LOCK       hba->memget_lock     /* mempool get lock */
2059 #define EMLXS_MEMPUT_LOCK       hba->memput_lock     /* mempool put lock */
2060 #define EMLXS_IOCTL_LOCK        hba->ioctl_lock              /* ioctl lock */
2061 #define EMLXS_SPAWN_LOCK        hba->spawn_lock              /* spawn lock */
2062 #define EMLXS_PM_LOCK           hba->pm_lock         /* pm lock */
2063 #define HBASTATS                hba->stats




   6  * You may not use this file except in compliance with the License.
   7  *
   8  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
   9  * or http://www.opensolaris.org/os/licensing.
  10  * See the License for the specific language governing permissions
  11  * and limitations under the License.
  12  *
  13  * When distributing Covered Code, include this CDDL HEADER in each
  14  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  15  * If applicable, add the following below this CDDL HEADER, with the
  16  * fields enclosed by brackets "[]" replaced with your own identifying
  17  * information: Portions Copyright [yyyy] [name of copyright owner]
  18  *
  19  * CDDL HEADER END
  20  */
  21 
  22 /*
  23  * Copyright 2010 Emulex.  All rights reserved.
  24  * Use is subject to license terms.
  25  */
  26 /*
  27  * Copyright 2014 Nexenta Systems, Inc.  All rights reserved.
  28  */
  29 
  30 #ifndef _EMLXS_FC_H
  31 #define _EMLXS_FC_H
  32 
  33 #ifdef  __cplusplus
  34 extern "C" {
  35 #endif
  36 
  37 typedef struct emlxs_buf
  38 {
  39         fc_packet_t             *pkt;           /* scsi_pkt reference */
  40         struct emlxs_port       *port;          /* pointer to port */
  41         void                    *bmp;           /* Save the buffer pointer */
  42                                                 /* list for later use. */
  43         struct emlxs_buf        *fc_fwd;        /* Use it by chip_Q */
  44         struct emlxs_buf        *fc_bkwd;       /* Use it by chip_Q */
  45         struct emlxs_buf        *next;          /* Use it when the iodone */
  46         struct emlxs_node       *node;
  47         void                    *channel;       /* Save channel and used by */
  48                                                 /* abort */


2026 
2027 #define EMLXS_HBA_T  1  /* flag emlxs_hba_t is already typedefed */
2028 
2029 #ifdef MSI_SUPPORT
2030 #define EMLXS_INTR_INIT(_hba, _m)               emlxs_msi_init(_hba, _m)
2031 #define EMLXS_INTR_UNINIT(_hba)                 emlxs_msi_uninit(_hba)
2032 #define EMLXS_INTR_ADD(_hba)                    emlxs_msi_add(_hba)
2033 #define EMLXS_INTR_REMOVE(_hba)                 emlxs_msi_remove(_hba)
2034 #else
2035 #define EMLXS_INTR_INIT(_hba, _m)               emlxs_intx_init(_hba, _m)
2036 #define EMLXS_INTR_UNINIT(_hba)                 emlxs_intx_uninit(_hba)
2037 #define EMLXS_INTR_ADD(_hba)                    emlxs_intx_add(_hba)
2038 #define EMLXS_INTR_REMOVE(_hba)                 emlxs_intx_remove(_hba)
2039 #endif  /* MSI_SUPPORT */
2040 
2041 
2042 /* Power Management Component */
2043 #define EMLXS_PM_ADAPTER        0
2044 
2045 
2046 #define DRV_TIME        (uint32_t)((gethrtime() - emlxs_device.drv_timestamp) / NANOSEC)
2047 
2048 #define HBA                     port->hba
2049 #define PPORT                   hba->port[0]
2050 #define VPORT(x)                hba->port[x]
2051 #define EMLXS_TIMER_LOCK        hba->timer_lock
2052 #define VPD                     hba->vpd
2053 #define CFG                     hba->config[0]
2054 #define LOG                     hba->log
2055 #define EVENTQ                  hba->event_queue
2056 #define EMLXS_MBOX_LOCK         hba->mbox_lock
2057 #define EMLXS_MBOX_CV           hba->mbox_lock_cv
2058 #define EMLXS_LINKUP_LOCK       hba->linkup_lock
2059 #define EMLXS_LINKUP_CV         hba->linkup_lock_cv
2060 #define EMLXS_TX_CHANNEL_LOCK   hba->channel_tx_lock /* ring txq lock */
2061 #define EMLXS_MEMGET_LOCK       hba->memget_lock     /* mempool get lock */
2062 #define EMLXS_MEMPUT_LOCK       hba->memput_lock     /* mempool put lock */
2063 #define EMLXS_IOCTL_LOCK        hba->ioctl_lock              /* ioctl lock */
2064 #define EMLXS_SPAWN_LOCK        hba->spawn_lock              /* spawn lock */
2065 #define EMLXS_PM_LOCK           hba->pm_lock         /* pm lock */
2066 #define HBASTATS                hba->stats