aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@woody.linux-foundation.org>2007-07-31 18:51:00 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-07-31 18:51:00 -0400
commit0d6caa1795090bd22ede96b84daa4600b63eee37 (patch)
tree7b69aa68f7f812bd1a13b0c5e73573a01e671ef8 /drivers
parent88c8199b9d2f5ec0a8468a0495ba4c9656846500 (diff)
parent8072f085d79a0a73cc5a0333ffa7f0c5d35f76e0 (diff)
Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
* 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6: (41 commits) [RTNETLINK]: Fix warning for !CONFIG_KMOD [IPV4] ip_options.c: kmalloc + memset conversion to kzalloc [DECNET]: kmalloc + memset conversion to kzalloc [NET]: ethtool_perm_addr only has one implementation [NET]: ethtool ops are the only way [PPPOE]: Improve hashing function in hash_item(). [XFRM]: State selection update to use inner addresses. [IPSEC]: Ensure that state inner family is set [TCP]: Bidir flow must not disregard SACK blocks for lost marking [TCP]: Fix ratehalving with bidirectional flows [PPPOL2TP]: Add CONFIG_INET Kconfig dependency. [NET]: Page offsets and lengths need to be __u32. [AF_UNIX]: Make code static. [NETFILTER]: Make nf_ct_ipv6_skip_exthdr() static. [PKTGEN]: make get_ipsec_sa() static and non-inline [PPPoE]: move lock_sock() in pppoe_sendmsg() to the right location [PPPoX/E]: return ENOTTY on unknown ioctl requests [IPV6]: ipv6_addr_type() doesn't know about RFC4193 addresses. [NET]: Fix prio_tune() handling of root qdisc. [NET]: Fix sch_api to properly set sch->parent on the root. ...
Diffstat (limited to 'drivers')
-rw-r--r--drivers/dma/iovlock.c27
-rw-r--r--drivers/net/3c59x.c1
-rw-r--r--drivers/net/8139cp.c1
-rw-r--r--drivers/net/8139too.c1
-rw-r--r--drivers/net/Kconfig2
-rw-r--r--drivers/net/ax88796.c1
-rw-r--r--drivers/net/b44.c1
-rw-r--r--drivers/net/bnx2.c1
-rw-r--r--drivers/net/bonding/bond_main.c52
-rw-r--r--drivers/net/cxgb3/cxgb3_main.c1
-rw-r--r--drivers/net/e100.c1
-rw-r--r--drivers/net/e1000/e1000_ethtool.c1
-rw-r--r--drivers/net/forcedeth.c1
-rw-r--r--drivers/net/ixgb/ixgb_ethtool.c1
-rw-r--r--drivers/net/loopback.c7
-rw-r--r--drivers/net/ne2k-pci.c1
-rw-r--r--drivers/net/netxen/netxen_nic_ethtool.c1
-rw-r--r--drivers/net/pcnet32.c1
-rw-r--r--drivers/net/pppoe.c37
-rw-r--r--drivers/net/pppox.c11
-rwxr-xr-xdrivers/net/qla3xxx.c1
-rw-r--r--drivers/net/r8169.c1
-rw-r--r--drivers/net/sc92031.c1
-rw-r--r--drivers/net/skge.c1
-rw-r--r--drivers/net/sky2.c1
-rw-r--r--drivers/net/sundance.c1
-rw-r--r--drivers/net/sunvnet.c1
-rw-r--r--drivers/net/tc35815.c1
-rw-r--r--drivers/net/tg3.c1
-rw-r--r--drivers/net/via-rhine.c1
30 files changed, 42 insertions, 118 deletions
diff --git a/drivers/dma/iovlock.c b/drivers/dma/iovlock.c
index d637555a833b..e763d723e4cf 100644
--- a/drivers/dma/iovlock.c
+++ b/drivers/dma/iovlock.c
@@ -143,29 +143,6 @@ void dma_unpin_iovec_pages(struct dma_pinned_list *pinned_list)
143 kfree(pinned_list); 143 kfree(pinned_list);
144} 144}
145 145
146static dma_cookie_t dma_memcpy_to_kernel_iovec(struct dma_chan *chan, struct
147 iovec *iov, unsigned char *kdata, size_t len)
148{
149 dma_cookie_t dma_cookie = 0;
150
151 while (len > 0) {
152 if (iov->iov_len) {
153 int copy = min_t(unsigned int, iov->iov_len, len);
154 dma_cookie = dma_async_memcpy_buf_to_buf(
155 chan,
156 iov->iov_base,
157 kdata,
158 copy);
159 kdata += copy;
160 len -= copy;
161 iov->iov_len -= copy;
162 iov->iov_base += copy;
163 }
164 iov++;
165 }
166
167 return dma_cookie;
168}
169 146
170/* 147/*
171 * We have already pinned down the pages we will be using in the iovecs. 148 * We have already pinned down the pages we will be using in the iovecs.
@@ -187,10 +164,6 @@ dma_cookie_t dma_memcpy_to_iovec(struct dma_chan *chan, struct iovec *iov,
187 if (!chan) 164 if (!chan)
188 return memcpy_toiovec(iov, kdata, len); 165 return memcpy_toiovec(iov, kdata, len);
189 166
190 /* -> kernel copies (e.g. smbfs) */
191 if (!pinned_list)
192 return dma_memcpy_to_kernel_iovec(chan, iov, kdata, len);
193
194 iovec_idx = 0; 167 iovec_idx = 0;
195 while (iovec_idx < pinned_list->nr_iovecs) { 168 while (iovec_idx < pinned_list->nr_iovecs) {
196 struct dma_page_list *page_list; 169 struct dma_page_list *page_list;
diff --git a/drivers/net/3c59x.c b/drivers/net/3c59x.c
index 6deb20fc7a08..001c66dd3a94 100644
--- a/drivers/net/3c59x.c
+++ b/drivers/net/3c59x.c
@@ -2886,7 +2886,6 @@ static const struct ethtool_ops vortex_ethtool_ops = {
2886 .set_settings = vortex_set_settings, 2886 .set_settings = vortex_set_settings,
2887 .get_link = ethtool_op_get_link, 2887 .get_link = ethtool_op_get_link,
2888 .nway_reset = vortex_nway_reset, 2888 .nway_reset = vortex_nway_reset,
2889 .get_perm_addr = ethtool_op_get_perm_addr,
2890}; 2889};
2891 2890
2892#ifdef CONFIG_PCI 2891#ifdef CONFIG_PCI
diff --git a/drivers/net/8139cp.c b/drivers/net/8139cp.c
index e970e64bf966..a79f28c7a100 100644
--- a/drivers/net/8139cp.c
+++ b/drivers/net/8139cp.c
@@ -1578,7 +1578,6 @@ static const struct ethtool_ops cp_ethtool_ops = {
1578 .set_wol = cp_set_wol, 1578 .set_wol = cp_set_wol,
1579 .get_strings = cp_get_strings, 1579 .get_strings = cp_get_strings,
1580 .get_ethtool_stats = cp_get_ethtool_stats, 1580 .get_ethtool_stats = cp_get_ethtool_stats,
1581 .get_perm_addr = ethtool_op_get_perm_addr,
1582 .get_eeprom_len = cp_get_eeprom_len, 1581 .get_eeprom_len = cp_get_eeprom_len,
1583 .get_eeprom = cp_get_eeprom, 1582 .get_eeprom = cp_get_eeprom,
1584 .set_eeprom = cp_set_eeprom, 1583 .set_eeprom = cp_set_eeprom,
diff --git a/drivers/net/8139too.c b/drivers/net/8139too.c
index 327eaa7b4999..f4e4298d24b9 100644
--- a/drivers/net/8139too.c
+++ b/drivers/net/8139too.c
@@ -2452,7 +2452,6 @@ static const struct ethtool_ops rtl8139_ethtool_ops = {
2452 .get_strings = rtl8139_get_strings, 2452 .get_strings = rtl8139_get_strings,
2453 .get_stats_count = rtl8139_get_stats_count, 2453 .get_stats_count = rtl8139_get_stats_count,
2454 .get_ethtool_stats = rtl8139_get_ethtool_stats, 2454 .get_ethtool_stats = rtl8139_get_ethtool_stats,
2455 .get_perm_addr = ethtool_op_get_perm_addr,
2456}; 2455};
2457 2456
2458static int netdev_ioctl(struct net_device *dev, struct ifreq *rq, int cmd) 2457static int netdev_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
diff --git a/drivers/net/Kconfig b/drivers/net/Kconfig
index f8a602caabcb..81ef81c9a584 100644
--- a/drivers/net/Kconfig
+++ b/drivers/net/Kconfig
@@ -2851,7 +2851,7 @@ config PPPOATM
2851 2851
2852config PPPOL2TP 2852config PPPOL2TP
2853 tristate "PPP over L2TP (EXPERIMENTAL)" 2853 tristate "PPP over L2TP (EXPERIMENTAL)"
2854 depends on EXPERIMENTAL && PPP 2854 depends on EXPERIMENTAL && PPP && INET
2855 help 2855 help
2856 Support for PPP-over-L2TP socket family. L2TP is a protocol 2856 Support for PPP-over-L2TP socket family. L2TP is a protocol
2857 used by ISPs and enterprises to tunnel PPP traffic over UDP 2857 used by ISPs and enterprises to tunnel PPP traffic over UDP
diff --git a/drivers/net/ax88796.c b/drivers/net/ax88796.c
index e43e8047b90e..83da1770bafb 100644
--- a/drivers/net/ax88796.c
+++ b/drivers/net/ax88796.c
@@ -580,7 +580,6 @@ static const struct ethtool_ops ax_ethtool_ops = {
580 .set_settings = ax_set_settings, 580 .set_settings = ax_set_settings,
581 .nway_reset = ax_nway_reset, 581 .nway_reset = ax_nway_reset,
582 .get_link = ax_get_link, 582 .get_link = ax_get_link,
583 .get_perm_addr = ethtool_op_get_perm_addr,
584}; 583};
585 584
586/* setup code */ 585/* setup code */
diff --git a/drivers/net/b44.c b/drivers/net/b44.c
index 37f1b6ff5c12..0795df235492 100644
--- a/drivers/net/b44.c
+++ b/drivers/net/b44.c
@@ -2033,7 +2033,6 @@ static const struct ethtool_ops b44_ethtool_ops = {
2033 .get_strings = b44_get_strings, 2033 .get_strings = b44_get_strings,
2034 .get_stats_count = b44_get_stats_count, 2034 .get_stats_count = b44_get_stats_count,
2035 .get_ethtool_stats = b44_get_ethtool_stats, 2035 .get_ethtool_stats = b44_get_ethtool_stats,
2036 .get_perm_addr = ethtool_op_get_perm_addr,
2037}; 2036};
2038 2037
2039static int b44_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd) 2038static int b44_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
diff --git a/drivers/net/bnx2.c b/drivers/net/bnx2.c
index a729da061bbb..d53dfc5bbae0 100644
--- a/drivers/net/bnx2.c
+++ b/drivers/net/bnx2.c
@@ -6269,7 +6269,6 @@ static const struct ethtool_ops bnx2_ethtool_ops = {
6269 .phys_id = bnx2_phys_id, 6269 .phys_id = bnx2_phys_id,
6270 .get_stats_count = bnx2_get_stats_count, 6270 .get_stats_count = bnx2_get_stats_count,
6271 .get_ethtool_stats = bnx2_get_ethtool_stats, 6271 .get_ethtool_stats = bnx2_get_ethtool_stats,
6272 .get_perm_addr = ethtool_op_get_perm_addr,
6273}; 6272};
6274 6273
6275/* Called with rtnl_lock */ 6274/* Called with rtnl_lock */
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
index cb9cb3013f42..070b78d959cc 100644
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -613,38 +613,20 @@ down:
613static int bond_update_speed_duplex(struct slave *slave) 613static int bond_update_speed_duplex(struct slave *slave)
614{ 614{
615 struct net_device *slave_dev = slave->dev; 615 struct net_device *slave_dev = slave->dev;
616 static int (* ioctl)(struct net_device *, struct ifreq *, int);
617 struct ifreq ifr;
618 struct ethtool_cmd etool; 616 struct ethtool_cmd etool;
617 int res;
619 618
620 /* Fake speed and duplex */ 619 /* Fake speed and duplex */
621 slave->speed = SPEED_100; 620 slave->speed = SPEED_100;
622 slave->duplex = DUPLEX_FULL; 621 slave->duplex = DUPLEX_FULL;
623 622
624 if (slave_dev->ethtool_ops) { 623 if (!slave_dev->ethtool_ops || !slave_dev->ethtool_ops->get_settings)
625 int res; 624 return -1;
626
627 if (!slave_dev->ethtool_ops->get_settings) {
628 return -1;
629 }
630
631 res = slave_dev->ethtool_ops->get_settings(slave_dev, &etool);
632 if (res < 0) {
633 return -1;
634 }
635
636 goto verify;
637 }
638 625
639 ioctl = slave_dev->do_ioctl; 626 res = slave_dev->ethtool_ops->get_settings(slave_dev, &etool);
640 strncpy(ifr.ifr_name, slave_dev->name, IFNAMSIZ); 627 if (res < 0)
641 etool.cmd = ETHTOOL_GSET;
642 ifr.ifr_data = (char*)&etool;
643 if (!ioctl || (IOCTL(slave_dev, &ifr, SIOCETHTOOL) < 0)) {
644 return -1; 628 return -1;
645 }
646 629
647verify:
648 switch (etool.speed) { 630 switch (etool.speed) {
649 case SPEED_10: 631 case SPEED_10:
650 case SPEED_100: 632 case SPEED_100:
@@ -690,7 +672,6 @@ static int bond_check_dev_link(struct bonding *bond, struct net_device *slave_de
690 static int (* ioctl)(struct net_device *, struct ifreq *, int); 672 static int (* ioctl)(struct net_device *, struct ifreq *, int);
691 struct ifreq ifr; 673 struct ifreq ifr;
692 struct mii_ioctl_data *mii; 674 struct mii_ioctl_data *mii;
693 struct ethtool_value etool;
694 675
695 if (bond->params.use_carrier) { 676 if (bond->params.use_carrier) {
696 return netif_carrier_ok(slave_dev) ? BMSR_LSTATUS : 0; 677 return netif_carrier_ok(slave_dev) ? BMSR_LSTATUS : 0;
@@ -721,9 +702,10 @@ static int bond_check_dev_link(struct bonding *bond, struct net_device *slave_de
721 } 702 }
722 } 703 }
723 704
724 /* try SIOCETHTOOL ioctl, some drivers cache ETHTOOL_GLINK */ 705 /*
725 /* for a period of time so we attempt to get link status */ 706 * Some drivers cache ETHTOOL_GLINK for a period of time so we only
726 /* from it last if the above MII ioctls fail... */ 707 * attempt to get link status from it if the above MII ioctls fail.
708 */
727 if (slave_dev->ethtool_ops) { 709 if (slave_dev->ethtool_ops) {
728 if (slave_dev->ethtool_ops->get_link) { 710 if (slave_dev->ethtool_ops->get_link) {
729 u32 link; 711 u32 link;
@@ -734,23 +716,9 @@ static int bond_check_dev_link(struct bonding *bond, struct net_device *slave_de
734 } 716 }
735 } 717 }
736 718
737 if (ioctl) {
738 strncpy(ifr.ifr_name, slave_dev->name, IFNAMSIZ);
739 etool.cmd = ETHTOOL_GLINK;
740 ifr.ifr_data = (char*)&etool;
741 if (IOCTL(slave_dev, &ifr, SIOCETHTOOL) == 0) {
742 if (etool.data == 1) {
743 return BMSR_LSTATUS;
744 } else {
745 dprintk("SIOCETHTOOL shows link down\n");
746 return 0;
747 }
748 }
749 }
750
751 /* 719 /*
752 * If reporting, report that either there's no dev->do_ioctl, 720 * If reporting, report that either there's no dev->do_ioctl,
753 * or both SIOCGMIIREG and SIOCETHTOOL failed (meaning that we 721 * or both SIOCGMIIREG and get_link failed (meaning that we
754 * cannot report link status). If not reporting, pretend 722 * cannot report link status). If not reporting, pretend
755 * we're ok. 723 * we're ok.
756 */ 724 */
diff --git a/drivers/net/cxgb3/cxgb3_main.c b/drivers/net/cxgb3/cxgb3_main.c
index 6fd1e5241833..dc5d26988bb3 100644
--- a/drivers/net/cxgb3/cxgb3_main.c
+++ b/drivers/net/cxgb3/cxgb3_main.c
@@ -1583,7 +1583,6 @@ static const struct ethtool_ops cxgb_ethtool_ops = {
1583 .get_wol = get_wol, 1583 .get_wol = get_wol,
1584 .get_tso = ethtool_op_get_tso, 1584 .get_tso = ethtool_op_get_tso,
1585 .set_tso = ethtool_op_set_tso, 1585 .set_tso = ethtool_op_set_tso,
1586 .get_perm_addr = ethtool_op_get_perm_addr
1587}; 1586};
1588 1587
1589static int in_range(int val, int lo, int hi) 1588static int in_range(int val, int lo, int hi)
diff --git a/drivers/net/e100.c b/drivers/net/e100.c
index 6b6401e9304e..280313b9b069 100644
--- a/drivers/net/e100.c
+++ b/drivers/net/e100.c
@@ -2506,7 +2506,6 @@ static const struct ethtool_ops e100_ethtool_ops = {
2506 .phys_id = e100_phys_id, 2506 .phys_id = e100_phys_id,
2507 .get_stats_count = e100_get_stats_count, 2507 .get_stats_count = e100_get_stats_count,
2508 .get_ethtool_stats = e100_get_ethtool_stats, 2508 .get_ethtool_stats = e100_get_ethtool_stats,
2509 .get_perm_addr = ethtool_op_get_perm_addr,
2510}; 2509};
2511 2510
2512static int e100_do_ioctl(struct net_device *netdev, struct ifreq *ifr, int cmd) 2511static int e100_do_ioctl(struct net_device *netdev, struct ifreq *ifr, int cmd)
diff --git a/drivers/net/e1000/e1000_ethtool.c b/drivers/net/e1000/e1000_ethtool.c
index bb08375b5f13..c90c92e72d2a 100644
--- a/drivers/net/e1000/e1000_ethtool.c
+++ b/drivers/net/e1000/e1000_ethtool.c
@@ -1973,7 +1973,6 @@ static const struct ethtool_ops e1000_ethtool_ops = {
1973 .phys_id = e1000_phys_id, 1973 .phys_id = e1000_phys_id,
1974 .get_stats_count = e1000_get_stats_count, 1974 .get_stats_count = e1000_get_stats_count,
1975 .get_ethtool_stats = e1000_get_ethtool_stats, 1975 .get_ethtool_stats = e1000_get_ethtool_stats,
1976 .get_perm_addr = ethtool_op_get_perm_addr,
1977}; 1976};
1978 1977
1979void e1000_set_ethtool_ops(struct net_device *netdev) 1978void e1000_set_ethtool_ops(struct net_device *netdev)
diff --git a/drivers/net/forcedeth.c b/drivers/net/forcedeth.c
index 51e1cb472738..69f5f365239a 100644
--- a/drivers/net/forcedeth.c
+++ b/drivers/net/forcedeth.c
@@ -4707,7 +4707,6 @@ static const struct ethtool_ops ops = {
4707 .get_regs_len = nv_get_regs_len, 4707 .get_regs_len = nv_get_regs_len,
4708 .get_regs = nv_get_regs, 4708 .get_regs = nv_get_regs,
4709 .nway_reset = nv_nway_reset, 4709 .nway_reset = nv_nway_reset,
4710 .get_perm_addr = ethtool_op_get_perm_addr,
4711 .get_tso = ethtool_op_get_tso, 4710 .get_tso = ethtool_op_get_tso,
4712 .set_tso = nv_set_tso, 4711 .set_tso = nv_set_tso,
4713 .get_ringparam = nv_get_ringparam, 4712 .get_ringparam = nv_get_ringparam,
diff --git a/drivers/net/ixgb/ixgb_ethtool.c b/drivers/net/ixgb/ixgb_ethtool.c
index afde84868bea..0413cd95eda7 100644
--- a/drivers/net/ixgb/ixgb_ethtool.c
+++ b/drivers/net/ixgb/ixgb_ethtool.c
@@ -724,7 +724,6 @@ static const struct ethtool_ops ixgb_ethtool_ops = {
724 .phys_id = ixgb_phys_id, 724 .phys_id = ixgb_phys_id,
725 .get_stats_count = ixgb_get_stats_count, 725 .get_stats_count = ixgb_get_stats_count,
726 .get_ethtool_stats = ixgb_get_ethtool_stats, 726 .get_ethtool_stats = ixgb_get_ethtool_stats,
727 .get_perm_addr = ethtool_op_get_perm_addr,
728}; 727};
729 728
730void ixgb_set_ethtool_ops(struct net_device *netdev) 729void ixgb_set_ethtool_ops(struct net_device *netdev)
diff --git a/drivers/net/loopback.c b/drivers/net/loopback.c
index 6ba6ed2b480a..5106c2328d12 100644
--- a/drivers/net/loopback.c
+++ b/drivers/net/loopback.c
@@ -229,7 +229,12 @@ struct net_device loopback_dev = {
229/* Setup and register the loopback device. */ 229/* Setup and register the loopback device. */
230static int __init loopback_init(void) 230static int __init loopback_init(void)
231{ 231{
232 return register_netdev(&loopback_dev); 232 int err = register_netdev(&loopback_dev);
233
234 if (err)
235 panic("loopback: Failed to register netdevice: %d\n", err);
236
237 return err;
233}; 238};
234 239
235module_init(loopback_init); 240module_init(loopback_init);
diff --git a/drivers/net/ne2k-pci.c b/drivers/net/ne2k-pci.c
index cfdeaf7aa163..f81d9398d605 100644
--- a/drivers/net/ne2k-pci.c
+++ b/drivers/net/ne2k-pci.c
@@ -638,7 +638,6 @@ static const struct ethtool_ops ne2k_pci_ethtool_ops = {
638 .get_drvinfo = ne2k_pci_get_drvinfo, 638 .get_drvinfo = ne2k_pci_get_drvinfo,
639 .get_tx_csum = ethtool_op_get_tx_csum, 639 .get_tx_csum = ethtool_op_get_tx_csum,
640 .get_sg = ethtool_op_get_sg, 640 .get_sg = ethtool_op_get_sg,
641 .get_perm_addr = ethtool_op_get_perm_addr,
642}; 641};
643 642
644static void __devexit ne2k_pci_remove_one (struct pci_dev *pdev) 643static void __devexit ne2k_pci_remove_one (struct pci_dev *pdev)
diff --git a/drivers/net/netxen/netxen_nic_ethtool.c b/drivers/net/netxen/netxen_nic_ethtool.c
index 0175f6c353f6..a6138b474b4a 100644
--- a/drivers/net/netxen/netxen_nic_ethtool.c
+++ b/drivers/net/netxen/netxen_nic_ethtool.c
@@ -755,5 +755,4 @@ struct ethtool_ops netxen_nic_ethtool_ops = {
755 .get_strings = netxen_nic_get_strings, 755 .get_strings = netxen_nic_get_strings,
756 .get_stats_count = netxen_nic_get_stats_count, 756 .get_stats_count = netxen_nic_get_stats_count,
757 .get_ethtool_stats = netxen_nic_get_ethtool_stats, 757 .get_ethtool_stats = netxen_nic_get_ethtool_stats,
758 .get_perm_addr = ethtool_op_get_perm_addr,
759}; 758};
diff --git a/drivers/net/pcnet32.c b/drivers/net/pcnet32.c
index 465485a3fbc6..e6a67531de99 100644
--- a/drivers/net/pcnet32.c
+++ b/drivers/net/pcnet32.c
@@ -1515,7 +1515,6 @@ static const struct ethtool_ops pcnet32_ethtool_ops = {
1515 .phys_id = pcnet32_phys_id, 1515 .phys_id = pcnet32_phys_id,
1516 .get_regs_len = pcnet32_get_regs_len, 1516 .get_regs_len = pcnet32_get_regs_len,
1517 .get_regs = pcnet32_get_regs, 1517 .get_regs = pcnet32_get_regs,
1518 .get_perm_addr = ethtool_op_get_perm_addr,
1519}; 1518};
1520 1519
1521/* only probes for non-PCI devices, the rest are handled by 1520/* only probes for non-PCI devices, the rest are handled by
diff --git a/drivers/net/pppoe.c b/drivers/net/pppoe.c
index 6f98834e6ace..68631a5721ac 100644
--- a/drivers/net/pppoe.c
+++ b/drivers/net/pppoe.c
@@ -108,19 +108,24 @@ static inline int cmp_addr(struct pppoe_addr *a, unsigned long sid, char *addr)
108 (memcmp(a->remote,addr,ETH_ALEN) == 0)); 108 (memcmp(a->remote,addr,ETH_ALEN) == 0));
109} 109}
110 110
111static int hash_item(unsigned long sid, unsigned char *addr) 111#if 8%PPPOE_HASH_BITS
112#error 8 must be a multiple of PPPOE_HASH_BITS
113#endif
114
115static int hash_item(unsigned int sid, unsigned char *addr)
112{ 116{
113 char hash = 0; 117 unsigned char hash = 0;
114 int i, j; 118 unsigned int i;
115 119
116 for (i = 0; i < ETH_ALEN ; ++i) { 120 for (i = 0 ; i < ETH_ALEN ; i++) {
117 for (j = 0; j < 8/PPPOE_HASH_BITS ; ++j) { 121 hash ^= addr[i];
118 hash ^= addr[i] >> ( j * PPPOE_HASH_BITS ); 122 }
119 } 123 for (i = 0 ; i < sizeof(sid_t)*8 ; i += 8 ){
124 hash ^= sid>>i;
125 }
126 for (i = 8 ; (i>>=1) >= PPPOE_HASH_BITS ; ) {
127 hash ^= hash>>i;
120 } 128 }
121
122 for (i = 0; i < (sizeof(unsigned long)*8) / PPPOE_HASH_BITS ; ++i)
123 hash ^= sid >> (i*PPPOE_HASH_BITS);
124 129
125 return hash & ( PPPOE_HASH_SIZE - 1 ); 130 return hash & ( PPPOE_HASH_SIZE - 1 );
126} 131}
@@ -664,8 +669,8 @@ static int pppoe_ioctl(struct socket *sock, unsigned int cmd,
664{ 669{
665 struct sock *sk = sock->sk; 670 struct sock *sk = sock->sk;
666 struct pppox_sock *po = pppox_sk(sk); 671 struct pppox_sock *po = pppox_sk(sk);
667 int val = 0; 672 int val;
668 int err = 0; 673 int err;
669 674
670 switch (cmd) { 675 switch (cmd) {
671 case PPPIOCGMRU: 676 case PPPIOCGMRU:
@@ -754,8 +759,9 @@ static int pppoe_ioctl(struct socket *sock, unsigned int cmd,
754 err = 0; 759 err = 0;
755 break; 760 break;
756 761
757 default:; 762 default:
758 }; 763 err = -ENOTTY;
764 }
759 765
760 return err; 766 return err;
761} 767}
@@ -773,6 +779,7 @@ static int pppoe_sendmsg(struct kiocb *iocb, struct socket *sock,
773 struct net_device *dev; 779 struct net_device *dev;
774 char *start; 780 char *start;
775 781
782 lock_sock(sk);
776 if (sock_flag(sk, SOCK_DEAD) || !(sk->sk_state & PPPOX_CONNECTED)) { 783 if (sock_flag(sk, SOCK_DEAD) || !(sk->sk_state & PPPOX_CONNECTED)) {
777 error = -ENOTCONN; 784 error = -ENOTCONN;
778 goto end; 785 goto end;
@@ -783,8 +790,6 @@ static int pppoe_sendmsg(struct kiocb *iocb, struct socket *sock,
783 hdr.code = 0; 790 hdr.code = 0;
784 hdr.sid = po->num; 791 hdr.sid = po->num;
785 792
786 lock_sock(sk);
787
788 dev = po->pppoe_dev; 793 dev = po->pppoe_dev;
789 794
790 error = -EMSGSIZE; 795 error = -EMSGSIZE;
diff --git a/drivers/net/pppox.c b/drivers/net/pppox.c
index f3e47d0c2b3c..25c52b55c38f 100644
--- a/drivers/net/pppox.c
+++ b/drivers/net/pppox.c
@@ -73,7 +73,7 @@ int pppox_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)
73{ 73{
74 struct sock *sk = sock->sk; 74 struct sock *sk = sock->sk;
75 struct pppox_sock *po = pppox_sk(sk); 75 struct pppox_sock *po = pppox_sk(sk);
76 int rc = 0; 76 int rc;
77 77
78 lock_sock(sk); 78 lock_sock(sk);
79 79
@@ -94,12 +94,9 @@ int pppox_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)
94 break; 94 break;
95 } 95 }
96 default: 96 default:
97 if (pppox_protos[sk->sk_protocol]->ioctl) 97 rc = pppox_protos[sk->sk_protocol]->ioctl ?
98 rc = pppox_protos[sk->sk_protocol]->ioctl(sock, cmd, 98 pppox_protos[sk->sk_protocol]->ioctl(sock, cmd, arg) : -ENOTTY;
99 arg); 99 }
100
101 break;
102 };
103 100
104 release_sock(sk); 101 release_sock(sk);
105 return rc; 102 return rc;
diff --git a/drivers/net/qla3xxx.c b/drivers/net/qla3xxx.c
index 8be8be451ada..69da95b5ad0c 100755
--- a/drivers/net/qla3xxx.c
+++ b/drivers/net/qla3xxx.c
@@ -1904,7 +1904,6 @@ static void ql_get_pauseparam(struct net_device *ndev,
1904static const struct ethtool_ops ql3xxx_ethtool_ops = { 1904static const struct ethtool_ops ql3xxx_ethtool_ops = {
1905 .get_settings = ql_get_settings, 1905 .get_settings = ql_get_settings,
1906 .get_drvinfo = ql_get_drvinfo, 1906 .get_drvinfo = ql_get_drvinfo,
1907 .get_perm_addr = ethtool_op_get_perm_addr,
1908 .get_link = ethtool_op_get_link, 1907 .get_link = ethtool_op_get_link,
1909 .get_msglevel = ql_get_msglevel, 1908 .get_msglevel = ql_get_msglevel,
1910 .set_msglevel = ql_set_msglevel, 1909 .set_msglevel = ql_set_msglevel,
diff --git a/drivers/net/r8169.c b/drivers/net/r8169.c
index bb6896ae3151..c9333b9dd51a 100644
--- a/drivers/net/r8169.c
+++ b/drivers/net/r8169.c
@@ -1066,7 +1066,6 @@ static const struct ethtool_ops rtl8169_ethtool_ops = {
1066 .get_strings = rtl8169_get_strings, 1066 .get_strings = rtl8169_get_strings,
1067 .get_stats_count = rtl8169_get_stats_count, 1067 .get_stats_count = rtl8169_get_stats_count,
1068 .get_ethtool_stats = rtl8169_get_ethtool_stats, 1068 .get_ethtool_stats = rtl8169_get_ethtool_stats,
1069 .get_perm_addr = ethtool_op_get_perm_addr,
1070}; 1069};
1071 1070
1072static void rtl8169_write_gmii_reg_bit(void __iomem *ioaddr, int reg, 1071static void rtl8169_write_gmii_reg_bit(void __iomem *ioaddr, int reg,
diff --git a/drivers/net/sc92031.c b/drivers/net/sc92031.c
index 5b7284c955dc..872cb1cc9c41 100644
--- a/drivers/net/sc92031.c
+++ b/drivers/net/sc92031.c
@@ -1402,7 +1402,6 @@ static struct ethtool_ops sc92031_ethtool_ops = {
1402 .get_strings = sc92031_ethtool_get_strings, 1402 .get_strings = sc92031_ethtool_get_strings,
1403 .get_stats_count = sc92031_ethtool_get_stats_count, 1403 .get_stats_count = sc92031_ethtool_get_stats_count,
1404 .get_ethtool_stats = sc92031_ethtool_get_ethtool_stats, 1404 .get_ethtool_stats = sc92031_ethtool_get_ethtool_stats,
1405 .get_perm_addr = ethtool_op_get_perm_addr,
1406 .get_ufo = ethtool_op_get_ufo, 1405 .get_ufo = ethtool_op_get_ufo,
1407}; 1406};
1408 1407
diff --git a/drivers/net/skge.c b/drivers/net/skge.c
index 776692946562..e3d8520209b8 100644
--- a/drivers/net/skge.c
+++ b/drivers/net/skge.c
@@ -821,7 +821,6 @@ static const struct ethtool_ops skge_ethtool_ops = {
821 .phys_id = skge_phys_id, 821 .phys_id = skge_phys_id,
822 .get_stats_count = skge_get_stats_count, 822 .get_stats_count = skge_get_stats_count,
823 .get_ethtool_stats = skge_get_ethtool_stats, 823 .get_ethtool_stats = skge_get_ethtool_stats,
824 .get_perm_addr = ethtool_op_get_perm_addr,
825}; 824};
826 825
827/* 826/*
diff --git a/drivers/net/sky2.c b/drivers/net/sky2.c
index 13f08a390e1f..e7a2eadcc3b0 100644
--- a/drivers/net/sky2.c
+++ b/drivers/net/sky2.c
@@ -3548,7 +3548,6 @@ static const struct ethtool_ops sky2_ethtool_ops = {
3548 .phys_id = sky2_phys_id, 3548 .phys_id = sky2_phys_id,
3549 .get_stats_count = sky2_get_stats_count, 3549 .get_stats_count = sky2_get_stats_count,
3550 .get_ethtool_stats = sky2_get_ethtool_stats, 3550 .get_ethtool_stats = sky2_get_ethtool_stats,
3551 .get_perm_addr = ethtool_op_get_perm_addr,
3552}; 3551};
3553 3552
3554#ifdef CONFIG_SKY2_DEBUG 3553#ifdef CONFIG_SKY2_DEBUG
diff --git a/drivers/net/sundance.c b/drivers/net/sundance.c
index af0c9831074c..a8f2af8f778a 100644
--- a/drivers/net/sundance.c
+++ b/drivers/net/sundance.c
@@ -1586,7 +1586,6 @@ static const struct ethtool_ops ethtool_ops = {
1586 .get_link = get_link, 1586 .get_link = get_link,
1587 .get_msglevel = get_msglevel, 1587 .get_msglevel = get_msglevel,
1588 .set_msglevel = set_msglevel, 1588 .set_msglevel = set_msglevel,
1589 .get_perm_addr = ethtool_op_get_perm_addr,
1590}; 1589};
1591 1590
1592static int netdev_ioctl(struct net_device *dev, struct ifreq *rq, int cmd) 1591static int netdev_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
diff --git a/drivers/net/sunvnet.c b/drivers/net/sunvnet.c
index 61f98251feab..ff1028a597df 100644
--- a/drivers/net/sunvnet.c
+++ b/drivers/net/sunvnet.c
@@ -906,7 +906,6 @@ static const struct ethtool_ops vnet_ethtool_ops = {
906 .get_msglevel = vnet_get_msglevel, 906 .get_msglevel = vnet_get_msglevel,
907 .set_msglevel = vnet_set_msglevel, 907 .set_msglevel = vnet_set_msglevel,
908 .get_link = ethtool_op_get_link, 908 .get_link = ethtool_op_get_link,
909 .get_perm_addr = ethtool_op_get_perm_addr,
910}; 909};
911 910
912static void vnet_port_free_tx_bufs(struct vnet_port *port) 911static void vnet_port_free_tx_bufs(struct vnet_port *port)
diff --git a/drivers/net/tc35815.c b/drivers/net/tc35815.c
index 7f94ca930988..ec41469eee82 100644
--- a/drivers/net/tc35815.c
+++ b/drivers/net/tc35815.c
@@ -2198,7 +2198,6 @@ static const struct ethtool_ops tc35815_ethtool_ops = {
2198 .get_strings = tc35815_get_strings, 2198 .get_strings = tc35815_get_strings,
2199 .get_stats_count = tc35815_get_stats_count, 2199 .get_stats_count = tc35815_get_stats_count,
2200 .get_ethtool_stats = tc35815_get_ethtool_stats, 2200 .get_ethtool_stats = tc35815_get_ethtool_stats,
2201 .get_perm_addr = ethtool_op_get_perm_addr,
2202}; 2201};
2203 2202
2204static int tc35815_ioctl(struct net_device *dev, struct ifreq *rq, int cmd) 2203static int tc35815_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
index 887b9a5cfe48..dc41c055ebb5 100644
--- a/drivers/net/tg3.c
+++ b/drivers/net/tg3.c
@@ -9294,7 +9294,6 @@ static const struct ethtool_ops tg3_ethtool_ops = {
9294 .get_ethtool_stats = tg3_get_ethtool_stats, 9294 .get_ethtool_stats = tg3_get_ethtool_stats,
9295 .get_coalesce = tg3_get_coalesce, 9295 .get_coalesce = tg3_get_coalesce,
9296 .set_coalesce = tg3_set_coalesce, 9296 .set_coalesce = tg3_set_coalesce,
9297 .get_perm_addr = ethtool_op_get_perm_addr,
9298}; 9297};
9299 9298
9300static void __devinit tg3_get_eeprom_size(struct tg3 *tp) 9299static void __devinit tg3_get_eeprom_size(struct tg3 *tp)
diff --git a/drivers/net/via-rhine.c b/drivers/net/via-rhine.c
index f51c2c138f10..c3fe230695a0 100644
--- a/drivers/net/via-rhine.c
+++ b/drivers/net/via-rhine.c
@@ -1805,7 +1805,6 @@ static const struct ethtool_ops netdev_ethtool_ops = {
1805 .set_wol = rhine_set_wol, 1805 .set_wol = rhine_set_wol,
1806 .get_sg = ethtool_op_get_sg, 1806 .get_sg = ethtool_op_get_sg,
1807 .get_tx_csum = ethtool_op_get_tx_csum, 1807 .get_tx_csum = ethtool_op_get_tx_csum,
1808 .get_perm_addr = ethtool_op_get_perm_addr,
1809}; 1808};
1810 1809
1811static int netdev_ioctl(struct net_device *dev, struct ifreq *rq, int cmd) 1810static int netdev_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)