ql4_def.h 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594
  1. /*
  2. * QLogic iSCSI HBA Driver
  3. * Copyright (c) 2003-2006 QLogic Corporation
  4. *
  5. * See LICENSE.qla4xxx for copyright and licensing details.
  6. */
  7. #ifndef __QL4_DEF_H
  8. #define __QL4_DEF_H
  9. #include <linux/kernel.h>
  10. #include <linux/init.h>
  11. #include <linux/types.h>
  12. #include <linux/module.h>
  13. #include <linux/list.h>
  14. #include <linux/pci.h>
  15. #include <linux/dma-mapping.h>
  16. #include <linux/sched.h>
  17. #include <linux/slab.h>
  18. #include <linux/dmapool.h>
  19. #include <linux/mempool.h>
  20. #include <linux/spinlock.h>
  21. #include <linux/workqueue.h>
  22. #include <linux/delay.h>
  23. #include <linux/interrupt.h>
  24. #include <linux/mutex.h>
  25. #include <net/tcp.h>
  26. #include <scsi/scsi.h>
  27. #include <scsi/scsi_host.h>
  28. #include <scsi/scsi_device.h>
  29. #include <scsi/scsi_cmnd.h>
  30. #include <scsi/scsi_transport.h>
  31. #include <scsi/scsi_transport_iscsi.h>
  32. #ifndef PCI_DEVICE_ID_QLOGIC_ISP4010
  33. #define PCI_DEVICE_ID_QLOGIC_ISP4010 0x4010
  34. #endif
  35. #ifndef PCI_DEVICE_ID_QLOGIC_ISP4022
  36. #define PCI_DEVICE_ID_QLOGIC_ISP4022 0x4022
  37. #endif
  38. #ifndef PCI_DEVICE_ID_QLOGIC_ISP4032
  39. #define PCI_DEVICE_ID_QLOGIC_ISP4032 0x4032
  40. #endif
  41. #define QLA_SUCCESS 0
  42. #define QLA_ERROR 1
  43. /*
  44. * Data bit definitions
  45. */
  46. #define BIT_0 0x1
  47. #define BIT_1 0x2
  48. #define BIT_2 0x4
  49. #define BIT_3 0x8
  50. #define BIT_4 0x10
  51. #define BIT_5 0x20
  52. #define BIT_6 0x40
  53. #define BIT_7 0x80
  54. #define BIT_8 0x100
  55. #define BIT_9 0x200
  56. #define BIT_10 0x400
  57. #define BIT_11 0x800
  58. #define BIT_12 0x1000
  59. #define BIT_13 0x2000
  60. #define BIT_14 0x4000
  61. #define BIT_15 0x8000
  62. #define BIT_16 0x10000
  63. #define BIT_17 0x20000
  64. #define BIT_18 0x40000
  65. #define BIT_19 0x80000
  66. #define BIT_20 0x100000
  67. #define BIT_21 0x200000
  68. #define BIT_22 0x400000
  69. #define BIT_23 0x800000
  70. #define BIT_24 0x1000000
  71. #define BIT_25 0x2000000
  72. #define BIT_26 0x4000000
  73. #define BIT_27 0x8000000
  74. #define BIT_28 0x10000000
  75. #define BIT_29 0x20000000
  76. #define BIT_30 0x40000000
  77. #define BIT_31 0x80000000
  78. /*
  79. * Host adapter default definitions
  80. ***********************************/
  81. #define MAX_HBAS 16
  82. #define MAX_BUSES 1
  83. #define MAX_TARGETS (MAX_PRST_DEV_DB_ENTRIES + MAX_DEV_DB_ENTRIES)
  84. #define MAX_LUNS 0xffff
  85. #define MAX_AEN_ENTRIES 256 /* should be > EXT_DEF_MAX_AEN_QUEUE */
  86. #define MAX_DDB_ENTRIES (MAX_PRST_DEV_DB_ENTRIES + MAX_DEV_DB_ENTRIES)
  87. #define MAX_PDU_ENTRIES 32
  88. #define INVALID_ENTRY 0xFFFF
  89. #define MAX_CMDS_TO_RISC 1024
  90. #define MAX_SRBS MAX_CMDS_TO_RISC
  91. #define MBOX_AEN_REG_COUNT 5
  92. #define MAX_INIT_RETRIES 5
  93. #define IOCB_HIWAT_CUSHION 16
  94. /*
  95. * Buffer sizes
  96. */
  97. #define REQUEST_QUEUE_DEPTH MAX_CMDS_TO_RISC
  98. #define RESPONSE_QUEUE_DEPTH 64
  99. #define QUEUE_SIZE 64
  100. #define DMA_BUFFER_SIZE 512
  101. /*
  102. * Misc
  103. */
  104. #define MAC_ADDR_LEN 6 /* in bytes */
  105. #define IP_ADDR_LEN 4 /* in bytes */
  106. #define DRIVER_NAME "qla4xxx"
  107. #define MAX_LINKED_CMDS_PER_LUN 3
  108. #define MAX_REQS_SERVICED_PER_INTR 16
  109. #define ISCSI_IPADDR_SIZE 4 /* IP address size */
  110. #define ISCSI_ALIAS_SIZE 32 /* ISCSI Alias name size */
  111. #define ISCSI_NAME_SIZE 0xE0 /* ISCSI Name size */
  112. #define LSDW(x) ((u32)((u64)(x)))
  113. #define MSDW(x) ((u32)((((u64)(x)) >> 16) >> 16))
  114. /*
  115. * Retry & Timeout Values
  116. */
  117. #define MBOX_TOV 60
  118. #define SOFT_RESET_TOV 30
  119. #define RESET_INTR_TOV 3
  120. #define SEMAPHORE_TOV 10
  121. #define ADAPTER_INIT_TOV 120
  122. #define ADAPTER_RESET_TOV 180
  123. #define EXTEND_CMD_TOV 60
  124. #define WAIT_CMD_TOV 30
  125. #define EH_WAIT_CMD_TOV 120
  126. #define FIRMWARE_UP_TOV 60
  127. #define RESET_FIRMWARE_TOV 30
  128. #define LOGOUT_TOV 10
  129. #define IOCB_TOV_MARGIN 10
  130. #define RELOGIN_TOV 18
  131. #define ISNS_DEREG_TOV 5
  132. #define MAX_RESET_HA_RETRIES 2
  133. /*
  134. * SCSI Request Block structure (srb) that is placed
  135. * on cmd->SCp location of every I/O [We have 22 bytes available]
  136. */
  137. struct srb {
  138. struct list_head list; /* (8) */
  139. struct scsi_qla_host *ha; /* HA the SP is queued on */
  140. struct ddb_entry *ddb;
  141. uint16_t flags; /* (1) Status flags. */
  142. #define SRB_DMA_VALID BIT_3 /* DMA Buffer mapped. */
  143. #define SRB_GOT_SENSE BIT_4 /* sense data recieved. */
  144. uint8_t state; /* (1) Status flags. */
  145. #define SRB_NO_QUEUE_STATE 0 /* Request is in between states */
  146. #define SRB_FREE_STATE 1
  147. #define SRB_ACTIVE_STATE 3
  148. #define SRB_ACTIVE_TIMEOUT_STATE 4
  149. #define SRB_SUSPENDED_STATE 7 /* Request in suspended state */
  150. struct scsi_cmnd *cmd; /* (4) SCSI command block */
  151. dma_addr_t dma_handle; /* (4) for unmap of single transfers */
  152. atomic_t ref_count; /* reference count for this srb */
  153. uint32_t fw_ddb_index;
  154. uint8_t err_id; /* error id */
  155. #define SRB_ERR_PORT 1 /* Request failed because "port down" */
  156. #define SRB_ERR_LOOP 2 /* Request failed because "loop down" */
  157. #define SRB_ERR_DEVICE 3 /* Request failed because "device error" */
  158. #define SRB_ERR_OTHER 4
  159. uint16_t reserved;
  160. uint16_t iocb_tov;
  161. uint16_t iocb_cnt; /* Number of used iocbs */
  162. uint16_t cc_stat;
  163. u_long r_start; /* Time we recieve a cmd from OS */
  164. u_long u_start; /* Time when we handed the cmd to F/W */
  165. };
  166. /*
  167. * Asynchronous Event Queue structure
  168. */
  169. struct aen {
  170. uint32_t mbox_sts[MBOX_AEN_REG_COUNT];
  171. };
  172. struct ql4_aen_log {
  173. int count;
  174. struct aen entry[MAX_AEN_ENTRIES];
  175. };
  176. /*
  177. * Device Database (DDB) structure
  178. */
  179. struct ddb_entry {
  180. struct list_head list; /* ddb list */
  181. struct scsi_qla_host *ha;
  182. struct iscsi_cls_session *sess;
  183. struct iscsi_cls_conn *conn;
  184. atomic_t state; /* DDB State */
  185. unsigned long flags; /* DDB Flags */
  186. unsigned long dev_scan_wait_to_start_relogin;
  187. unsigned long dev_scan_wait_to_complete_relogin;
  188. uint16_t os_target_id; /* Target ID */
  189. uint16_t fw_ddb_index; /* DDB firmware index */
  190. uint8_t reserved[2];
  191. uint32_t fw_ddb_device_state; /* F/W Device State -- see ql4_fw.h */
  192. uint32_t CmdSn;
  193. uint16_t target_session_id;
  194. uint16_t connection_id;
  195. uint16_t exe_throttle; /* Max mumber of cmds outstanding
  196. * simultaneously */
  197. uint16_t task_mgmt_timeout; /* Min time for task mgmt cmds to
  198. * complete */
  199. uint16_t default_relogin_timeout; /* Max time to wait for
  200. * relogin to complete */
  201. uint16_t tcp_source_port_num;
  202. uint32_t default_time2wait; /* Default Min time between
  203. * relogins (+aens) */
  204. atomic_t port_down_timer; /* Device connection timer */
  205. atomic_t retry_relogin_timer; /* Min Time between relogins
  206. * (4000 only) */
  207. atomic_t relogin_timer; /* Max Time to wait for relogin to complete */
  208. atomic_t relogin_retry_count; /* Num of times relogin has been
  209. * retried */
  210. uint16_t port;
  211. uint32_t tpgt;
  212. uint8_t ip_addr[ISCSI_IPADDR_SIZE];
  213. uint8_t iscsi_name[ISCSI_NAME_SIZE]; /* 72 x48 */
  214. uint8_t iscsi_alias[0x20];
  215. };
  216. /*
  217. * DDB states.
  218. */
  219. #define DDB_STATE_DEAD 0 /* We can no longer talk to
  220. * this device */
  221. #define DDB_STATE_ONLINE 1 /* Device ready to accept
  222. * commands */
  223. #define DDB_STATE_MISSING 2 /* Device logged off, trying
  224. * to re-login */
  225. /*
  226. * DDB flags.
  227. */
  228. #define DF_RELOGIN 0 /* Relogin to device */
  229. #define DF_NO_RELOGIN 1 /* Do not relogin if IOCTL
  230. * logged it out */
  231. #define DF_ISNS_DISCOVERED 2 /* Device was discovered via iSNS */
  232. #define DF_FO_MASKED 3
  233. #include "ql4_fw.h"
  234. #include "ql4_nvram.h"
  235. /*
  236. * Linux Host Adapter structure
  237. */
  238. struct scsi_qla_host {
  239. /* Linux adapter configuration data */
  240. unsigned long flags;
  241. #define AF_ONLINE 0 /* 0x00000001 */
  242. #define AF_INIT_DONE 1 /* 0x00000002 */
  243. #define AF_MBOX_COMMAND 2 /* 0x00000004 */
  244. #define AF_MBOX_COMMAND_DONE 3 /* 0x00000008 */
  245. #define AF_INTERRUPTS_ON 6 /* 0x00000040 */
  246. #define AF_GET_CRASH_RECORD 7 /* 0x00000080 */
  247. #define AF_LINK_UP 8 /* 0x00000100 */
  248. #define AF_IRQ_ATTACHED 10 /* 0x00000400 */
  249. #define AF_DISABLE_ACB_COMPLETE 11 /* 0x00000800 */
  250. unsigned long dpc_flags;
  251. #define DPC_RESET_HA 1 /* 0x00000002 */
  252. #define DPC_RETRY_RESET_HA 2 /* 0x00000004 */
  253. #define DPC_RELOGIN_DEVICE 3 /* 0x00000008 */
  254. #define DPC_RESET_HA_DESTROY_DDB_LIST 4 /* 0x00000010 */
  255. #define DPC_RESET_HA_INTR 5 /* 0x00000020 */
  256. #define DPC_ISNS_RESTART 7 /* 0x00000080 */
  257. #define DPC_AEN 9 /* 0x00000200 */
  258. #define DPC_GET_DHCP_IP_ADDR 15 /* 0x00008000 */
  259. struct Scsi_Host *host; /* pointer to host data */
  260. uint32_t tot_ddbs;
  261. uint16_t iocb_cnt;
  262. uint16_t iocb_hiwat;
  263. /* SRB cache. */
  264. #define SRB_MIN_REQ 128
  265. mempool_t *srb_mempool;
  266. /* pci information */
  267. struct pci_dev *pdev;
  268. struct isp_reg __iomem *reg; /* Base I/O address */
  269. unsigned long pio_address;
  270. unsigned long pio_length;
  271. #define MIN_IOBASE_LEN 0x100
  272. uint16_t req_q_count;
  273. uint8_t marker_needed;
  274. uint8_t rsvd1;
  275. unsigned long host_no;
  276. /* NVRAM registers */
  277. struct eeprom_data *nvram;
  278. spinlock_t hardware_lock ____cacheline_aligned;
  279. uint32_t eeprom_cmd_data;
  280. /* Counters for general statistics */
  281. uint64_t isr_count;
  282. uint64_t adapter_error_count;
  283. uint64_t device_error_count;
  284. uint64_t total_io_count;
  285. uint64_t total_mbytes_xferred;
  286. uint64_t link_failure_count;
  287. uint64_t invalid_crc_count;
  288. uint32_t bytes_xfered;
  289. uint32_t spurious_int_count;
  290. uint32_t aborted_io_count;
  291. uint32_t io_timeout_count;
  292. uint32_t mailbox_timeout_count;
  293. uint32_t seconds_since_last_intr;
  294. uint32_t seconds_since_last_heartbeat;
  295. uint32_t mac_index;
  296. /* Info Needed for Management App */
  297. /* --- From GetFwVersion --- */
  298. uint32_t firmware_version[2];
  299. uint32_t patch_number;
  300. uint32_t build_number;
  301. uint32_t board_id;
  302. /* --- From Init_FW --- */
  303. /* init_cb_t *init_cb; */
  304. uint16_t firmware_options;
  305. uint16_t tcp_options;
  306. uint8_t ip_address[IP_ADDR_LEN];
  307. uint8_t subnet_mask[IP_ADDR_LEN];
  308. uint8_t gateway[IP_ADDR_LEN];
  309. uint8_t alias[32];
  310. uint8_t name_string[256];
  311. uint8_t heartbeat_interval;
  312. uint8_t rsvd;
  313. /* --- From FlashSysInfo --- */
  314. uint8_t my_mac[MAC_ADDR_LEN];
  315. uint8_t serial_number[16];
  316. /* --- From GetFwState --- */
  317. uint32_t firmware_state;
  318. uint32_t addl_fw_state;
  319. /* Linux kernel thread */
  320. struct workqueue_struct *dpc_thread;
  321. struct work_struct dpc_work;
  322. /* Linux timer thread */
  323. struct timer_list timer;
  324. uint32_t timer_active;
  325. /* Recovery Timers */
  326. uint32_t port_down_retry_count;
  327. uint32_t discovery_wait;
  328. atomic_t check_relogin_timeouts;
  329. uint32_t retry_reset_ha_cnt;
  330. uint32_t isp_reset_timer; /* reset test timer */
  331. uint32_t nic_reset_timer; /* simulated nic reset test timer */
  332. int eh_start;
  333. struct list_head free_srb_q;
  334. uint16_t free_srb_q_count;
  335. uint16_t num_srbs_allocated;
  336. /* DMA Memory Block */
  337. void *queues;
  338. dma_addr_t queues_dma;
  339. unsigned long queues_len;
  340. #define MEM_ALIGN_VALUE \
  341. ((max(REQUEST_QUEUE_DEPTH, RESPONSE_QUEUE_DEPTH)) * \
  342. sizeof(struct queue_entry))
  343. /* request and response queue variables */
  344. dma_addr_t request_dma;
  345. struct queue_entry *request_ring;
  346. struct queue_entry *request_ptr;
  347. dma_addr_t response_dma;
  348. struct queue_entry *response_ring;
  349. struct queue_entry *response_ptr;
  350. dma_addr_t shadow_regs_dma;
  351. struct shadow_regs *shadow_regs;
  352. uint16_t request_in; /* Current indexes. */
  353. uint16_t request_out;
  354. uint16_t response_in;
  355. uint16_t response_out;
  356. /* aen queue variables */
  357. uint16_t aen_q_count; /* Number of available aen_q entries */
  358. uint16_t aen_in; /* Current indexes */
  359. uint16_t aen_out;
  360. struct aen aen_q[MAX_AEN_ENTRIES];
  361. struct ql4_aen_log aen_log;/* tracks all aens */
  362. /* This mutex protects several threads to do mailbox commands
  363. * concurrently.
  364. */
  365. struct mutex mbox_sem;
  366. /* temporary mailbox status registers */
  367. volatile uint8_t mbox_status_count;
  368. volatile uint32_t mbox_status[MBOX_REG_COUNT];
  369. /* local device database list (contains internal ddb entries) */
  370. struct list_head ddb_list;
  371. /* Map ddb_list entry by FW ddb index */
  372. struct ddb_entry *fw_ddb_index_map[MAX_DDB_ENTRIES];
  373. };
  374. static inline int is_qla4010(struct scsi_qla_host *ha)
  375. {
  376. return ha->pdev->device == PCI_DEVICE_ID_QLOGIC_ISP4010;
  377. }
  378. static inline int is_qla4022(struct scsi_qla_host *ha)
  379. {
  380. return ha->pdev->device == PCI_DEVICE_ID_QLOGIC_ISP4022;
  381. }
  382. static inline int is_qla4032(struct scsi_qla_host *ha)
  383. {
  384. return ha->pdev->device == PCI_DEVICE_ID_QLOGIC_ISP4032;
  385. }
  386. static inline int adapter_up(struct scsi_qla_host *ha)
  387. {
  388. return (test_bit(AF_ONLINE, &ha->flags) != 0) &&
  389. (test_bit(AF_LINK_UP, &ha->flags) != 0);
  390. }
  391. static inline struct scsi_qla_host* to_qla_host(struct Scsi_Host *shost)
  392. {
  393. return (struct scsi_qla_host *)shost->hostdata;
  394. }
  395. static inline void __iomem* isp_semaphore(struct scsi_qla_host *ha)
  396. {
  397. return (is_qla4010(ha) ?
  398. &ha->reg->u1.isp4010.nvram :
  399. &ha->reg->u1.isp4022.semaphore);
  400. }
  401. static inline void __iomem* isp_nvram(struct scsi_qla_host *ha)
  402. {
  403. return (is_qla4010(ha) ?
  404. &ha->reg->u1.isp4010.nvram :
  405. &ha->reg->u1.isp4022.nvram);
  406. }
  407. static inline void __iomem* isp_ext_hw_conf(struct scsi_qla_host *ha)
  408. {
  409. return (is_qla4010(ha) ?
  410. &ha->reg->u2.isp4010.ext_hw_conf :
  411. &ha->reg->u2.isp4022.p0.ext_hw_conf);
  412. }
  413. static inline void __iomem* isp_port_status(struct scsi_qla_host *ha)
  414. {
  415. return (is_qla4010(ha) ?
  416. &ha->reg->u2.isp4010.port_status :
  417. &ha->reg->u2.isp4022.p0.port_status);
  418. }
  419. static inline void __iomem* isp_port_ctrl(struct scsi_qla_host *ha)
  420. {
  421. return (is_qla4010(ha) ?
  422. &ha->reg->u2.isp4010.port_ctrl :
  423. &ha->reg->u2.isp4022.p0.port_ctrl);
  424. }
  425. static inline void __iomem* isp_port_error_status(struct scsi_qla_host *ha)
  426. {
  427. return (is_qla4010(ha) ?
  428. &ha->reg->u2.isp4010.port_err_status :
  429. &ha->reg->u2.isp4022.p0.port_err_status);
  430. }
  431. static inline void __iomem * isp_gp_out(struct scsi_qla_host *ha)
  432. {
  433. return (is_qla4010(ha) ?
  434. &ha->reg->u2.isp4010.gp_out :
  435. &ha->reg->u2.isp4022.p0.gp_out);
  436. }
  437. static inline int eeprom_ext_hw_conf_offset(struct scsi_qla_host *ha)
  438. {
  439. return (is_qla4010(ha) ?
  440. offsetof(struct eeprom_data, isp4010.ext_hw_conf) / 2 :
  441. offsetof(struct eeprom_data, isp4022.ext_hw_conf) / 2);
  442. }
  443. int ql4xxx_sem_spinlock(struct scsi_qla_host * ha, u32 sem_mask, u32 sem_bits);
  444. void ql4xxx_sem_unlock(struct scsi_qla_host * ha, u32 sem_mask);
  445. int ql4xxx_sem_lock(struct scsi_qla_host * ha, u32 sem_mask, u32 sem_bits);
  446. static inline int ql4xxx_lock_flash(struct scsi_qla_host *a)
  447. {
  448. if (is_qla4010(a))
  449. return ql4xxx_sem_spinlock(a, QL4010_FLASH_SEM_MASK,
  450. QL4010_FLASH_SEM_BITS);
  451. else
  452. return ql4xxx_sem_spinlock(a, QL4022_FLASH_SEM_MASK,
  453. (QL4022_RESOURCE_BITS_BASE_CODE |
  454. (a->mac_index)) << 13);
  455. }
  456. static inline void ql4xxx_unlock_flash(struct scsi_qla_host *a)
  457. {
  458. if (is_qla4010(a))
  459. ql4xxx_sem_unlock(a, QL4010_FLASH_SEM_MASK);
  460. else
  461. ql4xxx_sem_unlock(a, QL4022_FLASH_SEM_MASK);
  462. }
  463. static inline int ql4xxx_lock_nvram(struct scsi_qla_host *a)
  464. {
  465. if (is_qla4010(a))
  466. return ql4xxx_sem_spinlock(a, QL4010_NVRAM_SEM_MASK,
  467. QL4010_NVRAM_SEM_BITS);
  468. else
  469. return ql4xxx_sem_spinlock(a, QL4022_NVRAM_SEM_MASK,
  470. (QL4022_RESOURCE_BITS_BASE_CODE |
  471. (a->mac_index)) << 10);
  472. }
  473. static inline void ql4xxx_unlock_nvram(struct scsi_qla_host *a)
  474. {
  475. if (is_qla4010(a))
  476. ql4xxx_sem_unlock(a, QL4010_NVRAM_SEM_MASK);
  477. else
  478. ql4xxx_sem_unlock(a, QL4022_NVRAM_SEM_MASK);
  479. }
  480. static inline int ql4xxx_lock_drvr(struct scsi_qla_host *a)
  481. {
  482. if (is_qla4010(a))
  483. return ql4xxx_sem_lock(a, QL4010_DRVR_SEM_MASK,
  484. QL4010_DRVR_SEM_BITS);
  485. else
  486. return ql4xxx_sem_lock(a, QL4022_DRVR_SEM_MASK,
  487. (QL4022_RESOURCE_BITS_BASE_CODE |
  488. (a->mac_index)) << 1);
  489. }
  490. static inline void ql4xxx_unlock_drvr(struct scsi_qla_host *a)
  491. {
  492. if (is_qla4010(a))
  493. ql4xxx_sem_unlock(a, QL4010_DRVR_SEM_MASK);
  494. else
  495. ql4xxx_sem_unlock(a, QL4022_DRVR_SEM_MASK);
  496. }
  497. /*---------------------------------------------------------------------------*/
  498. /* Defines for qla4xxx_initialize_adapter() and qla4xxx_recover_adapter() */
  499. #define PRESERVE_DDB_LIST 0
  500. #define REBUILD_DDB_LIST 1
  501. /* Defines for process_aen() */
  502. #define PROCESS_ALL_AENS 0
  503. #define FLUSH_DDB_CHANGED_AENS 1
  504. #define RELOGIN_DDB_CHANGED_AENS 2
  505. #endif /*_QLA4XXX_H */