X-Git-Url: https://git.openpandora.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=drivers%2Fnet%2Fwireless%2Fath%2Fath6kl%2Fcfg80211.c;h=5c98de36d163fd0b78d5f18de81993424c38db19;hb=8a6c8060c0b166ce5ce4a3563b511b1f641dbea8;hp=f7176d203be085dfa76fb6e3a9462dd31af63162;hpb=238751365a1c42b1d66beb03dd81ca5d0fd12833;p=pandora-kernel.git diff --git a/drivers/net/wireless/ath/ath6kl/cfg80211.c b/drivers/net/wireless/ath/ath6kl/cfg80211.c index f7176d203be0..5c98de36d163 100644 --- a/drivers/net/wireless/ath/ath6kl/cfg80211.c +++ b/drivers/net/wireless/ath/ath6kl/cfg80211.c @@ -1658,6 +1658,58 @@ static int ath6kl_change_station(struct wiphy *wiphy, struct net_device *dev, 0); } +static int ath6kl_remain_on_channel(struct wiphy *wiphy, + struct net_device *dev, + struct ieee80211_channel *chan, + enum nl80211_channel_type channel_type, + unsigned int duration, + u64 *cookie) +{ + struct ath6kl *ar = ath6kl_priv(dev); + + /* TODO: if already pending or ongoing remain-on-channel, + * return -EBUSY */ + *cookie = 1; /* only a single pending request is supported */ + + return ath6kl_wmi_remain_on_chnl_cmd(ar->wmi, chan->center_freq, + duration); +} + +static int ath6kl_cancel_remain_on_channel(struct wiphy *wiphy, + struct net_device *dev, + u64 cookie) +{ + struct ath6kl *ar = ath6kl_priv(dev); + + if (cookie != 1) + return -ENOENT; + + return ath6kl_wmi_cancel_remain_on_chnl_cmd(ar->wmi); +} + +static int ath6kl_mgmt_tx(struct wiphy *wiphy, struct net_device *dev, + struct ieee80211_channel *chan, bool offchan, + enum nl80211_channel_type channel_type, + bool channel_type_valid, unsigned int wait, + const u8 *buf, size_t len, u64 *cookie) +{ + struct ath6kl *ar = ath6kl_priv(dev); + u32 id; + + id = ar->send_action_id++; + if (id == 0) { + /* + * 0 is a reserved value in the WMI command and shall not be + * used for the command. + */ + id = ar->send_action_id++; + } + + *cookie = id; + return ath6kl_wmi_send_action_cmd(ar->wmi, id, chan->center_freq, wait, + buf, len); +} + static struct cfg80211_ops ath6kl_cfg80211_ops = { .change_virtual_intf = ath6kl_cfg80211_change_iface, .scan = ath6kl_cfg80211_scan, @@ -1685,6 +1737,9 @@ static struct cfg80211_ops ath6kl_cfg80211_ops = { .set_beacon = ath6kl_set_beacon, .del_beacon = ath6kl_del_beacon, .change_station = ath6kl_change_station, + .remain_on_channel = ath6kl_remain_on_channel, + .cancel_remain_on_channel = ath6kl_cancel_remain_on_channel, + .mgmt_tx = ath6kl_mgmt_tx, }; struct wireless_dev *ath6kl_cfg80211_init(struct device *dev) @@ -1706,6 +1761,8 @@ struct wireless_dev *ath6kl_cfg80211_init(struct device *dev) return NULL; } + wdev->wiphy->max_remain_on_channel_duration = 5000; + /* set device pointer for wiphy */ set_wiphy_dev(wdev->wiphy, dev);