Loading drivers/net/wireless/ath/wil6210/cfg80211.c +18 −43 Original line number Diff line number Diff line Loading @@ -353,6 +353,8 @@ int wil_cid_fill_sinfo(struct wil6210_vif *vif, int cid, struct wil_net_stats *stats = &wil->sta[cid].stats; int rc; 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); if (rc) Loading Loading @@ -1158,17 +1160,11 @@ int wil_cfg80211_mgmt_tx(struct wiphy *wiphy, struct wireless_dev *wdev, u64 *cookie) { const u8 *buf = params->buf; size_t len = params->len, total; size_t len = params->len; struct wil6210_priv *wil = wiphy_to_wil(wiphy); struct wil6210_vif *vif = wdev_to_vif(wil, wdev); int rc; bool tx_status = false; struct ieee80211_mgmt *mgmt_frame = (void *)buf; struct wmi_sw_tx_req_cmd *cmd; struct { struct wmi_cmd_hdr wmi; struct wmi_sw_tx_complete_event evt; } __packed evt; bool tx_status; /* Note, currently we do not support the "wait" parameter, user-space * must call remain_on_channel before mgmt_tx or listen on a channel Loading @@ -1177,34 +1173,9 @@ int wil_cfg80211_mgmt_tx(struct wiphy *wiphy, struct wireless_dev *wdev, * different from currently "listened" channel and fail if it is. */ wil_dbg_misc(wil, "mgmt_tx mid %d\n", vif->mid); wil_hex_dump_misc("mgmt tx frame ", DUMP_PREFIX_OFFSET, 16, 1, buf, len, true); if (len < sizeof(struct ieee80211_hdr_3addr)) return -EINVAL; total = sizeof(*cmd) + len; if (total < len) return -EINVAL; cmd = kmalloc(total, GFP_KERNEL); if (!cmd) { rc = -ENOMEM; goto out; } memcpy(cmd->dst_mac, mgmt_frame->da, WMI_MAC_LEN); cmd->len = cpu_to_le16(len); memcpy(cmd->payload, buf, len); rc = wmi_call(wil, WMI_SW_TX_REQ_CMDID, vif->mid, cmd, total, WMI_SW_TX_COMPLETE_EVENTID, &evt, sizeof(evt), 2000); if (rc == 0) tx_status = !evt.evt.status; rc = wmi_mgmt_tx(vif, buf, len); tx_status = (rc == 0); kfree(cmd); out: cfg80211_mgmt_tx_status(wdev, cookie ? *cookie : 0, buf, len, tx_status, GFP_KERNEL); return rc; Loading Loading @@ -2422,7 +2393,9 @@ static int wil_rf_sector_get_cfg(struct wiphy *wiphy, struct { struct wmi_cmd_hdr wmi; struct wmi_get_rf_sector_params_done_event evt; } __packed reply; } __packed reply = { .evt = {.status = WMI_RF_SECTOR_STATUS_NOT_SUPPORTED_ERROR}, }; struct sk_buff *msg; struct nlattr *nl_cfgs, *nl_cfg; u32 i; Loading Loading @@ -2468,7 +2441,6 @@ static int wil_rf_sector_get_cfg(struct wiphy *wiphy, cmd.sector_idx = cpu_to_le16(sector_index); cmd.sector_type = sector_type; cmd.rf_modules_vec = rf_modules_vec & 0xFF; memset(&reply, 0, sizeof(reply)); rc = wmi_call(wil, WMI_GET_RF_SECTOR_PARAMS_CMDID, vif->mid, &cmd, sizeof(cmd), WMI_GET_RF_SECTOR_PARAMS_DONE_EVENTID, &reply, sizeof(reply), Loading Loading @@ -2543,7 +2515,9 @@ static int wil_rf_sector_set_cfg(struct wiphy *wiphy, struct { struct wmi_cmd_hdr wmi; struct wmi_set_rf_sector_params_done_event evt; } __packed reply; } __packed reply = { .evt = {.status = WMI_RF_SECTOR_STATUS_NOT_SUPPORTED_ERROR}, }; struct nlattr *nl_cfg; struct wmi_rf_sector_info *si; Loading Loading @@ -2626,7 +2600,6 @@ static int wil_rf_sector_set_cfg(struct wiphy *wiphy, } cmd.rf_modules_vec = rf_modules_vec & 0xFF; memset(&reply, 0, sizeof(reply)); rc = wmi_call(wil, WMI_SET_RF_SECTOR_PARAMS_CMDID, vif->mid, &cmd, sizeof(cmd), WMI_SET_RF_SECTOR_PARAMS_DONE_EVENTID, &reply, sizeof(reply), Loading @@ -2650,7 +2623,9 @@ static int wil_rf_sector_get_selected(struct wiphy *wiphy, struct { struct wmi_cmd_hdr wmi; struct wmi_get_selected_rf_sector_index_done_event evt; } __packed reply; } __packed reply = { .evt = {.status = WMI_RF_SECTOR_STATUS_NOT_SUPPORTED_ERROR}, }; struct sk_buff *msg; if (!test_bit(WMI_FW_CAPABILITY_RF_SECTORS, wil->fw_capabilities)) Loading Loading @@ -2690,7 +2665,6 @@ static int wil_rf_sector_get_selected(struct wiphy *wiphy, memset(&cmd, 0, sizeof(cmd)); cmd.cid = (u8)cid; cmd.sector_type = sector_type; memset(&reply, 0, sizeof(reply)); rc = wmi_call(wil, WMI_GET_SELECTED_RF_SECTOR_INDEX_CMDID, vif->mid, &cmd, sizeof(cmd), WMI_GET_SELECTED_RF_SECTOR_INDEX_DONE_EVENTID, Loading Loading @@ -2731,14 +2705,15 @@ static int wil_rf_sector_wmi_set_selected(struct wil6210_priv *wil, struct { struct wmi_cmd_hdr wmi; struct wmi_set_selected_rf_sector_index_done_event evt; } __packed reply; } __packed reply = { .evt = {.status = WMI_RF_SECTOR_STATUS_NOT_SUPPORTED_ERROR}, }; int rc; memset(&cmd, 0, sizeof(cmd)); cmd.sector_idx = cpu_to_le16(sector_index); cmd.sector_type = sector_type; cmd.cid = (u8)cid; memset(&reply, 0, sizeof(reply)); rc = wmi_call(wil, WMI_SET_SELECTED_RF_SECTOR_INDEX_CMDID, mid, &cmd, sizeof(cmd), WMI_SET_SELECTED_RF_SECTOR_INDEX_DONE_EVENTID, Loading drivers/net/wireless/ath/wil6210/debugfs.c +3 −2 Original line number Diff line number Diff line Loading @@ -1335,6 +1335,8 @@ static int wil_bf_debugfs_show(struct seq_file *s, void *data) struct wmi_notify_req_done_event evt; } __packed reply; memset(&reply, 0, sizeof(reply)); for (i = 0; i < ARRAY_SIZE(wil->sta); i++) { u32 status; Loading Loading @@ -1678,8 +1680,7 @@ static void wil_print_rxtid(struct seq_file *s, struct wil_tid_ampdu_rx *r) u16 index = ((r->head_seq_num - r->ssn) & 0xfff) % r->buf_size; unsigned long long drop_dup = r->drop_dup, drop_old = r->drop_old; seq_printf(s, "([%2d] %3d TU) 0x%03x [", r->buf_size, r->timeout, r->head_seq_num); seq_printf(s, "([%2d]) 0x%03x [", r->buf_size, r->head_seq_num); for (i = 0; i < r->buf_size; i++) { if (i == index) seq_printf(s, "%c", r->reorder_buf[i] ? 'O' : '|'); Loading drivers/net/wireless/ath/wil6210/main.c +2 −0 Original line number Diff line number Diff line Loading @@ -397,6 +397,8 @@ void wil_disconnect_worker(struct work_struct *work) /* already disconnected */ return; memset(&reply, 0, sizeof(reply)); rc = wmi_call(wil, WMI_DISCONNECT_CMDID, vif->mid, NULL, 0, WMI_DISCONNECT_EVENTID, &reply, sizeof(reply), WIL6210_DISCONNECT_TO_MS); Loading drivers/net/wireless/ath/wil6210/netdev.c +4 −4 Original line number Diff line number Diff line Loading @@ -529,16 +529,16 @@ void wil_vif_remove(struct wil6210_priv *wil, u8 mid) return; } mutex_lock(&wil->mutex); wil6210_disconnect(vif, NULL, WLAN_REASON_DEAUTH_LEAVING, false); mutex_unlock(&wil->mutex); ndev = vif_to_ndev(vif); /* during unregister_netdevice cfg80211_leave may perform operations * such as stop AP, disconnect, so we only clear the VIF afterwards */ unregister_netdevice(ndev); mutex_lock(&wil->mutex); wil6210_disconnect(vif, NULL, WLAN_REASON_DEAUTH_LEAVING, false); mutex_unlock(&wil->mutex); if (any_active && vif->mid != 0) wmi_port_delete(wil, vif->mid); Loading drivers/net/wireless/ath/wil6210/rx_reorder.c +5 −7 Original line number Diff line number Diff line Loading @@ -205,7 +205,6 @@ __acquires(&sta->tid_rx_lock) __releases(&sta->tid_rx_lock) /* put the frame in the reordering buffer */ r->reorder_buf[index] = skb; r->reorder_time[index] = jiffies; r->stored_mpdu_num++; wil_reorder_release(ndev, r); Loading Loading @@ -251,11 +250,8 @@ struct wil_tid_ampdu_rx *wil_tid_ampdu_rx_alloc(struct wil6210_priv *wil, r->reorder_buf = kcalloc(size, sizeof(struct sk_buff *), GFP_KERNEL); r->reorder_time = kcalloc(size, sizeof(unsigned long), GFP_KERNEL); if (!r->reorder_buf || !r->reorder_time) { if (!r->reorder_buf) { kfree(r->reorder_buf); kfree(r->reorder_time); kfree(r); return NULL; } Loading Loading @@ -285,7 +281,6 @@ void wil_tid_ampdu_rx_free(struct wil6210_priv *wil, kfree_skb(r->reorder_buf[i]); kfree(r->reorder_buf); kfree(r->reorder_time); kfree(r); } Loading Loading @@ -319,7 +314,10 @@ __acquires(&sta->tid_rx_lock) __releases(&sta->tid_rx_lock) * bits 6..15: buffer size */ u16 req_agg_wsize = WIL_GET_BITS(param_set, 6, 15); bool agg_amsdu = !!(param_set & BIT(0)); bool agg_amsdu = wil->use_enhanced_dma_hw && use_rx_hw_reordering && 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; Loading Loading
drivers/net/wireless/ath/wil6210/cfg80211.c +18 −43 Original line number Diff line number Diff line Loading @@ -353,6 +353,8 @@ int wil_cid_fill_sinfo(struct wil6210_vif *vif, int cid, struct wil_net_stats *stats = &wil->sta[cid].stats; int rc; 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); if (rc) Loading Loading @@ -1158,17 +1160,11 @@ int wil_cfg80211_mgmt_tx(struct wiphy *wiphy, struct wireless_dev *wdev, u64 *cookie) { const u8 *buf = params->buf; size_t len = params->len, total; size_t len = params->len; struct wil6210_priv *wil = wiphy_to_wil(wiphy); struct wil6210_vif *vif = wdev_to_vif(wil, wdev); int rc; bool tx_status = false; struct ieee80211_mgmt *mgmt_frame = (void *)buf; struct wmi_sw_tx_req_cmd *cmd; struct { struct wmi_cmd_hdr wmi; struct wmi_sw_tx_complete_event evt; } __packed evt; bool tx_status; /* Note, currently we do not support the "wait" parameter, user-space * must call remain_on_channel before mgmt_tx or listen on a channel Loading @@ -1177,34 +1173,9 @@ int wil_cfg80211_mgmt_tx(struct wiphy *wiphy, struct wireless_dev *wdev, * different from currently "listened" channel and fail if it is. */ wil_dbg_misc(wil, "mgmt_tx mid %d\n", vif->mid); wil_hex_dump_misc("mgmt tx frame ", DUMP_PREFIX_OFFSET, 16, 1, buf, len, true); if (len < sizeof(struct ieee80211_hdr_3addr)) return -EINVAL; total = sizeof(*cmd) + len; if (total < len) return -EINVAL; cmd = kmalloc(total, GFP_KERNEL); if (!cmd) { rc = -ENOMEM; goto out; } memcpy(cmd->dst_mac, mgmt_frame->da, WMI_MAC_LEN); cmd->len = cpu_to_le16(len); memcpy(cmd->payload, buf, len); rc = wmi_call(wil, WMI_SW_TX_REQ_CMDID, vif->mid, cmd, total, WMI_SW_TX_COMPLETE_EVENTID, &evt, sizeof(evt), 2000); if (rc == 0) tx_status = !evt.evt.status; rc = wmi_mgmt_tx(vif, buf, len); tx_status = (rc == 0); kfree(cmd); out: cfg80211_mgmt_tx_status(wdev, cookie ? *cookie : 0, buf, len, tx_status, GFP_KERNEL); return rc; Loading Loading @@ -2422,7 +2393,9 @@ static int wil_rf_sector_get_cfg(struct wiphy *wiphy, struct { struct wmi_cmd_hdr wmi; struct wmi_get_rf_sector_params_done_event evt; } __packed reply; } __packed reply = { .evt = {.status = WMI_RF_SECTOR_STATUS_NOT_SUPPORTED_ERROR}, }; struct sk_buff *msg; struct nlattr *nl_cfgs, *nl_cfg; u32 i; Loading Loading @@ -2468,7 +2441,6 @@ static int wil_rf_sector_get_cfg(struct wiphy *wiphy, cmd.sector_idx = cpu_to_le16(sector_index); cmd.sector_type = sector_type; cmd.rf_modules_vec = rf_modules_vec & 0xFF; memset(&reply, 0, sizeof(reply)); rc = wmi_call(wil, WMI_GET_RF_SECTOR_PARAMS_CMDID, vif->mid, &cmd, sizeof(cmd), WMI_GET_RF_SECTOR_PARAMS_DONE_EVENTID, &reply, sizeof(reply), Loading Loading @@ -2543,7 +2515,9 @@ static int wil_rf_sector_set_cfg(struct wiphy *wiphy, struct { struct wmi_cmd_hdr wmi; struct wmi_set_rf_sector_params_done_event evt; } __packed reply; } __packed reply = { .evt = {.status = WMI_RF_SECTOR_STATUS_NOT_SUPPORTED_ERROR}, }; struct nlattr *nl_cfg; struct wmi_rf_sector_info *si; Loading Loading @@ -2626,7 +2600,6 @@ static int wil_rf_sector_set_cfg(struct wiphy *wiphy, } cmd.rf_modules_vec = rf_modules_vec & 0xFF; memset(&reply, 0, sizeof(reply)); rc = wmi_call(wil, WMI_SET_RF_SECTOR_PARAMS_CMDID, vif->mid, &cmd, sizeof(cmd), WMI_SET_RF_SECTOR_PARAMS_DONE_EVENTID, &reply, sizeof(reply), Loading @@ -2650,7 +2623,9 @@ static int wil_rf_sector_get_selected(struct wiphy *wiphy, struct { struct wmi_cmd_hdr wmi; struct wmi_get_selected_rf_sector_index_done_event evt; } __packed reply; } __packed reply = { .evt = {.status = WMI_RF_SECTOR_STATUS_NOT_SUPPORTED_ERROR}, }; struct sk_buff *msg; if (!test_bit(WMI_FW_CAPABILITY_RF_SECTORS, wil->fw_capabilities)) Loading Loading @@ -2690,7 +2665,6 @@ static int wil_rf_sector_get_selected(struct wiphy *wiphy, memset(&cmd, 0, sizeof(cmd)); cmd.cid = (u8)cid; cmd.sector_type = sector_type; memset(&reply, 0, sizeof(reply)); rc = wmi_call(wil, WMI_GET_SELECTED_RF_SECTOR_INDEX_CMDID, vif->mid, &cmd, sizeof(cmd), WMI_GET_SELECTED_RF_SECTOR_INDEX_DONE_EVENTID, Loading Loading @@ -2731,14 +2705,15 @@ static int wil_rf_sector_wmi_set_selected(struct wil6210_priv *wil, struct { struct wmi_cmd_hdr wmi; struct wmi_set_selected_rf_sector_index_done_event evt; } __packed reply; } __packed reply = { .evt = {.status = WMI_RF_SECTOR_STATUS_NOT_SUPPORTED_ERROR}, }; int rc; memset(&cmd, 0, sizeof(cmd)); cmd.sector_idx = cpu_to_le16(sector_index); cmd.sector_type = sector_type; cmd.cid = (u8)cid; memset(&reply, 0, sizeof(reply)); rc = wmi_call(wil, WMI_SET_SELECTED_RF_SECTOR_INDEX_CMDID, mid, &cmd, sizeof(cmd), WMI_SET_SELECTED_RF_SECTOR_INDEX_DONE_EVENTID, Loading
drivers/net/wireless/ath/wil6210/debugfs.c +3 −2 Original line number Diff line number Diff line Loading @@ -1335,6 +1335,8 @@ static int wil_bf_debugfs_show(struct seq_file *s, void *data) struct wmi_notify_req_done_event evt; } __packed reply; memset(&reply, 0, sizeof(reply)); for (i = 0; i < ARRAY_SIZE(wil->sta); i++) { u32 status; Loading Loading @@ -1678,8 +1680,7 @@ static void wil_print_rxtid(struct seq_file *s, struct wil_tid_ampdu_rx *r) u16 index = ((r->head_seq_num - r->ssn) & 0xfff) % r->buf_size; unsigned long long drop_dup = r->drop_dup, drop_old = r->drop_old; seq_printf(s, "([%2d] %3d TU) 0x%03x [", r->buf_size, r->timeout, r->head_seq_num); seq_printf(s, "([%2d]) 0x%03x [", r->buf_size, r->head_seq_num); for (i = 0; i < r->buf_size; i++) { if (i == index) seq_printf(s, "%c", r->reorder_buf[i] ? 'O' : '|'); Loading
drivers/net/wireless/ath/wil6210/main.c +2 −0 Original line number Diff line number Diff line Loading @@ -397,6 +397,8 @@ void wil_disconnect_worker(struct work_struct *work) /* already disconnected */ return; memset(&reply, 0, sizeof(reply)); rc = wmi_call(wil, WMI_DISCONNECT_CMDID, vif->mid, NULL, 0, WMI_DISCONNECT_EVENTID, &reply, sizeof(reply), WIL6210_DISCONNECT_TO_MS); Loading
drivers/net/wireless/ath/wil6210/netdev.c +4 −4 Original line number Diff line number Diff line Loading @@ -529,16 +529,16 @@ void wil_vif_remove(struct wil6210_priv *wil, u8 mid) return; } mutex_lock(&wil->mutex); wil6210_disconnect(vif, NULL, WLAN_REASON_DEAUTH_LEAVING, false); mutex_unlock(&wil->mutex); ndev = vif_to_ndev(vif); /* during unregister_netdevice cfg80211_leave may perform operations * such as stop AP, disconnect, so we only clear the VIF afterwards */ unregister_netdevice(ndev); mutex_lock(&wil->mutex); wil6210_disconnect(vif, NULL, WLAN_REASON_DEAUTH_LEAVING, false); mutex_unlock(&wil->mutex); if (any_active && vif->mid != 0) wmi_port_delete(wil, vif->mid); Loading
drivers/net/wireless/ath/wil6210/rx_reorder.c +5 −7 Original line number Diff line number Diff line Loading @@ -205,7 +205,6 @@ __acquires(&sta->tid_rx_lock) __releases(&sta->tid_rx_lock) /* put the frame in the reordering buffer */ r->reorder_buf[index] = skb; r->reorder_time[index] = jiffies; r->stored_mpdu_num++; wil_reorder_release(ndev, r); Loading Loading @@ -251,11 +250,8 @@ struct wil_tid_ampdu_rx *wil_tid_ampdu_rx_alloc(struct wil6210_priv *wil, r->reorder_buf = kcalloc(size, sizeof(struct sk_buff *), GFP_KERNEL); r->reorder_time = kcalloc(size, sizeof(unsigned long), GFP_KERNEL); if (!r->reorder_buf || !r->reorder_time) { if (!r->reorder_buf) { kfree(r->reorder_buf); kfree(r->reorder_time); kfree(r); return NULL; } Loading Loading @@ -285,7 +281,6 @@ void wil_tid_ampdu_rx_free(struct wil6210_priv *wil, kfree_skb(r->reorder_buf[i]); kfree(r->reorder_buf); kfree(r->reorder_time); kfree(r); } Loading Loading @@ -319,7 +314,10 @@ __acquires(&sta->tid_rx_lock) __releases(&sta->tid_rx_lock) * bits 6..15: buffer size */ u16 req_agg_wsize = WIL_GET_BITS(param_set, 6, 15); bool agg_amsdu = !!(param_set & BIT(0)); bool agg_amsdu = wil->use_enhanced_dma_hw && use_rx_hw_reordering && 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; Loading