rpms/kernel/devel linux-2.6-acpi-eeepc-hotkey.patch, NONE, 1.1 linux-2.6-netdev-atl2.patch, NONE, 1.1 config-generic, 1.64, 1.65 config-x86-generic, 1.25, 1.26 config-x86_64-generic, 1.22, 1.23 kernel.spec, 1.403, 1.404

Chuck Ebbert (cebbert) fedora-extras-commits at redhat.com
Tue Feb 5 19:11:26 UTC 2008


Author: cebbert

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

Modified Files:
	config-generic config-x86-generic config-x86_64-generic 
	kernel.spec 
Added Files:
	linux-2.6-acpi-eeepc-hotkey.patch linux-2.6-netdev-atl2.patch 
Log Message:
* Tue Feb 05 2008 Chuck Ebbert <cebbert at redhat.com>
- atl2 network driver 2.0.4
- ASUS Eeepc ACPI hotkey driver


linux-2.6-acpi-eeepc-hotkey.patch:

--- NEW FILE linux-2.6-acpi-eeepc-hotkey.patch ---
Signed-off-by: Eric Cooper <ecc at cmu.edu>

---
 drivers/misc/Kconfig  |   10 +
 drivers/misc/Makefile |    1 +
 drivers/misc/eeepc.c  |  447 +++++++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 458 insertions(+), 0 deletions(-)
 create mode 100644 drivers/misc/eeepc.c

diff --git a/drivers/misc/Kconfig b/drivers/misc/Kconfig
index b1f9a40..8fd1ccb 100644
--- a/drivers/misc/Kconfig
+++ b/drivers/misc/Kconfig
@@ -251,4 +251,14 @@ config ATMEL_SSC
 
 	  If unsure, say N.
 
+config EEEPC
+        tristate "Eee PC Hotkey Driver (EXPERIMENTAL)"
+        depends on X86
+        depends on ACPI
+	depends on EXPERIMENTAL && !ACPI_ASUS
+        ---help---
+	  This driver supports the Fn-Fx keys on Eee PC laptops.
+
+	  If you have an Eee PC laptop, say Y or M here.
+
 endif # MISC_DEVICES
diff --git a/drivers/misc/Makefile b/drivers/misc/Makefile
index 87f2685..699b35c 100644
--- a/drivers/misc/Makefile
+++ b/drivers/misc/Makefile
@@ -17,3 +17,4 @@ obj-$(CONFIG_SONY_LAPTOP)	+= sony-laptop.o
 obj-$(CONFIG_THINKPAD_ACPI)	+= thinkpad_acpi.o
 obj-$(CONFIG_FUJITSU_LAPTOP)	+= fujitsu-laptop.o
 obj-$(CONFIG_EEPROM_93CX6)	+= eeprom_93cx6.o
