Top | ![]() |
![]() |
![]() |
![]() |
The LdmModaliasPlugin extends the base LdmPlugin and adds modalias-based hardware detection to it. This allows us to perform LdmModalias based matching against any given hardware.
The most useful case for LdmModaliasPlugin is to dynamically construct
it at runtime using .modaliases
files. These files contain specially
formatted lines that can be parsed into a set of LdmModalias rules,
all of which can later be used to detect hardware in bulk.
The format of the file is very simple, space separated, with just 4 columns:
TYPE ALIAS PLUGIN PACKAGE
TYPE
is reserved and is currently always set to alias
.
MODALIAS
is the fnmatch
style string used to match against hardware.
PLUGIN
is the kernel driver that supports any hardware matching the “match” field
PACKAGE
is the name of the package or bundle providing the kernel driver
Example:
alias pci:v000014E4d*sv*sd*bc02sc80i* wl broadcom-sta
If a hardware device matching pci:v000014E4d*sv*sd*bc02sc80i
is discovered,
it requires wl.ko
to operate correctly (or to enhance it). The user can find
wl.ko
in the broadcom-sta
package.
LdmPlugin *
ldm_modalias_plugin_new (const gchar *name
);
Create a new LdmPlugin for modalias detection with the given name
LdmPlugin *
ldm_modalias_plugin_new_from_filename (const gchar *filename
);
Create a new LdmPlugin for modalias detection. The named file will be opened and the resulting plugin will be seeded from that file.
void ldm_modalias_plugin_add_modalias (LdmModaliasPlugin *driver
,LdmModalias *modalias
);
Add a new modalias object to the plugin table. This method will take a new reference to the modalias.