Commit 11c36537 authored by Kalle Valo's avatar Kalle Valo

Merge tag 'iwlwifi-next-for-kalle-2015-08-23' of...

Merge tag 'iwlwifi-next-for-kalle-2015-08-23' of https://git.kernel.org/pub/scm/linux/kernel/git/iwlwifi/iwlwifi-next

* new Tx power firmware API
* bump max firmware API to 17
* fix bug in debug prints
* static checker fix
* fix unused defines
* fix command list on newest firmware
parents 4a89ba04 5865f365
...@@ -473,7 +473,7 @@ do { \ ...@@ -473,7 +473,7 @@ do { \
} while (0) } while (0)
#endif /* CONFIG_IWLWIFI_DEBUG */ #endif /* CONFIG_IWLWIFI_DEBUG */
extern const char *const iwl_dvm_cmd_strings[REPLY_MAX]; extern const char *const iwl_dvm_cmd_strings[REPLY_MAX + 1];
static inline const char *iwl_dvm_get_cmd_string(u8 cmd) static inline const char *iwl_dvm_get_cmd_string(u8 cmd)
{ {
......
...@@ -39,7 +39,7 @@ ...@@ -39,7 +39,7 @@
#define IWL_CMD_ENTRY(x) [x] = #x #define IWL_CMD_ENTRY(x) [x] = #x
const char *const iwl_dvm_cmd_strings[REPLY_MAX] = { const char *const iwl_dvm_cmd_strings[REPLY_MAX + 1] = {
IWL_CMD_ENTRY(REPLY_ALIVE), IWL_CMD_ENTRY(REPLY_ALIVE),
IWL_CMD_ENTRY(REPLY_ERROR), IWL_CMD_ENTRY(REPLY_ERROR),
IWL_CMD_ENTRY(REPLY_ECHO), IWL_CMD_ENTRY(REPLY_ECHO),
......
...@@ -69,7 +69,7 @@ ...@@ -69,7 +69,7 @@
#include "iwl-agn-hw.h" #include "iwl-agn-hw.h"
/* Highest firmware API version supported */ /* Highest firmware API version supported */
#define IWL7260_UCODE_API_MAX 16 #define IWL7260_UCODE_API_MAX 17
/* Oldest version we won't warn about */ /* Oldest version we won't warn about */
#define IWL7260_UCODE_API_OK 12 #define IWL7260_UCODE_API_OK 12
......
...@@ -69,7 +69,7 @@ ...@@ -69,7 +69,7 @@
#include "iwl-agn-hw.h" #include "iwl-agn-hw.h"
/* Highest firmware API version supported */ /* Highest firmware API version supported */
#define IWL8000_UCODE_API_MAX 16 #define IWL8000_UCODE_API_MAX 17
/* Oldest version we won't warn about */ /* Oldest version we won't warn about */
#define IWL8000_UCODE_API_OK 12 #define IWL8000_UCODE_API_OK 12
......
...@@ -259,6 +259,8 @@ typedef unsigned int __bitwise__ iwl_ucode_tlv_api_t; ...@@ -259,6 +259,8 @@ typedef unsigned int __bitwise__ iwl_ucode_tlv_api_t;
* @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 * @IWL_UCODE_TLV_API_EXT_SCAN_PRIORITY: scan APIs use 8-level priority
* instead of 3. * 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
*/ */
enum iwl_ucode_tlv_api { enum iwl_ucode_tlv_api {
IWL_UCODE_TLV_API_BT_COEX_SPLIT = (__force iwl_ucode_tlv_api_t)3, IWL_UCODE_TLV_API_BT_COEX_SPLIT = (__force iwl_ucode_tlv_api_t)3,
...@@ -274,6 +276,7 @@ enum iwl_ucode_tlv_api { ...@@ -274,6 +276,7 @@ enum iwl_ucode_tlv_api {
IWL_UCODE_TLV_API_STATS_V10 = (__force iwl_ucode_tlv_api_t)19, IWL_UCODE_TLV_API_STATS_V10 = (__force iwl_ucode_tlv_api_t)19,
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_EXT_SCAN_PRIORITY = (__force iwl_ucode_tlv_api_t)24,
IWL_UCODE_TLV_API_TX_POWER_CHAIN = (__force iwl_ucode_tlv_api_t)27,
}; };
typedef unsigned int __bitwise__ iwl_ucode_tlv_capa_t; typedef unsigned int __bitwise__ iwl_ucode_tlv_capa_t;
......
...@@ -949,9 +949,10 @@ static ssize_t iwl_dbgfs_fw_dbg_conf_write(struct iwl_mvm *mvm, ...@@ -949,9 +949,10 @@ static ssize_t iwl_dbgfs_fw_dbg_conf_write(struct iwl_mvm *mvm,
char *buf, size_t count, char *buf, size_t count,
loff_t *ppos) loff_t *ppos)
{ {
int ret, conf_id; unsigned int conf_id;
int ret;
ret = kstrtoint(buf, 0, &conf_id); ret = kstrtouint(buf, 0, &conf_id);
if (ret) if (ret)
return ret; return ret;
......
...@@ -339,8 +339,13 @@ enum iwl_wowlan_wakeup_reason { ...@@ -339,8 +339,13 @@ enum iwl_wowlan_wakeup_reason {
IWL_WOWLAN_WAKEUP_BY_FOUR_WAY_HANDSHAKE = BIT(8), IWL_WOWLAN_WAKEUP_BY_FOUR_WAY_HANDSHAKE = BIT(8),
IWL_WOWLAN_WAKEUP_BY_REM_WAKE_LINK_LOSS = BIT(9), IWL_WOWLAN_WAKEUP_BY_REM_WAKE_LINK_LOSS = BIT(9),
IWL_WOWLAN_WAKEUP_BY_REM_WAKE_SIGNATURE_TABLE = BIT(10), IWL_WOWLAN_WAKEUP_BY_REM_WAKE_SIGNATURE_TABLE = BIT(10),
/* BIT(11) reserved */ IWL_WOWLAN_WAKEUP_BY_REM_WAKE_TCP_EXTERNAL = BIT(11),
IWL_WOWLAN_WAKEUP_BY_REM_WAKE_WAKEUP_PACKET = BIT(12), IWL_WOWLAN_WAKEUP_BY_REM_WAKE_WAKEUP_PACKET = BIT(12),
IWL_WOWLAN_WAKEUP_BY_IOAC_MAGIC_PACKET = BIT(13),
IWL_WOWLAN_WAKEUP_BY_D3_WAKEUP_HOST_TIMER = BIT(14),
IWL_WOWLAN_WAKEUP_BY_RXFRAME_FILTERED_IN = BIT(15),
IWL_WOWLAN_WAKEUP_BY_BEACON_FILTERED_IN = BIT(16),
}; /* WOWLAN_WAKE_UP_REASON_API_E_VER_2 */ }; /* WOWLAN_WAKE_UP_REASON_API_E_VER_2 */
struct iwl_wowlan_gtk_status { struct iwl_wowlan_gtk_status {
......
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
* *
* Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved. * Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved.
* Copyright(c) 2013 - 2014 Intel Mobile Communications GmbH * Copyright(c) 2013 - 2014 Intel Mobile Communications GmbH
* Copyright(c) 2015 Intel Deutschland GmbH
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of version 2 of the GNU General Public License as
...@@ -33,6 +34,7 @@ ...@@ -33,6 +34,7 @@
* *
* Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved. * Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved.
* Copyright(c) 2013 - 2014 Intel Mobile Communications GmbH * Copyright(c) 2013 - 2014 Intel Mobile Communications GmbH
* Copyright(c) 2015 Intel Deutschland GmbH
* All rights reserved. * All rights reserved.
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
...@@ -310,17 +312,22 @@ struct iwl_reduce_tx_power_cmd { ...@@ -310,17 +312,22 @@ struct iwl_reduce_tx_power_cmd {
__le16 pwr_restriction; __le16 pwr_restriction;
} __packed; /* TX_REDUCED_POWER_API_S_VER_1 */ } __packed; /* TX_REDUCED_POWER_API_S_VER_1 */
enum iwl_dev_tx_power_cmd_mode {
IWL_TX_POWER_MODE_SET_MAC = 0,
IWL_TX_POWER_MODE_SET_DEVICE = 1,
IWL_TX_POWER_MODE_SET_CHAINS = 2,
}; /* TX_POWER_REDUCED_FLAGS_TYPE_API_E_VER_2 */;
/** /**
* struct iwl_dev_tx_power_cmd - TX power reduction command * struct iwl_dev_tx_power_cmd_v2 - TX power reduction command
* REDUCE_TX_POWER_CMD = 0x9f * @set_mode: see &enum iwl_dev_tx_power_cmd_mode
* @set_mode: 0 - MAC tx power, 1 - device tx power
* @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
*/ */
struct iwl_dev_tx_power_cmd { struct iwl_dev_tx_power_cmd_v2 {
__le32 set_mode; __le32 set_mode;
__le32 mac_context_id; __le32 mac_context_id;
__le16 pwr_restriction; __le16 pwr_restriction;
...@@ -329,6 +336,20 @@ struct iwl_dev_tx_power_cmd { ...@@ -329,6 +336,20 @@ struct iwl_dev_tx_power_cmd {
__le16 dev_52_high; __le16 dev_52_high;
} __packed; /* TX_REDUCED_POWER_API_S_VER_2 */ } __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 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];
} __packed; /* TX_REDUCED_POWER_API_S_VER_3 */
#define IWL_DEV_MAX_TX_POWER 0x7FFF #define IWL_DEV_MAX_TX_POWER 0x7FFF
/** /**
......
...@@ -1595,20 +1595,23 @@ static int iwl_mvm_set_tx_power(struct iwl_mvm *mvm, struct ieee80211_vif *vif, ...@@ -1595,20 +1595,23 @@ 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 = {
.set_mode = 0, .v2.set_mode = cpu_to_le32(IWL_TX_POWER_MODE_SET_MAC),
.mac_context_id = .v2.mac_context_id =
cpu_to_le32(iwl_mvm_vif_from_mac80211(vif)->id), cpu_to_le32(iwl_mvm_vif_from_mac80211(vif)->id),
.pwr_restriction = cpu_to_le16(8 * tx_power), .v2.pwr_restriction = cpu_to_le16(8 * tx_power),
}; };
int len = sizeof(cmd);
if (!fw_has_api(&mvm->fw->ucode_capa, IWL_UCODE_TLV_API_TX_POWER_DEV)) if (!fw_has_api(&mvm->fw->ucode_capa, IWL_UCODE_TLV_API_TX_POWER_DEV))
return iwl_mvm_set_tx_power_old(mvm, vif, tx_power); return iwl_mvm_set_tx_power_old(mvm, vif, tx_power);
if (tx_power == IWL_DEFAULT_MAX_TX_POWER) if (tx_power == IWL_DEFAULT_MAX_TX_POWER)
cmd.pwr_restriction = cpu_to_le16(IWL_DEV_MAX_TX_POWER); cmd.v2.pwr_restriction = cpu_to_le16(IWL_DEV_MAX_TX_POWER);
return iwl_mvm_send_cmd_pdu(mvm, REDUCE_TX_POWER_CMD, 0, if (!fw_has_api(&mvm->fw->ucode_capa, IWL_UCODE_TLV_API_TX_POWER_CHAIN))
sizeof(cmd), &cmd); len = sizeof(cmd.v2);
return iwl_mvm_send_cmd_pdu(mvm, REDUCE_TX_POWER_CMD, 0, len, &cmd);
} }
static int iwl_mvm_mac_add_interface(struct ieee80211_hw *hw, static int iwl_mvm_mac_add_interface(struct ieee80211_hw *hw,
......
...@@ -268,7 +268,7 @@ static const struct iwl_rx_handlers iwl_mvm_rx_handlers[] = { ...@@ -268,7 +268,7 @@ static const struct iwl_rx_handlers iwl_mvm_rx_handlers[] = {
#undef RX_HANDLER_GRP #undef RX_HANDLER_GRP
#define CMD(x) [x] = #x #define CMD(x) [x] = #x
static const char *const iwl_mvm_cmd_strings[REPLY_MAX] = { static const char *const iwl_mvm_cmd_strings[REPLY_MAX + 1] = {
CMD(MVM_ALIVE), CMD(MVM_ALIVE),
CMD(REPLY_ERROR), CMD(REPLY_ERROR),
CMD(INIT_COMPLETE_NOTIF), CMD(INIT_COMPLETE_NOTIF),
......
...@@ -349,10 +349,11 @@ void iwl_mvm_rx_lmac_scan_complete_notif(struct iwl_mvm *mvm, ...@@ -349,10 +349,11 @@ void iwl_mvm_rx_lmac_scan_complete_notif(struct iwl_mvm *mvm,
if (mvm->scan_status & IWL_MVM_SCAN_STOPPING_SCHED) { if (mvm->scan_status & IWL_MVM_SCAN_STOPPING_SCHED) {
WARN_ON_ONCE(mvm->scan_status & IWL_MVM_SCAN_STOPPING_REGULAR); WARN_ON_ONCE(mvm->scan_status & IWL_MVM_SCAN_STOPPING_REGULAR);
IWL_DEBUG_SCAN(mvm, IWL_DEBUG_SCAN(mvm, "Scheduled scan %s, EBS status %s\n",
"Scheduled scan %s, EBS status %s, Last line %d, Last iteration %d, Time after last iteration %d\n",
aborted ? "aborted" : "completed", aborted ? "aborted" : "completed",
iwl_mvm_ebs_status_str(scan_notif->ebs_status), iwl_mvm_ebs_status_str(scan_notif->ebs_status));
IWL_DEBUG_SCAN(mvm,
"Last line %d, Last iteration %d, Time after last iteration %d\n",
scan_notif->last_schedule_line, scan_notif->last_schedule_line,
scan_notif->last_schedule_iteration, scan_notif->last_schedule_iteration,
__le32_to_cpu(scan_notif->time_after_last_iter)); __le32_to_cpu(scan_notif->time_after_last_iter));
...@@ -367,10 +368,11 @@ void iwl_mvm_rx_lmac_scan_complete_notif(struct iwl_mvm *mvm, ...@@ -367,10 +368,11 @@ void iwl_mvm_rx_lmac_scan_complete_notif(struct iwl_mvm *mvm,
} else if (mvm->scan_status & IWL_MVM_SCAN_SCHED) { } else if (mvm->scan_status & IWL_MVM_SCAN_SCHED) {
WARN_ON_ONCE(mvm->scan_status & IWL_MVM_SCAN_REGULAR); WARN_ON_ONCE(mvm->scan_status & IWL_MVM_SCAN_REGULAR);
IWL_DEBUG_SCAN(mvm, IWL_DEBUG_SCAN(mvm, "Scheduled scan %s, EBS status %s\n",
"Scheduled scan %s, EBS status %s, Last line %d, Last iteration %d, Time after last iteration %d (FW)\n",
aborted ? "aborted" : "completed", aborted ? "aborted" : "completed",
iwl_mvm_ebs_status_str(scan_notif->ebs_status), iwl_mvm_ebs_status_str(scan_notif->ebs_status));
IWL_DEBUG_SCAN(mvm,
"Last line %d, Last iteration %d, Time after last iteration %d (FW)\n",
scan_notif->last_schedule_line, scan_notif->last_schedule_line,
scan_notif->last_schedule_iteration, scan_notif->last_schedule_iteration,
__le32_to_cpu(scan_notif->time_after_last_iter)); __le32_to_cpu(scan_notif->time_after_last_iter));
...@@ -1346,11 +1348,13 @@ void iwl_mvm_rx_umac_scan_complete_notif(struct iwl_mvm *mvm, ...@@ -1346,11 +1348,13 @@ void iwl_mvm_rx_umac_scan_complete_notif(struct iwl_mvm *mvm,
mvm->scan_status &= ~mvm->scan_uid_status[uid]; mvm->scan_status &= ~mvm->scan_uid_status[uid];
IWL_DEBUG_SCAN(mvm, IWL_DEBUG_SCAN(mvm,
"Scan completed, uid %u type %u, status %s, EBS status %s, Last line %d, Last iteration %d, Time from last iteration %d\n", "Scan completed, uid %u type %u, status %s, EBS status %s\n",
uid, mvm->scan_uid_status[uid], uid, mvm->scan_uid_status[uid],
notif->status == IWL_SCAN_OFFLOAD_COMPLETED ? notif->status == IWL_SCAN_OFFLOAD_COMPLETED ?
"completed" : "aborted", "completed" : "aborted",
iwl_mvm_ebs_status_str(notif->ebs_status), iwl_mvm_ebs_status_str(notif->ebs_status));
IWL_DEBUG_SCAN(mvm,
"Last line %d, Last iteration %d, Time from last iteration %d\n",
notif->last_schedule, notif->last_iter, notif->last_schedule, notif->last_iter,
__le32_to_cpu(notif->time_from_last_iter)); __le32_to_cpu(notif->time_from_last_iter));
......
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