+obj-$(CONFIG_EEEPC)		+= eeepc.o
diff --git a/drivers/misc/eeepc.c b/drivers/misc/eeepc.c
new file mode 100644
index 0000000..2e33117
--- /dev/null
+++ b/drivers/misc/eeepc.c
@@ -0,0 +1,447 @@
+/*
+ *  eepc_acpi.c - Asus Eee PC hotkey driver
+ *
+ *  Copyright (C) 2008 Eric Cooper <ecc at cmu.edu>
+ *
+ *  Based on asus_acpi.c as patched for the Eee PC by Asus:
+ *  ftp://ftp.asus.com/pub/ASUS/EeePC/701/ASUS_ACPI_071126.rar
+ *
+ *  Copyright (C) 2002-2005 Julien Lerouge, 2003-2006 Karol Kozimor
+ *
+ *  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.
+ */
+
+#include <linux/kernel.h>
+#include <linux/module.h>
+#include <linux/init.h>
+#include <linux/types.h>
+#include <linux/platform_device.h>
+#include <acpi/acpi_drivers.h>
+#include <acpi/acpi_bus.h>
+#include <asm/uaccess.h>
+
+#define EEEPC_HOTK_NAME          "Eee PC Hotkey Driver"
+#define EEEPC_HOTK_FILE          "eeepc"
+#define EEEPC_HOTK_CLASS         "hotkey"
+#define EEEPC_HOTK_DEVICE_NAME   "Hotkey"
+#define EEEPC_HOTK_HID           "ASUS010"
+
+#define EEEPC_LOG	EEEPC_HOTK_FILE ": "
+#define EEEPC_ERR	KERN_ERR EEEPC_LOG
+#define EEEPC_WARNING	KERN_WARNING EEEPC_LOG
+#define EEEPC_NOTICE	KERN_NOTICE EEEPC_LOG
+#define EEEPC_INFO	KERN_INFO EEEPC_LOG
+
+/*
+ * Definitions for Asus EeePC
+ */
+
+#define	NOTIFY_WLAN_ON	0x10
+
+enum {
+	DISABLE_ASL_WLAN = 0x0001,
+	DISABLE_ASL_BLUETOOTH = 0x0002,
+	DISABLE_ASL_IRDA = 0x0004,
+	DISABLE_ASL_CAMERA = 0x0008,
+	DISABLE_ASL_TV = 0x0010,
+	DISABLE_ASL_GPS = 0x0020,
+	DISABLE_ASL_DISPLAYSWITCH = 0x0040,
+	DISABLE_ASL_MODEM = 0x0080,
+	DISABLE_ASL_CARDREADER = 0x0100
+};
+
+enum {
+	CM_ASL_WLAN = 0,
+	CM_ASL_BLUETOOTH,
+	CM_ASL_IRDA,
+	CM_ASL_1394,
+	CM_ASL_CAMERA,
+	CM_ASL_TV,
+	CM_ASL_GPS,
+	CM_ASL_DVDROM,
+	CM_ASL_DISPLAYSWITCH,
+	CM_ASL_PANELBRIGHT,
+	CM_ASL_BIOSFLASH,
+	CM_ASL_ACPIFLASH,
+	CM_ASL_CPUFV,
+	CM_ASL_CPUTEMPERATURE,
+	CM_ASL_FANCPU,
+	CM_ASL_FANCHASSIS,
+	CM_ASL_USBPORT1,
+	CM_ASL_USBPORT2,
+	CM_ASL_USBPORT3,
+	CM_ASL_MODEM,
+	CM_ASL_CARDREADER,
+	CM_ASL_LID
+};
+
+const char *cm_getv[] = {
+	"WLDG", NULL, NULL, NULL,
+	"CAMG", NULL, NULL, NULL,
+	NULL, "PBLG", NULL, NULL,
+	"CFVG", NULL, NULL, NULL,
+	"USBG", NULL, NULL, "MODG",
+	"CRDG", "LIDG"
+};
+
+const char *cm_setv[] = {
+	"WLDS", NULL, NULL, NULL,
+	"CAMS", NULL, NULL, NULL,
+	"SDSP", "PBLS", "HDPS", NULL,
+	"CFVS", NULL, NULL, NULL,
+	"USBG", NULL, NULL, "MODS",
+	"CRDS", NULL
+};
+
+static unsigned int init_flag;
+
+/*
+ * This is the main structure, we can use it to store useful information
+ * about the hotk device
+ */
+struct eeepc_hotk {
+	struct acpi_device *device;	/* the device we are in */
+	acpi_handle handle;		/* the handle of the hotk device */
+	u32 cm_supported;		/* the control methods supported
+					   by this BIOS */
+	u16 event_count[128];		/* count for each event */
+};
+
+/* The actual device the driver binds to */
+static struct eeepc_hotk *ehotk;
+
+/*
+ * The hotkey driver declaration
+ */
+static int eeepc_hotk_add(struct acpi_device *device);
+static int eeepc_hotk_remove(struct acpi_device *device, int type);
+
+static const struct acpi_device_id eee_device_ids[] = {
+	{EEEPC_HOTK_HID, 0},
+	{"", 0},
+};
+
+static struct acpi_driver eeepc_hotk_driver = {
+	.name = EEEPC_HOTK_NAME,
+	.class = EEEPC_HOTK_CLASS,
+	.ids = eee_device_ids,
+	.ops = {
+		.add = eeepc_hotk_add,
+		.remove = eeepc_hotk_remove,
+	},
+};
+
+MODULE_AUTHOR("Julien Lerouge, Karol Kozimor, Eric Cooper");
+MODULE_DESCRIPTION(EEEPC_HOTK_NAME);
+MODULE_LICENSE("GPL");
+
+/*
+ * returns 1 if write is successful, otherwise 0.
+ */
+static int write_acpi_int(acpi_handle handle, const char *method, int val,
+			  struct acpi_buffer *output)
+{
+	struct acpi_object_list params;
+	union acpi_object in_obj;
+	acpi_status status;
+
+	params.count = 1;
+	params.pointer = &in_obj;
+	in_obj.type = ACPI_TYPE_INTEGER;
+	in_obj.integer.value = val;
+
+	status = acpi_evaluate_object(handle, (char *)method, &params, output);
+	return (status == AE_OK);
+}
+
+static int read_acpi_int(acpi_handle handle, const char *method, int *val)
+{
+	struct acpi_buffer output;
+	union acpi_object out_obj;
+	acpi_status status;
+
+	output.length = sizeof(out_obj);
+	output.pointer = &out_obj;
+	status = acpi_evaluate_object(handle, (char *) method, NULL, &output);
+	*val = out_obj.integer.value;
+	return (status == AE_OK) && (out_obj.type == ACPI_TYPE_INTEGER);
+}
+
+static int parse_arg(const char *buf, unsigned long count, int *val)
+{
+	if (!count)
+		return 0;
+	if (count > 31)
+		return -EINVAL;
+	if (sscanf(buf, "%i", val) != 1)
+		return -EINVAL;
+	return count;
+}
+
+static ssize_t store_proc(int cm, const char *buf, size_t count)
+{
+	int rv, value;
+
+	rv = parse_arg(buf, count, &value);
+	if (rv > 0 && (ehotk->cm_supported & (0x1 << cm))) {
+		const char *method = cm_setv[cm];
+		if (method == NULL)
+			return 0;
+		if (!write_acpi_int(ehotk->handle, method, value, NULL))
+			printk(EEEPC_WARNING "Error writing %s\n", method);
+	}
+	return rv;
+}
+
+static ssize_t show_proc(int cm, char *buf)
+{
+	int value = -1;
+
+	if ((ehotk->cm_supported & (0x1 << cm))) {
+		const char *method = cm_getv[cm];
+		if (method == NULL)
+			return 0;
+		if (!read_acpi_int(ehotk->handle, method, &value))
+			printk(EEEPC_WARNING "Error reading %s\n", method);
+	}
+	return sprintf(buf, "%d\n", value);
+}
+
+static ssize_t real_store_init(struct device *dev,
+			       struct device_attribute *attr,
+			       const char *buf, size_t count)
+{
+	int rv, value;
+
+	rv = parse_arg(buf, count, &value);
+	if (!write_acpi_int(ehotk->handle, "INIT", value, NULL))
+		printk(EEEPC_ERR "Hotkey initialization failed\n");
+	else
+		printk(EEEPC_INFO "Reset init flag 0x%x\n", value);
+	return rv;
+}
+
+#define EEEPC_CREATE_DEVICE_ATTR(_name, _cm)				\
+	static ssize_t show_##_name(struct device *dev,			\
+				    struct device_attribute *attr,	\
+				    char *buf)				\
+	{								\
+		return show_proc(_cm, buf);				\
+	}								\
+	static ssize_t store_##_name(struct device *dev,		\
+				     struct device_attribute *attr,	\
+				     const char *buf, size_t count)	\
+	{								\
+		return store_proc(_cm, buf, count);			\
+	}								\
+	static struct device_attribute dev_attr_##_name = {		\
+		.attr = {						\
+			.name = __stringify(_name),			\
+			.mode = 0644 },					\
+		.show   = show_##_name,					\
+		.store  = store_##_name,				\
+	}
+
+EEEPC_CREATE_DEVICE_ATTR(brn, CM_ASL_PANELBRIGHT);
+EEEPC_CREATE_DEVICE_ATTR(camera, CM_ASL_CAMERA);
+EEEPC_CREATE_DEVICE_ATTR(cardr, CM_ASL_CARDREADER);
+EEEPC_CREATE_DEVICE_ATTR(cpufv, CM_ASL_CPUFV);
+EEEPC_CREATE_DEVICE_ATTR(disp, CM_ASL_DISPLAYSWITCH);
+EEEPC_CREATE_DEVICE_ATTR(hdps, CM_ASL_BIOSFLASH);
+EEEPC_CREATE_DEVICE_ATTR(init, -1);	/* fixed up in eeepc_hotk_add() */
+EEEPC_CREATE_DEVICE_ATTR(lid, CM_ASL_LID);
+EEEPC_CREATE_DEVICE_ATTR(wlan, CM_ASL_WLAN);
+
+static struct attribute *platform_attributes[] = {
+	&dev_attr_brn.attr,
+	&dev_attr_camera.attr,
+	&dev_attr_cardr.attr,
+	&dev_attr_cpufv.attr,
+	&dev_attr_disp.attr,
+	&dev_attr_hdps.attr,
+	&dev_attr_init.attr,
+	&dev_attr_lid.attr,
+	&dev_attr_wlan.attr,
+	NULL
+};
+
+static struct attribute_group platform_attribute_group = {
+	.attrs = platform_attributes
+};
+
+static int eeepc_hotk_check(void)
+{
+	struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL };
+	int result;
+
+	result = acpi_bus_get_status(ehotk->device);
+	if (result)
+		return result;
+	if (ehotk->device->status.present) {
+		if (!write_acpi_int(ehotk->handle, "INIT", init_flag,
+				    &buffer)) {
+			printk(EEEPC_ERR "Hotkey initialization failed\n");
+			return -ENODEV;
+		} else {
+			printk(EEEPC_NOTICE "Hotkey init flags 0x%x\n",
+			       init_flag);
+		}
+		/* get control methods supported */
+		if (!read_acpi_int(ehotk->handle, "CMSG"
+				   , &ehotk->cm_supported)) {
+			printk(EEEPC_ERR
+			       "Get control methods supported failed\n");
+			return -ENODEV;
+		} else {
+			printk(EEEPC_INFO
+			       "Get control methods supported: 0x%x\n",
+			       ehotk->cm_supported);
+		}
+		ehotk->cm_supported |= (0x1 << CM_ASL_LID);
+	} else {
+		printk(EEEPC_ERR "Hotkey device not present, aborting\n");
+		return -EINVAL;
+	}
+	return 0;
+}
+
+static void eeepc_hotk_notify(acpi_handle handle, u32 event, void *data)
+{
+	if (!ehotk)
+		return;
+	/* if DISABLE_ASL_WLAN is set, the notify code for fn+f2
+	   will always be 0x10 */
+	if (event == NOTIFY_WLAN_ON && (DISABLE_ASL_WLAN & init_flag)) {
+		int value;
+		if (ehotk->cm_supported & (0x1 << CM_ASL_WLAN)) {
+			const char *method = cm_getv[CM_ASL_WLAN];
+			if (!read_acpi_int(ehotk->handle, method, &value))
+				printk(EEEPC_WARNING "Error reading %s\n",
+				       method);
+			else if (value == 1)
+				event = 0x11;
+		}
+	}
+	acpi_bus_generate_proc_event(ehotk->device, event,
+				     ehotk->event_count[event % 128]++);
+}
+
+static int ehotk_found;
+
+static int eeepc_hotk_add(struct acpi_device *device)
+{
+	acpi_status status = AE_OK;
+	int result;
+
+	if (!device)
+		 return -EINVAL;
+	printk(EEEPC_NOTICE EEEPC_HOTK_NAME "\n");
+	ehotk = kzalloc(sizeof(struct eeepc_hotk), GFP_KERNEL);
+	if (!ehotk)
+		return -ENOMEM;
+	ehotk->handle = device->handle;
+	strcpy(acpi_device_name(device), EEEPC_HOTK_DEVICE_NAME);
+	strcpy(acpi_device_class(device), EEEPC_HOTK_CLASS);
+	acpi_driver_data(device) = ehotk;
+	ehotk->device = device;
+	result = eeepc_hotk_check();
+	if (result)
+		goto end;
+	dev_attr_init.show = NULL;
+	dev_attr_init.store = real_store_init;
+	status = acpi_install_notify_handler(ehotk->handle, ACPI_SYSTEM_NOTIFY,
+					     eeepc_hotk_notify, ehotk);
+	if (ACPI_FAILURE(status))
+		printk(EEEPC_ERR "Error installing notify handler\n");
+	ehotk_found = 1;
+ end:
+	if (result)
+		kfree(ehotk);
+	return result;
+}
+
+static int eeepc_hotk_remove(struct acpi_device *device, int type)
+{
+	acpi_status status = 0;
+
+	if (!device || !acpi_driver_data(device))
+		 return -EINVAL;
+	status = acpi_remove_notify_handler(ehotk->handle, ACPI_SYSTEM_NOTIFY,
+					    eeepc_hotk_notify);
+	if (ACPI_FAILURE(status))
+		printk(EEEPC_ERR "Error removing notify handler\n");
+	kfree(ehotk);
+	return 0;
+}
+
+static struct platform_driver platform_driver = {
+	.driver = {
+		.name = EEEPC_HOTK_FILE,
+		.owner = THIS_MODULE,
+	}
+};
+
+static struct platform_device *platform_device;
+
+static void __exit eeepc_hotk_exit(void)
+{
+	acpi_bus_unregister_driver(&eeepc_hotk_driver);
+	sysfs_remove_group(&platform_device->dev.kobj,
+			   &platform_attribute_group);
+	platform_device_unregister(platform_device);
+	platform_driver_unregister(&platform_driver);
+}
+
+static int __init eeepc_hotk_init(void)
+{
+	struct device *dev;
+	int result;
+
+	if (acpi_disabled)
+		return -ENODEV;
+	init_flag = DISABLE_ASL_WLAN | DISABLE_ASL_DISPLAYSWITCH;
+	result = acpi_bus_register_driver(&eeepc_hotk_driver);
+	if (result < 0)
+		return result;
+	if (!ehotk_found) {
+		acpi_bus_unregister_driver(&eeepc_hotk_driver);
+		return -ENODEV;
+	}
+	dev = acpi_get_physical_device(ehotk->device->handle);
+	/* Register platform stuff */
+	result = platform_driver_register(&platform_driver);
+	if (result)
+		goto fail_platform_driver;
+	platform_device = platform_device_alloc(EEEPC_HOTK_FILE, -1);
+	if (!platform_device) {
+		result = -ENOMEM;
+		goto fail_platform_device1;
+	}
+	result = platform_device_add(platform_device);
+	if (result)
+		goto fail_platform_device2;
+	result = sysfs_create_group(&platform_device->dev.kobj,
+				    &platform_attribute_group);
+	if (result)
+		goto fail_sysfs;
+	return 0;
+ fail_sysfs:
+	platform_device_del(platform_device);
+ fail_platform_device2:
+	platform_device_put(platform_device);
+ fail_platform_device1:
+	platform_driver_unregister(&platform_driver);
+ fail_platform_driver:
+	return result;
+}
+
+module_init(eeepc_hotk_init);
+module_exit(eeepc_hotk_exit);

