diff options
Diffstat (limited to 'drivers/net')
39 files changed, 306 insertions, 195 deletions
diff --git a/drivers/net/3c509.c b/drivers/net/3c509.c index 3a7bc524af33..c7a4f3bcc2bc 100644 --- a/drivers/net/3c509.c +++ b/drivers/net/3c509.c | |||
@@ -94,7 +94,7 @@ | |||
94 | #include <asm/io.h> | 94 | #include <asm/io.h> |
95 | #include <asm/irq.h> | 95 | #include <asm/irq.h> |
96 | 96 | ||
97 | static char version[] __initdata = DRV_NAME ".c:" DRV_VERSION " " DRV_RELDATE " becker@scyld.com\n"; | 97 | static char version[] __devinitdata = DRV_NAME ".c:" DRV_VERSION " " DRV_RELDATE " becker@scyld.com\n"; |
98 | 98 | ||
99 | #ifdef EL3_DEBUG | 99 | #ifdef EL3_DEBUG |
100 | static int el3_debug = EL3_DEBUG; | 100 | static int el3_debug = EL3_DEBUG; |
@@ -186,7 +186,7 @@ static int max_interrupt_work = 10; | |||
186 | static int nopnp; | 186 | static int nopnp; |
187 | #endif | 187 | #endif |
188 | 188 | ||
189 | static int __init el3_common_init(struct net_device *dev); | 189 | static int __devinit el3_common_init(struct net_device *dev); |
190 | static void el3_common_remove(struct net_device *dev); | 190 | static void el3_common_remove(struct net_device *dev); |
191 | static ushort id_read_eeprom(int index); | 191 | static ushort id_read_eeprom(int index); |
192 | static ushort read_eeprom(int ioaddr, int index); | 192 | static ushort read_eeprom(int ioaddr, int index); |
@@ -537,7 +537,7 @@ static struct mca_driver el3_mca_driver = { | |||
537 | static int mca_registered; | 537 | static int mca_registered; |
538 | #endif /* CONFIG_MCA */ | 538 | #endif /* CONFIG_MCA */ |
539 | 539 | ||
540 | static int __init el3_common_init(struct net_device *dev) | 540 | static int __devinit el3_common_init(struct net_device *dev) |
541 | { | 541 | { |
542 | struct el3_private *lp = netdev_priv(dev); | 542 | struct el3_private *lp = netdev_priv(dev); |
543 | int err; | 543 | int err; |
diff --git a/drivers/net/amd8111e.c b/drivers/net/amd8111e.c index c54967f7942a..07a6697e3635 100644 --- a/drivers/net/amd8111e.c +++ b/drivers/net/amd8111e.c | |||
@@ -644,10 +644,6 @@ This function frees the transmiter and receiver descriptor rings. | |||
644 | */ | 644 | */ |
645 | static void amd8111e_free_ring(struct amd8111e_priv* lp) | 645 | static void amd8111e_free_ring(struct amd8111e_priv* lp) |
646 | { | 646 | { |
647 | |||
648 | /* Free transmit and receive skbs */ | ||
649 | amd8111e_free_skbs(lp->amd8111e_net_dev); | ||
650 | |||
651 | /* Free transmit and receive descriptor rings */ | 647 | /* Free transmit and receive descriptor rings */ |
652 | if(lp->rx_ring){ | 648 | if(lp->rx_ring){ |
653 | pci_free_consistent(lp->pci_dev, | 649 | pci_free_consistent(lp->pci_dev, |
@@ -833,12 +829,14 @@ static int amd8111e_rx_poll(struct napi_struct *napi, int budget) | |||
833 | 829 | ||
834 | } while(intr0 & RINT0); | 830 | } while(intr0 & RINT0); |
835 | 831 | ||
836 | /* Receive descriptor is empty now */ | 832 | if (rx_pkt_limit > 0) { |
837 | spin_lock_irqsave(&lp->lock, flags); | 833 | /* Receive descriptor is empty now */ |
838 | __netif_rx_complete(dev, napi); | 834 | spin_lock_irqsave(&lp->lock, flags); |
839 | writel(VAL0|RINTEN0, mmio + INTEN0); | 835 | __netif_rx_complete(dev, napi); |
840 | writel(VAL2 | RDMD0, mmio + CMD0); | 836 | writel(VAL0|RINTEN0, mmio + INTEN0); |
841 | spin_unlock_irqrestore(&lp->lock, flags); | 837 | writel(VAL2 | RDMD0, mmio + CMD0); |
838 | spin_unlock_irqrestore(&lp->lock, flags); | ||
839 | } | ||
842 | 840 | ||
843 | rx_not_empty: | 841 | rx_not_empty: |
844 | return num_rx_pkt; | 842 | return num_rx_pkt; |
@@ -1231,7 +1229,9 @@ static int amd8111e_close(struct net_device * dev) | |||
1231 | 1229 | ||
1232 | amd8111e_disable_interrupt(lp); | 1230 | amd8111e_disable_interrupt(lp); |
1233 | amd8111e_stop_chip(lp); | 1231 | amd8111e_stop_chip(lp); |
1234 | amd8111e_free_ring(lp); | 1232 | |
1233 | /* Free transmit and receive skbs */ | ||
1234 | amd8111e_free_skbs(lp->amd8111e_net_dev); | ||
1235 | 1235 | ||
1236 | netif_carrier_off(lp->amd8111e_net_dev); | 1236 | netif_carrier_off(lp->amd8111e_net_dev); |
1237 | 1237 | ||
@@ -1241,6 +1241,7 @@ static int amd8111e_close(struct net_device * dev) | |||
1241 | 1241 | ||
1242 | spin_unlock_irq(&lp->lock); | 1242 | spin_unlock_irq(&lp->lock); |
1243 | free_irq(dev->irq, dev); | 1243 | free_irq(dev->irq, dev); |
1244 | amd8111e_free_ring(lp); | ||
1244 | 1245 | ||
1245 | /* Update the statistics before closing */ | 1246 | /* Update the statistics before closing */ |
1246 | amd8111e_get_stats(dev); | 1247 | amd8111e_get_stats(dev); |
diff --git a/drivers/net/arm/at91_ether.c b/drivers/net/arm/at91_ether.c index 0fa53464efb2..6f431a887e7e 100644 --- a/drivers/net/arm/at91_ether.c +++ b/drivers/net/arm/at91_ether.c | |||
@@ -1080,7 +1080,8 @@ static int __init at91ether_setup(unsigned long phy_type, unsigned short phy_add | |||
1080 | init_timer(&lp->check_timer); | 1080 | init_timer(&lp->check_timer); |
1081 | lp->check_timer.data = (unsigned long)dev; | 1081 | lp->check_timer.data = (unsigned long)dev; |
1082 | lp->check_timer.function = at91ether_check_link; | 1082 | lp->check_timer.function = at91ether_check_link; |
1083 | } | 1083 | } else if (lp->board_data.phy_irq_pin >= 32) |
1084 | gpio_request(lp->board_data.phy_irq_pin, "ethernet_phy"); | ||
1084 | 1085 | ||
1085 | /* Display ethernet banner */ | 1086 | /* Display ethernet banner */ |
1086 | printk(KERN_INFO "%s: AT91 ethernet at 0x%08x int=%d %s%s (%s)\n", | 1087 | printk(KERN_INFO "%s: AT91 ethernet at 0x%08x int=%d %s%s (%s)\n", |
@@ -1167,6 +1168,9 @@ static int __devexit at91ether_remove(struct platform_device *pdev) | |||
1167 | struct net_device *dev = platform_get_drvdata(pdev); | 1168 | struct net_device *dev = platform_get_drvdata(pdev); |
1168 | struct at91_private *lp = netdev_priv(dev); | 1169 | struct at91_private *lp = netdev_priv(dev); |
1169 | 1170 | ||
1171 | if (lp->board_data.phy_irq_pin >= 32) | ||
1172 | gpio_free(lp->board_data.phy_irq_pin); | ||
1173 | |||
1170 | unregister_netdev(dev); | 1174 | unregister_netdev(dev); |
1171 | free_irq(dev->irq, dev); | 1175 | free_irq(dev->irq, dev); |
1172 | dma_free_coherent(NULL, sizeof(struct recv_desc_bufs), lp->dlist, (dma_addr_t)lp->dlist_phys); | 1176 | dma_free_coherent(NULL, sizeof(struct recv_desc_bufs), lp->dlist, (dma_addr_t)lp->dlist_phys); |
diff --git a/drivers/net/atlx/atl1.c b/drivers/net/atlx/atl1.c index 3cf59a7f5a1c..246d92b42636 100644 --- a/drivers/net/atlx/atl1.c +++ b/drivers/net/atlx/atl1.c | |||
@@ -2310,7 +2310,8 @@ static void atl1_tx_queue(struct atl1_adapter *adapter, u16 count, | |||
2310 | if (tpd != ptpd) | 2310 | if (tpd != ptpd) |
2311 | memcpy(tpd, ptpd, sizeof(struct tx_packet_desc)); | 2311 | memcpy(tpd, ptpd, sizeof(struct tx_packet_desc)); |
2312 | tpd->buffer_addr = cpu_to_le64(buffer_info->dma); | 2312 | tpd->buffer_addr = cpu_to_le64(buffer_info->dma); |
2313 | tpd->word2 = (cpu_to_le16(buffer_info->length) & | 2313 | tpd->word2 &= ~(TPD_BUFLEN_MASK << TPD_BUFLEN_SHIFT); |
2314 | tpd->word2 |= (cpu_to_le16(buffer_info->length) & | ||
2314 | TPD_BUFLEN_MASK) << TPD_BUFLEN_SHIFT; | 2315 | TPD_BUFLEN_MASK) << TPD_BUFLEN_SHIFT; |
2315 | 2316 | ||
2316 | /* | 2317 | /* |
@@ -2409,8 +2410,8 @@ static int atl1_xmit_frame(struct sk_buff *skb, struct net_device *netdev) | |||
2409 | vlan_tag = (vlan_tag << 4) | (vlan_tag >> 13) | | 2410 | vlan_tag = (vlan_tag << 4) | (vlan_tag >> 13) | |
2410 | ((vlan_tag >> 9) & 0x8); | 2411 | ((vlan_tag >> 9) & 0x8); |
2411 | ptpd->word3 |= 1 << TPD_INS_VL_TAG_SHIFT; | 2412 | ptpd->word3 |= 1 << TPD_INS_VL_TAG_SHIFT; |
2412 | ptpd->word3 |= (vlan_tag & TPD_VL_TAGGED_MASK) << | 2413 | ptpd->word2 |= (vlan_tag & TPD_VLANTAG_MASK) << |
2413 | TPD_VL_TAGGED_SHIFT; | 2414 | TPD_VLANTAG_SHIFT; |
2414 | } | 2415 | } |
2415 | 2416 | ||
2416 | tso = atl1_tso(adapter, skb, ptpd); | 2417 | tso = atl1_tso(adapter, skb, ptpd); |
diff --git a/drivers/net/atlx/atl1.h b/drivers/net/atlx/atl1.h index a5015b14a429..ffa73fc8d95e 100644 --- a/drivers/net/atlx/atl1.h +++ b/drivers/net/atlx/atl1.h | |||
@@ -504,7 +504,7 @@ struct rx_free_desc { | |||
504 | #define TPD_PKTNT_MASK 0x0001 | 504 | #define TPD_PKTNT_MASK 0x0001 |
505 | #define TPD_PKTINT_SHIFT 15 | 505 | #define TPD_PKTINT_SHIFT 15 |
506 | #define TPD_VLANTAG_MASK 0xFFFF | 506 | #define TPD_VLANTAG_MASK 0xFFFF |
507 | #define TPD_VLAN_SHIFT 16 | 507 | #define TPD_VLANTAG_SHIFT 16 |
508 | 508 | ||
509 | /* tpd word 3 bits 0:13 */ | 509 | /* tpd word 3 bits 0:13 */ |
510 | #define TPD_EOP_MASK 0x0001 | 510 | #define TPD_EOP_MASK 0x0001 |
diff --git a/drivers/net/bonding/bond_alb.c b/drivers/net/bonding/bond_alb.c index ade5f3f6693b..87437c788476 100644 --- a/drivers/net/bonding/bond_alb.c +++ b/drivers/net/bonding/bond_alb.c | |||
@@ -169,11 +169,14 @@ static void tlb_clear_slave(struct bonding *bond, struct slave *slave, int save_ | |||
169 | /* clear slave from tx_hashtbl */ | 169 | /* clear slave from tx_hashtbl */ |
170 | tx_hash_table = BOND_ALB_INFO(bond).tx_hashtbl; | 170 | tx_hash_table = BOND_ALB_INFO(bond).tx_hashtbl; |
171 | 171 | ||
172 | index = SLAVE_TLB_INFO(slave).head; | 172 | /* skip this if we've already freed the tx hash table */ |
173 | while (index != TLB_NULL_INDEX) { | 173 | if (tx_hash_table) { |
174 | u32 next_index = tx_hash_table[index].next; | 174 | index = SLAVE_TLB_INFO(slave).head; |
175 | tlb_init_table_entry(&tx_hash_table[index], save_load); | 175 | while (index != TLB_NULL_INDEX) { |
176 | index = next_index; | 176 | u32 next_index = tx_hash_table[index].next; |
177 | tlb_init_table_entry(&tx_hash_table[index], save_load); | ||
178 | index = next_index; | ||
179 | } | ||
177 | } | 180 | } |
178 | 181 | ||
179 | tlb_init_slave(slave); | 182 | tlb_init_slave(slave); |
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c index 832739f38db4..a3efba59eee9 100644 --- a/drivers/net/bonding/bond_main.c +++ b/drivers/net/bonding/bond_main.c | |||
@@ -1979,6 +1979,20 @@ void bond_destroy(struct bonding *bond) | |||
1979 | unregister_netdevice(bond->dev); | 1979 | unregister_netdevice(bond->dev); |
1980 | } | 1980 | } |
1981 | 1981 | ||
1982 | static void bond_destructor(struct net_device *bond_dev) | ||
1983 | { | ||
1984 | struct bonding *bond = bond_dev->priv; | ||
1985 | |||
1986 | if (bond->wq) | ||
1987 | destroy_workqueue(bond->wq); | ||
1988 | |||
1989 | netif_addr_lock_bh(bond_dev); | ||
1990 | bond_mc_list_destroy(bond); | ||
1991 | netif_addr_unlock_bh(bond_dev); | ||
1992 | |||
1993 | free_netdev(bond_dev); | ||
1994 | } | ||
1995 | |||
1982 | /* | 1996 | /* |
1983 | * First release a slave and than destroy the bond if no more slaves iare left. | 1997 | * First release a slave and than destroy the bond if no more slaves iare left. |
1984 | * Must be under rtnl_lock when this function is called. | 1998 | * Must be under rtnl_lock when this function is called. |
@@ -2376,6 +2390,9 @@ static void bond_miimon_commit(struct bonding *bond) | |||
2376 | continue; | 2390 | continue; |
2377 | 2391 | ||
2378 | case BOND_LINK_DOWN: | 2392 | case BOND_LINK_DOWN: |
2393 | if (slave->link_failure_count < UINT_MAX) | ||
2394 | slave->link_failure_count++; | ||
2395 | |||
2379 | slave->link = BOND_LINK_DOWN; | 2396 | slave->link = BOND_LINK_DOWN; |
2380 | 2397 | ||
2381 | if (bond->params.mode == BOND_MODE_ACTIVEBACKUP || | 2398 | if (bond->params.mode == BOND_MODE_ACTIVEBACKUP || |
@@ -4550,7 +4567,7 @@ static int bond_init(struct net_device *bond_dev, struct bond_params *params) | |||
4550 | 4567 | ||
4551 | bond_set_mode_ops(bond, bond->params.mode); | 4568 | bond_set_mode_ops(bond, bond->params.mode); |
4552 | 4569 | ||
4553 | bond_dev->destructor = free_netdev; | 4570 | bond_dev->destructor = bond_destructor; |
4554 | 4571 | ||
4555 | /* Initialize the device options */ | 4572 | /* Initialize the device options */ |
4556 | bond_dev->tx_queue_len = 0; | 4573 | bond_dev->tx_queue_len = 0; |
@@ -4589,20 +4606,6 @@ static int bond_init(struct net_device *bond_dev, struct bond_params *params) | |||
4589 | return 0; | 4606 | return 0; |
4590 | } | 4607 | } |
4591 | 4608 | ||
4592 | /* De-initialize device specific data. | ||
4593 | * Caller must hold rtnl_lock. | ||
4594 | */ | ||
4595 | static void bond_deinit(struct net_device *bond_dev) | ||
4596 | { | ||
4597 | struct bonding *bond = bond_dev->priv; | ||
4598 | |||
4599 | list_del(&bond->bond_list); | ||
4600 | |||
4601 | #ifdef CONFIG_PROC_FS | ||
4602 | bond_remove_proc_entry(bond); | ||
4603 | #endif | ||
4604 | } | ||
4605 | |||
4606 | static void bond_work_cancel_all(struct bonding *bond) | 4609 | static void bond_work_cancel_all(struct bonding *bond) |
4607 | { | 4610 | { |
4608 | write_lock_bh(&bond->lock); | 4611 | write_lock_bh(&bond->lock); |
@@ -4624,6 +4627,22 @@ static void bond_work_cancel_all(struct bonding *bond) | |||
4624 | cancel_delayed_work(&bond->ad_work); | 4627 | cancel_delayed_work(&bond->ad_work); |
4625 | } | 4628 | } |
4626 | 4629 | ||
4630 | /* De-initialize device specific data. | ||
4631 | * Caller must hold rtnl_lock. | ||
4632 | */ | ||
4633 | static void bond_deinit(struct net_device *bond_dev) | ||
4634 | { | ||
4635 | struct bonding *bond = bond_dev->priv; | ||
4636 | |||
4637 | list_del(&bond->bond_list); | ||
4638 | |||
4639 | bond_work_cancel_all(bond); | ||
4640 | |||
4641 | #ifdef CONFIG_PROC_FS | ||
4642 | bond_remove_proc_entry(bond); | ||
4643 | #endif | ||
4644 | } | ||
4645 | |||
4627 | /* Unregister and free all bond devices. | 4646 | /* Unregister and free all bond devices. |
4628 | * Caller must hold rtnl_lock. | 4647 | * Caller must hold rtnl_lock. |
4629 | */ | 4648 | */ |
@@ -4635,9 +4654,6 @@ static void bond_free_all(void) | |||
4635 | struct net_device *bond_dev = bond->dev; | 4654 | struct net_device *bond_dev = bond->dev; |
4636 | 4655 | ||
4637 | bond_work_cancel_all(bond); | 4656 | bond_work_cancel_all(bond); |
4638 | netif_addr_lock_bh(bond_dev); | ||
4639 | bond_mc_list_destroy(bond); | ||
4640 | netif_addr_unlock_bh(bond_dev); | ||
4641 | /* Release the bonded slaves */ | 4657 | /* Release the bonded slaves */ |
4642 | bond_release_all(bond_dev); | 4658 | bond_release_all(bond_dev); |
4643 | bond_destroy(bond); | 4659 | bond_destroy(bond); |
diff --git a/drivers/net/cris/eth_v10.c b/drivers/net/cris/eth_v10.c index 65d0a9103297..7e8a63106bdf 100644 --- a/drivers/net/cris/eth_v10.c +++ b/drivers/net/cris/eth_v10.c | |||
@@ -32,14 +32,14 @@ | |||
32 | #include <linux/skbuff.h> | 32 | #include <linux/skbuff.h> |
33 | #include <linux/ethtool.h> | 33 | #include <linux/ethtool.h> |
34 | 34 | ||
35 | #include <asm/arch/svinto.h>/* DMA and register descriptions */ | 35 | #include <arch/svinto.h>/* DMA and register descriptions */ |
36 | #include <asm/io.h> /* CRIS_LED_* I/O functions */ | 36 | #include <asm/io.h> /* CRIS_LED_* I/O functions */ |
37 | #include <asm/irq.h> | 37 | #include <asm/irq.h> |
38 | #include <asm/dma.h> | 38 | #include <asm/dma.h> |
39 | #include <asm/system.h> | 39 | #include <asm/system.h> |
40 | #include <asm/ethernet.h> | 40 | #include <asm/ethernet.h> |
41 | #include <asm/cache.h> | 41 | #include <asm/cache.h> |
42 | #include <asm/arch/io_interface_mux.h> | 42 | #include <arch/io_interface_mux.h> |
43 | 43 | ||
44 | //#define ETHDEBUG | 44 | //#define ETHDEBUG |
45 | #define D(x) | 45 | #define D(x) |
diff --git a/drivers/net/ehea/ehea.h b/drivers/net/ehea/ehea.h index 82dd1a891ce7..002d918fb4c7 100644 --- a/drivers/net/ehea/ehea.h +++ b/drivers/net/ehea/ehea.h | |||
@@ -40,7 +40,7 @@ | |||
40 | #include <asm/io.h> | 40 | #include <asm/io.h> |
41 | 41 | ||
42 | #define DRV_NAME "ehea" | 42 | #define DRV_NAME "ehea" |
43 | #define DRV_VERSION "EHEA_0094" | 43 | #define DRV_VERSION "EHEA_0095" |
44 | 44 | ||
45 | /* eHEA capability flags */ | 45 | /* eHEA capability flags */ |
46 | #define DLPAR_PORT_ADD_REM 1 | 46 | #define DLPAR_PORT_ADD_REM 1 |
diff --git a/drivers/net/ehea/ehea_qmr.c b/drivers/net/ehea/ehea_qmr.c index 9b61dc9865d1..9d006878f045 100644 --- a/drivers/net/ehea/ehea_qmr.c +++ b/drivers/net/ehea/ehea_qmr.c | |||
@@ -632,10 +632,13 @@ static void ehea_rebuild_busmap(void) | |||
632 | } | 632 | } |
633 | } | 633 | } |
634 | 634 | ||
635 | static int ehea_update_busmap(unsigned long pfn, unsigned long pgnum, int add) | 635 | static int ehea_update_busmap(unsigned long pfn, unsigned long nr_pages, int add) |
636 | { | 636 | { |
637 | unsigned long i, start_section, end_section; | 637 | unsigned long i, start_section, end_section; |
638 | 638 | ||
639 | if (!nr_pages) | ||
640 | return 0; | ||
641 | |||
639 | if (!ehea_bmap) { | 642 | if (!ehea_bmap) { |
640 | ehea_bmap = kzalloc(sizeof(struct ehea_bmap), GFP_KERNEL); | 643 | ehea_bmap = kzalloc(sizeof(struct ehea_bmap), GFP_KERNEL); |
641 | if (!ehea_bmap) | 644 | if (!ehea_bmap) |
@@ -643,7 +646,7 @@ static int ehea_update_busmap(unsigned long pfn, unsigned long pgnum, int add) | |||
643 | } | 646 | } |
644 | 647 | ||
645 | start_section = (pfn * PAGE_SIZE) / EHEA_SECTSIZE; | 648 | start_section = (pfn * PAGE_SIZE) / EHEA_SECTSIZE; |
646 | end_section = start_section + ((pgnum * PAGE_SIZE) / EHEA_SECTSIZE); | 649 | end_section = start_section + ((nr_pages * PAGE_SIZE) / EHEA_SECTSIZE); |
647 | /* Mark entries as valid or invalid only; address is assigned later */ | 650 | /* Mark entries as valid or invalid only; address is assigned later */ |
648 | for (i = start_section; i < end_section; i++) { | 651 | for (i = start_section; i < end_section; i++) { |
649 | u64 flag; | 652 | u64 flag; |
@@ -692,10 +695,54 @@ int ehea_rem_sect_bmap(unsigned long pfn, unsigned long nr_pages) | |||
692 | return ret; | 695 | return ret; |
693 | } | 696 | } |
694 | 697 | ||
695 | static int ehea_create_busmap_callback(unsigned long pfn, | 698 | static int ehea_is_hugepage(unsigned long pfn) |
696 | unsigned long nr_pages, void *arg) | 699 | { |
700 | int page_order; | ||
701 | |||
702 | if (pfn & EHEA_HUGEPAGE_PFN_MASK) | ||
703 | return 0; | ||
704 | |||
705 | page_order = compound_order(pfn_to_page(pfn)); | ||
706 | if (page_order + PAGE_SHIFT != EHEA_HUGEPAGESHIFT) | ||
707 | return 0; | ||
708 | |||
709 | return 1; | ||
710 | } | ||
711 | |||
712 | static int ehea_create_busmap_callback(unsigned long initial_pfn, | ||
713 | unsigned long total_nr_pages, void *arg) | ||
697 | { | 714 | { |
698 | return ehea_update_busmap(pfn, nr_pages, EHEA_BUSMAP_ADD_SECT); | 715 | int ret; |
716 | unsigned long pfn, start_pfn, end_pfn, nr_pages; | ||
717 | |||
718 | if ((total_nr_pages * PAGE_SIZE) < EHEA_HUGEPAGE_SIZE) | ||
719 | return ehea_update_busmap(initial_pfn, total_nr_pages, | ||
720 | EHEA_BUSMAP_ADD_SECT); | ||
721 | |||
722 | /* Given chunk is >= 16GB -> check for hugepages */ | ||
723 | start_pfn = initial_pfn; | ||
724 | end_pfn = initial_pfn + total_nr_pages; | ||
725 | pfn = start_pfn; | ||
726 | |||
727 | while (pfn < end_pfn) { | ||
728 | if (ehea_is_hugepage(pfn)) { | ||
729 | /* Add mem found in front of the hugepage */ | ||
730 | nr_pages = pfn - start_pfn; | ||
731 | ret = ehea_update_busmap(start_pfn, nr_pages, | ||
732 | EHEA_BUSMAP_ADD_SECT); | ||
733 | if (ret) | ||
734 | return ret; | ||
735 | |||
736 | /* Skip the hugepage */ | ||
737 | pfn += (EHEA_HUGEPAGE_SIZE / PAGE_SIZE); | ||
738 | start_pfn = pfn; | ||
739 | } else | ||
740 | pfn += (EHEA_SECTSIZE / PAGE_SIZE); | ||
741 | } | ||
742 | |||
743 | /* Add mem found behind the hugepage(s) */ | ||
744 | nr_pages = pfn - start_pfn; | ||
745 | return ehea_update_busmap(start_pfn, nr_pages, EHEA_BUSMAP_ADD_SECT); | ||
699 | } | 746 | } |
700 | 747 | ||
701 | int ehea_create_busmap(void) | 748 | int ehea_create_busmap(void) |
diff --git a/drivers/net/ehea/ehea_qmr.h b/drivers/net/ehea/ehea_qmr.h index 1e58dc06b7d2..0817c1e74a19 100644 --- a/drivers/net/ehea/ehea_qmr.h +++ b/drivers/net/ehea/ehea_qmr.h | |||
@@ -40,6 +40,9 @@ | |||
40 | #define EHEA_PAGESIZE (1UL << EHEA_PAGESHIFT) | 40 | #define EHEA_PAGESIZE (1UL << EHEA_PAGESHIFT) |
41 | #define EHEA_SECTSIZE (1UL << 24) | 41 | #define EHEA_SECTSIZE (1UL << 24) |
42 | #define EHEA_PAGES_PER_SECTION (EHEA_SECTSIZE >> EHEA_PAGESHIFT) | 42 | #define EHEA_PAGES_PER_SECTION (EHEA_SECTSIZE >> EHEA_PAGESHIFT) |
43 | #define EHEA_HUGEPAGESHIFT 34 | ||
44 | #define EHEA_HUGEPAGE_SIZE (1UL << EHEA_HUGEPAGESHIFT) | ||
45 | #define EHEA_HUGEPAGE_PFN_MASK ((EHEA_HUGEPAGE_SIZE - 1) >> PAGE_SHIFT) | ||
43 | 46 | ||
44 | #if ((1UL << SECTION_SIZE_BITS) < EHEA_SECTSIZE) | 47 | #if ((1UL << SECTION_SIZE_BITS) < EHEA_SECTSIZE) |
45 | #error eHEA module cannot work if kernel sectionsize < ehea sectionsize | 48 | #error eHEA module cannot work if kernel sectionsize < ehea sectionsize |
diff --git a/drivers/net/gianfar.c b/drivers/net/gianfar.c index 64b201134fdb..83a5cb6aa23b 100644 --- a/drivers/net/gianfar.c +++ b/drivers/net/gianfar.c | |||
@@ -586,6 +586,18 @@ static void gfar_configure_serdes(struct net_device *dev) | |||
586 | struct gfar_mii __iomem *regs = | 586 | struct gfar_mii __iomem *regs = |
587 | (void __iomem *)&priv->regs->gfar_mii_regs; | 587 | (void __iomem *)&priv->regs->gfar_mii_regs; |
588 | int tbipa = gfar_read(&priv->regs->tbipa); | 588 | int tbipa = gfar_read(&priv->regs->tbipa); |
589 | struct mii_bus *bus = gfar_get_miibus(priv); | ||
590 | |||
591 | if (bus) | ||
592 | mutex_lock(&bus->mdio_lock); | ||
593 | |||
594 | /* If the link is already up, we must already be ok, and don't need to | ||
595 | * configure and reset the TBI<->SerDes link. Maybe U-Boot configured | ||
596 | * everything for us? Resetting it takes the link down and requires | ||
597 | * several seconds for it to come back. | ||
598 | */ | ||
599 | if (gfar_local_mdio_read(regs, tbipa, MII_BMSR) & BMSR_LSTATUS) | ||
600 | goto done; | ||
589 | 601 | ||
590 | /* Single clk mode, mii mode off(for serdes communication) */ | 602 | /* Single clk mode, mii mode off(for serdes communication) */ |
591 | gfar_local_mdio_write(regs, tbipa, MII_TBICON, TBICON_CLK_SELECT); | 603 | gfar_local_mdio_write(regs, tbipa, MII_TBICON, TBICON_CLK_SELECT); |
@@ -596,6 +608,10 @@ static void gfar_configure_serdes(struct net_device *dev) | |||
596 | 608 | ||
597 | gfar_local_mdio_write(regs, tbipa, MII_BMCR, BMCR_ANENABLE | | 609 | gfar_local_mdio_write(regs, tbipa, MII_BMCR, BMCR_ANENABLE | |
598 | BMCR_ANRESTART | BMCR_FULLDPLX | BMCR_SPEED1000); | 610 | BMCR_ANRESTART | BMCR_FULLDPLX | BMCR_SPEED1000); |
611 | |||
612 | done: | ||
613 | if (bus) | ||
614 | mutex_unlock(&bus->mdio_lock); | ||
599 | } | 615 | } |
600 | 616 | ||
601 | static void init_registers(struct net_device *dev) | 617 | static void init_registers(struct net_device *dev) |
diff --git a/drivers/net/gianfar_mii.c b/drivers/net/gianfar_mii.c index bf73eea98010..0e2595d24933 100644 --- a/drivers/net/gianfar_mii.c +++ b/drivers/net/gianfar_mii.c | |||
@@ -269,6 +269,27 @@ static struct device_driver gianfar_mdio_driver = { | |||
269 | .remove = gfar_mdio_remove, | 269 | .remove = gfar_mdio_remove, |
270 | }; | 270 | }; |
271 | 271 | ||
272 | static int match_mdio_bus(struct device *dev, void *data) | ||
273 | { | ||
274 | const struct gfar_private *priv = data; | ||
275 | const struct platform_device *pdev = to_platform_device(dev); | ||
276 | |||
277 | return !strcmp(pdev->name, gianfar_mdio_driver.name) && | ||
278 | pdev->id == priv->einfo->mdio_bus; | ||
279 | } | ||
280 | |||
281 | /* Given a gfar_priv structure, find the mii_bus controlled by this device (not | ||
282 | * necessarily the same as the bus the gfar's PHY is on), if one exists. | ||
283 | * Normally only the first gianfar controls a mii_bus. */ | ||
284 | struct mii_bus *gfar_get_miibus(const struct gfar_private *priv) | ||
285 | { | ||
286 | /*const*/ struct device *d; | ||
287 | |||
288 | d = bus_find_device(gianfar_mdio_driver.bus, NULL, (void *)priv, | ||
289 | match_mdio_bus); | ||
290 | return d ? dev_get_drvdata(d) : NULL; | ||
291 | } | ||
292 | |||
272 | int __init gfar_mdio_init(void) | 293 | int __init gfar_mdio_init(void) |
273 | { | 294 | { |
274 | return driver_register(&gianfar_mdio_driver); | 295 | return driver_register(&gianfar_mdio_driver); |
diff --git a/drivers/net/gianfar_mii.h b/drivers/net/gianfar_mii.h index 2af28b16a0e2..02dc970ca1ff 100644 --- a/drivers/net/gianfar_mii.h +++ b/drivers/net/gianfar_mii.h | |||
@@ -18,6 +18,8 @@ | |||
18 | #ifndef __GIANFAR_MII_H | 18 | #ifndef __GIANFAR_MII_H |
19 | #define __GIANFAR_MII_H | 19 | #define __GIANFAR_MII_H |
20 | 20 | ||
21 | struct gfar_private; /* forward ref */ | ||
22 | |||
21 | #define MIIMIND_BUSY 0x00000001 | 23 | #define MIIMIND_BUSY 0x00000001 |
22 | #define MIIMIND_NOTVALID 0x00000004 | 24 | #define MIIMIND_NOTVALID 0x00000004 |
23 | 25 | ||
@@ -44,6 +46,7 @@ int gfar_mdio_write(struct mii_bus *bus, int mii_id, int regnum, u16 value); | |||
44 | int gfar_local_mdio_write(struct gfar_mii __iomem *regs, int mii_id, | 46 | int gfar_local_mdio_write(struct gfar_mii __iomem *regs, int mii_id, |
45 | int regnum, u16 value); | 47 | int regnum, u16 value); |
46 | int gfar_local_mdio_read(struct gfar_mii __iomem *regs, int mii_id, int regnum); | 48 | int gfar_local_mdio_read(struct gfar_mii __iomem *regs, int mii_id, int regnum); |
49 | struct mii_bus *gfar_get_miibus(const struct gfar_private *priv); | ||
47 | int __init gfar_mdio_init(void); | 50 | int __init gfar_mdio_init(void); |
48 | void gfar_mdio_exit(void); | 51 | void gfar_mdio_exit(void); |
49 | #endif /* GIANFAR_PHY_H */ | 52 | #endif /* GIANFAR_PHY_H */ |
diff --git a/drivers/net/ibm_newemac/core.c b/drivers/net/ibm_newemac/core.c index 2ee2622258f5..901212aa37cb 100644 --- a/drivers/net/ibm_newemac/core.c +++ b/drivers/net/ibm_newemac/core.c | |||
@@ -2605,7 +2605,7 @@ static int __devinit emac_init_config(struct emac_instance *dev) | |||
2605 | of_device_is_compatible(np, "ibm,emac-440gr")) | 2605 | of_device_is_compatible(np, "ibm,emac-440gr")) |
2606 | dev->features |= EMAC_FTR_440EP_PHY_CLK_FIX; | 2606 | dev->features |= EMAC_FTR_440EP_PHY_CLK_FIX; |
2607 | if (of_device_is_compatible(np, "ibm,emac-405ez")) { | 2607 | if (of_device_is_compatible(np, "ibm,emac-405ez")) { |
2608 | #ifdef CONFIG_IBM_NEW_EMAC_NO_FLOW_CONTROL | 2608 | #ifdef CONFIG_IBM_NEW_EMAC_NO_FLOW_CTRL |
2609 | dev->features |= EMAC_FTR_NO_FLOW_CONTROL_40x; | 2609 | dev->features |= EMAC_FTR_NO_FLOW_CONTROL_40x; |
2610 | #else | 2610 | #else |
2611 | printk(KERN_ERR "%s: Flow control not disabled!\n", | 2611 | printk(KERN_ERR "%s: Flow control not disabled!\n", |
diff --git a/drivers/net/irda/ks959-sir.c b/drivers/net/irda/ks959-sir.c index 2482d61662a2..2e67ae015d91 100644 --- a/drivers/net/irda/ks959-sir.c +++ b/drivers/net/irda/ks959-sir.c | |||
@@ -118,7 +118,6 @@ | |||
118 | #include <linux/errno.h> | 118 | #include <linux/errno.h> |
119 | #include <linux/init.h> | 119 | #include <linux/init.h> |
120 | #include <linux/slab.h> | 120 | #include <linux/slab.h> |
121 | #include <linux/module.h> | ||
122 | #include <linux/kref.h> | 121 | #include <linux/kref.h> |
123 | #include <linux/usb.h> | 122 | #include <linux/usb.h> |
124 | #include <linux/device.h> | 123 | #include <linux/device.h> |
diff --git a/drivers/net/irda/ksdazzle-sir.c b/drivers/net/irda/ksdazzle-sir.c index 1e0de93fd618..3843b5faba8b 100644 --- a/drivers/net/irda/ksdazzle-sir.c +++ b/drivers/net/irda/ksdazzle-sir.c | |||
@@ -82,7 +82,6 @@ | |||
82 | #include <linux/errno.h> | 82 | #include <linux/errno.h> |
83 | #include <linux/init.h> | 83 | #include <linux/init.h> |
84 | #include <linux/slab.h> | 84 | #include <linux/slab.h> |
85 | #include <linux/module.h> | ||
86 | #include <linux/kref.h> | 85 | #include <linux/kref.h> |
87 | #include <linux/usb.h> | 86 | #include <linux/usb.h> |
88 | #include <linux/device.h> | 87 | #include <linux/device.h> |
diff --git a/drivers/net/loopback.c b/drivers/net/loopback.c index 3b43bfd85a0f..b1ac63ab8c16 100644 --- a/drivers/net/loopback.c +++ b/drivers/net/loopback.c | |||
@@ -76,15 +76,6 @@ static int loopback_xmit(struct sk_buff *skb, struct net_device *dev) | |||
76 | 76 | ||
77 | skb->protocol = eth_type_trans(skb,dev); | 77 | skb->protocol = eth_type_trans(skb,dev); |
78 | 78 | ||
79 | #ifdef LOOPBACK_TSO | ||
80 | if (skb_is_gso(skb)) { | ||
81 | BUG_ON(skb->protocol != htons(ETH_P_IP)); | ||
82 | BUG_ON(ip_hdr(skb)->protocol != IPPROTO_TCP); | ||
83 | |||
84 | emulate_large_send_offload(skb); | ||
85 | return 0; | ||
86 | } | ||
87 | #endif | ||
88 | dev->last_rx = jiffies; | 79 | dev->last_rx = jiffies; |
89 | 80 | ||
90 | /* it's OK to use per_cpu_ptr() because BHs are off */ | 81 | /* it's OK to use per_cpu_ptr() because BHs are off */ |
diff --git a/drivers/net/mlx4/en_main.c b/drivers/net/mlx4/en_main.c index 1b0eebf84f76..4b9794e97a79 100644 --- a/drivers/net/mlx4/en_main.c +++ b/drivers/net/mlx4/en_main.c | |||
@@ -35,7 +35,6 @@ | |||
35 | #include <linux/module.h> | 35 | #include <linux/module.h> |
36 | #include <linux/delay.h> | 36 | #include <linux/delay.h> |
37 | #include <linux/netdevice.h> | 37 | #include <linux/netdevice.h> |
38 | #include <linux/cpumask.h> | ||
39 | 38 | ||
40 | #include <linux/mlx4/driver.h> | 39 | #include <linux/mlx4/driver.h> |
41 | #include <linux/mlx4/device.h> | 40 | #include <linux/mlx4/device.h> |
diff --git a/drivers/net/mlx4/fw.c b/drivers/net/mlx4/fw.c index be09fdb79cb8..cee199ceba2f 100644 --- a/drivers/net/mlx4/fw.c +++ b/drivers/net/mlx4/fw.c | |||
@@ -360,9 +360,9 @@ int mlx4_QUERY_DEV_CAP(struct mlx4_dev *dev, struct mlx4_dev_cap *dev_cap) | |||
360 | #define QUERY_PORT_ETH_MTU_OFFSET 0x02 | 360 | #define QUERY_PORT_ETH_MTU_OFFSET 0x02 |
361 | #define QUERY_PORT_WIDTH_OFFSET 0x06 | 361 | #define QUERY_PORT_WIDTH_OFFSET 0x06 |
362 | #define QUERY_PORT_MAX_GID_PKEY_OFFSET 0x07 | 362 | #define QUERY_PORT_MAX_GID_PKEY_OFFSET 0x07 |
363 | #define QUERY_PORT_MAC_OFFSET 0x08 | ||
364 | #define QUERY_PORT_MAX_MACVLAN_OFFSET 0x0a | 363 | #define QUERY_PORT_MAX_MACVLAN_OFFSET 0x0a |
365 | #define QUERY_PORT_MAX_VL_OFFSET 0x0b | 364 | #define QUERY_PORT_MAX_VL_OFFSET 0x0b |
365 | #define QUERY_PORT_MAC_OFFSET 0x10 | ||
366 | 366 | ||
367 | for (i = 1; i <= dev_cap->num_ports; ++i) { | 367 | for (i = 1; i <= dev_cap->num_ports; ++i) { |
368 | err = mlx4_cmd_box(dev, 0, mailbox->dma, i, 0, MLX4_CMD_QUERY_PORT, | 368 | err = mlx4_cmd_box(dev, 0, mailbox->dma, i, 0, MLX4_CMD_QUERY_PORT, |
diff --git a/drivers/net/myri10ge/myri10ge.c b/drivers/net/myri10ge/myri10ge.c index b1556b2e404c..a5f428bcc0eb 100644 --- a/drivers/net/myri10ge/myri10ge.c +++ b/drivers/net/myri10ge/myri10ge.c | |||
@@ -75,7 +75,7 @@ | |||
75 | #include "myri10ge_mcp.h" | 75 | #include "myri10ge_mcp.h" |
76 | #include "myri10ge_mcp_gen_header.h" | 76 | #include "myri10ge_mcp_gen_header.h" |
77 | 77 | ||
78 | #define MYRI10GE_VERSION_STR "1.4.3-1.371" | 78 | #define MYRI10GE_VERSION_STR "1.4.3-1.375" |
79 | 79 | ||
80 | MODULE_DESCRIPTION("Myricom 10G driver (10GbE)"); | 80 | MODULE_DESCRIPTION("Myricom 10G driver (10GbE)"); |
81 | MODULE_AUTHOR("Maintainer: help@myri.com"); | 81 | MODULE_AUTHOR("Maintainer: help@myri.com"); |
@@ -1393,6 +1393,7 @@ myri10ge_tx_done(struct myri10ge_slice_state *ss, int mcp_index) | |||
1393 | if (tx->req == tx->done) { | 1393 | if (tx->req == tx->done) { |
1394 | tx->queue_active = 0; | 1394 | tx->queue_active = 0; |
1395 | put_be32(htonl(1), tx->send_stop); | 1395 | put_be32(htonl(1), tx->send_stop); |
1396 | mmiowb(); | ||
1396 | } | 1397 | } |
1397 | __netif_tx_unlock(dev_queue); | 1398 | __netif_tx_unlock(dev_queue); |
1398 | } | 1399 | } |
@@ -2864,6 +2865,7 @@ again: | |||
2864 | if ((mgp->dev->real_num_tx_queues > 1) && tx->queue_active == 0) { | 2865 | if ((mgp->dev->real_num_tx_queues > 1) && tx->queue_active == 0) { |
2865 | tx->queue_active = 1; | 2866 | tx->queue_active = 1; |
2866 | put_be32(htonl(1), tx->send_go); | 2867 | put_be32(htonl(1), tx->send_go); |
2868 | mmiowb(); | ||
2867 | } | 2869 | } |
2868 | tx->pkt_start++; | 2870 | tx->pkt_start++; |
2869 | if ((avail - count) < MXGEFW_MAX_SEND_DESC) { | 2871 | if ((avail - count) < MXGEFW_MAX_SEND_DESC) { |
diff --git a/drivers/net/pppoe.c b/drivers/net/pppoe.c index fc6f4b8c64b3..b646e92134dc 100644 --- a/drivers/net/pppoe.c +++ b/drivers/net/pppoe.c | |||
@@ -399,11 +399,11 @@ static int pppoe_rcv(struct sk_buff *skb, | |||
399 | if (skb->len < len) | 399 | if (skb->len < len) |
400 | goto drop; | 400 | goto drop; |
401 | 401 | ||
402 | po = get_item(ph->sid, eth_hdr(skb)->h_source, dev->ifindex); | 402 | if (pskb_trim_rcsum(skb, len)) |
403 | if (!po) | ||
404 | goto drop; | 403 | goto drop; |
405 | 404 | ||
406 | if (pskb_trim_rcsum(skb, len)) | 405 | po = get_item(ph->sid, eth_hdr(skb)->h_source, dev->ifindex); |
406 | if (!po) | ||
407 | goto drop; | 407 | goto drop; |
408 | 408 | ||
409 | return sk_receive_skb(sk_pppox(po), skb, 0); | 409 | return sk_receive_skb(sk_pppox(po), skb, 0); |
diff --git a/drivers/net/smc91x.c b/drivers/net/smc91x.c index c70870e0fd61..6f9895d4e5bd 100644 --- a/drivers/net/smc91x.c +++ b/drivers/net/smc91x.c | |||
@@ -2060,7 +2060,6 @@ static int smc_request_attrib(struct platform_device *pdev, | |||
2060 | struct net_device *ndev) | 2060 | struct net_device *ndev) |
2061 | { | 2061 | { |
2062 | struct resource * res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "smc91x-attrib"); | 2062 | struct resource * res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "smc91x-attrib"); |
2063 | struct smc_local *lp = netdev_priv(ndev); | ||
2064 | 2063 | ||
2065 | if (!res) | 2064 | if (!res) |
2066 | return 0; | 2065 | return 0; |
@@ -2075,7 +2074,6 @@ static void smc_release_attrib(struct platform_device *pdev, | |||
2075 | struct net_device *ndev) | 2074 | struct net_device *ndev) |
2076 | { | 2075 | { |
2077 | struct resource * res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "smc91x-attrib"); | 2076 | struct resource * res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "smc91x-attrib"); |
2078 | struct smc_local *lp = netdev_priv(ndev); | ||
2079 | 2077 | ||
2080 | if (res) | 2078 | if (res) |
2081 | release_mem_region(res->start, ATTRIB_SIZE); | 2079 | release_mem_region(res->start, ATTRIB_SIZE); |
diff --git a/drivers/net/tulip/dmfe.c b/drivers/net/tulip/dmfe.c index 8e46a513a252..c91852f49a48 100644 --- a/drivers/net/tulip/dmfe.c +++ b/drivers/net/tulip/dmfe.c | |||
@@ -420,9 +420,13 @@ static int __devinit dmfe_init_one (struct pci_dev *pdev, | |||
420 | /* Allocate Tx/Rx descriptor memory */ | 420 | /* Allocate Tx/Rx descriptor memory */ |
421 | db->desc_pool_ptr = pci_alloc_consistent(pdev, sizeof(struct tx_desc) * | 421 | db->desc_pool_ptr = pci_alloc_consistent(pdev, sizeof(struct tx_desc) * |
422 | DESC_ALL_CNT + 0x20, &db->desc_pool_dma_ptr); | 422 | DESC_ALL_CNT + 0x20, &db->desc_pool_dma_ptr); |
423 | if (!db->desc_pool_ptr) | ||
424 | goto err_out_res; | ||
423 | 425 | ||
424 | db->buf_pool_ptr = pci_alloc_consistent(pdev, TX_BUF_ALLOC * | 426 | db->buf_pool_ptr = pci_alloc_consistent(pdev, TX_BUF_ALLOC * |
425 | TX_DESC_CNT + 4, &db->buf_pool_dma_ptr); | 427 | TX_DESC_CNT + 4, &db->buf_pool_dma_ptr); |
428 | if (!db->buf_pool_ptr) | ||
429 | goto err_out_free_desc; | ||
426 | 430 | ||
427 | db->first_tx_desc = (struct tx_desc *) db->desc_pool_ptr; | 431 | db->first_tx_desc = (struct tx_desc *) db->desc_pool_ptr; |
428 | db->first_tx_desc_dma = db->desc_pool_dma_ptr; | 432 | db->first_tx_desc_dma = db->desc_pool_dma_ptr; |
@@ -469,7 +473,7 @@ static int __devinit dmfe_init_one (struct pci_dev *pdev, | |||
469 | 473 | ||
470 | err = register_netdev (dev); | 474 | err = register_netdev (dev); |
471 | if (err) | 475 | if (err) |
472 | goto err_out_res; | 476 | goto err_out_free_buf; |
473 | 477 | ||
474 | printk(KERN_INFO "%s: Davicom DM%04lx at pci%s, " | 478 | printk(KERN_INFO "%s: Davicom DM%04lx at pci%s, " |
475 | "%s, irq %d.\n", | 479 | "%s, irq %d.\n", |
@@ -483,6 +487,12 @@ static int __devinit dmfe_init_one (struct pci_dev *pdev, | |||
483 | 487 | ||
484 | return 0; | 488 | return 0; |
485 | 489 | ||
490 | err_out_free_buf: | ||
491 | pci_free_consistent(pdev, TX_BUF_ALLOC * TX_DESC_CNT + 4, | ||
492 | db->buf_pool_ptr, db->buf_pool_dma_ptr); | ||
493 | err_out_free_desc: | ||
494 | pci_free_consistent(pdev, sizeof(struct tx_desc) * DESC_ALL_CNT + 0x20, | ||
495 | db->desc_pool_ptr, db->desc_pool_dma_ptr); | ||
486 | err_out_res: | 496 | err_out_res: |
487 | pci_release_regions(pdev); | 497 | pci_release_regions(pdev); |
488 | err_out_disable: | 498 | err_out_disable: |
diff --git a/drivers/net/tun.c b/drivers/net/tun.c index 6daea0c91862..33b6d1b122fb 100644 --- a/drivers/net/tun.c +++ b/drivers/net/tun.c | |||
@@ -1070,8 +1070,6 @@ static int tun_chr_close(struct inode *inode, struct file *file) | |||
1070 | 1070 | ||
1071 | DBG(KERN_INFO "%s: tun_chr_close\n", tun->dev->name); | 1071 | DBG(KERN_INFO "%s: tun_chr_close\n", tun->dev->name); |
1072 | 1072 | ||
1073 | tun_chr_fasync(-1, file, 0); | ||
1074 | |||
1075 | rtnl_lock(); | 1073 | rtnl_lock(); |
1076 | 1074 | ||
1077 | /* Detach from net device */ | 1075 | /* Detach from net device */ |
diff --git a/drivers/net/usb/dm9601.c b/drivers/net/usb/dm9601.c index 78df2be8a728..db3377dae9d5 100644 --- a/drivers/net/usb/dm9601.c +++ b/drivers/net/usb/dm9601.c | |||
@@ -396,6 +396,20 @@ static void dm9601_set_multicast(struct net_device *net) | |||
396 | dm_write_reg_async(dev, DM_RX_CTRL, rx_ctl); | 396 | dm_write_reg_async(dev, DM_RX_CTRL, rx_ctl); |
397 | } | 397 | } |
398 | 398 | ||
399 | static int dm9601_set_mac_address(struct net_device *net, void *p) | ||
400 | { | ||
401 | struct sockaddr *addr = p; | ||
402 | struct usbnet *dev = netdev_priv(net); | ||
403 | |||
404 | if (!is_valid_ether_addr(addr->sa_data)) | ||
405 | return -EINVAL; | ||
406 | |||
407 | memcpy(net->dev_addr, addr->sa_data, net->addr_len); | ||
408 | dm_write_async(dev, DM_PHY_ADDR, net->addr_len, net->dev_addr); | ||
409 | |||
410 | return 0; | ||
411 | } | ||
412 | |||
399 | static int dm9601_bind(struct usbnet *dev, struct usb_interface *intf) | 413 | static int dm9601_bind(struct usbnet *dev, struct usb_interface *intf) |
400 | { | 414 | { |
401 | int ret; | 415 | int ret; |
@@ -406,6 +420,7 @@ static int dm9601_bind(struct usbnet *dev, struct usb_interface *intf) | |||
406 | 420 | ||
407 | dev->net->do_ioctl = dm9601_ioctl; | 421 | dev->net->do_ioctl = dm9601_ioctl; |
408 | dev->net->set_multicast_list = dm9601_set_multicast; | 422 | dev->net->set_multicast_list = dm9601_set_multicast; |
423 | dev->net->set_mac_address = dm9601_set_mac_address; | ||
409 | dev->net->ethtool_ops = &dm9601_ethtool_ops; | 424 | dev->net->ethtool_ops = &dm9601_ethtool_ops; |
410 | dev->net->hard_header_len += DM_TX_OVERHEAD; | 425 | dev->net->hard_header_len += DM_TX_OVERHEAD; |
411 | dev->hard_mtu = dev->net->mtu + dev->net->hard_header_len; | 426 | dev->hard_mtu = dev->net->mtu + dev->net->hard_header_len; |
diff --git a/drivers/net/via-velocity.c b/drivers/net/via-velocity.c index 2dced383bcfb..3590ea5a902d 100644 --- a/drivers/net/via-velocity.c +++ b/drivers/net/via-velocity.c | |||
@@ -521,7 +521,7 @@ static void __devexit velocity_remove1(struct pci_dev *pdev) | |||
521 | * we don't duplicate code for each option. | 521 | * we don't duplicate code for each option. |
522 | */ | 522 | */ |
523 | 523 | ||
524 | static void __devinit velocity_set_int_opt(int *opt, int val, int min, int max, int def, char *name, char *devname) | 524 | static void __devinit velocity_set_int_opt(int *opt, int val, int min, int max, int def, char *name, const char *devname) |
525 | { | 525 | { |
526 | if (val == -1) | 526 | if (val == -1) |
527 | *opt = def; | 527 | *opt = def; |
@@ -550,7 +550,7 @@ static void __devinit velocity_set_int_opt(int *opt, int val, int min, int max, | |||
550 | * we don't duplicate code for each option. | 550 | * we don't duplicate code for each option. |
551 | */ | 551 | */ |
552 | 552 | ||
553 | static void __devinit velocity_set_bool_opt(u32 * opt, int val, int def, u32 flag, char *name, char *devname) | 553 | static void __devinit velocity_set_bool_opt(u32 * opt, int val, int def, u32 flag, char *name, const char *devname) |
554 | { | 554 | { |
555 | (*opt) &= (~flag); | 555 | (*opt) &= (~flag); |
556 | if (val == -1) | 556 | if (val == -1) |
@@ -576,7 +576,7 @@ static void __devinit velocity_set_bool_opt(u32 * opt, int val, int def, u32 fla | |||
576 | * for the current device | 576 | * for the current device |
577 | */ | 577 | */ |
578 | 578 | ||
579 | static void __devinit velocity_get_options(struct velocity_opt *opts, int index, char *devname) | 579 | static void __devinit velocity_get_options(struct velocity_opt *opts, int index, const char *devname) |
580 | { | 580 | { |
581 | 581 | ||
582 | velocity_set_int_opt(&opts->rx_thresh, rx_thresh[index], RX_THRESH_MIN, RX_THRESH_MAX, RX_THRESH_DEF, "rx_thresh", devname); | 582 | velocity_set_int_opt(&opts->rx_thresh, rx_thresh[index], RX_THRESH_MIN, RX_THRESH_MAX, RX_THRESH_DEF, "rx_thresh", devname); |
@@ -863,6 +863,7 @@ static int __devinit velocity_found1(struct pci_dev *pdev, const struct pci_devi | |||
863 | static int first = 1; | 863 | static int first = 1; |
864 | struct net_device *dev; | 864 | struct net_device *dev; |
865 | int i; | 865 | int i; |
866 | const char *drv_string; | ||
866 | const struct velocity_info_tbl *info = &chip_info_table[ent->driver_data]; | 867 | const struct velocity_info_tbl *info = &chip_info_table[ent->driver_data]; |
867 | struct velocity_info *vptr; | 868 | struct velocity_info *vptr; |
868 | struct mac_regs __iomem * regs; | 869 | struct mac_regs __iomem * regs; |
@@ -935,7 +936,9 @@ static int __devinit velocity_found1(struct pci_dev *pdev, const struct pci_devi | |||
935 | dev->dev_addr[i] = readb(®s->PAR[i]); | 936 | dev->dev_addr[i] = readb(®s->PAR[i]); |
936 | 937 | ||
937 | 938 | ||
938 | velocity_get_options(&vptr->options, velocity_nics, dev->name); | 939 | drv_string = dev_driver_string(&pdev->dev); |
940 | |||
941 | velocity_get_options(&vptr->options, velocity_nics, drv_string); | ||
939 | 942 | ||
940 | /* | 943 | /* |
941 | * Mask out the options cannot be set to the chip | 944 | * Mask out the options cannot be set to the chip |
diff --git a/drivers/net/wan/syncppp.c b/drivers/net/wan/syncppp.c index 327d58589e12..6e92f7b44b1a 100644 --- a/drivers/net/wan/syncppp.c +++ b/drivers/net/wan/syncppp.c | |||
@@ -756,10 +756,11 @@ static void sppp_cisco_input (struct sppp *sp, struct sk_buff *skb) | |||
756 | case CISCO_ADDR_REQ: | 756 | case CISCO_ADDR_REQ: |
757 | /* Stolen from net/ipv4/devinet.c -- SIOCGIFADDR ioctl */ | 757 | /* Stolen from net/ipv4/devinet.c -- SIOCGIFADDR ioctl */ |
758 | { | 758 | { |
759 | struct in_device *in_dev; | ||
760 | struct in_ifaddr *ifa; | ||
761 | __be32 addr = 0, mask = htonl(~0U); /* FIXME: is the mask correct? */ | 759 | __be32 addr = 0, mask = htonl(~0U); /* FIXME: is the mask correct? */ |
762 | #ifdef CONFIG_INET | 760 | #ifdef CONFIG_INET |
761 | struct in_device *in_dev; | ||
762 | struct in_ifaddr *ifa; | ||
763 | |||
763 | rcu_read_lock(); | 764 | rcu_read_lock(); |
764 | if ((in_dev = __in_dev_get_rcu(dev)) != NULL) | 765 | if ((in_dev = __in_dev_get_rcu(dev)) != NULL) |
765 | { | 766 | { |
diff --git a/drivers/net/wan/z85230.c b/drivers/net/wan/z85230.c index ccd9cd35ecbe..5bf7e01ef0e9 100644 --- a/drivers/net/wan/z85230.c +++ b/drivers/net/wan/z85230.c | |||
@@ -695,7 +695,6 @@ EXPORT_SYMBOL(z8530_nop); | |||
695 | * z8530_interrupt - Handle an interrupt from a Z8530 | 695 | * z8530_interrupt - Handle an interrupt from a Z8530 |
696 | * @irq: Interrupt number | 696 | * @irq: Interrupt number |
697 | * @dev_id: The Z8530 device that is interrupting. | 697 | * @dev_id: The Z8530 device that is interrupting. |
698 | * @regs: unused | ||
699 | * | 698 | * |
700 | * A Z85[2]30 device has stuck its hand in the air for attention. | 699 | * A Z85[2]30 device has stuck its hand in the air for attention. |
701 | * We scan both the channels on the chip for events and then call | 700 | * We scan both the channels on the chip for events and then call |
diff --git a/drivers/net/wireless/ath5k/base.c b/drivers/net/wireless/ath5k/base.c index 0f1d6bdd51a2..9e47d727e220 100644 --- a/drivers/net/wireless/ath5k/base.c +++ b/drivers/net/wireless/ath5k/base.c | |||
@@ -661,8 +661,7 @@ ath5k_pci_resume(struct pci_dev *pdev) | |||
661 | { | 661 | { |
662 | struct ieee80211_hw *hw = pci_get_drvdata(pdev); | 662 | struct ieee80211_hw *hw = pci_get_drvdata(pdev); |
663 | struct ath5k_softc *sc = hw->priv; | 663 | struct ath5k_softc *sc = hw->priv; |
664 | struct ath5k_hw *ah = sc->ah; | 664 | int err; |
665 | int i, err; | ||
666 | 665 | ||
667 | pci_restore_state(pdev); | 666 | pci_restore_state(pdev); |
668 | 667 | ||
@@ -688,16 +687,6 @@ ath5k_pci_resume(struct pci_dev *pdev) | |||
688 | goto err_irq; | 687 | goto err_irq; |
689 | ath5k_led_enable(sc); | 688 | ath5k_led_enable(sc); |
690 | 689 | ||
691 | /* | ||
692 | * Reset the key cache since some parts do not | ||
693 | * reset the contents on initial power up or resume. | ||
694 | * | ||
695 | * FIXME: This may need to be revisited when mac80211 becomes | ||
696 | * aware of suspend/resume. | ||
697 | */ | ||
698 | for (i = 0; i < AR5K_KEYTABLE_SIZE; i++) | ||
699 | ath5k_hw_reset_key(ah, i); | ||
700 | |||
701 | return 0; | 690 | return 0; |
702 | err_irq: | 691 | err_irq: |
703 | free_irq(pdev->irq, sc); | 692 | free_irq(pdev->irq, sc); |
@@ -718,7 +707,6 @@ ath5k_attach(struct pci_dev *pdev, struct ieee80211_hw *hw) | |||
718 | struct ath5k_softc *sc = hw->priv; | 707 | struct ath5k_softc *sc = hw->priv; |
719 | struct ath5k_hw *ah = sc->ah; | 708 | struct ath5k_hw *ah = sc->ah; |
720 | u8 mac[ETH_ALEN]; | 709 | u8 mac[ETH_ALEN]; |
721 | unsigned int i; | ||
722 | int ret; | 710 | int ret; |
723 | 711 | ||
724 | ATH5K_DBG(sc, ATH5K_DEBUG_ANY, "devid 0x%x\n", pdev->device); | 712 | ATH5K_DBG(sc, ATH5K_DEBUG_ANY, "devid 0x%x\n", pdev->device); |
@@ -737,13 +725,6 @@ ath5k_attach(struct pci_dev *pdev, struct ieee80211_hw *hw) | |||
737 | __set_bit(ATH_STAT_MRRETRY, sc->status); | 725 | __set_bit(ATH_STAT_MRRETRY, sc->status); |
738 | 726 | ||
739 | /* | 727 | /* |
740 | * Reset the key cache since some parts do not | ||
741 | * reset the contents on initial power up. | ||
742 | */ | ||
743 | for (i = 0; i < AR5K_KEYTABLE_SIZE; i++) | ||
744 | ath5k_hw_reset_key(ah, i); | ||
745 | |||
746 | /* | ||
747 | * Collect the channel list. The 802.11 layer | 728 | * Collect the channel list. The 802.11 layer |
748 | * is resposible for filtering this list based | 729 | * is resposible for filtering this list based |
749 | * on settings like the phy mode and regulatory | 730 | * on settings like the phy mode and regulatory |
@@ -2202,7 +2183,8 @@ ath5k_beacon_config(struct ath5k_softc *sc) | |||
2202 | static int | 2183 | static int |
2203 | ath5k_init(struct ath5k_softc *sc, bool is_resume) | 2184 | ath5k_init(struct ath5k_softc *sc, bool is_resume) |
2204 | { | 2185 | { |
2205 | int ret; | 2186 | struct ath5k_hw *ah = sc->ah; |
2187 | int ret, i; | ||
2206 | 2188 | ||
2207 | mutex_lock(&sc->lock); | 2189 | mutex_lock(&sc->lock); |
2208 | 2190 | ||
@@ -2235,10 +2217,17 @@ ath5k_init(struct ath5k_softc *sc, bool is_resume) | |||
2235 | if (ret) | 2217 | if (ret) |
2236 | goto done; | 2218 | goto done; |
2237 | 2219 | ||
2220 | /* | ||
2221 | * Reset the key cache since some parts do not reset the | ||
2222 | * contents on initial power up or resume from suspend. | ||
2223 | */ | ||
2224 | for (i = 0; i < AR5K_KEYTABLE_SIZE; i++) | ||
2225 | ath5k_hw_reset_key(ah, i); | ||
2226 | |||
2238 | __set_bit(ATH_STAT_STARTED, sc->status); | 2227 | __set_bit(ATH_STAT_STARTED, sc->status); |
2239 | 2228 | ||
2240 | /* Set ack to be sent at low bit-rates */ | 2229 | /* Set ack to be sent at low bit-rates */ |
2241 | ath5k_hw_set_ack_bitrate_high(sc->ah, false); | 2230 | ath5k_hw_set_ack_bitrate_high(ah, false); |
2242 | 2231 | ||
2243 | mod_timer(&sc->calib_tim, round_jiffies(jiffies + | 2232 | mod_timer(&sc->calib_tim, round_jiffies(jiffies + |
2244 | msecs_to_jiffies(ath5k_calinterval * 1000))); | 2233 | msecs_to_jiffies(ath5k_calinterval * 1000))); |
@@ -2953,10 +2942,8 @@ static void ath5k_configure_filter(struct ieee80211_hw *hw, | |||
2953 | sc->opmode != NL80211_IFTYPE_MESH_POINT && | 2942 | sc->opmode != NL80211_IFTYPE_MESH_POINT && |
2954 | test_bit(ATH_STAT_PROMISC, sc->status)) | 2943 | test_bit(ATH_STAT_PROMISC, sc->status)) |
2955 | rfilt |= AR5K_RX_FILTER_PROM; | 2944 | rfilt |= AR5K_RX_FILTER_PROM; |
2956 | if (sc->opmode == NL80211_IFTYPE_STATION || | 2945 | if (sc->opmode == NL80211_IFTYPE_ADHOC) |
2957 | sc->opmode == NL80211_IFTYPE_ADHOC) { | ||
2958 | rfilt |= AR5K_RX_FILTER_BEACON; | 2946 | rfilt |= AR5K_RX_FILTER_BEACON; |
2959 | } | ||
2960 | 2947 | ||
2961 | /* Set filters */ | 2948 | /* Set filters */ |
2962 | ath5k_hw_set_rx_filter(ah,rfilt); | 2949 | ath5k_hw_set_rx_filter(ah,rfilt); |
diff --git a/drivers/net/wireless/ath5k/debug.c b/drivers/net/wireless/ath5k/debug.c index 8f92d670f614..19980cbd5d5f 100644 --- a/drivers/net/wireless/ath5k/debug.c +++ b/drivers/net/wireless/ath5k/debug.c | |||
@@ -339,7 +339,7 @@ static struct { | |||
339 | { ATH5K_DEBUG_BEACON, "beacon", "beacon handling" }, | 339 | { ATH5K_DEBUG_BEACON, "beacon", "beacon handling" }, |
340 | { ATH5K_DEBUG_CALIBRATE, "calib", "periodic calibration" }, | 340 | { ATH5K_DEBUG_CALIBRATE, "calib", "periodic calibration" }, |
341 | { ATH5K_DEBUG_TXPOWER, "txpower", "transmit power setting" }, | 341 | { ATH5K_DEBUG_TXPOWER, "txpower", "transmit power setting" }, |
342 | { ATH5K_DEBUG_LED, "led", "LED mamagement" }, | 342 | { ATH5K_DEBUG_LED, "led", "LED management" }, |
343 | { ATH5K_DEBUG_DUMP_RX, "dumprx", "print received skb content" }, | 343 | { ATH5K_DEBUG_DUMP_RX, "dumprx", "print received skb content" }, |
344 | { ATH5K_DEBUG_DUMP_TX, "dumptx", "print transmit skb content" }, | 344 | { ATH5K_DEBUG_DUMP_TX, "dumptx", "print transmit skb content" }, |
345 | { ATH5K_DEBUG_DUMPBANDS, "dumpbands", "dump bands" }, | 345 | { ATH5K_DEBUG_DUMPBANDS, "dumpbands", "dump bands" }, |
diff --git a/drivers/net/wireless/ath5k/initvals.c b/drivers/net/wireless/ath5k/initvals.c index ea2e1a20b499..ceaa6c475c06 100644 --- a/drivers/net/wireless/ath5k/initvals.c +++ b/drivers/net/wireless/ath5k/initvals.c | |||
@@ -806,6 +806,8 @@ static const struct ath5k_ini_mode ar5212_rf5111_ini_mode_end[] = { | |||
806 | { 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 } }, | 806 | { 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 } }, |
807 | { AR5K_PHY(642), | 807 | { AR5K_PHY(642), |
808 | { 0xd03e6788, 0xd03e6788, 0xd03e6788, 0xd03e6788, 0xd03e6788 } }, | 808 | { 0xd03e6788, 0xd03e6788, 0xd03e6788, 0xd03e6788, 0xd03e6788 } }, |
809 | { 0xa228, | ||
810 | { 0x000001b5, 0x000001b5, 0x000001b5, 0x000001b5, 0x000001b5 } }, | ||
809 | { 0xa23c, | 811 | { 0xa23c, |
810 | { 0x13c889af, 0x13c889af, 0x13c889af, 0x13c889af, 0x13c889af } }, | 812 | { 0x13c889af, 0x13c889af, 0x13c889af, 0x13c889af, 0x13c889af } }, |
811 | }; | 813 | }; |
diff --git a/drivers/net/wireless/ath5k/reset.c b/drivers/net/wireless/ath5k/reset.c index 8f1886834e61..1b6d45b6772d 100644 --- a/drivers/net/wireless/ath5k/reset.c +++ b/drivers/net/wireless/ath5k/reset.c | |||
@@ -537,9 +537,10 @@ int ath5k_hw_reset(struct ath5k_hw *ah, enum nl80211_iftype op_mode, | |||
537 | mdelay(1); | 537 | mdelay(1); |
538 | 538 | ||
539 | /* | 539 | /* |
540 | * Write some more initial register settings | 540 | * Write some more initial register settings for revised chips |
541 | */ | 541 | */ |
542 | if (ah->ah_version == AR5K_AR5212) { | 542 | if (ah->ah_version == AR5K_AR5212 && |
543 | ah->ah_phy_revision > 0x41) { | ||
543 | ath5k_hw_reg_write(ah, 0x0002a002, 0x982c); | 544 | ath5k_hw_reg_write(ah, 0x0002a002, 0x982c); |
544 | 545 | ||
545 | if (channel->hw_value == CHANNEL_G) | 546 | if (channel->hw_value == CHANNEL_G) |
@@ -558,19 +559,10 @@ int ath5k_hw_reset(struct ath5k_hw *ah, enum nl80211_iftype op_mode, | |||
558 | else | 559 | else |
559 | ath5k_hw_reg_write(ah, 0x00000000, 0x994c); | 560 | ath5k_hw_reg_write(ah, 0x00000000, 0x994c); |
560 | 561 | ||
561 | /* Some bits are disabled here, we know nothing about | 562 | /* Got this from legacy-hal */ |
562 | * register 0xa228 yet, most of the times this ends up | 563 | AR5K_REG_DISABLE_BITS(ah, 0xa228, 0x200); |
563 | * with a value 0x9b5 -haven't seen any dump with | 564 | |
564 | * a different value- */ | 565 | AR5K_REG_MASKED_BITS(ah, 0xa228, 0x800, 0xfffe03ff); |
565 | /* Got this from decompiling binary HAL */ | ||
566 | data = ath5k_hw_reg_read(ah, 0xa228); | ||
567 | data &= 0xfffffdff; | ||
568 | ath5k_hw_reg_write(ah, data, 0xa228); | ||
569 | |||
570 | data = ath5k_hw_reg_read(ah, 0xa228); | ||
571 | data &= 0xfffe03ff; | ||
572 | ath5k_hw_reg_write(ah, data, 0xa228); | ||
573 | data = 0; | ||
574 | 566 | ||
575 | /* Just write 0x9b5 ? */ | 567 | /* Just write 0x9b5 ? */ |
576 | /* ath5k_hw_reg_write(ah, 0x000009b5, 0xa228); */ | 568 | /* ath5k_hw_reg_write(ah, 0x000009b5, 0xa228); */ |
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn.c b/drivers/net/wireless/iwlwifi/iwl-agn.c index 24a1aeb6448f..321dbc8c034a 100644 --- a/drivers/net/wireless/iwlwifi/iwl-agn.c +++ b/drivers/net/wireless/iwlwifi/iwl-agn.c | |||
@@ -2090,7 +2090,6 @@ static void iwl_alive_start(struct iwl_priv *priv) | |||
2090 | iwl4965_error_recovery(priv); | 2090 | iwl4965_error_recovery(priv); |
2091 | 2091 | ||
2092 | iwl_power_update_mode(priv, 1); | 2092 | iwl_power_update_mode(priv, 1); |
2093 | ieee80211_notify_mac(priv->hw, IEEE80211_NOTIFY_RE_ASSOC); | ||
2094 | 2093 | ||
2095 | if (test_and_clear_bit(STATUS_MODE_PENDING, &priv->status)) | 2094 | if (test_and_clear_bit(STATUS_MODE_PENDING, &priv->status)) |
2096 | iwl4965_set_mode(priv, priv->iw_mode); | 2095 | iwl4965_set_mode(priv, priv->iw_mode); |
@@ -2342,6 +2341,7 @@ static void iwl_bg_alive_start(struct work_struct *data) | |||
2342 | mutex_lock(&priv->mutex); | 2341 | mutex_lock(&priv->mutex); |
2343 | iwl_alive_start(priv); | 2342 | iwl_alive_start(priv); |
2344 | mutex_unlock(&priv->mutex); | 2343 | mutex_unlock(&priv->mutex); |
2344 | ieee80211_notify_mac(priv->hw, IEEE80211_NOTIFY_RE_ASSOC); | ||
2345 | } | 2345 | } |
2346 | 2346 | ||
2347 | static void iwl4965_bg_rf_kill(struct work_struct *work) | 2347 | static void iwl4965_bg_rf_kill(struct work_struct *work) |
diff --git a/drivers/net/wireless/libertas/cmd.c b/drivers/net/wireless/libertas/cmd.c index 297696de2da0..8265c7d25edc 100644 --- a/drivers/net/wireless/libertas/cmd.c +++ b/drivers/net/wireless/libertas/cmd.c | |||
@@ -605,9 +605,9 @@ int lbs_get_tx_power(struct lbs_private *priv, s16 *curlevel, s16 *minlevel, | |||
605 | if (ret == 0) { | 605 | if (ret == 0) { |
606 | *curlevel = le16_to_cpu(cmd.curlevel); | 606 | *curlevel = le16_to_cpu(cmd.curlevel); |
607 | if (minlevel) | 607 | if (minlevel) |
608 | *minlevel = le16_to_cpu(cmd.minlevel); | 608 | *minlevel = cmd.minlevel; |
609 | if (maxlevel) | 609 | if (maxlevel) |
610 | *maxlevel = le16_to_cpu(cmd.maxlevel); | 610 | *maxlevel = cmd.maxlevel; |
611 | } | 611 | } |
612 | 612 | ||
613 | lbs_deb_leave(LBS_DEB_CMD); | 613 | lbs_deb_leave(LBS_DEB_CMD); |
diff --git a/drivers/net/wireless/libertas/scan.c b/drivers/net/wireless/libertas/scan.c index 8f66903641b9..22c4c6110521 100644 --- a/drivers/net/wireless/libertas/scan.c +++ b/drivers/net/wireless/libertas/scan.c | |||
@@ -598,8 +598,8 @@ static int lbs_process_bss(struct bss_descriptor *bss, | |||
598 | 598 | ||
599 | switch (elem->id) { | 599 | switch (elem->id) { |
600 | case MFIE_TYPE_SSID: | 600 | case MFIE_TYPE_SSID: |
601 | bss->ssid_len = elem->len; | 601 | bss->ssid_len = min_t(int, 32, elem->len); |
602 | memcpy(bss->ssid, elem->data, elem->len); | 602 | memcpy(bss->ssid, elem->data, bss->ssid_len); |
603 | lbs_deb_scan("got SSID IE: '%s', len %u\n", | 603 | lbs_deb_scan("got SSID IE: '%s', len %u\n", |
604 | escape_essid(bss->ssid, bss->ssid_len), | 604 | escape_essid(bss->ssid, bss->ssid_len), |
605 | bss->ssid_len); | 605 | bss->ssid_len); |
diff --git a/drivers/net/wireless/p54/p54common.c b/drivers/net/wireless/p54/p54common.c index 2d022f83774c..827ca0384a4c 100644 --- a/drivers/net/wireless/p54/p54common.c +++ b/drivers/net/wireless/p54/p54common.c | |||
@@ -319,7 +319,7 @@ static int p54_parse_eeprom(struct ieee80211_hw *dev, void *eeprom, int len) | |||
319 | void *tmp; | 319 | void *tmp; |
320 | int err; | 320 | int err; |
321 | u8 *end = (u8 *)eeprom + len; | 321 | u8 *end = (u8 *)eeprom + len; |
322 | u16 synth; | 322 | u16 synth = 0; |
323 | DECLARE_MAC_BUF(mac); | 323 | DECLARE_MAC_BUF(mac); |
324 | 324 | ||
325 | wrap = (struct eeprom_pda_wrap *) eeprom; | 325 | wrap = (struct eeprom_pda_wrap *) eeprom; |
@@ -422,7 +422,8 @@ static int p54_parse_eeprom(struct ieee80211_hw *dev, void *eeprom, int len) | |||
422 | entry = (void *)entry + (entry_len + 1)*2; | 422 | entry = (void *)entry + (entry_len + 1)*2; |
423 | } | 423 | } |
424 | 424 | ||
425 | if (!priv->iq_autocal || !priv->output_limit || !priv->curve_data) { | 425 | if (!synth || !priv->iq_autocal || !priv->output_limit || |
426 | !priv->curve_data) { | ||
426 | printk(KERN_ERR "p54: not all required entries found in eeprom!\n"); | 427 | printk(KERN_ERR "p54: not all required entries found in eeprom!\n"); |
427 | err = -EINVAL; | 428 | err = -EINVAL; |
428 | goto err; | 429 | goto err; |
diff --git a/drivers/net/wireless/p54/p54pci.c b/drivers/net/wireless/p54/p54pci.c index 1c2a02a741af..88b3cad8b65e 100644 --- a/drivers/net/wireless/p54/p54pci.c +++ b/drivers/net/wireless/p54/p54pci.c | |||
@@ -346,68 +346,6 @@ static void p54p_tx(struct ieee80211_hw *dev, struct p54_control_hdr *data, | |||
346 | printk(KERN_INFO "%s: tx overflow.\n", wiphy_name(dev->wiphy)); | 346 | printk(KERN_INFO "%s: tx overflow.\n", wiphy_name(dev->wiphy)); |
347 | } | 347 | } |
348 | 348 | ||
349 | static int p54p_open(struct ieee80211_hw *dev) | ||
350 | { | ||
351 | struct p54p_priv *priv = dev->priv; | ||
352 | int err; | ||
353 | |||
354 | init_completion(&priv->boot_comp); | ||
355 | err = request_irq(priv->pdev->irq, &p54p_interrupt, | ||
356 | IRQF_SHARED, "p54pci", dev); | ||
357 | if (err) { | ||
358 | printk(KERN_ERR "%s: failed to register IRQ handler\n", | ||
359 | wiphy_name(dev->wiphy)); | ||
360 | return err; | ||
361 | } | ||
362 | |||
363 | memset(priv->ring_control, 0, sizeof(*priv->ring_control)); | ||
364 | err = p54p_upload_firmware(dev); | ||
365 | if (err) { | ||
366 | free_irq(priv->pdev->irq, dev); | ||
367 | return err; | ||
368 | } | ||
369 | priv->rx_idx_data = priv->tx_idx_data = 0; | ||
370 | priv->rx_idx_mgmt = priv->tx_idx_mgmt = 0; | ||
371 | |||
372 | p54p_refill_rx_ring(dev, 0, priv->ring_control->rx_data, | ||
373 | ARRAY_SIZE(priv->ring_control->rx_data), priv->rx_buf_data); | ||
374 | |||
375 | p54p_refill_rx_ring(dev, 2, priv->ring_control->rx_mgmt, | ||
376 | ARRAY_SIZE(priv->ring_control->rx_mgmt), priv->rx_buf_mgmt); | ||
377 | |||
378 | P54P_WRITE(ring_control_base, cpu_to_le32(priv->ring_control_dma)); | ||
379 | P54P_READ(ring_control_base); | ||
380 | wmb(); | ||
381 | udelay(10); | ||
382 | |||
383 | P54P_WRITE(int_enable, cpu_to_le32(ISL38XX_INT_IDENT_INIT)); | ||
384 | P54P_READ(int_enable); | ||
385 | wmb(); | ||
386 | udelay(10); | ||
387 | |||
388 | P54P_WRITE(dev_int, cpu_to_le32(ISL38XX_DEV_INT_RESET)); | ||
389 | P54P_READ(dev_int); | ||
390 | |||
391 | if (!wait_for_completion_interruptible_timeout(&priv->boot_comp, HZ)) { | ||
392 | printk(KERN_ERR "%s: Cannot boot firmware!\n", | ||
393 | wiphy_name(dev->wiphy)); | ||
394 | free_irq(priv->pdev->irq, dev); | ||
395 | return -ETIMEDOUT; | ||
396 | } | ||
397 | |||
398 | P54P_WRITE(int_enable, cpu_to_le32(ISL38XX_INT_IDENT_UPDATE)); | ||
399 | P54P_READ(int_enable); | ||
400 | wmb(); | ||
401 | udelay(10); | ||
402 | |||
403 | P54P_WRITE(dev_int, cpu_to_le32(ISL38XX_DEV_INT_UPDATE)); | ||
404 | P54P_READ(dev_int); | ||
405 | wmb(); | ||
406 | udelay(10); | ||
407 | |||
408 | return 0; | ||
409 | } | ||
410 | |||
411 | static void p54p_stop(struct ieee80211_hw *dev) | 349 | static void p54p_stop(struct ieee80211_hw *dev) |
412 | { | 350 | { |
413 | struct p54p_priv *priv = dev->priv; | 351 | struct p54p_priv *priv = dev->priv; |
@@ -474,6 +412,68 @@ static void p54p_stop(struct ieee80211_hw *dev) | |||
474 | memset(ring_control, 0, sizeof(*ring_control)); | 412 | memset(ring_control, 0, sizeof(*ring_control)); |
475 | } | 413 | } |
476 | 414 | ||
415 | static int p54p_open(struct ieee80211_hw *dev) | ||
416 | { | ||
417 | struct p54p_priv *priv = dev->priv; | ||
418 | int err; | ||
419 | |||
420 | init_completion(&priv->boot_comp); | ||
421 | err = request_irq(priv->pdev->irq, &p54p_interrupt, | ||
422 | IRQF_SHARED, "p54pci", dev); | ||
423 | if (err) { | ||
424 | printk(KERN_ERR "%s: failed to register IRQ handler\n", | ||
425 | wiphy_name(dev->wiphy)); | ||
426 | return err; | ||
427 | } | ||
428 | |||
429 | memset(priv->ring_control, 0, sizeof(*priv->ring_control)); | ||
430 | err = p54p_upload_firmware(dev); | ||
431 | if (err) { | ||
432 | free_irq(priv->pdev->irq, dev); | ||
433 | return err; | ||
434 | } | ||
435 | priv->rx_idx_data = priv->tx_idx_data = 0; | ||
436 | priv->rx_idx_mgmt = priv->tx_idx_mgmt = 0; | ||
437 | |||
438 | p54p_refill_rx_ring(dev, 0, priv->ring_control->rx_data, | ||
439 | ARRAY_SIZE(priv->ring_control->rx_data), priv->rx_buf_data); | ||
440 | |||
441 | p54p_refill_rx_ring(dev, 2, priv->ring_control->rx_mgmt, | ||
442 | ARRAY_SIZE(priv->ring_control->rx_mgmt), priv->rx_buf_mgmt); | ||
443 | |||
444 | P54P_WRITE(ring_control_base, cpu_to_le32(priv->ring_control_dma)); | ||
445 | P54P_READ(ring_control_base); | ||
446 | wmb(); | ||
447 | udelay(10); | ||
448 | |||
449 | P54P_WRITE(int_enable, cpu_to_le32(ISL38XX_INT_IDENT_INIT)); | ||
450 | P54P_READ(int_enable); | ||
451 | wmb(); | ||
452 | udelay(10); | ||
453 | |||
454 | P54P_WRITE(dev_int, cpu_to_le32(ISL38XX_DEV_INT_RESET)); | ||
455 | P54P_READ(dev_int); | ||
456 | |||
457 | if (!wait_for_completion_interruptible_timeout(&priv->boot_comp, HZ)) { | ||
458 | printk(KERN_ERR "%s: Cannot boot firmware!\n", | ||
459 | wiphy_name(dev->wiphy)); | ||
460 | p54p_stop(dev); | ||
461 | return -ETIMEDOUT; | ||
462 | } | ||
463 | |||
464 | P54P_WRITE(int_enable, cpu_to_le32(ISL38XX_INT_IDENT_UPDATE)); | ||
465 | P54P_READ(int_enable); | ||
466 | wmb(); | ||
467 | udelay(10); | ||
468 | |||
469 | P54P_WRITE(dev_int, cpu_to_le32(ISL38XX_DEV_INT_UPDATE)); | ||
470 | P54P_READ(dev_int); | ||
471 | wmb(); | ||
472 | udelay(10); | ||
473 | |||
474 | return 0; | ||
475 | } | ||
476 | |||
477 | static int __devinit p54p_probe(struct pci_dev *pdev, | 477 | static int __devinit p54p_probe(struct pci_dev *pdev, |
478 | const struct pci_device_id *id) | 478 | const struct pci_device_id *id) |
479 | { | 479 | { |
@@ -556,11 +556,13 @@ static int __devinit p54p_probe(struct pci_dev *pdev, | |||
556 | spin_lock_init(&priv->lock); | 556 | spin_lock_init(&priv->lock); |
557 | tasklet_init(&priv->rx_tasklet, p54p_rx_tasklet, (unsigned long)dev); | 557 | tasklet_init(&priv->rx_tasklet, p54p_rx_tasklet, (unsigned long)dev); |
558 | 558 | ||
559 | p54p_open(dev); | 559 | err = p54p_open(dev); |
560 | if (err) | ||
561 | goto err_free_common; | ||
560 | err = p54_read_eeprom(dev); | 562 | err = p54_read_eeprom(dev); |
561 | p54p_stop(dev); | 563 | p54p_stop(dev); |
562 | if (err) | 564 | if (err) |
563 | goto err_free_desc; | 565 | goto err_free_common; |
564 | 566 | ||
565 | err = ieee80211_register_hw(dev); | 567 | err = ieee80211_register_hw(dev); |
566 | if (err) { | 568 | if (err) { |
@@ -573,8 +575,6 @@ static int __devinit p54p_probe(struct pci_dev *pdev, | |||
573 | 575 | ||
574 | err_free_common: | 576 | err_free_common: |
575 | p54_free_common(dev); | 577 | p54_free_common(dev); |
576 | |||
577 | err_free_desc: | ||
578 | pci_free_consistent(pdev, sizeof(*priv->ring_control), | 578 | pci_free_consistent(pdev, sizeof(*priv->ring_control), |
579 | priv->ring_control, priv->ring_control_dma); | 579 | priv->ring_control, priv->ring_control_dma); |
580 | 580 | ||
diff --git a/drivers/net/wireless/rt2x00/Kconfig b/drivers/net/wireless/rt2x00/Kconfig index f839ce044afd..95511ac22470 100644 --- a/drivers/net/wireless/rt2x00/Kconfig +++ b/drivers/net/wireless/rt2x00/Kconfig | |||
@@ -1,5 +1,5 @@ | |||
1 | menuconfig RT2X00 | 1 | menuconfig RT2X00 |
2 | bool "Ralink driver support" | 2 | tristate "Ralink driver support" |
3 | depends on MAC80211 && WLAN_80211 && EXPERIMENTAL | 3 | depends on MAC80211 && WLAN_80211 && EXPERIMENTAL |
4 | ---help--- | 4 | ---help--- |
5 | This will enable the experimental support for the Ralink drivers, | 5 | This will enable the experimental support for the Ralink drivers, |