Merge tag 'iwlwifi-next-for-kalle-2020-01-11' of git://git.kernel.org/pub/scm/linux/kernel/git/iwlwifi/iwlwifi-next
First set of patches intended for v5.6 * Support new versions of the FTM FW APIs; * Fix an old bug in D3 (WoWLAN); * A couple of fixes/improvements in the receive-buffers code; * Fix in the debugging where we were skipping one TXQ; * Support new version of the beacon template FW API; * Print some extra information when the driver is loaded; * Some debugging infrastructure (aka. yoyo) updates; * Support for a new HW version; * Second phase of device configuration work started; * Some clean-ups;
このコミットが含まれているのは:
@@ -989,6 +989,8 @@ static int __iwl_mvm_suspend(struct ieee80211_hw *hw,
|
||||
|
||||
mutex_lock(&mvm->mutex);
|
||||
|
||||
set_bit(IWL_MVM_STATUS_IN_D3, &mvm->status);
|
||||
|
||||
vif = iwl_mvm_get_bss_vif(mvm);
|
||||
if (IS_ERR_OR_NULL(vif)) {
|
||||
ret = 1;
|
||||
@@ -1083,6 +1085,8 @@ static int __iwl_mvm_suspend(struct ieee80211_hw *hw,
|
||||
ieee80211_restart_hw(mvm->hw);
|
||||
}
|
||||
}
|
||||
|
||||
clear_bit(IWL_MVM_STATUS_IN_D3, &mvm->status);
|
||||
}
|
||||
out_noreset:
|
||||
mutex_unlock(&mvm->mutex);
|
||||
@@ -1929,6 +1933,8 @@ static int __iwl_mvm_resume(struct iwl_mvm *mvm, bool test)
|
||||
|
||||
mutex_lock(&mvm->mutex);
|
||||
|
||||
clear_bit(IWL_MVM_STATUS_IN_D3, &mvm->status);
|
||||
|
||||
/* get the BSS vif pointer again */
|
||||
vif = iwl_mvm_get_bss_vif(mvm);
|
||||
if (IS_ERR_OR_NULL(vif))
|
||||
|
@@ -752,7 +752,7 @@ static ssize_t iwl_dbgfs_fw_ver_read(struct file *file, char __user *user_buf,
|
||||
pos += scnprintf(pos, endpos - pos, "FW: %s\n",
|
||||
mvm->fwrt.fw->human_readable);
|
||||
pos += scnprintf(pos, endpos - pos, "Device: %s\n",
|
||||
mvm->fwrt.trans->cfg->name);
|
||||
mvm->fwrt.trans->name);
|
||||
pos += scnprintf(pos, endpos - pos, "Bus: %s\n",
|
||||
mvm->fwrt.dev->bus->name);
|
||||
|
||||
|
@@ -208,10 +208,11 @@ static void iwl_mvm_ftm_cmd(struct iwl_mvm *mvm, struct ieee80211_vif *vif,
|
||||
cmd->tsf_mac_id = cpu_to_le32(0xff);
|
||||
}
|
||||
|
||||
static int iwl_mvm_ftm_target_chandef(struct iwl_mvm *mvm,
|
||||
struct cfg80211_pmsr_request_peer *peer,
|
||||
u8 *channel, u8 *bandwidth,
|
||||
u8 *ctrl_ch_position)
|
||||
static int
|
||||
iwl_mvm_ftm_target_chandef_v1(struct iwl_mvm *mvm,
|
||||
struct cfg80211_pmsr_request_peer *peer,
|
||||
u8 *channel, u8 *bandwidth,
|
||||
u8 *ctrl_ch_position)
|
||||
{
|
||||
u32 freq = peer->chandef.chan->center_freq;
|
||||
|
||||
@@ -242,6 +243,45 @@ static int iwl_mvm_ftm_target_chandef(struct iwl_mvm *mvm,
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
iwl_mvm_ftm_target_chandef_v2(struct iwl_mvm *mvm,
|
||||
struct cfg80211_pmsr_request_peer *peer,
|
||||
u8 *channel, u8 *format_bw,
|
||||
u8 *ctrl_ch_position)
|
||||
{
|
||||
u32 freq = peer->chandef.chan->center_freq;
|
||||
|
||||
*channel = ieee80211_frequency_to_channel(freq);
|
||||
|
||||
switch (peer->chandef.width) {
|
||||
case NL80211_CHAN_WIDTH_20_NOHT:
|
||||
*format_bw = IWL_LOCATION_FRAME_FORMAT_LEGACY;
|
||||
*format_bw |= IWL_LOCATION_BW_20MHZ << LOCATION_BW_POS;
|
||||
break;
|
||||
case NL80211_CHAN_WIDTH_20:
|
||||
*format_bw = IWL_LOCATION_FRAME_FORMAT_HT;
|
||||
*format_bw |= IWL_LOCATION_BW_20MHZ << LOCATION_BW_POS;
|
||||
break;
|
||||
case NL80211_CHAN_WIDTH_40:
|
||||
*format_bw = IWL_LOCATION_FRAME_FORMAT_HT;
|
||||
*format_bw |= IWL_LOCATION_BW_40MHZ << LOCATION_BW_POS;
|
||||
break;
|
||||
case NL80211_CHAN_WIDTH_80:
|
||||
*format_bw = IWL_LOCATION_FRAME_FORMAT_VHT;
|
||||
*format_bw |= IWL_LOCATION_BW_80MHZ << LOCATION_BW_POS;
|
||||
break;
|
||||
default:
|
||||
IWL_ERR(mvm, "Unsupported BW in FTM request (%d)\n",
|
||||
peer->chandef.width);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
*ctrl_ch_position = (peer->chandef.width > NL80211_CHAN_WIDTH_20) ?
|
||||
iwl_mvm_get_ctrl_pos(&peer->chandef) : 0;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
iwl_mvm_ftm_put_target_v2(struct iwl_mvm *mvm,
|
||||
struct cfg80211_pmsr_request_peer *peer,
|
||||
@@ -249,9 +289,9 @@ iwl_mvm_ftm_put_target_v2(struct iwl_mvm *mvm,
|
||||
{
|
||||
int ret;
|
||||
|
||||
ret = iwl_mvm_ftm_target_chandef(mvm, peer, &target->channel_num,
|
||||
&target->bandwidth,
|
||||
&target->ctrl_ch_position);
|
||||
ret = iwl_mvm_ftm_target_chandef_v1(mvm, peer, &target->channel_num,
|
||||
&target->bandwidth,
|
||||
&target->ctrl_ch_position);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
@@ -278,18 +318,11 @@ iwl_mvm_ftm_put_target_v2(struct iwl_mvm *mvm,
|
||||
#define FTM_PUT_FLAG(flag) (target->initiator_ap_flags |= \
|
||||
cpu_to_le32(IWL_INITIATOR_AP_FLAGS_##flag))
|
||||
|
||||
static int iwl_mvm_ftm_put_target(struct iwl_mvm *mvm,
|
||||
struct cfg80211_pmsr_request_peer *peer,
|
||||
struct iwl_tof_range_req_ap_entry *target)
|
||||
static void
|
||||
iwl_mvm_ftm_put_target_common(struct iwl_mvm *mvm,
|
||||
struct cfg80211_pmsr_request_peer *peer,
|
||||
struct iwl_tof_range_req_ap_entry *target)
|
||||
{
|
||||
int ret;
|
||||
|
||||
ret = iwl_mvm_ftm_target_chandef(mvm, peer, &target->channel_num,
|
||||
&target->bandwidth,
|
||||
&target->ctrl_ch_position);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
memcpy(target->bssid, peer->addr, ETH_ALEN);
|
||||
target->burst_period =
|
||||
cpu_to_le16(peer->ftm.burst_period);
|
||||
@@ -314,24 +347,149 @@ static int iwl_mvm_ftm_put_target(struct iwl_mvm *mvm,
|
||||
FTM_PUT_FLAG(ALGO_LR);
|
||||
else if (IWL_MVM_FTM_INITIATOR_ALGO == IWL_TOF_ALGO_TYPE_FFT)
|
||||
FTM_PUT_FLAG(ALGO_FFT);
|
||||
}
|
||||
|
||||
static int
|
||||
iwl_mvm_ftm_put_target_v3(struct iwl_mvm *mvm,
|
||||
struct cfg80211_pmsr_request_peer *peer,
|
||||
struct iwl_tof_range_req_ap_entry_v3 *target)
|
||||
{
|
||||
int ret;
|
||||
|
||||
ret = iwl_mvm_ftm_target_chandef_v1(mvm, peer, &target->channel_num,
|
||||
&target->bandwidth,
|
||||
&target->ctrl_ch_position);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
/*
|
||||
* Versions 3 and 4 has some common fields, so
|
||||
* iwl_mvm_ftm_put_target_common() can be used for version 7 too.
|
||||
*/
|
||||
iwl_mvm_ftm_put_target_common(mvm, peer, (void *)target);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int iwl_mvm_ftm_put_target_v4(struct iwl_mvm *mvm,
|
||||
struct cfg80211_pmsr_request_peer *peer,
|
||||
struct iwl_tof_range_req_ap_entry *target)
|
||||
{
|
||||
int ret;
|
||||
|
||||
ret = iwl_mvm_ftm_target_chandef_v2(mvm, peer, &target->channel_num,
|
||||
&target->format_bw,
|
||||
&target->ctrl_ch_position);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
iwl_mvm_ftm_put_target_common(mvm, peer, target);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int iwl_mvm_ftm_send_cmd(struct iwl_mvm *mvm, struct iwl_host_cmd *hcmd)
|
||||
{
|
||||
u32 status;
|
||||
int err = iwl_mvm_send_cmd_status(mvm, hcmd, &status);
|
||||
|
||||
if (!err && status) {
|
||||
IWL_ERR(mvm, "FTM range request command failure, status: %u\n",
|
||||
status);
|
||||
err = iwl_ftm_range_request_status_to_err(status);
|
||||
}
|
||||
|
||||
return err;
|
||||
}
|
||||
|
||||
static int iwl_mvm_ftm_start_v5(struct iwl_mvm *mvm, struct ieee80211_vif *vif,
|
||||
struct cfg80211_pmsr_request *req)
|
||||
{
|
||||
struct iwl_tof_range_req_cmd_v5 cmd_v5;
|
||||
struct iwl_host_cmd hcmd = {
|
||||
.id = iwl_cmd_id(TOF_RANGE_REQ_CMD, LOCATION_GROUP, 0),
|
||||
.dataflags[0] = IWL_HCMD_DFL_DUP,
|
||||
.data[0] = &cmd_v5,
|
||||
.len[0] = sizeof(cmd_v5),
|
||||
};
|
||||
u8 i;
|
||||
int err;
|
||||
|
||||
iwl_mvm_ftm_cmd_v5(mvm, vif, &cmd_v5, req);
|
||||
|
||||
for (i = 0; i < cmd_v5.num_of_ap; i++) {
|
||||
struct cfg80211_pmsr_request_peer *peer = &req->peers[i];
|
||||
|
||||
err = iwl_mvm_ftm_put_target_v2(mvm, peer, &cmd_v5.ap[i]);
|
||||
if (err)
|
||||
return err;
|
||||
}
|
||||
|
||||
return iwl_mvm_ftm_send_cmd(mvm, &hcmd);
|
||||
}
|
||||
|
||||
static int iwl_mvm_ftm_start_v7(struct iwl_mvm *mvm, struct ieee80211_vif *vif,
|
||||
struct cfg80211_pmsr_request *req)
|
||||
{
|
||||
struct iwl_tof_range_req_cmd_v7 cmd_v7;
|
||||
struct iwl_host_cmd hcmd = {
|
||||
.id = iwl_cmd_id(TOF_RANGE_REQ_CMD, LOCATION_GROUP, 0),
|
||||
.dataflags[0] = IWL_HCMD_DFL_DUP,
|
||||
.data[0] = &cmd_v7,
|
||||
.len[0] = sizeof(cmd_v7),
|
||||
};
|
||||
u8 i;
|
||||
int err;
|
||||
|
||||
/*
|
||||
* Versions 7 and 8 has the same structure except from the responders
|
||||
* list, so iwl_mvm_ftm_cmd() can be used for version 7 too.
|
||||
*/
|
||||
iwl_mvm_ftm_cmd(mvm, vif, (void *)&cmd_v7, req);
|
||||
|
||||
for (i = 0; i < cmd_v7.num_of_ap; i++) {
|
||||
struct cfg80211_pmsr_request_peer *peer = &req->peers[i];
|
||||
|
||||
err = iwl_mvm_ftm_put_target_v3(mvm, peer, &cmd_v7.ap[i]);
|
||||
if (err)
|
||||
return err;
|
||||
}
|
||||
|
||||
return iwl_mvm_ftm_send_cmd(mvm, &hcmd);
|
||||
}
|
||||
|
||||
static int iwl_mvm_ftm_start_v8(struct iwl_mvm *mvm, struct ieee80211_vif *vif,
|
||||
struct cfg80211_pmsr_request *req)
|
||||
{
|
||||
struct iwl_tof_range_req_cmd cmd;
|
||||
struct iwl_host_cmd hcmd = {
|
||||
.id = iwl_cmd_id(TOF_RANGE_REQ_CMD, LOCATION_GROUP, 0),
|
||||
.dataflags[0] = IWL_HCMD_DFL_DUP,
|
||||
.data[0] = &cmd,
|
||||
.len[0] = sizeof(cmd),
|
||||
};
|
||||
u8 i;
|
||||
int err;
|
||||
|
||||
iwl_mvm_ftm_cmd(mvm, vif, &cmd, req);
|
||||
|
||||
for (i = 0; i < cmd.num_of_ap; i++) {
|
||||
struct cfg80211_pmsr_request_peer *peer = &req->peers[i];
|
||||
|
||||
err = iwl_mvm_ftm_put_target_v4(mvm, peer, &cmd.ap[i]);
|
||||
if (err)
|
||||
return err;
|
||||
}
|
||||
|
||||
return iwl_mvm_ftm_send_cmd(mvm, &hcmd);
|
||||
}
|
||||
|
||||
int iwl_mvm_ftm_start(struct iwl_mvm *mvm, struct ieee80211_vif *vif,
|
||||
struct cfg80211_pmsr_request *req)
|
||||
{
|
||||
struct iwl_tof_range_req_cmd_v5 cmd_v5;
|
||||
struct iwl_tof_range_req_cmd cmd;
|
||||
bool new_api = fw_has_api(&mvm->fw->ucode_capa,
|
||||
IWL_UCODE_TLV_API_FTM_NEW_RANGE_REQ);
|
||||
u8 num_of_ap;
|
||||
struct iwl_host_cmd hcmd = {
|
||||
.id = iwl_cmd_id(TOF_RANGE_REQ_CMD, LOCATION_GROUP, 0),
|
||||
.dataflags[0] = IWL_HCMD_DFL_DUP,
|
||||
};
|
||||
u32 status = 0;
|
||||
int err, i;
|
||||
int err;
|
||||
|
||||
lockdep_assert_held(&mvm->mutex);
|
||||
|
||||
@@ -339,35 +497,16 @@ int iwl_mvm_ftm_start(struct iwl_mvm *mvm, struct ieee80211_vif *vif,
|
||||
return -EBUSY;
|
||||
|
||||
if (new_api) {
|
||||
iwl_mvm_ftm_cmd(mvm, vif, &cmd, req);
|
||||
hcmd.data[0] = &cmd;
|
||||
hcmd.len[0] = sizeof(cmd);
|
||||
num_of_ap = cmd.num_of_ap;
|
||||
} else {
|
||||
iwl_mvm_ftm_cmd_v5(mvm, vif, &cmd_v5, req);
|
||||
hcmd.data[0] = &cmd_v5;
|
||||
hcmd.len[0] = sizeof(cmd_v5);
|
||||
num_of_ap = cmd_v5.num_of_ap;
|
||||
}
|
||||
u8 cmd_ver = iwl_mvm_lookup_cmd_ver(mvm->fw, LOCATION_GROUP,
|
||||
TOF_RANGE_REQ_CMD);
|
||||
|
||||
for (i = 0; i < num_of_ap; i++) {
|
||||
struct cfg80211_pmsr_request_peer *peer = &req->peers[i];
|
||||
|
||||
if (new_api)
|
||||
err = iwl_mvm_ftm_put_target(mvm, peer, &cmd.ap[i]);
|
||||
if (cmd_ver == 8)
|
||||
err = iwl_mvm_ftm_start_v8(mvm, vif, req);
|
||||
else
|
||||
err = iwl_mvm_ftm_put_target_v2(mvm, peer,
|
||||
&cmd_v5.ap[i]);
|
||||
err = iwl_mvm_ftm_start_v7(mvm, vif, req);
|
||||
|
||||
if (err)
|
||||
return err;
|
||||
}
|
||||
|
||||
err = iwl_mvm_send_cmd_status(mvm, &hcmd, &status);
|
||||
if (!err && status) {
|
||||
IWL_ERR(mvm, "FTM range request command failure, status: %u\n",
|
||||
status);
|
||||
err = iwl_ftm_range_request_status_to_err(status);
|
||||
} else {
|
||||
err = iwl_mvm_ftm_start_v5(mvm, vif, req);
|
||||
}
|
||||
|
||||
if (!err) {
|
||||
|
@@ -6,7 +6,7 @@
|
||||
* GPL LICENSE SUMMARY
|
||||
*
|
||||
* Copyright(c) 2015 - 2017 Intel Deutschland GmbH
|
||||
* Copyright (C) 2018 Intel Corporation
|
||||
* Copyright (C) 2018 - 2019 Intel Corporation
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of version 2 of the GNU General Public License as
|
||||
@@ -27,7 +27,7 @@
|
||||
* BSD LICENSE
|
||||
*
|
||||
* Copyright(c) 2015 - 2017 Intel Deutschland GmbH
|
||||
* Copyright (C) 2018 Intel Corporation
|
||||
* Copyright (C) 2018 - 2019 Intel Corporation
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@@ -62,12 +62,72 @@
|
||||
#include "mvm.h"
|
||||
#include "constants.h"
|
||||
|
||||
static int iwl_mvm_ftm_responder_set_bw_v1(struct cfg80211_chan_def *chandef,
|
||||
u8 *bw, u8 *ctrl_ch_position)
|
||||
{
|
||||
switch (chandef->width) {
|
||||
case NL80211_CHAN_WIDTH_20_NOHT:
|
||||
*bw = IWL_TOF_BW_20_LEGACY;
|
||||
break;
|
||||
case NL80211_CHAN_WIDTH_20:
|
||||
*bw = IWL_TOF_BW_20_HT;
|
||||
break;
|
||||
case NL80211_CHAN_WIDTH_40:
|
||||
*bw = IWL_TOF_BW_40;
|
||||
*ctrl_ch_position = iwl_mvm_get_ctrl_pos(chandef);
|
||||
break;
|
||||
case NL80211_CHAN_WIDTH_80:
|
||||
*bw = IWL_TOF_BW_80;
|
||||
*ctrl_ch_position = iwl_mvm_get_ctrl_pos(chandef);
|
||||
break;
|
||||
default:
|
||||
return -ENOTSUPP;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int iwl_mvm_ftm_responder_set_bw_v2(struct cfg80211_chan_def *chandef,
|
||||
u8 *format_bw,
|
||||
u8 *ctrl_ch_position)
|
||||
{
|
||||
switch (chandef->width) {
|
||||
case NL80211_CHAN_WIDTH_20_NOHT:
|
||||
*format_bw = IWL_LOCATION_FRAME_FORMAT_LEGACY;
|
||||
*format_bw |= IWL_LOCATION_BW_20MHZ << LOCATION_BW_POS;
|
||||
break;
|
||||
case NL80211_CHAN_WIDTH_20:
|
||||
*format_bw = IWL_LOCATION_FRAME_FORMAT_HT;
|
||||
*format_bw |= IWL_LOCATION_BW_20MHZ << LOCATION_BW_POS;
|
||||
break;
|
||||
case NL80211_CHAN_WIDTH_40:
|
||||
*format_bw = IWL_LOCATION_FRAME_FORMAT_HT;
|
||||
*format_bw |= IWL_LOCATION_BW_40MHZ << LOCATION_BW_POS;
|
||||
*ctrl_ch_position = iwl_mvm_get_ctrl_pos(chandef);
|
||||
break;
|
||||
case NL80211_CHAN_WIDTH_80:
|
||||
*format_bw = IWL_LOCATION_FRAME_FORMAT_VHT;
|
||||
*format_bw |= IWL_LOCATION_BW_80MHZ << LOCATION_BW_POS;
|
||||
*ctrl_ch_position = iwl_mvm_get_ctrl_pos(chandef);
|
||||
break;
|
||||
default:
|
||||
return -ENOTSUPP;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
iwl_mvm_ftm_responder_cmd(struct iwl_mvm *mvm,
|
||||
struct ieee80211_vif *vif,
|
||||
struct cfg80211_chan_def *chandef)
|
||||
{
|
||||
struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif);
|
||||
/*
|
||||
* The command structure is the same for versions 6 and 7, (only the
|
||||
* field interpretation is different), so the same struct can be use
|
||||
* for all cases.
|
||||
*/
|
||||
struct iwl_tof_responder_config_cmd cmd = {
|
||||
.channel_num = chandef->chan->hw_value,
|
||||
.cmd_valid_fields =
|
||||
@@ -76,27 +136,22 @@ iwl_mvm_ftm_responder_cmd(struct iwl_mvm *mvm,
|
||||
IWL_TOF_RESPONDER_CMD_VALID_STA_ID),
|
||||
.sta_id = mvmvif->bcast_sta.sta_id,
|
||||
};
|
||||
u8 cmd_ver = iwl_mvm_lookup_cmd_ver(mvm->fw, LOCATION_GROUP,
|
||||
TOF_RESPONDER_CONFIG_CMD);
|
||||
int err;
|
||||
|
||||
lockdep_assert_held(&mvm->mutex);
|
||||
|
||||
switch (chandef->width) {
|
||||
case NL80211_CHAN_WIDTH_20_NOHT:
|
||||
cmd.bandwidth = IWL_TOF_BW_20_LEGACY;
|
||||
break;
|
||||
case NL80211_CHAN_WIDTH_20:
|
||||
cmd.bandwidth = IWL_TOF_BW_20_HT;
|
||||
break;
|
||||
case NL80211_CHAN_WIDTH_40:
|
||||
cmd.bandwidth = IWL_TOF_BW_40;
|
||||
cmd.ctrl_ch_position = iwl_mvm_get_ctrl_pos(chandef);
|
||||
break;
|
||||
case NL80211_CHAN_WIDTH_80:
|
||||
cmd.bandwidth = IWL_TOF_BW_80;
|
||||
cmd.ctrl_ch_position = iwl_mvm_get_ctrl_pos(chandef);
|
||||
break;
|
||||
default:
|
||||
WARN_ON(1);
|
||||
return -EINVAL;
|
||||
if (cmd_ver == 7)
|
||||
err = iwl_mvm_ftm_responder_set_bw_v2(chandef, &cmd.format_bw,
|
||||
&cmd.ctrl_ch_position);
|
||||
else
|
||||
err = iwl_mvm_ftm_responder_set_bw_v1(chandef, &cmd.format_bw,
|
||||
&cmd.ctrl_ch_position);
|
||||
|
||||
if (err) {
|
||||
IWL_ERR(mvm, "Failed to set responder bandwidth\n");
|
||||
return err;
|
||||
}
|
||||
|
||||
memcpy(cmd.bssid, vif->addr, ETH_ALEN);
|
||||
|
@@ -353,22 +353,35 @@ static int iwl_mvm_load_ucode_wait_alive(struct iwl_mvm *mvm,
|
||||
if (ret) {
|
||||
struct iwl_trans *trans = mvm->trans;
|
||||
|
||||
if (ret == -ETIMEDOUT)
|
||||
iwl_fw_dbg_error_collect(&mvm->fwrt,
|
||||
FW_DBG_TRIGGER_ALIVE_TIMEOUT);
|
||||
|
||||
if (trans->trans_cfg->device_family >= IWL_DEVICE_FAMILY_22000)
|
||||
if (trans->trans_cfg->device_family >=
|
||||
IWL_DEVICE_FAMILY_22000) {
|
||||
IWL_ERR(mvm,
|
||||
"SecBoot CPU1 Status: 0x%x, CPU2 Status: 0x%x\n",
|
||||
iwl_read_umac_prph(trans, UMAG_SB_CPU_1_STATUS),
|
||||
iwl_read_umac_prph(trans,
|
||||
UMAG_SB_CPU_2_STATUS));
|
||||
else if (trans->trans_cfg->device_family >=
|
||||
IWL_DEVICE_FAMILY_8000)
|
||||
IWL_ERR(mvm, "UMAC PC: 0x%x\n",
|
||||
iwl_read_umac_prph(trans,
|
||||
UREG_UMAC_CURRENT_PC));
|
||||
IWL_ERR(mvm, "LMAC PC: 0x%x\n",
|
||||
iwl_read_umac_prph(trans,
|
||||
UREG_LMAC1_CURRENT_PC));
|
||||
if (iwl_mvm_is_cdb_supported(mvm))
|
||||
IWL_ERR(mvm, "LMAC2 PC: 0x%x\n",
|
||||
iwl_read_umac_prph(trans,
|
||||
UREG_LMAC2_CURRENT_PC));
|
||||
} else if (trans->trans_cfg->device_family >=
|
||||
IWL_DEVICE_FAMILY_8000) {
|
||||
IWL_ERR(mvm,
|
||||
"SecBoot CPU1 Status: 0x%x, CPU2 Status: 0x%x\n",
|
||||
iwl_read_prph(trans, SB_CPU_1_STATUS),
|
||||
iwl_read_prph(trans, SB_CPU_2_STATUS));
|
||||
}
|
||||
|
||||
if (ret == -ETIMEDOUT)
|
||||
iwl_fw_dbg_error_collect(&mvm->fwrt,
|
||||
FW_DBG_TRIGGER_ALIVE_TIMEOUT);
|
||||
|
||||
iwl_fw_set_current_image(&mvm->fwrt, old_type);
|
||||
return ret;
|
||||
}
|
||||
|
@@ -1160,6 +1160,7 @@ struct iwl_mvm {
|
||||
* @IWL_MVM_STATUS_ROC_AUX_RUNNING: AUX remain-on-channel is running
|
||||
* @IWL_MVM_STATUS_FIRMWARE_RUNNING: firmware is running
|
||||
* @IWL_MVM_STATUS_NEED_FLUSH_P2P: need to flush P2P bcast STA
|
||||
* @IWL_MVM_STATUS_IN_D3: in D3 (or at least about to go into it)
|
||||
*/
|
||||
enum iwl_mvm_status {
|
||||
IWL_MVM_STATUS_HW_RFKILL,
|
||||
@@ -1170,6 +1171,7 @@ enum iwl_mvm_status {
|
||||
IWL_MVM_STATUS_ROC_AUX_RUNNING,
|
||||
IWL_MVM_STATUS_FIRMWARE_RUNNING,
|
||||
IWL_MVM_STATUS_NEED_FLUSH_P2P,
|
||||
IWL_MVM_STATUS_IN_D3,
|
||||
};
|
||||
|
||||
/* Keep track of completed init configuration */
|
||||
|
@@ -178,7 +178,7 @@ static int iwl_nvm_read_chunk(struct iwl_mvm *mvm, u16 section,
|
||||
} else {
|
||||
IWL_DEBUG_EEPROM(mvm->trans->dev,
|
||||
"NVM access command failed with status %d (device: %s)\n",
|
||||
ret, mvm->cfg->name);
|
||||
ret, mvm->trans->name);
|
||||
ret = -ENODATA;
|
||||
}
|
||||
goto exit;
|
||||
|
@@ -830,7 +830,7 @@ iwl_op_mode_mvm_start(struct iwl_trans *trans, const struct iwl_cfg *cfg,
|
||||
}
|
||||
|
||||
IWL_INFO(mvm, "Detected %s, REV=0x%X\n",
|
||||
mvm->cfg->name, mvm->trans->hw_rev);
|
||||
mvm->trans->name, mvm->trans->hw_rev);
|
||||
|
||||
if (iwlwifi_mod_params.nvm_file)
|
||||
mvm->nvm_file_name = iwlwifi_mod_params.nvm_file;
|
||||
|
@@ -198,7 +198,7 @@ static void iwl_mvm_power_configure_uapsd(struct iwl_mvm *mvm,
|
||||
if (!mvmvif->queue_params[ac].uapsd)
|
||||
continue;
|
||||
|
||||
if (mvm->fwrt.cur_fw_img != IWL_UCODE_WOWLAN)
|
||||
if (!test_bit(IWL_MVM_STATUS_IN_D3, &mvm->status))
|
||||
cmd->flags |=
|
||||
cpu_to_le16(POWER_FLAGS_ADVANCE_PM_ENA_MSK);
|
||||
|
||||
@@ -233,15 +233,15 @@ static void iwl_mvm_power_configure_uapsd(struct iwl_mvm *mvm,
|
||||
cmd->flags |= cpu_to_le16(POWER_FLAGS_SNOOZE_ENA_MSK);
|
||||
cmd->snooze_interval = cpu_to_le16(IWL_MVM_PS_SNOOZE_INTERVAL);
|
||||
cmd->snooze_window =
|
||||
(mvm->fwrt.cur_fw_img == IWL_UCODE_WOWLAN) ?
|
||||
test_bit(IWL_MVM_STATUS_IN_D3, &mvm->status) ?
|
||||
cpu_to_le16(IWL_MVM_WOWLAN_PS_SNOOZE_WINDOW) :
|
||||
cpu_to_le16(IWL_MVM_PS_SNOOZE_WINDOW);
|
||||
}
|
||||
|
||||
cmd->uapsd_max_sp = mvm->hw->uapsd_max_sp_len;
|
||||
|
||||
if (mvm->fwrt.cur_fw_img == IWL_UCODE_WOWLAN || cmd->flags &
|
||||
cpu_to_le16(POWER_FLAGS_SNOOZE_ENA_MSK)) {
|
||||
if (test_bit(IWL_MVM_STATUS_IN_D3, &mvm->status) ||
|
||||
cmd->flags & cpu_to_le16(POWER_FLAGS_SNOOZE_ENA_MSK)) {
|
||||
cmd->rx_data_timeout_uapsd =
|
||||
cpu_to_le32(IWL_MVM_WOWLAN_PS_RX_DATA_TIMEOUT);
|
||||
cmd->tx_data_timeout_uapsd =
|
||||
@@ -354,8 +354,7 @@ static bool iwl_mvm_power_is_radar(struct ieee80211_vif *vif)
|
||||
|
||||
static void iwl_mvm_power_config_skip_dtim(struct iwl_mvm *mvm,
|
||||
struct ieee80211_vif *vif,
|
||||
struct iwl_mac_power_cmd *cmd,
|
||||
bool host_awake)
|
||||
struct iwl_mac_power_cmd *cmd)
|
||||
{
|
||||
int dtimper = vif->bss_conf.dtim_period ?: 1;
|
||||
int skip;
|
||||
@@ -370,7 +369,7 @@ static void iwl_mvm_power_config_skip_dtim(struct iwl_mvm *mvm,
|
||||
if (dtimper >= 10)
|
||||
return;
|
||||
|
||||
if (host_awake) {
|
||||
if (!test_bit(IWL_MVM_STATUS_IN_D3, &mvm->status)) {
|
||||
if (iwlmvm_mod_params.power_scheme != IWL_POWER_SCHEME_LP)
|
||||
return;
|
||||
skip = 2;
|
||||
@@ -390,8 +389,7 @@ static void iwl_mvm_power_config_skip_dtim(struct iwl_mvm *mvm,
|
||||
|
||||
static void iwl_mvm_power_build_cmd(struct iwl_mvm *mvm,
|
||||
struct ieee80211_vif *vif,
|
||||
struct iwl_mac_power_cmd *cmd,
|
||||
bool host_awake)
|
||||
struct iwl_mac_power_cmd *cmd)
|
||||
{
|
||||
int dtimper, bi;
|
||||
int keep_alive;
|
||||
@@ -437,9 +435,9 @@ static void iwl_mvm_power_build_cmd(struct iwl_mvm *mvm,
|
||||
cmd->lprx_rssi_threshold = POWER_LPRX_RSSI_THRESHOLD;
|
||||
}
|
||||
|
||||
iwl_mvm_power_config_skip_dtim(mvm, vif, cmd, host_awake);
|
||||
iwl_mvm_power_config_skip_dtim(mvm, vif, cmd);
|
||||
|
||||
if (!host_awake) {
|
||||
if (test_bit(IWL_MVM_STATUS_IN_D3, &mvm->status)) {
|
||||
cmd->rx_data_timeout =
|
||||
cpu_to_le32(IWL_MVM_WOWLAN_PS_RX_DATA_TIMEOUT);
|
||||
cmd->tx_data_timeout =
|
||||
@@ -512,8 +510,7 @@ static int iwl_mvm_power_send_cmd(struct iwl_mvm *mvm,
|
||||
{
|
||||
struct iwl_mac_power_cmd cmd = {};
|
||||
|
||||
iwl_mvm_power_build_cmd(mvm, vif, &cmd,
|
||||
mvm->fwrt.cur_fw_img != IWL_UCODE_WOWLAN);
|
||||
iwl_mvm_power_build_cmd(mvm, vif, &cmd);
|
||||
iwl_mvm_power_log(mvm, &cmd);
|
||||
#ifdef CONFIG_IWLWIFI_DEBUGFS
|
||||
memcpy(&iwl_mvm_vif_from_mac80211(vif)->mac_pwr_cmd, &cmd, sizeof(cmd));
|
||||
@@ -536,7 +533,7 @@ int iwl_mvm_power_update_device(struct iwl_mvm *mvm)
|
||||
cmd.flags |= cpu_to_le16(DEVICE_POWER_FLAGS_POWER_SAVE_ENA_MSK);
|
||||
|
||||
#ifdef CONFIG_IWLWIFI_DEBUGFS
|
||||
if ((mvm->fwrt.cur_fw_img == IWL_UCODE_WOWLAN) ?
|
||||
if (test_bit(IWL_MVM_STATUS_IN_D3, &mvm->status) ?
|
||||
mvm->disable_power_off_d3 : mvm->disable_power_off)
|
||||
cmd.flags &=
|
||||
cpu_to_le16(~DEVICE_POWER_FLAGS_POWER_SAVE_ENA_MSK);
|
||||
@@ -943,7 +940,7 @@ static int iwl_mvm_power_set_ba(struct iwl_mvm *mvm,
|
||||
if (!mvmvif->bf_data.bf_enabled)
|
||||
return 0;
|
||||
|
||||
if (mvm->fwrt.cur_fw_img == IWL_UCODE_WOWLAN)
|
||||
if (test_bit(IWL_MVM_STATUS_IN_D3, &mvm->status))
|
||||
cmd.ba_escape_timer = cpu_to_le32(IWL_BA_ESCAPE_TIMER_D3);
|
||||
|
||||
mvmvif->bf_data.ba_enabled = !(!mvmvif->pm_enabled ||
|
||||
|
@@ -1906,20 +1906,6 @@ iwl_mvm_scan_umac_fill_probe_p_v4(struct iwl_mvm_scan_params *params,
|
||||
iwl_scan_build_ssids(params, pp->direct_scan, bitmap_ssid);
|
||||
}
|
||||
|
||||
static void
|
||||
iwl_mvm_scan_umac_fill_ch_p_v3(struct iwl_mvm *mvm,
|
||||
struct iwl_mvm_scan_params *params,
|
||||
struct ieee80211_vif *vif,
|
||||
struct iwl_scan_channel_params_v3 *cp)
|
||||
{
|
||||
cp->flags = iwl_mvm_scan_umac_chan_flags_v2(mvm, params, vif);
|
||||
cp->count = params->n_channels;
|
||||
|
||||
iwl_mvm_umac_scan_cfg_channels(mvm, params->channels,
|
||||
params->n_channels, 0,
|
||||
cp->channel_config);
|
||||
}
|
||||
|
||||
static void
|
||||
iwl_mvm_scan_umac_fill_ch_p_v4(struct iwl_mvm *mvm,
|
||||
struct iwl_mvm_scan_params *params,
|
||||
@@ -1937,37 +1923,6 @@ iwl_mvm_scan_umac_fill_ch_p_v4(struct iwl_mvm *mvm,
|
||||
vif->type);
|
||||
}
|
||||
|
||||
static int iwl_mvm_scan_umac_v11(struct iwl_mvm *mvm, struct ieee80211_vif *vif,
|
||||
struct iwl_mvm_scan_params *params, int type,
|
||||
int uid)
|
||||
{
|
||||
struct iwl_scan_req_umac_v11 *cmd = mvm->scan_cmd;
|
||||
struct iwl_scan_req_params_v11 *scan_p = &cmd->scan_params;
|
||||
int ret;
|
||||
u16 gen_flags;
|
||||
|
||||
mvm->scan_uid_status[uid] = type;
|
||||
|
||||
cmd->ooc_priority = cpu_to_le32(iwl_mvm_scan_umac_ooc_priority(params));
|
||||
cmd->uid = cpu_to_le32(uid);
|
||||
|
||||
gen_flags = iwl_mvm_scan_umac_flags_v2(mvm, params, vif, type);
|
||||
iwl_mvm_scan_umac_fill_general_p_v10(mvm, params, vif,
|
||||
&scan_p->general_params,
|
||||
gen_flags);
|
||||
|
||||
ret = iwl_mvm_fill_scan_sched_params(params,
|
||||
scan_p->periodic_params.schedule,
|
||||
&scan_p->periodic_params.delay);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
iwl_mvm_scan_umac_fill_probe_p_v3(params, &scan_p->probe_params);
|
||||
iwl_mvm_scan_umac_fill_ch_p_v3(mvm, params, vif,
|
||||
&scan_p->channel_params);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int iwl_mvm_scan_umac_v12(struct iwl_mvm *mvm, struct ieee80211_vif *vif,
|
||||
struct iwl_mvm_scan_params *params, int type,
|
||||
@@ -2152,7 +2107,6 @@ static const struct iwl_scan_umac_handler iwl_scan_umac_handlers[] = {
|
||||
/* set the newest version first to shorten the list traverse time */
|
||||
IWL_SCAN_UMAC_HANDLER(13),
|
||||
IWL_SCAN_UMAC_HANDLER(12),
|
||||
IWL_SCAN_UMAC_HANDLER(11),
|
||||
};
|
||||
|
||||
static int iwl_mvm_build_scan_cmd(struct iwl_mvm *mvm,
|
||||
@@ -2511,7 +2465,6 @@ static int iwl_scan_req_umac_get_size(u8 scan_ver)
|
||||
switch (scan_ver) {
|
||||
IWL_SCAN_REQ_UMAC_HANDLE_SIZE(13);
|
||||
IWL_SCAN_REQ_UMAC_HANDLE_SIZE(12);
|
||||
IWL_SCAN_REQ_UMAC_HANDLE_SIZE(11);
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
新しいイシューから参照
ユーザーをブロックする