X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=drivers%2Fnet%2Fhns3%2Fhns3_ptp.c;h=9a829d7011ad86293aa1a6dd3f50b0876749afb8;hb=599ef84add7ed02537ff43a8e8a36f42b36e107e;hp=df84859046881f1222c547a0a87be81ad11c492c;hpb=38b539d96eb60cd8bb50e4b4f7bb8f5d4c01212c;p=dpdk.git diff --git a/drivers/net/hns3/hns3_ptp.c b/drivers/net/hns3/hns3_ptp.c index df84859046..9a829d7011 100644 --- a/drivers/net/hns3/hns3_ptp.c +++ b/drivers/net/hns3/hns3_ptp.c @@ -21,7 +21,7 @@ hns3_mbuf_dyn_rx_timestamp_register(struct rte_eth_dev *dev, struct hns3_hw *hw = &hns->hw; int ret; - if (!(conf->rxmode.offloads & DEV_RX_OFFLOAD_TIMESTAMP)) + if (!(conf->rxmode.offloads & RTE_ETH_RX_OFFLOAD_TIMESTAMP)) return 0; ret = rte_mbuf_dyn_rx_timestamp_register @@ -61,7 +61,7 @@ hns3_ptp_init(struct hns3_hw *hw) { int ret; - if (!hns3_dev_ptp_supported(hw)) + if (!hns3_dev_get_support(hw, PTP)) return 0; ret = hns3_ptp_int_en(hw, true); @@ -120,7 +120,7 @@ hns3_timesync_enable(struct rte_eth_dev *dev) struct hns3_pf *pf = &hns->pf; int ret; - if (!hns3_dev_ptp_supported(hw)) + if (!hns3_dev_get_support(hw, PTP)) return -ENOTSUP; if (pf->ptp_enable) @@ -140,7 +140,7 @@ hns3_timesync_disable(struct rte_eth_dev *dev) struct hns3_pf *pf = &hns->pf; int ret; - if (!hns3_dev_ptp_supported(hw)) + if (!hns3_dev_get_support(hw, PTP)) return -ENOTSUP; if (!pf->ptp_enable) @@ -164,7 +164,7 @@ hns3_timesync_read_rx_timestamp(struct rte_eth_dev *dev, struct hns3_pf *pf = &hns->pf; uint64_t ns, sec; - if (!hns3_dev_ptp_supported(hw)) + if (!hns3_dev_get_support(hw, PTP)) return -ENOTSUP; ns = pf->rx_timestamp & TIME_RX_STAMP_NS_MASK; @@ -190,7 +190,7 @@ hns3_timesync_read_tx_timestamp(struct rte_eth_dev *dev, uint64_t ns; int ts_cnt; - if (!hns3_dev_ptp_supported(hw)) + if (!hns3_dev_get_support(hw, PTP)) return -ENOTSUP; ts_cnt = hns3_read_dev(hw, HNS3_TX_1588_BACK_TSP_CNT) & @@ -219,7 +219,7 @@ hns3_timesync_read_time(struct rte_eth_dev *dev, struct timespec *ts) struct hns3_hw *hw = HNS3_DEV_PRIVATE_TO_HW(dev->data->dev_private); uint64_t ns, sec; - if (!hns3_dev_ptp_supported(hw)) + if (!hns3_dev_get_support(hw, PTP)) return -ENOTSUP; sec = hns3_read_dev(hw, HNS3_CURR_TIME_OUT_L); @@ -240,7 +240,7 @@ hns3_timesync_write_time(struct rte_eth_dev *dev, const struct timespec *ts) uint64_t sec = ts->tv_sec; uint64_t ns = ts->tv_nsec; - if (!hns3_dev_ptp_supported(hw)) + if (!hns3_dev_get_support(hw, PTP)) return -ENOTSUP; /* Set the timecounters to a new value. */ @@ -261,7 +261,7 @@ hns3_timesync_adjust_time(struct rte_eth_dev *dev, int64_t delta) struct timespec cur_time; uint64_t ns; - if (!hns3_dev_ptp_supported(hw)) + if (!hns3_dev_get_support(hw, PTP)) return -ENOTSUP; (void)hns3_timesync_read_time(dev, &cur_time); @@ -280,7 +280,7 @@ hns3_restore_ptp(struct hns3_adapter *hns) bool en = pf->ptp_enable; int ret; - if (!hns3_dev_ptp_supported(hw)) + if (!hns3_dev_get_support(hw, PTP)) return 0; ret = hns3_timesync_configure(hns, en);