linux-2.6-netdev-atl2.patch:

--- NEW FILE linux-2.6-netdev-atl2.patch ---
diff -Nurp a/drivers/net/atl2/atl2_ethtool.c b/drivers/net/atl2/atl2_ethtool.c
--- a/drivers/net/atl2/atl2_ethtool.c	1969-12-31 19:00:00.000000000 -0500
+++ b/drivers/net/atl2/atl2_ethtool.c	2007-12-10 12:45:39.000000000 -0500
@@ -0,0 +1,416 @@
+/* atl2_ethtool.c -- atl2 ethtool support
+ *
+ * Copyright(c) 2007 Atheros Corporation. All rights reserved.
+ * Copyright(c) 2006 xiong huang <xiong.huang at atheros.com>
+ * Copyright(c) 2007 Chris Snook <csnook at redhat.com>
+ *
+ * Derived from Intel e1000 driver
+ * Copyright(c) 1999 - 2005 Intel Corporation. All rights reserved.
+ *
+ * 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.
+ */
+
+#include <linux/bitops.h>
+#include <linux/ethtool.h>
+#include <linux/mii.h>
+#include <linux/netdevice.h>
+#include <linux/slab.h>
+#include <linux/string.h>
+#include <linux/types.h>
+
+#include "atl2.h"
+#include "atl2_hw.h"
+
+extern char atl2_driver_name[];
+extern char atl2_driver_version[];
+
+extern int atl2_up(struct atl2_adapter *adapter);
+extern void atl2_down(struct atl2_adapter *adapter);
+extern void atl2_reinit_locked(struct atl2_adapter *adapter);
+extern s32 atl2_reset_hw(struct atl2_hw *hw);
+
+static int
+atl2_get_settings(struct net_device *netdev, struct ethtool_cmd *ecmd)
+{
+	struct atl2_adapter *adapter = netdev_priv(netdev);
+	struct atl2_hw *hw = &adapter->hw;
+
+	ecmd->supported = (SUPPORTED_10baseT_Half |
+		SUPPORTED_10baseT_Full |
+		SUPPORTED_100baseT_Half |
+		SUPPORTED_100baseT_Full |
+		SUPPORTED_Autoneg |
+		SUPPORTED_TP);
+	ecmd->advertising = ADVERTISED_TP;
+
+	ecmd->advertising |= ADVERTISED_Autoneg;
+	ecmd->advertising |= hw->autoneg_advertised;
+
+	ecmd->port = PORT_TP;
+	ecmd->phy_address = 0;
+	ecmd->transceiver = XCVR_INTERNAL;
+
+	if (adapter->link_speed != SPEED_0) {
+		ecmd->speed = adapter->link_speed;
+		if (adapter->link_duplex == FULL_DUPLEX)
+			ecmd->duplex = DUPLEX_FULL;
+		else
+			ecmd->duplex = DUPLEX_HALF;
+	} else {
+		ecmd->speed = -1;
+		ecmd->duplex = -1;
+	}
+
+	ecmd->autoneg = AUTONEG_ENABLE;
+	return 0;
+}
+
+static int
+atl2_set_settings(struct net_device *netdev, struct ethtool_cmd *ecmd)
+{
+	struct atl2_adapter *adapter = netdev_priv(netdev);
+	struct atl2_hw *hw = &adapter->hw;
+
+	while (test_and_set_bit(__ATL2_RESETTING, &adapter->flags))
+		msleep(1);
+
+	if (ecmd->autoneg == AUTONEG_ENABLE) {
+#define MY_ADV_MASK	(ADVERTISE_10_HALF| \
+					 ADVERTISE_10_FULL| \
+					 ADVERTISE_100_HALF| \
+					 ADVERTISE_100_FULL)
+
+		if ((ecmd->advertising&MY_ADV_MASK) == MY_ADV_MASK) {
+			hw->MediaType = MEDIA_TYPE_AUTO_SENSOR;
+			hw->autoneg_advertised =  MY_ADV_MASK;
+		} else if ((ecmd->advertising&MY_ADV_MASK) == ADVERTISE_100_FULL) {
+			hw->MediaType = MEDIA_TYPE_100M_FULL;
+			hw->autoneg_advertised = ADVERTISE_100_FULL;
+		} else if ((ecmd->advertising&MY_ADV_MASK) == ADVERTISE_100_HALF) {
+			hw->MediaType = MEDIA_TYPE_100M_HALF;
+			hw->autoneg_advertised = ADVERTISE_100_HALF;
+		} else if ((ecmd->advertising&MY_ADV_MASK) == ADVERTISE_10_FULL) {
+			hw->MediaType = MEDIA_TYPE_10M_FULL;
+			hw->autoneg_advertised = ADVERTISE_10_FULL;
+		}  else if ((ecmd->advertising&MY_ADV_MASK) == ADVERTISE_10_HALF) {
+			hw->MediaType = MEDIA_TYPE_10M_HALF;
+			hw->autoneg_advertised = ADVERTISE_10_HALF;
+		} else {
+			clear_bit(__ATL2_RESETTING, &adapter->flags);
+			return -EINVAL;
+		}
+		ecmd->advertising = hw->autoneg_advertised |
+			ADVERTISED_TP | ADVERTISED_Autoneg;
+	} else {
+		clear_bit(__ATL2_RESETTING, &adapter->flags);
+		return -EINVAL;
+	}
+
+	/* reset the link */
+	if (netif_running(adapter->netdev)) {
+		atl2_down(adapter);
+		atl2_up(adapter);
+	} else
+		atl2_reset_hw(&adapter->hw);
+
+	clear_bit(__ATL2_RESETTING, &adapter->flags);
+	return 0;
+}
+
+static u32
+atl2_get_tx_csum(struct net_device *netdev)
+{
+	return (netdev->features & NETIF_F_HW_CSUM) != 0;
+}
+
+static u32
+atl2_get_msglevel(struct net_device *netdev)
+{
+	return 0;
+}
+
+/*
+ * It's sane for this to be empty, but we might want to take advantage of this.
+ */
+static void
+atl2_set_msglevel(struct net_device *netdev, u32 data)
+{
+}
+
+static int
+atl2_get_regs_len(struct net_device *netdev)
+{
+#define ATL2_REGS_LEN 42
+	return ATL2_REGS_LEN * sizeof(u32);
+}
+
+static void
+atl2_get_regs(struct net_device *netdev, struct ethtool_regs *regs, void *p)
+{
+	struct atl2_adapter *adapter = netdev_priv(netdev);
+	struct atl2_hw *hw = &adapter->hw;
+	u32 *regs_buff = p;
+	u16 phy_data;
+
+	memset(p, 0, ATL2_REGS_LEN * sizeof(u32));
+
+	regs->version = (1 << 24) | (hw->revision_id << 16) | hw->device_id;
+
+	regs_buff[0]  = ATL2_READ_REG(hw, REG_VPD_CAP);
+	regs_buff[1]  = ATL2_READ_REG(hw, REG_SPI_FLASH_CTRL);
+	regs_buff[2]  = ATL2_READ_REG(hw, REG_SPI_FLASH_CONFIG);
+	regs_buff[3]  = ATL2_READ_REG(hw, REG_TWSI_CTRL);
+	regs_buff[4]  = ATL2_READ_REG(hw, REG_PCIE_DEV_MISC_CTRL);
+	regs_buff[5]  = ATL2_READ_REG(hw, REG_MASTER_CTRL);
+	regs_buff[6]  = ATL2_READ_REG(hw, REG_MANUAL_TIMER_INIT);
+	regs_buff[7]  = ATL2_READ_REG(hw, REG_IRQ_MODU_TIMER_INIT);
+	regs_buff[8]  = ATL2_READ_REG(hw, REG_PHY_ENABLE);
+	regs_buff[9]  = ATL2_READ_REG(hw, REG_CMBDISDMA_TIMER);
+	regs_buff[10] = ATL2_READ_REG(hw, REG_IDLE_STATUS);
+	regs_buff[11] = ATL2_READ_REG(hw, REG_MDIO_CTRL);
+	regs_buff[12] = ATL2_READ_REG(hw, REG_SERDES_LOCK);
+	regs_buff[13] = ATL2_READ_REG(hw, REG_MAC_CTRL);
+	regs_buff[14] = ATL2_READ_REG(hw, REG_MAC_IPG_IFG);
+	regs_buff[15] = ATL2_READ_REG(hw, REG_MAC_STA_ADDR);
+	regs_buff[16] = ATL2_READ_REG(hw, REG_MAC_STA_ADDR+4);
+	regs_buff[17] = ATL2_READ_REG(hw, REG_RX_HASH_TABLE);
+	regs_buff[18] = ATL2_READ_REG(hw, REG_RX_HASH_TABLE+4);
+	regs_buff[19] = ATL2_READ_REG(hw, REG_MAC_HALF_DUPLX_CTRL);
+	regs_buff[20] = ATL2_READ_REG(hw, REG_MTU);
+	regs_buff[21] = ATL2_READ_REG(hw, REG_WOL_CTRL);
+	regs_buff[22] = ATL2_READ_REG(hw, REG_SRAM_TXRAM_END);
+	regs_buff[23] = ATL2_READ_REG(hw, REG_DESC_BASE_ADDR_HI);
+	regs_buff[24] = ATL2_READ_REG(hw, REG_TXD_BASE_ADDR_LO);
[...3961 lines suppressed...]
+		case enable_option:
+			switch (*value) {
+				case OPTION_ENABLED:
+					printk(KERN_INFO "%s Enabled\n", opt->name);
+					return 0;
+					break;
+				case OPTION_DISABLED:
+					printk(KERN_INFO "%s Disabled\n", opt->name);
+					return 0;
+					break;
+			}
+			break;
+		case range_option:
+			if(*value >= opt->arg.r.min && *value <= opt->arg.r.max) {
+				printk(KERN_INFO "%s set to %i\n", opt->name, *value);
+				return 0;
+			}
+			break;
+		case list_option:
+			for(i = 0; i < opt->arg.l.nr; i++) {
+				ent = &opt->arg.l.p[i];
+				if(*value == ent->i) {
+					if(ent->str[0] != '\0')
+						printk(KERN_INFO "%s\n", ent->str);
+				return 0;
+				}
+			}
+			break;
+		default:
+			BUG();
+	}
+
+	printk(KERN_INFO "Invalid %s specified (%i) %s\n",
+		opt->name, *value, opt->err);
+	*value = opt->def;
+	return -1;
+}
+
+/**
+ * atl2_check_options - Range Checking for Command Line Parameters
+ * @adapter: board private structure
+ *
+ * This routine checks all command line parameters for valid user
+ * input.  If an invalid value is given, or if no user specified
+ * value exists, a default value is used.  The final value is stored
+ * in a variable in the adapter structure.
+ **/
+void __devinit
+atl2_check_options(struct atl2_adapter *adapter)
+{
+	int val;
+	struct atl2_option opt;
+	int bd = adapter->bd_number;
+	if(bd >= ATL2_MAX_NIC) {
+		printk(KERN_NOTICE "Warning: no configuration for board #%i\n", bd);
+		printk(KERN_NOTICE "Using defaults for all values\n");
+#ifndef module_param_array
+		bd = ATL2_MAX_NIC;
+#endif
+	}
+
+	/* Bytes of Transmit Memory */
+	opt.type = range_option;
+	opt.name = "Bytes of Transmit Memory";
+	opt.err = "using default of " __MODULE_STRING(ATL2_DEFAULT_TX_MEMSIZE);
+	opt.def = ATL2_DEFAULT_TX_MEMSIZE;
+	opt.arg.r.min = ATL2_MIN_TX_MEMSIZE;
+	opt.arg.r.max = ATL2_MAX_TX_MEMSIZE;
+#ifdef module_param_array
+	if(num_TxMemSize > bd) {
+#endif
+		val = TxMemSize[bd];
+		atl2_validate_option(&val, &opt);
+		adapter->txd_ring_size = ((u32) val) * 1024;
+#ifdef module_param_array
+        } else {
+		adapter->txd_ring_size = ((u32)opt.def) * 1024;
+	}
+#endif
+	// txs ring size:
+	adapter->txs_ring_size = adapter->txd_ring_size / 128;
+	if (adapter->txs_ring_size > 160)
+		adapter->txs_ring_size = 160;
+
+	/* Receive Memory Block Count */
+	opt.type = range_option;
+	opt.name = "Number of receive memory block";
+	opt.err = "using default of " __MODULE_STRING(ATL2_DEFAULT_RXD_COUNT);
+	opt.def = ATL2_DEFAULT_RXD_COUNT;
+	opt.arg.r.min = ATL2_MIN_RXD_COUNT;
+	opt.arg.r.max = ATL2_MAX_RXD_COUNT;
+#ifdef module_param_array
+	if(num_RxMemBlock > bd) {
+#endif
+		val = RxMemBlock[bd];
+		atl2_validate_option(&val, &opt);
+		adapter->rxd_ring_size = (u32)val; //((u16)val)&~1; // even number
+#ifdef module_param_array
+	} else {
+		adapter->rxd_ring_size = (u32)opt.def;
+	}
+#endif
+	// init RXD Flow control value
+	adapter->hw.fc_rxd_hi = (adapter->rxd_ring_size/8)*7;
+	adapter->hw.fc_rxd_lo = (ATL2_MIN_RXD_COUNT/8) > (adapter->rxd_ring_size/12) ?
+		(ATL2_MIN_RXD_COUNT/8) : (adapter->rxd_ring_size/12);
+
+	/* Interrupt Moderate Timer */
+	opt.type = range_option;
+	opt.name = "Interrupt Moderate Timer";
+	opt.err = "using default of " __MODULE_STRING(INT_MOD_DEFAULT_CNT);
+	opt.def = INT_MOD_DEFAULT_CNT;
+	opt.arg.r.min = INT_MOD_MIN_CNT;
+	opt.arg.r.max = INT_MOD_MAX_CNT;
+#ifdef module_param_array
+	if(num_IntModTimer > bd) {
+#endif
+		val = IntModTimer[bd];
+		atl2_validate_option(&val, &opt);
+		adapter->imt = (u16) val;
+#ifdef module_param_array
+	} else {
+		adapter->imt = (u16)(opt.def);
+	}
+#endif
+	/* Flash Vendor */
+	opt.type = range_option;
+	opt.name = "SPI Flash Vendor";
+	opt.err = "using default of " __MODULE_STRING(FLASH_VENDOR_DEFAULT);
+	opt.def = FLASH_VENDOR_DEFAULT;
+	opt.arg.r.min = FLASH_VENDOR_MIN;
+	opt.arg.r.max = FLASH_VENDOR_MAX;
+#ifdef module_param_array
+	if(num_FlashVendor > bd) {
+#endif
+		val = FlashVendor[bd];
+		atl2_validate_option(&val, &opt);
+		adapter->hw.flash_vendor = (u8) val;
+#ifdef module_param_array
+	} else {
+		adapter->hw.flash_vendor = (u8)(opt.def);
+	}
+#endif
+	/* MediaType */
+	opt.type = range_option;
+	opt.name = "Speed/Duplex Selection";
+	opt.err = "using default of " __MODULE_STRING(MEDIA_TYPE_AUTO_SENSOR);
+	opt.def = MEDIA_TYPE_AUTO_SENSOR;
+	opt.arg.r.min = MEDIA_TYPE_AUTO_SENSOR;
+	opt.arg.r.max = MEDIA_TYPE_10M_HALF;
+#ifdef module_param_array
+	if(num_MediaType > bd) {
+#endif
+		val = MediaType[bd];
+		atl2_validate_option(&val, &opt);
+		adapter->hw.MediaType = (u16) val;
+#ifdef module_param_array
+	} else {
+		adapter->hw.MediaType = (u16)(opt.def);
+	}
+#endif
+}
diff -Nurp a/drivers/net/atl2/Makefile b/drivers/net/atl2/Makefile
--- a/drivers/net/atl2/Makefile	1969-12-31 19:00:00.000000000 -0500
+++ b/drivers/net/atl2/Makefile	2008-01-31 14:37:35.000000000 -0500
@@ -0,0 +1,2 @@
+obj-$(CONFIG_ATL2)	+= atl2.o
+atl2-y			+= atl2_main.o atl2_hw.o atl2_ethtool.o atl2_param.o
diff -Nurp a/drivers/net/Kconfig b/drivers/net/Kconfig
--- a/drivers/net/Kconfig	2008-01-31 14:32:05.000000000 -0500
+++ b/drivers/net/Kconfig	2008-01-31 14:44:01.000000000 -0500
@@ -1999,6 +1999,17 @@ config NE_H8300
 	  Say Y here if you want to use the NE2000 compatible
 	  controller on the Renesas H8/300 processor.
 
