2 .\" Copyright (c) 1999, Sun Microsystems, Inc. All Rights Reserved
3 .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License.
4 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing. See the License for the specific language governing permissions and limitations under the License.
5 .\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
6 .TH CSX_REQUESTWINDOW 9F "Jul 19, 1996"
8 csx_RequestWindow, csx_ReleaseWindow \- request or release window resources
12 #include <sys/pccard.h>
16 \fBint32_t\fR \fBcsx_RequestWindow\fR(\fBclient_handle_t\fR \fIch\fR, \fBwindow_handle_t *\fR\fIwh\fR,
17 \fBwin_req_t *\fR\fIwr\fR);
22 \fBint32_t\fR \fBcsx_ReleaseWindow\fR(\fBwindow_handle_t\fR \fIwh\fR);
28 Solaris \fBDDI \fRSpecific (Solaris \fBDDI) \fR
36 Client handle returned from \fBcsx_RegisterClient\fR(9F).
45 Pointer to a \fBwindow_handle_t\fR structure.
54 Pointer to a \fBwin_req_t\fR structure.
60 The function \fBcsx_RequestWindow()\fR requests a block of system address space
61 be assigned to a \fBPC \fRCard in a socket.
64 The function \fBcsx_ReleaseWindow()\fR releases window resources which were
65 obtained by a call to \fBcsx_RequestWindow()\fR. No adapter or socket hardware
66 is modified by this function.
69 The \fBcsx_MapMemPage\fR(9F) and \fBcsx_ModifyWindow\fR(9F) functions use the
70 window handle returned by \fBcsx_RequestWindow()\fR. This window handle must be
71 freed by calling \fBcsx_ReleaseWindow()\fR when the client is done using this
75 The \fBPC\fR Card Attribute or Common Memory offset for this window is set by
76 \fBcsx_MapMemPage\fR(9F).
80 The structure members of \fBwin_req_t\fR are:
84 uint32_t Socket; /* socket number */
85 uint32_t Attributes; /* window flags */
86 uint32_t Base.base; /* requested window */
88 acc_handle_t Base.handle; /* returned handle for
90 uint32_t Size; /* window size requested */
92 uint32_t win_params.AccessSpeed; /* window access speed */
93 uint32_t win_params.IOAddrLines; /* IO address lines decoded */
94 uint32_t ReqOffset; /* required window offest */
100 The fields are defined as follows:
107 Not used in Solaris, but for portability with other Card Services
108 implementations, it should be set to the logical socket number.
114 \fB\fBAttributes\fR\fR
117 This field is bit-mapped and is defined as follows:
121 \fB\fBWIN_MEMORY_TYPE_IO\fR\fR
131 \fB\fBWIN_MEMORY_TYPE_CM\fR\fR
135 Points to common memory space.
141 \fB\fBWIN_MEMORY_TYPE_AM\fR\fR
145 These bits select which type of window is being requested. One of these bits
152 \fB\fBWIN_ENABLE\fR\fR
156 The client must set this bit to enable the window.
162 \fB\fBWIN_ACC_BIG_ENDIAN\fR\fR
166 Describes device as big-endian.
172 \fB\fBWIN_ACC_LITTLE_ENDIAN\fR\fR
176 These bits describe the endian characteristics of the device as big endian or
177 little endian, respectively. Even though most of the devices will have the same
178 endian characteristics as their busses, there are examples of devices with an
179 \fBI/O \fRprocessor that has opposite endian characteristics of the busses.
180 When either of these bits are set, byte swapping will automatically be
181 performed by the system if the host machine and the device data formats have
182 opposite endian characteristics. The implementation may take advantage of
183 hardware platform byte swapping capabilities.
189 \fB\fBWIN_ACC_NEVER_SWAP\fR\fR
193 When this is specified, byte swapping will not be invoked in the data access
197 The ability to specify the order in which the \fBCPU\fR will reference data is
198 provided by the following \fBAttributes\fR bits, only one of which may be
203 \fB\fBWIN_ACC_STRICT_ORDER\fR\fR
207 The data references must be issued by a \fBCPU \fR in program order. Strict
208 ordering is the default behavior.
214 \fB\fBWIN_ACC_UNORDERED_OK\fR\fR
218 The \fBCPU\fR may re-order the data references. This includes all kinds of
219 re-ordering (that is, a load followed by a store may be replaced by a store
226 \fB\fBWIN_ACC_MERGING_OK\fR\fR
230 The \fBCPU \fRmay merge individual stores to consecutive locations. For
231 example, the \fBCPU \fRmay turn two consecutive byte stores into one halfword
232 store. It may also batch individual loads. For example, the \fBCPU \fRmay turn
233 two consecutive byte loads into one halfword load. This bit also implies
240 \fB\fBWIN_ACC_LOADCACHING_OK\fR\fR
244 The \fBCPU \fRmay cache the data it fetches and reuse it until another store
245 occurs. The default behavior is to fetch new data on every load. This bit also
246 implies merging and re-ordering.
252 \fB\fBWIN_ACC_STORECACHING_OK\fR\fR
256 The \fBCPU \fRmay keep the data in the cache and push it to the device (perhaps
257 with other data) at a later time. The default behavior is to push the data
258 right away. This bit also implies load caching, merging, and re-ordering.
261 These values are advisory, not mandatory. For example, data can be ordered
262 without being merged or cached, even though a driver requests unordered, merged
265 All other bits in the \fBAttributes\fR field must be set to \fB0\fR.
267 On successful return from \fBcsx_RequestWindow()\fR, \fBWIN_OFFSET_SIZE\fR is
268 set in the \fBAttributes\fR field when the client must specify card offsets to
269 \fBcsx_MapMemPage\fR(9F) that are a multiple of the window size.
275 \fB\fBBase.base\fR\fR
278 This field must be set to \fB0\fR on calling \fBcsx_RequestWindow()\fR.
284 \fB\fBBase.handle\fR\fR
287 On successful return from \fBcsx_RequestWindow()\fR, the \fBBase.handle\fR
288 field contains an access handle corresponding to the first byte of the
289 allocated memory window which the client must use when accessing the \fBPC
290 \fRCard's memory space via the common access functions. A client must \fBnot\fR
291 make any assumptions as to the format of the returned \fBBase.handle\fR field
301 On calling \fBcsx_RequestWindow()\fR, the \fBSize\fR field is the size in bytes
302 of the memory window requested. \fBSize\fR may be zero to indicate that Card
303 Services should provide the smallest sized window available. On successful
304 return from \fBcsx_RequestWindow()\fR, the \fBSize\fR field contains the actual
305 size of the window allocated.
311 \fB\fBwin_params.AccessSpeed\fR\fR
314 This field specifies the access speed of the window if the client is requesting
315 a memory window. The \fBAccessSpeed\fR field bit definitions use the format of
316 the extended speed byte of the Device \fBID \fRtuple. If the mantissa is
317 \fB0\fR (noted as reserved in the \fBPC Card 95 Standard\fR), the lower bits
318 are a binary code representing a speed from the following table:
328 \fBCode\fR \fBSpeed\fR
330 0 (Reserved - do not use).
340 5-7 (Reserved\(emdo not use.)
345 To request a window that supports the \fBWAIT\fR signal, \fBOR-in\fR the
346 \fBWIN_USE_WAIT\fR bit to the \fBAccessSpeed\fR value before calling this
350 It is recommended that clients use the \fBcsx_ConvertSpeed\fR(9F) function to
351 generate the appropriate \fBAccessSpeed\fR values rather than manually
352 perturbing the \fBAccessSpeed\fR field.
356 \fB\fBwin_params.IOAddrLines\fR\fR
359 If the client is requesting an \fBI/O \fRwindow, the \fBIOAddrLines\fR field is
360 the number of \fBI/O \fRaddress lines decoded by the \fBPC \fRCard in the
361 specified socket. Access to the \fBI/O \fRwindow is not enabled until
362 \fBcsx_RequestConfiguration\fR(9F) has been invoked successfully.
368 \fB\fBReqOffset\fR\fR
371 This field is a Solaris-specific extension that can be used by clients to
372 generate optimum window offsets passed to \fBcsx_MapMemPage\fR(9F).
379 \fB\fBCS_SUCCESS\fR\fR
382 Successful operation.
388 \fB\fBCS_BAD_ATTRIBUTE\fR\fR
391 \fBAttributes\fR are invalid.
397 \fB\fBCS_BAD_SPEED\fR\fR
406 \fB\fBCS_BAD_HANDLE\fR\fR
409 Client handle is invalid.
415 \fB\fBCS_BAD_SIZE\fR\fR
418 Window size is invalid.
424 \fB\fBCS_NO_CARD\fR\fR
427 No \fBPC \fRCard in socket.
433 \fB\fBCS_OUT_OF_RESOURCE\fR\fR
436 Unable to allocate window.
442 \fB\fBCS_UNSUPPORTED_FUNCTION\fR\fR
445 No \fBPCMCIA \fRhardware installed.
451 These functions may be called from user or kernel context.
455 \fBcsx_ConvertSpeed\fR(9F), \fBcsx_MapMemPage\fR(9F),
456 \fBcsx_ModifyWindow\fR(9F), \fBcsx_RegisterClient\fR(9F),
457 \fBcsx_RequestConfiguration\fR(9F)
460 \fIPC\fR \fICard\fR \fI95\fR \fIStandard,\fR PCMCIA/JEIDA