summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/Makefile.am2
-rw-r--r--src/common_device_name.c31
2 files changed, 29 insertions, 4 deletions
diff --git a/src/Makefile.am b/src/Makefile.am
index c6232d7..f815ee5 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -34,7 +34,7 @@ INCLUDES = -I$(top_srcdir)/include
libpciaccess_la_LIBADD = @PCIACCESS_LIBS@
-libpciaccess_la_LDFLAGS = -version-number 0:2:0 -no-undefined
+libpciaccess_la_LDFLAGS = -version-number 0:3:0 -no-undefined
libpciaccessincludedir = $(includedir)
libpciaccessinclude_HEADERS = \
diff --git a/src/common_device_name.c b/src/common_device_name.c
index 2a0d5bf..df2212e 100644
--- a/src/common_device_name.c
+++ b/src/common_device_name.c
@@ -335,10 +335,35 @@ find_vendor_name( const struct pci_id_match * m )
/**
* Get a name based on an arbitrary PCI search structure.
*/
-const char *
-pci_get_name( const struct pci_id_match * m )
+void
+pci_get_strings( const struct pci_id_match * m,
+ const char ** device_name,
+ const char ** vendor_name,
+ const char ** subdevice_name,
+ const char ** subvendor_name )
{
- return find_device_name( m );
+ struct pci_id_match temp;
+
+
+ temp = *m;
+ temp.subvendor_id = PCI_MATCH_ANY;
+ temp.subdevice_id = PCI_MATCH_ANY;
+
+ if ( device_name != NULL ) {
+ *device_name = find_device_name( & temp );
+ }
+
+ if ( vendor_name != NULL ) {
+ *vendor_name = find_vendor_name( & temp );
+ }
+
+ if ( subdevice_name != NULL ) {
+ *subdevice_name = find_device_name( m );
+ }
+
+ if ( subvendor_name != NULL ) {
+ *subvendor_name = find_vendor_name( m );
+ }
}