mirror of
https://github.com/corundum/corundum.git
synced 2025-01-16 08:12:53 +08:00
Check PTP feature bits
This commit is contained in:
parent
132d44cd90
commit
9341f93b3f
@ -191,7 +191,9 @@ static int mqnic_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
|
||||
dev_info(dev, "PHC count: %d", mqnic->phc_count);
|
||||
mqnic->phc_offset = ioread32(mqnic->hw_addr+MQNIC_REG_PHC_OFFSET);
|
||||
dev_info(dev, "PHC offset: 0x%08x", mqnic->phc_offset);
|
||||
mqnic->phc_hw_addr = mqnic->hw_addr+mqnic->phc_offset;
|
||||
|
||||
if (mqnic->phc_count)
|
||||
mqnic->phc_hw_addr = mqnic->hw_addr+mqnic->phc_offset;
|
||||
|
||||
mqnic->if_count = ioread32(mqnic->hw_addr+MQNIC_REG_IF_COUNT);
|
||||
dev_info(dev, "IF count: %d", mqnic->if_count);
|
||||
|
@ -292,7 +292,10 @@ bool mqnic_process_rx_cq(struct net_device *ndev, struct mqnic_cq_ring *cq_ring,
|
||||
skb->protocol = eth_type_trans(skb, priv->ndev);
|
||||
|
||||
// RX hardware timestamp
|
||||
skb_hwtstamps(skb)->hwtstamp = mqnic_read_cpl_ts(priv->mdev, ring, cpl);
|
||||
if (priv->if_features & MQNIC_IF_FEATURE_PTP_TS)
|
||||
{
|
||||
skb_hwtstamps(skb)->hwtstamp = mqnic_read_cpl_ts(priv->mdev, ring, cpl);
|
||||
}
|
||||
|
||||
skb_record_rx_queue(skb, cq_ring->ring_index);
|
||||
|
||||
|
@ -356,7 +356,7 @@ netdev_tx_t mqnic_start_xmit(struct sk_buff *skb, struct net_device *ndev)
|
||||
|
||||
// TX hardware timestamp
|
||||
tx_info->ts_requested = 0;
|
||||
if (unlikely(shinfo->tx_flags & SKBTX_HW_TSTAMP)) {
|
||||
if (unlikely(priv->if_features & MQNIC_IF_FEATURE_PTP_TS && shinfo->tx_flags & SKBTX_HW_TSTAMP)) {
|
||||
dev_info(&priv->mdev->pdev->dev, "mqnic_start_xmit TX TS requested");
|
||||
shinfo->tx_flags |= SKBTX_IN_PROGRESS;
|
||||
tx_info->ts_requested = 1;
|
||||
|
Loading…
x
Reference in New Issue
Block a user