- Kai Germaschewski: ISDN update (including Makefiles)
[davej-history.git] / drivers / acpi / resources / rsxface.c
blob8691f8200b33ebfa536cfcf3f2c0111035b6aedc
1 /*******************************************************************************
3 * Module Name: rsxface - Public interfaces to the ACPI subsystem
4 * $Revision: 8 $
6 ******************************************************************************/
8 /*
9 * Copyright (C) 2000 R. Byron Moore
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 * (at your option) any later version.
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.
21 * You should have received a copy of the GNU General Public License
22 * along with this program; if not, write to the Free Software
23 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
27 #include "acpi.h"
28 #include "acinterp.h"
29 #include "acnamesp.h"
30 #include "acresrc.h"
32 #define _COMPONENT RESOURCE_MANAGER
33 MODULE_NAME ("rsxface")
36 /*******************************************************************************
38 * FUNCTION: Acpi_get_irq_routing_table
40 * PARAMETERS: Device_handle - a handle to the Bus device we are querying
41 * Ret_buffer - a pointer to a buffer to receive the
42 * current resources for the device
44 * RETURN: Status - the status of the call
46 * DESCRIPTION: This function is called to get the IRQ routing table for a
47 * specific bus. The caller must first acquire a handle for the
48 * desired bus. The routine table is placed in the buffer pointed
49 * to by the Ret_buffer variable parameter.
51 * If the function fails an appropriate status will be returned
52 * and the value of Ret_buffer is undefined.
54 * This function attempts to execute the _PRT method contained in
55 * the object indicated by the passed Device_handle.
57 ******************************************************************************/
59 ACPI_STATUS
60 acpi_get_irq_routing_table (
61 ACPI_HANDLE device_handle,
62 ACPI_BUFFER *ret_buffer)
64 ACPI_STATUS status;
68 * Must have a valid handle and buffer, So we have to have a handle
69 * and a return buffer structure, and if there is a non-zero buffer length
70 * we also need a valid pointer in the buffer. If it's a zero buffer length,
71 * we'll be returning the needed buffer size, so keep going.
73 if ((!device_handle) ||
74 (!ret_buffer) ||
75 ((!ret_buffer->pointer) && (ret_buffer->length)))
77 return (AE_BAD_PARAMETER);
80 status = acpi_rs_get_prt_method_data (device_handle, ret_buffer);
82 return (status);
86 /*******************************************************************************
88 * FUNCTION: Acpi_get_current_resources
90 * PARAMETERS: Device_handle - a handle to the device object for the
91 * device we are querying
92 * Ret_buffer - a pointer to a buffer to receive the
93 * current resources for the device
95 * RETURN: Status - the status of the call
97 * DESCRIPTION: This function is called to get the current resources for a
98 * specific device. The caller must first acquire a handle for
99 * the desired device. The resource data is placed in the buffer
100 * pointed to by the Ret_buffer variable parameter.
102 * If the function fails an appropriate status will be returned
103 * and the value of Ret_buffer is undefined.
105 * This function attempts to execute the _CRS method contained in
106 * the object indicated by the passed Device_handle.
108 ******************************************************************************/
110 ACPI_STATUS
111 acpi_get_current_resources (
112 ACPI_HANDLE device_handle,
113 ACPI_BUFFER *ret_buffer)
115 ACPI_STATUS status;
119 * Must have a valid handle and buffer, So we have to have a handle
120 * and a return buffer structure, and if there is a non-zero buffer length
121 * we also need a valid pointer in the buffer. If it's a zero buffer length,
122 * we'll be returning the needed buffer size, so keep going.
124 if ((!device_handle) ||
125 (!ret_buffer) ||
126 ((ret_buffer->length) && (!ret_buffer->pointer)))
128 return (AE_BAD_PARAMETER);
131 status = acpi_rs_get_crs_method_data (device_handle, ret_buffer);
133 return (status);
137 /*******************************************************************************
139 * FUNCTION: Acpi_get_possible_resources
141 * PARAMETERS: Device_handle - a handle to the device object for the
142 * device we are querying
143 * Ret_buffer - a pointer to a buffer to receive the
144 * resources for the device
146 * RETURN: Status - the status of the call
148 * DESCRIPTION: This function is called to get a list of the possible resources
149 * for a specific device. The caller must first acquire a handle
150 * for the desired device. The resource data is placed in the
151 * buffer pointed to by the Ret_buffer variable.
153 * If the function fails an appropriate status will be returned
154 * and the value of Ret_buffer is undefined.
156 ******************************************************************************/
158 ACPI_STATUS
159 acpi_get_possible_resources (
160 ACPI_HANDLE device_handle,
161 ACPI_BUFFER *ret_buffer)
163 ACPI_STATUS status;
167 * Must have a valid handle and buffer, So we have to have a handle
168 * and a return buffer structure, and if there is a non-zero buffer length
169 * we also need a valid pointer in the buffer. If it's a zero buffer length,
170 * we'll be returning the needed buffer size, so keep going.
172 if ((!device_handle) ||
173 (!ret_buffer) ||
174 ((ret_buffer->length) && (!ret_buffer->pointer)))
176 return (AE_BAD_PARAMETER);
179 status = acpi_rs_get_prs_method_data (device_handle, ret_buffer);
181 return (status);
185 /*******************************************************************************
187 * FUNCTION: Acpi_set_current_resources
189 * PARAMETERS: Device_handle - a handle to the device object for the
190 * device we are changing the resources of
191 * In_buffer - a pointer to a buffer containing the
192 * resources to be set for the device
194 * RETURN: Status - the status of the call
196 * DESCRIPTION: This function is called to set the current resources for a
197 * specific device. The caller must first acquire a handle for
198 * the desired device. The resource data is passed to the routine
199 * the buffer pointed to by the In_buffer variable.
201 ******************************************************************************/
203 ACPI_STATUS
204 acpi_set_current_resources (
205 ACPI_HANDLE device_handle,
206 ACPI_BUFFER *in_buffer)
208 ACPI_STATUS status;
212 * Must have a valid handle and buffer
214 if ((!device_handle) ||
215 (!in_buffer) ||
216 (!in_buffer->pointer) ||
217 (!in_buffer->length))
219 return (AE_BAD_PARAMETER);
222 status = acpi_rs_set_srs_method_data (device_handle, in_buffer);
224 return (status);