-
Notifications
You must be signed in to change notification settings - Fork 475
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add switch api for clause 22 mdio access #1507
Merged
lguohan
merged 5 commits into
opencomputeproject:master
from
jiahua-wang:switch_mdio_cl22
Oct 10, 2022
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
912c4c4
Add switch api for clause 22 mdio access
jiahua-wang f045ca9
Add switch_mdio_cl22_read and switch_mdio_cl22_write to style.pm
jiahua-wang 0acba90
Add sai_switch_mdio_cl22_read_fn and sai_switch_mdio_cl22_write_fn
jiahua-wang c47ee84
Add sai_switch_mdio_cl22_read_fn and sai_switch_mdio_cl22_write_fn
jiahua-wang 0fb1c06
Merge branch 'switch_mdio_cl22' of https://github.com/jiahua-wang/SAI…
jiahua-wang File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3096,6 +3096,46 @@ typedef sai_status_t (*sai_switch_mdio_write_fn)( | |
_In_ uint32_t number_of_registers, | ||
_In_ const uint32_t *reg_val); | ||
|
||
/** | ||
* @brief Switch MDIO clause 22 read API | ||
* | ||
* Provides clause 22 read access API for devices connected to MDIO from NPU SAI. | ||
* | ||
* @objects switch_id SAI_OBJECT_TYPE_SWITCH | ||
* | ||
* @param[in] switch_id Switch Id | ||
* @param[in] device_addr Device address(PHY/lane/port MDIO address) | ||
* @param[in] start_reg_addr Starting register address to read | ||
* @param[in] number_of_registers Number of consecutive registers to read | ||
* @param[out] reg_val Register read values | ||
*/ | ||
typedef sai_status_t (*sai_switch_mdio_cl22_read_fn)( | ||
_In_ sai_object_id_t switch_id, | ||
_In_ uint32_t device_addr, | ||
_In_ uint32_t start_reg_addr, | ||
_In_ uint32_t number_of_registers, | ||
_Out_ uint32_t *reg_val); | ||
|
||
/** | ||
* @brief Switch MDIO clause write API | ||
* | ||
* Provides clause 22 write access API for devices connected to MDIO from NPU SAI. | ||
* | ||
* @objects switch_id SAI_OBJECT_TYPE_SWITCH | ||
* | ||
* @param[in] switch_id Switch Id | ||
* @param[in] device_addr Device address(PHY/lane/port MDIO address) | ||
* @param[in] start_reg_addr Starting register address to write | ||
* @param[in] number_of_registers Number of consecutive registers to write | ||
* @param[in] reg_val Register write values | ||
*/ | ||
typedef sai_status_t (*sai_switch_mdio_cl22_write_fn)( | ||
_In_ sai_object_id_t switch_id, | ||
_In_ uint32_t device_addr, | ||
_In_ uint32_t start_reg_addr, | ||
_In_ uint32_t number_of_registers, | ||
_In_ const uint32_t *reg_val); | ||
|
||
/** | ||
* @brief Create switch | ||
* | ||
|
@@ -3272,6 +3312,8 @@ typedef struct _sai_switch_api_t | |
sai_remove_switch_tunnel_fn remove_switch_tunnel; | ||
sai_set_switch_tunnel_attribute_fn set_switch_tunnel_attribute; | ||
sai_get_switch_tunnel_attribute_fn get_switch_tunnel_attribute; | ||
sai_switch_mdio_cl22_read_fn switch_mdio_cl22_read; | ||
sai_switch_mdio_cl22_write_fn switch_mdio_cl22_write; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It can be:
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
|
||
} sai_switch_api_t; | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Type
sai_switch_mdio_cl22_read_fn
is same assai_switch_mdio_read_fn
. It looks not needed to define it.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the first commit: 912c4c4 The new cl22 functions had the type you suggested. But it would not pass the parse.pl sanity check. I changed the cl22 function to the new type in the last commit: 0fb1c06