Scan two channels per each command on set_scan(), then bail out and let
get_scan() continue the scanning work up to the last channel.
This gives time to the firmware so it can go back to the association
channel and keep the connection alive.
Fixes http://dev.laptop.org/ticket/841
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
u32 radiomode;
u32 debugmode;
u8 fw_ready;
u32 radiomode;
u32 debugmode;
u8 fw_ready;
+
+ u8 last_scanned_channel;
};
#endif /* _WLAN_DEV_H_ */
};
#endif /* _WLAN_DEV_H_ */
u8 filteredscan,
struct wlan_scan_cmd_config * pscancfgout,
struct mrvlietypes_chanlistparamset * pchantlvout,
u8 filteredscan,
struct wlan_scan_cmd_config * pscancfgout,
struct mrvlietypes_chanlistparamset * pchantlvout,
- struct chanscanparamset * pscanchanlist)
+ struct chanscanparamset * pscanchanlist,
+ const struct wlan_ioctl_user_scan_cfg * puserscanin)
{
struct chanscanparamset *ptmpchan;
struct chanscanparamset *pstartchan;
{
struct chanscanparamset *ptmpchan;
struct chanscanparamset *pstartchan;
int doneearly;
int tlvidx;
int ret = 0;
int doneearly;
int tlvidx;
int ret = 0;
+ int scanned = 0;
+ union iwreq_data wrqu;
/* Set the temp channel struct pointer to the start of the desired list */
ptmpchan = pscanchanlist;
/* Set the temp channel struct pointer to the start of the desired list */
ptmpchan = pscanchanlist;
+ if (priv->adapter->last_scanned_channel && !puserscanin)
+ ptmpchan += priv->adapter->last_scanned_channel;
+
/* Loop through the desired channel list, sending a new firmware scan
* commands for each maxchanperscan channels (or for 1,6,11 individually
* if configured accordingly)
/* Loop through the desired channel list, sending a new firmware scan
* commands for each maxchanperscan channels (or for 1,6,11 individually
* if configured accordingly)
* - doneearly is set (controlling individual scanning of 1,6,11)
*/
while (tlvidx < maxchanperscan && ptmpchan->channumber
* - doneearly is set (controlling individual scanning of 1,6,11)
*/
while (tlvidx < maxchanperscan && ptmpchan->channumber
+ && !doneearly && scanned < 2) {
lbs_pr_debug(1,
"Scan: Chan(%3d), Radio(%d), mode(%d,%d), Dur(%d)\n",
lbs_pr_debug(1,
"Scan: Chan(%3d), Radio(%d), mode(%d,%d), Dur(%d)\n",
/* Increment the tmp pointer to the next channel to be scanned */
ptmpchan++;
/* Increment the tmp pointer to the next channel to be scanned */
ptmpchan++;
/* Stop the loop if the *next* channel is in the 1,6,11 set.
* This will cause it to be the only channel scanned on the next
/* Stop the loop if the *next* channel is in the 1,6,11 set.
* This will cause it to be the only channel scanned on the next
/* Send the scan command to the firmware with the specified cfg */
ret = libertas_prepare_and_send_command(priv, cmd_802_11_scan, 0,
0, 0, pscancfgout);
/* Send the scan command to the firmware with the specified cfg */
ret = libertas_prepare_and_send_command(priv, cmd_802_11_scan, 0,
0, 0, pscancfgout);
+ if (scanned >= 2) {
+ priv->adapter->last_scanned_channel = ptmpchan->channumber;
+ return 0;
+ }
+
+ priv->adapter->last_scanned_channel = ptmpchan->channumber;
+
+ memset(&wrqu, 0, sizeof(union iwreq_data));
+ wireless_send_event(priv->wlan_dev.netdev, SIOCGIWSCAN, &wrqu, NULL);
+
keeppreviousscan = puserscanin->keeppreviousscan;
}
keeppreviousscan = puserscanin->keeppreviousscan;
}
+ if (adapter->last_scanned_channel)
+ keeppreviousscan = 1;
+
if (!keeppreviousscan) {
memset(adapter->scantable, 0x00,
sizeof(struct bss_descriptor) * MRVDRV_MAX_BSSID_LIST);
if (!keeppreviousscan) {
memset(adapter->scantable, 0x00,
sizeof(struct bss_descriptor) * MRVDRV_MAX_BSSID_LIST);
filteredscan,
scan_cfg,
pchantlvout,
filteredscan,
scan_cfg,
pchantlvout,
+ scan_chan_list,
+ puserscanin);
/* Process the resulting scan table:
* - Remove any bad ssids
/* Process the resulting scan table:
* - Remove any bad ssids
{
wlan_private *priv = dev->priv;
wlan_adapter *adapter = priv->adapter;
{
wlan_private *priv = dev->priv;
wlan_adapter *adapter = priv->adapter;
- if (!wlan_scan_networks(priv, NULL)) {
- memset(&wrqu, 0, sizeof(union iwreq_data));
- wireless_send_event(priv->wlan_dev.netdev, SIOCGIWSCAN, &wrqu,
- NULL);
- }
+ wlan_scan_networks(priv, NULL);
if (adapter->surpriseremoved)
return -1;
if (adapter->surpriseremoved)
return -1;