Merge tag 'wireless-next-2025-01-17' of git://git.kernel.org/pub/scm/linux/kernel/git/wireless/wireless-next
Kalle Valo says: ==================== wireless-next patches for v6.14 Most likely the last "new features" pull request for v6.14 and this is a bigger one. Multi-Link Operation (MLO) work continues both in stack in drivers. Few new devices supported and usual fixes all over. Major changes: cfg80211 * Emergency Preparedness Communication Services (EPCS) station mode support mac80211 * an option to filter a sta from being flushed * some support for RX Operating Mode Indication (OMI) power saving * support for adding and removing station links for MLO iwlwifi * new device ids * rework firmware error handling and restart rtw88 * RTL8812A: RFE type 2 support * LED support rtw89 * variant info to support RTL8922AE-VS mt76 * mt7996: single wiphy multiband support (preparation for MLO) * mt7996: support for more variants * mt792x: P2P_DEVICE support * mt7921u: TP-Link TXE50UH support ath12k * enable MLO for QCN9274 (although it seems to be broken with dual band devices) * MLO radar detection support * debugfs: transmit buffer OFDMA, AST entry and puncture stats * tag 'wireless-next-2025-01-17' of git://git.kernel.org/pub/scm/linux/kernel/git/wireless/wireless-next: (322 commits) wifi: brcmfmac: fix NULL pointer dereference in brcmf_txfinalize() wifi: rtw88: add RTW88_LEDS depends on LEDS_CLASS to Kconfig wifi: wilc1000: unregister wiphy only after netdev registration wifi: cfg80211: adjust allocation of colocated AP data wifi: mac80211: fix memory leak in ieee80211_mgd_assoc_ml_reconf() wifi: ath12k: fix key cache handling wifi: ath12k: Fix uninitialized variable access in ath12k_mac_allocate() function wifi: ath12k: Remove ath12k_get_num_hw() helper function wifi: ath12k: Refactor the ath12k_hw get helper function argument wifi: ath12k: Refactor ath12k_hw set helper function argument wifi: mt76: mt7996: add implicit beamforming support for mt7992 wifi: mt76: mt7996: fix beacon command during disabling wifi: mt76: mt7996: fix ldpc setting wifi: mt76: mt7996: fix definition of tx descriptor wifi: mt76: connac: adjust phy capabilities based on band constraints wifi: mt76: mt7996: fix incorrect indexing of MIB FW event wifi: mt76: mt7996: fix HE Phy capability wifi: mt76: mt7996: fix the capability of reception of EHT MU PPDU wifi: mt76: mt7996: add max mpdu len capability wifi: mt76: mt7921: avoid undesired changes of the preset regulatory domain ... ==================== Link: https://patch.msgid.link/20250117203529.72D45C4CEDD@smtp.kernel.org Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
@@ -0,0 +1,204 @@
|
||||
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
|
||||
# Copyright (c) 2024 Qualcomm Innovation Center, Inc. All rights reserved.
|
||||
%YAML 1.2
|
||||
---
|
||||
$id: http://devicetree.org/schemas/net/wireless/qcom,ath12k-wsi.yaml#
|
||||
$schema: http://devicetree.org/meta-schemas/core.yaml#
|
||||
|
||||
title: Qualcomm Technologies ath12k wireless devices (PCIe) with WSI interface
|
||||
|
||||
maintainers:
|
||||
- Jeff Johnson <jjohnson@kernel.org>
|
||||
- Kalle Valo <kvalo@kernel.org>
|
||||
|
||||
description: |
|
||||
Qualcomm Technologies IEEE 802.11be PCIe devices with WSI interface.
|
||||
|
||||
The ath12k devices (QCN9274) feature WSI support. WSI stands for
|
||||
WLAN Serial Interface. It is used for the exchange of specific
|
||||
control information across radios based on the doorbell mechanism.
|
||||
This WSI connection is essential to exchange control information
|
||||
among these devices.
|
||||
|
||||
The WSI interface includes TX and RX ports, which are used to connect
|
||||
multiple WSI-supported devices together, forming a WSI group.
|
||||
|
||||
Diagram to represent one WSI connection (one WSI group) among
|
||||
three devices.
|
||||
|
||||
+-------+ +-------+ +-------+
|
||||
| pcie1 | | pcie2 | | pcie3 |
|
||||
| | | | | |
|
||||
+----->| wsi |------->| wsi |------->| wsi |-----+
|
||||
| | grp 0 | | grp 0 | | grp 0 | |
|
||||
| +-------+ +-------+ +-------+ |
|
||||
+------------------------------------------------------+
|
||||
|
||||
Diagram to represent two WSI connections (two separate WSI groups)
|
||||
among four devices.
|
||||
|
||||
+-------+ +-------+ +-------+ +-------+
|
||||
| pcie0 | | pcie1 | | pcie2 | | pcie3 |
|
||||
| | | | | | | |
|
||||
+-->| wsi |--->| wsi |--+ +-->| wsi |--->| wsi |--+
|
||||
| | grp 0 | | grp 0 | | | | grp 1 | | grp 1 | |
|
||||
| +-------+ +-------+ | | +-------+ +-------+ |
|
||||
+---------------------------+ +---------------------------+
|
||||
|
||||
properties:
|
||||
compatible:
|
||||
enum:
|
||||
- pci17cb,1109 # QCN9274
|
||||
|
||||
reg:
|
||||
maxItems: 1
|
||||
|
||||
qcom,ath12k-calibration-variant:
|
||||
$ref: /schemas/types.yaml#/definitions/string
|
||||
description:
|
||||
String to uniquely identify variant of the calibration data for designs
|
||||
with colliding bus and device ids
|
||||
|
||||
qcom,wsi-controller:
|
||||
$ref: /schemas/types.yaml#/definitions/flag
|
||||
description:
|
||||
The WSI controller device in the WSI group aids (is capable) to
|
||||
synchronize the Timing Synchronization Function (TSF) clock across
|
||||
all devices in the WSI group.
|
||||
|
||||
ports:
|
||||
$ref: /schemas/graph.yaml#/properties/ports
|
||||
properties:
|
||||
port@0:
|
||||
$ref: /schemas/graph.yaml#/properties/port
|
||||
description:
|
||||
This is the TX port of WSI interface. It is attached to the RX
|
||||
port of the next device in the WSI connection.
|
||||
|
||||
port@1:
|
||||
$ref: /schemas/graph.yaml#/properties/port
|
||||
description:
|
||||
This is the RX port of WSI interface. It is attached to the TX
|
||||
port of the previous device in the WSI connection.
|
||||
|
||||
required:
|
||||
- compatible
|
||||
- reg
|
||||
|
||||
additionalProperties: false
|
||||
|
||||
examples:
|
||||
- |
|
||||
pcie {
|
||||
#address-cells = <3>;
|
||||
#size-cells = <2>;
|
||||
|
||||
pcie@0 {
|
||||
device_type = "pci";
|
||||
reg = <0x0 0x0 0x0 0x0 0x0>;
|
||||
#address-cells = <3>;
|
||||
#size-cells = <2>;
|
||||
ranges;
|
||||
|
||||
wifi@0 {
|
||||
compatible = "pci17cb,1109";
|
||||
reg = <0x0 0x0 0x0 0x0 0x0>;
|
||||
|
||||
qcom,ath12k-calibration-variant = "RDP433_1";
|
||||
|
||||
ports {
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
|
||||
port@0 {
|
||||
reg = <0>;
|
||||
|
||||
wifi1_wsi_tx: endpoint {
|
||||
remote-endpoint = <&wifi2_wsi_rx>;
|
||||
};
|
||||
};
|
||||
|
||||
port@1 {
|
||||
reg = <1>;
|
||||
|
||||
wifi1_wsi_rx: endpoint {
|
||||
remote-endpoint = <&wifi3_wsi_tx>;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
pcie@1 {
|
||||
device_type = "pci";
|
||||
reg = <0x0 0x0 0x1 0x0 0x0>;
|
||||
#address-cells = <3>;
|
||||
#size-cells = <2>;
|
||||
ranges;
|
||||
|
||||
wifi@0 {
|
||||
compatible = "pci17cb,1109";
|
||||
reg = <0x0 0x0 0x0 0x0 0x0>;
|
||||
|
||||
qcom,ath12k-calibration-variant = "RDP433_2";
|
||||
qcom,wsi-controller;
|
||||
|
||||
ports {
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
|
||||
port@0 {
|
||||
reg = <0>;
|
||||
|
||||
wifi2_wsi_tx: endpoint {
|
||||
remote-endpoint = <&wifi3_wsi_rx>;
|
||||
};
|
||||
};
|
||||
|
||||
port@1 {
|
||||
reg = <1>;
|
||||
|
||||
wifi2_wsi_rx: endpoint {
|
||||
remote-endpoint = <&wifi1_wsi_tx>;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
pcie@2 {
|
||||
device_type = "pci";
|
||||
reg = <0x0 0x0 0x2 0x0 0x0>;
|
||||
#address-cells = <3>;
|
||||
#size-cells = <2>;
|
||||
ranges;
|
||||
|
||||
wifi@0 {
|
||||
compatible = "pci17cb,1109";
|
||||
reg = <0x0 0x0 0x0 0x0 0x0>;
|
||||
|
||||
qcom,ath12k-calibration-variant = "RDP433_3";
|
||||
|
||||
ports {
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
|
||||
port@0 {
|
||||
reg = <0>;
|
||||
|
||||
wifi3_wsi_tx: endpoint {
|
||||
remote-endpoint = <&wifi1_wsi_rx>;
|
||||
};
|
||||
};
|
||||
|
||||
port@1 {
|
||||
reg = <1>;
|
||||
|
||||
wifi3_wsi_rx: endpoint {
|
||||
remote-endpoint = <&wifi2_wsi_tx>;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
@@ -1,7 +1,7 @@
|
||||
// SPDX-License-Identifier: BSD-3-Clause-Clear
|
||||
/*
|
||||
* Copyright (c) 2018-2021 The Linux Foundation. All rights reserved.
|
||||
* Copyright (c) 2021-2024 Qualcomm Innovation Center, Inc. All rights reserved.
|
||||
* Copyright (c) 2021-2025 Qualcomm Innovation Center, Inc. All rights reserved.
|
||||
*/
|
||||
|
||||
#include <linux/module.h>
|
||||
@@ -9,6 +9,7 @@
|
||||
#include <linux/remoteproc.h>
|
||||
#include <linux/firmware.h>
|
||||
#include <linux/of.h>
|
||||
#include <linux/of_graph.h>
|
||||
#include "core.h"
|
||||
#include "dp_tx.h"
|
||||
#include "dp_rx.h"
|
||||
@@ -886,6 +887,73 @@ static void ath12k_core_hw_group_stop(struct ath12k_hw_group *ag)
|
||||
ath12k_mac_destroy(ag);
|
||||
}
|
||||
|
||||
static int __ath12k_mac_mlo_ready(struct ath12k *ar)
|
||||
{
|
||||
int ret;
|
||||
|
||||
ret = ath12k_wmi_mlo_ready(ar);
|
||||
if (ret) {
|
||||
ath12k_err(ar->ab, "MLO ready failed for pdev %d: %d\n",
|
||||
ar->pdev_idx, ret);
|
||||
return ret;
|
||||
}
|
||||
|
||||
ath12k_dbg(ar->ab, ATH12K_DBG_MAC, "mlo ready done for pdev %d\n",
|
||||
ar->pdev_idx);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int ath12k_mac_mlo_ready(struct ath12k_hw_group *ag)
|
||||
{
|
||||
struct ath12k_hw *ah;
|
||||
struct ath12k *ar;
|
||||
int ret;
|
||||
int i, j;
|
||||
|
||||
for (i = 0; i < ag->num_hw; i++) {
|
||||
ah = ag->ah[i];
|
||||
if (!ah)
|
||||
continue;
|
||||
|
||||
for_each_ar(ah, ar, j) {
|
||||
ar = &ah->radio[j];
|
||||
ret = __ath12k_mac_mlo_ready(ar);
|
||||
if (ret)
|
||||
goto out;
|
||||
}
|
||||
}
|
||||
|
||||
out:
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int ath12k_core_mlo_setup(struct ath12k_hw_group *ag)
|
||||
{
|
||||
int ret, i;
|
||||
|
||||
if (!ag->mlo_capable || ag->num_devices == 1)
|
||||
return 0;
|
||||
|
||||
ret = ath12k_mac_mlo_setup(ag);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
for (i = 0; i < ag->num_devices; i++)
|
||||
ath12k_dp_partner_cc_init(ag->ab[i]);
|
||||
|
||||
ret = ath12k_mac_mlo_ready(ag);
|
||||
if (ret)
|
||||
goto err_mlo_teardown;
|
||||
|
||||
return 0;
|
||||
|
||||
err_mlo_teardown:
|
||||
ath12k_mac_mlo_teardown(ag);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int ath12k_core_hw_group_start(struct ath12k_hw_group *ag)
|
||||
{
|
||||
struct ath12k_base *ab;
|
||||
@@ -900,10 +968,14 @@ static int ath12k_core_hw_group_start(struct ath12k_hw_group *ag)
|
||||
if (WARN_ON(ret))
|
||||
return ret;
|
||||
|
||||
ret = ath12k_mac_register(ag);
|
||||
ret = ath12k_core_mlo_setup(ag);
|
||||
if (WARN_ON(ret))
|
||||
goto err_mac_destroy;
|
||||
|
||||
ret = ath12k_mac_register(ag);
|
||||
if (WARN_ON(ret))
|
||||
goto err_mlo_teardown;
|
||||
|
||||
set_bit(ATH12K_GROUP_FLAG_REGISTERED, &ag->flags);
|
||||
|
||||
core_pdev_create:
|
||||
@@ -938,6 +1010,9 @@ err:
|
||||
ath12k_core_hw_group_stop(ag);
|
||||
return ret;
|
||||
|
||||
err_mlo_teardown:
|
||||
ath12k_mac_mlo_teardown(ag);
|
||||
|
||||
err_mac_destroy:
|
||||
ath12k_mac_destroy(ag);
|
||||
|
||||
@@ -1098,6 +1173,7 @@ err_hal_srng_deinit:
|
||||
static void ath12k_rfkill_work(struct work_struct *work)
|
||||
{
|
||||
struct ath12k_base *ab = container_of(work, struct ath12k_base, rfkill_work);
|
||||
struct ath12k_hw_group *ag = ab->ag;
|
||||
struct ath12k *ar;
|
||||
struct ath12k_hw *ah;
|
||||
struct ieee80211_hw *hw;
|
||||
@@ -1108,8 +1184,8 @@ static void ath12k_rfkill_work(struct work_struct *work)
|
||||
rfkill_radio_on = ab->rfkill_radio_on;
|
||||
spin_unlock_bh(&ab->base_lock);
|
||||
|
||||
for (i = 0; i < ath12k_get_num_hw(ab); i++) {
|
||||
ah = ath12k_ab_to_ah(ab, i);
|
||||
for (i = 0; i < ag->num_hw; i++) {
|
||||
ah = ath12k_ag_to_ah(ag, i);
|
||||
if (!ah)
|
||||
continue;
|
||||
|
||||
@@ -1149,6 +1225,7 @@ void ath12k_core_halt(struct ath12k *ar)
|
||||
|
||||
static void ath12k_core_pre_reconfigure_recovery(struct ath12k_base *ab)
|
||||
{
|
||||
struct ath12k_hw_group *ag = ab->ag;
|
||||
struct ath12k *ar;
|
||||
struct ath12k_hw *ah;
|
||||
int i, j;
|
||||
@@ -1160,8 +1237,8 @@ static void ath12k_core_pre_reconfigure_recovery(struct ath12k_base *ab)
|
||||
if (ab->is_reset)
|
||||
set_bit(ATH12K_FLAG_CRASH_FLUSH, &ab->dev_flags);
|
||||
|
||||
for (i = 0; i < ath12k_get_num_hw(ab); i++) {
|
||||
ah = ath12k_ab_to_ah(ab, i);
|
||||
for (i = 0; i < ag->num_hw; i++) {
|
||||
ah = ath12k_ag_to_ah(ag, i);
|
||||
if (!ah || ah->state == ATH12K_HW_STATE_OFF)
|
||||
continue;
|
||||
|
||||
@@ -1195,12 +1272,13 @@ static void ath12k_core_pre_reconfigure_recovery(struct ath12k_base *ab)
|
||||
|
||||
static void ath12k_core_post_reconfigure_recovery(struct ath12k_base *ab)
|
||||
{
|
||||
struct ath12k_hw_group *ag = ab->ag;
|
||||
struct ath12k_hw *ah;
|
||||
struct ath12k *ar;
|
||||
int i, j;
|
||||
|
||||
for (i = 0; i < ath12k_get_num_hw(ab); i++) {
|
||||
ah = ath12k_ab_to_ah(ab, i);
|
||||
for (i = 0; i < ag->num_hw; i++) {
|
||||
ah = ath12k_ag_to_ah(ag, i);
|
||||
if (!ah || ah->state == ATH12K_HW_STATE_OFF)
|
||||
continue;
|
||||
|
||||
@@ -1243,6 +1321,7 @@ static void ath12k_core_post_reconfigure_recovery(struct ath12k_base *ab)
|
||||
static void ath12k_core_restart(struct work_struct *work)
|
||||
{
|
||||
struct ath12k_base *ab = container_of(work, struct ath12k_base, restart_work);
|
||||
struct ath12k_hw_group *ag = ab->ag;
|
||||
struct ath12k_hw *ah;
|
||||
int ret, i;
|
||||
|
||||
@@ -1261,8 +1340,8 @@ static void ath12k_core_restart(struct work_struct *work)
|
||||
ath12k_dbg(ab, ATH12K_DBG_BOOT, "reset success\n");
|
||||
}
|
||||
|
||||
for (i = 0; i < ath12k_get_num_hw(ab); i++) {
|
||||
ah = ath12k_ab_to_ah(ab, i);
|
||||
for (i = 0; i < ag->num_hw; i++) {
|
||||
ah = ath12k_ag_to_ah(ab->ag, i);
|
||||
ieee80211_restart_hw(ah->hw);
|
||||
}
|
||||
}
|
||||
@@ -1383,20 +1462,24 @@ bool ath12k_core_hw_group_create_ready(struct ath12k_hw_group *ag)
|
||||
return (ag->num_probed == ag->num_devices);
|
||||
}
|
||||
|
||||
static struct ath12k_hw_group *ath12k_core_hw_group_alloc(u8 id, u8 max_devices)
|
||||
static struct ath12k_hw_group *ath12k_core_hw_group_alloc(struct ath12k_base *ab)
|
||||
{
|
||||
struct ath12k_hw_group *ag;
|
||||
int count = 0;
|
||||
|
||||
lockdep_assert_held(&ath12k_hw_group_mutex);
|
||||
|
||||
list_for_each_entry(ag, &ath12k_hw_group_list, list)
|
||||
count++;
|
||||
|
||||
ag = kzalloc(sizeof(*ag), GFP_KERNEL);
|
||||
if (!ag)
|
||||
return NULL;
|
||||
|
||||
ag->id = id;
|
||||
ag->num_devices = max_devices;
|
||||
ag->id = count;
|
||||
list_add(&ag->list, &ath12k_hw_group_list);
|
||||
mutex_init(&ag->mutex);
|
||||
ag->mlo_capable = false;
|
||||
|
||||
return ag;
|
||||
}
|
||||
@@ -1411,35 +1494,180 @@ static void ath12k_core_hw_group_free(struct ath12k_hw_group *ag)
|
||||
mutex_unlock(&ath12k_hw_group_mutex);
|
||||
}
|
||||
|
||||
static struct ath12k_hw_group *ath12k_core_hw_group_find_by_dt(struct ath12k_base *ab)
|
||||
{
|
||||
struct ath12k_hw_group *ag;
|
||||
int i;
|
||||
|
||||
if (!ab->dev->of_node)
|
||||
return NULL;
|
||||
|
||||
list_for_each_entry(ag, &ath12k_hw_group_list, list)
|
||||
for (i = 0; i < ag->num_devices; i++)
|
||||
if (ag->wsi_node[i] == ab->dev->of_node)
|
||||
return ag;
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static int ath12k_core_get_wsi_info(struct ath12k_hw_group *ag,
|
||||
struct ath12k_base *ab)
|
||||
{
|
||||
struct device_node *wsi_dev = ab->dev->of_node, *next_wsi_dev;
|
||||
struct device_node *tx_endpoint, *next_rx_endpoint;
|
||||
int device_count = 0;
|
||||
|
||||
next_wsi_dev = wsi_dev;
|
||||
|
||||
if (!next_wsi_dev)
|
||||
return -ENODEV;
|
||||
|
||||
do {
|
||||
ag->wsi_node[device_count] = next_wsi_dev;
|
||||
|
||||
tx_endpoint = of_graph_get_endpoint_by_regs(next_wsi_dev, 0, -1);
|
||||
if (!tx_endpoint) {
|
||||
of_node_put(next_wsi_dev);
|
||||
return -ENODEV;
|
||||
}
|
||||
|
||||
next_rx_endpoint = of_graph_get_remote_endpoint(tx_endpoint);
|
||||
if (!next_rx_endpoint) {
|
||||
of_node_put(next_wsi_dev);
|
||||
of_node_put(tx_endpoint);
|
||||
return -ENODEV;
|
||||
}
|
||||
|
||||
of_node_put(tx_endpoint);
|
||||
of_node_put(next_wsi_dev);
|
||||
|
||||
next_wsi_dev = of_graph_get_port_parent(next_rx_endpoint);
|
||||
if (!next_wsi_dev) {
|
||||
of_node_put(next_rx_endpoint);
|
||||
return -ENODEV;
|
||||
}
|
||||
|
||||
of_node_put(next_rx_endpoint);
|
||||
|
||||
device_count++;
|
||||
if (device_count > ATH12K_MAX_SOCS) {
|
||||
ath12k_warn(ab, "device count in DT %d is more than limit %d\n",
|
||||
device_count, ATH12K_MAX_SOCS);
|
||||
of_node_put(next_wsi_dev);
|
||||
return -EINVAL;
|
||||
}
|
||||
} while (wsi_dev != next_wsi_dev);
|
||||
|
||||
of_node_put(next_wsi_dev);
|
||||
ag->num_devices = device_count;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int ath12k_core_get_wsi_index(struct ath12k_hw_group *ag,
|
||||
struct ath12k_base *ab)
|
||||
{
|
||||
int i, wsi_controller_index = -1, node_index = -1;
|
||||
bool control;
|
||||
|
||||
for (i = 0; i < ag->num_devices; i++) {
|
||||
control = of_property_read_bool(ag->wsi_node[i], "qcom,wsi-controller");
|
||||
if (control)
|
||||
wsi_controller_index = i;
|
||||
|
||||
if (ag->wsi_node[i] == ab->dev->of_node)
|
||||
node_index = i;
|
||||
}
|
||||
|
||||
if (wsi_controller_index == -1) {
|
||||
ath12k_dbg(ab, ATH12K_DBG_BOOT, "wsi controller is not defined in dt");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
if (node_index == -1) {
|
||||
ath12k_dbg(ab, ATH12K_DBG_BOOT, "unable to get WSI node index");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
ab->wsi_info.index = (ag->num_devices + node_index - wsi_controller_index) %
|
||||
ag->num_devices;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static struct ath12k_hw_group *ath12k_core_hw_group_assign(struct ath12k_base *ab)
|
||||
{
|
||||
u32 group_id = ATH12K_INVALID_GROUP_ID;
|
||||
struct ath12k_wsi_info *wsi = &ab->wsi_info;
|
||||
struct ath12k_hw_group *ag;
|
||||
|
||||
lockdep_assert_held(&ath12k_hw_group_mutex);
|
||||
|
||||
/* The grouping of multiple devices will be done based on device tree file.
|
||||
* TODO: device tree file parsing to know about the devices involved in group.
|
||||
* The platforms that do not have any valid group information would have
|
||||
* each device to be part of its own invalid group.
|
||||
*
|
||||
* The platforms that do not have any valid group information would have each
|
||||
* device to be part of its own invalid group.
|
||||
*
|
||||
* Currently, we are not parsing any device tree information and hence, grouping
|
||||
* of multiple devices is not involved. Thus, single device is added to device
|
||||
* group.
|
||||
* We use group id ATH12K_INVALID_GROUP_ID for single device group
|
||||
* which didn't have dt entry or wrong dt entry, there could be many
|
||||
* groups with same group id, i.e ATH12K_INVALID_GROUP_ID. So
|
||||
* default group id of ATH12K_INVALID_GROUP_ID combined with
|
||||
* num devices in ath12k_hw_group determines if the group is
|
||||
* multi device or single device group
|
||||
*/
|
||||
ag = ath12k_core_hw_group_alloc(group_id, 1);
|
||||
|
||||
ag = ath12k_core_hw_group_find_by_dt(ab);
|
||||
if (!ag) {
|
||||
ag = ath12k_core_hw_group_alloc(ab);
|
||||
if (!ag) {
|
||||
ath12k_warn(ab, "unable to create new hw group\n");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (ath12k_core_get_wsi_info(ag, ab) ||
|
||||
ath12k_core_get_wsi_index(ag, ab)) {
|
||||
ath12k_dbg(ab, ATH12K_DBG_BOOT,
|
||||
"unable to get wsi info from dt, grouping single device");
|
||||
ag->id = ATH12K_INVALID_GROUP_ID;
|
||||
ag->num_devices = 1;
|
||||
memset(ag->wsi_node, 0, sizeof(ag->wsi_node));
|
||||
wsi->index = 0;
|
||||
}
|
||||
|
||||
goto exit;
|
||||
} else if (test_bit(ATH12K_GROUP_FLAG_UNREGISTER, &ag->flags)) {
|
||||
ath12k_dbg(ab, ATH12K_DBG_BOOT, "group id %d in unregister state\n",
|
||||
ag->id);
|
||||
goto invalid_group;
|
||||
} else {
|
||||
if (ath12k_core_get_wsi_index(ag, ab))
|
||||
goto invalid_group;
|
||||
goto exit;
|
||||
}
|
||||
|
||||
invalid_group:
|
||||
ag = ath12k_core_hw_group_alloc(ab);
|
||||
if (!ag) {
|
||||
ath12k_warn(ab, "unable to create new hw group\n");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
ag->id = ATH12K_INVALID_GROUP_ID;
|
||||
ag->num_devices = 1;
|
||||
wsi->index = 0;
|
||||
|
||||
ath12k_dbg(ab, ATH12K_DBG_BOOT, "single device added to hardware group\n");
|
||||
|
||||
exit:
|
||||
if (ag->num_probed >= ag->num_devices) {
|
||||
ath12k_warn(ab, "unable to add new device to group, max limit reached\n");
|
||||
goto invalid_group;
|
||||
}
|
||||
|
||||
ab->device_id = ag->num_probed++;
|
||||
ag->ab[ab->device_id] = ab;
|
||||
ab->ag = ag;
|
||||
ag->mlo_capable = false;
|
||||
|
||||
ath12k_dbg(ab, ATH12K_DBG_BOOT, "wsi group-id %d num-devices %d index %d",
|
||||
ag->id, ag->num_devices, wsi->index);
|
||||
|
||||
return ag;
|
||||
}
|
||||
@@ -1507,6 +1735,13 @@ static void ath12k_core_hw_group_cleanup(struct ath12k_hw_group *ag)
|
||||
|
||||
mutex_lock(&ag->mutex);
|
||||
|
||||
if (test_bit(ATH12K_GROUP_FLAG_UNREGISTER, &ag->flags)) {
|
||||
mutex_unlock(&ag->mutex);
|
||||
return;
|
||||
}
|
||||
|
||||
set_bit(ATH12K_GROUP_FLAG_UNREGISTER, &ag->flags);
|
||||
|
||||
ath12k_core_hw_group_stop(ag);
|
||||
|
||||
for (i = 0; i < ag->num_devices; i++) {
|
||||
@@ -1551,6 +1786,9 @@ static int ath12k_core_hw_group_create(struct ath12k_hw_group *ag)
|
||||
|
||||
void ath12k_core_hw_group_set_mlo_capable(struct ath12k_hw_group *ag)
|
||||
{
|
||||
struct ath12k_base *ab;
|
||||
int i;
|
||||
|
||||
lockdep_assert_held(&ag->mutex);
|
||||
|
||||
/* If more than one devices are grouped, then inter MLO
|
||||
@@ -1559,10 +1797,35 @@ void ath12k_core_hw_group_set_mlo_capable(struct ath12k_hw_group *ag)
|
||||
* Only when there is one device, then it depends whether the
|
||||
* device can support intra chip MLO or not
|
||||
*/
|
||||
if (ag->num_devices > 1)
|
||||
if (ag->num_devices > 1) {
|
||||
ag->mlo_capable = true;
|
||||
else
|
||||
ag->mlo_capable = ag->ab[0]->single_chip_mlo_supp;
|
||||
} else {
|
||||
ab = ag->ab[0];
|
||||
ag->mlo_capable = ab->single_chip_mlo_supp;
|
||||
|
||||
/* WCN chipsets does not advertise in firmware features
|
||||
* hence skip checking
|
||||
*/
|
||||
if (ab->hw_params->def_num_link)
|
||||
return;
|
||||
}
|
||||
|
||||
if (!ag->mlo_capable)
|
||||
return;
|
||||
|
||||
for (i = 0; i < ag->num_devices; i++) {
|
||||
ab = ag->ab[i];
|
||||
if (!ab)
|
||||
continue;
|
||||
|
||||
/* even if 1 device's firmware feature indicates MLO
|
||||
* unsupported, make MLO unsupported for the whole group
|
||||
*/
|
||||
if (!test_bit(ATH12K_FW_FEATURE_MLO, ab->fw.fw_features)) {
|
||||
ag->mlo_capable = false;
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
int ath12k_core_init(struct ath12k_base *ab)
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/* SPDX-License-Identifier: BSD-3-Clause-Clear */
|
||||
/*
|
||||
* Copyright (c) 2018-2021 The Linux Foundation. All rights reserved.
|
||||
* Copyright (c) 2021-2024 Qualcomm Innovation Center, Inc. All rights reserved.
|
||||
* Copyright (c) 2021-2025 Qualcomm Innovation Center, Inc. All rights reserved.
|
||||
*/
|
||||
|
||||
#ifndef ATH12K_CORE_H
|
||||
@@ -136,7 +136,7 @@ struct ath12k_skb_rxcb {
|
||||
struct hal_rx_desc *rx_desc;
|
||||
u8 err_rel_src;
|
||||
u8 err_code;
|
||||
u8 mac_id;
|
||||
u8 hw_link_id;
|
||||
u8 unmapped;
|
||||
u8 is_frag;
|
||||
u8 tid;
|
||||
@@ -219,10 +219,11 @@ enum ath12k_scan_state {
|
||||
|
||||
enum ath12k_hw_group_flags {
|
||||
ATH12K_GROUP_FLAG_REGISTERED,
|
||||
ATH12K_GROUP_FLAG_UNREGISTER,
|
||||
};
|
||||
|
||||
enum ath12k_dev_flags {
|
||||
ATH12K_CAC_RUNNING,
|
||||
ATH12K_FLAG_CAC_RUNNING,
|
||||
ATH12K_FLAG_CRASH_FLUSH,
|
||||
ATH12K_FLAG_RAW_MODE,
|
||||
ATH12K_FLAG_HW_CRYPTO_DISABLED,
|
||||
@@ -380,10 +381,6 @@ struct ath12k_rx_peer_stats {
|
||||
u64 non_ampdu_msdu_count;
|
||||
u64 stbc_count;
|
||||
u64 beamformed_count;
|
||||
u64 mcs_count[HAL_RX_MAX_MCS + 1];
|
||||
u64 nss_count[HAL_RX_MAX_NSS];
|
||||
u64 bw_count[HAL_RX_BW_MAX];
|
||||
u64 gi_count[HAL_RX_GI_MAX];
|
||||
u64 coding_count[HAL_RX_SU_MU_CODING_MAX];
|
||||
u64 tid_count[IEEE80211_NUM_TIDS + 1];
|
||||
u64 pream_cnt[HAL_RX_PREAMBLE_MAX];
|
||||
@@ -602,9 +599,10 @@ struct ath12k {
|
||||
struct delayed_work timeout;
|
||||
enum ath12k_scan_state state;
|
||||
bool is_roc;
|
||||
int vdev_id;
|
||||
int roc_freq;
|
||||
bool roc_notify;
|
||||
struct wiphy_work vdev_clean_wk;
|
||||
struct ath12k_link_vif *arvif;
|
||||
} scan;
|
||||
|
||||
struct {
|
||||
@@ -710,10 +708,12 @@ struct ath12k {
|
||||
bool monitor_started;
|
||||
int monitor_vdev_id;
|
||||
|
||||
u32 freq_low;
|
||||
u32 freq_high;
|
||||
struct wiphy_radio_freq_range freq_range;
|
||||
|
||||
bool nlo_enabled;
|
||||
|
||||
struct completion mlo_setup_done;
|
||||
u32 mlo_setup_status;
|
||||
};
|
||||
|
||||
struct ath12k_hw {
|
||||
@@ -769,6 +769,8 @@ struct ath12k_pdev_cap {
|
||||
u32 tx_chain_mask_shift;
|
||||
u32 rx_chain_mask_shift;
|
||||
struct ath12k_band_cap band[NUM_NL80211_BANDS];
|
||||
u32 eml_cap;
|
||||
u32 mld_cap;
|
||||
};
|
||||
|
||||
struct mlo_timestamp {
|
||||
@@ -821,6 +823,17 @@ struct ath12k_soc_dp_stats {
|
||||
struct ath12k_soc_dp_tx_err_stats tx_err;
|
||||
};
|
||||
|
||||
struct ath12k_mlo_memory {
|
||||
struct target_mem_chunk chunk[ATH12K_QMI_WLANFW_MAX_NUM_MEM_SEG_V01];
|
||||
int mlo_mem_size;
|
||||
bool init_done;
|
||||
};
|
||||
|
||||
struct ath12k_hw_link {
|
||||
u8 device_id;
|
||||
u8 pdev_idx;
|
||||
};
|
||||
|
||||
/* Holds info on the group of devices that are registered as a single
|
||||
* wiphy, protected with struct ath12k_hw_group::mutex.
|
||||
*/
|
||||
@@ -845,6 +858,16 @@ struct ath12k_hw_group {
|
||||
struct ath12k_hw *ah[ATH12K_GROUP_MAX_RADIO];
|
||||
u8 num_hw;
|
||||
bool mlo_capable;
|
||||
struct device_node *wsi_node[ATH12K_MAX_SOCS];
|
||||
struct ath12k_mlo_memory mlo_mem;
|
||||
struct ath12k_hw_link hw_links[ATH12K_GROUP_MAX_RADIO];
|
||||
bool hw_link_id_init_done;
|
||||
};
|
||||
|
||||
/* Holds WSI info specific to each device, excluding WSI group info */
|
||||
struct ath12k_wsi_info {
|
||||
u32 index;
|
||||
u32 hw_link_id_base;
|
||||
};
|
||||
|
||||
/* Master structure to hold the hw data which may be used in core module */
|
||||
@@ -1028,6 +1051,7 @@ struct ath12k_base {
|
||||
struct notifier_block panic_nb;
|
||||
|
||||
struct ath12k_hw_group *ag;
|
||||
struct ath12k_wsi_info wsi_info;
|
||||
|
||||
/* must be last */
|
||||
u8 drv_priv[] __aligned(sizeof(void *));
|
||||
@@ -1170,20 +1194,15 @@ static inline struct ieee80211_hw *ath12k_ar_to_hw(struct ath12k *ar)
|
||||
for ((index) = 0; ((index) < (ah)->num_radio && \
|
||||
((ar) = &(ah)->radio[(index)])); (index)++)
|
||||
|
||||
static inline struct ath12k_hw *ath12k_ab_to_ah(struct ath12k_base *ab, int idx)
|
||||
static inline struct ath12k_hw *ath12k_ag_to_ah(struct ath12k_hw_group *ag, int idx)
|
||||
{
|
||||
return ab->ag->ah[idx];
|
||||
return ag->ah[idx];
|
||||
}
|
||||
|
||||
static inline void ath12k_ab_set_ah(struct ath12k_base *ab, int idx,
|
||||
static inline void ath12k_ag_set_ah(struct ath12k_hw_group *ag, int idx,
|
||||
struct ath12k_hw *ah)
|
||||
{
|
||||
ab->ag->ah[idx] = ah;
|
||||
}
|
||||
|
||||
static inline int ath12k_get_num_hw(struct ath12k_base *ab)
|
||||
{
|
||||
return ab->ag->num_hw;
|
||||
ag->ah[idx] = ah;
|
||||
}
|
||||
|
||||
static inline struct ath12k_hw_group *ath12k_ab_to_ag(struct ath12k_base *ab)
|
||||
@@ -1205,4 +1224,10 @@ static inline void ath12k_core_stopped(struct ath12k_base *ab)
|
||||
ab->ag->num_started--;
|
||||
}
|
||||
|
||||
static inline struct ath12k_base *ath12k_ag_to_ab(struct ath12k_hw_group *ag,
|
||||
u8 device_id)
|
||||
{
|
||||
return ag->ab[device_id];
|
||||
}
|
||||
|
||||
#endif /* _CORE_H_ */
|
||||
|
||||
@@ -27,6 +27,9 @@ ath12k_fw_crash_dump_type ath12k_coredump_get_dump_type(enum ath12k_qmi_target_m
|
||||
case CALDB_MEM_REGION_TYPE:
|
||||
dump_type = FW_CRASH_DUMP_NONE;
|
||||
break;
|
||||
case MLO_GLOBAL_MEM_REGION_TYPE:
|
||||
dump_type = FW_CRASH_DUMP_MLO_GLOBAL_DATA;
|
||||
break;
|
||||
default:
|
||||
dump_type = FW_CRASH_DUMP_TYPE_MAX;
|
||||
break;
|
||||
|
||||
@@ -15,6 +15,7 @@ enum ath12k_fw_crash_dump_type {
|
||||
FW_CRASH_DUMP_PAGEABLE_DATA,
|
||||
FW_CRASH_DUMP_M3_DUMP,
|
||||
FW_CRASH_DUMP_NONE,
|
||||
FW_CRASH_DUMP_MLO_GLOBAL_DATA,
|
||||
|
||||
/* keep last */
|
||||
FW_CRASH_DUMP_TYPE_MAX,
|
||||
|
||||
@@ -2576,6 +2576,332 @@ ath12k_htt_print_pdev_obss_pd_stats_tlv(const void *tag_buf, u16 tag_len,
|
||||
stats_req->buf_len = len;
|
||||
}
|
||||
|
||||
static void
|
||||
ath12k_htt_print_pdev_tx_rate_txbf_stats_tlv(const void *tag_buf, u16 tag_len,
|
||||
struct debug_htt_stats_req *stats_req)
|
||||
{
|
||||
const struct ath12k_htt_pdev_txrate_txbf_stats_tlv *htt_stats_buf = tag_buf;
|
||||
u32 buf_len = ATH12K_HTT_STATS_BUF_SIZE;
|
||||
u32 len = stats_req->buf_len;
|
||||
u8 *buf = stats_req->buf;
|
||||
u8 i;
|
||||
|
||||
if (tag_len < sizeof(*htt_stats_buf))
|
||||
return;
|
||||
|
||||
len += scnprintf(buf + len, buf_len - len,
|
||||
"HTT_STATS_PDEV_TX_RATE_TXBF_STATS:\n");
|
||||
len += scnprintf(buf + len, buf_len - len, "Legacy OFDM Rates: 6 Mbps: %u, ",
|
||||
le32_to_cpu(htt_stats_buf->tx_legacy_ofdm_rate[0]));
|
||||
len += scnprintf(buf + len, buf_len - len, "9 Mbps: %u, 12 Mbps: %u, ",
|
||||
le32_to_cpu(htt_stats_buf->tx_legacy_ofdm_rate[1]),
|
||||
le32_to_cpu(htt_stats_buf->tx_legacy_ofdm_rate[2]));
|
||||
len += scnprintf(buf + len, buf_len - len, "18 Mbps: %u\n",
|
||||
le32_to_cpu(htt_stats_buf->tx_legacy_ofdm_rate[3]));
|
||||
len += scnprintf(buf + len, buf_len - len, "24 Mbps: %u, 36 Mbps: %u, ",
|
||||
le32_to_cpu(htt_stats_buf->tx_legacy_ofdm_rate[4]),
|
||||
le32_to_cpu(htt_stats_buf->tx_legacy_ofdm_rate[5]));
|
||||
len += scnprintf(buf + len, buf_len - len, "48 Mbps: %u, 54 Mbps: %u\n",
|
||||
le32_to_cpu(htt_stats_buf->tx_legacy_ofdm_rate[6]),
|
||||
le32_to_cpu(htt_stats_buf->tx_legacy_ofdm_rate[7]));
|
||||
|
||||
len += print_array_to_buf(buf, len, "tx_ol_mcs", htt_stats_buf->tx_su_ol_mcs,
|
||||
ATH12K_HTT_TX_BF_RATE_STATS_NUM_MCS_COUNTERS, "\n");
|
||||
len += print_array_to_buf(buf, len, "tx_ibf_mcs", htt_stats_buf->tx_su_ibf_mcs,
|
||||
ATH12K_HTT_TX_BF_RATE_STATS_NUM_MCS_COUNTERS, "\n");
|
||||
len += print_array_to_buf(buf, len, "tx_txbf_mcs", htt_stats_buf->tx_su_txbf_mcs,
|
||||
ATH12K_HTT_TX_BF_RATE_STATS_NUM_MCS_COUNTERS, "\n");
|
||||
len += print_array_to_buf_index(buf, len, "tx_ol_nss", 1,
|
||||
htt_stats_buf->tx_su_ol_nss,
|
||||
ATH12K_HTT_TX_PDEV_STATS_NUM_SPATIAL_STREAMS,
|
||||
"\n");
|
||||
len += print_array_to_buf_index(buf, len, "tx_ibf_nss", 1,
|
||||
htt_stats_buf->tx_su_ibf_nss,
|
||||
ATH12K_HTT_TX_PDEV_STATS_NUM_SPATIAL_STREAMS,
|
||||
"\n");
|
||||
len += print_array_to_buf_index(buf, len, "tx_txbf_nss", 1,
|
||||
htt_stats_buf->tx_su_txbf_nss,
|
||||
ATH12K_HTT_TX_PDEV_STATS_NUM_SPATIAL_STREAMS,
|
||||
"\n");
|
||||
len += print_array_to_buf(buf, len, "tx_ol_bw", htt_stats_buf->tx_su_ol_bw,
|
||||
ATH12K_HTT_TXBF_NUM_BW_CNTRS, "\n");
|
||||
for (i = 0; i < ATH12K_HTT_TXBF_NUM_REDUCED_CHAN_TYPES; i++)
|
||||
len += print_array_to_buf(buf, len, i ? "quarter_tx_ol_bw" :
|
||||
"half_tx_ol_bw",
|
||||
htt_stats_buf->ol[i],
|
||||
ATH12K_HTT_TXBF_NUM_BW_CNTRS,
|
||||
"\n");
|
||||
|
||||
len += print_array_to_buf(buf, len, "tx_ibf_bw", htt_stats_buf->tx_su_ibf_bw,
|
||||
ATH12K_HTT_TXBF_NUM_BW_CNTRS, "\n");
|
||||
for (i = 0; i < ATH12K_HTT_TXBF_NUM_REDUCED_CHAN_TYPES; i++)
|
||||
len += print_array_to_buf(buf, len, i ? "quarter_tx_ibf_bw" :
|
||||
"half_tx_ibf_bw",
|
||||
htt_stats_buf->ibf[i],
|
||||
ATH12K_HTT_TXBF_NUM_BW_CNTRS,
|
||||
"\n");
|
||||
|
||||
len += print_array_to_buf(buf, len, "tx_txbf_bw", htt_stats_buf->tx_su_txbf_bw,
|
||||
ATH12K_HTT_TXBF_NUM_BW_CNTRS, "\n");
|
||||
for (i = 0; i < ATH12K_HTT_TXBF_NUM_REDUCED_CHAN_TYPES; i++)
|
||||
len += print_array_to_buf(buf, len, i ? "quarter_tx_txbf_bw" :
|
||||
"half_tx_txbf_bw",
|
||||
htt_stats_buf->txbf[i],
|
||||
ATH12K_HTT_TXBF_NUM_BW_CNTRS,
|
||||
"\n");
|
||||
len += scnprintf(buf + len, buf_len - len, "\n");
|
||||
|
||||
len += scnprintf(buf + len, buf_len - len,
|
||||
"HTT_STATS_PDEV_TXBF_FLAG_RETURN_STATS:\n");
|
||||
len += scnprintf(buf + len, buf_len - len, "TXBF_reason_code_stats: 0:%u, 1:%u,",
|
||||
le32_to_cpu(htt_stats_buf->txbf_flag_set_mu_mode),
|
||||
le32_to_cpu(htt_stats_buf->txbf_flag_set_final_status));
|
||||
len += scnprintf(buf + len, buf_len - len, " 2:%u, 3:%u, 4:%u, 5:%u, ",
|
||||
le32_to_cpu(htt_stats_buf->txbf_flag_not_set_verified_txbf_mode),
|
||||
le32_to_cpu(htt_stats_buf->txbf_flag_not_set_disable_p2p_access),
|
||||
le32_to_cpu(htt_stats_buf->txbf_flag_not_set_max_nss_in_he160),
|
||||
le32_to_cpu(htt_stats_buf->txbf_flag_not_set_disable_uldlofdma));
|
||||
len += scnprintf(buf + len, buf_len - len, "6:%u, 7:%u\n\n",
|
||||
le32_to_cpu(htt_stats_buf->txbf_flag_not_set_mcs_threshold_val),
|
||||
le32_to_cpu(htt_stats_buf->txbf_flag_not_set_final_status));
|
||||
|
||||
stats_req->buf_len = len;
|
||||
}
|
||||
|
||||
static void
|
||||
ath12k_htt_print_txbf_ofdma_ax_ndpa_stats_tlv(const void *tag_buf, u16 tag_len,
|
||||
struct debug_htt_stats_req *stats_req)
|
||||
{
|
||||
const struct ath12k_htt_txbf_ofdma_ax_ndpa_stats_tlv *stats_buf = tag_buf;
|
||||
u32 buf_len = ATH12K_HTT_STATS_BUF_SIZE;
|
||||
u32 len = stats_req->buf_len;
|
||||
u8 *buf = stats_req->buf;
|
||||
u32 num_elements;
|
||||
u8 i;
|
||||
|
||||
if (tag_len < sizeof(*stats_buf))
|
||||
return;
|
||||
|
||||
num_elements = le32_to_cpu(stats_buf->num_elems_ax_ndpa_arr);
|
||||
|
||||
len += scnprintf(buf + len, buf_len - len, "HTT_TXBF_OFDMA_AX_NDPA_STATS_TLV:\n");
|
||||
len += scnprintf(buf + len, buf_len - len, "ax_ofdma_ndpa_queued =");
|
||||
for (i = 0; i < num_elements; i++)
|
||||
len += scnprintf(buf + len, buf_len - len, " %u:%u,", i + 1,
|
||||
le32_to_cpu(stats_buf->ax_ndpa[i].ax_ofdma_ndpa_queued));
|
||||
len--;
|
||||
*(buf + len) = '\0';
|
||||
|
||||
len += scnprintf(buf + len, buf_len - len, "\nax_ofdma_ndpa_tried =");
|
||||
for (i = 0; i < num_elements; i++)
|
||||
len += scnprintf(buf + len, buf_len - len, " %u:%u,", i + 1,
|
||||
le32_to_cpu(stats_buf->ax_ndpa[i].ax_ofdma_ndpa_tried));
|
||||
len--;
|
||||
*(buf + len) = '\0';
|
||||
|
||||
len += scnprintf(buf + len, buf_len - len, "\nax_ofdma_ndpa_flushed =");
|
||||
for (i = 0; i < num_elements; i++)
|
||||
len += scnprintf(buf + len, buf_len - len, " %u:%u,", i + 1,
|
||||
le32_to_cpu(stats_buf->ax_ndpa[i].ax_ofdma_ndpa_flush));
|
||||
len--;
|
||||
*(buf + len) = '\0';
|
||||
|
||||
len += scnprintf(buf + len, buf_len - len, "\nax_ofdma_ndpa_err =");
|
||||
for (i = 0; i < num_elements; i++)
|
||||
len += scnprintf(buf + len, buf_len - len, " %u:%u,", i + 1,
|
||||
le32_to_cpu(stats_buf->ax_ndpa[i].ax_ofdma_ndpa_err));
|
||||
len--;
|
||||
*(buf + len) = '\0';
|
||||
|
||||
len += scnprintf(buf + len, buf_len - len, "\n\n");
|
||||
|
||||
stats_req->buf_len = len;
|
||||
}
|
||||
|
||||
static void
|
||||
ath12k_htt_print_txbf_ofdma_ax_ndp_stats_tlv(const void *tag_buf, u16 tag_len,
|
||||
struct debug_htt_stats_req *stats_req)
|
||||
{
|
||||
const struct ath12k_htt_txbf_ofdma_ax_ndp_stats_tlv *stats_buf = tag_buf;
|
||||
u32 buf_len = ATH12K_HTT_STATS_BUF_SIZE;
|
||||
u32 len = stats_req->buf_len;
|
||||
u8 *buf = stats_req->buf;
|
||||
u32 num_elements;
|
||||
u8 i;
|
||||
|
||||
if (tag_len < sizeof(*stats_buf))
|
||||
return;
|
||||
|
||||
num_elements = le32_to_cpu(stats_buf->num_elems_ax_ndp_arr);
|
||||
|
||||
len += scnprintf(buf + len, buf_len - len, "HTT_TXBF_OFDMA_AX_NDP_STATS_TLV:\n");
|
||||
len += scnprintf(buf + len, buf_len - len, "ax_ofdma_ndp_queued =");
|
||||
for (i = 0; i < num_elements; i++)
|
||||
len += scnprintf(buf + len, buf_len - len, " %u:%u,", i + 1,
|
||||
le32_to_cpu(stats_buf->ax_ndp[i].ax_ofdma_ndp_queued));
|
||||
len--;
|
||||
*(buf + len) = '\0';
|
||||
|
||||
len += scnprintf(buf + len, buf_len - len, "\nax_ofdma_ndp_tried =");
|
||||
for (i = 0; i < num_elements; i++)
|
||||
len += scnprintf(buf + len, buf_len - len, " %u:%u,", i + 1,
|
||||
le32_to_cpu(stats_buf->ax_ndp[i].ax_ofdma_ndp_tried));
|
||||
len--;
|
||||
*(buf + len) = '\0';
|
||||
|
||||
len += scnprintf(buf + len, buf_len - len, "\nax_ofdma_ndp_flushed =");
|
||||
for (i = 0; i < num_elements; i++)
|
||||
len += scnprintf(buf + len, buf_len - len, " %u:%u,", i + 1,
|
||||
le32_to_cpu(stats_buf->ax_ndp[i].ax_ofdma_ndp_flush));
|
||||
len--;
|
||||
*(buf + len) = '\0';
|
||||
|
||||
len += scnprintf(buf + len, buf_len - len, "\nax_ofdma_ndp_err =");
|
||||
for (i = 0; i < num_elements; i++)
|
||||
len += scnprintf(buf + len, buf_len - len, " %u:%u,", i + 1,
|
||||
le32_to_cpu(stats_buf->ax_ndp[i].ax_ofdma_ndp_err));
|
||||
len--;
|
||||
*(buf + len) = '\0';
|
||||
|
||||
len += scnprintf(buf + len, buf_len - len, "\n\n");
|
||||
|
||||
stats_req->buf_len = len;
|
||||
}
|
||||
|
||||
static void
|
||||
ath12k_htt_print_txbf_ofdma_ax_brp_stats_tlv(const void *tag_buf, u16 tag_len,
|
||||
struct debug_htt_stats_req *stats_req)
|
||||
{
|
||||
const struct ath12k_htt_txbf_ofdma_ax_brp_stats_tlv *stats_buf = tag_buf;
|
||||
u32 buf_len = ATH12K_HTT_STATS_BUF_SIZE;
|
||||
u32 len = stats_req->buf_len;
|
||||
u8 *buf = stats_req->buf;
|
||||
u32 num_elements;
|
||||
u8 i;
|
||||
|
||||
if (tag_len < sizeof(*stats_buf))
|
||||
return;
|
||||
|
||||
num_elements = le32_to_cpu(stats_buf->num_elems_ax_brp_arr);
|
||||
|
||||
len += scnprintf(buf + len, buf_len - len, "HTT_TXBF_OFDMA_AX_BRP_STATS_TLV:\n");
|
||||
len += scnprintf(buf + len, buf_len - len, "ax_ofdma_brpoll_queued =");
|
||||
for (i = 0; i < num_elements; i++)
|
||||
len += scnprintf(buf + len, buf_len - len, " %u:%u,", i + 1,
|
||||
le32_to_cpu(stats_buf->ax_brp[i].ax_ofdma_brp_queued));
|
||||
len--;
|
||||
*(buf + len) = '\0';
|
||||
|
||||
len += scnprintf(buf + len, buf_len - len, "\nax_ofdma_brpoll_tied =");
|
||||
for (i = 0; i < num_elements; i++)
|
||||
len += scnprintf(buf + len, buf_len - len, " %u:%u,", i + 1,
|
||||
le32_to_cpu(stats_buf->ax_brp[i].ax_ofdma_brp_tried));
|
||||
len--;
|
||||
*(buf + len) = '\0';
|
||||
|
||||
len += scnprintf(buf + len, buf_len - len, "\nax_ofdma_brpoll_flushed =");
|
||||
for (i = 0; i < num_elements; i++)
|
||||
len += scnprintf(buf + len, buf_len - len, " %u:%u,", i + 1,
|
||||
le32_to_cpu(stats_buf->ax_brp[i].ax_ofdma_brp_flushed));
|
||||
len--;
|
||||
*(buf + len) = '\0';
|
||||
|
||||
len += scnprintf(buf + len, buf_len - len, "\nax_ofdma_brp_err =");
|
||||
for (i = 0; i < num_elements; i++)
|
||||
len += scnprintf(buf + len, buf_len - len, " %u:%u,", i + 1,
|
||||
le32_to_cpu(stats_buf->ax_brp[i].ax_ofdma_brp_err));
|
||||
len--;
|
||||
*(buf + len) = '\0';
|
||||
|
||||
len += scnprintf(buf + len, buf_len - len, "\nax_ofdma_brp_err_num_cbf_rcvd =");
|
||||
for (i = 0; i < num_elements; i++)
|
||||
len += scnprintf(buf + len, buf_len - len, " %u:%u,", i + 1,
|
||||
le32_to_cpu(stats_buf->ax_brp[i].ax_ofdma_num_cbf_rcvd));
|
||||
len--;
|
||||
*(buf + len) = '\0';
|
||||
|
||||
len += scnprintf(buf + len, buf_len - len, "\n\n");
|
||||
|
||||
stats_req->buf_len = len;
|
||||
}
|
||||
|
||||
static void
|
||||
ath12k_htt_print_txbf_ofdma_ax_steer_stats_tlv(const void *tag_buf, u16 tag_len,
|
||||
struct debug_htt_stats_req *stats_req)
|
||||
{
|
||||
const struct ath12k_htt_txbf_ofdma_ax_steer_stats_tlv *stats_buf = tag_buf;
|
||||
u32 buf_len = ATH12K_HTT_STATS_BUF_SIZE;
|
||||
u32 len = stats_req->buf_len;
|
||||
u8 *buf = stats_req->buf;
|
||||
u32 num_elements;
|
||||
u8 i;
|
||||
|
||||
if (tag_len < sizeof(*stats_buf))
|
||||
return;
|
||||
|
||||
num_elements = le32_to_cpu(stats_buf->num_elems_ax_steer_arr);
|
||||
|
||||
len += scnprintf(buf + len, buf_len - len,
|
||||
"HTT_TXBF_OFDMA_AX_STEER_STATS_TLV:\n");
|
||||
len += scnprintf(buf + len, buf_len - len, "ax_ofdma_num_ppdu_steer =");
|
||||
for (i = 0; i < num_elements; i++)
|
||||
len += scnprintf(buf + len, buf_len - len, " %u:%u,", i + 1,
|
||||
le32_to_cpu(stats_buf->ax_steer[i].num_ppdu_steer));
|
||||
len--;
|
||||
*(buf + len) = '\0';
|
||||
|
||||
len += scnprintf(buf + len, buf_len - len, "\nax_ofdma_num_usrs_prefetch =");
|
||||
for (i = 0; i < num_elements; i++)
|
||||
len += scnprintf(buf + len, buf_len - len, " %u:%u,", i + 1,
|
||||
le32_to_cpu(stats_buf->ax_steer[i].num_usr_prefetch));
|
||||
len--;
|
||||
*(buf + len) = '\0';
|
||||
|
||||
len += scnprintf(buf + len, buf_len - len, "\nax_ofdma_num_usrs_sound =");
|
||||
for (i = 0; i < num_elements; i++)
|
||||
len += scnprintf(buf + len, buf_len - len, " %u:%u,", i + 1,
|
||||
le32_to_cpu(stats_buf->ax_steer[i].num_usr_sound));
|
||||
len--;
|
||||
*(buf + len) = '\0';
|
||||
|
||||
len += scnprintf(buf + len, buf_len - len, "\nax_ofdma_num_usrs_force_sound =");
|
||||
for (i = 0; i < num_elements; i++)
|
||||
len += scnprintf(buf + len, buf_len - len, " %u:%u,", i + 1,
|
||||
le32_to_cpu(stats_buf->ax_steer[i].num_usr_force_sound));
|
||||
len--;
|
||||
*(buf + len) = '\0';
|
||||
|
||||
len += scnprintf(buf + len, buf_len - len, "\n\n");
|
||||
|
||||
stats_req->buf_len = len;
|
||||
}
|
||||
|
||||
static void
|
||||
ath12k_htt_print_txbf_ofdma_ax_steer_mpdu_stats_tlv(const void *tag_buf, u16 tag_len,
|
||||
struct debug_htt_stats_req *stats_req)
|
||||
{
|
||||
const struct ath12k_htt_txbf_ofdma_ax_steer_mpdu_stats_tlv *stats_buf = tag_buf;
|
||||
u32 buf_len = ATH12K_HTT_STATS_BUF_SIZE;
|
||||
u32 len = stats_req->buf_len;
|
||||
u8 *buf = stats_req->buf;
|
||||
|
||||
if (tag_len < sizeof(*stats_buf))
|
||||
return;
|
||||
|
||||
len += scnprintf(buf + len, buf_len - len,
|
||||
"HTT_TXBF_OFDMA_AX_STEER_MPDU_STATS_TLV:\n");
|
||||
len += scnprintf(buf + len, buf_len - len, "rbo_steer_mpdus_tried = %u\n",
|
||||
le32_to_cpu(stats_buf->ax_ofdma_rbo_steer_mpdus_tried));
|
||||
len += scnprintf(buf + len, buf_len - len, "rbo_steer_mpdus_failed = %u\n",
|
||||
le32_to_cpu(stats_buf->ax_ofdma_rbo_steer_mpdus_failed));
|
||||
len += scnprintf(buf + len, buf_len - len, "sifs_steer_mpdus_tried = %u\n",
|
||||
le32_to_cpu(stats_buf->ax_ofdma_sifs_steer_mpdus_tried));
|
||||
len += scnprintf(buf + len, buf_len - len, "sifs_steer_mpdus_failed = %u\n\n",
|
||||
le32_to_cpu(stats_buf->ax_ofdma_sifs_steer_mpdus_failed));
|
||||
|
||||
stats_req->buf_len = len;
|
||||
}
|
||||
|
||||
static void ath12k_htt_print_dlpager_entry(const struct ath12k_htt_pgs_info *pg_info,
|
||||
int idx, char *str_buf)
|
||||
{
|
||||
@@ -3143,6 +3469,157 @@ ath12k_htt_print_tx_per_rate_stats_tlv(const void *tag_buf, u16 tag_len,
|
||||
stats_req->buf_len = len;
|
||||
}
|
||||
|
||||
static void
|
||||
ath12k_htt_print_ast_entry_tlv(const void *tag_buf, u16 tag_len,
|
||||
struct debug_htt_stats_req *stats_req)
|
||||
{
|
||||
const struct ath12k_htt_ast_entry_tlv *htt_stats_buf = tag_buf;
|
||||
u32 buf_len = ATH12K_HTT_STATS_BUF_SIZE;
|
||||
u32 len = stats_req->buf_len;
|
||||
u8 *buf = stats_req->buf;
|
||||
u32 mac_addr_l32;
|
||||
u32 mac_addr_h16;
|
||||
u32 ast_info;
|
||||
|
||||
if (tag_len < sizeof(*htt_stats_buf))
|
||||
return;
|
||||
|
||||
mac_addr_l32 = le32_to_cpu(htt_stats_buf->mac_addr.mac_addr_l32);
|
||||
mac_addr_h16 = le32_to_cpu(htt_stats_buf->mac_addr.mac_addr_h16);
|
||||
ast_info = le32_to_cpu(htt_stats_buf->info);
|
||||
|
||||
len += scnprintf(buf + len, buf_len - len, "HTT_AST_ENTRY_TLV:\n");
|
||||
len += scnprintf(buf + len, buf_len - len, "ast_index = %u\n",
|
||||
le32_to_cpu(htt_stats_buf->ast_index));
|
||||
len += scnprintf(buf + len, buf_len - len,
|
||||
"mac_addr = %02x:%02x:%02x:%02x:%02x:%02x\n",
|
||||
u32_get_bits(mac_addr_l32, ATH12K_HTT_MAC_ADDR_L32_0),
|
||||
u32_get_bits(mac_addr_l32, ATH12K_HTT_MAC_ADDR_L32_1),
|
||||
u32_get_bits(mac_addr_l32, ATH12K_HTT_MAC_ADDR_L32_2),
|
||||
u32_get_bits(mac_addr_l32, ATH12K_HTT_MAC_ADDR_L32_3),
|
||||
u32_get_bits(mac_addr_h16, ATH12K_HTT_MAC_ADDR_H16_0),
|
||||
u32_get_bits(mac_addr_h16, ATH12K_HTT_MAC_ADDR_H16_1));
|
||||
|
||||
len += scnprintf(buf + len, buf_len - len, "sw_peer_id = %u\n",
|
||||
le32_to_cpu(htt_stats_buf->sw_peer_id));
|
||||
len += scnprintf(buf + len, buf_len - len, "pdev_id = %u\n",
|
||||
u32_get_bits(ast_info, ATH12K_HTT_AST_PDEV_ID_INFO));
|
||||
len += scnprintf(buf + len, buf_len - len, "vdev_id = %u\n",
|
||||
u32_get_bits(ast_info, ATH12K_HTT_AST_VDEV_ID_INFO));
|
||||
len += scnprintf(buf + len, buf_len - len, "next_hop = %u\n",
|
||||
u32_get_bits(ast_info, ATH12K_HTT_AST_NEXT_HOP_INFO));
|
||||
len += scnprintf(buf + len, buf_len - len, "mcast = %u\n",
|
||||
u32_get_bits(ast_info, ATH12K_HTT_AST_MCAST_INFO));
|
||||
len += scnprintf(buf + len, buf_len - len, "monitor_direct = %u\n",
|
||||
u32_get_bits(ast_info, ATH12K_HTT_AST_MONITOR_DIRECT_INFO));
|
||||
len += scnprintf(buf + len, buf_len - len, "mesh_sta = %u\n",
|
||||
u32_get_bits(ast_info, ATH12K_HTT_AST_MESH_STA_INFO));
|
||||
len += scnprintf(buf + len, buf_len - len, "mec = %u\n",
|
||||
u32_get_bits(ast_info, ATH12K_HTT_AST_MEC_INFO));
|
||||
len += scnprintf(buf + len, buf_len - len, "intra_bss = %u\n\n",
|
||||
u32_get_bits(ast_info, ATH12K_HTT_AST_INTRA_BSS_INFO));
|
||||
|
||||
stats_req->buf_len = len;
|
||||
}
|
||||
|
||||
static const char*
|
||||
ath12k_htt_get_punct_dir_type_str(enum ath12k_htt_stats_direction direction)
|
||||
{
|
||||
switch (direction) {
|
||||
case ATH12K_HTT_STATS_DIRECTION_TX:
|
||||
return "tx";
|
||||
case ATH12K_HTT_STATS_DIRECTION_RX:
|
||||
return "rx";
|
||||
default:
|
||||
return "unknown";
|
||||
}
|
||||
}
|
||||
|
||||
static const char*
|
||||
ath12k_htt_get_punct_ppdu_type_str(enum ath12k_htt_stats_ppdu_type ppdu_type)
|
||||
{
|
||||
switch (ppdu_type) {
|
||||
case ATH12K_HTT_STATS_PPDU_TYPE_MODE_SU:
|
||||
return "su";
|
||||
case ATH12K_HTT_STATS_PPDU_TYPE_DL_MU_MIMO:
|
||||
return "dl_mu_mimo";
|
||||
case ATH12K_HTT_STATS_PPDU_TYPE_UL_MU_MIMO:
|
||||
return "ul_mu_mimo";
|
||||
case ATH12K_HTT_STATS_PPDU_TYPE_DL_MU_OFDMA:
|
||||
return "dl_mu_ofdma";
|
||||
case ATH12K_HTT_STATS_PPDU_TYPE_UL_MU_OFDMA:
|
||||
return "ul_mu_ofdma";
|
||||
default:
|
||||
return "unknown";
|
||||
}
|
||||
}
|
||||
|
||||
static const char*
|
||||
ath12k_htt_get_punct_pream_type_str(enum ath12k_htt_stats_param_type pream_type)
|
||||
{
|
||||
switch (pream_type) {
|
||||
case ATH12K_HTT_STATS_PREAM_OFDM:
|
||||
return "ofdm";
|
||||
case ATH12K_HTT_STATS_PREAM_CCK:
|
||||
return "cck";
|
||||
case ATH12K_HTT_STATS_PREAM_HT:
|
||||
return "ht";
|
||||
case ATH12K_HTT_STATS_PREAM_VHT:
|
||||
return "ac";
|
||||
case ATH12K_HTT_STATS_PREAM_HE:
|
||||
return "ax";
|
||||
case ATH12K_HTT_STATS_PREAM_EHT:
|
||||
return "be";
|
||||
default:
|
||||
return "unknown";
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
ath12k_htt_print_puncture_stats_tlv(const void *tag_buf, u16 tag_len,
|
||||
struct debug_htt_stats_req *stats_req)
|
||||
{
|
||||
const struct ath12k_htt_pdev_puncture_stats_tlv *stats_buf = tag_buf;
|
||||
u32 buf_len = ATH12K_HTT_STATS_BUF_SIZE;
|
||||
u32 len = stats_req->buf_len;
|
||||
u8 *buf = stats_req->buf;
|
||||
const char *direction;
|
||||
const char *ppdu_type;
|
||||
const char *preamble;
|
||||
u32 mac_id__word;
|
||||
u32 subband_limit;
|
||||
u8 i;
|
||||
|
||||
if (tag_len < sizeof(*stats_buf))
|
||||
return;
|
||||
|
||||
mac_id__word = le32_to_cpu(stats_buf->mac_id__word);
|
||||
subband_limit = min(le32_to_cpu(stats_buf->subband_cnt),
|
||||
ATH12K_HTT_PUNCT_STATS_MAX_SUBBAND_CNT);
|
||||
|
||||
direction = ath12k_htt_get_punct_dir_type_str(le32_to_cpu(stats_buf->direction));
|
||||
ppdu_type = ath12k_htt_get_punct_ppdu_type_str(le32_to_cpu(stats_buf->ppdu_type));
|
||||
preamble = ath12k_htt_get_punct_pream_type_str(le32_to_cpu(stats_buf->preamble));
|
||||
|
||||
len += scnprintf(buf + len, buf_len - len, "HTT_PDEV_PUNCTURE_STATS_TLV:\n");
|
||||
len += scnprintf(buf + len, buf_len - len, "mac_id = %u\n",
|
||||
u32_get_bits(mac_id__word, ATH12K_HTT_STATS_MAC_ID));
|
||||
len += scnprintf(buf + len, buf_len - len,
|
||||
"%s_%s_%s_last_used_pattern_mask = 0x%08x\n",
|
||||
direction, preamble, ppdu_type,
|
||||
le32_to_cpu(stats_buf->last_used_pattern_mask));
|
||||
|
||||
for (i = 0; i < subband_limit; i++) {
|
||||
len += scnprintf(buf + len, buf_len - len,
|
||||
"%s_%s_%s_num_subbands_used_cnt_%02d = %u\n",
|
||||
direction, preamble, ppdu_type, i + 1,
|
||||
le32_to_cpu(stats_buf->num_subbands_used_cnt[i]));
|
||||
}
|
||||
len += scnprintf(buf + len, buf_len - len, "\n");
|
||||
|
||||
stats_req->buf_len = len;
|
||||
}
|
||||
|
||||
static void
|
||||
ath12k_htt_print_dmac_reset_stats_tlv(const void *tag_buf, u16 tag_len,
|
||||
struct debug_htt_stats_req *stats_req)
|
||||
@@ -3508,6 +3985,25 @@ static int ath12k_dbg_htt_ext_stats_parse(struct ath12k_base *ab,
|
||||
case HTT_STATS_PDEV_OBSS_PD_TAG:
|
||||
ath12k_htt_print_pdev_obss_pd_stats_tlv(tag_buf, len, stats_req);
|
||||
break;
|
||||
case HTT_STATS_PDEV_TX_RATE_TXBF_STATS_TAG:
|
||||
ath12k_htt_print_pdev_tx_rate_txbf_stats_tlv(tag_buf, len, stats_req);
|
||||
break;
|
||||
case HTT_STATS_TXBF_OFDMA_AX_NDPA_STATS_TAG:
|
||||
ath12k_htt_print_txbf_ofdma_ax_ndpa_stats_tlv(tag_buf, len, stats_req);
|
||||
break;
|
||||
case HTT_STATS_TXBF_OFDMA_AX_NDP_STATS_TAG:
|
||||
ath12k_htt_print_txbf_ofdma_ax_ndp_stats_tlv(tag_buf, len, stats_req);
|
||||
break;
|
||||
case HTT_STATS_TXBF_OFDMA_AX_BRP_STATS_TAG:
|
||||
ath12k_htt_print_txbf_ofdma_ax_brp_stats_tlv(tag_buf, len, stats_req);
|
||||
break;
|
||||
case HTT_STATS_TXBF_OFDMA_AX_STEER_STATS_TAG:
|
||||
ath12k_htt_print_txbf_ofdma_ax_steer_stats_tlv(tag_buf, len, stats_req);
|
||||
break;
|
||||
case HTT_STATS_TXBF_OFDMA_AX_STEER_MPDU_STATS_TAG:
|
||||
ath12k_htt_print_txbf_ofdma_ax_steer_mpdu_stats_tlv(tag_buf, len,
|
||||
stats_req);
|
||||
break;
|
||||
case HTT_STATS_DLPAGER_STATS_TAG:
|
||||
ath12k_htt_print_dlpager_stats_tlv(tag_buf, len, stats_req);
|
||||
break;
|
||||
@@ -3532,6 +4028,12 @@ static int ath12k_dbg_htt_ext_stats_parse(struct ath12k_base *ab,
|
||||
case HTT_STATS_PER_RATE_STATS_TAG:
|
||||
ath12k_htt_print_tx_per_rate_stats_tlv(tag_buf, len, stats_req);
|
||||
break;
|
||||
case HTT_STATS_AST_ENTRY_TAG:
|
||||
ath12k_htt_print_ast_entry_tlv(tag_buf, len, stats_req);
|
||||
break;
|
||||
case HTT_STATS_PDEV_PUNCTURE_STATS_TAG:
|
||||
ath12k_htt_print_puncture_stats_tlv(tag_buf, len, stats_req);
|
||||
break;
|
||||
case HTT_STATS_DMAC_RESET_STATS_TAG:
|
||||
ath12k_htt_print_dmac_reset_stats_tlv(tag_buf, len, stats_req);
|
||||
break;
|
||||
|
||||
@@ -135,11 +135,15 @@ enum ath12k_dbg_htt_ext_stats_type {
|
||||
ATH12K_DBG_HTT_EXT_STATS_PDEV_TX_MU = 17,
|
||||
ATH12K_DBG_HTT_EXT_STATS_PDEV_CCA_STATS = 19,
|
||||
ATH12K_DBG_HTT_EXT_STATS_PDEV_OBSS_PD_STATS = 23,
|
||||
ATH12K_DBG_HTT_EXT_STATS_PDEV_TX_RATE_TXBF = 31,
|
||||
ATH12K_DBG_HTT_EXT_STATS_TXBF_OFDMA = 32,
|
||||
ATH12K_DBG_HTT_EXT_STATS_DLPAGER_STATS = 36,
|
||||
ATH12K_DBG_HTT_EXT_PHY_COUNTERS_AND_PHY_STATS = 37,
|
||||
ATH12K_DBG_HTT_EXT_VDEVS_TXRX_STATS = 38,
|
||||
ATH12K_DBG_HTT_EXT_PDEV_PER_STATS = 40,
|
||||
ATH12K_DBG_HTT_EXT_AST_ENTRIES = 41,
|
||||
ATH12K_DBG_HTT_EXT_STATS_SOC_ERROR = 45,
|
||||
ATH12K_DBG_HTT_DBG_PDEV_PUNCTURE_STATS = 46,
|
||||
ATH12K_DBG_HTT_EXT_STATS_PDEV_SCHED_ALGO = 49,
|
||||
ATH12K_DBG_HTT_EXT_STATS_MANDATORY_MUOFDMA = 51,
|
||||
ATH12K_DGB_HTT_EXT_STATS_PDEV_MBSSID_CTRL_FRAME = 54,
|
||||
@@ -197,6 +201,7 @@ enum ath12k_dbg_htt_tlv_tag {
|
||||
HTT_STATS_HW_WAR_TAG = 89,
|
||||
HTT_STATS_SCHED_TXQ_SUPERCYCLE_TRIGGER_TAG = 100,
|
||||
HTT_STATS_PDEV_CTRL_PATH_TX_STATS_TAG = 102,
|
||||
HTT_STATS_PDEV_TX_RATE_TXBF_STATS_TAG = 108,
|
||||
HTT_STATS_TX_SELFGEN_AC_SCHED_STATUS_STATS_TAG = 111,
|
||||
HTT_STATS_TX_SELFGEN_AX_SCHED_STATUS_STATS_TAG = 112,
|
||||
HTT_STATS_DLPAGER_STATS_TAG = 120,
|
||||
@@ -208,13 +213,20 @@ enum ath12k_dbg_htt_tlv_tag {
|
||||
HTT_STATS_PER_RATE_STATS_TAG = 128,
|
||||
HTT_STATS_MU_PPDU_DIST_TAG = 129,
|
||||
HTT_STATS_TX_PDEV_MUMIMO_GRP_STATS_TAG = 130,
|
||||
HTT_STATS_AST_ENTRY_TAG = 132,
|
||||
HTT_STATS_TX_PDEV_RATE_STATS_BE_OFDMA_TAG = 135,
|
||||
HTT_STATS_TX_SELFGEN_BE_ERR_STATS_TAG = 137,
|
||||
HTT_STATS_TX_SELFGEN_BE_STATS_TAG = 138,
|
||||
HTT_STATS_TX_SELFGEN_BE_SCHED_STATUS_STATS_TAG = 139,
|
||||
HTT_STATS_TXBF_OFDMA_AX_NDPA_STATS_TAG = 147,
|
||||
HTT_STATS_TXBF_OFDMA_AX_NDP_STATS_TAG = 148,
|
||||
HTT_STATS_TXBF_OFDMA_AX_BRP_STATS_TAG = 149,
|
||||
HTT_STATS_TXBF_OFDMA_AX_STEER_STATS_TAG = 150,
|
||||
HTT_STATS_DMAC_RESET_STATS_TAG = 155,
|
||||
HTT_STATS_PHY_TPC_STATS_TAG = 157,
|
||||
HTT_STATS_PDEV_PUNCTURE_STATS_TAG = 158,
|
||||
HTT_STATS_PDEV_SCHED_ALGO_OFDMA_STATS_TAG = 165,
|
||||
HTT_STATS_TXBF_OFDMA_AX_STEER_MPDU_STATS_TAG = 172,
|
||||
HTT_STATS_PDEV_MBSSID_CTRL_FRAME_STATS_TAG = 176,
|
||||
|
||||
HTT_STATS_MAX_TAG,
|
||||
@@ -1068,6 +1080,97 @@ struct ath12k_htt_pdev_obss_pd_stats_tlv {
|
||||
__le32 num_sr_ppdu_abort_flush_cnt;
|
||||
} __packed;
|
||||
|
||||
#define ATH12K_HTT_TX_BF_RATE_STATS_NUM_MCS_COUNTERS 14
|
||||
#define ATH12K_HTT_TX_PDEV_STATS_NUM_LEGACY_OFDM_STATS 8
|
||||
#define ATH12K_HTT_TX_PDEV_STATS_NUM_SPATIAL_STREAMS 8
|
||||
#define ATH12K_HTT_TXBF_NUM_BW_CNTRS 5
|
||||
#define ATH12K_HTT_TXBF_NUM_REDUCED_CHAN_TYPES 2
|
||||
|
||||
struct ath12k_htt_pdev_txrate_txbf_stats_tlv {
|
||||
__le32 tx_su_txbf_mcs[ATH12K_HTT_TX_BF_RATE_STATS_NUM_MCS_COUNTERS];
|
||||
__le32 tx_su_ibf_mcs[ATH12K_HTT_TX_BF_RATE_STATS_NUM_MCS_COUNTERS];
|
||||
__le32 tx_su_ol_mcs[ATH12K_HTT_TX_BF_RATE_STATS_NUM_MCS_COUNTERS];
|
||||
__le32 tx_su_txbf_nss[ATH12K_HTT_TX_PDEV_STATS_NUM_SPATIAL_STREAMS];
|
||||
__le32 tx_su_ibf_nss[ATH12K_HTT_TX_PDEV_STATS_NUM_SPATIAL_STREAMS];
|
||||
__le32 tx_su_ol_nss[ATH12K_HTT_TX_PDEV_STATS_NUM_SPATIAL_STREAMS];
|
||||
__le32 tx_su_txbf_bw[ATH12K_HTT_TXBF_NUM_BW_CNTRS];
|
||||
__le32 tx_su_ibf_bw[ATH12K_HTT_TXBF_NUM_BW_CNTRS];
|
||||
__le32 tx_su_ol_bw[ATH12K_HTT_TXBF_NUM_BW_CNTRS];
|
||||
__le32 tx_legacy_ofdm_rate[ATH12K_HTT_TX_PDEV_STATS_NUM_LEGACY_OFDM_STATS];
|
||||
__le32 txbf[ATH12K_HTT_TXBF_NUM_REDUCED_CHAN_TYPES][ATH12K_HTT_TXBF_NUM_BW_CNTRS];
|
||||
__le32 ibf[ATH12K_HTT_TXBF_NUM_REDUCED_CHAN_TYPES][ATH12K_HTT_TXBF_NUM_BW_CNTRS];
|
||||
__le32 ol[ATH12K_HTT_TXBF_NUM_REDUCED_CHAN_TYPES][ATH12K_HTT_TXBF_NUM_BW_CNTRS];
|
||||
__le32 txbf_flag_set_mu_mode;
|
||||
__le32 txbf_flag_set_final_status;
|
||||
__le32 txbf_flag_not_set_verified_txbf_mode;
|
||||
__le32 txbf_flag_not_set_disable_p2p_access;
|
||||
__le32 txbf_flag_not_set_max_nss_in_he160;
|
||||
__le32 txbf_flag_not_set_disable_uldlofdma;
|
||||
__le32 txbf_flag_not_set_mcs_threshold_val;
|
||||
__le32 txbf_flag_not_set_final_status;
|
||||
} __packed;
|
||||
|
||||
struct ath12k_htt_txbf_ofdma_ax_ndpa_stats_elem_t {
|
||||
__le32 ax_ofdma_ndpa_queued;
|
||||
__le32 ax_ofdma_ndpa_tried;
|
||||
__le32 ax_ofdma_ndpa_flush;
|
||||
__le32 ax_ofdma_ndpa_err;
|
||||
} __packed;
|
||||
|
||||
struct ath12k_htt_txbf_ofdma_ax_ndpa_stats_tlv {
|
||||
__le32 num_elems_ax_ndpa_arr;
|
||||
__le32 arr_elem_size_ax_ndpa;
|
||||
DECLARE_FLEX_ARRAY(struct ath12k_htt_txbf_ofdma_ax_ndpa_stats_elem_t, ax_ndpa);
|
||||
} __packed;
|
||||
|
||||
struct ath12k_htt_txbf_ofdma_ax_ndp_stats_elem_t {
|
||||
__le32 ax_ofdma_ndp_queued;
|
||||
__le32 ax_ofdma_ndp_tried;
|
||||
__le32 ax_ofdma_ndp_flush;
|
||||
__le32 ax_ofdma_ndp_err;
|
||||
} __packed;
|
||||
|
||||
struct ath12k_htt_txbf_ofdma_ax_ndp_stats_tlv {
|
||||
__le32 num_elems_ax_ndp_arr;
|
||||
__le32 arr_elem_size_ax_ndp;
|
||||
DECLARE_FLEX_ARRAY(struct ath12k_htt_txbf_ofdma_ax_ndp_stats_elem_t, ax_ndp);
|
||||
} __packed;
|
||||
|
||||
struct ath12k_htt_txbf_ofdma_ax_brp_stats_elem_t {
|
||||
__le32 ax_ofdma_brp_queued;
|
||||
__le32 ax_ofdma_brp_tried;
|
||||
__le32 ax_ofdma_brp_flushed;
|
||||
__le32 ax_ofdma_brp_err;
|
||||
__le32 ax_ofdma_num_cbf_rcvd;
|
||||
} __packed;
|
||||
|
||||
struct ath12k_htt_txbf_ofdma_ax_brp_stats_tlv {
|
||||
__le32 num_elems_ax_brp_arr;
|
||||
__le32 arr_elem_size_ax_brp;
|
||||
DECLARE_FLEX_ARRAY(struct ath12k_htt_txbf_ofdma_ax_brp_stats_elem_t, ax_brp);
|
||||
} __packed;
|
||||
|
||||
struct ath12k_htt_txbf_ofdma_ax_steer_stats_elem_t {
|
||||
__le32 num_ppdu_steer;
|
||||
__le32 num_ppdu_ol;
|
||||
__le32 num_usr_prefetch;
|
||||
__le32 num_usr_sound;
|
||||
__le32 num_usr_force_sound;
|
||||
} __packed;
|
||||
|
||||
struct ath12k_htt_txbf_ofdma_ax_steer_stats_tlv {
|
||||
__le32 num_elems_ax_steer_arr;
|
||||
__le32 arr_elem_size_ax_steer;
|
||||
DECLARE_FLEX_ARRAY(struct ath12k_htt_txbf_ofdma_ax_steer_stats_elem_t, ax_steer);
|
||||
} __packed;
|
||||
|
||||
struct ath12k_htt_txbf_ofdma_ax_steer_mpdu_stats_tlv {
|
||||
__le32 ax_ofdma_rbo_steer_mpdus_tried;
|
||||
__le32 ax_ofdma_rbo_steer_mpdus_failed;
|
||||
__le32 ax_ofdma_sifs_steer_mpdus_tried;
|
||||
__le32 ax_ofdma_sifs_steer_mpdus_failed;
|
||||
} __packed;
|
||||
|
||||
enum ath12k_htt_stats_page_lock_state {
|
||||
ATH12K_HTT_STATS_PAGE_LOCKED = 0,
|
||||
ATH12K_HTT_STATS_PAGE_UNLOCKED = 1,
|
||||
@@ -1194,6 +1297,58 @@ struct ath12k_htt_t2h_soc_txrx_stats_common_tlv {
|
||||
__le32 inv_peers_msdu_drop_count_lo;
|
||||
} __packed;
|
||||
|
||||
#define ATH12K_HTT_AST_PDEV_ID_INFO GENMASK(1, 0)
|
||||
#define ATH12K_HTT_AST_VDEV_ID_INFO GENMASK(9, 2)
|
||||
#define ATH12K_HTT_AST_NEXT_HOP_INFO BIT(10)
|
||||
#define ATH12K_HTT_AST_MCAST_INFO BIT(11)
|
||||
#define ATH12K_HTT_AST_MONITOR_DIRECT_INFO BIT(12)
|
||||
#define ATH12K_HTT_AST_MESH_STA_INFO BIT(13)
|
||||
#define ATH12K_HTT_AST_MEC_INFO BIT(14)
|
||||
#define ATH12K_HTT_AST_INTRA_BSS_INFO BIT(15)
|
||||
|
||||
struct ath12k_htt_ast_entry_tlv {
|
||||
__le32 sw_peer_id;
|
||||
__le32 ast_index;
|
||||
struct htt_mac_addr mac_addr;
|
||||
__le32 info;
|
||||
} __packed;
|
||||
|
||||
enum ath12k_htt_stats_direction {
|
||||
ATH12K_HTT_STATS_DIRECTION_TX,
|
||||
ATH12K_HTT_STATS_DIRECTION_RX
|
||||
};
|
||||
|
||||
enum ath12k_htt_stats_ppdu_type {
|
||||
ATH12K_HTT_STATS_PPDU_TYPE_MODE_SU,
|
||||
ATH12K_HTT_STATS_PPDU_TYPE_DL_MU_MIMO,
|
||||
ATH12K_HTT_STATS_PPDU_TYPE_UL_MU_MIMO,
|
||||
ATH12K_HTT_STATS_PPDU_TYPE_DL_MU_OFDMA,
|
||||
ATH12K_HTT_STATS_PPDU_TYPE_UL_MU_OFDMA
|
||||
};
|
||||
|
||||
enum ath12k_htt_stats_param_type {
|
||||
ATH12K_HTT_STATS_PREAM_OFDM,
|
||||
ATH12K_HTT_STATS_PREAM_CCK,
|
||||
ATH12K_HTT_STATS_PREAM_HT,
|
||||
ATH12K_HTT_STATS_PREAM_VHT,
|
||||
ATH12K_HTT_STATS_PREAM_HE,
|
||||
ATH12K_HTT_STATS_PREAM_EHT,
|
||||
ATH12K_HTT_STATS_PREAM_RSVD1,
|
||||
ATH12K_HTT_STATS_PREAM_COUNT,
|
||||
};
|
||||
|
||||
#define ATH12K_HTT_PUNCT_STATS_MAX_SUBBAND_CNT 32
|
||||
|
||||
struct ath12k_htt_pdev_puncture_stats_tlv {
|
||||
__le32 mac_id__word;
|
||||
__le32 direction;
|
||||
__le32 preamble;
|
||||
__le32 ppdu_type;
|
||||
__le32 subband_cnt;
|
||||
__le32 last_used_pattern_mask;
|
||||
__le32 num_subbands_used_cnt[ATH12K_HTT_PUNCT_STATS_MAX_SUBBAND_CNT];
|
||||
} __packed;
|
||||
|
||||
struct ath12k_htt_dmac_reset_stats_tlv {
|
||||
__le32 reset_count;
|
||||
__le32 reset_time_lo_ms;
|
||||
|
||||
@@ -1445,6 +1445,7 @@ static int ath12k_dp_cc_desc_init(struct ath12k_base *ab)
|
||||
for (j = 0; j < ATH12K_MAX_SPT_ENTRIES; j++) {
|
||||
rx_descs[j].cookie = ath12k_dp_cc_cookie_gen(cookie_ppt_idx, j);
|
||||
rx_descs[j].magic = ATH12K_DP_RX_DESC_MAGIC;
|
||||
rx_descs[j].device_id = ab->device_id;
|
||||
list_add_tail(&rx_descs[j].list, &dp->rx_desc_free_list);
|
||||
|
||||
/* Update descriptor VA in SPT */
|
||||
@@ -1521,6 +1522,19 @@ static int ath12k_dp_cmem_init(struct ath12k_base *ab,
|
||||
return 0;
|
||||
}
|
||||
|
||||
void ath12k_dp_partner_cc_init(struct ath12k_base *ab)
|
||||
{
|
||||
struct ath12k_hw_group *ag = ab->ag;
|
||||
int i;
|
||||
|
||||
for (i = 0; i < ag->num_devices; i++) {
|
||||
if (ag->ab[i] == ab)
|
||||
continue;
|
||||
|
||||
ath12k_dp_cmem_init(ab, &ag->ab[i]->dp, ATH12K_DP_RX_DESC);
|
||||
}
|
||||
}
|
||||
|
||||
static int ath12k_dp_cc_init(struct ath12k_base *ab)
|
||||
{
|
||||
struct ath12k_dp *dp = &ab->dp;
|
||||
|
||||
@@ -287,7 +287,8 @@ struct ath12k_rx_desc_info {
|
||||
u32 cookie;
|
||||
u32 magic;
|
||||
u8 in_use : 1,
|
||||
reserved : 7;
|
||||
device_id : 3,
|
||||
reserved : 4;
|
||||
};
|
||||
|
||||
struct ath12k_tx_desc_info {
|
||||
@@ -695,9 +696,9 @@ enum htt_stats_internal_ppdu_frametype {
|
||||
*
|
||||
* The message would appear as follows:
|
||||
*
|
||||
* |31 26|25|24|23 16|15 8|7 0|
|
||||
* |-----------------+----------------+----------------+---------------|
|
||||
* | rsvd1 |PS|SS| ring_id | pdev_id | msg_type |
|
||||
* |31 29|28|27|26|25|24|23 16|15 8|7 0|
|
||||
* |-------+--+--+--+--+--+-----------+----------------+---------------|
|
||||
* | rsvd1 |ED|DT|OV|PS|SS| ring_id | pdev_id | msg_type |
|
||||
* |-------------------------------------------------------------------|
|
||||
* | rsvd2 | ring_buffer_size |
|
||||
* |-------------------------------------------------------------------|
|
||||
@@ -724,7 +725,13 @@ enum htt_stats_internal_ppdu_frametype {
|
||||
* More details can be got from enum htt_srng_ring_id
|
||||
* b'24 - status_swap: 1 is to swap status TLV
|
||||
* b'25 - pkt_swap: 1 is to swap packet TLV
|
||||
* b'26:31 - rsvd1: reserved for future use
|
||||
* b'26 - rx_offset_valid (OV): flag to indicate rx offsets
|
||||
* configuration fields are valid
|
||||
* b'27 - drop_thresh_valid (DT): flag to indicate if the
|
||||
* rx_drop_threshold field is valid
|
||||
* b'28 - rx_mon_global_en: Enable/Disable global register
|
||||
* configuration in Rx monitor module.
|
||||
* b'29:31 - rsvd1: reserved for future use
|
||||
* dword1 - b'0:16 - ring_buffer_size: size of buffers referenced by rx ring,
|
||||
* in byte units.
|
||||
* Valid only for HW_TO_SW_RING and SW_TO_HW_RING
|
||||
@@ -1791,6 +1798,18 @@ enum vdev_stats_offload_timer_duration {
|
||||
ATH12K_STATS_TIMER_DUR_2SEC = 3,
|
||||
};
|
||||
|
||||
#define ATH12K_HTT_MAC_ADDR_L32_0 GENMASK(7, 0)
|
||||
#define ATH12K_HTT_MAC_ADDR_L32_1 GENMASK(15, 8)
|
||||
#define ATH12K_HTT_MAC_ADDR_L32_2 GENMASK(23, 16)
|
||||
#define ATH12K_HTT_MAC_ADDR_L32_3 GENMASK(31, 24)
|
||||
#define ATH12K_HTT_MAC_ADDR_H16_0 GENMASK(7, 0)
|
||||
#define ATH12K_HTT_MAC_ADDR_H16_1 GENMASK(15, 8)
|
||||
|
||||
struct htt_mac_addr {
|
||||
__le32 mac_addr_l32;
|
||||
__le32 mac_addr_h16;
|
||||
} __packed;
|
||||
|
||||
static inline void ath12k_dp_get_mac_addr(u32 addr_l32, u16 addr_h16, u8 *addr)
|
||||
{
|
||||
memcpy(addr, &addr_l32, 4);
|
||||
@@ -1805,6 +1824,7 @@ void ath12k_dp_vdev_tx_attach(struct ath12k *ar, struct ath12k_link_vif *arvif);
|
||||
void ath12k_dp_free(struct ath12k_base *ab);
|
||||
int ath12k_dp_alloc(struct ath12k_base *ab);
|
||||
void ath12k_dp_cc_config(struct ath12k_base *ab);
|
||||
void ath12k_dp_partner_cc_init(struct ath12k_base *ab);
|
||||
int ath12k_dp_pdev_alloc(struct ath12k_base *ab);
|
||||
void ath12k_dp_pdev_pre_alloc(struct ath12k *ar);
|
||||
void ath12k_dp_pdev_free(struct ath12k_base *ab);
|
||||
|
||||
@@ -10,11 +10,10 @@
|
||||
#include "dp_tx.h"
|
||||
#include "peer.h"
|
||||
|
||||
static void ath12k_dp_mon_rx_handle_ofdma_info(void *rx_tlv,
|
||||
struct hal_rx_user_status *rx_user_status)
|
||||
static void
|
||||
ath12k_dp_mon_rx_handle_ofdma_info(const struct hal_rx_ppdu_end_user_stats *ppdu_end_user,
|
||||
struct hal_rx_user_status *rx_user_status)
|
||||
{
|
||||
struct hal_rx_ppdu_end_user_stats *ppdu_end_user = rx_tlv;
|
||||
|
||||
rx_user_status->ul_ofdma_user_v0_word0 =
|
||||
__le32_to_cpu(ppdu_end_user->usr_resp_ref);
|
||||
rx_user_status->ul_ofdma_user_v0_word1 =
|
||||
@@ -35,7 +34,7 @@ ath12k_dp_mon_rx_populate_byte_count(const struct hal_rx_ppdu_end_user_stats *st
|
||||
}
|
||||
|
||||
static void
|
||||
ath12k_dp_mon_rx_populate_mu_user_info(void *rx_tlv,
|
||||
ath12k_dp_mon_rx_populate_mu_user_info(const struct hal_rx_ppdu_end_user_stats *rx_tlv,
|
||||
struct hal_rx_mon_ppdu_info *ppdu_info,
|
||||
struct hal_rx_user_status *rx_user_status)
|
||||
{
|
||||
@@ -73,11 +72,9 @@ ath12k_dp_mon_rx_populate_mu_user_info(void *rx_tlv,
|
||||
ath12k_dp_mon_rx_populate_byte_count(rx_tlv, ppdu_info, rx_user_status);
|
||||
}
|
||||
|
||||
static void ath12k_dp_mon_parse_vht_sig_a(u8 *tlv_data,
|
||||
static void ath12k_dp_mon_parse_vht_sig_a(const struct hal_rx_vht_sig_a_info *vht_sig,
|
||||
struct hal_rx_mon_ppdu_info *ppdu_info)
|
||||
{
|
||||
struct hal_rx_vht_sig_a_info *vht_sig =
|
||||
(struct hal_rx_vht_sig_a_info *)tlv_data;
|
||||
u32 nsts, group_id, info0, info1;
|
||||
u8 gi_setting;
|
||||
|
||||
@@ -119,11 +116,9 @@ static void ath12k_dp_mon_parse_vht_sig_a(u8 *tlv_data,
|
||||
u32_get_bits(info1, HAL_RX_VHT_SIG_A_INFO_INFO1_SU_MU_CODING);
|
||||
}
|
||||
|
||||
static void ath12k_dp_mon_parse_ht_sig(u8 *tlv_data,
|
||||
static void ath12k_dp_mon_parse_ht_sig(const struct hal_rx_ht_sig_info *ht_sig,
|
||||
struct hal_rx_mon_ppdu_info *ppdu_info)
|
||||
{
|
||||
struct hal_rx_ht_sig_info *ht_sig =
|
||||
(struct hal_rx_ht_sig_info *)tlv_data;
|
||||
u32 info0 = __le32_to_cpu(ht_sig->info0);
|
||||
u32 info1 = __le32_to_cpu(ht_sig->info1);
|
||||
|
||||
@@ -136,11 +131,9 @@ static void ath12k_dp_mon_parse_ht_sig(u8 *tlv_data,
|
||||
ppdu_info->reception_type = HAL_RX_RECEPTION_TYPE_SU;
|
||||
}
|
||||
|
||||
static void ath12k_dp_mon_parse_l_sig_b(u8 *tlv_data,
|
||||
static void ath12k_dp_mon_parse_l_sig_b(const struct hal_rx_lsig_b_info *lsigb,
|
||||
struct hal_rx_mon_ppdu_info *ppdu_info)
|
||||
{
|
||||
struct hal_rx_lsig_b_info *lsigb =
|
||||
(struct hal_rx_lsig_b_info *)tlv_data;
|
||||
u32 info0 = __le32_to_cpu(lsigb->info0);
|
||||
u8 rate;
|
||||
|
||||
@@ -170,11 +163,9 @@ static void ath12k_dp_mon_parse_l_sig_b(u8 *tlv_data,
|
||||
ppdu_info->reception_type = HAL_RX_RECEPTION_TYPE_SU;
|
||||
}
|
||||
|
||||
static void ath12k_dp_mon_parse_l_sig_a(u8 *tlv_data,
|
||||
static void ath12k_dp_mon_parse_l_sig_a(const struct hal_rx_lsig_a_info *lsiga,
|
||||
struct hal_rx_mon_ppdu_info *ppdu_info)
|
||||
{
|
||||
struct hal_rx_lsig_a_info *lsiga =
|
||||
(struct hal_rx_lsig_a_info *)tlv_data;
|
||||
u32 info0 = __le32_to_cpu(lsiga->info0);
|
||||
u8 rate;
|
||||
|
||||
@@ -212,14 +203,13 @@ static void ath12k_dp_mon_parse_l_sig_a(u8 *tlv_data,
|
||||
ppdu_info->reception_type = HAL_RX_RECEPTION_TYPE_SU;
|
||||
}
|
||||
|
||||
static void ath12k_dp_mon_parse_he_sig_b2_ofdma(u8 *tlv_data,
|
||||
struct hal_rx_mon_ppdu_info *ppdu_info)
|
||||
static void
|
||||
ath12k_dp_mon_parse_he_sig_b2_ofdma(const struct hal_rx_he_sig_b2_ofdma_info *ofdma,
|
||||
struct hal_rx_mon_ppdu_info *ppdu_info)
|
||||
{
|
||||
struct hal_rx_he_sig_b2_ofdma_info *he_sig_b2_ofdma =
|
||||
(struct hal_rx_he_sig_b2_ofdma_info *)tlv_data;
|
||||
u32 info0, value;
|
||||
|
||||
info0 = __le32_to_cpu(he_sig_b2_ofdma->info0);
|
||||
info0 = __le32_to_cpu(ofdma->info0);
|
||||
|
||||
ppdu_info->he_data1 |= HE_MCS_KNOWN | HE_DCM_KNOWN | HE_CODING_KNOWN;
|
||||
|
||||
@@ -250,11 +240,10 @@ static void ath12k_dp_mon_parse_he_sig_b2_ofdma(u8 *tlv_data,
|
||||
ppdu_info->reception_type = HAL_RX_RECEPTION_TYPE_MU_OFDMA;
|
||||
}
|
||||
|
||||
static void ath12k_dp_mon_parse_he_sig_b2_mu(u8 *tlv_data,
|
||||
struct hal_rx_mon_ppdu_info *ppdu_info)
|
||||
static void
|
||||
ath12k_dp_mon_parse_he_sig_b2_mu(const struct hal_rx_he_sig_b2_mu_info *he_sig_b2_mu,
|
||||
struct hal_rx_mon_ppdu_info *ppdu_info)
|
||||
{
|
||||
struct hal_rx_he_sig_b2_mu_info *he_sig_b2_mu =
|
||||
(struct hal_rx_he_sig_b2_mu_info *)tlv_data;
|
||||
u32 info0, value;
|
||||
|
||||
info0 = __le32_to_cpu(he_sig_b2_mu->info0);
|
||||
@@ -277,11 +266,10 @@ static void ath12k_dp_mon_parse_he_sig_b2_mu(u8 *tlv_data,
|
||||
ppdu_info->nss = u32_get_bits(info0, HAL_RX_HE_SIG_B2_MU_INFO_INFO0_STA_NSTS);
|
||||
}
|
||||
|
||||
static void ath12k_dp_mon_parse_he_sig_b1_mu(u8 *tlv_data,
|
||||
struct hal_rx_mon_ppdu_info *ppdu_info)
|
||||
static void
|
||||
ath12k_dp_mon_parse_he_sig_b1_mu(const struct hal_rx_he_sig_b1_mu_info *he_sig_b1_mu,
|
||||
struct hal_rx_mon_ppdu_info *ppdu_info)
|
||||
{
|
||||
struct hal_rx_he_sig_b1_mu_info *he_sig_b1_mu =
|
||||
(struct hal_rx_he_sig_b1_mu_info *)tlv_data;
|
||||
u32 info0 = __le32_to_cpu(he_sig_b1_mu->info0);
|
||||
u16 ru_tones;
|
||||
|
||||
@@ -292,11 +280,10 @@ static void ath12k_dp_mon_parse_he_sig_b1_mu(u8 *tlv_data,
|
||||
ppdu_info->reception_type = HAL_RX_RECEPTION_TYPE_MU_MIMO;
|
||||
}
|
||||
|
||||
static void ath12k_dp_mon_parse_he_sig_mu(u8 *tlv_data,
|
||||
struct hal_rx_mon_ppdu_info *ppdu_info)
|
||||
static void
|
||||
ath12k_dp_mon_parse_he_sig_mu(const struct hal_rx_he_sig_a_mu_dl_info *he_sig_a_mu_dl,
|
||||
struct hal_rx_mon_ppdu_info *ppdu_info)
|
||||
{
|
||||
struct hal_rx_he_sig_a_mu_dl_info *he_sig_a_mu_dl =
|
||||
(struct hal_rx_he_sig_a_mu_dl_info *)tlv_data;
|
||||
u32 info0, info1, value;
|
||||
u16 he_gi = 0, he_ltf = 0;
|
||||
|
||||
@@ -427,11 +414,9 @@ static void ath12k_dp_mon_parse_he_sig_mu(u8 *tlv_data,
|
||||
ppdu_info->reception_type = HAL_RX_RECEPTION_TYPE_MU_MIMO;
|
||||
}
|
||||
|
||||
static void ath12k_dp_mon_parse_he_sig_su(u8 *tlv_data,
|
||||
static void ath12k_dp_mon_parse_he_sig_su(const struct hal_rx_he_sig_a_su_info *he_sig_a,
|
||||
struct hal_rx_mon_ppdu_info *ppdu_info)
|
||||
{
|
||||
struct hal_rx_he_sig_a_su_info *he_sig_a =
|
||||
(struct hal_rx_he_sig_a_su_info *)tlv_data;
|
||||
u32 info0, info1, value;
|
||||
u32 dcm;
|
||||
u8 he_dcm = 0, he_stbc = 0;
|
||||
@@ -580,15 +565,15 @@ static void ath12k_dp_mon_parse_he_sig_su(u8 *tlv_data,
|
||||
static enum hal_rx_mon_status
|
||||
ath12k_dp_mon_rx_parse_status_tlv(struct ath12k_base *ab,
|
||||
struct ath12k_mon_data *pmon,
|
||||
u32 tlv_tag, u8 *tlv_data, u32 userid)
|
||||
u32 tlv_tag, const void *tlv_data,
|
||||
u32 userid)
|
||||
{
|
||||
struct hal_rx_mon_ppdu_info *ppdu_info = &pmon->mon_ppdu_info;
|
||||
u32 info[7];
|
||||
|
||||
switch (tlv_tag) {
|
||||
case HAL_RX_PPDU_START: {
|
||||
struct hal_rx_ppdu_start *ppdu_start =
|
||||
(struct hal_rx_ppdu_start *)tlv_data;
|
||||
const struct hal_rx_ppdu_start *ppdu_start = tlv_data;
|
||||
|
||||
u64 ppdu_ts = ath12k_le32hilo_to_u64(ppdu_start->ppdu_start_ts_63_32,
|
||||
ppdu_start->ppdu_start_ts_31_0);
|
||||
@@ -615,8 +600,8 @@ ath12k_dp_mon_rx_parse_status_tlv(struct ath12k_base *ab,
|
||||
break;
|
||||
}
|
||||
case HAL_RX_PPDU_END_USER_STATS: {
|
||||
struct hal_rx_ppdu_end_user_stats *eu_stats =
|
||||
(struct hal_rx_ppdu_end_user_stats *)tlv_data;
|
||||
const struct hal_rx_ppdu_end_user_stats *eu_stats = tlv_data;
|
||||
u32 tid_bitmap;
|
||||
|
||||
info[0] = __le32_to_cpu(eu_stats->info0);
|
||||
info[1] = __le32_to_cpu(eu_stats->info1);
|
||||
@@ -629,10 +614,9 @@ ath12k_dp_mon_rx_parse_status_tlv(struct ath12k_base *ab,
|
||||
u32_get_bits(info[2], HAL_RX_PPDU_END_USER_STATS_INFO2_AST_INDEX);
|
||||
ppdu_info->fc_valid =
|
||||
u32_get_bits(info[1], HAL_RX_PPDU_END_USER_STATS_INFO1_FC_VALID);
|
||||
ppdu_info->tid =
|
||||
ffs(u32_get_bits(info[6],
|
||||
HAL_RX_PPDU_END_USER_STATS_INFO6_TID_BITMAP)
|
||||
- 1);
|
||||
tid_bitmap = u32_get_bits(info[6],
|
||||
HAL_RX_PPDU_END_USER_STATS_INFO6_TID_BITMAP);
|
||||
ppdu_info->tid = ffs(tid_bitmap) - 1;
|
||||
ppdu_info->tcp_msdu_count =
|
||||
u32_get_bits(info[4],
|
||||
HAL_RX_PPDU_END_USER_STATS_INFO4_TCP_MSDU_CNT);
|
||||
@@ -673,8 +657,8 @@ ath12k_dp_mon_rx_parse_status_tlv(struct ath12k_base *ab,
|
||||
&ppdu_info->userstats[userid];
|
||||
ppdu_info->num_users += 1;
|
||||
|
||||
ath12k_dp_mon_rx_handle_ofdma_info(tlv_data, rxuser_stats);
|
||||
ath12k_dp_mon_rx_populate_mu_user_info(tlv_data, ppdu_info,
|
||||
ath12k_dp_mon_rx_handle_ofdma_info(eu_stats, rxuser_stats);
|
||||
ath12k_dp_mon_rx_populate_mu_user_info(eu_stats, ppdu_info,
|
||||
rxuser_stats);
|
||||
}
|
||||
ppdu_info->mpdu_fcs_ok_bitmap[0] = __le32_to_cpu(eu_stats->rsvd1[0]);
|
||||
@@ -682,8 +666,8 @@ ath12k_dp_mon_rx_parse_status_tlv(struct ath12k_base *ab,
|
||||
break;
|
||||
}
|
||||
case HAL_RX_PPDU_END_USER_STATS_EXT: {
|
||||
struct hal_rx_ppdu_end_user_stats_ext *eu_stats =
|
||||
(struct hal_rx_ppdu_end_user_stats_ext *)tlv_data;
|
||||
const struct hal_rx_ppdu_end_user_stats_ext *eu_stats = tlv_data;
|
||||
|
||||
ppdu_info->mpdu_fcs_ok_bitmap[2] = __le32_to_cpu(eu_stats->info1);
|
||||
ppdu_info->mpdu_fcs_ok_bitmap[3] = __le32_to_cpu(eu_stats->info2);
|
||||
ppdu_info->mpdu_fcs_ok_bitmap[4] = __le32_to_cpu(eu_stats->info3);
|
||||
@@ -729,8 +713,7 @@ ath12k_dp_mon_rx_parse_status_tlv(struct ath12k_base *ab,
|
||||
break;
|
||||
|
||||
case HAL_PHYRX_RSSI_LEGACY: {
|
||||
struct hal_rx_phyrx_rssi_legacy_info *rssi =
|
||||
(struct hal_rx_phyrx_rssi_legacy_info *)tlv_data;
|
||||
const struct hal_rx_phyrx_rssi_legacy_info *rssi = tlv_data;
|
||||
|
||||
info[0] = __le32_to_cpu(rssi->info0);
|
||||
info[1] = __le32_to_cpu(rssi->info1);
|
||||
@@ -748,8 +731,7 @@ ath12k_dp_mon_rx_parse_status_tlv(struct ath12k_base *ab,
|
||||
break;
|
||||
}
|
||||
case HAL_RXPCU_PPDU_END_INFO: {
|
||||
struct hal_rx_ppdu_end_duration *ppdu_rx_duration =
|
||||
(struct hal_rx_ppdu_end_duration *)tlv_data;
|
||||
const struct hal_rx_ppdu_end_duration *ppdu_rx_duration = tlv_data;
|
||||
|
||||
info[0] = __le32_to_cpu(ppdu_rx_duration->info0);
|
||||
ppdu_info->rx_duration =
|
||||
@@ -760,8 +742,7 @@ ath12k_dp_mon_rx_parse_status_tlv(struct ath12k_base *ab,
|
||||
break;
|
||||
}
|
||||
case HAL_RX_MPDU_START: {
|
||||
struct hal_rx_mpdu_start *mpdu_start =
|
||||
(struct hal_rx_mpdu_start *)tlv_data;
|
||||
const struct hal_rx_mpdu_start *mpdu_start = tlv_data;
|
||||
struct dp_mon_mpdu *mon_mpdu = pmon->mon_mpdu;
|
||||
u16 peer_id;
|
||||
|
||||
@@ -790,8 +771,7 @@ ath12k_dp_mon_rx_parse_status_tlv(struct ath12k_base *ab,
|
||||
break;
|
||||
case HAL_MON_BUF_ADDR: {
|
||||
struct dp_rxdma_mon_ring *buf_ring = &ab->dp.rxdma_mon_buf_ring;
|
||||
struct dp_mon_packet_info *packet_info =
|
||||
(struct dp_mon_packet_info *)tlv_data;
|
||||
const struct dp_mon_packet_info *packet_info = tlv_data;
|
||||
int buf_id = u32_get_bits(packet_info->cookie,
|
||||
DP_RXDMA_BUF_COOKIE_BUF_ID);
|
||||
struct sk_buff *msdu;
|
||||
@@ -823,8 +803,7 @@ ath12k_dp_mon_rx_parse_status_tlv(struct ath12k_base *ab,
|
||||
break;
|
||||
}
|
||||
case HAL_RX_MSDU_END: {
|
||||
struct rx_msdu_end_qcn9274 *msdu_end =
|
||||
(struct rx_msdu_end_qcn9274 *)tlv_data;
|
||||
const struct rx_msdu_end_qcn9274 *msdu_end = tlv_data;
|
||||
bool is_first_msdu_in_mpdu;
|
||||
u16 msdu_end_info;
|
||||
|
||||
@@ -1093,8 +1072,14 @@ static void ath12k_dp_mon_rx_deliver_msdu(struct ath12k *ar, struct napi_struct
|
||||
decap = ath12k_dp_rx_h_decap_type(ar->ab, rxcb->rx_desc);
|
||||
spin_lock_bh(&ar->ab->base_lock);
|
||||
peer = ath12k_dp_rx_h_find_peer(ar->ab, msdu);
|
||||
if (peer && peer->sta)
|
||||
if (peer && peer->sta) {
|
||||
pubsta = peer->sta;
|
||||
if (pubsta->valid_links) {
|
||||
status->link_valid = 1;
|
||||
status->link_id = peer->link_id;
|
||||
}
|
||||
}
|
||||
|
||||
spin_unlock_bh(&ar->ab->base_lock);
|
||||
|
||||
ath12k_dbg(ar->ab, ATH12K_DBG_DATA,
|
||||
@@ -1199,19 +1184,19 @@ ath12k_dp_mon_parse_rx_dest(struct ath12k_base *ab, struct ath12k_mon_data *pmon
|
||||
struct sk_buff *skb)
|
||||
{
|
||||
struct hal_rx_mon_ppdu_info *ppdu_info = &pmon->mon_ppdu_info;
|
||||
struct hal_tlv_hdr *tlv;
|
||||
struct hal_tlv_64_hdr *tlv;
|
||||
enum hal_rx_mon_status hal_status;
|
||||
u32 tlv_userid = 0;
|
||||
u32 tlv_userid;
|
||||
u16 tlv_tag, tlv_len;
|
||||
u8 *ptr = skb->data;
|
||||
|
||||
memset(ppdu_info, 0, sizeof(struct hal_rx_mon_ppdu_info));
|
||||
|
||||
do {
|
||||
tlv = (struct hal_tlv_hdr *)ptr;
|
||||
tlv_tag = le32_get_bits(tlv->tl, HAL_TLV_HDR_TAG);
|
||||
tlv_len = le32_get_bits(tlv->tl, HAL_TLV_HDR_LEN);
|
||||
tlv_userid = le32_get_bits(tlv->tl, HAL_TLV_USR_ID);
|
||||
tlv = (struct hal_tlv_64_hdr *)ptr;
|
||||
tlv_tag = le64_get_bits(tlv->tl, HAL_TLV_64_HDR_TAG);
|
||||
tlv_len = le64_get_bits(tlv->tl, HAL_TLV_64_HDR_LEN);
|
||||
tlv_userid = le64_get_bits(tlv->tl, HAL_TLV_64_USR_ID);
|
||||
ptr += sizeof(*tlv);
|
||||
|
||||
/* The actual length of PPDU_END is the combined length of many PHY
|
||||
@@ -1226,7 +1211,7 @@ ath12k_dp_mon_parse_rx_dest(struct ath12k_base *ab, struct ath12k_mon_data *pmon
|
||||
hal_status = ath12k_dp_mon_rx_parse_status_tlv(ab, pmon,
|
||||
tlv_tag, ptr, tlv_userid);
|
||||
ptr += tlv_len;
|
||||
ptr = PTR_ALIGN(ptr, HAL_TLV_ALIGN);
|
||||
ptr = PTR_ALIGN(ptr, HAL_TLV_64_ALIGN);
|
||||
|
||||
if ((ptr - skb->data) >= DP_RX_BUFFER_SIZE)
|
||||
break;
|
||||
@@ -1603,7 +1588,7 @@ ath12k_dp_mon_tx_gen_prot_frame(struct dp_mon_tx_ppdu_info *tx_ppdu_info)
|
||||
static enum dp_mon_tx_tlv_status
|
||||
ath12k_dp_mon_tx_parse_status_tlv(struct ath12k_base *ab,
|
||||
struct ath12k_mon_data *pmon,
|
||||
u16 tlv_tag, u8 *tlv_data, u32 userid)
|
||||
u16 tlv_tag, const void *tlv_data, u32 userid)
|
||||
{
|
||||
struct dp_mon_tx_ppdu_info *tx_ppdu_info;
|
||||
enum dp_mon_tx_tlv_status status = DP_MON_TX_STATUS_PPDU_NOT_DONE;
|
||||
@@ -1613,8 +1598,7 @@ ath12k_dp_mon_tx_parse_status_tlv(struct ath12k_base *ab,
|
||||
|
||||
switch (tlv_tag) {
|
||||
case HAL_TX_FES_SETUP: {
|
||||
struct hal_tx_fes_setup *tx_fes_setup =
|
||||
(struct hal_tx_fes_setup *)tlv_data;
|
||||
const struct hal_tx_fes_setup *tx_fes_setup = tlv_data;
|
||||
|
||||
info[0] = __le32_to_cpu(tx_fes_setup->info0);
|
||||
tx_ppdu_info->ppdu_id = __le32_to_cpu(tx_fes_setup->schedule_id);
|
||||
@@ -1625,8 +1609,7 @@ ath12k_dp_mon_tx_parse_status_tlv(struct ath12k_base *ab,
|
||||
}
|
||||
|
||||
case HAL_TX_FES_STATUS_END: {
|
||||
struct hal_tx_fes_status_end *tx_fes_status_end =
|
||||
(struct hal_tx_fes_status_end *)tlv_data;
|
||||
const struct hal_tx_fes_status_end *tx_fes_status_end = tlv_data;
|
||||
u32 tst_15_0, tst_31_16;
|
||||
|
||||
info[0] = __le32_to_cpu(tx_fes_status_end->info0);
|
||||
@@ -1643,8 +1626,7 @@ ath12k_dp_mon_tx_parse_status_tlv(struct ath12k_base *ab,
|
||||
}
|
||||
|
||||
case HAL_RX_RESPONSE_REQUIRED_INFO: {
|
||||
struct hal_rx_resp_req_info *rx_resp_req_info =
|
||||
(struct hal_rx_resp_req_info *)tlv_data;
|
||||
const struct hal_rx_resp_req_info *rx_resp_req_info = tlv_data;
|
||||
u32 addr_32;
|
||||
u16 addr_16;
|
||||
|
||||
@@ -1689,8 +1671,7 @@ ath12k_dp_mon_tx_parse_status_tlv(struct ath12k_base *ab,
|
||||
}
|
||||
|
||||
case HAL_PCU_PPDU_SETUP_INIT: {
|
||||
struct hal_tx_pcu_ppdu_setup_init *ppdu_setup =
|
||||
(struct hal_tx_pcu_ppdu_setup_init *)tlv_data;
|
||||
const struct hal_tx_pcu_ppdu_setup_init *ppdu_setup = tlv_data;
|
||||
u32 addr_32;
|
||||
u16 addr_16;
|
||||
|
||||
@@ -1736,8 +1717,7 @@ ath12k_dp_mon_tx_parse_status_tlv(struct ath12k_base *ab,
|
||||
}
|
||||
|
||||
case HAL_TX_QUEUE_EXTENSION: {
|
||||
struct hal_tx_queue_exten *tx_q_exten =
|
||||
(struct hal_tx_queue_exten *)tlv_data;
|
||||
const struct hal_tx_queue_exten *tx_q_exten = tlv_data;
|
||||
|
||||
info[0] = __le32_to_cpu(tx_q_exten->info0);
|
||||
|
||||
@@ -1749,8 +1729,7 @@ ath12k_dp_mon_tx_parse_status_tlv(struct ath12k_base *ab,
|
||||
}
|
||||
|
||||
case HAL_TX_FES_STATUS_START: {
|
||||
struct hal_tx_fes_status_start *tx_fes_start =
|
||||
(struct hal_tx_fes_status_start *)tlv_data;
|
||||
const struct hal_tx_fes_status_start *tx_fes_start = tlv_data;
|
||||
|
||||
info[0] = __le32_to_cpu(tx_fes_start->info0);
|
||||
|
||||
@@ -1761,8 +1740,7 @@ ath12k_dp_mon_tx_parse_status_tlv(struct ath12k_base *ab,
|
||||
}
|
||||
|
||||
case HAL_TX_FES_STATUS_PROT: {
|
||||
struct hal_tx_fes_status_prot *tx_fes_status =
|
||||
(struct hal_tx_fes_status_prot *)tlv_data;
|
||||
const struct hal_tx_fes_status_prot *tx_fes_status = tlv_data;
|
||||
u32 start_timestamp;
|
||||
u32 end_timestamp;
|
||||
|
||||
@@ -1789,8 +1767,7 @@ ath12k_dp_mon_tx_parse_status_tlv(struct ath12k_base *ab,
|
||||
|
||||
case HAL_TX_FES_STATUS_START_PPDU:
|
||||
case HAL_TX_FES_STATUS_START_PROT: {
|
||||
struct hal_tx_fes_status_start_prot *tx_fes_stat_start =
|
||||
(struct hal_tx_fes_status_start_prot *)tlv_data;
|
||||
const struct hal_tx_fes_status_start_prot *tx_fes_stat_start = tlv_data;
|
||||
u64 ppdu_ts;
|
||||
|
||||
info[0] = __le32_to_cpu(tx_fes_stat_start->info0);
|
||||
@@ -1805,8 +1782,7 @@ ath12k_dp_mon_tx_parse_status_tlv(struct ath12k_base *ab,
|
||||
}
|
||||
|
||||
case HAL_TX_FES_STATUS_USER_PPDU: {
|
||||
struct hal_tx_fes_status_user_ppdu *tx_fes_usr_ppdu =
|
||||
(struct hal_tx_fes_status_user_ppdu *)tlv_data;
|
||||
const struct hal_tx_fes_status_user_ppdu *tx_fes_usr_ppdu = tlv_data;
|
||||
|
||||
info[0] = __le32_to_cpu(tx_fes_usr_ppdu->info0);
|
||||
|
||||
@@ -1849,8 +1825,7 @@ ath12k_dp_mon_tx_parse_status_tlv(struct ath12k_base *ab,
|
||||
break;
|
||||
|
||||
case HAL_RX_FRAME_BITMAP_ACK: {
|
||||
struct hal_rx_frame_bitmap_ack *fbm_ack =
|
||||
(struct hal_rx_frame_bitmap_ack *)tlv_data;
|
||||
const struct hal_rx_frame_bitmap_ack *fbm_ack = tlv_data;
|
||||
u32 addr_32;
|
||||
u16 addr_16;
|
||||
|
||||
@@ -1868,8 +1843,7 @@ ath12k_dp_mon_tx_parse_status_tlv(struct ath12k_base *ab,
|
||||
}
|
||||
|
||||
case HAL_MACTX_PHY_DESC: {
|
||||
struct hal_tx_phy_desc *tx_phy_desc =
|
||||
(struct hal_tx_phy_desc *)tlv_data;
|
||||
const struct hal_tx_phy_desc *tx_phy_desc = tlv_data;
|
||||
|
||||
info[0] = __le32_to_cpu(tx_phy_desc->info0);
|
||||
info[1] = __le32_to_cpu(tx_phy_desc->info1);
|
||||
|
||||
@@ -1697,7 +1697,11 @@ static void ath12k_htt_mlo_offset_event_handler(struct ath12k_base *ab,
|
||||
rcu_read_lock();
|
||||
ar = ath12k_mac_get_ar_by_pdev_id(ab, pdev_id);
|
||||
if (!ar) {
|
||||
ath12k_warn(ab, "invalid pdev id %d on htt mlo offset\n", pdev_id);
|
||||
/* It is possible that the ar is not yet active (started).
|
||||
* The above function will only look for the active pdev
|
||||
* and hence %NULL return is possible. Just silently
|
||||
* discard this message
|
||||
*/
|
||||
goto exit;
|
||||
}
|
||||
|
||||
@@ -2474,6 +2478,11 @@ static void ath12k_dp_rx_deliver_msdu(struct ath12k *ar, struct napi_struct *nap
|
||||
|
||||
pubsta = peer ? peer->sta : NULL;
|
||||
|
||||
if (pubsta && pubsta->valid_links) {
|
||||
status->link_valid = 1;
|
||||
status->link_id = peer->link_id;
|
||||
}
|
||||
|
||||
spin_unlock_bh(&ab->base_lock);
|
||||
|
||||
ath12k_dbg(ab, ATH12K_DBG_DATA,
|
||||
@@ -2595,11 +2604,14 @@ static void ath12k_dp_rx_process_received_packets(struct ath12k_base *ab,
|
||||
struct sk_buff_head *msdu_list,
|
||||
int ring_id)
|
||||
{
|
||||
struct ath12k_hw_group *ag = ab->ag;
|
||||
struct ieee80211_rx_status rx_status = {0};
|
||||
struct ath12k_skb_rxcb *rxcb;
|
||||
struct sk_buff *msdu;
|
||||
struct ath12k *ar;
|
||||
u8 mac_id, pdev_id;
|
||||
struct ath12k_hw_link *hw_links = ag->hw_links;
|
||||
struct ath12k_base *partner_ab;
|
||||
u8 hw_link_id, pdev_id;
|
||||
int ret;
|
||||
|
||||
if (skb_queue_empty(msdu_list))
|
||||
@@ -2609,15 +2621,18 @@ static void ath12k_dp_rx_process_received_packets(struct ath12k_base *ab,
|
||||
|
||||
while ((msdu = __skb_dequeue(msdu_list))) {
|
||||
rxcb = ATH12K_SKB_RXCB(msdu);
|
||||
mac_id = rxcb->mac_id;
|
||||
pdev_id = ath12k_hw_mac_id_to_pdev_id(ab->hw_params, mac_id);
|
||||
ar = ab->pdevs[pdev_id].ar;
|
||||
if (!rcu_dereference(ab->pdevs_active[pdev_id])) {
|
||||
hw_link_id = rxcb->hw_link_id;
|
||||
partner_ab = ath12k_ag_to_ab(ag,
|
||||
hw_links[hw_link_id].device_id);
|
||||
pdev_id = ath12k_hw_mac_id_to_pdev_id(partner_ab->hw_params,
|
||||
hw_links[hw_link_id].pdev_idx);
|
||||
ar = partner_ab->pdevs[pdev_id].ar;
|
||||
if (!rcu_dereference(partner_ab->pdevs_active[pdev_id])) {
|
||||
dev_kfree_skb_any(msdu);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (test_bit(ATH12K_CAC_RUNNING, &ar->dev_flags)) {
|
||||
if (test_bit(ATH12K_FLAG_CAC_RUNNING, &ar->dev_flags)) {
|
||||
dev_kfree_skb_any(msdu);
|
||||
continue;
|
||||
}
|
||||
@@ -2662,23 +2677,29 @@ static u16 ath12k_dp_rx_get_peer_id(struct ath12k_base *ab,
|
||||
int ath12k_dp_rx_process(struct ath12k_base *ab, int ring_id,
|
||||
struct napi_struct *napi, int budget)
|
||||
{
|
||||
LIST_HEAD(rx_desc_used_list);
|
||||
struct ath12k_hw_group *ag = ab->ag;
|
||||
struct list_head rx_desc_used_list[ATH12K_MAX_SOCS];
|
||||
struct ath12k_hw_link *hw_links = ag->hw_links;
|
||||
int num_buffs_reaped[ATH12K_MAX_SOCS] = {};
|
||||
struct ath12k_rx_desc_info *desc_info;
|
||||
struct ath12k_dp *dp = &ab->dp;
|
||||
struct dp_rxdma_ring *rx_ring = &dp->rx_refill_buf_ring;
|
||||
struct hal_reo_dest_ring *desc;
|
||||
int num_buffs_reaped = 0;
|
||||
struct ath12k_base *partner_ab;
|
||||
struct sk_buff_head msdu_list;
|
||||
struct ath12k_skb_rxcb *rxcb;
|
||||
int total_msdu_reaped = 0;
|
||||
u8 hw_link_id, device_id;
|
||||
struct hal_srng *srng;
|
||||
struct sk_buff *msdu;
|
||||
bool done = false;
|
||||
int mac_id;
|
||||
u64 desc_va;
|
||||
|
||||
__skb_queue_head_init(&msdu_list);
|
||||
|
||||
for (device_id = 0; device_id < ATH12K_MAX_SOCS; device_id++)
|
||||
INIT_LIST_HEAD(&rx_desc_used_list[device_id]);
|
||||
|
||||
srng = &ab->hal.srng_list[dp->reo_dst_ring[ring_id].ring_id];
|
||||
|
||||
spin_lock_bh(&srng->lock);
|
||||
@@ -2695,18 +2716,29 @@ try_again:
|
||||
cookie = le32_get_bits(desc->buf_addr_info.info1,
|
||||
BUFFER_ADDR_INFO1_SW_COOKIE);
|
||||
|
||||
mac_id = le32_get_bits(desc->info0,
|
||||
HAL_REO_DEST_RING_INFO0_SRC_LINK_ID);
|
||||
hw_link_id = le32_get_bits(desc->info0,
|
||||
HAL_REO_DEST_RING_INFO0_SRC_LINK_ID);
|
||||
|
||||
desc_va = ((u64)le32_to_cpu(desc->buf_va_hi) << 32 |
|
||||
le32_to_cpu(desc->buf_va_lo));
|
||||
desc_info = (struct ath12k_rx_desc_info *)((unsigned long)desc_va);
|
||||
|
||||
device_id = hw_links[hw_link_id].device_id;
|
||||
partner_ab = ath12k_ag_to_ab(ag, device_id);
|
||||
if (unlikely(!partner_ab)) {
|
||||
if (desc_info->skb) {
|
||||
dev_kfree_skb_any(desc_info->skb);
|
||||
desc_info->skb = NULL;
|
||||
}
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
/* retry manual desc retrieval */
|
||||
if (!desc_info) {
|
||||
desc_info = ath12k_dp_get_rx_desc(ab, cookie);
|
||||
desc_info = ath12k_dp_get_rx_desc(partner_ab, cookie);
|
||||
if (!desc_info) {
|
||||
ath12k_warn(ab, "Invalid cookie in manual descriptor retrieval: 0x%x\n",
|
||||
ath12k_warn(partner_ab, "Invalid cookie in manual descriptor retrieval: 0x%x\n",
|
||||
cookie);
|
||||
continue;
|
||||
}
|
||||
@@ -2718,14 +2750,14 @@ try_again:
|
||||
msdu = desc_info->skb;
|
||||
desc_info->skb = NULL;
|
||||
|
||||
list_add_tail(&desc_info->list, &rx_desc_used_list);
|
||||
list_add_tail(&desc_info->list, &rx_desc_used_list[device_id]);
|
||||
|
||||
rxcb = ATH12K_SKB_RXCB(msdu);
|
||||
dma_unmap_single(ab->dev, rxcb->paddr,
|
||||
dma_unmap_single(partner_ab->dev, rxcb->paddr,
|
||||
msdu->len + skb_tailroom(msdu),
|
||||
DMA_FROM_DEVICE);
|
||||
|
||||
num_buffs_reaped++;
|
||||
num_buffs_reaped[device_id]++;
|
||||
|
||||
push_reason = le32_get_bits(desc->info0,
|
||||
HAL_REO_DEST_RING_INFO0_PUSH_REASON);
|
||||
@@ -2745,7 +2777,7 @@ try_again:
|
||||
RX_MSDU_DESC_INFO0_LAST_MSDU_IN_MPDU);
|
||||
rxcb->is_continuation = !!(le32_to_cpu(msdu_info->info0) &
|
||||
RX_MSDU_DESC_INFO0_MSDU_CONTINUATION);
|
||||
rxcb->mac_id = mac_id;
|
||||
rxcb->hw_link_id = hw_link_id;
|
||||
rxcb->peer_id = ath12k_dp_rx_get_peer_id(ab, dp->peer_metadata_ver,
|
||||
mpdu_info->peer_meta_data);
|
||||
rxcb->tid = le32_get_bits(mpdu_info->info0,
|
||||
@@ -2782,8 +2814,17 @@ try_again:
|
||||
if (!total_msdu_reaped)
|
||||
goto exit;
|
||||
|
||||
ath12k_dp_rx_bufs_replenish(ab, rx_ring, &rx_desc_used_list,
|
||||
num_buffs_reaped);
|
||||
for (device_id = 0; device_id < ATH12K_MAX_SOCS; device_id++) {
|
||||
if (!num_buffs_reaped[device_id])
|
||||
continue;
|
||||
|
||||
partner_ab = ath12k_ag_to_ab(ag, device_id);
|
||||
rx_ring = &partner_ab->dp.rx_refill_buf_ring;
|
||||
|
||||
ath12k_dp_rx_bufs_replenish(partner_ab, rx_ring,
|
||||
&rx_desc_used_list[device_id],
|
||||
num_buffs_reaped[device_id]);
|
||||
}
|
||||
|
||||
ath12k_dp_rx_process_received_packets(ab, napi, &msdu_list,
|
||||
ring_id);
|
||||
@@ -2830,6 +2871,7 @@ int ath12k_dp_rx_peer_frag_setup(struct ath12k *ar, const u8 *peer_mac, int vdev
|
||||
|
||||
if (!peer->primary_link) {
|
||||
spin_unlock_bh(&ab->base_lock);
|
||||
crypto_free_shash(tfm);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -3442,7 +3484,7 @@ ath12k_dp_process_rx_err_buf(struct ath12k *ar, struct hal_reo_dest_ring *desc,
|
||||
goto exit;
|
||||
}
|
||||
|
||||
if (test_bit(ATH12K_CAC_RUNNING, &ar->dev_flags)) {
|
||||
if (test_bit(ATH12K_FLAG_CAC_RUNNING, &ar->dev_flags)) {
|
||||
dev_kfree_skb_any(msdu);
|
||||
goto exit;
|
||||
}
|
||||
@@ -3472,7 +3514,10 @@ exit:
|
||||
int ath12k_dp_rx_process_err(struct ath12k_base *ab, struct napi_struct *napi,
|
||||
int budget)
|
||||
{
|
||||
struct ath12k_hw_group *ag = ab->ag;
|
||||
struct list_head rx_desc_used_list[ATH12K_MAX_SOCS];
|
||||
u32 msdu_cookies[HAL_NUM_RX_MSDUS_PER_LINK_DESC];
|
||||
int num_buffs_reaped[ATH12K_MAX_SOCS] = {};
|
||||
struct dp_link_desc_bank *link_desc_banks;
|
||||
enum hal_rx_buf_return_buf_manager rbm;
|
||||
struct hal_rx_msdu_link *link_desc_va;
|
||||
@@ -3480,11 +3525,11 @@ int ath12k_dp_rx_process_err(struct ath12k_base *ab, struct napi_struct *napi,
|
||||
struct hal_reo_dest_ring *reo_desc;
|
||||
struct dp_rxdma_ring *rx_ring;
|
||||
struct dp_srng *reo_except;
|
||||
LIST_HEAD(rx_desc_used_list);
|
||||
struct ath12k_hw_link *hw_links = ag->hw_links;
|
||||
struct ath12k_base *partner_ab;
|
||||
u8 hw_link_id, device_id;
|
||||
u32 desc_bank, num_msdus;
|
||||
struct hal_srng *srng;
|
||||
struct ath12k_dp *dp;
|
||||
int mac_id;
|
||||
struct ath12k *ar;
|
||||
dma_addr_t paddr;
|
||||
bool is_frag;
|
||||
@@ -3494,9 +3539,10 @@ int ath12k_dp_rx_process_err(struct ath12k_base *ab, struct napi_struct *napi,
|
||||
tot_n_bufs_reaped = 0;
|
||||
quota = budget;
|
||||
|
||||
dp = &ab->dp;
|
||||
reo_except = &dp->reo_except_ring;
|
||||
link_desc_banks = dp->link_desc_banks;
|
||||
for (device_id = 0; device_id < ATH12K_MAX_SOCS; device_id++)
|
||||
INIT_LIST_HEAD(&rx_desc_used_list[device_id]);
|
||||
|
||||
reo_except = &ab->dp.reo_except_ring;
|
||||
|
||||
srng = &ab->hal.srng_list[reo_except->ring_id];
|
||||
|
||||
@@ -3516,16 +3562,27 @@ int ath12k_dp_rx_process_err(struct ath12k_base *ab, struct napi_struct *napi,
|
||||
ret);
|
||||
continue;
|
||||
}
|
||||
|
||||
hw_link_id = le32_get_bits(reo_desc->info0,
|
||||
HAL_REO_DEST_RING_INFO0_SRC_LINK_ID);
|
||||
device_id = hw_links[hw_link_id].device_id;
|
||||
partner_ab = ath12k_ag_to_ab(ag, device_id);
|
||||
|
||||
pdev_id = ath12k_hw_mac_id_to_pdev_id(partner_ab->hw_params,
|
||||
hw_links[hw_link_id].pdev_idx);
|
||||
ar = partner_ab->pdevs[pdev_id].ar;
|
||||
|
||||
link_desc_banks = partner_ab->dp.link_desc_banks;
|
||||
link_desc_va = link_desc_banks[desc_bank].vaddr +
|
||||
(paddr - link_desc_banks[desc_bank].paddr);
|
||||
ath12k_hal_rx_msdu_link_info_get(link_desc_va, &num_msdus, msdu_cookies,
|
||||
&rbm);
|
||||
if (rbm != dp->idle_link_rbm &&
|
||||
if (rbm != partner_ab->dp.idle_link_rbm &&
|
||||
rbm != HAL_RX_BUF_RBM_SW3_BM &&
|
||||
rbm != ab->hw_params->hal_params->rx_buf_rbm) {
|
||||
rbm != partner_ab->hw_params->hal_params->rx_buf_rbm) {
|
||||
ab->soc_stats.invalid_rbm++;
|
||||
ath12k_warn(ab, "invalid return buffer manager %d\n", rbm);
|
||||
ath12k_dp_rx_link_desc_return(ab, reo_desc,
|
||||
ath12k_dp_rx_link_desc_return(partner_ab, reo_desc,
|
||||
HAL_WBM_REL_BM_ACT_REL_MSDU);
|
||||
continue;
|
||||
}
|
||||
@@ -3535,26 +3592,26 @@ int ath12k_dp_rx_process_err(struct ath12k_base *ab, struct napi_struct *napi,
|
||||
|
||||
/* Process only rx fragments with one msdu per link desc below, and drop
|
||||
* msdu's indicated due to error reasons.
|
||||
* Dynamic fragmentation not supported in Multi-link client, so drop the
|
||||
* partner device buffers.
|
||||
*/
|
||||
if (!is_frag || num_msdus > 1) {
|
||||
if (!is_frag || num_msdus > 1 ||
|
||||
partner_ab->device_id != ab->device_id) {
|
||||
drop = true;
|
||||
|
||||
/* Return the link desc back to wbm idle list */
|
||||
ath12k_dp_rx_link_desc_return(ab, reo_desc,
|
||||
ath12k_dp_rx_link_desc_return(partner_ab, reo_desc,
|
||||
HAL_WBM_REL_BM_ACT_PUT_IN_IDLE);
|
||||
}
|
||||
|
||||
for (i = 0; i < num_msdus; i++) {
|
||||
mac_id = le32_get_bits(reo_desc->info0,
|
||||
HAL_REO_DEST_RING_INFO0_SRC_LINK_ID);
|
||||
|
||||
pdev_id = ath12k_hw_mac_id_to_pdev_id(ab->hw_params, mac_id);
|
||||
ar = ab->pdevs[pdev_id].ar;
|
||||
|
||||
if (!ath12k_dp_process_rx_err_buf(ar, reo_desc,
|
||||
&rx_desc_used_list,
|
||||
&rx_desc_used_list[device_id],
|
||||
drop,
|
||||
msdu_cookies[i]))
|
||||
msdu_cookies[i])) {
|
||||
num_buffs_reaped[device_id]++;
|
||||
tot_n_bufs_reaped++;
|
||||
}
|
||||
}
|
||||
|
||||
if (tot_n_bufs_reaped >= quota) {
|
||||
@@ -3570,10 +3627,17 @@ exit:
|
||||
|
||||
spin_unlock_bh(&srng->lock);
|
||||
|
||||
rx_ring = &dp->rx_refill_buf_ring;
|
||||
for (device_id = 0; device_id < ATH12K_MAX_SOCS; device_id++) {
|
||||
if (!num_buffs_reaped[device_id])
|
||||
continue;
|
||||
|
||||
ath12k_dp_rx_bufs_replenish(ab, rx_ring, &rx_desc_used_list,
|
||||
tot_n_bufs_reaped);
|
||||
partner_ab = ath12k_ag_to_ab(ag, device_id);
|
||||
rx_ring = &partner_ab->dp.rx_refill_buf_ring;
|
||||
|
||||
ath12k_dp_rx_bufs_replenish(partner_ab, rx_ring,
|
||||
&rx_desc_used_list[device_id],
|
||||
num_buffs_reaped[device_id]);
|
||||
}
|
||||
|
||||
return tot_n_bufs_reaped;
|
||||
}
|
||||
@@ -3790,7 +3854,8 @@ static void ath12k_dp_rx_wbm_err(struct ath12k *ar,
|
||||
int ath12k_dp_rx_process_wbm_err(struct ath12k_base *ab,
|
||||
struct napi_struct *napi, int budget)
|
||||
{
|
||||
LIST_HEAD(rx_desc_used_list);
|
||||
struct list_head rx_desc_used_list[ATH12K_MAX_SOCS];
|
||||
struct ath12k_hw_group *ag = ab->ag;
|
||||
struct ath12k *ar;
|
||||
struct ath12k_dp *dp = &ab->dp;
|
||||
struct dp_rxdma_ring *rx_ring;
|
||||
@@ -3800,17 +3865,22 @@ int ath12k_dp_rx_process_wbm_err(struct ath12k_base *ab,
|
||||
struct sk_buff_head msdu_list, scatter_msdu_list;
|
||||
struct ath12k_skb_rxcb *rxcb;
|
||||
void *rx_desc;
|
||||
u8 mac_id;
|
||||
int num_buffs_reaped = 0;
|
||||
int num_buffs_reaped[ATH12K_MAX_SOCS] = {};
|
||||
int total_num_buffs_reaped = 0;
|
||||
struct ath12k_rx_desc_info *desc_info;
|
||||
struct ath12k_hw_link *hw_links = ag->hw_links;
|
||||
struct ath12k_base *partner_ab;
|
||||
u8 hw_link_id, device_id;
|
||||
int ret, pdev_id;
|
||||
struct hal_rx_desc *msdu_data;
|
||||
|
||||
__skb_queue_head_init(&msdu_list);
|
||||
__skb_queue_head_init(&scatter_msdu_list);
|
||||
|
||||
for (device_id = 0; device_id < ATH12K_MAX_SOCS; device_id++)
|
||||
INIT_LIST_HEAD(&rx_desc_used_list[device_id]);
|
||||
|
||||
srng = &ab->hal.srng_list[dp->rx_rel_ring.ring_id];
|
||||
rx_ring = &dp->rx_refill_buf_ring;
|
||||
spin_lock_bh(&srng->lock);
|
||||
|
||||
ath12k_hal_srng_access_begin(ab, srng);
|
||||
@@ -3846,14 +3916,27 @@ int ath12k_dp_rx_process_wbm_err(struct ath12k_base *ab,
|
||||
msdu = desc_info->skb;
|
||||
desc_info->skb = NULL;
|
||||
|
||||
list_add_tail(&desc_info->list, &rx_desc_used_list);
|
||||
device_id = desc_info->device_id;
|
||||
partner_ab = ath12k_ag_to_ab(ag, device_id);
|
||||
if (unlikely(!partner_ab)) {
|
||||
dev_kfree_skb_any(msdu);
|
||||
|
||||
/* In any case continuation bit is set
|
||||
* in the previous record, cleanup scatter_msdu_list
|
||||
*/
|
||||
ath12k_dp_clean_up_skb_list(&scatter_msdu_list);
|
||||
continue;
|
||||
}
|
||||
|
||||
list_add_tail(&desc_info->list, &rx_desc_used_list[device_id]);
|
||||
|
||||
rxcb = ATH12K_SKB_RXCB(msdu);
|
||||
dma_unmap_single(ab->dev, rxcb->paddr,
|
||||
dma_unmap_single(partner_ab->dev, rxcb->paddr,
|
||||
msdu->len + skb_tailroom(msdu),
|
||||
DMA_FROM_DEVICE);
|
||||
|
||||
num_buffs_reaped++;
|
||||
num_buffs_reaped[device_id]++;
|
||||
total_num_buffs_reaped++;
|
||||
|
||||
if (!err_info.continuation)
|
||||
budget--;
|
||||
@@ -3877,9 +3960,9 @@ int ath12k_dp_rx_process_wbm_err(struct ath12k_base *ab,
|
||||
continue;
|
||||
}
|
||||
|
||||
mac_id = ath12k_dp_rx_get_msdu_src_link(ab,
|
||||
msdu_data);
|
||||
if (mac_id >= MAX_RADIOS) {
|
||||
hw_link_id = ath12k_dp_rx_get_msdu_src_link(partner_ab,
|
||||
msdu_data);
|
||||
if (hw_link_id >= ATH12K_GROUP_MAX_RADIO) {
|
||||
dev_kfree_skb_any(msdu);
|
||||
|
||||
/* In any case continuation bit is set
|
||||
@@ -3894,7 +3977,7 @@ int ath12k_dp_rx_process_wbm_err(struct ath12k_base *ab,
|
||||
|
||||
skb_queue_walk(&scatter_msdu_list, msdu) {
|
||||
rxcb = ATH12K_SKB_RXCB(msdu);
|
||||
rxcb->mac_id = mac_id;
|
||||
rxcb->hw_link_id = hw_link_id;
|
||||
}
|
||||
|
||||
skb_queue_splice_tail_init(&scatter_msdu_list,
|
||||
@@ -3902,7 +3985,7 @@ int ath12k_dp_rx_process_wbm_err(struct ath12k_base *ab,
|
||||
}
|
||||
|
||||
rxcb = ATH12K_SKB_RXCB(msdu);
|
||||
rxcb->mac_id = mac_id;
|
||||
rxcb->hw_link_id = hw_link_id;
|
||||
__skb_queue_tail(&msdu_list, msdu);
|
||||
}
|
||||
|
||||
@@ -3915,26 +3998,46 @@ int ath12k_dp_rx_process_wbm_err(struct ath12k_base *ab,
|
||||
|
||||
spin_unlock_bh(&srng->lock);
|
||||
|
||||
if (!num_buffs_reaped)
|
||||
if (!total_num_buffs_reaped)
|
||||
goto done;
|
||||
|
||||
ath12k_dp_rx_bufs_replenish(ab, rx_ring, &rx_desc_used_list,
|
||||
num_buffs_reaped);
|
||||
for (device_id = 0; device_id < ATH12K_MAX_SOCS; device_id++) {
|
||||
if (!num_buffs_reaped[device_id])
|
||||
continue;
|
||||
|
||||
partner_ab = ath12k_ag_to_ab(ag, device_id);
|
||||
rx_ring = &partner_ab->dp.rx_refill_buf_ring;
|
||||
|
||||
ath12k_dp_rx_bufs_replenish(ab, rx_ring,
|
||||
&rx_desc_used_list[device_id],
|
||||
num_buffs_reaped[device_id]);
|
||||
}
|
||||
|
||||
rcu_read_lock();
|
||||
while ((msdu = __skb_dequeue(&msdu_list))) {
|
||||
rxcb = ATH12K_SKB_RXCB(msdu);
|
||||
mac_id = rxcb->mac_id;
|
||||
hw_link_id = rxcb->hw_link_id;
|
||||
|
||||
pdev_id = ath12k_hw_mac_id_to_pdev_id(ab->hw_params, mac_id);
|
||||
ar = ab->pdevs[pdev_id].ar;
|
||||
|
||||
if (!ar || !rcu_dereference(ar->ab->pdevs_active[mac_id])) {
|
||||
device_id = hw_links[hw_link_id].device_id;
|
||||
partner_ab = ath12k_ag_to_ab(ag, device_id);
|
||||
if (unlikely(!partner_ab)) {
|
||||
ath12k_dbg(ab, ATH12K_DBG_DATA,
|
||||
"Unable to process WBM error msdu due to invalid hw link id %d device id %d\n",
|
||||
hw_link_id, device_id);
|
||||
dev_kfree_skb_any(msdu);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (test_bit(ATH12K_CAC_RUNNING, &ar->dev_flags)) {
|
||||
pdev_id = ath12k_hw_mac_id_to_pdev_id(partner_ab->hw_params,
|
||||
hw_links[hw_link_id].pdev_idx);
|
||||
ar = partner_ab->pdevs[pdev_id].ar;
|
||||
|
||||
if (!ar || !rcu_dereference(ar->ab->pdevs_active[hw_link_id])) {
|
||||
dev_kfree_skb_any(msdu);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (test_bit(ATH12K_FLAG_CAC_RUNNING, &ar->dev_flags)) {
|
||||
dev_kfree_skb_any(msdu);
|
||||
continue;
|
||||
}
|
||||
@@ -3942,7 +4045,7 @@ int ath12k_dp_rx_process_wbm_err(struct ath12k_base *ab,
|
||||
}
|
||||
rcu_read_unlock();
|
||||
done:
|
||||
return num_buffs_reaped;
|
||||
return total_num_buffs_reaped;
|
||||
}
|
||||
|
||||
void ath12k_dp_rx_process_reo_status(struct ath12k_base *ab)
|
||||
|
||||
@@ -23,6 +23,9 @@ enum ath12k_fw_features {
|
||||
*/
|
||||
ATH12K_FW_FEATURE_MULTI_QRTR_ID = 0,
|
||||
|
||||
/* The firmware supports MLO capability */
|
||||
ATH12K_FW_FEATURE_MLO,
|
||||
|
||||
/* keep last */
|
||||
ATH12K_FW_FEATURE_COUNT,
|
||||
};
|
||||
|
||||
@@ -181,7 +181,7 @@ static const struct hal_srng_config hw_srng_config_template[] = {
|
||||
.max_size = HAL_WBM2PPE_RELEASE_RING_BASE_MSB_RING_SIZE,
|
||||
},
|
||||
[HAL_TX_MONITOR_BUF] = {
|
||||
.start_ring_id = HAL_SRNG_SW2TXMON_BUF0,
|
||||
.start_ring_id = HAL_SRNG_RING_ID_WMAC1_SW2TXMON_BUF0,
|
||||
.max_rings = 1,
|
||||
.entry_size = sizeof(struct hal_mon_buf_ring) >> 2,
|
||||
.mac_type = ATH12K_HAL_SRNG_PMAC,
|
||||
|
||||
@@ -485,8 +485,8 @@ enum hal_srng_ring_id {
|
||||
HAL_SRNG_RING_ID_WMAC1_RXMON2SW0 = HAL_SRNG_RING_ID_WMAC1_RXDMA2SW1,
|
||||
HAL_SRNG_RING_ID_WMAC1_SW2RXDMA1_DESC,
|
||||
HAL_SRNG_RING_ID_RXDMA_DIR_BUF,
|
||||
HAL_SRNG_RING_ID_WMAC1_SW2TXMON_BUF0,
|
||||
HAL_SRNG_RING_ID_WMAC1_TXMON2SW0_BUF0,
|
||||
HAL_SRNG_RING_ID_WMAC1_SW2TXMON_BUF0,
|
||||
|
||||
HAL_SRNG_RING_ID_PMAC1_ID_END,
|
||||
};
|
||||
|
||||
@@ -522,7 +522,7 @@ enum hal_tlv_tag {
|
||||
HAL_PHYRXHT_SIG_USR_SU = 468 /* 0x1d4 */,
|
||||
HAL_PHYRXHT_SIG_USR_MU_MIMO = 469 /* 0x1d5 */,
|
||||
HAL_PHYRX_GENERIC_U_SIG = 470 /* 0x1d6 */,
|
||||
HAL_PHYRX_GENERICHT_SIG = 471 /* 0x1d7 */,
|
||||
HAL_PHYRX_GENERIC_EHT_SIG = 471 /* 0x1d7 */,
|
||||
HAL_OVERWRITE_RESP_START = 472 /* 0x1d8 */,
|
||||
HAL_OVERWRITE_RESP_PREAMBLE_INFO = 473 /* 0x1d9 */,
|
||||
HAL_OVERWRITE_RESP_FRAME_INFO = 474 /* 0x1da */,
|
||||
@@ -579,6 +579,8 @@ struct hal_tlv_hdr {
|
||||
|
||||
#define HAL_TLV_64_HDR_TAG GENMASK(9, 1)
|
||||
#define HAL_TLV_64_HDR_LEN GENMASK(21, 10)
|
||||
#define HAL_TLV_64_USR_ID GENMASK(31, 26)
|
||||
#define HAL_TLV_64_ALIGN 8
|
||||
|
||||
struct hal_tlv_64_hdr {
|
||||
__le64 tl;
|
||||
|
||||
@@ -19,7 +19,7 @@ struct hal_rx_wbm_rel_info {
|
||||
bool hw_cc_done;
|
||||
};
|
||||
|
||||
#define HAL_INVALID_PEERID 0xffff
|
||||
#define HAL_INVALID_PEERID 0x3fff
|
||||
#define VHT_SIG_SU_NSS_MASK 0x7
|
||||
|
||||
#define HAL_RX_MAX_MCS 12
|
||||
@@ -245,6 +245,8 @@ struct hal_rx_ppdu_start {
|
||||
__le32 rsvd[2];
|
||||
} __packed;
|
||||
|
||||
#define HAL_RX_PPDU_END_USER_STATS_INFO0_PEER_ID GENMASK(13, 0)
|
||||
#define HAL_RX_PPDU_END_USER_STATS_INFO0_DEVICE_ID GENMASK(15, 14)
|
||||
#define HAL_RX_PPDU_END_USER_STATS_INFO0_MPDU_CNT_FCS_ERR GENMASK(26, 16)
|
||||
|
||||
#define HAL_RX_PPDU_END_USER_STATS_INFO1_MPDU_CNT_FCS_OK GENMASK(10, 0)
|
||||
@@ -299,6 +301,7 @@ struct hal_rx_ppdu_end_user_stats_ext {
|
||||
__le32 info4;
|
||||
__le32 info5;
|
||||
__le32 info6;
|
||||
__le32 rsvd;
|
||||
} __packed;
|
||||
|
||||
#define HAL_RX_HT_SIG_INFO_INFO0_MCS GENMASK(6, 0)
|
||||
@@ -395,11 +398,9 @@ struct hal_rx_he_sig_a_su_info {
|
||||
#define HAL_RX_HE_SIG_A_MU_DL_INFO0_DOPPLER_INDICATION BIT(25)
|
||||
|
||||
#define HAL_RX_HE_SIG_A_MU_DL_INFO1_TXOP_DURATION GENMASK(6, 0)
|
||||
#define HAL_RX_HE_SIG_A_MU_DL_INFO1_CODING BIT(7)
|
||||
#define HAL_RX_HE_SIG_A_MU_DL_INFO1_NUM_LTF_SYMB GENMASK(10, 8)
|
||||
#define HAL_RX_HE_SIG_A_MU_DL_INFO1_LDPC_EXTRA BIT(11)
|
||||
#define HAL_RX_HE_SIG_A_MU_DL_INFO1_STBC BIT(12)
|
||||
#define HAL_RX_HE_SIG_A_MU_DL_INFO1_TXBF BIT(10)
|
||||
#define HAL_RX_HE_SIG_A_MU_DL_INFO1_PKT_EXT_FACTOR GENMASK(14, 13)
|
||||
#define HAL_RX_HE_SIG_A_MU_DL_INFO1_PKT_EXT_PE_DISAM BIT(15)
|
||||
|
||||
@@ -425,7 +426,7 @@ struct hal_rx_he_sig_b2_mu_info {
|
||||
|
||||
#define HAL_RX_HE_SIG_B2_OFDMA_INFO_INFO0_STA_ID GENMASK(10, 0)
|
||||
#define HAL_RX_HE_SIG_B2_OFDMA_INFO_INFO0_STA_NSTS GENMASK(13, 11)
|
||||
#define HAL_RX_HE_SIG_B2_OFDMA_INFO_INFO0_STA_TXBF BIT(19)
|
||||
#define HAL_RX_HE_SIG_B2_OFDMA_INFO_INFO0_STA_TXBF BIT(14)
|
||||
#define HAL_RX_HE_SIG_B2_OFDMA_INFO_INFO0_STA_MCS GENMASK(18, 15)
|
||||
#define HAL_RX_HE_SIG_B2_OFDMA_INFO_INFO0_STA_DCM BIT(19)
|
||||
#define HAL_RX_HE_SIG_B2_OFDMA_INFO_INFO0_STA_CODING BIT(20)
|
||||
@@ -453,7 +454,8 @@ struct hal_rx_phyrx_rssi_legacy_info {
|
||||
} __packed;
|
||||
|
||||
#define HAL_RX_MPDU_START_INFO0_PPDU_ID GENMASK(31, 16)
|
||||
#define HAL_RX_MPDU_START_INFO1_PEERID GENMASK(31, 16)
|
||||
#define HAL_RX_MPDU_START_INFO1_PEERID GENMASK(29, 16)
|
||||
#define HAL_RX_MPDU_START_INFO1_DEVICE_ID GENMASK(31, 30)
|
||||
#define HAL_RX_MPDU_START_INFO2_MPDU_LEN GENMASK(13, 0)
|
||||
struct hal_rx_mpdu_start {
|
||||
__le32 rsvd0[9];
|
||||
@@ -468,7 +470,7 @@ struct hal_rx_mpdu_start {
|
||||
struct hal_rx_ppdu_end_duration {
|
||||
__le32 rsvd0[9];
|
||||
__le32 info0;
|
||||
__le32 rsvd1[4];
|
||||
__le32 rsvd1[18];
|
||||
} __packed;
|
||||
|
||||
struct hal_rx_rxpcu_classification_overview {
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -59,6 +59,11 @@ enum ath12k_supported_bw {
|
||||
ATH12K_BW_320 = 4,
|
||||
};
|
||||
|
||||
struct ath12k_mac_get_any_chanctx_conf_arg {
|
||||
struct ath12k *ar;
|
||||
struct ieee80211_chanctx_conf *chanctx_conf;
|
||||
};
|
||||
|
||||
extern const struct htt_rx_ring_tlv_filter ath12k_mac_mon_status_filter_default;
|
||||
|
||||
void ath12k_mac_destroy(struct ath12k_hw_group *ag);
|
||||
@@ -96,6 +101,12 @@ int ath12k_mac_vif_set_keepalive(struct ath12k_link_vif *arvif,
|
||||
enum wmi_sta_keepalive_method method,
|
||||
u32 interval);
|
||||
u8 ath12k_mac_get_target_pdev_id(struct ath12k *ar);
|
||||
int ath12k_mac_mlo_setup(struct ath12k_hw_group *ag);
|
||||
int ath12k_mac_mlo_ready(struct ath12k_hw_group *ag);
|
||||
void ath12k_mac_mlo_teardown(struct ath12k_hw_group *ag);
|
||||
int ath12k_mac_vdev_stop(struct ath12k_link_vif *arvif);
|
||||
void ath12k_mac_get_any_chanctx_conf_iter(struct ieee80211_hw *hw,
|
||||
struct ieee80211_chanctx_conf *conf,
|
||||
void *data);
|
||||
|
||||
#endif
|
||||
|
||||
@@ -388,6 +388,8 @@ int ath12k_peer_create(struct ath12k *ar, struct ath12k_link_vif *arvif,
|
||||
arsta = wiphy_dereference(ath12k_ar_to_hw(ar)->wiphy,
|
||||
ahsta->link[link_id]);
|
||||
|
||||
peer->link_id = arsta->link_id;
|
||||
|
||||
/* Fill ML info into created peer */
|
||||
if (sta->mlo) {
|
||||
ml_peer_id = ahsta->ml_peer_id;
|
||||
|
||||
@@ -59,6 +59,9 @@ struct ath12k_peer {
|
||||
|
||||
/* To ensure only certain work related to dp is done once */
|
||||
bool primary_link;
|
||||
|
||||
/* for reference to ath12k_link_sta */
|
||||
u8 link_id;
|
||||
};
|
||||
|
||||
struct ath12k_ml_peer {
|
||||
|
||||
@@ -2016,17 +2016,43 @@ static const struct qmi_elem_info qmi_wlanfw_wlan_ini_resp_msg_v01_ei[] = {
|
||||
},
|
||||
};
|
||||
|
||||
static void ath12k_host_cap_parse_mlo(struct ath12k_base *ab,
|
||||
struct qmi_wlanfw_host_cap_req_msg_v01 *req)
|
||||
static void ath12k_host_cap_hw_link_id_init(struct ath12k_hw_group *ag)
|
||||
{
|
||||
struct ath12k_base *ab, *partner_ab;
|
||||
int i, j, hw_id_base;
|
||||
|
||||
for (i = 0; i < ag->num_devices; i++) {
|
||||
hw_id_base = 0;
|
||||
ab = ag->ab[i];
|
||||
|
||||
for (j = 0; j < ag->num_devices; j++) {
|
||||
partner_ab = ag->ab[j];
|
||||
|
||||
if (partner_ab->wsi_info.index >= ab->wsi_info.index)
|
||||
continue;
|
||||
|
||||
hw_id_base += partner_ab->qmi.num_radios;
|
||||
}
|
||||
|
||||
ab->wsi_info.hw_link_id_base = hw_id_base;
|
||||
}
|
||||
|
||||
ag->hw_link_id_init_done = true;
|
||||
}
|
||||
|
||||
static int ath12k_host_cap_parse_mlo(struct ath12k_base *ab,
|
||||
struct qmi_wlanfw_host_cap_req_msg_v01 *req)
|
||||
{
|
||||
struct wlfw_host_mlo_chip_info_s_v01 *info;
|
||||
struct ath12k_hw_group *ag = ab->ag;
|
||||
struct ath12k_base *partner_ab;
|
||||
u8 hw_link_id = 0;
|
||||
int i;
|
||||
int i, j, ret;
|
||||
|
||||
if (!ab->ag->mlo_capable) {
|
||||
if (!ag->mlo_capable) {
|
||||
ath12k_dbg(ab, ATH12K_DBG_QMI,
|
||||
"MLO is disabled hence skip QMI MLO cap");
|
||||
return;
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (!ab->qmi.num_radios || ab->qmi.num_radios == U8_MAX) {
|
||||
@@ -2035,7 +2061,12 @@ static void ath12k_host_cap_parse_mlo(struct ath12k_base *ab,
|
||||
ath12k_dbg(ab, ATH12K_DBG_QMI,
|
||||
"skip QMI MLO cap due to invalid num_radio %d\n",
|
||||
ab->qmi.num_radios);
|
||||
return;
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (ab->device_id == ATH12K_INVALID_DEVICE_ID) {
|
||||
ath12k_err(ab, "failed to send MLO cap due to invalid device id\n");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
req->mlo_capable_valid = 1;
|
||||
@@ -2043,27 +2074,83 @@ static void ath12k_host_cap_parse_mlo(struct ath12k_base *ab,
|
||||
req->mlo_chip_id_valid = 1;
|
||||
req->mlo_chip_id = ab->device_id;
|
||||
req->mlo_group_id_valid = 1;
|
||||
req->mlo_group_id = 0;
|
||||
req->mlo_group_id = ag->id;
|
||||
req->max_mlo_peer_valid = 1;
|
||||
/* Max peer number generally won't change for the same device
|
||||
* but needs to be synced with host driver.
|
||||
*/
|
||||
req->max_mlo_peer = ab->hw_params->max_mlo_peer;
|
||||
req->mlo_num_chips_valid = 1;
|
||||
req->mlo_num_chips = 1;
|
||||
req->mlo_num_chips = ag->num_devices;
|
||||
|
||||
info = &req->mlo_chip_info[0];
|
||||
info->chip_id = ab->device_id;
|
||||
info->num_local_links = ab->qmi.num_radios;
|
||||
ath12k_dbg(ab, ATH12K_DBG_QMI, "mlo capability advertisement device_id %d group_id %d num_devices %d",
|
||||
req->mlo_chip_id, req->mlo_group_id, req->mlo_num_chips);
|
||||
|
||||
for (i = 0; i < info->num_local_links; i++) {
|
||||
info->hw_link_id[i] = hw_link_id;
|
||||
info->valid_mlo_link_id[i] = 1;
|
||||
mutex_lock(&ag->mutex);
|
||||
|
||||
hw_link_id++;
|
||||
if (!ag->hw_link_id_init_done)
|
||||
ath12k_host_cap_hw_link_id_init(ag);
|
||||
|
||||
for (i = 0; i < ag->num_devices; i++) {
|
||||
info = &req->mlo_chip_info[i];
|
||||
partner_ab = ag->ab[i];
|
||||
|
||||
if (partner_ab->device_id == ATH12K_INVALID_DEVICE_ID) {
|
||||
ath12k_err(ab, "failed to send MLO cap due to invalid partner device id\n");
|
||||
ret = -EINVAL;
|
||||
goto device_cleanup;
|
||||
}
|
||||
|
||||
info->chip_id = partner_ab->device_id;
|
||||
info->num_local_links = partner_ab->qmi.num_radios;
|
||||
|
||||
ath12k_dbg(ab, ATH12K_DBG_QMI, "mlo device id %d num_link %d\n",
|
||||
info->chip_id, info->num_local_links);
|
||||
|
||||
for (j = 0; j < info->num_local_links; j++) {
|
||||
info->hw_link_id[j] = partner_ab->wsi_info.hw_link_id_base + j;
|
||||
info->valid_mlo_link_id[j] = 1;
|
||||
|
||||
ath12k_dbg(ab, ATH12K_DBG_QMI, "mlo hw_link_id %d\n",
|
||||
info->hw_link_id[j]);
|
||||
|
||||
hw_link_id++;
|
||||
}
|
||||
}
|
||||
|
||||
if (hw_link_id <= 0)
|
||||
ag->mlo_capable = false;
|
||||
|
||||
req->mlo_chip_info_valid = 1;
|
||||
|
||||
mutex_unlock(&ag->mutex);
|
||||
|
||||
return 0;
|
||||
|
||||
device_cleanup:
|
||||
for (i = i - 1; i >= 0; i--) {
|
||||
info = &req->mlo_chip_info[i];
|
||||
|
||||
memset(info, 0, sizeof(*info));
|
||||
}
|
||||
|
||||
req->mlo_num_chips = 0;
|
||||
req->mlo_num_chips_valid = 0;
|
||||
|
||||
req->max_mlo_peer = 0;
|
||||
req->max_mlo_peer_valid = 0;
|
||||
req->mlo_group_id = 0;
|
||||
req->mlo_group_id_valid = 0;
|
||||
req->mlo_chip_id = 0;
|
||||
req->mlo_chip_id_valid = 0;
|
||||
req->mlo_capable = 0;
|
||||
req->mlo_capable_valid = 0;
|
||||
|
||||
ag->mlo_capable = false;
|
||||
|
||||
mutex_unlock(&ag->mutex);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
/* clang stack usage explodes if this is inlined */
|
||||
@@ -2113,7 +2200,9 @@ int ath12k_qmi_host_cap_send(struct ath12k_base *ab)
|
||||
req.nm_modem |= PLATFORM_CAP_PCIE_GLOBAL_RESET;
|
||||
}
|
||||
|
||||
ath12k_host_cap_parse_mlo(ab, &req);
|
||||
ret = ath12k_host_cap_parse_mlo(ab, &req);
|
||||
if (ret < 0)
|
||||
goto out;
|
||||
|
||||
ret = qmi_txn_init(&ab->qmi.handle, &txn,
|
||||
qmi_wlanfw_host_cap_resp_msg_v01_ei, &resp);
|
||||
@@ -2351,30 +2440,125 @@ out:
|
||||
return ret;
|
||||
}
|
||||
|
||||
static void ath12k_qmi_free_mlo_mem_chunk(struct ath12k_base *ab,
|
||||
struct target_mem_chunk *chunk,
|
||||
int idx)
|
||||
{
|
||||
struct ath12k_hw_group *ag = ab->ag;
|
||||
struct target_mem_chunk *mlo_chunk;
|
||||
|
||||
lockdep_assert_held(&ag->mutex);
|
||||
|
||||
if (!ag->mlo_mem.init_done || ag->num_started)
|
||||
return;
|
||||
|
||||
if (idx >= ARRAY_SIZE(ag->mlo_mem.chunk)) {
|
||||
ath12k_warn(ab, "invalid index for MLO memory chunk free: %d\n", idx);
|
||||
return;
|
||||
}
|
||||
|
||||
mlo_chunk = &ag->mlo_mem.chunk[idx];
|
||||
if (mlo_chunk->v.addr) {
|
||||
dma_free_coherent(ab->dev,
|
||||
mlo_chunk->size,
|
||||
mlo_chunk->v.addr,
|
||||
mlo_chunk->paddr);
|
||||
mlo_chunk->v.addr = NULL;
|
||||
}
|
||||
|
||||
mlo_chunk->paddr = 0;
|
||||
mlo_chunk->size = 0;
|
||||
chunk->v.addr = NULL;
|
||||
chunk->paddr = 0;
|
||||
chunk->size = 0;
|
||||
}
|
||||
|
||||
static void ath12k_qmi_free_target_mem_chunk(struct ath12k_base *ab)
|
||||
{
|
||||
int i;
|
||||
struct ath12k_hw_group *ag = ab->ag;
|
||||
int i, mlo_idx;
|
||||
|
||||
for (i = 0; i < ab->qmi.mem_seg_count; i++) {
|
||||
for (i = 0, mlo_idx = 0; i < ab->qmi.mem_seg_count; i++) {
|
||||
if (!ab->qmi.target_mem[i].v.addr)
|
||||
continue;
|
||||
|
||||
dma_free_coherent(ab->dev,
|
||||
ab->qmi.target_mem[i].prev_size,
|
||||
ab->qmi.target_mem[i].v.addr,
|
||||
ab->qmi.target_mem[i].paddr);
|
||||
ab->qmi.target_mem[i].v.addr = NULL;
|
||||
if (ab->qmi.target_mem[i].type == MLO_GLOBAL_MEM_REGION_TYPE) {
|
||||
ath12k_qmi_free_mlo_mem_chunk(ab,
|
||||
&ab->qmi.target_mem[i],
|
||||
mlo_idx++);
|
||||
} else {
|
||||
dma_free_coherent(ab->dev,
|
||||
ab->qmi.target_mem[i].prev_size,
|
||||
ab->qmi.target_mem[i].v.addr,
|
||||
ab->qmi.target_mem[i].paddr);
|
||||
ab->qmi.target_mem[i].v.addr = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
if (!ag->num_started && ag->mlo_mem.init_done) {
|
||||
ag->mlo_mem.init_done = false;
|
||||
ag->mlo_mem.mlo_mem_size = 0;
|
||||
}
|
||||
}
|
||||
|
||||
static int ath12k_qmi_alloc_chunk(struct ath12k_base *ab,
|
||||
struct target_mem_chunk *chunk)
|
||||
{
|
||||
/* Firmware reloads in recovery/resume.
|
||||
* In such cases, no need to allocate memory for FW again.
|
||||
*/
|
||||
if (chunk->v.addr) {
|
||||
if (chunk->prev_type == chunk->type &&
|
||||
chunk->prev_size == chunk->size)
|
||||
goto this_chunk_done;
|
||||
|
||||
/* cannot reuse the existing chunk */
|
||||
dma_free_coherent(ab->dev, chunk->prev_size,
|
||||
chunk->v.addr, chunk->paddr);
|
||||
chunk->v.addr = NULL;
|
||||
}
|
||||
|
||||
chunk->v.addr = dma_alloc_coherent(ab->dev,
|
||||
chunk->size,
|
||||
&chunk->paddr,
|
||||
GFP_KERNEL | __GFP_NOWARN);
|
||||
if (!chunk->v.addr) {
|
||||
if (chunk->size > ATH12K_QMI_MAX_CHUNK_SIZE) {
|
||||
ab->qmi.target_mem_delayed = true;
|
||||
ath12k_warn(ab,
|
||||
"qmi dma allocation failed (%d B type %u), will try later with small size\n",
|
||||
chunk->size,
|
||||
chunk->type);
|
||||
ath12k_qmi_free_target_mem_chunk(ab);
|
||||
return -EAGAIN;
|
||||
}
|
||||
ath12k_warn(ab, "memory allocation failure for %u size: %d\n",
|
||||
chunk->type, chunk->size);
|
||||
return -ENOMEM;
|
||||
}
|
||||
chunk->prev_type = chunk->type;
|
||||
chunk->prev_size = chunk->size;
|
||||
this_chunk_done:
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int ath12k_qmi_alloc_target_mem_chunk(struct ath12k_base *ab)
|
||||
{
|
||||
int i;
|
||||
struct target_mem_chunk *chunk;
|
||||
struct target_mem_chunk *chunk, *mlo_chunk;
|
||||
struct ath12k_hw_group *ag = ab->ag;
|
||||
int i, mlo_idx, ret;
|
||||
int mlo_size = 0;
|
||||
|
||||
mutex_lock(&ag->mutex);
|
||||
|
||||
if (!ag->mlo_mem.init_done) {
|
||||
memset(ag->mlo_mem.chunk, 0, sizeof(ag->mlo_mem.chunk));
|
||||
ag->mlo_mem.init_done = true;
|
||||
}
|
||||
|
||||
ab->qmi.target_mem_delayed = false;
|
||||
|
||||
for (i = 0; i < ab->qmi.mem_seg_count; i++) {
|
||||
for (i = 0, mlo_idx = 0; i < ab->qmi.mem_seg_count; i++) {
|
||||
chunk = &ab->qmi.target_mem[i];
|
||||
|
||||
/* Allocate memory for the region and the functionality supported
|
||||
@@ -2386,42 +2570,41 @@ static int ath12k_qmi_alloc_target_mem_chunk(struct ath12k_base *ab)
|
||||
case M3_DUMP_REGION_TYPE:
|
||||
case PAGEABLE_MEM_REGION_TYPE:
|
||||
case CALDB_MEM_REGION_TYPE:
|
||||
/* Firmware reloads in recovery/resume.
|
||||
* In such cases, no need to allocate memory for FW again.
|
||||
*/
|
||||
if (chunk->v.addr) {
|
||||
if (chunk->prev_type == chunk->type &&
|
||||
chunk->prev_size == chunk->size)
|
||||
goto this_chunk_done;
|
||||
|
||||
/* cannot reuse the existing chunk */
|
||||
dma_free_coherent(ab->dev, chunk->prev_size,
|
||||
chunk->v.addr, chunk->paddr);
|
||||
chunk->v.addr = NULL;
|
||||
ret = ath12k_qmi_alloc_chunk(ab, chunk);
|
||||
if (ret)
|
||||
goto err;
|
||||
break;
|
||||
case MLO_GLOBAL_MEM_REGION_TYPE:
|
||||
mlo_size += chunk->size;
|
||||
if (ag->mlo_mem.mlo_mem_size &&
|
||||
mlo_size > ag->mlo_mem.mlo_mem_size) {
|
||||
ath12k_err(ab, "QMI MLO memory allocation failure, requested size %d is more than allocated size %d",
|
||||
mlo_size, ag->mlo_mem.mlo_mem_size);
|
||||
ret = -EINVAL;
|
||||
goto err;
|
||||
}
|
||||
|
||||
chunk->v.addr = dma_alloc_coherent(ab->dev,
|
||||
chunk->size,
|
||||
&chunk->paddr,
|
||||
GFP_KERNEL | __GFP_NOWARN);
|
||||
if (!chunk->v.addr) {
|
||||
if (chunk->size > ATH12K_QMI_MAX_CHUNK_SIZE) {
|
||||
ab->qmi.target_mem_delayed = true;
|
||||
ath12k_warn(ab,
|
||||
"qmi dma allocation failed (%d B type %u), will try later with small size\n",
|
||||
chunk->size,
|
||||
chunk->type);
|
||||
ath12k_qmi_free_target_mem_chunk(ab);
|
||||
return 0;
|
||||
mlo_chunk = &ag->mlo_mem.chunk[mlo_idx];
|
||||
if (mlo_chunk->paddr) {
|
||||
if (chunk->size != mlo_chunk->size) {
|
||||
ath12k_err(ab, "QMI MLO chunk memory allocation failure for index %d, requested size %d is more than allocated size %d",
|
||||
mlo_idx, chunk->size, mlo_chunk->size);
|
||||
ret = -EINVAL;
|
||||
goto err;
|
||||
}
|
||||
ath12k_warn(ab, "memory allocation failure for %u size: %d\n",
|
||||
chunk->type, chunk->size);
|
||||
return -ENOMEM;
|
||||
} else {
|
||||
mlo_chunk->size = chunk->size;
|
||||
mlo_chunk->type = chunk->type;
|
||||
ret = ath12k_qmi_alloc_chunk(ab, mlo_chunk);
|
||||
if (ret)
|
||||
goto err;
|
||||
memset(mlo_chunk->v.addr, 0, mlo_chunk->size);
|
||||
}
|
||||
|
||||
chunk->prev_type = chunk->type;
|
||||
chunk->prev_size = chunk->size;
|
||||
this_chunk_done:
|
||||
chunk->paddr = mlo_chunk->paddr;
|
||||
chunk->v.addr = mlo_chunk->v.addr;
|
||||
mlo_idx++;
|
||||
|
||||
break;
|
||||
default:
|
||||
ath12k_warn(ab, "memory type %u not supported\n",
|
||||
@@ -2431,7 +2614,34 @@ this_chunk_done:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!ag->mlo_mem.mlo_mem_size) {
|
||||
ag->mlo_mem.mlo_mem_size = mlo_size;
|
||||
} else if (ag->mlo_mem.mlo_mem_size != mlo_size) {
|
||||
ath12k_err(ab, "QMI MLO memory size error, expected size is %d but requested size is %d",
|
||||
ag->mlo_mem.mlo_mem_size, mlo_size);
|
||||
ret = -EINVAL;
|
||||
goto err;
|
||||
}
|
||||
|
||||
mutex_unlock(&ag->mutex);
|
||||
|
||||
return 0;
|
||||
|
||||
err:
|
||||
ath12k_qmi_free_target_mem_chunk(ab);
|
||||
|
||||
mutex_unlock(&ag->mutex);
|
||||
|
||||
/* The firmware will attempt to request memory in smaller chunks
|
||||
* on the next try. However, the current caller should be notified
|
||||
* that this instance of request parsing was successful.
|
||||
* Therefore, return 0 only.
|
||||
*/
|
||||
if (ret == -EAGAIN)
|
||||
ret = 0;
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
/* clang stack usage explodes if this is inlined */
|
||||
|
||||
@@ -172,6 +172,7 @@ enum ath12k_qmi_target_mem {
|
||||
BDF_MEM_REGION_TYPE = 0x2,
|
||||
M3_DUMP_REGION_TYPE = 0x3,
|
||||
CALDB_MEM_REGION_TYPE = 0x4,
|
||||
MLO_GLOBAL_MEM_REGION_TYPE = 0x8,
|
||||
PAGEABLE_MEM_REGION_TYPE = 0x9,
|
||||
};
|
||||
|
||||
|
||||
@@ -4662,6 +4662,9 @@ ath12k_wmi_tlv_mac_phy_caps_ext_parse(struct ath12k_base *ab,
|
||||
caps->eht_cap_info_internal);
|
||||
}
|
||||
|
||||
pdev->cap.eml_cap = le32_to_cpu(caps->eml_capability);
|
||||
pdev->cap.mld_cap = le32_to_cpu(caps->mld_capability);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -5359,6 +5362,9 @@ static int wmi_process_mgmt_tx_comp(struct ath12k *ar, u32 desc_id,
|
||||
if ((!(info->flags & IEEE80211_TX_CTL_NO_ACK)) && !status)
|
||||
info->flags |= IEEE80211_TX_STAT_ACK;
|
||||
|
||||
if ((info->flags & IEEE80211_TX_CTL_NO_ACK) && !status)
|
||||
info->flags |= IEEE80211_TX_STAT_NOACK_TRANSMITTED;
|
||||
|
||||
ieee80211_tx_status_irqsafe(ath12k_ar_to_hw(ar), msdu);
|
||||
|
||||
num_mgmt = atomic_dec_if_positive(&ar->num_pending_mgmt_tx);
|
||||
@@ -6209,7 +6215,7 @@ static void ath12k_mgmt_rx_event(struct ath12k_base *ab, struct sk_buff *skb)
|
||||
goto exit;
|
||||
}
|
||||
|
||||
if ((test_bit(ATH12K_CAC_RUNNING, &ar->dev_flags)) ||
|
||||
if ((test_bit(ATH12K_FLAG_CAC_RUNNING, &ar->dev_flags)) ||
|
||||
(rx_ev.status & (WMI_RX_STATUS_ERR_DECRYPT |
|
||||
WMI_RX_STATUS_ERR_KEY_CACHE_MISS |
|
||||
WMI_RX_STATUS_ERR_CRC))) {
|
||||
@@ -6338,7 +6344,8 @@ static struct ath12k *ath12k_get_ar_on_scan_state(struct ath12k_base *ab,
|
||||
|
||||
spin_lock_bh(&ar->data_lock);
|
||||
if (ar->scan.state == state &&
|
||||
ar->scan.vdev_id == vdev_id) {
|
||||
ar->scan.arvif &&
|
||||
ar->scan.arvif->vdev_id == vdev_id) {
|
||||
spin_unlock_bh(&ar->data_lock);
|
||||
return ar;
|
||||
}
|
||||
@@ -6873,7 +6880,7 @@ ath12k_wmi_process_csa_switch_count_event(struct ath12k_base *ab,
|
||||
}
|
||||
ahvif = arvif->ahvif;
|
||||
|
||||
if (arvif->link_id > IEEE80211_MLD_MAX_NUM_LINKS) {
|
||||
if (arvif->link_id >= IEEE80211_MLD_MAX_NUM_LINKS) {
|
||||
ath12k_warn(ab, "Invalid CSA switch count even link id: %d\n",
|
||||
arvif->link_id);
|
||||
continue;
|
||||
@@ -6931,6 +6938,7 @@ static void
|
||||
ath12k_wmi_pdev_dfs_radar_detected_event(struct ath12k_base *ab, struct sk_buff *skb)
|
||||
{
|
||||
const void **tb;
|
||||
struct ath12k_mac_get_any_chanctx_conf_arg arg;
|
||||
const struct ath12k_wmi_pdev_radar_event *ev;
|
||||
struct ath12k *ar;
|
||||
int ret;
|
||||
@@ -6966,13 +6974,22 @@ ath12k_wmi_pdev_dfs_radar_detected_event(struct ath12k_base *ab, struct sk_buff
|
||||
goto exit;
|
||||
}
|
||||
|
||||
arg.ar = ar;
|
||||
arg.chanctx_conf = NULL;
|
||||
ieee80211_iter_chan_contexts_atomic(ath12k_ar_to_hw(ar),
|
||||
ath12k_mac_get_any_chanctx_conf_iter, &arg);
|
||||
if (!arg.chanctx_conf) {
|
||||
ath12k_warn(ab, "failed to find valid chanctx_conf in radar detected event\n");
|
||||
goto exit;
|
||||
}
|
||||
|
||||
ath12k_dbg(ar->ab, ATH12K_DBG_REG, "DFS Radar Detected in pdev %d\n",
|
||||
ev->pdev_id);
|
||||
|
||||
if (ar->dfs_block_radar_events)
|
||||
ath12k_info(ab, "DFS Radar detected, but ignored as requested\n");
|
||||
else
|
||||
ieee80211_radar_detected(ath12k_ar_to_hw(ar), NULL);
|
||||
ieee80211_radar_detected(ath12k_ar_to_hw(ar), arg.chanctx_conf);
|
||||
|
||||
exit:
|
||||
rcu_read_unlock();
|
||||
@@ -7327,6 +7344,79 @@ static void ath12k_wmi_gtk_offload_status_event(struct ath12k_base *ab,
|
||||
kfree(tb);
|
||||
}
|
||||
|
||||
static void ath12k_wmi_event_mlo_setup_complete(struct ath12k_base *ab,
|
||||
struct sk_buff *skb)
|
||||
{
|
||||
const struct wmi_mlo_setup_complete_event *ev;
|
||||
struct ath12k *ar = NULL;
|
||||
struct ath12k_pdev *pdev;
|
||||
const void **tb;
|
||||
int ret, i;
|
||||
|
||||
tb = ath12k_wmi_tlv_parse_alloc(ab, skb, GFP_ATOMIC);
|
||||
if (IS_ERR(tb)) {
|
||||
ret = PTR_ERR(tb);
|
||||
ath12k_warn(ab, "failed to parse mlo setup complete event tlv: %d\n",
|
||||
ret);
|
||||
return;
|
||||
}
|
||||
|
||||
ev = tb[WMI_TAG_MLO_SETUP_COMPLETE_EVENT];
|
||||
if (!ev) {
|
||||
ath12k_warn(ab, "failed to fetch mlo setup complete event\n");
|
||||
kfree(tb);
|
||||
return;
|
||||
}
|
||||
|
||||
if (le32_to_cpu(ev->pdev_id) > ab->num_radios)
|
||||
goto skip_lookup;
|
||||
|
||||
for (i = 0; i < ab->num_radios; i++) {
|
||||
pdev = &ab->pdevs[i];
|
||||
if (pdev && pdev->pdev_id == le32_to_cpu(ev->pdev_id)) {
|
||||
ar = pdev->ar;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
skip_lookup:
|
||||
if (!ar) {
|
||||
ath12k_warn(ab, "invalid pdev_id %d status %u in setup complete event\n",
|
||||
ev->pdev_id, ev->status);
|
||||
goto out;
|
||||
}
|
||||
|
||||
ar->mlo_setup_status = le32_to_cpu(ev->status);
|
||||
complete(&ar->mlo_setup_done);
|
||||
|
||||
out:
|
||||
kfree(tb);
|
||||
}
|
||||
|
||||
static void ath12k_wmi_event_teardown_complete(struct ath12k_base *ab,
|
||||
struct sk_buff *skb)
|
||||
{
|
||||
const struct wmi_mlo_teardown_complete_event *ev;
|
||||
const void **tb;
|
||||
int ret;
|
||||
|
||||
tb = ath12k_wmi_tlv_parse_alloc(ab, skb, GFP_ATOMIC);
|
||||
if (IS_ERR(tb)) {
|
||||
ret = PTR_ERR(tb);
|
||||
ath12k_warn(ab, "failed to parse teardown complete event tlv: %d\n", ret);
|
||||
return;
|
||||
}
|
||||
|
||||
ev = tb[WMI_TAG_MLO_TEARDOWN_COMPLETE];
|
||||
if (!ev) {
|
||||
ath12k_warn(ab, "failed to fetch teardown complete event\n");
|
||||
kfree(tb);
|
||||
return;
|
||||
}
|
||||
|
||||
kfree(tb);
|
||||
}
|
||||
|
||||
static void ath12k_wmi_op_rx(struct ath12k_base *ab, struct sk_buff *skb)
|
||||
{
|
||||
struct wmi_cmd_hdr *cmd_hdr;
|
||||
@@ -7431,13 +7521,6 @@ static void ath12k_wmi_op_rx(struct ath12k_base *ab, struct sk_buff *skb)
|
||||
case WMI_P2P_NOA_EVENTID:
|
||||
ath12k_wmi_p2p_noa_event(ab, skb);
|
||||
break;
|
||||
/* add Unsupported events here */
|
||||
case WMI_TBTTOFFSET_EXT_UPDATE_EVENTID:
|
||||
case WMI_PEER_OPER_MODE_CHANGE_EVENTID:
|
||||
case WMI_PDEV_DMA_RING_CFG_RSP_EVENTID:
|
||||
ath12k_dbg(ab, ATH12K_DBG_WMI,
|
||||
"ignoring unsupported event 0x%x\n", id);
|
||||
break;
|
||||
case WMI_PDEV_DFS_RADAR_DETECTION_EVENTID:
|
||||
ath12k_wmi_pdev_dfs_radar_detected_event(ab, skb);
|
||||
break;
|
||||
@@ -7453,6 +7536,25 @@ static void ath12k_wmi_op_rx(struct ath12k_base *ab, struct sk_buff *skb)
|
||||
case WMI_GTK_OFFLOAD_STATUS_EVENTID:
|
||||
ath12k_wmi_gtk_offload_status_event(ab, skb);
|
||||
break;
|
||||
case WMI_MLO_SETUP_COMPLETE_EVENTID:
|
||||
ath12k_wmi_event_mlo_setup_complete(ab, skb);
|
||||
break;
|
||||
case WMI_MLO_TEARDOWN_COMPLETE_EVENTID:
|
||||
ath12k_wmi_event_teardown_complete(ab, skb);
|
||||
break;
|
||||
/* add Unsupported events (rare) here */
|
||||
case WMI_TBTTOFFSET_EXT_UPDATE_EVENTID:
|
||||
case WMI_PEER_OPER_MODE_CHANGE_EVENTID:
|
||||
case WMI_PDEV_DMA_RING_CFG_RSP_EVENTID:
|
||||
ath12k_dbg(ab, ATH12K_DBG_WMI,
|
||||
"ignoring unsupported event 0x%x\n", id);
|
||||
break;
|
||||
/* add Unsupported events (frequent) here */
|
||||
case WMI_PDEV_GET_HALPHY_CAL_STATUS_EVENTID:
|
||||
case WMI_MGMT_RX_FW_CONSUMED_EVENTID:
|
||||
case WMI_OBSS_COLOR_COLLISION_DETECTION_EVENTID:
|
||||
/* debug might flood hence silently ignore (no-op) */
|
||||
break;
|
||||
/* TODO: Add remaining events */
|
||||
default:
|
||||
ath12k_dbg(ab, ATH12K_DBG_WMI, "Unknown eventid: 0x%x\n", id);
|
||||
@@ -8269,3 +8371,104 @@ int ath12k_wmi_sta_keepalive(struct ath12k *ar,
|
||||
|
||||
return ath12k_wmi_cmd_send(wmi, skb, WMI_STA_KEEPALIVE_CMDID);
|
||||
}
|
||||
|
||||
int ath12k_wmi_mlo_setup(struct ath12k *ar, struct wmi_mlo_setup_arg *mlo_params)
|
||||
{
|
||||
struct wmi_mlo_setup_cmd *cmd;
|
||||
struct ath12k_wmi_pdev *wmi = ar->wmi;
|
||||
u32 *partner_links, num_links;
|
||||
int i, ret, buf_len, arg_len;
|
||||
struct sk_buff *skb;
|
||||
struct wmi_tlv *tlv;
|
||||
void *ptr;
|
||||
|
||||
num_links = mlo_params->num_partner_links;
|
||||
arg_len = num_links * sizeof(u32);
|
||||
buf_len = sizeof(*cmd) + TLV_HDR_SIZE + arg_len;
|
||||
|
||||
skb = ath12k_wmi_alloc_skb(wmi->wmi_ab, buf_len);
|
||||
if (!skb)
|
||||
return -ENOMEM;
|
||||
|
||||
cmd = (struct wmi_mlo_setup_cmd *)skb->data;
|
||||
cmd->tlv_header = ath12k_wmi_tlv_cmd_hdr(WMI_TAG_MLO_SETUP_CMD,
|
||||
sizeof(*cmd));
|
||||
cmd->mld_group_id = mlo_params->group_id;
|
||||
cmd->pdev_id = cpu_to_le32(ar->pdev->pdev_id);
|
||||
ptr = skb->data + sizeof(*cmd);
|
||||
|
||||
tlv = ptr;
|
||||
tlv->header = ath12k_wmi_tlv_hdr(WMI_TAG_ARRAY_UINT32, arg_len);
|
||||
ptr += TLV_HDR_SIZE;
|
||||
|
||||
partner_links = ptr;
|
||||
for (i = 0; i < num_links; i++)
|
||||
partner_links[i] = mlo_params->partner_link_id[i];
|
||||
|
||||
ret = ath12k_wmi_cmd_send(wmi, skb, WMI_MLO_SETUP_CMDID);
|
||||
if (ret) {
|
||||
ath12k_warn(ar->ab, "failed to submit WMI_MLO_SETUP_CMDID command: %d\n",
|
||||
ret);
|
||||
dev_kfree_skb(skb);
|
||||
return ret;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int ath12k_wmi_mlo_ready(struct ath12k *ar)
|
||||
{
|
||||
struct wmi_mlo_ready_cmd *cmd;
|
||||
struct ath12k_wmi_pdev *wmi = ar->wmi;
|
||||
struct sk_buff *skb;
|
||||
int ret, len;
|
||||
|
||||
len = sizeof(*cmd);
|
||||
skb = ath12k_wmi_alloc_skb(wmi->wmi_ab, len);
|
||||
if (!skb)
|
||||
return -ENOMEM;
|
||||
|
||||
cmd = (struct wmi_mlo_ready_cmd *)skb->data;
|
||||
cmd->tlv_header = ath12k_wmi_tlv_cmd_hdr(WMI_TAG_MLO_READY_CMD,
|
||||
sizeof(*cmd));
|
||||
cmd->pdev_id = cpu_to_le32(ar->pdev->pdev_id);
|
||||
|
||||
ret = ath12k_wmi_cmd_send(wmi, skb, WMI_MLO_READY_CMDID);
|
||||
if (ret) {
|
||||
ath12k_warn(ar->ab, "failed to submit WMI_MLO_READY_CMDID command: %d\n",
|
||||
ret);
|
||||
dev_kfree_skb(skb);
|
||||
return ret;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int ath12k_wmi_mlo_teardown(struct ath12k *ar)
|
||||
{
|
||||
struct wmi_mlo_teardown_cmd *cmd;
|
||||
struct ath12k_wmi_pdev *wmi = ar->wmi;
|
||||
struct sk_buff *skb;
|
||||
int ret, len;
|
||||
|
||||
len = sizeof(*cmd);
|
||||
skb = ath12k_wmi_alloc_skb(wmi->wmi_ab, len);
|
||||
if (!skb)
|
||||
return -ENOMEM;
|
||||
|
||||
cmd = (struct wmi_mlo_teardown_cmd *)skb->data;
|
||||
cmd->tlv_header = ath12k_wmi_tlv_cmd_hdr(WMI_TAG_MLO_TEARDOWN_CMD,
|
||||
sizeof(*cmd));
|
||||
cmd->pdev_id = cpu_to_le32(ar->pdev->pdev_id);
|
||||
cmd->reason_code = WMI_MLO_TEARDOWN_SSR_REASON;
|
||||
|
||||
ret = ath12k_wmi_cmd_send(wmi, skb, WMI_MLO_TEARDOWN_CMDID);
|
||||
if (ret) {
|
||||
ath12k_warn(ar->ab, "failed to submit WMI MLO teardown command: %d\n",
|
||||
ret);
|
||||
dev_kfree_skb(skb);
|
||||
return ret;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -285,6 +285,7 @@ enum wmi_cmd_group {
|
||||
WMI_GRP_TWT = 0x3e,
|
||||
WMI_GRP_MOTION_DET = 0x3f,
|
||||
WMI_GRP_SPATIAL_REUSE = 0x40,
|
||||
WMI_GRP_MLO = 0x48,
|
||||
};
|
||||
|
||||
#define WMI_CMD_GRP(grp_id) (((grp_id) << 12) | 0x1)
|
||||
@@ -665,6 +666,10 @@ enum wmi_tlv_cmd_id {
|
||||
WMI_PDEV_OBSS_PD_SPATIAL_REUSE_CMDID =
|
||||
WMI_TLV_CMD(WMI_GRP_SPATIAL_REUSE),
|
||||
WMI_PDEV_OBSS_PD_SPATIAL_REUSE_SET_DEF_OBSS_THRESH_CMDID,
|
||||
WMI_MLO_LINK_SET_ACTIVE_CMDID = WMI_TLV_CMD(WMI_GRP_MLO),
|
||||
WMI_MLO_SETUP_CMDID,
|
||||
WMI_MLO_READY_CMDID,
|
||||
WMI_MLO_TEARDOWN_CMDID,
|
||||
};
|
||||
|
||||
enum wmi_tlv_event_id {
|
||||
@@ -706,6 +711,8 @@ enum wmi_tlv_event_id {
|
||||
WMI_PDEV_RAP_INFO_EVENTID,
|
||||
WMI_CHAN_RF_CHARACTERIZATION_INFO_EVENTID,
|
||||
WMI_SERVICE_READY_EXT2_EVENTID,
|
||||
WMI_PDEV_GET_HALPHY_CAL_STATUS_EVENTID =
|
||||
WMI_SERVICE_READY_EXT2_EVENTID + 4,
|
||||
WMI_VDEV_START_RESP_EVENTID = WMI_TLV_CMD(WMI_GRP_VDEV),
|
||||
WMI_VDEV_STOPPED_EVENTID,
|
||||
WMI_VDEV_INSTALL_KEY_COMPLETE_EVENTID,
|
||||
@@ -747,6 +754,7 @@ enum wmi_tlv_event_id {
|
||||
WMI_TBTTOFFSET_EXT_UPDATE_EVENTID,
|
||||
WMI_OFFCHAN_DATA_TX_COMPLETION_EVENTID,
|
||||
WMI_HOST_FILS_DISCOVERY_EVENTID,
|
||||
WMI_MGMT_RX_FW_CONSUMED_EVENTID = WMI_HOST_FILS_DISCOVERY_EVENTID + 3,
|
||||
WMI_TX_DELBA_COMPLETE_EVENTID = WMI_TLV_CMD(WMI_GRP_BA_NEG),
|
||||
WMI_TX_ADDBA_COMPLETE_EVENTID,
|
||||
WMI_BA_RSP_SSN_EVENTID,
|
||||
@@ -845,6 +853,8 @@ enum wmi_tlv_event_id {
|
||||
WMI_MDNS_STATS_EVENTID = WMI_TLV_CMD(WMI_GRP_MDNS_OFL),
|
||||
WMI_SAP_OFL_ADD_STA_EVENTID = WMI_TLV_CMD(WMI_GRP_SAP_OFL),
|
||||
WMI_SAP_OFL_DEL_STA_EVENTID,
|
||||
WMI_OBSS_COLOR_COLLISION_DETECTION_EVENTID =
|
||||
WMI_EVT_GRP_START_ID(WMI_GRP_OBSS_OFL),
|
||||
WMI_OCB_SET_CONFIG_RESP_EVENTID = WMI_TLV_CMD(WMI_GRP_OCB),
|
||||
WMI_OCB_GET_TSF_TIMER_RESP_EVENTID,
|
||||
WMI_DCC_GET_STATS_RESP_EVENTID,
|
||||
@@ -874,6 +884,9 @@ enum wmi_tlv_event_id {
|
||||
WMI_TWT_DEL_DIALOG_EVENTID,
|
||||
WMI_TWT_PAUSE_DIALOG_EVENTID,
|
||||
WMI_TWT_RESUME_DIALOG_EVENTID,
|
||||
WMI_MLO_LINK_SET_ACTIVE_RESP_EVENTID = WMI_EVT_GRP_START_ID(WMI_GRP_MLO),
|
||||
WMI_MLO_SETUP_COMPLETE_EVENTID,
|
||||
WMI_MLO_TEARDOWN_COMPLETE_EVENTID,
|
||||
};
|
||||
|
||||
enum wmi_tlv_pdev_param {
|
||||
@@ -2703,6 +2716,8 @@ struct ath12k_wmi_caps_ext_params {
|
||||
__le32 eht_cap_info_internal;
|
||||
__le32 eht_supp_mcs_ext_2ghz[WMI_MAX_EHT_SUPP_MCS_2G_SIZE];
|
||||
__le32 eht_supp_mcs_ext_5ghz[WMI_MAX_EHT_SUPP_MCS_5G_SIZE];
|
||||
__le32 eml_capability;
|
||||
__le32 mld_capability;
|
||||
} __packed;
|
||||
|
||||
/* 2 word representation of MAC addr */
|
||||
@@ -4930,6 +4945,7 @@ struct wmi_probe_tmpl_cmd {
|
||||
|
||||
#define MAX_RADIOS 2
|
||||
|
||||
#define WMI_MLO_CMD_TIMEOUT_HZ (5 * HZ)
|
||||
#define WMI_SERVICE_READY_TIMEOUT_HZ (5 * HZ)
|
||||
#define WMI_SEND_TIMEOUT_HZ (3 * HZ)
|
||||
|
||||
@@ -5026,6 +5042,43 @@ struct wmi_twt_disable_event {
|
||||
__le32 status;
|
||||
} __packed;
|
||||
|
||||
struct wmi_mlo_setup_cmd {
|
||||
__le32 tlv_header;
|
||||
__le32 mld_group_id;
|
||||
__le32 pdev_id;
|
||||
} __packed;
|
||||
|
||||
struct wmi_mlo_setup_arg {
|
||||
__le32 group_id;
|
||||
u8 num_partner_links;
|
||||
u8 *partner_link_id;
|
||||
};
|
||||
|
||||
struct wmi_mlo_ready_cmd {
|
||||
__le32 tlv_header;
|
||||
__le32 pdev_id;
|
||||
} __packed;
|
||||
|
||||
enum wmi_mlo_tear_down_reason_code_type {
|
||||
WMI_MLO_TEARDOWN_SSR_REASON,
|
||||
};
|
||||
|
||||
struct wmi_mlo_teardown_cmd {
|
||||
__le32 tlv_header;
|
||||
__le32 pdev_id;
|
||||
__le32 reason_code;
|
||||
} __packed;
|
||||
|
||||
struct wmi_mlo_setup_complete_event {
|
||||
__le32 pdev_id;
|
||||
__le32 status;
|
||||
} __packed;
|
||||
|
||||
struct wmi_mlo_teardown_complete_event {
|
||||
__le32 pdev_id;
|
||||
__le32 status;
|
||||
} __packed;
|
||||
|
||||
/* WOW structures */
|
||||
enum wmi_wow_wakeup_event {
|
||||
WOW_BMISS_EVENT = 0,
|
||||
@@ -5751,5 +5804,8 @@ int ath12k_wmi_gtk_rekey_getinfo(struct ath12k *ar,
|
||||
struct ath12k_link_vif *arvif);
|
||||
int ath12k_wmi_sta_keepalive(struct ath12k *ar,
|
||||
const struct wmi_sta_keepalive_arg *arg);
|
||||
int ath12k_wmi_mlo_setup(struct ath12k *ar, struct wmi_mlo_setup_arg *mlo_params);
|
||||
int ath12k_wmi_mlo_ready(struct ath12k *ar);
|
||||
int ath12k_wmi_mlo_teardown(struct ath12k *ar);
|
||||
|
||||
#endif
|
||||
|
||||
@@ -338,7 +338,7 @@ struct ath_chanctx {
|
||||
|
||||
struct ath_beacon_config beacon;
|
||||
struct ath9k_hw_cal_data caldata;
|
||||
struct timespec64 tsf_ts;
|
||||
ktime_t tsf_ts;
|
||||
u64 tsf_val;
|
||||
u32 last_beacon;
|
||||
|
||||
@@ -592,8 +592,8 @@ void ath_txq_schedule_all(struct ath_softc *sc);
|
||||
int ath_tx_init(struct ath_softc *sc, int nbufs);
|
||||
int ath_txq_update(struct ath_softc *sc, int qnum,
|
||||
struct ath9k_tx_queue_info *q);
|
||||
u32 ath_pkt_duration(struct ath_softc *sc, u8 rix, int pktlen,
|
||||
int width, int half_gi, bool shortPreamble);
|
||||
u32 ath_pkt_duration(u8 rix, int pktlen, int width,
|
||||
int half_gi, bool shortPreamble);
|
||||
void ath_update_max_aggr_framelen(struct ath_softc *sc, int queue, int txop);
|
||||
void ath_assign_seq(struct ath_common *common, struct sk_buff *skb);
|
||||
int ath_tx_start(struct ieee80211_hw *hw, struct sk_buff *skb,
|
||||
@@ -1011,7 +1011,7 @@ struct ath_softc {
|
||||
struct ath_offchannel offchannel;
|
||||
struct ath_chanctx *next_chan;
|
||||
struct completion go_beacon;
|
||||
struct timespec64 last_event_time;
|
||||
ktime_t last_event_time;
|
||||
#endif
|
||||
|
||||
unsigned long driver_data;
|
||||
|
||||
@@ -293,7 +293,7 @@ void ath9k_beacon_ensure_primary_slot(struct ath_softc *sc)
|
||||
/* Modify TSF as required and update the HW. */
|
||||
avp->chanctx->tsf_val += tsfadjust;
|
||||
if (sc->cur_chan == avp->chanctx) {
|
||||
offset = ath9k_hw_get_tsf_offset(&avp->chanctx->tsf_ts, NULL);
|
||||
offset = ath9k_hw_get_tsf_offset(avp->chanctx->tsf_ts, 0);
|
||||
ath9k_hw_settsf64(sc->sc_ah, avp->chanctx->tsf_val + offset);
|
||||
}
|
||||
|
||||
|
||||
@@ -16,29 +16,25 @@
|
||||
|
||||
#include "hw.h"
|
||||
#include "hw-ops.h"
|
||||
#include <linux/sort.h>
|
||||
#include <linux/export.h>
|
||||
|
||||
/* Common calibration code */
|
||||
|
||||
static int rcmp_i16(const void *x, const void *y)
|
||||
{
|
||||
/* Sort in reverse order. */
|
||||
return *(int16_t *)y - *(int16_t *)x;
|
||||
}
|
||||
|
||||
static int16_t ath9k_hw_get_nf_hist_mid(int16_t *nfCalBuffer)
|
||||
{
|
||||
int16_t nfval;
|
||||
int16_t sort[ATH9K_NF_CAL_HIST_MAX];
|
||||
int i, j;
|
||||
int16_t nfcal[ATH9K_NF_CAL_HIST_MAX];
|
||||
|
||||
for (i = 0; i < ATH9K_NF_CAL_HIST_MAX; i++)
|
||||
sort[i] = nfCalBuffer[i];
|
||||
memcpy(nfcal, nfCalBuffer, sizeof(nfcal));
|
||||
sort(nfcal, ATH9K_NF_CAL_HIST_MAX, sizeof(int16_t), rcmp_i16, NULL);
|
||||
|
||||
for (i = 0; i < ATH9K_NF_CAL_HIST_MAX - 1; i++) {
|
||||
for (j = 1; j < ATH9K_NF_CAL_HIST_MAX - i; j++) {
|
||||
if (sort[j] > sort[j - 1])
|
||||
swap(sort[j], sort[j - 1]);
|
||||
}
|
||||
}
|
||||
nfval = sort[(ATH9K_NF_CAL_HIST_MAX - 1) >> 1];
|
||||
|
||||
return nfval;
|
||||
return nfcal[(ATH9K_NF_CAL_HIST_MAX - 1) >> 1];
|
||||
}
|
||||
|
||||
static struct ath_nf_limits *ath9k_hw_get_nf_limits(struct ath_hw *ah,
|
||||
|
||||
@@ -232,16 +232,11 @@ static const char *chanctx_state_string(enum ath_chanctx_state state)
|
||||
|
||||
static u32 chanctx_event_delta(struct ath_softc *sc)
|
||||
{
|
||||
u64 ms;
|
||||
struct timespec64 ts, *old;
|
||||
ktime_t ts = ktime_get_raw();
|
||||
s64 ms = ktime_ms_delta(ts, sc->last_event_time);
|
||||
|
||||
ktime_get_raw_ts64(&ts);
|
||||
old = &sc->last_event_time;
|
||||
ms = ts.tv_sec * 1000 + ts.tv_nsec / 1000000;
|
||||
ms -= old->tv_sec * 1000 + old->tv_nsec / 1000000;
|
||||
sc->last_event_time = ts;
|
||||
|
||||
return (u32)ms;
|
||||
return ms;
|
||||
}
|
||||
|
||||
void ath_chanctx_check_active(struct ath_softc *sc, struct ath_chanctx *ctx)
|
||||
@@ -334,8 +329,8 @@ ath_chanctx_get_next(struct ath_softc *sc, struct ath_chanctx *ctx)
|
||||
static void ath_chanctx_adjust_tbtt_delta(struct ath_softc *sc)
|
||||
{
|
||||
struct ath_chanctx *prev, *cur;
|
||||
struct timespec64 ts;
|
||||
u32 cur_tsf, prev_tsf, beacon_int;
|
||||
ktime_t ts;
|
||||
s32 offset;
|
||||
|
||||
beacon_int = TU_TO_USEC(sc->cur_chan->beacon.beacon_interval);
|
||||
@@ -346,12 +341,12 @@ static void ath_chanctx_adjust_tbtt_delta(struct ath_softc *sc)
|
||||
if (!prev->switch_after_beacon)
|
||||
return;
|
||||
|
||||
ktime_get_raw_ts64(&ts);
|
||||
ts = ktime_get_raw();
|
||||
cur_tsf = (u32) cur->tsf_val +
|
||||
ath9k_hw_get_tsf_offset(&cur->tsf_ts, &ts);
|
||||
ath9k_hw_get_tsf_offset(cur->tsf_ts, ts);
|
||||
|
||||
prev_tsf = prev->last_beacon - (u32) prev->tsf_val + cur_tsf;
|
||||
prev_tsf -= ath9k_hw_get_tsf_offset(&prev->tsf_ts, &ts);
|
||||
prev_tsf -= ath9k_hw_get_tsf_offset(prev->tsf_ts, ts);
|
||||
|
||||
/* Adjust the TSF time of the AP chanctx to keep its beacons
|
||||
* at half beacon interval offset relative to the STA chanctx.
|
||||
@@ -691,7 +686,7 @@ void ath_chanctx_event(struct ath_softc *sc, struct ieee80211_vif *vif,
|
||||
*/
|
||||
tsf_time = sc->sched.switch_start_time;
|
||||
tsf_time -= (u32) sc->cur_chan->tsf_val +
|
||||
ath9k_hw_get_tsf_offset(&sc->cur_chan->tsf_ts, NULL);
|
||||
ath9k_hw_get_tsf_offset(sc->cur_chan->tsf_ts, 0);
|
||||
tsf_time += ath9k_hw_gettsf32(ah);
|
||||
|
||||
sc->sched.beacon_adjust = false;
|
||||
@@ -1230,10 +1225,10 @@ void ath_chanctx_set_next(struct ath_softc *sc, bool force)
|
||||
{
|
||||
struct ath_common *common = ath9k_hw_common(sc->sc_ah);
|
||||
struct ath_chanctx *old_ctx;
|
||||
struct timespec64 ts;
|
||||
bool measure_time = false;
|
||||
bool send_ps = false;
|
||||
bool queues_stopped = false;
|
||||
ktime_t ts;
|
||||
|
||||
spin_lock_bh(&sc->chan_lock);
|
||||
if (!sc->next_chan) {
|
||||
@@ -1260,7 +1255,7 @@ void ath_chanctx_set_next(struct ath_softc *sc, bool force)
|
||||
spin_unlock_bh(&sc->chan_lock);
|
||||
|
||||
if (sc->next_chan == &sc->offchannel.chan) {
|
||||
ktime_get_raw_ts64(&ts);
|
||||
ts = ktime_get_raw();
|
||||
measure_time = true;
|
||||
}
|
||||
|
||||
@@ -1277,7 +1272,7 @@ void ath_chanctx_set_next(struct ath_softc *sc, bool force)
|
||||
spin_lock_bh(&sc->chan_lock);
|
||||
|
||||
if (sc->cur_chan != &sc->offchannel.chan) {
|
||||
ktime_get_raw_ts64(&sc->cur_chan->tsf_ts);
|
||||
sc->cur_chan->tsf_ts = ktime_get_raw();
|
||||
sc->cur_chan->tsf_val = ath9k_hw_gettsf64(sc->sc_ah);
|
||||
}
|
||||
}
|
||||
@@ -1303,7 +1298,7 @@ void ath_chanctx_set_next(struct ath_softc *sc, bool force)
|
||||
ath_set_channel(sc);
|
||||
if (measure_time)
|
||||
sc->sched.channel_switch_time =
|
||||
ath9k_hw_get_tsf_offset(&ts, NULL);
|
||||
ath9k_hw_get_tsf_offset(ts, 0);
|
||||
/*
|
||||
* A reset will ensure that all queues are woken up,
|
||||
* so there is no need to awaken them again.
|
||||
|
||||
@@ -1847,20 +1847,11 @@ fail:
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
u32 ath9k_hw_get_tsf_offset(struct timespec64 *last, struct timespec64 *cur)
|
||||
u32 ath9k_hw_get_tsf_offset(ktime_t last, ktime_t cur)
|
||||
{
|
||||
struct timespec64 ts;
|
||||
s64 usec;
|
||||
|
||||
if (!cur) {
|
||||
ktime_get_raw_ts64(&ts);
|
||||
cur = &ts;
|
||||
}
|
||||
|
||||
usec = cur->tv_sec * 1000000ULL + cur->tv_nsec / 1000;
|
||||
usec -= last->tv_sec * 1000000ULL + last->tv_nsec / 1000;
|
||||
|
||||
return (u32) usec;
|
||||
if (cur == 0)
|
||||
cur = ktime_get_raw();
|
||||
return ktime_us_delta(cur, last);
|
||||
}
|
||||
EXPORT_SYMBOL(ath9k_hw_get_tsf_offset);
|
||||
|
||||
@@ -1871,7 +1862,7 @@ int ath9k_hw_reset(struct ath_hw *ah, struct ath9k_channel *chan,
|
||||
u32 saveLedState;
|
||||
u32 saveDefAntenna;
|
||||
u32 macStaId1;
|
||||
struct timespec64 tsf_ts;
|
||||
ktime_t tsf_ts;
|
||||
u32 tsf_offset;
|
||||
u64 tsf = 0;
|
||||
int r;
|
||||
@@ -1917,7 +1908,7 @@ int ath9k_hw_reset(struct ath_hw *ah, struct ath9k_channel *chan,
|
||||
macStaId1 = REG_READ(ah, AR_STA_ID1) & AR_STA_ID1_BASE_RATE_11B;
|
||||
|
||||
/* Save TSF before chip reset, a cold reset clears it */
|
||||
ktime_get_raw_ts64(&tsf_ts);
|
||||
tsf_ts = ktime_get_raw();
|
||||
tsf = ath9k_hw_gettsf64(ah);
|
||||
|
||||
saveLedState = REG_READ(ah, AR_CFG_LED) &
|
||||
@@ -1951,7 +1942,7 @@ int ath9k_hw_reset(struct ath_hw *ah, struct ath9k_channel *chan,
|
||||
}
|
||||
|
||||
/* Restore TSF */
|
||||
tsf_offset = ath9k_hw_get_tsf_offset(&tsf_ts, NULL);
|
||||
tsf_offset = ath9k_hw_get_tsf_offset(tsf_ts, 0);
|
||||
ath9k_hw_settsf64(ah, tsf + tsf_offset);
|
||||
|
||||
if (AR_SREV_9280_20_OR_LATER(ah))
|
||||
@@ -1975,7 +1966,7 @@ int ath9k_hw_reset(struct ath_hw *ah, struct ath9k_channel *chan,
|
||||
* value after the initvals have been applied.
|
||||
*/
|
||||
if (AR_SREV_9100(ah) && (ath9k_hw_gettsf64(ah) < tsf)) {
|
||||
tsf_offset = ath9k_hw_get_tsf_offset(&tsf_ts, NULL);
|
||||
tsf_offset = ath9k_hw_get_tsf_offset(tsf_ts, 0);
|
||||
ath9k_hw_settsf64(ah, tsf + tsf_offset);
|
||||
}
|
||||
|
||||
|
||||
@@ -1066,7 +1066,7 @@ u32 ath9k_hw_gettsf32(struct ath_hw *ah);
|
||||
u64 ath9k_hw_gettsf64(struct ath_hw *ah);
|
||||
void ath9k_hw_settsf64(struct ath_hw *ah, u64 tsf64);
|
||||
void ath9k_hw_reset_tsf(struct ath_hw *ah);
|
||||
u32 ath9k_hw_get_tsf_offset(struct timespec64 *last, struct timespec64 *cur);
|
||||
u32 ath9k_hw_get_tsf_offset(ktime_t last, ktime_t cur);
|
||||
void ath9k_hw_set_tsfadjust(struct ath_hw *ah, bool set);
|
||||
void ath9k_hw_init_global_settings(struct ath_hw *ah);
|
||||
u32 ar9003_get_pll_sqsum_dvc(struct ath_hw *ah);
|
||||
|
||||
@@ -249,8 +249,7 @@ static bool ath_complete_reset(struct ath_softc *sc, bool start)
|
||||
if (sc->cur_chan->tsf_val) {
|
||||
u32 offset;
|
||||
|
||||
offset = ath9k_hw_get_tsf_offset(&sc->cur_chan->tsf_ts,
|
||||
NULL);
|
||||
offset = ath9k_hw_get_tsf_offset(sc->cur_chan->tsf_ts, 0);
|
||||
ath9k_hw_settsf64(ah, sc->cur_chan->tsf_val + offset);
|
||||
}
|
||||
|
||||
@@ -1956,7 +1955,7 @@ static u64 ath9k_get_tsf(struct ieee80211_hw *hw, struct ieee80211_vif *vif)
|
||||
tsf = ath9k_hw_gettsf64(sc->sc_ah);
|
||||
} else {
|
||||
tsf = sc->cur_chan->tsf_val +
|
||||
ath9k_hw_get_tsf_offset(&sc->cur_chan->tsf_ts, NULL);
|
||||
ath9k_hw_get_tsf_offset(sc->cur_chan->tsf_ts, 0);
|
||||
}
|
||||
tsf += le64_to_cpu(avp->tsf_adjust);
|
||||
ath9k_ps_restore(sc);
|
||||
@@ -1975,7 +1974,7 @@ static void ath9k_set_tsf(struct ieee80211_hw *hw,
|
||||
mutex_lock(&sc->mutex);
|
||||
ath9k_ps_wakeup(sc);
|
||||
tsf -= le64_to_cpu(avp->tsf_adjust);
|
||||
ktime_get_raw_ts64(&avp->chanctx->tsf_ts);
|
||||
avp->chanctx->tsf_ts = ktime_get_raw();
|
||||
if (sc->cur_chan == avp->chanctx)
|
||||
ath9k_hw_settsf64(sc->sc_ah, tsf);
|
||||
avp->chanctx->tsf_val = tsf;
|
||||
@@ -1991,7 +1990,7 @@ static void ath9k_reset_tsf(struct ieee80211_hw *hw, struct ieee80211_vif *vif)
|
||||
mutex_lock(&sc->mutex);
|
||||
|
||||
ath9k_ps_wakeup(sc);
|
||||
ktime_get_raw_ts64(&avp->chanctx->tsf_ts);
|
||||
avp->chanctx->tsf_ts = ktime_get_raw();
|
||||
if (sc->cur_chan == avp->chanctx)
|
||||
ath9k_hw_reset_tsf(sc->sc_ah);
|
||||
avp->chanctx->tsf_val = 0;
|
||||
|
||||
@@ -1042,8 +1042,8 @@ static void ath_rx_count_airtime(struct ath_softc *sc,
|
||||
if (!!(rxs->encoding == RX_ENC_HT)) {
|
||||
/* MCS rates */
|
||||
|
||||
airtime += ath_pkt_duration(sc, rxs->rate_idx, len,
|
||||
is_40, is_sgi, is_sp);
|
||||
airtime += ath_pkt_duration(rxs->rate_idx, len,
|
||||
is_40, is_sgi, is_sp);
|
||||
} else {
|
||||
|
||||
phy = IS_CCK_RATE(rs->rs_rate) ? WLAN_RC_PHY_CCK : WLAN_RC_PHY_OFDM;
|
||||
|
||||
@@ -67,8 +67,7 @@ static void ath_tx_txqaddbuf(struct ath_softc *sc, struct ath_txq *txq,
|
||||
static void ath_tx_rc_status(struct ath_softc *sc, struct ath_buf *bf,
|
||||
struct ath_tx_status *ts, int nframes, int nbad,
|
||||
int txok);
|
||||
static void ath_tx_update_baw(struct ath_softc *sc, struct ath_atx_tid *tid,
|
||||
struct ath_buf *bf);
|
||||
static void ath_tx_update_baw(struct ath_atx_tid *tid, struct ath_buf *bf);
|
||||
static struct ath_buf *ath_tx_setup_buffer(struct ath_softc *sc,
|
||||
struct ath_txq *txq,
|
||||
struct ath_atx_tid *tid,
|
||||
@@ -208,10 +207,10 @@ static void ath_set_rates(struct ieee80211_vif *vif, struct ieee80211_sta *sta,
|
||||
ARRAY_SIZE(bf->rates));
|
||||
}
|
||||
|
||||
static void ath_txq_skb_done(struct ath_softc *sc, struct ath_txq *txq,
|
||||
struct sk_buff *skb)
|
||||
static void ath_txq_skb_done(struct ath_softc *sc, struct sk_buff *skb)
|
||||
{
|
||||
struct ath_frame_info *fi = get_frame_info(skb);
|
||||
struct ath_txq *txq;
|
||||
int q = fi->txq;
|
||||
|
||||
if (q < 0)
|
||||
@@ -224,7 +223,7 @@ static void ath_txq_skb_done(struct ath_softc *sc, struct ath_txq *txq,
|
||||
}
|
||||
|
||||
static struct ath_atx_tid *
|
||||
ath_get_skb_tid(struct ath_softc *sc, struct ath_node *an, struct sk_buff *skb)
|
||||
ath_get_skb_tid(struct ath_node *an, struct sk_buff *skb)
|
||||
{
|
||||
u8 tidno = skb->priority & IEEE80211_QOS_CTL_TID_MASK;
|
||||
return ATH_AN_2_TID(an, tidno);
|
||||
@@ -294,13 +293,13 @@ static void ath_tx_flush_tid(struct ath_softc *sc, struct ath_atx_tid *tid)
|
||||
fi = get_frame_info(skb);
|
||||
bf = fi->bf;
|
||||
if (!bf) {
|
||||
ath_txq_skb_done(sc, txq, skb);
|
||||
ath_txq_skb_done(sc, skb);
|
||||
ieee80211_free_txskb(sc->hw, skb);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (fi->baw_tracked) {
|
||||
ath_tx_update_baw(sc, tid, bf);
|
||||
ath_tx_update_baw(tid, bf);
|
||||
sendbar = true;
|
||||
}
|
||||
|
||||
@@ -315,8 +314,7 @@ static void ath_tx_flush_tid(struct ath_softc *sc, struct ath_atx_tid *tid)
|
||||
}
|
||||
}
|
||||
|
||||
static void ath_tx_update_baw(struct ath_softc *sc, struct ath_atx_tid *tid,
|
||||
struct ath_buf *bf)
|
||||
static void ath_tx_update_baw(struct ath_atx_tid *tid, struct ath_buf *bf)
|
||||
{
|
||||
struct ath_frame_info *fi = get_frame_info(bf->bf_mpdu);
|
||||
u16 seqno = bf->bf_state.seqno;
|
||||
@@ -338,8 +336,7 @@ static void ath_tx_update_baw(struct ath_softc *sc, struct ath_atx_tid *tid,
|
||||
}
|
||||
}
|
||||
|
||||
static void ath_tx_addto_baw(struct ath_softc *sc, struct ath_atx_tid *tid,
|
||||
struct ath_buf *bf)
|
||||
static void ath_tx_addto_baw(struct ath_atx_tid *tid, struct ath_buf *bf)
|
||||
{
|
||||
struct ath_frame_info *fi = get_frame_info(bf->bf_mpdu);
|
||||
u16 seqno = bf->bf_state.seqno;
|
||||
@@ -452,9 +449,8 @@ static struct ath_buf* ath_clone_txbuf(struct ath_softc *sc, struct ath_buf *bf)
|
||||
return tbf;
|
||||
}
|
||||
|
||||
static void ath_tx_count_frames(struct ath_softc *sc, struct ath_buf *bf,
|
||||
struct ath_tx_status *ts, int txok,
|
||||
int *nframes, int *nbad)
|
||||
static void ath_tx_count_frames(struct ath_buf *bf, struct ath_tx_status *ts,
|
||||
int txok, int *nframes, int *nbad)
|
||||
{
|
||||
u16 seq_st = 0;
|
||||
u32 ba[WME_BA_BMP_SIZE >> 5];
|
||||
@@ -568,7 +564,7 @@ static void ath_tx_complete_aggr(struct ath_softc *sc, struct ath_txq *txq,
|
||||
|
||||
__skb_queue_head_init(&bf_pending);
|
||||
|
||||
ath_tx_count_frames(sc, bf, ts, txok, &nframes, &nbad);
|
||||
ath_tx_count_frames(bf, ts, txok, &nframes, &nbad);
|
||||
while (bf) {
|
||||
u16 seqno = bf->bf_state.seqno;
|
||||
|
||||
@@ -621,7 +617,7 @@ static void ath_tx_complete_aggr(struct ath_softc *sc, struct ath_txq *txq,
|
||||
* complete the acked-ones/xretried ones; update
|
||||
* block-ack window
|
||||
*/
|
||||
ath_tx_update_baw(sc, tid, bf);
|
||||
ath_tx_update_baw(tid, bf);
|
||||
|
||||
if (rc_update && (acked_cnt == 1 || txfail_cnt == 1)) {
|
||||
memcpy(tx_info->control.rates, rates, sizeof(rates));
|
||||
@@ -651,7 +647,7 @@ static void ath_tx_complete_aggr(struct ath_softc *sc, struct ath_txq *txq,
|
||||
* run out of tx buf.
|
||||
*/
|
||||
if (!tbf) {
|
||||
ath_tx_update_baw(sc, tid, bf);
|
||||
ath_tx_update_baw(tid, bf);
|
||||
|
||||
ath_tx_complete_buf(sc, bf, txq,
|
||||
&bf_head, NULL, ts,
|
||||
@@ -752,7 +748,7 @@ static void ath_tx_process_buffer(struct ath_softc *sc, struct ath_txq *txq,
|
||||
sta = ieee80211_find_sta_by_ifaddr(hw, hdr->addr1, hdr->addr2);
|
||||
if (sta) {
|
||||
struct ath_node *an = (struct ath_node *)sta->drv_priv;
|
||||
tid = ath_get_skb_tid(sc, an, bf->bf_mpdu);
|
||||
tid = ath_get_skb_tid(an, bf->bf_mpdu);
|
||||
ath_tx_count_airtime(sc, sta, bf, ts, tid->tidno);
|
||||
if (ts->ts_status & (ATH9K_TXERR_FILT | ATH9K_TXERR_XRETRY))
|
||||
tid->clear_ps_filter = true;
|
||||
@@ -962,7 +958,7 @@ ath_tx_get_tid_subframe(struct ath_softc *sc, struct ath_txq *txq,
|
||||
bf->bf_state.stale = false;
|
||||
|
||||
if (!bf) {
|
||||
ath_txq_skb_done(sc, txq, skb);
|
||||
ath_txq_skb_done(sc, skb);
|
||||
ieee80211_free_txskb(sc->hw, skb);
|
||||
continue;
|
||||
}
|
||||
@@ -1012,13 +1008,13 @@ ath_tx_get_tid_subframe(struct ath_softc *sc, struct ath_txq *txq,
|
||||
|
||||
INIT_LIST_HEAD(&bf_head);
|
||||
list_add(&bf->list, &bf_head);
|
||||
ath_tx_update_baw(sc, tid, bf);
|
||||
ath_tx_update_baw(tid, bf);
|
||||
ath_tx_complete_buf(sc, bf, txq, &bf_head, NULL, &ts, 0);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (bf_isampdu(bf))
|
||||
ath_tx_addto_baw(sc, tid, bf);
|
||||
ath_tx_addto_baw(tid, bf);
|
||||
|
||||
break;
|
||||
}
|
||||
@@ -1114,8 +1110,8 @@ finish:
|
||||
* width - 0 for 20 MHz, 1 for 40 MHz
|
||||
* half_gi - to use 4us v/s 3.6 us for symbol time
|
||||
*/
|
||||
u32 ath_pkt_duration(struct ath_softc *sc, u8 rix, int pktlen,
|
||||
int width, int half_gi, bool shortPreamble)
|
||||
u32 ath_pkt_duration(u8 rix, int pktlen, int width,
|
||||
int half_gi, bool shortPreamble)
|
||||
{
|
||||
u32 nbits, nsymbits, duration, nsymbols;
|
||||
int streams;
|
||||
@@ -1327,7 +1323,7 @@ static void ath_buf_set_rate(struct ath_softc *sc, struct ath_buf *bf,
|
||||
info->rates[i].Rate = rix | 0x80;
|
||||
info->rates[i].ChSel = ath_txchainmask_reduction(sc,
|
||||
ah->txchainmask, info->rates[i].Rate);
|
||||
info->rates[i].PktDuration = ath_pkt_duration(sc, rix, len,
|
||||
info->rates[i].PktDuration = ath_pkt_duration(rix, len,
|
||||
is_40, is_sgi, is_sp);
|
||||
if (rix < 8 && (tx_info->flags & IEEE80211_TX_CTL_STBC))
|
||||
info->rates[i].RateFlags |= ATH9K_RATESERIES_STBC;
|
||||
@@ -2122,7 +2118,7 @@ static void ath_tx_send_normal(struct ath_softc *sc, struct ath_txq *txq,
|
||||
bf->bf_state.bf_type = 0;
|
||||
if (tid && (tx_info->flags & IEEE80211_TX_CTL_AMPDU)) {
|
||||
bf->bf_state.bf_type = BUF_AMPDU;
|
||||
ath_tx_addto_baw(sc, tid, bf);
|
||||
ath_tx_addto_baw(tid, bf);
|
||||
}
|
||||
|
||||
bf->bf_next = NULL;
|
||||
@@ -2368,7 +2364,7 @@ int ath_tx_start(struct ieee80211_hw *hw, struct sk_buff *skb,
|
||||
|
||||
if (txctl->sta) {
|
||||
an = (struct ath_node *) sta->drv_priv;
|
||||
tid = ath_get_skb_tid(sc, an, skb);
|
||||
tid = ath_get_skb_tid(an, skb);
|
||||
}
|
||||
|
||||
ath_txq_lock(sc, txq);
|
||||
@@ -2379,7 +2375,7 @@ int ath_tx_start(struct ieee80211_hw *hw, struct sk_buff *skb,
|
||||
|
||||
bf = ath_tx_setup_buffer(sc, txq, tid, skb);
|
||||
if (!bf) {
|
||||
ath_txq_skb_done(sc, txq, skb);
|
||||
ath_txq_skb_done(sc, skb);
|
||||
if (txctl->paprd)
|
||||
dev_kfree_skb_any(skb);
|
||||
else
|
||||
@@ -2514,7 +2510,7 @@ static void ath_tx_complete(struct ath_softc *sc, struct sk_buff *skb,
|
||||
}
|
||||
spin_unlock_irqrestore(&sc->sc_pm_lock, flags);
|
||||
|
||||
ath_txq_skb_done(sc, txq, skb);
|
||||
ath_txq_skb_done(sc, skb);
|
||||
tx_info->status.status_driver_data[0] = sta;
|
||||
__skb_queue_tail(&txq->complete_q, skb);
|
||||
}
|
||||
|
||||
@@ -814,6 +814,8 @@ static int brcmf_cfg80211_request_ap_if(struct brcmf_if *ifp)
|
||||
* @name: name of the new interface.
|
||||
* @params: contains mac address for AP or STA device.
|
||||
* @type: interface type.
|
||||
*
|
||||
* Return: pointer to new vif on success, ERR_PTR(-errno) if not
|
||||
*/
|
||||
static
|
||||
struct wireless_dev *brcmf_apsta_add_vif(struct wiphy *wiphy, const char *name,
|
||||
@@ -900,6 +902,8 @@ static bool brcmf_is_ibssmode(struct brcmf_cfg80211_vif *vif)
|
||||
*
|
||||
* @wiphy: wiphy device of new interface.
|
||||
* @name: name of the new interface.
|
||||
*
|
||||
* Return: pointer to new vif on success, ERR_PTR(-errno) if not
|
||||
*/
|
||||
static struct wireless_dev *brcmf_mon_add_vif(struct wiphy *wiphy,
|
||||
const char *name)
|
||||
@@ -7412,6 +7416,8 @@ brcmf_txrx_stypes[NUM_NL80211_IFTYPES] = {
|
||||
* p2p, rsdb, and no mbss:
|
||||
* #STA <= 1, #P2P-DEV <= 1, #{P2P-CL, P2P-GO} <= 2, AP <= 2,
|
||||
* channels = 2, 4 total
|
||||
*
|
||||
* Return: 0 on success, negative errno on failure
|
||||
*/
|
||||
static int brcmf_setup_ifmodes(struct wiphy *wiphy, struct brcmf_if *ifp)
|
||||
{
|
||||
|
||||
@@ -540,6 +540,11 @@ void brcmf_txfinalize(struct brcmf_if *ifp, struct sk_buff *txp, bool success)
|
||||
struct ethhdr *eh;
|
||||
u16 type;
|
||||
|
||||
if (!ifp) {
|
||||
brcmu_pkt_buf_free_skb(txp);
|
||||
return;
|
||||
}
|
||||
|
||||
eh = (struct ethhdr *)(txp->data);
|
||||
type = ntohs(eh->h_proto);
|
||||
|
||||
|
||||
@@ -99,13 +99,13 @@ int brcmf_of_probe(struct device *dev, enum brcmf_bus_type bus_type,
|
||||
/* Set board-type to the first string of the machine compatible prop */
|
||||
root = of_find_node_by_path("/");
|
||||
if (root && err) {
|
||||
char *board_type;
|
||||
char *board_type = NULL;
|
||||
const char *tmp;
|
||||
|
||||
of_property_read_string_index(root, "compatible", 0, &tmp);
|
||||
|
||||
/* get rid of '/' in the compatible string to be able to find the FW */
|
||||
board_type = devm_kstrdup(dev, tmp, GFP_KERNEL);
|
||||
if (!of_property_read_string_index(root, "compatible", 0, &tmp))
|
||||
board_type = devm_kstrdup(dev, tmp, GFP_KERNEL);
|
||||
|
||||
if (!board_type) {
|
||||
of_node_put(root);
|
||||
return 0;
|
||||
|
||||
@@ -1127,44 +1127,6 @@ il3945_rx_queue_free(struct il_priv *il, struct il_rx_queue *rxq)
|
||||
rxq->rb_stts = NULL;
|
||||
}
|
||||
|
||||
/* Convert linear signal-to-noise ratio into dB */
|
||||
static u8 ratio2dB[100] = {
|
||||
/* 0 1 2 3 4 5 6 7 8 9 */
|
||||
0, 0, 6, 10, 12, 14, 16, 17, 18, 19, /* 00 - 09 */
|
||||
20, 21, 22, 22, 23, 23, 24, 25, 26, 26, /* 10 - 19 */
|
||||
26, 26, 26, 27, 27, 28, 28, 28, 29, 29, /* 20 - 29 */
|
||||
29, 30, 30, 30, 31, 31, 31, 31, 32, 32, /* 30 - 39 */
|
||||
32, 32, 32, 33, 33, 33, 33, 33, 34, 34, /* 40 - 49 */
|
||||
34, 34, 34, 34, 35, 35, 35, 35, 35, 35, /* 50 - 59 */
|
||||
36, 36, 36, 36, 36, 36, 36, 37, 37, 37, /* 60 - 69 */
|
||||
37, 37, 37, 37, 37, 38, 38, 38, 38, 38, /* 70 - 79 */
|
||||
38, 38, 38, 38, 38, 39, 39, 39, 39, 39, /* 80 - 89 */
|
||||
39, 39, 39, 39, 39, 40, 40, 40, 40, 40 /* 90 - 99 */
|
||||
};
|
||||
|
||||
/* Calculates a relative dB value from a ratio of linear
|
||||
* (i.e. not dB) signal levels.
|
||||
* Conversion assumes that levels are voltages (20*log), not powers (10*log). */
|
||||
int
|
||||
il3945_calc_db_from_ratio(int sig_ratio)
|
||||
{
|
||||
/* 1000:1 or higher just report as 60 dB */
|
||||
if (sig_ratio >= 1000)
|
||||
return 60;
|
||||
|
||||
/* 100:1 or higher, divide by 10 and use table,
|
||||
* add 20 dB to make up for divide by 10 */
|
||||
if (sig_ratio >= 100)
|
||||
return 20 + (int)ratio2dB[sig_ratio / 10];
|
||||
|
||||
/* We shouldn't see this */
|
||||
if (sig_ratio < 1)
|
||||
return 0;
|
||||
|
||||
/* Use table for ratios 1:1 - 99:1 */
|
||||
return (int)ratio2dB[sig_ratio];
|
||||
}
|
||||
|
||||
/*
|
||||
* il3945_rx_handle - Main entry function for receiving responses from uCode
|
||||
*
|
||||
|
||||
@@ -173,7 +173,6 @@ struct il3945_ibss_seq {
|
||||
* for use by iwl-*.c
|
||||
*
|
||||
*****************************************************************************/
|
||||
int il3945_calc_db_from_ratio(int sig_ratio);
|
||||
void il3945_rx_replenish(void *data);
|
||||
void il3945_rx_queue_reset(struct il_priv *il, struct il_rx_queue *rxq);
|
||||
unsigned int il3945_fill_beacon_frame(struct il_priv *il,
|
||||
|
||||
@@ -3915,37 +3915,6 @@ il_set_rxon_ht(struct il_priv *il, struct il_ht_config *ht_conf)
|
||||
}
|
||||
EXPORT_SYMBOL(il_set_rxon_ht);
|
||||
|
||||
/* Return valid, unused, channel for a passive scan to reset the RF */
|
||||
u8
|
||||
il_get_single_channel_number(struct il_priv *il, enum nl80211_band band)
|
||||
{
|
||||
const struct il_channel_info *ch_info;
|
||||
int i;
|
||||
u8 channel = 0;
|
||||
u8 min, max;
|
||||
|
||||
if (band == NL80211_BAND_5GHZ) {
|
||||
min = 14;
|
||||
max = il->channel_count;
|
||||
} else {
|
||||
min = 0;
|
||||
max = 14;
|
||||
}
|
||||
|
||||
for (i = min; i < max; i++) {
|
||||
channel = il->channel_info[i].channel;
|
||||
if (channel == le16_to_cpu(il->staging.channel))
|
||||
continue;
|
||||
|
||||
ch_info = il_get_channel_info(il, band, channel);
|
||||
if (il_is_channel_valid(ch_info))
|
||||
break;
|
||||
}
|
||||
|
||||
return channel;
|
||||
}
|
||||
EXPORT_SYMBOL(il_get_single_channel_number);
|
||||
|
||||
/*
|
||||
* il_set_rxon_channel - Set the band and channel values in staging RXON
|
||||
* @ch: requested channel as a pointer to struct ieee80211_channel
|
||||
|
||||
@@ -1705,7 +1705,6 @@ int il_full_rxon_required(struct il_priv *il);
|
||||
int il_set_rxon_channel(struct il_priv *il, struct ieee80211_channel *ch);
|
||||
void il_set_flags_for_band(struct il_priv *il, enum nl80211_band band,
|
||||
struct ieee80211_vif *vif);
|
||||
u8 il_get_single_channel_number(struct il_priv *il, enum nl80211_band band);
|
||||
void il_set_rxon_ht(struct il_priv *il, struct il_ht_config *ht_conf);
|
||||
bool il_is_ht40_tx_allowed(struct il_priv *il,
|
||||
struct ieee80211_sta_ht_cap *ht_cap);
|
||||
|
||||
@@ -5,13 +5,14 @@ iwlwifi-objs += iwl-io.o
|
||||
iwlwifi-objs += iwl-drv.o
|
||||
iwlwifi-objs += iwl-debug.o
|
||||
iwlwifi-objs += iwl-nvm-utils.o
|
||||
iwlwifi-objs += iwl-utils.o
|
||||
iwlwifi-objs += iwl-phy-db.o iwl-nvm-parse.o
|
||||
iwlwifi-objs += pcie/drv.o pcie/rx.o pcie/tx.o pcie/trans.o
|
||||
iwlwifi-objs += pcie/ctxt-info.o pcie/ctxt-info-gen3.o
|
||||
iwlwifi-objs += pcie/trans-gen2.o pcie/tx-gen2.o
|
||||
iwlwifi-$(CONFIG_IWLDVM) += cfg/1000.o cfg/2000.o cfg/5000.o cfg/6000.o
|
||||
iwlwifi-$(CONFIG_IWLMVM) += cfg/7000.o cfg/8000.o cfg/9000.o cfg/22000.o
|
||||
iwlwifi-$(CONFIG_IWLMVM) += cfg/ax210.o cfg/bz.o cfg/sc.o
|
||||
iwlwifi-$(CONFIG_IWLMVM) += cfg/ax210.o cfg/bz.o cfg/sc.o cfg/dr.o
|
||||
iwlwifi-objs += iwl-dbg-tlv.o
|
||||
iwlwifi-objs += iwl-trans.o
|
||||
|
||||
|
||||
@@ -31,40 +31,21 @@
|
||||
#define IWL_SO_A_GF_A_FW_PRE "iwlwifi-so-a0-gf-a0"
|
||||
#define IWL_TY_A_GF_A_FW_PRE "iwlwifi-ty-a0-gf-a0"
|
||||
#define IWL_SO_A_GF4_A_FW_PRE "iwlwifi-so-a0-gf4-a0"
|
||||
#define IWL_SO_A_MR_A_FW_PRE "iwlwifi-so-a0-mr-a0"
|
||||
#define IWL_MA_A_HR_B_FW_PRE "iwlwifi-ma-a0-hr-b0"
|
||||
#define IWL_MA_A_GF_A_FW_PRE "iwlwifi-ma-a0-gf-a0"
|
||||
#define IWL_MA_A_GF4_A_FW_PRE "iwlwifi-ma-a0-gf4-a0"
|
||||
#define IWL_MA_A_MR_A_FW_PRE "iwlwifi-ma-a0-mr-a0"
|
||||
#define IWL_MA_B_HR_B_FW_PRE "iwlwifi-ma-b0-hr-b0"
|
||||
#define IWL_MA_B_GF_A_FW_PRE "iwlwifi-ma-b0-gf-a0"
|
||||
#define IWL_MA_B_GF4_A_FW_PRE "iwlwifi-ma-b0-gf4-a0"
|
||||
#define IWL_MA_B_MR_A_FW_PRE "iwlwifi-ma-b0-mr-a0"
|
||||
|
||||
#define IWL_SO_A_JF_B_MODULE_FIRMWARE(api) \
|
||||
IWL_SO_A_JF_B_FW_PRE "-" __stringify(api) ".ucode"
|
||||
#define IWL_SO_A_HR_B_MODULE_FIRMWARE(api) \
|
||||
IWL_SO_A_HR_B_FW_PRE "-" __stringify(api) ".ucode"
|
||||
#define IWL_SO_A_GF_A_MODULE_FIRMWARE(api) \
|
||||
IWL_SO_A_GF_A_FW_PRE "-" __stringify(api) ".ucode"
|
||||
#define IWL_TY_A_GF_A_MODULE_FIRMWARE(api) \
|
||||
IWL_TY_A_GF_A_FW_PRE "-" __stringify(api) ".ucode"
|
||||
#define IWL_MA_A_HR_B_FW_MODULE_FIRMWARE(api) \
|
||||
IWL_MA_A_HR_B_FW_PRE "-" __stringify(api) ".ucode"
|
||||
#define IWL_MA_A_GF_A_FW_MODULE_FIRMWARE(api) \
|
||||
IWL_MA_A_GF_A_FW_PRE "-" __stringify(api) ".ucode"
|
||||
#define IWL_MA_A_GF4_A_FW_MODULE_FIRMWARE(api) \
|
||||
IWL_MA_A_GF4_A_FW_PRE "-" __stringify(api) ".ucode"
|
||||
#define IWL_MA_A_MR_A_FW_MODULE_FIRMWARE(api) \
|
||||
IWL_MA_A_MR_A_FW_PRE "-" __stringify(api) ".ucode"
|
||||
#define IWL_MA_B_HR_B_FW_MODULE_FIRMWARE(api) \
|
||||
IWL_MA_B_HR_B_FW_PRE "-" __stringify(api) ".ucode"
|
||||
#define IWL_MA_B_GF_A_FW_MODULE_FIRMWARE(api) \
|
||||
IWL_MA_B_GF_A_FW_PRE "-" __stringify(api) ".ucode"
|
||||
#define IWL_MA_B_GF4_A_FW_MODULE_FIRMWARE(api) \
|
||||
IWL_MA_B_GF4_A_FW_PRE "-" __stringify(api) ".ucode"
|
||||
#define IWL_MA_B_MR_A_FW_MODULE_FIRMWARE(api) \
|
||||
IWL_MA_B_MR_A_FW_PRE "-" __stringify(api) ".ucode"
|
||||
|
||||
static const struct iwl_base_params iwl_ax210_base_params = {
|
||||
.eeprom_size = OTP_LOW_IMAGE_SIZE_32K,
|
||||
@@ -267,13 +248,6 @@ const struct iwl_cfg iwlax411_2ax_cfg_so_gf4_a0_long = {
|
||||
.trans.low_latency_xtal = true,
|
||||
};
|
||||
|
||||
const struct iwl_cfg iwl_cfg_so_a0_ms_a0 = {
|
||||
.fw_name_pre = IWL_SO_A_MR_A_FW_PRE,
|
||||
.uhb_supported = false,
|
||||
IWL_DEVICE_AX210,
|
||||
.num_rbds = IWL_NUM_RBDS_AX210_HE,
|
||||
};
|
||||
|
||||
const struct iwl_cfg iwl_cfg_ma = {
|
||||
.fw_name_mac = "ma",
|
||||
.uhb_supported = true,
|
||||
@@ -289,19 +263,11 @@ const struct iwl_cfg iwl_cfg_so_a0_hr_a0 = {
|
||||
|
||||
MODULE_FIRMWARE(IWL_SO_A_JF_B_MODULE_FIRMWARE(IWL_AX210_UCODE_API_MAX));
|
||||
MODULE_FIRMWARE(IWL_SO_A_HR_B_MODULE_FIRMWARE(IWL_AX210_UCODE_API_MAX));
|
||||
MODULE_FIRMWARE(IWL_SO_A_GF_A_MODULE_FIRMWARE(IWL_AX210_UCODE_API_MAX));
|
||||
MODULE_FIRMWARE(IWL_TY_A_GF_A_MODULE_FIRMWARE(IWL_AX210_UCODE_API_MAX));
|
||||
IWL_FW_AND_PNVM(IWL_SO_A_GF_A_FW_PRE, IWL_AX210_UCODE_API_MAX);
|
||||
IWL_FW_AND_PNVM(IWL_TY_A_GF_A_FW_PRE, IWL_AX210_UCODE_API_MAX);
|
||||
MODULE_FIRMWARE(IWL_MA_A_HR_B_FW_MODULE_FIRMWARE(IWL_AX210_UCODE_API_MAX));
|
||||
MODULE_FIRMWARE(IWL_MA_A_GF_A_FW_MODULE_FIRMWARE(IWL_AX210_UCODE_API_MAX));
|
||||
MODULE_FIRMWARE(IWL_MA_A_GF4_A_FW_MODULE_FIRMWARE(IWL_AX210_UCODE_API_MAX));
|
||||
MODULE_FIRMWARE(IWL_MA_A_MR_A_FW_MODULE_FIRMWARE(IWL_AX210_UCODE_API_MAX));
|
||||
IWL_FW_AND_PNVM(IWL_MA_A_GF_A_FW_PRE, IWL_AX210_UCODE_API_MAX);
|
||||
IWL_FW_AND_PNVM(IWL_MA_A_GF4_A_FW_PRE, IWL_AX210_UCODE_API_MAX);
|
||||
MODULE_FIRMWARE(IWL_MA_B_HR_B_FW_MODULE_FIRMWARE(IWL_AX210_UCODE_API_MAX));
|
||||
MODULE_FIRMWARE(IWL_MA_B_GF_A_FW_MODULE_FIRMWARE(IWL_AX210_UCODE_API_MAX));
|
||||
MODULE_FIRMWARE(IWL_MA_B_GF4_A_FW_MODULE_FIRMWARE(IWL_AX210_UCODE_API_MAX));
|
||||
MODULE_FIRMWARE(IWL_MA_B_MR_A_FW_MODULE_FIRMWARE(IWL_AX210_UCODE_API_MAX));
|
||||
|
||||
MODULE_FIRMWARE("iwlwifi-so-a0-gf-a0.pnvm");
|
||||
MODULE_FIRMWARE("iwlwifi-so-a0-gf4-a0.pnvm");
|
||||
MODULE_FIRMWARE("iwlwifi-ty-a0-gf-a0.pnvm");
|
||||
MODULE_FIRMWARE("iwlwifi-ma-b0-gf-a0.pnvm");
|
||||
MODULE_FIRMWARE("iwlwifi-ma-b0-gf4-a0.pnvm");
|
||||
IWL_FW_AND_PNVM(IWL_MA_B_GF_A_FW_PRE, IWL_AX210_UCODE_API_MAX);
|
||||
IWL_FW_AND_PNVM(IWL_MA_B_GF4_A_FW_PRE, IWL_AX210_UCODE_API_MAX);
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
#include "fw/api/txq.h"
|
||||
|
||||
/* Highest firmware API version supported */
|
||||
#define IWL_BZ_UCODE_API_MAX 94
|
||||
#define IWL_BZ_UCODE_API_MAX 96
|
||||
|
||||
/* Lowest firmware API version supported */
|
||||
#define IWL_BZ_UCODE_API_MIN 92
|
||||
@@ -37,20 +37,6 @@
|
||||
|
||||
#define IWL_BZ_A_HR_B_MODULE_FIRMWARE(api) \
|
||||
IWL_BZ_A_HR_B_FW_PRE "-" __stringify(api) ".ucode"
|
||||
#define IWL_BZ_A_GF_A_MODULE_FIRMWARE(api) \
|
||||
IWL_BZ_A_GF_A_FW_PRE "-" __stringify(api) ".ucode"
|
||||
#define IWL_BZ_A_GF4_A_MODULE_FIRMWARE(api) \
|
||||
IWL_BZ_A_GF4_A_FW_PRE "-" __stringify(api) ".ucode"
|
||||
#define IWL_BZ_A_FM_B_MODULE_FIRMWARE(api) \
|
||||
IWL_BZ_A_FM_B_FW_PRE "-" __stringify(api) ".ucode"
|
||||
#define IWL_BZ_A_FM_C_MODULE_FIRMWARE(api) \
|
||||
IWL_BZ_A_FM_C_FW_PRE "-" __stringify(api) ".ucode"
|
||||
#define IWL_BZ_A_FM4_B_MODULE_FIRMWARE(api) \
|
||||
IWL_BZ_A_FM4_B_FW_PRE "-" __stringify(api) ".ucode"
|
||||
#define IWL_GL_B_FM_B_MODULE_FIRMWARE(api) \
|
||||
IWL_GL_B_FM_B_FW_PRE "-" __stringify(api) ".ucode"
|
||||
#define IWL_GL_C_FM_C_MODULE_FIRMWARE(api) \
|
||||
IWL_GL_C_FM_C_FW_PRE "-" __stringify(api) ".ucode"
|
||||
|
||||
static const struct iwl_base_params iwl_bz_base_params = {
|
||||
.eeprom_size = OTP_LOW_IMAGE_SIZE_32K,
|
||||
@@ -181,14 +167,11 @@ const struct iwl_cfg iwl_cfg_gl = {
|
||||
.num_rbds = IWL_NUM_RBDS_BZ_EHT,
|
||||
};
|
||||
|
||||
|
||||
MODULE_FIRMWARE(IWL_BZ_A_HR_B_MODULE_FIRMWARE(IWL_BZ_UCODE_API_MAX));
|
||||
MODULE_FIRMWARE(IWL_BZ_A_GF_A_MODULE_FIRMWARE(IWL_BZ_UCODE_API_MAX));
|
||||
MODULE_FIRMWARE(IWL_BZ_A_GF4_A_MODULE_FIRMWARE(IWL_BZ_UCODE_API_MAX));
|
||||
MODULE_FIRMWARE(IWL_BZ_A_FM_B_MODULE_FIRMWARE(IWL_BZ_UCODE_API_MAX));
|
||||
MODULE_FIRMWARE(IWL_BZ_A_FM_C_MODULE_FIRMWARE(IWL_BZ_UCODE_API_MAX));
|
||||
MODULE_FIRMWARE(IWL_BZ_A_FM4_B_MODULE_FIRMWARE(IWL_BZ_UCODE_API_MAX));
|
||||
MODULE_FIRMWARE(IWL_GL_B_FM_B_MODULE_FIRMWARE(IWL_BZ_UCODE_API_MAX));
|
||||
MODULE_FIRMWARE(IWL_GL_C_FM_C_MODULE_FIRMWARE(IWL_BZ_UCODE_API_MAX));
|
||||
|
||||
MODULE_FIRMWARE("iwlwifi-gl-c0-fm-c0.pnvm");
|
||||
IWL_FW_AND_PNVM(IWL_BZ_A_GF_A_FW_PRE, IWL_BZ_UCODE_API_MAX);
|
||||
IWL_FW_AND_PNVM(IWL_BZ_A_GF4_A_FW_PRE, IWL_BZ_UCODE_API_MAX);
|
||||
IWL_FW_AND_PNVM(IWL_BZ_A_FM_B_FW_PRE, IWL_BZ_UCODE_API_MAX);
|
||||
IWL_FW_AND_PNVM(IWL_BZ_A_FM_C_FW_PRE, IWL_BZ_UCODE_API_MAX);
|
||||
IWL_FW_AND_PNVM(IWL_BZ_A_FM4_B_FW_PRE, IWL_BZ_UCODE_API_MAX);
|
||||
IWL_FW_AND_PNVM(IWL_GL_B_FM_B_FW_PRE, IWL_BZ_UCODE_API_MAX);
|
||||
IWL_FW_AND_PNVM(IWL_GL_C_FM_C_FW_PRE, IWL_BZ_UCODE_API_MAX);
|
||||
|
||||
@@ -0,0 +1,167 @@
|
||||
// SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause
|
||||
/*
|
||||
* Copyright (C) 2024 Intel Corporation
|
||||
*/
|
||||
#include <linux/module.h>
|
||||
#include <linux/stringify.h>
|
||||
#include "iwl-config.h"
|
||||
#include "iwl-prph.h"
|
||||
#include "fw/api/txq.h"
|
||||
|
||||
/* Highest firmware API version supported */
|
||||
#define IWL_DR_UCODE_API_MAX 96
|
||||
|
||||
/* Lowest firmware API version supported */
|
||||
#define IWL_DR_UCODE_API_MIN 96
|
||||
|
||||
/* NVM versions */
|
||||
#define IWL_DR_NVM_VERSION 0x0a1d
|
||||
|
||||
/* Memory offsets and lengths */
|
||||
#define IWL_DR_DCCM_OFFSET 0x800000 /* LMAC1 */
|
||||
#define IWL_DR_DCCM_LEN 0x10000 /* LMAC1 */
|
||||
#define IWL_DR_DCCM2_OFFSET 0x880000
|
||||
#define IWL_DR_DCCM2_LEN 0x8000
|
||||
#define IWL_DR_SMEM_OFFSET 0x400000
|
||||
#define IWL_DR_SMEM_LEN 0xD0000
|
||||
|
||||
#define IWL_DR_A_PE_A_FW_PRE "iwlwifi-dr-a0-pe-a0"
|
||||
#define IWL_BR_A_PET_A_FW_PRE "iwlwifi-br-a0-petc-a0"
|
||||
#define IWL_BR_A_PE_A_FW_PRE "iwlwifi-br-a0-pe-a0"
|
||||
|
||||
#define IWL_DR_A_PE_A_FW_MODULE_FIRMWARE(api) \
|
||||
IWL_DR_A_PE_A_FW_PRE "-" __stringify(api) ".ucode"
|
||||
#define IWL_BR_A_PET_A_FW_MODULE_FIRMWARE(api) \
|
||||
IWL_BR_A_PET_A_FW_PRE "-" __stringify(api) ".ucode"
|
||||
#define IWL_BR_A_PE_A_FW_MODULE_FIRMWARE(api) \
|
||||
IWL_BR_A_PE_A_FW_PRE "-" __stringify(api) ".ucode"
|
||||
|
||||
static const struct iwl_base_params iwl_dr_base_params = {
|
||||
.eeprom_size = OTP_LOW_IMAGE_SIZE_32K,
|
||||
.num_of_queues = 512,
|
||||
.max_tfd_queue_size = 65536,
|
||||
.shadow_ram_support = true,
|
||||
.led_compensation = 57,
|
||||
.wd_timeout = IWL_LONG_WD_TIMEOUT,
|
||||
.max_event_log_size = 512,
|
||||
.shadow_reg_enable = true,
|
||||
.pcie_l1_allowed = true,
|
||||
};
|
||||
|
||||
#define IWL_DEVICE_DR_COMMON \
|
||||
.ucode_api_max = IWL_DR_UCODE_API_MAX, \
|
||||
.ucode_api_min = IWL_DR_UCODE_API_MIN, \
|
||||
.led_mode = IWL_LED_RF_STATE, \
|
||||
.nvm_hw_section_num = 10, \
|
||||
.non_shared_ant = ANT_B, \
|
||||
.dccm_offset = IWL_DR_DCCM_OFFSET, \
|
||||
.dccm_len = IWL_DR_DCCM_LEN, \
|
||||
.dccm2_offset = IWL_DR_DCCM2_OFFSET, \
|
||||
.dccm2_len = IWL_DR_DCCM2_LEN, \
|
||||
.smem_offset = IWL_DR_SMEM_OFFSET, \
|
||||
.smem_len = IWL_DR_SMEM_LEN, \
|
||||
.apmg_not_supported = true, \
|
||||
.trans.mq_rx_supported = true, \
|
||||
.vht_mu_mimo_supported = true, \
|
||||
.mac_addr_from_csr = 0x30, \
|
||||
.nvm_ver = IWL_DR_NVM_VERSION, \
|
||||
.trans.rf_id = true, \
|
||||
.trans.gen2 = true, \
|
||||
.nvm_type = IWL_NVM_EXT, \
|
||||
.dbgc_supported = true, \
|
||||
.min_umac_error_event_table = 0xD0000, \
|
||||
.d3_debug_data_base_addr = 0x401000, \
|
||||
.d3_debug_data_length = 60 * 1024, \
|
||||
.mon_smem_regs = { \
|
||||
.write_ptr = { \
|
||||
.addr = LDBG_M2S_BUF_WPTR, \
|
||||
.mask = LDBG_M2S_BUF_WPTR_VAL_MSK, \
|
||||
}, \
|
||||
.cycle_cnt = { \
|
||||
.addr = LDBG_M2S_BUF_WRAP_CNT, \
|
||||
.mask = LDBG_M2S_BUF_WRAP_CNT_VAL_MSK, \
|
||||
}, \
|
||||
}, \
|
||||
.trans.umac_prph_offset = 0x300000, \
|
||||
.trans.device_family = IWL_DEVICE_FAMILY_DR, \
|
||||
.trans.base_params = &iwl_dr_base_params, \
|
||||
.min_txq_size = 128, \
|
||||
.gp2_reg_addr = 0xd02c68, \
|
||||
.min_ba_txq_size = IWL_DEFAULT_QUEUE_SIZE_EHT, \
|
||||
.mon_dram_regs = { \
|
||||
.write_ptr = { \
|
||||
.addr = DBGC_CUR_DBGBUF_STATUS, \
|
||||
.mask = DBGC_CUR_DBGBUF_STATUS_OFFSET_MSK, \
|
||||
}, \
|
||||
.cycle_cnt = { \
|
||||
.addr = DBGC_DBGBUF_WRAP_AROUND, \
|
||||
.mask = 0xffffffff, \
|
||||
}, \
|
||||
.cur_frag = { \
|
||||
.addr = DBGC_CUR_DBGBUF_STATUS, \
|
||||
.mask = DBGC_CUR_DBGBUF_STATUS_IDX_MSK, \
|
||||
}, \
|
||||
}, \
|
||||
.mon_dbgi_regs = { \
|
||||
.write_ptr = { \
|
||||
.addr = DBGI_SRAM_FIFO_POINTERS, \
|
||||
.mask = DBGI_SRAM_FIFO_POINTERS_WR_PTR_MSK, \
|
||||
}, \
|
||||
}
|
||||
|
||||
#define IWL_DEVICE_DR \
|
||||
IWL_DEVICE_DR_COMMON, \
|
||||
.uhb_supported = true, \
|
||||
.features = IWL_TX_CSUM_NETIF_FLAGS | NETIF_F_RXCSUM, \
|
||||
.num_rbds = IWL_NUM_RBDS_DR_EHT, \
|
||||
.ht_params = &iwl_22000_ht_params
|
||||
|
||||
/*
|
||||
* This size was picked according to 8 MSDUs inside 512 A-MSDUs in an
|
||||
* A-MPDU, with additional overhead to account for processing time.
|
||||
*/
|
||||
#define IWL_NUM_RBDS_DR_EHT (512 * 16)
|
||||
|
||||
const struct iwl_cfg_trans_params iwl_dr_trans_cfg = {
|
||||
.device_family = IWL_DEVICE_FAMILY_DR,
|
||||
.base_params = &iwl_dr_base_params,
|
||||
.mq_rx_supported = true,
|
||||
.rf_id = true,
|
||||
.gen2 = true,
|
||||
.integrated = true,
|
||||
.umac_prph_offset = 0x300000,
|
||||
.xtal_latency = 12000,
|
||||
.low_latency_xtal = true,
|
||||
.ltr_delay = IWL_CFG_TRANS_LTR_DELAY_2500US,
|
||||
};
|
||||
|
||||
const char iwl_dr_name[] = "Intel(R) TBD Dr device";
|
||||
|
||||
const struct iwl_cfg iwl_cfg_dr = {
|
||||
.fw_name_mac = "dr",
|
||||
IWL_DEVICE_DR,
|
||||
};
|
||||
|
||||
const struct iwl_cfg_trans_params iwl_br_trans_cfg = {
|
||||
.device_family = IWL_DEVICE_FAMILY_DR,
|
||||
.base_params = &iwl_dr_base_params,
|
||||
.mq_rx_supported = true,
|
||||
.rf_id = true,
|
||||
.gen2 = true,
|
||||
.integrated = true,
|
||||
.umac_prph_offset = 0x300000,
|
||||
.xtal_latency = 12000,
|
||||
.low_latency_xtal = true,
|
||||
.ltr_delay = IWL_CFG_TRANS_LTR_DELAY_2500US,
|
||||
};
|
||||
|
||||
const char iwl_br_name[] = "Intel(R) TBD Br device";
|
||||
|
||||
const struct iwl_cfg iwl_cfg_br = {
|
||||
.fw_name_mac = "br",
|
||||
IWL_DEVICE_DR,
|
||||
};
|
||||
|
||||
MODULE_FIRMWARE(IWL_DR_A_PE_A_FW_MODULE_FIRMWARE(IWL_DR_UCODE_API_MAX));
|
||||
MODULE_FIRMWARE(IWL_BR_A_PET_A_FW_MODULE_FIRMWARE(IWL_DR_UCODE_API_MAX));
|
||||
MODULE_FIRMWARE(IWL_BR_A_PE_A_FW_MODULE_FIRMWARE(IWL_DR_UCODE_API_MAX));
|
||||
@@ -10,7 +10,7 @@
|
||||
#include "fw/api/txq.h"
|
||||
|
||||
/* Highest firmware API version supported */
|
||||
#define IWL_SC_UCODE_API_MAX 94
|
||||
#define IWL_SC_UCODE_API_MAX 96
|
||||
|
||||
/* Lowest firmware API version supported */
|
||||
#define IWL_SC_UCODE_API_MIN 92
|
||||
@@ -38,28 +38,10 @@
|
||||
#define IWL_SC2F_A_FM_C_FW_PRE "iwlwifi-sc2f-a0-fm-c0"
|
||||
#define IWL_SC2F_A_WH_A_FW_PRE "iwlwifi-sc2f-a0-wh-a0"
|
||||
|
||||
#define IWL_SC_A_FM_B_FW_MODULE_FIRMWARE(api) \
|
||||
IWL_SC_A_FM_B_FW_PRE "-" __stringify(api) ".ucode"
|
||||
#define IWL_SC_A_FM_C_FW_MODULE_FIRMWARE(api) \
|
||||
IWL_SC_A_FM_C_FW_PRE "-" __stringify(api) ".ucode"
|
||||
#define IWL_SC_A_HR_A_FW_MODULE_FIRMWARE(api) \
|
||||
IWL_SC_A_HR_A_FW_PRE "-" __stringify(api) ".ucode"
|
||||
#define IWL_SC_A_HR_B_FW_MODULE_FIRMWARE(api) \
|
||||
IWL_SC_A_HR_B_FW_PRE "-" __stringify(api) ".ucode"
|
||||
#define IWL_SC_A_GF_A_FW_MODULE_FIRMWARE(api) \
|
||||
IWL_SC_A_GF_A_FW_PRE "-" __stringify(api) ".ucode"
|
||||
#define IWL_SC_A_GF4_A_FW_MODULE_FIRMWARE(api) \
|
||||
IWL_SC_A_GF4_A_FW_PRE "-" __stringify(api) ".ucode"
|
||||
#define IWL_SC_A_WH_A_FW_MODULE_FIRMWARE(api) \
|
||||
IWL_SC_A_WH_A_FW_PRE "-" __stringify(api) ".ucode"
|
||||
#define IWL_SC2_A_FM_C_FW_MODULE_FIRMWARE(api) \
|
||||
IWL_SC2_A_FM_C_FW_PRE "-" __stringify(api) ".ucode"
|
||||
#define IWL_SC2_A_WH_A_FW_MODULE_FIRMWARE(api) \
|
||||
IWL_SC2_A_WH_A_FW_PRE "-" __stringify(api) ".ucode"
|
||||
#define IWL_SC2F_A_FM_C_FW_MODULE_FIRMWARE(api) \
|
||||
IWL_SC2F_A_FM_C_FW_PRE "-" __stringify(api) ".ucode"
|
||||
#define IWL_SC2F_A_WH_A_FW_MODULE_FIRMWARE(api) \
|
||||
IWL_SC2F_A_WH_A_FW_PRE "-" __stringify(api) ".ucode"
|
||||
|
||||
static const struct iwl_base_params iwl_sc_base_params = {
|
||||
.eeprom_size = OTP_LOW_IMAGE_SIZE_32K,
|
||||
@@ -181,14 +163,14 @@ const struct iwl_cfg iwl_cfg_sc2f = {
|
||||
IWL_DEVICE_SC,
|
||||
};
|
||||
|
||||
MODULE_FIRMWARE(IWL_SC_A_FM_B_FW_MODULE_FIRMWARE(IWL_SC_UCODE_API_MAX));
|
||||
MODULE_FIRMWARE(IWL_SC_A_FM_C_FW_MODULE_FIRMWARE(IWL_SC_UCODE_API_MAX));
|
||||
IWL_FW_AND_PNVM(IWL_SC_A_FM_B_FW_PRE, IWL_SC_UCODE_API_MAX);
|
||||
IWL_FW_AND_PNVM(IWL_SC_A_FM_C_FW_PRE, IWL_SC_UCODE_API_MAX);
|
||||
MODULE_FIRMWARE(IWL_SC_A_HR_A_FW_MODULE_FIRMWARE(IWL_SC_UCODE_API_MAX));
|
||||
MODULE_FIRMWARE(IWL_SC_A_HR_B_FW_MODULE_FIRMWARE(IWL_SC_UCODE_API_MAX));
|
||||
MODULE_FIRMWARE(IWL_SC_A_GF_A_FW_MODULE_FIRMWARE(IWL_SC_UCODE_API_MAX));
|
||||
MODULE_FIRMWARE(IWL_SC_A_GF4_A_FW_MODULE_FIRMWARE(IWL_SC_UCODE_API_MAX));
|
||||
MODULE_FIRMWARE(IWL_SC_A_WH_A_FW_MODULE_FIRMWARE(IWL_SC_UCODE_API_MAX));
|
||||
MODULE_FIRMWARE(IWL_SC2_A_FM_C_FW_MODULE_FIRMWARE(IWL_SC_UCODE_API_MAX));
|
||||
MODULE_FIRMWARE(IWL_SC2_A_WH_A_FW_MODULE_FIRMWARE(IWL_SC_UCODE_API_MAX));
|
||||
MODULE_FIRMWARE(IWL_SC2F_A_FM_C_FW_MODULE_FIRMWARE(IWL_SC_UCODE_API_MAX));
|
||||
MODULE_FIRMWARE(IWL_SC2F_A_WH_A_FW_MODULE_FIRMWARE(IWL_SC_UCODE_API_MAX));
|
||||
IWL_FW_AND_PNVM(IWL_SC_A_GF_A_FW_PRE, IWL_SC_UCODE_API_MAX);
|
||||
IWL_FW_AND_PNVM(IWL_SC_A_GF4_A_FW_PRE, IWL_SC_UCODE_API_MAX);
|
||||
IWL_FW_AND_PNVM(IWL_SC_A_WH_A_FW_PRE, IWL_SC_UCODE_API_MAX);
|
||||
IWL_FW_AND_PNVM(IWL_SC2_A_FM_C_FW_PRE, IWL_SC_UCODE_API_MAX);
|
||||
IWL_FW_AND_PNVM(IWL_SC2_A_WH_A_FW_PRE, IWL_SC_UCODE_API_MAX);
|
||||
IWL_FW_AND_PNVM(IWL_SC2F_A_FM_C_FW_PRE, IWL_SC_UCODE_API_MAX);
|
||||
IWL_FW_AND_PNVM(IWL_SC2F_A_WH_A_FW_PRE, IWL_SC_UCODE_API_MAX);
|
||||
|
||||
@@ -676,12 +676,12 @@ static int iwl_eeprom_acquire_semaphore(struct iwl_trans *trans)
|
||||
for (count = 0; count < IWL_EEPROM_SEM_RETRY_LIMIT; count++) {
|
||||
/* Request semaphore */
|
||||
iwl_set_bit(trans, CSR_HW_IF_CONFIG_REG,
|
||||
CSR_HW_IF_CONFIG_REG_BIT_EEPROM_OWN_SEM);
|
||||
CSR_HW_IF_CONFIG_REG_EEPROM_OWN_SEM);
|
||||
|
||||
/* See if we got it */
|
||||
ret = iwl_poll_bit(trans, CSR_HW_IF_CONFIG_REG,
|
||||
CSR_HW_IF_CONFIG_REG_BIT_EEPROM_OWN_SEM,
|
||||
CSR_HW_IF_CONFIG_REG_BIT_EEPROM_OWN_SEM,
|
||||
CSR_HW_IF_CONFIG_REG_EEPROM_OWN_SEM,
|
||||
CSR_HW_IF_CONFIG_REG_EEPROM_OWN_SEM,
|
||||
IWL_EEPROM_SEM_TIMEOUT);
|
||||
if (ret >= 0) {
|
||||
IWL_DEBUG_EEPROM(trans->dev,
|
||||
@@ -697,7 +697,7 @@ static int iwl_eeprom_acquire_semaphore(struct iwl_trans *trans)
|
||||
static void iwl_eeprom_release_semaphore(struct iwl_trans *trans)
|
||||
{
|
||||
iwl_clear_bit(trans, CSR_HW_IF_CONFIG_REG,
|
||||
CSR_HW_IF_CONFIG_REG_BIT_EEPROM_OWN_SEM);
|
||||
CSR_HW_IF_CONFIG_REG_EEPROM_OWN_SEM);
|
||||
}
|
||||
|
||||
static int iwl_eeprom_verify_signature(struct iwl_trans *trans, bool nvm_is_otp)
|
||||
|
||||
@@ -1565,6 +1565,16 @@ static void iwlagn_mac_sta_notify(struct ieee80211_hw *hw,
|
||||
IWL_DEBUG_MAC80211(priv, "leave\n");
|
||||
}
|
||||
|
||||
static void
|
||||
iwlagn_mac_reconfig_complete(struct ieee80211_hw *hw,
|
||||
enum ieee80211_reconfig_type reconfig_type)
|
||||
{
|
||||
struct iwl_priv *priv = IWL_MAC80211_GET_DVM(hw);
|
||||
|
||||
if (reconfig_type == IEEE80211_RECONFIG_TYPE_RESTART)
|
||||
iwl_trans_finish_sw_reset(priv->trans);
|
||||
}
|
||||
|
||||
const struct ieee80211_ops iwlagn_hw_ops = {
|
||||
.add_chanctx = ieee80211_emulate_add_chanctx,
|
||||
.remove_chanctx = ieee80211_emulate_remove_chanctx,
|
||||
@@ -1598,6 +1608,7 @@ const struct ieee80211_ops iwlagn_hw_ops = {
|
||||
.tx_last_beacon = iwlagn_mac_tx_last_beacon,
|
||||
.event_callback = iwlagn_mac_event_callback,
|
||||
.set_tim = iwlagn_mac_set_tim,
|
||||
.reconfig_complete = iwlagn_mac_reconfig_complete,
|
||||
};
|
||||
|
||||
/* This function both allocates and initializes hw and priv. */
|
||||
|
||||
@@ -1241,7 +1241,7 @@ static struct iwl_op_mode *iwl_op_mode_dvm_start(struct iwl_trans *trans,
|
||||
STATISTICS_NOTIFICATION,
|
||||
REPLY_TX,
|
||||
};
|
||||
int i;
|
||||
int i, err;
|
||||
|
||||
/************************
|
||||
* 1. Allocating HW data
|
||||
@@ -1249,6 +1249,7 @@ static struct iwl_op_mode *iwl_op_mode_dvm_start(struct iwl_trans *trans,
|
||||
hw = iwl_alloc_all();
|
||||
if (!hw) {
|
||||
pr_err("%s: Cannot allocate network device\n", trans->name);
|
||||
err = -ENOMEM;
|
||||
goto out;
|
||||
}
|
||||
|
||||
@@ -1299,8 +1300,10 @@ static struct iwl_op_mode *iwl_op_mode_dvm_start(struct iwl_trans *trans,
|
||||
break;
|
||||
}
|
||||
|
||||
if (WARN_ON(!priv->lib))
|
||||
if (WARN_ON(!priv->lib)) {
|
||||
err = -ENODEV;
|
||||
goto out_free_hw;
|
||||
}
|
||||
|
||||
/*
|
||||
* Populate the state variables that the transport layer needs
|
||||
@@ -1377,12 +1380,14 @@ static struct iwl_op_mode *iwl_op_mode_dvm_start(struct iwl_trans *trans,
|
||||
IWL_INFO(priv, "Detected %s, REV=0x%X\n",
|
||||
priv->trans->name, priv->trans->hw_rev);
|
||||
|
||||
if (iwl_trans_start_hw(priv->trans))
|
||||
err = iwl_trans_start_hw(priv->trans);
|
||||
if (err)
|
||||
goto out_free_hw;
|
||||
|
||||
/* Read the EEPROM */
|
||||
if (iwl_read_eeprom(priv->trans, &priv->eeprom_blob,
|
||||
&priv->eeprom_blob_size)) {
|
||||
err = iwl_read_eeprom(priv->trans, &priv->eeprom_blob,
|
||||
&priv->eeprom_blob_size);
|
||||
if (err) {
|
||||
IWL_ERR(priv, "Unable to init EEPROM\n");
|
||||
goto out_free_hw;
|
||||
}
|
||||
@@ -1393,13 +1398,17 @@ static struct iwl_op_mode *iwl_op_mode_dvm_start(struct iwl_trans *trans,
|
||||
priv->nvm_data = iwl_parse_eeprom_data(priv->trans, priv->cfg,
|
||||
priv->eeprom_blob,
|
||||
priv->eeprom_blob_size);
|
||||
if (!priv->nvm_data)
|
||||
if (!priv->nvm_data) {
|
||||
err = -ENOMEM;
|
||||
goto out_free_eeprom_blob;
|
||||
}
|
||||
|
||||
if (iwl_nvm_check_version(priv->nvm_data, priv->trans))
|
||||
err = iwl_nvm_check_version(priv->nvm_data, priv->trans);
|
||||
if (err)
|
||||
goto out_free_eeprom;
|
||||
|
||||
if (iwl_eeprom_init_hw_params(priv))
|
||||
err = iwl_eeprom_init_hw_params(priv);
|
||||
if (err)
|
||||
goto out_free_eeprom;
|
||||
|
||||
/* extract MAC Address */
|
||||
@@ -1446,7 +1455,8 @@ static struct iwl_op_mode *iwl_op_mode_dvm_start(struct iwl_trans *trans,
|
||||
atomic_set(&priv->queue_stop_count[i], 0);
|
||||
}
|
||||
|
||||
if (iwl_init_drv(priv))
|
||||
err = iwl_init_drv(priv);
|
||||
if (err)
|
||||
goto out_free_eeprom;
|
||||
|
||||
/* At this point both hw and priv are initialized. */
|
||||
@@ -1480,7 +1490,8 @@ static struct iwl_op_mode *iwl_op_mode_dvm_start(struct iwl_trans *trans,
|
||||
*
|
||||
* 7. Setup and register with mac80211 and debugfs
|
||||
**************************************************/
|
||||
if (iwlagn_mac_setup_register(priv, &fw->ucode_capa))
|
||||
err = iwlagn_mac_setup_register(priv, &fw->ucode_capa);
|
||||
if (err)
|
||||
goto out_destroy_workqueue;
|
||||
|
||||
iwl_dbgfs_register(priv, dbgfs_dir);
|
||||
@@ -1500,8 +1511,7 @@ out_free_eeprom:
|
||||
out_free_hw:
|
||||
ieee80211_free_hw(priv->hw);
|
||||
out:
|
||||
op_mode = NULL;
|
||||
return op_mode;
|
||||
return ERR_PTR(err);
|
||||
}
|
||||
|
||||
static void iwl_op_mode_dvm_stop(struct iwl_op_mode *op_mode)
|
||||
@@ -1895,17 +1905,9 @@ static void iwlagn_fw_error(struct iwl_priv *priv, bool ondemand)
|
||||
unsigned int reload_msec;
|
||||
unsigned long reload_jiffies;
|
||||
|
||||
if (iwl_have_debug_level(IWL_DL_FW))
|
||||
iwl_print_rx_config_cmd(priv, IWL_RXON_CTX_BSS);
|
||||
|
||||
/* uCode is no longer loaded. */
|
||||
priv->ucode_loaded = false;
|
||||
|
||||
/* Set the FW error flag -- cleared on iwl_down */
|
||||
set_bit(STATUS_FW_ERROR, &priv->status);
|
||||
|
||||
iwl_abort_notification_waits(&priv->notif_wait);
|
||||
|
||||
/* Keep the restart process from trying to send host
|
||||
* commands by clearing the ready bit */
|
||||
clear_bit(STATUS_READY, &priv->status);
|
||||
@@ -1942,27 +1944,43 @@ static void iwlagn_fw_error(struct iwl_priv *priv, bool ondemand)
|
||||
}
|
||||
}
|
||||
|
||||
static void iwl_nic_error(struct iwl_op_mode *op_mode, bool sync)
|
||||
static void iwl_nic_error(struct iwl_op_mode *op_mode,
|
||||
enum iwl_fw_error_type type)
|
||||
{
|
||||
struct iwl_priv *priv = IWL_OP_MODE_GET_DVM(op_mode);
|
||||
|
||||
/* Set the FW error flag -- cleared on iwl_down */
|
||||
set_bit(STATUS_FW_ERROR, &priv->status);
|
||||
|
||||
iwl_abort_notification_waits(&priv->notif_wait);
|
||||
|
||||
if (type == IWL_ERR_TYPE_CMD_QUEUE_FULL && iwl_check_for_ct_kill(priv))
|
||||
return;
|
||||
|
||||
IWL_ERR(priv, "Loaded firmware version: %s\n",
|
||||
priv->fw->fw_version);
|
||||
|
||||
iwl_dump_nic_error_log(priv);
|
||||
iwl_dump_nic_event_log(priv, false, NULL);
|
||||
if (type == IWL_ERR_TYPE_CMD_QUEUE_FULL) {
|
||||
IWL_ERR(priv, "Command queue full!\n");
|
||||
} else {
|
||||
iwl_dump_nic_error_log(priv);
|
||||
iwl_dump_nic_event_log(priv, false, NULL);
|
||||
}
|
||||
|
||||
iwlagn_fw_error(priv, false);
|
||||
if (iwl_have_debug_level(IWL_DL_FW))
|
||||
iwl_print_rx_config_cmd(priv, IWL_RXON_CTX_BSS);
|
||||
}
|
||||
|
||||
static void iwl_cmd_queue_full(struct iwl_op_mode *op_mode)
|
||||
static bool iwlagn_sw_reset(struct iwl_op_mode *op_mode,
|
||||
enum iwl_fw_error_type type)
|
||||
{
|
||||
struct iwl_priv *priv = IWL_OP_MODE_GET_DVM(op_mode);
|
||||
|
||||
if (!iwl_check_for_ct_kill(priv)) {
|
||||
IWL_ERR(priv, "Restarting adapter queue is full\n");
|
||||
iwlagn_fw_error(priv, false);
|
||||
}
|
||||
if (type == IWL_ERR_TYPE_CMD_QUEUE_FULL && iwl_check_for_ct_kill(priv))
|
||||
return false;
|
||||
|
||||
iwlagn_fw_error(priv, false);
|
||||
return true;
|
||||
}
|
||||
|
||||
#define EEPROM_RF_CONFIG_TYPE_MAX 0x3
|
||||
@@ -2117,7 +2135,7 @@ static const struct iwl_op_mode_ops iwl_dvm_ops = {
|
||||
.hw_rf_kill = iwl_set_hw_rfkill_state,
|
||||
.free_skb = iwl_free_skb,
|
||||
.nic_error = iwl_nic_error,
|
||||
.cmd_queue_full = iwl_cmd_queue_full,
|
||||
.sw_reset = iwlagn_sw_reset,
|
||||
.nic_config = iwl_nic_config,
|
||||
.wimax_active = iwl_wimax_active,
|
||||
};
|
||||
|
||||
@@ -79,9 +79,9 @@ static void *iwl_acpi_get_object(struct device *dev, acpi_string method)
|
||||
* method (DSM) interface. The returned acpi object must be freed by calling
|
||||
* function.
|
||||
*/
|
||||
static void *iwl_acpi_get_dsm_object(struct device *dev, int rev, int func,
|
||||
union acpi_object *args,
|
||||
const guid_t *guid)
|
||||
union acpi_object *iwl_acpi_get_dsm_object(struct device *dev, int rev,
|
||||
int func, union acpi_object *args,
|
||||
const guid_t *guid)
|
||||
{
|
||||
union acpi_object *obj;
|
||||
|
||||
@@ -108,7 +108,7 @@ static int iwl_acpi_get_dsm_integer(struct device *dev, int rev, int func,
|
||||
size_t expected_size)
|
||||
{
|
||||
union acpi_object *obj;
|
||||
int ret = 0;
|
||||
int ret;
|
||||
|
||||
obj = iwl_acpi_get_dsm_object(dev, rev, func, NULL, guid);
|
||||
if (IS_ERR(obj)) {
|
||||
@@ -123,8 +123,10 @@ static int iwl_acpi_get_dsm_integer(struct device *dev, int rev, int func,
|
||||
} else if (obj->type == ACPI_TYPE_BUFFER) {
|
||||
__le64 le_value = 0;
|
||||
|
||||
if (WARN_ON_ONCE(expected_size > sizeof(le_value)))
|
||||
return -EINVAL;
|
||||
if (WARN_ON_ONCE(expected_size > sizeof(le_value))) {
|
||||
ret = -EINVAL;
|
||||
goto out;
|
||||
}
|
||||
|
||||
/* if the buffer size doesn't match the expected size */
|
||||
if (obj->buffer.length != expected_size)
|
||||
@@ -145,8 +147,9 @@ static int iwl_acpi_get_dsm_integer(struct device *dev, int rev, int func,
|
||||
}
|
||||
|
||||
IWL_DEBUG_DEV_RADIO(dev,
|
||||
"ACPI: DSM method evaluated: func=%d, ret=%d\n",
|
||||
func, ret);
|
||||
"ACPI: DSM method evaluated: func=%d, value=%lld\n",
|
||||
func, *value);
|
||||
ret = 0;
|
||||
out:
|
||||
ACPI_FREE(obj);
|
||||
return ret;
|
||||
@@ -259,13 +262,14 @@ int iwl_acpi_get_tas_table(struct iwl_fw_runtime *fwrt,
|
||||
struct iwl_tas_data *tas_data)
|
||||
{
|
||||
union acpi_object *wifi_pkg, *data;
|
||||
int ret, tbl_rev, i, block_list_size, enabled;
|
||||
int ret, tbl_rev, block_list_size, enabled;
|
||||
u32 tas_selection;
|
||||
|
||||
data = iwl_acpi_get_object(fwrt->dev, ACPI_WTAS_METHOD);
|
||||
if (IS_ERR(data))
|
||||
return PTR_ERR(data);
|
||||
|
||||
/* try to read wtas table revision 1 or revision 0*/
|
||||
/* try to read wtas table */
|
||||
wifi_pkg = iwl_acpi_get_wifi_pkg(fwrt->dev, data,
|
||||
ACPI_WTAS_WIFI_DATA_SIZE,
|
||||
&tbl_rev);
|
||||
@@ -274,27 +278,23 @@ int iwl_acpi_get_tas_table(struct iwl_fw_runtime *fwrt,
|
||||
goto out_free;
|
||||
}
|
||||
|
||||
if (tbl_rev == 1 && wifi_pkg->package.elements[1].type ==
|
||||
ACPI_TYPE_INTEGER) {
|
||||
u32 tas_selection =
|
||||
(u32)wifi_pkg->package.elements[1].integer.value;
|
||||
|
||||
enabled = iwl_parse_tas_selection(fwrt, tas_data,
|
||||
tas_selection);
|
||||
|
||||
} else if (tbl_rev == 0 &&
|
||||
wifi_pkg->package.elements[1].type == ACPI_TYPE_INTEGER) {
|
||||
enabled = !!wifi_pkg->package.elements[1].integer.value;
|
||||
} else {
|
||||
if (tbl_rev < 0 || tbl_rev > 2 ||
|
||||
wifi_pkg->package.elements[1].type != ACPI_TYPE_INTEGER) {
|
||||
ret = -EINVAL;
|
||||
goto out_free;
|
||||
}
|
||||
|
||||
if (!enabled) {
|
||||
IWL_DEBUG_RADIO(fwrt, "TAS not enabled\n");
|
||||
ret = 0;
|
||||
goto out_free;
|
||||
}
|
||||
tas_selection = (u32)wifi_pkg->package.elements[1].integer.value;
|
||||
enabled = tas_selection & IWL_WTAS_ENABLED_MSK;
|
||||
|
||||
IWL_DEBUG_RADIO(fwrt, "TAS selection as read from BIOS: 0x%x\n",
|
||||
tas_selection);
|
||||
tas_data->table_source = BIOS_SOURCE_ACPI;
|
||||
tas_data->table_revision = tbl_rev;
|
||||
tas_data->tas_selection = tas_selection;
|
||||
|
||||
IWL_DEBUG_RADIO(fwrt, "TAS %s enabled\n",
|
||||
enabled ? "is" : "not");
|
||||
|
||||
IWL_DEBUG_RADIO(fwrt, "Reading TAS table revision %d\n", tbl_rev);
|
||||
if (wifi_pkg->package.elements[2].type != ACPI_TYPE_INTEGER ||
|
||||
@@ -305,13 +305,14 @@ int iwl_acpi_get_tas_table(struct iwl_fw_runtime *fwrt,
|
||||
ret = -EINVAL;
|
||||
goto out_free;
|
||||
}
|
||||
|
||||
block_list_size = wifi_pkg->package.elements[2].integer.value;
|
||||
tas_data->block_list_size = cpu_to_le32(block_list_size);
|
||||
tas_data->block_list_size = block_list_size;
|
||||
|
||||
IWL_DEBUG_RADIO(fwrt, "TAS array size %u\n", block_list_size);
|
||||
|
||||
for (i = 0; i < block_list_size; i++) {
|
||||
u32 country;
|
||||
for (int i = 0; i < block_list_size; i++) {
|
||||
u16 country;
|
||||
|
||||
if (wifi_pkg->package.elements[3 + i].type !=
|
||||
ACPI_TYPE_INTEGER) {
|
||||
@@ -322,11 +323,11 @@ int iwl_acpi_get_tas_table(struct iwl_fw_runtime *fwrt,
|
||||
}
|
||||
|
||||
country = wifi_pkg->package.elements[3 + i].integer.value;
|
||||
tas_data->block_list_array[i] = cpu_to_le32(country);
|
||||
tas_data->block_list_array[i] = country;
|
||||
IWL_DEBUG_RADIO(fwrt, "TAS block list country %d\n", country);
|
||||
}
|
||||
|
||||
ret = 1;
|
||||
ret = enabled;
|
||||
out_free:
|
||||
kfree(data);
|
||||
return ret;
|
||||
@@ -1023,3 +1024,37 @@ out_free:
|
||||
kfree(data);
|
||||
return ret;
|
||||
}
|
||||
|
||||
int iwl_acpi_get_dsbr(struct iwl_fw_runtime *fwrt, u32 *value)
|
||||
{
|
||||
union acpi_object *wifi_pkg, *data;
|
||||
int ret = -ENOENT;
|
||||
int tbl_rev;
|
||||
|
||||
data = iwl_acpi_get_object(fwrt->dev, ACPI_DSBR_METHOD);
|
||||
if (IS_ERR(data))
|
||||
return ret;
|
||||
|
||||
wifi_pkg = iwl_acpi_get_wifi_pkg(fwrt->dev, data,
|
||||
ACPI_DSBR_WIFI_DATA_SIZE,
|
||||
&tbl_rev);
|
||||
if (IS_ERR(wifi_pkg))
|
||||
goto out_free;
|
||||
|
||||
if (tbl_rev != ACPI_DSBR_WIFI_DATA_REV) {
|
||||
IWL_DEBUG_RADIO(fwrt, "Unsupported ACPI DSBR revision:%d\n",
|
||||
tbl_rev);
|
||||
goto out_free;
|
||||
}
|
||||
|
||||
if (wifi_pkg->package.elements[1].type != ACPI_TYPE_INTEGER)
|
||||
goto out_free;
|
||||
|
||||
*value = wifi_pkg->package.elements[1].integer.value;
|
||||
IWL_DEBUG_RADIO(fwrt, "Loaded DSBR config from ACPI value: 0x%x\n",
|
||||
*value);
|
||||
ret = 0;
|
||||
out_free:
|
||||
kfree(data);
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -28,6 +28,7 @@
|
||||
#define ACPI_WPFC_METHOD "WPFC"
|
||||
#define ACPI_GLAI_METHOD "GLAI"
|
||||
#define ACPI_WBEM_METHOD "WBEM"
|
||||
#define ACPI_DSBR_METHOD "DSBR"
|
||||
|
||||
#define ACPI_WIFI_DOMAIN (0x07)
|
||||
|
||||
@@ -74,6 +75,13 @@
|
||||
* and one for enablement of Wi-Fi 320MHz per MCC
|
||||
*/
|
||||
#define ACPI_WBEM_WIFI_DATA_SIZE 2
|
||||
/*
|
||||
* One element for domain type,
|
||||
* and one for DSBR response data
|
||||
*/
|
||||
#define ACPI_DSBR_WIFI_DATA_SIZE 2
|
||||
#define ACPI_DSBR_WIFI_DATA_REV 1
|
||||
|
||||
/*
|
||||
* One element for domain type,
|
||||
* and one for the status
|
||||
@@ -101,6 +109,30 @@
|
||||
|
||||
#define ACPI_DSM_REV 0
|
||||
|
||||
#define DSM_INTERNAL_FUNC_GET_PLAT_INFO 1
|
||||
/* TBD: VPRO is BIT(0) in the result, but what's the result? */
|
||||
|
||||
#define DSM_INTERNAL_FUNC_PRODUCT_RESET 2
|
||||
|
||||
/* DSM_INTERNAL_FUNC_PRODUCT_RESET - product reset (aka "PLDR") */
|
||||
enum iwl_dsm_internal_product_reset_cmds {
|
||||
DSM_INTERNAL_PLDR_CMD_GET_MODE = 1,
|
||||
DSM_INTERNAL_PLDR_CMD_SET_MODE = 2,
|
||||
DSM_INTERNAL_PLDR_CMD_GET_STATUS = 3,
|
||||
};
|
||||
|
||||
enum iwl_dsm_internal_product_reset_mode {
|
||||
DSM_INTERNAL_PLDR_MODE_EN_PROD_RESET = BIT(0),
|
||||
DSM_INTERNAL_PLDR_MODE_EN_WIFI_FLR = BIT(1),
|
||||
DSM_INTERNAL_PLDR_MODE_EN_BT_OFF_ON = BIT(2),
|
||||
};
|
||||
|
||||
struct iwl_dsm_internal_product_reset_cmd {
|
||||
/* cmd is from enum iwl_dsm_internal_product_reset_cmds */
|
||||
u16 cmd;
|
||||
u16 value;
|
||||
} __packed;
|
||||
|
||||
#define IWL_ACPI_WBEM_REV0_MASK (BIT(0) | BIT(1))
|
||||
#define IWL_ACPI_WBEM_REVISION 0
|
||||
|
||||
@@ -110,6 +142,10 @@ struct iwl_fw_runtime;
|
||||
|
||||
extern const guid_t iwl_guid;
|
||||
|
||||
union acpi_object *iwl_acpi_get_dsm_object(struct device *dev, int rev,
|
||||
int func, union acpi_object *args,
|
||||
const guid_t *guid);
|
||||
|
||||
/**
|
||||
* iwl_acpi_get_mcc - read MCC from ACPI, if available
|
||||
*
|
||||
@@ -153,10 +189,14 @@ int iwl_acpi_get_dsm(struct iwl_fw_runtime *fwrt,
|
||||
enum iwl_dsm_funcs func, u32 *value);
|
||||
|
||||
int iwl_acpi_get_wbem(struct iwl_fw_runtime *fwrt, u32 *value);
|
||||
|
||||
int iwl_acpi_get_dsbr(struct iwl_fw_runtime *fwrt, u32 *value);
|
||||
|
||||
#else /* CONFIG_ACPI */
|
||||
|
||||
static inline void *iwl_acpi_get_dsm_object(struct device *dev, int rev,
|
||||
int func, union acpi_object *args)
|
||||
static inline union acpi_object *
|
||||
iwl_acpi_get_dsm_object(struct device *dev, int rev, int func,
|
||||
union acpi_object *args, const guid_t *guid)
|
||||
{
|
||||
return ERR_PTR(-ENOENT);
|
||||
}
|
||||
@@ -221,6 +261,11 @@ static inline int iwl_acpi_get_wbem(struct iwl_fw_runtime *fwrt, u32 *value)
|
||||
{
|
||||
return -ENOENT;
|
||||
}
|
||||
|
||||
static inline int iwl_acpi_get_dsbr(struct iwl_fw_runtime *fwrt, u32 *value)
|
||||
{
|
||||
return -ENOENT;
|
||||
}
|
||||
#endif /* CONFIG_ACPI */
|
||||
|
||||
#endif /* __iwl_fw_acpi__ */
|
||||
|
||||
@@ -447,7 +447,7 @@ enum iwl_legacy_cmds {
|
||||
|
||||
/**
|
||||
* @BA_NOTIF:
|
||||
* BlockAck notification, uses &struct iwl_mvm_compressed_ba_notif
|
||||
* BlockAck notification, uses &struct iwl_compressed_ba_notif
|
||||
* or &struct iwl_mvm_ba_notif depending on the HW
|
||||
*/
|
||||
BA_NOTIF = 0xc5,
|
||||
|
||||
@@ -391,7 +391,7 @@ enum iwl_datapath_monitor_notif_type {
|
||||
|
||||
struct iwl_datapath_monitor_notif {
|
||||
__le32 type;
|
||||
u8 mac_id;
|
||||
u8 link_id;
|
||||
u8 reserved[3];
|
||||
} __packed; /* MONITOR_NTF_API_S_VER_1 */
|
||||
|
||||
|
||||
@@ -477,6 +477,9 @@ struct iwl_mvm_tas_status_per_mac {
|
||||
* @tas_status_mac: TAS status per lmac, uses
|
||||
* &struct iwl_mvm_tas_status_per_mac
|
||||
* @in_dual_radio: is TAS in dual radio? - TRUE/FALSE
|
||||
* @uhb_allowed_flags: see &enum iwl_tas_uhb_allowed_flags.
|
||||
* This member is valid only when fw has
|
||||
* %IWL_UCODE_TLV_CAPA_UHB_CANADA_TAS_SUPPORT capability.
|
||||
* @reserved: reserved
|
||||
*/
|
||||
struct iwl_mvm_tas_status_resp {
|
||||
@@ -486,7 +489,8 @@ struct iwl_mvm_tas_status_resp {
|
||||
__le16 block_list[16];
|
||||
struct iwl_mvm_tas_status_per_mac tas_status_mac[2];
|
||||
u8 in_dual_radio;
|
||||
u8 reserved[3];
|
||||
u8 uhb_allowed_flags;
|
||||
u8 reserved[2];
|
||||
} __packed; /*DEBUG_GET_TAS_STATUS_RSP_API_S_VER_3*/
|
||||
|
||||
/**
|
||||
|
||||
@@ -74,7 +74,7 @@ enum iwl_mac_conf_subcmd_ids {
|
||||
*/
|
||||
ROC_NOTIF = 0xF8,
|
||||
/**
|
||||
* @SESSION_PROTECTION_NOTIF: &struct iwl_mvm_session_prot_notif
|
||||
* @SESSION_PROTECTION_NOTIF: &struct iwl_session_prot_notif
|
||||
*/
|
||||
SESSION_PROTECTION_NOTIF = 0xFB,
|
||||
|
||||
|
||||
@@ -463,22 +463,31 @@ struct iwl_tas_config_cmd_v3 {
|
||||
__le16 enable_tas_iec;
|
||||
} __packed; /* TAS_CONFIG_CMD_API_S_VER_3 */
|
||||
|
||||
/**
|
||||
* enum iwl_tas_uhb_allowed_flags - per country TAS UHB allowed flags.
|
||||
* @TAS_UHB_ALLOWED_CANADA: TAS UHB is allowed in Canada. This flag is valid
|
||||
* only when fw has %IWL_UCODE_TLV_CAPA_UHB_CANADA_TAS_SUPPORT capability.
|
||||
*/
|
||||
enum iwl_tas_uhb_allowed_flags {
|
||||
TAS_UHB_ALLOWED_CANADA = BIT(0),
|
||||
};
|
||||
|
||||
/**
|
||||
* struct iwl_tas_config_cmd_v4 - configures the TAS
|
||||
* @override_tas_iec: indicates whether to override default value of IEC regulatory
|
||||
* @enable_tas_iec: in case override_tas_iec is set -
|
||||
* indicates whether IEC regulatory is enabled or disabled
|
||||
* @usa_tas_uhb_allowed: if set, allow TAS UHB in the USA
|
||||
* @reserved: reserved
|
||||
*/
|
||||
* @uhb_allowed_flags: see &enum iwl_tas_uhb_allowed_flags.
|
||||
*/
|
||||
struct iwl_tas_config_cmd_v4 {
|
||||
u8 override_tas_iec;
|
||||
u8 enable_tas_iec;
|
||||
u8 usa_tas_uhb_allowed;
|
||||
u8 reserved;
|
||||
u8 uhb_allowed_flags;
|
||||
} __packed; /* TAS_CONFIG_CMD_API_S_VER_4 */
|
||||
|
||||
struct iwl_tas_config_cmd {
|
||||
struct iwl_tas_config_cmd_v2_v4 {
|
||||
struct iwl_tas_config_cmd_common common;
|
||||
union {
|
||||
struct iwl_tas_config_cmd_v3 v3;
|
||||
@@ -486,6 +495,46 @@ struct iwl_tas_config_cmd {
|
||||
};
|
||||
};
|
||||
|
||||
/**
|
||||
* enum bios_source - source of bios data
|
||||
* @BIOS_SOURCE_NONE: BIOS source is not defined
|
||||
* @BIOS_SOURCE_ACPI: BIOS source is ACPI
|
||||
* @BIOS_SOURCE_UEFI: BIOS source is UEFI
|
||||
*/
|
||||
enum bios_source {
|
||||
BIOS_SOURCE_NONE,
|
||||
BIOS_SOURCE_ACPI,
|
||||
BIOS_SOURCE_UEFI,
|
||||
};
|
||||
|
||||
/**
|
||||
* struct bios_value_u32 - BIOS configuration.
|
||||
* @table_source: see &enum bios_source
|
||||
* @table_revision: table revision.
|
||||
* @reserved: reserved
|
||||
* @value: value in bios.
|
||||
*/
|
||||
struct bios_value_u32 {
|
||||
u8 table_source;
|
||||
u8 table_revision;
|
||||
u8 reserved[2];
|
||||
__le32 value;
|
||||
} __packed; /* BIOS_TABLE_SOURCE_U32_S_VER_1 */
|
||||
|
||||
/**
|
||||
* struct iwl_tas_config_cmd - configures the TAS.
|
||||
* @block_list_size: size of relevant field in block_list_array
|
||||
* @block_list_array: list of countries where TAS must be disabled
|
||||
* @reserved: reserved
|
||||
* @tas_config_info: see @struct bios_value_u32
|
||||
*/
|
||||
struct iwl_tas_config_cmd {
|
||||
__le16 block_list_size;
|
||||
__le16 block_list_array[IWL_WTAS_BLACK_LIST_MAX];
|
||||
u8 reserved[2];
|
||||
struct bios_value_u32 tas_config_info;
|
||||
} __packed; /* TAS_CONFIG_CMD_API_S_VER_5 */
|
||||
|
||||
/**
|
||||
* enum iwl_lari_config_masks - bit masks for the various LARI config operations
|
||||
* @LARI_CONFIG_DISABLE_11AC_UKRAINE_MSK: disable 11ac in ukraine
|
||||
|
||||
@@ -31,7 +31,7 @@ enum iwl_prot_offload_subcmd_ids {
|
||||
|
||||
/**
|
||||
* @STORED_BEACON_NTF: &struct iwl_stored_beacon_notif_v2 or
|
||||
* &struct iwl_stored_beacon_notif_v3
|
||||
* &struct iwl_stored_beacon_notif
|
||||
*/
|
||||
STORED_BEACON_NTF = 0xFF,
|
||||
};
|
||||
@@ -71,18 +71,18 @@ struct iwl_stored_beacon_notif_v2 {
|
||||
} __packed; /* WOWLAN_STROED_BEACON_INFO_S_VER_2 */
|
||||
|
||||
/**
|
||||
* struct iwl_stored_beacon_notif_v3 - Stored beacon notification
|
||||
* struct iwl_stored_beacon_notif - Stored beacon notification
|
||||
*
|
||||
* @common: fields common for all versions
|
||||
* @sta_id: station for which the beacon was received
|
||||
* @reserved: reserved for alignment
|
||||
* @data: beacon data, length in @byte_count
|
||||
*/
|
||||
struct iwl_stored_beacon_notif_v3 {
|
||||
struct iwl_stored_beacon_notif {
|
||||
struct iwl_stored_beacon_notif_common common;
|
||||
u8 sta_id;
|
||||
u8 reserved[3];
|
||||
u8 data[MAX_STORED_BEACON_SIZE];
|
||||
} __packed; /* WOWLAN_STROED_BEACON_INFO_S_VER_3 */
|
||||
} __packed; /* WOWLAN_STROED_BEACON_INFO_S_VER_3, _VER_4 */
|
||||
|
||||
#endif /* __iwl_fw_api_offload_h__ */
|
||||
|
||||
@@ -266,7 +266,7 @@ struct iwl_reduce_tx_power_cmd {
|
||||
} __packed; /* TX_REDUCED_POWER_API_S_VER_1 */
|
||||
|
||||
enum iwl_dev_tx_power_cmd_mode {
|
||||
IWL_TX_POWER_MODE_SET_MAC = 0,
|
||||
IWL_TX_POWER_MODE_SET_LINK = 0,
|
||||
IWL_TX_POWER_MODE_SET_DEVICE = 1,
|
||||
IWL_TX_POWER_MODE_SET_CHAINS = 2,
|
||||
IWL_TX_POWER_MODE_SET_ACK = 3,
|
||||
@@ -283,12 +283,14 @@ enum iwl_dev_tx_power_cmd_mode {
|
||||
/**
|
||||
* struct iwl_dev_tx_power_common - Common part of the TX power reduction cmd
|
||||
* @set_mode: see &enum iwl_dev_tx_power_cmd_mode
|
||||
* @mac_context_id: id of the mac ctx for which we are reducing TX power.
|
||||
* @link_id: id of the link ctx for which we are reducing TX power.
|
||||
* For version 9 / 10, this is the link id. For earlier versions, it is
|
||||
* the mac id.
|
||||
* @pwr_restriction: TX power restriction in 1/8 dBms.
|
||||
*/
|
||||
struct iwl_dev_tx_power_common {
|
||||
__le32 set_mode;
|
||||
__le32 mac_context_id;
|
||||
__le32 link_id;
|
||||
__le16 pwr_restriction;
|
||||
} __packed;
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause */
|
||||
/*
|
||||
* Copyright (C) 2012-2014, 2018 Intel Corporation
|
||||
* Copyright (C) 2012-2014, 2018, 2024 Intel Corporation
|
||||
* Copyright (C) 2013-2015 Intel Mobile Communications GmbH
|
||||
* Copyright (C) 2016-2017 Intel Deutschland GmbH
|
||||
*/
|
||||
@@ -10,7 +10,7 @@
|
||||
#include "fw/api/tx.h"
|
||||
#include "fw/api/phy-ctxt.h"
|
||||
|
||||
#define IWL_MVM_TDLS_STA_COUNT 4
|
||||
#define IWL_TDLS_STA_COUNT 4
|
||||
|
||||
/* Type of TDLS request */
|
||||
enum iwl_tdls_channel_switch_type {
|
||||
@@ -128,7 +128,7 @@ struct iwl_tdls_config_cmd {
|
||||
u8 tdls_peer_count;
|
||||
u8 tx_to_ap_tid;
|
||||
__le16 tx_to_ap_ssn;
|
||||
struct iwl_tdls_sta_info sta_info[IWL_MVM_TDLS_STA_COUNT];
|
||||
struct iwl_tdls_sta_info sta_info[IWL_TDLS_STA_COUNT];
|
||||
|
||||
__le32 pti_req_data_offset;
|
||||
struct iwl_tx_cmd pti_req_tx_cmd;
|
||||
@@ -155,7 +155,7 @@ struct iwl_tdls_config_sta_info_res {
|
||||
*/
|
||||
struct iwl_tdls_config_res {
|
||||
__le32 tx_to_ap_last_seq;
|
||||
struct iwl_tdls_config_sta_info_res sta_info[IWL_MVM_TDLS_STA_COUNT];
|
||||
struct iwl_tdls_config_sta_info_res sta_info[IWL_TDLS_STA_COUNT];
|
||||
} __packed; /* TDLS_CONFIG_RSP_API_S_VER_1 */
|
||||
|
||||
#endif /* __iwl_fw_api_tdls_h__ */
|
||||
|
||||
@@ -395,7 +395,7 @@ struct iwl_roc_notif {
|
||||
} __packed; /* ROC_NOTIF_API_S_VER_1 */
|
||||
|
||||
/**
|
||||
* enum iwl_mvm_session_prot_conf_id - session protection's configurations
|
||||
* enum iwl_session_prot_conf_id - session protection's configurations
|
||||
* @SESSION_PROTECT_CONF_ASSOC: Start a session protection for association.
|
||||
* The firmware will allocate two events.
|
||||
* Valid for BSS_STA and P2P_STA.
|
||||
@@ -424,7 +424,7 @@ struct iwl_roc_notif {
|
||||
* be taken into account.
|
||||
* @SESSION_PROTECT_CONF_MAX_ID: not used
|
||||
*/
|
||||
enum iwl_mvm_session_prot_conf_id {
|
||||
enum iwl_session_prot_conf_id {
|
||||
SESSION_PROTECT_CONF_ASSOC,
|
||||
SESSION_PROTECT_CONF_GO_CLIENT_ASSOC,
|
||||
SESSION_PROTECT_CONF_P2P_DEVICE_DISCOV,
|
||||
@@ -433,12 +433,12 @@ enum iwl_mvm_session_prot_conf_id {
|
||||
}; /* SESSION_PROTECTION_CONF_ID_E_VER_1 */
|
||||
|
||||
/**
|
||||
* struct iwl_mvm_session_prot_cmd - configure a session protection
|
||||
* struct iwl_session_prot_cmd - configure a session protection
|
||||
* @id_and_color: the id and color of the link (or mac, for command version 1)
|
||||
* for which this session protection is sent
|
||||
* @action: can be either FW_CTXT_ACTION_ADD or FW_CTXT_ACTION_REMOVE,
|
||||
* see &enum iwl_ctxt_action
|
||||
* @conf_id: see &enum iwl_mvm_session_prot_conf_id
|
||||
* @conf_id: see &enum iwl_session_prot_conf_id
|
||||
* @duration_tu: the duration of the whole protection in TUs.
|
||||
* @repetition_count: not used
|
||||
* @interval: not used
|
||||
@@ -448,7 +448,7 @@ enum iwl_mvm_session_prot_conf_id {
|
||||
* The firmware supports only one concurrent session protection per vif.
|
||||
* Adding a new session protection will remove any currently running session.
|
||||
*/
|
||||
struct iwl_mvm_session_prot_cmd {
|
||||
struct iwl_session_prot_cmd {
|
||||
/* COMMON_INDEX_HDR_API_S_VER_1 hdr */
|
||||
__le32 id_and_color;
|
||||
__le32 action;
|
||||
@@ -462,17 +462,17 @@ struct iwl_mvm_session_prot_cmd {
|
||||
*/
|
||||
|
||||
/**
|
||||
* struct iwl_mvm_session_prot_notif - session protection started / ended
|
||||
* struct iwl_session_prot_notif - session protection started / ended
|
||||
* @mac_link_id: the mac id (or link id, for notif ver > 2) for which the
|
||||
* session protection started / ended
|
||||
* @status: 1 means success, 0 means failure
|
||||
* @start: 1 means the session protection started, 0 means it ended
|
||||
* @conf_id: see &enum iwl_mvm_session_prot_conf_id
|
||||
* @conf_id: see &enum iwl_session_prot_conf_id
|
||||
*
|
||||
* Note that any session protection will always get two notifications: start
|
||||
* and end even the firmware could not schedule it.
|
||||
*/
|
||||
struct iwl_mvm_session_prot_notif {
|
||||
struct iwl_session_prot_notif {
|
||||
__le32 mac_link_id;
|
||||
__le32 status;
|
||||
__le32 start;
|
||||
|
||||
@@ -191,7 +191,7 @@ enum iwl_tx_offload_assist_flags_pos {
|
||||
* cleared. Combination of RATE_MCS_*
|
||||
* @sta_id: index of destination station in FW station table
|
||||
* @sec_ctl: security control, TX_CMD_SEC_*
|
||||
* @initial_rate_index: index into the the rate table for initial TX attempt.
|
||||
* @initial_rate_index: index into the rate table for initial TX attempt.
|
||||
* Applied if TX_CMD_FLG_STA_RATE_MSK is set, normally 0 for data frames.
|
||||
* @reserved2: reserved
|
||||
* @key: security key
|
||||
@@ -298,8 +298,7 @@ struct iwl_tx_cmd_gen3 {
|
||||
__le32 rate_n_flags;
|
||||
u8 reserved[8];
|
||||
struct ieee80211_hdr hdr[];
|
||||
} __packed; /* TX_CMD_API_S_VER_8,
|
||||
TX_CMD_API_S_VER_10 */
|
||||
} __packed; /* TX_CMD_API_S_VER_8, TX_CMD_API_S_VER_10 */
|
||||
|
||||
/*
|
||||
* TX response related data
|
||||
@@ -482,8 +481,8 @@ struct agg_tx_status {
|
||||
#define TX_RES_RATE_TABLE_COL_GET(_f) (((_f) & TX_RES_RATE_TABLE_COLOR_MSK) >>\
|
||||
TX_RES_RATE_TABLE_COLOR_POS)
|
||||
|
||||
#define IWL_MVM_TX_RES_GET_TID(_ra_tid) ((_ra_tid) & 0x0f)
|
||||
#define IWL_MVM_TX_RES_GET_RA(_ra_tid) ((_ra_tid) >> 4)
|
||||
#define IWL_TX_RES_GET_TID(_ra_tid) ((_ra_tid) & 0x0f)
|
||||
#define IWL_TX_RES_GET_RA(_ra_tid) ((_ra_tid) >> 4)
|
||||
|
||||
/**
|
||||
* struct iwl_tx_resp_v3 - notifies that fw is TXing a packet
|
||||
@@ -601,7 +600,8 @@ struct iwl_tx_resp {
|
||||
__le16 reserved2;
|
||||
struct agg_tx_status status;
|
||||
} __packed; /* TX_RSP_API_S_VER_6,
|
||||
TX_RSP_API_S_VER_7 */
|
||||
TX_RSP_API_S_VER_7,
|
||||
TX_RSP_API_S_VER_8 */
|
||||
|
||||
/**
|
||||
* struct iwl_mvm_ba_notif - notifies about reception of BA
|
||||
@@ -638,14 +638,14 @@ struct iwl_mvm_ba_notif {
|
||||
} __packed;
|
||||
|
||||
/**
|
||||
* struct iwl_mvm_compressed_ba_tfd - progress of a TFD queue
|
||||
* struct iwl_compressed_ba_tfd - progress of a TFD queue
|
||||
* @q_num: TFD queue number
|
||||
* @tfd_index: Index of first un-acked frame in the TFD queue
|
||||
* @scd_queue: For debug only - the physical queue the TFD queue is bound to
|
||||
* @tid: TID of the queue (0-7)
|
||||
* @reserved: reserved for alignment
|
||||
*/
|
||||
struct iwl_mvm_compressed_ba_tfd {
|
||||
struct iwl_compressed_ba_tfd {
|
||||
__le16 q_num;
|
||||
__le16 tfd_index;
|
||||
u8 scd_queue;
|
||||
@@ -654,12 +654,12 @@ struct iwl_mvm_compressed_ba_tfd {
|
||||
} __packed; /* COMPRESSED_BA_TFD_API_S_VER_1 */
|
||||
|
||||
/**
|
||||
* struct iwl_mvm_compressed_ba_ratid - progress of a RA TID queue
|
||||
* struct iwl_compressed_ba_ratid - progress of a RA TID queue
|
||||
* @q_num: RA TID queue number
|
||||
* @tid: TID of the queue
|
||||
* @ssn: BA window current SSN
|
||||
*/
|
||||
struct iwl_mvm_compressed_ba_ratid {
|
||||
struct iwl_compressed_ba_ratid {
|
||||
u8 q_num;
|
||||
u8 tid;
|
||||
__le16 ssn;
|
||||
@@ -685,7 +685,7 @@ enum iwl_mvm_ba_resp_flags {
|
||||
};
|
||||
|
||||
/**
|
||||
* struct iwl_mvm_compressed_ba_notif - notifies about reception of BA
|
||||
* struct iwl_compressed_ba_notif - notifies about reception of BA
|
||||
* ( BA_NOTIF = 0xc5 )
|
||||
* @flags: status flag, see the &iwl_mvm_ba_resp_flags
|
||||
* @sta_id: Index of recipient (BA-sending) station in fw's station table
|
||||
@@ -704,12 +704,12 @@ enum iwl_mvm_ba_resp_flags {
|
||||
* @tx_rate: the rate the aggregation was sent at
|
||||
* @tfd_cnt: number of TFD-Q elements
|
||||
* @ra_tid_cnt: number of RATID-Q elements
|
||||
* @tfd: array of TFD queue status updates. See &iwl_mvm_compressed_ba_tfd
|
||||
* @tfd: array of TFD queue status updates. See &iwl_compressed_ba_tfd
|
||||
* for details. Length in @tfd_cnt.
|
||||
* @ra_tid: array of RA-TID queue status updates. For debug purposes only. See
|
||||
* &iwl_mvm_compressed_ba_ratid for more details. Length in @ra_tid_cnt.
|
||||
* &iwl_compressed_ba_ratid for more details. Length in @ra_tid_cnt.
|
||||
*/
|
||||
struct iwl_mvm_compressed_ba_notif {
|
||||
struct iwl_compressed_ba_notif {
|
||||
__le32 flags;
|
||||
u8 sta_id;
|
||||
u8 reduced_txp;
|
||||
@@ -726,8 +726,8 @@ struct iwl_mvm_compressed_ba_notif {
|
||||
__le16 tfd_cnt;
|
||||
__le16 ra_tid_cnt;
|
||||
union {
|
||||
DECLARE_FLEX_ARRAY(struct iwl_mvm_compressed_ba_ratid, ra_tid);
|
||||
DECLARE_FLEX_ARRAY(struct iwl_mvm_compressed_ba_tfd, tfd);
|
||||
DECLARE_FLEX_ARRAY(struct iwl_compressed_ba_ratid, ra_tid);
|
||||
DECLARE_FLEX_ARRAY(struct iwl_compressed_ba_tfd, tfd);
|
||||
};
|
||||
} __packed; /* COMPRESSED_BA_RES_API_S_VER_4,
|
||||
COMPRESSED_BA_RES_API_S_VER_5 */
|
||||
|
||||
@@ -287,7 +287,7 @@ static inline void iwl_fw_umac_set_alive_err_table(struct iwl_trans *trans,
|
||||
trans->dbg.umac_error_event_table = umac_error_event_table;
|
||||
}
|
||||
|
||||
static inline void iwl_fw_error_collect(struct iwl_fw_runtime *fwrt, bool sync)
|
||||
static inline void iwl_fw_error_collect(struct iwl_fw_runtime *fwrt)
|
||||
{
|
||||
enum iwl_fw_ini_time_point tp_id;
|
||||
|
||||
@@ -303,7 +303,7 @@ static inline void iwl_fw_error_collect(struct iwl_fw_runtime *fwrt, bool sync)
|
||||
tp_id = IWL_FW_INI_TIME_POINT_FW_ASSERT;
|
||||
}
|
||||
|
||||
_iwl_dbg_tlv_time_point(fwrt, tp_id, NULL, sync);
|
||||
iwl_dbg_tlv_time_point_sync(fwrt, tp_id, NULL);
|
||||
}
|
||||
|
||||
static inline void iwl_fwrt_update_fw_versions(struct iwl_fw_runtime *fwrt,
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause
|
||||
/*
|
||||
* Copyright (C) 2012-2014, 2018-2023 Intel Corporation
|
||||
* Copyright (C) 2012-2014, 2018-2024 Intel Corporation
|
||||
* Copyright (C) 2013-2015 Intel Mobile Communications GmbH
|
||||
* Copyright (C) 2016-2017 Intel Deutschland GmbH
|
||||
*/
|
||||
@@ -123,6 +123,24 @@ static const struct file_operations iwl_dbgfs_##name##_ops = { \
|
||||
#define FWRT_DEBUGFS_ADD_FILE(name, parent, mode) \
|
||||
FWRT_DEBUGFS_ADD_FILE_ALIAS(#name, name, parent, mode)
|
||||
|
||||
static ssize_t iwl_dbgfs_fw_dbg_collect_write(struct iwl_fw_runtime *fwrt,
|
||||
char *buf, size_t count)
|
||||
{
|
||||
if (count == 0)
|
||||
return 0;
|
||||
|
||||
if (!iwl_trans_fw_running(fwrt->trans))
|
||||
return count;
|
||||
|
||||
iwl_dbg_tlv_time_point(fwrt, IWL_FW_INI_TIME_POINT_USER_TRIGGER, NULL);
|
||||
|
||||
iwl_fw_dbg_collect(fwrt, FW_DBG_TRIGGER_USER, buf, (count - 1), NULL);
|
||||
|
||||
return count;
|
||||
}
|
||||
|
||||
FWRT_DEBUGFS_WRITE_FILE_OPS(fw_dbg_collect, 16);
|
||||
|
||||
static int iwl_dbgfs_enabled_severities_write(struct iwl_fw_runtime *fwrt,
|
||||
char *buf, size_t count)
|
||||
{
|
||||
@@ -282,6 +300,26 @@ static ssize_t iwl_dbgfs_fw_dbg_domain_read(struct iwl_fw_runtime *fwrt,
|
||||
|
||||
FWRT_DEBUGFS_READ_FILE_OPS(fw_dbg_domain, 20);
|
||||
|
||||
static ssize_t iwl_dbgfs_fw_ver_read(struct iwl_fw_runtime *fwrt,
|
||||
size_t size, char *buf)
|
||||
{
|
||||
char *pos = buf;
|
||||
char *endpos = buf + size;
|
||||
|
||||
pos += scnprintf(pos, endpos - pos, "FW id: %s\n",
|
||||
fwrt->fw->fw_version);
|
||||
pos += scnprintf(pos, endpos - pos, "FW: %s\n",
|
||||
fwrt->fw->human_readable);
|
||||
pos += scnprintf(pos, endpos - pos, "Device: %s\n",
|
||||
fwrt->trans->name);
|
||||
pos += scnprintf(pos, endpos - pos, "Bus: %s\n",
|
||||
fwrt->dev->bus->name);
|
||||
|
||||
return pos - buf;
|
||||
}
|
||||
|
||||
FWRT_DEBUGFS_READ_FILE_OPS(fw_ver, 1024);
|
||||
|
||||
struct iwl_dbgfs_fw_info_priv {
|
||||
struct iwl_fw_runtime *fwrt;
|
||||
};
|
||||
@@ -403,5 +441,7 @@ void iwl_fwrt_dbgfs_register(struct iwl_fw_runtime *fwrt,
|
||||
FWRT_DEBUGFS_ADD_FILE(fw_info, dbgfs_dir, 0200);
|
||||
FWRT_DEBUGFS_ADD_FILE(send_hcmd, dbgfs_dir, 0200);
|
||||
FWRT_DEBUGFS_ADD_FILE(enabled_severities, dbgfs_dir, 0200);
|
||||
FWRT_DEBUGFS_ADD_FILE(fw_dbg_collect, dbgfs_dir, 0200);
|
||||
FWRT_DEBUGFS_ADD_FILE(fw_dbg_domain, dbgfs_dir, 0400);
|
||||
FWRT_DEBUGFS_ADD_FILE(fw_ver, dbgfs_dir, 0400);
|
||||
}
|
||||
|
||||
@@ -169,7 +169,7 @@ struct iwl_fw_error_dump_info {
|
||||
* @fw_mon_wr_ptr: the position of the write pointer in the cyclic buffer
|
||||
* @fw_mon_base_ptr: base pointer of the data
|
||||
* @fw_mon_cycle_cnt: number of wraparounds
|
||||
* @fw_mon_base_high_ptr: used in AX210 devices, the base adderss is 64 bit
|
||||
* @fw_mon_base_high_ptr: used in AX210 devices, the base address is 64 bit
|
||||
* so fw_mon_base_ptr holds LSB 32 bits and fw_mon_base_high_ptr hold
|
||||
* MSB 32 bits
|
||||
* @reserved: for future use
|
||||
|
||||
@@ -104,6 +104,7 @@ enum iwl_ucode_tlv_type {
|
||||
IWL_UCODE_TLV_CURRENT_PC = 68,
|
||||
|
||||
IWL_UCODE_TLV_FW_NUM_STATIONS = IWL_UCODE_TLV_CONST_BASE + 0,
|
||||
IWL_UCODE_TLV_FW_NUM_LINKS = IWL_UCODE_TLV_CONST_BASE + 1,
|
||||
IWL_UCODE_TLV_FW_NUM_BEACONS = IWL_UCODE_TLV_CONST_BASE + 2,
|
||||
|
||||
IWL_UCODE_TLV_TYPE_DEBUG_INFO = IWL_UCODE_TLV_DEBUG_BASE + 0,
|
||||
@@ -384,7 +385,8 @@ typedef unsigned int __bitwise iwl_ucode_tlv_capa_t;
|
||||
* to report the CSI information with (certain) RX frames
|
||||
* @IWL_UCODE_TLV_CAPA_FTM_CALIBRATED: has FTM calibrated and thus supports both
|
||||
* initiator and responder
|
||||
* @IWL_UCODE_TLV_CAPA_MLME_OFFLOAD: supports MLME offload
|
||||
* @IWL_UCODE_TLV_CAPA_BIOS_OVERRIDE_UNII4_US_CA: supports (de)activating UNII-4
|
||||
* for US/CA/WW from BIOS
|
||||
* @IWL_UCODE_TLV_CAPA_PROTECTED_TWT: Supports protection of TWT action frames
|
||||
* @IWL_UCODE_TLV_CAPA_FW_RESET_HANDSHAKE: Supports the firmware handshake in
|
||||
* reset flow
|
||||
@@ -397,6 +399,9 @@ typedef unsigned int __bitwise iwl_ucode_tlv_capa_t;
|
||||
* @IWL_UCODE_TLV_CAPA_SECURE_LTF_SUPPORT: Support secure LTF measurement.
|
||||
* @IWL_UCODE_TLV_CAPA_MONITOR_PASSIVE_CHANS: Support monitor mode on otherwise
|
||||
* passive channels
|
||||
* @IWL_UCODE_TLV_CAPA_BIOS_OVERRIDE_5G9_FOR_CA: supports (de)activating 5G9
|
||||
* for CA from BIOS.
|
||||
* @IWL_UCODE_TLV_CAPA_UHB_CANADA_TAS_SUPPORT: supports %TAS_UHB_ALLOWED_CANADA
|
||||
*
|
||||
* @NUM_IWL_UCODE_TLV_CAPA: number of bits used
|
||||
*/
|
||||
@@ -474,7 +479,7 @@ enum iwl_ucode_tlv_capa {
|
||||
IWL_UCODE_TLV_CAPA_DBG_BUF_ALLOC_CMD_SUPP = (__force iwl_ucode_tlv_capa_t)93,
|
||||
|
||||
/* set 3 */
|
||||
IWL_UCODE_TLV_CAPA_MLME_OFFLOAD = (__force iwl_ucode_tlv_capa_t)96,
|
||||
IWL_UCODE_TLV_CAPA_BIOS_OVERRIDE_UNII4_US_CA = (__force iwl_ucode_tlv_capa_t)96,
|
||||
|
||||
/*
|
||||
* @IWL_UCODE_TLV_CAPA_PSC_CHAN_SUPPORT: supports PSC channels
|
||||
@@ -497,6 +502,8 @@ enum iwl_ucode_tlv_capa {
|
||||
IWL_UCODE_TLV_CAPA_CHINA_22_REG_SUPPORT = (__force iwl_ucode_tlv_capa_t)117,
|
||||
IWL_UCODE_TLV_CAPA_SECURE_LTF_SUPPORT = (__force iwl_ucode_tlv_capa_t)121,
|
||||
IWL_UCODE_TLV_CAPA_MONITOR_PASSIVE_CHANS = (__force iwl_ucode_tlv_capa_t)122,
|
||||
IWL_UCODE_TLV_CAPA_BIOS_OVERRIDE_5G9_FOR_CA = (__force iwl_ucode_tlv_capa_t)123,
|
||||
IWL_UCODE_TLV_CAPA_UHB_CANADA_TAS_SUPPORT = (__force iwl_ucode_tlv_capa_t)124,
|
||||
NUM_IWL_UCODE_TLV_CAPA
|
||||
/*
|
||||
* This construction make both sparse (which cannot increment the previous
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
// SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause
|
||||
/*
|
||||
* Copyright(c) 2019 - 2021 Intel Corporation
|
||||
* Copyright(c) 2024 Intel Corporation
|
||||
*/
|
||||
#include <fw/api/commands.h>
|
||||
#include "img.h"
|
||||
@@ -75,6 +76,7 @@ static const struct {
|
||||
{ "NMI_INTERRUPT_ACTION_PT", 0x7C },
|
||||
{ "NMI_INTERRUPT_UNKNOWN", 0x84 },
|
||||
{ "NMI_INTERRUPT_INST_ACTION_PT", 0x86 },
|
||||
{ "NMI_INTERRUPT_PREG", 0x88 },
|
||||
{ "PNVM_MISSING", FW_SYSASSERT_PNVM_MISSING },
|
||||
{ "ADVANCED_SYSASSERT", 0 },
|
||||
};
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause */
|
||||
/*
|
||||
* Copyright (C) 2005-2014, 2018-2023 Intel Corporation
|
||||
* Copyright (C) 2005-2014, 2018-2024 Intel Corporation
|
||||
* Copyright (C) 2013-2015 Intel Mobile Communications GmbH
|
||||
* Copyright (C) 2016 Intel Deutschland GmbH
|
||||
*/
|
||||
@@ -51,6 +51,7 @@ struct iwl_ucode_capabilities {
|
||||
u32 error_log_addr;
|
||||
u32 error_log_size;
|
||||
u32 num_stations;
|
||||
u32 num_links;
|
||||
u32 num_beacons;
|
||||
unsigned long _api[BITS_TO_LONGS(NUM_IWL_UCODE_TLV_API)];
|
||||
unsigned long _capa[BITS_TO_LONGS(NUM_IWL_UCODE_TLV_CAPA)];
|
||||
|
||||
@@ -249,7 +249,7 @@ static int iwl_send_paging_cmd(struct iwl_fw_runtime *fwrt,
|
||||
};
|
||||
int blk_idx;
|
||||
|
||||
/* loop for for all paging blocks + CSS block */
|
||||
/* loop for all paging blocks + CSS block */
|
||||
for (blk_idx = 0; blk_idx < fwrt->num_of_paging_blk + 1; blk_idx++) {
|
||||
dma_addr_t addr = fwrt->fw_paging_db[blk_idx].fw_paging_phys;
|
||||
__le32 phy_addr;
|
||||
|
||||
@@ -39,6 +39,7 @@ IWL_BIOS_TABLE_LOADER_DATA(pwr_limit, u64);
|
||||
IWL_BIOS_TABLE_LOADER_DATA(mcc, char);
|
||||
IWL_BIOS_TABLE_LOADER_DATA(eckv, u32);
|
||||
IWL_BIOS_TABLE_LOADER_DATA(wbem, u32);
|
||||
IWL_BIOS_TABLE_LOADER_DATA(dsbr, u32);
|
||||
|
||||
|
||||
static const struct dmi_system_id dmi_ppag_approved_list[] = {
|
||||
@@ -100,6 +101,11 @@ static const struct dmi_system_id dmi_ppag_approved_list[] = {
|
||||
DMI_MATCH(DMI_SYS_VENDOR, "HONOR"),
|
||||
},
|
||||
},
|
||||
{ .ident = "WIKO",
|
||||
.matches = {
|
||||
DMI_MATCH(DMI_SYS_VENDOR, "WIKO"),
|
||||
},
|
||||
},
|
||||
{}
|
||||
};
|
||||
|
||||
@@ -424,25 +430,31 @@ bool iwl_is_tas_approved(void)
|
||||
}
|
||||
IWL_EXPORT_SYMBOL(iwl_is_tas_approved);
|
||||
|
||||
int iwl_parse_tas_selection(struct iwl_fw_runtime *fwrt,
|
||||
struct iwl_tas_data *tas_data,
|
||||
const u32 tas_selection)
|
||||
struct iwl_tas_selection_data
|
||||
iwl_parse_tas_selection(const u32 tas_selection_in, const u8 tbl_rev)
|
||||
{
|
||||
u8 override_iec = u32_get_bits(tas_selection,
|
||||
struct iwl_tas_selection_data tas_selection_out = {};
|
||||
u8 override_iec = u32_get_bits(tas_selection_in,
|
||||
IWL_WTAS_OVERRIDE_IEC_MSK);
|
||||
u8 enabled_iec = u32_get_bits(tas_selection, IWL_WTAS_ENABLE_IEC_MSK);
|
||||
u8 usa_tas_uhb = u32_get_bits(tas_selection, IWL_WTAS_USA_UHB_MSK);
|
||||
int enabled = tas_selection & IWL_WTAS_ENABLED_MSK;
|
||||
u8 canada_tas_uhb = u32_get_bits(tas_selection_in,
|
||||
IWL_WTAS_CANADA_UHB_MSK);
|
||||
u8 enabled_iec = u32_get_bits(tas_selection_in,
|
||||
IWL_WTAS_ENABLE_IEC_MSK);
|
||||
u8 usa_tas_uhb = u32_get_bits(tas_selection_in,
|
||||
IWL_WTAS_USA_UHB_MSK);
|
||||
|
||||
IWL_DEBUG_RADIO(fwrt, "TAS selection as read from BIOS: 0x%x\n",
|
||||
tas_selection);
|
||||
if (tbl_rev > 0) {
|
||||
tas_selection_out.usa_tas_uhb_allowed = usa_tas_uhb;
|
||||
tas_selection_out.override_tas_iec = override_iec;
|
||||
tas_selection_out.enable_tas_iec = enabled_iec;
|
||||
}
|
||||
|
||||
tas_data->usa_tas_uhb_allowed = usa_tas_uhb;
|
||||
tas_data->override_tas_iec = override_iec;
|
||||
tas_data->enable_tas_iec = enabled_iec;
|
||||
if (tbl_rev > 1)
|
||||
tas_selection_out.canada_tas_uhb_allowed = canada_tas_uhb;
|
||||
|
||||
return enabled;
|
||||
return tas_selection_out;
|
||||
}
|
||||
IWL_EXPORT_SYMBOL(iwl_parse_tas_selection);
|
||||
|
||||
static __le32 iwl_get_lari_config_bitmap(struct iwl_fw_runtime *fwrt)
|
||||
{
|
||||
@@ -552,10 +564,16 @@ int iwl_fill_lari_config(struct iwl_fw_runtime *fwrt,
|
||||
|
||||
ret = iwl_bios_get_dsm(fwrt, DSM_FUNC_ENABLE_UNII4_CHAN, &value);
|
||||
if (!ret) {
|
||||
if (cmd_ver < 9)
|
||||
value &= DSM_UNII4_ALLOW_BITMAP_CMD_V8;
|
||||
else
|
||||
value &= DSM_UNII4_ALLOW_BITMAP;
|
||||
value &= DSM_UNII4_ALLOW_BITMAP;
|
||||
|
||||
/* Since version 9, bits 4 and 5 are supported
|
||||
* regardless of this capability.
|
||||
*/
|
||||
if (cmd_ver < 9 &&
|
||||
!fw_has_capa(&fwrt->fw->ucode_capa,
|
||||
IWL_UCODE_TLV_CAPA_BIOS_OVERRIDE_5G9_FOR_CA))
|
||||
value &= ~(DSM_VALUE_UNII4_CANADA_OVERRIDE_MSK |
|
||||
DSM_VALUE_UNII4_CANADA_EN_MSK);
|
||||
|
||||
cmd->oem_unii4_allow_bitmap = cpu_to_le32(value);
|
||||
}
|
||||
@@ -564,7 +582,13 @@ int iwl_fill_lari_config(struct iwl_fw_runtime *fwrt,
|
||||
if (!ret) {
|
||||
if (cmd_ver < 8)
|
||||
value &= ~ACTIVATE_5G2_IN_WW_MASK;
|
||||
if (cmd_ver < 12)
|
||||
|
||||
/* Since version 12, bits 5 and 6 are supported
|
||||
* regardless of this capability.
|
||||
*/
|
||||
if (cmd_ver < 12 &&
|
||||
!fw_has_capa(&fwrt->fw->ucode_capa,
|
||||
IWL_UCODE_TLV_CAPA_BIOS_OVERRIDE_UNII4_US_CA))
|
||||
value &= CHAN_STATE_ACTIVE_BITMAP_CMD_V11;
|
||||
|
||||
cmd->chan_state_active_bitmap = cpu_to_le32(value);
|
||||
|
||||
@@ -40,11 +40,19 @@
|
||||
#define IWL_PPAG_ETSI_CHINA_MASK 3
|
||||
#define IWL_PPAG_REV3_MASK 0x7FF
|
||||
|
||||
#define IWL_WTAS_ENABLED_MSK 0x1
|
||||
#define IWL_WTAS_OVERRIDE_IEC_MSK 0x2
|
||||
#define IWL_WTAS_ENABLE_IEC_MSK 0x4
|
||||
#define IWL_WTAS_ENABLED_MSK BIT(0)
|
||||
#define IWL_WTAS_OVERRIDE_IEC_MSK BIT(1)
|
||||
#define IWL_WTAS_ENABLE_IEC_MSK BIT(2)
|
||||
#define IWL_WTAS_CANADA_UHB_MSK BIT(15)
|
||||
#define IWL_WTAS_USA_UHB_MSK BIT(16)
|
||||
|
||||
struct iwl_tas_selection_data {
|
||||
u8 override_tas_iec:1,
|
||||
enable_tas_iec:1,
|
||||
usa_tas_uhb_allowed:1,
|
||||
canada_tas_uhb_allowed:1;
|
||||
};
|
||||
|
||||
#define BIOS_MCC_CHINA 0x434e
|
||||
|
||||
/*
|
||||
@@ -97,11 +105,11 @@ struct iwl_ppag_chain {
|
||||
};
|
||||
|
||||
struct iwl_tas_data {
|
||||
__le32 block_list_size;
|
||||
__le32 block_list_array[IWL_WTAS_BLACK_LIST_MAX];
|
||||
u8 override_tas_iec;
|
||||
u8 enable_tas_iec;
|
||||
u8 usa_tas_uhb_allowed;
|
||||
u8 block_list_size;
|
||||
u16 block_list_array[IWL_WTAS_BLACK_LIST_MAX];
|
||||
u8 table_source;
|
||||
u8 table_revision;
|
||||
u32 tas_selection;
|
||||
};
|
||||
|
||||
/* For DSM revision 0 and 4 */
|
||||
@@ -144,12 +152,11 @@ enum iwl_dsm_unii4_bitmap {
|
||||
DSM_VALUE_UNII4_CANADA_EN_MSK = BIT(5),
|
||||
};
|
||||
|
||||
#define DSM_UNII4_ALLOW_BITMAP_CMD_V8 (DSM_VALUE_UNII4_US_OVERRIDE_MSK | \
|
||||
DSM_VALUE_UNII4_US_EN_MSK | \
|
||||
DSM_VALUE_UNII4_ETSI_OVERRIDE_MSK | \
|
||||
DSM_VALUE_UNII4_ETSI_EN_MSK)
|
||||
#define DSM_UNII4_ALLOW_BITMAP (DSM_UNII4_ALLOW_BITMAP_CMD_V8 | \
|
||||
DSM_VALUE_UNII4_CANADA_OVERRIDE_MSK | \
|
||||
#define DSM_UNII4_ALLOW_BITMAP (DSM_VALUE_UNII4_US_OVERRIDE_MSK |\
|
||||
DSM_VALUE_UNII4_US_EN_MSK |\
|
||||
DSM_VALUE_UNII4_ETSI_OVERRIDE_MSK |\
|
||||
DSM_VALUE_UNII4_ETSI_EN_MSK |\
|
||||
DSM_VALUE_UNII4_CANADA_OVERRIDE_MSK |\
|
||||
DSM_VALUE_UNII4_CANADA_EN_MSK)
|
||||
|
||||
enum iwl_dsm_values_rfi {
|
||||
@@ -184,9 +191,8 @@ bool iwl_is_ppag_approved(struct iwl_fw_runtime *fwrt);
|
||||
|
||||
bool iwl_is_tas_approved(void);
|
||||
|
||||
int iwl_parse_tas_selection(struct iwl_fw_runtime *fwrt,
|
||||
struct iwl_tas_data *tas_data,
|
||||
const u32 tas_selection);
|
||||
struct iwl_tas_selection_data
|
||||
iwl_parse_tas_selection(const u32 tas_selection, const u8 tbl_rev);
|
||||
|
||||
int iwl_bios_get_wrds_table(struct iwl_fw_runtime *fwrt);
|
||||
|
||||
@@ -221,4 +227,27 @@ static inline u32 iwl_bios_get_ppag_flags(const u32 ppag_modes,
|
||||
}
|
||||
|
||||
bool iwl_puncturing_is_allowed_in_bios(u32 puncturing, u16 mcc);
|
||||
|
||||
#define IWL_DSBR_FW_MODIFIED_URM_MASK BIT(8)
|
||||
#define IWL_DSBR_PERMANENT_URM_MASK BIT(9)
|
||||
|
||||
int iwl_bios_get_dsbr(struct iwl_fw_runtime *fwrt, u32 *value);
|
||||
|
||||
static inline void iwl_bios_setup_step(struct iwl_trans *trans,
|
||||
struct iwl_fw_runtime *fwrt)
|
||||
{
|
||||
u32 dsbr;
|
||||
|
||||
if (!trans->trans_cfg->integrated)
|
||||
return;
|
||||
|
||||
if (trans->trans_cfg->device_family < IWL_DEVICE_FAMILY_BZ)
|
||||
return;
|
||||
|
||||
if (iwl_bios_get_dsbr(fwrt, &dsbr))
|
||||
dsbr = 0;
|
||||
|
||||
trans->dsbr_urm_fw_dependent = !!(dsbr & IWL_DSBR_FW_MODIFIED_URM_MASK);
|
||||
trans->dsbr_urm_permanent = !!(dsbr & IWL_DSBR_PERMANENT_URM_MASK);
|
||||
}
|
||||
#endif /* __fw_regulatory_h__ */
|
||||
|
||||
@@ -13,9 +13,12 @@
|
||||
#include <linux/efi.h>
|
||||
#include "fw/runtime.h"
|
||||
|
||||
#define IWL_EFI_VAR_GUID EFI_GUID(0x92daaf2f, 0xc02b, 0x455b, \
|
||||
0xb2, 0xec, 0xf5, 0xa3, \
|
||||
0x59, 0x4f, 0x4a, 0xea)
|
||||
#define IWL_EFI_WIFI_GUID EFI_GUID(0x92daaf2f, 0xc02b, 0x455b, \
|
||||
0xb2, 0xec, 0xf5, 0xa3, \
|
||||
0x59, 0x4f, 0x4a, 0xea)
|
||||
#define IWL_EFI_WIFI_BT_GUID EFI_GUID(0xe65d8884, 0xd4af, 0x4b20, \
|
||||
0x8d, 0x03, 0x77, 0x2e, \
|
||||
0xcc, 0x3d, 0xa5, 0x31)
|
||||
|
||||
struct iwl_uefi_pnvm_mem_desc {
|
||||
__le32 addr;
|
||||
@@ -61,7 +64,7 @@ void *iwl_uefi_get_pnvm(struct iwl_trans *trans, size_t *len)
|
||||
|
||||
*len = 0;
|
||||
|
||||
data = iwl_uefi_get_variable(IWL_UEFI_OEM_PNVM_NAME, &IWL_EFI_VAR_GUID,
|
||||
data = iwl_uefi_get_variable(IWL_UEFI_OEM_PNVM_NAME, &IWL_EFI_WIFI_GUID,
|
||||
&package_size);
|
||||
if (IS_ERR(data)) {
|
||||
IWL_DEBUG_FW(trans,
|
||||
@@ -76,18 +79,18 @@ void *iwl_uefi_get_pnvm(struct iwl_trans *trans, size_t *len)
|
||||
return data;
|
||||
}
|
||||
|
||||
static
|
||||
void *iwl_uefi_get_verified_variable(struct iwl_trans *trans,
|
||||
efi_char16_t *uefi_var_name,
|
||||
char *var_name,
|
||||
unsigned int expected_size,
|
||||
unsigned long *size)
|
||||
static void *
|
||||
iwl_uefi_get_verified_variable_guid(struct iwl_trans *trans,
|
||||
efi_guid_t *guid,
|
||||
efi_char16_t *uefi_var_name,
|
||||
char *var_name,
|
||||
unsigned int expected_size,
|
||||
unsigned long *size)
|
||||
{
|
||||
void *var;
|
||||
unsigned long var_size;
|
||||
|
||||
var = iwl_uefi_get_variable(uefi_var_name, &IWL_EFI_VAR_GUID,
|
||||
&var_size);
|
||||
var = iwl_uefi_get_variable(uefi_var_name, guid, &var_size);
|
||||
|
||||
if (IS_ERR(var)) {
|
||||
IWL_DEBUG_RADIO(trans,
|
||||
@@ -112,6 +115,18 @@ void *iwl_uefi_get_verified_variable(struct iwl_trans *trans,
|
||||
return var;
|
||||
}
|
||||
|
||||
static void *
|
||||
iwl_uefi_get_verified_variable(struct iwl_trans *trans,
|
||||
efi_char16_t *uefi_var_name,
|
||||
char *var_name,
|
||||
unsigned int expected_size,
|
||||
unsigned long *size)
|
||||
{
|
||||
return iwl_uefi_get_verified_variable_guid(trans, &IWL_EFI_WIFI_GUID,
|
||||
uefi_var_name, var_name,
|
||||
expected_size, size);
|
||||
}
|
||||
|
||||
int iwl_uefi_handle_tlv_mem_desc(struct iwl_trans *trans, const u8 *data,
|
||||
u32 tlv_len, struct iwl_pnvm_image *pnvm_data)
|
||||
{
|
||||
@@ -311,8 +326,9 @@ void iwl_uefi_get_step_table(struct iwl_trans *trans)
|
||||
if (trans->trans_cfg->device_family < IWL_DEVICE_FAMILY_AX210)
|
||||
return;
|
||||
|
||||
data = iwl_uefi_get_verified_variable(trans, IWL_UEFI_STEP_NAME,
|
||||
"STEP", sizeof(*data), NULL);
|
||||
data = iwl_uefi_get_verified_variable_guid(trans, &IWL_EFI_WIFI_BT_GUID,
|
||||
IWL_UEFI_STEP_NAME,
|
||||
"STEP", sizeof(*data), NULL);
|
||||
if (IS_ERR(data))
|
||||
return;
|
||||
|
||||
@@ -554,27 +570,31 @@ int iwl_uefi_get_tas_table(struct iwl_fw_runtime *fwrt,
|
||||
struct iwl_tas_data *tas_data)
|
||||
{
|
||||
struct uefi_cnv_var_wtas *uefi_tas;
|
||||
int ret = 0, enabled, i;
|
||||
int ret, enabled;
|
||||
|
||||
uefi_tas = iwl_uefi_get_verified_variable(fwrt->trans, IWL_UEFI_WTAS_NAME,
|
||||
"WTAS", sizeof(*uefi_tas), NULL);
|
||||
if (IS_ERR(uefi_tas))
|
||||
return -EINVAL;
|
||||
|
||||
if (uefi_tas->revision != IWL_UEFI_WTAS_REVISION) {
|
||||
if (uefi_tas->revision < IWL_UEFI_MIN_WTAS_REVISION ||
|
||||
uefi_tas->revision > IWL_UEFI_MAX_WTAS_REVISION) {
|
||||
ret = -EINVAL;
|
||||
IWL_DEBUG_RADIO(fwrt, "Unsupported UEFI WTAS revision:%d\n",
|
||||
uefi_tas->revision);
|
||||
goto out;
|
||||
}
|
||||
|
||||
enabled = iwl_parse_tas_selection(fwrt, tas_data,
|
||||
uefi_tas->tas_selection);
|
||||
if (!enabled) {
|
||||
IWL_DEBUG_RADIO(fwrt, "TAS not enabled\n");
|
||||
ret = 0;
|
||||
goto out;
|
||||
}
|
||||
IWL_DEBUG_RADIO(fwrt, "TAS selection as read from BIOS: 0x%x\n",
|
||||
uefi_tas->tas_selection);
|
||||
|
||||
enabled = uefi_tas->tas_selection & IWL_WTAS_ENABLED_MSK;
|
||||
tas_data->table_source = BIOS_SOURCE_UEFI;
|
||||
tas_data->table_revision = uefi_tas->revision;
|
||||
tas_data->tas_selection = uefi_tas->tas_selection;
|
||||
|
||||
IWL_DEBUG_RADIO(fwrt, "TAS %s enabled\n",
|
||||
enabled ? "is" : "not");
|
||||
|
||||
IWL_DEBUG_RADIO(fwrt, "Reading TAS table revision %d\n",
|
||||
uefi_tas->revision);
|
||||
@@ -584,15 +604,16 @@ int iwl_uefi_get_tas_table(struct iwl_fw_runtime *fwrt,
|
||||
ret = -EINVAL;
|
||||
goto out;
|
||||
}
|
||||
tas_data->block_list_size = cpu_to_le32(uefi_tas->black_list_size);
|
||||
|
||||
tas_data->block_list_size = uefi_tas->black_list_size;
|
||||
IWL_DEBUG_RADIO(fwrt, "TAS array size %u\n", uefi_tas->black_list_size);
|
||||
|
||||
for (i = 0; i < uefi_tas->black_list_size; i++) {
|
||||
tas_data->block_list_array[i] =
|
||||
cpu_to_le32(uefi_tas->black_list[i]);
|
||||
for (u8 i = 0; i < uefi_tas->black_list_size; i++) {
|
||||
tas_data->block_list_array[i] = uefi_tas->black_list[i];
|
||||
IWL_DEBUG_RADIO(fwrt, "TAS block list country %d\n",
|
||||
uefi_tas->black_list[i]);
|
||||
}
|
||||
ret = enabled;
|
||||
out:
|
||||
kfree(uefi_tas);
|
||||
return ret;
|
||||
@@ -758,3 +779,29 @@ int iwl_uefi_get_puncturing(struct iwl_fw_runtime *fwrt)
|
||||
return puncturing;
|
||||
}
|
||||
IWL_EXPORT_SYMBOL(iwl_uefi_get_puncturing);
|
||||
|
||||
int iwl_uefi_get_dsbr(struct iwl_fw_runtime *fwrt, u32 *value)
|
||||
{
|
||||
struct uefi_cnv_wlan_dsbr_data *data;
|
||||
int ret = 0;
|
||||
|
||||
data = iwl_uefi_get_verified_variable_guid(fwrt->trans,
|
||||
&IWL_EFI_WIFI_BT_GUID,
|
||||
IWL_UEFI_DSBR_NAME, "DSBR",
|
||||
sizeof(*data), NULL);
|
||||
if (IS_ERR(data))
|
||||
return -EINVAL;
|
||||
|
||||
if (data->revision != IWL_UEFI_DSBR_REVISION) {
|
||||
ret = -EINVAL;
|
||||
IWL_DEBUG_RADIO(fwrt, "Unsupported UEFI DSBR revision:%d\n",
|
||||
data->revision);
|
||||
goto out;
|
||||
}
|
||||
*value = data->config;
|
||||
IWL_DEBUG_RADIO(fwrt, "Loaded DSBR config from UEFI value: 0x%x\n",
|
||||
*value);
|
||||
out:
|
||||
kfree(data);
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -23,6 +23,7 @@
|
||||
#define IWL_UEFI_DSM_NAME L"UefiCnvWlanGeneralCfg"
|
||||
#define IWL_UEFI_WBEM_NAME L"UefiCnvWlanWBEM"
|
||||
#define IWL_UEFI_PUNCTURING_NAME L"UefiCnvWlanPuncturing"
|
||||
#define IWL_UEFI_DSBR_NAME L"UefiCnvCommonDSBR"
|
||||
|
||||
|
||||
#define IWL_SGOM_MAP_SIZE 339
|
||||
@@ -33,13 +34,15 @@
|
||||
#define IWL_UEFI_WGDS_REVISION 3
|
||||
#define IWL_UEFI_MIN_PPAG_REV 1
|
||||
#define IWL_UEFI_MAX_PPAG_REV 3
|
||||
#define IWL_UEFI_WTAS_REVISION 1
|
||||
#define IWL_UEFI_MIN_WTAS_REVISION 1
|
||||
#define IWL_UEFI_MAX_WTAS_REVISION 2
|
||||
#define IWL_UEFI_SPLC_REVISION 0
|
||||
#define IWL_UEFI_WRDD_REVISION 0
|
||||
#define IWL_UEFI_ECKV_REVISION 0
|
||||
#define IWL_UEFI_WBEM_REVISION 0
|
||||
#define IWL_UEFI_DSM_REVISION 4
|
||||
#define IWL_UEFI_PUNCTURING_REVISION 0
|
||||
#define IWL_UEFI_DSBR_REVISION 1
|
||||
|
||||
struct pnvm_sku_package {
|
||||
u8 rev;
|
||||
@@ -213,6 +216,20 @@ struct uefi_cnv_var_puncturing_data {
|
||||
u32 puncturing;
|
||||
} __packed;
|
||||
|
||||
/**
|
||||
* struct uefi_cnv_wlan_dsbr_data - BIOS STEP configuration information
|
||||
* @revision: the revision of the table
|
||||
* @config: STEP configuration flags:
|
||||
* bit 8, switch to URM depending on FW setting
|
||||
* bit 9, switch to URM
|
||||
*
|
||||
* Platform information for STEP configuration/workarounds.
|
||||
*/
|
||||
struct uefi_cnv_wlan_dsbr_data {
|
||||
u8 revision;
|
||||
u32 config;
|
||||
} __packed;
|
||||
|
||||
/*
|
||||
* This is known to be broken on v4.19 and to work on v5.4. Until we
|
||||
* figure out why this is the case and how to make it work, simply
|
||||
@@ -244,6 +261,7 @@ void iwl_uefi_get_sgom_table(struct iwl_trans *trans, struct iwl_fw_runtime *fwr
|
||||
int iwl_uefi_get_uats_table(struct iwl_trans *trans,
|
||||
struct iwl_fw_runtime *fwrt);
|
||||
int iwl_uefi_get_puncturing(struct iwl_fw_runtime *fwrt);
|
||||
int iwl_uefi_get_dsbr(struct iwl_fw_runtime *fwrt, u32 *value);
|
||||
#else /* CONFIG_EFI */
|
||||
static inline void *iwl_uefi_get_pnvm(struct iwl_trans *trans, size_t *len)
|
||||
{
|
||||
@@ -346,5 +364,11 @@ int iwl_uefi_get_puncturing(struct iwl_fw_runtime *fwrt)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline
|
||||
int iwl_uefi_get_dsbr(struct iwl_fw_runtime *fwrt, u32 *value)
|
||||
{
|
||||
return -ENOENT;
|
||||
}
|
||||
#endif /* CONFIG_EFI */
|
||||
#endif /* __iwl_fw_uefi__ */
|
||||
|
||||
@@ -38,6 +38,7 @@ enum iwl_device_family {
|
||||
IWL_DEVICE_FAMILY_AX210,
|
||||
IWL_DEVICE_FAMILY_BZ,
|
||||
IWL_DEVICE_FAMILY_SC,
|
||||
IWL_DEVICE_FAMILY_DR,
|
||||
};
|
||||
|
||||
/*
|
||||
@@ -102,6 +103,10 @@ enum iwl_nvm_type {
|
||||
#define ANT_ABC (ANT_A | ANT_B | ANT_C)
|
||||
|
||||
|
||||
#define IWL_FW_AND_PNVM(pfx, api) \
|
||||
MODULE_FIRMWARE(pfx "-" __stringify(api) ".ucode"); \
|
||||
MODULE_FIRMWARE(pfx ".pnvm")
|
||||
|
||||
static inline u8 num_of_ant(u8 mask)
|
||||
{
|
||||
return !!((mask) & ANT_A) +
|
||||
@@ -424,6 +429,8 @@ struct iwl_cfg {
|
||||
#define IWL_CFG_MAC_TYPE_SC2 0x49
|
||||
#define IWL_CFG_MAC_TYPE_SC2F 0x4A
|
||||
#define IWL_CFG_MAC_TYPE_BZ_W 0x4B
|
||||
#define IWL_CFG_MAC_TYPE_BR 0x4C
|
||||
#define IWL_CFG_MAC_TYPE_DR 0x4D
|
||||
|
||||
#define IWL_CFG_RF_TYPE_TH 0x105
|
||||
#define IWL_CFG_RF_TYPE_TH1 0x108
|
||||
@@ -434,6 +441,7 @@ struct iwl_cfg {
|
||||
#define IWL_CFG_RF_TYPE_GF 0x10D
|
||||
#define IWL_CFG_RF_TYPE_FM 0x112
|
||||
#define IWL_CFG_RF_TYPE_WH 0x113
|
||||
#define IWL_CFG_RF_TYPE_PE 0x114
|
||||
|
||||
#define IWL_CFG_RF_ID_TH 0x1
|
||||
#define IWL_CFG_RF_ID_TH1 0x1
|
||||
@@ -506,6 +514,8 @@ extern const struct iwl_cfg_trans_params iwl_ma_trans_cfg;
|
||||
extern const struct iwl_cfg_trans_params iwl_bz_trans_cfg;
|
||||
extern const struct iwl_cfg_trans_params iwl_gl_trans_cfg;
|
||||
extern const struct iwl_cfg_trans_params iwl_sc_trans_cfg;
|
||||
extern const struct iwl_cfg_trans_params iwl_dr_trans_cfg;
|
||||
extern const struct iwl_cfg_trans_params iwl_br_trans_cfg;
|
||||
extern const char iwl9162_name[];
|
||||
extern const char iwl9260_name[];
|
||||
extern const char iwl9260_1_name[];
|
||||
@@ -551,6 +561,8 @@ extern const char iwl_mtp_name[];
|
||||
extern const char iwl_sc_name[];
|
||||
extern const char iwl_sc2_name[];
|
||||
extern const char iwl_sc2f_name[];
|
||||
extern const char iwl_dr_name[];
|
||||
extern const char iwl_br_name[];
|
||||
#if IS_ENABLED(CONFIG_IWLDVM)
|
||||
extern const struct iwl_cfg iwl5300_agn_cfg;
|
||||
extern const struct iwl_cfg iwl5100_agn_cfg;
|
||||
@@ -649,7 +661,6 @@ extern const struct iwl_cfg iwlax411_2ax_cfg_so_gf4_a0_long;
|
||||
extern const struct iwl_cfg iwl_cfg_ma;
|
||||
|
||||
extern const struct iwl_cfg iwl_cfg_so_a0_hr_a0;
|
||||
extern const struct iwl_cfg iwl_cfg_so_a0_ms_a0;
|
||||
extern const struct iwl_cfg iwl_cfg_quz_a0_hr_b0;
|
||||
|
||||
extern const struct iwl_cfg iwl_cfg_bz;
|
||||
@@ -658,6 +669,8 @@ extern const struct iwl_cfg iwl_cfg_gl;
|
||||
extern const struct iwl_cfg iwl_cfg_sc;
|
||||
extern const struct iwl_cfg iwl_cfg_sc2;
|
||||
extern const struct iwl_cfg iwl_cfg_sc2f;
|
||||
extern const struct iwl_cfg iwl_cfg_dr;
|
||||
extern const struct iwl_cfg iwl_cfg_br;
|
||||
#endif /* CONFIG_IWLMVM */
|
||||
|
||||
#endif /* __IWL_CONFIG_H__ */
|
||||
|
||||
@@ -76,7 +76,17 @@ enum iwl_prph_scratch_flags {
|
||||
IWL_PRPH_SCRATCH_SCU_FORCE_ACTIVE = BIT(29),
|
||||
};
|
||||
|
||||
/*
|
||||
/**
|
||||
* enum iwl_prph_scratch_ext_flags - PRPH scratch control ext flags
|
||||
* @IWL_PRPH_SCRATCH_EXT_URM_FW: switch to URM mode based on fw setting
|
||||
* @IWL_PRPH_SCRATCH_EXT_URM_PERM: switch to permanent URM mode
|
||||
*/
|
||||
enum iwl_prph_scratch_ext_flags {
|
||||
IWL_PRPH_SCRATCH_EXT_URM_FW = BIT(4),
|
||||
IWL_PRPH_SCRATCH_EXT_URM_PERM = BIT(5),
|
||||
};
|
||||
|
||||
/**
|
||||
* struct iwl_prph_scratch_version - version structure
|
||||
* @mac_id: SKU and revision id
|
||||
* @version: prph scratch information version id
|
||||
@@ -90,17 +100,18 @@ struct iwl_prph_scratch_version {
|
||||
__le16 reserved;
|
||||
} __packed; /* PERIPH_SCRATCH_VERSION_S */
|
||||
|
||||
/*
|
||||
/**
|
||||
* struct iwl_prph_scratch_control - control structure
|
||||
* @control_flags: context information flags see &enum iwl_prph_scratch_flags
|
||||
* @reserved: reserved
|
||||
* @control_flags_ext: context information for extended flags,
|
||||
* see &enum iwl_prph_scratch_ext_flags
|
||||
*/
|
||||
struct iwl_prph_scratch_control {
|
||||
__le32 control_flags;
|
||||
__le32 reserved;
|
||||
__le32 control_flags_ext;
|
||||
} __packed; /* PERIPH_SCRATCH_CONTROL_S */
|
||||
|
||||
/*
|
||||
/**
|
||||
* struct iwl_prph_scratch_pnvm_cfg - PNVM scratch
|
||||
* @pnvm_base_addr: PNVM start address
|
||||
* @pnvm_size: the size of the PNVM image in bytes
|
||||
@@ -120,7 +131,8 @@ struct iwl_prph_scratch_pnvm_cfg {
|
||||
struct iwl_prph_scrath_mem_desc_addr_array {
|
||||
__le64 mem_descs[IPC_DRAM_MAP_ENTRY_NUM_MAX];
|
||||
} __packed; /* PERIPH_SCRATCH_MEM_DESC_ADDR_ARRAY_S_VER_1 */
|
||||
/*
|
||||
|
||||
/**
|
||||
* struct iwl_prph_scratch_hwm_cfg - hwm config
|
||||
* @hwm_base_addr: hwm start address
|
||||
* @hwm_size: hwm size in DWs
|
||||
@@ -132,7 +144,7 @@ struct iwl_prph_scratch_hwm_cfg {
|
||||
__le32 debug_token_config;
|
||||
} __packed; /* PERIPH_SCRATCH_HWM_CFG_S */
|
||||
|
||||
/*
|
||||
/**
|
||||
* struct iwl_prph_scratch_rbd_cfg - RBDs configuration
|
||||
* @free_rbd_addr: default queue free RB CB base address
|
||||
* @reserved: reserved
|
||||
@@ -142,10 +154,11 @@ struct iwl_prph_scratch_rbd_cfg {
|
||||
__le32 reserved;
|
||||
} __packed; /* PERIPH_SCRATCH_RBD_CFG_S */
|
||||
|
||||
/*
|
||||
/**
|
||||
* struct iwl_prph_scratch_uefi_cfg - prph scratch reduce power table
|
||||
* @base_addr: reduce power table address
|
||||
* @size: the size of the entire power table image
|
||||
* @reserved: (reserved)
|
||||
*/
|
||||
struct iwl_prph_scratch_uefi_cfg {
|
||||
__le64 base_addr;
|
||||
@@ -153,7 +166,7 @@ struct iwl_prph_scratch_uefi_cfg {
|
||||
__le32 reserved;
|
||||
} __packed; /* PERIPH_SCRATCH_UEFI_CFG_S */
|
||||
|
||||
/*
|
||||
/**
|
||||
* struct iwl_prph_scratch_step_cfg - prph scratch step configuration
|
||||
* @mbx_addr_0: [0:7] revision,
|
||||
* [8:15] cnvi_to_cnvr length,
|
||||
@@ -167,13 +180,14 @@ struct iwl_prph_scratch_step_cfg {
|
||||
__le32 mbx_addr_1;
|
||||
} __packed;
|
||||
|
||||
/*
|
||||
/**
|
||||
* struct iwl_prph_scratch_ctrl_cfg - prph scratch ctrl and config
|
||||
* @version: version information of context info and HW
|
||||
* @control: control flags of FH configurations
|
||||
* @pnvm_cfg: ror configuration
|
||||
* @hwm_cfg: hwm configuration
|
||||
* @rbd_cfg: default RX queue configuration
|
||||
* @reduce_power_cfg: UEFI power reduction table
|
||||
* @step_cfg: step configuration
|
||||
*/
|
||||
struct iwl_prph_scratch_ctrl_cfg {
|
||||
@@ -186,7 +200,7 @@ struct iwl_prph_scratch_ctrl_cfg {
|
||||
struct iwl_prph_scratch_step_cfg step_cfg;
|
||||
} __packed; /* PERIPH_SCRATCH_CTRL_CFG_S */
|
||||
|
||||
/*
|
||||
/**
|
||||
* struct iwl_prph_scratch - peripheral scratch mapping
|
||||
* @ctrl_cfg: control and configuration of prph scratch
|
||||
* @dram: firmware images addresses in DRAM
|
||||
@@ -202,7 +216,7 @@ struct iwl_prph_scratch {
|
||||
struct iwl_context_info_dram dram;
|
||||
} __packed; /* PERIPH_SCRATCH_S */
|
||||
|
||||
/*
|
||||
/**
|
||||
* struct iwl_prph_info - peripheral information
|
||||
* @boot_stage_mirror: reflects the value in the Boot Stage CSR register
|
||||
* @ipc_status_mirror: reflects the value in the IPC Status CSR register
|
||||
@@ -216,7 +230,7 @@ struct iwl_prph_info {
|
||||
__le32 reserved;
|
||||
} __packed; /* PERIPH_INFO_S */
|
||||
|
||||
/*
|
||||
/**
|
||||
* struct iwl_context_info_gen3 - device INIT configuration
|
||||
* @version: version of the context information
|
||||
* @size: size of context information in DWs
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause */
|
||||
/*
|
||||
* Copyright (C) 2017 Intel Deutschland GmbH
|
||||
* Copyright (C) 2018-2020, 2022 Intel Corporation
|
||||
* Copyright (C) 2018-2020, 2022, 2024 Intel Corporation
|
||||
*/
|
||||
#ifndef __iwl_context_info_file_h__
|
||||
#define __iwl_context_info_file_h__
|
||||
|
||||
/* maximmum number of DRAM map entries supported by FW */
|
||||
/* maximum number of DRAM map entries supported by FW */
|
||||
#define IWL_MAX_DRAM_ENTRY 64
|
||||
#define CSR_CTXT_INFO_BA 0x40
|
||||
|
||||
@@ -53,11 +53,12 @@ enum iwl_context_info_flags {
|
||||
IWL_CTXT_INFO_RB_SIZE_32K = 0xe,
|
||||
};
|
||||
|
||||
/*
|
||||
/**
|
||||
* struct iwl_context_info_version - version structure
|
||||
* @mac_id: SKU and revision id
|
||||
* @version: context information version id
|
||||
* @size: the size of the context information in DWs
|
||||
* @reserved: (reserved)
|
||||
*/
|
||||
struct iwl_context_info_version {
|
||||
__le16 mac_id;
|
||||
@@ -66,16 +67,17 @@ struct iwl_context_info_version {
|
||||
__le16 reserved;
|
||||
} __packed;
|
||||
|
||||
/*
|
||||
/**
|
||||
* struct iwl_context_info_control - version structure
|
||||
* @control_flags: context information flags see &enum iwl_context_info_flags
|
||||
* @reserved: (reserved)
|
||||
*/
|
||||
struct iwl_context_info_control {
|
||||
__le32 control_flags;
|
||||
__le32 reserved;
|
||||
} __packed;
|
||||
|
||||
/*
|
||||
/**
|
||||
* struct iwl_context_info_dram - images DRAM map
|
||||
* each entry in the map represents a DRAM chunk of up to 32 KB
|
||||
* @umac_img: UMAC image DRAM map
|
||||
@@ -88,7 +90,7 @@ struct iwl_context_info_dram {
|
||||
__le64 virtual_img[IWL_MAX_DRAM_ENTRY];
|
||||
} __packed;
|
||||
|
||||
/*
|
||||
/**
|
||||
* struct iwl_context_info_rbd_cfg - RBDs configuration
|
||||
* @free_rbd_addr: default queue free RB CB base address
|
||||
* @used_rbd_addr: default queue used RB CB base address
|
||||
@@ -100,10 +102,11 @@ struct iwl_context_info_rbd_cfg {
|
||||
__le64 status_wr_ptr;
|
||||
} __packed;
|
||||
|
||||
/*
|
||||
/**
|
||||
* struct iwl_context_info_hcmd_cfg - command queue configuration
|
||||
* @cmd_queue_addr: address of command queue
|
||||
* @cmd_queue_size: number of entries
|
||||
* @reserved: (reserved)
|
||||
*/
|
||||
struct iwl_context_info_hcmd_cfg {
|
||||
__le64 cmd_queue_addr;
|
||||
@@ -111,10 +114,11 @@ struct iwl_context_info_hcmd_cfg {
|
||||
u8 reserved[7];
|
||||
} __packed;
|
||||
|
||||
/*
|
||||
/**
|
||||
* struct iwl_context_info_dump_cfg - Core Dump configuration
|
||||
* @core_dump_addr: core dump (debug DRAM address) start address
|
||||
* @core_dump_size: size, in DWs
|
||||
* @reserved: (reserved)
|
||||
*/
|
||||
struct iwl_context_info_dump_cfg {
|
||||
__le64 core_dump_addr;
|
||||
@@ -122,10 +126,11 @@ struct iwl_context_info_dump_cfg {
|
||||
__le32 reserved;
|
||||
} __packed;
|
||||
|
||||
/*
|
||||
/**
|
||||
* struct iwl_context_info_pnvm_cfg - platform NVM data configuration
|
||||
* @platform_nvm_addr: Platform NVM data start address
|
||||
* @platform_nvm_size: size in DWs
|
||||
* @reserved: (reserved)
|
||||
*/
|
||||
struct iwl_context_info_pnvm_cfg {
|
||||
__le64 platform_nvm_addr;
|
||||
@@ -133,11 +138,12 @@ struct iwl_context_info_pnvm_cfg {
|
||||
__le32 reserved;
|
||||
} __packed;
|
||||
|
||||
/*
|
||||
/**
|
||||
* struct iwl_context_info_early_dbg_cfg - early debug configuration for
|
||||
* dumping DRAM addresses
|
||||
* @early_debug_addr: early debug start address
|
||||
* @early_debug_size: size in DWs
|
||||
* @reserved: (reserved)
|
||||
*/
|
||||
struct iwl_context_info_early_dbg_cfg {
|
||||
__le64 early_debug_addr;
|
||||
@@ -145,16 +151,20 @@ struct iwl_context_info_early_dbg_cfg {
|
||||
__le32 reserved;
|
||||
} __packed;
|
||||
|
||||
/*
|
||||
/**
|
||||
* struct iwl_context_info - device INIT configuration
|
||||
* @version: version information of context info and HW
|
||||
* @control: control flags of FH configurations
|
||||
* @reserved0: (reserved)
|
||||
* @rbd_cfg: default RX queue configuration
|
||||
* @hcmd_cfg: command queue configuration
|
||||
* @reserved1: (reserved)
|
||||
* @dump_cfg: core dump data
|
||||
* @edbg_cfg: early debug configuration
|
||||
* @pnvm_cfg: platform nvm configuration
|
||||
* @reserved2: (reserved)
|
||||
* @dram: firmware image addresses in DRAM
|
||||
* @reserved3: (reserved)
|
||||
*/
|
||||
struct iwl_context_info {
|
||||
struct iwl_context_info_version version;
|
||||
|
||||
@@ -167,13 +167,15 @@
|
||||
#define CSR_HW_IF_CONFIG_REG_POS_PHY_DASH (12)
|
||||
#define CSR_HW_IF_CONFIG_REG_POS_PHY_STEP (14)
|
||||
|
||||
#define CSR_HW_IF_CONFIG_REG_BIT_HAP_WAKE_L1A (0x00080000)
|
||||
#define CSR_HW_IF_CONFIG_REG_BIT_EEPROM_OWN_SEM (0x00200000)
|
||||
#define CSR_HW_IF_CONFIG_REG_BIT_NIC_READY (0x00400000) /* PCI_OWN_SEM */
|
||||
#define CSR_HW_IF_CONFIG_REG_BIT_NIC_PREPARE_DONE (0x02000000) /* ME_OWN */
|
||||
#define CSR_HW_IF_CONFIG_REG_PREPARE (0x08000000) /* WAKE_ME */
|
||||
#define CSR_HW_IF_CONFIG_REG_ENABLE_PME (0x10000000)
|
||||
#define CSR_HW_IF_CONFIG_REG_PERSIST_MODE (0x40000000) /* PERSISTENCE */
|
||||
#define CSR_HW_IF_CONFIG_REG_HAP_WAKE 0x00080000
|
||||
/* NOTE: EEPROM_OWN_SEM is no longer defined for new HW */
|
||||
#define CSR_HW_IF_CONFIG_REG_EEPROM_OWN_SEM 0x00200000
|
||||
#define CSR_HW_IF_CONFIG_REG_PCI_OWN_SET 0x00400000
|
||||
#define CSR_HW_IF_CONFIG_REG_IAMT_UP 0x01000000
|
||||
#define CSR_HW_IF_CONFIG_REG_ME_OWN 0x02000000
|
||||
#define CSR_HW_IF_CONFIG_REG_WAKE_ME 0x08000000
|
||||
#define CSR_HW_IF_CONFIG_REG_WAKE_ME_PCIE_OWNER_EN 0x10000000
|
||||
#define CSR_HW_IF_CONFIG_REG_PERSISTENCE 0x40000000
|
||||
|
||||
#define CSR_MBOX_SET_REG_OS_ALIVE BIT(5)
|
||||
|
||||
@@ -351,7 +353,6 @@ enum {
|
||||
#define CSR_HW_RF_ID_TYPE_HRCDB (0x00109F00)
|
||||
#define CSR_HW_RF_ID_TYPE_GF (0x0010D000)
|
||||
#define CSR_HW_RF_ID_TYPE_GF4 (0x0010E000)
|
||||
#define CSR_HW_RF_ID_TYPE_MS (0x00111000)
|
||||
#define CSR_HW_RF_ID_TYPE_FM (0x00112000)
|
||||
#define CSR_HW_RF_ID_TYPE_WP (0x00113000)
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
/******************************************************************************
|
||||
*
|
||||
* Copyright(c) 2003 - 2014 Intel Corporation. All rights reserved.
|
||||
* Copyright(c) 2018 - 2021 Intel Corporation
|
||||
* Copyright(c) 2018 - 2021, 2024 Intel Corporation
|
||||
*
|
||||
* Portions of this file are derived from the ipw3945 project.
|
||||
*****************************************************************************/
|
||||
@@ -209,6 +209,7 @@ do { \
|
||||
#define IWL_DEBUG_RADIO(p, f, a...) IWL_DEBUG(p, IWL_DL_RADIO, f, ## a)
|
||||
#define IWL_DEBUG_DEV_RADIO(p, f, a...) IWL_DEBUG_DEV(p, IWL_DL_RADIO, f, ## a)
|
||||
#define IWL_DEBUG_POWER(p, f, a...) IWL_DEBUG(p, IWL_DL_POWER, f, ## a)
|
||||
#define IWL_DEBUG_DEV_POWER(p, f, a...) IWL_DEBUG_DEV(p, IWL_DL_POWER, f, ## a)
|
||||
#define IWL_DEBUG_11H(p, f, a...) IWL_DEBUG(p, IWL_DL_11H, f, ## a)
|
||||
#define IWL_DEBUG_TPT(p, f, a...) IWL_DEBUG(p, IWL_DL_TPT, f, ## a)
|
||||
#define IWL_DEBUG_WOWLAN(p, f, a...) IWL_DEBUG(p, IWL_DL_WOWLAN, f, ## a)
|
||||
|
||||
@@ -22,6 +22,7 @@
|
||||
#include "iwl-modparams.h"
|
||||
#include "fw/api/alive.h"
|
||||
#include "fw/api/mac.h"
|
||||
#include "fw/api/mac-cfg.h"
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
@@ -137,8 +138,7 @@ static void iwl_dealloc_ucode(struct iwl_drv *drv)
|
||||
memset(&drv->fw, 0, sizeof(drv->fw));
|
||||
}
|
||||
|
||||
static int iwl_alloc_fw_desc(struct iwl_drv *drv, struct fw_desc *desc,
|
||||
struct fw_sec *sec)
|
||||
static int iwl_alloc_fw_desc(struct fw_desc *desc, struct fw_sec *sec)
|
||||
{
|
||||
void *data;
|
||||
|
||||
@@ -318,17 +318,6 @@ struct iwl_firmware_pieces {
|
||||
size_t n_mem_tlv;
|
||||
};
|
||||
|
||||
/*
|
||||
* These functions are just to extract uCode section data from the pieces
|
||||
* structure.
|
||||
*/
|
||||
static struct fw_sec *get_sec(struct iwl_firmware_pieces *pieces,
|
||||
enum iwl_ucode_type type,
|
||||
int sec)
|
||||
{
|
||||
return &pieces->img[type].sec[sec];
|
||||
}
|
||||
|
||||
static void alloc_sec_data(struct iwl_firmware_pieces *pieces,
|
||||
enum iwl_ucode_type type,
|
||||
int sec)
|
||||
@@ -389,22 +378,18 @@ static void set_sec_offset(struct iwl_firmware_pieces *pieces,
|
||||
/*
|
||||
* Gets uCode section from tlv.
|
||||
*/
|
||||
static int iwl_store_ucode_sec(struct iwl_firmware_pieces *pieces,
|
||||
const void *data, enum iwl_ucode_type type,
|
||||
int size)
|
||||
static int iwl_store_ucode_sec(struct fw_img_parsing *img,
|
||||
const void *data, int size)
|
||||
{
|
||||
struct fw_img_parsing *img;
|
||||
struct fw_sec *sec;
|
||||
const struct fw_sec_parsing *sec_parse;
|
||||
size_t alloc_size;
|
||||
|
||||
if (WARN_ON(!pieces || !data || type >= IWL_UCODE_TYPE_MAX))
|
||||
return -1;
|
||||
if (WARN_ON(!img || !data))
|
||||
return -EINVAL;
|
||||
|
||||
sec_parse = (const struct fw_sec_parsing *)data;
|
||||
|
||||
img = &pieces->img[type];
|
||||
|
||||
alloc_size = sizeof(*img->sec) * (img->sec_counter + 1);
|
||||
sec = krealloc(img->sec, alloc_size, GFP_KERNEL);
|
||||
if (!sec)
|
||||
@@ -900,18 +885,18 @@ static int iwl_parse_tlv_firmware(struct iwl_drv *drv,
|
||||
le32_to_cpup((const __le32 *)tlv_data);
|
||||
break;
|
||||
case IWL_UCODE_TLV_SEC_RT:
|
||||
iwl_store_ucode_sec(pieces, tlv_data, IWL_UCODE_REGULAR,
|
||||
tlv_len);
|
||||
iwl_store_ucode_sec(&pieces->img[IWL_UCODE_REGULAR],
|
||||
tlv_data, tlv_len);
|
||||
drv->fw.type = IWL_FW_MVM;
|
||||
break;
|
||||
case IWL_UCODE_TLV_SEC_INIT:
|
||||
iwl_store_ucode_sec(pieces, tlv_data, IWL_UCODE_INIT,
|
||||
tlv_len);
|
||||
iwl_store_ucode_sec(&pieces->img[IWL_UCODE_INIT],
|
||||
tlv_data, tlv_len);
|
||||
drv->fw.type = IWL_FW_MVM;
|
||||
break;
|
||||
case IWL_UCODE_TLV_SEC_WOWLAN:
|
||||
iwl_store_ucode_sec(pieces, tlv_data, IWL_UCODE_WOWLAN,
|
||||
tlv_len);
|
||||
iwl_store_ucode_sec(&pieces->img[IWL_UCODE_WOWLAN],
|
||||
tlv_data, tlv_len);
|
||||
drv->fw.type = IWL_FW_MVM;
|
||||
break;
|
||||
case IWL_UCODE_TLV_DEF_CALIB:
|
||||
@@ -932,18 +917,18 @@ static int iwl_parse_tlv_firmware(struct iwl_drv *drv,
|
||||
FW_PHY_CFG_RX_CHAIN_POS;
|
||||
break;
|
||||
case IWL_UCODE_TLV_SECURE_SEC_RT:
|
||||
iwl_store_ucode_sec(pieces, tlv_data, IWL_UCODE_REGULAR,
|
||||
tlv_len);
|
||||
iwl_store_ucode_sec(&pieces->img[IWL_UCODE_REGULAR],
|
||||
tlv_data, tlv_len);
|
||||
drv->fw.type = IWL_FW_MVM;
|
||||
break;
|
||||
case IWL_UCODE_TLV_SECURE_SEC_INIT:
|
||||
iwl_store_ucode_sec(pieces, tlv_data, IWL_UCODE_INIT,
|
||||
tlv_len);
|
||||
iwl_store_ucode_sec(&pieces->img[IWL_UCODE_INIT],
|
||||
tlv_data, tlv_len);
|
||||
drv->fw.type = IWL_FW_MVM;
|
||||
break;
|
||||
case IWL_UCODE_TLV_SECURE_SEC_WOWLAN:
|
||||
iwl_store_ucode_sec(pieces, tlv_data, IWL_UCODE_WOWLAN,
|
||||
tlv_len);
|
||||
iwl_store_ucode_sec(&pieces->img[IWL_UCODE_WOWLAN],
|
||||
tlv_data, tlv_len);
|
||||
drv->fw.type = IWL_FW_MVM;
|
||||
break;
|
||||
case IWL_UCODE_TLV_NUM_OF_CPU:
|
||||
@@ -1110,9 +1095,8 @@ static int iwl_parse_tlv_firmware(struct iwl_drv *drv,
|
||||
}
|
||||
case IWL_UCODE_TLV_SEC_RT_USNIFFER:
|
||||
*usniffer_images = true;
|
||||
iwl_store_ucode_sec(pieces, tlv_data,
|
||||
IWL_UCODE_REGULAR_USNIFFER,
|
||||
tlv_len);
|
||||
iwl_store_ucode_sec(&pieces->img[IWL_UCODE_REGULAR_USNIFFER],
|
||||
tlv_data, tlv_len);
|
||||
break;
|
||||
case IWL_UCODE_TLV_PAGING:
|
||||
if (tlv_len != sizeof(u32))
|
||||
@@ -1214,6 +1198,19 @@ static int iwl_parse_tlv_firmware(struct iwl_drv *drv,
|
||||
capa->num_stations =
|
||||
le32_to_cpup((const __le32 *)tlv_data);
|
||||
break;
|
||||
case IWL_UCODE_TLV_FW_NUM_LINKS:
|
||||
if (tlv_len != sizeof(u32))
|
||||
goto invalid_tlv_len;
|
||||
if (le32_to_cpup((const __le32 *)tlv_data) >
|
||||
IWL_FW_MAX_LINK_ID + 1) {
|
||||
IWL_ERR(drv,
|
||||
"%d is an invalid number of links\n",
|
||||
le32_to_cpup((const __le32 *)tlv_data));
|
||||
goto tlv_error;
|
||||
}
|
||||
capa->num_links =
|
||||
le32_to_cpup((const __le32 *)tlv_data);
|
||||
break;
|
||||
case IWL_UCODE_TLV_FW_NUM_BEACONS:
|
||||
if (tlv_len != sizeof(u32))
|
||||
goto invalid_tlv_len;
|
||||
@@ -1337,24 +1334,29 @@ static int iwl_parse_tlv_firmware(struct iwl_drv *drv,
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
static int iwl_alloc_ucode_mem(struct fw_img *out, struct fw_img_parsing *img)
|
||||
{
|
||||
struct fw_desc *sec;
|
||||
|
||||
sec = kcalloc(img->sec_counter, sizeof(*sec), GFP_KERNEL);
|
||||
if (!sec)
|
||||
return -ENOMEM;
|
||||
|
||||
out->sec = sec;
|
||||
out->num_sec = img->sec_counter;
|
||||
|
||||
for (int i = 0; i < out->num_sec; i++)
|
||||
if (iwl_alloc_fw_desc(&sec[i], &img->sec[i]))
|
||||
return -ENOMEM;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int iwl_alloc_ucode(struct iwl_drv *drv,
|
||||
struct iwl_firmware_pieces *pieces,
|
||||
enum iwl_ucode_type type)
|
||||
{
|
||||
int i;
|
||||
struct fw_desc *sec;
|
||||
|
||||
sec = kcalloc(pieces->img[type].sec_counter, sizeof(*sec), GFP_KERNEL);
|
||||
if (!sec)
|
||||
return -ENOMEM;
|
||||
drv->fw.img[type].sec = sec;
|
||||
drv->fw.img[type].num_sec = pieces->img[type].sec_counter;
|
||||
|
||||
for (i = 0; i < pieces->img[type].sec_counter; i++)
|
||||
if (iwl_alloc_fw_desc(drv, &sec[i], get_sec(pieces, type, i)))
|
||||
return -ENOMEM;
|
||||
|
||||
return 0;
|
||||
return iwl_alloc_ucode_mem(&drv->fw.img[type], &pieces->img[type]);
|
||||
}
|
||||
|
||||
static int validate_sec_sizes(struct iwl_drv *drv,
|
||||
@@ -1429,18 +1431,21 @@ _iwl_op_mode_start(struct iwl_drv *drv, struct iwlwifi_opmode_table *op)
|
||||
op_mode = ops->start(drv->trans, drv->trans->cfg,
|
||||
&drv->fw, dbgfs_dir);
|
||||
|
||||
if (op_mode)
|
||||
if (!IS_ERR(op_mode))
|
||||
return op_mode;
|
||||
|
||||
if (test_bit(STATUS_TRANS_DEAD, &drv->trans->status))
|
||||
break;
|
||||
|
||||
IWL_ERR(drv, "retry init count %d\n", retry);
|
||||
|
||||
#ifdef CONFIG_IWLWIFI_DEBUGFS
|
||||
debugfs_remove_recursive(drv->dbgfs_op_mode);
|
||||
drv->dbgfs_op_mode = NULL;
|
||||
#endif
|
||||
|
||||
if (PTR_ERR(op_mode) != -ETIMEDOUT)
|
||||
break;
|
||||
|
||||
IWL_ERR(drv, "retry init count %d\n", retry);
|
||||
}
|
||||
|
||||
return NULL;
|
||||
@@ -1944,6 +1949,7 @@ module_init(iwl_drv_init);
|
||||
static void __exit iwl_drv_exit(void)
|
||||
{
|
||||
iwl_pci_unregister_driver();
|
||||
iwl_trans_free_restart_list();
|
||||
|
||||
#ifdef CONFIG_IWLWIFI_DEBUGFS
|
||||
debugfs_remove_recursive(iwl_dbgfs_root);
|
||||
|
||||
@@ -526,5 +526,5 @@ void iwl_trans_sync_nmi_with_addr(struct iwl_trans *trans, u32 inta_addr,
|
||||
if (interrupts_enabled)
|
||||
iwl_trans_interrupts(trans, true);
|
||||
|
||||
iwl_trans_fw_error(trans, false);
|
||||
iwl_trans_fw_error(trans, IWL_ERR_TYPE_NMI_FORCED);
|
||||
}
|
||||
|
||||
@@ -141,8 +141,10 @@ static struct ieee80211_rate iwl_cfg80211_rates[] = {
|
||||
/**
|
||||
* enum iwl_nvm_channel_flags - channel flags in NVM
|
||||
* @NVM_CHANNEL_VALID: channel is usable for this SKU/geo
|
||||
* @NVM_CHANNEL_IBSS: usable as an IBSS channel
|
||||
* @NVM_CHANNEL_ACTIVE: active scanning allowed
|
||||
* @NVM_CHANNEL_IBSS: usable as an IBSS channel and deprecated
|
||||
* when %IWL_NVM_SBANDS_FLAGS_LAR enabled.
|
||||
* @NVM_CHANNEL_ACTIVE: active scanning allowed and allows IBSS
|
||||
* when %IWL_NVM_SBANDS_FLAGS_LAR enabled.
|
||||
* @NVM_CHANNEL_RADAR: radar detection required
|
||||
* @NVM_CHANNEL_INDOOR_ONLY: only indoor use is allowed
|
||||
* @NVM_CHANNEL_GO_CONCURRENT: GO operation is allowed when connected to BSS
|
||||
|
||||
@@ -44,6 +44,55 @@ struct iwl_cfg;
|
||||
* 5) The driver layer stops the op_mode
|
||||
*/
|
||||
|
||||
/**
|
||||
* enum iwl_fw_error_type - FW error types/sources
|
||||
* @IWL_ERR_TYPE_IRQ: "normal" FW error through an IRQ
|
||||
* @IWL_ERR_TYPE_NMI_FORCED: NMI was forced by driver
|
||||
* @IWL_ERR_TYPE_RESET_HS_TIMEOUT: reset handshake timed out,
|
||||
* any debug collection must happen synchronously as
|
||||
* the device will be shut down
|
||||
* @IWL_ERR_TYPE_CMD_QUEUE_FULL: command queue was full
|
||||
*/
|
||||
enum iwl_fw_error_type {
|
||||
IWL_ERR_TYPE_IRQ,
|
||||
IWL_ERR_TYPE_NMI_FORCED,
|
||||
IWL_ERR_TYPE_RESET_HS_TIMEOUT,
|
||||
IWL_ERR_TYPE_CMD_QUEUE_FULL,
|
||||
};
|
||||
|
||||
/**
|
||||
* enum iwl_fw_error_context - error dump context
|
||||
* @IWL_ERR_CONTEXT_WORKER: regular from worker context,
|
||||
* opmode must acquire locks and must also check
|
||||
* for @IWL_ERR_CONTEXT_ABORT after acquiring locks
|
||||
* @IWL_ERR_CONTEXT_FROM_OPMODE: context is in a call
|
||||
* originating from the opmode, e.g. while resetting
|
||||
* or stopping the device, so opmode must not acquire
|
||||
* any locks
|
||||
* @IWL_ERR_CONTEXT_ABORT: after lock acquisition, indicates
|
||||
* that the dump already happened via another callback
|
||||
* (currently only while stopping the device) via the
|
||||
* @IWL_ERR_CONTEXT_FROM_OPMODE context, and this call
|
||||
* must be aborted
|
||||
*/
|
||||
enum iwl_fw_error_context {
|
||||
IWL_ERR_CONTEXT_WORKER,
|
||||
IWL_ERR_CONTEXT_FROM_OPMODE,
|
||||
IWL_ERR_CONTEXT_ABORT,
|
||||
};
|
||||
|
||||
/**
|
||||
* struct iwl_fw_error_dump_mode - error dump mode for callback
|
||||
* @type: The reason for the dump, per &enum iwl_fw_error_type.
|
||||
* @context: The context for the dump, may also indicate this
|
||||
* call needs to be skipped. This MUST be checked before
|
||||
* and after acquiring any locks in the op-mode!
|
||||
*/
|
||||
struct iwl_fw_error_dump_mode {
|
||||
enum iwl_fw_error_type type;
|
||||
enum iwl_fw_error_context context;
|
||||
};
|
||||
|
||||
/**
|
||||
* struct iwl_op_mode_ops - op_mode specific operations
|
||||
*
|
||||
@@ -77,10 +126,11 @@ struct iwl_cfg;
|
||||
* reclaimed by the op_mode. This can happen when the driver is freed and
|
||||
* there are Tx packets pending in the transport layer.
|
||||
* Must be atomic
|
||||
* @nic_error: error notification. Must be atomic and must be called with BH
|
||||
* disabled, unless the sync parameter is true.
|
||||
* @cmd_queue_full: Called when the command queue gets full. Must be atomic and
|
||||
* called with BH disabled.
|
||||
* @nic_error: error notification. Must be atomic, the op mode should handle
|
||||
* the error (e.g. abort notification waiters) and print the error if
|
||||
* applicable
|
||||
* @dump_error: NIC error dump collection (can sleep, synchronous)
|
||||
* @sw_reset: (maybe) initiate a software reset, return %true if started
|
||||
* @nic_config: configure NIC, called before firmware is started.
|
||||
* May sleep
|
||||
* @wimax_active: invoked when WiMax becomes active. May sleep
|
||||
@@ -104,8 +154,12 @@ struct iwl_op_mode_ops {
|
||||
void (*queue_not_full)(struct iwl_op_mode *op_mode, int queue);
|
||||
bool (*hw_rf_kill)(struct iwl_op_mode *op_mode, bool state);
|
||||
void (*free_skb)(struct iwl_op_mode *op_mode, struct sk_buff *skb);
|
||||
void (*nic_error)(struct iwl_op_mode *op_mode, bool sync);
|
||||
void (*cmd_queue_full)(struct iwl_op_mode *op_mode);
|
||||
void (*nic_error)(struct iwl_op_mode *op_mode,
|
||||
enum iwl_fw_error_type type);
|
||||
void (*dump_error)(struct iwl_op_mode *op_mode,
|
||||
struct iwl_fw_error_dump_mode *mode);
|
||||
bool (*sw_reset)(struct iwl_op_mode *op_mode,
|
||||
enum iwl_fw_error_type type);
|
||||
void (*nic_config)(struct iwl_op_mode *op_mode);
|
||||
void (*wimax_active)(struct iwl_op_mode *op_mode);
|
||||
void (*time_point)(struct iwl_op_mode *op_mode,
|
||||
@@ -177,14 +231,19 @@ static inline void iwl_op_mode_free_skb(struct iwl_op_mode *op_mode,
|
||||
op_mode->ops->free_skb(op_mode, skb);
|
||||
}
|
||||
|
||||
static inline void iwl_op_mode_nic_error(struct iwl_op_mode *op_mode, bool sync)
|
||||
static inline void iwl_op_mode_nic_error(struct iwl_op_mode *op_mode,
|
||||
enum iwl_fw_error_type type)
|
||||
{
|
||||
op_mode->ops->nic_error(op_mode, sync);
|
||||
op_mode->ops->nic_error(op_mode, type);
|
||||
}
|
||||
|
||||
static inline void iwl_op_mode_cmd_queue_full(struct iwl_op_mode *op_mode)
|
||||
static inline void iwl_op_mode_dump_error(struct iwl_op_mode *op_mode,
|
||||
struct iwl_fw_error_dump_mode *mode)
|
||||
{
|
||||
op_mode->ops->cmd_queue_full(op_mode);
|
||||
might_sleep();
|
||||
|
||||
if (op_mode->ops->dump_error)
|
||||
op_mode->ops->dump_error(op_mode, mode);
|
||||
}
|
||||
|
||||
static inline void iwl_op_mode_nic_config(struct iwl_op_mode *op_mode)
|
||||
|
||||
@@ -381,6 +381,10 @@ enum {
|
||||
#define CNVR_SCU_SD_REGS_SD_REG_ACTIVE_VDIG_MIRROR 0xA29938
|
||||
#define CNVI_SCU_SEQ_DATA_DW9 0xA27488
|
||||
|
||||
#define CNVI_SCU_REG_FOR_ECO_1 0xA26EF8
|
||||
#define CNVI_SCU_REG_FOR_ECO_1_WIAMT_KNOWN BIT(4)
|
||||
#define CNVI_SCU_REG_FOR_ECO_1_WIAMT_PRESENT BIT(5)
|
||||
|
||||
#define CNVI_PMU_STEP_FLOW 0xA2D588
|
||||
#define CNVI_PMU_STEP_FLOW_FORCE_URM BIT(2)
|
||||
|
||||
@@ -458,6 +462,7 @@ enum {
|
||||
#define REG_CRF_ID_TYPE_GF 0x410
|
||||
#define REG_CRF_ID_TYPE_FM 0x910
|
||||
#define REG_CRF_ID_TYPE_WHP 0xA10
|
||||
#define REG_CRF_ID_TYPE_PE 0xA30
|
||||
|
||||
#define HPM_DEBUG 0xA03440
|
||||
#define PERSISTENCE_BIT BIT(12)
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
*/
|
||||
#include <linux/kernel.h>
|
||||
#include <linux/bsearch.h>
|
||||
#include <linux/list.h>
|
||||
|
||||
#include "fw/api/tx.h"
|
||||
#include "iwl-trans.h"
|
||||
@@ -16,13 +17,200 @@
|
||||
#include "pcie/internal.h"
|
||||
#include "iwl-context-info-gen3.h"
|
||||
|
||||
struct iwl_trans_dev_restart_data {
|
||||
struct list_head list;
|
||||
unsigned int restart_count;
|
||||
time64_t last_error;
|
||||
char name[];
|
||||
};
|
||||
|
||||
static LIST_HEAD(restart_data_list);
|
||||
static DEFINE_SPINLOCK(restart_data_lock);
|
||||
|
||||
static struct iwl_trans_dev_restart_data *
|
||||
iwl_trans_get_restart_data(struct device *dev)
|
||||
{
|
||||
struct iwl_trans_dev_restart_data *tmp, *data = NULL;
|
||||
const char *name = dev_name(dev);
|
||||
|
||||
spin_lock(&restart_data_lock);
|
||||
list_for_each_entry(tmp, &restart_data_list, list) {
|
||||
if (strcmp(tmp->name, name))
|
||||
continue;
|
||||
data = tmp;
|
||||
break;
|
||||
}
|
||||
spin_unlock(&restart_data_lock);
|
||||
|
||||
if (data)
|
||||
return data;
|
||||
|
||||
data = kzalloc(struct_size(data, name, strlen(name) + 1), GFP_ATOMIC);
|
||||
if (!data)
|
||||
return NULL;
|
||||
|
||||
strcpy(data->name, name);
|
||||
spin_lock(&restart_data_lock);
|
||||
list_add_tail(&data->list, &restart_data_list);
|
||||
spin_unlock(&restart_data_lock);
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
static void iwl_trans_inc_restart_count(struct device *dev)
|
||||
{
|
||||
struct iwl_trans_dev_restart_data *data;
|
||||
|
||||
data = iwl_trans_get_restart_data(dev);
|
||||
if (data) {
|
||||
data->last_error = ktime_get_boottime_seconds();
|
||||
data->restart_count++;
|
||||
}
|
||||
}
|
||||
|
||||
void iwl_trans_free_restart_list(void)
|
||||
{
|
||||
struct iwl_trans_dev_restart_data *tmp;
|
||||
|
||||
while ((tmp = list_first_entry_or_null(&restart_data_list,
|
||||
typeof(*tmp), list))) {
|
||||
list_del(&tmp->list);
|
||||
kfree(tmp);
|
||||
}
|
||||
}
|
||||
|
||||
struct iwl_trans_reprobe {
|
||||
struct device *dev;
|
||||
struct work_struct work;
|
||||
};
|
||||
|
||||
static void iwl_trans_reprobe_wk(struct work_struct *wk)
|
||||
{
|
||||
struct iwl_trans_reprobe *reprobe;
|
||||
|
||||
reprobe = container_of(wk, typeof(*reprobe), work);
|
||||
|
||||
if (device_reprobe(reprobe->dev))
|
||||
dev_err(reprobe->dev, "reprobe failed!\n");
|
||||
put_device(reprobe->dev);
|
||||
kfree(reprobe);
|
||||
module_put(THIS_MODULE);
|
||||
}
|
||||
|
||||
#define IWL_TRANS_RESET_OK_TIME 180 /* seconds */
|
||||
|
||||
static enum iwl_reset_mode
|
||||
iwl_trans_determine_restart_mode(struct iwl_trans *trans)
|
||||
{
|
||||
struct iwl_trans_dev_restart_data *data;
|
||||
enum iwl_reset_mode at_least = 0;
|
||||
unsigned int index;
|
||||
static const enum iwl_reset_mode escalation_list[] = {
|
||||
IWL_RESET_MODE_SW_RESET,
|
||||
IWL_RESET_MODE_REPROBE,
|
||||
IWL_RESET_MODE_REPROBE,
|
||||
IWL_RESET_MODE_FUNC_RESET,
|
||||
/* FIXME: add TOP reset */
|
||||
IWL_RESET_MODE_PROD_RESET,
|
||||
/* FIXME: add TOP reset */
|
||||
IWL_RESET_MODE_PROD_RESET,
|
||||
/* FIXME: add TOP reset */
|
||||
IWL_RESET_MODE_PROD_RESET,
|
||||
};
|
||||
|
||||
if (trans->restart.during_reset)
|
||||
at_least = IWL_RESET_MODE_REPROBE;
|
||||
|
||||
data = iwl_trans_get_restart_data(trans->dev);
|
||||
if (!data)
|
||||
return at_least;
|
||||
|
||||
if (ktime_get_boottime_seconds() - data->last_error >=
|
||||
IWL_TRANS_RESET_OK_TIME)
|
||||
data->restart_count = 0;
|
||||
|
||||
index = data->restart_count;
|
||||
if (index >= ARRAY_SIZE(escalation_list))
|
||||
index = ARRAY_SIZE(escalation_list) - 1;
|
||||
|
||||
return max(at_least, escalation_list[index]);
|
||||
}
|
||||
|
||||
#define IWL_TRANS_RESET_DELAY (HZ * 60)
|
||||
|
||||
static void iwl_trans_restart_wk(struct work_struct *wk)
|
||||
{
|
||||
struct iwl_trans *trans = container_of(wk, typeof(*trans), restart.wk);
|
||||
struct iwl_trans_reprobe *reprobe;
|
||||
enum iwl_reset_mode mode;
|
||||
|
||||
if (!trans->op_mode)
|
||||
return;
|
||||
|
||||
/* might have been scheduled before marked as dead, re-check */
|
||||
if (test_bit(STATUS_TRANS_DEAD, &trans->status))
|
||||
return;
|
||||
|
||||
iwl_op_mode_dump_error(trans->op_mode, &trans->restart.mode);
|
||||
|
||||
/*
|
||||
* If the opmode stopped the device while we were trying to dump and
|
||||
* reset, then we'll have done the dump already (synchronized by the
|
||||
* opmode lock that it will acquire in iwl_op_mode_dump_error()) and
|
||||
* managed that via trans->restart.mode.
|
||||
* Additionally, make sure that in such a case we won't attempt to do
|
||||
* any resets now, since it's no longer requested.
|
||||
*/
|
||||
if (!test_and_clear_bit(STATUS_RESET_PENDING, &trans->status))
|
||||
return;
|
||||
|
||||
if (!iwlwifi_mod_params.fw_restart)
|
||||
return;
|
||||
|
||||
mode = iwl_trans_determine_restart_mode(trans);
|
||||
|
||||
iwl_trans_inc_restart_count(trans->dev);
|
||||
|
||||
switch (mode) {
|
||||
case IWL_RESET_MODE_SW_RESET:
|
||||
IWL_ERR(trans, "Device error - SW reset\n");
|
||||
iwl_trans_opmode_sw_reset(trans, trans->restart.mode.type);
|
||||
break;
|
||||
case IWL_RESET_MODE_REPROBE:
|
||||
IWL_ERR(trans, "Device error - reprobe!\n");
|
||||
|
||||
/*
|
||||
* get a module reference to avoid doing this while unloading
|
||||
* anyway and to avoid scheduling a work with code that's
|
||||
* being removed.
|
||||
*/
|
||||
if (!try_module_get(THIS_MODULE)) {
|
||||
IWL_ERR(trans, "Module is being unloaded - abort\n");
|
||||
return;
|
||||
}
|
||||
|
||||
reprobe = kzalloc(sizeof(*reprobe), GFP_KERNEL);
|
||||
if (!reprobe) {
|
||||
module_put(THIS_MODULE);
|
||||
return;
|
||||
}
|
||||
reprobe->dev = get_device(trans->dev);
|
||||
INIT_WORK(&reprobe->work, iwl_trans_reprobe_wk);
|
||||
schedule_work(&reprobe->work);
|
||||
break;
|
||||
default:
|
||||
iwl_trans_pcie_reset(trans, mode);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
struct iwl_trans *iwl_trans_alloc(unsigned int priv_size,
|
||||
struct device *dev,
|
||||
const struct iwl_cfg_trans_params *cfg_trans)
|
||||
{
|
||||
struct iwl_trans *trans;
|
||||
#ifdef CONFIG_LOCKDEP
|
||||
static struct lock_class_key __key;
|
||||
static struct lock_class_key __sync_cmd_key;
|
||||
#endif
|
||||
|
||||
trans = devm_kzalloc(dev, sizeof(*trans) + priv_size, GFP_KERNEL);
|
||||
@@ -33,12 +221,14 @@ struct iwl_trans *iwl_trans_alloc(unsigned int priv_size,
|
||||
|
||||
#ifdef CONFIG_LOCKDEP
|
||||
lockdep_init_map(&trans->sync_cmd_lockdep_map, "sync_cmd_lockdep_map",
|
||||
&__key, 0);
|
||||
&__sync_cmd_key, 0);
|
||||
#endif
|
||||
|
||||
trans->dev = dev;
|
||||
trans->num_rx_queues = 1;
|
||||
|
||||
INIT_WORK(&trans->restart.wk, iwl_trans_restart_wk);
|
||||
|
||||
return trans;
|
||||
}
|
||||
|
||||
@@ -81,6 +271,7 @@ int iwl_trans_init(struct iwl_trans *trans)
|
||||
|
||||
void iwl_trans_free(struct iwl_trans *trans)
|
||||
{
|
||||
cancel_work_sync(&trans->restart.wk);
|
||||
kmem_cache_destroy(trans->dev_cmd_pool);
|
||||
}
|
||||
|
||||
@@ -391,6 +582,34 @@ void iwl_trans_stop_device(struct iwl_trans *trans)
|
||||
{
|
||||
might_sleep();
|
||||
|
||||
/*
|
||||
* See also the comment in iwl_trans_restart_wk().
|
||||
*
|
||||
* When the opmode stops the device while a reset is pending, the
|
||||
* worker (iwl_trans_restart_wk) might not have run yet or, more
|
||||
* likely, will be blocked on the opmode lock. Due to the locking,
|
||||
* we can't just flush the worker.
|
||||
*
|
||||
* If this is the case, then the test_and_clear_bit() ensures that
|
||||
* the worker won't attempt to do anything after the stop.
|
||||
*
|
||||
* The trans->restart.mode is a handshake with the opmode, we set
|
||||
* the context there to ABORT so that when the worker can finally
|
||||
* acquire the lock in the opmode, the code there won't attempt to
|
||||
* do any dumps. Since we'd really like to have the dump though,
|
||||
* also do it inline here (with the opmode locks already held),
|
||||
* but use a separate mode struct to avoid races.
|
||||
*/
|
||||
if (test_and_clear_bit(STATUS_RESET_PENDING, &trans->status)) {
|
||||
struct iwl_fw_error_dump_mode mode;
|
||||
|
||||
mode = trans->restart.mode;
|
||||
mode.context = IWL_ERR_CONTEXT_FROM_OPMODE;
|
||||
trans->restart.mode.context = IWL_ERR_CONTEXT_ABORT;
|
||||
|
||||
iwl_op_mode_dump_error(trans->op_mode, &mode);
|
||||
}
|
||||
|
||||
if (trans->trans_cfg->gen2)
|
||||
iwl_trans_pcie_gen2_stop_device(trans);
|
||||
else
|
||||
|
||||
@@ -300,6 +300,10 @@ enum iwl_d3_status {
|
||||
* @STATUS_TRANS_DEAD: trans is dead - avoid any read/write operation
|
||||
* @STATUS_SUPPRESS_CMD_ERROR_ONCE: suppress "FW error in SYNC CMD" once,
|
||||
* e.g. for testing
|
||||
* @STATUS_IN_SW_RESET: device is undergoing reset, cleared by opmode
|
||||
* via iwl_trans_finish_sw_reset()
|
||||
* @STATUS_RESET_PENDING: reset worker was scheduled, but didn't dump
|
||||
* the firmware state yet
|
||||
*/
|
||||
enum iwl_trans_status {
|
||||
STATUS_SYNC_HCMD_ACTIVE,
|
||||
@@ -311,6 +315,8 @@ enum iwl_trans_status {
|
||||
STATUS_FW_ERROR,
|
||||
STATUS_TRANS_DEAD,
|
||||
STATUS_SUPPRESS_CMD_ERROR_ONCE,
|
||||
STATUS_IN_SW_RESET,
|
||||
STATUS_RESET_PENDING,
|
||||
};
|
||||
|
||||
static inline int
|
||||
@@ -322,7 +328,6 @@ iwl_trans_get_rb_size_order(enum iwl_amsdu_size rb_size)
|
||||
case IWL_AMSDU_4K:
|
||||
return get_order(4 * 1024);
|
||||
case IWL_AMSDU_8K:
|
||||
return get_order(8 * 1024);
|
||||
case IWL_AMSDU_12K:
|
||||
return get_order(16 * 1024);
|
||||
default:
|
||||
@@ -628,8 +633,6 @@ struct iwl_pc_data {
|
||||
* @n_dest_reg: num of reg_ops in %dbg_dest_tlv
|
||||
* @rec_on: true iff there is a fw debug recording currently active
|
||||
* @dest_tlv: points to the destination TLV for debug
|
||||
* @conf_tlv: array of pointers to configuration TLVs for debug
|
||||
* @trigger_tlv: array of pointers to triggers TLVs for debug
|
||||
* @lmac_error_event_table: addrs of lmacs error tables
|
||||
* @umac_error_event_table: addr of umac error table
|
||||
* @tcm_error_event_table: address(es) of TCM error table(s)
|
||||
@@ -664,8 +667,6 @@ struct iwl_trans_debug {
|
||||
bool rec_on;
|
||||
|
||||
const struct iwl_fw_dbg_dest_tlv_v1 *dest_tlv;
|
||||
const struct iwl_fw_dbg_conf_tlv *conf_tlv[FW_DBG_CONF_MAX];
|
||||
struct iwl_fw_dbg_trigger_tlv * const *trigger_tlv;
|
||||
|
||||
u32 lmac_error_event_table[2];
|
||||
u32 umac_error_event_table;
|
||||
@@ -877,7 +878,16 @@ struct iwl_txq {
|
||||
* @reduced_cap_sku: reduced capability supported SKU
|
||||
* @no_160: device not supporting 160 MHz
|
||||
* @step_urm: STEP is in URM, no support for MCS>9 in 320 MHz
|
||||
* @restart: restart worker data
|
||||
* @restart.wk: restart worker
|
||||
* @restart.mode: reset/restart error mode information
|
||||
* @restart.during_reset: error occurred during previous software reset
|
||||
* @me_recheck_wk: worker to recheck WiAMT/CSME presence
|
||||
* @me_present: WiAMT/CSME is detected as present (1), not present (0)
|
||||
* or unknown (-1, so can still use it as a boolean safely)
|
||||
* @trans_specific: data for the specific transport this is allocated for/with
|
||||
* @dsbr_urm_fw_dependent: switch to URM based on fw settings
|
||||
* @dsbr_urm_permanent: switch to URM permanently
|
||||
*/
|
||||
struct iwl_trans {
|
||||
bool csme_own;
|
||||
@@ -902,6 +912,9 @@ struct iwl_trans {
|
||||
bool reduced_cap_sku;
|
||||
u8 no_160:1, step_urm:1;
|
||||
|
||||
u8 dsbr_urm_fw_dependent:1,
|
||||
dsbr_urm_permanent:1;
|
||||
|
||||
u8 rx_mpdu_cmd, rx_mpdu_cmd_hdr_size;
|
||||
|
||||
bool pm_support;
|
||||
@@ -944,6 +957,15 @@ struct iwl_trans {
|
||||
|
||||
struct iwl_dma_ptr invalid_tx_cmd;
|
||||
|
||||
struct {
|
||||
struct work_struct wk;
|
||||
struct iwl_fw_error_dump_mode mode;
|
||||
bool during_reset;
|
||||
} restart;
|
||||
|
||||
struct delayed_work me_recheck_wk;
|
||||
s8 me_present;
|
||||
|
||||
/* pointer to trans specific struct */
|
||||
/*Ensure that this pointer will always be aligned to sizeof pointer */
|
||||
char trans_specific[] __aligned(sizeof(void *));
|
||||
@@ -1120,7 +1142,28 @@ bool _iwl_trans_grab_nic_access(struct iwl_trans *trans);
|
||||
void __releases(nic_access)
|
||||
iwl_trans_release_nic_access(struct iwl_trans *trans);
|
||||
|
||||
static inline void iwl_trans_fw_error(struct iwl_trans *trans, bool sync)
|
||||
static inline void iwl_trans_schedule_reset(struct iwl_trans *trans,
|
||||
enum iwl_fw_error_type type)
|
||||
{
|
||||
if (test_bit(STATUS_TRANS_DEAD, &trans->status))
|
||||
return;
|
||||
|
||||
trans->restart.mode.type = type;
|
||||
trans->restart.mode.context = IWL_ERR_CONTEXT_WORKER;
|
||||
|
||||
set_bit(STATUS_RESET_PENDING, &trans->status);
|
||||
|
||||
/*
|
||||
* keep track of whether or not this happened while resetting,
|
||||
* by the timer the worker runs it might have finished
|
||||
*/
|
||||
trans->restart.during_reset = test_bit(STATUS_IN_SW_RESET,
|
||||
&trans->status);
|
||||
queue_work(system_unbound_wq, &trans->restart.wk);
|
||||
}
|
||||
|
||||
static inline void iwl_trans_fw_error(struct iwl_trans *trans,
|
||||
enum iwl_fw_error_type type)
|
||||
{
|
||||
if (WARN_ON_ONCE(!trans->op_mode))
|
||||
return;
|
||||
@@ -1128,10 +1171,24 @@ static inline void iwl_trans_fw_error(struct iwl_trans *trans, bool sync)
|
||||
/* prevent double restarts due to the same erroneous FW */
|
||||
if (!test_and_set_bit(STATUS_FW_ERROR, &trans->status)) {
|
||||
trans->state = IWL_TRANS_NO_FW;
|
||||
iwl_op_mode_nic_error(trans->op_mode, sync);
|
||||
iwl_op_mode_nic_error(trans->op_mode, type);
|
||||
iwl_trans_schedule_reset(trans, type);
|
||||
}
|
||||
}
|
||||
|
||||
static inline void iwl_trans_opmode_sw_reset(struct iwl_trans *trans,
|
||||
enum iwl_fw_error_type type)
|
||||
{
|
||||
if (WARN_ON_ONCE(!trans->op_mode))
|
||||
return;
|
||||
|
||||
set_bit(STATUS_IN_SW_RESET, &trans->status);
|
||||
|
||||
if (!trans->op_mode->ops->sw_reset ||
|
||||
!trans->op_mode->ops->sw_reset(trans->op_mode, type))
|
||||
clear_bit(STATUS_IN_SW_RESET, &trans->status);
|
||||
}
|
||||
|
||||
static inline bool iwl_trans_fw_running(struct iwl_trans *trans)
|
||||
{
|
||||
return trans->state == IWL_TRANS_FW_ALIVE;
|
||||
@@ -1164,6 +1221,11 @@ static inline bool iwl_trans_dbg_ini_valid(struct iwl_trans *trans)
|
||||
|
||||
void iwl_trans_interrupts(struct iwl_trans *trans, bool enable);
|
||||
|
||||
static inline void iwl_trans_finish_sw_reset(struct iwl_trans *trans)
|
||||
{
|
||||
clear_bit(STATUS_IN_SW_RESET, &trans->status);
|
||||
}
|
||||
|
||||
/*****************************************************
|
||||
* transport helper functions
|
||||
*****************************************************/
|
||||
@@ -1178,12 +1240,27 @@ static inline bool iwl_trans_is_hw_error_value(u32 val)
|
||||
return ((val & ~0xf) == 0xa5a5a5a0) || ((val & ~0xf) == 0x5a5a5a50);
|
||||
}
|
||||
|
||||
void iwl_trans_free_restart_list(void);
|
||||
|
||||
/*****************************************************
|
||||
* PCIe handling
|
||||
*****************************************************/
|
||||
int __must_check iwl_pci_register_driver(void);
|
||||
void iwl_pci_unregister_driver(void);
|
||||
void iwl_trans_pcie_remove(struct iwl_trans *trans, bool rescan);
|
||||
|
||||
/* Note: order matters */
|
||||
enum iwl_reset_mode {
|
||||
/* upper level modes: */
|
||||
IWL_RESET_MODE_SW_RESET,
|
||||
IWL_RESET_MODE_REPROBE,
|
||||
/* PCIE level modes: */
|
||||
IWL_RESET_MODE_REMOVE_ONLY,
|
||||
IWL_RESET_MODE_RESCAN,
|
||||
IWL_RESET_MODE_FUNC_RESET,
|
||||
IWL_RESET_MODE_PROD_RESET,
|
||||
};
|
||||
|
||||
void iwl_trans_pcie_reset(struct iwl_trans *trans, enum iwl_reset_mode mode);
|
||||
|
||||
int iwl_trans_pcie_send_hcmd(struct iwl_trans *trans,
|
||||
struct iwl_host_cmd *cmd);
|
||||
|
||||
@@ -0,0 +1,85 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause */
|
||||
/*
|
||||
* Copyright (C) 2024 Intel Corporation
|
||||
*/
|
||||
#include <net/gso.h>
|
||||
#include <linux/ieee80211.h>
|
||||
#include <net/gso.h>
|
||||
#include <net/ip.h>
|
||||
|
||||
#include "iwl-drv.h"
|
||||
#include "iwl-utils.h"
|
||||
|
||||
#ifdef CONFIG_INET
|
||||
int iwl_tx_tso_segment(struct sk_buff *skb, unsigned int num_subframes,
|
||||
netdev_features_t netdev_flags,
|
||||
struct sk_buff_head *mpdus_skbs)
|
||||
{
|
||||
struct sk_buff *tmp, *next;
|
||||
struct ieee80211_hdr *hdr = (void *)skb->data;
|
||||
char cb[sizeof(skb->cb)];
|
||||
u16 i = 0;
|
||||
unsigned int tcp_payload_len;
|
||||
unsigned int mss = skb_shinfo(skb)->gso_size;
|
||||
bool ipv4 = (skb->protocol == htons(ETH_P_IP));
|
||||
bool qos = ieee80211_is_data_qos(hdr->frame_control);
|
||||
u16 ip_base_id = ipv4 ? ntohs(ip_hdr(skb)->id) : 0;
|
||||
|
||||
skb_shinfo(skb)->gso_size = num_subframes * mss;
|
||||
memcpy(cb, skb->cb, sizeof(cb));
|
||||
|
||||
next = skb_gso_segment(skb, netdev_flags);
|
||||
skb_shinfo(skb)->gso_size = mss;
|
||||
skb_shinfo(skb)->gso_type = ipv4 ? SKB_GSO_TCPV4 : SKB_GSO_TCPV6;
|
||||
|
||||
if (IS_ERR(next) && PTR_ERR(next) == -ENOMEM)
|
||||
return -ENOMEM;
|
||||
|
||||
if (WARN_ONCE(IS_ERR(next),
|
||||
"skb_gso_segment error: %d\n", (int)PTR_ERR(next)))
|
||||
return PTR_ERR(next);
|
||||
|
||||
if (next)
|
||||
consume_skb(skb);
|
||||
|
||||
skb_list_walk_safe(next, tmp, next) {
|
||||
memcpy(tmp->cb, cb, sizeof(tmp->cb));
|
||||
/*
|
||||
* Compute the length of all the data added for the A-MSDU.
|
||||
* This will be used to compute the length to write in the TX
|
||||
* command. We have: SNAP + IP + TCP for n -1 subframes and
|
||||
* ETH header for n subframes.
|
||||
*/
|
||||
tcp_payload_len = skb_tail_pointer(tmp) -
|
||||
skb_transport_header(tmp) -
|
||||
tcp_hdrlen(tmp) + tmp->data_len;
|
||||
|
||||
if (ipv4)
|
||||
ip_hdr(tmp)->id = htons(ip_base_id + i * num_subframes);
|
||||
|
||||
if (tcp_payload_len > mss) {
|
||||
skb_shinfo(tmp)->gso_size = mss;
|
||||
skb_shinfo(tmp)->gso_type = ipv4 ? SKB_GSO_TCPV4 :
|
||||
SKB_GSO_TCPV6;
|
||||
} else {
|
||||
if (qos) {
|
||||
u8 *qc;
|
||||
|
||||
if (ipv4)
|
||||
ip_send_check(ip_hdr(tmp));
|
||||
|
||||
qc = ieee80211_get_qos_ctl((void *)tmp->data);
|
||||
*qc &= ~IEEE80211_QOS_CTL_A_MSDU_PRESENT;
|
||||
}
|
||||
skb_shinfo(tmp)->gso_size = 0;
|
||||
}
|
||||
|
||||
skb_mark_not_on_list(tmp);
|
||||
__skb_queue_tail(mpdus_skbs, tmp);
|
||||
i++;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
IWL_EXPORT_SYMBOL(iwl_tx_tso_segment);
|
||||
#endif /* CONFIG_INET */
|
||||
@@ -0,0 +1,56 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause */
|
||||
/*
|
||||
* Copyright (C) 2024 Intel Corporation
|
||||
*/
|
||||
#ifndef __iwl_utils_h__
|
||||
#define __iwl_utils_h__
|
||||
|
||||
#include <net/cfg80211.h>
|
||||
|
||||
#ifdef CONFIG_INET
|
||||
/**
|
||||
* iwl_tx_tso_segment - Segments a TSO packet into subframes for A-MSDU.
|
||||
* @skb: buffer to segment.
|
||||
* @num_subframes: number of subframes to create.
|
||||
* @netdev_flags: netdev feature flags.
|
||||
* @mpdus_skbs: list to hold the segmented subframes.
|
||||
*
|
||||
* This function segments a large TCP packet into subframes.
|
||||
* subframes are added to the mpdus_skbs list
|
||||
*
|
||||
* Returns: 0 on success and negative value on failure.
|
||||
*/
|
||||
int iwl_tx_tso_segment(struct sk_buff *skb, unsigned int num_subframes,
|
||||
netdev_features_t netdev_flags,
|
||||
struct sk_buff_head *mpdus_skbs);
|
||||
#else
|
||||
static inline
|
||||
int iwl_tx_tso_segment(struct sk_buff *skb, unsigned int num_subframes,
|
||||
netdev_features_t netdev_flags,
|
||||
struct sk_buff_head *mpdus_skbs)
|
||||
{
|
||||
WARN_ON(1);
|
||||
|
||||
return -1;
|
||||
}
|
||||
#endif /* CONFIG_INET */
|
||||
|
||||
static inline
|
||||
u32 iwl_find_ie_offset(u8 *beacon, u8 eid, u32 frame_size)
|
||||
{
|
||||
struct ieee80211_mgmt *mgmt = (void *)beacon;
|
||||
const u8 *ie;
|
||||
|
||||
if (WARN_ON_ONCE(frame_size <= (mgmt->u.beacon.variable - beacon)))
|
||||
return 0;
|
||||
|
||||
frame_size -= mgmt->u.beacon.variable - beacon;
|
||||
|
||||
ie = cfg80211_find_ie(eid, mgmt->u.beacon.variable, frame_size);
|
||||
if (!ie)
|
||||
return 0;
|
||||
|
||||
return ie - beacon;
|
||||
}
|
||||
|
||||
#endif /* __iwl_utils_h__ */
|
||||
@@ -2,7 +2,7 @@
|
||||
/*
|
||||
* Copyright (C) 2012-2014, 2020 Intel Corporation
|
||||
* Copyright (C) 2016 Intel Deutschland GmbH
|
||||
* Copyright (C) 2022 Intel Corporation
|
||||
* Copyright (C) 2022, 2024 Intel Corporation
|
||||
*/
|
||||
#include <net/mac80211.h>
|
||||
#include "fw-api.h"
|
||||
@@ -158,9 +158,8 @@ int iwl_mvm_binding_remove_vif(struct iwl_mvm *mvm, struct ieee80211_vif *vif)
|
||||
ret = iwl_mvm_binding_update(mvm, vif, mvmvif->deflink.phy_ctxt,
|
||||
false);
|
||||
|
||||
if (!ret)
|
||||
if (iwl_mvm_sf_update(mvm, vif, true))
|
||||
IWL_ERR(mvm, "Failed to update SF state\n");
|
||||
if (!ret && iwl_mvm_sf_update(mvm, vif, true))
|
||||
IWL_ERR(mvm, "Failed to update SF state\n");
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -530,18 +530,15 @@ static void iwl_mvm_bt_coex_notif_iterator(void *_data, u8 *mac,
|
||||
struct ieee80211_vif *vif)
|
||||
{
|
||||
struct iwl_mvm *mvm = _data;
|
||||
struct ieee80211_bss_conf *link_conf;
|
||||
unsigned int link_id;
|
||||
|
||||
lockdep_assert_held(&mvm->mutex);
|
||||
|
||||
if (vif->type != NL80211_IFTYPE_STATION)
|
||||
return;
|
||||
|
||||
for (int link_id = 0;
|
||||
link_id < IEEE80211_MLD_MAX_NUM_LINKS;
|
||||
link_id++) {
|
||||
struct ieee80211_bss_conf *link_conf =
|
||||
rcu_dereference_check(vif->link_conf[link_id],
|
||||
lockdep_is_held(&mvm->mutex));
|
||||
for_each_vif_active_link(vif, link_conf, link_id) {
|
||||
struct ieee80211_chanctx_conf *chanctx_conf =
|
||||
rcu_dereference_check(link_conf->chanctx_conf,
|
||||
lockdep_is_held(&mvm->mutex));
|
||||
|
||||
@@ -1395,13 +1395,6 @@ static int __iwl_mvm_suspend(struct ieee80211_hw *hw,
|
||||
if (ret < 0) {
|
||||
iwl_mvm_free_nd(mvm);
|
||||
|
||||
if (!unified_image) {
|
||||
if (mvm->fw_restart > 0) {
|
||||
mvm->fw_restart--;
|
||||
ieee80211_restart_hw(mvm->hw);
|
||||
}
|
||||
}
|
||||
|
||||
clear_bit(IWL_MVM_STATUS_IN_D3, &mvm->status);
|
||||
}
|
||||
out_noreset:
|
||||
@@ -2498,12 +2491,6 @@ static void iwl_mvm_parse_wowlan_info_notif(struct iwl_mvm *mvm,
|
||||
u32 expected_len = sizeof(*data) +
|
||||
data->num_mlo_link_keys * sizeof(status->mlo_keys[0]);
|
||||
|
||||
if (!data) {
|
||||
IWL_ERR(mvm, "iwl_wowlan_info_notif data is NULL\n");
|
||||
status = NULL;
|
||||
return;
|
||||
}
|
||||
|
||||
if (len < expected_len) {
|
||||
IWL_ERR(mvm, "Invalid WoWLAN info notification!\n");
|
||||
status = NULL;
|
||||
@@ -2555,12 +2542,6 @@ iwl_mvm_parse_wowlan_info_notif_v4(struct iwl_mvm *mvm,
|
||||
u32 i;
|
||||
u32 expected_len = sizeof(*data);
|
||||
|
||||
if (!data) {
|
||||
IWL_ERR(mvm, "iwl_wowlan_info_notif data is NULL\n");
|
||||
status = NULL;
|
||||
return;
|
||||
}
|
||||
|
||||
if (has_mlo_keys)
|
||||
expected_len += (data->num_mlo_link_keys *
|
||||
sizeof(status->mlo_keys[0]));
|
||||
@@ -2609,12 +2590,6 @@ iwl_mvm_parse_wowlan_info_notif_v2(struct iwl_mvm *mvm,
|
||||
{
|
||||
u32 i;
|
||||
|
||||
if (!data) {
|
||||
IWL_ERR(mvm, "iwl_wowlan_info_notif data is NULL\n");
|
||||
status = NULL;
|
||||
return;
|
||||
}
|
||||
|
||||
if (len < sizeof(*data)) {
|
||||
IWL_ERR(mvm, "Invalid WoWLAN info notification!\n");
|
||||
status = NULL;
|
||||
@@ -3541,6 +3516,7 @@ static int __iwl_mvm_resume(struct iwl_mvm *mvm, bool test)
|
||||
iwl_fw_dbg_read_d3_debug_data(&mvm->fwrt);
|
||||
|
||||
if (iwl_mvm_check_rt_status(mvm, vif)) {
|
||||
IWL_ERR(mvm, "FW Error occurred during suspend. Restarting.\n");
|
||||
set_bit(STATUS_FW_ERROR, &mvm->trans->status);
|
||||
iwl_mvm_dump_nic_error_log(mvm);
|
||||
iwl_dbg_tlv_time_point(&mvm->fwrt,
|
||||
@@ -3713,8 +3689,7 @@ int iwl_mvm_fast_resume(struct iwl_mvm *mvm)
|
||||
iwl_fw_dbg_read_d3_debug_data(&mvm->fwrt);
|
||||
|
||||
if (iwl_mvm_check_rt_status(mvm, NULL)) {
|
||||
IWL_ERR(mvm,
|
||||
"iwl_mvm_check_rt_status failed, device is gone during suspend\n");
|
||||
IWL_ERR(mvm, "FW Error occurred during suspend. Restarting.\n");
|
||||
set_bit(STATUS_FW_ERROR, &mvm->trans->status);
|
||||
iwl_mvm_dump_nic_error_log(mvm);
|
||||
iwl_dbg_tlv_time_point(&mvm->fwrt,
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
#include "debugfs.h"
|
||||
#include "iwl-modparams.h"
|
||||
#include "iwl-drv.h"
|
||||
#include "iwl-utils.h"
|
||||
#include "fw/error-dump.h"
|
||||
#include "fw/api/phy-ctxt.h"
|
||||
|
||||
@@ -462,7 +463,6 @@ static ssize_t iwl_dbgfs_amsdu_len_write(struct ieee80211_link_sta *link_sta,
|
||||
if (amsdu_len) {
|
||||
mvm_link_sta->orig_amsdu_len = link_sta->agg.max_amsdu_len;
|
||||
link_sta->agg.max_amsdu_len = amsdu_len;
|
||||
link_sta->agg.max_amsdu_len = amsdu_len;
|
||||
for (i = 0; i < ARRAY_SIZE(link_sta->agg.max_tid_amsdu_len); i++)
|
||||
link_sta->agg.max_tid_amsdu_len[i] = amsdu_len;
|
||||
} else {
|
||||
@@ -537,43 +537,12 @@ static ssize_t iwl_dbgfs_disable_power_off_write(struct iwl_mvm *mvm, char *buf,
|
||||
return ret ?: count;
|
||||
}
|
||||
|
||||
static ssize_t iwl_dbgfs_fw_ver_read(struct file *file, char __user *user_buf,
|
||||
size_t count, loff_t *ppos)
|
||||
{
|
||||
struct iwl_mvm *mvm = file->private_data;
|
||||
char *buff, *pos, *endpos;
|
||||
static const size_t bufsz = 1024;
|
||||
int ret;
|
||||
|
||||
buff = kmalloc(bufsz, GFP_KERNEL);
|
||||
if (!buff)
|
||||
return -ENOMEM;
|
||||
|
||||
pos = buff;
|
||||
endpos = pos + bufsz;
|
||||
|
||||
pos += scnprintf(pos, endpos - pos, "FW id: %s\n",
|
||||
mvm->fwrt.fw->fw_version);
|
||||
pos += scnprintf(pos, endpos - pos, "FW: %s\n",
|
||||
mvm->fwrt.fw->human_readable);
|
||||
pos += scnprintf(pos, endpos - pos, "Device: %s\n",
|
||||
mvm->fwrt.trans->name);
|
||||
pos += scnprintf(pos, endpos - pos, "Bus: %s\n",
|
||||
mvm->fwrt.dev->bus->name);
|
||||
|
||||
ret = simple_read_from_buffer(user_buf, count, ppos, buff, pos - buff);
|
||||
kfree(buff);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
static ssize_t iwl_dbgfs_tas_get_status_read(struct file *file,
|
||||
char __user *user_buf,
|
||||
size_t count, loff_t *ppos)
|
||||
{
|
||||
struct iwl_mvm *mvm = file->private_data;
|
||||
struct iwl_mvm_tas_status_resp tas_rsp;
|
||||
struct iwl_mvm_tas_status_resp *rsp = &tas_rsp;
|
||||
struct iwl_mvm_tas_status_resp *rsp = NULL;
|
||||
static const size_t bufsz = 1024;
|
||||
char *buff, *pos, *endpos;
|
||||
const char * const tas_dis_reason[TAS_DISABLED_REASON_MAX] = {
|
||||
@@ -609,6 +578,10 @@ static ssize_t iwl_dbgfs_tas_get_status_read(struct file *file,
|
||||
if (!iwl_mvm_firmware_running(mvm))
|
||||
return -ENODEV;
|
||||
|
||||
if (iwl_fw_lookup_notif_ver(mvm->fw, DEBUG_GROUP, GET_TAS_STATUS,
|
||||
0) != 3)
|
||||
return -EOPNOTSUPP;
|
||||
|
||||
mutex_lock(&mvm->mutex);
|
||||
ret = iwl_mvm_send_cmd(mvm, &hcmd);
|
||||
mutex_unlock(&mvm->mutex);
|
||||
@@ -659,6 +632,14 @@ static ssize_t iwl_dbgfs_tas_get_status_read(struct file *file,
|
||||
rsp->tas_fw_version);
|
||||
pos += scnprintf(pos, endpos - pos, "Is UHB enabled for USA?: %s\n",
|
||||
rsp->is_uhb_for_usa_enable ? "True" : "False");
|
||||
|
||||
if (fw_has_capa(&mvm->fw->ucode_capa,
|
||||
IWL_UCODE_TLV_CAPA_UHB_CANADA_TAS_SUPPORT))
|
||||
pos += scnprintf(pos, endpos - pos,
|
||||
"Is UHB enabled for CANADA?: %s\n",
|
||||
rsp->uhb_allowed_flags &
|
||||
TAS_UHB_ALLOWED_CANADA ? "True" : "False");
|
||||
|
||||
pos += scnprintf(pos, endpos - pos, "Current MCC: 0x%x\n",
|
||||
le16_to_cpu(rsp->curr_mcc));
|
||||
|
||||
@@ -1159,10 +1140,6 @@ static ssize_t iwl_dbgfs_fw_restart_write(struct iwl_mvm *mvm, char *buf,
|
||||
|
||||
mutex_lock(&mvm->mutex);
|
||||
|
||||
/* allow one more restart that we're provoking here */
|
||||
if (mvm->fw_restart >= 0)
|
||||
mvm->fw_restart++;
|
||||
|
||||
if (count == 6 && !strcmp(buf, "nolog\n")) {
|
||||
set_bit(IWL_MVM_STATUS_SUPPRESS_ERROR_LOG_ONCE, &mvm->status);
|
||||
set_bit(STATUS_SUPPRESS_CMD_ERROR_ONCE, &mvm->trans->status);
|
||||
@@ -1409,9 +1386,9 @@ static int _iwl_dbgfs_inject_beacon_ie(struct iwl_mvm *mvm, char *bin, int len)
|
||||
|
||||
if (iwl_fw_lookup_cmd_ver(mvm->fw,
|
||||
BEACON_TEMPLATE_CMD, 0) >= 14) {
|
||||
u32 offset = iwl_mvm_find_ie_offset(beacon->data,
|
||||
WLAN_EID_S1G_TWT,
|
||||
beacon->len);
|
||||
u32 offset = iwl_find_ie_offset(beacon->data,
|
||||
WLAN_EID_S1G_TWT,
|
||||
beacon->len);
|
||||
|
||||
beacon_cmd.btwt_offset = cpu_to_le32(offset);
|
||||
}
|
||||
@@ -1495,22 +1472,6 @@ static ssize_t iwl_dbgfs_fw_dbg_conf_write(struct iwl_mvm *mvm,
|
||||
return ret ?: count;
|
||||
}
|
||||
|
||||
static ssize_t iwl_dbgfs_fw_dbg_collect_write(struct iwl_mvm *mvm,
|
||||
char *buf, size_t count,
|
||||
loff_t *ppos)
|
||||
{
|
||||
if (count == 0)
|
||||
return 0;
|
||||
|
||||
iwl_dbg_tlv_time_point(&mvm->fwrt, IWL_FW_INI_TIME_POINT_USER_TRIGGER,
|
||||
NULL);
|
||||
|
||||
iwl_fw_dbg_collect(&mvm->fwrt, FW_DBG_TRIGGER_USER, buf,
|
||||
(count - 1), NULL);
|
||||
|
||||
return count;
|
||||
}
|
||||
|
||||
static ssize_t iwl_dbgfs_fw_dbg_clear_write(struct iwl_mvm *mvm,
|
||||
char *buf, size_t count,
|
||||
loff_t *ppos)
|
||||
@@ -1964,14 +1925,12 @@ MVM_DEBUGFS_READ_WRITE_FILE_OPS(disable_power_off, 64);
|
||||
MVM_DEBUGFS_READ_FILE_OPS(fw_rx_stats);
|
||||
MVM_DEBUGFS_READ_FILE_OPS(drv_rx_stats);
|
||||
MVM_DEBUGFS_READ_FILE_OPS(fw_system_stats);
|
||||
MVM_DEBUGFS_READ_FILE_OPS(fw_ver);
|
||||
MVM_DEBUGFS_READ_FILE_OPS(phy_integration_ver);
|
||||
MVM_DEBUGFS_READ_FILE_OPS(tas_get_status);
|
||||
MVM_DEBUGFS_WRITE_FILE_OPS(fw_restart, 10);
|
||||
MVM_DEBUGFS_WRITE_FILE_OPS(fw_nmi, 10);
|
||||
MVM_DEBUGFS_READ_WRITE_FILE_OPS(scan_ant_rxchain, 8);
|
||||
MVM_DEBUGFS_READ_WRITE_FILE_OPS(fw_dbg_conf, 8);
|
||||
MVM_DEBUGFS_WRITE_FILE_OPS(fw_dbg_collect, 64);
|
||||
MVM_DEBUGFS_WRITE_FILE_OPS(fw_dbg_clear, 64);
|
||||
MVM_DEBUGFS_WRITE_FILE_OPS(dbg_time_point, 64);
|
||||
MVM_DEBUGFS_WRITE_FILE_OPS(indirection_tbl,
|
||||
@@ -2164,7 +2123,6 @@ void iwl_mvm_dbgfs_register(struct iwl_mvm *mvm)
|
||||
MVM_DEBUGFS_ADD_FILE(force_ctkill, mvm->debugfs_dir, 0200);
|
||||
MVM_DEBUGFS_ADD_FILE(stations, mvm->debugfs_dir, 0400);
|
||||
MVM_DEBUGFS_ADD_FILE(disable_power_off, mvm->debugfs_dir, 0600);
|
||||
MVM_DEBUGFS_ADD_FILE(fw_ver, mvm->debugfs_dir, 0400);
|
||||
MVM_DEBUGFS_ADD_FILE(fw_rx_stats, mvm->debugfs_dir, 0400);
|
||||
MVM_DEBUGFS_ADD_FILE(drv_rx_stats, mvm->debugfs_dir, 0400);
|
||||
MVM_DEBUGFS_ADD_FILE(fw_system_stats, mvm->debugfs_dir, 0400);
|
||||
@@ -2173,7 +2131,6 @@ void iwl_mvm_dbgfs_register(struct iwl_mvm *mvm)
|
||||
MVM_DEBUGFS_ADD_FILE(scan_ant_rxchain, mvm->debugfs_dir, 0600);
|
||||
MVM_DEBUGFS_ADD_FILE(prph_reg, mvm->debugfs_dir, 0600);
|
||||
MVM_DEBUGFS_ADD_FILE(fw_dbg_conf, mvm->debugfs_dir, 0600);
|
||||
MVM_DEBUGFS_ADD_FILE(fw_dbg_collect, mvm->debugfs_dir, 0200);
|
||||
MVM_DEBUGFS_ADD_FILE(fw_dbg_clear, mvm->debugfs_dir, 0200);
|
||||
MVM_DEBUGFS_ADD_FILE(dbg_time_point, mvm->debugfs_dir, 0200);
|
||||
MVM_DEBUGFS_ADD_FILE(send_echo_cmd, mvm->debugfs_dir, 0200);
|
||||
|
||||
@@ -642,7 +642,8 @@ static int iwl_run_unified_mvm_ucode(struct iwl_mvm *mvm)
|
||||
/* if we needed reset then fail here, but notify and remove */
|
||||
if (mvm->fw_product_reset) {
|
||||
iwl_mei_alive_notif(false);
|
||||
iwl_trans_pcie_remove(mvm->trans, true);
|
||||
iwl_trans_pcie_reset(mvm->trans,
|
||||
IWL_RESET_MODE_RESCAN);
|
||||
}
|
||||
|
||||
goto error;
|
||||
@@ -1093,36 +1094,40 @@ static int iwl_mvm_ppag_init(struct iwl_mvm *mvm)
|
||||
return iwl_mvm_ppag_send_cmd(mvm);
|
||||
}
|
||||
|
||||
static bool iwl_mvm_add_to_tas_block_list(__le32 *list, __le32 *le_size, unsigned int mcc)
|
||||
static bool
|
||||
iwl_mvm_add_to_tas_block_list(u16 *list, u8 *size, u16 mcc)
|
||||
{
|
||||
int i;
|
||||
u32 size = le32_to_cpu(*le_size);
|
||||
|
||||
/* Verify that there is room for another country */
|
||||
if (size >= IWL_WTAS_BLACK_LIST_MAX)
|
||||
if (*size >= IWL_WTAS_BLACK_LIST_MAX)
|
||||
return false;
|
||||
|
||||
for (i = 0; i < size; i++) {
|
||||
if (list[i] == cpu_to_le32(mcc))
|
||||
for (u8 i = 0; i < *size; i++) {
|
||||
if (list[i] == mcc)
|
||||
return true;
|
||||
}
|
||||
|
||||
list[size++] = cpu_to_le32(mcc);
|
||||
*le_size = cpu_to_le32(size);
|
||||
list[*size++] = mcc;
|
||||
return true;
|
||||
}
|
||||
|
||||
static void iwl_mvm_tas_init(struct iwl_mvm *mvm)
|
||||
{
|
||||
u32 cmd_id = WIDE_ID(REGULATORY_AND_NVM_GROUP, TAS_CONFIG);
|
||||
int ret;
|
||||
int fw_ver = iwl_fw_lookup_cmd_ver(mvm->fw, cmd_id,
|
||||
IWL_FW_CMD_VER_UNKNOWN);
|
||||
struct iwl_tas_selection_data selection_data = {};
|
||||
struct iwl_tas_config_cmd_v2_v4 cmd_v2_v4 = {};
|
||||
struct iwl_tas_config_cmd cmd_v5 = {};
|
||||
struct iwl_tas_data data = {};
|
||||
struct iwl_tas_config_cmd cmd = {};
|
||||
int cmd_size, fw_ver;
|
||||
void *cmd_data = &cmd_v2_v4;
|
||||
int cmd_size;
|
||||
int ret;
|
||||
|
||||
BUILD_BUG_ON(ARRAY_SIZE(data.block_list_array) !=
|
||||
IWL_WTAS_BLACK_LIST_MAX);
|
||||
BUILD_BUG_ON(ARRAY_SIZE(cmd.common.block_list_array) !=
|
||||
BUILD_BUG_ON(ARRAY_SIZE(cmd_v2_v4.common.block_list_array) !=
|
||||
IWL_WTAS_BLACK_LIST_MAX);
|
||||
BUILD_BUG_ON(ARRAY_SIZE(cmd_v5.block_list_array) !=
|
||||
IWL_WTAS_BLACK_LIST_MAX);
|
||||
|
||||
if (!fw_has_capa(&mvm->fw->ucode_capa, IWL_UCODE_TLV_CAPA_TAS_CFG)) {
|
||||
@@ -1138,7 +1143,7 @@ static void iwl_mvm_tas_init(struct iwl_mvm *mvm)
|
||||
return;
|
||||
}
|
||||
|
||||
if (ret == 0)
|
||||
if (ret == 0 && fw_ver < 5)
|
||||
return;
|
||||
|
||||
if (!iwl_is_tas_approved()) {
|
||||
@@ -1161,27 +1166,49 @@ static void iwl_mvm_tas_init(struct iwl_mvm *mvm)
|
||||
dmi_get_system_info(DMI_SYS_VENDOR) ?: "<unknown>");
|
||||
}
|
||||
|
||||
fw_ver = iwl_fw_lookup_cmd_ver(mvm->fw, cmd_id,
|
||||
IWL_FW_CMD_VER_UNKNOWN);
|
||||
|
||||
memcpy(&cmd.common, &data, sizeof(struct iwl_tas_config_cmd_common));
|
||||
|
||||
/* Set v3 or v4 specific parts. will be trunctated for fw_ver < 3 */
|
||||
if (fw_ver == 4) {
|
||||
cmd.v4.override_tas_iec = data.override_tas_iec;
|
||||
cmd.v4.enable_tas_iec = data.enable_tas_iec;
|
||||
cmd.v4.usa_tas_uhb_allowed = data.usa_tas_uhb_allowed;
|
||||
} else {
|
||||
cmd.v3.override_tas_iec = cpu_to_le16(data.override_tas_iec);
|
||||
cmd.v3.enable_tas_iec = cpu_to_le16(data.enable_tas_iec);
|
||||
if (fw_ver < 5) {
|
||||
selection_data = iwl_parse_tas_selection(data.tas_selection,
|
||||
data.table_revision);
|
||||
cmd_v2_v4.common.block_list_size =
|
||||
cpu_to_le32(data.block_list_size);
|
||||
for (u8 i = 0; i < data.block_list_size; i++)
|
||||
cmd_v2_v4.common.block_list_array[i] =
|
||||
cpu_to_le32(data.block_list_array[i]);
|
||||
}
|
||||
|
||||
cmd_size = sizeof(struct iwl_tas_config_cmd_common);
|
||||
if (fw_ver >= 3)
|
||||
/* v4 is the same size as v3 */
|
||||
cmd_size += sizeof(struct iwl_tas_config_cmd_v3);
|
||||
if (fw_ver == 5) {
|
||||
cmd_size = sizeof(cmd_v5);
|
||||
cmd_data = &cmd_v5;
|
||||
cmd_v5.block_list_size = cpu_to_le16(data.block_list_size);
|
||||
for (u16 i = 0; i < data.block_list_size; i++)
|
||||
cmd_v5.block_list_array[i] =
|
||||
cpu_to_le16(data.block_list_array[i]);
|
||||
cmd_v5.tas_config_info.table_source = data.table_source;
|
||||
cmd_v5.tas_config_info.table_revision = data.table_revision;
|
||||
cmd_v5.tas_config_info.value = cpu_to_le32(data.tas_selection);
|
||||
} else if (fw_ver == 4) {
|
||||
cmd_size = sizeof(cmd_v2_v4.common) + sizeof(cmd_v2_v4.v4);
|
||||
cmd_v2_v4.v4.override_tas_iec = selection_data.override_tas_iec;
|
||||
cmd_v2_v4.v4.enable_tas_iec = selection_data.enable_tas_iec;
|
||||
cmd_v2_v4.v4.usa_tas_uhb_allowed =
|
||||
selection_data.usa_tas_uhb_allowed;
|
||||
if (fw_has_capa(&mvm->fw->ucode_capa,
|
||||
IWL_UCODE_TLV_CAPA_UHB_CANADA_TAS_SUPPORT) &&
|
||||
selection_data.canada_tas_uhb_allowed)
|
||||
cmd_v2_v4.v4.uhb_allowed_flags = TAS_UHB_ALLOWED_CANADA;
|
||||
} else if (fw_ver == 3) {
|
||||
cmd_size = sizeof(cmd_v2_v4.common) + sizeof(cmd_v2_v4.v3);
|
||||
cmd_v2_v4.v3.override_tas_iec =
|
||||
cpu_to_le16(selection_data.override_tas_iec);
|
||||
cmd_v2_v4.v3.enable_tas_iec =
|
||||
cpu_to_le16(selection_data.enable_tas_iec);
|
||||
} else if (fw_ver == 2) {
|
||||
cmd_size = sizeof(cmd_v2_v4.common);
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
|
||||
ret = iwl_mvm_send_cmd_pdu(mvm, cmd_id, 0, cmd_size, &cmd);
|
||||
ret = iwl_mvm_send_cmd_pdu(mvm, cmd_id, 0, cmd_size, cmd_data);
|
||||
if (ret < 0)
|
||||
IWL_DEBUG_RADIO(mvm, "failed to send TAS_CONFIG (%d)\n", ret);
|
||||
}
|
||||
|
||||
@@ -412,9 +412,8 @@ int iwl_mvm_remove_link(struct iwl_mvm *mvm, struct ieee80211_vif *vif,
|
||||
|
||||
ret = iwl_mvm_link_cmd_send(mvm, &cmd, FW_CTXT_ACTION_REMOVE);
|
||||
|
||||
if (!ret)
|
||||
if (iwl_mvm_sf_update(mvm, vif, true))
|
||||
IWL_ERR(mvm, "Failed to update SF state\n");
|
||||
if (!ret && iwl_mvm_sf_update(mvm, vif, true))
|
||||
IWL_ERR(mvm, "Failed to update SF state\n");
|
||||
|
||||
return ret;
|
||||
}
|
||||
@@ -762,9 +761,8 @@ bool iwl_mvm_mld_valid_link_pair(struct ieee80211_vif *vif,
|
||||
iwl_mvm_esr_disallowed_with_link(mvm, vif, b, false))
|
||||
return false;
|
||||
|
||||
if (a->chandef->width != b->chandef->width ||
|
||||
!(a->chandef->chan->band == NL80211_BAND_6GHZ &&
|
||||
b->chandef->chan->band == NL80211_BAND_5GHZ))
|
||||
if (a->chandef->chan->band == b->chandef->chan->band ||
|
||||
a->chandef->width != b->chandef->width)
|
||||
ret |= IWL_MVM_ESR_EXIT_BANDWIDTH;
|
||||
|
||||
if (ret) {
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
#include "fw-api.h"
|
||||
#include "mvm.h"
|
||||
#include "time-event.h"
|
||||
#include "iwl-utils.h"
|
||||
|
||||
const u8 iwl_mvm_ac_to_tx_fifo[] = {
|
||||
IWL_MVM_TX_FIFO_VO,
|
||||
@@ -868,23 +869,6 @@ void iwl_mvm_mac_ctxt_set_tim(struct iwl_mvm *mvm,
|
||||
}
|
||||
}
|
||||
|
||||
u32 iwl_mvm_find_ie_offset(u8 *beacon, u8 eid, u32 frame_size)
|
||||
{
|
||||
struct ieee80211_mgmt *mgmt = (void *)beacon;
|
||||
const u8 *ie;
|
||||
|
||||
if (WARN_ON_ONCE(frame_size <= (mgmt->u.beacon.variable - beacon)))
|
||||
return 0;
|
||||
|
||||
frame_size -= mgmt->u.beacon.variable - beacon;
|
||||
|
||||
ie = cfg80211_find_ie(eid, mgmt->u.beacon.variable, frame_size);
|
||||
if (!ie)
|
||||
return 0;
|
||||
|
||||
return ie - beacon;
|
||||
}
|
||||
|
||||
u8 iwl_mvm_mac_ctxt_get_lowest_rate(struct iwl_mvm *mvm,
|
||||
struct ieee80211_tx_info *info,
|
||||
struct ieee80211_vif *vif)
|
||||
@@ -1078,22 +1062,23 @@ static int iwl_mvm_mac_ctxt_send_beacon_v7(struct iwl_mvm *mvm,
|
||||
beacon->data, beacon->len);
|
||||
|
||||
beacon_cmd.csa_offset =
|
||||
cpu_to_le32(iwl_mvm_find_ie_offset(beacon->data,
|
||||
WLAN_EID_CHANNEL_SWITCH,
|
||||
beacon->len));
|
||||
cpu_to_le32(iwl_find_ie_offset(beacon->data,
|
||||
WLAN_EID_CHANNEL_SWITCH,
|
||||
beacon->len));
|
||||
beacon_cmd.ecsa_offset =
|
||||
cpu_to_le32(iwl_mvm_find_ie_offset(beacon->data,
|
||||
WLAN_EID_EXT_CHANSWITCH_ANN,
|
||||
beacon->len));
|
||||
cpu_to_le32(iwl_find_ie_offset(beacon->data,
|
||||
WLAN_EID_EXT_CHANSWITCH_ANN,
|
||||
beacon->len));
|
||||
|
||||
return iwl_mvm_mac_ctxt_send_beacon_cmd(mvm, beacon, &beacon_cmd,
|
||||
sizeof(beacon_cmd));
|
||||
}
|
||||
|
||||
bool iwl_mvm_enable_fils(struct iwl_mvm *mvm,
|
||||
struct ieee80211_vif *vif,
|
||||
struct ieee80211_chanctx_conf *ctx)
|
||||
{
|
||||
if (IWL_MVM_DISABLE_AP_FILS)
|
||||
if (vif->type != NL80211_IFTYPE_AP || IWL_MVM_DISABLE_AP_FILS)
|
||||
return false;
|
||||
|
||||
if (cfg80211_channel_is_psc(ctx->def.chan))
|
||||
@@ -1122,7 +1107,7 @@ static int iwl_mvm_mac_ctxt_send_beacon_v9(struct iwl_mvm *mvm,
|
||||
ctx = rcu_dereference(link_conf->chanctx_conf);
|
||||
channel = ieee80211_frequency_to_channel(ctx->def.chan->center_freq);
|
||||
WARN_ON(channel == 0);
|
||||
if (iwl_mvm_enable_fils(mvm, ctx)) {
|
||||
if (iwl_mvm_enable_fils(mvm, vif, ctx)) {
|
||||
flags |= iwl_fw_lookup_cmd_ver(mvm->fw, BEACON_TEMPLATE_CMD,
|
||||
0) > 10 ?
|
||||
IWL_MAC_BEACON_FILS :
|
||||
@@ -1151,20 +1136,20 @@ static int iwl_mvm_mac_ctxt_send_beacon_v9(struct iwl_mvm *mvm,
|
||||
beacon->data, beacon->len);
|
||||
|
||||
beacon_cmd.csa_offset =
|
||||
cpu_to_le32(iwl_mvm_find_ie_offset(beacon->data,
|
||||
WLAN_EID_CHANNEL_SWITCH,
|
||||
beacon->len));
|
||||
cpu_to_le32(iwl_find_ie_offset(beacon->data,
|
||||
WLAN_EID_CHANNEL_SWITCH,
|
||||
beacon->len));
|
||||
beacon_cmd.ecsa_offset =
|
||||
cpu_to_le32(iwl_mvm_find_ie_offset(beacon->data,
|
||||
WLAN_EID_EXT_CHANSWITCH_ANN,
|
||||
beacon->len));
|
||||
cpu_to_le32(iwl_find_ie_offset(beacon->data,
|
||||
WLAN_EID_EXT_CHANSWITCH_ANN,
|
||||
beacon->len));
|
||||
|
||||
if (vif->type == NL80211_IFTYPE_AP &&
|
||||
iwl_fw_lookup_cmd_ver(mvm->fw, BEACON_TEMPLATE_CMD, 0) >= 14)
|
||||
beacon_cmd.btwt_offset =
|
||||
cpu_to_le32(iwl_mvm_find_ie_offset(beacon->data,
|
||||
WLAN_EID_S1G_TWT,
|
||||
beacon->len));
|
||||
cpu_to_le32(iwl_find_ie_offset(beacon->data,
|
||||
WLAN_EID_S1G_TWT,
|
||||
beacon->len));
|
||||
|
||||
return iwl_mvm_mac_ctxt_send_beacon_cmd(mvm, beacon, &beacon_cmd,
|
||||
sizeof(beacon_cmd));
|
||||
@@ -1767,7 +1752,7 @@ void iwl_mvm_rx_stored_beacon_notif(struct iwl_mvm *mvm,
|
||||
|
||||
data = sb_v2->data;
|
||||
} else {
|
||||
struct iwl_stored_beacon_notif_v3 *sb_v3 = (void *)pkt->data;
|
||||
struct iwl_stored_beacon_notif *sb_v3 = (void *)pkt->data;
|
||||
|
||||
if (pkt_len < struct_size(sb_v3, data, size))
|
||||
return;
|
||||
|
||||
@@ -1153,7 +1153,7 @@ static void iwl_mvm_cleanup_sta_iterator(void *data, struct ieee80211_sta *sta)
|
||||
* Delete the stale data to avoid issues later on.
|
||||
*/
|
||||
iwl_mvm_mld_free_sta_link(mvm, mvm_sta, mvm_link_sta,
|
||||
link_id, false);
|
||||
link_id);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1300,23 +1300,16 @@ int iwl_mvm_mac_start(struct ieee80211_hw *hw)
|
||||
|
||||
/* we are starting the mac not in error flow, and restart is enabled */
|
||||
if (!test_bit(IWL_MVM_STATUS_HW_RESTART_REQUESTED, &mvm->status) &&
|
||||
iwlwifi_mod_params.fw_restart) {
|
||||
iwlwifi_mod_params.fw_restart)
|
||||
max_retry = IWL_MAX_INIT_RETRY;
|
||||
/*
|
||||
* This will prevent mac80211 recovery flows to trigger during
|
||||
* init failures
|
||||
*/
|
||||
set_bit(IWL_MVM_STATUS_STARTING, &mvm->status);
|
||||
}
|
||||
|
||||
for (retry = 0; retry <= max_retry; retry++) {
|
||||
ret = __iwl_mvm_mac_start(mvm);
|
||||
if (!ret)
|
||||
if (ret != -ETIMEDOUT)
|
||||
break;
|
||||
|
||||
IWL_ERR(mvm, "mac start retry %d\n", retry);
|
||||
}
|
||||
clear_bit(IWL_MVM_STATUS_STARTING, &mvm->status);
|
||||
|
||||
mutex_unlock(&mvm->mutex);
|
||||
|
||||
@@ -1347,6 +1340,11 @@ static void iwl_mvm_restart_complete(struct iwl_mvm *mvm)
|
||||
iwl_mvm_teardown_tdls_peers(mvm);
|
||||
|
||||
IWL_INFO(mvm, "restart completed\n");
|
||||
iwl_trans_finish_sw_reset(mvm->trans);
|
||||
|
||||
/* no need to lock, adding in parallel would schedule too */
|
||||
if (!list_empty(&mvm->add_stream_txqs))
|
||||
schedule_work(&mvm->add_stream_wk);
|
||||
}
|
||||
|
||||
void iwl_mvm_mac_reconfig_complete(struct ieee80211_hw *hw,
|
||||
@@ -1485,11 +1483,12 @@ int iwl_mvm_set_tx_power(struct iwl_mvm *mvm,
|
||||
s16 tx_power)
|
||||
{
|
||||
u32 cmd_id = REDUCE_TX_POWER_CMD;
|
||||
u32 mac_id = iwl_mvm_vif_from_mac80211(link_conf->vif)->id;
|
||||
struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(link_conf->vif);
|
||||
u32 mac_id = mvmvif->id;
|
||||
int len;
|
||||
struct iwl_dev_tx_power_cmd_v3_v8 cmd = {
|
||||
.common.set_mode = cpu_to_le32(IWL_TX_POWER_MODE_SET_MAC),
|
||||
.common.mac_context_id = cpu_to_le32(mac_id),
|
||||
.common.set_mode = cpu_to_le32(IWL_TX_POWER_MODE_SET_LINK),
|
||||
.common.link_id = cpu_to_le32(mac_id),
|
||||
};
|
||||
struct iwl_dev_tx_power_cmd cmd_v9_v10;
|
||||
u8 cmd_ver = iwl_fw_lookup_cmd_ver(mvm->fw, cmd_id, 3);
|
||||
@@ -1500,9 +1499,16 @@ int iwl_mvm_set_tx_power(struct iwl_mvm *mvm,
|
||||
cmd.common.pwr_restriction = cpu_to_le16(u_tx_power);
|
||||
|
||||
if (cmd_ver > 8) {
|
||||
u32 link_id;
|
||||
|
||||
if (WARN_ON(!mvmvif->link[link_conf->link_id]))
|
||||
return -ENODEV;
|
||||
|
||||
link_id = mvmvif->link[link_conf->link_id]->fw_link_id;
|
||||
|
||||
/* Those fields sit on the same place for v9 and v10 */
|
||||
cmd_v9_v10.common.set_mode = cpu_to_le32(IWL_TX_POWER_MODE_SET_MAC);
|
||||
cmd_v9_v10.common.mac_context_id = cpu_to_le32(mac_id);
|
||||
cmd_v9_v10.common.set_mode = cpu_to_le32(IWL_TX_POWER_MODE_SET_LINK);
|
||||
cmd_v9_v10.common.link_id = cpu_to_le32(link_id);
|
||||
cmd_v9_v10.common.pwr_restriction = cpu_to_le16(u_tx_power);
|
||||
cmd_data = &cmd_v9_v10;
|
||||
}
|
||||
@@ -1802,6 +1808,8 @@ static int iwl_mvm_mac_add_interface(struct ieee80211_hw *hw,
|
||||
mvmvif->deflink.active = 0;
|
||||
mvmvif->link[0] = &mvmvif->deflink;
|
||||
|
||||
vif->driver_flags = IEEE80211_VIF_REMOVE_AP_AFTER_DISASSOC;
|
||||
|
||||
ret = iwl_mvm_set_link_mapping(mvm, vif, &vif->bss_conf);
|
||||
if (ret)
|
||||
goto out;
|
||||
@@ -2967,33 +2975,6 @@ static void iwl_mvm_bss_info_changed_station(struct iwl_mvm *mvm,
|
||||
&mvm->status),
|
||||
"Failed to update SF upon disassociation\n");
|
||||
|
||||
/*
|
||||
* If we get an assert during the connection (after the
|
||||
* station has been added, but before the vif is set
|
||||
* to associated), mac80211 will re-add the station and
|
||||
* then configure the vif. Since the vif is not
|
||||
* associated, we would remove the station here and
|
||||
* this would fail the recovery.
|
||||
*/
|
||||
if (!test_bit(IWL_MVM_STATUS_IN_HW_RESTART,
|
||||
&mvm->status)) {
|
||||
/* first remove remaining keys */
|
||||
iwl_mvm_sec_key_remove_ap(mvm, vif,
|
||||
&mvmvif->deflink, 0);
|
||||
|
||||
/*
|
||||
* Remove AP station now that
|
||||
* the MAC is unassoc
|
||||
*/
|
||||
ret = iwl_mvm_rm_sta_id(mvm, vif,
|
||||
mvmvif->deflink.ap_sta_id);
|
||||
if (ret)
|
||||
IWL_ERR(mvm,
|
||||
"failed to remove AP station\n");
|
||||
|
||||
mvmvif->deflink.ap_sta_id = IWL_INVALID_STA;
|
||||
}
|
||||
|
||||
/* remove quota for this interface */
|
||||
ret = iwl_mvm_update_quotas(mvm, false, NULL);
|
||||
if (ret)
|
||||
@@ -3913,7 +3894,7 @@ iwl_mvm_sta_state_notexist_to_none(struct iwl_mvm *mvm,
|
||||
|
||||
if (sta->tdls &&
|
||||
(vif->p2p ||
|
||||
iwl_mvm_tdls_sta_count(mvm, NULL) == IWL_MVM_TDLS_STA_COUNT ||
|
||||
iwl_mvm_tdls_sta_count(mvm, NULL) == IWL_TDLS_STA_COUNT ||
|
||||
iwl_mvm_phy_ctx_count(mvm) > 1)) {
|
||||
IWL_DEBUG_MAC80211(mvm, "refusing TDLS sta\n");
|
||||
return -EBUSY;
|
||||
@@ -4113,10 +4094,6 @@ iwl_mvm_sta_state_authorized_to_assoc(struct iwl_mvm *mvm,
|
||||
wiphy_work_cancel(mvm->hw->wiphy, &mvmvif->unblock_esr_tpt_wk);
|
||||
wiphy_delayed_work_cancel(mvm->hw->wiphy,
|
||||
&mvmvif->unblock_esr_tmp_non_bss_wk);
|
||||
|
||||
/* No need for the periodic statistics anymore */
|
||||
if (ieee80211_vif_is_mld(vif) && mvmvif->esr_active)
|
||||
iwl_mvm_request_periodic_system_statistics(mvm, false);
|
||||
}
|
||||
|
||||
return 0;
|
||||
@@ -5004,34 +4981,46 @@ int iwl_mvm_cancel_roc(struct ieee80211_hw *hw,
|
||||
return 0;
|
||||
}
|
||||
|
||||
struct iwl_mvm_ftm_responder_iter_data {
|
||||
bool responder;
|
||||
struct iwl_mvm_chanctx_usage_data {
|
||||
struct iwl_mvm *mvm;
|
||||
struct ieee80211_chanctx_conf *ctx;
|
||||
bool use_def;
|
||||
};
|
||||
|
||||
static void iwl_mvm_ftm_responder_chanctx_iter(void *_data, u8 *mac,
|
||||
struct ieee80211_vif *vif)
|
||||
static void iwl_mvm_chanctx_usage_iter(void *_data, u8 *mac,
|
||||
struct ieee80211_vif *vif)
|
||||
{
|
||||
struct iwl_mvm_ftm_responder_iter_data *data = _data;
|
||||
struct iwl_mvm_chanctx_usage_data *data = _data;
|
||||
struct ieee80211_bss_conf *link_conf;
|
||||
int link_id;
|
||||
|
||||
if (rcu_access_pointer(vif->bss_conf.chanctx_conf) == data->ctx &&
|
||||
vif->type == NL80211_IFTYPE_AP && vif->bss_conf.ftmr_params)
|
||||
data->responder = true;
|
||||
for_each_vif_active_link(vif, link_conf, link_id) {
|
||||
if (rcu_access_pointer(link_conf->chanctx_conf) != data->ctx)
|
||||
continue;
|
||||
|
||||
if (iwl_mvm_enable_fils(data->mvm, vif, data->ctx))
|
||||
data->use_def = true;
|
||||
|
||||
if (vif->type == NL80211_IFTYPE_AP && link_conf->ftmr_params)
|
||||
data->use_def = true;
|
||||
}
|
||||
}
|
||||
|
||||
bool iwl_mvm_is_ftm_responder_chanctx(struct iwl_mvm *mvm,
|
||||
struct ieee80211_chanctx_conf *ctx)
|
||||
struct cfg80211_chan_def *
|
||||
iwl_mvm_chanctx_def(struct iwl_mvm *mvm, struct ieee80211_chanctx_conf *ctx)
|
||||
{
|
||||
struct iwl_mvm_ftm_responder_iter_data data = {
|
||||
.responder = false,
|
||||
struct iwl_mvm_chanctx_usage_data data = {
|
||||
.mvm = mvm,
|
||||
.ctx = ctx,
|
||||
.use_def = false,
|
||||
};
|
||||
|
||||
ieee80211_iterate_active_interfaces_atomic(mvm->hw,
|
||||
IEEE80211_IFACE_ITER_NORMAL,
|
||||
iwl_mvm_ftm_responder_chanctx_iter,
|
||||
&data);
|
||||
return data.responder;
|
||||
IEEE80211_IFACE_ITER_NORMAL,
|
||||
iwl_mvm_chanctx_usage_iter,
|
||||
&data);
|
||||
|
||||
return data.use_def ? &ctx->def : &ctx->min_def;
|
||||
}
|
||||
|
||||
static int __iwl_mvm_add_chanctx(struct iwl_mvm *mvm,
|
||||
@@ -5415,7 +5404,7 @@ out_reassign:
|
||||
|
||||
out_restart:
|
||||
/* things keep failing, better restart the hw */
|
||||
iwl_mvm_nic_restart(mvm, false);
|
||||
iwl_force_nmi(mvm->trans);
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -5451,7 +5440,7 @@ out_reassign:
|
||||
|
||||
out_restart:
|
||||
/* things keep failing, better restart the hw */
|
||||
iwl_mvm_nic_restart(mvm, false);
|
||||
iwl_force_nmi(mvm->trans);
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -6278,7 +6267,7 @@ void iwl_mvm_mac_sta_statistics(struct ieee80211_hw *hw,
|
||||
|
||||
guard(mvm)(mvm);
|
||||
|
||||
if (mvmvif->deflink.ap_sta_id != mvmsta->deflink.sta_id)
|
||||
if (sta != mvmvif->ap_sta)
|
||||
return;
|
||||
|
||||
if (iwl_mvm_request_statistics(mvm, false))
|
||||
|
||||
@@ -18,6 +18,8 @@ static int iwl_mvm_mld_mac_add_interface(struct ieee80211_hw *hw,
|
||||
|
||||
mvmvif->mvm = mvm;
|
||||
|
||||
vif->driver_flags |= IEEE80211_VIF_REMOVE_AP_AFTER_DISASSOC;
|
||||
|
||||
/* Not much to do here. The stack will not allow interface
|
||||
* types or combinations that we didn't advertise, so we
|
||||
* don't really have to check the types.
|
||||
@@ -208,32 +210,6 @@ static unsigned int iwl_mvm_mld_count_active_links(struct iwl_mvm_vif *mvmvif)
|
||||
return n_active;
|
||||
}
|
||||
|
||||
static void iwl_mvm_restart_mpdu_count(struct iwl_mvm *mvm,
|
||||
struct iwl_mvm_vif *mvmvif)
|
||||
{
|
||||
struct ieee80211_sta *ap_sta = mvmvif->ap_sta;
|
||||
struct iwl_mvm_sta *mvmsta;
|
||||
|
||||
lockdep_assert_held(&mvm->mutex);
|
||||
|
||||
if (!ap_sta)
|
||||
return;
|
||||
|
||||
mvmsta = iwl_mvm_sta_from_mac80211(ap_sta);
|
||||
if (!mvmsta->mpdu_counters)
|
||||
return;
|
||||
|
||||
for (int q = 0; q < mvm->trans->num_rx_queues; q++) {
|
||||
spin_lock_bh(&mvmsta->mpdu_counters[q].lock);
|
||||
memset(mvmsta->mpdu_counters[q].per_link, 0,
|
||||
sizeof(mvmsta->mpdu_counters[q].per_link));
|
||||
mvmsta->mpdu_counters[q].window_start = jiffies;
|
||||
spin_unlock_bh(&mvmsta->mpdu_counters[q].lock);
|
||||
}
|
||||
|
||||
IWL_DEBUG_INFO(mvm, "MPDU counters are cleared\n");
|
||||
}
|
||||
|
||||
static int iwl_mvm_esr_mode_active(struct iwl_mvm *mvm,
|
||||
struct ieee80211_vif *vif)
|
||||
{
|
||||
@@ -267,16 +243,6 @@ static int iwl_mvm_esr_mode_active(struct iwl_mvm *mvm,
|
||||
else
|
||||
mvmvif->primary_link = __ffs(vif->active_links);
|
||||
|
||||
/* Needed for tracking RSSI */
|
||||
iwl_mvm_request_periodic_system_statistics(mvm, true);
|
||||
|
||||
/*
|
||||
* Restart the MPDU counters and the counting window, so when the
|
||||
* statistics arrive (which is where we look at the counters) we
|
||||
* will be at the end of the window.
|
||||
*/
|
||||
iwl_mvm_restart_mpdu_count(mvm, mvmvif);
|
||||
|
||||
iwl_dbg_tlv_time_point(&mvm->fwrt, IWL_FW_INI_TIME_ESR_LINK_UP,
|
||||
NULL);
|
||||
|
||||
@@ -323,7 +289,6 @@ __iwl_mvm_mld_assign_vif_chanctx(struct iwl_mvm *mvm,
|
||||
ret = iwl_mvm_esr_mode_active(mvm, vif);
|
||||
if (ret) {
|
||||
IWL_ERR(mvm, "failed to activate ESR mode (%d)\n", ret);
|
||||
iwl_mvm_request_periodic_system_statistics(mvm, false);
|
||||
goto out;
|
||||
}
|
||||
}
|
||||
@@ -449,11 +414,6 @@ static int iwl_mvm_esr_mode_inactive(struct iwl_mvm *mvm,
|
||||
break;
|
||||
}
|
||||
|
||||
iwl_mvm_request_periodic_system_statistics(mvm, false);
|
||||
|
||||
/* Start a new counting window */
|
||||
iwl_mvm_restart_mpdu_count(mvm, mvmvif);
|
||||
|
||||
iwl_dbg_tlv_time_point(&mvm->fwrt, IWL_FW_INI_TIME_ESR_LINK_DOWN,
|
||||
NULL);
|
||||
|
||||
@@ -831,30 +791,6 @@ static bool iwl_mvm_mld_vif_have_valid_ap_sta(struct iwl_mvm_vif *mvmvif)
|
||||
return false;
|
||||
}
|
||||
|
||||
static void iwl_mvm_mld_vif_delete_all_stas(struct iwl_mvm *mvm,
|
||||
struct ieee80211_vif *vif)
|
||||
{
|
||||
struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif);
|
||||
int i, ret;
|
||||
|
||||
if (test_bit(IWL_MVM_STATUS_IN_HW_RESTART, &mvm->status))
|
||||
return;
|
||||
|
||||
for_each_mvm_vif_valid_link(mvmvif, i) {
|
||||
struct iwl_mvm_vif_link_info *link = mvmvif->link[i];
|
||||
|
||||
if (!link)
|
||||
continue;
|
||||
|
||||
iwl_mvm_sec_key_remove_ap(mvm, vif, link, i);
|
||||
ret = iwl_mvm_mld_rm_sta_id(mvm, link->ap_sta_id);
|
||||
if (ret)
|
||||
IWL_ERR(mvm, "failed to remove AP station\n");
|
||||
|
||||
link->ap_sta_id = IWL_INVALID_STA;
|
||||
}
|
||||
}
|
||||
|
||||
static void iwl_mvm_mld_vif_cfg_changed_station(struct iwl_mvm *mvm,
|
||||
struct ieee80211_vif *vif,
|
||||
u64 changes)
|
||||
@@ -881,8 +817,13 @@ static void iwl_mvm_mld_vif_cfg_changed_station(struct iwl_mvm *mvm,
|
||||
if (vif->cfg.assoc) {
|
||||
mvmvif->session_prot_connection_loss = false;
|
||||
|
||||
/* clear statistics to get clean beacon counter */
|
||||
/*
|
||||
* Clear statistics to get clean beacon counter, and ask for
|
||||
* periodic statistics, as they are needed for link
|
||||
* selection and RX OMI decisions.
|
||||
*/
|
||||
iwl_mvm_request_statistics(mvm, true);
|
||||
iwl_mvm_request_periodic_system_statistics(mvm, true);
|
||||
iwl_mvm_sf_update(mvm, vif, false);
|
||||
iwl_mvm_power_vif_assoc(mvm, vif);
|
||||
|
||||
@@ -930,6 +871,8 @@ static void iwl_mvm_mld_vif_cfg_changed_station(struct iwl_mvm *mvm,
|
||||
} else if (iwl_mvm_mld_vif_have_valid_ap_sta(mvmvif)) {
|
||||
iwl_mvm_mei_host_disassociated(mvm);
|
||||
|
||||
iwl_mvm_request_periodic_system_statistics(mvm, false);
|
||||
|
||||
/* If update fails - SF might be running in associated
|
||||
* mode while disassociated - which is forbidden.
|
||||
*/
|
||||
@@ -938,15 +881,6 @@ static void iwl_mvm_mld_vif_cfg_changed_station(struct iwl_mvm *mvm,
|
||||
!test_bit(IWL_MVM_STATUS_HW_RESTART_REQUESTED,
|
||||
&mvm->status),
|
||||
"Failed to update SF upon disassociation\n");
|
||||
|
||||
/* If we get an assert during the connection (after the
|
||||
* station has been added, but before the vif is set
|
||||
* to associated), mac80211 will re-add the station and
|
||||
* then configure the vif. Since the vif is not
|
||||
* associated, we would remove the station here and
|
||||
* this would fail the recovery.
|
||||
*/
|
||||
iwl_mvm_mld_vif_delete_all_stas(mvm, vif);
|
||||
}
|
||||
|
||||
iwl_mvm_bss_info_changed_station_assoc(mvm, vif, changes);
|
||||
|
||||
@@ -518,14 +518,12 @@ static int iwl_mvm_mld_cfg_sta(struct iwl_mvm *mvm, struct ieee80211_sta *sta,
|
||||
void iwl_mvm_mld_free_sta_link(struct iwl_mvm *mvm,
|
||||
struct iwl_mvm_sta *mvm_sta,
|
||||
struct iwl_mvm_link_sta *mvm_sta_link,
|
||||
unsigned int link_id,
|
||||
bool is_in_fw)
|
||||
unsigned int link_id)
|
||||
{
|
||||
lockdep_assert_wiphy(mvm->hw->wiphy);
|
||||
lockdep_assert_held(&mvm->mutex);
|
||||
|
||||
RCU_INIT_POINTER(mvm->fw_id_to_mac_id[mvm_sta_link->sta_id],
|
||||
is_in_fw ? ERR_PTR(-EINVAL) : NULL);
|
||||
RCU_INIT_POINTER(mvm->fw_id_to_mac_id[mvm_sta_link->sta_id], NULL);
|
||||
RCU_INIT_POINTER(mvm->fw_id_to_link_sta[mvm_sta_link->sta_id], NULL);
|
||||
RCU_INIT_POINTER(mvm_sta->link[link_id], NULL);
|
||||
|
||||
@@ -546,7 +544,7 @@ static void iwl_mvm_mld_sta_rm_all_sta_links(struct iwl_mvm *mvm,
|
||||
if (!link)
|
||||
continue;
|
||||
|
||||
iwl_mvm_mld_free_sta_link(mvm, mvm_sta, link, link_id, false);
|
||||
iwl_mvm_mld_free_sta_link(mvm, mvm_sta, link, link_id);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -844,18 +842,11 @@ int iwl_mvm_mld_rm_sta(struct iwl_mvm *mvm, struct ieee80211_vif *vif,
|
||||
struct iwl_mvm_link_sta *mvm_link_sta =
|
||||
rcu_dereference_protected(mvm_sta->link[link_id],
|
||||
lockdep_is_held(&mvm->mutex));
|
||||
bool stay_in_fw;
|
||||
iwl_mvm_sta_del(mvm, vif, sta, link_sta);
|
||||
|
||||
stay_in_fw = iwl_mvm_sta_del(mvm, vif, sta, link_sta, &ret);
|
||||
if (ret)
|
||||
break;
|
||||
ret = iwl_mvm_mld_rm_sta_from_fw(mvm, mvm_link_sta->sta_id);
|
||||
|
||||
if (!stay_in_fw)
|
||||
ret = iwl_mvm_mld_rm_sta_from_fw(mvm,
|
||||
mvm_link_sta->sta_id);
|
||||
|
||||
iwl_mvm_mld_free_sta_link(mvm, mvm_sta, mvm_link_sta,
|
||||
link_id, stay_in_fw);
|
||||
iwl_mvm_mld_free_sta_link(mvm, mvm_sta, mvm_link_sta, link_id);
|
||||
}
|
||||
kfree(mvm_sta->mpdu_counters);
|
||||
mvm_sta->mpdu_counters = NULL;
|
||||
@@ -1122,8 +1113,7 @@ int iwl_mvm_mld_update_sta_links(struct iwl_mvm *mvm,
|
||||
if (vif->type == NL80211_IFTYPE_STATION)
|
||||
mvm_vif_link->ap_sta_id = IWL_INVALID_STA;
|
||||
|
||||
iwl_mvm_mld_free_sta_link(mvm, mvm_sta, mvm_sta_link, link_id,
|
||||
false);
|
||||
iwl_mvm_mld_free_sta_link(mvm, mvm_sta, mvm_sta_link, link_id);
|
||||
}
|
||||
|
||||
for_each_set_bit(link_id, &links_to_add, IEEE80211_MLD_MAX_NUM_LINKS) {
|
||||
@@ -1227,8 +1217,7 @@ err:
|
||||
rcu_dereference_protected(mvm_sta->link[link_id],
|
||||
lockdep_is_held(&mvm->mutex));
|
||||
|
||||
iwl_mvm_mld_free_sta_link(mvm, mvm_sta, mvm_sta_link, link_id,
|
||||
false);
|
||||
iwl_mvm_mld_free_sta_link(mvm, mvm_sta, mvm_sta_link, link_id);
|
||||
}
|
||||
|
||||
return ret;
|
||||
|
||||
@@ -103,6 +103,7 @@ struct iwl_mvm_phy_ctxt {
|
||||
u32 center_freq1;
|
||||
bool rlc_disabled;
|
||||
u32 channel_load_by_us;
|
||||
u32 channel_load_not_by_us;
|
||||
};
|
||||
|
||||
struct iwl_mvm_time_event_data {
|
||||
@@ -1174,8 +1175,6 @@ struct iwl_mvm {
|
||||
|
||||
struct ieee80211_bss_conf __rcu *link_id_to_link_conf[IWL_FW_MAX_LINK_ID + 1];
|
||||
|
||||
/* -1 for always, 0 for never, >0 for that many times */
|
||||
s8 fw_restart;
|
||||
u8 *error_recovery_buf;
|
||||
|
||||
#ifdef CONFIG_IWLWIFI_LEDS
|
||||
@@ -1401,8 +1400,6 @@ DEFINE_GUARD(mvm, struct iwl_mvm *, mutex_lock(&_T->mutex), mutex_unlock(&_T->mu
|
||||
* @IWL_MVM_STATUS_IN_D3: in D3 (or at least about to go into it)
|
||||
* @IWL_MVM_STATUS_SUPPRESS_ERROR_LOG_ONCE: suppress one error log
|
||||
* if this is set, when intentionally triggered
|
||||
* @IWL_MVM_STATUS_STARTING: starting mac,
|
||||
* used to disable restart flow while in STARTING state
|
||||
*/
|
||||
enum iwl_mvm_status {
|
||||
IWL_MVM_STATUS_HW_RFKILL,
|
||||
@@ -1414,7 +1411,6 @@ enum iwl_mvm_status {
|
||||
IWL_MVM_STATUS_FIRMWARE_RUNNING,
|
||||
IWL_MVM_STATUS_IN_D3,
|
||||
IWL_MVM_STATUS_SUPPRESS_ERROR_LOG_ONCE,
|
||||
IWL_MVM_STATUS_STARTING,
|
||||
};
|
||||
|
||||
struct iwl_mvm_csme_conn_info {
|
||||
@@ -1736,12 +1732,19 @@ static inline bool iwl_mvm_is_ctdp_supported(struct iwl_mvm *mvm)
|
||||
|
||||
static inline bool iwl_mvm_is_esr_supported(struct iwl_trans *trans)
|
||||
{
|
||||
if ((CSR_HW_RFID_TYPE(trans->hw_rf_id) == IWL_CFG_RF_TYPE_FM) &&
|
||||
!CSR_HW_RFID_IS_CDB(trans->hw_rf_id))
|
||||
if (CSR_HW_RFID_IS_CDB(trans->hw_rf_id))
|
||||
return false;
|
||||
|
||||
switch (CSR_HW_RFID_TYPE(trans->hw_rf_id)) {
|
||||
case IWL_CFG_RF_TYPE_FM:
|
||||
/* Step A doesn't support eSR */
|
||||
return CSR_HW_RFID_STEP(trans->hw_rf_id);
|
||||
|
||||
return false;
|
||||
case IWL_CFG_RF_TYPE_WH:
|
||||
case IWL_CFG_RF_TYPE_PE:
|
||||
return true;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
static inline int iwl_mvm_max_active_links(struct iwl_mvm *mvm,
|
||||
@@ -1824,7 +1827,6 @@ u8 iwl_mvm_next_antenna(struct iwl_mvm *mvm, u8 valid, u8 last_idx);
|
||||
void iwl_mvm_get_sync_time(struct iwl_mvm *mvm, int clock_type, u32 *gp2,
|
||||
u64 *boottime, ktime_t *realtime);
|
||||
u32 iwl_mvm_get_systime(struct iwl_mvm *mvm);
|
||||
u32 iwl_mvm_find_ie_offset(u8 *beacon, u8 eid, u32 frame_size);
|
||||
|
||||
/* Tx / Host Commands */
|
||||
int __must_check iwl_mvm_send_cmd(struct iwl_mvm *mvm,
|
||||
@@ -2591,7 +2593,6 @@ void iwl_mvm_tcm_add_vif(struct iwl_mvm *mvm, struct ieee80211_vif *vif);
|
||||
void iwl_mvm_tcm_rm_vif(struct iwl_mvm *mvm, struct ieee80211_vif *vif);
|
||||
u8 iwl_mvm_tcm_load_percentage(u32 airtime, u32 elapsed);
|
||||
|
||||
void iwl_mvm_nic_restart(struct iwl_mvm *mvm, bool fw_error);
|
||||
unsigned int iwl_mvm_get_wd_timeout(struct iwl_mvm *mvm,
|
||||
struct ieee80211_vif *vif);
|
||||
void iwl_mvm_connection_loss(struct iwl_mvm *mvm, struct ieee80211_vif *vif,
|
||||
@@ -2996,18 +2997,11 @@ int iwl_mvm_set_hw_timestamp(struct ieee80211_hw *hw,
|
||||
struct cfg80211_set_hw_timestamp *hwts);
|
||||
int iwl_mvm_update_mu_groups(struct iwl_mvm *mvm, struct ieee80211_vif *vif);
|
||||
bool iwl_mvm_enable_fils(struct iwl_mvm *mvm,
|
||||
struct ieee80211_vif *vif,
|
||||
struct ieee80211_chanctx_conf *ctx);
|
||||
bool iwl_mvm_is_ftm_responder_chanctx(struct iwl_mvm *mvm,
|
||||
struct ieee80211_chanctx_conf *ctx);
|
||||
|
||||
static inline struct cfg80211_chan_def *
|
||||
iwl_mvm_chanctx_def(struct iwl_mvm *mvm, struct ieee80211_chanctx_conf *ctx)
|
||||
{
|
||||
bool use_def = iwl_mvm_is_ftm_responder_chanctx(mvm, ctx) ||
|
||||
iwl_mvm_enable_fils(mvm, ctx);
|
||||
|
||||
return use_def ? &ctx->def : &ctx->min_def;
|
||||
}
|
||||
struct cfg80211_chan_def *
|
||||
iwl_mvm_chanctx_def(struct iwl_mvm *mvm, struct ieee80211_chanctx_conf *ctx);
|
||||
|
||||
void iwl_mvm_roc_duration_and_delay(struct ieee80211_vif *vif,
|
||||
u32 duration_ms,
|
||||
|
||||
@@ -208,7 +208,8 @@ static void iwl_mvm_rx_monitor_notif(struct iwl_mvm *mvm,
|
||||
if (notif->type != cpu_to_le32(IWL_DP_MON_NOTIF_TYPE_EXT_CCA))
|
||||
return;
|
||||
|
||||
vif = iwl_mvm_get_vif_by_macid(mvm, notif->mac_id);
|
||||
/* FIXME: should fetch the link and not the vif */
|
||||
vif = iwl_mvm_get_vif_by_macid(mvm, notif->link_id);
|
||||
if (!vif || vif->type != NL80211_IFTYPE_STATION)
|
||||
return;
|
||||
|
||||
@@ -408,7 +409,7 @@ static const struct iwl_rx_handlers iwl_mvm_rx_handlers[] = {
|
||||
RX_HANDLER_SYNC, struct iwl_time_event_notif),
|
||||
RX_HANDLER_GRP(MAC_CONF_GROUP, SESSION_PROTECTION_NOTIF,
|
||||
iwl_mvm_rx_session_protect_notif, RX_HANDLER_SYNC,
|
||||
struct iwl_mvm_session_prot_notif),
|
||||
struct iwl_session_prot_notif),
|
||||
RX_HANDLER(MCC_CHUB_UPDATE_CMD, iwl_mvm_rx_chub_update_mcc,
|
||||
RX_HANDLER_ASYNC_LOCKED, struct iwl_mcc_chub_notif),
|
||||
|
||||
@@ -1285,6 +1286,7 @@ iwl_op_mode_mvm_start(struct iwl_trans *trans, const struct iwl_cfg *cfg,
|
||||
size_t scan_size;
|
||||
u32 min_backoff;
|
||||
struct iwl_mvm_csme_conn_info *csme_conn_info __maybe_unused;
|
||||
int err;
|
||||
|
||||
/*
|
||||
* We use IWL_STATION_COUNT_MAX to check the validity of the station
|
||||
@@ -1302,7 +1304,7 @@ iwl_op_mode_mvm_start(struct iwl_trans *trans, const struct iwl_cfg *cfg,
|
||||
iwl_mvm_has_mld_api(fw) ? &iwl_mvm_mld_hw_ops :
|
||||
&iwl_mvm_hw_ops);
|
||||
if (!hw)
|
||||
return NULL;
|
||||
return ERR_PTR(-ENOMEM);
|
||||
|
||||
if (trans->trans_cfg->device_family >= IWL_DEVICE_FAMILY_BZ)
|
||||
max_agg = 512;
|
||||
@@ -1331,6 +1333,7 @@ iwl_op_mode_mvm_start(struct iwl_trans *trans, const struct iwl_cfg *cfg,
|
||||
iwl_mvm_get_bios_tables(mvm);
|
||||
iwl_uefi_get_sgom_table(trans, &mvm->fwrt);
|
||||
iwl_uefi_get_step_table(trans);
|
||||
iwl_bios_setup_step(trans, &mvm->fwrt);
|
||||
|
||||
mvm->init_status = 0;
|
||||
|
||||
@@ -1346,11 +1349,12 @@ iwl_op_mode_mvm_start(struct iwl_trans *trans, const struct iwl_cfg *cfg,
|
||||
trans->rx_mpdu_cmd_hdr_size =
|
||||
sizeof(struct iwl_rx_mpdu_res_start);
|
||||
|
||||
if (WARN_ON(trans->num_rx_queues > 1))
|
||||
if (WARN_ON(trans->num_rx_queues > 1)) {
|
||||
err = -EINVAL;
|
||||
goto out_free;
|
||||
}
|
||||
}
|
||||
|
||||
mvm->fw_restart = iwlwifi_mod_params.fw_restart ? -1 : 0;
|
||||
mvm->bios_enable_puncturing = iwl_uefi_get_puncturing(&mvm->fwrt);
|
||||
|
||||
if (iwl_mvm_has_new_tx_api(mvm)) {
|
||||
@@ -1424,8 +1428,10 @@ iwl_op_mode_mvm_start(struct iwl_trans *trans, const struct iwl_cfg *cfg,
|
||||
iwl_fw_lookup_notif_ver(mvm->fw, LOCATION_GROUP,
|
||||
TOF_RANGE_RESPONSE_NOTIF, 5);
|
||||
/* we only support up to version 9 */
|
||||
if (WARN_ON_ONCE(mvm->cmd_ver.range_resp > 9))
|
||||
if (WARN_ON_ONCE(mvm->cmd_ver.range_resp > 9)) {
|
||||
err = -EINVAL;
|
||||
goto out_free;
|
||||
}
|
||||
|
||||
/*
|
||||
* Populate the state variables that the transport layer needs
|
||||
@@ -1474,9 +1480,6 @@ iwl_op_mode_mvm_start(struct iwl_trans *trans, const struct iwl_cfg *cfg,
|
||||
trans->rx_mpdu_cmd = REPLY_RX_MPDU_CMD;
|
||||
trans->dbg.dest_tlv = mvm->fw->dbg.dest_tlv;
|
||||
trans->dbg.n_dest_reg = mvm->fw->dbg.n_dest_reg;
|
||||
memcpy(trans->dbg.conf_tlv, mvm->fw->dbg.conf_tlv,
|
||||
sizeof(trans->dbg.conf_tlv));
|
||||
trans->dbg.trigger_tlv = mvm->fw->dbg.trigger_tlv;
|
||||
|
||||
trans->iml = mvm->fw->iml;
|
||||
trans->iml_len = mvm->fw->iml_len;
|
||||
@@ -1488,6 +1491,7 @@ iwl_op_mode_mvm_start(struct iwl_trans *trans, const struct iwl_cfg *cfg,
|
||||
mvm->phy_db = iwl_phy_db_init(trans);
|
||||
if (!mvm->phy_db) {
|
||||
IWL_ERR(mvm, "Cannot init phy_db\n");
|
||||
err = -ENOMEM;
|
||||
goto out_free;
|
||||
}
|
||||
|
||||
@@ -1500,8 +1504,10 @@ iwl_op_mode_mvm_start(struct iwl_trans *trans, const struct iwl_cfg *cfg,
|
||||
scan_size = iwl_mvm_scan_size(mvm);
|
||||
|
||||
mvm->scan_cmd = kmalloc(scan_size, GFP_KERNEL);
|
||||
if (!mvm->scan_cmd)
|
||||
if (!mvm->scan_cmd) {
|
||||
err = -ENOMEM;
|
||||
goto out_free;
|
||||
}
|
||||
mvm->scan_cmd_size = scan_size;
|
||||
|
||||
/* invalidate ids to prevent accidental removal of sta_id 0 */
|
||||
@@ -1530,7 +1536,8 @@ iwl_op_mode_mvm_start(struct iwl_trans *trans, const struct iwl_cfg *cfg,
|
||||
|
||||
iwl_mvm_mei_scan_filter_init(&mvm->mei_scan_filter);
|
||||
|
||||
if (iwl_mvm_start_get_nvm(mvm)) {
|
||||
err = iwl_mvm_start_get_nvm(mvm);
|
||||
if (err) {
|
||||
/*
|
||||
* Getting NVM failed while CSME is the owner, but we are
|
||||
* registered to MEI, we'll get the NVM later when it'll be
|
||||
@@ -1543,7 +1550,8 @@ iwl_op_mode_mvm_start(struct iwl_trans *trans, const struct iwl_cfg *cfg,
|
||||
}
|
||||
|
||||
|
||||
if (iwl_mvm_start_post_nvm(mvm))
|
||||
err = iwl_mvm_start_post_nvm(mvm);
|
||||
if (err)
|
||||
goto out_thermal_exit;
|
||||
|
||||
return op_mode;
|
||||
@@ -1563,7 +1571,7 @@ iwl_op_mode_mvm_start(struct iwl_trans *trans, const struct iwl_cfg *cfg,
|
||||
iwl_trans_op_mode_leave(trans);
|
||||
|
||||
ieee80211_free_hw(mvm->hw);
|
||||
return NULL;
|
||||
return ERR_PTR(err);
|
||||
}
|
||||
|
||||
void iwl_mvm_stop_device(struct iwl_mvm *mvm)
|
||||
@@ -1998,28 +2006,63 @@ static void iwl_mvm_free_skb(struct iwl_op_mode *op_mode, struct sk_buff *skb)
|
||||
ieee80211_free_txskb(mvm->hw, skb);
|
||||
}
|
||||
|
||||
struct iwl_mvm_reprobe {
|
||||
struct device *dev;
|
||||
struct work_struct work;
|
||||
};
|
||||
|
||||
static void iwl_mvm_reprobe_wk(struct work_struct *wk)
|
||||
static void iwl_mvm_nic_error(struct iwl_op_mode *op_mode,
|
||||
enum iwl_fw_error_type type)
|
||||
{
|
||||
struct iwl_mvm_reprobe *reprobe;
|
||||
struct iwl_mvm *mvm = IWL_OP_MODE_GET_MVM(op_mode);
|
||||
|
||||
reprobe = container_of(wk, struct iwl_mvm_reprobe, work);
|
||||
if (device_reprobe(reprobe->dev))
|
||||
dev_err(reprobe->dev, "reprobe failed!\n");
|
||||
put_device(reprobe->dev);
|
||||
kfree(reprobe);
|
||||
module_put(THIS_MODULE);
|
||||
}
|
||||
|
||||
void iwl_mvm_nic_restart(struct iwl_mvm *mvm, bool fw_error)
|
||||
{
|
||||
iwl_abort_notification_waits(&mvm->notif_wait);
|
||||
iwl_dbg_tlv_del_timers(mvm->trans);
|
||||
|
||||
if (type == IWL_ERR_TYPE_CMD_QUEUE_FULL)
|
||||
IWL_ERR(mvm, "Command queue full!\n");
|
||||
else if (!test_bit(STATUS_TRANS_DEAD, &mvm->trans->status) &&
|
||||
!test_and_clear_bit(IWL_MVM_STATUS_SUPPRESS_ERROR_LOG_ONCE,
|
||||
&mvm->status))
|
||||
iwl_mvm_dump_nic_error_log(mvm);
|
||||
|
||||
/*
|
||||
* This should be first thing before trying to collect any
|
||||
* data to avoid endless loops if any HW error happens while
|
||||
* collecting debug data.
|
||||
* It might not actually be true that we'll restart, but the
|
||||
* setting of the bit doesn't matter if we're going to be
|
||||
* unbound either.
|
||||
*/
|
||||
if (type != IWL_ERR_TYPE_RESET_HS_TIMEOUT)
|
||||
set_bit(IWL_MVM_STATUS_HW_RESTART_REQUESTED, &mvm->status);
|
||||
}
|
||||
|
||||
static void iwl_mvm_dump_error(struct iwl_op_mode *op_mode,
|
||||
struct iwl_fw_error_dump_mode *mode)
|
||||
{
|
||||
struct iwl_mvm *mvm = IWL_OP_MODE_GET_MVM(op_mode);
|
||||
|
||||
/* if we come in from opmode we have the mutex held */
|
||||
if (mode->context == IWL_ERR_CONTEXT_FROM_OPMODE) {
|
||||
lockdep_assert_held(&mvm->mutex);
|
||||
iwl_fw_error_collect(&mvm->fwrt);
|
||||
} else {
|
||||
mutex_lock(&mvm->mutex);
|
||||
if (mode->context != IWL_ERR_CONTEXT_ABORT)
|
||||
iwl_fw_error_collect(&mvm->fwrt);
|
||||
mutex_unlock(&mvm->mutex);
|
||||
}
|
||||
}
|
||||
|
||||
static bool iwl_mvm_sw_reset(struct iwl_op_mode *op_mode,
|
||||
enum iwl_fw_error_type type)
|
||||
{
|
||||
struct iwl_mvm *mvm = IWL_OP_MODE_GET_MVM(op_mode);
|
||||
|
||||
/*
|
||||
* If the firmware crashes while we're already considering it
|
||||
* to be dead then don't ask for a restart, that cannot do
|
||||
* anything useful anyway.
|
||||
*/
|
||||
if (!test_bit(IWL_MVM_STATUS_FIRMWARE_RUNNING, &mvm->status))
|
||||
return false;
|
||||
|
||||
/*
|
||||
* This is a bit racy, but worst case we tell mac80211 about
|
||||
* a stopped/aborted scan when that was already done which
|
||||
@@ -2033,52 +2076,11 @@ void iwl_mvm_nic_restart(struct iwl_mvm *mvm, bool fw_error)
|
||||
iwl_mvm_report_scan_aborted(mvm);
|
||||
|
||||
/*
|
||||
* If we're restarting already, don't cycle restarts.
|
||||
* If INIT fw asserted, it will likely fail again.
|
||||
* If WoWLAN fw asserted, don't restart either, mac80211
|
||||
* can't recover this since we're already half suspended.
|
||||
*/
|
||||
if (!mvm->fw_restart && fw_error) {
|
||||
iwl_fw_error_collect(&mvm->fwrt, false);
|
||||
} else if (test_bit(IWL_MVM_STATUS_STARTING,
|
||||
&mvm->status)) {
|
||||
IWL_ERR(mvm, "Starting mac, retry will be triggered anyway\n");
|
||||
} else if (test_bit(IWL_MVM_STATUS_IN_HW_RESTART, &mvm->status)) {
|
||||
struct iwl_mvm_reprobe *reprobe;
|
||||
|
||||
IWL_ERR(mvm,
|
||||
"Firmware error during reconfiguration - reprobe!\n");
|
||||
|
||||
/*
|
||||
* get a module reference to avoid doing this while unloading
|
||||
* anyway and to avoid scheduling a work with code that's
|
||||
* being removed.
|
||||
*/
|
||||
if (!try_module_get(THIS_MODULE)) {
|
||||
IWL_ERR(mvm, "Module is being unloaded - abort\n");
|
||||
return;
|
||||
}
|
||||
|
||||
reprobe = kzalloc(sizeof(*reprobe), GFP_ATOMIC);
|
||||
if (!reprobe) {
|
||||
module_put(THIS_MODULE);
|
||||
return;
|
||||
}
|
||||
reprobe->dev = get_device(mvm->trans->dev);
|
||||
INIT_WORK(&reprobe->work, iwl_mvm_reprobe_wk);
|
||||
schedule_work(&reprobe->work);
|
||||
} else if (test_bit(IWL_MVM_STATUS_HW_RESTART_REQUESTED,
|
||||
&mvm->status)) {
|
||||
IWL_ERR(mvm, "HW restart already requested, but not started\n");
|
||||
} else if (mvm->fwrt.cur_fw_img == IWL_UCODE_REGULAR &&
|
||||
mvm->hw_registered &&
|
||||
!test_bit(STATUS_TRANS_DEAD, &mvm->trans->status)) {
|
||||
/* This should be first thing before trying to collect any
|
||||
* data to avoid endless loops if any HW error happens while
|
||||
* collecting debug data.
|
||||
*/
|
||||
set_bit(IWL_MVM_STATUS_HW_RESTART_REQUESTED, &mvm->status);
|
||||
|
||||
if (mvm->fwrt.cur_fw_img == IWL_UCODE_REGULAR && mvm->hw_registered) {
|
||||
if (mvm->fw->ucode_capa.error_log_size) {
|
||||
u32 src_size = mvm->fw->ucode_capa.error_log_size;
|
||||
u32 src_addr = mvm->fw->ucode_capa.error_log_addr;
|
||||
@@ -2093,57 +2095,18 @@ void iwl_mvm_nic_restart(struct iwl_mvm *mvm, bool fw_error)
|
||||
}
|
||||
}
|
||||
|
||||
iwl_fw_error_collect(&mvm->fwrt, false);
|
||||
|
||||
if (fw_error && mvm->fw_restart > 0) {
|
||||
mvm->fw_restart--;
|
||||
ieee80211_restart_hw(mvm->hw);
|
||||
} else if (mvm->fwrt.trans->dbg.restart_required) {
|
||||
if (mvm->fwrt.trans->dbg.restart_required) {
|
||||
IWL_DEBUG_INFO(mvm, "FW restart requested after debug collection\n");
|
||||
mvm->fwrt.trans->dbg.restart_required = false;
|
||||
ieee80211_restart_hw(mvm->hw);
|
||||
return true;
|
||||
} else if (mvm->trans->trans_cfg->device_family <= IWL_DEVICE_FAMILY_8000) {
|
||||
ieee80211_restart_hw(mvm->hw);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void iwl_mvm_nic_error(struct iwl_op_mode *op_mode, bool sync)
|
||||
{
|
||||
struct iwl_mvm *mvm = IWL_OP_MODE_GET_MVM(op_mode);
|
||||
|
||||
if (!test_bit(STATUS_TRANS_DEAD, &mvm->trans->status) &&
|
||||
!test_and_clear_bit(IWL_MVM_STATUS_SUPPRESS_ERROR_LOG_ONCE,
|
||||
&mvm->status))
|
||||
iwl_mvm_dump_nic_error_log(mvm);
|
||||
|
||||
if (sync) {
|
||||
iwl_fw_error_collect(&mvm->fwrt, true);
|
||||
/*
|
||||
* Currently, the only case for sync=true is during
|
||||
* shutdown, so just stop in this case. If/when that
|
||||
* changes, we need to be a bit smarter here.
|
||||
*/
|
||||
return;
|
||||
}
|
||||
|
||||
/*
|
||||
* If the firmware crashes while we're already considering it
|
||||
* to be dead then don't ask for a restart, that cannot do
|
||||
* anything useful anyway.
|
||||
*/
|
||||
if (!test_bit(IWL_MVM_STATUS_FIRMWARE_RUNNING, &mvm->status))
|
||||
return;
|
||||
|
||||
iwl_mvm_nic_restart(mvm, false);
|
||||
}
|
||||
|
||||
static void iwl_mvm_cmd_queue_full(struct iwl_op_mode *op_mode)
|
||||
{
|
||||
struct iwl_mvm *mvm = IWL_OP_MODE_GET_MVM(op_mode);
|
||||
|
||||
WARN_ON(1);
|
||||
iwl_mvm_nic_restart(mvm, true);
|
||||
return false;
|
||||
}
|
||||
|
||||
static void iwl_op_mode_mvm_time_point(struct iwl_op_mode *op_mode,
|
||||
@@ -2179,7 +2142,8 @@ static void iwl_op_mode_mvm_device_powered_off(struct iwl_op_mode *op_mode)
|
||||
.hw_rf_kill = iwl_mvm_set_hw_rfkill_state, \
|
||||
.free_skb = iwl_mvm_free_skb, \
|
||||
.nic_error = iwl_mvm_nic_error, \
|
||||
.cmd_queue_full = iwl_mvm_cmd_queue_full, \
|
||||
.dump_error = iwl_mvm_dump_error, \
|
||||
.sw_reset = iwl_mvm_sw_reset, \
|
||||
.nic_config = iwl_mvm_nic_config, \
|
||||
/* as we only register one, these MUST be common! */ \
|
||||
.start = iwl_op_mode_mvm_start, \
|
||||
|
||||
@@ -31,7 +31,7 @@ u8 iwl_mvm_get_channel_width(const struct cfg80211_chan_def *chandef)
|
||||
|
||||
/*
|
||||
* Maps the driver specific control channel position (relative to the center
|
||||
* freq) definitions to the the fw values
|
||||
* freq) definitions to the fw values
|
||||
*/
|
||||
u8 iwl_mvm_get_ctrl_pos(const struct cfg80211_chan_def *chandef)
|
||||
{
|
||||
|
||||
@@ -567,7 +567,7 @@ struct iwl_power_vifs {
|
||||
bool monitor_active;
|
||||
};
|
||||
|
||||
static void iwl_mvm_power_disable_pm_iterator(void *_data, u8* mac,
|
||||
static void iwl_mvm_power_disable_pm_iterator(void *_data, u8 *mac,
|
||||
struct ieee80211_vif *vif)
|
||||
{
|
||||
struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif);
|
||||
@@ -575,7 +575,7 @@ static void iwl_mvm_power_disable_pm_iterator(void *_data, u8* mac,
|
||||
mvmvif->pm_enabled = false;
|
||||
}
|
||||
|
||||
static void iwl_mvm_power_ps_disabled_iterator(void *_data, u8* mac,
|
||||
static void iwl_mvm_power_ps_disabled_iterator(void *_data, u8 *mac,
|
||||
struct ieee80211_vif *vif)
|
||||
{
|
||||
struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif);
|
||||
|
||||
@@ -789,6 +789,8 @@ static void iwl_mvm_handle_per_phy_stats(struct iwl_mvm *mvm,
|
||||
continue;
|
||||
mvm->phy_ctxts[i].channel_load_by_us =
|
||||
le32_to_cpu(per_phy[i].channel_load_by_us);
|
||||
mvm->phy_ctxts[i].channel_load_not_by_us =
|
||||
le32_to_cpu(per_phy[i].channel_load_not_by_us);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -962,6 +964,9 @@ iwl_mvm_stat_iterator_all_links(struct iwl_mvm *mvm,
|
||||
#define SEC_LINK_MIN_TX 3000
|
||||
#define SEC_LINK_MIN_RX 400
|
||||
|
||||
/* Accept a ~20% short window to avoid issues due to jitter */
|
||||
#define IWL_MVM_TPT_MIN_COUNT_WINDOW (IWL_MVM_TPT_COUNT_WINDOW_SEC * HZ * 4 / 5)
|
||||
|
||||
static void iwl_mvm_update_esr_mode_tpt(struct iwl_mvm *mvm)
|
||||
{
|
||||
struct ieee80211_vif *bss_vif = iwl_mvm_get_bss_vif(mvm);
|
||||
@@ -971,6 +976,7 @@ static void iwl_mvm_update_esr_mode_tpt(struct iwl_mvm *mvm)
|
||||
unsigned long sec_link_tx = 0, sec_link_rx = 0;
|
||||
u8 sec_link_tx_perc, sec_link_rx_perc;
|
||||
u8 sec_link;
|
||||
bool skip = false;
|
||||
|
||||
lockdep_assert_held(&mvm->mutex);
|
||||
|
||||
@@ -1010,13 +1016,25 @@ static void iwl_mvm_update_esr_mode_tpt(struct iwl_mvm *mvm)
|
||||
/*
|
||||
* In EMLSR we have statistics every 5 seconds, so we can reset
|
||||
* the counters upon every statistics notification.
|
||||
* The FW sends the notification regularly, but it will be
|
||||
* misaligned at the start. Skipping the measurement if it is
|
||||
* short will synchronize us.
|
||||
*/
|
||||
if (jiffies - mvmsta->mpdu_counters[q].window_start <
|
||||
IWL_MVM_TPT_MIN_COUNT_WINDOW)
|
||||
skip = true;
|
||||
mvmsta->mpdu_counters[q].window_start = jiffies;
|
||||
memset(mvmsta->mpdu_counters[q].per_link, 0,
|
||||
sizeof(mvmsta->mpdu_counters[q].per_link));
|
||||
|
||||
spin_unlock_bh(&mvmsta->mpdu_counters[q].lock);
|
||||
}
|
||||
|
||||
if (skip) {
|
||||
IWL_DEBUG_INFO(mvm, "MPDU statistics window was short\n");
|
||||
return;
|
||||
}
|
||||
|
||||
IWL_DEBUG_INFO(mvm, "total Tx MPDUs: %ld. total Rx MPDUs: %ld\n",
|
||||
total_tx, total_rx);
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user