From patchwork Sun Mar 6 12:57:03 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Malcolm Priestley X-Patchwork-Id: 8513281 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: X-Original-To: patchwork-linux-wireless@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 315FC9F46A for ; Sun, 6 Mar 2016 12:57:38 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 1474020172 for ; Sun, 6 Mar 2016 12:57:37 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id E9466201B4 for ; Sun, 6 Mar 2016 12:57:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751560AbcCFM5f (ORCPT ); Sun, 6 Mar 2016 07:57:35 -0500 Received: from mail-wm0-f67.google.com ([74.125.82.67]:32809 "EHLO mail-wm0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751419AbcCFM53 (ORCPT ); Sun, 6 Mar 2016 07:57:29 -0500 Received: by mail-wm0-f67.google.com with SMTP id n186so6302450wmn.0 for ; Sun, 06 Mar 2016 04:57:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=CZaJzwEZddcTCaDQf8GX+jEgI/kcJJNm4sqKZFF3Ut4=; b=Xj1vQtS6+/ROdSZ0EElWLKvFFIY+xS5/uCYfKeksyzbDMwdSCN1isSC6WSbb/WOdBy Sw7Jal0XAZ3j7n4wVhQOgQLlGLIXEMpKGlxwtkTiKNZNOAEfj5MY962Pg85XN/97o8Pc DdUCryicnsEqoxKYp1JEs6yNGTojdxJGiD5I2dzr0sRu4/A7WUhlb+31fGAO6wi1Wyol py22lpoT+Nx9L1PlUD0aApcxuHjSNHu1f62uhl2Fi6WTFCrajTAntApPDQxX7NA+0aim jRlRhfBNxAIBsP3xV+BPvj2gWpuqvgFmNfCxOajUrliQeeB68EXtzYkG++Z4pvytSDUe JSlA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=CZaJzwEZddcTCaDQf8GX+jEgI/kcJJNm4sqKZFF3Ut4=; b=V2NiCU2SBlyVHqmLMeGpipNI2nosLB41tVInUf4mYJvm87BkcBGPvNh6MejAMoT15o D5ZLny/CIgXCSsWxdD82JatrgciHVnEoo6dJ+yUZ8pP++TXB7QRVW+POuuyrbglvAZpU I6e+WDH2TSDHiSRtG/FUc+5ZS/U+hiMjPcjnVdVyaELHN2KO6m9HMkOnxjy0OTVkpky7 d7ygWi2+v11J2M4OjhYX5dpZaHBQ68aE7/A3yXJU/CkMTse/pItAAWCk5QJwyOFu4c59 7mJsvGfDE7YRS7+MeraNYP93hVaY1UyM8z3secRhq2KJWgiLOEq/6ZGOG4EZY8Th2jnu Swjg== X-Gm-Message-State: AD7BkJJP5wOPm7aVo62D56nEYse6Lox6P4qgtDY/cZue/WBGyHJ9e6uiRlZVT1ALjm+R+Q== X-Received: by 10.28.57.68 with SMTP id g65mr8209816wma.56.1457269048308; Sun, 06 Mar 2016 04:57:28 -0800 (PST) Received: from tipsey.3.home (188.30.137.64.threembb.co.uk. [188.30.137.64]) by smtp.gmail.com with ESMTPSA id n10sm12839950wjf.28.2016.03.06.04.57.27 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 06 Mar 2016 04:57:27 -0800 (PST) From: Malcolm Priestley To: gregkh@linuxfoundation.org Cc: linux-wireless@vger.kernel.org, Malcolm Priestley Subject: [PATCH 04/13] staging: vt6655: mac.c replace VNSvOutPortD with iowrite32. Date: Sun, 6 Mar 2016 12:57:03 +0000 Message-Id: <1457269032-2681-4-git-send-email-tvboxspy@gmail.com> X-Mailer: git-send-email 2.7.0 In-Reply-To: <1457269032-2681-1-git-send-email-tvboxspy@gmail.com> References: <1457269032-2681-1-git-send-email-tvboxspy@gmail.com> 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, RP_MATCHES_RCVD, T_DKIM_INVALID, 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 Removing the macro from functions. Signed-off-by: Malcolm Priestley --- drivers/staging/vt6655/mac.c | 52 +++++++++++++++++++++----------------------- 1 file changed, 25 insertions(+), 27 deletions(-) diff --git a/drivers/staging/vt6655/mac.c b/drivers/staging/vt6655/mac.c index c2723c1..a9ddb95 100644 --- a/drivers/staging/vt6655/mac.c +++ b/drivers/staging/vt6655/mac.c @@ -263,18 +263,16 @@ void MACvRestoreContext(struct vnt_private *priv, unsigned char *cxt_buf) MAC_REG_BBREGCTL - MAC_REG_PSCFG); /* restore CURR_RX_DESC_ADDR, CURR_TX_DESC_ADDR */ - VNSvOutPortD(io_base + MAC_REG_TXDMAPTR0, - *(u32 *)(cxt_buf + MAC_REG_TXDMAPTR0)); - VNSvOutPortD(io_base + MAC_REG_AC0DMAPTR, - *(u32 *)(cxt_buf + MAC_REG_AC0DMAPTR)); - VNSvOutPortD(io_base + MAC_REG_BCNDMAPTR, - *(u32 *)(cxt_buf + MAC_REG_BCNDMAPTR)); - - VNSvOutPortD(io_base + MAC_REG_RXDMAPTR0, - *(u32 *)(cxt_buf + MAC_REG_RXDMAPTR0)); - - VNSvOutPortD(io_base + MAC_REG_RXDMAPTR1, - *(u32 *)(cxt_buf + MAC_REG_RXDMAPTR1)); + iowrite32(*(u32 *)(cxt_buf + MAC_REG_TXDMAPTR0), + io_base + MAC_REG_TXDMAPTR0); + iowrite32(*(u32 *)(cxt_buf + MAC_REG_AC0DMAPTR), + io_base + MAC_REG_AC0DMAPTR); + iowrite32(*(u32 *)(cxt_buf + MAC_REG_BCNDMAPTR), + io_base + MAC_REG_BCNDMAPTR); + iowrite32(*(u32 *)(cxt_buf + MAC_REG_RXDMAPTR0), + io_base + MAC_REG_RXDMAPTR0); + iowrite32(*(u32 *)(cxt_buf + MAC_REG_RXDMAPTR1), + io_base + MAC_REG_RXDMAPTR1); } /* @@ -360,8 +358,8 @@ bool MACbSafeRxOff(struct vnt_private *priv) /* turn off wow temp for turn off Rx safely */ /* Clear RX DMA0,1 */ - VNSvOutPortD(io_base + MAC_REG_RXDMACTL0, DMACTL_CLRRUN); - VNSvOutPortD(io_base + MAC_REG_RXDMACTL1, DMACTL_CLRRUN); + iowrite32(DMACTL_CLRRUN, io_base + MAC_REG_RXDMACTL0); + iowrite32(DMACTL_CLRRUN, io_base + MAC_REG_RXDMACTL1); for (ww = 0; ww < W_MAX_TIMEOUT; ww++) { if (!(ioread32(io_base + MAC_REG_RXDMACTL0) & DMACTL_RUN)) break; @@ -413,9 +411,9 @@ bool MACbSafeTxOff(struct vnt_private *priv) /* Clear TX DMA */ /* Tx0 */ - VNSvOutPortD(io_base + MAC_REG_TXDMACTL0, DMACTL_CLRRUN); + iowrite32(DMACTL_CLRRUN, io_base + MAC_REG_TXDMACTL0); /* AC0 */ - VNSvOutPortD(io_base + MAC_REG_AC0DMACTL, DMACTL_CLRRUN); + iowrite32(DMACTL_CLRRUN, io_base + MAC_REG_AC0DMACTL); for (ww = 0; ww < W_MAX_TIMEOUT; ww++) { if (!(ioread32(io_base + MAC_REG_TXDMACTL0) & DMACTL_RUN)) @@ -572,7 +570,7 @@ void MACvSetCurrRx0DescAddr(struct vnt_private *priv, u32 dwCurrDescAddr) break; } - VNSvOutPortD(io_base + MAC_REG_RXDMAPTR0, dwCurrDescAddr); + iowrite32(dwCurrDescAddr, io_base + MAC_REG_RXDMAPTR0); if (byOrgDMACtl & DMACTL_RUN) VNSvOutPortB(io_base + MAC_REG_RXDMACTL0, DMACTL_RUN); } @@ -606,7 +604,7 @@ void MACvSetCurrRx1DescAddr(struct vnt_private *priv, u32 dwCurrDescAddr) break; } - VNSvOutPortD(io_base + MAC_REG_RXDMAPTR1, dwCurrDescAddr); + iowrite32(dwCurrDescAddr, io_base + MAC_REG_RXDMAPTR1); if (byOrgDMACtl & DMACTL_RUN) VNSvOutPortB(io_base + MAC_REG_RXDMACTL1, DMACTL_RUN); @@ -642,7 +640,7 @@ void MACvSetCurrTx0DescAddrEx(struct vnt_private *priv, break; } - VNSvOutPortD(io_base + MAC_REG_TXDMAPTR0, dwCurrDescAddr); + iowrite32(dwCurrDescAddr, io_base + MAC_REG_TXDMAPTR0); if (byOrgDMACtl & DMACTL_RUN) VNSvOutPortB(io_base + MAC_REG_TXDMACTL0, DMACTL_RUN); } @@ -679,7 +677,7 @@ void MACvSetCurrAC0DescAddrEx(struct vnt_private *priv, } if (ww == W_MAX_TIMEOUT) pr_debug(" DBG_PORT80(0x26)\n"); - VNSvOutPortD(io_base + MAC_REG_AC0DMAPTR, dwCurrDescAddr); + iowrite32(dwCurrDescAddr, io_base + MAC_REG_AC0DMAPTR); if (byOrgDMACtl & DMACTL_RUN) VNSvOutPortB(io_base + MAC_REG_AC0DMACTL, DMACTL_RUN); } @@ -714,7 +712,7 @@ void MACvTimer0MicroSDelay(struct vnt_private *priv, unsigned int uDelay) unsigned int uu, ii; VNSvOutPortB(io_base + MAC_REG_TMCTL0, 0); - VNSvOutPortD(io_base + MAC_REG_TMDATA0, uDelay); + iowrite32(uDelay, io_base + MAC_REG_TMDATA0); VNSvOutPortB(io_base + MAC_REG_TMCTL0, (TMCTL_TMD | TMCTL_TE)); for (ii = 0; ii < 66; ii++) { /* assume max PCI clock is 66Mhz */ for (uu = 0; uu < uDelay; uu++) { @@ -748,7 +746,7 @@ void MACvOneShotTimer1MicroSec(struct vnt_private *priv, unsigned int uDelayTime void __iomem *io_base = priv->PortOffset; VNSvOutPortB(io_base + MAC_REG_TMCTL1, 0); - VNSvOutPortD(io_base + MAC_REG_TMDATA1, uDelayTime); + iowrite32(uDelayTime, io_base + MAC_REG_TMDATA1); VNSvOutPortB(io_base + MAC_REG_TMCTL1, (TMCTL_TMD | TMCTL_TE)); } @@ -760,7 +758,7 @@ void MACvSetMISCFifo(struct vnt_private *priv, unsigned short wOffset, if (wOffset > 273) return; VNSvOutPortW(io_base + MAC_REG_MISCFFNDEX, wOffset); - VNSvOutPortD(io_base + MAC_REG_MISCFFDATA, dwData); + iowrite32(dwData, io_base + MAC_REG_MISCFFDATA); VNSvOutPortW(io_base + MAC_REG_MISCFFCTL, MISCFFCTL_WRITE); } @@ -829,7 +827,7 @@ void MACvSetKeyEntry(struct vnt_private *priv, unsigned short wKeyCtl, wOffset, dwData, wKeyCtl); VNSvOutPortW(io_base + MAC_REG_MISCFFNDEX, wOffset); - VNSvOutPortD(io_base + MAC_REG_MISCFFDATA, dwData); + iowrite32(dwData, io_base + MAC_REG_MISCFFDATA); VNSvOutPortW(io_base + MAC_REG_MISCFFCTL, MISCFFCTL_WRITE); wOffset++; @@ -844,7 +842,7 @@ void MACvSetKeyEntry(struct vnt_private *priv, unsigned short wKeyCtl, pr_debug("2. wOffset: %d, Data: %X\n", wOffset, dwData); VNSvOutPortW(io_base + MAC_REG_MISCFFNDEX, wOffset); - VNSvOutPortD(io_base + MAC_REG_MISCFFDATA, dwData); + iowrite32(dwData, io_base + MAC_REG_MISCFFDATA); VNSvOutPortW(io_base + MAC_REG_MISCFFCTL, MISCFFCTL_WRITE); wOffset++; @@ -854,7 +852,7 @@ void MACvSetKeyEntry(struct vnt_private *priv, unsigned short wKeyCtl, pr_debug("3.(%d) wOffset: %d, Data: %X\n", ii, wOffset+ii, *pdwKey); VNSvOutPortW(io_base + MAC_REG_MISCFFNDEX, wOffset+ii); - VNSvOutPortD(io_base + MAC_REG_MISCFFDATA, *pdwKey++); + iowrite32(*pdwKey++, io_base + MAC_REG_MISCFFDATA); VNSvOutPortW(io_base + MAC_REG_MISCFFCTL, MISCFFCTL_WRITE); } } @@ -882,6 +880,6 @@ void MACvDisableKeyEntry(struct vnt_private *priv, unsigned int uEntryIdx) wOffset += (uEntryIdx * MISCFIFO_KEYENTRYSIZE); VNSvOutPortW(io_base + MAC_REG_MISCFFNDEX, wOffset); - VNSvOutPortD(io_base + MAC_REG_MISCFFDATA, 0); + iowrite32(0, io_base + MAC_REG_MISCFFDATA); VNSvOutPortW(io_base + MAC_REG_MISCFFCTL, MISCFFCTL_WRITE); }