mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-06 08:46:46 +00:00
staging: vt6655: Fix wReqCount to __le16
Should be __le16 and do and correct endian conversion. Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
f1e3e92135
commit
7135d9a76f
3 changed files with 8 additions and 8 deletions
|
@ -573,17 +573,17 @@ CARDvSafeResetRx(
|
||||||
/* init state, all RD is chip's */
|
/* init state, all RD is chip's */
|
||||||
for (uu = 0; uu < pDevice->sOpts.nRxDescs0; uu++) {
|
for (uu = 0; uu < pDevice->sOpts.nRxDescs0; uu++) {
|
||||||
pDesc = &(pDevice->aRD0Ring[uu]);
|
pDesc = &(pDevice->aRD0Ring[uu]);
|
||||||
pDesc->m_rd0RD0.wResCount = (unsigned short)(pDevice->rx_buf_sz);
|
pDesc->m_rd0RD0.wResCount = cpu_to_le16(pDevice->rx_buf_sz);
|
||||||
pDesc->m_rd0RD0.f1Owner = OWNED_BY_NIC;
|
pDesc->m_rd0RD0.f1Owner = OWNED_BY_NIC;
|
||||||
pDesc->m_rd1RD1.wReqCount = (unsigned short)(pDevice->rx_buf_sz);
|
pDesc->m_rd1RD1.wReqCount = cpu_to_le16(pDevice->rx_buf_sz);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* init state, all RD is chip's */
|
/* init state, all RD is chip's */
|
||||||
for (uu = 0; uu < pDevice->sOpts.nRxDescs1; uu++) {
|
for (uu = 0; uu < pDevice->sOpts.nRxDescs1; uu++) {
|
||||||
pDesc = &(pDevice->aRD1Ring[uu]);
|
pDesc = &(pDevice->aRD1Ring[uu]);
|
||||||
pDesc->m_rd0RD0.wResCount = (unsigned short)(pDevice->rx_buf_sz);
|
pDesc->m_rd0RD0.wResCount = cpu_to_le16(pDevice->rx_buf_sz);
|
||||||
pDesc->m_rd0RD0.f1Owner = OWNED_BY_NIC;
|
pDesc->m_rd0RD0.f1Owner = OWNED_BY_NIC;
|
||||||
pDesc->m_rd1RD1.wReqCount = (unsigned short)(pDevice->rx_buf_sz);
|
pDesc->m_rd1RD1.wReqCount = cpu_to_le16(pDevice->rx_buf_sz);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* set perPkt mode */
|
/* set perPkt mode */
|
||||||
|
|
|
@ -175,7 +175,7 @@ typedef struct tagDEVICE_RD_INFO {
|
||||||
#ifdef __BIG_ENDIAN
|
#ifdef __BIG_ENDIAN
|
||||||
|
|
||||||
typedef struct tagRDES0 {
|
typedef struct tagRDES0 {
|
||||||
volatile unsigned short wResCount;
|
volatile __le16 wResCount;
|
||||||
union {
|
union {
|
||||||
volatile u16 f15Reserved;
|
volatile u16 f15Reserved;
|
||||||
struct {
|
struct {
|
||||||
|
@ -190,7 +190,7 @@ SRDES0, *PSRDES0;
|
||||||
#else
|
#else
|
||||||
|
|
||||||
typedef struct tagRDES0 {
|
typedef struct tagRDES0 {
|
||||||
unsigned short wResCount;
|
__le16 wResCount;
|
||||||
unsigned short f15Reserved:15;
|
unsigned short f15Reserved:15;
|
||||||
unsigned short f1Owner:1;
|
unsigned short f1Owner:1;
|
||||||
} __attribute__ ((__packed__))
|
} __attribute__ ((__packed__))
|
||||||
|
@ -199,7 +199,7 @@ SRDES0;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
typedef struct tagRDES1 {
|
typedef struct tagRDES1 {
|
||||||
unsigned short wReqCount;
|
__le16 wReqCount;
|
||||||
unsigned short wReserved;
|
unsigned short wReserved;
|
||||||
} __attribute__ ((__packed__))
|
} __attribute__ ((__packed__))
|
||||||
SRDES1;
|
SRDES1;
|
||||||
|
|
|
@ -144,7 +144,7 @@ bool vnt_receive_frame(struct vnt_private *priv, PSRxDesc curr_rd)
|
||||||
priv->rx_buf_sz, DMA_FROM_DEVICE);
|
priv->rx_buf_sz, DMA_FROM_DEVICE);
|
||||||
|
|
||||||
frame_size = le16_to_cpu(curr_rd->m_rd1RD1.wReqCount)
|
frame_size = le16_to_cpu(curr_rd->m_rd1RD1.wReqCount)
|
||||||
- cpu_to_le16(curr_rd->m_rd0RD0.wResCount);
|
- le16_to_cpu(curr_rd->m_rd0RD0.wResCount);
|
||||||
|
|
||||||
if ((frame_size > 2364) || (frame_size < 33)) {
|
if ((frame_size > 2364) || (frame_size < 33)) {
|
||||||
/* Frame Size error drop this packet.*/
|
/* Frame Size error drop this packet.*/
|
||||||
|
|
Loading…
Reference in a new issue