Hello again, not as important as my last patch, but I think it's useful, especially for hotpluggable devices, that can be plugged in at any order: set the network device name with a module parameter (eth_name).
Greetings, Oliver
--- drivers/usb/kaweth.c.orig1 Thu Feb 6 19:52:29 2003
+++ drivers/usb/kaweth.c Thu Feb 6 20:10:17 2003
@@ -114,6 +114,11 @@
MODULE_DESCRIPTION("KL5USB101 USB Ethernet driver");
MODULE_LICENSE("GPL");
+static char eth_name[IFNAMSIZ] = "eth%d";
+MODULE_PARM(eth_name, "c" __MODULE_STRING(IFNAMSIZ));
+MODULE_PARM_DESC(eth_name,
+ "the device name (default is eth%d)");
+
static void *kaweth_probe(
struct usb_device *dev, /* the device */
unsigned ifnum, /* what interface */
@@ -1013,7 +1018,7 @@
if (!kaweth->irq_urb)
goto err_tx_and_rx;
- kaweth->net = init_etherdev(0, 0);
+ kaweth->net = alloc_etherdev(0);
if (!kaweth->net) {
kaweth_err("Error calling init_etherdev.");
return kaweth;
@@ -1038,6 +1043,10 @@
kaweth->net->mtu = le16_to_cpu(kaweth->configuration.segment_size);
memset(&kaweth->stats, 0, sizeof(kaweth->stats));
+
+ strcpy(&kaweth->net->name, eth_name);
+
+ register_netdev(kaweth->net);
kaweth_info("kaweth interface created at %s", kaweth->net->name);
msg11350/pgp00000.pgp
Description: PGP signature
