Lines Matching refs:sh

128 int eata_release(struct Scsi_Host *sh)  in eata_release()  argument
131 if (sh->irq && reg_IRQ[sh->irq] == 1) free_irq(sh->irq, NULL); in eata_release()
132 else reg_IRQ[sh->irq]--; in eata_release()
136 for (i = 0; i < sh->can_queue; i++){ /* Free all SG arrays */ in eata_release()
137 if(SD(sh)->ccb[i].sg_list != NULL) in eata_release()
138 kfree((void *) SD(sh)->ccb[i].sg_list); in eata_release()
141 if (SD(sh)->channel == 0) { in eata_release()
142 if (sh->dma_channel != BUSMASTER) free_dma(sh->dma_channel); in eata_release()
143 if (sh->io_port && sh->n_io_port) in eata_release()
144 release_region(sh->io_port, sh->n_io_port); in eata_release()
247 struct Scsi_Host *sh; in eata_int_handler() local
249 for (x = 1, sh = first_HBA; x <= registered_HBAs; x++, sh = SD(sh)->next) { in eata_int_handler()
250 if (sh->irq != irq) in eata_int_handler()
253 while(inb((uint)sh->base + HA_RAUXSTAT) & HA_AIRQ) { in eata_int_handler()
257 sp = &SD(sh)->sp; in eata_int_handler()
264 eata_stat = inb((uint)sh->base + HA_RSTATUS); in eata_int_handler()
458 struct Scsi_Host *sh; in eata_queue() local
467 for (x = 1, sh = first_HBA; x <= registered_HBAs; x++, sh = SD(sh)->next) { in eata_queue()
468 if(inb((uint)sh->base + HA_RAUXSTAT) & HA_AIRQ) { in eata_queue()
470 " Calling interrupt handler.\n", sh->host_no); in eata_queue()
471 eata_int_handler(sh->irq, 0, 0); in eata_queue()
479 sh = cmd->host; in eata_queue()
491 for (y = hd->last_ccb + 1, x = 0; x < sh->can_queue; x++, y++) { in eata_queue()
492 if (y >= sh->can_queue) in eata_queue()
500 if (x >= sh->can_queue) { in eata_queue()
548 if (cmd->target == sh->this_id) in eata_queue()
554 ccb->sg_list = kmalloc(sh->sg_tablesize * sizeof(struct eata_sg_list), in eata_queue()
601 if(eata_send_command((u32) ccb, (u32) sh->base, EATA_CMD_DMA_SEND_CP) == FALSE) { in eata_queue()
611 "slot %d irq %d\n", (s32)sh->base, cmd->pid, in eata_queue()
612 cmd->target, cmd->lun, y, sh->irq)); in eata_queue()
624 struct Scsi_Host *sh; in eata_abort() local
635 for (x = 1, sh = first_HBA; x <= registered_HBAs; x++, sh = SD(sh)->next) { in eata_abort()
636 if(inb((uint)sh->base + HA_RAUXSTAT) & HA_AIRQ) { in eata_abort()
638 " Calling interrupt handler.\n", sh->host_no); in eata_abort()
639 eata_int_handler(sh->irq, 0, 0); in eata_abort()
685 struct Scsi_Host *sh; in eata_reset() local
694 for (x = 1, sh = first_HBA; x <= registered_HBAs; x++, sh = SD(sh)->next) { in eata_reset()
695 if(inb((uint)sh->base + HA_RAUXSTAT) & HA_AIRQ) { in eata_reset()
697 " Calling interrupt handler.\n", sh->host_no); in eata_reset()
698 eata_int_handler(sh->irq, 0, 0); in eata_reset()
1069 struct Scsi_Host *sh; in register_HBA() local
1185 sh = scsi_register(tpnt, size); in register_HBA()
1187 if(sh != NULL) { in register_HBA()
1189 hd = SD(sh); in register_HBA()
1193 sh->select_queue_depths = eata_select_queue_depths; in register_HBA()
1203 sh->sg_tablesize = SG_SIZE_BIG; in register_HBA()
1205 sh->sg_tablesize = ntohs(gc->SGsiz); in register_HBA()
1206 if (sh->sg_tablesize > SG_SIZE || sh->sg_tablesize == 0) { in register_HBA()
1207 if (sh->sg_tablesize == 0) in register_HBA()
1211 sh->sg_tablesize = SG_SIZE; in register_HBA()
1214 hd->sgsize = sh->sg_tablesize; in register_HBA()
1217 if(sh != NULL) { in register_HBA()
1218 sh->can_queue = hd->queuesize = ntohs(gc->queuesiz); in register_HBA()
1219 sh->cmd_per_lun = 0; in register_HBA()
1222 if(sh == NULL) { in register_HBA()
1225 scsi_unregister(sh); in register_HBA()
1283 sh->max_id = gc->MAX_ID + 1; in register_HBA()
1284 sh->max_lun = gc->MAX_LUN + 1; in register_HBA()
1286 sh->max_id = 8; in register_HBA()
1287 sh->max_lun = 8; in register_HBA()
1290 hd->HBA_number = sh->host_no; in register_HBA()
1292 sh->max_channel = gc->MAX_CHAN; in register_HBA()
1293 sh->unique_id = base; in register_HBA()
1294 sh->base = base; in register_HBA()
1295 sh->io_port = base; in register_HBA()
1296 sh->n_io_port = 9; in register_HBA()
1297 sh->irq = gc->IRQ; in register_HBA()
1298 sh->dma_channel = dma_channel; in register_HBA()
1303 sh->this_id = gc->scsi_id[3]; in register_HBA()
1311 sh->unchecked_isa_dma = FALSE; in register_HBA()
1313 sh->unchecked_isa_dma = TRUE; /* We're doing ISA DMA */ in register_HBA()
1325 SD(hd->prev)->next = sh; in register_HBA()
1326 last_HBA = sh; in register_HBA()
1328 first_HBA = sh; in register_HBA()