aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/mod
diff options
context:
space:
mode:
authorJens Taprogge <jens.taprogge@taprogge.org>2012-09-04 11:01:13 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-09-04 17:43:26 -0400
commit849e0ad257d259b8443c63d74e3bcc32ebf336af (patch)
tree905b37114e2df32fc1c99634188d40a4921796f5 /scripts/mod
parent1f43d7bfac880f63320c4dcbb8f864112946337f (diff)
Staging: ipack: implement ipack device table.
The modaliases look like ipack:fXvNdM, where X is the format version (8 bit) and N and M are the vendor and device ID represented as 32 bit hexadecimal numbers each. Using 32 bits allows us to define IPACK_ANY_ID as (~0) without interfering with the valid ids. The resulting modalias string for ipoctal.ko looks like this (once ipoctal provides a device table): alias: ipack:f01v000000F0d00000048* alias: ipack:f01v000000F0d0000002A* alias: ipack:f01v000000F0d00000022* (output from modinfo) Signed-off-by: Jens Taprogge <jens.taprogge@taprogge.org> Signed-off-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'scripts/mod')
-rw-r--r--scripts/mod/file2alias.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/scripts/mod/file2alias.c b/scripts/mod/file2alias.c
index 7ed6864ef65b..3c22bda8fdf3 100644
--- a/scripts/mod/file2alias.c
+++ b/scripts/mod/file2alias.c
@@ -966,6 +966,21 @@ static int do_isapnp_entry(const char *filename,
966} 966}
967ADD_TO_DEVTABLE("isapnp", struct isapnp_device_id, do_isapnp_entry); 967ADD_TO_DEVTABLE("isapnp", struct isapnp_device_id, do_isapnp_entry);
968 968
969/* Looks like: "ipack:fNvNdN". */
970static int do_ipack_entry(const char *filename,
971 struct ipack_device_id *id, char *alias)
972{
973 id->vendor = TO_NATIVE(id->vendor);
974 id->device = TO_NATIVE(id->device);
975 strcpy(alias, "ipack:");
976 ADD(alias, "f", id->format != IPACK_ANY_ID, id->format);
977 ADD(alias, "v", id->vendor != IPACK_ANY_ID, id->vendor);
978 ADD(alias, "d", id->device != IPACK_ANY_ID, id->device);
979 add_wildcard(alias);
980 return 1;
981}
982ADD_TO_DEVTABLE("ipack", struct ipack_device_id, do_ipack_entry);
983
969/* 984/*
970 * Append a match expression for a single masked hex digit. 985 * Append a match expression for a single masked hex digit.
971 * outp points to a pointer to the character at which to append. 986 * outp points to a pointer to the character at which to append.