Commit 49d3e599 authored by Javed Hasan's avatar Javed Hasan Committed by Martin K. Petersen
Browse files

scsi: fc: FDMI enhancement

Added RHBA and RPA attributes type and length.

As per FC_GC_7 document section "Table 400 – Attribute Entry Types and
associated Values" ASCII type attributes length can be vary from "4 to 256
byte".  If we keep all RHBA ASCII attributes length 256 then total length
is going upto 2750, which is far more than 2048 (max frame size).

In libfc we do have logic to split FCP commands but not for CT commands.
Practically all version/names get covered with in 64 bytes except OS name,
for that we need 128 bytes.  Hence length of all RBHA ASCII attributes
is reduced to 64 bytes and 128 bytes in case of OS name.

RPA attributes total length is within frame size.

Link: https://lore.kernel.org/r/20210603121623.10084-6-jhasan@marvell.com


Reviewed-by: default avatarHimanshu Madhani <himanshu.madhani@oracle.com>
Signed-off-by: default avatarJaved Hasan <jhasan@marvell.com>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent 974db67a
Loading
Loading
Loading
Loading
+48 −7
Original line number Diff line number Diff line
@@ -24,6 +24,12 @@
 */
#define	FC_FDMI_SUBTYPE	    0x10 /* fs_ct_hdr.ct_fs_subtype */

/*
 * Management server FDMI specifications.
 */
#define	FDMI_V1	    1 /* FDMI version 1 specifications */
#define	FDMI_V2	    2 /* FDMI version 2 specifications */

/*
 * Management server FDMI Requests.
 */
@@ -57,6 +63,13 @@ enum fc_fdmi_hba_attr_type {
	FC_FDMI_HBA_ATTR_FIRMWAREVERSION = 0x0009,
	FC_FDMI_HBA_ATTR_OSNAMEVERSION = 0x000A,
	FC_FDMI_HBA_ATTR_MAXCTPAYLOAD = 0x000B,
	FC_FDMI_HBA_ATTR_NODESYMBLNAME = 0x000C,
	FC_FDMI_HBA_ATTR_VENDORSPECIFICINFO = 0x000D,
	FC_FDMI_HBA_ATTR_NUMBEROFPORTS = 0x000E,
	FC_FDMI_HBA_ATTR_FABRICNAME = 0x000F,
	FC_FDMI_HBA_ATTR_BIOSVERSION = 0x0010,
	FC_FDMI_HBA_ATTR_BIOSSTATE = 0x0011,
	FC_FDMI_HBA_ATTR_VENDORIDENTIFIER = 0x00E0,
};

/*
@@ -65,14 +78,21 @@ enum fc_fdmi_hba_attr_type {
#define FC_FDMI_HBA_ATTR_NODENAME_LEN		8
#define FC_FDMI_HBA_ATTR_MANUFACTURER_LEN	64
#define FC_FDMI_HBA_ATTR_SERIALNUMBER_LEN	64
#define FC_FDMI_HBA_ATTR_MODEL_LEN		256
#define FC_FDMI_HBA_ATTR_MODELDESCR_LEN		256
#define FC_FDMI_HBA_ATTR_HARDWAREVERSION_LEN	256
#define FC_FDMI_HBA_ATTR_DRIVERVERSION_LEN	256
#define FC_FDMI_HBA_ATTR_OPTIONROMVERSION_LEN	256
#define FC_FDMI_HBA_ATTR_FIRMWAREVERSION_LEN	256
#define FC_FDMI_HBA_ATTR_OSNAMEVERSION_LEN	256
#define FC_FDMI_HBA_ATTR_MODEL_LEN		64
#define FC_FDMI_HBA_ATTR_MODELDESCR_LEN		64
#define FC_FDMI_HBA_ATTR_HARDWAREVERSION_LEN	64
#define FC_FDMI_HBA_ATTR_DRIVERVERSION_LEN	64
#define FC_FDMI_HBA_ATTR_OPTIONROMVERSION_LEN	64
#define FC_FDMI_HBA_ATTR_FIRMWAREVERSION_LEN	64
#define FC_FDMI_HBA_ATTR_OSNAMEVERSION_LEN	128
#define FC_FDMI_HBA_ATTR_MAXCTPAYLOAD_LEN	4
#define FC_FDMI_HBA_ATTR_NODESYMBLNAME_LEN	64
#define FC_FDMI_HBA_ATTR_VENDORSPECIFICINFO_LEN	4
#define FC_FDMI_HBA_ATTR_NUMBEROFPORTS_LEN	4
#define FC_FDMI_HBA_ATTR_FABRICNAME_LEN	8
#define FC_FDMI_HBA_ATTR_BIOSVERSION_LEN	64
#define FC_FDMI_HBA_ATTR_BIOSSTATE_LEN    4
#define FC_FDMI_HBA_ATTR_VENDORIDENTIFIER_LEN 8

/*
 * Port Attribute Type
@@ -84,6 +104,16 @@ enum fc_fdmi_port_attr_type {
	FC_FDMI_PORT_ATTR_MAXFRAMESIZE = 0x0004,
	FC_FDMI_PORT_ATTR_OSDEVICENAME = 0x0005,
	FC_FDMI_PORT_ATTR_HOSTNAME = 0x0006,
	FC_FDMI_PORT_ATTR_NODENAME = 0x0007,
	FC_FDMI_PORT_ATTR_PORTNAME = 0x0008,
	FC_FDMI_PORT_ATTR_SYMBOLICNAME = 0x0009,
	FC_FDMI_PORT_ATTR_PORTTYPE = 0x000A,
	FC_FDMI_PORT_ATTR_SUPPORTEDCLASSSRVC = 0x000B,
	FC_FDMI_PORT_ATTR_FABRICNAME = 0x000C,
	FC_FDMI_PORT_ATTR_CURRENTFC4TYPE = 0x000D,
	FC_FDMI_PORT_ATTR_PORTSTATE = 0x101,
	FC_FDMI_PORT_ATTR_DISCOVEREDPORTS = 0x102,
	FC_FDMI_PORT_ATTR_PORTID = 0x103,
};

/*
@@ -95,6 +125,17 @@ enum fc_fdmi_port_attr_type {
#define FC_FDMI_PORT_ATTR_MAXFRAMESIZE_LEN	4
#define FC_FDMI_PORT_ATTR_OSDEVICENAME_LEN	256
#define FC_FDMI_PORT_ATTR_HOSTNAME_LEN		256
#define FC_FDMI_PORT_ATTR_NODENAME_LEN		8
#define FC_FDMI_PORT_ATTR_PORTNAME_LEN		8
#define FC_FDMI_PORT_ATTR_SYMBOLICNAME_LEN	256
#define FC_FDMI_PORT_ATTR_PORTTYPE_LEN		4
#define FC_FDMI_PORT_ATTR_SUPPORTEDCLASSSRVC_LEN	4
#define FC_FDMI_PORT_ATTR_FABRICNAME_LEN	8
#define FC_FDMI_PORT_ATTR_CURRENTFC4TYPE_LEN	32
#define FC_FDMI_PORT_ATTR_PORTSTATE_LEN		4
#define FC_FDMI_PORT_ATTR_DISCOVEREDPORTS_LEN	4
#define FC_FDMI_PORT_ATTR_PORTID_LEN		4


/*
 * HBA Attribute ID