rpms/kernel/devel config-generic, 1.48, 1.49 kernel.spec, 1.280, 1.281 linux-2.6-ath5k.patch, 1.6, 1.7 linux-2.6-rtl8180.patch, 1.1, 1.2 linux-2.6-wireless-pending.patch, 1.15, 1.16 linux-2.6-b43-rev-d.patch, 1.1, NONE linux-2.6-zd1211rw-mac80211.patch, 1.6, NONE

John W. Linville (linville) fedora-extras-commits at redhat.com
Tue Dec 4 22:04:07 UTC 2007


Author: linville

Update of /cvs/pkgs/rpms/kernel/devel
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv27861

Modified Files:
	config-generic kernel.spec linux-2.6-ath5k.patch 
	linux-2.6-rtl8180.patch linux-2.6-wireless-pending.patch 
Removed Files:
	linux-2.6-b43-rev-d.patch linux-2.6-zd1211rw-mac80211.patch 
Log Message:
Some wireless driver bits headed for 2.6.25


Index: config-generic
===================================================================
RCS file: /cvs/pkgs/rpms/kernel/devel/config-generic,v
retrieving revision 1.48
retrieving revision 1.49
diff -u -r1.48 -r1.49
--- config-generic	3 Dec 2007 23:52:00 -0000	1.48
+++ config-generic	4 Dec 2007 22:03:28 -0000	1.49
@@ -1323,9 +1323,8 @@
 CONFIG_TMD_HERMES=m
 CONFIG_USB_ATMEL=m
 CONFIG_USB_ZD1201=m
-# CONFIG_ZD1211RW is not set
-CONFIG_ZD1211RW_MAC80211=m
-# CONFIG_ZD1211RW_MAC80211_DEBUG is not set
+CONFIG_ZD1211RW=m
+# CONFIG_ZD1211RW_DEBUG is not set
 
 
 #


Index: kernel.spec
===================================================================
RCS file: /cvs/pkgs/rpms/kernel/devel/kernel.spec,v
retrieving revision 1.280
retrieving revision 1.281
diff -u -r1.280 -r1.281
--- kernel.spec	4 Dec 2007 13:53:09 -0000	1.280
+++ kernel.spec	4 Dec 2007 22:03:28 -0000	1.281
@@ -622,10 +622,8 @@
 Patch681: linux-2.6-wireless-pending.patch
 Patch690: linux-2.6-at76.patch
 Patch691: linux-2.6-ath5k.patch
-Patch692: linux-2.6-zd1211rw-mac80211.patch
-Patch693: linux-2.6-rtl8180.patch
-Patch694: linux-2.6-b43-rev-d.patch
-Patch695: linux-2.6-ath5k-use-soft-wep.patch
+Patch692: linux-2.6-rtl8180.patch
+Patch693: linux-2.6-ath5k-use-soft-wep.patch
 Patch801: linux-2.6-wakeups.patch
 Patch820: linux-2.6-compile-fixes.patch
 Patch1101: linux-2.6-default-mmf_dump_elf_headers.patch
@@ -1130,11 +1128,8 @@
 # Add misc wireless bits from upstream wireless tree
 ApplyPatch linux-2.6-at76.patch
 ApplyPatch linux-2.6-ath5k.patch
-ApplyPatch linux-2.6-zd1211rw-mac80211.patch
 ApplyPatch linux-2.6-rtl8180.patch
 
-# Add support for "rev 13" cores in b43
-ApplyPatch linux-2.6-b43-rev-d.patch
 # Make ath5k use software WEP
 ApplyPatch linux-2.6-ath5k-use-soft-wep.patch
 
@@ -1750,6 +1745,9 @@
 %kernel_variant_files -a /%{image_install_path}/xen*-%{KVERREL} -e /etc/ld.so.conf.d/kernelcap-%{KVERREL}.conf %{with_xen} xen
 
 %changelog
+* Tue Dec 04 2007 John W. Linville <linville at redhat.com>
+- Some wireless driver bits headed for 2.6.25
+
 * Mon Dec 04 2007 David Woodhouse <dwmw2 at redhat.com>
 - Fix HW csum on pasemi_mac
 - Fix i2c bus reservation on pasemi

linux-2.6-ath5k.patch:

View full diff with command:
/usr/bin/cvs -f diff  -kk -u -N -r 1.6 -r 1.7 linux-2.6-ath5k.patch
Index: linux-2.6-ath5k.patch
===================================================================
RCS file: /cvs/pkgs/rpms/kernel/devel/linux-2.6-ath5k.patch,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- linux-2.6-ath5k.patch	21 Nov 2007 20:06:41 -0000	1.6
+++ linux-2.6-ath5k.patch	4 Dec 2007 22:03:28 -0000	1.7
@@ -1,6 +1,6 @@
 diff -up linux-2.6.23.noarch/drivers/net/wireless/Kconfig.orig linux-2.6.23.noarch/drivers/net/wireless/Kconfig
---- linux-2.6.23.noarch/drivers/net/wireless/Kconfig.orig	2007-11-21 14:21:34.000000000 -0500
-+++ linux-2.6.23.noarch/drivers/net/wireless/Kconfig	2007-11-21 14:22:18.000000000 -0500
+--- linux-2.6.23.noarch/drivers/net/wireless/Kconfig.orig	2007-12-04 15:09:15.000000000 -0500
++++ linux-2.6.23.noarch/drivers/net/wireless/Kconfig	2007-12-04 15:09:44.000000000 -0500
 @@ -604,6 +604,24 @@ config P54_PCI
  	tristate "Prism54 PCI support"
  	depends on P54_COMMON && PCI
@@ -27,17 +27,233 @@
  source "drivers/net/wireless/hostap/Kconfig"
  source "drivers/net/wireless/bcm43xx/Kconfig"
 diff -up linux-2.6.23.noarch/drivers/net/wireless/Makefile.orig linux-2.6.23.noarch/drivers/net/wireless/Makefile
---- linux-2.6.23.noarch/drivers/net/wireless/Makefile.orig	2007-11-21 14:21:34.000000000 -0500
-+++ linux-2.6.23.noarch/drivers/net/wireless/Makefile	2007-11-21 14:22:18.000000000 -0500
+--- linux-2.6.23.noarch/drivers/net/wireless/Makefile.orig	2007-12-04 15:09:15.000000000 -0500
++++ linux-2.6.23.noarch/drivers/net/wireless/Makefile	2007-12-04 15:09:44.000000000 -0500
 @@ -61,3 +61,5 @@ obj-$(CONFIG_RT2X00)	+= rt2x00/
  obj-$(CONFIG_P54_COMMON)	+= p54common.o
  obj-$(CONFIG_P54_USB)		+= p54usb.o
  obj-$(CONFIG_P54_PCI)		+= p54pci.o
 +
 +obj-$(CONFIG_ATH5K)	+= ath5k/
+diff -up /dev/null linux-2.6.23.noarch/drivers/net/wireless/ath5k/debug.h
+--- /dev/null	2007-11-21 18:00:15.874485932 -0500
++++ linux-2.6.23.noarch/drivers/net/wireless/ath5k/debug.h	2007-12-04 15:09:44.000000000 -0500
+@@ -0,0 +1,212 @@
++/*
++ * Copyright (c) 2007 Bruno Randolf <bruno at thinktube.com>
++ *
++ *  This file is free software: you may copy, redistribute and/or modify it
++ *  under the terms of the GNU General Public License as published by the
++ *  Free Software Foundation, either version 2 of the License, or (at your
++ *  option) any later version.
++ *
++ *  This file is distributed in the hope that it will be useful, but
++ *  WITHOUT ANY WARRANTY; without even the implied warranty of
++ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++ *  General Public License for more details.
++ *
++ *  You should have received a copy of the GNU General Public License
++ *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
++ *
++ *
++ * This file incorporates work covered by the following copyright and
++ * permission notice:
++ *
++ * Copyright (c) 2002-2005 Sam Leffler, Errno Consulting
++ * Copyright (c) 2004-2005 Atheros Communications, Inc.
++ * Copyright (c) 2006 Devicescape Software, Inc.
++ * Copyright (c) 2007 Jiri Slaby <jirislaby at gmail.com>
++ * Copyright (c) 2007 Luis R. Rodriguez <mcgrof at winlab.rutgers.edu>
++ *
++ * All rights reserved.
++ *
++ * Redistribution and use in source and binary forms, with or without
++ * modification, are permitted provided that the following conditions
++ * are met:
++ * 1. Redistributions of source code must retain the above copyright
++ *    notice, this list of conditions and the following disclaimer,
++ *    without modification.
++ * 2. Redistributions in binary form must reproduce at minimum a disclaimer
++ *    similar to the "NO WARRANTY" disclaimer below ("Disclaimer") and any
++ *    redistribution must be conditioned upon including a substantially
++ *    similar Disclaimer requirement for further binary redistribution.
++ * 3. Neither the names of the above-listed copyright holders nor the names
++ *    of any contributors may be used to endorse or promote products derived
++ *    from this software without specific prior written permission.
++ *
++ * Alternatively, this software may be distributed under the terms of the
++ * GNU General Public License ("GPL") version 2 as published by the Free
++ * Software Foundation.
++ *
++ * NO WARRANTY
++ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
++ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
++ * LIMITED TO, THE IMPLIED WARRANTIES OF NONINFRINGEMENT, MERCHANTIBILITY
++ * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
++ * THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY,
++ * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
++ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
++ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
++ * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
++ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
++ * THE POSSIBILITY OF SUCH DAMAGES.
++ */
++
++#ifndef _ATH5K_DEBUG_H
++#define _ATH5K_DEBUG_H
++
++/* set this to 1 for debugging output */
++#ifndef ATH5K_DEBUG
++#define ATH5K_DEBUG	0
++#endif
++
++struct ath5k_softc;
++struct ath5k_hw;
++struct ieee80211_hw_mode;
++struct sk_buff;
++struct ath5k_buf;
++
++struct ath5k_dbg_info {
++	unsigned int		level;		/* debug level */
++	/* debugfs entries */
++	struct dentry		*debugfs_phydir;
++	struct dentry		*debugfs_debug;
++};
++
++/**
++ * enum ath5k_debug_level - ath5k debug level
++ *
++ * @ATH5K_DEBUG_RESET: reset processing
++ * @ATH5K_DEBUG_INTR: interrupt handling
++ * @ATH5K_DEBUG_MODE: mode init/setup
++ * @ATH5K_DEBUG_XMIT: basic xmit operation
++ * @ATH5K_DEBUG_BEACON: beacon handling
++ * @ATH5K_DEBUG_BEACON_PROC: beacon ISR proc
++ * @ATH5K_DEBUG_CALIBRATE: periodic calibration
++ * @ATH5K_DEBUG_TXPOWER: transmit power setting
++ * @ATH5K_DEBUG_LED: led management
++ * @ATH5K_DEBUG_DUMP_RX: print received skb content
++ * @ATH5K_DEBUG_DUMP_TX: print transmit skb content
++ * @ATH5K_DEBUG_DUMPMODES: dump modes
++ * @ATH5K_DEBUG_TRACE: trace function calls
++ * @ATH5K_DEBUG_FATAL: fatal errors
++ * @ATH5K_DEBUG_ANY: show at any debug level
++ *
++ * The debug level is used to control the amount and type of debugging output
++ * we want to see. The debug level is given in calls to ATH5K_DBG to specify
++ * where the message should appear, and the user can control the debugging
++ * messages he wants to see, either by the module parameter 'debug' on module
++ * load, or dynamically by using debugfs 'ath5k/phyX/debug'. these levels can
++ * be combined together by bitwise OR.
++ */
++enum ath5k_debug_level {
++	ATH5K_DEBUG_RESET	= 0x00000001,
++	ATH5K_DEBUG_INTR	= 0x00000002,
++	ATH5K_DEBUG_MODE	= 0x00000004,
++	ATH5K_DEBUG_XMIT	= 0x00000008,
++	ATH5K_DEBUG_BEACON	= 0x00000010,
++	ATH5K_DEBUG_BEACON_PROC	= 0x00000020,
++	ATH5K_DEBUG_CALIBRATE	= 0x00000100,
++	ATH5K_DEBUG_TXPOWER	= 0x00000200,
++	ATH5K_DEBUG_LED		= 0x00000400,
++	ATH5K_DEBUG_DUMP_RX	= 0x00001000,
++	ATH5K_DEBUG_DUMP_TX	= 0x00002000,
++	ATH5K_DEBUG_DUMPMODES	= 0x00004000,
++	ATH5K_DEBUG_TRACE	= 0x00010000,
++	ATH5K_DEBUG_FATAL	= 0x80000000,
++	ATH5K_DEBUG_ANY		= 0xffffffff
++};
++
++#if ATH5K_DEBUG
++
++#define ATH5K_TRACE(_sc) do { \
++	if (unlikely((_sc)->debug.level & ATH5K_DEBUG_TRACE)) \
++		printk(KERN_DEBUG "ath5k trace %s:%d\n", __func__, __LINE__); \
++	} while (0)
++
++#define ATH5K_DBG(_sc, _m, _fmt, ...) do { \
++	if (unlikely((_sc)->debug.level & (_m) && net_ratelimit())) \
++		ATH5K_PRINTK(_sc, KERN_DEBUG, "(%s:%d): " _fmt, \
++			__func__, __LINE__, ##__VA_ARGS__); \
++	} while (0)
++
++#define ATH5K_DBG_UNLIMIT(_sc, _m, _fmt, ...) do { \
++	if (unlikely((_sc)->debug.level & (_m))) \
++		ATH5K_PRINTK(_sc, KERN_DEBUG, "(%s:%d): " _fmt, \
++			__func__, __LINE__, ##__VA_ARGS__); \
++	} while (0)
++
++void
++ath5k_debug_init(void);
++
++void
++ath5k_debug_init_device(struct ath5k_softc *sc);
++
++void
++ath5k_debug_finish(void);
++
++void
++ath5k_debug_finish_device(struct ath5k_softc *sc);
++
++void
++ath5k_debug_printrxbuffs(struct ath5k_softc *sc, struct ath5k_hw *ah);
++
++void
++ath5k_debug_dump_modes(struct ath5k_softc *sc,
++			struct ieee80211_hw_mode *modes);
++
++void
++ath5k_debug_dump_skb(struct ath5k_softc *sc,
[...2387 lines suppressed...]
++		ds->ds_link, ds->ds_data, ds->ds_ctl0, ds->ds_ctl1,
++		ds->ds_hw[0], ds->ds_hw[1],
++		!done ? ' ' : (ds->ds_rxstat.rs_status == 0) ? '*' : '!');
++}
++
++void
++ath5k_debug_printrxbuffs(struct ath5k_softc *sc, struct ath5k_hw *ah)
++{
++	struct ath5k_desc *ds;
++	struct ath5k_buf *bf;
++	int status;
++
++	if (likely(!(sc->debug.level &
++	    (ATH5K_DEBUG_RESET | ATH5K_DEBUG_FATAL))))
++		return;
++
++	printk(KERN_DEBUG "rx queue %x, link %p\n",
++		ath5k_hw_get_rx_buf(ah), sc->rxlink);
++
++	spin_lock_bh(&sc->rxbuflock);
++	list_for_each_entry(bf, &sc->rxbuf, list) {
++		ds = bf->desc;
++		status = ah->ah_proc_rx_desc(ah, ds);
++		if (!status || (sc->debug.level & ATH5K_DEBUG_FATAL))
++			ath5k_debug_printrxbuf(bf, status == 0);
++	}
++	spin_unlock_bh(&sc->rxbuflock);
++}
++
++void
++ath5k_debug_dump_skb(struct ath5k_softc *sc,
++			struct sk_buff *skb, const char *prefix, int tx)
++{
++	char buf[16];
++
++	if (likely(!((tx && (sc->debug.level & ATH5K_DEBUG_DUMP_TX)) ||
++		     (!tx && (sc->debug.level & ATH5K_DEBUG_DUMP_RX)))))
++		return;
++
++	snprintf(buf, sizeof(buf), "%s %s", wiphy_name(sc->hw->wiphy), prefix);
++
++	print_hex_dump_bytes(buf, DUMP_PREFIX_NONE, skb->data,
++		min(200U, skb->len));
++
++	printk(KERN_DEBUG "\n");
++}
++
++void
++ath5k_debug_printtxbuf(struct ath5k_softc *sc,
++			struct ath5k_buf *bf, int done)
++{
++	struct ath5k_desc *ds = bf->desc;
++
++	if (likely(!(sc->debug.level & ATH5K_DEBUG_RESET)))
++		return;
++
++	printk(KERN_DEBUG "T (%p %llx) %08x %08x %08x %08x %08x %08x %08x "
++		"%08x %c\n", ds, (unsigned long long)bf->daddr, ds->ds_link,
++		ds->ds_data, ds->ds_ctl0, ds->ds_ctl1,
++		ds->ds_hw[0], ds->ds_hw[1], ds->ds_hw[2], ds->ds_hw[3],
++		!done ? ' ' : (ds->ds_txstat.ts_status == 0) ? '*' : '!');
++}
++
++#endif /* if ATH5K_DEBUG */
 diff -up /dev/null linux-2.6.23.noarch/drivers/net/wireless/ath5k/base.h
---- /dev/null	2007-11-12 23:12:46.917997680 -0500
-+++ linux-2.6.23.noarch/drivers/net/wireless/ath5k/base.h	2007-11-21 14:22:18.000000000 -0500
-@@ -0,0 +1,175 @@
+--- /dev/null	2007-11-21 18:00:15.874485932 -0500
++++ linux-2.6.23.noarch/drivers/net/wireless/ath5k/base.h	2007-12-04 15:09:44.000000000 -0500
+@@ -0,0 +1,178 @@
 +/*-
 + * Copyright (c) 2002-2007 Sam Leffler, Errno Consulting
 + * All rights reserved.
@@ -13297,6 +13537,7 @@
 +#include <linux/if_ether.h>
 +
 +#include "ath5k.h"
++#include "debug.h"
 +
 +#define	ATH_RXBUF	40		/* number of RX buffers */
 +#define	ATH_TXBUF	200		/* number of TX buffers */
@@ -13350,7 +13591,9 @@
 +	enum ieee80211_if_types	opmode;
 +	struct ath5k_hw		*ah;		/* Atheros HW */
 +
-+	int			debug;
++#if ATH5K_DEBUG
++	struct ath5k_dbg_info	debug;		/* debug info */
++#endif
 +
 +	struct ath5k_buf	*bufptr;	/* allocated buffer ptr */
 +	struct ath5k_desc	*desc;		/* TX/RX descriptors */
