aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--MAINTAINERS2
-rw-r--r--drivers/net/bnx2.h9
-rw-r--r--drivers/net/bonding/bond_main.c2
-rw-r--r--drivers/net/cnic.c6
-rw-r--r--drivers/net/qlge/qlge.h1
-rw-r--r--drivers/net/qlge/qlge_main.c78
-rw-r--r--drivers/net/qlge/qlge_mpi.c23
-rw-r--r--drivers/net/sfc/rx.c9
-rw-r--r--drivers/net/usb/dm9601.c4
-rw-r--r--drivers/net/virtio_net.c14
-rw-r--r--drivers/net/wireless/airo.c5
-rw-r--r--drivers/net/wireless/b43/leds.h1
-rw-r--r--drivers/net/wireless/b43/main.c1
-rw-r--r--drivers/net/wireless/b43/rfkill.c3
-rw-r--r--drivers/net/wireless/libertas/if_spi.c10
-rw-r--r--drivers/net/wireless/rt2x00/rt2800usb.c2
-rw-r--r--net/ipv4/raw.c24
-rw-r--r--net/mac80211/ibss.c6
-rw-r--r--net/mac80211/mesh_hwmp.c2
-rw-r--r--net/mac80211/mlme.c3
-rw-r--r--net/mac80211/tx.c2
-rw-r--r--net/packet/af_packet.c5
-rw-r--r--net/wireless/core.h1
-rw-r--r--net/wireless/mlme.c9
-rw-r--r--net/wireless/sme.c21
25 files changed, 160 insertions, 83 deletions
diff --git a/MAINTAINERS b/MAINTAINERS
index 950bd3294313..e1cf7314a24c 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -4303,7 +4303,7 @@ F: drivers/video/aty/aty128fb.c
4303RALINK RT2X00 WIRELESS LAN DRIVER 4303RALINK RT2X00 WIRELESS LAN DRIVER
4304P: rt2x00 project 4304P: rt2x00 project
4305L: linux-wireless@vger.kernel.org 4305L: linux-wireless@vger.kernel.org
4306L: users@rt2x00.serialmonkey.com 4306L: users@rt2x00.serialmonkey.com (moderated for non-subscribers)
4307W: http://rt2x00.serialmonkey.com/ 4307W: http://rt2x00.serialmonkey.com/
4308S: Maintained 4308S: Maintained
4309T: git git://git.kernel.org/pub/scm/linux/kernel/git/ivd/rt2x00.git 4309T: git git://git.kernel.org/pub/scm/linux/kernel/git/ivd/rt2x00.git
diff --git a/drivers/net/bnx2.h b/drivers/net/bnx2.h
index 6c7f795d12de..a4d83409f205 100644
--- a/drivers/net/bnx2.h
+++ b/drivers/net/bnx2.h
@@ -361,9 +361,12 @@ struct l2_fhdr {
361#define BNX2_L2CTX_CTX_TYPE_CTX_BD_CHN_TYPE_VALUE (1<<28) 361#define BNX2_L2CTX_CTX_TYPE_CTX_BD_CHN_TYPE_VALUE (1<<28)
362 362
363#define BNX2_L2CTX_HOST_BDIDX 0x00000004 363#define BNX2_L2CTX_HOST_BDIDX 0x00000004
364#define BNX2_L2CTX_STATUSB_NUM_SHIFT 16 364#define BNX2_L2CTX_L5_STATUSB_NUM_SHIFT 16
365#define BNX2_L2CTX_STATUSB_NUM(sb_id) \ 365#define BNX2_L2CTX_L2_STATUSB_NUM_SHIFT 24
366 (((sb_id) > 0) ? (((sb_id) + 7) << BNX2_L2CTX_STATUSB_NUM_SHIFT) : 0) 366#define BNX2_L2CTX_L5_STATUSB_NUM(sb_id) \
367 (((sb_id) > 0) ? (((sb_id) + 7) << BNX2_L2CTX_L5_STATUSB_NUM_SHIFT) : 0)
368#define BNX2_L2CTX_L2_STATUSB_NUM(sb_id) \
369 (((sb_id) > 0) ? (((sb_id) + 7) << BNX2_L2CTX_L2_STATUSB_NUM_SHIFT) : 0)
367#define BNX2_L2CTX_HOST_BSEQ 0x00000008 370#define BNX2_L2CTX_HOST_BSEQ 0x00000008
368#define BNX2_L2CTX_NX_BSEQ 0x0000000c 371#define BNX2_L2CTX_NX_BSEQ 0x0000000c
369#define BNX2_L2CTX_NX_BDHADDR_HI 0x00000010 372#define BNX2_L2CTX_NX_BDHADDR_HI 0x00000010
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
index 8c5ebfb0680f..db82876ceb28 100644
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -707,7 +707,7 @@ static int bond_check_dev_link(struct bonding *bond,
707 struct net_device *slave_dev, int reporting) 707 struct net_device *slave_dev, int reporting)
708{ 708{
709 const struct net_device_ops *slave_ops = slave_dev->netdev_ops; 709 const struct net_device_ops *slave_ops = slave_dev->netdev_ops;
710 static int (*ioctl)(struct net_device *, struct ifreq *, int); 710 int (*ioctl)(struct net_device *, struct ifreq *, int);
711 struct ifreq ifr; 711 struct ifreq ifr;
712 struct mii_ioctl_data *mii; 712 struct mii_ioctl_data *mii;
713 713
diff --git a/drivers/net/cnic.c b/drivers/net/cnic.c
index 333b1d1e7435..cfc6b208631a 100644
--- a/drivers/net/cnic.c
+++ b/drivers/net/cnic.c
@@ -3560,9 +3560,9 @@ static void cnic_init_bnx2_rx_ring(struct cnic_dev *dev)
3560 cnic_ctx_wr(dev, cid_addr, BNX2_L2CTX_CTX_TYPE, val); 3560 cnic_ctx_wr(dev, cid_addr, BNX2_L2CTX_CTX_TYPE, val);
3561 3561
3562 if (sb_id == 0) 3562 if (sb_id == 0)
3563 val = 2 << BNX2_L2CTX_STATUSB_NUM_SHIFT; 3563 val = 2 << BNX2_L2CTX_L2_STATUSB_NUM_SHIFT;
3564 else 3564 else
3565 val = BNX2_L2CTX_STATUSB_NUM(sb_id); 3565 val = BNX2_L2CTX_L2_STATUSB_NUM(sb_id);
3566 cnic_ctx_wr(dev, cid_addr, BNX2_L2CTX_HOST_BDIDX, val); 3566 cnic_ctx_wr(dev, cid_addr, BNX2_L2CTX_HOST_BDIDX, val);
3567 3567
3568 rxbd = (struct rx_bd *) (cp->l2_ring + BCM_PAGE_SIZE); 3568 rxbd = (struct rx_bd *) (cp->l2_ring + BCM_PAGE_SIZE);
@@ -3719,7 +3719,7 @@ static int cnic_start_bnx2_hw(struct cnic_dev *dev)
3719 cp->int_num = 0; 3719 cp->int_num = 0;
3720 if (ethdev->drv_state & CNIC_DRV_STATE_USING_MSIX) { 3720 if (ethdev->drv_state & CNIC_DRV_STATE_USING_MSIX) {
3721 u32 sb_id = cp->status_blk_num; 3721 u32 sb_id = cp->status_blk_num;
3722 u32 sb = BNX2_L2CTX_STATUSB_NUM(sb_id); 3722 u32 sb = BNX2_L2CTX_L5_STATUSB_NUM(sb_id);
3723 3723
3724 cp->int_num = sb_id << BNX2_PCICFG_INT_ACK_CMD_INT_NUM_SHIFT; 3724 cp->int_num = sb_id << BNX2_PCICFG_INT_ACK_CMD_INT_NUM_SHIFT;
3725 cnic_ctx_wr(dev, cp->kwq_cid_addr, L5_KRNLQ_HOST_QIDX, sb); 3725 cnic_ctx_wr(dev, cp->kwq_cid_addr, L5_KRNLQ_HOST_QIDX, sb);
diff --git a/drivers/net/qlge/qlge.h b/drivers/net/qlge/qlge.h
index 4b954e13c007..73c7fd2badcd 100644
--- a/drivers/net/qlge/qlge.h
+++ b/drivers/net/qlge/qlge.h
@@ -97,6 +97,7 @@ enum {
97 97
98 /* Misc. stuff */ 98 /* Misc. stuff */
99 MAILBOX_COUNT = 16, 99 MAILBOX_COUNT = 16,
100 MAILBOX_TIMEOUT = 5,
100 101
101 PROC_ADDR_RDY = (1 << 31), 102 PROC_ADDR_RDY = (1 << 31),
102 PROC_ADDR_R = (1 << 30), 103 PROC_ADDR_R = (1 << 30),
diff --git a/drivers/net/qlge/qlge_main.c b/drivers/net/qlge/qlge_main.c
index dd0ea0277550..42ad811ec313 100644
--- a/drivers/net/qlge/qlge_main.c
+++ b/drivers/net/qlge/qlge_main.c
@@ -4101,6 +4101,7 @@ static int __devinit ql_init_device(struct pci_dev *pdev,
4101 goto err_out; 4101 goto err_out;
4102 } 4102 }
4103 4103
4104 pci_save_state(pdev);
4104 qdev->reg_base = 4105 qdev->reg_base =
4105 ioremap_nocache(pci_resource_start(pdev, 1), 4106 ioremap_nocache(pci_resource_start(pdev, 1),
4106 pci_resource_len(pdev, 1)); 4107 pci_resource_len(pdev, 1));
@@ -4255,6 +4256,33 @@ static void __devexit qlge_remove(struct pci_dev *pdev)
4255 free_netdev(ndev); 4256 free_netdev(ndev);
4256} 4257}
4257 4258
4259/* Clean up resources without touching hardware. */
4260static void ql_eeh_close(struct net_device *ndev)
4261{
4262 int i;
4263 struct ql_adapter *qdev = netdev_priv(ndev);
4264
4265 if (netif_carrier_ok(ndev)) {
4266 netif_carrier_off(ndev);
4267 netif_stop_queue(ndev);
4268 }
4269
4270 if (test_bit(QL_ADAPTER_UP, &qdev->flags))
4271 cancel_delayed_work_sync(&qdev->asic_reset_work);
4272 cancel_delayed_work_sync(&qdev->mpi_reset_work);
4273 cancel_delayed_work_sync(&qdev->mpi_work);
4274 cancel_delayed_work_sync(&qdev->mpi_idc_work);
4275 cancel_delayed_work_sync(&qdev->mpi_port_cfg_work);
4276
4277 for (i = 0; i < qdev->rss_ring_count; i++)
4278 netif_napi_del(&qdev->rx_ring[i].napi);
4279
4280 clear_bit(QL_ADAPTER_UP, &qdev->flags);
4281 ql_tx_ring_clean(qdev);
4282 ql_free_rx_buffers(qdev);
4283 ql_release_adapter_resources(qdev);
4284}
4285
4258/* 4286/*
4259 * This callback is called by the PCI subsystem whenever 4287 * This callback is called by the PCI subsystem whenever
4260 * a PCI bus error is detected. 4288 * a PCI bus error is detected.
@@ -4263,17 +4291,21 @@ static pci_ers_result_t qlge_io_error_detected(struct pci_dev *pdev,
4263 enum pci_channel_state state) 4291 enum pci_channel_state state)
4264{ 4292{
4265 struct net_device *ndev = pci_get_drvdata(pdev); 4293 struct net_device *ndev = pci_get_drvdata(pdev);
4266 struct ql_adapter *qdev = netdev_priv(ndev);
4267
4268 netif_device_detach(ndev);
4269 4294
4270 if (state == pci_channel_io_perm_failure) 4295 switch (state) {
4296 case pci_channel_io_normal:
4297 return PCI_ERS_RESULT_CAN_RECOVER;
4298 case pci_channel_io_frozen:
4299 netif_device_detach(ndev);
4300 if (netif_running(ndev))
4301 ql_eeh_close(ndev);
4302 pci_disable_device(pdev);
4303 return PCI_ERS_RESULT_NEED_RESET;
4304 case pci_channel_io_perm_failure:
4305 dev_err(&pdev->dev,
4306 "%s: pci_channel_io_perm_failure.\n", __func__);
4271 return PCI_ERS_RESULT_DISCONNECT; 4307 return PCI_ERS_RESULT_DISCONNECT;
4272 4308 }
4273 if (netif_running(ndev))
4274 ql_adapter_down(qdev);
4275
4276 pci_disable_device(pdev);
4277 4309
4278 /* Request a slot reset. */ 4310 /* Request a slot reset. */
4279 return PCI_ERS_RESULT_NEED_RESET; 4311 return PCI_ERS_RESULT_NEED_RESET;
@@ -4290,25 +4322,15 @@ static pci_ers_result_t qlge_io_slot_reset(struct pci_dev *pdev)
4290 struct net_device *ndev = pci_get_drvdata(pdev); 4322 struct net_device *ndev = pci_get_drvdata(pdev);
4291 struct ql_adapter *qdev = netdev_priv(ndev); 4323 struct ql_adapter *qdev = netdev_priv(ndev);
4292 4324
4325 pdev->error_state = pci_channel_io_normal;
4326
4327 pci_restore_state(pdev);
4293 if (pci_enable_device(pdev)) { 4328 if (pci_enable_device(pdev)) {
4294 QPRINTK(qdev, IFUP, ERR, 4329 QPRINTK(qdev, IFUP, ERR,
4295 "Cannot re-enable PCI device after reset.\n"); 4330 "Cannot re-enable PCI device after reset.\n");
4296 return PCI_ERS_RESULT_DISCONNECT; 4331 return PCI_ERS_RESULT_DISCONNECT;
4297 } 4332 }
4298
4299 pci_set_master(pdev); 4333 pci_set_master(pdev);
4300
4301 netif_carrier_off(ndev);
4302 ql_adapter_reset(qdev);
4303
4304 /* Make sure the EEPROM is good */
4305 memcpy(ndev->perm_addr, ndev->dev_addr, ndev->addr_len);
4306
4307 if (!is_valid_ether_addr(ndev->perm_addr)) {
4308 QPRINTK(qdev, IFUP, ERR, "After reset, invalid MAC address.\n");
4309 return PCI_ERS_RESULT_DISCONNECT;
4310 }
4311
4312 return PCI_ERS_RESULT_RECOVERED; 4334 return PCI_ERS_RESULT_RECOVERED;
4313} 4335}
4314 4336
@@ -4316,17 +4338,21 @@ static void qlge_io_resume(struct pci_dev *pdev)
4316{ 4338{
4317 struct net_device *ndev = pci_get_drvdata(pdev); 4339 struct net_device *ndev = pci_get_drvdata(pdev);
4318 struct ql_adapter *qdev = netdev_priv(ndev); 4340 struct ql_adapter *qdev = netdev_priv(ndev);
4341 int err = 0;
4319 4342
4320 pci_set_master(pdev); 4343 if (ql_adapter_reset(qdev))
4321 4344 QPRINTK(qdev, DRV, ERR, "reset FAILED!\n");
4322 if (netif_running(ndev)) { 4345 if (netif_running(ndev)) {
4323 if (ql_adapter_up(qdev)) { 4346 err = qlge_open(ndev);
4347 if (err) {
4324 QPRINTK(qdev, IFUP, ERR, 4348 QPRINTK(qdev, IFUP, ERR,
4325 "Device initialization failed after reset.\n"); 4349 "Device initialization failed after reset.\n");
4326 return; 4350 return;
4327 } 4351 }
4352 } else {
4353 QPRINTK(qdev, IFUP, ERR,
4354 "Device was not running prior to EEH.\n");
4328 } 4355 }
4329
4330 netif_device_attach(ndev); 4356 netif_device_attach(ndev);
4331} 4357}
4332 4358
diff --git a/drivers/net/qlge/qlge_mpi.c b/drivers/net/qlge/qlge_mpi.c
index 80b68539c5aa..bac7b86f2129 100644
--- a/drivers/net/qlge/qlge_mpi.c
+++ b/drivers/net/qlge/qlge_mpi.c
@@ -454,7 +454,8 @@ end:
454 */ 454 */
455static int ql_mailbox_command(struct ql_adapter *qdev, struct mbox_params *mbcp) 455static int ql_mailbox_command(struct ql_adapter *qdev, struct mbox_params *mbcp)
456{ 456{
457 int status, count; 457 int status;
458 unsigned long count;
458 459
459 460
460 /* Begin polled mode for MPI */ 461 /* Begin polled mode for MPI */
@@ -475,9 +476,9 @@ static int ql_mailbox_command(struct ql_adapter *qdev, struct mbox_params *mbcp)
475 /* Wait for the command to complete. We loop 476 /* Wait for the command to complete. We loop
476 * here because some AEN might arrive while 477 * here because some AEN might arrive while
477 * we're waiting for the mailbox command to 478 * we're waiting for the mailbox command to
478 * complete. If more than 5 arrive then we can 479 * complete. If more than 5 seconds expire we can
479 * assume something is wrong. */ 480 * assume something is wrong. */
480 count = 5; 481 count = jiffies + HZ * MAILBOX_TIMEOUT;
481 do { 482 do {
482 /* Wait for the interrupt to come in. */ 483 /* Wait for the interrupt to come in. */
483 status = ql_wait_mbx_cmd_cmplt(qdev); 484 status = ql_wait_mbx_cmd_cmplt(qdev);
@@ -501,15 +502,15 @@ static int ql_mailbox_command(struct ql_adapter *qdev, struct mbox_params *mbcp)
501 MB_CMD_STS_GOOD) || 502 MB_CMD_STS_GOOD) ||
502 ((mbcp->mbox_out[0] & 0x0000f000) == 503 ((mbcp->mbox_out[0] & 0x0000f000) ==
503 MB_CMD_STS_INTRMDT)) 504 MB_CMD_STS_INTRMDT))
504 break; 505 goto done;
505 } while (--count); 506 } while (time_before(jiffies, count));
506 507
507 if (!count) { 508 QPRINTK(qdev, DRV, ERR,
508 QPRINTK(qdev, DRV, ERR, 509 "Timed out waiting for mailbox complete.\n");
509 "Timed out waiting for mailbox complete.\n"); 510 status = -ETIMEDOUT;
510 status = -ETIMEDOUT; 511 goto end;
511 goto end; 512
512 } 513done:
513 514
514 /* Now we can clear the interrupt condition 515 /* Now we can clear the interrupt condition
515 * and look at our status. 516 * and look at our status.
diff --git a/drivers/net/sfc/rx.c b/drivers/net/sfc/rx.c
index ea59ed25b0d8..4b65c626a457 100644
--- a/drivers/net/sfc/rx.c
+++ b/drivers/net/sfc/rx.c
@@ -441,7 +441,8 @@ static void efx_rx_packet__check_len(struct efx_rx_queue *rx_queue,
441 * the appropriate LRO method 441 * the appropriate LRO method
442 */ 442 */
443static void efx_rx_packet_lro(struct efx_channel *channel, 443static void efx_rx_packet_lro(struct efx_channel *channel,
444 struct efx_rx_buffer *rx_buf) 444 struct efx_rx_buffer *rx_buf,
445 bool checksummed)
445{ 446{
446 struct napi_struct *napi = &channel->napi_str; 447 struct napi_struct *napi = &channel->napi_str;
447 448
@@ -463,7 +464,8 @@ static void efx_rx_packet_lro(struct efx_channel *channel,
463 skb->len = rx_buf->len; 464 skb->len = rx_buf->len;
464 skb->data_len = rx_buf->len; 465 skb->data_len = rx_buf->len;
465 skb->truesize += rx_buf->len; 466 skb->truesize += rx_buf->len;
466 skb->ip_summed = CHECKSUM_UNNECESSARY; 467 skb->ip_summed =
468 checksummed ? CHECKSUM_UNNECESSARY : CHECKSUM_NONE;
467 469
468 napi_gro_frags(napi); 470 napi_gro_frags(napi);
469 471
@@ -472,6 +474,7 @@ out:
472 rx_buf->page = NULL; 474 rx_buf->page = NULL;
473 } else { 475 } else {
474 EFX_BUG_ON_PARANOID(!rx_buf->skb); 476 EFX_BUG_ON_PARANOID(!rx_buf->skb);
477 EFX_BUG_ON_PARANOID(!checksummed);
475 478
476 napi_gro_receive(napi, rx_buf->skb); 479 napi_gro_receive(napi, rx_buf->skb);
477 rx_buf->skb = NULL; 480 rx_buf->skb = NULL;
@@ -567,7 +570,7 @@ void __efx_rx_packet(struct efx_channel *channel,
567 } 570 }
568 571
569 if (likely(checksummed || rx_buf->page)) { 572 if (likely(checksummed || rx_buf->page)) {
570 efx_rx_packet_lro(channel, rx_buf); 573 efx_rx_packet_lro(channel, rx_buf, checksummed);
571 goto done; 574 goto done;
572 } 575 }
573 576
diff --git a/drivers/net/usb/dm9601.c b/drivers/net/usb/dm9601.c
index 72470f77f556..a2b30a10064f 100644
--- a/drivers/net/usb/dm9601.c
+++ b/drivers/net/usb/dm9601.c
@@ -649,6 +649,10 @@ static const struct usb_device_id products[] = {
649 USB_DEVICE(0x0fe6, 0x8101), /* DM9601 USB to Fast Ethernet Adapter */ 649 USB_DEVICE(0x0fe6, 0x8101), /* DM9601 USB to Fast Ethernet Adapter */
650 .driver_info = (unsigned long)&dm9601_info, 650 .driver_info = (unsigned long)&dm9601_info,
651 }, 651 },
652 {
653 USB_DEVICE(0x0a46, 0x9000), /* DM9000E */
654 .driver_info = (unsigned long)&dm9601_info,
655 },
652 {}, // END 656 {}, // END
653}; 657};
654 658
diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c
index e78486504d3a..95274678fe45 100644
--- a/drivers/net/virtio_net.c
+++ b/drivers/net/virtio_net.c
@@ -514,8 +514,7 @@ again:
514 /* Free up any pending old buffers before queueing new ones. */ 514 /* Free up any pending old buffers before queueing new ones. */
515 free_old_xmit_skbs(vi); 515 free_old_xmit_skbs(vi);
516 516
517 /* Put new one in send queue and do transmit */ 517 /* Try to transmit */
518 __skb_queue_head(&vi->send, skb);
519 capacity = xmit_skb(vi, skb); 518 capacity = xmit_skb(vi, skb);
520 519
521 /* This can happen with OOM and indirect buffers. */ 520 /* This can happen with OOM and indirect buffers. */
@@ -529,8 +528,17 @@ again:
529 } 528 }
530 return NETDEV_TX_BUSY; 529 return NETDEV_TX_BUSY;
531 } 530 }
532
533 vi->svq->vq_ops->kick(vi->svq); 531 vi->svq->vq_ops->kick(vi->svq);
532
533 /*
534 * Put new one in send queue. You'd expect we'd need this before
535 * xmit_skb calls add_buf(), since the callback can be triggered
536 * immediately after that. But since the callback just triggers
537 * another call back here, normal network xmit locking prevents the
538 * race.
539 */
540 __skb_queue_head(&vi->send, skb);
541
534 /* Don't wait up for transmitted skbs to be freed. */ 542 /* Don't wait up for transmitted skbs to be freed. */
535 skb_orphan(skb); 543 skb_orphan(skb);
536 nf_reset(skb); 544 nf_reset(skb);
diff --git a/drivers/net/wireless/airo.c b/drivers/net/wireless/airo.c
index e265ba14054b..4eec87c3be2b 100644
--- a/drivers/net/wireless/airo.c
+++ b/drivers/net/wireless/airo.c
@@ -4790,9 +4790,8 @@ static int proc_stats_rid_open( struct inode *inode,
4790static int get_dec_u16( char *buffer, int *start, int limit ) { 4790static int get_dec_u16( char *buffer, int *start, int limit ) {
4791 u16 value; 4791 u16 value;
4792 int valid = 0; 4792 int valid = 0;
4793 for( value = 0; buffer[*start] >= '0' && 4793 for (value = 0; *start < limit && buffer[*start] >= '0' &&
4794 buffer[*start] <= '9' && 4794 buffer[*start] <= '9'; (*start)++) {
4795 *start < limit; (*start)++ ) {
4796 valid = 1; 4795 valid = 1;
4797 value *= 10; 4796 value *= 10;
4798 value += buffer[*start] - '0'; 4797 value += buffer[*start] - '0';
diff --git a/drivers/net/wireless/b43/leds.h b/drivers/net/wireless/b43/leds.h
index 4c56187810fc..32b66d53cdac 100644
--- a/drivers/net/wireless/b43/leds.h
+++ b/drivers/net/wireless/b43/leds.h
@@ -1,6 +1,7 @@
1#ifndef B43_LEDS_H_ 1#ifndef B43_LEDS_H_
2#define B43_LEDS_H_ 2#define B43_LEDS_H_
3 3
4struct b43_wl;
4struct b43_wldev; 5struct b43_wldev;
5 6
6#ifdef CONFIG_B43_LEDS 7#ifdef CONFIG_B43_LEDS
diff --git a/drivers/net/wireless/b43/main.c b/drivers/net/wireless/b43/main.c
index 751017b4c3d3..ed6e96a34743 100644
--- a/drivers/net/wireless/b43/main.c
+++ b/drivers/net/wireless/b43/main.c
@@ -4501,7 +4501,6 @@ static void b43_op_stop(struct ieee80211_hw *hw)
4501 4501
4502 cancel_work_sync(&(wl->beacon_update_trigger)); 4502 cancel_work_sync(&(wl->beacon_update_trigger));
4503 4503
4504 wiphy_rfkill_stop_polling(hw->wiphy);
4505 mutex_lock(&wl->mutex); 4504 mutex_lock(&wl->mutex);
4506 if (b43_status(dev) >= B43_STAT_STARTED) { 4505 if (b43_status(dev) >= B43_STAT_STARTED) {
4507 dev = b43_wireless_core_stop(dev); 4506 dev = b43_wireless_core_stop(dev);
diff --git a/drivers/net/wireless/b43/rfkill.c b/drivers/net/wireless/b43/rfkill.c
index 7a3218c5ba7d..ffdce6f3c909 100644
--- a/drivers/net/wireless/b43/rfkill.c
+++ b/drivers/net/wireless/b43/rfkill.c
@@ -33,7 +33,8 @@ bool b43_is_hw_radio_enabled(struct b43_wldev *dev)
33 & B43_MMIO_RADIO_HWENABLED_HI_MASK)) 33 & B43_MMIO_RADIO_HWENABLED_HI_MASK))
34 return 1; 34 return 1;
35 } else { 35 } else {
36 if (b43_read16(dev, B43_MMIO_RADIO_HWENABLED_LO) 36 if (b43_status(dev) >= B43_STAT_STARTED &&
37 b43_read16(dev, B43_MMIO_RADIO_HWENABLED_LO)
37 & B43_MMIO_RADIO_HWENABLED_LO_MASK) 38 & B43_MMIO_RADIO_HWENABLED_LO_MASK)
38 return 1; 39 return 1;
39 } 40 }
diff --git a/drivers/net/wireless/libertas/if_spi.c b/drivers/net/wireless/libertas/if_spi.c
index 06df2e174b50..30d9d0ea28eb 100644
--- a/drivers/net/wireless/libertas/if_spi.c
+++ b/drivers/net/wireless/libertas/if_spi.c
@@ -134,7 +134,7 @@ static void spu_transaction_finish(struct if_spi_card *card)
134static int spu_write(struct if_spi_card *card, u16 reg, const u8 *buf, int len) 134static int spu_write(struct if_spi_card *card, u16 reg, const u8 *buf, int len)
135{ 135{
136 int err = 0; 136 int err = 0;
137 u16 reg_out = cpu_to_le16(reg | IF_SPI_WRITE_OPERATION_MASK); 137 __le16 reg_out = cpu_to_le16(reg | IF_SPI_WRITE_OPERATION_MASK);
138 struct spi_message m; 138 struct spi_message m;
139 struct spi_transfer reg_trans; 139 struct spi_transfer reg_trans;
140 struct spi_transfer data_trans; 140 struct spi_transfer data_trans;
@@ -166,7 +166,7 @@ static int spu_write(struct if_spi_card *card, u16 reg, const u8 *buf, int len)
166 166
167static inline int spu_write_u16(struct if_spi_card *card, u16 reg, u16 val) 167static inline int spu_write_u16(struct if_spi_card *card, u16 reg, u16 val)
168{ 168{
169 u16 buff; 169 __le16 buff;
170 170
171 buff = cpu_to_le16(val); 171 buff = cpu_to_le16(val);
172 return spu_write(card, reg, (u8 *)&buff, sizeof(u16)); 172 return spu_write(card, reg, (u8 *)&buff, sizeof(u16));
@@ -188,7 +188,7 @@ static int spu_read(struct if_spi_card *card, u16 reg, u8 *buf, int len)
188{ 188{
189 unsigned int delay; 189 unsigned int delay;
190 int err = 0; 190 int err = 0;
191 u16 reg_out = cpu_to_le16(reg | IF_SPI_READ_OPERATION_MASK); 191 __le16 reg_out = cpu_to_le16(reg | IF_SPI_READ_OPERATION_MASK);
192 struct spi_message m; 192 struct spi_message m;
193 struct spi_transfer reg_trans; 193 struct spi_transfer reg_trans;
194 struct spi_transfer dummy_trans; 194 struct spi_transfer dummy_trans;
@@ -235,7 +235,7 @@ static int spu_read(struct if_spi_card *card, u16 reg, u8 *buf, int len)
235/* Read 16 bits from an SPI register */ 235/* Read 16 bits from an SPI register */
236static inline int spu_read_u16(struct if_spi_card *card, u16 reg, u16 *val) 236static inline int spu_read_u16(struct if_spi_card *card, u16 reg, u16 *val)
237{ 237{
238 u16 buf; 238 __le16 buf;
239 int ret; 239 int ret;
240 240
241 ret = spu_read(card, reg, (u8 *)&buf, sizeof(buf)); 241 ret = spu_read(card, reg, (u8 *)&buf, sizeof(buf));
@@ -248,7 +248,7 @@ static inline int spu_read_u16(struct if_spi_card *card, u16 reg, u16 *val)
248 * The low 16 bits are read first. */ 248 * The low 16 bits are read first. */
249static int spu_read_u32(struct if_spi_card *card, u16 reg, u32 *val) 249static int spu_read_u32(struct if_spi_card *card, u16 reg, u32 *val)
250{ 250{
251 u32 buf; 251 __le32 buf;
252 int err; 252 int err;
253 253
254 err = spu_read(card, reg, (u8 *)&buf, sizeof(buf)); 254 err = spu_read(card, reg, (u8 *)&buf, sizeof(buf));
diff --git a/drivers/net/wireless/rt2x00/rt2800usb.c b/drivers/net/wireless/rt2x00/rt2800usb.c
index a084077a1c61..9fe770f7d7bb 100644
--- a/drivers/net/wireless/rt2x00/rt2800usb.c
+++ b/drivers/net/wireless/rt2x00/rt2800usb.c
@@ -1994,7 +1994,7 @@ static void rt2800usb_write_tx_desc(struct rt2x00_dev *rt2x00dev,
1994 rt2x00_set_field32(&word, TXWI_W1_BW_WIN_SIZE, txdesc->ba_size); 1994 rt2x00_set_field32(&word, TXWI_W1_BW_WIN_SIZE, txdesc->ba_size);
1995 rt2x00_set_field32(&word, TXWI_W1_WIRELESS_CLI_ID, 1995 rt2x00_set_field32(&word, TXWI_W1_WIRELESS_CLI_ID,
1996 test_bit(ENTRY_TXD_ENCRYPT, &txdesc->flags) ? 1996 test_bit(ENTRY_TXD_ENCRYPT, &txdesc->flags) ?
1997 (skbdesc->entry->entry_idx + 1) : 0xff); 1997 txdesc->key_idx : 0xff);
1998 rt2x00_set_field32(&word, TXWI_W1_MPDU_TOTAL_BYTE_COUNT, 1998 rt2x00_set_field32(&word, TXWI_W1_MPDU_TOTAL_BYTE_COUNT,
1999 skb->len - txdesc->l2pad); 1999 skb->len - txdesc->l2pad);
2000 rt2x00_set_field32(&word, TXWI_W1_PACKETID, 2000 rt2x00_set_field32(&word, TXWI_W1_PACKETID,
diff --git a/net/ipv4/raw.c b/net/ipv4/raw.c
index 9ef8c0829a77..ce154b47f1da 100644
--- a/net/ipv4/raw.c
+++ b/net/ipv4/raw.c
@@ -351,13 +351,24 @@ static int raw_send_hdrinc(struct sock *sk, void *from, size_t length,
351 skb->ip_summed = CHECKSUM_NONE; 351 skb->ip_summed = CHECKSUM_NONE;
352 352
353 skb->transport_header = skb->network_header; 353 skb->transport_header = skb->network_header;
354 err = memcpy_fromiovecend((void *)iph, from, 0, length); 354 err = -EFAULT;
355 if (err) 355 if (memcpy_fromiovecend((void *)iph, from, 0, length))
356 goto error_fault; 356 goto error_free;
357 357
358 /* We don't modify invalid header */
359 iphlen = iph->ihl * 4; 358 iphlen = iph->ihl * 4;
360 if (iphlen >= sizeof(*iph) && iphlen <= length) { 359
360 /*
361 * We don't want to modify the ip header, but we do need to
362 * be sure that it won't cause problems later along the network
363 * stack. Specifically we want to make sure that iph->ihl is a
364 * sane value. If ihl points beyond the length of the buffer passed
365 * in, reject the frame as invalid
366 */
367 err = -EINVAL;
368 if (iphlen > length)
369 goto error_free;
370
371 if (iphlen >= sizeof(*iph)) {
361 if (!iph->saddr) 372 if (!iph->saddr)
362 iph->saddr = rt->rt_src; 373 iph->saddr = rt->rt_src;
363 iph->check = 0; 374 iph->check = 0;
@@ -380,8 +391,7 @@ static int raw_send_hdrinc(struct sock *sk, void *from, size_t length,
380out: 391out:
381 return 0; 392 return 0;
382 393
383error_fault: 394error_free:
384 err = -EFAULT;
385 kfree_skb(skb); 395 kfree_skb(skb);
386error: 396error:
387 IP_INC_STATS(net, IPSTATS_MIB_OUTDISCARDS); 397 IP_INC_STATS(net, IPSTATS_MIB_OUTDISCARDS);
diff --git a/net/mac80211/ibss.c b/net/mac80211/ibss.c
index 6eaf69823439..ca8ecce31d34 100644
--- a/net/mac80211/ibss.c
+++ b/net/mac80211/ibss.c
@@ -538,13 +538,12 @@ static void ieee80211_sta_find_ibss(struct ieee80211_sub_if_data *sdata)
538 WLAN_CAPABILITY_PRIVACY, 538 WLAN_CAPABILITY_PRIVACY,
539 capability); 539 capability);
540 540
541 if (bss) {
541#ifdef CONFIG_MAC80211_IBSS_DEBUG 542#ifdef CONFIG_MAC80211_IBSS_DEBUG
542 if (bss)
543 printk(KERN_DEBUG " sta_find_ibss: selected %pM current " 543 printk(KERN_DEBUG " sta_find_ibss: selected %pM current "
544 "%pM\n", bss->cbss.bssid, ifibss->bssid); 544 "%pM\n", bss->cbss.bssid, ifibss->bssid);
545#endif /* CONFIG_MAC80211_IBSS_DEBUG */ 545#endif /* CONFIG_MAC80211_IBSS_DEBUG */
546 546
547 if (bss && !memcmp(ifibss->bssid, bss->cbss.bssid, ETH_ALEN)) {
548 printk(KERN_DEBUG "%s: Selected IBSS BSSID %pM" 547 printk(KERN_DEBUG "%s: Selected IBSS BSSID %pM"
549 " based on configured SSID\n", 548 " based on configured SSID\n",
550 sdata->dev->name, bss->cbss.bssid); 549 sdata->dev->name, bss->cbss.bssid);
@@ -552,8 +551,7 @@ static void ieee80211_sta_find_ibss(struct ieee80211_sub_if_data *sdata)
552 ieee80211_sta_join_ibss(sdata, bss); 551 ieee80211_sta_join_ibss(sdata, bss);
553 ieee80211_rx_bss_put(local, bss); 552 ieee80211_rx_bss_put(local, bss);
554 return; 553 return;
555 } else if (bss) 554 }
556 ieee80211_rx_bss_put(local, bss);
557 555
558#ifdef CONFIG_MAC80211_IBSS_DEBUG 556#ifdef CONFIG_MAC80211_IBSS_DEBUG
559 printk(KERN_DEBUG " did not try to join ibss\n"); 557 printk(KERN_DEBUG " did not try to join ibss\n");
diff --git a/net/mac80211/mesh_hwmp.c b/net/mac80211/mesh_hwmp.c
index e12a786e26b8..29b82e98effa 100644
--- a/net/mac80211/mesh_hwmp.c
+++ b/net/mac80211/mesh_hwmp.c
@@ -259,7 +259,7 @@ static u32 airtime_link_metric_get(struct ieee80211_local *local,
259 * @hwmp_ie: hwmp information element (PREP or PREQ) 259 * @hwmp_ie: hwmp information element (PREP or PREQ)
260 * 260 *
261 * This function updates the path routing information to the originator and the 261 * This function updates the path routing information to the originator and the
262 * transmitter of a HWMP PREQ or PREP fram. 262 * transmitter of a HWMP PREQ or PREP frame.
263 * 263 *
264 * Returns: metric to frame originator or 0 if the frame should not be further 264 * Returns: metric to frame originator or 0 if the frame should not be further
265 * processed 265 * processed
diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c
index 71220a5d1406..dcc14e99227c 100644
--- a/net/mac80211/mlme.c
+++ b/net/mac80211/mlme.c
@@ -1463,8 +1463,7 @@ ieee80211_rx_mgmt_assoc_resp(struct ieee80211_sub_if_data *sdata,
1463 if (status_code != WLAN_STATUS_SUCCESS) { 1463 if (status_code != WLAN_STATUS_SUCCESS) {
1464 printk(KERN_DEBUG "%s: AP denied association (code=%d)\n", 1464 printk(KERN_DEBUG "%s: AP denied association (code=%d)\n",
1465 sdata->dev->name, status_code); 1465 sdata->dev->name, status_code);
1466 list_del(&wk->list); 1466 wk->state = IEEE80211_MGD_STATE_IDLE;
1467 kfree(wk);
1468 return RX_MGMT_CFG80211_ASSOC; 1467 return RX_MGMT_CFG80211_ASSOC;
1469 } 1468 }
1470 1469
diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c
index db4bda681ec9..eaa4118de988 100644
--- a/net/mac80211/tx.c
+++ b/net/mac80211/tx.c
@@ -1445,7 +1445,7 @@ static void ieee80211_xmit(struct ieee80211_sub_if_data *sdata,
1445 if (tmp_sdata->vif.type != NL80211_IFTYPE_AP) 1445 if (tmp_sdata->vif.type != NL80211_IFTYPE_AP)
1446 continue; 1446 continue;
1447 if (compare_ether_addr(tmp_sdata->dev->dev_addr, 1447 if (compare_ether_addr(tmp_sdata->dev->dev_addr,
1448 hdr->addr2)) { 1448 hdr->addr2) == 0) {
1449 dev_hold(tmp_sdata->dev); 1449 dev_hold(tmp_sdata->dev);
1450 dev_put(sdata->dev); 1450 dev_put(sdata->dev);
1451 sdata = tmp_sdata; 1451 sdata = tmp_sdata;
diff --git a/net/packet/af_packet.c b/net/packet/af_packet.c
index 33e68f20ec61..95ef64e4189a 100644
--- a/net/packet/af_packet.c
+++ b/net/packet/af_packet.c
@@ -984,10 +984,7 @@ static int tpacket_snd(struct packet_sock *po, struct msghdr *msg)
984 goto out_put; 984 goto out_put;
985 985
986 size_max = po->tx_ring.frame_size 986 size_max = po->tx_ring.frame_size
987 - sizeof(struct skb_shared_info) 987 - (po->tp_hdrlen - sizeof(struct sockaddr_ll));
988 - po->tp_hdrlen
989 - LL_ALLOCATED_SPACE(dev)
990 - sizeof(struct sockaddr_ll);
991 988
992 if (size_max > dev->mtu + reserve) 989 if (size_max > dev->mtu + reserve)
993 size_max = dev->mtu + reserve; 990 size_max = dev->mtu + reserve;
diff --git a/net/wireless/core.h b/net/wireless/core.h
index 2a33d8bc886b..68b321997d4c 100644
--- a/net/wireless/core.h
+++ b/net/wireless/core.h
@@ -358,6 +358,7 @@ int cfg80211_mgd_wext_connect(struct cfg80211_registered_device *rdev,
358 struct wireless_dev *wdev); 358 struct wireless_dev *wdev);
359 359
360void cfg80211_conn_work(struct work_struct *work); 360void cfg80211_conn_work(struct work_struct *work);
361void cfg80211_sme_failed_assoc(struct wireless_dev *wdev);
361bool cfg80211_sme_failed_reassoc(struct wireless_dev *wdev); 362bool cfg80211_sme_failed_reassoc(struct wireless_dev *wdev);
362 363
363/* internal helpers */ 364/* internal helpers */
diff --git a/net/wireless/mlme.c b/net/wireless/mlme.c
index 1f87b4e7f4f7..83c2a288dc63 100644
--- a/net/wireless/mlme.c
+++ b/net/wireless/mlme.c
@@ -62,6 +62,7 @@ void cfg80211_send_rx_assoc(struct net_device *dev, const u8 *buf, size_t len)
62 u8 *ie = mgmt->u.assoc_resp.variable; 62 u8 *ie = mgmt->u.assoc_resp.variable;
63 int i, ieoffs = offsetof(struct ieee80211_mgmt, u.assoc_resp.variable); 63 int i, ieoffs = offsetof(struct ieee80211_mgmt, u.assoc_resp.variable);
64 struct cfg80211_internal_bss *bss = NULL; 64 struct cfg80211_internal_bss *bss = NULL;
65 bool need_connect_result = true;
65 66
66 wdev_lock(wdev); 67 wdev_lock(wdev);
67 68
@@ -94,6 +95,14 @@ void cfg80211_send_rx_assoc(struct net_device *dev, const u8 *buf, size_t len)
94 } 95 }
95 96
96 WARN_ON(!bss); 97 WARN_ON(!bss);
98 } else if (wdev->conn) {
99 cfg80211_sme_failed_assoc(wdev);
100 need_connect_result = false;
101 /*
102 * do not call connect_result() now because the
103 * sme will schedule work that does it later.
104 */
105 goto out;
97 } 106 }
98 107
99 if (!wdev->conn && wdev->sme_state == CFG80211_SME_IDLE) { 108 if (!wdev->conn && wdev->sme_state == CFG80211_SME_IDLE) {
diff --git a/net/wireless/sme.c b/net/wireless/sme.c
index d3624152f7f7..98a3b7efac4c 100644
--- a/net/wireless/sme.c
+++ b/net/wireless/sme.c
@@ -26,6 +26,7 @@ struct cfg80211_conn {
26 CFG80211_CONN_AUTHENTICATING, 26 CFG80211_CONN_AUTHENTICATING,
27 CFG80211_CONN_ASSOCIATE_NEXT, 27 CFG80211_CONN_ASSOCIATE_NEXT,
28 CFG80211_CONN_ASSOCIATING, 28 CFG80211_CONN_ASSOCIATING,
29 CFG80211_CONN_DEAUTH_ASSOC_FAIL,
29 } state; 30 } state;
30 u8 bssid[ETH_ALEN], prev_bssid[ETH_ALEN]; 31 u8 bssid[ETH_ALEN], prev_bssid[ETH_ALEN];
31 u8 *ie; 32 u8 *ie;
@@ -148,6 +149,12 @@ static int cfg80211_conn_do_work(struct wireless_dev *wdev)
148 NULL, 0, 149 NULL, 0,
149 WLAN_REASON_DEAUTH_LEAVING); 150 WLAN_REASON_DEAUTH_LEAVING);
150 return err; 151 return err;
152 case CFG80211_CONN_DEAUTH_ASSOC_FAIL:
153 __cfg80211_mlme_deauth(rdev, wdev->netdev, params->bssid,
154 NULL, 0,
155 WLAN_REASON_DEAUTH_LEAVING);
156 /* return an error so that we call __cfg80211_connect_result() */
157 return -EINVAL;
151 default: 158 default:
152 return 0; 159 return 0;
153 } 160 }
@@ -158,6 +165,7 @@ void cfg80211_conn_work(struct work_struct *work)
158 struct cfg80211_registered_device *rdev = 165 struct cfg80211_registered_device *rdev =
159 container_of(work, struct cfg80211_registered_device, conn_work); 166 container_of(work, struct cfg80211_registered_device, conn_work);
160 struct wireless_dev *wdev; 167 struct wireless_dev *wdev;
168 u8 bssid[ETH_ALEN];
161 169
162 rtnl_lock(); 170 rtnl_lock();
163 cfg80211_lock_rdev(rdev); 171 cfg80211_lock_rdev(rdev);
@@ -173,10 +181,10 @@ void cfg80211_conn_work(struct work_struct *work)
173 wdev_unlock(wdev); 181 wdev_unlock(wdev);
174 continue; 182 continue;
175 } 183 }
184 memcpy(bssid, wdev->conn->params.bssid, ETH_ALEN);
176 if (cfg80211_conn_do_work(wdev)) 185 if (cfg80211_conn_do_work(wdev))
177 __cfg80211_connect_result( 186 __cfg80211_connect_result(
178 wdev->netdev, 187 wdev->netdev, bssid,
179 wdev->conn->params.bssid,
180 NULL, 0, NULL, 0, 188 NULL, 0, NULL, 0,
181 WLAN_STATUS_UNSPECIFIED_FAILURE, 189 WLAN_STATUS_UNSPECIFIED_FAILURE,
182 false, NULL); 190 false, NULL);
@@ -337,6 +345,15 @@ bool cfg80211_sme_failed_reassoc(struct wireless_dev *wdev)
337 return true; 345 return true;
338} 346}
339 347
348void cfg80211_sme_failed_assoc(struct wireless_dev *wdev)
349{
350 struct wiphy *wiphy = wdev->wiphy;
351 struct cfg80211_registered_device *rdev = wiphy_to_dev(wiphy);
352
353 wdev->conn->state = CFG80211_CONN_DEAUTH_ASSOC_FAIL;
354 schedule_work(&rdev->conn_work);
355}
356
340void __cfg80211_connect_result(struct net_device *dev, const u8 *bssid, 357void __cfg80211_connect_result(struct net_device *dev, const u8 *bssid,
341 const u8 *req_ie, size_t req_ie_len, 358 const u8 *req_ie, size_t req_ie_len,
342 const u8 *resp_ie, size_t resp_ie_len, 359 const u8 *resp_ie, size_t resp_ie_len,