mon_main.c (95d465fd750897ab32462a6702fbfe1b122cbbc0) mon_main.c (5b1c674d223eef6c6494be8be91e9e3a3054817e)
1/*
2 * The USB Monitor, inspired by Dave Harding's USBMon.
3 *
4 * mon_main.c: Main file, module initiation and exit, registrations, etc.
5 *
6 * Copyright (C) 2005 Pete Zaitcev (zaitcev@redhat.com)
7 */
8

--- 83 unchanged lines hidden (view full) ---

92 mbus = ubus->mon_bus;
93 if (mbus == NULL)
94 goto out_unlocked;
95
96 spin_lock_irqsave(&mbus->lock, flags);
97 if (mbus->nreaders == 0)
98 goto out_locked;
99
1/*
2 * The USB Monitor, inspired by Dave Harding's USBMon.
3 *
4 * mon_main.c: Main file, module initiation and exit, registrations, etc.
5 *
6 * Copyright (C) 2005 Pete Zaitcev (zaitcev@redhat.com)
7 */
8

--- 83 unchanged lines hidden (view full) ---

92 mbus = ubus->mon_bus;
93 if (mbus == NULL)
94 goto out_unlocked;
95
96 spin_lock_irqsave(&mbus->lock, flags);
97 if (mbus->nreaders == 0)
98 goto out_locked;
99
100 mbus->cnt_events++;
100 list_for_each (pos, &mbus->r_list) {
101 r = list_entry(pos, struct mon_reader, r_link);
102 r->rnf_submit(r->r_data, urb);
103 }
104
105 spin_unlock_irqrestore(&mbus->lock, flags);
106 return;
107

--- 39 unchanged lines hidden (view full) ---

147 * At this point we do not even know the bus number...
148 */
149 printk(KERN_ERR TAG ": Null mon bus in URB, pipe 0x%x\n",
150 urb->pipe);
151 return;
152 }
153
154 spin_lock_irqsave(&mbus->lock, flags);
101 list_for_each (pos, &mbus->r_list) {
102 r = list_entry(pos, struct mon_reader, r_link);
103 r->rnf_submit(r->r_data, urb);
104 }
105
106 spin_unlock_irqrestore(&mbus->lock, flags);
107 return;
108

--- 39 unchanged lines hidden (view full) ---

148 * At this point we do not even know the bus number...
149 */
150 printk(KERN_ERR TAG ": Null mon bus in URB, pipe 0x%x\n",
151 urb->pipe);
152 return;
153 }
154
155 spin_lock_irqsave(&mbus->lock, flags);
156 mbus->cnt_events++;
155 list_for_each (pos, &mbus->r_list) {
156 r = list_entry(pos, struct mon_reader, r_link);
157 r->rnf_complete(r->r_data, urb);
158 }
159 spin_unlock_irqrestore(&mbus->lock, flags);
160}
161
162/* int (*unlink_urb) (struct urb *urb, int status); */
163
164/*
165 * Stop monitoring.
157 list_for_each (pos, &mbus->r_list) {
158 r = list_entry(pos, struct mon_reader, r_link);
159 r->rnf_complete(r->r_data, urb);
160 }
161 spin_unlock_irqrestore(&mbus->lock, flags);
162}
163
164/* int (*unlink_urb) (struct urb *urb, int status); */
165
166/*
167 * Stop monitoring.
166 * Obviously this must be well locked, so no need to play with mb's.
167 */
168static void mon_stop(struct mon_bus *mbus)
169{
170 struct usb_bus *ubus = mbus->u_bus;
171
172 /*
173 * A stop can be called for a dissolved mon_bus in case of
174 * a reader staying across an rmmod foo_hcd.

--- 224 unchanged lines hidden ---
168 */
169static void mon_stop(struct mon_bus *mbus)
170{
171 struct usb_bus *ubus = mbus->u_bus;
172
173 /*
174 * A stop can be called for a dissolved mon_bus in case of
175 * a reader staying across an rmmod foo_hcd.

--- 224 unchanged lines hidden ---