Skip to content

Commit 0e74008

Browse files
committed
Merge tag 'mac80211-next-for-davem-2017-06-13' of git://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211-next
Johannes Berg says: ==================== A couple of weeks worth of updates - looks like things are quiet: * merged net-next back to get a patch from net that another patch here depends on * various small improvements/cleanups across the board * 4-way handshake offload (many thanks to Arend for shepherding that) * mesh CSA/DFS support in mac80211 * the skb_put_zero() we discussed previously ==================== Signed-off-by: David S. Miller <[email protected]>
2 parents 5952b02 + 4524667 commit 0e74008

32 files changed

+620
-111
lines changed

include/linux/ieee80211.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2400,7 +2400,11 @@ enum ieee80211_sa_query_action {
24002400

24012401
#define WLAN_MAX_KEY_LEN 32
24022402

2403+
#define WLAN_PMK_NAME_LEN 16
24032404
#define WLAN_PMKID_LEN 16
2405+
#define WLAN_PMK_LEN_EAP_LEAP 16
2406+
#define WLAN_PMK_LEN 32
2407+
#define WLAN_PMK_LEN_SUITE_B_192 48
24042408

24052409
#define WLAN_OUI_WFA 0x506f9a
24062410
#define WLAN_OUI_TYPE_WFA_P2P 9

include/linux/skbuff.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1904,6 +1904,15 @@ static inline unsigned char *__skb_put(struct sk_buff *skb, unsigned int len)
19041904
return tmp;
19051905
}
19061906

