All of lore.kernel.org
 help / color / mirror / Atom feed
From: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
To: "Greg Kroah-Hartman" <gregkh@suse.de>
Cc: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>,
	linux-kernel@vger.kernel.org
Subject: [PATCH 06/18] Staging: rtl8187se: remove CONFIG_RTL8180_IO_MAP ifdefs
Date: Sun, 28 Jun 2009 16:19:17 +0200	[thread overview]
Message-ID: <20090628141917.8761.45120.sendpatchset@localhost.localdomain> (raw)
In-Reply-To: <20090628141844.8761.8943.sendpatchset@localhost.localdomain>

From: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Subject: [PATCH] Staging: rtl8187se: remove CONFIG_RTL8180_IO_MAP ifdefs

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
---
 drivers/staging/rtl8187se/Makefile      |    1 
 drivers/staging/rtl8187se/r8180_core.c  |   83 ---------------
 drivers/staging/rtl8187se/r8185b_init.c |  168 --------------------------------
 3 files changed, 252 deletions(-)

Index: b/drivers/staging/rtl8187se/Makefile
===================================================================
--- a/drivers/staging/rtl8187se/Makefile
+++ b/drivers/staging/rtl8187se/Makefile
@@ -1,6 +1,5 @@
 
 #EXTRA_CFLAGS += -DCONFIG_IEEE80211_NOWEP=y
-#EXTRA_CFLAGS += -DCONFIG_RTL8180_IOMAP
 #EXTRA_CFLAGS += -std=gnu89
 #EXTRA_CFLAGS += -O2
 #CC            = gcc
