aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2012-02-10 23:32:28 -0500
committerDavid S. Miller <davem@davemloft.net>2012-02-10 23:32:28 -0500
commitd5ef8a4d87ab21d575ac86366599c9152a28028d (patch)
tree8b1be85ad1af7ee6a0e3e36c77ae738c966c1f21 /drivers/net
parentd9dd966d7fc088a6bed991c2b1e2fba4485e0a31 (diff)
parent8df54d622a120058ee8bec38743c9b8f091c8e58 (diff)
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Conflicts: drivers/infiniband/hw/nes/nes_cm.c Simple whitespace conflict. Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c3
-rw-r--r--drivers/net/ethernet/brocade/bna/bnad_ethtool.c10
-rw-r--r--drivers/net/ethernet/intel/e1000/e1000_main.c10
-rw-r--r--drivers/net/ethernet/intel/igb/igb_main.c3
-rw-r--r--drivers/net/ethernet/intel/ixgbe/ixgbe_dcb_nl.c11
-rw-r--r--drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c88
-rw-r--r--drivers/net/ethernet/intel/ixgbe/ixgbe_main.c18
-rw-r--r--drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c3
-rw-r--r--drivers/net/ethernet/marvell/skge.c71
-rw-r--r--drivers/net/ethernet/mellanox/mlx4/cmd.c10
-rw-r--r--drivers/net/ethernet/mellanox/mlx4/en_netdev.c3
-rw-r--r--drivers/net/ethernet/mellanox/mlx4/en_rx.c10
-rw-r--r--drivers/net/ethernet/mellanox/mlx4/mcg.c16
-rw-r--r--drivers/net/ethernet/mellanox/mlx4/mlx4_en.h3
-rw-r--r--drivers/net/ethernet/micrel/Kconfig1
-rw-r--r--drivers/net/ethernet/renesas/sh_eth.c4
-rw-r--r--drivers/net/ethernet/renesas/sh_eth.h3
-rw-r--r--drivers/net/ethernet/toshiba/Kconfig2
-rw-r--r--drivers/net/ethernet/via/via-velocity.c3
-rw-r--r--drivers/net/tokenring/Kconfig5
-rw-r--r--drivers/net/wireless/ath/ath9k/hw.c7
-rw-r--r--drivers/net/wireless/ath/ath9k/init.c9
-rw-r--r--drivers/net/wireless/ath/ath9k/recv.c8
-rw-r--r--drivers/net/wireless/mwifiex/init.c3
-rw-r--r--drivers/net/wireless/mwifiex/main.c12
-rw-r--r--drivers/net/wireless/mwifiex/sta_ioctl.c8
-rw-r--r--drivers/net/wireless/zd1211rw/zd_mac.c8
27 files changed, 174 insertions, 158 deletions
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c
index 6e6a684359b5..518ec5c6872d 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c
@@ -523,7 +523,6 @@ static void bnx2x_tpa_stop(struct bnx2x *bp, struct bnx2x_fastpath *fp,
523 skb = build_skb(data); 523 skb = build_skb(data);
524 524
525 if (likely(skb)) { 525 if (likely(skb)) {
526
527#ifdef BNX2X_STOP_ON_ERROR 526#ifdef BNX2X_STOP_ON_ERROR
528 if (pad + len > fp->rx_buf_size) { 527 if (pad + len > fp->rx_buf_size) {
529 BNX2X_ERR("skb_put is about to fail... " 528 BNX2X_ERR("skb_put is about to fail... "
@@ -557,7 +556,7 @@ static void bnx2x_tpa_stop(struct bnx2x *bp, struct bnx2x_fastpath *fp,
557 556
558 return; 557 return;
559 } 558 }
560 559 kfree(new_data);
561drop: 560drop:
562 /* drop the packet and keep the buffer in the bin */ 561 /* drop the packet and keep the buffer in the bin */
563 DP(NETIF_MSG_RX_STATUS, 562 DP(NETIF_MSG_RX_STATUS,
diff --git a/drivers/net/ethernet/brocade/bna/bnad_ethtool.c b/drivers/net/ethernet/brocade/bna/bnad_ethtool.c
index a27c601af3d1..ab753d7334a6 100644
--- a/drivers/net/ethernet/brocade/bna/bnad_ethtool.c
+++ b/drivers/net/ethernet/brocade/bna/bnad_ethtool.c
@@ -946,7 +946,7 @@ bnad_get_flash_partition_by_offset(struct bnad *bnad, u32 offset,
946 946
947 flash_attr = kzalloc(sizeof(struct bfa_flash_attr), GFP_KERNEL); 947 flash_attr = kzalloc(sizeof(struct bfa_flash_attr), GFP_KERNEL);
948 if (!flash_attr) 948 if (!flash_attr)
949 return -ENOMEM; 949 return 0;
950 950
951 fcomp.bnad = bnad; 951 fcomp.bnad = bnad;
952 fcomp.comp_status = 0; 952 fcomp.comp_status = 0;
@@ -958,7 +958,7 @@ bnad_get_flash_partition_by_offset(struct bnad *bnad, u32 offset,
958 if (ret != BFA_STATUS_OK) { 958 if (ret != BFA_STATUS_OK) {
959 spin_unlock_irqrestore(&bnad->bna_lock, flags); 959 spin_unlock_irqrestore(&bnad->bna_lock, flags);
960 kfree(flash_attr); 960 kfree(flash_attr);
961 goto out_err; 961 return 0;
962 } 962 }
963 spin_unlock_irqrestore(&bnad->bna_lock, flags); 963 spin_unlock_irqrestore(&bnad->bna_lock, flags);
964 wait_for_completion(&fcomp.comp); 964 wait_for_completion(&fcomp.comp);
@@ -978,8 +978,6 @@ bnad_get_flash_partition_by_offset(struct bnad *bnad, u32 offset,
978 } 978 }
979 kfree(flash_attr); 979 kfree(flash_attr);
980 return flash_part; 980 return flash_part;
981out_err:
982 return -EINVAL;
983} 981}
984 982
985static int 983static int
@@ -1006,7 +1004,7 @@ bnad_get_eeprom(struct net_device *netdev, struct ethtool_eeprom *eeprom,
1006 /* Query the flash partition based on the offset */ 1004 /* Query the flash partition based on the offset */
1007 flash_part = bnad_get_flash_partition_by_offset(bnad, 1005 flash_part = bnad_get_flash_partition_by_offset(bnad,
1008 eeprom->offset, &base_offset); 1006 eeprom->offset, &base_offset);
1009 if (flash_part <= 0) 1007 if (flash_part == 0)
1010 return -EFAULT; 1008 return -EFAULT;
1011 1009
1012 fcomp.bnad = bnad; 1010 fcomp.bnad = bnad;
@@ -1048,7 +1046,7 @@ bnad_set_eeprom(struct net_device *netdev, struct ethtool_eeprom *eeprom,
1048 /* Query the flash partition based on the offset */ 1046 /* Query the flash partition based on the offset */
1049 flash_part = bnad_get_flash_partition_by_offset(bnad, 1047 flash_part = bnad_get_flash_partition_by_offset(bnad,
1050 eeprom->offset, &base_offset); 1048 eeprom->offset, &base_offset);
1051 if (flash_part <= 0) 1049 if (flash_part == 0)
1052 return -EFAULT; 1050 return -EFAULT;
1053 1051
1054 fcomp.bnad = bnad; 1052 fcomp.bnad = bnad;
diff --git a/drivers/net/ethernet/intel/e1000/e1000_main.c b/drivers/net/ethernet/intel/e1000/e1000_main.c
index 1f86a70b88af..e72dc8175955 100644
--- a/drivers/net/ethernet/intel/e1000/e1000_main.c
+++ b/drivers/net/ethernet/intel/e1000/e1000_main.c
@@ -4962,12 +4962,14 @@ static int __e1000_shutdown(struct pci_dev *pdev, bool *enable_wake)
4962 e1000_setup_rctl(adapter); 4962 e1000_setup_rctl(adapter);
4963 e1000_set_rx_mode(netdev); 4963 e1000_set_rx_mode(netdev);
4964 4964
4965 rctl = er32(RCTL);
4966
4965 /* turn on all-multi mode if wake on multicast is enabled */ 4967 /* turn on all-multi mode if wake on multicast is enabled */
4966 if (wufc & E1000_WUFC_MC) { 4968 if (wufc & E1000_WUFC_MC)
4967 rctl = er32(RCTL);
4968 rctl |= E1000_RCTL_MPE; 4969 rctl |= E1000_RCTL_MPE;
4969 ew32(RCTL, rctl); 4970
4970 } 4971 /* enable receives in the hardware */
4972 ew32(RCTL, rctl | E1000_RCTL_EN);
4971 4973
4972 if (hw->mac_type >= e1000_82540) { 4974 if (hw->mac_type >= e1000_82540) {
4973 ctrl = er32(CTRL); 4975 ctrl = er32(CTRL);
diff --git a/drivers/net/ethernet/intel/igb/igb_main.c b/drivers/net/ethernet/intel/igb/igb_main.c
index fd911cac1ac5..fda824735e18 100644
--- a/drivers/net/ethernet/intel/igb/igb_main.c
+++ b/drivers/net/ethernet/intel/igb/igb_main.c
@@ -5014,7 +5014,8 @@ static int igb_find_enabled_vfs(struct igb_adapter *adapter)
5014 vf_devfn = pdev->devfn + 0x80; 5014 vf_devfn = pdev->devfn + 0x80;
5015 pvfdev = pci_get_device(hw->vendor_id, device_id, NULL); 5015 pvfdev = pci_get_device(hw->vendor_id, device_id, NULL);
5016 while (pvfdev) { 5016 while (pvfdev) {
5017 if (pvfdev->devfn == vf_devfn) 5017 if (pvfdev->devfn == vf_devfn &&
5018 (pvfdev->bus->number >= pdev->bus->number))
5018 vfs_found++; 5019 vfs_found++;
5019 vf_devfn += vf_stride; 5020 vf_devfn += vf_stride;
5020 pvfdev = pci_get_device(hw->vendor_id, 5021 pvfdev = pci_get_device(hw->vendor_id,
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_dcb_nl.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_dcb_nl.c
index 005e5f25600d..79a92fe987b9 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_dcb_nl.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_dcb_nl.c
@@ -112,6 +112,8 @@ static u8 ixgbe_dcbnl_get_state(struct net_device *netdev)
112static u8 ixgbe_dcbnl_set_state(struct net_device *netdev, u8 state) 112static u8 ixgbe_dcbnl_set_state(struct net_device *netdev, u8 state)
113{ 113{
114 u8 err = 0; 114 u8 err = 0;
115 u8 prio_tc[MAX_USER_PRIORITY] = {0};
116 int i;
115 struct ixgbe_adapter *adapter = netdev_priv(netdev); 117 struct ixgbe_adapter *adapter = netdev_priv(netdev);
116 118
117 /* Fail command if not in CEE mode */ 119 /* Fail command if not in CEE mode */
@@ -122,10 +124,15 @@ static u8 ixgbe_dcbnl_set_state(struct net_device *netdev, u8 state)
122 if (!!state != !(adapter->flags & IXGBE_FLAG_DCB_ENABLED)) 124 if (!!state != !(adapter->flags & IXGBE_FLAG_DCB_ENABLED))
123 return err; 125 return err;
124 126
125 if (state > 0) 127 if (state > 0) {
126 err = ixgbe_setup_tc(netdev, adapter->dcb_cfg.num_tcs.pg_tcs); 128 err = ixgbe_setup_tc(netdev, adapter->dcb_cfg.num_tcs.pg_tcs);
127 else 129 ixgbe_dcb_unpack_map(&adapter->dcb_cfg, DCB_TX_CONFIG, prio_tc);
130 } else {
128 err = ixgbe_setup_tc(netdev, 0); 131 err = ixgbe_setup_tc(netdev, 0);
132 }
133
134 for (i = 0; i < IEEE_8021QAZ_MAX_TCS; i++)
135 netdev_set_prio_tc_map(netdev, i, prio_tc[i]);
129 136
130 return err; 137 return err;
131} 138}
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c
index 1f31a04d3c91..a62975480e37 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c
@@ -120,19 +120,23 @@ static const struct ixgbe_stats ixgbe_gstrings_stats[] = {
120#endif /* IXGBE_FCOE */ 120#endif /* IXGBE_FCOE */
121}; 121};
122 122
123#define IXGBE_QUEUE_STATS_LEN \ 123/* ixgbe allocates num_tx_queues and num_rx_queues symmetrically so
124 ((((struct ixgbe_adapter *)netdev_priv(netdev))->num_tx_queues + \ 124 * we set the num_rx_queues to evaluate to num_tx_queues. This is
125 ((struct ixgbe_adapter *)netdev_priv(netdev))->num_rx_queues) * \ 125 * used because we do not have a good way to get the max number of
126 * rx queues with CONFIG_RPS disabled.
127 */
128#define IXGBE_NUM_RX_QUEUES netdev->num_tx_queues
129
130#define IXGBE_QUEUE_STATS_LEN ( \
131 (netdev->num_tx_queues + IXGBE_NUM_RX_QUEUES) * \
126 (sizeof(struct ixgbe_queue_stats) / sizeof(u64))) 132 (sizeof(struct ixgbe_queue_stats) / sizeof(u64)))
127#define IXGBE_GLOBAL_STATS_LEN ARRAY_SIZE(ixgbe_gstrings_stats) 133#define IXGBE_GLOBAL_STATS_LEN ARRAY_SIZE(ixgbe_gstrings_stats)
128#define IXGBE_PB_STATS_LEN ( \ 134#define IXGBE_PB_STATS_LEN ( \
129 (((struct ixgbe_adapter *)netdev_priv(netdev))->flags & \ 135 (sizeof(((struct ixgbe_adapter *)0)->stats.pxonrxc) + \
130 IXGBE_FLAG_DCB_ENABLED) ? \ 136 sizeof(((struct ixgbe_adapter *)0)->stats.pxontxc) + \
131 (sizeof(((struct ixgbe_adapter *)0)->stats.pxonrxc) + \ 137 sizeof(((struct ixgbe_adapter *)0)->stats.pxoffrxc) + \
132 sizeof(((struct ixgbe_adapter *)0)->stats.pxontxc) + \ 138 sizeof(((struct ixgbe_adapter *)0)->stats.pxofftxc)) \
133 sizeof(((struct ixgbe_adapter *)0)->stats.pxoffrxc) + \ 139 / sizeof(u64))
134 sizeof(((struct ixgbe_adapter *)0)->stats.pxofftxc)) \
135 / sizeof(u64) : 0)
136#define IXGBE_STATS_LEN (IXGBE_GLOBAL_STATS_LEN + \ 140#define IXGBE_STATS_LEN (IXGBE_GLOBAL_STATS_LEN + \
137 IXGBE_PB_STATS_LEN + \ 141 IXGBE_PB_STATS_LEN + \
138 IXGBE_QUEUE_STATS_LEN) 142 IXGBE_QUEUE_STATS_LEN)
@@ -1078,8 +1082,15 @@ static void ixgbe_get_ethtool_stats(struct net_device *netdev,
1078 data[i] = (ixgbe_gstrings_stats[i].sizeof_stat == 1082 data[i] = (ixgbe_gstrings_stats[i].sizeof_stat ==
1079 sizeof(u64)) ? *(u64 *)p : *(u32 *)p; 1083 sizeof(u64)) ? *(u64 *)p : *(u32 *)p;
1080 } 1084 }
1081 for (j = 0; j < adapter->num_tx_queues; j++) { 1085 for (j = 0; j < IXGBE_NUM_RX_QUEUES; j++) {
1082 ring = adapter->tx_ring[j]; 1086 ring = adapter->tx_ring[j];
1087 if (!ring) {
1088 data[i] = 0;
1089 data[i+1] = 0;
1090 i += 2;
1091 continue;
1092 }
1093
1083 do { 1094 do {
1084 start = u64_stats_fetch_begin_bh(&ring->syncp); 1095 start = u64_stats_fetch_begin_bh(&ring->syncp);
1085 data[i] = ring->stats.packets; 1096 data[i] = ring->stats.packets;
@@ -1087,8 +1098,15 @@ static void ixgbe_get_ethtool_stats(struct net_device *netdev,
1087 } while (u64_stats_fetch_retry_bh(&ring->syncp, start)); 1098 } while (u64_stats_fetch_retry_bh(&ring->syncp, start));
1088 i += 2; 1099 i += 2;
1089 } 1100 }
1090 for (j = 0; j < adapter->num_rx_queues; j++) { 1101 for (j = 0; j < IXGBE_NUM_RX_QUEUES; j++) {
1091 ring = adapter->rx_ring[j]; 1102 ring = adapter->rx_ring[j];
1103 if (!ring) {
1104 data[i] = 0;
1105 data[i+1] = 0;
1106 i += 2;
1107 continue;
1108 }
1109
1092 do { 1110 do {
1093 start = u64_stats_fetch_begin_bh(&ring->syncp); 1111 start = u64_stats_fetch_begin_bh(&ring->syncp);
1094 data[i] = ring->stats.packets; 1112 data[i] = ring->stats.packets;
@@ -1096,22 +1114,20 @@ static void ixgbe_get_ethtool_stats(struct net_device *netdev,
1096 } while (u64_stats_fetch_retry_bh(&ring->syncp, start)); 1114 } while (u64_stats_fetch_retry_bh(&ring->syncp, start));
1097 i += 2; 1115 i += 2;
1098 } 1116 }
1099 if (adapter->flags & IXGBE_FLAG_DCB_ENABLED) { 1117
1100 for (j = 0; j < MAX_TX_PACKET_BUFFERS; j++) { 1118 for (j = 0; j < IXGBE_MAX_PACKET_BUFFERS; j++) {
1101 data[i++] = adapter->stats.pxontxc[j]; 1119 data[i++] = adapter->stats.pxontxc[j];
1102 data[i++] = adapter->stats.pxofftxc[j]; 1120 data[i++] = adapter->stats.pxofftxc[j];
1103 } 1121 }
1104 for (j = 0; j < MAX_RX_PACKET_BUFFERS; j++) { 1122 for (j = 0; j < IXGBE_MAX_PACKET_BUFFERS; j++) {
1105 data[i++] = adapter->stats.pxonrxc[j]; 1123 data[i++] = adapter->stats.pxonrxc[j];
1106 data[i++] = adapter->stats.pxoffrxc[j]; 1124 data[i++] = adapter->stats.pxoffrxc[j];
1107 }
1108 } 1125 }
1109} 1126}
1110 1127
1111static void ixgbe_get_strings(struct net_device *netdev, u32 stringset, 1128static void ixgbe_get_strings(struct net_device *netdev, u32 stringset,
1112 u8 *data) 1129 u8 *data)
1113{ 1130{
1114 struct ixgbe_adapter *adapter = netdev_priv(netdev);
1115 char *p = (char *)data; 1131 char *p = (char *)data;
1116 int i; 1132 int i;
1117 1133
@@ -1126,31 +1142,29 @@ static void ixgbe_get_strings(struct net_device *netdev, u32 stringset,
1126 ETH_GSTRING_LEN); 1142 ETH_GSTRING_LEN);
1127 p += ETH_GSTRING_LEN; 1143 p += ETH_GSTRING_LEN;
1128 } 1144 }
1129 for (i = 0; i < adapter->num_tx_queues; i++) { 1145 for (i = 0; i < netdev->num_tx_queues; i++) {
1130 sprintf(p, "tx_queue_%u_packets", i); 1146 sprintf(p, "tx_queue_%u_packets", i);
1131 p += ETH_GSTRING_LEN; 1147 p += ETH_GSTRING_LEN;
1132 sprintf(p, "tx_queue_%u_bytes", i); 1148 sprintf(p, "tx_queue_%u_bytes", i);
1133 p += ETH_GSTRING_LEN; 1149 p += ETH_GSTRING_LEN;
1134 } 1150 }
1135 for (i = 0; i < adapter->num_rx_queues; i++) { 1151 for (i = 0; i < IXGBE_NUM_RX_QUEUES; i++) {
1136 sprintf(p, "rx_queue_%u_packets", i); 1152 sprintf(p, "rx_queue_%u_packets", i);
1137 p += ETH_GSTRING_LEN; 1153 p += ETH_GSTRING_LEN;
1138 sprintf(p, "rx_queue_%u_bytes", i); 1154 sprintf(p, "rx_queue_%u_bytes", i);
1139 p += ETH_GSTRING_LEN; 1155 p += ETH_GSTRING_LEN;
1140 } 1156 }
1141 if (adapter->flags & IXGBE_FLAG_DCB_ENABLED) { 1157 for (i = 0; i < IXGBE_MAX_PACKET_BUFFERS; i++) {
1142 for (i = 0; i < MAX_TX_PACKET_BUFFERS; i++) { 1158 sprintf(p, "tx_pb_%u_pxon", i);
1143 sprintf(p, "tx_pb_%u_pxon", i); 1159 p += ETH_GSTRING_LEN;
1144 p += ETH_GSTRING_LEN; 1160 sprintf(p, "tx_pb_%u_pxoff", i);
1145 sprintf(p, "tx_pb_%u_pxoff", i); 1161 p += ETH_GSTRING_LEN;
1146 p += ETH_GSTRING_LEN; 1162 }
1147 } 1163 for (i = 0; i < IXGBE_MAX_PACKET_BUFFERS; i++) {
1148 for (i = 0; i < MAX_RX_PACKET_BUFFERS; i++) { 1164 sprintf(p, "rx_pb_%u_pxon", i);
1149 sprintf(p, "rx_pb_%u_pxon", i); 1165 p += ETH_GSTRING_LEN;
1150 p += ETH_GSTRING_LEN; 1166 sprintf(p, "rx_pb_%u_pxoff", i);
1151 sprintf(p, "rx_pb_%u_pxoff", i); 1167 p += ETH_GSTRING_LEN;
1152 p += ETH_GSTRING_LEN;
1153 }
1154 } 1168 }
1155 /* BUG_ON(p - data != IXGBE_STATS_LEN * ETH_GSTRING_LEN); */ 1169 /* BUG_ON(p - data != IXGBE_STATS_LEN * ETH_GSTRING_LEN); */
1156 break; 1170 break;
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
index ecc46ce8b2c3..6441acc34c23 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
@@ -2638,22 +2638,22 @@ static void ixgbe_configure_rscctl(struct ixgbe_adapter *adapter,
2638 /* 2638 /*
2639 * we must limit the number of descriptors so that the 2639 * we must limit the number of descriptors so that the
2640 * total size of max desc * buf_len is not greater 2640 * total size of max desc * buf_len is not greater
2641 * than 65535 2641 * than 65536
2642 */ 2642 */
2643 if (ring_is_ps_enabled(ring)) { 2643 if (ring_is_ps_enabled(ring)) {
2644#if (MAX_SKB_FRAGS > 16) 2644#if (PAGE_SIZE < 8192)
2645 rscctrl |= IXGBE_RSCCTL_MAXDESC_16; 2645 rscctrl |= IXGBE_RSCCTL_MAXDESC_16;
2646#elif (MAX_SKB_FRAGS > 8) 2646#elif (PAGE_SIZE < 16384)
2647 rscctrl |= IXGBE_RSCCTL_MAXDESC_8; 2647 rscctrl |= IXGBE_RSCCTL_MAXDESC_8;
2648#elif (MAX_SKB_FRAGS > 4) 2648#elif (PAGE_SIZE < 32768)
2649 rscctrl |= IXGBE_RSCCTL_MAXDESC_4; 2649 rscctrl |= IXGBE_RSCCTL_MAXDESC_4;
2650#else 2650#else
2651 rscctrl |= IXGBE_RSCCTL_MAXDESC_1; 2651 rscctrl |= IXGBE_RSCCTL_MAXDESC_1;
2652#endif 2652#endif
2653 } else { 2653 } else {
2654 if (rx_buf_len < IXGBE_RXBUFFER_4K) 2654 if (rx_buf_len <= IXGBE_RXBUFFER_4K)
2655 rscctrl |= IXGBE_RSCCTL_MAXDESC_16; 2655 rscctrl |= IXGBE_RSCCTL_MAXDESC_16;
2656 else if (rx_buf_len < IXGBE_RXBUFFER_8K) 2656 else if (rx_buf_len <= IXGBE_RXBUFFER_8K)
2657 rscctrl |= IXGBE_RSCCTL_MAXDESC_8; 2657 rscctrl |= IXGBE_RSCCTL_MAXDESC_8;
2658 else 2658 else
2659 rscctrl |= IXGBE_RSCCTL_MAXDESC_4; 2659 rscctrl |= IXGBE_RSCCTL_MAXDESC_4;
@@ -2835,7 +2835,7 @@ static void ixgbe_configure_virtualization(struct ixgbe_adapter *adapter)
2835 IXGBE_WRITE_REG(hw, IXGBE_VT_CTL, vmdctl | vt_reg_bits); 2835 IXGBE_WRITE_REG(hw, IXGBE_VT_CTL, vmdctl | vt_reg_bits);
2836 2836
2837 vf_shift = adapter->num_vfs % 32; 2837 vf_shift = adapter->num_vfs % 32;
2838 reg_offset = (adapter->num_vfs > 32) ? 1 : 0; 2838 reg_offset = (adapter->num_vfs >= 32) ? 1 : 0;
2839 2839
2840 /* Enable only the PF's pool for Tx/Rx */ 2840 /* Enable only the PF's pool for Tx/Rx */
2841 IXGBE_WRITE_REG(hw, IXGBE_VFRE(reg_offset), (1 << vf_shift)); 2841 IXGBE_WRITE_REG(hw, IXGBE_VFRE(reg_offset), (1 << vf_shift));
@@ -4335,6 +4335,10 @@ static int ixgbe_set_num_queues(struct ixgbe_adapter *adapter)
4335 adapter->num_tx_queues = 1; 4335 adapter->num_tx_queues = 1;
4336 4336
4337done: 4337done:
4338 if ((adapter->netdev->reg_state == NETREG_UNREGISTERED) ||
4339 (adapter->netdev->reg_state == NETREG_UNREGISTERING))
4340 return 0;
4341
4338 /* Notify the stack of the (possibly) reduced queue counts. */ 4342 /* Notify the stack of the (possibly) reduced queue counts. */
4339 netif_set_real_num_tx_queues(adapter->netdev, adapter->num_tx_queues); 4343 netif_set_real_num_tx_queues(adapter->netdev, adapter->num_tx_queues);
4340 return netif_set_real_num_rx_queues(adapter->netdev, 4344 return netif_set_real_num_rx_queues(adapter->netdev,
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c
index 8d8cdbc22df0..b01ecb4d2bb1 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c
@@ -67,7 +67,8 @@ static int ixgbe_find_enabled_vfs(struct ixgbe_adapter *adapter)
67 vf_devfn = pdev->devfn + 0x80; 67 vf_devfn = pdev->devfn + 0x80;
68 pvfdev = pci_get_device(IXGBE_INTEL_VENDOR_ID, device_id, NULL); 68 pvfdev = pci_get_device(IXGBE_INTEL_VENDOR_ID, device_id, NULL);
69 while (pvfdev) { 69 while (pvfdev) {
70 if (pvfdev->devfn == vf_devfn) 70 if (pvfdev->devfn == vf_devfn &&
71 (pvfdev->bus->number >= pdev->bus->number))
71 vfs_found++; 72 vfs_found++;
72 vf_devfn += 2; 73 vf_devfn += 2;
73 pvfdev = pci_get_device(IXGBE_INTEL_VENDOR_ID, 74 pvfdev = pci_get_device(IXGBE_INTEL_VENDOR_ID,
diff --git a/drivers/net/ethernet/marvell/skge.c b/drivers/net/ethernet/marvell/skge.c
index 1d61eaac8587..5a30bf823099 100644
--- a/drivers/net/ethernet/marvell/skge.c
+++ b/drivers/net/ethernet/marvell/skge.c
@@ -931,20 +931,17 @@ static int skge_ring_alloc(struct skge_ring *ring, void *vaddr, u32 base)
931} 931}
932 932
933/* Allocate and setup a new buffer for receiving */ 933/* Allocate and setup a new buffer for receiving */
934static int skge_rx_setup(struct pci_dev *pdev, 934static void skge_rx_setup(struct skge_port *skge, struct skge_element *e,
935 struct skge_element *e, 935 struct sk_buff *skb, unsigned int bufsize)
936 struct sk_buff *skb, unsigned int bufsize)
937{ 936{
938 struct skge_rx_desc *rd = e->desc; 937 struct skge_rx_desc *rd = e->desc;
939 dma_addr_t map; 938 u64 map;
940 939
941 map = pci_map_single(pdev, skb->data, bufsize, 940 map = pci_map_single(skge->hw->pdev, skb->data, bufsize,
942 PCI_DMA_FROMDEVICE); 941 PCI_DMA_FROMDEVICE);
943 if (pci_dma_mapping_error(pdev, map))
944 goto mapping_error;
945 942
946 rd->dma_lo = lower_32_bits(map); 943 rd->dma_lo = map;
947 rd->dma_hi = upper_32_bits(map); 944 rd->dma_hi = map >> 32;
948 e->skb = skb; 945 e->skb = skb;
949 rd->csum1_start = ETH_HLEN; 946 rd->csum1_start = ETH_HLEN;
950 rd->csum2_start = ETH_HLEN; 947 rd->csum2_start = ETH_HLEN;
@@ -956,13 +953,6 @@ static int skge_rx_setup(struct pci_dev *pdev,
956 rd->control = BMU_OWN | BMU_STF | BMU_IRQ_EOF | BMU_TCP_CHECK | bufsize; 953 rd->control = BMU_OWN | BMU_STF | BMU_IRQ_EOF | BMU_TCP_CHECK | bufsize;
957 dma_unmap_addr_set(e, mapaddr, map); 954 dma_unmap_addr_set(e, mapaddr, map);
958 dma_unmap_len_set(e, maplen, bufsize); 955 dma_unmap_len_set(e, maplen, bufsize);
959 return 0;
960
961mapping_error:
962 if (net_ratelimit())
963 dev_warn(&pdev->dev, "%s: rx mapping error\n",
964 skb->dev->name);
965 return -EIO;
966} 956}
967 957
968/* Resume receiving using existing skb, 958/* Resume receiving using existing skb,
@@ -1024,11 +1014,7 @@ static int skge_rx_fill(struct net_device *dev)
1024 return -ENOMEM; 1014 return -ENOMEM;
1025 1015
1026 skb_reserve(skb, NET_IP_ALIGN); 1016 skb_reserve(skb, NET_IP_ALIGN);
1027 if (skge_rx_setup(skge->hw->pdev, e, skb, skge->rx_buf_size)) { 1017 skge_rx_setup(skge, e, skb, skge->rx_buf_size);
1028 kfree_skb(skb);
1029 return -ENOMEM;
1030 }
1031
1032 } while ((e = e->next) != ring->start); 1018 } while ((e = e->next) != ring->start);
1033 1019
1034 ring->to_clean = ring->start; 1020 ring->to_clean = ring->start;
@@ -2743,7 +2729,7 @@ static netdev_tx_t skge_xmit_frame(struct sk_buff *skb,
2743 struct skge_tx_desc *td; 2729 struct skge_tx_desc *td;
2744 int i; 2730 int i;
2745 u32 control, len; 2731 u32 control, len;
2746 dma_addr_t map; 2732 u64 map;
2747 2733
2748 if (skb_padto(skb, ETH_ZLEN)) 2734 if (skb_padto(skb, ETH_ZLEN))
2749 return NETDEV_TX_OK; 2735 return NETDEV_TX_OK;
@@ -2757,14 +2743,11 @@ static netdev_tx_t skge_xmit_frame(struct sk_buff *skb,
2757 e->skb = skb; 2743 e->skb = skb;
2758 len = skb_headlen(skb); 2744 len = skb_headlen(skb);
2759 map = pci_map_single(hw->pdev, skb->data, len, PCI_DMA_TODEVICE); 2745 map = pci_map_single(hw->pdev, skb->data, len, PCI_DMA_TODEVICE);
2760 if (pci_dma_mapping_error(hw->pdev, map))
2761 goto mapping_error;
2762
2763 dma_unmap_addr_set(e, mapaddr, map); 2746 dma_unmap_addr_set(e, mapaddr, map);
2764 dma_unmap_len_set(e, maplen, len); 2747 dma_unmap_len_set(e, maplen, len);
2765 2748
2766 td->dma_lo = lower_32_bits(map); 2749 td->dma_lo = map;
2767 td->dma_hi = upper_32_bits(map); 2750 td->dma_hi = map >> 32;
2768 2751
2769 if (skb->ip_summed == CHECKSUM_PARTIAL) { 2752 if (skb->ip_summed == CHECKSUM_PARTIAL) {
2770 const int offset = skb_checksum_start_offset(skb); 2753 const int offset = skb_checksum_start_offset(skb);
@@ -2795,16 +2778,14 @@ static netdev_tx_t skge_xmit_frame(struct sk_buff *skb,
2795 2778
2796 map = skb_frag_dma_map(&hw->pdev->dev, frag, 0, 2779 map = skb_frag_dma_map(&hw->pdev->dev, frag, 0,
2797 skb_frag_size(frag), DMA_TO_DEVICE); 2780 skb_frag_size(frag), DMA_TO_DEVICE);
2798 if (dma_mapping_error(&hw->pdev->dev, map))
2799 goto mapping_unwind;
2800 2781
2801 e = e->next; 2782 e = e->next;
2802 e->skb = skb; 2783 e->skb = skb;
2803 tf = e->desc; 2784 tf = e->desc;
2804 BUG_ON(tf->control & BMU_OWN); 2785 BUG_ON(tf->control & BMU_OWN);
2805 2786
2806 tf->dma_lo = lower_32_bits(map); 2787 tf->dma_lo = map;
2807 tf->dma_hi = upper_32_bits(map); 2788 tf->dma_hi = (u64) map >> 32;
2808 dma_unmap_addr_set(e, mapaddr, map); 2789 dma_unmap_addr_set(e, mapaddr, map);
2809 dma_unmap_len_set(e, maplen, skb_frag_size(frag)); 2790 dma_unmap_len_set(e, maplen, skb_frag_size(frag));
2810 2791
@@ -2834,28 +2815,6 @@ static netdev_tx_t skge_xmit_frame(struct sk_buff *skb,
2834 } 2815 }
2835 2816
2836 return NETDEV_TX_OK; 2817 return NETDEV_TX_OK;
2837
2838mapping_unwind:
2839 /* unroll any pages that were already mapped. */
2840 if (e != skge->tx_ring.to_use) {
2841 struct skge_element *u;
2842
2843 for (u = skge->tx_ring.to_use->next; u != e; u = u->next)
2844 pci_unmap_page(hw->pdev, dma_unmap_addr(u, mapaddr),
2845 dma_unmap_len(u, maplen),
2846 PCI_DMA_TODEVICE);
2847 e = skge->tx_ring.to_use;
2848 }
2849 /* undo the mapping for the skb header */
2850 pci_unmap_single(hw->pdev, dma_unmap_addr(e, mapaddr),
2851 dma_unmap_len(e, maplen),
2852 PCI_DMA_TODEVICE);
2853mapping_error:
2854 /* mapping error causes error message and packet to be discarded. */
2855 if (net_ratelimit())
2856 dev_warn(&hw->pdev->dev, "%s: tx mapping error\n", dev->name);
2857 dev_kfree_skb(skb);
2858 return NETDEV_TX_OK;
2859} 2818}
2860 2819
2861 2820
@@ -3099,17 +3058,13 @@ static struct sk_buff *skge_rx_get(struct net_device *dev,
3099 if (!nskb) 3058 if (!nskb)
3100 goto resubmit; 3059 goto resubmit;
3101 3060
3102 if (unlikely(skge_rx_setup(skge->hw->pdev, e, nskb, skge->rx_buf_size))) {
3103 dev_kfree_skb(nskb);
3104 goto resubmit;
3105 }
3106
3107 pci_unmap_single(skge->hw->pdev, 3061 pci_unmap_single(skge->hw->pdev,
3108 dma_unmap_addr(e, mapaddr), 3062 dma_unmap_addr(e, mapaddr),
3109 dma_unmap_len(e, maplen), 3063 dma_unmap_len(e, maplen),
3110 PCI_DMA_FROMDEVICE); 3064 PCI_DMA_FROMDEVICE);
3111 skb = e->skb; 3065 skb = e->skb;
3112 prefetch(skb->data); 3066 prefetch(skb->data);
3067 skge_rx_setup(skge, e, nskb, skge->rx_buf_size);
3113 } 3068 }
3114 3069
3115 skb_put(skb, len); 3070 skb_put(skb, len);
diff --git a/drivers/net/ethernet/mellanox/mlx4/cmd.c b/drivers/net/ethernet/mellanox/mlx4/cmd.c
index 1831ddeebc42..48d5c48d7ce8 100644
--- a/drivers/net/ethernet/mellanox/mlx4/cmd.c
+++ b/drivers/net/ethernet/mellanox/mlx4/cmd.c
@@ -1616,12 +1616,12 @@ void mlx4_multi_func_cleanup(struct mlx4_dev *dev)
1616 kfree(priv->mfunc.master.slave_state[i].vlan_filter[port]); 1616 kfree(priv->mfunc.master.slave_state[i].vlan_filter[port]);
1617 } 1617 }
1618 kfree(priv->mfunc.master.slave_state); 1618 kfree(priv->mfunc.master.slave_state);
1619 iounmap(priv->mfunc.comm);
1620 dma_free_coherent(&(dev->pdev->dev), PAGE_SIZE,
1621 priv->mfunc.vhcr,
1622 priv->mfunc.vhcr_dma);
1623 priv->mfunc.vhcr = NULL;
1624 } 1619 }
1620
1621 iounmap(priv->mfunc.comm);
1622 dma_free_coherent(&(dev->pdev->dev), PAGE_SIZE,
1623 priv->mfunc.vhcr, priv->mfunc.vhcr_dma);
1624 priv->mfunc.vhcr = NULL;
1625} 1625}
1626 1626
1627void mlx4_cmd_cleanup(struct mlx4_dev *dev) 1627void mlx4_cmd_cleanup(struct mlx4_dev *dev)
diff --git a/drivers/net/ethernet/mellanox/mlx4/en_netdev.c b/drivers/net/ethernet/mellanox/mlx4/en_netdev.c
index 25e6480479df..9fe4f94c6da7 100644
--- a/drivers/net/ethernet/mellanox/mlx4/en_netdev.c
+++ b/drivers/net/ethernet/mellanox/mlx4/en_netdev.c
@@ -892,7 +892,8 @@ void mlx4_en_free_resources(struct mlx4_en_priv *priv)
892 892
893 for (i = 0; i < priv->rx_ring_num; i++) { 893 for (i = 0; i < priv->rx_ring_num; i++) {
894 if (priv->rx_ring[i].rx_info) 894 if (priv->rx_ring[i].rx_info)
895 mlx4_en_destroy_rx_ring(priv, &priv->rx_ring[i]); 895 mlx4_en_destroy_rx_ring(priv, &priv->rx_ring[i],
896 priv->prof->rx_ring_size, priv->stride);
896 if (priv->rx_cq[i].buf) 897 if (priv->rx_cq[i].buf)
897 mlx4_en_destroy_cq(priv, &priv->rx_cq[i]); 898 mlx4_en_destroy_cq(priv, &priv->rx_cq[i]);
898 } 899 }
diff --git a/drivers/net/ethernet/mellanox/mlx4/en_rx.c b/drivers/net/ethernet/mellanox/mlx4/en_rx.c
index fb6e899f38d3..d703ef2c9c91 100644
--- a/drivers/net/ethernet/mellanox/mlx4/en_rx.c
+++ b/drivers/net/ethernet/mellanox/mlx4/en_rx.c
@@ -168,8 +168,12 @@ static int mlx4_en_prepare_rx_desc(struct mlx4_en_priv *priv,
168 return 0; 168 return 0;
169 169
170err: 170err:
171 while (i--) 171 while (i--) {
172 dma_addr_t dma = be64_to_cpu(rx_desc->data[i].addr);
173 pci_unmap_single(priv->mdev->pdev, dma, skb_frags[i].size,
174 PCI_DMA_FROMDEVICE);
172 put_page(skb_frags[i].page); 175 put_page(skb_frags[i].page);
176 }
173 return -ENOMEM; 177 return -ENOMEM;
174} 178}
175 179
@@ -379,12 +383,12 @@ err_allocator:
379} 383}
380 384
381void mlx4_en_destroy_rx_ring(struct mlx4_en_priv *priv, 385void mlx4_en_destroy_rx_ring(struct mlx4_en_priv *priv,
382 struct mlx4_en_rx_ring *ring) 386 struct mlx4_en_rx_ring *ring, u32 size, u16 stride)
383{ 387{
384 struct mlx4_en_dev *mdev = priv->mdev; 388 struct mlx4_en_dev *mdev = priv->mdev;
385 389
386 mlx4_en_unmap_buffer(&ring->wqres.buf); 390 mlx4_en_unmap_buffer(&ring->wqres.buf);
387 mlx4_free_hwq_res(mdev->dev, &ring->wqres, ring->buf_size + TXBB_SIZE); 391 mlx4_free_hwq_res(mdev->dev, &ring->wqres, size * stride + TXBB_SIZE);
388 vfree(ring->rx_info); 392 vfree(ring->rx_info);
389 ring->rx_info = NULL; 393 ring->rx_info = NULL;
390} 394}
diff --git a/drivers/net/ethernet/mellanox/mlx4/mcg.c b/drivers/net/ethernet/mellanox/mlx4/mcg.c
index 0785d9b2a265..ca574d850b39 100644
--- a/drivers/net/ethernet/mellanox/mlx4/mcg.c
+++ b/drivers/net/ethernet/mellanox/mlx4/mcg.c
@@ -136,7 +136,7 @@ static int new_steering_entry(struct mlx4_dev *dev, u8 port,
136 u32 prot; 136 u32 prot;
137 int err; 137 int err;
138 138
139 s_steer = &mlx4_priv(dev)->steer[0]; 139 s_steer = &mlx4_priv(dev)->steer[port - 1];
140 new_entry = kzalloc(sizeof *new_entry, GFP_KERNEL); 140 new_entry = kzalloc(sizeof *new_entry, GFP_KERNEL);
141 if (!new_entry) 141 if (!new_entry)
142 return -ENOMEM; 142 return -ENOMEM;
@@ -220,7 +220,7 @@ static int existing_steering_entry(struct mlx4_dev *dev, u8 port,
220 struct mlx4_promisc_qp *pqp; 220 struct mlx4_promisc_qp *pqp;
221 struct mlx4_promisc_qp *dqp; 221 struct mlx4_promisc_qp *dqp;
222 222
223 s_steer = &mlx4_priv(dev)->steer[0]; 223 s_steer = &mlx4_priv(dev)->steer[port - 1];
224 224
225 pqp = get_promisc_qp(dev, 0, steer, qpn); 225 pqp = get_promisc_qp(dev, 0, steer, qpn);
226 if (!pqp) 226 if (!pqp)
@@ -265,7 +265,7 @@ static bool check_duplicate_entry(struct mlx4_dev *dev, u8 port,
265 struct mlx4_steer_index *tmp_entry, *entry = NULL; 265 struct mlx4_steer_index *tmp_entry, *entry = NULL;
266 struct mlx4_promisc_qp *dqp, *tmp_dqp; 266 struct mlx4_promisc_qp *dqp, *tmp_dqp;
267 267
268 s_steer = &mlx4_priv(dev)->steer[0]; 268 s_steer = &mlx4_priv(dev)->steer[port - 1];
269 269
270 /* if qp is not promisc, it cannot be duplicated */ 270 /* if qp is not promisc, it cannot be duplicated */
271 if (!get_promisc_qp(dev, 0, steer, qpn)) 271 if (!get_promisc_qp(dev, 0, steer, qpn))
@@ -306,7 +306,7 @@ static bool can_remove_steering_entry(struct mlx4_dev *dev, u8 port,
306 bool ret = false; 306 bool ret = false;
307 int i; 307 int i;
308 308
309 s_steer = &mlx4_priv(dev)->steer[0]; 309 s_steer = &mlx4_priv(dev)->steer[port - 1];
310 310
311 mailbox = mlx4_alloc_cmd_mailbox(dev); 311 mailbox = mlx4_alloc_cmd_mailbox(dev);
312 if (IS_ERR(mailbox)) 312 if (IS_ERR(mailbox))
@@ -361,7 +361,7 @@ static int add_promisc_qp(struct mlx4_dev *dev, u8 port,
361 int err; 361 int err;
362 struct mlx4_priv *priv = mlx4_priv(dev); 362 struct mlx4_priv *priv = mlx4_priv(dev);
363 363
364 s_steer = &mlx4_priv(dev)->steer[0]; 364 s_steer = &mlx4_priv(dev)->steer[port - 1];
365 365
366 mutex_lock(&priv->mcg_table.mutex); 366 mutex_lock(&priv->mcg_table.mutex);
367 367
@@ -466,7 +466,7 @@ static int remove_promisc_qp(struct mlx4_dev *dev, u8 port,
466 int loc, i; 466 int loc, i;
467 int err; 467 int err;
468 468
469 s_steer = &mlx4_priv(dev)->steer[0]; 469 s_steer = &mlx4_priv(dev)->steer[port - 1];
470 mutex_lock(&priv->mcg_table.mutex); 470 mutex_lock(&priv->mcg_table.mutex);
471 471
472 pqp = get_promisc_qp(dev, 0, steer, qpn); 472 pqp = get_promisc_qp(dev, 0, steer, qpn);
@@ -1004,7 +1004,7 @@ EXPORT_SYMBOL_GPL(mlx4_multicast_promisc_remove);
1004 1004
1005int mlx4_unicast_promisc_add(struct mlx4_dev *dev, u32 qpn, u8 port) 1005int mlx4_unicast_promisc_add(struct mlx4_dev *dev, u32 qpn, u8 port)
1006{ 1006{
1007 if (!(dev->caps.flags & MLX4_DEV_CAP_FLAG_VEP_MC_STEER)) 1007 if (!(dev->caps.flags & MLX4_DEV_CAP_FLAG_VEP_UC_STEER))
1008 return 0; 1008 return 0;
1009 1009
1010 if (mlx4_is_mfunc(dev)) 1010 if (mlx4_is_mfunc(dev))
@@ -1016,7 +1016,7 @@ EXPORT_SYMBOL_GPL(mlx4_unicast_promisc_add);
1016 1016
1017int mlx4_unicast_promisc_remove(struct mlx4_dev *dev, u32 qpn, u8 port) 1017int mlx4_unicast_promisc_remove(struct mlx4_dev *dev, u32 qpn, u8 port)
1018{ 1018{
1019 if (!(dev->caps.flags & MLX4_DEV_CAP_FLAG_VEP_MC_STEER)) 1019 if (!(dev->caps.flags & MLX4_DEV_CAP_FLAG_VEP_UC_STEER))
1020 return 0; 1020 return 0;
1021 1021
1022 if (mlx4_is_mfunc(dev)) 1022 if (mlx4_is_mfunc(dev))
diff --git a/drivers/net/ethernet/mellanox/mlx4/mlx4_en.h b/drivers/net/ethernet/mellanox/mlx4/mlx4_en.h
index 35f08840813c..d60335f3c473 100644
--- a/drivers/net/ethernet/mellanox/mlx4/mlx4_en.h
+++ b/drivers/net/ethernet/mellanox/mlx4/mlx4_en.h
@@ -528,7 +528,8 @@ int mlx4_en_create_rx_ring(struct mlx4_en_priv *priv,
528 struct mlx4_en_rx_ring *ring, 528 struct mlx4_en_rx_ring *ring,
529 u32 size, u16 stride); 529 u32 size, u16 stride);
530void mlx4_en_destroy_rx_ring(struct mlx4_en_priv *priv, 530void mlx4_en_destroy_rx_ring(struct mlx4_en_priv *priv,
531 struct mlx4_en_rx_ring *ring); 531 struct mlx4_en_rx_ring *ring,
532 u32 size, u16 stride);
532int mlx4_en_activate_rx_rings(struct mlx4_en_priv *priv); 533int mlx4_en_activate_rx_rings(struct mlx4_en_priv *priv);
533void mlx4_en_deactivate_rx_ring(struct mlx4_en_priv *priv, 534void mlx4_en_deactivate_rx_ring(struct mlx4_en_priv *priv,
534 struct mlx4_en_rx_ring *ring); 535 struct mlx4_en_rx_ring *ring);
diff --git a/drivers/net/ethernet/micrel/Kconfig b/drivers/net/ethernet/micrel/Kconfig
index 1ea811cf515b..fe42fc00d8d3 100644
--- a/drivers/net/ethernet/micrel/Kconfig
+++ b/drivers/net/ethernet/micrel/Kconfig
@@ -42,7 +42,6 @@ config KS8851
42 select NET_CORE 42 select NET_CORE
43 select MII 43 select MII
44 select CRC32 44 select CRC32
45 select MISC_DEVICES
46 select EEPROM_93CX6 45 select EEPROM_93CX6
47 ---help--- 46 ---help---
48 SPI driver for Micrel KS8851 SPI attached network chip. 47 SPI driver for Micrel KS8851 SPI attached network chip.
diff --git a/drivers/net/ethernet/renesas/sh_eth.c b/drivers/net/ethernet/renesas/sh_eth.c
index 1a69504ed9c5..cfad09107054 100644
--- a/drivers/net/ethernet/renesas/sh_eth.c
+++ b/drivers/net/ethernet/renesas/sh_eth.c
@@ -38,6 +38,7 @@
38#include <linux/pm_runtime.h> 38#include <linux/pm_runtime.h>
39#include <linux/slab.h> 39#include <linux/slab.h>
40#include <linux/ethtool.h> 40#include <linux/ethtool.h>
41#include <linux/if_vlan.h>
41#include <linux/sh_eth.h> 42#include <linux/sh_eth.h>
42 43
43#include "sh_eth.h" 44#include "sh_eth.h"
@@ -816,7 +817,8 @@ static int sh_eth_dev_init(struct net_device *ndev)
816 sh_eth_write(ndev, 0, TRIMD); 817 sh_eth_write(ndev, 0, TRIMD);
817 818
818 /* Recv frame limit set register */ 819 /* Recv frame limit set register */
819 sh_eth_write(ndev, RFLR_VALUE, RFLR); 820 sh_eth_write(ndev, ndev->mtu + ETH_HLEN + VLAN_HLEN + ETH_FCS_LEN,
821 RFLR);
820 822
821 sh_eth_write(ndev, sh_eth_read(ndev, EESR), EESR); 823 sh_eth_write(ndev, sh_eth_read(ndev, EESR), EESR);
822 sh_eth_write(ndev, mdp->cd->eesipr_value, EESIPR); 824 sh_eth_write(ndev, mdp->cd->eesipr_value, EESIPR);
diff --git a/drivers/net/ethernet/renesas/sh_eth.h b/drivers/net/ethernet/renesas/sh_eth.h
index ba72976926fd..cb07add8638f 100644
--- a/drivers/net/ethernet/renesas/sh_eth.h
+++ b/drivers/net/ethernet/renesas/sh_eth.h
@@ -575,9 +575,6 @@ enum RPADIR_BIT {
575 RPADIR_PADR = 0x0003f, 575 RPADIR_PADR = 0x0003f,
576}; 576};
577 577
578/* RFLR */
579#define RFLR_VALUE 0x1000
580
581/* FDR */ 578/* FDR */
582#define DEFAULT_FDR_INIT 0x00000707 579#define DEFAULT_FDR_INIT 0x00000707
583 580
diff --git a/drivers/net/ethernet/toshiba/Kconfig b/drivers/net/ethernet/toshiba/Kconfig
index 051764704559..74acb5cf6099 100644
--- a/drivers/net/ethernet/toshiba/Kconfig
+++ b/drivers/net/ethernet/toshiba/Kconfig
@@ -5,7 +5,7 @@
5config NET_VENDOR_TOSHIBA 5config NET_VENDOR_TOSHIBA
6 bool "Toshiba devices" 6 bool "Toshiba devices"
7 default y 7 default y
8 depends on PCI && (PPC_IBM_CELL_BLADE || PPC_CELLEB) || PPC_PS3 8 depends on PCI && (PPC_IBM_CELL_BLADE || PPC_CELLEB || MIPS) || PPC_PS3
9 ---help--- 9 ---help---
10 If you have a network (Ethernet) card belonging to this class, say Y 10 If you have a network (Ethernet) card belonging to this class, say Y
11 and read the Ethernet-HOWTO, available from 11 and read the Ethernet-HOWTO, available from
diff --git a/drivers/net/ethernet/via/via-velocity.c b/drivers/net/ethernet/via/via-velocity.c
index cf69cbf6fec3..8a5d7c100a5e 100644
--- a/drivers/net/ethernet/via/via-velocity.c
+++ b/drivers/net/ethernet/via/via-velocity.c
@@ -2491,9 +2491,6 @@ static int velocity_close(struct net_device *dev)
2491 if (dev->irq != 0) 2491 if (dev->irq != 0)
2492 free_irq(dev->irq, dev); 2492 free_irq(dev->irq, dev);
2493 2493
2494 /* Power down the chip */
2495 pci_set_power_state(vptr->pdev, PCI_D3hot);
2496
2497 velocity_free_rings(vptr); 2494 velocity_free_rings(vptr);
2498 2495
2499 vptr->flags &= (~VELOCITY_FLAGS_OPENED); 2496 vptr->flags &= (~VELOCITY_FLAGS_OPENED);
diff --git a/drivers/net/tokenring/Kconfig b/drivers/net/tokenring/Kconfig
index c7e0149d1514..45550d42b368 100644
--- a/drivers/net/tokenring/Kconfig
+++ b/drivers/net/tokenring/Kconfig
@@ -7,7 +7,6 @@ menuconfig TR
7 bool "Token Ring driver support" 7 bool "Token Ring driver support"
8 depends on NETDEVICES && !UML 8 depends on NETDEVICES && !UML
9 depends on (PCI || ISA || MCA || CCW || PCMCIA) 9 depends on (PCI || ISA || MCA || CCW || PCMCIA)
10 select LLC
11 help 10 help
12 Token Ring is IBM's way of communication on a local network; the 11 Token Ring is IBM's way of communication on a local network; the
13 rest of the world uses Ethernet. To participate on a Token Ring 12 rest of the world uses Ethernet. To participate on a Token Ring
@@ -20,6 +19,10 @@ menuconfig TR
20 19
21if TR 20if TR
22 21
22config WANT_LLC
23 def_bool y
24 select LLC
25
23config PCMCIA_IBMTR 26config PCMCIA_IBMTR
24 tristate "IBM PCMCIA tokenring adapter support" 27 tristate "IBM PCMCIA tokenring adapter support"
25 depends on IBMTR!=y && PCMCIA 28 depends on IBMTR!=y && PCMCIA
diff --git a/drivers/net/wireless/ath/ath9k/hw.c b/drivers/net/wireless/ath/ath9k/hw.c
index ee7759575050..87db1ee1c298 100644
--- a/drivers/net/wireless/ath/ath9k/hw.c
+++ b/drivers/net/wireless/ath/ath9k/hw.c
@@ -1037,13 +1037,16 @@ void ath9k_hw_init_global_settings(struct ath_hw *ah)
1037 1037
1038 /* 1038 /*
1039 * Workaround for early ACK timeouts, add an offset to match the 1039 * Workaround for early ACK timeouts, add an offset to match the
1040 * initval's 64us ack timeout value. 1040 * initval's 64us ack timeout value. Use 48us for the CTS timeout.
1041 * This was initially only meant to work around an issue with delayed 1041 * This was initially only meant to work around an issue with delayed
1042 * BA frames in some implementations, but it has been found to fix ACK 1042 * BA frames in some implementations, but it has been found to fix ACK
1043 * timeout issues in other cases as well. 1043 * timeout issues in other cases as well.
1044 */ 1044 */
1045 if (conf->channel && conf->channel->band == IEEE80211_BAND_2GHZ) 1045 if (conf->channel && conf->channel->band == IEEE80211_BAND_2GHZ) {
1046 acktimeout += 64 - sifstime - ah->slottime; 1046 acktimeout += 64 - sifstime - ah->slottime;
1047 ctstimeout += 48 - sifstime - ah->slottime;
1048 }
1049
1047 1050
1048 ath9k_hw_set_sifs_time(ah, sifstime); 1051 ath9k_hw_set_sifs_time(ah, sifstime);
1049 ath9k_hw_setslottime(ah, slottime); 1052 ath9k_hw_setslottime(ah, slottime);
diff --git a/drivers/net/wireless/ath/ath9k/init.c b/drivers/net/wireless/ath/ath9k/init.c
index abf943557dee..53a005d288aa 100644
--- a/drivers/net/wireless/ath/ath9k/init.c
+++ b/drivers/net/wireless/ath/ath9k/init.c
@@ -822,6 +822,11 @@ int ath9k_init_device(u16 devid, struct ath_softc *sc,
822 ARRAY_SIZE(ath9k_tpt_blink)); 822 ARRAY_SIZE(ath9k_tpt_blink));
823#endif 823#endif
824 824
825 INIT_WORK(&sc->hw_reset_work, ath_reset_work);
826 INIT_WORK(&sc->hw_check_work, ath_hw_check);
827 INIT_WORK(&sc->paprd_work, ath_paprd_calibrate);
828 INIT_DELAYED_WORK(&sc->hw_pll_work, ath_hw_pll_work);
829
825 /* Register with mac80211 */ 830 /* Register with mac80211 */
826 error = ieee80211_register_hw(hw); 831 error = ieee80211_register_hw(hw);
827 if (error) 832 if (error)
@@ -840,10 +845,6 @@ int ath9k_init_device(u16 devid, struct ath_softc *sc,
840 goto error_world; 845 goto error_world;
841 } 846 }
842 847
843 INIT_WORK(&sc->hw_reset_work, ath_reset_work);
844 INIT_WORK(&sc->hw_check_work, ath_hw_check);
845 INIT_WORK(&sc->paprd_work, ath_paprd_calibrate);
846 INIT_DELAYED_WORK(&sc->hw_pll_work, ath_hw_pll_work);
847 sc->last_rssi = ATH_RSSI_DUMMY_MARKER; 848 sc->last_rssi = ATH_RSSI_DUMMY_MARKER;
848 849
849 ath_init_leds(sc); 850 ath_init_leds(sc);
diff --git a/drivers/net/wireless/ath/ath9k/recv.c b/drivers/net/wireless/ath/ath9k/recv.c
index 0e666fbe0842..7e1a91af1497 100644
--- a/drivers/net/wireless/ath/ath9k/recv.c
+++ b/drivers/net/wireless/ath/ath9k/recv.c
@@ -822,6 +822,14 @@ static bool ath9k_rx_accept(struct ath_common *common,
822 (ATH9K_RXERR_DECRYPT | ATH9K_RXERR_CRC | ATH9K_RXERR_MIC | 822 (ATH9K_RXERR_DECRYPT | ATH9K_RXERR_CRC | ATH9K_RXERR_MIC |
823 ATH9K_RXERR_KEYMISS)); 823 ATH9K_RXERR_KEYMISS));
824 824
825 /*
826 * Key miss events are only relevant for pairwise keys where the
827 * descriptor does contain a valid key index. This has been observed
828 * mostly with CCMP encryption.
829 */
830 if (rx_stats->rs_keyix == ATH9K_RXKEYIX_INVALID)
831 rx_stats->rs_status &= ~ATH9K_RXERR_KEYMISS;
832
825 if (!rx_stats->rs_datalen) 833 if (!rx_stats->rs_datalen)
826 return false; 834 return false;
827 /* 835 /*
diff --git a/drivers/net/wireless/mwifiex/init.c b/drivers/net/wireless/mwifiex/init.c
index e13b6d99171a..84fcb741a296 100644
--- a/drivers/net/wireless/mwifiex/init.c
+++ b/drivers/net/wireless/mwifiex/init.c
@@ -382,7 +382,8 @@ mwifiex_free_adapter(struct mwifiex_adapter *adapter)
382 382
383 adapter->if_ops.cleanup_if(adapter); 383 adapter->if_ops.cleanup_if(adapter);
384 384
385 dev_kfree_skb_any(adapter->sleep_cfm); 385 if (adapter->sleep_cfm)
386 dev_kfree_skb_any(adapter->sleep_cfm);
386} 387}
387 388
388/* 389/*
diff --git a/drivers/net/wireless/mwifiex/main.c b/drivers/net/wireless/mwifiex/main.c
index 80e44566bf6e..790a3796483c 100644
--- a/drivers/net/wireless/mwifiex/main.c
+++ b/drivers/net/wireless/mwifiex/main.c
@@ -811,7 +811,9 @@ int mwifiex_remove_card(struct mwifiex_adapter *adapter, struct semaphore *sem)
811 continue; 811 continue;
812 812
813 rtnl_lock(); 813 rtnl_lock();
814 mwifiex_del_virtual_intf(priv->wdev->wiphy, priv->netdev); 814 if (priv->wdev && priv->netdev)
815 mwifiex_del_virtual_intf(priv->wdev->wiphy,
816 priv->netdev);
815 rtnl_unlock(); 817 rtnl_unlock();
816 } 818 }
817 819
@@ -819,9 +821,11 @@ int mwifiex_remove_card(struct mwifiex_adapter *adapter, struct semaphore *sem)
819 if (!priv) 821 if (!priv)
820 goto exit_remove; 822 goto exit_remove;
821 823
822 wiphy_unregister(priv->wdev->wiphy); 824 if (priv->wdev) {
823 wiphy_free(priv->wdev->wiphy); 825 wiphy_unregister(priv->wdev->wiphy);
824 kfree(priv->wdev); 826 wiphy_free(priv->wdev->wiphy);
827 kfree(priv->wdev);
828 }
825 829
826 mwifiex_terminate_workqueue(adapter); 830 mwifiex_terminate_workqueue(adapter);
827 831
diff --git a/drivers/net/wireless/mwifiex/sta_ioctl.c b/drivers/net/wireless/mwifiex/sta_ioctl.c
index 470ca75ec250..b0fbf5d4fea0 100644
--- a/drivers/net/wireless/mwifiex/sta_ioctl.c
+++ b/drivers/net/wireless/mwifiex/sta_ioctl.c
@@ -54,7 +54,7 @@ int mwifiex_copy_mcast_addr(struct mwifiex_multicast_list *mlist,
54int mwifiex_wait_queue_complete(struct mwifiex_adapter *adapter) 54int mwifiex_wait_queue_complete(struct mwifiex_adapter *adapter)
55{ 55{
56 bool cancel_flag = false; 56 bool cancel_flag = false;
57 int status = adapter->cmd_wait_q.status; 57 int status;
58 struct cmd_ctrl_node *cmd_queued; 58 struct cmd_ctrl_node *cmd_queued;
59 59
60 if (!adapter->cmd_queued) 60 if (!adapter->cmd_queued)
@@ -79,6 +79,8 @@ int mwifiex_wait_queue_complete(struct mwifiex_adapter *adapter)
79 mwifiex_cancel_pending_ioctl(adapter); 79 mwifiex_cancel_pending_ioctl(adapter);
80 dev_dbg(adapter->dev, "cmd cancel\n"); 80 dev_dbg(adapter->dev, "cmd cancel\n");
81 } 81 }
82
83 status = adapter->cmd_wait_q.status;
82 adapter->cmd_wait_q.status = 0; 84 adapter->cmd_wait_q.status = 0;
83 85
84 return status; 86 return status;
@@ -240,6 +242,8 @@ int mwifiex_bss_start(struct mwifiex_private *priv, struct cfg80211_bss *bss,
240 242
241 if (!netif_queue_stopped(priv->netdev)) 243 if (!netif_queue_stopped(priv->netdev))
242 mwifiex_stop_net_dev_queue(priv->netdev, adapter); 244 mwifiex_stop_net_dev_queue(priv->netdev, adapter);
245 if (netif_carrier_ok(priv->netdev))
246 netif_carrier_off(priv->netdev);
243 247
244 /* Clear any past association response stored for 248 /* Clear any past association response stored for
245 * application retrieval */ 249 * application retrieval */
@@ -271,6 +275,8 @@ int mwifiex_bss_start(struct mwifiex_private *priv, struct cfg80211_bss *bss,
271 275
272 if (!netif_queue_stopped(priv->netdev)) 276 if (!netif_queue_stopped(priv->netdev))
273 mwifiex_stop_net_dev_queue(priv->netdev, adapter); 277 mwifiex_stop_net_dev_queue(priv->netdev, adapter);
278 if (netif_carrier_ok(priv->netdev))
279 netif_carrier_off(priv->netdev);
274 280
275 if (!ret) { 281 if (!ret) {
276 dev_dbg(adapter->dev, "info: network found in scan" 282 dev_dbg(adapter->dev, "info: network found in scan"
diff --git a/drivers/net/wireless/zd1211rw/zd_mac.c b/drivers/net/wireless/zd1211rw/zd_mac.c
index 0a70149df3fc..98a574a4a465 100644
--- a/drivers/net/wireless/zd1211rw/zd_mac.c
+++ b/drivers/net/wireless/zd1211rw/zd_mac.c
@@ -866,6 +866,14 @@ static int fill_ctrlset(struct zd_mac *mac,
866 866
867 ZD_ASSERT(frag_len <= 0xffff); 867 ZD_ASSERT(frag_len <= 0xffff);
868 868
869 /*
870 * Firmware computes the duration itself (for all frames except PSPoll)
871 * and needs the field set to 0 at input, otherwise firmware messes up
872 * duration_id and sets bits 14 and 15 on.
873 */
874 if (!ieee80211_is_pspoll(hdr->frame_control))
875 hdr->duration_id = 0;
876
869 txrate = ieee80211_get_tx_rate(mac->hw, info); 877 txrate = ieee80211_get_tx_rate(mac->hw, info);
870 878
871 cs->modulation = txrate->hw_value; 879 cs->modulation = txrate->hw_value;