aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/skfp/skfddi.c
diff options
context:
space:
mode:
authorAndrea Bastoni <bastoni@cs.unc.edu>2010-05-30 19:16:45 -0400
committerAndrea Bastoni <bastoni@cs.unc.edu>2010-05-30 19:16:45 -0400
commitada47b5fe13d89735805b566185f4885f5a3f750 (patch)
tree644b88f8a71896307d71438e9b3af49126ffb22b /drivers/net/skfp/skfddi.c
parent43e98717ad40a4ae64545b5ba047c7b86aa44f4f (diff)
parent3280f21d43ee541f97f8cda5792150d2dbec20d5 (diff)
Merge branch 'wip-2.6.34' into old-private-masterarchived-private-master
Diffstat (limited to 'drivers/net/skfp/skfddi.c')
-rw-r--r--drivers/net/skfp/skfddi.c39
1 files changed, 11 insertions, 28 deletions
diff --git a/drivers/net/skfp/skfddi.c b/drivers/net/skfp/skfddi.c
index b27156eaf267..d9016b75abc2 100644
--- a/drivers/net/skfp/skfddi.c
+++ b/drivers/net/skfp/skfddi.c
@@ -78,13 +78,13 @@ static const char * const boot_msg =
78#include <linux/kernel.h> 78#include <linux/kernel.h>
79#include <linux/errno.h> 79#include <linux/errno.h>
80#include <linux/ioport.h> 80#include <linux/ioport.h>
81#include <linux/slab.h>
82#include <linux/interrupt.h> 81#include <linux/interrupt.h>
83#include <linux/pci.h> 82#include <linux/pci.h>
84#include <linux/netdevice.h> 83#include <linux/netdevice.h>
85#include <linux/fddidevice.h> 84#include <linux/fddidevice.h>
86#include <linux/skbuff.h> 85#include <linux/skbuff.h>
87#include <linux/bitops.h> 86#include <linux/bitops.h>
87#include <linux/gfp.h>
88 88
89#include <asm/byteorder.h> 89#include <asm/byteorder.h>
90#include <asm/io.h> 90#include <asm/io.h>
@@ -149,7 +149,7 @@ extern void mac_drv_rx_mode(struct s_smc *smc, int mode);
149extern void mac_drv_clear_rx_queue(struct s_smc *smc); 149extern void mac_drv_clear_rx_queue(struct s_smc *smc);
150extern void enable_tx_irq(struct s_smc *smc, u_short queue); 150extern void enable_tx_irq(struct s_smc *smc, u_short queue);
151 151
152static struct pci_device_id skfddi_pci_tbl[] = { 152static DEFINE_PCI_DEVICE_TABLE(skfddi_pci_tbl) = {
153 { PCI_VENDOR_ID_SK, PCI_DEVICE_ID_SK_FP, PCI_ANY_ID, PCI_ANY_ID, }, 153 { PCI_VENDOR_ID_SK, PCI_DEVICE_ID_SK_FP, PCI_ANY_ID, PCI_ANY_ID, },
154 { } /* Terminating entry */ 154 { } /* Terminating entry */
155}; 155};
@@ -435,13 +435,7 @@ static int skfp_driver_init(struct net_device *dev)
435 goto fail; 435 goto fail;
436 } 436 }
437 read_address(smc, NULL); 437 read_address(smc, NULL);
438 pr_debug(KERN_INFO "HW-Addr: %02x %02x %02x %02x %02x %02x\n", 438 pr_debug(KERN_INFO "HW-Addr: %pMF\n", smc->hw.fddi_canon_addr.a);
439 smc->hw.fddi_canon_addr.a[0],
440 smc->hw.fddi_canon_addr.a[1],
441 smc->hw.fddi_canon_addr.a[2],
442 smc->hw.fddi_canon_addr.a[3],
443 smc->hw.fddi_canon_addr.a[4],
444 smc->hw.fddi_canon_addr.a[5]);
445 memcpy(dev->dev_addr, smc->hw.fddi_canon_addr.a, 6); 439 memcpy(dev->dev_addr, smc->hw.fddi_canon_addr.a, 6);
446 440
447 smt_reset_defaults(smc, 0); 441 smt_reset_defaults(smc, 0);
@@ -858,8 +852,7 @@ static void skfp_ctl_set_multicast_list(struct net_device *dev)
858static void skfp_ctl_set_multicast_list_wo_lock(struct net_device *dev) 852static void skfp_ctl_set_multicast_list_wo_lock(struct net_device *dev)
859{ 853{
860 struct s_smc *smc = netdev_priv(dev); 854 struct s_smc *smc = netdev_priv(dev);
861 struct dev_mc_list *dmi; /* ptr to multicast addr entry */ 855 struct dev_mc_list *dmi;
862 int i;
863 856
864 /* Enable promiscuous mode, if necessary */ 857 /* Enable promiscuous mode, if necessary */
865 if (dev->flags & IFF_PROMISC) { 858 if (dev->flags & IFF_PROMISC) {
@@ -878,29 +871,19 @@ static void skfp_ctl_set_multicast_list_wo_lock(struct net_device *dev)
878 if (dev->flags & IFF_ALLMULTI) { 871 if (dev->flags & IFF_ALLMULTI) {
879 mac_drv_rx_mode(smc, RX_ENABLE_ALLMULTI); 872 mac_drv_rx_mode(smc, RX_ENABLE_ALLMULTI);
880 pr_debug(KERN_INFO "ENABLE ALL MC ADDRESSES\n"); 873 pr_debug(KERN_INFO "ENABLE ALL MC ADDRESSES\n");
881 } else if (dev->mc_count > 0) { 874 } else if (!netdev_mc_empty(dev)) {
882 if (dev->mc_count <= FPMAX_MULTICAST) { 875 if (netdev_mc_count(dev) <= FPMAX_MULTICAST) {
883 /* use exact filtering */ 876 /* use exact filtering */
884 877
885 // point to first multicast addr 878 // point to first multicast addr
886 dmi = dev->mc_list; 879 netdev_for_each_mc_addr(dmi, dev) {
887
888 for (i = 0; i < dev->mc_count; i++) {
889 mac_add_multicast(smc, 880 mac_add_multicast(smc,
890 (struct fddi_addr *)dmi->dmi_addr, 881 (struct fddi_addr *)dmi->dmi_addr,
891 1); 882 1);
892 883
893 pr_debug(KERN_INFO "ENABLE MC ADDRESS:"); 884 pr_debug(KERN_INFO "ENABLE MC ADDRESS: %pMF\n",
894 pr_debug(" %02x %02x %02x ", 885 dmi->dmi_addr);
895 dmi->dmi_addr[0], 886 }
896 dmi->dmi_addr[1],
897 dmi->dmi_addr[2]);
898 pr_debug("%02x %02x %02x\n",
899 dmi->dmi_addr[3],
900 dmi->dmi_addr[4],
901 dmi->dmi_addr[5]);
902 dmi = dmi->next;
903 } // for
904 887
905 } else { // more MC addresses than HW supports 888 } else { // more MC addresses than HW supports
906 889
@@ -1002,7 +985,7 @@ static int skfp_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
1002 } 985 }
1003 break; 986 break;
1004 default: 987 default:
1005 printk("ioctl for %s: unknow cmd: %04x\n", dev->name, ioc.cmd); 988 printk("ioctl for %s: unknown cmd: %04x\n", dev->name, ioc.cmd);
1006 status = -EOPNOTSUPP; 989 status = -EOPNOTSUPP;
1007 990
1008 } // switch 991 } // switch