diff options
author | Pete Zaitcev <zaitcev@redhat.com> | 2006-06-10 01:03:32 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2006-06-21 18:04:17 -0400 |
commit | 12e72feab5d9a23107f245b0f241a2484cbb5a4e (patch) | |
tree | 0a7325d03fddd768118e42e25cf7a8214b99a560 /drivers/usb/mon/mon_main.c | |
parent | 5b1c674d223eef6c6494be8be91e9e3a3054817e (diff) |
[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.c | 20 |
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: | |||
114 | 114 | ||
115 | /* | 115 | /* |
116 | */ | 116 | */ |
117 | static void mon_submit_error(struct usb_bus *ubus, struct urb *urb, int err) | 117 | static void mon_submit_error(struct usb_bus *ubus, struct urb *urb, int error) |
118 | { | 118 | { |
119 | struct mon_bus *mbus; | 119 | struct mon_bus *mbus; |
120 | unsigned long flags; | ||
121 | struct list_head *pos; | ||
122 | struct mon_reader *r; | ||
120 | 123 | ||
121 | mbus = ubus->mon_bus; | 124 | mbus = ubus->mon_bus; |
122 | if (mbus == NULL) | 125 | if (mbus == NULL) |
123 | goto out_unlocked; | 126 | goto out_unlocked; |
124 | 127 | ||
125 | /* | 128 | spin_lock_irqsave(&mbus->lock, flags); |
126 | * XXX Capture the error code and the 'E' event. | 129 | if (mbus->nreaders == 0) |
127 | */ | 130 | goto out_locked; |
128 | 131 | ||
132 | mbus->cnt_events++; | ||
133 | list_for_each (pos, &mbus->r_list) { | ||
134 | r = list_entry(pos, struct mon_reader, r_link); | ||
135 | r->rnf_error(r->r_data, urb, error); | ||
136 | } | ||
137 | |||
138 | spin_unlock_irqrestore(&mbus->lock, flags); | ||
129 | return; | 139 | return; |
130 | 140 | ||
141 | out_locked: | ||
142 | spin_unlock_irqrestore(&mbus->lock, flags); | ||
131 | out_unlocked: | 143 | out_unlocked: |
132 | return; | 144 | return; |
133 | } | 145 | } |