login
Header Space

 
 

Re: udev can't name PS3's network devices correctly

Score:
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Marco d'Itri <md@...>
Cc: Harald Hoyer <harald@...>, <linux-hotplug@...>, <netdev@...>, <schwidefsky@...>
Date: Monday, April 14, 2008 - 7:11 am

On Mon, 2008-04-14 at 11:08 +0100, David Woodhouse wrote:

That would look something like this (in fact, I think it would let us
get rid of the special case for S390 too)...

--- ./udev-120/extras/rule_generator/75-persistent-net-generator.rules~	2008-04-03 20:12:53.000000000 +0100
+++ ./udev-120/extras/rule_generator/75-persistent-net-generator.rules	2008-04-14 11:52:46.000000000 +0100
@@ -18,7 +18,7 @@ SUBSYSTEM!="net", GOTO="persistent_net_g
 NAME=="?*", GOTO="persistent_net_generator_end"
 
 # device name whitelist
-KERNEL!="eth*|ath*|wlan*[0-9]|ra*|sta*|ctc*|lcs*|hsi*", GOTO="persistent_net_generator_end"
+KERNEL!="eth*|ath*|wlan*[0-9]|ra*|sta*|ctc*|lcs*|hsi*|msh*", GOTO="persistent_net_generator_end"
 
 # ignore Xen virtual interfaces
 SUBSYSTEMS=="xen", GOTO="persistent_net_generator_end"
@@ -29,6 +29,9 @@ ENV{MATCHADDR}="$attr{address}"
 # match interface type
 ENV{MATCHIFTYPE}="$attr{type}"
 
+# match dev_id
+ENV{MATCHDEVID}="$attr{dev_id}"
+
 # do not use "locally administered" MAC address
 ENV{MATCHADDR}=="?[2367abef]:*", ENV{MATCHADDR}=""
 
--- ./udev-120/extras/rule_generator/write_net_rules~	2008-04-03 20:12:53.000000000 +0100
+++ ./udev-120/extras/rule_generator/write_net_rules	2008-04-14 11:47:27.000000000 +0100
@@ -15,6 +15,7 @@
 # variables used to communicate:
 #   MATCHADDR             MAC address used for the match
 #   MATCHID               bus_id used for the match
+#   MATCHDEVID            dev_id used for the match
 #   MATCHDRV              driver name used for the match
 #   MATCHIFTYPE           interface type match
 #   COMMENT               comment to add to the generated rule
@@ -78,6 +79,10 @@ if [ "$MATCHDRV" ]; then
 	match="$match, DRIVERS==\"$MATCHDRV\""
 fi
 
+if [ "$MATCHDEVID" ]; then
+	match="$match, ATTR{dev_id}==\"$MATCHDEVID\""
+fi
+
 if [ "$MATCHID" ]; then
 	match="$match, KERNELS==\"$MATCHID\""
 fi


... and this...

