blob: 5370199f08c7bc99211ab31a161887f4372607be [file] [log] [blame]
Heiko J Schickfab97222006-09-22 15:22:22 -07001/*
2 * IBM eServer eHCA Infiniband device driver for Linux on POWER
3 *
4 * Function definitions and structs for EQs, NEQs and interrupts
5 *
6 * Authors: Heiko J Schick <schickhj@de.ibm.com>
7 * Khadija Souissi <souissi@de.ibm.com>
8 *
9 * Copyright (c) 2005 IBM Corporation
10 *
11 * All rights reserved.
12 *
13 * This source code is distributed under a dual license of GPL v2.0 and OpenIB
14 * BSD.
15 *
16 * OpenIB BSD License
17 *
18 * Redistribution and use in source and binary forms, with or without
19 * modification, are permitted provided that the following conditions are met:
20 *
21 * Redistributions of source code must retain the above copyright notice, this
22 * list of conditions and the following disclaimer.
23 *
24 * Redistributions in binary form must reproduce the above copyright notice,
25 * this list of conditions and the following disclaimer in the documentation
26 * and/or other materials
27 * provided with the distribution.
28 *
29 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
30 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
31 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
32 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
33 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
34 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
35 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
36 * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
37 * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
38 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
39 * POSSIBILITY OF SUCH DAMAGE.
40 */
41
42#ifndef __EHCA_IRQ_H
43#define __EHCA_IRQ_H
44
45
46struct ehca_shca;
47
48#include <linux/interrupt.h>
49#include <linux/types.h>
Heiko J Schickfab97222006-09-22 15:22:22 -070050
51int ehca_error_data(struct ehca_shca *shca, void *data, u64 resource);
52
David Howells7d12e782006-10-05 14:55:46 +010053irqreturn_t ehca_interrupt_neq(int irq, void *dev_id);
Heiko J Schickfab97222006-09-22 15:22:22 -070054void ehca_tasklet_neq(unsigned long data);
55
David Howells7d12e782006-10-05 14:55:46 +010056irqreturn_t ehca_interrupt_eq(int irq, void *dev_id);
Heiko J Schickfab97222006-09-22 15:22:22 -070057void ehca_tasklet_eq(unsigned long data);
Hoang-Nam Nguyen78d8d5f2007-02-15 17:06:33 +010058void ehca_process_eq(struct ehca_shca *shca, int is_irq);
Heiko J Schickfab97222006-09-22 15:22:22 -070059
60struct ehca_cpu_comp_task {
Heiko J Schickfab97222006-09-22 15:22:22 -070061 struct list_head cq_list;
Heiko J Schickfab97222006-09-22 15:22:22 -070062 spinlock_t task_lock;
63 int cq_jobs;
Thomas Gleixner81942622012-07-16 10:42:39 +000064 int active;
Heiko J Schickfab97222006-09-22 15:22:22 -070065};
66
67struct ehca_comp_pool {
Thomas Gleixner81942622012-07-16 10:42:39 +000068 struct ehca_cpu_comp_task __percpu *cpu_comp_tasks;
69 struct task_struct * __percpu *cpu_comp_threads;
Heiko J Schickfab97222006-09-22 15:22:22 -070070 int last_cpu;
71 spinlock_t last_cpu_lock;
72};
73
74int ehca_create_comp_pool(void);
75void ehca_destroy_comp_pool(void);
76
77#endif