From ce7cd137fced114d49178b73d468b82096a107fb Mon Sep 17 00:00:00 2001 From: Pete Zaitcev Date: Thu, 3 May 2007 16:51:16 -0700 Subject: usbmon: Add class for binary interface Add a class which allows for an easier integration with udev. This code was originally written by Paolo Abeni, and arrived to my tree as a part of big patch to add binary API on December 18. As I understand, Paolo always meant the class to be a part of the whole thing. This is his udev rule to go along with the patch: KERNEL=="usbmon[0-9]*", NAME="usbmon%n", MODE="0440",OWNER="root",GROUP="bin" Signed-off-by: Pete Zaitcev Signed-off-by: Greg Kroah-Hartman --- drivers/usb/mon/mon_main.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'drivers/usb/mon/mon_main.c') diff --git a/drivers/usb/mon/mon_main.c b/drivers/usb/mon/mon_main.c index 8977ec0d0f99..ce61d8b0fd86 100644 --- a/drivers/usb/mon/mon_main.c +++ b/drivers/usb/mon/mon_main.c @@ -220,6 +220,8 @@ static void mon_bus_remove(struct usb_bus *ubus) list_del(&mbus->bus_link); if (mbus->text_inited) mon_text_del(mbus); + if (mbus->bin_inited) + mon_bin_del(mbus); mon_dissolve(mbus, ubus); kref_put(&mbus->ref, mon_bus_drop); @@ -301,8 +303,8 @@ static void mon_bus_init(struct usb_bus *ubus) mbus->u_bus = ubus; ubus->mon_bus = mbus; - mbus->text_inited = mon_text_add(mbus, ubus->busnum); - // mon_bin_add(...) + mbus->text_inited = mon_text_add(mbus, ubus); + mbus->bin_inited = mon_bin_add(mbus, ubus); mutex_lock(&mon_lock); list_add_tail(&mbus->bus_link, &mon_buses); @@ -321,8 +323,8 @@ static void mon_bus0_init(void) spin_lock_init(&mbus->lock); INIT_LIST_HEAD(&mbus->r_list); - mbus->text_inited = mon_text_add(mbus, 0); - // mbus->bin_inited = mon_bin_add(mbus, 0); + mbus->text_inited = mon_text_add(mbus, NULL); + mbus->bin_inited = mon_bin_add(mbus, NULL); } /* @@ -403,6 +405,8 @@ static void __exit mon_exit(void) if (mbus->text_inited) mon_text_del(mbus); + if (mbus->bin_inited) + mon_bin_del(mbus); /* * This never happens, because the open/close paths in @@ -423,6 +427,8 @@ static void __exit mon_exit(void) mbus = &mon_bus0; if (mbus->text_inited) mon_text_del(mbus); + if (mbus->bin_inited) + mon_bin_del(mbus); mutex_unlock(&mon_lock); -- cgit v1.2.3