Lines Matching refs:ioc
197 MPT_ADAPTER *ioc; in mptfc_block_error_handler() local
200 ioc = hd->ioc; in mptfc_block_error_handler()
204 dfcprintk (ioc, printk(MYIOC_s_DEBUG_FMT in mptfc_block_error_handler()
207 ioc->name, ioc->sh->host_no, in mptfc_block_error_handler()
215 dfcprintk (ioc, printk(MYIOC_s_DEBUG_FMT in mptfc_block_error_handler()
218 ioc->name, ioc->sh->host_no, in mptfc_block_error_handler()
223 dfcprintk (ioc, printk(MYIOC_s_DEBUG_FMT in mptfc_block_error_handler()
225 ioc->name, ioc->sh->host_no, in mptfc_block_error_handler()
286 mptfc_GetFcDevPage0(MPT_ADAPTER *ioc, int ioc_port, in mptfc_GetFcDevPage0() argument
287 void(*func)(MPT_ADAPTER *ioc,int channel, FCDevicePage0_t *arg)) in mptfc_GetFcDevPage0() argument
302 int max_bus = ioc->facts.MaxBuses; in mptfc_GetFcDevPage0()
305 max_targ = (ioc->facts.MaxDevices == 0) ? 256 : ioc->facts.MaxDevices; in mptfc_GetFcDevPage0()
330 if ((rc = mpt_config(ioc, &cfg)) != 0) in mptfc_GetFcDevPage0()
337 ppage0_alloc = pci_alloc_consistent(ioc->pcidev, data_sz, in mptfc_GetFcDevPage0()
346 if ((rc = mpt_config(ioc, &cfg)) == 0) { in mptfc_GetFcDevPage0()
373 pci_free_consistent(ioc->pcidev, data_sz, in mptfc_GetFcDevPage0()
388 func(ioc, ioc_port, fc); in mptfc_GetFcDevPage0()
425 mptfc_register_dev(MPT_ADAPTER *ioc, int channel, FCDevicePage0_t *pg0) in mptfc_register_dev() argument
443 list_for_each_entry(ri, &ioc->fc_rports, list) { in mptfc_register_dev()
446 list_move_tail(&ri->list, &ioc->fc_rports); in mptfc_register_dev()
455 list_add_tail(&ri->list, &ioc->fc_rports); in mptfc_register_dev()
464 rport = fc_remote_port_add(ioc->sh, channel, &rport_ids); in mptfc_register_dev()
487 dfcprintk (ioc, printk(MYIOC_s_DEBUG_FMT in mptfc_register_dev()
490 ioc->name, in mptfc_register_dev()
491 ioc->sh->host_no, in mptfc_register_dev()
571 mptfc_dump_lun_info(MPT_ADAPTER *ioc, struct fc_rport *rport, struct scsi_device *sdev, in mptfc_dump_lun_info() argument
580 dfcprintk (ioc, printk(MYIOC_s_DEBUG_FMT in mptfc_dump_lun_info()
583 ioc->name, in mptfc_dump_lun_info()
607 MPT_ADAPTER *ioc; in mptfc_slave_alloc() local
616 ioc = hd->ioc; in mptfc_slave_alloc()
621 ioc->name, sizeof(VirtDevice)); in mptfc_slave_alloc()
630 vtarget->ioc_id = ioc->id; in mptfc_slave_alloc()
640 mptfc_dump_lun_info(ioc, rport, sdev, vtarget); in mptfc_slave_alloc()
685 mptfc_display_port_link_speed(MPT_ADAPTER *ioc, int portnum, FCPortPage0_t *pp0dest) in mptfc_display_port_link_speed() argument
693 old_speed = ioc->fc_link_speed[portnum]; in mptfc_display_port_link_speed()
711 ioc->name, new); in mptfc_display_port_link_speed()
715 ioc->name, old, new); in mptfc_display_port_link_speed()
717 ioc->fc_link_speed[portnum] = new_speed; in mptfc_display_port_link_speed()
734 mptfc_GetFcPortPage0(MPT_ADAPTER *ioc, int portnum) in mptfc_GetFcPortPage0() argument
761 if ((rc = mpt_config(ioc, &cfg)) != 0) in mptfc_GetFcPortPage0()
769 ppage0_alloc = (FCPortPage0_t *) pci_alloc_consistent(ioc->pcidev, data_sz, &page0_dma); in mptfc_GetFcPortPage0()
777 if ((rc = mpt_config(ioc, &cfg)) == 0) { in mptfc_GetFcPortPage0()
779 pp0dest = &ioc->fc_port_page0[portnum]; in mptfc_GetFcPortPage0()
818 ioc->name); in mptfc_GetFcPortPage0()
820 mptfc_display_port_link_speed(ioc, portnum, pp0dest); in mptfc_GetFcPortPage0()
823 pci_free_consistent(ioc->pcidev, data_sz, (u8 *) ppage0_alloc, page0_dma); in mptfc_GetFcPortPage0()
830 mptfc_WriteFcPortPage1(MPT_ADAPTER *ioc, int portnum) in mptfc_WriteFcPortPage1() argument
839 if (!(ioc->fc_data.fc_port_page1[portnum].data)) in mptfc_WriteFcPortPage1()
854 if ((rc = mpt_config(ioc, &cfg)) != 0) in mptfc_WriteFcPortPage1()
860 if (hdr.PageLength*4 != ioc->fc_data.fc_port_page1[portnum].pg_sz) in mptfc_WriteFcPortPage1()
863 cfg.physAddr = ioc->fc_data.fc_port_page1[portnum].dma; in mptfc_WriteFcPortPage1()
867 rc = mpt_config(ioc, &cfg); in mptfc_WriteFcPortPage1()
873 mptfc_GetFcPortPage1(MPT_ADAPTER *ioc, int portnum) in mptfc_GetFcPortPage1() argument
897 if ((rc = mpt_config(ioc, &cfg)) != 0) in mptfc_GetFcPortPage1()
905 if (ioc->fc_data.fc_port_page1[portnum].data == NULL) { in mptfc_GetFcPortPage1()
910 page1_alloc = (FCPortPage1_t *) pci_alloc_consistent(ioc->pcidev, in mptfc_GetFcPortPage1()
917 page1_alloc = ioc->fc_data.fc_port_page1[portnum].data; in mptfc_GetFcPortPage1()
918 page1_dma = ioc->fc_data.fc_port_page1[portnum].dma; in mptfc_GetFcPortPage1()
919 data_sz = ioc->fc_data.fc_port_page1[portnum].pg_sz; in mptfc_GetFcPortPage1()
921 ioc->fc_data.fc_port_page1[portnum].data = NULL; in mptfc_GetFcPortPage1()
922 pci_free_consistent(ioc->pcidev, data_sz, (u8 *) in mptfc_GetFcPortPage1()
933 if ((rc = mpt_config(ioc, &cfg)) == 0) { in mptfc_GetFcPortPage1()
934 ioc->fc_data.fc_port_page1[portnum].data = page1_alloc; in mptfc_GetFcPortPage1()
935 ioc->fc_data.fc_port_page1[portnum].pg_sz = data_sz; in mptfc_GetFcPortPage1()
936 ioc->fc_data.fc_port_page1[portnum].dma = page1_dma; in mptfc_GetFcPortPage1()
939 ioc->fc_data.fc_port_page1[portnum].data = NULL; in mptfc_GetFcPortPage1()
940 pci_free_consistent(ioc->pcidev, data_sz, (u8 *) in mptfc_GetFcPortPage1()
948 mptfc_SetFcPortPage1_defaults(MPT_ADAPTER *ioc) in mptfc_SetFcPortPage1_defaults() argument
958 for (ii=0; ii<ioc->facts.NumberOfPorts; ii++) { in mptfc_SetFcPortPage1_defaults()
959 if (mptfc_GetFcPortPage1(ioc, ii) != 0) in mptfc_SetFcPortPage1_defaults()
961 pp1 = ioc->fc_data.fc_port_page1[ii].data; in mptfc_SetFcPortPage1_defaults()
971 mptfc_WriteFcPortPage1(ioc, ii); in mptfc_SetFcPortPage1_defaults()
977 mptfc_init_host_attr(MPT_ADAPTER *ioc,int portnum) in mptfc_init_host_attr() argument
992 pp0 = &ioc->fc_port_page0[portnum]; in mptfc_init_host_attr()
993 sh = ioc->sh; in mptfc_init_host_attr()
997 ioc->prod_name, in mptfc_init_host_attr()
999 ioc->facts.FWVersion.Word); in mptfc_init_host_attr()
1073 MPT_ADAPTER *ioc = in mptfc_link_status_change() local
1077 for (ii=0; ii < ioc->facts.NumberOfPorts; ii++) in mptfc_link_status_change()
1078 (void) mptfc_GetFcPortPage0(ioc, ii); in mptfc_link_status_change()
1085 MPT_ADAPTER *ioc = in mptfc_setup_reset() local
1091 list_for_each_entry(ri, &ioc->fc_rports, list) { in mptfc_setup_reset()
1099 dfcprintk (ioc, printk(MYIOC_s_DEBUG_FMT in mptfc_setup_reset()
1101 ioc->name, in mptfc_setup_reset()
1102 ioc->sh->host_no, in mptfc_setup_reset()
1111 MPT_ADAPTER *ioc = in mptfc_rescan_devices() local
1118 list_for_each_entry(ri, &ioc->fc_rports, list) { in mptfc_rescan_devices()
1128 for (ii=0; ii < ioc->facts.NumberOfPorts; ii++) { in mptfc_rescan_devices()
1129 (void) mptfc_GetFcPortPage0(ioc, ii); in mptfc_rescan_devices()
1130 mptfc_init_host_attr(ioc, ii); /* refresh */ in mptfc_rescan_devices()
1131 mptfc_GetFcDevPage0(ioc, ii, mptfc_register_dev); in mptfc_rescan_devices()
1135 list_for_each_entry(ri, &ioc->fc_rports, list) { in mptfc_rescan_devices()
1146 dfcprintk (ioc, printk(MYIOC_s_DEBUG_FMT in mptfc_rescan_devices()
1148 ioc->name, in mptfc_rescan_devices()
1149 ioc->sh->host_no, in mptfc_rescan_devices()
1160 MPT_ADAPTER *ioc; in mptfc_probe() local
1172 ioc = pci_get_drvdata(pdev); in mptfc_probe()
1173 ioc->DoneCtx = mptfcDoneCtx; in mptfc_probe()
1174 ioc->TaskCtx = mptfcTaskCtx; in mptfc_probe()
1175 ioc->InternalCtx = mptfcInternalCtx; in mptfc_probe()
1179 if (ioc->last_state != MPI_IOC_STATE_OPERATIONAL) { in mptfc_probe()
1182 ioc->name); in mptfc_probe()
1187 if (!ioc->active) { in mptfc_probe()
1189 ioc->name); in mptfc_probe()
1197 for (ii=0; ii < ioc->facts.NumberOfPorts; ii++) { in mptfc_probe()
1198 if (ioc->pfacts[ii].ProtocolFlags & in mptfc_probe()
1206 ioc->name, ioc); in mptfc_probe()
1215 ioc->name); in mptfc_probe()
1220 spin_lock_init(&ioc->fc_rescan_work_lock); in mptfc_probe()
1221 INIT_WORK(&ioc->fc_rescan_work, mptfc_rescan_devices); in mptfc_probe()
1222 INIT_WORK(&ioc->fc_setup_reset_work, mptfc_setup_reset); in mptfc_probe()
1223 INIT_WORK(&ioc->fc_lsc_work, mptfc_link_status_change); in mptfc_probe()
1225 spin_lock_irqsave(&ioc->FreeQlock, flags); in mptfc_probe()
1229 ioc->sh = sh; in mptfc_probe()
1238 sh->max_id = ioc->pfacts->MaxDevices; in mptfc_probe()
1243 sh->unique_id = ioc->id; in mptfc_probe()
1254 scale = ioc->req_sz/(sizeof(dma_addr_t) + sizeof(u32)); in mptfc_probe()
1257 (ioc->facts.MaxChainDepth-1) + scale + in mptfc_probe()
1258 (ioc->req_sz - 60) / (sizeof(dma_addr_t) + in mptfc_probe()
1262 (ioc->facts.MaxChainDepth-1) + scale + in mptfc_probe()
1263 (ioc->req_sz - 64) / (sizeof(dma_addr_t) + in mptfc_probe()
1269 dprintk(ioc, printk(MYIOC_s_DEBUG_FMT in mptfc_probe()
1271 ioc->name, numSGE, sh->sg_tablesize)); in mptfc_probe()
1275 spin_unlock_irqrestore(&ioc->FreeQlock, flags); in mptfc_probe()
1278 hd->ioc = ioc; in mptfc_probe()
1283 ioc->ScsiLookup = kcalloc(ioc->req_depth, sizeof(void *), GFP_ATOMIC); in mptfc_probe()
1284 if (!ioc->ScsiLookup) { in mptfc_probe()
1288 spin_lock_init(&ioc->scsi_lookup_lock); in mptfc_probe()
1290 dprintk(ioc, printk(MYIOC_s_DEBUG_FMT "ScsiLookup @ %p\n", in mptfc_probe()
1291 ioc->name, ioc->ScsiLookup)); in mptfc_probe()
1320 error = scsi_add_host (sh, &ioc->pcidev->dev); in mptfc_probe()
1322 dprintk(ioc, printk(MYIOC_s_ERR_FMT in mptfc_probe()
1323 "scsi_add_host failed\n", ioc->name)); in mptfc_probe()
1329 snprintf(ioc->fc_rescan_work_q_name, sizeof(ioc->fc_rescan_work_q_name), in mptfc_probe()
1331 ioc->fc_rescan_work_q = in mptfc_probe()
1332 create_singlethread_workqueue(ioc->fc_rescan_work_q_name); in mptfc_probe()
1333 if (!ioc->fc_rescan_work_q) in mptfc_probe()
1340 for (ii=0; ii < ioc->facts.NumberOfPorts; ii++) { in mptfc_probe()
1341 (void) mptfc_GetFcPortPage0(ioc, ii); in mptfc_probe()
1343 mptfc_SetFcPortPage1_defaults(ioc); in mptfc_probe()
1350 queue_work(ioc->fc_rescan_work_q, &ioc->fc_rescan_work); in mptfc_probe()
1351 flush_workqueue(ioc->fc_rescan_work_q); in mptfc_probe()
1374 mptfc_event_process(MPT_ADAPTER *ioc, EventNotificationReply_t *pEvReply) in mptfc_event_process() argument
1381 devtverboseprintk(ioc, printk(MYIOC_s_DEBUG_FMT "MPT event (=%02Xh) routed to SCSI host driver!\n", in mptfc_event_process()
1382 ioc->name, event)); in mptfc_event_process()
1384 if (ioc->sh == NULL || in mptfc_event_process()
1385 ((hd = shost_priv(ioc->sh)) == NULL)) in mptfc_event_process()
1390 spin_lock_irqsave(&ioc->fc_rescan_work_lock, flags); in mptfc_event_process()
1391 if (ioc->fc_rescan_work_q) { in mptfc_event_process()
1392 queue_work(ioc->fc_rescan_work_q, in mptfc_event_process()
1393 &ioc->fc_rescan_work); in mptfc_event_process()
1395 spin_unlock_irqrestore(&ioc->fc_rescan_work_lock, flags); in mptfc_event_process()
1398 spin_lock_irqsave(&ioc->fc_rescan_work_lock, flags); in mptfc_event_process()
1399 if (ioc->fc_rescan_work_q) { in mptfc_event_process()
1400 queue_work(ioc->fc_rescan_work_q, in mptfc_event_process()
1401 &ioc->fc_lsc_work); in mptfc_event_process()
1403 spin_unlock_irqrestore(&ioc->fc_rescan_work_lock, flags); in mptfc_event_process()
1406 rc = mptscsih_event_process(ioc,pEvReply); in mptfc_event_process()
1413 mptfc_ioc_reset(MPT_ADAPTER *ioc, int reset_phase) in mptfc_ioc_reset() argument
1418 rc = mptscsih_ioc_reset(ioc,reset_phase); in mptfc_ioc_reset()
1423 dtmprintk(ioc, printk(MYIOC_s_DEBUG_FMT in mptfc_ioc_reset()
1424 ": IOC %s_reset routed to FC host driver!\n",ioc->name, in mptfc_ioc_reset()
1429 spin_lock_irqsave(&ioc->fc_rescan_work_lock, flags); in mptfc_ioc_reset()
1430 if (ioc->fc_rescan_work_q) { in mptfc_ioc_reset()
1431 queue_work(ioc->fc_rescan_work_q, in mptfc_ioc_reset()
1432 &ioc->fc_setup_reset_work); in mptfc_ioc_reset()
1434 spin_unlock_irqrestore(&ioc->fc_rescan_work_lock, flags); in mptfc_ioc_reset()
1441 mptfc_SetFcPortPage1_defaults(ioc); in mptfc_ioc_reset()
1442 spin_lock_irqsave(&ioc->fc_rescan_work_lock, flags); in mptfc_ioc_reset()
1443 if (ioc->fc_rescan_work_q) { in mptfc_ioc_reset()
1444 queue_work(ioc->fc_rescan_work_q, in mptfc_ioc_reset()
1445 &ioc->fc_rescan_work); in mptfc_ioc_reset()
1447 spin_unlock_irqrestore(&ioc->fc_rescan_work_lock, flags); in mptfc_ioc_reset()
1498 MPT_ADAPTER *ioc = pci_get_drvdata(pdev); in mptfc_remove() local
1505 if ((work_q=ioc->fc_rescan_work_q)) { in mptfc_remove()
1506 spin_lock_irqsave(&ioc->fc_rescan_work_lock, flags); in mptfc_remove()
1507 ioc->fc_rescan_work_q = NULL; in mptfc_remove()
1508 spin_unlock_irqrestore(&ioc->fc_rescan_work_lock, flags); in mptfc_remove()
1512 fc_remove_host(ioc->sh); in mptfc_remove()
1514 list_for_each_entry_safe(p, n, &ioc->fc_rports, list) { in mptfc_remove()
1519 for (ii=0; ii<ioc->facts.NumberOfPorts; ii++) { in mptfc_remove()
1520 if (ioc->fc_data.fc_port_page1[ii].data) { in mptfc_remove()
1521 pci_free_consistent(ioc->pcidev, in mptfc_remove()
1522 ioc->fc_data.fc_port_page1[ii].pg_sz, in mptfc_remove()
1523 (u8 *) ioc->fc_data.fc_port_page1[ii].data, in mptfc_remove()
1524 ioc->fc_data.fc_port_page1[ii].dma); in mptfc_remove()
1525 ioc->fc_data.fc_port_page1[ii].data = NULL; in mptfc_remove()