Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Linux 6.1 fixes #71

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 2 additions & 9 deletions modules/exanic/exanic-main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
8 changes: 6 additions & 2 deletions modules/exanic/exanic-netdev.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down Expand Up @@ -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);

Expand Down