diff --git a/modules/exanic/exanic-main.c b/modules/exanic/exanic-main.c index a004f8a..299c92e 100644 --- a/modules/exanic/exanic-main.c +++ b/modules/exanic/exanic-main.c @@ -1156,17 +1156,10 @@ static int exanic_probe(struct pci_dev *pdev, dev_info(dev, "DMA address width: %u bits.\n", exanic->dma_addr_bits); } - err = pci_set_dma_mask(pdev, DMA_BIT_MASK(exanic->dma_addr_bits)); + err = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(exanic->dma_addr_bits)); if (err) { - dev_err(dev, "pci_set_dma_mask failed: %d\n", err); - goto err_dma_mask; - } - - err = pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(exanic->dma_addr_bits)); - if (err) - { - dev_err(dev, "pci_set_consistent_dma_mask failed: %d\n", err); + dev_err(dev, "dma_set_mask_and_coherent failed: %d\n", err); goto err_dma_mask; } diff --git a/modules/exanic/exanic-netdev.c b/modules/exanic/exanic-netdev.c index a2c86ee..ea8699d 100644 --- a/modules/exanic/exanic-netdev.c +++ b/modules/exanic/exanic-netdev.c @@ -1064,7 +1064,7 @@ static int exanic_netdev_set_mac_addr(struct net_device *ndev, void *p) if (!err) err = exanic_get_mac_addr_regs(priv->exanic, priv->port, mac_addr); if (!err) - memcpy(ndev->dev_addr, mac_addr, ETH_ALEN); + eth_hw_addr_set(ndev, mac_addr); mutex_unlock(mutex); @@ -1932,14 +1932,18 @@ int exanic_netdev_alloc(struct exanic *exanic, unsigned port, spin_lock_init(&priv->tx_lock); SET_NETDEV_DEV(ndev, exanic_dev(exanic)); +#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 1, 0) netif_napi_add(ndev, &priv->napi, exanic_netdev_poll, 64); +#else + netif_napi_add(ndev, &priv->napi, exanic_netdev_poll); +#endif ndev->ethtool_ops = &exanic_ethtool_ops; SET_ETHTOOL_OPS_EXT(ndev, &exanic_ethtool_ops_ext); ndev->netdev_ops = &exanic_ndos; err = exanic_get_mac_addr_regs(exanic, port, mac_addr); if (!err) - memcpy(ndev->dev_addr, mac_addr, ETH_ALEN); + eth_hw_addr_set(ndev, mac_addr); memcpy(ndev->perm_addr, exanic->port[port].orig_mac_addr, ETH_ALEN);