[PATCH] Add info.linux.driver property for mac80211_hwsim devices



NetworkManager wants to read info.linux.driver for all devices.
Since a mac80211_hwsim device doesn't have a real parent the
property is not added. So let's add this property if there
is no proper parent and it is a 80211 device.

Signed-off-by: Daniel Wagner <wagi monom org>
---
 hald/linux/device.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/hald/linux/device.c b/hald/linux/device.c
index 21b9176..b68d3ef 100644
--- a/hald/linux/device.c
+++ b/hald/linux/device.c
@@ -1576,6 +1576,7 @@ net_add (const gchar *sysfs_path, const gchar *device_file, HalDevice *parent_de
 	guint media_type;
 	gint flags;
 	gint addr_len;
+	gboolean real_parent = TRUE;
 
 	d = NULL;
 	d = hal_device_new ();
@@ -1588,6 +1589,7 @@ net_add (const gchar *sysfs_path, const gchar *device_file, HalDevice *parent_de
 				HAL_ERROR (("Device '%s' has no parent and couldn't find computer root object."));
 				goto error;
 			}
+			real_parent = FALSE;
 		}
         }
 
@@ -1662,6 +1664,11 @@ net_add (const gchar *sysfs_path, const gchar *device_file, HalDevice *parent_de
 			hal_device_property_set_string (d, "info.category", "net.80211");
 			hal_device_add_capability (d, "net.80211");
 			hal_device_property_set_uint64 (d, "net.80211.mac_address", mac_address);
+
+			if (!real_parent) {
+				/* This is must be a mac80211_hwsim device */
+				hal_device_property_set_string (parent_dev, "info.linux.driver", "mac80211_hwsim");
+			}
 		} else if (stat (bridge_path, &s) == 0 && (s.st_mode & S_IFDIR)) {
 			hal_device_property_set_string (d, "info.product", "Bridge Interface");
 			hal_device_property_set_string (d, "info.category", "net.bridge");
-- 
1.6.0.2.GIT



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]