mirror of https://gitee.com/openkylin/linux.git
staging: vt6655: replace typedef struct tagRDES0
with struct vnt_rdes0 replacing members as follows wResCount -> res_count f15Reserved -> f15_reserved f1Owner -> owner big endian f8Reserved1 -> f8_reserved1 f7Reserved -> f7_reserved Narrowing endian differences to inside structure. Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
e48c9c2601
commit
de1c1862ca
|
@ -573,16 +573,16 @@ CARDvSafeResetRx(
|
|||
/* init state, all RD is chip's */
|
||||
for (uu = 0; uu < pDevice->sOpts.nRxDescs0; uu++) {
|
||||
pDesc = &(pDevice->aRD0Ring[uu]);
|
||||
pDesc->m_rd0RD0.wResCount = cpu_to_le16(pDevice->rx_buf_sz);
|
||||
pDesc->m_rd0RD0.f1Owner = OWNED_BY_NIC;
|
||||
pDesc->rd0.res_count = cpu_to_le16(pDevice->rx_buf_sz);
|
||||
pDesc->rd0.owner = OWNED_BY_NIC;
|
||||
pDesc->m_rd1RD1.wReqCount = cpu_to_le16(pDevice->rx_buf_sz);
|
||||
}
|
||||
|
||||
/* init state, all RD is chip's */
|
||||
for (uu = 0; uu < pDevice->sOpts.nRxDescs1; uu++) {
|
||||
pDesc = &(pDevice->aRD1Ring[uu]);
|
||||
pDesc->m_rd0RD0.wResCount = cpu_to_le16(pDevice->rx_buf_sz);
|
||||
pDesc->m_rd0RD0.f1Owner = OWNED_BY_NIC;
|
||||
pDesc->rd0.res_count = cpu_to_le16(pDevice->rx_buf_sz);
|
||||
pDesc->rd0.owner = OWNED_BY_NIC;
|
||||
pDesc->m_rd1RD1.wReqCount = cpu_to_le16(pDevice->rx_buf_sz);
|
||||
}
|
||||
|
||||
|
|
|
@ -172,31 +172,22 @@ typedef struct tagDEVICE_RD_INFO {
|
|||
dma_addr_t skb_dma;
|
||||
} DEVICE_RD_INFO, *PDEVICE_RD_INFO;
|
||||
|
||||
struct vnt_rdes0 {
|
||||
volatile __le16 res_count;
|
||||
#ifdef __BIG_ENDIAN
|
||||
|
||||
typedef struct tagRDES0 {
|
||||
volatile __le16 wResCount;
|
||||
union {
|
||||
volatile u16 f15Reserved;
|
||||
volatile u16 f15_reserved;
|
||||
struct {
|
||||
volatile u8 f8Reserved1;
|
||||
volatile u8 f1Owner:1;
|
||||
volatile u8 f7Reserved:7;
|
||||
} __attribute__ ((__packed__));
|
||||
} __attribute__ ((__packed__));
|
||||
} __attribute__ ((__packed__))
|
||||
SRDES0, *PSRDES0;
|
||||
|
||||
volatile u8 f8_reserved1;
|
||||
volatile u8 owner:1;
|
||||
volatile u8 f7_reserved:7;
|
||||
} __packed;
|
||||
} __packed;
|
||||
#else
|
||||
|
||||
typedef struct tagRDES0 {
|
||||
__le16 wResCount;
|
||||
unsigned short f15Reserved:15;
|
||||
unsigned short f1Owner:1;
|
||||
} __attribute__ ((__packed__))
|
||||
SRDES0;
|
||||
|
||||
u16 f15_reserved:15;
|
||||
u16 owner:1;
|
||||
#endif
|
||||
} __packed;
|
||||
|
||||
typedef struct tagRDES1 {
|
||||
__le16 wReqCount;
|
||||
|
@ -206,7 +197,7 @@ SRDES1;
|
|||
|
||||
/* Rx descriptor*/
|
||||
typedef struct tagSRxDesc {
|
||||
volatile SRDES0 m_rd0RD0;
|
||||
volatile struct vnt_rdes0 rd0;
|
||||
volatile SRDES1 m_rd1RD1;
|
||||
volatile __le32 buff_addr;
|
||||
volatile __le32 next_desc;
|
||||
|
|
|
@ -778,7 +778,7 @@ static int device_rx_srv(struct vnt_private *pDevice, unsigned int uIdx)
|
|||
int works = 0;
|
||||
|
||||
for (pRD = pDevice->pCurrRD[uIdx];
|
||||
pRD->m_rd0RD0.f1Owner == OWNED_BY_HOST;
|
||||
pRD->rd0.owner == OWNED_BY_HOST;
|
||||
pRD = pRD->next) {
|
||||
if (works++ > 15)
|
||||
break;
|
||||
|
@ -793,7 +793,7 @@ static int device_rx_srv(struct vnt_private *pDevice, unsigned int uIdx)
|
|||
break;
|
||||
}
|
||||
}
|
||||
pRD->m_rd0RD0.f1Owner = OWNED_BY_NIC;
|
||||
pRD->rd0.owner = OWNED_BY_NIC;
|
||||
}
|
||||
|
||||
pDevice->pCurrRD[uIdx] = pRD;
|
||||
|
@ -814,10 +814,10 @@ static bool device_alloc_rx_buf(struct vnt_private *pDevice, PSRxDesc pRD)
|
|||
skb_put(pRDInfo->skb, skb_tailroom(pRDInfo->skb)),
|
||||
pDevice->rx_buf_sz, DMA_FROM_DEVICE);
|
||||
|
||||
*((unsigned int *)&(pRD->m_rd0RD0)) = 0; /* FIX cast */
|
||||
*((unsigned int *)&pRD->rd0) = 0; /* FIX cast */
|
||||
|
||||
pRD->m_rd0RD0.wResCount = cpu_to_le16(pDevice->rx_buf_sz);
|
||||
pRD->m_rd0RD0.f1Owner = OWNED_BY_NIC;
|
||||
pRD->rd0.res_count = cpu_to_le16(pDevice->rx_buf_sz);
|
||||
pRD->rd0.owner = OWNED_BY_NIC;
|
||||
pRD->m_rd1RD1.wReqCount = cpu_to_le16(pDevice->rx_buf_sz);
|
||||
pRD->buff_addr = cpu_to_le32(pRDInfo->skb_dma);
|
||||
|
||||
|
|
|
@ -144,7 +144,7 @@ bool vnt_receive_frame(struct vnt_private *priv, PSRxDesc curr_rd)
|
|||
priv->rx_buf_sz, DMA_FROM_DEVICE);
|
||||
|
||||
frame_size = le16_to_cpu(curr_rd->m_rd1RD1.wReqCount)
|
||||
- le16_to_cpu(curr_rd->m_rd0RD0.wResCount);
|
||||
- le16_to_cpu(curr_rd->rd0.res_count);
|
||||
|
||||
if ((frame_size > 2364) || (frame_size < 33)) {
|
||||
/* Frame Size error drop this packet.*/
|
||||
|
|
Loading…
Reference in New Issue