diff options
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/scsi/qla2xxx/qla_dbg.c | 122 | ||||
-rw-r--r-- | drivers/scsi/qla2xxx/qla_dbg.h | 13 | ||||
-rw-r--r-- | drivers/scsi/qla2xxx/qla_def.h | 2 | ||||
-rw-r--r-- | drivers/scsi/qla2xxx/qla_gbl.h | 4 | ||||
-rw-r--r-- | drivers/scsi/qla2xxx/qla_gs.c | 6 | ||||
-rw-r--r-- | drivers/scsi/qla2xxx/qla_init.c | 41 | ||||
-rw-r--r-- | drivers/scsi/qla2xxx/qla_inline.h | 85 | ||||
-rw-r--r-- | drivers/scsi/qla2xxx/qla_iocb.c | 3 | ||||
-rw-r--r-- | drivers/scsi/qla2xxx/qla_isr.c | 90 | ||||
-rw-r--r-- | drivers/scsi/qla2xxx/qla_mid.c | 2 | ||||
-rw-r--r-- | drivers/scsi/qla2xxx/qla_os.c | 62 |
11 files changed, 2 insertions, 428 deletions
diff --git a/drivers/scsi/qla2xxx/qla_dbg.c b/drivers/scsi/qla2xxx/qla_dbg.c index 83dd68bacf2a..9d12d9f26209 100644 --- a/drivers/scsi/qla2xxx/qla_dbg.c +++ b/drivers/scsi/qla2xxx/qla_dbg.c | |||
@@ -1410,125 +1410,3 @@ qla2x00_dump_buffer(uint8_t * b, uint32_t size) | |||
1410 | if (cnt % 16) | 1410 | if (cnt % 16) |
1411 | printk("\n"); | 1411 | printk("\n"); |
1412 | } | 1412 | } |
1413 | |||
1414 | /************************************************************************** | ||
1415 | * qla2x00_print_scsi_cmd | ||
1416 | * Dumps out info about the scsi cmd and srb. | ||
1417 | * Input | ||
1418 | * cmd : struct scsi_cmnd | ||
1419 | **************************************************************************/ | ||
1420 | void | ||
1421 | qla2x00_print_scsi_cmd(struct scsi_cmnd * cmd) | ||
1422 | { | ||
1423 | int i; | ||
1424 | struct scsi_qla_host *ha; | ||
1425 | srb_t *sp; | ||
1426 | |||
1427 | ha = shost_priv(cmd->device->host); | ||
1428 | |||
1429 | sp = (srb_t *) cmd->SCp.ptr; | ||
1430 | printk("SCSI Command @=0x%p, Handle=0x%p\n", cmd, cmd->host_scribble); | ||
1431 | printk(" chan=0x%02x, target=0x%02x, lun=0x%02x, cmd_len=0x%02x\n", | ||
1432 | cmd->device->channel, cmd->device->id, cmd->device->lun, | ||
1433 | cmd->cmd_len); | ||
1434 | printk(" CDB: "); | ||
1435 | for (i = 0; i < cmd->cmd_len; i++) { | ||
1436 | printk("0x%02x ", cmd->cmnd[i]); | ||
1437 | } | ||
1438 | printk("\n seg_cnt=%d, allowed=%d, retries=%d\n", | ||
1439 | scsi_sg_count(cmd), cmd->allowed, cmd->retries); | ||
1440 | printk(" request buffer=0x%p, request buffer len=0x%x\n", | ||
1441 | scsi_sglist(cmd), scsi_bufflen(cmd)); | ||
1442 | printk(" tag=%d, transfersize=0x%x\n", | ||
1443 | cmd->tag, cmd->transfersize); | ||
1444 | printk(" serial_number=%lx, SP=%p\n", cmd->serial_number, sp); | ||
1445 | printk(" data direction=%d\n", cmd->sc_data_direction); | ||
1446 | |||
1447 | if (!sp) | ||
1448 | return; | ||
1449 | |||
1450 | printk(" sp flags=0x%x\n", sp->flags); | ||
1451 | } | ||
1452 | |||
1453 | #if defined(QL_DEBUG_ROUTINES) | ||
1454 | /* | ||
1455 | * qla2x00_formatted_dump_buffer | ||
1456 | * Prints string plus buffer. | ||
1457 | * | ||
1458 | * Input: | ||
1459 | * string = Null terminated string (no newline at end). | ||
1460 | * buffer = buffer address. | ||
1461 | * wd_size = word size 8, 16, 32 or 64 bits | ||
1462 | * count = number of words. | ||
1463 | */ | ||
1464 | void | ||
1465 | qla2x00_formatted_dump_buffer(char *string, uint8_t * buffer, | ||
1466 | uint8_t wd_size, uint32_t count) | ||
1467 | { | ||
1468 | uint32_t cnt; | ||
1469 | uint16_t *buf16; | ||
1470 | uint32_t *buf32; | ||
1471 | |||
1472 | if (strcmp(string, "") != 0) | ||
1473 | printk("%s\n",string); | ||
1474 | |||
1475 | switch (wd_size) { | ||
1476 | case 8: | ||
1477 | printk(" 0 1 2 3 4 5 6 7 " | ||
1478 | "8 9 Ah Bh Ch Dh Eh Fh\n"); | ||
1479 | printk("-----------------------------------------" | ||
1480 | "-------------------------------------\n"); | ||
1481 | |||
1482 | for (cnt = 1; cnt <= count; cnt++, buffer++) { | ||
1483 | printk("%02x",*buffer); | ||
1484 | if (cnt % 16 == 0) | ||
1485 | printk("\n"); | ||
1486 | else | ||
1487 | printk(" "); | ||
1488 | } | ||
1489 | if (cnt % 16 != 0) | ||
1490 | printk("\n"); | ||
1491 | break; | ||
1492 | case 16: | ||
1493 | printk(" 0 2 4 6 8 Ah " | ||
1494 | " Ch Eh\n"); | ||
1495 | printk("-----------------------------------------" | ||
1496 | "-------------\n"); | ||
1497 | |||
1498 | buf16 = (uint16_t *) buffer; | ||
1499 | for (cnt = 1; cnt <= count; cnt++, buf16++) { | ||
1500 | printk("%4x",*buf16); | ||
1501 | |||
1502 | if (cnt % 8 == 0) | ||
1503 | printk("\n"); | ||
1504 | else if (*buf16 < 10) | ||
1505 | printk(" "); | ||
1506 | else | ||
1507 | printk(" "); | ||
1508 | } | ||
1509 | if (cnt % 8 != 0) | ||
1510 | printk("\n"); | ||
1511 | break; | ||
1512 | case 32: | ||
1513 | printk(" 0 4 8 Ch\n"); | ||
1514 | printk("------------------------------------------\n"); | ||
1515 | |||
1516 | buf32 = (uint32_t *) buffer; | ||
1517 | for (cnt = 1; cnt <= count; cnt++, buf32++) { | ||
1518 | printk("%8x", *buf32); | ||
1519 | |||
1520 | if (cnt % 4 == 0) | ||
1521 | printk("\n"); | ||
1522 | else if (*buf32 < 10) | ||
1523 | printk(" "); | ||
1524 | else | ||
1525 | printk(" "); | ||
1526 | } | ||
1527 | if (cnt % 4 != 0) | ||
1528 | printk("\n"); | ||
1529 | break; | ||
1530 | default: | ||
1531 | break; | ||
1532 | } | ||
1533 | } | ||
1534 | #endif | ||
diff --git a/drivers/scsi/qla2xxx/qla_dbg.h b/drivers/scsi/qla2xxx/qla_dbg.h index c30f2fa284f2..2a4043b5b145 100644 --- a/drivers/scsi/qla2xxx/qla_dbg.h +++ b/drivers/scsi/qla2xxx/qla_dbg.h | |||
@@ -22,19 +22,6 @@ | |||
22 | /* #define QL_DEBUG_LEVEL_13 */ /* Output fdmi function trace msgs */ | 22 | /* #define QL_DEBUG_LEVEL_13 */ /* Output fdmi function trace msgs */ |
23 | /* #define QL_DEBUG_LEVEL_14 */ /* Output RSCN trace msgs */ | 23 | /* #define QL_DEBUG_LEVEL_14 */ /* Output RSCN trace msgs */ |
24 | /* #define QL_DEBUG_LEVEL_15 */ /* Output NPIV trace msgs */ | 24 | /* #define QL_DEBUG_LEVEL_15 */ /* Output NPIV trace msgs */ |
25 | /* | ||
26 | * Local Macro Definitions. | ||
27 | */ | ||
28 | #if defined(QL_DEBUG_LEVEL_1) || defined(QL_DEBUG_LEVEL_2) || \ | ||
29 | defined(QL_DEBUG_LEVEL_3) || defined(QL_DEBUG_LEVEL_4) || \ | ||
30 | defined(QL_DEBUG_LEVEL_5) || defined(QL_DEBUG_LEVEL_6) || \ | ||
31 | defined(QL_DEBUG_LEVEL_7) || defined(QL_DEBUG_LEVEL_8) || \ | ||
32 | defined(QL_DEBUG_LEVEL_9) || defined(QL_DEBUG_LEVEL_10) || \ | ||
33 | defined(QL_DEBUG_LEVEL_11) || defined(QL_DEBUG_LEVEL_12) || \ | ||
34 | defined(QL_DEBUG_LEVEL_13) || defined(QL_DEBUG_LEVEL_14) || \ | ||
35 | defined(QL_DEBUG_LEVEL_15) | ||
36 | #define QL_DEBUG_ROUTINES | ||
37 | #endif | ||
38 | 25 | ||
39 | /* | 26 | /* |
40 | * Macros use for debugging the driver. | 27 | * Macros use for debugging the driver. |
diff --git a/drivers/scsi/qla2xxx/qla_def.h b/drivers/scsi/qla2xxx/qla_def.h index 13ffedaf8cba..047973f37847 100644 --- a/drivers/scsi/qla2xxx/qla_def.h +++ b/drivers/scsi/qla2xxx/qla_def.h | |||
@@ -2449,8 +2449,6 @@ typedef struct scsi_qla_host { | |||
2449 | #define MBX_TIMEDOUT BIT_5 | 2449 | #define MBX_TIMEDOUT BIT_5 |
2450 | #define MBX_ACCESS_TIMEDOUT BIT_6 | 2450 | #define MBX_ACCESS_TIMEDOUT BIT_6 |
2451 | 2451 | ||
2452 | mbx_cmd_t mc; | ||
2453 | |||
2454 | /* Basic firmware related information. */ | 2452 | /* Basic firmware related information. */ |
2455 | uint16_t fw_major_version; | 2453 | uint16_t fw_major_version; |
2456 | uint16_t fw_minor_version; | 2454 | uint16_t fw_minor_version; |
diff --git a/drivers/scsi/qla2xxx/qla_gbl.h b/drivers/scsi/qla2xxx/qla_gbl.h index 276bd26c0c8e..10c3f905b711 100644 --- a/drivers/scsi/qla2xxx/qla_gbl.h +++ b/drivers/scsi/qla2xxx/qla_gbl.h | |||
@@ -38,9 +38,6 @@ extern int qla2x00_loop_resync(scsi_qla_host_t *); | |||
38 | extern int qla2x00_fabric_login(scsi_qla_host_t *, fc_port_t *, uint16_t *); | 38 | extern int qla2x00_fabric_login(scsi_qla_host_t *, fc_port_t *, uint16_t *); |
39 | extern int qla2x00_local_device_login(scsi_qla_host_t *, fc_port_t *); | 39 | extern int qla2x00_local_device_login(scsi_qla_host_t *, fc_port_t *); |
40 | 40 | ||
41 | extern void qla2x00_restart_queues(scsi_qla_host_t *, uint8_t); | ||
42 | |||
43 | extern void qla2x00_rescan_fcports(scsi_qla_host_t *); | ||
44 | extern void qla2x00_update_fcports(scsi_qla_host_t *); | 41 | extern void qla2x00_update_fcports(scsi_qla_host_t *); |
45 | 42 | ||
46 | extern int qla2x00_abort_isp(scsi_qla_host_t *); | 43 | extern int qla2x00_abort_isp(scsi_qla_host_t *); |
@@ -312,7 +309,6 @@ extern void qla24xx_fw_dump(scsi_qla_host_t *, int); | |||
312 | extern void qla25xx_fw_dump(scsi_qla_host_t *, int); | 309 | extern void qla25xx_fw_dump(scsi_qla_host_t *, int); |
313 | extern void qla2x00_dump_regs(scsi_qla_host_t *); | 310 | extern void qla2x00_dump_regs(scsi_qla_host_t *); |
314 | extern void qla2x00_dump_buffer(uint8_t *, uint32_t); | 311 | extern void qla2x00_dump_buffer(uint8_t *, uint32_t); |
315 | extern void qla2x00_print_scsi_cmd(struct scsi_cmnd *); | ||
316 | 312 | ||
317 | /* | 313 | /* |
318 | * Global Function Prototypes in qla_gs.c source file. | 314 | * Global Function Prototypes in qla_gs.c source file. |
diff --git a/drivers/scsi/qla2xxx/qla_gs.c b/drivers/scsi/qla2xxx/qla_gs.c index ea8a7d3e9ce5..e6578ce34ecd 100644 --- a/drivers/scsi/qla2xxx/qla_gs.c +++ b/drivers/scsi/qla2xxx/qla_gs.c | |||
@@ -6,12 +6,6 @@ | |||
6 | */ | 6 | */ |
7 | #include "qla_def.h" | 7 | #include "qla_def.h" |
8 | 8 | ||
9 | static inline struct ct_sns_req * | ||
10 | qla2x00_prep_ct_req(struct ct_sns_req *, uint16_t, uint16_t); | ||
11 | |||
12 | static inline struct sns_cmd_pkt * | ||
13 | qla2x00_prep_sns_cmd(scsi_qla_host_t *, uint16_t, uint16_t, uint16_t); | ||
14 | |||
15 | static int qla2x00_sns_ga_nxt(scsi_qla_host_t *, fc_port_t *); | 9 | static int qla2x00_sns_ga_nxt(scsi_qla_host_t *, fc_port_t *); |
16 | static int qla2x00_sns_gid_pt(scsi_qla_host_t *, sw_info_t *); | 10 | static int qla2x00_sns_gid_pt(scsi_qla_host_t *, sw_info_t *); |
17 | static int qla2x00_sns_gpn_id(scsi_qla_host_t *, sw_info_t *); | 11 | static int qla2x00_sns_gpn_id(scsi_qla_host_t *, sw_info_t *); |
diff --git a/drivers/scsi/qla2xxx/qla_init.c b/drivers/scsi/qla2xxx/qla_init.c index e9a7c2d13855..d429e2f5c70e 100644 --- a/drivers/scsi/qla2xxx/qla_init.c +++ b/drivers/scsi/qla2xxx/qla_init.c | |||
@@ -15,14 +15,6 @@ | |||
15 | #include <asm/prom.h> | 15 | #include <asm/prom.h> |
16 | #endif | 16 | #endif |
17 | 17 | ||
18 | /* XXX(hch): this is ugly, but we don't want to pull in exioctl.h */ | ||
19 | #ifndef EXT_IS_LUN_BIT_SET | ||
20 | #define EXT_IS_LUN_BIT_SET(P,L) \ | ||
21 | (((P)->mask[L/8] & (0x80 >> (L%8)))?1:0) | ||
22 | #define EXT_SET_LUN_BIT(P,L) \ | ||
23 | ((P)->mask[L/8] |= (0x80 >> (L%8))) | ||
24 | #endif | ||
25 | |||
26 | /* | 18 | /* |
27 | * QLogic ISP2x00 Hardware Support Function Prototypes. | 19 | * QLogic ISP2x00 Hardware Support Function Prototypes. |
28 | */ | 20 | */ |
@@ -2176,20 +2168,6 @@ cleanup_allocation: | |||
2176 | } | 2168 | } |
2177 | 2169 | ||
2178 | static void | 2170 | static void |
2179 | qla2x00_probe_for_all_luns(scsi_qla_host_t *ha) | ||
2180 | { | ||
2181 | fc_port_t *fcport; | ||
2182 | |||
2183 | qla2x00_mark_all_devices_lost(ha, 0); | ||
2184 | list_for_each_entry(fcport, &ha->fcports, list) { | ||
2185 | if (fcport->port_type != FCT_TARGET) | ||
2186 | continue; | ||
2187 | |||
2188 | qla2x00_update_fcport(ha, fcport); | ||
2189 | } | ||
2190 | } | ||
2191 | |||
2192 | static void | ||
2193 | qla2x00_iidma_fcport(scsi_qla_host_t *ha, fc_port_t *fcport) | 2171 | qla2x00_iidma_fcport(scsi_qla_host_t *ha, fc_port_t *fcport) |
2194 | { | 2172 | { |
2195 | #define LS_UNKNOWN 2 | 2173 | #define LS_UNKNOWN 2 |
@@ -3200,25 +3178,6 @@ qla2x00_loop_resync(scsi_qla_host_t *ha) | |||
3200 | } | 3178 | } |
3201 | 3179 | ||
3202 | void | 3180 | void |
3203 | qla2x00_rescan_fcports(scsi_qla_host_t *ha) | ||
3204 | { | ||
3205 | int rescan_done; | ||
3206 | fc_port_t *fcport; | ||
3207 | |||
3208 | rescan_done = 0; | ||
3209 | list_for_each_entry(fcport, &ha->fcports, list) { | ||
3210 | if ((fcport->flags & FCF_RESCAN_NEEDED) == 0) | ||
3211 | continue; | ||
3212 | |||
3213 | qla2x00_update_fcport(ha, fcport); | ||
3214 | fcport->flags &= ~FCF_RESCAN_NEEDED; | ||
3215 | |||
3216 | rescan_done = 1; | ||
3217 | } | ||
3218 | qla2x00_probe_for_all_luns(ha); | ||
3219 | } | ||
3220 | |||
3221 | void | ||
3222 | qla2x00_update_fcports(scsi_qla_host_t *ha) | 3181 | qla2x00_update_fcports(scsi_qla_host_t *ha) |
3223 | { | 3182 | { |
3224 | fc_port_t *fcport; | 3183 | fc_port_t *fcport; |
diff --git a/drivers/scsi/qla2xxx/qla_inline.h b/drivers/scsi/qla2xxx/qla_inline.h index 3e57a3e03dac..e9bae27737d1 100644 --- a/drivers/scsi/qla2xxx/qla_inline.h +++ b/drivers/scsi/qla2xxx/qla_inline.h | |||
@@ -5,7 +5,6 @@ | |||
5 | * See LICENSE.qla2xxx for copyright and licensing details. | 5 | * See LICENSE.qla2xxx for copyright and licensing details. |
6 | */ | 6 | */ |
7 | 7 | ||
8 | static __inline__ uint16_t qla2x00_debounce_register(volatile uint16_t __iomem *); | ||
9 | /* | 8 | /* |
10 | * qla2x00_debounce_register | 9 | * qla2x00_debounce_register |
11 | * Debounce register. | 10 | * Debounce register. |
@@ -32,94 +31,12 @@ qla2x00_debounce_register(volatile uint16_t __iomem *addr) | |||
32 | return (first); | 31 | return (first); |
33 | } | 32 | } |
34 | 33 | ||
35 | static __inline__ int qla2x00_normalize_dma_addr( | ||
36 | dma_addr_t *e_addr, uint32_t *e_len, | ||
37 | dma_addr_t *ne_addr, uint32_t *ne_len); | ||
38 | |||
39 | /** | ||
40 | * qla2x00_normalize_dma_addr() - Normalize an DMA address. | ||
41 | * @e_addr: Raw DMA address | ||
42 | * @e_len: Raw DMA length | ||
43 | * @ne_addr: Normalized second DMA address | ||
44 | * @ne_len: Normalized second DMA length | ||
45 | * | ||
46 | * If the address does not span a 4GB page boundary, the contents of @ne_addr | ||
47 | * and @ne_len are undefined. @e_len is updated to reflect a normalization. | ||
48 | * | ||
49 | * Example: | ||
50 | * | ||
51 | * ffffabc0ffffeeee (e_addr) start of DMA address | ||
52 | * 0000000020000000 (e_len) length of DMA transfer | ||
53 | * ffffabc11fffeeed end of DMA transfer | ||
54 | * | ||
55 | * Is the 4GB boundary crossed? | ||
56 | * | ||
57 | * ffffabc0ffffeeee (e_addr) | ||
58 | * ffffabc11fffeeed (e_addr + e_len - 1) | ||
59 | * 00000001e0000003 ((e_addr ^ (e_addr + e_len - 1)) | ||
60 | * 0000000100000000 ((e_addr ^ (e_addr + e_len - 1)) & ~(0xffffffff) | ||
61 | * | ||
62 | * Compute start of second DMA segment: | ||
63 | * | ||
64 | * ffffabc0ffffeeee (e_addr) | ||
65 | * ffffabc1ffffeeee (0x100000000 + e_addr) | ||
66 | * ffffabc100000000 (0x100000000 + e_addr) & ~(0xffffffff) | ||
67 | * ffffabc100000000 (ne_addr) | ||
68 | * | ||
69 | * Compute length of second DMA segment: | ||
70 | * | ||
71 | * 00000000ffffeeee (e_addr & 0xffffffff) | ||
72 | * 0000000000001112 (0x100000000 - (e_addr & 0xffffffff)) | ||
73 | * 000000001fffeeee (e_len - (0x100000000 - (e_addr & 0xffffffff)) | ||
74 | * 000000001fffeeee (ne_len) | ||
75 | * | ||
76 | * Adjust length of first DMA segment | ||
77 | * | ||
78 | * 0000000020000000 (e_len) | ||
79 | * 0000000000001112 (e_len - ne_len) | ||
80 | * 0000000000001112 (e_len) | ||
81 | * | ||
82 | * Returns non-zero if the specified address was normalized, else zero. | ||
83 | */ | ||
84 | static __inline__ int | ||
85 | qla2x00_normalize_dma_addr( | ||
86 | dma_addr_t *e_addr, uint32_t *e_len, | ||
87 | dma_addr_t *ne_addr, uint32_t *ne_len) | ||
88 | { | ||
89 | int normalized; | ||
90 | |||
91 | normalized = 0; | ||
92 | if ((*e_addr ^ (*e_addr + *e_len - 1)) & ~(0xFFFFFFFFULL)) { | ||
93 | /* Compute normalized crossed address and len */ | ||
94 | *ne_addr = (0x100000000ULL + *e_addr) & ~(0xFFFFFFFFULL); | ||
95 | *ne_len = *e_len - (0x100000000ULL - (*e_addr & 0xFFFFFFFFULL)); | ||
96 | *e_len -= *ne_len; | ||
97 | |||
98 | normalized++; | ||
99 | } | ||
100 | return (normalized); | ||
101 | } | ||
102 | |||
103 | static __inline__ void qla2x00_poll(scsi_qla_host_t *); | ||
104 | static inline void | 34 | static inline void |
105 | qla2x00_poll(scsi_qla_host_t *ha) | 35 | qla2x00_poll(scsi_qla_host_t *ha) |
106 | { | 36 | { |
107 | ha->isp_ops->intr_handler(0, ha); | 37 | ha->isp_ops->intr_handler(0, ha); |
108 | } | 38 | } |
109 | 39 | ||
110 | static __inline__ void qla2x00_check_fabric_devices(scsi_qla_host_t *); | ||
111 | /* | ||
112 | * This routine will wait for fabric devices for | ||
113 | * the reset delay. | ||
114 | */ | ||
115 | static __inline__ void qla2x00_check_fabric_devices(scsi_qla_host_t *ha) | ||
116 | { | ||
117 | uint16_t fw_state; | ||
118 | |||
119 | qla2x00_get_firmware_state(ha, &fw_state); | ||
120 | } | ||
121 | |||
122 | static __inline__ scsi_qla_host_t * to_qla_parent(scsi_qla_host_t *); | ||
123 | static __inline__ scsi_qla_host_t * | 40 | static __inline__ scsi_qla_host_t * |
124 | to_qla_parent(scsi_qla_host_t *ha) | 41 | to_qla_parent(scsi_qla_host_t *ha) |
125 | { | 42 | { |
@@ -152,7 +69,6 @@ qla2x00_issue_marker(scsi_qla_host_t *ha, int ha_locked) | |||
152 | return (QLA_SUCCESS); | 69 | return (QLA_SUCCESS); |
153 | } | 70 | } |
154 | 71 | ||
155 | static inline uint8_t *host_to_fcp_swap(uint8_t *, uint32_t); | ||
156 | static inline uint8_t * | 72 | static inline uint8_t * |
157 | host_to_fcp_swap(uint8_t *fcp, uint32_t bsize) | 73 | host_to_fcp_swap(uint8_t *fcp, uint32_t bsize) |
158 | { | 74 | { |
@@ -166,7 +82,6 @@ host_to_fcp_swap(uint8_t *fcp, uint32_t bsize) | |||
166 | return fcp; | 82 | return fcp; |
167 | } | 83 | } |
168 | 84 | ||
169 | static inline int qla2x00_is_reserved_id(scsi_qla_host_t *, uint16_t); | ||
170 | static inline int | 85 | static inline int |
171 | qla2x00_is_reserved_id(scsi_qla_host_t *ha, uint16_t loop_id) | 86 | qla2x00_is_reserved_id(scsi_qla_host_t *ha, uint16_t loop_id) |
172 | { | 87 | { |
diff --git a/drivers/scsi/qla2xxx/qla_iocb.c b/drivers/scsi/qla2xxx/qla_iocb.c index 9192ad574d99..5489d5024673 100644 --- a/drivers/scsi/qla2xxx/qla_iocb.c +++ b/drivers/scsi/qla2xxx/qla_iocb.c | |||
@@ -11,9 +11,6 @@ | |||
11 | 11 | ||
12 | #include <scsi/scsi_tcq.h> | 12 | #include <scsi/scsi_tcq.h> |
13 | 13 | ||
14 | static inline uint16_t qla2x00_get_cmd_direction(struct scsi_cmnd *cmd); | ||
15 | static inline cont_entry_t *qla2x00_prep_cont_type0_iocb(scsi_qla_host_t *); | ||
16 | static inline cont_a64_entry_t *qla2x00_prep_cont_type1_iocb(scsi_qla_host_t *); | ||
17 | static request_t *qla2x00_req_pkt(scsi_qla_host_t *ha); | 14 | static request_t *qla2x00_req_pkt(scsi_qla_host_t *ha); |
18 | static void qla2x00_isp_cmd(scsi_qla_host_t *ha); | 15 | static void qla2x00_isp_cmd(scsi_qla_host_t *ha); |
19 | 16 | ||
diff --git a/drivers/scsi/qla2xxx/qla_isr.c b/drivers/scsi/qla2xxx/qla_isr.c index 088464251d7e..e88600082c01 100644 --- a/drivers/scsi/qla2xxx/qla_isr.c +++ b/drivers/scsi/qla2xxx/qla_isr.c | |||
@@ -14,9 +14,6 @@ static void qla2x00_process_completed_request(struct scsi_qla_host *, uint32_t); | |||
14 | static void qla2x00_status_entry(scsi_qla_host_t *, void *); | 14 | static void qla2x00_status_entry(scsi_qla_host_t *, void *); |
15 | static void qla2x00_status_cont_entry(scsi_qla_host_t *, sts_cont_entry_t *); | 15 | static void qla2x00_status_cont_entry(scsi_qla_host_t *, sts_cont_entry_t *); |
16 | static void qla2x00_error_entry(scsi_qla_host_t *, sts_entry_t *); | 16 | static void qla2x00_error_entry(scsi_qla_host_t *, sts_entry_t *); |
17 | static void qla2x00_ms_entry(scsi_qla_host_t *, ms_iocb_entry_t *); | ||
18 | |||
19 | static void qla24xx_ms_entry(scsi_qla_host_t *, struct ct_entry_24xx *); | ||
20 | 17 | ||
21 | /** | 18 | /** |
22 | * qla2100_intr_handler() - Process interrupts for the ISP2100 and ISP2200. | 19 | * qla2100_intr_handler() - Process interrupts for the ISP2100 and ISP2200. |
@@ -809,9 +806,6 @@ qla2x00_process_response_queue(struct scsi_qla_host *ha) | |||
809 | case STATUS_CONT_TYPE: | 806 | case STATUS_CONT_TYPE: |
810 | qla2x00_status_cont_entry(ha, (sts_cont_entry_t *)pkt); | 807 | qla2x00_status_cont_entry(ha, (sts_cont_entry_t *)pkt); |
811 | break; | 808 | break; |
812 | case MS_IOCB_TYPE: | ||
813 | qla2x00_ms_entry(ha, (ms_iocb_entry_t *)pkt); | ||
814 | break; | ||
815 | default: | 809 | default: |
816 | /* Type Not Supported. */ | 810 | /* Type Not Supported. */ |
817 | DEBUG4(printk(KERN_WARNING | 811 | DEBUG4(printk(KERN_WARNING |
@@ -1346,44 +1340,6 @@ qla2x00_error_entry(scsi_qla_host_t *ha, sts_entry_t *pkt) | |||
1346 | } | 1340 | } |
1347 | 1341 | ||
1348 | /** | 1342 | /** |
1349 | * qla2x00_ms_entry() - Process a Management Server entry. | ||
1350 | * @ha: SCSI driver HA context | ||
1351 | * @index: Response queue out pointer | ||
1352 | */ | ||
1353 | static void | ||
1354 | qla2x00_ms_entry(scsi_qla_host_t *ha, ms_iocb_entry_t *pkt) | ||
1355 | { | ||
1356 | srb_t *sp; | ||
1357 | |||
1358 | DEBUG3(printk("%s(%ld): pkt=%p pkthandle=%d.\n", | ||
1359 | __func__, ha->host_no, pkt, pkt->handle1)); | ||
1360 | |||
1361 | /* Validate handle. */ | ||
1362 | if (pkt->handle1 < MAX_OUTSTANDING_COMMANDS) | ||
1363 | sp = ha->outstanding_cmds[pkt->handle1]; | ||
1364 | else | ||
1365 | sp = NULL; | ||
1366 | |||
1367 | if (sp == NULL) { | ||
1368 | DEBUG2(printk("scsi(%ld): MS entry - invalid handle\n", | ||
1369 | ha->host_no)); | ||
1370 | qla_printk(KERN_WARNING, ha, "MS entry - invalid handle\n"); | ||
1371 | |||
1372 | set_bit(ISP_ABORT_NEEDED, &ha->dpc_flags); | ||
1373 | return; | ||
1374 | } | ||
1375 | |||
1376 | CMD_COMPL_STATUS(sp->cmd) = le16_to_cpu(pkt->status); | ||
1377 | CMD_ENTRY_STATUS(sp->cmd) = pkt->entry_status; | ||
1378 | |||
1379 | /* Free outstanding command slot. */ | ||
1380 | ha->outstanding_cmds[pkt->handle1] = NULL; | ||
1381 | |||
1382 | qla2x00_sp_compl(ha, sp); | ||
1383 | } | ||
1384 | |||
1385 | |||
1386 | /** | ||
1387 | * qla24xx_mbx_completion() - Process mailbox command completions. | 1343 | * qla24xx_mbx_completion() - Process mailbox command completions. |
1388 | * @ha: SCSI driver HA context | 1344 | * @ha: SCSI driver HA context |
1389 | * @mb0: Mailbox0 register | 1345 | * @mb0: Mailbox0 register |
@@ -1455,9 +1411,6 @@ qla24xx_process_response_queue(struct scsi_qla_host *ha) | |||
1455 | case STATUS_CONT_TYPE: | 1411 | case STATUS_CONT_TYPE: |
1456 | qla2x00_status_cont_entry(ha, (sts_cont_entry_t *)pkt); | 1412 | qla2x00_status_cont_entry(ha, (sts_cont_entry_t *)pkt); |
1457 | break; | 1413 | break; |
1458 | case MS_IOCB_TYPE: | ||
1459 | qla24xx_ms_entry(ha, (struct ct_entry_24xx *)pkt); | ||
1460 | break; | ||
1461 | case VP_RPT_ID_IOCB_TYPE: | 1414 | case VP_RPT_ID_IOCB_TYPE: |
1462 | qla24xx_report_id_acquisition(ha, | 1415 | qla24xx_report_id_acquisition(ha, |
1463 | (struct vp_rpt_id_entry_24xx *)pkt); | 1416 | (struct vp_rpt_id_entry_24xx *)pkt); |
@@ -1619,49 +1572,6 @@ qla24xx_intr_handler(int irq, void *dev_id) | |||
1619 | return IRQ_HANDLED; | 1572 | return IRQ_HANDLED; |
1620 | } | 1573 | } |
1621 | 1574 | ||
1622 | /** | ||
1623 | * qla24xx_ms_entry() - Process a Management Server entry. | ||
1624 | * @ha: SCSI driver HA context | ||
1625 | * @index: Response queue out pointer | ||
1626 | */ | ||
1627 | static void | ||
1628 | qla24xx_ms_entry(scsi_qla_host_t *ha, struct ct_entry_24xx *pkt) | ||
1629 | { | ||
1630 | srb_t *sp; | ||
1631 | |||
1632 | DEBUG3(printk("%s(%ld): pkt=%p pkthandle=%d.\n", | ||
1633 | __func__, ha->host_no, pkt, pkt->handle)); | ||
1634 | |||
1635 | DEBUG9(printk("%s: ct pkt dump:\n", __func__)); | ||
1636 | DEBUG9(qla2x00_dump_buffer((void *)pkt, sizeof(struct ct_entry_24xx))); | ||
1637 | |||
1638 | /* Validate handle. */ | ||
1639 | if (pkt->handle < MAX_OUTSTANDING_COMMANDS) | ||
1640 | sp = ha->outstanding_cmds[pkt->handle]; | ||
1641 | else | ||
1642 | sp = NULL; | ||
1643 | |||
1644 | if (sp == NULL) { | ||
1645 | DEBUG2(printk("scsi(%ld): MS entry - invalid handle\n", | ||
1646 | ha->host_no)); | ||
1647 | DEBUG10(printk("scsi(%ld): MS entry - invalid handle\n", | ||
1648 | ha->host_no)); | ||
1649 | qla_printk(KERN_WARNING, ha, "MS entry - invalid handle %d\n", | ||
1650 | pkt->handle); | ||
1651 | |||
1652 | set_bit(ISP_ABORT_NEEDED, &ha->dpc_flags); | ||
1653 | return; | ||
1654 | } | ||
1655 | |||
1656 | CMD_COMPL_STATUS(sp->cmd) = le16_to_cpu(pkt->comp_status); | ||
1657 | CMD_ENTRY_STATUS(sp->cmd) = pkt->entry_status; | ||
1658 | |||
1659 | /* Free outstanding command slot. */ | ||
1660 | ha->outstanding_cmds[pkt->handle] = NULL; | ||
1661 | |||
1662 | qla2x00_sp_compl(ha, sp); | ||
1663 | } | ||
1664 | |||
1665 | static irqreturn_t | 1575 | static irqreturn_t |
1666 | qla24xx_msix_rsp_q(int irq, void *dev_id) | 1576 | qla24xx_msix_rsp_q(int irq, void *dev_id) |
1667 | { | 1577 | { |
diff --git a/drivers/scsi/qla2xxx/qla_mid.c b/drivers/scsi/qla2xxx/qla_mid.c index 5305ec194239..9f48cd46f618 100644 --- a/drivers/scsi/qla2xxx/qla_mid.c +++ b/drivers/scsi/qla2xxx/qla_mid.c | |||
@@ -16,8 +16,6 @@ | |||
16 | #include <scsi/scsicam.h> | 16 | #include <scsi/scsicam.h> |
17 | #include <linux/delay.h> | 17 | #include <linux/delay.h> |
18 | 18 | ||
19 | void qla2x00_vp_stop_timer(scsi_qla_host_t *); | ||
20 | |||
21 | void | 19 | void |
22 | qla2x00_vp_stop_timer(scsi_qla_host_t *vha) | 20 | qla2x00_vp_stop_timer(scsi_qla_host_t *vha) |
23 | { | 21 | { |
diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c index 3d290417bfc6..c0f6f66c358f 100644 --- a/drivers/scsi/qla2xxx/qla_os.c +++ b/drivers/scsi/qla2xxx/qla_os.c | |||
@@ -26,9 +26,6 @@ char qla2x00_version_str[40]; | |||
26 | */ | 26 | */ |
27 | static struct kmem_cache *srb_cachep; | 27 | static struct kmem_cache *srb_cachep; |
28 | 28 | ||
29 | /* | ||
30 | * Ioctl related information. | ||
31 | */ | ||
32 | int num_hosts; | 29 | int num_hosts; |
33 | int ql2xlogintimeout = 20; | 30 | int ql2xlogintimeout = 20; |
34 | module_param(ql2xlogintimeout, int, S_IRUGO|S_IRUSR); | 31 | module_param(ql2xlogintimeout, int, S_IRUGO|S_IRUSR); |
@@ -105,7 +102,6 @@ static int qla2xxx_eh_abort(struct scsi_cmnd *); | |||
105 | static int qla2xxx_eh_device_reset(struct scsi_cmnd *); | 102 | static int qla2xxx_eh_device_reset(struct scsi_cmnd *); |
106 | static int qla2xxx_eh_bus_reset(struct scsi_cmnd *); | 103 | static int qla2xxx_eh_bus_reset(struct scsi_cmnd *); |
107 | static int qla2xxx_eh_host_reset(struct scsi_cmnd *); | 104 | static int qla2xxx_eh_host_reset(struct scsi_cmnd *); |
108 | static int qla2x00_device_reset(scsi_qla_host_t *, fc_port_t *); | ||
109 | 105 | ||
110 | static int qla2x00_change_queue_depth(struct scsi_device *, int); | 106 | static int qla2x00_change_queue_depth(struct scsi_device *, int); |
111 | static int qla2x00_change_queue_type(struct scsi_device *, int); | 107 | static int qla2x00_change_queue_type(struct scsi_device *, int); |
@@ -685,7 +681,6 @@ qla2xxx_eh_abort(struct scsi_cmnd *cmd) | |||
685 | 681 | ||
686 | DEBUG2(printk("%s(%ld): aborting sp %p from RISC. pid=%ld.\n", | 682 | DEBUG2(printk("%s(%ld): aborting sp %p from RISC. pid=%ld.\n", |
687 | __func__, ha->host_no, sp, serial)); | 683 | __func__, ha->host_no, sp, serial)); |
688 | DEBUG3(qla2x00_print_scsi_cmd(cmd)); | ||
689 | 684 | ||
690 | spin_unlock_irqrestore(&pha->hardware_lock, flags); | 685 | spin_unlock_irqrestore(&pha->hardware_lock, flags); |
691 | if (ha->isp_ops->abort_command(ha, sp)) { | 686 | if (ha->isp_ops->abort_command(ha, sp)) { |
@@ -814,7 +809,7 @@ qla2xxx_eh_device_reset(struct scsi_cmnd *cmd) | |||
814 | goto eh_dev_reset_done; | 809 | goto eh_dev_reset_done; |
815 | 810 | ||
816 | if (qla2x00_wait_for_loop_ready(ha) == QLA_SUCCESS) { | 811 | if (qla2x00_wait_for_loop_ready(ha) == QLA_SUCCESS) { |
817 | if (qla2x00_device_reset(ha, fcport) == 0) | 812 | if (ha->isp_ops->abort_target(fcport) == 0) |
818 | ret = SUCCESS; | 813 | ret = SUCCESS; |
819 | } else { | 814 | } else { |
820 | DEBUG2(printk(KERN_INFO | 815 | DEBUG2(printk(KERN_INFO |
@@ -1071,7 +1066,7 @@ qla2x00_loop_reset(scsi_qla_host_t *ha) | |||
1071 | if (fcport->port_type != FCT_TARGET) | 1066 | if (fcport->port_type != FCT_TARGET) |
1072 | continue; | 1067 | continue; |
1073 | 1068 | ||
1074 | ret = qla2x00_device_reset(ha, fcport); | 1069 | ret = ha->isp_ops->abort_target(fcport); |
1075 | if (ret != QLA_SUCCESS) { | 1070 | if (ret != QLA_SUCCESS) { |
1076 | DEBUG2_3(printk("%s(%ld): bus_reset failed: " | 1071 | DEBUG2_3(printk("%s(%ld): bus_reset failed: " |
1077 | "target_reset=%d d_id=%x.\n", __func__, | 1072 | "target_reset=%d d_id=%x.\n", __func__, |
@@ -1086,26 +1081,6 @@ qla2x00_loop_reset(scsi_qla_host_t *ha) | |||
1086 | return QLA_SUCCESS; | 1081 | return QLA_SUCCESS; |
1087 | } | 1082 | } |
1088 | 1083 | ||
1089 | /* | ||
1090 | * qla2x00_device_reset | ||
1091 | * Issue bus device reset message to the target. | ||
1092 | * | ||
1093 | * Input: | ||
1094 | * ha = adapter block pointer. | ||
1095 | * t = SCSI ID. | ||
1096 | * TARGET_QUEUE_LOCK must be released. | ||
1097 | * ADAPTER_STATE_LOCK must be released. | ||
1098 | * | ||
1099 | * Context: | ||
1100 | * Kernel context. | ||
1101 | */ | ||
1102 | static int | ||
1103 | qla2x00_device_reset(scsi_qla_host_t *ha, fc_port_t *reset_fcport) | ||
1104 | { | ||
1105 | /* Abort Target command will clear Reservation */ | ||
1106 | return ha->isp_ops->abort_target(reset_fcport); | ||
1107 | } | ||
1108 | |||
1109 | void | 1084 | void |
1110 | qla2x00_abort_all_cmds(scsi_qla_host_t *ha, int res) | 1085 | qla2x00_abort_all_cmds(scsi_qla_host_t *ha, int res) |
1111 | { | 1086 | { |
@@ -2378,12 +2353,6 @@ qla2x00_do_dpc(void *data) | |||
2378 | if (test_and_clear_bit(FCPORT_UPDATE_NEEDED, &ha->dpc_flags)) | 2353 | if (test_and_clear_bit(FCPORT_UPDATE_NEEDED, &ha->dpc_flags)) |
2379 | qla2x00_update_fcports(ha); | 2354 | qla2x00_update_fcports(ha); |
2380 | 2355 | ||
2381 | if (test_and_clear_bit(LOOP_RESET_NEEDED, &ha->dpc_flags)) { | ||
2382 | DEBUG(printk("scsi(%ld): dpc: sched loop_reset()\n", | ||
2383 | ha->host_no)); | ||
2384 | qla2x00_loop_reset(ha); | ||
2385 | } | ||
2386 | |||
2387 | if (test_and_clear_bit(RESET_MARKER_NEEDED, &ha->dpc_flags) && | 2356 | if (test_and_clear_bit(RESET_MARKER_NEEDED, &ha->dpc_flags) && |
2388 | (!(test_and_set_bit(RESET_ACTIVE, &ha->dpc_flags)))) { | 2357 | (!(test_and_set_bit(RESET_ACTIVE, &ha->dpc_flags)))) { |
2389 | 2358 | ||
@@ -2454,19 +2423,6 @@ qla2x00_do_dpc(void *data) | |||
2454 | ha->host_no)); | 2423 | ha->host_no)); |
2455 | } | 2424 | } |
2456 | 2425 | ||
2457 | if ((test_bit(LOGIN_RETRY_NEEDED, &ha->dpc_flags)) && | ||
2458 | atomic_read(&ha->loop_state) != LOOP_DOWN) { | ||
2459 | |||
2460 | clear_bit(LOGIN_RETRY_NEEDED, &ha->dpc_flags); | ||
2461 | DEBUG(printk("scsi(%ld): qla2x00_login_retry()\n", | ||
2462 | ha->host_no)); | ||
2463 | |||
2464 | set_bit(LOOP_RESYNC_NEEDED, &ha->dpc_flags); | ||
2465 | |||
2466 | DEBUG(printk("scsi(%ld): qla2x00_login_retry - end\n", | ||
2467 | ha->host_no)); | ||
2468 | } | ||
2469 | |||
2470 | if (test_and_clear_bit(LOOP_RESYNC_NEEDED, &ha->dpc_flags)) { | 2426 | if (test_and_clear_bit(LOOP_RESYNC_NEEDED, &ha->dpc_flags)) { |
2471 | 2427 | ||
2472 | DEBUG(printk("scsi(%ld): qla2x00_loop_resync()\n", | 2428 | DEBUG(printk("scsi(%ld): qla2x00_loop_resync()\n", |
@@ -2484,18 +2440,6 @@ qla2x00_do_dpc(void *data) | |||
2484 | ha->host_no)); | 2440 | ha->host_no)); |
2485 | } | 2441 | } |
2486 | 2442 | ||
2487 | if (test_and_clear_bit(FCPORT_RESCAN_NEEDED, &ha->dpc_flags)) { | ||
2488 | |||
2489 | DEBUG(printk("scsi(%ld): Rescan flagged fcports...\n", | ||
2490 | ha->host_no)); | ||
2491 | |||
2492 | qla2x00_rescan_fcports(ha); | ||
2493 | |||
2494 | DEBUG(printk("scsi(%ld): Rescan flagged fcports..." | ||
2495 | "end.\n", | ||
2496 | ha->host_no)); | ||
2497 | } | ||
2498 | |||
2499 | if (!ha->interrupts_on) | 2443 | if (!ha->interrupts_on) |
2500 | ha->isp_ops->enable_intrs(ha); | 2444 | ha->isp_ops->enable_intrs(ha); |
2501 | 2445 | ||
@@ -2697,10 +2641,8 @@ qla2x00_timer(scsi_qla_host_t *ha) | |||
2697 | /* Schedule the DPC routine if needed */ | 2641 | /* Schedule the DPC routine if needed */ |
2698 | if ((test_bit(ISP_ABORT_NEEDED, &ha->dpc_flags) || | 2642 | if ((test_bit(ISP_ABORT_NEEDED, &ha->dpc_flags) || |
2699 | test_bit(LOOP_RESYNC_NEEDED, &ha->dpc_flags) || | 2643 | test_bit(LOOP_RESYNC_NEEDED, &ha->dpc_flags) || |
2700 | test_bit(LOOP_RESET_NEEDED, &ha->dpc_flags) || | ||
2701 | test_bit(FCPORT_UPDATE_NEEDED, &ha->dpc_flags) || | 2644 | test_bit(FCPORT_UPDATE_NEEDED, &ha->dpc_flags) || |
2702 | start_dpc || | 2645 | start_dpc || |
2703 | test_bit(LOGIN_RETRY_NEEDED, &ha->dpc_flags) || | ||
2704 | test_bit(RESET_MARKER_NEEDED, &ha->dpc_flags) || | 2646 | test_bit(RESET_MARKER_NEEDED, &ha->dpc_flags) || |
2705 | test_bit(BEACON_BLINK_NEEDED, &ha->dpc_flags) || | 2647 | test_bit(BEACON_BLINK_NEEDED, &ha->dpc_flags) || |
2706 | test_bit(VP_DPC_NEEDED, &ha->dpc_flags) || | 2648 | test_bit(VP_DPC_NEEDED, &ha->dpc_flags) || |