Skip to content

Commit

Permalink
Merge tag 'wireless-drivers-next-2020-03-24' of git://git.kernel.org/…
Browse files Browse the repository at this point in the history
…pub/scm/linux/kernel/git/kvalo/wireless-drivers-next

Kalle Valo says:

====================
wireless-drivers-next patches for v5.7

Second set of patches for v5.7. Lots of cleanup patches this time, but
of course various new features as well fixes.

When merging with wireless-drivers this pull request has a conflict in:

drivers/net/wireless/intel/iwlwifi/pcie/drv.c

To solve that just drop the changes from commit cf52c8a in
wireless-drivers and take the hunk from wireless-drivers-next as is.
The list of specific subsystem device IDs are not necessary after
commit d6f2134 (in wireless-drivers-next) anymore, the detection
is based on other characteristics of the devices.

Major changes:

qtnfmac

* support WPA3 SAE and OWE in AP mode

ath10k

* support for getting btcoex settings from Device Tree

* support QCA9377 SDIO device

ath11k

* add HE rate accounting

* add thermal sensor and cooling devices

mt76

* MT7663 support for the MT7615 driver
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
David S. Miller committed Mar 24, 2020
2 parents 9970de8 + 8d4ccd7 commit 5ef8c66
Show file tree
Hide file tree
Showing 130 changed files with 4,260 additions and 2,276 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,11 @@ Optional properties:
- qcom,msa-fixed-perm: Boolean context flag to disable SCM call for statically
mapped msa region.

- qcom,coexist-support : should contain eithr "0" or "1" to indicate coex
support by the hardware.
- qcom,coexist-gpio-pin : gpio pin number information to support coex
which will be used by wifi firmware.

Example (to supply PCI based wifi block details):

In this example, the node is defined as child node of the PCI controller.
Expand Down Expand Up @@ -159,6 +164,8 @@ wifi0: wifi@a000000 {
qcom,msi_addr = <0x0b006040>;
qcom,msi_base = <0x40>;
qcom,ath10k-pre-calibration-data = [ 01 02 03 ... ];
qcom,coexist-support = <1>;
qcom,coexist-gpio-pin = <0x33>;
};

Example (to supply wcn3990 SoC wifi block details):
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/wireless/admtek/adm8211.h
Original file line number Diff line number Diff line change
Expand Up @@ -531,7 +531,7 @@ struct adm8211_eeprom {
u8 lpf_cutoff[14]; /* 0x62 */
u8 lnags_threshold[14]; /* 0x70 */
__le16 checksum; /* 0x7E */
u8 cis_data[0]; /* 0x80, 384 bytes */
u8 cis_data[]; /* 0x80, 384 bytes */
} __packed;

struct adm8211_priv {
Expand Down
4 changes: 2 additions & 2 deletions drivers/net/wireless/ath/ath10k/ahb.c
Original file line number Diff line number Diff line change
Expand Up @@ -459,15 +459,15 @@ static int ath10k_ahb_resource_init(struct ath10k *ar)
ar_ahb->mem_len = resource_size(res);

ar_ahb->gcc_mem = ioremap(ATH10K_GCC_REG_BASE,
ATH10K_GCC_REG_SIZE);
ATH10K_GCC_REG_SIZE);
if (!ar_ahb->gcc_mem) {
ath10k_err(ar, "gcc mem ioremap error\n");
ret = -ENOMEM;
goto err_mem_unmap;
}

