cfg.c (c88f1542ee72872a276115c868f580a391f04a7b) | cfg.c (e7a7b84e33178db4a839c5e1773247be17597c1f) |
---|---|
1// SPDX-License-Identifier: GPL-2.0-only 2/* 3 * mac80211 configuration hooks for cfg80211 4 * 5 * Copyright 2006-2010 Johannes Berg <johannes@sipsolutions.net> 6 * Copyright 2013-2015 Intel Mobile Communications GmbH 7 * Copyright (C) 2015-2017 Intel Deutschland GmbH 8 * Copyright (C) 2018-2022 Intel Corporation --- 438 unchanged lines hidden (view full) --- 447 if (key && key->conf.flags & IEEE80211_KEY_FLAG_NO_AUTO_TX) 448 ret = ieee80211_set_tx_key(key); 449 450 mutex_unlock(&local->key_mtx); 451 return ret; 452} 453 454static int ieee80211_add_key(struct wiphy *wiphy, struct net_device *dev, | 1// SPDX-License-Identifier: GPL-2.0-only 2/* 3 * mac80211 configuration hooks for cfg80211 4 * 5 * Copyright 2006-2010 Johannes Berg <johannes@sipsolutions.net> 6 * Copyright 2013-2015 Intel Mobile Communications GmbH 7 * Copyright (C) 2015-2017 Intel Deutschland GmbH 8 * Copyright (C) 2018-2022 Intel Corporation --- 438 unchanged lines hidden (view full) --- 447 if (key && key->conf.flags & IEEE80211_KEY_FLAG_NO_AUTO_TX) 448 ret = ieee80211_set_tx_key(key); 449 450 mutex_unlock(&local->key_mtx); 451 return ret; 452} 453 454static int ieee80211_add_key(struct wiphy *wiphy, struct net_device *dev, |
455 u8 key_idx, bool pairwise, const u8 *mac_addr, 456 struct key_params *params) | 455 int link_id, u8 key_idx, bool pairwise, 456 const u8 *mac_addr, struct key_params *params) |
457{ 458 struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev); 459 struct ieee80211_local *local = sdata->local; 460 struct sta_info *sta = NULL; 461 struct ieee80211_key *key; 462 int err; 463 464 if (!ieee80211_sdata_running(sdata)) --- 126 unchanged lines hidden (view full) --- 591 /* or maybe it was a WEP key */ 592 if (key_idx < NUM_DEFAULT_KEYS) 593 return rcu_dereference_check_key_mtx(local, sdata->keys[key_idx]); 594 595 return NULL; 596} 597 598static int ieee80211_del_key(struct wiphy *wiphy, struct net_device *dev, | 457{ 458 struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev); 459 struct ieee80211_local *local = sdata->local; 460 struct sta_info *sta = NULL; 461 struct ieee80211_key *key; 462 int err; 463 464 if (!ieee80211_sdata_running(sdata)) --- 126 unchanged lines hidden (view full) --- 591 /* or maybe it was a WEP key */ 592 if (key_idx < NUM_DEFAULT_KEYS) 593 return rcu_dereference_check_key_mtx(local, sdata->keys[key_idx]); 594 595 return NULL; 596} 597 598static int ieee80211_del_key(struct wiphy *wiphy, struct net_device *dev, |
599 u8 key_idx, bool pairwise, const u8 *mac_addr) | 599 int link_id, u8 key_idx, bool pairwise, 600 const u8 *mac_addr) |
600{ 601 struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev); 602 struct ieee80211_local *local = sdata->local; 603 struct ieee80211_key *key; 604 int ret; 605 606 mutex_lock(&local->sta_mtx); 607 mutex_lock(&local->key_mtx); --- 10 unchanged lines hidden (view full) --- 618 out_unlock: 619 mutex_unlock(&local->key_mtx); 620 mutex_unlock(&local->sta_mtx); 621 622 return ret; 623} 624 625static int ieee80211_get_key(struct wiphy *wiphy, struct net_device *dev, | 601{ 602 struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev); 603 struct ieee80211_local *local = sdata->local; 604 struct ieee80211_key *key; 605 int ret; 606 607 mutex_lock(&local->sta_mtx); 608 mutex_lock(&local->key_mtx); --- 10 unchanged lines hidden (view full) --- 619 out_unlock: 620 mutex_unlock(&local->key_mtx); 621 mutex_unlock(&local->sta_mtx); 622 623 return ret; 624} 625 626static int ieee80211_get_key(struct wiphy *wiphy, struct net_device *dev, |
626 u8 key_idx, bool pairwise, const u8 *mac_addr, 627 void *cookie, | 627 int link_id, u8 key_idx, bool pairwise, 628 const u8 *mac_addr, void *cookie, |
628 void (*callback)(void *cookie, 629 struct key_params *params)) 630{ 631 struct ieee80211_sub_if_data *sdata; 632 u8 seq[6] = {0}; 633 struct key_params params; 634 struct ieee80211_key *key; 635 u64 pn64; --- 88 unchanged lines hidden (view full) --- 724 725 out: 726 rcu_read_unlock(); 727 return err; 728} 729 730static int ieee80211_config_default_key(struct wiphy *wiphy, 731 struct net_device *dev, | 629 void (*callback)(void *cookie, 630 struct key_params *params)) 631{ 632 struct ieee80211_sub_if_data *sdata; 633 u8 seq[6] = {0}; 634 struct key_params params; 635 struct ieee80211_key *key; 636 u64 pn64; --- 88 unchanged lines hidden (view full) --- 725 726 out: 727 rcu_read_unlock(); 728 return err; 729} 730 731static int ieee80211_config_default_key(struct wiphy *wiphy, 732 struct net_device *dev, |
732 u8 key_idx, bool uni, | 733 int link_id, u8 key_idx, bool uni, |
733 bool multi) 734{ 735 struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev); 736 737 ieee80211_set_default_key(sdata, key_idx, uni, multi); 738 739 return 0; 740} 741 742static int ieee80211_config_default_mgmt_key(struct wiphy *wiphy, 743 struct net_device *dev, | 734 bool multi) 735{ 736 struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev); 737 738 ieee80211_set_default_key(sdata, key_idx, uni, multi); 739 740 return 0; 741} 742 743static int ieee80211_config_default_mgmt_key(struct wiphy *wiphy, 744 struct net_device *dev, |
744 u8 key_idx) | 745 int link_id, u8 key_idx) |
745{ 746 struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev); 747 748 ieee80211_set_default_mgmt_key(sdata, key_idx); 749 750 return 0; 751} 752 753static int ieee80211_config_default_beacon_key(struct wiphy *wiphy, 754 struct net_device *dev, | 746{ 747 struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev); 748 749 ieee80211_set_default_mgmt_key(sdata, key_idx); 750 751 return 0; 752} 753 754static int ieee80211_config_default_beacon_key(struct wiphy *wiphy, 755 struct net_device *dev, |
755 u8 key_idx) | 756 int link_id, u8 key_idx) |
756{ 757 struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev); 758 759 ieee80211_set_default_beacon_key(sdata, key_idx); 760 761 return 0; 762} 763 --- 4124 unchanged lines hidden --- | 757{ 758 struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev); 759 760 ieee80211_set_default_beacon_key(sdata, key_idx); 761 762 return 0; 763} 764 --- 4124 unchanged lines hidden --- |