linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* pull request: iwlwifi-next 2015-08-23
@ 2015-08-23 10:05 Grumbach, Emmanuel
  2015-08-24 19:52 ` Kalle Valo
                   ` (7 more replies)
  0 siblings, 8 replies; 10+ messages in thread
From: Grumbach, Emmanuel @ 2015-08-23 10:05 UTC (permalink / raw)
  To: Kalle Valo; +Cc: linux-wireless@vger.kernel.org

Hi Kalle,

one very last pull request for 4.3 before the merge windows opens. I
hope it will make it.
Let me know if you have issues with it.

Thanks!

The following changes since commit ecc7c518b3017821a6b26fb5fdaa548afa8ee236:

  iwlwifi: mvm: fix a race in D0i3 vs. Tx path (2015-08-18 10:25:26 +0300)

are available in the git repository at:

 
https://git.kernel.org/pub/scm/linux/kernel/git/iwlwifi/iwlwifi-next.git
tags/iwlwifi-next-for-kalle-2015-08-23

for you to fetch changes up to 5865f3658ba37c54e346b0fdee08a1c7a152681b:

  iwlwifi: mvm: bump firmware API to 17 (2015-08-23 12:54:16 +0300)

----------------------------------------------------------------
* 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

----------------------------------------------------------------
Ayala Beker (1):
      iwlwifi: mvm: split debug message to avoid exceeding 110 characters

Dan Carpenter (1):
      iwlwifi: mvm: catch underflow error earlier

Emmanuel Grumbach (1):
      iwlwifi: mvm: bump firmware API to 17

Johannes Berg (2):
      iwlwifi: correctly size command string arrays
      iwlwifi: mvm: support new TX power command

Sara Sharon (1):
      iwlwifi: mvm: update wakeup reason enum

 drivers/net/wireless/iwlwifi/dvm/agn.h          |  2 +-
 drivers/net/wireless/iwlwifi/dvm/rx.c           |  2 +-
 drivers/net/wireless/iwlwifi/iwl-7000.c         |  2 +-
 drivers/net/wireless/iwlwifi/iwl-8000.c         |  2 +-
 drivers/net/wireless/iwlwifi/iwl-fw-file.h      |  3 +++
 drivers/net/wireless/iwlwifi/mvm/debugfs.c      |  5 +++--
 drivers/net/wireless/iwlwifi/mvm/fw-api-d3.h    |  7 ++++++-
 drivers/net/wireless/iwlwifi/mvm/fw-api-power.h | 29
+++++++++++++++++++++++++----
 drivers/net/wireless/iwlwifi/mvm/mac80211.c     | 15 +++++++++------
 drivers/net/wireless/iwlwifi/mvm/ops.c          |  2 +-
 drivers/net/wireless/iwlwifi/mvm/scan.c         | 20 ++++++++++++--------
 11 files changed, 63 insertions(+), 26 deletions(-)


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: pull request: iwlwifi-next 2015-08-23
  2015-08-23 10:05 pull request: iwlwifi-next 2015-08-23 Grumbach, Emmanuel
@ 2015-08-24 19:52 ` Kalle Valo
  2015-08-24 19:59   ` Grumbach, Emmanuel
  2015-08-24 20:00 ` [PATCH 1/6] iwlwifi: mvm: catch underflow error earlier Emmanuel Grumbach
                   ` (6 subsequent siblings)
  7 siblings, 1 reply; 10+ messages in thread
From: Kalle Valo @ 2015-08-24 19:52 UTC (permalink / raw)
  To: Grumbach, Emmanuel; +Cc: linux-wireless@vger.kernel.org

"Grumbach, Emmanuel" <emmanuel.grumbach@intel.com> writes:

> one very last pull request for 4.3 before the merge windows opens. I
> hope it will make it. Let me know if you have issues with it.

We got lucky as Linus released rc8 so we have few more days before the
merge window :)

But what about the patches, are they reviewed on linux-wireless or what?
I do not want to pull anything which is not reviewed publically.

