diff options
author | Paul Mackerras <paulus@samba.org> | 2007-12-21 06:21:08 -0500 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2007-12-21 06:21:08 -0500 |
commit | c2a7dcad9f0d92d7a96e735abb8bec7b9c621536 (patch) | |
tree | bf9b20fdd5ab07e5b0e4e0b95c6a3dbab1005cb9 /drivers/net | |
parent | 373a6da165ac3012a74fd072da340eabca55d031 (diff) | |
parent | ea67db4cdbbf7f4e74150e71da0984e25121f500 (diff) |
Merge branch 'linux-2.6'
Diffstat (limited to 'drivers/net')
30 files changed, 211 insertions, 132 deletions
diff --git a/drivers/net/Kconfig b/drivers/net/Kconfig index 6cde4edc846b..d9107e542dfa 100644 --- a/drivers/net/Kconfig +++ b/drivers/net/Kconfig | |||
@@ -2588,7 +2588,6 @@ config MLX4_DEBUG | |||
2588 | config TEHUTI | 2588 | config TEHUTI |
2589 | tristate "Tehuti Networks 10G Ethernet" | 2589 | tristate "Tehuti Networks 10G Ethernet" |
2590 | depends on PCI | 2590 | depends on PCI |
2591 | select ZLIB_INFLATE | ||
2592 | help | 2591 | help |
2593 | Tehuti Networks 10G Ethernet NIC | 2592 | Tehuti Networks 10G Ethernet NIC |
2594 | 2593 | ||
diff --git a/drivers/net/bnx2.c b/drivers/net/bnx2.c index da767d3d5af5..4e7b46e44874 100644 --- a/drivers/net/bnx2.c +++ b/drivers/net/bnx2.c | |||
@@ -56,8 +56,8 @@ | |||
56 | 56 | ||
57 | #define DRV_MODULE_NAME "bnx2" | 57 | #define DRV_MODULE_NAME "bnx2" |
58 | #define PFX DRV_MODULE_NAME ": " | 58 | #define PFX DRV_MODULE_NAME ": " |
59 | #define DRV_MODULE_VERSION "1.6.8" | 59 | #define DRV_MODULE_VERSION "1.6.9" |
60 | #define DRV_MODULE_RELDATE "October 17, 2007" | 60 | #define DRV_MODULE_RELDATE "December 8, 2007" |
61 | 61 | ||
62 | #define RUN_AT(x) (jiffies + (x)) | 62 | #define RUN_AT(x) (jiffies + (x)) |
63 | 63 | ||
@@ -2387,18 +2387,24 @@ bnx2_reuse_rx_skb(struct bnx2 *bp, struct sk_buff *skb, | |||
2387 | prod_bd->rx_bd_haddr_lo = cons_bd->rx_bd_haddr_lo; | 2387 | prod_bd->rx_bd_haddr_lo = cons_bd->rx_bd_haddr_lo; |
2388 | } | 2388 | } |
2389 | 2389 | ||
2390 | static inline u16 | ||
2391 | bnx2_get_hw_rx_cons(struct bnx2 *bp) | ||
2392 | { | ||
2393 | u16 cons = bp->status_blk->status_rx_quick_consumer_index0; | ||
2394 | |||
2395 | if (unlikely((cons & MAX_RX_DESC_CNT) == MAX_RX_DESC_CNT)) | ||
2396 | cons++; | ||
2397 | return cons; | ||
2398 | } | ||
2399 | |||
2390 | static int | 2400 | static int |
2391 | bnx2_rx_int(struct bnx2 *bp, int budget) | 2401 | bnx2_rx_int(struct bnx2 *bp, int budget) |
2392 | { | 2402 | { |
2393 | struct status_block *sblk = bp->status_blk; | ||
2394 | u16 hw_cons, sw_cons, sw_ring_cons, sw_prod, sw_ring_prod; | 2403 | u16 hw_cons, sw_cons, sw_ring_cons, sw_prod, sw_ring_prod; |
2395 | struct l2_fhdr *rx_hdr; | 2404 | struct l2_fhdr *rx_hdr; |
2396 | int rx_pkt = 0; | 2405 | int rx_pkt = 0; |
2397 | 2406 | ||
2398 | hw_cons = bp->hw_rx_cons = sblk->status_rx_quick_consumer_index0; | 2407 | hw_cons = bnx2_get_hw_rx_cons(bp); |
2399 | if ((hw_cons & MAX_RX_DESC_CNT) == MAX_RX_DESC_CNT) { | ||
2400 | hw_cons++; | ||
2401 | } | ||
2402 | sw_cons = bp->rx_cons; | 2408 | sw_cons = bp->rx_cons; |
2403 | sw_prod = bp->rx_prod; | 2409 | sw_prod = bp->rx_prod; |
2404 | 2410 | ||
@@ -2515,10 +2521,7 @@ next_rx: | |||
2515 | 2521 | ||
2516 | /* Refresh hw_cons to see if there is new work */ | 2522 | /* Refresh hw_cons to see if there is new work */ |
2517 | if (sw_cons == hw_cons) { | 2523 | if (sw_cons == hw_cons) { |
2518 | hw_cons = bp->hw_rx_cons = | 2524 | hw_cons = bnx2_get_hw_rx_cons(bp); |
2519 | sblk->status_rx_quick_consumer_index0; | ||
2520 | if ((hw_cons & MAX_RX_DESC_CNT) == MAX_RX_DESC_CNT) | ||
2521 | hw_cons++; | ||
2522 | rmb(); | 2525 | rmb(); |
2523 | } | 2526 | } |
2524 | } | 2527 | } |
@@ -2622,7 +2625,7 @@ bnx2_has_work(struct bnx2 *bp) | |||
2622 | { | 2625 | { |
2623 | struct status_block *sblk = bp->status_blk; | 2626 | struct status_block *sblk = bp->status_blk; |
2624 | 2627 | ||
2625 | if ((sblk->status_rx_quick_consumer_index0 != bp->hw_rx_cons) || | 2628 | if ((bnx2_get_hw_rx_cons(bp) != bp->rx_cons) || |
2626 | (sblk->status_tx_quick_consumer_index0 != bp->hw_tx_cons)) | 2629 | (sblk->status_tx_quick_consumer_index0 != bp->hw_tx_cons)) |
2627 | return 1; | 2630 | return 1; |
2628 | 2631 | ||
@@ -2655,7 +2658,7 @@ static int bnx2_poll_work(struct bnx2 *bp, int work_done, int budget) | |||
2655 | if (sblk->status_tx_quick_consumer_index0 != bp->hw_tx_cons) | 2658 | if (sblk->status_tx_quick_consumer_index0 != bp->hw_tx_cons) |
2656 | bnx2_tx_int(bp); | 2659 | bnx2_tx_int(bp); |
2657 | 2660 | ||
2658 | if (sblk->status_rx_quick_consumer_index0 != bp->hw_rx_cons) | 2661 | if (bnx2_get_hw_rx_cons(bp) != bp->rx_cons) |
2659 | work_done += bnx2_rx_int(bp, budget - work_done); | 2662 | work_done += bnx2_rx_int(bp, budget - work_done); |
2660 | 2663 | ||
2661 | return work_done; | 2664 | return work_done; |
@@ -4177,7 +4180,6 @@ bnx2_init_rx_ring(struct bnx2 *bp) | |||
4177 | 4180 | ||
4178 | ring_prod = prod = bp->rx_prod = 0; | 4181 | ring_prod = prod = bp->rx_prod = 0; |
4179 | bp->rx_cons = 0; | 4182 | bp->rx_cons = 0; |
4180 | bp->hw_rx_cons = 0; | ||
4181 | bp->rx_prod_bseq = 0; | 4183 | bp->rx_prod_bseq = 0; |
4182 | 4184 | ||
4183 | for (i = 0; i < bp->rx_max_ring; i++) { | 4185 | for (i = 0; i < bp->rx_max_ring; i++) { |
@@ -6685,8 +6687,9 @@ bnx2_init_board(struct pci_dev *pdev, struct net_device *dev) | |||
6685 | } else if (CHIP_NUM(bp) == CHIP_NUM_5706 || | 6687 | } else if (CHIP_NUM(bp) == CHIP_NUM_5706 || |
6686 | CHIP_NUM(bp) == CHIP_NUM_5708) | 6688 | CHIP_NUM(bp) == CHIP_NUM_5708) |
6687 | bp->phy_flags |= PHY_CRC_FIX_FLAG; | 6689 | bp->phy_flags |= PHY_CRC_FIX_FLAG; |
6688 | else if (CHIP_ID(bp) == CHIP_ID_5709_A0 || | 6690 | else if (CHIP_NUM(bp) == CHIP_NUM_5709 && |
6689 | CHIP_ID(bp) == CHIP_ID_5709_A1) | 6691 | (CHIP_REV(bp) == CHIP_REV_Ax || |
6692 | CHIP_REV(bp) == CHIP_REV_Bx)) | ||
6690 | bp->phy_flags |= PHY_DIS_EARLY_DAC_FLAG; | 6693 | bp->phy_flags |= PHY_DIS_EARLY_DAC_FLAG; |
6691 | 6694 | ||
6692 | if ((CHIP_ID(bp) == CHIP_ID_5708_A0) || | 6695 | if ((CHIP_ID(bp) == CHIP_ID_5708_A0) || |
diff --git a/drivers/net/bnx2.h b/drivers/net/bnx2.h index 1dce0d1a2581..30ba366608b0 100644 --- a/drivers/net/bnx2.h +++ b/drivers/net/bnx2.h | |||
@@ -6513,7 +6513,6 @@ struct bnx2 { | |||
6513 | u32 rx_prod_bseq; | 6513 | u32 rx_prod_bseq; |
6514 | u16 rx_prod; | 6514 | u16 rx_prod; |
6515 | u16 rx_cons; | 6515 | u16 rx_cons; |
6516 | u16 hw_rx_cons; | ||
6517 | 6516 | ||
6518 | u32 rx_csum; | 6517 | u32 rx_csum; |
6519 | 6518 | ||
diff --git a/drivers/net/e100.c b/drivers/net/e100.c index e1c8a0d023ea..2b06e4b4dabc 100644 --- a/drivers/net/e100.c +++ b/drivers/net/e100.c | |||
@@ -2737,8 +2737,9 @@ static int e100_suspend(struct pci_dev *pdev, pm_message_t state) | |||
2737 | pci_enable_wake(pdev, PCI_D3cold, 0); | 2737 | pci_enable_wake(pdev, PCI_D3cold, 0); |
2738 | } | 2738 | } |
2739 | 2739 | ||
2740 | pci_disable_device(pdev); | ||
2741 | free_irq(pdev->irq, netdev); | 2740 | free_irq(pdev->irq, netdev); |
2741 | |||
2742 | pci_disable_device(pdev); | ||
2742 | pci_set_power_state(pdev, PCI_D3hot); | 2743 | pci_set_power_state(pdev, PCI_D3hot); |
2743 | 2744 | ||
2744 | return 0; | 2745 | return 0; |
@@ -2780,6 +2781,8 @@ static void e100_shutdown(struct pci_dev *pdev) | |||
2780 | pci_enable_wake(pdev, PCI_D3cold, 0); | 2781 | pci_enable_wake(pdev, PCI_D3cold, 0); |
2781 | } | 2782 | } |
2782 | 2783 | ||
2784 | free_irq(pdev->irq, netdev); | ||
2785 | |||
2783 | pci_disable_device(pdev); | 2786 | pci_disable_device(pdev); |
2784 | pci_set_power_state(pdev, PCI_D3hot); | 2787 | pci_set_power_state(pdev, PCI_D3hot); |
2785 | } | 2788 | } |
diff --git a/drivers/net/fs_enet/mac-scc.c b/drivers/net/fs_enet/mac-scc.c index 5ff856d7590b..fe3d8a621c33 100644 --- a/drivers/net/fs_enet/mac-scc.c +++ b/drivers/net/fs_enet/mac-scc.c | |||
@@ -149,7 +149,7 @@ static int setup_data(struct net_device *dev) | |||
149 | { | 149 | { |
150 | struct fs_enet_private *fep = netdev_priv(dev); | 150 | struct fs_enet_private *fep = netdev_priv(dev); |
151 | 151 | ||
152 | #ifdef CONFIG_PPC_CPM_NEW_BINDING | 152 | #ifndef CONFIG_PPC_CPM_NEW_BINDING |
153 | struct fs_platform_info *fpi = fep->fpi; | 153 | struct fs_platform_info *fpi = fep->fpi; |
154 | 154 | ||
155 | fep->scc.idx = fs_get_scc_index(fpi->fs_no); | 155 | fep->scc.idx = fs_get_scc_index(fpi->fs_no); |
diff --git a/drivers/net/hamachi.c b/drivers/net/hamachi.c index ed407c85708f..b53f6b6491b3 100644 --- a/drivers/net/hamachi.c +++ b/drivers/net/hamachi.c | |||
@@ -204,8 +204,10 @@ KERN_INFO " Further modifications by Keith Underwood <keithu@parl.clemson.edu> | |||
204 | /* Condensed bus+endian portability operations. */ | 204 | /* Condensed bus+endian portability operations. */ |
205 | #if ADDRLEN == 64 | 205 | #if ADDRLEN == 64 |
206 | #define cpu_to_leXX(addr) cpu_to_le64(addr) | 206 | #define cpu_to_leXX(addr) cpu_to_le64(addr) |
207 | #define leXX_to_cpu(addr) le64_to_cpu(addr) | ||
207 | #else | 208 | #else |
208 | #define cpu_to_leXX(addr) cpu_to_le32(addr) | 209 | #define cpu_to_leXX(addr) cpu_to_le32(addr) |
210 | #define leXX_to_cpu(addr) le32_to_cpu(addr) | ||
209 | #endif | 211 | #endif |
210 | 212 | ||
211 | 213 | ||
@@ -465,12 +467,12 @@ enum intr_status_bits { | |||
465 | 467 | ||
466 | /* The Hamachi Rx and Tx buffer descriptors. */ | 468 | /* The Hamachi Rx and Tx buffer descriptors. */ |
467 | struct hamachi_desc { | 469 | struct hamachi_desc { |
468 | u32 status_n_length; | 470 | __le32 status_n_length; |
469 | #if ADDRLEN == 64 | 471 | #if ADDRLEN == 64 |
470 | u32 pad; | 472 | u32 pad; |
471 | u64 addr; | 473 | __le64 addr; |
472 | #else | 474 | #else |
473 | u32 addr; | 475 | __le32 addr; |
474 | #endif | 476 | #endif |
475 | }; | 477 | }; |
476 | 478 | ||
@@ -874,13 +876,13 @@ static int hamachi_open(struct net_device *dev) | |||
874 | 876 | ||
875 | #if ADDRLEN == 64 | 877 | #if ADDRLEN == 64 |
876 | /* writellll anyone ? */ | 878 | /* writellll anyone ? */ |
877 | writel(cpu_to_le64(hmp->rx_ring_dma), ioaddr + RxPtr); | 879 | writel(hmp->rx_ring_dma, ioaddr + RxPtr); |
878 | writel(cpu_to_le64(hmp->rx_ring_dma) >> 32, ioaddr + RxPtr + 4); | 880 | writel(hmp->rx_ring_dma >> 32, ioaddr + RxPtr + 4); |
879 | writel(cpu_to_le64(hmp->tx_ring_dma), ioaddr + TxPtr); | 881 | writel(hmp->tx_ring_dma, ioaddr + TxPtr); |
880 | writel(cpu_to_le64(hmp->tx_ring_dma) >> 32, ioaddr + TxPtr + 4); | 882 | writel(hmp->tx_ring_dma >> 32, ioaddr + TxPtr + 4); |
881 | #else | 883 | #else |
882 | writel(cpu_to_le32(hmp->rx_ring_dma), ioaddr + RxPtr); | 884 | writel(hmp->rx_ring_dma, ioaddr + RxPtr); |
883 | writel(cpu_to_le32(hmp->tx_ring_dma), ioaddr + TxPtr); | 885 | writel(hmp->tx_ring_dma, ioaddr + TxPtr); |
884 | #endif | 886 | #endif |
885 | 887 | ||
886 | /* TODO: It would make sense to organize this as words since the card | 888 | /* TODO: It would make sense to organize this as words since the card |
@@ -1019,8 +1021,8 @@ static inline int hamachi_tx(struct net_device *dev) | |||
1019 | skb = hmp->tx_skbuff[entry]; | 1021 | skb = hmp->tx_skbuff[entry]; |
1020 | if (skb) { | 1022 | if (skb) { |
1021 | pci_unmap_single(hmp->pci_dev, | 1023 | pci_unmap_single(hmp->pci_dev, |
1022 | hmp->tx_ring[entry].addr, skb->len, | 1024 | leXX_to_cpu(hmp->tx_ring[entry].addr), |
1023 | PCI_DMA_TODEVICE); | 1025 | skb->len, PCI_DMA_TODEVICE); |
1024 | dev_kfree_skb(skb); | 1026 | dev_kfree_skb(skb); |
1025 | hmp->tx_skbuff[entry] = NULL; | 1027 | hmp->tx_skbuff[entry] = NULL; |
1026 | } | 1028 | } |
@@ -1071,10 +1073,10 @@ static void hamachi_tx_timeout(struct net_device *dev) | |||
1071 | { | 1073 | { |
1072 | printk(KERN_DEBUG " Rx ring %p: ", hmp->rx_ring); | 1074 | printk(KERN_DEBUG " Rx ring %p: ", hmp->rx_ring); |
1073 | for (i = 0; i < RX_RING_SIZE; i++) | 1075 | for (i = 0; i < RX_RING_SIZE; i++) |
1074 | printk(" %8.8x", (unsigned int)hmp->rx_ring[i].status_n_length); | 1076 | printk(" %8.8x", le32_to_cpu(hmp->rx_ring[i].status_n_length)); |
1075 | printk("\n"KERN_DEBUG" Tx ring %p: ", hmp->tx_ring); | 1077 | printk("\n"KERN_DEBUG" Tx ring %p: ", hmp->tx_ring); |
1076 | for (i = 0; i < TX_RING_SIZE; i++) | 1078 | for (i = 0; i < TX_RING_SIZE; i++) |
1077 | printk(" %4.4x", hmp->tx_ring[i].status_n_length); | 1079 | printk(" %4.4x", le32_to_cpu(hmp->tx_ring[i].status_n_length)); |
1078 | printk("\n"); | 1080 | printk("\n"); |
1079 | } | 1081 | } |
1080 | 1082 | ||
@@ -1099,14 +1101,15 @@ static void hamachi_tx_timeout(struct net_device *dev) | |||
1099 | struct sk_buff *skb; | 1101 | struct sk_buff *skb; |
1100 | 1102 | ||
1101 | if (i >= TX_RING_SIZE - 1) | 1103 | if (i >= TX_RING_SIZE - 1) |
1102 | hmp->tx_ring[i].status_n_length = cpu_to_le32( | 1104 | hmp->tx_ring[i].status_n_length = |
1103 | DescEndRing | | 1105 | cpu_to_le32(DescEndRing) | |
1104 | (hmp->tx_ring[i].status_n_length & 0x0000FFFF)); | 1106 | (hmp->tx_ring[i].status_n_length & |
1107 | cpu_to_le32(0x0000ffff)); | ||
1105 | else | 1108 | else |
1106 | hmp->tx_ring[i].status_n_length &= 0x0000ffff; | 1109 | hmp->tx_ring[i].status_n_length &= cpu_to_le32(0x0000ffff); |
1107 | skb = hmp->tx_skbuff[i]; | 1110 | skb = hmp->tx_skbuff[i]; |
1108 | if (skb){ | 1111 | if (skb){ |
1109 | pci_unmap_single(hmp->pci_dev, hmp->tx_ring[i].addr, | 1112 | pci_unmap_single(hmp->pci_dev, leXX_to_cpu(hmp->tx_ring[i].addr), |
1110 | skb->len, PCI_DMA_TODEVICE); | 1113 | skb->len, PCI_DMA_TODEVICE); |
1111 | dev_kfree_skb(skb); | 1114 | dev_kfree_skb(skb); |
1112 | hmp->tx_skbuff[i] = NULL; | 1115 | hmp->tx_skbuff[i] = NULL; |
@@ -1128,7 +1131,8 @@ static void hamachi_tx_timeout(struct net_device *dev) | |||
1128 | struct sk_buff *skb = hmp->rx_skbuff[i]; | 1131 | struct sk_buff *skb = hmp->rx_skbuff[i]; |
1129 | 1132 | ||
1130 | if (skb){ | 1133 | if (skb){ |
1131 | pci_unmap_single(hmp->pci_dev, hmp->rx_ring[i].addr, | 1134 | pci_unmap_single(hmp->pci_dev, |
1135 | leXX_to_cpu(hmp->rx_ring[i].addr), | ||
1132 | hmp->rx_buf_sz, PCI_DMA_FROMDEVICE); | 1136 | hmp->rx_buf_sz, PCI_DMA_FROMDEVICE); |
1133 | dev_kfree_skb(skb); | 1137 | dev_kfree_skb(skb); |
1134 | hmp->rx_skbuff[i] = NULL; | 1138 | hmp->rx_skbuff[i] = NULL; |
@@ -1420,7 +1424,7 @@ static irqreturn_t hamachi_interrupt(int irq, void *dev_instance) | |||
1420 | /* Free the original skb. */ | 1424 | /* Free the original skb. */ |
1421 | if (skb){ | 1425 | if (skb){ |
1422 | pci_unmap_single(hmp->pci_dev, | 1426 | pci_unmap_single(hmp->pci_dev, |
1423 | hmp->tx_ring[entry].addr, | 1427 | leXX_to_cpu(hmp->tx_ring[entry].addr), |
1424 | skb->len, | 1428 | skb->len, |
1425 | PCI_DMA_TODEVICE); | 1429 | PCI_DMA_TODEVICE); |
1426 | dev_kfree_skb_irq(skb); | 1430 | dev_kfree_skb_irq(skb); |
@@ -1500,11 +1504,11 @@ static int hamachi_rx(struct net_device *dev) | |||
1500 | if (desc_status & DescOwn) | 1504 | if (desc_status & DescOwn) |
1501 | break; | 1505 | break; |
1502 | pci_dma_sync_single_for_cpu(hmp->pci_dev, | 1506 | pci_dma_sync_single_for_cpu(hmp->pci_dev, |
1503 | desc->addr, | 1507 | leXX_to_cpu(desc->addr), |
1504 | hmp->rx_buf_sz, | 1508 | hmp->rx_buf_sz, |
1505 | PCI_DMA_FROMDEVICE); | 1509 | PCI_DMA_FROMDEVICE); |
1506 | buf_addr = (u8 *) hmp->rx_skbuff[entry]->data; | 1510 | buf_addr = (u8 *) hmp->rx_skbuff[entry]->data; |
1507 | frame_status = le32_to_cpu(get_unaligned((s32*)&(buf_addr[data_size - 12]))); | 1511 | frame_status = le32_to_cpu(get_unaligned((__le32*)&(buf_addr[data_size - 12]))); |
1508 | if (hamachi_debug > 4) | 1512 | if (hamachi_debug > 4) |
1509 | printk(KERN_DEBUG " hamachi_rx() status was %8.8x.\n", | 1513 | printk(KERN_DEBUG " hamachi_rx() status was %8.8x.\n", |
1510 | frame_status); | 1514 | frame_status); |
@@ -1518,9 +1522,9 @@ static int hamachi_rx(struct net_device *dev) | |||
1518 | dev->name, desc, &hmp->rx_ring[hmp->cur_rx % RX_RING_SIZE]); | 1522 | dev->name, desc, &hmp->rx_ring[hmp->cur_rx % RX_RING_SIZE]); |
1519 | printk(KERN_WARNING "%s: Oversized Ethernet frame -- next status %x/%x last status %x.\n", | 1523 | printk(KERN_WARNING "%s: Oversized Ethernet frame -- next status %x/%x last status %x.\n", |
1520 | dev->name, | 1524 | dev->name, |
1521 | hmp->rx_ring[(hmp->cur_rx+1) % RX_RING_SIZE].status_n_length & 0xffff0000, | 1525 | le32_to_cpu(hmp->rx_ring[(hmp->cur_rx+1) % RX_RING_SIZE].status_n_length) & 0xffff0000, |
1522 | hmp->rx_ring[(hmp->cur_rx+1) % RX_RING_SIZE].status_n_length & 0x0000ffff, | 1526 | le32_to_cpu(hmp->rx_ring[(hmp->cur_rx+1) % RX_RING_SIZE].status_n_length) & 0x0000ffff, |
1523 | hmp->rx_ring[(hmp->cur_rx-1) % RX_RING_SIZE].status_n_length); | 1527 | le32_to_cpu(hmp->rx_ring[(hmp->cur_rx-1) % RX_RING_SIZE].status_n_length)); |
1524 | hmp->stats.rx_length_errors++; | 1528 | hmp->stats.rx_length_errors++; |
1525 | } /* else Omit for prototype errata??? */ | 1529 | } /* else Omit for prototype errata??? */ |
1526 | if (frame_status & 0x00380000) { | 1530 | if (frame_status & 0x00380000) { |
@@ -1566,7 +1570,7 @@ static int hamachi_rx(struct net_device *dev) | |||
1566 | #endif | 1570 | #endif |
1567 | skb_reserve(skb, 2); /* 16 byte align the IP header */ | 1571 | skb_reserve(skb, 2); /* 16 byte align the IP header */ |
1568 | pci_dma_sync_single_for_cpu(hmp->pci_dev, | 1572 | pci_dma_sync_single_for_cpu(hmp->pci_dev, |
1569 | hmp->rx_ring[entry].addr, | 1573 | leXX_to_cpu(hmp->rx_ring[entry].addr), |
1570 | hmp->rx_buf_sz, | 1574 | hmp->rx_buf_sz, |
1571 | PCI_DMA_FROMDEVICE); | 1575 | PCI_DMA_FROMDEVICE); |
1572 | /* Call copy + cksum if available. */ | 1576 | /* Call copy + cksum if available. */ |
@@ -1579,12 +1583,12 @@ static int hamachi_rx(struct net_device *dev) | |||
1579 | + entry*sizeof(*desc), pkt_len); | 1583 | + entry*sizeof(*desc), pkt_len); |
1580 | #endif | 1584 | #endif |
1581 | pci_dma_sync_single_for_device(hmp->pci_dev, | 1585 | pci_dma_sync_single_for_device(hmp->pci_dev, |
1582 | hmp->rx_ring[entry].addr, | 1586 | leXX_to_cpu(hmp->rx_ring[entry].addr), |
1583 | hmp->rx_buf_sz, | 1587 | hmp->rx_buf_sz, |
1584 | PCI_DMA_FROMDEVICE); | 1588 | PCI_DMA_FROMDEVICE); |
1585 | } else { | 1589 | } else { |
1586 | pci_unmap_single(hmp->pci_dev, | 1590 | pci_unmap_single(hmp->pci_dev, |
1587 | hmp->rx_ring[entry].addr, | 1591 | leXX_to_cpu(hmp->rx_ring[entry].addr), |
1588 | hmp->rx_buf_sz, PCI_DMA_FROMDEVICE); | 1592 | hmp->rx_buf_sz, PCI_DMA_FROMDEVICE); |
1589 | skb_put(skb = hmp->rx_skbuff[entry], pkt_len); | 1593 | skb_put(skb = hmp->rx_skbuff[entry], pkt_len); |
1590 | hmp->rx_skbuff[entry] = NULL; | 1594 | hmp->rx_skbuff[entry] = NULL; |
@@ -1787,21 +1791,21 @@ static int hamachi_close(struct net_device *dev) | |||
1787 | for (i = 0; i < RX_RING_SIZE; i++) { | 1791 | for (i = 0; i < RX_RING_SIZE; i++) { |
1788 | skb = hmp->rx_skbuff[i]; | 1792 | skb = hmp->rx_skbuff[i]; |
1789 | hmp->rx_ring[i].status_n_length = 0; | 1793 | hmp->rx_ring[i].status_n_length = 0; |
1790 | hmp->rx_ring[i].addr = 0xBADF00D0; /* An invalid address. */ | ||
1791 | if (skb) { | 1794 | if (skb) { |
1792 | pci_unmap_single(hmp->pci_dev, | 1795 | pci_unmap_single(hmp->pci_dev, |
1793 | hmp->rx_ring[i].addr, hmp->rx_buf_sz, | 1796 | leXX_to_cpu(hmp->rx_ring[i].addr), |
1794 | PCI_DMA_FROMDEVICE); | 1797 | hmp->rx_buf_sz, PCI_DMA_FROMDEVICE); |
1795 | dev_kfree_skb(skb); | 1798 | dev_kfree_skb(skb); |
1796 | hmp->rx_skbuff[i] = NULL; | 1799 | hmp->rx_skbuff[i] = NULL; |
1797 | } | 1800 | } |
1801 | hmp->rx_ring[i].addr = cpu_to_leXX(0xBADF00D0); /* An invalid address. */ | ||
1798 | } | 1802 | } |
1799 | for (i = 0; i < TX_RING_SIZE; i++) { | 1803 | for (i = 0; i < TX_RING_SIZE; i++) { |
1800 | skb = hmp->tx_skbuff[i]; | 1804 | skb = hmp->tx_skbuff[i]; |
1801 | if (skb) { | 1805 | if (skb) { |
1802 | pci_unmap_single(hmp->pci_dev, | 1806 | pci_unmap_single(hmp->pci_dev, |
1803 | hmp->tx_ring[i].addr, skb->len, | 1807 | leXX_to_cpu(hmp->tx_ring[i].addr), |
1804 | PCI_DMA_TODEVICE); | 1808 | skb->len, PCI_DMA_TODEVICE); |
1805 | dev_kfree_skb(skb); | 1809 | dev_kfree_skb(skb); |
1806 | hmp->tx_skbuff[i] = NULL; | 1810 | hmp->tx_skbuff[i] = NULL; |
1807 | } | 1811 | } |
diff --git a/drivers/net/ibm_newemac/debug.c b/drivers/net/ibm_newemac/debug.c index a2fc660ca5d4..86b756a30784 100644 --- a/drivers/net/ibm_newemac/debug.c +++ b/drivers/net/ibm_newemac/debug.c | |||
@@ -26,7 +26,7 @@ | |||
26 | 26 | ||
27 | #include "core.h" | 27 | #include "core.h" |
28 | 28 | ||
29 | static spinlock_t emac_dbg_lock = SPIN_LOCK_UNLOCKED; | 29 | static DEFINE_SPINLOCK(emac_dbg_lock); |
30 | 30 | ||
31 | static void emac_desc_dump(struct emac_instance *p) | 31 | static void emac_desc_dump(struct emac_instance *p) |
32 | { | 32 | { |
diff --git a/drivers/net/irda/irda-usb.c b/drivers/net/irda/irda-usb.c index c6355c00fd7a..9081234ab458 100644 --- a/drivers/net/irda/irda-usb.c +++ b/drivers/net/irda/irda-usb.c | |||
@@ -1168,6 +1168,7 @@ static int stir421x_patch_device(struct irda_usb_cb *self) | |||
1168 | static int irda_usb_net_open(struct net_device *netdev) | 1168 | static int irda_usb_net_open(struct net_device *netdev) |
1169 | { | 1169 | { |
1170 | struct irda_usb_cb *self; | 1170 | struct irda_usb_cb *self; |
1171 | unsigned long flags; | ||
1171 | char hwname[16]; | 1172 | char hwname[16]; |
1172 | int i; | 1173 | int i; |
1173 | 1174 | ||
@@ -1177,13 +1178,16 @@ static int irda_usb_net_open(struct net_device *netdev) | |||
1177 | self = (struct irda_usb_cb *) netdev->priv; | 1178 | self = (struct irda_usb_cb *) netdev->priv; |
1178 | IRDA_ASSERT(self != NULL, return -1;); | 1179 | IRDA_ASSERT(self != NULL, return -1;); |
1179 | 1180 | ||
1181 | spin_lock_irqsave(&self->lock, flags); | ||
1180 | /* Can only open the device if it's there */ | 1182 | /* Can only open the device if it's there */ |
1181 | if(!self->present) { | 1183 | if(!self->present) { |
1184 | spin_unlock_irqrestore(&self->lock, flags); | ||
1182 | IRDA_WARNING("%s(), device not present!\n", __FUNCTION__); | 1185 | IRDA_WARNING("%s(), device not present!\n", __FUNCTION__); |
1183 | return -1; | 1186 | return -1; |
1184 | } | 1187 | } |
1185 | 1188 | ||
1186 | if(self->needspatch) { | 1189 | if(self->needspatch) { |
1190 | spin_unlock_irqrestore(&self->lock, flags); | ||
1187 | IRDA_WARNING("%s(), device needs patch\n", __FUNCTION__) ; | 1191 | IRDA_WARNING("%s(), device needs patch\n", __FUNCTION__) ; |
1188 | return -EIO ; | 1192 | return -EIO ; |
1189 | } | 1193 | } |
@@ -1198,6 +1202,7 @@ static int irda_usb_net_open(struct net_device *netdev) | |||
1198 | /* To do *before* submitting Rx urbs and starting net Tx queue | 1202 | /* To do *before* submitting Rx urbs and starting net Tx queue |
1199 | * Jean II */ | 1203 | * Jean II */ |
1200 | self->netopen = 1; | 1204 | self->netopen = 1; |
1205 | spin_unlock_irqrestore(&self->lock, flags); | ||
1201 | 1206 | ||
1202 | /* | 1207 | /* |
1203 | * Now that everything should be initialized properly, | 1208 | * Now that everything should be initialized properly, |
diff --git a/drivers/net/irda/mcs7780.c b/drivers/net/irda/mcs7780.c index 0b769192d4ce..93916cf33f29 100644 --- a/drivers/net/irda/mcs7780.c +++ b/drivers/net/irda/mcs7780.c | |||
@@ -677,6 +677,8 @@ static int mcs_net_close(struct net_device *netdev) | |||
677 | /* Stop transmit processing */ | 677 | /* Stop transmit processing */ |
678 | netif_stop_queue(netdev); | 678 | netif_stop_queue(netdev); |
679 | 679 | ||
680 | kfree_skb(mcs->rx_buff.skb); | ||
681 | |||
680 | /* kill and free the receive and transmit URBs */ | 682 | /* kill and free the receive and transmit URBs */ |
681 | usb_kill_urb(mcs->rx_urb); | 683 | usb_kill_urb(mcs->rx_urb); |
682 | usb_free_urb(mcs->rx_urb); | 684 | usb_free_urb(mcs->rx_urb); |
diff --git a/drivers/net/irda/stir4200.c b/drivers/net/irda/stir4200.c index 042bc2f0417d..e59c485bc497 100644 --- a/drivers/net/irda/stir4200.c +++ b/drivers/net/irda/stir4200.c | |||
@@ -142,9 +142,6 @@ enum StirCtrl2Mask { | |||
142 | }; | 142 | }; |
143 | 143 | ||
144 | enum StirFifoCtlMask { | 144 | enum StirFifoCtlMask { |
145 | FIFOCTL_EOF = 0x80, | ||
146 | FIFOCTL_UNDER = 0x40, | ||
147 | FIFOCTL_OVER = 0x20, | ||
148 | FIFOCTL_DIR = 0x10, | 145 | FIFOCTL_DIR = 0x10, |
149 | FIFOCTL_CLR = 0x08, | 146 | FIFOCTL_CLR = 0x08, |
150 | FIFOCTL_EMPTY = 0x04, | 147 | FIFOCTL_EMPTY = 0x04, |
@@ -594,9 +591,10 @@ static int fifo_txwait(struct stir_cb *stir, int space) | |||
594 | { | 591 | { |
595 | int err; | 592 | int err; |
596 | unsigned long count, status; | 593 | unsigned long count, status; |
594 | unsigned long prev_count = 0x1fff; | ||
597 | 595 | ||
598 | /* Read FIFO status and count */ | 596 | /* Read FIFO status and count */ |
599 | for(;;) { | 597 | for (;; prev_count = count) { |
600 | err = read_reg(stir, REG_FIFOCTL, stir->fifo_status, | 598 | err = read_reg(stir, REG_FIFOCTL, stir->fifo_status, |
601 | FIFO_REGS_SIZE); | 599 | FIFO_REGS_SIZE); |
602 | if (unlikely(err != FIFO_REGS_SIZE)) { | 600 | if (unlikely(err != FIFO_REGS_SIZE)) { |
@@ -629,6 +627,10 @@ static int fifo_txwait(struct stir_cb *stir, int space) | |||
629 | if (space >= 0 && STIR_FIFO_SIZE - 4 > space + count) | 627 | if (space >= 0 && STIR_FIFO_SIZE - 4 > space + count) |
630 | return 0; | 628 | return 0; |
631 | 629 | ||
630 | /* queue confused */ | ||
631 | if (prev_count < count) | ||
632 | break; | ||
633 | |||
632 | /* estimate transfer time for remaining chars */ | 634 | /* estimate transfer time for remaining chars */ |
633 | msleep((count * 8000) / stir->speed); | 635 | msleep((count * 8000) / stir->speed); |
634 | } | 636 | } |
diff --git a/drivers/net/ixgb/ixgb_main.c b/drivers/net/ixgb/ixgb_main.c index 3021234b1e17..bf9085fe035a 100644 --- a/drivers/net/ixgb/ixgb_main.c +++ b/drivers/net/ixgb/ixgb_main.c | |||
@@ -320,10 +320,22 @@ ixgb_down(struct ixgb_adapter *adapter, boolean_t kill_watchdog) | |||
320 | void | 320 | void |
321 | ixgb_reset(struct ixgb_adapter *adapter) | 321 | ixgb_reset(struct ixgb_adapter *adapter) |
322 | { | 322 | { |
323 | struct ixgb_hw *hw = &adapter->hw; | ||
323 | 324 | ||
324 | ixgb_adapter_stop(&adapter->hw); | 325 | ixgb_adapter_stop(hw); |
325 | if(!ixgb_init_hw(&adapter->hw)) | 326 | if (!ixgb_init_hw(hw)) |
326 | DPRINTK(PROBE, ERR, "ixgb_init_hw failed.\n"); | 327 | DPRINTK(PROBE, ERR, "ixgb_init_hw failed.\n"); |
328 | |||
329 | /* restore frame size information */ | ||
330 | IXGB_WRITE_REG(hw, MFS, hw->max_frame_size << IXGB_MFS_SHIFT); | ||
331 | if (hw->max_frame_size > | ||
332 | IXGB_MAX_ENET_FRAME_SIZE_WITHOUT_FCS + ENET_FCS_LENGTH) { | ||
333 | u32 ctrl0 = IXGB_READ_REG(hw, CTRL0); | ||
334 | if (!(ctrl0 & IXGB_CTRL0_JFE)) { | ||
335 | ctrl0 |= IXGB_CTRL0_JFE; | ||
336 | IXGB_WRITE_REG(hw, CTRL0, ctrl0); | ||
337 | } | ||
338 | } | ||
327 | } | 339 | } |
328 | 340 | ||
329 | /** | 341 | /** |
diff --git a/drivers/net/pcmcia/pcnet_cs.c b/drivers/net/pcmcia/pcnet_cs.c index db6a97d1d7b1..51bbd582f16c 100644 --- a/drivers/net/pcmcia/pcnet_cs.c +++ b/drivers/net/pcmcia/pcnet_cs.c | |||
@@ -1746,6 +1746,7 @@ static struct pcmcia_device_id pcnet_ids[] = { | |||
1746 | PCMCIA_DEVICE_CIS_PROD_ID12("NDC", "Ethernet", 0x01c43ae1, 0x00b2e941, "NE2K.cis"), | 1746 | PCMCIA_DEVICE_CIS_PROD_ID12("NDC", "Ethernet", 0x01c43ae1, 0x00b2e941, "NE2K.cis"), |
1747 | PCMCIA_DEVICE_CIS_PROD_ID12("PMX ", "PE-200", 0x34f3f1c8, 0x10b59f8c, "PE-200.cis"), | 1747 | PCMCIA_DEVICE_CIS_PROD_ID12("PMX ", "PE-200", 0x34f3f1c8, 0x10b59f8c, "PE-200.cis"), |
1748 | PCMCIA_DEVICE_CIS_PROD_ID12("TAMARACK", "Ethernet", 0xcf434fba, 0x00b2e941, "tamarack.cis"), | 1748 | PCMCIA_DEVICE_CIS_PROD_ID12("TAMARACK", "Ethernet", 0xcf434fba, 0x00b2e941, "tamarack.cis"), |
1749 | PCMCIA_DEVICE_PROD_ID12("Ethernet", "CF Size PC Card", 0x00b2e941, 0x43ac239b), | ||
1749 | PCMCIA_DEVICE_PROD_ID123("Fast Ethernet", "CF Size PC Card", "1.0", | 1750 | PCMCIA_DEVICE_PROD_ID123("Fast Ethernet", "CF Size PC Card", "1.0", |
1750 | 0xb4be14e3, 0x43ac239b, 0x0877b627), | 1751 | 0xb4be14e3, 0x43ac239b, 0x0877b627), |
1751 | PCMCIA_DEVICE_NULL | 1752 | PCMCIA_DEVICE_NULL |
diff --git a/drivers/net/s2io.c b/drivers/net/s2io.c index 121cb100f93a..9d80f1cf73ac 100644 --- a/drivers/net/s2io.c +++ b/drivers/net/s2io.c | |||
@@ -3737,7 +3737,7 @@ static int s2io_enable_msi_x(struct s2io_nic *nic) | |||
3737 | } | 3737 | } |
3738 | 3738 | ||
3739 | /* Handle software interrupt used during MSI(X) test */ | 3739 | /* Handle software interrupt used during MSI(X) test */ |
3740 | static irqreturn_t __devinit s2io_test_intr(int irq, void *dev_id) | 3740 | static irqreturn_t s2io_test_intr(int irq, void *dev_id) |
3741 | { | 3741 | { |
3742 | struct s2io_nic *sp = dev_id; | 3742 | struct s2io_nic *sp = dev_id; |
3743 | 3743 | ||
@@ -3748,7 +3748,7 @@ static irqreturn_t __devinit s2io_test_intr(int irq, void *dev_id) | |||
3748 | } | 3748 | } |
3749 | 3749 | ||
3750 | /* Test interrupt path by forcing a a software IRQ */ | 3750 | /* Test interrupt path by forcing a a software IRQ */ |
3751 | static int __devinit s2io_test_msi(struct s2io_nic *sp) | 3751 | static int s2io_test_msi(struct s2io_nic *sp) |
3752 | { | 3752 | { |
3753 | struct pci_dev *pdev = sp->pdev; | 3753 | struct pci_dev *pdev = sp->pdev; |
3754 | struct XENA_dev_config __iomem *bar0 = sp->bar0; | 3754 | struct XENA_dev_config __iomem *bar0 = sp->bar0; |
diff --git a/drivers/net/sis190.c b/drivers/net/sis190.c index 720088396bb9..7eab072ae792 100644 --- a/drivers/net/sis190.c +++ b/drivers/net/sis190.c | |||
@@ -474,7 +474,7 @@ static inline void sis190_map_to_asic(struct RxDesc *desc, dma_addr_t mapping, | |||
474 | static inline void sis190_make_unusable_by_asic(struct RxDesc *desc) | 474 | static inline void sis190_make_unusable_by_asic(struct RxDesc *desc) |
475 | { | 475 | { |
476 | desc->PSize = 0x0; | 476 | desc->PSize = 0x0; |
477 | desc->addr = 0xdeadbeef; | 477 | desc->addr = cpu_to_le32(0xdeadbeef); |
478 | desc->size &= cpu_to_le32(RingEnd); | 478 | desc->size &= cpu_to_le32(RingEnd); |
479 | wmb(); | 479 | wmb(); |
480 | desc->status = 0x0; | 480 | desc->status = 0x0; |
@@ -580,7 +580,7 @@ static int sis190_rx_interrupt(struct net_device *dev, | |||
580 | struct RxDesc *desc = tp->RxDescRing + entry; | 580 | struct RxDesc *desc = tp->RxDescRing + entry; |
581 | u32 status; | 581 | u32 status; |
582 | 582 | ||
583 | if (desc->status & OWNbit) | 583 | if (le32_to_cpu(desc->status) & OWNbit) |
584 | break; | 584 | break; |
585 | 585 | ||
586 | status = le32_to_cpu(desc->PSize); | 586 | status = le32_to_cpu(desc->PSize); |
@@ -1381,7 +1381,7 @@ out: | |||
1381 | return rc; | 1381 | return rc; |
1382 | } | 1382 | } |
1383 | 1383 | ||
1384 | static void __devexit sis190_mii_remove(struct net_device *dev) | 1384 | static void sis190_mii_remove(struct net_device *dev) |
1385 | { | 1385 | { |
1386 | struct sis190_private *tp = netdev_priv(dev); | 1386 | struct sis190_private *tp = netdev_priv(dev); |
1387 | 1387 | ||
@@ -1538,9 +1538,9 @@ static int __devinit sis190_get_mac_addr_from_eeprom(struct pci_dev *pdev, | |||
1538 | 1538 | ||
1539 | /* Get MAC address from EEPROM */ | 1539 | /* Get MAC address from EEPROM */ |
1540 | for (i = 0; i < MAC_ADDR_LEN / 2; i++) { | 1540 | for (i = 0; i < MAC_ADDR_LEN / 2; i++) { |
1541 | __le16 w = sis190_read_eeprom(ioaddr, EEPROMMACAddr + i); | 1541 | u16 w = sis190_read_eeprom(ioaddr, EEPROMMACAddr + i); |
1542 | 1542 | ||
1543 | ((u16 *)dev->dev_addr)[i] = le16_to_cpu(w); | 1543 | ((__le16 *)dev->dev_addr)[i] = cpu_to_le16(w); |
1544 | } | 1544 | } |
1545 | 1545 | ||
1546 | sis190_set_rgmii(tp, sis190_read_eeprom(ioaddr, EEPROMInfo)); | 1546 | sis190_set_rgmii(tp, sis190_read_eeprom(ioaddr, EEPROMInfo)); |
diff --git a/drivers/net/sky2.c b/drivers/net/sky2.c index 6197afb3ed83..a74fc11a6482 100644 --- a/drivers/net/sky2.c +++ b/drivers/net/sky2.c | |||
@@ -822,8 +822,13 @@ static void sky2_mac_init(struct sky2_hw *hw, unsigned port) | |||
822 | 822 | ||
823 | sky2_write32(hw, SK_REG(port, RX_GMF_CTRL_T), rx_reg); | 823 | sky2_write32(hw, SK_REG(port, RX_GMF_CTRL_T), rx_reg); |
824 | 824 | ||
825 | /* Flush Rx MAC FIFO on any flow control or error */ | 825 | if (hw->chip_id == CHIP_ID_YUKON_XL) { |
826 | sky2_write16(hw, SK_REG(port, RX_GMF_FL_MSK), GMR_FS_ANY_ERR); | 826 | /* Hardware errata - clear flush mask */ |
827 | sky2_write16(hw, SK_REG(port, RX_GMF_FL_MSK), 0); | ||
828 | } else { | ||
829 | /* Flush Rx MAC FIFO on any flow control or error */ | ||
830 | sky2_write16(hw, SK_REG(port, RX_GMF_FL_MSK), GMR_FS_ANY_ERR); | ||
831 | } | ||
827 | 832 | ||
828 | /* Set threshold to 0xa (64 bytes) + 1 to workaround pause bug */ | 833 | /* Set threshold to 0xa (64 bytes) + 1 to workaround pause bug */ |
829 | reg = RX_GMF_FL_THR_DEF + 1; | 834 | reg = RX_GMF_FL_THR_DEF + 1; |
diff --git a/drivers/net/smc911x.h b/drivers/net/smc911x.h index d04e4fa35206..7defa63b9c74 100644 --- a/drivers/net/smc911x.h +++ b/drivers/net/smc911x.h | |||
@@ -76,7 +76,7 @@ | |||
76 | 76 | ||
77 | 77 | ||
78 | 78 | ||
79 | #if SMC_USE_PXA_DMA | 79 | #ifdef SMC_USE_PXA_DMA |
80 | #define SMC_USE_DMA | 80 | #define SMC_USE_DMA |
81 | 81 | ||
82 | /* | 82 | /* |
diff --git a/drivers/net/starfire.c b/drivers/net/starfire.c index bcc430bd9e49..6e00dc857afa 100644 --- a/drivers/net/starfire.c +++ b/drivers/net/starfire.c | |||
@@ -1742,7 +1742,7 @@ static void set_rx_mode(struct net_device *dev) | |||
1742 | if (vlan_group_get_device(np->vlgrp, i)) { | 1742 | if (vlan_group_get_device(np->vlgrp, i)) { |
1743 | if (vlan_count >= 32) | 1743 | if (vlan_count >= 32) |
1744 | break; | 1744 | break; |
1745 | writew(cpu_to_be16(i), filter_addr); | 1745 | writew(i, filter_addr); |
1746 | filter_addr += 16; | 1746 | filter_addr += 16; |
1747 | vlan_count++; | 1747 | vlan_count++; |
1748 | } | 1748 | } |
diff --git a/drivers/net/sundance.c b/drivers/net/sundance.c index ff98f5d597f1..0a6186d4a48e 100644 --- a/drivers/net/sundance.c +++ b/drivers/net/sundance.c | |||
@@ -340,9 +340,9 @@ enum mac_ctrl1_bits { | |||
340 | /* Note that using only 32 bit fields simplifies conversion to big-endian | 340 | /* Note that using only 32 bit fields simplifies conversion to big-endian |
341 | architectures. */ | 341 | architectures. */ |
342 | struct netdev_desc { | 342 | struct netdev_desc { |
343 | u32 next_desc; | 343 | __le32 next_desc; |
344 | u32 status; | 344 | __le32 status; |
345 | struct desc_frag { u32 addr, length; } frag[1]; | 345 | struct desc_frag { __le32 addr, length; } frag[1]; |
346 | }; | 346 | }; |
347 | 347 | ||
348 | /* Bits in netdev_desc.status */ | 348 | /* Bits in netdev_desc.status */ |
@@ -495,8 +495,8 @@ static int __devinit sundance_probe1 (struct pci_dev *pdev, | |||
495 | goto err_out_res; | 495 | goto err_out_res; |
496 | 496 | ||
497 | for (i = 0; i < 3; i++) | 497 | for (i = 0; i < 3; i++) |
498 | ((u16 *)dev->dev_addr)[i] = | 498 | ((__le16 *)dev->dev_addr)[i] = |
499 | le16_to_cpu(eeprom_read(ioaddr, i + EEPROM_SA_OFFSET)); | 499 | cpu_to_le16(eeprom_read(ioaddr, i + EEPROM_SA_OFFSET)); |
500 | memcpy(dev->perm_addr, dev->dev_addr, dev->addr_len); | 500 | memcpy(dev->perm_addr, dev->dev_addr, dev->addr_len); |
501 | 501 | ||
502 | dev->base_addr = (unsigned long)ioaddr; | 502 | dev->base_addr = (unsigned long)ioaddr; |
@@ -1090,8 +1090,8 @@ reset_tx (struct net_device *dev) | |||
1090 | skb = np->tx_skbuff[i]; | 1090 | skb = np->tx_skbuff[i]; |
1091 | if (skb) { | 1091 | if (skb) { |
1092 | pci_unmap_single(np->pci_dev, | 1092 | pci_unmap_single(np->pci_dev, |
1093 | np->tx_ring[i].frag[0].addr, skb->len, | 1093 | le32_to_cpu(np->tx_ring[i].frag[0].addr), |
1094 | PCI_DMA_TODEVICE); | 1094 | skb->len, PCI_DMA_TODEVICE); |
1095 | if (irq) | 1095 | if (irq) |
1096 | dev_kfree_skb_irq (skb); | 1096 | dev_kfree_skb_irq (skb); |
1097 | else | 1097 | else |
@@ -1214,7 +1214,7 @@ static irqreturn_t intr_handler(int irq, void *dev_instance) | |||
1214 | skb = np->tx_skbuff[entry]; | 1214 | skb = np->tx_skbuff[entry]; |
1215 | /* Free the original skb. */ | 1215 | /* Free the original skb. */ |
1216 | pci_unmap_single(np->pci_dev, | 1216 | pci_unmap_single(np->pci_dev, |
1217 | np->tx_ring[entry].frag[0].addr, | 1217 | le32_to_cpu(np->tx_ring[entry].frag[0].addr), |
1218 | skb->len, PCI_DMA_TODEVICE); | 1218 | skb->len, PCI_DMA_TODEVICE); |
1219 | dev_kfree_skb_irq (np->tx_skbuff[entry]); | 1219 | dev_kfree_skb_irq (np->tx_skbuff[entry]); |
1220 | np->tx_skbuff[entry] = NULL; | 1220 | np->tx_skbuff[entry] = NULL; |
@@ -1233,7 +1233,7 @@ static irqreturn_t intr_handler(int irq, void *dev_instance) | |||
1233 | skb = np->tx_skbuff[entry]; | 1233 | skb = np->tx_skbuff[entry]; |
1234 | /* Free the original skb. */ | 1234 | /* Free the original skb. */ |
1235 | pci_unmap_single(np->pci_dev, | 1235 | pci_unmap_single(np->pci_dev, |
1236 | np->tx_ring[entry].frag[0].addr, | 1236 | le32_to_cpu(np->tx_ring[entry].frag[0].addr), |
1237 | skb->len, PCI_DMA_TODEVICE); | 1237 | skb->len, PCI_DMA_TODEVICE); |
1238 | dev_kfree_skb_irq (np->tx_skbuff[entry]); | 1238 | dev_kfree_skb_irq (np->tx_skbuff[entry]); |
1239 | np->tx_skbuff[entry] = NULL; | 1239 | np->tx_skbuff[entry] = NULL; |
@@ -1311,19 +1311,19 @@ static void rx_poll(unsigned long data) | |||
1311 | && (skb = dev_alloc_skb(pkt_len + 2)) != NULL) { | 1311 | && (skb = dev_alloc_skb(pkt_len + 2)) != NULL) { |
1312 | skb_reserve(skb, 2); /* 16 byte align the IP header */ | 1312 | skb_reserve(skb, 2); /* 16 byte align the IP header */ |
1313 | pci_dma_sync_single_for_cpu(np->pci_dev, | 1313 | pci_dma_sync_single_for_cpu(np->pci_dev, |
1314 | desc->frag[0].addr, | 1314 | le32_to_cpu(desc->frag[0].addr), |
1315 | np->rx_buf_sz, | 1315 | np->rx_buf_sz, |
1316 | PCI_DMA_FROMDEVICE); | 1316 | PCI_DMA_FROMDEVICE); |
1317 | 1317 | ||
1318 | skb_copy_to_linear_data(skb, np->rx_skbuff[entry]->data, pkt_len); | 1318 | skb_copy_to_linear_data(skb, np->rx_skbuff[entry]->data, pkt_len); |
1319 | pci_dma_sync_single_for_device(np->pci_dev, | 1319 | pci_dma_sync_single_for_device(np->pci_dev, |
1320 | desc->frag[0].addr, | 1320 | le32_to_cpu(desc->frag[0].addr), |
1321 | np->rx_buf_sz, | 1321 | np->rx_buf_sz, |
1322 | PCI_DMA_FROMDEVICE); | 1322 | PCI_DMA_FROMDEVICE); |
1323 | skb_put(skb, pkt_len); | 1323 | skb_put(skb, pkt_len); |
1324 | } else { | 1324 | } else { |
1325 | pci_unmap_single(np->pci_dev, | 1325 | pci_unmap_single(np->pci_dev, |
1326 | desc->frag[0].addr, | 1326 | le32_to_cpu(desc->frag[0].addr), |
1327 | np->rx_buf_sz, | 1327 | np->rx_buf_sz, |
1328 | PCI_DMA_FROMDEVICE); | 1328 | PCI_DMA_FROMDEVICE); |
1329 | skb_put(skb = np->rx_skbuff[entry], pkt_len); | 1329 | skb_put(skb = np->rx_skbuff[entry], pkt_len); |
@@ -1709,23 +1709,23 @@ static int netdev_close(struct net_device *dev) | |||
1709 | /* Free all the skbuffs in the Rx queue. */ | 1709 | /* Free all the skbuffs in the Rx queue. */ |
1710 | for (i = 0; i < RX_RING_SIZE; i++) { | 1710 | for (i = 0; i < RX_RING_SIZE; i++) { |
1711 | np->rx_ring[i].status = 0; | 1711 | np->rx_ring[i].status = 0; |
1712 | np->rx_ring[i].frag[0].addr = 0xBADF00D0; /* An invalid address. */ | ||
1713 | skb = np->rx_skbuff[i]; | 1712 | skb = np->rx_skbuff[i]; |
1714 | if (skb) { | 1713 | if (skb) { |
1715 | pci_unmap_single(np->pci_dev, | 1714 | pci_unmap_single(np->pci_dev, |
1716 | np->rx_ring[i].frag[0].addr, np->rx_buf_sz, | 1715 | le32_to_cpu(np->rx_ring[i].frag[0].addr), |
1717 | PCI_DMA_FROMDEVICE); | 1716 | np->rx_buf_sz, PCI_DMA_FROMDEVICE); |
1718 | dev_kfree_skb(skb); | 1717 | dev_kfree_skb(skb); |
1719 | np->rx_skbuff[i] = NULL; | 1718 | np->rx_skbuff[i] = NULL; |
1720 | } | 1719 | } |
1720 | np->rx_ring[i].frag[0].addr = cpu_to_le32(0xBADF00D0); /* poison */ | ||
1721 | } | 1721 | } |
1722 | for (i = 0; i < TX_RING_SIZE; i++) { | 1722 | for (i = 0; i < TX_RING_SIZE; i++) { |
1723 | np->tx_ring[i].next_desc = 0; | 1723 | np->tx_ring[i].next_desc = 0; |
1724 | skb = np->tx_skbuff[i]; | 1724 | skb = np->tx_skbuff[i]; |
1725 | if (skb) { | 1725 | if (skb) { |
1726 | pci_unmap_single(np->pci_dev, | 1726 | pci_unmap_single(np->pci_dev, |
1727 | np->tx_ring[i].frag[0].addr, skb->len, | 1727 | le32_to_cpu(np->tx_ring[i].frag[0].addr), |
1728 | PCI_DMA_TODEVICE); | 1728 | skb->len, PCI_DMA_TODEVICE); |
1729 | dev_kfree_skb(skb); | 1729 | dev_kfree_skb(skb); |
1730 | np->tx_skbuff[i] = NULL; | 1730 | np->tx_skbuff[i] = NULL; |
1731 | } | 1731 | } |
diff --git a/drivers/net/ucc_geth.c b/drivers/net/ucc_geth.c index 0f7626856a6b..8d456e379a86 100644 --- a/drivers/net/ucc_geth.c +++ b/drivers/net/ucc_geth.c | |||
@@ -3447,7 +3447,7 @@ static int ucc_geth_rx(struct ucc_geth_private *ugeth, u8 rxQ, int rx_work_limit | |||
3447 | u16 length, howmany = 0; | 3447 | u16 length, howmany = 0; |
3448 | u32 bd_status; | 3448 | u32 bd_status; |
3449 | u8 *bdBuffer; | 3449 | u8 *bdBuffer; |
3450 | struct net_device * dev; | 3450 | struct net_device *dev; |
3451 | 3451 | ||
3452 | ugeth_vdbg("%s: IN", __FUNCTION__); | 3452 | ugeth_vdbg("%s: IN", __FUNCTION__); |
3453 | 3453 | ||
diff --git a/drivers/net/ucc_geth_mii.h b/drivers/net/ucc_geth_mii.h index d83437039919..1e45b2028a50 100644 --- a/drivers/net/ucc_geth_mii.h +++ b/drivers/net/ucc_geth_mii.h | |||
@@ -96,5 +96,5 @@ enum enet_tbi_mii_reg { | |||
96 | int uec_mdio_read(struct mii_bus *bus, int mii_id, int regnum); | 96 | int uec_mdio_read(struct mii_bus *bus, int mii_id, int regnum); |
97 | int uec_mdio_write(struct mii_bus *bus, int mii_id, int regnum, u16 value); | 97 | int uec_mdio_write(struct mii_bus *bus, int mii_id, int regnum, u16 value); |
98 | int __init uec_mdio_init(void); | 98 | int __init uec_mdio_init(void); |
99 | void __exit uec_mdio_exit(void); | 99 | void uec_mdio_exit(void); |
100 | #endif /* __UEC_MII_H */ | 100 | #endif /* __UEC_MII_H */ |
diff --git a/drivers/net/wan/syncppp.c b/drivers/net/wan/syncppp.c index 232ecba5340f..61e24b7a45a3 100644 --- a/drivers/net/wan/syncppp.c +++ b/drivers/net/wan/syncppp.c | |||
@@ -107,24 +107,24 @@ | |||
107 | struct ppp_header { | 107 | struct ppp_header { |
108 | u8 address; | 108 | u8 address; |
109 | u8 control; | 109 | u8 control; |
110 | u16 protocol; | 110 | __be16 protocol; |
111 | }; | 111 | }; |
112 | #define PPP_HEADER_LEN sizeof (struct ppp_header) | 112 | #define PPP_HEADER_LEN sizeof (struct ppp_header) |
113 | 113 | ||
114 | struct lcp_header { | 114 | struct lcp_header { |
115 | u8 type; | 115 | u8 type; |
116 | u8 ident; | 116 | u8 ident; |
117 | u16 len; | 117 | __be16 len; |
118 | }; | 118 | }; |
119 | #define LCP_HEADER_LEN sizeof (struct lcp_header) | 119 | #define LCP_HEADER_LEN sizeof (struct lcp_header) |
120 | 120 | ||
121 | struct cisco_packet { | 121 | struct cisco_packet { |
122 | u32 type; | 122 | __be32 type; |
123 | u32 par1; | 123 | __be32 par1; |
124 | u32 par2; | 124 | __be32 par2; |
125 | u16 rel; | 125 | __be16 rel; |
126 | u16 time0; | 126 | __be16 time0; |
127 | u16 time1; | 127 | __be16 time1; |
128 | }; | 128 | }; |
129 | #define CISCO_PACKET_LEN 18 | 129 | #define CISCO_PACKET_LEN 18 |
130 | #define CISCO_BIG_PACKET_LEN 20 | 130 | #define CISCO_BIG_PACKET_LEN 20 |
@@ -139,7 +139,7 @@ static struct sk_buff_head tx_queue; | |||
139 | static void sppp_keepalive (unsigned long dummy); | 139 | static void sppp_keepalive (unsigned long dummy); |
140 | static void sppp_cp_send (struct sppp *sp, u16 proto, u8 type, | 140 | static void sppp_cp_send (struct sppp *sp, u16 proto, u8 type, |
141 | u8 ident, u16 len, void *data); | 141 | u8 ident, u16 len, void *data); |
142 | static void sppp_cisco_send (struct sppp *sp, int type, long par1, long par2); | 142 | static void sppp_cisco_send (struct sppp *sp, int type, u32 par1, u32 par2); |
143 | static void sppp_lcp_input (struct sppp *sp, struct sk_buff *m); | 143 | static void sppp_lcp_input (struct sppp *sp, struct sk_buff *m); |
144 | static void sppp_cisco_input (struct sppp *sp, struct sk_buff *m); | 144 | static void sppp_cisco_input (struct sppp *sp, struct sk_buff *m); |
145 | static void sppp_ipcp_input (struct sppp *sp, struct sk_buff *m); | 145 | static void sppp_ipcp_input (struct sppp *sp, struct sk_buff *m); |
@@ -447,7 +447,7 @@ static void sppp_keepalive (unsigned long dummy) | |||
447 | sppp_cisco_send (sp, CISCO_KEEPALIVE_REQ, ++sp->pp_seq, | 447 | sppp_cisco_send (sp, CISCO_KEEPALIVE_REQ, ++sp->pp_seq, |
448 | sp->pp_rseq); | 448 | sp->pp_rseq); |
449 | else if (sp->lcp.state == LCP_STATE_OPENED) { | 449 | else if (sp->lcp.state == LCP_STATE_OPENED) { |
450 | long nmagic = htonl (sp->lcp.magic); | 450 | __be32 nmagic = htonl (sp->lcp.magic); |
451 | sp->lcp.echoid = ++sp->pp_seq; | 451 | sp->lcp.echoid = ++sp->pp_seq; |
452 | sppp_cp_send (sp, PPP_LCP, LCP_ECHO_REQ, | 452 | sppp_cp_send (sp, PPP_LCP, LCP_ECHO_REQ, |
453 | sp->lcp.echoid, 4, &nmagic); | 453 | sp->lcp.echoid, 4, &nmagic); |
@@ -667,7 +667,7 @@ badreq: | |||
667 | dev->name, len); | 667 | dev->name, len); |
668 | break; | 668 | break; |
669 | } | 669 | } |
670 | if (ntohl (*(long*)(h+1)) == sp->lcp.magic) { | 670 | if (ntohl (*(__be32*)(h+1)) == sp->lcp.magic) { |
671 | /* Line loopback mode detected. */ | 671 | /* Line loopback mode detected. */ |
672 | printk (KERN_WARNING "%s: loopback\n", dev->name); | 672 | printk (KERN_WARNING "%s: loopback\n", dev->name); |
673 | if_down (dev); | 673 | if_down (dev); |
@@ -680,7 +680,7 @@ badreq: | |||
680 | sppp_lcp_open (sp); | 680 | sppp_lcp_open (sp); |
681 | break; | 681 | break; |
682 | } | 682 | } |
683 | *(long*)(h+1) = htonl (sp->lcp.magic); | 683 | *(__be32 *)(h+1) = htonl (sp->lcp.magic); |
684 | sppp_cp_send (sp, PPP_LCP, LCP_ECHO_REPLY, h->ident, len-4, h+1); | 684 | sppp_cp_send (sp, PPP_LCP, LCP_ECHO_REPLY, h->ident, len-4, h+1); |
685 | break; | 685 | break; |
686 | case LCP_ECHO_REPLY: | 686 | case LCP_ECHO_REPLY: |
@@ -692,7 +692,7 @@ badreq: | |||
692 | dev->name, len); | 692 | dev->name, len); |
693 | break; | 693 | break; |
694 | } | 694 | } |
695 | if (ntohl (*(long*)(h+1)) != sp->lcp.magic) | 695 | if (ntohl(*(__be32 *)(h+1)) != sp->lcp.magic) |
696 | sp->pp_alivecnt = 0; | 696 | sp->pp_alivecnt = 0; |
697 | break; | 697 | break; |
698 | } | 698 | } |
@@ -765,7 +765,7 @@ static void sppp_cisco_input (struct sppp *sp, struct sk_buff *skb) | |||
765 | { | 765 | { |
766 | struct in_device *in_dev; | 766 | struct in_device *in_dev; |
767 | struct in_ifaddr *ifa; | 767 | struct in_ifaddr *ifa; |
768 | __be32 addr = 0, mask = ~0; /* FIXME: is the mask correct? */ | 768 | __be32 addr = 0, mask = htonl(~0U); /* FIXME: is the mask correct? */ |
769 | #ifdef CONFIG_INET | 769 | #ifdef CONFIG_INET |
770 | rcu_read_lock(); | 770 | rcu_read_lock(); |
771 | if ((in_dev = __in_dev_get_rcu(dev)) != NULL) | 771 | if ((in_dev = __in_dev_get_rcu(dev)) != NULL) |
@@ -782,8 +782,7 @@ static void sppp_cisco_input (struct sppp *sp, struct sk_buff *skb) | |||
782 | } | 782 | } |
783 | rcu_read_unlock(); | 783 | rcu_read_unlock(); |
784 | #endif | 784 | #endif |
785 | /* I hope both addr and mask are in the net order */ | 785 | sppp_cisco_send (sp, CISCO_ADDR_REPLY, ntohl(addr), ntohl(mask)); |
786 | sppp_cisco_send (sp, CISCO_ADDR_REPLY, addr, mask); | ||
787 | break; | 786 | break; |
788 | } | 787 | } |
789 | } | 788 | } |
@@ -844,7 +843,7 @@ static void sppp_cp_send (struct sppp *sp, u16 proto, u8 type, | |||
844 | * Send Cisco keepalive packet. | 843 | * Send Cisco keepalive packet. |
845 | */ | 844 | */ |
846 | 845 | ||
847 | static void sppp_cisco_send (struct sppp *sp, int type, long par1, long par2) | 846 | static void sppp_cisco_send (struct sppp *sp, int type, u32 par1, u32 par2) |
848 | { | 847 | { |
849 | struct ppp_header *h; | 848 | struct ppp_header *h; |
850 | struct cisco_packet *ch; | 849 | struct cisco_packet *ch; |
@@ -868,7 +867,7 @@ static void sppp_cisco_send (struct sppp *sp, int type, long par1, long par2) | |||
868 | ch->type = htonl (type); | 867 | ch->type = htonl (type); |
869 | ch->par1 = htonl (par1); | 868 | ch->par1 = htonl (par1); |
870 | ch->par2 = htonl (par2); | 869 | ch->par2 = htonl (par2); |
871 | ch->rel = -1; | 870 | ch->rel = htons(0xffff); |
872 | ch->time0 = htons ((u16) (t >> 16)); | 871 | ch->time0 = htons ((u16) (t >> 16)); |
873 | ch->time1 = htons ((u16) t); | 872 | ch->time1 = htons ((u16) t); |
874 | 873 | ||
diff --git a/drivers/net/wireless/Kconfig b/drivers/net/wireless/Kconfig index 2b733c582915..5583719a0dca 100644 --- a/drivers/net/wireless/Kconfig +++ b/drivers/net/wireless/Kconfig | |||
@@ -264,6 +264,7 @@ config IPW2200_DEBUG | |||
264 | config LIBERTAS | 264 | config LIBERTAS |
265 | tristate "Marvell 8xxx Libertas WLAN driver support" | 265 | tristate "Marvell 8xxx Libertas WLAN driver support" |
266 | depends on WLAN_80211 | 266 | depends on WLAN_80211 |
267 | select WIRELESS_EXT | ||
267 | select IEEE80211 | 268 | select IEEE80211 |
268 | select FW_LOADER | 269 | select FW_LOADER |
269 | ---help--- | 270 | ---help--- |
diff --git a/drivers/net/wireless/b43/leds.c b/drivers/net/wireless/b43/leds.c index 19e588582c7c..6c0e2b9f7760 100644 --- a/drivers/net/wireless/b43/leds.c +++ b/drivers/net/wireless/b43/leds.c | |||
@@ -163,6 +163,9 @@ static void b43_map_led(struct b43_wldev *dev, | |||
163 | b43_register_led(dev, &dev->led_radio, name, | 163 | b43_register_led(dev, &dev->led_radio, name, |
164 | b43_rfkill_led_name(dev), | 164 | b43_rfkill_led_name(dev), |
165 | led_index, activelow); | 165 | led_index, activelow); |
166 | /* Sync the RF-kill LED state with the switch state. */ | ||
167 | if (dev->radio_hw_enable) | ||
168 | b43_led_turn_on(dev, led_index, activelow); | ||
166 | break; | 169 | break; |
167 | case B43_LED_WEIRD: | 170 | case B43_LED_WEIRD: |
168 | case B43_LED_ASSOC: | 171 | case B43_LED_ASSOC: |
@@ -232,4 +235,5 @@ void b43_leds_exit(struct b43_wldev *dev) | |||
232 | b43_unregister_led(&dev->led_tx); | 235 | b43_unregister_led(&dev->led_tx); |
233 | b43_unregister_led(&dev->led_rx); | 236 | b43_unregister_led(&dev->led_rx); |
234 | b43_unregister_led(&dev->led_assoc); | 237 | b43_unregister_led(&dev->led_assoc); |
238 | b43_unregister_led(&dev->led_radio); | ||
235 | } | 239 | } |
diff --git a/drivers/net/wireless/b43/main.c b/drivers/net/wireless/b43/main.c index b45eecc53c4a..1c93b4f4bfe3 100644 --- a/drivers/net/wireless/b43/main.c +++ b/drivers/net/wireless/b43/main.c | |||
@@ -2163,7 +2163,6 @@ static void b43_mgmtframe_txantenna(struct b43_wldev *dev, int antenna) | |||
2163 | static void b43_chip_exit(struct b43_wldev *dev) | 2163 | static void b43_chip_exit(struct b43_wldev *dev) |
2164 | { | 2164 | { |
2165 | b43_radio_turn_off(dev, 1); | 2165 | b43_radio_turn_off(dev, 1); |
2166 | b43_leds_exit(dev); | ||
2167 | b43_gpio_cleanup(dev); | 2166 | b43_gpio_cleanup(dev); |
2168 | /* firmware is released later */ | 2167 | /* firmware is released later */ |
2169 | } | 2168 | } |
@@ -2191,11 +2190,10 @@ static int b43_chip_init(struct b43_wldev *dev) | |||
2191 | err = b43_gpio_init(dev); | 2190 | err = b43_gpio_init(dev); |
2192 | if (err) | 2191 | if (err) |
2193 | goto out; /* firmware is released later */ | 2192 | goto out; /* firmware is released later */ |
2194 | b43_leds_init(dev); | ||
2195 | 2193 | ||
2196 | err = b43_upload_initvals(dev); | 2194 | err = b43_upload_initvals(dev); |
2197 | if (err) | 2195 | if (err) |
2198 | goto err_leds_exit; | 2196 | goto err_gpio_clean; |
2199 | b43_radio_turn_on(dev); | 2197 | b43_radio_turn_on(dev); |
2200 | 2198 | ||
2201 | b43_write16(dev, 0x03E6, 0x0000); | 2199 | b43_write16(dev, 0x03E6, 0x0000); |
@@ -2271,8 +2269,7 @@ out: | |||
2271 | 2269 | ||
2272 | err_radio_off: | 2270 | err_radio_off: |
2273 | b43_radio_turn_off(dev, 1); | 2271 | b43_radio_turn_off(dev, 1); |
2274 | err_leds_exit: | 2272 | err_gpio_clean: |
2275 | b43_leds_exit(dev); | ||
2276 | b43_gpio_cleanup(dev); | 2273 | b43_gpio_cleanup(dev); |
2277 | return err; | 2274 | return err; |
2278 | } | 2275 | } |
@@ -3273,10 +3270,7 @@ static void b43_wireless_core_exit(struct b43_wldev *dev) | |||
3273 | return; | 3270 | return; |
3274 | b43_set_status(dev, B43_STAT_UNINIT); | 3271 | b43_set_status(dev, B43_STAT_UNINIT); |
3275 | 3272 | ||
3276 | mutex_unlock(&dev->wl->mutex); | 3273 | b43_leds_exit(dev); |
3277 | b43_rfkill_exit(dev); | ||
3278 | mutex_lock(&dev->wl->mutex); | ||
3279 | |||
3280 | b43_rng_exit(dev->wl); | 3274 | b43_rng_exit(dev->wl); |
3281 | b43_pio_free(dev); | 3275 | b43_pio_free(dev); |
3282 | b43_dma_free(dev); | 3276 | b43_dma_free(dev); |
@@ -3405,12 +3399,12 @@ static int b43_wireless_core_init(struct b43_wldev *dev) | |||
3405 | memset(wl->mac_addr, 0, ETH_ALEN); | 3399 | memset(wl->mac_addr, 0, ETH_ALEN); |
3406 | b43_upload_card_macaddress(dev); | 3400 | b43_upload_card_macaddress(dev); |
3407 | b43_security_init(dev); | 3401 | b43_security_init(dev); |
3408 | b43_rfkill_init(dev); | ||
3409 | b43_rng_init(wl); | 3402 | b43_rng_init(wl); |
3410 | 3403 | ||
3411 | b43_set_status(dev, B43_STAT_INITIALIZED); | 3404 | b43_set_status(dev, B43_STAT_INITIALIZED); |
3412 | 3405 | ||
3413 | out: | 3406 | b43_leds_init(dev); |
3407 | out: | ||
3414 | return err; | 3408 | return err; |
3415 | 3409 | ||
3416 | err_chip_exit: | 3410 | err_chip_exit: |
@@ -3499,6 +3493,10 @@ static int b43_start(struct ieee80211_hw *hw) | |||
3499 | int did_init = 0; | 3493 | int did_init = 0; |
3500 | int err = 0; | 3494 | int err = 0; |
3501 | 3495 | ||
3496 | /* First register RFkill. | ||
3497 | * LEDs that are registered later depend on it. */ | ||
3498 | b43_rfkill_init(dev); | ||
3499 | |||
3502 | mutex_lock(&wl->mutex); | 3500 | mutex_lock(&wl->mutex); |
3503 | 3501 | ||
3504 | if (b43_status(dev) < B43_STAT_INITIALIZED) { | 3502 | if (b43_status(dev) < B43_STAT_INITIALIZED) { |
@@ -3528,6 +3526,8 @@ static void b43_stop(struct ieee80211_hw *hw) | |||
3528 | struct b43_wl *wl = hw_to_b43_wl(hw); | 3526 | struct b43_wl *wl = hw_to_b43_wl(hw); |
3529 | struct b43_wldev *dev = wl->current_dev; | 3527 | struct b43_wldev *dev = wl->current_dev; |
3530 | 3528 | ||
3529 | b43_rfkill_exit(dev); | ||
3530 | |||
3531 | mutex_lock(&wl->mutex); | 3531 | mutex_lock(&wl->mutex); |
3532 | if (b43_status(dev) >= B43_STAT_STARTED) | 3532 | if (b43_status(dev) >= B43_STAT_STARTED) |
3533 | b43_wireless_core_stop(dev); | 3533 | b43_wireless_core_stop(dev); |
diff --git a/drivers/net/wireless/b43/rfkill.c b/drivers/net/wireless/b43/rfkill.c index 9b1f905ffbf4..98cf70c5fd47 100644 --- a/drivers/net/wireless/b43/rfkill.c +++ b/drivers/net/wireless/b43/rfkill.c | |||
@@ -25,6 +25,8 @@ | |||
25 | #include "rfkill.h" | 25 | #include "rfkill.h" |
26 | #include "b43.h" | 26 | #include "b43.h" |
27 | 27 | ||
28 | #include <linux/kmod.h> | ||
29 | |||
28 | 30 | ||
29 | /* Returns TRUE, if the radio is enabled in hardware. */ | 31 | /* Returns TRUE, if the radio is enabled in hardware. */ |
30 | static bool b43_is_hw_radio_enabled(struct b43_wldev *dev) | 32 | static bool b43_is_hw_radio_enabled(struct b43_wldev *dev) |
@@ -50,7 +52,10 @@ static void b43_rfkill_poll(struct input_polled_dev *poll_dev) | |||
50 | bool report_change = 0; | 52 | bool report_change = 0; |
51 | 53 | ||
52 | mutex_lock(&wl->mutex); | 54 | mutex_lock(&wl->mutex); |
53 | B43_WARN_ON(b43_status(dev) < B43_STAT_INITIALIZED); | 55 | if (unlikely(b43_status(dev) < B43_STAT_INITIALIZED)) { |
56 | mutex_unlock(&wl->mutex); | ||
57 | return; | ||
58 | } | ||
54 | enabled = b43_is_hw_radio_enabled(dev); | 59 | enabled = b43_is_hw_radio_enabled(dev); |
55 | if (unlikely(enabled != dev->radio_hw_enable)) { | 60 | if (unlikely(enabled != dev->radio_hw_enable)) { |
56 | dev->radio_hw_enable = enabled; | 61 | dev->radio_hw_enable = enabled; |
@@ -60,8 +65,12 @@ static void b43_rfkill_poll(struct input_polled_dev *poll_dev) | |||
60 | } | 65 | } |
61 | mutex_unlock(&wl->mutex); | 66 | mutex_unlock(&wl->mutex); |
62 | 67 | ||
63 | if (unlikely(report_change)) | 68 | /* send the radio switch event to the system - note both a key press |
64 | input_report_key(poll_dev->input, KEY_WLAN, enabled); | 69 | * and a release are required */ |
70 | if (unlikely(report_change)) { | ||
71 | input_report_key(poll_dev->input, KEY_WLAN, 1); | ||
72 | input_report_key(poll_dev->input, KEY_WLAN, 0); | ||
73 | } | ||
65 | } | 74 | } |
66 | 75 | ||
67 | /* Called when the RFKILL toggled in software. */ | 76 | /* Called when the RFKILL toggled in software. */ |
@@ -69,13 +78,15 @@ static int b43_rfkill_soft_toggle(void *data, enum rfkill_state state) | |||
69 | { | 78 | { |
70 | struct b43_wldev *dev = data; | 79 | struct b43_wldev *dev = data; |
71 | struct b43_wl *wl = dev->wl; | 80 | struct b43_wl *wl = dev->wl; |
72 | int err = 0; | 81 | int err = -EBUSY; |
73 | 82 | ||
74 | if (!wl->rfkill.registered) | 83 | if (!wl->rfkill.registered) |
75 | return 0; | 84 | return 0; |
76 | 85 | ||
77 | mutex_lock(&wl->mutex); | 86 | mutex_lock(&wl->mutex); |
78 | B43_WARN_ON(b43_status(dev) < B43_STAT_INITIALIZED); | 87 | if (b43_status(dev) < B43_STAT_INITIALIZED) |
88 | goto out_unlock; | ||
89 | err = 0; | ||
79 | switch (state) { | 90 | switch (state) { |
80 | case RFKILL_STATE_ON: | 91 | case RFKILL_STATE_ON: |
81 | if (!dev->radio_hw_enable) { | 92 | if (!dev->radio_hw_enable) { |
@@ -133,9 +144,25 @@ void b43_rfkill_init(struct b43_wldev *dev) | |||
133 | rfk->poll_dev->poll = b43_rfkill_poll; | 144 | rfk->poll_dev->poll = b43_rfkill_poll; |
134 | rfk->poll_dev->poll_interval = 1000; /* msecs */ | 145 | rfk->poll_dev->poll_interval = 1000; /* msecs */ |
135 | 146 | ||
147 | rfk->poll_dev->input->name = rfk->name; | ||
148 | rfk->poll_dev->input->id.bustype = BUS_HOST; | ||
149 | rfk->poll_dev->input->id.vendor = dev->dev->bus->boardinfo.vendor; | ||
150 | rfk->poll_dev->input->evbit[0] = BIT(EV_KEY); | ||
151 | set_bit(KEY_WLAN, rfk->poll_dev->input->keybit); | ||
152 | |||
136 | err = rfkill_register(rfk->rfkill); | 153 | err = rfkill_register(rfk->rfkill); |
137 | if (err) | 154 | if (err) |
138 | goto err_free_polldev; | 155 | goto err_free_polldev; |
156 | |||
157 | #ifdef CONFIG_RFKILL_INPUT_MODULE | ||
158 | /* B43 RF-kill isn't useful without the rfkill-input subsystem. | ||
159 | * Try to load the module. */ | ||
160 | err = request_module("rfkill-input"); | ||
161 | if (err) | ||
162 | b43warn(wl, "Failed to load the rfkill-input module. " | ||
163 | "The built-in radio LED will not work.\n"); | ||
164 | #endif /* CONFIG_RFKILL_INPUT */ | ||
165 | |||
139 | err = input_register_polled_device(rfk->poll_dev); | 166 | err = input_register_polled_device(rfk->poll_dev); |
140 | if (err) | 167 | if (err) |
141 | goto err_unreg_rfk; | 168 | goto err_unreg_rfk; |
diff --git a/drivers/net/wireless/bcm43xx/bcm43xx_debugfs.c b/drivers/net/wireless/bcm43xx/bcm43xx_debugfs.c index 35dbe4554513..76e9dd843faa 100644 --- a/drivers/net/wireless/bcm43xx/bcm43xx_debugfs.c +++ b/drivers/net/wireless/bcm43xx/bcm43xx_debugfs.c | |||
@@ -219,7 +219,7 @@ static ssize_t tsf_write_file(struct file *file, const char __user *user_buf, | |||
219 | ssize_t buf_size; | 219 | ssize_t buf_size; |
220 | ssize_t res; | 220 | ssize_t res; |
221 | unsigned long flags; | 221 | unsigned long flags; |
222 | u64 tsf; | 222 | unsigned long long tsf; |
223 | 223 | ||
224 | buf_size = min(count, sizeof (really_big_buffer) - 1); | 224 | buf_size = min(count, sizeof (really_big_buffer) - 1); |
225 | down(&big_buffer_sem); | 225 | down(&big_buffer_sem); |
diff --git a/drivers/net/wireless/ipw2200.c b/drivers/net/wireless/ipw2200.c index 54f44e5473c0..da51f477e9df 100644 --- a/drivers/net/wireless/ipw2200.c +++ b/drivers/net/wireless/ipw2200.c | |||
@@ -10751,7 +10751,7 @@ static void ipw_bg_link_down(struct work_struct *work) | |||
10751 | mutex_unlock(&priv->mutex); | 10751 | mutex_unlock(&priv->mutex); |
10752 | } | 10752 | } |
10753 | 10753 | ||
10754 | static int ipw_setup_deferred_work(struct ipw_priv *priv) | 10754 | static int __devinit ipw_setup_deferred_work(struct ipw_priv *priv) |
10755 | { | 10755 | { |
10756 | int ret = 0; | 10756 | int ret = 0; |
10757 | 10757 | ||
@@ -11600,7 +11600,8 @@ static void ipw_prom_free(struct ipw_priv *priv) | |||
11600 | #endif | 11600 | #endif |
11601 | 11601 | ||
11602 | 11602 | ||
11603 | static int ipw_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent) | 11603 | static int __devinit ipw_pci_probe(struct pci_dev *pdev, |
11604 | const struct pci_device_id *ent) | ||
11604 | { | 11605 | { |
11605 | int err = 0; | 11606 | int err = 0; |
11606 | struct net_device *net_dev; | 11607 | struct net_device *net_dev; |
@@ -11767,7 +11768,7 @@ static int ipw_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
11767 | return err; | 11768 | return err; |
11768 | } | 11769 | } |
11769 | 11770 | ||
11770 | static void ipw_pci_remove(struct pci_dev *pdev) | 11771 | static void __devexit ipw_pci_remove(struct pci_dev *pdev) |
11771 | { | 11772 | { |
11772 | struct ipw_priv *priv = pci_get_drvdata(pdev); | 11773 | struct ipw_priv *priv = pci_get_drvdata(pdev); |
11773 | struct list_head *p, *q; | 11774 | struct list_head *p, *q; |
diff --git a/drivers/net/wireless/iwlwifi/iwl3945-base.c b/drivers/net/wireless/iwlwifi/iwl3945-base.c index 4bdf237f6adc..3d1da0759b97 100644 --- a/drivers/net/wireless/iwlwifi/iwl3945-base.c +++ b/drivers/net/wireless/iwlwifi/iwl3945-base.c | |||
@@ -4743,8 +4743,10 @@ static void iwl_irq_tasklet(struct iwl_priv *priv) | |||
4743 | * when we loaded driver, and is now set to "enable". | 4743 | * when we loaded driver, and is now set to "enable". |
4744 | * After we're Alive, RF_KILL gets handled by | 4744 | * After we're Alive, RF_KILL gets handled by |
4745 | * iwl_rx_card_state_notif() */ | 4745 | * iwl_rx_card_state_notif() */ |
4746 | if (!hw_rf_kill && !test_bit(STATUS_ALIVE, &priv->status)) | 4746 | if (!hw_rf_kill && !test_bit(STATUS_ALIVE, &priv->status)) { |
4747 | clear_bit(STATUS_RF_KILL_HW, &priv->status); | ||
4747 | queue_work(priv->workqueue, &priv->restart); | 4748 | queue_work(priv->workqueue, &priv->restart); |
4749 | } | ||
4748 | 4750 | ||
4749 | handled |= CSR_INT_BIT_RF_KILL; | 4751 | handled |= CSR_INT_BIT_RF_KILL; |
4750 | } | 4752 | } |
@@ -6171,6 +6173,7 @@ static void iwl_alive_start(struct iwl_priv *priv) | |||
6171 | mutex_lock(&priv->mutex); | 6173 | mutex_lock(&priv->mutex); |
6172 | 6174 | ||
6173 | if (rc) { | 6175 | if (rc) { |
6176 | iwl_rate_control_unregister(priv->hw); | ||
6174 | IWL_ERROR("Failed to register network " | 6177 | IWL_ERROR("Failed to register network " |
6175 | "device (error %d)\n", rc); | 6178 | "device (error %d)\n", rc); |
6176 | return; | 6179 | return; |
diff --git a/drivers/net/wireless/iwlwifi/iwl4965-base.c b/drivers/net/wireless/iwlwifi/iwl4965-base.c index 8f85564ec6fa..b54fe5e6d529 100644 --- a/drivers/net/wireless/iwlwifi/iwl4965-base.c +++ b/drivers/net/wireless/iwlwifi/iwl4965-base.c | |||
@@ -5059,8 +5059,10 @@ static void iwl_irq_tasklet(struct iwl_priv *priv) | |||
5059 | * when we loaded driver, and is now set to "enable". | 5059 | * when we loaded driver, and is now set to "enable". |
5060 | * After we're Alive, RF_KILL gets handled by | 5060 | * After we're Alive, RF_KILL gets handled by |
5061 | * iwl_rx_card_state_notif() */ | 5061 | * iwl_rx_card_state_notif() */ |
5062 | if (!hw_rf_kill && !test_bit(STATUS_ALIVE, &priv->status)) | 5062 | if (!hw_rf_kill && !test_bit(STATUS_ALIVE, &priv->status)) { |
5063 | clear_bit(STATUS_RF_KILL_HW, &priv->status); | ||
5063 | queue_work(priv->workqueue, &priv->restart); | 5064 | queue_work(priv->workqueue, &priv->restart); |
5065 | } | ||
5064 | 5066 | ||
5065 | handled |= CSR_INT_BIT_RF_KILL; | 5067 | handled |= CSR_INT_BIT_RF_KILL; |
5066 | } | 5068 | } |
@@ -6527,6 +6529,7 @@ static void iwl_alive_start(struct iwl_priv *priv) | |||
6527 | mutex_lock(&priv->mutex); | 6529 | mutex_lock(&priv->mutex); |
6528 | 6530 | ||
6529 | if (rc) { | 6531 | if (rc) { |
6532 | iwl_rate_control_unregister(priv->hw); | ||
6530 | IWL_ERROR("Failed to register network " | 6533 | IWL_ERROR("Failed to register network " |
6531 | "device (error %d)\n", rc); | 6534 | "device (error %d)\n", rc); |
6532 | return; | 6535 | return; |
diff --git a/drivers/net/wireless/zd1211rw/zd_mac.c b/drivers/net/wireless/zd1211rw/zd_mac.c index a903645e157a..5298a8bf1129 100644 --- a/drivers/net/wireless/zd1211rw/zd_mac.c +++ b/drivers/net/wireless/zd1211rw/zd_mac.c | |||
@@ -1130,6 +1130,8 @@ static void zd_mac_rx(struct zd_mac *mac, struct sk_buff *skb) | |||
1130 | __skb_trim(skb, skb->len - | 1130 | __skb_trim(skb, skb->len - |
1131 | (IEEE80211_FCS_LEN + sizeof(struct rx_status))); | 1131 | (IEEE80211_FCS_LEN + sizeof(struct rx_status))); |
1132 | 1132 | ||
1133 | ZD_ASSERT(IS_ALIGNED((unsigned long)skb->data, 4)); | ||
1134 | |||
1133 | update_qual_rssi(mac, skb->data, skb->len, stats.signal, | 1135 | update_qual_rssi(mac, skb->data, skb->len, stats.signal, |
1134 | status->signal_strength); | 1136 | status->signal_strength); |
1135 | 1137 | ||
@@ -1166,15 +1168,19 @@ static void do_rx(unsigned long mac_ptr) | |||
1166 | int zd_mac_rx_irq(struct zd_mac *mac, const u8 *buffer, unsigned int length) | 1168 | int zd_mac_rx_irq(struct zd_mac *mac, const u8 *buffer, unsigned int length) |
1167 | { | 1169 | { |
1168 | struct sk_buff *skb; | 1170 | struct sk_buff *skb; |
1171 | unsigned int reserved = | ||
1172 | ALIGN(max_t(unsigned int, | ||
1173 | sizeof(struct zd_rt_hdr), ZD_PLCP_HEADER_SIZE), 4) - | ||
1174 | ZD_PLCP_HEADER_SIZE; | ||
1169 | 1175 | ||
1170 | skb = dev_alloc_skb(sizeof(struct zd_rt_hdr) + length); | 1176 | skb = dev_alloc_skb(reserved + length); |
1171 | if (!skb) { | 1177 | if (!skb) { |
1172 | struct ieee80211_device *ieee = zd_mac_to_ieee80211(mac); | 1178 | struct ieee80211_device *ieee = zd_mac_to_ieee80211(mac); |
1173 | dev_warn(zd_mac_dev(mac), "Could not allocate skb.\n"); | 1179 | dev_warn(zd_mac_dev(mac), "Could not allocate skb.\n"); |
1174 | ieee->stats.rx_dropped++; | 1180 | ieee->stats.rx_dropped++; |
1175 | return -ENOMEM; | 1181 | return -ENOMEM; |
1176 | } | 1182 | } |
1177 | skb_reserve(skb, sizeof(struct zd_rt_hdr)); | 1183 | skb_reserve(skb, reserved); |
1178 | memcpy(__skb_put(skb, length), buffer, length); | 1184 | memcpy(__skb_put(skb, length), buffer, length); |
1179 | skb_queue_tail(&mac->rx_queue, skb); | 1185 | skb_queue_tail(&mac->rx_queue, skb); |
1180 | tasklet_schedule(&mac->rx_tasklet); | 1186 | tasklet_schedule(&mac->rx_tasklet); |