rpms/kernel/devel linux-2.6-rtl8187.patch, NONE, 1.1 git-wireless-dev.patch, 1.15, 1.16 kernel-2.6.spec, 1.3290, 1.3291

John W. Linville (linville) fedora-extras-commits at redhat.com
Tue Jul 10 20:22:28 UTC 2007


Author: linville

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

Modified Files:
	git-wireless-dev.patch kernel-2.6.spec 
Added Files:
	linux-2.6-rtl8187.patch 
Log Message:
update git-wireless-dev.patch

linux-2.6-rtl8187.patch:

--- NEW FILE linux-2.6-rtl8187.patch ---
--- /dev/null	2007-07-10 08:31:05.354624318 -0400
+++ linux-2.6.22.noarch/include/linux/eeprom_93cx6.h	2007-07-10 16:06:46.000000000 -0400
@@ -0,0 +1,72 @@
+/*
+	Copyright (C) 2004 - 2006 rt2x00 SourceForge Project
+	<http://rt2x00.serialmonkey.com>
+
+	This program is free software; you can redistribute it 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 program 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, write to the
+	Free Software Foundation, Inc.,
+	59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+/*
+	Module: eeprom_93cx6
+	Abstract: EEPROM reader datastructures for 93cx6 chipsets.
+	Supported chipsets: 93c46 & 93c66.
+ */
+
+/*
+ * EEPROM operation defines.
+ */
+#define PCI_EEPROM_WIDTH_93C46	6
+#define PCI_EEPROM_WIDTH_93C66	8
+#define PCI_EEPROM_WIDTH_OPCODE	3
+#define PCI_EEPROM_WRITE_OPCODE	0x05
+#define PCI_EEPROM_READ_OPCODE	0x06
+#define PCI_EEPROM_EWDS_OPCODE	0x10
+#define PCI_EEPROM_EWEN_OPCODE	0x13
+
+/**
+ * struct eeprom_93cx6 - control structure for setting the commands
+ * for reading the eeprom data.
+ * @data: private pointer for the driver.
+ * @register_read(struct eeprom_93cx6 *eeprom): handler to
+ * read the eeprom register, this function should set all reg_* fields.
+ * @register_write(struct eeprom_93cx6 *eeprom): handler to
+ * write to the eeprom register by using all reg_* fields.
+ * @width: eeprom width, should be one of the PCI_EEPROM_WIDTH_* defines
+ * @reg_data_in: register field to indicate data input
+ * @reg_data_out: register field to indicate data output
+ * @reg_data_clock: register field to set the data clock
+ * @reg_chip_select: register field to set the chip select
+ *
+ * This structure is used for the communication between the driver
+ * and the eeprom_93cx6 handlers for reading the eeprom.
+ */
+struct eeprom_93cx6 {
+	void *data;
+
+	void (*register_read)(struct eeprom_93cx6 *eeprom);
+	void (*register_write)(struct eeprom_93cx6 *eeprom);
+
+	int width;
+
+	char reg_data_in;
+	char reg_data_out;
+	char reg_data_clock;
+	char reg_chip_select;
+};
+
+extern void eeprom_93cx6_read(struct eeprom_93cx6 *eeprom,
+	const u8 word, u16 *data);
+extern void eeprom_93cx6_multiread(struct eeprom_93cx6 *eeprom,
+	const u8 word, __le16 *data, const u16 words);
--- linux-2.6.22.noarch/MAINTAINERS.orig	2007-07-10 16:06:39.000000000 -0400
+++ linux-2.6.22.noarch/MAINTAINERS	2007-07-10 16:06:46.000000000 -0400
@@ -3098,6 +3098,16 @@ S:	Maintained
 RISCOM8 DRIVER
 S:	Orphan
 
+RTL818X WIRELESS DRIVER
+P:	Michael Wu
+M:	flamingice at sourmilk.net
+P:	Andrea Merello
+M:	andreamrl at tiscali.it
+L:	linux-wireless at vger.kernel.org
+W:	http://linuxwireless.org/
+T:	git kernel.org:/pub/scm/linux/kernel/git/mwu/mac80211-drivers.git
+S:	Maintained
+
 S3 SAVAGE FRAMEBUFFER DRIVER
 P:	Antonino Daplas
 M:	adaplas at gmail.com
--- linux-2.6.22.noarch/drivers/misc/Makefile.orig	2007-07-10 16:06:39.000000000 -0400
+++ linux-2.6.22.noarch/drivers/misc/Makefile	2007-07-10 16:06:46.000000000 -0400
@@ -14,3 +14,4 @@ obj-$(CONFIG_PHANTOM)		+= phantom.o
 obj-$(CONFIG_SGI_IOC4)		+= ioc4.o
 obj-$(CONFIG_SONY_LAPTOP)	+= sony-laptop.o
 obj-$(CONFIG_THINKPAD_ACPI)	+= thinkpad_acpi.o
