brcm80211: smac: removed MPC related code
authorRoland Vossen <rvossen@broadcom.com>
Fri, 21 Oct 2011 14:16:21 +0000 (16:16 +0200)
committerJohn W. Linville <linville@tuxdriver.com>
Tue, 8 Nov 2011 20:54:15 +0000 (15:54 -0500)
The chip init sequence enables MPC (Minimum Power Consumption), but the
driver disables it after that. As there are no interfaces to enable this
mode the related code is unused (member variable wlc->mpc is false).

Reviewed-by: Alwin Beukers <alwin@broadcom.com>
Reviewed-by: Arend van Spriel <arend@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Signed-off-by: Roland Vossen <rvossen@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/brcm80211/brcmsmac/mac80211_if.c
drivers/net/wireless/brcm80211/brcmsmac/main.c
drivers/net/wireless/brcm80211/brcmsmac/main.h
drivers/net/wireless/brcm80211/brcmsmac/pub.h

index 7a24a8314445750436a8ec337ccb354bc57077ea..1781157c02364fffec5676e33b294dda2e6c7dcf 100644 (file)
@@ -1079,7 +1079,7 @@ static struct brcms_info *brcms_attach(u16 vendor, u16 device,
        wl->pub->ieee_hw = hw;
 
        /* disable mpc */
-       brcms_c_set_radio_mpc(wl->wlc, false);
+       brcms_c_set_radio_mpc(wl->wlc);
 
        /* register our interrupt handler */
        if (request_irq(irq, brcms_isr, IRQF_SHARED, KBUILD_MODNAME, wl)) {
index 4f1d6e4b0406946fd678247fd76693a39c831f66..4687983253ed063a1bb50ec2c9bbfa478b847db2 100644 (file)
@@ -419,20 +419,6 @@ static int brcms_chspec_bw(u16 chanspec)
        return BRCMS_10_MHZ;
 }
 
-/*
- * return true if Minimum Power Consumption should
- * be entered, false otherwise
- */
-static bool brcms_c_is_non_delay_mpc(struct brcms_c_info *wlc)
-{
-       return false;
-}
-
-static bool brcms_c_ismpc(struct brcms_c_info *wlc)
-{
-       return (wlc->mpc_delay_off == 0) && (brcms_c_is_non_delay_mpc(wlc));
-}
-
 static void brcms_c_bsscfg_mfree(struct brcms_bss_cfg *cfg)
 {
        if (cfg == NULL)
@@ -4350,56 +4336,18 @@ static void brcms_b_watchdog(void *arg)
 
 static void brcms_c_radio_mpc_upd(struct brcms_c_info *wlc)
 {
-       bool mpc_radio, radio_state;
-
        /*
         * Clear the WL_RADIO_MPC_DISABLE bit when mpc feature is disabled
         * in case the WL_RADIO_MPC_DISABLE bit was set. Stop the radio
         * monitor also when WL_RADIO_MPC_DISABLE is the only reason that
         * the radio is going down.
         */
-       if (!wlc->mpc) {
-               if (!wlc->pub->radio_disabled)
-                       return;
-               mboolclr(wlc->pub->radio_disabled, WL_RADIO_MPC_DISABLE);
-               brcms_c_radio_upd(wlc);
-               if (!wlc->pub->radio_disabled)
-                       brcms_c_radio_monitor_stop(wlc);
+       if (!wlc->pub->radio_disabled)
                return;
-       }
-
-       /*
-        * sync ismpc logic with WL_RADIO_MPC_DISABLE bit in
-        * wlc->pub->radio_disabled to go ON, always call radio_upd
-        * synchronously to go OFF, postpone radio_upd to later when
-        * context is safe(e.g. watchdog)
-        */
-       radio_state =
-           (mboolisset(wlc->pub->radio_disabled, WL_RADIO_MPC_DISABLE) ? OFF :
-            ON);
-       mpc_radio = (brcms_c_ismpc(wlc) == true) ? OFF : ON;
-
-       if (radio_state == ON && mpc_radio == OFF)
-               wlc->mpc_delay_off = wlc->mpc_dlycnt;
-       else if (radio_state == OFF && mpc_radio == ON) {
-               mboolclr(wlc->pub->radio_disabled, WL_RADIO_MPC_DISABLE);
-               brcms_c_radio_upd(wlc);
-               if (wlc->mpc_offcnt < BRCMS_MPC_THRESHOLD)
-                       wlc->mpc_dlycnt = BRCMS_MPC_MAX_DELAYCNT;
-               else
-                       wlc->mpc_dlycnt = BRCMS_MPC_MIN_DELAYCNT;
-       }
-       /*
-        * Below logic is meant to capture the transition from mpc off
-        * to mpc on for reasons other than wlc->mpc_delay_off keeping
-        * the mpc off. In that case reset wlc->mpc_delay_off to
-        * wlc->mpc_dlycnt, so that we restart the countdown of mpc_delay_off
-        */
-       if ((wlc->prev_non_delay_mpc == false) &&
-           (brcms_c_is_non_delay_mpc(wlc) == true) && wlc->mpc_delay_off)
-               wlc->mpc_delay_off = wlc->mpc_dlycnt;
-
-       wlc->prev_non_delay_mpc = brcms_c_is_non_delay_mpc(wlc);
+       mboolclr(wlc->pub->radio_disabled, WL_RADIO_MPC_DISABLE);
+       brcms_c_radio_upd(wlc);
+       if (!wlc->pub->radio_disabled)
+               brcms_c_radio_monitor_stop(wlc);
 }
 
 /* common watchdog code */
@@ -4427,8 +4375,6 @@ static void brcms_c_watchdog(void *arg)
                if (--wlc->mpc_delay_off == 0) {
                        mboolset(wlc->pub->radio_disabled,
                                 WL_RADIO_MPC_DISABLE);
-                       if (wlc->mpc && brcms_c_ismpc(wlc))
-                               wlc->mpc_offcnt = 0;
                }
        }
 
@@ -5200,9 +5146,6 @@ static void brcms_c_ap_upd(struct brcms_c_info *wlc)
 {
        /* STA-BSS; short capable */
        wlc->PLCPHdr_override = BRCMS_PLCP_SHORT;
-
-       /* fixup mpc */
-       wlc->mpc = true;
 }
 
 /* Initialize just the hardware when coming out of POR or S3/S5 system states */
@@ -8192,9 +8135,8 @@ int brcms_c_get_tx_power(struct brcms_c_info *wlc)
        return (int)(qdbm / BRCMS_TXPWR_DB_FACTOR);
 }
 
