blob: d4a527e58434df73800eed55fbbc6750f5f2d5ee [file] [log] [blame]
Eric W. Biederman95d77882006-10-04 02:17:01 -07001#ifndef LINUX_HTIRQ_H
2#define LINUX_HTIRQ_H
3
Jiang Liu49e07d82015-04-13 14:11:43 +08004struct pci_dev;
5struct irq_data;
6
Eric W. Biedermanec683072006-11-08 17:44:57 -08007struct 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 Liu49e07d82015-04-13 14:11:43 +080012typedef void (ht_irq_update_t)(struct pci_dev *dev, int irq,
13 struct ht_irq_msg *msg);
14
15struct 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. Biederman95d77882006-10-04 02:17:01 -070024/* Helper functions.. */
Eric W. Biedermanec683072006-11-08 17:44:57 -080025void fetch_ht_irq_msg(unsigned int irq, struct ht_irq_msg *msg);
26void write_ht_irq_msg(unsigned int irq, struct ht_irq_msg *msg);
Thomas Gleixnere9f7ac62010-09-28 17:22:09 +020027void mask_ht_irq(struct irq_data *data);
28void unmask_ht_irq(struct irq_data *data);
Eric W. Biederman95d77882006-10-04 02:17:01 -070029
30/* The arch hook for getting things started */
Jiang Liu49e07d82015-04-13 14:11:43 +080031int arch_setup_ht_irq(int idx, int pos, struct pci_dev *dev,
32 ht_irq_update_t *update);
33void arch_teardown_ht_irq(unsigned int irq);
Eric W. Biederman95d77882006-10-04 02:17:01 -070034
Eric W. Biederman43539c382006-11-08 17:44:57 -080035/* For drivers of buggy hardware */
Eric W. Biederman43539c382006-11-08 17:44:57 -080036int __ht_create_irq(struct pci_dev *dev, int idx, ht_irq_update_t *update);
37
Eric W. Biederman95d77882006-10-04 02:17:01 -070038#endif /* LINUX_HTIRQ_H */