developer | 02e6591 | 2023-08-17 16:33:10 +0800 | [diff] [blame^] | 1 | /* adapter_int_shdevxs.c |
| 2 | * |
| 3 | * Adapter Shared Device Access module responsible for interrupts. |
| 4 | * Implementation depends on the Kernel Support Driver. |
| 5 | * |
| 6 | */ |
| 7 | |
| 8 | /***************************************************************************** |
| 9 | * Copyright (c) 2012-2022 by Rambus, Inc. and/or its subsidiaries. |
| 10 | * |
| 11 | * This program is free software: you can redistribute it and/or modify |
| 12 | * it under the terms of the GNU General Public License as published by |
| 13 | * the Free Software Foundation, either version 2 of the License, or |
| 14 | * any later version. |
| 15 | * |
| 16 | * This program is distributed in the hope that it will be useful, |
| 17 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 18 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 19 | * GNU General Public License for more details. |
| 20 | * |
| 21 | * You should have received a copy of the GNU General Public License |
| 22 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 23 | *****************************************************************************/ |
| 24 | |
| 25 | |
| 26 | /*---------------------------------------------------------------------------- |
| 27 | * This module implements (provides) the following interface(s): |
| 28 | */ |
| 29 | |
| 30 | #include "adapter_interrupts.h" |
| 31 | |
| 32 | |
| 33 | /*---------------------------------------------------------------------------- |
| 34 | * This module uses (requires) the following interface(s): |
| 35 | */ |
| 36 | |
| 37 | // Driver Framework Basic Definitions API |
| 38 | #include "basic_defs.h" // bool, IDENTIFIER_NOT_USED |
| 39 | |
| 40 | // Kernel support driver |
| 41 | #include "shdevxs_irq.h" |
| 42 | |
| 43 | |
| 44 | /*---------------------------------------------------------------------------- |
| 45 | * Definitions and macros |
| 46 | */ |
| 47 | |
| 48 | |
| 49 | /*---------------------------------------------------------------------------- |
| 50 | * Local variables |
| 51 | */ |
| 52 | |
| 53 | |
| 54 | /*---------------------------------------------------------------------------- |
| 55 | * Adapter_Interrupt_Enable |
| 56 | */ |
| 57 | int |
| 58 | Adapter_Interrupt_Enable( |
| 59 | const int nIRQ, |
| 60 | const unsigned int Flags) |
| 61 | { |
| 62 | return SHDevXS_IRQ_Enable(nIRQ, Flags); |
| 63 | } |
| 64 | |
| 65 | |
| 66 | /*---------------------------------------------------------------------------- |
| 67 | * Adapter_Interrupt_Disable |
| 68 | * |
| 69 | */ |
| 70 | int |
| 71 | Adapter_Interrupt_Disable( |
| 72 | const int nIRQ, |
| 73 | const unsigned int Flags) |
| 74 | { |
| 75 | return SHDevXS_IRQ_Disable(nIRQ, Flags); |
| 76 | } |
| 77 | |
| 78 | |
| 79 | /*---------------------------------------------------------------------------- |
| 80 | * Adapter_Interrupt_SetHandler |
| 81 | */ |
| 82 | int |
| 83 | Adapter_Interrupt_SetHandler( |
| 84 | const int nIRQ, |
| 85 | Adapter_InterruptHandler_t HandlerFunction) |
| 86 | { |
| 87 | return SHDevXS_IRQ_SetHandler(nIRQ, HandlerFunction); |
| 88 | } |
| 89 | |
| 90 | |
| 91 | /*---------------------------------------------------------------------------- |
| 92 | * Adapter_Interrupts_Init |
| 93 | */ |
| 94 | int |
| 95 | Adapter_Interrupts_Init( |
| 96 | const int nIRQ) |
| 97 | { |
| 98 | int res = SHDevXS_IRQ_Init(); |
| 99 | |
| 100 | IDENTIFIER_NOT_USED(nIRQ); |
| 101 | |
| 102 | return res; |
| 103 | } |
| 104 | |
| 105 | |
| 106 | /*---------------------------------------------------------------------------- |
| 107 | * Adapter_Interrupts_UnInit |
| 108 | */ |
| 109 | int |
| 110 | Adapter_Interrupts_UnInit( |
| 111 | const int nIRQ) |
| 112 | { |
| 113 | IDENTIFIER_NOT_USED(nIRQ); |
| 114 | return SHDevXS_IRQ_UnInit(); |
| 115 | } |
| 116 | |
| 117 | |
| 118 | /*---------------------------------------------------------------------------- |
| 119 | * Adapter_Interrupts_Resume |
| 120 | */ |
| 121 | int |
| 122 | Adapter_Interrupts_Resume(void) |
| 123 | { |
| 124 | // Resume AIC devices is done in SHDevXS IRQ module |
| 125 | return 0; // success |
| 126 | } |
| 127 | |
| 128 | |
| 129 | /* end of file adapter_int_shdevxs.c */ |