ar_ahb->tcsr_mem = ioremap(ATH10K_TCSR_REG_BASE,
ATH10K_TCSR_REG_SIZE);
ATH10K_TCSR_REG_SIZE);
if (!ar_ahb->tcsr_mem) {
ath10k_err(ar, "tcsr mem ioremap error\n");
ret = -ENOMEM;
Expand Down
82 changes: 81 additions & 1 deletion drivers/net/wireless/ath/ath10k/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -540,6 +540,33 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = {
.fw_diag_ce_download = true,
.tx_stats_over_pktlog = false,
},
{
.id = QCA9377_HW_1_1_DEV_VERSION,
.dev_id = QCA9377_1_0_DEVICE_ID,
.bus = ATH10K_BUS_SDIO,
.name = "qca9377 hw1.1 sdio",
.patch_load_addr = QCA9377_HW_1_0_PATCH_LOAD_ADDR,
.uart_pin = 19,
.otp_exe_param = 0,
.channel_counters_freq_hz = 88000,
.max_probe_resp_desc_thres = 0,
.cal_data_len = 8124,
.fw = {
.dir = QCA9377_HW_1_0_FW_DIR,
.board = QCA9377_HW_1_0_BOARD_DATA_FILE,
.board_size = QCA9377_BOARD_DATA_SZ,
.board_ext_size = QCA9377_BOARD_EXT_DATA_SZ,
},
.hw_ops = &qca6174_ops,
.hw_clk = qca6174_clk,
.target_cpu_freq = 176000000,
.decap_align_bytes = 4,
.n_cipher_suites = 8,
.num_peers = TARGET_QCA9377_HL_NUM_PEERS,
.ast_skid_limit = 0x10,
.num_wds_entries = 0x20,
.uart_pin_workaround = true,
},
{
.id = QCA4019_HW_1_0_DEV_VERSION,
.dev_id = 0,
Expand Down Expand Up @@ -874,6 +901,13 @@ static int ath10k_core_get_board_id_from_otp(struct ath10k *ar)
return -ENODATA;
}

if (ar->id.bmi_ids_valid) {
ath10k_dbg(ar, ATH10K_DBG_BOOT,
"boot already acquired valid otp board id,skip download, board_id %d chip_id %d\n",
ar->id.bmi_board_id, ar->id.bmi_chip_id);
goto skip_otp_download;
}

ath10k_dbg(ar, ATH10K_DBG_BOOT,
"boot upload otp to 0x%x len %zd for board id\n",
address, ar->normal_mode_fw.fw_file.otp_len);
Expand Down Expand Up @@ -921,6 +955,8 @@ static int ath10k_core_get_board_id_from_otp(struct ath10k *ar)
ar->id.bmi_board_id = board_id;
ar->id.bmi_chip_id = chip_id;

skip_otp_download:

return 0;
}

Expand Down Expand Up @@ -2119,6 +2155,40 @@ static int ath10k_download_cal_data(struct ath10k *ar)
return 0;
}

static void ath10k_core_fetch_btcoex_dt(struct ath10k *ar)
{
struct device_node *node;
u8 coex_support = 0;
int ret;

node = ar->dev->of_node;
if (!node)
goto out;

ret = of_property_read_u8(node, "qcom,coexist-support", &coex_support);
if (ret) {
ar->coex_support = true;
goto out;
}

if (coex_support) {
ar->coex_support = true;
} else {
ar->coex_support = false;
ar->coex_gpio_pin = -1;
goto out;
}

ret = of_property_read_u32(node, "qcom,coexist-gpio-pin",
&ar->coex_gpio_pin);
if (ret)
ar->coex_gpio_pin = -1;

out:
ath10k_dbg(ar, ATH10K_DBG_BOOT, "boot coex_support %d coex_gpio_pin %d\n",
ar->coex_support, ar->coex_gpio_pin);
}

