summaryrefslogtreecommitdiff
path: root/drivers/usb/mon/mon_main.c
diff options
context:
space:
mode:
authorPete Zaitcev <zaitcev@redhat.com>2006-06-10 09:03:32 +0400
committerGreg Kroah-Hartman <gregkh@suse.de>2006-06-22 02:04:17 +0400
commit12e72feab5d9a23107f245b0f241a2484cbb5a4e (patch)
tree0a7325d03fddd768118e42e25cf7a8214b99a560 /drivers/usb/mon/mon_main.c
parent5b1c674d223eef6c6494be8be91e9e3a3054817e (diff)
downloadlinux-12e72feab5d9a23107f245b0f241a2484cbb5a4e.tar.xz
[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>
Diffstat (limited to 'drivers/usb/mon/mon_main.c')
-rw-r--r--drivers/usb/mon/mon_main.c20
1 files changed, 16 insertions, 4 deletions
diff --git a/drivers/usb/mon/mon_main.c b/drivers/usb/mon/mon_main.c
index 86db92b4915b..275a66f83058 100644
--- a/drivers/usb/mon/mon_main.c
+++ b/drivers/usb/mon/mon_main.c
@@ -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;
}