-- 
Kalle Valo

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: pull request: iwlwifi-next 2015-08-23
  2015-08-24 19:52 ` Kalle Valo
@ 2015-08-24 19:59   ` Grumbach, Emmanuel
  0 siblings, 0 replies; 10+ messages in thread
From: Grumbach, Emmanuel @ 2015-08-24 19:59 UTC (permalink / raw)
  To: Kalle Valo; +Cc: linux-wireless@vger.kernel.org



On 08/24/2015 10:53 PM, Kalle Valo wrote:
> "Grumbach, Emmanuel" <emmanuel.grumbach@intel.com> writes:
> 
>> one very last pull request for 4.3 before the merge windows opens. I
>> hope it will make it. Let me know if you have issues with it.
> 
> We got lucky as Linus released rc8 so we have few more days before the
> merge window :)
> 
> But what about the patches, are they reviewed on linux-wireless or what?
> I do not want to pull anything which is not reviewed publically.
> 
yeah sure. Sorry - I forgot to publish them.

Will send them in a minute.

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [PATCH 1/6] iwlwifi: mvm: catch underflow error earlier
  2015-08-23 10:05 pull request: iwlwifi-next 2015-08-23 Grumbach, Emmanuel
  2015-08-24 19:52 ` Kalle Valo
@ 2015-08-24 20:00 ` Emmanuel Grumbach
  2015-08-24 20:00 ` [PATCH 2/6] iwlwifi: mvm: update wakeup reason enum Emmanuel Grumbach
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 10+ messages in thread
From: Emmanuel Grumbach @ 2015-08-24 20:00 UTC (permalink / raw)
  To: linux-wireless; +Cc: Dan Carpenter, Emmanuel Grumbach

From: Dan Carpenter <dan.carpenter@oracle.com>

My static checker complains that we don't check for underflows in
iwl_dbgfs_fw_dbg_conf_write().  This is harmless because we have a
sanity check in iwl_mvm_start_fw_dbg_conf(), but we may as well make
this unsigned and silence the underflow warning.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
---
 drivers/net/wireless/iwlwifi/mvm/debugfs.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/net/wireless/iwlwifi/mvm/debugfs.c b/drivers/net/wireless/iwlwifi/mvm/debugfs.c
index ca4a1f8..7d69a55 100644
--- a/drivers/net/wireless/iwlwifi/mvm/debugfs.c
+++ b/drivers/net/wireless/iwlwifi/mvm/debugfs.c
@@ -949,9 +949,10 @@ static ssize_t iwl_dbgfs_fw_dbg_conf_write(struct iwl_mvm *mvm,
 					   char *buf, size_t count,
 					   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)
 		return ret;
 
-- 
2.1.4


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH 2/6] iwlwifi: mvm: update wakeup reason enum
  2015-08-23 10:05 pull request: iwlwifi-next 2015-08-23 Grumbach, Emmanuel
  2015-08-24 19:52 ` Kalle Valo
  2015-08-24 20:00 ` [PATCH 1/6] iwlwifi: mvm: catch underflow error earlier Emmanuel Grumbach
@ 2015-08-24 20:00 ` Emmanuel Grumbach
  2015-08-24 20:00 ` [PATCH 3/6] iwlwifi: correctly size command string arrays Emmanuel Grumbach
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 10+ messages in thread
From: Emmanuel Grumbach @ 2015-08-24 20:00 UTC (permalink / raw)
  To: linux-wireless; +Cc: Sara Sharon, Emmanuel Grumbach

From: Sara Sharon <sara.sharon@intel.com>

when waking from d0i3 there is a wakeup reason.
Enum in driver is not up to date with FW api - fix it.

Signed-off-by: Sara Sharon <sara.sharon@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
---
 drivers/net/wireless/iwlwifi/mvm/fw-api-d3.h | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/drivers/net/wireless/iwlwifi/mvm/fw-api-d3.h b/drivers/net/wireless/iwlwifi/mvm/fw-api-d3.h
index d7658d1..20521be 100644
--- a/drivers/net/wireless/iwlwifi/mvm/fw-api-d3.h
+++ b/drivers/net/wireless/iwlwifi/mvm/fw-api-d3.h
@@ -339,8 +339,13 @@ enum iwl_wowlan_wakeup_reason {
 	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_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_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 */
 
 struct iwl_wowlan_gtk_status {
-- 
2.1.4


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH 3/6] iwlwifi: correctly size command string arrays
  2015-08-23 10:05 pull request: iwlwifi-next 2015-08-23 Grumbach, Emmanuel
                   ` (2 preceding siblings ...)
  2015-08-24 20:00 ` [PATCH 2/6] iwlwifi: mvm: update wakeup reason enum Emmanuel Grumbach
@ 2015-08-24 20:00 ` Emmanuel Grumbach
  2015-08-24 20:00 ` [PATCH 4/6] iwlwifi: mvm: split debug message to avoid exceeding 110 characters Emmanuel Grumbach
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 10+ messages in thread
From: Emmanuel Grumbach @ 2015-08-24 20:00 UTC (permalink / raw)
  To: linux-wireless; +Cc: Johannes Berg, Emmanuel Grumbach

From: Johannes Berg <johannes.berg@intel.com>

The command string array is assumed to be indexable by a full u8, so it
must have 256 entries (0-255), not just 255. A recent firmware change
(apparently) started using the command 0xff for a notification to the
host, causing the driver to crash in debug message/tracing code.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
---
 drivers/net/wireless/iwlwifi/dvm/agn.h | 2 +-
 drivers/net/wireless/iwlwifi/dvm/rx.c  | 2 +-
 drivers/net/wireless/iwlwifi/mvm/ops.c | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/net/wireless/iwlwifi/dvm/agn.h b/drivers/net/wireless/iwlwifi/dvm/agn.h
index edc3dd4..991def8 100644
--- a/drivers/net/wireless/iwlwifi/dvm/agn.h
+++ b/drivers/net/wireless/iwlwifi/dvm/agn.h
@@ -473,7 +473,7 @@ do {									\
 } while (0)
 #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)
 {
diff --git a/drivers/net/wireless/iwlwifi/dvm/rx.c b/drivers/net/wireless/iwlwifi/dvm/rx.c
index 4785203..4a45b0b 100644
--- a/drivers/net/wireless/iwlwifi/dvm/rx.c
+++ b/drivers/net/wireless/iwlwifi/dvm/rx.c
@@ -39,7 +39,7 @@
 
 #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_ERROR),
 	IWL_CMD_ENTRY(REPLY_ECHO),
diff --git a/drivers/net/wireless/iwlwifi/mvm/ops.c b/drivers/net/wireless/iwlwifi/mvm/ops.c
index 07e6892..a37de3f 100644
--- a/drivers/net/wireless/iwlwifi/mvm/ops.c
+++ b/drivers/net/wireless/iwlwifi/mvm/ops.c
@@ -268,7 +268,7 @@ static const struct iwl_rx_handlers iwl_mvm_rx_handlers[] = {
 #undef RX_HANDLER_GRP
 #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(REPLY_ERROR),
 	CMD(INIT_COMPLETE_NOTIF),
-- 
2.1.4


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH 4/6] iwlwifi: mvm: split debug message to avoid exceeding 110 characters
  2015-08-23 10:05 pull request: iwlwifi-next 2015-08-23 Grumbach, Emmanuel
                   ` (3 preceding siblings ...)
  2015-08-24 20:00 ` [PATCH 3/6] iwlwifi: correctly size command string arrays Emmanuel Grumbach
@ 2015-08-24 20:00 ` Emmanuel Grumbach
  2015-08-24 20:00 ` [PATCH 5/6] iwlwifi: mvm: support new TX power command Emmanuel Grumbach
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 10+ messages in thread
From: Emmanuel Grumbach @ 2015-08-24 20:00 UTC (permalink / raw)
  To: linux-wireless; +Cc: Ayala Beker, Emmanuel Grumbach

From: Ayala Beker <ayala.beker@intel.com>

split long debug messages that may result warning in tracing.

Fixes: 1a84e7716086 ("iwlwifi: mvm: add debug info to schedule scan complete message.")
Signed-off-by: Ayala Beker <ayala.beker@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
---
 drivers/net/wireless/iwlwifi/mvm/scan.c | 20 ++++++++++++--------
 1 file changed, 12 insertions(+), 8 deletions(-)

diff --git a/drivers/net/wireless/iwlwifi/mvm/scan.c b/drivers/net/wireless/iwlwifi/mvm/scan.c
index 1505546..56559d4 100644
--- a/drivers/net/wireless/iwlwifi/mvm/scan.c
+++ b/drivers/net/wireless/iwlwifi/mvm/scan.c
@@ -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) {
 		WARN_ON_ONCE(mvm->scan_status & IWL_MVM_SCAN_STOPPING_REGULAR);
 
-		IWL_DEBUG_SCAN(mvm,
-			       "Scheduled scan %s, EBS status %s, Last line %d, Last iteration %d, Time after last iteration %d\n",
+		IWL_DEBUG_SCAN(mvm, "Scheduled scan %s, EBS status %s\n",
 			       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_iteration,
 			       __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,
 	} else if (mvm->scan_status & IWL_MVM_SCAN_SCHED) {
 		WARN_ON_ONCE(mvm->scan_status & IWL_MVM_SCAN_REGULAR);
 
-		IWL_DEBUG_SCAN(mvm,
-			       "Scheduled scan %s, EBS status %s, Last line %d, Last iteration %d, Time after last iteration %d (FW)\n",
+		IWL_DEBUG_SCAN(mvm, "Scheduled scan %s, EBS status %s\n",
 			       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_iteration,
 			       __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,
 
 	mvm->scan_status &= ~mvm->scan_uid_status[uid];
 	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],
 		       notif->status == IWL_SCAN_OFFLOAD_COMPLETED ?
 				"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,
 		       __le32_to_cpu(notif->time_from_last_iter));
 
-- 
2.1.4


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH 5/6] iwlwifi: mvm: support new TX power command
  2015-08-23 10:05 pull request: iwlwifi-next 2015-08-23 Grumbach, Emmanuel
                   ` (4 preceding siblings ...)
  2015-08-24 20:00 ` [PATCH 4/6] iwlwifi: mvm: split debug message to avoid exceeding 110 characters Emmanuel Grumbach
@ 2015-08-24 20:00 ` Emmanuel Grumbach
  2015-08-24 20:00 ` [PATCH 6/6] iwlwifi: mvm: bump firmware API to 17 Emmanuel Grumbach
  2015-08-25 12:03 ` pull request: iwlwifi-next 2015-08-23 Kalle Valo
  7 siblings, 0 replies; 10+ messages in thread
