aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJouni Malinen <j@w1.fi>2003-07-10 14:49:09 (GMT)
committerJouni Malinen <j@w1.fi>2003-07-10 14:49:09 (GMT)
commit9c658222cbf930a885078242228a2d460ab02d8c (patch)
tree95364c34fa208e88f481f763525fcc077e6a3d40
parente8a31963af419e8aaf4a60bc554043e5e00c048f (diff)
downloadhostap-history-9c658222cbf930a885078242228a2d460ab02d8c.zip
hostap-history-9c658222cbf930a885078242228a2d460ab02d8c.tar.gz
hostap-history-9c658222cbf930a885078242228a2d460ab02d8c.tar.bz2
Added module parameter 'dev_template' for setting the device name
template (default: 'wlan%d'); this is for hostap_{cs,pci,plx}.o.
-rw-r--r--ChangeLog2
-rw-r--r--driver/modules/hostap_hw.c17
2 files changed, 17 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index d630ad7..91c5e00 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -19,6 +19,8 @@ ChangeLog for Host AP driver for Intersil Prism2/2.5/3
saving mode
* removed backward compatibility code for Linux Wireless Extensions
versions older than ver 9
+ * added module parameter 'dev_template' for setting the device name
+ template (default: 'wlan%d'); this is for hostap_{cs,pci,plx}.o
2003-05-18 - v0.0.3
* redesigned RADIUS client implementation
diff --git a/driver/modules/hostap_hw.c b/driver/modules/hostap_hw.c
index 1cbcb67..a321be7 100644
--- a/driver/modules/hostap_hw.c
+++ b/driver/modules/hostap_hw.c
@@ -100,6 +100,11 @@ MODULE_PARM_DESC(bus_master_threshold_tx, "Packet length threshold for using "
"PCI bus master on TX");
#endif /* PRISM2_PCI and PRISM2_BUS_MASTER */
+static char *dev_template = "wlan%d";
+MODULE_PARM(dev_template, "s");
+MODULE_PARM_DESC(dev_template, "Prefix for network device name (default: "
+ "wlan%d)");
+
/* See IEEE 802.1H for LLC/SNAP encapsulation/decapsulation */
/* Ethernet-II snap header (RFC1042 for most EtherTypes) */
@@ -3362,16 +3367,24 @@ prism2_init_local_data(struct prism2_helper_functions *funcs, int card_idx)
static int prism2_init_dev(local_info_t *local)
{
struct net_device *dev = local->dev;
+ int len;
+
+ len = strlen(dev_template);
+ if (len >= IFNAMSIZ || strstr(dev_template, "%d") == NULL) {
+ printk(KERN_WARNING "hostap: Invalid dev_template='%s'\n",
+ dev_template);
+ return 1;
+ }
#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,4,0))
{
int i = 0;
do {
- sprintf(dev->name, "wlan%d", i++);
+ sprintf(dev->name, dev_template, i++);
} while (dev_get(dev->name));
}
#else
- memcpy(dev->name, "wlan%d", 7);
+ memcpy(dev->name, dev_template, len + 1);
#endif
if (register_netdev(dev)) {
printk(KERN_WARNING "%s: register_netdev() failed!\n",