net: wireless: bcmdhd: Add ROAM setting per platform from Makefle
authorDmitry Shmidt <dimitrysh@google.com>
Thu, 13 Sep 2012 20:56:32 +0000 (13:56 -0700)
committerDmitry Shmidt <dimitrysh@google.com>
Thu, 13 Sep 2012 20:58:00 +0000 (13:58 -0700)
Change-Id: Ia6bc3025e3641cb6b91022ab1c9976c0f6ad16a4
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
drivers/net/wireless/bcmdhd/Makefile
drivers/net/wireless/bcmdhd/dhd.h
drivers/net/wireless/bcmdhd/dhd_linux.c

index eda803e3ca798520dbdf4e73580175b09f2a7116..0e9ca24013a69ae11e304b71987821a8df8a002b 100644 (file)
@@ -25,6 +25,8 @@ endif
 ifneq ($(CONFIG_CFG80211),)
 bcmdhd-objs += wl_cfg80211.o wl_cfgp2p.o wl_linux_mon.o
 DHDCFLAGS += -DWL_CFG80211
+DHDCFLAGS += -DCUSTOM_ROAM_TRIGGER_SETTING=-70
+DHDCFLAGS += -DCUSTOM_ROAM_DELTA_SETTING=15
 endif
 ifneq ($(CONFIG_DHD_USE_SCHED_SCAN),)
 DHDCFLAGS += -DWL_SCHED_SCAN
index 6106555f131467d04816218920c89a710cf824e1..34616d38b861fb52e6b5fd90037176eadffabe25 100644 (file)
@@ -608,6 +608,20 @@ extern uint dhd_pktgen_len;
 #endif
 
 
+/* hooks for custom Roaming Trigger  setting via Makefile */
+#define DEFAULT_ROAM_TRIGGER_VALUE -75 /* dBm default roam trigger all band */
+#define DEFAULT_ROAM_TRIGGER_SETTING   -1
+#ifndef CUSTOM_ROAM_TRIGGER_SETTING
+#define CUSTOM_ROAM_TRIGGER_SETTING    DEFAULT_ROAM_TRIGGER_VALUE
+#endif
+
+/* hooks for custom Roaming Romaing  setting via Makefile */
+#define DEFAULT_ROAM_DELTA_VALUE  10 /* dBm default roam delta all band */
+#define DEFAULT_ROAM_DELTA_SETTING     -1
+#ifndef CUSTOM_ROAM_DELTA_SETTING
+#define CUSTOM_ROAM_DELTA_SETTING      DEFAULT_ROAM_DELTA_VALUE
+#endif
+
 /* optionally set by a module_param_string() */
 #define MOD_PARAM_PATHLEN      2048
 extern char fw_path[MOD_PARAM_PATHLEN];
index f4ae2a30c3c88c83115b73dab10a5f0843a1099f..a189d6383246c51ae5f9b90acd4e94d26db73f34 100644 (file)
@@ -2990,6 +2990,8 @@ dhd_preinit_ioctls(dhd_pub_t *dhd)
        char *ptr;
        uint32 listen_interval = LISTEN_INTERVAL; /* Default Listen Interval in Beacons */
        uint16 chipID;
+       int roam_trigger[2] = {CUSTOM_ROAM_TRIGGER_SETTING, WLC_BAND_ALL};
+       int roam_delta[2] = {CUSTOM_ROAM_DELTA_SETTING, WLC_BAND_ALL};
 #if defined(SOFTAP)
        uint dtim = 1;
 #endif
@@ -3157,6 +3159,14 @@ dhd_preinit_ioctls(dhd_pub_t *dhd)
        if ((ret = dhd_wl_ioctl_cmd(dhd, WLC_SET_VAR, iovbuf, sizeof(iovbuf), TRUE, 0)) < 0)
                DHD_ERROR(("%s assoc_listen failed %d\n", __FUNCTION__, ret));
 
+       /* custom romaing setting */
+       if ((ret = dhd_wl_ioctl_cmd(dhd, WLC_SET_ROAM_TRIGGER, roam_trigger,
+               sizeof(roam_trigger), TRUE, 0)) < 0)
+               DHD_ERROR(("%s: roam trigger set failed %d\n", __FUNCTION__, ret));
+       if ((dhd_wl_ioctl_cmd(dhd, WLC_SET_ROAM_DELTA, roam_delta,
+               sizeof(roam_delta), TRUE, 0)) < 0)
+               DHD_ERROR(("%s: roam delta set failed %d\n", __FUNCTION__, ret));
+
        /* Set PowerSave mode */
        dhd_wl_ioctl_cmd(dhd, WLC_SET_PM, (char *)&power_mode, sizeof(power_mode), TRUE, 0);