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
118118 * to get a list of all present wiphys.
119119 * @NL80211_CMD_SET_WIPHY: set wiphy parameters, needs %NL80211_ATTR_WIPHY or
120120 * %NL80211_ATTR_IFINDEX; can be used to set %NL80211_ATTR_WIPHY_NAME,
121− * %NL80211_ATTR_WIPHY_TXQ_PARAMS, %NL80211_ATTR_WIPHY_FREQ,
122− * %NL80211_ATTR_WIPHY_CHANNEL_TYPE, %NL80211_ATTR_WIPHY_RETRY_SHORT,
121+ * %NL80211_ATTR_WIPHY_TXQ_PARAMS, %NL80211_ATTR_WIPHY_FREQ (and the
122+ * attributes determining the channel width; this is used for setting
123+ * monitor mode channel), %NL80211_ATTR_WIPHY_RETRY_SHORT,
123124 * %NL80211_ATTR_WIPHY_RETRY_LONG, %NL80211_ATTR_WIPHY_FRAG_THRESHOLD,
124125 * and/or %NL80211_ATTR_WIPHY_RTS_THRESHOLD.
125126 * However, for setting the channel, see %NL80211_CMD_SET_CHANNEL
@@ -171,7 +172,7 @@ · 45 unmodified lines
171172 * %NL80211_ATTR_AKM_SUITES, %NL80211_ATTR_PRIVACY,
172173 * %NL80211_ATTR_AUTH_TYPE and %NL80211_ATTR_INACTIVITY_TIMEOUT.
173174 * 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.
175176 * @NL80211_CMD_NEW_BEACON: old alias for %NL80211_CMD_START_AP
176177 * @NL80211_CMD_STOP_AP: Stop AP operation on the given interface
177178 * @NL80211_CMD_DEL_BEACON: old alias for %NL80211_CMD_STOP_AP
@@ -471,8 +472,8 @@ · 293 unmodified lines
471472 * command is used as an event to indicate the that a trigger level was
472473 * reached.
473474 * @NL80211_CMD_SET_CHANNEL: Set the channel (using %NL80211_ATTR_WIPHY_FREQ
474− * and %NL80211_ATTR_WIPHY_CHANNEL_TYPE) the given interface (identifed
475− * by %NL80211_ATTR_IFINDEX) shall operate on.
475+ * and the attributes determining channel width) the given interface
476+ * (identifed by %NL80211_ATTR_IFINDEX) shall operate on.
476477 * In case multiple channels are supported by the device, the mechanism
477478 * with which it switches channels is implementation-defined.
478479 * When a monitor interface is given, it can only switch channel while
@@ -566,8 +567,8 @@ · 87 unmodified lines
566567 *
567568 * @NL80211_CMD_CH_SWITCH_NOTIFY: An AP or GO may decide to switch channels
568569 * independently of the userspace SME, send this event indicating
569− * %NL80211_ATTR_IFINDEX is now on %NL80211_ATTR_WIPHY_FREQ with
570− * %NL80211_ATTR_WIPHY_CHANNEL_TYPE.
570+ * %NL80211_ATTR_IFINDEX is now on %NL80211_ATTR_WIPHY_FREQ and the
571+ * attributes determining channel width.
571572 *
572573 * @NL80211_CMD_START_P2P_DEVICE: Start the given P2P Device, identified by
573574 * its %NL80211_ATTR_WDEV identifier. It must have been created with
@@ -771,14 +772,26 @@ enum nl80211_commands { · 197 unmodified lines
771772 * /sys/class/ieee80211/<phyname>/index
772773 * @NL80211_ATTR_WIPHY_NAME: wiphy name (used for renaming)
773774 * @NL80211_ATTR_WIPHY_TXQ_PARAMS: a nested array of TX queue parameters
774− * @NL80211_ATTR_WIPHY_FREQ: frequency of the selected channel in MHz
775+ * @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
775787 * @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):
777789 * NL80211_CHAN_NO_HT = HT not allowed (i.e., same as not including
778790 * this attribute)
779791 * NL80211_CHAN_HT20 = HT20 only
780792 * NL80211_CHAN_HT40MINUS = secondary channel is below the primary channel
781793 * NL80211_CHAN_HT40PLUS = secondary channel is above the primary channel
794+ * This attribute is now deprecated.
782795 * @NL80211_ATTR_WIPHY_RETRY_SHORT: TX retry limit for frames whose length is
783796 * less than or equal to the RTS threshold; allowed range: 1..255;
784797 * dot11ShortRetryLimit; u8
@@ -1553,6 +1566,10 @@ enum nl80211_attrs { · 768 unmodified lines
15531566
15541567 NL80211_ATTR_SCAN_FLAGS,
15551568
1569+ NL80211_ATTR_CHANNEL_WIDTH,
1570+ NL80211_ATTR_CENTER_FREQ1,
1571+ NL80211_ATTR_CENTER_FREQ2,
1572+
15561573 /* add attributes here, update the policy in nl80211.c */
15571574
15581575 __NL80211_ATTR_AFTER_LAST,
@@ -2454,6 +2471,32 @@ enum nl80211_channel_type { · 895 unmodified lines
24542471 NL80211_CHAN_HT40PLUS
24552472 };
24562473
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+ */
2491+enum 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+
24572500 /**
24582501 * enum nl80211_bss - netlink attributes for a BSS
24592502 *

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