Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 267916
b: refs/heads/master
c: d2ee52a
h: refs/heads/master
v: v3
  • Loading branch information
K. Y. Srinivasan authored and Greg Kroah-Hartman committed Aug 25, 2011
1 parent 5ca1955 commit 2251b55
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: a91befc116f424883602fb7b57b63b5fcfe18719
refs/heads/master: d2ee52aaf30072e4a761e785c752e305ce10152f
25 changes: 25 additions & 0 deletions trunk/scripts/mod/file2alias.c
Original file line number Diff line number Diff line change
Expand Up @@ -735,6 +735,27 @@ static int do_virtio_entry(const char *filename, struct virtio_device_id *id,
return 1;
}

/*
* Looks like: vmbus:guid
* Each byte of the guid will be represented by two hex characters
* in the name.
*/

static int do_vmbus_entry(const char *filename, struct hv_vmbus_device_id *id,
char *alias)
{
int i;
char guid_name[((sizeof(struct hv_vmbus_device_id) + 1)) * 2];

for (i = 0; i < (sizeof(struct hv_vmbus_device_id) * 2); i += 2)
sprintf(&guid_name[i], "%02x", id->guid[i/2]);

strcpy(alias, "vmbus:");
strcat(alias, guid_name);

return 1;
}

/* Looks like: i2c:S */
static int do_i2c_entry(const char *filename, struct i2c_device_id *id,
char *alias)
Expand Down Expand Up @@ -994,6 +1015,10 @@ void handle_moddevtable(struct module *mod, struct elf_info *info,
do_table(symval, sym->st_size,
sizeof(struct virtio_device_id), "virtio",
do_virtio_entry, mod);
else if (sym_is(symname, "__mod_vmbus_device_table"))
do_table(symval, sym->st_size,
sizeof(struct hv_vmbus_device_id), "vmbus",
do_vmbus_entry, mod);
else if (sym_is(symname, "__mod_i2c_device_table"))
do_table(symval, sym->st_size,
sizeof(struct i2c_device_id), "i2c",
Expand Down

0 comments on commit 2251b55

Please sign in to comment.