@@ -13424,8 +13667,8 @@
 +
 +#endif
 diff -up /dev/null linux-2.6.23.noarch/drivers/net/wireless/ath5k/hw.h
---- /dev/null	2007-11-12 23:12:46.917997680 -0500
-+++ linux-2.6.23.noarch/drivers/net/wireless/ath5k/hw.h	2007-11-21 14:22:18.000000000 -0500
+--- /dev/null	2007-11-21 18:00:15.874485932 -0500
++++ linux-2.6.23.noarch/drivers/net/wireless/ath5k/hw.h	2007-12-04 15:09:44.000000000 -0500
 @@ -0,0 +1,588 @@
 +/*
 + * Copyright (c) 2004-2007 Reyk Floeter <reyk at openbsd.org>
@@ -14016,9 +14259,9 @@
 +	return retval;
 +}
 diff -up /dev/null linux-2.6.23.noarch/drivers/net/wireless/ath5k/ath5k.h
---- /dev/null	2007-11-12 23:12:46.917997680 -0500
-+++ linux-2.6.23.noarch/drivers/net/wireless/ath5k/ath5k.h	2007-11-21 14:22:18.000000000 -0500
-@@ -0,0 +1,1136 @@
+--- /dev/null	2007-11-21 18:00:15.874485932 -0500
++++ linux-2.6.23.noarch/drivers/net/wireless/ath5k/ath5k.h	2007-12-04 15:09:44.000000000 -0500
+@@ -0,0 +1,1149 @@
 +/*
 + * Copyright (c) 2004-2007 Reyk Floeter <reyk at openbsd.org>
 + * Copyright (c) 2006-2007 Nick Kossifidis <mickflemm at gmail.com>
@@ -14046,9 +14289,6 @@
 + * you've been warned. */
 +#define CHAN_DEBUG	0
 +
-+/* Uncomment this for debuging (warning that it results in TOO much output) */
-+/* #define AR5K_DEBUG	1 */
-+
 +#include <linux/io.h>
 +#include <linux/types.h>
 +#include <net/mac80211.h>
@@ -14090,13 +14330,26 @@
 +  GENERIC DRIVER DEFINITIONS
 +\****************************/
 +