+obj-$(CONFIG_EEPROM_93CX6)	+= eeprom_93cx6.o
--- /dev/null	2007-07-10 08:31:05.354624318 -0400
+++ linux-2.6.22.noarch/drivers/misc/eeprom_93cx6.c	2007-07-10 16:07:17.000000000 -0400
@@ -0,0 +1,241 @@
+/*
+	Copyright (C) 2004 - 2006 rt2x00 SourceForge Project
+	<http://rt2x00.serialmonkey.com>
+
+	This program is free software; you can redistribute it 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 program 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, write to the
+	Free Software Foundation, Inc.,
+	59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+/*
+	Module: eeprom_93cx6
+	Abstract: EEPROM reader routines for 93cx6 chipsets.
+	Supported chipsets: 93c46 & 93c66.
+ */
+
+#include <linux/kernel.h>
+#include <linux/module.h>
+#include <linux/version.h>
+#include <linux/delay.h>
+#include <linux/eeprom_93cx6.h>
+
+MODULE_AUTHOR("http://rt2x00.serialmonkey.com");
+MODULE_VERSION("1.0");
+MODULE_DESCRIPTION("EEPROM 93cx6 chip driver");
+MODULE_LICENSE("GPL");
+
+static inline void eeprom_93cx6_pulse_high(struct eeprom_93cx6 *eeprom)
+{
+	eeprom->reg_data_clock = 1;
+	eeprom->register_write(eeprom);
+
+	/*
+	 * Add a short delay for the pulse to work.
+	 * According to the specifications the "maximum minimum"
+	 * time should be 450ns.
+	 */
+	ndelay(450);
+}
+
+static inline void eeprom_93cx6_pulse_low(struct eeprom_93cx6 *eeprom)
+{
+	eeprom->reg_data_clock = 0;
+	eeprom->register_write(eeprom);
+
+	/*
+	 * Add a short delay for the pulse to work.
+	 * According to the specifications the "maximum minimum"
+	 * time should be 450ns.
+	 */
+	ndelay(450);
+}
+
+static void eeprom_93cx6_startup(struct eeprom_93cx6 *eeprom)
+{
+	/*
+	 * Clear all flags, and enable chip select.
+	 */
+	eeprom->register_read(eeprom);
+	eeprom->reg_data_in = 0;
+	eeprom->reg_data_out = 0;
+	eeprom->reg_data_clock = 0;
+	eeprom->reg_chip_select = 1;
+	eeprom->register_write(eeprom);
+
+	/*
+	 * kick a pulse.
+	 */
+	eeprom_93cx6_pulse_high(eeprom);
+	eeprom_93cx6_pulse_low(eeprom);
+}
+
+static void eeprom_93cx6_cleanup(struct eeprom_93cx6 *eeprom)
+{
+	/*
+	 * Clear chip_select and data_in flags.
+	 */
+	eeprom->register_read(eeprom);
+	eeprom->reg_data_in = 0;
+	eeprom->reg_chip_select = 0;
+	eeprom->register_write(eeprom);
+
+	/*
+	 * kick a pulse.
+	 */
[...1906 lines suppressed...]
+	0x63, 0x15, 0xc5  /* -66dBm */
+};
+
+void rtl8225z2_rf_init(struct ieee80211_hw *dev)
+{
+	struct rtl8187_priv *priv = dev->priv;
+	int i;
+
+	rtl8225_write(dev, 0x0, 0x2BF); 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);
+
+	rtl8225_write(dev, 0x0, 0x1B7);
+
+	for (i = 0; i < ARRAY_SIZE(rtl8225z2_rxgain); i++) {
+		rtl8225_write(dev, 0x1, i + 1);
+		rtl8225_write(dev, 0x2, rtl8225z2_rxgain[i]);
+	}
+
+	rtl8225_write(dev, 0x3, 0x080);
+	rtl8225_write(dev, 0x5, 0x004);
+	rtl8225_write(dev, 0x0, 0x0B7);
+	rtl8225_write(dev, 0x2, 0xc4D);
+
+	msleep(200);
+	rtl8225_write(dev, 0x2, 0x44D);
+	msleep(100);
+
+	if (!(rtl8225_read(dev, 6) & (1 << 7))) {
+		rtl8225_write(dev, 0x02, 0x0C4D);
+		msleep(200);
+		rtl8225_write(dev, 0x02, 0x044D);
+		msleep(100);
+		if (!(rtl8225_read(dev, 6) & (1 << 7)))
+			printk(KERN_WARNING "%s: RF Calibration Failed! %x\n",
+			       wiphy_name(dev->wiphy), rtl8225_read(dev, 6));
+	}
+
+	msleep(200);
+
+	rtl8225_write(dev, 0x0, 0x2BF);
+
+	for (i = 0; i < ARRAY_SIZE(rtl8225_agc); i++) {
+		rtl8225_write_phy_ofdm(dev, 0xB, rtl8225_agc[i]);
+		msleep(1);
+		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, 0x42); 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, 0x08); 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, 0x07); 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, 0x15); 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, 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, 0x17); 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, 0x00); 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, 0x0b, rtl8225z2_gain_bg[4 * 3]);
+	rtl8225_write_phy_ofdm(dev, 0x1b, rtl8225z2_gain_bg[4 * 3 + 1]);
+	rtl8225_write_phy_ofdm(dev, 0x1d, rtl8225z2_gain_bg[4 * 3 + 2]);
+	rtl8225_write_phy_ofdm(dev, 0x21, 0x37);
+
+	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, 0x9b); 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, 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);
+
+	rtl818x_iowrite8(priv, (u8 *)0xFF5B, 0x0D); msleep(1);
+
+	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 */
+
+	rtl818x_iowrite8(priv, &priv->map->TX_ANTENNA, 0x03);	/* B: 0x00 */
+	msleep(1);
+	rtl818x_iowrite32(priv, (__le32 *)0xFF94, 0x3dc00002);
+}
+
+void rtl8225_rf_stop(struct ieee80211_hw *dev)
+{
+	u8 reg;
+	struct rtl8187_priv *priv = dev->priv;
+
+	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);
+	rtl818x_iowrite8(priv, &priv->map->CONFIG3, reg | RTL818X_CONFIG3_ANAPARAM_WRITE);
+	rtl818x_iowrite32(priv, &priv->map->ANAPARAM2, RTL8225_ANAPARAM2_OFF);
+	rtl818x_iowrite32(priv, &priv->map->ANAPARAM, RTL8225_ANAPARAM_OFF);
+	rtl818x_iowrite8(priv, &priv->map->CONFIG3, reg & ~RTL818X_CONFIG3_ANAPARAM_WRITE);
+	rtl818x_iowrite8(priv, &priv->map->EEPROM_CMD, RTL818X_EEPROM_CMD_NORMAL);
+}
+
+void rtl8225_rf_set_channel(struct ieee80211_hw *dev, int channel)
+{
+	struct rtl8187_priv *priv = dev->priv;
+
+	if (priv->rf_init == rtl8225_rf_init)
+		rtl8225_rf_set_tx_power(dev, channel);
+	else
+		rtl8225z2_rf_set_tx_power(dev, channel);
+
+	rtl8225_write(dev, 0x7, rtl8225_chan[channel - 1]);
+	msleep(10);
+}
--- linux-2.6.22.noarch/drivers/net/wireless/Kconfig.orig	2007-07-10 16:06:39.000000000 -0400
+++ linux-2.6.22.noarch/drivers/net/wireless/Kconfig	2007-07-10 16:06:46.000000000 -0400
@@ -546,6 +546,18 @@ config USB_ZD1201
 	  To compile this driver as a module, choose M here: the
 	  module will be called zd1201.
 
