aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/intel/ice/ice_adminq_cmd.h
diff options
context:
space:
mode:
authorAnirudh Venkataramanan <anirudh.venkataramanan@intel.com>2019-02-28 18:24:23 -0500
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>2019-04-18 11:38:47 -0400
commit0ebd3ff13ccad2940516ba522ca8d21cea4f56f6 (patch)
tree1c3b060cf8ff2c6f716d3668991bc6aae641e9b7 /drivers/net/ethernet/intel/ice/ice_adminq_cmd.h
parent37b6f6469f75070e4fb2e32995eb858e79b8860a (diff)
ice: Add code for DCB initialization part 2/4
This patch introduces a new top level function ice_init_dcb (and related lower level helper functions) which continues the DCB init flow. This function uses ice_get_dcb_cfg to get, parse and store the DCB configuration. Once this is done, it sets itself up to be notified by the firmware on LLDP MIB change events. Reviewed-by: Bruce Allan <bruce.w.allan@intel.com> Signed-off-by: Anirudh Venkataramanan <anirudh.venkataramanan@intel.com> Tested-by: Andrew Bowers <andrewx.bowers@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Diffstat (limited to 'drivers/net/ethernet/intel/ice/ice_adminq_cmd.h')
-rw-r--r--drivers/net/ethernet/intel/ice/ice_adminq_cmd.h79
1 files changed, 79 insertions, 0 deletions
diff --git a/drivers/net/ethernet/intel/ice/ice_adminq_cmd.h b/drivers/net/ethernet/intel/ice/ice_adminq_cmd.h
index 4809e5ac55f4..bbceaca11541 100644
--- a/drivers/net/ethernet/intel/ice/ice_adminq_cmd.h
+++ b/drivers/net/ethernet/intel/ice/ice_adminq_cmd.h
@@ -1132,6 +1132,48 @@ struct ice_aqc_pf_vf_msg {
1132 __le32 addr_low; 1132 __le32 addr_low;
1133}; 1133};
1134 1134
1135/* Get LLDP MIB (indirect 0x0A00)
1136 * Note: This is also used by the LLDP MIB Change Event (0x0A01)
1137 * as the format is the same.
1138 */
1139struct ice_aqc_lldp_get_mib {
1140 u8 type;
1141#define ICE_AQ_LLDP_MIB_TYPE_S 0
1142#define ICE_AQ_LLDP_MIB_TYPE_M (0x3 << ICE_AQ_LLDP_MIB_TYPE_S)
1143#define ICE_AQ_LLDP_MIB_LOCAL 0
1144#define ICE_AQ_LLDP_MIB_REMOTE 1
1145#define ICE_AQ_LLDP_MIB_LOCAL_AND_REMOTE 2
1146#define ICE_AQ_LLDP_BRID_TYPE_S 2
1147#define ICE_AQ_LLDP_BRID_TYPE_M (0x3 << ICE_AQ_LLDP_BRID_TYPE_S)
1148#define ICE_AQ_LLDP_BRID_TYPE_NEAREST_BRID 0
1149#define ICE_AQ_LLDP_BRID_TYPE_NON_TPMR 1
1150/* Tx pause flags in the 0xA01 event use ICE_AQ_LLDP_TX_* */
1151#define ICE_AQ_LLDP_TX_S 0x4
1152#define ICE_AQ_LLDP_TX_M (0x03 << ICE_AQ_LLDP_TX_S)
1153#define ICE_AQ_LLDP_TX_ACTIVE 0
1154#define ICE_AQ_LLDP_TX_SUSPENDED 1
1155#define ICE_AQ_LLDP_TX_FLUSHED 3
1156/* The following bytes are reserved for the Get LLDP MIB command (0x0A00)
1157 * and in the LLDP MIB Change Event (0x0A01). They are valid for the
1158 * Get LLDP MIB (0x0A00) response only.
1159 */
1160 u8 reserved1;
1161 __le16 local_len;
1162 __le16 remote_len;
1163 u8 reserved2[2];
1164 __le32 addr_high;
1165 __le32 addr_low;
1166};
1167
1168/* Configure LLDP MIB Change Event (direct 0x0A01) */
1169/* For MIB Change Event use ice_aqc_lldp_get_mib structure above */
1170struct ice_aqc_lldp_set_mib_change {
1171 u8 command;
1172#define ICE_AQ_LLDP_MIB_UPDATE_ENABLE 0x0
1173#define ICE_AQ_LLDP_MIB_UPDATE_DIS 0x1
1174 u8 reserved[15];
1175};
1176
1135/* Start LLDP (direct 0x0A06) */ 1177/* Start LLDP (direct 0x0A06) */
1136struct ice_aqc_lldp_start { 1178struct ice_aqc_lldp_start {
1137 u8 command; 1179 u8 command;
@@ -1140,6 +1182,36 @@ struct ice_aqc_lldp_start {
1140 u8 reserved[15]; 1182 u8 reserved[15];
1141}; 1183};
1142 1184
1185/* Get CEE DCBX Oper Config (0x0A07)
1186 * The command uses the generic descriptor struct and
1187 * returns the struct below as an indirect response.
1188 */
1189struct ice_aqc_get_cee_dcb_cfg_resp {
1190 u8 oper_num_tc;
1191 u8 oper_prio_tc[4];
1192 u8 oper_tc_bw[8];
1193 u8 oper_pfc_en;
1194 __le16 oper_app_prio;
1195#define ICE_AQC_CEE_APP_FCOE_S 0
1196#define ICE_AQC_CEE_APP_FCOE_M (0x7 << ICE_AQC_CEE_APP_FCOE_S)
1197#define ICE_AQC_CEE_APP_ISCSI_S 3
1198#define ICE_AQC_CEE_APP_ISCSI_M (0x7 << ICE_AQC_CEE_APP_ISCSI_S)
1199#define ICE_AQC_CEE_APP_FIP_S 8
1200#define ICE_AQC_CEE_APP_FIP_M (0x7 << ICE_AQC_CEE_APP_FIP_S)
1201 __le32 tlv_status;
1202#define ICE_AQC_CEE_PG_STATUS_S 0
1203#define ICE_AQC_CEE_PG_STATUS_M (0x7 << ICE_AQC_CEE_PG_STATUS_S)
1204#define ICE_AQC_CEE_PFC_STATUS_S 3
1205#define ICE_AQC_CEE_PFC_STATUS_M (0x7 << ICE_AQC_CEE_PFC_STATUS_S)
1206#define ICE_AQC_CEE_FCOE_STATUS_S 8
1207#define ICE_AQC_CEE_FCOE_STATUS_M (0x7 << ICE_AQC_CEE_FCOE_STATUS_S)
1208#define ICE_AQC_CEE_ISCSI_STATUS_S 11
1209#define ICE_AQC_CEE_ISCSI_STATUS_M (0x7 << ICE_AQC_CEE_ISCSI_STATUS_S)
1210#define ICE_AQC_CEE_FIP_STATUS_S 16
1211#define ICE_AQC_CEE_FIP_STATUS_M (0x7 << ICE_AQC_CEE_FIP_STATUS_S)
1212 u8 reserved[12];
1213};
1214
1143/* Stop/Start LLDP Agent (direct 0x0A09) 1215/* Stop/Start LLDP Agent (direct 0x0A09)
1144 * Used for stopping/starting specific LLDP agent. e.g. DCBx. 1216 * Used for stopping/starting specific LLDP agent. e.g. DCBx.
1145 * The same structure is used for the response, with the command field 1217 * The same structure is used for the response, with the command field
@@ -1411,6 +1483,8 @@ struct ice_aq_desc {
1411 struct ice_aqc_query_txsched_res query_sched_res; 1483 struct ice_aqc_query_txsched_res query_sched_res;
1412 struct ice_aqc_nvm nvm; 1484 struct ice_aqc_nvm nvm;
1413 struct ice_aqc_pf_vf_msg virt; 1485 struct ice_aqc_pf_vf_msg virt;
1486 struct ice_aqc_lldp_get_mib lldp_get_mib;
1487 struct ice_aqc_lldp_set_mib_change lldp_set_event;
1414 struct ice_aqc_lldp_start lldp_start; 1488 struct ice_aqc_lldp_start lldp_start;
1415 struct ice_aqc_lldp_stop_start_specific_agent lldp_agent_ctrl; 1489 struct ice_aqc_lldp_stop_start_specific_agent lldp_agent_ctrl;
1416 struct ice_aqc_get_set_rss_lut get_set_rss_lut; 1490 struct ice_aqc_get_set_rss_lut get_set_rss_lut;
@@ -1445,6 +1519,8 @@ struct ice_aq_desc {
1445/* error codes */ 1519/* error codes */
1446enum ice_aq_err { 1520enum ice_aq_err {
1447 ICE_AQ_RC_OK = 0, /* Success */ 1521 ICE_AQ_RC_OK = 0, /* Success */
1522 ICE_AQ_RC_EPERM = 1, /* Operation not permitted */
1523 ICE_AQ_RC_ENOENT = 2, /* No such element */
1448 ICE_AQ_RC_ENOMEM = 9, /* Out of memory */ 1524 ICE_AQ_RC_ENOMEM = 9, /* Out of memory */
1449 ICE_AQ_RC_EBUSY = 12, /* Device or resource busy */ 1525 ICE_AQ_RC_EBUSY = 12, /* Device or resource busy */
1450 ICE_AQ_RC_EEXIST = 13, /* Object already exists */ 1526 ICE_AQ_RC_EEXIST = 13, /* Object already exists */
@@ -1515,7 +1591,10 @@ enum ice_adminq_opc {
1515 ice_mbx_opc_send_msg_to_pf = 0x0801, 1591 ice_mbx_opc_send_msg_to_pf = 0x0801,
1516 ice_mbx_opc_send_msg_to_vf = 0x0802, 1592 ice_mbx_opc_send_msg_to_vf = 0x0802,
1517 /* LLDP commands */ 1593 /* LLDP commands */
1594 ice_aqc_opc_lldp_get_mib = 0x0A00,
1595 ice_aqc_opc_lldp_set_mib_change = 0x0A01,
1518 ice_aqc_opc_lldp_start = 0x0A06, 1596 ice_aqc_opc_lldp_start = 0x0A06,
1597 ice_aqc_opc_get_cee_dcb_cfg = 0x0A07,
1519 ice_aqc_opc_lldp_stop_start_specific_agent = 0x0A09, 1598 ice_aqc_opc_lldp_stop_start_specific_agent = 0x0A09,
1520 1599
1521 /* RSS commands */ 1600 /* RSS commands */