-+#define AR5K_PRINTF(fmt, ...)   printk("%s: " fmt, __func__, ##__VA_ARGS__)
-+#define AR5K_PRINT(fmt)         printk("%s: " fmt, __func__)
-+#ifdef AR5K_DEBUG
-+#define AR5K_TRACE              printk(KERN_DEBUG "%s:%d\n", __func__, __LINE__)
-+#else
-+#define AR5K_TRACE
-+#endif
++#define ATH5K_PRINTF(fmt, ...)   printk("%s: " fmt, __func__, ##__VA_ARGS__)
++
++#define ATH5K_PRINTK(_sc, _level, _fmt, ...) \
++	printk(_level "ath5k %s: " _fmt, \
++		((_sc) && (_sc)->hw) ? wiphy_name((_sc)->hw->wiphy) : "", \
++		##__VA_ARGS__)
++
++#define ATH5K_PRINTK_LIMIT(_sc, _level, _fmt, ...) do { \
++	if (net_ratelimit()) \
++		ATH5K_PRINTK(_sc, _level, _fmt, ##__VA_ARGS__); \
++	} while (0)
++
++#define ATH5K_INFO(_sc, _fmt, ...) \
++	ATH5K_PRINTK(_sc, KERN_INFO, _fmt, ##__VA_ARGS__)
++
++#define ATH5K_WARN(_sc, _fmt, ...) \
++	ATH5K_PRINTK_LIMIT(_sc, KERN_WARNING, _fmt, ##__VA_ARGS__)
++
++#define ATH5K_ERR(_sc, _fmt, ...) \
++	ATH5K_PRINTK_LIMIT(_sc, KERN_ERR, _fmt, ##__VA_ARGS__)
 +
 +/*
 + * Some tuneable values (these should be changeable by the user)
@@ -15014,6 +15267,9 @@
 +		struct ieee80211_channel r_last_channel;
 +	} ah_radar;
 +
++	/* noise floor from last periodic calibration */
++	s32			ah_noise_floor;
++
 +	/*
 +	 * Function pointers
 +	 */
@@ -15116,7 +15372,6 @@
 +/* Regulatory Domain/Channels Setup */
 +extern u16 ath5k_get_regdomain(struct ath5k_hw *ah);
 +/* Misc functions */
-+extern void ath5k_hw_dump_state(struct ath5k_hw *ah);
 +extern int ath5k_hw_get_capability(struct ath5k_hw *ah, enum ath5k_capability_type cap_type, u32 capability, u32 *result);
 +
 +
@@ -15139,6 +15394,7 @@
 +extern u16 ath5k_hw_radio_revision(struct ath5k_hw *ah, unsigned int chan);
 +extern void ath5k_hw_set_def_antenna(struct ath5k_hw *ah, unsigned int ant);
 +extern unsigned int ath5k_hw_get_def_antenna(struct ath5k_hw *ah);
++extern int ath5k_hw_noise_floor_calibration(struct ath5k_hw *ah, short freq);
 +/* TX power setup */
 +extern int ath5k_hw_txpower(struct ath5k_hw *ah, struct ieee80211_channel *channel, unsigned int txpower);
 +extern int ath5k_hw_set_txpower_limit(struct ath5k_hw *ah, unsigned int power);
@@ -15156,9 +15412,9 @@
 +
 +#endif
 diff -up linux-2.6.23.noarch/MAINTAINERS.orig linux-2.6.23.noarch/MAINTAINERS
---- linux-2.6.23.noarch/MAINTAINERS.orig	2007-11-21 14:21:34.000000000 -0500
-+++ linux-2.6.23.noarch/MAINTAINERS	2007-11-21 14:22:18.000000000 -0500
-@@ -649,6 +649,17 @@ M:	ecashin at coraid.com
+--- linux-2.6.23.noarch/MAINTAINERS.orig	2007-12-04 15:09:15.000000000 -0500
++++ linux-2.6.23.noarch/MAINTAINERS	2007-12-04 15:09:44.000000000 -0500
+@@ -648,6 +648,17 @@ M:	ecashin at coraid.com
  W:	http://www.coraid.com/support/linux
  S:	Supported
  

linux-2.6-rtl8180.patch:

Index: linux-2.6-rtl8180.patch
===================================================================
RCS file: /cvs/pkgs/rpms/kernel/devel/linux-2.6-rtl8180.patch,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- linux-2.6-rtl8180.patch	21 Nov 2007 20:06:41 -0000	1.1
+++ linux-2.6-rtl8180.patch	4 Dec 2007 22:03:29 -0000	1.2
@@ -1,6 +1,42 @@
+diff -up linux-2.6.23.noarch/drivers/net/wireless/rtl8187_dev.c.orig linux-2.6.23.noarch/drivers/net/wireless/rtl8187_dev.c
+--- linux-2.6.23.noarch/drivers/net/wireless/rtl8187_dev.c.orig	2007-12-04 14:25:23.000000000 -0500
++++ linux-2.6.23.noarch/drivers/net/wireless/rtl8187_dev.c	2007-12-04 15:37:19.000000000 -0500
+@@ -393,12 +393,12 @@ static int rtl8187_init_hw(struct ieee80
+ 	priv->rf_init(dev);
+ 
+ 	rtl818x_iowrite16(priv, &priv->map->BRSR, 0x01F3);
+-	reg = rtl818x_ioread16(priv, &priv->map->PGSELECT) & 0xfffe;
+-	rtl818x_iowrite16(priv, &priv->map->PGSELECT, reg | 0x1);
++	reg = rtl818x_ioread8(priv, &priv->map->PGSELECT) & ~1;
++	rtl818x_iowrite8(priv, &priv->map->PGSELECT, reg | 1);
+ 	rtl818x_iowrite16(priv, (__le16 *)0xFFFE, 0x10);
+ 	rtl818x_iowrite8(priv, &priv->map->TALLY_SEL, 0x80);
+ 	rtl818x_iowrite8(priv, (u8 *)0xFFFF, 0x60);
+-	rtl818x_iowrite16(priv, &priv->map->PGSELECT, reg);
++	rtl818x_iowrite8(priv, &priv->map->PGSELECT, reg);
+ 
+ 	return 0;
+ }
+@@ -750,13 +750,13 @@ static int __devinit rtl8187_probe(struc
+ 	eeprom_93cx6_read(&eeprom, RTL8187_EEPROM_TXPWR_BASE,
+ 			  &priv->txpwr_base);
+ 
+-	reg = rtl818x_ioread16(priv, &priv->map->PGSELECT) & ~1;
+-	rtl818x_iowrite16(priv, &priv->map->PGSELECT, reg | 1);
++	reg = rtl818x_ioread8(priv, &priv->map->PGSELECT) & ~1;
++	rtl818x_iowrite8(priv, &priv->map->PGSELECT, reg | 1);
+ 	/* 0 means asic B-cut, we should use SW 3 wire
+ 	 * bit-by-bit banging for radio. 1 means we can use
+ 	 * USB specific request to write radio registers */
+ 	priv->asic_rev = rtl818x_ioread8(priv, (u8 *)0xFFFE) & 0x3;
+-	rtl818x_iowrite16(priv, &priv->map->PGSELECT, reg);
++	rtl818x_iowrite8(priv, &priv->map->PGSELECT, reg);
+ 	rtl818x_iowrite8(priv, &priv->map->EEPROM_CMD, RTL818X_EEPROM_CMD_NORMAL);
+ 
+ 	rtl8225_write(dev, 0, 0x1B7);
 diff -up linux-2.6.23.noarch/drivers/net/wireless/Kconfig.orig linux-2.6.23.noarch/drivers/net/wireless/Kconfig
---- linux-2.6.23.noarch/drivers/net/wireless/Kconfig.orig	2007-11-21 14:22:57.000000000 -0500
-+++ linux-2.6.23.noarch/drivers/net/wireless/Kconfig	2007-11-21 14:23:21.000000000 -0500
+--- linux-2.6.23.noarch/drivers/net/wireless/Kconfig.orig	2007-12-04 15:36:33.000000000 -0500
++++ linux-2.6.23.noarch/drivers/net/wireless/Kconfig	2007-12-04 15:37:19.000000000 -0500
 @@ -552,6 +552,11 @@ config USB_ZD1201
  	  To compile this driver as a module, choose M here: the
  	  module will be called zd1201.
@@ -13,24 +49,212 @@
  config RTL8187
  	tristate "Realtek 8187 USB support"
  	depends on MAC80211 && USB && WLAN_80211 && EXPERIMENTAL
+diff -up /dev/null linux-2.6.23.noarch/drivers/net/wireless/rtl8180_sa2400.h
+--- /dev/null	2007-11-21 18:00:15.874485932 -0500
++++ linux-2.6.23.noarch/drivers/net/wireless/rtl8180_sa2400.h	2007-12-04 15:37:19.000000000 -0500
+@@ -0,0 +1,38 @@
++#ifndef RTL8180_SA2400_H
++#define RTL8180_SA2400_H
++
++/*
++ * Radio tuning for Philips SA2400 on RTL8180
++ *
++ * Copyright 2007 Andrea Merello <andreamrl at tiscali.it>
++ *
++ * Code from the BSD driver and the rtl8181 project have been
++ * very useful to understand certain things
++ *
++ * I want to thanks the Authors of such projects and the Ndiswrapper
++ * project Authors.
++ *
++ * A special Big Thanks also is for all people who donated me cards,
++ * making possible the creation of the original rtl8180 driver
++ * from which this code is derived!
++ *
++ * This program is free software; you can redistribute it and/or modify
++ * it under the terms of the GNU General Public License version 2 as
++ * published by the Free Software Foundation.
++ */
++
++#define SA2400_ANTENNA 0x91
++#define SA2400_DIG_ANAPARAM_PWR1_ON 0x8
++#define SA2400_ANA_ANAPARAM_PWR1_ON 0x28
++#define SA2400_ANAPARAM_PWR0_ON 0x3
++
++/* RX sensitivity in dbm */
++#define SA2400_MAX_SENS 85
++
++#define SA2400_REG4_FIRDAC_SHIFT 7
++
++void sa2400_rf_init(struct ieee80211_hw *);
++void sa2400_rf_stop(struct ieee80211_hw *);
++void sa2400_rf_set_channel(struct ieee80211_hw *, struct ieee80211_conf *);
++
++#endif /* RTL8180_SA2400_H */
 diff -up linux-2.6.23.noarch/drivers/net/wireless/Makefile.orig linux-2.6.23.noarch/drivers/net/wireless/Makefile
---- linux-2.6.23.noarch/drivers/net/wireless/Makefile.orig	2007-11-21 14:22:57.000000000 -0500
-+++ linux-2.6.23.noarch/drivers/net/wireless/Makefile	2007-11-21 14:23:21.000000000 -0500
+--- linux-2.6.23.noarch/drivers/net/wireless/Makefile.orig	2007-12-04 15:36:33.000000000 -0500
++++ linux-2.6.23.noarch/drivers/net/wireless/Makefile	2007-12-04 15:37:19.000000000 -0500
 @@ -49,7 +49,10 @@ obj-$(CONFIG_PCMCIA_WL3501)	+= wl3501_cs
  obj-$(CONFIG_USB_ZD1201)	+= zd1201.o
  obj-$(CONFIG_LIBERTAS)		+= libertas/
  
-+rtl8180-objs		:= rtl8180_dev.o rtl8180_rtl8225.o
++rtl8180-objs		:= rtl8180_dev.o rtl8180_rtl8225.o rtl8180_sa2400.o rtl8180_max2820.o
  rtl8187-objs		:= rtl8187_dev.o rtl8187_rtl8225.o
 +
 +obj-$(CONFIG_RTL8180)	+= rtl8180.o
  obj-$(CONFIG_RTL8187)	+= rtl8187.o
  
  obj-$(CONFIG_ADM8211)	+= adm8211.o
+diff -up /dev/null linux-2.6.23.noarch/drivers/net/wireless/rtl8180_max2820.c
+--- /dev/null	2007-11-21 18:00:15.874485932 -0500
++++ linux-2.6.23.noarch/drivers/net/wireless/rtl8180_max2820.c	2007-12-04 15:37:19.000000000 -0500
+@@ -0,0 +1,142 @@
++/*
++ * Radio tuning for Maxim max2820 on RTL8180
++ *
++ * Copyright 2007 Andrea Merello <andreamrl at tiscali.it>
++ *
++ * Code from the BSD driver and the rtl8181 project have been
++ * very useful to understand certain things
++ *
++ * I want to thanks the Authors of such projects and the Ndiswrapper
++ * project Authors.
++ *
++ * A special Big Thanks also is for all people who donated me cards,
++ * making possible the creation of the original rtl8180 driver
++ * from which this code is derived!
++ *
++ * This program is free software; you can redistribute it and/or modify
++ * it under the terms of the GNU General Public License version 2 as
++ * published by the Free Software Foundation.
++ */
++
++#include <linux/init.h>
++#include <linux/pci.h>
++#include <linux/delay.h>
++#include <net/mac80211.h>
++
++#include "rtl8180.h"
++#include "rtl8180_max2820.h"
++
++u32 max2820_chan[] = {
++	12, /* CH 1 */
++	17,
++	22,
++	27,
++	32,
++	37,
++	42,
++	47,
++	52,
++	57,
++	62,
++	67,
++	72,
++	84, /* CH 14 */
++};
++
++static void write_max2820(struct ieee80211_hw *dev, u8 addr, u32 data)
++{
++	struct rtl8180_priv *priv = dev->priv;
++	u32 phy_config;
++
++	phy_config = 0x90 + (data & 0xf);
++	phy_config <<= 16;
++	phy_config += addr;
++	phy_config <<= 8;
++	phy_config += (data >> 4) & 0xff;
++
++	rtl818x_iowrite32(priv,
++		(__le32 __iomem *) &priv->map->RFPinsOutput, phy_config);
++
++	msleep(1);
++}
++
++static void max2820_write_phy_antenna(struct ieee80211_hw *dev, short chan)
++{
++	struct rtl8180_priv *priv = dev->priv;
++	u8 ant;
++
++	ant = MAXIM_ANTENNA;
++	if (priv->rfparam & RF_PARAM_ANTBDEFAULT)
++		ant |= BB_ANTENNA_B;
++	if (chan == 14)
++		ant |= BB_ANTATTEN_CHAN14;
++
++	rtl8180_write_phy(dev, 0x10, ant);
++}
++
++void max2820_rf_set_channel(struct ieee80211_hw *dev, struct ieee80211_conf *conf)
++{
++	struct rtl8180_priv *priv = dev->priv;
++	unsigned int chan_idx = conf ? conf->channel - 1 : 0;
++	u32 txpw = priv->channels[chan_idx].val & 0xFF;
++	u32 chan = max2820_chan[chan_idx];
++
++	/* While philips SA2400 drive the PA bias from
++	 * sa2400, for MAXIM we do this directly from BB */
++	rtl8180_write_phy(dev, 3, txpw);
++
++	max2820_write_phy_antenna(dev, chan);
++	write_max2820(dev, 3, chan);
++}
++
++void max2820_rf_stop(struct ieee80211_hw *dev)
++{
++	rtl8180_write_phy(dev, 3, 0x8);
++	write_max2820(dev, 1, 0);
++}
++
++
++void max2820_rf_init(struct ieee80211_hw *dev)
++{
++	struct rtl8180_priv *priv = dev->priv;
++
++	/* MAXIM from netbsd driver */
++	write_max2820(dev, 0, 0x007); /* test mode as indicated in datasheet */
++	write_max2820(dev, 1, 0x01e); /* enable register */
++	write_max2820(dev, 2, 0x001); /* synt register */
++
++	max2820_rf_set_channel(dev, NULL);
++
++	write_max2820(dev, 4, 0x313); /* rx register */
++
++	/* PA is driven directly by the BB, we keep the MAXIM bias
++	 * at the highest value in case that setting it to lower
++	 * values may introduce some further attenuation somewhere..
++	 */
++	write_max2820(dev, 5, 0x00f);
++
++	/* baseband configuration */
++	rtl8180_write_phy(dev, 0, 0x88); /* sys1       */
++	rtl8180_write_phy(dev, 3, 0x08); /* txagc      */
++	rtl8180_write_phy(dev, 4, 0xf8); /* lnadet     */
++	rtl8180_write_phy(dev, 5, 0x90); /* ifagcinit  */
++	rtl8180_write_phy(dev, 6, 0x1a); /* ifagclimit */
++	rtl8180_write_phy(dev, 7, 0x64); /* ifagcdet   */
++
++	max2820_write_phy_antenna(dev, 1);
++
++	rtl8180_write_phy(dev, 0x11, 0x88); /* trl */
++
++	if (rtl818x_ioread8(priv, &priv->map->CONFIG2) &
++	    RTL818X_CONFIG2_ANTENNA_DIV)
++		rtl8180_write_phy(dev, 0x12, 0xc7);
++	else
++		rtl8180_write_phy(dev, 0x12, 0x47);
++
++	rtl8180_write_phy(dev, 0x13, 0x9b);
++
++	rtl8180_write_phy(dev, 0x19, 0x0);  /* CHESTLIM */
++	rtl8180_write_phy(dev, 0x1a, 0x9f); /* CHSQLIM  */
++
++	max2820_rf_set_channel(dev, NULL);
++}
 diff -up /dev/null linux-2.6.23.noarch/drivers/net/wireless/rtl8180_dev.c
---- /dev/null	2007-11-12 23:12:46.917997680 -0500
-+++ linux-2.6.23.noarch/drivers/net/wireless/rtl8180_dev.c	2007-11-21 14:23:21.000000000 -0500
-@@ -0,0 +1,1019 @@
+--- /dev/null	2007-11-21 18:00:15.874485932 -0500
++++ linux-2.6.23.noarch/drivers/net/wireless/rtl8180_dev.c	2007-12-04 15:37:19.000000000 -0500
+@@ -0,0 +1,1054 @@
 +
 +/*
 + * Linux device driver for RTL8180 / RTL8185
@@ -57,6 +281,8 @@
 +
 +#include "rtl8180.h"
 +#include "rtl8180_rtl8225.h"
++#include "rtl8180_sa2400.h"
++#include "rtl8180_max2820.h"
 +
 +MODULE_AUTHOR("Michael Wu <flamingice at sourmilk.net>");
 +MODULE_AUTHOR("Andrea Merello <andreamrl at tiscali.it>");
@@ -64,7 +290,14 @@
 +MODULE_LICENSE("GPL");
 +
 +static struct pci_device_id rtl8180_table[] __devinitdata = {
++	/* rtl8185 */
 +	{ PCI_DEVICE(PCI_VENDOR_ID_REALTEK, 0x8185) },
++
++	/* rtl8180 */
++	{ PCI_DEVICE(PCI_VENDOR_ID_REALTEK, 0x8180) },
++	{ PCI_DEVICE(0x1799, 0x6001) },
++	{ PCI_DEVICE(0x1799, 0x6020) },
++	{ PCI_DEVICE(PCI_VENDOR_ID_DLINK, 0x3300) },
 +	{ }
 +};
 +
@@ -256,10 +489,21 @@
 +	spin_lock_irqsave(&priv->lock, flags);
 +	idx = (ring->idx + skb_queue_len(&ring->queue)) % ring->entries;
 +	entry = &ring->desc[idx];
-+	/* TODO: calculate PLCP length - needed for rtl8180 */
++
 +	if (control->flags & IEEE80211_TXCTL_USE_RTS_CTS)
 +		entry->rts_duration =
 +			ieee80211_rts_duration(dev, priv->if_id, skb->len, control);
++
++	if (!priv->r8185) {
++		unsigned int remainder;
++
++		entry->plcp_len =
++			DIV_ROUND_UP(16 * (skb->len + 4), (control->rate->rate * 2) / 10);
++		remainder = (16 * (skb->len + 4)) % ((control->rate->rate * 2) / 10);
++		if (remainder > 0 && remainder <= 6)
++			entry->plcp_len |= 1 << 15;
++	}
++
 +	entry->tx_buf = cpu_to_le32(mapping);
 +	entry->frame_len = cpu_to_le32(skb->len);
 +	entry->flags2 = control->alt_retry_rate != -1 ?
@@ -276,6 +520,20 @@
 +	return 0;
 +}
 +
++void rtl8180_set_anaparam(struct rtl8180_priv *priv, u32 anaparam)
++{
++	u8 reg;
++
++	rtl818x_iowrite8(priv, &priv->map->EEPROM_CMD, RTL818X_EEPROM_CMD_CONFIG);
++	reg = rtl818x_ioread8(priv, &priv->map->CONFIG3);
++	rtl818x_iowrite8(priv, &priv->map->CONFIG3,
++		 reg | RTL818X_CONFIG3_ANAPARAM_WRITE);
++	rtl818x_iowrite32(priv, &priv->map->ANAPARAM, anaparam);
++	rtl818x_iowrite8(priv, &priv->map->CONFIG3,
++		 reg & ~RTL818X_CONFIG3_ANAPARAM_WRITE);
++	rtl818x_iowrite8(priv, &priv->map->EEPROM_CMD, RTL818X_EEPROM_CMD_NORMAL);
++}
++
 +static int rtl8180_init_hw(struct ieee80211_hw *dev)
 +{
 +	struct rtl8180_priv *priv = dev->priv;
@@ -318,16 +576,8 @@
 +
 +	rtl818x_iowrite8(priv, &priv->map->MSR, 0);
 +
-+	if (!priv->r8185) {
-+		rtl818x_iowrite8(priv, &priv->map->EEPROM_CMD, RTL818X_EEPROM_CMD_CONFIG);
-+		reg = rtl818x_ioread8(priv, &priv->map->CONFIG3);
-+		rtl818x_iowrite8(priv, &priv->map->CONFIG3,
-+				 reg | RTL818X_CONFIG3_ANAPARAM_WRITE);
-+		rtl818x_iowrite32(priv, &priv->map->ANAPARAM, priv->anaparam);
-+		rtl818x_iowrite8(priv, &priv->map->CONFIG3,
-+				 reg & ~RTL818X_CONFIG3_ANAPARAM_WRITE);
-+		rtl818x_iowrite8(priv, &priv->map->EEPROM_CMD, RTL818X_EEPROM_CMD_NORMAL);
-+	}
++	if (!priv->r8185)
++		rtl8180_set_anaparam(priv, priv->anaparam);
 +
 +	rtl818x_iowrite32(priv, &priv->map->RDSAR, priv->rx_ring_dma);
 +	rtl818x_iowrite32(priv, &priv->map->TBDA, priv->tx_ring[3].dma);
@@ -355,12 +605,9 @@
 +		rtl818x_iowrite8(priv, &priv->map->WPA_CONF, 0);
 +		rtl818x_iowrite8(priv, &priv->map->RATE_FALLBACK, 0x81);
 +		rtl818x_iowrite8(priv, &priv->map->RESP_RATE, (8 << 4) | 0);
-+	}
 +
-+	/* TODO: fix for rtl8180 */
-+	rtl818x_iowrite16(priv, &priv->map->BRSR, 0x01F3);
++		rtl818x_iowrite16(priv, &priv->map->BRSR, 0x01F3);
 +
-+	if (priv->r8185) {
 +		/* TODO: set ClkRun enable? necessary? */
 +		reg = rtl818x_ioread8(priv, &priv->map->GP_ENABLE);
 +		rtl818x_iowrite8(priv, &priv->map->GP_ENABLE, reg & ~(1 << 6));
@@ -368,6 +615,12 @@
 +		reg = rtl818x_ioread8(priv, &priv->map->CONFIG3);
 +		rtl818x_iowrite8(priv, &priv->map->CONFIG3, reg | (1 << 2));
 +		rtl818x_iowrite8(priv, &priv->map->EEPROM_CMD, RTL818X_EEPROM_CMD_NORMAL);
++	} else {
++		rtl818x_iowrite16(priv, &priv->map->BRSR, 0x1);
++		rtl818x_iowrite8(priv, &priv->map->SECURITY, 0);
++
++		rtl818x_iowrite8(priv, &priv->map->PHY_DELAY, 0x6);
++		rtl818x_iowrite8(priv, &priv->map->CARRIER_SENSE_COUNTER, 0x4C);
 +	}
 +
 +	priv->rf_init(dev);
@@ -895,23 +1148,29 @@
 +		break;
 +	case 3:
 +		rf_name = "Philips";
++		priv->rf_init = sa2400_rf_init;
++		priv->rf_stop = sa2400_rf_stop;
++		priv->rf_set_chan = sa2400_rf_set_channel;
 +		break;
 +	case 4:
 +		rf_name = "Maxim";
++		priv->rf_init = max2820_rf_init;
++		priv->rf_stop = max2820_rf_stop;
++		priv->rf_set_chan = max2820_rf_set_channel;
 +		break;
 +	case 5:
 +		rf_name = "GCT";
 +		break;
 +	case 9:
-+		if (rtl8225_is_z2(dev)) {
++		if (rtl8180_rtl8225_is_z2(dev)) {
 +			rf_name = "RTL8225z2";
-+			priv->rf_init = rtl8225z2_rf_init;
++			priv->rf_init = rtl8180_rtl8225z2_rf_init;
 +		} else {
 +			rf_name = "RTL8225";
-+			priv->rf_init = rtl8225_rf_init;
++			priv->rf_init = rtl8180_rtl8225_rf_init;
 +		}
-+		priv->rf_stop = rtl8225_rf_stop;
-+		priv->rf_set_chan = rtl8225_rf_set_channel;
++		priv->rf_stop = rtl8180_rtl8225_rf_stop;
++		priv->rf_set_chan = rtl8180_rtl8225_rf_set_channel;
 +		break;
 +	case 10:
 +		rf_name = "RTL8255";
@@ -928,13 +1187,13 @@
 +		goto err_iounmap;
 +	}
 +
-+	eeprom_93cx6_read(&eeprom, 0x19, &priv->rfparam);
 +	eeprom_93cx6_read(&eeprom, 0x17, &eeprom_val);
 +	priv->csthreshold = eeprom_val >> 8;
 +	if (!priv->r8185) {
 +		__le32 anaparam;
 +		eeprom_93cx6_multiread(&eeprom, 0xD, (__le16 *)&anaparam, 2);
 +		priv->anaparam = le32_to_cpu(anaparam);
++		eeprom_93cx6_read(&eeprom, 0x19, &priv->rfparam);
 +	}
 +
 +	eeprom_93cx6_multiread(&eeprom, 0x7, (__le16 *)dev->wiphy->perm_addr, 3);
@@ -1050,9 +1309,206 @@
 +
 +module_init(rtl8180_init);
 +module_exit(rtl8180_exit);
+diff -up /dev/null linux-2.6.23.noarch/drivers/net/wireless/rtl8180_sa2400.c
+--- /dev/null	2007-11-21 18:00:15.874485932 -0500
++++ linux-2.6.23.noarch/drivers/net/wireless/rtl8180_sa2400.c	2007-12-04 15:37:19.000000000 -0500
+@@ -0,0 +1,193 @@
++
++/*
++ * Radio tuning for Philips SA2400 on RTL8180
++ *
++ * Copyright 2007 Andrea Merello <andreamrl at tiscali.it>
++ *
++ * Code from the BSD driver and the rtl8181 project have been
++ * very useful to understand certain things
++ *
++ * I want to thanks the Authors of such projects and the Ndiswrapper
++ * project Authors.
++ *
++ * A special Big Thanks also is for all people who donated me cards,
++ * making possible the creation of the original rtl8180 driver
++ * from which this code is derived!
++ *
++ * This program is free software; you can redistribute it and/or modify
++ * it under the terms of the GNU General Public License version 2 as
++ * published by the Free Software Foundation.
++ */
++
++#include <linux/init.h>
++#include <linux/pci.h>
++#include <linux/delay.h>
++#include <net/mac80211.h>
++
++#include "rtl8180.h"
++#include "rtl8180_sa2400.h"
++
++static const u32 sa2400_chan[] = {
++	0x00096c, /* ch1 */
++	0x080970,
++	0x100974,
++	0x180978,
++	0x000980,
++	0x080984,
++	0x100988,
++	0x18098c,
++	0x000994,
++	0x080998,
++	0x10099c,
++	0x1809a0,
++	0x0009a8,
++	0x0009b4, /* ch 14 */
++};
++
++static void write_sa2400(struct ieee80211_hw *dev, u8 addr, u32 data)
++{
++	struct rtl8180_priv *priv = dev->priv;
++	u32 phy_config;
++
++	/* MAC will bang bits to the sa2400. sw 3-wire is NOT used */
++	phy_config = 0xb0000000;
++
++	phy_config |= ((u32)(addr & 0xf)) << 24;
++	phy_config |= data & 0xffffff;
++
++	rtl818x_iowrite32(priv,
++		(__le32 __iomem *) &priv->map->RFPinsOutput, phy_config);
++
++	msleep(3);
++}
++
++static void sa2400_write_phy_antenna(struct ieee80211_hw *dev, short chan)
++{
++	struct rtl8180_priv *priv = dev->priv;
++	u8 ant = SA2400_ANTENNA;
++
++	if (priv->rfparam & RF_PARAM_ANTBDEFAULT)
++		ant |= BB_ANTENNA_B;
++
++	if (chan == 14)
++		ant |= BB_ANTATTEN_CHAN14;
++
++	rtl8180_write_phy(dev, 0x10, ant);
++
++}
++
++void sa2400_rf_set_channel(struct ieee80211_hw *dev, struct ieee80211_conf *conf)
++{
++	struct rtl8180_priv *priv = dev->priv;
++	u32 txpw = priv->channels[conf->channel - 1].val & 0xFF;
++	u32 chan = sa2400_chan[conf->channel - 1];
++
++	write_sa2400(dev, 7, txpw);
++
++	sa2400_write_phy_antenna(dev, chan);
++
++	write_sa2400(dev, 0, chan);
++	write_sa2400(dev, 1, 0xbb50);
++	write_sa2400(dev, 2, 0x80);
++	write_sa2400(dev, 3, 0);
++}
++
++void sa2400_rf_stop(struct ieee80211_hw *dev)
++{
++	write_sa2400(dev, 4, 0);
++}
++
++void sa2400_rf_init(struct ieee80211_hw *dev)
++{
++	struct rtl8180_priv *priv = dev->priv;
++	u32 anaparam, txconf;
++	u8 firdac;
++	int analogphy = priv->rfparam & RF_PARAM_ANALOGPHY;
++
++	anaparam = priv->anaparam;
++	anaparam &= ~(1 << ANAPARAM_TXDACOFF_SHIFT);
++	anaparam &= ~ANAPARAM_PWR1_MASK;
++	anaparam &= ~ANAPARAM_PWR0_MASK;
++
++	if (analogphy) {
++		anaparam |= SA2400_ANA_ANAPARAM_PWR1_ON << ANAPARAM_PWR1_SHIFT;
++		firdac = 0;
++	} else {
++		anaparam |= (SA2400_DIG_ANAPARAM_PWR1_ON << ANAPARAM_PWR1_SHIFT);
++		anaparam |= (SA2400_ANAPARAM_PWR0_ON << ANAPARAM_PWR0_SHIFT);
++		firdac = 1 << SA2400_REG4_FIRDAC_SHIFT;
++	}
++
++	rtl8180_set_anaparam(priv, anaparam);
++
++	write_sa2400(dev, 0, sa2400_chan[0]);
++	write_sa2400(dev, 1, 0xbb50);
++	write_sa2400(dev, 2, 0x80);
++	write_sa2400(dev, 3, 0);
++	write_sa2400(dev, 4, 0x19340 | firdac);
++	write_sa2400(dev, 5, 0x1dfb | (SA2400_MAX_SENS - 54) << 15);
++	write_sa2400(dev, 4, 0x19348 | firdac); /* calibrate VCO */
++
++	if (!analogphy)
++		write_sa2400(dev, 4, 0x1938c); /*???*/
++
++	write_sa2400(dev, 4, 0x19340 | firdac);
++
++	write_sa2400(dev, 0, sa2400_chan[0]);
++	write_sa2400(dev, 1, 0xbb50);
++	write_sa2400(dev, 2, 0x80);
++	write_sa2400(dev, 3, 0);
++	write_sa2400(dev, 4, 0x19344 | firdac); /* calibrate filter */
++
++	/* new from rtl8180 embedded driver (rtl8181 project) */
++	write_sa2400(dev, 6, 0x13ff | (1 << 23)); /* MANRX */
++	write_sa2400(dev, 8, 0); /* VCO */
++
++	if (analogphy) {
++		rtl8180_set_anaparam(priv, anaparam |
++				     (1 << ANAPARAM_TXDACOFF_SHIFT));
++
++		txconf = rtl818x_ioread32(priv, &priv->map->TX_CONF);
++		rtl818x_iowrite32(priv, &priv->map->TX_CONF,
++			txconf | RTL818X_TX_CONF_LOOPBACK_CONT);
++
++		write_sa2400(dev, 4, 0x19341); /* calibrates DC */
++
++		/* a 5us sleep is required here,
++		 * we rely on the 3ms delay introduced in write_sa2400 */
++		write_sa2400(dev, 4, 0x19345);
++
++		/* a 20us sleep is required here,
++		 * we rely on the 3ms delay introduced in write_sa2400 */
++
++		rtl818x_iowrite32(priv, &priv->map->TX_CONF, txconf);
++
++		rtl8180_set_anaparam(priv, anaparam);
++	}
++	/* end new code */
++
++	write_sa2400(dev, 4, 0x19341 | firdac); /* RTX MODE */
++
++	/* baseband configuration */
++	rtl8180_write_phy(dev, 0, 0x98);
++	rtl8180_write_phy(dev, 3, 0x38);
++	rtl8180_write_phy(dev, 4, 0xe0);
++	rtl8180_write_phy(dev, 5, 0x90);
++	rtl8180_write_phy(dev, 6, 0x1a);
++	rtl8180_write_phy(dev, 7, 0x64);
++
++	sa2400_write_phy_antenna(dev, 1);
++
++	rtl8180_write_phy(dev, 0x11, 0x80);
++
++	if (rtl818x_ioread8(priv, &priv->map->CONFIG2) &
++	    RTL818X_CONFIG2_ANTENNA_DIV)
++		rtl8180_write_phy(dev, 0x12, 0xc7); /* enable ant diversity */
++	else
++		rtl8180_write_phy(dev, 0x12, 0x47); /* disable ant diversity */
++
++	rtl8180_write_phy(dev, 0x13, 0x90 | priv->csthreshold);
++
++	rtl8180_write_phy(dev, 0x19, 0x0);
++	rtl8180_write_phy(dev, 0x1a, 0xa0);
++}
 diff -up /dev/null linux-2.6.23.noarch/drivers/net/wireless/rtl8180_rtl8225.h
---- /dev/null	2007-11-12 23:12:46.917997680 -0500
-+++ linux-2.6.23.noarch/drivers/net/wireless/rtl8180_rtl8225.h	2007-11-21 14:23:21.000000000 -0500
+--- /dev/null	2007-11-21 18:00:15.874485932 -0500
++++ linux-2.6.23.noarch/drivers/net/wireless/rtl8180_rtl8225.h	2007-12-04 15:37:19.000000000 -0500
 @@ -0,0 +1,28 @@
 +#ifndef RTL8180_RTL8225_H
 +#define RTL8180_RTL8225_H
@@ -1062,29 +1518,63 @@
 +#define RTL8225_ANAPARAM_OFF	0xa00beb59
 +#define RTL8225_ANAPARAM2_OFF	0x840dec11
 +
-+int rtl8225_is_z2(struct ieee80211_hw *dev);
++int rtl8180_rtl8225_is_z2(struct ieee80211_hw *dev);
 +
-+void rtl8225_rf_init(struct ieee80211_hw *);
-+void rtl8225z2_rf_init(struct ieee80211_hw *);
-+void rtl8225_rf_stop(struct ieee80211_hw *);
-+void rtl8225_rf_set_channel(struct ieee80211_hw *, struct ieee80211_conf *);
++void rtl8180_rtl8225_rf_init(struct ieee80211_hw *);
++void rtl8180_rtl8225z2_rf_init(struct ieee80211_hw *);
++void rtl8180_rtl8225_rf_stop(struct ieee80211_hw *);
++void rtl8180_rtl8225_rf_set_channel(struct ieee80211_hw *, struct ieee80211_conf *);
 +
-+static inline void rtl8225_write_phy_ofdm(struct ieee80211_hw *dev,
++static inline void rtl8180_rtl8225_write_phy_ofdm(struct ieee80211_hw *dev,
 +					  u8 addr, u8 data)
 +{
 +	rtl8180_write_phy(dev, addr, data);
 +}
 +
-+static inline void rtl8225_write_phy_cck(struct ieee80211_hw *dev,
++static inline void rtl8180_rtl8225_write_phy_cck(struct ieee80211_hw *dev,
 +					 u8 addr, u8 data)
 +{
 +	rtl8180_write_phy(dev, addr, data | 0x10000);
 +}
 +
 +#endif /* RTL8180_RTL8225_H */
+diff -up /dev/null linux-2.6.23.noarch/drivers/net/wireless/rtl8180_max2820.h
+--- /dev/null	2007-11-21 18:00:15.874485932 -0500
++++ linux-2.6.23.noarch/drivers/net/wireless/rtl8180_max2820.h	2007-12-04 15:37:19.000000000 -0500
+@@ -0,0 +1,30 @@
++#ifndef RTL8180_MAX2820_H
++#define RTL8180_MAX2820_H
++
++/*
++ * Radio tuning for Maxim max2820 on RTL8180
++ *
++ * Copyright 2007 Andrea Merello <andreamrl at tiscali.it>
++ *
++ * Code from the BSD driver and the rtl8181 project have been
++ * very useful to understand certain things
++ *
++ * I want to thanks the Authors of such projects and the Ndiswrapper
++ * project Authors.
++ *
++ * A special Big Thanks also is for all people who donated me cards,
++ * making possible the creation of the original rtl8180 driver
++ * from which this code is derived!
++ *
++ * This program is free software; you can redistribute it and/or modify
++ * it under the terms of the GNU General Public License version 2 as
++ * published by the Free Software Foundation.
++ */
++
++#define MAXIM_ANTENNA 0xb3
++
++void max2820_rf_init(struct ieee80211_hw *);
++void max2820_rf_stop(struct ieee80211_hw *);
++void max2820_rf_set_channel(struct ieee80211_hw *, struct ieee80211_conf *);
++
++#endif /* RTL8180_MAX2820_H */
 diff -up linux-2.6.23.noarch/drivers/net/wireless/rtl818x.h.orig linux-2.6.23.noarch/drivers/net/wireless/rtl818x.h
---- linux-2.6.23.noarch/drivers/net/wireless/rtl818x.h.orig	2007-11-21 13:41:14.000000000 -0500
-+++ linux-2.6.23.noarch/drivers/net/wireless/rtl818x.h	2007-11-21 14:23:21.000000000 -0500
+--- linux-2.6.23.noarch/drivers/net/wireless/rtl818x.h.orig	2007-12-04 15:36:33.000000000 -0500
++++ linux-2.6.23.noarch/drivers/net/wireless/rtl818x.h	2007-12-04 15:37:19.000000000 -0500
 @@ -58,13 +58,17 @@ struct rtl818x_csr {
  #define RTL818X_INT_TX_FO		(1 << 15)
  	__le32	TX_CONF;
@@ -1124,17 +1614,27 @@
  	__le32	ANAPARAM;
  	u8	MSR;
  #define RTL818X_MSR_NO_LINK		(0 << 2)
-@@ -111,7 +120,8 @@ struct rtl818x_csr {
+@@ -104,14 +113,17 @@ struct rtl818x_csr {
+ #define RTL818X_CONFIG4_VCOOFF		(1 << 7)
+ 	u8	TESTR;
+ 	u8	reserved_9[2];
+-	__le16	PGSELECT;
++	u8	PGSELECT;
++	u8	SECURITY;
+ 	__le32	ANAPARAM2;
+ 	u8	reserved_10[12];
+ 	__le16	BEACON_INTERVAL;
  	__le16	ATIM_WND;
  	__le16	BEACON_INTERVAL_TIME;
  	__le16	ATIMTR_INTERVAL;
 -	u8	reserved_11[4];
-+	__le16	PHY_DELAY;
++	u8	PHY_DELAY;
++	u8	CARRIER_SENSE_COUNTER;
 +	u8	reserved_11[2];
  	u8	PHY[4];
  	__le16	RFPinsOutput;
  	__le16	RFPinsEnable;
-@@ -149,8 +159,10 @@ struct rtl818x_csr {
+@@ -149,8 +161,10 @@ struct rtl818x_csr {
  	u8	RETRY_CTR;
  	u8	reserved_18[5];
  	__le32	RDSAR;
@@ -1148,9 +1648,9 @@
  } __attribute__((packed));
  
 diff -up /dev/null linux-2.6.23.noarch/drivers/net/wireless/rtl8180_rtl8225.c
---- /dev/null	2007-11-12 23:12:46.917997680 -0500
-+++ linux-2.6.23.noarch/drivers/net/wireless/rtl8180_rtl8225.c	2007-11-21 14:23:21.000000000 -0500
-@@ -0,0 +1,777 @@
+--- /dev/null	2007-11-21 18:00:15.874485932 -0500
++++ linux-2.6.23.noarch/drivers/net/wireless/rtl8180_rtl8225.c	2007-12-04 15:37:19.000000000 -0500
+@@ -0,0 +1,765 @@
 +
 +/*
 + * Radio tuning for RTL8225 on RTL8180
@@ -1176,7 +1676,7 @@
 +#include "rtl8180.h"
 +#include "rtl8180_rtl8225.h"
 +
-+static void rtl8225_write(struct ieee80211_hw *dev, u8 addr, u16 data)
++static void rtl8180_rtl8225_write(struct ieee80211_hw *dev, u8 addr, u16 data)
 +{
 +	struct rtl8180_priv *priv = dev->priv;
 +	u16 reg80, reg84, reg82;
@@ -1224,7 +1724,7 @@
 +	rtl818x_iowrite16(priv, &priv->map->RFPinsEnable, 0x1FFF);
 +}
 +
-+static u16 rtl8225_read(struct ieee80211_hw *dev, u8 addr)
++static u16 rtl8180_rtl8225_read(struct ieee80211_hw *dev, u8 addr)
 +{
 +	struct rtl8180_priv *priv = dev->priv;
 +	u16 reg80, reg82, reg84, out;
@@ -1327,7 +1827,7 @@
 +	return out;
 +}
 +
-+static const u16 rtl8225bcd_rxgain[] = {
++static const u16 rtl8180_rtl8225bcd_rxgain[] = {
 +	0x0400, 0x0401, 0x0402, 0x0403, 0x0404, 0x0405, 0x0408, 0x0409,
 +	0x040a, 0x040b, 0x0502, 0x0503, 0x0504, 0x0505, 0x0540, 0x0541,
 +	0x0542, 0x0543, 0x0544, 0x0545, 0x0580, 0x0581, 0x0582, 0x0583,
@@ -1342,7 +1842,7 @@
 +	0x07b4, 0x07b5, 0x07b8, 0x07b9, 0x07ba, 0x07bb, 0x07bb
 +};
 +
-+static const u8 rtl8225_agc[] = {
++static const u8 rtl8180_rtl8225_agc[] = {
 +	0x9e, 0x9e, 0x9e, 0x9e, 0x9e, 0x9e, 0x9e, 0x9e,
 +	0x9d, 0x9c, 0x9b, 0x9a, 0x99, 0x98, 0x97, 0x96,
 +	0x95, 0x94, 0x93, 0x92, 0x91, 0x90, 0x8f, 0x8e,
@@ -1361,7 +1861,7 @@
 +	0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01
 +};
 +
-+static const u8 rtl8225_gain[] = {
++static const u8 rtl8180_rtl8225_gain[] = {
 +	0x23, 0x88, 0x7c, 0xa5, /* -82dbm */
 +	0x23, 0x88, 0x7c, 0xb5, /* -82dbm */
 +	0x23, 0x88, 0x7c, 0xc5, /* -82dbm */
@@ -1371,15 +1871,15 @@
 +	0x63, 0x58, 0x70, 0xc5, /* -66dbm */
 +};
 +
-+static const u8 rtl8225_threshold[] = {
++static const u8 rtl8180_rtl8225_threshold[] = {
 +	0x8d, 0x8d, 0x8d, 0x8d, 0x9d, 0xad, 0xbd
 +};
 +
-+static const u8 rtl8225_tx_gain_cck_ofdm[] = {
++static const u8 rtl8180_rtl8225_tx_gain_cck_ofdm[] = {
 +	0x02, 0x06, 0x0e, 0x1e, 0x3e, 0x7e
 +};
 +
-+static const u8 rtl8225_tx_power_cck[] = {
++static const u8 rtl8180_rtl8225_tx_power_cck[] = {
 +	0x18, 0x17, 0x15, 0x11, 0x0c, 0x08, 0x04, 0x02,
 +	0x1b, 0x1a, 0x17, 0x13, 0x0e, 0x09, 0x04, 0x02,
 +	0x1f, 0x1e, 0x1a, 0x15, 0x10, 0x0a, 0x05, 0x02,
@@ -1388,7 +1888,7 @@
 +	0x2b, 0x2a, 0x25, 0x1e, 0x16, 0x0e, 0x07, 0x03
 +};
 +
-+static const u8 rtl8225_tx_power_cck_ch14[] = {
++static const u8 rtl8180_rtl8225_tx_power_cck_ch14[] = {
 +	0x18, 0x17, 0x15, 0x0c, 0x00, 0x00, 0x00, 0x00,
 +	0x1b, 0x1a, 0x17, 0x0e, 0x00, 0x00, 0x00, 0x00,
 +	0x1f, 0x1e, 0x1a, 0x0f, 0x00, 0x00, 0x00, 0x00,
@@ -1397,16 +1897,16 @@
 +	0x2b, 0x2a, 0x25, 0x15, 0x00, 0x00, 0x00, 0x00
 +};
 +
-+static const u8 rtl8225_tx_power_ofdm[] = {
++static const u8 rtl8180_rtl8225_tx_power_ofdm[] = {
 +	0x80, 0x90, 0xa2, 0xb5, 0xcb, 0xe4
 +};
 +
-+static const u32 rtl8225_chan[] = {
++static const u32 rtl8180_rtl8225_chan[] = {
 +	0x085c, 0x08dc, 0x095c, 0x09dc, 0x0a5c, 0x0adc, 0x0b5c,
 +	0x0bdc, 0x0c5c, 0x0cdc, 0x0d5c, 0x0ddc, 0x0e5c, 0x0f72
 +};
 +
-+static void rtl8225_rf_set_tx_power(struct ieee80211_hw *dev, int channel)
++static void rtl8180_rtl8225_rf_set_tx_power(struct ieee80211_hw *dev, int channel)
 +{
 +	struct rtl8180_priv *priv = dev->priv;
 +	u8 cck_power, ofdm_power;
@@ -1414,22 +1914,22 @@
 +	u32 reg;
 +	int i;
 +
-+	cck_power = priv->channels[channel - 1].val & 0xF;
-+	ofdm_power = priv->channels[channel - 1].val >> 4;
++	cck_power = priv->channels[channel - 1].val & 0xFF;
++	ofdm_power = priv->channels[channel - 1].val >> 8;
 +
 +	cck_power = min(cck_power, (u8)35);
 +	ofdm_power = min(ofdm_power, (u8)35);
 +
 +	rtl818x_iowrite8(priv, &priv->map->TX_GAIN_CCK,
-+			 rtl8225_tx_gain_cck_ofdm[cck_power / 6] >> 1);
++			 rtl8180_rtl8225_tx_gain_cck_ofdm[cck_power / 6] >> 1);
 +
 +	if (channel == 14)
-+		tmp = &rtl8225_tx_power_cck_ch14[(cck_power % 6) * 8];
++		tmp = &rtl8180_rtl8225_tx_power_cck_ch14[(cck_power % 6) * 8];
 +	else
-+		tmp = &rtl8225_tx_power_cck[(cck_power % 6) * 8];
++		tmp = &rtl8180_rtl8225_tx_power_cck[(cck_power % 6) * 8];
 +
 +	for (i = 0; i < 8; i++)
-+		rtl8225_write_phy_cck(dev, 0x44 + i, *tmp++);
++		rtl8180_rtl8225_write_phy_cck(dev, 0x44 + i, *tmp++);
 +
 +	msleep(1); /* FIXME: optional? */
 +
@@ -1441,48 +1941,42 @@
 +	rtl818x_iowrite8(priv, &priv->map->CONFIG3, reg & ~RTL818X_CONFIG3_ANAPARAM_WRITE);
 +	rtl818x_iowrite8(priv, &priv->map->EEPROM_CMD, RTL818X_EEPROM_CMD_NORMAL);
 +
-+	rtl8225_write_phy_ofdm(dev, 2, 0x42);
-+	rtl8225_write_phy_ofdm(dev, 6, 0x00);
-+	rtl8225_write_phy_ofdm(dev, 8, 0x00);
++	rtl8180_rtl8225_write_phy_ofdm(dev, 2, 0x42);
++	rtl8180_rtl8225_write_phy_ofdm(dev, 6, 0x00);
++	rtl8180_rtl8225_write_phy_ofdm(dev, 8, 0x00);
 +
 +	rtl818x_iowrite8(priv, &priv->map->TX_GAIN_OFDM,
-+			 rtl8225_tx_gain_cck_ofdm[ofdm_power/6] >> 1);
++			 rtl8180_rtl8225_tx_gain_cck_ofdm[ofdm_power/6] >> 1);
 +
-+	tmp = &rtl8225_tx_power_ofdm[ofdm_power % 6];
++	tmp = &rtl8180_rtl8225_tx_power_ofdm[ofdm_power % 6];
 +
-+	rtl8225_write_phy_ofdm(dev, 5, *tmp);
-+	rtl8225_write_phy_ofdm(dev, 7, *tmp);
++	rtl8180_rtl8225_write_phy_ofdm(dev, 5, *tmp);
++	rtl8180_rtl8225_write_phy_ofdm(dev, 7, *tmp);
 +
 +	msleep(1);
 +}
 +
-+int rtl8225_is_z2(struct ieee80211_hw *dev)
++int rtl8180_rtl8225_is_z2(struct ieee80211_hw *dev)
 +{
 +	int z2 = 0;
 +
-+	rtl8225_write(dev, 0, 0x1B7);
-+	rtl8225_read(dev, 0);
++	rtl8180_rtl8225_write(dev, 0, 0x1B7);
++	rtl8180_rtl8225_read(dev, 0);
 +
-+	if (rtl8225_read(dev, 8) == 0x588 && rtl8225_read(dev, 9) == 0x700)
++	if (rtl8180_rtl8225_read(dev, 8) == 0x588 && rtl8180_rtl8225_read(dev, 9) == 0x700)
 +		z2 = 1;
 +
-+	rtl8225_write(dev, 0, 0x0B7);
++	rtl8180_rtl8225_write(dev, 0, 0x0B7);
 +
 +	return z2;
 +}
 +
-+void rtl8225_rf_init(struct ieee80211_hw *dev)
++void rtl8180_rtl8225_rf_init(struct ieee80211_hw *dev)
 +{
 +	struct rtl8180_priv *priv = dev->priv;
 +	int i;
-+	u8 reg;
 +
-+	rtl818x_iowrite8(priv, &priv->map->EEPROM_CMD, RTL818X_EEPROM_CMD_CONFIG);
-+	reg = rtl818x_ioread8(priv, &priv->map->CONFIG3);
-+	rtl818x_iowrite8(priv, &priv->map->CONFIG3, reg | RTL818X_CONFIG3_ANAPARAM_WRITE);
-+	rtl818x_iowrite32(priv, &priv->map->ANAPARAM, RTL8225_ANAPARAM_ON);
-+	rtl818x_iowrite8(priv, &priv->map->CONFIG3, reg & ~RTL818X_CONFIG3_ANAPARAM_WRITE);
-+	rtl818x_iowrite8(priv, &priv->map->EEPROM_CMD, RTL818X_EEPROM_CMD_NORMAL);
++	rtl8180_set_anaparam(priv, RTL8225_ANAPARAM_ON);
 +
 +	/* host_pci_init */
 +	rtl818x_iowrite16(priv, &priv->map->RFPinsOutput, 0x0480);
@@ -1503,123 +1997,123 @@
 +	rtl818x_iowrite8(priv, &priv->map->CONFIG3, 0x44);
 +	rtl818x_iowrite8(priv, &priv->map->EEPROM_CMD, RTL818X_EEPROM_CMD_NORMAL);
 +
-+	rtl8225_write(dev, 0x0, 0x067);
-+	rtl8225_write(dev, 0x1, 0xFE0);
-+	rtl8225_write(dev, 0x2, 0x44D);
-+	rtl8225_write(dev, 0x3, 0x441);
-+	rtl8225_write(dev, 0x4, 0x8BE);
-+	rtl8225_write(dev, 0x5, 0xBF0);		/* TODO: minipci */
-+	rtl8225_write(dev, 0x6, 0xAE6);
-+	rtl8225_write(dev, 0x7, rtl8225_chan[0]);
-+	rtl8225_write(dev, 0x8, 0x01F);
-+	rtl8225_write(dev, 0x9, 0x334);
-+	rtl8225_write(dev, 0xA, 0xFD4);
-+	rtl8225_write(dev, 0xB, 0x391);
-+	rtl8225_write(dev, 0xC, 0x050);
-+	rtl8225_write(dev, 0xD, 0x6DB);
-+	rtl8225_write(dev, 0xE, 0x029);
-+	rtl8225_write(dev, 0xF, 0x914); msleep(1);
-+
-+	rtl8225_write(dev, 0x2, 0xC4D); msleep(100);
-+
-+	rtl8225_write(dev, 0x0, 0x127);
-+
-+	for (i = 0; i < ARRAY_SIZE(rtl8225bcd_rxgain); i++) {
-+		rtl8225_write(dev, 0x1, i + 1);
-+		rtl8225_write(dev, 0x2, rtl8225bcd_rxgain[i]);
++	rtl8180_rtl8225_write(dev, 0x0, 0x067);
++	rtl8180_rtl8225_write(dev, 0x1, 0xFE0);
++	rtl8180_rtl8225_write(dev, 0x2, 0x44D);
++	rtl8180_rtl8225_write(dev, 0x3, 0x441);
++	rtl8180_rtl8225_write(dev, 0x4, 0x8BE);
++	rtl8180_rtl8225_write(dev, 0x5, 0xBF0);		/* TODO: minipci */
++	rtl8180_rtl8225_write(dev, 0x6, 0xAE6);
++	rtl8180_rtl8225_write(dev, 0x7, rtl8180_rtl8225_chan[0]);
++	rtl8180_rtl8225_write(dev, 0x8, 0x01F);
++	rtl8180_rtl8225_write(dev, 0x9, 0x334);
++	rtl8180_rtl8225_write(dev, 0xA, 0xFD4);
++	rtl8180_rtl8225_write(dev, 0xB, 0x391);
++	rtl8180_rtl8225_write(dev, 0xC, 0x050);
++	rtl8180_rtl8225_write(dev, 0xD, 0x6DB);
++	rtl8180_rtl8225_write(dev, 0xE, 0x029);
++	rtl8180_rtl8225_write(dev, 0xF, 0x914); msleep(1);
++
++	rtl8180_rtl8225_write(dev, 0x2, 0xC4D); msleep(100);
++
++	rtl8180_rtl8225_write(dev, 0x0, 0x127);
++
++	for (i = 0; i < ARRAY_SIZE(rtl8180_rtl8225bcd_rxgain); i++) {
++		rtl8180_rtl8225_write(dev, 0x1, i + 1);
++		rtl8180_rtl8225_write(dev, 0x2, rtl8180_rtl8225bcd_rxgain[i]);
 +	}
 +
-+	rtl8225_write(dev, 0x0, 0x027);
-+	rtl8225_write(dev, 0x0, 0x22F);
++	rtl8180_rtl8225_write(dev, 0x0, 0x027);
++	rtl8180_rtl8225_write(dev, 0x0, 0x22F);
 +	rtl818x_iowrite16(priv, &priv->map->RFPinsEnable, 0x1FFF);
 +
-+	for (i = 0; i < ARRAY_SIZE(rtl8225_agc); i++) {
-+		rtl8225_write_phy_ofdm(dev, 0xB, rtl8225_agc[i]);
++	for (i = 0; i < ARRAY_SIZE(rtl8180_rtl8225_agc); i++) {
++		rtl8180_rtl8225_write_phy_ofdm(dev, 0xB, rtl8180_rtl8225_agc[i]);
 +		msleep(1);
-+		rtl8225_write_phy_ofdm(dev, 0xA, 0x80 + i);
++		rtl8180_rtl8225_write_phy_ofdm(dev, 0xA, 0x80 + i);
 +		msleep(1);
 +	}
 +
 +	msleep(1);
 +
-+	rtl8225_write_phy_ofdm(dev, 0x00, 0x01); msleep(1);
-+	rtl8225_write_phy_ofdm(dev, 0x01, 0x02); msleep(1);
-+	rtl8225_write_phy_ofdm(dev, 0x02, 0x62); msleep(1);
-+	rtl8225_write_phy_ofdm(dev, 0x03, 0x00); msleep(1);
-+	rtl8225_write_phy_ofdm(dev, 0x04, 0x00); msleep(1);
-+	rtl8225_write_phy_ofdm(dev, 0x05, 0x00); msleep(1);
-+	rtl8225_write_phy_ofdm(dev, 0x06, 0x40); msleep(1);
-+	rtl8225_write_phy_ofdm(dev, 0x07, 0x00); msleep(1);
-+	rtl8225_write_phy_ofdm(dev, 0x08, 0x40); msleep(1);
-+	rtl8225_write_phy_ofdm(dev, 0x09, 0xfe); msleep(1);
-+	rtl8225_write_phy_ofdm(dev, 0x0a, 0x09); msleep(1);
-+	rtl8225_write_phy_ofdm(dev, 0x0b, 0x80); msleep(1);
-+	rtl8225_write_phy_ofdm(dev, 0x0c, 0x01); msleep(1);
-+	rtl8225_write_phy_ofdm(dev, 0x0e, 0xd3); msleep(1);
-+	rtl8225_write_phy_ofdm(dev, 0x0f, 0x38); msleep(1);
-+	rtl8225_write_phy_ofdm(dev, 0x10, 0x84); msleep(1);
-+	rtl8225_write_phy_ofdm(dev, 0x11, 0x06); msleep(1);
-+	rtl8225_write_phy_ofdm(dev, 0x12, 0x20); msleep(1);
-+	rtl8225_write_phy_ofdm(dev, 0x13, 0x20); msleep(1);
-+	rtl8225_write_phy_ofdm(dev, 0x14, 0x00); msleep(1);
-+	rtl8225_write_phy_ofdm(dev, 0x15, 0x40); msleep(1);
-+	rtl8225_write_phy_ofdm(dev, 0x16, 0x00); msleep(1);
-+	rtl8225_write_phy_ofdm(dev, 0x17, 0x40); msleep(1);
-+	rtl8225_write_phy_ofdm(dev, 0x18, 0xef); msleep(1);
-+	rtl8225_write_phy_ofdm(dev, 0x19, 0x19); msleep(1);
-+	rtl8225_write_phy_ofdm(dev, 0x1a, 0x20); msleep(1);
-+	rtl8225_write_phy_ofdm(dev, 0x1b, 0x76); msleep(1);
-+	rtl8225_write_phy_ofdm(dev, 0x1c, 0x04); msleep(1);
-+	rtl8225_write_phy_ofdm(dev, 0x1e, 0x95); msleep(1);
-+	rtl8225_write_phy_ofdm(dev, 0x1f, 0x75); msleep(1);
-+	rtl8225_write_phy_ofdm(dev, 0x20, 0x1f); msleep(1);
-+	rtl8225_write_phy_ofdm(dev, 0x21, 0x27); msleep(1);
-+	rtl8225_write_phy_ofdm(dev, 0x22, 0x16); msleep(1);
-+	rtl8225_write_phy_ofdm(dev, 0x24, 0x46); msleep(1);
-+	rtl8225_write_phy_ofdm(dev, 0x25, 0x20); msleep(1);
-+	rtl8225_write_phy_ofdm(dev, 0x26, 0x90); msleep(1);
-+	rtl8225_write_phy_ofdm(dev, 0x27, 0x88); msleep(1);
-+
-+	rtl8225_write_phy_ofdm(dev, 0x0d, rtl8225_gain[1 * 4]);
-+	rtl8225_write_phy_ofdm(dev, 0x1b, rtl8225_gain[1 * 4 + 2]);
-+	rtl8225_write_phy_ofdm(dev, 0x1d, rtl8225_gain[1 * 4 + 3]);
-+	rtl8225_write_phy_ofdm(dev, 0x23, rtl8225_gain[1 * 4 + 1]);
-+
-+	rtl8225_write_phy_cck(dev, 0x00, 0x98); msleep(1);
-+	rtl8225_write_phy_cck(dev, 0x03, 0x20); msleep(1);
-+	rtl8225_write_phy_cck(dev, 0x04, 0x7e); msleep(1);
-+	rtl8225_write_phy_cck(dev, 0x05, 0x12); msleep(1);
-+	rtl8225_write_phy_cck(dev, 0x06, 0xfc); msleep(1);
-+	rtl8225_write_phy_cck(dev, 0x07, 0x78); msleep(1);
-+	rtl8225_write_phy_cck(dev, 0x08, 0x2e); msleep(1);
-+	rtl8225_write_phy_cck(dev, 0x10, 0x93); msleep(1);
-+	rtl8225_write_phy_cck(dev, 0x11, 0x88); msleep(1);
-+	rtl8225_write_phy_cck(dev, 0x12, 0x47); msleep(1);
-+	rtl8225_write_phy_cck(dev, 0x13, 0xd0);
-+	rtl8225_write_phy_cck(dev, 0x19, 0x00);
-+	rtl8225_write_phy_cck(dev, 0x1a, 0xa0);
-+	rtl8225_write_phy_cck(dev, 0x1b, 0x08);
-+	rtl8225_write_phy_cck(dev, 0x40, 0x86);
-+	rtl8225_write_phy_cck(dev, 0x41, 0x8d); msleep(1);
-+	rtl8225_write_phy_cck(dev, 0x42, 0x15); msleep(1);
-+	rtl8225_write_phy_cck(dev, 0x43, 0x18); msleep(1);
-+	rtl8225_write_phy_cck(dev, 0x44, 0x1f); msleep(1);
-+	rtl8225_write_phy_cck(dev, 0x45, 0x1e); msleep(1);
-+	rtl8225_write_phy_cck(dev, 0x46, 0x1a); msleep(1);
-+	rtl8225_write_phy_cck(dev, 0x47, 0x15); msleep(1);
-+	rtl8225_write_phy_cck(dev, 0x48, 0x10); msleep(1);
-+	rtl8225_write_phy_cck(dev, 0x49, 0x0a); msleep(1);
-+	rtl8225_write_phy_cck(dev, 0x4a, 0x05); msleep(1);
-+	rtl8225_write_phy_cck(dev, 0x4b, 0x02); msleep(1);
-+	rtl8225_write_phy_cck(dev, 0x4c, 0x05); msleep(1);
++	rtl8180_rtl8225_write_phy_ofdm(dev, 0x00, 0x01); msleep(1);
++	rtl8180_rtl8225_write_phy_ofdm(dev, 0x01, 0x02); msleep(1);
++	rtl8180_rtl8225_write_phy_ofdm(dev, 0x02, 0x62); msleep(1);
++	rtl8180_rtl8225_write_phy_ofdm(dev, 0x03, 0x00); msleep(1);
++	rtl8180_rtl8225_write_phy_ofdm(dev, 0x04, 0x00); msleep(1);
++	rtl8180_rtl8225_write_phy_ofdm(dev, 0x05, 0x00); msleep(1);
++	rtl8180_rtl8225_write_phy_ofdm(dev, 0x06, 0x40); msleep(1);
++	rtl8180_rtl8225_write_phy_ofdm(dev, 0x07, 0x00); msleep(1);
++	rtl8180_rtl8225_write_phy_ofdm(dev, 0x08, 0x40); msleep(1);
++	rtl8180_rtl8225_write_phy_ofdm(dev, 0x09, 0xfe); msleep(1);
++	rtl8180_rtl8225_write_phy_ofdm(dev, 0x0a, 0x09); msleep(1);
++	rtl8180_rtl8225_write_phy_ofdm(dev, 0x0b, 0x80); msleep(1);
++	rtl8180_rtl8225_write_phy_ofdm(dev, 0x0c, 0x01); msleep(1);
++	rtl8180_rtl8225_write_phy_ofdm(dev, 0x0e, 0xd3); msleep(1);
++	rtl8180_rtl8225_write_phy_ofdm(dev, 0x0f, 0x38); msleep(1);
++	rtl8180_rtl8225_write_phy_ofdm(dev, 0x10, 0x84); msleep(1);
++	rtl8180_rtl8225_write_phy_ofdm(dev, 0x11, 0x06); msleep(1);
++	rtl8180_rtl8225_write_phy_ofdm(dev, 0x12, 0x20); msleep(1);
++	rtl8180_rtl8225_write_phy_ofdm(dev, 0x13, 0x20); msleep(1);
++	rtl8180_rtl8225_write_phy_ofdm(dev, 0x14, 0x00); msleep(1);
++	rtl8180_rtl8225_write_phy_ofdm(dev, 0x15, 0x40); msleep(1);
++	rtl8180_rtl8225_write_phy_ofdm(dev, 0x16, 0x00); msleep(1);
++	rtl8180_rtl8225_write_phy_ofdm(dev, 0x17, 0x40); msleep(1);
++	rtl8180_rtl8225_write_phy_ofdm(dev, 0x18, 0xef); msleep(1);
++	rtl8180_rtl8225_write_phy_ofdm(dev, 0x19, 0x19); msleep(1);
++	rtl8180_rtl8225_write_phy_ofdm(dev, 0x1a, 0x20); msleep(1);
++	rtl8180_rtl8225_write_phy_ofdm(dev, 0x1b, 0x76); msleep(1);
++	rtl8180_rtl8225_write_phy_ofdm(dev, 0x1c, 0x04); msleep(1);
++	rtl8180_rtl8225_write_phy_ofdm(dev, 0x1e, 0x95); msleep(1);
++	rtl8180_rtl8225_write_phy_ofdm(dev, 0x1f, 0x75); msleep(1);
++	rtl8180_rtl8225_write_phy_ofdm(dev, 0x20, 0x1f); msleep(1);
++	rtl8180_rtl8225_write_phy_ofdm(dev, 0x21, 0x27); msleep(1);
++	rtl8180_rtl8225_write_phy_ofdm(dev, 0x22, 0x16); msleep(1);
++	rtl8180_rtl8225_write_phy_ofdm(dev, 0x24, 0x46); msleep(1);
++	rtl8180_rtl8225_write_phy_ofdm(dev, 0x25, 0x20); msleep(1);
++	rtl8180_rtl8225_write_phy_ofdm(dev, 0x26, 0x90); msleep(1);
++	rtl8180_rtl8225_write_phy_ofdm(dev, 0x27, 0x88); msleep(1);
++
++	rtl8180_rtl8225_write_phy_ofdm(dev, 0x0d, rtl8180_rtl8225_gain[1 * 4]);
++	rtl8180_rtl8225_write_phy_ofdm(dev, 0x1b, rtl8180_rtl8225_gain[1 * 4 + 2]);
++	rtl8180_rtl8225_write_phy_ofdm(dev, 0x1d, rtl8180_rtl8225_gain[1 * 4 + 3]);
++	rtl8180_rtl8225_write_phy_ofdm(dev, 0x23, rtl8180_rtl8225_gain[1 * 4 + 1]);
++
++	rtl8180_rtl8225_write_phy_cck(dev, 0x00, 0x98); msleep(1);
++	rtl8180_rtl8225_write_phy_cck(dev, 0x03, 0x20); msleep(1);
++	rtl8180_rtl8225_write_phy_cck(dev, 0x04, 0x7e); msleep(1);
++	rtl8180_rtl8225_write_phy_cck(dev, 0x05, 0x12); msleep(1);
++	rtl8180_rtl8225_write_phy_cck(dev, 0x06, 0xfc); msleep(1);
++	rtl8180_rtl8225_write_phy_cck(dev, 0x07, 0x78); msleep(1);
++	rtl8180_rtl8225_write_phy_cck(dev, 0x08, 0x2e); msleep(1);
++	rtl8180_rtl8225_write_phy_cck(dev, 0x10, 0x93); msleep(1);
++	rtl8180_rtl8225_write_phy_cck(dev, 0x11, 0x88); msleep(1);
++	rtl8180_rtl8225_write_phy_cck(dev, 0x12, 0x47); msleep(1);
++	rtl8180_rtl8225_write_phy_cck(dev, 0x13, 0xd0);
++	rtl8180_rtl8225_write_phy_cck(dev, 0x19, 0x00);
++	rtl8180_rtl8225_write_phy_cck(dev, 0x1a, 0xa0);
++	rtl8180_rtl8225_write_phy_cck(dev, 0x1b, 0x08);
++	rtl8180_rtl8225_write_phy_cck(dev, 0x40, 0x86);
++	rtl8180_rtl8225_write_phy_cck(dev, 0x41, 0x8d); msleep(1);
++	rtl8180_rtl8225_write_phy_cck(dev, 0x42, 0x15); msleep(1);
++	rtl8180_rtl8225_write_phy_cck(dev, 0x43, 0x18); msleep(1);
++	rtl8180_rtl8225_write_phy_cck(dev, 0x44, 0x1f); msleep(1);
++	rtl8180_rtl8225_write_phy_cck(dev, 0x45, 0x1e); msleep(1);
++	rtl8180_rtl8225_write_phy_cck(dev, 0x46, 0x1a); msleep(1);
++	rtl8180_rtl8225_write_phy_cck(dev, 0x47, 0x15); msleep(1);
++	rtl8180_rtl8225_write_phy_cck(dev, 0x48, 0x10); msleep(1);
++	rtl8180_rtl8225_write_phy_cck(dev, 0x49, 0x0a); msleep(1);
++	rtl8180_rtl8225_write_phy_cck(dev, 0x4a, 0x05); msleep(1);
++	rtl8180_rtl8225_write_phy_cck(dev, 0x4b, 0x02); msleep(1);
++	rtl8180_rtl8225_write_phy_cck(dev, 0x4c, 0x05); msleep(1);
 +
 +	rtl818x_iowrite8(priv, &priv->map->TESTR, 0x0D); msleep(1);
 +
-+	rtl8225_rf_set_tx_power(dev, 1);
++	rtl8180_rtl8225_rf_set_tx_power(dev, 1);
 +
 +	/* RX antenna default to A */
-+	rtl8225_write_phy_cck(dev, 0x10, 0x9b); msleep(1);	/* B: 0xDB */
-+	rtl8225_write_phy_ofdm(dev, 0x26, 0x90); msleep(1);	/* B: 0x10 */
++	rtl8180_rtl8225_write_phy_cck(dev, 0x10, 0x9b); msleep(1);	/* B: 0xDB */
++	rtl8180_rtl8225_write_phy_ofdm(dev, 0x26, 0x90); msleep(1);	/* B: 0x10 */
 +
 +	rtl818x_iowrite8(priv, &priv->map->TX_ANTENNA, 0x03);	/* B: 0x00 */
 +	msleep(1);
@@ -1627,51 +2121,51 @@
 +	rtl818x_iowrite16(priv, &priv->map->RFPinsEnable, 0x1FFF);
 +
 +	/* set sensitivity */
-+	rtl8225_write(dev, 0x0c, 0x50);
-+	rtl8225_write_phy_ofdm(dev, 0x0d, rtl8225_gain[1 * 4]);
-+	rtl8225_write_phy_ofdm(dev, 0x1b, rtl8225_gain[1 * 4 + 2]);
-+	rtl8225_write_phy_ofdm(dev, 0x1d, rtl8225_gain[1 * 4 + 3]);
-+	rtl8225_write_phy_ofdm(dev, 0x23, rtl8225_gain[1 * 4 + 1]);
-+	rtl8225_write_phy_cck(dev, 0x41, rtl8225_threshold[2]);
++	rtl8180_rtl8225_write(dev, 0x0c, 0x50);
++	rtl8180_rtl8225_write_phy_ofdm(dev, 0x0d, rtl8180_rtl8225_gain[1 * 4]);
++	rtl8180_rtl8225_write_phy_ofdm(dev, 0x1b, rtl8180_rtl8225_gain[1 * 4 + 2]);
++	rtl8180_rtl8225_write_phy_ofdm(dev, 0x1d, rtl8180_rtl8225_gain[1 * 4 + 3]);
++	rtl8180_rtl8225_write_phy_ofdm(dev, 0x23, rtl8180_rtl8225_gain[1 * 4 + 1]);
++	rtl8180_rtl8225_write_phy_cck(dev, 0x41, rtl8180_rtl8225_threshold[2]);
 +}
 +
-+static const u8 rtl8225z2_tx_power_cck_ch14[] = {
++static const u8 rtl8180_rtl8225z2_tx_power_cck_ch14[] = {
 +	0x36, 0x35, 0x2e, 0x1b, 0x00, 0x00, 0x00, 0x00
 +};
 +
-+static const u8 rtl8225z2_tx_power_cck_B[] = {
++static const u8 rtl8180_rtl8225z2_tx_power_cck_B[] = {
 +	0x30, 0x2f, 0x29, 0x21, 0x19, 0x10, 0x08, 0x04
 +};
 +
-+static const u8 rtl8225z2_tx_power_cck_A[] = {
++static const u8 rtl8180_rtl8225z2_tx_power_cck_A[] = {
 +	0x33, 0x32, 0x2b, 0x23, 0x1a, 0x11, 0x08, 0x04
 +};
 +
-+static const u8 rtl8225z2_tx_power_cck[] = {
++static const u8 rtl8180_rtl8225z2_tx_power_cck[] = {
 +	0x36, 0x35, 0x2e, 0x25, 0x1c, 0x12, 0x09, 0x04
 +};
 +
-+static void rtl8225z2_rf_set_tx_power(struct ieee80211_hw *dev, int channel)
++static void rtl8180_rtl8225z2_rf_set_tx_power(struct ieee80211_hw *dev, int channel)
 +{
 +	struct rtl8180_priv *priv = dev->priv;
 +	u8 cck_power, ofdm_power;
 +	const u8 *tmp;
 +	int i;
 +
-+	cck_power = priv->channels[channel - 1].val & 0xF;
-+	ofdm_power = priv->channels[channel - 1].val >> 4;
++	cck_power = priv->channels[channel - 1].val & 0xFF;
++	ofdm_power = priv->channels[channel - 1].val >> 8;
 +
 +	if (channel == 14)
-+		tmp = rtl8225z2_tx_power_cck_ch14;
++		tmp = rtl8180_rtl8225z2_tx_power_cck_ch14;
 +	else if (cck_power == 12)
-+		tmp = rtl8225z2_tx_power_cck_B;
++		tmp = rtl8180_rtl8225z2_tx_power_cck_B;
 +	else if (cck_power == 13)
-+		tmp = rtl8225z2_tx_power_cck_A;
++		tmp = rtl8180_rtl8225z2_tx_power_cck_A;
 +	else
-+		tmp = rtl8225z2_tx_power_cck;
++		tmp = rtl8180_rtl8225z2_tx_power_cck;
 +
 +	for (i = 0; i < 8; i++)
-+		rtl8225_write_phy_cck(dev, 0x44 + i, *tmp++);
++		rtl8180_rtl8225_write_phy_cck(dev, 0x44 + i, *tmp++);
 +
 +	cck_power = min(cck_power, (u8)35);
 +	if (cck_power == 13 || cck_power == 14)
@@ -1686,16 +2180,16 @@
 +	ofdm_power = min(ofdm_power, (u8)35);
 +	rtl818x_iowrite8(priv, &priv->map->TX_GAIN_OFDM, ofdm_power);
 +
-+	rtl8225_write_phy_ofdm(dev, 2, 0x42);
-+	rtl8225_write_phy_ofdm(dev, 5, 0x00);
-+	rtl8225_write_phy_ofdm(dev, 6, 0x40);
-+	rtl8225_write_phy_ofdm(dev, 7, 0x00);
-+	rtl8225_write_phy_ofdm(dev, 8, 0x40);
++	rtl8180_rtl8225_write_phy_ofdm(dev, 2, 0x42);
++	rtl8180_rtl8225_write_phy_ofdm(dev, 5, 0x00);
++	rtl8180_rtl8225_write_phy_ofdm(dev, 6, 0x40);
++	rtl8180_rtl8225_write_phy_ofdm(dev, 7, 0x00);
++	rtl8180_rtl8225_write_phy_ofdm(dev, 8, 0x40);
 +
 +	msleep(1);
 +}
 +
-+static const u16 rtl8225z2_rxgain[] = {
++static const u16 rtl8180_rtl8225z2_rxgain[] = {
 +	0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0008, 0x0009,
 +	0x000a, 0x000b, 0x0102, 0x0103, 0x0104, 0x0105, 0x0140, 0x0141,
 +	0x0142, 0x0143, 0x0144, 0x0145, 0x0180, 0x0181, 0x0182, 0x0183,
@@ -1710,18 +2204,12 @@
 +	0x03b4, 0x03b5, 0x03b8, 0x03b9, 0x03ba, 0x03bb, 0x03bb
 +};
 +
-+void rtl8225z2_rf_init(struct ieee80211_hw *dev)
++void rtl8180_rtl8225z2_rf_init(struct ieee80211_hw *dev)
 +{
 +	struct rtl8180_priv *priv = dev->priv;
 +	int i;
-+	u8 reg;
 +
-+	rtl818x_iowrite8(priv, &priv->map->EEPROM_CMD, RTL818X_EEPROM_CMD_CONFIG);
-+	reg = rtl818x_ioread8(priv, &priv->map->CONFIG3);
-+	rtl818x_iowrite8(priv, &priv->map->CONFIG3, reg | RTL818X_CONFIG3_ANAPARAM_WRITE);
-+	rtl818x_iowrite32(priv, &priv->map->ANAPARAM, RTL8225_ANAPARAM_ON);
-+	rtl818x_iowrite8(priv, &priv->map->CONFIG3, reg & ~RTL818X_CONFIG3_ANAPARAM_WRITE);
-+	rtl818x_iowrite8(priv, &priv->map->EEPROM_CMD, RTL818X_EEPROM_CMD_NORMAL);
++	rtl8180_set_anaparam(priv, RTL8225_ANAPARAM_ON);
 +
 +	/* host_pci_init */
 +	rtl818x_iowrite16(priv, &priv->map->RFPinsOutput, 0x0480);
@@ -1744,140 +2232,140 @@
 +
 +	rtl818x_iowrite16(priv, &priv->map->RFPinsEnable, 0x1FFF);
 +
-+	rtl8225_write(dev, 0x0, 0x0B7); msleep(1);
-+	rtl8225_write(dev, 0x1, 0xEE0); msleep(1);
-+	rtl8225_write(dev, 0x2, 0x44D); msleep(1);
-+	rtl8225_write(dev, 0x3, 0x441); msleep(1);
-+	rtl8225_write(dev, 0x4, 0x8C3); msleep(1);
-+	rtl8225_write(dev, 0x5, 0xC72); msleep(1);
-+	rtl8225_write(dev, 0x6, 0x0E6); msleep(1);
-+	rtl8225_write(dev, 0x7, 0x82A); msleep(1);
-+	rtl8225_write(dev, 0x8, 0x03F); msleep(1);
-+	rtl8225_write(dev, 0x9, 0x335); msleep(1);
-+	rtl8225_write(dev, 0xa, 0x9D4); msleep(1);
-+	rtl8225_write(dev, 0xb, 0x7BB); msleep(1);
-+	rtl8225_write(dev, 0xc, 0x850); msleep(1);
-+	rtl8225_write(dev, 0xd, 0xCDF); msleep(1);
-+	rtl8225_write(dev, 0xe, 0x02B); msleep(1);
-+	rtl8225_write(dev, 0xf, 0x114); msleep(100);
++	rtl8180_rtl8225_write(dev, 0x0, 0x0B7); msleep(1);
++	rtl8180_rtl8225_write(dev, 0x1, 0xEE0); msleep(1);
++	rtl8180_rtl8225_write(dev, 0x2, 0x44D); msleep(1);
++	rtl8180_rtl8225_write(dev, 0x3, 0x441); msleep(1);
++	rtl8180_rtl8225_write(dev, 0x4, 0x8C3); msleep(1);
++	rtl8180_rtl8225_write(dev, 0x5, 0xC72); msleep(1);
++	rtl8180_rtl8225_write(dev, 0x6, 0x0E6); msleep(1);
++	rtl8180_rtl8225_write(dev, 0x7, 0x82A); msleep(1);
++	rtl8180_rtl8225_write(dev, 0x8, 0x03F); msleep(1);
++	rtl8180_rtl8225_write(dev, 0x9, 0x335); msleep(1);
++	rtl8180_rtl8225_write(dev, 0xa, 0x9D4); msleep(1);
++	rtl8180_rtl8225_write(dev, 0xb, 0x7BB); msleep(1);
++	rtl8180_rtl8225_write(dev, 0xc, 0x850); msleep(1);
++	rtl8180_rtl8225_write(dev, 0xd, 0xCDF); msleep(1);
++	rtl8180_rtl8225_write(dev, 0xe, 0x02B); msleep(1);
++	rtl8180_rtl8225_write(dev, 0xf, 0x114); msleep(100);
 +
-+	if (!(rtl8225_read(dev, 6) & (1 << 7))) {
-+		rtl8225_write(dev, 0x02, 0x0C4D);
++	if (!(rtl8180_rtl8225_read(dev, 6) & (1 << 7))) {
++		rtl8180_rtl8225_write(dev, 0x02, 0x0C4D);
 +		msleep(200);
-+		rtl8225_write(dev, 0x02, 0x044D);
++		rtl8180_rtl8225_write(dev, 0x02, 0x044D);
 +		msleep(100);
-+		if (!(rtl8225_read(dev, 6) & (1 << 7)))
++		if (!(rtl8180_rtl8225_read(dev, 6) & (1 << 7)))
 +			printk(KERN_WARNING "%s: RF Calibration Failed! %x\n",
-+			       wiphy_name(dev->wiphy), rtl8225_read(dev, 6));
++			       wiphy_name(dev->wiphy), rtl8180_rtl8225_read(dev, 6));
 +	}
 +
-+	rtl8225_write(dev, 0x0, 0x1B7);
-+	rtl8225_write(dev, 0x3, 0x002);
-+	rtl8225_write(dev, 0x5, 0x004);
++	rtl8180_rtl8225_write(dev, 0x0, 0x1B7);
++	rtl8180_rtl8225_write(dev, 0x3, 0x002);
++	rtl8180_rtl8225_write(dev, 0x5, 0x004);
 +
-+	for (i = 0; i < ARRAY_SIZE(rtl8225z2_rxgain); i++) {
-+		rtl8225_write(dev, 0x1, i + 1);
-+		rtl8225_write(dev, 0x2, rtl8225z2_rxgain[i]);
++	for (i = 0; i < ARRAY_SIZE(rtl8180_rtl8225z2_rxgain); i++) {
++		rtl8180_rtl8225_write(dev, 0x1, i + 1);
++		rtl8180_rtl8225_write(dev, 0x2, rtl8180_rtl8225z2_rxgain[i]);
 +	}
 +
-+	rtl8225_write(dev, 0x0, 0x0B7); msleep(100);
-+	rtl8225_write(dev, 0x2, 0xC4D);
++	rtl8180_rtl8225_write(dev, 0x0, 0x0B7); msleep(100);
++	rtl8180_rtl8225_write(dev, 0x2, 0xC4D);
 +
 +	msleep(200);
-+	rtl8225_write(dev, 0x2, 0x44D);
++	rtl8180_rtl8225_write(dev, 0x2, 0x44D);
 +	msleep(100);
 +
-+	rtl8225_write(dev, 0x00, 0x2BF);
-+	rtl8225_write(dev, 0xFF, 0xFFFF);
++	rtl8180_rtl8225_write(dev, 0x00, 0x2BF);
++	rtl8180_rtl8225_write(dev, 0xFF, 0xFFFF);
 +
 +	rtl818x_iowrite16(priv, &priv->map->RFPinsEnable, 0x1FFF);
 +
-+	for (i = 0; i < ARRAY_SIZE(rtl8225_agc); i++) {
-+		rtl8225_write_phy_ofdm(dev, 0xB, rtl8225_agc[i]);
++	for (i = 0; i < ARRAY_SIZE(rtl8180_rtl8225_agc); i++) {
++		rtl8180_rtl8225_write_phy_ofdm(dev, 0xB, rtl8180_rtl8225_agc[i]);
 +		msleep(1);
-+		rtl8225_write_phy_ofdm(dev, 0xA, 0x80 + i);
++		rtl8180_rtl8225_write_phy_ofdm(dev, 0xA, 0x80 + i);
 +		msleep(1);
 +	}
 +
 +	msleep(1);
 +
-+	rtl8225_write_phy_ofdm(dev, 0x00, 0x01); msleep(1);
-+	rtl8225_write_phy_ofdm(dev, 0x01, 0x02); msleep(1);
-+	rtl8225_write_phy_ofdm(dev, 0x02, 0x62); msleep(1);
-+	rtl8225_write_phy_ofdm(dev, 0x03, 0x00); msleep(1);
-+	rtl8225_write_phy_ofdm(dev, 0x04, 0x00); msleep(1);
-+	rtl8225_write_phy_ofdm(dev, 0x05, 0x00); msleep(1);
-+	rtl8225_write_phy_ofdm(dev, 0x06, 0x40); msleep(1);
-+	rtl8225_write_phy_ofdm(dev, 0x07, 0x00); msleep(1);
-+	rtl8225_write_phy_ofdm(dev, 0x08, 0x40); msleep(1);
-+	rtl8225_write_phy_ofdm(dev, 0x09, 0xfe); msleep(1);
-+	rtl8225_write_phy_ofdm(dev, 0x0a, 0x09); msleep(1);
-+	rtl8225_write_phy_ofdm(dev, 0x18, 0xef); msleep(1);
-+	rtl8225_write_phy_ofdm(dev, 0x0b, 0x80); msleep(1);
-+	rtl8225_write_phy_ofdm(dev, 0x0c, 0x01); msleep(1);
-+	rtl8225_write_phy_ofdm(dev, 0x0d, 0x43);
-+	rtl8225_write_phy_ofdm(dev, 0x0e, 0xd3); msleep(1);
-+	rtl8225_write_phy_ofdm(dev, 0x0f, 0x38); msleep(1);
-+	rtl8225_write_phy_ofdm(dev, 0x10, 0x84); msleep(1);
-+	rtl8225_write_phy_ofdm(dev, 0x11, 0x06); msleep(1);
-+	rtl8225_write_phy_ofdm(dev, 0x12, 0x20); msleep(1);
-+	rtl8225_write_phy_ofdm(dev, 0x13, 0x20); msleep(1);
-+	rtl8225_write_phy_ofdm(dev, 0x14, 0x00); msleep(1);
-+	rtl8225_write_phy_ofdm(dev, 0x15, 0x40); msleep(1);
-+	rtl8225_write_phy_ofdm(dev, 0x16, 0x00); msleep(1);
-+	rtl8225_write_phy_ofdm(dev, 0x17, 0x40); msleep(1);
-+	rtl8225_write_phy_ofdm(dev, 0x18, 0xef); msleep(1);
-+	rtl8225_write_phy_ofdm(dev, 0x19, 0x19); msleep(1);
-+	rtl8225_write_phy_ofdm(dev, 0x1a, 0x20); msleep(1);
-+	rtl8225_write_phy_ofdm(dev, 0x1b, 0x11); msleep(1);
-+	rtl8225_write_phy_ofdm(dev, 0x1c, 0x04); msleep(1);
-+	rtl8225_write_phy_ofdm(dev, 0x1d, 0xc5); msleep(1);
-+	rtl8225_write_phy_ofdm(dev, 0x1e, 0xb3); msleep(1);
-+	rtl8225_write_phy_ofdm(dev, 0x1f, 0x75); msleep(1);
-+	rtl8225_write_phy_ofdm(dev, 0x20, 0x1f); msleep(1);
-+	rtl8225_write_phy_ofdm(dev, 0x21, 0x27); msleep(1);
-+	rtl8225_write_phy_ofdm(dev, 0x22, 0x16); msleep(1);
-+	rtl8225_write_phy_ofdm(dev, 0x23, 0x80); msleep(1); /* FIXME: not needed? */
-+	rtl8225_write_phy_ofdm(dev, 0x24, 0x46); msleep(1);
-+	rtl8225_write_phy_ofdm(dev, 0x25, 0x20); msleep(1);
-+	rtl8225_write_phy_ofdm(dev, 0x26, 0x90); msleep(1);
-+	rtl8225_write_phy_ofdm(dev, 0x27, 0x88); msleep(1);
-+
-+	rtl8225_write_phy_cck(dev, 0x00, 0x98); msleep(1);
-+	rtl8225_write_phy_cck(dev, 0x03, 0x20); msleep(1);
-+	rtl8225_write_phy_cck(dev, 0x04, 0x7e); msleep(1);
-+	rtl8225_write_phy_cck(dev, 0x05, 0x12); msleep(1);
-+	rtl8225_write_phy_cck(dev, 0x06, 0xfc); msleep(1);
-+	rtl8225_write_phy_cck(dev, 0x07, 0x78); msleep(1);
-+	rtl8225_write_phy_cck(dev, 0x08, 0x2e); msleep(1);
-+	rtl8225_write_phy_cck(dev, 0x10, 0x93); msleep(1);
-+	rtl8225_write_phy_cck(dev, 0x11, 0x88); msleep(1);
-+	rtl8225_write_phy_cck(dev, 0x12, 0x47); msleep(1);
-+	rtl8225_write_phy_cck(dev, 0x13, 0xd0);
-+	rtl8225_write_phy_cck(dev, 0x19, 0x00);
-+	rtl8225_write_phy_cck(dev, 0x1a, 0xa0);
-+	rtl8225_write_phy_cck(dev, 0x1b, 0x08);
-+	rtl8225_write_phy_cck(dev, 0x40, 0x86);
-+	rtl8225_write_phy_cck(dev, 0x41, 0x8a); msleep(1);
-+	rtl8225_write_phy_cck(dev, 0x42, 0x15); msleep(1);
-+	rtl8225_write_phy_cck(dev, 0x43, 0x18); msleep(1);
-+	rtl8225_write_phy_cck(dev, 0x44, 0x36); msleep(1);
-+	rtl8225_write_phy_cck(dev, 0x45, 0x35); msleep(1);
-+	rtl8225_write_phy_cck(dev, 0x46, 0x2e); msleep(1);
-+	rtl8225_write_phy_cck(dev, 0x47, 0x25); msleep(1);
-+	rtl8225_write_phy_cck(dev, 0x48, 0x1c); msleep(1);
-+	rtl8225_write_phy_cck(dev, 0x49, 0x12); msleep(1);
-+	rtl8225_write_phy_cck(dev, 0x4a, 0x09); msleep(1);
-+	rtl8225_write_phy_cck(dev, 0x4b, 0x04); msleep(1);
-+	rtl8225_write_phy_cck(dev, 0x4c, 0x05); msleep(1);
++	rtl8180_rtl8225_write_phy_ofdm(dev, 0x00, 0x01); msleep(1);
++	rtl8180_rtl8225_write_phy_ofdm(dev, 0x01, 0x02); msleep(1);
++	rtl8180_rtl8225_write_phy_ofdm(dev, 0x02, 0x62); msleep(1);
++	rtl8180_rtl8225_write_phy_ofdm(dev, 0x03, 0x00); msleep(1);
++	rtl8180_rtl8225_write_phy_ofdm(dev, 0x04, 0x00); msleep(1);
++	rtl8180_rtl8225_write_phy_ofdm(dev, 0x05, 0x00); msleep(1);
++	rtl8180_rtl8225_write_phy_ofdm(dev, 0x06, 0x40); msleep(1);
++	rtl8180_rtl8225_write_phy_ofdm(dev, 0x07, 0x00); msleep(1);
++	rtl8180_rtl8225_write_phy_ofdm(dev, 0x08, 0x40); msleep(1);
++	rtl8180_rtl8225_write_phy_ofdm(dev, 0x09, 0xfe); msleep(1);
++	rtl8180_rtl8225_write_phy_ofdm(dev, 0x0a, 0x09); msleep(1);
++	rtl8180_rtl8225_write_phy_ofdm(dev, 0x18, 0xef); msleep(1);
++	rtl8180_rtl8225_write_phy_ofdm(dev, 0x0b, 0x80); msleep(1);
++	rtl8180_rtl8225_write_phy_ofdm(dev, 0x0c, 0x01); msleep(1);
++	rtl8180_rtl8225_write_phy_ofdm(dev, 0x0d, 0x43);
++	rtl8180_rtl8225_write_phy_ofdm(dev, 0x0e, 0xd3); msleep(1);
++	rtl8180_rtl8225_write_phy_ofdm(dev, 0x0f, 0x38); msleep(1);
++	rtl8180_rtl8225_write_phy_ofdm(dev, 0x10, 0x84); msleep(1);
++	rtl8180_rtl8225_write_phy_ofdm(dev, 0x11, 0x06); msleep(1);
++	rtl8180_rtl8225_write_phy_ofdm(dev, 0x12, 0x20); msleep(1);
++	rtl8180_rtl8225_write_phy_ofdm(dev, 0x13, 0x20); msleep(1);
++	rtl8180_rtl8225_write_phy_ofdm(dev, 0x14, 0x00); msleep(1);
++	rtl8180_rtl8225_write_phy_ofdm(dev, 0x15, 0x40); msleep(1);
++	rtl8180_rtl8225_write_phy_ofdm(dev, 0x16, 0x00); msleep(1);
++	rtl8180_rtl8225_write_phy_ofdm(dev, 0x17, 0x40); msleep(1);
++	rtl8180_rtl8225_write_phy_ofdm(dev, 0x18, 0xef); msleep(1);
++	rtl8180_rtl8225_write_phy_ofdm(dev, 0x19, 0x19); msleep(1);
++	rtl8180_rtl8225_write_phy_ofdm(dev, 0x1a, 0x20); msleep(1);
++	rtl8180_rtl8225_write_phy_ofdm(dev, 0x1b, 0x11); msleep(1);
++	rtl8180_rtl8225_write_phy_ofdm(dev, 0x1c, 0x04); msleep(1);
++	rtl8180_rtl8225_write_phy_ofdm(dev, 0x1d, 0xc5); msleep(1);
++	rtl8180_rtl8225_write_phy_ofdm(dev, 0x1e, 0xb3); msleep(1);
++	rtl8180_rtl8225_write_phy_ofdm(dev, 0x1f, 0x75); msleep(1);
++	rtl8180_rtl8225_write_phy_ofdm(dev, 0x20, 0x1f); msleep(1);
++	rtl8180_rtl8225_write_phy_ofdm(dev, 0x21, 0x27); msleep(1);
++	rtl8180_rtl8225_write_phy_ofdm(dev, 0x22, 0x16); msleep(1);
++	rtl8180_rtl8225_write_phy_ofdm(dev, 0x23, 0x80); msleep(1); /* FIXME: not needed? */
++	rtl8180_rtl8225_write_phy_ofdm(dev, 0x24, 0x46); msleep(1);
++	rtl8180_rtl8225_write_phy_ofdm(dev, 0x25, 0x20); msleep(1);
++	rtl8180_rtl8225_write_phy_ofdm(dev, 0x26, 0x90); msleep(1);
++	rtl8180_rtl8225_write_phy_ofdm(dev, 0x27, 0x88); msleep(1);
++
++	rtl8180_rtl8225_write_phy_cck(dev, 0x00, 0x98); msleep(1);
++	rtl8180_rtl8225_write_phy_cck(dev, 0x03, 0x20); msleep(1);
++	rtl8180_rtl8225_write_phy_cck(dev, 0x04, 0x7e); msleep(1);
++	rtl8180_rtl8225_write_phy_cck(dev, 0x05, 0x12); msleep(1);
++	rtl8180_rtl8225_write_phy_cck(dev, 0x06, 0xfc); msleep(1);
++	rtl8180_rtl8225_write_phy_cck(dev, 0x07, 0x78); msleep(1);
++	rtl8180_rtl8225_write_phy_cck(dev, 0x08, 0x2e); msleep(1);
++	rtl8180_rtl8225_write_phy_cck(dev, 0x10, 0x93); msleep(1);
++	rtl8180_rtl8225_write_phy_cck(dev, 0x11, 0x88); msleep(1);
++	rtl8180_rtl8225_write_phy_cck(dev, 0x12, 0x47); msleep(1);
++	rtl8180_rtl8225_write_phy_cck(dev, 0x13, 0xd0);
++	rtl8180_rtl8225_write_phy_cck(dev, 0x19, 0x00);
++	rtl8180_rtl8225_write_phy_cck(dev, 0x1a, 0xa0);
++	rtl8180_rtl8225_write_phy_cck(dev, 0x1b, 0x08);
++	rtl8180_rtl8225_write_phy_cck(dev, 0x40, 0x86);
++	rtl8180_rtl8225_write_phy_cck(dev, 0x41, 0x8a); msleep(1);
++	rtl8180_rtl8225_write_phy_cck(dev, 0x42, 0x15); msleep(1);
++	rtl8180_rtl8225_write_phy_cck(dev, 0x43, 0x18); msleep(1);
++	rtl8180_rtl8225_write_phy_cck(dev, 0x44, 0x36); msleep(1);
++	rtl8180_rtl8225_write_phy_cck(dev, 0x45, 0x35); msleep(1);
++	rtl8180_rtl8225_write_phy_cck(dev, 0x46, 0x2e); msleep(1);
++	rtl8180_rtl8225_write_phy_cck(dev, 0x47, 0x25); msleep(1);
++	rtl8180_rtl8225_write_phy_cck(dev, 0x48, 0x1c); msleep(1);
++	rtl8180_rtl8225_write_phy_cck(dev, 0x49, 0x12); msleep(1);
++	rtl8180_rtl8225_write_phy_cck(dev, 0x4a, 0x09); msleep(1);
++	rtl8180_rtl8225_write_phy_cck(dev, 0x4b, 0x04); msleep(1);
++	rtl8180_rtl8225_write_phy_cck(dev, 0x4c, 0x05); msleep(1);
 +
 +	rtl818x_iowrite8(priv, (u8 __iomem *)((void __iomem *)priv->map + 0x5B), 0x0D); msleep(1);
 +
-+	rtl8225z2_rf_set_tx_power(dev, 1);
++	rtl8180_rtl8225z2_rf_set_tx_power(dev, 1);
 +
 +	/* RX antenna default to A */
-+	rtl8225_write_phy_cck(dev, 0x10, 0x9b); msleep(1);	/* B: 0xDB */
-+	rtl8225_write_phy_ofdm(dev, 0x26, 0x90); msleep(1);	/* B: 0x10 */
++	rtl8180_rtl8225_write_phy_cck(dev, 0x10, 0x9b); msleep(1);	/* B: 0xDB */
++	rtl8180_rtl8225_write_phy_ofdm(dev, 0x26, 0x90); msleep(1);	/* B: 0x10 */
 +
 +	rtl818x_iowrite8(priv, &priv->map->TX_ANTENNA, 0x03);	/* B: 0x00 */
 +	msleep(1);
@@ -1885,12 +2373,12 @@
 +	rtl818x_iowrite16(priv, &priv->map->RFPinsEnable, 0x1FFF);
 +}
 +
-+void rtl8225_rf_stop(struct ieee80211_hw *dev)
++void rtl8180_rtl8225_rf_stop(struct ieee80211_hw *dev)
 +{
 +	struct rtl8180_priv *priv = dev->priv;
 +	u8 reg;
 +
-+	rtl8225_write(dev, 0x4, 0x1f); msleep(1);
++	rtl8180_rtl8225_write(dev, 0x4, 0x1f); msleep(1);
 +
 +	rtl818x_iowrite8(priv, &priv->map->EEPROM_CMD, RTL818X_EEPROM_CMD_CONFIG);
 +	reg = rtl818x_ioread8(priv, &priv->map->CONFIG3);
@@ -1901,17 +2389,17 @@
 +	rtl818x_iowrite8(priv, &priv->map->EEPROM_CMD, RTL818X_EEPROM_CMD_NORMAL);
 +}
 +
-+void rtl8225_rf_set_channel(struct ieee80211_hw *dev,
++void rtl8180_rtl8225_rf_set_channel(struct ieee80211_hw *dev,
 +			    struct ieee80211_conf *conf)
 +{
 +	struct rtl8180_priv *priv = dev->priv;
 +
-+	if (priv->rf_init == rtl8225_rf_init)
-+		rtl8225_rf_set_tx_power(dev, conf->channel);
++	if (priv->rf_init == rtl8180_rtl8225_rf_init)
++		rtl8180_rtl8225_rf_set_tx_power(dev, conf->channel);
 +	else
-+		rtl8225z2_rf_set_tx_power(dev, conf->channel);
++		rtl8180_rtl8225z2_rf_set_tx_power(dev, conf->channel);
 +
-+	rtl8225_write(dev, 0x7, rtl8225_chan[conf->channel - 1]);
++	rtl8180_rtl8225_write(dev, 0x7, rtl8180_rtl8225_chan[conf->channel - 1]);
 +	msleep(10);
 +
 +	if (conf->flags & IEEE80211_CONF_SHORT_SLOT_TIME) {
@@ -1929,9 +2417,9 @@
 +	}
 +}
 diff -up /dev/null linux-2.6.23.noarch/drivers/net/wireless/rtl8180.h
---- /dev/null	2007-11-12 23:12:46.917997680 -0500
-+++ linux-2.6.23.noarch/drivers/net/wireless/rtl8180.h	2007-11-21 14:23:21.000000000 -0500
-@@ -0,0 +1,138 @@
+--- /dev/null	2007-11-21 18:00:15.874485932 -0500
++++ linux-2.6.23.noarch/drivers/net/wireless/rtl8180.h	2007-12-04 15:37:19.000000000 -0500
+@@ -0,0 +1,153 @@
 +#ifndef RTL8180_H
 +#define RTL8180_H
 +
@@ -1939,11 +2427,25 @@
 +
 +#define MAX_RX_SIZE IEEE80211_MAX_RTS_THRESHOLD
 +
-+#define RF_PARAM_DIGPHY		(1 << 0)
++#define RF_PARAM_ANALOGPHY	(1 << 0)
 +#define RF_PARAM_ANTBDEFAULT	(1 << 1)
 +#define RF_PARAM_CARRIERSENSE1	(1 << 2)
 +#define RF_PARAM_CARRIERSENSE2	(1 << 3)
 +
++#define BB_ANTATTEN_CHAN14	0x0C
++#define BB_ANTENNA_B 		0x40
++
++#define BB_HOST_BANG 		(1 << 30)
++#define BB_HOST_BANG_EN 	(1 << 2)
++#define BB_HOST_BANG_CLK 	(1 << 1)
++#define BB_HOST_BANG_DATA	1
++
++#define ANAPARAM_TXDACOFF_SHIFT	27
++#define ANAPARAM_PWR0_SHIFT	28
++#define ANAPARAM_PWR0_MASK 	(0x07 << ANAPARAM_PWR0_SHIFT)
++#define ANAPARAM_PWR1_SHIFT	20
++#define ANAPARAM_PWR1_MASK	(0x7F << ANAPARAM_PWR1_SHIFT)
++
 +enum rtl8180_tx_desc_flags {
 +	RTL8180_TX_DESC_FLAG_NO_ENC	= (1 << 15),
 +	RTL8180_TX_DESC_FLAG_TX_OK	= (1 << 15),
@@ -2035,6 +2537,7 @@
 +};
 +
 +void rtl8180_write_phy(struct ieee80211_hw *dev, u8 addr, u32 data);
++void rtl8180_set_anaparam(struct rtl8180_priv *priv, u32 anaparam);
 +
 +static inline u8 rtl818x_ioread8(struct rtl8180_priv *priv, u8 __iomem *addr)
 +{

linux-2.6-wireless-pending.patch:

View full diff with command:
/usr/bin/cvs -f diff  -kk -u -N -r 1.15 -r 1.16 linux-2.6-wireless-pending.patch
Index: linux-2.6-wireless-pending.patch
===================================================================
RCS file: /cvs/pkgs/rpms/kernel/devel/linux-2.6-wireless-pending.patch,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -r1.15 -r1.16
--- linux-2.6-wireless-pending.patch	1 Dec 2007 18:44:27 -0000	1.15
+++ linux-2.6-wireless-pending.patch	4 Dec 2007 22:03:29 -0000	1.16
@@ -1,1875 +1,1304 @@
-diff -up /dev/null linux-2.6.23.noarch/drivers/net/wireless/b43legacy/rfkill.h
---- /dev/null	2007-12-01 09:44:05.571105098 -0500
-+++ linux-2.6.23.noarch/drivers/net/wireless/b43legacy/rfkill.h	2007-12-01 12:46:43.000000000 -0500
-@@ -0,0 +1,59 @@
-+#ifndef B43legacy_RFKILL_H_
-+#define B43legacy_RFKILL_H_
-+
-+struct b43legacy_wldev;
-+
-+#ifdef CONFIG_B43LEGACY_RFKILL
-+
-+#include <linux/rfkill.h>
-+#include <linux/workqueue.h>
-+#include <linux/input-polldev.h>
-+
-+
-+
-+struct b43legacy_rfkill {
-+	/* The RFKILL subsystem data structure */
-+	struct rfkill *rfkill;
-+	/* The poll device for the RFKILL input button */
-+	struct input_polled_dev *poll_dev;
-+	/* Did initialization succeed? Used for freeing. */
-+	bool registered;
-+	/* The unique name of this rfkill switch */
-+	char name[sizeof("b43legacy-phy4294967295")];
-+};
-+
-+/* The init function returns void, because we are not interested
-+ * in failing the b43 init process when rfkill init failed. */
-+void b43legacy_rfkill_init(struct b43legacy_wldev *dev);
-+void b43legacy_rfkill_exit(struct b43legacy_wldev *dev);
-+
-+char * b43legacy_rfkill_led_name(struct b43legacy_wldev *dev);
-+
-+
-+#else /* CONFIG_B43LEGACY_RFKILL */
-+/* No RFKILL support. */
-+
-+struct b43legacy_rfkill {
-+	/* empty */
-+};
-+
-+static inline void b43legacy_rfkill_alloc(struct b43legacy_wldev *dev)
-+{
-+}
-+static inline void b43legacy_rfkill_free(struct b43legacy_wldev *dev)
-+{
-+}
-+static inline void b43legacy_rfkill_init(struct b43legacy_wldev *dev)
-+{
-+}
-+static inline void b43legacy_rfkill_exit(struct b43legacy_wldev *dev)
-+{
-+}
-+static inline char * b43legacy_rfkill_led_name(struct b43legacy_wldev *dev)
-+{
-+	return NULL;
-+}
-+
-+#endif /* CONFIG_B43LEGACY_RFKILL */
-+
-+#endif /* B43legacy_RFKILL_H_ */
-diff -up linux-2.6.23.noarch/drivers/net/wireless/b43legacy/leds.h.orig linux-2.6.23.noarch/drivers/net/wireless/b43legacy/leds.h
---- linux-2.6.23.noarch/drivers/net/wireless/b43legacy/leds.h.orig	2007-12-01 12:46:26.000000000 -0500
-+++ linux-2.6.23.noarch/drivers/net/wireless/b43legacy/leds.h	2007-12-01 12:46:43.000000000 -0500
-@@ -1,30 +1,33 @@
- #ifndef B43legacy_LEDS_H_
- #define B43legacy_LEDS_H_
- 
-+struct b43legacy_wldev;
-+
-+#ifdef CONFIG_B43LEGACY_LEDS
-+
- #include <linux/types.h>
--#include <linux/timer.h>
-+#include <linux/leds.h>
- 
- 
-+#define B43legacy_LED_MAX_NAME_LEN	31
-+
- struct b43legacy_led {
--	u8 behaviour;
--	bool activelow;
--	/* Index in the "leds" array in b43legacy_wldev */
--	u8 index;
- 	struct b43legacy_wldev *dev;
--	struct timer_list blink_timer;
--	unsigned long blink_interval;
-+	/* The LED class device */
-+	struct led_classdev led_dev;
-+	/* The index number of the LED. */
-+	u8 index;
-+	/* If activelow is true, the LED is ON if the
-+	 * bit is switched off. */
-+	bool activelow;
-+	/* The unique name string for this LED device. */
-+	char name[B43legacy_LED_MAX_NAME_LEN + 1];
- };
- 
--/* Delay between state changes when blinking in jiffies */
--#define B43legacy_LEDBLINK_SLOW		(HZ / 1)
--#define B43legacy_LEDBLINK_MEDIUM	(HZ / 4)
--#define B43legacy_LEDBLINK_FAST		(HZ / 8)
--
--#define B43legacy_LED_XFER_THRES	(HZ / 100)
--
- #define B43legacy_LED_BEHAVIOUR		0x7F
- #define B43legacy_LED_ACTIVELOW		0x80
--enum { /* LED behaviour values */
-+/* LED behaviour values */
-+enum b43legacy_led_behaviour {
- 	B43legacy_LED_OFF,
- 	B43legacy_LED_ON,
- 	B43legacy_LED_ACTIVITY,
-@@ -37,20 +40,24 @@ enum { /* LED behaviour values */
- 	B43legacy_LED_WEIRD,
- 	B43legacy_LED_ASSOC,
- 	B43legacy_LED_INACTIVE,
--
--	/* Behaviour values for testing.
--	 * With these values it is easier to figure out
--	 * the real behaviour of leds, in case the SPROM
--	 * is missing information.
--	 */
--	B43legacy_LED_TEST_BLINKSLOW,
--	B43legacy_LED_TEST_BLINKMEDIUM,
--	B43legacy_LED_TEST_BLINKFAST,
+diff -up linux-2.6.23.noarch/drivers/ssb/b43_pci_bridge.c.orig linux-2.6.23.noarch/drivers/ssb/b43_pci_bridge.c
+--- linux-2.6.23.noarch/drivers/ssb/b43_pci_bridge.c.orig	2007-12-04 16:14:41.000000000 -0500
++++ linux-2.6.23.noarch/drivers/ssb/b43_pci_bridge.c	2007-12-04 16:14:53.000000000 -0500
+@@ -27,6 +27,7 @@ static const struct pci_device_id b43_pc
+ 	{ PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, 0x4321) },
+ 	{ PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, 0x4324) },
+ 	{ PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, 0x4325) },
++	{ PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, 0x4328) },
+ 	{ 0, },
  };
- 
--int b43legacy_leds_init(struct b43legacy_wldev *dev);
-+void b43legacy_leds_init(struct b43legacy_wldev *dev);
- void b43legacy_leds_exit(struct b43legacy_wldev *dev);
--void b43legacy_leds_update(struct b43legacy_wldev *dev, int activity);
--void b43legacy_leds_switch_all(struct b43legacy_wldev *dev, int on);
-+
-+#else /* CONFIG_B43EGACY_LEDS */
-+/* LED support disabled */
-+
-+struct b43legacy_led {
-+	/* empty */
-+};
-+
-+static inline void b43legacy_leds_init(struct b43legacy_wldev *dev)
-+{
-+}
-+static inline void b43legacy_leds_exit(struct b43legacy_wldev *dev)
-+{
-+}
-+#endif /* CONFIG_B43LEGACY_LEDS */
- 
- #endif /* B43legacy_LEDS_H_ */
-diff -up linux-2.6.23.noarch/drivers/net/wireless/b43legacy/main.h.orig linux-2.6.23.noarch/drivers/net/wireless/b43legacy/main.h
---- linux-2.6.23.noarch/drivers/net/wireless/b43legacy/main.h.orig	2007-12-01 12:46:26.000000000 -0500
-+++ linux-2.6.23.noarch/drivers/net/wireless/b43legacy/main.h	2007-12-01 12:46:43.000000000 -0500
-@@ -3,7 +3,7 @@
-   Broadcom B43legacy wireless driver
- 
-   Copyright (c) 2005 Martin Langer <martin-langer at gmx.de>,
--  Copyright (c) 2005 Stefano Brivio <st3 at riseup.net>
-+  Copyright (c) 2005 Stefano Brivio <stefano.brivio at polimi.it>
-   Copyright (c) 2005, 2006 Michael Buesch <mb at bu3sch.de>
-   Copyright (c) 2005  Danny van Dyk <kugelfang at gentoo.org>
-   Copyright (c) 2005  Andreas Jaggi <andreas.jaggi at waterwave.ch>
-diff -up linux-2.6.23.noarch/drivers/net/wireless/b43legacy/phy.c.orig linux-2.6.23.noarch/drivers/net/wireless/b43legacy/phy.c
---- linux-2.6.23.noarch/drivers/net/wireless/b43legacy/phy.c.orig	2007-12-01 12:46:26.000000000 -0500
-+++ linux-2.6.23.noarch/drivers/net/wireless/b43legacy/phy.c	2007-12-01 12:46:43.000000000 -0500
-@@ -3,7 +3,7 @@
-   Broadcom B43legacy wireless driver
- 
-   Copyright (c) 2005 Martin Langer <martin-langer at gmx.de>,
--		     Stefano Brivio <st3 at riseup.net>
-+		     Stefano Brivio <stefano.brivio at polimi.it>
- 		     Michael Buesch <mbuesch at freenet.de>
- 		     Danny van Dyk <kugelfang at gentoo.org>
-      Andreas Jaggi <andreas.jaggi at waterwave.ch>
-@@ -441,7 +441,7 @@ static void b43legacy_phy_inita(struct b
- 	might_sleep();
- 
- 	b43legacy_phy_setupg(dev);
--	if (dev->dev->bus->sprom.r1.boardflags_lo & B43legacy_BFL_PACTRL)
-+	if (dev->dev->bus->sprom.boardflags_lo & B43legacy_BFL_PACTRL)
[...103364 lines suppressed...]
++		conf->ht_conf.cap &= ~(IEEE80211_HT_CAP_MIMO_PS);
++		conf->ht_conf.cap |=
++			mode->ht_info.cap & IEEE80211_HT_CAP_MIMO_PS;
++		conf->ht_bss_conf.primary_channel =
++			req_bss_cap->primary_channel;
++		conf->ht_bss_conf.bss_cap = req_bss_cap->bss_cap;
++		conf->ht_bss_conf.bss_op_mode = req_bss_cap->bss_op_mode;
++		for (i = 0; i < SUPP_MCS_SET_LEN; i++)
++			conf->ht_conf.supp_mcs_set[i] =
++				mode->ht_info.supp_mcs_set[i] &
++				  req_ht_cap->supp_mcs_set[i];
 +
-+What:	iee80211 softmac wireless networking component
-+When:	2.6.26 (or after removal of bcm43xx and port of zd1211rw to mac80211)
-+Files:	net/ieee80211/softmac
-+Why:	No in-kernel drivers will depend on it any longer.
-+Who:	John W. Linville <linville at tuxdriver.com>
++		/* In STA mode, this gives us indication
++		 * to the AP's mode of operation */
++		conf->ht_conf.ht_supported = 1;
++		conf->ht_conf.ampdu_factor = req_ht_cap->ampdu_factor;
++		conf->ht_conf.ampdu_density = req_ht_cap->ampdu_density;
++	}
 +
-+---------------------------
-diff -up linux-2.6.23.noarch/MAINTAINERS.orig linux-2.6.23.noarch/MAINTAINERS
---- linux-2.6.23.noarch/MAINTAINERS.orig	2007-12-01 12:46:26.000000000 -0500
-+++ linux-2.6.23.noarch/MAINTAINERS	2007-12-01 12:48:38.000000000 -0500
-@@ -807,7 +807,7 @@ P:	Stefano Brivio
- M:	stefano.brivio at polimi.it
- L:	linux-wireless at vger.kernel.org
- W:	http://bcm43xx.berlios.de/
--S:	Maintained
-+S:	Obsolete
- 
- BEFS FILE SYSTEM
- P:	Sergey S. Kostyliov
-@@ -2026,10 +2026,12 @@ W:	http://sourceforge.net/projects/e1000
- S:	Supported
- 
- INTEL PRO/WIRELESS 2100 NETWORK CONNECTION SUPPORT
--P:	Yi Zhu
-+P:	Zhu Yi
- M:	yi.zhu at intel.com
- P:	James Ketrenos
- M:	jketreno at linux.intel.com
-+P:	Reinette Chatre
-+M:	reinette.chatre at intel.com
- L:	linux-wireless at vger.kernel.org
- L:	ipw2100-devel at lists.sourceforge.net
- L:	http://lists.sourceforge.net/mailman/listinfo/ipw2100-devel
-@@ -2037,10 +2039,12 @@ W:	http://ipw2100.sourceforge.net
- S:	Supported
- 
- INTEL PRO/WIRELESS 2915ABG NETWORK CONNECTION SUPPORT
--P:	Yi Zhu
-+P:	Zhu Yi
- M:	yi.zhu at intel.com
- P:	James Ketrenos
- M:	jketreno at linux.intel.com
-+P:	Reinette Chatre
-+M:	reinette.chatre at intel.com
- L:	linux-wireless at vger.kernel.org
- L:	ipw2100-devel at lists.sourceforge.net
- L:	http://lists.sourceforge.net/mailman/listinfo/ipw2100-devel
-@@ -2050,6 +2054,8 @@ S:	Supported
- INTEL WIRELESS WIFI LINK (iwlwifi)
- P:	Zhu Yi
- M:	yi.zhu at intel.com
-+P:	Reinette Chatre
-+M:	reinette.chatre at intel.com
- L:	linux-wireless at vger.kernel.org
- L:	ipw3945-devel at lists.sourceforge.net
- W:	http://intellinuxwireless.org
++	local->ops->conf_ht(local_to_hw(local), &local->hw.conf);
++
++	return 0;
++}
++
+ void ieee80211_erp_info_change_notify(struct net_device *dev, u8 changes)
+ {
+ 	struct ieee80211_local *local = wdev_priv(dev->ieee80211_ptr);
 diff -up linux-2.6.23.noarch/include/net/mac80211.h.orig linux-2.6.23.noarch/include/net/mac80211.h
---- linux-2.6.23.noarch/include/net/mac80211.h.orig	2007-12-01 12:46:26.000000000 -0500
-+++ linux-2.6.23.noarch/include/net/mac80211.h	2007-12-01 12:48:38.000000000 -0500
+--- linux-2.6.23.noarch/include/net/mac80211.h.orig	2007-12-04 16:14:41.000000000 -0500
++++ linux-2.6.23.noarch/include/net/mac80211.h	2007-12-04 16:14:53.000000000 -0500
 @@ -139,17 +139,54 @@ enum ieee80211_phymode {
  };
  
@@ -49071,8 +61609,8 @@
 +
  #endif /* MAC80211_H */
 diff -up linux-2.6.23.noarch/include/linux/ieee80211.h.orig linux-2.6.23.noarch/include/linux/ieee80211.h
---- linux-2.6.23.noarch/include/linux/ieee80211.h.orig	2007-12-01 12:46:26.000000000 -0500
-+++ linux-2.6.23.noarch/include/linux/ieee80211.h	2007-12-01 12:46:43.000000000 -0500
+--- linux-2.6.23.noarch/include/linux/ieee80211.h.orig	2007-12-04 16:14:41.000000000 -0500
++++ linux-2.6.23.noarch/include/linux/ieee80211.h	2007-12-04 16:14:53.000000000 -0500
 @@ -54,6 +54,8 @@
  #define IEEE80211_STYPE_ACTION		0x00D0
  
@@ -49290,8 +61828,8 @@
  #define WLAN_CIPHER_SUITE_USE_GROUP	0x000FAC00
  #define WLAN_CIPHER_SUITE_WEP40		0x000FAC01
 diff -up linux-2.6.23.noarch/include/linux/ssb/ssb_regs.h.orig linux-2.6.23.noarch/include/linux/ssb/ssb_regs.h
---- linux-2.6.23.noarch/include/linux/ssb/ssb_regs.h.orig	2007-12-01 12:46:26.000000000 -0500
-+++ linux-2.6.23.noarch/include/linux/ssb/ssb_regs.h	2007-12-01 12:46:43.000000000 -0500
+--- linux-2.6.23.noarch/include/linux/ssb/ssb_regs.h.orig	2007-12-04 16:14:41.000000000 -0500
++++ linux-2.6.23.noarch/include/linux/ssb/ssb_regs.h	2007-12-04 16:14:53.000000000 -0500
 @@ -147,6 +147,10 @@
  #define  SSB_IDLOW_SSBREV	0xF0000000 /* Sonics Backplane Revision code */
  #define  SSB_IDLOW_SSBREV_22	0x00000000 /* <= 2.2 */
@@ -49392,8 +61930,8 @@
  enum {
  	SSB_SPROM1CCODE_WORLD = 0,
 diff -up linux-2.6.23.noarch/include/linux/ssb/ssb.h.orig linux-2.6.23.noarch/include/linux/ssb/ssb.h
---- linux-2.6.23.noarch/include/linux/ssb/ssb.h.orig	2007-12-01 12:46:26.000000000 -0500
-+++ linux-2.6.23.noarch/include/linux/ssb/ssb.h	2007-12-01 12:46:43.000000000 -0500
+--- linux-2.6.23.noarch/include/linux/ssb/ssb.h.orig	2007-12-04 16:14:41.000000000 -0500
++++ linux-2.6.23.noarch/include/linux/ssb/ssb.h	2007-12-04 16:14:53.000000000 -0500
 @@ -15,22 +15,14 @@ struct pcmcia_device;
  struct ssb_bus;
  struct ssb_driver;
@@ -49495,3 +62033,76 @@
  	u8 chip_package;
  
  	/* List of devices (cores) on the backplane. */
+diff -up linux-2.6.23.noarch/Documentation/feature-removal-schedule.txt.orig linux-2.6.23.noarch/Documentation/feature-removal-schedule.txt
+--- linux-2.6.23.noarch/Documentation/feature-removal-schedule.txt.orig	2007-12-04 16:14:41.000000000 -0500
++++ linux-2.6.23.noarch/Documentation/feature-removal-schedule.txt	2007-12-04 16:14:53.000000000 -0500
+@@ -343,3 +343,20 @@ Why:	powermac supports proper generic pm
+ Who:	Johannes Berg <johannes at sipsolutions.net>
+ 
+ ---------------------------
++
++What:	bcm43xx wireless network driver
++When:	2.6.26
++Files:	drivers/net/wireless/bcm43xx
++Why:	This driver's functionality has been replaced by the
++	mac80211-based b43 and b43legacy drivers.
++Who:	John W. Linville <linville at tuxdriver.com>
++
++---------------------------
++
++What:	iee80211 softmac wireless networking component
++When:	2.6.26 (or after removal of bcm43xx and port of zd1211rw to mac80211)
++Files:	net/ieee80211/softmac
++Why:	No in-kernel drivers will depend on it any longer.
++Who:	John W. Linville <linville at tuxdriver.com>
++
++---------------------------
+diff -up linux-2.6.23.noarch/MAINTAINERS.orig linux-2.6.23.noarch/MAINTAINERS
+--- linux-2.6.23.noarch/MAINTAINERS.orig	2007-12-04 16:14:41.000000000 -0500
++++ linux-2.6.23.noarch/MAINTAINERS	2007-12-04 16:14:53.000000000 -0500
+@@ -807,7 +807,7 @@ P:	Stefano Brivio
+ M:	stefano.brivio at polimi.it
+ L:	linux-wireless at vger.kernel.org
+ W:	http://bcm43xx.berlios.de/
+-S:	Maintained
++S:	Obsolete
+ 
+ BEFS FILE SYSTEM
+ P:	Sergey S. Kostyliov
+@@ -2026,10 +2026,12 @@ W:	http://sourceforge.net/projects/e1000
+ S:	Supported
+ 
+ INTEL PRO/WIRELESS 2100 NETWORK CONNECTION SUPPORT
+-P:	Yi Zhu
++P:	Zhu Yi
+ M:	yi.zhu at intel.com
+ P:	James Ketrenos
+ M:	jketreno at linux.intel.com
++P:	Reinette Chatre
++M:	reinette.chatre at intel.com
+ L:	linux-wireless at vger.kernel.org
+ L:	ipw2100-devel at lists.sourceforge.net
+ L:	http://lists.sourceforge.net/mailman/listinfo/ipw2100-devel
+@@ -2037,10 +2039,12 @@ W:	http://ipw2100.sourceforge.net
+ S:	Supported
+ 
+ INTEL PRO/WIRELESS 2915ABG NETWORK CONNECTION SUPPORT
+-P:	Yi Zhu
++P:	Zhu Yi
+ M:	yi.zhu at intel.com
+ P:	James Ketrenos
+ M:	jketreno at linux.intel.com
++P:	Reinette Chatre
++M:	reinette.chatre at intel.com
+ L:	linux-wireless at vger.kernel.org
+ L:	ipw2100-devel at lists.sourceforge.net
+ L:	http://lists.sourceforge.net/mailman/listinfo/ipw2100-devel
+@@ -2050,6 +2054,8 @@ S:	Supported
+ INTEL WIRELESS WIFI LINK (iwlwifi)
+ P:	Zhu Yi
+ M:	yi.zhu at intel.com
++P:	Reinette Chatre
++M:	reinette.chatre at intel.com
+ L:	linux-wireless at vger.kernel.org
+ L:	ipw3945-devel at lists.sourceforge.net
+ W:	http://intellinuxwireless.org


--- linux-2.6-b43-rev-d.patch DELETED ---


--- linux-2.6-zd1211rw-mac80211.patch DELETED ---




More information about the fedora-extras-commits mailing list