Commit f9e5f05c authored by Jouni Malinen's avatar Jouni Malinen Committed by Kalle Valo

ath6kl: Add cfg80211 calls for remain-on-channel events

Signed-off-by: default avatarJouni Malinen <jouni@qca.qualcomm.com>
Signed-off-by: default avatarKalle Valo <kvalo@qca.qualcomm.com>
parent 4dea08e0
...@@ -425,11 +425,14 @@ static int ath6kl_wmi_tx_complete_event_rx(u8 *datap, int len) ...@@ -425,11 +425,14 @@ static int ath6kl_wmi_tx_complete_event_rx(u8 *datap, int len)
return 0; return 0;
} }
static int ath6kl_wmi_remain_on_chnl_event_rx(u8 *datap, int len) static int ath6kl_wmi_remain_on_chnl_event_rx(struct wmi *wmi, u8 *datap,
int len)
{ {
struct wmi_remain_on_chnl_event *ev; struct wmi_remain_on_chnl_event *ev;
u32 freq; u32 freq;
u32 dur; u32 dur;
struct ieee80211_channel *chan;
struct ath6kl *ar = wmi->parent_dev;
if (len < sizeof(*ev)) if (len < sizeof(*ev))
return -EINVAL; return -EINVAL;
...@@ -439,15 +442,26 @@ static int ath6kl_wmi_remain_on_chnl_event_rx(u8 *datap, int len) ...@@ -439,15 +442,26 @@ static int ath6kl_wmi_remain_on_chnl_event_rx(u8 *datap, int len)
dur = le32_to_cpu(ev->duration); dur = le32_to_cpu(ev->duration);
ath6kl_dbg(ATH6KL_DBG_WMI, "remain_on_chnl: freq=%u dur=%u\n", ath6kl_dbg(ATH6KL_DBG_WMI, "remain_on_chnl: freq=%u dur=%u\n",
freq, dur); freq, dur);
chan = ieee80211_get_channel(ar->wdev->wiphy, freq);
if (!chan) {
ath6kl_dbg(ATH6KL_DBG_WMI, "remain_on_chnl: Unknown channel "
"(freq=%u)\n", freq);
return -EINVAL;
}
cfg80211_ready_on_channel(ar->net_dev, 1, chan, NL80211_CHAN_NO_HT,
dur, GFP_ATOMIC);
return 0; return 0;
} }
static int ath6kl_wmi_cancel_remain_on_chnl_event_rx(u8 *datap, int len) static int ath6kl_wmi_cancel_remain_on_chnl_event_rx(struct wmi *wmi,
u8 *datap, int len)
{ {
struct wmi_cancel_remain_on_chnl_event *ev; struct wmi_cancel_remain_on_chnl_event *ev;
u32 freq; u32 freq;
u32 dur; u32 dur;
struct ieee80211_channel *chan;
struct ath6kl *ar = wmi->parent_dev;
if (len < sizeof(*ev)) if (len < sizeof(*ev))
return -EINVAL; return -EINVAL;
...@@ -457,6 +471,14 @@ static int ath6kl_wmi_cancel_remain_on_chnl_event_rx(u8 *datap, int len) ...@@ -457,6 +471,14 @@ static int ath6kl_wmi_cancel_remain_on_chnl_event_rx(u8 *datap, int len)
dur = le32_to_cpu(ev->duration); dur = le32_to_cpu(ev->duration);
ath6kl_dbg(ATH6KL_DBG_WMI, "cancel_remain_on_chnl: freq=%u dur=%u " ath6kl_dbg(ATH6KL_DBG_WMI, "cancel_remain_on_chnl: freq=%u dur=%u "
"status=%u\n", freq, dur, ev->status); "status=%u\n", freq, dur, ev->status);
chan = ieee80211_get_channel(ar->wdev->wiphy, freq);
if (!chan) {
ath6kl_dbg(ATH6KL_DBG_WMI, "cancel_remain_on_chnl: Unknown "
"channel (freq=%u)\n", freq);
return -EINVAL;
}
cfg80211_remain_on_channel_expired(ar->net_dev, 1, chan,
NL80211_CHAN_NO_HT, GFP_ATOMIC);
return 0; return 0;
} }
...@@ -3009,12 +3031,13 @@ int ath6kl_wmi_control_rx(struct wmi *wmi, struct sk_buff *skb) ...@@ -3009,12 +3031,13 @@ int ath6kl_wmi_control_rx(struct wmi *wmi, struct sk_buff *skb)
break; break;
case WMI_REMAIN_ON_CHNL_EVENTID: case WMI_REMAIN_ON_CHNL_EVENTID:
ath6kl_dbg(ATH6KL_DBG_WMI, "WMI_REMAIN_ON_CHNL_EVENTID\n"); ath6kl_dbg(ATH6KL_DBG_WMI, "WMI_REMAIN_ON_CHNL_EVENTID\n");
ret = ath6kl_wmi_remain_on_chnl_event_rx(datap, len); ret = ath6kl_wmi_remain_on_chnl_event_rx(wmi, datap, len);
break; break;
case WMI_CANCEL_REMAIN_ON_CHNL_EVENTID: case WMI_CANCEL_REMAIN_ON_CHNL_EVENTID:
ath6kl_dbg(ATH6KL_DBG_WMI, ath6kl_dbg(ATH6KL_DBG_WMI,
"WMI_CANCEL_REMAIN_ON_CHNL_EVENTID\n"); "WMI_CANCEL_REMAIN_ON_CHNL_EVENTID\n");
ret = ath6kl_wmi_cancel_remain_on_chnl_event_rx(datap, len); ret = ath6kl_wmi_cancel_remain_on_chnl_event_rx(wmi, datap,
len);
break; break;
case WMI_TX_STATUS_EVENTID: case WMI_TX_STATUS_EVENTID:
ath6kl_dbg(ATH6KL_DBG_WMI, "WMI_TX_STATUS_EVENTID\n"); ath6kl_dbg(ATH6KL_DBG_WMI, "WMI_TX_STATUS_EVENTID\n");
......
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