Kernel Functions for Drivers csxRequestWindow(9F)
NAME
csxRequestWindow, csxReleaseWindow - request or release
window resources
SYNOPSIS
#include
int32t csxRequestWindow(clienthandlet ch, windowhandlet *wh,
winreqt *wr);
int32t csxReleaseWindow(windowhandlet wh);
INTERFACE LEVEL
Solaris DI Specific (Solaris DI)
PARAMETERS
ch Client handle returned from csxRegisterClient(9F).
wh Pointer to a windowhandlet structure.
wr Pointer to a winreqt structure.
DESCRIPTION
The function csxRequestWindow() requests a block of system
address space be assigned to a PC Card in a socket.
The function csxReleaseWindow() releases window resources
which were obtained by a call to csxRequestWindow(). No
adapter or socket hardware is modified by this function.
The csxMapMemPage(9F) and csxModifyWindow(9F) functions
use the window handle returned by csxRequestWindow(). This
window handle must be freed by calling csxReleaseWindow()
when the client is done using this window.
The PC Card Attribute or Common Memory offset for this win-
dow is set by csxMapMemPage(9F).
STRUCTURE MEMBERS
The structure members of winreqt are:
uint32t Socket; /* socket number */
SunOS 5.11 Last change: 19 Jul 1996 1
Kernel Functions for Drivers csxRequestWindow(9F)
uint32t Attributes; /* window flags */
uint32t Base.base; /* requested window */
/* base address */
acchandlet Base.handle; /* returned handle for
/* base of window */
uint32t Size; /* window size requested */
/* or granted */
uint32t winparams.AccessSpeed; /* window access speed */
uint32t winparams.IOAddrLines; /* IO address lines decoded */
uint32t ReqOffset; /* required window offest */
The fields are defined as follows:
Socket Not used in Solaris, but for por-
tability with other Card Services
implementations, it should be set
to the logical socket number.
Attributes This field is bit-mapped and is
defined as follows:
WINMEMORYTYPEIO
Points to I/O space.
WINMEMORYTYPECM
Points to common memory space.
WINMEMORYTYPEAM
These bits select which type
of window is being requested.
One of these bits must be set.
WINENABLE
The client must set this bit
to enable the window.
WINACBIGENDIAN
Describes device as big-
endian.
SunOS 5.11 Last change: 19 Jul 1996 2
Kernel Functions for Drivers csxRequestWindow(9F)
WINACLITLENDIAN
These bits describe the endian
characteristics of the device
as big endian or little
endian, respectively. Even
though most of the devices
will have the same endian
characteristics as their
busses, there are examples of
devices with an I/O processor
that has opposite endian
characteristics of the busses.
When either of these bits are
set, byte swapping will
automatically be performed by
the system if the host machine
and the device data formats
have opposite endian charac-
teristics. The implementation
may take advantage of hardware
platform byte swapping capa-
bilities.
WINACNEVERSWAP
When this is specified, byte
swapping will not be invoked
in the data access functions.
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:
WINACSTRICTORDER
The data references must be
issued by a CPU in program
order. Strict ordering is the
default behavior.
WINACUNORDEREDOK
The CPU may re-order the data
references. This includes all
kinds of re-ordering (that is,
a load followed by a store may
be replaced by a store
SunOS 5.11 Last change: 19 Jul 1996 3
Kernel Functions for Drivers csxRequestWindow(9F)
followed by a load).
WINACMERGINGOK
The CPU may merge individual
stores to consecutive loca-
tions. For example, the CPU
may turn two consecutive byte
stores into one halfword
store. It may also batch indi-
vidual loads. For example, the
CPU may turn two consecutive
byte loads into one halfword
load. This bit also implies
re-ordering.
WINACLOADCACHINGOK
The CPU may cache the data it
fetches and reuse it until
another store occurs. The
default behavior is to fetch
new data on every load. This
bit also implies merging and
re-ordering.
WINACSTORECACHINGOK
The CPU may keep the data in
the cache and push it to the
device (perhaps with other
data) at a later time. The
default behavior is to push
the data right away. This bit
also implies load caching,
merging, and re-ordering.
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
csxRequestWindow(),
SunOS 5.11 Last change: 19 Jul 1996 4
Kernel Functions for Drivers csxRequestWindow(9F)
WINOFSETSIZE is set in the
Attributes field when the client
must specify card offsets to
csxMapMemPage(9F) that are a mul-
tiple of the window size.
Base.base This field must be set to 0 on
calling csxRequestWindow().
Base.handle On successful return from
csxRequestWindow(), the
Base.handle field contains an
access handle corresponding to the
first byte of the allocated memory
window which the client must use
when accessing the PC Card's
memory space via the common access
functions. A client must not make
any assumptions as to the format
of the returned Base.handle field
value.
Size On calling csxRequestWindow(),
the Size field is the size in
bytes of the memory window
requested. Size may be zero to
indicate that Card Services should
provide the smallest sized window
available. On successful return
from csxRequestWindow(), the Size
field contains the actual size of
the window allocated.
winparams.AccessSpeed This field specifies the access
speed of the window if the client
is requesting a memory window. The
AccessSpeed field bit definitions
use the format of the extended
speed byte of the Device ID tuple.
If the mantissa is 0 (noted as
reserved in the PC Card 95 Stan-
dard), the lower bits are a binary
code representing a speed from the
following table:
SunOS 5.11 Last change: 19 Jul 1996 5
Kernel Functions for Drivers csxRequestWindow(9F)
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
WINUSEWAIT bit to the AccessSpeed value before calling
this function.
It is recommended that clients use the csxConvertSpeed(9F)
function to generate the appropriate AccessSpeed values
rather than manually perturbing the AccessSpeed field.
winparams.IOAddrLines If the client is requesting an I/O
window, the IOAddrLines field is
the number of I/O address lines
decoded by the PC Card in the
specified socket. Access to the
I/O window is not enabled until
csxRequestConfiguration(9F) has
been invoked successfully.
ReqOffset This field is a Solaris-specific
extension that can be used by
clients to generate optimum window
offsets passed to
csxMapMemPage(9F).
RETURN VALUES
CSUCES Successful operation.
CSBADATRIBUTE Attributes are invalid.
SunOS 5.11 Last change: 19 Jul 1996 6
Kernel Functions for Drivers csxRequestWindow(9F)
CSBADSPED Speed is invalid.
CSBADHANDLE Client handle is invalid.
CSBADSIZE Window size is invalid.
CSNOCARD No PC Card in socket.
CSOUTOFRESOURCE Unable to allocate window.
CSUNSUPORTEDFUNCTION No PCMCIA hardware installed.
CONTEXT
These functions may be called from user or kernel context.
SEE ALSO
csxConvertSpeed(9F), csxMapMemPage(9F),
csxModifyWindow(9F), csxRegisterClient(9F),
csxRequestConfiguration(9F)
PC Card 95 Standard, PCMCIA/JEIDA
SunOS 5.11 Last change: 19 Jul 1996 7
|