* [PATCH] wlcore: avoid using NET_IP_ALIGN for RX alignment
@ 2012-06-11 14:59 Eyal Shapira
2012-06-13 19:04 ` Luciano Coelho
0 siblings, 1 reply; 2+ messages in thread
From: Eyal Shapira @ 2012-06-11 14:59 UTC (permalink / raw)
To: Luciano Coelho; +Cc: linux-wireless
NET_IP_ALIGN can be overriden on different architectures
and therefore cannot be used in the RX path to account
for the 2 bytes added for alignment (either by the FW
in the case of 18xx or by the host for 12xx).
Instead use an internal define.
Signed-off-by: Eyal Shapira <eyal@wizery.com>
---
drivers/net/wireless/ti/wlcore/rx.c | 4 ++--
drivers/net/wireless/ti/wlcore/rx.h | 6 ++++++
2 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/drivers/net/wireless/ti/wlcore/rx.c b/drivers/net/wireless/ti/wlcore/rx.c
index 78200dc..a1db4e0 100644
--- a/drivers/net/wireless/ti/wlcore/rx.c
+++ b/drivers/net/wireless/ti/wlcore/rx.c
@@ -127,7 +127,7 @@ static int wl1271_rx_handle_data(struct wl1271 *wl, u8 *data, u32 length,
}
if (rx_align == WLCORE_RX_BUF_UNALIGNED)
- reserved = NET_IP_ALIGN;
+ reserved = RX_BUF_ALIGN;
/* the data read starts with the descriptor */
desc = (struct wl1271_rx_descriptor *) data;
@@ -175,7 +175,7 @@ static int wl1271_rx_handle_data(struct wl1271 *wl, u8 *data, u32 length,
*/
memcpy(buf, data + sizeof(*desc), pkt_data_len);
if (rx_align == WLCORE_RX_BUF_PADDED)
- skb_pull(skb, NET_IP_ALIGN);
+ skb_pull(skb, RX_BUF_ALIGN);
*hlid = desc->hlid;
diff --git a/drivers/net/wireless/ti/wlcore/rx.h b/drivers/net/wireless/ti/wlcore/rx.h
index 9be7801..4324a42 100644
--- a/drivers/net/wireless/ti/wlcore/rx.h
+++ b/drivers/net/wireless/ti/wlcore/rx.h
@@ -103,6 +103,12 @@
/* If set, the buffer was padded by the FW to be 4 bytes aligned */
#define RX_BUF_PADDED_PAYLOAD BIT(30)
+/*
+ * Account for the padding inserted by the FW in case of RX_ALIGNMENT
+ * or for fixing alignment in case the packet wasn't aligned.
+ */
+#define RX_BUF_ALIGN 2
+
/* Describes the alignment state of a Rx buffer */
enum wl_rx_buf_align {
WLCORE_RX_BUF_ALIGNED,
--
1.7.4.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] wlcore: avoid using NET_IP_ALIGN for RX alignment
2012-06-11 14:59 [PATCH] wlcore: avoid using NET_IP_ALIGN for RX alignment Eyal Shapira
@ 2012-06-13 19:04 ` Luciano Coelho
0 siblings, 0 replies; 2+ messages in thread
From: Luciano Coelho @ 2012-06-13 19:04 UTC (permalink / raw)
To: Eyal Shapira; +Cc: linux-wireless
On Mon, 2012-06-11 at 17:59 +0300, Eyal Shapira wrote:
> NET_IP_ALIGN can be overriden on different architectures
> and therefore cannot be used in the RX path to account
> for the 2 bytes added for alignment (either by the FW
> in the case of 18xx or by the host for 12xx).
> Instead use an internal define.
>
> Signed-off-by: Eyal Shapira <eyal@wizery.com>
> ---
Applied and pushed, thanks!
--
Luca.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2012-06-13 19:04 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-06-11 14:59 [PATCH] wlcore: avoid using NET_IP_ALIGN for RX alignment Eyal Shapira
2012-06-13 19:04 ` Luciano Coelho
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.