+config RTL8187
+	tristate "Realtek 8187 USB support"
+	depends on MAC80211 && USB && WLAN_80211 && EXPERIMENTAL
+	select EEPROM_93CX6
+	---help---
+	  This is a driver for RTL8187 based cards.
+	  These are USB based chips found in cards such as:
+
+	  Netgear WG111v2
+
+	  Thanks to Realtek for their support!
+
 source "drivers/net/wireless/hostap/Kconfig"
 source "drivers/net/wireless/bcm43xx/Kconfig"
 source "drivers/net/wireless/zd1211rw/Kconfig"

git-wireless-dev.patch:

View full diff with command:
/usr/bin/cvs -f diff  -kk -u -N -r 1.15 -r 1.16 git-wireless-dev.patch
Index: git-wireless-dev.patch
===================================================================
RCS file: /cvs/pkgs/rpms/kernel/devel/git-wireless-dev.patch,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -r1.15 -r1.16
--- git-wireless-dev.patch	6 Jul 2007 14:55:01 -0000	1.15
+++ git-wireless-dev.patch	10 Jul 2007 20:21:50 -0000	1.16
@@ -1,5 +1,5 @@
---- linux-2.6.21.noarch/CREDITS.orig	2007-06-25 09:16:57.000000000 -0400
-+++ linux-2.6.21.noarch/CREDITS	2007-06-25 09:55:35.000000000 -0400
+--- linux-2.6.22.noarch/CREDITS.orig	2007-07-10 15:54:56.000000000 -0400
++++ linux-2.6.22.noarch/CREDITS	2007-07-10 15:56:02.000000000 -0400
 @@ -665,6 +665,11 @@ D: Minor updates to SCSI types, added /p
  S: (ask for current address)
  S: USA
@@ -66,8 +66,8 @@
  N: Lars Wirzenius
  E: liw at iki.fi
  D: Linux System Administrator's Guide, author, former maintainer
