diff options
author | jal2 <jal2> | 2004-08-18 22:01:45 +0000 |
---|---|---|
committer | jal2 <jal2> | 2004-08-18 22:01:45 +0000 |
commit | 2b8da4d89de998965e34b4f4c95d3c8c09a0fc06 (patch) | |
tree | dea70a92af59f4c86b05472d377472eddabf6dea | |
parent | ffef8563f1d6d3feef3459d1aa4e52e06d5147f4 (diff) |
version 0.12beta17:version_0_12beta17
- Makefile: new targets:
* rmmod - remove all loaded modules in correct order (for tests etc.)
* kernel_patch - try to copy the source files and patch Kconfig
and Makefile, for 2.6.x only - use with care !
* VERSION went into at76c503.h
- file names cleaned up:
* usbdfu.* --> at76_usbdfu.*
* removed fw-empty.h
* ieee802* --> at76_ieee802*
- no debugs even if CONFIG_USB_DEBUG is defined
- fixed copyright entries
- added ref. to Berlios project's homepage
-rw-r--r-- | Makefile | 53 | ||||
-rw-r--r-- | Makefile.k26 | 10 | ||||
-rw-r--r-- | at76_ieee802_11.h (renamed from ieee802_11.h) | 14 | ||||
-rw-r--r-- | at76_usbdfu.c (renamed from usbdfu.c) | 16 | ||||
-rw-r--r-- | at76_usbdfu.h (renamed from usbdfu.h) | 7 | ||||
-rw-r--r-- | at76c503-fw_skel.c | 11 | ||||
-rw-r--r-- | at76c503-i3861.c | 17 | ||||
-rw-r--r-- | at76c503-i3863.c | 10 | ||||
-rw-r--r-- | at76c503-rfmd-acc.c | 12 | ||||
-rw-r--r-- | at76c503-rfmd.c | 11 | ||||
-rw-r--r-- | at76c503.c | 21 | ||||
-rw-r--r-- | at76c503.h | 35 | ||||
-rw-r--r-- | at76c505-rfmd.c | 11 | ||||
-rw-r--r-- | at76c505-rfmd2958.c | 9 | ||||
-rw-r--r-- | at76c505a-rfmd2958.c | 10 | ||||
-rw-r--r-- | fw-empty.h | 4 | ||||
-rwxr-xr-x | kernel_patch.sh | 103 |
17 files changed, 280 insertions, 74 deletions
@@ -1,6 +1,13 @@ -#$Id: Makefile,v 1.38 2004/08/13 22:42:06 jal2 Exp $ - -VERSION = 0.12beta16 +#$Id: Makefile,v 1.39 2004/08/18 22:01:45 jal2 Exp $ +# +# Copyright (c) 2002 - 2003 Oliver Kurth +# (c) 2003 - 2004 Jörg Albert <joerg.albert@gmx.de> +# +# 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. +# CC=gcc @@ -12,20 +19,18 @@ FW_DL= # compile for firmware download from user space # if no firmware header files are available -ifeq ($(wildcard fw-pkg*.h),) -FW_DL += -DCONFIG_AT76C503_FIRMWARE_DOWNLOAD -DVERSION = $(VERSION)-fwdl -else -DVERSION = $(VERSION) +ifneq ($(wildcard fw-pkg*.h),) +FW_DL += -DCOMPILE_FIRMWARE_INTO_DRIVER endif -MODULES = at76c503.o usbdfu.o at76c503-i3861.o at76c503-rfmd.o at76c503-rfmd-acc.o \ - at76c505-rfmd.o at76c503-i3863.o at76c505-rfmd2958.o at76c505a-rfmd2958.o +MODULES = at76c503-i3861.o at76c503-rfmd.o at76c503-rfmd-acc.o \ + at76c505-rfmd.o at76c503-i3863.o at76c505-rfmd2958.o at76c505a-rfmd2958.o \ + at76c503.o at76_usbdfu.o -SRCS = at76c503.c usbdfu.c at76c503-rfmd.c at76c505-rfmd.c at76c503-rfmd-acc.c \ +SRCS = at76c503.c at76_usbdfu.c at76c503-rfmd.c at76c505-rfmd.c at76c503-rfmd-acc.c \ at76c503-i3861.c at76c503-i3863.c at76c505-rfmd2958.c at76c505a-rfmd2958.c -HDRS = at76c503.h ieee802_11.h usbdfu.h at76c503-fw_skel.c fw-empty.h +HDRS = at76c503.h at76_ieee802_11.h at76_usbdfu.h at76c503-fw_skel.c FW_HDRS= fw-pkg-505-rfmd2958-1.101.0-86.h fw-pkg-i3863.h \ fw-pkg-rfmd-1.101.0-84.h fw-pkg-i3861.h \ fw-pkg-rfmd-0.90.2-140.h \ @@ -35,14 +40,21 @@ FW_HDRS= fw-pkg-505-rfmd2958-1.101.0-86.h fw-pkg-i3863.h \ SCRIPTS = fwbin2h fwbin2pkg.sh fwconvert fwversion DISTFILES = $(SRCS) $(HDRS) $(FW_HDRS) Makefile README COPYING \ - CHANGELOG gen_fw.c + CHANGELOG gen_fw.c kernel_patch.sh Makefile.k26 TOPDISTFILES = -DISTNAME = at76c503-$(VERSION) + +# get the version from at76c503.h +# for 2.6.x kernels the shell command is evaluated too late, +# looking for at76c503.h in the kernel root dir :-( +#VERSION = - +#VERSION += $(shell grep '\#define DRIVER_VERSION' at76c503.h | sed 's/\#define.*DRIVER_VERSION.*"\(.*\)"/\1/g' ) +VERSION = +DISTNAME = at76c503$(VERSION) DISTDIR = ../dist # delete any old module in this tree before installing a new one DEL_MODULE_DIR = $(DESTDIR)/lib/modules/$(KERNEL_VERSION) -MODULE_DIR = $(DESTDIR)/lib/modules/$(KERNEL_VERSION)/kernel/drivers/usb/ +MODULE_DIR = $(DESTDIR)/lib/modules/$(KERNEL_VERSION)/kernel/drivers/net/wireless/at76c503 DEPMOD = /sbin/depmod # if Rules.make exists in the kernel tree, we assume 2.4 style modules @@ -63,7 +75,7 @@ modules: mkdir -p .tmp_versions -cp $(KERNEL_SRC)/.tmp_versions/*.mod $(MODVERDIR) $(MAKE) -C $(KERNEL_SRC) SUBDIRS=$(SRCDIR) MODVERDIR=$(MODVERDIR) \ - EXTRA_CFLAGS="-DDRIVER_VERSION=\\\"v$(DVERSION)\\\" $(FW_DL)" modules + EXTRA_CFLAGS="$(FW_DL)" modules mv_old: for i in $(MODULES:%.o=%.ko); do \ @@ -83,7 +95,6 @@ else CPPFLAGS = -D__KERNEL__ \ -DMODULE -DEXPORT_SYMTAB \ - -DDRIVER_VERSION=\"v$(DVERSION)\" \ -I$(KERNEL_HEADERS) CFLAGS = -O2 -Wall -Wstrict-prototypes -pipe -fno-strict-aliasing \ $(FW_DL) \ @@ -114,7 +125,7 @@ install: all mv_old uninstall: for f in $(MODULES); do rm $(MODULE_DIR)/$$f; done -.PHONY: dist +.PHONY: dist kernel_patch rmmod %.o: %.c $(CC) -MD $(CFLAGS) $(CPPFLAGS) $(MFLAG) -c $< @@ -150,3 +161,9 @@ dist: mv $(DISTNAME) $(DISTNAME)-fwdl tar zcvf $(DISTNAME)-fwdl.tar.gz $(DISTNAME)-fwdl rm -rf $(DISTNAME)-fwdl + +kernel_patch: + DRV_SRC="$(SRCS)" DRV_HDR="$(HDRS)" ./kernel_patch.sh $(KERNEL_SRC) + +rmmod: + rmmod $(MODULES:%.o=%)
\ No newline at end of file diff --git a/Makefile.k26 b/Makefile.k26 new file mode 100644 index 0000000..3bd14f1 --- /dev/null +++ b/Makefile.k26 @@ -0,0 +1,10 @@ +# $Id: Makefile.k26,v 1.1 2004/08/18 22:01:45 jal2 Exp $ + +obj-$(CONFIG_USB_ATMEL) += at76c503.o at76_usbdfu.o at76c503-i3861.o at76c503-rfmd.o at76c503-rfmd-acc.o \ + at76c505-rfmd.o at76c503-i3863.o at76c505-rfmd2958.o at76c505a-rfmd2958.o + +# copy the fw-*.h files into this dir and uncomment to compile the firmware statically +# into the driver (against kernel policy of not including binary-only code) +#EXTRA_CFLAGS = -DCOMPILE_FIRMWARE_INTO_DRIVER + + diff --git a/ieee802_11.h b/at76_ieee802_11.h index 30281ce..1685479 100644 --- a/ieee802_11.h +++ b/at76_ieee802_11.h @@ -1,3 +1,17 @@ +/* $Id: at76_ieee802_11.h,v 1.1 2004/08/18 22:01:45 jal2 Exp $ */ + +/* Copyright (c) 2003 Oliver Kurth + * Copyright (c) 2004 Joerg Albert <joerg.albert@gmx.de> + * + * 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 file is part of the Berlios driver for WLAN USB devices based on the + * Atmel AT76C503A/505/505A. See at76c503.h for details. + */ + #ifndef _IEEE802_11_H #define _IEEE802_11_H @@ -1,8 +1,13 @@ /* -*- linux-c -*- */ +/* $Id: at76_usbdfu.c,v 1.1 2004/08/18 22:01:45 jal2 Exp $ */ /* * USB Device Firmware Upgrade (DFU) handler * - * Copyright (c) 2003 Oliver Kurth <oku@masqmail.cx> + * Copyright (c) 2003 Oliver Kurth + * Copyright (c) 2004 Jörg Albert + * + * This file is part of the driver for WLAN USB devices based on the Atmel + * AT76C503A/505/505A. See at76c503.h for details. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as @@ -26,13 +31,10 @@ #include <linux/usb.h> #include <linux/version.h> #include <linux/init.h> -#include "usbdfu.h" +#include "at76c503.h" /* for DRIVER_VERSION only */ +#include "at76_usbdfu.h" -#ifdef CONFIG_USB_DEBUG -static int debug = 1; -#else -static int debug; -#endif +static int debug = 0; /* Use our own dbg macro */ #undef dbg @@ -2,15 +2,18 @@ /* * USB Device Firmware Upgrade (DFU) handler * - * Copyright (c) 2003 Oliver Kurth <oku@masqmail.cx> - * Copyright (c) 2003 Joerg Albert <joerg.albert@gmx.de> + * Copyright (c) 2003 Oliver Kurth + * Copyright (c) 2004 Joerg Albert <joerg.albert@gmx.de> * * 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 file is part of the Berlios driver for WLAN USB devices based on the + * Atmel AT76C503A/505/505A. See at76c503.h for details. * +* */ /* Different to the previous version of usbdfu.c this module does not diff --git a/at76c503-fw_skel.c b/at76c503-fw_skel.c index 2511c55..6d640f7 100644 --- a/at76c503-fw_skel.c +++ b/at76c503-fw_skel.c @@ -1,17 +1,20 @@ /* -*- linux-c -*- */ /* - * $Id: at76c503-fw_skel.c,v 1.6 2004/03/18 20:54:57 jal2 Exp $ + * $Id: at76c503-fw_skel.c,v 1.7 2004/08/18 22:01:45 jal2 Exp $ * * Driver for at76c503-based devices based on the Atmel "Fast-Vnet" reference * - * Copyright (c) 2002 - 2003 Oliver Kurth <oku@masqmail.cx> - * Changes Copyright (c) 2003 Joerg Albert <joerg.albert@gmx.de> + * Copyright (c) 2002 - 2003 Oliver Kurth + * Changes Copyright (c) 2004 Joerg Albert <joerg.albert@gmx.de> * * 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 file is part of the Berlios driver for WLAN USB devices based on the + * Atmel AT76C503A/505/505A. See at76c503.h for details. + * * This file is the skeleton used in every fw-specific file. * It assumes to have the following defines * @@ -126,7 +129,7 @@ static int at76c50x_probe(struct usb_interface *interface, } else { err("firmware " FW_NAME " not found."); err("You may need to download the firmware from " - "http://www.thekelleys.org.uk/atmel or" + "http://www.thekelleys.org.uk/atmel or " "ftp://ftp.berlios.de/pub/at76c503a/firmware/"); RETERR(-EFAULT); } diff --git a/at76c503-i3861.c b/at76c503-i3861.c index 300562e..af7c1e3 100644 --- a/at76c503-i3861.c +++ b/at76c503-i3861.c @@ -1,12 +1,12 @@ /* -*- linux-c -*- */ /* - * $Id: at76c503-i3861.c,v 1.19 2004/03/07 22:09:41 jal2 Exp $ + * $Id: at76c503-i3861.c,v 1.20 2004/08/18 22:01:45 jal2 Exp $ * * Driver for at76c503-based devices based on the Atmel "Fast-Vnet" reference * design using Intersil 3861 radio chips * - * Copyright (c) 2002 - 2003 Oliver Kurth <oku@masqmail.cx> - * Changes Copyright (c) 2003 Joerg Albert <joerg.albert@gmx.de> + * Copyright (c) 2002 - 2003 Oliver Kurth + * Changes Copyright (c) 2004 Joerg Albert <joerg.albert@gmx.de> * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as @@ -16,6 +16,9 @@ * * This driver is derived from usb-skeleton.c * + * This file is part of the Berlios driver for WLAN USB devices based on the + * Atmel AT76C503A/505/505A. See at76c503.h for details. + * * This driver contains code specific to Atmel AT76C503 (USB wireless 802.11) * devices which use a Intersil 3861 radio chip. Almost * all of the actual driver is handled by the generic at76c503.c module, this @@ -47,7 +50,8 @@ struct firmware { /* Include firmware data definition: a dummy or a statically compiled-in fw */ #ifdef CONFIG_AT76C503_FIRMWARE_DOWNLOAD -# include "fw-empty.h" +/* a dummy struct to use if at76c503-*.o shall load the firmware via hotplug */ +static struct firmware static_fw = {0,NULL}; #else # include "fw-pkg-i3861.h" #endif @@ -109,6 +113,10 @@ Wireless USB Adapter SMC2662W (v1) */ #define VENDOR_ID_IO_DATA 0x04bb #define PRODUCT_ID_IO_DATA_WN_B11_USB 0x0919 /* IO-DATA WN-B11/USB */ +#define VENDOR_ID_BT 0x069a +#define PRODUCT_ID_BT_VOYAGER_1010 0x0821 /* BT Voyager 1010 */ + + static struct usb_device_id dev_table[] = { { USB_DEVICE(VENDOR_ID_ATMEL, PRODUCT_ID_ATMEL_503I ) }, { USB_DEVICE(VENDOR_ID_LINKSYS, PRODUCT_ID_LINKSYS_WUSB11_V21) }, @@ -124,6 +132,7 @@ static struct usb_device_id dev_table[] = { { USB_DEVICE(VENDOR_ID_CONCEPTRONIC,PRODUCT_ID_CONCEPTRONIC_C11U) }, { USB_DEVICE(VENDOR_ID_ARESCOM, PRODUCT_ID_WL_210) }, { USB_DEVICE(VENDOR_ID_IO_DATA, PRODUCT_ID_IO_DATA_WN_B11_USB) }, + { USB_DEVICE(VENDOR_ID_BT, PRODUCT_ID_BT_VOYAGER_1010 ) }, { } }; diff --git a/at76c503-i3863.c b/at76c503-i3863.c index 50ce025..b18e5e2 100644 --- a/at76c503-i3863.c +++ b/at76c503-i3863.c @@ -1,11 +1,11 @@ /* -*- linux-c -*- */ /* - * $Id: at76c503-i3863.c,v 1.10 2004/01/19 19:43:20 jal2 Exp $ + * $Id: at76c503-i3863.c,v 1.11 2004/08/18 22:01:45 jal2 Exp $ * * Driver for at76c503-based devices based on the Atmel "Fast-Vnet" reference * design using a Intersil 3863 radio chip * - * Copyright (c) 2002 - 2003 Oliver Kurth <oku@masqmail.cx> + * Copyright (c) 2002 - 2003 Oliver Kurth * Changes Copyright (c) 2003 Joerg Albert <joerg.albert@gmx.de> * * This program is free software; you can redistribute it and/or @@ -14,6 +14,9 @@ * the License, or (at your option) any later version. * * + * This file is part of the Berlios driver for WLAN USB devices based on the + * Atmel AT76C503A/505/505A. See at76c503.h for details. + * * This driver is derived from usb-skeleton.c * * This driver contains code specific to Atmel AT76C503 (USB wireless 802.11) @@ -46,7 +49,8 @@ struct firmware { /* Include firmware data definition: a dummy or a statically compiled-in fw */ #ifdef CONFIG_AT76C503_FIRMWARE_DOWNLOAD -# include "fw-empty.h" +/* a dummy struct to use if at76c503-*.o shall load the firmware via hotplug */ +static struct firmware static_fw = {0,NULL}; #else # include "fw-pkg-i3863.h" #endif diff --git a/at76c503-rfmd-acc.c b/at76c503-rfmd-acc.c index d3d7ba3..0815b7d 100644 --- a/at76c503-rfmd-acc.c +++ b/at76c503-rfmd-acc.c @@ -1,12 +1,12 @@ /* -*- linux-c -*- */ /* - * $Id: at76c503-rfmd-acc.c,v 1.10 2004/01/19 19:43:20 jal2 Exp $ + * $Id: at76c503-rfmd-acc.c,v 1.11 2004/08/18 22:01:45 jal2 Exp $ * * Driver for at76c503-based devices based on the Atmel "Fast-Vnet" reference * design using RFMD radio chips in the Accton OEM layout. * - * Copyright (c) 2002 - 2003 Oliver Kurth <oku@masqmail.cx> - * Changes Copyright (c) 2003 Joerg Albert <joerg.albert@gmx.de> + * Copyright (c) 2002 - 2003 Oliver Kurth + * Changes Copyright (c) 2004 Joerg Albert <joerg.albert@gmx.de> * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as @@ -14,6 +14,9 @@ * the License, or (at your option) any later version. * * + * This file is part of the Berlios driver for WLAN USB devices based on the + * Atmel AT76C503A/505/505A. See at76c503.h for details. + * * This driver is derived from usb-skeleton.c * * This driver contains code specific to Atmel AT76C503 (USB wireless 802.11) @@ -46,7 +49,8 @@ struct firmware { /* Include firmware data definition: a dummy or a statically compiled-in fw */ #ifdef CONFIG_AT76C503_FIRMWARE_DOWNLOAD -# include "fw-empty.h" +/* a dummy struct to use if at76c503-*.o shall load the firmware via hotplug */ +static struct firmware static_fw = {0,NULL}; #else # include "fw-pkg-rfmd-acc-1.101.0-84.h" #endif diff --git a/at76c503-rfmd.c b/at76c503-rfmd.c index caa55f2..2d2aa3d 100644 --- a/at76c503-rfmd.c +++ b/at76c503-rfmd.c @@ -1,18 +1,20 @@ /* -*- linux-c -*- */ /* - * $Id: at76c503-rfmd.c,v 1.24 2004/04/14 21:06:21 jal2 Exp $ + * $Id: at76c503-rfmd.c,v 1.25 2004/08/18 22:01:45 jal2 Exp $ * * Driver for at76c503-based devices based on the Atmel "Fast-Vnet" reference * design using RFMD radio chips * - * Copyright (c) 2002 - 2003 Oliver Kurth <oku@masqmail.cx> - * Changes Copyright (c) 2003 Joerg Albert <joerg.albert@gmx.de> + * Copyright (c) 2002 - 2003 Oliver Kurth + * Changes Copyright (c) 2004 Joerg Albert <joerg.albert@gmx.de> * * 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 file is part of the Berlios driver for WLAN USB devices based on the + * Atmel AT76C503A/505/505A. See at76c503.h for details. * * This driver is derived from usb-skeleton.c * @@ -56,7 +58,8 @@ struct firmware { /* Include firmware data definition: a dummy or a statically compiled-in fw */ #ifdef CONFIG_AT76C503_FIRMWARE_DOWNLOAD -# include "fw-empty.h" +/* a dummy struct to use if at76c503-*.o shall load the firmware via hotplug */ +static struct firmware static_fw = {0,NULL}; #else # include "fw-pkg-rfmd-1.101.0-84.h" #endif @@ -1,15 +1,20 @@ /* -*- linux-c -*- */ -/* $Id: at76c503.c,v 1.65 2004/08/13 22:45:49 jal2 Exp $ +/* $Id: at76c503.c,v 1.66 2004/08/18 22:01:45 jal2 Exp $ * * USB at76c503/at76c505 driver * - * Copyright (c) 2002 - 2003 Oliver Kurth <oku@masqmail.cx> + * Copyright (c) 2002 - 2003 Oliver Kurth + * Copyright (c) 2004 Joerg Albert <joerg.albert@gmx.de> + * Copyright (c) 2004 Nick Jones * * 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 file is part of the Berlios driver for WLAN USB devices based on the + * Atmel AT76C503A/505/505A. See at76c503.h for details. + * * Some iw_handler code was taken from airo.c, (C) 1999 Benjamin Reed * * History: @@ -112,8 +117,8 @@ #include <linux/rtnetlink.h> /* for rtnl_lock() */ #include "at76c503.h" -#include "ieee802_11.h" -#include "usbdfu.h" +#include "at76_ieee802_11.h" +#include "at76_usbdfu.h" /* timeout in seconds for the usb_control_msg in get_cmd_status * and set_card_command @@ -209,11 +214,7 @@ static inline void usb_set_intfdata(struct usb_interface *intf, void *data) {} #define DBG_RX_FRAGS_SKB 0x400000 /* show skb header for incoming rx fragments */ #define DBG_BSS_TABLE_RM 0x800000 /* inform on removal of old bss table entries */ -#ifdef CONFIG_USB_DEBUG -#define DBG_DEFAULTS (DBG_PROGRESS | DBG_PARAMS | DBG_BSS_TABLE | DBG_DEVSTART) -#else #define DBG_DEFAULTS 0 -#endif static int debug = DBG_DEFAULTS; static const u8 zeros[32]; @@ -264,7 +265,7 @@ static const u8 zeros[32]; /* Module paramaters */ MODULE_PARM(debug, "i"); #define DRIVER_AUTHOR \ -"Oliver Kurth <oku@masqmail.cx>, Joerg Albert <joerg.albert@gmx.de>, Alex <alex@foogod.com>" +"Oliver Kurth, Joerg Albert <joerg.albert@gmx.de>, Alex, Nick Jones" MODULE_PARM_DESC(debug, "Debugging level"); static int rx_copybreak = 200; @@ -6586,7 +6587,7 @@ int init_new_device(struct at76c503 *dev) else dev->rx_data_fcs_len = 4; - info("$Id: at76c503.c,v 1.65 2004/08/13 22:45:49 jal2 Exp $ compiled %s %s", __DATE__, __TIME__); + info("$Id: at76c503.c,v 1.66 2004/08/18 22:01:45 jal2 Exp $ compiled %s %s", __DATE__, __TIME__); info("firmware version %d.%d.%d #%d (fcs_len %d)", dev->fw_version.major, dev->fw_version.minor, dev->fw_version.patch, dev->fw_version.build, @@ -1,15 +1,27 @@ /* -*- linux-c -*- */ -/* $Id: at76c503.h,v 1.25 2004/08/13 00:17:23 jal2 Exp $ +/* $Id: at76c503.h,v 1.26 2004/08/18 22:01:45 jal2 Exp $ * - * USB at76c503 driver - * - * Copyright (c) 2002 - 2003 Oliver Kurth <oku@masqmail.cx> + * Copyright (c) 2002 - 2003 Oliver Kurth + * (c) 2003 - 2004 Jörg Albert <joerg.albert@gmx.de> * * 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 driver was based on information from the Sourceforge driver + * released and maintained by Atmel: + * + * http://sourceforge.net/projects/atmelwlandriver/ + * + * althrough the code was completely re-written. + * It would have been impossible without Atmel's decision to + * release an Open Source driver (unfortunately the firmware was + * kept binary only). Thanks for that decision to Atmel! + * + * For the latest version of this driver, mailinglists + * and other info, please check + * http://at76c503a.berlios.de/ */ #ifndef _AT76C503_H @@ -23,7 +35,20 @@ #endif #include <linux/version.h> -#include "ieee802_11.h" /* we need some constants here */ +#include "at76_ieee802_11.h" /* we need some constants here */ + +#ifndef COMPILE_FIRMWARE_INTO_DRIVER +# define CONFIG_AT76C503_FIRMWARE_DOWNLOAD +# define VERSION_APPEND "-fw_dwl" +#else +# ifdef CONFIG_AT76C503_FIRMWARE_DOWNLOAD +# undef CONFIG_AT76C503_FIRMWARE_DOWNLOAD +# endif +# define VERSION_APPEND "-static" +#endif + +/* current driver version */ +#define DRIVER_VERSION "v0.12beta17" VERSION_APPEND /* Workqueue / task queue backwards compatibility stuff */ #if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,41) diff --git a/at76c505-rfmd.c b/at76c505-rfmd.c index 62b3ce9..60b9278 100644 --- a/at76c505-rfmd.c +++ b/at76c505-rfmd.c @@ -1,18 +1,20 @@ /* -*- linux-c -*- */ /* - * $Id: at76c505-rfmd.c,v 1.13 2004/06/15 19:53:42 jal2 Exp $ + * $Id: at76c505-rfmd.c,v 1.14 2004/08/18 22:01:45 jal2 Exp $ * * Driver for at76c503-based devices based on the Atmel "Fast-Vnet" reference * design using at76c505 with RFMD radio chips * - * Copyright (c) 2002 - 2003 Oliver Kurth <oku@masqmail.cx> - * Changes Copyright (c) 2003 Joerg Albert <joerg.albert@gmx.de> + * Copyright (c) 2002 - 2003 Oliver Kurth + * Changes Copyright (c) 2004 Joerg Albert <joerg.albert@gmx.de> * * 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 file is part of the Berlios driver for WLAN USB devices based on the + * Atmel AT76C503A/505/505A. See at76c503.h for details. * * This driver is derived from usb-skeleton.c * @@ -46,7 +48,8 @@ struct firmware { /* Include firmware data definition: a dummy or a statically compiled-in fw */ #ifdef CONFIG_AT76C503_FIRMWARE_DOWNLOAD -# include "fw-empty.h" +/* a dummy struct to use if at76c503-*.o shall load the firmware via hotplug */ +static struct firmware static_fw = {0,NULL}; #else # include "fw-pkg-r505.h" #endif diff --git a/at76c505-rfmd2958.c b/at76c505-rfmd2958.c index 52d9bb3..176637f 100644 --- a/at76c505-rfmd2958.c +++ b/at76c505-rfmd2958.c @@ -6,7 +6,8 @@ * design using RFMD radio chips * This file is used for the AT76C505 with RFMD 2958 radio. * - * Copyright (c) 2002 - 2003 Oliver Kurth <oku@masqmail.cx> + * Copyright (c) 2002 - 2003 Oliver Kurth + * Copyright (c) 2004 Joerg Albert <joerg.albert@gmx.de> * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as @@ -14,6 +15,9 @@ * the License, or (at your option) any later version. * * + * This file is part of the Berlios driver for WLAN USB devices based on the + * Atmel AT76C503A/505/505A. See at76c503.h for details. + * * This driver is derived from usb-skeleton.c * * This driver contains code specific to Atmel AT76C505 (USB wireless 802.11) @@ -46,7 +50,8 @@ struct firmware { /* Include firmware data definition: a dummy or a statically compiled-in fw */ #ifdef CONFIG_AT76C503_FIRMWARE_DOWNLOAD -# include "fw-empty.h" +/* a dummy struct to use if at76c503-*.o shall load the firmware via hotplug */ +static struct firmware static_fw = {0,NULL}; #else # include "fw-pkg-505-rfmd2958-1.101.0-86.h" #endif diff --git a/at76c505a-rfmd2958.c b/at76c505a-rfmd2958.c index 51ae644..21751a7 100644 --- a/at76c505a-rfmd2958.c +++ b/at76c505a-rfmd2958.c @@ -1,11 +1,11 @@ /* -*- linux-c -*- */ /* - * $Id: at76c505a-rfmd2958.c,v 1.1 2004/06/15 20:02:05 jal2 Exp $ + * $Id: at76c505a-rfmd2958.c,v 1.2 2004/08/18 22:01:45 jal2 Exp $ * * Driver for at76c503-based devices based on the Atmel "Fast-Vnet" reference * design using a at76c505a (with RFMD radio chips ?) * - * Copyright (c) 2005 Joerg Albert <joerg.albert@gmx.de> + * Copyright (c) 2004 Joerg Albert <joerg.albert@gmx.de> * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as @@ -13,6 +13,9 @@ * the License, or (at your option) any later version. * * + * This file is part of the Berlios driver for WLAN USB devices based on the + * Atmel AT76C503A/505/505A. See at76c503.h for details. + * * This driver is derived from usb-skeleton.c * * This driver contains code specific to Atmel AT76C505A (USB wireless 802.11) @@ -45,7 +48,8 @@ struct firmware { /* Include firmware data definition: a dummy or a statically compiled-in fw */ #ifdef CONFIG_AT76C503_FIRMWARE_DOWNLOAD -# include "fw-empty.h" +/* a dummy struct to use if at76c503-*.o shall load the firmware via hotplug */ +static struct firmware static_fw = {0,NULL}; #else # include "fw-pkg-505a-rfmd2958-1.102.0-113.h" #endif diff --git a/fw-empty.h b/fw-empty.h deleted file mode 100644 index 4377c61..0000000 --- a/fw-empty.h +++ /dev/null @@ -1,4 +0,0 @@ -/* $Id: fw-empty.h,v 1.2 2003/12/25 22:40:26 jal2 Exp $ */ - -/* a dummy struct to use if at76c503-*.o shall load the firmware via hotplug */ -static struct firmware static_fw = {0,NULL}; diff --git a/kernel_patch.sh b/kernel_patch.sh new file mode 100755 index 0000000..be43610 --- /dev/null +++ b/kernel_patch.sh @@ -0,0 +1,103 @@ +#!/bin/bash +# arg1: kernel source root dir +# arg2..n: files to copy + +#set -x +if [ $# -ne 1 ]; then + echo "#ERR call $0 kernel_root_dir" + echo "set environment vars DRV_SRC, DRV_HDR to the file names" + exit 1 +fi + +KSRC=$1 +DEST=$KSRC/drivers/net/wireless +# subdir created in the above path +SUBDIR=at76c503 +# source of the makefile for the kernel subdir +KMAKEFILE=Makefile.k26 + +if [ "$DRV_SRC" == "" ]; then echo "#ERR env var DRV_SRC not set or empty"; exit 1; fi + +if [ "$DRV_HDR" == "" ]; then echo "#ERR env var DRV_HDR not set or empty"; exit 1; fi + +if [ ! -r at76c503.h ]; then echo "#ERR cannot read at76c503.h"; exit 2; fi + +if [ ! -d $DEST ]; then echo "#ERR $DEST is no directory"; exit 3; fi + +if [ ! -w $DEST ]; then echo "#ERR cannot write to directory $DEST"; exit 4; fi + +if [ ! -d $DEST/$SUBDIR ]; then + echo "creating $DEST/$SUBDIR" + if mkdir -p $DEST/$SUBDIR; then true; else echo "#ERR cannot create dir $DEST/$SUBDIR" && exit 5; fi +else + if [ ! -d $DEST/$SUBDIR ]; then + echo "#ERR $DEST/$SUBDIR exists and is no directory"; exit 5 + fi + if [ ! -w $DEST/$SUBDIR ]; then + echo "#ERR dir $DEST/$SUBDIR exists and is not writable"; exit 5 + fi +fi + +VERSION=`grep '^#define DRIVER_VERSION' at76c503.h | sed 's/#define.*DRIVER_VERSION.*\"\(.*\)\".*$/\1/g'` + +echo "patching driver version $VERSION into kernel source $KSRC" + +echo "copying $DRV_SRC $DRV_HDR $KMAKEFILE into $DEST/$SUBDIR" + +# for tests only +#exit 0 + +for f in $DRV_SRC $DRV_HDR; do + if cp -v $f $DEST/$SUBDIR; then true; else echo "#ERR cannot copy $i into $DEST/$SUBDIR"; exit 5; fi +done + +# copy the Makefile +if cp -v $KMAKEFILE $DEST/$SUBDIR/Makefile; then + true; +else + echo "#ERR cannot copy $KMAKEFILE into $DEST/$SUBDIR/Makefile" + exit 5 +fi + +# patch Kconfig +PWD=`pwd` +cd $DEST +if grep "^config USB_ATMEL" Kconfig; then + echo "found \"config USB_ATMEL\" in $DEST/Kconfig - leave it untouched" +else + echo "going to patch $DEST/Kconfig (original copied into Kconfig.orig)" + + mv Kconfig Kconfig.orig +# remove the last endmenu in Kconfig + head -$((`grep -n endmenu Kconfig.orig | tail -1 | sed 's/\([0-9]*\).*/\1/'`-1)) Kconfig.orig > Kconfig + (cat <<"EOF" +config USB_ATMEL + tristate "Atmel at76c503a/505/505a USB adapter" + depends on NET_RADIO && ATMEL && USB + select FW_LOADER + ---help--- + Enable support for WLAN USB adapters containing the + Atmel at76c503a, 505 and 505a chips. + +endmenu +EOF + ) >> Kconfig +fi + +# patch the Makefile +if grep "CONFIG_USB_ATMEL" Makefile; then + echo "found \"config CONFIG_USB_ATMEL\" in $DEST/Makefile - leave it untouched" +else + echo "going to patch $DEST/Makefile (original copied into Makefile.orig)" + + cp Makefile Makefile.orig + (cat <<EOF + +obj-\$(CONFIG_USB_ATMEL) += $SUBDIR/ + +EOF + ) >> Makefile + +fi + + |