base.h 2.7 KB
Newer Older
L
Linus Torvalds 已提交
1 2
extern spinlock_t pnp_lock;
void *pnp_alloc(long size);
3 4 5 6

int pnp_register_protocol(struct pnp_protocol *protocol);
void pnp_unregister_protocol(struct pnp_protocol *protocol);

B
Bjorn Helgaas 已提交
7 8
#define PNP_EISA_ID_MASK 0x7fffffff
void pnp_eisa_id_to_string(u32 id, char *str);
B
Bjorn Helgaas 已提交
9
struct pnp_dev *pnp_alloc_dev(struct pnp_protocol *, int id, char *pnpid);
B
Bjorn Helgaas 已提交
10
struct pnp_card *pnp_alloc_card(struct pnp_protocol *, int id, char *pnpid);
11 12

int pnp_add_device(struct pnp_dev *dev);
13
struct pnp_id *pnp_add_id(struct pnp_dev *dev, char *id);
L
Linus Torvalds 已提交
14
int pnp_interface_attach_device(struct pnp_dev *dev);
15 16 17 18 19 20 21

int pnp_add_card(struct pnp_card *card);
struct pnp_id *pnp_add_card_id(struct pnp_card *card, char *id);
void pnp_remove_card(struct pnp_card *card);
int pnp_add_card_device(struct pnp_card *card, struct pnp_dev *dev);
void pnp_remove_card_device(struct pnp_dev *dev);

22
struct pnp_option *pnp_build_option(int priority);
23 24 25 26 27 28 29 30 31 32 33 34 35
struct pnp_option *pnp_register_independent_option(struct pnp_dev *dev);
struct pnp_option *pnp_register_dependent_option(struct pnp_dev *dev,
						 int priority);
int pnp_register_irq_resource(struct pnp_dev *dev, struct pnp_option *option,
			      struct pnp_irq *data);
int pnp_register_dma_resource(struct pnp_dev *dev, struct pnp_option *option,
			      struct pnp_dma *data);
int pnp_register_port_resource(struct pnp_dev *dev, struct pnp_option *option,
			       struct pnp_port *data);
int pnp_register_mem_resource(struct pnp_dev *dev, struct pnp_option *option,
			      struct pnp_mem *data);
void pnp_init_resources(struct pnp_dev *dev);

L
Linus Torvalds 已提交
36 37 38 39 40
void pnp_fixup_device(struct pnp_dev *dev);
void pnp_free_option(struct pnp_option *option);
int __pnp_add_device(struct pnp_dev *dev);
void __pnp_remove_device(struct pnp_dev *dev);

41 42 43 44
int pnp_check_port(struct pnp_dev *dev, struct resource *res);
int pnp_check_mem(struct pnp_dev *dev, struct resource *res);
int pnp_check_irq(struct pnp_dev *dev, struct resource *res);
int pnp_check_dma(struct pnp_dev *dev, struct resource *res);
45

46
char *pnp_resource_type_name(struct resource *res);
47
void dbg_pnp_show_resources(struct pnp_dev *dev, char *desc);
48

49
void pnp_free_resources(struct pnp_dev *dev);
50
int pnp_resource_type(struct resource *res);
51

B
Bjorn Helgaas 已提交
52
struct pnp_resource {
53
	struct list_head list;
B
Bjorn Helgaas 已提交
54 55 56
	struct resource res;
};

57
void pnp_free_resource(struct pnp_resource *pnp_res);
58 59 60

struct pnp_resource *pnp_add_irq_resource(struct pnp_dev *dev, int irq,
					  int flags);
61 62
struct pnp_resource *pnp_add_dma_resource(struct pnp_dev *dev, int dma,
					  int flags);
63 64 65
struct pnp_resource *pnp_add_io_resource(struct pnp_dev *dev,
					 resource_size_t start,
					 resource_size_t end, int flags);
66 67 68
struct pnp_resource *pnp_add_mem_resource(struct pnp_dev *dev,
					  resource_size_t start,
					  resource_size_t end, int flags);