diff options
author | Alan Stern <stern@rowland.harvard.edu> | 2007-08-24 15:41:41 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2007-10-12 17:55:23 -0400 |
commit | 9347d51c52afcf1a77d2104f162cf8a085624c83 (patch) | |
tree | f128a00eeed69166f5f5a7196a8c1c45c5cc5d92 /drivers/usb/mon | |
parent | 888fda47051716765175d0008450126c837adb32 (diff) |
USB: reorganize urb->status use in usbmon
This patch (as978) reorganizes the way usbmon uses urb->status. It
now accepts the status value as an argument.
Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Acked-by: Pete Zaitcev <zaitcev@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb/mon')
-rw-r--r-- | drivers/usb/mon/mon_bin.c | 10 | ||||
-rw-r--r-- | drivers/usb/mon/mon_main.c | 11 | ||||
-rw-r--r-- | drivers/usb/mon/mon_text.c | 10 | ||||
-rw-r--r-- | drivers/usb/mon/usb_mon.h | 2 |
4 files changed, 17 insertions, 16 deletions
diff --git a/drivers/usb/mon/mon_bin.c b/drivers/usb/mon/mon_bin.c index 3d6f03819ffd..f06e4e2b49d3 100644 --- a/drivers/usb/mon/mon_bin.c +++ b/drivers/usb/mon/mon_bin.c | |||
@@ -386,7 +386,7 @@ static char mon_bin_get_data(const struct mon_reader_bin *rp, | |||
386 | } | 386 | } |
387 | 387 | ||
388 | static void mon_bin_event(struct mon_reader_bin *rp, struct urb *urb, | 388 | static void mon_bin_event(struct mon_reader_bin *rp, struct urb *urb, |
389 | char ev_type) | 389 | char ev_type, int status) |
390 | { | 390 | { |
391 | const struct usb_endpoint_descriptor *epd = &urb->ep->desc; | 391 | const struct usb_endpoint_descriptor *epd = &urb->ep->desc; |
392 | unsigned long flags; | 392 | unsigned long flags; |
@@ -452,7 +452,7 @@ static void mon_bin_event(struct mon_reader_bin *rp, struct urb *urb, | |||
452 | ep->id = (unsigned long) urb; | 452 | ep->id = (unsigned long) urb; |
453 | ep->ts_sec = ts.tv_sec; | 453 | ep->ts_sec = ts.tv_sec; |
454 | ep->ts_usec = ts.tv_usec; | 454 | ep->ts_usec = ts.tv_usec; |
455 | ep->status = urb->status; | 455 | ep->status = status; |
456 | ep->len_urb = urb_length; | 456 | ep->len_urb = urb_length; |
457 | ep->len_cap = length; | 457 | ep->len_cap = length; |
458 | 458 | ||
@@ -475,13 +475,13 @@ static void mon_bin_event(struct mon_reader_bin *rp, struct urb *urb, | |||
475 | static void mon_bin_submit(void *data, struct urb *urb) | 475 | static void mon_bin_submit(void *data, struct urb *urb) |
476 | { | 476 | { |
477 | struct mon_reader_bin *rp = data; | 477 | struct mon_reader_bin *rp = data; |
478 | mon_bin_event(rp, urb, 'S'); | 478 | mon_bin_event(rp, urb, 'S', -EINPROGRESS); |
479 | } | 479 | } |
480 | 480 | ||
481 | static void mon_bin_complete(void *data, struct urb *urb) | 481 | static void mon_bin_complete(void *data, struct urb *urb, int status) |
482 | { | 482 | { |
483 | struct mon_reader_bin *rp = data; | 483 | struct mon_reader_bin *rp = data; |
484 | mon_bin_event(rp, urb, 'C'); | 484 | mon_bin_event(rp, urb, 'C', status); |
485 | } | 485 | } |
486 | 486 | ||
487 | static void mon_bin_error(void *data, struct urb *urb, int error) | 487 | static void mon_bin_error(void *data, struct urb *urb, int error) |
diff --git a/drivers/usb/mon/mon_main.c b/drivers/usb/mon/mon_main.c index 2e317bd79e92..b371ffd39d36 100644 --- a/drivers/usb/mon/mon_main.c +++ b/drivers/usb/mon/mon_main.c | |||
@@ -129,7 +129,8 @@ static void mon_submit_error(struct usb_bus *ubus, struct urb *urb, int error) | |||
129 | 129 | ||
130 | /* | 130 | /* |
131 | */ | 131 | */ |
132 | static void mon_bus_complete(struct mon_bus *mbus, struct urb *urb) | 132 | static void mon_bus_complete(struct mon_bus *mbus, struct urb *urb, |
133 | int status) | ||
133 | { | 134 | { |
134 | unsigned long flags; | 135 | unsigned long flags; |
135 | struct list_head *pos; | 136 | struct list_head *pos; |
@@ -139,18 +140,18 @@ static void mon_bus_complete(struct mon_bus *mbus, struct urb *urb) | |||
139 | mbus->cnt_events++; | 140 | mbus->cnt_events++; |
140 | list_for_each (pos, &mbus->r_list) { | 141 | list_for_each (pos, &mbus->r_list) { |
141 | r = list_entry(pos, struct mon_reader, r_link); | 142 | r = list_entry(pos, struct mon_reader, r_link); |
142 | r->rnf_complete(r->r_data, urb); | 143 | r->rnf_complete(r->r_data, urb, status); |
143 | } | 144 | } |
144 | spin_unlock_irqrestore(&mbus->lock, flags); | 145 | spin_unlock_irqrestore(&mbus->lock, flags); |
145 | } | 146 | } |
146 | 147 | ||
147 | static void mon_complete(struct usb_bus *ubus, struct urb *urb) | 148 | static void mon_complete(struct usb_bus *ubus, struct urb *urb, int status) |
148 | { | 149 | { |
149 | struct mon_bus *mbus; | 150 | struct mon_bus *mbus; |
150 | 151 | ||
151 | if ((mbus = ubus->mon_bus) != NULL) | 152 | if ((mbus = ubus->mon_bus) != NULL) |
152 | mon_bus_complete(mbus, urb); | 153 | mon_bus_complete(mbus, urb, status); |
153 | mon_bus_complete(&mon_bus0, urb); | 154 | mon_bus_complete(&mon_bus0, urb, status); |
154 | } | 155 | } |
155 | 156 | ||
156 | /* int (*unlink_urb) (struct urb *urb, int status); */ | 157 | /* int (*unlink_urb) (struct urb *urb, int status); */ |
diff --git a/drivers/usb/mon/mon_text.c b/drivers/usb/mon/mon_text.c index 663a702a17dd..ebb04ac4857b 100644 --- a/drivers/usb/mon/mon_text.c +++ b/drivers/usb/mon/mon_text.c | |||
@@ -183,7 +183,7 @@ static inline unsigned int mon_get_timestamp(void) | |||
183 | } | 183 | } |
184 | 184 | ||
185 | static void mon_text_event(struct mon_reader_text *rp, struct urb *urb, | 185 | static void mon_text_event(struct mon_reader_text *rp, struct urb *urb, |
186 | char ev_type) | 186 | char ev_type, int status) |
187 | { | 187 | { |
188 | struct mon_event_text *ep; | 188 | struct mon_event_text *ep; |
189 | unsigned int stamp; | 189 | unsigned int stamp; |
@@ -210,7 +210,7 @@ static void mon_text_event(struct mon_reader_text *rp, struct urb *urb, | |||
210 | ep->length = (ev_type == 'S') ? | 210 | ep->length = (ev_type == 'S') ? |
211 | urb->transfer_buffer_length : urb->actual_length; | 211 | urb->transfer_buffer_length : urb->actual_length; |
212 | /* Collecting status makes debugging sense for submits, too */ | 212 | /* Collecting status makes debugging sense for submits, too */ |
213 | ep->status = urb->status; | 213 | ep->status = status; |
214 | 214 | ||
215 | if (ep->xfertype == USB_ENDPOINT_XFER_INT) { | 215 | if (ep->xfertype == USB_ENDPOINT_XFER_INT) { |
216 | ep->interval = urb->interval; | 216 | ep->interval = urb->interval; |
@@ -248,13 +248,13 @@ static void mon_text_event(struct mon_reader_text *rp, struct urb *urb, | |||
248 | static void mon_text_submit(void *data, struct urb *urb) | 248 | static void mon_text_submit(void *data, struct urb *urb) |
249 | { | 249 | { |
250 | struct mon_reader_text *rp = data; | 250 | struct mon_reader_text *rp = data; |
251 | mon_text_event(rp, urb, 'S'); | 251 | mon_text_event(rp, urb, 'S', -EINPROGRESS); |
252 | } | 252 | } |
253 | 253 | ||
254 | static void mon_text_complete(void *data, struct urb *urb) | 254 | static void mon_text_complete(void *data, struct urb *urb, int status) |
255 | { | 255 | { |
256 | struct mon_reader_text *rp = data; | 256 | struct mon_reader_text *rp = data; |
257 | mon_text_event(rp, urb, 'C'); | 257 | mon_text_event(rp, urb, 'C', status); |
258 | } | 258 | } |
259 | 259 | ||
260 | static void mon_text_error(void *data, struct urb *urb, int error) | 260 | static void mon_text_error(void *data, struct urb *urb, int error) |
diff --git a/drivers/usb/mon/usb_mon.h b/drivers/usb/mon/usb_mon.h index f68ad6d99ad7..f5d84ff8c101 100644 --- a/drivers/usb/mon/usb_mon.h +++ b/drivers/usb/mon/usb_mon.h | |||
@@ -46,7 +46,7 @@ struct mon_reader { | |||
46 | 46 | ||
47 | void (*rnf_submit)(void *data, struct urb *urb); | 47 | void (*rnf_submit)(void *data, struct urb *urb); |
48 | void (*rnf_error)(void *data, struct urb *urb, int error); | 48 | void (*rnf_error)(void *data, struct urb *urb, int error); |
49 | void (*rnf_complete)(void *data, struct urb *urb); | 49 | void (*rnf_complete)(void *data, struct urb *urb, int status); |
50 | }; | 50 | }; |
51 | 51 | ||
52 | void mon_reader_add(struct mon_bus *mbus, struct mon_reader *r); | 52 | void mon_reader_add(struct mon_bus *mbus, struct mon_reader *r); |