.. | .. |
---|
45 | 45 | WCN36XX_CFG_VAL(MAX_MEDIUM_TIME, 6000), |
---|
46 | 46 | WCN36XX_CFG_VAL(MAX_MPDUS_IN_AMPDU, 64), |
---|
47 | 47 | WCN36XX_CFG_VAL(RTS_THRESHOLD, 2347), |
---|
48 | | - WCN36XX_CFG_VAL(SHORT_RETRY_LIMIT, 6), |
---|
49 | | - WCN36XX_CFG_VAL(LONG_RETRY_LIMIT, 6), |
---|
| 48 | + WCN36XX_CFG_VAL(SHORT_RETRY_LIMIT, 15), |
---|
| 49 | + WCN36XX_CFG_VAL(LONG_RETRY_LIMIT, 15), |
---|
50 | 50 | WCN36XX_CFG_VAL(FRAGMENTATION_THRESHOLD, 8000), |
---|
51 | 51 | WCN36XX_CFG_VAL(DYNAMIC_THRESHOLD_ZERO, 5), |
---|
52 | 52 | WCN36XX_CFG_VAL(DYNAMIC_THRESHOLD_ONE, 10), |
---|
.. | .. |
---|
77 | 77 | WCN36XX_CFG_VAL(BTC_STATIC_LEN_LE_WLAN, 30000), |
---|
78 | 78 | WCN36XX_CFG_VAL(MAX_ASSOC_LIMIT, 10), |
---|
79 | 79 | WCN36XX_CFG_VAL(ENABLE_MCC_ADAPTIVE_SCHEDULER, 0), |
---|
| 80 | + WCN36XX_CFG_VAL(ENABLE_DYNAMIC_RA_START_RATE, 133), /* MCS 5 */ |
---|
| 81 | +}; |
---|
| 82 | + |
---|
| 83 | +static struct wcn36xx_cfg_val wcn3680_cfg_vals[] = { |
---|
| 84 | + WCN36XX_CFG_VAL(CURRENT_TX_ANTENNA, 1), |
---|
| 85 | + WCN36XX_CFG_VAL(CURRENT_RX_ANTENNA, 1), |
---|
| 86 | + WCN36XX_CFG_VAL(LOW_GAIN_OVERRIDE, 0), |
---|
| 87 | + WCN36XX_CFG_VAL(POWER_STATE_PER_CHAIN, 785), |
---|
| 88 | + WCN36XX_CFG_VAL(CAL_PERIOD, 5), |
---|
| 89 | + WCN36XX_CFG_VAL(CAL_CONTROL, 1), |
---|
| 90 | + WCN36XX_CFG_VAL(PROXIMITY, 0), |
---|
| 91 | + WCN36XX_CFG_VAL(NETWORK_DENSITY, 3), |
---|
| 92 | + WCN36XX_CFG_VAL(MAX_MEDIUM_TIME, 4096), |
---|
| 93 | + WCN36XX_CFG_VAL(MAX_MPDUS_IN_AMPDU, 64), |
---|
| 94 | + WCN36XX_CFG_VAL(RTS_THRESHOLD, 2347), |
---|
| 95 | + WCN36XX_CFG_VAL(SHORT_RETRY_LIMIT, 15), |
---|
| 96 | + WCN36XX_CFG_VAL(LONG_RETRY_LIMIT, 15), |
---|
| 97 | + WCN36XX_CFG_VAL(FRAGMENTATION_THRESHOLD, 8000), |
---|
| 98 | + WCN36XX_CFG_VAL(DYNAMIC_THRESHOLD_ZERO, 5), |
---|
| 99 | + WCN36XX_CFG_VAL(DYNAMIC_THRESHOLD_ONE, 10), |
---|
| 100 | + WCN36XX_CFG_VAL(DYNAMIC_THRESHOLD_TWO, 15), |
---|
| 101 | + WCN36XX_CFG_VAL(FIXED_RATE, 0), |
---|
| 102 | + WCN36XX_CFG_VAL(RETRYRATE_POLICY, 4), |
---|
| 103 | + WCN36XX_CFG_VAL(RETRYRATE_SECONDARY, 0), |
---|
| 104 | + WCN36XX_CFG_VAL(RETRYRATE_TERTIARY, 0), |
---|
| 105 | + WCN36XX_CFG_VAL(FORCE_POLICY_PROTECTION, 5), |
---|
| 106 | + WCN36XX_CFG_VAL(FIXED_RATE_MULTICAST_24GHZ, 1), |
---|
| 107 | + WCN36XX_CFG_VAL(FIXED_RATE_MULTICAST_5GHZ, 5), |
---|
| 108 | + WCN36XX_CFG_VAL(DEFAULT_RATE_INDEX_24GHZ, 1), |
---|
| 109 | + WCN36XX_CFG_VAL(DEFAULT_RATE_INDEX_5GHZ, 5), |
---|
| 110 | + WCN36XX_CFG_VAL(MAX_BA_SESSIONS, 40), |
---|
| 111 | + WCN36XX_CFG_VAL(PS_DATA_INACTIVITY_TIMEOUT, 200), |
---|
| 112 | + WCN36XX_CFG_VAL(PS_ENABLE_BCN_FILTER, 1), |
---|
| 113 | + WCN36XX_CFG_VAL(PS_ENABLE_RSSI_MONITOR, 1), |
---|
| 114 | + WCN36XX_CFG_VAL(NUM_BEACON_PER_RSSI_AVERAGE, 20), |
---|
| 115 | + WCN36XX_CFG_VAL(STATS_PERIOD, 10), |
---|
| 116 | + WCN36XX_CFG_VAL(CFP_MAX_DURATION, 30000), |
---|
| 117 | + WCN36XX_CFG_VAL(FRAME_TRANS_ENABLED, 0), |
---|
| 118 | + WCN36XX_CFG_VAL(BA_THRESHOLD_HIGH, 128), |
---|
| 119 | + WCN36XX_CFG_VAL(MAX_BA_BUFFERS, 2560), |
---|
| 120 | + WCN36XX_CFG_VAL(DYNAMIC_PS_POLL_VALUE, 0), |
---|
| 121 | + WCN36XX_CFG_VAL(TX_PWR_CTRL_ENABLE, 1), |
---|
| 122 | + WCN36XX_CFG_VAL(ENABLE_CLOSE_LOOP, 1), |
---|
| 123 | + WCN36XX_CFG_VAL(ENABLE_LPWR_IMG_TRANSITION, 0), |
---|
| 124 | + WCN36XX_CFG_VAL(BTC_STATIC_LEN_LE_BT, 120000), |
---|
| 125 | + WCN36XX_CFG_VAL(BTC_STATIC_LEN_LE_WLAN, 30000), |
---|
| 126 | + WCN36XX_CFG_VAL(MAX_ASSOC_LIMIT, 10), |
---|
| 127 | + WCN36XX_CFG_VAL(ENABLE_MCC_ADAPTIVE_SCHEDULER, 0), |
---|
| 128 | + WCN36XX_CFG_VAL(TDLS_PUAPSD_MASK, 0), |
---|
| 129 | + WCN36XX_CFG_VAL(TDLS_PUAPSD_BUFFER_STA_CAPABLE, 1), |
---|
| 130 | + WCN36XX_CFG_VAL(TDLS_PUAPSD_INACTIVITY_TIME, 0), |
---|
| 131 | + WCN36XX_CFG_VAL(TDLS_PUAPSD_RX_FRAME_THRESHOLD, 10), |
---|
| 132 | + WCN36XX_CFG_VAL(TDLS_OFF_CHANNEL_CAPABLE, 1), |
---|
| 133 | + WCN36XX_CFG_VAL(ENABLE_ADAPTIVE_RX_DRAIN, 1), |
---|
| 134 | + WCN36XX_CFG_VAL(FLEXCONNECT_POWER_FACTOR, 0), |
---|
| 135 | + WCN36XX_CFG_VAL(ANTENNA_DIVERSITY, 3), |
---|
| 136 | + WCN36XX_CFG_VAL(ATH_DISABLE, 0), |
---|
| 137 | + WCN36XX_CFG_VAL(BTC_STATIC_OPP_WLAN_ACTIVE_WLAN_LEN, 60000), |
---|
| 138 | + WCN36XX_CFG_VAL(BTC_STATIC_OPP_WLAN_ACTIVE_BT_LEN, 90000), |
---|
| 139 | + WCN36XX_CFG_VAL(BTC_SAP_STATIC_OPP_ACTIVE_WLAN_LEN, 30000), |
---|
| 140 | + WCN36XX_CFG_VAL(BTC_SAP_STATIC_OPP_ACTIVE_BT_LEN, 30000), |
---|
| 141 | + WCN36XX_CFG_VAL(ASD_PROBE_INTERVAL, 50), |
---|
| 142 | + WCN36XX_CFG_VAL(ASD_TRIGGER_THRESHOLD, -60), |
---|
| 143 | + WCN36XX_CFG_VAL(ASD_RTT_RSSI_HYST_THRESHOLD, 3), |
---|
| 144 | + WCN36XX_CFG_VAL(BTC_CTS2S_ON_STA_DURING_SCO, 0), |
---|
| 145 | + WCN36XX_CFG_VAL(RA_FILTER_ENABLE, 0), |
---|
| 146 | + WCN36XX_CFG_VAL(RA_RATE_LIMIT_INTERVAL, 60), |
---|
| 147 | + WCN36XX_CFG_VAL(BTC_FATAL_HID_NSNIFF_BLK, 2), |
---|
| 148 | + WCN36XX_CFG_VAL(BTC_CRITICAL_HID_NSNIFF_BLK, 1), |
---|
| 149 | + WCN36XX_CFG_VAL(BTC_DYN_A2DP_TX_QUEUE_THOLD, 0), |
---|
| 150 | + WCN36XX_CFG_VAL(BTC_DYN_OPP_TX_QUEUE_THOLD, 1), |
---|
| 151 | + WCN36XX_CFG_VAL(MAX_UAPSD_CONSEC_SP, 10), |
---|
| 152 | + WCN36XX_CFG_VAL(MAX_UAPSD_CONSEC_RX_CNT, 50), |
---|
| 153 | + WCN36XX_CFG_VAL(MAX_UAPSD_CONSEC_TX_CNT, 50), |
---|
| 154 | + WCN36XX_CFG_VAL(MAX_UAPSD_CONSEC_TX_CNT_MEAS_WINDOW, 500), |
---|
| 155 | + WCN36XX_CFG_VAL(MAX_UAPSD_CONSEC_RX_CNT_MEAS_WINDOW, 500), |
---|
| 156 | + WCN36XX_CFG_VAL(MAX_PSPOLL_IN_WMM_UAPSD_PS_MODE, 0), |
---|
| 157 | + WCN36XX_CFG_VAL(MAX_UAPSD_INACTIVITY_INTERVALS, 10), |
---|
| 158 | + WCN36XX_CFG_VAL(ENABLE_DYNAMIC_WMMPS, 1), |
---|
| 159 | + WCN36XX_CFG_VAL(BURST_MODE_BE_TXOP_VALUE, 0), |
---|
| 160 | + WCN36XX_CFG_VAL(ENABLE_DYNAMIC_RA_START_RATE, 136), |
---|
| 161 | + WCN36XX_CFG_VAL(BTC_FAST_WLAN_CONN_PREF, 1), |
---|
| 162 | + WCN36XX_CFG_VAL(ENABLE_RTSCTS_HTVHT, 0), |
---|
| 163 | + WCN36XX_CFG_VAL(BTC_STATIC_OPP_WLAN_IDLE_WLAN_LEN, 30000), |
---|
| 164 | + WCN36XX_CFG_VAL(BTC_STATIC_OPP_WLAN_IDLE_BT_LEN, 120000), |
---|
| 165 | + WCN36XX_CFG_VAL(LINK_FAIL_TX_CNT, 200), |
---|
| 166 | + WCN36XX_CFG_VAL(TOGGLE_ARP_BDRATES, 0), |
---|
| 167 | + WCN36XX_CFG_VAL(OPTIMIZE_CA_EVENT, 0), |
---|
| 168 | + WCN36XX_CFG_VAL(EXT_SCAN_CONC_MODE, 0), |
---|
| 169 | + WCN36XX_CFG_VAL(BAR_WAKEUP_HOST_DISABLE, 0), |
---|
| 170 | + WCN36XX_CFG_VAL(SAR_BOFFSET_CORRECTION_ENABLE, 0), |
---|
| 171 | + WCN36XX_CFG_VAL(BTC_DISABLE_WLAN_LINK_CRITICAL, 5), |
---|
| 172 | + WCN36XX_CFG_VAL(DISABLE_SCAN_DURING_SCO, 2), |
---|
| 173 | + WCN36XX_CFG_VAL(CONS_BCNMISS_COUNT, 0), |
---|
| 174 | + WCN36XX_CFG_VAL(UNITS_OF_BCN_WAIT_TIME, 0), |
---|
| 175 | + WCN36XX_CFG_VAL(TRIGGER_NULLFRAME_BEFORE_HB, 0), |
---|
| 176 | + WCN36XX_CFG_VAL(ENABLE_POWERSAVE_OFFLOAD, 0), |
---|
80 | 177 | }; |
---|
81 | 178 | |
---|
82 | 179 | static int put_cfg_tlv_u32(struct wcn36xx *wcn, size_t *len, u32 id, u32 value) |
---|
.. | .. |
---|
121 | 218 | { |
---|
122 | 219 | return caps & flag ? 1 : 0; |
---|
123 | 220 | } |
---|
| 221 | + |
---|
124 | 222 | static void wcn36xx_smd_set_bss_ht_params(struct ieee80211_vif *vif, |
---|
125 | 223 | struct ieee80211_sta *sta, |
---|
126 | 224 | struct wcn36xx_hal_config_bss_params *bss_params) |
---|
.. | .. |
---|
143 | 241 | /* IEEE80211_HT_OP_MODE_PROTECTION_20MHZ */ |
---|
144 | 242 | bss_params->ht20_coexist = 0; |
---|
145 | 243 | } |
---|
| 244 | +} |
---|
| 245 | + |
---|
| 246 | +static void |
---|
| 247 | +wcn36xx_smd_set_bss_vht_params(struct ieee80211_vif *vif, |
---|
| 248 | + struct ieee80211_sta *sta, |
---|
| 249 | + struct wcn36xx_hal_config_bss_params_v1 *bss) |
---|
| 250 | +{ |
---|
| 251 | + if (sta && sta->vht_cap.vht_supported) |
---|
| 252 | + bss->vht_capable = 1; |
---|
146 | 253 | } |
---|
147 | 254 | |
---|
148 | 255 | static void wcn36xx_smd_set_sta_ht_params(struct ieee80211_sta *sta, |
---|
.. | .. |
---|
173 | 280 | } |
---|
174 | 281 | } |
---|
175 | 282 | |
---|
| 283 | +static void wcn36xx_smd_set_sta_vht_params(struct wcn36xx *wcn, |
---|
| 284 | + struct ieee80211_sta *sta, |
---|
| 285 | + struct wcn36xx_hal_config_sta_params_v1 *sta_params) |
---|
| 286 | +{ |
---|
| 287 | + if (sta->vht_cap.vht_supported) { |
---|
| 288 | + unsigned long caps = sta->vht_cap.cap; |
---|
| 289 | + |
---|
| 290 | + sta_params->vht_capable = sta->vht_cap.vht_supported; |
---|
| 291 | + sta_params->vht_ldpc_enabled = |
---|
| 292 | + is_cap_supported(caps, IEEE80211_VHT_CAP_RXLDPC); |
---|
| 293 | + if (get_feat_caps(wcn->fw_feat_caps, MU_MIMO)) { |
---|
| 294 | + sta_params->vht_tx_mu_beamformee_capable = |
---|
| 295 | + is_cap_supported(caps, IEEE80211_VHT_CAP_MU_BEAMFORMER_CAPABLE); |
---|
| 296 | + if (sta_params->vht_tx_mu_beamformee_capable) |
---|
| 297 | + sta_params->vht_tx_bf_enabled = 1; |
---|
| 298 | + } else { |
---|
| 299 | + sta_params->vht_tx_mu_beamformee_capable = 0; |
---|
| 300 | + } |
---|
| 301 | + sta_params->vht_tx_channel_width_set = 0; |
---|
| 302 | + } |
---|
| 303 | +} |
---|
| 304 | + |
---|
| 305 | +static void wcn36xx_smd_set_sta_ht_ldpc_params(struct ieee80211_sta *sta, |
---|
| 306 | + struct wcn36xx_hal_config_sta_params_v1 *sta_params) |
---|
| 307 | +{ |
---|
| 308 | + if (sta->ht_cap.ht_supported) { |
---|
| 309 | + sta_params->ht_ldpc_enabled = |
---|
| 310 | + is_cap_supported(sta->ht_cap.cap, IEEE80211_HT_CAP_LDPC_CODING); |
---|
| 311 | + } |
---|
| 312 | +} |
---|
| 313 | + |
---|
176 | 314 | static void wcn36xx_smd_set_sta_default_ht_params( |
---|
177 | 315 | struct wcn36xx_hal_config_sta_params *sta_params) |
---|
178 | 316 | { |
---|
.. | .. |
---|
187 | 325 | sta_params->green_field_capable = 1; |
---|
188 | 326 | sta_params->delayed_ba_support = 0; |
---|
189 | 327 | sta_params->dsss_cck_mode_40mhz = 1; |
---|
| 328 | +} |
---|
| 329 | + |
---|
| 330 | +static void wcn36xx_smd_set_sta_default_vht_params(struct wcn36xx *wcn, |
---|
| 331 | + struct wcn36xx_hal_config_sta_params_v1 *sta_params) |
---|
| 332 | +{ |
---|
| 333 | + if (wcn->rf_id == RF_IRIS_WCN3680) { |
---|
| 334 | + sta_params->vht_capable = 1; |
---|
| 335 | + sta_params->vht_tx_mu_beamformee_capable = 1; |
---|
| 336 | + } else { |
---|
| 337 | + sta_params->vht_capable = 0; |
---|
| 338 | + sta_params->vht_tx_mu_beamformee_capable = 0; |
---|
| 339 | + } |
---|
| 340 | + |
---|
| 341 | + sta_params->vht_ldpc_enabled = 0; |
---|
| 342 | + sta_params->vht_tx_channel_width_set = 0; |
---|
| 343 | + sta_params->vht_tx_bf_enabled = 0; |
---|
| 344 | +} |
---|
| 345 | + |
---|
| 346 | +static void wcn36xx_smd_set_sta_default_ht_ldpc_params(struct wcn36xx *wcn, |
---|
| 347 | + struct wcn36xx_hal_config_sta_params_v1 *sta_params) |
---|
| 348 | +{ |
---|
| 349 | + if (wcn->rf_id == RF_IRIS_WCN3680) |
---|
| 350 | + sta_params->ht_ldpc_enabled = 1; |
---|
| 351 | + else |
---|
| 352 | + sta_params->ht_ldpc_enabled = 0; |
---|
190 | 353 | } |
---|
191 | 354 | |
---|
192 | 355 | static void wcn36xx_smd_set_sta_params(struct wcn36xx *wcn, |
---|
.. | .. |
---|
241 | 404 | sta_params->aid = sta_priv->aid; |
---|
242 | 405 | wcn36xx_smd_set_sta_ht_params(sta, sta_params); |
---|
243 | 406 | memcpy(&sta_params->supported_rates, &sta_priv->supported_rates, |
---|
244 | | - sizeof(sta_priv->supported_rates)); |
---|
| 407 | + sizeof(struct wcn36xx_hal_supported_rates)); |
---|
245 | 408 | } else { |
---|
246 | | - wcn36xx_set_default_rates(&sta_params->supported_rates); |
---|
| 409 | + wcn36xx_set_default_rates((struct wcn36xx_hal_supported_rates *) |
---|
| 410 | + &sta_params->supported_rates); |
---|
247 | 411 | wcn36xx_smd_set_sta_default_ht_params(sta_params); |
---|
248 | 412 | } |
---|
249 | 413 | } |
---|
.. | .. |
---|
290 | 454 | hdr->len = msg_size + sizeof(*hdr); |
---|
291 | 455 | } |
---|
292 | 456 | |
---|
293 | | -#define INIT_HAL_MSG(msg_body, type) \ |
---|
| 457 | +#define __INIT_HAL_MSG(msg_body, type, version) \ |
---|
294 | 458 | do { \ |
---|
295 | 459 | memset(&msg_body, 0, sizeof(msg_body)); \ |
---|
296 | 460 | msg_body.header.msg_type = type; \ |
---|
297 | | - msg_body.header.msg_version = WCN36XX_HAL_MSG_VERSION0; \ |
---|
| 461 | + msg_body.header.msg_version = version; \ |
---|
298 | 462 | msg_body.header.len = sizeof(msg_body); \ |
---|
299 | 463 | } while (0) \ |
---|
| 464 | + |
---|
| 465 | +#define INIT_HAL_MSG(msg_body, type) \ |
---|
| 466 | + __INIT_HAL_MSG(msg_body, type, WCN36XX_HAL_MSG_VERSION0) |
---|
| 467 | + |
---|
| 468 | +#define INIT_HAL_MSG_V1(msg_body, type) \ |
---|
| 469 | + __INIT_HAL_MSG(msg_body, type, WCN36XX_HAL_MSG_VERSION1) |
---|
300 | 470 | |
---|
301 | 471 | #define INIT_HAL_PTT_MSG(p_msg_body, ppt_msg_len) \ |
---|
302 | 472 | do { \ |
---|
.. | .. |
---|
449 | 619 | int ret; |
---|
450 | 620 | int i; |
---|
451 | 621 | size_t len; |
---|
| 622 | + int cfg_elements; |
---|
| 623 | + static struct wcn36xx_cfg_val *cfg_vals; |
---|
452 | 624 | |
---|
453 | 625 | mutex_lock(&wcn->hal_mutex); |
---|
454 | 626 | INIT_HAL_MSG(msg_body, WCN36XX_HAL_START_REQ); |
---|
.. | .. |
---|
461 | 633 | body = (struct wcn36xx_hal_mac_start_req_msg *)wcn->hal_buf; |
---|
462 | 634 | len = body->header.len; |
---|
463 | 635 | |
---|
464 | | - for (i = 0; i < ARRAY_SIZE(wcn36xx_cfg_vals); i++) { |
---|
465 | | - ret = put_cfg_tlv_u32(wcn, &len, wcn36xx_cfg_vals[i].cfg_id, |
---|
466 | | - wcn36xx_cfg_vals[i].value); |
---|
| 636 | + if (wcn->rf_id == RF_IRIS_WCN3680) { |
---|
| 637 | + cfg_vals = wcn3680_cfg_vals; |
---|
| 638 | + cfg_elements = ARRAY_SIZE(wcn3680_cfg_vals); |
---|
| 639 | + } else { |
---|
| 640 | + cfg_vals = wcn36xx_cfg_vals; |
---|
| 641 | + cfg_elements = ARRAY_SIZE(wcn36xx_cfg_vals); |
---|
| 642 | + } |
---|
| 643 | + |
---|
| 644 | + for (i = 0; i < cfg_elements; i++) { |
---|
| 645 | + ret = put_cfg_tlv_u32(wcn, &len, cfg_vals[i].cfg_id, |
---|
| 646 | + cfg_vals[i].value); |
---|
467 | 647 | if (ret) |
---|
468 | 648 | goto out; |
---|
469 | 649 | } |
---|
.. | .. |
---|
517 | 697 | return ret; |
---|
518 | 698 | } |
---|
519 | 699 | |
---|
520 | | -int wcn36xx_smd_init_scan(struct wcn36xx *wcn, enum wcn36xx_hal_sys_mode mode) |
---|
| 700 | +int wcn36xx_smd_init_scan(struct wcn36xx *wcn, enum wcn36xx_hal_sys_mode mode, |
---|
| 701 | + struct ieee80211_vif *vif) |
---|
521 | 702 | { |
---|
| 703 | + struct wcn36xx_vif *vif_priv = wcn36xx_vif_to_priv(vif); |
---|
522 | 704 | struct wcn36xx_hal_init_scan_req_msg msg_body; |
---|
523 | 705 | int ret; |
---|
524 | 706 | |
---|
.. | .. |
---|
526 | 708 | INIT_HAL_MSG(msg_body, WCN36XX_HAL_INIT_SCAN_REQ); |
---|
527 | 709 | |
---|
528 | 710 | msg_body.mode = mode; |
---|
| 711 | + if (vif_priv->bss_index != WCN36XX_HAL_BSS_INVALID_IDX) { |
---|
| 712 | + /* Notify BSSID with null DATA packet */ |
---|
| 713 | + msg_body.frame_type = 2; |
---|
| 714 | + msg_body.notify = 1; |
---|
| 715 | + msg_body.scan_entry.bss_index[0] = vif_priv->bss_index; |
---|
| 716 | + msg_body.scan_entry.active_bss_count = 1; |
---|
| 717 | + } |
---|
529 | 718 | |
---|
530 | 719 | PREPARE_HAL_BUF(wcn->hal_buf, msg_body); |
---|
531 | 720 | |
---|
.. | .. |
---|
541 | 730 | wcn36xx_err("hal_init_scan response failed err=%d\n", ret); |
---|
542 | 731 | goto out; |
---|
543 | 732 | } |
---|
| 733 | + wcn->sw_scan_init = true; |
---|
544 | 734 | out: |
---|
545 | 735 | mutex_unlock(&wcn->hal_mutex); |
---|
546 | 736 | return ret; |
---|
.. | .. |
---|
571 | 761 | wcn36xx_err("hal_start_scan response failed err=%d\n", ret); |
---|
572 | 762 | goto out; |
---|
573 | 763 | } |
---|
| 764 | + wcn->sw_scan_channel = scan_channel; |
---|
574 | 765 | out: |
---|
575 | 766 | mutex_unlock(&wcn->hal_mutex); |
---|
576 | 767 | return ret; |
---|
.. | .. |
---|
601 | 792 | wcn36xx_err("hal_end_scan response failed err=%d\n", ret); |
---|
602 | 793 | goto out; |
---|
603 | 794 | } |
---|
| 795 | + wcn->sw_scan_channel = 0; |
---|
604 | 796 | out: |
---|
605 | 797 | mutex_unlock(&wcn->hal_mutex); |
---|
606 | 798 | return ret; |
---|
607 | 799 | } |
---|
608 | 800 | |
---|
609 | 801 | int wcn36xx_smd_finish_scan(struct wcn36xx *wcn, |
---|
610 | | - enum wcn36xx_hal_sys_mode mode) |
---|
| 802 | + enum wcn36xx_hal_sys_mode mode, |
---|
| 803 | + struct ieee80211_vif *vif) |
---|
611 | 804 | { |
---|
| 805 | + struct wcn36xx_vif *vif_priv = wcn36xx_vif_to_priv(vif); |
---|
612 | 806 | struct wcn36xx_hal_finish_scan_req_msg msg_body; |
---|
613 | 807 | int ret; |
---|
614 | 808 | |
---|
.. | .. |
---|
616 | 810 | INIT_HAL_MSG(msg_body, WCN36XX_HAL_FINISH_SCAN_REQ); |
---|
617 | 811 | |
---|
618 | 812 | msg_body.mode = mode; |
---|
| 813 | + msg_body.oper_channel = WCN36XX_HW_CHANNEL(wcn); |
---|
| 814 | + if (vif_priv->bss_index != WCN36XX_HAL_BSS_INVALID_IDX) { |
---|
| 815 | + /* Notify BSSID with null data packet */ |
---|
| 816 | + msg_body.notify = 1; |
---|
| 817 | + msg_body.frame_type = 2; |
---|
| 818 | + msg_body.scan_entry.bss_index[0] = vif_priv->bss_index; |
---|
| 819 | + msg_body.scan_entry.active_bss_count = 1; |
---|
| 820 | + } |
---|
619 | 821 | |
---|
620 | 822 | PREPARE_HAL_BUF(wcn->hal_buf, msg_body); |
---|
621 | 823 | |
---|
.. | .. |
---|
632 | 834 | wcn36xx_err("hal_finish_scan response failed err=%d\n", ret); |
---|
633 | 835 | goto out; |
---|
634 | 836 | } |
---|
| 837 | + wcn->sw_scan_init = false; |
---|
635 | 838 | out: |
---|
636 | 839 | mutex_unlock(&wcn->hal_mutex); |
---|
637 | 840 | return ret; |
---|
.. | .. |
---|
674 | 877 | |
---|
675 | 878 | msg_body->num_channel = min_t(u8, req->n_channels, |
---|
676 | 879 | sizeof(msg_body->channels)); |
---|
677 | | - for (i = 0; i < msg_body->num_channel; i++) |
---|
678 | | - msg_body->channels[i] = req->channels[i]->hw_value; |
---|
| 880 | + for (i = 0; i < msg_body->num_channel; i++) { |
---|
| 881 | + msg_body->channels[i] = |
---|
| 882 | + HW_VALUE_CHANNEL(req->channels[i]->hw_value); |
---|
| 883 | + } |
---|
679 | 884 | |
---|
680 | 885 | msg_body->header.len -= WCN36XX_MAX_SCAN_IE_LEN; |
---|
681 | 886 | |
---|
.. | .. |
---|
799 | 1004 | rsp->header.len - sizeof(rsp->ptt_msg_resp_status)); |
---|
800 | 1005 | |
---|
801 | 1006 | if (rsp->header.len > 0) { |
---|
802 | | - *p_ptt_rsp_msg = kmalloc(rsp->header.len, GFP_ATOMIC); |
---|
| 1007 | + *p_ptt_rsp_msg = kmemdup(rsp->ptt_msg, rsp->header.len, |
---|
| 1008 | + GFP_ATOMIC); |
---|
803 | 1009 | if (!*p_ptt_rsp_msg) |
---|
804 | 1010 | return -ENOMEM; |
---|
805 | | - memcpy(*p_ptt_rsp_msg, rsp->ptt_msg, rsp->header.len); |
---|
806 | 1011 | } |
---|
807 | 1012 | return ret; |
---|
808 | 1013 | } |
---|
.. | .. |
---|
1163 | 1368 | v1->p2p = orig->p2p; |
---|
1164 | 1369 | } |
---|
1165 | 1370 | |
---|
| 1371 | +static void |
---|
| 1372 | +wcn36xx_smd_set_sta_params_v1(struct wcn36xx *wcn, |
---|
| 1373 | + struct ieee80211_vif *vif, |
---|
| 1374 | + struct ieee80211_sta *sta, |
---|
| 1375 | + struct wcn36xx_hal_config_sta_params_v1 *sta_par) |
---|
| 1376 | +{ |
---|
| 1377 | + struct wcn36xx_sta *sta_priv = NULL; |
---|
| 1378 | + struct wcn36xx_hal_config_sta_params sta_par_v0; |
---|
| 1379 | + |
---|
| 1380 | + wcn36xx_smd_set_sta_params(wcn, vif, sta, &sta_par_v0); |
---|
| 1381 | + wcn36xx_smd_convert_sta_to_v1(wcn, &sta_par_v0, sta_par); |
---|
| 1382 | + |
---|
| 1383 | + if (sta) { |
---|
| 1384 | + sta_priv = wcn36xx_sta_to_priv(sta); |
---|
| 1385 | + wcn36xx_smd_set_sta_vht_params(wcn, sta, sta_par); |
---|
| 1386 | + wcn36xx_smd_set_sta_ht_ldpc_params(sta, sta_par); |
---|
| 1387 | + memcpy(&sta_par->supported_rates, &sta_priv->supported_rates, |
---|
| 1388 | + sizeof(sta_par->supported_rates)); |
---|
| 1389 | + } else { |
---|
| 1390 | + wcn36xx_set_default_rates_v1(&sta_par->supported_rates); |
---|
| 1391 | + wcn36xx_smd_set_sta_default_vht_params(wcn, sta_par); |
---|
| 1392 | + wcn36xx_smd_set_sta_default_ht_ldpc_params(wcn, sta_par); |
---|
| 1393 | + } |
---|
| 1394 | +} |
---|
| 1395 | + |
---|
1166 | 1396 | static int wcn36xx_smd_config_sta_rsp(struct wcn36xx *wcn, |
---|
1167 | 1397 | struct ieee80211_sta *sta, |
---|
1168 | 1398 | void *buf, |
---|
.. | .. |
---|
1197 | 1427 | } |
---|
1198 | 1428 | |
---|
1199 | 1429 | static int wcn36xx_smd_config_sta_v1(struct wcn36xx *wcn, |
---|
1200 | | - const struct wcn36xx_hal_config_sta_req_msg *orig) |
---|
| 1430 | + struct ieee80211_vif *vif, |
---|
| 1431 | + struct ieee80211_sta *sta) |
---|
1201 | 1432 | { |
---|
1202 | 1433 | struct wcn36xx_hal_config_sta_req_msg_v1 msg_body; |
---|
1203 | | - struct wcn36xx_hal_config_sta_params_v1 *sta = &msg_body.sta_params; |
---|
| 1434 | + struct wcn36xx_hal_config_sta_params_v1 *sta_params; |
---|
1204 | 1435 | |
---|
1205 | | - INIT_HAL_MSG(msg_body, WCN36XX_HAL_CONFIG_STA_REQ); |
---|
| 1436 | + if (wcn->rf_id == RF_IRIS_WCN3680) { |
---|
| 1437 | + INIT_HAL_MSG_V1(msg_body, WCN36XX_HAL_CONFIG_STA_REQ); |
---|
| 1438 | + } else { |
---|
| 1439 | + INIT_HAL_MSG(msg_body, WCN36XX_HAL_CONFIG_STA_REQ); |
---|
| 1440 | + msg_body.header.len -= WCN36XX_DIFF_STA_PARAMS_V1_NOVHT; |
---|
| 1441 | + } |
---|
1206 | 1442 | |
---|
1207 | | - wcn36xx_smd_convert_sta_to_v1(wcn, &orig->sta_params, |
---|
1208 | | - &msg_body.sta_params); |
---|
| 1443 | + sta_params = &msg_body.sta_params; |
---|
| 1444 | + |
---|
| 1445 | + wcn36xx_smd_set_sta_params_v1(wcn, vif, sta, sta_params); |
---|
1209 | 1446 | |
---|
1210 | 1447 | PREPARE_HAL_BUF(wcn->hal_buf, msg_body); |
---|
1211 | 1448 | |
---|
1212 | 1449 | wcn36xx_dbg(WCN36XX_DBG_HAL, |
---|
1213 | 1450 | "hal config sta v1 action %d sta_index %d bssid_index %d bssid %pM type %d mac %pM aid %d\n", |
---|
1214 | | - sta->action, sta->sta_index, sta->bssid_index, |
---|
1215 | | - sta->bssid, sta->type, sta->mac, sta->aid); |
---|
| 1451 | + sta_params->action, sta_params->sta_index, sta_params->bssid_index, |
---|
| 1452 | + sta_params->bssid, sta_params->type, sta_params->mac, sta_params->aid); |
---|
1216 | 1453 | |
---|
1217 | 1454 | return wcn36xx_smd_send_and_wait(wcn, msg_body.header.len); |
---|
1218 | 1455 | } |
---|
1219 | 1456 | |
---|
1220 | | -int wcn36xx_smd_config_sta(struct wcn36xx *wcn, struct ieee80211_vif *vif, |
---|
1221 | | - struct ieee80211_sta *sta) |
---|
| 1457 | +static int wcn36xx_smd_config_sta_v0(struct wcn36xx *wcn, |
---|
| 1458 | + struct ieee80211_vif *vif, |
---|
| 1459 | + struct ieee80211_sta *sta) |
---|
1222 | 1460 | { |
---|
1223 | 1461 | struct wcn36xx_hal_config_sta_req_msg msg; |
---|
1224 | 1462 | struct wcn36xx_hal_config_sta_params *sta_params; |
---|
1225 | | - int ret; |
---|
1226 | 1463 | |
---|
1227 | | - mutex_lock(&wcn->hal_mutex); |
---|
1228 | 1464 | INIT_HAL_MSG(msg, WCN36XX_HAL_CONFIG_STA_REQ); |
---|
1229 | 1465 | |
---|
1230 | 1466 | sta_params = &msg.sta_params; |
---|
1231 | 1467 | |
---|
1232 | 1468 | wcn36xx_smd_set_sta_params(wcn, vif, sta, sta_params); |
---|
1233 | 1469 | |
---|
1234 | | - if (!wcn36xx_is_fw_version(wcn, 1, 2, 2, 24)) { |
---|
1235 | | - ret = wcn36xx_smd_config_sta_v1(wcn, &msg); |
---|
1236 | | - } else { |
---|
1237 | | - PREPARE_HAL_BUF(wcn->hal_buf, msg); |
---|
| 1470 | + PREPARE_HAL_BUF(wcn->hal_buf, msg); |
---|
1238 | 1471 | |
---|
1239 | | - wcn36xx_dbg(WCN36XX_DBG_HAL, |
---|
1240 | | - "hal config sta action %d sta_index %d bssid_index %d bssid %pM type %d mac %pM aid %d\n", |
---|
1241 | | - sta_params->action, sta_params->sta_index, |
---|
1242 | | - sta_params->bssid_index, sta_params->bssid, |
---|
1243 | | - sta_params->type, sta_params->mac, sta_params->aid); |
---|
| 1472 | + wcn36xx_dbg(WCN36XX_DBG_HAL, |
---|
| 1473 | + "hal config sta action %d sta_index %d bssid_index %d bssid %pM type %d mac %pM aid %d\n", |
---|
| 1474 | + sta_params->action, sta_params->sta_index, |
---|
| 1475 | + sta_params->bssid_index, sta_params->bssid, |
---|
| 1476 | + sta_params->type, sta_params->mac, sta_params->aid); |
---|
1244 | 1477 | |
---|
1245 | | - ret = wcn36xx_smd_send_and_wait(wcn, msg.header.len); |
---|
1246 | | - } |
---|
| 1478 | + return wcn36xx_smd_send_and_wait(wcn, msg.header.len); |
---|
| 1479 | +} |
---|
| 1480 | + |
---|
| 1481 | +int wcn36xx_smd_config_sta(struct wcn36xx *wcn, struct ieee80211_vif *vif, |
---|
| 1482 | + struct ieee80211_sta *sta) |
---|
| 1483 | +{ |
---|
| 1484 | + int ret; |
---|
| 1485 | + |
---|
| 1486 | + mutex_lock(&wcn->hal_mutex); |
---|
| 1487 | + |
---|
| 1488 | + if (!wcn36xx_is_fw_version(wcn, 1, 2, 2, 24)) |
---|
| 1489 | + ret = wcn36xx_smd_config_sta_v1(wcn, vif, sta); |
---|
| 1490 | + else |
---|
| 1491 | + ret = wcn36xx_smd_config_sta_v0(wcn, vif, sta); |
---|
| 1492 | + |
---|
1247 | 1493 | if (ret) { |
---|
1248 | 1494 | wcn36xx_err("Sending hal_config_sta failed\n"); |
---|
1249 | 1495 | goto out; |
---|
.. | .. |
---|
1261 | 1507 | return ret; |
---|
1262 | 1508 | } |
---|
1263 | 1509 | |
---|
1264 | | -static int wcn36xx_smd_config_bss_v1(struct wcn36xx *wcn, |
---|
1265 | | - const struct wcn36xx_hal_config_bss_req_msg *orig) |
---|
| 1510 | +static void wcn36xx_smd_set_bss_params(struct wcn36xx *wcn, |
---|
| 1511 | + struct ieee80211_vif *vif, |
---|
| 1512 | + struct ieee80211_sta *sta, |
---|
| 1513 | + const u8 *bssid, |
---|
| 1514 | + bool update, |
---|
| 1515 | + struct wcn36xx_hal_config_bss_params *bss) |
---|
1266 | 1516 | { |
---|
1267 | | - struct wcn36xx_hal_config_bss_req_msg_v1 *msg_body; |
---|
1268 | | - struct wcn36xx_hal_config_bss_params_v1 *bss; |
---|
1269 | | - struct wcn36xx_hal_config_sta_params_v1 *sta; |
---|
1270 | | - int ret; |
---|
1271 | | - |
---|
1272 | | - msg_body = kzalloc(sizeof(*msg_body), GFP_KERNEL); |
---|
1273 | | - if (!msg_body) |
---|
1274 | | - return -ENOMEM; |
---|
1275 | | - |
---|
1276 | | - INIT_HAL_MSG((*msg_body), WCN36XX_HAL_CONFIG_BSS_REQ); |
---|
1277 | | - |
---|
1278 | | - bss = &msg_body->bss_params; |
---|
1279 | | - sta = &bss->sta; |
---|
1280 | | - |
---|
1281 | | - /* convert orig to v1 */ |
---|
1282 | | - memcpy(&msg_body->bss_params.bssid, |
---|
1283 | | - &orig->bss_params.bssid, ETH_ALEN); |
---|
1284 | | - memcpy(&msg_body->bss_params.self_mac_addr, |
---|
1285 | | - &orig->bss_params.self_mac_addr, ETH_ALEN); |
---|
1286 | | - |
---|
1287 | | - msg_body->bss_params.bss_type = orig->bss_params.bss_type; |
---|
1288 | | - msg_body->bss_params.oper_mode = orig->bss_params.oper_mode; |
---|
1289 | | - msg_body->bss_params.nw_type = orig->bss_params.nw_type; |
---|
1290 | | - |
---|
1291 | | - msg_body->bss_params.short_slot_time_supported = |
---|
1292 | | - orig->bss_params.short_slot_time_supported; |
---|
1293 | | - msg_body->bss_params.lla_coexist = orig->bss_params.lla_coexist; |
---|
1294 | | - msg_body->bss_params.llb_coexist = orig->bss_params.llb_coexist; |
---|
1295 | | - msg_body->bss_params.llg_coexist = orig->bss_params.llg_coexist; |
---|
1296 | | - msg_body->bss_params.ht20_coexist = orig->bss_params.ht20_coexist; |
---|
1297 | | - msg_body->bss_params.lln_non_gf_coexist = |
---|
1298 | | - orig->bss_params.lln_non_gf_coexist; |
---|
1299 | | - |
---|
1300 | | - msg_body->bss_params.lsig_tx_op_protection_full_support = |
---|
1301 | | - orig->bss_params.lsig_tx_op_protection_full_support; |
---|
1302 | | - msg_body->bss_params.rifs_mode = orig->bss_params.rifs_mode; |
---|
1303 | | - msg_body->bss_params.beacon_interval = orig->bss_params.beacon_interval; |
---|
1304 | | - msg_body->bss_params.dtim_period = orig->bss_params.dtim_period; |
---|
1305 | | - msg_body->bss_params.tx_channel_width_set = |
---|
1306 | | - orig->bss_params.tx_channel_width_set; |
---|
1307 | | - msg_body->bss_params.oper_channel = orig->bss_params.oper_channel; |
---|
1308 | | - msg_body->bss_params.ext_channel = orig->bss_params.ext_channel; |
---|
1309 | | - |
---|
1310 | | - msg_body->bss_params.reserved = orig->bss_params.reserved; |
---|
1311 | | - |
---|
1312 | | - memcpy(&msg_body->bss_params.ssid, |
---|
1313 | | - &orig->bss_params.ssid, |
---|
1314 | | - sizeof(orig->bss_params.ssid)); |
---|
1315 | | - |
---|
1316 | | - msg_body->bss_params.action = orig->bss_params.action; |
---|
1317 | | - msg_body->bss_params.rateset = orig->bss_params.rateset; |
---|
1318 | | - msg_body->bss_params.ht = orig->bss_params.ht; |
---|
1319 | | - msg_body->bss_params.obss_prot_enabled = |
---|
1320 | | - orig->bss_params.obss_prot_enabled; |
---|
1321 | | - msg_body->bss_params.rmf = orig->bss_params.rmf; |
---|
1322 | | - msg_body->bss_params.ht_oper_mode = orig->bss_params.ht_oper_mode; |
---|
1323 | | - msg_body->bss_params.dual_cts_protection = |
---|
1324 | | - orig->bss_params.dual_cts_protection; |
---|
1325 | | - |
---|
1326 | | - msg_body->bss_params.max_probe_resp_retry_limit = |
---|
1327 | | - orig->bss_params.max_probe_resp_retry_limit; |
---|
1328 | | - msg_body->bss_params.hidden_ssid = orig->bss_params.hidden_ssid; |
---|
1329 | | - msg_body->bss_params.proxy_probe_resp = |
---|
1330 | | - orig->bss_params.proxy_probe_resp; |
---|
1331 | | - msg_body->bss_params.edca_params_valid = |
---|
1332 | | - orig->bss_params.edca_params_valid; |
---|
1333 | | - |
---|
1334 | | - memcpy(&msg_body->bss_params.acbe, |
---|
1335 | | - &orig->bss_params.acbe, |
---|
1336 | | - sizeof(orig->bss_params.acbe)); |
---|
1337 | | - memcpy(&msg_body->bss_params.acbk, |
---|
1338 | | - &orig->bss_params.acbk, |
---|
1339 | | - sizeof(orig->bss_params.acbk)); |
---|
1340 | | - memcpy(&msg_body->bss_params.acvi, |
---|
1341 | | - &orig->bss_params.acvi, |
---|
1342 | | - sizeof(orig->bss_params.acvi)); |
---|
1343 | | - memcpy(&msg_body->bss_params.acvo, |
---|
1344 | | - &orig->bss_params.acvo, |
---|
1345 | | - sizeof(orig->bss_params.acvo)); |
---|
1346 | | - |
---|
1347 | | - msg_body->bss_params.ext_set_sta_key_param_valid = |
---|
1348 | | - orig->bss_params.ext_set_sta_key_param_valid; |
---|
1349 | | - |
---|
1350 | | - memcpy(&msg_body->bss_params.ext_set_sta_key_param, |
---|
1351 | | - &orig->bss_params.ext_set_sta_key_param, |
---|
1352 | | - sizeof(orig->bss_params.acvo)); |
---|
1353 | | - |
---|
1354 | | - msg_body->bss_params.wcn36xx_hal_persona = |
---|
1355 | | - orig->bss_params.wcn36xx_hal_persona; |
---|
1356 | | - msg_body->bss_params.spectrum_mgt_enable = |
---|
1357 | | - orig->bss_params.spectrum_mgt_enable; |
---|
1358 | | - msg_body->bss_params.tx_mgmt_power = orig->bss_params.tx_mgmt_power; |
---|
1359 | | - msg_body->bss_params.max_tx_power = orig->bss_params.max_tx_power; |
---|
1360 | | - |
---|
1361 | | - wcn36xx_smd_convert_sta_to_v1(wcn, &orig->bss_params.sta, |
---|
1362 | | - &msg_body->bss_params.sta); |
---|
1363 | | - |
---|
1364 | | - PREPARE_HAL_BUF(wcn->hal_buf, (*msg_body)); |
---|
1365 | | - |
---|
1366 | | - wcn36xx_dbg(WCN36XX_DBG_HAL, |
---|
1367 | | - "hal config bss v1 bssid %pM self_mac_addr %pM bss_type %d oper_mode %d nw_type %d\n", |
---|
1368 | | - bss->bssid, bss->self_mac_addr, bss->bss_type, |
---|
1369 | | - bss->oper_mode, bss->nw_type); |
---|
1370 | | - |
---|
1371 | | - wcn36xx_dbg(WCN36XX_DBG_HAL, |
---|
1372 | | - "- sta bssid %pM action %d sta_index %d bssid_index %d aid %d type %d mac %pM\n", |
---|
1373 | | - sta->bssid, sta->action, sta->sta_index, |
---|
1374 | | - sta->bssid_index, sta->aid, sta->type, sta->mac); |
---|
1375 | | - |
---|
1376 | | - ret = wcn36xx_smd_send_and_wait(wcn, msg_body->header.len); |
---|
1377 | | - kfree(msg_body); |
---|
1378 | | - |
---|
1379 | | - return ret; |
---|
1380 | | -} |
---|
1381 | | - |
---|
1382 | | - |
---|
1383 | | -static int wcn36xx_smd_config_bss_rsp(struct wcn36xx *wcn, |
---|
1384 | | - struct ieee80211_vif *vif, |
---|
1385 | | - struct ieee80211_sta *sta, |
---|
1386 | | - void *buf, |
---|
1387 | | - size_t len) |
---|
1388 | | -{ |
---|
1389 | | - struct wcn36xx_hal_config_bss_rsp_msg *rsp; |
---|
1390 | | - struct wcn36xx_hal_config_bss_rsp_params *params; |
---|
1391 | 1517 | struct wcn36xx_vif *vif_priv = wcn36xx_vif_to_priv(vif); |
---|
1392 | | - |
---|
1393 | | - if (len < sizeof(*rsp)) |
---|
1394 | | - return -EINVAL; |
---|
1395 | | - |
---|
1396 | | - rsp = (struct wcn36xx_hal_config_bss_rsp_msg *)buf; |
---|
1397 | | - params = &rsp->bss_rsp_params; |
---|
1398 | | - |
---|
1399 | | - if (params->status != WCN36XX_FW_MSG_RESULT_SUCCESS) { |
---|
1400 | | - wcn36xx_warn("hal config bss response failure: %d\n", |
---|
1401 | | - params->status); |
---|
1402 | | - return -EIO; |
---|
1403 | | - } |
---|
1404 | | - |
---|
1405 | | - wcn36xx_dbg(WCN36XX_DBG_HAL, |
---|
1406 | | - "hal config bss rsp status %d bss_idx %d dpu_desc_index %d" |
---|
1407 | | - " sta_idx %d self_idx %d bcast_idx %d mac %pM" |
---|
1408 | | - " power %d ucast_dpu_signature %d\n", |
---|
1409 | | - params->status, params->bss_index, params->dpu_desc_index, |
---|
1410 | | - params->bss_sta_index, params->bss_self_sta_index, |
---|
1411 | | - params->bss_bcast_sta_idx, params->mac, |
---|
1412 | | - params->tx_mgmt_power, params->ucast_dpu_signature); |
---|
1413 | | - |
---|
1414 | | - vif_priv->bss_index = params->bss_index; |
---|
1415 | | - |
---|
1416 | | - if (sta) { |
---|
1417 | | - struct wcn36xx_sta *sta_priv = wcn36xx_sta_to_priv(sta); |
---|
1418 | | - sta_priv->bss_sta_index = params->bss_sta_index; |
---|
1419 | | - sta_priv->bss_dpu_desc_index = params->dpu_desc_index; |
---|
1420 | | - } |
---|
1421 | | - |
---|
1422 | | - vif_priv->self_ucast_dpu_sign = params->ucast_dpu_signature; |
---|
1423 | | - |
---|
1424 | | - return 0; |
---|
1425 | | -} |
---|
1426 | | - |
---|
1427 | | -int wcn36xx_smd_config_bss(struct wcn36xx *wcn, struct ieee80211_vif *vif, |
---|
1428 | | - struct ieee80211_sta *sta, const u8 *bssid, |
---|
1429 | | - bool update) |
---|
1430 | | -{ |
---|
1431 | | - struct wcn36xx_hal_config_bss_req_msg *msg; |
---|
1432 | | - struct wcn36xx_hal_config_bss_params *bss; |
---|
1433 | | - struct wcn36xx_hal_config_sta_params *sta_params; |
---|
1434 | | - struct wcn36xx_vif *vif_priv = wcn36xx_vif_to_priv(vif); |
---|
1435 | | - int ret; |
---|
1436 | | - |
---|
1437 | | - mutex_lock(&wcn->hal_mutex); |
---|
1438 | | - msg = kzalloc(sizeof(*msg), GFP_KERNEL); |
---|
1439 | | - if (!msg) { |
---|
1440 | | - ret = -ENOMEM; |
---|
1441 | | - goto out; |
---|
1442 | | - } |
---|
1443 | | - INIT_HAL_MSG((*msg), WCN36XX_HAL_CONFIG_BSS_REQ); |
---|
1444 | | - |
---|
1445 | | - bss = &msg->bss_params; |
---|
1446 | | - sta_params = &bss->sta; |
---|
1447 | 1518 | |
---|
1448 | 1519 | WARN_ON(is_zero_ether_addr(bssid)); |
---|
1449 | 1520 | |
---|
.. | .. |
---|
1498 | 1569 | bss->ext_channel = IEEE80211_HT_PARAM_CHA_SEC_NONE; |
---|
1499 | 1570 | |
---|
1500 | 1571 | bss->reserved = 0; |
---|
1501 | | - wcn36xx_smd_set_sta_params(wcn, vif, sta, sta_params); |
---|
1502 | 1572 | |
---|
1503 | 1573 | /* wcn->ssid is only valid in AP and IBSS mode */ |
---|
1504 | 1574 | bss->ssid.length = vif_priv->ssid.length; |
---|
.. | .. |
---|
1523 | 1593 | bss->action = update; |
---|
1524 | 1594 | |
---|
1525 | 1595 | vif_priv->bss_type = bss->bss_type; |
---|
| 1596 | +} |
---|
| 1597 | + |
---|
| 1598 | +static int wcn36xx_smd_config_bss_v1(struct wcn36xx *wcn, |
---|
| 1599 | + struct ieee80211_vif *vif, |
---|
| 1600 | + struct ieee80211_sta *sta_80211, |
---|
| 1601 | + const u8 *bssid, |
---|
| 1602 | + bool update) |
---|
| 1603 | +{ |
---|
| 1604 | + struct wcn36xx_hal_config_bss_req_msg_v1 *msg_body; |
---|
| 1605 | + struct wcn36xx_hal_config_bss_params_v1 *bss; |
---|
| 1606 | + struct wcn36xx_hal_config_bss_params bss_v0; |
---|
| 1607 | + struct wcn36xx_hal_config_sta_params_v1 *sta; |
---|
| 1608 | + struct cfg80211_chan_def *chandef; |
---|
| 1609 | + int ret; |
---|
| 1610 | + |
---|
| 1611 | + msg_body = kzalloc(sizeof(*msg_body), GFP_KERNEL); |
---|
| 1612 | + if (!msg_body) |
---|
| 1613 | + return -ENOMEM; |
---|
| 1614 | + |
---|
| 1615 | + if (wcn->rf_id == RF_IRIS_WCN3680) { |
---|
| 1616 | + INIT_HAL_MSG_V1((*msg_body), WCN36XX_HAL_CONFIG_BSS_REQ); |
---|
| 1617 | + } else { |
---|
| 1618 | + INIT_HAL_MSG((*msg_body), WCN36XX_HAL_CONFIG_BSS_REQ); |
---|
| 1619 | + msg_body->header.len -= WCN36XX_DIFF_BSS_PARAMS_V1_NOVHT; |
---|
| 1620 | + } |
---|
| 1621 | + |
---|
| 1622 | + bss = &msg_body->bss_params; |
---|
| 1623 | + sta = &bss->sta; |
---|
| 1624 | + |
---|
| 1625 | + memset(&bss_v0, 0x00, sizeof(bss_v0)); |
---|
| 1626 | + wcn36xx_smd_set_bss_params(wcn, vif, sta_80211, bssid, update, &bss_v0); |
---|
| 1627 | + wcn36xx_smd_set_sta_params_v1(wcn, vif, sta_80211, sta); |
---|
| 1628 | + |
---|
| 1629 | + /* convert orig to v1 */ |
---|
| 1630 | + memcpy(bss->bssid, &bss_v0.bssid, ETH_ALEN); |
---|
| 1631 | + memcpy(bss->self_mac_addr, &bss_v0.self_mac_addr, ETH_ALEN); |
---|
| 1632 | + |
---|
| 1633 | + bss->bss_type = bss_v0.bss_type; |
---|
| 1634 | + bss->oper_mode = bss_v0.oper_mode; |
---|
| 1635 | + bss->nw_type = bss_v0.nw_type; |
---|
| 1636 | + |
---|
| 1637 | + bss->short_slot_time_supported = |
---|
| 1638 | + bss_v0.short_slot_time_supported; |
---|
| 1639 | + bss->lla_coexist = bss_v0.lla_coexist; |
---|
| 1640 | + bss->llb_coexist = bss_v0.llb_coexist; |
---|
| 1641 | + bss->llg_coexist = bss_v0.llg_coexist; |
---|
| 1642 | + bss->ht20_coexist = bss_v0.ht20_coexist; |
---|
| 1643 | + bss->lln_non_gf_coexist = bss_v0.lln_non_gf_coexist; |
---|
| 1644 | + |
---|
| 1645 | + bss->lsig_tx_op_protection_full_support = |
---|
| 1646 | + bss_v0.lsig_tx_op_protection_full_support; |
---|
| 1647 | + bss->rifs_mode = bss_v0.rifs_mode; |
---|
| 1648 | + bss->beacon_interval = bss_v0.beacon_interval; |
---|
| 1649 | + bss->dtim_period = bss_v0.dtim_period; |
---|
| 1650 | + bss->tx_channel_width_set = bss_v0.tx_channel_width_set; |
---|
| 1651 | + bss->oper_channel = bss_v0.oper_channel; |
---|
| 1652 | + |
---|
| 1653 | + if (wcn->hw->conf.chandef.width == NL80211_CHAN_WIDTH_80) { |
---|
| 1654 | + chandef = &wcn->hw->conf.chandef; |
---|
| 1655 | + bss->ext_channel = HW_VALUE_PHY(chandef->chan->hw_value); |
---|
| 1656 | + } else { |
---|
| 1657 | + bss->ext_channel = bss_v0.ext_channel; |
---|
| 1658 | + } |
---|
| 1659 | + |
---|
| 1660 | + bss->reserved = bss_v0.reserved; |
---|
| 1661 | + |
---|
| 1662 | + memcpy(&bss->ssid, &bss_v0.ssid, |
---|
| 1663 | + sizeof(bss_v0.ssid)); |
---|
| 1664 | + |
---|
| 1665 | + bss->action = bss_v0.action; |
---|
| 1666 | + bss->rateset = bss_v0.rateset; |
---|
| 1667 | + bss->ht = bss_v0.ht; |
---|
| 1668 | + bss->obss_prot_enabled = bss_v0.obss_prot_enabled; |
---|
| 1669 | + bss->rmf = bss_v0.rmf; |
---|
| 1670 | + bss->ht_oper_mode = bss_v0.ht_oper_mode; |
---|
| 1671 | + bss->dual_cts_protection = bss_v0.dual_cts_protection; |
---|
| 1672 | + |
---|
| 1673 | + bss->max_probe_resp_retry_limit = |
---|
| 1674 | + bss_v0.max_probe_resp_retry_limit; |
---|
| 1675 | + bss->hidden_ssid = bss_v0.hidden_ssid; |
---|
| 1676 | + bss->proxy_probe_resp = bss_v0.proxy_probe_resp; |
---|
| 1677 | + bss->edca_params_valid = bss_v0.edca_params_valid; |
---|
| 1678 | + |
---|
| 1679 | + memcpy(&bss->acbe, &bss_v0.acbe, |
---|
| 1680 | + sizeof(bss_v0.acbe)); |
---|
| 1681 | + memcpy(&bss->acbk, &bss_v0.acbk, |
---|
| 1682 | + sizeof(bss_v0.acbk)); |
---|
| 1683 | + memcpy(&bss->acvi, &bss_v0.acvi, |
---|
| 1684 | + sizeof(bss_v0.acvi)); |
---|
| 1685 | + memcpy(&bss->acvo, &bss_v0.acvo, |
---|
| 1686 | + sizeof(bss_v0.acvo)); |
---|
| 1687 | + |
---|
| 1688 | + bss->ext_set_sta_key_param_valid = |
---|
| 1689 | + bss_v0.ext_set_sta_key_param_valid; |
---|
| 1690 | + |
---|
| 1691 | + memcpy(&bss->ext_set_sta_key_param, |
---|
| 1692 | + &bss_v0.ext_set_sta_key_param, |
---|
| 1693 | + sizeof(bss_v0.acvo)); |
---|
| 1694 | + |
---|
| 1695 | + bss->wcn36xx_hal_persona = bss_v0.wcn36xx_hal_persona; |
---|
| 1696 | + bss->spectrum_mgt_enable = bss_v0.spectrum_mgt_enable; |
---|
| 1697 | + bss->tx_mgmt_power = bss_v0.tx_mgmt_power; |
---|
| 1698 | + bss->max_tx_power = bss_v0.max_tx_power; |
---|
| 1699 | + |
---|
| 1700 | + wcn36xx_smd_set_bss_vht_params(vif, sta_80211, bss); |
---|
| 1701 | + |
---|
| 1702 | + PREPARE_HAL_BUF(wcn->hal_buf, (*msg_body)); |
---|
| 1703 | + |
---|
| 1704 | + wcn36xx_dbg(WCN36XX_DBG_HAL, |
---|
| 1705 | + "hal config bss v1 bssid %pM self_mac_addr %pM bss_type %d oper_mode %d nw_type %d\n", |
---|
| 1706 | + bss->bssid, bss->self_mac_addr, bss->bss_type, |
---|
| 1707 | + bss->oper_mode, bss->nw_type); |
---|
| 1708 | + |
---|
| 1709 | + wcn36xx_dbg(WCN36XX_DBG_HAL, |
---|
| 1710 | + "- sta bssid %pM action %d sta_index %d bssid_index %d aid %d type %d mac %pM\n", |
---|
| 1711 | + sta->bssid, sta->action, sta->sta_index, |
---|
| 1712 | + sta->bssid_index, sta->aid, sta->type, sta->mac); |
---|
| 1713 | + |
---|
| 1714 | + ret = wcn36xx_smd_send_and_wait(wcn, msg_body->header.len); |
---|
| 1715 | + kfree(msg_body); |
---|
| 1716 | + |
---|
| 1717 | + return ret; |
---|
| 1718 | +} |
---|
| 1719 | + |
---|
| 1720 | +static int wcn36xx_smd_config_bss_v0(struct wcn36xx *wcn, |
---|
| 1721 | + struct ieee80211_vif *vif, |
---|
| 1722 | + struct ieee80211_sta *sta, |
---|
| 1723 | + const u8 *bssid, |
---|
| 1724 | + bool update) |
---|
| 1725 | +{ |
---|
| 1726 | + struct wcn36xx_hal_config_bss_req_msg *msg; |
---|
| 1727 | + struct wcn36xx_hal_config_bss_params *bss; |
---|
| 1728 | + struct wcn36xx_hal_config_sta_params *sta_params; |
---|
| 1729 | + int ret; |
---|
| 1730 | + |
---|
| 1731 | + msg = kzalloc(sizeof(*msg), GFP_KERNEL); |
---|
| 1732 | + if (!msg) |
---|
| 1733 | + return -ENOMEM; |
---|
| 1734 | + |
---|
| 1735 | + INIT_HAL_MSG((*msg), WCN36XX_HAL_CONFIG_BSS_REQ); |
---|
| 1736 | + |
---|
| 1737 | + bss = &msg->bss_params; |
---|
| 1738 | + sta_params = &bss->sta; |
---|
| 1739 | + |
---|
| 1740 | + wcn36xx_smd_set_bss_params(wcn, vif, sta, bssid, update, bss); |
---|
| 1741 | + wcn36xx_smd_set_sta_params(wcn, vif, sta, sta_params); |
---|
| 1742 | + |
---|
| 1743 | + PREPARE_HAL_BUF(wcn->hal_buf, (*msg)); |
---|
1526 | 1744 | |
---|
1527 | 1745 | wcn36xx_dbg(WCN36XX_DBG_HAL, |
---|
1528 | 1746 | "hal config bss bssid %pM self_mac_addr %pM bss_type %d oper_mode %d nw_type %d\n", |
---|
.. | .. |
---|
1536 | 1754 | sta_params->aid, sta_params->type, |
---|
1537 | 1755 | sta_params->mac); |
---|
1538 | 1756 | |
---|
1539 | | - if (!wcn36xx_is_fw_version(wcn, 1, 2, 2, 24)) { |
---|
1540 | | - ret = wcn36xx_smd_config_bss_v1(wcn, msg); |
---|
1541 | | - } else { |
---|
1542 | | - PREPARE_HAL_BUF(wcn->hal_buf, (*msg)); |
---|
| 1757 | + ret = wcn36xx_smd_send_and_wait(wcn, msg->header.len); |
---|
| 1758 | + kfree(msg); |
---|
1543 | 1759 | |
---|
1544 | | - ret = wcn36xx_smd_send_and_wait(wcn, msg->header.len); |
---|
| 1760 | + return ret; |
---|
| 1761 | +} |
---|
| 1762 | + |
---|
| 1763 | +static int wcn36xx_smd_config_bss_rsp(struct wcn36xx *wcn, |
---|
| 1764 | + struct ieee80211_vif *vif, |
---|
| 1765 | + struct ieee80211_sta *sta, |
---|
| 1766 | + void *buf, |
---|
| 1767 | + size_t len) |
---|
| 1768 | +{ |
---|
| 1769 | + struct wcn36xx_hal_config_bss_rsp_msg *rsp; |
---|
| 1770 | + struct wcn36xx_hal_config_bss_rsp_params *params; |
---|
| 1771 | + struct wcn36xx_vif *vif_priv = wcn36xx_vif_to_priv(vif); |
---|
| 1772 | + |
---|
| 1773 | + if (len < sizeof(*rsp)) |
---|
| 1774 | + return -EINVAL; |
---|
| 1775 | + |
---|
| 1776 | + rsp = (struct wcn36xx_hal_config_bss_rsp_msg *)buf; |
---|
| 1777 | + params = &rsp->bss_rsp_params; |
---|
| 1778 | + |
---|
| 1779 | + if (params->status != WCN36XX_FW_MSG_RESULT_SUCCESS) { |
---|
| 1780 | + wcn36xx_warn("hal config bss response failure: %d\n", |
---|
| 1781 | + params->status); |
---|
| 1782 | + return -EIO; |
---|
1545 | 1783 | } |
---|
| 1784 | + |
---|
| 1785 | + wcn36xx_dbg(WCN36XX_DBG_HAL, |
---|
| 1786 | + "hal config bss rsp status %d bss_idx %d dpu_desc_index %d" |
---|
| 1787 | + " sta_idx %d self_idx %d bcast_idx %d mac %pM" |
---|
| 1788 | + " power %d ucast_dpu_signature %d\n", |
---|
| 1789 | + params->status, params->bss_index, params->dpu_desc_index, |
---|
| 1790 | + params->bss_sta_index, params->bss_self_sta_index, |
---|
| 1791 | + params->bss_bcast_sta_idx, params->mac, |
---|
| 1792 | + params->tx_mgmt_power, params->ucast_dpu_signature); |
---|
| 1793 | + |
---|
| 1794 | + vif_priv->bss_index = params->bss_index; |
---|
| 1795 | + |
---|
| 1796 | + if (sta) { |
---|
| 1797 | + struct wcn36xx_sta *sta_priv = wcn36xx_sta_to_priv(sta); |
---|
| 1798 | + sta_priv->bss_sta_index = params->bss_sta_index; |
---|
| 1799 | + sta_priv->bss_dpu_desc_index = params->dpu_desc_index; |
---|
| 1800 | + } |
---|
| 1801 | + |
---|
| 1802 | + vif_priv->self_ucast_dpu_sign = params->ucast_dpu_signature; |
---|
| 1803 | + |
---|
| 1804 | + return 0; |
---|
| 1805 | +} |
---|
| 1806 | + |
---|
| 1807 | +int wcn36xx_smd_config_bss(struct wcn36xx *wcn, struct ieee80211_vif *vif, |
---|
| 1808 | + struct ieee80211_sta *sta, const u8 *bssid, |
---|
| 1809 | + bool update) |
---|
| 1810 | +{ |
---|
| 1811 | + int ret; |
---|
| 1812 | + |
---|
| 1813 | + mutex_lock(&wcn->hal_mutex); |
---|
| 1814 | + |
---|
| 1815 | + if (!wcn36xx_is_fw_version(wcn, 1, 2, 2, 24)) |
---|
| 1816 | + ret = wcn36xx_smd_config_bss_v1(wcn, vif, sta, bssid, update); |
---|
| 1817 | + else |
---|
| 1818 | + ret = wcn36xx_smd_config_bss_v0(wcn, vif, sta, bssid, update); |
---|
| 1819 | + |
---|
1546 | 1820 | if (ret) { |
---|
1547 | 1821 | wcn36xx_err("Sending hal_config_bss failed\n"); |
---|
1548 | 1822 | goto out; |
---|
.. | .. |
---|
1552 | 1826 | sta, |
---|
1553 | 1827 | wcn->hal_buf, |
---|
1554 | 1828 | wcn->hal_rsp_len); |
---|
1555 | | - if (ret) { |
---|
| 1829 | + if (ret) |
---|
1556 | 1830 | wcn36xx_err("hal_config_bss response failed err=%d\n", ret); |
---|
1557 | | - goto out; |
---|
1558 | | - } |
---|
| 1831 | + |
---|
1559 | 1832 | out: |
---|
1560 | | - kfree(msg); |
---|
1561 | 1833 | mutex_unlock(&wcn->hal_mutex); |
---|
1562 | 1834 | return ret; |
---|
1563 | 1835 | } |
---|
.. | .. |
---|
1620 | 1892 | msg_body.beacon_length6 = msg_body.beacon_length + 6; |
---|
1621 | 1893 | |
---|
1622 | 1894 | if (msg_body.beacon_length > BEACON_TEMPLATE_SIZE) { |
---|
1623 | | - wcn36xx_err("Beacon is to big: beacon size=%d\n", |
---|
| 1895 | + wcn36xx_err("Beacon is too big: beacon size=%d\n", |
---|
1624 | 1896 | msg_body.beacon_length); |
---|
1625 | 1897 | ret = -ENOMEM; |
---|
1626 | 1898 | goto out; |
---|
.. | .. |
---|
1924 | 2196 | mutex_unlock(&wcn->hal_mutex); |
---|
1925 | 2197 | return ret; |
---|
1926 | 2198 | } |
---|
| 2199 | + |
---|
1927 | 2200 | int wcn36xx_smd_set_power_params(struct wcn36xx *wcn, bool ignore_dtim) |
---|
1928 | 2201 | { |
---|
1929 | 2202 | struct wcn36xx_hal_set_power_params_req_msg msg_body; |
---|
.. | .. |
---|
1953 | 2226 | mutex_unlock(&wcn->hal_mutex); |
---|
1954 | 2227 | return ret; |
---|
1955 | 2228 | } |
---|
| 2229 | + |
---|
1956 | 2230 | /* Notice: This function should be called after associated, or else it |
---|
1957 | 2231 | * will be invalid |
---|
1958 | 2232 | */ |
---|
.. | .. |
---|
2080 | 2354 | INIT_HAL_MSG(msg_body, WCN36XX_HAL_FEATURE_CAPS_EXCHANGE_REQ); |
---|
2081 | 2355 | |
---|
2082 | 2356 | set_feat_caps(msg_body.feat_caps, STA_POWERSAVE); |
---|
| 2357 | + if (wcn->rf_id == RF_IRIS_WCN3680) |
---|
| 2358 | + set_feat_caps(msg_body.feat_caps, DOT11AC); |
---|
2083 | 2359 | |
---|
2084 | 2360 | PREPARE_HAL_BUF(wcn->hal_buf, msg_body); |
---|
2085 | 2361 | |
---|
.. | .. |
---|
2102 | 2378 | return ret; |
---|
2103 | 2379 | } |
---|
2104 | 2380 | |
---|
| 2381 | +static int wcn36xx_smd_add_ba_session_rsp(void *buf, int len, u8 *session) |
---|
| 2382 | +{ |
---|
| 2383 | + struct wcn36xx_hal_add_ba_session_rsp_msg *rsp; |
---|
| 2384 | + |
---|
| 2385 | + if (len < sizeof(*rsp)) |
---|
| 2386 | + return -EINVAL; |
---|
| 2387 | + |
---|
| 2388 | + rsp = (struct wcn36xx_hal_add_ba_session_rsp_msg *)buf; |
---|
| 2389 | + if (rsp->status != WCN36XX_FW_MSG_RESULT_SUCCESS) |
---|
| 2390 | + return rsp->status; |
---|
| 2391 | + |
---|
| 2392 | + *session = rsp->ba_session_id; |
---|
| 2393 | + |
---|
| 2394 | + return 0; |
---|
| 2395 | +} |
---|
| 2396 | + |
---|
2105 | 2397 | int wcn36xx_smd_add_ba_session(struct wcn36xx *wcn, |
---|
2106 | 2398 | struct ieee80211_sta *sta, |
---|
2107 | 2399 | u16 tid, |
---|
.. | .. |
---|
2110 | 2402 | u8 sta_index) |
---|
2111 | 2403 | { |
---|
2112 | 2404 | struct wcn36xx_hal_add_ba_session_req_msg msg_body; |
---|
| 2405 | + u8 session_id; |
---|
2113 | 2406 | int ret; |
---|
2114 | 2407 | |
---|
2115 | 2408 | mutex_lock(&wcn->hal_mutex); |
---|
.. | .. |
---|
2135 | 2428 | wcn36xx_err("Sending hal_add_ba_session failed\n"); |
---|
2136 | 2429 | goto out; |
---|
2137 | 2430 | } |
---|
2138 | | - ret = wcn36xx_smd_rsp_status_check(wcn->hal_buf, wcn->hal_rsp_len); |
---|
| 2431 | + ret = wcn36xx_smd_add_ba_session_rsp(wcn->hal_buf, wcn->hal_rsp_len, |
---|
| 2432 | + &session_id); |
---|
2139 | 2433 | if (ret) { |
---|
2140 | 2434 | wcn36xx_err("hal_add_ba_session response failed err=%d\n", ret); |
---|
2141 | 2435 | goto out; |
---|
2142 | 2436 | } |
---|
| 2437 | + |
---|
| 2438 | + ret = session_id; |
---|
2143 | 2439 | out: |
---|
2144 | 2440 | mutex_unlock(&wcn->hal_mutex); |
---|
2145 | 2441 | return ret; |
---|
2146 | 2442 | } |
---|
2147 | 2443 | |
---|
2148 | | -int wcn36xx_smd_add_ba(struct wcn36xx *wcn) |
---|
| 2444 | +int wcn36xx_smd_add_ba(struct wcn36xx *wcn, u8 session_id) |
---|
2149 | 2445 | { |
---|
2150 | 2446 | struct wcn36xx_hal_add_ba_req_msg msg_body; |
---|
2151 | 2447 | int ret; |
---|
.. | .. |
---|
2153 | 2449 | mutex_lock(&wcn->hal_mutex); |
---|
2154 | 2450 | INIT_HAL_MSG(msg_body, WCN36XX_HAL_ADD_BA_REQ); |
---|
2155 | 2451 | |
---|
2156 | | - msg_body.session_id = 0; |
---|
| 2452 | + msg_body.session_id = session_id; |
---|
2157 | 2453 | msg_body.win_size = WCN36XX_AGGR_BUFFER_SIZE; |
---|
2158 | 2454 | |
---|
2159 | 2455 | PREPARE_HAL_BUF(wcn->hal_buf, msg_body); |
---|
.. | .. |
---|
2212 | 2508 | return rsp->status; |
---|
2213 | 2509 | } |
---|
2214 | 2510 | |
---|
2215 | | -int wcn36xx_smd_trigger_ba(struct wcn36xx *wcn, u8 sta_index) |
---|
| 2511 | +int wcn36xx_smd_trigger_ba(struct wcn36xx *wcn, u8 sta_index, u16 tid, u8 session_id) |
---|
2216 | 2512 | { |
---|
2217 | 2513 | struct wcn36xx_hal_trigger_ba_req_msg msg_body; |
---|
2218 | 2514 | struct wcn36xx_hal_trigger_ba_req_candidate *candidate; |
---|
.. | .. |
---|
2221 | 2517 | mutex_lock(&wcn->hal_mutex); |
---|
2222 | 2518 | INIT_HAL_MSG(msg_body, WCN36XX_HAL_TRIGGER_BA_REQ); |
---|
2223 | 2519 | |
---|
2224 | | - msg_body.session_id = 0; |
---|
| 2520 | + msg_body.session_id = session_id; |
---|
2225 | 2521 | msg_body.candidate_cnt = 1; |
---|
2226 | 2522 | msg_body.header.len += sizeof(*candidate); |
---|
2227 | 2523 | PREPARE_HAL_BUF(wcn->hal_buf, msg_body); |
---|
.. | .. |
---|
2229 | 2525 | candidate = (struct wcn36xx_hal_trigger_ba_req_candidate *) |
---|
2230 | 2526 | (wcn->hal_buf + sizeof(msg_body)); |
---|
2231 | 2527 | candidate->sta_index = sta_index; |
---|
2232 | | - candidate->tid_bitmap = 1; |
---|
| 2528 | + candidate->tid_bitmap = 1 << tid; |
---|
2233 | 2529 | |
---|
2234 | 2530 | ret = wcn36xx_smd_send_and_wait(wcn, msg_body.header.len); |
---|
2235 | 2531 | if (ret) { |
---|
.. | .. |
---|
2632 | 2928 | kfree(hal_ind_msg); |
---|
2633 | 2929 | } |
---|
2634 | 2930 | } |
---|
| 2931 | + |
---|
2635 | 2932 | int wcn36xx_smd_open(struct wcn36xx *wcn) |
---|
2636 | 2933 | { |
---|
2637 | 2934 | wcn->hal_ind_wq = create_freezable_workqueue("wcn36xx_smd_ind"); |
---|