/*
* The PCI Utilities -- List All PCI Devices
*
- * Copyright (c) 1997--2008 Martin Mares <mj@ucw.cz>
+ * Copyright (c) 1997--2010 Martin Mares <mj@ucw.cz>
*
* Can be freely distributed and used under the terms of the GNU GPL.
*/
void get_subid(struct device *d, word *subvp, word *subdp);
+/* Useful macros for decoding of bits and bit fields */
+
#define FLAG(x,y) ((x & y) ? '+' : '-')
+#define BITS(x,at,width) (((x) >> (at)) & ((1 << (width)) - 1))
+#define TABLE(tab,x,buf) ((x) < sizeof(tab)/sizeof((tab)[0]) ? (tab)[x] : (sprintf((buf), "??%d", (x)), (buf)))
/* ls-vpd.c */