cregit-Linux how code gets into the kernel

Release 4.8 net/bluetooth/hci_sysfs.c

Directory: net/bluetooth
/* 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 void bt_link_release(struct device *dev) { struct hci_conn *conn = to_hci_conn(dev); kfree(conn); }

Contributors

PersonTokensPropCommitsCommitProp
marcel holtmannmarcel holtmann2180.77%250.00%
david herrmanndavid herrmann519.23%250.00%
Total26100.00%4100.00%

static struct device_type bt_link = { .name = "link", .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

PersonTokensPropCommitsCommitProp
gustavo f. padovangustavo f. padovan2379.31%150.00%
marcel holtmannmarcel holtmann620.69%150.00%
Total29100.00%2100.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

PersonTokensPropCommitsCommitProp
gustavo f. padovangustavo f. padovan5487.10%133.33%
marcel holtmannmarcel holtmann812.90%266.67%
Total62100.00%3100.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

PersonTokensPropCommitsCommitProp
marcel holtmannmarcel holtmann5376.81%480.00%
gustavo f. padovangustavo f. padovan1623.19%120.00%
Total69100.00%5100.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

PersonTokensPropCommitsCommitProp
marcel holtmannmarcel holtmann8494.38%360.00%
gustavo f. padovangustavo f. padovan33.37%120.00%
cornelia huckcornelia huck22.25%120.00%
Total89100.00%5100.00%


static void bt_host_release(struct device *dev) { struct hci_dev *hdev = to_hci_dev(dev); kfree(hdev); module_put(THIS_MODULE); }

Contributors

PersonTokensPropCommitsCommitProp
marcel holtmannmarcel holtmann1858.06%450.00%
david herrmanndavid herrmann1032.26%337.50%
dave youngdave young39.68%112.50%
Total31100.00%8100.00%

static struct device_type bt_host = { .name = "host", .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

PersonTokensPropCommitsCommitProp
david herrmanndavid herrmann43100.00%2100.00%
Total43100.00%2100.00%


int __init bt_sysfs_init(void) { bt_class = class_create(THIS_MODULE, "bluetooth"); return PTR_ERR_OR_ZERO(bt_class); }

Contributors

PersonTokensPropCommitsCommitProp
marcel holtmannmarcel holtmann1565.22%466.67%
maksim krasnyanskiymaksim krasnyanskiy730.43%116.67%
rusty russellrusty russell14.35%116.67%
Total23100.00%6100.00%


void bt_sysfs_cleanup(void) { class_destroy(bt_class); }

Contributors

PersonTokensPropCommitsCommitProp
maksim krasnyanskiymaksim krasnyanskiy650.00%125.00%
marcel holtmannmarcel holtmann325.00%250.00%
dave youngdave young325.00%125.00%
Total12100.00%4100.00%


Overall Contributors

PersonTokensPropCommitsCommitProp
marcel holtmannmarcel holtmann24957.24%1456.00%
gustavo f. padovangustavo f. padovan9722.30%14.00%
david herrmanndavid herrmann5813.33%520.00%
maksim krasnyanskiymaksim krasnyanskiy194.37%14.00%
dave youngdave young61.38%14.00%
paul gortmakerpaul gortmaker30.69%14.00%
cornelia huckcornelia huck20.46%14.00%
rusty russellrusty russell10.23%14.00%
Total435100.00%25100.00%
Directory: net/bluetooth
Information contained on this website is for historical information purposes only and does not indicate or represent copyright ownership.