[PATCH] USB: implement error event in usbmon
Implement the "error" event in usbmon. Signed-off-by: Pete Zaitcev <zaitcev@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
5b1c674d22
commit
12e72feab5
@@ -114,20 +114,32 @@ out_unlocked:
|
||||
|
||||
/*
|
||||
*/
|
||||
static void mon_submit_error(struct usb_bus *ubus, struct urb *urb, int err)
|
||||
static void mon_submit_error(struct usb_bus *ubus, struct urb *urb, int error)
|
||||
{
|
||||
struct mon_bus *mbus;
|
||||
unsigned long flags;
|
||||
struct list_head *pos;
|
||||
struct mon_reader *r;
|
||||
|
||||
mbus = ubus->mon_bus;
|
||||
if (mbus == NULL)
|
||||
goto out_unlocked;
|
||||
|
||||
/*
|
||||
* XXX Capture the error code and the 'E' event.
|
||||
*/
|
||||
spin_lock_irqsave(&mbus->lock, flags);
|
||||
if (mbus->nreaders == 0)
|
||||
goto out_locked;
|
||||
|
||||
mbus->cnt_events++;
|
||||
list_for_each (pos, &mbus->r_list) {
|
||||
r = list_entry(pos, struct mon_reader, r_link);
|
||||
r->rnf_error(r->r_data, urb, error);
|
||||
}
|
||||
|
||||
spin_unlock_irqrestore(&mbus->lock, flags);
|
||||
return;
|
||||
|
||||
out_locked:
|
||||
spin_unlock_irqrestore(&mbus->lock, flags);
|
||||
out_unlocked:
|
||||
return;
|
||||
}
|
||||
|
Reference in New Issue
Block a user