1 /* SPDX-License-Identifier: GPL-2.0-or-later */
3 * iSCSI Transport BSG Interface
5 * Copyright (C) 2009 James Smart, Emulex Corporation
8 #ifndef SCSI_BSG_ISCSI_H
9 #define SCSI_BSG_ISCSI_H
12 * This file intended to be included by both kernel and user space
15 #include <scsi/scsi.h>
18 * iSCSI Transport SGIO v4 BSG Message Support
21 /* Default BSG request timeout (in seconds) */
22 #define ISCSI_DEFAULT_BSG_TIMEOUT (10 * HZ)
26 * Request Message Codes supported by the iSCSI Transport
29 /* define the class masks for the message codes */
30 #define ISCSI_BSG_CLS_MASK 0xF0000000 /* find object class */
31 #define ISCSI_BSG_HST_MASK 0x80000000 /* iscsi host class */
33 /* iscsi host Message Codes */
34 #define ISCSI_BSG_HST_VENDOR (ISCSI_BSG_HST_MASK | 0x000000FF)
41 /* ISCSI_BSG_HST_VENDOR : */
44 * Note: When specifying vendor_id, be sure to read the Vendor Type and ID
45 * formatting requirements specified in scsi_netlink.h
47 struct iscsi_bsg_host_vendor {
49 * Identifies the vendor that the message is formatted for. This
50 * should be the recipient of the message.
54 /* start of vendor command area */
55 uint32_t vendor_cmd[];
60 struct iscsi_bsg_host_vendor_reply {
61 /* start of vendor response area */
62 uint32_t vendor_rsp[0];
66 /* request (CDB) structure of the sg_io_v4 */
67 struct iscsi_bsg_request {
70 struct iscsi_bsg_host_vendor h_vendor;
72 } __attribute__((packed));
75 /* response (request sense data) structure of the sg_io_v4 */
76 struct iscsi_bsg_reply {
78 * The completion result. Result exists in two forms:
79 * if negative, it is an -Exxx system errno value. There will
80 * be no further reply information supplied.
81 * else, it's the 4-byte scsi error result, with driver, host,
82 * msg and status fields. The per-msgcode reply structure
83 * will contain valid data.
87 /* If there was reply_payload, how much was received ? */
88 uint32_t reply_payload_rcv_len;
91 struct iscsi_bsg_host_vendor_reply vendor_reply;
96 #endif /* SCSI_BSG_ISCSI_H */