ia64/xen-unstable
changeset 2107:cfe6d46a6298
bitkeeper revision 1.1149.2.3 (411386bfYp4SwvBgrsGPfuJ_1XU5xw)
Enable pcibios_scan_all_fns since otherwise we don't find all multifunction devices.
Enable pcibios_scan_all_fns since otherwise we don't find all multifunction devices.
author | cl349@freefall.cl.cam.ac.uk |
---|---|
date | Fri Aug 06 13:25:19 2004 +0000 (2004-08-06) |
parents | 04070e921d35 |
children | 6a95987050ca |
files | .rootkeys linux-2.6.7-xen-sparse/include/asm-xen/asm-i386/pci.h xen/common/physdev.c |
line diff
1.1 --- a/.rootkeys Thu Aug 05 16:13:28 2004 +0000 1.2 +++ b/.rootkeys Fri Aug 06 13:25:19 2004 +0000 1.3 @@ -217,6 +217,7 @@ 40f5623arsFXkGdPvIqvFi3yFXGR0Q linux-2.6 1.4 40f5623aFTyFTR-vdiA-KaGxk5JOKQ linux-2.6.7-xen-sparse/include/asm-xen/asm-i386/msr.h 1.5 40f5623adgjZq9nAgCt0IXdWl7udSA linux-2.6.7-xen-sparse/include/asm-xen/asm-i386/page.h 1.6 40f5623a54NuG-7qHihGYmw4wWQnMA linux-2.6.7-xen-sparse/include/asm-xen/asm-i386/param.h 1.7 +41137cc1kkvg0cg7uxddcEfjL7L67w linux-2.6.7-xen-sparse/include/asm-xen/asm-i386/pci.h 1.8 40f5623atCokYc2uCysSJ8jFO8TEsw linux-2.6.7-xen-sparse/include/asm-xen/asm-i386/pgalloc.h 1.9 40f5623aEToIXouJgO-ao5d5pcEt1w linux-2.6.7-xen-sparse/include/asm-xen/asm-i386/pgtable-2level.h 1.10 40f5623aCCXRPlGpNthVXstGz9ZV3A linux-2.6.7-xen-sparse/include/asm-xen/asm-i386/pgtable.h
2.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 2.2 +++ b/linux-2.6.7-xen-sparse/include/asm-xen/asm-i386/pci.h Fri Aug 06 13:25:19 2004 +0000 2.3 @@ -0,0 +1,117 @@ 2.4 +#ifndef __i386_PCI_H 2.5 +#define __i386_PCI_H 2.6 + 2.7 +#include <linux/config.h> 2.8 + 2.9 +#ifdef __KERNEL__ 2.10 +#include <linux/mm.h> /* for struct page */ 2.11 + 2.12 +/* Can be used to override the logic in pci_scan_bus for skipping 2.13 + already-configured bus numbers - to be used for buggy BIOSes 2.14 + or architectures with incomplete PCI setup by the loader */ 2.15 + 2.16 +#ifdef CONFIG_PCI 2.17 +extern unsigned int pcibios_assign_all_busses(void); 2.18 +#else 2.19 +#define pcibios_assign_all_busses() 0 2.20 +#endif 2.21 +#define pcibios_scan_all_fns(a, b) 0 2.22 + 2.23 +extern unsigned long pci_mem_start; 2.24 +#define PCIBIOS_MIN_IO 0x1000 2.25 +#define PCIBIOS_MIN_MEM (pci_mem_start) 2.26 + 2.27 +#define PCIBIOS_MIN_CARDBUS_IO 0x4000 2.28 + 2.29 +void pcibios_config_init(void); 2.30 +struct pci_bus * pcibios_scan_root(int bus); 2.31 + 2.32 +void pcibios_set_master(struct pci_dev *dev); 2.33 +void pcibios_penalize_isa_irq(int irq); 2.34 +struct irq_routing_table *pcibios_get_irq_routing_table(void); 2.35 +int pcibios_set_irq_routing(struct pci_dev *dev, int pin, int irq); 2.36 + 2.37 +/* Dynamic DMA mapping stuff. 2.38 + * i386 has everything mapped statically. 2.39 + */ 2.40 + 2.41 +#include <linux/types.h> 2.42 +#include <linux/slab.h> 2.43 +#include <asm/scatterlist.h> 2.44 +#include <linux/string.h> 2.45 +#include <asm/io.h> 2.46 + 2.47 +struct pci_dev; 2.48 + 2.49 +/* The PCI address space does equal the physical memory 2.50 + * address space. The networking and block device layers use 2.51 + * this boolean for bounce buffer decisions. 2.52 + */ 2.53 +#define PCI_DMA_BUS_IS_PHYS (1) 2.54 + 2.55 +/* pci_unmap_{page,single} is a nop so... */ 2.56 +#define DECLARE_PCI_UNMAP_ADDR(ADDR_NAME) 2.57 +#define DECLARE_PCI_UNMAP_LEN(LEN_NAME) 2.58 +#define pci_unmap_addr(PTR, ADDR_NAME) (0) 2.59 +#define pci_unmap_addr_set(PTR, ADDR_NAME, VAL) do { } while (0) 2.60 +#define pci_unmap_len(PTR, LEN_NAME) (0) 2.61 +#define pci_unmap_len_set(PTR, LEN_NAME, VAL) do { } while (0) 2.62 + 2.63 +/* This is always fine. */ 2.64 +#define pci_dac_dma_supported(pci_dev, mask) (1) 2.65 + 2.66 +static inline dma64_addr_t 2.67 +pci_dac_page_to_dma(struct pci_dev *pdev, struct page *page, unsigned long offset, int direction) 2.68 +{ 2.69 + return ((dma64_addr_t) page_to_phys(page) + 2.70 + (dma64_addr_t) offset); 2.71 +} 2.72 + 2.73 +static inline struct page * 2.74 +pci_dac_dma_to_page(struct pci_dev *pdev, dma64_addr_t dma_addr) 2.75 +{ 2.76 + return pfn_to_page(dma_addr >> PAGE_SHIFT); 2.77 +} 2.78 + 2.79 +static inline unsigned long 2.80 +pci_dac_dma_to_offset(struct pci_dev *pdev, dma64_addr_t dma_addr) 2.81 +{ 2.82 + return (dma_addr & ~PAGE_MASK); 2.83 +} 2.84 + 2.85 +static inline void 2.86 +pci_dac_dma_sync_single_for_cpu(struct pci_dev *pdev, dma64_addr_t dma_addr, size_t len, int direction) 2.87 +{ 2.88 +} 2.89 + 2.90 +static inline void 2.91 +pci_dac_dma_sync_single_for_device(struct pci_dev *pdev, dma64_addr_t dma_addr, size_t len, int direction) 2.92 +{ 2.93 + flush_write_buffers(); 2.94 +} 2.95 + 2.96 +#define HAVE_PCI_MMAP 2.97 +extern int pci_mmap_page_range(struct pci_dev *dev, struct vm_area_struct *vma, 2.98 + enum pci_mmap_state mmap_state, int write_combine); 2.99 + 2.100 + 2.101 +static inline void pcibios_add_platform_entries(struct pci_dev *dev) 2.102 +{ 2.103 +} 2.104 + 2.105 +#endif /* __KERNEL__ */ 2.106 + 2.107 +/* implement the pci_ DMA API in terms of the generic device dma_ one */ 2.108 +#include <asm-generic/pci-dma-compat.h> 2.109 + 2.110 +/* generic pci stuff */ 2.111 +#include <asm-generic/pci.h> 2.112 + 2.113 +/* On Xen we have to scan all functions since Xen hides bridges from 2.114 + * us. If a bridge is at fn=0 and that slot has a multifunction 2.115 + * device, we won't find the additional devices without scanning all 2.116 + * functions. */ 2.117 +#undef pcibios_scan_all_fns 2.118 +#define pcibios_scan_all_fns(a, b) 1 2.119 + 2.120 +#endif /* __i386_PCI_H */
3.1 --- a/xen/common/physdev.c Thu Aug 05 16:13:28 2004 +0000 3.2 +++ b/xen/common/physdev.c Fri Aug 06 13:25:19 2004 +0000 3.3 @@ -734,7 +734,19 @@ void physdev_init_dom0(struct domain *p) 3.4 continue; 3.5 } 3.6 3.7 - /* Skip bridges and other peculiarities for now. */ 3.8 + /* Skip bridges and other peculiarities for now. 3.9 + * 3.10 + * Note that this can prevent the guest from detecting devices 3.11 + * with fn>0 on slots where the fn=0 device is a bridge. We 3.12 + * can identify such slots by looking at the multifunction bit 3.13 + * (top bit of hdr_type, masked out in dev->hdr_type). 3.14 + * 3.15 + * In Linux2.4 we find all devices because the detection code 3.16 + * scans all functions if the read of the fn=0 device's header 3.17 + * type fails. 3.18 + * 3.19 + * In Linux2.6 we set pcibios_scan_all_fns(). 3.20 + */ 3.21 if ( dev->hdr_type != PCI_HEADER_TYPE_NORMAL ) 3.22 continue; 3.23 pdev = xmalloc(sizeof(phys_dev_t));