If the driver advertises NL80211_EXT_FEATURE_SCAN_FREQ_KHZ userspace can omit NL80211_ATTR_SCAN_FREQUENCIES in favor of an NL80211_ATTR_SCAN_FREQ_KHZ. To get scan results in KHz userspace must also set the NL80211_SCAN_FLAG_FREQ_KHZ. This lets nl80211 remain compatible with older userspaces while not requring and sending redundant (and potentially incorrect) scan frequency sets.
Showing the changes to include/uapi/linux (1 of 3 files). Show all
Unified · Split
| @@ -2492,7 +2492,7 @@ enum nl80211_commands { · 2491 unmodified lines | ||
| 2492 | 2492 | * an %NL80211_ATTR_WIPHY_FREQ_OFFSET. |
| 2493 | 2493 | * @NL80211_ATTR_CENTER_FREQ1_OFFSET: Center frequency offset in KHz for the |
| 2494 | 2494 | * first channel segment specified in %NL80211_ATTR_CENTER_FREQ1. |
| 2495 | − * | |
| 2495 | + * @NL80211_ATTR_SCAN_FREQ_KHZ: nested attribute with KHz frequencies | |
| 2496 | 2496 | * |
| 2497 | 2497 | * @NUM_NL80211_ATTR: total number of nl80211_attrs available |
| 2498 | 2498 | * @NL80211_ATTR_MAX: highest attribute number currently defined |
| @@ -2972,6 +2972,7 @@ enum nl80211_attrs { · 473 unmodified lines | ||
| 2972 | 2972 | NL80211_ATTR_RECEIVE_MULTICAST, |
| 2973 | 2973 | NL80211_ATTR_WIPHY_FREQ_OFFSET, |
| 2974 | 2974 | NL80211_ATTR_CENTER_FREQ1_OFFSET, |
| 2975 | + NL80211_ATTR_SCAN_FREQ_KHZ, | |
| 2975 | 2976 | |
| 2976 | 2977 | /* add attributes here, update the policy in nl80211.c */ |
| 2977 | 2978 | |
| @@ -5723,6 +5724,11 @@ enum nl80211_feature_flags { · 2745 unmodified lines | ||
| 5723 | 5724 | * @NL80211_EXT_FEATURE_MULTICAST_REGISTRATIONS: management frame registrations |
| 5724 | 5725 | * are possible for multicast frames and those will be reported properly. |
| 5725 | 5726 | * |
| 5727 | + * @NL80211_EXT_FEATURE_SCAN_FREQ_KHZ: This driver supports receiving and | |
| 5728 | + * reporting scan request with %NL80211_ATTR_SCAN_FREQ_KHZ. In order to | |
| 5729 | + * report %NL80211_ATTR_SCAN_FREQ_KHZ, %NL80211_SCAN_FLAG_FREQ_KHZ must be | |
| 5730 | + * included in the scan request. | |
| 5731 | + * | |
| 5726 | 5732 | * @NUM_NL80211_EXT_FEATURES: number of extended features. |
| 5727 | 5733 | * @MAX_NL80211_EXT_FEATURES: highest extended feature index. |
| 5728 | 5734 | */ |
| @@ -5776,6 +5782,7 @@ enum nl80211_ext_feature_index { · 47 unmodified lines | ||
| 5776 | 5782 | NL80211_EXT_FEATURE_DEL_IBSS_STA, |
| 5777 | 5783 | NL80211_EXT_FEATURE_MULTICAST_REGISTRATIONS, |
| 5778 | 5784 | NL80211_EXT_FEATURE_BEACON_PROTECTION_CLIENT, |
| 5785 | + NL80211_EXT_FEATURE_SCAN_FREQ_KHZ, | |
| 5779 | 5786 | |
| 5780 | 5787 | /* add new features before the definition below */ |
| 5781 | 5788 | NUM_NL80211_EXT_FEATURES, |
| @@ -5887,6 +5894,9 @@ enum nl80211_timeout_reason { · 105 unmodified lines | ||
| 5887 | 5894 | * @NL80211_SCAN_FLAG_MIN_PREQ_CONTENT: minimize probe request content to |
| 5888 | 5895 | * only have supported rates and no additional capabilities (unless |
| 5889 | 5896 | * added by userspace explicitly.) |
| 5897 | + * @NL80211_SCAN_FLAG_FREQ_KHZ: report scan results with | |
| 5898 | + * %NL80211_ATTR_SCAN_FREQ_KHZ. This also means | |
| 5899 | + * %NL80211_ATTR_SCAN_FREQUENCIES will not be included. | |
| 5890 | 5900 | */ |
| 5891 | 5901 | enum nl80211_scan_flags { |
| 5892 | 5902 | NL80211_SCAN_FLAG_LOW_PRIORITY = 1<<0, |
| @@ -5902,6 +5912,7 @@ enum nl80211_scan_flags { · 9 unmodified lines | ||
| 5902 | 5912 | NL80211_SCAN_FLAG_HIGH_ACCURACY = 1<<10, |
| 5903 | 5913 | NL80211_SCAN_FLAG_RANDOM_SN = 1<<11, |
| 5904 | 5914 | NL80211_SCAN_FLAG_MIN_PREQ_CONTENT = 1<<12, |
| 5915 | + NL80211_SCAN_FLAG_FREQ_KHZ = 1<<13, | |
| 5905 | 5916 | }; |
| 5906 | 5917 | |
| 5907 | 5918 | /** |