+config ATL2
+	tristate "Atheros L2 Fast Ethernet support (EXPERIMENTAL)"
+	depends on PCI && EXPERIMENTAL
+	select CRC32
+	select MII
+	help
+	  This driver supports the Atheros L2 fast ethernet adapter.
+
+	  To compile this driver as a module, choose M here.  The module
+	  will be called atl2.
+
 source "drivers/net/fec_8xx/Kconfig"
 source "drivers/net/fs_enet/Kconfig"
 
diff -Nurp a/drivers/net/Makefile b/drivers/net/Makefile
--- a/drivers/net/Makefile	2008-01-31 14:32:05.000000000 -0500
+++ b/drivers/net/Makefile	2008-01-31 14:38:52.000000000 -0500
@@ -11,6 +11,7 @@ obj-$(CONFIG_CHELSIO_T3) += cxgb3/
 obj-$(CONFIG_EHEA) += ehea/
 obj-$(CONFIG_BONDING) += bonding/
 obj-$(CONFIG_ATL1) += atl1/
+obj-$(CONFIG_ATL2) += atl2/
 obj-$(CONFIG_GIANFAR) += gianfar_driver.o
 obj-$(CONFIG_TEHUTI) += tehuti.o
 


Index: config-generic
===================================================================
RCS file: /cvs/pkgs/rpms/kernel/devel/config-generic,v
retrieving revision 1.64
retrieving revision 1.65
diff -u -r1.64 -r1.65
--- config-generic	1 Feb 2008 22:33:38 -0000	1.64
+++ config-generic	5 Feb 2008 19:10:17 -0000	1.65
@@ -1114,6 +1114,7 @@
 CONFIG_BNX2=m
 CONFIG_QLA3XXX=m
 CONFIG_ATL1=m
