diff options
Diffstat (limited to 'drivers/net/wireless/bcm43xx/bcm43xx_main.c')
-rw-r--r-- | drivers/net/wireless/bcm43xx/bcm43xx_main.c | 207 |
1 files changed, 120 insertions, 87 deletions
diff --git a/drivers/net/wireless/bcm43xx/bcm43xx_main.c b/drivers/net/wireless/bcm43xx/bcm43xx_main.c index a1b783813d8e..5b3c27359a18 100644 --- a/drivers/net/wireless/bcm43xx/bcm43xx_main.c +++ b/drivers/net/wireless/bcm43xx/bcm43xx_main.c | |||
@@ -130,6 +130,10 @@ MODULE_PARM_DESC(fwpostfix, "Postfix for .fw files. Useful for debugging."); | |||
130 | { PCI_VENDOR_ID_BROADCOM, 0x4301, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, | 130 | { PCI_VENDOR_ID_BROADCOM, 0x4301, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, |
131 | /* Broadcom 4307 802.11b */ | 131 | /* Broadcom 4307 802.11b */ |
132 | { PCI_VENDOR_ID_BROADCOM, 0x4307, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, | 132 | { PCI_VENDOR_ID_BROADCOM, 0x4307, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, |
133 | /* Broadcom 4311 802.11(a)/b/g */ | ||
134 | { PCI_VENDOR_ID_BROADCOM, 0x4311, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, | ||
135 | /* Broadcom 4312 802.11a/b/g */ | ||
136 | { PCI_VENDOR_ID_BROADCOM, 0x4312, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, | ||
133 | /* Broadcom 4318 802.11b/g */ | 137 | /* Broadcom 4318 802.11b/g */ |
134 | { PCI_VENDOR_ID_BROADCOM, 0x4318, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, | 138 | { PCI_VENDOR_ID_BROADCOM, 0x4318, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, |
135 | /* Broadcom 4319 802.11a/b/g */ | 139 | /* Broadcom 4319 802.11a/b/g */ |
@@ -2600,8 +2604,9 @@ static int bcm43xx_probe_cores(struct bcm43xx_private *bcm) | |||
2600 | /* fetch sb_id_hi from core information registers */ | 2604 | /* fetch sb_id_hi from core information registers */ |
2601 | sb_id_hi = bcm43xx_read32(bcm, BCM43xx_CIR_SB_ID_HI); | 2605 | sb_id_hi = bcm43xx_read32(bcm, BCM43xx_CIR_SB_ID_HI); |
2602 | 2606 | ||
2603 | core_id = (sb_id_hi & 0xFFF0) >> 4; | 2607 | core_id = (sb_id_hi & 0x8FF0) >> 4; |
2604 | core_rev = (sb_id_hi & 0xF); | 2608 | core_rev = (sb_id_hi & 0x7000) >> 8; |
2609 | core_rev |= (sb_id_hi & 0xF); | ||
2605 | core_vendor = (sb_id_hi & 0xFFFF0000) >> 16; | 2610 | core_vendor = (sb_id_hi & 0xFFFF0000) >> 16; |
2606 | 2611 | ||
2607 | /* if present, chipcommon is always core 0; read the chipid from it */ | 2612 | /* if present, chipcommon is always core 0; read the chipid from it */ |
@@ -2679,14 +2684,10 @@ static int bcm43xx_probe_cores(struct bcm43xx_private *bcm) | |||
2679 | bcm->chip_id, bcm->chip_rev); | 2684 | bcm->chip_id, bcm->chip_rev); |
2680 | dprintk(KERN_INFO PFX "Number of cores: %d\n", core_count); | 2685 | dprintk(KERN_INFO PFX "Number of cores: %d\n", core_count); |
2681 | if (bcm->core_chipcommon.available) { | 2686 | if (bcm->core_chipcommon.available) { |
2682 | dprintk(KERN_INFO PFX "Core 0: ID 0x%x, rev 0x%x, vendor 0x%x, %s\n", | 2687 | dprintk(KERN_INFO PFX "Core 0: ID 0x%x, rev 0x%x, vendor 0x%x\n", |
2683 | core_id, core_rev, core_vendor, | 2688 | core_id, core_rev, core_vendor); |
2684 | bcm43xx_core_enabled(bcm) ? "enabled" : "disabled"); | ||
2685 | } | ||
2686 | |||
2687 | if (bcm->core_chipcommon.available) | ||
2688 | current_core = 1; | 2689 | current_core = 1; |
2689 | else | 2690 | } else |
2690 | current_core = 0; | 2691 | current_core = 0; |
2691 | for ( ; current_core < core_count; current_core++) { | 2692 | for ( ; current_core < core_count; current_core++) { |
2692 | struct bcm43xx_coreinfo *core; | 2693 | struct bcm43xx_coreinfo *core; |
@@ -2704,13 +2705,13 @@ static int bcm43xx_probe_cores(struct bcm43xx_private *bcm) | |||
2704 | core_rev = (sb_id_hi & 0xF); | 2705 | core_rev = (sb_id_hi & 0xF); |
2705 | core_vendor = (sb_id_hi & 0xFFFF0000) >> 16; | 2706 | core_vendor = (sb_id_hi & 0xFFFF0000) >> 16; |
2706 | 2707 | ||
2707 | dprintk(KERN_INFO PFX "Core %d: ID 0x%x, rev 0x%x, vendor 0x%x, %s\n", | 2708 | dprintk(KERN_INFO PFX "Core %d: ID 0x%x, rev 0x%x, vendor 0x%x\n", |
2708 | current_core, core_id, core_rev, core_vendor, | 2709 | current_core, core_id, core_rev, core_vendor); |
2709 | bcm43xx_core_enabled(bcm) ? "enabled" : "disabled" ); | ||
2710 | 2710 | ||
2711 | core = NULL; | 2711 | core = NULL; |
2712 | switch (core_id) { | 2712 | switch (core_id) { |
2713 | case BCM43xx_COREID_PCI: | 2713 | case BCM43xx_COREID_PCI: |
2714 | case BCM43xx_COREID_PCIE: | ||
2714 | core = &bcm->core_pci; | 2715 | core = &bcm->core_pci; |
2715 | if (core->available) { | 2716 | if (core->available) { |
2716 | printk(KERN_WARNING PFX "Multiple PCI cores found.\n"); | 2717 | printk(KERN_WARNING PFX "Multiple PCI cores found.\n"); |
@@ -2749,12 +2750,12 @@ static int bcm43xx_probe_cores(struct bcm43xx_private *bcm) | |||
2749 | case 6: | 2750 | case 6: |
2750 | case 7: | 2751 | case 7: |
2751 | case 9: | 2752 | case 9: |
2753 | case 10: | ||
2752 | break; | 2754 | break; |
2753 | default: | 2755 | default: |
2754 | printk(KERN_ERR PFX "Error: Unsupported 80211 core revision %u\n", | 2756 | printk(KERN_WARNING PFX |
2757 | "Unsupported 80211 core revision %u\n", | ||
2755 | core_rev); | 2758 | core_rev); |
2756 | err = -ENODEV; | ||
2757 | goto out; | ||
2758 | } | 2759 | } |
2759 | bcm->nr_80211_available++; | 2760 | bcm->nr_80211_available++; |
2760 | core->priv = ext_80211; | 2761 | core->priv = ext_80211; |
@@ -2868,16 +2869,11 @@ static int bcm43xx_wireless_core_init(struct bcm43xx_private *bcm, | |||
2868 | u32 sbimconfiglow; | 2869 | u32 sbimconfiglow; |
2869 | u8 limit; | 2870 | u8 limit; |
2870 | 2871 | ||
2871 | if (bcm->chip_rev < 5) { | 2872 | if (bcm->core_pci.rev <= 5 && bcm->core_pci.id != BCM43xx_COREID_PCIE) { |
2872 | sbimconfiglow = bcm43xx_read32(bcm, BCM43xx_CIR_SBIMCONFIGLOW); | 2873 | sbimconfiglow = bcm43xx_read32(bcm, BCM43xx_CIR_SBIMCONFIGLOW); |
2873 | sbimconfiglow &= ~ BCM43xx_SBIMCONFIGLOW_REQUEST_TOUT_MASK; | 2874 | sbimconfiglow &= ~ BCM43xx_SBIMCONFIGLOW_REQUEST_TOUT_MASK; |
2874 | sbimconfiglow &= ~ BCM43xx_SBIMCONFIGLOW_SERVICE_TOUT_MASK; | 2875 | sbimconfiglow &= ~ BCM43xx_SBIMCONFIGLOW_SERVICE_TOUT_MASK; |
2875 | if (bcm->bustype == BCM43xx_BUSTYPE_PCI) | 2876 | sbimconfiglow |= 0x32; |
2876 | sbimconfiglow |= 0x32; | ||
2877 | else if (bcm->bustype == BCM43xx_BUSTYPE_SB) | ||
2878 | sbimconfiglow |= 0x53; | ||
2879 | else | ||
2880 | assert(0); | ||
2881 | bcm43xx_write32(bcm, BCM43xx_CIR_SBIMCONFIGLOW, sbimconfiglow); | 2877 | bcm43xx_write32(bcm, BCM43xx_CIR_SBIMCONFIGLOW, sbimconfiglow); |
2882 | } | 2878 | } |
2883 | 2879 | ||
@@ -3004,22 +3000,64 @@ static void bcm43xx_pcicore_broadcast_value(struct bcm43xx_private *bcm, | |||
3004 | 3000 | ||
3005 | static int bcm43xx_pcicore_commit_settings(struct bcm43xx_private *bcm) | 3001 | static int bcm43xx_pcicore_commit_settings(struct bcm43xx_private *bcm) |
3006 | { | 3002 | { |
3007 | int err; | 3003 | int err = 0; |
3008 | struct bcm43xx_coreinfo *old_core; | ||
3009 | 3004 | ||
3010 | old_core = bcm->current_core; | 3005 | bcm->irq_savedstate = bcm43xx_interrupt_disable(bcm, BCM43xx_IRQ_ALL); |
3011 | err = bcm43xx_switch_core(bcm, &bcm->core_pci); | ||
3012 | if (err) | ||
3013 | goto out; | ||
3014 | 3006 | ||
3015 | bcm43xx_pcicore_broadcast_value(bcm, 0xfd8, 0x00000000); | 3007 | if (bcm->core_chipcommon.available) { |
3008 | err = bcm43xx_switch_core(bcm, &bcm->core_chipcommon); | ||
3009 | if (err) | ||
3010 | goto out; | ||
3011 | |||
3012 | bcm43xx_pcicore_broadcast_value(bcm, 0xfd8, 0x00000000); | ||
3013 | |||
3014 | /* this function is always called when a PCI core is mapped */ | ||
3015 | err = bcm43xx_switch_core(bcm, &bcm->core_pci); | ||
3016 | if (err) | ||
3017 | goto out; | ||
3018 | } else | ||
3019 | bcm43xx_pcicore_broadcast_value(bcm, 0xfd8, 0x00000000); | ||
3020 | |||
3021 | bcm43xx_interrupt_enable(bcm, bcm->irq_savedstate); | ||
3016 | 3022 | ||
3017 | bcm43xx_switch_core(bcm, old_core); | ||
3018 | assert(err == 0); | ||
3019 | out: | 3023 | out: |
3020 | return err; | 3024 | return err; |
3021 | } | 3025 | } |
3022 | 3026 | ||
3027 | static u32 bcm43xx_pcie_reg_read(struct bcm43xx_private *bcm, u32 address) | ||
3028 | { | ||
3029 | bcm43xx_write32(bcm, BCM43xx_PCIECORE_REG_ADDR, address); | ||
3030 | return bcm43xx_read32(bcm, BCM43xx_PCIECORE_REG_DATA); | ||
3031 | } | ||
3032 | |||
3033 | static void bcm43xx_pcie_reg_write(struct bcm43xx_private *bcm, u32 address, | ||
3034 | u32 data) | ||
3035 | { | ||
3036 | bcm43xx_write32(bcm, BCM43xx_PCIECORE_REG_ADDR, address); | ||
3037 | bcm43xx_write32(bcm, BCM43xx_PCIECORE_REG_DATA, data); | ||
3038 | } | ||
3039 | |||
3040 | static void bcm43xx_pcie_mdio_write(struct bcm43xx_private *bcm, u8 dev, u8 reg, | ||
3041 | u16 data) | ||
3042 | { | ||
3043 | int i; | ||
3044 | |||
3045 | bcm43xx_write32(bcm, BCM43xx_PCIECORE_MDIO_CTL, 0x0082); | ||
3046 | bcm43xx_write32(bcm, BCM43xx_PCIECORE_MDIO_DATA, BCM43xx_PCIE_MDIO_ST | | ||
3047 | BCM43xx_PCIE_MDIO_WT | (dev << BCM43xx_PCIE_MDIO_DEV) | | ||
3048 | (reg << BCM43xx_PCIE_MDIO_REG) | BCM43xx_PCIE_MDIO_TA | | ||
3049 | data); | ||
3050 | udelay(10); | ||
3051 | |||
3052 | for (i = 0; i < 10; i++) { | ||
3053 | if (bcm43xx_read32(bcm, BCM43xx_PCIECORE_MDIO_CTL) & | ||
3054 | BCM43xx_PCIE_MDIO_TC) | ||
3055 | break; | ||
3056 | msleep(1); | ||
3057 | } | ||
3058 | bcm43xx_write32(bcm, BCM43xx_PCIECORE_MDIO_CTL, 0); | ||
3059 | } | ||
3060 | |||
3023 | /* Make an I/O Core usable. "core_mask" is the bitmask of the cores to enable. | 3061 | /* Make an I/O Core usable. "core_mask" is the bitmask of the cores to enable. |
3024 | * To enable core 0, pass a core_mask of 1<<0 | 3062 | * To enable core 0, pass a core_mask of 1<<0 |
3025 | */ | 3063 | */ |
@@ -3039,7 +3077,8 @@ static int bcm43xx_setup_backplane_pci_connection(struct bcm43xx_private *bcm, | |||
3039 | if (err) | 3077 | if (err) |
3040 | goto out; | 3078 | goto out; |
3041 | 3079 | ||
3042 | if (bcm->core_pci.rev < 6) { | 3080 | if (bcm->current_core->rev < 6 || |
3081 | bcm->current_core->id == BCM43xx_COREID_PCI) { | ||
3043 | value = bcm43xx_read32(bcm, BCM43xx_CIR_SBINTVEC); | 3082 | value = bcm43xx_read32(bcm, BCM43xx_CIR_SBINTVEC); |
3044 | value |= (1 << backplane_flag_nr); | 3083 | value |= (1 << backplane_flag_nr); |
3045 | bcm43xx_write32(bcm, BCM43xx_CIR_SBINTVEC, value); | 3084 | bcm43xx_write32(bcm, BCM43xx_CIR_SBINTVEC, value); |
@@ -3057,21 +3096,46 @@ static int bcm43xx_setup_backplane_pci_connection(struct bcm43xx_private *bcm, | |||
3057 | } | 3096 | } |
3058 | } | 3097 | } |
3059 | 3098 | ||
3060 | value = bcm43xx_read32(bcm, BCM43xx_PCICORE_SBTOPCI2); | 3099 | if (bcm->current_core->id == BCM43xx_COREID_PCI) { |
3061 | value |= BCM43xx_SBTOPCI2_PREFETCH | BCM43xx_SBTOPCI2_BURST; | 3100 | value = bcm43xx_read32(bcm, BCM43xx_PCICORE_SBTOPCI2); |
3062 | bcm43xx_write32(bcm, BCM43xx_PCICORE_SBTOPCI2, value); | 3101 | value |= BCM43xx_SBTOPCI2_PREFETCH | BCM43xx_SBTOPCI2_BURST; |
3063 | 3102 | bcm43xx_write32(bcm, BCM43xx_PCICORE_SBTOPCI2, value); | |
3064 | if (bcm->core_pci.rev < 5) { | 3103 | |
3065 | value = bcm43xx_read32(bcm, BCM43xx_CIR_SBIMCONFIGLOW); | 3104 | if (bcm->current_core->rev < 5) { |
3066 | value |= (2 << BCM43xx_SBIMCONFIGLOW_SERVICE_TOUT_SHIFT) | 3105 | value = bcm43xx_read32(bcm, BCM43xx_CIR_SBIMCONFIGLOW); |
3067 | & BCM43xx_SBIMCONFIGLOW_SERVICE_TOUT_MASK; | 3106 | value |= (2 << BCM43xx_SBIMCONFIGLOW_SERVICE_TOUT_SHIFT) |
3068 | value |= (3 << BCM43xx_SBIMCONFIGLOW_REQUEST_TOUT_SHIFT) | 3107 | & BCM43xx_SBIMCONFIGLOW_SERVICE_TOUT_MASK; |
3069 | & BCM43xx_SBIMCONFIGLOW_REQUEST_TOUT_MASK; | 3108 | value |= (3 << BCM43xx_SBIMCONFIGLOW_REQUEST_TOUT_SHIFT) |
3070 | bcm43xx_write32(bcm, BCM43xx_CIR_SBIMCONFIGLOW, value); | 3109 | & BCM43xx_SBIMCONFIGLOW_REQUEST_TOUT_MASK; |
3071 | err = bcm43xx_pcicore_commit_settings(bcm); | 3110 | bcm43xx_write32(bcm, BCM43xx_CIR_SBIMCONFIGLOW, value); |
3072 | assert(err == 0); | 3111 | err = bcm43xx_pcicore_commit_settings(bcm); |
3112 | assert(err == 0); | ||
3113 | } else if (bcm->current_core->rev >= 11) { | ||
3114 | value = bcm43xx_read32(bcm, BCM43xx_PCICORE_SBTOPCI2); | ||
3115 | value |= BCM43xx_SBTOPCI2_MEMREAD_MULTI; | ||
3116 | bcm43xx_write32(bcm, BCM43xx_PCICORE_SBTOPCI2, value); | ||
3117 | } | ||
3118 | } else { | ||
3119 | if (bcm->current_core->rev == 0 || bcm->current_core->rev == 1) { | ||
3120 | value = bcm43xx_pcie_reg_read(bcm, BCM43xx_PCIE_TLP_WORKAROUND); | ||
3121 | value |= 0x8; | ||
3122 | bcm43xx_pcie_reg_write(bcm, BCM43xx_PCIE_TLP_WORKAROUND, | ||
3123 | value); | ||
3124 | } | ||
3125 | if (bcm->current_core->rev == 0) { | ||
3126 | bcm43xx_pcie_mdio_write(bcm, BCM43xx_MDIO_SERDES_RX, | ||
3127 | BCM43xx_SERDES_RXTIMER, 0x8128); | ||
3128 | bcm43xx_pcie_mdio_write(bcm, BCM43xx_MDIO_SERDES_RX, | ||
3129 | BCM43xx_SERDES_CDR, 0x0100); | ||
3130 | bcm43xx_pcie_mdio_write(bcm, BCM43xx_MDIO_SERDES_RX, | ||
3131 | BCM43xx_SERDES_CDR_BW, 0x1466); | ||
3132 | } else if (bcm->current_core->rev == 1) { | ||
3133 | value = bcm43xx_pcie_reg_read(bcm, BCM43xx_PCIE_DLLP_LINKCTL); | ||
3134 | value |= 0x40; | ||
3135 | bcm43xx_pcie_reg_write(bcm, BCM43xx_PCIE_DLLP_LINKCTL, | ||
3136 | value); | ||
3137 | } | ||
3073 | } | 3138 | } |
3074 | |||
3075 | out_switch_back: | 3139 | out_switch_back: |
3076 | err = bcm43xx_switch_core(bcm, old_core); | 3140 | err = bcm43xx_switch_core(bcm, old_core); |
3077 | out: | 3141 | out: |
@@ -3140,55 +3204,27 @@ static void bcm43xx_periodic_every15sec(struct bcm43xx_private *bcm) | |||
3140 | 3204 | ||
3141 | static void do_periodic_work(struct bcm43xx_private *bcm) | 3205 | static void do_periodic_work(struct bcm43xx_private *bcm) |
3142 | { | 3206 | { |
3143 | unsigned int state; | 3207 | if (bcm->periodic_state % 8 == 0) |
3144 | |||
3145 | state = bcm->periodic_state; | ||
3146 | if (state % 8 == 0) | ||
3147 | bcm43xx_periodic_every120sec(bcm); | 3208 | bcm43xx_periodic_every120sec(bcm); |
3148 | if (state % 4 == 0) | 3209 | if (bcm->periodic_state % 4 == 0) |
3149 | bcm43xx_periodic_every60sec(bcm); | 3210 | bcm43xx_periodic_every60sec(bcm); |
3150 | if (state % 2 == 0) | 3211 | if (bcm->periodic_state % 2 == 0) |
3151 | bcm43xx_periodic_every30sec(bcm); | 3212 | bcm43xx_periodic_every30sec(bcm); |
3152 | if (state % 1 == 0) | 3213 | bcm43xx_periodic_every15sec(bcm); |
3153 | bcm43xx_periodic_every15sec(bcm); | ||
3154 | bcm->periodic_state = state + 1; | ||
3155 | 3214 | ||
3156 | schedule_delayed_work(&bcm->periodic_work, HZ * 15); | 3215 | schedule_delayed_work(&bcm->periodic_work, HZ * 15); |
3157 | } | 3216 | } |
3158 | 3217 | ||
3159 | /* Estimate a "Badness" value based on the periodic work | ||
3160 | * state-machine state. "Badness" is worse (bigger), if the | ||
3161 | * periodic work will take longer. | ||
3162 | */ | ||
3163 | static int estimate_periodic_work_badness(unsigned int state) | ||
3164 | { | ||
3165 | int badness = 0; | ||
3166 | |||
3167 | if (state % 8 == 0) /* every 120 sec */ | ||
3168 | badness += 10; | ||
3169 | if (state % 4 == 0) /* every 60 sec */ | ||
3170 | badness += 5; | ||
3171 | if (state % 2 == 0) /* every 30 sec */ | ||
3172 | badness += 1; | ||
3173 | if (state % 1 == 0) /* every 15 sec */ | ||
3174 | badness += 1; | ||
3175 | |||
3176 | #define BADNESS_LIMIT 4 | ||
3177 | return badness; | ||
3178 | } | ||
3179 | |||
3180 | static void bcm43xx_periodic_work_handler(void *d) | 3218 | static void bcm43xx_periodic_work_handler(void *d) |
3181 | { | 3219 | { |
3182 | struct bcm43xx_private *bcm = d; | 3220 | struct bcm43xx_private *bcm = d; |
3183 | struct net_device *net_dev = bcm->net_dev; | 3221 | struct net_device *net_dev = bcm->net_dev; |
3184 | unsigned long flags; | 3222 | unsigned long flags; |
3185 | u32 savedirqs = 0; | 3223 | u32 savedirqs = 0; |
3186 | int badness; | ||
3187 | unsigned long orig_trans_start = 0; | 3224 | unsigned long orig_trans_start = 0; |
3188 | 3225 | ||
3189 | mutex_lock(&bcm->mutex); | 3226 | mutex_lock(&bcm->mutex); |
3190 | badness = estimate_periodic_work_badness(bcm->periodic_state); | 3227 | if (unlikely(bcm->periodic_state % 4 == 0)) { |
3191 | if (badness > BADNESS_LIMIT) { | ||
3192 | /* Periodic work will take a long time, so we want it to | 3228 | /* Periodic work will take a long time, so we want it to |
3193 | * be preemtible. | 3229 | * be preemtible. |
3194 | */ | 3230 | */ |
@@ -3220,7 +3256,7 @@ static void bcm43xx_periodic_work_handler(void *d) | |||
3220 | 3256 | ||
3221 | do_periodic_work(bcm); | 3257 | do_periodic_work(bcm); |
3222 | 3258 | ||
3223 | if (badness > BADNESS_LIMIT) { | 3259 | if (unlikely(bcm->periodic_state % 4 == 0)) { |
3224 | spin_lock_irqsave(&bcm->irq_lock, flags); | 3260 | spin_lock_irqsave(&bcm->irq_lock, flags); |
3225 | tasklet_enable(&bcm->isr_tasklet); | 3261 | tasklet_enable(&bcm->isr_tasklet); |
3226 | bcm43xx_interrupt_enable(bcm, savedirqs); | 3262 | bcm43xx_interrupt_enable(bcm, savedirqs); |
@@ -3231,6 +3267,7 @@ static void bcm43xx_periodic_work_handler(void *d) | |||
3231 | net_dev->trans_start = orig_trans_start; | 3267 | net_dev->trans_start = orig_trans_start; |
3232 | } | 3268 | } |
3233 | mmiowb(); | 3269 | mmiowb(); |
3270 | bcm->periodic_state++; | ||
3234 | spin_unlock_irqrestore(&bcm->irq_lock, flags); | 3271 | spin_unlock_irqrestore(&bcm->irq_lock, flags); |
3235 | mutex_unlock(&bcm->mutex); | 3272 | mutex_unlock(&bcm->mutex); |
3236 | } | 3273 | } |
@@ -3676,7 +3713,7 @@ static int bcm43xx_read_phyinfo(struct bcm43xx_private *bcm) | |||
3676 | bcm->ieee->freq_band = IEEE80211_24GHZ_BAND; | 3713 | bcm->ieee->freq_band = IEEE80211_24GHZ_BAND; |
3677 | break; | 3714 | break; |
3678 | case BCM43xx_PHYTYPE_G: | 3715 | case BCM43xx_PHYTYPE_G: |
3679 | if (phy_rev > 7) | 3716 | if (phy_rev > 8) |
3680 | phy_rev_ok = 0; | 3717 | phy_rev_ok = 0; |
3681 | bcm->ieee->modulation = IEEE80211_OFDM_MODULATION | | 3718 | bcm->ieee->modulation = IEEE80211_OFDM_MODULATION | |
3682 | IEEE80211_CCK_MODULATION; | 3719 | IEEE80211_CCK_MODULATION; |
@@ -3688,6 +3725,8 @@ static int bcm43xx_read_phyinfo(struct bcm43xx_private *bcm) | |||
3688 | phy_type); | 3725 | phy_type); |
3689 | return -ENODEV; | 3726 | return -ENODEV; |
3690 | }; | 3727 | }; |
3728 | bcm->ieee->perfect_rssi = RX_RSSI_MAX; | ||
3729 | bcm->ieee->worst_rssi = 0; | ||
3691 | if (!phy_rev_ok) { | 3730 | if (!phy_rev_ok) { |
3692 | printk(KERN_WARNING PFX "Invalid PHY Revision %x\n", | 3731 | printk(KERN_WARNING PFX "Invalid PHY Revision %x\n", |
3693 | phy_rev); | 3732 | phy_rev); |
@@ -3974,11 +4013,6 @@ static int bcm43xx_ieee80211_hard_start_xmit(struct ieee80211_txb *txb, | |||
3974 | return NETDEV_TX_OK; | 4013 | return NETDEV_TX_OK; |
3975 | } | 4014 | } |
3976 | 4015 | ||
3977 | static struct net_device_stats * bcm43xx_net_get_stats(struct net_device *net_dev) | ||
3978 | { | ||
3979 | return &(bcm43xx_priv(net_dev)->ieee->stats); | ||
3980 | } | ||
3981 | |||
3982 | static void bcm43xx_net_tx_timeout(struct net_device *net_dev) | 4016 | static void bcm43xx_net_tx_timeout(struct net_device *net_dev) |
3983 | { | 4017 | { |
3984 | struct bcm43xx_private *bcm = bcm43xx_priv(net_dev); | 4018 | struct bcm43xx_private *bcm = bcm43xx_priv(net_dev); |
@@ -4092,7 +4126,6 @@ static int __devinit bcm43xx_init_one(struct pci_dev *pdev, | |||
4092 | 4126 | ||
4093 | net_dev->open = bcm43xx_net_open; | 4127 | net_dev->open = bcm43xx_net_open; |
4094 | net_dev->stop = bcm43xx_net_stop; | 4128 | net_dev->stop = bcm43xx_net_stop; |
4095 | net_dev->get_stats = bcm43xx_net_get_stats; | ||
4096 | net_dev->tx_timeout = bcm43xx_net_tx_timeout; | 4129 | net_dev->tx_timeout = bcm43xx_net_tx_timeout; |
4097 | #ifdef CONFIG_NET_POLL_CONTROLLER | 4130 | #ifdef CONFIG_NET_POLL_CONTROLLER |
4098 | net_dev->poll_controller = bcm43xx_net_poll_controller; | 4131 | net_dev->poll_controller = bcm43xx_net_poll_controller; |