diff options
author | Thomas Pugliese <thomas.pugliese@gmail.com> | 2014-09-16 15:53:08 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2014-09-23 22:04:44 -0700 |
commit | 848879340a7d220fd9801396eba82ecac2f2a739 (patch) | |
tree | e61a90d95d576c10e55b0296d7be17ef79a64acf /drivers/uwb/lc-dev.c | |
parent | 58e4ab3eb02c77e11eae1555e4d635a058afb629 (diff) | |
download | linux-stable-848879340a7d220fd9801396eba82ecac2f2a739.tar.gz linux-stable-848879340a7d220fd9801396eba82ecac2f2a739.tar.bz2 linux-stable-848879340a7d220fd9801396eba82ecac2f2a739.zip |
uwb: create a uwb bus type and add in-range peer devices to it
Documentation/usb/WUSB-Design-overview.txt states that UWB devices seen
by a UWB radio controller are added to /sys/bus/uwb/devices, but this
was not actually being done. This functionality is needed in order for
UWB peer devices to be enumerated by user mode tools. This patch
creates a uwb bus type and adds UWB peer devices to it as they are
discovered by the radio controller.
Signed-off-by: Thomas Pugliese <thomas.pugliese@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/uwb/lc-dev.c')
-rw-r--r-- | drivers/uwb/lc-dev.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/drivers/uwb/lc-dev.c b/drivers/uwb/lc-dev.c index ba76810eea10..8c7cfab5cee3 100644 --- a/drivers/uwb/lc-dev.c +++ b/drivers/uwb/lc-dev.c @@ -255,6 +255,12 @@ static struct attribute *uwb_dev_attrs[] = { }; ATTRIBUTE_GROUPS(uwb_dev); +/* UWB bus type. */ +struct bus_type uwb_bus_type = { + .name = "uwb", + .dev_groups = uwb_dev_groups, +}; + /** * Device SYSFS registration */ @@ -263,10 +269,6 @@ static int __uwb_dev_sys_add(struct uwb_dev *uwb_dev, struct device *parent_dev) struct device *dev; dev = &uwb_dev->dev; - /* Device sysfs files are only useful for neighbor devices not - local radio controllers. */ - if (&uwb_dev->rc->uwb_dev != uwb_dev) - dev->groups = uwb_dev_groups; dev->parent = parent_dev; dev_set_drvdata(dev, uwb_dev); @@ -428,6 +430,7 @@ void uwbd_dev_onair(struct uwb_rc *rc, struct uwb_beca_e *bce) return; } uwb_dev_init(uwb_dev); /* This sets refcnt to one, we own it */ + uwb_dev->dev.bus = &uwb_bus_type; uwb_dev->mac_addr = *bce->mac_addr; uwb_dev->dev_addr = bce->dev_addr; dev_set_name(&uwb_dev->dev, "%s", macbuf); |