int wifi_scan_pno_time;
int wifi_scan_pno_repeat;
int wifi_scan_pno_freq_expo_max;
+int wifi_scan_pno_home_away_time;
+int wifi_scan_pno_nprobes;
+int wifi_scan_pno_active_time;
+int wifi_scan_pno_passive_time;
+int wifi_scan_pno_home_time;
int wifi_scan_wait;
DECLARE_WAIT_QUEUE_HEAD(wifi_scan_wait_queue);
"PNO scan settings:\n"
" pno_time %d\n"
" pno_repeat %d\n"
- " pno_freq_expo_max %d\n",
+ " pno_freq_expo_max %d\n"
+ " wifi_scan_pno_home_away_time %d\n"
+ " wifi_scan_pno_nprobes %d\n"
+ " wifi_scan_pno_active_time %d\n"
+ " wifi_scan_pno_passive_time %d\n"
+ " wifi_scan_pno_home_time %d\n",
wifi_scan_pno_time,
wifi_scan_pno_repeat,
- wifi_scan_pno_freq_expo_max);
+ wifi_scan_pno_freq_expo_max,
+ wifi_scan_pno_home_away_time,
+ wifi_scan_pno_nprobes,
+ wifi_scan_pno_active_time,
+ wifi_scan_pno_passive_time,
+ wifi_scan_pno_home_time);
if (PAGE_SIZE - (s - buf) == strlen(s) + 1) {
*s = '\0';
goto abort_show_item;
struct device_attribute *attr,
const char *buf, size_t count)
{
- int a, b, c;
+ int a, b, c, skip;
// pr_info("%s\n", __func__);
} else if (strncmp(buf, "-policy ", 8) == 0) {
wifi_scan_policy__remove(buf + 8, count - 8);
} else if (strncmp(buf, "pno ", 4) == 0) {
- if (sscanf(buf + 4, "%d %d %d", &a, &b, &c) != 3) {
+ if (sscanf(buf + 4, "%d %d %d%n", &a, &b, &c, &skip) < 3) {
pr_err("%s: invalid pno setting:"
" pno <pno_time>"
" <pno_repeat> <pno_freq_expo_max>\n",
__func__);
return count;
}
+ buf += 4 + skip;
wifi_scan_pno_time = a;
wifi_scan_pno_repeat = b;
wifi_scan_pno_freq_expo_max = c;
+check_pno_arguments_again:
+ if (sscanf(buf, " -H %d%n", &a, &skip) >= 1) {
+ pr_info("-H %d\n", a);
+ wifi_scan_pno_home_away_time = a;
+ buf += skip;
+ goto check_pno_arguments_again;
+ }
+ if (sscanf(buf, " -n %d%n", &a, &skip) >= 1) {
+ pr_info("-n %d\n", a);
+ wifi_scan_pno_nprobes = a;
+ buf += skip;
+ goto check_pno_arguments_again;
+ }
+ if (sscanf(buf, " -a %d%n", &a, &skip) >= 1) {
+ pr_info("-a %d\n", a);
+ wifi_scan_pno_active_time = a;
+ buf += skip;
+ goto check_pno_arguments_again;
+ }
+ if (sscanf(buf, " -p %d%n", &a, &skip) >= 1) {
+ pr_info("-p %d\n", a);
+ wifi_scan_pno_passive_time = a;
+ buf += skip;
+ goto check_pno_arguments_again;
+ }
+ if (sscanf(buf, " -h %d%n", &a, &skip) >= 1) {
+ pr_info("-h %d\n", a);
+ wifi_scan_pno_home_time = a;
+ buf += skip;
+ goto check_pno_arguments_again;
+ }
} else {
pr_err("%s: unknown command\n", __func__);
}
extern int wifi_scan_pno_time;
extern int wifi_scan_pno_repeat;
extern int wifi_scan_pno_freq_expo_max;
+extern int wifi_scan_pno_home_away_time;
+extern int wifi_scan_pno_nprobes;
+extern int wifi_scan_pno_active_time;
+extern int wifi_scan_pno_passive_time;
+extern int wifi_scan_pno_home_time;
-#define TEGRA_PNO_SCAN_PREPARE(request,\
+#define TEGRA_PNO_SCAN_PREPARE(netdev, dhd, request,\
pno_time, pno_repeat, pno_freq_expo_max)\
{\
if ((wifi_scan_pno_time != 0) &&\
wifi_scan_pno_freq_expo_max);\
pno_freq_expo_max = wifi_scan_pno_freq_expo_max;\
}\
+ if (wifi_scan_pno_home_away_time != 0) {\
+ WIFI_SCAN_DEBUG("%s: TEGRA_PNO_SCAN_PREPARE:"\
+ " home_away_time %d ms\n",\
+ __func__,\
+ wifi_scan_pno_home_away_time);\
+ wldev_iovar_setint(netdev,\
+ "scan_home_away_time",\
+ wifi_scan_pno_home_away_time);\
+ }\
+ if (wifi_scan_pno_nprobes != 0) {\
+ WIFI_SCAN_DEBUG("%s: TEGRA_PNO_SCAN_PREPARE:"\
+ " nprobes %d\n",\
+ __func__,\
+ wifi_scan_pno_nprobes);\
+ dhd_wl_ioctl_cmd(dhd,\
+ WLC_SET_SCAN_NPROBES,\
+ (char *) &wifi_scan_pno_nprobes,\
+ sizeof(wifi_scan_pno_nprobes),\
+ TRUE, 0);\
+ }\
+ if (wifi_scan_pno_active_time != 0) {\
+ WIFI_SCAN_DEBUG("%s: TEGRA_PNO_SCAN_PREPARE:"\
+ " active_time %d ms\n",\
+ __func__,\
+ wifi_scan_pno_active_time);\
+ dhd_wl_ioctl_cmd(dhd,\
+ WLC_SET_SCAN_CHANNEL_TIME,\
+ (char *) &wifi_scan_pno_active_time,\
+ sizeof(wifi_scan_pno_active_time),\
+ TRUE, 0);\
+ dhd_wl_ioctl_cmd(dhd,\
+ WLC_SET_SCAN_UNASSOC_TIME,\
+ (char *) &wifi_scan_pno_active_time,\
+ sizeof(wifi_scan_pno_active_time),\
+ TRUE, 0);\
+ }\
+ if (wifi_scan_pno_passive_time != 0) {\
+ WIFI_SCAN_DEBUG("%s: TEGRA_PNO_SCAN_PREPARE:"\
+ " passive_time %d ms\n",\
+ __func__,\
+ wifi_scan_pno_passive_time);\
+ dhd_wl_ioctl_cmd(dhd,\
+ WLC_SET_SCAN_PASSIVE_TIME,\
+ (char *) &wifi_scan_pno_passive_time,\
+ sizeof(wifi_scan_pno_passive_time),\
+ TRUE, 0);\
+ }\
+ if (wifi_scan_pno_home_time != 0) {\
+ WIFI_SCAN_DEBUG("%s: TEGRA_PNO_SCAN_PREPARE:"\
+ " home_time %d ms\n",\
+ __func__,\
+ wifi_scan_pno_home_time);\
+ dhd_wl_ioctl_cmd(dhd,\
+ WLC_SET_SCAN_HOME_TIME,\
+ (char *) &wifi_scan_pno_home_time,\
+ sizeof(wifi_scan_pno_home_time),\
+ TRUE, 0);\
+ }\
}\
extern int wifi_scan_wait;
request->n_ssids, pno_time, pno_repeat, pno_freq_expo_max));
#ifdef CONFIG_BCMDHD_CUSTOM_SYSFS_TEGRA
- TEGRA_PNO_SCAN_PREPARE(request,
- pno_time, pno_repeat, pno_freq_expo_max)
+ {
+ struct bcm_cfg80211 *cfg = wiphy_priv(wiphy);
+ dhd_pub_t *dhd = (dhd_pub_t *)(cfg->pub);
+ if (cfg && dhd)
+ TEGRA_PNO_SCAN_PREPARE(dev, dhd, request,
+ pno_time, pno_repeat, pno_freq_expo_max)
+ }
#endif
if (!request || !request->n_ssids || !request->n_match_sets) {