net: wireless: bcmdhd: Add SUPPORT_PM2_ONLY option
authorDmitry Shmidt <dimitrysh@google.com>
Fri, 8 Feb 2013 20:08:48 +0000 (12:08 -0800)
committerDmitry Shmidt <dimitrysh@google.com>
Fri, 8 Feb 2013 20:08:48 +0000 (12:08 -0800)
Change-Id: Ieb2569cb7fb2bbc56ff9abbc8728a7741fda0027
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
drivers/net/wireless/bcmdhd/dhd_linux.c
drivers/net/wireless/bcmdhd/wl_cfg80211.c
drivers/net/wireless/bcmdhd/wl_cfgp2p.c

index 9e9f5b62a427b28deef58d1bd0b8b8a13426eb60..476a50a99649f16dc12dc9d2ee08dc2a7e4e71bb 100644 (file)
@@ -530,7 +530,9 @@ static void dhd_set_packet_filter(int value, dhd_pub_t *dhd)
 
 static int dhd_set_suspend(int value, dhd_pub_t *dhd)
 {
+#if !defined(SUPPORT_PM2_ONLY)
        int power_mode = PM_MAX;
+#endif
        /* wl_pkt_filter_enable_t       enable_parm; */
        char iovbuf[32];
        int bcn_li_dtim = 3;
@@ -546,8 +548,10 @@ static int dhd_set_suspend(int value, dhd_pub_t *dhd)
                        /* Kernel suspended */
                        DHD_ERROR(("%s: force extra Suspend setting\n", __FUNCTION__));
 
+#if !defined(SUPPORT_PM2_ONLY)
                        dhd_wl_ioctl_cmd(dhd, WLC_SET_PM, (char *)&power_mode,
                                         sizeof(power_mode), TRUE, 0);
+#endif
 
                        /* Enable packet filter, only allow unicast packet to send up */
                        dhd_set_packet_filter(1, dhd);
@@ -570,9 +574,11 @@ static int dhd_set_suspend(int value, dhd_pub_t *dhd)
                        /* Kernel resumed  */
                        DHD_ERROR(("%s: Remove extra suspend setting\n", __FUNCTION__));
 
+#if !defined(SUPPORT_PM2_ONLY)
                        power_mode = PM_FAST;
                        dhd_wl_ioctl_cmd(dhd, WLC_SET_PM, (char *)&power_mode,
                                         sizeof(power_mode), TRUE, 0);
+#endif
 
                        /* disable pkt filter */
                        dhd_set_packet_filter(0, dhd);
index d653b3e0971443dc5efb282660b28729277a6c8b..90c947e8e8c12267fbd814b75c26b6b1d50ea269 100644 (file)
@@ -3094,8 +3094,9 @@ wl_cfg80211_set_power_mgmt(struct wiphy *wiphy, struct net_device *dev,
        s32 pm;
        s32 err = 0;
        struct wl_priv *wl = wiphy_priv(wiphy);
+#if !defined(SUPPORT_PM2_ONLY)
        dhd_pub_t *dhd =  (dhd_pub_t *)(wl->pub);
-
+#endif
        CHECK_SYS_UP(wl);
 
        WL_DBG(("Enter : power save %s\n", (enabled ? "enable" : "disable")));
@@ -3103,7 +3104,11 @@ wl_cfg80211_set_power_mgmt(struct wiphy *wiphy, struct net_device *dev,
                return err;
        }
 
+#if !defined(SUPPORT_PM2_ONLY)
        pm = enabled ? ((dhd->in_suspend) ? PM_MAX : PM_FAST) : PM_OFF;
+#else
+       pm = enabled ? PM_FAST : PM_OFF;
+#endif
        pm = htod32(pm);
        err = wldev_ioctl(dev, WLC_SET_PM, &pm, sizeof(pm), true);
        if (unlikely(err)) {
index aedf9705b4408a87e05941e3bae35d87d7c6c276..38c81cf94f4220b671a79b5c2f0d45f8e2221034 100644 (file)
@@ -1758,6 +1758,10 @@ wl_cfgp2p_set_p2p_ps(struct wl_priv *wl, struct net_device *ndev, char* buf, int
 
                if (legacy_ps != -1) {
                        s32 pm = legacy_ps ? PM_MAX : PM_OFF;
+#if defined(SUPPORT_PM2_ONLY)
+                       if (pm == PM_MAX)
+                               pm = PM_FAST;
+#endif /* SUPPORT_PM2_ONLY */
                        ret = wldev_ioctl(wl_to_p2p_bss_ndev(wl, P2PAPI_BSSCFG_CONNECTION),
                                WLC_SET_PM, &pm, sizeof(pm), true);
                        if (unlikely(ret)) {