--- ./linux-2.6.24.ppc/drivers/net/ps3_gelic_wireless.c~	2008-04-13 13:38:15.000000000 +0100
+++ ./linux-2.6.24.ppc/drivers/net/ps3_gelic_wireless.c	2008-04-14 11:15:10.000000000 +0100
@@ -2699,6 +2699,7 @@ int gelic_wl_driver_probe(struct gelic_c
 	gelic_wl_setup_netdev_ops(netdev);
 
 	/* setup some of net_device and register it */
+	netdev->dev_id = GELIC_PORT_WIRELESS;
 	ret = gelic_net_setup_netdev(netdev, card);
 	if (ret)
 		goto fail_setup;
--- ./linux-2.6.24.ppc/drivers/net/ps3_gelic_net.c~	2008-04-13 13:38:15.000000000 +0100
+++ ./linux-2.6.24.ppc/drivers/net/ps3_gelic_net.c	2008-04-14 11:15:19.000000000 +0100
@@ -1635,6 +1635,7 @@ static int ps3_gelic_driver_probe(struct
 	netdev->irq = card->irq;
 	SET_NETDEV_DEV(netdev, &card->dev->core);
 	gelic_ether_setup_netdev_ops(netdev, &card->napi);
+	netdev->dev_id = GELIC_PORT_ETHERNET;
 	result = gelic_net_setup_netdev(netdev, card);
 	if (result) {
 		dev_dbg(&dev->core, "%s: setup_netdev failed %d",
--- ./linux-2.6.24.ppc/drivers/net/wireless/libertas/main.c~	2008-04-13 13:38:16.000000000 +0100
+++ ./linux-2.6.24.ppc/drivers/net/wireless/libertas/main.c	2008-04-14 10:49:52.000000000 +0100
@@ -1205,6 +1205,8 @@ int lbs_start_card(struct lbs_private *p
 	/* init 802.11d */
 	lbs_init_11d(priv);
 
+	dev->dev_id = 0;
+
 	if (register_netdev(dev)) {
 		lbs_pr_err("cannot register ethX device\n");
 		goto done;
@@ -1327,6 +1329,7 @@ static int lbs_add_mesh(struct lbs_priva
 	mesh_dev->wireless_handlers = (struct iw_handler_def *)&mesh_handler_def;
 #endif
 	/* Register virtual mesh interface */
+	mesh_dev->dev_id = 1;
 	ret = register_netdev(mesh_dev);
 	if (ret) {
 		lbs_pr_err("cannot register mshX virtual interface\n");
@@ -1542,6 +1545,7 @@ static int lbs_add_rtap(struct lbs_priva
 	rtap_dev->set_multicast_list = lbs_set_multicast_list;
 	rtap_dev->priv = priv;
 
+	rtap_dev->dev_id = 2;
 	ret = register_netdev(rtap_dev);
 	if (ret) {
 		free_netdev(rtap_dev);
--- ./linux-2.6.24.ppc/net/core/net-sysfs.c~	2008-04-13 13:38:24.000000000 +0100
+++ ./linux-2.6.24.ppc/net/core/net-sysfs.c	2008-04-14 10:58:32.000000000 +0100
@@ -87,6 +87,7 @@ static ssize_t netdev_store(struct devic
 	return ret;
 }
 
+NETDEVICE_SHOW(dev_id, fmt_hex);
 NETDEVICE_SHOW(addr_len, fmt_dec);
 NETDEVICE_SHOW(iflink, fmt_dec);
 NETDEVICE_SHOW(ifindex, fmt_dec);
@@ -210,6 +211,7 @@ static ssize_t store_tx_queue_len(struct
 
 static struct device_attribute net_class_attributes[] = {
 	__ATTR(addr_len, S_IRUGO, show_addr_len, NULL),
+	__ATTR(dev_id, S_IRUGO, show_dev_id, NULL),
 	__ATTR(iflink, S_IRUGO, show_iflink, NULL),
 	__ATTR(ifindex, S_IRUGO, show_ifindex, NULL),
 	__ATTR(features, S_IRUGO, show_features, NULL),

-- 
dwmw2

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Re: udev can't name PS3's network devices correctly, David Woodhouse, (Mon Apr 14, 6:08 am)
Re: udev can't name PS3's network devices correctly, Marco d'Itri, (Mon Apr 14, 8:51 am)
Re: udev can't name PS3's network devices correctly, David Woodhouse, (Mon Apr 14, 9:38 am)
Re: udev can't name PS3's network devices correctly, Kay Sievers, (Mon Apr 14, 8:03 am)
Re: udev can't name PS3's network devices correctly, David Woodhouse, (Mon Apr 14, 8:19 am)
Re: udev can't name PS3's network devices correctly, Kay Sievers, (Mon Apr 14, 8:52 am)
Re: udev can't name PS3's network devices correctly, David Woodhouse, (Mon Apr 14, 9:16 am)
Re: udev can't name PS3's network devices correctly, David Woodhouse, (Mon Apr 14, 7:11 am)
Re: udev can't name PS3's network devices correctly, Kay Sievers, (Mon Apr 14, 7:55 am)
Re: udev can't name PS3's network devices correctly, David Woodhouse, (Sun Apr 27, 1:37 pm)
Re: udev can't name PS3's network devices correctly, Kay Sievers, (Sun Apr 27, 2:28 pm)
[PATCH] Expose netdevice dev_id through sysfs, David Woodhouse, (Sun Apr 20, 7:22 am)
[PATCH] Expose netdevice dev_id through sysfs, David Woodhouse, (Mon Apr 14, 8:32 am)
Re: [PATCH] Expose netdevice dev_id through sysfs, David Miller, (Sat Apr 19, 9:33 pm)
Re: [PATCH] Expose netdevice dev_id through sysfs, David Woodhouse, (Sun Apr 20, 6:50 am)
Re: [PATCH] Expose netdevice dev_id through sysfs, David Miller, (Sun Apr 20, 6:55 am)
Re: [PATCH] Expose netdevice dev_id through sysfs, David Woodhouse, (Sun Apr 20, 7:12 am)
Re: [PATCH] Expose netdevice dev_id through sysfs, David Miller, (Sun Apr 20, 7:14 am)
Re: [PATCH] Expose netdevice dev_id through sysfs, Andrey Borzenkov, (Sun Apr 20, 1:21 am)
Re: [PATCH] Expose netdevice dev_id through sysfs, David Miller, (Sun Apr 20, 1:32 am)
speck-geostationary