CSX_REQUESTWINDOW(9F) | Kernel Functions for Drivers | CSX_REQUESTWINDOW(9F) |
csx_RequestWindow, csx_ReleaseWindow - request or release window resources
#include <sys/pccard.h> int32_t csx_RequestWindow(client_handle_t ch, window_handle_t *wh,
win_req_t *wr);
int32_t csx_ReleaseWindow(window_handle_t wh);
illumos DDI Specific (illumos DDI)
ch
wh
wr
The function csx_RequestWindow() requests a block of system address space be assigned to a PC Card in a socket.
The function csx_ReleaseWindow() releases window resources which were obtained by a call to csx_RequestWindow(). No adapter or socket hardware is modified by this function.
The csx_MapMemPage(9F) and csx_ModifyWindow(9F) functions use the window handle returned by csx_RequestWindow(). This window handle must be freed by calling csx_ReleaseWindow() when the client is done using this window.
The PC Card Attribute or Common Memory offset for this window is set by csx_MapMemPage(9F).
The structure members of win_req_t are:
uint32_t Socket; /* socket number */ uint32_t Attributes; /* window flags */ uint32_t Base.base; /* requested window */
/* base address */ acc_handle_t Base.handle; /* returned handle for
/* base of window */ uint32_t Size; /* window size requested */
/* or granted */ uint32_t win_params.AccessSpeed; /* window access speed */ uint32_t win_params.IOAddrLines; /* IO address lines decoded */ uint32_t ReqOffset; /* required window offest */
The fields are defined as follows:
Socket
Attributes
WIN_MEMORY_TYPE_IO
WIN_MEMORY_TYPE_CM
WIN_MEMORY_TYPE_AM
WIN_ENABLE
WIN_ACC_BIG_ENDIAN
WIN_ACC_LITTLE_ENDIAN
WIN_ACC_NEVER_SWAP
The ability to specify the order in which the CPU will reference data is provided by the following Attributes bits, only one of which may be specified:
WIN_ACC_STRICT_ORDER
WIN_ACC_UNORDERED_OK
WIN_ACC_MERGING_OK
WIN_ACC_LOADCACHING_OK
WIN_ACC_STORECACHING_OK
These values are advisory, not mandatory. For example, data can be ordered without being merged or cached, even though a driver requests unordered, merged and cached together.
All other bits in the Attributes field must be set to 0.
On successful return from csx_RequestWindow(), WIN_OFFSET_SIZE is set in the Attributes field when the client must specify card offsets to csx_MapMemPage(9F) that are a multiple of the window size.
Base.base
Base.handle
Size
win_params.AccessSpeed
Code | Speed |
0 | (Reserved - do not use). |
1 | 250 nsec |
2 | 200 nsec |
3 | 150 nsec |
4 | 100 nse |
5-7 | (Reserved—do not use.) |
To request a window that supports the WAIT signal, OR-in the WIN_USE_WAIT bit to the AccessSpeed value before calling this function.
It is recommended that clients use the csx_ConvertSpeed(9F) function to generate the appropriate AccessSpeed values rather than manually perturbing the AccessSpeed field.
win_params.IOAddrLines
ReqOffset
CS_SUCCESS
CS_BAD_ATTRIBUTE
CS_BAD_SPEED
CS_BAD_HANDLE
CS_BAD_SIZE
CS_NO_CARD
CS_OUT_OF_RESOURCE
CS_UNSUPPORTED_FUNCTION
These functions may be called from user or kernel context.
csx_ConvertSpeed(9F), csx_MapMemPage(9F), csx_ModifyWindow(9F), csx_RegisterClient(9F), csx_RequestConfiguration(9F)
PC Card 95 Standard, PCMCIA/JEIDA
July 19, 1996 | OmniOS |