Eric W. Biederman | 95d7788 | 2006-10-04 02:17:01 -0700 | [diff] [blame] | 1 | #ifndef LINUX_HTIRQ_H |
| 2 | #define LINUX_HTIRQ_H |
| 3 | |
Jiang Liu | 49e07d8 | 2015-04-13 14:11:43 +0800 | [diff] [blame] | 4 | struct pci_dev; |
| 5 | struct irq_data; |
| 6 | |
Eric W. Biederman | ec68307 | 2006-11-08 17:44:57 -0800 | [diff] [blame] | 7 | struct ht_irq_msg { |
| 8 | u32 address_lo; /* low 32 bits of the ht irq message */ |
| 9 | u32 address_hi; /* high 32 bits of the it irq message */ |
| 10 | }; |
| 11 | |
Jiang Liu | 49e07d8 | 2015-04-13 14:11:43 +0800 | [diff] [blame] | 12 | typedef void (ht_irq_update_t)(struct pci_dev *dev, int irq, |
| 13 | struct ht_irq_msg *msg); |
| 14 | |
| 15 | struct ht_irq_cfg { |
| 16 | struct pci_dev *dev; |
| 17 | /* Update callback used to cope with buggy hardware */ |
| 18 | ht_irq_update_t *update; |
| 19 | unsigned pos; |
| 20 | unsigned idx; |
| 21 | struct ht_irq_msg msg; |
| 22 | }; |
| 23 | |
Eric W. Biederman | 95d7788 | 2006-10-04 02:17:01 -0700 | [diff] [blame] | 24 | /* Helper functions.. */ |
Eric W. Biederman | ec68307 | 2006-11-08 17:44:57 -0800 | [diff] [blame] | 25 | void fetch_ht_irq_msg(unsigned int irq, struct ht_irq_msg *msg); |
| 26 | void write_ht_irq_msg(unsigned int irq, struct ht_irq_msg *msg); |
Thomas Gleixner | e9f7ac6 | 2010-09-28 17:22:09 +0200 | [diff] [blame] | 27 | void mask_ht_irq(struct irq_data *data); |
| 28 | void unmask_ht_irq(struct irq_data *data); |
Eric W. Biederman | 95d7788 | 2006-10-04 02:17:01 -0700 | [diff] [blame] | 29 | |
| 30 | /* The arch hook for getting things started */ |
Jiang Liu | 49e07d8 | 2015-04-13 14:11:43 +0800 | [diff] [blame] | 31 | int arch_setup_ht_irq(int idx, int pos, struct pci_dev *dev, |
| 32 | ht_irq_update_t *update); |
| 33 | void arch_teardown_ht_irq(unsigned int irq); |
Eric W. Biederman | 95d7788 | 2006-10-04 02:17:01 -0700 | [diff] [blame] | 34 | |
Eric W. Biederman | 43539c38 | 2006-11-08 17:44:57 -0800 | [diff] [blame] | 35 | /* For drivers of buggy hardware */ |
Eric W. Biederman | 43539c38 | 2006-11-08 17:44:57 -0800 | [diff] [blame] | 36 | int __ht_create_irq(struct pci_dev *dev, int idx, ht_irq_update_t *update); |
| 37 | |
Eric W. Biederman | 95d7788 | 2006-10-04 02:17:01 -0700 | [diff] [blame] | 38 | #endif /* LINUX_HTIRQ_H */ |