From: Emmanuel Grumbach @ 2015-08-24 20:00 UTC (permalink / raw)
  To: linux-wireless; +Cc: Johannes Berg, Emmanuel Grumbach

From: Johannes Berg <johannes.berg@intel.com>

Add support for the new (bigger) TX power command. This doesn't
actually take advantage of the new capabilities (to set per-chain
TX power limits) but makes the code compatible with newer firmware
images expecting the larger command.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
---
 drivers/net/wireless/iwlwifi/iwl-fw-file.h      |  3 +++
 drivers/net/wireless/iwlwifi/mvm/fw-api-power.h | 29 +++++++++++++++++++++----
 drivers/net/wireless/iwlwifi/mvm/mac80211.c     | 15 ++++++++-----
 3 files changed, 37 insertions(+), 10 deletions(-)

diff --git a/drivers/net/wireless/iwlwifi/iwl-fw-file.h b/drivers/net/wireless/iwlwifi/iwl-fw-file.h
index 75809ab..84653e3 100644
--- a/drivers/net/wireless/iwlwifi/iwl-fw-file.h
+++ b/drivers/net/wireless/iwlwifi/iwl-fw-file.h
@@ -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_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
  */
 enum iwl_ucode_tlv_api {
 	IWL_UCODE_TLV_API_BT_COEX_SPLIT         = (__force iwl_ucode_tlv_api_t)3,
@@ -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_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,
 };
 
 typedef unsigned int __bitwise__ iwl_ucode_tlv_capa_t;
