Release 4.11 net/mac80211/cfg.c
/*
* mac80211 configuration hooks for cfg80211
*
* Copyright 2006-2010 Johannes Berg <johannes@sipsolutions.net>
* Copyright 2013-2015 Intel Mobile Communications GmbH
* Copyright (C) 2015-2016 Intel Deutschland GmbH
*
* This file is GPLv2 as found in COPYING.
*/
#include <linux/ieee80211.h>
#include <linux/nl80211.h>
#include <linux/rtnetlink.h>
#include <linux/slab.h>
#include <net/net_namespace.h>
#include <linux/rcupdate.h>
#include <linux/if_ether.h>
#include <net/cfg80211.h>
#include "ieee80211_i.h"
#include "driver-ops.h"
#include "rate.h"
#include "mesh.h"
#include "wme.h"
static struct wireless_dev *ieee80211_add_iface(struct wiphy *wiphy,
const char *name,
unsigned char name_assign_type,
enum nl80211_iftype type,
u32 *flags,
struct vif_params *params)
{
struct ieee80211_local *local = wiphy_priv(wiphy);
struct wireless_dev *wdev;
struct ieee80211_sub_if_data *sdata;
int err;
err = ieee80211_if_add(local, name, name_assign_type, &wdev, type, params);
if (err)
return ERR_PTR(err);
if (type == NL80211_IFTYPE_MONITOR && flags) {
sdata = IEEE80211_WDEV_TO_SUB_IF(wdev);
sdata->u.mntr.flags = *flags;
}
return wdev;
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Michael Wu | 40 | 34.19% | 2 | 16.67% |
Jiri Benc | 35 | 29.91% | 1 | 8.33% |
Johannes Berg | 26 | 22.22% | 5 | 41.67% |
Luis Carlos Cobo Rus | 7 | 5.98% | 2 | 16.67% |
Tom Gundersen | 6 | 5.13% | 1 | 8.33% |
Aviya Erenfeld | 3 | 2.56% | 1 | 8.33% |
Total | 117 | 100.00% | 12 | 100.00% |
static int ieee80211_del_iface(struct wiphy *wiphy, struct wireless_dev *wdev)
{
ieee80211_if_remove(IEEE80211_WDEV_TO_SUB_IF(wdev));
return 0;
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Jiri Benc | 16 | 59.26% | 1 | 20.00% |
Johannes Berg | 9 | 33.33% | 3 | 60.00% |
Jasper Bryant-Greene | 2 | 7.41% | 1 | 20.00% |
Total | 27 | 100.00% | 5 | 100.00% |
static int ieee80211_change_iface(struct wiphy *wiphy,
struct net_device *dev,
enum nl80211_iftype type, u32 *flags,
struct vif_params *params)
{
struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev);
int ret;
ret = ieee80211_if_change_type(sdata, type);
if (ret)
return ret;
if (type == NL80211_IFTYPE_AP_VLAN &&
params && params->use_4addr == 0) {
RCU_INIT_POINTER(sdata->u.vlan.sta, NULL);
ieee80211_check_fast_rx_iface(sdata);
} else if (type == NL80211_IFTYPE_STATION &&
params && params->use_4addr >= 0) {
sdata->u.mgd.use_4addr = params->use_4addr;
}
if (sdata->vif.type == NL80211_IFTYPE_MONITOR) {
struct ieee80211_local *local = sdata->local;
struct ieee80211_sub_if_data *monitor_sdata;
u32 mu_mntr_cap_flag = NL80211_EXT_FEATURE_MU_MIMO_AIR_SNIFFER;
monitor_sdata = rtnl_dereference(local->monitor_sdata);
if (monitor_sdata &&
wiphy_ext_feature_isset(wiphy, mu_mntr_cap_flag)) {
memcpy(monitor_sdata->vif.bss_conf.mu_group.membership,
params->vht_mumimo_groups, WLAN_MEMBERSHIP_LEN);
memcpy(monitor_sdata->vif.bss_conf.mu_group.position,
params->vht_mumimo_groups + WLAN_MEMBERSHIP_LEN,
WLAN_USER_POSITION_LEN);
monitor_sdata->vif.mu_mimo_owner = true;
ieee80211_bss_info_change_notify(monitor_sdata,
BSS_CHANGED_MU_GROUPS);
ether_addr_copy(monitor_sdata->u.mntr.mu_follow_addr,
params->macaddr);
}
if (!flags)
return 0;
if (ieee80211_sdata_running(sdata)) {
u32 mask = MONITOR_FLAG_COOK_FRAMES |
MONITOR_FLAG_ACTIVE;
/*
* Prohibit MONITOR_FLAG_COOK_FRAMES and
* MONITOR_FLAG_ACTIVE to be changed while the
* interface is up.
* Else we would need to add a lot of cruft
* to update everything:
* cooked_mntrs, monitor and all fif_* counters
* reconfigure hardware
*/
if ((*flags & mask) != (sdata->u.mntr.flags & mask))
return -EBUSY;
ieee80211_adjust_monitor_flags(sdata, -1);
sdata->u.mntr.flags = *flags;
ieee80211_adjust_monitor_flags(sdata, 1);
ieee80211_configure_filter(local);
} else {
/*
* Because the interface is down, ieee80211_do_stop
* and ieee80211_do_open take care of "everything"
* mentioned in the comment above.
*/
sdata->u.mntr.flags = *flags;
}
}
return 0;
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Aviya Erenfeld | 119 | 34.69% | 2 | 11.11% |
Johannes Berg | 112 | 32.65% | 8 | 44.44% |
Christian Lamparter | 72 | 20.99% | 1 | 5.56% |
Felix Fietkau | 20 | 5.83% | 2 | 11.11% |
Michael Wu | 12 | 3.50% | 2 | 11.11% |
Luis Carlos Cobo Rus | 7 | 2.04% | 2 | 11.11% |
Stephen Hemminger | 1 | 0.29% | 1 | 5.56% |
Total | 343 | 100.00% | 18 | 100.00% |
static int ieee80211_start_p2p_device(struct wiphy *wiphy,
struct wireless_dev *wdev)
{
struct ieee80211_sub_if_data *sdata = IEEE80211_WDEV_TO_SUB_IF(wdev);
int ret;
mutex_lock(&sdata->local->chanctx_mtx);
ret = ieee80211_check_combinations(sdata, NULL, 0, 0);
mutex_unlock(&sdata->local->chanctx_mtx);
if (ret < 0)
return ret;
return ieee80211_do_open(wdev, true);
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Luciano Coelho | 55 | 69.62% | 1 | 50.00% |
Johannes Berg | 24 | 30.38% | 1 | 50.00% |
Total | 79 | 100.00% | 2 | 100.00% |
static void ieee80211_stop_p2p_device(struct wiphy *wiphy,
struct wireless_dev *wdev)
{
ieee80211_sdata_stop(IEEE80211_WDEV_TO_SUB_IF(wdev));
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Johannes Berg | 24 | 100.00% | 1 | 100.00% |
Total | 24 | 100.00% | 1 | 100.00% |
static int ieee80211_start_nan(struct wiphy *wiphy,
struct wireless_dev *wdev,
struct cfg80211_nan_conf *conf)
{
struct ieee80211_sub_if_data *sdata = IEEE80211_WDEV_TO_SUB_IF(wdev);
int ret;
mutex_lock(&sdata->local->chanctx_mtx);
ret = ieee80211_check_combinations(sdata, NULL, 0, 0);
mutex_unlock(&sdata->local->chanctx_mtx);
if (ret < 0)
return ret;
ret = ieee80211_do_open(wdev, true);
if (ret)
return ret;
ret = drv_start_nan(sdata->local, sdata, conf);
if (ret)
ieee80211_sdata_stop(sdata);
sdata->u.nan.conf = *conf;
return ret;
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Ayala Beker | 128 | 100.00% | 2 | 100.00% |
Total | 128 | 100.00% | 2 | 100.00% |
static void ieee80211_stop_nan(struct wiphy *wiphy,
struct wireless_dev *wdev)
{
struct ieee80211_sub_if_data *sdata = IEEE80211_WDEV_TO_SUB_IF(wdev);
drv_stop_nan(sdata->local, sdata);
ieee80211_sdata_stop(sdata);
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Ayala Beker | 40 | 100.00% | 1 | 100.00% |
Total | 40 | 100.00% | 1 | 100.00% |
static int ieee80211_nan_change_conf(struct wiphy *wiphy,
struct wireless_dev *wdev,
struct cfg80211_nan_conf *conf,
u32 changes)
{
struct ieee80211_sub_if_data *sdata = IEEE80211_WDEV_TO_SUB_IF(wdev);
struct cfg80211_nan_conf new_conf;
int ret = 0;
if (sdata->vif.type != NL80211_IFTYPE_NAN)
return -EOPNOTSUPP;
if (!ieee80211_sdata_running(sdata))
return -ENETDOWN;
new_conf = sdata->u.nan.conf;
if (changes & CFG80211_NAN_CONF_CHANGED_PREF)
new_conf.master_pref = conf->master_pref;
if (changes & CFG80211_NAN_CONF_CHANGED_BANDS)
new_conf.bands = conf->bands;
ret = drv_nan_change_conf(sdata->local, sdata, &new_conf, changes);
if (!ret)
sdata->u.nan.conf = new_conf;
return ret;
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Ayala Beker | 138 | 97.87% | 1 | 50.00% |
Luciano Coelho | 3 | 2.13% | 1 | 50.00% |
Total | 141 | 100.00% | 2 | 100.00% |
static int ieee80211_add_nan_func(struct wiphy *wiphy,
struct wireless_dev *wdev,
struct cfg80211_nan_func *nan_func)
{
struct ieee80211_sub_if_data *sdata = IEEE80211_WDEV_TO_SUB_IF(wdev);
int ret;
if (sdata->vif.type != NL80211_IFTYPE_NAN)
return -EOPNOTSUPP;
if (!ieee80211_sdata_running(sdata))
return -ENETDOWN;
spin_lock_bh(&sdata->u.nan.func_lock);
ret = idr_alloc(&sdata->u.nan.function_inst_ids,
nan_func, 1, sdata->local->hw.max_nan_de_entries + 1,
GFP_ATOMIC);
spin_unlock_bh(&sdata->u.nan.func_lock);
if (ret < 0)
return ret;
nan_func->instance_id = ret;
WARN_ON(nan_func->instance_id == 0);
ret = drv_add_nan_func(sdata->local, sdata, nan_func);
if (ret) {
spin_lock_bh(&sdata->u.nan.func_lock);
idr_remove(&sdata->u.nan.function_inst_ids,
nan_func->instance_id);
spin_unlock_bh(&sdata->u.nan.func_lock);
}
return ret;
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Ayala Beker | 200 | 100.00% | 1 | 100.00% |
Total | 200 | 100.00% | 1 | 100.00% |
static struct cfg80211_nan_func *
ieee80211_find_nan_func_by_cookie(struct ieee80211_sub_if_data *sdata,
u64 cookie)
{
struct cfg80211_nan_func *func;
int id;
lockdep_assert_held(&sdata->u.nan.func_lock);
idr_for_each_entry(&sdata->u.nan.function_inst_ids, func, id) {
if (func->cookie == cookie)
return func;
}
return NULL;
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Ayala Beker | 60 | 100.00% | 1 | 100.00% |
Total | 60 | 100.00% | 1 | 100.00% |
static void ieee80211_del_nan_func(struct wiphy *wiphy,
struct wireless_dev *wdev, u64 cookie)
{
struct ieee80211_sub_if_data *sdata = IEEE80211_WDEV_TO_SUB_IF(wdev);
struct cfg80211_nan_func *func;
u8 instance_id = 0;
if (sdata->vif.type != NL80211_IFTYPE_NAN ||
!ieee80211_sdata_running(sdata))
return;
spin_lock_bh(&sdata->u.nan.func_lock);
func = ieee80211_find_nan_func_by_cookie(sdata, cookie);
if (func)
instance_id = func->instance_id;
spin_unlock_bh(&sdata->u.nan.func_lock);
if (instance_id)
drv_del_nan_func(sdata->local, sdata, instance_id);
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Ayala Beker | 114 | 100.00% | 1 | 100.00% |
Total | 114 | 100.00% | 1 | 100.00% |
static int ieee80211_set_noack_map(struct wiphy *wiphy,
struct net_device *dev,
u16 noack_map)
{
struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev);
sdata->noack_map = noack_map;
ieee80211_check_fast_xmit_iface(sdata);
return 0;
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Simon Wunderlich | 38 | 88.37% | 1 | 50.00% |
Johannes Berg | 5 | 11.63% | 1 | 50.00% |
Total | 43 | 100.00% | 2 | 100.00% |
static int ieee80211_add_key(struct wiphy *wiphy, struct net_device *dev,
u8 key_idx, bool pairwise, const u8 *mac_addr,
struct key_params *params)
{
struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev);
struct ieee80211_local *local = sdata->local;
struct sta_info *sta = NULL;
const struct ieee80211_cipher_scheme *cs = NULL;
struct ieee80211_key *key;
int err;
if (!ieee80211_sdata_running(sdata))
return -ENETDOWN;
/* reject WEP and TKIP keys if WEP failed to initialize */
switch (params->cipher) {
case WLAN_CIPHER_SUITE_WEP40:
case WLAN_CIPHER_SUITE_TKIP:
case WLAN_CIPHER_SUITE_WEP104:
if (IS_ERR(local->wep_tx_tfm))
return -EINVAL;
break;
case WLAN_CIPHER_SUITE_CCMP:
case WLAN_CIPHER_SUITE_CCMP_256:
case WLAN_CIPHER_SUITE_AES_CMAC:
case WLAN_CIPHER_SUITE_BIP_CMAC_256:
case WLAN_CIPHER_SUITE_BIP_GMAC_128:
case WLAN_CIPHER_SUITE_BIP_GMAC_256:
case WLAN_CIPHER_SUITE_GCMP:
case WLAN_CIPHER_SUITE_GCMP_256:
break;
default:
cs = ieee80211_cs_get(local, params->cipher, sdata->vif.type);
break;
}
key = ieee80211_key_alloc(params->cipher, key_idx, params->key_len,
params->key, params->seq_len, params->seq,
cs);
if (IS_ERR(key))
return PTR_ERR(key);
if (pairwise)
key->conf.flags |= IEEE80211_KEY_FLAG_PAIRWISE;
mutex_lock(&local->sta_mtx);
if (mac_addr) {
sta = sta_info_get_bss(sdata, mac_addr);
/*
* The ASSOC test makes sure the driver is ready to
* receive the key. When wpa_supplicant has roamed
* using FT, it attempts to set the key before
* association has completed, this rejects that attempt
* so it will set the key again after association.
*
* TODO: accept the key if we have a station entry and
* add it to the device after the station.
*/
if (!sta || !test_sta_flag(sta, WLAN_STA_ASSOC)) {
ieee80211_key_free_unused(key);
err = -ENOENT;
goto out_unlock;
}
}
switch (sdata->vif.type) {
case NL80211_IFTYPE_STATION:
if (sdata->u.mgd.mfp != IEEE80211_MFP_DISABLED)
key->conf.flags |= IEEE80211_KEY_FLAG_RX_MGMT;
break;
case NL80211_IFTYPE_AP:
case NL80211_IFTYPE_AP_VLAN:
/* Keys without a station are used for TX only */
if (key->sta && test_sta_flag(key->sta, WLAN_STA_MFP))
key->conf.flags |= IEEE80211_KEY_FLAG_RX_MGMT;
break;
case NL80211_IFTYPE_ADHOC:
/* no MFP (yet) */
break;
case NL80211_IFTYPE_MESH_POINT:
#ifdef CONFIG_MAC80211_MESH
if (sdata->u.mesh.security != IEEE80211_MESH_SEC_NONE)
key->conf.flags |= IEEE80211_KEY_FLAG_RX_MGMT;
break;
#endif
case NL80211_IFTYPE_WDS:
case NL80211_IFTYPE_MONITOR:
case NL80211_IFTYPE_P2P_DEVICE:
case NL80211_IFTYPE_NAN:
case NL80211_IFTYPE_UNSPECIFIED:
case NUM_NL80211_IFTYPES:
case NL80211_IFTYPE_P2P_CLIENT:
case NL80211_IFTYPE_P2P_GO:
case NL80211_IFTYPE_OCB:
/* shouldn't happen */
WARN_ON_ONCE(1);
break;
}
if (sta)
sta->cipher_scheme = cs;
err = ieee80211_key_link(key, sdata, sta);
out_unlock:
mutex_unlock(&local->sta_mtx);
return err;
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Johannes Berg | 327 | 75.17% | 12 | 48.00% |
Max Stepanov | 56 | 12.87% | 1 | 4.00% |
Jouni Malinen | 24 | 5.52% | 6 | 24.00% |
John W. Linville | 13 | 2.99% | 1 | 4.00% |
Ben Hutchings | 7 | 1.61% | 1 | 4.00% |
Ayala Beker | 3 | 0.69% | 1 | 4.00% |
Rostislav Lisovy | 3 | 0.69% | 1 | 4.00% |
Felix Fietkau | 1 | 0.23% | 1 | 4.00% |
Stephen Hemminger | 1 | 0.23% | 1 | 4.00% |
Total | 435 | 100.00% | 25 | 100.00% |
static int ieee80211_del_key(struct wiphy *wiphy, struct net_device *dev,
u8 key_idx, bool pairwise, const u8 *mac_addr)
{
struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev);
struct ieee80211_local *local = sdata->local;
struct sta_info *sta;
struct ieee80211_key *key = NULL;
int ret;
mutex_lock(&local->sta_mtx);
mutex_lock(&local->key_mtx);
if (mac_addr) {
ret = -ENOENT;
sta = sta_info_get_bss(sdata, mac_addr);
if (!sta)
goto out_unlock;
if (pairwise)
key = key_mtx_dereference(local, sta->ptk[key_idx]);
else
key = key_mtx_dereference(local, sta->gtk[key_idx]);
} else
key = key_mtx_dereference(local, sdata->keys[key_idx]);
if (!key) {
ret = -ENOENT;
goto out_unlock;
}
ieee80211_key_free(key, true);
ret = 0;
out_unlock:
mutex_unlock(&local->key_mtx);
mutex_unlock(&local->sta_mtx);
return ret;
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Johannes Berg | 196 | 98.00% | 11 | 84.62% |
Max Stepanov | 3 | 1.50% | 1 | 7.69% |
Felix Fietkau | 1 | 0.50% | 1 | 7.69% |
Total | 200 | 100.00% | 13 | 100.00% |
static int ieee80211_get_key(struct wiphy *wiphy, struct net_device *dev,
u8 key_idx, bool pairwise, const u8 *mac_addr,
void *cookie,
void (*callback)(void *cookie,
struct key_params *params))
{
struct ieee80211_sub_if_data *sdata;
struct sta_info *sta = NULL;
u8 seq[6] = {0};
struct key_params params;
struct ieee80211_key *key = NULL;
u64 pn64;
u32 iv32;
u16 iv16;
int err = -ENOENT;
struct ieee80211_key_seq kseq = {};
sdata = IEEE80211_DEV_TO_SUB_IF(dev);
rcu_read_lock();
if (mac_addr) {
sta = sta_info_get_bss(sdata, mac_addr);
if (!sta)
goto out;
if (pairwise && key_idx < NUM_DEFAULT_KEYS)
key = rcu_dereference(sta->ptk[key_idx]);
else if (!pairwise &&
key_idx < NUM_DEFAULT_KEYS + NUM_DEFAULT_MGMT_KEYS)
key = rcu_dereference(sta->gtk[key_idx]);
} else
key = rcu_dereference(sdata->keys[key_idx]);
if (!key)
goto out;
memset(¶ms, 0, sizeof(params));
params.cipher = key->conf.cipher;
switch (key->conf.cipher) {
case WLAN_CIPHER_SUITE_TKIP:
pn64 = atomic64_read(&key->conf.tx_pn);
iv32 = TKIP_PN_TO_IV32(pn64);
iv16 = TKIP_PN_TO_IV16(pn64);
if (key->flags & KEY_FLAG_UPLOADED_TO_HARDWARE &&
!(key->conf.flags & IEEE80211_KEY_FLAG_GENERATE_IV)) {
drv_get_key_seq(sdata->local, key, &kseq);
iv32 = kseq.tkip.iv32;
iv16 = kseq.tkip.iv16;
}
seq[0] = iv16 & 0xff;
seq[1] = (iv16 >> 8) & 0xff;
seq[2] = iv32 & 0xff;
seq[3] = (iv32 >> 8) & 0xff;
seq[4] = (iv32 >> 16) & 0xff;
seq[5] = (iv32 >> 24) & 0xff;
params.seq = seq;
params.seq_len = 6;
break;
case WLAN_CIPHER_SUITE_CCMP:
case WLAN_CIPHER_SUITE_CCMP_256:
case WLAN_CIPHER_SUITE_AES_CMAC:
case WLAN_CIPHER_SUITE_BIP_CMAC_256:
BUILD_BUG_ON(offsetof(typeof(kseq), ccmp) !=
offsetof(typeof(kseq), aes_cmac));
case WLAN_CIPHER_SUITE_BIP_GMAC_128:
case WLAN_CIPHER_SUITE_BIP_GMAC_256:
BUILD_BUG_ON(offsetof(typeof(kseq), ccmp) !=
offsetof(typeof(kseq), aes_gmac));
case WLAN_CIPHER_SUITE_GCMP:
case WLAN_CIPHER_SUITE_GCMP_256:
BUILD_BUG_ON(offsetof(typeof(kseq), ccmp) !=
offsetof(typeof(kseq), gcmp));
if (key->flags & KEY_FLAG_UPLOADED_TO_HARDWARE &&
!(key->conf.flags & IEEE80211_KEY_FLAG_GENERATE_IV)) {
drv_get_key_seq(sdata->local, key, &kseq);
memcpy(seq, kseq.ccmp.pn, 6);
} else {
pn64 = atomic64_read(&key->conf.tx_pn);
seq[0] = pn64;
seq[1] = pn64 >> 8;
seq[2] = pn64 >> 16;
seq[3] = pn64 >> 24;
seq[4] = pn64 >> 32;
seq[5] = pn64 >> 40;
}
params.seq = seq;
params.seq_len = 6;
break;
default:
if (!(key->flags & KEY_FLAG_UPLOADED_TO_HARDWARE))
break;
if (WARN_ON(key->conf.flags & IEEE80211_KEY_FLAG_GENERATE_IV))
break;
drv_get_key_seq(sdata->local, key, &kseq);
params.seq = kseq.hw.seq;
params.seq_len = kseq.hw.seq_len;
break;
}
params.key = key->conf.key;
params.key_len = key->conf.keylen;
callback(cookie, ¶ms);
err = 0;
out:
rcu_read_unlock();
return err;
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Johannes Berg | 581 | 81.60% | 12 | 52.17% |
Jouni Malinen | 100 | 14.04% | 5 | 21.74% |
Eliad Peller | 17 | 2.39% | 1 | 4.35% |
Max Stepanov | 12 | 1.69% | 3 | 13.04% |
Harvey Harrison | 1 | 0.14% | 1 | 4.35% |
Felix Fietkau | 1 | 0.14% | 1 | 4.35% |
Total | 712 | 100.00% | 23 | 100.00% |
static int ieee80211_config_default_key(struct wiphy *wiphy,
struct net_device *dev,
u8 key_idx, bool uni,
bool multi)
{
struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev);
ieee80211_set_default_key(sdata, key_idx, uni, multi);
return 0;
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Johannes Berg | 49 | 100.00% | 4 | 100.00% |
Total | 49 | 100.00% | 4 | 100.00% |
static int ieee80211_config_default_mgmt_key(struct wiphy *wiphy,
struct net_device *dev,
u8 key_idx)
{
struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev);
ieee80211_set_default_mgmt_key(sdata, key_idx);
return 0;
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Jouni Malinen | 37 | 94.87% | 1 | 50.00% |
Johannes Berg | 2 | 5.13% | 1 | 50.00% |
Total | 39 | 100.00% | 2 | 100.00% |
void sta_set_rate_info_tx(struct sta_info *sta,
const struct ieee80211_tx_rate *rate,
struct rate_info *rinfo)
{
rinfo->flags = 0;
if (rate->flags & IEEE80211_TX_RC_MCS) {
rinfo->flags |= RATE_INFO_FLAGS_MCS;
rinfo->mcs = rate->idx;
} else if (rate->flags & IEEE80211_TX_RC_VHT_MCS) {
rinfo->flags |= RATE_INFO_FLAGS_VHT_MCS;
rinfo->mcs = ieee80211_rate_get_vht_mcs(rate);
rinfo->nss = ieee80211_rate_get_vht_nss(rate);
} else {
struct ieee80211_supported_band *sband;
int shift = ieee80211_vif_get_shift(&sta->sdata->vif);
u16 brate;
sband = sta->local->hw.wiphy->bands[
ieee80211_get_sdata_band(sta->sdata)];
brate = sband->bitrates[rate->idx].bitrate;
rinfo->legacy = DIV_ROUND_UP(brate, 1 << shift);
}
if (rate->flags & IEEE80211_TX_RC_40_MHZ_WIDTH)
rinfo->bw = RATE_INFO_BW_40;
else if (rate->flags & IEEE80211_TX_RC_80_MHZ_WIDTH)
rinfo->bw = RATE_INFO_BW_80;
else if (rate->flags & IEEE80211_TX_RC_160_MHZ_WIDTH)
rinfo->bw = RATE_INFO_BW_160;
else
rinfo->bw = RATE_INFO_BW_20;
if (rate->flags & IEEE80211_TX_RC_SHORT_GI)
rinfo->flags |= RATE_INFO_FLAGS_SHORT_GI;
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Johannes Berg | 102 | 46.15% | 4 | 57.14% |
Felix Fietkau | 51 | 23.08% | 1 | 14.29% |
Thomas Pedersen | 38 | 17.19% | 1 | 14.29% |
Simon Wunderlich | 30 | 13.57% | 1 | 14.29% |
Total | 221 | 100.00% | 7 | 100.00% |
static int ieee80211_dump_station(struct wiphy *wiphy, struct net_device *dev