---- linux-2.6.21.noarch/include/linux/nl80211.h.orig	2007-06-25 09:16:53.000000000 -0400
-+++ linux-2.6.21.noarch/include/linux/nl80211.h	2007-06-25 09:55:35.000000000 -0400
+--- linux-2.6.22.noarch/include/linux/nl80211.h.orig	2007-07-10 15:54:56.000000000 -0400
++++ linux-2.6.22.noarch/include/linux/nl80211.h	2007-07-10 15:56:02.000000000 -0400
 @@ -7,6 +7,217 @@
   */
  
@@ -343,8 +343,8 @@
 +#define NL80211_KEYTYPE_MAX (__NL80211_KEYTYPE_AFTER_LAST - 1)
 +
  #endif /* __LINUX_NL80211_H */
---- linux-2.6.21.noarch/include/linux/ieee80211.h.orig	2007-06-25 09:16:53.000000000 -0400
-+++ linux-2.6.21.noarch/include/linux/ieee80211.h	2007-06-25 09:55:35.000000000 -0400
+--- linux-2.6.22.noarch/include/linux/ieee80211.h.orig	2007-07-10 15:54:56.000000000 -0400
++++ linux-2.6.22.noarch/include/linux/ieee80211.h	2007-07-10 15:56:02.000000000 -0400
 @@ -106,6 +106,75 @@ struct ieee80211_hdr {
  } __attribute__ ((packed));
  
@@ -643,88 +643,8 @@
 +};
 +
  #endif /* IEEE80211_H */
---- /dev/null	2007-06-25 08:13:03.438982207 -0400
-+++ linux-2.6.21.noarch/include/linux/eeprom_93cx6.h	2007-06-25 09:55:35.000000000 -0400
-@@ -0,0 +1,77 @@
-+/*
-+	Copyright (C) 2004 - 2006 rt2x00 SourceForge Project
-+	<http://rt2x00.serialmonkey.com>
-+
-+	This program is free software; you can redistribute it 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 program 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, write to the
-+	Free Software Foundation, Inc.,
-+	59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-+ */
-+
-+/*
-+	Module: eeprom_93cx6
-+	Abstract: EEPROM reader datastructures for 93cx6 chipsets.
-+	Supported chipsets: 93c46 & 93c66.
-+ */
-+
-+/*
-+ * EEPROM operation defines.
-+ */
-+#define PCI_EEPROM_WIDTH_93C46	6
-+#define PCI_EEPROM_WIDTH_93C66	8
-+#define PCI_EEPROM_WIDTH_OPCODE	3
-+#define PCI_EEPROM_WRITE_OPCODE	0x05
-+#define PCI_EEPROM_READ_OPCODE	0x06
-+#define PCI_EEPROM_EWDS_OPCODE	0x10
-+#define PCI_EEPROM_EWEN_OPCODE	0x13
-+
-+/**
-+ * struct eeprom_93cx6 - control structure for setting the commands
-+ * for reading the eeprom data.
-+ * @data: private pointer for the driver.
-+ * @register_read(struct eeprom_93cx6 *eeprom): handler to
-+ * read the eeprom register, this function should set all reg_* fields.
-+ * @register_write(struct eeprom_93cx6 *eeprom): handler to
-+ * write to the eeprom register by using all reg_* fields.
-+ * @width: eeprom width, should be one of the PCI_EEPROM_WIDTH_* defines
-+ * @reg_data_in: register field to indicate data input
-+ * @reg_data_out: register field to indicate data output
-+ * @reg_data_clock: register field to set the data clock
-+ * @reg_chip_select: register field to set the chip select
-+ *
-+ * This structure is used for the communication between the driver
-+ * and the eeprom_93cx6 handlers for reading the eeprom.
-+ */
-+struct eeprom_93cx6 {
-+	void *data;
-+
-+	void (*register_read)(struct eeprom_93cx6 *eeprom);
-+	void (*register_write)(struct eeprom_93cx6 *eeprom);
-+
-+	int width;
-+
-+	char reg_data_in;
-+	char reg_data_out;
-+	char reg_data_clock;
-+	char reg_chip_select;
-+};
-+
-+extern void eeprom_93cx6_read(struct eeprom_93cx6 *eeprom,
-+	const u8 word, u16 *data);
-+extern void eeprom_93cx6_multiread(struct eeprom_93cx6 *eeprom,
-+	const u8 word, __le16 *data, const u16 words);
-+
-+extern void eeprom_93cx6_write(struct eeprom_93cx6 *eeprom,
-+	const u8 word, u16 data);
-+extern void eeprom_93cx6_multiwrite(struct eeprom_93cx6 *eeprom,
-+	const u8 word, __le16 *data, const u16 words);
---- /dev/null	2007-06-25 08:13:03.438982207 -0400
-+++ linux-2.6.21.noarch/include/linux/ssb/ssb_driver_chipcommon.h	2007-06-25 09:55:35.000000000 -0400
+--- /dev/null	2007-07-10 08:31:05.354624318 -0400
++++ linux-2.6.22.noarch/include/linux/ssb/ssb_driver_chipcommon.h	2007-07-10 15:56:02.000000000 -0400
 @@ -0,0 +1,387 @@
 +#ifndef LINUX_SSB_CHIPCO_H_
 +#define LINUX_SSB_CHIPCO_H_
