diff options
author | Johannes Berg <johannes.berg@intel.com> | 2010-11-25 04:02:29 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2010-11-29 15:24:35 -0500 |
commit | f7ca38dfe58c20cb1aa2ed9643187e8b194b5bae (patch) | |
tree | 42db54588fd5fa769a16def75708117903577b40 /include | |
parent | 9a67d761b39614c0495dcab9a204e21a9f4c4d31 (diff) |
nl80211/cfg80211: extend mgmt-tx API for off-channel
With p2p, it is sometimes necessary to transmit
a frame (typically an action frame) on another
channel than the current channel. Enable this
through the CMD_FRAME API, and allow it to wait
for a response. A new command allows that wait
to be aborted.
However, allow userspace to specify whether or
not it wants to allow off-channel TX, it may
actually want to use the same channel only.
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/nl80211.h | 25 | ||||
-rw-r--r-- | include/net/cfg80211.h | 11 |
2 files changed, 28 insertions, 8 deletions
diff --git a/include/linux/nl80211.h b/include/linux/nl80211.h index d706bf3badc8..5cfa579df476 100644 --- a/include/linux/nl80211.h +++ b/include/linux/nl80211.h | |||
@@ -358,11 +358,16 @@ | |||
358 | * user space application). %NL80211_ATTR_FRAME is used to specify the | 358 | * user space application). %NL80211_ATTR_FRAME is used to specify the |
359 | * frame contents (including header). %NL80211_ATTR_WIPHY_FREQ (and | 359 | * frame contents (including header). %NL80211_ATTR_WIPHY_FREQ (and |
360 | * optionally %NL80211_ATTR_WIPHY_CHANNEL_TYPE) is used to indicate on | 360 | * optionally %NL80211_ATTR_WIPHY_CHANNEL_TYPE) is used to indicate on |
361 | * which channel the frame is to be transmitted or was received. This | 361 | * which channel the frame is to be transmitted or was received. If this |
362 | * channel has to be the current channel (remain-on-channel or the | 362 | * channel is not the current channel (remain-on-channel or the |
363 | * operational channel). When called, this operation returns a cookie | 363 | * operational channel) the device will switch to the given channel and |
364 | * (%NL80211_ATTR_COOKIE) that will be included with the TX status event | 364 | * transmit the frame, optionally waiting for a response for the time |
365 | * pertaining to the TX request. | 365 | * specified using %NL80211_ATTR_DURATION. When called, this operation |
366 | * returns a cookie (%NL80211_ATTR_COOKIE) that will be included with the | ||
367 | * TX status event pertaining to the TX request. | ||
368 | * @NL80211_CMD_FRAME_WAIT_CANCEL: When an off-channel TX was requested, this | ||
369 | * command may be used with the corresponding cookie to cancel the wait | ||
370 | * time if it is known that it is no longer necessary. | ||
366 | * @NL80211_CMD_ACTION: Alias for @NL80211_CMD_FRAME for backward compatibility. | 371 | * @NL80211_CMD_ACTION: Alias for @NL80211_CMD_FRAME for backward compatibility. |
367 | * @NL80211_CMD_FRAME_TX_STATUS: Report TX status of a management frame | 372 | * @NL80211_CMD_FRAME_TX_STATUS: Report TX status of a management frame |
368 | * transmitted with %NL80211_CMD_FRAME. %NL80211_ATTR_COOKIE identifies | 373 | * transmitted with %NL80211_CMD_FRAME. %NL80211_ATTR_COOKIE identifies |
@@ -493,6 +498,8 @@ enum nl80211_commands { | |||
493 | NL80211_CMD_SET_CHANNEL, | 498 | NL80211_CMD_SET_CHANNEL, |
494 | NL80211_CMD_SET_WDS_PEER, | 499 | NL80211_CMD_SET_WDS_PEER, |
495 | 500 | ||
501 | NL80211_CMD_FRAME_WAIT_CANCEL, | ||
502 | |||
496 | /* add new commands above here */ | 503 | /* add new commands above here */ |
497 | 504 | ||
498 | /* used to define NL80211_CMD_MAX below */ | 505 | /* used to define NL80211_CMD_MAX below */ |
@@ -828,6 +835,12 @@ enum nl80211_commands { | |||
828 | * | 835 | * |
829 | * @NL80211_ATTR_MCAST_RATE: Multicast tx rate (in 100 kbps) for IBSS | 836 | * @NL80211_ATTR_MCAST_RATE: Multicast tx rate (in 100 kbps) for IBSS |
830 | * | 837 | * |
838 | * @NL80211_ATTR_OFFCHANNEL_TX_OK: For management frame TX, the frame may be | ||
839 | * transmitted on another channel when the channel given doesn't match | ||
840 | * the current channel. If the current channel doesn't match and this | ||
841 | * flag isn't set, the frame will be rejected. This is also used as an | ||
842 | * nl80211 capability flag. | ||
843 | * | ||
831 | * @NL80211_ATTR_MAX: highest attribute number currently defined | 844 | * @NL80211_ATTR_MAX: highest attribute number currently defined |
832 | * @__NL80211_ATTR_AFTER_LAST: internal use | 845 | * @__NL80211_ATTR_AFTER_LAST: internal use |
833 | */ | 846 | */ |
@@ -1002,6 +1015,8 @@ enum nl80211_attrs { | |||
1002 | 1015 | ||
1003 | NL80211_ATTR_MCAST_RATE, | 1016 | NL80211_ATTR_MCAST_RATE, |
1004 | 1017 | ||
1018 | NL80211_ATTR_OFFCHANNEL_TX_OK, | ||
1019 | |||
1005 | /* add attributes here, update the policy in nl80211.c */ | 1020 | /* add attributes here, update the policy in nl80211.c */ |
1006 | 1021 | ||
1007 | __NL80211_ATTR_AFTER_LAST, | 1022 | __NL80211_ATTR_AFTER_LAST, |
diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h index 0663945cfa48..49a7c53a48ca 100644 --- a/include/net/cfg80211.h +++ b/include/net/cfg80211.h | |||
@@ -1134,7 +1134,9 @@ struct cfg80211_pmksa { | |||
1134 | * @cancel_remain_on_channel: Cancel an on-going remain-on-channel operation. | 1134 | * @cancel_remain_on_channel: Cancel an on-going remain-on-channel operation. |
1135 | * This allows the operation to be terminated prior to timeout based on | 1135 | * This allows the operation to be terminated prior to timeout based on |
1136 | * the duration value. | 1136 | * the duration value. |
1137 | * @mgmt_tx: Transmit a management frame | 1137 | * @mgmt_tx: Transmit a management frame. |
1138 | * @mgmt_tx_cancel_wait: Cancel the wait time from transmitting a management | ||
1139 | * frame on another channel | ||
1138 | * | 1140 | * |
1139 | * @testmode_cmd: run a test mode command | 1141 | * @testmode_cmd: run a test mode command |
1140 | * | 1142 | * |
@@ -1291,10 +1293,13 @@ struct cfg80211_ops { | |||
1291 | u64 cookie); | 1293 | u64 cookie); |
1292 | 1294 | ||
1293 | int (*mgmt_tx)(struct wiphy *wiphy, struct net_device *dev, | 1295 | int (*mgmt_tx)(struct wiphy *wiphy, struct net_device *dev, |
1294 | struct ieee80211_channel *chan, | 1296 | struct ieee80211_channel *chan, bool offchan, |
1295 | enum nl80211_channel_type channel_type, | 1297 | enum nl80211_channel_type channel_type, |
1296 | bool channel_type_valid, | 1298 | bool channel_type_valid, unsigned int wait, |
1297 | const u8 *buf, size_t len, u64 *cookie); | 1299 | const u8 *buf, size_t len, u64 *cookie); |
1300 | int (*mgmt_tx_cancel_wait)(struct wiphy *wiphy, | ||
1301 | struct net_device *dev, | ||
1302 | u64 cookie); | ||
1298 | 1303 | ||
1299 | int (*set_power_mgmt)(struct wiphy *wiphy, struct net_device *dev, | 1304 | int (*set_power_mgmt)(struct wiphy *wiphy, struct net_device *dev, |
1300 | bool enabled, int timeout); | 1305 | bool enabled, int timeout); |