Ignore:
Timestamp:
Mar 18, 2021, 8:57:36 PM (4 years ago)
Author:
David Azarewicz
Message:

Merge changes from Paul's uniaud32next branch.

Location:
GPL/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • GPL/trunk

  • GPL/trunk/include/linux/pci.h

    r604 r679  
    1616#define LINUX_PCI_H
    1717
     18#include <linux/mod_devicetable.h>
     19
    1820#include <linux/types.h>
    1921#include <linux/list.h>
     22#include <linux/kobject.h>
     23#include <linux/device.h>
     24#include <linux/pm.h>
     25#include <linux/io.h>
     26
    2027#pragma pack(1) //!!! by vladest
    2128/*
     
    302309#define pci_choose_state(pci,state)     ((state) ? PCI_D3hot : PCI_D0)
    303310
    304 typedef struct device {
    305     struct pci_dev *pci;  /* for PCI and PCI-SG types */
    306   struct device   * parent;
    307   struct bus_type * bus;    /* type of bus device is on */
    308   char  bus_id[BUS_ID_SIZE];  /* position on parent bus */
    309   void  (*release)(struct device * dev);
    310     unsigned int flags; /* GFP_XXX for continous and ISA types */
    311 #ifdef CONFIG_SBUS
    312     struct sbus_dev *sbus;  /* for SBUS type */
    313 #endif
    314   void *private_data;
    315   void *platform_data;
    316 
    317   struct device_driver *driver;
    318   struct pm_dev *pm_dev;
    319   char  bus_id[20];
    320 } device;
     311struct dev_pm_info2 {
     312        unsigned int            async_suspend:1;
     313        bool                    is_prepared:1;  /* Owned by the PM core */
     314        u32                     power_state;
     315        u8                      * saved_state;
     316        atomic_t                pm_users;
     317        struct device           * pm_parent;
     318        struct list_head        entry;
     319};
    321320
    322321/*
     
    334333  struct proc_dir_entry *procent; /* device entry in /proc/bus/pci */
    335334
    336         struct device   dev;
    337 
     335  struct device   dev;
     336        unsigned int    class;          /* 3 bytes: (base,sub,prog-if) */
     337  u8            revision;       /* PCI revision, low byte of class word */
    338338  unsigned int  devfn;    /* encoded device & function index */
    339339  unsigned short  vendor;
     
    341341  unsigned short  subsystem_vendor;
    342342  unsigned short  subsystem_device;
    343   unsigned int  _class;   /* 3 bytes: (base,sub,prog-if) */
    344343  u8    hdr_type; /* PCI header type (`multi' flag masked out) */
    345344  u8    rom_base_reg; /* Which config register controls the ROM */
     
    369368
    370369  void         *driver_data;
    371   unsigned long   dma_mask;
     370        u64             dma_mask;       /* Mask of the bits of bus address this
     371                                           device implements.  Normally this is
     372                                           0xffffffff.  You only need to change
     373                                           this if your device has broken DMA
     374                                           or supports 64-bit transfers.  */
     375  unsigned int  no_64bit_msi:1; /* device may only use 32-bit MSIs */
    372376
    373377  int (*prepare)(struct pci_dev *dev);
     
    378382//DAZ unsigned int apicirq;
    379383  unsigned long hAdapter;
    380   unsigned long hDevice;
     384//AT  unsigned long hDevice;
    381385  void *pcidriver;
    382386#endif
     
    579583        unsigned long driver_data;
    580584};
    581 #if 0
     585
    582586struct pci_driver {
    583         struct list_head node;
    584         char *name;
    585         const struct pci_device_id *id_table;
    586         int (*probe)(struct pci_dev *dev, const struct pci_device_id *id);
    587         void (*remove)(struct pci_dev *dev);
    588         void (*suspend)(struct pci_dev *dev, u32 state);
    589         void (*resume)(struct pci_dev *dev);
     587        struct list_head node;
     588        struct pci_dev *dev;
     589        char *name;
     590        const struct pci_device_id *id_table; /* NULL if wants all devices */
     591        int (*probe)(struct pci_dev *dev, const struct pci_device_id *id); /* New device inserted */
     592        void (*remove)(struct pci_dev *dev);  /* Device removed (NULL if not a hot-plug capable driver) */
     593        int (*suspend)(struct pci_dev *dev, u32 stgate);  /* Device suspended */
     594        int (*resume)(struct pci_dev *dev); /* Device woken up */
     595        void (*shutdown) (struct pci_dev *dev);
     596        struct device_driver    driver;
    590597};
    591 #else
    592 struct pci_driver {
    593   struct list_head node;
    594   struct pci_dev *dev;
    595   char *name;
    596   const struct pci_device_id *id_table; /* NULL if wants all devices */
    597   int (*probe)(struct pci_dev *dev, const struct pci_device_id *id); /* New device inserted */
    598   void (*remove)(struct pci_dev *dev);  /* Device removed (NULL if not a hot-plug capable driver) */
    599   int (*suspend)(struct pci_dev *dev, u32 stgate);  /* Device suspended */
    600   int (*resume)(struct pci_dev *dev); /* Device woken up */
    601 };
    602 #endif
    603598
    604599/*
     
    651646 *
    652647 */
    653 const struct pci_device_id *pci_match_device(const struct pci_device_id *ids, struct pci_dev *dev);
     648const struct pci_device_id *pci_match_id(const struct pci_device_id *ids, struct pci_dev *dev);
    654649unsigned long pci_get_size (struct pci_dev *dev, int n_base);
    655650
     
    686681#define pci_get_device  pci_find_device
    687682#define pci_dev_put(x)
     683
     684#define to_pci_dev(n)   container_of(n, struct pci_dev, dev)
    688685
    689686#pragma pack() //!!! by vladest
     
    728725  const struct pci_device_id _table[] __devinitdata
    729726
     727/**
     728 * module_pci_driver() - Helper macro for registering a PCI driver
     729 * @__pci_driver: pci_driver struct
     730 *
     731 * Helper macro for PCI drivers which do not do anything special in module
     732 * init/exit. This eliminates a lot of boilerplate. Each module may only
     733 * use this macro once, and calling it replaces module_init() and module_exit()
     734 */
     735#define module_pci_driver(__pci_driver) \
     736        module_driver(__pci_driver, pci_register_driver, \
     737                       pci_unregister_driver)
     738
     739static inline bool pci_dev_run_wake(struct pci_dev *dev) { return 0; }
     740
     741/* If you want to know what to call your pci_dev, ask this function.
     742 * Again, it's a wrapper around the generic device.
     743 */
     744static inline const char *pci_name(struct pci_dev *pdev)
     745{
     746        return dev_name(&pdev->dev);
     747}
     748
     749/**
     750 * PCI_DEVICE_SUB - macro used to describe a specific pci device with subsystem
     751 * @vend: the 16 bit PCI Vendor ID
     752 * @dev: the 16 bit PCI Device ID
     753 * @subvend: the 16 bit PCI Subvendor ID
     754 * @subdev: the 16 bit PCI Subdevice ID
     755 *
     756 * This macro is used to create a struct pci_device_id that matches a
     757 * specific device with subsystem information.
     758 */
     759#define PCI_DEVICE_SUB(vend, dev, subvend, subdev) \
     760        .vendor = (vend), .device = (dev), \
     761        .subvendor = (subvend), .subdevice = (subdev)
     762
     763int pci_status_get_and_clear_errors(struct pci_dev *pdev);
     764#define PCI_STATUS_ERROR_BITS (PCI_STATUS_DETECTED_PARITY  | \
     765                               PCI_STATUS_SIG_SYSTEM_ERROR | \
     766                               PCI_STATUS_REC_MASTER_ABORT | \
     767                               PCI_STATUS_REC_TARGET_ABORT | \
     768                               PCI_STATUS_SIG_TARGET_ABORT | \
     769                               PCI_STATUS_PARITY)
     770
    730771#endif /* LINUX_PCI_H */
Note: See TracChangeset for help on using the changeset viewer.