Dzień dobry, jestem katie, czy możemy porozmawiać?

2018-07-16 Thread KATIE HIGGINS




Re: [RFC v2 1/4] mac80211: Add TXQ scheduling API

2018-07-16 Thread Rajkumar Manoharan

On 2018-07-13 06:39, Toke Høiland-Jørgensen wrote:

Rajkumar Manoharan  writes:


[...]


Hmm... I thought driver will call ieee80211_schedule_txq when it runs
out of hardware descriptor and break the loop. The serving txq will be
added back to head of activeq list. no?


Yes, and then the next one will be serviced... It's basically:

while (!hwq_is_full()) {
 txq = next_txq():
 build_one_aggr(txq); // may or may not succeed
 if (!empty(txq))
   schedule_txq(txq);
}

It is not generally predictable how many times this will loop before
exiting...

Agree.. It would be better If the driver does not worry about txq 
sequence

numbering. Perhaps one more API (ieee80211_first_txq) could solve this.
Will leave it to you.



ieee80211_txq_get_depth
  - return deficit status along with frm_cnt

ieee80211_reorder_txq
  - if txq deficit > 0
- return;
  - if txq is last
 - return
  - delete txq from list
  - move it to tail
  - update deficit by quantum

ath10k_htt_rx_tx_fetch_ind
  - get txq deficit status
  - if txq deficit > 0
- dequeue skb
  - else if deficit < 0
- return NULL

Please share your thoughts.


Hmm, not sure exactly how this would work; seems a little 
complicated?

Also, I'd rather if drivers were completely oblivious to the deficit;
that is a bit of an implementation detail...


Agree.. Initially I thought of adding deficit check in
ieee80211_tx_dequeue.
But It will be overhead of taking activeq_lock for every skbs. Perhaps
it can be renamed as allowed_to_dequeue instead of deficit.


We could have an ieee80211_txq_may_pull(); or maybe just have
ieee80211_tx_dequeue() return NULL if the deficit is negative?


As I said earlier, checking deficit for every skb will be an overhead.
It should be done once before accessing txq.


Well, it could conceivably be done in a way that doesn't require taking
the activeq_lock. Adding another STOP flag to the TXQ, for instance.
From an API point of view I think that is more consistent with what we
have already...



Make sense. ieee80211_txq_may_pull would be better place to decide 
whether
given txq is allowed for transmission. It also makes drivers do not have 
to

worry about deficit. Still I may need ieee80211_reorder_txq API after
processing txq. isn't it?


the reasonable thing for the driver to do, then, would be to ask
ieee80211_next_txq() for another TXQ to pull from if the current one
doesn't work for whatever reason.

Would that work for push-pull mode?


Not really. Driver shouldn't send other txq data instead of asked one.


I didn't necessarily mean immediately. As long as it does it 
eventually.

If a TXQ's deficit runs negative, that TXQ will not be allowed to send
again until its deficit has been restored to positive through enough
cycles of the loop in next_txq().



Thats true. Are you suggesting to run the loop until the txq deficit 
becomes

positive?


In MU-MIMO, firmware will query N packets from given set of {STA,TID}.
So the driver not supposed to send other txq's data.


Hmm, it'll actually be interesting to see how the airtime fairness
scheduler interacts with MU-MIMO. I'm not quite sure that it'll be in a
good way; the DRR scheduler generally only restores one TXQ to positive
deficit at a time, so it may be that MU-MIMO will break completely and
we'll have to come up with another scheduling algorithm.



In push-pull method, driver reports to firmware that number of frames
queued for each tid per station by wake_tx_queue. Later firmware will 
query
N frames from each TID and after dequeue driver will update remaining 
frames
for that tid. In ATF case, when driver is not able to dequeue frames, 
driver
will simply update remaining frames. The consecutive fetch_ind get 
opportunity
to dequeue the frames. By This way, transmission for serving client will 
be paused

for a while and opportunity will be given to others.

-Rajkumar


IBSS timeouts

2018-07-16 Thread James Prestwood
Hello,

I am a developer for IWD and trying to implement IBSS networks. The
initial IBSS_JOIN, 4-way, and setting the keys all works and I am able
to connect two stations. The problem is that I am hitting a timeout in
the kernel once the connection has succeeded and there are no more
frames flowing between stations. I dug around in the kernel and saw
there is a 60 second inactivity timeout which is precicely what is
happening. After setting the keys 60 seconds go by and I recieve a
DEL_STATION (log attached).

