Rev 3747 | Rev 5270 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 3747 | Rev 5056 | ||
---|---|---|---|
Line 454... | Line 454... | ||
454 | pci_resource_start((dev), (bar))) ? 0 : \ |
454 | pci_resource_start((dev), (bar))) ? 0 : \ |
455 | \ |
455 | \ |
456 | (pci_resource_end((dev), (bar)) - \ |
456 | (pci_resource_end((dev), (bar)) - \ |
457 | pci_resource_start((dev), (bar)) + 1)) |
457 | pci_resource_start((dev), (bar)) + 1)) |
Line -... | Line 458... | ||
- | 458 | ||
Line 458... | Line 459... | ||
458 | 459 | #define PCI_REGION_FLAG_MASK 0x0fU /* These bits of resource flags tell us the PCI region flags */ |
|
459 | 460 | ||
460 | struct pci_bus { |
461 | struct pci_bus { |
461 | struct list_head node; /* node in list of buses */ |
462 | struct list_head node; /* node in list of buses */ |
Line 478... | Line 479... | ||
478 | unsigned char cur_bus_speed; /* enum pci_bus_speed */ |
479 | unsigned char cur_bus_speed; /* enum pci_bus_speed */ |
Line 479... | Line 480... | ||
479 | 480 | ||
Line 480... | Line 481... | ||
480 | char name[48]; |
481 | char name[48]; |
481 | 482 | ||
482 | unsigned short bridge_ctl; /* manage NO_ISA/FBB/et al behaviors */ |
483 | unsigned short bridge_ctl; /* manage NO_ISA/FBB/et al behaviors */ |
483 | pci_bus_flags_t bus_flags; /* Inherited by child busses */ |
484 | pci_bus_flags_t bus_flags; /* inherited by child buses */ |
484 | struct device *bridge; |
485 | struct device *bridge; |
485 | struct device dev; |
486 | struct device dev; |
486 | struct bin_attribute *legacy_io; /* legacy I/O for this bus */ |
487 | struct bin_attribute *legacy_io; /* legacy I/O for this bus */ |
Line 506... | Line 507... | ||
506 | 507 | ||
507 | #define pci_bus_b(n) list_entry(n, struct pci_bus, node) |
508 | #define pci_bus_b(n) list_entry(n, struct pci_bus, node) |
Line 508... | Line 509... | ||
508 | #define to_pci_bus(n) container_of(n, struct pci_bus, dev) |
509 | #define to_pci_bus(n) container_of(n, struct pci_bus, dev) |
509 | 510 | ||
510 | /* |
511 | /* |
- | 512 | * Returns true if the PCI bus is root (behind host-PCI bridge), |
|
- | 513 | * false otherwise |
|
- | 514 | * |
|
- | 515 | * Some code assumes that "bus->self == NULL" means that bus is a root bus. |
|
511 | * Returns true if the pci bus is root (behind host-pci bridge), |
516 | * This is incorrect because "virtual" buses added for SR-IOV (via |
512 | * false otherwise |
517 | * virtfn_add_bus()) have "bus->self == NULL" but are not root buses. |
513 | */ |
518 | */ |
514 | static inline bool pci_is_root_bus(struct pci_bus *pbus) |
519 | static inline bool pci_is_root_bus(struct pci_bus *pbus) |
515 | { |
520 | { |
Line 529... | Line 534... | ||
529 | #define PCIBIOS_DEVICE_NOT_FOUND 0x86 |
534 | #define PCIBIOS_DEVICE_NOT_FOUND 0x86 |
530 | #define PCIBIOS_BAD_REGISTER_NUMBER 0x87 |
535 | #define PCIBIOS_BAD_REGISTER_NUMBER 0x87 |
531 | #define PCIBIOS_SET_FAILED 0x88 |
536 | #define PCIBIOS_SET_FAILED 0x88 |
532 | #define PCIBIOS_BUFFER_TOO_SMALL 0x89 |
537 | #define PCIBIOS_BUFFER_TOO_SMALL 0x89 |
Line -... | Line 538... | ||
- | 538 | ||
- | 539 | /* |
|
- | 540 | * Translate above to generic errno for passing back through non-PCI code. |
|
- | 541 | */ |
|
- | 542 | static inline int pcibios_err_to_errno(int err) |
|
- | 543 | { |
|
- | 544 | if (err <= PCIBIOS_SUCCESSFUL) |
|
- | 545 | return err; /* Assume already errno */ |
|
- | 546 | ||
- | 547 | switch (err) { |
|
- | 548 | case PCIBIOS_FUNC_NOT_SUPPORTED: |
|
- | 549 | return -ENOENT; |
|
- | 550 | case PCIBIOS_BAD_VENDOR_ID: |
|
- | 551 | return -EINVAL; |
|
- | 552 | case PCIBIOS_DEVICE_NOT_FOUND: |
|
- | 553 | return -ENODEV; |
|
- | 554 | case PCIBIOS_BAD_REGISTER_NUMBER: |
|
- | 555 | return -EFAULT; |
|
- | 556 | case PCIBIOS_SET_FAILED: |
|
- | 557 | return -EIO; |
|
- | 558 | case PCIBIOS_BUFFER_TOO_SMALL: |
|
- | 559 | return -ENOSPC; |
|
- | 560 | } |
|
- | 561 | ||
- | 562 | return -ENOTTY; |
|
- | 563 | } |
|
533 | 564 | ||
Line 534... | Line 565... | ||
534 | /* Low-level architecture-dependent routines */ |
565 | /* Low-level architecture-dependent routines */ |
535 | 566 | ||
536 | struct pci_ops { |
567 | struct pci_ops { |
Line 584... | Line 615... | ||
584 | 615 | ||
585 | /** |
616 | /** |
586 | * pci_is_pcie - check if the PCI device is PCI Express capable |
617 | * pci_is_pcie - check if the PCI device is PCI Express capable |
587 | * @dev: PCI device |
618 | * @dev: PCI device |
588 | * |
619 | * |
589 | * Retrun true if the PCI device is PCI Express capable, false otherwise. |
620 | * Returns: true if the PCI device is PCI Express capable, false otherwise. |
590 | */ |
621 | */ |
591 | static inline bool pci_is_pcie(struct pci_dev *dev) |
622 | static inline bool pci_is_pcie(struct pci_dev *dev) |
592 | { |
623 | { |
593 | return !!pci_pcie_cap(dev); |
624 | return !!pci_pcie_cap(dev); |
Line 670... | Line 701... | ||
670 | 701 | ||
Line 671... | Line 702... | ||
671 | void __iomem *pci_map_rom(struct pci_dev *pdev, size_t *size); |
702 | void __iomem *pci_map_rom(struct pci_dev *pdev, size_t *size); |
Line -... | Line 703... | ||
- | 703 | ||
- | 704 | #define pci_name(x) "radeon" |
|
- | 705 | ||
- | 706 | static inline dma_addr_t pci_bus_address(struct pci_dev *pdev, int bar) |
|
- | 707 | { |
|
672 | 708 | return pdev->resource[bar].start; |