static int ath10k_init_uart(struct ath10k *ar)
{
int ret;
Expand Down Expand Up @@ -2696,14 +2766,22 @@ int ath10k_core_start(struct ath10k *ar, enum ath10k_firmware_mode mode,
if (test_bit(WMI_SERVICE_BSS_CHANNEL_INFO_64, ar->wmi.svc_map))
val |= WMI_10_4_BSS_CHANNEL_INFO_64;

ath10k_core_fetch_btcoex_dt(ar);

/* 10.4 firmware supports BT-Coex without reloading firmware
* via pdev param. To support Bluetooth coexistence pdev param,
* WMI_COEX_GPIO_SUPPORT of extended resource config should be
* enabled always.
*
* We can still enable BTCOEX if firmware has the support
* eventhough btceox_support value is
* ATH10K_DT_BTCOEX_NOT_FOUND
*/

if (test_bit(WMI_SERVICE_COEX_GPIO, ar->wmi.svc_map) &&
test_bit(ATH10K_FW_FEATURE_BTCOEX_PARAM,
ar->running_fw->fw_file.fw_features))
ar->running_fw->fw_file.fw_features) &&
ar->coex_support)
val |= WMI_10_4_COEX_GPIO_SUPPORT;

if (test_bit(WMI_SERVICE_TDLS_EXPLICIT_MODE_ONLY,
Expand Down Expand Up @@ -2863,6 +2941,8 @@ void ath10k_core_stop(struct ath10k *ar)
ath10k_htt_tx_stop(&ar->htt);
ath10k_htt_rx_free(&ar->htt);
ath10k_wmi_detach(ar);

ar->id.bmi_ids_valid = false;
}
EXPORT_SYMBOL(ath10k_core_stop);

Expand Down
3 changes: 3 additions & 0 deletions drivers/net/wireless/ath/ath10k/core.h
Original file line number Diff line number Diff line change
Expand Up @@ -1222,6 +1222,9 @@ struct ath10k {
struct ath10k_bus_params bus_param;
struct completion peer_delete_done;

bool coex_support;
int coex_gpio_pin;

/* must be last */
u8 drv_priv[0] __aligned(sizeof(void *));
};
Expand Down
12 changes: 7 additions & 5 deletions drivers/net/wireless/ath/ath10k/debug.c
Original file line number Diff line number Diff line change
Expand Up @@ -1978,6 +1978,9 @@ static ssize_t ath10k_write_btcoex(struct file *file,
if (strtobool(buf, &val) != 0)
return -EINVAL;

if (!ar->coex_support)
return -EOPNOTSUPP;

mutex_lock(&ar->conf_mutex);

if (ar->state != ATH10K_STATE_ON &&
Expand Down Expand Up @@ -2370,9 +2373,6 @@ static ssize_t ath10k_write_warm_hw_reset(struct file *file,
goto exit;
}

if (!(test_bit(WMI_SERVICE_RESET_CHIP, ar->wmi.svc_map)))
ath10k_warn(ar, "wmi service for reset chip is not available\n");

ret = ath10k_wmi_pdev_set_param(ar, ar->wmi.pdev_param->pdev_reset,
WMI_RST_MODE_WARM_RESET);

Expand Down Expand Up @@ -2647,8 +2647,10 @@ int ath10k_debug_register(struct ath10k *ar)
ar->debug.debugfs_phy, ar,
&fops_tpc_stats_final);

debugfs_create_file("warm_hw_reset", 0600, ar->debug.debugfs_phy, ar,
&fops_warm_hw_reset);
if (test_bit(WMI_SERVICE_RESET_CHIP, ar->wmi.svc_map))
debugfs_create_file("warm_hw_reset", 0600,
ar->debug.debugfs_phy, ar,
&fops_warm_hw_reset);

debugfs_create_file("ps_state_enable", 0600, ar->debug.debugfs_phy, ar,
&fops_ps_state_enable);
Expand Down
3 changes: 2 additions & 1 deletion drivers/net/wireless/ath/ath10k/htt_rx.c
Original file line number Diff line number Diff line change
Expand Up @@ -2744,7 +2744,8 @@ static void ath10k_htt_rx_tx_compl_ind(struct ath10k *ar,
continue;
}

tid = FIELD_GET(HTT_TX_PPDU_DUR_INFO0_TID_MASK, info0);
tid = FIELD_GET(HTT_TX_PPDU_DUR_INFO0_TID_MASK, info0) &
IEEE80211_QOS_CTL_TID_MASK;
tx_duration = __le32_to_cpu(ppdu_dur->tx_duration);

ieee80211_sta_register_airtime(peer->sta, tid, tx_duration, 0);
Expand Down
1 change: 1 addition & 0 deletions drivers/net/wireless/ath/ath10k/hw.c
Original file line number Diff line number Diff line change
Expand Up @@ -1131,6 +1131,7 @@ static int ath10k_get_htt_tx_data_rssi_pad(struct htt_resp *resp)

const struct ath10k_hw_ops qca988x_ops = {
.set_coverage_class = ath10k_hw_qca988x_set_coverage_class,
.is_rssi_enable = ath10k_htt_tx_rssi_enable,
};

static int ath10k_qca99x0_rx_desc_get_l3_pad_bytes(struct htt_rx_desc *rxd)
Expand Down
3 changes: 3 additions & 0 deletions drivers/net/wireless/ath/ath10k/hw.h
Original file line number Diff line number Diff line change
Expand Up @@ -774,6 +774,9 @@ ath10k_is_rssi_enable(struct ath10k_hw_params *hw,
#define TARGET_HL_TLV_AST_SKID_LIMIT 16
#define TARGET_HL_TLV_NUM_WDS_ENTRIES 2

/* Target specific defines for QCA9377 high latency firmware */
#define TARGET_QCA9377_HL_NUM_PEERS 15

/* Diagnostic Window */
#define CE_DIAG_PIPE 7

Expand Down
3 changes: 2 additions & 1 deletion drivers/net/wireless/ath/ath10k/mac.c
Original file line number Diff line number Diff line change
Expand Up @@ -4982,7 +4982,8 @@ static int ath10k_start(struct ieee80211_hw *hw)
param = ar->wmi.pdev_param->enable_btcoex;
if (test_bit(WMI_SERVICE_COEX_GPIO, ar->wmi.svc_map) &&
test_bit(ATH10K_FW_FEATURE_BTCOEX_PARAM,
ar->running_fw->fw_file.fw_features)) {
ar->running_fw->fw_file.fw_features) &&
ar->coex_support) {
ret = ath10k_wmi_pdev_set_param(ar, param, 0);
if (ret) {
ath10k_warn(ar,
Expand Down
25 changes: 19 additions & 6 deletions drivers/net/wireless/ath/ath10k/sdio.c
Original file line number Diff line number Diff line change
Expand Up @@ -694,7 +694,7 @@ static int ath10k_sdio_mbox_rx_fetch_bundle(struct ath10k *ar)
htc_hdr = (struct ath10k_htc_hdr *)(ar_sdio->vsg_buffer + pkt_offset);
pkt->act_len = le16_to_cpu(htc_hdr->len) + sizeof(*htc_hdr);

if (pkt->act_len > pkt->alloc_len ) {
if (pkt->act_len > pkt->alloc_len) {
ret = -EINVAL;
goto err;
}
Expand Down Expand Up @@ -953,8 +953,11 @@ static int ath10k_sdio_mbox_read_int_status(struct ath10k *ar,
*/
ret = ath10k_sdio_read(ar, MBOX_HOST_INT_STATUS_ADDRESS,
irq_proc_reg, sizeof(*irq_proc_reg));
if (ret)
if (ret) {
queue_work(ar->workqueue, &ar->restart_work);
ath10k_warn(ar, "read int status fail, start recovery\n");
goto out;
}

/* Update only those registers that are enabled */
*host_int_status = irq_proc_reg->host_int_status &
Expand Down Expand Up @@ -1647,23 +1650,33 @@ static int ath10k_sdio_hif_diag_read(struct ath10k *ar, u32 address, void *buf,
size_t buf_len)
{
int ret;
void *mem;

mem = kzalloc(buf_len, GFP_KERNEL);
if (!mem)
return -ENOMEM;

/* set window register to start read cycle */
ret = ath10k_sdio_write32(ar, MBOX_WINDOW_READ_ADDR_ADDRESS, address);
if (ret) {
ath10k_warn(ar, "failed to set mbox window read address: %d", ret);
return ret;
goto out;
}

/* read the data */
ret = ath10k_sdio_read(ar, MBOX_WINDOW_DATA_ADDRESS, buf, buf_len);
ret = ath10k_sdio_read(ar, MBOX_WINDOW_DATA_ADDRESS, mem, buf_len);
if (ret) {
ath10k_warn(ar, "failed to read from mbox window data address: %d\n",
ret);
return ret;
goto out;
}

return 0;
memcpy(buf, mem, buf_len);

out:
kfree(mem);

return ret;
}

static int ath10k_sdio_hif_diag_read32(struct ath10k *ar, u32 address,
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/wireless/ath/ath10k/wmi.c
Original file line number Diff line number Diff line change
Expand Up @@ -8787,7 +8787,7 @@ ath10k_wmi_10_4_ext_resource_config(struct ath10k *ar,
cmd = (struct wmi_ext_resource_config_10_4_cmd *)skb->data;
cmd->host_platform_config = __cpu_to_le32(type);
cmd->fw_feature_bitmap = __cpu_to_le32(fw_feature_bitmap);
cmd->wlan_gpio_priority = __cpu_to_le32(-1);
cmd->wlan_gpio_priority = __cpu_to_le32(ar->coex_gpio_pin);
cmd->coex_version = __cpu_to_le32(WMI_NO_COEX_VERSION_SUPPORT);
cmd->coex_gpio_pin1 = __cpu_to_le32(-1);
cmd->coex_gpio_pin2 = __cpu_to_le32(-1);
Expand Down
7 changes: 7 additions & 0 deletions drivers/net/wireless/ath/ath10k/wmi.h
Original file line number Diff line number Diff line change
Expand Up @@ -371,6 +371,11 @@ enum wmi_10_4_service {
WMI_10_4_SERVICE_EXT_PEER_TID_CONFIGS_SUPPORT,
WMI_10_4_SERVICE_REPORT_AIRTIME,
WMI_10_4_SERVICE_TX_PWR_PER_PEER,
WMI_10_4_SERVICE_FETCH_PEER_TX_PN,
WMI_10_4_SERVICE_MULTIPLE_VDEV_RESTART,
WMI_10_4_SERVICE_ENHANCED_RADIO_COUNTERS,
WMI_10_4_SERVICE_QINQ_SUPPORT,
WMI_10_4_SERVICE_RESET_CHIP,
};

static inline char *wmi_service_name(enum wmi_service service_id)
Expand Down Expand Up @@ -827,6 +832,8 @@ static inline void wmi_10_4_svc_map(const __le32 *in, unsigned long *out,
WMI_SERVICE_REPORT_AIRTIME, len);
SVCMAP(WMI_10_4_SERVICE_TX_PWR_PER_PEER,
WMI_SERVICE_TX_PWR_PER_PEER, len);
SVCMAP(WMI_10_4_SERVICE_RESET_CHIP,
WMI_SERVICE_RESET_CHIP, len);
}

#undef SVCMAP
Expand Down
1 change: 1 addition & 0 deletions drivers/net/wireless/ath/ath11k/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ ath11k-y += core.o \
ath11k-$(CONFIG_ATH11K_DEBUGFS) += debug_htt_stats.o debugfs_sta.o
ath11k-$(CONFIG_NL80211_TESTMODE) += testmode.o
ath11k-$(CONFIG_ATH11K_TRACING) += trace.o
ath11k-$(CONFIG_THERMAL) += thermal.o

# for tracing framework to find trace.h
CFLAGS_trace.o := -I$(src)
Loading

0 comments on commit 5ef8c66

Please sign in to comment.