diff options
author | Chris Metcalf <cmetcalf@tilera.com> | 2010-08-13 19:59:15 -0400 |
---|---|---|
committer | Chris Metcalf <cmetcalf@tilera.com> | 2010-08-13 19:59:15 -0400 |
commit | 7d72e6fa56c4100b9669efe0044f77ed9eb785a1 (patch) | |
tree | 5e90bf4969809a1ab20b97432b85be20ccfaa1f4 /drivers/net | |
parent | ba00376b0b13f234d839541a7b36a5bf5c2a4036 (diff) | |
parent | 2be1f3a73dd02e38e181cf5abacb3d45a6a2d6b8 (diff) |
Merge branch 'master' into for-linus
Diffstat (limited to 'drivers/net')
67 files changed, 411 insertions, 369 deletions
diff --git a/drivers/net/arm/ixp4xx_eth.c b/drivers/net/arm/ixp4xx_eth.c index 4f1cc7164ad9..6028226a7270 100644 --- a/drivers/net/arm/ixp4xx_eth.c +++ b/drivers/net/arm/ixp4xx_eth.c | |||
@@ -241,7 +241,7 @@ static inline void memcpy_swab32(u32 *dest, u32 *src, int cnt) | |||
241 | 241 | ||
242 | static spinlock_t mdio_lock; | 242 | static spinlock_t mdio_lock; |
243 | static struct eth_regs __iomem *mdio_regs; /* mdio command and status only */ | 243 | static struct eth_regs __iomem *mdio_regs; /* mdio command and status only */ |
244 | struct mii_bus *mdio_bus; | 244 | static struct mii_bus *mdio_bus; |
245 | static int ports_open; | 245 | static int ports_open; |
246 | static struct port *npe_port_tab[MAX_NPES]; | 246 | static struct port *npe_port_tab[MAX_NPES]; |
247 | static struct dma_pool *dma_pool; | 247 | static struct dma_pool *dma_pool; |
diff --git a/drivers/net/caif/caif_spi_slave.c b/drivers/net/caif/caif_spi_slave.c index 077ccf840edf..2111dbfea6fe 100644 --- a/drivers/net/caif/caif_spi_slave.c +++ b/drivers/net/caif/caif_spi_slave.c | |||
@@ -22,13 +22,13 @@ | |||
22 | #include <net/caif/caif_spi.h> | 22 | #include <net/caif/caif_spi.h> |
23 | 23 | ||
24 | #ifndef CONFIG_CAIF_SPI_SYNC | 24 | #ifndef CONFIG_CAIF_SPI_SYNC |
25 | #define SPI_DATA_POS SPI_CMD_SZ | 25 | #define SPI_DATA_POS 0 |
26 | static inline int forward_to_spi_cmd(struct cfspi *cfspi) | 26 | static inline int forward_to_spi_cmd(struct cfspi *cfspi) |
27 | { | 27 | { |
28 | return cfspi->rx_cpck_len; | 28 | return cfspi->rx_cpck_len; |
29 | } | 29 | } |
30 | #else | 30 | #else |
31 | #define SPI_DATA_POS 0 | 31 | #define SPI_DATA_POS SPI_CMD_SZ |
32 | static inline int forward_to_spi_cmd(struct cfspi *cfspi) | 32 | static inline int forward_to_spi_cmd(struct cfspi *cfspi) |
33 | { | 33 | { |
34 | return 0; | 34 | return 0; |
diff --git a/drivers/net/can/mscan/mpc5xxx_can.c b/drivers/net/can/mscan/mpc5xxx_can.c index af753936e835..b1bdc909090f 100644 --- a/drivers/net/can/mscan/mpc5xxx_can.c +++ b/drivers/net/can/mscan/mpc5xxx_can.c | |||
@@ -38,7 +38,7 @@ | |||
38 | 38 | ||
39 | struct mpc5xxx_can_data { | 39 | struct mpc5xxx_can_data { |
40 | unsigned int type; | 40 | unsigned int type; |
41 | u32 (*get_clock)(struct of_device *ofdev, const char *clock_name, | 41 | u32 (*get_clock)(struct platform_device *ofdev, const char *clock_name, |
42 | int *mscan_clksrc); | 42 | int *mscan_clksrc); |
43 | }; | 43 | }; |
44 | 44 | ||
@@ -48,7 +48,7 @@ static struct of_device_id __devinitdata mpc52xx_cdm_ids[] = { | |||
48 | {} | 48 | {} |
49 | }; | 49 | }; |
50 | 50 | ||
51 | static u32 __devinit mpc52xx_can_get_clock(struct of_device *ofdev, | 51 | static u32 __devinit mpc52xx_can_get_clock(struct platform_device *ofdev, |
52 | const char *clock_name, | 52 | const char *clock_name, |
53 | int *mscan_clksrc) | 53 | int *mscan_clksrc) |
54 | { | 54 | { |
@@ -101,7 +101,7 @@ static u32 __devinit mpc52xx_can_get_clock(struct of_device *ofdev, | |||
101 | return freq; | 101 | return freq; |
102 | } | 102 | } |
103 | #else /* !CONFIG_PPC_MPC52xx */ | 103 | #else /* !CONFIG_PPC_MPC52xx */ |
104 | static u32 __devinit mpc52xx_can_get_clock(struct of_device *ofdev, | 104 | static u32 __devinit mpc52xx_can_get_clock(struct platform_device *ofdev, |
105 | const char *clock_name, | 105 | const char *clock_name, |
106 | int *mscan_clksrc) | 106 | int *mscan_clksrc) |
107 | { | 107 | { |
@@ -129,7 +129,7 @@ static struct of_device_id __devinitdata mpc512x_clock_ids[] = { | |||
129 | {} | 129 | {} |
130 | }; | 130 | }; |
131 | 131 | ||
132 | static u32 __devinit mpc512x_can_get_clock(struct of_device *ofdev, | 132 | static u32 __devinit mpc512x_can_get_clock(struct platform_device *ofdev, |
133 | const char *clock_name, | 133 | const char *clock_name, |
134 | int *mscan_clksrc) | 134 | int *mscan_clksrc) |
135 | { | 135 | { |
@@ -239,7 +239,7 @@ exit_unmap: | |||
239 | return freq; | 239 | return freq; |
240 | } | 240 | } |
241 | #else /* !CONFIG_PPC_MPC512x */ | 241 | #else /* !CONFIG_PPC_MPC512x */ |
242 | static u32 __devinit mpc512x_can_get_clock(struct of_device *ofdev, | 242 | static u32 __devinit mpc512x_can_get_clock(struct platform_device *ofdev, |
243 | const char *clock_name, | 243 | const char *clock_name, |
244 | int *mscan_clksrc) | 244 | int *mscan_clksrc) |
245 | { | 245 | { |
@@ -247,7 +247,7 @@ static u32 __devinit mpc512x_can_get_clock(struct of_device *ofdev, | |||
247 | } | 247 | } |
248 | #endif /* CONFIG_PPC_MPC512x */ | 248 | #endif /* CONFIG_PPC_MPC512x */ |
249 | 249 | ||
250 | static int __devinit mpc5xxx_can_probe(struct of_device *ofdev, | 250 | static int __devinit mpc5xxx_can_probe(struct platform_device *ofdev, |
251 | const struct of_device_id *id) | 251 | const struct of_device_id *id) |
252 | { | 252 | { |
253 | struct mpc5xxx_can_data *data = (struct mpc5xxx_can_data *)id->data; | 253 | struct mpc5xxx_can_data *data = (struct mpc5xxx_can_data *)id->data; |
@@ -317,7 +317,7 @@ exit_unmap_mem: | |||
317 | return err; | 317 | return err; |
318 | } | 318 | } |
319 | 319 | ||
320 | static int __devexit mpc5xxx_can_remove(struct of_device *ofdev) | 320 | static int __devexit mpc5xxx_can_remove(struct platform_device *ofdev) |
321 | { | 321 | { |
322 | struct net_device *dev = dev_get_drvdata(&ofdev->dev); | 322 | struct net_device *dev = dev_get_drvdata(&ofdev->dev); |
323 | struct mscan_priv *priv = netdev_priv(dev); | 323 | struct mscan_priv *priv = netdev_priv(dev); |
@@ -334,7 +334,7 @@ static int __devexit mpc5xxx_can_remove(struct of_device *ofdev) | |||
334 | 334 | ||
335 | #ifdef CONFIG_PM | 335 | #ifdef CONFIG_PM |
336 | static struct mscan_regs saved_regs; | 336 | static struct mscan_regs saved_regs; |
337 | static int mpc5xxx_can_suspend(struct of_device *ofdev, pm_message_t state) | 337 | static int mpc5xxx_can_suspend(struct platform_device *ofdev, pm_message_t state) |
338 | { | 338 | { |
339 | struct net_device *dev = dev_get_drvdata(&ofdev->dev); | 339 | struct net_device *dev = dev_get_drvdata(&ofdev->dev); |
340 | struct mscan_priv *priv = netdev_priv(dev); | 340 | struct mscan_priv *priv = netdev_priv(dev); |
@@ -345,7 +345,7 @@ static int mpc5xxx_can_suspend(struct of_device *ofdev, pm_message_t state) | |||
345 | return 0; | 345 | return 0; |
346 | } | 346 | } |
347 | 347 | ||
348 | static int mpc5xxx_can_resume(struct of_device *ofdev) | 348 | static int mpc5xxx_can_resume(struct platform_device *ofdev) |
349 | { | 349 | { |
350 | struct net_device *dev = dev_get_drvdata(&ofdev->dev); | 350 | struct net_device *dev = dev_get_drvdata(&ofdev->dev); |
351 | struct mscan_priv *priv = netdev_priv(dev); | 351 | struct mscan_priv *priv = netdev_priv(dev); |
diff --git a/drivers/net/can/sja1000/sja1000_of_platform.c b/drivers/net/can/sja1000/sja1000_of_platform.c index ac1a83d7c204..5bfccfdf3bbb 100644 --- a/drivers/net/can/sja1000/sja1000_of_platform.c +++ b/drivers/net/can/sja1000/sja1000_of_platform.c | |||
@@ -67,7 +67,7 @@ static void sja1000_ofp_write_reg(const struct sja1000_priv *priv, | |||
67 | out_8(priv->reg_base + reg, val); | 67 | out_8(priv->reg_base + reg, val); |
68 | } | 68 | } |
69 | 69 | ||
70 | static int __devexit sja1000_ofp_remove(struct of_device *ofdev) | 70 | static int __devexit sja1000_ofp_remove(struct platform_device *ofdev) |
71 | { | 71 | { |
72 | struct net_device *dev = dev_get_drvdata(&ofdev->dev); | 72 | struct net_device *dev = dev_get_drvdata(&ofdev->dev); |
73 | struct sja1000_priv *priv = netdev_priv(dev); | 73 | struct sja1000_priv *priv = netdev_priv(dev); |
@@ -87,7 +87,7 @@ static int __devexit sja1000_ofp_remove(struct of_device *ofdev) | |||
87 | return 0; | 87 | return 0; |
88 | } | 88 | } |
89 | 89 | ||
90 | static int __devinit sja1000_ofp_probe(struct of_device *ofdev, | 90 | static int __devinit sja1000_ofp_probe(struct platform_device *ofdev, |
91 | const struct of_device_id *id) | 91 | const struct of_device_id *id) |
92 | { | 92 | { |
93 | struct device_node *np = ofdev->dev.of_node; | 93 | struct device_node *np = ofdev->dev.of_node; |
diff --git a/drivers/net/ehea/ehea.h b/drivers/net/ehea/ehea.h index 0060e422f171..99a929964e3c 100644 --- a/drivers/net/ehea/ehea.h +++ b/drivers/net/ehea/ehea.h | |||
@@ -413,7 +413,7 @@ struct ehea_port_res { | |||
413 | 413 | ||
414 | struct ehea_adapter { | 414 | struct ehea_adapter { |
415 | u64 handle; | 415 | u64 handle; |
416 | struct of_device *ofdev; | 416 | struct platform_device *ofdev; |
417 | struct ehea_port *port[EHEA_MAX_PORTS]; | 417 | struct ehea_port *port[EHEA_MAX_PORTS]; |
418 | struct ehea_eq *neq; /* notification event queue */ | 418 | struct ehea_eq *neq; /* notification event queue */ |
419 | struct tasklet_struct neq_tasklet; | 419 | struct tasklet_struct neq_tasklet; |
@@ -465,7 +465,7 @@ struct ehea_port { | |||
465 | struct net_device *netdev; | 465 | struct net_device *netdev; |
466 | struct net_device_stats stats; | 466 | struct net_device_stats stats; |
467 | struct ehea_port_res port_res[EHEA_MAX_PORT_RES]; | 467 | struct ehea_port_res port_res[EHEA_MAX_PORT_RES]; |
468 | struct of_device ofdev; /* Open Firmware Device */ | 468 | struct platform_device ofdev; /* Open Firmware Device */ |
469 | struct ehea_mc_list *mc_list; /* Multicast MAC addresses */ | 469 | struct ehea_mc_list *mc_list; /* Multicast MAC addresses */ |
470 | struct vlan_group *vgrp; | 470 | struct vlan_group *vgrp; |
471 | struct ehea_eq *qp_eq; | 471 | struct ehea_eq *qp_eq; |
diff --git a/drivers/net/ehea/ehea_main.c b/drivers/net/ehea/ehea_main.c index 3beba70b7dea..897719b49f96 100644 --- a/drivers/net/ehea/ehea_main.c +++ b/drivers/net/ehea/ehea_main.c | |||
@@ -107,10 +107,10 @@ struct ehea_fw_handle_array ehea_fw_handles; | |||
107 | struct ehea_bcmc_reg_array ehea_bcmc_regs; | 107 | struct ehea_bcmc_reg_array ehea_bcmc_regs; |
108 | 108 | ||
109 | 109 | ||
110 | static int __devinit ehea_probe_adapter(struct of_device *dev, | 110 | static int __devinit ehea_probe_adapter(struct platform_device *dev, |
111 | const struct of_device_id *id); | 111 | const struct of_device_id *id); |
112 | 112 | ||
113 | static int __devexit ehea_remove(struct of_device *dev); | 113 | static int __devexit ehea_remove(struct platform_device *dev); |
114 | 114 | ||
115 | static struct of_device_id ehea_device_table[] = { | 115 | static struct of_device_id ehea_device_table[] = { |
116 | { | 116 | { |
@@ -3376,7 +3376,7 @@ static ssize_t ehea_remove_port(struct device *dev, | |||
3376 | static DEVICE_ATTR(probe_port, S_IWUSR, NULL, ehea_probe_port); | 3376 | static DEVICE_ATTR(probe_port, S_IWUSR, NULL, ehea_probe_port); |
3377 | static DEVICE_ATTR(remove_port, S_IWUSR, NULL, ehea_remove_port); | 3377 | static DEVICE_ATTR(remove_port, S_IWUSR, NULL, ehea_remove_port); |
3378 | 3378 | ||
3379 | int ehea_create_device_sysfs(struct of_device *dev) | 3379 | int ehea_create_device_sysfs(struct platform_device *dev) |
3380 | { | 3380 | { |
3381 | int ret = device_create_file(&dev->dev, &dev_attr_probe_port); | 3381 | int ret = device_create_file(&dev->dev, &dev_attr_probe_port); |
3382 | if (ret) | 3382 | if (ret) |
@@ -3387,13 +3387,13 @@ out: | |||
3387 | return ret; | 3387 | return ret; |
3388 | } | 3388 | } |
3389 | 3389 | ||
3390 | void ehea_remove_device_sysfs(struct of_device *dev) | 3390 | void ehea_remove_device_sysfs(struct platform_device *dev) |
3391 | { | 3391 | { |
3392 | device_remove_file(&dev->dev, &dev_attr_probe_port); | 3392 | device_remove_file(&dev->dev, &dev_attr_probe_port); |
3393 | device_remove_file(&dev->dev, &dev_attr_remove_port); | 3393 | device_remove_file(&dev->dev, &dev_attr_remove_port); |
3394 | } | 3394 | } |
3395 | 3395 | ||
3396 | static int __devinit ehea_probe_adapter(struct of_device *dev, | 3396 | static int __devinit ehea_probe_adapter(struct platform_device *dev, |
3397 | const struct of_device_id *id) | 3397 | const struct of_device_id *id) |
3398 | { | 3398 | { |
3399 | struct ehea_adapter *adapter; | 3399 | struct ehea_adapter *adapter; |
@@ -3492,7 +3492,7 @@ out: | |||
3492 | return ret; | 3492 | return ret; |
3493 | } | 3493 | } |
3494 | 3494 | ||
3495 | static int __devexit ehea_remove(struct of_device *dev) | 3495 | static int __devexit ehea_remove(struct platform_device *dev) |
3496 | { | 3496 | { |
3497 | struct ehea_adapter *adapter = dev_get_drvdata(&dev->dev); | 3497 | struct ehea_adapter *adapter = dev_get_drvdata(&dev->dev); |
3498 | int i; | 3498 | int i; |
diff --git a/drivers/net/fec_mpc52xx.c b/drivers/net/fec_mpc52xx.c index d1a5b17b2a95..e3e10b4add9c 100644 --- a/drivers/net/fec_mpc52xx.c +++ b/drivers/net/fec_mpc52xx.c | |||
@@ -850,7 +850,7 @@ static const struct net_device_ops mpc52xx_fec_netdev_ops = { | |||
850 | /* ======================================================================== */ | 850 | /* ======================================================================== */ |
851 | 851 | ||
852 | static int __devinit | 852 | static int __devinit |
853 | mpc52xx_fec_probe(struct of_device *op, const struct of_device_id *match) | 853 | mpc52xx_fec_probe(struct platform_device *op, const struct of_device_id *match) |
854 | { | 854 | { |
855 | int rv; | 855 | int rv; |
856 | struct net_device *ndev; | 856 | struct net_device *ndev; |
@@ -995,7 +995,7 @@ err_netdev: | |||
995 | } | 995 | } |
996 | 996 | ||
997 | static int | 997 | static int |
998 | mpc52xx_fec_remove(struct of_device *op) | 998 | mpc52xx_fec_remove(struct platform_device *op) |
999 | { | 999 | { |
1000 | struct net_device *ndev; | 1000 | struct net_device *ndev; |
1001 | struct mpc52xx_fec_priv *priv; | 1001 | struct mpc52xx_fec_priv *priv; |
@@ -1025,7 +1025,7 @@ mpc52xx_fec_remove(struct of_device *op) | |||
1025 | } | 1025 | } |
1026 | 1026 | ||
1027 | #ifdef CONFIG_PM | 1027 | #ifdef CONFIG_PM |
1028 | static int mpc52xx_fec_of_suspend(struct of_device *op, pm_message_t state) | 1028 | static int mpc52xx_fec_of_suspend(struct platform_device *op, pm_message_t state) |
1029 | { | 1029 | { |
1030 | struct net_device *dev = dev_get_drvdata(&op->dev); | 1030 | struct net_device *dev = dev_get_drvdata(&op->dev); |
1031 | 1031 | ||
@@ -1035,7 +1035,7 @@ static int mpc52xx_fec_of_suspend(struct of_device *op, pm_message_t state) | |||
1035 | return 0; | 1035 | return 0; |
1036 | } | 1036 | } |
1037 | 1037 | ||
1038 | static int mpc52xx_fec_of_resume(struct of_device *op) | 1038 | static int mpc52xx_fec_of_resume(struct platform_device *op) |
1039 | { | 1039 | { |
1040 | struct net_device *dev = dev_get_drvdata(&op->dev); | 1040 | struct net_device *dev = dev_get_drvdata(&op->dev); |
1041 | 1041 | ||
diff --git a/drivers/net/fec_mpc52xx_phy.c b/drivers/net/fec_mpc52xx_phy.c index dbaf72cbb233..0b4cb6f15984 100644 --- a/drivers/net/fec_mpc52xx_phy.c +++ b/drivers/net/fec_mpc52xx_phy.c | |||
@@ -61,7 +61,7 @@ static int mpc52xx_fec_mdio_write(struct mii_bus *bus, int phy_id, int reg, | |||
61 | data | FEC_MII_WRITE_FRAME); | 61 | data | FEC_MII_WRITE_FRAME); |
62 | } | 62 | } |
63 | 63 | ||
64 | static int mpc52xx_fec_mdio_probe(struct of_device *of, | 64 | static int mpc52xx_fec_mdio_probe(struct platform_device *of, |
65 | const struct of_device_id *match) | 65 | const struct of_device_id *match) |
66 | { | 66 | { |
67 | struct device *dev = &of->dev; | 67 | struct device *dev = &of->dev; |
@@ -122,7 +122,7 @@ static int mpc52xx_fec_mdio_probe(struct of_device *of, | |||
122 | return err; | 122 | return err; |
123 | } | 123 | } |
124 | 124 | ||
125 | static int mpc52xx_fec_mdio_remove(struct of_device *of) | 125 | static int mpc52xx_fec_mdio_remove(struct platform_device *of) |
126 | { | 126 | { |
127 | struct device *dev = &of->dev; | 127 | struct device *dev = &of->dev; |
128 | struct mii_bus *bus = dev_get_drvdata(dev); | 128 | struct mii_bus *bus = dev_get_drvdata(dev); |
diff --git a/drivers/net/fs_enet/fs_enet-main.c b/drivers/net/fs_enet/fs_enet-main.c index f08cff9020bd..d6e3111959ab 100644 --- a/drivers/net/fs_enet/fs_enet-main.c +++ b/drivers/net/fs_enet/fs_enet-main.c | |||
@@ -997,7 +997,7 @@ static const struct net_device_ops fs_enet_netdev_ops = { | |||
997 | #endif | 997 | #endif |
998 | }; | 998 | }; |
999 | 999 | ||
1000 | static int __devinit fs_enet_probe(struct of_device *ofdev, | 1000 | static int __devinit fs_enet_probe(struct platform_device *ofdev, |
1001 | const struct of_device_id *match) | 1001 | const struct of_device_id *match) |
1002 | { | 1002 | { |
1003 | struct net_device *ndev; | 1003 | struct net_device *ndev; |
@@ -1105,7 +1105,7 @@ out_free_fpi: | |||
1105 | return ret; | 1105 | return ret; |
1106 | } | 1106 | } |
1107 | 1107 | ||
1108 | static int fs_enet_remove(struct of_device *ofdev) | 1108 | static int fs_enet_remove(struct platform_device *ofdev) |
1109 | { | 1109 | { |
1110 | struct net_device *ndev = dev_get_drvdata(&ofdev->dev); | 1110 | struct net_device *ndev = dev_get_drvdata(&ofdev->dev); |
1111 | struct fs_enet_private *fep = netdev_priv(ndev); | 1111 | struct fs_enet_private *fep = netdev_priv(ndev); |
diff --git a/drivers/net/fs_enet/mac-fcc.c b/drivers/net/fs_enet/mac-fcc.c index 48e91b6242ce..7a84e45487e8 100644 --- a/drivers/net/fs_enet/mac-fcc.c +++ b/drivers/net/fs_enet/mac-fcc.c | |||
@@ -84,7 +84,7 @@ static inline int fcc_cr_cmd(struct fs_enet_private *fep, u32 op) | |||
84 | 84 | ||
85 | static int do_pd_setup(struct fs_enet_private *fep) | 85 | static int do_pd_setup(struct fs_enet_private *fep) |
86 | { | 86 | { |
87 | struct of_device *ofdev = to_of_device(fep->dev); | 87 | struct platform_device *ofdev = to_platform_device(fep->dev); |
88 | struct fs_platform_info *fpi = fep->fpi; | 88 | struct fs_platform_info *fpi = fep->fpi; |
89 | int ret = -EINVAL; | 89 | int ret = -EINVAL; |
90 | 90 | ||
diff --git a/drivers/net/fs_enet/mac-fec.c b/drivers/net/fs_enet/mac-fec.c index 7ca1642276d0..61035fc5599b 100644 --- a/drivers/net/fs_enet/mac-fec.c +++ b/drivers/net/fs_enet/mac-fec.c | |||
@@ -96,7 +96,7 @@ static int whack_reset(struct fec __iomem *fecp) | |||
96 | 96 | ||
97 | static int do_pd_setup(struct fs_enet_private *fep) | 97 | static int do_pd_setup(struct fs_enet_private *fep) |
98 | { | 98 | { |
99 | struct of_device *ofdev = to_of_device(fep->dev); | 99 | struct platform_device *ofdev = to_platform_device(fep->dev); |
100 | 100 | ||
101 | fep->interrupt = of_irq_to_resource(ofdev->dev.of_node, 0, NULL); | 101 | fep->interrupt = of_irq_to_resource(ofdev->dev.of_node, 0, NULL); |
102 | if (fep->interrupt == NO_IRQ) | 102 | if (fep->interrupt == NO_IRQ) |
diff --git a/drivers/net/fs_enet/mac-scc.c b/drivers/net/fs_enet/mac-scc.c index a3c44544846d..22a02a767069 100644 --- a/drivers/net/fs_enet/mac-scc.c +++ b/drivers/net/fs_enet/mac-scc.c | |||
@@ -96,7 +96,7 @@ static inline int scc_cr_cmd(struct fs_enet_private *fep, u32 op) | |||
96 | 96 | ||
97 | static int do_pd_setup(struct fs_enet_private *fep) | 97 | static int do_pd_setup(struct fs_enet_private *fep) |
98 | { | 98 | { |
99 | struct of_device *ofdev = to_of_device(fep->dev); | 99 | struct platform_device *ofdev = to_platform_device(fep->dev); |
100 | 100 | ||
101 | fep->interrupt = of_irq_to_resource(ofdev->dev.of_node, 0, NULL); | 101 | fep->interrupt = of_irq_to_resource(ofdev->dev.of_node, 0, NULL); |
102 | if (fep->interrupt == NO_IRQ) | 102 | if (fep->interrupt == NO_IRQ) |
diff --git a/drivers/net/fs_enet/mii-bitbang.c b/drivers/net/fs_enet/mii-bitbang.c index 3607340f3da7..3cda2b515471 100644 --- a/drivers/net/fs_enet/mii-bitbang.c +++ b/drivers/net/fs_enet/mii-bitbang.c | |||
@@ -150,7 +150,7 @@ static int __devinit fs_mii_bitbang_init(struct mii_bus *bus, | |||
150 | return 0; | 150 | return 0; |
151 | } | 151 | } |
152 | 152 | ||
153 | static int __devinit fs_enet_mdio_probe(struct of_device *ofdev, | 153 | static int __devinit fs_enet_mdio_probe(struct platform_device *ofdev, |
154 | const struct of_device_id *match) | 154 | const struct of_device_id *match) |
155 | { | 155 | { |
156 | struct mii_bus *new_bus; | 156 | struct mii_bus *new_bus; |
@@ -200,7 +200,7 @@ out: | |||
200 | return ret; | 200 | return ret; |
201 | } | 201 | } |
202 | 202 | ||
203 | static int fs_enet_mdio_remove(struct of_device *ofdev) | 203 | static int fs_enet_mdio_remove(struct platform_device *ofdev) |
204 | { | 204 | { |
205 | struct mii_bus *bus = dev_get_drvdata(&ofdev->dev); | 205 | struct mii_bus *bus = dev_get_drvdata(&ofdev->dev); |
206 | struct bb_info *bitbang = bus->priv; | 206 | struct bb_info *bitbang = bus->priv; |
diff --git a/drivers/net/fs_enet/mii-fec.c b/drivers/net/fs_enet/mii-fec.c index bddffd169b93..dbb9c48623df 100644 --- a/drivers/net/fs_enet/mii-fec.c +++ b/drivers/net/fs_enet/mii-fec.c | |||
@@ -101,7 +101,7 @@ static int fs_enet_fec_mii_reset(struct mii_bus *bus) | |||
101 | return 0; | 101 | return 0; |
102 | } | 102 | } |
103 | 103 | ||
104 | static int __devinit fs_enet_mdio_probe(struct of_device *ofdev, | 104 | static int __devinit fs_enet_mdio_probe(struct platform_device *ofdev, |
105 | const struct of_device_id *match) | 105 | const struct of_device_id *match) |
106 | { | 106 | { |
107 | struct resource res; | 107 | struct resource res; |
@@ -192,7 +192,7 @@ out: | |||
192 | return ret; | 192 | return ret; |
193 | } | 193 | } |
194 | 194 | ||
195 | static int fs_enet_mdio_remove(struct of_device *ofdev) | 195 | static int fs_enet_mdio_remove(struct platform_device *ofdev) |
196 | { | 196 | { |
197 | struct mii_bus *bus = dev_get_drvdata(&ofdev->dev); | 197 | struct mii_bus *bus = dev_get_drvdata(&ofdev->dev); |
198 | struct fec_info *fec = bus->priv; | 198 | struct fec_info *fec = bus->priv; |
diff --git a/drivers/net/fsl_pq_mdio.c b/drivers/net/fsl_pq_mdio.c index f53f850b6418..d4bf91aac25f 100644 --- a/drivers/net/fsl_pq_mdio.c +++ b/drivers/net/fsl_pq_mdio.c | |||
@@ -265,7 +265,7 @@ static int get_ucc_id_for_range(u64 start, u64 end, u32 *ucc_id) | |||
265 | #endif | 265 | #endif |
266 | 266 | ||
267 | 267 | ||
268 | static int fsl_pq_mdio_probe(struct of_device *ofdev, | 268 | static int fsl_pq_mdio_probe(struct platform_device *ofdev, |
269 | const struct of_device_id *match) | 269 | const struct of_device_id *match) |
270 | { | 270 | { |
271 | struct device_node *np = ofdev->dev.of_node; | 271 | struct device_node *np = ofdev->dev.of_node; |
@@ -425,7 +425,7 @@ err_free_priv: | |||
425 | } | 425 | } |
426 | 426 | ||
427 | 427 | ||
428 | static int fsl_pq_mdio_remove(struct of_device *ofdev) | 428 | static int fsl_pq_mdio_remove(struct platform_device *ofdev) |
429 | { | 429 | { |
430 | struct device *device = &ofdev->dev; | 430 | struct device *device = &ofdev->dev; |
431 | struct mii_bus *bus = dev_get_drvdata(device); | 431 | struct mii_bus *bus = dev_get_drvdata(device); |
diff --git a/drivers/net/gianfar.c b/drivers/net/gianfar.c index a1b6301bc674..4f7c3f3ca234 100644 --- a/drivers/net/gianfar.c +++ b/drivers/net/gianfar.c | |||
@@ -122,9 +122,9 @@ static irqreturn_t gfar_interrupt(int irq, void *dev_id); | |||
122 | static void adjust_link(struct net_device *dev); | 122 | static void adjust_link(struct net_device *dev); |
123 | static void init_registers(struct net_device *dev); | 123 | static void init_registers(struct net_device *dev); |
124 | static int init_phy(struct net_device *dev); | 124 | static int init_phy(struct net_device *dev); |
125 | static int gfar_probe(struct of_device *ofdev, | 125 | static int gfar_probe(struct platform_device *ofdev, |
126 | const struct of_device_id *match); | 126 | const struct of_device_id *match); |
127 | static int gfar_remove(struct of_device *ofdev); | 127 | static int gfar_remove(struct platform_device *ofdev); |
128 | static void free_skb_resources(struct gfar_private *priv); | 128 | static void free_skb_resources(struct gfar_private *priv); |
129 | static void gfar_set_multi(struct net_device *dev); | 129 | static void gfar_set_multi(struct net_device *dev); |
130 | static void gfar_set_hash_for_addr(struct net_device *dev, u8 *addr); | 130 | static void gfar_set_hash_for_addr(struct net_device *dev, u8 *addr); |
@@ -605,7 +605,7 @@ static int gfar_parse_group(struct device_node *np, | |||
605 | return 0; | 605 | return 0; |
606 | } | 606 | } |
607 | 607 | ||
608 | static int gfar_of_init(struct of_device *ofdev, struct net_device **pdev) | 608 | static int gfar_of_init(struct platform_device *ofdev, struct net_device **pdev) |
609 | { | 609 | { |
610 | const char *model; | 610 | const char *model; |
611 | const char *ctype; | 611 | const char *ctype; |
@@ -959,7 +959,7 @@ static void gfar_detect_errata(struct gfar_private *priv) | |||
959 | 959 | ||
960 | /* Set up the ethernet device structure, private data, | 960 | /* Set up the ethernet device structure, private data, |
961 | * and anything else we need before we start */ | 961 | * and anything else we need before we start */ |
962 | static int gfar_probe(struct of_device *ofdev, | 962 | static int gfar_probe(struct platform_device *ofdev, |
963 | const struct of_device_id *match) | 963 | const struct of_device_id *match) |
964 | { | 964 | { |
965 | u32 tempval; | 965 | u32 tempval; |
@@ -1238,7 +1238,7 @@ register_fail: | |||
1238 | return err; | 1238 | return err; |
1239 | } | 1239 | } |
1240 | 1240 | ||
1241 | static int gfar_remove(struct of_device *ofdev) | 1241 | static int gfar_remove(struct platform_device *ofdev) |
1242 | { | 1242 | { |
1243 | struct gfar_private *priv = dev_get_drvdata(&ofdev->dev); | 1243 | struct gfar_private *priv = dev_get_drvdata(&ofdev->dev); |
1244 | 1244 | ||
diff --git a/drivers/net/gianfar.h b/drivers/net/gianfar.h index 710810e2adb4..68984eb88ae0 100644 --- a/drivers/net/gianfar.h +++ b/drivers/net/gianfar.h | |||
@@ -1054,7 +1054,7 @@ struct gfar_private { | |||
1054 | 1054 | ||
1055 | struct device_node *node; | 1055 | struct device_node *node; |
1056 | struct net_device *ndev; | 1056 | struct net_device *ndev; |
1057 | struct of_device *ofdev; | 1057 | struct platform_device *ofdev; |
1058 | enum gfar_errata errata; | 1058 | enum gfar_errata errata; |
1059 | 1059 | ||
1060 | struct gfar_priv_grp gfargrp[MAXGROUPS]; | 1060 | struct gfar_priv_grp gfargrp[MAXGROUPS]; |
diff --git a/drivers/net/greth.c b/drivers/net/greth.c index 4d09eab3548e..f15c64f1cd38 100644 --- a/drivers/net/greth.c +++ b/drivers/net/greth.c | |||
@@ -1373,7 +1373,7 @@ error: | |||
1373 | } | 1373 | } |
1374 | 1374 | ||
1375 | /* Initialize the GRETH MAC */ | 1375 | /* Initialize the GRETH MAC */ |
1376 | static int __devinit greth_of_probe(struct of_device *ofdev, const struct of_device_id *match) | 1376 | static int __devinit greth_of_probe(struct platform_device *ofdev, const struct of_device_id *match) |
1377 | { | 1377 | { |
1378 | struct net_device *dev; | 1378 | struct net_device *dev; |
1379 | struct greth_private *greth; | 1379 | struct greth_private *greth; |
@@ -1412,7 +1412,7 @@ static int __devinit greth_of_probe(struct of_device *ofdev, const struct of_dev | |||
1412 | } | 1412 | } |
1413 | 1413 | ||
1414 | regs = (struct greth_regs *) greth->regs; | 1414 | regs = (struct greth_regs *) greth->regs; |
1415 | greth->irq = ofdev->irqs[0]; | 1415 | greth->irq = ofdev->archdata.irqs[0]; |
1416 | 1416 | ||
1417 | dev_set_drvdata(greth->dev, dev); | 1417 | dev_set_drvdata(greth->dev, dev); |
1418 | SET_NETDEV_DEV(dev, greth->dev); | 1418 | SET_NETDEV_DEV(dev, greth->dev); |
@@ -1572,7 +1572,7 @@ error1: | |||
1572 | return err; | 1572 | return err; |
1573 | } | 1573 | } |
1574 | 1574 | ||
1575 | static int __devexit greth_of_remove(struct of_device *of_dev) | 1575 | static int __devexit greth_of_remove(struct platform_device *of_dev) |
1576 | { | 1576 | { |
1577 | struct net_device *ndev = dev_get_drvdata(&of_dev->dev); | 1577 | struct net_device *ndev = dev_get_drvdata(&of_dev->dev); |
1578 | struct greth_private *greth = netdev_priv(ndev); | 1578 | struct greth_private *greth = netdev_priv(ndev); |
diff --git a/drivers/net/greth.h b/drivers/net/greth.h index 973388d6abca..03ad903cd676 100644 --- a/drivers/net/greth.h +++ b/drivers/net/greth.h | |||
@@ -118,7 +118,7 @@ struct greth_private { | |||
118 | 118 | ||
119 | int irq; | 119 | int irq; |
120 | 120 | ||
121 | struct device *dev; /* Pointer to of_device->dev */ | 121 | struct device *dev; /* Pointer to platform_device->dev */ |
122 | struct net_device *netdev; | 122 | struct net_device *netdev; |
123 | struct napi_struct napi; | 123 | struct napi_struct napi; |
124 | spinlock_t devlock; | 124 | spinlock_t devlock; |
diff --git a/drivers/net/ibm_newemac/core.c b/drivers/net/ibm_newemac/core.c index eeec7bc2ce74..3506fd6ad726 100644 --- a/drivers/net/ibm_newemac/core.c +++ b/drivers/net/ibm_newemac/core.c | |||
@@ -2245,7 +2245,7 @@ static int emac_ioctl(struct net_device *ndev, struct ifreq *rq, int cmd) | |||
2245 | struct emac_depentry { | 2245 | struct emac_depentry { |
2246 | u32 phandle; | 2246 | u32 phandle; |
2247 | struct device_node *node; | 2247 | struct device_node *node; |
2248 | struct of_device *ofdev; | 2248 | struct platform_device *ofdev; |
2249 | void *drvdata; | 2249 | void *drvdata; |
2250 | }; | 2250 | }; |
2251 | 2251 | ||
@@ -2719,7 +2719,7 @@ static const struct net_device_ops emac_gige_netdev_ops = { | |||
2719 | .ndo_change_mtu = emac_change_mtu, | 2719 | .ndo_change_mtu = emac_change_mtu, |
2720 | }; | 2720 | }; |
2721 | 2721 | ||
2722 | static int __devinit emac_probe(struct of_device *ofdev, | 2722 | static int __devinit emac_probe(struct platform_device *ofdev, |
2723 | const struct of_device_id *match) | 2723 | const struct of_device_id *match) |
2724 | { | 2724 | { |
2725 | struct net_device *ndev; | 2725 | struct net_device *ndev; |
@@ -2941,7 +2941,7 @@ static int __devinit emac_probe(struct of_device *ofdev, | |||
2941 | return err; | 2941 | return err; |
2942 | } | 2942 | } |
2943 | 2943 | ||
2944 | static int __devexit emac_remove(struct of_device *ofdev) | 2944 | static int __devexit emac_remove(struct platform_device *ofdev) |
2945 | { | 2945 | { |
2946 | struct emac_instance *dev = dev_get_drvdata(&ofdev->dev); | 2946 | struct emac_instance *dev = dev_get_drvdata(&ofdev->dev); |
2947 | 2947 | ||
diff --git a/drivers/net/ibm_newemac/core.h b/drivers/net/ibm_newemac/core.h index b1cbe6fdfc7a..9e37e3d9c51d 100644 --- a/drivers/net/ibm_newemac/core.h +++ b/drivers/net/ibm_newemac/core.h | |||
@@ -170,12 +170,12 @@ struct emac_instance { | |||
170 | struct net_device *ndev; | 170 | struct net_device *ndev; |
171 | struct resource rsrc_regs; | 171 | struct resource rsrc_regs; |
172 | struct emac_regs __iomem *emacp; | 172 | struct emac_regs __iomem *emacp; |
173 | struct of_device *ofdev; | 173 | struct platform_device *ofdev; |
174 | struct device_node **blist; /* bootlist entry */ | 174 | struct device_node **blist; /* bootlist entry */ |
175 | 175 | ||
176 | /* MAL linkage */ | 176 | /* MAL linkage */ |
177 | u32 mal_ph; | 177 | u32 mal_ph; |
178 | struct of_device *mal_dev; | 178 | struct platform_device *mal_dev; |
179 | u32 mal_rx_chan; | 179 | u32 mal_rx_chan; |
180 | u32 mal_tx_chan; | 180 | u32 mal_tx_chan; |
181 | struct mal_instance *mal; | 181 | struct mal_instance *mal; |
@@ -196,24 +196,24 @@ struct emac_instance { | |||
196 | 196 | ||
197 | /* Shared MDIO if any */ | 197 | /* Shared MDIO if any */ |
198 | u32 mdio_ph; | 198 | u32 mdio_ph; |
199 | struct of_device *mdio_dev; | 199 | struct platform_device *mdio_dev; |
200 | struct emac_instance *mdio_instance; | 200 | struct emac_instance *mdio_instance; |
201 | struct mutex mdio_lock; | 201 | struct mutex mdio_lock; |
202 | 202 | ||
203 | /* ZMII infos if any */ | 203 | /* ZMII infos if any */ |
204 | u32 zmii_ph; | 204 | u32 zmii_ph; |
205 | u32 zmii_port; | 205 | u32 zmii_port; |
206 | struct of_device *zmii_dev; | 206 | struct platform_device *zmii_dev; |
207 | 207 | ||
208 | /* RGMII infos if any */ | 208 | /* RGMII infos if any */ |
209 | u32 rgmii_ph; | 209 | u32 rgmii_ph; |
210 | u32 rgmii_port; | 210 | u32 rgmii_port; |
211 | struct of_device *rgmii_dev; | 211 | struct platform_device *rgmii_dev; |
212 | 212 | ||
213 | /* TAH infos if any */ | 213 | /* TAH infos if any */ |
214 | u32 tah_ph; | 214 | u32 tah_ph; |
215 | u32 tah_port; | 215 | u32 tah_port; |
216 | struct of_device *tah_dev; | 216 | struct platform_device *tah_dev; |
217 | 217 | ||
218 | /* IRQs */ | 218 | /* IRQs */ |
219 | int wol_irq; | 219 | int wol_irq; |
diff --git a/drivers/net/ibm_newemac/mal.c b/drivers/net/ibm_newemac/mal.c index fcff9e0bd382..d5717e2123e1 100644 --- a/drivers/net/ibm_newemac/mal.c +++ b/drivers/net/ibm_newemac/mal.c | |||
@@ -517,7 +517,7 @@ void *mal_dump_regs(struct mal_instance *mal, void *buf) | |||
517 | return regs + 1; | 517 | return regs + 1; |
518 | } | 518 | } |
519 | 519 | ||
520 | static int __devinit mal_probe(struct of_device *ofdev, | 520 | static int __devinit mal_probe(struct platform_device *ofdev, |
521 | const struct of_device_id *match) | 521 | const struct of_device_id *match) |
522 | { | 522 | { |
523 | struct mal_instance *mal; | 523 | struct mal_instance *mal; |
@@ -730,7 +730,7 @@ static int __devinit mal_probe(struct of_device *ofdev, | |||
730 | return err; | 730 | return err; |
731 | } | 731 | } |
732 | 732 | ||
733 | static int __devexit mal_remove(struct of_device *ofdev) | 733 | static int __devexit mal_remove(struct platform_device *ofdev) |
734 | { | 734 | { |
735 | struct mal_instance *mal = dev_get_drvdata(&ofdev->dev); | 735 | struct mal_instance *mal = dev_get_drvdata(&ofdev->dev); |
736 | 736 | ||
diff --git a/drivers/net/ibm_newemac/mal.h b/drivers/net/ibm_newemac/mal.h index 9ededfbf0726..66084214bf45 100644 --- a/drivers/net/ibm_newemac/mal.h +++ b/drivers/net/ibm_newemac/mal.h | |||
@@ -210,7 +210,7 @@ struct mal_instance { | |||
210 | dma_addr_t bd_dma; | 210 | dma_addr_t bd_dma; |
211 | struct mal_descriptor *bd_virt; | 211 | struct mal_descriptor *bd_virt; |
212 | 212 | ||
213 | struct of_device *ofdev; | 213 | struct platform_device *ofdev; |
214 | int index; | 214 | int index; |
215 | spinlock_t lock; | 215 | spinlock_t lock; |
216 | 216 | ||
diff --git a/drivers/net/ibm_newemac/rgmii.c b/drivers/net/ibm_newemac/rgmii.c index 108919bcdf13..dd61798897ac 100644 --- a/drivers/net/ibm_newemac/rgmii.c +++ b/drivers/net/ibm_newemac/rgmii.c | |||
@@ -93,7 +93,7 @@ static inline u32 rgmii_mode_mask(int mode, int input) | |||
93 | } | 93 | } |
94 | } | 94 | } |
95 | 95 | ||
96 | int __devinit rgmii_attach(struct of_device *ofdev, int input, int mode) | 96 | int __devinit rgmii_attach(struct platform_device *ofdev, int input, int mode) |
97 | { | 97 | { |
98 | struct rgmii_instance *dev = dev_get_drvdata(&ofdev->dev); | 98 | struct rgmii_instance *dev = dev_get_drvdata(&ofdev->dev); |
99 | struct rgmii_regs __iomem *p = dev->base; | 99 | struct rgmii_regs __iomem *p = dev->base; |
@@ -122,7 +122,7 @@ int __devinit rgmii_attach(struct of_device *ofdev, int input, int mode) | |||
122 | return 0; | 122 | return 0; |
123 | } | 123 | } |
124 | 124 | ||
125 | void rgmii_set_speed(struct of_device *ofdev, int input, int speed) | 125 | void rgmii_set_speed(struct platform_device *ofdev, int input, int speed) |
126 | { | 126 | { |
127 | struct rgmii_instance *dev = dev_get_drvdata(&ofdev->dev); | 127 | struct rgmii_instance *dev = dev_get_drvdata(&ofdev->dev); |
128 | struct rgmii_regs __iomem *p = dev->base; | 128 | struct rgmii_regs __iomem *p = dev->base; |
@@ -144,7 +144,7 @@ void rgmii_set_speed(struct of_device *ofdev, int input, int speed) | |||
144 | mutex_unlock(&dev->lock); | 144 | mutex_unlock(&dev->lock); |
145 | } | 145 | } |
146 | 146 | ||
147 | void rgmii_get_mdio(struct of_device *ofdev, int input) | 147 | void rgmii_get_mdio(struct platform_device *ofdev, int input) |
148 | { | 148 | { |
149 | struct rgmii_instance *dev = dev_get_drvdata(&ofdev->dev); | 149 | struct rgmii_instance *dev = dev_get_drvdata(&ofdev->dev); |
150 | struct rgmii_regs __iomem *p = dev->base; | 150 | struct rgmii_regs __iomem *p = dev->base; |
@@ -165,7 +165,7 @@ void rgmii_get_mdio(struct of_device *ofdev, int input) | |||
165 | DBG2(dev, " fer = 0x%08x\n", fer); | 165 | DBG2(dev, " fer = 0x%08x\n", fer); |
166 | } | 166 | } |
167 | 167 | ||
168 | void rgmii_put_mdio(struct of_device *ofdev, int input) | 168 | void rgmii_put_mdio(struct platform_device *ofdev, int input) |
169 | { | 169 | { |
170 | struct rgmii_instance *dev = dev_get_drvdata(&ofdev->dev); | 170 | struct rgmii_instance *dev = dev_get_drvdata(&ofdev->dev); |
171 | struct rgmii_regs __iomem *p = dev->base; | 171 | struct rgmii_regs __iomem *p = dev->base; |
@@ -186,7 +186,7 @@ void rgmii_put_mdio(struct of_device *ofdev, int input) | |||
186 | mutex_unlock(&dev->lock); | 186 | mutex_unlock(&dev->lock); |
187 | } | 187 | } |
188 | 188 | ||
189 | void rgmii_detach(struct of_device *ofdev, int input) | 189 | void rgmii_detach(struct platform_device *ofdev, int input) |
190 | { | 190 | { |
191 | struct rgmii_instance *dev = dev_get_drvdata(&ofdev->dev); | 191 | struct rgmii_instance *dev = dev_get_drvdata(&ofdev->dev); |
192 | struct rgmii_regs __iomem *p; | 192 | struct rgmii_regs __iomem *p; |
@@ -206,13 +206,13 @@ void rgmii_detach(struct of_device *ofdev, int input) | |||
206 | mutex_unlock(&dev->lock); | 206 | mutex_unlock(&dev->lock); |
207 | } | 207 | } |
208 | 208 | ||
209 | int rgmii_get_regs_len(struct of_device *ofdev) | 209 | int rgmii_get_regs_len(struct platform_device *ofdev) |
210 | { | 210 | { |
211 | return sizeof(struct emac_ethtool_regs_subhdr) + | 211 | return sizeof(struct emac_ethtool_regs_subhdr) + |
212 | sizeof(struct rgmii_regs); | 212 | sizeof(struct rgmii_regs); |
213 | } | 213 | } |
214 | 214 | ||
215 | void *rgmii_dump_regs(struct of_device *ofdev, void *buf) | 215 | void *rgmii_dump_regs(struct platform_device *ofdev, void *buf) |
216 | { | 216 | { |
217 | struct rgmii_instance *dev = dev_get_drvdata(&ofdev->dev); | 217 | struct rgmii_instance *dev = dev_get_drvdata(&ofdev->dev); |
218 | struct emac_ethtool_regs_subhdr *hdr = buf; | 218 | struct emac_ethtool_regs_subhdr *hdr = buf; |
@@ -228,7 +228,7 @@ void *rgmii_dump_regs(struct of_device *ofdev, void *buf) | |||
228 | } | 228 | } |
229 | 229 | ||
230 | 230 | ||
231 | static int __devinit rgmii_probe(struct of_device *ofdev, | 231 | static int __devinit rgmii_probe(struct platform_device *ofdev, |
232 | const struct of_device_id *match) | 232 | const struct of_device_id *match) |
233 | { | 233 | { |
234 | struct device_node *np = ofdev->dev.of_node; | 234 | struct device_node *np = ofdev->dev.of_node; |
@@ -293,7 +293,7 @@ static int __devinit rgmii_probe(struct of_device *ofdev, | |||
293 | return rc; | 293 | return rc; |
294 | } | 294 | } |
295 | 295 | ||
296 | static int __devexit rgmii_remove(struct of_device *ofdev) | 296 | static int __devexit rgmii_remove(struct platform_device *ofdev) |
297 | { | 297 | { |
298 | struct rgmii_instance *dev = dev_get_drvdata(&ofdev->dev); | 298 | struct rgmii_instance *dev = dev_get_drvdata(&ofdev->dev); |
299 | 299 | ||
diff --git a/drivers/net/ibm_newemac/rgmii.h b/drivers/net/ibm_newemac/rgmii.h index c4a4b358a270..d69799049865 100644 --- a/drivers/net/ibm_newemac/rgmii.h +++ b/drivers/net/ibm_newemac/rgmii.h | |||
@@ -51,20 +51,20 @@ struct rgmii_instance { | |||
51 | int users; | 51 | int users; |
52 | 52 | ||
53 | /* OF device instance */ | 53 | /* OF device instance */ |
54 | struct of_device *ofdev; | 54 | struct platform_device *ofdev; |
55 | }; | 55 | }; |
56 | 56 | ||
57 | #ifdef CONFIG_IBM_NEW_EMAC_RGMII | 57 | #ifdef CONFIG_IBM_NEW_EMAC_RGMII |
58 | 58 | ||
59 | extern int rgmii_init(void); | 59 | extern int rgmii_init(void); |
60 | extern void rgmii_exit(void); | 60 | extern void rgmii_exit(void); |
61 | extern int rgmii_attach(struct of_device *ofdev, int input, int mode); | 61 | extern int rgmii_attach(struct platform_device *ofdev, int input, int mode); |
62 | extern void rgmii_detach(struct of_device *ofdev, int input); | 62 | extern void rgmii_detach(struct platform_device *ofdev, int input); |
63 | extern void rgmii_get_mdio(struct of_device *ofdev, int input); | 63 | extern void rgmii_get_mdio(struct platform_device *ofdev, int input); |
64 | extern void rgmii_put_mdio(struct of_device *ofdev, int input); | 64 | extern void rgmii_put_mdio(struct platform_device *ofdev, int input); |
65 | extern void rgmii_set_speed(struct of_device *ofdev, int input, int speed); | 65 | extern void rgmii_set_speed(struct platform_device *ofdev, int input, int speed); |
66 | extern int rgmii_get_regs_len(struct of_device *ofdev); | 66 | extern int rgmii_get_regs_len(struct platform_device *ofdev); |
67 | extern void *rgmii_dump_regs(struct of_device *ofdev, void *buf); | 67 | extern void *rgmii_dump_regs(struct platform_device *ofdev, void *buf); |
68 | 68 | ||
69 | #else | 69 | #else |
70 | 70 | ||
diff --git a/drivers/net/ibm_newemac/tah.c b/drivers/net/ibm_newemac/tah.c index 044637144c43..299aa49490c0 100644 --- a/drivers/net/ibm_newemac/tah.c +++ b/drivers/net/ibm_newemac/tah.c | |||
@@ -23,7 +23,7 @@ | |||
23 | #include "emac.h" | 23 | #include "emac.h" |
24 | #include "core.h" | 24 | #include "core.h" |
25 | 25 | ||
26 | int __devinit tah_attach(struct of_device *ofdev, int channel) | 26 | int __devinit tah_attach(struct platform_device *ofdev, int channel) |
27 | { | 27 | { |
28 | struct tah_instance *dev = dev_get_drvdata(&ofdev->dev); | 28 | struct tah_instance *dev = dev_get_drvdata(&ofdev->dev); |
29 | 29 | ||
@@ -35,7 +35,7 @@ int __devinit tah_attach(struct of_device *ofdev, int channel) | |||
35 | return 0; | 35 | return 0; |
36 | } | 36 | } |
37 | 37 | ||
38 | void tah_detach(struct of_device *ofdev, int channel) | 38 | void tah_detach(struct platform_device *ofdev, int channel) |
39 | { | 39 | { |
40 | struct tah_instance *dev = dev_get_drvdata(&ofdev->dev); | 40 | struct tah_instance *dev = dev_get_drvdata(&ofdev->dev); |
41 | 41 | ||
@@ -44,7 +44,7 @@ void tah_detach(struct of_device *ofdev, int channel) | |||
44 | mutex_unlock(&dev->lock); | 44 | mutex_unlock(&dev->lock); |
45 | } | 45 | } |
46 | 46 | ||
47 | void tah_reset(struct of_device *ofdev) | 47 | void tah_reset(struct platform_device *ofdev) |
48 | { | 48 | { |
49 | struct tah_instance *dev = dev_get_drvdata(&ofdev->dev); | 49 | struct tah_instance *dev = dev_get_drvdata(&ofdev->dev); |
50 | struct tah_regs __iomem *p = dev->base; | 50 | struct tah_regs __iomem *p = dev->base; |
@@ -66,13 +66,13 @@ void tah_reset(struct of_device *ofdev) | |||
66 | TAH_MR_DIG); | 66 | TAH_MR_DIG); |
67 | } | 67 | } |
68 | 68 | ||
69 | int tah_get_regs_len(struct of_device *ofdev) | 69 | int tah_get_regs_len(struct platform_device *ofdev) |
70 | { | 70 | { |
71 | return sizeof(struct emac_ethtool_regs_subhdr) + | 71 | return sizeof(struct emac_ethtool_regs_subhdr) + |
72 | sizeof(struct tah_regs); | 72 | sizeof(struct tah_regs); |
73 | } | 73 | } |
74 | 74 | ||
75 | void *tah_dump_regs(struct of_device *ofdev, void *buf) | 75 | void *tah_dump_regs(struct platform_device *ofdev, void *buf) |
76 | { | 76 | { |
77 | struct tah_instance *dev = dev_get_drvdata(&ofdev->dev); | 77 | struct tah_instance *dev = dev_get_drvdata(&ofdev->dev); |
78 | struct emac_ethtool_regs_subhdr *hdr = buf; | 78 | struct emac_ethtool_regs_subhdr *hdr = buf; |
@@ -87,7 +87,7 @@ void *tah_dump_regs(struct of_device *ofdev, void *buf) | |||
87 | return regs + 1; | 87 | return regs + 1; |
88 | } | 88 | } |
89 | 89 | ||
90 | static int __devinit tah_probe(struct of_device *ofdev, | 90 | static int __devinit tah_probe(struct platform_device *ofdev, |
91 | const struct of_device_id *match) | 91 | const struct of_device_id *match) |
92 | { | 92 | { |
93 | struct device_node *np = ofdev->dev.of_node; | 93 | struct device_node *np = ofdev->dev.of_node; |
@@ -139,7 +139,7 @@ static int __devinit tah_probe(struct of_device *ofdev, | |||
139 | return rc; | 139 | return rc; |
140 | } | 140 | } |
141 | 141 | ||
142 | static int __devexit tah_remove(struct of_device *ofdev) | 142 | static int __devexit tah_remove(struct platform_device *ofdev) |
143 | { | 143 | { |
144 | struct tah_instance *dev = dev_get_drvdata(&ofdev->dev); | 144 | struct tah_instance *dev = dev_get_drvdata(&ofdev->dev); |
145 | 145 | ||
diff --git a/drivers/net/ibm_newemac/tah.h b/drivers/net/ibm_newemac/tah.h index a068b5658dad..61dbeca006d1 100644 --- a/drivers/net/ibm_newemac/tah.h +++ b/drivers/net/ibm_newemac/tah.h | |||
@@ -48,7 +48,7 @@ struct tah_instance { | |||
48 | int users; | 48 | int users; |
49 | 49 | ||
50 | /* OF device instance */ | 50 | /* OF device instance */ |
51 | struct of_device *ofdev; | 51 | struct platform_device *ofdev; |
52 | }; | 52 | }; |
53 | 53 | ||
54 | 54 | ||
@@ -74,11 +74,11 @@ struct tah_instance { | |||
74 | 74 | ||
75 | extern int tah_init(void); | 75 | extern int tah_init(void); |
76 | extern void tah_exit(void); | 76 | extern void tah_exit(void); |
77 | extern int tah_attach(struct of_device *ofdev, int channel); | 77 | extern int tah_attach(struct platform_device *ofdev, int channel); |
78 | extern void tah_detach(struct of_device *ofdev, int channel); | 78 | extern void tah_detach(struct platform_device *ofdev, int channel); |
79 | extern void tah_reset(struct of_device *ofdev); | 79 | extern void tah_reset(struct platform_device *ofdev); |
80 | extern int tah_get_regs_len(struct of_device *ofdev); | 80 | extern int tah_get_regs_len(struct platform_device *ofdev); |
81 | extern void *tah_dump_regs(struct of_device *ofdev, void *buf); | 81 | extern void *tah_dump_regs(struct platform_device *ofdev, void *buf); |
82 | 82 | ||
83 | #else | 83 | #else |
84 | 84 | ||
diff --git a/drivers/net/ibm_newemac/zmii.c b/drivers/net/ibm_newemac/zmii.c index 046dcd069c45..34ed6ee8ca8a 100644 --- a/drivers/net/ibm_newemac/zmii.c +++ b/drivers/net/ibm_newemac/zmii.c | |||
@@ -82,7 +82,7 @@ static inline u32 zmii_mode_mask(int mode, int input) | |||
82 | } | 82 | } |
83 | } | 83 | } |
84 | 84 | ||
85 | int __devinit zmii_attach(struct of_device *ofdev, int input, int *mode) | 85 | int __devinit zmii_attach(struct platform_device *ofdev, int input, int *mode) |
86 | { | 86 | { |
87 | struct zmii_instance *dev = dev_get_drvdata(&ofdev->dev); | 87 | struct zmii_instance *dev = dev_get_drvdata(&ofdev->dev); |
88 | struct zmii_regs __iomem *p = dev->base; | 88 | struct zmii_regs __iomem *p = dev->base; |
@@ -148,7 +148,7 @@ int __devinit zmii_attach(struct of_device *ofdev, int input, int *mode) | |||
148 | return 0; | 148 | return 0; |
149 | } | 149 | } |
150 | 150 | ||
151 | void zmii_get_mdio(struct of_device *ofdev, int input) | 151 | void zmii_get_mdio(struct platform_device *ofdev, int input) |
152 | { | 152 | { |
153 | struct zmii_instance *dev = dev_get_drvdata(&ofdev->dev); | 153 | struct zmii_instance *dev = dev_get_drvdata(&ofdev->dev); |
154 | u32 fer; | 154 | u32 fer; |
@@ -161,7 +161,7 @@ void zmii_get_mdio(struct of_device *ofdev, int input) | |||
161 | out_be32(&dev->base->fer, fer | ZMII_FER_MDI(input)); | 161 | out_be32(&dev->base->fer, fer | ZMII_FER_MDI(input)); |
162 | } | 162 | } |
163 | 163 | ||
164 | void zmii_put_mdio(struct of_device *ofdev, int input) | 164 | void zmii_put_mdio(struct platform_device *ofdev, int input) |
165 | { | 165 | { |
166 | struct zmii_instance *dev = dev_get_drvdata(&ofdev->dev); | 166 | struct zmii_instance *dev = dev_get_drvdata(&ofdev->dev); |
167 | 167 | ||
@@ -170,7 +170,7 @@ void zmii_put_mdio(struct of_device *ofdev, int input) | |||
170 | } | 170 | } |
171 | 171 | ||
172 | 172 | ||
173 | void zmii_set_speed(struct of_device *ofdev, int input, int speed) | 173 | void zmii_set_speed(struct platform_device *ofdev, int input, int speed) |
174 | { | 174 | { |
175 | struct zmii_instance *dev = dev_get_drvdata(&ofdev->dev); | 175 | struct zmii_instance *dev = dev_get_drvdata(&ofdev->dev); |
176 | u32 ssr; | 176 | u32 ssr; |
@@ -191,7 +191,7 @@ void zmii_set_speed(struct of_device *ofdev, int input, int speed) | |||
191 | mutex_unlock(&dev->lock); | 191 | mutex_unlock(&dev->lock); |
192 | } | 192 | } |
193 | 193 | ||
194 | void zmii_detach(struct of_device *ofdev, int input) | 194 | void zmii_detach(struct platform_device *ofdev, int input) |
195 | { | 195 | { |
196 | struct zmii_instance *dev = dev_get_drvdata(&ofdev->dev); | 196 | struct zmii_instance *dev = dev_get_drvdata(&ofdev->dev); |
197 | 197 | ||
@@ -210,13 +210,13 @@ void zmii_detach(struct of_device *ofdev, int input) | |||
210 | mutex_unlock(&dev->lock); | 210 | mutex_unlock(&dev->lock); |
211 | } | 211 | } |
212 | 212 | ||
213 | int zmii_get_regs_len(struct of_device *ofdev) | 213 | int zmii_get_regs_len(struct platform_device *ofdev) |
214 | { | 214 | { |
215 | return sizeof(struct emac_ethtool_regs_subhdr) + | 215 | return sizeof(struct emac_ethtool_regs_subhdr) + |
216 | sizeof(struct zmii_regs); | 216 | sizeof(struct zmii_regs); |
217 | } | 217 | } |
218 | 218 | ||
219 | void *zmii_dump_regs(struct of_device *ofdev, void *buf) | 219 | void *zmii_dump_regs(struct platform_device *ofdev, void *buf) |
220 | { | 220 | { |
221 | struct zmii_instance *dev = dev_get_drvdata(&ofdev->dev); | 221 | struct zmii_instance *dev = dev_get_drvdata(&ofdev->dev); |
222 | struct emac_ethtool_regs_subhdr *hdr = buf; | 222 | struct emac_ethtool_regs_subhdr *hdr = buf; |
@@ -231,7 +231,7 @@ void *zmii_dump_regs(struct of_device *ofdev, void *buf) | |||
231 | return regs + 1; | 231 | return regs + 1; |
232 | } | 232 | } |
233 | 233 | ||
234 | static int __devinit zmii_probe(struct of_device *ofdev, | 234 | static int __devinit zmii_probe(struct platform_device *ofdev, |
235 | const struct of_device_id *match) | 235 | const struct of_device_id *match) |
236 | { | 236 | { |
237 | struct device_node *np = ofdev->dev.of_node; | 237 | struct device_node *np = ofdev->dev.of_node; |
@@ -286,7 +286,7 @@ static int __devinit zmii_probe(struct of_device *ofdev, | |||
286 | return rc; | 286 | return rc; |
287 | } | 287 | } |
288 | 288 | ||
289 | static int __devexit zmii_remove(struct of_device *ofdev) | 289 | static int __devexit zmii_remove(struct platform_device *ofdev) |
290 | { | 290 | { |
291 | struct zmii_instance *dev = dev_get_drvdata(&ofdev->dev); | 291 | struct zmii_instance *dev = dev_get_drvdata(&ofdev->dev); |
292 | 292 | ||
diff --git a/drivers/net/ibm_newemac/zmii.h b/drivers/net/ibm_newemac/zmii.h index 6c9beba0c4b6..1333fa2b2781 100644 --- a/drivers/net/ibm_newemac/zmii.h +++ b/drivers/net/ibm_newemac/zmii.h | |||
@@ -48,20 +48,20 @@ struct zmii_instance { | |||
48 | u32 fer_save; | 48 | u32 fer_save; |
49 | 49 | ||
50 | /* OF device instance */ | 50 | /* OF device instance */ |
51 | struct of_device *ofdev; | 51 | struct platform_device *ofdev; |
52 | }; | 52 | }; |
53 | 53 | ||
54 | #ifdef CONFIG_IBM_NEW_EMAC_ZMII | 54 | #ifdef CONFIG_IBM_NEW_EMAC_ZMII |
55 | 55 | ||
56 | extern int zmii_init(void); | 56 | extern int zmii_init(void); |
57 | extern void zmii_exit(void); | 57 | extern void zmii_exit(void); |
58 | extern int zmii_attach(struct of_device *ofdev, int input, int *mode); | 58 | extern int zmii_attach(struct platform_device *ofdev, int input, int *mode); |
59 | extern void zmii_detach(struct of_device *ofdev, int input); | 59 | extern void zmii_detach(struct platform_device *ofdev, int input); |
60 | extern void zmii_get_mdio(struct of_device *ofdev, int input); | 60 | extern void zmii_get_mdio(struct platform_device *ofdev, int input); |
61 | extern void zmii_put_mdio(struct of_device *ofdev, int input); | 61 | extern void zmii_put_mdio(struct platform_device *ofdev, int input); |
62 | extern void zmii_set_speed(struct of_device *ofdev, int input, int speed); | 62 | extern void zmii_set_speed(struct platform_device *ofdev, int input, int speed); |
63 | extern int zmii_get_regs_len(struct of_device *ocpdev); | 63 | extern int zmii_get_regs_len(struct platform_device *ocpdev); |
64 | extern void *zmii_dump_regs(struct of_device *ofdev, void *buf); | 64 | extern void *zmii_dump_regs(struct platform_device *ofdev, void *buf); |
65 | 65 | ||
66 | #else | 66 | #else |
67 | # define zmii_init() 0 | 67 | # define zmii_init() 0 |
diff --git a/drivers/net/irda/sh_irda.c b/drivers/net/irda/sh_irda.c index edd5666f0ffb..9e3f4f54281d 100644 --- a/drivers/net/irda/sh_irda.c +++ b/drivers/net/irda/sh_irda.c | |||
@@ -748,7 +748,6 @@ static int __devinit sh_irda_probe(struct platform_device *pdev) | |||
748 | struct net_device *ndev; | 748 | struct net_device *ndev; |
749 | struct sh_irda_self *self; | 749 | struct sh_irda_self *self; |
750 | struct resource *res; | 750 | struct resource *res; |
751 | char clk_name[8]; | ||
752 | int irq; | 751 | int irq; |
753 | int err = -ENOMEM; | 752 | int err = -ENOMEM; |
754 | 753 | ||
@@ -775,10 +774,9 @@ static int __devinit sh_irda_probe(struct platform_device *pdev) | |||
775 | if (err) | 774 | if (err) |
776 | goto err_mem_2; | 775 | goto err_mem_2; |
777 | 776 | ||
778 | snprintf(clk_name, sizeof(clk_name), "irda%d", pdev->id); | 777 | self->clk = clk_get(&pdev->dev, NULL); |
779 | self->clk = clk_get(&pdev->dev, clk_name); | ||
780 | if (IS_ERR(self->clk)) { | 778 | if (IS_ERR(self->clk)) { |
781 | dev_err(&pdev->dev, "cannot get clock \"%s\"\n", clk_name); | 779 | dev_err(&pdev->dev, "cannot get irda clock\n"); |
782 | goto err_mem_3; | 780 | goto err_mem_3; |
783 | } | 781 | } |
784 | 782 | ||
diff --git a/drivers/net/ll_temac_main.c b/drivers/net/ll_temac_main.c index 4eea3f70c5cf..c7b624711f5e 100644 --- a/drivers/net/ll_temac_main.c +++ b/drivers/net/ll_temac_main.c | |||
@@ -159,7 +159,7 @@ static void temac_dma_dcr_out(struct temac_local *lp, int reg, u32 value) | |||
159 | * temac_dcr_setup - If the DMA is DCR based, then setup the address and | 159 | * temac_dcr_setup - If the DMA is DCR based, then setup the address and |
160 | * I/O functions | 160 | * I/O functions |
161 | */ | 161 | */ |
162 | static int temac_dcr_setup(struct temac_local *lp, struct of_device *op, | 162 | static int temac_dcr_setup(struct temac_local *lp, struct platform_device *op, |
163 | struct device_node *np) | 163 | struct device_node *np) |
164 | { | 164 | { |
165 | unsigned int dcrs; | 165 | unsigned int dcrs; |
@@ -184,7 +184,7 @@ static int temac_dcr_setup(struct temac_local *lp, struct of_device *op, | |||
184 | * temac_dcr_setup - This is a stub for when DCR is not supported, | 184 | * temac_dcr_setup - This is a stub for when DCR is not supported, |
185 | * such as with MicroBlaze | 185 | * such as with MicroBlaze |
186 | */ | 186 | */ |
187 | static int temac_dcr_setup(struct temac_local *lp, struct of_device *op, | 187 | static int temac_dcr_setup(struct temac_local *lp, struct platform_device *op, |
188 | struct device_node *np) | 188 | struct device_node *np) |
189 | { | 189 | { |
190 | return -1; | 190 | return -1; |
@@ -952,7 +952,7 @@ static const struct attribute_group temac_attr_group = { | |||
952 | }; | 952 | }; |
953 | 953 | ||
954 | static int __init | 954 | static int __init |
955 | temac_of_probe(struct of_device *op, const struct of_device_id *match) | 955 | temac_of_probe(struct platform_device *op, const struct of_device_id *match) |
956 | { | 956 | { |
957 | struct device_node *np; | 957 | struct device_node *np; |
958 | struct temac_local *lp; | 958 | struct temac_local *lp; |
@@ -1094,7 +1094,7 @@ temac_of_probe(struct of_device *op, const struct of_device_id *match) | |||
1094 | return rc; | 1094 | return rc; |
1095 | } | 1095 | } |
1096 | 1096 | ||
1097 | static int __devexit temac_of_remove(struct of_device *op) | 1097 | static int __devexit temac_of_remove(struct platform_device *op) |
1098 | { | 1098 | { |
1099 | struct net_device *ndev = dev_get_drvdata(&op->dev); | 1099 | struct net_device *ndev = dev_get_drvdata(&op->dev); |
1100 | struct temac_local *lp = netdev_priv(ndev); | 1100 | struct temac_local *lp = netdev_priv(ndev); |
diff --git a/drivers/net/myri10ge/myri10ge.c b/drivers/net/myri10ge/myri10ge.c index d771d1650d60..fb2c0927d3cc 100644 --- a/drivers/net/myri10ge/myri10ge.c +++ b/drivers/net/myri10ge/myri10ge.c | |||
@@ -239,6 +239,7 @@ struct myri10ge_priv { | |||
239 | int watchdog_resets; | 239 | int watchdog_resets; |
240 | int watchdog_pause; | 240 | int watchdog_pause; |
241 | int pause; | 241 | int pause; |
242 | bool fw_name_allocated; | ||
242 | char *fw_name; | 243 | char *fw_name; |
243 | char eeprom_strings[MYRI10GE_EEPROM_STRINGS_SIZE]; | 244 | char eeprom_strings[MYRI10GE_EEPROM_STRINGS_SIZE]; |
244 | char *product_code_string; | 245 | char *product_code_string; |
@@ -271,6 +272,7 @@ MODULE_FIRMWARE("myri10ge_eth_z8e.dat"); | |||
271 | MODULE_FIRMWARE("myri10ge_rss_ethp_z8e.dat"); | 272 | MODULE_FIRMWARE("myri10ge_rss_ethp_z8e.dat"); |
272 | MODULE_FIRMWARE("myri10ge_rss_eth_z8e.dat"); | 273 | MODULE_FIRMWARE("myri10ge_rss_eth_z8e.dat"); |
273 | 274 | ||
275 | /* Careful: must be accessed under kparam_block_sysfs_write */ | ||
274 | static char *myri10ge_fw_name = NULL; | 276 | static char *myri10ge_fw_name = NULL; |
275 | module_param(myri10ge_fw_name, charp, S_IRUGO | S_IWUSR); | 277 | module_param(myri10ge_fw_name, charp, S_IRUGO | S_IWUSR); |
276 | MODULE_PARM_DESC(myri10ge_fw_name, "Firmware image name"); | 278 | MODULE_PARM_DESC(myri10ge_fw_name, "Firmware image name"); |
@@ -376,6 +378,14 @@ static inline void put_be32(__be32 val, __be32 __iomem * p) | |||
376 | 378 | ||
377 | static struct net_device_stats *myri10ge_get_stats(struct net_device *dev); | 379 | static struct net_device_stats *myri10ge_get_stats(struct net_device *dev); |
378 | 380 | ||
381 | static void set_fw_name(struct myri10ge_priv *mgp, char *name, bool allocated) | ||
382 | { | ||
383 | if (mgp->fw_name_allocated) | ||
384 | kfree(mgp->fw_name); | ||
385 | mgp->fw_name = name; | ||
386 | mgp->fw_name_allocated = allocated; | ||
387 | } | ||
388 | |||
379 | static int | 389 | static int |
380 | myri10ge_send_cmd(struct myri10ge_priv *mgp, u32 cmd, | 390 | myri10ge_send_cmd(struct myri10ge_priv *mgp, u32 cmd, |
381 | struct myri10ge_cmd *data, int atomic) | 391 | struct myri10ge_cmd *data, int atomic) |
@@ -747,7 +757,7 @@ static int myri10ge_load_firmware(struct myri10ge_priv *mgp, int adopt) | |||
747 | dev_warn(&mgp->pdev->dev, "via hotplug\n"); | 757 | dev_warn(&mgp->pdev->dev, "via hotplug\n"); |
748 | } | 758 | } |
749 | 759 | ||
750 | mgp->fw_name = "adopted"; | 760 | set_fw_name(mgp, "adopted", false); |
751 | mgp->tx_boundary = 2048; | 761 | mgp->tx_boundary = 2048; |
752 | myri10ge_dummy_rdma(mgp, 1); | 762 | myri10ge_dummy_rdma(mgp, 1); |
753 | status = myri10ge_get_firmware_capabilities(mgp); | 763 | status = myri10ge_get_firmware_capabilities(mgp); |
@@ -3233,7 +3243,7 @@ static void myri10ge_firmware_probe(struct myri10ge_priv *mgp) | |||
3233 | * load the optimized firmware (which assumes aligned PCIe | 3243 | * load the optimized firmware (which assumes aligned PCIe |
3234 | * completions) in order to see if it works on this host. | 3244 | * completions) in order to see if it works on this host. |
3235 | */ | 3245 | */ |
3236 | mgp->fw_name = myri10ge_fw_aligned; | 3246 | set_fw_name(mgp, myri10ge_fw_aligned, false); |
3237 | status = myri10ge_load_firmware(mgp, 1); | 3247 | status = myri10ge_load_firmware(mgp, 1); |
3238 | if (status != 0) { | 3248 | if (status != 0) { |
3239 | goto abort; | 3249 | goto abort; |
@@ -3261,7 +3271,7 @@ static void myri10ge_firmware_probe(struct myri10ge_priv *mgp) | |||
3261 | abort: | 3271 | abort: |
3262 | /* fall back to using the unaligned firmware */ | 3272 | /* fall back to using the unaligned firmware */ |
3263 | mgp->tx_boundary = 2048; | 3273 | mgp->tx_boundary = 2048; |
3264 | mgp->fw_name = myri10ge_fw_unaligned; | 3274 | set_fw_name(mgp, myri10ge_fw_unaligned, false); |
3265 | 3275 | ||
3266 | } | 3276 | } |
3267 | 3277 | ||
@@ -3284,7 +3294,7 @@ static void myri10ge_select_firmware(struct myri10ge_priv *mgp) | |||
3284 | dev_info(&mgp->pdev->dev, "PCIE x%d Link\n", | 3294 | dev_info(&mgp->pdev->dev, "PCIE x%d Link\n", |
3285 | link_width); | 3295 | link_width); |
3286 | mgp->tx_boundary = 4096; | 3296 | mgp->tx_boundary = 4096; |
3287 | mgp->fw_name = myri10ge_fw_aligned; | 3297 | set_fw_name(mgp, myri10ge_fw_aligned, false); |
3288 | } else { | 3298 | } else { |
3289 | myri10ge_firmware_probe(mgp); | 3299 | myri10ge_firmware_probe(mgp); |
3290 | } | 3300 | } |
@@ -3293,22 +3303,29 @@ static void myri10ge_select_firmware(struct myri10ge_priv *mgp) | |||
3293 | dev_info(&mgp->pdev->dev, | 3303 | dev_info(&mgp->pdev->dev, |
3294 | "Assuming aligned completions (forced)\n"); | 3304 | "Assuming aligned completions (forced)\n"); |
3295 | mgp->tx_boundary = 4096; | 3305 | mgp->tx_boundary = 4096; |
3296 | mgp->fw_name = myri10ge_fw_aligned; | 3306 | set_fw_name(mgp, myri10ge_fw_aligned, false); |
3297 | } else { | 3307 | } else { |
3298 | dev_info(&mgp->pdev->dev, | 3308 | dev_info(&mgp->pdev->dev, |
3299 | "Assuming unaligned completions (forced)\n"); | 3309 | "Assuming unaligned completions (forced)\n"); |
3300 | mgp->tx_boundary = 2048; | 3310 | mgp->tx_boundary = 2048; |
3301 | mgp->fw_name = myri10ge_fw_unaligned; | 3311 | set_fw_name(mgp, myri10ge_fw_unaligned, false); |
3302 | } | 3312 | } |
3303 | } | 3313 | } |
3314 | |||
3315 | kparam_block_sysfs_write(myri10ge_fw_name); | ||
3304 | if (myri10ge_fw_name != NULL) { | 3316 | if (myri10ge_fw_name != NULL) { |
3305 | overridden = 1; | 3317 | char *fw_name = kstrdup(myri10ge_fw_name, GFP_KERNEL); |
3306 | mgp->fw_name = myri10ge_fw_name; | 3318 | if (fw_name) { |
3319 | overridden = 1; | ||
3320 | set_fw_name(mgp, fw_name, true); | ||
3321 | } | ||
3307 | } | 3322 | } |
3323 | kparam_unblock_sysfs_write(myri10ge_fw_name); | ||
3324 | |||
3308 | if (mgp->board_number < MYRI10GE_MAX_BOARDS && | 3325 | if (mgp->board_number < MYRI10GE_MAX_BOARDS && |
3309 | myri10ge_fw_names[mgp->board_number] != NULL && | 3326 | myri10ge_fw_names[mgp->board_number] != NULL && |
3310 | strlen(myri10ge_fw_names[mgp->board_number])) { | 3327 | strlen(myri10ge_fw_names[mgp->board_number])) { |
3311 | mgp->fw_name = myri10ge_fw_names[mgp->board_number]; | 3328 | set_fw_name(mgp, myri10ge_fw_names[mgp->board_number], false); |
3312 | overridden = 1; | 3329 | overridden = 1; |
3313 | } | 3330 | } |
3314 | if (overridden) | 3331 | if (overridden) |
@@ -3660,6 +3677,7 @@ static void myri10ge_probe_slices(struct myri10ge_priv *mgp) | |||
3660 | struct myri10ge_cmd cmd; | 3677 | struct myri10ge_cmd cmd; |
3661 | struct pci_dev *pdev = mgp->pdev; | 3678 | struct pci_dev *pdev = mgp->pdev; |
3662 | char *old_fw; | 3679 | char *old_fw; |
3680 | bool old_allocated; | ||
3663 | int i, status, ncpus, msix_cap; | 3681 | int i, status, ncpus, msix_cap; |
3664 | 3682 | ||
3665 | mgp->num_slices = 1; | 3683 | mgp->num_slices = 1; |
@@ -3672,17 +3690,23 @@ static void myri10ge_probe_slices(struct myri10ge_priv *mgp) | |||
3672 | 3690 | ||
3673 | /* try to load the slice aware rss firmware */ | 3691 | /* try to load the slice aware rss firmware */ |
3674 | old_fw = mgp->fw_name; | 3692 | old_fw = mgp->fw_name; |
3693 | old_allocated = mgp->fw_name_allocated; | ||
3694 | /* don't free old_fw if we override it. */ | ||
3695 | mgp->fw_name_allocated = false; | ||
3696 | |||
3675 | if (myri10ge_fw_name != NULL) { | 3697 | if (myri10ge_fw_name != NULL) { |
3676 | dev_info(&mgp->pdev->dev, "overriding rss firmware to %s\n", | 3698 | dev_info(&mgp->pdev->dev, "overriding rss firmware to %s\n", |
3677 | myri10ge_fw_name); | 3699 | myri10ge_fw_name); |
3678 | mgp->fw_name = myri10ge_fw_name; | 3700 | set_fw_name(mgp, myri10ge_fw_name, false); |
3679 | } else if (old_fw == myri10ge_fw_aligned) | 3701 | } else if (old_fw == myri10ge_fw_aligned) |
3680 | mgp->fw_name = myri10ge_fw_rss_aligned; | 3702 | set_fw_name(mgp, myri10ge_fw_rss_aligned, false); |
3681 | else | 3703 | else |
3682 | mgp->fw_name = myri10ge_fw_rss_unaligned; | 3704 | set_fw_name(mgp, myri10ge_fw_rss_unaligned, false); |
3683 | status = myri10ge_load_firmware(mgp, 0); | 3705 | status = myri10ge_load_firmware(mgp, 0); |
3684 | if (status != 0) { | 3706 | if (status != 0) { |
3685 | dev_info(&pdev->dev, "Rss firmware not found\n"); | 3707 | dev_info(&pdev->dev, "Rss firmware not found\n"); |
3708 | if (old_allocated) | ||
3709 | kfree(old_fw); | ||
3686 | return; | 3710 | return; |
3687 | } | 3711 | } |
3688 | 3712 | ||
@@ -3747,6 +3771,8 @@ static void myri10ge_probe_slices(struct myri10ge_priv *mgp) | |||
3747 | mgp->num_slices); | 3771 | mgp->num_slices); |
3748 | if (status == 0) { | 3772 | if (status == 0) { |
3749 | pci_disable_msix(pdev); | 3773 | pci_disable_msix(pdev); |
3774 | if (old_allocated) | ||
3775 | kfree(old_fw); | ||
3750 | return; | 3776 | return; |
3751 | } | 3777 | } |
3752 | if (status > 0) | 3778 | if (status > 0) |
@@ -3763,7 +3789,7 @@ disable_msix: | |||
3763 | 3789 | ||
3764 | abort_with_fw: | 3790 | abort_with_fw: |
3765 | mgp->num_slices = 1; | 3791 | mgp->num_slices = 1; |
3766 | mgp->fw_name = old_fw; | 3792 | set_fw_name(mgp, old_fw, old_allocated); |
3767 | myri10ge_load_firmware(mgp, 0); | 3793 | myri10ge_load_firmware(mgp, 0); |
3768 | } | 3794 | } |
3769 | 3795 | ||
@@ -3993,6 +4019,7 @@ abort_with_enabled: | |||
3993 | pci_disable_device(pdev); | 4019 | pci_disable_device(pdev); |
3994 | 4020 | ||
3995 | abort_with_netdev: | 4021 | abort_with_netdev: |
4022 | set_fw_name(mgp, NULL, false); | ||
3996 | free_netdev(netdev); | 4023 | free_netdev(netdev); |
3997 | return status; | 4024 | return status; |
3998 | } | 4025 | } |
@@ -4037,6 +4064,7 @@ static void myri10ge_remove(struct pci_dev *pdev) | |||
4037 | dma_free_coherent(&pdev->dev, sizeof(*mgp->cmd), | 4064 | dma_free_coherent(&pdev->dev, sizeof(*mgp->cmd), |
4038 | mgp->cmd, mgp->cmd_bus); | 4065 | mgp->cmd, mgp->cmd_bus); |
4039 | 4066 | ||
4067 | set_fw_name(mgp, NULL, false); | ||
4040 | free_netdev(netdev); | 4068 | free_netdev(netdev); |
4041 | pci_disable_device(pdev); | 4069 | pci_disable_device(pdev); |
4042 | pci_set_drvdata(pdev, NULL); | 4070 | pci_set_drvdata(pdev, NULL); |
diff --git a/drivers/net/myri_sbus.c b/drivers/net/myri_sbus.c index 04e552aa14ec..617f898ba5f0 100644 --- a/drivers/net/myri_sbus.c +++ b/drivers/net/myri_sbus.c | |||
@@ -926,7 +926,7 @@ static const struct net_device_ops myri_ops = { | |||
926 | .ndo_validate_addr = eth_validate_addr, | 926 | .ndo_validate_addr = eth_validate_addr, |
927 | }; | 927 | }; |
928 | 928 | ||
929 | static int __devinit myri_sbus_probe(struct of_device *op, const struct of_device_id *match) | 929 | static int __devinit myri_sbus_probe(struct platform_device *op, const struct of_device_id *match) |
930 | { | 930 | { |
931 | struct device_node *dp = op->dev.of_node; | 931 | struct device_node *dp = op->dev.of_node; |
932 | static unsigned version_printed; | 932 | static unsigned version_printed; |
@@ -1124,7 +1124,7 @@ err: | |||
1124 | return -ENODEV; | 1124 | return -ENODEV; |
1125 | } | 1125 | } |
1126 | 1126 | ||
1127 | static int __devexit myri_sbus_remove(struct of_device *op) | 1127 | static int __devexit myri_sbus_remove(struct platform_device *op) |
1128 | { | 1128 | { |
1129 | struct myri_eth *mp = dev_get_drvdata(&op->dev); | 1129 | struct myri_eth *mp = dev_get_drvdata(&op->dev); |
1130 | struct net_device *net_dev = mp->dev; | 1130 | struct net_device *net_dev = mp->dev; |
diff --git a/drivers/net/myri_sbus.h b/drivers/net/myri_sbus.h index ff363e95d9cf..80a2fa5cf757 100644 --- a/drivers/net/myri_sbus.h +++ b/drivers/net/myri_sbus.h | |||
@@ -288,7 +288,7 @@ struct myri_eth { | |||
288 | struct myri_eeprom eeprom; /* Local copy of EEPROM. */ | 288 | struct myri_eeprom eeprom; /* Local copy of EEPROM. */ |
289 | unsigned int reg_size; /* Size of register space. */ | 289 | unsigned int reg_size; /* Size of register space. */ |
290 | unsigned int shmem_base; /* Offset to shared ram. */ | 290 | unsigned int shmem_base; /* Offset to shared ram. */ |
291 | struct of_device *myri_op; /* Our OF device struct. */ | 291 | struct platform_device *myri_op; /* Our OF device struct. */ |
292 | }; | 292 | }; |
293 | 293 | ||
294 | /* We use this to acquire receive skb's that we can DMA directly into. */ | 294 | /* We use this to acquire receive skb's that we can DMA directly into. */ |
diff --git a/drivers/net/niu.c b/drivers/net/niu.c index 404f2d552888..bc695d53cdcc 100644 --- a/drivers/net/niu.c +++ b/drivers/net/niu.c | |||
@@ -9103,7 +9103,7 @@ retry: | |||
9103 | static int __devinit niu_n2_irq_init(struct niu *np, u8 *ldg_num_map) | 9103 | static int __devinit niu_n2_irq_init(struct niu *np, u8 *ldg_num_map) |
9104 | { | 9104 | { |
9105 | #ifdef CONFIG_SPARC64 | 9105 | #ifdef CONFIG_SPARC64 |
9106 | struct of_device *op = np->op; | 9106 | struct platform_device *op = np->op; |
9107 | const u32 *int_prop; | 9107 | const u32 *int_prop; |
9108 | int i; | 9108 | int i; |
9109 | 9109 | ||
@@ -9688,7 +9688,7 @@ static void __devinit niu_driver_version(void) | |||
9688 | 9688 | ||
9689 | static struct net_device * __devinit niu_alloc_and_init( | 9689 | static struct net_device * __devinit niu_alloc_and_init( |
9690 | struct device *gen_dev, struct pci_dev *pdev, | 9690 | struct device *gen_dev, struct pci_dev *pdev, |
9691 | struct of_device *op, const struct niu_ops *ops, | 9691 | struct platform_device *op, const struct niu_ops *ops, |
9692 | u8 port) | 9692 | u8 port) |
9693 | { | 9693 | { |
9694 | struct net_device *dev; | 9694 | struct net_device *dev; |
@@ -10064,7 +10064,7 @@ static const struct niu_ops niu_phys_ops = { | |||
10064 | .unmap_single = niu_phys_unmap_single, | 10064 | .unmap_single = niu_phys_unmap_single, |
10065 | }; | 10065 | }; |
10066 | 10066 | ||
10067 | static int __devinit niu_of_probe(struct of_device *op, | 10067 | static int __devinit niu_of_probe(struct platform_device *op, |
10068 | const struct of_device_id *match) | 10068 | const struct of_device_id *match) |
10069 | { | 10069 | { |
10070 | union niu_parent_id parent_id; | 10070 | union niu_parent_id parent_id; |
@@ -10179,7 +10179,7 @@ err_out: | |||
10179 | return err; | 10179 | return err; |
10180 | } | 10180 | } |
10181 | 10181 | ||
10182 | static int __devexit niu_of_remove(struct of_device *op) | 10182 | static int __devexit niu_of_remove(struct platform_device *op) |
10183 | { | 10183 | { |
10184 | struct net_device *dev = dev_get_drvdata(&op->dev); | 10184 | struct net_device *dev = dev_get_drvdata(&op->dev); |
10185 | 10185 | ||
diff --git a/drivers/net/phy/Kconfig b/drivers/net/phy/Kconfig index a527e37728cd..eb799b36c86a 100644 --- a/drivers/net/phy/Kconfig +++ b/drivers/net/phy/Kconfig | |||
@@ -5,7 +5,7 @@ | |||
5 | menuconfig PHYLIB | 5 | menuconfig PHYLIB |
6 | tristate "PHY Device support and infrastructure" | 6 | tristate "PHY Device support and infrastructure" |
7 | depends on !S390 | 7 | depends on !S390 |
8 | depends on NET_ETHERNET | 8 | depends on NETDEVICES |
9 | help | 9 | help |
10 | Ethernet controllers are usually attached to PHY | 10 | Ethernet controllers are usually attached to PHY |
11 | devices. This option provides infrastructure for | 11 | devices. This option provides infrastructure for |
diff --git a/drivers/net/phy/mdio-gpio.c b/drivers/net/phy/mdio-gpio.c index fc5fef2a8175..f62c7b717bc8 100644 --- a/drivers/net/phy/mdio-gpio.c +++ b/drivers/net/phy/mdio-gpio.c | |||
@@ -188,7 +188,7 @@ static int __devexit mdio_gpio_remove(struct platform_device *pdev) | |||
188 | 188 | ||
189 | #ifdef CONFIG_OF_GPIO | 189 | #ifdef CONFIG_OF_GPIO |
190 | 190 | ||
191 | static int __devinit mdio_ofgpio_probe(struct of_device *ofdev, | 191 | static int __devinit mdio_ofgpio_probe(struct platform_device *ofdev, |
192 | const struct of_device_id *match) | 192 | const struct of_device_id *match) |
193 | { | 193 | { |
194 | struct mdio_gpio_platform_data *pdata; | 194 | struct mdio_gpio_platform_data *pdata; |
@@ -224,7 +224,7 @@ out_free: | |||
224 | return -ENODEV; | 224 | return -ENODEV; |
225 | } | 225 | } |
226 | 226 | ||
227 | static int __devexit mdio_ofgpio_remove(struct of_device *ofdev) | 227 | static int __devexit mdio_ofgpio_remove(struct platform_device *ofdev) |
228 | { | 228 | { |
229 | mdio_gpio_bus_destroy(&ofdev->dev); | 229 | mdio_gpio_bus_destroy(&ofdev->dev); |
230 | kfree(ofdev->dev.platform_data); | 230 | kfree(ofdev->dev.platform_data); |
diff --git a/drivers/net/phy/phy.c b/drivers/net/phy/phy.c index 5130db8f5c4e..1bb16cb79433 100644 --- a/drivers/net/phy/phy.c +++ b/drivers/net/phy/phy.c | |||
@@ -301,7 +301,7 @@ EXPORT_SYMBOL(phy_ethtool_gset); | |||
301 | /** | 301 | /** |
302 | * phy_mii_ioctl - generic PHY MII ioctl interface | 302 | * phy_mii_ioctl - generic PHY MII ioctl interface |
303 | * @phydev: the phy_device struct | 303 | * @phydev: the phy_device struct |
304 | * @mii_data: MII ioctl data | 304 | * @ifr: &struct ifreq for socket ioctl's |
305 | * @cmd: ioctl cmd to execute | 305 | * @cmd: ioctl cmd to execute |
306 | * | 306 | * |
307 | * Note that this function is currently incompatible with the | 307 | * Note that this function is currently incompatible with the |
diff --git a/drivers/net/qlcnic/qlcnic_main.c b/drivers/net/qlcnic/qlcnic_main.c index b9615bd745ea..bf6d87adda4f 100644 --- a/drivers/net/qlcnic/qlcnic_main.c +++ b/drivers/net/qlcnic/qlcnic_main.c | |||
@@ -473,48 +473,58 @@ qlcnic_cleanup_pci_map(struct qlcnic_adapter *adapter) | |||
473 | static int | 473 | static int |
474 | qlcnic_init_pci_info(struct qlcnic_adapter *adapter) | 474 | qlcnic_init_pci_info(struct qlcnic_adapter *adapter) |
475 | { | 475 | { |
476 | struct qlcnic_pci_info pci_info[QLCNIC_MAX_PCI_FUNC]; | 476 | struct qlcnic_pci_info *pci_info; |
477 | int i, ret = 0, err; | 477 | int i, ret = 0, err; |
478 | u8 pfn; | 478 | u8 pfn; |
479 | 479 | ||
480 | if (!adapter->npars) | 480 | pci_info = kcalloc(QLCNIC_MAX_PCI_FUNC, sizeof(*pci_info), GFP_KERNEL); |
481 | adapter->npars = kzalloc(sizeof(struct qlcnic_npar_info) * | 481 | if (!pci_info) |
482 | QLCNIC_MAX_PCI_FUNC, GFP_KERNEL); | ||
483 | if (!adapter->npars) | ||
484 | return -ENOMEM; | 482 | return -ENOMEM; |
485 | 483 | ||
486 | if (!adapter->eswitch) | 484 | adapter->npars = kzalloc(sizeof(struct qlcnic_npar_info) * |
487 | adapter->eswitch = kzalloc(sizeof(struct qlcnic_eswitch) * | 485 | QLCNIC_MAX_PCI_FUNC, GFP_KERNEL); |
486 | if (!adapter->npars) { | ||
487 | err = -ENOMEM; | ||
488 | goto err_pci_info; | ||
489 | } | ||
490 | |||
491 | adapter->eswitch = kzalloc(sizeof(struct qlcnic_eswitch) * | ||
488 | QLCNIC_NIU_MAX_XG_PORTS, GFP_KERNEL); | 492 | QLCNIC_NIU_MAX_XG_PORTS, GFP_KERNEL); |
489 | if (!adapter->eswitch) { | 493 | if (!adapter->eswitch) { |
490 | err = -ENOMEM; | 494 | err = -ENOMEM; |
491 | goto err_eswitch; | 495 | goto err_npars; |
492 | } | 496 | } |
493 | 497 | ||
494 | ret = qlcnic_get_pci_info(adapter, pci_info); | 498 | ret = qlcnic_get_pci_info(adapter, pci_info); |
495 | if (!ret) { | 499 | if (ret) |
496 | for (i = 0; i < QLCNIC_MAX_PCI_FUNC; i++) { | 500 | goto err_eswitch; |
497 | pfn = pci_info[i].id; | ||
498 | if (pfn > QLCNIC_MAX_PCI_FUNC) | ||
499 | return QL_STATUS_INVALID_PARAM; | ||
500 | adapter->npars[pfn].active = pci_info[i].active; | ||
501 | adapter->npars[pfn].type = pci_info[i].type; | ||
502 | adapter->npars[pfn].phy_port = pci_info[i].default_port; | ||
503 | adapter->npars[pfn].mac_learning = DEFAULT_MAC_LEARN; | ||
504 | adapter->npars[pfn].min_bw = pci_info[i].tx_min_bw; | ||
505 | adapter->npars[pfn].max_bw = pci_info[i].tx_max_bw; | ||
506 | } | ||
507 | |||
508 | for (i = 0; i < QLCNIC_NIU_MAX_XG_PORTS; i++) | ||
509 | adapter->eswitch[i].flags |= QLCNIC_SWITCH_ENABLE; | ||
510 | 501 | ||
511 | return ret; | 502 | for (i = 0; i < QLCNIC_MAX_PCI_FUNC; i++) { |
503 | pfn = pci_info[i].id; | ||
504 | if (pfn > QLCNIC_MAX_PCI_FUNC) | ||
505 | return QL_STATUS_INVALID_PARAM; | ||
506 | adapter->npars[pfn].active = pci_info[i].active; | ||
507 | adapter->npars[pfn].type = pci_info[i].type; | ||
508 | adapter->npars[pfn].phy_port = pci_info[i].default_port; | ||
509 | adapter->npars[pfn].mac_learning = DEFAULT_MAC_LEARN; | ||
510 | adapter->npars[pfn].min_bw = pci_info[i].tx_min_bw; | ||
511 | adapter->npars[pfn].max_bw = pci_info[i].tx_max_bw; | ||
512 | } | 512 | } |
513 | 513 | ||
514 | for (i = 0; i < QLCNIC_NIU_MAX_XG_PORTS; i++) | ||
515 | adapter->eswitch[i].flags |= QLCNIC_SWITCH_ENABLE; | ||
516 | |||
517 | kfree(pci_info); | ||
518 | return 0; | ||
519 | |||
520 | err_eswitch: | ||
514 | kfree(adapter->eswitch); | 521 | kfree(adapter->eswitch); |
515 | adapter->eswitch = NULL; | 522 | adapter->eswitch = NULL; |
516 | err_eswitch: | 523 | err_npars: |
517 | kfree(adapter->npars); | 524 | kfree(adapter->npars); |
525 | adapter->npars = NULL; | ||
526 | err_pci_info: | ||
527 | kfree(pci_info); | ||
518 | 528 | ||
519 | return ret; | 529 | return ret; |
520 | } | 530 | } |
@@ -3361,15 +3371,21 @@ qlcnic_sysfs_read_pci_config(struct file *file, struct kobject *kobj, | |||
3361 | struct device *dev = container_of(kobj, struct device, kobj); | 3371 | struct device *dev = container_of(kobj, struct device, kobj); |
3362 | struct qlcnic_adapter *adapter = dev_get_drvdata(dev); | 3372 | struct qlcnic_adapter *adapter = dev_get_drvdata(dev); |
3363 | struct qlcnic_pci_func_cfg pci_cfg[QLCNIC_MAX_PCI_FUNC]; | 3373 | struct qlcnic_pci_func_cfg pci_cfg[QLCNIC_MAX_PCI_FUNC]; |
3364 | struct qlcnic_pci_info pci_info[QLCNIC_MAX_PCI_FUNC]; | 3374 | struct qlcnic_pci_info *pci_info; |
3365 | int i, ret; | 3375 | int i, ret; |
3366 | 3376 | ||
3367 | if (size != sizeof(pci_cfg)) | 3377 | if (size != sizeof(pci_cfg)) |
3368 | return QL_STATUS_INVALID_PARAM; | 3378 | return QL_STATUS_INVALID_PARAM; |
3369 | 3379 | ||
3380 | pci_info = kcalloc(QLCNIC_MAX_PCI_FUNC, sizeof(*pci_info), GFP_KERNEL); | ||
3381 | if (!pci_info) | ||
3382 | return -ENOMEM; | ||
3383 | |||
3370 | ret = qlcnic_get_pci_info(adapter, pci_info); | 3384 | ret = qlcnic_get_pci_info(adapter, pci_info); |
3371 | if (ret) | 3385 | if (ret) { |
3386 | kfree(pci_info); | ||
3372 | return ret; | 3387 | return ret; |
3388 | } | ||
3373 | 3389 | ||
3374 | for (i = 0; i < QLCNIC_MAX_PCI_FUNC ; i++) { | 3390 | for (i = 0; i < QLCNIC_MAX_PCI_FUNC ; i++) { |
3375 | pci_cfg[i].pci_func = pci_info[i].id; | 3391 | pci_cfg[i].pci_func = pci_info[i].id; |
@@ -3380,8 +3396,8 @@ qlcnic_sysfs_read_pci_config(struct file *file, struct kobject *kobj, | |||
3380 | memcpy(&pci_cfg[i].def_mac_addr, &pci_info[i].mac, ETH_ALEN); | 3396 | memcpy(&pci_cfg[i].def_mac_addr, &pci_info[i].mac, ETH_ALEN); |
3381 | } | 3397 | } |
3382 | memcpy(buf, &pci_cfg, size); | 3398 | memcpy(buf, &pci_cfg, size); |
3399 | kfree(pci_info); | ||
3383 | return size; | 3400 | return size; |
3384 | |||
3385 | } | 3401 | } |
3386 | static struct bin_attribute bin_attr_npar_config = { | 3402 | static struct bin_attribute bin_attr_npar_config = { |
3387 | .attr = {.name = "npar_config", .mode = (S_IRUGO | S_IWUSR)}, | 3403 | .attr = {.name = "npar_config", .mode = (S_IRUGO | S_IWUSR)}, |
diff --git a/drivers/net/sunbmac.c b/drivers/net/sunbmac.c index 09c071bd6ad4..618643e3ca3e 100644 --- a/drivers/net/sunbmac.c +++ b/drivers/net/sunbmac.c | |||
@@ -97,7 +97,7 @@ static int qec_global_reset(void __iomem *gregs) | |||
97 | 97 | ||
98 | static void qec_init(struct bigmac *bp) | 98 | static void qec_init(struct bigmac *bp) |
99 | { | 99 | { |
100 | struct of_device *qec_op = bp->qec_op; | 100 | struct platform_device *qec_op = bp->qec_op; |
101 | void __iomem *gregs = bp->gregs; | 101 | void __iomem *gregs = bp->gregs; |
102 | u8 bsizes = bp->bigmac_bursts; | 102 | u8 bsizes = bp->bigmac_bursts; |
103 | u32 regval; | 103 | u32 regval; |
@@ -1083,8 +1083,8 @@ static const struct net_device_ops bigmac_ops = { | |||
1083 | .ndo_validate_addr = eth_validate_addr, | 1083 | .ndo_validate_addr = eth_validate_addr, |
1084 | }; | 1084 | }; |
1085 | 1085 | ||
1086 | static int __devinit bigmac_ether_init(struct of_device *op, | 1086 | static int __devinit bigmac_ether_init(struct platform_device *op, |
1087 | struct of_device *qec_op) | 1087 | struct platform_device *qec_op) |
1088 | { | 1088 | { |
1089 | static int version_printed; | 1089 | static int version_printed; |
1090 | struct net_device *dev; | 1090 | struct net_device *dev; |
@@ -1242,25 +1242,25 @@ fail_and_cleanup: | |||
1242 | /* QEC can be the parent of either QuadEthernet or a BigMAC. We want | 1242 | /* QEC can be the parent of either QuadEthernet or a BigMAC. We want |
1243 | * the latter. | 1243 | * the latter. |
1244 | */ | 1244 | */ |
1245 | static int __devinit bigmac_sbus_probe(struct of_device *op, | 1245 | static int __devinit bigmac_sbus_probe(struct platform_device *op, |
1246 | const struct of_device_id *match) | 1246 | const struct of_device_id *match) |
1247 | { | 1247 | { |
1248 | struct device *parent = op->dev.parent; | 1248 | struct device *parent = op->dev.parent; |
1249 | struct of_device *qec_op; | 1249 | struct platform_device *qec_op; |
1250 | 1250 | ||
1251 | qec_op = to_of_device(parent); | 1251 | qec_op = to_platform_device(parent); |
1252 | 1252 | ||
1253 | return bigmac_ether_init(op, qec_op); | 1253 | return bigmac_ether_init(op, qec_op); |
1254 | } | 1254 | } |
1255 | 1255 | ||
1256 | static int __devexit bigmac_sbus_remove(struct of_device *op) | 1256 | static int __devexit bigmac_sbus_remove(struct platform_device *op) |
1257 | { | 1257 | { |
1258 | struct bigmac *bp = dev_get_drvdata(&op->dev); | 1258 | struct bigmac *bp = dev_get_drvdata(&op->dev); |
1259 | struct device *parent = op->dev.parent; | 1259 | struct device *parent = op->dev.parent; |
1260 | struct net_device *net_dev = bp->dev; | 1260 | struct net_device *net_dev = bp->dev; |
1261 | struct of_device *qec_op; | 1261 | struct platform_device *qec_op; |
1262 | 1262 | ||
1263 | qec_op = to_of_device(parent); | 1263 | qec_op = to_platform_device(parent); |
1264 | 1264 | ||
1265 | unregister_netdev(net_dev); | 1265 | unregister_netdev(net_dev); |
1266 | 1266 | ||
diff --git a/drivers/net/sunbmac.h b/drivers/net/sunbmac.h index 8840bc0b840b..8db88945b889 100644 --- a/drivers/net/sunbmac.h +++ b/drivers/net/sunbmac.h | |||
@@ -329,8 +329,8 @@ struct bigmac { | |||
329 | unsigned int timer_ticks; | 329 | unsigned int timer_ticks; |
330 | 330 | ||
331 | struct net_device_stats enet_stats; | 331 | struct net_device_stats enet_stats; |
332 | struct of_device *qec_op; | 332 | struct platform_device *qec_op; |
333 | struct of_device *bigmac_op; | 333 | struct platform_device *bigmac_op; |
334 | struct net_device *dev; | 334 | struct net_device *dev; |
335 | }; | 335 | }; |
336 | 336 | ||
diff --git a/drivers/net/sunhme.c b/drivers/net/sunhme.c index eec443f64079..bd0df1c14955 100644 --- a/drivers/net/sunhme.c +++ b/drivers/net/sunhme.c | |||
@@ -1591,7 +1591,7 @@ static int happy_meal_init(struct happy_meal *hp) | |||
1591 | */ | 1591 | */ |
1592 | #ifdef CONFIG_SBUS | 1592 | #ifdef CONFIG_SBUS |
1593 | if ((hp->happy_flags & HFLAG_PCI) == 0) { | 1593 | if ((hp->happy_flags & HFLAG_PCI) == 0) { |
1594 | struct of_device *op = hp->happy_dev; | 1594 | struct platform_device *op = hp->happy_dev; |
1595 | if (sbus_can_dma_64bit()) { | 1595 | if (sbus_can_dma_64bit()) { |
1596 | sbus_set_sbus64(&op->dev, | 1596 | sbus_set_sbus64(&op->dev, |
1597 | hp->happy_bursts); | 1597 | hp->happy_bursts); |
@@ -2480,7 +2480,7 @@ static void hme_get_drvinfo(struct net_device *dev, struct ethtool_drvinfo *info | |||
2480 | #ifdef CONFIG_SBUS | 2480 | #ifdef CONFIG_SBUS |
2481 | else { | 2481 | else { |
2482 | const struct linux_prom_registers *regs; | 2482 | const struct linux_prom_registers *regs; |
2483 | struct of_device *op = hp->happy_dev; | 2483 | struct platform_device *op = hp->happy_dev; |
2484 | regs = of_get_property(op->dev.of_node, "regs", NULL); | 2484 | regs = of_get_property(op->dev.of_node, "regs", NULL); |
2485 | if (regs) | 2485 | if (regs) |
2486 | sprintf(info->bus_info, "SBUS:%d", | 2486 | sprintf(info->bus_info, "SBUS:%d", |
@@ -2515,13 +2515,13 @@ static int hme_version_printed; | |||
2515 | * | 2515 | * |
2516 | * Return NULL on failure. | 2516 | * Return NULL on failure. |
2517 | */ | 2517 | */ |
2518 | static struct quattro * __devinit quattro_sbus_find(struct of_device *child) | 2518 | static struct quattro * __devinit quattro_sbus_find(struct platform_device *child) |
2519 | { | 2519 | { |
2520 | struct device *parent = child->dev.parent; | 2520 | struct device *parent = child->dev.parent; |
2521 | struct of_device *op; | 2521 | struct platform_device *op; |
2522 | struct quattro *qp; | 2522 | struct quattro *qp; |
2523 | 2523 | ||
2524 | op = to_of_device(parent); | 2524 | op = to_platform_device(parent); |
2525 | qp = dev_get_drvdata(&op->dev); | 2525 | qp = dev_get_drvdata(&op->dev); |
2526 | if (qp) | 2526 | if (qp) |
2527 | return qp; | 2527 | return qp; |
@@ -2551,7 +2551,7 @@ static int __init quattro_sbus_register_irqs(void) | |||
2551 | struct quattro *qp; | 2551 | struct quattro *qp; |
2552 | 2552 | ||
2553 | for (qp = qfe_sbus_list; qp != NULL; qp = qp->next) { | 2553 | for (qp = qfe_sbus_list; qp != NULL; qp = qp->next) { |
2554 | struct of_device *op = qp->quattro_dev; | 2554 | struct platform_device *op = qp->quattro_dev; |
2555 | int err, qfe_slot, skip = 0; | 2555 | int err, qfe_slot, skip = 0; |
2556 | 2556 | ||
2557 | for (qfe_slot = 0; qfe_slot < 4; qfe_slot++) { | 2557 | for (qfe_slot = 0; qfe_slot < 4; qfe_slot++) { |
@@ -2580,7 +2580,7 @@ static void quattro_sbus_free_irqs(void) | |||
2580 | struct quattro *qp; | 2580 | struct quattro *qp; |
2581 | 2581 | ||
2582 | for (qp = qfe_sbus_list; qp != NULL; qp = qp->next) { | 2582 | for (qp = qfe_sbus_list; qp != NULL; qp = qp->next) { |
2583 | struct of_device *op = qp->quattro_dev; | 2583 | struct platform_device *op = qp->quattro_dev; |
2584 | int qfe_slot, skip = 0; | 2584 | int qfe_slot, skip = 0; |
2585 | 2585 | ||
2586 | for (qfe_slot = 0; qfe_slot < 4; qfe_slot++) { | 2586 | for (qfe_slot = 0; qfe_slot < 4; qfe_slot++) { |
@@ -2639,7 +2639,7 @@ static const struct net_device_ops hme_netdev_ops = { | |||
2639 | }; | 2639 | }; |
2640 | 2640 | ||
2641 | #ifdef CONFIG_SBUS | 2641 | #ifdef CONFIG_SBUS |
2642 | static int __devinit happy_meal_sbus_probe_one(struct of_device *op, int is_qfe) | 2642 | static int __devinit happy_meal_sbus_probe_one(struct platform_device *op, int is_qfe) |
2643 | { | 2643 | { |
2644 | struct device_node *dp = op->dev.of_node, *sbus_dp; | 2644 | struct device_node *dp = op->dev.of_node, *sbus_dp; |
2645 | struct quattro *qp = NULL; | 2645 | struct quattro *qp = NULL; |
@@ -2648,7 +2648,7 @@ static int __devinit happy_meal_sbus_probe_one(struct of_device *op, int is_qfe) | |||
2648 | int i, qfe_slot = -1; | 2648 | int i, qfe_slot = -1; |
2649 | int err = -ENODEV; | 2649 | int err = -ENODEV; |
2650 | 2650 | ||
2651 | sbus_dp = to_of_device(op->dev.parent)->dev.of_node; | 2651 | sbus_dp = op->dev.parent->of_node; |
2652 | 2652 | ||
2653 | /* We can match PCI devices too, do not accept those here. */ | 2653 | /* We can match PCI devices too, do not accept those here. */ |
2654 | if (strcmp(sbus_dp->name, "sbus")) | 2654 | if (strcmp(sbus_dp->name, "sbus")) |
@@ -3235,7 +3235,7 @@ static void happy_meal_pci_exit(void) | |||
3235 | #endif | 3235 | #endif |
3236 | 3236 | ||
3237 | #ifdef CONFIG_SBUS | 3237 | #ifdef CONFIG_SBUS |
3238 | static int __devinit hme_sbus_probe(struct of_device *op, const struct of_device_id *match) | 3238 | static int __devinit hme_sbus_probe(struct platform_device *op, const struct of_device_id *match) |
3239 | { | 3239 | { |
3240 | struct device_node *dp = op->dev.of_node; | 3240 | struct device_node *dp = op->dev.of_node; |
3241 | const char *model = of_get_property(dp, "model", NULL); | 3241 | const char *model = of_get_property(dp, "model", NULL); |
@@ -3247,7 +3247,7 @@ static int __devinit hme_sbus_probe(struct of_device *op, const struct of_device | |||
3247 | return happy_meal_sbus_probe_one(op, is_qfe); | 3247 | return happy_meal_sbus_probe_one(op, is_qfe); |
3248 | } | 3248 | } |
3249 | 3249 | ||
3250 | static int __devexit hme_sbus_remove(struct of_device *op) | 3250 | static int __devexit hme_sbus_remove(struct platform_device *op) |
3251 | { | 3251 | { |
3252 | struct happy_meal *hp = dev_get_drvdata(&op->dev); | 3252 | struct happy_meal *hp = dev_get_drvdata(&op->dev); |
3253 | struct net_device *net_dev = hp->dev; | 3253 | struct net_device *net_dev = hp->dev; |
diff --git a/drivers/net/sunhme.h b/drivers/net/sunhme.h index efd2ca0fcad3..756b5bf3aa89 100644 --- a/drivers/net/sunhme.h +++ b/drivers/net/sunhme.h | |||
@@ -407,7 +407,7 @@ struct happy_meal { | |||
407 | void (*write_rxd)(struct happy_meal_rxd *, u32, u32); | 407 | void (*write_rxd)(struct happy_meal_rxd *, u32, u32); |
408 | #endif | 408 | #endif |
409 | 409 | ||
410 | /* This is either an of_device or a pci_dev. */ | 410 | /* This is either an platform_device or a pci_dev. */ |
411 | void *happy_dev; | 411 | void *happy_dev; |
412 | struct device *dma_dev; | 412 | struct device *dma_dev; |
413 | 413 | ||
diff --git a/drivers/net/sunlance.c b/drivers/net/sunlance.c index ee364fa75634..8dcb858f2168 100644 --- a/drivers/net/sunlance.c +++ b/drivers/net/sunlance.c | |||
@@ -250,7 +250,7 @@ struct lance_private { | |||
250 | int rx_new, tx_new; | 250 | int rx_new, tx_new; |
251 | int rx_old, tx_old; | 251 | int rx_old, tx_old; |
252 | 252 | ||
253 | struct of_device *ledma; /* If set this points to ledma */ | 253 | struct platform_device *ledma; /* If set this points to ledma */ |
254 | char tpe; /* cable-selection is TPE */ | 254 | char tpe; /* cable-selection is TPE */ |
255 | char auto_select; /* cable-selection by carrier */ | 255 | char auto_select; /* cable-selection by carrier */ |
256 | char burst_sizes; /* ledma SBus burst sizes */ | 256 | char burst_sizes; /* ledma SBus burst sizes */ |
@@ -265,8 +265,8 @@ struct lance_private { | |||
265 | char *name; | 265 | char *name; |
266 | dma_addr_t init_block_dvma; | 266 | dma_addr_t init_block_dvma; |
267 | struct net_device *dev; /* Backpointer */ | 267 | struct net_device *dev; /* Backpointer */ |
268 | struct of_device *op; | 268 | struct platform_device *op; |
269 | struct of_device *lebuffer; | 269 | struct platform_device *lebuffer; |
270 | struct timer_list multicast_timer; | 270 | struct timer_list multicast_timer; |
271 | }; | 271 | }; |
272 | 272 | ||
@@ -1272,7 +1272,7 @@ static void lance_free_hwresources(struct lance_private *lp) | |||
1272 | if (lp->lregs) | 1272 | if (lp->lregs) |
1273 | of_iounmap(&lp->op->resource[0], lp->lregs, LANCE_REG_SIZE); | 1273 | of_iounmap(&lp->op->resource[0], lp->lregs, LANCE_REG_SIZE); |
1274 | if (lp->dregs) { | 1274 | if (lp->dregs) { |
1275 | struct of_device *ledma = lp->ledma; | 1275 | struct platform_device *ledma = lp->ledma; |
1276 | 1276 | ||
1277 | of_iounmap(&ledma->resource[0], lp->dregs, | 1277 | of_iounmap(&ledma->resource[0], lp->dregs, |
1278 | resource_size(&ledma->resource[0])); | 1278 | resource_size(&ledma->resource[0])); |
@@ -1319,9 +1319,9 @@ static const struct net_device_ops sparc_lance_ops = { | |||
1319 | .ndo_validate_addr = eth_validate_addr, | 1319 | .ndo_validate_addr = eth_validate_addr, |
1320 | }; | 1320 | }; |
1321 | 1321 | ||
1322 | static int __devinit sparc_lance_probe_one(struct of_device *op, | 1322 | static int __devinit sparc_lance_probe_one(struct platform_device *op, |
1323 | struct of_device *ledma, | 1323 | struct platform_device *ledma, |
1324 | struct of_device *lebuffer) | 1324 | struct platform_device *lebuffer) |
1325 | { | 1325 | { |
1326 | struct device_node *dp = op->dev.of_node; | 1326 | struct device_node *dp = op->dev.of_node; |
1327 | static unsigned version_printed; | 1327 | static unsigned version_printed; |
@@ -1503,9 +1503,9 @@ fail: | |||
1503 | return -ENODEV; | 1503 | return -ENODEV; |
1504 | } | 1504 | } |
1505 | 1505 | ||
1506 | static int __devinit sunlance_sbus_probe(struct of_device *op, const struct of_device_id *match) | 1506 | static int __devinit sunlance_sbus_probe(struct platform_device *op, const struct of_device_id *match) |
1507 | { | 1507 | { |
1508 | struct of_device *parent = to_of_device(op->dev.parent); | 1508 | struct platform_device *parent = to_platform_device(op->dev.parent); |
1509 | struct device_node *parent_dp = parent->dev.of_node; | 1509 | struct device_node *parent_dp = parent->dev.of_node; |
1510 | int err; | 1510 | int err; |
1511 | 1511 | ||
@@ -1519,7 +1519,7 @@ static int __devinit sunlance_sbus_probe(struct of_device *op, const struct of_d | |||
1519 | return err; | 1519 | return err; |
1520 | } | 1520 | } |
1521 | 1521 | ||
1522 | static int __devexit sunlance_sbus_remove(struct of_device *op) | 1522 | static int __devexit sunlance_sbus_remove(struct platform_device *op) |
1523 | { | 1523 | { |
1524 | struct lance_private *lp = dev_get_drvdata(&op->dev); | 1524 | struct lance_private *lp = dev_get_drvdata(&op->dev); |
1525 | struct net_device *net_dev = lp->dev; | 1525 | struct net_device *net_dev = lp->dev; |
diff --git a/drivers/net/sunqe.c b/drivers/net/sunqe.c index 5f84a5dadedd..72e65d4666ef 100644 --- a/drivers/net/sunqe.c +++ b/drivers/net/sunqe.c | |||
@@ -689,7 +689,7 @@ static void qe_get_drvinfo(struct net_device *dev, struct ethtool_drvinfo *info) | |||
689 | { | 689 | { |
690 | const struct linux_prom_registers *regs; | 690 | const struct linux_prom_registers *regs; |
691 | struct sunqe *qep = netdev_priv(dev); | 691 | struct sunqe *qep = netdev_priv(dev); |
692 | struct of_device *op; | 692 | struct platform_device *op; |
693 | 693 | ||
694 | strcpy(info->driver, "sunqe"); | 694 | strcpy(info->driver, "sunqe"); |
695 | strcpy(info->version, "3.0"); | 695 | strcpy(info->version, "3.0"); |
@@ -720,7 +720,7 @@ static const struct ethtool_ops qe_ethtool_ops = { | |||
720 | }; | 720 | }; |
721 | 721 | ||
722 | /* This is only called once at boot time for each card probed. */ | 722 | /* This is only called once at boot time for each card probed. */ |
723 | static void qec_init_once(struct sunqec *qecp, struct of_device *op) | 723 | static void qec_init_once(struct sunqec *qecp, struct platform_device *op) |
724 | { | 724 | { |
725 | u8 bsizes = qecp->qec_bursts; | 725 | u8 bsizes = qecp->qec_bursts; |
726 | 726 | ||
@@ -770,9 +770,9 @@ static u8 __devinit qec_get_burst(struct device_node *dp) | |||
770 | return bsizes; | 770 | return bsizes; |
771 | } | 771 | } |
772 | 772 | ||
773 | static struct sunqec * __devinit get_qec(struct of_device *child) | 773 | static struct sunqec * __devinit get_qec(struct platform_device *child) |
774 | { | 774 | { |
775 | struct of_device *op = to_of_device(child->dev.parent); | 775 | struct platform_device *op = to_platform_device(child->dev.parent); |
776 | struct sunqec *qecp; | 776 | struct sunqec *qecp; |
777 | 777 | ||
778 | qecp = dev_get_drvdata(&op->dev); | 778 | qecp = dev_get_drvdata(&op->dev); |
@@ -836,7 +836,7 @@ static const struct net_device_ops qec_ops = { | |||
836 | .ndo_validate_addr = eth_validate_addr, | 836 | .ndo_validate_addr = eth_validate_addr, |
837 | }; | 837 | }; |
838 | 838 | ||
839 | static int __devinit qec_ether_init(struct of_device *op) | 839 | static int __devinit qec_ether_init(struct platform_device *op) |
840 | { | 840 | { |
841 | static unsigned version_printed; | 841 | static unsigned version_printed; |
842 | struct net_device *dev; | 842 | struct net_device *dev; |
@@ -941,12 +941,12 @@ fail: | |||
941 | return res; | 941 | return res; |
942 | } | 942 | } |
943 | 943 | ||
944 | static int __devinit qec_sbus_probe(struct of_device *op, const struct of_device_id *match) | 944 | static int __devinit qec_sbus_probe(struct platform_device *op, const struct of_device_id *match) |
945 | { | 945 | { |
946 | return qec_ether_init(op); | 946 | return qec_ether_init(op); |
947 | } | 947 | } |
948 | 948 | ||
949 | static int __devexit qec_sbus_remove(struct of_device *op) | 949 | static int __devexit qec_sbus_remove(struct platform_device *op) |
950 | { | 950 | { |
951 | struct sunqe *qp = dev_get_drvdata(&op->dev); | 951 | struct sunqe *qp = dev_get_drvdata(&op->dev); |
952 | struct net_device *net_dev = qp->dev; | 952 | struct net_device *net_dev = qp->dev; |
@@ -997,7 +997,7 @@ static void __exit qec_exit(void) | |||
997 | 997 | ||
998 | while (root_qec_dev) { | 998 | while (root_qec_dev) { |
999 | struct sunqec *next = root_qec_dev->next_module; | 999 | struct sunqec *next = root_qec_dev->next_module; |
1000 | struct of_device *op = root_qec_dev->op; | 1000 | struct platform_device *op = root_qec_dev->op; |
1001 | 1001 | ||
1002 | free_irq(op->archdata.irqs[0], (void *) root_qec_dev); | 1002 | free_irq(op->archdata.irqs[0], (void *) root_qec_dev); |
1003 | of_iounmap(&op->resource[0], root_qec_dev->gregs, | 1003 | of_iounmap(&op->resource[0], root_qec_dev->gregs, |
diff --git a/drivers/net/sunqe.h b/drivers/net/sunqe.h index 5813a7b2faa5..581781b6b2fa 100644 --- a/drivers/net/sunqe.h +++ b/drivers/net/sunqe.h | |||
@@ -314,7 +314,7 @@ struct sunqec { | |||
314 | void __iomem *gregs; /* QEC Global Registers */ | 314 | void __iomem *gregs; /* QEC Global Registers */ |
315 | struct sunqe *qes[4]; /* Each child MACE */ | 315 | struct sunqe *qes[4]; /* Each child MACE */ |
316 | unsigned int qec_bursts; /* Support burst sizes */ | 316 | unsigned int qec_bursts; /* Support burst sizes */ |
317 | struct of_device *op; /* QEC's OF device */ | 317 | struct platform_device *op; /* QEC's OF device */ |
318 | struct sunqec *next_module; /* List of all QECs in system */ | 318 | struct sunqec *next_module; /* List of all QECs in system */ |
319 | }; | 319 | }; |
320 | 320 | ||
@@ -342,7 +342,7 @@ struct sunqe { | |||
342 | __u32 buffers_dvma; /* DVMA visible address. */ | 342 | __u32 buffers_dvma; /* DVMA visible address. */ |
343 | struct sunqec *parent; | 343 | struct sunqec *parent; |
344 | u8 mconfig; /* Base MACE mconfig value */ | 344 | u8 mconfig; /* Base MACE mconfig value */ |
345 | struct of_device *op; /* QE's OF device struct */ | 345 | struct platform_device *op; /* QE's OF device struct */ |
346 | struct net_device *dev; /* QE's netdevice struct */ | 346 | struct net_device *dev; /* QE's netdevice struct */ |
347 | int channel; /* Who am I? */ | 347 | int channel; /* Who am I? */ |
348 | }; | 348 | }; |
diff --git a/drivers/net/ucc_geth.c b/drivers/net/ucc_geth.c index 8d532f9b50d0..a4c3f5708246 100644 --- a/drivers/net/ucc_geth.c +++ b/drivers/net/ucc_geth.c | |||
@@ -3601,7 +3601,7 @@ static void ucc_geth_timeout(struct net_device *dev) | |||
3601 | 3601 | ||
3602 | #ifdef CONFIG_PM | 3602 | #ifdef CONFIG_PM |
3603 | 3603 | ||
3604 | static int ucc_geth_suspend(struct of_device *ofdev, pm_message_t state) | 3604 | static int ucc_geth_suspend(struct platform_device *ofdev, pm_message_t state) |
3605 | { | 3605 | { |
3606 | struct net_device *ndev = dev_get_drvdata(&ofdev->dev); | 3606 | struct net_device *ndev = dev_get_drvdata(&ofdev->dev); |
3607 | struct ucc_geth_private *ugeth = netdev_priv(ndev); | 3607 | struct ucc_geth_private *ugeth = netdev_priv(ndev); |
@@ -3629,7 +3629,7 @@ static int ucc_geth_suspend(struct of_device *ofdev, pm_message_t state) | |||
3629 | return 0; | 3629 | return 0; |
3630 | } | 3630 | } |
3631 | 3631 | ||
3632 | static int ucc_geth_resume(struct of_device *ofdev) | 3632 | static int ucc_geth_resume(struct platform_device *ofdev) |
3633 | { | 3633 | { |
3634 | struct net_device *ndev = dev_get_drvdata(&ofdev->dev); | 3634 | struct net_device *ndev = dev_get_drvdata(&ofdev->dev); |
3635 | struct ucc_geth_private *ugeth = netdev_priv(ndev); | 3635 | struct ucc_geth_private *ugeth = netdev_priv(ndev); |
@@ -3732,7 +3732,7 @@ static const struct net_device_ops ucc_geth_netdev_ops = { | |||
3732 | #endif | 3732 | #endif |
3733 | }; | 3733 | }; |
3734 | 3734 | ||
3735 | static int ucc_geth_probe(struct of_device* ofdev, const struct of_device_id *match) | 3735 | static int ucc_geth_probe(struct platform_device* ofdev, const struct of_device_id *match) |
3736 | { | 3736 | { |
3737 | struct device *device = &ofdev->dev; | 3737 | struct device *device = &ofdev->dev; |
3738 | struct device_node *np = ofdev->dev.of_node; | 3738 | struct device_node *np = ofdev->dev.of_node; |
@@ -3954,7 +3954,7 @@ static int ucc_geth_probe(struct of_device* ofdev, const struct of_device_id *ma | |||
3954 | return 0; | 3954 | return 0; |
3955 | } | 3955 | } |
3956 | 3956 | ||
3957 | static int ucc_geth_remove(struct of_device* ofdev) | 3957 | static int ucc_geth_remove(struct platform_device* ofdev) |
3958 | { | 3958 | { |
3959 | struct device *device = &ofdev->dev; | 3959 | struct device *device = &ofdev->dev; |
3960 | struct net_device *dev = dev_get_drvdata(device); | 3960 | struct net_device *dev = dev_get_drvdata(device); |
diff --git a/drivers/net/usb/usbnet.c b/drivers/net/usb/usbnet.c index 7f62e2dea28f..ca7fc9df1ccf 100644 --- a/drivers/net/usb/usbnet.c +++ b/drivers/net/usb/usbnet.c | |||
@@ -315,7 +315,7 @@ EXPORT_SYMBOL_GPL(usbnet_defer_kevent); | |||
315 | 315 | ||
316 | static void rx_complete (struct urb *urb); | 316 | static void rx_complete (struct urb *urb); |
317 | 317 | ||
318 | static void rx_submit (struct usbnet *dev, struct urb *urb, gfp_t flags) | 318 | static int rx_submit (struct usbnet *dev, struct urb *urb, gfp_t flags) |
319 | { | 319 | { |
320 | struct sk_buff *skb; | 320 | struct sk_buff *skb; |
321 | struct skb_data *entry; | 321 | struct skb_data *entry; |
@@ -327,7 +327,7 @@ static void rx_submit (struct usbnet *dev, struct urb *urb, gfp_t flags) | |||
327 | netif_dbg(dev, rx_err, dev->net, "no rx skb\n"); | 327 | netif_dbg(dev, rx_err, dev->net, "no rx skb\n"); |
328 | usbnet_defer_kevent (dev, EVENT_RX_MEMORY); | 328 | usbnet_defer_kevent (dev, EVENT_RX_MEMORY); |
329 | usb_free_urb (urb); | 329 | usb_free_urb (urb); |
330 | return; | 330 | return -ENOMEM; |
331 | } | 331 | } |
332 | skb_reserve (skb, NET_IP_ALIGN); | 332 | skb_reserve (skb, NET_IP_ALIGN); |
333 | 333 | ||
@@ -357,6 +357,9 @@ static void rx_submit (struct usbnet *dev, struct urb *urb, gfp_t flags) | |||
357 | netif_dbg(dev, ifdown, dev->net, "device gone\n"); | 357 | netif_dbg(dev, ifdown, dev->net, "device gone\n"); |
358 | netif_device_detach (dev->net); | 358 | netif_device_detach (dev->net); |
359 | break; | 359 | break; |
360 | case -EHOSTUNREACH: | ||
361 | retval = -ENOLINK; | ||
362 | break; | ||
360 | default: | 363 | default: |
361 | netif_dbg(dev, rx_err, dev->net, | 364 | netif_dbg(dev, rx_err, dev->net, |
362 | "rx submit, %d\n", retval); | 365 | "rx submit, %d\n", retval); |
@@ -374,6 +377,7 @@ static void rx_submit (struct usbnet *dev, struct urb *urb, gfp_t flags) | |||
374 | dev_kfree_skb_any (skb); | 377 | dev_kfree_skb_any (skb); |
375 | usb_free_urb (urb); | 378 | usb_free_urb (urb); |
376 | } | 379 | } |
380 | return retval; | ||
377 | } | 381 | } |
378 | 382 | ||
379 | 383 | ||
@@ -912,6 +916,7 @@ fail_halt: | |||
912 | /* tasklet could resubmit itself forever if memory is tight */ | 916 | /* tasklet could resubmit itself forever if memory is tight */ |
913 | if (test_bit (EVENT_RX_MEMORY, &dev->flags)) { | 917 | if (test_bit (EVENT_RX_MEMORY, &dev->flags)) { |
914 | struct urb *urb = NULL; | 918 | struct urb *urb = NULL; |
919 | int resched = 1; | ||
915 | 920 | ||
916 | if (netif_running (dev->net)) | 921 | if (netif_running (dev->net)) |
917 | urb = usb_alloc_urb (0, GFP_KERNEL); | 922 | urb = usb_alloc_urb (0, GFP_KERNEL); |
@@ -922,10 +927,12 @@ fail_halt: | |||
922 | status = usb_autopm_get_interface(dev->intf); | 927 | status = usb_autopm_get_interface(dev->intf); |
923 | if (status < 0) | 928 | if (status < 0) |
924 | goto fail_lowmem; | 929 | goto fail_lowmem; |
925 | rx_submit (dev, urb, GFP_KERNEL); | 930 | if (rx_submit (dev, urb, GFP_KERNEL) == -ENOLINK) |
931 | resched = 0; | ||
926 | usb_autopm_put_interface(dev->intf); | 932 | usb_autopm_put_interface(dev->intf); |
927 | fail_lowmem: | 933 | fail_lowmem: |
928 | tasklet_schedule (&dev->bh); | 934 | if (resched) |
935 | tasklet_schedule (&dev->bh); | ||
929 | } | 936 | } |
930 | } | 937 | } |
931 | 938 | ||
@@ -1175,8 +1182,11 @@ static void usbnet_bh (unsigned long param) | |||
1175 | // don't refill the queue all at once | 1182 | // don't refill the queue all at once |
1176 | for (i = 0; i < 10 && dev->rxq.qlen < qlen; i++) { | 1183 | for (i = 0; i < 10 && dev->rxq.qlen < qlen; i++) { |
1177 | urb = usb_alloc_urb (0, GFP_ATOMIC); | 1184 | urb = usb_alloc_urb (0, GFP_ATOMIC); |
1178 | if (urb != NULL) | 1185 | if (urb != NULL) { |
1179 | rx_submit (dev, urb, GFP_ATOMIC); | 1186 | if (rx_submit (dev, urb, GFP_ATOMIC) == |
1187 | -ENOLINK) | ||
1188 | return; | ||
1189 | } | ||
1180 | } | 1190 | } |
1181 | if (temp != dev->rxq.qlen) | 1191 | if (temp != dev->rxq.qlen) |
1182 | netif_dbg(dev, link, dev->net, | 1192 | netif_dbg(dev, link, dev->net, |
diff --git a/drivers/net/wan/farsync.c b/drivers/net/wan/farsync.c index ad7719fe6d0a..e050bd65e037 100644 --- a/drivers/net/wan/farsync.c +++ b/drivers/net/wan/farsync.c | |||
@@ -885,20 +885,21 @@ fst_rx_dma_complete(struct fst_card_info *card, struct fst_port_info *port, | |||
885 | * Receive a frame through the DMA | 885 | * Receive a frame through the DMA |
886 | */ | 886 | */ |
887 | static inline void | 887 | static inline void |
888 | fst_rx_dma(struct fst_card_info *card, unsigned char *skb, | 888 | fst_rx_dma(struct fst_card_info *card, dma_addr_t skb, |
889 | unsigned char *mem, int len) | 889 | dma_addr_t mem, int len) |
890 | { | 890 | { |
891 | /* | 891 | /* |
892 | * This routine will setup the DMA and start it | 892 | * This routine will setup the DMA and start it |
893 | */ | 893 | */ |
894 | 894 | ||
895 | dbg(DBG_RX, "In fst_rx_dma %p %p %d\n", skb, mem, len); | 895 | dbg(DBG_RX, "In fst_rx_dma %lx %lx %d\n", |
896 | (unsigned long) skb, (unsigned long) mem, len); | ||
896 | if (card->dmarx_in_progress) { | 897 | if (card->dmarx_in_progress) { |
897 | dbg(DBG_ASS, "In fst_rx_dma while dma in progress\n"); | 898 | dbg(DBG_ASS, "In fst_rx_dma while dma in progress\n"); |
898 | } | 899 | } |
899 | 900 | ||
900 | outl((unsigned long) skb, card->pci_conf + DMAPADR0); /* Copy to here */ | 901 | outl(skb, card->pci_conf + DMAPADR0); /* Copy to here */ |
901 | outl((unsigned long) mem, card->pci_conf + DMALADR0); /* from here */ | 902 | outl(mem, card->pci_conf + DMALADR0); /* from here */ |
902 | outl(len, card->pci_conf + DMASIZ0); /* for this length */ | 903 | outl(len, card->pci_conf + DMASIZ0); /* for this length */ |
903 | outl(0x00000000c, card->pci_conf + DMADPR0); /* In this direction */ | 904 | outl(0x00000000c, card->pci_conf + DMADPR0); /* In this direction */ |
904 | 905 | ||
@@ -1309,8 +1310,8 @@ fst_intr_rx(struct fst_card_info *card, struct fst_port_info *port) | |||
1309 | card->dma_port_rx = port; | 1310 | card->dma_port_rx = port; |
1310 | card->dma_len_rx = len; | 1311 | card->dma_len_rx = len; |
1311 | card->dma_rxpos = rxp; | 1312 | card->dma_rxpos = rxp; |
1312 | fst_rx_dma(card, (char *) card->rx_dma_handle_card, | 1313 | fst_rx_dma(card, card->rx_dma_handle_card, |
1313 | (char *) BUF_OFFSET(rxBuffer[pi][rxp][0]), len); | 1314 | BUF_OFFSET(rxBuffer[pi][rxp][0]), len); |
1314 | } | 1315 | } |
1315 | if (rxp != port->rxpos) { | 1316 | if (rxp != port->rxpos) { |
1316 | dbg(DBG_ASS, "About to increment rxpos by more than 1\n"); | 1317 | dbg(DBG_ASS, "About to increment rxpos by more than 1\n"); |
diff --git a/drivers/net/wan/ixp4xx_hss.c b/drivers/net/wan/ixp4xx_hss.c index 88e363033e23..6c571e198835 100644 --- a/drivers/net/wan/ixp4xx_hss.c +++ b/drivers/net/wan/ixp4xx_hss.c | |||
@@ -396,7 +396,7 @@ static void hss_config(struct port *port) | |||
396 | msg.cmd = PORT_CONFIG_WRITE; | 396 | msg.cmd = PORT_CONFIG_WRITE; |
397 | msg.hss_port = port->id; | 397 | msg.hss_port = port->id; |
398 | msg.index = HSS_CONFIG_TX_PCR; | 398 | msg.index = HSS_CONFIG_TX_PCR; |
399 | msg.data32 = PCR_FRM_SYNC_OUTPUT_RISING | PCR_MSB_ENDIAN | | 399 | msg.data32 = PCR_FRM_PULSE_DISABLED | PCR_MSB_ENDIAN | |
400 | PCR_TX_DATA_ENABLE | PCR_SOF_NO_FBIT; | 400 | PCR_TX_DATA_ENABLE | PCR_SOF_NO_FBIT; |
401 | if (port->clock_type == CLOCK_INT) | 401 | if (port->clock_type == CLOCK_INT) |
402 | msg.data32 |= PCR_SYNC_CLK_DIR_OUTPUT; | 402 | msg.data32 |= PCR_SYNC_CLK_DIR_OUTPUT; |
diff --git a/drivers/net/wireless/iwlwifi/iwl-1000.c b/drivers/net/wireless/iwlwifi/iwl-1000.c index 8848333bc3a9..fec026212326 100644 --- a/drivers/net/wireless/iwlwifi/iwl-1000.c +++ b/drivers/net/wireless/iwlwifi/iwl-1000.c | |||
@@ -260,7 +260,7 @@ struct iwl_cfg iwl1000_bgn_cfg = { | |||
260 | .shadow_ram_support = false, | 260 | .shadow_ram_support = false, |
261 | .ht_greenfield_support = true, | 261 | .ht_greenfield_support = true, |
262 | .led_compensation = 51, | 262 | .led_compensation = 51, |
263 | .use_rts_for_ht = true, /* use rts/cts protection */ | 263 | .use_rts_for_aggregation = true, /* use rts/cts protection */ |
264 | .chain_noise_num_beacons = IWL_CAL_NUM_BEACONS, | 264 | .chain_noise_num_beacons = IWL_CAL_NUM_BEACONS, |
265 | .support_ct_kill_exit = true, | 265 | .support_ct_kill_exit = true, |
266 | .plcp_delta_threshold = IWL_MAX_PLCP_ERR_EXT_LONG_THRESHOLD_DEF, | 266 | .plcp_delta_threshold = IWL_MAX_PLCP_ERR_EXT_LONG_THRESHOLD_DEF, |
diff --git a/drivers/net/wireless/iwlwifi/iwl-3945.c b/drivers/net/wireless/iwlwifi/iwl-3945.c index a07310fefcf2..6950a783913b 100644 --- a/drivers/net/wireless/iwlwifi/iwl-3945.c +++ b/drivers/net/wireless/iwlwifi/iwl-3945.c | |||
@@ -769,22 +769,6 @@ void iwl3945_hw_build_tx_cmd_rate(struct iwl_priv *priv, | |||
769 | rts_retry_limit = data_retry_limit; | 769 | rts_retry_limit = data_retry_limit; |
770 | tx_cmd->rts_retry_limit = rts_retry_limit; | 770 | tx_cmd->rts_retry_limit = rts_retry_limit; |
771 | 771 | ||
772 | if (ieee80211_is_mgmt(fc)) { | ||
773 | switch (fc & cpu_to_le16(IEEE80211_FCTL_STYPE)) { | ||
774 | case cpu_to_le16(IEEE80211_STYPE_AUTH): | ||
775 | case cpu_to_le16(IEEE80211_STYPE_DEAUTH): | ||
776 | case cpu_to_le16(IEEE80211_STYPE_ASSOC_REQ): | ||
777 | case cpu_to_le16(IEEE80211_STYPE_REASSOC_REQ): | ||
778 | if (tx_flags & TX_CMD_FLG_RTS_MSK) { | ||
779 | tx_flags &= ~TX_CMD_FLG_RTS_MSK; | ||
780 | tx_flags |= TX_CMD_FLG_CTS_MSK; | ||
781 | } | ||
782 | break; | ||
783 | default: | ||
784 | break; | ||
785 | } | ||
786 | } | ||
787 | |||
788 | tx_cmd->rate = rate; | 772 | tx_cmd->rate = rate; |
789 | tx_cmd->tx_flags = tx_flags; | 773 | tx_cmd->tx_flags = tx_flags; |
790 | 774 | ||
@@ -2717,7 +2701,7 @@ static struct iwl_lib_ops iwl3945_lib = { | |||
2717 | static struct iwl_hcmd_utils_ops iwl3945_hcmd_utils = { | 2701 | static struct iwl_hcmd_utils_ops iwl3945_hcmd_utils = { |
2718 | .get_hcmd_size = iwl3945_get_hcmd_size, | 2702 | .get_hcmd_size = iwl3945_get_hcmd_size, |
2719 | .build_addsta_hcmd = iwl3945_build_addsta_hcmd, | 2703 | .build_addsta_hcmd = iwl3945_build_addsta_hcmd, |
2720 | .rts_tx_cmd_flag = iwlcore_rts_tx_cmd_flag, | 2704 | .tx_cmd_protection = iwlcore_tx_cmd_protection, |
2721 | .request_scan = iwl3945_request_scan, | 2705 | .request_scan = iwl3945_request_scan, |
2722 | }; | 2706 | }; |
2723 | 2707 | ||
diff --git a/drivers/net/wireless/iwlwifi/iwl-4965.c b/drivers/net/wireless/iwlwifi/iwl-4965.c index d6531ad3906a..d6da356608fa 100644 --- a/drivers/net/wireless/iwlwifi/iwl-4965.c +++ b/drivers/net/wireless/iwlwifi/iwl-4965.c | |||
@@ -2223,7 +2223,7 @@ static struct iwl_hcmd_utils_ops iwl4965_hcmd_utils = { | |||
2223 | .build_addsta_hcmd = iwl4965_build_addsta_hcmd, | 2223 | .build_addsta_hcmd = iwl4965_build_addsta_hcmd, |
2224 | .chain_noise_reset = iwl4965_chain_noise_reset, | 2224 | .chain_noise_reset = iwl4965_chain_noise_reset, |
2225 | .gain_computation = iwl4965_gain_computation, | 2225 | .gain_computation = iwl4965_gain_computation, |
2226 | .rts_tx_cmd_flag = iwlcore_rts_tx_cmd_flag, | 2226 | .tx_cmd_protection = iwlcore_tx_cmd_protection, |
2227 | .calc_rssi = iwl4965_calc_rssi, | 2227 | .calc_rssi = iwl4965_calc_rssi, |
2228 | .request_scan = iwlagn_request_scan, | 2228 | .request_scan = iwlagn_request_scan, |
2229 | }; | 2229 | }; |
diff --git a/drivers/net/wireless/iwlwifi/iwl-5000.c b/drivers/net/wireless/iwlwifi/iwl-5000.c index 8093ce2804fb..aacf3770f075 100644 --- a/drivers/net/wireless/iwlwifi/iwl-5000.c +++ b/drivers/net/wireless/iwlwifi/iwl-5000.c | |||
@@ -506,7 +506,7 @@ struct iwl_cfg iwl5300_agn_cfg = { | |||
506 | .use_bsm = false, | 506 | .use_bsm = false, |
507 | .ht_greenfield_support = true, | 507 | .ht_greenfield_support = true, |
508 | .led_compensation = 51, | 508 | .led_compensation = 51, |
509 | .use_rts_for_ht = true, /* use rts/cts protection */ | 509 | .use_rts_for_aggregation = true, /* use rts/cts protection */ |
510 | .chain_noise_num_beacons = IWL_CAL_NUM_BEACONS, | 510 | .chain_noise_num_beacons = IWL_CAL_NUM_BEACONS, |
511 | .plcp_delta_threshold = IWL_MAX_PLCP_ERR_LONG_THRESHOLD_DEF, | 511 | .plcp_delta_threshold = IWL_MAX_PLCP_ERR_LONG_THRESHOLD_DEF, |
512 | .chain_noise_scale = 1000, | 512 | .chain_noise_scale = 1000, |
@@ -537,7 +537,7 @@ struct iwl_cfg iwl5100_bgn_cfg = { | |||
537 | .use_bsm = false, | 537 | .use_bsm = false, |
538 | .ht_greenfield_support = true, | 538 | .ht_greenfield_support = true, |
539 | .led_compensation = 51, | 539 | .led_compensation = 51, |
540 | .use_rts_for_ht = true, /* use rts/cts protection */ | 540 | .use_rts_for_aggregation = true, /* use rts/cts protection */ |
541 | .chain_noise_num_beacons = IWL_CAL_NUM_BEACONS, | 541 | .chain_noise_num_beacons = IWL_CAL_NUM_BEACONS, |
542 | .plcp_delta_threshold = IWL_MAX_PLCP_ERR_LONG_THRESHOLD_DEF, | 542 | .plcp_delta_threshold = IWL_MAX_PLCP_ERR_LONG_THRESHOLD_DEF, |
543 | .chain_noise_scale = 1000, | 543 | .chain_noise_scale = 1000, |
@@ -597,7 +597,7 @@ struct iwl_cfg iwl5100_agn_cfg = { | |||
597 | .use_bsm = false, | 597 | .use_bsm = false, |
598 | .ht_greenfield_support = true, | 598 | .ht_greenfield_support = true, |
599 | .led_compensation = 51, | 599 | .led_compensation = 51, |
600 | .use_rts_for_ht = true, /* use rts/cts protection */ | 600 | .use_rts_for_aggregation = true, /* use rts/cts protection */ |
601 | .chain_noise_num_beacons = IWL_CAL_NUM_BEACONS, | 601 | .chain_noise_num_beacons = IWL_CAL_NUM_BEACONS, |
602 | .plcp_delta_threshold = IWL_MAX_PLCP_ERR_LONG_THRESHOLD_DEF, | 602 | .plcp_delta_threshold = IWL_MAX_PLCP_ERR_LONG_THRESHOLD_DEF, |
603 | .chain_noise_scale = 1000, | 603 | .chain_noise_scale = 1000, |
@@ -628,7 +628,7 @@ struct iwl_cfg iwl5350_agn_cfg = { | |||
628 | .use_bsm = false, | 628 | .use_bsm = false, |
629 | .ht_greenfield_support = true, | 629 | .ht_greenfield_support = true, |
630 | .led_compensation = 51, | 630 | .led_compensation = 51, |
631 | .use_rts_for_ht = true, /* use rts/cts protection */ | 631 | .use_rts_for_aggregation = true, /* use rts/cts protection */ |
632 | .chain_noise_num_beacons = IWL_CAL_NUM_BEACONS, | 632 | .chain_noise_num_beacons = IWL_CAL_NUM_BEACONS, |
633 | .plcp_delta_threshold = IWL_MAX_PLCP_ERR_LONG_THRESHOLD_DEF, | 633 | .plcp_delta_threshold = IWL_MAX_PLCP_ERR_LONG_THRESHOLD_DEF, |
634 | .chain_noise_scale = 1000, | 634 | .chain_noise_scale = 1000, |
@@ -659,7 +659,7 @@ struct iwl_cfg iwl5150_agn_cfg = { | |||
659 | .use_bsm = false, | 659 | .use_bsm = false, |
660 | .ht_greenfield_support = true, | 660 | .ht_greenfield_support = true, |
661 | .led_compensation = 51, | 661 | .led_compensation = 51, |
662 | .use_rts_for_ht = true, /* use rts/cts protection */ | 662 | .use_rts_for_aggregation = true, /* use rts/cts protection */ |
663 | .chain_noise_num_beacons = IWL_CAL_NUM_BEACONS, | 663 | .chain_noise_num_beacons = IWL_CAL_NUM_BEACONS, |
664 | .plcp_delta_threshold = IWL_MAX_PLCP_ERR_LONG_THRESHOLD_DEF, | 664 | .plcp_delta_threshold = IWL_MAX_PLCP_ERR_LONG_THRESHOLD_DEF, |
665 | .chain_noise_scale = 1000, | 665 | .chain_noise_scale = 1000, |
diff --git a/drivers/net/wireless/iwlwifi/iwl-6000.c b/drivers/net/wireless/iwlwifi/iwl-6000.c index 58270529a0e4..af4fd50f3405 100644 --- a/drivers/net/wireless/iwlwifi/iwl-6000.c +++ b/drivers/net/wireless/iwlwifi/iwl-6000.c | |||
@@ -381,7 +381,7 @@ struct iwl_cfg iwl6000g2a_2agn_cfg = { | |||
381 | .shadow_ram_support = true, | 381 | .shadow_ram_support = true, |
382 | .ht_greenfield_support = true, | 382 | .ht_greenfield_support = true, |
383 | .led_compensation = 51, | 383 | .led_compensation = 51, |
384 | .use_rts_for_ht = true, /* use rts/cts protection */ | 384 | .use_rts_for_aggregation = true, /* use rts/cts protection */ |
385 | .chain_noise_num_beacons = IWL_CAL_NUM_BEACONS, | 385 | .chain_noise_num_beacons = IWL_CAL_NUM_BEACONS, |
386 | .supports_idle = true, | 386 | .supports_idle = true, |
387 | .adv_thermal_throttle = true, | 387 | .adv_thermal_throttle = true, |
@@ -489,7 +489,7 @@ struct iwl_cfg iwl6000g2b_2agn_cfg = { | |||
489 | .shadow_ram_support = true, | 489 | .shadow_ram_support = true, |
490 | .ht_greenfield_support = true, | 490 | .ht_greenfield_support = true, |
491 | .led_compensation = 51, | 491 | .led_compensation = 51, |
492 | .use_rts_for_ht = true, /* use rts/cts protection */ | 492 | .use_rts_for_aggregation = true, /* use rts/cts protection */ |
493 | .chain_noise_num_beacons = IWL_CAL_NUM_BEACONS, | 493 | .chain_noise_num_beacons = IWL_CAL_NUM_BEACONS, |
494 | .supports_idle = true, | 494 | .supports_idle = true, |
495 | .adv_thermal_throttle = true, | 495 | .adv_thermal_throttle = true, |
@@ -563,7 +563,7 @@ struct iwl_cfg iwl6000g2b_2bgn_cfg = { | |||
563 | .shadow_ram_support = true, | 563 | .shadow_ram_support = true, |
564 | .ht_greenfield_support = true, | 564 | .ht_greenfield_support = true, |
565 | .led_compensation = 51, | 565 | .led_compensation = 51, |
566 | .use_rts_for_ht = true, /* use rts/cts protection */ | 566 | .use_rts_for_aggregation = true, /* use rts/cts protection */ |
567 | .chain_noise_num_beacons = IWL_CAL_NUM_BEACONS, | 567 | .chain_noise_num_beacons = IWL_CAL_NUM_BEACONS, |
568 | .supports_idle = true, | 568 | .supports_idle = true, |
569 | .adv_thermal_throttle = true, | 569 | .adv_thermal_throttle = true, |
@@ -637,7 +637,7 @@ struct iwl_cfg iwl6000g2b_bgn_cfg = { | |||
637 | .shadow_ram_support = true, | 637 | .shadow_ram_support = true, |
638 | .ht_greenfield_support = true, | 638 | .ht_greenfield_support = true, |
639 | .led_compensation = 51, | 639 | .led_compensation = 51, |
640 | .use_rts_for_ht = true, /* use rts/cts protection */ | 640 | .use_rts_for_aggregation = true, /* use rts/cts protection */ |
641 | .chain_noise_num_beacons = IWL_CAL_NUM_BEACONS, | 641 | .chain_noise_num_beacons = IWL_CAL_NUM_BEACONS, |
642 | .supports_idle = true, | 642 | .supports_idle = true, |
643 | .adv_thermal_throttle = true, | 643 | .adv_thermal_throttle = true, |
@@ -714,7 +714,7 @@ struct iwl_cfg iwl6000i_2agn_cfg = { | |||
714 | .shadow_ram_support = true, | 714 | .shadow_ram_support = true, |
715 | .ht_greenfield_support = true, | 715 | .ht_greenfield_support = true, |
716 | .led_compensation = 51, | 716 | .led_compensation = 51, |
717 | .use_rts_for_ht = true, /* use rts/cts protection */ | 717 | .use_rts_for_aggregation = true, /* use rts/cts protection */ |
718 | .chain_noise_num_beacons = IWL_CAL_NUM_BEACONS, | 718 | .chain_noise_num_beacons = IWL_CAL_NUM_BEACONS, |
719 | .supports_idle = true, | 719 | .supports_idle = true, |
720 | .adv_thermal_throttle = true, | 720 | .adv_thermal_throttle = true, |
@@ -821,7 +821,7 @@ struct iwl_cfg iwl6050_2agn_cfg = { | |||
821 | .shadow_ram_support = true, | 821 | .shadow_ram_support = true, |
822 | .ht_greenfield_support = true, | 822 | .ht_greenfield_support = true, |
823 | .led_compensation = 51, | 823 | .led_compensation = 51, |
824 | .use_rts_for_ht = true, /* use rts/cts protection */ | 824 | .use_rts_for_aggregation = true, /* use rts/cts protection */ |
825 | .chain_noise_num_beacons = IWL_CAL_NUM_BEACONS, | 825 | .chain_noise_num_beacons = IWL_CAL_NUM_BEACONS, |
826 | .supports_idle = true, | 826 | .supports_idle = true, |
827 | .adv_thermal_throttle = true, | 827 | .adv_thermal_throttle = true, |
@@ -859,7 +859,7 @@ struct iwl_cfg iwl6050g2_bgn_cfg = { | |||
859 | .shadow_ram_support = true, | 859 | .shadow_ram_support = true, |
860 | .ht_greenfield_support = true, | 860 | .ht_greenfield_support = true, |
861 | .led_compensation = 51, | 861 | .led_compensation = 51, |
862 | .use_rts_for_ht = true, /* use rts/cts protection */ | 862 | .use_rts_for_aggregation = true, /* use rts/cts protection */ |
863 | .chain_noise_num_beacons = IWL_CAL_NUM_BEACONS, | 863 | .chain_noise_num_beacons = IWL_CAL_NUM_BEACONS, |
864 | .supports_idle = true, | 864 | .supports_idle = true, |
865 | .adv_thermal_throttle = true, | 865 | .adv_thermal_throttle = true, |
@@ -933,7 +933,7 @@ struct iwl_cfg iwl6000_3agn_cfg = { | |||
933 | .shadow_ram_support = true, | 933 | .shadow_ram_support = true, |
934 | .ht_greenfield_support = true, | 934 | .ht_greenfield_support = true, |
935 | .led_compensation = 51, | 935 | .led_compensation = 51, |
936 | .use_rts_for_ht = true, /* use rts/cts protection */ | 936 | .use_rts_for_aggregation = true, /* use rts/cts protection */ |
937 | .chain_noise_num_beacons = IWL_CAL_NUM_BEACONS, | 937 | .chain_noise_num_beacons = IWL_CAL_NUM_BEACONS, |
938 | .supports_idle = true, | 938 | .supports_idle = true, |
939 | .adv_thermal_throttle = true, | 939 | .adv_thermal_throttle = true, |
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn-hcmd.c b/drivers/net/wireless/iwlwifi/iwl-agn-hcmd.c index a7216dda9786..75b901b3eb1e 100644 --- a/drivers/net/wireless/iwlwifi/iwl-agn-hcmd.c +++ b/drivers/net/wireless/iwlwifi/iwl-agn-hcmd.c | |||
@@ -211,10 +211,21 @@ static void iwlagn_chain_noise_reset(struct iwl_priv *priv) | |||
211 | } | 211 | } |
212 | } | 212 | } |
213 | 213 | ||
214 | static void iwlagn_rts_tx_cmd_flag(struct ieee80211_tx_info *info, | 214 | static void iwlagn_tx_cmd_protection(struct iwl_priv *priv, |
215 | __le32 *tx_flags) | 215 | struct ieee80211_tx_info *info, |
216 | __le16 fc, __le32 *tx_flags) | ||
216 | { | 217 | { |
217 | *tx_flags |= TX_CMD_FLG_PROT_REQUIRE_MSK; | 218 | if (info->control.rates[0].flags & IEEE80211_TX_RC_USE_RTS_CTS || |
219 | info->control.rates[0].flags & IEEE80211_TX_RC_USE_CTS_PROTECT) { | ||
220 | *tx_flags |= TX_CMD_FLG_PROT_REQUIRE_MSK; | ||
221 | return; | ||
222 | } | ||
223 | |||
224 | if (priv->cfg->use_rts_for_aggregation && | ||
225 | info->flags & IEEE80211_TX_CTL_AMPDU) { | ||
226 | *tx_flags |= TX_CMD_FLG_PROT_REQUIRE_MSK; | ||
227 | return; | ||
228 | } | ||
218 | } | 229 | } |
219 | 230 | ||
220 | /* Calc max signal level (dBm) among 3 possible receivers */ | 231 | /* Calc max signal level (dBm) among 3 possible receivers */ |
@@ -268,7 +279,7 @@ struct iwl_hcmd_utils_ops iwlagn_hcmd_utils = { | |||
268 | .build_addsta_hcmd = iwlagn_build_addsta_hcmd, | 279 | .build_addsta_hcmd = iwlagn_build_addsta_hcmd, |
269 | .gain_computation = iwlagn_gain_computation, | 280 | .gain_computation = iwlagn_gain_computation, |
270 | .chain_noise_reset = iwlagn_chain_noise_reset, | 281 | .chain_noise_reset = iwlagn_chain_noise_reset, |
271 | .rts_tx_cmd_flag = iwlagn_rts_tx_cmd_flag, | 282 | .tx_cmd_protection = iwlagn_tx_cmd_protection, |
272 | .calc_rssi = iwlagn_calc_rssi, | 283 | .calc_rssi = iwlagn_calc_rssi, |
273 | .request_scan = iwlagn_request_scan, | 284 | .request_scan = iwlagn_request_scan, |
274 | }; | 285 | }; |
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn-tx.c b/drivers/net/wireless/iwlwifi/iwl-agn-tx.c index d04502d54df3..69155aa448fb 100644 --- a/drivers/net/wireless/iwlwifi/iwl-agn-tx.c +++ b/drivers/net/wireless/iwlwifi/iwl-agn-tx.c | |||
@@ -379,10 +379,7 @@ static void iwlagn_tx_cmd_build_basic(struct iwl_priv *priv, | |||
379 | tx_flags |= TX_CMD_FLG_SEQ_CTL_MSK; | 379 | tx_flags |= TX_CMD_FLG_SEQ_CTL_MSK; |
380 | } | 380 | } |
381 | 381 | ||
382 | priv->cfg->ops->utils->rts_tx_cmd_flag(info, &tx_flags); | 382 | priv->cfg->ops->utils->tx_cmd_protection(priv, info, fc, &tx_flags); |
383 | |||
384 | if ((tx_flags & TX_CMD_FLG_RTS_MSK) || (tx_flags & TX_CMD_FLG_CTS_MSK)) | ||
385 | tx_flags |= TX_CMD_FLG_FULL_TXOP_PROT_MSK; | ||
386 | 383 | ||
387 | tx_flags &= ~(TX_CMD_FLG_ANT_SEL_MSK); | 384 | tx_flags &= ~(TX_CMD_FLG_ANT_SEL_MSK); |
388 | if (ieee80211_is_mgmt(fc)) { | 385 | if (ieee80211_is_mgmt(fc)) { |
@@ -456,21 +453,6 @@ static void iwlagn_tx_cmd_build_rate(struct iwl_priv *priv, | |||
456 | if ((rate_idx >= IWL_FIRST_CCK_RATE) && (rate_idx <= IWL_LAST_CCK_RATE)) | 453 | if ((rate_idx >= IWL_FIRST_CCK_RATE) && (rate_idx <= IWL_LAST_CCK_RATE)) |
457 | rate_flags |= RATE_MCS_CCK_MSK; | 454 | rate_flags |= RATE_MCS_CCK_MSK; |
458 | 455 | ||
459 | /* Set up RTS and CTS flags for certain packets */ | ||
460 | switch (fc & cpu_to_le16(IEEE80211_FCTL_STYPE)) { | ||
461 | case cpu_to_le16(IEEE80211_STYPE_AUTH): | ||
462 | case cpu_to_le16(IEEE80211_STYPE_DEAUTH): | ||
463 | case cpu_to_le16(IEEE80211_STYPE_ASSOC_REQ): | ||
464 | case cpu_to_le16(IEEE80211_STYPE_REASSOC_REQ): | ||
465 | if (tx_cmd->tx_flags & TX_CMD_FLG_RTS_MSK) { | ||
466 | tx_cmd->tx_flags &= ~TX_CMD_FLG_RTS_MSK; | ||
467 | tx_cmd->tx_flags |= TX_CMD_FLG_CTS_MSK; | ||
468 | } | ||
469 | break; | ||
470 | default: | ||
471 | break; | ||
472 | } | ||
473 | |||
474 | /* Set up antennas */ | 456 | /* Set up antennas */ |
475 | priv->mgmt_tx_ant = iwl_toggle_tx_ant(priv, priv->mgmt_tx_ant, | 457 | priv->mgmt_tx_ant = iwl_toggle_tx_ant(priv, priv->mgmt_tx_ant, |
476 | priv->hw_params.valid_tx_ant); | 458 | priv->hw_params.valid_tx_ant); |
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn.c b/drivers/net/wireless/iwlwifi/iwl-agn.c index 35337b1e7cac..c1882fd8345d 100644 --- a/drivers/net/wireless/iwlwifi/iwl-agn.c +++ b/drivers/net/wireless/iwlwifi/iwl-agn.c | |||
@@ -202,13 +202,6 @@ int iwl_commit_rxon(struct iwl_priv *priv) | |||
202 | 202 | ||
203 | priv->start_calib = 0; | 203 | priv->start_calib = 0; |
204 | if (new_assoc) { | 204 | if (new_assoc) { |
205 | /* | ||
206 | * allow CTS-to-self if possible for new association. | ||
207 | * this is relevant only for 5000 series and up, | ||
208 | * but will not damage 4965 | ||
209 | */ | ||
210 | priv->staging_rxon.flags |= RXON_FLG_SELF_CTS_EN; | ||
211 | |||
212 | /* Apply the new configuration | 205 | /* Apply the new configuration |
213 | * RXON assoc doesn't clear the station table in uCode, | 206 | * RXON assoc doesn't clear the station table in uCode, |
214 | */ | 207 | */ |
@@ -1618,45 +1611,9 @@ static ssize_t store_tx_power(struct device *d, | |||
1618 | 1611 | ||
1619 | static DEVICE_ATTR(tx_power, S_IWUSR | S_IRUGO, show_tx_power, store_tx_power); | 1612 | static DEVICE_ATTR(tx_power, S_IWUSR | S_IRUGO, show_tx_power, store_tx_power); |
1620 | 1613 | ||
1621 | static ssize_t show_rts_ht_protection(struct device *d, | ||
1622 | struct device_attribute *attr, char *buf) | ||
1623 | { | ||
1624 | struct iwl_priv *priv = dev_get_drvdata(d); | ||
1625 | |||
1626 | return sprintf(buf, "%s\n", | ||
1627 | priv->cfg->use_rts_for_ht ? "RTS/CTS" : "CTS-to-self"); | ||
1628 | } | ||
1629 | |||
1630 | static ssize_t store_rts_ht_protection(struct device *d, | ||
1631 | struct device_attribute *attr, | ||
1632 | const char *buf, size_t count) | ||
1633 | { | ||
1634 | struct iwl_priv *priv = dev_get_drvdata(d); | ||
1635 | unsigned long val; | ||
1636 | int ret; | ||
1637 | |||
1638 | ret = strict_strtoul(buf, 10, &val); | ||
1639 | if (ret) | ||
1640 | IWL_INFO(priv, "Input is not in decimal form.\n"); | ||
1641 | else { | ||
1642 | if (!iwl_is_associated(priv)) | ||
1643 | priv->cfg->use_rts_for_ht = val ? true : false; | ||
1644 | else | ||
1645 | IWL_ERR(priv, "Sta associated with AP - " | ||
1646 | "Change protection mechanism is not allowed\n"); | ||
1647 | ret = count; | ||
1648 | } | ||
1649 | return ret; | ||
1650 | } | ||
1651 | |||
1652 | static DEVICE_ATTR(rts_ht_protection, S_IWUSR | S_IRUGO, | ||
1653 | show_rts_ht_protection, store_rts_ht_protection); | ||
1654 | |||
1655 | |||
1656 | static struct attribute *iwl_sysfs_entries[] = { | 1614 | static struct attribute *iwl_sysfs_entries[] = { |
1657 | &dev_attr_temperature.attr, | 1615 | &dev_attr_temperature.attr, |
1658 | &dev_attr_tx_power.attr, | 1616 | &dev_attr_tx_power.attr, |
1659 | &dev_attr_rts_ht_protection.attr, | ||
1660 | #ifdef CONFIG_IWLWIFI_DEBUG | 1617 | #ifdef CONFIG_IWLWIFI_DEBUG |
1661 | &dev_attr_debug_level.attr, | 1618 | &dev_attr_debug_level.attr, |
1662 | #endif | 1619 | #endif |
@@ -3464,25 +3421,6 @@ static int iwl_mac_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd, | |||
3464 | return ret; | 3421 | return ret; |
3465 | } | 3422 | } |
3466 | 3423 | ||
3467 | /* | ||
3468 | * switch to RTS/CTS for TX | ||
3469 | */ | ||
3470 | static void iwl_enable_rts_cts(struct iwl_priv *priv) | ||
3471 | { | ||
3472 | |||
3473 | if (test_bit(STATUS_EXIT_PENDING, &priv->status)) | ||
3474 | return; | ||
3475 | |||
3476 | priv->staging_rxon.flags &= ~RXON_FLG_SELF_CTS_EN; | ||
3477 | if (!test_bit(STATUS_SCANNING, &priv->status)) { | ||
3478 | IWL_DEBUG_INFO(priv, "use RTS/CTS protection\n"); | ||
3479 | iwlcore_commit_rxon(priv); | ||
3480 | } else { | ||
3481 | /* scanning, defer the request until scan completed */ | ||
3482 | IWL_DEBUG_INFO(priv, "defer setting RTS/CTS protection\n"); | ||
3483 | } | ||
3484 | } | ||
3485 | |||
3486 | static int iwl_mac_ampdu_action(struct ieee80211_hw *hw, | 3424 | static int iwl_mac_ampdu_action(struct ieee80211_hw *hw, |
3487 | struct ieee80211_vif *vif, | 3425 | struct ieee80211_vif *vif, |
3488 | enum ieee80211_ampdu_mlme_action action, | 3426 | enum ieee80211_ampdu_mlme_action action, |
@@ -3529,14 +3467,33 @@ static int iwl_mac_ampdu_action(struct ieee80211_hw *hw, | |||
3529 | } | 3467 | } |
3530 | if (test_bit(STATUS_EXIT_PENDING, &priv->status)) | 3468 | if (test_bit(STATUS_EXIT_PENDING, &priv->status)) |
3531 | ret = 0; | 3469 | ret = 0; |
3470 | if (priv->cfg->use_rts_for_aggregation) { | ||
3471 | struct iwl_station_priv *sta_priv = | ||
3472 | (void *) sta->drv_priv; | ||
3473 | /* | ||
3474 | * switch off RTS/CTS if it was previously enabled | ||
3475 | */ | ||
3476 | |||
3477 | sta_priv->lq_sta.lq.general_params.flags &= | ||
3478 | ~LINK_QUAL_FLAGS_SET_STA_TLC_RTS_MSK; | ||
3479 | iwl_send_lq_cmd(priv, &sta_priv->lq_sta.lq, | ||
3480 | CMD_ASYNC, false); | ||
3481 | } | ||
3532 | break; | 3482 | break; |
3533 | case IEEE80211_AMPDU_TX_OPERATIONAL: | 3483 | case IEEE80211_AMPDU_TX_OPERATIONAL: |
3534 | if (priv->cfg->use_rts_for_ht) { | 3484 | if (priv->cfg->use_rts_for_aggregation) { |
3485 | struct iwl_station_priv *sta_priv = | ||
3486 | (void *) sta->drv_priv; | ||
3487 | |||
3535 | /* | 3488 | /* |
3536 | * switch to RTS/CTS if it is the prefer protection | 3489 | * switch to RTS/CTS if it is the prefer protection |
3537 | * method for HT traffic | 3490 | * method for HT traffic |
3538 | */ | 3491 | */ |
3539 | iwl_enable_rts_cts(priv); | 3492 | |
3493 | sta_priv->lq_sta.lq.general_params.flags |= | ||
3494 | LINK_QUAL_FLAGS_SET_STA_TLC_RTS_MSK; | ||
3495 | iwl_send_lq_cmd(priv, &sta_priv->lq_sta.lq, | ||
3496 | CMD_ASYNC, false); | ||
3540 | } | 3497 | } |
3541 | ret = 0; | 3498 | ret = 0; |
3542 | break; | 3499 | break; |
diff --git a/drivers/net/wireless/iwlwifi/iwl-core.c b/drivers/net/wireless/iwlwifi/iwl-core.c index 8ccb6d205b6d..2c03c6e20a72 100644 --- a/drivers/net/wireless/iwlwifi/iwl-core.c +++ b/drivers/net/wireless/iwlwifi/iwl-core.c | |||
@@ -401,21 +401,38 @@ void iwlcore_free_geos(struct iwl_priv *priv) | |||
401 | EXPORT_SYMBOL(iwlcore_free_geos); | 401 | EXPORT_SYMBOL(iwlcore_free_geos); |
402 | 402 | ||
403 | /* | 403 | /* |
404 | * iwlcore_rts_tx_cmd_flag: Set rts/cts. 3945 and 4965 only share this | 404 | * iwlcore_tx_cmd_protection: Set rts/cts. 3945 and 4965 only share this |
405 | * function. | 405 | * function. |
406 | */ | 406 | */ |
407 | void iwlcore_rts_tx_cmd_flag(struct ieee80211_tx_info *info, | 407 | void iwlcore_tx_cmd_protection(struct iwl_priv *priv, |
408 | __le32 *tx_flags) | 408 | struct ieee80211_tx_info *info, |
409 | __le16 fc, __le32 *tx_flags) | ||
409 | { | 410 | { |
410 | if (info->control.rates[0].flags & IEEE80211_TX_RC_USE_RTS_CTS) { | 411 | if (info->control.rates[0].flags & IEEE80211_TX_RC_USE_RTS_CTS) { |
411 | *tx_flags |= TX_CMD_FLG_RTS_MSK; | 412 | *tx_flags |= TX_CMD_FLG_RTS_MSK; |
412 | *tx_flags &= ~TX_CMD_FLG_CTS_MSK; | 413 | *tx_flags &= ~TX_CMD_FLG_CTS_MSK; |
414 | *tx_flags |= TX_CMD_FLG_FULL_TXOP_PROT_MSK; | ||
415 | |||
416 | if (!ieee80211_is_mgmt(fc)) | ||
417 | return; | ||
418 | |||
419 | switch (fc & cpu_to_le16(IEEE80211_FCTL_STYPE)) { | ||
420 | case cpu_to_le16(IEEE80211_STYPE_AUTH): | ||
421 | case cpu_to_le16(IEEE80211_STYPE_DEAUTH): | ||
422 | case cpu_to_le16(IEEE80211_STYPE_ASSOC_REQ): | ||
423 | case cpu_to_le16(IEEE80211_STYPE_REASSOC_REQ): | ||
424 | *tx_flags &= ~TX_CMD_FLG_RTS_MSK; | ||
425 | *tx_flags |= TX_CMD_FLG_CTS_MSK; | ||
426 | break; | ||
427 | } | ||
413 | } else if (info->control.rates[0].flags & IEEE80211_TX_RC_USE_CTS_PROTECT) { | 428 | } else if (info->control.rates[0].flags & IEEE80211_TX_RC_USE_CTS_PROTECT) { |
414 | *tx_flags &= ~TX_CMD_FLG_RTS_MSK; | 429 | *tx_flags &= ~TX_CMD_FLG_RTS_MSK; |
415 | *tx_flags |= TX_CMD_FLG_CTS_MSK; | 430 | *tx_flags |= TX_CMD_FLG_CTS_MSK; |
431 | *tx_flags |= TX_CMD_FLG_FULL_TXOP_PROT_MSK; | ||
416 | } | 432 | } |
417 | } | 433 | } |
418 | EXPORT_SYMBOL(iwlcore_rts_tx_cmd_flag); | 434 | EXPORT_SYMBOL(iwlcore_tx_cmd_protection); |
435 | |||
419 | 436 | ||
420 | static bool is_single_rx_stream(struct iwl_priv *priv) | 437 | static bool is_single_rx_stream(struct iwl_priv *priv) |
421 | { | 438 | { |
@@ -1869,6 +1886,10 @@ void iwl_bss_info_changed(struct ieee80211_hw *hw, | |||
1869 | priv->staging_rxon.flags |= RXON_FLG_TGG_PROTECT_MSK; | 1886 | priv->staging_rxon.flags |= RXON_FLG_TGG_PROTECT_MSK; |
1870 | else | 1887 | else |
1871 | priv->staging_rxon.flags &= ~RXON_FLG_TGG_PROTECT_MSK; | 1888 | priv->staging_rxon.flags &= ~RXON_FLG_TGG_PROTECT_MSK; |
1889 | if (bss_conf->use_cts_prot) | ||
1890 | priv->staging_rxon.flags |= RXON_FLG_SELF_CTS_EN; | ||
1891 | else | ||
1892 | priv->staging_rxon.flags &= ~RXON_FLG_SELF_CTS_EN; | ||
1872 | } | 1893 | } |
1873 | 1894 | ||
1874 | if (changes & BSS_CHANGED_BASIC_RATES) { | 1895 | if (changes & BSS_CHANGED_BASIC_RATES) { |
diff --git a/drivers/net/wireless/iwlwifi/iwl-core.h b/drivers/net/wireless/iwlwifi/iwl-core.h index e9d23f2f869d..4a71dfb10a15 100644 --- a/drivers/net/wireless/iwlwifi/iwl-core.h +++ b/drivers/net/wireless/iwlwifi/iwl-core.h | |||
@@ -104,8 +104,9 @@ struct iwl_hcmd_utils_ops { | |||
104 | u32 min_average_noise, | 104 | u32 min_average_noise, |
105 | u8 default_chain); | 105 | u8 default_chain); |
106 | void (*chain_noise_reset)(struct iwl_priv *priv); | 106 | void (*chain_noise_reset)(struct iwl_priv *priv); |
107 | void (*rts_tx_cmd_flag)(struct ieee80211_tx_info *info, | 107 | void (*tx_cmd_protection)(struct iwl_priv *priv, |
108 | __le32 *tx_flags); | 108 | struct ieee80211_tx_info *info, |
109 | __le16 fc, __le32 *tx_flags); | ||
109 | int (*calc_rssi)(struct iwl_priv *priv, | 110 | int (*calc_rssi)(struct iwl_priv *priv, |
110 | struct iwl_rx_phy_res *rx_resp); | 111 | struct iwl_rx_phy_res *rx_resp); |
111 | void (*request_scan)(struct iwl_priv *priv, struct ieee80211_vif *vif); | 112 | void (*request_scan)(struct iwl_priv *priv, struct ieee80211_vif *vif); |
@@ -249,7 +250,7 @@ struct iwl_mod_params { | |||
249 | * @led_compensation: compensate on the led on/off time per HW according | 250 | * @led_compensation: compensate on the led on/off time per HW according |
250 | * to the deviation to achieve the desired led frequency. | 251 | * to the deviation to achieve the desired led frequency. |
251 | * The detail algorithm is described in iwl-led.c | 252 | * The detail algorithm is described in iwl-led.c |
252 | * @use_rts_for_ht: use rts/cts protection for HT traffic | 253 | * @use_rts_for_aggregation: use rts/cts protection for HT traffic |
253 | * @chain_noise_num_beacons: number of beacons used to compute chain noise | 254 | * @chain_noise_num_beacons: number of beacons used to compute chain noise |
254 | * @adv_thermal_throttle: support advance thermal throttle | 255 | * @adv_thermal_throttle: support advance thermal throttle |
255 | * @support_ct_kill_exit: support ct kill exit condition | 256 | * @support_ct_kill_exit: support ct kill exit condition |
@@ -318,7 +319,7 @@ struct iwl_cfg { | |||
318 | const bool ht_greenfield_support; | 319 | const bool ht_greenfield_support; |
319 | u16 led_compensation; | 320 | u16 led_compensation; |
320 | const bool broken_powersave; | 321 | const bool broken_powersave; |
321 | bool use_rts_for_ht; | 322 | bool use_rts_for_aggregation; |
322 | int chain_noise_num_beacons; | 323 | int chain_noise_num_beacons; |
323 | const bool supports_idle; | 324 | const bool supports_idle; |
324 | bool adv_thermal_throttle; | 325 | bool adv_thermal_throttle; |
@@ -390,8 +391,9 @@ void iwl_config_ap(struct iwl_priv *priv, struct ieee80211_vif *vif); | |||
390 | void iwl_mac_reset_tsf(struct ieee80211_hw *hw); | 391 | void iwl_mac_reset_tsf(struct ieee80211_hw *hw); |
391 | int iwl_alloc_txq_mem(struct iwl_priv *priv); | 392 | int iwl_alloc_txq_mem(struct iwl_priv *priv); |
392 | void iwl_free_txq_mem(struct iwl_priv *priv); | 393 | void iwl_free_txq_mem(struct iwl_priv *priv); |
393 | void iwlcore_rts_tx_cmd_flag(struct ieee80211_tx_info *info, | 394 | void iwlcore_tx_cmd_protection(struct iwl_priv *priv, |
394 | __le32 *tx_flags); | 395 | struct ieee80211_tx_info *info, |
396 | __le16 fc, __le32 *tx_flags); | ||
395 | #ifdef CONFIG_IWLWIFI_DEBUGFS | 397 | #ifdef CONFIG_IWLWIFI_DEBUGFS |
396 | int iwl_alloc_traffic_mem(struct iwl_priv *priv); | 398 | int iwl_alloc_traffic_mem(struct iwl_priv *priv); |
397 | void iwl_free_traffic_mem(struct iwl_priv *priv); | 399 | void iwl_free_traffic_mem(struct iwl_priv *priv); |
diff --git a/drivers/net/wireless/iwlwifi/iwl3945-base.c b/drivers/net/wireless/iwlwifi/iwl3945-base.c index d24eb47d3705..70c4b8fba0ee 100644 --- a/drivers/net/wireless/iwlwifi/iwl3945-base.c +++ b/drivers/net/wireless/iwlwifi/iwl3945-base.c | |||
@@ -435,10 +435,7 @@ static void iwl3945_build_tx_cmd_basic(struct iwl_priv *priv, | |||
435 | tx_flags |= TX_CMD_FLG_SEQ_CTL_MSK; | 435 | tx_flags |= TX_CMD_FLG_SEQ_CTL_MSK; |
436 | } | 436 | } |
437 | 437 | ||
438 | priv->cfg->ops->utils->rts_tx_cmd_flag(info, &tx_flags); | 438 | priv->cfg->ops->utils->tx_cmd_protection(priv, info, fc, &tx_flags); |
439 | |||
440 | if ((tx_flags & TX_CMD_FLG_RTS_MSK) || (tx_flags & TX_CMD_FLG_CTS_MSK)) | ||
441 | tx_flags |= TX_CMD_FLG_FULL_TXOP_PROT_MSK; | ||
442 | 439 | ||
443 | tx_flags &= ~(TX_CMD_FLG_ANT_SEL_MSK); | 440 | tx_flags &= ~(TX_CMD_FLG_ANT_SEL_MSK); |
444 | if (ieee80211_is_mgmt(fc)) { | 441 | if (ieee80211_is_mgmt(fc)) { |
diff --git a/drivers/net/wireless/libertas/cfg.c b/drivers/net/wireless/libertas/cfg.c index 8e9fbfd804b6..3e82f1627209 100644 --- a/drivers/net/wireless/libertas/cfg.c +++ b/drivers/net/wireless/libertas/cfg.c | |||
@@ -6,7 +6,10 @@ | |||
6 | * | 6 | * |
7 | */ | 7 | */ |
8 | 8 | ||
9 | #include <linux/sched.h> | ||
10 | #include <linux/wait.h> | ||
9 | #include <linux/slab.h> | 11 | #include <linux/slab.h> |
12 | #include <linux/sched.h> | ||
10 | #include <linux/ieee80211.h> | 13 | #include <linux/ieee80211.h> |
11 | #include <net/cfg80211.h> | 14 | #include <net/cfg80211.h> |
12 | #include <asm/unaligned.h> | 15 | #include <asm/unaligned.h> |
diff --git a/drivers/net/wireless/libertas/if_sdio.c b/drivers/net/wireless/libertas/if_sdio.c index 6e71346a7550..ba854c70ab94 100644 --- a/drivers/net/wireless/libertas/if_sdio.c +++ b/drivers/net/wireless/libertas/if_sdio.c | |||
@@ -125,6 +125,8 @@ struct if_sdio_card { | |||
125 | 125 | ||
126 | const char *helper; | 126 | const char *helper; |
127 | const char *firmware; | 127 | const char *firmware; |
128 | bool helper_allocated; | ||
129 | bool firmware_allocated; | ||
128 | 130 | ||
129 | u8 buffer[65536]; | 131 | u8 buffer[65536]; |
130 | 132 | ||
@@ -984,16 +986,34 @@ static int if_sdio_probe(struct sdio_func *func, | |||
984 | card->helper = if_sdio_models[i].helper; | 986 | card->helper = if_sdio_models[i].helper; |
985 | card->firmware = if_sdio_models[i].firmware; | 987 | card->firmware = if_sdio_models[i].firmware; |
986 | 988 | ||
989 | kparam_block_sysfs_write(helper_name); | ||
987 | if (lbs_helper_name) { | 990 | if (lbs_helper_name) { |
991 | char *helper = kstrdup(lbs_helper_name, GFP_KERNEL); | ||
992 | if (!helper) { | ||
993 | kparam_unblock_sysfs_write(helper_name); | ||
994 | ret = -ENOMEM; | ||
995 | goto free; | ||
996 | } | ||
988 | lbs_deb_sdio("overriding helper firmware: %s\n", | 997 | lbs_deb_sdio("overriding helper firmware: %s\n", |
989 | lbs_helper_name); | 998 | lbs_helper_name); |
990 | card->helper = lbs_helper_name; | 999 | card->helper = helper; |
1000 | card->helper_allocated = true; | ||
991 | } | 1001 | } |
1002 | kparam_unblock_sysfs_write(helper_name); | ||
992 | 1003 | ||
1004 | kparam_block_sysfs_write(fw_name); | ||
993 | if (lbs_fw_name) { | 1005 | if (lbs_fw_name) { |
1006 | char *fw_name = kstrdup(lbs_fw_name, GFP_KERNEL); | ||
1007 | if (!fw_name) { | ||
1008 | kparam_unblock_sysfs_write(fw_name); | ||
1009 | ret = -ENOMEM; | ||
1010 | goto free; | ||
1011 | } | ||
994 | lbs_deb_sdio("overriding firmware: %s\n", lbs_fw_name); | 1012 | lbs_deb_sdio("overriding firmware: %s\n", lbs_fw_name); |
995 | card->firmware = lbs_fw_name; | 1013 | card->firmware = fw_name; |
1014 | card->firmware_allocated = true; | ||
996 | } | 1015 | } |
1016 | kparam_unblock_sysfs_write(fw_name); | ||
997 | 1017 | ||
998 | sdio_claim_host(func); | 1018 | sdio_claim_host(func); |
999 | 1019 | ||
@@ -1127,6 +1147,10 @@ free: | |||
1127 | kfree(packet); | 1147 | kfree(packet); |
1128 | } | 1148 | } |
1129 | 1149 | ||
1150 | if (card->helper_allocated) | ||
1151 | kfree(card->helper); | ||
1152 | if (card->firmware_allocated) | ||
1153 | kfree(card->firmware); | ||
1130 | kfree(card); | 1154 | kfree(card); |
1131 | 1155 | ||
1132 | goto out; | 1156 | goto out; |
@@ -1177,6 +1201,10 @@ static void if_sdio_remove(struct sdio_func *func) | |||
1177 | kfree(packet); | 1201 | kfree(packet); |
1178 | } | 1202 | } |
1179 | 1203 | ||
1204 | if (card->helper_allocated) | ||
1205 | kfree(card->helper); | ||
1206 | if (card->firmware_allocated) | ||
1207 | kfree(card->firmware); | ||
1180 | kfree(card); | 1208 | kfree(card); |
1181 | 1209 | ||
1182 | lbs_deb_leave(LBS_DEB_SDIO); | 1210 | lbs_deb_leave(LBS_DEB_SDIO); |
diff --git a/drivers/net/wireless/libertas/if_usb.c b/drivers/net/wireless/libertas/if_usb.c index 07ece9d26c63..3ff61063671a 100644 --- a/drivers/net/wireless/libertas/if_usb.c +++ b/drivers/net/wireless/libertas/if_usb.c | |||
@@ -289,10 +289,13 @@ static int if_usb_probe(struct usb_interface *intf, | |||
289 | } | 289 | } |
290 | 290 | ||
291 | /* Upload firmware */ | 291 | /* Upload firmware */ |
292 | kparam_block_sysfs_write(fw_name); | ||
292 | if (__if_usb_prog_firmware(cardp, lbs_fw_name, BOOT_CMD_FW_BY_USB)) { | 293 | if (__if_usb_prog_firmware(cardp, lbs_fw_name, BOOT_CMD_FW_BY_USB)) { |
294 | kparam_unblock_sysfs_write(fw_name); | ||
293 | lbs_deb_usbd(&udev->dev, "FW upload failed\n"); | 295 | lbs_deb_usbd(&udev->dev, "FW upload failed\n"); |
294 | goto err_prog_firmware; | 296 | goto err_prog_firmware; |
295 | } | 297 | } |
298 | kparam_unblock_sysfs_write(fw_name); | ||
296 | 299 | ||
297 | if (!(priv = lbs_add_card(cardp, &udev->dev))) | 300 | if (!(priv = lbs_add_card(cardp, &udev->dev))) |
298 | goto err_prog_firmware; | 301 | goto err_prog_firmware; |
diff --git a/drivers/net/wireless/libertas_tf/if_usb.c b/drivers/net/wireless/libertas_tf/if_usb.c index b172f5d87a3b..41a4f214ade1 100644 --- a/drivers/net/wireless/libertas_tf/if_usb.c +++ b/drivers/net/wireless/libertas_tf/if_usb.c | |||
@@ -811,12 +811,15 @@ static int if_usb_prog_firmware(struct if_usb_card *cardp) | |||
811 | 811 | ||
812 | lbtf_deb_enter(LBTF_DEB_USB); | 812 | lbtf_deb_enter(LBTF_DEB_USB); |
813 | 813 | ||
814 | kparam_block_sysfs_write(fw_name); | ||
814 | ret = request_firmware(&cardp->fw, lbtf_fw_name, &cardp->udev->dev); | 815 | ret = request_firmware(&cardp->fw, lbtf_fw_name, &cardp->udev->dev); |
815 | if (ret < 0) { | 816 | if (ret < 0) { |
816 | pr_err("request_firmware() failed with %#x\n", ret); | 817 | pr_err("request_firmware() failed with %#x\n", ret); |
817 | pr_err("firmware %s not found\n", lbtf_fw_name); | 818 | pr_err("firmware %s not found\n", lbtf_fw_name); |
819 | kparam_unblock_sysfs_write(fw_name); | ||
818 | goto done; | 820 | goto done; |
819 | } | 821 | } |
822 | kparam_unblock_sysfs_write(fw_name); | ||
820 | 823 | ||
821 | if (check_fwfile_format(cardp->fw->data, cardp->fw->size)) | 824 | if (check_fwfile_format(cardp->fw->data, cardp->fw->size)) |
822 | goto release_fw; | 825 | goto release_fw; |
diff --git a/drivers/net/wireless/p54/p54pci.c b/drivers/net/wireless/p54/p54pci.c index 71a101fb2e4e..822f8dc26e9c 100644 --- a/drivers/net/wireless/p54/p54pci.c +++ b/drivers/net/wireless/p54/p54pci.c | |||
@@ -43,8 +43,6 @@ static DEFINE_PCI_DEVICE_TABLE(p54p_table) = { | |||
43 | { PCI_DEVICE(0x1260, 0x3886) }, | 43 | { PCI_DEVICE(0x1260, 0x3886) }, |
44 | /* Intersil PRISM Xbow Wireless LAN adapter (Symbol AP-300) */ | 44 | /* Intersil PRISM Xbow Wireless LAN adapter (Symbol AP-300) */ |
45 | { PCI_DEVICE(0x1260, 0xffff) }, | 45 | { PCI_DEVICE(0x1260, 0xffff) }, |
46 | /* Standard Microsystems Corp SMC2802W Wireless PCI */ | ||
47 | { PCI_DEVICE(0x10b8, 0x2802) }, | ||
48 | { }, | 46 | { }, |
49 | }; | 47 | }; |
50 | 48 | ||
diff --git a/drivers/net/xilinx_emaclite.c b/drivers/net/xilinx_emaclite.c index b2c2f391b29d..ecbbb688eba0 100644 --- a/drivers/net/xilinx_emaclite.c +++ b/drivers/net/xilinx_emaclite.c | |||
@@ -1086,7 +1086,7 @@ static void xemaclite_remove_ndev(struct net_device *ndev) | |||
1086 | * | 1086 | * |
1087 | * Return: Value of the parameter if the parameter is found, or 0 otherwise | 1087 | * Return: Value of the parameter if the parameter is found, or 0 otherwise |
1088 | */ | 1088 | */ |
1089 | static bool get_bool(struct of_device *ofdev, const char *s) | 1089 | static bool get_bool(struct platform_device *ofdev, const char *s) |
1090 | { | 1090 | { |
1091 | u32 *p = (u32 *)of_get_property(ofdev->dev.of_node, s, NULL); | 1091 | u32 *p = (u32 *)of_get_property(ofdev->dev.of_node, s, NULL); |
1092 | 1092 | ||
@@ -1115,7 +1115,7 @@ static struct net_device_ops xemaclite_netdev_ops; | |||
1115 | * Return: 0, if the driver is bound to the Emaclite device, or | 1115 | * Return: 0, if the driver is bound to the Emaclite device, or |
1116 | * a negative error if there is failure. | 1116 | * a negative error if there is failure. |
1117 | */ | 1117 | */ |
1118 | static int __devinit xemaclite_of_probe(struct of_device *ofdev, | 1118 | static int __devinit xemaclite_of_probe(struct platform_device *ofdev, |
1119 | const struct of_device_id *match) | 1119 | const struct of_device_id *match) |
1120 | { | 1120 | { |
1121 | struct resource r_irq; /* Interrupt resources */ | 1121 | struct resource r_irq; /* Interrupt resources */ |
@@ -1240,7 +1240,7 @@ error2: | |||
1240 | * | 1240 | * |
1241 | * Return: 0, always. | 1241 | * Return: 0, always. |
1242 | */ | 1242 | */ |
1243 | static int __devexit xemaclite_of_remove(struct of_device *of_dev) | 1243 | static int __devexit xemaclite_of_remove(struct platform_device *of_dev) |
1244 | { | 1244 | { |
1245 | struct device *dev = &of_dev->dev; | 1245 | struct device *dev = &of_dev->dev; |
1246 | struct net_device *ndev = dev_get_drvdata(dev); | 1246 | struct net_device *ndev = dev_get_drvdata(dev); |