aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2012-04-10 14:30:45 -0400
committerDavid S. Miller <davem@davemloft.net>2012-04-10 14:30:45 -0400
commit06eb4eafbdc0796d741d139a44f1253278da8611 (patch)
treefbdb44317130c371928154c9e6903e699fe2b995 /drivers/net
parent32ed53b83ea5ec26a4dba90e18f5e0ff6c71eb48 (diff)
parentf68e556e23d1a4176b563bcb25d8baf2c5313f91 (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/appletalk/cops.c1
-rw-r--r--drivers/net/appletalk/ltpc.c1
-rw-r--r--drivers/net/arcnet/com20020_cs.c1
-rw-r--r--drivers/net/bonding/bond_main.c61
-rw-r--r--drivers/net/caif/caif_spi.c10
-rw-r--r--drivers/net/can/slcan.c1
-rw-r--r--drivers/net/cris/eth_v10.c1
-rw-r--r--drivers/net/ethernet/3com/3c574_cs.c1
-rw-r--r--drivers/net/ethernet/3com/3c589_cs.c1
-rw-r--r--drivers/net/ethernet/8390/3c503.c1
-rw-r--r--drivers/net/ethernet/8390/ac3200.c1
-rw-r--r--drivers/net/ethernet/8390/apne.c1
-rw-r--r--drivers/net/ethernet/8390/ax88796.c1
-rw-r--r--drivers/net/ethernet/8390/axnet_cs.c1
-rw-r--r--drivers/net/ethernet/8390/e2100.c1
-rw-r--r--drivers/net/ethernet/8390/es3210.c1
-rw-r--r--drivers/net/ethernet/8390/etherh.c2
-rw-r--r--drivers/net/ethernet/8390/hp-plus.c1
-rw-r--r--drivers/net/ethernet/8390/hp.c1
-rw-r--r--drivers/net/ethernet/8390/lib8390.c1
-rw-r--r--drivers/net/ethernet/8390/lne390.c1
-rw-r--r--drivers/net/ethernet/8390/mac8390.c1
-rw-r--r--drivers/net/ethernet/8390/ne-h8300.c1
-rw-r--r--drivers/net/ethernet/8390/ne.c1
-rw-r--r--drivers/net/ethernet/8390/ne2.c1
-rw-r--r--drivers/net/ethernet/8390/ne2k-pci.c1
-rw-r--r--drivers/net/ethernet/8390/ne3210.c1
-rw-r--r--drivers/net/ethernet/8390/pcnet_cs.c1
-rw-r--r--drivers/net/ethernet/8390/smc-mca.c1
-rw-r--r--drivers/net/ethernet/8390/smc-ultra.c1
-rw-r--r--drivers/net/ethernet/8390/smc-ultra32.c1
-rw-r--r--drivers/net/ethernet/8390/stnic.c1
-rw-r--r--drivers/net/ethernet/8390/wd.c1
-rw-r--r--drivers/net/ethernet/8390/zorro8390.c1
-rw-r--r--drivers/net/ethernet/alteon/acenic.c1
-rw-r--r--drivers/net/ethernet/amd/7990.c1
-rw-r--r--drivers/net/ethernet/amd/am79c961a.c1
-rw-r--r--drivers/net/ethernet/amd/amd8111e.c1
-rw-r--r--drivers/net/ethernet/amd/declance.c1
-rw-r--r--drivers/net/ethernet/amd/hplance.c1
-rw-r--r--drivers/net/ethernet/amd/mvme147.c1
-rw-r--r--drivers/net/ethernet/amd/nmclan_cs.c1
-rw-r--r--drivers/net/ethernet/amd/sunlance.c1
-rw-r--r--drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c1
-rw-r--r--drivers/net/ethernet/broadcom/bnx2x/bnx2x_fw_defs.h110
-rw-r--r--drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c147
-rw-r--r--drivers/net/ethernet/broadcom/bnx2x/bnx2x_reg.h8
-rw-r--r--drivers/net/ethernet/broadcom/tg3.c5
-rw-r--r--drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c9
-rw-r--r--drivers/net/ethernet/cirrus/cs89x0.c1
-rw-r--r--drivers/net/ethernet/cirrus/mac89x0.c1
-rw-r--r--drivers/net/ethernet/dlink/de600.c1
-rw-r--r--drivers/net/ethernet/dlink/de620.c1
-rw-r--r--drivers/net/ethernet/freescale/ucc_geth.c6
-rw-r--r--drivers/net/ethernet/fujitsu/at1700.c1
-rw-r--r--drivers/net/ethernet/fujitsu/eth16i.c1
-rw-r--r--drivers/net/ethernet/fujitsu/fmvj18x_cs.c1
-rw-r--r--drivers/net/ethernet/i825xx/3c507.c1
-rw-r--r--drivers/net/ethernet/i825xx/3c527.c1
-rw-r--r--drivers/net/ethernet/i825xx/eepro.c1
-rw-r--r--drivers/net/ethernet/i825xx/eexpress.c1
-rw-r--r--drivers/net/ethernet/i825xx/ether1.c1
-rw-r--r--drivers/net/ethernet/i825xx/znet.c1
-rw-r--r--drivers/net/ethernet/ibm/ibmveth.c7
-rw-r--r--drivers/net/ethernet/intel/e1000e/e1000.h6
-rw-r--r--drivers/net/ethernet/intel/e1000e/netdev.c26
-rw-r--r--drivers/net/ethernet/intel/ixgbe/ixgbe_dcb_nl.c164
-rw-r--r--drivers/net/ethernet/korina.c1
-rw-r--r--drivers/net/ethernet/marvell/mv643xx_eth.c1
-rw-r--r--drivers/net/ethernet/marvell/pxa168_eth.c1
-rw-r--r--drivers/net/ethernet/marvell/sky2.c18
-rw-r--r--drivers/net/ethernet/mellanox/mlx4/mlx4_en.h5
-rw-r--r--drivers/net/ethernet/micrel/ks8842.c4
-rw-r--r--drivers/net/ethernet/natsemi/jazzsonic.c1
-rw-r--r--drivers/net/ethernet/natsemi/macsonic.c1
-rw-r--r--drivers/net/ethernet/natsemi/ns83820.c1
-rw-r--r--drivers/net/ethernet/neterion/s2io.c1
-rw-r--r--drivers/net/ethernet/nvidia/forcedeth.c1
-rw-r--r--drivers/net/ethernet/realtek/atp.c1
-rw-r--r--drivers/net/ethernet/realtek/r8169.c4
-rw-r--r--drivers/net/ethernet/renesas/sh_eth.c2
-rw-r--r--drivers/net/ethernet/renesas/sh_eth.h4
-rw-r--r--drivers/net/ethernet/seeq/ether3.c1
-rw-r--r--drivers/net/ethernet/seeq/seeq8005.c1
-rw-r--r--drivers/net/ethernet/sfc/mtd.c10
-rw-r--r--drivers/net/ethernet/smsc/smc91c92_cs.c1
-rw-r--r--drivers/net/ethernet/smsc/smc91x.c2
-rw-r--r--drivers/net/ethernet/stmicro/stmmac/stmmac_main.c6
-rw-r--r--drivers/net/ethernet/sun/cassini.c1
-rw-r--r--drivers/net/ethernet/sun/sunbmac.c1
-rw-r--r--drivers/net/ethernet/sun/sungem.c1
-rw-r--r--drivers/net/ethernet/sun/sunhme.c1
-rw-r--r--drivers/net/ethernet/sun/sunqe.c1
-rw-r--r--drivers/net/ethernet/sun/sunvnet.c5
-rw-r--r--drivers/net/ethernet/tundra/tsi108_eth.c1
-rw-r--r--drivers/net/ethernet/via/via-rhine.c12
-rw-r--r--drivers/net/ethernet/xircom/xirc2ps_cs.c1
-rw-r--r--drivers/net/hamradio/6pack.c1
-rw-r--r--drivers/net/hamradio/baycom_par.c1
-rw-r--r--drivers/net/hamradio/bpqether.c1
-rw-r--r--drivers/net/hamradio/mkiss.c1
-rw-r--r--drivers/net/hamradio/scc.c1
-rw-r--r--drivers/net/hamradio/yam.c1
-rw-r--r--drivers/net/hippi/rrunner.c1
-rw-r--r--drivers/net/irda/Kconfig2
-rw-r--r--drivers/net/irda/donauboe.c1
-rw-r--r--drivers/net/irda/sa1100_ir.c953
-rw-r--r--drivers/net/loopback.c1
-rw-r--r--drivers/net/phy/icplus.c3
-rw-r--r--drivers/net/plip/plip.c1
-rw-r--r--drivers/net/ppp/ppp_generic.c14
-rw-r--r--drivers/net/rionet.c11
-rw-r--r--drivers/net/slip/slhc.c1
-rw-r--r--drivers/net/slip/slip.c1
-rw-r--r--drivers/net/tokenring/3c359.c1
-rw-r--r--drivers/net/tokenring/abyss.c1
-rw-r--r--drivers/net/tokenring/ibmtr_cs.c1
-rw-r--r--drivers/net/tokenring/lanstreamer.c1
-rw-r--r--drivers/net/tokenring/madgemc.c1
-rw-r--r--drivers/net/tokenring/olympic.c1
-rw-r--r--drivers/net/tokenring/proteon.c1
-rw-r--r--drivers/net/tokenring/skisa.c1
-rw-r--r--drivers/net/tokenring/smctr.c1
-rw-r--r--drivers/net/tokenring/tms380tr.c1
-rw-r--r--drivers/net/tokenring/tmspci.c1
-rw-r--r--drivers/net/tun.c1
-rw-r--r--drivers/net/usb/cdc_eem.c1
-rw-r--r--drivers/net/usb/rtl8150.c26
-rw-r--r--drivers/net/wan/Kconfig4
-rw-r--r--drivers/net/wan/dlci.c1
-rw-r--r--drivers/net/wan/dscc4.c1
-rw-r--r--drivers/net/wan/hd64570.c1
-rw-r--r--drivers/net/wan/hd64572.c1
-rw-r--r--drivers/net/wan/lapbether.c1
-rw-r--r--drivers/net/wan/sdla.c1
-rw-r--r--drivers/net/wan/x25_asy.c1
-rw-r--r--drivers/net/wimax/i2400m/debugfs.c15
-rw-r--r--drivers/net/wireless/airo.c1
-rw-r--r--drivers/net/wireless/airo_cs.c1
-rw-r--r--drivers/net/wireless/ath/ath5k/debug.c23
-rw-r--r--drivers/net/wireless/ath/ath6kl/debug.c42
-rw-r--r--drivers/net/wireless/ath/ath9k/debug.c37
-rw-r--r--drivers/net/wireless/ath/ath9k/dfs_debug.c9
-rw-r--r--drivers/net/wireless/ath/ath9k/htc_drv_debug.c26
-rw-r--r--drivers/net/wireless/ath/ath9k/rc.c8
-rw-r--r--drivers/net/wireless/ath/carl9170/debug.c7
-rw-r--r--drivers/net/wireless/atmel.c1
-rw-r--r--drivers/net/wireless/atmel_cs.c1
-rw-r--r--drivers/net/wireless/b43/debugfs.c8
-rw-r--r--drivers/net/wireless/b43legacy/debugfs.c8
-rw-r--r--drivers/net/wireless/iwlegacy/3945-rs.c8
-rw-r--r--drivers/net/wireless/iwlegacy/4965-rs.c12
-rw-r--r--drivers/net/wireless/iwlegacy/debug.c12
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-agn-rs.c11
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-debugfs.c12
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-trans-pcie.c12
-rw-r--r--drivers/net/wireless/iwmc3200wifi/debugfs.c14
-rw-r--r--drivers/net/wireless/iwmc3200wifi/sdio.c9
-rw-r--r--drivers/net/wireless/libertas/debugfs.c10
-rw-r--r--drivers/net/wireless/mwifiex/debugfs.c18
-rw-r--r--drivers/net/wireless/prism54/islpci_mgt.c1
-rw-r--r--drivers/net/wireless/ray_cs.c1
-rw-r--r--drivers/net/wireless/wl1251/debugfs.c14
-rw-r--r--drivers/net/wireless/wl12xx/debugfs.c38
-rw-r--r--drivers/net/wireless/wl3501_cs.c1
165 files changed, 1052 insertions, 1059 deletions
diff --git a/drivers/net/appletalk/cops.c b/drivers/net/appletalk/cops.c
index 9abd4eb86dc..dd5e04813b7 100644
--- a/drivers/net/appletalk/cops.c
+++ b/drivers/net/appletalk/cops.c
@@ -70,7 +70,6 @@ static const char *version =
70#include <linux/bitops.h> 70#include <linux/bitops.h>
71#include <linux/jiffies.h> 71#include <linux/jiffies.h>
72 72
73#include <asm/system.h>
74#include <asm/io.h> 73#include <asm/io.h>
75#include <asm/dma.h> 74#include <asm/dma.h>
76 75
diff --git a/drivers/net/appletalk/ltpc.c b/drivers/net/appletalk/ltpc.c
index 6057b30417a..0910dce3996 100644
--- a/drivers/net/appletalk/ltpc.c
+++ b/drivers/net/appletalk/ltpc.c
@@ -229,7 +229,6 @@ static int dma;
229#include <linux/bitops.h> 229#include <linux/bitops.h>
230#include <linux/gfp.h> 230#include <linux/gfp.h>
231 231
232#include <asm/system.h>
233#include <asm/dma.h> 232#include <asm/dma.h>
234#include <asm/io.h> 233#include <asm/io.h>
235 234
diff --git a/drivers/net/arcnet/com20020_cs.c b/drivers/net/arcnet/com20020_cs.c
index 980e65c1493..5bed4c4e250 100644
--- a/drivers/net/arcnet/com20020_cs.c
+++ b/drivers/net/arcnet/com20020_cs.c
@@ -47,7 +47,6 @@
47#include <pcmcia/ds.h> 47#include <pcmcia/ds.h>
48 48
49#include <asm/io.h> 49#include <asm/io.h>
50#include <asm/system.h>
51 50
52#define VERSION "arcnet: COM20020 PCMCIA support loaded.\n" 51#define VERSION "arcnet: COM20020 PCMCIA support loaded.\n"
53 52
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
index a20b5850e7c..62d2409bb29 100644
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -54,7 +54,6 @@
54#include <linux/inet.h> 54#include <linux/inet.h>
55#include <linux/bitops.h> 55#include <linux/bitops.h>
56#include <linux/io.h> 56#include <linux/io.h>
57#include <asm/system.h>
58#include <asm/dma.h> 57#include <asm/dma.h>
59#include <linux/uaccess.h> 58#include <linux/uaccess.h>
60#include <linux/errno.h> 59#include <linux/errno.h>
@@ -2035,6 +2034,9 @@ int bond_release(struct net_device *bond_dev, struct net_device *slave_dev)
2035 write_unlock_bh(&bond->lock); 2034 write_unlock_bh(&bond->lock);
2036 unblock_netpoll_tx(); 2035 unblock_netpoll_tx();
2037 2036
2037 if (bond->slave_cnt == 0)
2038 call_netdevice_notifiers(NETDEV_CHANGEADDR, bond->dev);
2039
2038 bond_compute_features(bond); 2040 bond_compute_features(bond);
2039 if (!(bond_dev->features & NETIF_F_VLAN_CHALLENGED) && 2041 if (!(bond_dev->features & NETIF_F_VLAN_CHALLENGED) &&
2040 (old_features & NETIF_F_VLAN_CHALLENGED)) 2042 (old_features & NETIF_F_VLAN_CHALLENGED))
@@ -3008,7 +3010,11 @@ static void bond_ab_arp_commit(struct bonding *bond, int delta_in_ticks)
3008 trans_start + delta_in_ticks)) || 3010 trans_start + delta_in_ticks)) ||
3009 bond->curr_active_slave != slave) { 3011 bond->curr_active_slave != slave) {
3010 slave->link = BOND_LINK_UP; 3012 slave->link = BOND_LINK_UP;
3011 bond->current_arp_slave = NULL; 3013 if (bond->current_arp_slave) {
3014 bond_set_slave_inactive_flags(
3015 bond->current_arp_slave);
3016 bond->current_arp_slave = NULL;
3017 }
3012 3018
3013 pr_info("%s: link status definitely up for interface %s.\n", 3019 pr_info("%s: link status definitely up for interface %s.\n",
3014 bond->dev->name, slave->dev->name); 3020 bond->dev->name, slave->dev->name);
@@ -3702,17 +3708,52 @@ static void bond_set_multicast_list(struct net_device *bond_dev)
3702 read_unlock(&bond->lock); 3708 read_unlock(&bond->lock);
3703} 3709}
3704 3710
3705static int bond_neigh_setup(struct net_device *dev, struct neigh_parms *parms) 3711static int bond_neigh_init(struct neighbour *n)
3706{ 3712{
3707 struct bonding *bond = netdev_priv(dev); 3713 struct bonding *bond = netdev_priv(n->dev);
3708 struct slave *slave = bond->first_slave; 3714 struct slave *slave = bond->first_slave;
3715 const struct net_device_ops *slave_ops;
3716 struct neigh_parms parms;
3717 int ret;
3718
3719 if (!slave)
3720 return 0;
3721
3722 slave_ops = slave->dev->netdev_ops;
3723
3724 if (!slave_ops->ndo_neigh_setup)
3725 return 0;
3726
3727 parms.neigh_setup = NULL;
3728 parms.neigh_cleanup = NULL;
3729 ret = slave_ops->ndo_neigh_setup(slave->dev, &parms);
3730 if (ret)
3731 return ret;
3732
3733 /*
3734 * Assign slave's neigh_cleanup to neighbour in case cleanup is called
3735 * after the last slave has been detached. Assumes that all slaves
3736 * utilize the same neigh_cleanup (true at this writing as only user
3737 * is ipoib).
3738 */
3739 n->parms->neigh_cleanup = parms.neigh_cleanup;
3740
3741 if (!parms.neigh_setup)
3742 return 0;
3743
3744 return parms.neigh_setup(n);
3745}
3746
3747/*
3748 * The bonding ndo_neigh_setup is called at init time beofre any
3749 * slave exists. So we must declare proxy setup function which will
3750 * be used at run time to resolve the actual slave neigh param setup.
3751 */
3752static int bond_neigh_setup(struct net_device *dev,
3753 struct neigh_parms *parms)
3754{
3755 parms->neigh_setup = bond_neigh_init;
3709 3756
3710 if (slave) {
3711 const struct net_device_ops *slave_ops
3712 = slave->dev->netdev_ops;
3713 if (slave_ops->ndo_neigh_setup)
3714 return slave_ops->ndo_neigh_setup(slave->dev, parms);
3715 }
3716 return 0; 3757 return 0;
3717} 3758}
3718 3759
diff --git a/drivers/net/caif/caif_spi.c b/drivers/net/caif/caif_spi.c
index 96391c36fa7..b71ce9bf0af 100644
--- a/drivers/net/caif/caif_spi.c
+++ b/drivers/net/caif/caif_spi.c
@@ -127,12 +127,6 @@ static inline void dev_debugfs_rem(struct cfspi *cfspi)
127 debugfs_remove(cfspi->dbgfs_dir); 127 debugfs_remove(cfspi->dbgfs_dir);
128} 128}
129 129
130static int dbgfs_open(struct inode *inode, struct file *file)
131{
132 file->private_data = inode->i_private;
133 return 0;
134}
135
136static ssize_t dbgfs_state(struct file *file, char __user *user_buf, 130static ssize_t dbgfs_state(struct file *file, char __user *user_buf,
137 size_t count, loff_t *ppos) 131 size_t count, loff_t *ppos)
138{ 132{
@@ -243,13 +237,13 @@ static ssize_t dbgfs_frame(struct file *file, char __user *user_buf,
243} 237}
244 238
245static const struct file_operations dbgfs_state_fops = { 239static const struct file_operations dbgfs_state_fops = {
246 .open = dbgfs_open, 240 .open = simple_open,
247 .read = dbgfs_state, 241 .read = dbgfs_state,
248 .owner = THIS_MODULE 242 .owner = THIS_MODULE
249}; 243};
250 244
251static const struct file_operations dbgfs_frame_fops = { 245static const struct file_operations dbgfs_frame_fops = {
252 .open = dbgfs_open, 246 .open = simple_open,
253 .read = dbgfs_frame, 247 .read = dbgfs_frame,
254 .owner = THIS_MODULE 248 .owner = THIS_MODULE
255}; 249};
diff --git a/drivers/net/can/slcan.c b/drivers/net/can/slcan.c
index 98a5a7d867f..034c16b60e9 100644
--- a/drivers/net/can/slcan.c
+++ b/drivers/net/can/slcan.c
@@ -40,7 +40,6 @@
40#include <linux/module.h> 40#include <linux/module.h>
41#include <linux/moduleparam.h> 41#include <linux/moduleparam.h>
42 42
43#include <asm/system.h>
44#include <linux/uaccess.h> 43#include <linux/uaccess.h>
45#include <linux/bitops.h> 44#include <linux/bitops.h>
46#include <linux/string.h> 45#include <linux/string.h>
diff --git a/drivers/net/cris/eth_v10.c b/drivers/net/cris/eth_v10.c
index 7cb2785e209..ec03b401620 100644
--- a/drivers/net/cris/eth_v10.c
+++ b/drivers/net/cris/eth_v10.c
@@ -35,7 +35,6 @@
35#include <asm/io.h> /* CRIS_LED_* I/O functions */ 35#include <asm/io.h> /* CRIS_LED_* I/O functions */
36#include <asm/irq.h> 36#include <asm/irq.h>
37#include <asm/dma.h> 37#include <asm/dma.h>
38#include <asm/system.h>
39#include <asm/ethernet.h> 38#include <asm/ethernet.h>
40#include <asm/cache.h> 39#include <asm/cache.h>
41#include <arch/io_interface_mux.h> 40#include <arch/io_interface_mux.h>
diff --git a/drivers/net/ethernet/3com/3c574_cs.c b/drivers/net/ethernet/3com/3c574_cs.c
index e61b2f82ba3..66df9363808 100644
--- a/drivers/net/ethernet/3com/3c574_cs.c
+++ b/drivers/net/ethernet/3com/3c574_cs.c
@@ -95,7 +95,6 @@ earlier 3Com products.
95 95
96#include <asm/uaccess.h> 96#include <asm/uaccess.h>
97#include <asm/io.h> 97#include <asm/io.h>
98#include <asm/system.h>
99 98
100/*====================================================================*/ 99/*====================================================================*/
101 100
diff --git a/drivers/net/ethernet/3com/3c589_cs.c b/drivers/net/ethernet/3com/3c589_cs.c
index b23253b9f74..a556c01e011 100644
--- a/drivers/net/ethernet/3com/3c589_cs.c
+++ b/drivers/net/ethernet/3com/3c589_cs.c
@@ -50,7 +50,6 @@
50 50
51#include <asm/uaccess.h> 51#include <asm/uaccess.h>
52#include <asm/io.h> 52#include <asm/io.h>
53#include <asm/system.h>
54 53
55/* To minimize the size of the driver source I only define operating 54/* To minimize the size of the driver source I only define operating
56 constants if they are used several times. You'll need the manual 55 constants if they are used several times. You'll need the manual
diff --git a/drivers/net/ethernet/8390/3c503.c b/drivers/net/ethernet/8390/3c503.c
index fbab1367505..49d76bd0dc8 100644
--- a/drivers/net/ethernet/8390/3c503.c
+++ b/drivers/net/ethernet/8390/3c503.c
@@ -54,7 +54,6 @@ static const char version[] =
54 54
55#include <asm/uaccess.h> 55#include <asm/uaccess.h>
56#include <asm/io.h> 56#include <asm/io.h>
57#include <asm/system.h>
58#include <asm/byteorder.h> 57#include <asm/byteorder.h>
59 58
60#include "8390.h" 59#include "8390.h"
diff --git a/drivers/net/ethernet/8390/ac3200.c b/drivers/net/ethernet/8390/ac3200.c
index 5337dd0a59b..ccf07942ff6 100644
--- a/drivers/net/ethernet/8390/ac3200.c
+++ b/drivers/net/ethernet/8390/ac3200.c
@@ -34,7 +34,6 @@ static const char version[] =
34#include <linux/init.h> 34#include <linux/init.h>
35#include <linux/interrupt.h> 35#include <linux/interrupt.h>
36 36
37#include <asm/system.h>
38#include <asm/io.h> 37#include <asm/io.h>
39#include <asm/irq.h> 38#include <asm/irq.h>
40 39
diff --git a/drivers/net/ethernet/8390/apne.c b/drivers/net/ethernet/8390/apne.c
index 3ad5d2f9a49..923959275a8 100644
--- a/drivers/net/ethernet/8390/apne.c
+++ b/drivers/net/ethernet/8390/apne.c
@@ -39,7 +39,6 @@
39#include <linux/interrupt.h> 39#include <linux/interrupt.h>
40#include <linux/jiffies.h> 40#include <linux/jiffies.h>
41 41
42#include <asm/system.h>
43#include <asm/io.h> 42#include <asm/io.h>
44#include <asm/setup.h> 43#include <asm/setup.h>
45#include <asm/amigaints.h> 44#include <asm/amigaints.h>
diff --git a/drivers/net/ethernet/8390/ax88796.c b/drivers/net/ethernet/8390/ax88796.c
index 211efbf82b5..203ff9dccad 100644
--- a/drivers/net/ethernet/8390/ax88796.c
+++ b/drivers/net/ethernet/8390/ax88796.c
@@ -31,7 +31,6 @@
31 31
32#include <net/ax88796.h> 32#include <net/ax88796.h>
33 33
34#include <asm/system.h>
35 34
36/* Rename the lib8390.c functions to show that they are in this driver */ 35/* Rename the lib8390.c functions to show that they are in this driver */
37#define __ei_open ax_ei_open 36#define __ei_open ax_ei_open
diff --git a/drivers/net/ethernet/8390/axnet_cs.c b/drivers/net/ethernet/8390/axnet_cs.c
index c5bd8eb7a9f..e1b3941bd14 100644
--- a/drivers/net/ethernet/8390/axnet_cs.c
+++ b/drivers/net/ethernet/8390/axnet_cs.c
@@ -46,7 +46,6 @@
46#include <pcmcia/cisreg.h> 46#include <pcmcia/cisreg.h>
47 47
48#include <asm/io.h> 48#include <asm/io.h>
49#include <asm/system.h>
50#include <asm/byteorder.h> 49#include <asm/byteorder.h>
51#include <asm/uaccess.h> 50#include <asm/uaccess.h>
52 51
diff --git a/drivers/net/ethernet/8390/e2100.c b/drivers/net/ethernet/8390/e2100.c
index d16dc53c181..ed55ce85ebb 100644
--- a/drivers/net/ethernet/8390/e2100.c
+++ b/drivers/net/ethernet/8390/e2100.c
@@ -48,7 +48,6 @@ static const char version[] =
48#include <linux/delay.h> 48#include <linux/delay.h>
49 49
50#include <asm/io.h> 50#include <asm/io.h>
51#include <asm/system.h>
52 51
53#include "8390.h" 52#include "8390.h"
54 53
diff --git a/drivers/net/ethernet/8390/es3210.c b/drivers/net/ethernet/8390/es3210.c
index 6428f9e7a55..ba1b5c95531 100644
--- a/drivers/net/ethernet/8390/es3210.c
+++ b/drivers/net/ethernet/8390/es3210.c
@@ -59,7 +59,6 @@ static const char version[] =
59#include <linux/etherdevice.h> 59#include <linux/etherdevice.h>
60 60
61#include <asm/io.h> 61#include <asm/io.h>
62#include <asm/system.h>
63 62
64#include "8390.h" 63#include "8390.h"
65 64
diff --git a/drivers/net/ethernet/8390/etherh.c b/drivers/net/ethernet/8390/etherh.c
index 89cba45c35c..8322c54972f 100644
--- a/drivers/net/ethernet/8390/etherh.c
+++ b/drivers/net/ethernet/8390/etherh.c
@@ -45,9 +45,9 @@
45#include <linux/bitops.h> 45#include <linux/bitops.h>
46#include <linux/jiffies.h> 46#include <linux/jiffies.h>
47 47
48#include <asm/system.h>
49#include <asm/ecard.h> 48#include <asm/ecard.h>
50#include <asm/io.h> 49#include <asm/io.h>
50#include <asm/system_info.h>
51 51
52#define EI_SHIFT(x) (ei_local->reg_offset[x]) 52#define EI_SHIFT(x) (ei_local->reg_offset[x])
53 53
diff --git a/drivers/net/ethernet/8390/hp-plus.c b/drivers/net/ethernet/8390/hp-plus.c
index d42938b6b59..52f70f999c0 100644
--- a/drivers/net/ethernet/8390/hp-plus.c
+++ b/drivers/net/ethernet/8390/hp-plus.c
@@ -33,7 +33,6 @@ static const char version[] =
33#include <linux/interrupt.h> 33#include <linux/interrupt.h>
34#include <linux/delay.h> 34#include <linux/delay.h>
35 35
36#include <asm/system.h>
37#include <asm/io.h> 36#include <asm/io.h>
38 37
39#include "8390.h" 38#include "8390.h"
diff --git a/drivers/net/ethernet/8390/hp.c b/drivers/net/ethernet/8390/hp.c
index 113f1e075a2..37fa89aa457 100644
--- a/drivers/net/ethernet/8390/hp.c
+++ b/drivers/net/ethernet/8390/hp.c
@@ -33,7 +33,6 @@ static const char version[] =
33#include <linux/interrupt.h> 33#include <linux/interrupt.h>
34#include <linux/delay.h> 34#include <linux/delay.h>
35 35
36#include <asm/system.h>
37#include <asm/io.h> 36#include <asm/io.h>
38 37
39#include "8390.h" 38#include "8390.h"
diff --git a/drivers/net/ethernet/8390/lib8390.c b/drivers/net/ethernet/8390/lib8390.c
index e77f624e819..b329f5c0d62 100644
--- a/drivers/net/ethernet/8390/lib8390.c
+++ b/drivers/net/ethernet/8390/lib8390.c
@@ -57,7 +57,6 @@
57#include <linux/types.h> 57#include <linux/types.h>
58#include <linux/string.h> 58#include <linux/string.h>
59#include <linux/bitops.h> 59#include <linux/bitops.h>
60#include <asm/system.h>
61#include <linux/uaccess.h> 60#include <linux/uaccess.h>
62#include <linux/io.h> 61#include <linux/io.h>
63#include <asm/irq.h> 62#include <asm/irq.h>
diff --git a/drivers/net/ethernet/8390/lne390.c b/drivers/net/ethernet/8390/lne390.c
index 69490ae018e..479409bf2e3 100644
--- a/drivers/net/ethernet/8390/lne390.c
+++ b/drivers/net/ethernet/8390/lne390.c
@@ -46,7 +46,6 @@ static const char *version =
46#include <linux/etherdevice.h> 46#include <linux/etherdevice.h>
47 47
48#include <asm/io.h> 48#include <asm/io.h>
49#include <asm/system.h>
50 49
51#include "8390.h" 50#include "8390.h"
52 51
diff --git a/drivers/net/ethernet/8390/mac8390.c b/drivers/net/ethernet/8390/mac8390.c
index af5d9822cad..88ccc8b14f0 100644
--- a/drivers/net/ethernet/8390/mac8390.c
+++ b/drivers/net/ethernet/8390/mac8390.c
@@ -37,7 +37,6 @@
37#include <linux/bitops.h> 37#include <linux/bitops.h>
38#include <linux/io.h> 38#include <linux/io.h>
39 39
40#include <asm/system.h>
41#include <asm/dma.h> 40#include <asm/dma.h>
42#include <asm/hwtest.h> 41#include <asm/hwtest.h>
43#include <asm/macints.h> 42#include <asm/macints.h>
diff --git a/drivers/net/ethernet/8390/ne-h8300.c b/drivers/net/ethernet/8390/ne-h8300.c
index 9b9c77d5a65..7fc28f2d28a 100644
--- a/drivers/net/ethernet/8390/ne-h8300.c
+++ b/drivers/net/ethernet/8390/ne-h8300.c
@@ -29,7 +29,6 @@ static const char version1[] =
29#include <linux/etherdevice.h> 29#include <linux/etherdevice.h>
30#include <linux/jiffies.h> 30#include <linux/jiffies.h>
31 31
32#include <asm/system.h>
33#include <asm/io.h> 32#include <asm/io.h>
34#include <asm/irq.h> 33#include <asm/irq.h>
35 34
diff --git a/drivers/net/ethernet/8390/ne.c b/drivers/net/ethernet/8390/ne.c
index f92ea2a65a5..d04911d33b6 100644
--- a/drivers/net/ethernet/8390/ne.c
+++ b/drivers/net/ethernet/8390/ne.c
@@ -53,7 +53,6 @@ static const char version2[] =
53#include <linux/jiffies.h> 53#include <linux/jiffies.h>
54#include <linux/platform_device.h> 54#include <linux/platform_device.h>
55 55
56#include <asm/system.h>
57#include <asm/io.h> 56#include <asm/io.h>
58 57
59#include "8390.h" 58#include "8390.h"
diff --git a/drivers/net/ethernet/8390/ne2.c b/drivers/net/ethernet/8390/ne2.c
index 922b32036c6..ef85839f43d 100644
--- a/drivers/net/ethernet/8390/ne2.c
+++ b/drivers/net/ethernet/8390/ne2.c
@@ -76,7 +76,6 @@ static const char *version = "ne2.c:v0.91 Nov 16 1998 Wim Dumon <wimpie@kotnet.o
76#include <linux/bitops.h> 76#include <linux/bitops.h>
77#include <linux/jiffies.h> 77#include <linux/jiffies.h>
78 78
79#include <asm/system.h>
80#include <asm/io.h> 79#include <asm/io.h>
81#include <asm/dma.h> 80#include <asm/dma.h>
82 81
diff --git a/drivers/net/ethernet/8390/ne2k-pci.c b/drivers/net/ethernet/8390/ne2k-pci.c
index 3fab04a0034..5e8845febfb 100644
--- a/drivers/net/ethernet/8390/ne2k-pci.c
+++ b/drivers/net/ethernet/8390/ne2k-pci.c
@@ -54,7 +54,6 @@ static int options[MAX_UNITS];
54#include <linux/netdevice.h> 54#include <linux/netdevice.h>
55#include <linux/etherdevice.h> 55#include <linux/etherdevice.h>
56 56
57#include <asm/system.h>
58#include <asm/io.h> 57#include <asm/io.h>
59#include <asm/irq.h> 58#include <asm/irq.h>
60#include <asm/uaccess.h> 59#include <asm/uaccess.h>
diff --git a/drivers/net/ethernet/8390/ne3210.c b/drivers/net/ethernet/8390/ne3210.c
index 2a3e8057fea..a2f8b2b8e27 100644
--- a/drivers/net/ethernet/8390/ne3210.c
+++ b/drivers/net/ethernet/8390/ne3210.c
@@ -39,7 +39,6 @@
39#include <linux/mm.h> 39#include <linux/mm.h>
40 40
41#include <asm/io.h> 41#include <asm/io.h>
42#include <asm/system.h>
43 42
44#include "8390.h" 43#include "8390.h"
45 44
diff --git a/drivers/net/ethernet/8390/pcnet_cs.c b/drivers/net/ethernet/8390/pcnet_cs.c
index f2a4e5de18c..de1af0bfed4 100644
--- a/drivers/net/ethernet/8390/pcnet_cs.c
+++ b/drivers/net/ethernet/8390/pcnet_cs.c
@@ -49,7 +49,6 @@
49#include <pcmcia/cisreg.h> 49#include <pcmcia/cisreg.h>
50 50
51#include <asm/io.h> 51#include <asm/io.h>
52#include <asm/system.h>
53#include <asm/byteorder.h> 52#include <asm/byteorder.h>
54#include <asm/uaccess.h> 53#include <asm/uaccess.h>
55 54
diff --git a/drivers/net/ethernet/8390/smc-mca.c b/drivers/net/ethernet/8390/smc-mca.c
index 77efec44fea..7a68590f280 100644
--- a/drivers/net/ethernet/8390/smc-mca.c
+++ b/drivers/net/ethernet/8390/smc-mca.c
@@ -47,7 +47,6 @@
47#include <linux/etherdevice.h> 47#include <linux/etherdevice.h>
48 48
49#include <asm/io.h> 49#include <asm/io.h>
50#include <asm/system.h>
51 50
52#include "8390.h" 51#include "8390.h"
53 52
diff --git a/drivers/net/ethernet/8390/smc-ultra.c b/drivers/net/ethernet/8390/smc-ultra.c
index 1cc306a83ff..b0fbce39661 100644
--- a/drivers/net/ethernet/8390/smc-ultra.c
+++ b/drivers/net/ethernet/8390/smc-ultra.c
@@ -69,7 +69,6 @@ static const char version[] =
69 69
70#include <asm/io.h> 70#include <asm/io.h>
71#include <asm/irq.h> 71#include <asm/irq.h>
72#include <asm/system.h>
73 72
74#include "8390.h" 73#include "8390.h"
75 74
diff --git a/drivers/net/ethernet/8390/smc-ultra32.c b/drivers/net/ethernet/8390/smc-ultra32.c
index bb87053eb3d..923e42aedcf 100644
--- a/drivers/net/ethernet/8390/smc-ultra32.c
+++ b/drivers/net/ethernet/8390/smc-ultra32.c
@@ -57,7 +57,6 @@ static const char *version = "smc-ultra32.c: 06/97 v1.00\n";
57#include <linux/etherdevice.h> 57#include <linux/etherdevice.h>
58 58
59#include <asm/io.h> 59#include <asm/io.h>
60#include <asm/system.h>
61 60
62#include "8390.h" 61#include "8390.h"
63 62
diff --git a/drivers/net/ethernet/8390/stnic.c b/drivers/net/ethernet/8390/stnic.c
index 3b903759980..8df4c415723 100644
--- a/drivers/net/ethernet/8390/stnic.c
+++ b/drivers/net/ethernet/8390/stnic.c
@@ -17,7 +17,6 @@
17#include <linux/init.h> 17#include <linux/init.h>
18#include <linux/delay.h> 18#include <linux/delay.h>
19 19
20#include <asm/system.h>
21#include <asm/io.h> 20#include <asm/io.h>
22#include <mach-se/mach/se.h> 21#include <mach-se/mach/se.h>
23#include <asm/machvec.h> 22#include <asm/machvec.h>
diff --git a/drivers/net/ethernet/8390/wd.c b/drivers/net/ethernet/8390/wd.c
index c175fadb597..03eb3eed49f 100644
--- a/drivers/net/ethernet/8390/wd.c
+++ b/drivers/net/ethernet/8390/wd.c
@@ -39,7 +39,6 @@ static const char version[] =
39#include <linux/etherdevice.h> 39#include <linux/etherdevice.h>
40 40
41#include <asm/io.h> 41#include <asm/io.h>
42#include <asm/system.h>
43 42
44#include "8390.h" 43#include "8390.h"
45 44
diff --git a/drivers/net/ethernet/8390/zorro8390.c b/drivers/net/ethernet/8390/zorro8390.c
index bcd27323b20..7818e6397e9 100644
--- a/drivers/net/ethernet/8390/zorro8390.c
+++ b/drivers/net/ethernet/8390/zorro8390.c
@@ -31,7 +31,6 @@
31#include <linux/zorro.h> 31#include <linux/zorro.h>
32#include <linux/jiffies.h> 32#include <linux/jiffies.h>
33 33
34#include <asm/system.h>
35#include <asm/irq.h> 34#include <asm/irq.h>
36#include <asm/amigaints.h> 35#include <asm/amigaints.h>
37#include <asm/amigahw.h> 36#include <asm/amigahw.h>
diff --git a/drivers/net/ethernet/alteon/acenic.c b/drivers/net/ethernet/alteon/acenic.c
index 6c3b1c0adaa..7219123fa0a 100644
--- a/drivers/net/ethernet/alteon/acenic.c
+++ b/drivers/net/ethernet/alteon/acenic.c
@@ -78,7 +78,6 @@
78#include <net/sock.h> 78#include <net/sock.h>
79#include <net/ip.h> 79#include <net/ip.h>
80 80
81#include <asm/system.h>
82#include <asm/io.h> 81#include <asm/io.h>
83#include <asm/irq.h> 82#include <asm/irq.h>
84#include <asm/byteorder.h> 83#include <asm/byteorder.h>
diff --git a/drivers/net/ethernet/amd/7990.c b/drivers/net/ethernet/amd/7990.c
index 1b046f58d58..6e722dc37db 100644
--- a/drivers/net/ethernet/amd/7990.c
+++ b/drivers/net/ethernet/amd/7990.c
@@ -33,7 +33,6 @@
33#include <linux/socket.h> 33#include <linux/socket.h>
34#include <linux/bitops.h> 34#include <linux/bitops.h>
35 35
36#include <asm/system.h>
37#include <asm/io.h> 36#include <asm/io.h>
38#include <asm/dma.h> 37#include <asm/dma.h>
39#include <asm/pgtable.h> 38#include <asm/pgtable.h>
diff --git a/drivers/net/ethernet/amd/am79c961a.c b/drivers/net/ethernet/amd/am79c961a.c
index cc7b9e46780..e10ffad525a 100644
--- a/drivers/net/ethernet/amd/am79c961a.c
+++ b/drivers/net/ethernet/amd/am79c961a.c
@@ -30,7 +30,6 @@
30#include <linux/io.h> 30#include <linux/io.h>
31 31
32#include <mach/hardware.h> 32#include <mach/hardware.h>
33#include <asm/system.h>
34 33
35#define TX_BUFFERS 15 34#define TX_BUFFERS 15
36#define RX_BUFFERS 25 35#define RX_BUFFERS 25
diff --git a/drivers/net/ethernet/amd/amd8111e.c b/drivers/net/ethernet/amd/amd8111e.c
index 9f62504d008..64d0d9c1afa 100644
--- a/drivers/net/ethernet/amd/amd8111e.c
+++ b/drivers/net/ethernet/amd/amd8111e.c
@@ -88,7 +88,6 @@ Revision History:
88#include <linux/crc32.h> 88#include <linux/crc32.h>
89#include <linux/dma-mapping.h> 89#include <linux/dma-mapping.h>
90 90
91#include <asm/system.h>
92#include <asm/io.h> 91#include <asm/io.h>
93#include <asm/byteorder.h> 92#include <asm/byteorder.h>
94#include <asm/uaccess.h> 93#include <asm/uaccess.h>
diff --git a/drivers/net/ethernet/amd/declance.c b/drivers/net/ethernet/amd/declance.c
index 7dc508e5c72..75299f500ee 100644
--- a/drivers/net/ethernet/amd/declance.c
+++ b/drivers/net/ethernet/amd/declance.c
@@ -64,7 +64,6 @@
64#include <linux/types.h> 64#include <linux/types.h>
65 65
66#include <asm/addrspace.h> 66#include <asm/addrspace.h>
67#include <asm/system.h>
68 67
69#include <asm/dec/interrupts.h> 68#include <asm/dec/interrupts.h>
70#include <asm/dec/ioasic.h> 69#include <asm/dec/ioasic.h>
diff --git a/drivers/net/ethernet/amd/hplance.c b/drivers/net/ethernet/amd/hplance.c
index 4e2d68a4de8..8baff4e5d96 100644
--- a/drivers/net/ethernet/amd/hplance.c
+++ b/drivers/net/ethernet/amd/hplance.c
@@ -22,7 +22,6 @@
22#include <linux/etherdevice.h> 22#include <linux/etherdevice.h>
23#include <linux/skbuff.h> 23#include <linux/skbuff.h>
24 24
25#include <asm/system.h>
26#include <asm/io.h> 25#include <asm/io.h>
27#include <asm/pgtable.h> 26#include <asm/pgtable.h>
28 27
diff --git a/drivers/net/ethernet/amd/mvme147.c b/drivers/net/ethernet/amd/mvme147.c
index 56bc47a9418..9af3c307862 100644
--- a/drivers/net/ethernet/amd/mvme147.c
+++ b/drivers/net/ethernet/amd/mvme147.c
@@ -22,7 +22,6 @@
22#include <linux/etherdevice.h> 22#include <linux/etherdevice.h>
23#include <linux/skbuff.h> 23#include <linux/skbuff.h>
24 24
25#include <asm/system.h>
26#include <asm/io.h> 25#include <asm/io.h>
27#include <asm/pgtable.h> 26#include <asm/pgtable.h>
28#include <asm/mvme147hw.h> 27#include <asm/mvme147hw.h>
diff --git a/drivers/net/ethernet/amd/nmclan_cs.c b/drivers/net/ethernet/amd/nmclan_cs.c
index ebdb9e238a8..9f59bf63514 100644
--- a/drivers/net/ethernet/amd/nmclan_cs.c
+++ b/drivers/net/ethernet/amd/nmclan_cs.c
@@ -154,7 +154,6 @@ Include Files
154 154
155#include <asm/uaccess.h> 155#include <asm/uaccess.h>
156#include <asm/io.h> 156#include <asm/io.h>
157#include <asm/system.h>
158 157
159/* ---------------------------------------------------------------------------- 158/* ----------------------------------------------------------------------------
160Defines 159Defines
diff --git a/drivers/net/ethernet/amd/sunlance.c b/drivers/net/ethernet/amd/sunlance.c
index e3fe3504e19..d7a3533d990 100644
--- a/drivers/net/ethernet/amd/sunlance.c
+++ b/drivers/net/ethernet/amd/sunlance.c
@@ -95,7 +95,6 @@ static char lancestr[] = "LANCE";
95#include <linux/of_device.h> 95#include <linux/of_device.h>
96#include <linux/gfp.h> 96#include <linux/gfp.h>
97 97
98#include <asm/system.h>
99#include <asm/io.h> 98#include <asm/io.h>
100#include <asm/dma.h> 99#include <asm/dma.h>
101#include <asm/pgtable.h> 100#include <asm/pgtable.h>
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c
index 583da06e715..5a58cff78dc 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c
@@ -1863,7 +1863,6 @@ int bnx2x_nic_load(struct bnx2x *bp, int load_mode)
1863 * bnx2x_periodic_task(). 1863 * bnx2x_periodic_task().
1864 */ 1864 */
1865 smp_mb(); 1865 smp_mb();
1866 queue_delayed_work(bnx2x_wq, &bp->period_task, 0);
1867 } else 1866 } else
1868 bp->port.pmf = 0; 1867 bp->port.pmf = 0;
1869 1868
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_fw_defs.h b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_fw_defs.h
index cd6dfa9eaa3..b9b26332343 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_fw_defs.h
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_fw_defs.h
@@ -25,31 +25,31 @@
25 (IRO[149].base + ((funcId) * IRO[149].m1)) 25 (IRO[149].base + ((funcId) * IRO[149].m1))
26#define CSTORM_IGU_MODE_OFFSET (IRO[157].base) 26#define CSTORM_IGU_MODE_OFFSET (IRO[157].base)
27#define CSTORM_ISCSI_CQ_SIZE_OFFSET(pfId) \ 27#define CSTORM_ISCSI_CQ_SIZE_OFFSET(pfId) \
28 (IRO[315].base + ((pfId) * IRO[315].m1))
29#define CSTORM_ISCSI_CQ_SQN_SIZE_OFFSET(pfId) \
30 (IRO[316].base + ((pfId) * IRO[316].m1)) 28 (IRO[316].base + ((pfId) * IRO[316].m1))
29#define CSTORM_ISCSI_CQ_SQN_SIZE_OFFSET(pfId) \
30 (IRO[317].base + ((pfId) * IRO[317].m1))
31#define CSTORM_ISCSI_EQ_CONS_OFFSET(pfId, iscsiEqId) \ 31#define CSTORM_ISCSI_EQ_CONS_OFFSET(pfId, iscsiEqId) \
32 (IRO[308].base + ((pfId) * IRO[308].m1) + ((iscsiEqId) * IRO[308].m2)) 32 (IRO[309].base + ((pfId) * IRO[309].m1) + ((iscsiEqId) * IRO[309].m2))
33#define CSTORM_ISCSI_EQ_NEXT_EQE_ADDR_OFFSET(pfId, iscsiEqId) \ 33#define CSTORM_ISCSI_EQ_NEXT_EQE_ADDR_OFFSET(pfId, iscsiEqId) \
34 (IRO[310].base + ((pfId) * IRO[310].m1) + ((iscsiEqId) * IRO[310].m2)) 34 (IRO[311].base + ((pfId) * IRO[311].m1) + ((iscsiEqId) * IRO[311].m2))
35#define CSTORM_ISCSI_EQ_NEXT_PAGE_ADDR_OFFSET(pfId, iscsiEqId) \ 35#define CSTORM_ISCSI_EQ_NEXT_PAGE_ADDR_OFFSET(pfId, iscsiEqId) \
36 (IRO[309].base + ((pfId) * IRO[309].m1) + ((iscsiEqId) * IRO[309].m2)) 36 (IRO[310].base + ((pfId) * IRO[310].m1) + ((iscsiEqId) * IRO[310].m2))
37#define CSTORM_ISCSI_EQ_NEXT_PAGE_ADDR_VALID_OFFSET(pfId, iscsiEqId) \ 37#define CSTORM_ISCSI_EQ_NEXT_PAGE_ADDR_VALID_OFFSET(pfId, iscsiEqId) \
38 (IRO[311].base + ((pfId) * IRO[311].m1) + ((iscsiEqId) * IRO[311].m2)) 38 (IRO[312].base + ((pfId) * IRO[312].m1) + ((iscsiEqId) * IRO[312].m2))
39#define CSTORM_ISCSI_EQ_PROD_OFFSET(pfId, iscsiEqId) \ 39#define CSTORM_ISCSI_EQ_PROD_OFFSET(pfId, iscsiEqId) \
40 (IRO[307].base + ((pfId) * IRO[307].m1) + ((iscsiEqId) * IRO[307].m2)) 40 (IRO[308].base + ((pfId) * IRO[308].m1) + ((iscsiEqId) * IRO[308].m2))
41#define CSTORM_ISCSI_EQ_SB_INDEX_OFFSET(pfId, iscsiEqId) \ 41#define CSTORM_ISCSI_EQ_SB_INDEX_OFFSET(pfId, iscsiEqId) \
42 (IRO[313].base + ((pfId) * IRO[313].m1) + ((iscsiEqId) * IRO[313].m2)) 42 (IRO[314].base + ((pfId) * IRO[314].m1) + ((iscsiEqId) * IRO[314].m2))
43#define CSTORM_ISCSI_EQ_SB_NUM_OFFSET(pfId, iscsiEqId) \ 43#define CSTORM_ISCSI_EQ_SB_NUM_OFFSET(pfId, iscsiEqId) \
44 (IRO[312].base + ((pfId) * IRO[312].m1) + ((iscsiEqId) * IRO[312].m2)) 44 (IRO[313].base + ((pfId) * IRO[313].m1) + ((iscsiEqId) * IRO[313].m2))
45#define CSTORM_ISCSI_HQ_SIZE_OFFSET(pfId) \ 45#define CSTORM_ISCSI_HQ_SIZE_OFFSET(pfId) \
46 (IRO[314].base + ((pfId) * IRO[314].m1)) 46 (IRO[315].base + ((pfId) * IRO[315].m1))
47#define CSTORM_ISCSI_NUM_OF_TASKS_OFFSET(pfId) \ 47#define CSTORM_ISCSI_NUM_OF_TASKS_OFFSET(pfId) \
48 (IRO[306].base + ((pfId) * IRO[306].m1)) 48 (IRO[307].base + ((pfId) * IRO[307].m1))
49#define CSTORM_ISCSI_PAGE_SIZE_LOG_OFFSET(pfId) \ 49#define CSTORM_ISCSI_PAGE_SIZE_LOG_OFFSET(pfId) \
50 (IRO[305].base + ((pfId) * IRO[305].m1)) 50 (IRO[306].base + ((pfId) * IRO[306].m1))
51#define CSTORM_ISCSI_PAGE_SIZE_OFFSET(pfId) \ 51#define CSTORM_ISCSI_PAGE_SIZE_OFFSET(pfId) \
52 (IRO[304].base + ((pfId) * IRO[304].m1)) 52 (IRO[305].base + ((pfId) * IRO[305].m1))
53#define CSTORM_RECORD_SLOW_PATH_OFFSET(funcId) \ 53#define CSTORM_RECORD_SLOW_PATH_OFFSET(funcId) \
54 (IRO[151].base + ((funcId) * IRO[151].m1)) 54 (IRO[151].base + ((funcId) * IRO[151].m1))
55#define CSTORM_SP_STATUS_BLOCK_DATA_OFFSET(pfId) \ 55#define CSTORM_SP_STATUS_BLOCK_DATA_OFFSET(pfId) \
@@ -96,37 +96,37 @@
96#define TSTORM_FUNC_EN_OFFSET(funcId) \ 96#define TSTORM_FUNC_EN_OFFSET(funcId) \
97 (IRO[103].base + ((funcId) * IRO[103].m1)) 97 (IRO[103].base + ((funcId) * IRO[103].m1))
98#define TSTORM_ISCSI_ERROR_BITMAP_OFFSET(pfId) \ 98#define TSTORM_ISCSI_ERROR_BITMAP_OFFSET(pfId) \
99 (IRO[271].base + ((pfId) * IRO[271].m1))
100#define TSTORM_ISCSI_L2_ISCSI_OOO_CID_TABLE_OFFSET(pfId) \
101 (IRO[272].base + ((pfId) * IRO[272].m1)) 99 (IRO[272].base + ((pfId) * IRO[272].m1))
102#define TSTORM_ISCSI_L2_ISCSI_OOO_CLIENT_ID_TABLE_OFFSET(pfId) \ 100#define TSTORM_ISCSI_L2_ISCSI_OOO_CID_TABLE_OFFSET(pfId) \
103 (IRO[273].base + ((pfId) * IRO[273].m1)) 101 (IRO[273].base + ((pfId) * IRO[273].m1))
104#define TSTORM_ISCSI_L2_ISCSI_OOO_PROD_OFFSET(pfId) \ 102#define TSTORM_ISCSI_L2_ISCSI_OOO_CLIENT_ID_TABLE_OFFSET(pfId) \
105 (IRO[274].base + ((pfId) * IRO[274].m1)) 103 (IRO[274].base + ((pfId) * IRO[274].m1))
104#define TSTORM_ISCSI_L2_ISCSI_OOO_PROD_OFFSET(pfId) \
105 (IRO[275].base + ((pfId) * IRO[275].m1))
106#define TSTORM_ISCSI_NUM_OF_TASKS_OFFSET(pfId) \ 106#define TSTORM_ISCSI_NUM_OF_TASKS_OFFSET(pfId) \
107 (IRO[270].base + ((pfId) * IRO[270].m1)) 107 (IRO[271].base + ((pfId) * IRO[271].m1))
108#define TSTORM_ISCSI_PAGE_SIZE_LOG_OFFSET(pfId) \ 108#define TSTORM_ISCSI_PAGE_SIZE_LOG_OFFSET(pfId) \
109 (IRO[269].base + ((pfId) * IRO[269].m1)) 109 (IRO[270].base + ((pfId) * IRO[270].m1))
110#define TSTORM_ISCSI_PAGE_SIZE_OFFSET(pfId) \ 110#define TSTORM_ISCSI_PAGE_SIZE_OFFSET(pfId) \
111 (IRO[268].base + ((pfId) * IRO[268].m1)) 111 (IRO[269].base + ((pfId) * IRO[269].m1))
112#define TSTORM_ISCSI_RQ_SIZE_OFFSET(pfId) \ 112#define TSTORM_ISCSI_RQ_SIZE_OFFSET(pfId) \
113 (IRO[267].base + ((pfId) * IRO[267].m1)) 113 (IRO[268].base + ((pfId) * IRO[268].m1))
114#define TSTORM_ISCSI_TCP_LOCAL_ADV_WND_OFFSET(pfId) \ 114#define TSTORM_ISCSI_TCP_LOCAL_ADV_WND_OFFSET(pfId) \
115 (IRO[276].base + ((pfId) * IRO[276].m1)) 115 (IRO[277].base + ((pfId) * IRO[277].m1))
116#define TSTORM_ISCSI_TCP_VARS_FLAGS_OFFSET(pfId) \ 116#define TSTORM_ISCSI_TCP_VARS_FLAGS_OFFSET(pfId) \
117 (IRO[263].base + ((pfId) * IRO[263].m1))
118#define TSTORM_ISCSI_TCP_VARS_LSB_LOCAL_MAC_ADDR_OFFSET(pfId) \
119 (IRO[264].base + ((pfId) * IRO[264].m1)) 117 (IRO[264].base + ((pfId) * IRO[264].m1))
120#define TSTORM_ISCSI_TCP_VARS_MID_LOCAL_MAC_ADDR_OFFSET(pfId) \ 118#define TSTORM_ISCSI_TCP_VARS_LSB_LOCAL_MAC_ADDR_OFFSET(pfId) \
121 (IRO[265].base + ((pfId) * IRO[265].m1)) 119 (IRO[265].base + ((pfId) * IRO[265].m1))
122#define TSTORM_ISCSI_TCP_VARS_MSB_LOCAL_MAC_ADDR_OFFSET(pfId) \ 120#define TSTORM_ISCSI_TCP_VARS_MID_LOCAL_MAC_ADDR_OFFSET(pfId) \
123 (IRO[266].base + ((pfId) * IRO[266].m1)) 121 (IRO[266].base + ((pfId) * IRO[266].m1))
122#define TSTORM_ISCSI_TCP_VARS_MSB_LOCAL_MAC_ADDR_OFFSET(pfId) \
123 (IRO[267].base + ((pfId) * IRO[267].m1))
124#define TSTORM_MAC_FILTER_CONFIG_OFFSET(pfId) \ 124#define TSTORM_MAC_FILTER_CONFIG_OFFSET(pfId) \
125 (IRO[202].base + ((pfId) * IRO[202].m1)) 125 (IRO[202].base + ((pfId) * IRO[202].m1))
126#define TSTORM_RECORD_SLOW_PATH_OFFSET(funcId) \ 126#define TSTORM_RECORD_SLOW_PATH_OFFSET(funcId) \
127 (IRO[105].base + ((funcId) * IRO[105].m1)) 127 (IRO[105].base + ((funcId) * IRO[105].m1))
128#define TSTORM_TCP_MAX_CWND_OFFSET(pfId) \ 128#define TSTORM_TCP_MAX_CWND_OFFSET(pfId) \
129 (IRO[216].base + ((pfId) * IRO[216].m1)) 129 (IRO[217].base + ((pfId) * IRO[217].m1))
130#define TSTORM_VF_TO_PF_OFFSET(funcId) \ 130#define TSTORM_VF_TO_PF_OFFSET(funcId) \
131 (IRO[104].base + ((funcId) * IRO[104].m1)) 131 (IRO[104].base + ((funcId) * IRO[104].m1))
132#define USTORM_AGG_DATA_OFFSET (IRO[206].base) 132#define USTORM_AGG_DATA_OFFSET (IRO[206].base)
@@ -140,29 +140,29 @@
140#define USTORM_ETH_PAUSE_ENABLED_OFFSET(portId) \ 140#define USTORM_ETH_PAUSE_ENABLED_OFFSET(portId) \
141 (IRO[183].base + ((portId) * IRO[183].m1)) 141 (IRO[183].base + ((portId) * IRO[183].m1))
142#define USTORM_FCOE_EQ_PROD_OFFSET(pfId) \ 142#define USTORM_FCOE_EQ_PROD_OFFSET(pfId) \
143 (IRO[317].base + ((pfId) * IRO[317].m1)) 143 (IRO[318].base + ((pfId) * IRO[318].m1))
144#define USTORM_FUNC_EN_OFFSET(funcId) \ 144#define USTORM_FUNC_EN_OFFSET(funcId) \
145 (IRO[178].base + ((funcId) * IRO[178].m1)) 145 (IRO[178].base + ((funcId) * IRO[178].m1))
146#define USTORM_ISCSI_CQ_SIZE_OFFSET(pfId) \ 146#define USTORM_ISCSI_CQ_SIZE_OFFSET(pfId) \
147 (IRO[281].base + ((pfId) * IRO[281].m1))
148#define USTORM_ISCSI_CQ_SQN_SIZE_OFFSET(pfId) \
149 (IRO[282].base + ((pfId) * IRO[282].m1)) 147 (IRO[282].base + ((pfId) * IRO[282].m1))
148#define USTORM_ISCSI_CQ_SQN_SIZE_OFFSET(pfId) \
149 (IRO[283].base + ((pfId) * IRO[283].m1))
150#define USTORM_ISCSI_ERROR_BITMAP_OFFSET(pfId) \ 150#define USTORM_ISCSI_ERROR_BITMAP_OFFSET(pfId) \
151 (IRO[286].base + ((pfId) * IRO[286].m1)) 151 (IRO[287].base + ((pfId) * IRO[287].m1))
152#define USTORM_ISCSI_GLOBAL_BUF_PHYS_ADDR_OFFSET(pfId) \ 152#define USTORM_ISCSI_GLOBAL_BUF_PHYS_ADDR_OFFSET(pfId) \
153 (IRO[283].base + ((pfId) * IRO[283].m1)) 153 (IRO[284].base + ((pfId) * IRO[284].m1))
154#define USTORM_ISCSI_NUM_OF_TASKS_OFFSET(pfId) \ 154#define USTORM_ISCSI_NUM_OF_TASKS_OFFSET(pfId) \
155 (IRO[279].base + ((pfId) * IRO[279].m1)) 155 (IRO[280].base + ((pfId) * IRO[280].m1))
156#define USTORM_ISCSI_PAGE_SIZE_LOG_OFFSET(pfId) \ 156#define USTORM_ISCSI_PAGE_SIZE_LOG_OFFSET(pfId) \
157 (IRO[278].base + ((pfId) * IRO[278].m1)) 157 (IRO[279].base + ((pfId) * IRO[279].m1))
158#define USTORM_ISCSI_PAGE_SIZE_OFFSET(pfId) \ 158#define USTORM_ISCSI_PAGE_SIZE_OFFSET(pfId) \
159 (IRO[277].base + ((pfId) * IRO[277].m1)) 159 (IRO[278].base + ((pfId) * IRO[278].m1))
160#define USTORM_ISCSI_R2TQ_SIZE_OFFSET(pfId) \ 160#define USTORM_ISCSI_R2TQ_SIZE_OFFSET(pfId) \
161 (IRO[280].base + ((pfId) * IRO[280].m1)) 161 (IRO[281].base + ((pfId) * IRO[281].m1))
162#define USTORM_ISCSI_RQ_BUFFER_SIZE_OFFSET(pfId) \ 162#define USTORM_ISCSI_RQ_BUFFER_SIZE_OFFSET(pfId) \
163 (IRO[284].base + ((pfId) * IRO[284].m1))
164#define USTORM_ISCSI_RQ_SIZE_OFFSET(pfId) \
165 (IRO[285].base + ((pfId) * IRO[285].m1)) 163 (IRO[285].base + ((pfId) * IRO[285].m1))
164#define USTORM_ISCSI_RQ_SIZE_OFFSET(pfId) \
165 (IRO[286].base + ((pfId) * IRO[286].m1))
166#define USTORM_MEM_WORKAROUND_ADDRESS_OFFSET(pfId) \ 166#define USTORM_MEM_WORKAROUND_ADDRESS_OFFSET(pfId) \
167 (IRO[182].base + ((pfId) * IRO[182].m1)) 167 (IRO[182].base + ((pfId) * IRO[182].m1))
168#define USTORM_RECORD_SLOW_PATH_OFFSET(funcId) \ 168#define USTORM_RECORD_SLOW_PATH_OFFSET(funcId) \
@@ -188,39 +188,39 @@
188#define XSTORM_FUNC_EN_OFFSET(funcId) \ 188#define XSTORM_FUNC_EN_OFFSET(funcId) \
189 (IRO[47].base + ((funcId) * IRO[47].m1)) 189 (IRO[47].base + ((funcId) * IRO[47].m1))
190#define XSTORM_ISCSI_HQ_SIZE_OFFSET(pfId) \ 190#define XSTORM_ISCSI_HQ_SIZE_OFFSET(pfId) \
191 (IRO[294].base + ((pfId) * IRO[294].m1)) 191 (IRO[295].base + ((pfId) * IRO[295].m1))
192#define XSTORM_ISCSI_LOCAL_MAC_ADDR0_OFFSET(pfId) \ 192#define XSTORM_ISCSI_LOCAL_MAC_ADDR0_OFFSET(pfId) \
193 (IRO[297].base + ((pfId) * IRO[297].m1))
194#define XSTORM_ISCSI_LOCAL_MAC_ADDR1_OFFSET(pfId) \
195 (IRO[298].base + ((pfId) * IRO[298].m1)) 193 (IRO[298].base + ((pfId) * IRO[298].m1))
196#define XSTORM_ISCSI_LOCAL_MAC_ADDR2_OFFSET(pfId) \ 194#define XSTORM_ISCSI_LOCAL_MAC_ADDR1_OFFSET(pfId) \
197 (IRO[299].base + ((pfId) * IRO[299].m1)) 195 (IRO[299].base + ((pfId) * IRO[299].m1))
198#define XSTORM_ISCSI_LOCAL_MAC_ADDR3_OFFSET(pfId) \ 196#define XSTORM_ISCSI_LOCAL_MAC_ADDR2_OFFSET(pfId) \
199 (IRO[300].base + ((pfId) * IRO[300].m1)) 197 (IRO[300].base + ((pfId) * IRO[300].m1))
200#define XSTORM_ISCSI_LOCAL_MAC_ADDR4_OFFSET(pfId) \ 198#define XSTORM_ISCSI_LOCAL_MAC_ADDR3_OFFSET(pfId) \
201 (IRO[301].base + ((pfId) * IRO[301].m1)) 199 (IRO[301].base + ((pfId) * IRO[301].m1))
202#define XSTORM_ISCSI_LOCAL_MAC_ADDR5_OFFSET(pfId) \ 200#define XSTORM_ISCSI_LOCAL_MAC_ADDR4_OFFSET(pfId) \
203 (IRO[302].base + ((pfId) * IRO[302].m1)) 201 (IRO[302].base + ((pfId) * IRO[302].m1))
204#define XSTORM_ISCSI_LOCAL_VLAN_OFFSET(pfId) \ 202#define XSTORM_ISCSI_LOCAL_MAC_ADDR5_OFFSET(pfId) \
205 (IRO[303].base + ((pfId) * IRO[303].m1)) 203 (IRO[303].base + ((pfId) * IRO[303].m1))
204#define XSTORM_ISCSI_LOCAL_VLAN_OFFSET(pfId) \
205 (IRO[304].base + ((pfId) * IRO[304].m1))
206#define XSTORM_ISCSI_NUM_OF_TASKS_OFFSET(pfId) \ 206#define XSTORM_ISCSI_NUM_OF_TASKS_OFFSET(pfId) \
207 (IRO[293].base + ((pfId) * IRO[293].m1)) 207 (IRO[294].base + ((pfId) * IRO[294].m1))
208#define XSTORM_ISCSI_PAGE_SIZE_LOG_OFFSET(pfId) \ 208#define XSTORM_ISCSI_PAGE_SIZE_LOG_OFFSET(pfId) \
209 (IRO[292].base + ((pfId) * IRO[292].m1)) 209 (IRO[293].base + ((pfId) * IRO[293].m1))
210#define XSTORM_ISCSI_PAGE_SIZE_OFFSET(pfId) \ 210#define XSTORM_ISCSI_PAGE_SIZE_OFFSET(pfId) \
211 (IRO[291].base + ((pfId) * IRO[291].m1)) 211 (IRO[292].base + ((pfId) * IRO[292].m1))
212#define XSTORM_ISCSI_R2TQ_SIZE_OFFSET(pfId) \ 212#define XSTORM_ISCSI_R2TQ_SIZE_OFFSET(pfId) \
213 (IRO[296].base + ((pfId) * IRO[296].m1)) 213 (IRO[297].base + ((pfId) * IRO[297].m1))
214#define XSTORM_ISCSI_SQ_SIZE_OFFSET(pfId) \ 214#define XSTORM_ISCSI_SQ_SIZE_OFFSET(pfId) \
215 (IRO[295].base + ((pfId) * IRO[295].m1)) 215 (IRO[296].base + ((pfId) * IRO[296].m1))
216#define XSTORM_ISCSI_TCP_VARS_ADV_WND_SCL_OFFSET(pfId) \ 216#define XSTORM_ISCSI_TCP_VARS_ADV_WND_SCL_OFFSET(pfId) \
217 (IRO[290].base + ((pfId) * IRO[290].m1)) 217 (IRO[291].base + ((pfId) * IRO[291].m1))
218#define XSTORM_ISCSI_TCP_VARS_FLAGS_OFFSET(pfId) \ 218#define XSTORM_ISCSI_TCP_VARS_FLAGS_OFFSET(pfId) \
219 (IRO[289].base + ((pfId) * IRO[289].m1)) 219 (IRO[290].base + ((pfId) * IRO[290].m1))
220#define XSTORM_ISCSI_TCP_VARS_TOS_OFFSET(pfId) \ 220#define XSTORM_ISCSI_TCP_VARS_TOS_OFFSET(pfId) \
221 (IRO[288].base + ((pfId) * IRO[288].m1)) 221 (IRO[289].base + ((pfId) * IRO[289].m1))
222#define XSTORM_ISCSI_TCP_VARS_TTL_OFFSET(pfId) \ 222#define XSTORM_ISCSI_TCP_VARS_TTL_OFFSET(pfId) \
223 (IRO[287].base + ((pfId) * IRO[287].m1)) 223 (IRO[288].base + ((pfId) * IRO[288].m1))
224#define XSTORM_RATE_SHAPING_PER_VN_VARS_OFFSET(pfId) \ 224#define XSTORM_RATE_SHAPING_PER_VN_VARS_OFFSET(pfId) \
225 (IRO[44].base + ((pfId) * IRO[44].m1)) 225 (IRO[44].base + ((pfId) * IRO[44].m1))
226#define XSTORM_RECORD_SLOW_PATH_OFFSET(funcId) \ 226#define XSTORM_RECORD_SLOW_PATH_OFFSET(funcId) \
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c
index 71e5bd00e8b..ff882a48209 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c
@@ -1340,7 +1340,14 @@ static void bnx2x_update_pfc_xmac(struct link_params *params,
1340 pfc1_val |= XMAC_PFC_CTRL_HI_REG_PFC_REFRESH_EN | 1340 pfc1_val |= XMAC_PFC_CTRL_HI_REG_PFC_REFRESH_EN |
1341 XMAC_PFC_CTRL_HI_REG_PFC_STATS_EN | 1341 XMAC_PFC_CTRL_HI_REG_PFC_STATS_EN |
1342 XMAC_PFC_CTRL_HI_REG_RX_PFC_EN | 1342 XMAC_PFC_CTRL_HI_REG_RX_PFC_EN |
1343 XMAC_PFC_CTRL_HI_REG_TX_PFC_EN; 1343 XMAC_PFC_CTRL_HI_REG_TX_PFC_EN |
1344 XMAC_PFC_CTRL_HI_REG_FORCE_PFC_XON;
1345 /* Write pause and PFC registers */
1346 REG_WR(bp, xmac_base + XMAC_REG_PAUSE_CTRL, pause_val);
1347 REG_WR(bp, xmac_base + XMAC_REG_PFC_CTRL, pfc0_val);
1348 REG_WR(bp, xmac_base + XMAC_REG_PFC_CTRL_HI, pfc1_val);
1349 pfc1_val &= ~XMAC_PFC_CTRL_HI_REG_FORCE_PFC_XON;
1350
1344 } 1351 }
1345 1352
1346 /* Write pause and PFC registers */ 1353 /* Write pause and PFC registers */
@@ -3574,6 +3581,33 @@ static void bnx2x_ext_phy_update_adv_fc(struct bnx2x_phy *phy,
3574 if (phy->type == PORT_HW_CFG_XGXS_EXT_PHY_TYPE_BCM54618SE) { 3581 if (phy->type == PORT_HW_CFG_XGXS_EXT_PHY_TYPE_BCM54618SE) {
3575 bnx2x_cl22_read(bp, phy, 0x4, &ld_pause); 3582 bnx2x_cl22_read(bp, phy, 0x4, &ld_pause);
3576 bnx2x_cl22_read(bp, phy, 0x5, &lp_pause); 3583 bnx2x_cl22_read(bp, phy, 0x5, &lp_pause);
3584 } else if (CHIP_IS_E3(bp) &&
3585 SINGLE_MEDIA_DIRECT(params)) {
3586 u8 lane = bnx2x_get_warpcore_lane(phy, params);
3587 u16 gp_status, gp_mask;
3588 bnx2x_cl45_read(bp, phy,
3589 MDIO_AN_DEVAD, MDIO_WC_REG_GP2_STATUS_GP_2_4,
3590 &gp_status);
3591 gp_mask = (MDIO_WC_REG_GP2_STATUS_GP_2_4_CL73_AN_CMPL |
3592 MDIO_WC_REG_GP2_STATUS_GP_2_4_CL37_LP_AN_CAP) <<
3593 lane;
3594 if ((gp_status & gp_mask) == gp_mask) {
3595 bnx2x_cl45_read(bp, phy, MDIO_AN_DEVAD,
3596 MDIO_AN_REG_ADV_PAUSE, &ld_pause);
3597 bnx2x_cl45_read(bp, phy, MDIO_AN_DEVAD,
3598 MDIO_AN_REG_LP_AUTO_NEG, &lp_pause);
3599 } else {
3600 bnx2x_cl45_read(bp, phy, MDIO_AN_DEVAD,
3601 MDIO_AN_REG_CL37_FC_LD, &ld_pause);
3602 bnx2x_cl45_read(bp, phy, MDIO_AN_DEVAD,
3603 MDIO_AN_REG_CL37_FC_LP, &lp_pause);
3604 ld_pause = ((ld_pause &
3605 MDIO_COMBO_IEEE0_AUTO_NEG_ADV_PAUSE_BOTH)
3606 << 3);
3607 lp_pause = ((lp_pause &
3608 MDIO_COMBO_IEEE0_AUTO_NEG_ADV_PAUSE_BOTH)
3609 << 3);
3610 }
3577 } else { 3611 } else {
3578 bnx2x_cl45_read(bp, phy, 3612 bnx2x_cl45_read(bp, phy,
3579 MDIO_AN_DEVAD, 3613 MDIO_AN_DEVAD,
@@ -3625,7 +3659,23 @@ static void bnx2x_warpcore_enable_AN_KR(struct bnx2x_phy *phy,
3625 u16 val16 = 0, lane, bam37 = 0; 3659 u16 val16 = 0, lane, bam37 = 0;
3626 struct bnx2x *bp = params->bp; 3660 struct bnx2x *bp = params->bp;
3627 DP(NETIF_MSG_LINK, "Enable Auto Negotiation for KR\n"); 3661 DP(NETIF_MSG_LINK, "Enable Auto Negotiation for KR\n");
3628 3662 /* Set to default registers that may be overriden by 10G force */
3663 bnx2x_cl45_write(bp, phy, MDIO_WC_DEVAD,
3664 MDIO_WC_REG_SERDESDIGITAL_CONTROL1000X2, 0x7);
3665 bnx2x_cl45_write(bp, phy, MDIO_AN_DEVAD,
3666 MDIO_WC_REG_PAR_DET_10G_CTRL, 0);
3667 bnx2x_cl45_write(bp, phy, MDIO_WC_DEVAD,
3668 MDIO_WC_REG_CL72_USERB0_CL72_MISC1_CONTROL, 0);
3669 bnx2x_cl45_write(bp, phy, MDIO_WC_DEVAD,
3670 MDIO_WC_REG_XGXSBLK1_LANECTRL0, 0xff);
3671 bnx2x_cl45_write(bp, phy, MDIO_WC_DEVAD,
3672 MDIO_WC_REG_XGXSBLK1_LANECTRL1, 0x5555);
3673 bnx2x_cl45_write(bp, phy, MDIO_PMA_DEVAD,
3674 MDIO_WC_REG_IEEE0BLK_AUTONEGNP, 0x0);
3675 bnx2x_cl45_write(bp, phy, MDIO_WC_DEVAD,
3676 MDIO_WC_REG_RX66_CONTROL, 0x7415);
3677 bnx2x_cl45_write(bp, phy, MDIO_WC_DEVAD,
3678 MDIO_WC_REG_SERDESDIGITAL_MISC2, 0x6190);
3629 /* Disable Autoneg: re-enable it after adv is done. */ 3679 /* Disable Autoneg: re-enable it after adv is done. */
3630 bnx2x_cl45_write(bp, phy, MDIO_AN_DEVAD, 3680 bnx2x_cl45_write(bp, phy, MDIO_AN_DEVAD,
3631 MDIO_WC_REG_IEEE0BLK_MIICNTL, 0); 3681 MDIO_WC_REG_IEEE0BLK_MIICNTL, 0);
@@ -3868,13 +3918,13 @@ static void bnx2x_warpcore_set_10G_XFI(struct bnx2x_phy *phy,
3868 3918
3869 } else { 3919 } else {
3870 misc1_val |= 0x9; 3920 misc1_val |= 0x9;
3871 tap_val = ((0x12 << MDIO_WC_REG_TX_FIR_TAP_POST_TAP_OFFSET) | 3921 tap_val = ((0x0f << MDIO_WC_REG_TX_FIR_TAP_POST_TAP_OFFSET) |
3872 (0x2d << MDIO_WC_REG_TX_FIR_TAP_MAIN_TAP_OFFSET) | 3922 (0x2b << MDIO_WC_REG_TX_FIR_TAP_MAIN_TAP_OFFSET) |
3873 (0x00 << MDIO_WC_REG_TX_FIR_TAP_PRE_TAP_OFFSET)); 3923 (0x02 << MDIO_WC_REG_TX_FIR_TAP_PRE_TAP_OFFSET));
3874 tx_driver_val = 3924 tx_driver_val =
3875 ((0x02 << MDIO_WC_REG_TX0_TX_DRIVER_POST2_COEFF_OFFSET) | 3925 ((0x03 << MDIO_WC_REG_TX0_TX_DRIVER_POST2_COEFF_OFFSET) |
3876 (0x02 << MDIO_WC_REG_TX0_TX_DRIVER_IDRIVER_OFFSET) | 3926 (0x02 << MDIO_WC_REG_TX0_TX_DRIVER_IDRIVER_OFFSET) |
3877 (0x02 << MDIO_WC_REG_TX0_TX_DRIVER_IPRE_DRIVER_OFFSET)); 3927 (0x06 << MDIO_WC_REG_TX0_TX_DRIVER_IPRE_DRIVER_OFFSET));
3878 } 3928 }
3879 bnx2x_cl45_write(bp, phy, MDIO_WC_DEVAD, 3929 bnx2x_cl45_write(bp, phy, MDIO_WC_DEVAD,
3880 MDIO_WC_REG_SERDESDIGITAL_MISC1, misc1_val); 3930 MDIO_WC_REG_SERDESDIGITAL_MISC1, misc1_val);
@@ -4290,7 +4340,7 @@ static void bnx2x_warpcore_config_init(struct bnx2x_phy *phy,
4290 switch (serdes_net_if) { 4340 switch (serdes_net_if) {
4291 case PORT_HW_CFG_NET_SERDES_IF_KR: 4341 case PORT_HW_CFG_NET_SERDES_IF_KR:
4292 /* Enable KR Auto Neg */ 4342 /* Enable KR Auto Neg */
4293 if (params->loopback_mode == LOOPBACK_NONE) 4343 if (params->loopback_mode != LOOPBACK_EXT)
4294 bnx2x_warpcore_enable_AN_KR(phy, params, vars); 4344 bnx2x_warpcore_enable_AN_KR(phy, params, vars);
4295 else { 4345 else {
4296 DP(NETIF_MSG_LINK, "Setting KR 10G-Force\n"); 4346 DP(NETIF_MSG_LINK, "Setting KR 10G-Force\n");
@@ -6076,12 +6126,14 @@ int bnx2x_set_led(struct link_params *params,
6076 6126
6077 tmp = EMAC_RD(bp, EMAC_REG_EMAC_LED); 6127 tmp = EMAC_RD(bp, EMAC_REG_EMAC_LED);
6078 if (params->phy[EXT_PHY1].type == 6128 if (params->phy[EXT_PHY1].type ==
6079 PORT_HW_CFG_XGXS_EXT_PHY_TYPE_BCM54618SE) 6129 PORT_HW_CFG_XGXS_EXT_PHY_TYPE_BCM54618SE)
6080 EMAC_WR(bp, EMAC_REG_EMAC_LED, tmp & 0xfff1); 6130 tmp &= ~(EMAC_LED_1000MB_OVERRIDE |
6081 else { 6131 EMAC_LED_100MB_OVERRIDE |
6082 EMAC_WR(bp, EMAC_REG_EMAC_LED, 6132 EMAC_LED_10MB_OVERRIDE);
6083 (tmp | EMAC_LED_OVERRIDE)); 6133 else
6084 } 6134 tmp |= EMAC_LED_OVERRIDE;
6135
6136 EMAC_WR(bp, EMAC_REG_EMAC_LED, tmp);
6085 break; 6137 break;
6086 6138
6087 case LED_MODE_OPER: 6139 case LED_MODE_OPER:
@@ -6131,10 +6183,15 @@ int bnx2x_set_led(struct link_params *params,
6131 hw_led_mode); 6183 hw_led_mode);
6132 } else if ((params->phy[EXT_PHY1].type == 6184 } else if ((params->phy[EXT_PHY1].type ==
6133 PORT_HW_CFG_XGXS_EXT_PHY_TYPE_BCM54618SE) && 6185 PORT_HW_CFG_XGXS_EXT_PHY_TYPE_BCM54618SE) &&
6134 (mode != LED_MODE_OPER)) { 6186 (mode == LED_MODE_ON)) {
6135 REG_WR(bp, NIG_REG_LED_MODE_P0 + port*4, 0); 6187 REG_WR(bp, NIG_REG_LED_MODE_P0 + port*4, 0);
6136 tmp = EMAC_RD(bp, EMAC_REG_EMAC_LED); 6188 tmp = EMAC_RD(bp, EMAC_REG_EMAC_LED);
6137 EMAC_WR(bp, EMAC_REG_EMAC_LED, tmp | 0x3); 6189 EMAC_WR(bp, EMAC_REG_EMAC_LED, tmp |
6190 EMAC_LED_OVERRIDE | EMAC_LED_1000MB_OVERRIDE);
6191 /* Break here; otherwise, it'll disable the
6192 * intended override.
6193 */
6194 break;
6138 } else 6195 } else
6139 REG_WR(bp, NIG_REG_LED_MODE_P0 + port*4, 6196 REG_WR(bp, NIG_REG_LED_MODE_P0 + port*4,
6140 hw_led_mode); 6197 hw_led_mode);
@@ -6149,13 +6206,9 @@ int bnx2x_set_led(struct link_params *params,
6149 LED_BLINK_RATE_VAL_E1X_E2); 6206 LED_BLINK_RATE_VAL_E1X_E2);
6150 REG_WR(bp, NIG_REG_LED_CONTROL_BLINK_RATE_ENA_P0 + 6207 REG_WR(bp, NIG_REG_LED_CONTROL_BLINK_RATE_ENA_P0 +
6151 port*4, 1); 6208 port*4, 1);
6152 if ((params->phy[EXT_PHY1].type != 6209 tmp = EMAC_RD(bp, EMAC_REG_EMAC_LED);
6153 PORT_HW_CFG_XGXS_EXT_PHY_TYPE_BCM54618SE) && 6210 EMAC_WR(bp, EMAC_REG_EMAC_LED,
6154 (mode != LED_MODE_OPER)) { 6211 (tmp & (~EMAC_LED_OVERRIDE)));
6155 tmp = EMAC_RD(bp, EMAC_REG_EMAC_LED);
6156 EMAC_WR(bp, EMAC_REG_EMAC_LED,
6157 (tmp & (~EMAC_LED_OVERRIDE)));
6158 }
6159 6212
6160 if (CHIP_IS_E1(bp) && 6213 if (CHIP_IS_E1(bp) &&
6161 ((speed == SPEED_2500) || 6214 ((speed == SPEED_2500) ||
@@ -6736,6 +6789,12 @@ int bnx2x_link_update(struct link_params *params, struct link_vars *vars)
6736 SINGLE_MEDIA_DIRECT(params)) && 6789 SINGLE_MEDIA_DIRECT(params)) &&
6737 (phy_vars[active_external_phy].fault_detected == 0)); 6790 (phy_vars[active_external_phy].fault_detected == 0));
6738 6791
6792 /* Update the PFC configuration in case it was changed */
6793 if (params->feature_config_flags & FEATURE_CONFIG_PFC_ENABLED)
6794 vars->link_status |= LINK_STATUS_PFC_ENABLED;
6795 else
6796 vars->link_status &= ~LINK_STATUS_PFC_ENABLED;
6797
6739 if (vars->link_up) 6798 if (vars->link_up)
6740 rc = bnx2x_update_link_up(params, vars, link_10g_plus); 6799 rc = bnx2x_update_link_up(params, vars, link_10g_plus);
6741 else 6800 else
@@ -7909,7 +7968,9 @@ static int bnx2x_verify_sfp_module(struct bnx2x_phy *phy,
7909 netdev_err(bp->dev, "Warning: Unqualified SFP+ module detected," 7968 netdev_err(bp->dev, "Warning: Unqualified SFP+ module detected,"
7910 " Port %d from %s part number %s\n", 7969 " Port %d from %s part number %s\n",
7911 params->port, vendor_name, vendor_pn); 7970 params->port, vendor_name, vendor_pn);
7912 phy->flags |= FLAGS_SFP_NOT_APPROVED; 7971 if ((val & PORT_FEAT_CFG_OPT_MDL_ENFRCMNT_MASK) !=
7972 PORT_FEAT_CFG_OPT_MDL_ENFRCMNT_WARNING_MSG)
7973 phy->flags |= FLAGS_SFP_NOT_APPROVED;
7913 return -EINVAL; 7974 return -EINVAL;
7914} 7975}
7915 7976
@@ -8948,6 +9009,12 @@ static int bnx2x_8727_config_init(struct bnx2x_phy *phy,
8948 tmp2 &= 0xFFEF; 9009 tmp2 &= 0xFFEF;
8949 bnx2x_cl45_write(bp, phy, 9010 bnx2x_cl45_write(bp, phy,
8950 MDIO_PMA_DEVAD, MDIO_PMA_REG_8727_OPT_CFG_REG, tmp2); 9011 MDIO_PMA_DEVAD, MDIO_PMA_REG_8727_OPT_CFG_REG, tmp2);
9012 bnx2x_cl45_read(bp, phy,
9013 MDIO_PMA_DEVAD, MDIO_PMA_REG_PHY_IDENTIFIER,
9014 &tmp2);
9015 bnx2x_cl45_write(bp, phy,
9016 MDIO_PMA_DEVAD, MDIO_PMA_REG_PHY_IDENTIFIER,
9017 (tmp2 & 0x7fff));
8951 } 9018 }
8952 9019
8953 return 0; 9020 return 0;
@@ -9123,12 +9190,11 @@ static u8 bnx2x_8727_read_status(struct bnx2x_phy *phy,
9123 MDIO_PMA_DEVAD, MDIO_PMA_LASI_RXCTRL, 9190 MDIO_PMA_DEVAD, MDIO_PMA_LASI_RXCTRL,
9124 ((1<<5) | (1<<2))); 9191 ((1<<5) | (1<<2)));
9125 } 9192 }
9126 DP(NETIF_MSG_LINK, "Enabling 8727 TX laser if SFP is approved\n"); 9193
9127 bnx2x_8727_specific_func(phy, params, ENABLE_TX); 9194 if (!(phy->flags & FLAGS_SFP_NOT_APPROVED)) {
9128 /* If transmitter is disabled, ignore false link up indication */ 9195 DP(NETIF_MSG_LINK, "Enabling 8727 TX laser\n");
9129 bnx2x_cl45_read(bp, phy, 9196 bnx2x_sfp_set_transmitter(params, phy, 1);
9130 MDIO_PMA_DEVAD, MDIO_PMA_REG_PHY_IDENTIFIER, &val1); 9197 } else {
9131 if (val1 & (1<<15)) {
9132 DP(NETIF_MSG_LINK, "Tx is disabled\n"); 9198 DP(NETIF_MSG_LINK, "Tx is disabled\n");
9133 return 0; 9199 return 0;
9134 } 9200 }
@@ -9220,8 +9286,7 @@ static void bnx2x_save_848xx_spirom_version(struct bnx2x_phy *phy,
9220 9286
9221 if (phy->type == PORT_HW_CFG_XGXS_EXT_PHY_TYPE_BCM84833) { 9287 if (phy->type == PORT_HW_CFG_XGXS_EXT_PHY_TYPE_BCM84833) {
9222 bnx2x_cl45_read(bp, phy, MDIO_CTL_DEVAD, 0x400f, &fw_ver1); 9288 bnx2x_cl45_read(bp, phy, MDIO_CTL_DEVAD, 0x400f, &fw_ver1);
9223 bnx2x_save_spirom_version(bp, port, 9289 bnx2x_save_spirom_version(bp, port, fw_ver1 & 0xfff,
9224 ((fw_ver1 & 0xf000)>>5) | (fw_ver1 & 0x7f),
9225 phy->ver_addr); 9290 phy->ver_addr);
9226 } else { 9291 } else {
9227 /* For 32-bit registers in 848xx, access via MDIO2ARM i/f. */ 9292 /* For 32-bit registers in 848xx, access via MDIO2ARM i/f. */
@@ -9642,6 +9707,15 @@ static int bnx2x_84833_hw_reset_phy(struct bnx2x_phy *phy,
9642 other_shmem_base_addr)); 9707 other_shmem_base_addr));
9643 9708
9644 u32 shmem_base_path[2]; 9709 u32 shmem_base_path[2];
9710
9711 /* Work around for 84833 LED failure inside RESET status */
9712 bnx2x_cl45_write(bp, phy, MDIO_AN_DEVAD,
9713 MDIO_AN_REG_8481_LEGACY_MII_CTRL,
9714 MDIO_AN_REG_8481_MII_CTRL_FORCE_1G);
9715 bnx2x_cl45_write(bp, phy, MDIO_AN_DEVAD,
9716 MDIO_AN_REG_8481_1G_100T_EXT_CTRL,
9717 MIDO_AN_REG_8481_EXT_CTRL_FORCE_LEDS_OFF);
9718
9645 shmem_base_path[0] = params->shmem_base; 9719 shmem_base_path[0] = params->shmem_base;
9646 shmem_base_path[1] = other_shmem_base_addr; 9720 shmem_base_path[1] = other_shmem_base_addr;
9647 9721
@@ -9951,7 +10025,7 @@ static void bnx2x_848x3_link_reset(struct bnx2x_phy *phy,
9951 u8 port; 10025 u8 port;
9952 u16 val16; 10026 u16 val16;
9953 10027
9954 if (!(CHIP_IS_E1(bp))) 10028 if (!(CHIP_IS_E1x(bp)))
9955 port = BP_PATH(bp); 10029 port = BP_PATH(bp);
9956 else 10030 else
9957 port = params->port; 10031 port = params->port;
@@ -9978,7 +10052,7 @@ static void bnx2x_848xx_set_link_led(struct bnx2x_phy *phy,
9978 u16 val; 10052 u16 val;
9979 u8 port; 10053 u8 port;
9980 10054
9981 if (!(CHIP_IS_E1(bp))) 10055 if (!(CHIP_IS_E1x(bp)))
9982 port = BP_PATH(bp); 10056 port = BP_PATH(bp);
9983 else 10057 else
9984 port = params->port; 10058 port = params->port;
@@ -11893,6 +11967,9 @@ int bnx2x_phy_init(struct link_params *params, struct link_vars *vars)
11893 11967
11894 bnx2x_emac_init(params, vars); 11968 bnx2x_emac_init(params, vars);
11895 11969
11970 if (params->feature_config_flags & FEATURE_CONFIG_PFC_ENABLED)
11971 vars->link_status |= LINK_STATUS_PFC_ENABLED;
11972
11896 if (params->num_phys == 0) { 11973 if (params->num_phys == 0) {
11897 DP(NETIF_MSG_LINK, "No phy found for initialization !!\n"); 11974 DP(NETIF_MSG_LINK, "No phy found for initialization !!\n");
11898 return -EINVAL; 11975 return -EINVAL;
@@ -11973,10 +12050,10 @@ int bnx2x_link_reset(struct link_params *params, struct link_vars *vars,
11973 * Hold it as vars low 12050 * Hold it as vars low
11974 */ 12051 */
11975 /* clear link led */ 12052 /* clear link led */
12053 bnx2x_set_mdio_clk(bp, params->chip_id, port);
11976 bnx2x_set_led(params, vars, LED_MODE_OFF, 0); 12054 bnx2x_set_led(params, vars, LED_MODE_OFF, 0);
11977 12055
11978 if (reset_ext_phy) { 12056 if (reset_ext_phy) {
11979 bnx2x_set_mdio_clk(bp, params->chip_id, port);
11980 for (phy_index = EXT_PHY1; phy_index < params->num_phys; 12057 for (phy_index = EXT_PHY1; phy_index < params->num_phys;
11981 phy_index++) { 12058 phy_index++) {
11982 if (params->phy[phy_index].link_reset) { 12059 if (params->phy[phy_index].link_reset) {
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_reg.h b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_reg.h
index 4532172c9fd..bbd387492a8 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_reg.h
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_reg.h
@@ -5359,6 +5359,7 @@
5359#define XMAC_CTRL_REG_TX_EN (0x1<<0) 5359#define XMAC_CTRL_REG_TX_EN (0x1<<0)
5360#define XMAC_PAUSE_CTRL_REG_RX_PAUSE_EN (0x1<<18) 5360#define XMAC_PAUSE_CTRL_REG_RX_PAUSE_EN (0x1<<18)
5361#define XMAC_PAUSE_CTRL_REG_TX_PAUSE_EN (0x1<<17) 5361#define XMAC_PAUSE_CTRL_REG_TX_PAUSE_EN (0x1<<17)
5362#define XMAC_PFC_CTRL_HI_REG_FORCE_PFC_XON (0x1<<1)
5362#define XMAC_PFC_CTRL_HI_REG_PFC_REFRESH_EN (0x1<<0) 5363#define XMAC_PFC_CTRL_HI_REG_PFC_REFRESH_EN (0x1<<0)
5363#define XMAC_PFC_CTRL_HI_REG_PFC_STATS_EN (0x1<<3) 5364#define XMAC_PFC_CTRL_HI_REG_PFC_STATS_EN (0x1<<3)
5364#define XMAC_PFC_CTRL_HI_REG_RX_PFC_EN (0x1<<4) 5365#define XMAC_PFC_CTRL_HI_REG_RX_PFC_EN (0x1<<4)
@@ -6825,10 +6826,13 @@ Theotherbitsarereservedandshouldbezero*/
6825 6826
6826#define MDIO_AN_REG_8481_10GBASE_T_AN_CTRL 0x0020 6827#define MDIO_AN_REG_8481_10GBASE_T_AN_CTRL 0x0020
6827#define MDIO_AN_REG_8481_LEGACY_MII_CTRL 0xffe0 6828#define MDIO_AN_REG_8481_LEGACY_MII_CTRL 0xffe0
6829#define MDIO_AN_REG_8481_MII_CTRL_FORCE_1G 0x40
6828#define MDIO_AN_REG_8481_LEGACY_MII_STATUS 0xffe1 6830#define MDIO_AN_REG_8481_LEGACY_MII_STATUS 0xffe1
6829#define MDIO_AN_REG_8481_LEGACY_AN_ADV 0xffe4 6831#define MDIO_AN_REG_8481_LEGACY_AN_ADV 0xffe4
6830#define MDIO_AN_REG_8481_LEGACY_AN_EXPANSION 0xffe6 6832#define MDIO_AN_REG_8481_LEGACY_AN_EXPANSION 0xffe6
6831#define MDIO_AN_REG_8481_1000T_CTRL 0xffe9 6833#define MDIO_AN_REG_8481_1000T_CTRL 0xffe9
6834#define MDIO_AN_REG_8481_1G_100T_EXT_CTRL 0xfff0
6835#define MIDO_AN_REG_8481_EXT_CTRL_FORCE_LEDS_OFF 0x0008
6832#define MDIO_AN_REG_8481_EXPANSION_REG_RD_RW 0xfff5 6836#define MDIO_AN_REG_8481_EXPANSION_REG_RD_RW 0xfff5
6833#define MDIO_AN_REG_8481_EXPANSION_REG_ACCESS 0xfff7 6837#define MDIO_AN_REG_8481_EXPANSION_REG_ACCESS 0xfff7
6834#define MDIO_AN_REG_8481_AUX_CTRL 0xfff8 6838#define MDIO_AN_REG_8481_AUX_CTRL 0xfff8
@@ -6948,6 +6952,10 @@ Theotherbitsarereservedandshouldbezero*/
6948#define MDIO_WC_REG_GP2_STATUS_GP_2_2 0x81d2 6952#define MDIO_WC_REG_GP2_STATUS_GP_2_2 0x81d2
6949#define MDIO_WC_REG_GP2_STATUS_GP_2_3 0x81d3 6953#define MDIO_WC_REG_GP2_STATUS_GP_2_3 0x81d3
6950#define MDIO_WC_REG_GP2_STATUS_GP_2_4 0x81d4 6954#define MDIO_WC_REG_GP2_STATUS_GP_2_4 0x81d4
6955#define MDIO_WC_REG_GP2_STATUS_GP_2_4_CL73_AN_CMPL 0x1000
6956#define MDIO_WC_REG_GP2_STATUS_GP_2_4_CL37_AN_CMPL 0x0100
6957#define MDIO_WC_REG_GP2_STATUS_GP_2_4_CL37_LP_AN_CAP 0x0010
6958#define MDIO_WC_REG_GP2_STATUS_GP_2_4_CL37_AN_CAP 0x1
6951#define MDIO_WC_REG_UC_INFO_B0_DEAD_TRAP 0x81EE 6959#define MDIO_WC_REG_UC_INFO_B0_DEAD_TRAP 0x81EE
6952#define MDIO_WC_REG_UC_INFO_B1_VERSION 0x81F0 6960#define MDIO_WC_REG_UC_INFO_B1_VERSION 0x81F0
6953#define MDIO_WC_REG_UC_INFO_B1_FIRMWARE_MODE 0x81F2 6961#define MDIO_WC_REG_UC_INFO_B1_FIRMWARE_MODE 0x81F2
diff --git a/drivers/net/ethernet/broadcom/tg3.c b/drivers/net/ethernet/broadcom/tg3.c
index 86097981e1e..0c3e7c70ffb 100644
--- a/drivers/net/ethernet/broadcom/tg3.c
+++ b/drivers/net/ethernet/broadcom/tg3.c
@@ -48,7 +48,6 @@
48#include <net/checksum.h> 48#include <net/checksum.h>
49#include <net/ip.h> 49#include <net/ip.h>
50 50
51#include <asm/system.h>
52#include <linux/io.h> 51#include <linux/io.h>
53#include <asm/byteorder.h> 52#include <asm/byteorder.h>
54#include <linux/uaccess.h> 53#include <linux/uaccess.h>
@@ -2779,7 +2778,9 @@ static void tg3_power_down_phy(struct tg3 *tp, bool do_low_power)
2779 if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5700 || 2778 if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5700 ||
2780 GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5704 || 2779 GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5704 ||
2781 (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5780 && 2780 (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5780 &&
2782 (tp->phy_flags & TG3_PHYFLG_MII_SERDES))) 2781 (tp->phy_flags & TG3_PHYFLG_MII_SERDES)) ||
2782 (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5717 &&
2783 !tp->pci_fn))
2783 return; 2784 return;
2784 2785
2785 if (GET_CHIP_REV(tp->pci_chip_rev_id) == CHIPREV_5784_AX || 2786 if (GET_CHIP_REV(tp->pci_chip_rev_id) == CHIPREV_5784_AX ||
diff --git a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c
index 05ff076af06..b126b98065a 100644
--- a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c
+++ b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c
@@ -2000,13 +2000,6 @@ static const struct ethtool_ops cxgb_ethtool_ops = {
2000/* 2000/*
2001 * debugfs support 2001 * debugfs support
2002 */ 2002 */
2003
2004static int mem_open(struct inode *inode, struct file *file)
2005{
2006 file->private_data = inode->i_private;
2007 return 0;
2008}
2009
2010static ssize_t mem_read(struct file *file, char __user *buf, size_t count, 2003static ssize_t mem_read(struct file *file, char __user *buf, size_t count,
2011 loff_t *ppos) 2004 loff_t *ppos)
2012{ 2005{
@@ -2050,7 +2043,7 @@ static ssize_t mem_read(struct file *file, char __user *buf, size_t count,
2050 2043
2051static const struct file_operations mem_debugfs_fops = { 2044static const struct file_operations mem_debugfs_fops = {
2052 .owner = THIS_MODULE, 2045 .owner = THIS_MODULE,
2053 .open = mem_open, 2046 .open = simple_open,
2054 .read = mem_read, 2047 .read = mem_read,
2055 .llseek = default_llseek, 2048 .llseek = default_llseek,
2056}; 2049};
diff --git a/drivers/net/ethernet/cirrus/cs89x0.c b/drivers/net/ethernet/cirrus/cs89x0.c
index 30fee428c48..b9406cbfc18 100644
--- a/drivers/net/ethernet/cirrus/cs89x0.c
+++ b/drivers/net/ethernet/cirrus/cs89x0.c
@@ -148,7 +148,6 @@
148#include <linux/delay.h> 148#include <linux/delay.h>
149#include <linux/gfp.h> 149#include <linux/gfp.h>
150 150
151#include <asm/system.h>
152#include <asm/io.h> 151#include <asm/io.h>
153#include <asm/irq.h> 152#include <asm/irq.h>
154#include <linux/atomic.h> 153#include <linux/atomic.h>
diff --git a/drivers/net/ethernet/cirrus/mac89x0.c b/drivers/net/ethernet/cirrus/mac89x0.c
index 932fdccc339..e285f384b09 100644
--- a/drivers/net/ethernet/cirrus/mac89x0.c
+++ b/drivers/net/ethernet/cirrus/mac89x0.c
@@ -99,7 +99,6 @@ static char *version =
99#include <linux/bitops.h> 99#include <linux/bitops.h>
100#include <linux/gfp.h> 100#include <linux/gfp.h>
101 101
102#include <asm/system.h>
103#include <asm/io.h> 102#include <asm/io.h>
104#include <asm/hwtest.h> 103#include <asm/hwtest.h>
105#include <asm/macints.h> 104#include <asm/macints.h>
diff --git a/drivers/net/ethernet/dlink/de600.c b/drivers/net/ethernet/dlink/de600.c
index 682750c052c..414f0eea104 100644
--- a/drivers/net/ethernet/dlink/de600.c
+++ b/drivers/net/ethernet/dlink/de600.c
@@ -46,7 +46,6 @@ static const char version[] = "de600.c: $Revision: 1.41-2.5 $, Bjorn Ekwall (bj
46#include <linux/interrupt.h> 46#include <linux/interrupt.h>
47#include <linux/ioport.h> 47#include <linux/ioport.h>
48#include <linux/in.h> 48#include <linux/in.h>
49#include <asm/system.h>
50#include <linux/errno.h> 49#include <linux/errno.h>
51#include <linux/init.h> 50#include <linux/init.h>
52#include <linux/delay.h> 51#include <linux/delay.h>
diff --git a/drivers/net/ethernet/dlink/de620.c b/drivers/net/ethernet/dlink/de620.c
index afc5aaac6b6..2e2bc60ee81 100644
--- a/drivers/net/ethernet/dlink/de620.c
+++ b/drivers/net/ethernet/dlink/de620.c
@@ -122,7 +122,6 @@ static const char version[] =
122#include <linux/skbuff.h> 122#include <linux/skbuff.h>
123 123
124#include <asm/io.h> 124#include <asm/io.h>
125#include <asm/system.h>
126 125
127/* Constant definitions for the DE-620 registers, commands and bits */ 126/* Constant definitions for the DE-620 registers, commands and bits */
128#include "de620.h" 127#include "de620.h"
diff --git a/drivers/net/ethernet/freescale/ucc_geth.c b/drivers/net/ethernet/freescale/ucc_geth.c
index 4e3cd2f8deb..17a46e76123 100644
--- a/drivers/net/ethernet/freescale/ucc_geth.c
+++ b/drivers/net/ethernet/freescale/ucc_geth.c
@@ -3945,6 +3945,8 @@ static int ucc_geth_probe(struct platform_device* ofdev)
3945 } 3945 }
3946 3946
3947 if (max_speed == SPEED_1000) { 3947 if (max_speed == SPEED_1000) {
3948 unsigned int snums = qe_get_num_of_snums();
3949
3948 /* configure muram FIFOs for gigabit operation */ 3950 /* configure muram FIFOs for gigabit operation */
3949 ug_info->uf_info.urfs = UCC_GETH_URFS_GIGA_INIT; 3951 ug_info->uf_info.urfs = UCC_GETH_URFS_GIGA_INIT;
3950 ug_info->uf_info.urfet = UCC_GETH_URFET_GIGA_INIT; 3952 ug_info->uf_info.urfet = UCC_GETH_URFET_GIGA_INIT;
@@ -3954,11 +3956,11 @@ static int ucc_geth_probe(struct platform_device* ofdev)
3954 ug_info->uf_info.utftt = UCC_GETH_UTFTT_GIGA_INIT; 3956 ug_info->uf_info.utftt = UCC_GETH_UTFTT_GIGA_INIT;
3955 ug_info->numThreadsTx = UCC_GETH_NUM_OF_THREADS_4; 3957 ug_info->numThreadsTx = UCC_GETH_NUM_OF_THREADS_4;
3956 3958
3957 /* If QE's snum number is 46 which means we need to support 3959 /* If QE's snum number is 46/76 which means we need to support
3958 * 4 UECs at 1000Base-T simultaneously, we need to allocate 3960 * 4 UECs at 1000Base-T simultaneously, we need to allocate
3959 * more Threads to Rx. 3961 * more Threads to Rx.
3960 */ 3962 */
3961 if (qe_get_num_of_snums() == 46) 3963 if ((snums == 76) || (snums == 46))
3962 ug_info->numThreadsRx = UCC_GETH_NUM_OF_THREADS_6; 3964 ug_info->numThreadsRx = UCC_GETH_NUM_OF_THREADS_6;
3963 else 3965 else
3964 ug_info->numThreadsRx = UCC_GETH_NUM_OF_THREADS_4; 3966 ug_info->numThreadsRx = UCC_GETH_NUM_OF_THREADS_4;
diff --git a/drivers/net/ethernet/fujitsu/at1700.c b/drivers/net/ethernet/fujitsu/at1700.c
index 586b46fd4ee..3d94797c8f9 100644
--- a/drivers/net/ethernet/fujitsu/at1700.c
+++ b/drivers/net/ethernet/fujitsu/at1700.c
@@ -52,7 +52,6 @@
52#include <linux/crc32.h> 52#include <linux/crc32.h>
53#include <linux/bitops.h> 53#include <linux/bitops.h>
54 54
55#include <asm/system.h>
56#include <asm/io.h> 55#include <asm/io.h>
57#include <asm/dma.h> 56#include <asm/dma.h>
58 57
diff --git a/drivers/net/ethernet/fujitsu/eth16i.c b/drivers/net/ethernet/fujitsu/eth16i.c
index c3f0178fb5c..a992d1f7e0d 100644
--- a/drivers/net/ethernet/fujitsu/eth16i.c
+++ b/drivers/net/ethernet/fujitsu/eth16i.c
@@ -163,7 +163,6 @@ static char *version =
163#include <linux/jiffies.h> 163#include <linux/jiffies.h>
164#include <linux/io.h> 164#include <linux/io.h>
165 165
166#include <asm/system.h>
167#include <asm/dma.h> 166#include <asm/dma.h>
168 167
169 168
diff --git a/drivers/net/ethernet/fujitsu/fmvj18x_cs.c b/drivers/net/ethernet/fujitsu/fmvj18x_cs.c
index 0230319ddb5..2418faf2251 100644
--- a/drivers/net/ethernet/fujitsu/fmvj18x_cs.c
+++ b/drivers/net/ethernet/fujitsu/fmvj18x_cs.c
@@ -57,7 +57,6 @@
57 57
58#include <asm/uaccess.h> 58#include <asm/uaccess.h>
59#include <asm/io.h> 59#include <asm/io.h>
60#include <asm/system.h>
61 60
62/*====================================================================*/ 61/*====================================================================*/
63 62
diff --git a/drivers/net/ethernet/i825xx/3c507.c b/drivers/net/ethernet/i825xx/3c507.c
index ed6925f1147..e8984b05990 100644
--- a/drivers/net/ethernet/i825xx/3c507.c
+++ b/drivers/net/ethernet/i825xx/3c507.c
@@ -63,7 +63,6 @@ static const char version[] =
63 63
64#include <asm/dma.h> 64#include <asm/dma.h>
65#include <asm/io.h> 65#include <asm/io.h>
66#include <asm/system.h>
67#include <asm/uaccess.h> 66#include <asm/uaccess.h>
68 67
69/* use 0 for production, 1 for verification, 2..7 for debug */ 68/* use 0 for production, 1 for verification, 2..7 for debug */
diff --git a/drivers/net/ethernet/i825xx/3c527.c b/drivers/net/ethernet/i825xx/3c527.c
index ef43f3e951c..278e791afe0 100644
--- a/drivers/net/ethernet/i825xx/3c527.c
+++ b/drivers/net/ethernet/i825xx/3c527.c
@@ -106,7 +106,6 @@ DRV_NAME ".c:v" DRV_VERSION " " DRV_RELDATE " Richard Procter <rnp@paradise.net.
106#include <linux/semaphore.h> 106#include <linux/semaphore.h>
107 107
108#include <asm/uaccess.h> 108#include <asm/uaccess.h>
109#include <asm/system.h>
110#include <asm/io.h> 109#include <asm/io.h>
111#include <asm/dma.h> 110#include <asm/dma.h>
112 111
diff --git a/drivers/net/ethernet/i825xx/eepro.c b/drivers/net/ethernet/i825xx/eepro.c
index 7a4ad4a0791..7f49fd54c52 100644
--- a/drivers/net/ethernet/i825xx/eepro.c
+++ b/drivers/net/ethernet/i825xx/eepro.c
@@ -148,7 +148,6 @@ static const char version[] =
148#include <linux/bitops.h> 148#include <linux/bitops.h>
149#include <linux/ethtool.h> 149#include <linux/ethtool.h>
150 150
151#include <asm/system.h>
152#include <asm/io.h> 151#include <asm/io.h>
153#include <asm/dma.h> 152#include <asm/dma.h>
154 153
diff --git a/drivers/net/ethernet/i825xx/eexpress.c b/drivers/net/ethernet/i825xx/eexpress.c
index 3fc649e54a3..cc2e66ad443 100644
--- a/drivers/net/ethernet/i825xx/eexpress.c
+++ b/drivers/net/ethernet/i825xx/eexpress.c
@@ -116,7 +116,6 @@
116#include <linux/bitops.h> 116#include <linux/bitops.h>
117#include <linux/jiffies.h> 117#include <linux/jiffies.h>
118 118
119#include <asm/system.h>
120#include <asm/io.h> 119#include <asm/io.h>
121#include <asm/irq.h> 120#include <asm/irq.h>
122 121
diff --git a/drivers/net/ethernet/i825xx/ether1.c b/drivers/net/ethernet/i825xx/ether1.c
index 406a12b4640..067db3f13e9 100644
--- a/drivers/net/ethernet/i825xx/ether1.c
+++ b/drivers/net/ethernet/i825xx/ether1.c
@@ -48,7 +48,6 @@
48#include <linux/skbuff.h> 48#include <linux/skbuff.h>
49#include <linux/bitops.h> 49#include <linux/bitops.h>
50 50
51#include <asm/system.h>
52#include <asm/io.h> 51#include <asm/io.h>
53#include <asm/dma.h> 52#include <asm/dma.h>
54#include <asm/ecard.h> 53#include <asm/ecard.h>
diff --git a/drivers/net/ethernet/i825xx/znet.c b/drivers/net/ethernet/i825xx/znet.c
index a43649735a0..bd1f1ef91e1 100644
--- a/drivers/net/ethernet/i825xx/znet.c
+++ b/drivers/net/ethernet/i825xx/znet.c
@@ -100,7 +100,6 @@
100#include <linux/if_arp.h> 100#include <linux/if_arp.h>
101#include <linux/bitops.h> 101#include <linux/bitops.h>
102 102
103#include <asm/system.h>
104#include <asm/io.h> 103#include <asm/io.h>
105#include <asm/dma.h> 104#include <asm/dma.h>
106 105
diff --git a/drivers/net/ethernet/ibm/ibmveth.c b/drivers/net/ethernet/ibm/ibmveth.c
index e877371680a..9010cea68bc 100644
--- a/drivers/net/ethernet/ibm/ibmveth.c
+++ b/drivers/net/ethernet/ibm/ibmveth.c
@@ -1616,11 +1616,8 @@ static struct vio_driver ibmveth_driver = {
1616 .probe = ibmveth_probe, 1616 .probe = ibmveth_probe,
1617 .remove = ibmveth_remove, 1617 .remove = ibmveth_remove,
1618 .get_desired_dma = ibmveth_get_desired_dma, 1618 .get_desired_dma = ibmveth_get_desired_dma,
1619 .driver = { 1619 .name = ibmveth_driver_name,
1620 .name = ibmveth_driver_name, 1620 .pm = &ibmveth_pm_ops,
1621 .owner = THIS_MODULE,
1622 .pm = &ibmveth_pm_ops,
1623 }
1624}; 1621};
1625 1622
1626static int __init ibmveth_module_init(void) 1623static int __init ibmveth_module_init(void)
diff --git a/drivers/net/ethernet/intel/e1000e/e1000.h b/drivers/net/ethernet/intel/e1000e/e1000.h
index 86cdd479399..b83897f76ee 100644
--- a/drivers/net/ethernet/intel/e1000e/e1000.h
+++ b/drivers/net/ethernet/intel/e1000e/e1000.h
@@ -161,6 +161,12 @@ struct e1000_info;
161/* Time to wait before putting the device into D3 if there's no link (in ms). */ 161/* Time to wait before putting the device into D3 if there's no link (in ms). */
162#define LINK_TIMEOUT 100 162#define LINK_TIMEOUT 100
163 163
164/*
165 * Count for polling __E1000_RESET condition every 10-20msec.
166 * Experimentation has shown the reset can take approximately 210msec.
167 */
168#define E1000_CHECK_RESET_COUNT 25
169
164#define DEFAULT_RDTR 0 170#define DEFAULT_RDTR 0
165#define DEFAULT_RADV 8 171#define DEFAULT_RADV 8
166#define BURST_RDTR 0x20 172#define BURST_RDTR 0x20
diff --git a/drivers/net/ethernet/intel/e1000e/netdev.c b/drivers/net/ethernet/intel/e1000e/netdev.c
index f88dac614de..851f7937db2 100644
--- a/drivers/net/ethernet/intel/e1000e/netdev.c
+++ b/drivers/net/ethernet/intel/e1000e/netdev.c
@@ -1060,6 +1060,13 @@ static void e1000_print_hw_hang(struct work_struct *work)
1060 ew32(TIDV, adapter->tx_int_delay | E1000_TIDV_FPD); 1060 ew32(TIDV, adapter->tx_int_delay | E1000_TIDV_FPD);
1061 /* execute the writes immediately */ 1061 /* execute the writes immediately */
1062 e1e_flush(); 1062 e1e_flush();
1063 /*
1064 * Due to rare timing issues, write to TIDV again to ensure
1065 * the write is successful
1066 */
1067 ew32(TIDV, adapter->tx_int_delay | E1000_TIDV_FPD);
1068 /* execute the writes immediately */
1069 e1e_flush();
1063 adapter->tx_hang_recheck = true; 1070 adapter->tx_hang_recheck = true;
1064 return; 1071 return;
1065 } 1072 }
@@ -3615,6 +3622,16 @@ static void e1000e_flush_descriptors(struct e1000_adapter *adapter)
3615 3622
3616 /* execute the writes immediately */ 3623 /* execute the writes immediately */
3617 e1e_flush(); 3624 e1e_flush();
3625
3626 /*
3627 * due to rare timing issues, write to TIDV/RDTR again to ensure the
3628 * write is successful
3629 */
3630 ew32(TIDV, adapter->tx_int_delay | E1000_TIDV_FPD);
3631 ew32(RDTR, adapter->rx_int_delay | E1000_RDTR_FPD);
3632
3633 /* execute the writes immediately */
3634 e1e_flush();
3618} 3635}
3619 3636
3620static void e1000e_update_stats(struct e1000_adapter *adapter); 3637static void e1000e_update_stats(struct e1000_adapter *adapter);
@@ -3967,6 +3984,10 @@ static int e1000_close(struct net_device *netdev)
3967{ 3984{
3968 struct e1000_adapter *adapter = netdev_priv(netdev); 3985 struct e1000_adapter *adapter = netdev_priv(netdev);
3969 struct pci_dev *pdev = adapter->pdev; 3986 struct pci_dev *pdev = adapter->pdev;
3987 int count = E1000_CHECK_RESET_COUNT;
3988
3989 while (test_bit(__E1000_RESETTING, &adapter->state) && count--)
3990 usleep_range(10000, 20000);
3970 3991
3971 WARN_ON(test_bit(__E1000_RESETTING, &adapter->state)); 3992 WARN_ON(test_bit(__E1000_RESETTING, &adapter->state));
3972 3993
@@ -5471,6 +5492,11 @@ static int __e1000_shutdown(struct pci_dev *pdev, bool *enable_wake,
5471 netif_device_detach(netdev); 5492 netif_device_detach(netdev);
5472 5493
5473 if (netif_running(netdev)) { 5494 if (netif_running(netdev)) {
5495 int count = E1000_CHECK_RESET_COUNT;
5496
5497 while (test_bit(__E1000_RESETTING, &adapter->state) && count--)
5498 usleep_range(10000, 20000);
5499
5474 WARN_ON(test_bit(__E1000_RESETTING, &adapter->state)); 5500 WARN_ON(test_bit(__E1000_RESETTING, &adapter->state));
5475 e1000e_down(adapter); 5501 e1000e_down(adapter);
5476 e1000_free_irq(adapter); 5502 e1000_free_irq(adapter);
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_dcb_nl.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_dcb_nl.c
index dde65f95140..652e4b09546 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_dcb_nl.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_dcb_nl.c
@@ -44,62 +44,94 @@
44#define DCB_NO_HW_CHG 1 /* DCB configuration did not change */ 44#define DCB_NO_HW_CHG 1 /* DCB configuration did not change */
45#define DCB_HW_CHG 2 /* DCB configuration changed, no reset */ 45#define DCB_HW_CHG 2 /* DCB configuration changed, no reset */
46 46
47int ixgbe_copy_dcb_cfg(struct ixgbe_dcb_config *src_dcb_cfg, 47int ixgbe_copy_dcb_cfg(struct ixgbe_dcb_config *scfg,
48 struct ixgbe_dcb_config *dst_dcb_cfg, int tc_max) 48 struct ixgbe_dcb_config *dcfg, int tc_max)
49{ 49{
50 struct tc_configuration *src_tc_cfg = NULL; 50 struct tc_configuration *src = NULL;
51 struct tc_configuration *dst_tc_cfg = NULL; 51 struct tc_configuration *dst = NULL;
52 int i; 52 int i, j;
53 int tx = DCB_TX_CONFIG;
54 int rx = DCB_RX_CONFIG;
55 int changes = 0;
53 56
54 if (!src_dcb_cfg || !dst_dcb_cfg) 57 if (!scfg || !dcfg)
55 return -EINVAL; 58 return changes;
56 59
57 for (i = DCB_PG_ATTR_TC_0; i < tc_max + DCB_PG_ATTR_TC_0; i++) { 60 for (i = DCB_PG_ATTR_TC_0; i < tc_max + DCB_PG_ATTR_TC_0; i++) {
58 src_tc_cfg = &src_dcb_cfg->tc_config[i - DCB_PG_ATTR_TC_0]; 61 src = &scfg->tc_config[i - DCB_PG_ATTR_TC_0];
59 dst_tc_cfg = &dst_dcb_cfg->tc_config[i - DCB_PG_ATTR_TC_0]; 62 dst = &dcfg->tc_config[i - DCB_PG_ATTR_TC_0];
60 63
61 dst_tc_cfg->path[DCB_TX_CONFIG].prio_type = 64 if (dst->path[tx].prio_type != src->path[tx].prio_type) {
62 src_tc_cfg->path[DCB_TX_CONFIG].prio_type; 65 dst->path[tx].prio_type = src->path[tx].prio_type;
66 changes |= BIT_PG_TX;
67 }
63 68
64 dst_tc_cfg->path[DCB_TX_CONFIG].bwg_id = 69 if (dst->path[tx].bwg_id != src->path[tx].bwg_id) {
65 src_tc_cfg->path[DCB_TX_CONFIG].bwg_id; 70 dst->path[tx].bwg_id = src->path[tx].bwg_id;
71 changes |= BIT_PG_TX;
72 }
66 73
67 dst_tc_cfg->path[DCB_TX_CONFIG].bwg_percent = 74 if (dst->path[tx].bwg_percent != src->path[tx].bwg_percent) {
68 src_tc_cfg->path[DCB_TX_CONFIG].bwg_percent; 75 dst->path[tx].bwg_percent = src->path[tx].bwg_percent;
76 changes |= BIT_PG_TX;
77 }
69 78
70 dst_tc_cfg->path[DCB_TX_CONFIG].up_to_tc_bitmap = 79 if (dst->path[tx].up_to_tc_bitmap !=
71 src_tc_cfg->path[DCB_TX_CONFIG].up_to_tc_bitmap; 80 src->path[tx].up_to_tc_bitmap) {
81 dst->path[tx].up_to_tc_bitmap =
82 src->path[tx].up_to_tc_bitmap;
83 changes |= (BIT_PG_TX | BIT_PFC | BIT_APP_UPCHG);
84 }
72 85
73 dst_tc_cfg->path[DCB_RX_CONFIG].prio_type = 86 if (dst->path[rx].prio_type != src->path[rx].prio_type) {
74 src_tc_cfg->path[DCB_RX_CONFIG].prio_type; 87 dst->path[rx].prio_type = src->path[rx].prio_type;
88 changes |= BIT_PG_RX;
89 }
75 90
76 dst_tc_cfg->path[DCB_RX_CONFIG].bwg_id = 91 if (dst->path[rx].bwg_id != src->path[rx].bwg_id) {
77 src_tc_cfg->path[DCB_RX_CONFIG].bwg_id; 92 dst->path[rx].bwg_id = src->path[rx].bwg_id;
93 changes |= BIT_PG_RX;
94 }
78 95
79 dst_tc_cfg->path[DCB_RX_CONFIG].bwg_percent = 96 if (dst->path[rx].bwg_percent != src->path[rx].bwg_percent) {
80 src_tc_cfg->path[DCB_RX_CONFIG].bwg_percent; 97 dst->path[rx].bwg_percent = src->path[rx].bwg_percent;
98 changes |= BIT_PG_RX;
99 }
81 100
82 dst_tc_cfg->path[DCB_RX_CONFIG].up_to_tc_bitmap = 101 if (dst->path[rx].up_to_tc_bitmap !=
83 src_tc_cfg->path[DCB_RX_CONFIG].up_to_tc_bitmap; 102 src->path[rx].up_to_tc_bitmap) {
103 dst->path[rx].up_to_tc_bitmap =
104 src->path[rx].up_to_tc_bitmap;
105 changes |= (BIT_PG_RX | BIT_PFC | BIT_APP_UPCHG);
106 }
84 } 107 }
85 108
86 for (i = DCB_PG_ATTR_BW_ID_0; i < DCB_PG_ATTR_BW_ID_MAX; i++) { 109 for (i = DCB_PG_ATTR_BW_ID_0; i < DCB_PG_ATTR_BW_ID_MAX; i++) {
87 dst_dcb_cfg->bw_percentage[DCB_TX_CONFIG] 110 j = i - DCB_PG_ATTR_BW_ID_0;
88 [i-DCB_PG_ATTR_BW_ID_0] = src_dcb_cfg->bw_percentage 111 if (dcfg->bw_percentage[tx][j] != scfg->bw_percentage[tx][j]) {
89 [DCB_TX_CONFIG][i-DCB_PG_ATTR_BW_ID_0]; 112 dcfg->bw_percentage[tx][j] = scfg->bw_percentage[tx][j];
90 dst_dcb_cfg->bw_percentage[DCB_RX_CONFIG] 113 changes |= BIT_PG_TX;
91 [i-DCB_PG_ATTR_BW_ID_0] = src_dcb_cfg->bw_percentage 114 }
92 [DCB_RX_CONFIG][i-DCB_PG_ATTR_BW_ID_0]; 115 if (dcfg->bw_percentage[rx][j] != scfg->bw_percentage[rx][j]) {
116 dcfg->bw_percentage[rx][j] = scfg->bw_percentage[rx][j];
117 changes |= BIT_PG_RX;
118 }
93 } 119 }
94 120
95 for (i = DCB_PFC_UP_ATTR_0; i < DCB_PFC_UP_ATTR_MAX; i++) { 121 for (i = DCB_PFC_UP_ATTR_0; i < DCB_PFC_UP_ATTR_MAX; i++) {
96 dst_dcb_cfg->tc_config[i - DCB_PFC_UP_ATTR_0].dcb_pfc = 122 j = i - DCB_PFC_UP_ATTR_0;
97 src_dcb_cfg->tc_config[i - DCB_PFC_UP_ATTR_0].dcb_pfc; 123 if (dcfg->tc_config[j].dcb_pfc != scfg->tc_config[j].dcb_pfc) {
124 dcfg->tc_config[j].dcb_pfc = scfg->tc_config[j].dcb_pfc;
125 changes |= BIT_PFC;
126 }
98 } 127 }
99 128
100 dst_dcb_cfg->pfc_mode_enable = src_dcb_cfg->pfc_mode_enable; 129 if (dcfg->pfc_mode_enable != scfg->pfc_mode_enable) {
130 dcfg->pfc_mode_enable = scfg->pfc_mode_enable;
131 changes |= BIT_PFC;
132 }
101 133
102 return 0; 134 return changes;
103} 135}
104 136
105static u8 ixgbe_dcbnl_get_state(struct net_device *netdev) 137static u8 ixgbe_dcbnl_get_state(struct net_device *netdev)
@@ -179,20 +211,6 @@ static void ixgbe_dcbnl_set_pg_tc_cfg_tx(struct net_device *netdev, int tc,
179 if (up_map != DCB_ATTR_VALUE_UNDEFINED) 211 if (up_map != DCB_ATTR_VALUE_UNDEFINED)
180 adapter->temp_dcb_cfg.tc_config[tc].path[0].up_to_tc_bitmap = 212 adapter->temp_dcb_cfg.tc_config[tc].path[0].up_to_tc_bitmap =
181 up_map; 213 up_map;
182
183 if ((adapter->temp_dcb_cfg.tc_config[tc].path[0].prio_type !=
184 adapter->dcb_cfg.tc_config[tc].path[0].prio_type) ||
185 (adapter->temp_dcb_cfg.tc_config[tc].path[0].bwg_id !=
186 adapter->dcb_cfg.tc_config[tc].path[0].bwg_id) ||
187 (adapter->temp_dcb_cfg.tc_config[tc].path[0].bwg_percent !=
188 adapter->dcb_cfg.tc_config[tc].path[0].bwg_percent) ||
189 (adapter->temp_dcb_cfg.tc_config[tc].path[0].up_to_tc_bitmap !=
190 adapter->dcb_cfg.tc_config[tc].path[0].up_to_tc_bitmap))
191 adapter->dcb_set_bitmap |= BIT_PG_TX;
192
193 if (adapter->temp_dcb_cfg.tc_config[tc].path[0].up_to_tc_bitmap !=
194 adapter->dcb_cfg.tc_config[tc].path[0].up_to_tc_bitmap)
195 adapter->dcb_set_bitmap |= BIT_PFC | BIT_APP_UPCHG;
196} 214}
197 215
198static void ixgbe_dcbnl_set_pg_bwg_cfg_tx(struct net_device *netdev, int bwg_id, 216static void ixgbe_dcbnl_set_pg_bwg_cfg_tx(struct net_device *netdev, int bwg_id,
@@ -201,10 +219,6 @@ static void ixgbe_dcbnl_set_pg_bwg_cfg_tx(struct net_device *netdev, int bwg_id,
201 struct ixgbe_adapter *adapter = netdev_priv(netdev); 219 struct ixgbe_adapter *adapter = netdev_priv(netdev);
202 220
203 adapter->temp_dcb_cfg.bw_percentage[0][bwg_id] = bw_pct; 221 adapter->temp_dcb_cfg.bw_percentage[0][bwg_id] = bw_pct;
204
205 if (adapter->temp_dcb_cfg.bw_percentage[0][bwg_id] !=
206 adapter->dcb_cfg.bw_percentage[0][bwg_id])
207 adapter->dcb_set_bitmap |= BIT_PG_TX;
208} 222}
209 223
210static void ixgbe_dcbnl_set_pg_tc_cfg_rx(struct net_device *netdev, int tc, 224static void ixgbe_dcbnl_set_pg_tc_cfg_rx(struct net_device *netdev, int tc,
@@ -223,20 +237,6 @@ static void ixgbe_dcbnl_set_pg_tc_cfg_rx(struct net_device *netdev, int tc,
223 if (up_map != DCB_ATTR_VALUE_UNDEFINED) 237 if (up_map != DCB_ATTR_VALUE_UNDEFINED)
224 adapter->temp_dcb_cfg.tc_config[tc].path[1].up_to_tc_bitmap = 238 adapter->temp_dcb_cfg.tc_config[tc].path[1].up_to_tc_bitmap =
225 up_map; 239 up_map;
226
227 if ((adapter->temp_dcb_cfg.tc_config[tc].path[1].prio_type !=
228 adapter->dcb_cfg.tc_config[tc].path[1].prio_type) ||
229 (adapter->temp_dcb_cfg.tc_config[tc].path[1].bwg_id !=
230 adapter->dcb_cfg.tc_config[tc].path[1].bwg_id) ||
231 (adapter->temp_dcb_cfg.tc_config[tc].path[1].bwg_percent !=
232 adapter->dcb_cfg.tc_config[tc].path[1].bwg_percent) ||
233 (adapter->temp_dcb_cfg.tc_config[tc].path[1].up_to_tc_bitmap !=
234 adapter->dcb_cfg.tc_config[tc].path[1].up_to_tc_bitmap))
235 adapter->dcb_set_bitmap |= BIT_PG_RX;
236
237 if (adapter->temp_dcb_cfg.tc_config[tc].path[1].up_to_tc_bitmap !=
238 adapter->dcb_cfg.tc_config[tc].path[1].up_to_tc_bitmap)
239 adapter->dcb_set_bitmap |= BIT_PFC;
240} 240}
241 241
242static void ixgbe_dcbnl_set_pg_bwg_cfg_rx(struct net_device *netdev, int bwg_id, 242static void ixgbe_dcbnl_set_pg_bwg_cfg_rx(struct net_device *netdev, int bwg_id,
@@ -245,10 +245,6 @@ static void ixgbe_dcbnl_set_pg_bwg_cfg_rx(struct net_device *netdev, int bwg_id,
245 struct ixgbe_adapter *adapter = netdev_priv(netdev); 245 struct ixgbe_adapter *adapter = netdev_priv(netdev);
246 246
247 adapter->temp_dcb_cfg.bw_percentage[1][bwg_id] = bw_pct; 247 adapter->temp_dcb_cfg.bw_percentage[1][bwg_id] = bw_pct;
248
249 if (adapter->temp_dcb_cfg.bw_percentage[1][bwg_id] !=
250 adapter->dcb_cfg.bw_percentage[1][bwg_id])
251 adapter->dcb_set_bitmap |= BIT_PG_RX;
252} 248}
253 249
254static void ixgbe_dcbnl_get_pg_tc_cfg_tx(struct net_device *netdev, int tc, 250static void ixgbe_dcbnl_get_pg_tc_cfg_tx(struct net_device *netdev, int tc,
@@ -298,10 +294,8 @@ static void ixgbe_dcbnl_set_pfc_cfg(struct net_device *netdev, int priority,
298 294
299 adapter->temp_dcb_cfg.tc_config[priority].dcb_pfc = setting; 295 adapter->temp_dcb_cfg.tc_config[priority].dcb_pfc = setting;
300 if (adapter->temp_dcb_cfg.tc_config[priority].dcb_pfc != 296 if (adapter->temp_dcb_cfg.tc_config[priority].dcb_pfc !=
301 adapter->dcb_cfg.tc_config[priority].dcb_pfc) { 297 adapter->dcb_cfg.tc_config[priority].dcb_pfc)
302 adapter->dcb_set_bitmap |= BIT_PFC;
303 adapter->temp_dcb_cfg.pfc_mode_enable = true; 298 adapter->temp_dcb_cfg.pfc_mode_enable = true;
304 }
305} 299}
306 300
307static void ixgbe_dcbnl_get_pfc_cfg(struct net_device *netdev, int priority, 301static void ixgbe_dcbnl_get_pfc_cfg(struct net_device *netdev, int priority,
@@ -336,7 +330,8 @@ static void ixgbe_dcbnl_devreset(struct net_device *dev)
336static u8 ixgbe_dcbnl_set_all(struct net_device *netdev) 330static u8 ixgbe_dcbnl_set_all(struct net_device *netdev)
337{ 331{
338 struct ixgbe_adapter *adapter = netdev_priv(netdev); 332 struct ixgbe_adapter *adapter = netdev_priv(netdev);
339 int ret, i; 333 int ret = DCB_NO_HW_CHG;
334 int i;
340#ifdef IXGBE_FCOE 335#ifdef IXGBE_FCOE
341 struct dcb_app app = { 336 struct dcb_app app = {
342 .selector = DCB_APP_IDTYPE_ETHTYPE, 337 .selector = DCB_APP_IDTYPE_ETHTYPE,
@@ -355,12 +350,13 @@ static u8 ixgbe_dcbnl_set_all(struct net_device *netdev)
355 350
356 /* Fail command if not in CEE mode */ 351 /* Fail command if not in CEE mode */
357 if (!(adapter->dcbx_cap & DCB_CAP_DCBX_VER_CEE)) 352 if (!(adapter->dcbx_cap & DCB_CAP_DCBX_VER_CEE))
358 return 1; 353 return ret;
359 354
360 ret = ixgbe_copy_dcb_cfg(&adapter->temp_dcb_cfg, &adapter->dcb_cfg, 355 adapter->dcb_set_bitmap |= ixgbe_copy_dcb_cfg(&adapter->temp_dcb_cfg,
361 MAX_TRAFFIC_CLASS); 356 &adapter->dcb_cfg,
362 if (ret) 357 MAX_TRAFFIC_CLASS);
363 return DCB_NO_HW_CHG; 358 if (!adapter->dcb_set_bitmap)
359 return ret;
364 360
365 if (adapter->dcb_cfg.pfc_mode_enable) { 361 if (adapter->dcb_cfg.pfc_mode_enable) {
366 switch (adapter->hw.mac.type) { 362 switch (adapter->hw.mac.type) {
@@ -420,6 +416,8 @@ static u8 ixgbe_dcbnl_set_all(struct net_device *netdev)
420 416
421 for (i = 0; i < IEEE_8021QAZ_MAX_TCS; i++) 417 for (i = 0; i < IEEE_8021QAZ_MAX_TCS; i++)
422 netdev_set_prio_tc_map(netdev, i, prio_tc[i]); 418 netdev_set_prio_tc_map(netdev, i, prio_tc[i]);
419
420 ret = DCB_HW_CHG_RST;
423 } 421 }
424 422
425 if (adapter->dcb_set_bitmap & BIT_PFC) { 423 if (adapter->dcb_set_bitmap & BIT_PFC) {
@@ -430,7 +428,8 @@ static u8 ixgbe_dcbnl_set_all(struct net_device *netdev)
430 DCB_TX_CONFIG, prio_tc); 428 DCB_TX_CONFIG, prio_tc);
431 ixgbe_dcb_unpack_pfc(&adapter->dcb_cfg, &pfc_en); 429 ixgbe_dcb_unpack_pfc(&adapter->dcb_cfg, &pfc_en);
432 ixgbe_dcb_hw_pfc_config(&adapter->hw, pfc_en, prio_tc); 430 ixgbe_dcb_hw_pfc_config(&adapter->hw, pfc_en, prio_tc);
433 ret = DCB_HW_CHG; 431 if (ret != DCB_HW_CHG_RST)
432 ret = DCB_HW_CHG;
434 } 433 }
435 434
436 if (adapter->dcb_cfg.pfc_mode_enable) 435 if (adapter->dcb_cfg.pfc_mode_enable)
@@ -531,9 +530,6 @@ static void ixgbe_dcbnl_setpfcstate(struct net_device *netdev, u8 state)
531 struct ixgbe_adapter *adapter = netdev_priv(netdev); 530 struct ixgbe_adapter *adapter = netdev_priv(netdev);
532 531
533 adapter->temp_dcb_cfg.pfc_mode_enable = state; 532 adapter->temp_dcb_cfg.pfc_mode_enable = state;
534 if (adapter->temp_dcb_cfg.pfc_mode_enable !=
535 adapter->dcb_cfg.pfc_mode_enable)
536 adapter->dcb_set_bitmap |= BIT_PFC;
537} 533}
538 534
539/** 535/**
diff --git a/drivers/net/ethernet/korina.c b/drivers/net/ethernet/korina.c
index f30db1c4660..bc58f1dc22f 100644
--- a/drivers/net/ethernet/korina.c
+++ b/drivers/net/ethernet/korina.c
@@ -55,7 +55,6 @@
55#include <linux/crc32.h> 55#include <linux/crc32.h>
56 56
57#include <asm/bootinfo.h> 57#include <asm/bootinfo.h>
58#include <asm/system.h>
59#include <asm/bitops.h> 58#include <asm/bitops.h>
60#include <asm/pgtable.h> 59#include <asm/pgtable.h>
61#include <asm/io.h> 60#include <asm/io.h>
diff --git a/drivers/net/ethernet/marvell/mv643xx_eth.c b/drivers/net/ethernet/marvell/mv643xx_eth.c
index 153d33210e8..c8950da60e6 100644
--- a/drivers/net/ethernet/marvell/mv643xx_eth.c
+++ b/drivers/net/ethernet/marvell/mv643xx_eth.c
@@ -57,7 +57,6 @@
57#include <linux/types.h> 57#include <linux/types.h>
58#include <linux/inet_lro.h> 58#include <linux/inet_lro.h>
59#include <linux/slab.h> 59#include <linux/slab.h>
60#include <asm/system.h>
61 60
62static char mv643xx_eth_driver_name[] = "mv643xx_eth"; 61static char mv643xx_eth_driver_name[] = "mv643xx_eth";
63static char mv643xx_eth_driver_version[] = "1.4"; 62static char mv643xx_eth_driver_version[] = "1.4";
diff --git a/drivers/net/ethernet/marvell/pxa168_eth.c b/drivers/net/ethernet/marvell/pxa168_eth.c
index 44bad608eed..1db023b075a 100644
--- a/drivers/net/ethernet/marvell/pxa168_eth.c
+++ b/drivers/net/ethernet/marvell/pxa168_eth.c
@@ -43,7 +43,6 @@
43#include <linux/interrupt.h> 43#include <linux/interrupt.h>
44#include <linux/types.h> 44#include <linux/types.h>
45#include <asm/pgtable.h> 45#include <asm/pgtable.h>
46#include <asm/system.h>
47#include <asm/cacheflush.h> 46#include <asm/cacheflush.h>
48#include <linux/pxa168_eth.h> 47#include <linux/pxa168_eth.h>
49 48
diff --git a/drivers/net/ethernet/marvell/sky2.c b/drivers/net/ethernet/marvell/sky2.c
index 20a59322c79..7732474263d 100644
--- a/drivers/net/ethernet/marvell/sky2.c
+++ b/drivers/net/ethernet/marvell/sky2.c
@@ -1767,13 +1767,14 @@ static int sky2_open(struct net_device *dev)
1767 1767
1768 sky2_hw_up(sky2); 1768 sky2_hw_up(sky2);
1769 1769
1770 /* Enable interrupts from phy/mac for port */
1771 imask = sky2_read32(hw, B0_IMSK);
1772
1770 if (hw->chip_id == CHIP_ID_YUKON_OPT || 1773 if (hw->chip_id == CHIP_ID_YUKON_OPT ||
1771 hw->chip_id == CHIP_ID_YUKON_PRM || 1774 hw->chip_id == CHIP_ID_YUKON_PRM ||
1772 hw->chip_id == CHIP_ID_YUKON_OP_2) 1775 hw->chip_id == CHIP_ID_YUKON_OP_2)
1773 imask |= Y2_IS_PHY_QLNK; /* enable PHY Quick Link */ 1776 imask |= Y2_IS_PHY_QLNK; /* enable PHY Quick Link */
1774 1777
1775 /* Enable interrupts from phy/mac for port */
1776 imask = sky2_read32(hw, B0_IMSK);
1777 imask |= portirq_msk[port]; 1778 imask |= portirq_msk[port];
1778 sky2_write32(hw, B0_IMSK, imask); 1779 sky2_write32(hw, B0_IMSK, imask);
1779 sky2_read32(hw, B0_IMSK); 1780 sky2_read32(hw, B0_IMSK);
@@ -2468,6 +2469,17 @@ static int sky2_change_mtu(struct net_device *dev, int new_mtu)
2468 return err; 2469 return err;
2469} 2470}
2470 2471
2472static inline bool needs_copy(const struct rx_ring_info *re,
2473 unsigned length)
2474{
2475#ifndef CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS
2476 /* Some architectures need the IP header to be aligned */
2477 if (!IS_ALIGNED(re->data_addr + ETH_HLEN, sizeof(u32)))
2478 return true;
2479#endif
2480 return length < copybreak;
2481}
2482
2471/* For small just reuse existing skb for next receive */ 2483/* For small just reuse existing skb for next receive */
2472static struct sk_buff *receive_copy(struct sky2_port *sky2, 2484static struct sk_buff *receive_copy(struct sky2_port *sky2,
2473 const struct rx_ring_info *re, 2485 const struct rx_ring_info *re,
@@ -2598,7 +2610,7 @@ static struct sk_buff *sky2_receive(struct net_device *dev,
2598 goto error; 2610 goto error;
2599 2611
2600okay: 2612okay:
2601 if (length < copybreak) 2613 if (needs_copy(re, length))
2602 skb = receive_copy(sky2, re, length); 2614 skb = receive_copy(sky2, re, length);
2603 else 2615 else
2604 skb = receive_new(sky2, re, length); 2616 skb = receive_new(sky2, re, length);
diff --git a/drivers/net/ethernet/mellanox/mlx4/mlx4_en.h b/drivers/net/ethernet/mellanox/mlx4/mlx4_en.h
index 3879c5eee62..47e1c0ff177 100644
--- a/drivers/net/ethernet/mellanox/mlx4/mlx4_en.h
+++ b/drivers/net/ethernet/mellanox/mlx4/mlx4_en.h
@@ -86,8 +86,9 @@
86 86
87#define MLX4_EN_WATCHDOG_TIMEOUT (15 * HZ) 87#define MLX4_EN_WATCHDOG_TIMEOUT (15 * HZ)
88 88
89#define MLX4_EN_ALLOC_ORDER 2 89/* Use the maximum between 16384 and a single page */
90#define MLX4_EN_ALLOC_SIZE (PAGE_SIZE << MLX4_EN_ALLOC_ORDER) 90#define MLX4_EN_ALLOC_SIZE PAGE_ALIGN(16384)
91#define MLX4_EN_ALLOC_ORDER get_order(MLX4_EN_ALLOC_SIZE)
91 92
92#define MLX4_EN_MAX_LRO_DESCRIPTORS 32 93#define MLX4_EN_MAX_LRO_DESCRIPTORS 32
93 94
diff --git a/drivers/net/ethernet/micrel/ks8842.c b/drivers/net/ethernet/micrel/ks8842.c
index 0686b93f185..f84dd2dc82b 100644
--- a/drivers/net/ethernet/micrel/ks8842.c
+++ b/drivers/net/ethernet/micrel/ks8842.c
@@ -458,7 +458,7 @@ static int ks8842_tx_frame_dma(struct sk_buff *skb, struct net_device *netdev)
458 if (sg_dma_len(&ctl->sg) % 4) 458 if (sg_dma_len(&ctl->sg) % 4)
459 sg_dma_len(&ctl->sg) += 4 - sg_dma_len(&ctl->sg) % 4; 459 sg_dma_len(&ctl->sg) += 4 - sg_dma_len(&ctl->sg) % 4;
460 460
461 ctl->adesc = ctl->chan->device->device_prep_slave_sg(ctl->chan, 461 ctl->adesc = dmaengine_prep_slave_sg(ctl->chan,
462 &ctl->sg, 1, DMA_MEM_TO_DEV, 462 &ctl->sg, 1, DMA_MEM_TO_DEV,
463 DMA_PREP_INTERRUPT | DMA_COMPL_SKIP_SRC_UNMAP); 463 DMA_PREP_INTERRUPT | DMA_COMPL_SKIP_SRC_UNMAP);
464 if (!ctl->adesc) 464 if (!ctl->adesc)
@@ -570,7 +570,7 @@ static int __ks8842_start_new_rx_dma(struct net_device *netdev)
570 570
571 sg_dma_len(sg) = DMA_BUFFER_SIZE; 571 sg_dma_len(sg) = DMA_BUFFER_SIZE;
572 572
573 ctl->adesc = ctl->chan->device->device_prep_slave_sg(ctl->chan, 573 ctl->adesc = dmaengine_prep_slave_sg(ctl->chan,
574 sg, 1, DMA_DEV_TO_MEM, 574 sg, 1, DMA_DEV_TO_MEM,
575 DMA_PREP_INTERRUPT | DMA_COMPL_SKIP_SRC_UNMAP); 575 DMA_PREP_INTERRUPT | DMA_COMPL_SKIP_SRC_UNMAP);
576 576
diff --git a/drivers/net/ethernet/natsemi/jazzsonic.c b/drivers/net/ethernet/natsemi/jazzsonic.c
index 5b89fd377ae..95dd39ffb23 100644
--- a/drivers/net/ethernet/natsemi/jazzsonic.c
+++ b/drivers/net/ethernet/natsemi/jazzsonic.c
@@ -38,7 +38,6 @@
38#include <linux/slab.h> 38#include <linux/slab.h>
39 39
40#include <asm/bootinfo.h> 40#include <asm/bootinfo.h>
41#include <asm/system.h>
42#include <asm/pgtable.h> 41#include <asm/pgtable.h>
43#include <asm/io.h> 42#include <asm/io.h>
44#include <asm/dma.h> 43#include <asm/dma.h>
diff --git a/drivers/net/ethernet/natsemi/macsonic.c b/drivers/net/ethernet/natsemi/macsonic.c
index e640e23460d..b9680ba5a32 100644
--- a/drivers/net/ethernet/natsemi/macsonic.c
+++ b/drivers/net/ethernet/natsemi/macsonic.c
@@ -53,7 +53,6 @@
53#include <linux/slab.h> 53#include <linux/slab.h>
54 54
55#include <asm/bootinfo.h> 55#include <asm/bootinfo.h>
56#include <asm/system.h>
57#include <asm/pgtable.h> 56#include <asm/pgtable.h>
58#include <asm/io.h> 57#include <asm/io.h>
59#include <asm/hwtest.h> 58#include <asm/hwtest.h>
diff --git a/drivers/net/ethernet/natsemi/ns83820.c b/drivers/net/ethernet/natsemi/ns83820.c
index c24b46cbfe2..d52728b3c43 100644
--- a/drivers/net/ethernet/natsemi/ns83820.c
+++ b/drivers/net/ethernet/natsemi/ns83820.c
@@ -121,7 +121,6 @@
121 121
122#include <asm/io.h> 122#include <asm/io.h>
123#include <asm/uaccess.h> 123#include <asm/uaccess.h>
124#include <asm/system.h>
125 124
126#define DRV_NAME "ns83820" 125#define DRV_NAME "ns83820"
127 126
diff --git a/drivers/net/ethernet/neterion/s2io.c b/drivers/net/ethernet/neterion/s2io.c
index eb2ab048cbc..bb367582c1e 100644
--- a/drivers/net/ethernet/neterion/s2io.c
+++ b/drivers/net/ethernet/neterion/s2io.c
@@ -81,7 +81,6 @@
81#include <linux/prefetch.h> 81#include <linux/prefetch.h>
82#include <net/tcp.h> 82#include <net/tcp.h>
83 83
84#include <asm/system.h>
85#include <asm/div64.h> 84#include <asm/div64.h>
86#include <asm/irq.h> 85#include <asm/irq.h>
87 86
diff --git a/drivers/net/ethernet/nvidia/forcedeth.c b/drivers/net/ethernet/nvidia/forcedeth.c
index 84952b308f8..d93a088debc 100644
--- a/drivers/net/ethernet/nvidia/forcedeth.c
+++ b/drivers/net/ethernet/nvidia/forcedeth.c
@@ -69,7 +69,6 @@
69#include <linux/io.h> 69#include <linux/io.h>
70 70
71#include <asm/irq.h> 71#include <asm/irq.h>
72#include <asm/system.h>
73 72
74#define TX_WORK_PER_LOOP 64 73#define TX_WORK_PER_LOOP 64
75#define RX_WORK_PER_LOOP 64 74#define RX_WORK_PER_LOOP 64
diff --git a/drivers/net/ethernet/realtek/atp.c b/drivers/net/ethernet/realtek/atp.c
index 46c1932048c..e02f04d7f3a 100644
--- a/drivers/net/ethernet/realtek/atp.c
+++ b/drivers/net/ethernet/realtek/atp.c
@@ -140,7 +140,6 @@ static int xcvr[NUM_UNITS]; /* The data transfer mode. */
140#include <linux/delay.h> 140#include <linux/delay.h>
141#include <linux/bitops.h> 141#include <linux/bitops.h>
142 142
143#include <asm/system.h>
144#include <asm/io.h> 143#include <asm/io.h>
145#include <asm/dma.h> 144#include <asm/dma.h>
146 145
diff --git a/drivers/net/ethernet/realtek/r8169.c b/drivers/net/ethernet/realtek/r8169.c
index 074a5741baf..71393ea8ef5 100644
--- a/drivers/net/ethernet/realtek/r8169.c
+++ b/drivers/net/ethernet/realtek/r8169.c
@@ -29,7 +29,6 @@
29#include <linux/pci-aspm.h> 29#include <linux/pci-aspm.h>
30#include <linux/prefetch.h> 30#include <linux/prefetch.h>
31 31
32#include <asm/system.h>
33#include <asm/io.h> 32#include <asm/io.h>
34#include <asm/irq.h> 33#include <asm/irq.h>
35 34
@@ -5812,7 +5811,10 @@ static void __rtl8169_resume(struct net_device *dev)
5812 5811
5813 rtl_pll_power_up(tp); 5812 rtl_pll_power_up(tp);
5814 5813
5814 rtl_lock_work(tp);
5815 napi_enable(&tp->napi);
5815 set_bit(RTL_FLAG_TASK_ENABLED, tp->wk.flags); 5816 set_bit(RTL_FLAG_TASK_ENABLED, tp->wk.flags);
5817 rtl_unlock_work(tp);
5816 5818
5817 rtl_schedule_task(tp, RTL_FLAG_TASK_RESET_PENDING); 5819 rtl_schedule_task(tp, RTL_FLAG_TASK_RESET_PENDING);
5818} 5820}
diff --git a/drivers/net/ethernet/renesas/sh_eth.c b/drivers/net/ethernet/renesas/sh_eth.c
index 5999e961def..be3c2217916 100644
--- a/drivers/net/ethernet/renesas/sh_eth.c
+++ b/drivers/net/ethernet/renesas/sh_eth.c
@@ -912,7 +912,7 @@ static int sh_eth_dev_init(struct net_device *ndev)
912 /* all sh_eth int mask */ 912 /* all sh_eth int mask */
913 sh_eth_write(ndev, 0, EESIPR); 913 sh_eth_write(ndev, 0, EESIPR);
914 914
915#if defined(__LITTLE_ENDIAN__) 915#if defined(__LITTLE_ENDIAN)
916 if (mdp->cd->hw_swap) 916 if (mdp->cd->hw_swap)
917 sh_eth_write(ndev, EDMR_EL, EDMR); 917 sh_eth_write(ndev, EDMR_EL, EDMR);
918 else 918 else
diff --git a/drivers/net/ethernet/renesas/sh_eth.h b/drivers/net/ethernet/renesas/sh_eth.h
index 2d80feadc86..57b8e1fc5d1 100644
--- a/drivers/net/ethernet/renesas/sh_eth.h
+++ b/drivers/net/ethernet/renesas/sh_eth.h
@@ -694,7 +694,7 @@ enum TSU_FWSLC_BIT {
694 */ 694 */
695struct sh_eth_txdesc { 695struct sh_eth_txdesc {
696 u32 status; /* TD0 */ 696 u32 status; /* TD0 */
697#if defined(CONFIG_CPU_LITTLE_ENDIAN) 697#if defined(__LITTLE_ENDIAN)
698 u16 pad0; /* TD1 */ 698 u16 pad0; /* TD1 */
699 u16 buffer_length; /* TD1 */ 699 u16 buffer_length; /* TD1 */
700#else 700#else
@@ -711,7 +711,7 @@ struct sh_eth_txdesc {
711 */ 711 */
712struct sh_eth_rxdesc { 712struct sh_eth_rxdesc {
713 u32 status; /* RD0 */ 713 u32 status; /* RD0 */
714#if defined(CONFIG_CPU_LITTLE_ENDIAN) 714#if defined(__LITTLE_ENDIAN)
715 u16 frame_length; /* RD1 */ 715 u16 frame_length; /* RD1 */
716 u16 buffer_length; /* RD1 */ 716 u16 buffer_length; /* RD1 */
717#else 717#else
diff --git a/drivers/net/ethernet/seeq/ether3.c b/drivers/net/ethernet/seeq/ether3.c
index 7b819bd8c41..df808ac8cb6 100644
--- a/drivers/net/ethernet/seeq/ether3.c
+++ b/drivers/net/ethernet/seeq/ether3.c
@@ -64,7 +64,6 @@
64#include <linux/delay.h> 64#include <linux/delay.h>
65#include <linux/bitops.h> 65#include <linux/bitops.h>
66 66
67#include <asm/system.h>
68#include <asm/ecard.h> 67#include <asm/ecard.h>
69#include <asm/io.h> 68#include <asm/io.h>
70 69
diff --git a/drivers/net/ethernet/seeq/seeq8005.c b/drivers/net/ethernet/seeq/seeq8005.c
index 79899077444..698edbbfc14 100644
--- a/drivers/net/ethernet/seeq/seeq8005.c
+++ b/drivers/net/ethernet/seeq/seeq8005.c
@@ -47,7 +47,6 @@ static const char version[] =
47#include <linux/bitops.h> 47#include <linux/bitops.h>
48#include <linux/jiffies.h> 48#include <linux/jiffies.h>
49 49
50#include <asm/system.h>
51#include <asm/io.h> 50#include <asm/io.h>
52#include <asm/dma.h> 51#include <asm/dma.h>
53 52
diff --git a/drivers/net/ethernet/sfc/mtd.c b/drivers/net/ethernet/sfc/mtd.c
index 26b3c23b0b6..758148379b0 100644
--- a/drivers/net/ethernet/sfc/mtd.c
+++ b/drivers/net/ethernet/sfc/mtd.c
@@ -193,7 +193,7 @@ static int efx_mtd_erase(struct mtd_info *mtd, struct erase_info *erase)
193 erase->state = MTD_ERASE_DONE; 193 erase->state = MTD_ERASE_DONE;
194 } else { 194 } else {
195 erase->state = MTD_ERASE_FAILED; 195 erase->state = MTD_ERASE_FAILED;
196 erase->fail_addr = 0xffffffff; 196 erase->fail_addr = MTD_FAIL_ADDR_UNKNOWN;
197 } 197 }
198 mtd_erase_callback(erase); 198 mtd_erase_callback(erase);
199 return rc; 199 return rc;
@@ -263,10 +263,10 @@ static int efx_mtd_probe_device(struct efx_nic *efx, struct efx_mtd *efx_mtd)
263 part->mtd.owner = THIS_MODULE; 263 part->mtd.owner = THIS_MODULE;
264 part->mtd.priv = efx_mtd; 264 part->mtd.priv = efx_mtd;
265 part->mtd.name = part->name; 265 part->mtd.name = part->name;
266 part->mtd.erase = efx_mtd_erase; 266 part->mtd._erase = efx_mtd_erase;
267 part->mtd.read = efx_mtd->ops->read; 267 part->mtd._read = efx_mtd->ops->read;
268 part->mtd.write = efx_mtd->ops->write; 268 part->mtd._write = efx_mtd->ops->write;
269 part->mtd.sync = efx_mtd_sync; 269 part->mtd._sync = efx_mtd_sync;
270 270
271 if (mtd_device_register(&part->mtd, NULL, 0)) 271 if (mtd_device_register(&part->mtd, NULL, 0))
272 goto fail; 272 goto fail;
diff --git a/drivers/net/ethernet/smsc/smc91c92_cs.c b/drivers/net/ethernet/smsc/smc91c92_cs.c
index d12e48a7861..04393b5fef7 100644
--- a/drivers/net/ethernet/smsc/smc91c92_cs.c
+++ b/drivers/net/ethernet/smsc/smc91c92_cs.c
@@ -53,7 +53,6 @@
53#include <pcmcia/ss.h> 53#include <pcmcia/ss.h>
54 54
55#include <asm/io.h> 55#include <asm/io.h>
56#include <asm/system.h>
57#include <asm/uaccess.h> 56#include <asm/uaccess.h>
58 57
59/*====================================================================*/ 58/*====================================================================*/
diff --git a/drivers/net/ethernet/smsc/smc91x.c b/drivers/net/ethernet/smsc/smc91x.c
index 1dc4fad593e..fee44935501 100644
--- a/drivers/net/ethernet/smsc/smc91x.c
+++ b/drivers/net/ethernet/smsc/smc91x.c
@@ -2280,7 +2280,7 @@ static int __devinit smc_drv_probe(struct platform_device *pdev)
2280 if (ret) 2280 if (ret)
2281 goto out_release_io; 2281 goto out_release_io;
2282#if defined(CONFIG_SA1100_ASSABET) 2282#if defined(CONFIG_SA1100_ASSABET)
2283 NCR_0 |= NCR_ENET_OSC_EN; 2283 neponset_ncr_set(NCR_ENET_OSC_EN);
2284#endif 2284#endif
2285 platform_set_drvdata(pdev, ndev); 2285 platform_set_drvdata(pdev, ndev);
2286 ret = smc_enable_device(pdev); 2286 ret = smc_enable_device(pdev);
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
index 90d5c4c75d2..a64f0d422e7 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
@@ -1784,10 +1784,12 @@ static int stmmac_hw_init(struct stmmac_priv *priv)
1784 struct mac_device_info *mac; 1784 struct mac_device_info *mac;
1785 1785
1786 /* Identify the MAC HW device */ 1786 /* Identify the MAC HW device */
1787 if (priv->plat->has_gmac) 1787 if (priv->plat->has_gmac) {
1788 priv->dev->priv_flags |= IFF_UNICAST_FLT;
1788 mac = dwmac1000_setup(priv->ioaddr); 1789 mac = dwmac1000_setup(priv->ioaddr);
1789 else 1790 } else {
1790 mac = dwmac100_setup(priv->ioaddr); 1791 mac = dwmac100_setup(priv->ioaddr);
1792 }
1791 if (!mac) 1793 if (!mac)
1792 return -ENOMEM; 1794 return -ENOMEM;
1793 1795
diff --git a/drivers/net/ethernet/sun/cassini.c b/drivers/net/ethernet/sun/cassini.c
index 3c229556073..ce4df61b4b5 100644
--- a/drivers/net/ethernet/sun/cassini.c
+++ b/drivers/net/ethernet/sun/cassini.c
@@ -99,7 +99,6 @@
99#include <net/checksum.h> 99#include <net/checksum.h>
100 100
101#include <linux/atomic.h> 101#include <linux/atomic.h>
102#include <asm/system.h>
103#include <asm/io.h> 102#include <asm/io.h>
104#include <asm/byteorder.h> 103#include <asm/byteorder.h>
105#include <asm/uaccess.h> 104#include <asm/uaccess.h>
diff --git a/drivers/net/ethernet/sun/sunbmac.c b/drivers/net/ethernet/sun/sunbmac.c
index f359863b534..2a83fc57edb 100644
--- a/drivers/net/ethernet/sun/sunbmac.c
+++ b/drivers/net/ethernet/sun/sunbmac.c
@@ -35,7 +35,6 @@
35#include <asm/openprom.h> 35#include <asm/openprom.h>
36#include <asm/oplib.h> 36#include <asm/oplib.h>
37#include <asm/pgtable.h> 37#include <asm/pgtable.h>
38#include <asm/system.h>
39 38
40#include "sunbmac.h" 39#include "sunbmac.h"
41 40
diff --git a/drivers/net/ethernet/sun/sungem.c b/drivers/net/ethernet/sun/sungem.c
index 8707d59ed54..dfd4b1d13a5 100644
--- a/drivers/net/ethernet/sun/sungem.c
+++ b/drivers/net/ethernet/sun/sungem.c
@@ -41,7 +41,6 @@
41#include <linux/mm.h> 41#include <linux/mm.h>
42#include <linux/gfp.h> 42#include <linux/gfp.h>
43 43
44#include <asm/system.h>
45#include <asm/io.h> 44#include <asm/io.h>
46#include <asm/byteorder.h> 45#include <asm/byteorder.h>
47#include <asm/uaccess.h> 46#include <asm/uaccess.h>
diff --git a/drivers/net/ethernet/sun/sunhme.c b/drivers/net/ethernet/sun/sunhme.c
index afb19a6d7c5..dfc00c4683e 100644
--- a/drivers/net/ethernet/sun/sunhme.c
+++ b/drivers/net/ethernet/sun/sunhme.c
@@ -36,7 +36,6 @@
36#include <linux/bitops.h> 36#include <linux/bitops.h>
37#include <linux/dma-mapping.h> 37#include <linux/dma-mapping.h>
38 38
39#include <asm/system.h>
40#include <asm/io.h> 39#include <asm/io.h>
41#include <asm/dma.h> 40#include <asm/dma.h>
42#include <asm/byteorder.h> 41#include <asm/byteorder.h>
diff --git a/drivers/net/ethernet/sun/sunqe.c b/drivers/net/ethernet/sun/sunqe.c
index 139d6b410d6..7d4a040d84a 100644
--- a/drivers/net/ethernet/sun/sunqe.c
+++ b/drivers/net/ethernet/sun/sunqe.c
@@ -28,7 +28,6 @@
28#include <linux/of.h> 28#include <linux/of.h>
29#include <linux/of_device.h> 29#include <linux/of_device.h>
30 30
31#include <asm/system.h>
32#include <asm/io.h> 31#include <asm/io.h>
33#include <asm/dma.h> 32#include <asm/dma.h>
34#include <asm/byteorder.h> 33#include <asm/byteorder.h>
diff --git a/drivers/net/ethernet/sun/sunvnet.c b/drivers/net/ethernet/sun/sunvnet.c
index 92a037a8228..38e3ae9155b 100644
--- a/drivers/net/ethernet/sun/sunvnet.c
+++ b/drivers/net/ethernet/sun/sunvnet.c
@@ -1259,10 +1259,7 @@ static struct vio_driver vnet_port_driver = {
1259 .id_table = vnet_port_match, 1259 .id_table = vnet_port_match,
1260 .probe = vnet_port_probe, 1260 .probe = vnet_port_probe,
1261 .remove = vnet_port_remove, 1261 .remove = vnet_port_remove,
1262 .driver = { 1262 .name = "vnet_port",
1263 .name = "vnet_port",
1264 .owner = THIS_MODULE,
1265 }
1266}; 1263};
1267 1264
1268static int __init vnet_init(void) 1265static int __init vnet_init(void)
diff --git a/drivers/net/ethernet/tundra/tsi108_eth.c b/drivers/net/ethernet/tundra/tsi108_eth.c
index 840e0e9031f..277c93e9ff4 100644
--- a/drivers/net/ethernet/tundra/tsi108_eth.c
+++ b/drivers/net/ethernet/tundra/tsi108_eth.c
@@ -50,7 +50,6 @@
50#include <linux/platform_device.h> 50#include <linux/platform_device.h>
51#include <linux/gfp.h> 51#include <linux/gfp.h>
52 52
53#include <asm/system.h>
54#include <asm/io.h> 53#include <asm/io.h>
55#include <asm/tsi108.h> 54#include <asm/tsi108.h>
56 55
diff --git a/drivers/net/ethernet/via/via-rhine.c b/drivers/net/ethernet/via/via-rhine.c
index 47b411fe3ec..0459c096629 100644
--- a/drivers/net/ethernet/via/via-rhine.c
+++ b/drivers/net/ethernet/via/via-rhine.c
@@ -503,30 +503,32 @@ static int rhine_vlan_rx_add_vid(struct net_device *dev, unsigned short vid);
503static int rhine_vlan_rx_kill_vid(struct net_device *dev, unsigned short vid); 503static int rhine_vlan_rx_kill_vid(struct net_device *dev, unsigned short vid);
504static void rhine_restart_tx(struct net_device *dev); 504static void rhine_restart_tx(struct net_device *dev);
505 505
506static void rhine_wait_bit(struct rhine_private *rp, u8 reg, u8 mask, bool high) 506static void rhine_wait_bit(struct rhine_private *rp, u8 reg, u8 mask, bool low)
507{ 507{
508 void __iomem *ioaddr = rp->base; 508 void __iomem *ioaddr = rp->base;
509 int i; 509 int i;
510 510
511 for (i = 0; i < 1024; i++) { 511 for (i = 0; i < 1024; i++) {
512 if (high ^ !!(ioread8(ioaddr + reg) & mask)) 512 bool has_mask_bits = !!(ioread8(ioaddr + reg) & mask);
513
514 if (low ^ has_mask_bits)
513 break; 515 break;
514 udelay(10); 516 udelay(10);
515 } 517 }
516 if (i > 64) { 518 if (i > 64) {
517 netif_dbg(rp, hw, rp->dev, "%s bit wait (%02x/%02x) cycle " 519 netif_dbg(rp, hw, rp->dev, "%s bit wait (%02x/%02x) cycle "
518 "count: %04d\n", high ? "high" : "low", reg, mask, i); 520 "count: %04d\n", low ? "low" : "high", reg, mask, i);
519 } 521 }
520} 522}
521 523
522static void rhine_wait_bit_high(struct rhine_private *rp, u8 reg, u8 mask) 524static void rhine_wait_bit_high(struct rhine_private *rp, u8 reg, u8 mask)
523{ 525{
524 rhine_wait_bit(rp, reg, mask, true); 526 rhine_wait_bit(rp, reg, mask, false);
525} 527}
526 528
527static void rhine_wait_bit_low(struct rhine_private *rp, u8 reg, u8 mask) 529static void rhine_wait_bit_low(struct rhine_private *rp, u8 reg, u8 mask)
528{ 530{
529 rhine_wait_bit(rp, reg, mask, false); 531 rhine_wait_bit(rp, reg, mask, true);
530} 532}
531 533
532static u32 rhine_get_events(struct rhine_private *rp) 534static u32 rhine_get_events(struct rhine_private *rp)
diff --git a/drivers/net/ethernet/xircom/xirc2ps_cs.c b/drivers/net/ethernet/xircom/xirc2ps_cs.c
index 5c69c6f93fb..94a1f94f74b 100644
--- a/drivers/net/ethernet/xircom/xirc2ps_cs.c
+++ b/drivers/net/ethernet/xircom/xirc2ps_cs.c
@@ -89,7 +89,6 @@
89#include <pcmcia/ciscode.h> 89#include <pcmcia/ciscode.h>
90 90
91#include <asm/io.h> 91#include <asm/io.h>
92#include <asm/system.h>
93#include <asm/uaccess.h> 92#include <asm/uaccess.h>
94 93
95#ifndef MANFID_COMPAQ 94#ifndef MANFID_COMPAQ
diff --git a/drivers/net/hamradio/6pack.c b/drivers/net/hamradio/6pack.c
index 2a5a34d2d67..64783a0d545 100644
--- a/drivers/net/hamradio/6pack.c
+++ b/drivers/net/hamradio/6pack.c
@@ -13,7 +13,6 @@
13 */ 13 */
14 14
15#include <linux/module.h> 15#include <linux/module.h>
16#include <asm/system.h>
17#include <asm/uaccess.h> 16#include <asm/uaccess.h>
18#include <linux/bitops.h> 17#include <linux/bitops.h>
19#include <linux/string.h> 18#include <linux/string.h>
diff --git a/drivers/net/hamradio/baycom_par.c b/drivers/net/hamradio/baycom_par.c
index f1aea0c9833..acb636963e9 100644
--- a/drivers/net/hamradio/baycom_par.c
+++ b/drivers/net/hamradio/baycom_par.c
@@ -86,7 +86,6 @@
86#include <linux/bitops.h> 86#include <linux/bitops.h>
87#include <linux/jiffies.h> 87#include <linux/jiffies.h>
88 88
89#include <asm/system.h>
90#include <asm/uaccess.h> 89#include <asm/uaccess.h>
91 90
92/* --------------------------------------------------------------------- */ 91/* --------------------------------------------------------------------- */
diff --git a/drivers/net/hamradio/bpqether.c b/drivers/net/hamradio/bpqether.c
index 18d8affecd1..76d54774ba8 100644
--- a/drivers/net/hamradio/bpqether.c
+++ b/drivers/net/hamradio/bpqether.c
@@ -69,7 +69,6 @@
69#include <linux/if_arp.h> 69#include <linux/if_arp.h>
70#include <linux/skbuff.h> 70#include <linux/skbuff.h>
71#include <net/sock.h> 71#include <net/sock.h>
72#include <asm/system.h>
73#include <asm/uaccess.h> 72#include <asm/uaccess.h>
74#include <linux/mm.h> 73#include <linux/mm.h>
75#include <linux/interrupt.h> 74#include <linux/interrupt.h>
diff --git a/drivers/net/hamradio/mkiss.c b/drivers/net/hamradio/mkiss.c
index bc02968cee1..aed1a6105b2 100644
--- a/drivers/net/hamradio/mkiss.c
+++ b/drivers/net/hamradio/mkiss.c
@@ -17,7 +17,6 @@
17 * Copyright (C) 2004, 05 Thomas Osterried DL9SAU <thomas@x-berg.in-berlin.de> 17 * Copyright (C) 2004, 05 Thomas Osterried DL9SAU <thomas@x-berg.in-berlin.de>
18 */ 18 */
19#include <linux/module.h> 19#include <linux/module.h>
20#include <asm/system.h>
21#include <linux/bitops.h> 20#include <linux/bitops.h>
22#include <asm/uaccess.h> 21#include <asm/uaccess.h>
23#include <linux/crc16.h> 22#include <linux/crc16.h>
diff --git a/drivers/net/hamradio/scc.c b/drivers/net/hamradio/scc.c
index 33655814448..efc6c97163a 100644
--- a/drivers/net/hamradio/scc.c
+++ b/drivers/net/hamradio/scc.c
@@ -177,7 +177,6 @@
177#include <net/ax25.h> 177#include <net/ax25.h>
178 178
179#include <asm/irq.h> 179#include <asm/irq.h>
180#include <asm/system.h>
181#include <asm/io.h> 180#include <asm/io.h>
182#include <asm/uaccess.h> 181#include <asm/uaccess.h>
183 182
diff --git a/drivers/net/hamradio/yam.c b/drivers/net/hamradio/yam.c
index 696327773fb..5a6412ecce7 100644
--- a/drivers/net/hamradio/yam.c
+++ b/drivers/net/hamradio/yam.c
@@ -52,7 +52,6 @@
52#include <linux/bitops.h> 52#include <linux/bitops.h>
53#include <linux/random.h> 53#include <linux/random.h>
54#include <asm/io.h> 54#include <asm/io.h>
55#include <asm/system.h>
56#include <linux/interrupt.h> 55#include <linux/interrupt.h>
57#include <linux/ioport.h> 56#include <linux/ioport.h>
58#include <linux/firmware.h> 57#include <linux/firmware.h>
diff --git a/drivers/net/hippi/rrunner.c b/drivers/net/hippi/rrunner.c
index 248c4f17846..b6a2bdeff59 100644
--- a/drivers/net/hippi/rrunner.c
+++ b/drivers/net/hippi/rrunner.c
@@ -43,7 +43,6 @@
43#include <linux/slab.h> 43#include <linux/slab.h>
44#include <net/sock.h> 44#include <net/sock.h>
45 45
46#include <asm/system.h>
47#include <asm/cache.h> 46#include <asm/cache.h>
48#include <asm/byteorder.h> 47#include <asm/byteorder.h>
49#include <asm/io.h> 48#include <asm/io.h>
diff --git a/drivers/net/irda/Kconfig b/drivers/net/irda/Kconfig
index e535137eb2d..468047866c8 100644
--- a/drivers/net/irda/Kconfig
+++ b/drivers/net/irda/Kconfig
@@ -356,7 +356,7 @@ config VLSI_FIR
356 356
357config SA1100_FIR 357config SA1100_FIR
358 tristate "SA1100 Internal IR" 358 tristate "SA1100 Internal IR"
359 depends on ARCH_SA1100 && IRDA 359 depends on ARCH_SA1100 && IRDA && DMA_SA11X0
360 360
361config VIA_FIR 361config VIA_FIR
362 tristate "VIA VT8231/VT1211 SIR/MIR/FIR" 362 tristate "VIA VT8231/VT1211 SIR/MIR/FIR"
diff --git a/drivers/net/irda/donauboe.c b/drivers/net/irda/donauboe.c
index 617a446d126..4351296dde3 100644
--- a/drivers/net/irda/donauboe.c
+++ b/drivers/net/irda/donauboe.c
@@ -156,7 +156,6 @@
156#include <linux/pci.h> 156#include <linux/pci.h>
157#include <linux/rtnetlink.h> 157#include <linux/rtnetlink.h>
158 158
159#include <asm/system.h>
160#include <asm/io.h> 159#include <asm/io.h>
161 160
162#include <net/irda/wrapper.h> 161#include <net/irda/wrapper.h>
diff --git a/drivers/net/irda/sa1100_ir.c b/drivers/net/irda/sa1100_ir.c
index da2705061a6..e25067552b2 100644
--- a/drivers/net/irda/sa1100_ir.c
+++ b/drivers/net/irda/sa1100_ir.c
@@ -15,7 +15,7 @@
15 * This driver takes one kernel command line parameter, sa1100ir=, with 15 * This driver takes one kernel command line parameter, sa1100ir=, with
16 * the following options: 16 * the following options:
17 * max_rate:baudrate - set the maximum baud rate 17 * max_rate:baudrate - set the maximum baud rate
18 * power_leve:level - set the transmitter power level 18 * power_level:level - set the transmitter power level
19 * tx_lpm:0|1 - set transmit low power mode 19 * tx_lpm:0|1 - set transmit low power mode
20 */ 20 */
21#include <linux/module.h> 21#include <linux/module.h>
@@ -30,13 +30,13 @@
30#include <linux/delay.h> 30#include <linux/delay.h>
31#include <linux/platform_device.h> 31#include <linux/platform_device.h>
32#include <linux/dma-mapping.h> 32#include <linux/dma-mapping.h>
33#include <linux/dmaengine.h>
34#include <linux/sa11x0-dma.h>
33 35
34#include <net/irda/irda.h> 36#include <net/irda/irda.h>
35#include <net/irda/wrapper.h> 37#include <net/irda/wrapper.h>
36#include <net/irda/irda_device.h> 38#include <net/irda/irda_device.h>
37 39
38#include <asm/irq.h>
39#include <mach/dma.h>
40#include <mach/hardware.h> 40#include <mach/hardware.h>
41#include <asm/mach/irda.h> 41#include <asm/mach/irda.h>
42 42
@@ -44,8 +44,15 @@ static int power_level = 3;
44static int tx_lpm; 44static int tx_lpm;
45static int max_rate = 4000000; 45static int max_rate = 4000000;
46 46
47struct sa1100_buf {
48 struct device *dev;
49 struct sk_buff *skb;
50 struct scatterlist sg;
51 struct dma_chan *chan;
52 dma_cookie_t cookie;
53};
54
47struct sa1100_irda { 55struct sa1100_irda {
48 unsigned char hscr0;
49 unsigned char utcr4; 56 unsigned char utcr4;
50 unsigned char power; 57 unsigned char power;
51 unsigned char open; 58 unsigned char open;
@@ -53,12 +60,8 @@ struct sa1100_irda {
53 int speed; 60 int speed;
54 int newspeed; 61 int newspeed;
55 62
56 struct sk_buff *txskb; 63 struct sa1100_buf dma_rx;
57 struct sk_buff *rxskb; 64 struct sa1100_buf dma_tx;
58 dma_addr_t txbuf_dma;
59 dma_addr_t rxbuf_dma;
60 dma_regs_t *txdma;
61 dma_regs_t *rxdma;
62 65
63 struct device *dev; 66 struct device *dev;
64 struct irda_platform_data *pdata; 67 struct irda_platform_data *pdata;
@@ -67,23 +70,103 @@ struct sa1100_irda {
67 70
68 iobuff_t tx_buff; 71 iobuff_t tx_buff;
69 iobuff_t rx_buff; 72 iobuff_t rx_buff;
73
74 int (*tx_start)(struct sk_buff *, struct net_device *, struct sa1100_irda *);
75 irqreturn_t (*irq)(struct net_device *, struct sa1100_irda *);
70}; 76};
71 77
78static int sa1100_irda_set_speed(struct sa1100_irda *, int);
79
72#define IS_FIR(si) ((si)->speed >= 4000000) 80#define IS_FIR(si) ((si)->speed >= 4000000)
73 81
74#define HPSIR_MAX_RXLEN 2047 82#define HPSIR_MAX_RXLEN 2047
75 83
84static struct dma_slave_config sa1100_irda_sir_tx = {
85 .direction = DMA_TO_DEVICE,
86 .dst_addr = __PREG(Ser2UTDR),
87 .dst_addr_width = DMA_SLAVE_BUSWIDTH_1_BYTE,
88 .dst_maxburst = 4,
89};
90
91static struct dma_slave_config sa1100_irda_fir_rx = {
92 .direction = DMA_FROM_DEVICE,
93 .src_addr = __PREG(Ser2HSDR),
94 .src_addr_width = DMA_SLAVE_BUSWIDTH_1_BYTE,
95 .src_maxburst = 8,
96};
97
98static struct dma_slave_config sa1100_irda_fir_tx = {
99 .direction = DMA_TO_DEVICE,
100 .dst_addr = __PREG(Ser2HSDR),
101 .dst_addr_width = DMA_SLAVE_BUSWIDTH_1_BYTE,
102 .dst_maxburst = 8,
103};
104
105static unsigned sa1100_irda_dma_xferred(struct sa1100_buf *buf)
106{
107 struct dma_chan *chan = buf->chan;
108 struct dma_tx_state state;
109 enum dma_status status;
110
111 status = chan->device->device_tx_status(chan, buf->cookie, &state);
112 if (status != DMA_PAUSED)
113 return 0;
114
115 return sg_dma_len(&buf->sg) - state.residue;
116}
117
118static int sa1100_irda_dma_request(struct device *dev, struct sa1100_buf *buf,
119 const char *name, struct dma_slave_config *cfg)
120{
121 dma_cap_mask_t m;
122 int ret;
123
124 dma_cap_zero(m);
125 dma_cap_set(DMA_SLAVE, m);
126
127 buf->chan = dma_request_channel(m, sa11x0_dma_filter_fn, (void *)name);
128 if (!buf->chan) {
129 dev_err(dev, "unable to request DMA channel for %s\n",
130 name);
131 return -ENOENT;
132 }
133
134 ret = dmaengine_slave_config(buf->chan, cfg);
135 if (ret)
136 dev_warn(dev, "DMA slave_config for %s returned %d\n",
137 name, ret);
138
139 buf->dev = buf->chan->device->dev;
140
141 return 0;
142}
143
144static void sa1100_irda_dma_start(struct sa1100_buf *buf,
145 enum dma_transfer_direction dir, dma_async_tx_callback cb, void *cb_p)
146{
147 struct dma_async_tx_descriptor *desc;
148 struct dma_chan *chan = buf->chan;
149
150 desc = dmaengine_prep_slave_sg(chan, &buf->sg, 1, dir,
151 DMA_PREP_INTERRUPT | DMA_CTRL_ACK);
152 if (desc) {
153 desc->callback = cb;
154 desc->callback_param = cb_p;
155 buf->cookie = dmaengine_submit(desc);
156 dma_async_issue_pending(chan);
157 }
158}
159
76/* 160/*
77 * Allocate and map the receive buffer, unless it is already allocated. 161 * Allocate and map the receive buffer, unless it is already allocated.
78 */ 162 */
79static int sa1100_irda_rx_alloc(struct sa1100_irda *si) 163static int sa1100_irda_rx_alloc(struct sa1100_irda *si)
80{ 164{
81 if (si->rxskb) 165 if (si->dma_rx.skb)
82 return 0; 166 return 0;
83 167
84 si->rxskb = alloc_skb(HPSIR_MAX_RXLEN + 1, GFP_ATOMIC); 168 si->dma_rx.skb = alloc_skb(HPSIR_MAX_RXLEN + 1, GFP_ATOMIC);
85 169 if (!si->dma_rx.skb) {
86 if (!si->rxskb) {
87 printk(KERN_ERR "sa1100_ir: out of memory for RX SKB\n"); 170 printk(KERN_ERR "sa1100_ir: out of memory for RX SKB\n");
88 return -ENOMEM; 171 return -ENOMEM;
89 } 172 }
@@ -92,11 +175,14 @@ static int sa1100_irda_rx_alloc(struct sa1100_irda *si)
92 * Align any IP headers that may be contained 175 * Align any IP headers that may be contained
93 * within the frame. 176 * within the frame.
94 */ 177 */
95 skb_reserve(si->rxskb, 1); 178 skb_reserve(si->dma_rx.skb, 1);
179
180 sg_set_buf(&si->dma_rx.sg, si->dma_rx.skb->data, HPSIR_MAX_RXLEN);
181 if (dma_map_sg(si->dma_rx.dev, &si->dma_rx.sg, 1, DMA_FROM_DEVICE) == 0) {
182 dev_kfree_skb_any(si->dma_rx.skb);
183 return -ENOMEM;
184 }
96 185
97 si->rxbuf_dma = dma_map_single(si->dev, si->rxskb->data,
98 HPSIR_MAX_RXLEN,
99 DMA_FROM_DEVICE);
100 return 0; 186 return 0;
101} 187}
102 188
@@ -106,7 +192,7 @@ static int sa1100_irda_rx_alloc(struct sa1100_irda *si)
106 */ 192 */
107static void sa1100_irda_rx_dma_start(struct sa1100_irda *si) 193static void sa1100_irda_rx_dma_start(struct sa1100_irda *si)
108{ 194{
109 if (!si->rxskb) { 195 if (!si->dma_rx.skb) {
110 printk(KERN_ERR "sa1100_ir: rx buffer went missing\n"); 196 printk(KERN_ERR "sa1100_ir: rx buffer went missing\n");
111 return; 197 return;
112 } 198 }
@@ -114,254 +200,87 @@ static void sa1100_irda_rx_dma_start(struct sa1100_irda *si)
114 /* 200 /*
115 * First empty receive FIFO 201 * First empty receive FIFO
116 */ 202 */
117 Ser2HSCR0 = si->hscr0 | HSCR0_HSSP; 203 Ser2HSCR0 = HSCR0_HSSP;
118 204
119 /* 205 /*
120 * Enable the DMA, receiver and receive interrupt. 206 * Enable the DMA, receiver and receive interrupt.
121 */ 207 */
122 sa1100_clear_dma(si->rxdma); 208 dmaengine_terminate_all(si->dma_rx.chan);
123 sa1100_start_dma(si->rxdma, si->rxbuf_dma, HPSIR_MAX_RXLEN); 209 sa1100_irda_dma_start(&si->dma_rx, DMA_DEV_TO_MEM, NULL, NULL);
124 Ser2HSCR0 = si->hscr0 | HSCR0_HSSP | HSCR0_RXE; 210
211 Ser2HSCR0 = HSCR0_HSSP | HSCR0_RXE;
125} 212}
126 213
127/* 214static void sa1100_irda_check_speed(struct sa1100_irda *si)
128 * Set the IrDA communications speed.
129 */
130static int sa1100_irda_set_speed(struct sa1100_irda *si, int speed)
131{ 215{
132 unsigned long flags; 216 if (si->newspeed) {
133 int brd, ret = -EINVAL; 217 sa1100_irda_set_speed(si, si->newspeed);
134 218 si->newspeed = 0;
135 switch (speed) {
136 case 9600: case 19200: case 38400:
137 case 57600: case 115200:
138 brd = 3686400 / (16 * speed) - 1;
139
140 /*
141 * Stop the receive DMA.
142 */
143 if (IS_FIR(si))
144 sa1100_stop_dma(si->rxdma);
145
146 local_irq_save(flags);
147
148 Ser2UTCR3 = 0;
149 Ser2HSCR0 = HSCR0_UART;
150
151 Ser2UTCR1 = brd >> 8;
152 Ser2UTCR2 = brd;
153
154 /*
155 * Clear status register
156 */
157 Ser2UTSR0 = UTSR0_REB | UTSR0_RBB | UTSR0_RID;
158 Ser2UTCR3 = UTCR3_RIE | UTCR3_RXE | UTCR3_TXE;
159
160 if (si->pdata->set_speed)
161 si->pdata->set_speed(si->dev, speed);
162
163 si->speed = speed;
164
165 local_irq_restore(flags);
166 ret = 0;
167 break;
168
169 case 4000000:
170 local_irq_save(flags);
171
172 si->hscr0 = 0;
173
174 Ser2HSSR0 = 0xff;
175 Ser2HSCR0 = si->hscr0 | HSCR0_HSSP;
176 Ser2UTCR3 = 0;
177
178 si->speed = speed;
179
180 if (si->pdata->set_speed)
181 si->pdata->set_speed(si->dev, speed);
182
183 sa1100_irda_rx_alloc(si);
184 sa1100_irda_rx_dma_start(si);
185
186 local_irq_restore(flags);
187
188 break;
189
190 default:
191 break;
192 } 219 }
193
194 return ret;
195} 220}
196 221
197/* 222/*
198 * Control the power state of the IrDA transmitter. 223 * HP-SIR format support.
199 * State:
200 * 0 - off
201 * 1 - short range, lowest power
202 * 2 - medium range, medium power
203 * 3 - maximum range, high power
204 *
205 * Currently, only assabet is known to support this.
206 */ 224 */
207static int 225static void sa1100_irda_sirtxdma_irq(void *id)
208__sa1100_irda_set_power(struct sa1100_irda *si, unsigned int state)
209{ 226{
210 int ret = 0; 227 struct net_device *dev = id;
211 if (si->pdata->set_power) 228 struct sa1100_irda *si = netdev_priv(dev);
212 ret = si->pdata->set_power(si->dev, state);
213 return ret;
214}
215
216static inline int
217sa1100_set_power(struct sa1100_irda *si, unsigned int state)
218{
219 int ret;
220
221 ret = __sa1100_irda_set_power(si, state);
222 if (ret == 0)
223 si->power = state;
224 229
225 return ret; 230 dma_unmap_sg(si->dma_tx.dev, &si->dma_tx.sg, 1, DMA_TO_DEVICE);
226} 231 dev_kfree_skb(si->dma_tx.skb);
232 si->dma_tx.skb = NULL;
227 233
228static int sa1100_irda_startup(struct sa1100_irda *si) 234 dev->stats.tx_packets++;
229{ 235 dev->stats.tx_bytes += sg_dma_len(&si->dma_tx.sg);
230 int ret;
231 236
232 /* 237 /* We need to ensure that the transmitter has finished. */
233 * Ensure that the ports for this device are setup correctly. 238 do
234 */ 239 rmb();
235 if (si->pdata->startup) { 240 while (Ser2UTSR1 & UTSR1_TBY);
236 ret = si->pdata->startup(si->dev);
237 if (ret)
238 return ret;
239 }
240
241 /*
242 * Configure PPC for IRDA - we want to drive TXD2 low.
243 * We also want to drive this pin low during sleep.
244 */
245 PPSR &= ~PPC_TXD2;
246 PSDR &= ~PPC_TXD2;
247 PPDR |= PPC_TXD2;
248
249 /*
250 * Enable HP-SIR modulation, and ensure that the port is disabled.
251 */
252 Ser2UTCR3 = 0;
253 Ser2HSCR0 = HSCR0_UART;
254 Ser2UTCR4 = si->utcr4;
255 Ser2UTCR0 = UTCR0_8BitData;
256 Ser2HSCR2 = HSCR2_TrDataH | HSCR2_RcDataL;
257 241
258 /* 242 /*
259 * Clear status register 243 * Ok, we've finished transmitting. Now enable the receiver.
244 * Sometimes we get a receive IRQ immediately after a transmit...
260 */ 245 */
261 Ser2UTSR0 = UTSR0_REB | UTSR0_RBB | UTSR0_RID; 246 Ser2UTSR0 = UTSR0_REB | UTSR0_RBB | UTSR0_RID;
247 Ser2UTCR3 = UTCR3_RIE | UTCR3_RXE | UTCR3_TXE;
262 248
263 ret = sa1100_irda_set_speed(si, si->speed = 9600); 249 sa1100_irda_check_speed(si);
264 if (ret) {
265 Ser2UTCR3 = 0;
266 Ser2HSCR0 = 0;
267
268 if (si->pdata->shutdown)
269 si->pdata->shutdown(si->dev);
270 }
271
272 return ret;
273}
274
275static void sa1100_irda_shutdown(struct sa1100_irda *si)
276{
277 /*
278 * Stop all DMA activity.
279 */
280 sa1100_stop_dma(si->rxdma);
281 sa1100_stop_dma(si->txdma);
282
283 /* Disable the port. */
284 Ser2UTCR3 = 0;
285 Ser2HSCR0 = 0;
286 250
287 if (si->pdata->shutdown) 251 /* I'm hungry! */
288 si->pdata->shutdown(si->dev); 252 netif_wake_queue(dev);
289} 253}
290 254
291#ifdef CONFIG_PM 255static int sa1100_irda_sir_tx_start(struct sk_buff *skb, struct net_device *dev,
292/* 256 struct sa1100_irda *si)
293 * Suspend the IrDA interface.
294 */
295static int sa1100_irda_suspend(struct platform_device *pdev, pm_message_t state)
296{ 257{
297 struct net_device *dev = platform_get_drvdata(pdev); 258 si->tx_buff.data = si->tx_buff.head;
298 struct sa1100_irda *si; 259 si->tx_buff.len = async_wrap_skb(skb, si->tx_buff.data,
299 260 si->tx_buff.truesize);
300 if (!dev) 261
301 return 0; 262 si->dma_tx.skb = skb;
302 263 sg_set_buf(&si->dma_tx.sg, si->tx_buff.data, si->tx_buff.len);
303 si = netdev_priv(dev); 264 if (dma_map_sg(si->dma_tx.dev, &si->dma_tx.sg, 1, DMA_TO_DEVICE) == 0) {
304 if (si->open) { 265 si->dma_tx.skb = NULL;
305 /* 266 netif_wake_queue(dev);
306 * Stop the transmit queue 267 dev->stats.tx_dropped++;
307 */ 268 return NETDEV_TX_OK;
308 netif_device_detach(dev);
309 disable_irq(dev->irq);
310 sa1100_irda_shutdown(si);
311 __sa1100_irda_set_power(si, 0);
312 } 269 }
313 270
314 return 0; 271 sa1100_irda_dma_start(&si->dma_tx, DMA_MEM_TO_DEV, sa1100_irda_sirtxdma_irq, dev);
315}
316
317/*
318 * Resume the IrDA interface.
319 */
320static int sa1100_irda_resume(struct platform_device *pdev)
321{
322 struct net_device *dev = platform_get_drvdata(pdev);
323 struct sa1100_irda *si;
324
325 if (!dev)
326 return 0;
327 272
328 si = netdev_priv(dev); 273 /*
329 if (si->open) { 274 * The mean turn-around time is enforced by XBOF padding,
330 /* 275 * so we don't have to do anything special here.
331 * If we missed a speed change, initialise at the new speed 276 */
332 * directly. It is debatable whether this is actually 277 Ser2UTCR3 = UTCR3_TXE;
333 * required, but in the interests of continuing from where
334 * we left off it is desirable. The converse argument is
335 * that we should re-negotiate at 9600 baud again.
336 */
337 if (si->newspeed) {
338 si->speed = si->newspeed;
339 si->newspeed = 0;
340 }
341
342 sa1100_irda_startup(si);
343 __sa1100_irda_set_power(si, si->power);
344 enable_irq(dev->irq);
345
346 /*
347 * This automatically wakes up the queue
348 */
349 netif_device_attach(dev);
350 }
351 278
352 return 0; 279 return NETDEV_TX_OK;
353} 280}
354#else
355#define sa1100_irda_suspend NULL
356#define sa1100_irda_resume NULL
357#endif
358 281
359/* 282static irqreturn_t sa1100_irda_sir_irq(struct net_device *dev, struct sa1100_irda *si)
360 * HP-SIR format interrupt service routines.
361 */
362static void sa1100_irda_hpsir_irq(struct net_device *dev)
363{ 283{
364 struct sa1100_irda *si = netdev_priv(dev);
365 int status; 284 int status;
366 285
367 status = Ser2UTSR0; 286 status = Ser2UTSR0;
@@ -414,51 +333,96 @@ static void sa1100_irda_hpsir_irq(struct net_device *dev)
414 333
415 } 334 }
416 335
417 if (status & UTSR0_TFS && si->tx_buff.len) { 336 return IRQ_HANDLED;
418 /* 337}
419 * Transmitter FIFO is not full
420 */
421 do {
422 Ser2UTDR = *si->tx_buff.data++;
423 si->tx_buff.len -= 1;
424 } while (Ser2UTSR1 & UTSR1_TNF && si->tx_buff.len);
425 338
426 if (si->tx_buff.len == 0) { 339/*
427 dev->stats.tx_packets++; 340 * FIR format support.
428 dev->stats.tx_bytes += si->tx_buff.data - 341 */
429 si->tx_buff.head; 342static void sa1100_irda_firtxdma_irq(void *id)
343{
344 struct net_device *dev = id;
345 struct sa1100_irda *si = netdev_priv(dev);
346 struct sk_buff *skb;
430 347
431 /* 348 /*
432 * We need to ensure that the transmitter has 349 * Wait for the transmission to complete. Unfortunately,
433 * finished. 350 * the hardware doesn't give us an interrupt to indicate
434 */ 351 * "end of frame".
435 do 352 */
436 rmb(); 353 do
437 while (Ser2UTSR1 & UTSR1_TBY); 354 rmb();
355 while (!(Ser2HSSR0 & HSSR0_TUR) || Ser2HSSR1 & HSSR1_TBY);
438 356
439 /* 357 /*
440 * Ok, we've finished transmitting. Now enable 358 * Clear the transmit underrun bit.
441 * the receiver. Sometimes we get a receive IRQ 359 */
442 * immediately after a transmit... 360 Ser2HSSR0 = HSSR0_TUR;
443 */
444 Ser2UTSR0 = UTSR0_REB | UTSR0_RBB | UTSR0_RID;
445 Ser2UTCR3 = UTCR3_RIE | UTCR3_RXE | UTCR3_TXE;
446 361
447 if (si->newspeed) { 362 /*
448 sa1100_irda_set_speed(si, si->newspeed); 363 * Do we need to change speed? Note that we're lazy
449 si->newspeed = 0; 364 * here - we don't free the old dma_rx.skb. We don't need
450 } 365 * to allocate a buffer either.
366 */
367 sa1100_irda_check_speed(si);
451 368
452 /* I'm hungry! */ 369 /*
453 netif_wake_queue(dev); 370 * Start reception. This disables the transmitter for
454 } 371 * us. This will be using the existing RX buffer.
372 */
373 sa1100_irda_rx_dma_start(si);
374
375 /* Account and free the packet. */
376 skb = si->dma_tx.skb;
377 if (skb) {
378 dma_unmap_sg(si->dma_tx.dev, &si->dma_tx.sg, 1,
379 DMA_TO_DEVICE);
380 dev->stats.tx_packets ++;
381 dev->stats.tx_bytes += skb->len;
382 dev_kfree_skb_irq(skb);
383 si->dma_tx.skb = NULL;
455 } 384 }
385
386 /*
387 * Make sure that the TX queue is available for sending
388 * (for retries). TX has priority over RX at all times.
389 */
390 netif_wake_queue(dev);
391}
392
393static int sa1100_irda_fir_tx_start(struct sk_buff *skb, struct net_device *dev,
394 struct sa1100_irda *si)
395{
396 int mtt = irda_get_mtt(skb);
397
398 si->dma_tx.skb = skb;
399 sg_set_buf(&si->dma_tx.sg, skb->data, skb->len);
400 if (dma_map_sg(si->dma_tx.dev, &si->dma_tx.sg, 1, DMA_TO_DEVICE) == 0) {
401 si->dma_tx.skb = NULL;
402 netif_wake_queue(dev);
403 dev->stats.tx_dropped++;
404 dev_kfree_skb(skb);
405 return NETDEV_TX_OK;
406 }
407
408 sa1100_irda_dma_start(&si->dma_tx, DMA_MEM_TO_DEV, sa1100_irda_firtxdma_irq, dev);
409
410 /*
411 * If we have a mean turn-around time, impose the specified
412 * specified delay. We could shorten this by timing from
413 * the point we received the packet.
414 */
415 if (mtt)
416 udelay(mtt);
417
418 Ser2HSCR0 = HSCR0_HSSP | HSCR0_TXE;
419
420 return NETDEV_TX_OK;
456} 421}
457 422
458static void sa1100_irda_fir_error(struct sa1100_irda *si, struct net_device *dev) 423static void sa1100_irda_fir_error(struct sa1100_irda *si, struct net_device *dev)
459{ 424{
460 struct sk_buff *skb = si->rxskb; 425 struct sk_buff *skb = si->dma_rx.skb;
461 dma_addr_t dma_addr;
462 unsigned int len, stat, data; 426 unsigned int len, stat, data;
463 427
464 if (!skb) { 428 if (!skb) {
@@ -469,11 +433,10 @@ static void sa1100_irda_fir_error(struct sa1100_irda *si, struct net_device *dev
469 /* 433 /*
470 * Get the current data position. 434 * Get the current data position.
471 */ 435 */
472 dma_addr = sa1100_get_dma_pos(si->rxdma); 436 len = sa1100_irda_dma_xferred(&si->dma_rx);
473 len = dma_addr - si->rxbuf_dma;
474 if (len > HPSIR_MAX_RXLEN) 437 if (len > HPSIR_MAX_RXLEN)
475 len = HPSIR_MAX_RXLEN; 438 len = HPSIR_MAX_RXLEN;
476 dma_unmap_single(si->dev, si->rxbuf_dma, len, DMA_FROM_DEVICE); 439 dma_unmap_sg(si->dma_rx.dev, &si->dma_rx.sg, 1, DMA_FROM_DEVICE);
477 440
478 do { 441 do {
479 /* 442 /*
@@ -501,7 +464,7 @@ static void sa1100_irda_fir_error(struct sa1100_irda *si, struct net_device *dev
501 } while (Ser2HSSR0 & HSSR0_EIF); 464 } while (Ser2HSSR0 & HSSR0_EIF);
502 465
503 if (stat & HSSR1_EOF) { 466 if (stat & HSSR1_EOF) {
504 si->rxskb = NULL; 467 si->dma_rx.skb = NULL;
505 468
506 skb_put(skb, len); 469 skb_put(skb, len);
507 skb->dev = dev; 470 skb->dev = dev;
@@ -518,28 +481,23 @@ static void sa1100_irda_fir_error(struct sa1100_irda *si, struct net_device *dev
518 netif_rx(skb); 481 netif_rx(skb);
519 } else { 482 } else {
520 /* 483 /*
521 * Remap the buffer. 484 * Remap the buffer - it was previously mapped, and we
485 * hope that this succeeds.
522 */ 486 */
523 si->rxbuf_dma = dma_map_single(si->dev, si->rxskb->data, 487 dma_map_sg(si->dma_rx.dev, &si->dma_rx.sg, 1, DMA_FROM_DEVICE);
524 HPSIR_MAX_RXLEN,
525 DMA_FROM_DEVICE);
526 } 488 }
527} 489}
528 490
529/* 491/*
530 * FIR format interrupt service routine. We only have to 492 * We only have to handle RX events here; transmit events go via the TX
531 * handle RX events; transmit events go via the TX DMA handler. 493 * DMA handler. We disable RX, process, and the restart RX.
532 *
533 * No matter what, we disable RX, process, and the restart RX.
534 */ 494 */
535static void sa1100_irda_fir_irq(struct net_device *dev) 495static irqreturn_t sa1100_irda_fir_irq(struct net_device *dev, struct sa1100_irda *si)
536{ 496{
537 struct sa1100_irda *si = netdev_priv(dev);
538
539 /* 497 /*
540 * Stop RX DMA 498 * Stop RX DMA
541 */ 499 */
542 sa1100_stop_dma(si->rxdma); 500 dmaengine_pause(si->dma_rx.chan);
543 501
544 /* 502 /*
545 * Framing error - we throw away the packet completely. 503 * Framing error - we throw away the packet completely.
@@ -555,7 +513,7 @@ static void sa1100_irda_fir_irq(struct net_device *dev)
555 /* 513 /*
556 * Clear out the DMA... 514 * Clear out the DMA...
557 */ 515 */
558 Ser2HSCR0 = si->hscr0 | HSCR0_HSSP; 516 Ser2HSCR0 = HSCR0_HSSP;
559 517
560 /* 518 /*
561 * Clear selected status bits now, so we 519 * Clear selected status bits now, so we
@@ -577,74 +535,124 @@ static void sa1100_irda_fir_irq(struct net_device *dev)
577 * No matter what happens, we must restart reception. 535 * No matter what happens, we must restart reception.
578 */ 536 */
579 sa1100_irda_rx_dma_start(si); 537 sa1100_irda_rx_dma_start(si);
580}
581 538
582static irqreturn_t sa1100_irda_irq(int irq, void *dev_id)
583{
584 struct net_device *dev = dev_id;
585 if (IS_FIR(((struct sa1100_irda *)netdev_priv(dev))))
586 sa1100_irda_fir_irq(dev);
587 else
588 sa1100_irda_hpsir_irq(dev);
589 return IRQ_HANDLED; 539 return IRQ_HANDLED;
590} 540}
591 541
592/* 542/*
593 * TX DMA completion handler. 543 * Set the IrDA communications speed.
594 */ 544 */
595static void sa1100_irda_txdma_irq(void *id) 545static int sa1100_irda_set_speed(struct sa1100_irda *si, int speed)
596{ 546{
597 struct net_device *dev = id; 547 unsigned long flags;
598 struct sa1100_irda *si = netdev_priv(dev); 548 int brd, ret = -EINVAL;
599 struct sk_buff *skb = si->txskb;
600 549
601 si->txskb = NULL; 550 switch (speed) {
551 case 9600: case 19200: case 38400:
552 case 57600: case 115200:
553 brd = 3686400 / (16 * speed) - 1;
602 554
603 /* 555 /* Stop the receive DMA, and configure transmit. */
604 * Wait for the transmission to complete. Unfortunately, 556 if (IS_FIR(si)) {
605 * the hardware doesn't give us an interrupt to indicate 557 dmaengine_terminate_all(si->dma_rx.chan);
606 * "end of frame". 558 dmaengine_slave_config(si->dma_tx.chan,
607 */ 559 &sa1100_irda_sir_tx);
608 do 560 }
609 rmb();
610 while (!(Ser2HSSR0 & HSSR0_TUR) || Ser2HSSR1 & HSSR1_TBY);
611 561
612 /* 562 local_irq_save(flags);
613 * Clear the transmit underrun bit.
614 */
615 Ser2HSSR0 = HSSR0_TUR;
616 563
617 /* 564 Ser2UTCR3 = 0;
618 * Do we need to change speed? Note that we're lazy 565 Ser2HSCR0 = HSCR0_UART;
619 * here - we don't free the old rxskb. We don't need
620 * to allocate a buffer either.
621 */
622 if (si->newspeed) {
623 sa1100_irda_set_speed(si, si->newspeed);
624 si->newspeed = 0;
625 }
626 566
627 /* 567 Ser2UTCR1 = brd >> 8;
628 * Start reception. This disables the transmitter for 568 Ser2UTCR2 = brd;
629 * us. This will be using the existing RX buffer.
630 */
631 sa1100_irda_rx_dma_start(si);
632 569
633 /* 570 /*
634 * Account and free the packet. 571 * Clear status register
635 */ 572 */
636 if (skb) { 573 Ser2UTSR0 = UTSR0_REB | UTSR0_RBB | UTSR0_RID;
637 dma_unmap_single(si->dev, si->txbuf_dma, skb->len, DMA_TO_DEVICE); 574 Ser2UTCR3 = UTCR3_RIE | UTCR3_RXE | UTCR3_TXE;
638 dev->stats.tx_packets ++; 575
639 dev->stats.tx_bytes += skb->len; 576 if (si->pdata->set_speed)
640 dev_kfree_skb_irq(skb); 577 si->pdata->set_speed(si->dev, speed);
578
579 si->speed = speed;
580 si->tx_start = sa1100_irda_sir_tx_start;
581 si->irq = sa1100_irda_sir_irq;
582
583 local_irq_restore(flags);
584 ret = 0;
585 break;
586
587 case 4000000:
588 if (!IS_FIR(si))
589 dmaengine_slave_config(si->dma_tx.chan,
590 &sa1100_irda_fir_tx);
591
592 local_irq_save(flags);
593
594 Ser2HSSR0 = 0xff;
595 Ser2HSCR0 = HSCR0_HSSP;
596 Ser2UTCR3 = 0;
597
598 si->speed = speed;
599 si->tx_start = sa1100_irda_fir_tx_start;
600 si->irq = sa1100_irda_fir_irq;
601
602 if (si->pdata->set_speed)
603 si->pdata->set_speed(si->dev, speed);
604
605 sa1100_irda_rx_alloc(si);
606 sa1100_irda_rx_dma_start(si);
607
608 local_irq_restore(flags);
609
610 break;
611
612 default:
613 break;
641 } 614 }
642 615
643 /* 616 return ret;
644 * Make sure that the TX queue is available for sending 617}
645 * (for retries). TX has priority over RX at all times. 618
646 */ 619/*
647 netif_wake_queue(dev); 620 * Control the power state of the IrDA transmitter.
621 * State:
622 * 0 - off
623 * 1 - short range, lowest power
624 * 2 - medium range, medium power
625 * 3 - maximum range, high power
626 *
627 * Currently, only assabet is known to support this.
628 */
629static int
630__sa1100_irda_set_power(struct sa1100_irda *si, unsigned int state)
631{
632 int ret = 0;
633 if (si->pdata->set_power)
634 ret = si->pdata->set_power(si->dev, state);
635 return ret;
636}
637
638static inline int
639sa1100_set_power(struct sa1100_irda *si, unsigned int state)
640{
641 int ret;
642
643 ret = __sa1100_irda_set_power(si, state);
644 if (ret == 0)
645 si->power = state;
646
647 return ret;
648}
649
650static irqreturn_t sa1100_irda_irq(int irq, void *dev_id)
651{
652 struct net_device *dev = dev_id;
653 struct sa1100_irda *si = netdev_priv(dev);
654
655 return si->irq(dev, si);
648} 656}
649 657
650static int sa1100_irda_hard_xmit(struct sk_buff *skb, struct net_device *dev) 658static int sa1100_irda_hard_xmit(struct sk_buff *skb, struct net_device *dev)
@@ -660,62 +668,19 @@ static int sa1100_irda_hard_xmit(struct sk_buff *skb, struct net_device *dev)
660 if (speed != si->speed && speed != -1) 668 if (speed != si->speed && speed != -1)
661 si->newspeed = speed; 669 si->newspeed = speed;
662 670
663 /* 671 /* If this is an empty frame, we can bypass a lot. */
664 * If this is an empty frame, we can bypass a lot.
665 */
666 if (skb->len == 0) { 672 if (skb->len == 0) {
667 if (si->newspeed) { 673 sa1100_irda_check_speed(si);
668 si->newspeed = 0;
669 sa1100_irda_set_speed(si, speed);
670 }
671 dev_kfree_skb(skb); 674 dev_kfree_skb(skb);
672 return NETDEV_TX_OK; 675 return NETDEV_TX_OK;
673 } 676 }
674 677
675 if (!IS_FIR(si)) { 678 netif_stop_queue(dev);
676 netif_stop_queue(dev);
677
678 si->tx_buff.data = si->tx_buff.head;
679 si->tx_buff.len = async_wrap_skb(skb, si->tx_buff.data,
680 si->tx_buff.truesize);
681
682 /*
683 * Set the transmit interrupt enable. This will fire
684 * off an interrupt immediately. Note that we disable
685 * the receiver so we won't get spurious characteres
686 * received.
687 */
688 Ser2UTCR3 = UTCR3_TIE | UTCR3_TXE;
689
690 dev_kfree_skb(skb);
691 } else {
692 int mtt = irda_get_mtt(skb);
693
694 /*
695 * We must not be transmitting...
696 */
697 BUG_ON(si->txskb);
698
699 netif_stop_queue(dev);
700
701 si->txskb = skb;
702 si->txbuf_dma = dma_map_single(si->dev, skb->data,
703 skb->len, DMA_TO_DEVICE);
704
705 sa1100_start_dma(si->txdma, si->txbuf_dma, skb->len);
706
707 /*
708 * If we have a mean turn-around time, impose the specified
709 * specified delay. We could shorten this by timing from
710 * the point we received the packet.
711 */
712 if (mtt)
713 udelay(mtt);
714 679
715 Ser2HSCR0 = si->hscr0 | HSCR0_HSSP | HSCR0_TXE; 680 /* We must not already have a skb to transmit... */
716 } 681 BUG_ON(si->dma_tx.skb);
717 682
718 return NETDEV_TX_OK; 683 return si->tx_start(skb, dev, si);
719} 684}
720 685
721static int 686static int
@@ -762,6 +727,69 @@ sa1100_irda_ioctl(struct net_device *dev, struct ifreq *ifreq, int cmd)
762 return ret; 727 return ret;
763} 728}
764 729
730static int sa1100_irda_startup(struct sa1100_irda *si)
731{
732 int ret;
733
734 /*
735 * Ensure that the ports for this device are setup correctly.
736 */
737 if (si->pdata->startup) {
738 ret = si->pdata->startup(si->dev);
739 if (ret)
740 return ret;
741 }
742
743 /*
744 * Configure PPC for IRDA - we want to drive TXD2 low.
745 * We also want to drive this pin low during sleep.
746 */
747 PPSR &= ~PPC_TXD2;
748 PSDR &= ~PPC_TXD2;
749 PPDR |= PPC_TXD2;
750
751 /*
752 * Enable HP-SIR modulation, and ensure that the port is disabled.
753 */
754 Ser2UTCR3 = 0;
755 Ser2HSCR0 = HSCR0_UART;
756 Ser2UTCR4 = si->utcr4;
757 Ser2UTCR0 = UTCR0_8BitData;
758 Ser2HSCR2 = HSCR2_TrDataH | HSCR2_RcDataL;
759
760 /*
761 * Clear status register
762 */
763 Ser2UTSR0 = UTSR0_REB | UTSR0_RBB | UTSR0_RID;
764
765 ret = sa1100_irda_set_speed(si, si->speed = 9600);
766 if (ret) {
767 Ser2UTCR3 = 0;
768 Ser2HSCR0 = 0;
769
770 if (si->pdata->shutdown)
771 si->pdata->shutdown(si->dev);
772 }
773
774 return ret;
775}
776
777static void sa1100_irda_shutdown(struct sa1100_irda *si)
778{
779 /*
780 * Stop all DMA activity.
781 */
782 dmaengine_terminate_all(si->dma_rx.chan);
783 dmaengine_terminate_all(si->dma_tx.chan);
784
785 /* Disable the port. */
786 Ser2UTCR3 = 0;
787 Ser2HSCR0 = 0;
788
789 if (si->pdata->shutdown)
790 si->pdata->shutdown(si->dev);
791}
792
765static int sa1100_irda_start(struct net_device *dev) 793static int sa1100_irda_start(struct net_device *dev)
766{ 794{
767 struct sa1100_irda *si = netdev_priv(dev); 795 struct sa1100_irda *si = netdev_priv(dev);
@@ -769,26 +797,17 @@ static int sa1100_irda_start(struct net_device *dev)
769 797
770 si->speed = 9600; 798 si->speed = 9600;
771 799
772 err = request_irq(dev->irq, sa1100_irda_irq, 0, dev->name, dev); 800 err = sa1100_irda_dma_request(si->dev, &si->dma_rx, "Ser2ICPRc",
773 if (err) 801 &sa1100_irda_fir_rx);
774 goto err_irq;
775
776 err = sa1100_request_dma(DMA_Ser2HSSPRd, "IrDA receive",
777 NULL, NULL, &si->rxdma);
778 if (err) 802 if (err)
779 goto err_rx_dma; 803 goto err_rx_dma;
780 804
781 err = sa1100_request_dma(DMA_Ser2HSSPWr, "IrDA transmit", 805 err = sa1100_irda_dma_request(si->dev, &si->dma_tx, "Ser2ICPTr",
782 sa1100_irda_txdma_irq, dev, &si->txdma); 806 &sa1100_irda_sir_tx);
783 if (err) 807 if (err)
784 goto err_tx_dma; 808 goto err_tx_dma;
785 809
786 /* 810 /*
787 * The interrupt must remain disabled for now.
788 */
789 disable_irq(dev->irq);
790
791 /*
792 * Setup the serial port for the specified speed. 811 * Setup the serial port for the specified speed.
793 */ 812 */
794 err = sa1100_irda_startup(si); 813 err = sa1100_irda_startup(si);
@@ -803,44 +822,60 @@ static int sa1100_irda_start(struct net_device *dev)
803 if (!si->irlap) 822 if (!si->irlap)
804 goto err_irlap; 823 goto err_irlap;
805 824
825 err = request_irq(dev->irq, sa1100_irda_irq, 0, dev->name, dev);
826 if (err)
827 goto err_irq;
828
806 /* 829 /*
807 * Now enable the interrupt and start the queue 830 * Now enable the interrupt and start the queue
808 */ 831 */
809 si->open = 1; 832 si->open = 1;
810 sa1100_set_power(si, power_level); /* low power mode */ 833 sa1100_set_power(si, power_level); /* low power mode */
811 enable_irq(dev->irq); 834
812 netif_start_queue(dev); 835 netif_start_queue(dev);
813 return 0; 836 return 0;
814 837
838err_irq:
839 irlap_close(si->irlap);
815err_irlap: 840err_irlap:
816 si->open = 0; 841 si->open = 0;
817 sa1100_irda_shutdown(si); 842 sa1100_irda_shutdown(si);
818err_startup: 843err_startup:
819 sa1100_free_dma(si->txdma); 844 dma_release_channel(si->dma_tx.chan);
820err_tx_dma: 845err_tx_dma:
821 sa1100_free_dma(si->rxdma); 846 dma_release_channel(si->dma_rx.chan);
822err_rx_dma: 847err_rx_dma:
823 free_irq(dev->irq, dev);
824err_irq:
825 return err; 848 return err;
826} 849}
827 850
828static int sa1100_irda_stop(struct net_device *dev) 851static int sa1100_irda_stop(struct net_device *dev)
829{ 852{
830 struct sa1100_irda *si = netdev_priv(dev); 853 struct sa1100_irda *si = netdev_priv(dev);
854 struct sk_buff *skb;
855
856 netif_stop_queue(dev);
831 857
832 disable_irq(dev->irq); 858 si->open = 0;
833 sa1100_irda_shutdown(si); 859 sa1100_irda_shutdown(si);
834 860
835 /* 861 /*
836 * If we have been doing DMA receive, make sure we 862 * If we have been doing any DMA activity, make sure we
837 * tidy that up cleanly. 863 * tidy that up cleanly.
838 */ 864 */
839 if (si->rxskb) { 865 skb = si->dma_rx.skb;
840 dma_unmap_single(si->dev, si->rxbuf_dma, HPSIR_MAX_RXLEN, 866 if (skb) {
841 DMA_FROM_DEVICE); 867 dma_unmap_sg(si->dma_rx.dev, &si->dma_rx.sg, 1,
842 dev_kfree_skb(si->rxskb); 868 DMA_FROM_DEVICE);
843 si->rxskb = NULL; 869 dev_kfree_skb(skb);
870 si->dma_rx.skb = NULL;
871 }
872
873 skb = si->dma_tx.skb;
874 if (skb) {
875 dma_unmap_sg(si->dma_tx.dev, &si->dma_tx.sg, 1,
876 DMA_TO_DEVICE);
877 dev_kfree_skb(skb);
878 si->dma_tx.skb = NULL;
844 } 879 }
845 880
846 /* Stop IrLAP */ 881 /* Stop IrLAP */
@@ -849,14 +884,11 @@ static int sa1100_irda_stop(struct net_device *dev)
849 si->irlap = NULL; 884 si->irlap = NULL;
850 } 885 }
851 886
852 netif_stop_queue(dev);
853 si->open = 0;
854
855 /* 887 /*
856 * Free resources 888 * Free resources
857 */ 889 */
858 sa1100_free_dma(si->txdma); 890 dma_release_channel(si->dma_tx.chan);
859 sa1100_free_dma(si->rxdma); 891 dma_release_channel(si->dma_rx.chan);
860 free_irq(dev->irq, dev); 892 free_irq(dev->irq, dev);
861 893
862 sa1100_set_power(si, 0); 894 sa1100_set_power(si, 0);
@@ -888,11 +920,15 @@ static int sa1100_irda_probe(struct platform_device *pdev)
888 struct net_device *dev; 920 struct net_device *dev;
889 struct sa1100_irda *si; 921 struct sa1100_irda *si;
890 unsigned int baudrate_mask; 922 unsigned int baudrate_mask;
891 int err; 923 int err, irq;
892 924
893 if (!pdev->dev.platform_data) 925 if (!pdev->dev.platform_data)
894 return -EINVAL; 926 return -EINVAL;
895 927
928 irq = platform_get_irq(pdev, 0);
929 if (irq <= 0)
930 return irq < 0 ? irq : -ENXIO;
931
896 err = request_mem_region(__PREG(Ser2UTCR0), 0x24, "IrDA") ? 0 : -EBUSY; 932 err = request_mem_region(__PREG(Ser2UTCR0), 0x24, "IrDA") ? 0 : -EBUSY;
897 if (err) 933 if (err)
898 goto err_mem_1; 934 goto err_mem_1;
@@ -907,22 +943,27 @@ static int sa1100_irda_probe(struct platform_device *pdev)
907 if (!dev) 943 if (!dev)
908 goto err_mem_4; 944 goto err_mem_4;
909 945
946 SET_NETDEV_DEV(dev, &pdev->dev);
947
910 si = netdev_priv(dev); 948 si = netdev_priv(dev);
911 si->dev = &pdev->dev; 949 si->dev = &pdev->dev;
912 si->pdata = pdev->dev.platform_data; 950 si->pdata = pdev->dev.platform_data;
913 951
952 sg_init_table(&si->dma_rx.sg, 1);
953 sg_init_table(&si->dma_tx.sg, 1);
954
914 /* 955 /*
915 * Initialise the HP-SIR buffers 956 * Initialise the HP-SIR buffers
916 */ 957 */
917 err = sa1100_irda_init_iobuf(&si->rx_buff, 14384); 958 err = sa1100_irda_init_iobuf(&si->rx_buff, 14384);
918 if (err) 959 if (err)
919 goto err_mem_5; 960 goto err_mem_5;
920 err = sa1100_irda_init_iobuf(&si->tx_buff, 4000); 961 err = sa1100_irda_init_iobuf(&si->tx_buff, IRDA_SIR_MAX_FRAME);
921 if (err) 962 if (err)
922 goto err_mem_5; 963 goto err_mem_5;
923 964
924 dev->netdev_ops = &sa1100_irda_netdev_ops; 965 dev->netdev_ops = &sa1100_irda_netdev_ops;
925 dev->irq = IRQ_Ser2ICP; 966 dev->irq = irq;
926 967
927 irda_init_max_qos_capabilies(&si->qos); 968 irda_init_max_qos_capabilies(&si->qos);
928 969
@@ -996,6 +1037,74 @@ static int sa1100_irda_remove(struct platform_device *pdev)
996 return 0; 1037 return 0;
997} 1038}
998 1039
1040#ifdef CONFIG_PM
1041/*
1042 * Suspend the IrDA interface.
1043 */
1044static int sa1100_irda_suspend(struct platform_device *pdev, pm_message_t state)
1045{
1046 struct net_device *dev = platform_get_drvdata(pdev);
1047 struct sa1100_irda *si;
1048
1049 if (!dev)
1050 return 0;
1051
1052 si = netdev_priv(dev);
1053 if (si->open) {
1054 /*
1055 * Stop the transmit queue
1056 */
1057 netif_device_detach(dev);
1058 disable_irq(dev->irq);
1059 sa1100_irda_shutdown(si);
1060 __sa1100_irda_set_power(si, 0);
1061 }
1062
1063 return 0;
1064}
1065
1066/*
1067 * Resume the IrDA interface.
1068 */
1069static int sa1100_irda_resume(struct platform_device *pdev)
1070{
1071 struct net_device *dev = platform_get_drvdata(pdev);
1072 struct sa1100_irda *si;
1073
1074 if (!dev)
1075 return 0;
1076
1077 si = netdev_priv(dev);
1078 if (si->open) {
1079 /*
1080 * If we missed a speed change, initialise at the new speed
1081 * directly. It is debatable whether this is actually
1082 * required, but in the interests of continuing from where
1083 * we left off it is desirable. The converse argument is
1084 * that we should re-negotiate at 9600 baud again.
1085 */
1086 if (si->newspeed) {
1087 si->speed = si->newspeed;
1088 si->newspeed = 0;
1089 }
1090
1091 sa1100_irda_startup(si);
1092 __sa1100_irda_set_power(si, si->power);
1093 enable_irq(dev->irq);
1094
1095 /*
1096 * This automatically wakes up the queue
1097 */
1098 netif_device_attach(dev);
1099 }
1100
1101 return 0;
1102}
1103#else
1104#define sa1100_irda_suspend NULL
1105#define sa1100_irda_resume NULL
1106#endif
1107
999static struct platform_driver sa1100ir_driver = { 1108static struct platform_driver sa1100ir_driver = {
1000 .probe = sa1100_irda_probe, 1109 .probe = sa1100_irda_probe,
1001 .remove = sa1100_irda_remove, 1110 .remove = sa1100_irda_remove,
diff --git a/drivers/net/loopback.c b/drivers/net/loopback.c
index b71998d0b5b..32eb94ece6c 100644
--- a/drivers/net/loopback.c
+++ b/drivers/net/loopback.c
@@ -41,7 +41,6 @@
41#include <linux/in.h> 41#include <linux/in.h>
42#include <linux/init.h> 42#include <linux/init.h>
43 43
44#include <asm/system.h>
45#include <asm/uaccess.h> 44#include <asm/uaccess.h>
46#include <asm/io.h> 45#include <asm/io.h>
47 46
diff --git a/drivers/net/phy/icplus.c b/drivers/net/phy/icplus.c
index 0856e1b7a84..f08c85acf76 100644
--- a/drivers/net/phy/icplus.c
+++ b/drivers/net/phy/icplus.c
@@ -162,7 +162,8 @@ static int ip101a_g_config_init(struct phy_device *phydev)
162 /* Enable Auto Power Saving mode */ 162 /* Enable Auto Power Saving mode */
163 c = phy_read(phydev, IP10XX_SPEC_CTRL_STATUS); 163 c = phy_read(phydev, IP10XX_SPEC_CTRL_STATUS);
164 c |= IP101A_G_APS_ON; 164 c |= IP101A_G_APS_ON;
165 return c; 165
166 return phy_write(phydev, IP10XX_SPEC_CTRL_STATUS, c);
166} 167}
167 168
168static int ip175c_read_status(struct phy_device *phydev) 169static int ip175c_read_status(struct phy_device *phydev)
diff --git a/drivers/net/plip/plip.c b/drivers/net/plip/plip.c
index 1a5a316cc96..bed62d9c53c 100644
--- a/drivers/net/plip/plip.c
+++ b/drivers/net/plip/plip.c
@@ -113,7 +113,6 @@ static const char version[] = "NET3 PLIP version 2.4-parport gniibe@mri.co.jp\n"
113 113
114#include <net/neighbour.h> 114#include <net/neighbour.h>
115 115
116#include <asm/system.h>
117#include <asm/irq.h> 116#include <asm/irq.h>
118#include <asm/byteorder.h> 117#include <asm/byteorder.h>
119 118
diff --git a/drivers/net/ppp/ppp_generic.c b/drivers/net/ppp/ppp_generic.c
index 159da2905fe..33f8c51968b 100644
--- a/drivers/net/ppp/ppp_generic.c
+++ b/drivers/net/ppp/ppp_generic.c
@@ -235,7 +235,7 @@ struct ppp_net {
235/* Prototypes. */ 235/* Prototypes. */
236static int ppp_unattached_ioctl(struct net *net, struct ppp_file *pf, 236static int ppp_unattached_ioctl(struct net *net, struct ppp_file *pf,
237 struct file *file, unsigned int cmd, unsigned long arg); 237 struct file *file, unsigned int cmd, unsigned long arg);
238static void ppp_xmit_process(struct ppp *ppp); 238static int ppp_xmit_process(struct ppp *ppp);
239static void ppp_send_frame(struct ppp *ppp, struct sk_buff *skb); 239static void ppp_send_frame(struct ppp *ppp, struct sk_buff *skb);
240static void ppp_push(struct ppp *ppp); 240static void ppp_push(struct ppp *ppp);
241static void ppp_channel_push(struct channel *pch); 241static void ppp_channel_push(struct channel *pch);
@@ -968,9 +968,9 @@ ppp_start_xmit(struct sk_buff *skb, struct net_device *dev)
968 proto = npindex_to_proto[npi]; 968 proto = npindex_to_proto[npi];
969 put_unaligned_be16(proto, pp); 969 put_unaligned_be16(proto, pp);
970 970
971 netif_stop_queue(dev);
972 skb_queue_tail(&ppp->file.xq, skb); 971 skb_queue_tail(&ppp->file.xq, skb);
973 ppp_xmit_process(ppp); 972 if (!ppp_xmit_process(ppp))
973 netif_stop_queue(dev);
974 return NETDEV_TX_OK; 974 return NETDEV_TX_OK;
975 975
976 outf: 976 outf:
@@ -1048,10 +1048,11 @@ static void ppp_setup(struct net_device *dev)
1048 * Called to do any work queued up on the transmit side 1048 * Called to do any work queued up on the transmit side
1049 * that can now be done. 1049 * that can now be done.
1050 */ 1050 */
1051static void 1051static int
1052ppp_xmit_process(struct ppp *ppp) 1052ppp_xmit_process(struct ppp *ppp)
1053{ 1053{
1054 struct sk_buff *skb; 1054 struct sk_buff *skb;
1055 int ret = 0;
1055 1056
1056 ppp_xmit_lock(ppp); 1057 ppp_xmit_lock(ppp);
1057 if (!ppp->closing) { 1058 if (!ppp->closing) {
@@ -1061,10 +1062,13 @@ ppp_xmit_process(struct ppp *ppp)
1061 ppp_send_frame(ppp, skb); 1062 ppp_send_frame(ppp, skb);
1062 /* If there's no work left to do, tell the core net 1063 /* If there's no work left to do, tell the core net
1063 code that we can accept some more. */ 1064 code that we can accept some more. */
1064 if (!ppp->xmit_pending && !skb_peek(&ppp->file.xq)) 1065 if (!ppp->xmit_pending && !skb_peek(&ppp->file.xq)) {
1065 netif_wake_queue(ppp->dev); 1066 netif_wake_queue(ppp->dev);
1067 ret = 1;
1068 }
1066 } 1069 }
1067 ppp_xmit_unlock(ppp); 1070 ppp_xmit_unlock(ppp);
1071 return ret;
1068} 1072}
1069 1073
1070static inline struct sk_buff * 1074static inline struct sk_buff *
diff --git a/drivers/net/rionet.c b/drivers/net/rionet.c
index a57f05726b5..91d25888a1b 100644
--- a/drivers/net/rionet.c
+++ b/drivers/net/rionet.c
@@ -375,8 +375,8 @@ static void rionet_remove(struct rio_dev *rdev)
375 struct net_device *ndev = rio_get_drvdata(rdev); 375 struct net_device *ndev = rio_get_drvdata(rdev);
376 struct rionet_peer *peer, *tmp; 376 struct rionet_peer *peer, *tmp;
377 377
378 free_pages((unsigned long)rionet_active, rdev->net->hport->sys_size ? 378 free_pages((unsigned long)rionet_active, get_order(sizeof(void *) *
379 __fls(sizeof(void *)) + 4 : 0); 379 RIO_MAX_ROUTE_ENTRIES(rdev->net->hport->sys_size)));
380 unregister_netdev(ndev); 380 unregister_netdev(ndev);
381 free_netdev(ndev); 381 free_netdev(ndev);
382 382
@@ -432,15 +432,16 @@ static int rionet_setup_netdev(struct rio_mport *mport, struct net_device *ndev)
432 int rc = 0; 432 int rc = 0;
433 struct rionet_private *rnet; 433 struct rionet_private *rnet;
434 u16 device_id; 434 u16 device_id;
435 const size_t rionet_active_bytes = sizeof(void *) *
436 RIO_MAX_ROUTE_ENTRIES(mport->sys_size);
435 437
436 rionet_active = (struct rio_dev **)__get_free_pages(GFP_KERNEL, 438 rionet_active = (struct rio_dev **)__get_free_pages(GFP_KERNEL,
437 mport->sys_size ? __fls(sizeof(void *)) + 4 : 0); 439 get_order(rionet_active_bytes));
438 if (!rionet_active) { 440 if (!rionet_active) {
439 rc = -ENOMEM; 441 rc = -ENOMEM;
440 goto out; 442 goto out;
441 } 443 }
442 memset((void *)rionet_active, 0, sizeof(void *) * 444 memset((void *)rionet_active, 0, rionet_active_bytes);
443 RIO_MAX_ROUTE_ENTRIES(mport->sys_size));
444 445
445 /* Set up private area */ 446 /* Set up private area */
446 rnet = netdev_priv(ndev); 447 rnet = netdev_priv(ndev);
diff --git a/drivers/net/slip/slhc.c b/drivers/net/slip/slhc.c
index 0a0a6643cf3..1252d9c726a 100644
--- a/drivers/net/slip/slhc.c
+++ b/drivers/net/slip/slhc.c
@@ -75,7 +75,6 @@
75#include <linux/skbuff.h> 75#include <linux/skbuff.h>
76#include <net/sock.h> 76#include <net/sock.h>
77#include <linux/timer.h> 77#include <linux/timer.h>
78#include <asm/system.h>
79#include <asm/uaccess.h> 78#include <asm/uaccess.h>
80#include <net/checksum.h> 79#include <net/checksum.h>
81#include <asm/unaligned.h> 80#include <asm/unaligned.h>
diff --git a/drivers/net/slip/slip.c b/drivers/net/slip/slip.c
index 69345dfae0f..d4c9db3da22 100644
--- a/drivers/net/slip/slip.c
+++ b/drivers/net/slip/slip.c
@@ -64,7 +64,6 @@
64#include <linux/module.h> 64#include <linux/module.h>
65#include <linux/moduleparam.h> 65#include <linux/moduleparam.h>
66 66
67#include <asm/system.h>
68#include <asm/uaccess.h> 67#include <asm/uaccess.h>
69#include <linux/bitops.h> 68#include <linux/bitops.h>
70#include <linux/sched.h> 69#include <linux/sched.h>
diff --git a/drivers/net/tokenring/3c359.c b/drivers/net/tokenring/3c359.c
index d7c292aa76b..b15ac81d46f 100644
--- a/drivers/net/tokenring/3c359.c
+++ b/drivers/net/tokenring/3c359.c
@@ -68,7 +68,6 @@
68#include <net/checksum.h> 68#include <net/checksum.h>
69 69
70#include <asm/io.h> 70#include <asm/io.h>
71#include <asm/system.h>
72 71
73#include "3c359.h" 72#include "3c359.h"
74 73
diff --git a/drivers/net/tokenring/abyss.c b/drivers/net/tokenring/abyss.c
index 515f122777a..b715e6b444d 100644
--- a/drivers/net/tokenring/abyss.c
+++ b/drivers/net/tokenring/abyss.c
@@ -33,7 +33,6 @@
33#include <linux/netdevice.h> 33#include <linux/netdevice.h>
34#include <linux/trdevice.h> 34#include <linux/trdevice.h>
35 35
36#include <asm/system.h>
37#include <asm/io.h> 36#include <asm/io.h>
38#include <asm/irq.h> 37#include <asm/irq.h>
39 38
diff --git a/drivers/net/tokenring/ibmtr_cs.c b/drivers/net/tokenring/ibmtr_cs.c
index 91b684630fc..356e28e4881 100644
--- a/drivers/net/tokenring/ibmtr_cs.c
+++ b/drivers/net/tokenring/ibmtr_cs.c
@@ -63,7 +63,6 @@
63 63
64#include <asm/uaccess.h> 64#include <asm/uaccess.h>
65#include <asm/io.h> 65#include <asm/io.h>
66#include <asm/system.h>
67 66
68#define PCMCIA 67#define PCMCIA
69#include "ibmtr.c" 68#include "ibmtr.c"
diff --git a/drivers/net/tokenring/lanstreamer.c b/drivers/net/tokenring/lanstreamer.c
index 8d71e0d2906..3e4b4f09111 100644
--- a/drivers/net/tokenring/lanstreamer.c
+++ b/drivers/net/tokenring/lanstreamer.c
@@ -127,7 +127,6 @@
127#include <net/checksum.h> 127#include <net/checksum.h>
128 128
129#include <asm/io.h> 129#include <asm/io.h>
130#include <asm/system.h>
131 130
132#include "lanstreamer.h" 131#include "lanstreamer.h"
133 132
diff --git a/drivers/net/tokenring/madgemc.c b/drivers/net/tokenring/madgemc.c
index 1cdc034f6ae..28adcdf3b14 100644
--- a/drivers/net/tokenring/madgemc.c
+++ b/drivers/net/tokenring/madgemc.c
@@ -28,7 +28,6 @@ static const char version[] = "madgemc.c: v0.91 23/01/2000 by Adam Fritzler\n";
28#include <linux/netdevice.h> 28#include <linux/netdevice.h>
29#include <linux/trdevice.h> 29#include <linux/trdevice.h>
30 30
31#include <asm/system.h>
32#include <asm/io.h> 31#include <asm/io.h>
33#include <asm/irq.h> 32#include <asm/irq.h>
34 33
diff --git a/drivers/net/tokenring/olympic.c b/drivers/net/tokenring/olympic.c
index fd8dce90c95..0e234741cc7 100644
--- a/drivers/net/tokenring/olympic.c
+++ b/drivers/net/tokenring/olympic.c
@@ -106,7 +106,6 @@
106#include <net/net_namespace.h> 106#include <net/net_namespace.h>
107 107
108#include <asm/io.h> 108#include <asm/io.h>
109#include <asm/system.h>
110 109
111#include "olympic.h" 110#include "olympic.h"
112 111
diff --git a/drivers/net/tokenring/proteon.c b/drivers/net/tokenring/proteon.c
index 8d362e64a40..62d90e40f9e 100644
--- a/drivers/net/tokenring/proteon.c
+++ b/drivers/net/tokenring/proteon.c
@@ -31,7 +31,6 @@ static const char version[] = "proteon.c: v1.00 02/01/2003 by Jochen Friedrich\n
31#include <linux/trdevice.h> 31#include <linux/trdevice.h>
32#include <linux/platform_device.h> 32#include <linux/platform_device.h>
33 33
34#include <asm/system.h>
35#include <asm/io.h> 34#include <asm/io.h>
36#include <asm/irq.h> 35#include <asm/irq.h>
37#include <asm/pci.h> 36#include <asm/pci.h>
diff --git a/drivers/net/tokenring/skisa.c b/drivers/net/tokenring/skisa.c
index 46db5c5395b..ee11e93dc30 100644
--- a/drivers/net/tokenring/skisa.c
+++ b/drivers/net/tokenring/skisa.c
@@ -38,7 +38,6 @@ static const char version[] = "skisa.c: v1.03 09/12/2002 by Jochen Friedrich\n";
38#include <linux/trdevice.h> 38#include <linux/trdevice.h>
39#include <linux/platform_device.h> 39#include <linux/platform_device.h>
40 40
41#include <asm/system.h>
42#include <asm/io.h> 41#include <asm/io.h>
43#include <asm/irq.h> 42#include <asm/irq.h>
44#include <asm/pci.h> 43#include <asm/pci.h>
diff --git a/drivers/net/tokenring/smctr.c b/drivers/net/tokenring/smctr.c
index 029846a9863..cb35fb79e01 100644
--- a/drivers/net/tokenring/smctr.c
+++ b/drivers/net/tokenring/smctr.c
@@ -49,7 +49,6 @@
49#include <linux/bitops.h> 49#include <linux/bitops.h>
50#include <linux/firmware.h> 50#include <linux/firmware.h>
51 51
52#include <asm/system.h>
53#include <asm/io.h> 52#include <asm/io.h>
54#include <asm/dma.h> 53#include <asm/dma.h>
55#include <asm/irq.h> 54#include <asm/irq.h>
diff --git a/drivers/net/tokenring/tms380tr.c b/drivers/net/tokenring/tms380tr.c
index 102f896bbc5..be4813e0366 100644
--- a/drivers/net/tokenring/tms380tr.c
+++ b/drivers/net/tokenring/tms380tr.c
@@ -98,7 +98,6 @@ static const char version[] = "tms380tr.c: v1.10 30/12/2002 by Christoph Goos, A
98#include <linux/firmware.h> 98#include <linux/firmware.h>
99#include <linux/bitops.h> 99#include <linux/bitops.h>
100 100
101#include <asm/system.h>
102#include <asm/io.h> 101#include <asm/io.h>
103#include <asm/dma.h> 102#include <asm/dma.h>
104#include <asm/irq.h> 103#include <asm/irq.h>
diff --git a/drivers/net/tokenring/tmspci.c b/drivers/net/tokenring/tmspci.c
index d3e788a9cd1..fb9918da579 100644
--- a/drivers/net/tokenring/tmspci.c
+++ b/drivers/net/tokenring/tmspci.c
@@ -34,7 +34,6 @@
34#include <linux/netdevice.h> 34#include <linux/netdevice.h>
35#include <linux/trdevice.h> 35#include <linux/trdevice.h>
36 36
37#include <asm/system.h>
38#include <asm/io.h> 37#include <asm/io.h>
39#include <asm/irq.h> 38#include <asm/irq.h>
40 39
diff --git a/drivers/net/tun.c b/drivers/net/tun.c
index 74d7f76d14a..bb8c72c79c6 100644
--- a/drivers/net/tun.c
+++ b/drivers/net/tun.c
@@ -69,7 +69,6 @@
69#include <net/rtnetlink.h> 69#include <net/rtnetlink.h>
70#include <net/sock.h> 70#include <net/sock.h>
71 71
72#include <asm/system.h>
73#include <asm/uaccess.h> 72#include <asm/uaccess.h>
74 73
75/* Uncomment to enable debugging */ 74/* Uncomment to enable debugging */
diff --git a/drivers/net/usb/cdc_eem.c b/drivers/net/usb/cdc_eem.c
index 439690be519..685a4e22c76 100644
--- a/drivers/net/usb/cdc_eem.c
+++ b/drivers/net/usb/cdc_eem.c
@@ -93,6 +93,7 @@ static int eem_bind(struct usbnet *dev, struct usb_interface *intf)
93 /* no jumbogram (16K) support for now */ 93 /* no jumbogram (16K) support for now */
94 94
95 dev->net->hard_header_len += EEM_HEAD + ETH_FCS_LEN; 95 dev->net->hard_header_len += EEM_HEAD + ETH_FCS_LEN;
96 dev->hard_mtu = dev->net->mtu + dev->net->hard_header_len;
96 97
97 return 0; 98 return 0;
98} 99}
diff --git a/drivers/net/usb/rtl8150.c b/drivers/net/usb/rtl8150.c
index 6dda2fe5b15..d363b31053d 100644
--- a/drivers/net/usb/rtl8150.c
+++ b/drivers/net/usb/rtl8150.c
@@ -85,32 +85,6 @@
85#define INT_CRERR_CNT 0x06 85#define INT_CRERR_CNT 0x06
86#define INT_COL_CNT 0x07 86#define INT_COL_CNT 0x07
87 87
88/* Transmit status register errors */
89#define TSR_ECOL (1<<5)
90#define TSR_LCOL (1<<4)
91#define TSR_LOSS_CRS (1<<3)
92#define TSR_JBR (1<<2)
93#define TSR_ERRORS (TSR_ECOL | TSR_LCOL | TSR_LOSS_CRS | TSR_JBR)
94/* Receive status register errors */
95#define RSR_CRC (1<<2)
96#define RSR_FAE (1<<1)
97#define RSR_ERRORS (RSR_CRC | RSR_FAE)
98
99/* Media status register definitions */
100#define MSR_DUPLEX (1<<4)
101#define MSR_SPEED (1<<3)
102#define MSR_LINK (1<<2)
103
104/* Interrupt pipe data */
105#define INT_TSR 0x00
106#define INT_RSR 0x01
107#define INT_MSR 0x02
108#define INT_WAKSR 0x03
109#define INT_TXOK_CNT 0x04
110#define INT_RXLOST_CNT 0x05
111#define INT_CRERR_CNT 0x06
112#define INT_COL_CNT 0x07
113
114 88
115#define RTL8150_MTU 1540 89#define RTL8150_MTU 1540
116#define RTL8150_TX_TIMEOUT (HZ) 90#define RTL8150_TX_TIMEOUT (HZ)
diff --git a/drivers/net/wan/Kconfig b/drivers/net/wan/Kconfig
index 423eb26386c..d70ede7a7f9 100644
--- a/drivers/net/wan/Kconfig
+++ b/drivers/net/wan/Kconfig
@@ -290,8 +290,8 @@ config FARSYNC
290 Frame Relay or X.25/LAPB. 290 Frame Relay or X.25/LAPB.
291 291
292 If you want the module to be automatically loaded when the interface 292 If you want the module to be automatically loaded when the interface
293 is referenced then you should add "alias hdlcX farsync" to 293 is referenced then you should add "alias hdlcX farsync" to a file
294 /etc/modprobe.conf for each interface, where X is 0, 1, 2, ..., or 294 in /etc/modprobe.d/ for each interface, where X is 0, 1, 2, ..., or
295 simply use "alias hdlc* farsync" to indicate all of them. 295 simply use "alias hdlc* farsync" to indicate all of them.
296 296
297 To compile this driver as a module, choose M here: the 297 To compile this driver as a module, choose M here: the
diff --git a/drivers/net/wan/dlci.c b/drivers/net/wan/dlci.c
index 48ab38a34c5..147614ed86a 100644
--- a/drivers/net/wan/dlci.c
+++ b/drivers/net/wan/dlci.c
@@ -50,7 +50,6 @@
50 50
51#include <net/sock.h> 51#include <net/sock.h>
52 52
53#include <asm/system.h>
54#include <asm/io.h> 53#include <asm/io.h>
55#include <asm/dma.h> 54#include <asm/dma.h>
56#include <asm/uaccess.h> 55#include <asm/uaccess.h>
diff --git a/drivers/net/wan/dscc4.c b/drivers/net/wan/dscc4.c
index fe8d060d8ff..c676de7de02 100644
--- a/drivers/net/wan/dscc4.c
+++ b/drivers/net/wan/dscc4.c
@@ -93,7 +93,6 @@
93#include <linux/mm.h> 93#include <linux/mm.h>
94#include <linux/slab.h> 94#include <linux/slab.h>
95 95
96#include <asm/system.h>
97#include <asm/cache.h> 96#include <asm/cache.h>
98#include <asm/byteorder.h> 97#include <asm/byteorder.h>
99#include <asm/uaccess.h> 98#include <asm/uaccess.h>
diff --git a/drivers/net/wan/hd64570.c b/drivers/net/wan/hd64570.c
index 33b67d88fce..cf4903355a3 100644
--- a/drivers/net/wan/hd64570.c
+++ b/drivers/net/wan/hd64570.c
@@ -40,7 +40,6 @@
40#include <linux/string.h> 40#include <linux/string.h>
41#include <linux/types.h> 41#include <linux/types.h>
42#include <asm/io.h> 42#include <asm/io.h>
43#include <asm/system.h>
44#include <asm/uaccess.h> 43#include <asm/uaccess.h>
45#include "hd64570.h" 44#include "hd64570.h"
46 45
diff --git a/drivers/net/wan/hd64572.c b/drivers/net/wan/hd64572.c
index efc0db10118..e2779faa6c4 100644
--- a/drivers/net/wan/hd64572.c
+++ b/drivers/net/wan/hd64572.c
@@ -40,7 +40,6 @@
40#include <linux/string.h> 40#include <linux/string.h>
41#include <linux/types.h> 41#include <linux/types.h>
42#include <asm/io.h> 42#include <asm/io.h>
43#include <asm/system.h>
44#include <asm/uaccess.h> 43#include <asm/uaccess.h>
45#include "hd64572.h" 44#include "hd64572.h"
46 45
diff --git a/drivers/net/wan/lapbether.c b/drivers/net/wan/lapbether.c
index 7beeb9b88a3..a73b49eb87e 100644
--- a/drivers/net/wan/lapbether.c
+++ b/drivers/net/wan/lapbether.c
@@ -35,7 +35,6 @@
35#include <linux/if_arp.h> 35#include <linux/if_arp.h>
36#include <linux/skbuff.h> 36#include <linux/skbuff.h>
37#include <net/sock.h> 37#include <net/sock.h>
38#include <asm/system.h>
39#include <asm/uaccess.h> 38#include <asm/uaccess.h>
40#include <linux/mm.h> 39#include <linux/mm.h>
41#include <linux/interrupt.h> 40#include <linux/interrupt.h>
diff --git a/drivers/net/wan/sdla.c b/drivers/net/wan/sdla.c
index c8531612eea..de3bbf43fc5 100644
--- a/drivers/net/wan/sdla.c
+++ b/drivers/net/wan/sdla.c
@@ -54,7 +54,6 @@
54#include <linux/sdla.h> 54#include <linux/sdla.h>
55#include <linux/bitops.h> 55#include <linux/bitops.h>
56 56
57#include <asm/system.h>
58#include <asm/io.h> 57#include <asm/io.h>
59#include <asm/dma.h> 58#include <asm/dma.h>
60#include <asm/uaccess.h> 59#include <asm/uaccess.h>
diff --git a/drivers/net/wan/x25_asy.c b/drivers/net/wan/x25_asy.c
index e862369b4a6..d7a65e141d1 100644
--- a/drivers/net/wan/x25_asy.c
+++ b/drivers/net/wan/x25_asy.c
@@ -18,7 +18,6 @@
18 18
19#include <linux/module.h> 19#include <linux/module.h>
20 20
21#include <asm/system.h>
22#include <linux/uaccess.h> 21#include <linux/uaccess.h>
23#include <linux/bitops.h> 22#include <linux/bitops.h>
24#include <linux/string.h> 23#include <linux/string.h>
diff --git a/drivers/net/wimax/i2400m/debugfs.c b/drivers/net/wimax/i2400m/debugfs.c
index 129ba36bd04..4b66ab1d0e5 100644
--- a/drivers/net/wimax/i2400m/debugfs.c
+++ b/drivers/net/wimax/i2400m/debugfs.c
@@ -53,17 +53,6 @@ struct dentry *debugfs_create_netdev_queue_stopped(
53 &fops_netdev_queue_stopped); 53 &fops_netdev_queue_stopped);
54} 54}
55 55
56
57/*
58 * inode->i_private has the @data argument to debugfs_create_file()
59 */
60static
61int i2400m_stats_open(struct inode *inode, struct file *filp)
62{
63 filp->private_data = inode->i_private;
64 return 0;
65}
66
67/* 56/*
68 * We don't allow partial reads of this file, as then the reader would 57 * We don't allow partial reads of this file, as then the reader would
69 * get weirdly confused data as it is updated. 58 * get weirdly confused data as it is updated.
@@ -117,7 +106,7 @@ ssize_t i2400m_rx_stats_write(struct file *filp, const char __user *buffer,
117static 106static
118const struct file_operations i2400m_rx_stats_fops = { 107const struct file_operations i2400m_rx_stats_fops = {
119 .owner = THIS_MODULE, 108 .owner = THIS_MODULE,
120 .open = i2400m_stats_open, 109 .open = simple_open,
121 .read = i2400m_rx_stats_read, 110 .read = i2400m_rx_stats_read,
122 .write = i2400m_rx_stats_write, 111 .write = i2400m_rx_stats_write,
123 .llseek = default_llseek, 112 .llseek = default_llseek,
@@ -170,7 +159,7 @@ ssize_t i2400m_tx_stats_write(struct file *filp, const char __user *buffer,
170static 159static
171const struct file_operations i2400m_tx_stats_fops = { 160const struct file_operations i2400m_tx_stats_fops = {
172 .owner = THIS_MODULE, 161 .owner = THIS_MODULE,
173 .open = i2400m_stats_open, 162 .open = simple_open,
174 .read = i2400m_tx_stats_read, 163 .read = i2400m_tx_stats_read,
175 .write = i2400m_tx_stats_write, 164 .write = i2400m_tx_stats_write,
176 .llseek = default_llseek, 165 .llseek = default_llseek,
diff --git a/drivers/net/wireless/airo.c b/drivers/net/wireless/airo.c
index ddc061dd150..520a4b2eb9c 100644
--- a/drivers/net/wireless/airo.c
+++ b/drivers/net/wireless/airo.c
@@ -37,7 +37,6 @@
37#include <linux/scatterlist.h> 37#include <linux/scatterlist.h>
38#include <linux/crypto.h> 38#include <linux/crypto.h>
39#include <asm/io.h> 39#include <asm/io.h>
40#include <asm/system.h>
41#include <asm/unaligned.h> 40#include <asm/unaligned.h>
42 41
43#include <linux/netdevice.h> 42#include <linux/netdevice.h>
diff --git a/drivers/net/wireless/airo_cs.c b/drivers/net/wireless/airo_cs.c
index c983c10e0f6..630577dd3a7 100644
--- a/drivers/net/wireless/airo_cs.c
+++ b/drivers/net/wireless/airo_cs.c
@@ -37,7 +37,6 @@
37#include <pcmcia/ds.h> 37#include <pcmcia/ds.h>
38 38
39#include <linux/io.h> 39#include <linux/io.h>
40#include <asm/system.h>
41 40
42#include "airo.h" 41#include "airo.h"
43 42
diff --git a/drivers/net/wireless/ath/ath5k/debug.c b/drivers/net/wireless/ath/ath5k/debug.c
index 8c5ce8b0c73..e5e8f45d86a 100644
--- a/drivers/net/wireless/ath/ath5k/debug.c
+++ b/drivers/net/wireless/ath/ath5k/debug.c
@@ -71,13 +71,6 @@ static unsigned int ath5k_debug;
71module_param_named(debug, ath5k_debug, uint, 0); 71module_param_named(debug, ath5k_debug, uint, 0);
72 72
73 73
74static int ath5k_debugfs_open(struct inode *inode, struct file *file)
75{
76 file->private_data = inode->i_private;
77 return 0;
78}
79
80
81/* debugfs: registers */ 74/* debugfs: registers */
82 75
83struct reg { 76struct reg {
@@ -265,7 +258,7 @@ static ssize_t write_file_beacon(struct file *file,
265static const struct file_operations fops_beacon = { 258static const struct file_operations fops_beacon = {
266 .read = read_file_beacon, 259 .read = read_file_beacon,
267 .write = write_file_beacon, 260 .write = write_file_beacon,
268 .open = ath5k_debugfs_open, 261 .open = simple_open,
269 .owner = THIS_MODULE, 262 .owner = THIS_MODULE,
270 .llseek = default_llseek, 263 .llseek = default_llseek,
271}; 264};
@@ -285,7 +278,7 @@ static ssize_t write_file_reset(struct file *file,
285 278
286static const struct file_operations fops_reset = { 279static const struct file_operations fops_reset = {
287 .write = write_file_reset, 280 .write = write_file_reset,
288 .open = ath5k_debugfs_open, 281 .open = simple_open,
289 .owner = THIS_MODULE, 282 .owner = THIS_MODULE,
290 .llseek = noop_llseek, 283 .llseek = noop_llseek,
291}; 284};
@@ -365,7 +358,7 @@ static ssize_t write_file_debug(struct file *file,
365static const struct file_operations fops_debug = { 358static const struct file_operations fops_debug = {
366 .read = read_file_debug, 359 .read = read_file_debug,
367 .write = write_file_debug, 360 .write = write_file_debug,
368 .open = ath5k_debugfs_open, 361 .open = simple_open,
369 .owner = THIS_MODULE, 362 .owner = THIS_MODULE,
370 .llseek = default_llseek, 363 .llseek = default_llseek,
371}; 364};
@@ -477,7 +470,7 @@ static ssize_t write_file_antenna(struct file *file,
477static const struct file_operations fops_antenna = { 470static const struct file_operations fops_antenna = {
478 .read = read_file_antenna, 471 .read = read_file_antenna,
479 .write = write_file_antenna, 472 .write = write_file_antenna,
480 .open = ath5k_debugfs_open, 473 .open = simple_open,
481 .owner = THIS_MODULE, 474 .owner = THIS_MODULE,
482 .llseek = default_llseek, 475 .llseek = default_llseek,
483}; 476};
@@ -532,7 +525,7 @@ static ssize_t read_file_misc(struct file *file, char __user *user_buf,
532 525
533static const struct file_operations fops_misc = { 526static const struct file_operations fops_misc = {
534 .read = read_file_misc, 527 .read = read_file_misc,
535 .open = ath5k_debugfs_open, 528 .open = simple_open,
536 .owner = THIS_MODULE, 529 .owner = THIS_MODULE,
537}; 530};
538 531
@@ -647,7 +640,7 @@ static ssize_t write_file_frameerrors(struct file *file,
647static const struct file_operations fops_frameerrors = { 640static const struct file_operations fops_frameerrors = {
648 .read = read_file_frameerrors, 641 .read = read_file_frameerrors,
649 .write = write_file_frameerrors, 642 .write = write_file_frameerrors,
650 .open = ath5k_debugfs_open, 643 .open = simple_open,
651 .owner = THIS_MODULE, 644 .owner = THIS_MODULE,
652 .llseek = default_llseek, 645 .llseek = default_llseek,
653}; 646};
@@ -810,7 +803,7 @@ static ssize_t write_file_ani(struct file *file,
810static const struct file_operations fops_ani = { 803static const struct file_operations fops_ani = {
811 .read = read_file_ani, 804 .read = read_file_ani,
812 .write = write_file_ani, 805 .write = write_file_ani,
813 .open = ath5k_debugfs_open, 806 .open = simple_open,
814 .owner = THIS_MODULE, 807 .owner = THIS_MODULE,
815 .llseek = default_llseek, 808 .llseek = default_llseek,
816}; 809};
@@ -881,7 +874,7 @@ static ssize_t write_file_queue(struct file *file,
881static const struct file_operations fops_queue = { 874static const struct file_operations fops_queue = {
882 .read = read_file_queue, 875 .read = read_file_queue,
883 .write = write_file_queue, 876 .write = write_file_queue,
884 .open = ath5k_debugfs_open, 877 .open = simple_open,
885 .owner = THIS_MODULE, 878 .owner = THIS_MODULE,
886 .llseek = default_llseek, 879 .llseek = default_llseek,
887}; 880};
diff --git a/drivers/net/wireless/ath/ath6kl/debug.c b/drivers/net/wireless/ath/ath6kl/debug.c
index 552adb3f80d..d01403a263f 100644
--- a/drivers/net/wireless/ath/ath6kl/debug.c
+++ b/drivers/net/wireless/ath/ath6kl/debug.c
@@ -217,12 +217,6 @@ void dump_cred_dist_stats(struct htc_target *target)
217 target->credit_info->cur_free_credits); 217 target->credit_info->cur_free_credits);
218} 218}
219 219
220static int ath6kl_debugfs_open(struct inode *inode, struct file *file)
221{
222 file->private_data = inode->i_private;
223 return 0;
224}
225
226void ath6kl_debug_war(struct ath6kl *ar, enum ath6kl_war war) 220void ath6kl_debug_war(struct ath6kl *ar, enum ath6kl_war war)
227{ 221{
228 switch (war) { 222 switch (war) {
@@ -263,7 +257,7 @@ static ssize_t read_file_war_stats(struct file *file, char __user *user_buf,
263 257
264static const struct file_operations fops_war_stats = { 258static const struct file_operations fops_war_stats = {
265 .read = read_file_war_stats, 259 .read = read_file_war_stats,
266 .open = ath6kl_debugfs_open, 260 .open = simple_open,
267 .owner = THIS_MODULE, 261 .owner = THIS_MODULE,
268 .llseek = default_llseek, 262 .llseek = default_llseek,
269}; 263};
@@ -488,7 +482,7 @@ static ssize_t ath6kl_fwlog_mask_write(struct file *file,
488} 482}
489 483
490static const struct file_operations fops_fwlog_mask = { 484static const struct file_operations fops_fwlog_mask = {
491 .open = ath6kl_debugfs_open, 485 .open = simple_open,
492 .read = ath6kl_fwlog_mask_read, 486 .read = ath6kl_fwlog_mask_read,
493 .write = ath6kl_fwlog_mask_write, 487 .write = ath6kl_fwlog_mask_write,
494 .owner = THIS_MODULE, 488 .owner = THIS_MODULE,
@@ -634,7 +628,7 @@ static ssize_t read_file_tgt_stats(struct file *file, char __user *user_buf,
634 628
635static const struct file_operations fops_tgt_stats = { 629static const struct file_operations fops_tgt_stats = {
636 .read = read_file_tgt_stats, 630 .read = read_file_tgt_stats,
637 .open = ath6kl_debugfs_open, 631 .open = simple_open,
638 .owner = THIS_MODULE, 632 .owner = THIS_MODULE,
639 .llseek = default_llseek, 633 .llseek = default_llseek,
640}; 634};
@@ -699,7 +693,7 @@ static ssize_t read_file_credit_dist_stats(struct file *file,
699 693
700static const struct file_operations fops_credit_dist_stats = { 694static const struct file_operations fops_credit_dist_stats = {
701 .read = read_file_credit_dist_stats, 695 .read = read_file_credit_dist_stats,
702 .open = ath6kl_debugfs_open, 696 .open = simple_open,
703 .owner = THIS_MODULE, 697 .owner = THIS_MODULE,
704 .llseek = default_llseek, 698 .llseek = default_llseek,
705}; 699};
@@ -802,7 +796,7 @@ static ssize_t ath6kl_endpoint_stats_write(struct file *file,
802} 796}
803 797
804static const struct file_operations fops_endpoint_stats = { 798static const struct file_operations fops_endpoint_stats = {
805 .open = ath6kl_debugfs_open, 799 .open = simple_open,
806 .read = ath6kl_endpoint_stats_read, 800 .read = ath6kl_endpoint_stats_read,
807 .write = ath6kl_endpoint_stats_write, 801 .write = ath6kl_endpoint_stats_write,
808 .owner = THIS_MODULE, 802 .owner = THIS_MODULE,
@@ -875,7 +869,7 @@ static ssize_t ath6kl_regread_write(struct file *file,
875static const struct file_operations fops_diag_reg_read = { 869static const struct file_operations fops_diag_reg_read = {
876 .read = ath6kl_regread_read, 870 .read = ath6kl_regread_read,
877 .write = ath6kl_regread_write, 871 .write = ath6kl_regread_write,
878 .open = ath6kl_debugfs_open, 872 .open = simple_open,
879 .owner = THIS_MODULE, 873 .owner = THIS_MODULE,
880 .llseek = default_llseek, 874 .llseek = default_llseek,
881}; 875};
@@ -999,7 +993,7 @@ static ssize_t ath6kl_lrssi_roam_read(struct file *file,
999static const struct file_operations fops_lrssi_roam_threshold = { 993static const struct file_operations fops_lrssi_roam_threshold = {
1000 .read = ath6kl_lrssi_roam_read, 994 .read = ath6kl_lrssi_roam_read,
1001 .write = ath6kl_lrssi_roam_write, 995 .write = ath6kl_lrssi_roam_write,
1002 .open = ath6kl_debugfs_open, 996 .open = simple_open,
1003 .owner = THIS_MODULE, 997 .owner = THIS_MODULE,
1004 .llseek = default_llseek, 998 .llseek = default_llseek,
1005}; 999};
@@ -1061,7 +1055,7 @@ static ssize_t ath6kl_regwrite_write(struct file *file,
1061static const struct file_operations fops_diag_reg_write = { 1055static const struct file_operations fops_diag_reg_write = {
1062 .read = ath6kl_regwrite_read, 1056 .read = ath6kl_regwrite_read,
1063 .write = ath6kl_regwrite_write, 1057 .write = ath6kl_regwrite_write,
1064 .open = ath6kl_debugfs_open, 1058 .open = simple_open,
1065 .owner = THIS_MODULE, 1059 .owner = THIS_MODULE,
1066 .llseek = default_llseek, 1060 .llseek = default_llseek,
1067}; 1061};
@@ -1166,7 +1160,7 @@ static ssize_t ath6kl_roam_table_read(struct file *file, char __user *user_buf,
1166 1160
1167static const struct file_operations fops_roam_table = { 1161static const struct file_operations fops_roam_table = {
1168 .read = ath6kl_roam_table_read, 1162 .read = ath6kl_roam_table_read,
1169 .open = ath6kl_debugfs_open, 1163 .open = simple_open,
1170 .owner = THIS_MODULE, 1164 .owner = THIS_MODULE,
1171 .llseek = default_llseek, 1165 .llseek = default_llseek,
1172}; 1166};
@@ -1204,7 +1198,7 @@ static ssize_t ath6kl_force_roam_write(struct file *file,
1204 1198
1205static const struct file_operations fops_force_roam = { 1199static const struct file_operations fops_force_roam = {
1206 .write = ath6kl_force_roam_write, 1200 .write = ath6kl_force_roam_write,
1207 .open = ath6kl_debugfs_open, 1201 .open = simple_open,
1208 .owner = THIS_MODULE, 1202 .owner = THIS_MODULE,
1209 .llseek = default_llseek, 1203 .llseek = default_llseek,
1210}; 1204};
@@ -1244,7 +1238,7 @@ static ssize_t ath6kl_roam_mode_write(struct file *file,
1244 1238
1245static const struct file_operations fops_roam_mode = { 1239static const struct file_operations fops_roam_mode = {
1246 .write = ath6kl_roam_mode_write, 1240 .write = ath6kl_roam_mode_write,
1247 .open = ath6kl_debugfs_open, 1241 .open = simple_open,
1248 .owner = THIS_MODULE, 1242 .owner = THIS_MODULE,
1249 .llseek = default_llseek, 1243 .llseek = default_llseek,
1250}; 1244};
@@ -1286,7 +1280,7 @@ static ssize_t ath6kl_keepalive_write(struct file *file,
1286} 1280}
1287 1281
1288static const struct file_operations fops_keepalive = { 1282static const struct file_operations fops_keepalive = {
1289 .open = ath6kl_debugfs_open, 1283 .open = simple_open,
1290 .read = ath6kl_keepalive_read, 1284 .read = ath6kl_keepalive_read,
1291 .write = ath6kl_keepalive_write, 1285 .write = ath6kl_keepalive_write,
1292 .owner = THIS_MODULE, 1286 .owner = THIS_MODULE,
@@ -1331,7 +1325,7 @@ static ssize_t ath6kl_disconnect_timeout_write(struct file *file,
1331} 1325}
1332 1326
1333static const struct file_operations fops_disconnect_timeout = { 1327static const struct file_operations fops_disconnect_timeout = {
1334 .open = ath6kl_debugfs_open, 1328 .open = simple_open,
1335 .read = ath6kl_disconnect_timeout_read, 1329 .read = ath6kl_disconnect_timeout_read,
1336 .write = ath6kl_disconnect_timeout_write, 1330 .write = ath6kl_disconnect_timeout_write,
1337 .owner = THIS_MODULE, 1331 .owner = THIS_MODULE,
@@ -1512,7 +1506,7 @@ static ssize_t ath6kl_create_qos_write(struct file *file,
1512 1506
1513static const struct file_operations fops_create_qos = { 1507static const struct file_operations fops_create_qos = {
1514 .write = ath6kl_create_qos_write, 1508 .write = ath6kl_create_qos_write,
1515 .open = ath6kl_debugfs_open, 1509 .open = simple_open,
1516 .owner = THIS_MODULE, 1510 .owner = THIS_MODULE,
1517 .llseek = default_llseek, 1511 .llseek = default_llseek,
1518}; 1512};
@@ -1560,7 +1554,7 @@ static ssize_t ath6kl_delete_qos_write(struct file *file,
1560 1554
1561static const struct file_operations fops_delete_qos = { 1555static const struct file_operations fops_delete_qos = {
1562 .write = ath6kl_delete_qos_write, 1556 .write = ath6kl_delete_qos_write,
1563 .open = ath6kl_debugfs_open, 1557 .open = simple_open,
1564 .owner = THIS_MODULE, 1558 .owner = THIS_MODULE,
1565 .llseek = default_llseek, 1559 .llseek = default_llseek,
1566}; 1560};
@@ -1593,7 +1587,7 @@ static ssize_t ath6kl_bgscan_int_write(struct file *file,
1593 1587
1594static const struct file_operations fops_bgscan_int = { 1588static const struct file_operations fops_bgscan_int = {
1595 .write = ath6kl_bgscan_int_write, 1589 .write = ath6kl_bgscan_int_write,
1596 .open = ath6kl_debugfs_open, 1590 .open = simple_open,
1597 .owner = THIS_MODULE, 1591 .owner = THIS_MODULE,
1598 .llseek = default_llseek, 1592 .llseek = default_llseek,
1599}; 1593};
@@ -1651,7 +1645,7 @@ static ssize_t ath6kl_listen_int_read(struct file *file,
1651static const struct file_operations fops_listen_int = { 1645static const struct file_operations fops_listen_int = {
1652 .read = ath6kl_listen_int_read, 1646 .read = ath6kl_listen_int_read,
1653 .write = ath6kl_listen_int_write, 1647 .write = ath6kl_listen_int_write,
1654 .open = ath6kl_debugfs_open, 1648 .open = simple_open,
1655 .owner = THIS_MODULE, 1649 .owner = THIS_MODULE,
1656 .llseek = default_llseek, 1650 .llseek = default_llseek,
1657}; 1651};
@@ -1711,7 +1705,7 @@ static ssize_t ath6kl_power_params_write(struct file *file,
1711 1705
1712static const struct file_operations fops_power_params = { 1706static const struct file_operations fops_power_params = {
1713 .write = ath6kl_power_params_write, 1707 .write = ath6kl_power_params_write,
1714 .open = ath6kl_debugfs_open, 1708 .open = simple_open,
1715 .owner = THIS_MODULE, 1709 .owner = THIS_MODULE,
1716 .llseek = default_llseek, 1710 .llseek = default_llseek,
1717}; 1711};
diff --git a/drivers/net/wireless/ath/ath9k/debug.c b/drivers/net/wireless/ath/ath9k/debug.c
index 35d1c8e91d1..ff47b32ecaf 100644
--- a/drivers/net/wireless/ath/ath9k/debug.c
+++ b/drivers/net/wireless/ath/ath9k/debug.c
@@ -26,11 +26,6 @@
26#define REG_READ_D(_ah, _reg) \ 26#define REG_READ_D(_ah, _reg) \
27 ath9k_hw_common(_ah)->ops->read((_ah), (_reg)) 27 ath9k_hw_common(_ah)->ops->read((_ah), (_reg))
28 28
29static int ath9k_debugfs_open(struct inode *inode, struct file *file)
30{
31 file->private_data = inode->i_private;
32 return 0;
33}
34 29
35static ssize_t ath9k_debugfs_read_buf(struct file *file, char __user *user_buf, 30static ssize_t ath9k_debugfs_read_buf(struct file *file, char __user *user_buf,
36 size_t count, loff_t *ppos) 31 size_t count, loff_t *ppos)
@@ -83,7 +78,7 @@ static ssize_t write_file_debug(struct file *file, const char __user *user_buf,
83static const struct file_operations fops_debug = { 78static const struct file_operations fops_debug = {
84 .read = read_file_debug, 79 .read = read_file_debug,
85 .write = write_file_debug, 80 .write = write_file_debug,
86 .open = ath9k_debugfs_open, 81 .open = simple_open,
87 .owner = THIS_MODULE, 82 .owner = THIS_MODULE,
88 .llseek = default_llseek, 83 .llseek = default_llseek,
89}; 84};
@@ -129,7 +124,7 @@ static ssize_t write_file_tx_chainmask(struct file *file, const char __user *use
129static const struct file_operations fops_tx_chainmask = { 124static const struct file_operations fops_tx_chainmask = {
130 .read = read_file_tx_chainmask, 125 .read = read_file_tx_chainmask,
131 .write = write_file_tx_chainmask, 126 .write = write_file_tx_chainmask,
132 .open = ath9k_debugfs_open, 127 .open = simple_open,
133 .owner = THIS_MODULE, 128 .owner = THIS_MODULE,
134 .llseek = default_llseek, 129 .llseek = default_llseek,
135}; 130};
@@ -172,7 +167,7 @@ static ssize_t write_file_rx_chainmask(struct file *file, const char __user *use
172static const struct file_operations fops_rx_chainmask = { 167static const struct file_operations fops_rx_chainmask = {
173 .read = read_file_rx_chainmask, 168 .read = read_file_rx_chainmask,
174 .write = write_file_rx_chainmask, 169 .write = write_file_rx_chainmask,
175 .open = ath9k_debugfs_open, 170 .open = simple_open,
176 .owner = THIS_MODULE, 171 .owner = THIS_MODULE,
177 .llseek = default_llseek, 172 .llseek = default_llseek,
178}; 173};
@@ -223,7 +218,7 @@ static ssize_t write_file_disable_ani(struct file *file,
223static const struct file_operations fops_disable_ani = { 218static const struct file_operations fops_disable_ani = {
224 .read = read_file_disable_ani, 219 .read = read_file_disable_ani,
225 .write = write_file_disable_ani, 220 .write = write_file_disable_ani,
226 .open = ath9k_debugfs_open, 221 .open = simple_open,
227 .owner = THIS_MODULE, 222 .owner = THIS_MODULE,
228 .llseek = default_llseek, 223 .llseek = default_llseek,
229}; 224};
@@ -324,7 +319,7 @@ static ssize_t read_file_dma(struct file *file, char __user *user_buf,
324 319
325static const struct file_operations fops_dma = { 320static const struct file_operations fops_dma = {
326 .read = read_file_dma, 321 .read = read_file_dma,
327 .open = ath9k_debugfs_open, 322 .open = simple_open,
328 .owner = THIS_MODULE, 323 .owner = THIS_MODULE,
329 .llseek = default_llseek, 324 .llseek = default_llseek,
330}; 325};
@@ -446,7 +441,7 @@ static ssize_t read_file_interrupt(struct file *file, char __user *user_buf,
446 441
447static const struct file_operations fops_interrupt = { 442static const struct file_operations fops_interrupt = {
448 .read = read_file_interrupt, 443 .read = read_file_interrupt,
449 .open = ath9k_debugfs_open, 444 .open = simple_open,
450 .owner = THIS_MODULE, 445 .owner = THIS_MODULE,
451 .llseek = default_llseek, 446 .llseek = default_llseek,
452}; 447};
@@ -852,28 +847,28 @@ void ath_debug_stat_tx(struct ath_softc *sc, struct ath_buf *bf,
852 847
853static const struct file_operations fops_xmit = { 848static const struct file_operations fops_xmit = {
854 .read = read_file_xmit, 849 .read = read_file_xmit,
855 .open = ath9k_debugfs_open, 850 .open = simple_open,
856 .owner = THIS_MODULE, 851 .owner = THIS_MODULE,
857 .llseek = default_llseek, 852 .llseek = default_llseek,
858}; 853};
859 854
860static const struct file_operations fops_stations = { 855static const struct file_operations fops_stations = {
861 .read = read_file_stations, 856 .read = read_file_stations,
862 .open = ath9k_debugfs_open, 857 .open = simple_open,
863 .owner = THIS_MODULE, 858 .owner = THIS_MODULE,
864 .llseek = default_llseek, 859 .llseek = default_llseek,
865}; 860};
866 861
867static const struct file_operations fops_misc = { 862static const struct file_operations fops_misc = {
868 .read = read_file_misc, 863 .read = read_file_misc,
869 .open = ath9k_debugfs_open, 864 .open = simple_open,
870 .owner = THIS_MODULE, 865 .owner = THIS_MODULE,
871 .llseek = default_llseek, 866 .llseek = default_llseek,
872}; 867};
873 868
874static const struct file_operations fops_reset = { 869static const struct file_operations fops_reset = {
875 .read = read_file_reset, 870 .read = read_file_reset,
876 .open = ath9k_debugfs_open, 871 .open = simple_open,
877 .owner = THIS_MODULE, 872 .owner = THIS_MODULE,
878 .llseek = default_llseek, 873 .llseek = default_llseek,
879}; 874};
@@ -1016,7 +1011,7 @@ void ath_debug_stat_rx(struct ath_softc *sc, struct ath_rx_status *rs)
1016 1011
1017static const struct file_operations fops_recv = { 1012static const struct file_operations fops_recv = {
1018 .read = read_file_recv, 1013 .read = read_file_recv,
1019 .open = ath9k_debugfs_open, 1014 .open = simple_open,
1020 .owner = THIS_MODULE, 1015 .owner = THIS_MODULE,
1021 .llseek = default_llseek, 1016 .llseek = default_llseek,
1022}; 1017};
@@ -1055,7 +1050,7 @@ static ssize_t write_file_regidx(struct file *file, const char __user *user_buf,
1055static const struct file_operations fops_regidx = { 1050static const struct file_operations fops_regidx = {
1056 .read = read_file_regidx, 1051 .read = read_file_regidx,
1057 .write = write_file_regidx, 1052 .write = write_file_regidx,
1058 .open = ath9k_debugfs_open, 1053 .open = simple_open,
1059 .owner = THIS_MODULE, 1054 .owner = THIS_MODULE,
1060 .llseek = default_llseek, 1055 .llseek = default_llseek,
1061}; 1056};
@@ -1102,7 +1097,7 @@ static ssize_t write_file_regval(struct file *file, const char __user *user_buf,
1102static const struct file_operations fops_regval = { 1097static const struct file_operations fops_regval = {
1103 .read = read_file_regval, 1098 .read = read_file_regval,
1104 .write = write_file_regval, 1099 .write = write_file_regval,
1105 .open = ath9k_debugfs_open, 1100 .open = simple_open,
1106 .owner = THIS_MODULE, 1101 .owner = THIS_MODULE,
1107 .llseek = default_llseek, 1102 .llseek = default_llseek,
1108}; 1103};
@@ -1191,7 +1186,7 @@ static ssize_t read_file_dump_nfcal(struct file *file, char __user *user_buf,
1191 1186
1192static const struct file_operations fops_dump_nfcal = { 1187static const struct file_operations fops_dump_nfcal = {
1193 .read = read_file_dump_nfcal, 1188 .read = read_file_dump_nfcal,
1194 .open = ath9k_debugfs_open, 1189 .open = simple_open,
1195 .owner = THIS_MODULE, 1190 .owner = THIS_MODULE,
1196 .llseek = default_llseek, 1191 .llseek = default_llseek,
1197}; 1192};
@@ -1219,7 +1214,7 @@ static ssize_t read_file_base_eeprom(struct file *file, char __user *user_buf,
1219 1214
1220static const struct file_operations fops_base_eeprom = { 1215static const struct file_operations fops_base_eeprom = {
1221 .read = read_file_base_eeprom, 1216 .read = read_file_base_eeprom,
1222 .open = ath9k_debugfs_open, 1217 .open = simple_open,
1223 .owner = THIS_MODULE, 1218 .owner = THIS_MODULE,
1224 .llseek = default_llseek, 1219 .llseek = default_llseek,
1225}; 1220};
@@ -1247,7 +1242,7 @@ static ssize_t read_file_modal_eeprom(struct file *file, char __user *user_buf,
1247 1242
1248static const struct file_operations fops_modal_eeprom = { 1243static const struct file_operations fops_modal_eeprom = {
1249 .read = read_file_modal_eeprom, 1244 .read = read_file_modal_eeprom,
1250 .open = ath9k_debugfs_open, 1245 .open = simple_open,
1251 .owner = THIS_MODULE, 1246 .owner = THIS_MODULE,
1252 .llseek = default_llseek, 1247 .llseek = default_llseek,
1253}; 1248};
diff --git a/drivers/net/wireless/ath/ath9k/dfs_debug.c b/drivers/net/wireless/ath/ath9k/dfs_debug.c
index 106d031d834..4364c103ed3 100644
--- a/drivers/net/wireless/ath/ath9k/dfs_debug.c
+++ b/drivers/net/wireless/ath/ath9k/dfs_debug.c
@@ -60,16 +60,9 @@ static ssize_t read_file_dfs(struct file *file, char __user *user_buf,
60 return retval; 60 return retval;
61} 61}
62 62
63static int ath9k_dfs_debugfs_open(struct inode *inode, struct file *file)
64{
65 file->private_data = inode->i_private;
66
67 return 0;
68}
69
70static const struct file_operations fops_dfs_stats = { 63static const struct file_operations fops_dfs_stats = {
71 .read = read_file_dfs, 64 .read = read_file_dfs,
72 .open = ath9k_dfs_debugfs_open, 65 .open = simple_open,
73 .owner = THIS_MODULE, 66 .owner = THIS_MODULE,
74 .llseek = default_llseek, 67 .llseek = default_llseek,
75}; 68};
diff --git a/drivers/net/wireless/ath/ath9k/htc_drv_debug.c b/drivers/net/wireless/ath/ath9k/htc_drv_debug.c
index d3ff33c71aa..3035deb7a0c 100644
--- a/drivers/net/wireless/ath/ath9k/htc_drv_debug.c
+++ b/drivers/net/wireless/ath/ath9k/htc_drv_debug.c
@@ -16,12 +16,6 @@
16 16
17#include "htc.h" 17#include "htc.h"
18 18
19static int ath9k_debugfs_open(struct inode *inode, struct file *file)
20{
21 file->private_data = inode->i_private;
22 return 0;
23}
24
25static ssize_t read_file_tgt_int_stats(struct file *file, char __user *user_buf, 19static ssize_t read_file_tgt_int_stats(struct file *file, char __user *user_buf,
26 size_t count, loff_t *ppos) 20 size_t count, loff_t *ppos)
27{ 21{
@@ -75,7 +69,7 @@ static ssize_t read_file_tgt_int_stats(struct file *file, char __user *user_buf,
75 69
76static const struct file_operations fops_tgt_int_stats = { 70static const struct file_operations fops_tgt_int_stats = {
77 .read = read_file_tgt_int_stats, 71 .read = read_file_tgt_int_stats,
78 .open = ath9k_debugfs_open, 72 .open = simple_open,
79 .owner = THIS_MODULE, 73 .owner = THIS_MODULE,
80 .llseek = default_llseek, 74 .llseek = default_llseek,
81}; 75};
@@ -145,7 +139,7 @@ static ssize_t read_file_tgt_tx_stats(struct file *file, char __user *user_buf,
145 139
146static const struct file_operations fops_tgt_tx_stats = { 140static const struct file_operations fops_tgt_tx_stats = {
147 .read = read_file_tgt_tx_stats, 141 .read = read_file_tgt_tx_stats,
148 .open = ath9k_debugfs_open, 142 .open = simple_open,
149 .owner = THIS_MODULE, 143 .owner = THIS_MODULE,
150 .llseek = default_llseek, 144 .llseek = default_llseek,
151}; 145};
@@ -191,7 +185,7 @@ static ssize_t read_file_tgt_rx_stats(struct file *file, char __user *user_buf,
191 185
192static const struct file_operations fops_tgt_rx_stats = { 186static const struct file_operations fops_tgt_rx_stats = {
193 .read = read_file_tgt_rx_stats, 187 .read = read_file_tgt_rx_stats,
194 .open = ath9k_debugfs_open, 188 .open = simple_open,
195 .owner = THIS_MODULE, 189 .owner = THIS_MODULE,
196 .llseek = default_llseek, 190 .llseek = default_llseek,
197}; 191};
@@ -243,7 +237,7 @@ static ssize_t read_file_xmit(struct file *file, char __user *user_buf,
243 237
244static const struct file_operations fops_xmit = { 238static const struct file_operations fops_xmit = {
245 .read = read_file_xmit, 239 .read = read_file_xmit,
246 .open = ath9k_debugfs_open, 240 .open = simple_open,
247 .owner = THIS_MODULE, 241 .owner = THIS_MODULE,
248 .llseek = default_llseek, 242 .llseek = default_llseek,
249}; 243};
@@ -364,7 +358,7 @@ static ssize_t read_file_recv(struct file *file, char __user *user_buf,
364 358
365static const struct file_operations fops_recv = { 359static const struct file_operations fops_recv = {
366 .read = read_file_recv, 360 .read = read_file_recv,
367 .open = ath9k_debugfs_open, 361 .open = simple_open,
368 .owner = THIS_MODULE, 362 .owner = THIS_MODULE,
369 .llseek = default_llseek, 363 .llseek = default_llseek,
370}; 364};
@@ -399,7 +393,7 @@ static ssize_t read_file_slot(struct file *file, char __user *user_buf,
399 393
400static const struct file_operations fops_slot = { 394static const struct file_operations fops_slot = {
401 .read = read_file_slot, 395 .read = read_file_slot,
402 .open = ath9k_debugfs_open, 396 .open = simple_open,
403 .owner = THIS_MODULE, 397 .owner = THIS_MODULE,
404 .llseek = default_llseek, 398 .llseek = default_llseek,
405}; 399};
@@ -446,7 +440,7 @@ static ssize_t read_file_queue(struct file *file, char __user *user_buf,
446 440
447static const struct file_operations fops_queue = { 441static const struct file_operations fops_queue = {
448 .read = read_file_queue, 442 .read = read_file_queue,
449 .open = ath9k_debugfs_open, 443 .open = simple_open,
450 .owner = THIS_MODULE, 444 .owner = THIS_MODULE,
451 .llseek = default_llseek, 445 .llseek = default_llseek,
452}; 446};
@@ -487,7 +481,7 @@ static ssize_t write_file_debug(struct file *file, const char __user *user_buf,
487static const struct file_operations fops_debug = { 481static const struct file_operations fops_debug = {
488 .read = read_file_debug, 482 .read = read_file_debug,
489 .write = write_file_debug, 483 .write = write_file_debug,
490 .open = ath9k_debugfs_open, 484 .open = simple_open,
491 .owner = THIS_MODULE, 485 .owner = THIS_MODULE,
492 .llseek = default_llseek, 486 .llseek = default_llseek,
493}; 487};
@@ -636,7 +630,7 @@ static ssize_t read_file_base_eeprom(struct file *file, char __user *user_buf,
636 630
637static const struct file_operations fops_base_eeprom = { 631static const struct file_operations fops_base_eeprom = {
638 .read = read_file_base_eeprom, 632 .read = read_file_base_eeprom,
639 .open = ath9k_debugfs_open, 633 .open = simple_open,
640 .owner = THIS_MODULE, 634 .owner = THIS_MODULE,
641 .llseek = default_llseek, 635 .llseek = default_llseek,
642}; 636};
@@ -917,7 +911,7 @@ static ssize_t read_file_modal_eeprom(struct file *file, char __user *user_buf,
917 911
918static const struct file_operations fops_modal_eeprom = { 912static const struct file_operations fops_modal_eeprom = {
919 .read = read_file_modal_eeprom, 913 .read = read_file_modal_eeprom,
920 .open = ath9k_debugfs_open, 914 .open = simple_open,
921 .owner = THIS_MODULE, 915 .owner = THIS_MODULE,
922 .llseek = default_llseek, 916 .llseek = default_llseek,
923}; 917};
diff --git a/drivers/net/wireless/ath/ath9k/rc.c b/drivers/net/wireless/ath/ath9k/rc.c
index 4f848493fec..08bb4553270 100644
--- a/drivers/net/wireless/ath/ath9k/rc.c
+++ b/drivers/net/wireless/ath/ath9k/rc.c
@@ -1480,12 +1480,6 @@ static void ath_rate_update(void *priv, struct ieee80211_supported_band *sband,
1480 1480
1481#ifdef CONFIG_ATH9K_DEBUGFS 1481#ifdef CONFIG_ATH9K_DEBUGFS
1482 1482
1483static int ath9k_debugfs_open(struct inode *inode, struct file *file)
1484{
1485 file->private_data = inode->i_private;
1486 return 0;
1487}
1488
1489static ssize_t read_file_rcstat(struct file *file, char __user *user_buf, 1483static ssize_t read_file_rcstat(struct file *file, char __user *user_buf,
1490 size_t count, loff_t *ppos) 1484 size_t count, loff_t *ppos)
1491{ 1485{
@@ -1553,7 +1547,7 @@ static ssize_t read_file_rcstat(struct file *file, char __user *user_buf,
1553 1547
1554static const struct file_operations fops_rcstat = { 1548static const struct file_operations fops_rcstat = {
1555 .read = read_file_rcstat, 1549 .read = read_file_rcstat,
1556 .open = ath9k_debugfs_open, 1550 .open = simple_open,
1557 .owner = THIS_MODULE 1551 .owner = THIS_MODULE
1558}; 1552};
1559 1553
diff --git a/drivers/net/wireless/ath/carl9170/debug.c b/drivers/net/wireless/ath/carl9170/debug.c
index 3c164226687..93fe6003a49 100644
--- a/drivers/net/wireless/ath/carl9170/debug.c
+++ b/drivers/net/wireless/ath/carl9170/debug.c
@@ -48,11 +48,6 @@
48#define ADD(buf, off, max, fmt, args...) \ 48#define ADD(buf, off, max, fmt, args...) \
49 off += snprintf(&buf[off], max - off, fmt, ##args); 49 off += snprintf(&buf[off], max - off, fmt, ##args);
50 50
51static int carl9170_debugfs_open(struct inode *inode, struct file *file)
52{
53 file->private_data = inode->i_private;
54 return 0;
55}
56 51
57struct carl9170_debugfs_fops { 52struct carl9170_debugfs_fops {
58 unsigned int read_bufsize; 53 unsigned int read_bufsize;
@@ -178,7 +173,7 @@ static const struct carl9170_debugfs_fops carl_debugfs_##name ##_ops = {\
178 .attr = _attr, \ 173 .attr = _attr, \
179 .req_dev_state = _dstate, \ 174 .req_dev_state = _dstate, \
180 .fops = { \ 175 .fops = { \
181 .open = carl9170_debugfs_open, \ 176 .open = simple_open, \
182 .read = carl9170_debugfs_read, \ 177 .read = carl9170_debugfs_read, \
183 .write = carl9170_debugfs_write, \ 178 .write = carl9170_debugfs_write, \
184 .owner = THIS_MODULE \ 179 .owner = THIS_MODULE \
diff --git a/drivers/net/wireless/atmel.c b/drivers/net/wireless/atmel.c
index 3010cee7b95..6c87a823f5a 100644
--- a/drivers/net/wireless/atmel.c
+++ b/drivers/net/wireless/atmel.c
@@ -50,7 +50,6 @@
50#include <linux/timer.h> 50#include <linux/timer.h>
51#include <asm/byteorder.h> 51#include <asm/byteorder.h>
52#include <asm/io.h> 52#include <asm/io.h>
53#include <asm/system.h>
54#include <asm/uaccess.h> 53#include <asm/uaccess.h>
55#include <linux/module.h> 54#include <linux/module.h>
56#include <linux/netdevice.h> 55#include <linux/netdevice.h>
diff --git a/drivers/net/wireless/atmel_cs.c b/drivers/net/wireless/atmel_cs.c
index ec295c4f677..ded03d226a7 100644
--- a/drivers/net/wireless/atmel_cs.c
+++ b/drivers/net/wireless/atmel_cs.c
@@ -48,7 +48,6 @@
48#include <pcmcia/ciscode.h> 48#include <pcmcia/ciscode.h>
49 49
50#include <asm/io.h> 50#include <asm/io.h>
51#include <asm/system.h>
52#include <linux/wireless.h> 51#include <linux/wireless.h>
53 52
54#include "atmel.h" 53#include "atmel.h"
diff --git a/drivers/net/wireless/b43/debugfs.c b/drivers/net/wireless/b43/debugfs.c
index e751fdee89b..e807bd93064 100644
--- a/drivers/net/wireless/b43/debugfs.c
+++ b/drivers/net/wireless/b43/debugfs.c
@@ -500,12 +500,6 @@ out:
500 500
501#undef fappend 501#undef fappend
502 502
503static int b43_debugfs_open(struct inode *inode, struct file *file)
504{
505 file->private_data = inode->i_private;
506 return 0;
507}
508
509static ssize_t b43_debugfs_read(struct file *file, char __user *userbuf, 503static ssize_t b43_debugfs_read(struct file *file, char __user *userbuf,
510 size_t count, loff_t *ppos) 504 size_t count, loff_t *ppos)
511{ 505{
@@ -624,7 +618,7 @@ out_unlock:
624 .read = _read, \ 618 .read = _read, \
625 .write = _write, \ 619 .write = _write, \
626 .fops = { \ 620 .fops = { \
627 .open = b43_debugfs_open, \ 621 .open = simple_open, \
628 .read = b43_debugfs_read, \ 622 .read = b43_debugfs_read, \
629 .write = b43_debugfs_write, \ 623 .write = b43_debugfs_write, \
630 .llseek = generic_file_llseek, \ 624 .llseek = generic_file_llseek, \
diff --git a/drivers/net/wireless/b43legacy/debugfs.c b/drivers/net/wireless/b43legacy/debugfs.c
index 5e28ad0d6d1..1965edb765a 100644
--- a/drivers/net/wireless/b43legacy/debugfs.c
+++ b/drivers/net/wireless/b43legacy/debugfs.c
@@ -197,12 +197,6 @@ static int restart_write_file(struct b43legacy_wldev *dev, const char *buf, size
197 197
198#undef fappend 198#undef fappend
199 199
200static int b43legacy_debugfs_open(struct inode *inode, struct file *file)
201{
202 file->private_data = inode->i_private;
203 return 0;
204}
205
206static ssize_t b43legacy_debugfs_read(struct file *file, char __user *userbuf, 200static ssize_t b43legacy_debugfs_read(struct file *file, char __user *userbuf,
207 size_t count, loff_t *ppos) 201 size_t count, loff_t *ppos)
208{ 202{
@@ -331,7 +325,7 @@ out_unlock:
331 .read = _read, \ 325 .read = _read, \
332 .write = _write, \ 326 .write = _write, \
333 .fops = { \ 327 .fops = { \
334 .open = b43legacy_debugfs_open, \ 328 .open = simple_open, \
335 .read = b43legacy_debugfs_read, \ 329 .read = b43legacy_debugfs_read, \
336 .write = b43legacy_debugfs_write, \ 330 .write = b43legacy_debugfs_write, \
337 .llseek = generic_file_llseek, \ 331 .llseek = generic_file_llseek, \
diff --git a/drivers/net/wireless/iwlegacy/3945-rs.c b/drivers/net/wireless/iwlegacy/3945-rs.c
index 70bee1a4d87..4b10157d868 100644
--- a/drivers/net/wireless/iwlegacy/3945-rs.c
+++ b/drivers/net/wireless/iwlegacy/3945-rs.c
@@ -821,12 +821,6 @@ out:
821} 821}
822 822
823#ifdef CONFIG_MAC80211_DEBUGFS 823#ifdef CONFIG_MAC80211_DEBUGFS
824static int
825il3945_open_file_generic(struct inode *inode, struct file *file)
826{
827 file->private_data = inode->i_private;
828 return 0;
829}
830 824
831static ssize_t 825static ssize_t
832il3945_sta_dbgfs_stats_table_read(struct file *file, char __user *user_buf, 826il3945_sta_dbgfs_stats_table_read(struct file *file, char __user *user_buf,
@@ -862,7 +856,7 @@ il3945_sta_dbgfs_stats_table_read(struct file *file, char __user *user_buf,
862 856
863static const struct file_operations rs_sta_dbgfs_stats_table_ops = { 857static const struct file_operations rs_sta_dbgfs_stats_table_ops = {
864 .read = il3945_sta_dbgfs_stats_table_read, 858 .read = il3945_sta_dbgfs_stats_table_read,
865 .open = il3945_open_file_generic, 859 .open = simple_open,
866 .llseek = default_llseek, 860 .llseek = default_llseek,
867}; 861};
868 862
diff --git a/drivers/net/wireless/iwlegacy/4965-rs.c b/drivers/net/wireless/iwlegacy/4965-rs.c
index d7e2856e41d..11ab1247fae 100644
--- a/drivers/net/wireless/iwlegacy/4965-rs.c
+++ b/drivers/net/wireless/iwlegacy/4965-rs.c
@@ -2518,12 +2518,6 @@ il4965_rs_free_sta(void *il_r, struct ieee80211_sta *sta, void *il_sta)
2518} 2518}
2519 2519
2520#ifdef CONFIG_MAC80211_DEBUGFS 2520#ifdef CONFIG_MAC80211_DEBUGFS
2521static int
2522il4965_open_file_generic(struct inode *inode, struct file *file)
2523{
2524 file->private_data = inode->i_private;
2525 return 0;
2526}
2527 2521
2528static void 2522static void
2529il4965_rs_dbgfs_set_mcs(struct il_lq_sta *lq_sta, u32 * rate_n_flags, int idx) 2523il4965_rs_dbgfs_set_mcs(struct il_lq_sta *lq_sta, u32 * rate_n_flags, int idx)
@@ -2695,7 +2689,7 @@ il4965_rs_sta_dbgfs_scale_table_read(struct file *file, char __user *user_buf,
2695static const struct file_operations rs_sta_dbgfs_scale_table_ops = { 2689static const struct file_operations rs_sta_dbgfs_scale_table_ops = {
2696 .write = il4965_rs_sta_dbgfs_scale_table_write, 2690 .write = il4965_rs_sta_dbgfs_scale_table_write,
2697 .read = il4965_rs_sta_dbgfs_scale_table_read, 2691 .read = il4965_rs_sta_dbgfs_scale_table_read,
2698 .open = il4965_open_file_generic, 2692 .open = simple_open,
2699 .llseek = default_llseek, 2693 .llseek = default_llseek,
2700}; 2694};
2701 2695
@@ -2740,7 +2734,7 @@ il4965_rs_sta_dbgfs_stats_table_read(struct file *file, char __user *user_buf,
2740 2734
2741static const struct file_operations rs_sta_dbgfs_stats_table_ops = { 2735static const struct file_operations rs_sta_dbgfs_stats_table_ops = {
2742 .read = il4965_rs_sta_dbgfs_stats_table_read, 2736 .read = il4965_rs_sta_dbgfs_stats_table_read,
2743 .open = il4965_open_file_generic, 2737 .open = simple_open,
2744 .llseek = default_llseek, 2738 .llseek = default_llseek,
2745}; 2739};
2746 2740
@@ -2768,7 +2762,7 @@ il4965_rs_sta_dbgfs_rate_scale_data_read(struct file *file,
2768 2762
2769static const struct file_operations rs_sta_dbgfs_rate_scale_data_ops = { 2763static const struct file_operations rs_sta_dbgfs_rate_scale_data_ops = {
2770 .read = il4965_rs_sta_dbgfs_rate_scale_data_read, 2764 .read = il4965_rs_sta_dbgfs_rate_scale_data_read,
2771 .open = il4965_open_file_generic, 2765 .open = simple_open,
2772 .llseek = default_llseek, 2766 .llseek = default_llseek,
2773}; 2767};
2774 2768
diff --git a/drivers/net/wireless/iwlegacy/debug.c b/drivers/net/wireless/iwlegacy/debug.c
index 229849150aa..eff26501d60 100644
--- a/drivers/net/wireless/iwlegacy/debug.c
+++ b/drivers/net/wireless/iwlegacy/debug.c
@@ -160,18 +160,12 @@ static ssize_t il_dbgfs_##name##_write(struct file *file, \
160 const char __user *user_buf, \ 160 const char __user *user_buf, \
161 size_t count, loff_t *ppos); 161 size_t count, loff_t *ppos);
162 162
163static int
164il_dbgfs_open_file_generic(struct inode *inode, struct file *file)
165{
166 file->private_data = inode->i_private;
167 return 0;
168}
169 163
170#define DEBUGFS_READ_FILE_OPS(name) \ 164#define DEBUGFS_READ_FILE_OPS(name) \
171 DEBUGFS_READ_FUNC(name); \ 165 DEBUGFS_READ_FUNC(name); \
172static const struct file_operations il_dbgfs_##name##_ops = { \ 166static const struct file_operations il_dbgfs_##name##_ops = { \
173 .read = il_dbgfs_##name##_read, \ 167 .read = il_dbgfs_##name##_read, \
174 .open = il_dbgfs_open_file_generic, \ 168 .open = simple_open, \
175 .llseek = generic_file_llseek, \ 169 .llseek = generic_file_llseek, \
176}; 170};
177 171
@@ -179,7 +173,7 @@ static const struct file_operations il_dbgfs_##name##_ops = { \
179 DEBUGFS_WRITE_FUNC(name); \ 173 DEBUGFS_WRITE_FUNC(name); \
180static const struct file_operations il_dbgfs_##name##_ops = { \ 174static const struct file_operations il_dbgfs_##name##_ops = { \
181 .write = il_dbgfs_##name##_write, \ 175 .write = il_dbgfs_##name##_write, \
182 .open = il_dbgfs_open_file_generic, \ 176 .open = simple_open, \
183 .llseek = generic_file_llseek, \ 177 .llseek = generic_file_llseek, \
184}; 178};
185 179
@@ -189,7 +183,7 @@ static const struct file_operations il_dbgfs_##name##_ops = { \
189static const struct file_operations il_dbgfs_##name##_ops = { \ 183static const struct file_operations il_dbgfs_##name##_ops = { \
190 .write = il_dbgfs_##name##_write, \ 184 .write = il_dbgfs_##name##_write, \
191 .read = il_dbgfs_##name##_read, \ 185 .read = il_dbgfs_##name##_read, \
192 .open = il_dbgfs_open_file_generic, \ 186 .open = simple_open, \
193 .llseek = generic_file_llseek, \ 187 .llseek = generic_file_llseek, \
194}; 188};
195 189
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn-rs.c b/drivers/net/wireless/iwlwifi/iwl-agn-rs.c
index 53f8c51cfcd..7e590b349dd 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn-rs.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn-rs.c
@@ -3083,11 +3083,6 @@ static void rs_free_sta(void *priv_r, struct ieee80211_sta *sta,
3083} 3083}
3084 3084
3085#ifdef CONFIG_MAC80211_DEBUGFS 3085#ifdef CONFIG_MAC80211_DEBUGFS
3086static int open_file_generic(struct inode *inode, struct file *file)
3087{
3088 file->private_data = inode->i_private;
3089 return 0;
3090}
3091static void rs_dbgfs_set_mcs(struct iwl_lq_sta *lq_sta, 3086static void rs_dbgfs_set_mcs(struct iwl_lq_sta *lq_sta,
3092 u32 *rate_n_flags, int index) 3087 u32 *rate_n_flags, int index)
3093{ 3088{
@@ -3226,7 +3221,7 @@ static ssize_t rs_sta_dbgfs_scale_table_read(struct file *file,
3226static const struct file_operations rs_sta_dbgfs_scale_table_ops = { 3221static const struct file_operations rs_sta_dbgfs_scale_table_ops = {
3227 .write = rs_sta_dbgfs_scale_table_write, 3222 .write = rs_sta_dbgfs_scale_table_write,
3228 .read = rs_sta_dbgfs_scale_table_read, 3223 .read = rs_sta_dbgfs_scale_table_read,
3229 .open = open_file_generic, 3224 .open = simple_open,
3230 .llseek = default_llseek, 3225 .llseek = default_llseek,
3231}; 3226};
3232static ssize_t rs_sta_dbgfs_stats_table_read(struct file *file, 3227static ssize_t rs_sta_dbgfs_stats_table_read(struct file *file,
@@ -3269,7 +3264,7 @@ static ssize_t rs_sta_dbgfs_stats_table_read(struct file *file,
3269 3264
3270static const struct file_operations rs_sta_dbgfs_stats_table_ops = { 3265static const struct file_operations rs_sta_dbgfs_stats_table_ops = {
3271 .read = rs_sta_dbgfs_stats_table_read, 3266 .read = rs_sta_dbgfs_stats_table_read,
3272 .open = open_file_generic, 3267 .open = simple_open,
3273 .llseek = default_llseek, 3268 .llseek = default_llseek,
3274}; 3269};
3275 3270
@@ -3295,7 +3290,7 @@ static ssize_t rs_sta_dbgfs_rate_scale_data_read(struct file *file,
3295 3290
3296static const struct file_operations rs_sta_dbgfs_rate_scale_data_ops = { 3291static const struct file_operations rs_sta_dbgfs_rate_scale_data_ops = {
3297 .read = rs_sta_dbgfs_rate_scale_data_read, 3292 .read = rs_sta_dbgfs_rate_scale_data_read,
3298 .open = open_file_generic, 3293 .open = simple_open,
3299 .llseek = default_llseek, 3294 .llseek = default_llseek,
3300}; 3295};
3301 3296
diff --git a/drivers/net/wireless/iwlwifi/iwl-debugfs.c b/drivers/net/wireless/iwlwifi/iwl-debugfs.c
index b7b1c04f2fb..2bbaebd99ad 100644
--- a/drivers/net/wireless/iwlwifi/iwl-debugfs.c
+++ b/drivers/net/wireless/iwlwifi/iwl-debugfs.c
@@ -84,17 +84,11 @@ static ssize_t iwl_dbgfs_##name##_write(struct file *file, \
84 size_t count, loff_t *ppos); 84 size_t count, loff_t *ppos);
85 85
86 86
87static int iwl_dbgfs_open_file_generic(struct inode *inode, struct file *file)
88{
89 file->private_data = inode->i_private;
90 return 0;
91}
92
93#define DEBUGFS_READ_FILE_OPS(name) \ 87#define DEBUGFS_READ_FILE_OPS(name) \
94 DEBUGFS_READ_FUNC(name); \ 88 DEBUGFS_READ_FUNC(name); \
95static const struct file_operations iwl_dbgfs_##name##_ops = { \ 89static const struct file_operations iwl_dbgfs_##name##_ops = { \
96 .read = iwl_dbgfs_##name##_read, \ 90 .read = iwl_dbgfs_##name##_read, \
97 .open = iwl_dbgfs_open_file_generic, \ 91 .open = simple_open, \
98 .llseek = generic_file_llseek, \ 92 .llseek = generic_file_llseek, \
99}; 93};
100 94
@@ -102,7 +96,7 @@ static const struct file_operations iwl_dbgfs_##name##_ops = { \
102 DEBUGFS_WRITE_FUNC(name); \ 96 DEBUGFS_WRITE_FUNC(name); \
103static const struct file_operations iwl_dbgfs_##name##_ops = { \ 97static const struct file_operations iwl_dbgfs_##name##_ops = { \
104 .write = iwl_dbgfs_##name##_write, \ 98 .write = iwl_dbgfs_##name##_write, \
105 .open = iwl_dbgfs_open_file_generic, \ 99 .open = simple_open, \
106 .llseek = generic_file_llseek, \ 100 .llseek = generic_file_llseek, \
107}; 101};
108 102
@@ -113,7 +107,7 @@ static const struct file_operations iwl_dbgfs_##name##_ops = { \
113static const struct file_operations iwl_dbgfs_##name##_ops = { \ 107static const struct file_operations iwl_dbgfs_##name##_ops = { \
114 .write = iwl_dbgfs_##name##_write, \ 108 .write = iwl_dbgfs_##name##_write, \
115 .read = iwl_dbgfs_##name##_read, \ 109 .read = iwl_dbgfs_##name##_read, \
116 .open = iwl_dbgfs_open_file_generic, \ 110 .open = simple_open, \
117 .llseek = generic_file_llseek, \ 111 .llseek = generic_file_llseek, \
118}; 112};
119 113
diff --git a/drivers/net/wireless/iwlwifi/iwl-trans-pcie.c b/drivers/net/wireless/iwlwifi/iwl-trans-pcie.c
index b4f796c82e1..4d7b30d3e64 100644
--- a/drivers/net/wireless/iwlwifi/iwl-trans-pcie.c
+++ b/drivers/net/wireless/iwlwifi/iwl-trans-pcie.c
@@ -1898,17 +1898,11 @@ static ssize_t iwl_dbgfs_##name##_write(struct file *file, \
1898 size_t count, loff_t *ppos); 1898 size_t count, loff_t *ppos);
1899 1899
1900 1900
1901static int iwl_dbgfs_open_file_generic(struct inode *inode, struct file *file)
1902{
1903 file->private_data = inode->i_private;
1904 return 0;
1905}
1906
1907#define DEBUGFS_READ_FILE_OPS(name) \ 1901#define DEBUGFS_READ_FILE_OPS(name) \
1908 DEBUGFS_READ_FUNC(name); \ 1902 DEBUGFS_READ_FUNC(name); \
1909static const struct file_operations iwl_dbgfs_##name##_ops = { \ 1903static const struct file_operations iwl_dbgfs_##name##_ops = { \
1910 .read = iwl_dbgfs_##name##_read, \ 1904 .read = iwl_dbgfs_##name##_read, \
1911 .open = iwl_dbgfs_open_file_generic, \ 1905 .open = simple_open, \
1912 .llseek = generic_file_llseek, \ 1906 .llseek = generic_file_llseek, \
1913}; 1907};
1914 1908
@@ -1916,7 +1910,7 @@ static const struct file_operations iwl_dbgfs_##name##_ops = { \
1916 DEBUGFS_WRITE_FUNC(name); \ 1910 DEBUGFS_WRITE_FUNC(name); \
1917static const struct file_operations iwl_dbgfs_##name##_ops = { \ 1911static const struct file_operations iwl_dbgfs_##name##_ops = { \
1918 .write = iwl_dbgfs_##name##_write, \ 1912 .write = iwl_dbgfs_##name##_write, \
1919 .open = iwl_dbgfs_open_file_generic, \ 1913 .open = simple_open, \
1920 .llseek = generic_file_llseek, \ 1914 .llseek = generic_file_llseek, \
1921}; 1915};
1922 1916
@@ -1926,7 +1920,7 @@ static const struct file_operations iwl_dbgfs_##name##_ops = { \
1926static const struct file_operations iwl_dbgfs_##name##_ops = { \ 1920static const struct file_operations iwl_dbgfs_##name##_ops = { \
1927 .write = iwl_dbgfs_##name##_write, \ 1921 .write = iwl_dbgfs_##name##_write, \
1928 .read = iwl_dbgfs_##name##_read, \ 1922 .read = iwl_dbgfs_##name##_read, \
1929 .open = iwl_dbgfs_open_file_generic, \ 1923 .open = simple_open, \
1930 .llseek = generic_file_llseek, \ 1924 .llseek = generic_file_llseek, \
1931}; 1925};
1932 1926
diff --git a/drivers/net/wireless/iwmc3200wifi/debugfs.c b/drivers/net/wireless/iwmc3200wifi/debugfs.c
index 87eef5773a0..b6199d124bb 100644
--- a/drivers/net/wireless/iwmc3200wifi/debugfs.c
+++ b/drivers/net/wireless/iwmc3200wifi/debugfs.c
@@ -99,12 +99,6 @@ DEFINE_SIMPLE_ATTRIBUTE(fops_iwm_dbg_modules,
99 iwm_debugfs_u32_read, iwm_debugfs_dbg_modules_write, 99 iwm_debugfs_u32_read, iwm_debugfs_dbg_modules_write,
100 "%llu\n"); 100 "%llu\n");
101 101
102static int iwm_generic_open(struct inode *inode, struct file *filp)
103{
104 filp->private_data = inode->i_private;
105 return 0;
106}
107
108 102
109static ssize_t iwm_debugfs_txq_read(struct file *filp, char __user *buffer, 103static ssize_t iwm_debugfs_txq_read(struct file *filp, char __user *buffer,
110 size_t count, loff_t *ppos) 104 size_t count, loff_t *ppos)
@@ -401,28 +395,28 @@ out:
401 395
402static const struct file_operations iwm_debugfs_txq_fops = { 396static const struct file_operations iwm_debugfs_txq_fops = {
403 .owner = THIS_MODULE, 397 .owner = THIS_MODULE,
404 .open = iwm_generic_open, 398 .open = simple_open,
405 .read = iwm_debugfs_txq_read, 399 .read = iwm_debugfs_txq_read,
406 .llseek = default_llseek, 400 .llseek = default_llseek,
407}; 401};
408 402
409static const struct file_operations iwm_debugfs_tx_credit_fops = { 403static const struct file_operations iwm_debugfs_tx_credit_fops = {
410 .owner = THIS_MODULE, 404 .owner = THIS_MODULE,
411 .open = iwm_generic_open, 405 .open = simple_open,
412 .read = iwm_debugfs_tx_credit_read, 406 .read = iwm_debugfs_tx_credit_read,
413 .llseek = default_llseek, 407 .llseek = default_llseek,
414}; 408};
415 409
416static const struct file_operations iwm_debugfs_rx_ticket_fops = { 410static const struct file_operations iwm_debugfs_rx_ticket_fops = {
417 .owner = THIS_MODULE, 411 .owner = THIS_MODULE,
418 .open = iwm_generic_open, 412 .open = simple_open,
419 .read = iwm_debugfs_rx_ticket_read, 413 .read = iwm_debugfs_rx_ticket_read,
420 .llseek = default_llseek, 414 .llseek = default_llseek,
421}; 415};
422 416
423static const struct file_operations iwm_debugfs_fw_err_fops = { 417static const struct file_operations iwm_debugfs_fw_err_fops = {
424 .owner = THIS_MODULE, 418 .owner = THIS_MODULE,
425 .open = iwm_generic_open, 419 .open = simple_open,
426 .read = iwm_debugfs_fw_err_read, 420 .read = iwm_debugfs_fw_err_read,
427 .llseek = default_llseek, 421 .llseek = default_llseek,
428}; 422};
diff --git a/drivers/net/wireless/iwmc3200wifi/sdio.c b/drivers/net/wireless/iwmc3200wifi/sdio.c
index 764b40dd24a..0042f204b07 100644
--- a/drivers/net/wireless/iwmc3200wifi/sdio.c
+++ b/drivers/net/wireless/iwmc3200wifi/sdio.c
@@ -264,13 +264,6 @@ static int if_sdio_send_chunk(struct iwm_priv *iwm, u8 *buf, int count)
264 return ret; 264 return ret;
265} 265}
266 266
267/* debugfs hooks */
268static int iwm_debugfs_sdio_open(struct inode *inode, struct file *filp)
269{
270 filp->private_data = inode->i_private;
271 return 0;
272}
273
274static ssize_t iwm_debugfs_sdio_read(struct file *filp, char __user *buffer, 267static ssize_t iwm_debugfs_sdio_read(struct file *filp, char __user *buffer,
275 size_t count, loff_t *ppos) 268 size_t count, loff_t *ppos)
276{ 269{
@@ -363,7 +356,7 @@ err:
363 356
364static const struct file_operations iwm_debugfs_sdio_fops = { 357static const struct file_operations iwm_debugfs_sdio_fops = {
365 .owner = THIS_MODULE, 358 .owner = THIS_MODULE,
366 .open = iwm_debugfs_sdio_open, 359 .open = simple_open,
367 .read = iwm_debugfs_sdio_read, 360 .read = iwm_debugfs_sdio_read,
368 .llseek = default_llseek, 361 .llseek = default_llseek,
369}; 362};
diff --git a/drivers/net/wireless/libertas/debugfs.c b/drivers/net/wireless/libertas/debugfs.c
index c192671610f..a06cc283e23 100644
--- a/drivers/net/wireless/libertas/debugfs.c
+++ b/drivers/net/wireless/libertas/debugfs.c
@@ -21,12 +21,6 @@ static char *szStates[] = {
21static void lbs_debug_init(struct lbs_private *priv); 21static void lbs_debug_init(struct lbs_private *priv);
22#endif 22#endif
23 23
24static int open_file_generic(struct inode *inode, struct file *file)
25{
26 file->private_data = inode->i_private;
27 return 0;
28}
29
30static ssize_t write_file_dummy(struct file *file, const char __user *buf, 24static ssize_t write_file_dummy(struct file *file, const char __user *buf,
31 size_t count, loff_t *ppos) 25 size_t count, loff_t *ppos)
32{ 26{
@@ -696,7 +690,7 @@ out_unlock:
696 690
697#define FOPS(fread, fwrite) { \ 691#define FOPS(fread, fwrite) { \
698 .owner = THIS_MODULE, \ 692 .owner = THIS_MODULE, \
699 .open = open_file_generic, \ 693 .open = simple_open, \
700 .read = (fread), \ 694 .read = (fread), \
701 .write = (fwrite), \ 695 .write = (fwrite), \
702 .llseek = generic_file_llseek, \ 696 .llseek = generic_file_llseek, \
@@ -962,7 +956,7 @@ static ssize_t lbs_debugfs_write(struct file *f, const char __user *buf,
962 956
963static const struct file_operations lbs_debug_fops = { 957static const struct file_operations lbs_debug_fops = {
964 .owner = THIS_MODULE, 958 .owner = THIS_MODULE,
965 .open = open_file_generic, 959 .open = simple_open,
966 .write = lbs_debugfs_write, 960 .write = lbs_debugfs_write,
967 .read = lbs_debugfs_read, 961 .read = lbs_debugfs_read,
968 .llseek = default_llseek, 962 .llseek = default_llseek,
diff --git a/drivers/net/wireless/mwifiex/debugfs.c b/drivers/net/wireless/mwifiex/debugfs.c
index d26a78b6b3c..1a845074c52 100644
--- a/drivers/net/wireless/mwifiex/debugfs.c
+++ b/drivers/net/wireless/mwifiex/debugfs.c
@@ -140,18 +140,6 @@ static struct mwifiex_debug_data items[] = {
140static int num_of_items = ARRAY_SIZE(items); 140static int num_of_items = ARRAY_SIZE(items);
141 141
142/* 142/*
143 * Generic proc file open handler.
144 *
145 * This function is called every time a file is accessed for read or write.
146 */
147static int
148mwifiex_open_generic(struct inode *inode, struct file *file)
149{
150 file->private_data = inode->i_private;
151 return 0;
152}
153
154/*
155 * Proc info file read handler. 143 * Proc info file read handler.
156 * 144 *
157 * This function is called when the 'info' file is opened for reading. 145 * This function is called when the 'info' file is opened for reading.
@@ -676,19 +664,19 @@ done:
676static const struct file_operations mwifiex_dfs_##name##_fops = { \ 664static const struct file_operations mwifiex_dfs_##name##_fops = { \
677 .read = mwifiex_##name##_read, \ 665 .read = mwifiex_##name##_read, \
678 .write = mwifiex_##name##_write, \ 666 .write = mwifiex_##name##_write, \
679 .open = mwifiex_open_generic, \ 667 .open = simple_open, \
680}; 668};
681 669
682#define MWIFIEX_DFS_FILE_READ_OPS(name) \ 670#define MWIFIEX_DFS_FILE_READ_OPS(name) \
683static const struct file_operations mwifiex_dfs_##name##_fops = { \ 671static const struct file_operations mwifiex_dfs_##name##_fops = { \
684 .read = mwifiex_##name##_read, \ 672 .read = mwifiex_##name##_read, \
685 .open = mwifiex_open_generic, \ 673 .open = simple_open, \
686}; 674};
687 675
688#define MWIFIEX_DFS_FILE_WRITE_OPS(name) \ 676#define MWIFIEX_DFS_FILE_WRITE_OPS(name) \
689static const struct file_operations mwifiex_dfs_##name##_fops = { \ 677static const struct file_operations mwifiex_dfs_##name##_fops = { \
690 .write = mwifiex_##name##_write, \ 678 .write = mwifiex_##name##_write, \
691 .open = mwifiex_open_generic, \ 679 .open = simple_open, \
692}; 680};
693 681
694 682
diff --git a/drivers/net/wireless/prism54/islpci_mgt.c b/drivers/net/wireless/prism54/islpci_mgt.c
index 851fa10241e..c5404cb59e0 100644
--- a/drivers/net/wireless/prism54/islpci_mgt.c
+++ b/drivers/net/wireless/prism54/islpci_mgt.c
@@ -24,7 +24,6 @@
24#include <linux/slab.h> 24#include <linux/slab.h>
25 25
26#include <asm/io.h> 26#include <asm/io.h>
27#include <asm/system.h>
28#include <linux/if_arp.h> 27#include <linux/if_arp.h>
29 28
30#include "prismcompat.h" 29#include "prismcompat.h"
diff --git a/drivers/net/wireless/ray_cs.c b/drivers/net/wireless/ray_cs.c
index 04fec1fa6e0..86a738bf591 100644
--- a/drivers/net/wireless/ray_cs.c
+++ b/drivers/net/wireless/ray_cs.c
@@ -53,7 +53,6 @@
53#include <net/iw_handler.h> 53#include <net/iw_handler.h>
54 54
55#include <asm/io.h> 55#include <asm/io.h>
56#include <asm/system.h>
57#include <asm/byteorder.h> 56#include <asm/byteorder.h>
58#include <asm/uaccess.h> 57#include <asm/uaccess.h>
59 58
diff --git a/drivers/net/wireless/wl1251/debugfs.c b/drivers/net/wireless/wl1251/debugfs.c
index 6c274007d20..448da1f8c22 100644
--- a/drivers/net/wireless/wl1251/debugfs.c
+++ b/drivers/net/wireless/wl1251/debugfs.c
@@ -47,7 +47,7 @@ static ssize_t name## _read(struct file *file, char __user *userbuf, \
47 \ 47 \
48static const struct file_operations name## _ops = { \ 48static const struct file_operations name## _ops = { \
49 .read = name## _read, \ 49 .read = name## _read, \
50 .open = wl1251_open_file_generic, \ 50 .open = simple_open, \
51 .llseek = generic_file_llseek, \ 51 .llseek = generic_file_llseek, \
52}; 52};
53 53
@@ -84,7 +84,7 @@ static ssize_t sub## _ ##name## _read(struct file *file, \
84 \ 84 \
85static const struct file_operations sub## _ ##name## _ops = { \ 85static const struct file_operations sub## _ ##name## _ops = { \
86 .read = sub## _ ##name## _read, \ 86 .read = sub## _ ##name## _read, \
87 .open = wl1251_open_file_generic, \ 87 .open = simple_open, \
88 .llseek = generic_file_llseek, \ 88 .llseek = generic_file_llseek, \
89}; 89};
90 90
@@ -117,12 +117,6 @@ out:
117 mutex_unlock(&wl->mutex); 117 mutex_unlock(&wl->mutex);
118} 118}
119 119
120static int wl1251_open_file_generic(struct inode *inode, struct file *file)
121{
122 file->private_data = inode->i_private;
123 return 0;
124}
125
126DEBUGFS_FWSTATS_FILE(tx, internal_desc_overflow, 20, "%u"); 120DEBUGFS_FWSTATS_FILE(tx, internal_desc_overflow, 20, "%u");
127 121
128DEBUGFS_FWSTATS_FILE(rx, out_of_mem, 20, "%u"); 122DEBUGFS_FWSTATS_FILE(rx, out_of_mem, 20, "%u");
@@ -235,7 +229,7 @@ static ssize_t tx_queue_len_read(struct file *file, char __user *userbuf,
235 229
236static const struct file_operations tx_queue_len_ops = { 230static const struct file_operations tx_queue_len_ops = {
237 .read = tx_queue_len_read, 231 .read = tx_queue_len_read,
238 .open = wl1251_open_file_generic, 232 .open = simple_open,
239 .llseek = generic_file_llseek, 233 .llseek = generic_file_llseek,
240}; 234};
241 235
@@ -257,7 +251,7 @@ static ssize_t tx_queue_status_read(struct file *file, char __user *userbuf,
257 251
258static const struct file_operations tx_queue_status_ops = { 252static const struct file_operations tx_queue_status_ops = {
259 .read = tx_queue_status_read, 253 .read = tx_queue_status_read,
260 .open = wl1251_open_file_generic, 254 .open = simple_open,
261 .llseek = generic_file_llseek, 255 .llseek = generic_file_llseek,
262}; 256};
263 257
diff --git a/drivers/net/wireless/wl12xx/debugfs.c b/drivers/net/wireless/wl12xx/debugfs.c
index e1cf7276596..564d49575c9 100644
--- a/drivers/net/wireless/wl12xx/debugfs.c
+++ b/drivers/net/wireless/wl12xx/debugfs.c
@@ -63,7 +63,7 @@ static ssize_t name## _read(struct file *file, char __user *userbuf, \
63 \ 63 \
64static const struct file_operations name## _ops = { \ 64static const struct file_operations name## _ops = { \
65 .read = name## _read, \ 65 .read = name## _read, \
66 .open = wl1271_open_file_generic, \ 66 .open = simple_open, \
67 .llseek = generic_file_llseek, \ 67 .llseek = generic_file_llseek, \
68}; 68};
69 69
@@ -96,7 +96,7 @@ static ssize_t sub## _ ##name## _read(struct file *file, \
96 \ 96 \
97static const struct file_operations sub## _ ##name## _ops = { \ 97static const struct file_operations sub## _ ##name## _ops = { \
98 .read = sub## _ ##name## _read, \ 98 .read = sub## _ ##name## _read, \
99 .open = wl1271_open_file_generic, \ 99 .open = simple_open, \
100 .llseek = generic_file_llseek, \ 100 .llseek = generic_file_llseek, \
101}; 101};
102 102
@@ -126,12 +126,6 @@ out:
126 mutex_unlock(&wl->mutex); 126 mutex_unlock(&wl->mutex);
127} 127}
128 128
129static int wl1271_open_file_generic(struct inode *inode, struct file *file)
130{
131 file->private_data = inode->i_private;
132 return 0;
133}
134
135DEBUGFS_FWSTATS_FILE(tx, internal_desc_overflow, "%u"); 129DEBUGFS_FWSTATS_FILE(tx, internal_desc_overflow, "%u");
136 130
137DEBUGFS_FWSTATS_FILE(rx, out_of_mem, "%u"); 131DEBUGFS_FWSTATS_FILE(rx, out_of_mem, "%u");
@@ -243,7 +237,7 @@ static ssize_t tx_queue_len_read(struct file *file, char __user *userbuf,
243 237
244static const struct file_operations tx_queue_len_ops = { 238static const struct file_operations tx_queue_len_ops = {
245 .read = tx_queue_len_read, 239 .read = tx_queue_len_read,
246 .open = wl1271_open_file_generic, 240 .open = simple_open,
247 .llseek = default_llseek, 241 .llseek = default_llseek,
248}; 242};
249 243
@@ -289,7 +283,7 @@ static ssize_t gpio_power_write(struct file *file,
289static const struct file_operations gpio_power_ops = { 283static const struct file_operations gpio_power_ops = {
290 .read = gpio_power_read, 284 .read = gpio_power_read,
291 .write = gpio_power_write, 285 .write = gpio_power_write,
292 .open = wl1271_open_file_generic, 286 .open = simple_open,
293 .llseek = default_llseek, 287 .llseek = default_llseek,
294}; 288};
295 289
@@ -308,7 +302,7 @@ static ssize_t start_recovery_write(struct file *file,
308 302
309static const struct file_operations start_recovery_ops = { 303static const struct file_operations start_recovery_ops = {
310 .write = start_recovery_write, 304 .write = start_recovery_write,
311 .open = wl1271_open_file_generic, 305 .open = simple_open,
312 .llseek = default_llseek, 306 .llseek = default_llseek,
313}; 307};
314 308
@@ -372,7 +366,7 @@ out:
372static const struct file_operations dynamic_ps_timeout_ops = { 366static const struct file_operations dynamic_ps_timeout_ops = {
373 .read = dynamic_ps_timeout_read, 367 .read = dynamic_ps_timeout_read,
374 .write = dynamic_ps_timeout_write, 368 .write = dynamic_ps_timeout_write,
375 .open = wl1271_open_file_generic, 369 .open = simple_open,
376 .llseek = default_llseek, 370 .llseek = default_llseek,
377}; 371};
378 372
@@ -441,7 +435,7 @@ out:
441static const struct file_operations forced_ps_ops = { 435static const struct file_operations forced_ps_ops = {
442 .read = forced_ps_read, 436 .read = forced_ps_read,
443 .write = forced_ps_write, 437 .write = forced_ps_write,
444 .open = wl1271_open_file_generic, 438 .open = simple_open,
445 .llseek = default_llseek, 439 .llseek = default_llseek,
446}; 440};
447 441
@@ -483,7 +477,7 @@ static ssize_t split_scan_timeout_write(struct file *file,
483static const struct file_operations split_scan_timeout_ops = { 477static const struct file_operations split_scan_timeout_ops = {
484 .read = split_scan_timeout_read, 478 .read = split_scan_timeout_read,
485 .write = split_scan_timeout_write, 479 .write = split_scan_timeout_write,
486 .open = wl1271_open_file_generic, 480 .open = simple_open,
487 .llseek = default_llseek, 481 .llseek = default_llseek,
488}; 482};
489 483
@@ -566,7 +560,7 @@ static ssize_t driver_state_read(struct file *file, char __user *user_buf,
566 560
567static const struct file_operations driver_state_ops = { 561static const struct file_operations driver_state_ops = {
568 .read = driver_state_read, 562 .read = driver_state_read,
569 .open = wl1271_open_file_generic, 563 .open = simple_open,
570 .llseek = default_llseek, 564 .llseek = default_llseek,
571}; 565};
572 566
@@ -675,7 +669,7 @@ static ssize_t vifs_state_read(struct file *file, char __user *user_buf,
675 669
676static const struct file_operations vifs_state_ops = { 670static const struct file_operations vifs_state_ops = {
677 .read = vifs_state_read, 671 .read = vifs_state_read,
678 .open = wl1271_open_file_generic, 672 .open = simple_open,
679 .llseek = default_llseek, 673 .llseek = default_llseek,
680}; 674};
681 675
@@ -733,7 +727,7 @@ static ssize_t dtim_interval_write(struct file *file,
733static const struct file_operations dtim_interval_ops = { 727static const struct file_operations dtim_interval_ops = {
734 .read = dtim_interval_read, 728 .read = dtim_interval_read,
735 .write = dtim_interval_write, 729 .write = dtim_interval_write,
736 .open = wl1271_open_file_generic, 730 .open = simple_open,
737 .llseek = default_llseek, 731 .llseek = default_llseek,
738}; 732};
739 733
@@ -791,7 +785,7 @@ static ssize_t suspend_dtim_interval_write(struct file *file,
791static const struct file_operations suspend_dtim_interval_ops = { 785static const struct file_operations suspend_dtim_interval_ops = {
792 .read = suspend_dtim_interval_read, 786 .read = suspend_dtim_interval_read,
793 .write = suspend_dtim_interval_write, 787 .write = suspend_dtim_interval_write,
794 .open = wl1271_open_file_generic, 788 .open = simple_open,
795 .llseek = default_llseek, 789 .llseek = default_llseek,
796}; 790};
797 791
@@ -849,7 +843,7 @@ static ssize_t beacon_interval_write(struct file *file,
849static const struct file_operations beacon_interval_ops = { 843static const struct file_operations beacon_interval_ops = {
850 .read = beacon_interval_read, 844 .read = beacon_interval_read,
851 .write = beacon_interval_write, 845 .write = beacon_interval_write,
852 .open = wl1271_open_file_generic, 846 .open = simple_open,
853 .llseek = default_llseek, 847 .llseek = default_llseek,
854}; 848};
855 849
@@ -904,7 +898,7 @@ static ssize_t rx_streaming_interval_read(struct file *file,
904static const struct file_operations rx_streaming_interval_ops = { 898static const struct file_operations rx_streaming_interval_ops = {
905 .read = rx_streaming_interval_read, 899 .read = rx_streaming_interval_read,
906 .write = rx_streaming_interval_write, 900 .write = rx_streaming_interval_write,
907 .open = wl1271_open_file_generic, 901 .open = simple_open,
908 .llseek = default_llseek, 902 .llseek = default_llseek,
909}; 903};
910 904
@@ -959,7 +953,7 @@ static ssize_t rx_streaming_always_read(struct file *file,
959static const struct file_operations rx_streaming_always_ops = { 953static const struct file_operations rx_streaming_always_ops = {
960 .read = rx_streaming_always_read, 954 .read = rx_streaming_always_read,
961 .write = rx_streaming_always_write, 955 .write = rx_streaming_always_write,
962 .open = wl1271_open_file_generic, 956 .open = simple_open,
963 .llseek = default_llseek, 957 .llseek = default_llseek,
964}; 958};
965 959
@@ -1003,7 +997,7 @@ out:
1003 997
1004static const struct file_operations beacon_filtering_ops = { 998static const struct file_operations beacon_filtering_ops = {
1005 .write = beacon_filtering_write, 999 .write = beacon_filtering_write,
1006 .open = wl1271_open_file_generic, 1000 .open = simple_open,
1007 .llseek = default_llseek, 1001 .llseek = default_llseek,
1008}; 1002};
1009 1003
diff --git a/drivers/net/wireless/wl3501_cs.c b/drivers/net/wireless/wl3501_cs.c
index 98fbf54f600..00f6e69c1dc 100644
--- a/drivers/net/wireless/wl3501_cs.c
+++ b/drivers/net/wireless/wl3501_cs.c
@@ -53,7 +53,6 @@
53 53
54#include <asm/io.h> 54#include <asm/io.h>
55#include <asm/uaccess.h> 55#include <asm/uaccess.h>
56#include <asm/system.h>
57 56
58#include "wl3501.h" 57#include "wl3501.h"
59 58