aboutsummaryrefslogtreecommitdiffstats
path: root/net/bluetooth/hci_sysfs.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/bluetooth/hci_sysfs.c')
-rw-r--r--net/bluetooth/hci_sysfs.c31
1 files changed, 21 insertions, 10 deletions
diff --git a/net/bluetooth/hci_sysfs.c b/net/bluetooth/hci_sysfs.c
index 84360c117d4..844ca5f1b2d 100644
--- a/net/bluetooth/hci_sysfs.c
+++ b/net/bluetooth/hci_sysfs.c
@@ -113,11 +113,13 @@ static ssize_t show_inquiry_cache(struct device *dev, struct device_attribute *a
113 struct inquiry_data *data = &e->data; 113 struct inquiry_data *data = &e->data;
114 bdaddr_t bdaddr; 114 bdaddr_t bdaddr;
115 baswap(&bdaddr, &data->bdaddr); 115 baswap(&bdaddr, &data->bdaddr);
116 n += sprintf(buf + n, "%s %d %d %d 0x%.2x%.2x%.2x 0x%.4x %d %u\n", 116 n += sprintf(buf + n, "%s %d %d %d 0x%.2x%.2x%.2x 0x%.4x %d %d %u\n",
117 batostr(&bdaddr), 117 batostr(&bdaddr),
118 data->pscan_rep_mode, data->pscan_period_mode, data->pscan_mode, 118 data->pscan_rep_mode, data->pscan_period_mode,
119 data->dev_class[2], data->dev_class[1], data->dev_class[0], 119 data->pscan_mode, data->dev_class[2],
120 __le16_to_cpu(data->clock_offset), data->rssi, e->timestamp); 120 data->dev_class[1], data->dev_class[0],
121 __le16_to_cpu(data->clock_offset),
122 data->rssi, data->ssp_mode, e->timestamp);
121 } 123 }
122 124
123 hci_dev_unlock_bh(hdev); 125 hci_dev_unlock_bh(hdev);
@@ -249,15 +251,28 @@ static ssize_t show_conn_address(struct device *dev, struct device_attribute *at
249 return sprintf(buf, "%s\n", batostr(&bdaddr)); 251 return sprintf(buf, "%s\n", batostr(&bdaddr));
250} 252}
251 253
254static ssize_t show_conn_features(struct device *dev, struct device_attribute *attr, char *buf)
255{
256 struct hci_conn *conn = dev_get_drvdata(dev);
257
258 return sprintf(buf, "0x%02x%02x%02x%02x%02x%02x%02x%02x\n",
259 conn->features[0], conn->features[1],
260 conn->features[2], conn->features[3],
261 conn->features[4], conn->features[5],
262 conn->features[6], conn->features[7]);
263}
264
252#define CONN_ATTR(_name,_mode,_show,_store) \ 265#define CONN_ATTR(_name,_mode,_show,_store) \
253struct device_attribute conn_attr_##_name = __ATTR(_name,_mode,_show,_store) 266struct device_attribute conn_attr_##_name = __ATTR(_name,_mode,_show,_store)
254 267
255static CONN_ATTR(type, S_IRUGO, show_conn_type, NULL); 268static CONN_ATTR(type, S_IRUGO, show_conn_type, NULL);
256static CONN_ATTR(address, S_IRUGO, show_conn_address, NULL); 269static CONN_ATTR(address, S_IRUGO, show_conn_address, NULL);
270static CONN_ATTR(features, S_IRUGO, show_conn_features, NULL);
257 271
258static struct device_attribute *conn_attrs[] = { 272static struct device_attribute *conn_attrs[] = {
259 &conn_attr_type, 273 &conn_attr_type,
260 &conn_attr_address, 274 &conn_attr_address,
275 &conn_attr_features,
261 NULL 276 NULL
262}; 277};
263 278
@@ -296,7 +311,6 @@ static void add_conn(struct work_struct *work)
296void hci_conn_add_sysfs(struct hci_conn *conn) 311void hci_conn_add_sysfs(struct hci_conn *conn)
297{ 312{
298 struct hci_dev *hdev = conn->hdev; 313 struct hci_dev *hdev = conn->hdev;
299 bdaddr_t *ba = &conn->dst;
300 314
301 BT_DBG("conn %p", conn); 315 BT_DBG("conn %p", conn);
302 316
@@ -305,11 +319,8 @@ void hci_conn_add_sysfs(struct hci_conn *conn)
305 319
306 conn->dev.release = bt_release; 320 conn->dev.release = bt_release;
307 321
308 snprintf(conn->dev.bus_id, BUS_ID_SIZE, 322 snprintf(conn->dev.bus_id, BUS_ID_SIZE, "%s:%d",
309 "%s%2.2X%2.2X%2.2X%2.2X%2.2X%2.2X", 323 hdev->name, conn->handle);
310 conn->type == ACL_LINK ? "acl" : "sco",
311 ba->b[5], ba->b[4], ba->b[3],
312 ba->b[2], ba->b[1], ba->b[0]);
313 324
314 dev_set_drvdata(&conn->dev, conn); 325 dev_set_drvdata(&conn->dev, conn);
315 326