|
Switchtec Userspace PROJECT_NUMBER = 4.2
|
List and wait for switch events. More...
Functions | |
| int | switchtec_event_summary_set (struct switchtec_event_summary *sum, enum switchtec_event_id e, int index) |
| Set a bit corresponding to an event in a summary structure. | |
| int | switchtec_event_summary_test (struct switchtec_event_summary *sum, enum switchtec_event_id e, int index) |
| Test if a bit corresponding to an event is set in a summary structure. | |
| int | switchtec_event_summary_iter (struct switchtec_event_summary *sum, enum switchtec_event_id *e, int *idx) |
| Iterate through all set bits in an event summary structure. | |
| int | switchtec_event_check (struct switchtec_dev *dev, struct switchtec_event_summary *chk, struct switchtec_event_summary *res) |
| Check if one or more events have occurred. | |
| enum switchtec_event_type | switchtec_event_info (enum switchtec_event_id e, const char **name, const char **desc) |
| Get the name and description strings as well as the type (global, partition or pff) for a specific event ID. | |
| int | switchtec_event_wait_for (struct switchtec_dev *dev, enum switchtec_event_id e, int index, struct switchtec_event_summary *res, int timeout_ms) |
| Block until a specific event occurs. | |
| int | switchtec_event_summary (struct switchtec_dev *dev, struct switchtec_event_summary *sum) |
| Retrieve a summary of all the events that have occurred in the switch. | |
| int | switchtec_event_ctl (struct switchtec_dev *dev, enum switchtec_event_id e, int index, int flags, uint32_t data[5]) |
| Enable, disable and clear events or retrieve event data. | |
| int | switchtec_event_wait (struct switchtec_dev *dev, int timeout_ms) |
| Wait for any event to occur (typically just an interrupt). | |
List and wait for switch events.
switchtec_event_info() provides an interface to list all possible switch events. switchtec_event_summary() gives a bitmask of events that have occured since they were last cleared. switchtec_event_ctl() can be used to clear and event or manage what happens when an event occurs. switchtec_event_wait_for() may be used to block until a specific event occurs.
| int switchtec_event_check | ( | struct switchtec_dev * | dev, |
| struct switchtec_event_summary * | chk, | ||
| struct switchtec_event_summary * | res ) |
Check if one or more events have occurred.
| [in] | dev | Switchtec device handle |
| [in] | chk | Summary structure with events to check |
| [out] | res | Returned current events summary, (may be NULL) |
| int switchtec_event_ctl | ( | struct switchtec_dev * | dev, |
| enum switchtec_event_id | e, | ||
| int | index, | ||
| int | flags, | ||
| uint32_t | data[5] ) |
Enable, disable and clear events or retrieve event data.
| [in] | dev | Switchtec device handle |
| [in] | e | Event to operate on |
| [in] | index | Event index (partition or port, depending on event) |
| [in] | flags | Any of the SWITCHTEC_EVT_FLAGs |
| [out] | data | Returned event data reported by the switch |
Definition at line 327 of file platform.c.
| enum switchtec_event_type switchtec_event_info | ( | enum switchtec_event_id | e, |
| const char ** | name, | ||
| const char ** | desc ) |
| int switchtec_event_summary | ( | struct switchtec_dev * | dev, |
| struct switchtec_event_summary * | sum ) |
Retrieve a summary of all the events that have occurred in the switch.
| [in] | dev | Switchtec device handle |
| [out] | sum | Structure to place the result in |
Definition at line 311 of file platform.c.
| int switchtec_event_summary_iter | ( | struct switchtec_event_summary * | sum, |
| enum switchtec_event_id * | e, | ||
| int * | idx ) |
Iterate through all set bits in an event summary structure.
| [in] | sum | Summary structure to set the bit in |
| [out] | e | Event ID which was set |
| [out] | idx | Event index (partition or port, depending on event) |
This function is meant to be called in a loop. It finds the lowest bit set and returns the corresponding event id and index. It then clears that bit in the structure.
| int switchtec_event_summary_set | ( | struct switchtec_event_summary * | sum, |
| enum switchtec_event_id | e, | ||
| int | index ) |
| int switchtec_event_summary_test | ( | struct switchtec_event_summary * | sum, |
| enum switchtec_event_id | e, | ||
| int | index ) |
| int switchtec_event_wait | ( | struct switchtec_dev * | dev, |
| int | timeout_ms ) |
Wait for any event to occur (typically just an interrupt).
| [in] | dev | Switchtec device handle |
| [in] | timeout_ms | Timeout ofter this many milliseconds |
Definition at line 343 of file platform.c.
| int switchtec_event_wait_for | ( | struct switchtec_dev * | dev, |
| enum switchtec_event_id | e, | ||
| int | index, | ||
| struct switchtec_event_summary * | res, | ||
| int | timeout_ms ) |
Block until a specific event occurs.
| [in] | dev | Switchtec device handle |
| [in] | e | Event ID to wait for |
| [in] | index | Event index (partition or port) |
| [out] | res | Current event summary set, after waiting |
| [in] | timeout_ms | Timeout of this many milliseconds |