aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/bnx2x.c6
-rw-r--r--drivers/net/ehea/ehea.h3
-rw-r--r--drivers/net/ehea/ehea_main.c24
-rw-r--r--drivers/net/forcedeth.c31
-rw-r--r--drivers/net/fs_enet/fs_enet-main.c3
-rw-r--r--drivers/net/macb.c14
-rw-r--r--drivers/net/phy/marvell.c2
-rw-r--r--drivers/net/sc92031.c1
-rw-r--r--drivers/net/sky2.c1
-rw-r--r--drivers/net/smc91x.c2
-rw-r--r--drivers/net/starfire.c11
-rw-r--r--drivers/net/tg3.c157
-rw-r--r--drivers/net/tg3.h79
-rw-r--r--drivers/net/tokenring/olympic.c21
-rw-r--r--drivers/net/tun.c38
-rw-r--r--drivers/net/ucc_geth.c53
-rw-r--r--drivers/net/virtio_net.c5
-rw-r--r--drivers/net/wan/Kconfig6
-rw-r--r--drivers/net/wireless/hostap/hostap_80211_rx.c39
-rw-r--r--drivers/net/wireless/hostap/hostap_80211_tx.c7
-rw-r--r--drivers/net/wireless/hostap/hostap_ap.c203
-rw-r--r--drivers/net/wireless/ipw2200.c8
-rw-r--r--drivers/net/wireless/libertas/assoc.c2
-rw-r--r--drivers/net/wireless/rt2x00/rt61pci.c4
24 files changed, 543 insertions, 177 deletions
diff --git a/drivers/net/bnx2x.c b/drivers/net/bnx2x.c
index de32b3fba322..7bdb5af35951 100644
--- a/drivers/net/bnx2x.c
+++ b/drivers/net/bnx2x.c
@@ -63,8 +63,8 @@
63#include "bnx2x.h" 63#include "bnx2x.h"
64#include "bnx2x_init.h" 64#include "bnx2x_init.h"
65 65
66#define DRV_MODULE_VERSION "1.42.3" 66#define DRV_MODULE_VERSION "1.42.4"
67#define DRV_MODULE_RELDATE "2008/3/9" 67#define DRV_MODULE_RELDATE "2008/4/9"
68#define BNX2X_BC_VER 0x040200 68#define BNX2X_BC_VER 0x040200
69 69
70/* Time in jiffies before concluding the transmitter is hung. */ 70/* Time in jiffies before concluding the transmitter is hung. */
@@ -6153,7 +6153,7 @@ static int bnx2x_function_init(struct bnx2x *bp, int mode)
6153 func, mode); 6153 func, mode);
6154 REG_WR(bp, GRCBASE_MISC + MISC_REGISTERS_RESET_REG_1_SET, 6154 REG_WR(bp, GRCBASE_MISC + MISC_REGISTERS_RESET_REG_1_SET,
6155 0xffffffff); 6155 0xffffffff);
6156 REG_WR(bp, GRCBASE_MISC + MISC_REGISTERS_RESET_REG_1_SET, 6156 REG_WR(bp, GRCBASE_MISC + MISC_REGISTERS_RESET_REG_2_SET,
6157 0xfffc); 6157 0xfffc);
6158 bnx2x_init_block(bp, MISC_COMMON_START, MISC_COMMON_END); 6158 bnx2x_init_block(bp, MISC_COMMON_START, MISC_COMMON_END);
6159 6159
diff --git a/drivers/net/ehea/ehea.h b/drivers/net/ehea/ehea.h
index 26acd05c80b5..f5dacceab95b 100644
--- a/drivers/net/ehea/ehea.h
+++ b/drivers/net/ehea/ehea.h
@@ -40,7 +40,7 @@
40#include <asm/io.h> 40#include <asm/io.h>
41 41
42#define DRV_NAME "ehea" 42#define DRV_NAME "ehea"
43#define DRV_VERSION "EHEA_0089" 43#define DRV_VERSION "EHEA_0090"
44 44
45/* eHEA capability flags */ 45/* eHEA capability flags */
46#define DLPAR_PORT_ADD_REM 1 46#define DLPAR_PORT_ADD_REM 1
@@ -371,6 +371,7 @@ struct ehea_port_res {
371 struct ehea_q_skb_arr rq2_skba; 371 struct ehea_q_skb_arr rq2_skba;
372 struct ehea_q_skb_arr rq3_skba; 372 struct ehea_q_skb_arr rq3_skba;
373 struct ehea_q_skb_arr sq_skba; 373 struct ehea_q_skb_arr sq_skba;
374 int sq_skba_size;
374 spinlock_t netif_queue; 375 spinlock_t netif_queue;
375 int queue_stopped; 376 int queue_stopped;
376 int swqe_refill_th; 377 int swqe_refill_th;
diff --git a/drivers/net/ehea/ehea_main.c b/drivers/net/ehea/ehea_main.c
index 0c1c360a85ca..9ff7538b7595 100644
--- a/drivers/net/ehea/ehea_main.c
+++ b/drivers/net/ehea/ehea_main.c
@@ -350,7 +350,8 @@ static void ehea_refill_rq1(struct ehea_port_res *pr, int index, int nr_of_wqes)
350 pr->rq1_skba.os_skbs = 0; 350 pr->rq1_skba.os_skbs = 0;
351 351
352 if (unlikely(test_bit(__EHEA_STOP_XFER, &ehea_driver_flags))) { 352 if (unlikely(test_bit(__EHEA_STOP_XFER, &ehea_driver_flags))) {
353 pr->rq1_skba.index = index; 353 if (nr_of_wqes > 0)
354 pr->rq1_skba.index = index;
354 pr->rq1_skba.os_skbs = fill_wqes; 355 pr->rq1_skba.os_skbs = fill_wqes;
355 return; 356 return;
356 } 357 }
@@ -1465,7 +1466,9 @@ static int ehea_init_port_res(struct ehea_port *port, struct ehea_port_res *pr,
1465 init_attr->act_nr_rwqes_rq2, 1466 init_attr->act_nr_rwqes_rq2,
1466 init_attr->act_nr_rwqes_rq3); 1467 init_attr->act_nr_rwqes_rq3);
1467 1468
1468 ret = ehea_init_q_skba(&pr->sq_skba, init_attr->act_nr_send_wqes + 1); 1469 pr->sq_skba_size = init_attr->act_nr_send_wqes + 1;
1470
1471 ret = ehea_init_q_skba(&pr->sq_skba, pr->sq_skba_size);
1469 ret |= ehea_init_q_skba(&pr->rq1_skba, init_attr->act_nr_rwqes_rq1 + 1); 1472 ret |= ehea_init_q_skba(&pr->rq1_skba, init_attr->act_nr_rwqes_rq1 + 1);
1470 ret |= ehea_init_q_skba(&pr->rq2_skba, init_attr->act_nr_rwqes_rq2 + 1); 1473 ret |= ehea_init_q_skba(&pr->rq2_skba, init_attr->act_nr_rwqes_rq2 + 1);
1471 ret |= ehea_init_q_skba(&pr->rq3_skba, init_attr->act_nr_rwqes_rq3 + 1); 1474 ret |= ehea_init_q_skba(&pr->rq3_skba, init_attr->act_nr_rwqes_rq3 + 1);
@@ -2622,6 +2625,22 @@ void ehea_purge_sq(struct ehea_qp *orig_qp)
2622 } 2625 }
2623} 2626}
2624 2627
2628void ehea_flush_sq(struct ehea_port *port)
2629{
2630 int i;
2631
2632 for (i = 0; i < port->num_def_qps + port->num_add_tx_qps; i++) {
2633 struct ehea_port_res *pr = &port->port_res[i];
2634 int swqe_max = pr->sq_skba_size - 2 - pr->swqe_ll_count;
2635 int k = 0;
2636 while (atomic_read(&pr->swqe_avail) < swqe_max) {
2637 msleep(5);
2638 if (++k == 20)
2639 break;
2640 }
2641 }
2642}
2643
2625int ehea_stop_qps(struct net_device *dev) 2644int ehea_stop_qps(struct net_device *dev)
2626{ 2645{
2627 struct ehea_port *port = netdev_priv(dev); 2646 struct ehea_port *port = netdev_priv(dev);
@@ -2849,6 +2868,7 @@ static void ehea_rereg_mrs(struct work_struct *work)
2849 if (dev->flags & IFF_UP) { 2868 if (dev->flags & IFF_UP) {
2850 mutex_lock(&port->port_lock); 2869 mutex_lock(&port->port_lock);
2851 netif_stop_queue(dev); 2870 netif_stop_queue(dev);
2871 ehea_flush_sq(port);
2852 ret = ehea_stop_qps(dev); 2872 ret = ehea_stop_qps(dev);
2853 if (ret) { 2873 if (ret) {
2854 mutex_unlock(&port->port_lock); 2874 mutex_unlock(&port->port_lock);
diff --git a/drivers/net/forcedeth.c b/drivers/net/forcedeth.c
index 4708a1631925..3338b115fa66 100644
--- a/drivers/net/forcedeth.c
+++ b/drivers/net/forcedeth.c
@@ -2112,9 +2112,8 @@ static inline void nv_tx_flip_ownership(struct net_device *dev)
2112 2112
2113 np->tx_pkts_in_progress--; 2113 np->tx_pkts_in_progress--;
2114 if (np->tx_change_owner) { 2114 if (np->tx_change_owner) {
2115 __le32 flaglen = le32_to_cpu(np->tx_change_owner->first_tx_desc->flaglen); 2115 np->tx_change_owner->first_tx_desc->flaglen |=
2116 flaglen |= NV_TX2_VALID; 2116 cpu_to_le32(NV_TX2_VALID);
2117 np->tx_change_owner->first_tx_desc->flaglen = cpu_to_le32(flaglen);
2118 np->tx_pkts_in_progress++; 2117 np->tx_pkts_in_progress++;
2119 2118
2120 np->tx_change_owner = np->tx_change_owner->next_tx_ctx; 2119 np->tx_change_owner = np->tx_change_owner->next_tx_ctx;
@@ -5319,8 +5318,7 @@ static int __devinit nv_probe(struct pci_dev *pci_dev, const struct pci_device_i
5319 5318
5320 /* check the workaround bit for correct mac address order */ 5319 /* check the workaround bit for correct mac address order */
5321 txreg = readl(base + NvRegTransmitPoll); 5320 txreg = readl(base + NvRegTransmitPoll);
5322 if ((txreg & NVREG_TRANSMITPOLL_MAC_ADDR_REV) || 5321 if (id->driver_data & DEV_HAS_CORRECT_MACADDR) {
5323 (id->driver_data & DEV_HAS_CORRECT_MACADDR)) {
5324 /* mac address is already in correct order */ 5322 /* mac address is already in correct order */
5325 dev->dev_addr[0] = (np->orig_mac[0] >> 0) & 0xff; 5323 dev->dev_addr[0] = (np->orig_mac[0] >> 0) & 0xff;
5326 dev->dev_addr[1] = (np->orig_mac[0] >> 8) & 0xff; 5324 dev->dev_addr[1] = (np->orig_mac[0] >> 8) & 0xff;
@@ -5328,6 +5326,22 @@ static int __devinit nv_probe(struct pci_dev *pci_dev, const struct pci_device_i
5328 dev->dev_addr[3] = (np->orig_mac[0] >> 24) & 0xff; 5326 dev->dev_addr[3] = (np->orig_mac[0] >> 24) & 0xff;
5329 dev->dev_addr[4] = (np->orig_mac[1] >> 0) & 0xff; 5327 dev->dev_addr[4] = (np->orig_mac[1] >> 0) & 0xff;
5330 dev->dev_addr[5] = (np->orig_mac[1] >> 8) & 0xff; 5328 dev->dev_addr[5] = (np->orig_mac[1] >> 8) & 0xff;
5329 } else if (txreg & NVREG_TRANSMITPOLL_MAC_ADDR_REV) {
5330 /* mac address is already in correct order */
5331 dev->dev_addr[0] = (np->orig_mac[0] >> 0) & 0xff;
5332 dev->dev_addr[1] = (np->orig_mac[0] >> 8) & 0xff;
5333 dev->dev_addr[2] = (np->orig_mac[0] >> 16) & 0xff;
5334 dev->dev_addr[3] = (np->orig_mac[0] >> 24) & 0xff;
5335 dev->dev_addr[4] = (np->orig_mac[1] >> 0) & 0xff;
5336 dev->dev_addr[5] = (np->orig_mac[1] >> 8) & 0xff;
5337 /*
5338 * Set orig mac address back to the reversed version.
5339 * This flag will be cleared during low power transition.
5340 * Therefore, we should always put back the reversed address.
5341 */
5342 np->orig_mac[0] = (dev->dev_addr[5] << 0) + (dev->dev_addr[4] << 8) +
5343 (dev->dev_addr[3] << 16) + (dev->dev_addr[2] << 24);
5344 np->orig_mac[1] = (dev->dev_addr[1] << 0) + (dev->dev_addr[0] << 8);
5331 } else { 5345 } else {
5332 /* need to reverse mac address to correct order */ 5346 /* need to reverse mac address to correct order */
5333 dev->dev_addr[0] = (np->orig_mac[1] >> 8) & 0xff; 5347 dev->dev_addr[0] = (np->orig_mac[1] >> 8) & 0xff;
@@ -5598,7 +5612,9 @@ out:
5598static int nv_resume(struct pci_dev *pdev) 5612static int nv_resume(struct pci_dev *pdev)
5599{ 5613{
5600 struct net_device *dev = pci_get_drvdata(pdev); 5614 struct net_device *dev = pci_get_drvdata(pdev);
5615 u8 __iomem *base = get_hwbase(dev);
5601 int rc = 0; 5616 int rc = 0;
5617 u32 txreg;
5602 5618
5603 if (!netif_running(dev)) 5619 if (!netif_running(dev))
5604 goto out; 5620 goto out;
@@ -5609,6 +5625,11 @@ static int nv_resume(struct pci_dev *pdev)
5609 pci_restore_state(pdev); 5625 pci_restore_state(pdev);
5610 pci_enable_wake(pdev, PCI_D0, 0); 5626 pci_enable_wake(pdev, PCI_D0, 0);
5611 5627
5628 /* restore mac address reverse flag */
5629 txreg = readl(base + NvRegTransmitPoll);
5630 txreg |= NVREG_TRANSMITPOLL_MAC_ADDR_REV;
5631 writel(txreg, base + NvRegTransmitPoll);
5632
5612 rc = nv_open(dev); 5633 rc = nv_open(dev);
5613out: 5634out:
5614 return rc; 5635 return rc;
diff --git a/drivers/net/fs_enet/fs_enet-main.c b/drivers/net/fs_enet/fs_enet-main.c
index af869cf9ae7d..940e2041ba38 100644
--- a/drivers/net/fs_enet/fs_enet-main.c
+++ b/drivers/net/fs_enet/fs_enet-main.c
@@ -835,7 +835,8 @@ static int fs_enet_close(struct net_device *dev)
835 835
836 netif_stop_queue(dev); 836 netif_stop_queue(dev);
837 netif_carrier_off(dev); 837 netif_carrier_off(dev);
838 napi_disable(&fep->napi); 838 if (fep->fpi->use_napi)
839 napi_disable(&fep->napi);
839 phy_stop(fep->phydev); 840 phy_stop(fep->phydev);
840 841
841 spin_lock_irqsave(&fep->lock, flags); 842 spin_lock_irqsave(&fep->lock, flags);
diff --git a/drivers/net/macb.c b/drivers/net/macb.c
index 1d210ed46130..489c7c3b90d9 100644
--- a/drivers/net/macb.c
+++ b/drivers/net/macb.c
@@ -242,12 +242,12 @@ static int macb_mii_init(struct macb *bp)
242 /* Enable managment port */ 242 /* Enable managment port */
243 macb_writel(bp, NCR, MACB_BIT(MPE)); 243 macb_writel(bp, NCR, MACB_BIT(MPE));
244 244
245 bp->mii_bus.name = "MACB_mii_bus", 245 bp->mii_bus.name = "MACB_mii_bus";
246 bp->mii_bus.read = &macb_mdio_read, 246 bp->mii_bus.read = &macb_mdio_read;
247 bp->mii_bus.write = &macb_mdio_write, 247 bp->mii_bus.write = &macb_mdio_write;
248 bp->mii_bus.reset = &macb_mdio_reset, 248 bp->mii_bus.reset = &macb_mdio_reset;
249 bp->mii_bus.id = bp->pdev->id, 249 bp->mii_bus.id = bp->pdev->id;
250 bp->mii_bus.priv = bp, 250 bp->mii_bus.priv = bp;
251 bp->mii_bus.dev = &bp->dev->dev; 251 bp->mii_bus.dev = &bp->dev->dev;
252 pdata = bp->pdev->dev.platform_data; 252 pdata = bp->pdev->dev.platform_data;
253 253
@@ -1257,6 +1257,8 @@ static int __exit macb_remove(struct platform_device *pdev)
1257 1257
1258 if (dev) { 1258 if (dev) {
1259 bp = netdev_priv(dev); 1259 bp = netdev_priv(dev);
1260 if (bp->phy_dev)
1261 phy_disconnect(bp->phy_dev);
1260 mdiobus_unregister(&bp->mii_bus); 1262 mdiobus_unregister(&bp->mii_bus);
1261 kfree(bp->mii_bus.irq); 1263 kfree(bp->mii_bus.irq);
1262 unregister_netdev(dev); 1264 unregister_netdev(dev);
diff --git a/drivers/net/phy/marvell.c b/drivers/net/phy/marvell.c
index 33539917e9b8..32a8503a7acd 100644
--- a/drivers/net/phy/marvell.c
+++ b/drivers/net/phy/marvell.c
@@ -211,8 +211,6 @@ static int m88e1111_config_init(struct phy_device *phydev)
211 } 211 }
212 212
213 if (phydev->interface == PHY_INTERFACE_MODE_SGMII) { 213 if (phydev->interface == PHY_INTERFACE_MODE_SGMII) {
214 int temp;
215
216 temp = phy_read(phydev, MII_M1111_PHY_EXT_SR); 214 temp = phy_read(phydev, MII_M1111_PHY_EXT_SR);
217 if (temp < 0) 215 if (temp < 0)
218 return temp; 216 return temp;
diff --git a/drivers/net/sc92031.c b/drivers/net/sc92031.c
index 37b42394560d..15fcee55284e 100644
--- a/drivers/net/sc92031.c
+++ b/drivers/net/sc92031.c
@@ -1446,6 +1446,7 @@ static int __devinit sc92031_probe(struct pci_dev *pdev,
1446 } 1446 }
1447 1447
1448 pci_set_drvdata(pdev, dev); 1448 pci_set_drvdata(pdev, dev);
1449 SET_NETDEV_DEV(dev, &pdev->dev);
1449 1450
1450#if SC92031_USE_BAR == 0 1451#if SC92031_USE_BAR == 0
1451 dev->mem_start = pci_resource_start(pdev, SC92031_USE_BAR); 1452 dev->mem_start = pci_resource_start(pdev, SC92031_USE_BAR);
diff --git a/drivers/net/sky2.c b/drivers/net/sky2.c
index 853bce0ac478..f226bcac7d17 100644
--- a/drivers/net/sky2.c
+++ b/drivers/net/sky2.c
@@ -154,6 +154,7 @@ static const char *yukon2_name[] = {
154 "EC", /* 0xb6 */ 154 "EC", /* 0xb6 */
155 "FE", /* 0xb7 */ 155 "FE", /* 0xb7 */
156 "FE+", /* 0xb8 */ 156 "FE+", /* 0xb8 */
157 "Supreme", /* 0xb9 */
157}; 158};
158 159
159static void sky2_set_multicast(struct net_device *dev); 160static void sky2_set_multicast(struct net_device *dev);
diff --git a/drivers/net/smc91x.c b/drivers/net/smc91x.c
index 97bdb2a43bc8..600b92af3334 100644
--- a/drivers/net/smc91x.c
+++ b/drivers/net/smc91x.c
@@ -1326,9 +1326,11 @@ static irqreturn_t smc_interrupt(int irq, void *dev_id)
1326 SMC_SET_INT_MASK(lp, mask); 1326 SMC_SET_INT_MASK(lp, mask);
1327 spin_unlock(&lp->lock); 1327 spin_unlock(&lp->lock);
1328 1328
1329#ifndef CONFIG_NET_POLL_CONTROLLER
1329 if (timeout == MAX_IRQ_LOOPS) 1330 if (timeout == MAX_IRQ_LOOPS)
1330 PRINTK("%s: spurious interrupt (mask = 0x%02x)\n", 1331 PRINTK("%s: spurious interrupt (mask = 0x%02x)\n",
1331 dev->name, mask); 1332 dev->name, mask);
1333#endif
1332 DBG(3, "%s: Interrupt done (%d loops)\n", 1334 DBG(3, "%s: Interrupt done (%d loops)\n",
1333 dev->name, MAX_IRQ_LOOPS - timeout); 1335 dev->name, MAX_IRQ_LOOPS - timeout);
1334 1336
diff --git a/drivers/net/starfire.c b/drivers/net/starfire.c
index c49214feae91..7b7b1717b0d1 100644
--- a/drivers/net/starfire.c
+++ b/drivers/net/starfire.c
@@ -1472,13 +1472,12 @@ static int __netdev_rx(struct net_device *dev, int *quota)
1472#ifndef final_version /* Remove after testing. */ 1472#ifndef final_version /* Remove after testing. */
1473 /* You will want this info for the initial debug. */ 1473 /* You will want this info for the initial debug. */
1474 if (debug > 5) { 1474 if (debug > 5) {
1475 DECLARE_MAC_BUF(mac); 1475 printk(KERN_DEBUG " Rx data " MAC_FMT " " MAC_FMT
1476 DECLARE_MAC_BUF(mac2);
1477
1478 printk(KERN_DEBUG " Rx data %s %s"
1479 " %2.2x%2.2x.\n", 1476 " %2.2x%2.2x.\n",
1480 print_mac(mac, &skb->data[0]), 1477 skb->data[0], skb->data[1], skb->data[2],
1481 print_mac(mac2, &skb->data[6]), 1478 skb->data[3], skb->data[4], skb->data[5],
1479 skb->data[6], skb->data[7], skb->data[8],
1480 skb->data[9], skb->data[10], skb->data[11],
1482 skb->data[12], skb->data[13]); 1481 skb->data[12], skb->data[13]);
1483 } 1482 }
1484#endif 1483#endif
diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
index f9ef8bd8b11e..96043c5746d0 100644
--- a/drivers/net/tg3.c
+++ b/drivers/net/tg3.c
@@ -64,8 +64,8 @@
64 64
65#define DRV_MODULE_NAME "tg3" 65#define DRV_MODULE_NAME "tg3"
66#define PFX DRV_MODULE_NAME ": " 66#define PFX DRV_MODULE_NAME ": "
67#define DRV_MODULE_VERSION "3.88" 67#define DRV_MODULE_VERSION "3.90"
68#define DRV_MODULE_RELDATE "March 20, 2008" 68#define DRV_MODULE_RELDATE "April 12, 2008"
69 69
70#define TG3_DEF_MAC_MODE 0 70#define TG3_DEF_MAC_MODE 0
71#define TG3_DEF_RX_MODE 0 71#define TG3_DEF_RX_MODE 0
@@ -804,6 +804,12 @@ static int tg3_writephy(struct tg3 *tp, int reg, u32 val)
804 return ret; 804 return ret;
805} 805}
806 806
807static void tg3_phydsp_write(struct tg3 *tp, u32 reg, u32 val)
808{
809 tg3_writephy(tp, MII_TG3_DSP_ADDRESS, reg);
810 tg3_writephy(tp, MII_TG3_DSP_RW_PORT, val);
811}
812
807static void tg3_phy_toggle_automdix(struct tg3 *tp, int enable) 813static void tg3_phy_toggle_automdix(struct tg3 *tp, int enable)
808{ 814{
809 u32 phy; 815 u32 phy;
@@ -886,6 +892,49 @@ static int tg3_bmcr_reset(struct tg3 *tp)
886 return 0; 892 return 0;
887} 893}
888 894
895static void tg3_phy_apply_otp(struct tg3 *tp)
896{
897 u32 otp, phy;
898
899 if (!tp->phy_otp)
900 return;
901
902 otp = tp->phy_otp;
903
904 /* Enable SM_DSP clock and tx 6dB coding. */
905 phy = MII_TG3_AUXCTL_SHDWSEL_AUXCTL |
906 MII_TG3_AUXCTL_ACTL_SMDSP_ENA |
907 MII_TG3_AUXCTL_ACTL_TX_6DB;
908 tg3_writephy(tp, MII_TG3_AUX_CTRL, phy);
909
910 phy = ((otp & TG3_OTP_AGCTGT_MASK) >> TG3_OTP_AGCTGT_SHIFT);
911 phy |= MII_TG3_DSP_TAP1_AGCTGT_DFLT;
912 tg3_phydsp_write(tp, MII_TG3_DSP_TAP1, phy);
913
914 phy = ((otp & TG3_OTP_HPFFLTR_MASK) >> TG3_OTP_HPFFLTR_SHIFT) |
915 ((otp & TG3_OTP_HPFOVER_MASK) >> TG3_OTP_HPFOVER_SHIFT);
916 tg3_phydsp_write(tp, MII_TG3_DSP_AADJ1CH0, phy);
917
918 phy = ((otp & TG3_OTP_LPFDIS_MASK) >> TG3_OTP_LPFDIS_SHIFT);
919 phy |= MII_TG3_DSP_AADJ1CH3_ADCCKADJ;
920 tg3_phydsp_write(tp, MII_TG3_DSP_AADJ1CH3, phy);
921
922 phy = ((otp & TG3_OTP_VDAC_MASK) >> TG3_OTP_VDAC_SHIFT);
923 tg3_phydsp_write(tp, MII_TG3_DSP_EXP75, phy);
924
925 phy = ((otp & TG3_OTP_10BTAMP_MASK) >> TG3_OTP_10BTAMP_SHIFT);
926 tg3_phydsp_write(tp, MII_TG3_DSP_EXP96, phy);
927
928 phy = ((otp & TG3_OTP_ROFF_MASK) >> TG3_OTP_ROFF_SHIFT) |
929 ((otp & TG3_OTP_RCOFF_MASK) >> TG3_OTP_RCOFF_SHIFT);
930 tg3_phydsp_write(tp, MII_TG3_DSP_EXP97, phy);
931
932 /* Turn off SM_DSP clock. */
933 phy = MII_TG3_AUXCTL_SHDWSEL_AUXCTL |
934 MII_TG3_AUXCTL_ACTL_TX_6DB;
935 tg3_writephy(tp, MII_TG3_AUX_CTRL, phy);
936}
937
889static int tg3_wait_macro_done(struct tg3 *tp) 938static int tg3_wait_macro_done(struct tg3 *tp)
890{ 939{
891 int limit = 100; 940 int limit = 100;
@@ -1073,6 +1122,7 @@ static void tg3_link_report(struct tg3 *);
1073 */ 1122 */
1074static int tg3_phy_reset(struct tg3 *tp) 1123static int tg3_phy_reset(struct tg3 *tp)
1075{ 1124{
1125 u32 cpmuctrl;
1076 u32 phy_status; 1126 u32 phy_status;
1077 int err; 1127 int err;
1078 1128
@@ -1102,10 +1152,28 @@ static int tg3_phy_reset(struct tg3 *tp)
1102 goto out; 1152 goto out;
1103 } 1153 }
1104 1154
1155 cpmuctrl = 0;
1156 if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5784 &&
1157 GET_CHIP_REV(tp->pci_chip_rev_id) != CHIPREV_5784_AX) {
1158 cpmuctrl = tr32(TG3_CPMU_CTRL);
1159 if (cpmuctrl & CPMU_CTRL_GPHY_10MB_RXONLY)
1160 tw32(TG3_CPMU_CTRL,
1161 cpmuctrl & ~CPMU_CTRL_GPHY_10MB_RXONLY);
1162 }
1163
1105 err = tg3_bmcr_reset(tp); 1164 err = tg3_bmcr_reset(tp);
1106 if (err) 1165 if (err)
1107 return err; 1166 return err;
1108 1167
1168 if (cpmuctrl & CPMU_CTRL_GPHY_10MB_RXONLY) {
1169 u32 phy;
1170
1171 phy = MII_TG3_DSP_EXP8_AEDW | MII_TG3_DSP_EXP8_REJ2MHz;
1172 tg3_phydsp_write(tp, MII_TG3_DSP_EXP8, phy);
1173
1174 tw32(TG3_CPMU_CTRL, cpmuctrl);
1175 }
1176
1109 if (tp->tg3_flags3 & TG3_FLG3_5761_5784_AX_FIXES) { 1177 if (tp->tg3_flags3 & TG3_FLG3_5761_5784_AX_FIXES) {
1110 u32 val; 1178 u32 val;
1111 1179
@@ -1124,6 +1192,8 @@ static int tg3_phy_reset(struct tg3 *tp)
1124 MII_TG3_MISC_SHDW_APD_WKTM_84MS); 1192 MII_TG3_MISC_SHDW_APD_WKTM_84MS);
1125 } 1193 }
1126 1194
1195 tg3_phy_apply_otp(tp);
1196
1127out: 1197out:
1128 if (tp->tg3_flags2 & TG3_FLG2_PHY_ADC_BUG) { 1198 if (tp->tg3_flags2 & TG3_FLG2_PHY_ADC_BUG) {
1129 tg3_writephy(tp, MII_TG3_AUX_CTRL, 0x0c00); 1199 tg3_writephy(tp, MII_TG3_AUX_CTRL, 0x0c00);
@@ -9464,7 +9534,8 @@ static int tg3_test_loopback(struct tg3 *tp)
9464 if (err) 9534 if (err)
9465 return TG3_LOOPBACK_FAILED; 9535 return TG3_LOOPBACK_FAILED;
9466 9536
9467 if (tp->tg3_flags3 & TG3_FLG3_5761_5784_AX_FIXES) { 9537 if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5784 ||
9538 GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5761) {
9468 int i; 9539 int i;
9469 u32 status; 9540 u32 status;
9470 9541
@@ -9481,17 +9552,23 @@ static int tg3_test_loopback(struct tg3 *tp)
9481 if (status != CPMU_MUTEX_GNT_DRIVER) 9552 if (status != CPMU_MUTEX_GNT_DRIVER)
9482 return TG3_LOOPBACK_FAILED; 9553 return TG3_LOOPBACK_FAILED;
9483 9554
9484 /* Turn off power management based on link speed. */ 9555 /* Turn off link-based power management. */
9485 cpmuctrl = tr32(TG3_CPMU_CTRL); 9556 cpmuctrl = tr32(TG3_CPMU_CTRL);
9486 tw32(TG3_CPMU_CTRL, 9557 if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5784 ||
9487 cpmuctrl & ~(CPMU_CTRL_LINK_SPEED_MODE | 9558 GET_CHIP_REV(tp->pci_chip_rev_id) == CHIPREV_5761_AX)
9488 CPMU_CTRL_LINK_AWARE_MODE)); 9559 tw32(TG3_CPMU_CTRL,
9560 cpmuctrl & ~(CPMU_CTRL_LINK_SPEED_MODE |
9561 CPMU_CTRL_LINK_AWARE_MODE));
9562 else
9563 tw32(TG3_CPMU_CTRL,
9564 cpmuctrl & ~CPMU_CTRL_LINK_AWARE_MODE);
9489 } 9565 }
9490 9566
9491 if (tg3_run_loopback(tp, TG3_MAC_LOOPBACK)) 9567 if (tg3_run_loopback(tp, TG3_MAC_LOOPBACK))
9492 err |= TG3_MAC_LOOPBACK_FAILED; 9568 err |= TG3_MAC_LOOPBACK_FAILED;
9493 9569
9494 if (tp->tg3_flags3 & TG3_FLG3_5761_5784_AX_FIXES) { 9570 if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5784 ||
9571 GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5761) {
9495 tw32(TG3_CPMU_CTRL, cpmuctrl); 9572 tw32(TG3_CPMU_CTRL, cpmuctrl);
9496 9573
9497 /* Release the mutex */ 9574 /* Release the mutex */
@@ -10724,9 +10801,8 @@ static void __devinit tg3_get_eeprom_hw_cfg(struct tg3 *tp)
10724 tp->pdev->subsystem_vendor == PCI_VENDOR_ID_DELL) 10801 tp->pdev->subsystem_vendor == PCI_VENDOR_ID_DELL)
10725 tp->led_ctrl = LED_CTRL_MODE_PHY_2; 10802 tp->led_ctrl = LED_CTRL_MODE_PHY_2;
10726 10803
10727 if (tp->pci_chip_rev_id == CHIPREV_ID_5784_A0 || 10804 if (GET_CHIP_REV(tp->pci_chip_rev_id) == CHIPREV_5784_AX)
10728 tp->pci_chip_rev_id == CHIPREV_ID_5784_A1) 10805 tp->led_ctrl = LED_CTRL_MODE_PHY_1;
10729 tp->led_ctrl = LED_CTRL_MODE_MAC;
10730 10806
10731 if (nic_cfg & NIC_SRAM_DATA_CFG_EEPROM_WP) { 10807 if (nic_cfg & NIC_SRAM_DATA_CFG_EEPROM_WP) {
10732 tp->tg3_flags |= TG3_FLAG_EEPROM_WRITE_PROT; 10808 tp->tg3_flags |= TG3_FLAG_EEPROM_WRITE_PROT;
@@ -10773,6 +10849,55 @@ static void __devinit tg3_get_eeprom_hw_cfg(struct tg3 *tp)
10773 } 10849 }
10774} 10850}
10775 10851
10852static int __devinit tg3_issue_otp_command(struct tg3 *tp, u32 cmd)
10853{
10854 int i;
10855 u32 val;
10856
10857 tw32(OTP_CTRL, cmd | OTP_CTRL_OTP_CMD_START);
10858 tw32(OTP_CTRL, cmd);
10859
10860 /* Wait for up to 1 ms for command to execute. */
10861 for (i = 0; i < 100; i++) {
10862 val = tr32(OTP_STATUS);
10863 if (val & OTP_STATUS_CMD_DONE)
10864 break;
10865 udelay(10);
10866 }
10867
10868 return (val & OTP_STATUS_CMD_DONE) ? 0 : -EBUSY;
10869}
10870
10871/* Read the gphy configuration from the OTP region of the chip. The gphy
10872 * configuration is a 32-bit value that straddles the alignment boundary.
10873 * We do two 32-bit reads and then shift and merge the results.
10874 */
10875static u32 __devinit tg3_read_otp_phycfg(struct tg3 *tp)
10876{
10877 u32 bhalf_otp, thalf_otp;
10878
10879 tw32(OTP_MODE, OTP_MODE_OTP_THRU_GRC);
10880
10881 if (tg3_issue_otp_command(tp, OTP_CTRL_OTP_CMD_INIT))
10882 return 0;
10883
10884 tw32(OTP_ADDRESS, OTP_ADDRESS_MAGIC1);
10885
10886 if (tg3_issue_otp_command(tp, OTP_CTRL_OTP_CMD_READ))
10887 return 0;
10888
10889 thalf_otp = tr32(OTP_READ_DATA);
10890
10891 tw32(OTP_ADDRESS, OTP_ADDRESS_MAGIC2);
10892
10893 if (tg3_issue_otp_command(tp, OTP_CTRL_OTP_CMD_READ))
10894 return 0;
10895
10896 bhalf_otp = tr32(OTP_READ_DATA);
10897
10898 return ((thalf_otp & 0x0000ffff) << 16) | (bhalf_otp >> 16);
10899}
10900
10776static int __devinit tg3_phy_probe(struct tg3 *tp) 10901static int __devinit tg3_phy_probe(struct tg3 *tp)
10777{ 10902{
10778 u32 hw_phy_id_1, hw_phy_id_2; 10903 u32 hw_phy_id_1, hw_phy_id_2;
@@ -11586,6 +11711,13 @@ static int __devinit tg3_get_invariants(struct tg3 *tp)
11586 tp->tg3_flags2 |= TG3_FLG2_PHY_BER_BUG; 11711 tp->tg3_flags2 |= TG3_FLG2_PHY_BER_BUG;
11587 } 11712 }
11588 11713
11714 if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5784 &&
11715 GET_CHIP_REV(tp->pci_chip_rev_id) != CHIPREV_5784_AX) {
11716 tp->phy_otp = tg3_read_otp_phycfg(tp);
11717 if (tp->phy_otp == 0)
11718 tp->phy_otp = TG3_OTP_DEFAULT;
11719 }
11720
11589 tp->coalesce_mode = 0; 11721 tp->coalesce_mode = 0;
11590 if (GET_CHIP_REV(tp->pci_chip_rev_id) != CHIPREV_5700_AX && 11722 if (GET_CHIP_REV(tp->pci_chip_rev_id) != CHIPREV_5700_AX &&
11591 GET_CHIP_REV(tp->pci_chip_rev_id) != CHIPREV_5700_BX) 11723 GET_CHIP_REV(tp->pci_chip_rev_id) != CHIPREV_5700_BX)
@@ -12446,7 +12578,8 @@ static int __devinit tg3_init_one(struct pci_dev *pdev,
12446 const struct pci_device_id *ent) 12578 const struct pci_device_id *ent)
12447{ 12579{
12448 static int tg3_version_printed = 0; 12580 static int tg3_version_printed = 0;
12449 unsigned long tg3reg_base, tg3reg_len; 12581 resource_size_t tg3reg_base;
12582 unsigned long tg3reg_len;
12450 struct net_device *dev; 12583 struct net_device *dev;
12451 struct tg3 *tp; 12584 struct tg3 *tp;
12452 int err, pm_cap; 12585 int err, pm_cap;
diff --git a/drivers/net/tg3.h b/drivers/net/tg3.h
index 3938eb35ce8c..c1075a73d66c 100644
--- a/drivers/net/tg3.h
+++ b/drivers/net/tg3.h
@@ -138,6 +138,8 @@
138#define CHIPREV_5704_BX 0x21 138#define CHIPREV_5704_BX 0x21
139#define CHIPREV_5750_AX 0x40 139#define CHIPREV_5750_AX 0x40
140#define CHIPREV_5750_BX 0x41 140#define CHIPREV_5750_BX 0x41
141#define CHIPREV_5784_AX 0x57840
142#define CHIPREV_5761_AX 0x57610
141#define GET_METAL_REV(CHIP_REV_ID) ((CHIP_REV_ID) & 0xff) 143#define GET_METAL_REV(CHIP_REV_ID) ((CHIP_REV_ID) & 0xff)
142#define METAL_REV_A0 0x00 144#define METAL_REV_A0 0x00
143#define METAL_REV_A1 0x01 145#define METAL_REV_A1 0x01
@@ -866,6 +868,7 @@
866#define CPMU_CTRL_LINK_IDLE_MODE 0x00000200 868#define CPMU_CTRL_LINK_IDLE_MODE 0x00000200
867#define CPMU_CTRL_LINK_AWARE_MODE 0x00000400 869#define CPMU_CTRL_LINK_AWARE_MODE 0x00000400
868#define CPMU_CTRL_LINK_SPEED_MODE 0x00004000 870#define CPMU_CTRL_LINK_SPEED_MODE 0x00004000
871#define CPMU_CTRL_GPHY_10MB_RXONLY 0x00010000
869#define TG3_CPMU_LSPD_10MB_CLK 0x00003604 872#define TG3_CPMU_LSPD_10MB_CLK 0x00003604
870#define CPMU_LSPD_10MB_MACCLK_MASK 0x001f0000 873#define CPMU_LSPD_10MB_MACCLK_MASK 0x001f0000
871#define CPMU_LSPD_10MB_MACCLK_6_25 0x00130000 874#define CPMU_LSPD_10MB_MACCLK_6_25 0x00130000
@@ -1559,7 +1562,24 @@
1559/* 0x702c unused */ 1562/* 0x702c unused */
1560 1563
1561#define NVRAM_ADDR_LOCKOUT 0x00007030 1564#define NVRAM_ADDR_LOCKOUT 0x00007030
1562/* 0x7034 --> 0x7c00 unused */ 1565/* 0x7034 --> 0x7500 unused */
1566
1567#define OTP_MODE 0x00007500
1568#define OTP_MODE_OTP_THRU_GRC 0x00000001
1569#define OTP_CTRL 0x00007504
1570#define OTP_CTRL_OTP_PROG_ENABLE 0x00200000
1571#define OTP_CTRL_OTP_CMD_READ 0x00000000
1572#define OTP_CTRL_OTP_CMD_INIT 0x00000008
1573#define OTP_CTRL_OTP_CMD_START 0x00000001
1574#define OTP_STATUS 0x00007508
1575#define OTP_STATUS_CMD_DONE 0x00000001
1576#define OTP_ADDRESS 0x0000750c
1577#define OTP_ADDRESS_MAGIC1 0x000000a0
1578#define OTP_ADDRESS_MAGIC2 0x00000080
1579/* 0x7510 unused */
1580
1581#define OTP_READ_DATA 0x00007514
1582/* 0x7518 --> 0x7c04 unused */
1563 1583
1564#define PCIE_TRANSACTION_CFG 0x00007c04 1584#define PCIE_TRANSACTION_CFG 0x00007c04
1565#define PCIE_TRANS_CFG_1SHOT_MSI 0x20000000 1585#define PCIE_TRANS_CFG_1SHOT_MSI 0x20000000
@@ -1568,6 +1588,28 @@
1568#define PCIE_PWR_MGMT_THRESH 0x00007d28 1588#define PCIE_PWR_MGMT_THRESH 0x00007d28
1569#define PCIE_PWR_MGMT_L1_THRESH_MSK 0x0000ff00 1589#define PCIE_PWR_MGMT_L1_THRESH_MSK 0x0000ff00
1570 1590
1591
1592/* OTP bit definitions */
1593#define TG3_OTP_AGCTGT_MASK 0x000000e0
1594#define TG3_OTP_AGCTGT_SHIFT 1
1595#define TG3_OTP_HPFFLTR_MASK 0x00000300
1596#define TG3_OTP_HPFFLTR_SHIFT 1
1597#define TG3_OTP_HPFOVER_MASK 0x00000400
1598#define TG3_OTP_HPFOVER_SHIFT 1
1599#define TG3_OTP_LPFDIS_MASK 0x00000800
1600#define TG3_OTP_LPFDIS_SHIFT 11
1601#define TG3_OTP_VDAC_MASK 0xff000000
1602#define TG3_OTP_VDAC_SHIFT 24
1603#define TG3_OTP_10BTAMP_MASK 0x0000f000
1604#define TG3_OTP_10BTAMP_SHIFT 8
1605#define TG3_OTP_ROFF_MASK 0x00e00000
1606#define TG3_OTP_ROFF_SHIFT 11
1607#define TG3_OTP_RCOFF_MASK 0x001c0000
1608#define TG3_OTP_RCOFF_SHIFT 16
1609
1610#define TG3_OTP_DEFAULT 0x286c1640
1611
1612
1571#define TG3_EEPROM_MAGIC 0x669955aa 1613#define TG3_EEPROM_MAGIC 0x669955aa
1572#define TG3_EEPROM_MAGIC_FW 0xa5000000 1614#define TG3_EEPROM_MAGIC_FW 0xa5000000
1573#define TG3_EEPROM_MAGIC_FW_MSK 0xff000000 1615#define TG3_EEPROM_MAGIC_FW_MSK 0xff000000
@@ -1705,15 +1747,31 @@
1705 1747
1706#define MII_TG3_DSP_RW_PORT 0x15 /* DSP coefficient read/write port */ 1748#define MII_TG3_DSP_RW_PORT 0x15 /* DSP coefficient read/write port */
1707 1749
1708#define MII_TG3_DSP_ADDRESS 0x17 /* DSP address register */
1709#define MII_TG3_EPHY_PTEST 0x17 /* 5906 PHY register */ 1750#define MII_TG3_EPHY_PTEST 0x17 /* 5906 PHY register */
1751#define MII_TG3_DSP_ADDRESS 0x17 /* DSP address register */
1752
1753#define MII_TG3_DSP_TAP1 0x0001
1754#define MII_TG3_DSP_TAP1_AGCTGT_DFLT 0x0007
1755#define MII_TG3_DSP_AADJ1CH0 0x001f
1756#define MII_TG3_DSP_AADJ1CH3 0x601f
1757#define MII_TG3_DSP_AADJ1CH3_ADCCKADJ 0x0002
1758#define MII_TG3_DSP_EXP8 0x0708
1759#define MII_TG3_DSP_EXP8_REJ2MHz 0x0001
1760#define MII_TG3_DSP_EXP8_AEDW 0x0200
1761#define MII_TG3_DSP_EXP75 0x0f75
1762#define MII_TG3_DSP_EXP96 0x0f96
1763#define MII_TG3_DSP_EXP97 0x0f97
1710 1764
1711#define MII_TG3_AUX_CTRL 0x18 /* auxilliary control register */ 1765#define MII_TG3_AUX_CTRL 0x18 /* auxilliary control register */
1712 1766
1713#define MII_TG3_AUXCTL_MISC_WREN 0x8000 1767#define MII_TG3_AUXCTL_MISC_WREN 0x8000
1714#define MII_TG3_AUXCTL_MISC_FORCE_AMDIX 0x0200 1768#define MII_TG3_AUXCTL_MISC_FORCE_AMDIX 0x0200
1715#define MII_TG3_AUXCTL_MISC_RDSEL_MISC 0x7000 1769#define MII_TG3_AUXCTL_MISC_RDSEL_MISC 0x7000
1716#define MII_TG3_AUXCTL_SHDWSEL_MISC 0x0007 1770#define MII_TG3_AUXCTL_SHDWSEL_MISC 0x0007
1771
1772#define MII_TG3_AUXCTL_ACTL_SMDSP_ENA 0x0800
1773#define MII_TG3_AUXCTL_ACTL_TX_6DB 0x0400
1774#define MII_TG3_AUXCTL_SHDWSEL_AUXCTL 0x0000
1717 1775
1718#define MII_TG3_AUX_STAT 0x19 /* auxilliary status register */ 1776#define MII_TG3_AUX_STAT 0x19 /* auxilliary status register */
1719#define MII_TG3_AUX_STAT_LPASS 0x0004 1777#define MII_TG3_AUX_STAT_LPASS 0x0004
@@ -1743,6 +1801,20 @@
1743#define MII_TG3_INT_DUPLEXCHG 0x0008 1801#define MII_TG3_INT_DUPLEXCHG 0x0008
1744#define MII_TG3_INT_ANEG_PAGE_RX 0x0400 1802#define MII_TG3_INT_ANEG_PAGE_RX 0x0400
1745 1803
1804#define MII_TG3_MISC_SHDW 0x1c
1805#define MII_TG3_MISC_SHDW_WREN 0x8000
1806#define MII_TG3_MISC_SHDW_SCR5_SEL 0x1400
1807#define MII_TG3_MISC_SHDW_APD_SEL 0x2800
1808
1809#define MII_TG3_MISC_SHDW_SCR5_C125OE 0x0001
1810#define MII_TG3_MISC_SHDW_SCR5_DLLAPD 0x0002
1811#define MII_TG3_MISC_SHDW_SCR5_SDTL 0x0004
1812#define MII_TG3_MISC_SHDW_SCR5_DLPTLM 0x0008
1813#define MII_TG3_MISC_SHDW_SCR5_LPED 0x0010
1814
1815#define MII_TG3_MISC_SHDW_APD_WKTM_84MS 0x0001
1816#define MII_TG3_MISC_SHDW_APD_ENABLE 0x0020
1817
1746#define MII_TG3_EPHY_TEST 0x1f /* 5906 PHY register */ 1818#define MII_TG3_EPHY_TEST 0x1f /* 5906 PHY register */
1747#define MII_TG3_EPHY_SHADOW_EN 0x80 1819#define MII_TG3_EPHY_SHADOW_EN 0x80
1748 1820
@@ -2473,6 +2545,7 @@ struct tg3 {
2473#define PHY_REV_BCM5411_X0 0x1 /* Found on Netgear GA302T */ 2545#define PHY_REV_BCM5411_X0 0x1 /* Found on Netgear GA302T */
2474 2546
2475 u32 led_ctrl; 2547 u32 led_ctrl;
2548 u32 phy_otp;
2476 u16 pci_cmd; 2549 u16 pci_cmd;
2477 2550
2478 char board_part_number[24]; 2551 char board_part_number[24];
diff --git a/drivers/net/tokenring/olympic.c b/drivers/net/tokenring/olympic.c
index 433c994ea9d8..0ab51a0f35fc 100644
--- a/drivers/net/tokenring/olympic.c
+++ b/drivers/net/tokenring/olympic.c
@@ -117,7 +117,7 @@
117 * Official releases will only have an a.b.c version number format. 117 * Official releases will only have an a.b.c version number format.
118 */ 118 */
119 119
120static char version[] __devinitdata = 120static char version[] =
121"Olympic.c v1.0.5 6/04/02 - Peter De Schrijver & Mike Phillips" ; 121"Olympic.c v1.0.5 6/04/02 - Peter De Schrijver & Mike Phillips" ;
122 122
123static char *open_maj_error[] = {"No error", "Lobe Media Test", "Physical Insertion", 123static char *open_maj_error[] = {"No error", "Lobe Media Test", "Physical Insertion",
@@ -290,7 +290,7 @@ op_disable_dev:
290 return i; 290 return i;
291} 291}
292 292
293static int __devinit olympic_init(struct net_device *dev) 293static int olympic_init(struct net_device *dev)
294{ 294{
295 struct olympic_private *olympic_priv; 295 struct olympic_private *olympic_priv;
296 u8 __iomem *olympic_mmio, *init_srb,*adapter_addr; 296 u8 __iomem *olympic_mmio, *init_srb,*adapter_addr;
@@ -434,7 +434,7 @@ static int __devinit olympic_init(struct net_device *dev)
434 434
435} 435}
436 436
437static int __devinit olympic_open(struct net_device *dev) 437static int olympic_open(struct net_device *dev)
438{ 438{
439 struct olympic_private *olympic_priv=netdev_priv(dev); 439 struct olympic_private *olympic_priv=netdev_priv(dev);
440 u8 __iomem *olympic_mmio=olympic_priv->olympic_mmio,*init_srb; 440 u8 __iomem *olympic_mmio=olympic_priv->olympic_mmio,*init_srb;
@@ -1438,13 +1438,18 @@ static void olympic_arb_cmd(struct net_device *dev)
1438 1438
1439 if (olympic_priv->olympic_network_monitor) { 1439 if (olympic_priv->olympic_network_monitor) {
1440 struct trh_hdr *mac_hdr; 1440 struct trh_hdr *mac_hdr;
1441 DECLARE_MAC_BUF(mac);
1442 printk(KERN_WARNING "%s: Received MAC Frame, details: \n",dev->name); 1441 printk(KERN_WARNING "%s: Received MAC Frame, details: \n",dev->name);
1443 mac_hdr = tr_hdr(mac_frame); 1442 mac_hdr = tr_hdr(mac_frame);
1444 printk(KERN_WARNING "%s: MAC Frame Dest. Addr: %s\n", 1443 printk(KERN_WARNING "%s: MAC Frame Dest. Addr: "
1445 dev->name, print_mac(mac, mac_hdr->daddr)); 1444 MAC_FMT " \n", dev->name,
1446 printk(KERN_WARNING "%s: MAC Frame Srce. Addr: %s\n", 1445 mac_hdr->daddr[0], mac_hdr->daddr[1],
1447 dev->name, print_mac(mac, mac_hdr->saddr)); 1446 mac_hdr->daddr[2], mac_hdr->daddr[3],
1447 mac_hdr->daddr[4], mac_hdr->daddr[5]);
1448 printk(KERN_WARNING "%s: MAC Frame Srce. Addr: "
1449 MAC_FMT " \n", dev->name,
1450 mac_hdr->saddr[0], mac_hdr->saddr[1],
1451 mac_hdr->saddr[2], mac_hdr->saddr[3],
1452 mac_hdr->saddr[4], mac_hdr->saddr[5]);
1448 } 1453 }
1449 netif_rx(mac_frame); 1454 netif_rx(mac_frame);
1450 dev->last_rx = jiffies; 1455 dev->last_rx = jiffies;
diff --git a/drivers/net/tun.c b/drivers/net/tun.c
index 7b816a032957..5b5d87585d91 100644
--- a/drivers/net/tun.c
+++ b/drivers/net/tun.c
@@ -67,9 +67,42 @@
67#include <asm/system.h> 67#include <asm/system.h>
68#include <asm/uaccess.h> 68#include <asm/uaccess.h>
69 69
70/* Uncomment to enable debugging */
71/* #define TUN_DEBUG 1 */
72
70#ifdef TUN_DEBUG 73#ifdef TUN_DEBUG
71static int debug; 74static int debug;
75
76#define DBG if(tun->debug)printk
77#define DBG1 if(debug==2)printk
78#else
79#define DBG( a... )
80#define DBG1( a... )
81#endif
82
83struct tun_struct {
84 struct list_head list;
85 unsigned long flags;
86 int attached;
87 uid_t owner;
88 gid_t group;
89
90 wait_queue_head_t read_wait;
91 struct sk_buff_head readq;
92
93 struct net_device *dev;
94
95 struct fasync_struct *fasync;
96
97 unsigned long if_flags;
98 u8 dev_addr[ETH_ALEN];
99 u32 chr_filter[2];
100 u32 net_filter[2];
101
102#ifdef TUN_DEBUG
103 int debug;
72#endif 104#endif
105};
73 106
74/* Network device part of the driver */ 107/* Network device part of the driver */
75 108
@@ -253,8 +286,11 @@ static __inline__ ssize_t tun_get_user(struct tun_struct *tun, struct iovec *iv,
253 return -EFAULT; 286 return -EFAULT;
254 } 287 }
255 288
256 if ((tun->flags & TUN_TYPE_MASK) == TUN_TAP_DEV) 289 if ((tun->flags & TUN_TYPE_MASK) == TUN_TAP_DEV) {
257 align = NET_IP_ALIGN; 290 align = NET_IP_ALIGN;
291 if (unlikely(len < ETH_HLEN))
292 return -EINVAL;
293 }
258 294
259 if (!(skb = alloc_skb(len + align, GFP_KERNEL))) { 295 if (!(skb = alloc_skb(len + align, GFP_KERNEL))) {
260 tun->dev->stats.rx_dropped++; 296 tun->dev->stats.rx_dropped++;
diff --git a/drivers/net/ucc_geth.c b/drivers/net/ucc_geth.c
index 8cc316653a39..0ee4c168e4c0 100644
--- a/drivers/net/ucc_geth.c
+++ b/drivers/net/ucc_geth.c
@@ -3833,6 +3833,7 @@ static int ucc_geth_probe(struct of_device* ofdev, const struct of_device_id *ma
3833 struct device_node *phy; 3833 struct device_node *phy;
3834 int err, ucc_num, max_speed = 0; 3834 int err, ucc_num, max_speed = 0;
3835 const phandle *ph; 3835 const phandle *ph;
3836 const u32 *fixed_link;
3836 const unsigned int *prop; 3837 const unsigned int *prop;
3837 const char *sprop; 3838 const char *sprop;
3838 const void *mac_addr; 3839 const void *mac_addr;
@@ -3923,18 +3924,38 @@ static int ucc_geth_probe(struct of_device* ofdev, const struct of_device_id *ma
3923 3924
3924 ug_info->uf_info.regs = res.start; 3925 ug_info->uf_info.regs = res.start;
3925 ug_info->uf_info.irq = irq_of_parse_and_map(np, 0); 3926 ug_info->uf_info.irq = irq_of_parse_and_map(np, 0);
3927 fixed_link = of_get_property(np, "fixed-link", NULL);
3928 if (fixed_link) {
3929 ug_info->mdio_bus = 0;
3930 ug_info->phy_address = fixed_link[0];
3931 phy = NULL;
3932 } else {
3933 ph = of_get_property(np, "phy-handle", NULL);
3934 phy = of_find_node_by_phandle(*ph);
3926 3935
3927 ph = of_get_property(np, "phy-handle", NULL); 3936 if (phy == NULL)
3928 phy = of_find_node_by_phandle(*ph); 3937 return -ENODEV;
3929 3938
3930 if (phy == NULL) 3939 /* set the PHY address */
3931 return -ENODEV; 3940 prop = of_get_property(phy, "reg", NULL);
3941 if (prop == NULL)
3942 return -1;
3943 ug_info->phy_address = *prop;
3944
3945 /* Set the bus id */
3946 mdio = of_get_parent(phy);
3947
3948 if (mdio == NULL)
3949 return -1;
3932 3950
3933 /* set the PHY address */ 3951 err = of_address_to_resource(mdio, 0, &res);
3934 prop = of_get_property(phy, "reg", NULL); 3952 of_node_put(mdio);
3935 if (prop == NULL) 3953
3936 return -1; 3954 if (err)
3937 ug_info->phy_address = *prop; 3955 return -1;
3956
3957 ug_info->mdio_bus = res.start;
3958 }
3938 3959
3939 /* get the phy interface type, or default to MII */ 3960 /* get the phy interface type, or default to MII */
3940 prop = of_get_property(np, "phy-connection-type", NULL); 3961 prop = of_get_property(np, "phy-connection-type", NULL);
@@ -3979,20 +4000,6 @@ static int ucc_geth_probe(struct of_device* ofdev, const struct of_device_id *ma
3979 ug_info->numThreadsRx = UCC_GETH_NUM_OF_THREADS_4; 4000 ug_info->numThreadsRx = UCC_GETH_NUM_OF_THREADS_4;
3980 } 4001 }
3981 4002
3982 /* Set the bus id */
3983 mdio = of_get_parent(phy);
3984
3985 if (mdio == NULL)
3986 return -1;
3987
3988 err = of_address_to_resource(mdio, 0, &res);
3989 of_node_put(mdio);
3990
3991 if (err)
3992 return -1;
3993
3994 ug_info->mdio_bus = res.start;
3995
3996 if (netif_msg_probe(&debug)) 4003 if (netif_msg_probe(&debug))
3997 printk(KERN_INFO "ucc_geth: UCC%1d at 0x%8x (irq = %d) \n", 4004 printk(KERN_INFO "ucc_geth: UCC%1d at 0x%8x (irq = %d) \n",
3998 ug_info->uf_info.ucc_num + 1, ug_info->uf_info.regs, 4005 ug_info->uf_info.ucc_num + 1, ug_info->uf_info.regs,
diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c
index b58472cf76f8..d02d9d75fe14 100644
--- a/drivers/net/virtio_net.c
+++ b/drivers/net/virtio_net.c
@@ -234,11 +234,12 @@ static int start_xmit(struct sk_buff *skb, struct net_device *dev)
234 struct scatterlist sg[1+MAX_SKB_FRAGS]; 234 struct scatterlist sg[1+MAX_SKB_FRAGS];
235 struct virtio_net_hdr *hdr; 235 struct virtio_net_hdr *hdr;
236 const unsigned char *dest = ((struct ethhdr *)skb->data)->h_dest; 236 const unsigned char *dest = ((struct ethhdr *)skb->data)->h_dest;
237 DECLARE_MAC_BUF(mac);
238 237
239 sg_init_table(sg, 1+MAX_SKB_FRAGS); 238 sg_init_table(sg, 1+MAX_SKB_FRAGS);
240 239
241 pr_debug("%s: xmit %p %s\n", dev->name, skb, print_mac(mac, dest)); 240 pr_debug("%s: xmit %p " MAC_FMT "\n", dev->name, skb,
241 dest[0], dest[1], dest[2],
242 dest[3], dest[4], dest[5]);
242 243
243 /* Encode metadata header at front. */ 244 /* Encode metadata header at front. */
244 hdr = skb_vnet_hdr(skb); 245 hdr = skb_vnet_hdr(skb);
diff --git a/drivers/net/wan/Kconfig b/drivers/net/wan/Kconfig
index a3df09ee729f..8005dd16fb4e 100644
--- a/drivers/net/wan/Kconfig
+++ b/drivers/net/wan/Kconfig
@@ -150,9 +150,13 @@ config HDLC_FR
150 150
151config HDLC_PPP 151config HDLC_PPP
152 tristate "Synchronous Point-to-Point Protocol (PPP) support" 152 tristate "Synchronous Point-to-Point Protocol (PPP) support"
153 depends on HDLC 153 depends on HDLC && BROKEN
154 help 154 help
155 Generic HDLC driver supporting PPP over WAN connections. 155 Generic HDLC driver supporting PPP over WAN connections.
156 This module is currently broken and will cause a kernel panic
157 when a device configured in PPP mode is activated.
158
159 It will be replaced by new PPP implementation in Linux 2.6.26.
156 160
157 If unsure, say N. 161 If unsure, say N.
158 162
diff --git a/drivers/net/wireless/hostap/hostap_80211_rx.c b/drivers/net/wireless/hostap/hostap_80211_rx.c
index 49978bdb4324..4fd73809602e 100644
--- a/drivers/net/wireless/hostap/hostap_80211_rx.c
+++ b/drivers/net/wireless/hostap/hostap_80211_rx.c
@@ -635,7 +635,6 @@ hostap_rx_frame_decrypt(local_info_t *local, struct sk_buff *skb,
635{ 635{
636 struct ieee80211_hdr_4addr *hdr; 636 struct ieee80211_hdr_4addr *hdr;
637 int res, hdrlen; 637 int res, hdrlen;
638 DECLARE_MAC_BUF(mac);
639 638
640 if (crypt == NULL || crypt->ops->decrypt_mpdu == NULL) 639 if (crypt == NULL || crypt->ops->decrypt_mpdu == NULL)
641 return 0; 640 return 0;
@@ -647,8 +646,10 @@ hostap_rx_frame_decrypt(local_info_t *local, struct sk_buff *skb,
647 strcmp(crypt->ops->name, "TKIP") == 0) { 646 strcmp(crypt->ops->name, "TKIP") == 0) {
648 if (net_ratelimit()) { 647 if (net_ratelimit()) {
649 printk(KERN_DEBUG "%s: TKIP countermeasures: dropped " 648 printk(KERN_DEBUG "%s: TKIP countermeasures: dropped "
650 "received packet from %s\n", 649 "received packet from " MAC_FMT "\n",
651 local->dev->name, print_mac(mac, hdr->addr2)); 650 local->dev->name,
651 hdr->addr2[0], hdr->addr2[1], hdr->addr2[2],
652 hdr->addr2[3], hdr->addr2[4], hdr->addr2[5]);
652 } 653 }
653 return -1; 654 return -1;
654 } 655 }
@@ -657,9 +658,12 @@ hostap_rx_frame_decrypt(local_info_t *local, struct sk_buff *skb,
657 res = crypt->ops->decrypt_mpdu(skb, hdrlen, crypt->priv); 658 res = crypt->ops->decrypt_mpdu(skb, hdrlen, crypt->priv);
658 atomic_dec(&crypt->refcnt); 659 atomic_dec(&crypt->refcnt);
659 if (res < 0) { 660 if (res < 0) {
660 printk(KERN_DEBUG "%s: decryption failed (SA=%s" 661 printk(KERN_DEBUG "%s: decryption failed (SA=" MAC_FMT
661 ") res=%d\n", 662 ") res=%d\n",
662 local->dev->name, print_mac(mac, hdr->addr2), res); 663 local->dev->name,
664 hdr->addr2[0], hdr->addr2[1], hdr->addr2[2],
665 hdr->addr2[3], hdr->addr2[4], hdr->addr2[5],
666 res);
663 local->comm_tallies.rx_discards_wep_undecryptable++; 667 local->comm_tallies.rx_discards_wep_undecryptable++;
664 return -1; 668 return -1;
665 } 669 }
@@ -721,7 +725,6 @@ void hostap_80211_rx(struct net_device *dev, struct sk_buff *skb,
721 struct ieee80211_crypt_data *crypt = NULL; 725 struct ieee80211_crypt_data *crypt = NULL;
722 void *sta = NULL; 726 void *sta = NULL;
723 int keyidx = 0; 727 int keyidx = 0;
724 DECLARE_MAC_BUF(mac);
725 728
726 iface = netdev_priv(dev); 729 iface = netdev_priv(dev);
727 local = iface->local; 730 local = iface->local;
@@ -798,8 +801,10 @@ void hostap_80211_rx(struct net_device *dev, struct sk_buff *skb,
798 * frames silently instead of filling system log with 801 * frames silently instead of filling system log with
799 * these reports. */ 802 * these reports. */
800 printk(KERN_DEBUG "%s: WEP decryption failed (not set)" 803 printk(KERN_DEBUG "%s: WEP decryption failed (not set)"
801 " (SA=%s)\n", 804 " (SA=" MAC_FMT ")\n",
802 local->dev->name, print_mac(mac, hdr->addr2)); 805 local->dev->name,
806 hdr->addr2[0], hdr->addr2[1], hdr->addr2[2],
807 hdr->addr2[3], hdr->addr2[4], hdr->addr2[5]);
803#endif 808#endif
804 local->comm_tallies.rx_discards_wep_undecryptable++; 809 local->comm_tallies.rx_discards_wep_undecryptable++;
805 goto rx_dropped; 810 goto rx_dropped;
@@ -813,8 +818,9 @@ void hostap_80211_rx(struct net_device *dev, struct sk_buff *skb,
813 (keyidx = hostap_rx_frame_decrypt(local, skb, crypt)) < 0) 818 (keyidx = hostap_rx_frame_decrypt(local, skb, crypt)) < 0)
814 { 819 {
815 printk(KERN_DEBUG "%s: failed to decrypt mgmt::auth " 820 printk(KERN_DEBUG "%s: failed to decrypt mgmt::auth "
816 "from %s\n", dev->name, 821 "from " MAC_FMT "\n", dev->name,
817 print_mac(mac, hdr->addr2)); 822 hdr->addr2[0], hdr->addr2[1], hdr->addr2[2],
823 hdr->addr2[3], hdr->addr2[4], hdr->addr2[5]);
818 /* TODO: could inform hostapd about this so that it 824 /* TODO: could inform hostapd about this so that it
819 * could send auth failure report */ 825 * could send auth failure report */
820 goto rx_dropped; 826 goto rx_dropped;
@@ -982,8 +988,10 @@ void hostap_80211_rx(struct net_device *dev, struct sk_buff *skb,
982 "unencrypted EAPOL frame\n", local->dev->name); 988 "unencrypted EAPOL frame\n", local->dev->name);
983 } else { 989 } else {
984 printk(KERN_DEBUG "%s: encryption configured, but RX " 990 printk(KERN_DEBUG "%s: encryption configured, but RX "
985 "frame not encrypted (SA=%s)\n", 991 "frame not encrypted (SA=" MAC_FMT ")\n",
986 local->dev->name, print_mac(mac, hdr->addr2)); 992 local->dev->name,
993 hdr->addr2[0], hdr->addr2[1], hdr->addr2[2],
994 hdr->addr2[3], hdr->addr2[4], hdr->addr2[5]);
987 goto rx_dropped; 995 goto rx_dropped;
988 } 996 }
989 } 997 }
@@ -992,9 +1000,10 @@ void hostap_80211_rx(struct net_device *dev, struct sk_buff *skb,
992 !hostap_is_eapol_frame(local, skb)) { 1000 !hostap_is_eapol_frame(local, skb)) {
993 if (net_ratelimit()) { 1001 if (net_ratelimit()) {
994 printk(KERN_DEBUG "%s: dropped unencrypted RX data " 1002 printk(KERN_DEBUG "%s: dropped unencrypted RX data "
995 "frame from %s" 1003 "frame from " MAC_FMT " (drop_unencrypted=1)\n",
996 " (drop_unencrypted=1)\n", 1004 dev->name,
997 dev->name, print_mac(mac, hdr->addr2)); 1005 hdr->addr2[0], hdr->addr2[1], hdr->addr2[2],
1006 hdr->addr2[3], hdr->addr2[4], hdr->addr2[5]);
998 } 1007 }
999 goto rx_dropped; 1008 goto rx_dropped;
1000 } 1009 }
diff --git a/drivers/net/wireless/hostap/hostap_80211_tx.c b/drivers/net/wireless/hostap/hostap_80211_tx.c
index e7afc3ec3e6d..921c984416f8 100644
--- a/drivers/net/wireless/hostap/hostap_80211_tx.c
+++ b/drivers/net/wireless/hostap/hostap_80211_tx.c
@@ -314,7 +314,6 @@ static struct sk_buff * hostap_tx_encrypt(struct sk_buff *skb,
314 struct ieee80211_hdr_4addr *hdr; 314 struct ieee80211_hdr_4addr *hdr;
315 u16 fc; 315 u16 fc;
316 int prefix_len, postfix_len, hdr_len, res; 316 int prefix_len, postfix_len, hdr_len, res;
317 DECLARE_MAC_BUF(mac);
318 317
319 iface = netdev_priv(skb->dev); 318 iface = netdev_priv(skb->dev);
320 local = iface->local; 319 local = iface->local;
@@ -329,8 +328,10 @@ static struct sk_buff * hostap_tx_encrypt(struct sk_buff *skb,
329 hdr = (struct ieee80211_hdr_4addr *) skb->data; 328 hdr = (struct ieee80211_hdr_4addr *) skb->data;
330 if (net_ratelimit()) { 329 if (net_ratelimit()) {
331 printk(KERN_DEBUG "%s: TKIP countermeasures: dropped " 330 printk(KERN_DEBUG "%s: TKIP countermeasures: dropped "
332 "TX packet to %s\n", 331 "TX packet to " MAC_FMT "\n",
333 local->dev->name, print_mac(mac, hdr->addr1)); 332 local->dev->name,
333 hdr->addr1[0], hdr->addr1[1], hdr->addr1[2],
334 hdr->addr1[3], hdr->addr1[4], hdr->addr1[5]);
334 } 335 }
335 kfree_skb(skb); 336 kfree_skb(skb);
336 return NULL; 337 return NULL;
diff --git a/drivers/net/wireless/hostap/hostap_ap.c b/drivers/net/wireless/hostap/hostap_ap.c
index ad040a3bb8a7..0acd9589c48c 100644
--- a/drivers/net/wireless/hostap/hostap_ap.c
+++ b/drivers/net/wireless/hostap/hostap_ap.c
@@ -632,7 +632,6 @@ static void hostap_ap_tx_cb_auth(struct sk_buff *skb, int ok, void *data)
632 __le16 *pos; 632 __le16 *pos;
633 struct sta_info *sta = NULL; 633 struct sta_info *sta = NULL;
634 char *txt = NULL; 634 char *txt = NULL;
635 DECLARE_MAC_BUF(mac);
636 635
637 if (ap->local->hostapd) { 636 if (ap->local->hostapd) {
638 dev_kfree_skb(skb); 637 dev_kfree_skb(skb);
@@ -684,10 +683,12 @@ static void hostap_ap_tx_cb_auth(struct sk_buff *skb, int ok, void *data)
684 if (sta) 683 if (sta)
685 atomic_dec(&sta->users); 684 atomic_dec(&sta->users);
686 if (txt) { 685 if (txt) {
687 PDEBUG(DEBUG_AP, "%s: %s auth_cb - alg=%d " 686 PDEBUG(DEBUG_AP, "%s: " MAC_FMT " auth_cb - alg=%d "
688 "trans#=%d status=%d - %s\n", 687 "trans#=%d status=%d - %s\n",
689 dev->name, print_mac(mac, hdr->addr1), auth_alg, 688 dev->name,
690 auth_transaction, status, txt); 689 hdr->addr1[0], hdr->addr1[1], hdr->addr1[2],
690 hdr->addr1[3], hdr->addr1[4], hdr->addr1[5],
691 auth_alg, auth_transaction, status, txt);
691 } 692 }
692 dev_kfree_skb(skb); 693 dev_kfree_skb(skb);
693} 694}
@@ -703,7 +704,6 @@ static void hostap_ap_tx_cb_assoc(struct sk_buff *skb, int ok, void *data)
703 __le16 *pos; 704 __le16 *pos;
704 struct sta_info *sta = NULL; 705 struct sta_info *sta = NULL;
705 char *txt = NULL; 706 char *txt = NULL;
706 DECLARE_MAC_BUF(mac);
707 707
708 if (ap->local->hostapd) { 708 if (ap->local->hostapd) {
709 dev_kfree_skb(skb); 709 dev_kfree_skb(skb);
@@ -754,8 +754,11 @@ static void hostap_ap_tx_cb_assoc(struct sk_buff *skb, int ok, void *data)
754 if (sta) 754 if (sta)
755 atomic_dec(&sta->users); 755 atomic_dec(&sta->users);
756 if (txt) { 756 if (txt) {
757 PDEBUG(DEBUG_AP, "%s: %s assoc_cb - %s\n", 757 PDEBUG(DEBUG_AP, "%s: " MAC_FMT " assoc_cb - %s\n",
758 dev->name, print_mac(mac, hdr->addr1), txt); 758 dev->name,
759 hdr->addr1[0], hdr->addr1[1], hdr->addr1[2],
760 hdr->addr1[3], hdr->addr1[4], hdr->addr1[5],
761 txt);
759 } 762 }
760 dev_kfree_skb(skb); 763 dev_kfree_skb(skb);
761} 764}
@@ -767,7 +770,6 @@ static void hostap_ap_tx_cb_poll(struct sk_buff *skb, int ok, void *data)
767 struct ap_data *ap = data; 770 struct ap_data *ap = data;
768 struct ieee80211_hdr_4addr *hdr; 771 struct ieee80211_hdr_4addr *hdr;
769 struct sta_info *sta; 772 struct sta_info *sta;
770 DECLARE_MAC_BUF(mac);
771 773
772 if (skb->len < 24) 774 if (skb->len < 24)
773 goto fail; 775 goto fail;
@@ -779,9 +781,11 @@ static void hostap_ap_tx_cb_poll(struct sk_buff *skb, int ok, void *data)
779 sta->flags &= ~WLAN_STA_PENDING_POLL; 781 sta->flags &= ~WLAN_STA_PENDING_POLL;
780 spin_unlock(&ap->sta_table_lock); 782 spin_unlock(&ap->sta_table_lock);
781 } else { 783 } else {
782 PDEBUG(DEBUG_AP, "%s: STA %s" 784 PDEBUG(DEBUG_AP, "%s: STA " MAC_FMT
783 " did not ACK activity poll frame\n", 785 " did not ACK activity poll frame\n",
784 ap->local->dev->name, print_mac(mac, hdr->addr1)); 786 ap->local->dev->name,
787 hdr->addr1[0], hdr->addr1[1], hdr->addr1[2],
788 hdr->addr1[3], hdr->addr1[4], hdr->addr1[5]);
785 } 789 }
786 790
787 fail: 791 fail:
@@ -1306,7 +1310,6 @@ static void handle_authen(local_info_t *local, struct sk_buff *skb,
1306 struct sta_info *sta = NULL; 1310 struct sta_info *sta = NULL;
1307 struct ieee80211_crypt_data *crypt; 1311 struct ieee80211_crypt_data *crypt;
1308 char *txt = ""; 1312 char *txt = "";
1309 DECLARE_MAC_BUF(mac);
1310 1313
1311 len = skb->len - IEEE80211_MGMT_HDR_LEN; 1314 len = skb->len - IEEE80211_MGMT_HDR_LEN;
1312 1315
@@ -1315,8 +1318,9 @@ static void handle_authen(local_info_t *local, struct sk_buff *skb,
1315 1318
1316 if (len < 6) { 1319 if (len < 6) {
1317 PDEBUG(DEBUG_AP, "%s: handle_authen - too short payload " 1320 PDEBUG(DEBUG_AP, "%s: handle_authen - too short payload "
1318 "(len=%d) from %s\n", dev->name, len, 1321 "(len=%d) from " MAC_FMT "\n", dev->name, len,
1319 print_mac(mac, hdr->addr2)); 1322 hdr->addr2[0], hdr->addr2[1], hdr->addr2[2],
1323 hdr->addr2[3], hdr->addr2[4], hdr->addr2[5]);
1320 return; 1324 return;
1321 } 1325 }
1322 1326
@@ -1381,8 +1385,10 @@ static void handle_authen(local_info_t *local, struct sk_buff *skb,
1381 if (time_after(jiffies, sta->u.ap.last_beacon + 1385 if (time_after(jiffies, sta->u.ap.last_beacon +
1382 (10 * sta->listen_interval * HZ) / 1024)) { 1386 (10 * sta->listen_interval * HZ) / 1024)) {
1383 PDEBUG(DEBUG_AP, "%s: no beacons received for a while," 1387 PDEBUG(DEBUG_AP, "%s: no beacons received for a while,"
1384 " assuming AP %s is now STA\n", 1388 " assuming AP " MAC_FMT " is now STA\n",
1385 dev->name, print_mac(mac, sta->addr)); 1389 dev->name,
1390 sta->addr[0], sta->addr[1], sta->addr[2],
1391 sta->addr[3], sta->addr[4], sta->addr[5]);
1386 sta->ap = 0; 1392 sta->ap = 0;
1387 sta->flags = 0; 1393 sta->flags = 0;
1388 sta->u.sta.challenge = NULL; 1394 sta->u.sta.challenge = NULL;
@@ -1497,10 +1503,13 @@ static void handle_authen(local_info_t *local, struct sk_buff *skb,
1497 } 1503 }
1498 1504
1499 if (resp) { 1505 if (resp) {
1500 PDEBUG(DEBUG_AP, "%s: %s auth (alg=%d " 1506 PDEBUG(DEBUG_AP, "%s: " MAC_FMT " auth (alg=%d "
1501 "trans#=%d stat=%d len=%d fc=%04x) ==> %d (%s)\n", 1507 "trans#=%d stat=%d len=%d fc=%04x) ==> %d (%s)\n",
1502 dev->name, print_mac(mac, hdr->addr2), auth_alg, 1508 dev->name,
1503 auth_transaction, status_code, len, fc, resp, txt); 1509 hdr->addr2[0], hdr->addr2[1], hdr->addr2[2],
1510 hdr->addr2[3], hdr->addr2[4], hdr->addr2[5],
1511 auth_alg, auth_transaction, status_code, len,
1512 fc, resp, txt);
1504 } 1513 }
1505} 1514}
1506 1515
@@ -1519,14 +1528,15 @@ static void handle_assoc(local_info_t *local, struct sk_buff *skb,
1519 int send_deauth = 0; 1528 int send_deauth = 0;
1520 char *txt = ""; 1529 char *txt = "";
1521 u8 prev_ap[ETH_ALEN]; 1530 u8 prev_ap[ETH_ALEN];
1522 DECLARE_MAC_BUF(mac);
1523 1531
1524 left = len = skb->len - IEEE80211_MGMT_HDR_LEN; 1532 left = len = skb->len - IEEE80211_MGMT_HDR_LEN;
1525 1533
1526 if (len < (reassoc ? 10 : 4)) { 1534 if (len < (reassoc ? 10 : 4)) {
1527 PDEBUG(DEBUG_AP, "%s: handle_assoc - too short payload " 1535 PDEBUG(DEBUG_AP, "%s: handle_assoc - too short payload "
1528 "(len=%d, reassoc=%d) from %s\n", 1536 "(len=%d, reassoc=%d) from " MAC_FMT "\n",
1529 dev->name, len, reassoc, print_mac(mac, hdr->addr2)); 1537 dev->name, len, reassoc,
1538 hdr->addr2[0], hdr->addr2[1], hdr->addr2[2],
1539 hdr->addr2[3], hdr->addr2[4], hdr->addr2[5]);
1530 return; 1540 return;
1531 } 1541 }
1532 1542
@@ -1603,9 +1613,12 @@ static void handle_assoc(local_info_t *local, struct sk_buff *skb,
1603 } 1613 }
1604 1614
1605 if (left > 0) { 1615 if (left > 0) {
1606 PDEBUG(DEBUG_AP, "%s: assoc from %s" 1616 PDEBUG(DEBUG_AP, "%s: assoc from " MAC_FMT
1607 " with extra data (%d bytes) [", 1617 " with extra data (%d bytes) [",
1608 dev->name, print_mac(mac, hdr->addr2), left); 1618 dev->name,
1619 hdr->addr2[0], hdr->addr2[1], hdr->addr2[2],
1620 hdr->addr2[3], hdr->addr2[4], hdr->addr2[5],
1621 left);
1609 while (left > 0) { 1622 while (left > 0) {
1610 PDEBUG2(DEBUG_AP, "<%02x>", *u); 1623 PDEBUG2(DEBUG_AP, "<%02x>", *u);
1611 u++; left--; 1624 u++; left--;
@@ -1704,10 +1717,15 @@ static void handle_assoc(local_info_t *local, struct sk_buff *skb,
1704 } 1717 }
1705 1718
1706#if 0 1719#if 0
1707 PDEBUG(DEBUG_AP, "%s: %s %sassoc (len=%d " 1720 PDEBUG(DEBUG_AP, "%s: " MAC_FMT" %sassoc (len=%d "
1708 "prev_ap=%s) => %d(%d) (%s)\n", 1721 "prev_ap=" MAC_FMT") => %d(%d) (%s)\n",
1709 dev->name, print_mac(mac, hdr->addr2), reassoc ? "re" : "", len, 1722 dev->name,
1710 print_mac(mac, prev_ap), resp, send_deauth, txt); 1723 hdr->addr2[0], hdr->addr2[1], hdr->addr2[2],
1724 hdr->addr2[3], hdr->addr2[4], hdr->addr2[5],
1725 reassoc ? "re" : "", len,
1726 prev_ap[0], prev_ap[1], prev_ap[2],
1727 prev_ap[3], prev_ap[4], prev_ap[5],
1728 resp, send_deauth, txt);
1711#endif 1729#endif
1712} 1730}
1713 1731
@@ -1735,9 +1753,11 @@ static void handle_deauth(local_info_t *local, struct sk_buff *skb,
1735 pos = (__le16 *) body; 1753 pos = (__le16 *) body;
1736 reason_code = le16_to_cpu(*pos); 1754 reason_code = le16_to_cpu(*pos);
1737 1755
1738 PDEBUG(DEBUG_AP, "%s: deauthentication: %s len=%d, " 1756 PDEBUG(DEBUG_AP, "%s: deauthentication: " MAC_FMT " len=%d, "
1739 "reason_code=%d\n", dev->name, print_mac(mac, hdr->addr2), len, 1757 "reason_code=%d\n", dev->name,
1740 reason_code); 1758 hdr->addr2[0], hdr->addr2[1], hdr->addr2[2],
1759 hdr->addr2[3], hdr->addr2[4], hdr->addr2[5],
1760 len, reason_code);
1741 1761
1742 spin_lock_bh(&local->ap->sta_table_lock); 1762 spin_lock_bh(&local->ap->sta_table_lock);
1743 sta = ap_get_sta(local->ap, hdr->addr2); 1763 sta = ap_get_sta(local->ap, hdr->addr2);
@@ -1748,9 +1768,11 @@ static void handle_deauth(local_info_t *local, struct sk_buff *skb,
1748 } 1768 }
1749 spin_unlock_bh(&local->ap->sta_table_lock); 1769 spin_unlock_bh(&local->ap->sta_table_lock);
1750 if (sta == NULL) { 1770 if (sta == NULL) {
1751 printk("%s: deauthentication from %s, " 1771 printk("%s: deauthentication from " MAC_FMT ", "
1752 "reason_code=%d, but STA not authenticated\n", dev->name, 1772 "reason_code=%d, but STA not authenticated\n", dev->name,
1753 print_mac(mac, hdr->addr2), reason_code); 1773 hdr->addr2[0], hdr->addr2[1], hdr->addr2[2],
1774 hdr->addr2[3], hdr->addr2[4], hdr->addr2[5],
1775 reason_code);
1754 } 1776 }
1755} 1777}
1756 1778
@@ -1766,7 +1788,6 @@ static void handle_disassoc(local_info_t *local, struct sk_buff *skb,
1766 u16 reason_code; 1788 u16 reason_code;
1767 __le16 *pos; 1789 __le16 *pos;
1768 struct sta_info *sta = NULL; 1790 struct sta_info *sta = NULL;
1769 DECLARE_MAC_BUF(mac);
1770 1791
1771 len = skb->len - IEEE80211_MGMT_HDR_LEN; 1792 len = skb->len - IEEE80211_MGMT_HDR_LEN;
1772 1793
@@ -1778,9 +1799,11 @@ static void handle_disassoc(local_info_t *local, struct sk_buff *skb,
1778 pos = (__le16 *) body; 1799 pos = (__le16 *) body;
1779 reason_code = le16_to_cpu(*pos); 1800 reason_code = le16_to_cpu(*pos);
1780 1801
1781 PDEBUG(DEBUG_AP, "%s: disassociation: %s len=%d, " 1802 PDEBUG(DEBUG_AP, "%s: disassociation: " MAC_FMT " len=%d, "
1782 "reason_code=%d\n", dev->name, print_mac(mac, hdr->addr2), len, 1803 "reason_code=%d\n", dev->name,
1783 reason_code); 1804 hdr->addr2[0], hdr->addr2[1], hdr->addr2[2],
1805 hdr->addr2[3], hdr->addr2[4], hdr->addr2[5],
1806 len, reason_code);
1784 1807
1785 spin_lock_bh(&local->ap->sta_table_lock); 1808 spin_lock_bh(&local->ap->sta_table_lock);
1786 sta = ap_get_sta(local->ap, hdr->addr2); 1809 sta = ap_get_sta(local->ap, hdr->addr2);
@@ -1791,9 +1814,12 @@ static void handle_disassoc(local_info_t *local, struct sk_buff *skb,
1791 } 1814 }
1792 spin_unlock_bh(&local->ap->sta_table_lock); 1815 spin_unlock_bh(&local->ap->sta_table_lock);
1793 if (sta == NULL) { 1816 if (sta == NULL) {
1794 printk("%s: disassociation from %s, " 1817 printk("%s: disassociation from " MAC_FMT ", "
1795 "reason_code=%d, but STA not authenticated\n", 1818 "reason_code=%d, but STA not authenticated\n",
1796 dev->name, print_mac(mac, hdr->addr2), reason_code); 1819 dev->name,
1820 hdr->addr2[0], hdr->addr2[1], hdr->addr2[2],
1821 hdr->addr2[3], hdr->addr2[4], hdr->addr2[5],
1822 reason_code);
1797 } 1823 }
1798} 1824}
1799 1825
@@ -1882,16 +1908,20 @@ static void handle_pspoll(local_info_t *local,
1882 struct sta_info *sta; 1908 struct sta_info *sta;
1883 u16 aid; 1909 u16 aid;
1884 struct sk_buff *skb; 1910 struct sk_buff *skb;
1885 DECLARE_MAC_BUF(mac);
1886 1911
1887 PDEBUG(DEBUG_PS2, "handle_pspoll: BSSID=%s" 1912 PDEBUG(DEBUG_PS2, "handle_pspoll: BSSID=" MAC_FMT
1888 ", TA=%s PWRMGT=%d\n", 1913 ", TA=" MAC_FMT " PWRMGT=%d\n",
1889 print_mac(mac, hdr->addr1), print_mac(mac, hdr->addr2), 1914 hdr->addr1[0], hdr->addr1[1], hdr->addr1[2],
1915 hdr->addr1[3], hdr->addr1[4], hdr->addr1[5],
1916 hdr->addr2[0], hdr->addr2[1], hdr->addr2[2],
1917 hdr->addr2[3], hdr->addr2[4], hdr->addr2[5],
1890 !!(le16_to_cpu(hdr->frame_ctl) & IEEE80211_FCTL_PM)); 1918 !!(le16_to_cpu(hdr->frame_ctl) & IEEE80211_FCTL_PM));
1891 1919
1892 if (memcmp(hdr->addr1, dev->dev_addr, ETH_ALEN)) { 1920 if (memcmp(hdr->addr1, dev->dev_addr, ETH_ALEN)) {
1893 PDEBUG(DEBUG_AP, "handle_pspoll - addr1(BSSID)=%s" 1921 PDEBUG(DEBUG_AP, "handle_pspoll - addr1(BSSID)=" MAC_FMT
1894 " not own MAC\n", print_mac(mac, hdr->addr1)); 1922 " not own MAC\n",
1923 hdr->addr1[0], hdr->addr1[1], hdr->addr1[2],
1924 hdr->addr1[3], hdr->addr1[4], hdr->addr1[5]);
1895 return; 1925 return;
1896 } 1926 }
1897 1927
@@ -1969,7 +1999,6 @@ static void handle_wds_oper_queue(struct work_struct *work)
1969 wds_oper_queue); 1999 wds_oper_queue);
1970 local_info_t *local = ap->local; 2000 local_info_t *local = ap->local;
1971 struct wds_oper_data *entry, *prev; 2001 struct wds_oper_data *entry, *prev;
1972 DECLARE_MAC_BUF(mac);
1973 2002
1974 spin_lock_bh(&local->lock); 2003 spin_lock_bh(&local->lock);
1975 entry = local->ap->wds_oper_entries; 2004 entry = local->ap->wds_oper_entries;
@@ -1978,10 +2007,11 @@ static void handle_wds_oper_queue(struct work_struct *work)
1978 2007
1979 while (entry) { 2008 while (entry) {
1980 PDEBUG(DEBUG_AP, "%s: %s automatic WDS connection " 2009 PDEBUG(DEBUG_AP, "%s: %s automatic WDS connection "
1981 "to AP %s\n", 2010 "to AP " MAC_FMT "\n",
1982 local->dev->name, 2011 local->dev->name,
1983 entry->type == WDS_ADD ? "adding" : "removing", 2012 entry->type == WDS_ADD ? "adding" : "removing",
1984 print_mac(mac, entry->addr)); 2013 entry->addr[0], entry->addr[1], entry->addr[2],
2014 entry->addr[3], entry->addr[4], entry->addr[5]);
1985 if (entry->type == WDS_ADD) 2015 if (entry->type == WDS_ADD)
1986 prism2_wds_add(local, entry->addr, 0); 2016 prism2_wds_add(local, entry->addr, 0);
1987 else if (entry->type == WDS_DEL) 2017 else if (entry->type == WDS_DEL)
@@ -2158,7 +2188,6 @@ static void handle_ap_item(local_info_t *local, struct sk_buff *skb,
2158#endif /* PRISM2_NO_KERNEL_IEEE80211_MGMT */ 2188#endif /* PRISM2_NO_KERNEL_IEEE80211_MGMT */
2159 u16 fc, type, stype; 2189 u16 fc, type, stype;
2160 struct ieee80211_hdr_4addr *hdr; 2190 struct ieee80211_hdr_4addr *hdr;
2161 DECLARE_MAC_BUF(mac);
2162 2191
2163 /* FIX: should give skb->len to handler functions and check that the 2192 /* FIX: should give skb->len to handler functions and check that the
2164 * buffer is long enough */ 2193 * buffer is long enough */
@@ -2187,8 +2216,9 @@ static void handle_ap_item(local_info_t *local, struct sk_buff *skb,
2187 2216
2188 if (memcmp(hdr->addr1, dev->dev_addr, ETH_ALEN)) { 2217 if (memcmp(hdr->addr1, dev->dev_addr, ETH_ALEN)) {
2189 PDEBUG(DEBUG_AP, "handle_ap_item - addr1(BSSID)=" 2218 PDEBUG(DEBUG_AP, "handle_ap_item - addr1(BSSID)="
2190 "%s not own MAC\n", 2219 MAC_FMT " not own MAC\n",
2191 print_mac(mac, hdr->addr1)); 2220 hdr->addr1[0], hdr->addr1[1], hdr->addr1[2],
2221 hdr->addr1[3], hdr->addr1[4], hdr->addr1[5]);
2192 goto done; 2222 goto done;
2193 } 2223 }
2194 2224
@@ -2224,14 +2254,18 @@ static void handle_ap_item(local_info_t *local, struct sk_buff *skb,
2224 } 2254 }
2225 2255
2226 if (memcmp(hdr->addr1, dev->dev_addr, ETH_ALEN)) { 2256 if (memcmp(hdr->addr1, dev->dev_addr, ETH_ALEN)) {
2227 PDEBUG(DEBUG_AP, "handle_ap_item - addr1(DA)=%s" 2257 PDEBUG(DEBUG_AP, "handle_ap_item - addr1(DA)=" MAC_FMT
2228 " not own MAC\n", print_mac(mac, hdr->addr1)); 2258 " not own MAC\n",
2259 hdr->addr1[0], hdr->addr1[1], hdr->addr1[2],
2260 hdr->addr1[3], hdr->addr1[4], hdr->addr1[5]);
2229 goto done; 2261 goto done;
2230 } 2262 }
2231 2263
2232 if (memcmp(hdr->addr3, dev->dev_addr, ETH_ALEN)) { 2264 if (memcmp(hdr->addr3, dev->dev_addr, ETH_ALEN)) {
2233 PDEBUG(DEBUG_AP, "handle_ap_item - addr3(BSSID)=%s" 2265 PDEBUG(DEBUG_AP, "handle_ap_item - addr3(BSSID)=" MAC_FMT
2234 " not own MAC\n", print_mac(mac, hdr->addr3)); 2266 " not own MAC\n",
2267 hdr->addr3[0], hdr->addr3[1], hdr->addr3[2],
2268 hdr->addr3[3], hdr->addr3[4], hdr->addr3[5]);
2235 goto done; 2269 goto done;
2236 } 2270 }
2237 2271
@@ -2312,7 +2346,6 @@ static void schedule_packet_send(local_info_t *local, struct sta_info *sta)
2312 struct sk_buff *skb; 2346 struct sk_buff *skb;
2313 struct ieee80211_hdr_4addr *hdr; 2347 struct ieee80211_hdr_4addr *hdr;
2314 struct hostap_80211_rx_status rx_stats; 2348 struct hostap_80211_rx_status rx_stats;
2315 DECLARE_MAC_BUF(mac);
2316 2349
2317 if (skb_queue_empty(&sta->tx_buf)) 2350 if (skb_queue_empty(&sta->tx_buf))
2318 return; 2351 return;
@@ -2334,7 +2367,9 @@ static void schedule_packet_send(local_info_t *local, struct sta_info *sta)
2334 hdr->duration_id = cpu_to_le16(sta->aid | BIT(15) | BIT(14)); 2367 hdr->duration_id = cpu_to_le16(sta->aid | BIT(15) | BIT(14));
2335 2368
2336 PDEBUG(DEBUG_PS2, "%s: Scheduling buffered packet delivery for STA " 2369 PDEBUG(DEBUG_PS2, "%s: Scheduling buffered packet delivery for STA "
2337 "%s\n", local->dev->name, print_mac(mac, sta->addr)); 2370 MAC_FMT "\n", local->dev->name,
2371 sta->addr[0], sta->addr[1], sta->addr[2],
2372 sta->addr[3], sta->addr[4], sta->addr[5]);
2338 2373
2339 skb->dev = local->dev; 2374 skb->dev = local->dev;
2340 2375
@@ -2661,7 +2696,6 @@ static int ap_update_sta_tx_rate(struct sta_info *sta, struct net_device *dev)
2661 int ret = sta->tx_rate; 2696 int ret = sta->tx_rate;
2662 struct hostap_interface *iface; 2697 struct hostap_interface *iface;
2663 local_info_t *local; 2698 local_info_t *local;
2664 DECLARE_MAC_BUF(mac);
2665 2699
2666 iface = netdev_priv(dev); 2700 iface = netdev_priv(dev);
2667 local = iface->local; 2701 local = iface->local;
@@ -2689,9 +2723,12 @@ static int ap_update_sta_tx_rate(struct sta_info *sta, struct net_device *dev)
2689 case 3: sta->tx_rate = 110; break; 2723 case 3: sta->tx_rate = 110; break;
2690 default: sta->tx_rate = 0; break; 2724 default: sta->tx_rate = 0; break;
2691 } 2725 }
2692 PDEBUG(DEBUG_AP, "%s: STA %s" 2726 PDEBUG(DEBUG_AP, "%s: STA " MAC_FMT
2693 " TX rate raised to %d\n", 2727 " TX rate raised to %d\n",
2694 dev->name, print_mac(mac, sta->addr), sta->tx_rate); 2728 dev->name,
2729 sta->addr[0], sta->addr[1], sta->addr[2],
2730 sta->addr[3], sta->addr[4], sta->addr[5],
2731 sta->tx_rate);
2695 } 2732 }
2696 sta->tx_since_last_failure = 0; 2733 sta->tx_since_last_failure = 0;
2697 } 2734 }
@@ -2709,7 +2746,6 @@ ap_tx_ret hostap_handle_sta_tx(local_info_t *local, struct hostap_tx_data *tx)
2709 int set_tim, ret; 2746 int set_tim, ret;
2710 struct ieee80211_hdr_4addr *hdr; 2747 struct ieee80211_hdr_4addr *hdr;
2711 struct hostap_skb_tx_data *meta; 2748 struct hostap_skb_tx_data *meta;
2712 DECLARE_MAC_BUF(mac);
2713 2749
2714 meta = (struct hostap_skb_tx_data *) skb->cb; 2750 meta = (struct hostap_skb_tx_data *) skb->cb;
2715 ret = AP_TX_CONTINUE; 2751 ret = AP_TX_CONTINUE;
@@ -2745,8 +2781,9 @@ ap_tx_ret hostap_handle_sta_tx(local_info_t *local, struct hostap_tx_data *tx)
2745 * print out any errors here. */ 2781 * print out any errors here. */
2746 if (net_ratelimit()) { 2782 if (net_ratelimit()) {
2747 printk(KERN_DEBUG "AP: drop packet to non-associated " 2783 printk(KERN_DEBUG "AP: drop packet to non-associated "
2748 "STA %s\n", 2784 "STA " MAC_FMT "\n",
2749 print_mac(mac, hdr->addr1)); 2785 hdr->addr1[0], hdr->addr1[1], hdr->addr1[2],
2786 hdr->addr1[3], hdr->addr1[4], hdr->addr1[5]);
2750 } 2787 }
2751#endif 2788#endif
2752 local->ap->tx_drop_nonassoc++; 2789 local->ap->tx_drop_nonassoc++;
@@ -2784,9 +2821,11 @@ ap_tx_ret hostap_handle_sta_tx(local_info_t *local, struct hostap_tx_data *tx)
2784 } 2821 }
2785 2822
2786 if (skb_queue_len(&sta->tx_buf) >= STA_MAX_TX_BUFFER) { 2823 if (skb_queue_len(&sta->tx_buf) >= STA_MAX_TX_BUFFER) {
2787 PDEBUG(DEBUG_PS, "%s: No more space in STA (%s" 2824 PDEBUG(DEBUG_PS, "%s: No more space in STA (" MAC_FMT
2788 ")'s PS mode buffer\n", 2825 ")'s PS mode buffer\n",
2789 local->dev->name, print_mac(mac, sta->addr)); 2826 local->dev->name,
2827 sta->addr[0], sta->addr[1], sta->addr[2],
2828 sta->addr[3], sta->addr[4], sta->addr[5]);
2790 /* Make sure that TIM is set for the station (it might not be 2829 /* Make sure that TIM is set for the station (it might not be
2791 * after AP wlan hw reset). */ 2830 * after AP wlan hw reset). */
2792 /* FIX: should fix hw reset to restore bits based on STA 2831 /* FIX: should fix hw reset to restore bits based on STA
@@ -2850,7 +2889,6 @@ void hostap_handle_sta_tx_exc(local_info_t *local, struct sk_buff *skb)
2850 struct sta_info *sta; 2889 struct sta_info *sta;
2851 struct ieee80211_hdr_4addr *hdr; 2890 struct ieee80211_hdr_4addr *hdr;
2852 struct hostap_skb_tx_data *meta; 2891 struct hostap_skb_tx_data *meta;
2853 DECLARE_MAC_BUF(mac);
2854 2892
2855 hdr = (struct ieee80211_hdr_4addr *) skb->data; 2893 hdr = (struct ieee80211_hdr_4addr *) skb->data;
2856 meta = (struct hostap_skb_tx_data *) skb->cb; 2894 meta = (struct hostap_skb_tx_data *) skb->cb;
@@ -2859,9 +2897,12 @@ void hostap_handle_sta_tx_exc(local_info_t *local, struct sk_buff *skb)
2859 sta = ap_get_sta(local->ap, hdr->addr1); 2897 sta = ap_get_sta(local->ap, hdr->addr1);
2860 if (!sta) { 2898 if (!sta) {
2861 spin_unlock(&local->ap->sta_table_lock); 2899 spin_unlock(&local->ap->sta_table_lock);
2862 PDEBUG(DEBUG_AP, "%s: Could not find STA %s" 2900 PDEBUG(DEBUG_AP, "%s: Could not find STA " MAC_FMT
2863 " for this TX error (@%lu)\n", 2901 " for this TX error (@%lu)\n",
2864 local->dev->name, print_mac(mac, hdr->addr1), jiffies); 2902 local->dev->name,
2903 hdr->addr1[0], hdr->addr1[1], hdr->addr1[2],
2904 hdr->addr1[3], hdr->addr1[4], hdr->addr1[5],
2905 jiffies);
2865 return; 2906 return;
2866 } 2907 }
2867 2908
@@ -2888,9 +2929,11 @@ void hostap_handle_sta_tx_exc(local_info_t *local, struct sk_buff *skb)
2888 case 3: sta->tx_rate = 110; break; 2929 case 3: sta->tx_rate = 110; break;
2889 default: sta->tx_rate = 0; break; 2930 default: sta->tx_rate = 0; break;
2890 } 2931 }
2891 PDEBUG(DEBUG_AP, "%s: STA %s" 2932 PDEBUG(DEBUG_AP, "%s: STA " MAC_FMT
2892 " TX rate lowered to %d\n", 2933 " TX rate lowered to %d\n",
2893 local->dev->name, print_mac(mac, sta->addr), 2934 local->dev->name,
2935 sta->addr[0], sta->addr[1], sta->addr[2],
2936 sta->addr[3], sta->addr[4], sta->addr[5],
2894 sta->tx_rate); 2937 sta->tx_rate);
2895 } 2938 }
2896 sta->tx_consecutive_exc = 0; 2939 sta->tx_consecutive_exc = 0;
@@ -2956,7 +2999,6 @@ ap_rx_ret hostap_handle_sta_rx(local_info_t *local, struct net_device *dev,
2956 struct sta_info *sta; 2999 struct sta_info *sta;
2957 u16 fc, type, stype; 3000 u16 fc, type, stype;
2958 struct ieee80211_hdr_4addr *hdr; 3001 struct ieee80211_hdr_4addr *hdr;
2959 DECLARE_MAC_BUF(mac);
2960 3002
2961 if (local->ap == NULL) 3003 if (local->ap == NULL)
2962 return AP_RX_CONTINUE; 3004 return AP_RX_CONTINUE;
@@ -2988,9 +3030,12 @@ ap_rx_ret hostap_handle_sta_rx(local_info_t *local, struct net_device *dev,
2988 } else { 3030 } else {
2989 printk(KERN_DEBUG "%s: dropped received packet" 3031 printk(KERN_DEBUG "%s: dropped received packet"
2990 " from non-associated STA " 3032 " from non-associated STA "
2991 "%s" 3033 MAC_FMT
2992 " (type=0x%02x, subtype=0x%02x)\n", 3034 " (type=0x%02x, subtype=0x%02x)\n",
2993 dev->name, print_mac(mac, hdr->addr2), 3035 dev->name,
3036 hdr->addr2[0], hdr->addr2[1],
3037 hdr->addr2[2], hdr->addr2[3],
3038 hdr->addr2[4], hdr->addr2[5],
2994 type >> 2, stype >> 4); 3039 type >> 2, stype >> 4);
2995 hostap_rx(dev, skb, rx_stats); 3040 hostap_rx(dev, skb, rx_stats);
2996#endif /* PRISM2_NO_KERNEL_IEEE80211_MGMT */ 3041#endif /* PRISM2_NO_KERNEL_IEEE80211_MGMT */
@@ -3025,8 +3070,11 @@ ap_rx_ret hostap_handle_sta_rx(local_info_t *local, struct net_device *dev,
3025 * being associated. */ 3070 * being associated. */
3026 printk(KERN_DEBUG "%s: rejected received nullfunc " 3071 printk(KERN_DEBUG "%s: rejected received nullfunc "
3027 "frame without ToDS from not associated STA " 3072 "frame without ToDS from not associated STA "
3028 "%s\n", 3073 MAC_FMT "\n",
3029 dev->name, print_mac(mac, hdr->addr2)); 3074 dev->name,
3075 hdr->addr2[0], hdr->addr2[1],
3076 hdr->addr2[2], hdr->addr2[3],
3077 hdr->addr2[4], hdr->addr2[5]);
3030 hostap_rx(dev, skb, rx_stats); 3078 hostap_rx(dev, skb, rx_stats);
3031#endif /* PRISM2_NO_KERNEL_IEEE80211_MGMT */ 3079#endif /* PRISM2_NO_KERNEL_IEEE80211_MGMT */
3032 } 3080 }
@@ -3043,9 +3091,12 @@ ap_rx_ret hostap_handle_sta_rx(local_info_t *local, struct net_device *dev,
3043 * If BSSID is own, report the dropping of this frame. */ 3091 * If BSSID is own, report the dropping of this frame. */
3044 if (memcmp(hdr->addr3, dev->dev_addr, ETH_ALEN) == 0) { 3092 if (memcmp(hdr->addr3, dev->dev_addr, ETH_ALEN) == 0) {
3045 printk(KERN_DEBUG "%s: dropped received packet from " 3093 printk(KERN_DEBUG "%s: dropped received packet from "
3046 "%s with no ToDS flag " 3094 MAC_FMT " with no ToDS flag "
3047 "(type=0x%02x, subtype=0x%02x)\n", dev->name, 3095 "(type=0x%02x, subtype=0x%02x)\n", dev->name,
3048 print_mac(mac, hdr->addr2), type >> 2, stype >> 4); 3096 hdr->addr2[0], hdr->addr2[1],
3097 hdr->addr2[2], hdr->addr2[3],
3098 hdr->addr2[4], hdr->addr2[5],
3099 type >> 2, stype >> 4);
3049 hostap_dump_rx_80211(dev->name, skb, rx_stats); 3100 hostap_dump_rx_80211(dev->name, skb, rx_stats);
3050 } 3101 }
3051 ret = AP_RX_DROP; 3102 ret = AP_RX_DROP;
diff --git a/drivers/net/wireless/ipw2200.c b/drivers/net/wireless/ipw2200.c
index e79de53bd4f3..fa87c5c2ae0b 100644
--- a/drivers/net/wireless/ipw2200.c
+++ b/drivers/net/wireless/ipw2200.c
@@ -10192,7 +10192,6 @@ static int ipw_tx_skb(struct ipw_priv *priv, struct ieee80211_txb *txb,
10192 u8 id, hdr_len, unicast; 10192 u8 id, hdr_len, unicast;
10193 u16 remaining_bytes; 10193 u16 remaining_bytes;
10194 int fc; 10194 int fc;
10195 DECLARE_MAC_BUF(mac);
10196 10195
10197 hdr_len = ieee80211_get_hdrlen(le16_to_cpu(hdr->frame_ctl)); 10196 hdr_len = ieee80211_get_hdrlen(le16_to_cpu(hdr->frame_ctl));
10198 switch (priv->ieee->iw_mode) { 10197 switch (priv->ieee->iw_mode) {
@@ -10203,8 +10202,10 @@ static int ipw_tx_skb(struct ipw_priv *priv, struct ieee80211_txb *txb,
10203 id = ipw_add_station(priv, hdr->addr1); 10202 id = ipw_add_station(priv, hdr->addr1);
10204 if (id == IPW_INVALID_STATION) { 10203 if (id == IPW_INVALID_STATION) {
10205 IPW_WARNING("Attempt to send data to " 10204 IPW_WARNING("Attempt to send data to "
10206 "invalid cell: %s\n", 10205 "invalid cell: " MAC_FMT "\n",
10207 print_mac(mac, hdr->addr1)); 10206 hdr->addr1[0], hdr->addr1[1],
10207 hdr->addr1[2], hdr->addr1[3],
10208 hdr->addr1[4], hdr->addr1[5]);
10208 goto drop; 10209 goto drop;
10209 } 10210 }
10210 } 10211 }
@@ -11574,6 +11575,7 @@ static int ipw_prom_alloc(struct ipw_priv *priv)
11574 priv->prom_priv->priv = priv; 11575 priv->prom_priv->priv = priv;
11575 11576
11576 strcpy(priv->prom_net_dev->name, "rtap%d"); 11577 strcpy(priv->prom_net_dev->name, "rtap%d");
11578 memcpy(priv->prom_net_dev->dev_addr, priv->mac_addr, ETH_ALEN);
11577 11579
11578 priv->prom_net_dev->type = ARPHRD_IEEE80211_RADIOTAP; 11580 priv->prom_net_dev->type = ARPHRD_IEEE80211_RADIOTAP;
11579 priv->prom_net_dev->open = ipw_prom_open; 11581 priv->prom_net_dev->open = ipw_prom_open;
diff --git a/drivers/net/wireless/libertas/assoc.c b/drivers/net/wireless/libertas/assoc.c
index f353419acd02..c9c3640ce9fb 100644
--- a/drivers/net/wireless/libertas/assoc.c
+++ b/drivers/net/wireless/libertas/assoc.c
@@ -1004,7 +1004,7 @@ void lbs_association_worker(struct work_struct *work)
1004 } 1004 }
1005 1005
1006 if (find_any_ssid) { 1006 if (find_any_ssid) {
1007 u8 new_mode; 1007 u8 new_mode = assoc_req->mode;
1008 1008
1009 ret = lbs_find_best_network_ssid(priv, assoc_req->ssid, 1009 ret = lbs_find_best_network_ssid(priv, assoc_req->ssid,
1010 &assoc_req->ssid_len, assoc_req->mode, &new_mode); 1010 &assoc_req->ssid_len, assoc_req->mode, &new_mode);
diff --git a/drivers/net/wireless/rt2x00/rt61pci.c b/drivers/net/wireless/rt2x00/rt61pci.c
index 1cb056be4489..468a31c8c113 100644
--- a/drivers/net/wireless/rt2x00/rt61pci.c
+++ b/drivers/net/wireless/rt2x00/rt61pci.c
@@ -2379,10 +2379,8 @@ static int rt61pci_beacon_update(struct ieee80211_hw *hw, struct sk_buff *skb,
2379 */ 2379 */
2380 if (skb_headroom(skb) < intf->beacon->queue->desc_size) { 2380 if (skb_headroom(skb) < intf->beacon->queue->desc_size) {
2381 if (pskb_expand_head(skb, intf->beacon->queue->desc_size, 2381 if (pskb_expand_head(skb, intf->beacon->queue->desc_size,
2382 0, GFP_ATOMIC)) { 2382 0, GFP_ATOMIC))
2383 dev_kfree_skb(skb);
2384 return -ENOMEM; 2383 return -ENOMEM;
2385 }
2386 } 2384 }
2387 2385
2388 /* 2386 /*