diff options
Diffstat (limited to 'SOURCES/steamdeck-oled-wifi.patch')
-rw-r--r-- | SOURCES/steamdeck-oled-wifi.patch | 434 |
1 files changed, 13 insertions, 421 deletions
diff --git a/SOURCES/steamdeck-oled-wifi.patch b/SOURCES/steamdeck-oled-wifi.patch index 03db382..db7fe1b 100644 --- a/SOURCES/steamdeck-oled-wifi.patch +++ b/SOURCES/steamdeck-oled-wifi.patch @@ -4,8 +4,6 @@ Date: Thu, 4 Apr 2024 12:43:12 -0600 Subject: [PATCH] steamdeck-wifi --- - drivers/net/wireless/ath/ath11k/core.c | 88 ++++++++++++++++++++++++++ - drivers/net/wireless/ath/ath11k/core.h | 1 + drivers/net/wireless/ath/ath11k/hw.c | 1 + drivers/net/wireless/ath/ath11k/hw.h | 1 + drivers/net/wireless/ath/ath11k/mac.c | 86 +++++++++++++++++++------ @@ -16,166 +14,6 @@ Subject: [PATCH] steamdeck-wifi drivers/net/wireless/ath/ath11k/wmi.h | 87 +++++++++++++++++++++++++ 10 files changed, 322 insertions(+), 31 deletions(-) -diff --git a/drivers/net/wireless/ath/ath11k/core.c b/drivers/net/wireless/ath/ath11k/core.c -index 0c6ecbb9a..203e33c22 100644 ---- a/drivers/net/wireless/ath/ath11k/core.c -+++ b/drivers/net/wireless/ath/ath11k/core.c -@@ -17,6 +17,7 @@ - #include "hif.h" - #include "wow.h" - #include "fw.h" -+#include "wmi.h" - - unsigned int ath11k_debug_mask; - EXPORT_SYMBOL(ath11k_debug_mask); -@@ -122,6 +123,7 @@ static const struct ath11k_hw_params ath11k_hw_params[] = { - .tcl_ring_retry = true, - .tx_ring_size = DP_TCL_DATA_RING_SIZE, - .smp2p_wow_exit = false, -+ .coex_isolation = false, - }, - { - .hw_rev = ATH11K_HW_IPQ6018_HW10, -@@ -205,6 +207,7 @@ static const struct ath11k_hw_params ath11k_hw_params[] = { - .tx_ring_size = DP_TCL_DATA_RING_SIZE, - .smp2p_wow_exit = false, - .support_fw_mac_sequence = false, -+ .coex_isolation = false, - }, - { - .name = "qca6390 hw2.0", -@@ -372,6 +375,7 @@ static const struct ath11k_hw_params ath11k_hw_params[] = { - .tx_ring_size = DP_TCL_DATA_RING_SIZE, - .smp2p_wow_exit = false, - .support_fw_mac_sequence = false, -+ .coex_isolation = false, - }, - { - .name = "wcn6855 hw2.0", -@@ -411,6 +415,68 @@ static const struct ath11k_hw_params ath11k_hw_params[] = { - .fragment_160mhz = false, - }, - -+ .interface_modes = BIT(NL80211_IFTYPE_STATION) | -+ BIT(NL80211_IFTYPE_AP), -+ .supports_monitor = false, -+ .supports_shadow_regs = true, -+ .idle_ps = true, -+ .supports_sta_ps = true, -+ .coldboot_cal_mm = false, -+ .coldboot_cal_ftm = false, -+ .fw_mem_mode = 0, -+ .num_vdevs = 16 + 1, -+ .num_peers = 512, -+ .supports_suspend = true, -+ .hal_desc_sz = sizeof(struct hal_rx_desc_wcn6855), -+ .supports_regdb = true, -+ .fix_l1ss = false, -+ .credit_flow = true, -+ .max_tx_ring = DP_TCL_NUM_RING_MAX_QCA6390, -+ .hal_params = &ath11k_hw_hal_params_qca6390, -+ .supports_dynamic_smps_6ghz = false, -+ .alloc_cacheable_memory = false, -+ .supports_rssi_stats = true, -+ .fw_wmi_diag_event = true, -+ .current_cc_support = true, -+ .dbr_debug_support = false, -+ .coex_isolation = false, -+ }, -+ { -+ .name = "qca206x hw2.1", -+ .hw_rev = ATH11K_HW_QCA206X_HW21, -+ .fw = { -+ .dir = "QCA206X/hw2.1", -+ .board_size = 256 * 1024, -+ .cal_offset = 128 * 1024, -+ }, -+ .max_radios = 3, -+ .bdf_addr = 0x4B0C0000, -+ .hw_ops = &wcn6855_ops, -+ .ring_mask = &ath11k_hw_ring_mask_qca6390, -+ .internal_sleep_clock = true, -+ .regs = &wcn6855_regs, -+ .qmi_service_ins_id = ATH11K_QMI_WLFW_SERVICE_INS_ID_V01_QCA6390, -+ .host_ce_config = ath11k_host_ce_config_qca6390, -+ .ce_count = 9, -+ .target_ce_config = ath11k_target_ce_config_wlan_qca6390, -+ .target_ce_count = 9, -+ .svc_to_ce_map = ath11k_target_service_to_ce_map_wlan_qca6390, -+ .svc_to_ce_map_len = 14, -+ .single_pdev_only = true, -+ .rxdma1_enable = false, -+ .num_rxmda_per_pdev = 2, -+ .rx_mac_buf_ring = true, -+ .vdev_start_delay = true, -+ .htt_peer_map_v2 = false, -+ -+ .spectral = { -+ .fft_sz = 0, -+ .fft_pad_sz = 0, -+ .summary_pad_sz = 0, -+ .fft_hdr_len = 0, -+ .max_fft_bins = 0, -+ }, -+ - .interface_modes = BIT(NL80211_IFTYPE_STATION) | - BIT(NL80211_IFTYPE_AP), - .supports_monitor = false, -@@ -457,6 +523,7 @@ static const struct ath11k_hw_params ath11k_hw_params[] = { - .tx_ring_size = DP_TCL_DATA_RING_SIZE, - .smp2p_wow_exit = false, - .support_fw_mac_sequence = true, -+ .coex_isolation = false, - }, - { - .name = "wcn6855 hw2.1", -@@ -1573,6 +1640,18 @@ static void ath11k_core_pdev_destroy(struct ath11k_base *ab) - ath11k_debugfs_pdev_destroy(ab); - } - -+static int ath11k_core_config_coex_isolation(struct ath11k_base *ab) -+{ -+ struct ath11k *ar = ath11k_ab_to_ar(ab, 0); -+ struct wmi_coex_config_params param; -+ -+ memset(¶m, 0, sizeof(struct wmi_coex_config_params)); -+ param.config_type = WMI_COEX_CONFIG_ANTENNA_ISOLATION; -+ param.config_arg1 = WMI_COEX_ISOLATION_ARG1_DEFAUT; -+ -+ return ath11k_wmi_send_coex_config(ar, ¶m); -+} -+ - static int ath11k_core_start(struct ath11k_base *ab) - { - int ret; -@@ -1670,6 +1749,15 @@ static int ath11k_core_start(struct ath11k_base *ab) - goto err_reo_cleanup; - } - -+ if (ab->hw_params.coex_isolation) { -+ ret = ath11k_core_config_coex_isolation(ab); -+ if (ret) { -+ ath11k_err(ab, "failed to set coex isolation: %d\n", -+ ret); -+ goto err_reo_cleanup; -+ } -+ } -+ - return 0; - - err_reo_cleanup: -diff --git a/drivers/net/wireless/ath/ath11k/core.h b/drivers/net/wireless/ath/ath11k/core.h -index cd829ec70..ad0c86384 100644 ---- a/drivers/net/wireless/ath/ath11k/core.h -+++ b/drivers/net/wireless/ath/ath11k/core.h -@@ -147,6 +147,7 @@ enum ath11k_hw_rev { - ATH11K_HW_WCN6855_HW21, - ATH11K_HW_WCN6750_HW10, - ATH11K_HW_IPQ5018_HW10, -+ ATH11K_HW_QCA206X_HW21, - }; - - enum ath11k_firmware_mode { diff --git a/drivers/net/wireless/ath/ath11k/hw.c b/drivers/net/wireless/ath/ath11k/hw.c index 77d8f9237..409eb565d 100644 --- a/drivers/net/wireless/ath/ath11k/hw.c @@ -204,161 +42,27 @@ diff --git a/drivers/net/wireless/ath/ath11k/mac.c b/drivers/net/wireless/ath/at index cc8031008..c8409c00a 100644 --- a/drivers/net/wireless/ath/ath11k/mac.c +++ b/drivers/net/wireless/ath/ath11k/mac.c -@@ -2474,7 +2474,7 @@ static void ath11k_peer_assoc_h_he(struct ath11k *ar, +@@ -2464,7 +2464,7 @@ he_mcs_mask[i]) max_nss = i + 1; } - arg->peer_nss = min(sta->deflink.rx_nss, max_nss); + arg->peer_nss = min(arg->peer_nss, (u32)max_nss); - + if (arg->peer_phymode == MODE_11AX_HE160 || arg->peer_phymode == MODE_11AX_HE80_80) { -@@ -4713,6 +4713,7 @@ static void ath11k_sta_rc_update_wk(struct work_struct *wk) - +@@ -4714,6 +4714,7 @@ + nss = max_t(u32, 1, nss); nss = min(nss, ath11k_mac_max_nss(ht_mcs_mask, vht_mcs_mask, he_mcs_mask)); + nss = min(nss, (u32)ar->num_tx_chains); - + if (changed & IEEE80211_RC_BW_CHANGED) { /* Get the peer phymode */ -@@ -9293,6 +9294,31 @@ static int ath11k_mac_setup_channels_rates(struct ath11k *ar, - return 0; - } - -+static void ath11k_mac_setup_mac_address_list(struct ath11k *ar) -+{ -+ struct mac_address *addresses; -+ u16 n_addresses; -+ int i; -+ -+ if (!ar->ab->hw_params.single_pdev_only || ar->ab->hw_params.num_rxmda_per_pdev < 2) -+ return; -+ -+ n_addresses = 3; -+ addresses = kcalloc(n_addresses, sizeof(*addresses), GFP_KERNEL); -+ if (!addresses) -+ return; -+ -+ memcpy(addresses[0].addr, ar->mac_addr, ETH_ALEN); -+ for (i = 1; i < n_addresses; i++) { -+ memcpy(addresses[i].addr, ar->mac_addr, ETH_ALEN); -+ addresses[i].addr[0] |= 0x2; -+ addresses[i].addr[0] += (i - 1) << 4; -+ } -+ -+ ar->hw->wiphy->addresses = addresses; -+ ar->hw->wiphy->n_addresses = n_addresses; -+} -+ - static int ath11k_mac_setup_iface_combinations(struct ath11k *ar) - { - struct ath11k_base *ab = ar->ab; -@@ -9312,28 +9338,43 @@ static int ath11k_mac_setup_iface_combinations(struct ath11k *ar) - return -ENOMEM; - } - -- limits[0].max = 1; -- limits[0].types |= BIT(NL80211_IFTYPE_STATION); -+ if (ab->hw_params.single_pdev_only && ar->ab->hw_params.num_rxmda_per_pdev > 1) { -+ limits[0].max = 2; -+ limits[0].types |= BIT(NL80211_IFTYPE_STATION); - -- limits[1].max = 16; -- limits[1].types |= BIT(NL80211_IFTYPE_AP); -+ limits[1].max = 1; -+ limits[1].types |= BIT(NL80211_IFTYPE_AP); - -- if (IS_ENABLED(CONFIG_MAC80211_MESH) && -- ab->hw_params.interface_modes & BIT(NL80211_IFTYPE_MESH_POINT)) -- limits[1].types |= BIT(NL80211_IFTYPE_MESH_POINT); -- -- combinations[0].limits = limits; -- combinations[0].n_limits = n_limits; -- combinations[0].max_interfaces = 16; -- combinations[0].num_different_channels = 1; -- combinations[0].beacon_int_infra_match = true; -- combinations[0].beacon_int_min_gcd = 100; -- combinations[0].radar_detect_widths = BIT(NL80211_CHAN_WIDTH_20_NOHT) | -- BIT(NL80211_CHAN_WIDTH_20) | -- BIT(NL80211_CHAN_WIDTH_40) | -- BIT(NL80211_CHAN_WIDTH_80) | -- BIT(NL80211_CHAN_WIDTH_80P80) | -- BIT(NL80211_CHAN_WIDTH_160); -+ combinations[0].limits = limits; -+ combinations[0].n_limits = 2; -+ combinations[0].max_interfaces = 3; -+ combinations[0].num_different_channels = 2; -+ combinations[0].beacon_int_infra_match = true; -+ combinations[0].beacon_int_min_gcd = 100; -+ } else { -+ limits[0].max = 1; -+ limits[0].types |= BIT(NL80211_IFTYPE_STATION); -+ -+ limits[1].max = 16; -+ limits[1].types |= BIT(NL80211_IFTYPE_AP); -+ -+ if (IS_ENABLED(CONFIG_MAC80211_MESH) && -+ ab->hw_params.interface_modes & BIT(NL80211_IFTYPE_MESH_POINT)) -+ limits[1].types |= BIT(NL80211_IFTYPE_MESH_POINT); -+ -+ combinations[0].limits = limits; -+ combinations[0].n_limits = 2; -+ combinations[0].max_interfaces = 16; -+ combinations[0].num_different_channels = 1; -+ combinations[0].beacon_int_infra_match = true; -+ combinations[0].beacon_int_min_gcd = 100; -+ combinations[0].radar_detect_widths = BIT(NL80211_CHAN_WIDTH_20_NOHT) | -+ BIT(NL80211_CHAN_WIDTH_20) | -+ BIT(NL80211_CHAN_WIDTH_40) | -+ BIT(NL80211_CHAN_WIDTH_80) | -+ BIT(NL80211_CHAN_WIDTH_80P80) | -+ BIT(NL80211_CHAN_WIDTH_160); -+ } - - ar->hw->wiphy->iface_combinations = combinations; - ar->hw->wiphy->n_iface_combinations = 1; -@@ -9398,6 +9439,8 @@ static void __ath11k_mac_unregister(struct ath11k *ar) - kfree(ar->hw->wiphy->iface_combinations[0].limits); - kfree(ar->hw->wiphy->iface_combinations); - -+ kfree(ar->hw->wiphy->addresses); -+ - SET_IEEE80211_DEV(ar->hw, NULL); - } - -@@ -9440,6 +9483,7 @@ static int __ath11k_mac_register(struct ath11k *ar) - ath11k_pdev_caps_update(ar); - - SET_IEEE80211_PERM_ADDR(ar->hw, ar->mac_addr); -+ ath11k_mac_setup_mac_address_list(ar); - - SET_IEEE80211_DEV(ar->hw, ab->dev); - -diff --git a/drivers/net/wireless/ath/ath11k/mhi.c b/drivers/net/wireless/ath/ath11k/mhi.c -index 6835c14b8..49082cf1f 100644 ---- a/drivers/net/wireless/ath/ath11k/mhi.c -+++ b/drivers/net/wireless/ath/ath11k/mhi.c -@@ -443,6 +443,7 @@ int ath11k_mhi_register(struct ath11k_pci *ab_pci) - case ATH11K_HW_QCA6390_HW20: - case ATH11K_HW_WCN6855_HW20: - case ATH11K_HW_WCN6855_HW21: -+ case ATH11K_HW_QCA206X_HW21: - ath11k_mhi_config = &ath11k_mhi_config_qca6390; - break; - default: diff --git a/drivers/net/wireless/ath/ath11k/pci.c b/drivers/net/wireless/ath/ath11k/pci.c index 09e65c5e5..88f11f6e4 100644 --- a/drivers/net/wireless/ath/ath11k/pci.c +++ b/drivers/net/wireless/ath/ath11k/pci.c -@@ -28,6 +28,8 @@ - #define QCN9074_DEVICE_ID 0x1104 - #define WCN6855_DEVICE_ID 0x1103 - -+#define SUB_VERSION 0x1910010 -+ - static const struct pci_device_id ath11k_pci_id_table[] = { - { PCI_VDEVICE(QCOM, QCA6390_DEVICE_ID) }, - { PCI_VDEVICE(QCOM, WCN6855_DEVICE_ID) }, @@ -108,7 +110,12 @@ static u32 ath11k_pci_window_read32(struct ath11k_base *ab, u32 offset) struct ath11k_pci *ab_pci = ath11k_pci_priv(ab); u32 window_start, val; @@ -373,118 +77,6 @@ index 09e65c5e5..88f11f6e4 100644 if (window_start == ATH11K_PCI_WINDOW_START) { spin_lock_bh(&ab_pci->window_lock); -@@ -733,6 +740,8 @@ static int ath11k_pci_probe(struct pci_dev *pdev, - u32 soc_hw_version_major, soc_hw_version_minor, addr; - const struct ath11k_pci_ops *pci_ops; - int ret; -+ u32 sub_version; -+ int ops_init = 0; - - ab = ath11k_core_alloc(&pdev->dev, sizeof(*ab_pci), ATH11K_BUS_PCI); - -@@ -779,8 +788,8 @@ static int ath11k_pci_probe(struct pci_dev *pdev, - case QCA6390_DEVICE_ID: - ath11k_pci_read_hw_version(ab, &soc_hw_version_major, - &soc_hw_version_minor); -- switch (soc_hw_version_major) { -- case 2: -+ switch (soc_hw_version_major) { -+ case 2: - ab->hw_rev = ATH11K_HW_QCA6390_HW20; - break; - default: -@@ -800,6 +809,13 @@ static int ath11k_pci_probe(struct pci_dev *pdev, - ab->id.bdf_search = ATH11K_BDF_SEARCH_BUS_AND_BOARD; - ath11k_pci_read_hw_version(ab, &soc_hw_version_major, - &soc_hw_version_minor); -+ pci_ops = &ath11k_pci_ops_qca6390; -+ ret = ath11k_pcic_register_pci_ops(ab, pci_ops); -+ if (ret) { -+ ath11k_err(ab, "failed to register PCI ops: %d\n", ret); -+ goto err_pci_free_region; -+ } -+ ops_init = 1; - switch (soc_hw_version_major) { - case 2: - switch (soc_hw_version_minor) { -@@ -809,7 +825,19 @@ static int ath11k_pci_probe(struct pci_dev *pdev, - break; - case 0x10: - case 0x11: -- ab->hw_rev = ATH11K_HW_WCN6855_HW21; -+ //ab->hw_rev = ATH11K_HW_WCN6855_HW21; -+ sub_version = ath11k_pcic_read32(ab, SUB_VERSION); -+ ath11k_dbg(ab, ATH11K_DBG_PCI, "sub_version 0x%x\n", sub_version); -+ switch (sub_version) { -+ case 0x1019A0E1: -+ case 0x1019B0E1: -+ case 0x1019C0E1: -+ case 0x1019D0E1: -+ ab->hw_rev = ATH11K_HW_QCA206X_HW21; -+ break; -+ default: -+ ab->hw_rev = ATH11K_HW_WCN6855_HW21; -+ } - break; - default: - goto unsupported_wcn6855_soc; -@@ -823,7 +851,6 @@ static int ath11k_pci_probe(struct pci_dev *pdev, - goto err_pci_free_region; - } - -- pci_ops = &ath11k_pci_ops_qca6390; - break; - default: - dev_err(&pdev->dev, "Unknown PCI device found: 0x%x\n", -@@ -832,11 +859,13 @@ static int ath11k_pci_probe(struct pci_dev *pdev, - goto err_pci_free_region; - } - -- ret = ath11k_pcic_register_pci_ops(ab, pci_ops); -- if (ret) { -- ath11k_err(ab, "failed to register PCI ops: %d\n", ret); -- goto err_pci_free_region; -- } -+ if(ops_init == 1){ -+ ret = ath11k_pcic_register_pci_ops(ab, pci_ops); -+ if (ret) { -+ ath11k_err(ab, "failed to register PCI ops: %d\n", ret); -+ goto err_pci_free_region; -+ } -+ } - - ret = ath11k_pcic_init_msi_config(ab); - if (ret) { -@@ -1021,6 +1050,7 @@ static struct pci_driver ath11k_pci_driver = { - static int ath11k_pci_init(void) - { - int ret; -+ u32 sub_version; - - ret = pci_register_driver(&ath11k_pci_driver); - if (ret) -diff --git a/drivers/net/wireless/ath/ath11k/pcic.c b/drivers/net/wireless/ath/ath11k/pcic.c -index 15e2ceb22..c7b4b897d 100644 ---- a/drivers/net/wireless/ath/ath11k/pcic.c -+++ b/drivers/net/wireless/ath/ath11k/pcic.c -@@ -115,6 +115,17 @@ static const struct ath11k_msi_config ath11k_msi_config[] = { - }, - .hw_rev = ATH11K_HW_WCN6750_HW10, - }, -+ { -+ .total_vectors = 32, -+ .total_users = 4, -+ .users = (struct ath11k_msi_user[]) { -+ { .name = "MHI", .num_vectors = 3, .base_vector = 0 }, -+ { .name = "CE", .num_vectors = 10, .base_vector = 3 }, -+ { .name = "WAKE", .num_vectors = 1, .base_vector = 13 }, -+ { .name = "DP", .num_vectors = 18, .base_vector = 14 }, -+ }, -+ .hw_rev = ATH11K_HW_QCA206X_HW21, -+ }, - }; - - int ath11k_pcic_init_msi_config(struct ath11k_base *ab) diff --git a/drivers/net/wireless/ath/ath11k/wmi.c b/drivers/net/wireless/ath/ath11k/wmi.c index 442afda7e..2abf307a7 100644 --- a/drivers/net/wireless/ath/ath11k/wmi.c @@ -497,9 +89,9 @@ index 442afda7e..2abf307a7 100644 wmi_cfg->host_service_flags &= ~(1 << WMI_CFG_HOST_SERVICE_FLAG_REG_CC_EXT); wmi_cfg->host_service_flags |= (tg_cfg->is_reg_cc_ext_event_supported << -@@ -9688,3 +9689,29 @@ int ath11k_wmi_sta_keepalive(struct ath11k *ar, - - return ath11k_wmi_cmd_send(wmi, skb, WMI_STA_KEEPALIVE_CMDID); +@@ -9758,3 +9759,29 @@ + return test_bit(WMI_TLV_SERVICE_REG_CC_EXT_EVENT_SUPPORT, + ar->ab->wmi_ab.svc_map) && ar->supports_6ghz; } + +int ath11k_wmi_send_coex_config(struct ath11k *ar, @@ -555,10 +147,10 @@ index cd2098d78..7cfe0c0f5 100644 }; enum wmi_debug_log_param { -@@ -6298,6 +6308,82 @@ enum wmi_sta_keepalive_method { - - const void **ath11k_wmi_tlv_parse_alloc(struct ath11k_base *ab, const void *ptr, - size_t len, gfp_t gfp); +@@ -6344,6 +6344,82 @@ + + const void **ath11k_wmi_tlv_parse_alloc(struct ath11k_base *ab, + struct sk_buff *skb, gfp_t gfp); +enum wmi_coex_config_type { + WMI_COEX_CONFIG_PAGE_P2P_TDM = 1, + WMI_COEX_CONFIG_PAGE_STA_TDM = 2, @@ -638,7 +230,7 @@ index cd2098d78..7cfe0c0f5 100644 int ath11k_wmi_cmd_send(struct ath11k_pdev_wmi *wmi, struct sk_buff *skb, u32 cmd_id); struct sk_buff *ath11k_wmi_alloc_skb(struct ath11k_wmi_base *wmi_sc, u32 len); -@@ -6459,6 +6545,7 @@ int ath11k_wmi_scan_prob_req_oui(struct ath11k *ar, +@@ -6505,6 +6581,7 @@ const u8 mac_addr[ETH_ALEN]); int ath11k_wmi_fw_dbglog_cfg(struct ath11k *ar, u32 *module_id_bitmap, struct ath11k_fw_dbglog *dbglog); |