ethdev: use constants for link state
[dpdk.git] / lib / librte_ether / rte_ethdev.h
index e7de34a..c5a215a 100644 (file)
@@ -247,7 +247,7 @@ struct rte_eth_stats {
 struct rte_eth_link {
        uint16_t link_speed;      /**< ETH_LINK_SPEED_[10, 100, 1000, 10000] */
        uint16_t link_duplex;     /**< ETH_LINK_[HALF_DUPLEX, FULL_DUPLEX] */
-       uint8_t  link_status : 1; /**< 1 -> link up, 0 -> link down */
+       uint8_t  link_status : 1; /**< ETH_LINK_[DOWN/UP] */
 }__attribute__((aligned(8)));     /**< aligned for atomic64 read/write */
 
 #define ETH_LINK_SPEED_AUTONEG  0       /**< Auto-negotiate link speed. */
@@ -259,9 +259,12 @@ struct rte_eth_link {
 #define ETH_LINK_SPEED_20G      20000   /**< 20 gigabits/second. */
 #define ETH_LINK_SPEED_40G      40000   /**< 40 gigabits/second. */
 
+/* Utility constants */
 #define ETH_LINK_AUTONEG_DUPLEX 0       /**< Auto-negotiate duplex. */
 #define ETH_LINK_HALF_DUPLEX    1       /**< Half-duplex connection. */
 #define ETH_LINK_FULL_DUPLEX    2       /**< Full-duplex connection. */
+#define ETH_LINK_DOWN           0 /**< Link is down. */
+#define ETH_LINK_UP             1 /**< Link is up. */
 
 /**
  * A structure used to configure the ring threshold registers of an RX/TX