[PATCH] wireless/atmel: send WEXT scan completion events
Send scan completion events to user space when a scan completes. Signed-off-by: Dan Williams <dcbw@redhat.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
This commit is contained in:
committed by
John W. Linville
parent
6fcdf565ff
commit
3a1af6ffe4
@@ -3463,6 +3463,7 @@ static void atmel_command_irq(struct atmel_private *priv)
|
|||||||
u8 status = atmel_rmem8(priv, atmel_co(priv, CMD_BLOCK_STATUS_OFFSET));
|
u8 status = atmel_rmem8(priv, atmel_co(priv, CMD_BLOCK_STATUS_OFFSET));
|
||||||
u8 command = atmel_rmem8(priv, atmel_co(priv, CMD_BLOCK_COMMAND_OFFSET));
|
u8 command = atmel_rmem8(priv, atmel_co(priv, CMD_BLOCK_COMMAND_OFFSET));
|
||||||
int fast_scan;
|
int fast_scan;
|
||||||
|
union iwreq_data wrqu;
|
||||||
|
|
||||||
if (status == CMD_STATUS_IDLE ||
|
if (status == CMD_STATUS_IDLE ||
|
||||||
status == CMD_STATUS_IN_PROGRESS)
|
status == CMD_STATUS_IN_PROGRESS)
|
||||||
@@ -3487,6 +3488,7 @@ static void atmel_command_irq(struct atmel_private *priv)
|
|||||||
atmel_scan(priv, 1);
|
atmel_scan(priv, 1);
|
||||||
} else {
|
} else {
|
||||||
int bss_index = retrieve_bss(priv);
|
int bss_index = retrieve_bss(priv);
|
||||||
|
int notify_scan_complete = 1;
|
||||||
if (bss_index != -1) {
|
if (bss_index != -1) {
|
||||||
atmel_join_bss(priv, bss_index);
|
atmel_join_bss(priv, bss_index);
|
||||||
} else if (priv->operating_mode == IW_MODE_ADHOC &&
|
} else if (priv->operating_mode == IW_MODE_ADHOC &&
|
||||||
@@ -3495,8 +3497,14 @@ static void atmel_command_irq(struct atmel_private *priv)
|
|||||||
} else {
|
} else {
|
||||||
priv->fast_scan = !fast_scan;
|
priv->fast_scan = !fast_scan;
|
||||||
atmel_scan(priv, 1);
|
atmel_scan(priv, 1);
|
||||||
|
notify_scan_complete = 0;
|
||||||
}
|
}
|
||||||
priv->site_survey_state = SITE_SURVEY_COMPLETED;
|
priv->site_survey_state = SITE_SURVEY_COMPLETED;
|
||||||
|
if (notify_scan_complete) {
|
||||||
|
wrqu.data.length = 0;
|
||||||
|
wrqu.data.flags = 0;
|
||||||
|
wireless_send_event(priv->dev, SIOCGIWSCAN, &wrqu, NULL);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@@ -3509,6 +3517,9 @@ static void atmel_command_irq(struct atmel_private *priv)
|
|||||||
priv->site_survey_state = SITE_SURVEY_COMPLETED;
|
priv->site_survey_state = SITE_SURVEY_COMPLETED;
|
||||||
if (priv->station_is_associated) {
|
if (priv->station_is_associated) {
|
||||||
atmel_enter_state(priv, STATION_STATE_READY);
|
atmel_enter_state(priv, STATION_STATE_READY);
|
||||||
|
wrqu.data.length = 0;
|
||||||
|
wrqu.data.flags = 0;
|
||||||
|
wireless_send_event(priv->dev, SIOCGIWSCAN, &wrqu, NULL);
|
||||||
} else {
|
} else {
|
||||||
atmel_scan(priv, 1);
|
atmel_scan(priv, 1);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user