Index: b/drivers/staging/rtl8187se/r8180_core.c
===================================================================
--- a/drivers/staging/rtl8187se/r8180_core.c
+++ b/drivers/staging/rtl8187se/r8180_core.c
@@ -59,7 +59,6 @@ double __extendsfdf2(float a) {return a;
 //#define DEBUG_RX
 //#define DEBUG_RX_SKB
 
-//#define CONFIG_RTL8180_IO_MAP
 #include <linux/syscalls.h>
 //#include <linux/fcntl.h>
 //#include <asm/uaccess.h>
@@ -78,8 +77,6 @@ double __extendsfdf2(float a) {return a;
 
 #include "ieee80211/dot11d.h"
 
-//#define CONFIG_RTL8180_IO_MAP
-
 #ifndef PCI_VENDOR_ID_BELKIN
 	#define PCI_VENDOR_ID_BELKIN 0x1799
 #endif
@@ -202,39 +199,6 @@ static struct pci_driver rtl8180_pci_dri
 
 
 
-#ifdef CONFIG_RTL8180_IO_MAP
-
-u8 read_nic_byte(struct net_device *dev, int x)
-{
-        return 0xff&inb(dev->base_addr +x);
-}
-
-u32 read_nic_dword(struct net_device *dev, int x)
-{
-        return inl(dev->base_addr +x);
-}
-
-u16 read_nic_word(struct net_device *dev, int x)
-{
-        return inw(dev->base_addr +x);
-}
-
-void write_nic_byte(struct net_device *dev, int x,u8 y)
-{
-        outb(y&0xff,dev->base_addr +x);
-}
-
-void write_nic_word(struct net_device *dev, int x,u16 y)
-{
-        outw(y,dev->base_addr +x);
-}
-
-void write_nic_dword(struct net_device *dev, int x,u32 y)
-{
-        outl(y,dev->base_addr +x);
-}
-
-#else /* RTL_IO_MAP */
 
 u8 read_nic_byte(struct net_device *dev, int x)
 {
@@ -269,7 +233,6 @@ void write_nic_word(struct net_device *d
 	udelay(20);
 }
 
-#endif /* RTL_IO_MAP */
 
 
 
@@ -278,9 +241,7 @@ void write_nic_word(struct net_device *d
 inline void force_pci_posting(struct net_device *dev)
 {
 	read_nic_byte(dev,EPROM_CMD);
-#ifndef CONFIG_RTL8180_IO_MAP
 	mb();
-#endif
 }
 
 
@@ -5411,11 +5372,7 @@ static int __devinit rtl8180_pci_probe(s
 	//u8 *ptr;
 	u8 unit = 0;
 
-#ifdef CONFIG_RTL8180_IO_MAP
-	unsigned long pio_start, pio_len, pio_flags;
-#else
 	unsigned long pmem_start, pmem_len, pmem_flags;
-#endif //end #ifdef RTL_IO_MAP
 
 	DMESG("Configuring chip resources");
 
@@ -5442,27 +5399,6 @@ static int __devinit rtl8180_pci_probe(s
 	priv->pdev=pdev;
 
 
-#ifdef CONFIG_RTL8180_IO_MAP
-
-	pio_start = (unsigned long)pci_resource_start (pdev, 0);
-	pio_len = (unsigned long)pci_resource_len (pdev, 0);
-	pio_flags = (unsigned long)pci_resource_flags (pdev, 0);
-
-      	if (!(pio_flags & IORESOURCE_IO)) {
-		DMESG("region #0 not a PIO resource, aborting");
-		goto fail;
-	}
-
-	//DMESG("IO space @ 0x%08lx", pio_start );
-	if( ! request_region( pio_start, pio_len, RTL8180_MODULE_NAME ) ){
-		DMESG("request_region failed!");
-		goto fail;
-	}
-
-	ioaddr = pio_start;
-	dev->base_addr = ioaddr; // device I/O address
-
-#else
 
 	pmem_start = pci_resource_start(pdev, 1);
 	pmem_len = pci_resource_len(pdev, 1);
@@ -5490,7 +5426,6 @@ static int __devinit rtl8180_pci_probe(s
 	dev->mem_start = ioaddr; // shared mem start
 	dev->mem_end = ioaddr + pci_resource_len(pdev, 0); // shared mem end
 
-#endif //end #ifdef RTL_IO_MAP
 
 	//pci_read_config_byte(pdev, 0x05, ptr);
 	//pci_write_config_byte(pdev, 0x05, (*ptr) & (~0x04));
@@ -5530,20 +5465,11 @@ static int __devinit rtl8180_pci_probe(s
 
 fail1:
 
-#ifdef CONFIG_RTL8180_IO_MAP
-
-	if( dev->base_addr != 0 ){
-
-		release_region(dev->base_addr,
-	       pci_resource_len(pdev, 0) );
-	}
-#else
 	if( dev->mem_start != (unsigned long)NULL ){
 		iounmap( (void *)dev->mem_start );
 		release_mem_region( pci_resource_start(pdev, 1),
 				    pci_resource_len(pdev, 1) );
 	}
-#endif //end #ifdef RTL_IO_MAP
 
 
 fail:
@@ -5598,20 +5524,11 @@ static void __devexit rtl8180_pci_remove
 		free_tx_desc_rings(dev);
 	//	free_beacon_desc_ring(dev,priv->txbeaconcount);
 
-#ifdef CONFIG_RTL8180_IO_MAP
-
-		if( dev->base_addr != 0 ){
-
-			release_region(dev->base_addr,
-				       pci_resource_len(pdev, 0) );
-		}
-#else
 		if( dev->mem_start != (unsigned long)NULL ){
 			iounmap( (void *)dev->mem_start );
 			release_mem_region( pci_resource_start(pdev, 1),
 					    pci_resource_len(pdev, 1) );
 		}
-#endif /*end #ifdef RTL_IO_MAP*/
 
 		free_ieee80211(dev);
 	}
Index: b/drivers/staging/rtl8187se/r8185b_init.c
===================================================================
--- a/drivers/staging/rtl8187se/r8185b_init.c
+++ b/drivers/staging/rtl8187se/r8185b_init.c
@@ -131,37 +131,9 @@ PlatformIOWrite1Byte(
 	u8		data
 	)
 {
-#ifndef CONFIG_RTL8180_IO_MAP
 	write_nic_byte(dev, offset, data);
 	read_nic_byte(dev, offset); // To make sure write operation is completed, 2005.11.09, by rcnjko.
 
-#else // Port IO
-	u32 Page = (offset >> 8);
-
-	switch(Page)
-	{
-	case 0: // Page 0
-		write_nic_byte(dev, offset, data);
-		break;
-
-	case 1: // Page 1
-	case 2: // Page 2
-	case 3: // Page 3
-		{
-			u8 psr = read_nic_byte(dev, PSR);
-
-			write_nic_byte(dev, PSR, ((psr & 0xfc) | (u8)Page)); // Switch to page N.
-			write_nic_byte(dev, (offset & 0xff), data);
-			write_nic_byte(dev, PSR, (psr & 0xfc)); // Switch to page 0.
-		}
-		break;
-
-	default:
-		// Illegal page number.
-		DMESGE("PlatformIOWrite1Byte(): illegal page number: %d, offset: %#X", Page, offset);
-		break;
-	}
-#endif
 }
 
 void
@@ -171,38 +143,10 @@ PlatformIOWrite2Byte(
 	u16		data
 	)
 {
-#ifndef CONFIG_RTL8180_IO_MAP
 	write_nic_word(dev, offset, data);
 	read_nic_word(dev, offset); // To make sure write operation is completed, 2005.11.09, by rcnjko.
 
 
-#else // Port IO
-	u32 Page = (offset >> 8);
-
-	switch(Page)
-	{
-	case 0: // Page 0
-		write_nic_word(dev, offset, data);
-		break;
-
-	case 1: // Page 1
-	case 2: // Page 2
-	case 3: // Page 3
-		{
-			u8 psr = read_nic_byte(dev, PSR);
-
-			write_nic_byte(dev, PSR, ((psr & 0xfc) | (u8)Page)); // Switch to page N.
-			write_nic_word(dev, (offset & 0xff), data);
-			write_nic_byte(dev, PSR, (psr & 0xfc)); // Switch to page 0.
-		}
-		break;
-
-	default:
-		// Illegal page number.
-		DMESGE("PlatformIOWrite2Byte(): illegal page number: %d, offset: %#X", Page, offset);
-		break;
-	}
-#endif
 }
 u8 PlatformIORead1Byte(struct net_device *dev, u32 offset);
 
@@ -213,7 +157,6 @@ PlatformIOWrite4Byte(
 	u32		data
 	)
 {
-#ifndef CONFIG_RTL8180_IO_MAP
 //{by amy 080312
 if (offset == PhyAddr)
 	{//For Base Band configuration.
@@ -257,33 +200,6 @@ if (offset == PhyAddr)
 		write_nic_dword(dev, offset, data);
 		read_nic_dword(dev, offset); // To make sure write operation is completed, 2005.11.09, by rcnjko.
 	}
-#else // Port IO
-	u32 Page = (offset >> 8);
-
-	switch(Page)
-	{
-	case 0: // Page 0
-		write_nic_word(dev, offset, data);
-		break;
-
-	case 1: // Page 1
-	case 2: // Page 2
-	case 3: // Page 3
-		{
-			u8 psr = read_nic_byte(dev, PSR);
-
-			write_nic_byte(dev, PSR, ((psr & 0xfc) | (u8)Page)); // Switch to page N.
-			write_nic_dword(dev, (offset & 0xff), data);
-			write_nic_byte(dev, PSR, (psr & 0xfc)); // Switch to page 0.
-		}
-		break;
-
-	default:
-		// Illegal page number.
-		DMESGE("PlatformIOWrite4Byte(): illegal page number: %d, offset: %#X", Page, offset);
-		break;
-	}
-#endif
 }
 
 u8
@@ -294,36 +210,8 @@ PlatformIORead1Byte(
 {
 	u8	data = 0;
 
-#ifndef CONFIG_RTL8180_IO_MAP
 	data = read_nic_byte(dev, offset);
 
-#else // Port IO
-	u32 Page = (offset >> 8);
-
-	switch(Page)
-	{
-	case 0: // Page 0
-		data = read_nic_byte(dev, offset);
-		break;
-
-	case 1: // Page 1
-	case 2: // Page 2
-	case 3: // Page 3
-		{
-			u8 psr = read_nic_byte(dev, PSR);
-
-			write_nic_byte(dev, PSR, ((psr & 0xfc) | (u8)Page)); // Switch to page N.
-			data = read_nic_byte(dev, (offset & 0xff));
-			write_nic_byte(dev, PSR, (psr & 0xfc)); // Switch to page 0.
-		}
-		break;
-
-	default:
-		// Illegal page number.
-		DMESGE("PlatformIORead1Byte(): illegal page number: %d, offset: %#X", Page, offset);
-		break;
-	}
-#endif
 
 	return data;
 }
@@ -336,36 +224,8 @@ PlatformIORead2Byte(
 {
 	u16	data = 0;
 
-#ifndef CONFIG_RTL8180_IO_MAP
 	data = read_nic_word(dev, offset);
 
-#else // Port IO
-	u32 Page = (offset >> 8);
-
-	switch(Page)
-	{
-	case 0: // Page 0
-		data = read_nic_word(dev, offset);
-		break;
-
-	case 1: // Page 1
-	case 2: // Page 2
-	case 3: // Page 3
-		{
-			u8 psr = read_nic_byte(dev, PSR);
-
-			write_nic_byte(dev, PSR, ((psr & 0xfc) | (u8)Page)); // Switch to page N.
-			data = read_nic_word(dev, (offset & 0xff));
-			write_nic_byte(dev, PSR, (psr & 0xfc)); // Switch to page 0.
-		}
-		break;
-
-	default:
-		// Illegal page number.
-		DMESGE("PlatformIORead2Byte(): illegal page number: %d, offset: %#X", Page, offset);
-		break;
-	}
-#endif
 
 	return data;
 }
@@ -378,36 +238,8 @@ PlatformIORead4Byte(
 {
 	u32	data = 0;
 
-#ifndef CONFIG_RTL8180_IO_MAP
 	data = read_nic_dword(dev, offset);
 
-#else // Port IO
-	u32 Page = (offset >> 8);
-
-	switch(Page)
-	{
-	case 0: // Page 0
-		data = read_nic_dword(dev, offset);
-		break;
-
-	case 1: // Page 1
-	case 2: // Page 2
-	case 3: // Page 3
-		{
-			u8 psr = read_nic_byte(dev, PSR);
-
-			write_nic_byte(dev, PSR, ((psr & 0xfc) | (u8)Page)); // Switch to page N.
-			data = read_nic_dword(dev, (offset & 0xff));
-			write_nic_byte(dev, PSR, (psr & 0xfc)); // Switch to page 0.
-		}
-		break;
-
-	default:
-		// Illegal page number.
-		DMESGE("PlatformIORead4Byte(): illegal page number: %d, offset: %#X\n", Page, offset);
-		break;
-	}
-#endif
 
 	return data;
 }

  parent reply	other threads:[~2009-06-28 14:13 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-06-28 14:18 [PATCH 01/18] Staging: rtl8187se: remove ENABLE_DOT11D ifdefs Bartlomiej Zolnierkiewicz
2009-06-28 14:18 ` [PATCH 02/18] Staging: rtl8187se: remove CONFIG_RTL8180_PM ifdefs Bartlomiej Zolnierkiewicz
2009-06-28 14:18 ` [PATCH 03/18] Staging: rtl8187se: remove THOMAS_TURBO ifdefs Bartlomiej Zolnierkiewicz
2009-06-28 14:19 ` [PATCH 04/18] Staging: rtl8187se: remove CONFIG_RTL818x_S ifdefs Bartlomiej Zolnierkiewicz
2009-06-28 14:19 ` [PATCH 05/18] Staging: rtl8187se: remove CONFIG_RTL8185B ifdefs Bartlomiej Zolnierkiewicz
2009-06-28 14:19 ` Bartlomiej Zolnierkiewicz [this message]
2009-06-28 14:19 ` [PATCH 07/18] Staging: rtl8187se: remove dead code Bartlomiej Zolnierkiewicz
2009-06-28 14:19 ` [PATCH 08/18] Staging: rtl8187se: remove unused radio frontends Bartlomiej Zolnierkiewicz
2009-06-28 14:19 ` [PATCH 09/18] Staging: rtl8187se: remove debugging code from r8180_core.c Bartlomiej Zolnierkiewicz
2009-06-28 14:19 ` [PATCH 10/18] Staging: rtl8187se: remove unused rtl8225_rf_* functions Bartlomiej Zolnierkiewicz
2009-06-28 14:19 ` [PATCH 11/18] Staging: rtl8187se: cleanup r8180_rtl8225.c Bartlomiej Zolnierkiewicz
2009-06-28 14:19 ` [PATCH 12/18] Staging: rtl8187se: merge r8180_rtl8225.c with r8180_rtl8225z2.c Bartlomiej Zolnierkiewicz
2009-06-28 14:20 ` [PATCH 13/18] Staging: rtl8187se: cleanup r8180_pm.c Bartlomiej Zolnierkiewicz
2009-06-28 14:20 ` [PATCH 14/18] Staging: rtl8187se: merge r8180_pm.c with r8180_core.c Bartlomiej Zolnierkiewicz
2009-06-28 14:20 ` [PATCH 15/18] Staging: rtl8187se: remove unused definitions from r8180_hw.h Bartlomiej Zolnierkiewicz
2009-06-28 14:20 ` [PATCH 16/18] Staging: rtl8187se: remove unused definitions from r8180.h Bartlomiej Zolnierkiewicz
2009-06-28 14:20 ` [PATCH 17/18] Staging: rtl8187se: cleanup r8180_rtl8225z2.c Bartlomiej Zolnierkiewicz
2009-06-28 14:20 ` [PATCH 18/18] Staging: rtl8187se: cleanup r8180_core.c Bartlomiej Zolnierkiewicz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20090628141917.8761.45120.sendpatchset@localhost.localdomain \
    --to=bzolnier@gmail.com \
    --cc=gregkh@suse.de \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.