aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/amd8111e.c14
-rw-r--r--drivers/net/ehea/ehea.h2
-rw-r--r--drivers/net/ehea/ehea_qmr.c57
-rw-r--r--drivers/net/ehea/ehea_qmr.h3
-rw-r--r--drivers/net/ibm_newemac/core.c2
-rw-r--r--drivers/net/mlx4/en_main.c1
-rw-r--r--drivers/net/mlx4/fw.c2
-rw-r--r--drivers/net/tulip/dmfe.c12
-rw-r--r--drivers/net/usb/dm9601.c15
-rw-r--r--drivers/net/via-velocity.c11
-rw-r--r--drivers/net/wan/syncppp.c5
-rw-r--r--drivers/net/wireless/ath5k/base.c33
-rw-r--r--drivers/net/wireless/p54/p54common.c5
-rw-r--r--drivers/net/wireless/p54/p54pci.c132
14 files changed, 182 insertions, 112 deletions
diff --git a/drivers/net/amd8111e.c b/drivers/net/amd8111e.c
index c54967f7942a..ba1be0b3a8c8 100644
--- a/drivers/net/amd8111e.c
+++ b/drivers/net/amd8111e.c
@@ -833,12 +833,14 @@ static int amd8111e_rx_poll(struct napi_struct *napi, int budget)
833 833
834 } while(intr0 & RINT0); 834 } while(intr0 & RINT0);
835 835
836 /* Receive descriptor is empty now */ 836 if (rx_pkt_limit > 0) {
837 spin_lock_irqsave(&lp->lock, flags); 837 /* Receive descriptor is empty now */
838 __netif_rx_complete(dev, napi); 838 spin_lock_irqsave(&lp->lock, flags);
839 writel(VAL0|RINTEN0, mmio + INTEN0); 839 __netif_rx_complete(dev, napi);
840 writel(VAL2 | RDMD0, mmio + CMD0); 840 writel(VAL0|RINTEN0, mmio + INTEN0);
841 spin_unlock_irqrestore(&lp->lock, flags); 841 writel(VAL2 | RDMD0, mmio + CMD0);
842 spin_unlock_irqrestore(&lp->lock, flags);
843 }
842 844
843rx_not_empty: 845rx_not_empty:
844 return num_rx_pkt; 846 return num_rx_pkt;
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
635static int ehea_update_busmap(unsigned long pfn, unsigned long pgnum, int add) 635static 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
695static int ehea_create_busmap_callback(unsigned long pfn, 698static 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
712static 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
701int ehea_create_busmap(void) 748int 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/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/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/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
490err_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);
493err_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);
486err_out_res: 496err_out_res:
487 pci_release_regions(pdev); 497 pci_release_regions(pdev);
488err_out_disable: 498err_out_disable:
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
399static 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
399static int dm9601_bind(struct usbnet *dev, struct usb_interface *intf) 413static 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
524static void __devinit velocity_set_int_opt(int *opt, int val, int min, int max, int def, char *name, char *devname) 524static 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
553static void __devinit velocity_set_bool_opt(u32 * opt, int val, int def, u32 flag, char *name, char *devname) 553static 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
579static void __devinit velocity_get_options(struct velocity_opt *opts, int index, char *devname) 579static 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(&regs->PAR[i]); 936 dev->dev_addr[i] = readb(&regs->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/wireless/ath5k/base.c b/drivers/net/wireless/ath5k/base.c
index 0f1d6bdd51a2..cfd4d052d666 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;
702err_irq: 691err_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)
2202static int 2183static int
2203ath5k_init(struct ath5k_softc *sc, bool is_resume) 2184ath5k_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)));
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
349static 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
411static void p54p_stop(struct ieee80211_hw *dev) 349static 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
415static 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
477static int __devinit p54p_probe(struct pci_dev *pdev, 477static 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