blob: 65d67b8b05818f6af721220c609f68b22d2143fe [file] [log] [blame]
developer29c4d2d2022-12-26 19:41:22 +08001From ffc4445958a3ed4064f2e1bf73fa478a61c5cf7b Mon Sep 17 00:00:00 2001
2From: Antonio Quartulli <ordex@autistici.org>
3Date: Sun, 3 Jun 2012 18:42:25 +0200
4Subject: [PATCHv2 602/602] driver_nl80211: use new parameters during ibss join
5
6Signed-hostap: Antonio Quartulli <ordex@autistici.org>
7---
8 src/drivers/driver_nl80211.c | 33 ++++++++++++++++++++++++++++++++-
9 1 file changed, 32 insertions(+), 1 deletion(-)
10
11--- a/src/drivers/driver_nl80211.c
12+++ b/src/drivers/driver_nl80211.c
13@@ -6005,7 +6005,7 @@ static int wpa_driver_nl80211_ibss(struc
14 struct wpa_driver_associate_params *params)
15 {
16 struct nl_msg *msg;
17- int ret = -1;
18+ int ret = -1, i;
19 int count = 0;
20
21 wpa_printf(MSG_DEBUG, "nl80211: Join IBSS (ifindex=%d)", drv->ifindex);
22@@ -6032,6 +6032,37 @@ retry:
23 nl80211_put_beacon_int(msg, params->beacon_int))
24 goto fail;
25
26+ if (params->fixed_freq) {
27+ wpa_printf(MSG_DEBUG, " * fixed_freq");
28+ nla_put_flag(msg, NL80211_ATTR_FREQ_FIXED);
29+ }
30+
31+ if (params->beacon_int > 0) {
32+ wpa_printf(MSG_DEBUG, " * beacon_int=%d",
33+ params->beacon_int);
34+ nla_put_u32(msg, NL80211_ATTR_BEACON_INTERVAL,
35+ params->beacon_int);
36+ }
37+
38+ if (params->rates[0] > 0) {
39+ wpa_printf(MSG_DEBUG, " * basic_rates:");
40+ i = 0;
41+ while (i < NL80211_MAX_SUPP_RATES &&
42+ params->rates[i] > 0) {
43+ wpa_printf(MSG_DEBUG, " %.1f",
44+ (double)params->rates[i] / 2);
45+ i++;
46+ }
47+ nla_put(msg, NL80211_ATTR_BSS_BASIC_RATES, i,
48+ params->rates);
49+ }
50+
51+ if (params->mcast_rate > 0) {
52+ wpa_printf(MSG_DEBUG, " * mcast_rate=%.1f",
53+ (double)params->mcast_rate / 10);
54+ nla_put_u32(msg, NL80211_ATTR_MCAST_RATE, params->mcast_rate);
55+ }
56+
57 ret = nl80211_set_conn_keys(params, msg);
58 if (ret)
59 goto fail;