~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/include/uapi/scsi/scsi_bsg_ufs.h

Version: ~ [ linux-5.1-rc5 ] ~ [ linux-5.0.7 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.34 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.111 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.168 ] ~ [ linux-4.8.17 ] ~ [ linux-4.7.10 ] ~ [ linux-4.6.7 ] ~ [ linux-4.5.7 ] ~ [ linux-4.4.178 ] ~ [ linux-4.3.6 ] ~ [ linux-4.2.8 ] ~ [ linux-4.1.52 ] ~ [ linux-4.0.9 ] ~ [ linux-3.19.8 ] ~ [ linux-3.18.138 ] ~ [ linux-3.17.8 ] ~ [ linux-3.16.65 ] ~ [ linux-3.15.10 ] ~ [ linux-3.14.79 ] ~ [ linux-3.13.11 ] ~ [ linux-3.12.74 ] ~ [ linux-3.11.10 ] ~ [ linux-3.10.108 ] ~ [ linux-3.9.11 ] ~ [ linux-3.8.13 ] ~ [ linux-3.7.10 ] ~ [ linux-3.6.11 ] ~ [ linux-3.5.7 ] ~ [ linux-3.4.113 ] ~ [ linux-3.3.8 ] ~ [ linux-3.2.102 ] ~ [ linux-3.1.10 ] ~ [ linux-3.0.101 ] ~ [ linux-2.6.39.4 ] ~ [ linux-2.6.38.8 ] ~ [ linux-2.6.37.6 ] ~ [ linux-2.6.36.4 ] ~ [ linux-2.6.35.14 ] ~ [ linux-2.6.34.15 ] ~ [ linux-2.6.33.20 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.5 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /* SPDX-License-Identifier: GPL-2.0 */
  2 /*
  3  * UFS Transport SGIO v4 BSG Message Support
  4  *
  5  * Copyright (C) 2011-2013 Samsung India Software Operations
  6  * Copyright (C) 2018 Western Digital Corporation
  7  */
  8 #ifndef SCSI_BSG_UFS_H
  9 #define SCSI_BSG_UFS_H
 10 
 11 #include <linux/types.h>
 12 /*
 13  * This file intended to be included by both kernel and user space
 14  */
 15 
 16 #define UFS_CDB_SIZE    16
 17 #define UPIU_TRANSACTION_UIC_CMD 0x1F
 18 /* uic commands are 4DW long, per UFSHCI V2.1 paragraph 5.6.1 */
 19 #define UIC_CMD_SIZE (sizeof(__u32) * 4)
 20 
 21 /**
 22  * struct utp_upiu_header - UPIU header structure
 23  * @dword_0: UPIU header DW-0
 24  * @dword_1: UPIU header DW-1
 25  * @dword_2: UPIU header DW-2
 26  */
 27 struct utp_upiu_header {
 28         __be32 dword_0;
 29         __be32 dword_1;
 30         __be32 dword_2;
 31 };
 32 
 33 /**
 34  * struct utp_upiu_query - upiu request buffer structure for
 35  * query request.
 36  * @opcode: command to perform B-0
 37  * @idn: a value that indicates the particular type of data B-1
 38  * @index: Index to further identify data B-2
 39  * @selector: Index to further identify data B-3
 40  * @reserved_osf: spec reserved field B-4,5
 41  * @length: number of descriptor bytes to read/write B-6,7
 42  * @value: Attribute value to be written DW-5
 43  * @reserved: spec reserved DW-6,7
 44  */
 45 struct utp_upiu_query {
 46         __u8 opcode;
 47         __u8 idn;
 48         __u8 index;
 49         __u8 selector;
 50         __be16 reserved_osf;
 51         __be16 length;
 52         __be32 value;
 53         __be32 reserved[2];
 54 };
 55 
 56 /**
 57  * struct utp_upiu_cmd - Command UPIU structure
 58  * @data_transfer_len: Data Transfer Length DW-3
 59  * @cdb: Command Descriptor Block CDB DW-4 to DW-7
 60  */
 61 struct utp_upiu_cmd {
 62         __be32 exp_data_transfer_len;
 63         __u8 cdb[UFS_CDB_SIZE];
 64 };
 65 
 66 /**
 67  * struct utp_upiu_req - general upiu request structure
 68  * @header:UPIU header structure DW-0 to DW-2
 69  * @sc: fields structure for scsi command DW-3 to DW-7
 70  * @qr: fields structure for query request DW-3 to DW-7
 71  */
 72 struct utp_upiu_req {
 73         struct utp_upiu_header header;
 74         union {
 75                 struct utp_upiu_cmd             sc;
 76                 struct utp_upiu_query           qr;
 77                 struct utp_upiu_query           tr;
 78                 /* use utp_upiu_query to host the 4 dwords of uic command */
 79                 struct utp_upiu_query           uc;
 80         };
 81 };
 82 
 83 /* request (CDB) structure of the sg_io_v4 */
 84 struct ufs_bsg_request {
 85         __u32 msgcode;
 86         struct utp_upiu_req upiu_req;
 87 };
 88 
 89 /* response (request sense data) structure of the sg_io_v4 */
 90 struct ufs_bsg_reply {
 91         /*
 92          * The completion result. Result exists in two forms:
 93          * if negative, it is an -Exxx system errno value. There will
 94          * be no further reply information supplied.
 95          * else, it's the 4-byte scsi error result, with driver, host,
 96          * msg and status fields. The per-msgcode reply structure
 97          * will contain valid data.
 98          */
 99         __u32 result;
100 
101         /* If there was reply_payload, how much was received? */
102         __u32 reply_payload_rcv_len;
103 
104         struct utp_upiu_req upiu_rsp;
105 };
106 #endif /* UFS_BSG_H */
107 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | Wiki (Japanese) | Wiki (English) | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

osdn.jp