Edit File by line
/home/barbar84/www/wp-conte.../plugins/sujqvwi/AnonR/anonr.TX.../usr/include/scsi
File: scsi_bsg_fc.h
/* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */
[0] Fix | Delete
/*
[1] Fix | Delete
* FC Transport BSG Interface
[2] Fix | Delete
*
[3] Fix | Delete
* Copyright (C) 2008 James Smart, Emulex Corporation
[4] Fix | Delete
*
[5] Fix | Delete
* This program is free software; you can redistribute it and/or modify
[6] Fix | Delete
* it under the terms of the GNU General Public License as published by
[7] Fix | Delete
* the Free Software Foundation; either version 2 of the License, or
[8] Fix | Delete
* (at your option) any later version.
[9] Fix | Delete
*
[10] Fix | Delete
* This program is distributed in the hope that it will be useful,
[11] Fix | Delete
* but WITHOUT ANY WARRANTY; without even the implied warranty of
[12] Fix | Delete
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
[13] Fix | Delete
* GNU General Public License for more details.
[14] Fix | Delete
*
[15] Fix | Delete
* You should have received a copy of the GNU General Public License
[16] Fix | Delete
* along with this program; if not, write to the Free Software
[17] Fix | Delete
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
[18] Fix | Delete
*
[19] Fix | Delete
*/
[20] Fix | Delete
[21] Fix | Delete
#ifndef SCSI_BSG_FC_H
[22] Fix | Delete
#define SCSI_BSG_FC_H
[23] Fix | Delete
[24] Fix | Delete
/*
[25] Fix | Delete
* This file intended to be included by both kernel and user space
[26] Fix | Delete
*/
[27] Fix | Delete
[28] Fix | Delete
/*
[29] Fix | Delete
* FC Transport SGIO v4 BSG Message Support
[30] Fix | Delete
*/
[31] Fix | Delete
[32] Fix | Delete
/* Default BSG request timeout (in seconds) */
[33] Fix | Delete
#define FC_DEFAULT_BSG_TIMEOUT (10 * HZ)
[34] Fix | Delete
[35] Fix | Delete
[36] Fix | Delete
/*
[37] Fix | Delete
* Request Message Codes supported by the FC Transport
[38] Fix | Delete
*/
[39] Fix | Delete
[40] Fix | Delete
/* define the class masks for the message codes */
[41] Fix | Delete
#define FC_BSG_CLS_MASK 0xF0000000 /* find object class */
[42] Fix | Delete
#define FC_BSG_HST_MASK 0x80000000 /* fc host class */
[43] Fix | Delete
#define FC_BSG_RPT_MASK 0x40000000 /* fc rport class */
[44] Fix | Delete
[45] Fix | Delete
/* fc_host Message Codes */
[46] Fix | Delete
#define FC_BSG_HST_ADD_RPORT (FC_BSG_HST_MASK | 0x00000001)
[47] Fix | Delete
#define FC_BSG_HST_DEL_RPORT (FC_BSG_HST_MASK | 0x00000002)
[48] Fix | Delete
#define FC_BSG_HST_ELS_NOLOGIN (FC_BSG_HST_MASK | 0x00000003)
[49] Fix | Delete
#define FC_BSG_HST_CT (FC_BSG_HST_MASK | 0x00000004)
[50] Fix | Delete
#define FC_BSG_HST_VENDOR (FC_BSG_HST_MASK | 0x000000FF)
[51] Fix | Delete
[52] Fix | Delete
/* fc_rport Message Codes */
[53] Fix | Delete
#define FC_BSG_RPT_ELS (FC_BSG_RPT_MASK | 0x00000001)
[54] Fix | Delete
#define FC_BSG_RPT_CT (FC_BSG_RPT_MASK | 0x00000002)
[55] Fix | Delete
[56] Fix | Delete
[57] Fix | Delete
[58] Fix | Delete
/*
[59] Fix | Delete
* FC Address Identifiers in Message Structures :
[60] Fix | Delete
*
[61] Fix | Delete
* Whenever a command payload contains a FC Address Identifier
[62] Fix | Delete
* (aka port_id), the value is effectively in big-endian
[63] Fix | Delete
* order, thus the array elements are decoded as follows:
[64] Fix | Delete
* element [0] is bits 23:16 of the FC Address Identifier
[65] Fix | Delete
* element [1] is bits 15:8 of the FC Address Identifier
[66] Fix | Delete
* element [2] is bits 7:0 of the FC Address Identifier
[67] Fix | Delete
*/
[68] Fix | Delete
[69] Fix | Delete
[70] Fix | Delete
/*
[71] Fix | Delete
* FC Host Messages
[72] Fix | Delete
*/
[73] Fix | Delete
[74] Fix | Delete
/* FC_BSG_HST_ADDR_PORT : */
[75] Fix | Delete
[76] Fix | Delete
/* Request:
[77] Fix | Delete
* This message requests the FC host to login to the remote port
[78] Fix | Delete
* at the specified N_Port_Id. The remote port is to be enumerated
[79] Fix | Delete
* with the transport upon completion of the login.
[80] Fix | Delete
*/
[81] Fix | Delete
struct fc_bsg_host_add_rport {
[82] Fix | Delete
uint8_t reserved;
[83] Fix | Delete
[84] Fix | Delete
/* FC Address Identier of the remote port to login to */
[85] Fix | Delete
uint8_t port_id[3];
[86] Fix | Delete
};
[87] Fix | Delete
[88] Fix | Delete
/* Response:
[89] Fix | Delete
* There is no additional response data - fc_bsg_reply->result is sufficient
[90] Fix | Delete
*/
[91] Fix | Delete
[92] Fix | Delete
[93] Fix | Delete
/* FC_BSG_HST_DEL_RPORT : */
[94] Fix | Delete
[95] Fix | Delete
/* Request:
[96] Fix | Delete
* This message requests the FC host to remove an enumerated
[97] Fix | Delete
* remote port and to terminate the login to it.
[98] Fix | Delete
*
[99] Fix | Delete
* Note: The driver is free to reject this request if it desires to
[100] Fix | Delete
* remain logged in with the remote port.
[101] Fix | Delete
*/
[102] Fix | Delete
struct fc_bsg_host_del_rport {
[103] Fix | Delete
uint8_t reserved;
[104] Fix | Delete
[105] Fix | Delete
/* FC Address Identier of the remote port to logout of */
[106] Fix | Delete
uint8_t port_id[3];
[107] Fix | Delete
};
[108] Fix | Delete
[109] Fix | Delete
/* Response:
[110] Fix | Delete
* There is no additional response data - fc_bsg_reply->result is sufficient
[111] Fix | Delete
*/
[112] Fix | Delete
[113] Fix | Delete
[114] Fix | Delete
/* FC_BSG_HST_ELS_NOLOGIN : */
[115] Fix | Delete
[116] Fix | Delete
/* Request:
[117] Fix | Delete
* This message requests the FC_Host to send an ELS to a specific
[118] Fix | Delete
* N_Port_ID. The host does not need to log into the remote port,
[119] Fix | Delete
* nor does it need to enumerate the rport for further traffic
[120] Fix | Delete
* (although, the FC host is free to do so if it desires).
[121] Fix | Delete
*/
[122] Fix | Delete
struct fc_bsg_host_els {
[123] Fix | Delete
/*
[124] Fix | Delete
* ELS Command Code being sent (must be the same as byte 0
[125] Fix | Delete
* of the payload)
[126] Fix | Delete
*/
[127] Fix | Delete
uint8_t command_code;
[128] Fix | Delete
[129] Fix | Delete
/* FC Address Identier of the remote port to send the ELS to */
[130] Fix | Delete
uint8_t port_id[3];
[131] Fix | Delete
};
[132] Fix | Delete
[133] Fix | Delete
/* Response:
[134] Fix | Delete
*/
[135] Fix | Delete
/* fc_bsg_ctels_reply->status values */
[136] Fix | Delete
#define FC_CTELS_STATUS_OK 0x00000000
[137] Fix | Delete
#define FC_CTELS_STATUS_REJECT 0x00000001
[138] Fix | Delete
#define FC_CTELS_STATUS_P_RJT 0x00000002
[139] Fix | Delete
#define FC_CTELS_STATUS_F_RJT 0x00000003
[140] Fix | Delete
#define FC_CTELS_STATUS_P_BSY 0x00000004
[141] Fix | Delete
#define FC_CTELS_STATUS_F_BSY 0x00000006
[142] Fix | Delete
struct fc_bsg_ctels_reply {
[143] Fix | Delete
/*
[144] Fix | Delete
* Note: An ELS LS_RJT may be reported in 2 ways:
[145] Fix | Delete
* a) A status of FC_CTELS_STATUS_OK is returned. The caller
[146] Fix | Delete
* is to look into the ELS receive payload to determine
[147] Fix | Delete
* LS_ACC or LS_RJT (by contents of word 0). The reject
[148] Fix | Delete
* data will be in word 1.
[149] Fix | Delete
* b) A status of FC_CTELS_STATUS_REJECT is returned, The
[150] Fix | Delete
* rjt_data field will contain valid data.
[151] Fix | Delete
*
[152] Fix | Delete
* Note: ELS LS_ACC is determined by an FC_CTELS_STATUS_OK, and
[153] Fix | Delete
* the receive payload word 0 indicates LS_ACC
[154] Fix | Delete
* (e.g. value is 0x02xxxxxx).
[155] Fix | Delete
*
[156] Fix | Delete
* Note: Similarly, a CT Reject may be reported in 2 ways:
[157] Fix | Delete
* a) A status of FC_CTELS_STATUS_OK is returned. The caller
[158] Fix | Delete
* is to look into the CT receive payload to determine
[159] Fix | Delete
* Accept or Reject (by contents of word 2). The reject
[160] Fix | Delete
* data will be in word 3.
[161] Fix | Delete
* b) A status of FC_CTELS_STATUS_REJECT is returned, The
[162] Fix | Delete
* rjt_data field will contain valid data.
[163] Fix | Delete
*
[164] Fix | Delete
* Note: x_RJT/BSY status will indicae that the rjt_data field
[165] Fix | Delete
* is valid and contains the reason/explanation values.
[166] Fix | Delete
*/
[167] Fix | Delete
uint32_t status; /* See FC_CTELS_STATUS_xxx */
[168] Fix | Delete
[169] Fix | Delete
/* valid if status is not FC_CTELS_STATUS_OK */
[170] Fix | Delete
struct {
[171] Fix | Delete
uint8_t action; /* fragment_id for CT REJECT */
[172] Fix | Delete
uint8_t reason_code;
[173] Fix | Delete
uint8_t reason_explanation;
[174] Fix | Delete
uint8_t vendor_unique;
[175] Fix | Delete
} rjt_data;
[176] Fix | Delete
};
[177] Fix | Delete
[178] Fix | Delete
[179] Fix | Delete
/* FC_BSG_HST_CT : */
[180] Fix | Delete
[181] Fix | Delete
/* Request:
[182] Fix | Delete
* This message requests that a CT Request be performed with the
[183] Fix | Delete
* indicated N_Port_ID. The driver is responsible for logging in with
[184] Fix | Delete
* the fabric and/or N_Port_ID, etc as per FC rules. This request does
[185] Fix | Delete
* not mandate that the driver must enumerate the destination in the
[186] Fix | Delete
* transport. The driver is allowed to decide whether to enumerate it,
[187] Fix | Delete
* and whether to tear it down after the request.
[188] Fix | Delete
*/
[189] Fix | Delete
struct fc_bsg_host_ct {
[190] Fix | Delete
uint8_t reserved;
[191] Fix | Delete
[192] Fix | Delete
/* FC Address Identier of the remote port to send the ELS to */
[193] Fix | Delete
uint8_t port_id[3];
[194] Fix | Delete
[195] Fix | Delete
/*
[196] Fix | Delete
* We need words 0-2 of the generic preamble for the LLD's
[197] Fix | Delete
*/
[198] Fix | Delete
uint32_t preamble_word0; /* revision & IN_ID */
[199] Fix | Delete
uint32_t preamble_word1; /* GS_Type, GS_SubType, Options, Rsvd */
[200] Fix | Delete
uint32_t preamble_word2; /* Cmd Code, Max Size */
[201] Fix | Delete
[202] Fix | Delete
};
[203] Fix | Delete
/* Response:
[204] Fix | Delete
*
[205] Fix | Delete
* The reply structure is an fc_bsg_ctels_reply structure
[206] Fix | Delete
*/
[207] Fix | Delete
[208] Fix | Delete
[209] Fix | Delete
/* FC_BSG_HST_VENDOR : */
[210] Fix | Delete
[211] Fix | Delete
/* Request:
[212] Fix | Delete
* Note: When specifying vendor_id, be sure to read the Vendor Type and ID
[213] Fix | Delete
* formatting requirements specified in scsi_netlink.h
[214] Fix | Delete
*/
[215] Fix | Delete
struct fc_bsg_host_vendor {
[216] Fix | Delete
/*
[217] Fix | Delete
* Identifies the vendor that the message is formatted for. This
[218] Fix | Delete
* should be the recipient of the message.
[219] Fix | Delete
*/
[220] Fix | Delete
uint64_t vendor_id;
[221] Fix | Delete
[222] Fix | Delete
/* start of vendor command area */
[223] Fix | Delete
uint32_t vendor_cmd[0];
[224] Fix | Delete
};
[225] Fix | Delete
[226] Fix | Delete
/* Response:
[227] Fix | Delete
*/
[228] Fix | Delete
struct fc_bsg_host_vendor_reply {
[229] Fix | Delete
/* start of vendor response area */
[230] Fix | Delete
uint32_t vendor_rsp[0];
[231] Fix | Delete
};
[232] Fix | Delete
[233] Fix | Delete
[234] Fix | Delete
[235] Fix | Delete
/*
[236] Fix | Delete
* FC Remote Port Messages
[237] Fix | Delete
*/
[238] Fix | Delete
[239] Fix | Delete
/* FC_BSG_RPT_ELS : */
[240] Fix | Delete
[241] Fix | Delete
/* Request:
[242] Fix | Delete
* This message requests that an ELS be performed with the rport.
[243] Fix | Delete
*/
[244] Fix | Delete
struct fc_bsg_rport_els {
[245] Fix | Delete
/*
[246] Fix | Delete
* ELS Command Code being sent (must be the same as
[247] Fix | Delete
* byte 0 of the payload)
[248] Fix | Delete
*/
[249] Fix | Delete
uint8_t els_code;
[250] Fix | Delete
};
[251] Fix | Delete
[252] Fix | Delete
/* Response:
[253] Fix | Delete
*
[254] Fix | Delete
* The reply structure is an fc_bsg_ctels_reply structure
[255] Fix | Delete
*/
[256] Fix | Delete
[257] Fix | Delete
[258] Fix | Delete
/* FC_BSG_RPT_CT : */
[259] Fix | Delete
[260] Fix | Delete
/* Request:
[261] Fix | Delete
* This message requests that a CT Request be performed with the rport.
[262] Fix | Delete
*/
[263] Fix | Delete
struct fc_bsg_rport_ct {
[264] Fix | Delete
/*
[265] Fix | Delete
* We need words 0-2 of the generic preamble for the LLD's
[266] Fix | Delete
*/
[267] Fix | Delete
uint32_t preamble_word0; /* revision & IN_ID */
[268] Fix | Delete
uint32_t preamble_word1; /* GS_Type, GS_SubType, Options, Rsvd */
[269] Fix | Delete
uint32_t preamble_word2; /* Cmd Code, Max Size */
[270] Fix | Delete
};
[271] Fix | Delete
/* Response:
[272] Fix | Delete
*
[273] Fix | Delete
* The reply structure is an fc_bsg_ctels_reply structure
[274] Fix | Delete
*/
[275] Fix | Delete
[276] Fix | Delete
[277] Fix | Delete
[278] Fix | Delete
[279] Fix | Delete
/* request (CDB) structure of the sg_io_v4 */
[280] Fix | Delete
struct fc_bsg_request {
[281] Fix | Delete
uint32_t msgcode;
[282] Fix | Delete
union {
[283] Fix | Delete
struct fc_bsg_host_add_rport h_addrport;
[284] Fix | Delete
struct fc_bsg_host_del_rport h_delrport;
[285] Fix | Delete
struct fc_bsg_host_els h_els;
[286] Fix | Delete
struct fc_bsg_host_ct h_ct;
[287] Fix | Delete
struct fc_bsg_host_vendor h_vendor;
[288] Fix | Delete
[289] Fix | Delete
struct fc_bsg_rport_els r_els;
[290] Fix | Delete
struct fc_bsg_rport_ct r_ct;
[291] Fix | Delete
} rqst_data;
[292] Fix | Delete
} __attribute__((packed));
[293] Fix | Delete
[294] Fix | Delete
[295] Fix | Delete
/* response (request sense data) structure of the sg_io_v4 */
[296] Fix | Delete
struct fc_bsg_reply {
[297] Fix | Delete
/*
[298] Fix | Delete
* The completion result. Result exists in two forms:
[299] Fix | Delete
* if negative, it is an -Exxx system errno value. There will
[300] Fix | Delete
* be no further reply information supplied.
[301] Fix | Delete
* else, it's the 4-byte scsi error result, with driver, host,
[302] Fix | Delete
* msg and status fields. The per-msgcode reply structure
[303] Fix | Delete
* will contain valid data.
[304] Fix | Delete
*/
[305] Fix | Delete
uint32_t result;
[306] Fix | Delete
[307] Fix | Delete
/* If there was reply_payload, how much was recevied ? */
[308] Fix | Delete
uint32_t reply_payload_rcv_len;
[309] Fix | Delete
[310] Fix | Delete
union {
[311] Fix | Delete
struct fc_bsg_host_vendor_reply vendor_reply;
[312] Fix | Delete
[313] Fix | Delete
struct fc_bsg_ctels_reply ctels_reply;
[314] Fix | Delete
} reply_data;
[315] Fix | Delete
};
[316] Fix | Delete
[317] Fix | Delete
[318] Fix | Delete
#endif /* SCSI_BSG_FC_H */
[319] Fix | Delete
[320] Fix | Delete
[321] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function