Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0 */
0002 #ifndef _VSEC_H
0003 #define _VSEC_H
0004 
0005 #include <linux/auxiliary_bus.h>
0006 #include <linux/bits.h>
0007 
0008 struct pci_dev;
0009 struct resource;
0010 
0011 enum intel_vsec_quirks {
0012     /* Watcher feature not supported */
0013     VSEC_QUIRK_NO_WATCHER   = BIT(0),
0014 
0015     /* Crashlog feature not supported */
0016     VSEC_QUIRK_NO_CRASHLOG  = BIT(1),
0017 
0018     /* Use shift instead of mask to read discovery table offset */
0019     VSEC_QUIRK_TABLE_SHIFT  = BIT(2),
0020 
0021     /* DVSEC not present (provided in driver data) */
0022     VSEC_QUIRK_NO_DVSEC = BIT(3),
0023 
0024     /* Platforms requiring quirk in the auxiliary driver */
0025     VSEC_QUIRK_EARLY_HW     = BIT(4),
0026 };
0027 
0028 /* Platform specific data */
0029 struct intel_vsec_platform_info {
0030     struct intel_vsec_header **capabilities;
0031     unsigned long quirks;
0032 };
0033 
0034 struct intel_vsec_device {
0035     struct auxiliary_device auxdev;
0036     struct pci_dev *pcidev;
0037     struct resource *resource;
0038     struct ida *ida;
0039     struct intel_vsec_platform_info *info;
0040     int num_resources;
0041 };
0042 
0043 static inline struct intel_vsec_device *dev_to_ivdev(struct device *dev)
0044 {
0045     return container_of(dev, struct intel_vsec_device, auxdev.dev);
0046 }
0047 
0048 static inline struct intel_vsec_device *auxdev_to_ivdev(struct auxiliary_device *auxdev)
0049 {
0050     return container_of(auxdev, struct intel_vsec_device, auxdev);
0051 }
0052 #endif