diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/asm-generic/dma-coherent.h | 13 | ||||
-rw-r--r-- | include/linux/dma-mapping.h | 13 | ||||
-rw-r--r-- | include/linux/pci.h | 40 | ||||
-rw-r--r-- | include/linux/pci_ids.h | 3 | ||||
-rw-r--r-- | include/linux/types.h | 1 |
5 files changed, 43 insertions, 27 deletions
diff --git a/include/asm-generic/dma-coherent.h b/include/asm-generic/dma-coherent.h index 2be8a2dbc868..0297e5875798 100644 --- a/include/asm-generic/dma-coherent.h +++ b/include/asm-generic/dma-coherent.h | |||
@@ -16,16 +16,13 @@ int dma_mmap_from_coherent(struct device *dev, struct vm_area_struct *vma, | |||
16 | * Standard interface | 16 | * Standard interface |
17 | */ | 17 | */ |
18 | #define ARCH_HAS_DMA_DECLARE_COHERENT_MEMORY | 18 | #define ARCH_HAS_DMA_DECLARE_COHERENT_MEMORY |
19 | extern int | 19 | int dma_declare_coherent_memory(struct device *dev, phys_addr_t phys_addr, |
20 | dma_declare_coherent_memory(struct device *dev, dma_addr_t bus_addr, | 20 | dma_addr_t device_addr, size_t size, int flags); |
21 | dma_addr_t device_addr, size_t size, int flags); | ||
22 | 21 | ||
23 | extern void | 22 | void dma_release_declared_memory(struct device *dev); |
24 | dma_release_declared_memory(struct device *dev); | ||
25 | 23 | ||
26 | extern void * | 24 | void *dma_mark_declared_memory_occupied(struct device *dev, |
27 | dma_mark_declared_memory_occupied(struct device *dev, | 25 | dma_addr_t device_addr, size_t size); |
28 | dma_addr_t device_addr, size_t size); | ||
29 | #else | 26 | #else |
30 | #define dma_alloc_from_coherent(dev, size, handle, ret) (0) | 27 | #define dma_alloc_from_coherent(dev, size, handle, ret) (0) |
31 | #define dma_release_from_coherent(dev, order, vaddr) (0) | 28 | #define dma_release_from_coherent(dev, order, vaddr) (0) |
diff --git a/include/linux/dma-mapping.h b/include/linux/dma-mapping.h index fd4aee29ad10..0c3eab1e39ac 100644 --- a/include/linux/dma-mapping.h +++ b/include/linux/dma-mapping.h | |||
@@ -8,6 +8,12 @@ | |||
8 | #include <linux/dma-direction.h> | 8 | #include <linux/dma-direction.h> |
9 | #include <linux/scatterlist.h> | 9 | #include <linux/scatterlist.h> |
10 | 10 | ||
11 | /* | ||
12 | * A dma_addr_t can hold any valid DMA or bus address for the platform. | ||
13 | * It can be given to a device to use as a DMA source or target. A CPU cannot | ||
14 | * reference a dma_addr_t directly because there may be translation between | ||
15 | * its physical address space and the bus address space. | ||
16 | */ | ||
11 | struct dma_map_ops { | 17 | struct dma_map_ops { |
12 | void* (*alloc)(struct device *dev, size_t size, | 18 | void* (*alloc)(struct device *dev, size_t size, |
13 | dma_addr_t *dma_handle, gfp_t gfp, | 19 | dma_addr_t *dma_handle, gfp_t gfp, |
@@ -186,7 +192,7 @@ static inline int dma_get_cache_alignment(void) | |||
186 | 192 | ||
187 | #ifndef ARCH_HAS_DMA_DECLARE_COHERENT_MEMORY | 193 | #ifndef ARCH_HAS_DMA_DECLARE_COHERENT_MEMORY |
188 | static inline int | 194 | static inline int |
189 | dma_declare_coherent_memory(struct device *dev, dma_addr_t bus_addr, | 195 | dma_declare_coherent_memory(struct device *dev, phys_addr_t phys_addr, |
190 | dma_addr_t device_addr, size_t size, int flags) | 196 | dma_addr_t device_addr, size_t size, int flags) |
191 | { | 197 | { |
192 | return 0; | 198 | return 0; |
@@ -217,13 +223,14 @@ extern void *dmam_alloc_noncoherent(struct device *dev, size_t size, | |||
217 | extern void dmam_free_noncoherent(struct device *dev, size_t size, void *vaddr, | 223 | extern void dmam_free_noncoherent(struct device *dev, size_t size, void *vaddr, |
218 | dma_addr_t dma_handle); | 224 | dma_addr_t dma_handle); |
219 | #ifdef ARCH_HAS_DMA_DECLARE_COHERENT_MEMORY | 225 | #ifdef ARCH_HAS_DMA_DECLARE_COHERENT_MEMORY |
220 | extern int dmam_declare_coherent_memory(struct device *dev, dma_addr_t bus_addr, | 226 | extern int dmam_declare_coherent_memory(struct device *dev, |
227 | phys_addr_t phys_addr, | ||
221 | dma_addr_t device_addr, size_t size, | 228 | dma_addr_t device_addr, size_t size, |
222 | int flags); | 229 | int flags); |
223 | extern void dmam_release_declared_memory(struct device *dev); | 230 | extern void dmam_release_declared_memory(struct device *dev); |
224 | #else /* ARCH_HAS_DMA_DECLARE_COHERENT_MEMORY */ | 231 | #else /* ARCH_HAS_DMA_DECLARE_COHERENT_MEMORY */ |
225 | static inline int dmam_declare_coherent_memory(struct device *dev, | 232 | static inline int dmam_declare_coherent_memory(struct device *dev, |
226 | dma_addr_t bus_addr, dma_addr_t device_addr, | 233 | phys_addr_t phys_addr, dma_addr_t device_addr, |
227 | size_t size, gfp_t gfp) | 234 | size_t size, gfp_t gfp) |
228 | { | 235 | { |
229 | return 0; | 236 | return 0; |
diff --git a/include/linux/pci.h b/include/linux/pci.h index aab57b4abe7f..71d9673c1b2c 100644 --- a/include/linux/pci.h +++ b/include/linux/pci.h | |||
@@ -365,6 +365,7 @@ struct pci_dev { | |||
365 | #endif | 365 | #endif |
366 | phys_addr_t rom; /* Physical address of ROM if it's not from the BAR */ | 366 | phys_addr_t rom; /* Physical address of ROM if it's not from the BAR */ |
367 | size_t romlen; /* Length of ROM if it's not from the BAR */ | 367 | size_t romlen; /* Length of ROM if it's not from the BAR */ |
368 | char *driver_override; /* Driver name to force a match */ | ||
368 | }; | 369 | }; |
369 | 370 | ||
370 | static inline struct pci_dev *pci_physfn(struct pci_dev *dev) | 371 | static inline struct pci_dev *pci_physfn(struct pci_dev *dev) |
@@ -477,6 +478,19 @@ static inline bool pci_is_root_bus(struct pci_bus *pbus) | |||
477 | return !(pbus->parent); | 478 | return !(pbus->parent); |
478 | } | 479 | } |
479 | 480 | ||
481 | /** | ||
482 | * pci_is_bridge - check if the PCI device is a bridge | ||
483 | * @dev: PCI device | ||
484 | * | ||
485 | * Return true if the PCI device is bridge whether it has subordinate | ||
486 | * or not. | ||
487 | */ | ||
488 | static inline bool pci_is_bridge(struct pci_dev *dev) | ||
489 | { | ||
490 | return dev->hdr_type == PCI_HEADER_TYPE_BRIDGE || | ||
491 | dev->hdr_type == PCI_HEADER_TYPE_CARDBUS; | ||
492 | } | ||
493 | |||
480 | static inline struct pci_dev *pci_upstream_bridge(struct pci_dev *dev) | 494 | static inline struct pci_dev *pci_upstream_bridge(struct pci_dev *dev) |
481 | { | 495 | { |
482 | dev = pci_physfn(dev); | 496 | dev = pci_physfn(dev); |
@@ -518,7 +532,7 @@ static inline int pcibios_err_to_errno(int err) | |||
518 | case PCIBIOS_FUNC_NOT_SUPPORTED: | 532 | case PCIBIOS_FUNC_NOT_SUPPORTED: |
519 | return -ENOENT; | 533 | return -ENOENT; |
520 | case PCIBIOS_BAD_VENDOR_ID: | 534 | case PCIBIOS_BAD_VENDOR_ID: |
521 | return -EINVAL; | 535 | return -ENOTTY; |
522 | case PCIBIOS_DEVICE_NOT_FOUND: | 536 | case PCIBIOS_DEVICE_NOT_FOUND: |
523 | return -ENODEV; | 537 | return -ENODEV; |
524 | case PCIBIOS_BAD_REGISTER_NUMBER: | 538 | case PCIBIOS_BAD_REGISTER_NUMBER: |
@@ -529,7 +543,7 @@ static inline int pcibios_err_to_errno(int err) | |||
529 | return -ENOSPC; | 543 | return -ENOSPC; |
530 | } | 544 | } |
531 | 545 | ||
532 | return -ENOTTY; | 546 | return -ERANGE; |
533 | } | 547 | } |
534 | 548 | ||
535 | /* Low-level architecture-dependent routines */ | 549 | /* Low-level architecture-dependent routines */ |
@@ -603,6 +617,9 @@ struct pci_error_handlers { | |||
603 | /* PCI slot has been reset */ | 617 | /* PCI slot has been reset */ |
604 | pci_ers_result_t (*slot_reset)(struct pci_dev *dev); | 618 | pci_ers_result_t (*slot_reset)(struct pci_dev *dev); |
605 | 619 | ||
620 | /* PCI function reset prepare or completed */ | ||
621 | void (*reset_notify)(struct pci_dev *dev, bool prepare); | ||
622 | |||
606 | /* Device driver may resume normal operations */ | 623 | /* Device driver may resume normal operations */ |
607 | void (*resume)(struct pci_dev *dev); | 624 | void (*resume)(struct pci_dev *dev); |
608 | }; | 625 | }; |
@@ -680,8 +697,8 @@ struct pci_driver { | |||
680 | 697 | ||
681 | /** | 698 | /** |
682 | * PCI_VDEVICE - macro used to describe a specific pci device in short form | 699 | * PCI_VDEVICE - macro used to describe a specific pci device in short form |
683 | * @vendor: the vendor name | 700 | * @vend: the vendor name |
684 | * @device: the 16 bit PCI Device ID | 701 | * @dev: the 16 bit PCI Device ID |
685 | * | 702 | * |
686 | * This macro is used to create a struct pci_device_id that matches a | 703 | * This macro is used to create a struct pci_device_id that matches a |
687 | * specific PCI device. The subvendor, and subdevice fields will be set | 704 | * specific PCI device. The subvendor, and subdevice fields will be set |
@@ -689,9 +706,9 @@ struct pci_driver { | |||
689 | * private data. | 706 | * private data. |
690 | */ | 707 | */ |
691 | 708 | ||
692 | #define PCI_VDEVICE(vendor, device) \ | 709 | #define PCI_VDEVICE(vend, dev) \ |
693 | PCI_VENDOR_ID_##vendor, (device), \ | 710 | .vendor = PCI_VENDOR_ID_##vend, .device = (dev), \ |
694 | PCI_ANY_ID, PCI_ANY_ID, 0, 0 | 711 | .subvendor = PCI_ANY_ID, .subdevice = PCI_ANY_ID, 0, 0 |
695 | 712 | ||
696 | /* these external functions are only available when PCI support is enabled */ | 713 | /* these external functions are only available when PCI support is enabled */ |
697 | #ifdef CONFIG_PCI | 714 | #ifdef CONFIG_PCI |
@@ -764,7 +781,7 @@ int pci_scan_slot(struct pci_bus *bus, int devfn); | |||
764 | struct pci_dev *pci_scan_single_device(struct pci_bus *bus, int devfn); | 781 | struct pci_dev *pci_scan_single_device(struct pci_bus *bus, int devfn); |
765 | void pci_device_add(struct pci_dev *dev, struct pci_bus *bus); | 782 | void pci_device_add(struct pci_dev *dev, struct pci_bus *bus); |
766 | unsigned int pci_scan_child_bus(struct pci_bus *bus); | 783 | unsigned int pci_scan_child_bus(struct pci_bus *bus); |
767 | int __must_check pci_bus_add_device(struct pci_dev *dev); | 784 | void pci_bus_add_device(struct pci_dev *dev); |
768 | void pci_read_bridge_bases(struct pci_bus *child); | 785 | void pci_read_bridge_bases(struct pci_bus *child); |
769 | struct resource *pci_find_parent_resource(const struct pci_dev *dev, | 786 | struct resource *pci_find_parent_resource(const struct pci_dev *dev, |
770 | struct resource *res); | 787 | struct resource *res); |
@@ -1158,7 +1175,6 @@ struct msix_entry { | |||
1158 | 1175 | ||
1159 | #ifdef CONFIG_PCI_MSI | 1176 | #ifdef CONFIG_PCI_MSI |
1160 | int pci_msi_vec_count(struct pci_dev *dev); | 1177 | int pci_msi_vec_count(struct pci_dev *dev); |
1161 | int pci_enable_msi_block(struct pci_dev *dev, int nvec); | ||
1162 | void pci_msi_shutdown(struct pci_dev *dev); | 1178 | void pci_msi_shutdown(struct pci_dev *dev); |
1163 | void pci_disable_msi(struct pci_dev *dev); | 1179 | void pci_disable_msi(struct pci_dev *dev); |
1164 | int pci_msix_vec_count(struct pci_dev *dev); | 1180 | int pci_msix_vec_count(struct pci_dev *dev); |
@@ -1188,8 +1204,6 @@ static inline int pci_enable_msix_exact(struct pci_dev *dev, | |||
1188 | } | 1204 | } |
1189 | #else | 1205 | #else |
1190 | static inline int pci_msi_vec_count(struct pci_dev *dev) { return -ENOSYS; } | 1206 | static inline int pci_msi_vec_count(struct pci_dev *dev) { return -ENOSYS; } |
1191 | static inline int pci_enable_msi_block(struct pci_dev *dev, int nvec) | ||
1192 | { return -ENOSYS; } | ||
1193 | static inline void pci_msi_shutdown(struct pci_dev *dev) { } | 1207 | static inline void pci_msi_shutdown(struct pci_dev *dev) { } |
1194 | static inline void pci_disable_msi(struct pci_dev *dev) { } | 1208 | static inline void pci_disable_msi(struct pci_dev *dev) { } |
1195 | static inline int pci_msix_vec_count(struct pci_dev *dev) { return -ENOSYS; } | 1209 | static inline int pci_msix_vec_count(struct pci_dev *dev) { return -ENOSYS; } |
@@ -1244,7 +1258,7 @@ static inline void pcie_set_ecrc_checking(struct pci_dev *dev) { } | |||
1244 | static inline void pcie_ecrc_get_policy(char *str) { } | 1258 | static inline void pcie_ecrc_get_policy(char *str) { } |
1245 | #endif | 1259 | #endif |
1246 | 1260 | ||
1247 | #define pci_enable_msi(pdev) pci_enable_msi_block(pdev, 1) | 1261 | #define pci_enable_msi(pdev) pci_enable_msi_exact(pdev, 1) |
1248 | 1262 | ||
1249 | #ifdef CONFIG_HT_IRQ | 1263 | #ifdef CONFIG_HT_IRQ |
1250 | /* The functions a driver should call */ | 1264 | /* The functions a driver should call */ |
@@ -1572,13 +1586,13 @@ extern unsigned long pci_hotplug_io_size; | |||
1572 | extern unsigned long pci_hotplug_mem_size; | 1586 | extern unsigned long pci_hotplug_mem_size; |
1573 | 1587 | ||
1574 | /* Architecture-specific versions may override these (weak) */ | 1588 | /* Architecture-specific versions may override these (weak) */ |
1575 | int pcibios_add_platform_entries(struct pci_dev *dev); | ||
1576 | void pcibios_disable_device(struct pci_dev *dev); | 1589 | void pcibios_disable_device(struct pci_dev *dev); |
1577 | void pcibios_set_master(struct pci_dev *dev); | 1590 | void pcibios_set_master(struct pci_dev *dev); |
1578 | int pcibios_set_pcie_reset_state(struct pci_dev *dev, | 1591 | int pcibios_set_pcie_reset_state(struct pci_dev *dev, |
1579 | enum pcie_reset_state state); | 1592 | enum pcie_reset_state state); |
1580 | int pcibios_add_device(struct pci_dev *dev); | 1593 | int pcibios_add_device(struct pci_dev *dev); |
1581 | void pcibios_release_device(struct pci_dev *dev); | 1594 | void pcibios_release_device(struct pci_dev *dev); |
1595 | void pcibios_penalize_isa_irq(int irq, int active); | ||
1582 | 1596 | ||
1583 | #ifdef CONFIG_HIBERNATE_CALLBACKS | 1597 | #ifdef CONFIG_HIBERNATE_CALLBACKS |
1584 | extern struct dev_pm_ops pcibios_pm_ops; | 1598 | extern struct dev_pm_ops pcibios_pm_ops; |
diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h index d4de24b4d4c6..7fa31731c854 100644 --- a/include/linux/pci_ids.h +++ b/include/linux/pci_ids.h | |||
@@ -1631,8 +1631,6 @@ | |||
1631 | #define PCI_DEVICE_ID_ATT_VENUS_MODEM 0x480 | 1631 | #define PCI_DEVICE_ID_ATT_VENUS_MODEM 0x480 |
1632 | 1632 | ||
1633 | #define PCI_VENDOR_ID_SPECIALIX 0x11cb | 1633 | #define PCI_VENDOR_ID_SPECIALIX 0x11cb |
1634 | #define PCI_DEVICE_ID_SPECIALIX_IO8 0x2000 | ||
1635 | #define PCI_DEVICE_ID_SPECIALIX_RIO 0x8000 | ||
1636 | #define PCI_SUBDEVICE_ID_SPECIALIX_SPEED4 0xa004 | 1634 | #define PCI_SUBDEVICE_ID_SPECIALIX_SPEED4 0xa004 |
1637 | 1635 | ||
1638 | #define PCI_VENDOR_ID_ANALOG_DEVICES 0x11d4 | 1636 | #define PCI_VENDOR_ID_ANALOG_DEVICES 0x11d4 |
@@ -2874,7 +2872,6 @@ | |||
2874 | #define PCI_DEVICE_ID_SCALEMP_VSMP_CTL 0x1010 | 2872 | #define PCI_DEVICE_ID_SCALEMP_VSMP_CTL 0x1010 |
2875 | 2873 | ||
2876 | #define PCI_VENDOR_ID_COMPUTONE 0x8e0e | 2874 | #define PCI_VENDOR_ID_COMPUTONE 0x8e0e |
2877 | #define PCI_DEVICE_ID_COMPUTONE_IP2EX 0x0291 | ||
2878 | #define PCI_DEVICE_ID_COMPUTONE_PG 0x0302 | 2875 | #define PCI_DEVICE_ID_COMPUTONE_PG 0x0302 |
2879 | #define PCI_SUBVENDOR_ID_COMPUTONE 0x8e0e | 2876 | #define PCI_SUBVENDOR_ID_COMPUTONE 0x8e0e |
2880 | #define PCI_SUBDEVICE_ID_COMPUTONE_PG4 0x0001 | 2877 | #define PCI_SUBDEVICE_ID_COMPUTONE_PG4 0x0001 |
diff --git a/include/linux/types.h b/include/linux/types.h index 4d118ba11349..a0bb7048687f 100644 --- a/include/linux/types.h +++ b/include/linux/types.h | |||
@@ -142,6 +142,7 @@ typedef unsigned long blkcnt_t; | |||
142 | #define pgoff_t unsigned long | 142 | #define pgoff_t unsigned long |
143 | #endif | 143 | #endif |
144 | 144 | ||
145 | /* A dma_addr_t can hold any valid DMA or bus address for the platform */ | ||
145 | #ifdef CONFIG_ARCH_DMA_ADDR_T_64BIT | 146 | #ifdef CONFIG_ARCH_DMA_ADDR_T_64BIT |
146 | typedef u64 dma_addr_t; | 147 | typedef u64 dma_addr_t; |
147 | #else | 148 | #else |