aboutsummaryrefslogtreecommitdiffstats
path: root/net/bluetooth/hci_sysfs.c
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2010-02-12 20:28:41 -0500
committerMarcel Holtmann <marcel@holtmann.org>2010-02-27 08:05:38 -0500
commit943da25d95c7e8fd8c39dbf09e030f5da46f5d85 (patch)
treeafa710bb2455ec43db38e205157fd6943ac6b63b /net/bluetooth/hci_sysfs.c
parentb914a250e7b390c713b36a9405a39c4c11abad80 (diff)
Bluetooth: Add controller types for BR/EDR and 802.11 AMP
With the Bluetooth 3.0 specification and the introduction of alternate MAC/PHY (AMP) support, it is required to differentiate between primary BR/EDR controllers and 802.11 AMP controllers. So introduce a special type inside HCI device for differentiation. For now all AMP controllers will be treated as raw devices until an AMP manager has been implemented. Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Diffstat (limited to 'net/bluetooth/hci_sysfs.c')
-rw-r--r--net/bluetooth/hci_sysfs.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/net/bluetooth/hci_sysfs.c b/net/bluetooth/hci_sysfs.c
index f9d93f9cbcd2..1a79a6c7e30e 100644
--- a/net/bluetooth/hci_sysfs.c
+++ b/net/bluetooth/hci_sysfs.c
@@ -192,12 +192,30 @@ static inline char *host_bustostr(int bus)
192 } 192 }
193} 193}
194 194
195static inline char *host_typetostr(int type)
196{
197 switch (type) {
198 case HCI_BREDR:
199 return "BR/EDR";
200 case HCI_80211:
201 return "802.11";
202 default:
203 return "UNKNOWN";
204 }
205}
206
195static ssize_t show_bus(struct device *dev, struct device_attribute *attr, char *buf) 207static ssize_t show_bus(struct device *dev, struct device_attribute *attr, char *buf)
196{ 208{
197 struct hci_dev *hdev = dev_get_drvdata(dev); 209 struct hci_dev *hdev = dev_get_drvdata(dev);
198 return sprintf(buf, "%s\n", host_bustostr(hdev->bus)); 210 return sprintf(buf, "%s\n", host_bustostr(hdev->bus));
199} 211}
200 212
213static ssize_t show_type(struct device *dev, struct device_attribute *attr, char *buf)
214{
215 struct hci_dev *hdev = dev_get_drvdata(dev);
216 return sprintf(buf, "%s\n", host_typetostr(hdev->dev_type));
217}
218
201static ssize_t show_name(struct device *dev, struct device_attribute *attr, char *buf) 219static ssize_t show_name(struct device *dev, struct device_attribute *attr, char *buf)
202{ 220{
203 struct hci_dev *hdev = dev_get_drvdata(dev); 221 struct hci_dev *hdev = dev_get_drvdata(dev);
@@ -334,6 +352,7 @@ static ssize_t store_sniff_min_interval(struct device *dev, struct device_attrib
334} 352}
335 353
336static DEVICE_ATTR(bus, S_IRUGO, show_bus, NULL); 354static DEVICE_ATTR(bus, S_IRUGO, show_bus, NULL);
355static DEVICE_ATTR(type, S_IRUGO, show_type, NULL);
337static DEVICE_ATTR(name, S_IRUGO, show_name, NULL); 356static DEVICE_ATTR(name, S_IRUGO, show_name, NULL);
338static DEVICE_ATTR(class, S_IRUGO, show_class, NULL); 357static DEVICE_ATTR(class, S_IRUGO, show_class, NULL);
339static DEVICE_ATTR(address, S_IRUGO, show_address, NULL); 358static DEVICE_ATTR(address, S_IRUGO, show_address, NULL);
@@ -351,6 +370,7 @@ static DEVICE_ATTR(sniff_min_interval, S_IRUGO | S_IWUSR,
351 370
352static struct attribute *bt_host_attrs[] = { 371static struct attribute *bt_host_attrs[] = {
353 &dev_attr_bus.attr, 372 &dev_attr_bus.attr,
373 &dev_attr_type.attr,
354 &dev_attr_name.attr, 374 &dev_attr_name.attr,
355 &dev_attr_class.attr, 375 &dev_attr_class.attr,
356 &dev_attr_address.attr, 376 &dev_attr_address.attr,