Setpci:
- auto-width
-- man page
-- update library ABI
- extend the register table
Capabilities with partial decoding:
}
int
-pci_fill_info(struct pci_dev *d, int flags)
+pci_fill_info_v31(struct pci_dev *d, int flags)
{
if (flags & PCI_FILL_RESCAN)
{
return d->known_fields;
}
+/* In version 3.1, pci_fill_info got new flags => versioned alias */
+STATIC_ALIAS(int pci_fill_info(struct pci_dev *d, int flags), pci_fill_info_v31(d,flags));
+DEFINE_ALIAS(int pci_fill_info_v30(struct pci_dev *d, int flags), pci_fill_info_v31);
+SYMBOL_VERSION(pci_fill_info_v30, pci_fill_info@LIBPCI_3.0);
+SYMBOL_VERSION(pci_fill_info_v31, pci_fill_info@@LIBPCI_3.1);
+
void
pci_setup_cache(struct pci_dev *d, byte *cache, int len)
{
{
struct pci_cap *c;
- pci_fill_info(d, ((type == PCI_CAP_NORMAL) ? PCI_FILL_CAPS : PCI_FILL_EXT_CAPS));
+ pci_fill_info_v31(d, ((type == PCI_CAP_NORMAL) ? PCI_FILL_CAPS : PCI_FILL_EXT_CAPS));
for (c=d->first_cap; c; c=c->next)
if (c->type == type && c->id == id)
return c;
return 0;
if (f->device >= 0 || f->vendor >= 0)
{
- pci_fill_info(d, PCI_FILL_IDENT);
+ pci_fill_info_v31(d, PCI_FILL_IDENT);
if ((f->device >= 0 && f->device != d->device_id) ||
(f->vendor >= 0 && f->vendor != d->vendor_id))
return 0;
#ifdef PCI_SHARED_LIB
#define PCI_ABI __attribute__((visibility("default")))
+#define STATIC_ALIAS(_decl, _for)
+#define DEFINE_ALIAS(_decl, _for) extern _decl __attribute__((alias(#_for)))
+#define SYMBOL_VERSION(_int, _ext) asm(".symver " #_int "," #_ext)
+#else
+#define STATIC_ALIAS(_decl, _for) _decl { return _for; }
+#define DEFINE_ALIAS(_decl, _for)
+#define SYMBOL_VERSION(_int, _ext)
#endif
#include "pci.h"
struct pci_dev *pci_alloc_dev(struct pci_access *);
int pci_link_dev(struct pci_access *, struct pci_dev *);
+int pci_fill_info_v30(struct pci_dev *, int flags) PCI_ABI;
+int pci_fill_info_v31(struct pci_dev *, int flags) PCI_ABI;
+
/* params.c */
void pci_define_param(struct pci_access *acc, char *param, char *val, char *help);
int pci_set_param_internal(struct pci_access *acc, char *param, char *val, int copy);
*/
LIBPCI_3.0 {
- global: pci_*;
+ global:
+ pci_alloc;
+ pci_cleanup;
+ pci_fill_info;
+ pci_filter_init;
+ pci_filter_match;
+ pci_filter_parse_id;
+ pci_filter_parse_slot;
+ pci_free_dev;
+ pci_free_name_list;
+ pci_get_dev;
+ pci_get_method_name;
+ pci_get_param;
+ pci_id_cache_flush;
+ pci_init;
+ pci_load_name_list;
+ pci_lookup_method;
+ pci_lookup_name;
+ pci_read_block;
+ pci_read_byte;
+ pci_read_long;
+ pci_read_word;
+ pci_scan_bus;
+ pci_set_name_list_path;
+ pci_set_param;
+ pci_setup_cache;
+ pci_walk_params;
+ pci_write_block;
+ pci_write_byte;
+ pci_write_long;
+ pci_write_word;
local: *;
};
+
+LIBPCI_3.1 {
+ global:
+ pci_fill_info;
+ pci_find_cap;
+};
#include "header.h"
#include "types.h"
-#define PCI_LIB_VERSION 0x030000
+#define PCI_LIB_VERSION 0x030100
#ifndef PCI_ABI
#define PCI_ABI
pciaddr_t size[6]; /* Region sizes */
pciaddr_t rom_base_addr; /* Expansion ROM base address */
pciaddr_t rom_size; /* Expansion ROM size */
+ struct pci_cap *first_cap; /* List of capabilities */
/* Fields used internally: */
struct pci_access *access;
int cache_len;
int hdrtype; /* Cached low 7 bits of header type, -1 if unknown */
void *aux; /* Auxillary data */
-
- /* Another field set by pci_fill_info() */
- struct pci_cap *first_cap; /* List of capabilities */
};
#define PCI_ADDR_IO_MASK (~(pciaddr_t) 0x3)