Skip to content

Commit

Permalink
Extended port operational status with various error status
Browse files Browse the repository at this point in the history
Signed-off-by: Prince George <prgeor@microsoft.com>
  • Loading branch information
prgeor committed Aug 6, 2024
1 parent 469dc91 commit 4db3f9c
Showing 1 changed file with 62 additions and 0 deletions.
62 changes: 62 additions & 0 deletions inc/saiport.h
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,25 @@ typedef enum _sai_port_oper_status_t

} sai_port_oper_status_t;

typedef enum _sai_port_errors_status_t
{
/** No errors */
SAI_PORT_ERROR_CLEAR=0x0,

SAI_PORT_ERROR_MAC_LOCAL_FAULT=0x1,

SAI_PORT_ERROR_MAC_REMOTE_FAULT=0x2,

SAI_PORT_ERROR_LINK_TRAINING_FAILED=0x4,

SAI_PORT_ERROR_AUTONEG_FAILED=0x8,

SAI_PORT_ERROR_LINK_TRAINING_FAILED=0x10,

SAI_PORT_ERROR_SET_SPEED_FAILED=0x20,

} sai_port_errors_status_t;

/**
* @brief Defines the operational status of the port
*/
Expand All @@ -91,6 +110,23 @@ typedef struct _sai_port_oper_status_notification_t

} sai_port_oper_status_notification_t;

typedef struct _sai_port_oper_status_extended_notification_t
{
/**
* @brief Port id.
*
* @objects SAI_OBJECT_TYPE_PORT
*/
sai_object_id_t port_id;

/** Port operational status */
sai_port_oper_status_t port_state;

/** Bitmask of various port error status */
sai_port_errors_status_t port_error_status;

} sai_port_oper_status_extended_notification_t;

/**
* @brief Attribute data for #SAI_PORT_ATTR_GLOBAL_FLOW_CONTROL_MODE
*/
Expand Down Expand Up @@ -2528,6 +2564,18 @@ typedef enum _sai_port_attr_t
*/
SAI_PORT_ATTR_JSON_FORMATTED_DEBUG_DATA_SIZE,

/**
* @brief Various port error status
*
* It can be used to query the capability of the port to report
* various error and fault status
*
* @type sai_port_errors_status_t
* @flags READ_ONLY
* @default SAI_PORT_ERROR_CLEAR
*/
SAI_PORT_ATTR_ERROR_STATUS,

/**
* @brief End of attributes
*/
Expand Down Expand Up @@ -3398,6 +3446,20 @@ typedef void (*sai_port_state_change_notification_fn)(
_In_ uint32_t count,
_In_ const sai_port_oper_status_notification_t *data);

/**
* @brief Port state change notification
*
* Passed as a parameter into sai_initialize_switch()
*
* @count data[count]
*
* @param[in] count Number of notifications
* @param[in] data Array of port operational status extended with error status
*/
typedef void (*sai_port_state_change_extended_notification_fn)(
_In_ uint32_t count,
_In_ const sai_port_oper_status_extended_notification_t *data);

/**
* @brief Port host tx ready notification
*
Expand Down

0 comments on commit 4db3f9c

Please sign in to comment.