diff --git a/drivers/net/wireless/iwlwifi/mvm/fw-api-power.h b/drivers/net/wireless/iwlwifi/mvm/fw-api-power.h
index b86b169..7005fa4 100644
--- a/drivers/net/wireless/iwlwifi/mvm/fw-api-power.h
+++ b/drivers/net/wireless/iwlwifi/mvm/fw-api-power.h
@@ -7,6 +7,7 @@
  *
  * Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved.
  * 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
  * it under the terms of version 2 of the GNU General Public License as
@@ -33,6 +34,7 @@
  *
  * Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved.
  * Copyright(c) 2013 - 2014 Intel Mobile Communications GmbH
+ * Copyright(c) 2015 Intel Deutschland GmbH
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -310,17 +312,22 @@ struct iwl_reduce_tx_power_cmd {
 	__le16 pwr_restriction;
 } __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
- * REDUCE_TX_POWER_CMD = 0x9f
- * @set_mode: 0 - MAC tx power, 1 - device tx power
+ * struct iwl_dev_tx_power_cmd_v2 - TX power reduction command
+ * @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.
  * @pwr_restriction: 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_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 mac_context_id;
 	__le16 pwr_restriction;
@@ -329,6 +336,20 @@ struct iwl_dev_tx_power_cmd {
 	__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 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
 
 /**
diff --git a/drivers/net/wireless/iwlwifi/mvm/mac80211.c b/drivers/net/wireless/iwlwifi/mvm/mac80211.c
index 537a157..aa8c2b7 100644
--- a/drivers/net/wireless/iwlwifi/mvm/mac80211.c
+++ b/drivers/net/wireless/iwlwifi/mvm/mac80211.c
@@ -1595,20 +1595,23 @@ static int iwl_mvm_set_tx_power(struct iwl_mvm *mvm, struct ieee80211_vif *vif,
 				s16 tx_power)
 {
 	struct iwl_dev_tx_power_cmd cmd = {
-		.set_mode = 0,
-		.mac_context_id =
+		.v2.set_mode = cpu_to_le32(IWL_TX_POWER_MODE_SET_MAC),
+		.v2.mac_context_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))
 		return iwl_mvm_set_tx_power_old(mvm, vif, 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,
-				    sizeof(cmd), &cmd);
+	if (!fw_has_api(&mvm->fw->ucode_capa, IWL_UCODE_TLV_API_TX_POWER_CHAIN))
+		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,
-- 
2.1.4


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH 6/6] iwlwifi: mvm: bump firmware API to 17
  2015-08-23 10:05 pull request: iwlwifi-next 2015-08-23 Grumbach, Emmanuel
                   ` (5 preceding siblings ...)
  2015-08-24 20:00 ` [PATCH 5/6] iwlwifi: mvm: support new TX power command Emmanuel Grumbach
@ 2015-08-24 20:00 ` Emmanuel Grumbach
  2015-08-25 12:03 ` pull request: iwlwifi-next 2015-08-23 Kalle Valo
  7 siblings, 0 replies; 10+ messages in thread
From: Emmanuel Grumbach @ 2015-08-24 20:00 UTC (permalink / raw)
  To: linux-wireless; +Cc: Emmanuel Grumbach

The driver is now able to handle -17.ucode.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
---
 drivers/net/wireless/iwlwifi/iwl-7000.c | 2 +-
 drivers/net/wireless/iwlwifi/iwl-8000.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/wireless/iwlwifi/iwl-7000.c b/drivers/net/wireless/iwlwifi/iwl-7000.c
index 413b63e..6951aba 100644
--- a/drivers/net/wireless/iwlwifi/iwl-7000.c
+++ b/drivers/net/wireless/iwlwifi/iwl-7000.c
@@ -69,7 +69,7 @@
 #include "iwl-agn-hw.h"
 
 /* Highest firmware API version supported */
-#define IWL7260_UCODE_API_MAX	16
+#define IWL7260_UCODE_API_MAX	17
 
 /* Oldest version we won't warn about */
 #define IWL7260_UCODE_API_OK	12
diff --git a/drivers/net/wireless/iwlwifi/iwl-8000.c b/drivers/net/wireless/iwlwifi/iwl-8000.c
index 8324bc8..197abe4 100644
--- a/drivers/net/wireless/iwlwifi/iwl-8000.c
+++ b/drivers/net/wireless/iwlwifi/iwl-8000.c
@@ -69,7 +69,7 @@
 #include "iwl-agn-hw.h"
 
 /* Highest firmware API version supported */
-#define IWL8000_UCODE_API_MAX	16
+#define IWL8000_UCODE_API_MAX	17
 
 /* Oldest version we won't warn about */
 #define IWL8000_UCODE_API_OK	12
-- 
2.1.4


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* Re: pull request: iwlwifi-next 2015-08-23
  2015-08-23 10:05 pull request: iwlwifi-next 2015-08-23 Grumbach, Emmanuel
                   ` (6 preceding siblings ...)
  2015-08-24 20:00 ` [PATCH 6/6] iwlwifi: mvm: bump firmware API to 17 Emmanuel Grumbach
@ 2015-08-25 12:03 ` Kalle Valo
  7 siblings, 0 replies; 10+ messages in thread
From: Kalle Valo @ 2015-08-25 12:03 UTC (permalink / raw)
  To: Grumbach, Emmanuel; +Cc: linux-wireless@vger.kernel.org

"Grumbach, Emmanuel" <emmanuel.grumbach@intel.com> writes:

> one very last pull request for 4.3 before the merge windows opens. I
> hope it will make it. Let me know if you have issues with it.
>
> Thanks!
>
> The following changes since commit ecc7c518b3017821a6b26fb5fdaa548afa8ee236:
>
>   iwlwifi: mvm: fix a race in D0i3 vs. Tx path (2015-08-18 10:25:26 +0300)
>
> are available in the git repository at:
>
>  
> https://git.kernel.org/pub/scm/linux/kernel/git/iwlwifi/iwlwifi-next.git
> tags/iwlwifi-next-for-kalle-2015-08-23

Thanks, pulled.

-- 
Kalle Valo

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2015-08-25 12:03 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-08-23 10:05 pull request: iwlwifi-next 2015-08-23 Grumbach, Emmanuel
2015-08-24 19:52 ` Kalle Valo
2015-08-24 19:59   ` Grumbach, Emmanuel
2015-08-24 20:00 ` [PATCH 1/6] iwlwifi: mvm: catch underflow error earlier Emmanuel Grumbach
2015-08-24 20:00 ` [PATCH 2/6] iwlwifi: mvm: update wakeup reason enum Emmanuel Grumbach
2015-08-24 20:00 ` [PATCH 3/6] iwlwifi: correctly size command string arrays Emmanuel Grumbach
2015-08-24 20:00 ` [PATCH 4/6] iwlwifi: mvm: split debug message to avoid exceeding 110 characters Emmanuel Grumbach
2015-08-24 20:00 ` [PATCH 5/6] iwlwifi: mvm: support new TX power command Emmanuel Grumbach
2015-08-24 20:00 ` [PATCH 6/6] iwlwifi: mvm: bump firmware API to 17 Emmanuel Grumbach
2015-08-25 12:03 ` pull request: iwlwifi-next 2015-08-23 Kalle Valo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).