My question is: is this timeout expected after the station has been
added and the keys are set? If so how does one reset this timeout so
the connection can remain alive even if no data is being sent?
heartbeat of some kind?

The log attached was obtained with iwmon, which is a utility included
in IWD that monitors NL traffic.

Thanks,
James< Request: Set Interface (0x06) len 16 [ack]  1531765291.397958
Interface Index: 2 (0x0002)
Interface Type: 1 (0x0001)
> Response: Set Interface (0x06) len 4 [0x100]1531765291.397968
Status: Success (0)
< Request: Join IBSS (0x2b) len 80 [ack]  1531765291.420343
Interface Index: 2 (0x0002)
SSID: len 6
6d 79 73 73 69 64myssid  
Wiphy Frequency: 2437 (0x0985)
Wiphy Channel Type: 0 (0x)
Control Port: true
Privacy: true
Interface Socket Owner: true
Information Elements: len 20
RSN:
Group Data Cipher Suite: len 4
Group traffic not allowed (00:0f:ac) suite  07
Pairwise Cipher Suite: len 4
CCMP (00:0f:ac) suite  04
AKM Suite: len 4
PSK; RSNA PSK (00:0f:ac) suite  02
01 00 00 0f ac 07 01 00 00 0f ac 04 01 00 00 0f  
ac 02..  
Beacon Interval: 100 (0x0064)
> Response: Join IBSS (0x2b) len 4 [0x100]1531765291.420363
Status: Success (0)
< Request: Get Scan (0x20) len 8 [ack,0x300]  1531765293.386648
Interface Index: 2 (0x0002)
> Complete: Get Scan (0x20) len 4 [multi] 1531765293.390015
Status: 0
> Event: Join IBSS (0x2b) len 28  1531765299.243604
Wiphy: 0 (0x)
Interface Index: 2 (0x0002)
MAC Address 52:1A:93:B9:3E:D4
> Event: New Station (0x13) len 321531765299.593053
Interface Index: 2 (0x0002)
MAC Address 6C:71:D9:0D:6E:4B
Generation: 5 (0x0005)
Station Info: len 0
> Event: Join IBSS (0x2b) len 28  1531765299.593167
Wiphy: 0 (0x)
Interface Index: 2 (0x0002)
MAC Address C6:4B:95:D4:B4:42
< PAE: len 121 0.593374
Interface Index: 2
EAPoL: len 121
02 03 00 75 02 00 8a 00 10 00 00 00 00 00 00 00  ...u
01 7c 23 78 f9 41 20 1e 3c b6 65 29 77 71 d6 a5  .|#x.A .<.e)wq..
29 97 6e 88 a1 9c 90 55 b9 c3 a6 94 8f 89 27 cb  ).nU..'.
d6 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  
00 00 16 dd 14 00 0f ac 04 84 74 54 87 67 e0 7c  ..tT.g.|
e0 03 17 77 ed e4 b4 e1 32   ...w2   
Protocol Version: 2 (802.1X-2004)
Type: 3 (Key)
Length: 117
Descriptor Type: 2
Key MIC: false
Secure: false
Error: false
Request: false
Encrypted Key Data: false
SMK Message: false
Key Descriptor Version: 2 (02)
Key Type: true
Install: false
Key ACK: true
Key Length: 16
Key Replay Counter: 1
Key NONCE
7c 23 78 f9 41 20 1e 3c b6 65 29 77 71 d6 a5 29  |#x.A .<.e)wq..)
97 6e 88 a1 9c 90 55 b9 c3 a6 94 8f 89 27 cb d6  .nU..'..
Key IV
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  
Key RSC 
00 00 00 00 00 00 00 00  
Key MIC Data
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  
Key Data: len 22
Vendor specific: len 20
IEEE 802.11 (00:0f:ac) type: 04
00 0f ac 04 84 74 54 87 67 e0 7c e0 03 17 77 ed  
.tT.g.|...w.
e4 b4 e1 32  ...2   
 
> PAE: len 121 0.613642
Interface Index: 2
EAPoL: len 121
02 03 00 75 02 00 8a 00 10 00 00 00 00 00 00 00  ...u
01 33 2b b2 1f 7e 42 78 73 83 ae 9e 5c 4d 49 20  .3+..~Bxs...\MI 
c7 32 87 87 a0 60 90 6a 96 6a d3 ba 16 d5 c

