From patchwork Thu Aug 4 18:53:15 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Larry Finger X-Patchwork-Id: 1036692 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter2.kernel.org (8.14.4/8.14.4) with ESMTP id p74J0RV0012931 for ; Thu, 4 Aug 2011 19:00:28 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754843Ab1HDSxR (ORCPT ); Thu, 4 Aug 2011 14:53:17 -0400 Received: from hrndva-omtalb.mail.rr.com ([71.74.56.122]:38629 "EHLO hrndva-omtalb.mail.rr.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754779Ab1HDSxR (ORCPT ); Thu, 4 Aug 2011 14:53:17 -0400 X-Authority-Analysis: v=1.1 cv=s3eDhkhcaTLnj7IEXy8aaXUiY7FbET0mf+/2Xe0elbc= c=1 sm=0 a=3rvgeqzMqd0A:10 a=Q8Pfa2ASUooA:10 a=Zx2FLkwYMp0A:10 a=kj9zAlcOel0A:10 a=mpMdnlmFKti1S5SNY1DT+A==:17 a=yQdBAQUQAAAA:8 a=bUU3dy_Jc20fzCqqqeYA:9 a=2enOJTj8Eo4QJ66XKssA:7 a=CjuIK1q_8ugA:10 a=IcxpeKGZWnEA:10 a=mpMdnlmFKti1S5SNY1DT+A==:117 X-Cloudmark-Score: 0 X-Originating-IP: 65.28.92.85 Received: from [65.28.92.85] ([65.28.92.85:48198] helo=larrylap.lan) by hrndva-oedge01.mail.rr.com (envelope-from ) (ecelerity 2.2.3.46 r()) with ESMTP id EE/A3-02568-B9AEA3E4; Thu, 04 Aug 2011 18:53:16 +0000 Date: Thu, 04 Aug 2011 13:53:15 -0500 From: Larry Finger To: John W Linville Cc: linux-wireless@vger.kernel.org Subject: [RFC] rtlwifi: Fix build failures due to raw port access Message-ID: <4e3aea9b.T53ak5bZ1r+a9cJM%Larry.Finger@lwfinger.net> User-Agent: Heirloom mailx 12.2 01/07/07 MIME-Version: 1.0 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter2.kernel.org [140.211.167.43]); Thu, 04 Aug 2011 19:00:29 +0000 (UTC) When rtlwifi is built for the sh4 architecture, build errors of the following type occur. As these raw port accesses are specific to the X86 architecture, their usage is restricted and dummy routines are substituted for all other platforms. v3.0/sh4/sh-allmodconfig v3.0/sh4/sh-allyesconfig src/drivers/net/wireless/rtlwifi/rtl8192c/../pci.h:290: error: implicit declaration of function 'outl': 4 errors in 2 logs v3.0/sh4/sh-allmodconfig v3.0/sh4/sh-allyesconfig src/drivers/net/wireless/rtlwifi/rtl8192c/../pci.h:295: error: implicit declaration of function 'outb': 4 errors in 2 logs v3.0/sh4/sh-allmodconfig v3.0/sh4/sh-allyesconfig src/drivers/net/wireless/rtlwifi/rtl8192c/../pci.h:300: error: implicit declaration of function 'inb': 4 errors in 2 logs v3.0/sh4/sh-allmodconfig v3.0/sh4/sh-allyesconfig src/drivers/net/wireless/rtlwifi/rtl8192c/../pci.h:305: error: implicit declaration of function 'inw': 4 errors in 2 logs Signed-off-by: Larry Finger --- -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Index: wireless-testing-new/drivers/net/wireless/rtlwifi/pci.h =================================================================== --- wireless-testing-new.orig/drivers/net/wireless/rtlwifi/pci.h +++ wireless-testing-new/drivers/net/wireless/rtlwifi/pci.h @@ -273,6 +273,7 @@ static inline void pci_write32_async(str writel(val, (u8 __iomem *) rtlpriv->io.pci_mem_start + addr); } +#ifdef CONFIG_X86 static inline void rtl_pci_raw_write_port_ulong(u32 port, u32 val) { outl(val, port); @@ -288,14 +289,29 @@ static inline void rtl_pci_raw_read_port *pval = inb(port); } -static inline void rtl_pci_raw_read_port_ushort(u32 port, u16 *pval) +static inline void rtl_pci_raw_read_port_ulong(u32 port, u32 *pval) +{ + *pval = inl(port); +} +#else +/* define dummy routines if not X86 architecture */ +static inline void rtl_pci_raw_write_port_ulong(u32 port, u32 val) +{ +} + +static inline void rtl_pci_raw_write_port_uchar(u32 port, u8 val) { - *pval = inw(port); +} + +static inline void rtl_pci_raw_read_port_uchar(u32 port, u8 *pval) +{ + *pval = 0; } static inline void rtl_pci_raw_read_port_ulong(u32 port, u32 *pval) { - *pval = inl(port); + *pval = 0; } +#endif /* ifdef CONFIG_X86 */ #endif