Lines Matching refs:HD
492 #define HD(board) ((struct hostdata *) &sh[board]->hostdata)
493 #define BN(board) (HD(board)->board_name)
612 id_dma_addr = pci_map_single(HD(j)->pdev, HD(j)->board_id,
613 sizeof(HD(j)->board_id), PCI_DMA_BIDIRECTIONAL);
614 cpp = &HD(j)->cp[0];
615 cpp->cp_dma_addr = pci_map_single(HD(j)->pdev, cpp, sizeof(struct mscp),
621 cpp->data_len = H2DEV(sizeof(HD(j)->board_id));
630 HD(j)->cp_stat[0] = IGNORE;
646 if (cpp->adapter_status || HD(j)->cp_stat[0] != FREE) {
647 HD(j)->cp_stat[0] = FREE;
652 pci_unmap_single(HD(j)->pdev, cpp->cp_dma_addr, sizeof(struct mscp),
654 pci_unmap_single(HD(j)->pdev, id_dma_addr, sizeof(HD(j)->board_id),
787 memset(HD(j), 0, sizeof(struct hostdata));
788 HD(j)->heads = mapping_table[config_2.mapping_mode].heads;
789 HD(j)->sectors = mapping_table[config_2.mapping_mode].sectors;
790 HD(j)->subversion = subversion;
791 HD(j)->pdev = NULL;
792 HD(j)->board_number = j;
796 if (HD(j)->subversion == ESA) {
822 if (HD(j)->subversion == ISA && !board_inquiry(j)) {
823 HD(j)->board_id[40] = 0;
825 if (strcmp(&HD(j)->board_id[32], "06000600")) {
826 printk("%s: %s.\n", BN(j), &HD(j)->board_id[8]);
828 BN(j), &HD(j)->board_id[32]);
840 HD(j)->cp[i].cp_dma_addr = pci_map_single(HD(j)->pdev,
841 &HD(j)->cp[i], sizeof(struct mscp), PCI_DMA_BIDIRECTIONAL);
844 if (! ((&HD(j)->cp[i])->sglist = kmalloc(
982 cpp = &HD(j)->cp[i]; SCpnt = cpp->SCpnt;
986 cpp->sense_addr = H2DEV(pci_map_single(HD(j)->pdev, SCpnt->sense_buffer,
1004 H2DEV(pci_map_single(HD(j)->pdev, cpp->sglist,
1020 cpp = &HD(j)->cp[i]; SCpnt = cpp->SCpnt;
1024 pci_unmap_single(HD(j)->pdev, DEV2H(cpp->sense_addr),
1032 pci_unmap_single(HD(j)->pdev, DEV2H(cpp->data_address),
1041 cpp = &HD(j)->cp[i]; SCpnt = cpp->SCpnt;
1045 pci_dma_sync_single_for_cpu(HD(j)->pdev, DEV2H(cpp->sense_addr),
1049 pci_dma_sync_sg_for_cpu(HD(j)->pdev, scsi_sglist(SCpnt),
1055 pci_dma_sync_single_for_cpu(HD(j)->pdev, DEV2H(cpp->data_address),
1077 cpp = &HD(j)->cp[i]; SCpnt = cpp->SCpnt;
1125 i = HD(j)->last_cp_used + 1;
1131 if (HD(j)->cp_stat[i] == FREE) {
1132 HD(j)->last_cp_used = i;
1143 cpp = &HD(j)->cp[i];
1170 HD(j)->cp_stat[i] = READY;
1189 HD(j)->cp_stat[i] = IN_USE;
1216 if (HD(j)->cp_stat[i] == FREE) {
1221 if (HD(j)->cp_stat[i] == IN_USE) {
1224 if (SCarg != HD(j)->cp[i].SCpnt)
1226 BN(j), i, SCarg, HD(j)->cp[i].SCpnt);
1234 if (HD(j)->cp_stat[i] == IN_RESET) {
1239 if (HD(j)->cp_stat[i] == LOCKED) {
1244 if (HD(j)->cp_stat[i] == READY || HD(j)->cp_stat[i] == ABORTING) {
1248 HD(j)->cp_stat[i] = FREE;
1272 if (HD(j)->in_reset) {
1284 HD(j)->retries = 0;
1288 HD(j)->target_redo[k][c] = TRUE;
1289 HD(j)->target_to[k][c] = 0;
1294 if (HD(j)->cp_stat[i] == FREE) continue;
1296 if (HD(j)->cp_stat[i] == LOCKED) {
1297 HD(j)->cp_stat[i] = FREE;
1302 if (!(SCpnt = HD(j)->cp[i].SCpnt))
1305 if (HD(j)->cp_stat[i] == READY || HD(j)->cp_stat[i] == ABORTING) {
1306 HD(j)->cp_stat[i] = ABORTING;
1312 HD(j)->cp_stat[i] = IN_RESET;
1342 HD(j)->in_reset = TRUE;
1353 if (HD(j)->cp_stat[i] == IN_RESET) {
1354 SCpnt = HD(j)->cp[i].SCpnt;
1360 HD(j)->cp_stat[i] = LOCKED;
1366 else if (HD(j)->cp_stat[i] == ABORTING) {
1367 SCpnt = HD(j)->cp[i].SCpnt;
1373 HD(j)->cp_stat[i] = FREE;
1387 HD(j)->in_reset = FALSE;
1402 dkinfo[0] = HD(j)->heads;
1403 dkinfo[1] = HD(j)->sectors;
1404 dkinfo[2] = size / (HD(j)->heads * HD(j)->sectors);
1471 k = il[n]; cpp = &HD(j)->cp[k]; SCpnt = cpp->SCpnt;
1508 k = il[n]; cpp = &HD(j)->cp[k]; SCpnt = cpp->SCpnt;
1532 k = il[n]; cpp = &HD(j)->cp[k]; SCpnt = cpp->SCpnt;
1553 if (HD(j)->cp_stat[k] != READY && HD(j)->cp_stat[k] != IN_USE) continue;
1555 cpp = &HD(j)->cp[k]; SCpnt = cpp->SCpnt;
1559 if (HD(j)->cp_stat[k] == IN_USE) return;
1567 k = il[n]; cpp = &HD(j)->cp[k]; SCpnt = cpp->SCpnt;
1574 HD(j)->cp_stat[k] = ABORTING;
1580 HD(j)->cp_stat[k] = IN_USE;
1595 HD(j)->iocount++;
1598 HD(j)->iocount);
1604 BN(j), irq, reg, HD(j)->iocount);
1615 if (H2DEV(HD(j)->cp[i].cp_dma_addr) == ret) break;
1619 (void *)ret, (void *)H2DEV(HD(j)->cp[0].cp_dma_addr));
1621 cpp = &(HD(j)->cp[i]);
1625 if ((HD(j)->iocount > 500) && ((HD(j)->iocount % 500) < 3)) goto handled;
1628 if (HD(j)->cp_stat[i] == IGNORE) {
1629 HD(j)->cp_stat[i] = FREE;
1632 else if (HD(j)->cp_stat[i] == LOCKED) {
1633 HD(j)->cp_stat[i] = FREE;
1635 HD(j)->iocount);
1638 else if (HD(j)->cp_stat[i] == FREE) {
1640 HD(j)->iocount);
1643 else if (HD(j)->cp_stat[i] == IN_RESET)
1645 else if (HD(j)->cp_stat[i] != IN_USE)
1647 BN(j), i, HD(j)->cp_stat[i]);
1649 HD(j)->cp_stat[i] = FREE;
1671 if ((HD(j)->iocount > 500) && ((HD(j)->iocount % 200) < 2))
1684 && HD(j)->target_redo[scmd_id(SCpnt)][scmd_channel(SCpnt)])
1697 HD(j)->target_redo[scmd_id(SCpnt)][scmd_channel(SCpnt)] = FALSE;
1700 (!(tstatus == CHECK_CONDITION && HD(j)->iocount <= 1000 &&
1707 HD(j)->target_to[scmd_id(SCpnt)][scmd_channel(SCpnt)] = 0;
1709 if (HD(j)->last_retried_pid == SCpnt->serial_number) HD(j)->retries = 0;
1714 if (HD(j)->target_to[scmd_id(SCpnt)][scmd_channel(SCpnt)] > 1)
1718 HD(j)->target_to[scmd_id(SCpnt)][scmd_channel(SCpnt)]++;
1731 HD(j)->target_redo[k][c] = TRUE;
1737 && HD(j)->retries < MAX_INTERNAL_RETRIES) {
1745 HD(j)->retries++;
1746 HD(j)->last_retried_pid = SCpnt->serial_number;
1769 if ((spp->adapter_status != ASOK && HD(j)->iocount > 1000) ||
1771 spp->adapter_status != ASST && HD(j)->iocount <= 1000) ||
1777 reg, HD(j)->iocount);
1787 HD(j)->iocount);
1818 kfree((&HD(j)->cp[i])->sglist);
1821 pci_unmap_single(HD(j)->pdev, HD(j)->cp[i].cp_dma_addr,