Skip to contentSkip to conversation

wireless: Clean up firmware loading in Atmel driver

PATCH In review Dan Williams 3 participants 3 messages Feb 2, 2005 – Feb 26, 2005

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/2 wireless: Clean up firmware loading in Atmel driver

(resend)

Identify different firmware by enums, not strings, as we need to have some integral firmware identifier for choosing maximum rssi values for each different firmware type. Consolidate the information about firmware filenames and capabilities in the atmel module, not in atmel_cs or atmel_pci. Move common prototypes and firmware enum into new atmel.h file. The atmel_cs driver also thought that init_atmel_card() took "int irq" as the first parameter, this is now fixed to be "unsigned short irq".

drivers/net/wireless/atmel.h new file +43 -0
@@ -0,0 +1,43 @@
+/*** -*- linux-c -*- **********************************************************
+
+     Driver for Atmel at76c502 at76c504 and at76c506 wireless cards.
+
+         Copyright 2005 Dan Williams and Red Hat, Inc.
+
+    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 software 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 Atmel wireless lan drivers; if not, write to the Free Software
+    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+
+******************************************************************************/
+
+#ifndef _ATMEL_H
+#define _ATMEL_H
+
+typedef enum {
+	ATMEL_FW_TYPE_NONE = 0,
+	ATMEL_FW_TYPE_502,
+	ATMEL_FW_TYPE_502D,
+	ATMEL_FW_TYPE_502E,
+	ATMEL_FW_TYPE_502_3COM,
+	ATMEL_FW_TYPE_504,
+	ATMEL_FW_TYPE_504_2958,
+	ATMEL_FW_TYPE_504A_2958,
+	ATMEL_FW_TYPE_506
+} AtmelFWType;
+
+struct net_device *init_atmel_card(unsigned short, int, const AtmelFWType, struct device *, 
+				    int (*present_func)(void *), void * );
+void stop_atmel_card( struct net_device *, int );
+int atmel_open( struct net_device * );
+
+#endif
drivers/net/wireless/atmel.c +45 -17

115 lines not on this page · raw message

drivers/net/wireless/atmel_cs.c +22 -26

74 lines not on this page · raw message

drivers/net/wireless/atmel_pci.c +2 -4
@@ -25,6 +25,7 @@
 #include <linux/module.h>
 #include <linux/init.h>
 #include <linux/netdevice.h>
+#include "atmel.h"
 
 MODULE_AUTHOR("Simon Kelley");
 MODULE_DESCRIPTION("Support for Atmel at76c50x 802.11 wireless ethernet cards.");
@@ -40,9 +41,6 @@
 
 static int atmel_pci_probe(struct pci_dev *, const struct pci_device_id *);
 static void atmel_pci_remove(struct pci_dev *);
-struct net_device *init_atmel_card(int, int, char *, struct device *, 
-				   int (*present_func)(void *), void * );
-void stop_atmel_card( struct net_device *, int );
 
 static struct pci_driver atmel_driver = {
 	.name     = "atmel",
@@ -63,7 +61,7 @@
 	pci_set_master(pdev);
 	
 	dev = init_atmel_card(pdev->irq, pdev->resource[1].start, 
-			      "atmel_at76c506%s.bin",
+			      ATMEL_FW_TYPE_506,
 			      &pdev->dev, NULL, NULL);
 	if (!dev)
 		return -ENODEV;
#1 lore raw

All Dans patches look good, in principle, to me.

There's one more entry to go in the device table which has been floating around for a month or two, but doesn't seem to have made it in yet,

in the new format:

{0, 0," LG/LW2100N", ATMEL_FW_TYPE_502E, "LG LW2100N 11Mbps WLAN PCMCIA Card" }

Dan, if you make another version of your patch maybe you could add that, otherwise I'll submit it as a follow-on once your changes have gone in.

Cheers,

Simon.