block/opal_proto.h
Source file repositories/reference/linux-study-clean/block/opal_proto.h
File Facts
- System
- Linux kernel
- Corpus path
block/opal_proto.h- Extension
.h- Size
- 10505 bytes
- Lines
- 510
- Domain
- Representative Device Path
- Bucket
- PCIe NVMe Storage Path
- Inferred role
- Representative Device Path: implementation source
- Status
- source implementation candidate
Why This File Exists
Part of the selected hardware vertical slice: PCI discovery, driver binding, NVMe queues, block requests, DMA, interrupts, and completion.
- Part of the selected hardware vertical slice: PCI discovery, driver binding, NVMe queues, block requests, DMA, interrupts, and completion.
- Touches IRQ or DMA behavior; this matters for the representative real-device path.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/types.h
Detected Declarations
struct opal_compacketstruct opal_packetstruct opal_data_subpacketstruct opal_headerstruct opal_stack_resetstruct opal_stack_reset_responsestruct d0_headerstruct d0_tper_featuresstruct d0_locking_featuresstruct d0_geometry_featuresstruct d0_enterprise_sscstruct d0_opal_v100struct d0_single_user_modestruct d0_datastore_tablestruct d0_opal_v200struct d0_featuresenum opal_response_tokenenum opal_uidenum opal_methodenum opal_tokenenum opal_lockingstateenum opal_parameterenum opal_revertlsp
Annotated Snippet
struct opal_compacket {
__be32 reserved0;
u8 extendedComID[4];
__be32 outstandingData;
__be32 minTransfer;
__be32 length;
};
/* Packet structure. */
struct opal_packet {
__be32 tsn;
__be32 hsn;
__be32 seq_number;
__be16 reserved0;
__be16 ack_type;
__be32 acknowledgment;
__be32 length;
};
/* Data sub packet header */
struct opal_data_subpacket {
u8 reserved0[6];
__be16 kind;
__be32 length;
};
/* header of a response */
struct opal_header {
struct opal_compacket cp;
struct opal_packet pkt;
struct opal_data_subpacket subpkt;
};
/*
* TCG_Storage_Architecture_Core_Spec_v2.01_r1.00
* Section: 3.3.4.7.5 STACK_RESET
*/
#define OPAL_STACK_RESET 0x0002
struct opal_stack_reset {
u8 extendedComID[4];
__be32 request_code;
};
struct opal_stack_reset_response {
u8 extendedComID[4];
__be32 request_code;
u8 reserved0[2];
__be16 data_length;
__be32 response;
};
#define FC_TPER 0x0001
#define FC_LOCKING 0x0002
#define FC_GEOMETRY 0x0003
#define FC_ENTERPRISE 0x0100
#define FC_DATASTORE 0x0202
#define FC_SINGLEUSER 0x0201
#define FC_OPALV100 0x0200
#define FC_OPALV200 0x0203
/*
* The Discovery 0 Header. As defined in
* Opal SSC Documentation
* Section: 3.3.5 Capability Discovery
*/
struct d0_header {
__be32 length; /* the length of the header 48 in 2.00.100 */
__be32 revision; /**< revision of the header 1 in 2.00.100 */
__be32 reserved01;
__be32 reserved02;
/*
* the remainder of the structure is vendor specific and will not be
* addressed now
*/
u8 ignored[32];
};
/*
* TPer Feature Descriptor. Contains flags indicating support for the
* TPer features described in the OPAL specification. The names match the
* OPAL terminology
*
* code == 0x001 in 2.00.100
*/
struct d0_tper_features {
/*
* supported_features bits:
* bit 7: reserved
* bit 6: com ID management
Annotation
- Immediate include surface: `linux/types.h`.
- Detected declarations: `struct opal_compacket`, `struct opal_packet`, `struct opal_data_subpacket`, `struct opal_header`, `struct opal_stack_reset`, `struct opal_stack_reset_response`, `struct d0_header`, `struct d0_tper_features`, `struct d0_locking_features`, `struct d0_geometry_features`.
- Atlas domain: Representative Device Path / PCIe NVMe Storage Path.
- Implementation status: source implementation candidate.
- IRQ or DMA behavior appears here, which is relevant to the selected PCIe/NVMe device path.
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.