Lines Matching refs:SDpnt

151 void scsi_build_commandblocks(Scsi_Device * SDpnt);
194 void scsi_initialize_queue(Scsi_Device * SDpnt, struct Scsi_Host * SHpnt) in scsi_initialize_queue() argument
196 request_queue_t *q = &SDpnt->request_queue; in scsi_initialize_queue()
201 q->queuedata = (void *) SDpnt; in scsi_initialize_queue()
357 Scsi_Device *SDpnt; in scsi_allocate_device() local
385 for (SDpnt = host->host_queue; in scsi_allocate_device()
386 SDpnt; in scsi_allocate_device()
387 SDpnt = SDpnt->next) { in scsi_allocate_device()
392 if (SDpnt->channel != device->channel in scsi_allocate_device()
393 || SDpnt->id != device->id in scsi_allocate_device()
394 || SDpnt == device) { in scsi_allocate_device()
397 if( atomic_read(&SDpnt->device_active) != 0) in scsi_allocate_device()
402 if (SDpnt) { in scsi_allocate_device()
524 Scsi_Device * SDpnt; in __scsi_release_command() local
528 SDpnt = SCpnt->device; in __scsi_release_command()
534 atomic_dec(&SDpnt->device_active); in __scsi_release_command()
564 wake_up(&SDpnt->scpnt_wait); in __scsi_release_command()
597 Scsi_Device * SDpnt; in scsi_release_command() local
599 SDpnt = SCpnt->device; in scsi_release_command()
609 q = &SDpnt->request_queue; in scsi_release_command()
828 Scsi_Device * SDpnt = SRpnt->sr_device; in scsi_do_req() local
829 struct Scsi_Host *host = SDpnt->host; in scsi_do_req()
836 int target = SDpnt->id; in scsi_do_req()
841 "command : ", host->host_no, SDpnt->channel, target, buffer, in scsi_do_req()
1444 void scsi_release_commandblocks(Scsi_Device * SDpnt) in scsi_release_commandblocks() argument
1450 for (SCpnt = SDpnt->device_queue; SCpnt; SCpnt = SCnext) { in scsi_release_commandblocks()
1451 SDpnt->device_queue = SCnext = SCpnt->next; in scsi_release_commandblocks()
1454 SDpnt->has_cmdblocks = 0; in scsi_release_commandblocks()
1455 SDpnt->queue_depth = 0; in scsi_release_commandblocks()
1472 void scsi_build_commandblocks(Scsi_Device * SDpnt) in scsi_build_commandblocks() argument
1475 struct Scsi_Host *host = SDpnt->host; in scsi_build_commandblocks()
1481 if (SDpnt->queue_depth == 0) in scsi_build_commandblocks()
1483 SDpnt->queue_depth = host->cmd_per_lun; in scsi_build_commandblocks()
1484 if (SDpnt->queue_depth == 0) in scsi_build_commandblocks()
1485 SDpnt->queue_depth = 1; /* live to fight another day */ in scsi_build_commandblocks()
1487 SDpnt->device_queue = NULL; in scsi_build_commandblocks()
1489 for (j = 0; j < SDpnt->queue_depth; j++) { in scsi_build_commandblocks()
1498 SCpnt->device = SDpnt; in scsi_build_commandblocks()
1499 SCpnt->target = SDpnt->id; in scsi_build_commandblocks()
1500 SCpnt->lun = SDpnt->lun; in scsi_build_commandblocks()
1501 SCpnt->channel = SDpnt->channel; in scsi_build_commandblocks()
1513 SCpnt->next = SDpnt->device_queue; in scsi_build_commandblocks()
1514 SDpnt->device_queue = SCpnt; in scsi_build_commandblocks()
1518 if (j < SDpnt->queue_depth) { /* low on space (D.Gilbert 990424) */ in scsi_build_commandblocks()
1520 SDpnt->queue_depth, j); in scsi_build_commandblocks()
1521 SDpnt->queue_depth = j; in scsi_build_commandblocks()
1522 SDpnt->has_cmdblocks = (0 != j); in scsi_build_commandblocks()
1524 SDpnt->has_cmdblocks = 1; in scsi_build_commandblocks()
1946 Scsi_Device *SDpnt; in scsi_register_host() local
2061 for (SDpnt = shpnt->host_queue; SDpnt; SDpnt = SDpnt->next) in scsi_register_host()
2062 if (SDpnt->host->hostt == tpnt) { in scsi_register_host()
2065 (*sdtpnt->attach) (SDpnt); in scsi_register_host()
2066 if (SDpnt->attached) { in scsi_register_host()
2067 scsi_build_commandblocks(SDpnt); in scsi_register_host()
2068 if (0 == SDpnt->has_cmdblocks) in scsi_register_host()
2111 Scsi_Device *SDpnt; in scsi_unregister_host() local
2126 for (SDpnt = shpnt->host_queue; SDpnt; in scsi_unregister_host()
2127 SDpnt = SDpnt->next) { in scsi_unregister_host()
2128 if (SDpnt->host->hostt == tpnt in scsi_unregister_host()
2129 && SDpnt->host->hostt->module in scsi_unregister_host()
2130 && GET_USE_COUNT(SDpnt->host->hostt->module)) in scsi_unregister_host()
2148 for (SDpnt = shpnt->host_queue; SDpnt; in scsi_unregister_host()
2149 SDpnt = SDpnt->next) { in scsi_unregister_host()
2150 if (SDpnt->host->hostt == tpnt) in scsi_unregister_host()
2151 SDpnt->online = FALSE; in scsi_unregister_host()
2160 for (SDpnt = shpnt->host_queue; SDpnt; in scsi_unregister_host()
2161 SDpnt = SDpnt->next) { in scsi_unregister_host()
2166 for (SCpnt = SDpnt->device_queue; SCpnt; in scsi_unregister_host()
2168 online_status = SDpnt->online; in scsi_unregister_host()
2169 SDpnt->online = FALSE; in scsi_unregister_host()
2181 SDpnt->online = online_status; in scsi_unregister_host()
2200 for (SDpnt = shpnt->host_queue; SDpnt; in scsi_unregister_host()
2201 SDpnt = SDpnt->next) { in scsi_unregister_host()
2204 (*sdtpnt->detach) (SDpnt); in scsi_unregister_host()
2207 if (SDpnt->attached) { in scsi_unregister_host()
2208 printk(KERN_ERR "Attached usage count = %d\n", SDpnt->attached); in scsi_unregister_host()
2211 devfs_unregister (SDpnt->de); in scsi_unregister_host()
2237 for (SDpnt = shpnt->host_queue; SDpnt; in scsi_unregister_host()
2238 SDpnt = shpnt->host_queue) { in scsi_unregister_host()
2239 scsi_release_commandblocks(SDpnt); in scsi_unregister_host()
2241 blk_cleanup_queue(&SDpnt->request_queue); in scsi_unregister_host()
2243 shpnt->host_queue = SDpnt->next; in scsi_unregister_host()
2244 kfree((char *) SDpnt); in scsi_unregister_host()
2334 Scsi_Device *SDpnt; in scsi_register_device_module() local
2347 for (SDpnt = shpnt->host_queue; SDpnt; in scsi_register_device_module()
2348 SDpnt = SDpnt->next) { in scsi_register_device_module()
2350 SDpnt->detected = (*tpnt->detect) (SDpnt); in scsi_register_device_module()
2362 for (SDpnt = shpnt->host_queue; SDpnt; in scsi_register_device_module()
2363 SDpnt = SDpnt->next) { in scsi_register_device_module()
2364 SDpnt->detected = 0; in scsi_register_device_module()
2376 for (SDpnt = shpnt->host_queue; SDpnt; in scsi_register_device_module()
2377 SDpnt = SDpnt->next) { in scsi_register_device_module()
2378 SDpnt->attached += SDpnt->detected; in scsi_register_device_module()
2379 SDpnt->detected = 0; in scsi_register_device_module()
2381 (*tpnt->attach) (SDpnt); in scsi_register_device_module()
2386 if (SDpnt->attached && SDpnt->has_cmdblocks == 0) { in scsi_register_device_module()
2387 SDpnt->online = TRUE; in scsi_register_device_module()
2388 scsi_build_commandblocks(SDpnt); in scsi_register_device_module()
2389 if (0 == SDpnt->has_cmdblocks) in scsi_register_device_module()
2413 Scsi_Device *SDpnt; in scsi_unregister_device() local
2428 for (SDpnt = shpnt->host_queue; SDpnt; in scsi_unregister_device()
2429 SDpnt = SDpnt->next) { in scsi_unregister_device()
2431 (*tpnt->detach) (SDpnt); in scsi_unregister_device()
2432 if (SDpnt->attached == 0) { in scsi_unregister_device()
2433 SDpnt->online = FALSE; in scsi_unregister_device()
2439 scsi_release_commandblocks(SDpnt); in scsi_unregister_device()
2539 Scsi_Device *SDpnt; in scsi_dump_status() local
2555 for (SDpnt = shpnt->host_queue; SDpnt; SDpnt = SDpnt->next) { in scsi_dump_status()
2556 for (SCpnt = SDpnt->device_queue; SCpnt; SCpnt = SCpnt->next) { in scsi_dump_status()
2589 for (SDpnt = shpnt->host_queue; SDpnt; SDpnt = SDpnt->next) { in scsi_dump_status()
2746 Scsi_Device * SDpnt; in scsi_get_host_dev() local
2759 SDpnt = (Scsi_Device *) kmalloc(sizeof(Scsi_Device), in scsi_get_host_dev()
2761 if(SDpnt == NULL) in scsi_get_host_dev()
2764 memset(SDpnt, 0, sizeof(Scsi_Device)); in scsi_get_host_dev()
2766 SDpnt->host = SHpnt; in scsi_get_host_dev()
2767 SDpnt->id = SHpnt->this_id; in scsi_get_host_dev()
2768 SDpnt->type = -1; in scsi_get_host_dev()
2769 SDpnt->queue_depth = 1; in scsi_get_host_dev()
2771 scsi_build_commandblocks(SDpnt); in scsi_get_host_dev()
2773 scsi_initialize_queue(SDpnt, SHpnt); in scsi_get_host_dev()
2775 SDpnt->online = TRUE; in scsi_get_host_dev()
2780 init_waitqueue_head(&SDpnt->scpnt_wait); in scsi_get_host_dev()
2781 return SDpnt; in scsi_get_host_dev()
2797 void scsi_free_host_dev(Scsi_Device * SDpnt) in scsi_free_host_dev() argument
2799 if( (unsigned char) SDpnt->id != (unsigned char) SDpnt->host->this_id ) in scsi_free_host_dev()
2804 blk_cleanup_queue(&SDpnt->request_queue); in scsi_free_host_dev()
2810 scsi_release_commandblocks(SDpnt); in scsi_free_host_dev()
2811 kfree(SDpnt); in scsi_free_host_dev()