Commit e4dd6325 authored by Sukesh Srikakula's avatar Sukesh Srikakula Committed by Greg Kroah-Hartman

staging: brcm80211: Added support to change scan times from brcmfmac driver

wl_dongle_scantime function moved out of conditional compilation to allow
the fullmac driver to change FW scan times.

Cc: devel@linuxdriverproject.org
Cc: linux-wireless@vger.kernel.org
Reviewed-by: default avatarFranky (Zhenhui) Lin <frankyl@broadcom.com>
Reviewed-by: default avatarBrett Rudley <brudley@broadcom.com>
Signed-off-by: default avatarArend van Spriel <arend@broadcom.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent a1e962b6
...@@ -259,8 +259,6 @@ static s32 wl_dongle_up(struct net_device *ndev, u32 up); ...@@ -259,8 +259,6 @@ static s32 wl_dongle_up(struct net_device *ndev, u32 up);
static s32 wl_dongle_power(struct net_device *ndev, u32 power_mode); static s32 wl_dongle_power(struct net_device *ndev, u32 power_mode);
static s32 wl_dongle_glom(struct net_device *ndev, u32 glom, static s32 wl_dongle_glom(struct net_device *ndev, u32 glom,
u32 dongle_align); u32 dongle_align);
static s32 wl_dongle_scantime(struct net_device *ndev, s32 scan_assoc_time,
s32 scan_unassoc_time);
static s32 wl_dongle_offload(struct net_device *ndev, s32 arpoe, static s32 wl_dongle_offload(struct net_device *ndev, s32 arpoe,
s32 arp_ol); s32 arp_ol);
static s32 wl_pattern_atoh(s8 *src, s8 *dst); static s32 wl_pattern_atoh(s8 *src, s8 *dst);
...@@ -269,6 +267,8 @@ static s32 wl_update_wiphybands(struct wl_priv *wl); ...@@ -269,6 +267,8 @@ static s32 wl_update_wiphybands(struct wl_priv *wl);
#endif /* !EMBEDDED_PLATFORM */ #endif /* !EMBEDDED_PLATFORM */
static s32 wl_dongle_eventmsg(struct net_device *ndev); static s32 wl_dongle_eventmsg(struct net_device *ndev);
static s32 wl_dongle_scantime(struct net_device *ndev, s32 scan_assoc_time,
s32 scan_unassoc_time, s32 scan_passive_time);
static s32 wl_config_dongle(struct wl_priv *wl, bool need_lock); static s32 wl_config_dongle(struct wl_priv *wl, bool need_lock);
static s32 wl_dongle_roam(struct net_device *ndev, u32 roamvar, static s32 wl_dongle_roam(struct net_device *ndev, u32 roamvar,
u32 bcn_timeout); u32 bcn_timeout);
...@@ -3632,37 +3632,6 @@ wl_dongle_glom(struct net_device *ndev, u32 glom, u32 dongle_align) ...@@ -3632,37 +3632,6 @@ wl_dongle_glom(struct net_device *ndev, u32 glom, u32 dongle_align)
return err; return err;
} }
static s32
wl_dongle_scantime(struct net_device *ndev, s32 scan_assoc_time,
s32 scan_unassoc_time)
{
s32 err = 0;
err = wl_dev_ioctl(ndev, WLC_SET_SCAN_CHANNEL_TIME, &scan_assoc_time,
sizeof(scan_assoc_time));
if (err) {
if (err == -EOPNOTSUPP) {
WL_INFO("Scan assoc time is not supported\n");
} else {
WL_ERR("Scan assoc time error (%d)\n", err);
}
goto dongle_scantime_out;
}
err = wl_dev_ioctl(ndev, WLC_SET_SCAN_UNASSOC_TIME, &scan_unassoc_time,
sizeof(scan_unassoc_time));
if (err) {
if (err == -EOPNOTSUPP) {
WL_INFO("Scan unassoc time is not supported\n");
} else {
WL_ERR("Scan unassoc time error (%d)\n", err);
}
goto dongle_scantime_out;
}
dongle_scantime_out:
return err;
}
static s32 static s32
wl_dongle_offload(struct net_device *ndev, s32 arpoe, s32 arp_ol) wl_dongle_offload(struct net_device *ndev, s32 arpoe, s32 arp_ol)
{ {
...@@ -3917,6 +3886,45 @@ wl_dongle_roam(struct net_device *ndev, u32 roamvar, u32 bcn_timeout) ...@@ -3917,6 +3886,45 @@ wl_dongle_roam(struct net_device *ndev, u32 roamvar, u32 bcn_timeout)
return err; return err;
} }
static s32
wl_dongle_scantime(struct net_device *ndev, s32 scan_assoc_time,
s32 scan_unassoc_time, s32 scan_passive_time)
{
s32 err = 0;
err = wl_dev_ioctl(ndev, WLC_SET_SCAN_CHANNEL_TIME, &scan_assoc_time,
sizeof(scan_assoc_time));
if (err) {
if (err == -EOPNOTSUPP)
WL_INFO("Scan assoc time is not supported\n");
else
WL_ERR("Scan assoc time error (%d)\n", err);
goto dongle_scantime_out;
}
err = wl_dev_ioctl(ndev, WLC_SET_SCAN_UNASSOC_TIME, &scan_unassoc_time,
sizeof(scan_unassoc_time));
if (err) {
if (err == -EOPNOTSUPP)
WL_INFO("Scan unassoc time is not supported\n");
else
WL_ERR("Scan unassoc time error (%d)\n", err);
goto dongle_scantime_out;
}
err = wl_dev_ioctl(ndev, WLC_SET_SCAN_PASSIVE_TIME, &scan_passive_time,
sizeof(scan_passive_time));
if (err) {
if (err == -EOPNOTSUPP)
WL_INFO("Scan passive time is not supported\n");
else
WL_ERR("Scan passive time error (%d)\n", err);
goto dongle_scantime_out;
}
dongle_scantime_out:
return err;
}
s32 wl_config_dongle(struct wl_priv *wl, bool need_lock) s32 wl_config_dongle(struct wl_priv *wl, bool need_lock)
{ {
#ifndef DHD_SDALIGN #ifndef DHD_SDALIGN
...@@ -3947,10 +3955,13 @@ s32 wl_config_dongle(struct wl_priv *wl, bool need_lock) ...@@ -3947,10 +3955,13 @@ s32 wl_config_dongle(struct wl_priv *wl, bool need_lock)
err = wl_dongle_glom(ndev, 0, DHD_SDALIGN); err = wl_dongle_glom(ndev, 0, DHD_SDALIGN);
if (unlikely(err)) if (unlikely(err))
goto default_conf_out; goto default_conf_out;
wl_dongle_scantime(ndev, 40, 80);
wl_dongle_offload(ndev, 1, 0xf); wl_dongle_offload(ndev, 1, 0xf);
wl_dongle_filter(ndev, 1); wl_dongle_filter(ndev, 1);
#endif /* !EMBEDDED_PLATFORM */ #endif /* !EMBEDDED_PLATFORM */
wl_dongle_scantime(ndev, WL_SCAN_CHANNEL_TIME,
WL_SCAN_UNASSOC_TIME, WL_SCAN_PASSIVE_TIME);
err = wl_dongle_eventmsg(ndev); err = wl_dongle_eventmsg(ndev);
if (unlikely(err)) if (unlikely(err))
......
...@@ -99,6 +99,10 @@ do { \ ...@@ -99,6 +99,10 @@ do { \
#define WL_ROAM_DELTA 20 #define WL_ROAM_DELTA 20
#define WL_BEACON_TIMEOUT 3 #define WL_BEACON_TIMEOUT 3
#define WL_SCAN_CHANNEL_TIME 40
#define WL_SCAN_UNASSOC_TIME 40
#define WL_SCAN_PASSIVE_TIME 120
/* dongle status */ /* dongle status */
enum wl_status { enum wl_status {
WL_STATUS_READY, WL_STATUS_READY,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment