History

nl80211/cfg80211: add radar detection command/event

Add new NL80211_CMD_RADAR_DETECT, which starts the Channel Availability Check (CAC). This command will also notify the usermode about events (CAC finished, CAC aborted, radar detected, NOP finished). Once radar detection has started it should continuously monitor for radars as long as the channel is active. This patch enables DFS for AP mode in nl80211/cfg80211. Based on original patch by Victor Goldenshtein <victorg@ti.com>

Simon Wunderlich committed 13 years ago

Commit 04f39041 parent 2a0e04711 files · +570 −17Browse files

Showing the changes to include/uapi/linux (1 of 11 files). Show all

Unified · Split

include/uapi/linux/nl80211.h+61−0
@@ -603,6 +603,14 @@ · 602 unmodified lines
603603 * command is used in AP/P2P GO mode. Driver has to make sure to clear its
604604 * ACL list during %NL80211_CMD_STOP_AP.
605605 *
606+ * @NL80211_CMD_RADAR_DETECT: Start a Channel availability check (CAC). Once
607+ * a radar is detected or the channel availability scan (CAC) has finished
608+ * or was aborted, or a radar was detected, usermode will be notified with
609+ * this event. This command is also used to notify userspace about radars
610+ * while operating on this channel.
611+ * %NL80211_ATTR_RADAR_EVENT is used to inform about the type of the
612+ * event.
613+ *
606614 * @NL80211_CMD_MAX: highest used command number
607615 * @__NL80211_CMD_AFTER_LAST: internal use
608616 */
@@ -755,6 +763,8 @@ enum nl80211_commands { · 146 unmodified lines
755763
756764 NL80211_CMD_SET_MAC_ACL,
757765
766+ NL80211_CMD_RADAR_DETECT,
767+
758768 /* add new commands above here */
759769
760770 /* used to define NL80211_CMD_MAX below */
@@ -1342,6 +1352,9 @@ enum nl80211_commands { · 581 unmodified lines
13421352 * number of MAC addresses that a device can support for MAC
13431353 * ACL.
13441354 *
1355+ * @NL80211_ATTR_RADAR_EVENT: Type of radar event for notification to userspace,
1356+ * contains a value of enum nl80211_radar_event (u32).
1357+ *
13451358 * @NL80211_ATTR_MAX: highest attribute number currently defined
13461359 * @__NL80211_ATTR_AFTER_LAST: internal use
13471360 */
@@ -1620,6 +1633,8 @@ enum nl80211_attrs { · 272 unmodified lines
16201633
16211634 NL80211_ATTR_MAC_ACL_MAX,
16221635
1636+ NL80211_ATTR_RADAR_EVENT,
1637+
16231638 /* add attributes here, update the policy in nl80211.c */
16241639
16251640 __NL80211_ATTR_AFTER_LAST,
@@ -2022,6 +2037,10 @@ enum nl80211_band_attr { · 396 unmodified lines
20222037 * on this channel in current regulatory domain.
20232038 * @NL80211_FREQUENCY_ATTR_MAX_TX_POWER: Maximum transmission power in mBm
20242039 * (100 * dBm).
2040+ * @NL80211_FREQUENCY_ATTR_DFS_STATE: current state for DFS
2041+ * (enum nl80211_dfs_state)
2042+ * @NL80211_FREQUENCY_ATTR_DFS_TIME: time in miliseconds for how long
2043+ * this channel is in this DFS state.
20252044 * @NL80211_FREQUENCY_ATTR_MAX: highest frequency attribute number
20262045 * currently defined
20272046 * @__NL80211_FREQUENCY_ATTR_AFTER_LAST: internal use
@@ -2034,6 +2053,8 @@ enum nl80211_frequency_attr { · 6 unmodified lines
20342053 NL80211_FREQUENCY_ATTR_NO_IBSS,
20352054 NL80211_FREQUENCY_ATTR_RADAR,
20362055 NL80211_FREQUENCY_ATTR_MAX_TX_POWER,
2056+ NL80211_FREQUENCY_ATTR_DFS_STATE,
2057+ NL80211_FREQUENCY_ATTR_DFS_TIME,
20372058
20382059 /* keep last */
20392060 __NL80211_FREQUENCY_ATTR_AFTER_LAST,
@@ -3489,4 +3510,44 @@ enum nl80211_acl_policy { · 1449 unmodified lines
34893510 NL80211_ACL_POLICY_DENY_UNLESS_LISTED,
34903511 };
34913512
3513+/**
3514+ * enum nl80211_radar_event - type of radar event for DFS operation
3515+ *
3516+ * Type of event to be used with NL80211_ATTR_RADAR_EVENT to inform userspace
3517+ * about detected radars or success of the channel available check (CAC)
3518+ *
3519+ * @NL80211_RADAR_DETECTED: A radar pattern has been detected. The channel is
3520+ * now unusable.
3521+ * @NL80211_RADAR_CAC_FINISHED: Channel Availability Check has been finished,
3522+ * the channel is now available.
3523+ * @NL80211_RADAR_CAC_ABORTED: Channel Availability Check has been aborted, no
3524+ * change to the channel status.
3525+ * @NL80211_RADAR_NOP_FINISHED: The Non-Occupancy Period for this channel is
3526+ * over, channel becomes usable.
3527+ */
3528+enum nl80211_radar_event {
3529+ NL80211_RADAR_DETECTED,
3530+ NL80211_RADAR_CAC_FINISHED,
3531+ NL80211_RADAR_CAC_ABORTED,
3532+ NL80211_RADAR_NOP_FINISHED,
3533+};
3534+
3535+/**
3536+ * enum nl80211_dfs_state - DFS states for channels
3537+ *
3538+ * Channel states used by the DFS code.
3539+ *
3540+ * @IEEE80211_DFS_USABLE: The channel can be used, but channel availability
3541+ * check (CAC) must be performed before using it for AP or IBSS.
3542+ * @IEEE80211_DFS_UNAVAILABLE: A radar has been detected on this channel, it
3543+ * is therefore marked as not available.
3544+ * @IEEE80211_DFS_AVAILABLE: The channel has been CAC checked and is available.
3545+ */
3546+
3547+enum nl80211_dfs_state {
3548+ NL80211_DFS_USABLE,
3549+ NL80211_DFS_UNAVAILABLE,
3550+ NL80211_DFS_AVAILABLE,
3551+};
3552+
34923553 #endif /* __LINUX_NL80211_H */

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t