diff options
Diffstat (limited to 'drivers/net/amd8111e.c')
-rw-r--r-- | drivers/net/amd8111e.c | 29 |
1 files changed, 15 insertions, 14 deletions
diff --git a/drivers/net/amd8111e.c b/drivers/net/amd8111e.c index 4e6359fff0e1..8d58f0a8f42f 100644 --- a/drivers/net/amd8111e.c +++ b/drivers/net/amd8111e.c | |||
@@ -73,7 +73,6 @@ Revision History: | |||
73 | #include <linux/kernel.h> | 73 | #include <linux/kernel.h> |
74 | #include <linux/types.h> | 74 | #include <linux/types.h> |
75 | #include <linux/compiler.h> | 75 | #include <linux/compiler.h> |
76 | #include <linux/slab.h> | ||
77 | #include <linux/delay.h> | 76 | #include <linux/delay.h> |
78 | #include <linux/init.h> | 77 | #include <linux/init.h> |
79 | #include <linux/ioport.h> | 78 | #include <linux/ioport.h> |
@@ -113,7 +112,7 @@ MODULE_PARM_DESC(coalesce, "Enable or Disable interrupt coalescing, 1: Enable, 0 | |||
113 | module_param_array(dynamic_ipg, bool, NULL, 0); | 112 | module_param_array(dynamic_ipg, bool, NULL, 0); |
114 | MODULE_PARM_DESC(dynamic_ipg, "Enable or Disable dynamic IPG, 1: Enable, 0: Disable"); | 113 | MODULE_PARM_DESC(dynamic_ipg, "Enable or Disable dynamic IPG, 1: Enable, 0: Disable"); |
115 | 114 | ||
116 | static struct pci_device_id amd8111e_pci_tbl[] = { | 115 | static DEFINE_PCI_DEVICE_TABLE(amd8111e_pci_tbl) = { |
117 | 116 | ||
118 | { PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD8111E_7462, | 117 | { PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD8111E_7462, |
119 | PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0UL }, | 118 | PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0UL }, |
@@ -1176,8 +1175,7 @@ static irqreturn_t amd8111e_interrupt(int irq, void *dev_id) | |||
1176 | /* Schedule a polling routine */ | 1175 | /* Schedule a polling routine */ |
1177 | __napi_schedule(&lp->napi); | 1176 | __napi_schedule(&lp->napi); |
1178 | } else if (intren0 & RINTEN0) { | 1177 | } else if (intren0 & RINTEN0) { |
1179 | printk("************Driver bug! \ | 1178 | printk("************Driver bug! interrupt while in poll\n"); |
1180 | interrupt while in poll\n"); | ||
1181 | /* Fix by disable receive interrupts */ | 1179 | /* Fix by disable receive interrupts */ |
1182 | writel(RINTEN0, mmio + INTEN0); | 1180 | writel(RINTEN0, mmio + INTEN0); |
1183 | } | 1181 | } |
@@ -1378,28 +1376,28 @@ list to the device. | |||
1378 | */ | 1376 | */ |
1379 | static void amd8111e_set_multicast_list(struct net_device *dev) | 1377 | static void amd8111e_set_multicast_list(struct net_device *dev) |
1380 | { | 1378 | { |
1381 | struct dev_mc_list* mc_ptr; | 1379 | struct dev_mc_list *mc_ptr; |
1382 | struct amd8111e_priv *lp = netdev_priv(dev); | 1380 | struct amd8111e_priv *lp = netdev_priv(dev); |
1383 | u32 mc_filter[2] ; | 1381 | u32 mc_filter[2] ; |
1384 | int i,bit_num; | 1382 | int bit_num; |
1383 | |||
1385 | if(dev->flags & IFF_PROMISC){ | 1384 | if(dev->flags & IFF_PROMISC){ |
1386 | writel( VAL2 | PROM, lp->mmio + CMD2); | 1385 | writel( VAL2 | PROM, lp->mmio + CMD2); |
1387 | return; | 1386 | return; |
1388 | } | 1387 | } |
1389 | else | 1388 | else |
1390 | writel( PROM, lp->mmio + CMD2); | 1389 | writel( PROM, lp->mmio + CMD2); |
1391 | if(dev->flags & IFF_ALLMULTI || dev->mc_count > MAX_FILTER_SIZE){ | 1390 | if (dev->flags & IFF_ALLMULTI || |
1391 | netdev_mc_count(dev) > MAX_FILTER_SIZE) { | ||
1392 | /* get all multicast packet */ | 1392 | /* get all multicast packet */ |
1393 | mc_filter[1] = mc_filter[0] = 0xffffffff; | 1393 | mc_filter[1] = mc_filter[0] = 0xffffffff; |
1394 | lp->mc_list = dev->mc_list; | ||
1395 | lp->options |= OPTION_MULTICAST_ENABLE; | 1394 | lp->options |= OPTION_MULTICAST_ENABLE; |
1396 | amd8111e_writeq(*(u64*)mc_filter,lp->mmio + LADRF); | 1395 | amd8111e_writeq(*(u64*)mc_filter,lp->mmio + LADRF); |
1397 | return; | 1396 | return; |
1398 | } | 1397 | } |
1399 | if( dev->mc_count == 0 ){ | 1398 | if (netdev_mc_empty(dev)) { |
1400 | /* get only own packets */ | 1399 | /* get only own packets */ |
1401 | mc_filter[1] = mc_filter[0] = 0; | 1400 | mc_filter[1] = mc_filter[0] = 0; |
1402 | lp->mc_list = NULL; | ||
1403 | lp->options &= ~OPTION_MULTICAST_ENABLE; | 1401 | lp->options &= ~OPTION_MULTICAST_ENABLE; |
1404 | amd8111e_writeq(*(u64*)mc_filter,lp->mmio + LADRF); | 1402 | amd8111e_writeq(*(u64*)mc_filter,lp->mmio + LADRF); |
1405 | /* disable promiscous mode */ | 1403 | /* disable promiscous mode */ |
@@ -1408,10 +1406,8 @@ static void amd8111e_set_multicast_list(struct net_device *dev) | |||
1408 | } | 1406 | } |
1409 | /* load all the multicast addresses in the logic filter */ | 1407 | /* load all the multicast addresses in the logic filter */ |
1410 | lp->options |= OPTION_MULTICAST_ENABLE; | 1408 | lp->options |= OPTION_MULTICAST_ENABLE; |
1411 | lp->mc_list = dev->mc_list; | ||
1412 | mc_filter[1] = mc_filter[0] = 0; | 1409 | mc_filter[1] = mc_filter[0] = 0; |
1413 | for (i = 0, mc_ptr = dev->mc_list; mc_ptr && i < dev->mc_count; | 1410 | netdev_for_each_mc_addr(mc_ptr, dev) { |
1414 | i++, mc_ptr = mc_ptr->next) { | ||
1415 | bit_num = (ether_crc_le(ETH_ALEN, mc_ptr->dmi_addr) >> 26) & 0x3f; | 1411 | bit_num = (ether_crc_le(ETH_ALEN, mc_ptr->dmi_addr) >> 26) & 0x3f; |
1416 | mc_filter[bit_num >> 5] |= 1 << (bit_num & 31); | 1412 | mc_filter[bit_num >> 5] |= 1 << (bit_num & 31); |
1417 | } | 1413 | } |
@@ -1633,8 +1629,13 @@ static int amd8111e_enable_link_change(struct amd8111e_priv* lp) | |||
1633 | readl(lp->mmio + CMD7); | 1629 | readl(lp->mmio + CMD7); |
1634 | return 0; | 1630 | return 0; |
1635 | } | 1631 | } |
1636 | /* This function is called when a packet transmission fails to complete within a resonable period, on the assumption that an interrupts have been failed or the interface is locked up. This function will reinitialize the hardware */ | ||
1637 | 1632 | ||
1633 | /* | ||
1634 | * This function is called when a packet transmission fails to complete | ||
1635 | * within a reasonable period, on the assumption that an interrupt have | ||
1636 | * failed or the interface is locked up. This function will reinitialize | ||
1637 | * the hardware. | ||
1638 | */ | ||
1638 | static void amd8111e_tx_timeout(struct net_device *dev) | 1639 | static void amd8111e_tx_timeout(struct net_device *dev) |
1639 | { | 1640 | { |
1640 | struct amd8111e_priv* lp = netdev_priv(dev); | 1641 | struct amd8111e_priv* lp = netdev_priv(dev); |