From patchwork Sat Aug 15 20:57:32 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Malcolm Priestley X-Patchwork-Id: 7021471 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: X-Original-To: patchwork-linux-wireless@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 02548C05AD for ; Sat, 15 Aug 2015 20:58:17 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id ED30D2052F for ; Sat, 15 Aug 2015 20:58:15 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id D0A0E20529 for ; Sat, 15 Aug 2015 20:58:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754491AbbHOU6H (ORCPT ); Sat, 15 Aug 2015 16:58:07 -0400 Received: from mail-wi0-f176.google.com ([209.85.212.176]:35180 "EHLO mail-wi0-f176.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752878AbbHOU6G (ORCPT ); Sat, 15 Aug 2015 16:58:06 -0400 Received: by wicne3 with SMTP id ne3so43528146wic.0 for ; Sat, 15 Aug 2015 13:58:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=PfGYUrffy554wT0Pb5q1+iY2IZrtRln9jmJUbMrUn0o=; b=RGWmEiinC4ZHrVyrX4AlECD7e4eTFpEkMoq9hABfkL425Op/mcPE5bWfAwkzLnnImS LLlgLdOBJv4Mu78LkNE4jVU7hDTC9aMUW/KtjRGvyF7Xgq3rJER07S2P5ExP628EJfTk 3ApQpzZziz16PtFR9NaMSmeZXP4E+D0RJHU8a30fZPiMcB90Kb41bEvhpMrMISGtcbqC 3fwDvf0PCiiNbA3H7jEWygkliMnkWeyBW2vnybb0XeQrYQuXdefbc1CgH9C2RyQ2byOk jfTSAVFi6kdWPKpl08f714oOqZrCuM1OyP54vbyF0+L/9FZlIknqMG4xLqDoNetf2J1u vO7g== X-Received: by 10.180.219.41 with SMTP id pl9mr19473606wic.30.1439672283950; Sat, 15 Aug 2015 13:58:03 -0700 (PDT) Received: from tipsey.3.home (188.31.160.140.threembb.co.uk. [188.31.160.140]) by smtp.gmail.com with ESMTPSA id jr5sm14438355wjc.14.2015.08.15.13.58.00 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 15 Aug 2015 13:58:03 -0700 (PDT) From: Malcolm Priestley To: gregkh@linuxfoundation.org Cc: linux-wireless@vger.kernel.org, Malcolm Priestley Subject: [PATCH 1/4] staging: vt6655: replace typedef struct tagRDES0 Date: Sat, 15 Aug 2015 21:57:32 +0100 Message-Id: <1439672255-2548-1-git-send-email-tvboxspy@gmail.com> X-Mailer: git-send-email 2.5.0 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 --- drivers/staging/vt6655/card.c | 8 ++++---- drivers/staging/vt6655/desc.h | 33 ++++++++++++--------------------- drivers/staging/vt6655/device_main.c | 10 +++++----- drivers/staging/vt6655/dpc.c | 2 +- 4 files changed, 22 insertions(+), 31 deletions(-) diff --git a/drivers/staging/vt6655/card.c b/drivers/staging/vt6655/card.c index c7b75df..ab632e0 100644 --- a/drivers/staging/vt6655/card.c +++ b/drivers/staging/vt6655/card.c @@ -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); } diff --git a/drivers/staging/vt6655/desc.h b/drivers/staging/vt6655/desc.h index 3c9007e..68b3121 100644 --- a/drivers/staging/vt6655/desc.h +++ b/drivers/staging/vt6655/desc.h @@ -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; diff --git a/drivers/staging/vt6655/device_main.c b/drivers/staging/vt6655/device_main.c index 0d8f123..37c2be2 100644 --- a/drivers/staging/vt6655/device_main.c +++ b/drivers/staging/vt6655/device_main.c @@ -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); diff --git a/drivers/staging/vt6655/dpc.c b/drivers/staging/vt6655/dpc.c index e14eed1..dbaaeeb 100644 --- a/drivers/staging/vt6655/dpc.c +++ b/drivers/staging/vt6655/dpc.c @@ -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.*/