cregit-Linux how code gets into the kernel

Release 4.14 net/bluetooth/hci_sysfs.c

Directory: net/bluetooth
// SPDX-License-Identifier: GPL-2.0
/* 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 Holtmann2180.77%250.00%
David Herrmann519.23%250.00%
Total26100.00%4100.00%

static const 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 Fernando Padovan2379.31%150.00%
Marcel 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 Fernando Padovan5487.10%133.33%
Marcel 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 Holtmann5376.81%480.00%
Gustavo Fernando 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 Holtmann8494.38%360.00%
Gustavo Fernando Padovan33.37%120.00%
Cornelia 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 Holtmann1858.06%450.00%
David Herrmann1032.26%337.50%
Dave Young39.68%112.50%
Total31100.00%8100.00%

static const 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 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 Holtmann1356.52%466.67%
Maksim Krasnyanskiy939.13%116.67%
Rusty Russell14.35%116.67%
Total23100.00%6100.00%


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

Contributors

PersonTokensPropCommitsCommitProp
Maksim Krasnyanskiy650.00%125.00%
Marcel Holtmann325.00%250.00%
Dave Young325.00%125.00%
Total12100.00%4100.00%


Overall Contributors

PersonTokensPropCommitsCommitProp
Marcel Holtmann24756.39%1451.85%
Gustavo Fernando Padovan9722.15%13.70%
David Herrmann5813.24%518.52%
Maksim Krasnyanskiy214.79%13.70%
Dave Young61.37%13.70%
Paul Gortmaker30.68%13.70%
Bhumika Goyal20.46%13.70%
Cornelia Huck20.46%13.70%
Rusty Russell10.23%13.70%
Greg Kroah-Hartman10.23%13.70%
Total438100.00%27100.00%
Directory: net/bluetooth
Information contained on this website is for historical information purposes only and does not indicate or represent copyright ownership.
Created with cregit.