aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2011-07-05 10:35:40 -0400
committerJohn W. Linville <linville@tuxdriver.com>2011-07-06 15:05:42 -0400
commite5497d766adb92bcbd1fa4a147e188f84f34b20a (patch)
treef5d41f4272b78b8c61a80c22389f6d4b24e65b34 /include
parent830af02f24fbc087999b757b8eca51829c67fa6f (diff)
cfg80211/nl80211: support GTK rekey offload
In certain circumstances, like WoWLAN scenarios, devices may implement (partial) GTK rekeying on the device to avoid waking up the host for it. In order to successfully go through GTK rekeying, the KEK, KCK and the replay counter are required. Add API to let the supplicant hand the parameters to the driver which may store it for future GTK rekey operations. Note that, of course, if GTK rekeying is done by the device, the EAP frame must not be passed up to userspace, instead a rekey event needs to be sent to let userspace update its replay counter. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'include')
-rw-r--r--include/linux/nl80211.h39
-rw-r--r--include/net/cfg80211.h26
2 files changed, 65 insertions, 0 deletions
diff --git a/include/linux/nl80211.h b/include/linux/nl80211.h
index c7ccaae15af6..3ec2f949bf7a 100644
--- a/include/linux/nl80211.h
+++ b/include/linux/nl80211.h
@@ -483,6 +483,14 @@
483 * more background information, see 483 * more background information, see
484 * http://wireless.kernel.org/en/users/Documentation/WoWLAN. 484 * http://wireless.kernel.org/en/users/Documentation/WoWLAN.
485 * 485 *
486 * @NL80211_CMD_SET_REKEY_OFFLOAD: This command is used give the driver
487 * the necessary information for supporting GTK rekey offload. This
488 * feature is typically used during WoWLAN. The configuration data
489 * is contained in %NL80211_ATTR_REKEY_DATA (which is nested and
490 * contains the data in sub-attributes). After rekeying happened,
491 * this command may also be sent by the driver as an MLME event to
492 * inform userspace of the new replay counter.
493 *
486 * @NL80211_CMD_MAX: highest used command number 494 * @NL80211_CMD_MAX: highest used command number
487 * @__NL80211_CMD_AFTER_LAST: internal use 495 * @__NL80211_CMD_AFTER_LAST: internal use
488 */ 496 */
@@ -605,6 +613,8 @@ enum nl80211_commands {
605 NL80211_CMD_SCHED_SCAN_RESULTS, 613 NL80211_CMD_SCHED_SCAN_RESULTS,
606 NL80211_CMD_SCHED_SCAN_STOPPED, 614 NL80211_CMD_SCHED_SCAN_STOPPED,
607 615
616 NL80211_CMD_SET_REKEY_OFFLOAD,
617
608 /* add new commands above here */ 618 /* add new commands above here */
609 619
610 /* used to define NL80211_CMD_MAX below */ 620 /* used to define NL80211_CMD_MAX below */
@@ -996,6 +1006,9 @@ enum nl80211_commands {
996 * are managed in software: interfaces of these types aren't subject to 1006 * are managed in software: interfaces of these types aren't subject to
997 * any restrictions in their number or combinations. 1007 * any restrictions in their number or combinations.
998 * 1008 *
1009 * @%NL80211_ATTR_REKEY_DATA: nested attribute containing the information
1010 * necessary for GTK rekeying in the device, see &enum nl80211_rekey_data.
1011 *
999 * @NL80211_ATTR_MAX: highest attribute number currently defined 1012 * @NL80211_ATTR_MAX: highest attribute number currently defined
1000 * @__NL80211_ATTR_AFTER_LAST: internal use 1013 * @__NL80211_ATTR_AFTER_LAST: internal use
1001 */ 1014 */
@@ -1194,6 +1207,8 @@ enum nl80211_attrs {
1194 NL80211_ATTR_INTERFACE_COMBINATIONS, 1207 NL80211_ATTR_INTERFACE_COMBINATIONS,
1195 NL80211_ATTR_SOFTWARE_IFTYPES, 1208 NL80211_ATTR_SOFTWARE_IFTYPES,
1196 1209
1210 NL80211_ATTR_REKEY_DATA,
1211
1197 /* add attributes here, update the policy in nl80211.c */ 1212 /* add attributes here, update the policy in nl80211.c */
1198 1213
1199 __NL80211_ATTR_AFTER_LAST, 1214 __NL80211_ATTR_AFTER_LAST,
@@ -2361,4 +2376,28 @@ enum nl80211_plink_state {
2361 MAX_NL80211_PLINK_STATES = NUM_NL80211_PLINK_STATES - 1 2376 MAX_NL80211_PLINK_STATES = NUM_NL80211_PLINK_STATES - 1
2362}; 2377};
2363 2378
2379#define NL80211_KCK_LEN 16
2380#define NL80211_KEK_LEN 16
2381#define NL80211_REPLAY_CTR_LEN 8
2382
2383/**
2384 * enum nl80211_rekey_data - attributes for GTK rekey offload
2385 * @__NL80211_REKEY_DATA_INVALID: invalid number for nested attributes
2386 * @NL80211_REKEY_DATA_KEK: key encryption key (binary)
2387 * @NL80211_REKEY_DATA_KCK: key confirmation key (binary)
2388 * @NL80211_REKEY_DATA_REPLAY_CTR: replay counter (binary)
2389 * @NUM_NL80211_REKEY_DATA: number of rekey attributes (internal)
2390 * @MAX_NL80211_REKEY_DATA: highest rekey attribute (internal)
2391 */
2392enum nl80211_rekey_data {
2393 __NL80211_REKEY_DATA_INVALID,
2394 NL80211_REKEY_DATA_KEK,
2395 NL80211_REKEY_DATA_KCK,
2396 NL80211_REKEY_DATA_REPLAY_CTR,
2397
2398 /* keep last */
2399 NUM_NL80211_REKEY_DATA,
2400 MAX_NL80211_REKEY_DATA = NUM_NL80211_REKEY_DATA - 1
2401};
2402
2364#endif /* __LINUX_NL80211_H */ 2403#endif /* __LINUX_NL80211_H */
diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
index 7202bce7bfeb..4bf101bada4e 100644
--- a/include/net/cfg80211.h
+++ b/include/net/cfg80211.h
@@ -1154,6 +1154,18 @@ struct cfg80211_wowlan {
1154}; 1154};
1155 1155
1156/** 1156/**
1157 * struct cfg80211_gtk_rekey_data - rekey data
1158 * @kek: key encryption key
1159 * @kck: key confirmation key
1160 * @replay_ctr: replay counter
1161 */
1162struct cfg80211_gtk_rekey_data {
1163 u8 kek[NL80211_KEK_LEN];
1164 u8 kck[NL80211_KCK_LEN];
1165 u8 replay_ctr[NL80211_REPLAY_CTR_LEN];
1166};
1167
1168/**
1157 * struct cfg80211_ops - backend description for wireless configuration 1169 * struct cfg80211_ops - backend description for wireless configuration
1158 * 1170 *
1159 * This struct is registered by fullmac card drivers and/or wireless stacks 1171 * This struct is registered by fullmac card drivers and/or wireless stacks
@@ -1197,6 +1209,8 @@ struct cfg80211_wowlan {
1197 * 1209 *
1198 * @set_default_mgmt_key: set the default management frame key on an interface 1210 * @set_default_mgmt_key: set the default management frame key on an interface
1199 * 1211 *
1212 * @set_rekey_data: give the data necessary for GTK rekeying to the driver
1213 *
1200 * @add_beacon: Add a beacon with given parameters, @head, @interval 1214 * @add_beacon: Add a beacon with given parameters, @head, @interval
1201 * and @dtim_period will be valid, @tail is optional. 1215 * and @dtim_period will be valid, @tail is optional.
1202 * @set_beacon: Change the beacon parameters for an access point mode 1216 * @set_beacon: Change the beacon parameters for an access point mode
@@ -1499,6 +1513,9 @@ struct cfg80211_ops {
1499 struct net_device *dev, 1513 struct net_device *dev,
1500 struct cfg80211_sched_scan_request *request); 1514 struct cfg80211_sched_scan_request *request);
1501 int (*sched_scan_stop)(struct wiphy *wiphy, struct net_device *dev); 1515 int (*sched_scan_stop)(struct wiphy *wiphy, struct net_device *dev);
1516
1517 int (*set_rekey_data)(struct wiphy *wiphy, struct net_device *dev,
1518 struct cfg80211_gtk_rekey_data *data);
1502}; 1519};
1503 1520
1504/* 1521/*
@@ -3033,6 +3050,15 @@ void cfg80211_cqm_rssi_notify(struct net_device *dev,
3033void cfg80211_cqm_pktloss_notify(struct net_device *dev, 3050void cfg80211_cqm_pktloss_notify(struct net_device *dev,
3034 const u8 *peer, u32 num_packets, gfp_t gfp); 3051 const u8 *peer, u32 num_packets, gfp_t gfp);
3035 3052
3053/**
3054 * cfg80211_gtk_rekey_notify - notify userspace about driver rekeying
3055 * @dev: network device
3056 * @bssid: BSSID of AP (to avoid races)
3057 * @replay_ctr: new replay counter
3058 */
3059void cfg80211_gtk_rekey_notify(struct net_device *dev, const u8 *bssid,
3060 const u8 *replay_ctr, gfp_t gfp);
3061
3036/* Logging, debugging and troubleshooting/diagnostic helpers. */ 3062/* Logging, debugging and troubleshooting/diagnostic helpers. */
3037 3063
3038/* wiphy_printk helpers, similar to dev_printk */ 3064/* wiphy_printk helpers, similar to dev_printk */