summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--drivers/staging/cw1200/cw1200.h1
-rw-r--r--drivers/staging/cw1200/sta.c24
-rw-r--r--drivers/staging/cw1200/wsm.c5
3 files changed, 22 insertions, 8 deletions
diff --git a/drivers/staging/cw1200/cw1200.h b/drivers/staging/cw1200/cw1200.h
index d0c2d7588d3..067ad1ed5cd 100644
--- a/drivers/staging/cw1200/cw1200.h
+++ b/drivers/staging/cw1200/cw1200.h
@@ -47,6 +47,7 @@
#define CW1200_MAX_STA_IN_AP_MODE (5)
#define CW1200_LINK_ID_AFTER_DTIM (CW1200_MAX_STA_IN_AP_MODE + 1)
+/* Please keep order */
enum cw1200_join_status {
CW1200_JOIN_STATUS_PASSIVE = 0,
CW1200_JOIN_STATUS_MONITOR,
diff --git a/drivers/staging/cw1200/sta.c b/drivers/staging/cw1200/sta.c
index a0f65c37c18..cd0284f3f05 100644
--- a/drivers/staging/cw1200/sta.c
+++ b/drivers/staging/cw1200/sta.c
@@ -995,9 +995,10 @@ void cw1200_join_work(struct work_struct *work)
BUG_ON(!priv->channel);
queueId = wsm_queue_id_to_linux(wsm->queueId);
- action = ieee80211_is_action(frame->frame_control);
+ action = ieee80211_is_action(frame->frame_control) ||
+ ieee80211_is_probe_resp(frame->frame_control);
- if (unlikely(priv->join_status == CW1200_JOIN_STATUS_STA)) {
+ if (unlikely(priv->join_status)) {
wsm_lock_tx(priv);
cw1200_unjoin_work(&priv->unjoin_work);
}
@@ -1122,15 +1123,26 @@ void cw1200_unjoin_work(struct work_struct *work)
mutex_lock(&priv->conf_mutex);
if (unlikely(atomic_read(&priv->scan.in_progress))) {
- BUG_ON(priv->delayed_unjoin);
+ if (priv->delayed_unjoin) {
+ wiphy_err(priv->hw->wiphy,
+ "%s: Unexpected: delayed unjoin "
+ "is already scheduled.\n",
+ __func__);
+ BUG_ON(1);
+ }
priv->delayed_unjoin = true;
mutex_unlock(&priv->conf_mutex);
return;
}
- BUG_ON(priv->join_status &&
- priv->join_status != CW1200_JOIN_STATUS_STA);
- if (priv->join_status == CW1200_JOIN_STATUS_STA) {
+ if (priv->join_status &&
+ priv->join_status > CW1200_JOIN_STATUS_STA) {
+ wiphy_err(priv->hw->wiphy,
+ "%s: Unexpected: join status: %d\n",
+ __func__, priv->join_status);
+ BUG_ON(1);
+ }
+ if (priv->join_status) {
memset(&priv->join_bssid[0], 0, sizeof(priv->join_bssid));
priv->join_status = CW1200_JOIN_STATUS_PASSIVE;
diff --git a/drivers/staging/cw1200/wsm.c b/drivers/staging/cw1200/wsm.c
index 59f40666d69..1fe5e32a27a 100644
--- a/drivers/staging/cw1200/wsm.c
+++ b/drivers/staging/cw1200/wsm.c
@@ -1255,7 +1255,8 @@ static bool wsm_handle_tx_data(struct cw1200_common *priv,
switch (priv->mode) {
case NL80211_IFTYPE_STATION:
- if (unlikely(!priv->join_status ||
+ if (unlikely(
+ (priv->join_status <= CW1200_JOIN_STATUS_MONITOR) ||
memcmp(frame->addr1, priv->join_bssid,
sizeof(priv->join_bssid)))) {
if (ieee80211_is_auth(fctl))
@@ -1264,7 +1265,7 @@ static bool wsm_handle_tx_data(struct cw1200_common *priv,
action = doTx;
else if (ieee80211_is_action(fctl) ||
ieee80211_is_probe_resp(fctl)) {
- if (priv->join_status)
+ if (priv->join_status > CW1200_JOIN_STATUS_MONITOR)
action = doTx;
else
action = doJoin;