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 | 25eb846 | 2008-04-28 16:33:53 -0600 | [diff] [blame] | 3 | #define PNP_EISA_ID_MASK 0x7fffffff |
| 4 | void pnp_eisa_id_to_string(u32 id, char *str); |
Bjorn Helgaas | bda1e4e | 2008-04-28 16:33:54 -0600 | [diff] [blame] | 5 | 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] | 6 | struct pnp_card *pnp_alloc_card(struct pnp_protocol *, int id, char *pnpid); |
Bjorn Helgaas | 772defc | 2008-04-28 16:33:52 -0600 | [diff] [blame] | 7 | struct pnp_id *pnp_add_id(struct pnp_dev *dev, char *id); |
Bjorn Helgaas | e436675 | 2008-04-28 16:33:56 -0600 | [diff] [blame] | 8 | struct pnp_id *pnp_add_card_id(struct pnp_card *card, char *id); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 9 | int pnp_interface_attach_device(struct pnp_dev *dev); |
| 10 | void pnp_fixup_device(struct pnp_dev *dev); |
| 11 | void pnp_free_option(struct pnp_option *option); |
| 12 | int __pnp_add_device(struct pnp_dev *dev); |
| 13 | void __pnp_remove_device(struct pnp_dev *dev); |
| 14 | |
Bjorn Helgaas | f5d94ff | 2008-04-28 16:34:22 -0600 | [diff] [blame] | 15 | int pnp_check_port(struct pnp_dev *dev, struct resource *res); |
| 16 | int pnp_check_mem(struct pnp_dev *dev, struct resource *res); |
| 17 | int pnp_check_irq(struct pnp_dev *dev, struct resource *res); |
| 18 | int pnp_check_dma(struct pnp_dev *dev, struct resource *res); |
Bjorn Helgaas | 81b5c75 | 2008-04-28 16:34:08 -0600 | [diff] [blame] | 19 | |
| 20 | void dbg_pnp_show_resources(struct pnp_dev *dev, char *desc); |
Bjorn Helgaas | d948a8d | 2008-04-28 16:34:13 -0600 | [diff] [blame] | 21 | |
| 22 | void pnp_init_resource(struct resource *res); |
Bjorn Helgaas | 02d83b5 | 2008-04-28 16:34:28 -0600 | [diff] [blame] | 23 | |
Bjorn Helgaas | 0a977f1 | 2008-04-28 16:34:31 -0600 | [diff] [blame] | 24 | struct pnp_resource *pnp_get_pnp_resource(struct pnp_dev *dev, |
| 25 | unsigned int type, unsigned int num); |
| 26 | |
Bjorn Helgaas | 02d83b5 | 2008-04-28 16:34:28 -0600 | [diff] [blame] | 27 | #define PNP_MAX_PORT 40 |
| 28 | #define PNP_MAX_MEM 24 |
| 29 | #define PNP_MAX_IRQ 2 |
| 30 | #define PNP_MAX_DMA 2 |
| 31 | |
Bjorn Helgaas | 784f01d | 2008-04-28 16:34:30 -0600 | [diff] [blame] | 32 | struct pnp_resource { |
| 33 | struct resource res; |
Bjorn Helgaas | 21855d6 | 2008-04-28 16:34:32 -0600 | [diff] [blame] | 34 | unsigned int index; /* ISAPNP config register index */ |
Bjorn Helgaas | 784f01d | 2008-04-28 16:34:30 -0600 | [diff] [blame] | 35 | }; |
| 36 | |
Bjorn Helgaas | 02d83b5 | 2008-04-28 16:34:28 -0600 | [diff] [blame] | 37 | struct pnp_resource_table { |
Bjorn Helgaas | 784f01d | 2008-04-28 16:34:30 -0600 | [diff] [blame] | 38 | struct pnp_resource port[PNP_MAX_PORT]; |
| 39 | struct pnp_resource mem[PNP_MAX_MEM]; |
| 40 | struct pnp_resource dma[PNP_MAX_DMA]; |
| 41 | struct pnp_resource irq[PNP_MAX_IRQ]; |
Bjorn Helgaas | 02d83b5 | 2008-04-28 16:34:28 -0600 | [diff] [blame] | 42 | }; |
Bjorn Helgaas | dbddd03 | 2008-04-28 16:34:34 -0600 | [diff] [blame] | 43 | |
| 44 | struct pnp_resource *pnp_add_irq_resource(struct pnp_dev *dev, int irq, |
| 45 | int flags); |
Bjorn Helgaas | dc16f5f | 2008-04-28 16:34:35 -0600 | [diff] [blame] | 46 | struct pnp_resource *pnp_add_dma_resource(struct pnp_dev *dev, int dma, |
| 47 | int flags); |
Bjorn Helgaas | cc8c2e3 | 2008-04-28 16:34:36 -0600 | [diff] [blame^] | 48 | struct pnp_resource *pnp_add_io_resource(struct pnp_dev *dev, |
| 49 | resource_size_t start, |
| 50 | resource_size_t end, int flags); |