include/linux/hid-over-spi.h
Source file repositories/reference/linux-study-clean/include/linux/hid-over-spi.h
File Facts
- System
- Linux kernel
- Corpus path
include/linux/hid-over-spi.h- Extension
.h- Size
- 5023 bytes
- Lines
- 156
- Domain
- Core OS
- Bucket
- Core Kernel Interface
- Inferred role
- Core OS: implementation source
- Status
- source implementation candidate
Why This File Exists
Core operating-system implementation surface: boot, tasks, memory, VFS, syscall-facing interfaces, synchronization, credentials, and isolation.
- Core operating-system implementation surface: boot, tasks, memory, VFS, syscall-facing interfaces, synchronization, credentials, and isolation.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/bits.hlinux/types.h
Detected Declarations
struct input_report_body_headerstruct input_report_bodystruct output_report_headerstruct output_reportstruct hidspi_dev_descriptorenum input_report_typeenum output_report_typeenum hidspi_power_state
Annotated Snippet
struct input_report_body_header {
u8 input_report_type;
__le16 content_len;
u8 content_id;
} __packed;
#define HIDSPI_INPUT_BODY_HEADER_SIZE sizeof(struct input_report_body_header)
/**
* struct input_report_body - Input report body definition in HIDSPI protocol
* @body_hdr: input report body header
* @content: input report body content
*/
struct input_report_body {
struct input_report_body_header body_hdr;
u8 content[];
} __packed;
#define HIDSPI_INPUT_BODY_SIZE(content_len) ((content_len) + HIDSPI_INPUT_BODY_HEADER_SIZE)
/**
* struct output_report_header - Output report header definition in HIDSPI protocol
* @report_type: output report type, reference to enum output_report_type
* @content_len: length of content
* @content_id: 0x00 - descriptors
* report id - Set/Feature feature or Input/Output Reports
* command opcode - for commands
*/
struct output_report_header {
u8 report_type;
__le16 content_len;
u8 content_id;
} __packed;
#define HIDSPI_OUTPUT_REPORT_HEADER_SIZE sizeof(struct output_report_header)
/**
* struct output_report - Output report definition in HIDSPI protocol
* @output_hdr: output report header
* @content: output report content
*/
struct output_report {
struct output_report_header output_hdr;
u8 content[];
} __packed;
#define HIDSPI_OUTPUT_REPORT_SIZE(content_len) ((content_len) + HIDSPI_OUTPUT_REPORT_HEADER_SIZE)
/**
* struct hidspi_dev_descriptor - HIDSPI device descriptor definition
* @dev_desc_len: The length of the complete device descriptor, fixed to 0x18 (24).
* @bcd_ver: The version number of the HIDSPI protocol supported.
* In binary coded decimal (BCD) format. Must be fixed to 0x0300.
* @rep_desc_len: The length of the report descriptor
* @max_input_len: The length of the largest possible HID input (or feature) report
* @max_output_len: The length of the largest output (or feature) report
* @max_frag_len: The length of the largest fragment, where a fragment represents
* the body of an input report.
* @vendor_id: Device manufacturers vendor ID
* @product_id: Device unique model/product ID
* @version_id: Device’s unique version
* @flags: Specify flags for the device’s operation
* @reserved: Reserved and should be 0
*/
struct hidspi_dev_descriptor {
__le16 dev_desc_len;
__le16 bcd_ver;
__le16 rep_desc_len;
__le16 max_input_len;
__le16 max_output_len;
__le16 max_frag_len;
__le16 vendor_id;
__le16 product_id;
__le16 version_id;
__le16 flags;
__le32 reserved;
};
#define HIDSPI_DEVICE_DESCRIPTOR_SIZE sizeof(struct hidspi_dev_descriptor)
#define HIDSPI_INPUT_DEVICE_DESCRIPTOR_SIZE \
(HIDSPI_INPUT_BODY_HEADER_SIZE + HIDSPI_DEVICE_DESCRIPTOR_SIZE)
#endif /* _HID_OVER_SPI_H_ */
Annotation
- Immediate include surface: `linux/bits.h`, `linux/types.h`.
- Detected declarations: `struct input_report_body_header`, `struct input_report_body`, `struct output_report_header`, `struct output_report`, `struct hidspi_dev_descriptor`, `enum input_report_type`, `enum output_report_type`, `enum hidspi_power_state`.
- Atlas domain: Core OS / Core Kernel Interface.
- 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.