All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] iwlwifi: mvm: fix old scan version sizes
@ 2018-04-23 13:01 Luca Coelho
  2018-04-23 13:10 ` Kalle Valo
  2018-04-24 10:13 ` Kalle Valo
  0 siblings, 2 replies; 4+ messages in thread
From: Luca Coelho @ 2018-04-23 13:01 UTC (permalink / raw)
  To: kvalo; +Cc: linux-wireless, mika.westerberg, Luca Coelho

From: Luca Coelho <luciano.coelho@intel.com>

When version 8 of the scan command API was introduced, only the size
of version 7 was updated, causing older versions of the firmware to
throw BAD_COMMAND errors.

Calculating the old version based on the size of the latest version
got too complicated and the size of the older versions will never
change anyway, so it's better to just hardcoded the sizes.

Fixes: 66fa2424df16 ("iwlwifi: fw api: support the new scan request FW API version")
Reported-by: Scott Register <sreg@sreg.io>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
---
 drivers/net/wireless/intel/iwlwifi/fw/api/scan.h | 13 +++++--------
 1 file changed, 5 insertions(+), 8 deletions(-)

diff --git a/drivers/net/wireless/intel/iwlwifi/fw/api/scan.h b/drivers/net/wireless/intel/iwlwifi/fw/api/scan.h
index 7af3a0f51b77..a17c4a79b8d4 100644
--- a/drivers/net/wireless/intel/iwlwifi/fw/api/scan.h
+++ b/drivers/net/wireless/intel/iwlwifi/fw/api/scan.h
@@ -8,6 +8,7 @@
  * Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved.
  * Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH
  * Copyright(c) 2016 - 2017 Intel Deutschland GmbH
+ * Copyright(c) 2018        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
@@ -30,7 +31,7 @@
  * Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved.
  * Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH
  * Copyright(c) 2016 - 2017 Intel Deutschland GmbH
- * Copyright(c) 2018 Intel Corporation
+ * Copyright(c) 2018        Intel Corporation
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -749,13 +750,9 @@ struct iwl_scan_req_umac {
 } __packed;
 
 #define IWL_SCAN_REQ_UMAC_SIZE_V8 sizeof(struct iwl_scan_req_umac)
-#define IWL_SCAN_REQ_UMAC_SIZE_V7 (sizeof(struct iwl_scan_req_umac) - \
-					 4 * sizeof(u8))
-#define IWL_SCAN_REQ_UMAC_SIZE_V6 (sizeof(struct iwl_scan_req_umac) - \
-				   2 * sizeof(u8) - sizeof(__le16))
-#define IWL_SCAN_REQ_UMAC_SIZE_V1 (sizeof(struct iwl_scan_req_umac) - \
-				   2 * sizeof(__le32) - 2 * sizeof(u8) - \
-				   sizeof(__le16))
+#define IWL_SCAN_REQ_UMAC_SIZE_V7 48
+#define IWL_SCAN_REQ_UMAC_SIZE_V6 44
+#define IWL_SCAN_REQ_UMAC_SIZE_V1 36
 
 /**
  * struct iwl_umac_scan_abort
-- 
2.17.0

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

* Re: [PATCH] iwlwifi: mvm: fix old scan version sizes
  2018-04-23 13:01 [PATCH] iwlwifi: mvm: fix old scan version sizes Luca Coelho
@ 2018-04-23 13:10 ` Kalle Valo
  2018-04-23 13:30   ` Luca Coelho
  2018-04-24 10:13 ` Kalle Valo
  1 sibling, 1 reply; 4+ messages in thread
From: Kalle Valo @ 2018-04-23 13:10 UTC (permalink / raw)
  To: Luca Coelho; +Cc: linux-wireless, mika.westerberg, Luca Coelho

Luca Coelho <luca@coelho.fi> writes:

> From: Luca Coelho <luciano.coelho@intel.com>
>
> When version 8 of the scan command API was introduced, only the size
> of version 7 was updated, causing older versions of the firmware to
> throw BAD_COMMAND errors.
>
> Calculating the old version based on the size of the latest version
> got too complicated and the size of the older versions will never
> change anyway, so it's better to just hardcoded the sizes.
>
> Fixes: 66fa2424df16 ("iwlwifi: fw api: support the new scan request FW API version")
> Reported-by: Scott Register <sreg@sreg.io>
> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>

I guess this is for 4.17? Should I apply this directly? I'm hoping to
send a pull request today or tomorrow.

-- 
Kalle Valo

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

* Re: [PATCH] iwlwifi: mvm: fix old scan version sizes
  2018-04-23 13:10 ` Kalle Valo
@ 2018-04-23 13:30   ` Luca Coelho
  0 siblings, 0 replies; 4+ messages in thread
From: Luca Coelho @ 2018-04-23 13:30 UTC (permalink / raw)
  To: Kalle Valo; +Cc: linux-wireless, mika.westerberg

On Mon, 2018-04-23 at 16:10 +0300, Kalle Valo wrote:
> Luca Coelho <luca@coelho.fi> writes:
> 
> > From: Luca Coelho <luciano.coelho@intel.com>
> > 
> > When version 8 of the scan command API was introduced, only the
> > size
> > of version 7 was updated, causing older versions of the firmware to
> > throw BAD_COMMAND errors.
> > 
> > Calculating the old version based on the size of the latest version
> > got too complicated and the size of the older versions will never
> > change anyway, so it's better to just hardcoded the sizes.
> > 
> > Fixes: 66fa2424df16 ("iwlwifi: fw api: support the new scan request
> > FW API version")
> > Reported-by: Scott Register <sreg@sreg.io>
> > Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
> 
> I guess this is for 4.17? Should I apply this directly? I'm hoping to
> send a pull request today or tomorrow.

Yes, please do if you're sending a pull request today or tomorrow.

I sent it out by itself to sync with you about it.  I'll only send a
pull req for v.4.17 on Friday or so.

Thanks, Kalle!

--
Cheers,
Luca.

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

* Re: iwlwifi: mvm: fix old scan version sizes
  2018-04-23 13:01 [PATCH] iwlwifi: mvm: fix old scan version sizes Luca Coelho
  2018-04-23 13:10 ` Kalle Valo
@ 2018-04-24 10:13 ` Kalle Valo
  1 sibling, 0 replies; 4+ messages in thread
From: Kalle Valo @ 2018-04-24 10:13 UTC (permalink / raw)
  To: Luciano Coelho; +Cc: linux-wireless, mika.westerberg, Luca Coelho

Luciano Coelho <luca@coelho.fi> wrote:

> From: Luca Coelho <luciano.coelho@intel.com>
> 
> When version 8 of the scan command API was introduced, only the size
> of version 7 was updated, causing older versions of the firmware to
> throw BAD_COMMAND errors.
> 
> Calculating the old version based on the size of the latest version
> got too complicated and the size of the older versions will never
> change anyway, so it's better to just hardcoded the sizes.
> 
> Fixes: 66fa2424df16 ("iwlwifi: fw api: support the new scan request FW API version")
> Reported-by: Scott Register <sreg@sreg.io>
> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>

Patch applied to wireless-drivers.git, thanks.

a083429e133d iwlwifi: mvm: fix old scan version sizes

-- 
https://patchwork.kernel.org/patch/10356987/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches

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

end of thread, other threads:[~2018-04-24 10:13 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-04-23 13:01 [PATCH] iwlwifi: mvm: fix old scan version sizes Luca Coelho
2018-04-23 13:10 ` Kalle Valo
2018-04-23 13:30   ` Luca Coelho
2018-04-24 10:13 ` Kalle Valo

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.