Loading drivers/net/wireless/ath/wil6210/cfg80211.c +2 −1 Original line number Diff line number Diff line Loading @@ -580,7 +580,8 @@ int wil_cid_fill_sinfo(struct wil6210_vif *vif, int cid, memset(&reply, 0, sizeof(reply)); rc = wmi_call(wil, WMI_NOTIFY_REQ_CMDID, vif->mid, &cmd, sizeof(cmd), WMI_NOTIFY_REQ_DONE_EVENTID, &reply, sizeof(reply), 20); WMI_NOTIFY_REQ_DONE_EVENTID, &reply, sizeof(reply), WIL_WMI_CALL_GENERAL_TO_MS); if (rc) return rc; Loading drivers/net/wireless/ath/wil6210/debugfs.c +73 −10 Original line number Diff line number Diff line Loading @@ -810,6 +810,44 @@ static const struct file_operations fops_rxon = { .open = simple_open, }; static ssize_t wil_write_file_rbufcap(struct file *file, const char __user *buf, size_t count, loff_t *ppos) { struct wil6210_priv *wil = file->private_data; int val; int rc; rc = kstrtoint_from_user(buf, count, 0, &val); if (rc) { wil_err(wil, "Invalid argument\n"); return rc; } /* input value: negative to disable, 0 to use system default, * 1..ring size to set descriptor threshold */ wil_info(wil, "%s RBUFCAP, descriptors threshold - %d\n", val < 0 ? "Disabling" : "Enabling", val); if (!wil->ring_rx.va || val > wil->ring_rx.size) { wil_err(wil, "Invalid descriptors threshold, %d\n", val); return -EINVAL; } rc = wmi_rbufcap_cfg(wil, val < 0 ? 0 : 1, val < 0 ? 0 : val); if (rc) { wil_err(wil, "RBUFCAP config failed: %d\n", rc); return rc; } return count; } static const struct file_operations fops_rbufcap = { .write = wil_write_file_rbufcap, .open = simple_open, }; /* block ack control, write: * - "add <ringid> <agg_size> <timeout>" to trigger ADDBA * - "del_tx <ringid> <reason>" to trigger DELBA for Tx side Loading Loading @@ -1364,7 +1402,7 @@ static int wil_bf_debugfs_show(struct seq_file *s, void *data) rc = wmi_call(wil, WMI_NOTIFY_REQ_CMDID, vif->mid, &cmd, sizeof(cmd), WMI_NOTIFY_REQ_DONE_EVENTID, &reply, sizeof(reply), 20); sizeof(reply), WIL_WMI_CALL_GENERAL_TO_MS); /* if reply is all-0, ignore this CID */ if (rc || is_all_zeros(&reply.evt, sizeof(reply.evt))) continue; Loading Loading @@ -1413,7 +1451,7 @@ static void print_temp(struct seq_file *s, const char *prefix, s32 t) { switch (t) { case 0: case ~(u32)0: case WMI_INVALID_TEMPERATURE: seq_printf(s, "%s N/A\n", prefix); break; default: Loading @@ -1426,17 +1464,41 @@ static void print_temp(struct seq_file *s, const char *prefix, s32 t) static int wil_temp_debugfs_show(struct seq_file *s, void *data) { struct wil6210_priv *wil = s->private; s32 t_m, t_r; int rc = wmi_get_temperature(wil, &t_m, &t_r); int rc, i; if (test_bit(WMI_FW_CAPABILITY_TEMPERATURE_ALL_RF, wil->fw_capabilities)) { struct wmi_temp_sense_all_done_event sense_all_evt; wil_dbg_misc(wil, "WMI_FW_CAPABILITY_TEMPERATURE_ALL_RF is supported"); rc = wmi_get_all_temperatures(wil, &sense_all_evt); if (rc) { seq_puts(s, "Failed\n"); return 0; } print_temp(s, "T_mac =", le32_to_cpu(sense_all_evt.baseband_t1000)); seq_printf(s, "Connected RFs [0x%08x]\n", sense_all_evt.rf_bitmap); for (i = 0; i < WMI_MAX_XIF_PORTS_NUM; i++) { seq_printf(s, "RF[%d] = ", i); print_temp(s, "", le32_to_cpu(sense_all_evt.rf_t1000[i])); } } else { s32 t_m, t_r; wil_dbg_misc(wil, "WMI_FW_CAPABILITY_TEMPERATURE_ALL_RF is not supported"); rc = wmi_get_temperature(wil, &t_m, &t_r); if (rc) { seq_puts(s, "Failed\n"); return 0; } print_temp(s, "T_mac =", t_m); print_temp(s, "T_radio =", t_r); } return 0; } Loading Loading @@ -2508,6 +2570,7 @@ static const struct { {"tx_latency", 0644, &fops_tx_latency}, {"link_stats", 0644, &fops_link_stats}, {"link_stats_global", 0644, &fops_link_stats_global}, {"rbufcap", 0244, &fops_rbufcap}, }; static void wil6210_debugfs_init_files(struct wil6210_priv *wil, Loading drivers/net/wireless/ath/wil6210/main.c +15 −0 Original line number Diff line number Diff line Loading @@ -1600,6 +1600,7 @@ int wil_vr_update_profile(struct wil6210_priv *wil, u8 profile) static void wil_pre_fw_config(struct wil6210_priv *wil) { wil_clear_fw_log_addr(wil); /* Mark FW as loaded from host */ wil_s(wil, RGF_USER_USAGE_6, 1); Loading Loading @@ -1656,6 +1657,20 @@ static int wil_restore_vifs(struct wil6210_priv *wil) return 0; } /* * Clear FW and ucode log start addr to indicate FW log is not ready. The host * driver clears the addresses before FW starts and FW initializes the address * when it is ready to send logs. */ void wil_clear_fw_log_addr(struct wil6210_priv *wil) { /* FW log addr */ wil_w(wil, RGF_USER_USAGE_1, 0); /* ucode log addr */ wil_w(wil, RGF_USER_USAGE_2, 0); wil_dbg_misc(wil, "Cleared FW and ucode log address"); } /* * We reset all the structures, and we reset the UMAC. * After calling this routine, you're expected to reload Loading drivers/net/wireless/ath/wil6210/pcie_bus.c +1 −0 Original line number Diff line number Diff line Loading @@ -521,6 +521,7 @@ static int wil_pcie_probe(struct pci_dev *pdev, const struct pci_device_id *id) } /* rollback to bus_disable */ wil_clear_fw_log_addr(wil); rc = wil_if_add(wil); if (rc) { wil_err(wil, "wil_if_add failed: %d\n", rc); Loading drivers/net/wireless/ath/wil6210/rx_reorder.c +11 −20 Original line number Diff line number Diff line Loading @@ -305,7 +305,7 @@ __acquires(&sta->tid_rx_lock) __releases(&sta->tid_rx_lock) u16 agg_timeout = le16_to_cpu(ba_timeout); u16 seq_ctrl = le16_to_cpu(ba_seq_ctrl); struct wil_sta_info *sta; u16 agg_wsize = 0; u16 agg_wsize; /* bit 0: A-MSDU supported * bit 1: policy (should be 0 for us) * bits 2..5: TID Loading @@ -317,7 +317,6 @@ __acquires(&sta->tid_rx_lock) __releases(&sta->tid_rx_lock) test_bit(WMI_FW_CAPABILITY_AMSDU, wil->fw_capabilities) && wil->amsdu_en && (param_set & BIT(0)); int ba_policy = param_set & BIT(1); u16 status = WLAN_STATUS_SUCCESS; u16 ssn = seq_ctrl >> 4; struct wil_tid_ampdu_rx *r; int rc = 0; Loading @@ -344,27 +343,19 @@ __acquires(&sta->tid_rx_lock) __releases(&sta->tid_rx_lock) agg_amsdu ? "+" : "-", !!ba_policy, dialog_token, ssn); /* apply policies */ if (ba_policy) { wil_err(wil, "BACK requested unsupported ba_policy == 1\n"); status = WLAN_STATUS_INVALID_QOS_PARAM; } if (status == WLAN_STATUS_SUCCESS) { if (req_agg_wsize == 0) { wil_dbg_misc(wil, "Suggest BACK wsize %d\n", wil->max_agg_wsize); agg_wsize = wil->max_agg_wsize; } else { agg_wsize = min_t(u16, wil->max_agg_wsize, req_agg_wsize); } agg_wsize = min_t(u16, wil->max_agg_wsize, req_agg_wsize); } rc = wil->txrx_ops.wmi_addba_rx_resp(wil, mid, cid, tid, dialog_token, status, agg_amsdu, agg_wsize, agg_timeout); if (rc || (status != WLAN_STATUS_SUCCESS)) { wil_err(wil, "do not apply ba, rc(%d), status(%d)\n", rc, status); WLAN_STATUS_SUCCESS, agg_amsdu, agg_wsize, agg_timeout); if (rc) { wil_err(wil, "do not apply ba, rc(%d)\n", rc); goto out; } Loading Loading
drivers/net/wireless/ath/wil6210/cfg80211.c +2 −1 Original line number Diff line number Diff line Loading @@ -580,7 +580,8 @@ int wil_cid_fill_sinfo(struct wil6210_vif *vif, int cid, memset(&reply, 0, sizeof(reply)); rc = wmi_call(wil, WMI_NOTIFY_REQ_CMDID, vif->mid, &cmd, sizeof(cmd), WMI_NOTIFY_REQ_DONE_EVENTID, &reply, sizeof(reply), 20); WMI_NOTIFY_REQ_DONE_EVENTID, &reply, sizeof(reply), WIL_WMI_CALL_GENERAL_TO_MS); if (rc) return rc; Loading
drivers/net/wireless/ath/wil6210/debugfs.c +73 −10 Original line number Diff line number Diff line Loading @@ -810,6 +810,44 @@ static const struct file_operations fops_rxon = { .open = simple_open, }; static ssize_t wil_write_file_rbufcap(struct file *file, const char __user *buf, size_t count, loff_t *ppos) { struct wil6210_priv *wil = file->private_data; int val; int rc; rc = kstrtoint_from_user(buf, count, 0, &val); if (rc) { wil_err(wil, "Invalid argument\n"); return rc; } /* input value: negative to disable, 0 to use system default, * 1..ring size to set descriptor threshold */ wil_info(wil, "%s RBUFCAP, descriptors threshold - %d\n", val < 0 ? "Disabling" : "Enabling", val); if (!wil->ring_rx.va || val > wil->ring_rx.size) { wil_err(wil, "Invalid descriptors threshold, %d\n", val); return -EINVAL; } rc = wmi_rbufcap_cfg(wil, val < 0 ? 0 : 1, val < 0 ? 0 : val); if (rc) { wil_err(wil, "RBUFCAP config failed: %d\n", rc); return rc; } return count; } static const struct file_operations fops_rbufcap = { .write = wil_write_file_rbufcap, .open = simple_open, }; /* block ack control, write: * - "add <ringid> <agg_size> <timeout>" to trigger ADDBA * - "del_tx <ringid> <reason>" to trigger DELBA for Tx side Loading Loading @@ -1364,7 +1402,7 @@ static int wil_bf_debugfs_show(struct seq_file *s, void *data) rc = wmi_call(wil, WMI_NOTIFY_REQ_CMDID, vif->mid, &cmd, sizeof(cmd), WMI_NOTIFY_REQ_DONE_EVENTID, &reply, sizeof(reply), 20); sizeof(reply), WIL_WMI_CALL_GENERAL_TO_MS); /* if reply is all-0, ignore this CID */ if (rc || is_all_zeros(&reply.evt, sizeof(reply.evt))) continue; Loading Loading @@ -1413,7 +1451,7 @@ static void print_temp(struct seq_file *s, const char *prefix, s32 t) { switch (t) { case 0: case ~(u32)0: case WMI_INVALID_TEMPERATURE: seq_printf(s, "%s N/A\n", prefix); break; default: Loading @@ -1426,17 +1464,41 @@ static void print_temp(struct seq_file *s, const char *prefix, s32 t) static int wil_temp_debugfs_show(struct seq_file *s, void *data) { struct wil6210_priv *wil = s->private; s32 t_m, t_r; int rc = wmi_get_temperature(wil, &t_m, &t_r); int rc, i; if (test_bit(WMI_FW_CAPABILITY_TEMPERATURE_ALL_RF, wil->fw_capabilities)) { struct wmi_temp_sense_all_done_event sense_all_evt; wil_dbg_misc(wil, "WMI_FW_CAPABILITY_TEMPERATURE_ALL_RF is supported"); rc = wmi_get_all_temperatures(wil, &sense_all_evt); if (rc) { seq_puts(s, "Failed\n"); return 0; } print_temp(s, "T_mac =", le32_to_cpu(sense_all_evt.baseband_t1000)); seq_printf(s, "Connected RFs [0x%08x]\n", sense_all_evt.rf_bitmap); for (i = 0; i < WMI_MAX_XIF_PORTS_NUM; i++) { seq_printf(s, "RF[%d] = ", i); print_temp(s, "", le32_to_cpu(sense_all_evt.rf_t1000[i])); } } else { s32 t_m, t_r; wil_dbg_misc(wil, "WMI_FW_CAPABILITY_TEMPERATURE_ALL_RF is not supported"); rc = wmi_get_temperature(wil, &t_m, &t_r); if (rc) { seq_puts(s, "Failed\n"); return 0; } print_temp(s, "T_mac =", t_m); print_temp(s, "T_radio =", t_r); } return 0; } Loading Loading @@ -2508,6 +2570,7 @@ static const struct { {"tx_latency", 0644, &fops_tx_latency}, {"link_stats", 0644, &fops_link_stats}, {"link_stats_global", 0644, &fops_link_stats_global}, {"rbufcap", 0244, &fops_rbufcap}, }; static void wil6210_debugfs_init_files(struct wil6210_priv *wil, Loading
drivers/net/wireless/ath/wil6210/main.c +15 −0 Original line number Diff line number Diff line Loading @@ -1600,6 +1600,7 @@ int wil_vr_update_profile(struct wil6210_priv *wil, u8 profile) static void wil_pre_fw_config(struct wil6210_priv *wil) { wil_clear_fw_log_addr(wil); /* Mark FW as loaded from host */ wil_s(wil, RGF_USER_USAGE_6, 1); Loading Loading @@ -1656,6 +1657,20 @@ static int wil_restore_vifs(struct wil6210_priv *wil) return 0; } /* * Clear FW and ucode log start addr to indicate FW log is not ready. The host * driver clears the addresses before FW starts and FW initializes the address * when it is ready to send logs. */ void wil_clear_fw_log_addr(struct wil6210_priv *wil) { /* FW log addr */ wil_w(wil, RGF_USER_USAGE_1, 0); /* ucode log addr */ wil_w(wil, RGF_USER_USAGE_2, 0); wil_dbg_misc(wil, "Cleared FW and ucode log address"); } /* * We reset all the structures, and we reset the UMAC. * After calling this routine, you're expected to reload Loading
drivers/net/wireless/ath/wil6210/pcie_bus.c +1 −0 Original line number Diff line number Diff line Loading @@ -521,6 +521,7 @@ static int wil_pcie_probe(struct pci_dev *pdev, const struct pci_device_id *id) } /* rollback to bus_disable */ wil_clear_fw_log_addr(wil); rc = wil_if_add(wil); if (rc) { wil_err(wil, "wil_if_add failed: %d\n", rc); Loading
drivers/net/wireless/ath/wil6210/rx_reorder.c +11 −20 Original line number Diff line number Diff line Loading @@ -305,7 +305,7 @@ __acquires(&sta->tid_rx_lock) __releases(&sta->tid_rx_lock) u16 agg_timeout = le16_to_cpu(ba_timeout); u16 seq_ctrl = le16_to_cpu(ba_seq_ctrl); struct wil_sta_info *sta; u16 agg_wsize = 0; u16 agg_wsize; /* bit 0: A-MSDU supported * bit 1: policy (should be 0 for us) * bits 2..5: TID Loading @@ -317,7 +317,6 @@ __acquires(&sta->tid_rx_lock) __releases(&sta->tid_rx_lock) test_bit(WMI_FW_CAPABILITY_AMSDU, wil->fw_capabilities) && wil->amsdu_en && (param_set & BIT(0)); int ba_policy = param_set & BIT(1); u16 status = WLAN_STATUS_SUCCESS; u16 ssn = seq_ctrl >> 4; struct wil_tid_ampdu_rx *r; int rc = 0; Loading @@ -344,27 +343,19 @@ __acquires(&sta->tid_rx_lock) __releases(&sta->tid_rx_lock) agg_amsdu ? "+" : "-", !!ba_policy, dialog_token, ssn); /* apply policies */ if (ba_policy) { wil_err(wil, "BACK requested unsupported ba_policy == 1\n"); status = WLAN_STATUS_INVALID_QOS_PARAM; } if (status == WLAN_STATUS_SUCCESS) { if (req_agg_wsize == 0) { wil_dbg_misc(wil, "Suggest BACK wsize %d\n", wil->max_agg_wsize); agg_wsize = wil->max_agg_wsize; } else { agg_wsize = min_t(u16, wil->max_agg_wsize, req_agg_wsize); } agg_wsize = min_t(u16, wil->max_agg_wsize, req_agg_wsize); } rc = wil->txrx_ops.wmi_addba_rx_resp(wil, mid, cid, tid, dialog_token, status, agg_amsdu, agg_wsize, agg_timeout); if (rc || (status != WLAN_STATUS_SUCCESS)) { wil_err(wil, "do not apply ba, rc(%d), status(%d)\n", rc, status); WLAN_STATUS_SUCCESS, agg_amsdu, agg_wsize, agg_timeout); if (rc) { wil_err(wil, "do not apply ba, rc(%d)\n", rc); goto out; } Loading