-
Notifications
You must be signed in to change notification settings - Fork 603
Support for running firmware in embedded controllers #2319
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
Closed
Closed
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
872a8d6
Support for Multiple Firmware
JaiOCP 0362932
Fix SAI_STATUS_IS_* attribute-range helpers for negative status codes…
MoriLevinzon 4720233
saithriftv2: link VPP libraries for platform=vpp + bookworm/py3 build…
nicholasching df9cb28
saiserver: default switch_id on neighbor/route entries when omitted …
nicholasching 95d3b86
sai_test: add opt-in SIMULATE_SONIC to emulate SONiC teamd/IntfMgr ne…
nicholasching 8d2b0a3
sai_test config: drop redundant bridge_id, env-gated port bring-up, f…
nicholasching f32259a
APSU SAI port attributes (#2303)
prgeor 93c3135
[sai_test]: Isolate simulated IPv6 startup control traffic- (#2321)
nicholasching fc18979
add SAI definitions for optical circuit switch (#2229)
wni0812 ed377ca
Add label attribute for ACL entry (#2322)
zechengh09 ab23d7c
Merge branch 'master' into fw
JaiOCP e21ca3c
Merge branch 'master' into fw
JaiOCP d17807c
Merge Conflict
JaiOCP 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
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or 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
This file contains hidden or 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 |
|---|---|---|
| @@ -0,0 +1,217 @@ | ||
| /** | ||
| * Copyright (c) 2014 Microsoft Open Technologies, Inc. | ||
| * | ||
| * Licensed under the Apache License, Version 2.0 (the "License"); you may | ||
| * not use this file except in compliance with the License. You may obtain | ||
| * a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR | ||
| * CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT | ||
| * LIMITATION ANY IMPLIED WARRANTIES OR CONDITIONS OF TITLE, FITNESS | ||
| * FOR A PARTICULAR PURPOSE, MERCHANTABILITY OR NON-INFRINGEMENT. | ||
| * | ||
| * See the Apache Version 2.0 License for specific language governing | ||
| * permissions and limitations under the License. | ||
| * | ||
| * Microsoft would like to thank the following companies for their review and | ||
| * assistance with these files: Intel Corporation, Mellanox Technologies Ltd, | ||
| * Dell Products, L.P., Facebook, Inc., Marvell International Ltd. | ||
| * | ||
| * @file saifw.h | ||
| * | ||
| * @brief This module defines SAI Firmware spec | ||
| */ | ||
|
|
||
| #if !defined (__SAIFW_H_) | ||
| #define __SAIFW_H_ | ||
|
|
||
| #include <saitypes.h> | ||
|
|
||
| /** | ||
| * @defgroup SAIFW SAI - Firmware specific API definitions | ||
| * | ||
| * @{ | ||
| */ | ||
|
|
||
| /** | ||
| * @brief SAI firmware operational state | ||
| */ | ||
| typedef enum _sai_fw_op_state_t | ||
| { | ||
| /** Firmware operational state is firmware is loaded but not started */ | ||
| SAI_FW_OP_STATE_LOADED, | ||
|
|
||
| /** Firmware operational state is firmware is not loaded */ | ||
| SAI_FW_OP_STATE_NOT_LOADED, | ||
|
|
||
| /** Firmware operational state is running */ | ||
| SAI_FW_OP_STATE_RUNNING, | ||
|
|
||
| /** Firmware operational state is stop */ | ||
| SAI_FW_OP_STATE_STOPPED, | ||
|
|
||
| /** Firmware operational state is in error */ | ||
| SAI_FW_OP_STATE_ERROR, | ||
| } sai_fw_op_state_t; | ||
|
|
||
| /** | ||
| * @brief Defines maximum length of firmware and log file name | ||
| */ | ||
| #define SAI_FW_NAME_SIZE 64 | ||
|
|
||
| /** | ||
| * @brief Firmware Attributes | ||
| */ | ||
| typedef enum _sai_fw_attr_t | ||
| { | ||
| /** | ||
| * @brief Start of Attributes | ||
| */ | ||
| SAI_FW_ATTR_START, | ||
|
|
||
| /** | ||
| * @brief Firmware Log File and Path Name [char[SAI_FW_NAME_SIZE]] | ||
| * | ||
| * The maximum number of characters for the name is SAI_FW_NAME_SIZE - 1 since | ||
| * it needs the terminating null byte ('\0') at the end. | ||
| * | ||
| * @type char | ||
| * @flags CREATE_AND_SET | ||
| * @default "" | ||
| */ | ||
| SAI_FW_ATTR_LOG_FILE_AND_PATH_NAME = SAI_FW_ATTR_START, | ||
|
|
||
| /** | ||
| * @brief Firmware File and Path Name [char[SAI_FW_NAME_SIZE]] | ||
| * | ||
| * The maximum number of characters for the name is SAI_FW_NAME_SIZE - 1 since | ||
| * it needs the terminating null byte ('\0') at the end. | ||
| * | ||
| * @type char | ||
|
JaiOCP marked this conversation as resolved.
|
||
| * @flags CREATE_AND_SET | ||
| * @default "" | ||
| */ | ||
| SAI_FW_ATTR_FW_FILE_AND_PATH_NAME, | ||
|
|
||
| /** | ||
| * @brief Firmware to be loaded on the core | ||
| * | ||
| * @type sai_uint8_t | ||
| * @flags CREATE_AND_SET | ||
| * @default 0 | ||
| */ | ||
| SAI_FW_ATTR_CORE_ID, | ||
|
|
||
| /** | ||
| * @brief Firmware admin state | ||
| * | ||
| * @type sai_fw_admin_state_t | ||
| * @flags CREATE_AND_SET | ||
| * @default SAI_FW_ADMIN_STATE_AUTO | ||
| */ | ||
| SAI_FW_ATTR_FW_ADMIN_STATE, | ||
|
|
||
| /** | ||
| * @brief Firmware operational state | ||
| * | ||
| * @type sai_fw_op_state_t | ||
| * @flags READ_ONLY | ||
| */ | ||
| SAI_FW_ATTR_FW_OP_STATE, | ||
|
|
||
| /** | ||
| * @brief Firmware major version | ||
| * | ||
| * @type sai_uint32_t | ||
| * @flags READ_ONLY | ||
| */ | ||
| SAI_FW_ATTR_FW_MAJOR_VERSION, | ||
|
|
||
| /** | ||
| * @brief Firmware minor version | ||
| * | ||
| * @type sai_uint32_t | ||
| * @flags READ_ONLY | ||
| */ | ||
| SAI_FW_ATTR_FW_MINOR_VERSION, | ||
|
|
||
| /** | ||
| * @brief End of Performance Monitoring attributes | ||
| */ | ||
| SAI_FW_ATTR_END, | ||
|
|
||
| /** Custom range base value */ | ||
| SAI_FW_ATTR_CUSTOM_RANGE_START = 0x10000000, | ||
|
|
||
| /** End of custom range base */ | ||
| SAI_FW_ATTR_CUSTOM_RANGE_END | ||
|
|
||
| } sai_fw_attr_t; | ||
|
|
||
| /** | ||
| * @brief Create firmware object | ||
| * | ||
| * @param[out] fw_id Firmware id | ||
| * @param[in] switch_id Switch id | ||
| * @param[in] attr_count Number of attributes | ||
| * @param[in] attr_list Array of attributes | ||
| * | ||
| * @return #SAI_STATUS_SUCCESS on success, failure status code on error | ||
| */ | ||
| typedef sai_status_t (*sai_create_fw_fn)( | ||
| _Out_ sai_object_id_t *fw_id, | ||
| _In_ sai_object_id_t switch_id, | ||
| _In_ uint32_t attr_count, | ||
| _In_ const sai_attribute_t *attr_list); | ||
|
|
||
| /** | ||
| * @brief Remove firmware object | ||
| * | ||
| * @param[in] fw_id Firmware id | ||
| * | ||
| * @return #SAI_STATUS_SUCCESS on success, failure status code on error | ||
| */ | ||
| typedef sai_status_t (*sai_remove_fw_fn)( | ||
| _In_ sai_object_id_t fw_id); | ||
|
|
||
| /** | ||
| * @brief Set firmware attribute | ||
| * | ||
| * @param[in] fw_id Firmware id | ||
| * @param[in] attr Attribute | ||
| * | ||
| * @return #SAI_STATUS_SUCCESS on success, failure status code on error | ||
| */ | ||
| typedef sai_status_t (*sai_set_fw_attribute_fn)( | ||
| _In_ sai_object_id_t fw_id, | ||
| _In_ const sai_attribute_t *attr); | ||
|
|
||
| /** | ||
| * @brief Get Firmware attribute | ||
| * | ||
| * @param[in] fw_id Firmware ID | ||
| * @param[in] attr_count Number of attributes | ||
| * @param[inout] attr_list Array of attributes | ||
| * | ||
| * @return #SAI_STATUS_SUCCESS on success, failure status code on error | ||
| */ | ||
| typedef sai_status_t (*sai_get_fw_attribute_fn)( | ||
| _In_ sai_object_id_t fw_id, | ||
| _In_ uint32_t attr_count, | ||
| _Inout_ sai_attribute_t *attr_list); | ||
|
|
||
| /** | ||
| * @brief Firmware related API methods table retrieved with sai_api_query() | ||
| */ | ||
| typedef struct _sai_fw_api_t | ||
| { | ||
| sai_create_fw_fn create_fw; | ||
| sai_remove_fw_fn remove_fw; | ||
| sai_set_fw_attribute_fn set_fw_attribute; | ||
| sai_get_fw_attribute_fn get_fw_attribute; | ||
| } sai_fw_api_t; | ||
|
|
||
| /** | ||
| * @} | ||
| */ | ||
| #endif /** __SAIFW_H_ */ | ||
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.