Manually refreshed: 010-mesh-Allow-DFS-channels-to-be-selected-if-dfs-is-ena.patch 110-mbedtls-TLS-crypto-option-initial-port.patch 140-tests-Makefile-make-run-tests-with-CONFIG_TLS.patch 301-mesh-noscan.patch 601-ucode_support.patch 780-Implement-APuP-Access-Point-Micro-Peering.patch Dropped upstreamed: 330-nl80211_fix_set_freq.patch 804-hostapd-Fix-clearing-up-settings-for-color-switch.patch Automatically rebased all other patches. Tested-by: Rany Hany <rany_hany@riseup.net> # ramips_mt7621/asus_rt-ax53u, mt7622/xiaomi_redmi-router-ax6s Tested-by: Andre Heider <a.heider@gmail.com> # filogic/openwrt_one, ramips_mt7621/netgear_wac124 Tested-by: Agustin Lorenzo <agustin.lorenzo@thinco.es> # qualcommax/ipq807x (AX3600) Tested-by: Daniel Pawlik <pawlik.dan@gmail.com> # BPi-R4 with mt7996 Signed-off-by: Rany Hany <rany_hany@riseup.net>
171 lines
4.1 KiB
Diff
171 lines
4.1 KiB
Diff
From 4bb69d15477e0f2b00e166845341dc933de47c58 Mon Sep 17 00:00:00 2001
|
|
From: Antonio Quartulli <ordex@autistici.org>
|
|
Date: Sun, 3 Jun 2012 18:22:56 +0200
|
|
Subject: [PATCHv2 601/602] wpa_supplicant: add new config params to be used
|
|
with the ibss join command
|
|
|
|
Signed-hostap: Antonio Quartulli <ordex@autistici.org>
|
|
---
|
|
src/drivers/driver.h | 6 +++
|
|
wpa_supplicant/config.c | 96 +++++++++++++++++++++++++++++++++++++++
|
|
wpa_supplicant/config_ssid.h | 6 +++
|
|
wpa_supplicant/wpa_supplicant.c | 23 +++++++---
|
|
4 files changed, 124 insertions(+), 7 deletions(-)
|
|
|
|
--- a/src/drivers/driver.h
|
|
+++ b/src/drivers/driver.h
|
|
@@ -1012,6 +1012,9 @@ struct wpa_driver_associate_params {
|
|
* responsible for selecting with which BSS to associate. */
|
|
const u8 *bssid;
|
|
|
|
+ unsigned char rates[WLAN_SUPP_RATES_MAX];
|
|
+ int mcast_rate;
|
|
+
|
|
/**
|
|
* bssid_hint - BSSID of a proposed AP
|
|
*
|
|
--- a/wpa_supplicant/config.c
|
|
+++ b/wpa_supplicant/config.c
|
|
@@ -18,6 +18,7 @@
|
|
#include "eap_peer/eap.h"
|
|
#include "p2p/p2p.h"
|
|
#include "fst/fst.h"
|
|
+#include "ap/sta_info.h"
|
|
#include "config.h"
|
|
|
|
|
|
@@ -2449,6 +2450,97 @@ static char * wpa_config_write_mac_value
|
|
#endif /* NO_CONFIG_WRITE */
|
|
|
|
|
|
+static int wpa_config_parse_mcast_rate(const struct parse_data *data,
|
|
+ struct wpa_ssid *ssid, int line,
|
|
+ const char *value)
|
|
+{
|
|
+ ssid->mcast_rate = (int)(strtod(value, NULL) * 10);
|
|
+
|
|
+ return 0;
|
|
+}
|
|
+
|
|
+#ifndef NO_CONFIG_WRITE
|
|
+static char * wpa_config_write_mcast_rate(const struct parse_data *data,
|
|
+ struct wpa_ssid *ssid)
|
|
+{
|
|
+ char *value;
|
|
+ int res;
|
|
+
|
|
+ if (!ssid->mcast_rate == 0)
|
|
+ return NULL;
|
|
+
|
|
+ value = os_malloc(6); /* longest: 300.0 */
|
|
+ if (value == NULL)
|
|
+ return NULL;
|
|
+ res = os_snprintf(value, 5, "%.1f", (double)ssid->mcast_rate / 10);
|
|
+ if (res < 0) {
|
|
+ os_free(value);
|
|
+ return NULL;
|
|
+ }
|
|
+ return value;
|
|
+}
|
|
+#endif /* NO_CONFIG_WRITE */
|
|
+
|
|
+static int wpa_config_parse_rates(const struct parse_data *data,
|
|
+ struct wpa_ssid *ssid, int line,
|
|
+ const char *value)
|
|
+{
|
|
+ int i;
|
|
+ char *pos, *r, *sptr, *end;
|
|
+ double rate;
|
|
+
|
|
+ pos = (char *)value;
|
|
+ r = strtok_r(pos, ",", &sptr);
|
|
+ i = 0;
|
|
+ while (pos && i < WLAN_SUPP_RATES_MAX) {
|
|
+ rate = 0.0;
|
|
+ if (r)
|
|
+ rate = strtod(r, &end);
|
|
+ ssid->rates[i] = rate * 2;
|
|
+ if (*end != '\0' || rate * 2 != ssid->rates[i])
|
|
+ return 1;
|
|
+
|
|
+ i++;
|
|
+ r = strtok_r(NULL, ",", &sptr);
|
|
+ }
|
|
+
|
|
+ return 0;
|
|
+}
|
|
+
|
|
+#ifndef NO_CONFIG_WRITE
|
|
+static char * wpa_config_write_rates(const struct parse_data *data,
|
|
+ struct wpa_ssid *ssid)
|
|
+{
|
|
+ char *value, *pos;
|
|
+ int res, i;
|
|
+
|
|
+ if (ssid->rates[0] <= 0)
|
|
+ return NULL;
|
|
+
|
|
+ value = os_malloc(6 * WLAN_SUPP_RATES_MAX + 1);
|
|
+ if (value == NULL)
|
|
+ return NULL;
|
|
+ pos = value;
|
|
+ for (i = 0; i < WLAN_SUPP_RATES_MAX - 1; i++) {
|
|
+ res = os_snprintf(pos, 6, "%.1f,", (double)ssid->rates[i] / 2);
|
|
+ if (res < 0) {
|
|
+ os_free(value);
|
|
+ return NULL;
|
|
+ }
|
|
+ pos += res;
|
|
+ }
|
|
+ res = os_snprintf(pos, 6, "%.1f",
|
|
+ (double)ssid->rates[WLAN_SUPP_RATES_MAX - 1] / 2);
|
|
+ if (res < 0) {
|
|
+ os_free(value);
|
|
+ return NULL;
|
|
+ }
|
|
+
|
|
+ value[6 * WLAN_SUPP_RATES_MAX] = '\0';
|
|
+ return value;
|
|
+}
|
|
+#endif /* NO_CONFIG_WRITE */
|
|
+
|
|
/* Helper macros for network block parser */
|
|
|
|
#ifdef OFFSET
|
|
@@ -2744,6 +2836,8 @@ static const struct parse_data ssid_fiel
|
|
{ INT(ap_max_inactivity) },
|
|
{ INT(dtim_period) },
|
|
{ INT(beacon_int) },
|
|
+ { FUNC(rates) },
|
|
+ { FUNC(mcast_rate) },
|
|
#ifdef CONFIG_MACSEC
|
|
{ INT_RANGE(macsec_policy, 0, 1) },
|
|
{ INT_RANGE(macsec_integ_only, 0, 1) },
|
|
--- a/wpa_supplicant/config_ssid.h
|
|
+++ b/wpa_supplicant/config_ssid.h
|
|
@@ -907,6 +907,9 @@ struct wpa_ssid {
|
|
*/
|
|
void *parent_cred;
|
|
|
|
+ unsigned char rates[WLAN_SUPP_RATES_MAX];
|
|
+ double mcast_rate;
|
|
+
|
|
#ifdef CONFIG_MACSEC
|
|
/**
|
|
* macsec_policy - Determines the policy for MACsec secure session
|
|
--- a/wpa_supplicant/wpa_supplicant.c
|
|
+++ b/wpa_supplicant/wpa_supplicant.c
|
|
@@ -4635,6 +4635,12 @@ static void wpas_start_assoc_cb(struct w
|
|
params.beacon_int = ssid->beacon_int;
|
|
else
|
|
params.beacon_int = wpa_s->conf->beacon_int;
|
|
+ int i = 0;
|
|
+ while (i < WLAN_SUPP_RATES_MAX) {
|
|
+ params.rates[i] = ssid->rates[i];
|
|
+ i++;
|
|
+ }
|
|
+ params.mcast_rate = ssid->mcast_rate;
|
|
}
|
|
|
|
if (bss && ssid->enable_edmg)
|