cfg80211: remove remain-on-channel channel type
As mwifiex (and mac80211 in the software case) are the only drivers actually implementing remain-on-channel with channel type, userspace can't be relying on it. This is the case, as it's used only for P2P operations right now. Rather than adding a flag to tell userspace whether or not it can actually rely on it, simplify all the code by removing the ability to use different channel types. Leave only the validation of the attribute, so that if we extend it again later (with the needed capability flag), it can't break userspace sending invalid data. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
This commit is contained in:
parent
028e8da072
commit
42d97a599e
@ -2976,7 +2976,6 @@ static int ath6kl_change_station(struct wiphy *wiphy, struct net_device *dev,
|
|||||||
static int ath6kl_remain_on_channel(struct wiphy *wiphy,
|
static int ath6kl_remain_on_channel(struct wiphy *wiphy,
|
||||||
struct wireless_dev *wdev,
|
struct wireless_dev *wdev,
|
||||||
struct ieee80211_channel *chan,
|
struct ieee80211_channel *chan,
|
||||||
enum nl80211_channel_type channel_type,
|
|
||||||
unsigned int duration,
|
unsigned int duration,
|
||||||
u64 *cookie)
|
u64 *cookie)
|
||||||
{
|
{
|
||||||
@ -3135,10 +3134,8 @@ static bool ath6kl_is_p2p_go_ssid(const u8 *buf, size_t len)
|
|||||||
|
|
||||||
static int ath6kl_mgmt_tx(struct wiphy *wiphy, struct wireless_dev *wdev,
|
static int ath6kl_mgmt_tx(struct wiphy *wiphy, struct wireless_dev *wdev,
|
||||||
struct ieee80211_channel *chan, bool offchan,
|
struct ieee80211_channel *chan, bool offchan,
|
||||||
enum nl80211_channel_type channel_type,
|
unsigned int wait, const u8 *buf, size_t len,
|
||||||
bool channel_type_valid, unsigned int wait,
|
bool no_cck, bool dont_wait_for_ack, u64 *cookie)
|
||||||
const u8 *buf, size_t len, bool no_cck,
|
|
||||||
bool dont_wait_for_ack, u64 *cookie)
|
|
||||||
{
|
{
|
||||||
struct ath6kl_vif *vif = ath6kl_vif_from_wdev(wdev);
|
struct ath6kl_vif *vif = ath6kl_vif_from_wdev(wdev);
|
||||||
struct ath6kl *ar = ath6kl_priv(vif->ndev);
|
struct ath6kl *ar = ath6kl_priv(vif->ndev);
|
||||||
|
@ -474,7 +474,7 @@ static int ath6kl_wmi_remain_on_chnl_event_rx(struct wmi *wmi, u8 *datap,
|
|||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
id = vif->last_roc_id;
|
id = vif->last_roc_id;
|
||||||
cfg80211_ready_on_channel(&vif->wdev, id, chan, NL80211_CHAN_NO_HT,
|
cfg80211_ready_on_channel(&vif->wdev, id, chan,
|
||||||
dur, GFP_ATOMIC);
|
dur, GFP_ATOMIC);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
@ -513,8 +513,7 @@ static int ath6kl_wmi_cancel_remain_on_chnl_event_rx(struct wmi *wmi,
|
|||||||
else
|
else
|
||||||
id = vif->last_roc_id; /* timeout on uncanceled r-o-c */
|
id = vif->last_roc_id; /* timeout on uncanceled r-o-c */
|
||||||
vif->last_cancel_roc_id = 0;
|
vif->last_cancel_roc_id = 0;
|
||||||
cfg80211_remain_on_channel_expired(&vif->wdev, id, chan,
|
cfg80211_remain_on_channel_expired(&vif->wdev, id, chan, GFP_ATOMIC);
|
||||||
NL80211_CHAN_NO_HT, GFP_ATOMIC);
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -789,7 +789,6 @@ struct iwl_priv {
|
|||||||
/* remain-on-channel offload support */
|
/* remain-on-channel offload support */
|
||||||
struct ieee80211_channel *hw_roc_channel;
|
struct ieee80211_channel *hw_roc_channel;
|
||||||
struct delayed_work hw_roc_disable_work;
|
struct delayed_work hw_roc_disable_work;
|
||||||
enum nl80211_channel_type hw_roc_chantype;
|
|
||||||
int hw_roc_duration;
|
int hw_roc_duration;
|
||||||
bool hw_roc_setup, hw_roc_start_notified;
|
bool hw_roc_setup, hw_roc_start_notified;
|
||||||
|
|
||||||
|
@ -1034,7 +1034,6 @@ done:
|
|||||||
static int iwlagn_mac_remain_on_channel(struct ieee80211_hw *hw,
|
static int iwlagn_mac_remain_on_channel(struct ieee80211_hw *hw,
|
||||||
struct ieee80211_vif *vif,
|
struct ieee80211_vif *vif,
|
||||||
struct ieee80211_channel *channel,
|
struct ieee80211_channel *channel,
|
||||||
enum nl80211_channel_type channel_type,
|
|
||||||
int duration)
|
int duration)
|
||||||
{
|
{
|
||||||
struct iwl_priv *priv = IWL_MAC80211_GET_DVM(hw);
|
struct iwl_priv *priv = IWL_MAC80211_GET_DVM(hw);
|
||||||
@ -1066,7 +1065,6 @@ static int iwlagn_mac_remain_on_channel(struct ieee80211_hw *hw,
|
|||||||
}
|
}
|
||||||
|
|
||||||
priv->hw_roc_channel = channel;
|
priv->hw_roc_channel = channel;
|
||||||
priv->hw_roc_chantype = channel_type;
|
|
||||||
/* convert from ms to TU */
|
/* convert from ms to TU */
|
||||||
priv->hw_roc_duration = DIV_ROUND_UP(1000 * duration, 1024);
|
priv->hw_roc_duration = DIV_ROUND_UP(1000 * duration, 1024);
|
||||||
priv->hw_roc_start_notified = false;
|
priv->hw_roc_start_notified = false;
|
||||||
|
@ -1455,7 +1455,6 @@ static void hw_roc_done(struct work_struct *work)
|
|||||||
static int mac80211_hwsim_roc(struct ieee80211_hw *hw,
|
static int mac80211_hwsim_roc(struct ieee80211_hw *hw,
|
||||||
struct ieee80211_vif *vif,
|
struct ieee80211_vif *vif,
|
||||||
struct ieee80211_channel *chan,
|
struct ieee80211_channel *chan,
|
||||||
enum nl80211_channel_type channel_type,
|
|
||||||
int duration)
|
int duration)
|
||||||
{
|
{
|
||||||
struct mac80211_hwsim_data *hwsim = hw->priv;
|
struct mac80211_hwsim_data *hwsim = hw->priv;
|
||||||
|
@ -180,10 +180,8 @@ mwifiex_form_mgmt_frame(struct sk_buff *skb, const u8 *buf, size_t len)
|
|||||||
static int
|
static int
|
||||||
mwifiex_cfg80211_mgmt_tx(struct wiphy *wiphy, struct wireless_dev *wdev,
|
mwifiex_cfg80211_mgmt_tx(struct wiphy *wiphy, struct wireless_dev *wdev,
|
||||||
struct ieee80211_channel *chan, bool offchan,
|
struct ieee80211_channel *chan, bool offchan,
|
||||||
enum nl80211_channel_type channel_type,
|
unsigned int wait, const u8 *buf, size_t len,
|
||||||
bool channel_type_valid, unsigned int wait,
|
bool no_cck, bool dont_wait_for_ack, u64 *cookie)
|
||||||
const u8 *buf, size_t len, bool no_cck,
|
|
||||||
bool dont_wait_for_ack, u64 *cookie)
|
|
||||||
{
|
{
|
||||||
struct sk_buff *skb;
|
struct sk_buff *skb;
|
||||||
u16 pkt_len;
|
u16 pkt_len;
|
||||||
@ -253,7 +251,6 @@ static int
|
|||||||
mwifiex_cfg80211_remain_on_channel(struct wiphy *wiphy,
|
mwifiex_cfg80211_remain_on_channel(struct wiphy *wiphy,
|
||||||
struct wireless_dev *wdev,
|
struct wireless_dev *wdev,
|
||||||
struct ieee80211_channel *chan,
|
struct ieee80211_channel *chan,
|
||||||
enum nl80211_channel_type channel_type,
|
|
||||||
unsigned int duration, u64 *cookie)
|
unsigned int duration, u64 *cookie)
|
||||||
{
|
{
|
||||||
struct mwifiex_private *priv = mwifiex_netdev_get_priv(wdev->netdev);
|
struct mwifiex_private *priv = mwifiex_netdev_get_priv(wdev->netdev);
|
||||||
@ -271,15 +268,14 @@ mwifiex_cfg80211_remain_on_channel(struct wiphy *wiphy,
|
|||||||
}
|
}
|
||||||
|
|
||||||
ret = mwifiex_remain_on_chan_cfg(priv, HostCmd_ACT_GEN_SET, chan,
|
ret = mwifiex_remain_on_chan_cfg(priv, HostCmd_ACT_GEN_SET, chan,
|
||||||
&channel_type, duration);
|
duration);
|
||||||
|
|
||||||
if (!ret) {
|
if (!ret) {
|
||||||
*cookie = random32() | 1;
|
*cookie = random32() | 1;
|
||||||
priv->roc_cfg.cookie = *cookie;
|
priv->roc_cfg.cookie = *cookie;
|
||||||
priv->roc_cfg.chan = *chan;
|
priv->roc_cfg.chan = *chan;
|
||||||
priv->roc_cfg.chan_type = channel_type;
|
|
||||||
|
|
||||||
cfg80211_ready_on_channel(wdev, *cookie, chan, channel_type,
|
cfg80211_ready_on_channel(wdev, *cookie, chan,
|
||||||
duration, GFP_ATOMIC);
|
duration, GFP_ATOMIC);
|
||||||
|
|
||||||
wiphy_dbg(wiphy, "info: ROC, cookie = 0x%llx\n", *cookie);
|
wiphy_dbg(wiphy, "info: ROC, cookie = 0x%llx\n", *cookie);
|
||||||
@ -302,13 +298,11 @@ mwifiex_cfg80211_cancel_remain_on_channel(struct wiphy *wiphy,
|
|||||||
return -ENOENT;
|
return -ENOENT;
|
||||||
|
|
||||||
ret = mwifiex_remain_on_chan_cfg(priv, HostCmd_ACT_GEN_REMOVE,
|
ret = mwifiex_remain_on_chan_cfg(priv, HostCmd_ACT_GEN_REMOVE,
|
||||||
&priv->roc_cfg.chan,
|
&priv->roc_cfg.chan, 0);
|
||||||
&priv->roc_cfg.chan_type, 0);
|
|
||||||
|
|
||||||
if (!ret) {
|
if (!ret) {
|
||||||
cfg80211_remain_on_channel_expired(wdev, cookie,
|
cfg80211_remain_on_channel_expired(wdev, cookie,
|
||||||
&priv->roc_cfg.chan,
|
&priv->roc_cfg.chan,
|
||||||
priv->roc_cfg.chan_type,
|
|
||||||
GFP_ATOMIC);
|
GFP_ATOMIC);
|
||||||
|
|
||||||
memset(&priv->roc_cfg, 0, sizeof(struct mwifiex_roc_cfg));
|
memset(&priv->roc_cfg, 0, sizeof(struct mwifiex_roc_cfg));
|
||||||
|
@ -371,7 +371,6 @@ struct wps {
|
|||||||
struct mwifiex_roc_cfg {
|
struct mwifiex_roc_cfg {
|
||||||
u64 cookie;
|
u64 cookie;
|
||||||
struct ieee80211_channel chan;
|
struct ieee80211_channel chan;
|
||||||
enum nl80211_channel_type chan_type;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
struct mwifiex_adapter;
|
struct mwifiex_adapter;
|
||||||
@ -1016,7 +1015,6 @@ int mwifiex_get_ver_ext(struct mwifiex_private *priv);
|
|||||||
|
|
||||||
int mwifiex_remain_on_chan_cfg(struct mwifiex_private *priv, u16 action,
|
int mwifiex_remain_on_chan_cfg(struct mwifiex_private *priv, u16 action,
|
||||||
struct ieee80211_channel *chan,
|
struct ieee80211_channel *chan,
|
||||||
enum nl80211_channel_type *channel_type,
|
|
||||||
unsigned int duration);
|
unsigned int duration);
|
||||||
|
|
||||||
int mwifiex_set_bss_role(struct mwifiex_private *priv, u8 bss_role);
|
int mwifiex_set_bss_role(struct mwifiex_private *priv, u8 bss_role);
|
||||||
|
@ -424,7 +424,6 @@ int mwifiex_process_sta_event(struct mwifiex_private *priv)
|
|||||||
cfg80211_remain_on_channel_expired(priv->wdev,
|
cfg80211_remain_on_channel_expired(priv->wdev,
|
||||||
priv->roc_cfg.cookie,
|
priv->roc_cfg.cookie,
|
||||||
&priv->roc_cfg.chan,
|
&priv->roc_cfg.chan,
|
||||||
priv->roc_cfg.chan_type,
|
|
||||||
GFP_ATOMIC);
|
GFP_ATOMIC);
|
||||||
|
|
||||||
memset(&priv->roc_cfg, 0x00, sizeof(struct mwifiex_roc_cfg));
|
memset(&priv->roc_cfg, 0x00, sizeof(struct mwifiex_roc_cfg));
|
||||||
|
@ -1046,7 +1046,6 @@ mwifiex_get_ver_ext(struct mwifiex_private *priv)
|
|||||||
int
|
int
|
||||||
mwifiex_remain_on_chan_cfg(struct mwifiex_private *priv, u16 action,
|
mwifiex_remain_on_chan_cfg(struct mwifiex_private *priv, u16 action,
|
||||||
struct ieee80211_channel *chan,
|
struct ieee80211_channel *chan,
|
||||||
enum nl80211_channel_type *ct,
|
|
||||||
unsigned int duration)
|
unsigned int duration)
|
||||||
{
|
{
|
||||||
struct host_cmd_ds_remain_on_chan roc_cfg;
|
struct host_cmd_ds_remain_on_chan roc_cfg;
|
||||||
@ -1056,7 +1055,7 @@ mwifiex_remain_on_chan_cfg(struct mwifiex_private *priv, u16 action,
|
|||||||
roc_cfg.action = cpu_to_le16(action);
|
roc_cfg.action = cpu_to_le16(action);
|
||||||
if (action == HostCmd_ACT_GEN_SET) {
|
if (action == HostCmd_ACT_GEN_SET) {
|
||||||
roc_cfg.band_cfg = chan->band;
|
roc_cfg.band_cfg = chan->band;
|
||||||
sc = mwifiex_chan_type_to_sec_chan_offset(*ct);
|
sc = mwifiex_chan_type_to_sec_chan_offset(NL80211_CHAN_NO_HT);
|
||||||
roc_cfg.band_cfg |= (sc << 2);
|
roc_cfg.band_cfg |= (sc << 2);
|
||||||
|
|
||||||
roc_cfg.channel =
|
roc_cfg.channel =
|
||||||
|
@ -1791,7 +1791,6 @@ struct cfg80211_ops {
|
|||||||
int (*remain_on_channel)(struct wiphy *wiphy,
|
int (*remain_on_channel)(struct wiphy *wiphy,
|
||||||
struct wireless_dev *wdev,
|
struct wireless_dev *wdev,
|
||||||
struct ieee80211_channel *chan,
|
struct ieee80211_channel *chan,
|
||||||
enum nl80211_channel_type channel_type,
|
|
||||||
unsigned int duration,
|
unsigned int duration,
|
||||||
u64 *cookie);
|
u64 *cookie);
|
||||||
int (*cancel_remain_on_channel)(struct wiphy *wiphy,
|
int (*cancel_remain_on_channel)(struct wiphy *wiphy,
|
||||||
@ -1800,10 +1799,8 @@ struct cfg80211_ops {
|
|||||||
|
|
||||||
int (*mgmt_tx)(struct wiphy *wiphy, struct wireless_dev *wdev,
|
int (*mgmt_tx)(struct wiphy *wiphy, struct wireless_dev *wdev,
|
||||||
struct ieee80211_channel *chan, bool offchan,
|
struct ieee80211_channel *chan, bool offchan,
|
||||||
enum nl80211_channel_type channel_type,
|
unsigned int wait, const u8 *buf, size_t len,
|
||||||
bool channel_type_valid, unsigned int wait,
|
bool no_cck, bool dont_wait_for_ack, u64 *cookie);
|
||||||
const u8 *buf, size_t len, bool no_cck,
|
|
||||||
bool dont_wait_for_ack, u64 *cookie);
|
|
||||||
int (*mgmt_tx_cancel_wait)(struct wiphy *wiphy,
|
int (*mgmt_tx_cancel_wait)(struct wiphy *wiphy,
|
||||||
struct wireless_dev *wdev,
|
struct wireless_dev *wdev,
|
||||||
u64 cookie);
|
u64 cookie);
|
||||||
@ -3350,14 +3347,12 @@ void cfg80211_disconnected(struct net_device *dev, u16 reason,
|
|||||||
* @wdev: wireless device
|
* @wdev: wireless device
|
||||||
* @cookie: the request cookie
|
* @cookie: the request cookie
|
||||||
* @chan: The current channel (from remain_on_channel request)
|
* @chan: The current channel (from remain_on_channel request)
|
||||||
* @channel_type: Channel type
|
|
||||||
* @duration: Duration in milliseconds that the driver intents to remain on the
|
* @duration: Duration in milliseconds that the driver intents to remain on the
|
||||||
* channel
|
* channel
|
||||||
* @gfp: allocation flags
|
* @gfp: allocation flags
|
||||||
*/
|
*/
|
||||||
void cfg80211_ready_on_channel(struct wireless_dev *wdev, u64 cookie,
|
void cfg80211_ready_on_channel(struct wireless_dev *wdev, u64 cookie,
|
||||||
struct ieee80211_channel *chan,
|
struct ieee80211_channel *chan,
|
||||||
enum nl80211_channel_type channel_type,
|
|
||||||
unsigned int duration, gfp_t gfp);
|
unsigned int duration, gfp_t gfp);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -3365,12 +3360,10 @@ void cfg80211_ready_on_channel(struct wireless_dev *wdev, u64 cookie,
|
|||||||
* @wdev: wireless device
|
* @wdev: wireless device
|
||||||
* @cookie: the request cookie
|
* @cookie: the request cookie
|
||||||
* @chan: The current channel (from remain_on_channel request)
|
* @chan: The current channel (from remain_on_channel request)
|
||||||
* @channel_type: Channel type
|
|
||||||
* @gfp: allocation flags
|
* @gfp: allocation flags
|
||||||
*/
|
*/
|
||||||
void cfg80211_remain_on_channel_expired(struct wireless_dev *wdev, u64 cookie,
|
void cfg80211_remain_on_channel_expired(struct wireless_dev *wdev, u64 cookie,
|
||||||
struct ieee80211_channel *chan,
|
struct ieee80211_channel *chan,
|
||||||
enum nl80211_channel_type channel_type,
|
|
||||||
gfp_t gfp);
|
gfp_t gfp);
|
||||||
|
|
||||||
|
|
||||||
|
@ -2550,7 +2550,6 @@ struct ieee80211_ops {
|
|||||||
int (*remain_on_channel)(struct ieee80211_hw *hw,
|
int (*remain_on_channel)(struct ieee80211_hw *hw,
|
||||||
struct ieee80211_vif *vif,
|
struct ieee80211_vif *vif,
|
||||||
struct ieee80211_channel *chan,
|
struct ieee80211_channel *chan,
|
||||||
enum nl80211_channel_type channel_type,
|
|
||||||
int duration);
|
int duration);
|
||||||
int (*cancel_remain_on_channel)(struct ieee80211_hw *hw);
|
int (*cancel_remain_on_channel)(struct ieee80211_hw *hw);
|
||||||
int (*set_ringparam)(struct ieee80211_hw *hw, u32 tx, u32 rx);
|
int (*set_ringparam)(struct ieee80211_hw *hw, u32 tx, u32 rx);
|
||||||
|
@ -401,8 +401,7 @@
|
|||||||
* a response while being associated to an AP on another channel.
|
* a response while being associated to an AP on another channel.
|
||||||
* %NL80211_ATTR_IFINDEX is used to specify which interface (and thus
|
* %NL80211_ATTR_IFINDEX is used to specify which interface (and thus
|
||||||
* radio) is used. %NL80211_ATTR_WIPHY_FREQ is used to specify the
|
* radio) is used. %NL80211_ATTR_WIPHY_FREQ is used to specify the
|
||||||
* frequency for the operation and %NL80211_ATTR_WIPHY_CHANNEL_TYPE may be
|
* frequency for the operation.
|
||||||
* optionally used to specify additional channel parameters.
|
|
||||||
* %NL80211_ATTR_DURATION is used to specify the duration in milliseconds
|
* %NL80211_ATTR_DURATION is used to specify the duration in milliseconds
|
||||||
* to remain on the channel. This command is also used as an event to
|
* to remain on the channel. This command is also used as an event to
|
||||||
* notify when the requested duration starts (it may take a while for the
|
* notify when the requested duration starts (it may take a while for the
|
||||||
@ -440,12 +439,11 @@
|
|||||||
* as an event indicating reception of a frame that was not processed in
|
* as an event indicating reception of a frame that was not processed in
|
||||||
* kernel code, but is for us (i.e., which may need to be processed in a
|
* kernel code, but is for us (i.e., which may need to be processed in a
|
||||||
* user space application). %NL80211_ATTR_FRAME is used to specify the
|
* user space application). %NL80211_ATTR_FRAME is used to specify the
|
||||||
* frame contents (including header). %NL80211_ATTR_WIPHY_FREQ (and
|
* frame contents (including header). %NL80211_ATTR_WIPHY_FREQ is used
|
||||||
* optionally %NL80211_ATTR_WIPHY_CHANNEL_TYPE) is used to indicate on
|
* to indicate on which channel the frame is to be transmitted or was
|
||||||
* which channel the frame is to be transmitted or was received. If this
|
* received. If this channel is not the current channel (remain-on-channel
|
||||||
* channel is not the current channel (remain-on-channel or the
|
* or the operational channel) the device will switch to the given channel
|
||||||
* operational channel) the device will switch to the given channel and
|
* and transmit the frame, optionally waiting for a response for the time
|
||||||
* transmit the frame, optionally waiting for a response for the time
|
|
||||||
* specified using %NL80211_ATTR_DURATION. When called, this operation
|
* specified using %NL80211_ATTR_DURATION. When called, this operation
|
||||||
* returns a cookie (%NL80211_ATTR_COOKIE) that will be included with the
|
* returns a cookie (%NL80211_ATTR_COOKIE) that will be included with the
|
||||||
* TX status event pertaining to the TX request.
|
* TX status event pertaining to the TX request.
|
||||||
|
@ -2236,7 +2236,6 @@ static int ieee80211_set_bitrate_mask(struct wiphy *wiphy,
|
|||||||
static int ieee80211_start_roc_work(struct ieee80211_local *local,
|
static int ieee80211_start_roc_work(struct ieee80211_local *local,
|
||||||
struct ieee80211_sub_if_data *sdata,
|
struct ieee80211_sub_if_data *sdata,
|
||||||
struct ieee80211_channel *channel,
|
struct ieee80211_channel *channel,
|
||||||
enum nl80211_channel_type channel_type,
|
|
||||||
unsigned int duration, u64 *cookie,
|
unsigned int duration, u64 *cookie,
|
||||||
struct sk_buff *txskb)
|
struct sk_buff *txskb)
|
||||||
{
|
{
|
||||||
@ -2254,7 +2253,6 @@ static int ieee80211_start_roc_work(struct ieee80211_local *local,
|
|||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
|
|
||||||
roc->chan = channel;
|
roc->chan = channel;
|
||||||
roc->chan_type = channel_type;
|
|
||||||
roc->duration = duration;
|
roc->duration = duration;
|
||||||
roc->req_duration = duration;
|
roc->req_duration = duration;
|
||||||
roc->frame = txskb;
|
roc->frame = txskb;
|
||||||
@ -2287,8 +2285,7 @@ static int ieee80211_start_roc_work(struct ieee80211_local *local,
|
|||||||
if (!duration)
|
if (!duration)
|
||||||
duration = 10;
|
duration = 10;
|
||||||
|
|
||||||
ret = drv_remain_on_channel(local, sdata, channel, channel_type,
|
ret = drv_remain_on_channel(local, sdata, channel, duration);
|
||||||
duration);
|
|
||||||
if (ret) {
|
if (ret) {
|
||||||
kfree(roc);
|
kfree(roc);
|
||||||
return ret;
|
return ret;
|
||||||
@ -2299,8 +2296,7 @@ static int ieee80211_start_roc_work(struct ieee80211_local *local,
|
|||||||
|
|
||||||
out_check_combine:
|
out_check_combine:
|
||||||
list_for_each_entry(tmp, &local->roc_list, list) {
|
list_for_each_entry(tmp, &local->roc_list, list) {
|
||||||
if (tmp->chan != channel || tmp->chan_type != channel_type ||
|
if (tmp->chan != channel || tmp->sdata != sdata)
|
||||||
tmp->sdata != sdata)
|
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -2417,7 +2413,6 @@ static int ieee80211_start_roc_work(struct ieee80211_local *local,
|
|||||||
static int ieee80211_remain_on_channel(struct wiphy *wiphy,
|
static int ieee80211_remain_on_channel(struct wiphy *wiphy,
|
||||||
struct wireless_dev *wdev,
|
struct wireless_dev *wdev,
|
||||||
struct ieee80211_channel *chan,
|
struct ieee80211_channel *chan,
|
||||||
enum nl80211_channel_type channel_type,
|
|
||||||
unsigned int duration,
|
unsigned int duration,
|
||||||
u64 *cookie)
|
u64 *cookie)
|
||||||
{
|
{
|
||||||
@ -2426,7 +2421,7 @@ static int ieee80211_remain_on_channel(struct wiphy *wiphy,
|
|||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
mutex_lock(&local->mtx);
|
mutex_lock(&local->mtx);
|
||||||
ret = ieee80211_start_roc_work(local, sdata, chan, channel_type,
|
ret = ieee80211_start_roc_work(local, sdata, chan,
|
||||||
duration, cookie, NULL);
|
duration, cookie, NULL);
|
||||||
mutex_unlock(&local->mtx);
|
mutex_unlock(&local->mtx);
|
||||||
|
|
||||||
@ -2519,10 +2514,8 @@ static int ieee80211_cancel_remain_on_channel(struct wiphy *wiphy,
|
|||||||
|
|
||||||
static int ieee80211_mgmt_tx(struct wiphy *wiphy, struct wireless_dev *wdev,
|
static int ieee80211_mgmt_tx(struct wiphy *wiphy, struct wireless_dev *wdev,
|
||||||
struct ieee80211_channel *chan, bool offchan,
|
struct ieee80211_channel *chan, bool offchan,
|
||||||
enum nl80211_channel_type channel_type,
|
unsigned int wait, const u8 *buf, size_t len,
|
||||||
bool channel_type_valid, unsigned int wait,
|
bool no_cck, bool dont_wait_for_ack, u64 *cookie)
|
||||||
const u8 *buf, size_t len, bool no_cck,
|
|
||||||
bool dont_wait_for_ack, u64 *cookie)
|
|
||||||
{
|
{
|
||||||
struct ieee80211_sub_if_data *sdata = IEEE80211_WDEV_TO_SUB_IF(wdev);
|
struct ieee80211_sub_if_data *sdata = IEEE80211_WDEV_TO_SUB_IF(wdev);
|
||||||
struct ieee80211_local *local = sdata->local;
|
struct ieee80211_local *local = sdata->local;
|
||||||
@ -2591,14 +2584,10 @@ static int ieee80211_mgmt_tx(struct wiphy *wiphy, struct wireless_dev *wdev,
|
|||||||
rcu_read_lock();
|
rcu_read_lock();
|
||||||
chanctx_conf = rcu_dereference(sdata->vif.chanctx_conf);
|
chanctx_conf = rcu_dereference(sdata->vif.chanctx_conf);
|
||||||
|
|
||||||
if (chanctx_conf) {
|
if (chanctx_conf)
|
||||||
need_offchan = chan != chanctx_conf->channel;
|
need_offchan = chan != chanctx_conf->channel;
|
||||||
if (channel_type_valid &&
|
else
|
||||||
channel_type != chanctx_conf->channel_type)
|
|
||||||
need_offchan = true;
|
|
||||||
} else {
|
|
||||||
need_offchan = true;
|
need_offchan = true;
|
||||||
}
|
|
||||||
rcu_read_unlock();
|
rcu_read_unlock();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2633,7 +2622,7 @@ static int ieee80211_mgmt_tx(struct wiphy *wiphy, struct wireless_dev *wdev,
|
|||||||
local->hw.offchannel_tx_hw_queue;
|
local->hw.offchannel_tx_hw_queue;
|
||||||
|
|
||||||
/* This will handle all kinds of coalescing and immediate TX */
|
/* This will handle all kinds of coalescing and immediate TX */
|
||||||
ret = ieee80211_start_roc_work(local, sdata, chan, channel_type,
|
ret = ieee80211_start_roc_work(local, sdata, chan,
|
||||||
wait, cookie, skb);
|
wait, cookie, skb);
|
||||||
if (ret)
|
if (ret)
|
||||||
kfree_skb(skb);
|
kfree_skb(skb);
|
||||||
|
@ -738,16 +738,15 @@ static inline int drv_get_antenna(struct ieee80211_local *local,
|
|||||||
static inline int drv_remain_on_channel(struct ieee80211_local *local,
|
static inline int drv_remain_on_channel(struct ieee80211_local *local,
|
||||||
struct ieee80211_sub_if_data *sdata,
|
struct ieee80211_sub_if_data *sdata,
|
||||||
struct ieee80211_channel *chan,
|
struct ieee80211_channel *chan,
|
||||||
enum nl80211_channel_type chantype,
|
|
||||||
unsigned int duration)
|
unsigned int duration)
|
||||||
{
|
{
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
might_sleep();
|
might_sleep();
|
||||||
|
|
||||||
trace_drv_remain_on_channel(local, sdata, chan, chantype, duration);
|
trace_drv_remain_on_channel(local, sdata, chan, duration);
|
||||||
ret = local->ops->remain_on_channel(&local->hw, &sdata->vif,
|
ret = local->ops->remain_on_channel(&local->hw, &sdata->vif,
|
||||||
chan, chantype, duration);
|
chan, duration);
|
||||||
trace_drv_return_int(local, ret);
|
trace_drv_return_int(local, ret);
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
|
@ -348,7 +348,6 @@ struct ieee80211_roc_work {
|
|||||||
struct ieee80211_sub_if_data *sdata;
|
struct ieee80211_sub_if_data *sdata;
|
||||||
|
|
||||||
struct ieee80211_channel *chan;
|
struct ieee80211_channel *chan;
|
||||||
enum nl80211_channel_type chan_type;
|
|
||||||
|
|
||||||
bool started, abort, hw_begun, notified;
|
bool started, abort, hw_begun, notified;
|
||||||
|
|
||||||
@ -1048,7 +1047,6 @@ struct ieee80211_local {
|
|||||||
|
|
||||||
/* Temporary remain-on-channel for off-channel operations */
|
/* Temporary remain-on-channel for off-channel operations */
|
||||||
struct ieee80211_channel *tmp_channel;
|
struct ieee80211_channel *tmp_channel;
|
||||||
enum nl80211_channel_type tmp_channel_type;
|
|
||||||
|
|
||||||
/* channel contexts */
|
/* channel contexts */
|
||||||
struct list_head chanctx_list;
|
struct list_head chanctx_list;
|
||||||
|
@ -115,7 +115,7 @@ static u32 ieee80211_hw_conf_chan(struct ieee80211_local *local)
|
|||||||
channel_type = NL80211_CHAN_NO_HT;
|
channel_type = NL80211_CHAN_NO_HT;
|
||||||
} else if (local->tmp_channel) {
|
} else if (local->tmp_channel) {
|
||||||
chan = local->tmp_channel;
|
chan = local->tmp_channel;
|
||||||
channel_type = local->tmp_channel_type;
|
channel_type = NL80211_CHAN_NO_HT;
|
||||||
} else {
|
} else {
|
||||||
chan = local->_oper_channel;
|
chan = local->_oper_channel;
|
||||||
channel_type = local->_oper_channel_type;
|
channel_type = local->_oper_channel_type;
|
||||||
|
@ -205,8 +205,8 @@ void ieee80211_handle_roc_started(struct ieee80211_roc_work *roc)
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
cfg80211_ready_on_channel(&roc->sdata->wdev, roc->cookie,
|
cfg80211_ready_on_channel(&roc->sdata->wdev, roc->cookie,
|
||||||
roc->chan, roc->chan_type,
|
roc->chan, roc->req_duration,
|
||||||
roc->req_duration, GFP_KERNEL);
|
GFP_KERNEL);
|
||||||
}
|
}
|
||||||
|
|
||||||
roc->notified = true;
|
roc->notified = true;
|
||||||
@ -284,7 +284,6 @@ void ieee80211_start_next_roc(struct ieee80211_local *local)
|
|||||||
duration = 10;
|
duration = 10;
|
||||||
|
|
||||||
ret = drv_remain_on_channel(local, roc->sdata, roc->chan,
|
ret = drv_remain_on_channel(local, roc->sdata, roc->chan,
|
||||||
roc->chan_type,
|
|
||||||
duration);
|
duration);
|
||||||
|
|
||||||
roc->started = true;
|
roc->started = true;
|
||||||
@ -321,7 +320,7 @@ void ieee80211_roc_notify_destroy(struct ieee80211_roc_work *roc)
|
|||||||
if (!roc->mgmt_tx_cookie)
|
if (!roc->mgmt_tx_cookie)
|
||||||
cfg80211_remain_on_channel_expired(&roc->sdata->wdev,
|
cfg80211_remain_on_channel_expired(&roc->sdata->wdev,
|
||||||
roc->cookie, roc->chan,
|
roc->cookie, roc->chan,
|
||||||
roc->chan_type, GFP_KERNEL);
|
GFP_KERNEL);
|
||||||
|
|
||||||
list_for_each_entry_safe(dep, tmp, &roc->dependents, list)
|
list_for_each_entry_safe(dep, tmp, &roc->dependents, list)
|
||||||
ieee80211_roc_notify_destroy(dep);
|
ieee80211_roc_notify_destroy(dep);
|
||||||
@ -359,7 +358,6 @@ void ieee80211_sw_roc_work(struct work_struct *work)
|
|||||||
ieee80211_recalc_idle(local);
|
ieee80211_recalc_idle(local);
|
||||||
|
|
||||||
local->tmp_channel = roc->chan;
|
local->tmp_channel = roc->chan;
|
||||||
local->tmp_channel_type = roc->chan_type;
|
|
||||||
ieee80211_hw_config(local, 0);
|
ieee80211_hw_config(local, 0);
|
||||||
|
|
||||||
/* tell userspace or send frame */
|
/* tell userspace or send frame */
|
||||||
|
@ -1022,15 +1022,14 @@ TRACE_EVENT(drv_remain_on_channel,
|
|||||||
TP_PROTO(struct ieee80211_local *local,
|
TP_PROTO(struct ieee80211_local *local,
|
||||||
struct ieee80211_sub_if_data *sdata,
|
struct ieee80211_sub_if_data *sdata,
|
||||||
struct ieee80211_channel *chan,
|
struct ieee80211_channel *chan,
|
||||||
enum nl80211_channel_type chantype, unsigned int duration),
|
unsigned int duration),
|
||||||
|
|
||||||
TP_ARGS(local, sdata, chan, chantype, duration),
|
TP_ARGS(local, sdata, chan, duration),
|
||||||
|
|
||||||
TP_STRUCT__entry(
|
TP_STRUCT__entry(
|
||||||
LOCAL_ENTRY
|
LOCAL_ENTRY
|
||||||
VIF_ENTRY
|
VIF_ENTRY
|
||||||
__field(int, center_freq)
|
__field(int, center_freq)
|
||||||
__field(int, channel_type)
|
|
||||||
__field(unsigned int, duration)
|
__field(unsigned int, duration)
|
||||||
),
|
),
|
||||||
|
|
||||||
@ -1038,7 +1037,6 @@ TRACE_EVENT(drv_remain_on_channel,
|
|||||||
LOCAL_ASSIGN;
|
LOCAL_ASSIGN;
|
||||||
VIF_ASSIGN;
|
VIF_ASSIGN;
|
||||||
__entry->center_freq = chan->center_freq;
|
__entry->center_freq = chan->center_freq;
|
||||||
__entry->channel_type = chantype;
|
|
||||||
__entry->duration = duration;
|
__entry->duration = duration;
|
||||||
),
|
),
|
||||||
|
|
||||||
|
@ -378,10 +378,8 @@ void cfg80211_mlme_purge_registrations(struct wireless_dev *wdev);
|
|||||||
int cfg80211_mlme_mgmt_tx(struct cfg80211_registered_device *rdev,
|
int cfg80211_mlme_mgmt_tx(struct cfg80211_registered_device *rdev,
|
||||||
struct wireless_dev *wdev,
|
struct wireless_dev *wdev,
|
||||||
struct ieee80211_channel *chan, bool offchan,
|
struct ieee80211_channel *chan, bool offchan,
|
||||||
enum nl80211_channel_type channel_type,
|
unsigned int wait, const u8 *buf, size_t len,
|
||||||
bool channel_type_valid, unsigned int wait,
|
bool no_cck, bool dont_wait_for_ack, u64 *cookie);
|
||||||
const u8 *buf, size_t len, bool no_cck,
|
|
||||||
bool dont_wait_for_ack, u64 *cookie);
|
|
||||||
void cfg80211_oper_and_ht_capa(struct ieee80211_ht_cap *ht_capa,
|
void cfg80211_oper_and_ht_capa(struct ieee80211_ht_cap *ht_capa,
|
||||||
const struct ieee80211_ht_cap *ht_capa_mask);
|
const struct ieee80211_ht_cap *ht_capa_mask);
|
||||||
|
|
||||||
|
@ -579,31 +579,25 @@ void cfg80211_mlme_down(struct cfg80211_registered_device *rdev,
|
|||||||
|
|
||||||
void cfg80211_ready_on_channel(struct wireless_dev *wdev, u64 cookie,
|
void cfg80211_ready_on_channel(struct wireless_dev *wdev, u64 cookie,
|
||||||
struct ieee80211_channel *chan,
|
struct ieee80211_channel *chan,
|
||||||
enum nl80211_channel_type channel_type,
|
|
||||||
unsigned int duration, gfp_t gfp)
|
unsigned int duration, gfp_t gfp)
|
||||||
{
|
{
|
||||||
struct wiphy *wiphy = wdev->wiphy;
|
struct wiphy *wiphy = wdev->wiphy;
|
||||||
struct cfg80211_registered_device *rdev = wiphy_to_dev(wiphy);
|
struct cfg80211_registered_device *rdev = wiphy_to_dev(wiphy);
|
||||||
|
|
||||||
trace_cfg80211_ready_on_channel(wdev, cookie, chan, channel_type,
|
trace_cfg80211_ready_on_channel(wdev, cookie, chan, duration);
|
||||||
duration);
|
nl80211_send_remain_on_channel(rdev, wdev, cookie, chan, duration, gfp);
|
||||||
nl80211_send_remain_on_channel(rdev, wdev, cookie, chan, channel_type,
|
|
||||||
duration, gfp);
|
|
||||||
}
|
}
|
||||||
EXPORT_SYMBOL(cfg80211_ready_on_channel);
|
EXPORT_SYMBOL(cfg80211_ready_on_channel);
|
||||||
|
|
||||||
void cfg80211_remain_on_channel_expired(struct wireless_dev *wdev, u64 cookie,
|
void cfg80211_remain_on_channel_expired(struct wireless_dev *wdev, u64 cookie,
|
||||||
struct ieee80211_channel *chan,
|
struct ieee80211_channel *chan,
|
||||||
enum nl80211_channel_type channel_type,
|
|
||||||
gfp_t gfp)
|
gfp_t gfp)
|
||||||
{
|
{
|
||||||
struct wiphy *wiphy = wdev->wiphy;
|
struct wiphy *wiphy = wdev->wiphy;
|
||||||
struct cfg80211_registered_device *rdev = wiphy_to_dev(wiphy);
|
struct cfg80211_registered_device *rdev = wiphy_to_dev(wiphy);
|
||||||
|
|
||||||
trace_cfg80211_ready_on_channel_expired(wdev, cookie, chan,
|
trace_cfg80211_ready_on_channel_expired(wdev, cookie, chan);
|
||||||
channel_type);
|
nl80211_send_remain_on_channel_cancel(rdev, wdev, cookie, chan, gfp);
|
||||||
nl80211_send_remain_on_channel_cancel(rdev, wdev, cookie, chan,
|
|
||||||
channel_type, gfp);
|
|
||||||
}
|
}
|
||||||
EXPORT_SYMBOL(cfg80211_remain_on_channel_expired);
|
EXPORT_SYMBOL(cfg80211_remain_on_channel_expired);
|
||||||
|
|
||||||
@ -758,10 +752,8 @@ void cfg80211_mlme_purge_registrations(struct wireless_dev *wdev)
|
|||||||
int cfg80211_mlme_mgmt_tx(struct cfg80211_registered_device *rdev,
|
int cfg80211_mlme_mgmt_tx(struct cfg80211_registered_device *rdev,
|
||||||
struct wireless_dev *wdev,
|
struct wireless_dev *wdev,
|
||||||
struct ieee80211_channel *chan, bool offchan,
|
struct ieee80211_channel *chan, bool offchan,
|
||||||
enum nl80211_channel_type channel_type,
|
unsigned int wait, const u8 *buf, size_t len,
|
||||||
bool channel_type_valid, unsigned int wait,
|
bool no_cck, bool dont_wait_for_ack, u64 *cookie)
|
||||||
const u8 *buf, size_t len, bool no_cck,
|
|
||||||
bool dont_wait_for_ack, u64 *cookie)
|
|
||||||
{
|
{
|
||||||
const struct ieee80211_mgmt *mgmt;
|
const struct ieee80211_mgmt *mgmt;
|
||||||
u16 stype;
|
u16 stype;
|
||||||
@ -855,7 +847,6 @@ int cfg80211_mlme_mgmt_tx(struct cfg80211_registered_device *rdev,
|
|||||||
|
|
||||||
/* Transmit the Action frame as requested by user space */
|
/* Transmit the Action frame as requested by user space */
|
||||||
return rdev_mgmt_tx(rdev, wdev, chan, offchan,
|
return rdev_mgmt_tx(rdev, wdev, chan, offchan,
|
||||||
channel_type, channel_type_valid,
|
|
||||||
wait, buf, len, no_cck, dont_wait_for_ack,
|
wait, buf, len, no_cck, dont_wait_for_ack,
|
||||||
cookie);
|
cookie);
|
||||||
}
|
}
|
||||||
|
@ -5952,7 +5952,6 @@ static int nl80211_remain_on_channel(struct sk_buff *skb,
|
|||||||
struct sk_buff *msg;
|
struct sk_buff *msg;
|
||||||
void *hdr;
|
void *hdr;
|
||||||
u64 cookie;
|
u64 cookie;
|
||||||
enum nl80211_channel_type channel_type = NL80211_CHAN_NO_HT;
|
|
||||||
u32 freq, duration;
|
u32 freq, duration;
|
||||||
int err;
|
int err;
|
||||||
|
|
||||||
@ -5975,11 +5974,11 @@ static int nl80211_remain_on_channel(struct sk_buff *skb,
|
|||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
|
||||||
if (info->attrs[NL80211_ATTR_WIPHY_CHANNEL_TYPE] &&
|
if (info->attrs[NL80211_ATTR_WIPHY_CHANNEL_TYPE] &&
|
||||||
!nl80211_valid_channel_type(info, &channel_type))
|
!nl80211_valid_channel_type(info, NULL))
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
|
||||||
freq = nla_get_u32(info->attrs[NL80211_ATTR_WIPHY_FREQ]);
|
freq = nla_get_u32(info->attrs[NL80211_ATTR_WIPHY_FREQ]);
|
||||||
chan = rdev_freq_to_chan(rdev, freq, channel_type);
|
chan = rdev_freq_to_chan(rdev, freq, NL80211_CHAN_NO_HT);
|
||||||
if (chan == NULL)
|
if (chan == NULL)
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
|
||||||
@ -5995,8 +5994,7 @@ static int nl80211_remain_on_channel(struct sk_buff *skb,
|
|||||||
goto free_msg;
|
goto free_msg;
|
||||||
}
|
}
|
||||||
|
|
||||||
err = rdev_remain_on_channel(rdev, wdev, chan, channel_type, duration,
|
err = rdev_remain_on_channel(rdev, wdev, chan, duration, &cookie);
|
||||||
&cookie);
|
|
||||||
|
|
||||||
if (err)
|
if (err)
|
||||||
goto free_msg;
|
goto free_msg;
|
||||||
@ -6216,8 +6214,6 @@ static int nl80211_tx_mgmt(struct sk_buff *skb, struct genl_info *info)
|
|||||||
struct cfg80211_registered_device *rdev = info->user_ptr[0];
|
struct cfg80211_registered_device *rdev = info->user_ptr[0];
|
||||||
struct wireless_dev *wdev = info->user_ptr[1];
|
struct wireless_dev *wdev = info->user_ptr[1];
|
||||||
struct ieee80211_channel *chan;
|
struct ieee80211_channel *chan;
|
||||||
enum nl80211_channel_type channel_type = NL80211_CHAN_NO_HT;
|
|
||||||
bool channel_type_valid = false;
|
|
||||||
u32 freq;
|
u32 freq;
|
||||||
int err;
|
int err;
|
||||||
void *hdr = NULL;
|
void *hdr = NULL;
|
||||||
@ -6264,11 +6260,9 @@ static int nl80211_tx_mgmt(struct sk_buff *skb, struct genl_info *info)
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (info->attrs[NL80211_ATTR_WIPHY_CHANNEL_TYPE]) {
|
if (info->attrs[NL80211_ATTR_WIPHY_CHANNEL_TYPE] &&
|
||||||
if (!nl80211_valid_channel_type(info, &channel_type))
|
!nl80211_valid_channel_type(info, NULL))
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
channel_type_valid = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
offchan = info->attrs[NL80211_ATTR_OFFCHANNEL_TX_OK];
|
offchan = info->attrs[NL80211_ATTR_OFFCHANNEL_TX_OK];
|
||||||
|
|
||||||
@ -6278,7 +6272,7 @@ static int nl80211_tx_mgmt(struct sk_buff *skb, struct genl_info *info)
|
|||||||
no_cck = nla_get_flag(info->attrs[NL80211_ATTR_TX_NO_CCK_RATE]);
|
no_cck = nla_get_flag(info->attrs[NL80211_ATTR_TX_NO_CCK_RATE]);
|
||||||
|
|
||||||
freq = nla_get_u32(info->attrs[NL80211_ATTR_WIPHY_FREQ]);
|
freq = nla_get_u32(info->attrs[NL80211_ATTR_WIPHY_FREQ]);
|
||||||
chan = rdev_freq_to_chan(rdev, freq, channel_type);
|
chan = rdev_freq_to_chan(rdev, freq, NL80211_CHAN_NO_HT);
|
||||||
if (chan == NULL)
|
if (chan == NULL)
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
|
||||||
@ -6296,8 +6290,7 @@ static int nl80211_tx_mgmt(struct sk_buff *skb, struct genl_info *info)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
err = cfg80211_mlme_mgmt_tx(rdev, wdev, chan, offchan, channel_type,
|
err = cfg80211_mlme_mgmt_tx(rdev, wdev, chan, offchan, wait,
|
||||||
channel_type_valid, wait,
|
|
||||||
nla_data(info->attrs[NL80211_ATTR_FRAME]),
|
nla_data(info->attrs[NL80211_ATTR_FRAME]),
|
||||||
nla_len(info->attrs[NL80211_ATTR_FRAME]),
|
nla_len(info->attrs[NL80211_ATTR_FRAME]),
|
||||||
no_cck, dont_wait_for_ack, &cookie);
|
no_cck, dont_wait_for_ack, &cookie);
|
||||||
@ -8395,7 +8388,6 @@ static void nl80211_send_remain_on_chan_event(
|
|||||||
int cmd, struct cfg80211_registered_device *rdev,
|
int cmd, struct cfg80211_registered_device *rdev,
|
||||||
struct wireless_dev *wdev, u64 cookie,
|
struct wireless_dev *wdev, u64 cookie,
|
||||||
struct ieee80211_channel *chan,
|
struct ieee80211_channel *chan,
|
||||||
enum nl80211_channel_type channel_type,
|
|
||||||
unsigned int duration, gfp_t gfp)
|
unsigned int duration, gfp_t gfp)
|
||||||
{
|
{
|
||||||
struct sk_buff *msg;
|
struct sk_buff *msg;
|
||||||
@ -8416,7 +8408,8 @@ static void nl80211_send_remain_on_chan_event(
|
|||||||
wdev->netdev->ifindex)) ||
|
wdev->netdev->ifindex)) ||
|
||||||
nla_put_u64(msg, NL80211_ATTR_WDEV, wdev_id(wdev)) ||
|
nla_put_u64(msg, NL80211_ATTR_WDEV, wdev_id(wdev)) ||
|
||||||
nla_put_u32(msg, NL80211_ATTR_WIPHY_FREQ, chan->center_freq) ||
|
nla_put_u32(msg, NL80211_ATTR_WIPHY_FREQ, chan->center_freq) ||
|
||||||
nla_put_u32(msg, NL80211_ATTR_WIPHY_CHANNEL_TYPE, channel_type) ||
|
nla_put_u32(msg, NL80211_ATTR_WIPHY_CHANNEL_TYPE,
|
||||||
|
NL80211_CHAN_NO_HT) ||
|
||||||
nla_put_u64(msg, NL80211_ATTR_COOKIE, cookie))
|
nla_put_u64(msg, NL80211_ATTR_COOKIE, cookie))
|
||||||
goto nla_put_failure;
|
goto nla_put_failure;
|
||||||
|
|
||||||
@ -8438,23 +8431,20 @@ static void nl80211_send_remain_on_chan_event(
|
|||||||
void nl80211_send_remain_on_channel(struct cfg80211_registered_device *rdev,
|
void nl80211_send_remain_on_channel(struct cfg80211_registered_device *rdev,
|
||||||
struct wireless_dev *wdev, u64 cookie,
|
struct wireless_dev *wdev, u64 cookie,
|
||||||
struct ieee80211_channel *chan,
|
struct ieee80211_channel *chan,
|
||||||
enum nl80211_channel_type channel_type,
|
|
||||||
unsigned int duration, gfp_t gfp)
|
unsigned int duration, gfp_t gfp)
|
||||||
{
|
{
|
||||||
nl80211_send_remain_on_chan_event(NL80211_CMD_REMAIN_ON_CHANNEL,
|
nl80211_send_remain_on_chan_event(NL80211_CMD_REMAIN_ON_CHANNEL,
|
||||||
rdev, wdev, cookie, chan,
|
rdev, wdev, cookie, chan,
|
||||||
channel_type, duration, gfp);
|
duration, gfp);
|
||||||
}
|
}
|
||||||
|
|
||||||
void nl80211_send_remain_on_channel_cancel(
|
void nl80211_send_remain_on_channel_cancel(
|
||||||
struct cfg80211_registered_device *rdev,
|
struct cfg80211_registered_device *rdev,
|
||||||
struct wireless_dev *wdev,
|
struct wireless_dev *wdev,
|
||||||
u64 cookie, struct ieee80211_channel *chan,
|
u64 cookie, struct ieee80211_channel *chan, gfp_t gfp)
|
||||||
enum nl80211_channel_type channel_type, gfp_t gfp)
|
|
||||||
{
|
{
|
||||||
nl80211_send_remain_on_chan_event(NL80211_CMD_CANCEL_REMAIN_ON_CHANNEL,
|
nl80211_send_remain_on_chan_event(NL80211_CMD_CANCEL_REMAIN_ON_CHANNEL,
|
||||||
rdev, wdev, cookie, chan,
|
rdev, wdev, cookie, chan, 0, gfp);
|
||||||
channel_type, 0, gfp);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void nl80211_send_sta_event(struct cfg80211_registered_device *rdev,
|
void nl80211_send_sta_event(struct cfg80211_registered_device *rdev,
|
||||||
|
@ -76,13 +76,11 @@ void nl80211_send_ibss_bssid(struct cfg80211_registered_device *rdev,
|
|||||||
void nl80211_send_remain_on_channel(struct cfg80211_registered_device *rdev,
|
void nl80211_send_remain_on_channel(struct cfg80211_registered_device *rdev,
|
||||||
struct wireless_dev *wdev, u64 cookie,
|
struct wireless_dev *wdev, u64 cookie,
|
||||||
struct ieee80211_channel *chan,
|
struct ieee80211_channel *chan,
|
||||||
enum nl80211_channel_type channel_type,
|
|
||||||
unsigned int duration, gfp_t gfp);
|
unsigned int duration, gfp_t gfp);
|
||||||
void nl80211_send_remain_on_channel_cancel(
|
void nl80211_send_remain_on_channel_cancel(
|
||||||
struct cfg80211_registered_device *rdev,
|
struct cfg80211_registered_device *rdev,
|
||||||
struct wireless_dev *wdev,
|
struct wireless_dev *wdev,
|
||||||
u64 cookie, struct ieee80211_channel *chan,
|
u64 cookie, struct ieee80211_channel *chan, gfp_t gfp);
|
||||||
enum nl80211_channel_type channel_type, gfp_t gfp);
|
|
||||||
|
|
||||||
void nl80211_send_sta_event(struct cfg80211_registered_device *rdev,
|
void nl80211_send_sta_event(struct cfg80211_registered_device *rdev,
|
||||||
struct net_device *dev, const u8 *mac_addr,
|
struct net_device *dev, const u8 *mac_addr,
|
||||||
|
@ -600,14 +600,12 @@ static inline int
|
|||||||
rdev_remain_on_channel(struct cfg80211_registered_device *rdev,
|
rdev_remain_on_channel(struct cfg80211_registered_device *rdev,
|
||||||
struct wireless_dev *wdev,
|
struct wireless_dev *wdev,
|
||||||
struct ieee80211_channel *chan,
|
struct ieee80211_channel *chan,
|
||||||
enum nl80211_channel_type channel_type,
|
|
||||||
unsigned int duration, u64 *cookie)
|
unsigned int duration, u64 *cookie)
|
||||||
{
|
{
|
||||||
int ret;
|
int ret;
|
||||||
trace_rdev_remain_on_channel(&rdev->wiphy, wdev, chan, channel_type,
|
trace_rdev_remain_on_channel(&rdev->wiphy, wdev, chan, duration);
|
||||||
duration);
|
|
||||||
ret = rdev->ops->remain_on_channel(&rdev->wiphy, wdev, chan,
|
ret = rdev->ops->remain_on_channel(&rdev->wiphy, wdev, chan,
|
||||||
channel_type, duration, cookie);
|
duration, cookie);
|
||||||
trace_rdev_return_int_cookie(&rdev->wiphy, ret, *cookie);
|
trace_rdev_return_int_cookie(&rdev->wiphy, ret, *cookie);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
@ -626,17 +624,15 @@ rdev_cancel_remain_on_channel(struct cfg80211_registered_device *rdev,
|
|||||||
static inline int rdev_mgmt_tx(struct cfg80211_registered_device *rdev,
|
static inline int rdev_mgmt_tx(struct cfg80211_registered_device *rdev,
|
||||||
struct wireless_dev *wdev,
|
struct wireless_dev *wdev,
|
||||||
struct ieee80211_channel *chan, bool offchan,
|
struct ieee80211_channel *chan, bool offchan,
|
||||||
enum nl80211_channel_type channel_type,
|
unsigned int wait, const u8 *buf, size_t len,
|
||||||
bool channel_type_valid, unsigned int wait,
|
bool no_cck, bool dont_wait_for_ack, u64 *cookie)
|
||||||
const u8 *buf, size_t len, bool no_cck,
|
|
||||||
bool dont_wait_for_ack, u64 *cookie)
|
|
||||||
{
|
{
|
||||||
int ret;
|
int ret;
|
||||||
trace_rdev_mgmt_tx(&rdev->wiphy, wdev, chan, offchan, channel_type,
|
trace_rdev_mgmt_tx(&rdev->wiphy, wdev, chan, offchan,
|
||||||
channel_type_valid, wait, no_cck, dont_wait_for_ack);
|
wait, no_cck, dont_wait_for_ack);
|
||||||
ret = rdev->ops->mgmt_tx(&rdev->wiphy, wdev, chan, offchan,
|
ret = rdev->ops->mgmt_tx(&rdev->wiphy, wdev, chan, offchan,
|
||||||
channel_type, channel_type_valid, wait, buf,
|
wait, buf, len, no_cck,
|
||||||
len, no_cck, dont_wait_for_ack, cookie);
|
dont_wait_for_ack, cookie);
|
||||||
trace_rdev_return_int_cookie(&rdev->wiphy, ret, *cookie);
|
trace_rdev_return_int_cookie(&rdev->wiphy, ret, *cookie);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
@ -1573,25 +1573,22 @@ DEFINE_EVENT(rdev_pmksa, rdev_del_pmksa,
|
|||||||
TRACE_EVENT(rdev_remain_on_channel,
|
TRACE_EVENT(rdev_remain_on_channel,
|
||||||
TP_PROTO(struct wiphy *wiphy, struct wireless_dev *wdev,
|
TP_PROTO(struct wiphy *wiphy, struct wireless_dev *wdev,
|
||||||
struct ieee80211_channel *chan,
|
struct ieee80211_channel *chan,
|
||||||
enum nl80211_channel_type channel_type, unsigned int duration),
|
unsigned int duration),
|
||||||
TP_ARGS(wiphy, wdev, chan, channel_type, duration),
|
TP_ARGS(wiphy, wdev, chan, duration),
|
||||||
TP_STRUCT__entry(
|
TP_STRUCT__entry(
|
||||||
WIPHY_ENTRY
|
WIPHY_ENTRY
|
||||||
WDEV_ENTRY
|
WDEV_ENTRY
|
||||||
CHAN_ENTRY
|
CHAN_ENTRY
|
||||||
__field(enum nl80211_channel_type, channel_type)
|
|
||||||
__field(unsigned int, duration)
|
__field(unsigned int, duration)
|
||||||
),
|
),
|
||||||
TP_fast_assign(
|
TP_fast_assign(
|
||||||
WIPHY_ASSIGN;
|
WIPHY_ASSIGN;
|
||||||
WDEV_ASSIGN;
|
WDEV_ASSIGN;
|
||||||
CHAN_ASSIGN(chan);
|
CHAN_ASSIGN(chan);
|
||||||
__entry->channel_type = channel_type;
|
|
||||||
__entry->duration = duration;
|
__entry->duration = duration;
|
||||||
),
|
),
|
||||||
TP_printk(WIPHY_PR_FMT WDEV_PR_FMT CHAN_PR_FMT ", channel type: %d, duration: %u",
|
TP_printk(WIPHY_PR_FMT WDEV_PR_FMT CHAN_PR_FMT ", duration: %u",
|
||||||
WIPHY_PR_ARG, WDEV_PR_ARG, CHAN_PR_ARG, __entry->channel_type,
|
WIPHY_PR_ARG, WDEV_PR_ARG, CHAN_PR_ARG, __entry->duration)
|
||||||
__entry->duration)
|
|
||||||
);
|
);
|
||||||
|
|
||||||
TRACE_EVENT(rdev_return_int_cookie,
|
TRACE_EVENT(rdev_return_int_cookie,
|
||||||
@ -1631,18 +1628,13 @@ TRACE_EVENT(rdev_cancel_remain_on_channel,
|
|||||||
TRACE_EVENT(rdev_mgmt_tx,
|
TRACE_EVENT(rdev_mgmt_tx,
|
||||||
TP_PROTO(struct wiphy *wiphy, struct wireless_dev *wdev,
|
TP_PROTO(struct wiphy *wiphy, struct wireless_dev *wdev,
|
||||||
struct ieee80211_channel *chan, bool offchan,
|
struct ieee80211_channel *chan, bool offchan,
|
||||||
enum nl80211_channel_type channel_type,
|
unsigned int wait, bool no_cck, bool dont_wait_for_ack),
|
||||||
bool channel_type_valid, unsigned int wait, bool no_cck,
|
TP_ARGS(wiphy, wdev, chan, offchan, wait, no_cck, dont_wait_for_ack),
|
||||||
bool dont_wait_for_ack),
|
|
||||||
TP_ARGS(wiphy, wdev, chan, offchan, channel_type, channel_type_valid,
|
|
||||||
wait, no_cck, dont_wait_for_ack),
|
|
||||||
TP_STRUCT__entry(
|
TP_STRUCT__entry(
|
||||||
WIPHY_ENTRY
|
WIPHY_ENTRY
|
||||||
WDEV_ENTRY
|
WDEV_ENTRY
|
||||||
CHAN_ENTRY
|
CHAN_ENTRY
|
||||||
__field(bool, offchan)
|
__field(bool, offchan)
|
||||||
__field(enum nl80211_channel_type, channel_type)
|
|
||||||
__field(bool, channel_type_valid)
|
|
||||||
__field(unsigned int, wait)
|
__field(unsigned int, wait)
|
||||||
__field(bool, no_cck)
|
__field(bool, no_cck)
|
||||||
__field(bool, dont_wait_for_ack)
|
__field(bool, dont_wait_for_ack)
|
||||||
@ -1652,18 +1644,14 @@ TRACE_EVENT(rdev_mgmt_tx,
|
|||||||
WDEV_ASSIGN;
|
WDEV_ASSIGN;
|
||||||
CHAN_ASSIGN(chan);
|
CHAN_ASSIGN(chan);
|
||||||
__entry->offchan = offchan;
|
__entry->offchan = offchan;
|
||||||
__entry->channel_type = channel_type;
|
|
||||||
__entry->channel_type_valid = channel_type_valid;
|
|
||||||
__entry->wait = wait;
|
__entry->wait = wait;
|
||||||
__entry->no_cck = no_cck;
|
__entry->no_cck = no_cck;
|
||||||
__entry->dont_wait_for_ack = dont_wait_for_ack;
|
__entry->dont_wait_for_ack = dont_wait_for_ack;
|
||||||
),
|
),
|
||||||
TP_printk(WIPHY_PR_FMT WDEV_PR_FMT CHAN_PR_FMT ", offchan: %s, "
|
TP_printk(WIPHY_PR_FMT WDEV_PR_FMT CHAN_PR_FMT ", offchan: %s,"
|
||||||
"channel type: %d, channel type valid: %s, wait: %u, "
|
" wait: %u, no cck: %s, dont wait for ack: %s",
|
||||||
"no cck: %s, dont wait for ack: %s",
|
|
||||||
WIPHY_PR_ARG, WDEV_PR_ARG, CHAN_PR_ARG,
|
WIPHY_PR_ARG, WDEV_PR_ARG, CHAN_PR_ARG,
|
||||||
BOOL_TO_STR(__entry->offchan), __entry->channel_type,
|
BOOL_TO_STR(__entry->offchan), __entry->wait,
|
||||||
BOOL_TO_STR(__entry->channel_type_valid), __entry->wait,
|
|
||||||
BOOL_TO_STR(__entry->no_cck),
|
BOOL_TO_STR(__entry->no_cck),
|
||||||
BOOL_TO_STR(__entry->dont_wait_for_ack))
|
BOOL_TO_STR(__entry->dont_wait_for_ack))
|
||||||
);
|
);
|
||||||
@ -1894,47 +1882,41 @@ TRACE_EVENT(cfg80211_michael_mic_failure,
|
|||||||
TRACE_EVENT(cfg80211_ready_on_channel,
|
TRACE_EVENT(cfg80211_ready_on_channel,
|
||||||
TP_PROTO(struct wireless_dev *wdev, u64 cookie,
|
TP_PROTO(struct wireless_dev *wdev, u64 cookie,
|
||||||
struct ieee80211_channel *chan,
|
struct ieee80211_channel *chan,
|
||||||
enum nl80211_channel_type channel_type, unsigned int duration),
|
unsigned int duration),
|
||||||
TP_ARGS(wdev, cookie, chan, channel_type, duration),
|
TP_ARGS(wdev, cookie, chan, duration),
|
||||||
TP_STRUCT__entry(
|
TP_STRUCT__entry(
|
||||||
WDEV_ENTRY
|
WDEV_ENTRY
|
||||||
__field(u64, cookie)
|
__field(u64, cookie)
|
||||||
CHAN_ENTRY
|
CHAN_ENTRY
|
||||||
__field(enum nl80211_channel_type, channel_type)
|
|
||||||
__field(unsigned int, duration)
|
__field(unsigned int, duration)
|
||||||
),
|
),
|
||||||
TP_fast_assign(
|
TP_fast_assign(
|
||||||
WDEV_ASSIGN;
|
WDEV_ASSIGN;
|
||||||
__entry->cookie = cookie;
|
__entry->cookie = cookie;
|
||||||
CHAN_ASSIGN(chan);
|
CHAN_ASSIGN(chan);
|
||||||
__entry->channel_type = channel_type;
|
|
||||||
__entry->duration = duration;
|
__entry->duration = duration;
|
||||||
),
|
),
|
||||||
TP_printk(WDEV_PR_FMT ", cookie: %llu, " CHAN_PR_FMT ", channel type: %d, duration: %u",
|
TP_printk(WDEV_PR_FMT ", cookie: %llu, " CHAN_PR_FMT ", duration: %u",
|
||||||
WDEV_PR_ARG, __entry->cookie, CHAN_PR_ARG,
|
WDEV_PR_ARG, __entry->cookie, CHAN_PR_ARG,
|
||||||
__entry->channel_type, __entry->duration)
|
__entry->duration)
|
||||||
);
|
);
|
||||||
|
|
||||||
TRACE_EVENT(cfg80211_ready_on_channel_expired,
|
TRACE_EVENT(cfg80211_ready_on_channel_expired,
|
||||||
TP_PROTO(struct wireless_dev *wdev, u64 cookie,
|
TP_PROTO(struct wireless_dev *wdev, u64 cookie,
|
||||||
struct ieee80211_channel *chan,
|
struct ieee80211_channel *chan),
|
||||||
enum nl80211_channel_type channel_type),
|
TP_ARGS(wdev, cookie, chan),
|
||||||
TP_ARGS(wdev, cookie, chan, channel_type),
|
|
||||||
TP_STRUCT__entry(
|
TP_STRUCT__entry(
|
||||||
WDEV_ENTRY
|
WDEV_ENTRY
|
||||||
__field(u64, cookie)
|
__field(u64, cookie)
|
||||||
CHAN_ENTRY
|
CHAN_ENTRY
|
||||||
__field(enum nl80211_channel_type, channel_type)
|
|
||||||
),
|
),
|
||||||
TP_fast_assign(
|
TP_fast_assign(
|
||||||
WDEV_ASSIGN;
|
WDEV_ASSIGN;
|
||||||
__entry->cookie = cookie;
|
__entry->cookie = cookie;
|
||||||
CHAN_ASSIGN(chan);
|
CHAN_ASSIGN(chan);
|
||||||
__entry->channel_type = channel_type;
|
|
||||||
),
|
),
|
||||||
TP_printk(WDEV_PR_FMT ", cookie: %llu, " CHAN_PR_FMT ", channel type: %d",
|
TP_printk(WDEV_PR_FMT ", cookie: %llu, " CHAN_PR_FMT,
|
||||||
WDEV_PR_ARG, __entry->cookie, CHAN_PR_ARG,
|
WDEV_PR_ARG, __entry->cookie, CHAN_PR_ARG)
|
||||||
__entry->channel_type)
|
|
||||||
);
|
);
|
||||||
|
|
||||||
TRACE_EVENT(cfg80211_new_sta,
|
TRACE_EVENT(cfg80211_new_sta,
|
||||||
|
Loading…
Reference in New Issue
Block a user