Re: [PATCH] wireless/lib80211: Convert from ahash to shash

2018-07-16 Thread Eric Biggers
On Sun, Jul 15, 2018 at 08:52:26PM -0700, Kees Cook wrote:
> In preparing to remove all stack VLA usage from the kernel[1], this
> removes the discouraged use of AHASH_REQUEST_ON_STACK in favor of
> the smaller SHASH_DESC_ON_STACK by converting from ahash-wrapped-shash
> to direct shash. The stack allocation will be made a fixed size in a
> later patch to the crypto subsystem.
> 
> [1] 
> https://lkml.kernel.org/r/CA+55aFzCG-zNmZwX4A2FQpadafLfEzK6CC=qpxydaacu1rq...@mail.gmail.com
> 
> Signed-off-by: Kees Cook 
> ---
>  net/wireless/lib80211_crypt_tkip.c | 55 --
>  1 file changed, 30 insertions(+), 25 deletions(-)
> 
> diff --git a/net/wireless/lib80211_crypt_tkip.c 
> b/net/wireless/lib80211_crypt_tkip.c
> index ba0a1f398ce5..e6bce1f130c9 100644
> --- a/net/wireless/lib80211_crypt_tkip.c
> +++ b/net/wireless/lib80211_crypt_tkip.c
> @@ -65,9 +65,9 @@ struct lib80211_tkip_data {
>   int key_idx;
>  
>   struct crypto_skcipher *rx_tfm_arc4;
> - struct crypto_ahash *rx_tfm_michael;
> + struct crypto_shash *rx_tfm_michael;
>   struct crypto_skcipher *tx_tfm_arc4;
> - struct crypto_ahash *tx_tfm_michael;
> + struct crypto_shash *tx_tfm_michael;
>  
>   /* scratch buffers for virt_to_page() (crypto API) */
>   u8 rx_hdr[16], tx_hdr[16];
> @@ -106,8 +106,7 @@ static void *lib80211_tkip_init(int key_idx)
>   goto fail;
>   }
>  
> - priv->tx_tfm_michael = crypto_alloc_ahash("michael_mic", 0,
> -   CRYPTO_ALG_ASYNC);
> + priv->tx_tfm_michael = crypto_alloc_shash("michael_mic", 0, 0);
>   if (IS_ERR(priv->tx_tfm_michael)) {
>   priv->tx_tfm_michael = NULL;
>   goto fail;
> @@ -120,8 +119,7 @@ static void *lib80211_tkip_init(int key_idx)
>   goto fail;
>   }
>  
> - priv->rx_tfm_michael = crypto_alloc_ahash("michael_mic", 0,
> -   CRYPTO_ALG_ASYNC);
> + priv->rx_tfm_michael = crypto_alloc_shash("michael_mic", 0, 0);
>   if (IS_ERR(priv->rx_tfm_michael)) {
>   priv->rx_tfm_michael = NULL;
>   goto fail;
> @@ -131,9 +129,9 @@ static void *lib80211_tkip_init(int key_idx)
>  
>fail:
>   if (priv) {
> - crypto_free_ahash(priv->tx_tfm_michael);
> + crypto_free_shash(priv->tx_tfm_michael);
>   crypto_free_skcipher(priv->tx_tfm_arc4);
> - crypto_free_ahash(priv->rx_tfm_michael);
> + crypto_free_shash(priv->rx_tfm_michael);
>   crypto_free_skcipher(priv->rx_tfm_arc4);
>   kfree(priv);
>   }
> @@ -145,9 +143,9 @@ static void lib80211_tkip_deinit(void *priv)
>  {
>   struct lib80211_tkip_data *_priv = priv;
>   if (_priv) {
> - crypto_free_ahash(_priv->tx_tfm_michael);
> + crypto_free_shash(_priv->tx_tfm_michael);
>   crypto_free_skcipher(_priv->tx_tfm_arc4);
> - crypto_free_ahash(_priv->rx_tfm_michael);
> + crypto_free_shash(_priv->rx_tfm_michael);
>   crypto_free_skcipher(_priv->rx_tfm_arc4);
>   }
>   kfree(priv);
> @@ -510,29 +508,36 @@ static int lib80211_tkip_decrypt(struct sk_buff *skb, 
> int hdr_len, void *priv)
>   return keyidx;
>  }
>  
> -static int michael_mic(struct crypto_ahash *tfm_michael, u8 * key, u8 * hdr,
> -u8 * data, size_t data_len, u8 * mic)
> +static int michael_mic(struct crypto_shash *tfm_michael, u8 *key, u8 *hdr,
> +u8 *data, size_t data_len, u8 *mic)
>  {
> - AHASH_REQUEST_ON_STACK(req, tfm_michael);
> - struct scatterlist sg[2];
> + SHASH_DESC_ON_STACK(desc, tfm_michael);
>   int err;
>  
>   if (tfm_michael == NULL) {
>   pr_warn("%s(): tfm_michael == NULL\n", __func__);
>   return -1;
>   }

This NULL check is pointless, since 'tfm_michael' is already dereferenced by the
previous AHASH_REQUEST_ON_STACK() or SHASH_DESC_ON_STACK().

> - sg_init_table(sg, 2);
> - sg_set_buf(&sg[0], hdr, 16);
> - sg_set_buf(&sg[1], data, data_len);
>  
> - if (crypto_ahash_setkey(tfm_michael, key, 8))
> + desc->tfm = tfm_michael;
> + desc->flags = 0;
> +
> + if (crypto_shash_setkey(tfm_michael, key, 8))
>   return -1;
>  
> - ahash_request_set_tfm(req, tfm_michael);
> - ahash_request_set_callback(req, 0, NULL, NULL);
> - ahash_request_set_crypt(req, sg, mic, data_len + 16);
> - err = crypto_ahash_digest(req);
> - ahash_request_zero(req);
> + err = crypto_shash_init(desc);
> + if (err)
> + goto out;
> + err = crypto_shash_update(desc, hdr, 16);
> + if (err)
> + goto out;
> + err = crypto_shash_update(desc, data, data_len);
> + if (err)
> + goto out;
> + err = crypto_shash_final(desc, mic);
> +
> +out:
> + shash_desc_zero(desc);
>   return err;
>  }
>  
> @@ -65

[PATCH 1/6] rsi: remove redundant device ids

2018-07-16 Thread Siva Rebbagondla
From: Siva Rebbagondla 

Removing redundant device id's from both usb and sdio idtables, as rsi
driver currently supporting only one module(RS9113). Also, replaced ids
with specific defines.

Signed-off-by: Siva Rebbagondla 
---
 drivers/net/wireless/rsi/rsi_91x_sdio.c | 5 +
 drivers/net/wireless/rsi/rsi_91x_usb.c  | 6 +-
 drivers/net/wireless/rsi/rsi_sdio.h | 3 +++
 drivers/net/wireless/rsi/rsi_usb.h  | 3 +++
 4 files changed, 8 insertions(+), 9 deletions(-)

diff --git a/drivers/net/wireless/rsi/rsi_91x_sdio.c 
b/drivers/net/wireless/rsi/rsi_91x_sdio.c
index 416981d..5733e44 100644
--- a/drivers/net/wireless/rsi/rsi_91x_sdio.c
+++ b/drivers/net/wireless/rsi/rsi_91x_sdio.c
@@ -1394,10 +1394,7 @@ static const struct dev_pm_ops rsi_pm_ops = {
 #endif
 
 static const struct sdio_device_id rsi_dev_table[] =  {
-   { SDIO_DEVICE(0x303, 0x100) },
-   { SDIO_DEVICE(0x041B, 0x0301) },
-   { SDIO_DEVICE(0x041B, 0x0201) },
-   { SDIO_DEVICE(0x041B, 0x9330) },
+   { SDIO_DEVICE(RSI_SDIO_VID_9113, RSI_SDIO_PID_9113) },
{ /* Blank */},
 };
 
diff --git a/drivers/net/wireless/rsi/rsi_91x_usb.c 
b/drivers/net/wireless/rsi/rsi_91x_usb.c
index 6ce6b75..c0a163e 100644
--- a/drivers/net/wireless/rsi/rsi_91x_usb.c
+++ b/drivers/net/wireless/rsi/rsi_91x_usb.c
@@ -835,11 +835,7 @@ static int rsi_resume(struct usb_interface *intf)
 #endif
 
 static const struct usb_device_id rsi_dev_table[] = {
-   { USB_DEVICE(0x0303, 0x0100) },
-   { USB_DEVICE(0x041B, 0x0301) },
-   { USB_DEVICE(0x041B, 0x0201) },
-   { USB_DEVICE(0x041B, 0x9330) },
-   { USB_DEVICE(0x1618, 0x9113) },
+   { USB_DEVICE(RSI_USB_VID_9113, RSI_USB_PID_9113) },
{ /* Blank */},
 };
 
diff --git a/drivers/net/wireless/rsi/rsi_sdio.h 
b/drivers/net/wireless/rsi/rsi_sdio.h
index 353dbdf..66dcd2e 100644
--- a/drivers/net/wireless/rsi/rsi_sdio.h
+++ b/drivers/net/wireless/rsi/rsi_sdio.h
@@ -28,6 +28,9 @@
 #include 
 #include "rsi_main.h"
 
+#define RSI_SDIO_VID_91130x041B
+#define RSI_SDIO_PID_91130x9330
+
 enum sdio_interrupt_type {
BUFFER_FULL = 0x0,
BUFFER_AVAILABLE= 0x2,
diff --git a/drivers/net/wireless/rsi/rsi_usb.h 
b/drivers/net/wireless/rsi/rsi_usb.h
index b6fe79f..5b2eddd 100644
--- a/drivers/net/wireless/rsi/rsi_usb.h
+++ b/drivers/net/wireless/rsi/rsi_usb.h
@@ -22,6 +22,9 @@
 #include "rsi_main.h"
 #include "rsi_common.h"
 
+#define RSI_USB_VID_9113   0x1618
+#define RSI_USB_PID_9113   0x9113
+
 #define USB_INTERNAL_REG_1   0x25000
 #define RSI_USB_READY_MAGIC_NUM  0xab
 #define FW_STATUS_REG0x41050012
-- 
2.5.5



[PATCH 4/6] rsi: Correct RSI_NEEDED_HEADROOM in mac80211_attach.

2018-07-16 Thread Siva Rebbagondla
From: Amol Hanwate 

Currently, RSI_NEEDED_HEADROOM is '80' for rsi driver, which is wrong.
As per rsi internal frame format, the RSI_NEEDED_HEADROOM shall be '84',
which is 64(dword_align) + 4(extended_desc) + 16(frame_desc).
Hence, corrected the needed headroom.

Signed-off-by: Amol Hanwate 
Signed-off-by: Siva Rebbagondla 
---
 drivers/net/wireless/rsi/rsi_mgmt.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/wireless/rsi/rsi_mgmt.h 
b/drivers/net/wireless/rsi/rsi_mgmt.h
index 1462093..359fbdf 100644
--- a/drivers/net/wireless/rsi/rsi_mgmt.h
+++ b/drivers/net/wireless/rsi/rsi_mgmt.h
@@ -22,7 +22,7 @@
 #include "rsi_main.h"
 
 #define MAX_MGMT_PKT_SIZE   512
-#define RSI_NEEDED_HEADROOM 80
+#define RSI_NEEDED_HEADROOM 84
 #define RSI_RCV_BUFFER_LEN  2000
 
 #define RSI_11B_MODE0
-- 
2.5.5



[PATCH 6/6] rsi: move init_done flag to end of rsi_91x_init().

2018-07-16 Thread Siva Rebbagondla
From: Amol Hanwate 

common->init_done flag should set after basic initialization. Hence,
moving init_done flag at end of rsi_91x_init().

Signed-off-by: Amol Hanwate 
Signed-off-by: Siva Rebbagondla 
---
 drivers/net/wireless/rsi/rsi_91x_main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/wireless/rsi/rsi_91x_main.c 
b/drivers/net/wireless/rsi/rsi_91x_main.c
index 34a5d9c..01d99ed 100644
--- a/drivers/net/wireless/rsi/rsi_91x_main.c
+++ b/drivers/net/wireless/rsi/rsi_91x_main.c
@@ -331,7 +331,6 @@ struct rsi_hw *rsi_91x_init(u16 oper_mode)
spin_lock_init(&adapter->ps_lock);
timer_setup(&common->roc_timer, rsi_roc_timeout, 0);
init_completion(&common->wlan_init_completion);
-   common->init_done = true;
adapter->device_model = RSI_DEV_9113;
common->oper_mode = oper_mode;
 
@@ -369,6 +368,7 @@ struct rsi_hw *rsi_91x_init(u16 oper_mode)
}
 #endif
 
+   common->init_done = true;
return adapter;
 
 err:
-- 
2.5.5



[PATCH 2/6] rsi: remove redundant flash_content variable

2018-07-16 Thread Siva Rebbagondla
From: Siva Rebbagondla 

while cleaning up the driver, observed that flash_content pointer is not
necessary in rsi_load_firmware(). Instead of this, driver can use
'fw_entry->data' directly.Hence, removed redundant flash_content pointer.

Signed-off-by: Siva Rebbagondla 
---
 drivers/net/wireless/rsi/rsi_91x_hal.c | 23 +++
 1 file changed, 7 insertions(+), 16 deletions(-)

diff --git a/drivers/net/wireless/rsi/rsi_91x_hal.c 
b/drivers/net/wireless/rsi/rsi_91x_hal.c
index 533d9e9..150c3e6 100644
--- a/drivers/net/wireless/rsi/rsi_91x_hal.c
+++ b/drivers/net/wireless/rsi/rsi_91x_hal.c
@@ -842,7 +842,6 @@ static int rsi_load_firmware(struct rsi_hw *adapter)
const struct firmware *fw_entry = NULL;
u32 regout_val = 0, content_size;
u16 tmp_regout_val = 0;
-   u8 *flash_content = NULL;
struct ta_metadata *metadata_p;
int status;
 
@@ -904,28 +903,22 @@ static int rsi_load_firmware(struct rsi_hw *adapter)
__func__, metadata_p->name);
return status;
}
-   flash_content = kmemdup(fw_entry->data, fw_entry->size, GFP_KERNEL);
-   if (!flash_content) {
-   rsi_dbg(ERR_ZONE, "%s: Failed to copy firmware\n", __func__);
-   status = -EIO;
-   goto fail;
-   }
content_size = fw_entry->size;
rsi_dbg(INFO_ZONE, "FW Length = %d bytes\n", content_size);
 
