convert wireless drivers to module_param*
PATCH 1/1 convert wireless drivers to module_param*
Replaces MODULE_PARM with module_param calls in all wireless drivers. Note that this patch skips prism54 because it has been converted already.
Also note that this patch does _not_ fix the numerous casting warnings
generated by a few drivers (e.g. orinoco and hermes). Most of these warnings look like:drivers/net/wireless/hermes.c:379: warning: passing arg 1 of `readw' makes pointer from integer without a cast
There are quite a few writeable sysfs entries. Though I was careful, and did not 0644 things like IRQs, I may have made some silly mistake somewhere, who knows. Please review the permissions carefully.
I also reordered arlan module parameter declarations a little to improve readability. All debug related parameter stuff is now declared in one block, rather than all over the place. Some debug related module parameters even used to be declared outside DEBUG #ifdefs. Generally, the arlan debug code is still broken, though. It currently does not compile, and this patch does not make it compile.
In wavelan.c, use strlcpy instead of memcpy to copy the interface name parameter.
Keep in mind that this is my very first go on the kernel... That is, there is a 99% chance that I made a big mistake somewhere ;-)
drivers/net/wireless/airo.c +14 -14
@@ -246,36 +246,36 @@ MODULE_DESCRIPTION("Support for Cisco/Ai for PCMCIA when used with airo_cs.");MODULE_LICENSE ("Dual BSD/GPL" );MODULE_SUPPORTED_DEVICE ("Aironet 4500, 4800 and Cisco 340/350" ); -MODULE_PARM (io,"1-4i" ); -MODULE_PARM (irq,"1-4i" ); -MODULE_PARM (basic_rate,"i" ); -MODULE_PARM (rates,"1-8i" ); -MODULE_PARM (ssids,"1-3s" ); -MODULE_PARM (auto_wep,"i" ); +module_param_array (io, int,NULL ,0444 ); +module_param_array (irq, int,NULL ,0444 ); +module_param (basic_rate, int,0644 ); +module_param_array (rates, int,NULL ,0644 ); +module_param_array (ssids, int,NULL ,0644 ); +module_param (auto_wep, int,0644 );MODULE_PARM_DESC (auto_wep,"If non-zero, the driver will keep looping through \ the authentication options until an association is made. The value of \ auto_wep is number of the wep keys to check. A value of 2 will try using \ the key at index 0 and index 1." ); -MODULE_PARM (aux_bap,"i" ); +module_param (aux_bap, int,0644 );MODULE_PARM_DESC (aux_bap,"If non-zero, the driver will switch into a mode \ than seems to work better for older cards with some older buses. Before \ switching it checks that the switch is needed." ); -MODULE_PARM (maxencrypt,"i" ); +module_param (maxencrypt, int,0644 );MODULE_PARM_DESC (maxencrypt,"The maximum speed that the card can do \ encryption. Units are in 512kbs. Zero (default) means there is no limit. \ Older cards used to be limited to 2mbs (4)." ); -MODULE_PARM (adhoc,"i" ); +module_param (adhoc, int,0644 );MODULE_PARM_DESC (adhoc,"If non-zero, the card will start in adhoc mode." ); -MODULE_PARM (probe,"i" ); +module_param (probe, int,0644 );MODULE_PARM_DESC (probe,"If zero, the driver won't start the card." ); -MODULE_PARM (proc_uid,"i" ); +module_param (proc_uid, int,0644 );MODULE_PARM_DESC (proc_uid,"The uid that the /proc files will belong to." ); -MODULE_PARM (proc_gid,"i" ); +module_param (proc_gid, int,0644 );MODULE_PARM_DESC (proc_gid,"The gid that the /proc files will belong to." ); -MODULE_PARM (airo_perm,"i" ); +module_param (airo_perm, int,0644 );MODULE_PARM_DESC (airo_perm,"The permission bits of /proc/[driver/]aironet." ); -MODULE_PARM (proc_perm,"i" ); +module_param (proc_perm, int,0644 );MODULE_PARM_DESC (proc_perm,"The permission bits of the files in /proc" );/* This is a kind of sloppy hack to get this information to OUT4500 and
drivers/net/wireless/airo_cs.c +3 -3
@@ -52,7 +52,7 @@*/ #ifdef PCMCIA_DEBUG static int pc_debug =PCMCIA_DEBUG ; -MODULE_PARM (pc_debug,"i" ); +module_param (pc_debug, int,0644 );static char *version ="$Revision: 1.2 $" ; #define DEBUG(n, args...) if (pc_debug>(n)) printk(KERN_DEBUG args);#else
@@ -75,8 +75,8 @@ MODULE_DESCRIPTION("Support for Cisco/Ai with the airo module.");MODULE_LICENSE ("Dual BSD/GPL" );MODULE_SUPPORTED_DEVICE ("Aironet 4500, 4800 and Cisco 340 PCMCIA cards" ); -MODULE_PARM (irq_mask,"i" ); -MODULE_PARM (irq_list,"1-4i" ); +module_param (irq_mask, int,0644 ); +module_param_array (irq_list, int,NULL ,0444 );/*==================================*/
drivers/net/wireless/arlan-main.c +29 -35
81 lines not on this page · raw message
drivers/net/wireless/atmel_cs.c +3 -3
@@ -65,7 +65,7 @@*/ #ifdef PCMCIA_DEBUG static int pc_debug =PCMCIA_DEBUG ; -MODULE_PARM (pc_debug,"i" ); +module_param (pc_debug, int,0644 );static char *version ="$Revision: 1.2 $" ; #define DEBUG(n, args...) if (pc_debug>(n)) printk(KERN_DEBUG args);#else
@@ -86,8 +86,8 @@ MODULE_AUTHOR("Simon Kelley");MODULE_DESCRIPTION ("Support for Atmel at76c50x 802.11 wireless ethernet cards." );MODULE_LICENSE ("GPL" );MODULE_SUPPORTED_DEVICE ("Atmel at76c50x PCMCIA cards" ); -MODULE_PARM (irq_mask,"i" ); -MODULE_PARM (irq_list,"1-4i" ); +module_param (irq_mask, int,0444 ); +module_param_array (irq_list, int,NULL ,0444 );/*==================================*/
drivers/net/wireless/netwave_cs.c +6 -6
@@ -161,7 +161,7 @@ static const unsigned int txConfLoop#ifdef PCMCIA_DEBUG static int pc_debug =PCMCIA_DEBUG ; -MODULE_PARM (pc_debug,"i" ); +module_param (pc_debug, int,0644 ); #define DEBUG(n, args...) if (pc_debug>(n)) printk(KERN_DEBUG args) static char *version "netwave_cs.c 0.3.0 Thu Jul 17 14:36:02 1997 (John Markus Bjørndalen)\n";
@@ -195,11 +195,11 @@ static int mem_speed;static u_int irq_mask =0xdeb8 ;static int irq_list[4 ] = {-1 }; -MODULE_PARM (domain,"i" ); -MODULE_PARM (scramble_key,"i" ); -MODULE_PARM (mem_speed,"i" ); -MODULE_PARM (irq_mask,"i" ); -MODULE_PARM (irq_list,"1-4i" ); +module_param (domain, uint,0644 ); +module_param (scramble_key, uint,0644 ); +module_param (mem_speed, int,0444 ); +module_param (irq_mask, uint,0444 ); +module_param_array (irq_list, int,NULL ,0444 );/*==================================*/
drivers/net/wireless/orinoco.c +2 -2
@@ -461,12 +461,12 @@ MODULE_LICENSE("Dual MPL/GPL");/* Level of debugging. Used in the macros in orinoco.h */ #ifdef ORINOCO_DEBUG int orinoco_debug =ORINOCO_DEBUG ; -MODULE_PARM (orinoco_debug,"i" ); +module_param (orinoco_debug, int,0644 );EXPORT_SYMBOL (orinoco_debug);#endif static int suppress_linkstatus;/* = 0 */ -MODULE_PARM (suppress_linkstatus,"i" ); +module_param (suppress_linkstatus, bool,0644 );/********************************************************************/ /* Compile time configuration and compatibility stuff */
drivers/net/wireless/orinoco_cs.c +3 -3
@@ -64,9 +64,9 @@ static int irq_list[4] = { -1 };* don't have any CIS entry for it. This workaround it... */ static int ignore_cis_vcc;/* = 0 */ -MODULE_PARM (irq_mask,"i" ); -MODULE_PARM (irq_list,"1-4i" ); -MODULE_PARM (ignore_cis_vcc,"i" ); +module_param (irq_mask, uint,0444 ); +module_param_array (irq_list, int,NULL ,0444 ); +module_param (ignore_cis_vcc, bool,0644 );/********************************************************************/ /* Magic constants */
drivers/net/wireless/ray_cs.c +13 -13
@@ -84,7 +84,7 @@ typedef u_char mac_addr[ETH_ALEN]; /* Ha#ifdef PCMCIA_DEBUG static int ray_debug;static int pc_debug =PCMCIA_DEBUG ; -MODULE_PARM (pc_debug,"i" ); +module_param (pc_debug, bool,0644 );/* #define DEBUG(n, args...) if (pc_debug>(n)) printk(KERN_DEBUG args); */ #define DEBUG(n, args...) if (pc_debug>(n)) printk(args);#else
@@ -226,18 +226,18 @@ MODULE_AUTHOR("Corey Thomas <corey@worldMODULE_DESCRIPTION ("Raylink/WebGear wireless LAN driver" );MODULE_LICENSE ("GPL" ); -MODULE_PARM (irq_mask,"i" ); -MODULE_PARM (net_type,"i" ); -MODULE_PARM (hop_dwell,"i" ); -MODULE_PARM (beacon_period,"i" ); -MODULE_PARM (psm,"i" ); -MODULE_PARM (essid,"s" ); -MODULE_PARM (translate,"i" ); -MODULE_PARM (country,"i" ); -MODULE_PARM (sniffer,"i" ); -MODULE_PARM (bc,"i" ); -MODULE_PARM (phy_addr,"s" ); -MODULE_PARM (ray_mem_speed,"i" ); +module_param (irq_mask, u_long,0444 ); +module_param (net_type,int,0644 ); +module_param (hop_dwell, int,0644 ); +module_param (beacon_period, int,0644 ); +module_param (psm, bool,0644 ); +module_param_string (essid, esiid,32 ,0444 ); +module_param (translate, bool,0644 ); +module_param (country, int,0644 ); +module_param (sniffer, bool,0444 ); +module_param (bc, bool,0444 ); +module_param_string (phy_addr, phy_addr,ADDRLEN ,0444 ); +module_param (ray_mem_speed, int,0444 );static UCHAR b5_default_startup_parms[] = {0 ,0 ,/* Adhoc station */
drivers/net/wireless/wavelan.c +1 -1
@@ -4344,7 +4344,7 @@ int init_module(void)struct net_device *dev =alloc_etherdev (sizeof (net_local));if (!dev)break ; -memcpy (dev->name, name[i],IFNAMSIZ );/* Copy name */ +strlcpy (dev->name, name[i],IFNAMSIZ );/* Copy name */ dev->base_addr = io[i]; dev->irq = irq[i];
drivers/net/wireless/wavelan_cs.p.h +4 -4
@@ -803,14 +803,14 @@ static int irq_list[4] = { -1 };static int mem_speed =0 ;/* New module interface */ -MODULE_PARM (irq_mask,"i" ); -MODULE_PARM (irq_list,"1-4i" ); -MODULE_PARM (mem_speed,"i" ); +module_param (irq_mask, int,0444 ); +module_param_array (irq_list, int,NULL ,0444 ); +module_param (mem_speed, int,0444 );#ifdef WAVELAN_ROAMING /* Conditional compile, see above in options */ /* Enable roaming mode ? No ! Please keep this to 0 */ static int do_roaming =0 ; -MODULE_PARM (do_roaming,"i" ); +module_param (do_roaming, bool,0444 );#endif /* WAVELAN_ROAMING */ MODULE_LICENSE ("GPL" );
drivers/net/wireless/wavelan.p.h +4 -4
@@ -704,12 +704,12 @@ static unsigned short iobase[] static int io[4];static int irq[4 ];static char name[4 ][IFNAMSIZ ]; -MODULE_PARM (io,"1-4i" ); -MODULE_PARM (irq,"1-4i" ); -MODULE_PARM (name,"1-4c" __MODULE_STRING(IFNAMSIZ )); +module_param_array (io, int,NULL ,0444 ); +module_param_array (irq, int,NULL ,0444 ); +module_param_array (name, charp,NULL ,0444 );MODULE_PARM_DESC (io,"WaveLAN I/O base address(es),required" );MODULE_PARM_DESC (irq,"WaveLAN IRQ number(s)" ); -MODULE_PARM_DESC (name,"WaveLAN interface neme(s)" ); +MODULE_PARM_DESC (name,"WaveLAN interface name(s)" );#endif /* MODULE */ #endif /* WAVELAN_P_H */
drivers/net/wireless/wl3501_cs.c +3 -3
@@ -79,7 +79,7 @@#define PCMCIA_DEBUG 0#ifdef PCMCIA_DEBUG static int pc_debug =PCMCIA_DEBUG ; -MODULE_PARM (pc_debug,"i" ); +module_param (pc_debug, bool,0644 ); #define dprintk(n, format, args...) \ { if (pc_debug > (n)) \ printk(KERN_INFO "%s: " format "\n", __FUNCTION__ , ##args); }
@@ -2279,8 +2279,8 @@ static void __exit wl3501_exit_module(vomodule_init (wl3501_init_module);module_exit (wl3501_exit_module); -MODULE_PARM (wl3501_irq_mask,"i" ); -MODULE_PARM (wl3501_irq_list,"1-4i" ); +module_param (wl3501_irq_mask, long,0444 ); +module_param_array (wl3501_irq_list, int,NULL ,0444 );MODULE_AUTHOR ("Fox Chen <[email protected]>, " "Arnaldo Carvalho de Melo <[email protected]>," "Gustavo Niemeyer <[email protected]>" );
_______________________________________________
Kernel-janitors mailing list
[email protected]
http://lists.osdl.org/mailman/listinfo/kernel-janitors
On Mon, Nov 08, 2004 at 11:31:11PM +0100, Stefan Sperling wrote:
<snip>
Quoted 2 lines
Keep in mind that this is my very first go on the kernel... That is, there is a 99% chance that I made a big mistake somewhere ;-)
Can you send these split-out as individual patches (one per file).
Thanks,
Nish
_______________________________________________
Kernel-janitors mailing list
[email protected]
http://lists.osdl.org/mailman/listinfo/kernel-janitors
Quoted 8 lines · Nishanth Aravamudan
On Mon, Nov 08, 2004 at 11:31:11PM +0100, Stefan Sperling wrote:
<snip>
Quoted 2 lines
Keep in mind that this is my very first go on the kernel... That is, there is a 99% chance that I made a big mistake somewhere ;-)
Can you send these split-out as individual patches (one per file).
OK. But not today, my timezone says I should really go to bed...
stefan
Signature · 2 lines
Give me a fish and I will eat today. Teach me to fish and I will eat forever.
_______________________________________________
Kernel-janitors mailing list
[email protected]
http://lists.osdl.org/mailman/listinfo/kernel-janitors