Lines Matching +full:force +full:- +full:m1
1 // SPDX-License-Identifier: GPL-2.0
34 * This must be called with mon_lock taken because of mbus->ref.
41 spin_lock_irqsave(&mbus->lock, flags); in mon_reader_add()
42 if (mbus->nreaders == 0) { in mon_reader_add()
45 struct mon_bus *m1; in mon_reader_add() local
46 m1 = list_entry(p, struct mon_bus, bus_link); in mon_reader_add()
47 m1->u_bus->monitored = 1; in mon_reader_add()
50 mbus->u_bus->monitored = 1; in mon_reader_add()
53 mbus->nreaders++; in mon_reader_add()
54 list_add_tail(&r->r_link, &mbus->r_list); in mon_reader_add()
55 spin_unlock_irqrestore(&mbus->lock, flags); in mon_reader_add()
57 kref_get(&mbus->ref); in mon_reader_add()
63 * This is called with mon_lock taken, so we can decrement mbus->ref.
69 spin_lock_irqsave(&mbus->lock, flags); in mon_reader_del()
70 list_del(&r->r_link); in mon_reader_del()
71 --mbus->nreaders; in mon_reader_del()
72 if (mbus->nreaders == 0) in mon_reader_del()
74 spin_unlock_irqrestore(&mbus->lock, flags); in mon_reader_del()
76 kref_put(&mbus->ref, mon_bus_drop); in mon_reader_del()
86 spin_lock_irqsave(&mbus->lock, flags); in mon_bus_submit()
87 mbus->cnt_events++; in mon_bus_submit()
88 list_for_each_entry(r, &mbus->r_list, r_link) in mon_bus_submit()
89 r->rnf_submit(r->r_data, urb); in mon_bus_submit()
90 spin_unlock_irqrestore(&mbus->lock, flags); in mon_bus_submit()
97 mbus = ubus->mon_bus; in mon_submit()
110 spin_lock_irqsave(&mbus->lock, flags); in mon_bus_submit_error()
111 mbus->cnt_events++; in mon_bus_submit_error()
112 list_for_each_entry(r, &mbus->r_list, r_link) in mon_bus_submit_error()
113 r->rnf_error(r->r_data, urb, error); in mon_bus_submit_error()
114 spin_unlock_irqrestore(&mbus->lock, flags); in mon_bus_submit_error()
121 mbus = ubus->mon_bus; in mon_submit_error()
134 spin_lock_irqsave(&mbus->lock, flags); in mon_bus_complete()
135 mbus->cnt_events++; in mon_bus_complete()
136 list_for_each_entry(r, &mbus->r_list, r_link) in mon_bus_complete()
137 r->rnf_complete(r->r_data, urb, status); in mon_bus_complete()
138 spin_unlock_irqrestore(&mbus->lock, flags); in mon_bus_complete()
145 mbus = ubus->mon_bus; in mon_complete()
165 if (mbus->nreaders == 0 && (ubus = mbus->u_bus) != NULL) in mon_stop()
166 ubus->monitored = 0; in mon_stop()
171 * a reader staying across an rmmod foo_hcd, so test ->u_bus. in mon_stop()
173 if (mon_bus0.nreaders == 0 && (ubus = mbus->u_bus) != NULL) { in mon_stop()
174 ubus->monitored = 0; in mon_stop()
181 * Add a USB bus (usually by a modprobe foo-hcd)
191 ubus->monitored = 1; in mon_bus_add()
196 * Remove a USB bus (either from rmmod foo-hcd or from a hot-remove event).
200 struct mon_bus *mbus = ubus->mon_bus; in mon_bus_remove()
203 list_del(&mbus->bus_link); in mon_bus_remove()
204 if (mbus->text_inited) in mon_bus_remove()
206 if (mbus->bin_inited) in mon_bus_remove()
210 kref_put(&mbus->ref, mon_bus_drop); in mon_bus_remove()
246 if (ubus->monitored) { in mon_dissolve()
247 ubus->monitored = 0; in mon_dissolve()
251 ubus->mon_bus = NULL; in mon_dissolve()
252 mbus->u_bus = NULL; in mon_dissolve()
268 * - allocate mon_bus
269 * - refcount USB bus struct
270 * - link
279 kref_init(&mbus->ref); in mon_bus_init()
280 spin_lock_init(&mbus->lock); in mon_bus_init()
281 INIT_LIST_HEAD(&mbus->r_list); in mon_bus_init()
287 mbus->u_bus = ubus; in mon_bus_init()
288 ubus->mon_bus = mbus; in mon_bus_init()
290 mbus->text_inited = mon_text_add(mbus, ubus); in mon_bus_init()
291 mbus->bin_inited = mon_bin_add(mbus, ubus); in mon_bus_init()
294 list_add_tail(&mbus->bus_link, &mon_buses); in mon_bus_init()
306 kref_init(&mbus->ref); in mon_bus0_init()
307 spin_lock_init(&mbus->lock); in mon_bus0_init()
308 INIT_LIST_HEAD(&mbus->r_list); in mon_bus0_init()
310 mbus->text_inited = mon_text_add(mbus, NULL); in mon_bus0_init()
311 mbus->bin_inited = mon_bin_add(mbus, NULL); in mon_bus0_init()
330 if (mbus->u_bus->busnum == num) { in mon_bus_lookup()
351 rc = -ENODEV; in mon_init()
386 if (mbus->text_inited) in mon_exit()
388 if (mbus->bin_inited) in mon_exit()
396 if (mbus->nreaders) { in mon_exit()
399 mbus->nreaders, mbus->u_bus->busnum); in mon_exit()
400 kref_get(&mbus->ref); /* Force leak */ in mon_exit()
403 mon_dissolve(mbus, mbus->u_bus); in mon_exit()
404 kref_put(&mbus->ref, mon_bus_drop); in mon_exit()
408 if (mbus->text_inited) in mon_exit()
410 if (mbus->bin_inited) in mon_exit()