@@ -1113,8 +1033,8 @@
 +
 +#endif /* __KERNEL__ */
 +#endif /* LINUX_SSB_CHIPCO_H_ */
---- /dev/null	2007-06-25 08:13:03.438982207 -0400
-+++ linux-2.6.21.noarch/include/linux/ssb/ssb_driver_extif.h	2007-06-25 09:55:35.000000000 -0400
+--- /dev/null	2007-07-10 08:31:05.354624318 -0400
++++ linux-2.6.22.noarch/include/linux/ssb/ssb_driver_extif.h	2007-07-10 15:56:02.000000000 -0400
 @@ -0,0 +1,163 @@
 +/*
 + * Hardware-specific External Interface I/O core definitions
@@ -1279,8 +1199,8 @@
 +
 +#endif /* __KERNEL__ */
 +#endif /* LINUX_SSB_EXTIFCORE_H_ */
---- /dev/null	2007-06-25 08:13:03.438982207 -0400
-+++ linux-2.6.21.noarch/include/linux/ssb/ssb_driver_mips.h	2007-06-25 09:55:35.000000000 -0400
+--- /dev/null	2007-07-10 08:31:05.354624318 -0400
++++ linux-2.6.22.noarch/include/linux/ssb/ssb_driver_mips.h	2007-07-10 15:56:02.000000000 -0400
 @@ -0,0 +1,47 @@
 +#ifndef LINUX_SSB_MIPSCORE_H_
 +#define LINUX_SSB_MIPSCORE_H_
@@ -1329,8 +1249,8 @@
 +
 +#endif /* __KERNEL__ */
 +#endif /* LINUX_SSB_MIPSCORE_H_ */
---- /dev/null	2007-06-25 08:13:03.438982207 -0400
-+++ linux-2.6.21.noarch/include/linux/ssb/ssb_regs.h	2007-06-25 09:55:35.000000000 -0400
+--- /dev/null	2007-07-10 08:31:05.354624318 -0400
++++ linux-2.6.22.noarch/include/linux/ssb/ssb_regs.h	2007-07-10 15:56:02.000000000 -0400
 @@ -0,0 +1,294 @@
 +#ifndef LINUX_SSB_REGS_H_
 +#define LINUX_SSB_REGS_H_
@@ -1535,16 +1455,16 @@
 +#define  SSB_SPROM1_GPIOB_P3		0xFF00	/* Pin 3 */
 +#define  SSB_SPROM1_GPIOB_P3_SHIFT	8
 +#define SSB_SPROM1_MAXPWR		0x1068	/* Power Amplifier Max Power */
-+#define  SSB_SPROM1_MAXPWR_A		0x00FF	/* A-PHY (in dBm Q5.2) */
-+#define  SSB_SPROM1_MAXPWR_BG		0xFF00	/* B-PHY and G-PHY (in dBm Q5.2) */
-+#define  SSB_SPROM1_MAXPWR_BG_SHIFT	8
++#define  SSB_SPROM1_MAXPWR_BG		0x00FF	/* B-PHY and G-PHY (in dBm Q5.2) */
++#define  SSB_SPROM1_MAXPWR_A		0xFF00	/* A-PHY (in dBm Q5.2) */
++#define  SSB_SPROM1_MAXPWR_A_SHIFT	8
 +#define SSB_SPROM1_PA1B0		0x106A
 +#define SSB_SPROM1_PA1B1		0x106C
 +#define SSB_SPROM1_PA1B2		0x106E
 +#define SSB_SPROM1_ITSSI		0x1070	/* Idle TSSI Target */
-+#define  SSB_SPROM1_ITSSI_A		0x00FF	/* A-PHY */
-+#define  SSB_SPROM1_ITSSI_BG		0xFF00	/* B-PHY and G-PHY */
-+#define  SSB_SPROM1_ITSSI_BG_SHIFT	8
++#define  SSB_SPROM1_ITSSI_BG		0x00FF	/* B-PHY and G-PHY*/
++#define  SSB_SPROM1_ITSSI_A		0xFF00	/* A-PHY */
++#define  SSB_SPROM1_ITSSI_A_SHIFT	8
 +#define SSB_SPROM1_BFLLO		0x1072	/* Boardflags (low 16 bits) */
 +#define SSB_SPROM1_AGAIN		0x1074	/* Antenna Gain (in dBm Q5.2) */
 +#define  SSB_SPROM1_AGAIN_A		0x00FF	/* A-PHY */
