http://downloads.netgear.com/files/GPL/GPL_Source_V361j_DM111PSP_series_consumer_rele...
[bcm963xx.git] / kernel / linux / arch / alpha / kernel / pci-noop.c
1 /*
2  *      linux/arch/alpha/kernel/pci-noop.c
3  *
4  * Stub PCI interfaces for Jensen-specific kernels.
5  */
6
7 #include <linux/pci.h>
8 #include <linux/init.h>
9 #include <linux/bootmem.h>
10 #include <linux/errno.h>
11 #include <linux/sched.h>
12
13 #include "proto.h"
14
15
16 /*
17  * The PCI controller list.
18  */
19
20 struct pci_controller *hose_head, **hose_tail = &hose_head;
21 struct pci_controller *pci_isa_hose;
22
23
24 struct pci_controller * __init
25 alloc_pci_controller(void)
26 {
27         struct pci_controller *hose;
28
29         hose = alloc_bootmem(sizeof(*hose));
30
31         *hose_tail = hose;
32         hose_tail = &hose->next;
33
34         return hose;
35 }
36
37 struct resource * __init
38 alloc_resource(void)
39 {
40         struct resource *res;
41
42         res = alloc_bootmem(sizeof(*res));
43
44         return res;
45 }
46
47 asmlinkage long
48 sys_pciconfig_iobase(long which, unsigned long bus, unsigned long dfn)
49 {
50         struct pci_controller *hose;
51
52         /* from hose or from bus.devfn */
53         if (which & IOBASE_FROM_HOSE) {
54                 for (hose = hose_head; hose; hose = hose->next) 
55                         if (hose->index == bus)
56                                 break;
57                 if (!hose)
58                         return -ENODEV;
59         } else {
60                 /* Special hook for ISA access.  */
61                 if (bus == 0 && dfn == 0)
62                         hose = pci_isa_hose;
63                 else
64                         return -ENODEV;
65         }
66
67         switch (which & ~IOBASE_FROM_HOSE) {
68         case IOBASE_HOSE:
69                 return hose->index;
70         case IOBASE_SPARSE_MEM:
71                 return hose->sparse_mem_base;
72         case IOBASE_DENSE_MEM:
73                 return hose->dense_mem_base;
74         case IOBASE_SPARSE_IO:
75                 return hose->sparse_io_base;
76         case IOBASE_DENSE_IO:
77                 return hose->dense_io_base;
78         case IOBASE_ROOT_BUS:
79                 return hose->bus->number;
80         }
81
82         return -EOPNOTSUPP;
83 }
84
85 asmlinkage long
86 sys_pciconfig_read(unsigned long bus, unsigned long dfn,
87                    unsigned long off, unsigned long len, void *buf)
88 {
89         if (!capable(CAP_SYS_ADMIN))
90                 return -EPERM;
91         else
92                 return -ENODEV;
93 }
94
95 asmlinkage long
96 sys_pciconfig_write(unsigned long bus, unsigned long dfn,
97                     unsigned long off, unsigned long len, void *buf)
98 {
99         if (!capable(CAP_SYS_ADMIN))
100                 return -EPERM;
101         else
102                 return -ENODEV;
103 }
104 /* stubs for the routines in pci_iommu.c */
105 void *
106 pci_alloc_consistent(struct pci_dev *pdev, size_t size, dma_addr_t *dma_addrp)
107 {
108         return NULL;
109 }
110 void
111 pci_free_consistent(struct pci_dev *pdev, size_t size, void *cpu_addr,
112                     dma_addr_t dma_addr)
113 {
114 }
115 dma_addr_t
116 pci_map_single(struct pci_dev *pdev, void *cpu_addr, size_t size,
117                int direction)
118 {
119         return (dma_addr_t) 0;
120 }
121 void
122 pci_unmap_single(struct pci_dev *pdev, dma_addr_t dma_addr, size_t size,
123                  int direction)
124 {
125 }
126 int
127 pci_map_sg(struct pci_dev *pdev, struct scatterlist *sg, int nents,
128            int direction)
129 {
130         return 0;
131 }
132 void
133 pci_unmap_sg(struct pci_dev *pdev, struct scatterlist *sg, int nents,
134              int direction)
135 {
136 }
137 int
138 pci_dma_supported(struct pci_dev *hwdev, dma_addr_t mask)
139 {
140         return 0;
141 }