[SCSI] qla2xxx: Re-factor isp_operations to static structures.

In preparation for new ISP types.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>

authored by

Andrew Vasquez and committed by
James Bottomley
fd34f556 8084fe16

+244 -196
+12 -11
drivers/scsi/qla2xxx/qla_attr.c
··· 98 99 /* Read NVRAM. */ 100 spin_lock_irqsave(&ha->hardware_lock, flags); 101 - ha->isp_ops.read_nvram(ha, (uint8_t *)buf, ha->nvram_base, 102 ha->nvram_size); 103 spin_unlock_irqrestore(&ha->hardware_lock, flags); 104 ··· 143 144 /* Write NVRAM. */ 145 spin_lock_irqsave(&ha->hardware_lock, flags); 146 - ha->isp_ops.write_nvram(ha, (uint8_t *)buf, ha->nvram_base, count); 147 spin_unlock_irqrestore(&ha->hardware_lock, flags); 148 149 set_bit(ISP_ABORT_NEEDED, &ha->dpc_flags); ··· 252 } 253 254 memset(ha->optrom_buffer, 0, ha->optrom_size); 255 - ha->isp_ops.read_optrom(ha, ha->optrom_buffer, 0, 256 ha->optrom_size); 257 break; 258 case 2: ··· 275 if (ha->optrom_state != QLA_SWRITING) 276 break; 277 278 - ha->isp_ops.write_optrom(ha, ha->optrom_buffer, 0, 279 ha->optrom_size); 280 break; 281 } ··· 305 306 /* Read NVRAM. */ 307 spin_lock_irqsave(&ha->hardware_lock, flags); 308 - ha->isp_ops.read_nvram(ha, (uint8_t *)buf, ha->vpd_base, ha->vpd_size); 309 spin_unlock_irqrestore(&ha->hardware_lock, flags); 310 311 return ha->vpd_size; ··· 326 327 /* Write NVRAM. */ 328 spin_lock_irqsave(&ha->hardware_lock, flags); 329 - ha->isp_ops.write_nvram(ha, (uint8_t *)buf, ha->vpd_base, count); 330 spin_unlock_irqrestore(&ha->hardware_lock, flags); 331 332 return count; ··· 438 } 439 440 if (ha->beacon_blink_led == 1) 441 - ha->isp_ops.beacon_off(ha); 442 } 443 444 /* Scsi_Host attributes. */ ··· 456 char fw_str[30]; 457 458 return snprintf(buf, PAGE_SIZE, "%s\n", 459 - ha->isp_ops.fw_version_str(ha, fw_str)); 460 } 461 462 static ssize_t ··· 508 char pci_info[30]; 509 510 return snprintf(buf, PAGE_SIZE, "%s\n", 511 - ha->isp_ops.pci_info_str(ha, pci_info)); 512 } 513 514 static ssize_t ··· 653 return -EINVAL; 654 655 if (val) 656 - rval = ha->isp_ops.beacon_on(ha); 657 else 658 - rval = ha->isp_ops.beacon_off(ha); 659 660 if (rval != QLA_SUCCESS) 661 count = 0;
··· 98 99 /* Read NVRAM. */ 100 spin_lock_irqsave(&ha->hardware_lock, flags); 101 + ha->isp_ops->read_nvram(ha, (uint8_t *)buf, ha->nvram_base, 102 ha->nvram_size); 103 spin_unlock_irqrestore(&ha->hardware_lock, flags); 104 ··· 143 144 /* Write NVRAM. */ 145 spin_lock_irqsave(&ha->hardware_lock, flags); 146 + ha->isp_ops->write_nvram(ha, (uint8_t *)buf, ha->nvram_base, count); 147 spin_unlock_irqrestore(&ha->hardware_lock, flags); 148 149 set_bit(ISP_ABORT_NEEDED, &ha->dpc_flags); ··· 252 } 253 254 memset(ha->optrom_buffer, 0, ha->optrom_size); 255 + ha->isp_ops->read_optrom(ha, ha->optrom_buffer, 0, 256 ha->optrom_size); 257 break; 258 case 2: ··· 275 if (ha->optrom_state != QLA_SWRITING) 276 break; 277 278 + ha->isp_ops->write_optrom(ha, ha->optrom_buffer, 0, 279 ha->optrom_size); 280 break; 281 } ··· 305 306 /* Read NVRAM. */ 307 spin_lock_irqsave(&ha->hardware_lock, flags); 308 + ha->isp_ops->read_nvram(ha, (uint8_t *)buf, ha->vpd_base, 309 + ha->vpd_size); 310 spin_unlock_irqrestore(&ha->hardware_lock, flags); 311 312 return ha->vpd_size; ··· 325 326 /* Write NVRAM. */ 327 spin_lock_irqsave(&ha->hardware_lock, flags); 328 + ha->isp_ops->write_nvram(ha, (uint8_t *)buf, ha->vpd_base, count); 329 spin_unlock_irqrestore(&ha->hardware_lock, flags); 330 331 return count; ··· 437 } 438 439 if (ha->beacon_blink_led == 1) 440 + ha->isp_ops->beacon_off(ha); 441 } 442 443 /* Scsi_Host attributes. */ ··· 455 char fw_str[30]; 456 457 return snprintf(buf, PAGE_SIZE, "%s\n", 458 + ha->isp_ops->fw_version_str(ha, fw_str)); 459 } 460 461 static ssize_t ··· 507 char pci_info[30]; 508 509 return snprintf(buf, PAGE_SIZE, "%s\n", 510 + ha->isp_ops->pci_info_str(ha, pci_info)); 511 } 512 513 static ssize_t ··· 652 return -EINVAL; 653 654 if (val) 655 + rval = ha->isp_ops->beacon_on(ha); 656 else 657 + rval = ha->isp_ops->beacon_off(ha); 658 659 if (rval != QLA_SUCCESS) 660 count = 0;
+1 -1
drivers/scsi/qla2xxx/qla_def.h
··· 2286 uint16_t rsp_ring_index; /* Current index. */ 2287 uint16_t response_q_length; 2288 2289 - struct isp_operations isp_ops; 2290 2291 /* Outstandings ISP commands. */ 2292 srb_t *outstanding_cmds[MAX_OUTSTANDING_COMMANDS];
··· 2286 uint16_t rsp_ring_index; /* Current index. */ 2287 uint16_t response_q_length; 2288 2289 + struct isp_operations *isp_ops; 2290 2291 /* Outstandings ISP commands. */ 2292 srb_t *outstanding_cmds[MAX_OUTSTANDING_COMMANDS];
+19 -14
drivers/scsi/qla2xxx/qla_gs.c
··· 180 181 /* Issue GA_NXT */ 182 /* Prepare common MS IOCB */ 183 - ms_pkt = ha->isp_ops.prep_ms_iocb(ha, GA_NXT_REQ_SIZE, GA_NXT_RSP_SIZE); 184 185 /* Prepare CT request */ 186 ct_req = qla2x00_prep_ct_req(&ha->ct_sns->p.req, GA_NXT_CMD, ··· 267 268 /* Issue GID_PT */ 269 /* Prepare common MS IOCB */ 270 - ms_pkt = ha->isp_ops.prep_ms_iocb(ha, GID_PT_REQ_SIZE, GID_PT_RSP_SIZE); 271 272 /* Prepare CT request */ 273 ct_req = qla2x00_prep_ct_req(&ha->ct_sns->p.req, GID_PT_CMD, ··· 340 for (i = 0; i < MAX_FIBRE_DEVICES; i++) { 341 /* Issue GPN_ID */ 342 /* Prepare common MS IOCB */ 343 - ms_pkt = ha->isp_ops.prep_ms_iocb(ha, GPN_ID_REQ_SIZE, 344 GPN_ID_RSP_SIZE); 345 346 /* Prepare CT request */ ··· 401 for (i = 0; i < MAX_FIBRE_DEVICES; i++) { 402 /* Issue GNN_ID */ 403 /* Prepare common MS IOCB */ 404 - ms_pkt = ha->isp_ops.prep_ms_iocb(ha, GNN_ID_REQ_SIZE, 405 GNN_ID_RSP_SIZE); 406 407 /* Prepare CT request */ ··· 475 476 /* Issue RFT_ID */ 477 /* Prepare common MS IOCB */ 478 - ms_pkt = ha->isp_ops.prep_ms_iocb(ha, RFT_ID_REQ_SIZE, RFT_ID_RSP_SIZE); 479 480 /* Prepare CT request */ 481 ct_req = qla2x00_prep_ct_req(&ha->ct_sns->p.req, RFT_ID_CMD, ··· 531 532 /* Issue RFF_ID */ 533 /* Prepare common MS IOCB */ 534 - ms_pkt = ha->isp_ops.prep_ms_iocb(ha, RFF_ID_REQ_SIZE, RFF_ID_RSP_SIZE); 535 536 /* Prepare CT request */ 537 ct_req = qla2x00_prep_ct_req(&ha->ct_sns->p.req, RFF_ID_CMD, ··· 586 587 /* Issue RNN_ID */ 588 /* Prepare common MS IOCB */ 589 - ms_pkt = ha->isp_ops.prep_ms_iocb(ha, RNN_ID_REQ_SIZE, RNN_ID_RSP_SIZE); 590 591 /* Prepare CT request */ 592 ct_req = qla2x00_prep_ct_req(&ha->ct_sns->p.req, RNN_ID_CMD, ··· 650 /* Issue RSNN_NN */ 651 /* Prepare common MS IOCB */ 652 /* Request size adjusted after CT preparation */ 653 - ms_pkt = ha->isp_ops.prep_ms_iocb(ha, 0, RSNN_NN_RSP_SIZE); 654 655 /* Prepare CT request */ 656 ct_req = qla2x00_prep_ct_req(&ha->ct_sns->p.req, RSNN_NN_CMD, ··· 1107 if (ha->flags.management_server_logged_in) 1108 return ret; 1109 1110 - ha->isp_ops.fabric_login(ha, ha->mgmt_svr_loop_id, 0xff, 0xff, 0xfa, 1111 mb, BIT_1); 1112 if (mb[0] != MBS_COMMAND_COMPLETE) { 1113 DEBUG2_13(printk("%s(%ld): Failed MANAGEMENT_SERVER login: " ··· 1258 /* Issue RHBA */ 1259 /* Prepare common MS IOCB */ 1260 /* Request size adjusted after CT preparation */ 1261 - ms_pkt = ha->isp_ops.prep_ms_fdmi_iocb(ha, 0, RHBA_RSP_SIZE); 1262 1263 /* Prepare CT request */ 1264 ct_req = qla2x00_prep_ct_fdmi_req(&ha->ct_sns->p.req, RHBA_CMD, ··· 1378 /* Firmware version */ 1379 eiter = (struct ct_fdmi_hba_attr *) (entries + size); 1380 eiter->type = __constant_cpu_to_be16(FDMI_HBA_FIRMWARE_VERSION); 1381 - ha->isp_ops.fw_version_str(ha, eiter->a.fw_version); 1382 alen = strlen(eiter->a.fw_version); 1383 alen += (alen & 3) ? (4 - (alen & 3)) : 4; 1384 eiter->len = cpu_to_be16(4 + alen); ··· 1444 1445 /* Issue RPA */ 1446 /* Prepare common MS IOCB */ 1447 - ms_pkt = ha->isp_ops.prep_ms_fdmi_iocb(ha, DHBA_REQ_SIZE, 1448 DHBA_RSP_SIZE); 1449 1450 /* Prepare CT request */ ··· 1502 /* Issue RPA */ 1503 /* Prepare common MS IOCB */ 1504 /* Request size adjusted after CT preparation */ 1505 - ms_pkt = ha->isp_ops.prep_ms_fdmi_iocb(ha, 0, RPA_RSP_SIZE); 1506 1507 /* Prepare CT request */ 1508 ct_req = qla2x00_prep_ct_fdmi_req(&ha->ct_sns->p.req, RPA_CMD, ··· 1702 memset(list[i].fabric_port_name, 0, WWN_SIZE); 1703 1704 /* Prepare common MS IOCB */ 1705 - ms_pkt = ha->isp_ops.prep_ms_iocb(ha, GFPN_ID_REQ_SIZE, 1706 GFPN_ID_RSP_SIZE); 1707 1708 /* Prepare CT request */
··· 180 181 /* Issue GA_NXT */ 182 /* Prepare common MS IOCB */ 183 + ms_pkt = ha->isp_ops->prep_ms_iocb(ha, GA_NXT_REQ_SIZE, 184 + GA_NXT_RSP_SIZE); 185 186 /* Prepare CT request */ 187 ct_req = qla2x00_prep_ct_req(&ha->ct_sns->p.req, GA_NXT_CMD, ··· 266 267 /* Issue GID_PT */ 268 /* Prepare common MS IOCB */ 269 + ms_pkt = ha->isp_ops->prep_ms_iocb(ha, GID_PT_REQ_SIZE, 270 + GID_PT_RSP_SIZE); 271 272 /* Prepare CT request */ 273 ct_req = qla2x00_prep_ct_req(&ha->ct_sns->p.req, GID_PT_CMD, ··· 338 for (i = 0; i < MAX_FIBRE_DEVICES; i++) { 339 /* Issue GPN_ID */ 340 /* Prepare common MS IOCB */ 341 + ms_pkt = ha->isp_ops->prep_ms_iocb(ha, GPN_ID_REQ_SIZE, 342 GPN_ID_RSP_SIZE); 343 344 /* Prepare CT request */ ··· 399 for (i = 0; i < MAX_FIBRE_DEVICES; i++) { 400 /* Issue GNN_ID */ 401 /* Prepare common MS IOCB */ 402 + ms_pkt = ha->isp_ops->prep_ms_iocb(ha, GNN_ID_REQ_SIZE, 403 GNN_ID_RSP_SIZE); 404 405 /* Prepare CT request */ ··· 473 474 /* Issue RFT_ID */ 475 /* Prepare common MS IOCB */ 476 + ms_pkt = ha->isp_ops->prep_ms_iocb(ha, RFT_ID_REQ_SIZE, 477 + RFT_ID_RSP_SIZE); 478 479 /* Prepare CT request */ 480 ct_req = qla2x00_prep_ct_req(&ha->ct_sns->p.req, RFT_ID_CMD, ··· 528 529 /* Issue RFF_ID */ 530 /* Prepare common MS IOCB */ 531 + ms_pkt = ha->isp_ops->prep_ms_iocb(ha, RFF_ID_REQ_SIZE, 532 + RFF_ID_RSP_SIZE); 533 534 /* Prepare CT request */ 535 ct_req = qla2x00_prep_ct_req(&ha->ct_sns->p.req, RFF_ID_CMD, ··· 582 583 /* Issue RNN_ID */ 584 /* Prepare common MS IOCB */ 585 + ms_pkt = ha->isp_ops->prep_ms_iocb(ha, RNN_ID_REQ_SIZE, 586 + RNN_ID_RSP_SIZE); 587 588 /* Prepare CT request */ 589 ct_req = qla2x00_prep_ct_req(&ha->ct_sns->p.req, RNN_ID_CMD, ··· 645 /* Issue RSNN_NN */ 646 /* Prepare common MS IOCB */ 647 /* Request size adjusted after CT preparation */ 648 + ms_pkt = ha->isp_ops->prep_ms_iocb(ha, 0, RSNN_NN_RSP_SIZE); 649 650 /* Prepare CT request */ 651 ct_req = qla2x00_prep_ct_req(&ha->ct_sns->p.req, RSNN_NN_CMD, ··· 1102 if (ha->flags.management_server_logged_in) 1103 return ret; 1104 1105 + ha->isp_ops->fabric_login(ha, ha->mgmt_svr_loop_id, 0xff, 0xff, 0xfa, 1106 mb, BIT_1); 1107 if (mb[0] != MBS_COMMAND_COMPLETE) { 1108 DEBUG2_13(printk("%s(%ld): Failed MANAGEMENT_SERVER login: " ··· 1253 /* Issue RHBA */ 1254 /* Prepare common MS IOCB */ 1255 /* Request size adjusted after CT preparation */ 1256 + ms_pkt = ha->isp_ops->prep_ms_fdmi_iocb(ha, 0, RHBA_RSP_SIZE); 1257 1258 /* Prepare CT request */ 1259 ct_req = qla2x00_prep_ct_fdmi_req(&ha->ct_sns->p.req, RHBA_CMD, ··· 1373 /* Firmware version */ 1374 eiter = (struct ct_fdmi_hba_attr *) (entries + size); 1375 eiter->type = __constant_cpu_to_be16(FDMI_HBA_FIRMWARE_VERSION); 1376 + ha->isp_ops->fw_version_str(ha, eiter->a.fw_version); 1377 alen = strlen(eiter->a.fw_version); 1378 alen += (alen & 3) ? (4 - (alen & 3)) : 4; 1379 eiter->len = cpu_to_be16(4 + alen); ··· 1439 1440 /* Issue RPA */ 1441 /* Prepare common MS IOCB */ 1442 + ms_pkt = ha->isp_ops->prep_ms_fdmi_iocb(ha, DHBA_REQ_SIZE, 1443 DHBA_RSP_SIZE); 1444 1445 /* Prepare CT request */ ··· 1497 /* Issue RPA */ 1498 /* Prepare common MS IOCB */ 1499 /* Request size adjusted after CT preparation */ 1500 + ms_pkt = ha->isp_ops->prep_ms_fdmi_iocb(ha, 0, RPA_RSP_SIZE); 1501 1502 /* Prepare CT request */ 1503 ct_req = qla2x00_prep_ct_fdmi_req(&ha->ct_sns->p.req, RPA_CMD, ··· 1697 memset(list[i].fabric_port_name, 0, WWN_SIZE); 1698 1699 /* Prepare common MS IOCB */ 1700 + ms_pkt = ha->isp_ops->prep_ms_iocb(ha, GFPN_ID_REQ_SIZE, 1701 GFPN_ID_RSP_SIZE); 1702 1703 /* Prepare CT request */
+27 -27
drivers/scsi/qla2xxx/qla_init.c
··· 79 set_bit(REGISTER_FDMI_NEEDED, &ha->dpc_flags); 80 81 qla_printk(KERN_INFO, ha, "Configuring PCI space...\n"); 82 - rval = ha->isp_ops.pci_config(ha); 83 if (rval) { 84 DEBUG2(printk("scsi(%ld): Unable to configure PCI space.\n", 85 ha->host_no)); 86 return (rval); 87 } 88 89 - ha->isp_ops.reset_chip(ha); 90 91 - ha->isp_ops.get_flash_version(ha, ha->request_ring); 92 93 qla_printk(KERN_INFO, ha, "Configure NVRAM parameters...\n"); 94 95 - ha->isp_ops.nvram_config(ha); 96 97 if (ha->flags.disable_serdes) { 98 /* Mask HBA via NVRAM settings? */ ··· 108 qla_printk(KERN_INFO, ha, "Verifying loaded RISC code...\n"); 109 110 if (qla2x00_isp_firmware(ha) != QLA_SUCCESS) { 111 - rval = ha->isp_ops.chip_diag(ha); 112 if (rval) 113 return (rval); 114 rval = qla2x00_setup_chip(ha); ··· 351 uint32_t cnt; 352 uint16_t cmd; 353 354 - ha->isp_ops.disable_intrs(ha); 355 356 spin_lock_irqsave(&ha->hardware_lock, flags); 357 ··· 551 void 552 qla24xx_reset_chip(scsi_qla_host_t *ha) 553 { 554 - ha->isp_ops.disable_intrs(ha); 555 556 /* Perform RISC reset. */ 557 qla24xx_reset_risc(ha); ··· 879 uint32_t srisc_address = 0; 880 881 /* Load firmware sequences */ 882 - rval = ha->isp_ops.load_risc(ha, &srisc_address); 883 if (rval == QLA_SUCCESS) { 884 DEBUG(printk("scsi(%ld): Verifying Checksum of loaded RISC " 885 "code.\n", ha->host_no)); ··· 1130 /* Initialize response queue entries */ 1131 qla2x00_init_response_q_entries(ha); 1132 1133 - ha->isp_ops.config_rings(ha); 1134 1135 spin_unlock_irqrestore(&ha->hardware_lock, flags); 1136 1137 /* Update any ISP specific firmware options before initialization. */ 1138 - ha->isp_ops.update_fw_options(ha); 1139 1140 DEBUG(printk("scsi(%ld): Issue init firmware.\n", ha->host_no)); 1141 ··· 1459 ha->nvram_base = 0x80; 1460 1461 /* Get NVRAM data and calculate checksum. */ 1462 - ha->isp_ops.read_nvram(ha, ptr, ha->nvram_base, ha->nvram_size); 1463 for (cnt = 0, chksum = 0; cnt < ha->nvram_size; cnt++) 1464 chksum += *ptr++; 1465 ··· 2298 loop_id = NPH_SNS; 2299 else 2300 loop_id = SIMPLE_NAME_SERVER; 2301 - ha->isp_ops.fabric_login(ha, loop_id, 0xff, 0xff, 2302 0xfc, mb, BIT_1 | BIT_0); 2303 if (mb[0] != MBS_COMMAND_COMPLETE) { 2304 DEBUG2(qla_printk(KERN_INFO, ha, ··· 2355 (fcport->flags & FCF_TAPE_PRESENT) == 0 && 2356 fcport->port_type != FCT_INITIATOR && 2357 fcport->port_type != FCT_BROADCAST) { 2358 - ha->isp_ops.fabric_logout(ha, 2359 fcport->loop_id, 2360 fcport->d_id.b.domain, 2361 fcport->d_id.b.area, ··· 2664 (fcport->flags & FCF_TAPE_PRESENT) == 0 && 2665 fcport->port_type != FCT_INITIATOR && 2666 fcport->port_type != FCT_BROADCAST) { 2667 - ha->isp_ops.fabric_logout(ha, fcport->loop_id, 2668 fcport->d_id.b.domain, fcport->d_id.b.area, 2669 fcport->d_id.b.al_pa); 2670 fcport->loop_id = FC_NO_LOOP_ID; ··· 2919 opts |= BIT_1; 2920 rval = qla2x00_get_port_database(ha, fcport, opts); 2921 if (rval != QLA_SUCCESS) { 2922 - ha->isp_ops.fabric_logout(ha, fcport->loop_id, 2923 fcport->d_id.b.domain, fcport->d_id.b.area, 2924 fcport->d_id.b.al_pa); 2925 qla2x00_mark_device_lost(ha, fcport, 1, 0); ··· 2964 fcport->d_id.b.area, fcport->d_id.b.al_pa)); 2965 2966 /* Login fcport on switch. */ 2967 - ha->isp_ops.fabric_login(ha, fcport->loop_id, 2968 fcport->d_id.b.domain, fcport->d_id.b.area, 2969 fcport->d_id.b.al_pa, mb, BIT_0); 2970 if (mb[0] == MBS_PORT_ID_USED) { ··· 3032 * dead. 3033 */ 3034 *next_loopid = fcport->loop_id; 3035 - ha->isp_ops.fabric_logout(ha, fcport->loop_id, 3036 fcport->d_id.b.domain, fcport->d_id.b.area, 3037 fcport->d_id.b.al_pa); 3038 qla2x00_mark_device_lost(ha, fcport, 1, 0); ··· 3050 fcport->d_id.b.al_pa, fcport->loop_id, jiffies)); 3051 3052 *next_loopid = fcport->loop_id; 3053 - ha->isp_ops.fabric_logout(ha, fcport->loop_id, 3054 fcport->d_id.b.domain, fcport->d_id.b.area, 3055 fcport->d_id.b.al_pa); 3056 fcport->loop_id = FC_NO_LOOP_ID; ··· 3206 3207 qla_printk(KERN_INFO, ha, 3208 "Performing ISP error recovery - ha= %p.\n", ha); 3209 - ha->isp_ops.reset_chip(ha); 3210 3211 atomic_set(&ha->loop_down_timer, LOOP_DOWN_TIME); 3212 if (atomic_read(&ha->loop_state) != LOOP_DOWN) { ··· 3232 } 3233 spin_unlock_irqrestore(&ha->hardware_lock, flags); 3234 3235 - ha->isp_ops.get_flash_version(ha, ha->request_ring); 3236 3237 - ha->isp_ops.nvram_config(ha); 3238 3239 if (!qla2x00_restart_isp(ha)) { 3240 clear_bit(RESET_MARKER_NEEDED, &ha->dpc_flags); ··· 3249 3250 ha->flags.online = 1; 3251 3252 - ha->isp_ops.enable_intrs(ha); 3253 3254 ha->isp_abort_cnt = 0; 3255 clear_bit(ISP_ABORT_RETRY, &ha->dpc_flags); ··· 3274 * The next call disables the board 3275 * completely. 3276 */ 3277 - ha->isp_ops.reset_adapter(ha); 3278 ha->flags.online = 0; 3279 clear_bit(ISP_ABORT_RETRY, 3280 &ha->dpc_flags); ··· 3331 /* If firmware needs to be loaded */ 3332 if (qla2x00_isp_firmware(ha)) { 3333 ha->flags.online = 0; 3334 - if (!(status = ha->isp_ops.chip_diag(ha))) { 3335 if (IS_QLA2100(ha) || IS_QLA2200(ha)) { 3336 status = qla2x00_setup_chip(ha); 3337 goto done; ··· 3423 struct device_reg_2xxx __iomem *reg = &ha->iobase->isp; 3424 3425 ha->flags.online = 0; 3426 - ha->isp_ops.disable_intrs(ha); 3427 3428 spin_lock_irqsave(&ha->hardware_lock, flags); 3429 WRT_REG_WORD(&reg->hccr, HCCR_RESET_RISC); ··· 3440 struct device_reg_24xx __iomem *reg = &ha->iobase->isp24; 3441 3442 ha->flags.online = 0; 3443 - ha->isp_ops.disable_intrs(ha); 3444 3445 spin_lock_irqsave(&ha->hardware_lock, flags); 3446 WRT_REG_DWORD(&reg->hccr, HCCRX_SET_RISC_RESET); ··· 3498 3499 /* Get NVRAM data and calculate checksum. */ 3500 dptr = (uint32_t *)nv; 3501 - ha->isp_ops.read_nvram(ha, (uint8_t *)dptr, ha->nvram_base, 3502 ha->nvram_size); 3503 for (cnt = 0, chksum = 0; cnt < ha->nvram_size >> 2; cnt++) 3504 chksum += le32_to_cpu(*dptr++);
··· 79 set_bit(REGISTER_FDMI_NEEDED, &ha->dpc_flags); 80 81 qla_printk(KERN_INFO, ha, "Configuring PCI space...\n"); 82 + rval = ha->isp_ops->pci_config(ha); 83 if (rval) { 84 DEBUG2(printk("scsi(%ld): Unable to configure PCI space.\n", 85 ha->host_no)); 86 return (rval); 87 } 88 89 + ha->isp_ops->reset_chip(ha); 90 91 + ha->isp_ops->get_flash_version(ha, ha->request_ring); 92 93 qla_printk(KERN_INFO, ha, "Configure NVRAM parameters...\n"); 94 95 + ha->isp_ops->nvram_config(ha); 96 97 if (ha->flags.disable_serdes) { 98 /* Mask HBA via NVRAM settings? */ ··· 108 qla_printk(KERN_INFO, ha, "Verifying loaded RISC code...\n"); 109 110 if (qla2x00_isp_firmware(ha) != QLA_SUCCESS) { 111 + rval = ha->isp_ops->chip_diag(ha); 112 if (rval) 113 return (rval); 114 rval = qla2x00_setup_chip(ha); ··· 351 uint32_t cnt; 352 uint16_t cmd; 353 354 + ha->isp_ops->disable_intrs(ha); 355 356 spin_lock_irqsave(&ha->hardware_lock, flags); 357 ··· 551 void 552 qla24xx_reset_chip(scsi_qla_host_t *ha) 553 { 554 + ha->isp_ops->disable_intrs(ha); 555 556 /* Perform RISC reset. */ 557 qla24xx_reset_risc(ha); ··· 879 uint32_t srisc_address = 0; 880 881 /* Load firmware sequences */ 882 + rval = ha->isp_ops->load_risc(ha, &srisc_address); 883 if (rval == QLA_SUCCESS) { 884 DEBUG(printk("scsi(%ld): Verifying Checksum of loaded RISC " 885 "code.\n", ha->host_no)); ··· 1130 /* Initialize response queue entries */ 1131 qla2x00_init_response_q_entries(ha); 1132 1133 + ha->isp_ops->config_rings(ha); 1134 1135 spin_unlock_irqrestore(&ha->hardware_lock, flags); 1136 1137 /* Update any ISP specific firmware options before initialization. */ 1138 + ha->isp_ops->update_fw_options(ha); 1139 1140 DEBUG(printk("scsi(%ld): Issue init firmware.\n", ha->host_no)); 1141 ··· 1459 ha->nvram_base = 0x80; 1460 1461 /* Get NVRAM data and calculate checksum. */ 1462 + ha->isp_ops->read_nvram(ha, ptr, ha->nvram_base, ha->nvram_size); 1463 for (cnt = 0, chksum = 0; cnt < ha->nvram_size; cnt++) 1464 chksum += *ptr++; 1465 ··· 2298 loop_id = NPH_SNS; 2299 else 2300 loop_id = SIMPLE_NAME_SERVER; 2301 + ha->isp_ops->fabric_login(ha, loop_id, 0xff, 0xff, 2302 0xfc, mb, BIT_1 | BIT_0); 2303 if (mb[0] != MBS_COMMAND_COMPLETE) { 2304 DEBUG2(qla_printk(KERN_INFO, ha, ··· 2355 (fcport->flags & FCF_TAPE_PRESENT) == 0 && 2356 fcport->port_type != FCT_INITIATOR && 2357 fcport->port_type != FCT_BROADCAST) { 2358 + ha->isp_ops->fabric_logout(ha, 2359 fcport->loop_id, 2360 fcport->d_id.b.domain, 2361 fcport->d_id.b.area, ··· 2664 (fcport->flags & FCF_TAPE_PRESENT) == 0 && 2665 fcport->port_type != FCT_INITIATOR && 2666 fcport->port_type != FCT_BROADCAST) { 2667 + ha->isp_ops->fabric_logout(ha, fcport->loop_id, 2668 fcport->d_id.b.domain, fcport->d_id.b.area, 2669 fcport->d_id.b.al_pa); 2670 fcport->loop_id = FC_NO_LOOP_ID; ··· 2919 opts |= BIT_1; 2920 rval = qla2x00_get_port_database(ha, fcport, opts); 2921 if (rval != QLA_SUCCESS) { 2922 + ha->isp_ops->fabric_logout(ha, fcport->loop_id, 2923 fcport->d_id.b.domain, fcport->d_id.b.area, 2924 fcport->d_id.b.al_pa); 2925 qla2x00_mark_device_lost(ha, fcport, 1, 0); ··· 2964 fcport->d_id.b.area, fcport->d_id.b.al_pa)); 2965 2966 /* Login fcport on switch. */ 2967 + ha->isp_ops->fabric_login(ha, fcport->loop_id, 2968 fcport->d_id.b.domain, fcport->d_id.b.area, 2969 fcport->d_id.b.al_pa, mb, BIT_0); 2970 if (mb[0] == MBS_PORT_ID_USED) { ··· 3032 * dead. 3033 */ 3034 *next_loopid = fcport->loop_id; 3035 + ha->isp_ops->fabric_logout(ha, fcport->loop_id, 3036 fcport->d_id.b.domain, fcport->d_id.b.area, 3037 fcport->d_id.b.al_pa); 3038 qla2x00_mark_device_lost(ha, fcport, 1, 0); ··· 3050 fcport->d_id.b.al_pa, fcport->loop_id, jiffies)); 3051 3052 *next_loopid = fcport->loop_id; 3053 + ha->isp_ops->fabric_logout(ha, fcport->loop_id, 3054 fcport->d_id.b.domain, fcport->d_id.b.area, 3055 fcport->d_id.b.al_pa); 3056 fcport->loop_id = FC_NO_LOOP_ID; ··· 3206 3207 qla_printk(KERN_INFO, ha, 3208 "Performing ISP error recovery - ha= %p.\n", ha); 3209 + ha->isp_ops->reset_chip(ha); 3210 3211 atomic_set(&ha->loop_down_timer, LOOP_DOWN_TIME); 3212 if (atomic_read(&ha->loop_state) != LOOP_DOWN) { ··· 3232 } 3233 spin_unlock_irqrestore(&ha->hardware_lock, flags); 3234 3235 + ha->isp_ops->get_flash_version(ha, ha->request_ring); 3236 3237 + ha->isp_ops->nvram_config(ha); 3238 3239 if (!qla2x00_restart_isp(ha)) { 3240 clear_bit(RESET_MARKER_NEEDED, &ha->dpc_flags); ··· 3249 3250 ha->flags.online = 1; 3251 3252 + ha->isp_ops->enable_intrs(ha); 3253 3254 ha->isp_abort_cnt = 0; 3255 clear_bit(ISP_ABORT_RETRY, &ha->dpc_flags); ··· 3274 * The next call disables the board 3275 * completely. 3276 */ 3277 + ha->isp_ops->reset_adapter(ha); 3278 ha->flags.online = 0; 3279 clear_bit(ISP_ABORT_RETRY, 3280 &ha->dpc_flags); ··· 3331 /* If firmware needs to be loaded */ 3332 if (qla2x00_isp_firmware(ha)) { 3333 ha->flags.online = 0; 3334 + if (!(status = ha->isp_ops->chip_diag(ha))) { 3335 if (IS_QLA2100(ha) || IS_QLA2200(ha)) { 3336 status = qla2x00_setup_chip(ha); 3337 goto done; ··· 3423 struct device_reg_2xxx __iomem *reg = &ha->iobase->isp; 3424 3425 ha->flags.online = 0; 3426 + ha->isp_ops->disable_intrs(ha); 3427 3428 spin_lock_irqsave(&ha->hardware_lock, flags); 3429 WRT_REG_WORD(&reg->hccr, HCCR_RESET_RISC); ··· 3440 struct device_reg_24xx __iomem *reg = &ha->iobase->isp24; 3441 3442 ha->flags.online = 0; 3443 + ha->isp_ops->disable_intrs(ha); 3444 3445 spin_lock_irqsave(&ha->hardware_lock, flags); 3446 WRT_REG_DWORD(&reg->hccr, HCCRX_SET_RISC_RESET); ··· 3498 3499 /* Get NVRAM data and calculate checksum. */ 3500 dptr = (uint32_t *)nv; 3501 + ha->isp_ops->read_nvram(ha, (uint8_t *)dptr, ha->nvram_base, 3502 ha->nvram_size); 3503 for (cnt = 0, chksum = 0; cnt < ha->nvram_size >> 2; cnt++) 3504 chksum += le32_to_cpu(*dptr++);
+1 -1
drivers/scsi/qla2xxx/qla_inline.h
··· 104 static inline void 105 qla2x00_poll(scsi_qla_host_t *ha) 106 { 107 - ha->isp_ops.intr_handler(0, ha); 108 } 109 110 static __inline__ void qla2x00_check_fabric_devices(scsi_qla_host_t *);
··· 104 static inline void 105 qla2x00_poll(scsi_qla_host_t *ha) 106 { 107 + ha->isp_ops->intr_handler(0, ha); 108 } 109 110 static __inline__ void qla2x00_check_fabric_devices(scsi_qla_host_t *);
+2 -2
drivers/scsi/qla2xxx/qla_iocb.c
··· 326 tot_dsds = nseg; 327 328 /* Calculate the number of request entries needed. */ 329 - req_cnt = ha->isp_ops.calc_req_entries(tot_dsds); 330 if (ha->req_q_cnt < (req_cnt + 2)) { 331 cnt = RD_REG_WORD_RELAXED(ISP_REQ_Q_OUT(ha, reg)); 332 if (ha->req_ring_index < cnt) ··· 364 cmd_pkt->byte_count = cpu_to_le32((uint32_t)scsi_bufflen(cmd)); 365 366 /* Build IOCB segments */ 367 - ha->isp_ops.build_iocbs(sp, cmd_pkt, tot_dsds); 368 369 /* Set total data segment count. */ 370 cmd_pkt->entry_count = (uint8_t)req_cnt;
··· 326 tot_dsds = nseg; 327 328 /* Calculate the number of request entries needed. */ 329 + req_cnt = ha->isp_ops->calc_req_entries(tot_dsds); 330 if (ha->req_q_cnt < (req_cnt + 2)) { 331 cnt = RD_REG_WORD_RELAXED(ISP_REQ_Q_OUT(ha, reg)); 332 if (ha->req_ring_index < cnt) ··· 364 cmd_pkt->byte_count = cpu_to_le32((uint32_t)scsi_bufflen(cmd)); 365 366 /* Build IOCB segments */ 367 + ha->isp_ops->build_iocbs(sp, cmd_pkt, tot_dsds); 368 369 /* Set total data segment count. */ 370 cmd_pkt->entry_count = (uint8_t)req_cnt;
+5 -5
drivers/scsi/qla2xxx/qla_isr.c
··· 143 WRT_REG_WORD(&reg->hccr, HCCR_RESET_RISC); 144 RD_REG_WORD(&reg->hccr); 145 146 - ha->isp_ops.fw_dump(ha, 1); 147 set_bit(ISP_ABORT_NEEDED, &ha->dpc_flags); 148 break; 149 } else if ((stat & HSR_RISC_INT) == 0) ··· 334 "ISP System Error - mbx1=%xh mbx2=%xh mbx3=%xh.\n", 335 mb[1], mb[2], mb[3]); 336 337 - ha->isp_ops.fw_dump(ha, 1); 338 339 if (IS_FWI2_CAPABLE(ha)) { 340 if (mb[1] == 0 && mb[2] == 0) { ··· 1502 1503 qla_printk(KERN_INFO, ha, "RISC paused -- HCCR=%x, " 1504 "Dumping firmware!\n", hccr); 1505 - ha->isp_ops.fw_dump(ha, 1); 1506 set_bit(ISP_ABORT_NEEDED, &ha->dpc_flags); 1507 break; 1508 } else if ((stat & HSRX_RISC_INT) == 0) ··· 1636 1637 qla_printk(KERN_INFO, ha, "RISC paused -- HCCR=%x, " 1638 "Dumping firmware!\n", hccr); 1639 - ha->isp_ops.fw_dump(ha, 1); 1640 set_bit(ISP_ABORT_NEEDED, &ha->dpc_flags); 1641 break; 1642 } else if ((stat & HSRX_RISC_INT) == 0) ··· 1791 } 1792 skip_msi: 1793 1794 - ret = request_irq(ha->pdev->irq, ha->isp_ops.intr_handler, 1795 IRQF_DISABLED|IRQF_SHARED, QLA2XXX_DRIVER_NAME, ha); 1796 if (!ret) { 1797 ha->flags.inta_enabled = 1;
··· 143 WRT_REG_WORD(&reg->hccr, HCCR_RESET_RISC); 144 RD_REG_WORD(&reg->hccr); 145 146 + ha->isp_ops->fw_dump(ha, 1); 147 set_bit(ISP_ABORT_NEEDED, &ha->dpc_flags); 148 break; 149 } else if ((stat & HSR_RISC_INT) == 0) ··· 334 "ISP System Error - mbx1=%xh mbx2=%xh mbx3=%xh.\n", 335 mb[1], mb[2], mb[3]); 336 337 + ha->isp_ops->fw_dump(ha, 1); 338 339 if (IS_FWI2_CAPABLE(ha)) { 340 if (mb[1] == 0 && mb[2] == 0) { ··· 1502 1503 qla_printk(KERN_INFO, ha, "RISC paused -- HCCR=%x, " 1504 "Dumping firmware!\n", hccr); 1505 + ha->isp_ops->fw_dump(ha, 1); 1506 set_bit(ISP_ABORT_NEEDED, &ha->dpc_flags); 1507 break; 1508 } else if ((stat & HSRX_RISC_INT) == 0) ··· 1636 1637 qla_printk(KERN_INFO, ha, "RISC paused -- HCCR=%x, " 1638 "Dumping firmware!\n", hccr); 1639 + ha->isp_ops->fw_dump(ha, 1); 1640 set_bit(ISP_ABORT_NEEDED, &ha->dpc_flags); 1641 break; 1642 } else if ((stat & HSRX_RISC_INT) == 0) ··· 1791 } 1792 skip_msi: 1793 1794 + ret = request_irq(ha->pdev->irq, ha->isp_ops->intr_handler, 1795 IRQF_DISABLED|IRQF_SHARED, QLA2XXX_DRIVER_NAME, ha); 1796 if (!ret) { 1797 ha->flags.inta_enabled = 1;
+171 -129
drivers/scsi/qla2xxx/qla_os.c
··· 681 DEBUG3(qla2x00_print_scsi_cmd(cmd)); 682 683 spin_unlock_irqrestore(&pha->hardware_lock, flags); 684 - if (ha->isp_ops.abort_command(ha, sp)) { 685 DEBUG2(printk("%s(%ld): abort_command " 686 "mbx failed.\n", __func__, ha->host_no)); 687 } else { ··· 813 #if defined(LOGOUT_AFTER_DEVICE_RESET) 814 if (ret == SUCCESS) { 815 if (fcport->flags & FC_FABRIC_DEVICE) { 816 - ha->isp_ops.fabric_logout(ha, fcport->loop_id); 817 qla2x00_mark_device_lost(ha, fcport, 0, 0); 818 } 819 } ··· 1105 qla2x00_device_reset(scsi_qla_host_t *ha, fc_port_t *reset_fcport) 1106 { 1107 /* Abort Target command will clear Reservation */ 1108 - return ha->isp_ops.abort_target(reset_fcport); 1109 } 1110 1111 static int ··· 1184 !pci_set_consistent_dma_mask(ha->pdev, DMA_64BIT_MASK)) { 1185 /* Ok, a 64bit DMA mask is applicable. */ 1186 ha->flags.enable_64bit_addressing = 1; 1187 - ha->isp_ops.calc_req_entries = qla2x00_calc_iocbs_64; 1188 - ha->isp_ops.build_iocbs = qla2x00_build_scsi_iocbs_64; 1189 return; 1190 } 1191 } ··· 1193 dma_set_mask(&ha->pdev->dev, DMA_32BIT_MASK); 1194 pci_set_consistent_dma_mask(ha->pdev, DMA_32BIT_MASK); 1195 } 1196 1197 static inline void 1198 qla2x00_set_isp_flags(scsi_qla_host_t *ha) ··· 1483 } 1484 1485 static void 1486 - qla2x00_enable_intrs(scsi_qla_host_t *ha) 1487 - { 1488 - unsigned long flags = 0; 1489 - struct device_reg_2xxx __iomem *reg = &ha->iobase->isp; 1490 - 1491 - spin_lock_irqsave(&ha->hardware_lock, flags); 1492 - ha->interrupts_on = 1; 1493 - /* enable risc and host interrupts */ 1494 - WRT_REG_WORD(&reg->ictrl, ICR_EN_INT | ICR_EN_RISC); 1495 - RD_REG_WORD(&reg->ictrl); 1496 - spin_unlock_irqrestore(&ha->hardware_lock, flags); 1497 - 1498 - } 1499 - 1500 - static void 1501 - qla2x00_disable_intrs(scsi_qla_host_t *ha) 1502 - { 1503 - unsigned long flags = 0; 1504 - struct device_reg_2xxx __iomem *reg = &ha->iobase->isp; 1505 - 1506 - spin_lock_irqsave(&ha->hardware_lock, flags); 1507 - ha->interrupts_on = 0; 1508 - /* disable risc and host interrupts */ 1509 - WRT_REG_WORD(&reg->ictrl, 0); 1510 - RD_REG_WORD(&reg->ictrl); 1511 - spin_unlock_irqrestore(&ha->hardware_lock, flags); 1512 - } 1513 - 1514 - static void 1515 - qla24xx_enable_intrs(scsi_qla_host_t *ha) 1516 - { 1517 - unsigned long flags = 0; 1518 - struct device_reg_24xx __iomem *reg = &ha->iobase->isp24; 1519 - 1520 - spin_lock_irqsave(&ha->hardware_lock, flags); 1521 - ha->interrupts_on = 1; 1522 - WRT_REG_DWORD(&reg->ictrl, ICRX_EN_RISC_INT); 1523 - RD_REG_DWORD(&reg->ictrl); 1524 - spin_unlock_irqrestore(&ha->hardware_lock, flags); 1525 - } 1526 - 1527 - static void 1528 - qla24xx_disable_intrs(scsi_qla_host_t *ha) 1529 - { 1530 - unsigned long flags = 0; 1531 - struct device_reg_24xx __iomem *reg = &ha->iobase->isp24; 1532 - 1533 - spin_lock_irqsave(&ha->hardware_lock, flags); 1534 - ha->interrupts_on = 0; 1535 - WRT_REG_DWORD(&reg->ictrl, 0); 1536 - RD_REG_DWORD(&reg->ictrl); 1537 - spin_unlock_irqrestore(&ha->hardware_lock, flags); 1538 - } 1539 - 1540 - static void 1541 qla2xxx_scan_start(struct Scsi_Host *shost) 1542 { 1543 scsi_qla_host_t *ha = (scsi_qla_host_t *)shost->hostdata; ··· 1571 ha->max_q_depth = ql2xmaxqdepth; 1572 1573 /* Assign ISP specific operations. */ 1574 - ha->isp_ops.pci_config = qla2100_pci_config; 1575 - ha->isp_ops.reset_chip = qla2x00_reset_chip; 1576 - ha->isp_ops.chip_diag = qla2x00_chip_diag; 1577 - ha->isp_ops.config_rings = qla2x00_config_rings; 1578 - ha->isp_ops.reset_adapter = qla2x00_reset_adapter; 1579 - ha->isp_ops.nvram_config = qla2x00_nvram_config; 1580 - ha->isp_ops.update_fw_options = qla2x00_update_fw_options; 1581 - ha->isp_ops.load_risc = qla2x00_load_risc; 1582 - ha->isp_ops.pci_info_str = qla2x00_pci_info_str; 1583 - ha->isp_ops.fw_version_str = qla2x00_fw_version_str; 1584 - ha->isp_ops.intr_handler = qla2100_intr_handler; 1585 - ha->isp_ops.enable_intrs = qla2x00_enable_intrs; 1586 - ha->isp_ops.disable_intrs = qla2x00_disable_intrs; 1587 - ha->isp_ops.abort_command = qla2x00_abort_command; 1588 - ha->isp_ops.abort_target = qla2x00_abort_target; 1589 - ha->isp_ops.fabric_login = qla2x00_login_fabric; 1590 - ha->isp_ops.fabric_logout = qla2x00_fabric_logout; 1591 - ha->isp_ops.calc_req_entries = qla2x00_calc_iocbs_32; 1592 - ha->isp_ops.build_iocbs = qla2x00_build_scsi_iocbs_32; 1593 - ha->isp_ops.prep_ms_iocb = qla2x00_prep_ms_iocb; 1594 - ha->isp_ops.prep_ms_fdmi_iocb = qla2x00_prep_ms_fdmi_iocb; 1595 - ha->isp_ops.read_nvram = qla2x00_read_nvram_data; 1596 - ha->isp_ops.write_nvram = qla2x00_write_nvram_data; 1597 - ha->isp_ops.fw_dump = qla2100_fw_dump; 1598 - ha->isp_ops.read_optrom = qla2x00_read_optrom_data; 1599 - ha->isp_ops.write_optrom = qla2x00_write_optrom_data; 1600 - ha->isp_ops.get_flash_version = qla2x00_get_flash_version; 1601 if (IS_QLA2100(ha)) { 1602 host->max_id = MAX_TARGETS_2100; 1603 ha->mbx_count = MAILBOX_REGISTER_COUNT_2100; ··· 1579 ha->last_loop_id = SNS_LAST_LOOP_ID_2100; 1580 host->sg_tablesize = 32; 1581 ha->gid_list_info_size = 4; 1582 } else if (IS_QLA2200(ha)) { 1583 host->max_id = MAX_TARGETS_2200; 1584 ha->mbx_count = MAILBOX_REGISTER_COUNT; ··· 1587 ha->response_q_length = RESPONSE_ENTRY_CNT_2100; 1588 ha->last_loop_id = SNS_LAST_LOOP_ID_2100; 1589 ha->gid_list_info_size = 4; 1590 } else if (IS_QLA23XX(ha)) { 1591 host->max_id = MAX_TARGETS_2200; 1592 ha->mbx_count = MAILBOX_REGISTER_COUNT; 1593 ha->request_q_length = REQUEST_ENTRY_CNT_2200; 1594 ha->response_q_length = RESPONSE_ENTRY_CNT_2300; 1595 ha->last_loop_id = SNS_LAST_LOOP_ID_2300; 1596 - ha->isp_ops.pci_config = qla2300_pci_config; 1597 - ha->isp_ops.intr_handler = qla2300_intr_handler; 1598 - ha->isp_ops.fw_dump = qla2300_fw_dump; 1599 - ha->isp_ops.beacon_on = qla2x00_beacon_on; 1600 - ha->isp_ops.beacon_off = qla2x00_beacon_off; 1601 - ha->isp_ops.beacon_blink = qla2x00_beacon_blink; 1602 ha->gid_list_info_size = 6; 1603 if (IS_QLA2322(ha) || IS_QLA6322(ha)) 1604 ha->optrom_size = OPTROM_SIZE_2322; 1605 } else if (IS_QLA24XX(ha) || IS_QLA54XX(ha)) { 1606 host->max_id = MAX_TARGETS_2200; 1607 ha->mbx_count = MAILBOX_REGISTER_COUNT; ··· 1606 ha->last_loop_id = SNS_LAST_LOOP_ID_2300; 1607 ha->init_cb_size = sizeof(struct mid_init_cb_24xx); 1608 ha->mgmt_svr_loop_id = 10 + ha->vp_idx; 1609 - ha->isp_ops.pci_config = qla24xx_pci_config; 1610 - ha->isp_ops.reset_chip = qla24xx_reset_chip; 1611 - ha->isp_ops.chip_diag = qla24xx_chip_diag; 1612 - ha->isp_ops.config_rings = qla24xx_config_rings; 1613 - ha->isp_ops.reset_adapter = qla24xx_reset_adapter; 1614 - ha->isp_ops.nvram_config = qla24xx_nvram_config; 1615 - ha->isp_ops.update_fw_options = qla24xx_update_fw_options; 1616 - ha->isp_ops.load_risc = qla24xx_load_risc; 1617 - ha->isp_ops.pci_info_str = qla24xx_pci_info_str; 1618 - ha->isp_ops.fw_version_str = qla24xx_fw_version_str; 1619 - ha->isp_ops.intr_handler = qla24xx_intr_handler; 1620 - ha->isp_ops.enable_intrs = qla24xx_enable_intrs; 1621 - ha->isp_ops.disable_intrs = qla24xx_disable_intrs; 1622 - ha->isp_ops.abort_command = qla24xx_abort_command; 1623 - ha->isp_ops.abort_target = qla24xx_abort_target; 1624 - ha->isp_ops.fabric_login = qla24xx_login_fabric; 1625 - ha->isp_ops.fabric_logout = qla24xx_fabric_logout; 1626 - ha->isp_ops.prep_ms_iocb = qla24xx_prep_ms_iocb; 1627 - ha->isp_ops.prep_ms_fdmi_iocb = qla24xx_prep_ms_fdmi_iocb; 1628 - ha->isp_ops.read_nvram = qla24xx_read_nvram_data; 1629 - ha->isp_ops.write_nvram = qla24xx_write_nvram_data; 1630 - ha->isp_ops.fw_dump = qla24xx_fw_dump; 1631 - ha->isp_ops.read_optrom = qla24xx_read_optrom_data; 1632 - ha->isp_ops.write_optrom = qla24xx_write_optrom_data; 1633 - ha->isp_ops.beacon_on = qla24xx_beacon_on; 1634 - ha->isp_ops.beacon_off = qla24xx_beacon_off; 1635 - ha->isp_ops.beacon_blink = qla24xx_beacon_blink; 1636 - ha->isp_ops.get_flash_version = qla24xx_get_flash_version; 1637 ha->gid_list_info_size = 8; 1638 ha->optrom_size = OPTROM_SIZE_24XX; 1639 } 1640 host->can_queue = ha->request_q_length + 128; 1641 ··· 1676 DEBUG2(printk("DEBUG: detect hba %ld at address = %p\n", 1677 ha->host_no, ha)); 1678 1679 - ha->isp_ops.disable_intrs(ha); 1680 1681 spin_lock_irqsave(&ha->hardware_lock, flags); 1682 reg = ha->iobase; ··· 1702 } 1703 spin_unlock_irqrestore(&ha->hardware_lock, flags); 1704 1705 - ha->isp_ops.enable_intrs(ha); 1706 1707 pci_set_drvdata(pdev, ha); 1708 ··· 1727 " ISP%04X: %s @ %s hdma%c, host#=%ld, fw=%s\n", 1728 qla2x00_version_str, ha->model_number, 1729 ha->model_desc ? ha->model_desc: "", pdev->device, 1730 - ha->isp_ops.pci_info_str(ha, pci_info), pci_name(pdev), 1731 ha->flags.enable_64bit_addressing ? '+': '-', ha->host_no, 1732 - ha->isp_ops.fw_version_str(ha, fw_str)); 1733 1734 return 0; 1735 ··· 1795 1796 /* turn-off interrupts on the card */ 1797 if (ha->interrupts_on) 1798 - ha->isp_ops.disable_intrs(ha); 1799 1800 qla2x00_mem_free(ha); 1801 ··· 2353 if (fcport->flags & FCF_FABRIC_DEVICE) { 2354 if (fcport->flags & 2355 FCF_TAPE_PRESENT) 2356 - ha->isp_ops.fabric_logout( 2357 ha, fcport->loop_id, 2358 fcport->d_id.b.domain, 2359 fcport->d_id.b.area, ··· 2433 } 2434 2435 if (!ha->interrupts_on) 2436 - ha->isp_ops.enable_intrs(ha); 2437 2438 if (test_and_clear_bit(BEACON_BLINK_NEEDED, &ha->dpc_flags)) 2439 - ha->isp_ops.beacon_blink(ha); 2440 2441 qla2x00_do_dpc_all_vps(ha); 2442
··· 681 DEBUG3(qla2x00_print_scsi_cmd(cmd)); 682 683 spin_unlock_irqrestore(&pha->hardware_lock, flags); 684 + if (ha->isp_ops->abort_command(ha, sp)) { 685 DEBUG2(printk("%s(%ld): abort_command " 686 "mbx failed.\n", __func__, ha->host_no)); 687 } else { ··· 813 #if defined(LOGOUT_AFTER_DEVICE_RESET) 814 if (ret == SUCCESS) { 815 if (fcport->flags & FC_FABRIC_DEVICE) { 816 + ha->isp_ops->fabric_logout(ha, fcport->loop_id); 817 qla2x00_mark_device_lost(ha, fcport, 0, 0); 818 } 819 } ··· 1105 qla2x00_device_reset(scsi_qla_host_t *ha, fc_port_t *reset_fcport) 1106 { 1107 /* Abort Target command will clear Reservation */ 1108 + return ha->isp_ops->abort_target(reset_fcport); 1109 } 1110 1111 static int ··· 1184 !pci_set_consistent_dma_mask(ha->pdev, DMA_64BIT_MASK)) { 1185 /* Ok, a 64bit DMA mask is applicable. */ 1186 ha->flags.enable_64bit_addressing = 1; 1187 + ha->isp_ops->calc_req_entries = qla2x00_calc_iocbs_64; 1188 + ha->isp_ops->build_iocbs = qla2x00_build_scsi_iocbs_64; 1189 return; 1190 } 1191 } ··· 1193 dma_set_mask(&ha->pdev->dev, DMA_32BIT_MASK); 1194 pci_set_consistent_dma_mask(ha->pdev, DMA_32BIT_MASK); 1195 } 1196 + 1197 + static void 1198 + qla2x00_enable_intrs(scsi_qla_host_t *ha) 1199 + { 1200 + unsigned long flags = 0; 1201 + struct device_reg_2xxx __iomem *reg = &ha->iobase->isp; 1202 + 1203 + spin_lock_irqsave(&ha->hardware_lock, flags); 1204 + ha->interrupts_on = 1; 1205 + /* enable risc and host interrupts */ 1206 + WRT_REG_WORD(&reg->ictrl, ICR_EN_INT | ICR_EN_RISC); 1207 + RD_REG_WORD(&reg->ictrl); 1208 + spin_unlock_irqrestore(&ha->hardware_lock, flags); 1209 + 1210 + } 1211 + 1212 + static void 1213 + qla2x00_disable_intrs(scsi_qla_host_t *ha) 1214 + { 1215 + unsigned long flags = 0; 1216 + struct device_reg_2xxx __iomem *reg = &ha->iobase->isp; 1217 + 1218 + spin_lock_irqsave(&ha->hardware_lock, flags); 1219 + ha->interrupts_on = 0; 1220 + /* disable risc and host interrupts */ 1221 + WRT_REG_WORD(&reg->ictrl, 0); 1222 + RD_REG_WORD(&reg->ictrl); 1223 + spin_unlock_irqrestore(&ha->hardware_lock, flags); 1224 + } 1225 + 1226 + static void 1227 + qla24xx_enable_intrs(scsi_qla_host_t *ha) 1228 + { 1229 + unsigned long flags = 0; 1230 + struct device_reg_24xx __iomem *reg = &ha->iobase->isp24; 1231 + 1232 + spin_lock_irqsave(&ha->hardware_lock, flags); 1233 + ha->interrupts_on = 1; 1234 + WRT_REG_DWORD(&reg->ictrl, ICRX_EN_RISC_INT); 1235 + RD_REG_DWORD(&reg->ictrl); 1236 + spin_unlock_irqrestore(&ha->hardware_lock, flags); 1237 + } 1238 + 1239 + static void 1240 + qla24xx_disable_intrs(scsi_qla_host_t *ha) 1241 + { 1242 + unsigned long flags = 0; 1243 + struct device_reg_24xx __iomem *reg = &ha->iobase->isp24; 1244 + 1245 + spin_lock_irqsave(&ha->hardware_lock, flags); 1246 + ha->interrupts_on = 0; 1247 + WRT_REG_DWORD(&reg->ictrl, 0); 1248 + RD_REG_DWORD(&reg->ictrl); 1249 + spin_unlock_irqrestore(&ha->hardware_lock, flags); 1250 + } 1251 + 1252 + static struct isp_operations qla2100_isp_ops = { 1253 + .pci_config = qla2100_pci_config, 1254 + .reset_chip = qla2x00_reset_chip, 1255 + .chip_diag = qla2x00_chip_diag, 1256 + .config_rings = qla2x00_config_rings, 1257 + .reset_adapter = qla2x00_reset_adapter, 1258 + .nvram_config = qla2x00_nvram_config, 1259 + .update_fw_options = qla2x00_update_fw_options, 1260 + .load_risc = qla2x00_load_risc, 1261 + .pci_info_str = qla2x00_pci_info_str, 1262 + .fw_version_str = qla2x00_fw_version_str, 1263 + .intr_handler = qla2100_intr_handler, 1264 + .enable_intrs = qla2x00_enable_intrs, 1265 + .disable_intrs = qla2x00_disable_intrs, 1266 + .abort_command = qla2x00_abort_command, 1267 + .abort_target = qla2x00_abort_target, 1268 + .fabric_login = qla2x00_login_fabric, 1269 + .fabric_logout = qla2x00_fabric_logout, 1270 + .calc_req_entries = qla2x00_calc_iocbs_32, 1271 + .build_iocbs = qla2x00_build_scsi_iocbs_32, 1272 + .prep_ms_iocb = qla2x00_prep_ms_iocb, 1273 + .prep_ms_fdmi_iocb = qla2x00_prep_ms_fdmi_iocb, 1274 + .read_nvram = qla2x00_read_nvram_data, 1275 + .write_nvram = qla2x00_write_nvram_data, 1276 + .fw_dump = qla2100_fw_dump, 1277 + .beacon_on = NULL, 1278 + .beacon_off = NULL, 1279 + .beacon_blink = NULL, 1280 + .read_optrom = qla2x00_read_optrom_data, 1281 + .write_optrom = qla2x00_write_optrom_data, 1282 + .get_flash_version = qla2x00_get_flash_version, 1283 + }; 1284 + 1285 + static struct isp_operations qla2300_isp_ops = { 1286 + .pci_config = qla2300_pci_config, 1287 + .reset_chip = qla2x00_reset_chip, 1288 + .chip_diag = qla2x00_chip_diag, 1289 + .config_rings = qla2x00_config_rings, 1290 + .reset_adapter = qla2x00_reset_adapter, 1291 + .nvram_config = qla2x00_nvram_config, 1292 + .update_fw_options = qla2x00_update_fw_options, 1293 + .load_risc = qla2x00_load_risc, 1294 + .pci_info_str = qla2x00_pci_info_str, 1295 + .fw_version_str = qla2x00_fw_version_str, 1296 + .intr_handler = qla2300_intr_handler, 1297 + .enable_intrs = qla2x00_enable_intrs, 1298 + .disable_intrs = qla2x00_disable_intrs, 1299 + .abort_command = qla2x00_abort_command, 1300 + .abort_target = qla2x00_abort_target, 1301 + .fabric_login = qla2x00_login_fabric, 1302 + .fabric_logout = qla2x00_fabric_logout, 1303 + .calc_req_entries = qla2x00_calc_iocbs_32, 1304 + .build_iocbs = qla2x00_build_scsi_iocbs_32, 1305 + .prep_ms_iocb = qla2x00_prep_ms_iocb, 1306 + .prep_ms_fdmi_iocb = qla2x00_prep_ms_fdmi_iocb, 1307 + .read_nvram = qla2x00_read_nvram_data, 1308 + .write_nvram = qla2x00_write_nvram_data, 1309 + .fw_dump = qla2300_fw_dump, 1310 + .beacon_on = qla2x00_beacon_on, 1311 + .beacon_off = qla2x00_beacon_off, 1312 + .beacon_blink = qla2x00_beacon_blink, 1313 + .read_optrom = qla2x00_read_optrom_data, 1314 + .write_optrom = qla2x00_write_optrom_data, 1315 + .get_flash_version = qla2x00_get_flash_version, 1316 + }; 1317 + 1318 + static struct isp_operations qla24xx_isp_ops = { 1319 + .pci_config = qla24xx_pci_config, 1320 + .reset_chip = qla24xx_reset_chip, 1321 + .chip_diag = qla24xx_chip_diag, 1322 + .config_rings = qla24xx_config_rings, 1323 + .reset_adapter = qla24xx_reset_adapter, 1324 + .nvram_config = qla24xx_nvram_config, 1325 + .update_fw_options = qla24xx_update_fw_options, 1326 + .load_risc = qla24xx_load_risc, 1327 + .pci_info_str = qla24xx_pci_info_str, 1328 + .fw_version_str = qla24xx_fw_version_str, 1329 + .intr_handler = qla24xx_intr_handler, 1330 + .enable_intrs = qla24xx_enable_intrs, 1331 + .disable_intrs = qla24xx_disable_intrs, 1332 + .abort_command = qla24xx_abort_command, 1333 + .abort_target = qla24xx_abort_target, 1334 + .fabric_login = qla24xx_login_fabric, 1335 + .fabric_logout = qla24xx_fabric_logout, 1336 + .calc_req_entries = NULL, 1337 + .build_iocbs = NULL, 1338 + .prep_ms_iocb = qla24xx_prep_ms_iocb, 1339 + .prep_ms_fdmi_iocb = qla24xx_prep_ms_fdmi_iocb, 1340 + .read_nvram = qla24xx_read_nvram_data, 1341 + .write_nvram = qla24xx_write_nvram_data, 1342 + .fw_dump = qla24xx_fw_dump, 1343 + .beacon_on = qla24xx_beacon_on, 1344 + .beacon_off = qla24xx_beacon_off, 1345 + .beacon_blink = qla24xx_beacon_blink, 1346 + .read_optrom = qla24xx_read_optrom_data, 1347 + .write_optrom = qla24xx_write_optrom_data, 1348 + .get_flash_version = qla24xx_get_flash_version, 1349 + }; 1350 1351 static inline void 1352 qla2x00_set_isp_flags(scsi_qla_host_t *ha) ··· 1329 } 1330 1331 static void 1332 qla2xxx_scan_start(struct Scsi_Host *shost) 1333 { 1334 scsi_qla_host_t *ha = (scsi_qla_host_t *)shost->hostdata; ··· 1472 ha->max_q_depth = ql2xmaxqdepth; 1473 1474 /* Assign ISP specific operations. */ 1475 if (IS_QLA2100(ha)) { 1476 host->max_id = MAX_TARGETS_2100; 1477 ha->mbx_count = MAILBOX_REGISTER_COUNT_2100; ··· 1507 ha->last_loop_id = SNS_LAST_LOOP_ID_2100; 1508 host->sg_tablesize = 32; 1509 ha->gid_list_info_size = 4; 1510 + ha->isp_ops = &qla2100_isp_ops; 1511 } else if (IS_QLA2200(ha)) { 1512 host->max_id = MAX_TARGETS_2200; 1513 ha->mbx_count = MAILBOX_REGISTER_COUNT; ··· 1514 ha->response_q_length = RESPONSE_ENTRY_CNT_2100; 1515 ha->last_loop_id = SNS_LAST_LOOP_ID_2100; 1516 ha->gid_list_info_size = 4; 1517 + ha->isp_ops = &qla2100_isp_ops; 1518 } else if (IS_QLA23XX(ha)) { 1519 host->max_id = MAX_TARGETS_2200; 1520 ha->mbx_count = MAILBOX_REGISTER_COUNT; 1521 ha->request_q_length = REQUEST_ENTRY_CNT_2200; 1522 ha->response_q_length = RESPONSE_ENTRY_CNT_2300; 1523 ha->last_loop_id = SNS_LAST_LOOP_ID_2300; 1524 ha->gid_list_info_size = 6; 1525 if (IS_QLA2322(ha) || IS_QLA6322(ha)) 1526 ha->optrom_size = OPTROM_SIZE_2322; 1527 + ha->isp_ops = &qla2300_isp_ops; 1528 } else if (IS_QLA24XX(ha) || IS_QLA54XX(ha)) { 1529 host->max_id = MAX_TARGETS_2200; 1530 ha->mbx_count = MAILBOX_REGISTER_COUNT; ··· 1537 ha->last_loop_id = SNS_LAST_LOOP_ID_2300; 1538 ha->init_cb_size = sizeof(struct mid_init_cb_24xx); 1539 ha->mgmt_svr_loop_id = 10 + ha->vp_idx; 1540 ha->gid_list_info_size = 8; 1541 ha->optrom_size = OPTROM_SIZE_24XX; 1542 + ha->isp_ops = &qla24xx_isp_ops; 1543 } 1544 host->can_queue = ha->request_q_length + 128; 1545 ··· 1634 DEBUG2(printk("DEBUG: detect hba %ld at address = %p\n", 1635 ha->host_no, ha)); 1636 1637 + ha->isp_ops->disable_intrs(ha); 1638 1639 spin_lock_irqsave(&ha->hardware_lock, flags); 1640 reg = ha->iobase; ··· 1660 } 1661 spin_unlock_irqrestore(&ha->hardware_lock, flags); 1662 1663 + ha->isp_ops->enable_intrs(ha); 1664 1665 pci_set_drvdata(pdev, ha); 1666 ··· 1685 " ISP%04X: %s @ %s hdma%c, host#=%ld, fw=%s\n", 1686 qla2x00_version_str, ha->model_number, 1687 ha->model_desc ? ha->model_desc: "", pdev->device, 1688 + ha->isp_ops->pci_info_str(ha, pci_info), pci_name(pdev), 1689 ha->flags.enable_64bit_addressing ? '+': '-', ha->host_no, 1690 + ha->isp_ops->fw_version_str(ha, fw_str)); 1691 1692 return 0; 1693 ··· 1753 1754 /* turn-off interrupts on the card */ 1755 if (ha->interrupts_on) 1756 + ha->isp_ops->disable_intrs(ha); 1757 1758 qla2x00_mem_free(ha); 1759 ··· 2311 if (fcport->flags & FCF_FABRIC_DEVICE) { 2312 if (fcport->flags & 2313 FCF_TAPE_PRESENT) 2314 + ha->isp_ops->fabric_logout( 2315 ha, fcport->loop_id, 2316 fcport->d_id.b.domain, 2317 fcport->d_id.b.area, ··· 2391 } 2392 2393 if (!ha->interrupts_on) 2394 + ha->isp_ops->enable_intrs(ha); 2395 2396 if (test_and_clear_bit(BEACON_BLINK_NEEDED, &ha->dpc_flags)) 2397 + ha->isp_ops->beacon_blink(ha); 2398 2399 qla2x00_do_dpc_all_vps(ha); 2400
+6 -6
drivers/scsi/qla2xxx/qla_sup.c
··· 919 else 920 ha->beacon_color_state = QLA_LED_GRN_ON; 921 922 - ha->isp_ops.beacon_blink(ha); /* This turns green LED off */ 923 924 ha->fw_options[1] &= ~FO1_SET_EMPHASIS_SWING; 925 ha->fw_options[1] &= ~FO1_DISABLE_GPIO6_7; ··· 1031 ha->beacon_blink_led = 0; 1032 ha->beacon_color_state = QLA_LED_ALL_ON; 1033 1034 - ha->isp_ops.beacon_blink(ha); /* Will flip to all off. */ 1035 1036 /* Give control back to firmware. */ 1037 spin_lock_irqsave(&ha->hardware_lock, flags); ··· 1419 1420 /* Suspend HBA. */ 1421 scsi_block_requests(ha->host); 1422 - ha->isp_ops.disable_intrs(ha); 1423 set_bit(MBX_UPDATE_FLASH_ACTIVE, &ha->mbx_cmd_flags); 1424 1425 /* Pause RISC. */ ··· 1705 { 1706 /* Suspend HBA. */ 1707 scsi_block_requests(ha->host); 1708 - ha->isp_ops.disable_intrs(ha); 1709 set_bit(MBX_UPDATE_FLASH_ACTIVE, &ha->mbx_cmd_flags); 1710 1711 /* Go with read. */ ··· 1713 1714 /* Resume HBA. */ 1715 clear_bit(MBX_UPDATE_FLASH_ACTIVE, &ha->mbx_cmd_flags); 1716 - ha->isp_ops.enable_intrs(ha); 1717 scsi_unblock_requests(ha->host); 1718 1719 return buf; ··· 1727 1728 /* Suspend HBA. */ 1729 scsi_block_requests(ha->host); 1730 - ha->isp_ops.disable_intrs(ha); 1731 set_bit(MBX_UPDATE_FLASH_ACTIVE, &ha->mbx_cmd_flags); 1732 1733 /* Go with write. */
··· 919 else 920 ha->beacon_color_state = QLA_LED_GRN_ON; 921 922 + ha->isp_ops->beacon_blink(ha); /* This turns green LED off */ 923 924 ha->fw_options[1] &= ~FO1_SET_EMPHASIS_SWING; 925 ha->fw_options[1] &= ~FO1_DISABLE_GPIO6_7; ··· 1031 ha->beacon_blink_led = 0; 1032 ha->beacon_color_state = QLA_LED_ALL_ON; 1033 1034 + ha->isp_ops->beacon_blink(ha); /* Will flip to all off. */ 1035 1036 /* Give control back to firmware. */ 1037 spin_lock_irqsave(&ha->hardware_lock, flags); ··· 1419 1420 /* Suspend HBA. */ 1421 scsi_block_requests(ha->host); 1422 + ha->isp_ops->disable_intrs(ha); 1423 set_bit(MBX_UPDATE_FLASH_ACTIVE, &ha->mbx_cmd_flags); 1424 1425 /* Pause RISC. */ ··· 1705 { 1706 /* Suspend HBA. */ 1707 scsi_block_requests(ha->host); 1708 + ha->isp_ops->disable_intrs(ha); 1709 set_bit(MBX_UPDATE_FLASH_ACTIVE, &ha->mbx_cmd_flags); 1710 1711 /* Go with read. */ ··· 1713 1714 /* Resume HBA. */ 1715 clear_bit(MBX_UPDATE_FLASH_ACTIVE, &ha->mbx_cmd_flags); 1716 + ha->isp_ops->enable_intrs(ha); 1717 scsi_unblock_requests(ha->host); 1718 1719 return buf; ··· 1727 1728 /* Suspend HBA. */ 1729 scsi_block_requests(ha->host); 1730 + ha->isp_ops->disable_intrs(ha); 1731 set_bit(MBX_UPDATE_FLASH_ACTIVE, &ha->mbx_cmd_flags); 1732 1733 /* Go with write. */