+CONFIG_ATL2=m
 # CONFIG_EEPRO100 is not set
 CONFIG_E100=m
 CONFIG_FEALNX=m


Index: config-x86-generic
===================================================================
RCS file: /cvs/pkgs/rpms/kernel/devel/config-x86-generic,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -r1.25 -r1.26
--- config-x86-generic	28 Jan 2008 23:15:42 -0000	1.25
+++ config-x86-generic	5 Feb 2008 19:10:17 -0000	1.26
@@ -304,6 +304,7 @@
 # CONFIG_SGI_IOC4 is not set
 
 CONFIG_ASUS_LAPTOP=m
+CONFIG_EEEPC=m
 CONFIG_FUJITSU_LAPTOP=m
 CONFIG_MSI_LAPTOP=m
 CONFIG_SONY_LAPTOP=m


Index: config-x86_64-generic
===================================================================
RCS file: /cvs/pkgs/rpms/kernel/devel/config-x86_64-generic,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -r1.22 -r1.23
--- config-x86_64-generic	28 Jan 2008 23:15:42 -0000	1.22
+++ config-x86_64-generic	5 Feb 2008 19:10:17 -0000	1.23
@@ -95,6 +95,7 @@
 CONFIG_ACPI_PROC_EVENT=y
 
 CONFIG_ASUS_LAPTOP=m
