Commit 0ad523c8 authored by Kalle Valo's avatar Kalle Valo

Merge tag 'iwlwifi-next-for-kalle-2015-09-26' of...

Merge tag 'iwlwifi-next-for-kalle-2015-09-26' of git://git.kernel.org/pub/scm/linux/kernel/git/iwlwifi/iwlwifi-next

* Some new HW IDs;
* Small fix in CTDP error handling;
* Remove support for older firmwares;
* Clean-ups and a few simple fixes here and there.
parents 2df86ad9 9cd70e80
...@@ -77,9 +77,9 @@ ...@@ -77,9 +77,9 @@
#define IWL3168_UCODE_API_MAX 26 #define IWL3168_UCODE_API_MAX 26
/* Lowest firmware API version supported */ /* Lowest firmware API version supported */
#define IWL7260_UCODE_API_MIN 16 #define IWL7260_UCODE_API_MIN 17
#define IWL7265_UCODE_API_MIN 16 #define IWL7265_UCODE_API_MIN 17
#define IWL7265D_UCODE_API_MIN 16 #define IWL7265D_UCODE_API_MIN 17
#define IWL3168_UCODE_API_MIN 20 #define IWL3168_UCODE_API_MIN 20
/* NVM versions */ /* NVM versions */
......
...@@ -74,7 +74,7 @@ ...@@ -74,7 +74,7 @@
#define IWL8265_UCODE_API_MAX 26 #define IWL8265_UCODE_API_MAX 26
/* Lowest firmware API version supported */ /* Lowest firmware API version supported */
#define IWL8000_UCODE_API_MIN 16 #define IWL8000_UCODE_API_MIN 17
#define IWL8265_UCODE_API_MIN 20 #define IWL8265_UCODE_API_MIN 20
/* NVM versions */ /* NVM versions */
......
...@@ -58,7 +58,7 @@ ...@@ -58,7 +58,7 @@
#define IWL9000_UCODE_API_MAX 26 #define IWL9000_UCODE_API_MAX 26
/* Lowest firmware API version supported */ /* Lowest firmware API version supported */
#define IWL9000_UCODE_API_MIN 16 #define IWL9000_UCODE_API_MIN 17
/* NVM versions */ /* NVM versions */
#define IWL9000_NVM_VERSION 0x0a1d #define IWL9000_NVM_VERSION 0x0a1d
......
...@@ -359,7 +359,6 @@ struct iwl_cfg { ...@@ -359,7 +359,6 @@ struct iwl_cfg {
high_temp:1, high_temp:1,
mac_addr_from_csr:1, mac_addr_from_csr:1,
lp_xtal_workaround:1, lp_xtal_workaround:1,
no_power_up_nic_in_init:1,
disable_dummy_notification:1, disable_dummy_notification:1,
apmg_not_supported:1, apmg_not_supported:1,
mq_rx_supported:1, mq_rx_supported:1,
......
...@@ -199,8 +199,6 @@ struct iwl_ucode_capa { ...@@ -199,8 +199,6 @@ struct iwl_ucode_capa {
* @IWL_UCODE_TLV_FLAGS_NEWSCAN: new uCode scan behavior on hidden SSID, * @IWL_UCODE_TLV_FLAGS_NEWSCAN: new uCode scan behavior on hidden SSID,
* treats good CRC threshold as a boolean * treats good CRC threshold as a boolean
* @IWL_UCODE_TLV_FLAGS_MFP: This uCode image supports MFP (802.11w). * @IWL_UCODE_TLV_FLAGS_MFP: This uCode image supports MFP (802.11w).
* @IWL_UCODE_TLV_FLAGS_P2P: This uCode image supports P2P.
* @IWL_UCODE_TLV_FLAGS_DW_BC_TABLE: The SCD byte count table is in DWORDS
* @IWL_UCODE_TLV_FLAGS_UAPSD_SUPPORT: This uCode image supports uAPSD * @IWL_UCODE_TLV_FLAGS_UAPSD_SUPPORT: This uCode image supports uAPSD
* @IWL_UCODE_TLV_FLAGS_SHORT_BL: 16 entries of black list instead of 64 in scan * @IWL_UCODE_TLV_FLAGS_SHORT_BL: 16 entries of black list instead of 64 in scan
* offload profile config command. * offload profile config command.
...@@ -210,36 +208,24 @@ struct iwl_ucode_capa { ...@@ -210,36 +208,24 @@ struct iwl_ucode_capa {
* from the probe request template. * from the probe request template.
* @IWL_UCODE_TLV_FLAGS_NEW_NSOFFL_SMALL: new NS offload (small version) * @IWL_UCODE_TLV_FLAGS_NEW_NSOFFL_SMALL: new NS offload (small version)
* @IWL_UCODE_TLV_FLAGS_NEW_NSOFFL_LARGE: new NS offload (large version) * @IWL_UCODE_TLV_FLAGS_NEW_NSOFFL_LARGE: new NS offload (large version)
* @IWL_UCODE_TLV_FLAGS_P2P_PM: P2P client supports PM as a stand alone MAC
* @IWL_UCODE_TLV_FLAGS_P2P_BSS_PS_DCM: support power save on BSS station and
* P2P client interfaces simultaneously if they are in different bindings.
* @IWL_UCODE_TLV_FLAGS_P2P_BSS_PS_SCM: support power save on BSS station and
* P2P client interfaces simultaneously if they are in same bindings.
* @IWL_UCODE_TLV_FLAGS_UAPSD_SUPPORT: General support for uAPSD * @IWL_UCODE_TLV_FLAGS_UAPSD_SUPPORT: General support for uAPSD
* @IWL_UCODE_TLV_FLAGS_P2P_PS_UAPSD: P2P client supports uAPSD power save * @IWL_UCODE_TLV_FLAGS_P2P_PS_UAPSD: P2P client supports uAPSD power save
* @IWL_UCODE_TLV_FLAGS_BCAST_FILTERING: uCode supports broadcast filtering. * @IWL_UCODE_TLV_FLAGS_BCAST_FILTERING: uCode supports broadcast filtering.
* @IWL_UCODE_TLV_FLAGS_GO_UAPSD: AP/GO interfaces support uAPSD clients
* @IWL_UCODE_TLV_FLAGS_EBS_SUPPORT: this uCode image supports EBS. * @IWL_UCODE_TLV_FLAGS_EBS_SUPPORT: this uCode image supports EBS.
*/ */
enum iwl_ucode_tlv_flag { enum iwl_ucode_tlv_flag {
IWL_UCODE_TLV_FLAGS_PAN = BIT(0), IWL_UCODE_TLV_FLAGS_PAN = BIT(0),
IWL_UCODE_TLV_FLAGS_NEWSCAN = BIT(1), IWL_UCODE_TLV_FLAGS_NEWSCAN = BIT(1),
IWL_UCODE_TLV_FLAGS_MFP = BIT(2), IWL_UCODE_TLV_FLAGS_MFP = BIT(2),
IWL_UCODE_TLV_FLAGS_P2P = BIT(3),
IWL_UCODE_TLV_FLAGS_DW_BC_TABLE = BIT(4),
IWL_UCODE_TLV_FLAGS_SHORT_BL = BIT(7), IWL_UCODE_TLV_FLAGS_SHORT_BL = BIT(7),
IWL_UCODE_TLV_FLAGS_D3_6_IPV6_ADDRS = BIT(10), IWL_UCODE_TLV_FLAGS_D3_6_IPV6_ADDRS = BIT(10),
IWL_UCODE_TLV_FLAGS_NO_BASIC_SSID = BIT(12), IWL_UCODE_TLV_FLAGS_NO_BASIC_SSID = BIT(12),
IWL_UCODE_TLV_FLAGS_NEW_NSOFFL_SMALL = BIT(15), IWL_UCODE_TLV_FLAGS_NEW_NSOFFL_SMALL = BIT(15),
IWL_UCODE_TLV_FLAGS_NEW_NSOFFL_LARGE = BIT(16), IWL_UCODE_TLV_FLAGS_NEW_NSOFFL_LARGE = BIT(16),
IWL_UCODE_TLV_FLAGS_P2P_PM = BIT(21),
IWL_UCODE_TLV_FLAGS_BSS_P2P_PS_DCM = BIT(22),
IWL_UCODE_TLV_FLAGS_BSS_P2P_PS_SCM = BIT(23),
IWL_UCODE_TLV_FLAGS_UAPSD_SUPPORT = BIT(24), IWL_UCODE_TLV_FLAGS_UAPSD_SUPPORT = BIT(24),
IWL_UCODE_TLV_FLAGS_EBS_SUPPORT = BIT(25), IWL_UCODE_TLV_FLAGS_EBS_SUPPORT = BIT(25),
IWL_UCODE_TLV_FLAGS_P2P_PS_UAPSD = BIT(26), IWL_UCODE_TLV_FLAGS_P2P_PS_UAPSD = BIT(26),
IWL_UCODE_TLV_FLAGS_BCAST_FILTERING = BIT(29), IWL_UCODE_TLV_FLAGS_BCAST_FILTERING = BIT(29),
IWL_UCODE_TLV_FLAGS_GO_UAPSD = BIT(30),
}; };
typedef unsigned int __bitwise__ iwl_ucode_tlv_api_t; typedef unsigned int __bitwise__ iwl_ucode_tlv_api_t;
...@@ -249,13 +235,8 @@ typedef unsigned int __bitwise__ iwl_ucode_tlv_api_t; ...@@ -249,13 +235,8 @@ typedef unsigned int __bitwise__ iwl_ucode_tlv_api_t;
* @IWL_UCODE_TLV_API_FRAGMENTED_SCAN: This ucode supports active dwell time * @IWL_UCODE_TLV_API_FRAGMENTED_SCAN: This ucode supports active dwell time
* longer than the passive one, which is essential for fragmented scan. * longer than the passive one, which is essential for fragmented scan.
* @IWL_UCODE_TLV_API_WIFI_MCC_UPDATE: ucode supports MCC updates with source. * @IWL_UCODE_TLV_API_WIFI_MCC_UPDATE: ucode supports MCC updates with source.
* @IWL_UCODE_TLV_API_WIDE_CMD_HDR: ucode supports wide command header
* @IWL_UCODE_TLV_API_LQ_SS_PARAMS: Configure STBC/BFER via LQ CMD ss_params * @IWL_UCODE_TLV_API_LQ_SS_PARAMS: Configure STBC/BFER via LQ CMD ss_params
* @IWL_UCODE_TLV_API_NEW_VERSION: new versioning format * @IWL_UCODE_TLV_API_NEW_VERSION: new versioning format
* @IWL_UCODE_TLV_API_EXT_SCAN_PRIORITY: scan APIs use 8-level priority
* instead of 3.
* @IWL_UCODE_TLV_API_TX_POWER_CHAIN: TX power API has larger command size
* (command version 3) that supports per-chain limits
* @IWL_UCODE_TLV_API_SCAN_TSF_REPORT: Scan start time reported in scan * @IWL_UCODE_TLV_API_SCAN_TSF_REPORT: Scan start time reported in scan
* iteration complete notification, and the timestamp reported for RX * iteration complete notification, and the timestamp reported for RX
* received during scan, are reported in TSF of the mac specified in the * received during scan, are reported in TSF of the mac specified in the
...@@ -266,11 +247,8 @@ typedef unsigned int __bitwise__ iwl_ucode_tlv_api_t; ...@@ -266,11 +247,8 @@ typedef unsigned int __bitwise__ iwl_ucode_tlv_api_t;
enum iwl_ucode_tlv_api { enum iwl_ucode_tlv_api {
IWL_UCODE_TLV_API_FRAGMENTED_SCAN = (__force iwl_ucode_tlv_api_t)8, IWL_UCODE_TLV_API_FRAGMENTED_SCAN = (__force iwl_ucode_tlv_api_t)8,
IWL_UCODE_TLV_API_WIFI_MCC_UPDATE = (__force iwl_ucode_tlv_api_t)9, IWL_UCODE_TLV_API_WIFI_MCC_UPDATE = (__force iwl_ucode_tlv_api_t)9,
IWL_UCODE_TLV_API_WIDE_CMD_HDR = (__force iwl_ucode_tlv_api_t)14,
IWL_UCODE_TLV_API_LQ_SS_PARAMS = (__force iwl_ucode_tlv_api_t)18, IWL_UCODE_TLV_API_LQ_SS_PARAMS = (__force iwl_ucode_tlv_api_t)18,
IWL_UCODE_TLV_API_NEW_VERSION = (__force iwl_ucode_tlv_api_t)20, IWL_UCODE_TLV_API_NEW_VERSION = (__force iwl_ucode_tlv_api_t)20,
IWL_UCODE_TLV_API_EXT_SCAN_PRIORITY = (__force iwl_ucode_tlv_api_t)24,
IWL_UCODE_TLV_API_TX_POWER_CHAIN = (__force iwl_ucode_tlv_api_t)27,
IWL_UCODE_TLV_API_SCAN_TSF_REPORT = (__force iwl_ucode_tlv_api_t)28, IWL_UCODE_TLV_API_SCAN_TSF_REPORT = (__force iwl_ucode_tlv_api_t)28,
NUM_IWL_UCODE_TLV_API NUM_IWL_UCODE_TLV_API
......
...@@ -1578,8 +1578,7 @@ void iwl_mvm_vif_dbgfs_register(struct iwl_mvm *mvm, struct ieee80211_vif *vif) ...@@ -1578,8 +1578,7 @@ void iwl_mvm_vif_dbgfs_register(struct iwl_mvm *mvm, struct ieee80211_vif *vif)
if (iwlmvm_mod_params.power_scheme != IWL_POWER_SCHEME_CAM && if (iwlmvm_mod_params.power_scheme != IWL_POWER_SCHEME_CAM &&
((vif->type == NL80211_IFTYPE_STATION && !vif->p2p) || ((vif->type == NL80211_IFTYPE_STATION && !vif->p2p) ||
(vif->type == NL80211_IFTYPE_STATION && vif->p2p && (vif->type == NL80211_IFTYPE_STATION && vif->p2p)))
mvm->fw->ucode_capa.flags & IWL_UCODE_TLV_FLAGS_BSS_P2P_PS_DCM)))
MVM_DEBUGFS_ADD_FILE_VIF(pm_params, mvmvif->dbgfs_dir, S_IWUSR | MVM_DEBUGFS_ADD_FILE_VIF(pm_params, mvmvif->dbgfs_dir, S_IWUSR |
S_IRUSR); S_IRUSR);
......
...@@ -313,35 +313,26 @@ enum iwl_dev_tx_power_cmd_mode { ...@@ -313,35 +313,26 @@ enum iwl_dev_tx_power_cmd_mode {
IWL_TX_POWER_MODE_SET_ACK = 3, IWL_TX_POWER_MODE_SET_ACK = 3,
}; /* TX_POWER_REDUCED_FLAGS_TYPE_API_E_VER_4 */; }; /* TX_POWER_REDUCED_FLAGS_TYPE_API_E_VER_4 */;
#define IWL_NUM_CHAIN_LIMITS 2
#define IWL_NUM_SUB_BANDS 5
/** /**
* struct iwl_dev_tx_power_cmd_v2 - TX power reduction command * struct iwl_dev_tx_power_cmd - TX power reduction command
* @set_mode: see &enum iwl_dev_tx_power_cmd_mode * @set_mode: see &enum iwl_dev_tx_power_cmd_mode
* @mac_context_id: id of the mac ctx for which we are reducing TX power. * @mac_context_id: id of the mac ctx for which we are reducing TX power.
* @pwr_restriction: TX power restriction in 1/8 dBms. * @pwr_restriction: TX power restriction in 1/8 dBms.
* @dev_24: device TX power restriction in 1/8 dBms * @dev_24: device TX power restriction in 1/8 dBms
* @dev_52_low: device TX power restriction upper band - low * @dev_52_low: device TX power restriction upper band - low
* @dev_52_high: device TX power restriction upper band - high * @dev_52_high: device TX power restriction upper band - high
* @per_chain_restriction: per chain restrictions
*/ */
struct iwl_dev_tx_power_cmd_v2 { struct iwl_dev_tx_power_cmd_v3 {
__le32 set_mode; __le32 set_mode;
__le32 mac_context_id; __le32 mac_context_id;
__le16 pwr_restriction; __le16 pwr_restriction;
__le16 dev_24; __le16 dev_24;
__le16 dev_52_low; __le16 dev_52_low;
__le16 dev_52_high; __le16 dev_52_high;
} __packed; /* TX_REDUCED_POWER_API_S_VER_2 */
#define IWL_NUM_CHAIN_LIMITS 2
#define IWL_NUM_SUB_BANDS 5
/**
* struct iwl_dev_tx_power_cmd - TX power reduction command
* @v2: version 2 of the command, embedded here for easier software handling
* @per_chain_restriction: per chain restrictions
*/
struct iwl_dev_tx_power_cmd_v3 {
/* v3 is just an extension of v2 - keep this here */
struct iwl_dev_tx_power_cmd_v2 v2;
__le16 per_chain_restriction[IWL_NUM_CHAIN_LIMITS][IWL_NUM_SUB_BANDS]; __le16 per_chain_restriction[IWL_NUM_CHAIN_LIMITS][IWL_NUM_SUB_BANDS];
} __packed; /* TX_REDUCED_POWER_API_S_VER_3 */ } __packed; /* TX_REDUCED_POWER_API_S_VER_3 */
......
...@@ -89,7 +89,6 @@ ...@@ -89,7 +89,6 @@
* @TX_CMD_FLG_MH_PAD: driver inserted 2 byte padding after MAC header. * @TX_CMD_FLG_MH_PAD: driver inserted 2 byte padding after MAC header.
* Should be set for 26/30 length MAC headers * Should be set for 26/30 length MAC headers
* @TX_CMD_FLG_RESP_TO_DRV: zero this if the response should go only to FW * @TX_CMD_FLG_RESP_TO_DRV: zero this if the response should go only to FW
* @TX_CMD_FLG_CCMP_AGG: this frame uses CCMP for aggregation acceleration
* @TX_CMD_FLG_TKIP_MIC_DONE: FW already performed TKIP MIC calculation * @TX_CMD_FLG_TKIP_MIC_DONE: FW already performed TKIP MIC calculation
* @TX_CMD_FLG_DUR: disable duration overwriting used in PS-Poll Assoc-id * @TX_CMD_FLG_DUR: disable duration overwriting used in PS-Poll Assoc-id
* @TX_CMD_FLG_FW_DROP: FW should mark frame to be dropped * @TX_CMD_FLG_FW_DROP: FW should mark frame to be dropped
...@@ -116,7 +115,6 @@ enum iwl_tx_flags { ...@@ -116,7 +115,6 @@ enum iwl_tx_flags {
TX_CMD_FLG_KEEP_SEQ_CTL = BIT(18), TX_CMD_FLG_KEEP_SEQ_CTL = BIT(18),
TX_CMD_FLG_MH_PAD = BIT(20), TX_CMD_FLG_MH_PAD = BIT(20),
TX_CMD_FLG_RESP_TO_DRV = BIT(21), TX_CMD_FLG_RESP_TO_DRV = BIT(21),
TX_CMD_FLG_CCMP_AGG = BIT(22),
TX_CMD_FLG_TKIP_MIC_DONE = BIT(23), TX_CMD_FLG_TKIP_MIC_DONE = BIT(23),
TX_CMD_FLG_DUR = BIT(25), TX_CMD_FLG_DUR = BIT(25),
TX_CMD_FLG_FW_DROP = BIT(26), TX_CMD_FLG_FW_DROP = BIT(26),
...@@ -149,7 +147,7 @@ enum iwl_tx_pm_timeouts { ...@@ -149,7 +147,7 @@ enum iwl_tx_pm_timeouts {
* @TX_CMD_SEC_EXT: extended cipher algorithm. * @TX_CMD_SEC_EXT: extended cipher algorithm.
* @TX_CMD_SEC_GCMP: GCMP encryption algorithm. * @TX_CMD_SEC_GCMP: GCMP encryption algorithm.
* @TX_CMD_SEC_KEY128: set for 104 bits WEP key. * @TX_CMD_SEC_KEY128: set for 104 bits WEP key.
* @TC_CMD_SEC_KEY_FROM_TABLE: for a non-WEP key, set if the key should be taken * @TX_CMD_SEC_KEY_FROM_TABLE: for a non-WEP key, set if the key should be taken
* from the table instead of from the TX command. * from the table instead of from the TX command.
* If the key is taken from the key table its index should be given by the * If the key is taken from the key table its index should be given by the
* first byte of the TX command key field. * first byte of the TX command key field.
...@@ -161,7 +159,7 @@ enum iwl_tx_cmd_sec_ctrl { ...@@ -161,7 +159,7 @@ enum iwl_tx_cmd_sec_ctrl {
TX_CMD_SEC_EXT = 0x04, TX_CMD_SEC_EXT = 0x04,
TX_CMD_SEC_GCMP = 0x05, TX_CMD_SEC_GCMP = 0x05,
TX_CMD_SEC_KEY128 = 0x08, TX_CMD_SEC_KEY128 = 0x08,
TC_CMD_SEC_KEY_FROM_TABLE = 0x08, TX_CMD_SEC_KEY_FROM_TABLE = 0x08,
}; };
/* TODO: how does these values are OK with only 16 bit variable??? */ /* TODO: how does these values are OK with only 16 bit variable??? */
......
...@@ -1046,19 +1046,11 @@ static int iwl_mvm_sar_init(struct iwl_mvm *mvm) ...@@ -1046,19 +1046,11 @@ static int iwl_mvm_sar_init(struct iwl_mvm *mvm)
{ {
struct iwl_mvm_sar_table sar_table; struct iwl_mvm_sar_table sar_table;
struct iwl_dev_tx_power_cmd cmd = { struct iwl_dev_tx_power_cmd cmd = {
.v3.v2.set_mode = cpu_to_le32(IWL_TX_POWER_MODE_SET_CHAINS), .v3.set_mode = cpu_to_le32(IWL_TX_POWER_MODE_SET_CHAINS),
}; };
int ret, i, j, idx; int ret, i, j, idx;
int len = sizeof(cmd); int len = sizeof(cmd);
/* we can't do anything with the table if the FW doesn't support it */
if (!fw_has_api(&mvm->fw->ucode_capa,
IWL_UCODE_TLV_API_TX_POWER_CHAIN)) {
IWL_DEBUG_RADIO(mvm,
"FW doesn't support per-chain TX power settings.\n");
return 0;
}
if (!fw_has_capa(&mvm->fw->ucode_capa, IWL_UCODE_TLV_CAPA_TX_POWER_ACK)) if (!fw_has_capa(&mvm->fw->ucode_capa, IWL_UCODE_TLV_CAPA_TX_POWER_ACK))
len = sizeof(cmd.v3); len = sizeof(cmd.v3);
...@@ -1115,14 +1107,18 @@ int iwl_mvm_up(struct iwl_mvm *mvm) ...@@ -1115,14 +1107,18 @@ int iwl_mvm_up(struct iwl_mvm *mvm)
* (for example, if we were in RFKILL) * (for example, if we were in RFKILL)
*/ */
ret = iwl_run_init_mvm_ucode(mvm, false); ret = iwl_run_init_mvm_ucode(mvm, false);
if (ret && !iwlmvm_mod_params.init_dbg) {
if (iwlmvm_mod_params.init_dbg)
return 0;
if (ret) {
IWL_ERR(mvm, "Failed to run INIT ucode: %d\n", ret); IWL_ERR(mvm, "Failed to run INIT ucode: %d\n", ret);
/* this can't happen */ /* this can't happen */
if (WARN_ON(ret > 0)) if (WARN_ON(ret > 0))
ret = -ERFKILL; ret = -ERFKILL;
goto error; goto error;
} }
if (!iwlmvm_mod_params.init_dbg) {
/* /*
* Stop and start the transport without entering low power * Stop and start the transport without entering low power
* mode. This will save the state of other components on the * mode. This will save the state of other components on the
...@@ -1132,10 +1128,6 @@ int iwl_mvm_up(struct iwl_mvm *mvm) ...@@ -1132,10 +1128,6 @@ int iwl_mvm_up(struct iwl_mvm *mvm)
ret = _iwl_trans_start_hw(mvm->trans, false); ret = _iwl_trans_start_hw(mvm->trans, false);
if (ret) if (ret)
goto error; goto error;
}
if (iwlmvm_mod_params.init_dbg)
return 0;
ret = iwl_mvm_load_ucode_wait_alive(mvm, IWL_UCODE_REGULAR); ret = iwl_mvm_load_ucode_wait_alive(mvm, IWL_UCODE_REGULAR);
if (ret) { if (ret) {
...@@ -1233,9 +1225,12 @@ int iwl_mvm_up(struct iwl_mvm *mvm) ...@@ -1233,9 +1225,12 @@ int iwl_mvm_up(struct iwl_mvm *mvm)
} }
/* TODO: read the budget from BIOS / Platform NVM */ /* TODO: read the budget from BIOS / Platform NVM */
if (iwl_mvm_is_ctdp_supported(mvm) && mvm->cooling_dev.cur_state > 0) if (iwl_mvm_is_ctdp_supported(mvm) && mvm->cooling_dev.cur_state > 0) {
ret = iwl_mvm_ctdp_command(mvm, CTDP_CMD_OPERATION_START, ret = iwl_mvm_ctdp_command(mvm, CTDP_CMD_OPERATION_START,
mvm->cooling_dev.cur_state); mvm->cooling_dev.cur_state);
if (ret)
goto error;
}
#else #else
/* Initialize tx backoffs to the minimal possible */ /* Initialize tx backoffs to the minimal possible */
iwl_mvm_tt_tx_backoff(mvm, 0); iwl_mvm_tt_tx_backoff(mvm, 0);
......
...@@ -479,13 +479,11 @@ int iwl_mvm_mac_setup_register(struct iwl_mvm *mvm) ...@@ -479,13 +479,11 @@ int iwl_mvm_mac_setup_register(struct iwl_mvm *mvm)
hw->wiphy->n_cipher_suites++; hw->wiphy->n_cipher_suites++;
} }
/* /* Enable 11w if software crypto is not enabled (as the
* Enable 11w if advertised by firmware and software crypto * firmware will interpret some mgmt packets, so enabling it
* is not enabled (as the firmware will interpret some mgmt * with software crypto isn't safe).
* packets, so enabling it with software crypto isn't safe)
*/ */
if (mvm->fw->ucode_capa.flags & IWL_UCODE_TLV_FLAGS_MFP && if (!iwlwifi_mod_params.sw_crypto) {
!iwlwifi_mod_params.sw_crypto) {
ieee80211_hw_set(hw, MFP_CAPABLE); ieee80211_hw_set(hw, MFP_CAPABLE);
mvm->ciphers[hw->wiphy->n_cipher_suites] = mvm->ciphers[hw->wiphy->n_cipher_suites] =
WLAN_CIPHER_SUITE_AES_CMAC; WLAN_CIPHER_SUITE_AES_CMAC;
...@@ -547,9 +545,7 @@ int iwl_mvm_mac_setup_register(struct iwl_mvm *mvm) ...@@ -547,9 +545,7 @@ int iwl_mvm_mac_setup_register(struct iwl_mvm *mvm)
hw->wiphy->regulatory_flags |= REGULATORY_CUSTOM_REG | hw->wiphy->regulatory_flags |= REGULATORY_CUSTOM_REG |
REGULATORY_DISABLE_BEACON_HINTS; REGULATORY_DISABLE_BEACON_HINTS;
if (mvm->fw->ucode_capa.flags & IWL_UCODE_TLV_FLAGS_GO_UAPSD)
hw->wiphy->flags |= WIPHY_FLAG_AP_UAPSD; hw->wiphy->flags |= WIPHY_FLAG_AP_UAPSD;
hw->wiphy->flags |= WIPHY_FLAG_HAS_CHANNEL_SWITCH; hw->wiphy->flags |= WIPHY_FLAG_HAS_CHANNEL_SWITCH;
hw->wiphy->iface_combinations = iwl_mvm_iface_combinations; hw->wiphy->iface_combinations = iwl_mvm_iface_combinations;
...@@ -1273,20 +1269,18 @@ static int iwl_mvm_set_tx_power(struct iwl_mvm *mvm, struct ieee80211_vif *vif, ...@@ -1273,20 +1269,18 @@ static int iwl_mvm_set_tx_power(struct iwl_mvm *mvm, struct ieee80211_vif *vif,
s16 tx_power) s16 tx_power)
{ {
struct iwl_dev_tx_power_cmd cmd = { struct iwl_dev_tx_power_cmd cmd = {
.v3.v2.set_mode = cpu_to_le32(IWL_TX_POWER_MODE_SET_MAC), .v3.set_mode = cpu_to_le32(IWL_TX_POWER_MODE_SET_MAC),
.v3.v2.mac_context_id = .v3.mac_context_id =
cpu_to_le32(iwl_mvm_vif_from_mac80211(vif)->id), cpu_to_le32(iwl_mvm_vif_from_mac80211(vif)->id),
.v3.v2.pwr_restriction = cpu_to_le16(8 * tx_power), .v3.pwr_restriction = cpu_to_le16(8 * tx_power),
}; };
int len = sizeof(cmd); int len = sizeof(cmd);
if (tx_power == IWL_DEFAULT_MAX_TX_POWER) if (tx_power == IWL_DEFAULT_MAX_TX_POWER)
cmd.v3.v2.pwr_restriction = cpu_to_le16(IWL_DEV_MAX_TX_POWER); cmd.v3.pwr_restriction = cpu_to_le16(IWL_DEV_MAX_TX_POWER);
if (!fw_has_capa(&mvm->fw->ucode_capa, IWL_UCODE_TLV_CAPA_TX_POWER_ACK)) if (!fw_has_capa(&mvm->fw->ucode_capa, IWL_UCODE_TLV_CAPA_TX_POWER_ACK))
len = sizeof(cmd.v3); len = sizeof(cmd.v3);
if (!fw_has_api(&mvm->fw->ucode_capa, IWL_UCODE_TLV_API_TX_POWER_CHAIN))
len = sizeof(cmd.v3.v2);
return iwl_mvm_send_cmd_pdu(mvm, REDUCE_TX_POWER_CMD, 0, len, &cmd); return iwl_mvm_send_cmd_pdu(mvm, REDUCE_TX_POWER_CMD, 0, len, &cmd);
} }
......
...@@ -1305,8 +1305,6 @@ static inline void iwl_mvm_set_tx_cmd_ccmp(struct ieee80211_tx_info *info, ...@@ -1305,8 +1305,6 @@ static inline void iwl_mvm_set_tx_cmd_ccmp(struct ieee80211_tx_info *info,
tx_cmd->sec_ctl = TX_CMD_SEC_CCM; tx_cmd->sec_ctl = TX_CMD_SEC_CCM;
memcpy(tx_cmd->key, keyconf->key, keyconf->keylen); memcpy(tx_cmd->key, keyconf->key, keyconf->keylen);
if (info->flags & IEEE80211_TX_CTL_AMPDU)
tx_cmd->tx_flags |= cpu_to_le32(TX_CMD_FLG_CCMP_AGG);
} }
static inline void iwl_mvm_wait_for_async_handlers(struct iwl_mvm *mvm) static inline void iwl_mvm_wait_for_async_handlers(struct iwl_mvm *mvm)
......
...@@ -653,10 +653,8 @@ iwl_op_mode_mvm_start(struct iwl_trans *trans, const struct iwl_cfg *cfg, ...@@ -653,10 +653,8 @@ iwl_op_mode_mvm_start(struct iwl_trans *trans, const struct iwl_cfg *cfg,
/* the hardware splits the A-MSDU */ /* the hardware splits the A-MSDU */
if (mvm->cfg->mq_rx_supported) if (mvm->cfg->mq_rx_supported)
trans_cfg.rx_buf_size = IWL_AMSDU_4K; trans_cfg.rx_buf_size = IWL_AMSDU_4K;
trans->wide_cmd_header = fw_has_api(&mvm->fw->ucode_capa,
IWL_UCODE_TLV_API_WIDE_CMD_HDR);
if (mvm->fw->ucode_capa.flags & IWL_UCODE_TLV_FLAGS_DW_BC_TABLE) trans->wide_cmd_header = true;
trans_cfg.bc_table_dword = true; trans_cfg.bc_table_dword = true;
trans_cfg.command_groups = iwl_mvm_groups; trans_cfg.command_groups = iwl_mvm_groups;
...@@ -712,21 +710,6 @@ iwl_op_mode_mvm_start(struct iwl_trans *trans, const struct iwl_cfg *cfg, ...@@ -712,21 +710,6 @@ iwl_op_mode_mvm_start(struct iwl_trans *trans, const struct iwl_cfg *cfg,
IWL_DEBUG_EEPROM(mvm->trans->dev, IWL_DEBUG_EEPROM(mvm->trans->dev,
"working without external nvm file\n"); "working without external nvm file\n");
if (WARN(cfg->no_power_up_nic_in_init && !mvm->nvm_file_name,
"not allowing power-up and not having nvm_file\n"))
goto out_free;
/*
* Even if nvm exists in the nvm_file driver should read again the nvm
* from the nic because there might be entries that exist in the OTP
* and not in the file.
* for nics with no_power_up_nic_in_init: rely completley on nvm_file
*/
if (cfg->no_power_up_nic_in_init && mvm->nvm_file_name) {
err = iwl_nvm_init(mvm, false);
if (err)
goto out_free;
} else {
err = iwl_trans_start_hw(mvm->trans); err = iwl_trans_start_hw(mvm->trans);
if (err) if (err)
goto out_free; goto out_free;
...@@ -743,7 +726,6 @@ iwl_op_mode_mvm_start(struct iwl_trans *trans, const struct iwl_cfg *cfg, ...@@ -743,7 +726,6 @@ iwl_op_mode_mvm_start(struct iwl_trans *trans, const struct iwl_cfg *cfg,
IWL_ERR(mvm, "Failed to run INIT ucode: %d\n", err); IWL_ERR(mvm, "Failed to run INIT ucode: %d\n", err);
goto out_free; goto out_free;
} }
}
scan_size = iwl_mvm_scan_size(mvm); scan_size = iwl_mvm_scan_size(mvm);
...@@ -784,8 +766,8 @@ iwl_op_mode_mvm_start(struct iwl_trans *trans, const struct iwl_cfg *cfg, ...@@ -784,8 +766,8 @@ iwl_op_mode_mvm_start(struct iwl_trans *trans, const struct iwl_cfg *cfg,
flush_delayed_work(&mvm->fw_dump_wk); flush_delayed_work(&mvm->fw_dump_wk);
iwl_phy_db_free(mvm->phy_db); iwl_phy_db_free(mvm->phy_db);
kfree(mvm->scan_cmd); kfree(mvm->scan_cmd);
if (!cfg->no_power_up_nic_in_init || !mvm->nvm_file_name)
iwl_trans_op_mode_leave(trans); iwl_trans_op_mode_leave(trans);
ieee80211_free_hw(mvm->hw); ieee80211_free_hw(mvm->hw);
return NULL; return NULL;
} }
......
...@@ -694,7 +694,6 @@ static void iwl_mvm_power_set_pm(struct iwl_mvm *mvm, ...@@ -694,7 +694,6 @@ static void iwl_mvm_power_set_pm(struct iwl_mvm *mvm,
/* enable PM on p2p if p2p stand alone */ /* enable PM on p2p if p2p stand alone */
if (vifs->p2p_active && !vifs->bss_active && !vifs->ap_active) { if (vifs->p2p_active && !vifs->bss_active && !vifs->ap_active) {
if (mvm->fw->ucode_capa.flags & IWL_UCODE_TLV_FLAGS_P2P_PM)
p2p_mvmvif->pm_enabled = true; p2p_mvmvif->pm_enabled = true;
return; return;
} }
...@@ -707,12 +706,10 @@ static void iwl_mvm_power_set_pm(struct iwl_mvm *mvm, ...@@ -707,12 +706,10 @@ static void iwl_mvm_power_set_pm(struct iwl_mvm *mvm,
ap_mvmvif->phy_ctxt->id); ap_mvmvif->phy_ctxt->id);
/* clients are not stand alone: enable PM if DCM */ /* clients are not stand alone: enable PM if DCM */
if (!(client_same_channel || ap_same_channel) && if (!(client_same_channel || ap_same_channel)) {
(mvm->fw->ucode_capa.flags & IWL_UCODE_TLV_FLAGS_BSS_P2P_PS_DCM)) {
if (vifs->bss_active) if (vifs->bss_active)
bss_mvmvif->pm_enabled = true; bss_mvmvif->pm_enabled = true;
if (vifs->p2p_active && if (vifs->p2p_active)
(mvm->fw->ucode_capa.flags & IWL_UCODE_TLV_FLAGS_P2P_PM))
p2p_mvmvif->pm_enabled = true; p2p_mvmvif->pm_enabled = true;
return; return;
} }
...@@ -721,11 +718,9 @@ static void iwl_mvm_power_set_pm(struct iwl_mvm *mvm, ...@@ -721,11 +718,9 @@ static void iwl_mvm_power_set_pm(struct iwl_mvm *mvm,
* There is only one channel in the system and there are only * There is only one channel in the system and there are only
* bss and p2p clients that share it * bss and p2p clients that share it
*/ */
if (client_same_channel && !vifs->ap_active && if (client_same_channel && !vifs->ap_active) {
(mvm->fw->ucode_capa.flags & IWL_UCODE_TLV_FLAGS_BSS_P2P_PS_SCM)) {
/* share same channel*/ /* share same channel*/
bss_mvmvif->pm_enabled = true; bss_mvmvif->pm_enabled = true;
if (mvm->fw->ucode_capa.flags & IWL_UCODE_TLV_FLAGS_P2P_PM)
p2p_mvmvif->pm_enabled = true; p2p_mvmvif->pm_enabled = true;
} }
} }
......
...@@ -739,22 +739,6 @@ iwl_mvm_build_scan_probe(struct iwl_mvm *mvm, struct ieee80211_vif *vif, ...@@ -739,22 +739,6 @@ iwl_mvm_build_scan_probe(struct iwl_mvm *mvm, struct ieee80211_vif *vif,
params->preq.common_data.len = cpu_to_le16(ies->common_ie_len); params->preq.common_data.len = cpu_to_le16(ies->common_ie_len);
} }
static __le32 iwl_mvm_scan_priority(struct iwl_mvm *mvm,
enum iwl_scan_priority_ext prio)
{
if (fw_has_api(&mvm->fw->ucode_capa,
IWL_UCODE_TLV_API_EXT_SCAN_PRIORITY))
return cpu_to_le32(prio);
if (prio <= IWL_SCAN_PRIORITY_EXT_2)
return cpu_to_le32(IWL_SCAN_PRIORITY_LOW);
if (prio <= IWL_SCAN_PRIORITY_EXT_4)
return cpu_to_le32(IWL_SCAN_PRIORITY_MEDIUM);
return cpu_to_le32(IWL_SCAN_PRIORITY_HIGH);
}
static void iwl_mvm_scan_lmac_dwell(struct iwl_mvm *mvm, static void iwl_mvm_scan_lmac_dwell(struct iwl_mvm *mvm,
struct iwl_scan_req_lmac *cmd, struct iwl_scan_req_lmac *cmd,
struct iwl_mvm_scan_params *params) struct iwl_mvm_scan_params *params)
...@@ -765,7 +749,7 @@ static void iwl_mvm_scan_lmac_dwell(struct iwl_mvm *mvm, ...@@ -765,7 +749,7 @@ static void iwl_mvm_scan_lmac_dwell(struct iwl_mvm *mvm,
cmd->extended_dwell = scan_timing[params->type].dwell_extended; cmd->extended_dwell = scan_timing[params->type].dwell_extended;
cmd->max_out_time = cpu_to_le32(scan_timing[params->type].max_out_time); cmd->max_out_time = cpu_to_le32(scan_timing[params->type].max_out_time);
cmd->suspend_time = cpu_to_le32(scan_timing[params->type].suspend_time); cmd->suspend_time = cpu_to_le32(scan_timing[params->type].suspend_time);
cmd->scan_prio = iwl_mvm_scan_priority(mvm, IWL_SCAN_PRIORITY_EXT_6); cmd->scan_prio = cpu_to_le32(IWL_SCAN_PRIORITY_EXT_6);
} }
static inline bool iwl_mvm_scan_fits(struct iwl_mvm *mvm, int n_ssids, static inline bool iwl_mvm_scan_fits(struct iwl_mvm *mvm, int n_ssids,
...@@ -1067,15 +1051,12 @@ static void iwl_mvm_scan_umac_dwell(struct iwl_mvm *mvm, ...@@ -1067,15 +1051,12 @@ static void iwl_mvm_scan_umac_dwell(struct iwl_mvm *mvm,
cmd->fragmented_dwell = scan_timing[params->type].dwell_fragmented; cmd->fragmented_dwell = scan_timing[params->type].dwell_fragmented;
cmd->max_out_time = cpu_to_le32(scan_timing[params->type].max_out_time); cmd->max_out_time = cpu_to_le32(scan_timing[params->type].max_out_time);
cmd->suspend_time = cpu_to_le32(scan_timing[params->type].suspend_time); cmd->suspend_time = cpu_to_le32(scan_timing[params->type].suspend_time);
cmd->scan_priority = cmd->scan_priority = cpu_to_le32(IWL_SCAN_PRIORITY_EXT_6);
iwl_mvm_scan_priority(mvm, IWL_SCAN_PRIORITY_EXT_6);
if (iwl_mvm_is_regular_scan(params)) if (iwl_mvm_is_regular_scan(params))
cmd->ooc_priority = cmd->ooc_priority = cpu_to_le32(IWL_SCAN_PRIORITY_EXT_6);
iwl_mvm_scan_priority(mvm, IWL_SCAN_PRIORITY_EXT_6);
else else
cmd->ooc_priority = cmd->ooc_priority = cpu_to_le32(IWL_SCAN_PRIORITY_EXT_2);
iwl_mvm_scan_priority(mvm, IWL_SCAN_PRIORITY_EXT_2);
} }
static void static void
......
...@@ -933,7 +933,7 @@ static void iwl_mvm_unshare_queue(struct iwl_mvm *mvm, int queue) ...@@ -933,7 +933,7 @@ static void iwl_mvm_unshare_queue(struct iwl_mvm *mvm, int queue)
/* If aggs should be turned back on - do it */ /* If aggs should be turned back on - do it */
if (mvmsta->tid_data[tid].state == IWL_AGG_ON) { if (mvmsta->tid_data[tid].state == IWL_AGG_ON) {
struct iwl_mvm_add_sta_cmd cmd; struct iwl_mvm_add_sta_cmd cmd = {0};
mvmsta->tid_disable_agg &= ~BIT(tid); mvmsta->tid_disable_agg &= ~BIT(tid);
......
...@@ -241,11 +241,8 @@ static int iwl_mvm_get_temp_cmd(struct iwl_mvm *mvm) ...@@ -241,11 +241,8 @@ static int iwl_mvm_get_temp_cmd(struct iwl_mvm *mvm)
}; };
u32 cmdid; u32 cmdid;
if (fw_has_api(&mvm->fw->ucode_capa, IWL_UCODE_TLV_API_WIDE_CMD_HDR))
cmdid = iwl_cmd_id(CMD_DTS_MEASUREMENT_TRIGGER_WIDE, cmdid = iwl_cmd_id(CMD_DTS_MEASUREMENT_TRIGGER_WIDE,
PHY_OPS_GROUP, 0); PHY_OPS_GROUP, 0);
else
cmdid = CMD_DTS_MEASUREMENT_TRIGGER;
if (!fw_has_capa(&mvm->fw->ucode_capa, if (!fw_has_capa(&mvm->fw->ucode_capa,
IWL_UCODE_TLV_CAPA_EXTENDED_DTS_MEASURE)) IWL_UCODE_TLV_CAPA_EXTENDED_DTS_MEASURE))
...@@ -261,9 +258,6 @@ int iwl_mvm_get_temp(struct iwl_mvm *mvm, s32 *temp) ...@@ -261,9 +258,6 @@ int iwl_mvm_get_temp(struct iwl_mvm *mvm, s32 *temp)
DTS_MEASUREMENT_NOTIF_WIDE) }; DTS_MEASUREMENT_NOTIF_WIDE) };
int ret; int ret;
if (!fw_has_api(&mvm->fw->ucode_capa, IWL_UCODE_TLV_API_WIDE_CMD_HDR))
temp_notif[0] = DTS_MEASUREMENT_NOTIFICATION;
lockdep_assert_held(&mvm->mutex); lockdep_assert_held(&mvm->mutex);
iwl_init_notification_wait(&mvm->notif_wait, &wait_temp_notif, iwl_init_notification_wait(&mvm->notif_wait, &wait_temp_notif,
......
...@@ -346,7 +346,7 @@ void iwl_mvm_set_tx_cmd_rate(struct iwl_mvm *mvm, struct iwl_tx_cmd *tx_cmd, ...@@ -346,7 +346,7 @@ void iwl_mvm_set_tx_cmd_rate(struct iwl_mvm *mvm, struct iwl_tx_cmd *tx_cmd,
rate_idx = info->control.rates[0].idx; rate_idx = info->control.rates[0].idx;
/* if the rate isn't a well known legacy rate, take the lowest one */ /* if the rate isn't a well known legacy rate, take the lowest one */
if (rate_idx < 0 || rate_idx > IWL_RATE_COUNT_LEGACY) if (rate_idx < 0 || rate_idx >= IWL_RATE_COUNT_LEGACY)
rate_idx = rate_lowest_index( rate_idx = rate_lowest_index(
&mvm->nvm_data->bands[info->band], sta); &mvm->nvm_data->bands[info->band], sta);
...@@ -441,7 +441,7 @@ static void iwl_mvm_set_tx_cmd_crypto(struct iwl_mvm *mvm, ...@@ -441,7 +441,7 @@ static void iwl_mvm_set_tx_cmd_crypto(struct iwl_mvm *mvm,
* one. * one.
* Need to handle this. * Need to handle this.
*/ */
tx_cmd->sec_ctl |= TX_CMD_SEC_GCMP | TC_CMD_SEC_KEY_FROM_TABLE; tx_cmd->sec_ctl |= TX_CMD_SEC_GCMP | TX_CMD_SEC_KEY_FROM_TABLE;
tx_cmd->key[0] = keyconf->hw_key_idx; tx_cmd->key[0] = keyconf->hw_key_idx;
iwl_mvm_set_tx_cmd_pn(info, crypto_hdr); iwl_mvm_set_tx_cmd_pn(info, crypto_hdr);
break; break;
......
...@@ -512,7 +512,7 @@ void iwl_mvm_dump_nic_error_log(struct iwl_mvm *mvm) ...@@ -512,7 +512,7 @@ void iwl_mvm_dump_nic_error_log(struct iwl_mvm *mvm)
base = mvm->fw->inst_errlog_ptr; base = mvm->fw->inst_errlog_ptr;
} }
if (base < 0x800000) { if (base < 0x400000) {
IWL_ERR(mvm, IWL_ERR(mvm,
"Not valid error log pointer 0x%08X for %s uCode\n", "Not valid error log pointer 0x%08X for %s uCode\n",
base, base,
......
...@@ -529,6 +529,8 @@ static const struct pci_device_id iwl_hw_card_ids[] = { ...@@ -529,6 +529,8 @@ static const struct pci_device_id iwl_hw_card_ids[] = {
{IWL_PCI_DEVICE(0x9DF0, 0x0030, iwl9560_2ac_cfg)}, {IWL_PCI_DEVICE(0x9DF0, 0x0030, iwl9560_2ac_cfg)},
{IWL_PCI_DEVICE(0xA370, 0x0030, iwl9560_2ac_cfg)}, {IWL_PCI_DEVICE(0xA370, 0x0030, iwl9560_2ac_cfg)},
{IWL_PCI_DEVICE(0x31DC, 0x0030, iwl9560_2ac_cfg)}, {IWL_PCI_DEVICE(0x31DC, 0x0030, iwl9560_2ac_cfg)},
{IWL_PCI_DEVICE(0x2526, 0x1030, iwl9560_2ac_cfg)},
{IWL_PCI_DEVICE(0xA370, 0x1030, iwl9560_2ac_cfg)},
/* a000 Series */ /* a000 Series */
{IWL_PCI_DEVICE(0x2720, 0x0A10, iwla000_2ac_cfg)}, {IWL_PCI_DEVICE(0x2720, 0x0A10, iwla000_2ac_cfg)},
......
...@@ -497,23 +497,20 @@ void iwl_trans_pcie_reclaim(struct iwl_trans *trans, int txq_id, int ssn, ...@@ -497,23 +497,20 @@ void iwl_trans_pcie_reclaim(struct iwl_trans *trans, int txq_id, int ssn,
struct sk_buff_head *skbs); struct sk_buff_head *skbs);
void iwl_trans_pcie_tx_reset(struct iwl_trans *trans); void iwl_trans_pcie_tx_reset(struct iwl_trans *trans);
static inline u16 iwl_pcie_tfd_tb_get_len(struct iwl_trans *trans, void *tfd, static inline u16 iwl_pcie_tfd_tb_get_len(struct iwl_trans *trans, void *_tfd,
u8 idx) u8 idx)
{ {
struct iwl_tfd *tfd_fh;
struct iwl_tfd_tb *tb;
if (trans->cfg->use_tfh) { if (trans->cfg->use_tfh) {
struct iwl_tfh_tfd *tfd_fh = (void *)tfd; struct iwl_tfh_tfd *tfd = _tfd;
struct iwl_tfh_tb *tb = &tfd_fh->tbs[idx]; struct iwl_tfh_tb *tb = &tfd->tbs[idx];
return le16_to_cpu(tb->tb_len); return le16_to_cpu(tb->tb_len);
} } else {
struct iwl_tfd *tfd = _tfd;
tfd_fh = (void *)tfd; struct iwl_tfd_tb *tb = &tfd->tbs[idx];
tb = &tfd_fh->tbs[idx];
return le16_to_cpu(tb->hi_n_len) >> 4; return le16_to_cpu(tb->hi_n_len) >> 4;
}
} }
/***************************************************** /*****************************************************
......
...@@ -337,28 +337,32 @@ static inline void *iwl_pcie_get_tfd(struct iwl_trans_pcie *trans_pcie, ...@@ -337,28 +337,32 @@ static inline void *iwl_pcie_get_tfd(struct iwl_trans_pcie *trans_pcie,
} }
static inline dma_addr_t iwl_pcie_tfd_tb_get_addr(struct iwl_trans *trans, static inline dma_addr_t iwl_pcie_tfd_tb_get_addr(struct iwl_trans *trans,
void *tfd, u8 idx) void *_tfd, u8 idx)
{ {
struct iwl_tfd *tfd_fh;
struct iwl_tfd_tb *tb;
dma_addr_t addr;
if (trans->cfg->use_tfh) { if (trans->cfg->use_tfh) {
struct iwl_tfh_tfd *tfd_fh = (void *)tfd; struct iwl_tfh_tfd *tfd = _tfd;
struct iwl_tfh_tb *tb = &tfd_fh->tbs[idx]; struct iwl_tfh_tb *tb = &tfd->tbs[idx];
return (dma_addr_t)(le64_to_cpu(tb->addr)); return (dma_addr_t)(le64_to_cpu(tb->addr));
} } else {
struct iwl_tfd *tfd = _tfd;
struct iwl_tfd_tb *tb = &tfd->tbs[idx];
dma_addr_t addr = get_unaligned_le32(&tb->lo);
dma_addr_t hi_len;
tfd_fh = (void *)tfd; if (sizeof(dma_addr_t) <= sizeof(u32))
tb = &tfd_fh->tbs[idx]; return addr;
addr = get_unaligned_le32(&tb->lo);
if (sizeof(dma_addr_t) > sizeof(u32)) hi_len = le16_to_cpu(tb->hi_n_len) & 0xF;
addr |=
((dma_addr_t)(le16_to_cpu(tb->hi_n_len) & 0xF) << 16) << 16;
return addr; /*
* shift by 16 twice to avoid warnings on 32-bit
* (where this code never runs anyway due to the
* if statement above)
*/
return addr | ((hi_len << 16) << 16);
}
} }
static inline void iwl_pcie_tfd_set_tb(struct iwl_trans *trans, void *tfd, static inline void iwl_pcie_tfd_set_tb(struct iwl_trans *trans, void *tfd,
...@@ -388,18 +392,17 @@ static inline void iwl_pcie_tfd_set_tb(struct iwl_trans *trans, void *tfd, ...@@ -388,18 +392,17 @@ static inline void iwl_pcie_tfd_set_tb(struct iwl_trans *trans, void *tfd,
} }
} }
static inline u8 iwl_pcie_tfd_get_num_tbs(struct iwl_trans *trans, void *tfd) static inline u8 iwl_pcie_tfd_get_num_tbs(struct iwl_trans *trans, void *_tfd)
{ {
struct iwl_tfd *tfd_fh;
if (trans->cfg->use_tfh) { if (trans->cfg->use_tfh) {
struct iwl_tfh_tfd *tfd_fh = (void *)tfd; struct iwl_tfh_tfd *tfd = _tfd;
return le16_to_cpu(tfd_fh->num_tbs) & 0x1f; return le16_to_cpu(tfd->num_tbs) & 0x1f;
} } else {
struct iwl_tfd *tfd = _tfd;
tfd_fh = (void *)tfd; return tfd->num_tbs & 0x1f;
return tfd_fh->num_tbs & 0x1f; }
} }
static void iwl_pcie_tfd_unmap(struct iwl_trans *trans, static void iwl_pcie_tfd_unmap(struct iwl_trans *trans,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment