net/bluetooth/hci_debugfs.c
Source file repositories/reference/linux-study-clean/net/bluetooth/hci_debugfs.c
File Facts
- System
- Linux kernel
- Corpus path
net/bluetooth/hci_debugfs.c- Extension
.c- Size
- 33951 bytes
- Lines
- 1393
- Domain
- Networking Core
- Bucket
- Sockets, Protocols, Packet Path, And Network Policy
- Inferred role
- Networking Core: operation-table or driver-model contract
- Status
- pattern implementation candidate
Why This File Exists
Networking stack implementation surface: socket APIs, protocol dispatch, packet flow, routing, filtering, and network namespaces.
- Networking stack implementation surface: socket APIs, protocol dispatch, packet flow, routing, filtering, and network namespaces.
- Defines an operation table; this is where Linux turns generic core objects into subsystem-specific behavior.
- Touches user memory; correctness depends on fault-safe copying and privilege boundary handling.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/debugfs.hlinux/kstrtox.hnet/bluetooth/bluetooth.hnet/bluetooth/hci_core.hsmp.hhci_debugfs.h
Detected Declarations
function features_showfunction device_id_showfunction device_list_showfunction blacklist_showfunction blocked_keys_showfunction uuids_showfunction remote_oob_showfunction conn_info_min_age_setfunction conn_info_min_age_getfunction conn_info_max_age_setfunction conn_info_max_age_getfunction use_debug_keys_readfunction sc_only_mode_readfunction hci_debugfs_create_commonfunction inquiry_cache_showfunction list_for_each_entryfunction link_keys_showfunction dev_class_showfunction voice_setting_getfunction ssp_debug_mode_readfunction auto_accept_delay_setfunction min_encrypt_key_size_setfunction min_encrypt_key_size_getfunction auto_accept_delay_getfunction force_bredr_smp_readfunction force_bredr_smp_writefunction idle_timeout_setfunction idle_timeout_getfunction sniff_min_interval_setfunction sniff_min_interval_getfunction sniff_max_interval_setfunction sniff_max_interval_getfunction hci_debugfs_create_bredrfunction identity_showfunction rpa_timeout_setfunction rpa_timeout_getfunction random_address_showfunction static_address_showfunction force_static_address_readfunction force_static_address_writefunction white_list_showfunction resolv_list_showfunction identity_resolving_keys_showfunction long_term_keys_showfunction conn_min_interval_setfunction conn_min_interval_getfunction conn_max_interval_setfunction conn_max_interval_get
Annotated Snippet
static const struct file_operations __name ## _fops = { \
.open = simple_open, \
.read = __name ## _read, \
.write = __name ## _write, \
.llseek = default_llseek, \
} \
#define DEFINE_INFO_ATTRIBUTE(__name, __field) \
static int __name ## _show(struct seq_file *f, void *ptr) \
{ \
struct hci_dev *hdev = f->private; \
\
hci_dev_lock(hdev); \
seq_printf(f, "%s\n", hdev->__field ? : ""); \
hci_dev_unlock(hdev); \
\
return 0; \
} \
\
DEFINE_SHOW_ATTRIBUTE(__name)
static int features_show(struct seq_file *f, void *ptr)
{
struct hci_dev *hdev = f->private;
u8 p;
hci_dev_lock(hdev);
for (p = 0; p < HCI_MAX_PAGES && p <= hdev->max_page; p++)
seq_printf(f, "%2u: %8ph\n", p, hdev->features[p]);
if (lmp_le_capable(hdev))
seq_printf(f, "LE: %8ph\n", hdev->le_features);
hci_dev_unlock(hdev);
return 0;
}
DEFINE_SHOW_ATTRIBUTE(features);
static int device_id_show(struct seq_file *f, void *ptr)
{
struct hci_dev *hdev = f->private;
hci_dev_lock(hdev);
seq_printf(f, "%4.4x:%4.4x:%4.4x:%4.4x\n", hdev->devid_source,
hdev->devid_vendor, hdev->devid_product, hdev->devid_version);
hci_dev_unlock(hdev);
return 0;
}
DEFINE_SHOW_ATTRIBUTE(device_id);
static int device_list_show(struct seq_file *f, void *ptr)
{
struct hci_dev *hdev = f->private;
struct hci_conn_params *p;
struct bdaddr_list *b;
hci_dev_lock(hdev);
list_for_each_entry(b, &hdev->accept_list, list)
seq_printf(f, "%pMR (type %u)\n", &b->bdaddr, b->bdaddr_type);
list_for_each_entry(p, &hdev->le_conn_params, list) {
seq_printf(f, "%pMR (type %u) %u\n", &p->addr, p->addr_type,
p->auto_connect);
}
hci_dev_unlock(hdev);
return 0;
}
DEFINE_SHOW_ATTRIBUTE(device_list);
static int blacklist_show(struct seq_file *f, void *p)
{
struct hci_dev *hdev = f->private;
struct bdaddr_list *b;
hci_dev_lock(hdev);
list_for_each_entry(b, &hdev->reject_list, list)
seq_printf(f, "%pMR (type %u)\n", &b->bdaddr, b->bdaddr_type);
hci_dev_unlock(hdev);
return 0;
}
DEFINE_SHOW_ATTRIBUTE(blacklist);
static int blocked_keys_show(struct seq_file *f, void *p)
{
struct hci_dev *hdev = f->private;
Annotation
- Immediate include surface: `linux/debugfs.h`, `linux/kstrtox.h`, `net/bluetooth/bluetooth.h`, `net/bluetooth/hci_core.h`, `smp.h`, `hci_debugfs.h`.
- Detected declarations: `function features_show`, `function device_id_show`, `function device_list_show`, `function blacklist_show`, `function blocked_keys_show`, `function uuids_show`, `function remote_oob_show`, `function conn_info_min_age_set`, `function conn_info_min_age_get`, `function conn_info_max_age_set`.
- Atlas domain: Networking Core / Sockets, Protocols, Packet Path, And Network Policy.
- Implementation status: pattern implementation candidate.
- This snippet crosses the user/kernel memory boundary; validate fault handling and access checks before translating the pattern.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.