wireless-drivers fixes for 4.17
A few fixes for 4.17 but nothing really special. The new ETSI WMM parameter support for iwlwifi is not technically a bugfix but important for regulatory compliance. iwlwifi * use new ETSI WMM parameters from regulatory database * fix a regression with the older firmware API 31 (eg. 31.560484.0) brcmfmac * fix a double free in nvmam loading fails rtlwifi * yet another fix for ant_sel module parameter -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQEcBAABAgAGBQJa4aIYAAoJEG4XJFUm622bOnMH/j7LR1jtny0B8MecnkIt82Ar uRl/dChzygAsPf2siR5bED5BJPMGuZTl9KWo/XsVP9GSZ5bQewXWmkF+7FXmgP98 MJcxnHDVqhIDzNk5BUtAYQSjpucoZVAy/ueVYwiB526XYjRGCf+15Ie9po/AkBPI Dd+uRhT0hKAJmnXFtSxtIpkN1E8oBHFiHVyi76HELO8y5eyTnUm4Wxxu0l6tl7D1 elaCK1uLaZm+s5CeyOuJwvYT/k7p5b0knLAyjWOAaTWbSyF02FjY7AIaKhjcJH2m rOoni7vEa8INQFyK77HOi+d06fWxgSprfZ8dLMxurV12NPFpGzcX7a3tYFpquFE= =lizT -----END PGP SIGNATURE----- Merge tag 'wireless-drivers-for-davem-2018-04-26' of git://git.kernel.org/pub/scm/linux/kernel/git/kvalo/wireless-drivers Kalle Valo says: ==================== wireless-drivers fixes for 4.17 A few fixes for 4.17 but nothing really special. The new ETSI WMM parameter support for iwlwifi is not technically a bugfix but important for regulatory compliance. iwlwifi * use new ETSI WMM parameters from regulatory database * fix a regression with the older firmware API 31 (eg. 31.560484.0) brcmfmac * fix a double free in nvmam loading fails rtlwifi * yet another fix for ant_sel module parameter ==================== Signed-off-by: David S. Miller <davem@davemloft.net>hifive-unleashed-5.1
commit
1da9a586a2
|
@ -459,7 +459,7 @@ static void brcmf_fw_free_request(struct brcmf_fw_request *req)
|
||||||
kfree(req);
|
kfree(req);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void brcmf_fw_request_nvram_done(const struct firmware *fw, void *ctx)
|
static int brcmf_fw_request_nvram_done(const struct firmware *fw, void *ctx)
|
||||||
{
|
{
|
||||||
struct brcmf_fw *fwctx = ctx;
|
struct brcmf_fw *fwctx = ctx;
|
||||||
struct brcmf_fw_item *cur;
|
struct brcmf_fw_item *cur;
|
||||||
|
@ -498,13 +498,10 @@ static void brcmf_fw_request_nvram_done(const struct firmware *fw, void *ctx)
|
||||||
brcmf_dbg(TRACE, "nvram %p len %d\n", nvram, nvram_length);
|
brcmf_dbg(TRACE, "nvram %p len %d\n", nvram, nvram_length);
|
||||||
cur->nv_data.data = nvram;
|
cur->nv_data.data = nvram;
|
||||||
cur->nv_data.len = nvram_length;
|
cur->nv_data.len = nvram_length;
|
||||||
return;
|
return 0;
|
||||||
|
|
||||||
fail:
|
fail:
|
||||||
brcmf_dbg(TRACE, "failed: dev=%s\n", dev_name(fwctx->dev));
|
return -ENOENT;
|
||||||
fwctx->done(fwctx->dev, -ENOENT, NULL);
|
|
||||||
brcmf_fw_free_request(fwctx->req);
|
|
||||||
kfree(fwctx);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static int brcmf_fw_request_next_item(struct brcmf_fw *fwctx, bool async)
|
static int brcmf_fw_request_next_item(struct brcmf_fw *fwctx, bool async)
|
||||||
|
@ -553,20 +550,27 @@ static void brcmf_fw_request_done(const struct firmware *fw, void *ctx)
|
||||||
brcmf_dbg(TRACE, "enter: firmware %s %sfound\n", cur->path,
|
brcmf_dbg(TRACE, "enter: firmware %s %sfound\n", cur->path,
|
||||||
fw ? "" : "not ");
|
fw ? "" : "not ");
|
||||||
|
|
||||||
if (fw) {
|
if (!fw)
|
||||||
if (cur->type == BRCMF_FW_TYPE_BINARY)
|
|
||||||
cur->binary = fw;
|
|
||||||
else if (cur->type == BRCMF_FW_TYPE_NVRAM)
|
|
||||||
brcmf_fw_request_nvram_done(fw, fwctx);
|
|
||||||
else
|
|
||||||
release_firmware(fw);
|
|
||||||
} else if (cur->type == BRCMF_FW_TYPE_NVRAM) {
|
|
||||||
brcmf_fw_request_nvram_done(NULL, fwctx);
|
|
||||||
} else if (!(cur->flags & BRCMF_FW_REQF_OPTIONAL)) {
|
|
||||||
ret = -ENOENT;
|
ret = -ENOENT;
|
||||||
|
|
||||||
|
switch (cur->type) {
|
||||||
|
case BRCMF_FW_TYPE_NVRAM:
|
||||||
|
ret = brcmf_fw_request_nvram_done(fw, fwctx);
|
||||||
|
break;
|
||||||
|
case BRCMF_FW_TYPE_BINARY:
|
||||||
|
cur->binary = fw;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
/* something fishy here so bail out early */
|
||||||
|
brcmf_err("unknown fw type: %d\n", cur->type);
|
||||||
|
release_firmware(fw);
|
||||||
|
ret = -EINVAL;
|
||||||
goto fail;
|
goto fail;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (ret < 0 && !(cur->flags & BRCMF_FW_REQF_OPTIONAL))
|
||||||
|
goto fail;
|
||||||
|
|
||||||
do {
|
do {
|
||||||
if (++fwctx->curpos == fwctx->req->n_items) {
|
if (++fwctx->curpos == fwctx->req->n_items) {
|
||||||
ret = 0;
|
ret = 0;
|
||||||
|
|
|
@ -8,6 +8,7 @@
|
||||||
* Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved.
|
* Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved.
|
||||||
* Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH
|
* Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH
|
||||||
* Copyright(c) 2016 - 2017 Intel Deutschland GmbH
|
* Copyright(c) 2016 - 2017 Intel Deutschland GmbH
|
||||||
|
* Copyright(c) 2018 Intel Corporation
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of version 2 of the GNU General Public License as
|
* it under the terms of version 2 of the GNU General Public License as
|
||||||
|
@ -30,7 +31,7 @@
|
||||||
* Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved.
|
* Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved.
|
||||||
* Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH
|
* Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH
|
||||||
* Copyright(c) 2016 - 2017 Intel Deutschland GmbH
|
* Copyright(c) 2016 - 2017 Intel Deutschland GmbH
|
||||||
* Copyright(c) 2018 Intel Corporation
|
* Copyright(c) 2018 Intel Corporation
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
@ -749,13 +750,9 @@ struct iwl_scan_req_umac {
|
||||||
} __packed;
|
} __packed;
|
||||||
|
|
||||||
#define IWL_SCAN_REQ_UMAC_SIZE_V8 sizeof(struct iwl_scan_req_umac)
|
#define IWL_SCAN_REQ_UMAC_SIZE_V8 sizeof(struct iwl_scan_req_umac)
|
||||||
#define IWL_SCAN_REQ_UMAC_SIZE_V7 (sizeof(struct iwl_scan_req_umac) - \
|
#define IWL_SCAN_REQ_UMAC_SIZE_V7 48
|
||||||
4 * sizeof(u8))
|
#define IWL_SCAN_REQ_UMAC_SIZE_V6 44
|
||||||
#define IWL_SCAN_REQ_UMAC_SIZE_V6 (sizeof(struct iwl_scan_req_umac) - \
|
#define IWL_SCAN_REQ_UMAC_SIZE_V1 36
|
||||||
2 * sizeof(u8) - sizeof(__le16))
|
|
||||||
#define IWL_SCAN_REQ_UMAC_SIZE_V1 (sizeof(struct iwl_scan_req_umac) - \
|
|
||||||
2 * sizeof(__le32) - 2 * sizeof(u8) - \
|
|
||||||
sizeof(__le16))
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* struct iwl_umac_scan_abort
|
* struct iwl_umac_scan_abort
|
||||||
|
|
|
@ -76,6 +76,7 @@
|
||||||
#include "iwl-io.h"
|
#include "iwl-io.h"
|
||||||
#include "iwl-csr.h"
|
#include "iwl-csr.h"
|
||||||
#include "fw/acpi.h"
|
#include "fw/acpi.h"
|
||||||
|
#include "fw/api/nvm-reg.h"
|
||||||
|
|
||||||
/* NVM offsets (in words) definitions */
|
/* NVM offsets (in words) definitions */
|
||||||
enum nvm_offsets {
|
enum nvm_offsets {
|
||||||
|
@ -146,8 +147,8 @@ static const u8 iwl_ext_nvm_channels[] = {
|
||||||
149, 153, 157, 161, 165, 169, 173, 177, 181
|
149, 153, 157, 161, 165, 169, 173, 177, 181
|
||||||
};
|
};
|
||||||
|
|
||||||
#define IWL_NUM_CHANNELS ARRAY_SIZE(iwl_nvm_channels)
|
#define IWL_NVM_NUM_CHANNELS ARRAY_SIZE(iwl_nvm_channels)
|
||||||
#define IWL_NUM_CHANNELS_EXT ARRAY_SIZE(iwl_ext_nvm_channels)
|
#define IWL_NVM_NUM_CHANNELS_EXT ARRAY_SIZE(iwl_ext_nvm_channels)
|
||||||
#define NUM_2GHZ_CHANNELS 14
|
#define NUM_2GHZ_CHANNELS 14
|
||||||
#define NUM_2GHZ_CHANNELS_EXT 14
|
#define NUM_2GHZ_CHANNELS_EXT 14
|
||||||
#define FIRST_2GHZ_HT_MINUS 5
|
#define FIRST_2GHZ_HT_MINUS 5
|
||||||
|
@ -301,11 +302,11 @@ static int iwl_init_channel_map(struct device *dev, const struct iwl_cfg *cfg,
|
||||||
const u8 *nvm_chan;
|
const u8 *nvm_chan;
|
||||||
|
|
||||||
if (cfg->nvm_type != IWL_NVM_EXT) {
|
if (cfg->nvm_type != IWL_NVM_EXT) {
|
||||||
num_of_ch = IWL_NUM_CHANNELS;
|
num_of_ch = IWL_NVM_NUM_CHANNELS;
|
||||||
nvm_chan = &iwl_nvm_channels[0];
|
nvm_chan = &iwl_nvm_channels[0];
|
||||||
num_2ghz_channels = NUM_2GHZ_CHANNELS;
|
num_2ghz_channels = NUM_2GHZ_CHANNELS;
|
||||||
} else {
|
} else {
|
||||||
num_of_ch = IWL_NUM_CHANNELS_EXT;
|
num_of_ch = IWL_NVM_NUM_CHANNELS_EXT;
|
||||||
nvm_chan = &iwl_ext_nvm_channels[0];
|
nvm_chan = &iwl_ext_nvm_channels[0];
|
||||||
num_2ghz_channels = NUM_2GHZ_CHANNELS_EXT;
|
num_2ghz_channels = NUM_2GHZ_CHANNELS_EXT;
|
||||||
}
|
}
|
||||||
|
@ -720,12 +721,12 @@ iwl_parse_nvm_data(struct iwl_trans *trans, const struct iwl_cfg *cfg,
|
||||||
if (cfg->nvm_type != IWL_NVM_EXT)
|
if (cfg->nvm_type != IWL_NVM_EXT)
|
||||||
data = kzalloc(sizeof(*data) +
|
data = kzalloc(sizeof(*data) +
|
||||||
sizeof(struct ieee80211_channel) *
|
sizeof(struct ieee80211_channel) *
|
||||||
IWL_NUM_CHANNELS,
|
IWL_NVM_NUM_CHANNELS,
|
||||||
GFP_KERNEL);
|
GFP_KERNEL);
|
||||||
else
|
else
|
||||||
data = kzalloc(sizeof(*data) +
|
data = kzalloc(sizeof(*data) +
|
||||||
sizeof(struct ieee80211_channel) *
|
sizeof(struct ieee80211_channel) *
|
||||||
IWL_NUM_CHANNELS_EXT,
|
IWL_NVM_NUM_CHANNELS_EXT,
|
||||||
GFP_KERNEL);
|
GFP_KERNEL);
|
||||||
if (!data)
|
if (!data)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
@ -842,24 +843,34 @@ static u32 iwl_nvm_get_regdom_bw_flags(const u8 *nvm_chan,
|
||||||
return flags;
|
return flags;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
struct regdb_ptrs {
|
||||||
|
struct ieee80211_wmm_rule *rule;
|
||||||
|
u32 token;
|
||||||
|
};
|
||||||
|
|
||||||
struct ieee80211_regdomain *
|
struct ieee80211_regdomain *
|
||||||
iwl_parse_nvm_mcc_info(struct device *dev, const struct iwl_cfg *cfg,
|
iwl_parse_nvm_mcc_info(struct device *dev, const struct iwl_cfg *cfg,
|
||||||
int num_of_ch, __le32 *channels, u16 fw_mcc)
|
int num_of_ch, __le32 *channels, u16 fw_mcc,
|
||||||
|
u16 geo_info)
|
||||||
{
|
{
|
||||||
int ch_idx;
|
int ch_idx;
|
||||||
u16 ch_flags;
|
u16 ch_flags;
|
||||||
u32 reg_rule_flags, prev_reg_rule_flags = 0;
|
u32 reg_rule_flags, prev_reg_rule_flags = 0;
|
||||||
const u8 *nvm_chan = cfg->nvm_type == IWL_NVM_EXT ?
|
const u8 *nvm_chan = cfg->nvm_type == IWL_NVM_EXT ?
|
||||||
iwl_ext_nvm_channels : iwl_nvm_channels;
|
iwl_ext_nvm_channels : iwl_nvm_channels;
|
||||||
struct ieee80211_regdomain *regd;
|
struct ieee80211_regdomain *regd, *copy_rd;
|
||||||
int size_of_regd;
|
int size_of_regd, regd_to_copy, wmms_to_copy;
|
||||||
|
int size_of_wmms = 0;
|
||||||
struct ieee80211_reg_rule *rule;
|
struct ieee80211_reg_rule *rule;
|
||||||
|
struct ieee80211_wmm_rule *wmm_rule, *d_wmm, *s_wmm;
|
||||||
|
struct regdb_ptrs *regdb_ptrs;
|
||||||
enum nl80211_band band;
|
enum nl80211_band band;
|
||||||
int center_freq, prev_center_freq = 0;
|
int center_freq, prev_center_freq = 0;
|
||||||
int valid_rules = 0;
|
int valid_rules = 0, n_wmms = 0;
|
||||||
|
int i;
|
||||||
bool new_rule;
|
bool new_rule;
|
||||||
int max_num_ch = cfg->nvm_type == IWL_NVM_EXT ?
|
int max_num_ch = cfg->nvm_type == IWL_NVM_EXT ?
|
||||||
IWL_NUM_CHANNELS_EXT : IWL_NUM_CHANNELS;
|
IWL_NVM_NUM_CHANNELS_EXT : IWL_NVM_NUM_CHANNELS;
|
||||||
|
|
||||||
if (WARN_ON_ONCE(num_of_ch > NL80211_MAX_SUPP_REG_RULES))
|
if (WARN_ON_ONCE(num_of_ch > NL80211_MAX_SUPP_REG_RULES))
|
||||||
return ERR_PTR(-EINVAL);
|
return ERR_PTR(-EINVAL);
|
||||||
|
@ -875,10 +886,26 @@ iwl_parse_nvm_mcc_info(struct device *dev, const struct iwl_cfg *cfg,
|
||||||
sizeof(struct ieee80211_regdomain) +
|
sizeof(struct ieee80211_regdomain) +
|
||||||
num_of_ch * sizeof(struct ieee80211_reg_rule);
|
num_of_ch * sizeof(struct ieee80211_reg_rule);
|
||||||
|
|
||||||
regd = kzalloc(size_of_regd, GFP_KERNEL);
|
if (geo_info & GEO_WMM_ETSI_5GHZ_INFO)
|
||||||
|
size_of_wmms =
|
||||||
|
num_of_ch * sizeof(struct ieee80211_wmm_rule);
|
||||||
|
|
||||||
|
regd = kzalloc(size_of_regd + size_of_wmms, GFP_KERNEL);
|
||||||
if (!regd)
|
if (!regd)
|
||||||
return ERR_PTR(-ENOMEM);
|
return ERR_PTR(-ENOMEM);
|
||||||
|
|
||||||
|
regdb_ptrs = kcalloc(num_of_ch, sizeof(*regdb_ptrs), GFP_KERNEL);
|
||||||
|
if (!regdb_ptrs) {
|
||||||
|
copy_rd = ERR_PTR(-ENOMEM);
|
||||||
|
goto out;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* set alpha2 from FW. */
|
||||||
|
regd->alpha2[0] = fw_mcc >> 8;
|
||||||
|
regd->alpha2[1] = fw_mcc & 0xff;
|
||||||
|
|
||||||
|
wmm_rule = (struct ieee80211_wmm_rule *)((u8 *)regd + size_of_regd);
|
||||||
|
|
||||||
for (ch_idx = 0; ch_idx < num_of_ch; ch_idx++) {
|
for (ch_idx = 0; ch_idx < num_of_ch; ch_idx++) {
|
||||||
ch_flags = (u16)__le32_to_cpup(channels + ch_idx);
|
ch_flags = (u16)__le32_to_cpup(channels + ch_idx);
|
||||||
band = (ch_idx < NUM_2GHZ_CHANNELS) ?
|
band = (ch_idx < NUM_2GHZ_CHANNELS) ?
|
||||||
|
@ -927,14 +954,66 @@ iwl_parse_nvm_mcc_info(struct device *dev, const struct iwl_cfg *cfg,
|
||||||
|
|
||||||
iwl_nvm_print_channel_flags(dev, IWL_DL_LAR,
|
iwl_nvm_print_channel_flags(dev, IWL_DL_LAR,
|
||||||
nvm_chan[ch_idx], ch_flags);
|
nvm_chan[ch_idx], ch_flags);
|
||||||
|
|
||||||
|
if (!(geo_info & GEO_WMM_ETSI_5GHZ_INFO) ||
|
||||||
|
band == NL80211_BAND_2GHZ)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
if (!reg_query_regdb_wmm(regd->alpha2, center_freq,
|
||||||
|
®db_ptrs[n_wmms].token, wmm_rule)) {
|
||||||
|
/* Add only new rules */
|
||||||
|
for (i = 0; i < n_wmms; i++) {
|
||||||
|
if (regdb_ptrs[i].token ==
|
||||||
|
regdb_ptrs[n_wmms].token) {
|
||||||
|
rule->wmm_rule = regdb_ptrs[i].rule;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (i == n_wmms) {
|
||||||
|
rule->wmm_rule = wmm_rule;
|
||||||
|
regdb_ptrs[n_wmms++].rule = wmm_rule;
|
||||||
|
wmm_rule++;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
regd->n_reg_rules = valid_rules;
|
regd->n_reg_rules = valid_rules;
|
||||||
|
regd->n_wmm_rules = n_wmms;
|
||||||
|
|
||||||
/* set alpha2 from FW. */
|
/*
|
||||||
regd->alpha2[0] = fw_mcc >> 8;
|
* Narrow down regdom for unused regulatory rules to prevent hole
|
||||||
regd->alpha2[1] = fw_mcc & 0xff;
|
* between reg rules to wmm rules.
|
||||||
|
*/
|
||||||
|
regd_to_copy = sizeof(struct ieee80211_regdomain) +
|
||||||
|
valid_rules * sizeof(struct ieee80211_reg_rule);
|
||||||
|
|
||||||
return regd;
|
wmms_to_copy = sizeof(struct ieee80211_wmm_rule) * n_wmms;
|
||||||
|
|
||||||
|
copy_rd = kzalloc(regd_to_copy + wmms_to_copy, GFP_KERNEL);
|
||||||
|
if (!copy_rd) {
|
||||||
|
copy_rd = ERR_PTR(-ENOMEM);
|
||||||
|
goto out;
|
||||||
|
}
|
||||||
|
|
||||||
|
memcpy(copy_rd, regd, regd_to_copy);
|
||||||
|
memcpy((u8 *)copy_rd + regd_to_copy, (u8 *)regd + size_of_regd,
|
||||||
|
wmms_to_copy);
|
||||||
|
|
||||||
|
d_wmm = (struct ieee80211_wmm_rule *)((u8 *)copy_rd + regd_to_copy);
|
||||||
|
s_wmm = (struct ieee80211_wmm_rule *)((u8 *)regd + size_of_regd);
|
||||||
|
|
||||||
|
for (i = 0; i < regd->n_reg_rules; i++) {
|
||||||
|
if (!regd->reg_rules[i].wmm_rule)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
copy_rd->reg_rules[i].wmm_rule = d_wmm +
|
||||||
|
(regd->reg_rules[i].wmm_rule - s_wmm) /
|
||||||
|
sizeof(struct ieee80211_wmm_rule);
|
||||||
|
}
|
||||||
|
|
||||||
|
out:
|
||||||
|
kfree(regdb_ptrs);
|
||||||
|
kfree(regd);
|
||||||
|
return copy_rd;
|
||||||
}
|
}
|
||||||
IWL_EXPORT_SYMBOL(iwl_parse_nvm_mcc_info);
|
IWL_EXPORT_SYMBOL(iwl_parse_nvm_mcc_info);
|
||||||
|
|
|
@ -101,12 +101,14 @@ void iwl_init_sbands(struct device *dev, const struct iwl_cfg *cfg,
|
||||||
*
|
*
|
||||||
* This function parses the regulatory channel data received as a
|
* This function parses the regulatory channel data received as a
|
||||||
* MCC_UPDATE_CMD command. It returns a newly allocation regulatory domain,
|
* MCC_UPDATE_CMD command. It returns a newly allocation regulatory domain,
|
||||||
* to be fed into the regulatory core. An ERR_PTR is returned on error.
|
* to be fed into the regulatory core. In case the geo_info is set handle
|
||||||
|
* accordingly. An ERR_PTR is returned on error.
|
||||||
* If not given to the regulatory core, the user is responsible for freeing
|
* If not given to the regulatory core, the user is responsible for freeing
|
||||||
* the regdomain returned here with kfree.
|
* the regdomain returned here with kfree.
|
||||||
*/
|
*/
|
||||||
struct ieee80211_regdomain *
|
struct ieee80211_regdomain *
|
||||||
iwl_parse_nvm_mcc_info(struct device *dev, const struct iwl_cfg *cfg,
|
iwl_parse_nvm_mcc_info(struct device *dev, const struct iwl_cfg *cfg,
|
||||||
int num_of_ch, __le32 *channels, u16 fw_mcc);
|
int num_of_ch, __le32 *channels, u16 fw_mcc,
|
||||||
|
u16 geo_info);
|
||||||
|
|
||||||
#endif /* __iwl_nvm_parse_h__ */
|
#endif /* __iwl_nvm_parse_h__ */
|
||||||
|
|
|
@ -311,7 +311,8 @@ struct ieee80211_regdomain *iwl_mvm_get_regdomain(struct wiphy *wiphy,
|
||||||
regd = iwl_parse_nvm_mcc_info(mvm->trans->dev, mvm->cfg,
|
regd = iwl_parse_nvm_mcc_info(mvm->trans->dev, mvm->cfg,
|
||||||
__le32_to_cpu(resp->n_channels),
|
__le32_to_cpu(resp->n_channels),
|
||||||
resp->channels,
|
resp->channels,
|
||||||
__le16_to_cpu(resp->mcc));
|
__le16_to_cpu(resp->mcc),
|
||||||
|
__le16_to_cpu(resp->geo_info));
|
||||||
/* Store the return source id */
|
/* Store the return source id */
|
||||||
src_id = resp->source_id;
|
src_id = resp->source_id;
|
||||||
kfree(resp);
|
kfree(resp);
|
||||||
|
|
|
@ -158,16 +158,6 @@ static u8 halbtc_get_wifi_central_chnl(struct btc_coexist *btcoexist)
|
||||||
|
|
||||||
static u8 rtl_get_hwpg_single_ant_path(struct rtl_priv *rtlpriv)
|
static u8 rtl_get_hwpg_single_ant_path(struct rtl_priv *rtlpriv)
|
||||||
{
|
{
|
||||||
struct rtl_mod_params *mod_params = rtlpriv->cfg->mod_params;
|
|
||||||
|
|
||||||
/* override ant_num / ant_path */
|
|
||||||
if (mod_params->ant_sel) {
|
|
||||||
rtlpriv->btcoexist.btc_info.ant_num =
|
|
||||||
(mod_params->ant_sel == 1 ? ANT_X2 : ANT_X1);
|
|
||||||
|
|
||||||
rtlpriv->btcoexist.btc_info.single_ant_path =
|
|
||||||
(mod_params->ant_sel == 1 ? 0 : 1);
|
|
||||||
}
|
|
||||||
return rtlpriv->btcoexist.btc_info.single_ant_path;
|
return rtlpriv->btcoexist.btc_info.single_ant_path;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -178,7 +168,6 @@ static u8 rtl_get_hwpg_bt_type(struct rtl_priv *rtlpriv)
|
||||||
|
|
||||||
static u8 rtl_get_hwpg_ant_num(struct rtl_priv *rtlpriv)
|
static u8 rtl_get_hwpg_ant_num(struct rtl_priv *rtlpriv)
|
||||||
{
|
{
|
||||||
struct rtl_mod_params *mod_params = rtlpriv->cfg->mod_params;
|
|
||||||
u8 num;
|
u8 num;
|
||||||
|
|
||||||
if (rtlpriv->btcoexist.btc_info.ant_num == ANT_X2)
|
if (rtlpriv->btcoexist.btc_info.ant_num == ANT_X2)
|
||||||
|
@ -186,10 +175,6 @@ static u8 rtl_get_hwpg_ant_num(struct rtl_priv *rtlpriv)
|
||||||
else
|
else
|
||||||
num = 1;
|
num = 1;
|
||||||
|
|
||||||
/* override ant_num / ant_path */
|
|
||||||
if (mod_params->ant_sel)
|
|
||||||
num = (mod_params->ant_sel == 1 ? ANT_X2 : ANT_X1) + 1;
|
|
||||||
|
|
||||||
return num;
|
return num;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -848,6 +848,9 @@ static bool _rtl8723be_init_mac(struct ieee80211_hw *hw)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (rtlpriv->cfg->ops->get_btc_status())
|
||||||
|
rtlpriv->btcoexist.btc_ops->btc_power_on_setting(rtlpriv);
|
||||||
|
|
||||||
bytetmp = rtl_read_byte(rtlpriv, REG_MULTI_FUNC_CTRL);
|
bytetmp = rtl_read_byte(rtlpriv, REG_MULTI_FUNC_CTRL);
|
||||||
rtl_write_byte(rtlpriv, REG_MULTI_FUNC_CTRL, bytetmp | BIT(3));
|
rtl_write_byte(rtlpriv, REG_MULTI_FUNC_CTRL, bytetmp | BIT(3));
|
||||||
|
|
||||||
|
@ -2696,21 +2699,21 @@ void rtl8723be_read_bt_coexist_info_from_hwpg(struct ieee80211_hw *hw,
|
||||||
rtlpriv->btcoexist.btc_info.bt_type = BT_RTL8723B;
|
rtlpriv->btcoexist.btc_info.bt_type = BT_RTL8723B;
|
||||||
rtlpriv->btcoexist.btc_info.ant_num = (value & 0x1);
|
rtlpriv->btcoexist.btc_info.ant_num = (value & 0x1);
|
||||||
rtlpriv->btcoexist.btc_info.single_ant_path =
|
rtlpriv->btcoexist.btc_info.single_ant_path =
|
||||||
(value & 0x40); /*0xc3[6]*/
|
(value & 0x40 ? ANT_AUX : ANT_MAIN); /*0xc3[6]*/
|
||||||
} else {
|
} else {
|
||||||
rtlpriv->btcoexist.btc_info.btcoexist = 0;
|
rtlpriv->btcoexist.btc_info.btcoexist = 0;
|
||||||
rtlpriv->btcoexist.btc_info.bt_type = BT_RTL8723B;
|
rtlpriv->btcoexist.btc_info.bt_type = BT_RTL8723B;
|
||||||
rtlpriv->btcoexist.btc_info.ant_num = ANT_X2;
|
rtlpriv->btcoexist.btc_info.ant_num = ANT_X2;
|
||||||
rtlpriv->btcoexist.btc_info.single_ant_path = 0;
|
rtlpriv->btcoexist.btc_info.single_ant_path = ANT_MAIN;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* override ant_num / ant_path */
|
/* override ant_num / ant_path */
|
||||||
if (mod_params->ant_sel) {
|
if (mod_params->ant_sel) {
|
||||||
rtlpriv->btcoexist.btc_info.ant_num =
|
rtlpriv->btcoexist.btc_info.ant_num =
|
||||||
(mod_params->ant_sel == 1 ? ANT_X2 : ANT_X1);
|
(mod_params->ant_sel == 1 ? ANT_X1 : ANT_X2);
|
||||||
|
|
||||||
rtlpriv->btcoexist.btc_info.single_ant_path =
|
rtlpriv->btcoexist.btc_info.single_ant_path =
|
||||||
(mod_params->ant_sel == 1 ? 0 : 1);
|
(mod_params->ant_sel == 1 ? ANT_AUX : ANT_MAIN);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -2823,6 +2823,11 @@ enum bt_ant_num {
|
||||||
ANT_X1 = 1,
|
ANT_X1 = 1,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
enum bt_ant_path {
|
||||||
|
ANT_MAIN = 0,
|
||||||
|
ANT_AUX = 1,
|
||||||
|
};
|
||||||
|
|
||||||
enum bt_co_type {
|
enum bt_co_type {
|
||||||
BT_2WIRE = 0,
|
BT_2WIRE = 0,
|
||||||
BT_ISSC_3WIRE = 1,
|
BT_ISSC_3WIRE = 1,
|
||||||
|
|
Loading…
Reference in New Issue