Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1 | extern spinlock_t pnp_lock; |
| 2 | void *pnp_alloc(long size); |
Bjorn Helgaas | 62cfb29 | 2008-04-28 16:34:40 -0600 | [diff] [blame^] | 3 | |
| 4 | int pnp_register_protocol(struct pnp_protocol *protocol); |
| 5 | void pnp_unregister_protocol(struct pnp_protocol *protocol); |
| 6 | |
Bjorn Helgaas | 25eb846 | 2008-04-28 16:33:53 -0600 | [diff] [blame] | 7 | #define PNP_EISA_ID_MASK 0x7fffffff |
| 8 | void pnp_eisa_id_to_string(u32 id, char *str); |
Bjorn Helgaas | bda1e4e | 2008-04-28 16:33:54 -0600 | [diff] [blame] | 9 | struct pnp_dev *pnp_alloc_dev(struct pnp_protocol *, int id, char *pnpid); |
Bjorn Helgaas | 6bf2aab | 2008-04-28 16:33:58 -0600 | [diff] [blame] | 10 | struct pnp_card *pnp_alloc_card(struct pnp_protocol *, int id, char *pnpid); |
Bjorn Helgaas | 62cfb29 | 2008-04-28 16:34:40 -0600 | [diff] [blame^] | 11 | |
| 12 | int pnp_add_device(struct pnp_dev *dev); |
Bjorn Helgaas | 772defc | 2008-04-28 16:33:52 -0600 | [diff] [blame] | 13 | struct pnp_id *pnp_add_id(struct pnp_dev *dev, char *id); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 14 | int pnp_interface_attach_device(struct pnp_dev *dev); |
Bjorn Helgaas | 62cfb29 | 2008-04-28 16:34:40 -0600 | [diff] [blame^] | 15 | |
| 16 | int pnp_add_card(struct pnp_card *card); |
| 17 | struct pnp_id *pnp_add_card_id(struct pnp_card *card, char *id); |
| 18 | void pnp_remove_card(struct pnp_card *card); |
| 19 | int pnp_add_card_device(struct pnp_card *card, struct pnp_dev *dev); |
| 20 | void pnp_remove_card_device(struct pnp_dev *dev); |
| 21 | |
| 22 | struct pnp_option *pnp_register_independent_option(struct pnp_dev *dev); |
| 23 | struct pnp_option *pnp_register_dependent_option(struct pnp_dev *dev, |
| 24 | int priority); |
| 25 | int pnp_register_irq_resource(struct pnp_dev *dev, struct pnp_option *option, |
| 26 | struct pnp_irq *data); |
| 27 | int pnp_register_dma_resource(struct pnp_dev *dev, struct pnp_option *option, |
| 28 | struct pnp_dma *data); |
| 29 | int pnp_register_port_resource(struct pnp_dev *dev, struct pnp_option *option, |
| 30 | struct pnp_port *data); |
| 31 | int pnp_register_mem_resource(struct pnp_dev *dev, struct pnp_option *option, |
| 32 | struct pnp_mem *data); |
| 33 | void pnp_init_resources(struct pnp_dev *dev); |
| 34 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 35 | void pnp_fixup_device(struct pnp_dev *dev); |
| 36 | void pnp_free_option(struct pnp_option *option); |
| 37 | int __pnp_add_device(struct pnp_dev *dev); |
| 38 | void __pnp_remove_device(struct pnp_dev *dev); |
| 39 | |
Bjorn Helgaas | f5d94ff | 2008-04-28 16:34:22 -0600 | [diff] [blame] | 40 | int pnp_check_port(struct pnp_dev *dev, struct resource *res); |
| 41 | int pnp_check_mem(struct pnp_dev *dev, struct resource *res); |
| 42 | int pnp_check_irq(struct pnp_dev *dev, struct resource *res); |
| 43 | int pnp_check_dma(struct pnp_dev *dev, struct resource *res); |
Bjorn Helgaas | 81b5c75 | 2008-04-28 16:34:08 -0600 | [diff] [blame] | 44 | |
| 45 | void dbg_pnp_show_resources(struct pnp_dev *dev, char *desc); |
Bjorn Helgaas | d948a8d | 2008-04-28 16:34:13 -0600 | [diff] [blame] | 46 | |
| 47 | void pnp_init_resource(struct resource *res); |
Bjorn Helgaas | 02d83b5 | 2008-04-28 16:34:28 -0600 | [diff] [blame] | 48 | |
Bjorn Helgaas | 0a977f1 | 2008-04-28 16:34:31 -0600 | [diff] [blame] | 49 | struct pnp_resource *pnp_get_pnp_resource(struct pnp_dev *dev, |
| 50 | unsigned int type, unsigned int num); |
| 51 | |
Bjorn Helgaas | 02d83b5 | 2008-04-28 16:34:28 -0600 | [diff] [blame] | 52 | #define PNP_MAX_PORT 40 |
| 53 | #define PNP_MAX_MEM 24 |
| 54 | #define PNP_MAX_IRQ 2 |
| 55 | #define PNP_MAX_DMA 2 |
| 56 | |
Bjorn Helgaas | 784f01d | 2008-04-28 16:34:30 -0600 | [diff] [blame] | 57 | struct pnp_resource { |
| 58 | struct resource res; |
Bjorn Helgaas | 21855d6 | 2008-04-28 16:34:32 -0600 | [diff] [blame] | 59 | unsigned int index; /* ISAPNP config register index */ |
Bjorn Helgaas | 784f01d | 2008-04-28 16:34:30 -0600 | [diff] [blame] | 60 | }; |
| 61 | |
Bjorn Helgaas | 02d83b5 | 2008-04-28 16:34:28 -0600 | [diff] [blame] | 62 | struct pnp_resource_table { |
Bjorn Helgaas | 784f01d | 2008-04-28 16:34:30 -0600 | [diff] [blame] | 63 | struct pnp_resource port[PNP_MAX_PORT]; |
| 64 | struct pnp_resource mem[PNP_MAX_MEM]; |
| 65 | struct pnp_resource dma[PNP_MAX_DMA]; |
| 66 | struct pnp_resource irq[PNP_MAX_IRQ]; |
Bjorn Helgaas | 02d83b5 | 2008-04-28 16:34:28 -0600 | [diff] [blame] | 67 | }; |
Bjorn Helgaas | dbddd03 | 2008-04-28 16:34:34 -0600 | [diff] [blame] | 68 | |
| 69 | struct pnp_resource *pnp_add_irq_resource(struct pnp_dev *dev, int irq, |
| 70 | int flags); |
Bjorn Helgaas | dc16f5f | 2008-04-28 16:34:35 -0600 | [diff] [blame] | 71 | struct pnp_resource *pnp_add_dma_resource(struct pnp_dev *dev, int dma, |
| 72 | int flags); |
Bjorn Helgaas | cc8c2e3 | 2008-04-28 16:34:36 -0600 | [diff] [blame] | 73 | struct pnp_resource *pnp_add_io_resource(struct pnp_dev *dev, |
| 74 | resource_size_t start, |
| 75 | resource_size_t end, int flags); |
Bjorn Helgaas | d6180f3 | 2008-04-28 16:34:37 -0600 | [diff] [blame] | 76 | struct pnp_resource *pnp_add_mem_resource(struct pnp_dev *dev, |
| 77 | resource_size_t start, |
| 78 | resource_size_t end, int flags); |