aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/mod/file2alias.c
diff options
context:
space:
mode:
authorK. Y. Srinivasan <kys@microsoft.com>2011-08-25 12:48:30 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2011-08-25 13:42:12 -0400
commitd2ee52aaf30072e4a761e785c752e305ce10152f (patch)
tree3cde835c61ad65015664e52ac580ea8f32472c8e /scripts/mod/file2alias.c
parenta91befc116f424883602fb7b57b63b5fcfe18719 (diff)
Staging: hv: Add code to parse struct hv_vmbus_device_id table
Add code to parse struct hv_vmbus_device_id table. Signed-off-by: K. Y. Srinivasan <kys@microsoft.com> Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'scripts/mod/file2alias.c')
-rw-r--r--scripts/mod/file2alias.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/scripts/mod/file2alias.c b/scripts/mod/file2alias.c
index e26e2fb462d4..b74d21ab91f7 100644
--- a/scripts/mod/file2alias.c
+++ b/scripts/mod/file2alias.c
@@ -735,6 +735,27 @@ static int do_virtio_entry(const char *filename, struct virtio_device_id *id,
735 return 1; 735 return 1;
736} 736}
737 737
738/*
739 * Looks like: vmbus:guid
740 * Each byte of the guid will be represented by two hex characters
741 * in the name.
742 */
743
744static int do_vmbus_entry(const char *filename, struct hv_vmbus_device_id *id,
745 char *alias)
746{
747 int i;
748 char guid_name[((sizeof(struct hv_vmbus_device_id) + 1)) * 2];
749
750 for (i = 0; i < (sizeof(struct hv_vmbus_device_id) * 2); i += 2)
751 sprintf(&guid_name[i], "%02x", id->guid[i/2]);
752
753 strcpy(alias, "vmbus:");
754 strcat(alias, guid_name);
755
756 return 1;
757}
758
738/* Looks like: i2c:S */ 759/* Looks like: i2c:S */
739static int do_i2c_entry(const char *filename, struct i2c_device_id *id, 760static int do_i2c_entry(const char *filename, struct i2c_device_id *id,
740 char *alias) 761 char *alias)
@@ -994,6 +1015,10 @@ void handle_moddevtable(struct module *mod, struct elf_info *info,
994 do_table(symval, sym->st_size, 1015 do_table(symval, sym->st_size,
995 sizeof(struct virtio_device_id), "virtio", 1016 sizeof(struct virtio_device_id), "virtio",
996 do_virtio_entry, mod); 1017 do_virtio_entry, mod);
1018 else if (sym_is(symname, "__mod_vmbus_device_table"))
1019 do_table(symval, sym->st_size,
1020 sizeof(struct hv_vmbus_device_id), "vmbus",
1021 do_vmbus_entry, mod);
997 else if (sym_is(symname, "__mod_i2c_device_table")) 1022 else if (sym_is(symname, "__mod_i2c_device_table"))
998 do_table(symval, sym->st_size, 1023 do_table(symval, sym->st_size,
999 sizeof(struct i2c_device_id), "i2c", 1024 sizeof(struct i2c_device_id), "i2c",