/[linux-patches]/genpatches-2.6/trunk/2.6.14/1157_4_microtek-scanner-scsi.patch
Gentoo

Contents of /genpatches-2.6/trunk/2.6.14/1157_4_microtek-scanner-scsi.patch

Parent Directory Parent Directory | Revision Log Revision Log


Revision 292 - (show annotations) (download) (as text)
Tue Jan 31 21:50:53 2006 UTC (14 years, 9 months ago) by johnm
File MIME type: text/x-diff
File size: 4006 byte(s)
Large update - thanks goes to Kerin Millar for the legwork.
1 From stable-bounces@linux.kernel.org Fri Dec 2 12:50:00 2005
2 Message-ID: <4390B2E1.5010507@gentoo.org>
3 Date: Fri, 02 Dec 2005 20:47:29 +0000
4 From: Daniel Drake <dsd@gentoo.org>
5 To: stable@kernel.org
6 Cc: oliver@neukum.org
7 Subject: USB: Adapt microtek driver to new scsi features
8 X-Git-Tag: v2.6.15-rc2
9 X-Git-Url: http://www.kernel.org/git/gitweb.cgi?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=9142d59a451731d23539d218c962418acc93283c
10
11 From: Oliver Neukum <oliver@neukum.org>
12
13 [PATCH] USB: Adapt microtek driver to new scsi features
14
15 the scsi layer now uses very short sg lists. This breaks the microtek
16 driver. Here is a patch fixes this and some other issues.
17
18 Signed-off-by: Oliver Neukum <oliver@neukum.name>
19 Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
20 Signed-off-by: Linus Torvalds <torvalds@osdl.org>
21 ---
22 drivers/usb/image/microtek.c | 31 +++++++++++++++++++++++++------
23 drivers/usb/image/microtek.h | 2 +-
24 2 files changed, 26 insertions(+), 7 deletions(-)
25
26 --- linux-2.6.14.3.orig/drivers/usb/image/microtek.c
27 +++ linux-2.6.14.3/drivers/usb/image/microtek.c
28 @@ -327,6 +327,18 @@ static inline void mts_urb_abort(struct
29 usb_kill_urb( desc->urb );
30 }
31
32 +static int mts_slave_alloc (struct scsi_device *s)
33 +{
34 + s->inquiry_len = 0x24;
35 + return 0;
36 +}
37 +
38 +static int mts_slave_configure (struct scsi_device *s)
39 +{
40 + blk_queue_dma_alignment(s->request_queue, (512 - 1));
41 + return 0;
42 +}
43 +
44 static int mts_scsi_abort (Scsi_Cmnd *srb)
45 {
46 struct mts_desc* desc = (struct mts_desc*)(srb->device->host->hostdata[0]);
47 @@ -411,7 +423,7 @@ static void mts_transfer_done( struct ur
48 MTS_INT_INIT();
49
50 context->srb->result &= MTS_SCSI_ERR_MASK;
51 - context->srb->result |= (unsigned)context->status<<1;
52 + context->srb->result |= (unsigned)(*context->scsi_status)<<1;
53
54 mts_transfer_cleanup(transfer);
55
56 @@ -427,7 +439,7 @@ static void mts_get_status( struct urb *
57 mts_int_submit_urb(transfer,
58 usb_rcvbulkpipe(context->instance->usb_dev,
59 context->instance->ep_response),
60 - &context->status,
61 + context->scsi_status,
62 1,
63 mts_transfer_done );
64 }
65 @@ -481,7 +493,7 @@ static void mts_command_done( struct urb
66 context->data_pipe,
67 context->data,
68 context->data_length,
69 - context->srb->use_sg ? mts_do_sg : mts_data_done);
70 + context->srb->use_sg > 1 ? mts_do_sg : mts_data_done);
71 } else {
72 mts_get_status(transfer);
73 }
74 @@ -627,7 +639,6 @@ int mts_scsi_queuecommand( Scsi_Cmnd *sr
75 callback(srb);
76
77 }
78 -
79 out:
80 return err;
81 }
82 @@ -645,6 +656,9 @@ static Scsi_Host_Template mts_scsi_host_
83 .cmd_per_lun = 1,
84 .use_clustering = 1,
85 .emulated = 1,
86 + .slave_alloc = mts_slave_alloc,
87 + .slave_configure = mts_slave_configure,
88 + .max_sectors= 256, /* 128 K */
89 };
90
91 struct vendor_product
92 @@ -782,6 +796,10 @@ static int mts_usb_probe(struct usb_inte
93 if (!new_desc->urb)
94 goto out_kfree;
95
96 + new_desc->context.scsi_status = kmalloc(1, GFP_KERNEL);
97 + if (!new_desc->context.scsi_status)
98 + goto out_kfree2;
99 +
100 new_desc->usb_dev = dev;
101 new_desc->usb_intf = intf;
102 init_MUTEX(&new_desc->lock);
103 @@ -818,6 +836,8 @@ static int mts_usb_probe(struct usb_inte
104 usb_set_intfdata(intf, new_desc);
105 return 0;
106
107 + out_kfree2:
108 + kfree(new_desc->context.scsi_status);
109 out_free_urb:
110 usb_free_urb(new_desc->urb);
111 out_kfree:
112 @@ -837,6 +857,7 @@ static void mts_usb_disconnect (struct u
113
114 scsi_host_put(desc->host);
115 usb_free_urb(desc->urb);
116 + kfree(desc->context.scsi_status);
117 kfree(desc);
118 }
119
120 @@ -857,5 +878,3 @@ module_exit(microtek_drv_exit);
121 MODULE_AUTHOR( DRIVER_AUTHOR );
122 MODULE_DESCRIPTION( DRIVER_DESC );
123 MODULE_LICENSE("GPL");
124 -
125 -
126 --- linux-2.6.14.3.orig/drivers/usb/image/microtek.h
127 +++ linux-2.6.14.3/drivers/usb/image/microtek.h
128 @@ -22,7 +22,7 @@ struct mts_transfer_context
129 int data_pipe;
130 int fragment;
131
132 - u8 status; /* status returned from ep_response after command completion */
133 + u8 *scsi_status; /* status returned from ep_response after command completion */
134 };
135
136

  ViewVC Help
Powered by ViewVC 1.1.20