Release 4.7 net/bluetooth/hci_sysfs.c
/* Bluetooth HCI driver model support. */
#include <linux/module.h>
#include <net/bluetooth/bluetooth.h>
#include <net/bluetooth/hci_core.h>
static struct class *bt_class;
static inline char *link_typetostr(int type)
{
switch (type) {
case ACL_LINK:
return "ACL";
case SCO_LINK:
return "SCO";
case ESCO_LINK:
return "eSCO";
case LE_LINK:
return "LE";
default:
return "UNKNOWN";
}
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
marcel holtmann | marcel holtmann | 34 | 75.56% | 4 | 66.67% |
peter hurley | peter hurley | 6 | 13.33% | 1 | 16.67% |
maksim krasnyanskiy | maksim krasnyanskiy | 5 | 11.11% | 1 | 16.67% |
| Total | 45 | 100.00% | 6 | 100.00% |
static ssize_t show_link_type(struct device *dev,
struct device_attribute *attr, char *buf)
{
struct hci_conn *conn = to_hci_conn(dev);
return sprintf(buf, "%s\n", link_typetostr(conn->type));
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
marcel holtmann | marcel holtmann | 28 | 62.22% | 4 | 66.67% |
maksim krasnyanskiy | maksim krasnyanskiy | 16 | 35.56% | 1 | 16.67% |
david herrmann | david herrmann | 1 | 2.22% | 1 | 16.67% |
| Total | 45 | 100.00% | 6 | 100.00% |
static ssize_t show_link_address(struct device *dev,
struct device_attribute *attr, char *buf)
{
struct hci_conn *conn = to_hci_conn(dev);
return sprintf(buf, "%pMR\n", &conn->dst);
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
marcel holtmann | marcel holtmann | 24 | 55.81% | 3 | 42.86% |
maksim krasnyanskiy | maksim krasnyanskiy | 14 | 32.56% | 1 | 14.29% |
gustavo f. padovan | gustavo f. padovan | 3 | 6.98% | 1 | 14.29% |
andrei emeltchenko | andrei emeltchenko | 1 | 2.33% | 1 | 14.29% |
david herrmann | david herrmann | 1 | 2.33% | 1 | 14.29% |
| Total | 43 | 100.00% | 7 | 100.00% |
#define LINK_ATTR(_name, _mode, _show, _store) \
struct device_attribute link_attr_##_name = __ATTR(_name, _mode, _show, _store)
static LINK_ATTR(type, S_IRUGO, show_link_type, NULL);
static LINK_ATTR(address, S_IRUGO, show_link_address, NULL);
static struct attribute *bt_link_attrs[] = {
&link_attr_type.attr,
&link_attr_address.attr,
NULL
};
ATTRIBUTE_GROUPS(bt_link);
static void bt_link_release(struct device *dev)
{
struct hci_conn *conn = to_hci_conn(dev);
kfree(conn);
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
marcel holtmann | marcel holtmann | 21 | 80.77% | 2 | 50.00% |
david herrmann | david herrmann | 5 | 19.23% | 2 | 50.00% |
| Total | 26 | 100.00% | 4 | 100.00% |
static struct device_type bt_link = {
.name = "link",
.groups = bt_link_groups,
.release = bt_link_release,
};
/*
* The rfcomm tty device will possibly retain even when conn
* is down, and sysfs doesn't support move zombie device,
* so we should move the device before conn device is destroyed.
*/
static int __match_tty(struct device *dev, void *data)
{
return !strncmp(dev_name(dev), "rfcomm", 6);
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
gustavo f. padovan | gustavo f. padovan | 23 | 79.31% | 1 | 50.00% |
marcel holtmann | marcel holtmann | 6 | 20.69% | 1 | 50.00% |
| Total | 29 | 100.00% | 2 | 100.00% |
void hci_conn_init_sysfs(struct hci_conn *conn)
{
struct hci_dev *hdev = conn->hdev;
BT_DBG("conn %p", conn);
conn->dev.type = &bt_link;
conn->dev.class = bt_class;
conn->dev.parent = &hdev->dev;
device_initialize(&conn->dev);
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
gustavo f. padovan | gustavo f. padovan | 54 | 87.10% | 1 | 33.33% |
marcel holtmann | marcel holtmann | 8 | 12.90% | 2 | 66.67% |
| Total | 62 | 100.00% | 3 | 100.00% |
void hci_conn_add_sysfs(struct hci_conn *conn)
{
struct hci_dev *hdev = conn->hdev;
BT_DBG("conn %p", conn);
dev_set_name(&conn->dev, "%s:%d", hdev->name, conn->handle);
if (device_add(&conn->dev) < 0) {
BT_ERR("Failed to register connection device");
return;
}
hci_dev_hold(hdev);
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
marcel holtmann | marcel holtmann | 53 | 76.81% | 4 | 80.00% |
gustavo f. padovan | gustavo f. padovan | 16 | 23.19% | 1 | 20.00% |
| Total | 69 | 100.00% | 5 | 100.00% |
void hci_conn_del_sysfs(struct hci_conn *conn)
{
struct hci_dev *hdev = conn->hdev;
if (!device_is_registered(&conn->dev))
return;
while (1) {
struct device *dev;
dev = device_find_child(&conn->dev, NULL, __match_tty);
if (!dev)
break;
device_move(dev, NULL, DPM_ORDER_DEV_LAST);
put_device(dev);
}
device_del(&conn->dev);
hci_dev_put(hdev);
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
marcel holtmann | marcel holtmann | 84 | 94.38% | 3 | 60.00% |
gustavo f. padovan | gustavo f. padovan | 3 | 3.37% | 1 | 20.00% |
cornelia huck | cornelia huck | 2 | 2.25% | 1 | 20.00% |
| Total | 89 | 100.00% | 5 | 100.00% |
static inline char *host_typetostr(int type)
{
switch (type) {
case HCI_BREDR:
return "BR/EDR";
case HCI_AMP:
return "AMP";
default:
return "UNKNOWN";
}
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
marcel holtmann | marcel holtmann | 31 | 93.94% | 1 | 50.00% |
david vrabel | david vrabel | 2 | 6.06% | 1 | 50.00% |
| Total | 33 | 100.00% | 2 | 100.00% |
static ssize_t show_type(struct device *dev,
struct device_attribute *attr, char *buf)
{
struct hci_dev *hdev = to_hci_dev(dev);
return sprintf(buf, "%s\n", host_typetostr(hdev->dev_type));
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
marcel holtmann | marcel holtmann | 44 | 97.78% | 1 | 50.00% |
david herrmann | david herrmann | 1 | 2.22% | 1 | 50.00% |
| Total | 45 | 100.00% | 2 | 100.00% |
static ssize_t show_name(struct device *dev,
struct device_attribute *attr, char *buf)
{
struct hci_dev *hdev = to_hci_dev(dev);
char name[HCI_MAX_NAME_LENGTH + 1];
int i;
for (i = 0; i < HCI_MAX_NAME_LENGTH; i++)
name[i] = hdev->dev_name[i];
name[HCI_MAX_NAME_LENGTH] = '\0';
return sprintf(buf, "%s\n", name);
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
marcel holtmann | marcel holtmann | 77 | 92.77% | 3 | 60.00% |
johan hedberg | johan hedberg | 5 | 6.02% | 1 | 20.00% |
david herrmann | david herrmann | 1 | 1.20% | 1 | 20.00% |
| Total | 83 | 100.00% | 5 | 100.00% |
static ssize_t show_address(struct device *dev,
struct device_attribute *attr, char *buf)
{
struct hci_dev *hdev = to_hci_dev(dev);
return sprintf(buf, "%pMR\n", &hdev->bdaddr);
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
marcel holtmann | marcel holtmann | 38 | 88.37% | 5 | 55.56% |
gustavo f. padovan | gustavo f. padovan | 2 | 4.65% | 1 | 11.11% |
andrei emeltchenko | andrei emeltchenko | 1 | 2.33% | 1 | 11.11% |
maksim krasnyanskiy | maksim krasnyanskiy | 1 | 2.33% | 1 | 11.11% |
david herrmann | david herrmann | 1 | 2.33% | 1 | 11.11% |
| Total | 43 | 100.00% | 9 | 100.00% |
static DEVICE_ATTR(type, S_IRUGO, show_type, NULL);
static DEVICE_ATTR(name, S_IRUGO, show_name, NULL);
static DEVICE_ATTR(address, S_IRUGO, show_address, NULL);
static struct attribute *bt_host_attrs[] = {
&dev_attr_type.attr,
&dev_attr_name.attr,
&dev_attr_address.attr,
NULL
};
ATTRIBUTE_GROUPS(bt_host);
static void bt_host_release(struct device *dev)
{
struct hci_dev *hdev = to_hci_dev(dev);
kfree(hdev);
module_put(THIS_MODULE);
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
marcel holtmann | marcel holtmann | 18 | 58.06% | 4 | 50.00% |
david herrmann | david herrmann | 10 | 32.26% | 3 | 37.50% |
dave young | dave young | 3 | 9.68% | 1 | 12.50% |
| Total | 31 | 100.00% | 8 | 100.00% |
static struct device_type bt_host = {
.name = "host",
.groups = bt_host_groups,
.release = bt_host_release,
};
void hci_init_sysfs(struct hci_dev *hdev)
{
struct device *dev = &hdev->dev;
dev->type = &bt_host;
dev->class = bt_class;
__module_get(THIS_MODULE);
device_initialize(dev);
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
david herrmann | david herrmann | 43 | 100.00% | 2 | 100.00% |
| Total | 43 | 100.00% | 2 | 100.00% |
int __init bt_sysfs_init(void)
{
bt_class = class_create(THIS_MODULE, "bluetooth");
return PTR_ERR_OR_ZERO(bt_class);
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
marcel holtmann | marcel holtmann | 15 | 65.22% | 4 | 66.67% |
maksim krasnyanskiy | maksim krasnyanskiy | 7 | 30.43% | 1 | 16.67% |
rusty russell | rusty russell | 1 | 4.35% | 1 | 16.67% |
| Total | 23 | 100.00% | 6 | 100.00% |
void bt_sysfs_cleanup(void)
{
class_destroy(bt_class);
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
maksim krasnyanskiy | maksim krasnyanskiy | 6 | 50.00% | 1 | 25.00% |
marcel holtmann | marcel holtmann | 3 | 25.00% | 2 | 50.00% |
dave young | dave young | 3 | 25.00% | 1 | 25.00% |
| Total | 12 | 100.00% | 4 | 100.00% |
Overall Contributors
| Person | Tokens | Prop | Commits | CommitProp |
marcel holtmann | marcel holtmann | 646 | 70.76% | 20 | 47.62% |
gustavo f. padovan | gustavo f. padovan | 103 | 11.28% | 3 | 7.14% |
david herrmann | david herrmann | 63 | 6.90% | 5 | 11.90% |
maksim krasnyanskiy | maksim krasnyanskiy | 55 | 6.02% | 1 | 2.38% |
dave young | dave young | 12 | 1.31% | 3 | 7.14% |
wei yongjun | wei yongjun | 10 | 1.10% | 1 | 2.38% |
peter hurley | peter hurley | 6 | 0.66% | 1 | 2.38% |
johan hedberg | johan hedberg | 5 | 0.55% | 1 | 2.38% |
paul gortmaker | paul gortmaker | 3 | 0.33% | 1 | 2.38% |
david howells | david howells | 2 | 0.22% | 1 | 2.38% |
andrei emeltchenko | andrei emeltchenko | 2 | 0.22% | 1 | 2.38% |
david vrabel | david vrabel | 2 | 0.22% | 1 | 2.38% |
cornelia huck | cornelia huck | 2 | 0.22% | 1 | 2.38% |
david s. miller | david s. miller | 1 | 0.11% | 1 | 2.38% |
rusty russell | rusty russell | 1 | 0.11% | 1 | 2.38% |
| Total | 913 | 100.00% | 42 | 100.00% |
Information contained on this website is for historical information purposes only and does not indicate or represent copyright ownership.