include/net/bluetooth/l2cap.h
Source file repositories/reference/linux-study-clean/include/net/bluetooth/l2cap.h
File Facts
- System
- Linux kernel
- Corpus path
include/net/bluetooth/l2cap.h- Extension
.h- Size
- 24236 bytes
- Lines
- 982
- Domain
- Networking Core
- Bucket
- Sockets, Protocols, Packet Path, And Network Policy
- Inferred role
- Networking Core: implementation source
- Status
- source 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.
- 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/unaligned.hlinux/atomic.h
Detected Declarations
struct sockaddr_l2struct l2cap_optionsstruct l2cap_conninfostruct l2cap_hdrstruct l2cap_cmd_hdrstruct l2cap_cmd_rej_unkstruct l2cap_cmd_rej_mtustruct l2cap_cmd_rej_cidstruct l2cap_conn_reqstruct l2cap_conn_rspstruct l2cap_conf_reqstruct l2cap_conf_rspstruct l2cap_conf_optstruct l2cap_conf_rfcstruct l2cap_conf_efsstruct l2cap_disconn_reqstruct l2cap_disconn_rspstruct l2cap_info_reqstruct l2cap_info_rspstruct l2cap_move_chan_cfmstruct l2cap_move_chan_cfm_rspstruct l2cap_conn_param_update_reqstruct l2cap_conn_param_update_rspstruct l2cap_le_conn_reqstruct l2cap_le_conn_rspstruct l2cap_le_creditsstruct l2cap_ecred_conn_reqstruct l2cap_ecred_conn_rspstruct l2cap_ecred_reconf_reqstruct l2cap_ecred_reconf_rspstruct l2cap_seq_liststruct l2cap_chanstruct l2cap_opsstruct l2cap_connstruct l2cap_userstruct l2cap_rx_busystruct l2cap_pinfofunction l2cap_chan_lockfunction l2cap_chan_unlockfunction l2cap_set_timerfunction l2cap_clear_timerfunction __seq_offsetfunction __next_seqfunction l2cap_chan_no_recvfunction l2cap_chan_no_teardown
Annotated Snippet
struct sockaddr_l2 {
sa_family_t l2_family;
__le16 l2_psm;
bdaddr_t l2_bdaddr;
__le16 l2_cid;
__u8 l2_bdaddr_type;
};
/* L2CAP socket options */
#define L2CAP_OPTIONS 0x01
struct l2cap_options {
__u16 omtu;
__u16 imtu;
__u16 flush_to;
__u8 mode;
__u8 fcs;
__u8 max_tx;
__u16 txwin_size;
};
#define L2CAP_CONNINFO 0x02
struct l2cap_conninfo {
__u16 hci_handle;
__u8 dev_class[3];
};
#define L2CAP_LM 0x03
#define L2CAP_LM_MASTER 0x0001
#define L2CAP_LM_AUTH 0x0002
#define L2CAP_LM_ENCRYPT 0x0004
#define L2CAP_LM_TRUSTED 0x0008
#define L2CAP_LM_RELIABLE 0x0010
#define L2CAP_LM_SECURE 0x0020
#define L2CAP_LM_FIPS 0x0040
/* L2CAP command codes */
#define L2CAP_COMMAND_REJ 0x01
#define L2CAP_CONN_REQ 0x02
#define L2CAP_CONN_RSP 0x03
#define L2CAP_CONF_REQ 0x04
#define L2CAP_CONF_RSP 0x05
#define L2CAP_DISCONN_REQ 0x06
#define L2CAP_DISCONN_RSP 0x07
#define L2CAP_ECHO_REQ 0x08
#define L2CAP_ECHO_RSP 0x09
#define L2CAP_INFO_REQ 0x0a
#define L2CAP_INFO_RSP 0x0b
#define L2CAP_CONN_PARAM_UPDATE_REQ 0x12
#define L2CAP_CONN_PARAM_UPDATE_RSP 0x13
#define L2CAP_LE_CONN_REQ 0x14
#define L2CAP_LE_CONN_RSP 0x15
#define L2CAP_LE_CREDITS 0x16
#define L2CAP_ECRED_CONN_REQ 0x17
#define L2CAP_ECRED_CONN_RSP 0x18
#define L2CAP_ECRED_RECONF_REQ 0x19
#define L2CAP_ECRED_RECONF_RSP 0x1a
/* L2CAP extended feature mask */
#define L2CAP_FEAT_FLOWCTL 0x00000001
#define L2CAP_FEAT_RETRANS 0x00000002
#define L2CAP_FEAT_BIDIR_QOS 0x00000004
#define L2CAP_FEAT_ERTM 0x00000008
#define L2CAP_FEAT_STREAMING 0x00000010
#define L2CAP_FEAT_FCS 0x00000020
#define L2CAP_FEAT_EXT_FLOW 0x00000040
#define L2CAP_FEAT_FIXED_CHAN 0x00000080
#define L2CAP_FEAT_EXT_WINDOW 0x00000100
#define L2CAP_FEAT_UCD 0x00000200
/* L2CAP checksum option */
#define L2CAP_FCS_NONE 0x00
#define L2CAP_FCS_CRC16 0x01
/* L2CAP fixed channels */
#define L2CAP_FC_SIG_BREDR 0x02
#define L2CAP_FC_CONNLESS 0x04
#define L2CAP_FC_ATT 0x10
#define L2CAP_FC_SIG_LE 0x20
#define L2CAP_FC_SMP_LE 0x40
#define L2CAP_FC_SMP_BREDR 0x80
/* L2CAP Control Field bit masks */
#define L2CAP_CTRL_SAR 0xC000
#define L2CAP_CTRL_REQSEQ 0x3F00
#define L2CAP_CTRL_TXSEQ 0x007E
#define L2CAP_CTRL_SUPERVISE 0x000C
#define L2CAP_CTRL_RETRANS 0x0080
#define L2CAP_CTRL_FINAL 0x0080
#define L2CAP_CTRL_POLL 0x0010
Annotation
- Immediate include surface: `linux/unaligned.h`, `linux/atomic.h`.
- Detected declarations: `struct sockaddr_l2`, `struct l2cap_options`, `struct l2cap_conninfo`, `struct l2cap_hdr`, `struct l2cap_cmd_hdr`, `struct l2cap_cmd_rej_unk`, `struct l2cap_cmd_rej_mtu`, `struct l2cap_cmd_rej_cid`, `struct l2cap_conn_req`, `struct l2cap_conn_rsp`.
- Atlas domain: Networking Core / Sockets, Protocols, Packet Path, And Network Policy.
- Implementation status: source implementation candidate.
- 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.