aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/image/microtek.c
diff options
context:
space:
mode:
authorGlenn Elliott <gelliott@cs.unc.edu>2012-03-04 19:47:13 -0500
committerGlenn Elliott <gelliott@cs.unc.edu>2012-03-04 19:47:13 -0500
commitc71c03bda1e86c9d5198c5d83f712e695c4f2a1e (patch)
treeecb166cb3e2b7e2adb3b5e292245fefd23381ac8 /drivers/usb/image/microtek.c
parentea53c912f8a86a8567697115b6a0d8152beee5c8 (diff)
parent6a00f206debf8a5c8899055726ad127dbeeed098 (diff)
Merge branch 'mpi-master' into wip-k-fmlpwip-k-fmlp
Conflicts: litmus/sched_cedf.c
Diffstat (limited to 'drivers/usb/image/microtek.c')
-rw-r--r--drivers/usb/image/microtek.c23
1 files changed, 8 insertions, 15 deletions
diff --git a/drivers/usb/image/microtek.c b/drivers/usb/image/microtek.c
index 3a6bcd5fee09..a0037961e5bd 100644
--- a/drivers/usb/image/microtek.c
+++ b/drivers/usb/image/microtek.c
@@ -69,7 +69,7 @@
69 * 20000513 added IDs for all products supported by Windows driver (john) 69 * 20000513 added IDs for all products supported by Windows driver (john)
70 * 20000514 Rewrote mts_scsi_queuecommand to use URBs (john) 70 * 20000514 Rewrote mts_scsi_queuecommand to use URBs (john)
71 * 20000514 Version 0.0.8j 71 * 20000514 Version 0.0.8j
72 * 20000514 Fix reporting of non-existant devices to SCSI layer (john) 72 * 20000514 Fix reporting of non-existent devices to SCSI layer (john)
73 * 20000514 Added MTS_DEBUG_INT (john) 73 * 20000514 Added MTS_DEBUG_INT (john)
74 * 20000514 Changed "usb-microtek" to "microtek" for consistency (john) 74 * 20000514 Changed "usb-microtek" to "microtek" for consistency (john)
75 * 20000514 Stupid bug fixes (john) 75 * 20000514 Stupid bug fixes (john)
@@ -364,7 +364,7 @@ static int mts_scsi_host_reset(struct scsi_cmnd *srb)
364} 364}
365 365
366static int 366static int
367mts_scsi_queuecommand(struct scsi_cmnd *srb, mts_scsi_cmnd_callback callback); 367mts_scsi_queuecommand(struct Scsi_Host *shost, struct scsi_cmnd *srb);
368 368
369static void mts_transfer_cleanup( struct urb *transfer ); 369static void mts_transfer_cleanup( struct urb *transfer );
370static void mts_do_sg(struct urb * transfer); 370static void mts_do_sg(struct urb * transfer);
@@ -398,7 +398,6 @@ void mts_int_submit_urb (struct urb* transfer,
398 context->srb->result = DID_ERROR << 16; 398 context->srb->result = DID_ERROR << 16;
399 mts_transfer_cleanup(transfer); 399 mts_transfer_cleanup(transfer);
400 } 400 }
401 return;
402} 401}
403 402
404 403
@@ -409,7 +408,6 @@ static void mts_transfer_cleanup( struct urb *transfer )
409 408
410 if ( likely(context->final_callback != NULL) ) 409 if ( likely(context->final_callback != NULL) )
411 context->final_callback(context->srb); 410 context->final_callback(context->srb);
412
413} 411}
414 412
415static void mts_transfer_done( struct urb *transfer ) 413static void mts_transfer_done( struct urb *transfer )
@@ -420,8 +418,6 @@ static void mts_transfer_done( struct urb *transfer )
420 context->srb->result |= (unsigned)(*context->scsi_status)<<1; 418 context->srb->result |= (unsigned)(*context->scsi_status)<<1;
421 419
422 mts_transfer_cleanup(transfer); 420 mts_transfer_cleanup(transfer);
423
424 return;
425} 421}
426 422
427 423
@@ -452,8 +448,6 @@ static void mts_data_done( struct urb* transfer )
452 } 448 }
453 449
454 mts_get_status(transfer); 450 mts_get_status(transfer);
455
456 return;
457} 451}
458 452
459 453
@@ -496,8 +490,6 @@ static void mts_command_done( struct urb *transfer )
496 mts_get_status(transfer); 490 mts_get_status(transfer);
497 } 491 }
498 } 492 }
499
500 return;
501} 493}
502 494
503static void mts_do_sg (struct urb* transfer) 495static void mts_do_sg (struct urb* transfer)
@@ -522,7 +514,6 @@ static void mts_do_sg (struct urb* transfer)
522 sg[context->fragment].length, 514 sg[context->fragment].length,
523 context->fragment + 1 == scsi_sg_count(context->srb) ? 515 context->fragment + 1 == scsi_sg_count(context->srb) ?
524 mts_data_done : mts_do_sg); 516 mts_data_done : mts_do_sg);
525 return;
526} 517}
527 518
528static const u8 mts_read_image_sig[] = { 0x28, 00, 00, 00 }; 519static const u8 mts_read_image_sig[] = { 0x28, 00, 00, 00 };
@@ -566,14 +557,14 @@ mts_build_transfer_context(struct scsi_cmnd *srb, struct mts_desc* desc)
566 557
567 if ( !memcmp( srb->cmnd, mts_read_image_sig, mts_read_image_sig_len ) 558 if ( !memcmp( srb->cmnd, mts_read_image_sig, mts_read_image_sig_len )
568) { pipe = usb_rcvbulkpipe(desc->usb_dev,desc->ep_image); 559) { pipe = usb_rcvbulkpipe(desc->usb_dev,desc->ep_image);
569 MTS_DEBUG( "transfering from desc->ep_image == %d\n", 560 MTS_DEBUG( "transferring from desc->ep_image == %d\n",
570 (int)desc->ep_image ); 561 (int)desc->ep_image );
571 } else if ( MTS_DIRECTION_IS_IN(srb->cmnd[0]) ) { 562 } else if ( MTS_DIRECTION_IS_IN(srb->cmnd[0]) ) {
572 pipe = usb_rcvbulkpipe(desc->usb_dev,desc->ep_response); 563 pipe = usb_rcvbulkpipe(desc->usb_dev,desc->ep_response);
573 MTS_DEBUG( "transfering from desc->ep_response == %d\n", 564 MTS_DEBUG( "transferring from desc->ep_response == %d\n",
574 (int)desc->ep_response); 565 (int)desc->ep_response);
575 } else { 566 } else {
576 MTS_DEBUG("transfering to desc->ep_out == %d\n", 567 MTS_DEBUG("transferring to desc->ep_out == %d\n",
577 (int)desc->ep_out); 568 (int)desc->ep_out);
578 pipe = usb_sndbulkpipe(desc->usb_dev,desc->ep_out); 569 pipe = usb_sndbulkpipe(desc->usb_dev,desc->ep_out);
579 } 570 }
@@ -582,7 +573,7 @@ mts_build_transfer_context(struct scsi_cmnd *srb, struct mts_desc* desc)
582 573
583 574
584static int 575static int
585mts_scsi_queuecommand(struct scsi_cmnd *srb, mts_scsi_cmnd_callback callback) 576mts_scsi_queuecommand_lck(struct scsi_cmnd *srb, mts_scsi_cmnd_callback callback)
586{ 577{
587 struct mts_desc* desc = (struct mts_desc*)(srb->device->host->hostdata[0]); 578 struct mts_desc* desc = (struct mts_desc*)(srb->device->host->hostdata[0]);
588 int err = 0; 579 int err = 0;
@@ -635,6 +626,8 @@ out:
635 return err; 626 return err;
636} 627}
637 628
629static DEF_SCSI_QCMD(mts_scsi_queuecommand)
630
638static struct scsi_host_template mts_scsi_host_template = { 631static struct scsi_host_template mts_scsi_host_template = {
639 .module = THIS_MODULE, 632 .module = THIS_MODULE,
640 .name = "microtekX6", 633 .name = "microtekX6",