summaryrefslogtreecommitdiff
path: root/at76c503-rfmd-acc.c
diff options
context:
space:
mode:
Diffstat (limited to 'at76c503-rfmd-acc.c')
-rw-r--r--at76c503-rfmd-acc.c158
1 files changed, 6 insertions, 152 deletions
diff --git a/at76c503-rfmd-acc.c b/at76c503-rfmd-acc.c
index 4a7a1b9..d0dcede 100644
--- a/at76c503-rfmd-acc.c
+++ b/at76c503-rfmd-acc.c
@@ -1,6 +1,6 @@
/* -*- linux-c -*- */
/*
- * $Id: at76c503-rfmd-acc.c,v 1.2.2.4 2003/09/04 05:27:19 jal2 Exp $
+ * $Id: at76c503-rfmd-acc.c,v 1.2.2.5 2003/12/25 22:19:43 jal2 Exp $
*
* Driver for at76c503-based devices based on the Atmel "Fast-Vnet" reference
* design using RFMD radio chips in the Accton OEM layout.
@@ -22,15 +22,6 @@
* file just registers for the USB ids and passes the correct firmware to
* at76c503.
*
- * History:
- *
- * 2003_02_11 0.1: (alex)
- * - split board-specific code off from at76c503.c
- * - reverted to 0.90.2 firmware because 0.100.x is broken for WUSB11
- *
- * 2003_02_18 0.2: (alex)
- * - Reduced duplicated code and moved as much as possible into at76c503.c
- * - Changed default netdev name to "wlan%d"
*/
#include <linux/config.h>
@@ -58,6 +49,8 @@
/* firmware name to load if above include file contains empty fw only */
#define FW_NAME DRIVER_NAME "-fw"
+#define BOARDTYPE BOARDTYPE_RFMD_ACC
+
/* USB Device IDs supported by this driver */
#define VENDOR_ID_SMC 0x083a
@@ -69,145 +62,6 @@ static struct usb_device_id dev_table[] = {
};
/*---------------------------------------------------------------------------*/
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 5, 0)
-extern inline char *fw_dev_param(struct usb_device *udev, char *buf)
-{
- snprintf(buf, FIRMWARE_NAME_MAX, "usb-%s-%s",
- udev->bus->bus_name, udev->devpath);
- return buf;
-}
-#else
-#define fw_dev_param(udev, buf) (&udev->dev)
-#endif
-
-MODULE_DEVICE_TABLE (usb, dev_table);
-
-/* this is the firmware we use */
-const struct firmware *fw;
-
-/* Module paramaters */
-
-static char netdev_name[IFNAMSIZ+1] = "wlan%d";
-MODULE_PARM(netdev_name, "c" __MODULE_STRING(IFNAMSIZ));
-MODULE_PARM_DESC(netdev_name,
- "network device name (default is wlan%d)");
-static int debug = 1;
-MODULE_PARM(debug, "i");
-MODULE_PARM_DESC(debug,
- "debug output (default: 1)");
-
-/* Use our own dbg macro */
-#undef dbg
-#define dbg(format, arg...) \
- do { \
- if (debug) \
- printk(KERN_DEBUG __FILE__ ": " format "\n" , ## arg);\
- } while (0)
-
-
-/* local function prototypes */
-
-static int at76c50x_probe(struct usb_interface *interface,
- const struct usb_device_id *id);
-
-static void at76c50x_disconnect(struct usb_interface *interface);
-
-/* structure for registering this driver with the usb subsystem */
-
-static struct usb_driver module_usb = {
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,20)
- owner: THIS_MODULE,
-#endif
- name: DRIVER_NAME,
- probe: at76c50x_probe,
- disconnect: at76c50x_disconnect,
- id_table: dev_table,
-};
-
-/* Module and USB entry points */
-
-
-static int at76c50x_probe(struct usb_interface *interface,
- const struct usb_device_id *id)
-{
- struct usb_device *udev __attribute__ ((unused));
- udev = interface_to_usbdev(interface);
-
- /* if fw is statically compiled in, we use it */
- if (static_fw.size > 0) {
- dbg("using compiled-in firmware");
- fw = &static_fw;
- } else {
-#ifdef CONFIG_AT76C503_FIRMWARE_DOWNLOAD
- char buf[FIRMWARE_NAME_MAX] __attribute__ ((unused));
- if (fw == NULL) {
- dbg("downloading firmware " FW_NAME);
- if (request_firmware(&fw, FW_NAME,
- fw_dev_param(udev,buf)) == 0) {
- dbg("got it.");
- } else {
- err("firmware " FW_NAME " not found.");
- return -EFAULT;
- }
- } else
- dbg("re-using previously loaded fw");
-#else
- err("either configure driver for firmware loader or compile"
- "firmware in");
- return -EFAULT;
-#endif
- }
-
- return at76c503_do_probe(interface, &module_usb, fw->data, fw->size,
- BOARDTYPE_RFMD_ACC, netdev_name);
-}
-
-static void at76c50x_disconnect(struct usb_interface *interface)
-{
- struct at76c503 *dev;
-
- dbg("%s: ENTER", __FUNCTION__);
-
- dev = usb_get_intfdata (interface);
- usb_set_intfdata(interface, NULL);
-
- info("%s disconnected", dev->netdev->name);
- at76c503_delete_device(dev);
-
- dbg("%s: EXIT", __FUNCTION__);
-}
-
-static int __init mod_init(void)
-{
- int result;
-
- info(DRIVER_DESC " " DRIVER_VERSION " loading");
-
- /* register this driver with the USB subsystem */
- result = usb_register(&module_usb);
- if (result < 0) {
- err("usb_register failed (status %d)", result);
- return -1;
- }
-
- fw = NULL;
- return 0;
-}
-
-static void __exit mod_exit(void)
-{
- info(DRIVER_DESC " " DRIVER_VERSION " unloading");
- usb_deregister(&module_usb);
-#ifdef CONFIG_AT76C503_FIRMWARE_DOWNLOAD
- if (static_fw.size == 0 && fw != NULL)
- /* we had loaded and allocated the buffer before */
- release_firmware(fw);
-#endif
-}
-
-module_init (mod_init);
-module_exit (mod_exit);
-
-MODULE_AUTHOR(DRIVER_AUTHOR);
-MODULE_DESCRIPTION(DRIVER_DESC);
-MODULE_LICENSE("GPL");
+/* jal: not really good style to include a .c file, but all but the above
+ is constant in the at76c503-*.c files ... */
+#include "at76c503-fw_skel.c"