History

nl80211/cfg80211: support VHT channel configuration

Change nl80211 to support specifying a VHT (or HT) using the control channel frequency (as before) and new attributes for the channel width and first and second center frequency. The old channel type is of course still supported for HT. Also change the cfg80211 channel definition struct to support these by adding the relevant fields to it (and removing the _type field.) This also adds new helper functions: - cfg80211_chandef_create to create a channel def struct given the control channel and channel type, - cfg80211_chandef_identical to check if two channel definitions are identical - cfg80211_chandef_compatible to check if the given channel definitions are compatible, and return the wider of the two This isn't entirely complete, but that doesn't matter until we have a driver using it. In particular, it's missing - regulatory checks on the usable bandwidth (if that even makes sense) - regulatory TX power (database can't deal with it) - a proper channel compatibility calculation for the new channel types

Johannes Berg committed 14 years ago

Commit 3d9d1d61 parent 683b6d313 files · +507 −113Browse files

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

Unified · Split

include/uapi/linux/nl80211.h+52−9
@@ -118,8 +118,9 @@ · 117 unmodified lines
118 * to get a list of all present wiphys.118 * to get a list of all present wiphys.
119 * @NL80211_CMD_SET_WIPHY: set wiphy parameters, needs %NL80211_ATTR_WIPHY or119 * @NL80211_CMD_SET_WIPHY: set wiphy parameters, needs %NL80211_ATTR_WIPHY or
120 * %NL80211_ATTR_IFINDEX; can be used to set %NL80211_ATTR_WIPHY_NAME,120 * %NL80211_ATTR_IFINDEX; can be used to set %NL80211_ATTR_WIPHY_NAME,
121 * %NL80211_ATTR_WIPHY_TXQ_PARAMS, %NL80211_ATTR_WIPHY_FREQ,121 * %NL80211_ATTR_WIPHY_TXQ_PARAMS, %NL80211_ATTR_WIPHY_FREQ (and the
122 * %NL80211_ATTR_WIPHY_CHANNEL_TYPE, %NL80211_ATTR_WIPHY_RETRY_SHORT,122 * attributes determining the channel width; this is used for setting
123 * monitor mode channel), %NL80211_ATTR_WIPHY_RETRY_SHORT,
123 * %NL80211_ATTR_WIPHY_RETRY_LONG, %NL80211_ATTR_WIPHY_FRAG_THRESHOLD,124 * %NL80211_ATTR_WIPHY_RETRY_LONG, %NL80211_ATTR_WIPHY_FRAG_THRESHOLD,
124 * and/or %NL80211_ATTR_WIPHY_RTS_THRESHOLD.125 * and/or %NL80211_ATTR_WIPHY_RTS_THRESHOLD.
125 * However, for setting the channel, see %NL80211_CMD_SET_CHANNEL126 * However, for setting the channel, see %NL80211_CMD_SET_CHANNEL
@@ -171,7 +172,7 @@ · 45 unmodified lines
171 * %NL80211_ATTR_AKM_SUITES, %NL80211_ATTR_PRIVACY,172 * %NL80211_ATTR_AKM_SUITES, %NL80211_ATTR_PRIVACY,
172 * %NL80211_ATTR_AUTH_TYPE and %NL80211_ATTR_INACTIVITY_TIMEOUT.173 * %NL80211_ATTR_AUTH_TYPE and %NL80211_ATTR_INACTIVITY_TIMEOUT.
173 * The channel to use can be set on the interface or be given using the174 * The channel to use can be set on the interface or be given using the
174 * %NL80211_ATTR_WIPHY_FREQ and %NL80211_ATTR_WIPHY_CHANNEL_TYPE attrs.175 * %NL80211_ATTR_WIPHY_FREQ and the attributes determining channel width.
175 * @NL80211_CMD_NEW_BEACON: old alias for %NL80211_CMD_START_AP176 * @NL80211_CMD_NEW_BEACON: old alias for %NL80211_CMD_START_AP
176 * @NL80211_CMD_STOP_AP: Stop AP operation on the given interface177 * @NL80211_CMD_STOP_AP: Stop AP operation on the given interface
177 * @NL80211_CMD_DEL_BEACON: old alias for %NL80211_CMD_STOP_AP178 * @NL80211_CMD_DEL_BEACON: old alias for %NL80211_CMD_STOP_AP
@@ -471,8 +472,8 @@ · 293 unmodified lines
471 * command is used as an event to indicate the that a trigger level was472 * command is used as an event to indicate the that a trigger level was
472 * reached.473 * reached.
473 * @NL80211_CMD_SET_CHANNEL: Set the channel (using %NL80211_ATTR_WIPHY_FREQ474 * @NL80211_CMD_SET_CHANNEL: Set the channel (using %NL80211_ATTR_WIPHY_FREQ
474 * and %NL80211_ATTR_WIPHY_CHANNEL_TYPE) the given interface (identifed475 * and the attributes determining channel width) the given interface
475 * by %NL80211_ATTR_IFINDEX) shall operate on.476 * (identifed by %NL80211_ATTR_IFINDEX) shall operate on.
476 * In case multiple channels are supported by the device, the mechanism477 * In case multiple channels are supported by the device, the mechanism
477 * with which it switches channels is implementation-defined.478 * with which it switches channels is implementation-defined.
478 * When a monitor interface is given, it can only switch channel while479 * When a monitor interface is given, it can only switch channel while
@@ -566,8 +567,8 @@ · 87 unmodified lines
566 *567 *
567 * @NL80211_CMD_CH_SWITCH_NOTIFY: An AP or GO may decide to switch channels568 * @NL80211_CMD_CH_SWITCH_NOTIFY: An AP or GO may decide to switch channels
568 * independently of the userspace SME, send this event indicating569 * independently of the userspace SME, send this event indicating
569 * %NL80211_ATTR_IFINDEX is now on %NL80211_ATTR_WIPHY_FREQ with570 * %NL80211_ATTR_IFINDEX is now on %NL80211_ATTR_WIPHY_FREQ and the
570 * %NL80211_ATTR_WIPHY_CHANNEL_TYPE.571 * attributes determining channel width.
571 *572 *
572 * @NL80211_CMD_START_P2P_DEVICE: Start the given P2P Device, identified by573 * @NL80211_CMD_START_P2P_DEVICE: Start the given P2P Device, identified by
573 * its %NL80211_ATTR_WDEV identifier. It must have been created with574 * its %NL80211_ATTR_WDEV identifier. It must have been created with
@@ -771,14 +772,26 @@ enum nl80211_commands { · 197 unmodified lines
771 * /sys/class/ieee80211/<phyname>/index772 * /sys/class/ieee80211/<phyname>/index
772 * @NL80211_ATTR_WIPHY_NAME: wiphy name (used for renaming)773 * @NL80211_ATTR_WIPHY_NAME: wiphy name (used for renaming)
773 * @NL80211_ATTR_WIPHY_TXQ_PARAMS: a nested array of TX queue parameters774 * @NL80211_ATTR_WIPHY_TXQ_PARAMS: a nested array of TX queue parameters
774 * @NL80211_ATTR_WIPHY_FREQ: frequency of the selected channel in MHz775 * @NL80211_ATTR_WIPHY_FREQ: frequency of the selected channel in MHz,
776 * defines the channel together with the (deprecated)
777 * %NL80211_ATTR_WIPHY_CHANNEL_TYPE attribute or the attributes
778 * %NL80211_ATTR_CHANNEL_WIDTH and if needed %NL80211_ATTR_CENTER_FREQ1
779 * and %NL80211_ATTR_CENTER_FREQ2
780 * @NL80211_ATTR_CHANNEL_WIDTH: u32 attribute containing one of the values
781 * of &enum nl80211_chan_width, describing the channel width. See the
782 * documentation of the enum for more information.
783 * @NL80211_ATTR_CENTER_FREQ1: Center frequency of the first part of the
784 * channel, used for anything but 20 MHz bandwidth
785 * @NL80211_ATTR_CENTER_FREQ2: Center frequency of the second part of the
786 * channel, used only for 80+80 MHz bandwidth
775 * @NL80211_ATTR_WIPHY_CHANNEL_TYPE: included with NL80211_ATTR_WIPHY_FREQ787 * @NL80211_ATTR_WIPHY_CHANNEL_TYPE: included with NL80211_ATTR_WIPHY_FREQ
776 * if HT20 or HT40 are allowed (i.e., 802.11n disabled if not included):788 * if HT20 or HT40 are to be used (i.e., HT disabled if not included):
777 * NL80211_CHAN_NO_HT = HT not allowed (i.e., same as not including789 * NL80211_CHAN_NO_HT = HT not allowed (i.e., same as not including
778 * this attribute)790 * this attribute)
779 * NL80211_CHAN_HT20 = HT20 only791 * NL80211_CHAN_HT20 = HT20 only
780 * NL80211_CHAN_HT40MINUS = secondary channel is below the primary channel792 * NL80211_CHAN_HT40MINUS = secondary channel is below the primary channel
781 * NL80211_CHAN_HT40PLUS = secondary channel is above the primary channel793 * NL80211_CHAN_HT40PLUS = secondary channel is above the primary channel
794 * This attribute is now deprecated.
782 * @NL80211_ATTR_WIPHY_RETRY_SHORT: TX retry limit for frames whose length is795 * @NL80211_ATTR_WIPHY_RETRY_SHORT: TX retry limit for frames whose length is
783 * less than or equal to the RTS threshold; allowed range: 1..255;796 * less than or equal to the RTS threshold; allowed range: 1..255;
784 * dot11ShortRetryLimit; u8797 * dot11ShortRetryLimit; u8
@@ -1553,6 +1566,10 @@ enum nl80211_attrs { · 768 unmodified lines
1553 1566
1554 NL80211_ATTR_SCAN_FLAGS,1567 NL80211_ATTR_SCAN_FLAGS,
1555 1568
1569 NL80211_ATTR_CHANNEL_WIDTH,
1570 NL80211_ATTR_CENTER_FREQ1,
1571 NL80211_ATTR_CENTER_FREQ2,
1572
1556 /* add attributes here, update the policy in nl80211.c */1573 /* add attributes here, update the policy in nl80211.c */
1557 1574
1558 __NL80211_ATTR_AFTER_LAST,1575 __NL80211_ATTR_AFTER_LAST,
@@ -2454,6 +2471,32 @@ enum nl80211_channel_type { · 895 unmodified lines
2454 NL80211_CHAN_HT40PLUS2471 NL80211_CHAN_HT40PLUS
2455};2472};
2456 2473
2474/**
2475 * enum nl80211_chan_width - channel width definitions
2476 *
2477 * These values are used with the %NL80211_ATTR_CHANNEL_WIDTH
2478 * attribute.
2479 *
2480 * @NL80211_CHAN_WIDTH_20_NOHT: 20 MHz, non-HT channel
2481 * @NL80211_CHAN_WIDTH_20: 20 MHz HT channel
2482 * @NL80211_CHAN_WIDTH_40: 40 MHz channel, the %NL80211_ATTR_CENTER_FREQ1
2483 * attribute must be provided as well
2484 * @NL80211_CHAN_WIDTH_80: 80 MHz channel, the %NL80211_ATTR_CENTER_FREQ1
2485 * attribute must be provided as well
2486 * @NL80211_CHAN_WIDTH_80P80: 80+80 MHz channel, the %NL80211_ATTR_CENTER_FREQ1
2487 * and %NL80211_ATTR_CENTER_FREQ2 attributes must be provided as well
2488 * @NL80211_CHAN_WIDTH_160: 160 MHz channel, the %NL80211_ATTR_CENTER_FREQ1
2489 * attribute must be provided as well
2490 */
2491enum nl80211_chan_width {
2492 NL80211_CHAN_WIDTH_20_NOHT,
2493 NL80211_CHAN_WIDTH_20,
2494 NL80211_CHAN_WIDTH_40,
2495 NL80211_CHAN_WIDTH_80,
2496 NL80211_CHAN_WIDTH_80P80,
2497 NL80211_CHAN_WIDTH_160,
2498};
2499
2457/**2500/**
2458 * enum nl80211_bss - netlink attributes for a BSS2501 * enum nl80211_bss - netlink attributes for a BSS
2459 *2502 *

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