Re: [PATCH 1/3] rsi: Rename the file rsi_91x_pkt.c to rsi_91x_hal.c

2017-05-11 Thread Kalle Valo
amit karwar  writes:

> On Tue, Apr 4, 2017 at 10:30 AM, Prameela Rani Garnepudi
>  wrote:
>> The file rsi_91x_hal.c will contain new firmware loading method for
>> RSI 9113 chipset. So this file will have device specific operations.
>> As the file 'rsi_91x_pkt.c' contains code for preparing device
>> (frimware understandable) specific descriptors for the transmit frames,
>> it is moved to 'rsi_91x_hal.c'
>>
>> Signed-off-by: Prameela Rani Garnepudi 

[...]

> Kindly ignore this patch series.
> We have split the work and submitted updated version.

Ok, dropped.

-- 
Kalle Valo


Re: [PATCH 1/3] rsi: Rename the file rsi_91x_pkt.c to rsi_91x_hal.c

2017-05-09 Thread amit karwar
Hi Kvalle,

On Tue, Apr 4, 2017 at 10:30 AM, Prameela Rani Garnepudi
 wrote:
> The file rsi_91x_hal.c will contain new firmware loading method for
> RSI 9113 chipset. So this file will have device specific operations.
> As the file 'rsi_91x_pkt.c' contains code for preparing device
> (frimware understandable) specific descriptors for the transmit frames,
> it is moved to 'rsi_91x_hal.c'
>
> Signed-off-by: Prameela Rani Garnepudi 
> ---
>  drivers/net/wireless/rsi/Makefile  |   2 +-
>  drivers/net/wireless/rsi/rsi_91x_hal.c | 215 
> +
>  drivers/net/wireless/rsi/rsi_91x_pkt.c | 215 
> -
>  3 files changed, 216 insertions(+), 216 deletions(-)
>  create mode 100644 drivers/net/wireless/rsi/rsi_91x_hal.c
>  delete mode 100644 drivers/net/wireless/rsi/rsi_91x_pkt.c
>
> diff --git a/drivers/net/wireless/rsi/Makefile 
> b/drivers/net/wireless/rsi/Makefile
> index 25828b6..a475c81 100644
> --- a/drivers/net/wireless/rsi/Makefile
> +++ b/drivers/net/wireless/rsi/Makefile
> @@ -2,7 +2,7 @@ rsi_91x-y   += rsi_91x_main.o
>  rsi_91x-y  += rsi_91x_core.o
>  rsi_91x-y  += rsi_91x_mac80211.o
>  rsi_91x-y  += rsi_91x_mgmt.o
> -rsi_91x-y  += rsi_91x_pkt.o
> +rsi_91x-y  += rsi_91x_hal.o
>  rsi_91x-$(CONFIG_RSI_DEBUGFS)  += rsi_91x_debugfs.o
>
>  rsi_usb-y  += rsi_91x_usb.o rsi_91x_usb_ops.o
> diff --git a/drivers/net/wireless/rsi/rsi_91x_hal.c 
> b/drivers/net/wireless/rsi/rsi_91x_hal.c
> new file mode 100644
> index 000..02920c9
> --- /dev/null
> +++ b/drivers/net/wireless/rsi/rsi_91x_hal.c
> @@ -0,0 +1,215 @@
> +/**
> + * Copyright (c) 2014 Redpine Signals Inc.
> + *
> + * Permission to use, copy, modify, and/or distribute this software for any
> + * purpose with or without fee is hereby granted, provided that the above
> + * copyright notice and this permission notice appear in all copies.
> + *
> + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
> + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
> + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
> + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
> + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
> + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
> + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
> + */
> +
> +#include "rsi_mgmt.h"
> +
> +/**
> + * rsi_send_data_pkt() - This function sends the recieved data packet from
> + *  driver to device.
> + * @common: Pointer to the driver private structure.
> + * @skb: Pointer to the socket buffer structure.
> + *
> + * Return: status: 0 on success, -1 on failure.
> + */
> +int rsi_send_data_pkt(struct rsi_common *common, struct sk_buff *skb)
> +{
> +   struct rsi_hw *adapter = common->priv;
> +   struct ieee80211_hdr *tmp_hdr;
> +   struct ieee80211_tx_info *info;
> +   struct skb_info *tx_params;
> +   struct ieee80211_bss_conf *bss;
> +   int status;
> +   u8 ieee80211_size = MIN_802_11_HDR_LEN;
> +   u8 extnd_size;
> +   __le16 *frame_desc;
> +   u16 seq_num;
> +
> +   info = IEEE80211_SKB_CB(skb);
> +   bss = >control.vif->bss_conf;
> +   tx_params = (struct skb_info *)info->driver_data;
> +
> +   if (!bss->assoc) {
> +   status = -EINVAL;
> +   goto err;
> +   }
> +
> +   tmp_hdr = (struct ieee80211_hdr *)>data[0];
> +   seq_num = (le16_to_cpu(tmp_hdr->seq_ctrl) >> 4);
> +
> +   extnd_size = ((uintptr_t)skb->data & 0x3);
> +
> +   if ((FRAME_DESC_SZ + extnd_size) > skb_headroom(skb)) {
> +   rsi_dbg(ERR_ZONE, "%s: Unable to send pkt\n", __func__);
> +   status = -ENOSPC;
> +   goto err;
> +   }
> +
> +   skb_push(skb, (FRAME_DESC_SZ + extnd_size));
> +   frame_desc = (__le16 *)>data[0];
> +   memset((u8 *)frame_desc, 0, FRAME_DESC_SZ);
> +
> +   if (ieee80211_is_data_qos(tmp_hdr->frame_control)) {
> +   ieee80211_size += 2;
> +   frame_desc[6] |= cpu_to_le16(BIT(12));
> +   }
> +
> +   if ((!(info->flags & IEEE80211_TX_INTFL_DONT_ENCRYPT)) &&
> +   (common->secinfo.security_enable)) {
> +   if (rsi_is_cipher_wep(common))
> +   ieee80211_size += 4;
> +   else
> +   ieee80211_size += 8;
> +   frame_desc[6] |= cpu_to_le16(BIT(15));
> +   }
> +
> +   frame_desc[0] = cpu_to_le16((skb->len - FRAME_DESC_SZ) |
> +   (RSI_WIFI_DATA_Q << 12));
> +   frame_desc[2] = cpu_to_le16((extnd_size) | (ieee80211_size) << 8);
> +
> +   if (common->min_rate != 0x) {
> +  

Re: [PATCH 1/3] rsi: Rename the file rsi_91x_pkt.c to rsi_91x_hal.c

2017-04-05 Thread Kalle Valo
Prameela Rani Garnepudi  writes:

> The file rsi_91x_hal.c will contain new firmware loading method for
> RSI 9113 chipset. So this file will have device specific operations.
> As the file 'rsi_91x_pkt.c' contains code for preparing device
> (frimware understandable) specific descriptors for the transmit frames,
> it is moved to 'rsi_91x_hal.c'
>
> Signed-off-by: Prameela Rani Garnepudi 

If you send a new version of the patchset mark it as "[PATCH v2]". Also
I don't see a changelog anywhere, what has changed since the version you
posted last December?

Please read:

https://kernelnewbies.org/FirstKernelPatch#head-5c81b3c517a1d0bbc24f92594cb734e155fcbbcb

-- 
Kalle Valo


[PATCH 1/3] rsi: Rename the file rsi_91x_pkt.c to rsi_91x_hal.c

2017-04-03 Thread Prameela Rani Garnepudi
The file rsi_91x_hal.c will contain new firmware loading method for
RSI 9113 chipset. So this file will have device specific operations.
As the file 'rsi_91x_pkt.c' contains code for preparing device
(frimware understandable) specific descriptors for the transmit frames,
it is moved to 'rsi_91x_hal.c'

Signed-off-by: Prameela Rani Garnepudi 
---
 drivers/net/wireless/rsi/Makefile  |   2 +-
 drivers/net/wireless/rsi/rsi_91x_hal.c | 215 +
 drivers/net/wireless/rsi/rsi_91x_pkt.c | 215 -
 3 files changed, 216 insertions(+), 216 deletions(-)
 create mode 100644 drivers/net/wireless/rsi/rsi_91x_hal.c
 delete mode 100644 drivers/net/wireless/rsi/rsi_91x_pkt.c

diff --git a/drivers/net/wireless/rsi/Makefile 
b/drivers/net/wireless/rsi/Makefile
index 25828b6..a475c81 100644
--- a/drivers/net/wireless/rsi/Makefile
+++ b/drivers/net/wireless/rsi/Makefile
@@ -2,7 +2,7 @@ rsi_91x-y   += rsi_91x_main.o
 rsi_91x-y  += rsi_91x_core.o
 rsi_91x-y  += rsi_91x_mac80211.o
 rsi_91x-y  += rsi_91x_mgmt.o
-rsi_91x-y  += rsi_91x_pkt.o
+rsi_91x-y  += rsi_91x_hal.o
 rsi_91x-$(CONFIG_RSI_DEBUGFS)  += rsi_91x_debugfs.o
 
 rsi_usb-y  += rsi_91x_usb.o rsi_91x_usb_ops.o
diff --git a/drivers/net/wireless/rsi/rsi_91x_hal.c 
b/drivers/net/wireless/rsi/rsi_91x_hal.c
new file mode 100644
index 000..02920c9
--- /dev/null
+++ b/drivers/net/wireless/rsi/rsi_91x_hal.c
@@ -0,0 +1,215 @@
+/**
+ * Copyright (c) 2014 Redpine Signals Inc.
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+#include "rsi_mgmt.h"
+
+/**
+ * rsi_send_data_pkt() - This function sends the recieved data packet from
+ *  driver to device.
+ * @common: Pointer to the driver private structure.
+ * @skb: Pointer to the socket buffer structure.
+ *
+ * Return: status: 0 on success, -1 on failure.
+ */
+int rsi_send_data_pkt(struct rsi_common *common, struct sk_buff *skb)
+{
+   struct rsi_hw *adapter = common->priv;
+   struct ieee80211_hdr *tmp_hdr;
+   struct ieee80211_tx_info *info;
+   struct skb_info *tx_params;
+   struct ieee80211_bss_conf *bss;
+   int status;
+   u8 ieee80211_size = MIN_802_11_HDR_LEN;
+   u8 extnd_size;
+   __le16 *frame_desc;
+   u16 seq_num;
+
+   info = IEEE80211_SKB_CB(skb);
+   bss = >control.vif->bss_conf;
+   tx_params = (struct skb_info *)info->driver_data;
+
+   if (!bss->assoc) {
+   status = -EINVAL;
+   goto err;
+   }
+
+   tmp_hdr = (struct ieee80211_hdr *)>data[0];
+   seq_num = (le16_to_cpu(tmp_hdr->seq_ctrl) >> 4);
+
+   extnd_size = ((uintptr_t)skb->data & 0x3);
+
+   if ((FRAME_DESC_SZ + extnd_size) > skb_headroom(skb)) {
+   rsi_dbg(ERR_ZONE, "%s: Unable to send pkt\n", __func__);
+   status = -ENOSPC;
+   goto err;
+   }
+
+   skb_push(skb, (FRAME_DESC_SZ + extnd_size));
+   frame_desc = (__le16 *)>data[0];
+   memset((u8 *)frame_desc, 0, FRAME_DESC_SZ);
+
+   if (ieee80211_is_data_qos(tmp_hdr->frame_control)) {
+   ieee80211_size += 2;
+   frame_desc[6] |= cpu_to_le16(BIT(12));
+   }
+
+   if ((!(info->flags & IEEE80211_TX_INTFL_DONT_ENCRYPT)) &&
+   (common->secinfo.security_enable)) {
+   if (rsi_is_cipher_wep(common))
+   ieee80211_size += 4;
+   else
+   ieee80211_size += 8;
+   frame_desc[6] |= cpu_to_le16(BIT(15));
+   }
+
+   frame_desc[0] = cpu_to_le16((skb->len - FRAME_DESC_SZ) |
+   (RSI_WIFI_DATA_Q << 12));
+   frame_desc[2] = cpu_to_le16((extnd_size) | (ieee80211_size) << 8);
+
+   if (common->min_rate != 0x) {
+   /* Send fixed rate */
+   frame_desc[3] = cpu_to_le16(RATE_INFO_ENABLE);
+   frame_desc[4] = cpu_to_le16(common->min_rate);
+
+   if (conf_is_ht40(>priv->hw->conf))
+   frame_desc[5] = cpu_to_le16(FULL40M_ENABLE);
+
+   if (common->vif_info[0].sgi) {
+  

Re: [PATCH 1/3] rsi: Rename the file rsi_91x_pkt.c to rsi_91x_hal.c

2017-04-03 Thread Kalle Valo
+ linux-wireless

Prameela Rani Garnepudi  writes:

> The file rsi_91x_hal.c will contain new firmware loading method for
> RSI 9113 chipset. So this file will have device specific operations.
> As the file 'rsi_91x_pkt.c' contains code for preparing device
> (frimware understandable) specific descriptors for the transmit frames,
> it is moved to 'rsi_91x_hal.c'
>
> Signed-off-by: Prameela Rani Garnepudi 

Always remember CC linux-wireless for wireless patches. So please
resend.

-- 
Kalle Valo