]> www.infradead.org Git - users/hch/configfs.git/commitdiff
platform/x86/intel/vsec: Move structures to header
authorDavid E. Box <david.e.box@linux.intel.com>
Wed, 29 Nov 2023 22:21:15 +0000 (14:21 -0800)
committerHans de Goede <hdegoede@redhat.com>
Mon, 4 Dec 2023 13:53:29 +0000 (14:53 +0100)
In preparation for exporting an API to register Intel Vendor Specific
Extended Capabilities (VSEC) from other drivers, move needed structures to
the header file.

Signed-off-by: David E. Box <david.e.box@linux.intel.com>
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Link: https://lore.kernel.org/r/20231129222132.2331261-4-david.e.box@linux.intel.com
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
drivers/platform/x86/intel/vsec.c
drivers/platform/x86/intel/vsec.h

index 25017227a0a6fe272ee80595e4cf4c82d13ad76b..4dc490fd4a5b5e50d3acaf72c33d585f68934e31 100644 (file)
 
 #include "vsec.h"
 
-/* Intel DVSEC offsets */
-#define INTEL_DVSEC_ENTRIES            0xA
-#define INTEL_DVSEC_SIZE               0xB
-#define INTEL_DVSEC_TABLE              0xC
-#define INTEL_DVSEC_TABLE_BAR(x)       ((x) & GENMASK(2, 0))
-#define INTEL_DVSEC_TABLE_OFFSET(x)    ((x) & GENMASK(31, 3))
-#define TABLE_OFFSET_SHIFT             3
 #define PMT_XA_START                   0
 #define PMT_XA_MAX                     INT_MAX
 #define PMT_XA_LIMIT                   XA_LIMIT(PMT_XA_START, PMT_XA_MAX)
@@ -39,34 +32,6 @@ static DEFINE_IDA(intel_vsec_ida);
 static DEFINE_IDA(intel_vsec_sdsi_ida);
 static DEFINE_XARRAY_ALLOC(auxdev_array);
 
-/**
- * struct intel_vsec_header - Common fields of Intel VSEC and DVSEC registers.
- * @rev:         Revision ID of the VSEC/DVSEC register space
- * @length:      Length of the VSEC/DVSEC register space
- * @id:          ID of the feature
- * @num_entries: Number of instances of the feature
- * @entry_size:  Size of the discovery table for each feature
- * @tbir:        BAR containing the discovery tables
- * @offset:      BAR offset of start of the first discovery table
- */
-struct intel_vsec_header {
-       u8      rev;
-       u16     length;
-       u16     id;
-       u8      num_entries;
-       u8      entry_size;
-       u8      tbir;
-       u32     offset;
-};
-
-enum intel_vsec_id {
-       VSEC_ID_TELEMETRY       = 2,
-       VSEC_ID_WATCHER         = 3,
-       VSEC_ID_CRASHLOG        = 4,
-       VSEC_ID_SDSI            = 65,
-       VSEC_ID_TPMI            = 66,
-};
-
 static const char *intel_vsec_name(enum intel_vsec_id id)
 {
        switch (id) {
index 0a6201b4a0e9064523ba9873cb04096da52223a8..c242c07ea69ce9cb002262f22647d352a7a5baec 100644 (file)
 #define VSEC_CAP_SDSI          BIT(3)
 #define VSEC_CAP_TPMI          BIT(4)
 
+/* Intel DVSEC offsets */
+#define INTEL_DVSEC_ENTRIES            0xA
+#define INTEL_DVSEC_SIZE               0xB
+#define INTEL_DVSEC_TABLE              0xC
+#define INTEL_DVSEC_TABLE_BAR(x)       ((x) & GENMASK(2, 0))
+#define INTEL_DVSEC_TABLE_OFFSET(x)    ((x) & GENMASK(31, 3))
+#define TABLE_OFFSET_SHIFT             3
+
 struct pci_dev;
 struct resource;
 
+enum intel_vsec_id {
+       VSEC_ID_TELEMETRY       = 2,
+       VSEC_ID_WATCHER         = 3,
+       VSEC_ID_CRASHLOG        = 4,
+       VSEC_ID_SDSI            = 65,
+       VSEC_ID_TPMI            = 66,
+};
+
+/**
+ * struct intel_vsec_header - Common fields of Intel VSEC and DVSEC registers.
+ * @rev:         Revision ID of the VSEC/DVSEC register space
+ * @length:      Length of the VSEC/DVSEC register space
+ * @id:          ID of the feature
+ * @num_entries: Number of instances of the feature
+ * @entry_size:  Size of the discovery table for each feature
+ * @tbir:        BAR containing the discovery tables
+ * @offset:      BAR offset of start of the first discovery table
+ */
+struct intel_vsec_header {
+       u8      rev;
+       u16     length;
+       u16     id;
+       u8      num_entries;
+       u8      entry_size;
+       u8      tbir;
+       u32     offset;
+};
+
 enum intel_vsec_quirks {
        /* Watcher feature not supported */
        VSEC_QUIRK_NO_WATCHER   = BIT(0),