@@ -1626,8 +1546,8 @@
 +
 +#endif /* __KERNEL__ */
 +#endif /* LINUX_SSB_REGS_H_ */
---- /dev/null	2007-06-25 08:13:03.438982207 -0400
-+++ linux-2.6.21.noarch/include/linux/ssb/ssb_driver_pci.h	2007-06-25 09:55:35.000000000 -0400
+--- /dev/null	2007-07-10 08:31:05.354624318 -0400
++++ linux-2.6.22.noarch/include/linux/ssb/ssb_driver_pci.h	2007-07-10 15:56:02.000000000 -0400
 @@ -0,0 +1,108 @@
 +#ifndef LINUX_SSB_PCICORE_H_
 +#define LINUX_SSB_PCICORE_H_
@@ -1737,9 +1657,9 @@
 +#endif /* CONFIG_SSB_DRIVER_PCICORE */
 +#endif /* __KERNEL__ */
 +#endif /* LINUX_SSB_PCICORE_H_ */
[...24871 lines suppressed...]
++	     SSB_SPROM1_MAXPWR_A_SHIFT);
++	SPEX(maxpwr_bg, SSB_SPROM1_MAXPWR, SSB_SPROM1_MAXPWR_BG, 0);
++	SPEX(itssi_a, SSB_SPROM1_ITSSI, SSB_SPROM1_ITSSI_A,
++	     SSB_SPROM1_ITSSI_A_SHIFT);
++	SPEX(itssi_bg, SSB_SPROM1_ITSSI, SSB_SPROM1_ITSSI_BG, 0);
 +	SPEX(boardflags_lo, SSB_SPROM1_BFLLO, 0xFFFF, 0);
 +	SPEX(antenna_gain_a, SSB_SPROM1_AGAIN, SSB_SPROM1_AGAIN_A, 0);
 +	SPEX(antenna_gain_bg, SSB_SPROM1_AGAIN, SSB_SPROM1_AGAIN_BG,
@@ -91125,7 +87308,8 @@
 +	out->ofdmgpo |= (in[SPOFF(SSB_SPROM3_OFDMGPO) + 1] & 0x00FF) << 8;
 +}
 +
-+static int sprom_extract(struct ssb_sprom *out, const u16 *in)
++static int sprom_extract(struct ssb_bus *bus,
++			 struct ssb_sprom *out, const u16 *in)
 +{
 +	memset(out, 0, sizeof(*out));
 +
@@ -91133,16 +87317,23 @@
 +	SPEX(crc, SSB_SPROM_REVISION, SSB_SPROM_REVISION_CRC,
 +	     SSB_SPROM_REVISION_CRC_SHIFT);
 +
-+	if (out->revision == 0)
-+		goto unsupported;
-+	if (out->revision >= 1 && out->revision <= 3)
++	if ((bus->chip_id & 0xFF00) == 0x4400) {
++		/* Workaround: The BCM44XX chip has a stupid revision
++		 * number stored in the SPROM.
++		 * Always extract r1. */
 +		sprom_extract_r1(&out->r1, in);
-+	if (out->revision >= 2 && out->revision <= 3)
-+		sprom_extract_r2(&out->r2, in);
-+	if (out->revision == 3)
-+		sprom_extract_r3(&out->r3, in);
-+	if (out->revision >= 4)
-+		goto unsupported;
++	} else {
++		if (out->revision == 0)
++			goto unsupported;
++		if (out->revision >= 1 && out->revision <= 3)
++			sprom_extract_r1(&out->r1, in);
++		if (out->revision >= 2 && out->revision <= 3)
++			sprom_extract_r2(&out->r2, in);
++		if (out->revision == 3)
++			sprom_extract_r3(&out->r3, in);
++		if (out->revision >= 4)
++			goto unsupported;
++	}
 +
 +	return 0;
 +unsupported:
@@ -91152,13 +87343,12 @@
 +	return 0;
 +}
 +
-+int ssb_pci_sprom_get(struct ssb_bus *bus)
++static int ssb_pci_sprom_get(struct ssb_bus *bus,
++			     struct ssb_sprom *sprom)
 +{
 +	int err = -ENOMEM;
 +	u16 *buf;
 +
-+	assert(bus->bustype == SSB_BUSTYPE_PCI);
-+
 +	buf = kcalloc(SSB_SPROMSIZE_WORDS, sizeof(u16), GFP_KERNEL);
 +	if (!buf)
 +		goto out;
@@ -91168,21 +87358,36 @@
 +		ssb_printk(KERN_WARNING PFX
 +			   "WARNING: Invalid SPROM CRC (corrupt SPROM)\n");
 +	}
-+	err = sprom_extract(&bus->sprom, buf);
++	err = sprom_extract(bus, sprom, buf);
 +
 +	kfree(buf);
 +out:
 +	return err;
 +}
 +
