diff options
Diffstat (limited to 'drivers/scsi')
-rw-r--r-- | drivers/scsi/dpt_i2o.c | 4 | ||||
-rw-r--r-- | drivers/scsi/hosts.c | 7 | ||||
-rw-r--r-- | drivers/scsi/ide-scsi.c | 32 | ||||
-rw-r--r-- | drivers/scsi/scsi_transport_fc.c | 9 | ||||
-rw-r--r-- | drivers/scsi/scsi_transport_iscsi.c | 8 |
5 files changed, 25 insertions, 35 deletions
diff --git a/drivers/scsi/dpt_i2o.c b/drivers/scsi/dpt_i2o.c index 2bc30e32b67a..1fe0901e8119 100644 --- a/drivers/scsi/dpt_i2o.c +++ b/drivers/scsi/dpt_i2o.c | |||
@@ -271,8 +271,8 @@ rebuild_sys_tab: | |||
271 | pHba->initialized = TRUE; | 271 | pHba->initialized = TRUE; |
272 | pHba->state &= ~DPTI_STATE_RESET; | 272 | pHba->state &= ~DPTI_STATE_RESET; |
273 | if (adpt_sysfs_class) { | 273 | if (adpt_sysfs_class) { |
274 | struct device *dev = device_create(adpt_sysfs_class, | 274 | struct device *dev = device_create_drvdata(adpt_sysfs_class, |
275 | NULL, MKDEV(DPTI_I2O_MAJOR, pHba->unit), | 275 | NULL, MKDEV(DPTI_I2O_MAJOR, pHba->unit), NULL, |
276 | "dpti%d", pHba->unit); | 276 | "dpti%d", pHba->unit); |
277 | if (IS_ERR(dev)) { | 277 | if (IS_ERR(dev)) { |
278 | printk(KERN_WARNING"dpti%d: unable to " | 278 | printk(KERN_WARNING"dpti%d: unable to " |
diff --git a/drivers/scsi/hosts.c b/drivers/scsi/hosts.c index 35cd892dce04..fed0b02ebc1d 100644 --- a/drivers/scsi/hosts.c +++ b/drivers/scsi/hosts.c | |||
@@ -232,8 +232,8 @@ int scsi_add_host(struct Scsi_Host *shost, struct device *dev) | |||
232 | } | 232 | } |
233 | 233 | ||
234 | if (shost->transportt->create_work_queue) { | 234 | if (shost->transportt->create_work_queue) { |
235 | snprintf(shost->work_q_name, KOBJ_NAME_LEN, "scsi_wq_%d", | 235 | snprintf(shost->work_q_name, sizeof(shost->work_q_name), |
236 | shost->host_no); | 236 | "scsi_wq_%d", shost->host_no); |
237 | shost->work_q = create_singlethread_workqueue( | 237 | shost->work_q = create_singlethread_workqueue( |
238 | shost->work_q_name); | 238 | shost->work_q_name); |
239 | if (!shost->work_q) { | 239 | if (!shost->work_q) { |
@@ -466,7 +466,8 @@ struct Scsi_Host *scsi_host_lookup(unsigned short hostnum) | |||
466 | struct device *cdev; | 466 | struct device *cdev; |
467 | struct Scsi_Host *shost = ERR_PTR(-ENXIO); | 467 | struct Scsi_Host *shost = ERR_PTR(-ENXIO); |
468 | 468 | ||
469 | cdev = class_find_device(&shost_class, &hostnum, __scsi_host_match); | 469 | cdev = class_find_device(&shost_class, NULL, &hostnum, |
470 | __scsi_host_match); | ||
470 | if (cdev) { | 471 | if (cdev) { |
471 | shost = scsi_host_get(class_to_shost(cdev)); | 472 | shost = scsi_host_get(class_to_shost(cdev)); |
472 | put_device(cdev); | 473 | put_device(cdev); |
diff --git a/drivers/scsi/ide-scsi.c b/drivers/scsi/ide-scsi.c index f843c1383a4b..538552495d48 100644 --- a/drivers/scsi/ide-scsi.c +++ b/drivers/scsi/ide-scsi.c | |||
@@ -84,7 +84,6 @@ typedef struct ide_scsi_obj { | |||
84 | struct Scsi_Host *host; | 84 | struct Scsi_Host *host; |
85 | 85 | ||
86 | struct ide_atapi_pc *pc; /* Current packet command */ | 86 | struct ide_atapi_pc *pc; /* Current packet command */ |
87 | unsigned long flags; /* Status/Action flags */ | ||
88 | unsigned long transform; /* SCSI cmd translation layer */ | 87 | unsigned long transform; /* SCSI cmd translation layer */ |
89 | unsigned long log; /* log flags */ | 88 | unsigned long log; /* log flags */ |
90 | } idescsi_scsi_t; | 89 | } idescsi_scsi_t; |
@@ -126,23 +125,14 @@ static inline idescsi_scsi_t *drive_to_idescsi(ide_drive_t *ide_drive) | |||
126 | } | 125 | } |
127 | 126 | ||
128 | /* | 127 | /* |
129 | * Per ATAPI device status bits. | ||
130 | */ | ||
131 | #define IDESCSI_DRQ_INTERRUPT 0 /* DRQ interrupt device */ | ||
132 | |||
133 | /* | ||
134 | * ide-scsi requests. | ||
135 | */ | ||
136 | #define IDESCSI_PC_RQ 90 | ||
137 | |||
138 | /* | ||
139 | * PIO data transfer routine using the scatter gather table. | 128 | * PIO data transfer routine using the scatter gather table. |
140 | */ | 129 | */ |
141 | static void ide_scsi_io_buffers(ide_drive_t *drive, struct ide_atapi_pc *pc, | 130 | static void ide_scsi_io_buffers(ide_drive_t *drive, struct ide_atapi_pc *pc, |
142 | unsigned int bcount, int write) | 131 | unsigned int bcount, int write) |
143 | { | 132 | { |
144 | ide_hwif_t *hwif = drive->hwif; | 133 | ide_hwif_t *hwif = drive->hwif; |
145 | xfer_func_t *xf = write ? hwif->output_data : hwif->input_data; | 134 | const struct ide_tp_ops *tp_ops = hwif->tp_ops; |
135 | xfer_func_t *xf = write ? tp_ops->output_data : tp_ops->input_data; | ||
146 | char *buf; | 136 | char *buf; |
147 | int count; | 137 | int count; |
148 | 138 | ||
@@ -228,7 +218,6 @@ static int idescsi_check_condition(ide_drive_t *drive, | |||
228 | rq->cmd_type = REQ_TYPE_SENSE; | 218 | rq->cmd_type = REQ_TYPE_SENSE; |
229 | rq->cmd_flags |= REQ_PREEMPT; | 219 | rq->cmd_flags |= REQ_PREEMPT; |
230 | pc->timeout = jiffies + WAIT_READY; | 220 | pc->timeout = jiffies + WAIT_READY; |
231 | pc->callback = ide_scsi_callback; | ||
232 | /* NOTE! Save the failed packet command in "rq->buffer" */ | 221 | /* NOTE! Save the failed packet command in "rq->buffer" */ |
233 | rq->buffer = (void *) failed_cmd->special; | 222 | rq->buffer = (void *) failed_cmd->special; |
234 | pc->scsi_cmd = ((struct ide_atapi_pc *) failed_cmd->special)->scsi_cmd; | 223 | pc->scsi_cmd = ((struct ide_atapi_pc *) failed_cmd->special)->scsi_cmd; |
@@ -237,6 +226,7 @@ static int idescsi_check_condition(ide_drive_t *drive, | |||
237 | ide_scsi_hex_dump(pc->c, 6); | 226 | ide_scsi_hex_dump(pc->c, 6); |
238 | } | 227 | } |
239 | rq->rq_disk = scsi->disk; | 228 | rq->rq_disk = scsi->disk; |
229 | memcpy(rq->cmd, pc->c, 12); | ||
240 | ide_do_drive_cmd(drive, rq); | 230 | ide_do_drive_cmd(drive, rq); |
241 | return 0; | 231 | return 0; |
242 | } | 232 | } |
@@ -246,10 +236,9 @@ idescsi_atapi_error(ide_drive_t *drive, struct request *rq, u8 stat, u8 err) | |||
246 | { | 236 | { |
247 | ide_hwif_t *hwif = drive->hwif; | 237 | ide_hwif_t *hwif = drive->hwif; |
248 | 238 | ||
249 | if (ide_read_status(drive) & (BUSY_STAT | DRQ_STAT)) | 239 | if (hwif->tp_ops->read_status(hwif) & (BUSY_STAT | DRQ_STAT)) |
250 | /* force an abort */ | 240 | /* force an abort */ |
251 | hwif->OUTBSYNC(hwif, WIN_IDLEIMMEDIATE, | 241 | hwif->tp_ops->exec_command(hwif, WIN_IDLEIMMEDIATE); |
252 | hwif->io_ports.command_addr); | ||
253 | 242 | ||
254 | rq->errors++; | 243 | rq->errors++; |
255 | 244 | ||
@@ -421,10 +410,6 @@ static ide_startstop_t idescsi_do_request (ide_drive_t *drive, struct request *r | |||
421 | 410 | ||
422 | if (blk_sense_request(rq) || blk_special_request(rq)) { | 411 | if (blk_sense_request(rq) || blk_special_request(rq)) { |
423 | struct ide_atapi_pc *pc = (struct ide_atapi_pc *)rq->special; | 412 | struct ide_atapi_pc *pc = (struct ide_atapi_pc *)rq->special; |
424 | idescsi_scsi_t *scsi = drive_to_idescsi(drive); | ||
425 | |||
426 | if (test_bit(IDESCSI_DRQ_INTERRUPT, &scsi->flags)) | ||
427 | pc->flags |= PC_FLAG_DRQ_INTERRUPT; | ||
428 | 413 | ||
429 | if (drive->using_dma && !idescsi_map_sg(drive, pc)) | 414 | if (drive->using_dma && !idescsi_map_sg(drive, pc)) |
430 | pc->flags |= PC_FLAG_DMA_OK; | 415 | pc->flags |= PC_FLAG_DMA_OK; |
@@ -460,11 +445,14 @@ static inline void idescsi_add_settings(ide_drive_t *drive) { ; } | |||
460 | static void idescsi_setup (ide_drive_t *drive, idescsi_scsi_t *scsi) | 445 | static void idescsi_setup (ide_drive_t *drive, idescsi_scsi_t *scsi) |
461 | { | 446 | { |
462 | if (drive->id && (drive->id->config & 0x0060) == 0x20) | 447 | if (drive->id && (drive->id->config & 0x0060) == 0x20) |
463 | set_bit (IDESCSI_DRQ_INTERRUPT, &scsi->flags); | 448 | set_bit(IDE_AFLAG_DRQ_INTERRUPT, &drive->atapi_flags); |
464 | clear_bit(IDESCSI_SG_TRANSFORM, &scsi->transform); | 449 | clear_bit(IDESCSI_SG_TRANSFORM, &scsi->transform); |
465 | #if IDESCSI_DEBUG_LOG | 450 | #if IDESCSI_DEBUG_LOG |
466 | set_bit(IDESCSI_LOG_CMD, &scsi->log); | 451 | set_bit(IDESCSI_LOG_CMD, &scsi->log); |
467 | #endif /* IDESCSI_DEBUG_LOG */ | 452 | #endif /* IDESCSI_DEBUG_LOG */ |
453 | |||
454 | drive->pc_callback = ide_scsi_callback; | ||
455 | |||
468 | idescsi_add_settings(drive); | 456 | idescsi_add_settings(drive); |
469 | } | 457 | } |
470 | 458 | ||
@@ -616,7 +604,6 @@ static int idescsi_queue (struct scsi_cmnd *cmd, | |||
616 | pc->scsi_cmd = cmd; | 604 | pc->scsi_cmd = cmd; |
617 | pc->done = done; | 605 | pc->done = done; |
618 | pc->timeout = jiffies + cmd->timeout_per_command; | 606 | pc->timeout = jiffies + cmd->timeout_per_command; |
619 | pc->callback = ide_scsi_callback; | ||
620 | 607 | ||
621 | if (test_bit(IDESCSI_LOG_CMD, &scsi->log)) { | 608 | if (test_bit(IDESCSI_LOG_CMD, &scsi->log)) { |
622 | printk ("ide-scsi: %s: que %lu, cmd = ", drive->name, cmd->serial_number); | 609 | printk ("ide-scsi: %s: que %lu, cmd = ", drive->name, cmd->serial_number); |
@@ -631,6 +618,7 @@ static int idescsi_queue (struct scsi_cmnd *cmd, | |||
631 | rq->special = (char *) pc; | 618 | rq->special = (char *) pc; |
632 | rq->cmd_type = REQ_TYPE_SPECIAL; | 619 | rq->cmd_type = REQ_TYPE_SPECIAL; |
633 | spin_unlock_irq(host->host_lock); | 620 | spin_unlock_irq(host->host_lock); |
621 | memcpy(rq->cmd, pc->c, 12); | ||
634 | blk_execute_rq_nowait(drive->queue, scsi->disk, rq, 0, NULL); | 622 | blk_execute_rq_nowait(drive->queue, scsi->disk, rq, 0, NULL); |
635 | spin_lock_irq(host->host_lock); | 623 | spin_lock_irq(host->host_lock); |
636 | return 0; | 624 | return 0; |
diff --git a/drivers/scsi/scsi_transport_fc.c b/drivers/scsi/scsi_transport_fc.c index 5fd64e70029d..a272b9a2c869 100644 --- a/drivers/scsi/scsi_transport_fc.c +++ b/drivers/scsi/scsi_transport_fc.c | |||
@@ -417,15 +417,16 @@ static int fc_host_setup(struct transport_container *tc, struct device *dev, | |||
417 | fc_host->next_vport_number = 0; | 417 | fc_host->next_vport_number = 0; |
418 | fc_host->npiv_vports_inuse = 0; | 418 | fc_host->npiv_vports_inuse = 0; |
419 | 419 | ||
420 | snprintf(fc_host->work_q_name, KOBJ_NAME_LEN, "fc_wq_%d", | 420 | snprintf(fc_host->work_q_name, sizeof(fc_host->work_q_name), |
421 | shost->host_no); | 421 | "fc_wq_%d", shost->host_no); |
422 | fc_host->work_q = create_singlethread_workqueue( | 422 | fc_host->work_q = create_singlethread_workqueue( |
423 | fc_host->work_q_name); | 423 | fc_host->work_q_name); |
424 | if (!fc_host->work_q) | 424 | if (!fc_host->work_q) |
425 | return -ENOMEM; | 425 | return -ENOMEM; |
426 | 426 | ||
427 | snprintf(fc_host->devloss_work_q_name, KOBJ_NAME_LEN, "fc_dl_%d", | 427 | snprintf(fc_host->devloss_work_q_name, |
428 | shost->host_no); | 428 | sizeof(fc_host->devloss_work_q_name), |
429 | "fc_dl_%d", shost->host_no); | ||
429 | fc_host->devloss_work_q = create_singlethread_workqueue( | 430 | fc_host->devloss_work_q = create_singlethread_workqueue( |
430 | fc_host->devloss_work_q_name); | 431 | fc_host->devloss_work_q_name); |
431 | if (!fc_host->devloss_work_q) { | 432 | if (!fc_host->devloss_work_q) { |
diff --git a/drivers/scsi/scsi_transport_iscsi.c b/drivers/scsi/scsi_transport_iscsi.c index 3af7cbcc5c5d..043c3921164f 100644 --- a/drivers/scsi/scsi_transport_iscsi.c +++ b/drivers/scsi/scsi_transport_iscsi.c | |||
@@ -170,7 +170,7 @@ iscsi_create_endpoint(int dd_size) | |||
170 | int err; | 170 | int err; |
171 | 171 | ||
172 | for (id = 1; id < ISCSI_MAX_EPID; id++) { | 172 | for (id = 1; id < ISCSI_MAX_EPID; id++) { |
173 | dev = class_find_device(&iscsi_endpoint_class, &id, | 173 | dev = class_find_device(&iscsi_endpoint_class, NULL, &id, |
174 | iscsi_match_epid); | 174 | iscsi_match_epid); |
175 | if (!dev) | 175 | if (!dev) |
176 | break; | 176 | break; |
@@ -222,7 +222,7 @@ struct iscsi_endpoint *iscsi_lookup_endpoint(u64 handle) | |||
222 | struct iscsi_endpoint *ep; | 222 | struct iscsi_endpoint *ep; |
223 | struct device *dev; | 223 | struct device *dev; |
224 | 224 | ||
225 | dev = class_find_device(&iscsi_endpoint_class, &handle, | 225 | dev = class_find_device(&iscsi_endpoint_class, NULL, &handle, |
226 | iscsi_match_epid); | 226 | iscsi_match_epid); |
227 | if (!dev) | 227 | if (!dev) |
228 | return NULL; | 228 | return NULL; |
@@ -247,8 +247,8 @@ static int iscsi_setup_host(struct transport_container *tc, struct device *dev, | |||
247 | atomic_set(&ihost->nr_scans, 0); | 247 | atomic_set(&ihost->nr_scans, 0); |
248 | mutex_init(&ihost->mutex); | 248 | mutex_init(&ihost->mutex); |
249 | 249 | ||
250 | snprintf(ihost->scan_workq_name, KOBJ_NAME_LEN, "iscsi_scan_%d", | 250 | snprintf(ihost->scan_workq_name, sizeof(ihost->scan_workq_name), |
251 | shost->host_no); | 251 | "iscsi_scan_%d", shost->host_no); |
252 | ihost->scan_workq = create_singlethread_workqueue( | 252 | ihost->scan_workq = create_singlethread_workqueue( |
253 | ihost->scan_workq_name); | 253 | ihost->scan_workq_name); |
254 | if (!ihost->scan_workq) | 254 | if (!ihost->scan_workq) |