]> mj.ucw.cz Git - pciutils.git/blobdiff - lspci.h
TPH and LTR capability reporting
[pciutils.git] / lspci.h
diff --git a/lspci.h b/lspci.h
index c498b7c970e64e8eb409056112877f2b88445581..d0404923567d77f59774ffd0e9b13ee58337d709 100644 (file)
--- a/lspci.h
+++ b/lspci.h
@@ -1,7 +1,7 @@
 /*
  *     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.
  */
@@ -52,7 +52,11 @@ byte get_conf_byte(struct device *d, unsigned int pos);
 
 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 */