@@ -104,6 +104,35 @@ struct ice_aqc_list_caps_elem {
104104 __le64 rsvd2 ;
105105};
106106
107+ /* Manage MAC address, read command - indirect (0x0107)
108+ * This struct is also used for the response
109+ */
110+ struct ice_aqc_manage_mac_read {
111+ __le16 flags ; /* Zeroed by device driver */
112+ #define ICE_AQC_MAN_MAC_LAN_ADDR_VALID BIT(4)
113+ #define ICE_AQC_MAN_MAC_SAN_ADDR_VALID BIT(5)
114+ #define ICE_AQC_MAN_MAC_PORT_ADDR_VALID BIT(6)
115+ #define ICE_AQC_MAN_MAC_WOL_ADDR_VALID BIT(7)
116+ #define ICE_AQC_MAN_MAC_READ_S 4
117+ #define ICE_AQC_MAN_MAC_READ_M (0xF << ICE_AQC_MAN_MAC_READ_S)
118+ u8 lport_num ;
119+ u8 lport_num_valid ;
120+ #define ICE_AQC_MAN_MAC_PORT_NUM_IS_VALID BIT(0)
121+ u8 num_addr ; /* Used in response */
122+ u8 reserved [3 ];
123+ __le32 addr_high ;
124+ __le32 addr_low ;
125+ };
126+
127+ /* Response buffer format for manage MAC read command */
128+ struct ice_aqc_manage_mac_read_resp {
129+ u8 lport_num ;
130+ u8 addr_type ;
131+ #define ICE_AQC_MAN_MAC_ADDR_TYPE_LAN 0
132+ #define ICE_AQC_MAN_MAC_ADDR_TYPE_WOL 1
133+ u8 mac_addr [ETH_ALEN ];
134+ };
135+
107136/* Clear PXE Command and response (direct 0x0110) */
108137struct ice_aqc_clear_pxe {
109138 u8 rx_cnt ;
@@ -161,6 +190,16 @@ struct ice_aqc_get_sw_cfg_resp {
161190 struct ice_aqc_get_sw_cfg_resp_elem elements [1 ];
162191};
163192
193+ /* Get Default Topology (indirect 0x0400) */
194+ struct ice_aqc_get_topo {
195+ u8 port_num ;
196+ u8 num_branches ;
197+ __le16 reserved1 ;
198+ __le32 reserved2 ;
199+ __le32 addr_high ;
200+ __le32 addr_low ;
201+ };
202+
164203/* Add TSE (indirect 0x0401)
165204 * Delete TSE (indirect 0x040F)
166205 * Move TSE (indirect 0x0408)
@@ -221,6 +260,12 @@ struct ice_aqc_txsched_topo_grp_info_hdr {
221260 __le16 reserved2 ;
222261};
223262
263+ struct ice_aqc_get_topo_elem {
264+ struct ice_aqc_txsched_topo_grp_info_hdr hdr ;
265+ struct ice_aqc_txsched_elem_data
266+ generic [ICE_AQC_TOPO_MAX_LEVEL_NUM ];
267+ };
268+
224269struct ice_aqc_delete_elem {
225270 struct ice_aqc_txsched_topo_grp_info_hdr hdr ;
226271 __le32 teid [1 ];
@@ -266,6 +311,210 @@ struct ice_aqc_query_txsched_res_resp {
266311 struct ice_aqc_layer_props layer_props [ICE_AQC_TOPO_MAX_LEVEL_NUM ];
267312};
268313
314+ /* Get PHY capabilities (indirect 0x0600) */
315+ struct ice_aqc_get_phy_caps {
316+ u8 lport_num ;
317+ u8 reserved ;
318+ __le16 param0 ;
319+ /* 18.0 - Report qualified modules */
320+ #define ICE_AQC_GET_PHY_RQM BIT(0)
321+ /* 18.1 - 18.2 : Report mode
322+ * 00b - Report NVM capabilities
323+ * 01b - Report topology capabilities
324+ * 10b - Report SW configured
325+ */
326+ #define ICE_AQC_REPORT_MODE_S 1
327+ #define ICE_AQC_REPORT_MODE_M (3 << ICE_AQC_REPORT_MODE_S)
328+ #define ICE_AQC_REPORT_NVM_CAP 0
329+ #define ICE_AQC_REPORT_TOPO_CAP BIT(1)
330+ #define ICE_AQC_REPORT_SW_CFG BIT(2)
331+ __le32 reserved1 ;
332+ __le32 addr_high ;
333+ __le32 addr_low ;
334+ };
335+
336+ /* This is #define of PHY type (Extended):
337+ * The first set of defines is for phy_type_low.
338+ */
339+ #define ICE_PHY_TYPE_LOW_100BASE_TX BIT_ULL(0)
340+ #define ICE_PHY_TYPE_LOW_100M_SGMII BIT_ULL(1)
341+ #define ICE_PHY_TYPE_LOW_1000BASE_T BIT_ULL(2)
342+ #define ICE_PHY_TYPE_LOW_1000BASE_SX BIT_ULL(3)
343+ #define ICE_PHY_TYPE_LOW_1000BASE_LX BIT_ULL(4)
344+ #define ICE_PHY_TYPE_LOW_1000BASE_KX BIT_ULL(5)
345+ #define ICE_PHY_TYPE_LOW_1G_SGMII BIT_ULL(6)
346+ #define ICE_PHY_TYPE_LOW_2500BASE_T BIT_ULL(7)
347+ #define ICE_PHY_TYPE_LOW_2500BASE_X BIT_ULL(8)
348+ #define ICE_PHY_TYPE_LOW_2500BASE_KX BIT_ULL(9)
349+ #define ICE_PHY_TYPE_LOW_5GBASE_T BIT_ULL(10)
350+ #define ICE_PHY_TYPE_LOW_5GBASE_KR BIT_ULL(11)
351+ #define ICE_PHY_TYPE_LOW_10GBASE_T BIT_ULL(12)
352+ #define ICE_PHY_TYPE_LOW_10G_SFI_DA BIT_ULL(13)
353+ #define ICE_PHY_TYPE_LOW_10GBASE_SR BIT_ULL(14)
354+ #define ICE_PHY_TYPE_LOW_10GBASE_LR BIT_ULL(15)
355+ #define ICE_PHY_TYPE_LOW_10GBASE_KR_CR1 BIT_ULL(16)
356+ #define ICE_PHY_TYPE_LOW_10G_SFI_AOC_ACC BIT_ULL(17)
357+ #define ICE_PHY_TYPE_LOW_10G_SFI_C2C BIT_ULL(18)
358+ #define ICE_PHY_TYPE_LOW_25GBASE_T BIT_ULL(19)
359+ #define ICE_PHY_TYPE_LOW_25GBASE_CR BIT_ULL(20)
360+ #define ICE_PHY_TYPE_LOW_25GBASE_CR_S BIT_ULL(21)
361+ #define ICE_PHY_TYPE_LOW_25GBASE_CR1 BIT_ULL(22)
362+ #define ICE_PHY_TYPE_LOW_25GBASE_SR BIT_ULL(23)
363+ #define ICE_PHY_TYPE_LOW_25GBASE_LR BIT_ULL(24)
364+ #define ICE_PHY_TYPE_LOW_25GBASE_KR BIT_ULL(25)
365+ #define ICE_PHY_TYPE_LOW_25GBASE_KR_S BIT_ULL(26)
366+ #define ICE_PHY_TYPE_LOW_25GBASE_KR1 BIT_ULL(27)
367+ #define ICE_PHY_TYPE_LOW_25G_AUI_AOC_ACC BIT_ULL(28)
368+ #define ICE_PHY_TYPE_LOW_25G_AUI_C2C BIT_ULL(29)
369+ #define ICE_PHY_TYPE_LOW_40GBASE_CR4 BIT_ULL(30)
370+ #define ICE_PHY_TYPE_LOW_40GBASE_SR4 BIT_ULL(31)
371+ #define ICE_PHY_TYPE_LOW_40GBASE_LR4 BIT_ULL(32)
372+ #define ICE_PHY_TYPE_LOW_40GBASE_KR4 BIT_ULL(33)
373+ #define ICE_PHY_TYPE_LOW_40G_XLAUI_AOC_ACC BIT_ULL(34)
374+ #define ICE_PHY_TYPE_LOW_40G_XLAUI BIT_ULL(35)
375+ #define ICE_PHY_TYPE_LOW_MAX_INDEX 63
376+
377+ struct ice_aqc_get_phy_caps_data {
378+ __le64 phy_type_low ; /* Use values from ICE_PHY_TYPE_LOW_* */
379+ __le64 reserved ;
380+ u8 caps ;
381+ #define ICE_AQC_PHY_EN_TX_LINK_PAUSE BIT(0)
382+ #define ICE_AQC_PHY_EN_RX_LINK_PAUSE BIT(1)
383+ #define ICE_AQC_PHY_LOW_POWER_MODE BIT(2)
384+ #define ICE_AQC_PHY_EN_LINK BIT(3)
385+ #define ICE_AQC_PHY_AN_MODE BIT(4)
386+ #define ICE_AQC_GET_PHY_EN_MOD_QUAL BIT(5)
387+ u8 low_power_ctrl ;
388+ #define ICE_AQC_PHY_EN_D3COLD_LOW_POWER_AUTONEG BIT(0)
389+ __le16 eee_cap ;
390+ #define ICE_AQC_PHY_EEE_EN_100BASE_TX BIT(0)
391+ #define ICE_AQC_PHY_EEE_EN_1000BASE_T BIT(1)
392+ #define ICE_AQC_PHY_EEE_EN_10GBASE_T BIT(2)
393+ #define ICE_AQC_PHY_EEE_EN_1000BASE_KX BIT(3)
394+ #define ICE_AQC_PHY_EEE_EN_10GBASE_KR BIT(4)
395+ #define ICE_AQC_PHY_EEE_EN_25GBASE_KR BIT(5)
396+ #define ICE_AQC_PHY_EEE_EN_40GBASE_KR4 BIT(6)
397+ __le16 eeer_value ;
398+ u8 phy_id_oui [4 ]; /* PHY/Module ID connected on the port */
399+ u8 link_fec_options ;
400+ #define ICE_AQC_PHY_FEC_10G_KR_40G_KR4_EN BIT(0)
401+ #define ICE_AQC_PHY_FEC_10G_KR_40G_KR4_REQ BIT(1)
402+ #define ICE_AQC_PHY_FEC_25G_RS_528_REQ BIT(2)
403+ #define ICE_AQC_PHY_FEC_25G_KR_REQ BIT(3)
404+ #define ICE_AQC_PHY_FEC_25G_RS_544_REQ BIT(4)
405+ #define ICE_AQC_PHY_FEC_25G_RS_CLAUSE91_EN BIT(6)
406+ #define ICE_AQC_PHY_FEC_25G_KR_CLAUSE74_EN BIT(7)
407+ u8 extended_compliance_code ;
408+ #define ICE_MODULE_TYPE_TOTAL_BYTE 3
409+ u8 module_type [ICE_MODULE_TYPE_TOTAL_BYTE ];
410+ #define ICE_AQC_MOD_TYPE_BYTE0_SFP_PLUS 0xA0
411+ #define ICE_AQC_MOD_TYPE_BYTE0_QSFP_PLUS 0x80
412+ #define ICE_AQC_MOD_TYPE_BYTE1_SFP_PLUS_CU_PASSIVE BIT(0)
413+ #define ICE_AQC_MOD_TYPE_BYTE1_SFP_PLUS_CU_ACTIVE BIT(1)
414+ #define ICE_AQC_MOD_TYPE_BYTE1_10G_BASE_SR BIT(4)
415+ #define ICE_AQC_MOD_TYPE_BYTE1_10G_BASE_LR BIT(5)
416+ #define ICE_AQC_MOD_TYPE_BYTE1_10G_BASE_LRM BIT(6)
417+ #define ICE_AQC_MOD_TYPE_BYTE1_10G_BASE_ER BIT(7)
418+ #define ICE_AQC_MOD_TYPE_BYTE2_SFP_PLUS 0xA0
419+ #define ICE_AQC_MOD_TYPE_BYTE2_QSFP_PLUS 0x86
420+ u8 qualified_module_count ;
421+ #define ICE_AQC_QUAL_MOD_COUNT_MAX 16
422+ struct {
423+ u8 v_oui [3 ];
424+ u8 rsvd1 ;
425+ u8 v_part [16 ];
426+ __le32 v_rev ;
427+ __le64 rsvd8 ;
428+ } qual_modules [ICE_AQC_QUAL_MOD_COUNT_MAX ];
429+ };
430+
431+ /* Get link status (indirect 0x0607), also used for Link Status Event */
432+ struct ice_aqc_get_link_status {
433+ u8 lport_num ;
434+ u8 reserved ;
435+ __le16 cmd_flags ;
436+ #define ICE_AQ_LSE_M 0x3
437+ #define ICE_AQ_LSE_NOP 0x0
438+ #define ICE_AQ_LSE_DIS 0x2
439+ #define ICE_AQ_LSE_ENA 0x3
440+ /* only response uses this flag */
441+ #define ICE_AQ_LSE_IS_ENABLED 0x1
442+ __le32 reserved2 ;
443+ __le32 addr_high ;
444+ __le32 addr_low ;
445+ };
446+
447+ /* Get link status response data structure, also used for Link Status Event */
448+ struct ice_aqc_get_link_status_data {
449+ u8 topo_media_conflict ;
450+ #define ICE_AQ_LINK_TOPO_CONFLICT BIT(0)
451+ #define ICE_AQ_LINK_MEDIA_CONFLICT BIT(1)
452+ #define ICE_AQ_LINK_TOPO_CORRUPT BIT(2)
453+ u8 reserved1 ;
454+ u8 link_info ;
455+ #define ICE_AQ_LINK_UP BIT(0) /* Link Status */
456+ #define ICE_AQ_LINK_FAULT BIT(1)
457+ #define ICE_AQ_LINK_FAULT_TX BIT(2)
458+ #define ICE_AQ_LINK_FAULT_RX BIT(3)
459+ #define ICE_AQ_LINK_FAULT_REMOTE BIT(4)
460+ #define ICE_AQ_LINK_UP_PORT BIT(5) /* External Port Link Status */
461+ #define ICE_AQ_MEDIA_AVAILABLE BIT(6)
462+ #define ICE_AQ_SIGNAL_DETECT BIT(7)
463+ u8 an_info ;
464+ #define ICE_AQ_AN_COMPLETED BIT(0)
465+ #define ICE_AQ_LP_AN_ABILITY BIT(1)
466+ #define ICE_AQ_PD_FAULT BIT(2) /* Parallel Detection Fault */
467+ #define ICE_AQ_FEC_EN BIT(3)
468+ #define ICE_AQ_PHY_LOW_POWER BIT(4) /* Low Power State */
469+ #define ICE_AQ_LINK_PAUSE_TX BIT(5)
470+ #define ICE_AQ_LINK_PAUSE_RX BIT(6)
471+ #define ICE_AQ_QUALIFIED_MODULE BIT(7)
472+ u8 ext_info ;
473+ #define ICE_AQ_LINK_PHY_TEMP_ALARM BIT(0)
474+ #define ICE_AQ_LINK_EXCESSIVE_ERRORS BIT(1) /* Excessive Link Errors */
475+ /* Port TX Suspended */
476+ #define ICE_AQ_LINK_TX_S 2
477+ #define ICE_AQ_LINK_TX_M (0x03 << ICE_AQ_LINK_TX_S)
478+ #define ICE_AQ_LINK_TX_ACTIVE 0
479+ #define ICE_AQ_LINK_TX_DRAINED 1
480+ #define ICE_AQ_LINK_TX_FLUSHED 3
481+ u8 reserved2 ;
482+ __le16 max_frame_size ;
483+ u8 cfg ;
484+ #define ICE_AQ_LINK_25G_KR_FEC_EN BIT(0)
485+ #define ICE_AQ_LINK_25G_RS_528_FEC_EN BIT(1)
486+ #define ICE_AQ_LINK_25G_RS_544_FEC_EN BIT(2)
487+ /* Pacing Config */
488+ #define ICE_AQ_CFG_PACING_S 3
489+ #define ICE_AQ_CFG_PACING_M (0xF << ICE_AQ_CFG_PACING_S)
490+ #define ICE_AQ_CFG_PACING_TYPE_M BIT(7)
491+ #define ICE_AQ_CFG_PACING_TYPE_AVG 0
492+ #define ICE_AQ_CFG_PACING_TYPE_FIXED ICE_AQ_CFG_PACING_TYPE_M
493+ /* External Device Power Ability */
494+ u8 power_desc ;
495+ #define ICE_AQ_PWR_CLASS_M 0x3
496+ #define ICE_AQ_LINK_PWR_BASET_LOW_HIGH 0
497+ #define ICE_AQ_LINK_PWR_BASET_HIGH 1
498+ #define ICE_AQ_LINK_PWR_QSFP_CLASS_1 0
499+ #define ICE_AQ_LINK_PWR_QSFP_CLASS_2 1
500+ #define ICE_AQ_LINK_PWR_QSFP_CLASS_3 2
501+ #define ICE_AQ_LINK_PWR_QSFP_CLASS_4 3
502+ __le16 link_speed ;
503+ #define ICE_AQ_LINK_SPEED_10MB BIT(0)
504+ #define ICE_AQ_LINK_SPEED_100MB BIT(1)
505+ #define ICE_AQ_LINK_SPEED_1000MB BIT(2)
506+ #define ICE_AQ_LINK_SPEED_2500MB BIT(3)
507+ #define ICE_AQ_LINK_SPEED_5GB BIT(4)
508+ #define ICE_AQ_LINK_SPEED_10GB BIT(5)
509+ #define ICE_AQ_LINK_SPEED_20GB BIT(6)
510+ #define ICE_AQ_LINK_SPEED_25GB BIT(7)
511+ #define ICE_AQ_LINK_SPEED_40GB BIT(8)
512+ #define ICE_AQ_LINK_SPEED_UNKNOWN BIT(15)
513+ __le32 reserved3 ; /* Aligns next field to 8-byte boundary */
514+ __le64 phy_type_low ; /* Use values from ICE_PHY_TYPE_LOW_* */
515+ __le64 reserved4 ;
516+ };
517+
269518/* NVM Read command (indirect 0x0701)
270519 * NVM Erase commands (direct 0x0702)
271520 * NVM Update commands (indirect 0x0703)
@@ -318,12 +567,16 @@ struct ice_aq_desc {
318567 struct ice_aqc_get_ver get_ver ;
319568 struct ice_aqc_q_shutdown q_shutdown ;
320569 struct ice_aqc_req_res res_owner ;
570+ struct ice_aqc_manage_mac_read mac_read ;
321571 struct ice_aqc_clear_pxe clear_pxe ;
322572 struct ice_aqc_list_caps get_cap ;
573+ struct ice_aqc_get_phy_caps get_phy ;
323574 struct ice_aqc_get_sw_cfg get_sw_conf ;
575+ struct ice_aqc_get_topo get_topo ;
324576 struct ice_aqc_query_txsched_res query_sched_res ;
325577 struct ice_aqc_add_move_delete_elem add_move_delete_elem ;
326578 struct ice_aqc_nvm nvm ;
579+ struct ice_aqc_get_link_status get_link_status ;
327580 } params ;
328581};
329582
@@ -362,6 +615,9 @@ enum ice_adminq_opc {
362615 ice_aqc_opc_list_func_caps = 0x000A ,
363616 ice_aqc_opc_list_dev_caps = 0x000B ,
364617
618+ /* manage MAC address */
619+ ice_aqc_opc_manage_mac_read = 0x0107 ,
620+
365621 /* PXE */
366622 ice_aqc_opc_clear_pxe_mode = 0x0110 ,
367623
@@ -371,9 +627,14 @@ enum ice_adminq_opc {
371627 ice_aqc_opc_clear_pf_cfg = 0x02A4 ,
372628
373629 /* transmit scheduler commands */
630+ ice_aqc_opc_get_dflt_topo = 0x0400 ,
374631 ice_aqc_opc_delete_sched_elems = 0x040F ,
375632 ice_aqc_opc_query_sched_res = 0x0412 ,
376633
634+ /* PHY commands */
635+ ice_aqc_opc_get_phy_caps = 0x0600 ,
636+ ice_aqc_opc_get_link_status = 0x0607 ,
637+
377638 /* NVM commands */
378639 ice_aqc_opc_nvm_read = 0x0701 ,
379640
0 commit comments