+CONFIG_EEEPC=m
 CONFIG_FUJITSU_LAPTOP=m
 CONFIG_MSI_LAPTOP=m
 CONFIG_SONY_LAPTOP=m


Index: kernel.spec
===================================================================
RCS file: /cvs/pkgs/rpms/kernel/devel/kernel.spec,v
retrieving revision 1.403
retrieving revision 1.404
diff -u -r1.403 -r1.404
--- kernel.spec	5 Feb 2008 02:58:57 -0000	1.403
+++ kernel.spec	5 Feb 2008 19:10:17 -0000	1.404
@@ -604,7 +604,6 @@
 Patch270: linux-2.6-debug-taint-vm.patch
 Patch280: linux-2.6-debug-spinlock-taint.patch
 Patch330: linux-2.6-debug-no-quiet.patch
-Patch345: linux-2.6-debug-acpi-os-write-port.patch
 Patch350: linux-2.6-devmem.patch
 Patch370: linux-2.6-crash-driver.patch
 Patch400: linux-2.6-scsi-cpqarray-set-master.patch
@@ -652,9 +651,16 @@
 # fix null pointer deref in bonding driver
 Patch2010: linux-2.6-netdev-bonding-fix-null-deref.patch
 
-# ext4 patches
-Patch2100: linux-2.6-ext4-linus-git.patch
-Patch2101: linux-2.6-ext4-stable-queue.patch
+# atl2 network driver
+Patch2020: linux-2.6-netdev-atl2.patch
+
+# ext4dev upstream patch queue, slated for 2.6.25
+# "stable" patches as of 1/21/2008
+# supporting files, and ext4/jbd2 core files
+Patch2100: linux-2.6-ext4-jbd2-support-patch-queue.patch
+Patch2101: linux-2.6-ext4-jbd2-patch-queue.patch
+Patch2102: linux-2.6-ext4-extent-mount-check.patch
+Patch2103: linux-2.6-ext4-root-inode-xattrs.patch
 
 # linux1394 git patches
 Patch2200: linux-2.6-firewire-git-update.patch
