1
2
3
4
5
6
7
8
9
10
11
12
13
14
15#include <linux/slab.h>
16#include <linux/module.h>
17#include <linux/kernel.h>
18
19#include <pcmcia/ss.h>
20#include <pcmcia/cistpl.h>
21#include "cs_internal.h"
22
23int static_init(struct pcmcia_socket *s)
24{
25
26
27
28 s->resource_setup_done = 1;
29
30 return 0;
31}
32
33struct resource *pcmcia_make_resource(resource_size_t start,
34 resource_size_t end,
35 unsigned long flags, const char *name)
36{
37 struct resource *res = kzalloc(sizeof(*res), GFP_KERNEL);
38
39 if (res) {
40 res->name = name;
41 res->start = start;
42 res->end = start + end - 1;
43 res->flags = flags;
44 }
45 return res;
46}
47
48static int static_find_io(struct pcmcia_socket *s, unsigned int attr,
49 unsigned int *base, unsigned int num,
50 unsigned int align, struct resource **parent)
51{
52 if (!s->io_offset)
53 return -EINVAL;
54 *base = s->io_offset | (*base & 0x0fff);
55 *parent = NULL;
56
57 return 0;
58}
59
60
61struct pccard_resource_ops pccard_static_ops = {
62 .validate_mem = NULL,
63 .find_io = static_find_io,
64 .find_mem = NULL,
65 .init = static_init,
66 .exit = NULL,
67};
68EXPORT_SYMBOL(pccard_static_ops);
69
70
71MODULE_AUTHOR("David A. Hinds, Dominik Brodowski");
72MODULE_LICENSE("GPL");
73MODULE_ALIAS("rsrc_nonstatic");
74