-void brcms_c_set_radio_mpc(struct brcms_c_info *wlc, bool mpc)
+void brcms_c_set_radio_mpc(struct brcms_c_info *wlc)
 {
-       wlc->mpc = mpc;
        brcms_c_radio_mpc_upd(wlc);
 }
 
index c0e0fcfdfaf8e7988e5ec6d22919df019218f08e..37c55fde4790ec81109889511073715cbffaf8da 100644 (file)
@@ -427,7 +427,6 @@ struct brcms_txq_info {
  * bandinit_pending: track band init in auto band.
  * radio_monitor: radio timer is running.
  * going_down: down path intermediate variable.
- * mpc: enable minimum power consumption.
  * mpc_dlycnt: # of watchdog cnt before turn disable radio.
  * mpc_offcnt: # of watchdog cnt that radio is disabled.
  * mpc_delay_off: delay radio disable by # of watchdog cnt.
@@ -522,7 +521,6 @@ struct brcms_c_info {
        bool radio_monitor;
        bool going_down;
 
-       bool mpc;
        u8 mpc_dlycnt;
        u8 mpc_offcnt;
        u8 mpc_delay_off;
index d20116a5b0a3631e21099d86f6f82ece69a63704..2e092160df5ce85f92e523d0e0df0329abfe228e 100644 (file)
@@ -596,7 +596,7 @@ extern void brcms_c_set_beacon_listen_interval(struct brcms_c_info *wlc,
                                        u8 interval);
 extern int brcms_c_set_tx_power(struct brcms_c_info *wlc, int txpwr);
 extern int brcms_c_get_tx_power(struct brcms_c_info *wlc);
-extern void brcms_c_set_radio_mpc(struct brcms_c_info *wlc, bool mpc);
+extern void brcms_c_set_radio_mpc(struct brcms_c_info *wlc);
 extern bool brcms_c_check_radio_disabled(struct brcms_c_info *wlc);
 
 #endif                         /* _BRCM_PUB_H_ */