Lines Matching refs:ha
146 static irqreturn_t __gdth_interrupt(gdth_ha_str *ha,
148 static int gdth_sync_event(gdth_ha_str *ha, int service, u8 index,
150 static int gdth_async_event(gdth_ha_str *ha);
153 static void gdth_putq(gdth_ha_str *ha, Scsi_Cmnd *scp, u8 priority);
154 static void gdth_next(gdth_ha_str *ha);
155 static int gdth_fill_raw_cmd(gdth_ha_str *ha, Scsi_Cmnd *scp, u8 b);
156 static int gdth_special_cmd(gdth_ha_str *ha, Scsi_Cmnd *scp);
157 static gdth_evt_str *gdth_store_event(gdth_ha_str *ha, u16 source,
159 static int gdth_read_event(gdth_ha_str *ha, int handle, gdth_evt_str *estr);
160 static void gdth_readapp_event(gdth_ha_str *ha, u8 application,
164 static void gdth_copy_internal_data(gdth_ha_str *ha, Scsi_Cmnd *scp,
166 static int gdth_internal_cache_cmd(gdth_ha_str *ha, Scsi_Cmnd *scp);
167 static int gdth_fill_cache_cmd(gdth_ha_str *ha, Scsi_Cmnd *scp, u16 hdrive);
169 static void gdth_enable_int(gdth_ha_str *ha);
170 static int gdth_test_busy(gdth_ha_str *ha);
171 static int gdth_get_cmd_index(gdth_ha_str *ha);
172 static void gdth_release_event(gdth_ha_str *ha);
173 static int gdth_wait(gdth_ha_str *ha, int index,u32 time);
174 static int gdth_internal_cmd(gdth_ha_str *ha, u8 service, u16 opcode,
176 static int gdth_search_drives(gdth_ha_str *ha);
177 static int gdth_analyse_hdrive(gdth_ha_str *ha, u16 hdrive);
179 static const char *gdth_ctr_name(gdth_ha_str *ha);
186 static void gdth_flush(gdth_ha_str *ha);
188 static int __gdth_queuecommand(gdth_ha_str *ha, struct scsi_cmnd *scp,
383 gdth_ha_str *ha; in gdth_find_ha() local
385 list_for_each_entry(ha, &gdth_instances, list) in gdth_find_ha()
386 if (hanum == ha->hanum) in gdth_find_ha()
387 return ha; in gdth_find_ha()
392 static struct gdth_cmndinfo *gdth_get_cmndinfo(gdth_ha_str *ha) in gdth_get_cmndinfo() argument
398 spin_lock_irqsave(&ha->smp_lock, flags); in gdth_get_cmndinfo()
401 if (ha->cmndinfo[i].index == 0) { in gdth_get_cmndinfo()
402 priv = &ha->cmndinfo[i]; in gdth_get_cmndinfo()
409 spin_unlock_irqrestore(&ha->smp_lock, flags); in gdth_get_cmndinfo()
448 gdth_ha_str *ha = shost_priv(sdev->host); in __gdth_execute() local
476 __gdth_queuecommand(ha, scp, &cmndinfo); in __gdth_execute()
573 static void gdth_remove_one(gdth_ha_str *ha);
595 gdth_ha_str *ha = pci_get_drvdata(pdev); in gdth_pci_remove_one() local
597 list_del(&ha->list); in gdth_pci_remove_one()
598 gdth_remove_one(ha); in gdth_pci_remove_one()
611 gdth_ha_str *ha = NULL; in gdth_pci_init_one() local
652 rc = gdth_pci_probe_one(&gdth_pcistr, &ha); in gdth_pci_init_one()
661 static int __init gdth_init_eisa(u16 eisa_adr,gdth_ha_str *ha) in gdth_init_eisa() argument
690 ha->bmic = eisa_adr; in gdth_init_eisa()
691 ha->brd_phys = (u32)eisa_adr >> 12; in gdth_init_eisa()
700 ha->oem_id = OEM_ID_ICP; in gdth_init_eisa()
701 ha->type = GDT_EISA; in gdth_init_eisa()
702 ha->stype = id; in gdth_init_eisa()
714 ha->irq = inb(eisa_adr+MAILBOXREG); in gdth_init_eisa()
716 TRACE2(("GDT3000/3020: IRQ=%d\n",ha->irq)); in gdth_init_eisa()
718 if (ha->irq == 0) { in gdth_init_eisa()
728 ha->irq = irq[i]; in gdth_init_eisa()
732 ha->irq); in gdth_init_eisa()
743 ha->irq = gdth_irq_tab[eisacf]; in gdth_init_eisa()
744 ha->oem_id = OEM_ID_ICP; in gdth_init_eisa()
745 ha->type = GDT_EISA; in gdth_init_eisa()
746 ha->stype = id; in gdth_init_eisa()
749 ha->dma64_support = 0; in gdth_init_eisa()
755 static int __init gdth_init_isa(u32 bios_adr,gdth_ha_str *ha) in gdth_init_isa() argument
764 ha->brd = ioremap(bios_adr, sizeof(gdt2_dpram_str)); in gdth_init_isa()
765 if (ha->brd == NULL) { in gdth_init_isa()
769 dp2_ptr = ha->brd; in gdth_init_isa()
775 iounmap(ha->brd); in gdth_init_isa()
791 ha->drq = gdth_drq_tab[i]; in gdth_init_isa()
799 ha->irq = gdth_irq_tab[i]; in gdth_init_isa()
810 iounmap(ha->brd); in gdth_init_isa()
820 iounmap(ha->brd); in gdth_init_isa()
824 ha->oem_id = OEM_ID_ICP; in gdth_init_isa()
825 ha->type = GDT_ISA; in gdth_init_isa()
826 ha->ic_all_size = sizeof(dp2_ptr->u); in gdth_init_isa()
827 ha->stype= GDT2_ID; in gdth_init_isa()
828 ha->brd_phys = bios_adr >> 4; in gdth_init_isa()
842 iounmap(ha->brd); in gdth_init_isa()
850 ha->dma64_support = 0; in gdth_init_isa()
857 gdth_ha_str *ha) in gdth_init_pci() argument
870 ha->oem_id = OEM_ID_INTEL; in gdth_init_pci()
872 ha->oem_id = OEM_ID_ICP; in gdth_init_pci()
873 ha->brd_phys = (pdev->bus->number << 8) | (pdev->devfn & 0xf8); in gdth_init_pci()
874 ha->stype = (u32)pdev->device; in gdth_init_pci()
875 ha->irq = pdev->irq; in gdth_init_pci()
876 ha->pdev = pdev; in gdth_init_pci()
878 if (ha->pdev->device <= PCI_DEVICE_ID_VORTEX_GDT6000B) { /* GDT6000/B */ in gdth_init_pci()
879 TRACE2(("init_pci() dpmem %lx irq %d\n",pcistr->dpmem,ha->irq)); in gdth_init_pci()
880 ha->brd = ioremap(pcistr->dpmem, sizeof(gdt6_dpram_str)); in gdth_init_pci()
881 if (ha->brd == NULL) { in gdth_init_pci()
886 dp6_ptr = ha->brd; in gdth_init_pci()
893 iounmap(ha->brd); in gdth_init_pci()
894 ha->brd = ioremap(i, sizeof(u16)); in gdth_init_pci()
895 if (ha->brd == NULL) { in gdth_init_pci()
899 if (readw(ha->brd) != 0xffff) { in gdth_init_pci()
903 iounmap(ha->brd); in gdth_init_pci()
905 ha->brd = ioremap(i, sizeof(gdt6_dpram_str)); in gdth_init_pci()
906 if (ha->brd == NULL) { in gdth_init_pci()
910 dp6_ptr = ha->brd; in gdth_init_pci()
920 iounmap(ha->brd); in gdth_init_pci()
927 iounmap(ha->brd); in gdth_init_pci()
945 iounmap(ha->brd); in gdth_init_pci()
955 iounmap(ha->brd); in gdth_init_pci()
959 ha->type = GDT_PCI; in gdth_init_pci()
960 ha->ic_all_size = sizeof(dp6_ptr->u); in gdth_init_pci()
974 iounmap(ha->brd); in gdth_init_pci()
982 ha->dma64_support = 0; in gdth_init_pci()
984 } else if (ha->pdev->device <= PCI_DEVICE_ID_VORTEX_GDT6555) { /* GDT6110, ... */ in gdth_init_pci()
985 ha->plx = (gdt6c_plx_regs *)pcistr->io; in gdth_init_pci()
987 pcistr->dpmem,ha->irq)); in gdth_init_pci()
988 ha->brd = ioremap(pcistr->dpmem, sizeof(gdt6c_dpram_str)); in gdth_init_pci()
989 if (ha->brd == NULL) { in gdth_init_pci()
991 iounmap(ha->brd); in gdth_init_pci()
995 dp6c_ptr = ha->brd; in gdth_init_pci()
1002 iounmap(ha->brd); in gdth_init_pci()
1003 ha->brd = ioremap(i, sizeof(u16)); in gdth_init_pci()
1004 if (ha->brd == NULL) { in gdth_init_pci()
1008 if (readw(ha->brd) != 0xffff) { in gdth_init_pci()
1012 iounmap(ha->brd); in gdth_init_pci()
1014 ha->brd = ioremap(i, sizeof(gdt6c_dpram_str)); in gdth_init_pci()
1015 if (ha->brd == NULL) { in gdth_init_pci()
1019 dp6c_ptr = ha->brd; in gdth_init_pci()
1029 iounmap(ha->brd); in gdth_init_pci()
1036 iounmap(ha->brd); in gdth_init_pci()
1041 outb(0x00,PTR2USHORT(&ha->plx->control1)); in gdth_init_pci()
1042 outb(0xff,PTR2USHORT(&ha->plx->edoor_reg)); in gdth_init_pci()
1050 outb(1,PTR2USHORT(&ha->plx->ldoor_reg)); in gdth_init_pci()
1057 iounmap(ha->brd); in gdth_init_pci()
1066 iounmap(ha->brd); in gdth_init_pci()
1070 ha->type = GDT_PCINEW; in gdth_init_pci()
1071 ha->ic_all_size = sizeof(dp6c_ptr->u); in gdth_init_pci()
1080 outb(1,PTR2USHORT(&ha->plx->ldoor_reg)); in gdth_init_pci()
1087 iounmap(ha->brd); in gdth_init_pci()
1094 ha->dma64_support = 0; in gdth_init_pci()
1097 TRACE2(("init_pci_mpr() dpmem %lx irq %d\n",pcistr->dpmem,ha->irq)); in gdth_init_pci()
1098 ha->brd = ioremap(pcistr->dpmem, sizeof(gdt6m_dpram_str)); in gdth_init_pci()
1099 if (ha->brd == NULL) { in gdth_init_pci()
1110 dp6m_ptr = ha->brd; in gdth_init_pci()
1124 iounmap(ha->brd); in gdth_init_pci()
1125 ha->brd = ioremap(i, sizeof(u16)); in gdth_init_pci()
1126 if (ha->brd == NULL) { in gdth_init_pci()
1130 if (readw(ha->brd) != 0xffff) { in gdth_init_pci()
1134 iounmap(ha->brd); in gdth_init_pci()
1136 ha->brd = ioremap(i, sizeof(gdt6m_dpram_str)); in gdth_init_pci()
1137 if (ha->brd == NULL) { in gdth_init_pci()
1141 dp6m_ptr = ha->brd; in gdth_init_pci()
1151 iounmap(ha->brd); in gdth_init_pci()
1172 iounmap(ha->brd); in gdth_init_pci()
1181 iounmap(ha->brd); in gdth_init_pci()
1185 ha->type = GDT_PCIMPR; in gdth_init_pci()
1186 ha->ic_all_size = sizeof(dp6m_ptr->u); in gdth_init_pci()
1200 iounmap(ha->brd); in gdth_init_pci()
1215 iounmap(ha->brd); in gdth_init_pci()
1223 ha->dma64_support = 0; in gdth_init_pci()
1225 ha->dma64_support = 1; in gdth_init_pci()
1234 static void gdth_enable_int(gdth_ha_str *ha) in gdth_enable_int() argument
1241 TRACE(("gdth_enable_int() hanum %d\n",ha->hanum)); in gdth_enable_int()
1242 spin_lock_irqsave(&ha->smp_lock, flags); in gdth_enable_int()
1244 if (ha->type == GDT_EISA) { in gdth_enable_int()
1245 outb(0xff, ha->bmic + EDOORREG); in gdth_enable_int()
1246 outb(0xff, ha->bmic + EDENABREG); in gdth_enable_int()
1247 outb(0x01, ha->bmic + EINTENABREG); in gdth_enable_int()
1248 } else if (ha->type == GDT_ISA) { in gdth_enable_int()
1249 dp2_ptr = ha->brd; in gdth_enable_int()
1253 } else if (ha->type == GDT_PCI) { in gdth_enable_int()
1254 dp6_ptr = ha->brd; in gdth_enable_int()
1258 } else if (ha->type == GDT_PCINEW) { in gdth_enable_int()
1259 outb(0xff, PTR2USHORT(&ha->plx->edoor_reg)); in gdth_enable_int()
1260 outb(0x03, PTR2USHORT(&ha->plx->control1)); in gdth_enable_int()
1261 } else if (ha->type == GDT_PCIMPR) { in gdth_enable_int()
1262 dp6m_ptr = ha->brd; in gdth_enable_int()
1267 spin_unlock_irqrestore(&ha->smp_lock, flags); in gdth_enable_int()
1271 static u8 gdth_get_status(gdth_ha_str *ha) in gdth_get_status() argument
1275 TRACE(("gdth_get_status() irq %d ctr_count %d\n", ha->irq, gdth_ctr_count)); in gdth_get_status()
1277 if (ha->type == GDT_EISA) in gdth_get_status()
1278 IStatus = inb((u16)ha->bmic + EDOORREG); in gdth_get_status()
1279 else if (ha->type == GDT_ISA) in gdth_get_status()
1281 readb(&((gdt2_dpram_str __iomem *)ha->brd)->u.ic.Cmd_Index); in gdth_get_status()
1282 else if (ha->type == GDT_PCI) in gdth_get_status()
1284 readb(&((gdt6_dpram_str __iomem *)ha->brd)->u.ic.Cmd_Index); in gdth_get_status()
1285 else if (ha->type == GDT_PCINEW) in gdth_get_status()
1286 IStatus = inb(PTR2USHORT(&ha->plx->edoor_reg)); in gdth_get_status()
1287 else if (ha->type == GDT_PCIMPR) in gdth_get_status()
1289 readb(&((gdt6m_dpram_str __iomem *)ha->brd)->i960r.edoor_reg); in gdth_get_status()
1294 static int gdth_test_busy(gdth_ha_str *ha) in gdth_test_busy() argument
1298 TRACE(("gdth_test_busy() hanum %d\n", ha->hanum)); in gdth_test_busy()
1300 if (ha->type == GDT_EISA) in gdth_test_busy()
1301 gdtsema0 = (int)inb(ha->bmic + SEMA0REG); in gdth_test_busy()
1302 else if (ha->type == GDT_ISA) in gdth_test_busy()
1303 gdtsema0 = (int)readb(&((gdt2_dpram_str __iomem *)ha->brd)->u.ic.Sema0); in gdth_test_busy()
1304 else if (ha->type == GDT_PCI) in gdth_test_busy()
1305 gdtsema0 = (int)readb(&((gdt6_dpram_str __iomem *)ha->brd)->u.ic.Sema0); in gdth_test_busy()
1306 else if (ha->type == GDT_PCINEW) in gdth_test_busy()
1307 gdtsema0 = (int)inb(PTR2USHORT(&ha->plx->sema0_reg)); in gdth_test_busy()
1308 else if (ha->type == GDT_PCIMPR) in gdth_test_busy()
1310 (int)readb(&((gdt6m_dpram_str __iomem *)ha->brd)->i960r.sema0_reg); in gdth_test_busy()
1316 static int gdth_get_cmd_index(gdth_ha_str *ha) in gdth_get_cmd_index() argument
1320 TRACE(("gdth_get_cmd_index() hanum %d\n", ha->hanum)); in gdth_get_cmd_index()
1323 if (ha->cmd_tab[i].cmnd == UNUSED_CMND) { in gdth_get_cmd_index()
1324 ha->cmd_tab[i].cmnd = ha->pccb->RequestBuffer; in gdth_get_cmd_index()
1325 ha->cmd_tab[i].service = ha->pccb->Service; in gdth_get_cmd_index()
1326 ha->pccb->CommandIndex = (u32)i+2; in gdth_get_cmd_index()
1334 static void gdth_set_sema0(gdth_ha_str *ha) in gdth_set_sema0() argument
1336 TRACE(("gdth_set_sema0() hanum %d\n", ha->hanum)); in gdth_set_sema0()
1338 if (ha->type == GDT_EISA) { in gdth_set_sema0()
1339 outb(1, ha->bmic + SEMA0REG); in gdth_set_sema0()
1340 } else if (ha->type == GDT_ISA) { in gdth_set_sema0()
1341 writeb(1, &((gdt2_dpram_str __iomem *)ha->brd)->u.ic.Sema0); in gdth_set_sema0()
1342 } else if (ha->type == GDT_PCI) { in gdth_set_sema0()
1343 writeb(1, &((gdt6_dpram_str __iomem *)ha->brd)->u.ic.Sema0); in gdth_set_sema0()
1344 } else if (ha->type == GDT_PCINEW) { in gdth_set_sema0()
1345 outb(1, PTR2USHORT(&ha->plx->sema0_reg)); in gdth_set_sema0()
1346 } else if (ha->type == GDT_PCIMPR) { in gdth_set_sema0()
1347 writeb(1, &((gdt6m_dpram_str __iomem *)ha->brd)->i960r.sema0_reg); in gdth_set_sema0()
1352 static void gdth_copy_command(gdth_ha_str *ha) in gdth_copy_command() argument
1361 TRACE(("gdth_copy_command() hanum %d\n", ha->hanum)); in gdth_copy_command()
1363 cp_count = ha->cmd_len; in gdth_copy_command()
1364 dp_offset= ha->cmd_offs_dpmem; in gdth_copy_command()
1365 cmd_no = ha->cmd_cnt; in gdth_copy_command()
1366 cmd_ptr = ha->pccb; in gdth_copy_command()
1368 ++ha->cmd_cnt; in gdth_copy_command()
1369 if (ha->type == GDT_EISA) in gdth_copy_command()
1376 ha->cmd_offs_dpmem += cp_count; in gdth_copy_command()
1379 if (ha->type == GDT_ISA) { in gdth_copy_command()
1380 dp2_ptr = ha->brd; in gdth_copy_command()
1386 } else if (ha->type == GDT_PCI) { in gdth_copy_command()
1387 dp6_ptr = ha->brd; in gdth_copy_command()
1393 } else if (ha->type == GDT_PCINEW) { in gdth_copy_command()
1394 dp6c_ptr = ha->brd; in gdth_copy_command()
1400 } else if (ha->type == GDT_PCIMPR) { in gdth_copy_command()
1401 dp6m_ptr = ha->brd; in gdth_copy_command()
1411 static void gdth_release_event(gdth_ha_str *ha) in gdth_release_event() argument
1413 TRACE(("gdth_release_event() hanum %d\n", ha->hanum)); in gdth_release_event()
1419 if (ha->cmd_tab[j].cmnd != UNUSED_CMND) in gdth_release_event()
1429 if (ha->pccb->OpCode == GDT_INIT) in gdth_release_event()
1430 ha->pccb->Service |= 0x80; in gdth_release_event()
1432 if (ha->type == GDT_EISA) { in gdth_release_event()
1433 if (ha->pccb->OpCode == GDT_INIT) /* store DMA buffer */ in gdth_release_event()
1434 outl(ha->ccb_phys, ha->bmic + MAILBOXREG); in gdth_release_event()
1435 outb(ha->pccb->Service, ha->bmic + LDOORREG); in gdth_release_event()
1436 } else if (ha->type == GDT_ISA) { in gdth_release_event()
1437 writeb(0, &((gdt2_dpram_str __iomem *)ha->brd)->io.event); in gdth_release_event()
1438 } else if (ha->type == GDT_PCI) { in gdth_release_event()
1439 writeb(0, &((gdt6_dpram_str __iomem *)ha->brd)->io.event); in gdth_release_event()
1440 } else if (ha->type == GDT_PCINEW) { in gdth_release_event()
1441 outb(1, PTR2USHORT(&ha->plx->ldoor_reg)); in gdth_release_event()
1442 } else if (ha->type == GDT_PCIMPR) { in gdth_release_event()
1443 writeb(1, &((gdt6m_dpram_str __iomem *)ha->brd)->i960r.ldoor_reg); in gdth_release_event()
1447 static int gdth_wait(gdth_ha_str *ha, int index, u32 time) in gdth_wait() argument
1452 TRACE(("gdth_wait() hanum %d index %d time %d\n", ha->hanum, index, time)); in gdth_wait()
1458 __gdth_interrupt(ha, true, &wait_index); in gdth_wait()
1466 while (gdth_test_busy(ha)) in gdth_wait()
1473 static int gdth_internal_cmd(gdth_ha_str *ha, u8 service, u16 opcode, in gdth_internal_cmd() argument
1481 cmd_ptr = ha->pccb; in gdth_internal_cmd()
1488 if (!(index=gdth_get_cmd_index(ha))) { in gdth_internal_cmd()
1492 gdth_set_sema0(ha); in gdth_internal_cmd()
1500 cmd_ptr->u.ioctl.p_param = ha->scratch_phys; in gdth_internal_cmd()
1502 if (ha->cache_feat & GDT_64BIT) { in gdth_internal_cmd()
1511 if (ha->raw_feat & GDT_64BIT) { in gdth_internal_cmd()
1529 ha->cmd_len = sizeof(gdth_cmd_str); in gdth_internal_cmd()
1530 ha->cmd_offs_dpmem = 0; in gdth_internal_cmd()
1531 ha->cmd_cnt = 0; in gdth_internal_cmd()
1532 gdth_copy_command(ha); in gdth_internal_cmd()
1533 gdth_release_event(ha); in gdth_internal_cmd()
1535 if (!gdth_wait(ha, index, INIT_TIMEOUT)) { in gdth_internal_cmd()
1539 if (ha->status != S_BSY || --retries == 0) in gdth_internal_cmd()
1544 return (ha->status != S_OK ? 0:1); in gdth_internal_cmd()
1550 static int gdth_search_drives(gdth_ha_str *ha) in gdth_search_drives() argument
1571 TRACE(("gdth_search_drives() hanum %d\n", ha->hanum)); in gdth_search_drives()
1575 ha->screen_feat = 0; in gdth_search_drives()
1577 ok = gdth_internal_cmd(ha, SCREENSERVICE, GDT_X_INIT_SCR, 0, 0, 0); in gdth_search_drives()
1579 ha->screen_feat = GDT_64BIT; in gdth_search_drives()
1581 if (force_dma32 || (!ok && ha->status == (u16)S_NOFUNC)) in gdth_search_drives()
1582 ok = gdth_internal_cmd(ha, SCREENSERVICE, GDT_INIT, 0, 0, 0); in gdth_search_drives()
1585 ha->hanum, ha->status); in gdth_search_drives()
1609 gdth_internal_cmd(ha, SCREENSERVICE, GDT_REALTIME, *(u32 *)&rtc[0], in gdth_search_drives()
1614 gdth_internal_cmd(ha, CACHESERVICE, GDT_UNFREEZE_IO, 0, 0, 0); in gdth_search_drives()
1617 ha->cache_feat = 0; in gdth_search_drives()
1619 ok = gdth_internal_cmd(ha, CACHESERVICE, GDT_X_INIT_HOST, LINUX_OS, in gdth_search_drives()
1622 ha->cache_feat = GDT_64BIT; in gdth_search_drives()
1624 if (force_dma32 || (!ok && ha->status == (u16)S_NOFUNC)) in gdth_search_drives()
1625 ok = gdth_internal_cmd(ha, CACHESERVICE, GDT_INIT, LINUX_OS, 0, 0); in gdth_search_drives()
1628 ha->hanum, ha->status); in gdth_search_drives()
1632 cdev_cnt = (u16)ha->info; in gdth_search_drives()
1633 ha->fw_vers = ha->service; in gdth_search_drives()
1636 if (ha->type == GDT_PCIMPR) { in gdth_search_drives()
1638 pmod = (gdth_perf_modes *)ha->pscratch; in gdth_search_drives()
1641 *((u64 *)&pmod->st_buff_addr1) = ha->coal_stat_phys; in gdth_search_drives()
1657 if (gdth_internal_cmd(ha, CACHESERVICE, GDT_IOCTL, SET_PERF_MODES, in gdth_search_drives()
1659 printk("GDT-HA %d: Interrupt coalescing activated\n", ha->hanum); in gdth_search_drives()
1665 iocr = (gdth_raw_iochan_str *)ha->pscratch; in gdth_search_drives()
1671 if (gdth_internal_cmd(ha, CACHESERVICE, GDT_IOCTL, IOCHAN_RAW_DESC, in gdth_search_drives()
1674 ha->bus_cnt = iocr->hdr.chan_count; in gdth_search_drives()
1675 for (bus_no = 0; bus_no < ha->bus_cnt; ++bus_no) { in gdth_search_drives()
1677 ha->bus_id[bus_no] = iocr->list[bus_no].proc_id; in gdth_search_drives()
1679 ha->bus_id[bus_no] = 0xff; in gdth_search_drives()
1683 chn = (gdth_getch_str *)ha->pscratch; in gdth_search_drives()
1686 if (!gdth_internal_cmd(ha, CACHESERVICE, GDT_IOCTL, in gdth_search_drives()
1692 ha->hanum, ha->status); in gdth_search_drives()
1698 ha->bus_id[bus_no] = chn->siop_id; in gdth_search_drives()
1700 ha->bus_id[bus_no] = 0xff; in gdth_search_drives()
1702 ha->bus_cnt = (u8)bus_no; in gdth_search_drives()
1704 TRACE2(("gdth_search_drives() %d channels\n",ha->bus_cnt)); in gdth_search_drives()
1707 if (!gdth_internal_cmd(ha, CACHESERVICE, GDT_IOCTL, CACHE_INFO, in gdth_search_drives()
1710 ha->hanum, ha->status); in gdth_search_drives()
1713 ha->cpar = ((gdth_cinfo_str *)ha->pscratch)->cpar; in gdth_search_drives()
1715 ha->cpar.version,ha->cpar.state,ha->cpar.strategy, in gdth_search_drives()
1716 ha->cpar.write_back,ha->cpar.block_size)); in gdth_search_drives()
1719 ha->more_proc = FALSE; in gdth_search_drives()
1720 if (gdth_internal_cmd(ha, CACHESERVICE, GDT_IOCTL, BOARD_INFO, in gdth_search_drives()
1722 memcpy(&ha->binfo, (gdth_binfo_str *)ha->pscratch, in gdth_search_drives()
1724 if (gdth_internal_cmd(ha, CACHESERVICE, GDT_IOCTL, BOARD_FEATURES, in gdth_search_drives()
1727 ha->bfeat = *(gdth_bfeat_str *)ha->pscratch; in gdth_search_drives()
1728 ha->more_proc = TRUE; in gdth_search_drives()
1732 strcpy(ha->binfo.type_string, gdth_ctr_name(ha)); in gdth_search_drives()
1734 TRACE2(("Controller name: %s\n",ha->binfo.type_string)); in gdth_search_drives()
1737 if (ha->more_proc) { in gdth_search_drives()
1739 ioc = (gdth_iochan_str *)ha->pscratch; in gdth_search_drives()
1745 if (gdth_internal_cmd(ha, CACHESERVICE, GDT_IOCTL, IOCHAN_DESC, in gdth_search_drives()
1747 for (bus_no = 0; bus_no < ha->bus_cnt; ++bus_no) { in gdth_search_drives()
1748 ha->raw[bus_no].address = ioc->list[bus_no].address; in gdth_search_drives()
1749 ha->raw[bus_no].local_no = ioc->list[bus_no].local_no; in gdth_search_drives()
1752 for (bus_no = 0; bus_no < ha->bus_cnt; ++bus_no) { in gdth_search_drives()
1753 ha->raw[bus_no].address = IO_CHANNEL; in gdth_search_drives()
1754 ha->raw[bus_no].local_no = bus_no; in gdth_search_drives()
1757 for (bus_no = 0; bus_no < ha->bus_cnt; ++bus_no) { in gdth_search_drives()
1758 chn = (gdth_getch_str *)ha->pscratch; in gdth_search_drives()
1759 chn->channel_no = ha->raw[bus_no].local_no; in gdth_search_drives()
1760 if (gdth_internal_cmd(ha, CACHESERVICE, GDT_IOCTL, in gdth_search_drives()
1762 ha->raw[bus_no].address | INVALID_CHANNEL, in gdth_search_drives()
1764 ha->raw[bus_no].pdev_cnt = chn->drive_cnt; in gdth_search_drives()
1768 if (ha->raw[bus_no].pdev_cnt > 0) { in gdth_search_drives()
1769 drl = (gdth_drlist_str *)ha->pscratch; in gdth_search_drives()
1770 drl->sc_no = ha->raw[bus_no].local_no; in gdth_search_drives()
1771 drl->sc_cnt = ha->raw[bus_no].pdev_cnt; in gdth_search_drives()
1772 if (gdth_internal_cmd(ha, CACHESERVICE, GDT_IOCTL, in gdth_search_drives()
1774 ha->raw[bus_no].address | INVALID_CHANNEL, in gdth_search_drives()
1776 for (j = 0; j < ha->raw[bus_no].pdev_cnt; ++j) in gdth_search_drives()
1777 ha->raw[bus_no].id_list[j] = drl->sc_list[j]; in gdth_search_drives()
1779 ha->raw[bus_no].pdev_cnt = 0; in gdth_search_drives()
1785 if (gdth_internal_cmd(ha, CACHESERVICE, GDT_IOCTL, CACHE_DRV_CNT, in gdth_search_drives()
1787 drv_cnt = *(u32 *)ha->pscratch; in gdth_search_drives()
1788 if (gdth_internal_cmd(ha, CACHESERVICE, GDT_IOCTL, CACHE_DRV_LIST, in gdth_search_drives()
1791 drv_no = ((u32 *)ha->pscratch)[j]; in gdth_search_drives()
1793 ha->hdr[drv_no].is_logdrv = TRUE; in gdth_search_drives()
1798 alst = (gdth_arcdl_str *)ha->pscratch; in gdth_search_drives()
1802 if (gdth_internal_cmd(ha, CACHESERVICE, GDT_IOCTL, in gdth_search_drives()
1807 ha->hdr[j].is_arraydrv = alst->list[j].is_arrayd; in gdth_search_drives()
1808 ha->hdr[j].is_master = alst->list[j].is_master; in gdth_search_drives()
1809 ha->hdr[j].is_parity = alst->list[j].is_parity; in gdth_search_drives()
1810 ha->hdr[j].is_hotfix = alst->list[j].is_hotfix; in gdth_search_drives()
1811 ha->hdr[j].master_no = alst->list[j].cd_handle; in gdth_search_drives()
1813 } else if (gdth_internal_cmd(ha, CACHESERVICE, GDT_IOCTL, in gdth_search_drives()
1817 alst2 = &((gdth_alist_str *)ha->pscratch)[j]; in gdth_search_drives()
1818 ha->hdr[j].is_arraydrv = alst2->is_arrayd; in gdth_search_drives()
1819 ha->hdr[j].is_master = alst2->is_master; in gdth_search_drives()
1820 ha->hdr[j].is_parity = alst2->is_parity; in gdth_search_drives()
1821 ha->hdr[j].is_hotfix = alst2->is_hotfix; in gdth_search_drives()
1822 ha->hdr[j].master_no = alst2->cd_handle; in gdth_search_drives()
1829 ha->raw_feat = 0; in gdth_search_drives()
1831 ok = gdth_internal_cmd(ha, SCSIRAWSERVICE, GDT_X_INIT_RAW, 0, 0, 0); in gdth_search_drives()
1833 ha->raw_feat = GDT_64BIT; in gdth_search_drives()
1835 if (force_dma32 || (!ok && ha->status == (u16)S_NOFUNC)) in gdth_search_drives()
1836 ok = gdth_internal_cmd(ha, SCSIRAWSERVICE, GDT_INIT, 0, 0, 0); in gdth_search_drives()
1839 ha->hanum, ha->status); in gdth_search_drives()
1845 if (gdth_internal_cmd(ha, SCSIRAWSERVICE, GDT_SET_FEAT, SCATTER_GATHER, in gdth_search_drives()
1848 if (gdth_internal_cmd(ha, SCSIRAWSERVICE, GDT_GET_FEAT, 0, 0, 0)) { in gdth_search_drives()
1850 ha->info)); in gdth_search_drives()
1851 ha->raw_feat |= (u16)ha->info; in gdth_search_drives()
1856 if (gdth_internal_cmd(ha, CACHESERVICE, GDT_SET_FEAT, 0, in gdth_search_drives()
1859 if (gdth_internal_cmd(ha, CACHESERVICE, GDT_GET_FEAT, 0, 0, 0)) { in gdth_search_drives()
1861 ha->info)); in gdth_search_drives()
1862 ha->cache_feat |= (u16)ha->info; in gdth_search_drives()
1868 gdth_internal_cmd(ha, SCSIRAWSERVICE, GDT_RESERVE_ALL, in gdth_search_drives()
1871 ha->status)); in gdth_search_drives()
1874 if (reserve_list[i] == ha->hanum && reserve_list[i+1] < ha->bus_cnt && in gdth_search_drives()
1875 reserve_list[i+2] < ha->tid_cnt && reserve_list[i+3] < MAXLUN) { in gdth_search_drives()
1879 if (!gdth_internal_cmd(ha, SCSIRAWSERVICE, GDT_RESERVE, 0, in gdth_search_drives()
1883 ha->hanum, ha->status); in gdth_search_drives()
1889 oemstr = (gdth_oem_str_ioctl *)ha->pscratch; in gdth_search_drives()
1892 if (gdth_internal_cmd(ha, CACHESERVICE, GDT_IOCTL, in gdth_search_drives()
1897 ha->hanum, oemstr->text.oem_company_name, ha->binfo.type_string); in gdth_search_drives()
1899 strlcpy(ha->oem_name,oemstr->text.scsi_host_drive_inquiry_vendor_id, in gdth_search_drives()
1900 sizeof(ha->oem_name)); in gdth_search_drives()
1905 ha->hanum, ha->binfo.type_string); in gdth_search_drives()
1906 if (ha->oem_id == OEM_ID_INTEL) in gdth_search_drives()
1907 strlcpy(ha->oem_name,"Intel ", sizeof(ha->oem_name)); in gdth_search_drives()
1909 strlcpy(ha->oem_name,"ICP ", sizeof(ha->oem_name)); in gdth_search_drives()
1914 gdth_analyse_hdrive(ha, i); in gdth_search_drives()
1920 static int gdth_analyse_hdrive(gdth_ha_str *ha, u16 hdrive) in gdth_analyse_hdrive() argument
1925 TRACE(("gdth_analyse_hdrive() hanum %d drive %d\n", ha->hanum, hdrive)); in gdth_analyse_hdrive()
1929 if (!gdth_internal_cmd(ha, CACHESERVICE, GDT_INFO, hdrive, 0, 0)) in gdth_analyse_hdrive()
1931 ha->hdr[hdrive].present = TRUE; in gdth_analyse_hdrive()
1932 ha->hdr[hdrive].size = ha->info; in gdth_analyse_hdrive()
1935 ha->hdr[hdrive].size &= ~SECS32; in gdth_analyse_hdrive()
1936 if (ha->info2 == 0) { in gdth_analyse_hdrive()
1937 gdth_eval_mapping(ha->hdr[hdrive].size,&drv_cyls,&drv_hds,&drv_secs); in gdth_analyse_hdrive()
1939 drv_hds = ha->info2 & 0xff; in gdth_analyse_hdrive()
1940 drv_secs = (ha->info2 >> 8) & 0xff; in gdth_analyse_hdrive()
1941 drv_cyls = (u32)ha->hdr[hdrive].size / drv_hds / drv_secs; in gdth_analyse_hdrive()
1943 ha->hdr[hdrive].heads = (u8)drv_hds; in gdth_analyse_hdrive()
1944 ha->hdr[hdrive].secs = (u8)drv_secs; in gdth_analyse_hdrive()
1946 ha->hdr[hdrive].size = drv_cyls * drv_hds * drv_secs; in gdth_analyse_hdrive()
1948 if (ha->cache_feat & GDT_64BIT) { in gdth_analyse_hdrive()
1949 if (gdth_internal_cmd(ha, CACHESERVICE, GDT_X_INFO, hdrive, 0, 0) in gdth_analyse_hdrive()
1950 && ha->info2 != 0) { in gdth_analyse_hdrive()
1951 ha->hdr[hdrive].size = ((u64)ha->info2 << 32) | ha->info; in gdth_analyse_hdrive()
1955 hdrive,ha->hdr[hdrive].size,drv_hds,drv_secs)); in gdth_analyse_hdrive()
1958 if (gdth_internal_cmd(ha, CACHESERVICE, GDT_DEVTYPE, hdrive, 0, 0)) { in gdth_analyse_hdrive()
1960 hdrive,ha->info)); in gdth_analyse_hdrive()
1961 ha->hdr[hdrive].devtype = (u16)ha->info; in gdth_analyse_hdrive()
1965 if (gdth_internal_cmd(ha, CACHESERVICE, GDT_CLUST_INFO, hdrive, 0, 0)) { in gdth_analyse_hdrive()
1967 hdrive,ha->info)); in gdth_analyse_hdrive()
1969 ha->hdr[hdrive].cluster_type = (u8)ha->info; in gdth_analyse_hdrive()
1973 if (gdth_internal_cmd(ha, CACHESERVICE, GDT_RW_ATTRIBS, hdrive, 0, 0)) { in gdth_analyse_hdrive()
1975 hdrive,ha->info)); in gdth_analyse_hdrive()
1976 ha->hdr[hdrive].rw_attribs = (u8)ha->info; in gdth_analyse_hdrive()
1985 static void gdth_putq(gdth_ha_str *ha, Scsi_Cmnd *scp, u8 priority) in gdth_putq() argument
1993 spin_lock_irqsave(&ha->smp_lock, flags); in gdth_putq()
1998 if (ha->req_first==NULL) { in gdth_putq()
1999 ha->req_first = scp; /* queue was empty */ in gdth_putq()
2002 pscp = ha->req_first; in gdth_putq()
2012 spin_unlock_irqrestore(&ha->smp_lock, flags); in gdth_putq()
2016 for (nscp=ha->req_first; nscp; nscp=(Scsi_Cmnd*)nscp->SCp.ptr) in gdth_putq()
2025 static void gdth_next(gdth_ha_str *ha) in gdth_next() argument
2034 TRACE(("gdth_next() hanum %d\n", ha->hanum)); in gdth_next()
2036 spin_lock_irqsave(&ha->smp_lock, flags); in gdth_next()
2038 ha->cmd_cnt = ha->cmd_offs_dpmem = 0; in gdth_next()
2043 for (nscp = pscp = ha->req_first; nscp; nscp = (Scsi_Cmnd *)nscp->SCp.ptr) { in gdth_next()
2052 if ((b != ha->virt_bus && ha->raw[BUS_L2P(ha,b)].lock) || in gdth_next()
2053 (b == ha->virt_bus && t < MAX_HDRIVES && ha->hdr[t].lock)) in gdth_next()
2060 if (gdth_test_busy(ha)) { /* controller busy ? */ in gdth_next()
2061 TRACE(("gdth_next() controller %d busy !\n", ha->hanum)); in gdth_next()
2063 spin_unlock_irqrestore(&ha->smp_lock, flags); in gdth_next()
2066 while (gdth_test_busy(ha)) in gdth_next()
2079 if ((ha->scan_mode & 0x0f) == 0) { in gdth_next()
2081 ha->scan_mode |= 1; in gdth_next()
2082 TRACE2(("Scan mode: 0x%x\n", ha->scan_mode)); in gdth_next()
2084 } else if ((ha->scan_mode & 0x0f) == 1) { in gdth_next()
2088 nscp_cmndinfo->phase = ((ha->scan_mode & 0x10 ? 1:0) << 8) in gdth_next()
2090 ha->scan_mode = 0x12; in gdth_next()
2092 ha->scan_mode)); in gdth_next()
2094 ha->scan_mode &= 0x10; in gdth_next()
2095 TRACE2(("Scan mode: 0x%x\n", ha->scan_mode)); in gdth_next()
2097 } else if (ha->scan_mode == 0x12) { in gdth_next()
2098 if (b == ha->bus_cnt && t == ha->tid_cnt-1) { in gdth_next()
2101 ha->scan_mode &= 0x10; in gdth_next()
2103 ha->scan_mode)); in gdth_next()
2107 if (b == ha->virt_bus && nscp->cmnd[0] != INQUIRY && in gdth_next()
2109 (ha->hdr[t].cluster_type & CLUSTER_DRIVE)) { in gdth_next()
2118 if (!(cmd_index=gdth_fill_cache_cmd(ha, nscp, t))) in gdth_next()
2122 if (!(cmd_index=gdth_fill_raw_cmd(ha, nscp, BUS_L2P(ha, b)))) in gdth_next()
2136 if (!(cmd_index=gdth_special_cmd(ha, nscp))) in gdth_next()
2139 } else if (b != ha->virt_bus) { in gdth_next()
2140 if (ha->raw[BUS_L2P(ha,b)].io_cnt[t] >= GDTH_MAX_RAW || in gdth_next()
2141 !(cmd_index=gdth_fill_raw_cmd(ha, nscp, BUS_L2P(ha, b)))) in gdth_next()
2144 ha->raw[BUS_L2P(ha,b)].io_cnt[t]++; in gdth_next()
2145 } else if (t >= MAX_HDRIVES || !ha->hdr[t].present || l != 0) { in gdth_next()
2166 if (ha->hdr[t].media_changed && nscp->cmnd[0] != INQUIRY) { in gdth_next()
2170 ha->hdr[t].media_changed = FALSE; in gdth_next()
2179 } else if (gdth_internal_cache_cmd(ha, nscp)) in gdth_next()
2187 if ( (nscp->cmnd[4]&1) && !(ha->hdr[t].devtype&1) ) { in gdth_next()
2196 nscp->cmnd[3] = (ha->hdr[t].devtype&1) ? 1:0; in gdth_next()
2199 if (!(cmd_index=gdth_fill_cache_cmd(ha, nscp, t))) in gdth_next()
2208 if (!(cmd_index=gdth_fill_cache_cmd(ha, nscp, t))) in gdth_next()
2218 if (ha->hdr[t].media_changed) { in gdth_next()
2222 ha->hdr[t].media_changed = FALSE; in gdth_next()
2231 } else if (!(cmd_index=gdth_fill_cache_cmd(ha, nscp, t))) in gdth_next()
2240 ha->hanum, nscp->cmnd[0]); in gdth_next()
2252 if (nscp == ha->req_first) in gdth_next()
2253 ha->req_first = pscp = (Scsi_Cmnd *)nscp->SCp.ptr; in gdth_next()
2260 if (ha->cmd_cnt > 0) { in gdth_next()
2261 gdth_release_event(ha); in gdth_next()
2265 spin_unlock_irqrestore(&ha->smp_lock, flags); in gdth_next()
2267 if (gdth_polling && ha->cmd_cnt > 0) { in gdth_next()
2268 if (!gdth_wait(ha, cmd_index, POLL_TIMEOUT)) in gdth_next()
2270 ha->hanum, cmd_index); in gdth_next()
2278 static void gdth_copy_internal_data(gdth_ha_str *ha, Scsi_Cmnd *scp, in gdth_copy_internal_data() argument
2300 ha->hanum); in gdth_copy_internal_data()
2315 ha->hanum); in gdth_copy_internal_data()
2320 static int gdth_internal_cache_cmd(gdth_ha_str *ha, Scsi_Cmnd *scp) in gdth_internal_cache_cmd() argument
2345 t,ha->hdr[t].devtype)); in gdth_internal_cache_cmd()
2346 inq.type_qual = (ha->hdr[t].devtype&4) ? TYPE_ROM:TYPE_DISK; in gdth_internal_cache_cmd()
2350 if ((ha->hdr[t].devtype & 1) || in gdth_internal_cache_cmd()
2351 (ha->hdr[t].cluster_type & CLUSTER_DRIVE)) in gdth_internal_cache_cmd()
2356 strcpy(inq.vendor,ha->oem_name); in gdth_internal_cache_cmd()
2359 gdth_copy_internal_data(ha, scp, (char*)&inq, sizeof(gdth_inq_data)); in gdth_internal_cache_cmd()
2369 gdth_copy_internal_data(ha, scp, (char*)&sd, sizeof(gdth_sense_data)); in gdth_internal_cache_cmd()
2376 mpd.hd.dev_par = (ha->hdr[t].devtype&2) ? 0x80:0; in gdth_internal_cache_cmd()
2381 gdth_copy_internal_data(ha, scp, (char*)&mpd, sizeof(gdth_modep_data)); in gdth_internal_cache_cmd()
2386 if (ha->hdr[t].size > (u64)0xffffffff) in gdth_internal_cache_cmd()
2389 rdc.last_block_no = cpu_to_be32(ha->hdr[t].size-1); in gdth_internal_cache_cmd()
2391 gdth_copy_internal_data(ha, scp, (char*)&rdc, sizeof(gdth_rdcap_data)); in gdth_internal_cache_cmd()
2396 (ha->cache_feat & GDT_64BIT)) { in gdth_internal_cache_cmd()
2400 rdc16.last_block_no = cpu_to_be64(ha->hdr[t].size-1); in gdth_internal_cache_cmd()
2402 gdth_copy_internal_data(ha, scp, (char*)&rdc16, in gdth_internal_cache_cmd()
2422 static int gdth_fill_cache_cmd(gdth_ha_str *ha, Scsi_Cmnd *scp, u16 hdrive) in gdth_fill_cache_cmd() argument
2430 cmdp = ha->pccb; in gdth_fill_cache_cmd()
2434 if (ha->type==GDT_EISA && ha->cmd_cnt>0) in gdth_fill_cache_cmd()
2437 mode64 = (ha->cache_feat & GDT_64BIT) ? TRUE : FALSE; in gdth_fill_cache_cmd()
2445 if (!(cmd_index=gdth_get_cmd_index(ha))) { in gdth_fill_cache_cmd()
2450 if (ha->cmd_cnt == 0) in gdth_fill_cache_cmd()
2451 gdth_set_sema0(ha); in gdth_fill_cache_cmd()
2472 if (gdth_write_through || ((ha->hdr[hdrive].rw_attribs & 1) && in gdth_fill_cache_cmd()
2473 (ha->cache_feat & GDT_WR_THROUGH))) in gdth_fill_cache_cmd()
2520 sgcnt = pci_map_sg(ha->pdev, scsi_sglist(scp), scsi_sg_count(scp), in gdth_fill_cache_cmd()
2531 ha->dma64_cnt++; in gdth_fill_cache_cmd()
2533 ha->dma32_cnt++; in gdth_fill_cache_cmd()
2545 ha->dma32_cnt++; in gdth_fill_cache_cmd()
2568 ha->cmd_len = GDTOFFSOF(gdth_cmd_str,u.cache64.sg_lst) + in gdth_fill_cache_cmd()
2577 ha->cmd_len = GDTOFFSOF(gdth_cmd_str,u.cache.sg_lst) + in gdth_fill_cache_cmd()
2580 if (ha->cmd_len & 3) in gdth_fill_cache_cmd()
2581 ha->cmd_len += (4 - (ha->cmd_len & 3)); in gdth_fill_cache_cmd()
2583 if (ha->cmd_cnt > 0) { in gdth_fill_cache_cmd()
2584 if ((ha->cmd_offs_dpmem + ha->cmd_len + DPMEM_COMMAND_OFFSET) > in gdth_fill_cache_cmd()
2585 ha->ic_all_size) { in gdth_fill_cache_cmd()
2587 ha->cmd_tab[cmd_index-2].cmnd = UNUSED_CMND; in gdth_fill_cache_cmd()
2593 gdth_copy_command(ha); in gdth_fill_cache_cmd()
2597 static int gdth_fill_raw_cmd(gdth_ha_str *ha, Scsi_Cmnd *scp, u8 b) in gdth_fill_raw_cmd() argument
2610 cmdp = ha->pccb; in gdth_fill_raw_cmd()
2614 if (ha->type==GDT_EISA && ha->cmd_cnt>0) in gdth_fill_raw_cmd()
2617 mode64 = (ha->raw_feat & GDT_64BIT) ? TRUE : FALSE; in gdth_fill_raw_cmd()
2622 if (!(cmd_index=gdth_get_cmd_index(ha))) { in gdth_fill_raw_cmd()
2627 if (ha->cmd_cnt == 0) in gdth_fill_raw_cmd()
2628 gdth_set_sema0(ha); in gdth_fill_raw_cmd()
2640 ha->cmd_len = GDTOFFSOF(gdth_cmd_str,u.raw64.sg_lst); in gdth_fill_raw_cmd()
2646 ha->cmd_len = GDTOFFSOF(gdth_cmd_str,u.raw.sg_lst); in gdth_fill_raw_cmd()
2652 sense_paddr = pci_map_page(ha->pdev,page,offset, in gdth_fill_raw_cmd()
2695 sgcnt = pci_map_sg(ha->pdev, scsi_sglist(scp), scsi_sg_count(scp), in gdth_fill_raw_cmd()
2706 ha->dma64_cnt++; in gdth_fill_raw_cmd()
2708 ha->dma32_cnt++; in gdth_fill_raw_cmd()
2720 ha->dma32_cnt++; in gdth_fill_raw_cmd()
2740 ha->cmd_len = GDTOFFSOF(gdth_cmd_str,u.raw64.sg_lst) + in gdth_fill_raw_cmd()
2748 ha->cmd_len = GDTOFFSOF(gdth_cmd_str,u.raw.sg_lst) + in gdth_fill_raw_cmd()
2753 if (ha->cmd_len & 3) in gdth_fill_raw_cmd()
2754 ha->cmd_len += (4 - (ha->cmd_len & 3)); in gdth_fill_raw_cmd()
2756 if (ha->cmd_cnt > 0) { in gdth_fill_raw_cmd()
2757 if ((ha->cmd_offs_dpmem + ha->cmd_len + DPMEM_COMMAND_OFFSET) > in gdth_fill_raw_cmd()
2758 ha->ic_all_size) { in gdth_fill_raw_cmd()
2760 ha->cmd_tab[cmd_index-2].cmnd = UNUSED_CMND; in gdth_fill_raw_cmd()
2766 gdth_copy_command(ha); in gdth_fill_raw_cmd()
2770 static int gdth_special_cmd(gdth_ha_str *ha, Scsi_Cmnd *scp) in gdth_special_cmd() argument
2776 cmdp= ha->pccb; in gdth_special_cmd()
2779 if (ha->type==GDT_EISA && ha->cmd_cnt>0) in gdth_special_cmd()
2786 if (!(cmd_index=gdth_get_cmd_index(ha))) { in gdth_special_cmd()
2792 if (ha->cmd_cnt == 0) in gdth_special_cmd()
2793 gdth_set_sema0(ha); in gdth_special_cmd()
2798 ha->cmd_len = in gdth_special_cmd()
2802 if (ha->cache_feat & GDT_64BIT) in gdth_special_cmd()
2803 ha->cmd_len = in gdth_special_cmd()
2806 ha->cmd_len = in gdth_special_cmd()
2810 if (ha->raw_feat & GDT_64BIT) in gdth_special_cmd()
2811 ha->cmd_len = in gdth_special_cmd()
2814 ha->cmd_len = in gdth_special_cmd()
2818 if (ha->cmd_len & 3) in gdth_special_cmd()
2819 ha->cmd_len += (4 - (ha->cmd_len & 3)); in gdth_special_cmd()
2821 if (ha->cmd_cnt > 0) { in gdth_special_cmd()
2822 if ((ha->cmd_offs_dpmem + ha->cmd_len + DPMEM_COMMAND_OFFSET) > in gdth_special_cmd()
2823 ha->ic_all_size) { in gdth_special_cmd()
2825 ha->cmd_tab[cmd_index-2].cmnd = UNUSED_CMND; in gdth_special_cmd()
2831 gdth_copy_command(ha); in gdth_special_cmd()
2837 static gdth_evt_str *gdth_store_event(gdth_ha_str *ha, u16 source, in gdth_store_event() argument
2883 static int gdth_read_event(gdth_ha_str *ha, int handle, gdth_evt_str *estr) in gdth_read_event() argument
2890 spin_lock_irqsave(&ha->smp_lock, flags); in gdth_read_event()
2898 spin_unlock_irqrestore(&ha->smp_lock, flags); in gdth_read_event()
2911 spin_unlock_irqrestore(&ha->smp_lock, flags); in gdth_read_event()
2915 static void gdth_readapp_event(gdth_ha_str *ha, in gdth_readapp_event() argument
2924 spin_lock_irqsave(&ha->smp_lock, flags); in gdth_readapp_event()
2944 spin_unlock_irqrestore(&ha->smp_lock, flags); in gdth_readapp_event()
2958 static irqreturn_t __gdth_interrupt(gdth_ha_str *ha, in __gdth_interrupt() argument
2976 TRACE(("gdth_interrupt() IRQ %d\n", ha->irq)); in __gdth_interrupt()
2986 spin_lock_irqsave(&ha->smp_lock, flags); in __gdth_interrupt()
2989 IStatus = gdth_get_status(ha); in __gdth_interrupt()
2993 spin_unlock_irqrestore(&ha->smp_lock, flags); in __gdth_interrupt()
3006 pcs = ha->coal_stat; in __gdth_interrupt()
3019 if (ha->type == GDT_EISA) { in __gdth_interrupt()
3022 ha->status = inw(ha->bmic + MAILBOXREG+8); in __gdth_interrupt()
3023 TRACE2(("gdth_interrupt() error %d/%d\n",IStatus,ha->status)); in __gdth_interrupt()
3025 ha->status = S_OK; in __gdth_interrupt()
3026 ha->info = inl(ha->bmic + MAILBOXREG+12); in __gdth_interrupt()
3027 ha->service = inw(ha->bmic + MAILBOXREG+10); in __gdth_interrupt()
3028 ha->info2 = inl(ha->bmic + MAILBOXREG+4); in __gdth_interrupt()
3030 outb(0xff, ha->bmic + EDOORREG); /* acknowledge interrupt */ in __gdth_interrupt()
3031 outb(0x00, ha->bmic + SEMA1REG); /* reset status semaphore */ in __gdth_interrupt()
3032 } else if (ha->type == GDT_ISA) { in __gdth_interrupt()
3033 dp2_ptr = ha->brd; in __gdth_interrupt()
3036 ha->status = readw(&dp2_ptr->u.ic.Status); in __gdth_interrupt()
3037 TRACE2(("gdth_interrupt() error %d/%d\n",IStatus,ha->status)); in __gdth_interrupt()
3039 ha->status = S_OK; in __gdth_interrupt()
3040 ha->info = readl(&dp2_ptr->u.ic.Info[0]); in __gdth_interrupt()
3041 ha->service = readw(&dp2_ptr->u.ic.Service); in __gdth_interrupt()
3042 ha->info2 = readl(&dp2_ptr->u.ic.Info[1]); in __gdth_interrupt()
3047 } else if (ha->type == GDT_PCI) { in __gdth_interrupt()
3048 dp6_ptr = ha->brd; in __gdth_interrupt()
3051 ha->status = readw(&dp6_ptr->u.ic.Status); in __gdth_interrupt()
3052 TRACE2(("gdth_interrupt() error %d/%d\n",IStatus,ha->status)); in __gdth_interrupt()
3054 ha->status = S_OK; in __gdth_interrupt()
3055 ha->info = readl(&dp6_ptr->u.ic.Info[0]); in __gdth_interrupt()
3056 ha->service = readw(&dp6_ptr->u.ic.Service); in __gdth_interrupt()
3057 ha->info2 = readl(&dp6_ptr->u.ic.Info[1]); in __gdth_interrupt()
3062 } else if (ha->type == GDT_PCINEW) { in __gdth_interrupt()
3065 ha->status = inw(PTR2USHORT(&ha->plx->status)); in __gdth_interrupt()
3066 TRACE2(("gdth_interrupt() error %d/%d\n",IStatus,ha->status)); in __gdth_interrupt()
3068 ha->status = S_OK; in __gdth_interrupt()
3069 ha->info = inl(PTR2USHORT(&ha->plx->info[0])); in __gdth_interrupt()
3070 ha->service = inw(PTR2USHORT(&ha->plx->service)); in __gdth_interrupt()
3071 ha->info2 = inl(PTR2USHORT(&ha->plx->info[1])); in __gdth_interrupt()
3073 outb(0xff, PTR2USHORT(&ha->plx->edoor_reg)); in __gdth_interrupt()
3074 outb(0x00, PTR2USHORT(&ha->plx->sema1_reg)); in __gdth_interrupt()
3075 } else if (ha->type == GDT_PCIMPR) { in __gdth_interrupt()
3076 dp6m_ptr = ha->brd; in __gdth_interrupt()
3081 ha->status = pcs->ext_status & 0xffff; in __gdth_interrupt()
3084 ha->status = readw(&dp6m_ptr->i960r.status); in __gdth_interrupt()
3085 TRACE2(("gdth_interrupt() error %d/%d\n",IStatus,ha->status)); in __gdth_interrupt()
3087 ha->status = S_OK; in __gdth_interrupt()
3091 ha->info = pcs->info0; in __gdth_interrupt()
3092 ha->info2 = pcs->info1; in __gdth_interrupt()
3093 ha->service = (pcs->ext_status >> 16) & 0xffff; in __gdth_interrupt()
3097 ha->info = readl(&dp6m_ptr->i960r.info[0]); in __gdth_interrupt()
3098 ha->service = readw(&dp6m_ptr->i960r.service); in __gdth_interrupt()
3099 ha->info2 = readl(&dp6m_ptr->i960r.info[1]); in __gdth_interrupt()
3103 if (ha->service != SCREENSERVICE && in __gdth_interrupt()
3104 (ha->fw_vers & 0xff) >= 0x1a) { in __gdth_interrupt()
3105 ha->dvr.severity = readb in __gdth_interrupt()
3106 (&((gdt6m_dpram_str __iomem *)ha->brd)->i960r.severity); in __gdth_interrupt()
3108 ha->dvr.event_string[i] = readb in __gdth_interrupt()
3109 (&((gdt6m_dpram_str __iomem *)ha->brd)->i960r.evt_str[i]); in __gdth_interrupt()
3110 if (ha->dvr.event_string[i] == 0) in __gdth_interrupt()
3127 spin_unlock_irqrestore(&ha->smp_lock, flags); in __gdth_interrupt()
3132 IStatus,ha->status,ha->info)); in __gdth_interrupt()
3140 gdth_async_event(ha); in __gdth_interrupt()
3142 spin_unlock_irqrestore(&ha->smp_lock, flags); in __gdth_interrupt()
3143 gdth_next(ha); in __gdth_interrupt()
3149 ha->dvr.size = sizeof(ha->dvr.eu.driver); in __gdth_interrupt()
3150 ha->dvr.eu.driver.ionode = ha->hanum; in __gdth_interrupt()
3151 gdth_store_event(ha, ES_DRIVER, 4, &ha->dvr); in __gdth_interrupt()
3153 spin_unlock_irqrestore(&ha->smp_lock, flags); in __gdth_interrupt()
3156 scp = ha->cmd_tab[IStatus-2].cmnd; in __gdth_interrupt()
3157 Service = ha->cmd_tab[IStatus-2].service; in __gdth_interrupt()
3158 ha->cmd_tab[IStatus-2].cmnd = UNUSED_CMND; in __gdth_interrupt()
3161 ha->dvr.size = sizeof(ha->dvr.eu.driver); in __gdth_interrupt()
3162 ha->dvr.eu.driver.ionode = ha->hanum; in __gdth_interrupt()
3163 ha->dvr.eu.driver.index = IStatus; in __gdth_interrupt()
3164 gdth_store_event(ha, ES_DRIVER, 1, &ha->dvr); in __gdth_interrupt()
3166 spin_unlock_irqrestore(&ha->smp_lock, flags); in __gdth_interrupt()
3172 spin_unlock_irqrestore(&ha->smp_lock, flags); in __gdth_interrupt()
3177 rval = gdth_sync_event(ha,Service,IStatus,scp); in __gdth_interrupt()
3179 spin_unlock_irqrestore(&ha->smp_lock, flags); in __gdth_interrupt()
3181 gdth_putq(ha, scp, gdth_cmnd_priv(scp)->priority); in __gdth_interrupt()
3205 if (ha->type == GDT_PCIMPR && coalesced) { in __gdth_interrupt()
3211 gdth_next(ha); in __gdth_interrupt()
3217 gdth_ha_str *ha = dev_id; in gdth_interrupt() local
3219 return __gdth_interrupt(ha, false, NULL); in gdth_interrupt()
3222 static int gdth_sync_event(gdth_ha_str *ha, int service, u8 index, in gdth_sync_event() argument
3230 cmdp = ha->pccb; in gdth_sync_event()
3232 service,ha->status)); in gdth_sync_event()
3235 msg = ha->pmsg; in gdth_sync_event()
3247 while (gdth_test_busy(ha)) in gdth_sync_event()
3251 gdth_get_cmd_index(ha); in gdth_sync_event()
3252 gdth_set_sema0(ha); in gdth_sync_event()
3257 cmdp->u.screen.su.msg.msg_addr = ha->msg_phys; in gdth_sync_event()
3258 ha->cmd_offs_dpmem = 0; in gdth_sync_event()
3259 ha->cmd_len = GDTOFFSOF(gdth_cmd_str,u.screen.su.msg.msg_addr) in gdth_sync_event()
3261 ha->cmd_cnt = 0; in gdth_sync_event()
3262 gdth_copy_command(ha); in gdth_sync_event()
3263 gdth_release_event(ha); in gdth_sync_event()
3281 while (gdth_test_busy(ha)) in gdth_sync_event()
3285 gdth_get_cmd_index(ha); in gdth_sync_event()
3286 gdth_set_sema0(ha); in gdth_sync_event()
3291 cmdp->u.screen.su.msg.msg_addr = ha->msg_phys; in gdth_sync_event()
3292 ha->cmd_offs_dpmem = 0; in gdth_sync_event()
3293 ha->cmd_len = GDTOFFSOF(gdth_cmd_str,u.screen.su.msg.msg_addr) in gdth_sync_event()
3295 ha->cmd_cnt = 0; in gdth_sync_event()
3296 gdth_copy_command(ha); in gdth_sync_event()
3297 gdth_release_event(ha); in gdth_sync_event()
3305 if (cmndinfo->OpCode == -1 && b != ha->virt_bus) { in gdth_sync_event()
3306 ha->raw[BUS_L2P(ha,b)].io_cnt[t]--; in gdth_sync_event()
3309 if (ha->status == S_BSY) { in gdth_sync_event()
3317 pci_unmap_sg(ha->pdev, scsi_sglist(scp), scsi_sg_count(scp), in gdth_sync_event()
3321 pci_unmap_page(ha->pdev, cmndinfo->sense_paddr, 16, in gdth_sync_event()
3324 if (ha->status == S_OK) { in gdth_sync_event()
3326 cmndinfo->info = ha->info; in gdth_sync_event()
3332 ha->hdr[t].cluster_type = (u8)ha->info; in gdth_sync_event()
3333 if (!(ha->hdr[t].cluster_type & in gdth_sync_event()
3337 if (ha->hdr[t].cluster_type & in gdth_sync_event()
3347 ha->hdr[t].cluster_type |= CLUSTER_MOUNTED; in gdth_sync_event()
3348 ha->hdr[t].media_changed = TRUE; in gdth_sync_event()
3350 ha->hdr[t].cluster_type &= ~CLUSTER_MOUNTED; in gdth_sync_event()
3351 ha->hdr[t].media_changed = TRUE; in gdth_sync_event()
3361 ha->hdr[t].cluster_type |= CLUSTER_RESERVED; in gdth_sync_event()
3363 ha->hdr[t].cluster_type &= ~CLUSTER_RESERVED; in gdth_sync_event()
3369 cmndinfo->status = ha->status; in gdth_sync_event()
3370 cmndinfo->info = ha->info; in gdth_sync_event()
3374 cmndinfo->OpCode, ha->status)); in gdth_sync_event()
3387 if (ha->status == S_CACHE_UNKNOWN && in gdth_sync_event()
3388 (ha->hdr[t].cluster_type & in gdth_sync_event()
3391 ha->hdr[t].cluster_type &= ~CLUSTER_RESERVED; in gdth_sync_event()
3394 if (ha->status == (u16)S_CACHE_RESERV) { in gdth_sync_event()
3402 ha->dvr.size = sizeof(ha->dvr.eu.sync); in gdth_sync_event()
3403 ha->dvr.eu.sync.ionode = ha->hanum; in gdth_sync_event()
3404 ha->dvr.eu.sync.service = service; in gdth_sync_event()
3405 ha->dvr.eu.sync.status = ha->status; in gdth_sync_event()
3406 ha->dvr.eu.sync.info = ha->info; in gdth_sync_event()
3407 ha->dvr.eu.sync.hostdrive = t; in gdth_sync_event()
3408 if (ha->status >= 0x8000) in gdth_sync_event()
3409 gdth_store_event(ha, ES_SYNC, 0, &ha->dvr); in gdth_sync_event()
3411 gdth_store_event(ha, ES_SYNC, service, &ha->dvr); in gdth_sync_event()
3415 if (ha->status != S_RAW_SCSI || ha->info >= 0x100) { in gdth_sync_event()
3418 scp->result = (DID_OK << 16) | ha->info; in gdth_sync_event()
3587 static int gdth_async_event(gdth_ha_str *ha) in gdth_async_event() argument
3592 cmdp= ha->pccb; in gdth_async_event()
3594 ha->hanum, ha->service)); in gdth_async_event()
3596 if (ha->service == SCREENSERVICE) { in gdth_async_event()
3597 if (ha->status == MSG_REQUEST) { in gdth_async_event()
3598 while (gdth_test_busy(ha)) in gdth_async_event()
3602 cmd_index = gdth_get_cmd_index(ha); in gdth_async_event()
3603 gdth_set_sema0(ha); in gdth_async_event()
3608 cmdp->u.screen.su.msg.msg_addr = ha->msg_phys; in gdth_async_event()
3609 ha->cmd_offs_dpmem = 0; in gdth_async_event()
3610 ha->cmd_len = GDTOFFSOF(gdth_cmd_str,u.screen.su.msg.msg_addr) in gdth_async_event()
3612 ha->cmd_cnt = 0; in gdth_async_event()
3613 gdth_copy_command(ha); in gdth_async_event()
3614 if (ha->type == GDT_EISA) in gdth_async_event()
3615 printk("[EISA slot %d] ",(u16)ha->brd_phys); in gdth_async_event()
3616 else if (ha->type == GDT_ISA) in gdth_async_event()
3617 printk("[DPMEM 0x%4X] ",(u16)ha->brd_phys); in gdth_async_event()
3619 printk("[PCI %d/%d] ",(u16)(ha->brd_phys>>8), in gdth_async_event()
3620 (u16)((ha->brd_phys>>3)&0x1f)); in gdth_async_event()
3621 gdth_release_event(ha); in gdth_async_event()
3625 if (ha->type == GDT_PCIMPR && in gdth_async_event()
3626 (ha->fw_vers & 0xff) >= 0x1a) { in gdth_async_event()
3627 ha->dvr.size = 0; in gdth_async_event()
3628 ha->dvr.eu.async.ionode = ha->hanum; in gdth_async_event()
3629 ha->dvr.eu.async.status = ha->status; in gdth_async_event()
3632 ha->dvr.size = sizeof(ha->dvr.eu.async); in gdth_async_event()
3633 ha->dvr.eu.async.ionode = ha->hanum; in gdth_async_event()
3634 ha->dvr.eu.async.service = ha->service; in gdth_async_event()
3635 ha->dvr.eu.async.status = ha->status; in gdth_async_event()
3636 ha->dvr.eu.async.info = ha->info; in gdth_async_event()
3637 *(u32 *)ha->dvr.eu.async.scsi_coord = ha->info2; in gdth_async_event()
3639 gdth_store_event( ha, ES_ASYNC, ha->service, &ha->dvr ); in gdth_async_event()
3640 gdth_log_event( &ha->dvr, NULL ); in gdth_async_event()
3643 if (ha->service == CACHESERVICE && ha->status == 56) { in gdth_async_event()
3645 (u16)ha->info)); in gdth_async_event()
3715 gdth_ha_str *ha; in gdth_timeout() local
3723 ha = list_first_entry(&gdth_instances, gdth_ha_str, list); in gdth_timeout()
3724 spin_lock_irqsave(&ha->smp_lock, flags); in gdth_timeout()
3727 if (ha->cmd_tab[i].cmnd != UNUSED_CMND) in gdth_timeout()
3730 for (act_rq=0,nscp=ha->req_first; nscp; nscp=(Scsi_Cmnd*)nscp->SCp.ptr) in gdth_timeout()
3739 spin_unlock_irqrestore(&ha->smp_lock, flags); in gdth_timeout()
3848 static const char *gdth_ctr_name(gdth_ha_str *ha) in gdth_ctr_name() argument
3852 if (ha->type == GDT_EISA) { in gdth_ctr_name()
3853 switch (ha->stype) { in gdth_ctr_name()
3861 } else if (ha->type == GDT_ISA) { in gdth_ctr_name()
3863 } else if (ha->type == GDT_PCI) { in gdth_ctr_name()
3864 switch (ha->pdev->device) { in gdth_ctr_name()
3878 gdth_ha_str *ha = shost_priv(shp); in gdth_info() local
3881 return ((const char *)ha->binfo.type_string); in gdth_info()
3886 gdth_ha_str *ha = shost_priv(scp->device->host); in gdth_timed_out() local
3905 spin_lock_irqsave(&ha->smp_lock, flags); in gdth_timed_out()
3906 if ((b != ha->virt_bus && ha->raw[BUS_L2P(ha, b)].lock) || in gdth_timed_out()
3907 (b == ha->virt_bus && t < MAX_HDRIVES && ha->hdr[t].lock)) { in gdth_timed_out()
3911 spin_unlock_irqrestore(&ha->smp_lock, flags); in gdth_timed_out()
3919 gdth_ha_str *ha = shost_priv(scp->device->host); in gdth_eh_bus_reset() local
3930 spin_lock_irqsave(&ha->smp_lock, flags); in gdth_eh_bus_reset()
3932 cmnd = ha->cmd_tab[i].cmnd; in gdth_eh_bus_reset()
3934 ha->cmd_tab[i].cmnd = UNUSED_CMND; in gdth_eh_bus_reset()
3936 spin_unlock_irqrestore(&ha->smp_lock, flags); in gdth_eh_bus_reset()
3938 if (b == ha->virt_bus) { in gdth_eh_bus_reset()
3941 if (ha->hdr[i].present) { in gdth_eh_bus_reset()
3942 spin_lock_irqsave(&ha->smp_lock, flags); in gdth_eh_bus_reset()
3944 while (gdth_test_busy(ha)) in gdth_eh_bus_reset()
3946 if (gdth_internal_cmd(ha, CACHESERVICE, in gdth_eh_bus_reset()
3948 ha->hdr[i].cluster_type &= ~CLUSTER_RESERVED; in gdth_eh_bus_reset()
3950 spin_unlock_irqrestore(&ha->smp_lock, flags); in gdth_eh_bus_reset()
3955 spin_lock_irqsave(&ha->smp_lock, flags); in gdth_eh_bus_reset()
3957 ha->raw[BUS_L2P(ha,b)].io_cnt[i] = 0; in gdth_eh_bus_reset()
3959 while (gdth_test_busy(ha)) in gdth_eh_bus_reset()
3961 gdth_internal_cmd(ha, SCSIRAWSERVICE, GDT_RESET_BUS, in gdth_eh_bus_reset()
3962 BUS_L2P(ha,b), 0, 0); in gdth_eh_bus_reset()
3964 spin_unlock_irqrestore(&ha->smp_lock, flags); in gdth_eh_bus_reset()
3972 gdth_ha_str *ha = shost_priv(sdev->host); in gdth_bios_param() local
3980 TRACE2(("gdth_bios_param() ha %d bus %d target %d\n", ha->hanum, b, t)); in gdth_bios_param()
3982 if (b != ha->virt_bus || ha->hdr[t].heads == 0) { in gdth_bios_param()
3987 ip[0] = ha->hdr[t].heads; in gdth_bios_param()
3988 ip[1] = ha->hdr[t].secs; in gdth_bios_param()
4001 gdth_ha_str *ha = shost_priv(scp->device->host); in gdth_queuecommand_lck() local
4006 cmndinfo = gdth_get_cmndinfo(ha); in gdth_queuecommand_lck()
4013 return __gdth_queuecommand(ha, scp, cmndinfo); in gdth_queuecommand_lck()
4018 static int __gdth_queuecommand(gdth_ha_str *ha, struct scsi_cmnd *scp, in DEF_SCSI_QCMD()
4030 gdth_putq(ha, scp, cmndinfo->priority); in DEF_SCSI_QCMD()
4031 gdth_next(ha); in DEF_SCSI_QCMD()
4038 gdth_ha_str *ha; in gdth_open() local
4041 list_for_each_entry(ha, &gdth_instances, list) { in gdth_open()
4042 if (!ha->sdev) in gdth_open()
4043 ha->sdev = scsi_get_host_dev(ha->shost); in gdth_open()
4060 gdth_ha_str *ha; in ioc_event() local
4065 ha = gdth_find_ha(evt.ionode); in ioc_event()
4066 if (!ha) in ioc_event()
4078 spin_lock_irqsave(&ha->smp_lock, flags); in ioc_event()
4079 gdth_store_event(ha, evt.event.event_source, evt.event.event_idx, in ioc_event()
4081 spin_unlock_irqrestore(&ha->smp_lock, flags); in ioc_event()
4085 evt.handle = gdth_read_event(ha, evt.handle, &evt.event); in ioc_event()
4087 gdth_readapp_event(ha, evt.erase, &evt.event); in ioc_event()
4099 gdth_ha_str *ha; in ioc_lockdrv() local
4103 ha = gdth_find_ha(ldrv.ionode); in ioc_lockdrv()
4104 if (!ha) in ioc_lockdrv()
4109 if (j >= MAX_HDRIVES || !ha->hdr[j].present) in ioc_lockdrv()
4112 spin_lock_irqsave(&ha->smp_lock, flags); in ioc_lockdrv()
4113 ha->hdr[j].lock = 1; in ioc_lockdrv()
4114 spin_unlock_irqrestore(&ha->smp_lock, flags); in ioc_lockdrv()
4115 gdth_wait_completion(ha, ha->bus_cnt, j); in ioc_lockdrv()
4117 spin_lock_irqsave(&ha->smp_lock, flags); in ioc_lockdrv()
4118 ha->hdr[j].lock = 0; in ioc_lockdrv()
4119 spin_unlock_irqrestore(&ha->smp_lock, flags); in ioc_lockdrv()
4120 gdth_next(ha); in ioc_lockdrv()
4130 gdth_ha_str *ha; in ioc_resetdrv() local
4136 ha = gdth_find_ha(res.ionode); in ioc_resetdrv()
4137 if (!ha) in ioc_resetdrv()
4140 if (!ha->hdr[res.number].present) in ioc_resetdrv()
4145 if (ha->cache_feat & GDT_64BIT) in ioc_resetdrv()
4150 rval = __gdth_execute(ha->sdev, &cmd, cmnd, 30, NULL); in ioc_resetdrv()
4165 gdth_ha_str *ha; in ioc_general() local
4170 ha = gdth_find_ha(gen.ionode); in ioc_general()
4171 if (!ha) in ioc_general()
4182 if (!(buf = gdth_ioctl_alloc(ha, gen.data_len + gen.sense_len, in ioc_general()
4187 gdth_ioctl_free(ha, gen.data_len+gen.sense_len, buf, paddr); in ioc_general()
4194 if (ha->cache_feat & GDT_64BIT) { in ioc_general()
4200 if (ha->cache_feat & SCATTER_GATHER) { in ioc_general()
4211 if (ha->cache_feat & SCATTER_GATHER) { in ioc_general()
4223 if (ha->raw_feat & GDT_64BIT) { in ioc_general()
4236 if (ha->raw_feat & SCATTER_GATHER) { in ioc_general()
4248 if (ha->raw_feat & SCATTER_GATHER) { in ioc_general()
4261 gdth_ioctl_free(ha, gen.data_len+gen.sense_len, buf, paddr); in ioc_general()
4266 rval = __gdth_execute(ha->sdev, &gen.command, cmnd, gen.timeout, &gen.info); in ioc_general()
4268 gdth_ioctl_free(ha, gen.data_len+gen.sense_len, buf, paddr); in ioc_general()
4275 gdth_ioctl_free(ha, gen.data_len+gen.sense_len, buf, paddr); in ioc_general()
4280 gdth_ioctl_free(ha, gen.data_len+gen.sense_len, buf, paddr); in ioc_general()
4283 gdth_ioctl_free(ha, gen.data_len+gen.sense_len, buf, paddr); in ioc_general()
4291 gdth_ha_str *ha; in ioc_hdrlist() local
4302 (NULL == (ha = gdth_find_ha(rsc->ionode)))) { in ioc_hdrlist()
4309 if (!ha->hdr[i].present) { in ioc_hdrlist()
4313 rsc->hdr_list[i].bus = ha->virt_bus; in ioc_hdrlist()
4316 rsc->hdr_list[i].cluster_type = ha->hdr[i].cluster_type; in ioc_hdrlist()
4317 if (ha->hdr[i].cluster_type & CLUSTER_DRIVE) { in ioc_hdrlist()
4320 if (ha->cache_feat & GDT_64BIT) in ioc_hdrlist()
4324 if (__gdth_execute(ha->sdev, cmd, cmnd, 30, &cluster_type) == S_OK) in ioc_hdrlist()
4349 gdth_ha_str *ha; in ioc_rescan() local
4357 (NULL == (ha = gdth_find_ha(rsc->ionode)))) { in ioc_rescan()
4366 if (ha->cache_feat & GDT_64BIT) { in ioc_rescan()
4374 status = __gdth_execute(ha->sdev, cmd, cmnd, 30, &info); in ioc_rescan()
4385 if (ha->cache_feat & GDT_64BIT) in ioc_rescan()
4390 status = __gdth_execute(ha->sdev, cmd, cmnd, 30, &info); in ioc_rescan()
4392 spin_lock_irqsave(&ha->smp_lock, flags); in ioc_rescan()
4393 rsc->hdr_list[i].bus = ha->virt_bus; in ioc_rescan()
4397 ha->hdr[i].present = FALSE; in ioc_rescan()
4399 ha->hdr[i].present = TRUE; in ioc_rescan()
4400 ha->hdr[i].size = info; in ioc_rescan()
4402 ha->hdr[i].size &= ~SECS32; in ioc_rescan()
4403 gdth_eval_mapping(ha->hdr[i].size,&cyls,&hds,&secs); in ioc_rescan()
4404 ha->hdr[i].heads = hds; in ioc_rescan()
4405 ha->hdr[i].secs = secs; in ioc_rescan()
4407 ha->hdr[i].size = cyls * hds * secs; in ioc_rescan()
4409 spin_unlock_irqrestore(&ha->smp_lock, flags); in ioc_rescan()
4419 if (ha->cache_feat & GDT_64BIT) in ioc_rescan()
4424 status = __gdth_execute(ha->sdev, cmd, cmnd, 30, &info); in ioc_rescan()
4426 spin_lock_irqsave(&ha->smp_lock, flags); in ioc_rescan()
4427 ha->hdr[i].devtype = (status == S_OK ? (u16)info : 0); in ioc_rescan()
4428 spin_unlock_irqrestore(&ha->smp_lock, flags); in ioc_rescan()
4432 if (ha->cache_feat & GDT_64BIT) in ioc_rescan()
4437 status = __gdth_execute(ha->sdev, cmd, cmnd, 30, &info); in ioc_rescan()
4439 spin_lock_irqsave(&ha->smp_lock, flags); in ioc_rescan()
4440 ha->hdr[i].cluster_type = in ioc_rescan()
4442 spin_unlock_irqrestore(&ha->smp_lock, flags); in ioc_rescan()
4443 rsc->hdr_list[i].cluster_type = ha->hdr[i].cluster_type; in ioc_rescan()
4447 if (ha->cache_feat & GDT_64BIT) in ioc_rescan()
4452 status = __gdth_execute(ha->sdev, cmd, cmnd, 30, &info); in ioc_rescan()
4454 spin_lock_irqsave(&ha->smp_lock, flags); in ioc_rescan()
4455 ha->hdr[i].rw_attribs = (status == S_OK ? (u16)info : 0); in ioc_rescan()
4456 spin_unlock_irqrestore(&ha->smp_lock, flags); in ioc_rescan()
4472 gdth_ha_str *ha; in gdth_ioctl() local
4516 (NULL == (ha = gdth_find_ha(ctrt.ionode)))) in gdth_ioctl()
4519 if (ha->type == GDT_ISA || ha->type == GDT_EISA) { in gdth_ioctl()
4520 ctrt.type = (u8)((ha->stype>>20) - 0x10); in gdth_ioctl()
4522 if (ha->type != GDT_PCIMPR) { in gdth_ioctl()
4523 ctrt.type = (u8)((ha->stype<<4) + 6); in gdth_ioctl()
4526 (ha->oem_id == OEM_ID_INTEL ? 0xfd : 0xfe); in gdth_ioctl()
4527 if (ha->stype >= 0x300) in gdth_ioctl()
4528 ctrt.ext_type = 0x6000 | ha->pdev->subsystem_device; in gdth_ioctl()
4530 ctrt.ext_type = 0x6000 | ha->stype; in gdth_ioctl()
4532 ctrt.device_id = ha->pdev->device; in gdth_ioctl()
4533 ctrt.sub_device_id = ha->pdev->subsystem_device; in gdth_ioctl()
4535 ctrt.info = ha->brd_phys; in gdth_ioctl()
4536 ctrt.oem_id = ha->oem_id; in gdth_ioctl()
4557 (NULL == (ha = gdth_find_ha(lchn.ionode)))) in gdth_ioctl()
4561 if (i < ha->bus_cnt) { in gdth_ioctl()
4563 spin_lock_irqsave(&ha->smp_lock, flags); in gdth_ioctl()
4564 ha->raw[i].lock = 1; in gdth_ioctl()
4565 spin_unlock_irqrestore(&ha->smp_lock, flags); in gdth_ioctl()
4566 for (j = 0; j < ha->tid_cnt; ++j) in gdth_ioctl()
4567 gdth_wait_completion(ha, i, j); in gdth_ioctl()
4569 spin_lock_irqsave(&ha->smp_lock, flags); in gdth_ioctl()
4570 ha->raw[i].lock = 0; in gdth_ioctl()
4571 spin_unlock_irqrestore(&ha->smp_lock, flags); in gdth_ioctl()
4572 for (j = 0; j < ha->tid_cnt; ++j) in gdth_ioctl()
4573 gdth_next(ha); in gdth_ioctl()
4591 (NULL == (ha = gdth_find_ha(res.ionode)))) in gdth_ioctl()
4597 scp->device = ha->sdev; in gdth_ioctl()
4631 static void gdth_flush(gdth_ha_str *ha) in gdth_flush() argument
4638 TRACE2(("gdth_flush() hanum %d\n", ha->hanum)); in gdth_flush()
4641 if (ha->hdr[i].present) { in gdth_flush()
4645 if (ha->cache_feat & GDT_64BIT) { in gdth_flush()
4654 TRACE2(("gdth_flush(): flush ha %d drive %d\n", ha->hanum, i)); in gdth_flush()
4656 gdth_execute(ha->shost, &gdtcmd, cmnd, 30, NULL); in gdth_flush()
4693 gdth_ha_str *ha; in gdth_isa_probe_one() local
4703 ha = shost_priv(shp); in gdth_isa_probe_one()
4706 if (!gdth_init_isa(isa_bios,ha)) in gdth_isa_probe_one()
4711 isa_bios, ha->irq, ha->drq); in gdth_isa_probe_one()
4713 error = request_irq(ha->irq, gdth_interrupt, 0, "gdth", ha); in gdth_isa_probe_one()
4719 error = request_dma(ha->drq, "gdth"); in gdth_isa_probe_one()
4725 set_dma_mode(ha->drq,DMA_MODE_CASCADE); in gdth_isa_probe_one()
4726 enable_dma(ha->drq); in gdth_isa_probe_one()
4728 shp->irq = ha->irq; in gdth_isa_probe_one()
4729 shp->dma_channel = ha->drq; in gdth_isa_probe_one()
4731 ha->hanum = gdth_ctr_count++; in gdth_isa_probe_one()
4732 ha->shost = shp; in gdth_isa_probe_one()
4734 ha->pccb = &ha->cmdext; in gdth_isa_probe_one()
4735 ha->ccb_phys = 0L; in gdth_isa_probe_one()
4736 ha->pdev = NULL; in gdth_isa_probe_one()
4740 ha->pscratch = pci_alloc_consistent(ha->pdev, GDTH_SCRATCH, in gdth_isa_probe_one()
4742 if (!ha->pscratch) in gdth_isa_probe_one()
4744 ha->scratch_phys = scratch_dma_handle; in gdth_isa_probe_one()
4746 ha->pmsg = pci_alloc_consistent(ha->pdev, sizeof(gdth_msg_str), in gdth_isa_probe_one()
4748 if (!ha->pmsg) in gdth_isa_probe_one()
4750 ha->msg_phys = scratch_dma_handle; in gdth_isa_probe_one()
4753 ha->coal_stat = pci_alloc_consistent(ha->pdev, in gdth_isa_probe_one()
4756 if (!ha->coal_stat) in gdth_isa_probe_one()
4758 ha->coal_stat_phys = scratch_dma_handle; in gdth_isa_probe_one()
4761 ha->scratch_busy = FALSE; in gdth_isa_probe_one()
4762 ha->req_first = NULL; in gdth_isa_probe_one()
4763 ha->tid_cnt = MAX_HDRIVES; in gdth_isa_probe_one()
4764 if (max_ids > 0 && max_ids < ha->tid_cnt) in gdth_isa_probe_one()
4765 ha->tid_cnt = max_ids; in gdth_isa_probe_one()
4767 ha->cmd_tab[i].cmnd = UNUSED_CMND; in gdth_isa_probe_one()
4768 ha->scan_mode = rescan ? 0x10 : 0; in gdth_isa_probe_one()
4771 if (!gdth_search_drives(ha)) { in gdth_isa_probe_one()
4776 if (hdr_channel < 0 || hdr_channel > ha->bus_cnt) in gdth_isa_probe_one()
4777 hdr_channel = ha->bus_cnt; in gdth_isa_probe_one()
4778 ha->virt_bus = hdr_channel; in gdth_isa_probe_one()
4780 if (ha->cache_feat & ha->raw_feat & ha->screen_feat & GDT_64BIT) in gdth_isa_probe_one()
4783 shp->max_id = ha->tid_cnt; in gdth_isa_probe_one()
4785 shp->max_channel = ha->bus_cnt; in gdth_isa_probe_one()
4787 spin_lock_init(&ha->smp_lock); in gdth_isa_probe_one()
4788 gdth_enable_int(ha); in gdth_isa_probe_one()
4793 list_add_tail(&ha->list, &gdth_instances); in gdth_isa_probe_one()
4802 pci_free_consistent(ha->pdev, sizeof(gdth_coal_status) * MAXOFFSETS, in gdth_isa_probe_one()
4803 ha->coal_stat, ha->coal_stat_phys); in gdth_isa_probe_one()
4806 pci_free_consistent(ha->pdev, sizeof(gdth_msg_str), in gdth_isa_probe_one()
4807 ha->pmsg, ha->msg_phys); in gdth_isa_probe_one()
4809 pci_free_consistent(ha->pdev, GDTH_SCRATCH, in gdth_isa_probe_one()
4810 ha->pscratch, ha->scratch_phys); in gdth_isa_probe_one()
4814 free_irq(ha->irq, ha); in gdth_isa_probe_one()
4825 gdth_ha_str *ha; in gdth_eisa_probe_one() local
4835 ha = shost_priv(shp); in gdth_eisa_probe_one()
4838 if (!gdth_init_eisa(eisa_slot,ha)) in gdth_eisa_probe_one()
4843 eisa_slot >> 12, ha->irq); in gdth_eisa_probe_one()
4845 error = request_irq(ha->irq, gdth_interrupt, 0, "gdth", ha); in gdth_eisa_probe_one()
4852 shp->irq = ha->irq; in gdth_eisa_probe_one()
4855 ha->hanum = gdth_ctr_count++; in gdth_eisa_probe_one()
4856 ha->shost = shp; in gdth_eisa_probe_one()
4858 TRACE2(("EISA detect Bus 0: hanum %d\n", ha->hanum)); in gdth_eisa_probe_one()
4860 ha->pccb = &ha->cmdext; in gdth_eisa_probe_one()
4861 ha->ccb_phys = 0L; in gdth_eisa_probe_one()
4865 ha->pdev = NULL; in gdth_eisa_probe_one()
4866 ha->pscratch = pci_alloc_consistent(ha->pdev, GDTH_SCRATCH, in gdth_eisa_probe_one()
4868 if (!ha->pscratch) in gdth_eisa_probe_one()
4870 ha->scratch_phys = scratch_dma_handle; in gdth_eisa_probe_one()
4872 ha->pmsg = pci_alloc_consistent(ha->pdev, sizeof(gdth_msg_str), in gdth_eisa_probe_one()
4874 if (!ha->pmsg) in gdth_eisa_probe_one()
4876 ha->msg_phys = scratch_dma_handle; in gdth_eisa_probe_one()
4879 ha->coal_stat = pci_alloc_consistent(ha->pdev, in gdth_eisa_probe_one()
4882 if (!ha->coal_stat) in gdth_eisa_probe_one()
4884 ha->coal_stat_phys = scratch_dma_handle; in gdth_eisa_probe_one()
4887 ha->ccb_phys = pci_map_single(ha->pdev,ha->pccb, in gdth_eisa_probe_one()
4889 if (!ha->ccb_phys) in gdth_eisa_probe_one()
4892 ha->scratch_busy = FALSE; in gdth_eisa_probe_one()
4893 ha->req_first = NULL; in gdth_eisa_probe_one()
4894 ha->tid_cnt = MAX_HDRIVES; in gdth_eisa_probe_one()
4895 if (max_ids > 0 && max_ids < ha->tid_cnt) in gdth_eisa_probe_one()
4896 ha->tid_cnt = max_ids; in gdth_eisa_probe_one()
4898 ha->cmd_tab[i].cmnd = UNUSED_CMND; in gdth_eisa_probe_one()
4899 ha->scan_mode = rescan ? 0x10 : 0; in gdth_eisa_probe_one()
4901 if (!gdth_search_drives(ha)) { in gdth_eisa_probe_one()
4907 if (hdr_channel < 0 || hdr_channel > ha->bus_cnt) in gdth_eisa_probe_one()
4908 hdr_channel = ha->bus_cnt; in gdth_eisa_probe_one()
4909 ha->virt_bus = hdr_channel; in gdth_eisa_probe_one()
4911 if (ha->cache_feat & ha->raw_feat & ha->screen_feat & GDT_64BIT) in gdth_eisa_probe_one()
4914 shp->max_id = ha->tid_cnt; in gdth_eisa_probe_one()
4916 shp->max_channel = ha->bus_cnt; in gdth_eisa_probe_one()
4918 spin_lock_init(&ha->smp_lock); in gdth_eisa_probe_one()
4919 gdth_enable_int(ha); in gdth_eisa_probe_one()
4924 list_add_tail(&ha->list, &gdth_instances); in gdth_eisa_probe_one()
4932 pci_unmap_single(ha->pdev,ha->ccb_phys, sizeof(gdth_cmd_str), in gdth_eisa_probe_one()
4936 pci_free_consistent(ha->pdev, sizeof(gdth_coal_status) * MAXOFFSETS, in gdth_eisa_probe_one()
4937 ha->coal_stat, ha->coal_stat_phys); in gdth_eisa_probe_one()
4940 pci_free_consistent(ha->pdev, sizeof(gdth_msg_str), in gdth_eisa_probe_one()
4941 ha->pmsg, ha->msg_phys); in gdth_eisa_probe_one()
4943 pci_free_consistent(ha->pdev, GDTH_SCRATCH, in gdth_eisa_probe_one()
4944 ha->pscratch, ha->scratch_phys); in gdth_eisa_probe_one()
4946 free_irq(ha->irq, ha); in gdth_eisa_probe_one()
4958 gdth_ha_str *ha; in gdth_pci_probe_one() local
4968 ha = shost_priv(shp); in gdth_pci_probe_one()
4971 if (!gdth_init_pci(pdev, pcistr, ha)) in gdth_pci_probe_one()
4978 ha->irq); in gdth_pci_probe_one()
4980 error = request_irq(ha->irq, gdth_interrupt, in gdth_pci_probe_one()
4981 IRQF_SHARED, "gdth", ha); in gdth_pci_probe_one()
4988 shp->irq = ha->irq; in gdth_pci_probe_one()
4991 ha->hanum = gdth_ctr_count++; in gdth_pci_probe_one()
4992 ha->shost = shp; in gdth_pci_probe_one()
4994 ha->pccb = &ha->cmdext; in gdth_pci_probe_one()
4995 ha->ccb_phys = 0L; in gdth_pci_probe_one()
4999 ha->pscratch = pci_alloc_consistent(ha->pdev, GDTH_SCRATCH, in gdth_pci_probe_one()
5001 if (!ha->pscratch) in gdth_pci_probe_one()
5003 ha->scratch_phys = scratch_dma_handle; in gdth_pci_probe_one()
5005 ha->pmsg = pci_alloc_consistent(ha->pdev, sizeof(gdth_msg_str), in gdth_pci_probe_one()
5007 if (!ha->pmsg) in gdth_pci_probe_one()
5009 ha->msg_phys = scratch_dma_handle; in gdth_pci_probe_one()
5012 ha->coal_stat = pci_alloc_consistent(ha->pdev, in gdth_pci_probe_one()
5015 if (!ha->coal_stat) in gdth_pci_probe_one()
5017 ha->coal_stat_phys = scratch_dma_handle; in gdth_pci_probe_one()
5020 ha->scratch_busy = FALSE; in gdth_pci_probe_one()
5021 ha->req_first = NULL; in gdth_pci_probe_one()
5022 ha->tid_cnt = pdev->device >= 0x200 ? MAXID : MAX_HDRIVES; in gdth_pci_probe_one()
5023 if (max_ids > 0 && max_ids < ha->tid_cnt) in gdth_pci_probe_one()
5024 ha->tid_cnt = max_ids; in gdth_pci_probe_one()
5026 ha->cmd_tab[i].cmnd = UNUSED_CMND; in gdth_pci_probe_one()
5027 ha->scan_mode = rescan ? 0x10 : 0; in gdth_pci_probe_one()
5030 if (!gdth_search_drives(ha)) { in gdth_pci_probe_one()
5031 printk("GDT-PCI %d: Error during device scan\n", ha->hanum); in gdth_pci_probe_one()
5035 if (hdr_channel < 0 || hdr_channel > ha->bus_cnt) in gdth_pci_probe_one()
5036 hdr_channel = ha->bus_cnt; in gdth_pci_probe_one()
5037 ha->virt_bus = hdr_channel; in gdth_pci_probe_one()
5040 if (!(ha->cache_feat & ha->raw_feat & ha->screen_feat & GDT_64BIT) || in gdth_pci_probe_one()
5041 !ha->dma64_support) { in gdth_pci_probe_one()
5044 "Unable to set 32-bit DMA\n", ha->hanum); in gdth_pci_probe_one()
5050 printk("GDT-PCI %d: 64-bit DMA enabled\n", ha->hanum); in gdth_pci_probe_one()
5053 "Unable to set 64/32-bit DMA\n", ha->hanum); in gdth_pci_probe_one()
5058 shp->max_id = ha->tid_cnt; in gdth_pci_probe_one()
5060 shp->max_channel = ha->bus_cnt; in gdth_pci_probe_one()
5062 spin_lock_init(&ha->smp_lock); in gdth_pci_probe_one()
5063 gdth_enable_int(ha); in gdth_pci_probe_one()
5068 list_add_tail(&ha->list, &gdth_instances); in gdth_pci_probe_one()
5070 pci_set_drvdata(ha->pdev, ha); in gdth_pci_probe_one()
5075 *ha_out = ha; in gdth_pci_probe_one()
5081 pci_free_consistent(ha->pdev, sizeof(gdth_coal_status) * MAXOFFSETS, in gdth_pci_probe_one()
5082 ha->coal_stat, ha->coal_stat_phys); in gdth_pci_probe_one()
5085 pci_free_consistent(ha->pdev, sizeof(gdth_msg_str), in gdth_pci_probe_one()
5086 ha->pmsg, ha->msg_phys); in gdth_pci_probe_one()
5088 pci_free_consistent(ha->pdev, GDTH_SCRATCH, in gdth_pci_probe_one()
5089 ha->pscratch, ha->scratch_phys); in gdth_pci_probe_one()
5091 free_irq(ha->irq, ha); in gdth_pci_probe_one()
5099 static void gdth_remove_one(gdth_ha_str *ha) in gdth_remove_one() argument
5101 struct Scsi_Host *shp = ha->shost; in gdth_remove_one()
5107 gdth_flush(ha); in gdth_remove_one()
5109 if (ha->sdev) { in gdth_remove_one()
5110 scsi_free_host_dev(ha->sdev); in gdth_remove_one()
5111 ha->sdev = NULL; in gdth_remove_one()
5115 free_irq(shp->irq,ha); in gdth_remove_one()
5122 if (ha->coal_stat) in gdth_remove_one()
5123 pci_free_consistent(ha->pdev, sizeof(gdth_coal_status) * in gdth_remove_one()
5124 MAXOFFSETS, ha->coal_stat, ha->coal_stat_phys); in gdth_remove_one()
5126 if (ha->pscratch) in gdth_remove_one()
5127 pci_free_consistent(ha->pdev, GDTH_SCRATCH, in gdth_remove_one()
5128 ha->pscratch, ha->scratch_phys); in gdth_remove_one()
5129 if (ha->pmsg) in gdth_remove_one()
5130 pci_free_consistent(ha->pdev, sizeof(gdth_msg_str), in gdth_remove_one()
5131 ha->pmsg, ha->msg_phys); in gdth_remove_one()
5132 if (ha->ccb_phys) in gdth_remove_one()
5133 pci_unmap_single(ha->pdev,ha->ccb_phys, in gdth_remove_one()
5141 gdth_ha_str *ha; in gdth_halt() local
5147 list_for_each_entry(ha, &gdth_instances, list) in gdth_halt()
5148 gdth_flush(ha); in gdth_halt()
5195 gdth_ha_str *ha; in gdth_init() local
5197 list_for_each_entry(ha, &gdth_instances, list) in gdth_init()
5198 gdth_remove_one(ha); in gdth_init()
5213 gdth_ha_str *ha; in gdth_exit() local
5226 list_for_each_entry(ha, &gdth_instances, list) in gdth_exit()
5227 gdth_remove_one(ha); in gdth_exit()