1907+
static inline unsigned char *skb_put_zero(struct sk_buff *skb, unsigned int len)
1908+
{
1909+
unsigned char *tmp = skb_put(skb, len);
1910+
1911+
memset(tmp, 0, len);
1912+
1913+
return tmp;
1914+
}
1915+
19071916
unsigned char *skb_push(struct sk_buff *skb, unsigned int len);
19081917
static inline unsigned char *__skb_push(struct sk_buff *skb, unsigned int len)
19091918
{

include/net/cfg80211.h

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -649,6 +649,7 @@ struct survey_info {
649649
* @wep_keys: static WEP keys, if not NULL points to an array of
650650
* CFG80211_MAX_WEP_KEYS WEP keys
651651
* @wep_tx_key: key index (0..3) of the default TX static WEP key
652+
* @psk: PSK (for devices supporting 4-way-handshake offload)
652653
*/
653654
struct cfg80211_crypto_settings {
654655
u32 wpa_versions;
@@ -662,6 +663,7 @@ struct cfg80211_crypto_settings {
662663
bool control_port_no_encrypt;
663664
struct key_params *wep_keys;
664665
int wep_tx_key;
666+
const u8 *psk;
665667
};
666668

667669
/**
@@ -1441,6 +1443,9 @@ struct mesh_config {
14411443
* @mcast_rate: multicat rate for Mesh Node [6Mbps is the default for 802.11a]
14421444
* @basic_rates: basic rates to use when creating the mesh
14431445
* @beacon_rate: bitrate to be used for beacons
1446+
* @userspace_handles_dfs: whether user space controls DFS operation, i.e.
1447+
* changes the channel when a radar is detected. This is required
1448+
* to operate on DFS channels.
14441449
*
14451450
* These parameters are fixed when the mesh is created.
14461451
*/
@@ -1462,6 +1467,7 @@ struct mesh_setup {
14621467
int mcast_rate[NUM_NL80211_BANDS];
14631468
u32 basic_rates;
14641469
struct cfg80211_bitrate_mask beacon_rate;
1470+
bool userspace_handles_dfs;
14651471
};
14661472

14671473
/**
@@ -2106,6 +2112,8 @@ struct cfg80211_bss_selection {
21062112
* @fils_erp_rrk: ERP re-authentication Root Key (rRK) used to derive additional
21072113
* keys in FILS or %NULL if not specified.
21082114
* @fils_erp_rrk_len: Length of @fils_erp_rrk in octets.
2115+
* @want_1x: indicates user-space supports and wants to use 802.1X driver
2116+
* offload of 4-way handshake.
21092117
*/
21102118
struct cfg80211_connect_params {
21112119
struct ieee80211_channel *channel;
@@ -2138,6 +2146,7 @@ struct cfg80211_connect_params {
21382146
u16 fils_erp_next_seq_num;
21392147
const u8 *fils_erp_rrk;
21402148
size_t fils_erp_rrk_len;
2149+
bool want_1x;
21412150
};
21422151

21432152
/**
@@ -2559,6 +2568,23 @@ struct cfg80211_nan_func {
25592568
u64 cookie;
25602569
};
25612570

2571+
/**
2572+
* struct cfg80211_pmk_conf - PMK configuration
2573+
*
2574+
* @aa: authenticator address
2575+
* @pmk_len: PMK length in bytes.
2576+
* @pmk: the PMK material
2577+
* @pmk_r0_name: PMK-R0 Name. NULL if not applicable (i.e., the PMK
2578+
* is not PMK-R0). When pmk_r0_name is not NULL, the pmk field
2579+
* holds PMK-R0.
2580+
*/
2581+
struct cfg80211_pmk_conf {
2582+
const u8 *aa;
2583+
u8 pmk_len;
2584+
const u8 *pmk;
2585+
const u8 *pmk_r0_name;
2586+
};
2587+
25622588
/**
25632589
* struct cfg80211_ops - backend description for wireless configuration
25642590
*
@@ -2875,6 +2901,13 @@ struct cfg80211_nan_func {
28752901
* All other parameters must be ignored.
28762902
*
28772903
* @set_multicast_to_unicast: configure multicast to unicast conversion for BSS
2904+
*
2905+
* @set_pmk: configure the PMK to be used for offloaded 802.1X 4-Way handshake.
2906+
* If not deleted through @del_pmk the PMK remains valid until disconnect
2907+
* upon which the driver should clear it.
2908+
* (invoked with the wireless_dev mutex held)
2909+
* @del_pmk: delete the previously configured PMK for the given authenticator.
2910+
* (invoked with the wireless_dev mutex held)
28782911
*/
28792912
struct cfg80211_ops {
28802913
int (*suspend)(struct wiphy *wiphy, struct cfg80211_wowlan *wow);
@@ -3163,6 +3196,11 @@ struct cfg80211_ops {
31633196
int (*set_multicast_to_unicast)(struct wiphy *wiphy,
31643197
struct net_device *dev,
31653198
const bool enabled);
3199+
3200+
int (*set_pmk)(struct wiphy *wiphy, struct net_device *dev,
3201+
const struct cfg80211_pmk_conf *conf);
3202+
int (*del_pmk)(struct wiphy *wiphy, struct net_device *dev,
3203+
const u8 *aa);
31663204
};
31673205

31683206
/*
@@ -5403,6 +5441,9 @@ cfg80211_connect_timeout(struct net_device *dev, const u8 *bssid,
54035441
* @req_ie_len: association request IEs length
54045442
* @resp_ie: association response IEs (may be %NULL)
54055443
* @resp_ie_len: assoc response IEs length
5444+
* @authorized: true if the 802.1X authentication was done by the driver or is
5445+
* not needed (e.g., when Fast Transition protocol was used), false
5446+
* otherwise. Ignored for networks that don't use 802.1X authentication.
54065447
*/
54075448
struct cfg80211_roam_info {
54085449
struct ieee80211_channel *channel;
@@ -5412,6 +5453,7 @@ struct cfg80211_roam_info {
54125453
size_t req_ie_len;
54135454
const u8 *resp_ie;
54145455
size_t resp_ie_len;
5456+
bool authorized;
54155457
};
54165458

54175459
/**

include/net/mac80211.h

Lines changed: 33 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4204,6 +4204,22 @@ void ieee80211_get_tx_rates(struct ieee80211_vif *vif,
42044204
struct ieee80211_tx_rate *dest,
42054205
int max_rates);
42064206

4207+
/**
4208+
* ieee80211_sta_set_expected_throughput - set the expected tpt for a station
4209+
*
4210+
* Call this function to notify mac80211 about a change in expected throughput
4211+
* to a station. A driver for a device that does rate control in firmware can
4212+
* call this function when the expected throughput estimate towards a station
4213+
* changes. The information is used to tune the CoDel AQM applied to traffic
4214+
* going towards that station (which can otherwise be too aggressive and cause
4215+
* slow stations to starve).
4216+
*
4217+
* @pubsta: the station to set throughput for.
4218+
* @thr: the current expected throughput in kbps.
4219+
*/
4220+
void ieee80211_sta_set_expected_throughput(struct ieee80211_sta *pubsta,
4221+
u32 thr);
4222+
42074223
/**
42084224
* ieee80211_tx_status - transmit status callback
42094225
*
@@ -5436,6 +5452,9 @@ void ieee80211_mark_rx_ba_filtered_frames(struct ieee80211_sta *pubsta, u8 tid,
54365452
*/
54375453
void ieee80211_send_bar(struct ieee80211_vif *vif, u8 *ra, u16 tid, u16 ssn);
54385454

5455+
void ieee80211_manage_rx_ba_offl(struct ieee80211_vif *vif, const u8 *addr,
5456+
unsigned int bit);
5457+
54395458
/**
54405459
* ieee80211_start_rx_ba_session_offl - start a Rx BA session
54415460
*
@@ -5450,8 +5469,13 @@ void ieee80211_send_bar(struct ieee80211_vif *vif, u8 *ra, u16 tid, u16 ssn);
54505469
* @addr: station mac address
54515470
* @tid: the rx tid
54525471
*/
5453-
void ieee80211_start_rx_ba_session_offl(struct ieee80211_vif *vif,
5454-
const u8 *addr, u16 tid);
5472+
static inline void ieee80211_start_rx_ba_session_offl(struct ieee80211_vif *vif,
5473+
const u8 *addr, u16 tid)
5474+
{
5475+
if (WARN_ON(tid >= IEEE80211_NUM_TIDS))
5476+
return;
5477+
ieee80211_manage_rx_ba_offl(vif, addr, tid);
5478+
}
54555479

54565480
/**
54575481
* ieee80211_stop_rx_ba_session_offl - stop a Rx BA session
@@ -5467,8 +5491,13 @@ void ieee80211_start_rx_ba_session_offl(struct ieee80211_vif *vif,
54675491
* @addr: station mac address
54685492
* @tid: the rx tid
54695493
*/
5470-
void ieee80211_stop_rx_ba_session_offl(struct ieee80211_vif *vif,
5471-
const u8 *addr, u16 tid);
5494+
static inline void ieee80211_stop_rx_ba_session_offl(struct ieee80211_vif *vif,
5495+
const u8 *addr, u16 tid)
5496+
{
5497+
if (WARN_ON(tid >= IEEE80211_NUM_TIDS))
5498+
return;
5499+
ieee80211_manage_rx_ba_offl(vif, addr, tid + IEEE80211_NUM_TIDS);
5500+
}
54725501

54735502
/* Rate control API */
54745503

include/uapi/linux/nl80211.h

Lines changed: 69 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,29 @@
172172
* Multiple such rules can be created.
173173
*/
174174

175+
/**
176+
* DOC: WPA/WPA2 EAPOL handshake offload
177+
*
178+
* By setting @NL80211_EXT_FEATURE_4WAY_HANDSHAKE_STA_PSK flag drivers
179+
* can indicate they support offloading EAPOL handshakes for WPA/WPA2
180+
* preshared key authentication. In %NL80211_CMD_CONNECT the preshared
181+
* key should be specified using %NL80211_ATTR_PMK. Drivers supporting
182+
* this offload may reject the %NL80211_CMD_CONNECT when no preshared
183+
* key material is provided, for example when that driver does not
184+
* support setting the temporal keys through %CMD_NEW_KEY.
185+
*
186+
* Similarly @NL80211_EXT_FEATURE_4WAY_HANDSHAKE_STA_1X flag can be
187+
* set by drivers indicating offload support of the PTK/GTK EAPOL
188+
* handshakes during 802.1X authentication. In order to use the offload
189+
* the %NL80211_CMD_CONNECT should have %NL80211_ATTR_WANT_1X_4WAY_HS
190+
* attribute flag. Drivers supporting this offload may reject the
191+
* %NL80211_CMD_CONNECT when the attribute flag is not present.
192+
*
193+
* For 802.1X the PMK or PMK-R0 are set by providing %NL80211_ATTR_PMK
194+
* using %NL80211_CMD_SET_PMK. For offloaded FT support also
195+
* %NL80211_ATTR_PMKR0_NAME must be provided.
196+
*/
197+
175198
/**
176199
* DOC: FILS shared key authentication offload
177200
*
@@ -546,8 +569,13 @@
546569
* authentication/association or not receiving a response from the AP.
547570
* Non-zero %NL80211_ATTR_STATUS_CODE value is indicated in that case as
548571
* well to remain backwards compatible.
549-
* @NL80211_CMD_ROAM: request that the card roam (currently not implemented),
550-
* sent as an event when the card/driver roamed by itself.
572+
* @NL80211_CMD_ROAM: notifcation indicating the card/driver roamed by itself.
573+
* When the driver roamed in a network that requires 802.1X authentication,
574+
* %NL80211_ATTR_PORT_AUTHORIZED should be set if the 802.1X authentication
575+
* was done by the driver or if roaming was done using Fast Transition
576+
* protocol (in which case 802.1X authentication is not needed). If
577+
* %NL80211_ATTR_PORT_AUTHORIZED is not set, user space is responsible for
578+
* the 802.1X authentication.
551579
* @NL80211_CMD_DISCONNECT: drop a given connection; also used to notify
552580
* userspace that a connection was dropped by the AP or due to other
553581
* reasons, for this the %NL80211_ATTR_DISCONNECTED_BY_AP and
@@ -947,6 +975,14 @@
947975
* does not result in a change for the current association. Currently,
948976
* only the %NL80211_ATTR_IE data is used and updated with this command.
949977
*
978+
* @NL80211_CMD_SET_PMK: For offloaded 4-Way handshake, set the PMK or PMK-R0
979+
* for the given authenticator address (specified with &NL80211_ATTR_MAC).
980+
* When &NL80211_ATTR_PMKR0_NAME is set, &NL80211_ATTR_PMK specifies the
981+
* PMK-R0, otherwise it specifies the PMK.
982+
* @NL80211_CMD_DEL_PMK: For offloaded 4-Way handshake, delete the previously
983+
* configured PMK for the authenticator address identified by
984+
* &NL80211_ATTR_MAC.
985+
*
950986
* @NL80211_CMD_MAX: highest used command number
951987
* @__NL80211_CMD_AFTER_LAST: internal use
952988
*/
@@ -1146,6 +1182,9 @@ enum nl80211_commands {
11461182

11471183
NL80211_CMD_UPDATE_CONNECT_PARAMS,
11481184

1185+
NL80211_CMD_SET_PMK,
1186+
NL80211_CMD_DEL_PMK,
1187+
11491188
/* add new commands above here */
11501189

11511190
/* used to define NL80211_CMD_MAX below */
@@ -2080,14 +2119,27 @@ enum nl80211_commands {
20802119
* identifying the scope of PMKSAs. This is used with
20812120
* @NL80211_CMD_SET_PMKSA and @NL80211_CMD_DEL_PMKSA.
20822121
*
2083-
* @NL80211_ATTR_PMK: PMK for the PMKSA identified by %NL80211_ATTR_PMKID.
2084-
* This is used with @NL80211_CMD_SET_PMKSA.
2122+
* @NL80211_ATTR_PMK: attribute for passing PMK key material. Used with
2123+
* %NL80211_CMD_SET_PMKSA for the PMKSA identified by %NL80211_ATTR_PMKID.
2124+
* For %NL80211_CMD_CONNECT it is used to provide PSK for offloading 4-way
2125+
* handshake for WPA/WPA2-PSK networks. For 802.1X authentication it is
2126+
* used with %NL80211_CMD_SET_PMK. For offloaded FT support this attribute
2127+
* specifies the PMK-R0 if NL80211_ATTR_PMKR0_NAME is included as well.
20852128
*
20862129
* @NL80211_ATTR_SCHED_SCAN_MULTI: flag attribute which user-space shall use to
20872130
* indicate that it supports multiple active scheduled scan requests.
20882131
* @NL80211_ATTR_SCHED_SCAN_MAX_REQS: indicates maximum number of scheduled
20892132
* scan request that may be active for the device (u32).
20902133
*
2134+
* @NL80211_ATTR_WANT_1X_4WAY_HS: flag attribute which user-space can include
2135+
* in %NL80211_CMD_CONNECT to indicate that for 802.1X authentication it
2136+
* wants to use the supported offload of the 4-way handshake.
2137+
* @NL80211_ATTR_PMKR0_NAME: PMK-R0 Name for offloaded FT.
2138+
* @NL80211_ATTR_PORT_AUTHORIZED: flag attribute used in %NL80211_CMD_ROAMED
2139+
* notification indicating that that 802.1X authentication was done by
2140+
* the driver or is not needed (because roaming used the Fast Transition
2141+
* protocol).
2142+
*
20912143
* @NUM_NL80211_ATTR: total number of nl80211_attrs available
20922144
* @NL80211_ATTR_MAX: highest attribute number currently defined
20932145
* @__NL80211_ATTR_AFTER_LAST: internal use
@@ -2510,6 +2562,10 @@ enum nl80211_attrs {
25102562
NL80211_ATTR_SCHED_SCAN_MULTI,
25112563
NL80211_ATTR_SCHED_SCAN_MAX_REQS,
25122564

2565+
NL80211_ATTR_WANT_1X_4WAY_HS,
2566+
NL80211_ATTR_PMKR0_NAME,
2567+
NL80211_ATTR_PORT_AUTHORIZED,
2568+
25132569
/* add attributes here, update the policy in nl80211.c */
25142570

25152571
__NL80211_ATTR_AFTER_LAST,
@@ -4852,6 +4908,13 @@ enum nl80211_feature_flags {
48524908
* RSSI threshold values to monitor rather than exactly one threshold.
48534909
* @NL80211_EXT_FEATURE_FILS_SK_OFFLOAD: Driver SME supports FILS shared key
48544910
* authentication with %NL80211_CMD_CONNECT.
4911+
* @NL80211_EXT_FEATURE_4WAY_HANDSHAKE_STA_PSK: Device wants to do 4-way
4912+
* handshake with PSK in station mode (PSK is passed as part of the connect
4913+
* and associate commands), doing it in the host might not be supported.
4914+
* @NL80211_EXT_FEATURE_4WAY_HANDSHAKE_STA_1X: Device wants to do doing 4-way
4915+
* handshake with 802.1X in station mode (will pass EAP frames to the host
4916+
* and accept the set_pmk/del_pmk commands), doing it in the host might not
4917+
* be supported.
48554918
*
48564919
* @NUM_NL80211_EXT_FEATURES: number of extended features.
48574920
* @MAX_NL80211_EXT_FEATURES: highest extended feature index.
@@ -4872,6 +4935,8 @@ enum nl80211_ext_feature_index {
48724935
NL80211_EXT_FEATURE_SCHED_SCAN_RELATIVE_RSSI,
48734936
NL80211_EXT_FEATURE_CQM_RSSI_LIST,
48744937
NL80211_EXT_FEATURE_FILS_SK_OFFLOAD,
4938+
NL80211_EXT_FEATURE_4WAY_HANDSHAKE_STA_PSK,
4939+
NL80211_EXT_FEATURE_4WAY_HANDSHAKE_STA_1X,
48754940

48764941
/* add new features before the definition below */
48774942
NUM_NL80211_EXT_FEATURES,

0 commit comments

Comments
 (0)