From 1bb983d261a1bcca3d3263a84c4cbaf904e35ae0 Mon Sep 17 00:00:00 2001 From: Jiahua Wang Date: Mon, 13 Jun 2022 13:41:18 -0700 Subject: [PATCH 1/2] Add mdio access type (clause 45/clause 22) attribute Signed-off-by: Jiahua Wang --- inc/saiswitch.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/inc/saiswitch.h b/inc/saiswitch.h index c7d521288..e95479fe3 100644 --- a/inc/saiswitch.h +++ b/inc/saiswitch.h @@ -2776,6 +2776,20 @@ typedef enum _sai_switch_attr_t */ SAI_SWITCH_ATTR_ECMP_MEMBER_COUNT, + /** + * @brief Enable/disable Clause 22 MDIO access + * + * set mdio access type (clause 45 or clause 22) before calling sai_switch_mdio_read_fn and sai_switch_mdio_write_fn + * + * FALSE - sai_switch_mdio_read_fn and sai_switch_mdio_write_fn use clasue 45 mdio access. + * TRUE - sai_switch_mdio_read_fn and sai_switch_mdio_write_fn use clasue 22 mdio access. + * + * @type bool + * @flags CREATE_AND_SET + * @default false + */ + SAI_SWITCH_ATTR_MDIO_CLAUSE_22, + /** * @brief End of attributes */ From 8e395a2406bf3168d568c76c0827e34cad00f646 Mon Sep 17 00:00:00 2001 From: Jiahua Wang Date: Tue, 14 Jun 2022 15:07:23 -0700 Subject: [PATCH 2/2] Add mdio access type attribute and enum type Signed-off-by: Jiahua Wang --- inc/saiswitch.h | 26 ++++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/inc/saiswitch.h b/inc/saiswitch.h index e95479fe3..c5183d6a1 100644 --- a/inc/saiswitch.h +++ b/inc/saiswitch.h @@ -261,6 +261,19 @@ typedef enum _sai_switch_hardware_access_bus_t } sai_switch_hardware_access_bus_t; +/** + * @brief Attribute data for #SAI_SWITCH_ATTR_MDIO_ACCESS_TYPE + */ +typedef enum _sai_switch_mdio_clause_t +{ + /** MDIO Clause 22 */ + SAI_SWITCH_MDIO_CLAUSE_22, + + /** MDIO Clause 45 */ + SAI_SWITCH_MDIO_CLAUSE_45, + +} sai_switch_mdio_clause_t; + /** * @brief Attribute data for #SAI_SWITCH_ATTR_FIRMWARE_LOAD_METHOD */ @@ -2777,18 +2790,15 @@ typedef enum _sai_switch_attr_t SAI_SWITCH_ATTR_ECMP_MEMBER_COUNT, /** - * @brief Enable/disable Clause 22 MDIO access - * - * set mdio access type (clause 45 or clause 22) before calling sai_switch_mdio_read_fn and sai_switch_mdio_write_fn + * @brief Switch MDIO access type * - * FALSE - sai_switch_mdio_read_fn and sai_switch_mdio_write_fn use clasue 45 mdio access. - * TRUE - sai_switch_mdio_read_fn and sai_switch_mdio_write_fn use clasue 22 mdio access. + * set mdio access type (clause 22 or clause 45) before calling sai_switch_mdio_read_fn and sai_switch_mdio_write_fn * - * @type bool + * @type sai_switch_mdio_clause_t * @flags CREATE_AND_SET - * @default false + * @default SAI_SWITCH_MDIO_CLAUSE_45 */ - SAI_SWITCH_ATTR_MDIO_CLAUSE_22, + SAI_SWITCH_ATTR_MDIO_ACCESS_TYPE, /** * @brief End of attributes