Commit c046555966e4a3a75b731e05ece3b1d763ac56ae
Exists in
smarc-imx_3.14.28_1.0.0_ga
and in
1 other branch
Merge branch 'for-john' of git://git.kernel.org/pub/scm/linux/kernel/git/iwlwifi/iwlwifi-next
Showing 13 changed files Side-by-side Diff
- drivers/net/wireless/iwlwifi/dvm/ucode.c
- drivers/net/wireless/iwlwifi/iwl-fw.h
- drivers/net/wireless/iwlwifi/iwl-io.c
- drivers/net/wireless/iwlwifi/iwl-trans.h
- drivers/net/wireless/iwlwifi/mvm/bt-coex.c
- drivers/net/wireless/iwlwifi/mvm/debugfs.c
- drivers/net/wireless/iwlwifi/mvm/fw.c
- drivers/net/wireless/iwlwifi/mvm/mac-ctxt.c
- drivers/net/wireless/iwlwifi/mvm/mac80211.c
- drivers/net/wireless/iwlwifi/mvm/mvm.h
- drivers/net/wireless/iwlwifi/mvm/ops.c
- drivers/net/wireless/iwlwifi/mvm/rx.c
- drivers/net/wireless/iwlwifi/pcie/tx.c
drivers/net/wireless/iwlwifi/dvm/ucode.c
... | ... | @@ -330,14 +330,13 @@ |
330 | 330 | enum iwl_ucode_type old_type; |
331 | 331 | static const u8 alive_cmd[] = { REPLY_ALIVE }; |
332 | 332 | |
333 | - old_type = priv->cur_ucode; | |
334 | - priv->cur_ucode = ucode_type; | |
335 | 333 | fw = iwl_get_ucode_image(priv, ucode_type); |
334 | + if (WARN_ON(!fw)) | |
335 | + return -EINVAL; | |
336 | 336 | |
337 | + old_type = priv->cur_ucode; | |
338 | + priv->cur_ucode = ucode_type; | |
337 | 339 | priv->ucode_loaded = false; |
338 | - | |
339 | - if (!fw) | |
340 | - return -EINVAL; | |
341 | 340 | |
342 | 341 | iwl_init_notification_wait(&priv->notif_wait, &alive_wait, |
343 | 342 | alive_cmd, ARRAY_SIZE(alive_cmd), |
drivers/net/wireless/iwlwifi/iwl-fw.h
... | ... | @@ -100,7 +100,7 @@ |
100 | 100 | IWL_UCODE_TLV_FLAGS_P2P = BIT(3), |
101 | 101 | IWL_UCODE_TLV_FLAGS_DW_BC_TABLE = BIT(4), |
102 | 102 | IWL_UCODE_TLV_FLAGS_NEWBT_COEX = BIT(5), |
103 | - IWL_UCODE_TLV_FLAGS_UAPSD = BIT(6), | |
103 | + IWL_UCODE_TLV_FLAGS_PM_CMD_SUPPORT = BIT(6), | |
104 | 104 | IWL_UCODE_TLV_FLAGS_SHORT_BL = BIT(7), |
105 | 105 | IWL_UCODE_TLV_FLAGS_RX_ENERGY_API = BIT(8), |
106 | 106 | IWL_UCODE_TLV_FLAGS_TIME_EVENT_API_V2 = BIT(9), |
... | ... | @@ -113,6 +113,7 @@ |
113 | 113 | IWL_UCODE_TLV_FLAGS_SCHED_SCAN = BIT(17), |
114 | 114 | IWL_UCODE_TLV_FLAGS_STA_KEY_CMD = BIT(19), |
115 | 115 | IWL_UCODE_TLV_FLAGS_DEVICE_PS_CMD = BIT(20), |
116 | + IWL_UCODE_TLV_FLAGS_UAPSD_SUPPORT = BIT(24), | |
116 | 117 | }; |
117 | 118 | |
118 | 119 | /* The default calibrate table size if not specified by firmware file */ |
drivers/net/wireless/iwlwifi/iwl-io.c
drivers/net/wireless/iwlwifi/iwl-trans.h
drivers/net/wireless/iwlwifi/mvm/bt-coex.c
... | ... | @@ -505,12 +505,16 @@ |
505 | 505 | struct iwl_mvm_sta *mvmsta; |
506 | 506 | int ret; |
507 | 507 | |
508 | - /* This can happen if the station has been removed right now */ | |
509 | 508 | if (sta_id == IWL_MVM_STATION_COUNT) |
510 | 509 | return 0; |
511 | 510 | |
512 | 511 | sta = rcu_dereference_protected(mvm->fw_id_to_mac_id[sta_id], |
513 | 512 | lockdep_is_held(&mvm->mutex)); |
513 | + | |
514 | + /* This can happen if the station has been removed right now */ | |
515 | + if (IS_ERR_OR_NULL(sta)) | |
516 | + return 0; | |
517 | + | |
514 | 518 | mvmsta = (void *)sta->drv_priv; |
515 | 519 | |
516 | 520 | /* nothing to do */ |
... | ... | @@ -751,7 +755,7 @@ |
751 | 755 | |
752 | 756 | cmd.bt_secondary_ci = |
753 | 757 | iwl_ci_mask[chan->def.chan->hw_value][ci_bw_idx]; |
754 | - cmd.secondary_ch_phy_id = *((u16 *)data.primary->drv_priv); | |
758 | + cmd.secondary_ch_phy_id = *((u16 *)data.secondary->drv_priv); | |
755 | 759 | } |
756 | 760 | |
757 | 761 | rcu_read_unlock(); |
drivers/net/wireless/iwlwifi/mvm/debugfs.c
... | ... | @@ -342,6 +342,7 @@ |
342 | 342 | case MVM_DEBUGFS_PM_DISABLE_POWER_OFF: |
343 | 343 | IWL_DEBUG_POWER(mvm, "disable_power_off=%d\n", val); |
344 | 344 | dbgfs_pm->disable_power_off = val; |
345 | + break; | |
345 | 346 | case MVM_DEBUGFS_PM_LPRX_ENA: |
346 | 347 | IWL_DEBUG_POWER(mvm, "lprx %s\n", val ? "enabled" : "disabled"); |
347 | 348 | dbgfs_pm->lprx_ena = val; |
drivers/net/wireless/iwlwifi/mvm/fw.c
... | ... | @@ -151,13 +151,11 @@ |
151 | 151 | enum iwl_ucode_type old_type = mvm->cur_ucode; |
152 | 152 | static const u8 alive_cmd[] = { MVM_ALIVE }; |
153 | 153 | |
154 | - mvm->cur_ucode = ucode_type; | |
155 | 154 | fw = iwl_get_ucode_image(mvm, ucode_type); |
156 | - | |
157 | - mvm->ucode_loaded = false; | |
158 | - | |
159 | - if (!fw) | |
155 | + if (WARN_ON(!fw)) | |
160 | 156 | return -EINVAL; |
157 | + mvm->cur_ucode = ucode_type; | |
158 | + mvm->ucode_loaded = false; | |
161 | 159 | |
162 | 160 | iwl_init_notification_wait(&mvm->notif_wait, &alive_wait, |
163 | 161 | alive_cmd, ARRAY_SIZE(alive_cmd), |
drivers/net/wireless/iwlwifi/mvm/mac-ctxt.c
... | ... | @@ -719,7 +719,9 @@ |
719 | 719 | cmd.filter_flags = cpu_to_le32(MAC_FILTER_IN_PROMISC | |
720 | 720 | MAC_FILTER_IN_CONTROL_AND_MGMT | |
721 | 721 | MAC_FILTER_IN_BEACON | |
722 | - MAC_FILTER_IN_PROBE_REQUEST); | |
722 | + MAC_FILTER_IN_PROBE_REQUEST | | |
723 | + MAC_FILTER_IN_CRC32); | |
724 | + mvm->hw->flags |= IEEE80211_HW_RX_INCLUDES_FCS; | |
723 | 725 | |
724 | 726 | return iwl_mvm_mac_ctxt_send_cmd(mvm, &cmd); |
725 | 727 | } |
... | ... | @@ -1122,6 +1124,10 @@ |
1122 | 1124 | } |
1123 | 1125 | |
1124 | 1126 | mvmvif->uploaded = false; |
1127 | + | |
1128 | + if (vif->type == NL80211_IFTYPE_MONITOR) | |
1129 | + mvm->hw->flags &= ~IEEE80211_HW_RX_INCLUDES_FCS; | |
1130 | + | |
1125 | 1131 | return 0; |
1126 | 1132 | } |
1127 | 1133 |
drivers/net/wireless/iwlwifi/mvm/mac80211.c
... | ... | @@ -164,8 +164,7 @@ |
164 | 164 | IEEE80211_HW_TIMING_BEACON_ONLY | |
165 | 165 | IEEE80211_HW_CONNECTION_MONITOR | |
166 | 166 | IEEE80211_HW_SUPPORTS_DYNAMIC_SMPS | |
167 | - IEEE80211_HW_SUPPORTS_STATIC_SMPS | | |
168 | - IEEE80211_HW_SUPPORTS_UAPSD; | |
167 | + IEEE80211_HW_SUPPORTS_STATIC_SMPS; | |
169 | 168 | |
170 | 169 | hw->queues = mvm->first_agg_queue; |
171 | 170 | hw->offchannel_tx_hw_queue = IWL_MVM_OFFCHANNEL_QUEUE; |
... | ... | @@ -180,6 +179,12 @@ |
180 | 179 | !iwlwifi_mod_params.sw_crypto) |
181 | 180 | hw->flags |= IEEE80211_HW_MFP_CAPABLE; |
182 | 181 | |
182 | + if (mvm->fw->ucode_capa.flags & IWL_UCODE_TLV_FLAGS_UAPSD_SUPPORT) { | |
183 | + hw->flags |= IEEE80211_HW_SUPPORTS_UAPSD; | |
184 | + hw->uapsd_queues = IWL_UAPSD_AC_INFO; | |
185 | + hw->uapsd_max_sp_len = IWL_UAPSD_MAX_SP; | |
186 | + } | |
187 | + | |
183 | 188 | hw->sta_data_size = sizeof(struct iwl_mvm_sta); |
184 | 189 | hw->vif_data_size = sizeof(struct iwl_mvm_vif); |
185 | 190 | hw->chanctx_data_size = sizeof(u16); |
... | ... | @@ -204,8 +209,6 @@ |
204 | 209 | |
205 | 210 | hw->wiphy->max_remain_on_channel_duration = 10000; |
206 | 211 | hw->max_listen_interval = IWL_CONN_MAX_LISTEN_INTERVAL; |
207 | - hw->uapsd_queues = IWL_UAPSD_AC_INFO; | |
208 | - hw->uapsd_max_sp_len = IWL_UAPSD_MAX_SP; | |
209 | 212 | |
210 | 213 | /* Extract MAC address */ |
211 | 214 | memcpy(mvm->addresses[0].addr, mvm->nvm_data->hw_addr, ETH_ALEN); |
... | ... | @@ -861,7 +864,8 @@ |
861 | 864 | /* reset rssi values */ |
862 | 865 | mvmvif->bf_data.ave_beacon_signal = 0; |
863 | 866 | |
864 | - if (!(mvm->fw->ucode_capa.flags & IWL_UCODE_TLV_FLAGS_UAPSD)) { | |
867 | + if (!(mvm->fw->ucode_capa.flags & | |
868 | + IWL_UCODE_TLV_FLAGS_PM_CMD_SUPPORT)) { | |
865 | 869 | /* Workaround for FW bug, otherwise FW disables device |
866 | 870 | * power save upon disassociation |
867 | 871 | */ |
drivers/net/wireless/iwlwifi/mvm/mvm.h
drivers/net/wireless/iwlwifi/mvm/ops.c
... | ... | @@ -459,7 +459,7 @@ |
459 | 459 | if (err) |
460 | 460 | goto out_unregister; |
461 | 461 | |
462 | - if (mvm->fw->ucode_capa.flags & IWL_UCODE_TLV_FLAGS_UAPSD) | |
462 | + if (mvm->fw->ucode_capa.flags & IWL_UCODE_TLV_FLAGS_PM_CMD_SUPPORT) | |
463 | 463 | mvm->pm_ops = &pm_mac_ops; |
464 | 464 | else |
465 | 465 | mvm->pm_ops = &pm_legacy_ops; |
drivers/net/wireless/iwlwifi/mvm/rx.c
... | ... | @@ -300,10 +300,14 @@ |
300 | 300 | return 0; |
301 | 301 | } |
302 | 302 | |
303 | + /* | |
304 | + * Keep packets with CRC errors (and with overrun) for monitor mode | |
305 | + * (otherwise the firmware discards them) but mark them as bad. | |
306 | + */ | |
303 | 307 | if (!(rx_pkt_status & RX_MPDU_RES_STATUS_CRC_OK) || |
304 | 308 | !(rx_pkt_status & RX_MPDU_RES_STATUS_OVERRUN_OK)) { |
305 | 309 | IWL_DEBUG_RX(mvm, "Bad CRC or FIFO: 0x%08X.\n", rx_pkt_status); |
306 | - return 0; | |
310 | + rx_status.flag |= RX_FLAG_FAILED_FCS_CRC; | |
307 | 311 | } |
308 | 312 | |
309 | 313 | /* This will be used in several places later */ |
drivers/net/wireless/iwlwifi/pcie/tx.c
... | ... | @@ -1499,12 +1499,11 @@ |
1499 | 1499 | IWL_DEBUG_INFO(trans, "Attempting to send sync command %s\n", |
1500 | 1500 | get_cmd_string(trans_pcie, cmd->id)); |
1501 | 1501 | |
1502 | - if (WARN_ON(test_and_set_bit(STATUS_HCMD_ACTIVE, | |
1503 | - &trans_pcie->status))) { | |
1504 | - IWL_ERR(trans, "Command %s: a command is already active!\n", | |
1505 | - get_cmd_string(trans_pcie, cmd->id)); | |
1502 | + if (WARN(test_and_set_bit(STATUS_HCMD_ACTIVE, | |
1503 | + &trans_pcie->status), | |
1504 | + "Command %s: a command is already active!\n", | |
1505 | + get_cmd_string(trans_pcie, cmd->id))) | |
1506 | 1506 | return -EIO; |
1507 | - } | |
1508 | 1507 | |
1509 | 1508 | IWL_DEBUG_INFO(trans, "Setting HCMD_ACTIVE for command %s\n", |
1510 | 1509 | get_cmd_string(trans_pcie, cmd->id)); |