Home Home > GIT Browse
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOlaf Hering <ohering@suse.de>2011-09-02 18:29:33 +0200
committerOlaf Hering <ohering@suse.de>2011-09-02 18:29:33 +0200
commit94054c9188c313781025b7e14b01c2611c125ef3 (patch)
treec60ab2367d15d4a2fe2882a4c02d40178f103721
parentd77df1b9e2a08eb1b39e575a2db42f3c3b39382b (diff)
Staging: hv: vmbus: Show the modalias in /sys/bus/vmbus/devices/*/
-rw-r--r--patches.suse/staging-hv-vmbus-modalias-show.patch68
-rw-r--r--series.conf1
2 files changed, 69 insertions, 0 deletions
diff --git a/patches.suse/staging-hv-vmbus-modalias-show.patch b/patches.suse/staging-hv-vmbus-modalias-show.patch
new file mode 100644
index 0000000000..4f68c822e1
--- /dev/null
+++ b/patches.suse/staging-hv-vmbus-modalias-show.patch
@@ -0,0 +1,68 @@
+From: <ohering@suse.de>
+Subject: Staging: hv: vmbus: Show the modalias in /sys/bus/vmbus/devices/*/
+Patch-mainline: submitted 20110902 lkml
+References: fate#311487
+
+---
+ drivers/staging/hv/vmbus_drv.c | 21 ++++++++++++++++-----
+ 1 file changed, 16 insertions(+), 5 deletions(-)
+
+--- a/drivers/staging/hv/vmbus_drv.c
++++ b/drivers/staging/hv/vmbus_drv.c
+@@ -93,6 +93,14 @@ static void get_channel_info(struct hv_d
+ debug_info.outbound.bytes_avail_towrite;
+ }
+
++#define VMBUS_ALIAS_LEN ((sizeof((struct hv_vmbus_device_id *)0)->guid) * 2)
++static void print_alias_name(struct hv_device *hv_dev, char *alias_name)
++{
++ int i;
++ for (i = 0; i < VMBUS_ALIAS_LEN; i += 2)
++ sprintf(&alias_name[i], "%02x", hv_dev->dev_type.b[i/2]);
++}
++
+ /*
+ * vmbus_show_device_attr - Show the device attribute in sysfs.
+ *
+@@ -105,6 +113,7 @@ static ssize_t vmbus_show_device_attr(st
+ {
+ struct hv_device *hv_dev = device_to_hv_device(dev);
+ struct hv_device_info device_info;
++ char alias_name[VMBUS_ALIAS_LEN + 1];
+
+ memset(&device_info, 0, sizeof(struct hv_device_info));
+
+@@ -148,6 +157,9 @@ static ssize_t vmbus_show_device_attr(st
+ device_info.chn_instance.b[13],
+ device_info.chn_instance.b[14],
+ device_info.chn_instance.b[15]);
++ } else if (!strcmp(dev_attr->attr.name, "modalias")) {
++ print_alias_name(hv_dev, alias_name);
++ return sprintf(buf, "vmbus:%s\n", alias_name);
+ } else if (!strcmp(dev_attr->attr.name, "state")) {
+ return sprintf(buf, "%d\n", device_info.chn_state);
+ } else if (!strcmp(dev_attr->attr.name, "id")) {
+@@ -204,6 +216,7 @@ static struct device_attribute vmbus_dev
+ __ATTR(class_id, S_IRUGO, vmbus_show_device_attr, NULL),
+ __ATTR(device_id, S_IRUGO, vmbus_show_device_attr, NULL),
+ __ATTR(monitor_id, S_IRUGO, vmbus_show_device_attr, NULL),
++ __ATTR(modalias, S_IRUGO, vmbus_show_device_attr, NULL),
+
+ __ATTR(server_monitor_pending, S_IRUGO, vmbus_show_device_attr, NULL),
+ __ATTR(server_monitor_latency, S_IRUGO, vmbus_show_device_attr, NULL),
+@@ -242,12 +255,10 @@ static struct device_attribute vmbus_dev
+ static int vmbus_uevent(struct device *device, struct kobj_uevent_env *env)
+ {
+ struct hv_device *dev = device_to_hv_device(device);
+- int i, ret;
+- char alias_name[((sizeof((struct hv_vmbus_device_id *)0)->guid) + 1) * 2];
+-
+- for (i = 0; i < ((sizeof((struct hv_vmbus_device_id *)0)->guid) * 2); i += 2)
+- sprintf(&alias_name[i], "%02x", dev->dev_type.b[i/2]);
++ int ret;
++ char alias_name[VMBUS_ALIAS_LEN + 1];
+
++ print_alias_name(dev, alias_name);
+ ret = add_uevent_var(env, "MODALIAS=vmbus:%s", alias_name);
+ return ret;
+ }
diff --git a/series.conf b/series.conf
index f7abf92c0a..a0a807a2b1 100644
--- a/series.conf
+++ b/series.conf
@@ -541,6 +541,7 @@
patches.suse/staging-hv-staging-next-20110829-0345-Staging-hv-mousevsc-Fix-checkpatch-errors-and-war.patch
patches.suse/staging-hv-staging-next-20110829-0346-Staging-hv-netvsc-return-negative-error-codes.patch
+ patches.suse/staging-hv-vmbus-modalias-show.patch
patches.suse/staging-hv-pata_piix-ignore-disks.patch
patches.fixes/parport-mutex