Define API to get pktio link state: seed and link up/down.

Signed-off-by: Maxim Uvarov <[email protected]>
---
  v3: - even more simple, left only link up/down state and speed.
  v2: - use simple struct to return pktio link state;
     - odp will not modify link, only ready it's state;

 include/odp/api/packet_io.h | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

diff --git a/include/odp/api/packet_io.h b/include/odp/api/packet_io.h
index 3479af1..2fa3db8 100644
--- a/include/odp/api/packet_io.h
+++ b/include/odp/api/packet_io.h
@@ -96,6 +96,25 @@ typedef struct odp_pktio_param_t {
 } odp_pktio_param_t;
 
 /**
+ * Packet IO link state information
+ */
+typedef struct odp_pktio_link_state_t {
+       uint32_t speed;         /**< Speed in Mbps: 10, 100, 1000 etc */
+       odp_bool_t up;          /**< 1 - link up, 0 - link down */
+} odp_pktio_link_state_t;
+
+/**
+ * Get packet IO link state
+ *
+ * @param[in] pktio    Packet IO handle
+ * @param[out] state   Buffer to save link state
+ *
+ * @retval 0 on success (state info updated)
+ * @retval <0 on failure (state info not updated)
+ */
+int odp_pktio_link_state(odp_pktio_t pktio, odp_pktio_link_state_t *state);
+
+/**
  * Open a packet IO interface
  *
  * An ODP program can open a single packet IO interface per device, attempts
-- 
1.9.1

_______________________________________________
lng-odp mailing list
[email protected]
https://lists.linaro.org/mailman/listinfo/lng-odp

Reply via email to