-+void ssb_pci_get_boardtype(struct ssb_bus *bus)
++static void ssb_pci_get_boardinfo(struct ssb_bus *bus,
++				  struct ssb_boardinfo *bi)
 +{
 +	pci_read_config_word(bus->host_pci, PCI_SUBSYSTEM_VENDOR_ID,
-+			     &bus->board_vendor);
++			     &bi->vendor);
 +	pci_read_config_word(bus->host_pci, PCI_SUBSYSTEM_ID,
-+			     &bus->board_type);
++			     &bi->type);
 +	pci_read_config_word(bus->host_pci, PCI_REVISION_ID,
-+			     &bus->board_rev);
++			     &bi->rev);
++}
++
++int ssb_pci_get_invariants(struct ssb_bus *bus,
++			   struct ssb_init_invariants *iv)
++{
++	int err;
++
++	err = ssb_pci_sprom_get(bus, &iv->sprom);
++	if (err)
++		goto out;
++	ssb_pci_get_boardinfo(bus, &iv->boardinfo);
++
++out:
++	return err;
 +}
 +
 +static u16 ssb_pci_read16(struct ssb_device *dev, u16 offset)
@@ -91378,18 +87583,12 @@
 +	err = device_create_file(&pdev->dev, &dev_attr_ssb_sprom);
 +	if (err)
 +		goto out;
-+	err = ssb_pci_sprom_get(bus);
-+	if (err)
-+		goto err_remove_sprom_file;
 +
 +out:
 +	return err;
-+err_remove_sprom_file:
-+	device_remove_file(&pdev->dev, &dev_attr_ssb_sprom);
-+	return err;
 +}
---- /dev/null	2007-06-25 08:13:03.438982207 -0400
-+++ linux-2.6.21.noarch/drivers/ssb/driver_chipcommon.c	2007-06-25 09:55:35.000000000 -0400
+--- /dev/null	2007-07-10 08:31:05.354624318 -0400
++++ linux-2.6.22.noarch/drivers/ssb/driver_chipcommon.c	2007-07-10 15:56:02.000000000 -0400
 @@ -0,0 +1,402 @@
 +/*
 + * Sonics Silicon Backplane
@@ -91686,15 +87885,15 @@
 +
 +	/* set register for external IO to control LED. */
 +	chipco_write32(cc, SSB_CHIPCO_PROG_CFG, 0x11);
-+	tmp = ceildiv(10, ns) << SSB_PROG_WCNT_3_SHIFT;		/* Waitcount-3 = 10ns */
-+	tmp |= ceildiv(40, ns) << SSB_PROG_WCNT_1_SHIFT;	/* Waitcount-1 = 40ns */
-+	tmp |= ceildiv(240, ns);				/* Waitcount-0 = 240ns */
++	tmp = DIV_ROUND_UP(10, ns) << SSB_PROG_WCNT_3_SHIFT;		/* Waitcount-3 = 10ns */
++	tmp |= DIV_ROUND_UP(40, ns) << SSB_PROG_WCNT_1_SHIFT;	/* Waitcount-1 = 40ns */
++	tmp |= DIV_ROUND_UP(240, ns);				/* Waitcount-0 = 240ns */
 +	chipco_write32(cc, SSB_CHIPCO_PROG_WAITCNT, tmp);	/* 0x01020a0c for a 100Mhz clock */
 +
 +	/* Set timing for the flash */
-+	tmp = ceildiv(10, ns) << SSB_FLASH_WCNT_3_SHIFT;	/* Waitcount-3 = 10nS */
-+	tmp |= ceildiv(10, ns) << SSB_FLASH_WCNT_1_SHIFT;	/* Waitcount-1 = 10nS */
-+	tmp |= ceildiv(120, ns);				/* Waitcount-0 = 120nS */
++	tmp = DIV_ROUND_UP(10, ns) << SSB_FLASH_WCNT_3_SHIFT;	/* Waitcount-3 = 10nS */
++	tmp |= DIV_ROUND_UP(10, ns) << SSB_FLASH_WCNT_1_SHIFT;	/* Waitcount-1 = 10nS */
++	tmp |= DIV_ROUND_UP(120, ns);				/* Waitcount-0 = 120nS */
 +	if ((bus->chip_id == 0x5365) ||
 +	    (dev->id.revision < 9))
 +		chipco_write32(cc, SSB_CHIPCO_FLASH_WAITCNT, tmp);
