lkml.org 
[lkml]   [2023]   [Aug]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] Fix encoding of ethernet frame length for big endian platforms in QCA7000/7005 protocol header.
Date
From: Kornel Swierzy <kornel.swierzy@embevity.com>

QCA7000 protocol requires that ethernet frame length is encoded
as u16 little endian value. Current implementation does not work
on big endian architectures.

Signed-off-by: Kornel Swierzy <kornel.swierzy@embevity.com>
---
drivers/net/ethernet/qualcomm/qca_7k_common.c | 8 ++------
1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/drivers/net/ethernet/qualcomm/qca_7k_common.c b/drivers/net/ethernet/qualcomm/qca_7k_common.c
index 6b511f05df61..7bb7ae85fcf7 100644
--- a/drivers/net/ethernet/qualcomm/qca_7k_common.c
+++ b/drivers/net/ethernet/qualcomm/qca_7k_common.c
@@ -30,19 +30,15 @@
u16
qcafrm_create_header(u8 *buf, u16 length)
{
- __le16 len;
-
if (!buf)
return 0;

- len = cpu_to_le16(length);
-
buf[0] = 0xAA;
buf[1] = 0xAA;
buf[2] = 0xAA;
buf[3] = 0xAA;
- buf[4] = len & 0xff;
- buf[5] = (len >> 8) & 0xff;
+ buf[4] = length & 0xff;
+ buf[5] = (length >> 8) & 0xff;
buf[6] = 0;
buf[7] = 0;

--
2.25.1
\
 
 \ /
  Last update: 2023-08-22 09:01    [W:0.041 / U:0.228 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site