aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2008-10-13 13:08:08 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2008-10-13 13:08:08 -0400
commitfffdedef691a0f6fa7ca1fc0a2a508cbb49def69 (patch)
tree124b128308a4d35bab0ac8001da4b324d40220eb /drivers/net
parent5723ff931a94acf0738df42604ee89f852e151b0 (diff)
parentbf94e17bc8d35fc339945a42990a2f2b5e9b5a40 (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6: net/mac80211/rx.c: fix build error acpi: Make ACPI_TOSHIBA depend on INPUT. net/bfin_mac.c MDIO namespace fixes jme: remove unused #include <version.h> netfilter: remove unused #include <version.h> net: Fix off-by-one in skb_dma_map smc911x: Add support for LAN921{5,7,8} chips from SMSC qlge: remove duplicated #include wireless: remove duplicated #include net/au1000_eth.c MDIO namespace fixes net/tc35815.c: fix compilation sky2: Fix WOL regression r8169: NULL pointer dereference on r8169 load
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/au1000_eth.c27
-rw-r--r--drivers/net/bfin_mac.c26
-rw-r--r--drivers/net/jme.c1
-rw-r--r--drivers/net/qlge/qlge_ethtool.c1
-rw-r--r--drivers/net/qlge/qlge_main.c1
-rw-r--r--drivers/net/r8169.c3
-rw-r--r--drivers/net/sky2.c19
-rw-r--r--drivers/net/smc911x.c6
-rw-r--r--drivers/net/smc911x.h14
-rw-r--r--drivers/net/tc35815.c2
10 files changed, 49 insertions, 51 deletions
diff --git a/drivers/net/au1000_eth.c b/drivers/net/au1000_eth.c
index 7b92201a7b50..019b13c08ae6 100644
--- a/drivers/net/au1000_eth.c
+++ b/drivers/net/au1000_eth.c
@@ -94,8 +94,8 @@ static irqreturn_t au1000_interrupt(int, void *);
94static void au1000_tx_timeout(struct net_device *); 94static void au1000_tx_timeout(struct net_device *);
95static void set_rx_mode(struct net_device *); 95static void set_rx_mode(struct net_device *);
96static int au1000_ioctl(struct net_device *, struct ifreq *, int); 96static int au1000_ioctl(struct net_device *, struct ifreq *, int);
97static int mdio_read(struct net_device *, int, int); 97static int au1000_mdio_read(struct net_device *, int, int);
98static void mdio_write(struct net_device *, int, int, u16); 98static void au1000_mdio_write(struct net_device *, int, int, u16);
99static void au1000_adjust_link(struct net_device *); 99static void au1000_adjust_link(struct net_device *);
100static void enable_mac(struct net_device *, int); 100static void enable_mac(struct net_device *, int);
101 101
@@ -191,7 +191,7 @@ struct au1000_private *au_macs[NUM_ETH_INTERFACES];
191/* 191/*
192 * MII operations 192 * MII operations
193 */ 193 */
194static int mdio_read(struct net_device *dev, int phy_addr, int reg) 194static int au1000_mdio_read(struct net_device *dev, int phy_addr, int reg)
195{ 195{
196 struct au1000_private *aup = (struct au1000_private *) dev->priv; 196 struct au1000_private *aup = (struct au1000_private *) dev->priv;
197 volatile u32 *const mii_control_reg = &aup->mac->mii_control; 197 volatile u32 *const mii_control_reg = &aup->mac->mii_control;
@@ -225,7 +225,8 @@ static int mdio_read(struct net_device *dev, int phy_addr, int reg)
225 return (int)*mii_data_reg; 225 return (int)*mii_data_reg;
226} 226}
227 227
228static void mdio_write(struct net_device *dev, int phy_addr, int reg, u16 value) 228static void au1000_mdio_write(struct net_device *dev, int phy_addr,
229 int reg, u16 value)
229{ 230{
230 struct au1000_private *aup = (struct au1000_private *) dev->priv; 231 struct au1000_private *aup = (struct au1000_private *) dev->priv;
231 volatile u32 *const mii_control_reg = &aup->mac->mii_control; 232 volatile u32 *const mii_control_reg = &aup->mac->mii_control;
@@ -249,7 +250,7 @@ static void mdio_write(struct net_device *dev, int phy_addr, int reg, u16 value)
249 *mii_control_reg = mii_control; 250 *mii_control_reg = mii_control;
250} 251}
251 252
252static int mdiobus_read(struct mii_bus *bus, int phy_addr, int regnum) 253static int au1000_mdiobus_read(struct mii_bus *bus, int phy_addr, int regnum)
253{ 254{
254 /* WARNING: bus->phy_map[phy_addr].attached_dev == dev does 255 /* WARNING: bus->phy_map[phy_addr].attached_dev == dev does
255 * _NOT_ hold (e.g. when PHY is accessed through other MAC's MII bus) */ 256 * _NOT_ hold (e.g. when PHY is accessed through other MAC's MII bus) */
@@ -257,21 +258,21 @@ static int mdiobus_read(struct mii_bus *bus, int phy_addr, int regnum)
257 258
258 enable_mac(dev, 0); /* make sure the MAC associated with this 259 enable_mac(dev, 0); /* make sure the MAC associated with this
259 * mii_bus is enabled */ 260 * mii_bus is enabled */
260 return mdio_read(dev, phy_addr, regnum); 261 return au1000_mdio_read(dev, phy_addr, regnum);
261} 262}
262 263
263static int mdiobus_write(struct mii_bus *bus, int phy_addr, int regnum, 264static int au1000_mdiobus_write(struct mii_bus *bus, int phy_addr, int regnum,
264 u16 value) 265 u16 value)
265{ 266{
266 struct net_device *const dev = bus->priv; 267 struct net_device *const dev = bus->priv;
267 268
268 enable_mac(dev, 0); /* make sure the MAC associated with this 269 enable_mac(dev, 0); /* make sure the MAC associated with this
269 * mii_bus is enabled */ 270 * mii_bus is enabled */
270 mdio_write(dev, phy_addr, regnum, value); 271 au1000_mdio_write(dev, phy_addr, regnum, value);
271 return 0; 272 return 0;
272} 273}
273 274
274static int mdiobus_reset(struct mii_bus *bus) 275static int au1000_mdiobus_reset(struct mii_bus *bus)
275{ 276{
276 struct net_device *const dev = bus->priv; 277 struct net_device *const dev = bus->priv;
277 278
@@ -703,9 +704,9 @@ static struct net_device * au1000_probe(int port_num)
703 goto err_out; 704 goto err_out;
704 705
705 aup->mii_bus->priv = dev; 706 aup->mii_bus->priv = dev;
706 aup->mii_bus->read = mdiobus_read; 707 aup->mii_bus->read = au1000_mdiobus_read;
707 aup->mii_bus->write = mdiobus_write; 708 aup->mii_bus->write = au1000_mdiobus_write;
708 aup->mii_bus->reset = mdiobus_reset; 709 aup->mii_bus->reset = au1000_mdiobus_reset;
709 aup->mii_bus->name = "au1000_eth_mii"; 710 aup->mii_bus->name = "au1000_eth_mii";
710 snprintf(aup->mii_bus->id, MII_BUS_ID_SIZE, "%x", aup->mac_id); 711 snprintf(aup->mii_bus->id, MII_BUS_ID_SIZE, "%x", aup->mac_id);
711 aup->mii_bus->irq = kmalloc(sizeof(int)*PHY_MAX_ADDR, GFP_KERNEL); 712 aup->mii_bus->irq = kmalloc(sizeof(int)*PHY_MAX_ADDR, GFP_KERNEL);
diff --git a/drivers/net/bfin_mac.c b/drivers/net/bfin_mac.c
index a0d41c5d97d8..b458d607a9c6 100644
--- a/drivers/net/bfin_mac.c
+++ b/drivers/net/bfin_mac.c
@@ -253,7 +253,7 @@ init_error:
253 * MII operations 253 * MII operations
254 */ 254 */
255/* Wait until the previous MDC/MDIO transaction has completed */ 255/* Wait until the previous MDC/MDIO transaction has completed */
256static void mdio_poll(void) 256static void bfin_mdio_poll(void)
257{ 257{
258 int timeout_cnt = MAX_TIMEOUT_CNT; 258 int timeout_cnt = MAX_TIMEOUT_CNT;
259 259
@@ -269,25 +269,25 @@ static void mdio_poll(void)
269} 269}
270 270
271/* Read an off-chip register in a PHY through the MDC/MDIO port */ 271/* Read an off-chip register in a PHY through the MDC/MDIO port */
272static int mdiobus_read(struct mii_bus *bus, int phy_addr, int regnum) 272static int bfin_mdiobus_read(struct mii_bus *bus, int phy_addr, int regnum)
273{ 273{
274 mdio_poll(); 274 bfin_mdio_poll();
275 275
276 /* read mode */ 276 /* read mode */
277 bfin_write_EMAC_STAADD(SET_PHYAD((u16) phy_addr) | 277 bfin_write_EMAC_STAADD(SET_PHYAD((u16) phy_addr) |
278 SET_REGAD((u16) regnum) | 278 SET_REGAD((u16) regnum) |
279 STABUSY); 279 STABUSY);
280 280
281 mdio_poll(); 281 bfin_mdio_poll();
282 282
283 return (int) bfin_read_EMAC_STADAT(); 283 return (int) bfin_read_EMAC_STADAT();
284} 284}
285 285
286/* Write an off-chip register in a PHY through the MDC/MDIO port */ 286/* Write an off-chip register in a PHY through the MDC/MDIO port */
287static int mdiobus_write(struct mii_bus *bus, int phy_addr, int regnum, 287static int bfin_mdiobus_write(struct mii_bus *bus, int phy_addr, int regnum,
288 u16 value) 288 u16 value)
289{ 289{
290 mdio_poll(); 290 bfin_mdio_poll();
291 291
292 bfin_write_EMAC_STADAT((u32) value); 292 bfin_write_EMAC_STADAT((u32) value);
293 293
@@ -297,12 +297,12 @@ static int mdiobus_write(struct mii_bus *bus, int phy_addr, int regnum,
297 STAOP | 297 STAOP |
298 STABUSY); 298 STABUSY);
299 299
300 mdio_poll(); 300 bfin_mdio_poll();
301 301
302 return 0; 302 return 0;
303} 303}
304 304
305static int mdiobus_reset(struct mii_bus *bus) 305static int bfin_mdiobus_reset(struct mii_bus *bus)
306{ 306{
307 return 0; 307 return 0;
308} 308}
@@ -818,7 +818,7 @@ static void bfin_mac_enable(void)
818 bfin_write_DMA1_CONFIG(rx_list_head->desc_a.config); 818 bfin_write_DMA1_CONFIG(rx_list_head->desc_a.config);
819 819
820 /* Wait MII done */ 820 /* Wait MII done */
821 mdio_poll(); 821 bfin_mdio_poll();
822 822
823 /* We enable only RX here */ 823 /* We enable only RX here */
824 /* ASTP : Enable Automatic Pad Stripping 824 /* ASTP : Enable Automatic Pad Stripping
@@ -1063,9 +1063,9 @@ static int __devinit bfin_mac_probe(struct platform_device *pdev)
1063 goto out_err_mdiobus_alloc; 1063 goto out_err_mdiobus_alloc;
1064 1064
1065 lp->mii_bus->priv = ndev; 1065 lp->mii_bus->priv = ndev;
1066 lp->mii_bus->read = mdiobus_read; 1066 lp->mii_bus->read = bfin_mdiobus_read;
1067 lp->mii_bus->write = mdiobus_write; 1067 lp->mii_bus->write = bfin_mdiobus_write;
1068 lp->mii_bus->reset = mdiobus_reset; 1068 lp->mii_bus->reset = bfin_mdiobus_reset;
1069 lp->mii_bus->name = "bfin_mac_mdio"; 1069 lp->mii_bus->name = "bfin_mac_mdio";
1070 snprintf(lp->mii_bus->id, MII_BUS_ID_SIZE, "0"); 1070 snprintf(lp->mii_bus->id, MII_BUS_ID_SIZE, "0");
1071 lp->mii_bus->irq = kmalloc(sizeof(int)*PHY_MAX_ADDR, GFP_KERNEL); 1071 lp->mii_bus->irq = kmalloc(sizeof(int)*PHY_MAX_ADDR, GFP_KERNEL);
diff --git a/drivers/net/jme.c b/drivers/net/jme.c
index 5f9a1313fa3e..156f159aafbb 100644
--- a/drivers/net/jme.c
+++ b/drivers/net/jme.c
@@ -21,7 +21,6 @@
21 * 21 *
22 */ 22 */
23 23
24#include <linux/version.h>
25#include <linux/module.h> 24#include <linux/module.h>
26#include <linux/kernel.h> 25#include <linux/kernel.h>
27#include <linux/pci.h> 26#include <linux/pci.h>
diff --git a/drivers/net/qlge/qlge_ethtool.c b/drivers/net/qlge/qlge_ethtool.c
index 6457f8c4fdaa..b62fbd4bf00f 100644
--- a/drivers/net/qlge/qlge_ethtool.c
+++ b/drivers/net/qlge/qlge_ethtool.c
@@ -29,7 +29,6 @@
29#include <linux/skbuff.h> 29#include <linux/skbuff.h>
30#include <linux/rtnetlink.h> 30#include <linux/rtnetlink.h>
31#include <linux/if_vlan.h> 31#include <linux/if_vlan.h>
32#include <linux/init.h>
33#include <linux/delay.h> 32#include <linux/delay.h>
34#include <linux/mm.h> 33#include <linux/mm.h>
35#include <linux/vmalloc.h> 34#include <linux/vmalloc.h>
diff --git a/drivers/net/qlge/qlge_main.c b/drivers/net/qlge/qlge_main.c
index 3af822b6226e..297877b68c46 100644
--- a/drivers/net/qlge/qlge_main.c
+++ b/drivers/net/qlge/qlge_main.c
@@ -36,7 +36,6 @@
36#include <linux/skbuff.h> 36#include <linux/skbuff.h>
37#include <linux/rtnetlink.h> 37#include <linux/rtnetlink.h>
38#include <linux/if_vlan.h> 38#include <linux/if_vlan.h>
39#include <linux/init.h>
40#include <linux/delay.h> 39#include <linux/delay.h>
41#include <linux/mm.h> 40#include <linux/mm.h>
42#include <linux/vmalloc.h> 41#include <linux/vmalloc.h>
diff --git a/drivers/net/r8169.c b/drivers/net/r8169.c
index bdae2c59a750..c821da21d8eb 100644
--- a/drivers/net/r8169.c
+++ b/drivers/net/r8169.c
@@ -2154,6 +2154,8 @@ rtl8169_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
2154 2154
2155 spin_lock_init(&tp->lock); 2155 spin_lock_init(&tp->lock);
2156 2156
2157 tp->mmio_addr = ioaddr;
2158
2157 rtl_init_mac_address(tp, ioaddr); 2159 rtl_init_mac_address(tp, ioaddr);
2158 2160
2159 /* Get MAC address */ 2161 /* Get MAC address */
@@ -2186,7 +2188,6 @@ rtl8169_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
2186#endif 2188#endif
2187 2189
2188 tp->intr_mask = 0xffff; 2190 tp->intr_mask = 0xffff;
2189 tp->mmio_addr = ioaddr;
2190 tp->align = cfg->align; 2191 tp->align = cfg->align;
2191 tp->hw_start = cfg->hw_start; 2192 tp->hw_start = cfg->hw_start;
2192 tp->intr_event = cfg->intr_event; 2193 tp->intr_event = cfg->intr_event;
diff --git a/drivers/net/sky2.c b/drivers/net/sky2.c
index 3805b9318be7..3813d15e2df7 100644
--- a/drivers/net/sky2.c
+++ b/drivers/net/sky2.c
@@ -3034,7 +3034,8 @@ static int sky2_set_wol(struct net_device *dev, struct ethtool_wolinfo *wol)
3034 struct sky2_port *sky2 = netdev_priv(dev); 3034 struct sky2_port *sky2 = netdev_priv(dev);
3035 struct sky2_hw *hw = sky2->hw; 3035 struct sky2_hw *hw = sky2->hw;
3036 3036
3037 if (wol->wolopts & ~sky2_wol_supported(sky2->hw)) 3037 if ((wol->wolopts & ~sky2_wol_supported(sky2->hw))
3038 || !device_can_wakeup(&hw->pdev->dev))
3038 return -EOPNOTSUPP; 3039 return -EOPNOTSUPP;
3039 3040
3040 sky2->wol = wol->wolopts; 3041 sky2->wol = wol->wolopts;
@@ -3045,6 +3046,8 @@ static int sky2_set_wol(struct net_device *dev, struct ethtool_wolinfo *wol)
3045 sky2_write32(hw, B0_CTST, sky2->wol 3046 sky2_write32(hw, B0_CTST, sky2->wol
3046 ? Y2_HW_WOL_ON : Y2_HW_WOL_OFF); 3047 ? Y2_HW_WOL_ON : Y2_HW_WOL_OFF);
3047 3048
3049 device_set_wakeup_enable(&hw->pdev->dev, sky2->wol);
3050
3048 if (!netif_running(dev)) 3051 if (!netif_running(dev))
3049 sky2_wol_init(sky2); 3052 sky2_wol_init(sky2);
3050 return 0; 3053 return 0;
@@ -4179,18 +4182,6 @@ static int __devinit sky2_test_msi(struct sky2_hw *hw)
4179 return err; 4182 return err;
4180} 4183}
4181 4184
4182static int __devinit pci_wake_enabled(struct pci_dev *dev)
4183{
4184 int pm = pci_find_capability(dev, PCI_CAP_ID_PM);
4185 u16 value;
4186
4187 if (!pm)
4188 return 0;
4189 if (pci_read_config_word(dev, pm + PCI_PM_CTRL, &value))
4190 return 0;
4191 return value & PCI_PM_CTRL_PME_ENABLE;
4192}
4193
4194/* 4185/*
4195 * Read and parse the first part of Vital Product Data 4186 * Read and parse the first part of Vital Product Data
4196 */ 4187 */
@@ -4314,7 +4305,7 @@ static int __devinit sky2_probe(struct pci_dev *pdev,
4314 } 4305 }
4315 } 4306 }
4316 4307
4317 wol_default = pci_wake_enabled(pdev) ? WAKE_MAGIC : 0; 4308 wol_default = device_may_wakeup(&pdev->dev) ? WAKE_MAGIC : 0;
4318 4309
4319 err = -ENOMEM; 4310 err = -ENOMEM;
4320 hw = kzalloc(sizeof(*hw), GFP_KERNEL); 4311 hw = kzalloc(sizeof(*hw), GFP_KERNEL);
diff --git a/drivers/net/smc911x.c b/drivers/net/smc911x.c
index 3d19d00e8eec..8aa7460ef0e3 100644
--- a/drivers/net/smc911x.c
+++ b/drivers/net/smc911x.c
@@ -685,8 +685,10 @@ static void smc911x_phy_detect(struct net_device *dev)
685 * PHY#1 to PHY#31, and then PHY#0 last. 685 * PHY#1 to PHY#31, and then PHY#0 last.
686 */ 686 */
687 switch(lp->version) { 687 switch(lp->version) {
688 case 0x115: 688 case CHIP_9115:
689 case 0x117: 689 case CHIP_9117:
690 case CHIP_9215:
691 case CHIP_9217:
690 cfg = SMC_GET_HW_CFG(lp); 692 cfg = SMC_GET_HW_CFG(lp);
691 if (cfg & HW_CFG_EXT_PHY_DET_) { 693 if (cfg & HW_CFG_EXT_PHY_DET_) {
692 cfg &= ~HW_CFG_PHY_CLK_SEL_; 694 cfg &= ~HW_CFG_PHY_CLK_SEL_;
diff --git a/drivers/net/smc911x.h b/drivers/net/smc911x.h
index 2abfc2845198..bf6240f23f5d 100644
--- a/drivers/net/smc911x.h
+++ b/drivers/net/smc911x.h
@@ -666,10 +666,13 @@ smc_pxa_dma_outsl(struct smc911x_local *lp, u_long physaddr,
666#define LAN911X_INTERNAL_PHY_ID (0x0007C000) 666#define LAN911X_INTERNAL_PHY_ID (0x0007C000)
667 667
668/* Chip ID values */ 668/* Chip ID values */
669#define CHIP_9115 0x115 669#define CHIP_9115 0x0115
670#define CHIP_9116 0x116 670#define CHIP_9116 0x0116
671#define CHIP_9117 0x117 671#define CHIP_9117 0x0117
672#define CHIP_9118 0x118 672#define CHIP_9118 0x0118
673#define CHIP_9215 0x115A
674#define CHIP_9217 0x117A
675#define CHIP_9218 0x118A
673 676
674struct chip_id { 677struct chip_id {
675 u16 id; 678 u16 id;
@@ -681,6 +684,9 @@ static const struct chip_id chip_ids[] = {
681 { CHIP_9116, "LAN9116" }, 684 { CHIP_9116, "LAN9116" },
682 { CHIP_9117, "LAN9117" }, 685 { CHIP_9117, "LAN9117" },
683 { CHIP_9118, "LAN9118" }, 686 { CHIP_9118, "LAN9118" },
687 { CHIP_9215, "LAN9215" },
688 { CHIP_9217, "LAN9217" },
689 { CHIP_9218, "LAN9218" },
684 { 0, NULL }, 690 { 0, NULL },
685}; 691};
686 692
diff --git a/drivers/net/tc35815.c b/drivers/net/tc35815.c
index 4980b12b6219..df20cafff7dd 100644
--- a/drivers/net/tc35815.c
+++ b/drivers/net/tc35815.c
@@ -796,7 +796,7 @@ err_out_unregister_bus:
796 mdiobus_unregister(lp->mii_bus); 796 mdiobus_unregister(lp->mii_bus);
797err_out_free_mdio_irq: 797err_out_free_mdio_irq:
798 kfree(lp->mii_bus->irq); 798 kfree(lp->mii_bus->irq);
799err_out_free_mii_bus; 799err_out_free_mii_bus:
800 mdiobus_free(lp->mii_bus); 800 mdiobus_free(lp->mii_bus);
801err_out: 801err_out:
802 return err; 802 return err;