@@ -91705,10 +87904,10 @@
 +
 +	if (bus->chip_id == 0x5350) {
 +		/* Enable EXTIF */
-+		tmp = ceildiv(10, ns) << SSB_PROG_WCNT_3_SHIFT;	  /* Waitcount-3 = 10ns */
-+		tmp |= ceildiv(20, ns) << SSB_PROG_WCNT_2_SHIFT;  /* Waitcount-2 = 20ns */
-+		tmp |= ceildiv(100, ns) << SSB_PROG_WCNT_1_SHIFT; /* Waitcount-1 = 100ns */
-+		tmp |= ceildiv(120, ns);			  /* Waitcount-0 = 120ns */
++		tmp = DIV_ROUND_UP(10, ns) << SSB_PROG_WCNT_3_SHIFT;	  /* Waitcount-3 = 10ns */
++		tmp |= DIV_ROUND_UP(20, ns) << SSB_PROG_WCNT_2_SHIFT;  /* Waitcount-2 = 20ns */
++		tmp |= DIV_ROUND_UP(100, ns) << SSB_PROG_WCNT_1_SHIFT; /* Waitcount-1 = 100ns */
++		tmp |= DIV_ROUND_UP(120, ns);			  /* Waitcount-0 = 120ns */
 +		chipco_write32(cc, SSB_CHIPCO_PROG_WAITCNT, tmp); /* 0x01020a0c for a 100Mhz clock */
 +	}
 +}
@@ -91793,8 +87992,8 @@
 +	return nr_ports;
 +}
 +#endif /* CONFIG_SSB_SERIAL */
---- /dev/null	2007-06-25 08:13:03.438982207 -0400
-+++ linux-2.6.21.noarch/drivers/ssb/Kconfig	2007-06-25 09:55:35.000000000 -0400
+--- /dev/null	2007-07-10 08:31:05.354624318 -0400
++++ linux-2.6.22.noarch/drivers/ssb/Kconfig	2007-07-10 15:56:02.000000000 -0400
 @@ -0,0 +1,93 @@
 +menu "Sonics Silicon Backplane"
 +
@@ -91889,8 +88088,8 @@
 +	  If unsure, say N
 +
 +endmenu
---- /dev/null	2007-06-25 08:13:03.438982207 -0400
-+++ linux-2.6.21.noarch/drivers/ssb/scan.c	2007-06-25 09:55:35.000000000 -0400
+--- /dev/null	2007-07-10 08:31:05.354624318 -0400
++++ linux-2.6.22.noarch/drivers/ssb/scan.c	2007-07-10 15:56:02.000000000 -0400
 @@ -0,0 +1,407 @@
 +/*
 + * Sonics Silicon Backplane
@@ -92299,8 +88498,8 @@
 +	ssb_iounmap(bus);
 +	goto out;
 +}
---- /dev/null	2007-06-25 08:13:03.438982207 -0400
-+++ linux-2.6.21.noarch/drivers/ssb/driver_pcicore.c	2007-06-25 09:55:35.000000000 -0400
+--- /dev/null	2007-07-10 08:31:05.354624318 -0400
++++ linux-2.6.22.noarch/drivers/ssb/driver_pcicore.c	2007-07-10 15:56:02.000000000 -0400
 @@ -0,0 +1,556 @@
 +/*
 + * Sonics Silicon Backplane


Index: kernel-2.6.spec
===================================================================
RCS file: /cvs/pkgs/rpms/kernel/devel/kernel-2.6.spec,v
retrieving revision 1.3290
retrieving revision 1.3291
diff -u -r1.3290 -r1.3291
--- kernel-2.6.spec	10 Jul 2007 19:51:45 -0000	1.3290
+++ kernel-2.6.spec	10 Jul 2007 20:21:51 -0000	1.3291
@@ -559,6 +559,7 @@
 Patch661: linux-2.6-libata-ich8m-add-pciid.patch
 Patch670: linux-2.6-ata-quirk.patch
 Patch680: git-wireless-dev.patch
+Patch681: linux-2.6-rtl8187.patch
 Patch690: linux-2.6-e1000-ich9.patch
 Patch691: linux-2.6-sky2-restore-workarounds.patch
 Patch710: linux-2.6-bcm43xx-pci-neuter.patch
@@ -1158,8 +1159,10 @@
 # ia64 ata quirk
 ApplyPatch linux-2.6-ata-quirk.patch
 
-# Add the new wireless stack and drivers from wireless-dev
+# Add the wireless stack updates and drivers from wireless-dev
 ApplyPatch git-wireless-dev.patch
+# Add the rtl8187 driver from upstream
+ApplyPatch linux-2.6-rtl8187.patch
 # add patch from markmc so that e1000 supports ICH9
 ApplyPatch linux-2.6-e1000-ich9.patch
 # sky2: restore workarounds for lost interrupts
@@ -2098,6 +2101,10 @@
 %endif
 
 %changelog
+* Tue Jul 10 2007 John W. Linville <linville at redhat.com>
+- Update git-wireless-dev.patch
+- Add upstream version of rtl8187 patch
+
 * Tue Jul 10 2007 Dave Jones <davej at redhat.com>
 - Split utrace up into multiple patches.
 




More information about the fedora-extras-commits mailing list