diff options
Diffstat (limited to 'drivers/scsi/qla2xxx/qla_def.h')
-rw-r--r-- | drivers/scsi/qla2xxx/qla_def.h | 188 |
1 files changed, 9 insertions, 179 deletions
diff --git a/drivers/scsi/qla2xxx/qla_def.h b/drivers/scsi/qla2xxx/qla_def.h index 53508f3c4ae9..d6f6579cfd27 100644 --- a/drivers/scsi/qla2xxx/qla_def.h +++ b/drivers/scsi/qla2xxx/qla_def.h | |||
@@ -31,6 +31,8 @@ | |||
31 | #include <scsi/scsi_cmnd.h> | 31 | #include <scsi/scsi_cmnd.h> |
32 | #include <scsi/scsi_transport_fc.h> | 32 | #include <scsi/scsi_transport_fc.h> |
33 | 33 | ||
34 | #define QLA2XXX_DRIVER_NAME "qla2xxx" | ||
35 | |||
34 | /* | 36 | /* |
35 | * We have MAILBOX_REGISTER_COUNT sized arrays in a few places, | 37 | * We have MAILBOX_REGISTER_COUNT sized arrays in a few places, |
36 | * but that's fine as we don't look at the last 24 ones for | 38 | * but that's fine as we don't look at the last 24 ones for |
@@ -189,22 +191,13 @@ typedef struct srb { | |||
189 | 191 | ||
190 | struct scsi_cmnd *cmd; /* Linux SCSI command pkt */ | 192 | struct scsi_cmnd *cmd; /* Linux SCSI command pkt */ |
191 | 193 | ||
192 | struct timer_list timer; /* Command timer */ | ||
193 | atomic_t ref_count; /* Reference count for this structure */ | ||
194 | uint16_t flags; | 194 | uint16_t flags; |
195 | 195 | ||
196 | /* Request state */ | ||
197 | uint16_t state; | ||
198 | |||
199 | /* Single transfer DMA context */ | 196 | /* Single transfer DMA context */ |
200 | dma_addr_t dma_handle; | 197 | dma_addr_t dma_handle; |
201 | 198 | ||
202 | uint32_t request_sense_length; | 199 | uint32_t request_sense_length; |
203 | uint8_t *request_sense_ptr; | 200 | uint8_t *request_sense_ptr; |
204 | |||
205 | /* SRB magic number */ | ||
206 | uint16_t magic; | ||
207 | #define SRB_MAGIC 0x10CB | ||
208 | } srb_t; | 201 | } srb_t; |
209 | 202 | ||
210 | /* | 203 | /* |
@@ -226,21 +219,6 @@ typedef struct srb { | |||
226 | #define SRB_TAPE BIT_11 /* FCP2 (Tape) command. */ | 219 | #define SRB_TAPE BIT_11 /* FCP2 (Tape) command. */ |
227 | 220 | ||
228 | /* | 221 | /* |
229 | * SRB state definitions | ||
230 | */ | ||
231 | #define SRB_FREE_STATE 0 /* returned back */ | ||
232 | #define SRB_PENDING_STATE 1 /* queued in LUN Q */ | ||
233 | #define SRB_ACTIVE_STATE 2 /* in Active Array */ | ||
234 | #define SRB_DONE_STATE 3 /* queued in Done Queue */ | ||
235 | #define SRB_RETRY_STATE 4 /* in Retry Queue */ | ||
236 | #define SRB_SUSPENDED_STATE 5 /* in suspended state */ | ||
237 | #define SRB_NO_QUEUE_STATE 6 /* is in between states */ | ||
238 | #define SRB_ACTIVE_TIMEOUT_STATE 7 /* in Active Array but timed out */ | ||
239 | #define SRB_FAILOVER_STATE 8 /* in Failover Queue */ | ||
240 | #define SRB_SCSI_RETRY_STATE 9 /* in Scsi Retry Queue */ | ||
241 | |||
242 | |||
243 | /* | ||
244 | * ISP I/O Register Set structure definitions. | 222 | * ISP I/O Register Set structure definitions. |
245 | */ | 223 | */ |
246 | struct device_reg_2xxx { | 224 | struct device_reg_2xxx { |
@@ -270,6 +248,8 @@ struct device_reg_2xxx { | |||
270 | #define NVR_SELECT BIT_1 | 248 | #define NVR_SELECT BIT_1 |
271 | #define NVR_CLOCK BIT_0 | 249 | #define NVR_CLOCK BIT_0 |
272 | 250 | ||
251 | #define NVR_WAIT_CNT 20000 | ||
252 | |||
273 | union { | 253 | union { |
274 | struct { | 254 | struct { |
275 | uint16_t mailbox0; | 255 | uint16_t mailbox0; |
@@ -1514,62 +1494,6 @@ typedef struct { | |||
1514 | } sw_info_t; | 1494 | } sw_info_t; |
1515 | 1495 | ||
1516 | /* | 1496 | /* |
1517 | * Inquiry command structure. | ||
1518 | */ | ||
1519 | #define INQ_DATA_SIZE 36 | ||
1520 | |||
1521 | /* | ||
1522 | * Inquiry mailbox IOCB packet definition. | ||
1523 | */ | ||
1524 | typedef struct { | ||
1525 | union { | ||
1526 | cmd_a64_entry_t cmd; | ||
1527 | sts_entry_t rsp; | ||
1528 | struct cmd_type_7 cmd24; | ||
1529 | struct sts_entry_24xx rsp24; | ||
1530 | } p; | ||
1531 | uint8_t inq[INQ_DATA_SIZE]; | ||
1532 | } inq_cmd_rsp_t; | ||
1533 | |||
1534 | /* | ||
1535 | * Report LUN command structure. | ||
1536 | */ | ||
1537 | #define CHAR_TO_SHORT(a, b) (uint16_t)((uint8_t)b << 8 | (uint8_t)a) | ||
1538 | |||
1539 | typedef struct { | ||
1540 | uint32_t len; | ||
1541 | uint32_t rsrv; | ||
1542 | } rpt_hdr_t; | ||
1543 | |||
1544 | typedef struct { | ||
1545 | struct { | ||
1546 | uint8_t b : 6; | ||
1547 | uint8_t address_method : 2; | ||
1548 | } msb; | ||
1549 | uint8_t lsb; | ||
1550 | uint8_t unused[6]; | ||
1551 | } rpt_lun_t; | ||
1552 | |||
1553 | typedef struct { | ||
1554 | rpt_hdr_t hdr; | ||
1555 | rpt_lun_t lst[MAX_LUNS]; | ||
1556 | } rpt_lun_lst_t; | ||
1557 | |||
1558 | /* | ||
1559 | * Report Lun mailbox IOCB packet definition. | ||
1560 | */ | ||
1561 | typedef struct { | ||
1562 | union { | ||
1563 | cmd_a64_entry_t cmd; | ||
1564 | sts_entry_t rsp; | ||
1565 | struct cmd_type_7 cmd24; | ||
1566 | struct sts_entry_24xx rsp24; | ||
1567 | } p; | ||
1568 | rpt_lun_lst_t list; | ||
1569 | } rpt_lun_cmd_rsp_t; | ||
1570 | |||
1571 | |||
1572 | /* | ||
1573 | * Fibre channel port type. | 1497 | * Fibre channel port type. |
1574 | */ | 1498 | */ |
1575 | typedef enum { | 1499 | typedef enum { |
@@ -1587,7 +1511,6 @@ typedef struct { | |||
1587 | typedef struct fc_port { | 1511 | typedef struct fc_port { |
1588 | struct list_head list; | 1512 | struct list_head list; |
1589 | struct scsi_qla_host *ha; | 1513 | struct scsi_qla_host *ha; |
1590 | struct scsi_qla_host *vis_ha; /* only used when suspending lun */ | ||
1591 | 1514 | ||
1592 | uint8_t node_name[WWN_SIZE]; | 1515 | uint8_t node_name[WWN_SIZE]; |
1593 | uint8_t port_name[WWN_SIZE]; | 1516 | uint8_t port_name[WWN_SIZE]; |
@@ -1602,23 +1525,13 @@ typedef struct fc_port { | |||
1602 | 1525 | ||
1603 | unsigned int os_target_id; | 1526 | unsigned int os_target_id; |
1604 | 1527 | ||
1605 | uint16_t iodesc_idx_sent; | ||
1606 | |||
1607 | int port_login_retry_count; | 1528 | int port_login_retry_count; |
1608 | int login_retry; | 1529 | int login_retry; |
1609 | atomic_t port_down_timer; | 1530 | atomic_t port_down_timer; |
1610 | 1531 | ||
1611 | uint8_t device_type; | ||
1612 | uint8_t unused; | ||
1613 | |||
1614 | uint8_t mp_byte; /* multi-path byte (not used) */ | ||
1615 | uint8_t cur_path; /* current path id */ | ||
1616 | |||
1617 | spinlock_t rport_lock; | 1532 | spinlock_t rport_lock; |
1618 | struct fc_rport *rport, *drport; | 1533 | struct fc_rport *rport, *drport; |
1619 | u32 supported_classes; | 1534 | u32 supported_classes; |
1620 | struct work_struct rport_add_work; | ||
1621 | struct work_struct rport_del_work; | ||
1622 | } fc_port_t; | 1535 | } fc_port_t; |
1623 | 1536 | ||
1624 | /* | 1537 | /* |
@@ -2027,54 +1940,6 @@ struct sns_cmd_pkt { | |||
2027 | } p; | 1940 | } p; |
2028 | }; | 1941 | }; |
2029 | 1942 | ||
2030 | /* IO descriptors */ | ||
2031 | #define MAX_IO_DESCRIPTORS 32 | ||
2032 | |||
2033 | #define ABORT_IOCB_CB 0 | ||
2034 | #define ADISC_PORT_IOCB_CB 1 | ||
2035 | #define LOGOUT_PORT_IOCB_CB 2 | ||
2036 | #define LOGIN_PORT_IOCB_CB 3 | ||
2037 | #define LAST_IOCB_CB 4 | ||
2038 | |||
2039 | #define IODESC_INVALID_INDEX 0xFFFF | ||
2040 | #define IODESC_ADISC_NEEDED 0xFFFE | ||
2041 | #define IODESC_LOGIN_NEEDED 0xFFFD | ||
2042 | |||
2043 | struct io_descriptor { | ||
2044 | uint16_t used:1; | ||
2045 | uint16_t idx:11; | ||
2046 | uint16_t cb_idx:4; | ||
2047 | |||
2048 | struct timer_list timer; | ||
2049 | |||
2050 | struct scsi_qla_host *ha; | ||
2051 | |||
2052 | port_id_t d_id; | ||
2053 | fc_port_t *remote_fcport; | ||
2054 | |||
2055 | uint32_t signature; | ||
2056 | }; | ||
2057 | |||
2058 | struct qla_fw_info { | ||
2059 | unsigned short addressing; /* addressing method used to load fw */ | ||
2060 | #define FW_INFO_ADDR_NORMAL 0 | ||
2061 | #define FW_INFO_ADDR_EXTENDED 1 | ||
2062 | #define FW_INFO_ADDR_NOMORE 0xffff | ||
2063 | unsigned short *fwcode; /* pointer to FW array */ | ||
2064 | unsigned short *fwlen; /* number of words in array */ | ||
2065 | unsigned short *fwstart; /* start address for F/W */ | ||
2066 | unsigned long *lfwstart; /* start address (long) for F/W */ | ||
2067 | }; | ||
2068 | |||
2069 | struct qla_board_info { | ||
2070 | char *drv_name; | ||
2071 | |||
2072 | char isp_name[8]; | ||
2073 | struct qla_fw_info *fw_info; | ||
2074 | char *fw_fname; | ||
2075 | struct scsi_host_template *sht; | ||
2076 | }; | ||
2077 | |||
2078 | struct fw_blob { | 1943 | struct fw_blob { |
2079 | char *name; | 1944 | char *name; |
2080 | uint32_t segs[4]; | 1945 | uint32_t segs[4]; |
@@ -2303,9 +2168,6 @@ typedef struct scsi_qla_host { | |||
2303 | uint32_t current_outstanding_cmd; | 2168 | uint32_t current_outstanding_cmd; |
2304 | srb_t *status_srb; /* Status continuation entry. */ | 2169 | srb_t *status_srb; /* Status continuation entry. */ |
2305 | 2170 | ||
2306 | uint16_t revision; | ||
2307 | uint8_t ports; | ||
2308 | |||
2309 | /* ISP configuration data. */ | 2171 | /* ISP configuration data. */ |
2310 | uint16_t loop_id; /* Host adapter loop id */ | 2172 | uint16_t loop_id; /* Host adapter loop id */ |
2311 | uint16_t fb_rev; | 2173 | uint16_t fb_rev; |
@@ -2361,10 +2223,6 @@ typedef struct scsi_qla_host { | |||
2361 | 2223 | ||
2362 | /* Fibre Channel Device List. */ | 2224 | /* Fibre Channel Device List. */ |
2363 | struct list_head fcports; | 2225 | struct list_head fcports; |
2364 | struct list_head rscn_fcports; | ||
2365 | |||
2366 | struct io_descriptor io_descriptors[MAX_IO_DESCRIPTORS]; | ||
2367 | uint16_t iodesc_signature; | ||
2368 | 2226 | ||
2369 | /* RSCN queue. */ | 2227 | /* RSCN queue. */ |
2370 | uint32_t rscn_queue[MAX_RSCN_COUNT]; | 2228 | uint32_t rscn_queue[MAX_RSCN_COUNT]; |
@@ -2395,9 +2253,6 @@ typedef struct scsi_qla_host { | |||
2395 | struct gid_list_info *gid_list; | 2253 | struct gid_list_info *gid_list; |
2396 | int gid_list_info_size; | 2254 | int gid_list_info_size; |
2397 | 2255 | ||
2398 | dma_addr_t rlc_rsp_dma; | ||
2399 | rpt_lun_cmd_rsp_t *rlc_rsp; | ||
2400 | |||
2401 | /* Small DMA pool allocations -- maximum 256 bytes in length. */ | 2256 | /* Small DMA pool allocations -- maximum 256 bytes in length. */ |
2402 | #define DMA_POOL_SIZE 256 | 2257 | #define DMA_POOL_SIZE 256 |
2403 | struct dma_pool *s_dma_pool; | 2258 | struct dma_pool *s_dma_pool; |
@@ -2406,9 +2261,6 @@ typedef struct scsi_qla_host { | |||
2406 | init_cb_t *init_cb; | 2261 | init_cb_t *init_cb; |
2407 | int init_cb_size; | 2262 | int init_cb_size; |
2408 | 2263 | ||
2409 | dma_addr_t iodesc_pd_dma; | ||
2410 | port_database_t *iodesc_pd; | ||
2411 | |||
2412 | /* These are used by mailbox operations. */ | 2264 | /* These are used by mailbox operations. */ |
2413 | volatile uint16_t mailbox_out[MAILBOX_REGISTER_COUNT]; | 2265 | volatile uint16_t mailbox_out[MAILBOX_REGISTER_COUNT]; |
2414 | 2266 | ||
@@ -2435,13 +2287,16 @@ typedef struct scsi_qla_host { | |||
2435 | mbx_cmd_t mc; | 2287 | mbx_cmd_t mc; |
2436 | 2288 | ||
2437 | /* Basic firmware related information. */ | 2289 | /* Basic firmware related information. */ |
2438 | struct qla_board_info *brd_info; | ||
2439 | uint16_t fw_major_version; | 2290 | uint16_t fw_major_version; |
2440 | uint16_t fw_minor_version; | 2291 | uint16_t fw_minor_version; |
2441 | uint16_t fw_subminor_version; | 2292 | uint16_t fw_subminor_version; |
2442 | uint16_t fw_attributes; | 2293 | uint16_t fw_attributes; |
2443 | uint32_t fw_memory_size; | 2294 | uint32_t fw_memory_size; |
2444 | uint32_t fw_transfer_size; | 2295 | uint32_t fw_transfer_size; |
2296 | uint32_t fw_srisc_address; | ||
2297 | #define RISC_START_ADDRESS_2100 0x1000 | ||
2298 | #define RISC_START_ADDRESS_2300 0x800 | ||
2299 | #define RISC_START_ADDRESS_2400 0x100000 | ||
2445 | 2300 | ||
2446 | uint16_t fw_options[16]; /* slots: 1,2,3,10,11 */ | 2301 | uint16_t fw_options[16]; /* slots: 1,2,3,10,11 */ |
2447 | uint8_t fw_seriallink_options[4]; | 2302 | uint8_t fw_seriallink_options[4]; |
@@ -2449,15 +2304,11 @@ typedef struct scsi_qla_host { | |||
2449 | 2304 | ||
2450 | /* Firmware dump information. */ | 2305 | /* Firmware dump information. */ |
2451 | void *fw_dump; | 2306 | void *fw_dump; |
2452 | int fw_dump_order; | 2307 | int fw_dumped; |
2453 | int fw_dump_reading; | 2308 | int fw_dump_reading; |
2454 | char *fw_dump_buffer; | 2309 | char *fw_dump_buffer; |
2455 | int fw_dump_buffer_len; | 2310 | int fw_dump_buffer_len; |
2456 | 2311 | ||
2457 | int fw_dumped; | ||
2458 | void *fw_dump24; | ||
2459 | int fw_dump24_len; | ||
2460 | |||
2461 | uint8_t host_str[16]; | 2312 | uint8_t host_str[16]; |
2462 | uint32_t pci_attr; | 2313 | uint32_t pci_attr; |
2463 | 2314 | ||
@@ -2503,8 +2354,6 @@ typedef struct scsi_qla_host { | |||
2503 | test_bit(LOOP_RESYNC_NEEDED, &ha->dpc_flags) || \ | 2354 | test_bit(LOOP_RESYNC_NEEDED, &ha->dpc_flags) || \ |
2504 | atomic_read(&ha->loop_state) == LOOP_DOWN) | 2355 | atomic_read(&ha->loop_state) == LOOP_DOWN) |
2505 | 2356 | ||
2506 | #define TGT_Q(ha, t) (ha->otgt[t]) | ||
2507 | |||
2508 | #define to_qla_host(x) ((scsi_qla_host_t *) (x)->hostdata) | 2357 | #define to_qla_host(x) ((scsi_qla_host_t *) (x)->hostdata) |
2509 | 2358 | ||
2510 | #define qla_printk(level, ha, format, arg...) \ | 2359 | #define qla_printk(level, ha, format, arg...) \ |
@@ -2537,19 +2386,6 @@ typedef struct scsi_qla_host { | |||
2537 | #define QLA_RSCNS_HANDLED 0x108 | 2386 | #define QLA_RSCNS_HANDLED 0x108 |
2538 | #define QLA_ALREADY_REGISTERED 0x109 | 2387 | #define QLA_ALREADY_REGISTERED 0x109 |
2539 | 2388 | ||
2540 | /* | ||
2541 | * Stat info for all adpaters | ||
2542 | */ | ||
2543 | struct _qla2x00stats { | ||
2544 | unsigned long mboxtout; /* mailbox timeouts */ | ||
2545 | unsigned long mboxerr; /* mailbox errors */ | ||
2546 | unsigned long ispAbort; /* ISP aborts */ | ||
2547 | unsigned long debugNo; | ||
2548 | unsigned long loop_resync; | ||
2549 | unsigned long outarray_full; | ||
2550 | unsigned long retry_q_cnt; | ||
2551 | }; | ||
2552 | |||
2553 | #define NVRAM_DELAY() udelay(10) | 2389 | #define NVRAM_DELAY() udelay(10) |
2554 | 2390 | ||
2555 | #define INVALID_HANDLE (MAX_OUTSTANDING_COMMANDS+1) | 2391 | #define INVALID_HANDLE (MAX_OUTSTANDING_COMMANDS+1) |
@@ -2565,12 +2401,6 @@ struct _qla2x00stats { | |||
2565 | #include "qla_dbg.h" | 2401 | #include "qla_dbg.h" |
2566 | #include "qla_inline.h" | 2402 | #include "qla_inline.h" |
2567 | 2403 | ||
2568 | /* | ||
2569 | * String arrays | ||
2570 | */ | ||
2571 | #define LINESIZE 256 | ||
2572 | #define MAXARGS 26 | ||
2573 | |||
2574 | #define CMD_SP(Cmnd) ((Cmnd)->SCp.ptr) | 2404 | #define CMD_SP(Cmnd) ((Cmnd)->SCp.ptr) |
2575 | #define CMD_COMPL_STATUS(Cmnd) ((Cmnd)->SCp.this_residual) | 2405 | #define CMD_COMPL_STATUS(Cmnd) ((Cmnd)->SCp.this_residual) |
2576 | #define CMD_RESID_LEN(Cmnd) ((Cmnd)->SCp.buffers_residual) | 2406 | #define CMD_RESID_LEN(Cmnd) ((Cmnd)->SCp.buffers_residual) |