drivers/thunderbolt/tb_msgs.h
Source file repositories/reference/linux-study-clean/drivers/thunderbolt/tb_msgs.h
File Facts
- System
- Linux kernel
- Corpus path
drivers/thunderbolt/tb_msgs.h- Extension
.h- Size
- 12686 bytes
- Lines
- 657
- Domain
- Driver Families
- Bucket
- drivers/thunderbolt
- Inferred role
- Driver Families: implementation source
- Status
- source implementation candidate
Why This File Exists
Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/types.hlinux/uuid.h
Detected Declarations
struct tb_cfg_headerstruct tb_cfg_addressstruct cfg_read_pkgstruct cfg_write_pkgstruct cfg_error_pkgstruct cfg_ack_pkgstruct cfg_event_pkgstruct cfg_reset_pkgstruct icm_pkg_headerstruct icm_pkg_driver_readystruct icm_fr_pkg_driver_ready_responsestruct icm_fr_pkg_get_topologystruct icm_fr_pkg_get_topology_responsestruct icm_fr_event_device_connectedstruct icm_fr_pkg_approve_devicestruct icm_fr_event_device_disconnectedstruct icm_fr_event_xdomain_connectedstruct icm_fr_event_xdomain_disconnectedstruct icm_fr_pkg_add_device_keystruct icm_fr_pkg_add_device_key_responsestruct icm_fr_pkg_challenge_devicestruct icm_fr_pkg_challenge_device_responsestruct icm_fr_pkg_approve_xdomainstruct icm_fr_pkg_approve_xdomain_responsestruct icm_ar_pkg_driver_ready_responsestruct icm_ar_pkg_get_routestruct icm_ar_pkg_get_route_responsestruct icm_ar_boot_acl_entrystruct icm_ar_pkg_preboot_aclstruct icm_ar_pkg_preboot_acl_responsestruct icm_tr_pkg_driver_ready_responsestruct icm_tr_event_device_connectedstruct icm_tr_event_device_disconnectedstruct icm_tr_event_xdomain_connectedstruct icm_tr_event_xdomain_disconnectedstruct icm_tr_pkg_approve_devicestruct icm_tr_pkg_add_device_keystruct icm_tr_pkg_challenge_devicestruct icm_tr_pkg_approve_xdomainstruct icm_tr_pkg_disconnect_xdomainstruct icm_tr_pkg_challenge_device_responsestruct icm_tr_pkg_add_device_key_responsestruct icm_tr_pkg_approve_xdomain_responsestruct icm_tr_pkg_disconnect_xdomain_responsestruct icm_icl_event_rtd3_vetostruct icm_usb4_switch_opstruct icm_usb4_switch_op_responsestruct tb_xdomain_header
Annotated Snippet
struct tb_cfg_header {
u32 route_hi:22;
u32 unknown:10; /* highest order bit is set on replies */
u32 route_lo;
} __packed;
/* additional header for read/write packets */
struct tb_cfg_address {
u32 offset:13; /* in dwords */
u32 length:6; /* in dwords */
u32 port:6;
enum tb_cfg_space space:2;
u32 seq:2; /* sequence number */
u32 zero:3;
} __packed;
/* TB_CFG_PKG_READ, response for TB_CFG_PKG_WRITE */
struct cfg_read_pkg {
struct tb_cfg_header header;
struct tb_cfg_address addr;
} __packed;
/* TB_CFG_PKG_WRITE, response for TB_CFG_PKG_READ */
struct cfg_write_pkg {
struct tb_cfg_header header;
struct tb_cfg_address addr;
u32 data[64]; /* maximum size, tb_cfg_address.length has 6 bits */
} __packed;
/* TB_CFG_PKG_ERROR */
struct cfg_error_pkg {
struct tb_cfg_header header;
enum tb_cfg_error error:8;
u32 port:6;
u32 reserved:16;
u32 pg:2;
} __packed;
struct cfg_ack_pkg {
struct tb_cfg_header header;
};
#define TB_CFG_ERROR_PG_HOT_PLUG 0x2
#define TB_CFG_ERROR_PG_HOT_UNPLUG 0x3
/* TB_CFG_PKG_EVENT */
struct cfg_event_pkg {
struct tb_cfg_header header;
u32 port:6;
u32 zero:25;
bool unplug:1;
} __packed;
/* TB_CFG_PKG_RESET */
struct cfg_reset_pkg {
struct tb_cfg_header header;
} __packed;
/* ICM messages */
enum icm_pkg_code {
ICM_GET_TOPOLOGY = 0x1,
ICM_DRIVER_READY = 0x3,
ICM_APPROVE_DEVICE = 0x4,
ICM_CHALLENGE_DEVICE = 0x5,
ICM_ADD_DEVICE_KEY = 0x6,
ICM_GET_ROUTE = 0xa,
ICM_APPROVE_XDOMAIN = 0x10,
ICM_DISCONNECT_XDOMAIN = 0x11,
ICM_PREBOOT_ACL = 0x18,
ICM_USB4_SWITCH_OP = 0x20,
};
enum icm_event_code {
ICM_EVENT_DEVICE_CONNECTED = 0x3,
ICM_EVENT_DEVICE_DISCONNECTED = 0x4,
ICM_EVENT_XDOMAIN_CONNECTED = 0x6,
ICM_EVENT_XDOMAIN_DISCONNECTED = 0x7,
ICM_EVENT_DP_CONFIG_CHANGED = 0x8,
ICM_EVENT_RTD3_VETO = 0xa,
};
struct icm_pkg_header {
u8 code;
u8 flags;
u8 packet_id;
u8 total_packets;
};
#define ICM_FLAGS_ERROR BIT(0)
Annotation
- Immediate include surface: `linux/types.h`, `linux/uuid.h`.
- Detected declarations: `struct tb_cfg_header`, `struct tb_cfg_address`, `struct cfg_read_pkg`, `struct cfg_write_pkg`, `struct cfg_error_pkg`, `struct cfg_ack_pkg`, `struct cfg_event_pkg`, `struct cfg_reset_pkg`, `struct icm_pkg_header`, `struct icm_pkg_driver_ready`.
- Atlas domain: Driver Families / drivers/thunderbolt.
- Implementation status: source implementation candidate.
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.