/* SPDX-License-Identifier: GPL-2.0-or-later */1/*2* iSCSI Transport BSG Interface3*4* Copyright (C) 2009 James Smart, Emulex Corporation5*/67#ifndef SCSI_BSG_ISCSI_H8#define SCSI_BSG_ISCSI_H910/*11* This file intended to be included by both kernel and user space12*/1314#include <scsi/scsi.h>1516/*17* iSCSI Transport SGIO v4 BSG Message Support18*/1920/* Default BSG request timeout (in seconds) */21#define ISCSI_DEFAULT_BSG_TIMEOUT (10 * HZ)222324/*25* Request Message Codes supported by the iSCSI Transport26*/2728/* define the class masks for the message codes */29#define ISCSI_BSG_CLS_MASK 0xF0000000 /* find object class */30#define ISCSI_BSG_HST_MASK 0x80000000 /* iscsi host class */3132/* iscsi host Message Codes */33#define ISCSI_BSG_HST_VENDOR (ISCSI_BSG_HST_MASK | 0x000000FF)343536/*37* iSCSI Host Messages38*/3940/* ISCSI_BSG_HST_VENDOR : */4142/* Request:43* Note: When specifying vendor_id, be sure to read the Vendor Type and ID44* formatting requirements specified in scsi_netlink.h45*/46struct iscsi_bsg_host_vendor {47/*48* Identifies the vendor that the message is formatted for. This49* should be the recipient of the message.50*/51uint64_t vendor_id;5253/* start of vendor command area */54uint32_t vendor_cmd[];55};5657/* Response:58*/59struct iscsi_bsg_host_vendor_reply {60/* start of vendor response area */61DECLARE_FLEX_ARRAY(uint32_t, vendor_rsp);62};636465/* request (CDB) structure of the sg_io_v4 */66struct iscsi_bsg_request {67uint32_t msgcode;68union {69struct iscsi_bsg_host_vendor h_vendor;70} rqst_data;71} __attribute__((packed));727374/* response (request sense data) structure of the sg_io_v4 */75struct iscsi_bsg_reply {76/*77* The completion result. Result exists in two forms:78* if negative, it is an -Exxx system errno value. There will79* be no further reply information supplied.80* else, it's the 4-byte scsi error result, with driver, host,81* msg and status fields. The per-msgcode reply structure82* will contain valid data.83*/84uint32_t result;8586/* If there was reply_payload, how much was received ? */87uint32_t reply_payload_rcv_len;8889union {90struct iscsi_bsg_host_vendor_reply vendor_reply;91} reply_data;92};939495#endif /* SCSI_BSG_ISCSI_H */969798