Commit 2fdac010 authored by Julia Lawall's avatar Julia Lawall Committed by David S. Miller

drivers/net/ethernet/via/via-velocity.c: update napi implementation

Drivers supporting NAPI should use a NAPI-specific function for receiving
packets.  Hence netif_rx is changed to netif_receive_skb.

Furthermore netif_napi_del should be used in the probe and remove function
to clean up the NAPI resource information.

Thanks to Francois Romieu, David Shwatrz and Rami Rosen for their help on
this patch.
Signed-off-by: default avatarJulia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 728e2cca
...@@ -2100,7 +2100,7 @@ static int velocity_receive_frame(struct velocity_info *vptr, int idx) ...@@ -2100,7 +2100,7 @@ static int velocity_receive_frame(struct velocity_info *vptr, int idx)
__vlan_hwaccel_put_tag(skb, htons(ETH_P_8021Q), vid); __vlan_hwaccel_put_tag(skb, htons(ETH_P_8021Q), vid);
} }
netif_rx(skb); netif_receive_skb(skb);
stats->rx_bytes += pkt_len; stats->rx_bytes += pkt_len;
stats->rx_packets++; stats->rx_packets++;
...@@ -2884,6 +2884,7 @@ static int velocity_probe(struct device *dev, int irq, ...@@ -2884,6 +2884,7 @@ static int velocity_probe(struct device *dev, int irq,
return ret; return ret;
err_iounmap: err_iounmap:
netif_napi_del(&vptr->napi);
iounmap(regs); iounmap(regs);
err_free_dev: err_free_dev:
free_netdev(netdev); free_netdev(netdev);
...@@ -2904,6 +2905,7 @@ static int velocity_remove(struct device *dev) ...@@ -2904,6 +2905,7 @@ static int velocity_remove(struct device *dev)
struct velocity_info *vptr = netdev_priv(netdev); struct velocity_info *vptr = netdev_priv(netdev);
unregister_netdev(netdev); unregister_netdev(netdev);
netif_napi_del(&vptr->napi);
iounmap(vptr->mac_regs); iounmap(vptr->mac_regs);
free_netdev(netdev); free_netdev(netdev);
velocity_nics--; velocity_nics--;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment