Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 278077
b: refs/heads/master
c: 1052261
h: refs/heads/master
i:
  278075: 580c0ea
v: v3
  • Loading branch information
Jouni Malinen authored and Kalle Valo committed Nov 11, 2011
1 parent e599865 commit 6cc48d4
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 5 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: f7830202c3ae934e2b978b750656626b203decb4
refs/heads/master: 1052261e4bba9879c1d7d519c8e8606c5d4264d5
11 changes: 9 additions & 2 deletions trunk/drivers/net/wireless/ath/ath6kl/cfg80211.c
Original file line number Diff line number Diff line change
Expand Up @@ -1932,10 +1932,16 @@ static int ath6kl_remain_on_channel(struct wiphy *wiphy,
{
struct ath6kl *ar = ath6kl_priv(dev);
struct ath6kl_vif *vif = netdev_priv(dev);
u32 id;

/* TODO: if already pending or ongoing remain-on-channel,
* return -EBUSY */
*cookie = 1; /* only a single pending request is supported */
id = ++vif->last_roc_id;
if (id == 0) {
/* Do not use 0 as the cookie value */
id = ++vif->last_roc_id;
}
*cookie = id;

return ath6kl_wmi_remain_on_chnl_cmd(ar->wmi, vif->fw_vif_idx,
chan->center_freq, duration);
Expand All @@ -1948,8 +1954,9 @@ static int ath6kl_cancel_remain_on_channel(struct wiphy *wiphy,
struct ath6kl *ar = ath6kl_priv(dev);
struct ath6kl_vif *vif = netdev_priv(dev);

if (cookie != 1)
if (cookie != vif->last_roc_id)
return -ENOENT;
vif->last_cancel_roc_id = cookie;

return ath6kl_wmi_cancel_remain_on_chnl_cmd(ar->wmi, vif->fw_vif_idx);
}
Expand Down
2 changes: 2 additions & 0 deletions trunk/drivers/net/wireless/ath/ath6kl/core.h
Original file line number Diff line number Diff line change
Expand Up @@ -427,6 +427,8 @@ struct ath6kl_vif {
struct cfg80211_scan_request *scan_req;
enum sme_state sme_state;
int reconnect_flag;
u32 last_roc_id;
u32 last_cancel_roc_id;
u32 send_action_id;
bool probe_req_report;
u16 next_chan;
Expand Down
13 changes: 11 additions & 2 deletions trunk/drivers/net/wireless/ath/ath6kl/wmi.c
Original file line number Diff line number Diff line change
Expand Up @@ -443,6 +443,7 @@ static int ath6kl_wmi_remain_on_chnl_event_rx(struct wmi *wmi, u8 *datap,
u32 dur;
struct ieee80211_channel *chan;
struct ath6kl *ar = wmi->parent_dev;
u32 id;

if (len < sizeof(*ev))
return -EINVAL;
Expand All @@ -458,7 +459,8 @@ static int ath6kl_wmi_remain_on_chnl_event_rx(struct wmi *wmi, u8 *datap,
"(freq=%u)\n", freq);
return -EINVAL;
}
cfg80211_ready_on_channel(vif->ndev, 1, chan, NL80211_CHAN_NO_HT,
id = vif->last_roc_id;
cfg80211_ready_on_channel(vif->ndev, id, chan, NL80211_CHAN_NO_HT,
dur, GFP_ATOMIC);

return 0;
Expand All @@ -473,6 +475,7 @@ static int ath6kl_wmi_cancel_remain_on_chnl_event_rx(struct wmi *wmi,
u32 dur;
struct ieee80211_channel *chan;
struct ath6kl *ar = wmi->parent_dev;
u32 id;

if (len < sizeof(*ev))
return -EINVAL;
Expand All @@ -488,7 +491,13 @@ static int ath6kl_wmi_cancel_remain_on_chnl_event_rx(struct wmi *wmi,
"channel (freq=%u)\n", freq);
return -EINVAL;
}
cfg80211_remain_on_channel_expired(vif->ndev, 1, chan,
if (vif->last_cancel_roc_id &&
vif->last_cancel_roc_id + 1 == vif->last_roc_id)
id = vif->last_cancel_roc_id; /* event for cancel command */
else
id = vif->last_roc_id; /* timeout on uncanceled r-o-c */
vif->last_cancel_roc_id = 0;
cfg80211_remain_on_channel_expired(vif->ndev, id, chan,
NL80211_CHAN_NO_HT, GFP_ATOMIC);

return 0;
Expand Down

0 comments on commit 6cc48d4

Please sign in to comment.