/* Get the firmware version */
common->lmac_ver.ver.info.fw_ver[0] =
-   flash_content[LMAC_VER_OFFSET] & 0xFF;
+   fw_entry->data[LMAC_VER_OFFSET] & 0xFF;
common->lmac_ver.ver.info.fw_ver[1] =
-   flash_content[LMAC_VER_OFFSET + 1] & 0xFF;
-   common->lmac_ver.major = flash_content[LMAC_VER_OFFSET + 2] & 0xFF;
+   fw_entry->data[LMAC_VER_OFFSET + 1] & 0xFF;
+   common->lmac_ver.major = fw_entry->data[LMAC_VER_OFFSET + 2] & 0xFF;
common->lmac_ver.release_num =
-   flash_content[LMAC_VER_OFFSET + 3] & 0xFF;
-   common->lmac_ver.minor = flash_content[LMAC_VER_OFFSET + 4] & 0xFF;
+   fw_entry->data[LMAC_VER_OFFSET + 3] & 0xFF;
+   common->lmac_ver.minor = fw_entry->data[LMAC_VER_OFFSET + 4] & 0xFF;
common->lmac_ver.patch_num = 0;
rsi_print_version(common);
 
-   status = bl_write_header(adapter, flash_content, content_size);
+   status = bl_write_header(adapter, (u8 *)fw_entry->data, content_size);
if (status) {
rsi_dbg(ERR_ZONE,
"%s: RPS Image header loading failed\n",
@@ -967,7 +960,7 @@ static int rsi_load_firmware(struct rsi_hw *adapter)
 
rsi_dbg(INFO_ZONE, "Burn Command Pass.. Upgrading the firmware\n");
 
-   status = auto_fw_upgrade(adapter, flash_content, content_size);
+   status = auto_fw_upgrade(adapter, (u8 *)fw_entry->data, content_size);
if (status == 0) {
rsi_dbg(ERR_ZONE, "Firmware upgradation Done\n");
goto load_image_cmd;
@@ -981,13 +974,11 @@ static int rsi_load_firmware(struct rsi_hw *adapter)
 
 success:
rsi_dbg(ERR_ZONE, "* Firmware Loading successful *\n");
-   kfree(flash_content);
release_firmware(fw_entry);
return 0;
 
 fail:
rsi_dbg(ERR_ZONE, "# Firmware loading failed #\n");
-   kfree(flash_content);
release_firmware(fw_entry);
return status;
 }
-- 
2.5.5



[PATCH 0/6] rsi: miscellaneous driver cleanups

2018-07-16 Thread Siva Rebbagondla
From: Siva Rebbagondla 

This patch set consists some miscellaneous driver cleanups for
Redpine wlan driver.

Amol Hanwate (3):
  rsi: Correct RSI_NEEDED_HEADROOM in mac80211_attach.
  rsi: fill rx_params only once.
  rsi: move init_done flag to end of rsi_91x_init().

Siva Rebbagondla (3):
  rsi: remove redundant device ids
  rsi: remove redundant flash_content variable
  rsi: add firmware support for AP+BT dual mode

 drivers/net/wireless/rsi/rsi_91x_hal.c  | 26 ++
 drivers/net/wireless/rsi/rsi_91x_main.c |  7 +--
 drivers/net/wireless/rsi/rsi_91x_sdio.c |  5 +
 drivers/net/wireless/rsi/rsi_91x_usb.c  |  6 +-
 drivers/net/wireless/rsi/rsi_mgmt.h |  2 +-
 drivers/net/wireless/rsi/rsi_sdio.h |  3 +++
 drivers/net/wireless/rsi/rsi_usb.h  |  3 +++
 7 files changed, 20 insertions(+), 32 deletions(-)

-- 
2.5.5



[PATCH 3/6] rsi: add firmware support for AP+BT dual mode

2018-07-16 Thread Siva Rebbagondla
From: Siva Rebbagondla 

Currently, AP mode will work on only WLAN alone firmware. To give support
for AP and BT dual mode, adding firmware entry in 'struct ta_metadata'.
The firmware entry is based on what coex_mode is used in driver and coex
mode '4' for all AP+BT related functionalities. Hence, added the same.

Signed-off-by: Siva Rebbagondla 
---
 drivers/net/wireless/rsi/rsi_91x_hal.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/net/wireless/rsi/rsi_91x_hal.c 
b/drivers/net/wireless/rsi/rsi_91x_hal.c
index 150c3e6..27e6baf 100644
--- a/drivers/net/wireless/rsi/rsi_91x_hal.c
+++ b/drivers/net/wireless/rsi/rsi_91x_hal.c
@@ -26,6 +26,9 @@ static struct ta_metadata metadata_flash_content[] = {
{"flash_content", 0x0001},
{"rsi/rs9113_wlan_qspi.rps", 0x0001},
{"rsi/rs9113_wlan_bt_dual_mode.rps", 0x0001},
+   {"flash_content", 0x0001},
+   {"rsi/rs9113_ap_bt_dual_mode.rps", 0x0001},
+
 };
 
 int rsi_send_pkt_to_bus(struct rsi_common *common, struct sk_buff *skb)
-- 
2.5.5



[PATCH 5/6] rsi: fill rx_params only once.

2018-07-16 Thread Siva Rebbagondla
From: Amol Hanwate 

rx_params are getting updated two times in driver, which is not required.
Hence, removing duplicate updation of rx_params from rsi_prepare_skb().

Signed-off-by: Amol Hanwate 
Signed-off-by: Siva Rebbagondla 
---
 drivers/net/wireless/rsi/rsi_91x_main.c | 5 -
 1 file changed, 5 deletions(-)

diff --git a/drivers/net/wireless/rsi/rsi_91x_main.c 
b/drivers/net/wireless/rsi/rsi_91x_main.c
index 1485a0c..34a5d9c 100644
--- a/drivers/net/wireless/rsi/rsi_91x_main.c
+++ b/drivers/net/wireless/rsi/rsi_91x_main.c
@@ -122,7 +122,6 @@ static struct sk_buff *rsi_prepare_skb(struct rsi_common 
*common,
   u8 extended_desc)
 {
struct ieee80211_tx_info *info;
-   struct skb_info *rx_params;
struct sk_buff *skb = NULL;
u8 payload_offset;
struct ieee80211_vif *vif;
@@ -149,10 +148,6 @@ static struct sk_buff *rsi_prepare_skb(struct rsi_common 
*common,
vif = rsi_get_vif(common->priv, wh->addr1);
 
info = IEEE80211_SKB_CB(skb);
-   rx_params = (struct skb_info *)info->driver_data;
-   rx_params->rssi = rsi_get_rssi(buffer);
-   rx_params->channel = rsi_get_connected_channel(vif);
-
return skb;
 }
 
-- 
2.5.5