STRUCT UTP_UPIU_HEADER(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

okay bestie, you're on the struct utp_upiu_header(9) page from the Kernel API Manual πŸ’– this is the UPIU header structure, and we're gonna keep every single member, flag, and literal exactly as it is. No skips, no cap 🫢

✨ NAME ✨

struct utp_upiu_header β€” UPIU header structure. Short, sweet, iconic ✨

🌸 SYNOPSIS 🌸

Here's the struct, copied exactly β€” braces, semicolons, endianness branches, all of it πŸ’…

       struct utp_upiu_header {
           union {
             struct {
               __be32 dword_0;
               __be32 dword_1;
               __be32 dword_2;
             };
             struct {
               __u8 transaction_code;
               __u8 flags;
               __u8 lun;
               __u8 task_tag;
         #if defined(__BIG_ENDIAN);
               __u8 iid: 4;
               __u8 command_set_type: 4;
         #elif defined(__LITTLE_ENDIAN);
               __u8 command_set_type: 4;
               __u8 iid: 4;
         #else;
         #error;
         #endif;
               union {
                 __u8 tm_function;
                 __u8 query_function;
               };
               __u8 response;
               __u8 status;
               __u8 ehs_length;
               __u8 device_information;
               __be16 data_segment_length;
             };
           };
        };

🧚 Members 🧚

Okay, member-by-member, in source order. The source repeats command_set_type and iid, so they appear twice below too β€” not a typo, that's just the tea πŸ’€

  • {unnamed_union} β€” anonymous
  • {unnamed_struct} β€” anonymous
  • dword_0 β€” UPIU header DW-0
  • dword_1 β€” UPIU header DW-1
  • dword_2 β€” UPIU header DW-2
  • {unnamed_struct} β€” anonymous
  • transaction_code β€” Type of request or response. See also enum upiu_request_transaction and enum upiu_response_transaction.
  • flags β€” UPIU flags. The meaning of individual flags depends on the transaction code.
  • lun β€” Logical unit number.
  • task_tag β€” Task tag.
  • iid β€” Initiator ID.
  • command_set_type β€” 0 for SCSI command set; 1 for UFS specific.
  • command_set_type β€” 0 for SCSI command set; 1 for UFS specific.
  • iid β€” Initiator ID.
  • {unnamed_union} β€” anonymous
  • tm_function β€” Task management function in case of a task management request UPIU.
  • query_function β€” Query function in case of a query request UPIU.
  • response β€” 0 for success; 1 for failure.
  • status β€” SCSI status if this is the header of a response to a SCSI command.
  • ehs_length β€” EHS length in units of 32 bytes.
  • device_information β€” (no description in the source, so no invented tea πŸ™ˆ)
  • data_segment_length β€” data segment length.

🌈 SEE ALSO 🌈

  • Kernel file ./include/uapi/scsi/scsi_bsg_ufs.h plus struct utp_upiu_query(9), struct utp_upiu_query_v4_0(9), struct utp_upiu_cmd(9), struct utp_upiu_req(9) β€” that's the whole reference crew 🫢

Source/version line points at ./include/uapi/scsi, date says October 2026, and the page is struct utp_upiu_header(9) β€” bye bestie, go be iconic with your structs πŸŽ€πŸ’–

πŸ“¦ where this page comes from