Subversion Repositories Kolibri OS

Rev

Rev 1430 | Rev 1628 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1430 Rev 1627
Line 347... Line 347...
347
struct resource
347
struct resource
348
{
348
{
349
         resource_size_t start;
349
         resource_size_t start;
350
         resource_size_t end;
350
         resource_size_t end;
351
//         const char *name;
351
         const char *name;
352
         unsigned long flags;
352
         unsigned long flags;
353
//         struct resource *parent, *sibling, *child;
353
         struct resource *parent, *sibling, *child;
354
};
354
};
Line -... Line 355...
-
 
355
 
-
 
356
 
-
 
357
/*
-
 
358
 *  For PCI devices, the region numbers are assigned this way:
-
 
359
 */
-
 
360
enum {
-
 
361
    /* #0-5: standard PCI resources */
-
 
362
    PCI_STD_RESOURCES,
-
 
363
    PCI_STD_RESOURCE_END = 5,
-
 
364
 
-
 
365
    /* #6: expansion ROM resource */
-
 
366
    PCI_ROM_RESOURCE,
-
 
367
 
-
 
368
    /* device specific resources */
-
 
369
#ifdef CONFIG_PCI_IOV
-
 
370
    PCI_IOV_RESOURCES,
-
 
371
    PCI_IOV_RESOURCE_END = PCI_IOV_RESOURCES + PCI_SRIOV_NUM_BARS - 1,
-
 
372
#endif
-
 
373
 
-
 
374
    /* resources assigned to buses behind the bridge */
-
 
375
#define PCI_BRIDGE_RESOURCE_NUM 4
-
 
376
 
-
 
377
    PCI_BRIDGE_RESOURCES,
-
 
378
    PCI_BRIDGE_RESOURCE_END = PCI_BRIDGE_RESOURCES +
-
 
379
                  PCI_BRIDGE_RESOURCE_NUM - 1,
-
 
380
 
-
 
381
    /* total resources associated with a PCI device */
-
 
382
    PCI_NUM_RESOURCES,
-
 
383
 
-
 
384
    /* preserve this for compatibility */
-
 
385
    DEVICE_COUNT_RESOURCE
-
 
386
};
-
 
387
 
355
 
388
 
356
/*
389
/*
357
 * IO resources have these defined flags.
390
 * IO resources have these defined flags.
358
 */
391
 */
Line 547... Line 580...
547
    struct list_head    link;
580
    struct list_head    link;
548
    struct pci_dev      pci_dev;
581
    struct pci_dev      pci_dev;
549
}pci_dev_t;
582
}pci_dev_t;
550
 
583
 
Line -... Line 584...
-
 
584
 
-
 
585
typedef unsigned short __bitwise pci_bus_flags_t;
-
 
586
enum pci_bus_flags {
-
 
587
    PCI_BUS_FLAGS_NO_MSI   = (__force pci_bus_flags_t) 1,
-
 
588
    PCI_BUS_FLAGS_NO_MMRBC = (__force pci_bus_flags_t) 2,
-
 
589
};
-
 
590
 
-
 
591
struct pci_sysdata
-
 
592
{
-
 
593
    int             domain;         /* PCI domain */
-
 
594
    int             node;           /* NUMA node */
-
 
595
#ifdef CONFIG_X86_64
-
 
596
    void            *iommu;         /* IOMMU private data */
-
 
597
#endif
-
 
598
};
-
 
599
 
-
 
600
struct pci_bus;
-
 
601
 
-
 
602
struct pci_ops
-
 
603
{
-
 
604
    int (*read)(struct pci_bus *bus, unsigned int devfn, int where, int size, u32 *val);
-
 
605
    int (*write)(struct pci_bus *bus, unsigned int devfn, int where, int size, u32 val);
-
 
606
};
-
 
607
 
-
 
608
 
-
 
609
struct pci_bus {
-
 
610
    struct list_head node;      /* node in list of buses */
-
 
611
    struct pci_bus  *parent;    /* parent bus this bridge is on */
-
 
612
    struct list_head children;  /* list of child buses */
-
 
613
    struct list_head devices;   /* list of devices on this bus */
-
 
614
    struct pci_dev  *self;      /* bridge device as seen by parent */
-
 
615
    struct list_head slots;     /* list of slots on this bus */
-
 
616
    struct resource *resource[PCI_BRIDGE_RESOURCE_NUM];
-
 
617
    struct list_head resources; /* address space routed to this bus */
-
 
618
 
-
 
619
    struct pci_ops  *ops;       /* configuration access functions */
-
 
620
    void        *sysdata;       /* hook for sys-specific extension */
-
 
621
 
-
 
622
    unsigned char   number;     /* bus number */
-
 
623
    unsigned char   primary;    /* number of primary bridge */
-
 
624
    unsigned char   secondary;  /* number of secondary bridge */
-
 
625
    unsigned char   subordinate;    /* max number of subordinate buses */
-
 
626
 
-
 
627
    char        name[48];
-
 
628
 
-
 
629
    unsigned short  bridge_ctl; /* manage NO_ISA/FBB/et al behaviors */
-
 
630
    pci_bus_flags_t bus_flags;  /* Inherited by child busses */
-
 
631
//    struct device       *bridge;
-
 
632
//    struct device       dev;
-
 
633
//    struct bin_attribute    *legacy_io; /* legacy I/O for this bus */
-
 
634
//    struct bin_attribute    *legacy_mem; /* legacy mem */
-
 
635
    unsigned int        is_added:1;
-
 
636
};
-
 
637
 
-
 
638
#define pci_bus_b(n)    list_entry(n, struct pci_bus, node)
-
 
639
#define to_pci_bus(n)   container_of(n, struct pci_bus, dev)
-
 
640
 
-
 
641
 
-
 
642
static inline int pci_domain_nr(struct pci_bus *bus)
-
 
643
{
-
 
644
    struct pci_sysdata *sd = bus->sysdata;
-
 
645
    return sd->domain;
-
 
646
}
-
 
647
 
-
 
648
 
551
int enum_pci_devices(void);
649
int enum_pci_devices(void);
Line 552... Line 650...
552
 
650
 
553
struct pci_device_id*
651
struct pci_device_id*
Line 554... Line 652...
554
find_pci_device(pci_dev_t* pdev, struct pci_device_id *idlist);
652
find_pci_device(pci_dev_t* pdev, struct pci_device_id *idlist);
Line 555... Line 653...
555
 
653
 
Line -... Line 654...
-
 
654
#define DMA_BIT_MASK(n) (((n) == 64) ? ~0ULL : ((1ULL<<(n))-1))
-
 
655
 
-
 
656
int pci_set_dma_mask(struct pci_dev *dev, u64 mask);
-
 
657
 
-
 
658
struct pci_bus * pci_create_bus(int bus, struct pci_ops *ops, void *sysdata);
Line 556... Line 659...
556
#define DMA_BIT_MASK(n) (((n) == 64) ? ~0ULL : ((1ULL<<(n))-1))
659
struct pci_bus * pci_find_bus(int domain, int busnr);
Line 557... Line 660...
557
 
660
struct pci_bus * pci_find_next_bus(const struct pci_bus *from);