| 3057 | } |
| 3058 | |
| 3059 | static int |
| 3060 | ngbe_timesync_read_tx_timestamp(struct rte_eth_dev *dev, |
| 3061 | struct timespec *timestamp) |
| 3062 | { |
| 3063 | struct ngbe_hw *hw = ngbe_dev_hw(dev); |
| 3064 | struct ngbe_adapter *adapter = ngbe_dev_adapter(dev); |
| 3065 | uint32_t tsync_txctl; |
| 3066 | uint64_t tx_tstamp_cycles; |
| 3067 | uint64_t ns; |
| 3068 | |
| 3069 | tsync_txctl = rd32(hw, NGBE_TSTXCTL); |
| 3070 | if ((tsync_txctl & NGBE_TSTXCTL_VLD) == 0) |
| 3071 | return -EINVAL; |
| 3072 | |
| 3073 | tx_tstamp_cycles = ngbe_read_tx_tstamp_cyclecounter(dev); |
| 3074 | ns = rte_timecounter_update(&adapter->tx_tstamp_tc, tx_tstamp_cycles); |
| 3075 | *timestamp = rte_ns_to_timespec(ns); |
| 3076 | |
| 3077 | return 0; |
| 3078 | } |
| 3079 | |
| 3080 | static int |
| 3081 | ngbe_get_reg_length(struct rte_eth_dev *dev __rte_unused) |
nothing calls this directly
no test coverage detected