@@ -666,6 +672,9 @@
 # make USB EHCI driver respect "nousb" parameter
 Patch2300: linux-2.6-usb-ehci-hcd-respect-nousb.patch
 
+# acpi hotkey driver for asus eeepc
+Patch2350: linux-2.6-acpi-eeepc-hotkey.patch
+
 # usb video
 Patch2400: linux-2.6-uvcvideo.patch
 
@@ -1064,8 +1073,14 @@
 #
 # bugfixes to drivers and filesystems
 #
+
+# USB
 ApplyPatch linux-2.6-usb-ehci-hcd-respect-nousb.patch
 
+# ACPI
+# eeepc hotkey support
+ApplyPatch linux-2.6-acpi-eeepc-hotkey.patch
+
 # Various low-impact patches to aid debugging.
 ApplyPatch linux-2.6-debug-sizeof-structs.patch
 ApplyPatch linux-2.6-debug-nmi-timeout.patch
@@ -1074,8 +1089,6 @@
 %if !%{debugbuildsenabled}
 ApplyPatch linux-2.6-debug-no-quiet.patch
 %endif
-# try to find out what is breaking acpi-cpufreq
-ApplyPatch linux-2.6-debug-acpi-os-write-port.patch
 
 #
 # Make /dev/mem a need-to-know function
@@ -1181,6 +1194,8 @@
 ApplyPatch linux-2.6-e1000-corrupt-eeprom-checksum.patch
 ApplyPatch linux-2.6-netdev-e1000-disable-alpm.patch
 ApplyPatch linux-2.6-netdev-bonding-fix-null-deref.patch
+# atl2 driver for eeepc (and others)
+ApplyPatch linux-2.6-netdev-atl2.patch
 
 # drm-mm catchup (modesetting, ...)
 ApplyPatch linux-2.6-agp-mm.patch
@@ -1778,6 +1793,10 @@
 %kernel_variant_files -a /%{image_install_path}/xen*-%{KVERREL} -e /etc/ld.so.conf.d/kernelcap-%{KVERREL}.conf %{with_xen} xen
 
 %changelog
+* Tue Feb 05 2008 Chuck Ebbert <cebbert at redhat.com>
+- atl2 network driver 2.0.4
+- ASUS Eeepc ACPI hotkey driver
+
 * Mon Feb 04 2008 Eric Sandeen <sandeen at redhat.com>
 - Update ext4 patch queue, now picking up from Linus' git
 




More information about the fedora-extras-commits mailing list