/*
* CDDL HEADER START
*
* 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.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* 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]
*
* CDDL HEADER END
*/
/*
* Copyright 2008 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#ifndef _CS_H
#define _CS_H
#ifdef __cplusplus
extern "C" {
#endif
/*
* PCMCIA Card Services header file
*/
/*
* XXX - This define really should be in a global header file
* somewhere; we do this stunt here since a lot of
* people include this header file but not necessarily
* the header file in which this is defined.
*/
#ifndef _VERSION
#endif
/*
* Define this version of CS - this should correspond to the PCMCIA
* version number specified in the PCMCIA standard.
*/
/*
* CS_INTERNAL_REVISION_LEVEL is our internal revision level value returned
* via GetCardServicesInfo in get_cardservices_info_t->Revision
*/
"Copyright 2008 Sun Microsystems, Inc. All rights reserved.\n" \
"Use is subject to license terms.\n" \
"@(#)cs.h 1.69 08/10/17 SMI\n" \
"Based on the PC Card Standard, February 1995\n"
/*
* typedef for function pointers to quiet lint and cc -v
*/
/*
* CS_SUN_VENDOR_DESCRIPTION - can be returned by clients handling
* the CS_EVENT_CLIENT_INFO event in the
* client_info_t->VendorName member.
*/
/*
* Return codes from Card Services - these correspond to the PCMCIA
* standard and also include some implementation-specific return
* codes.
*/
/* RESERVED - 0x05 */
/* RESERVED - 0x0c */
/* RESERVED - 0x13 */
/*
* The following are Solaris-specific extended return codes
*/
/*
* Card Services event codes - these do NOT correspond to the PCMCIA
* standard event codes for CS since these events are encoded as
* bit flags, while the PCMCIA standard event codes are encoded
* as numerical values. In practice, this shouldn't be a problem
* since no one should be looking at the absolute value of the
* event codes; these defines should be used.
*
* The numerical value of an event code determines in what order a client
* will receive the event if other events are also pending for that
* client. XXX - need to make event_t a 64-bit field.
*
* Card Services receives these events from Socket Services or by reading
* the card's Pin Replacement Register. In either case, the client
* always gets the same type of notification.
*/
/*
* The CS_EVENT_SS_UPDATED event is generated when Socket Services
* has completed parsing the CIS and has done any necessary
* work to get the client driver loaded and attached.
*/
/*
* The CS_EVENT_STATUS_CHANGE event is generated by a Socket Services
* PCE_CARD_STATUS_CHANGE event; this event gets converted to
* the appropriate Card Services events when Card Services
* reads the PRR.
*/
/*
* The CS_EVENT_CARD_REMOVAL is the last "real" CS event and must
* have the highest value of all "real" CS events so that this
* event is handed to the client after all other queued events
* have been processed.
* If the client has set the CS_EVENT_CARD_REMOVAL_LOWP flag in
* either of their event masks, then they will also receive
* a CS_EVENT_CARD_REMOVAL at low (cs_event_thread) priority;
* in this low priority removal event, the client can call
* many CS functions that they can't call when they recieve
* the high priority removal event.
*/
/*
* The following are not events but they share the event flags field
* and are used internally by CS. These bit patterns will never
* be seen by clients.
* CS_EVENT_ALL_CLIENTS can only be set by the super-client and by
* the CSI clients; setting this bit causes the driver to
* receive any events specified in their event masks whenever
* any such events occur on the socket.
* CS_EVENT_READY_TIMEOUT is a CS-private flag and should never be
* set by clients.
*/
/*
* CS_EVENT_CLIENT_EVENTS_MASK is a msk of events that only the framework
* is allowed to manipulate.
*/
/*
* client_info_t structure used by clients for a CS_EVENT_CLIENT_INFO
* event and for the GetClientInfo function.
*/
typedef struct client_info_t {
/*
* Flags for client_info_t->Attributes
*
* The low order byte bit values are used to return the data passed
* in to RegisterClient in the client_reg_t->Attributes member.
*/
/*
* Control and status flags.
*/
/*
* Client Info subservice flags and types.
*/
/*
* CS_CLIENT_INFO_MAKE_DATE - Macro to make constructing the
* client_info_t->RevDate member easier. Parameters are:
*
* day - from 1 to 31
* month - from 1 to 12
* year - year relative to 1980
* 00 - 1980
* 06 - 1986
* 12 = 1992
* 16 - 1996, etc...
*/
(((m) & 0x0f) << 5) | \
(((y) & 0x7f) << 9))
/*
* get_firstnext_client_t_t structure used for GetFirstClient and GetNextClient
*/
typedef struct get_firstnext_client_t {
/*
* Flags for get_firstnext_client_t->Attributes
*/
/*
* The client event callback argument structure - this is passed in to
* the client event handler. Most of these arguments are identical
* to the PCMCIA-specified arguments.
*/
typedef struct event_callback_args_t {
void *info;
void *mtdrequest;
void *buffer;
void *misc;
void *client_data;
/*
* Event priority flag passed to the client's event handler; the client
* uses this priority to determine which mutex to use.
*/
/*
* Event-specific event_callback_args_t->info values
*
* CS_EVENT_WRITE_PROTECT
* CS_EVENT_WRITE_PROTECT_WPOFF - card is not write protected
* CS_EVENT_WRITE_PROTECT_WPON - card is write protected
*/
/*
* Endinanness and data ordering Attribute bits common to both R2 and
* CardBus windows and common to RequestIO, RequestWindow and
* DupHandle.
*/
/*
* io_req_t structure used for RequestIO and ReleaseIO
*/
typedef struct io_req_t {
} io_req_t;
/*
* Flags for RequestIO and ReleaseIO
*/
/*
* The following flags are included for compatability with other versions of
* Card Services, but they are not implemented in this version. They
* are assigned values as placeholders only. If any of these flags
* are set on a call to RequestIO, CS_BAD_ATTRIBUTE is returned.
*/
/*
* The following flags are private to Card Services and should never be set
* by a client. Doing so will cause the system to take a supervisor
* trap at level twenty-nine.
*/
/*
* win_req_t structure used for RequestWindow
*
* Note that the ReqOffset member is not defined in the current PCMCIA
* spec but is included here to aid clients in determining the
* optimum offset to give to MapMemPage.
*/
typedef struct win_req_t {
union {
} Base;
union {
} win_params;
} win_req_t;
/*
* modify_win_t structure used for ModifyWindow
*/
typedef struct modify_win_t {
} modify_win_t;
/*
* Flags for RequestWindow and ModifyWindow
*/
/*
* The following flag is used internally by Card Services and should never
* be set by the caller.
*/
/*
* The following flags are included for compatability with other versions of
* Card Services, but they are not implemented in this version. They
* are assigned values as placeholders only. If any of these flags
* are set on a call to RequestWindow, CS_BAD_ATTRIBUTE is returned.
*/
/*
* The following flag is actually part of the AccessSpeed member
*/
/*
* client_reg_t structure for RegisterClient
*/
typedef struct client_reg_t {
/* DDI support */
/* CS private */
} client_reg_t;
/*
* Flags for RegisterClient - some of these flags are also used internally
* by CS to sequence the order of event callbacks and to allow Socket
* Services to register as a "super" client.
*
* The client_reg_t->Attributes structure member uses these flags.
*
* The client_info_t->Attributes, client_types_t->type and client_t->flags
* tructure members use these flags as well.
*
* Client types - mutually exclusive.
*/
INFO_IO_CLIENT | \
INFO_MTD_CLIENT | \
INFO_MEM_CLIENT | \
/*
* The following two are for backwards-compatability with the PCMCIA spec.
* We will give the client CARD_INSERTION and REGISTRATION_COMPLETE
* if either of these two bits are set. Normally, all IO and MEM
* clients should set both of these bits.
*/
/*
* tuple_t struct used for GetFirstTuple, GetNextTuple, GetTupleData
* and ParseTuple
*
* Note that the values for DesiredTuple are defined in the cis.h header
* file.
*/
typedef struct tuple_t {
/* tuple body data buffer */
} tuple_t;
/*
* Attribute flags definitions for CS tuple functions.
*
*/
/*
* cisinfo_t structure used for ValidateCIS
*/
typedef struct cisinfo_t {
} cisinfo_t;
/*
* map_mem_page_t structure used for MapMemPage
*/
typedef struct map_mem_page_t {
/*
* sockevent_t structure used for GetEventMask and SetEventMask
*/
typedef struct sockevent_t {
} sockevent_t;
/*
* request_socket_mask_t structure used for RequestSocketMask
*/
typedef struct request_socket_mask_t {
/*
* release_socket_mask_t structure used for ReleaseSocketMask
*/
typedef struct release_socket_mask_t {
/*
* Flags for GetEventMask and SetEventMask
*/
/*
* convert_speed_t structure used for ConvertSpeed
*/
typedef struct convert_speed_t {
/*
* Flags for ConvertSpeed
*/
/*
* convert_size_t structure used for ConvertSize
*/
typedef struct convert_size_t {
/*
* Flags for ConvertSize
*/
/*
* event2text_t structure used for Event2Text
*/
typedef struct event2text_t {
/* buffer to return text strings */
} event2text_t;
/*
* error2text_t structure used for Error2Text
*/
typedef struct error2text_t {
} error2text_t;
/*
* get_status_t structure used for GetStatus
*
* The values in the status members are the same as the CS_EVENT_XXX values.
*/
typedef struct get_status_t {
} get_status_t;
/*
* GetStatus returns card state using the same bit definitions
* as the CS_EVENT_XXX bits. Some of the CS_EVENT_XXX bits
* are not meaningful for GetStatus and are reused here for
* status definitions.
*
* get_status_t->CardState and get_status_t->raw_CardState bits
*/
/*
* get_status_t->SocketState bits
*/
/*
* map_log_socket_t structure used for MapLogSocket
*/
typedef struct map_log_socket_t {
/*
* get_physical_adapter_info_t structure used for GetPhysicalAdapterInfo
*/
typedef struct get_physical_adapter_info_t {
/*
* irq_req_t structure used for RequestIRQ and ReleaseIRQ
*/
typedef struct irq_req_t {
void *irq_handler_arg;
} irq_req_t;
/*
* Flags for RequestIRQ and ReleaseIRQ
*/
/*
* The following flags are included for compatability with other versions of
* Card Services, but they are not implemented in this version. They
* are assigned values as placeholders only. If any of these flags
* are set on a call to RequestIRQ, CS_BAD_ATTRIBUTE is returned.
*/
/*
* release_config_t structure used for ReleaseConfiguration
*/
typedef struct release_config_t {
/*
* config_req_t structure used for RequestConfiguration
*/
typedef struct config_req_t {
} config_req_t;
/*
* Flags for RequestConfiguration - note that the CONF_ENABLE_IRQ_STEERING
* flag shares the same bit field as the Attributes flags for
* ModifyConfiguration.
*/
/*
* The following flags are used for the IntType member to specify which
* type of socket interface the client wants.
*/
/*
* The following flags are used for the Present member to specify which
* configuration registers are present. They may also be used by
* clients for their internal state.
*/
/*
* CONFIG_IOBASE_REG_MASK - mask of IO Base Port register present bits
* CONFIG_IOBASE_REG_SHIFT - shifts IO Base Port register present bits
*/
/*
* Bit definitions for configuration registers.
*
* Pin Replacement Register (PRR) bits - these are used for calls to
* RequestConfiguration, AccessConfigurationRegister and
* GetConfigurationInfo, as well as internally by clients
* and Card Services.
* To inform Card Services that a particular bit in the PRR is valid on
* a call to RequestConfiguration, both the XXX_STATUS and the
* XXX_EVENT bits must be set.
*/
/*
* Configuration Option Register (COR) bits
*/
/*
* Card Configuration Status Register (CCSR)
*/
/*
* Macros to manipulate the Socket and Copy Register (SCR) values
*/
/*
* modify_config_t structure used for ModifyConfiguration
*/
typedef struct modify_config_t {
/*
* Flags for ModifyConfiguration - note that the CONF_ENABLE_IRQ_STEERING
* flag used with RequestConfiguration shares this bit field.
*/
/*
* access_config_reg_t structure used for AccessConfigurationRegister
*/
typedef struct access_config_reg_t {
/*
* Flags for AccessConfigurationRegister
*/
/*
* The following offsets are used to specify the configuration register
* offset to AccessConfigurationRegister
*/
/*
* reset_function_t structure used for ResetFunction
*/
typedef struct reset_function_t {
/*
* get_cardservices_info_t structure used for GetCardServicesInfo
*/
typedef struct get_cardservices_info_t {
/*
* get_configuration_info_t structure used by GetConfigurationInfo
*/
typedef struct get_configuration_info_t {
/*
* devnode_desc_t structure used in make_device_node_t and remove_device_node_t
* for MakeDeviceNode and RemoveDeviceNode
*/
typedef struct devnode_desc_t {
/*
* make_device_node_t structure used for MakeDeviceNode
*/
typedef struct make_device_node_t {
/*
* Action values for MakeDeviceNode
*/
/*
* remove_device_node_t structure used for RemoveDeviceNode
*/
typedef struct remove_device_node_t {
/*
* Action values for RemoveDeviceNode
*
* Note: The "Action" member for make_device_node_t and remove_device_node_t
* share the same set of values.
*/
/*
* cs_ddi_info_t for CS_DDI_Info
*/
typedef struct cs_ddi_info_t {
/*
* cs_sys_ctl_t for CS_Sys_Ctl
*/
typedef struct cs_sys_ctl_t {
} cs_sys_ctl_t;
/*
* cs_sys_ctl_t->Action defines
*
* CS_SYS_CTL_SEND_EVENT - send events in cs_sys_ctl_t->Events to clients
*/
/*
* cs_sys_ctl_t->Flags defines
*
* CS_SYS_CTL_WAIT_SYNC - wait for operation to complete, otherwise
* return immediately
* CS_SYS_CTL_EVENT_SOCKET - send events to all clients on specified
* socket
* CS_SYS_CTL_EVENT_CLIENT - send events to client specified by
* cs_sys_ctl_t->client_handle
*/
/*
* Autoincrement control flags for RepPut8, RepPut16, RepPut32, RepPut32,
* RepGet8, RepGet16, RepGet32, RepGet64
*/
/*
* Card Services function prototypes
*/
/*
* CIS tuple parsing functions
*/
cistpl_device_t *);
cistpl_device_t *);
cistpl_device_t *);
cistpl_format_t *);
cistpl_battery_t *);
uint32_t);
cistpl_spcl_t *);
cistpl_swil_t *);
cistpl_bar_t *);
/*
* Data access functions
*/
/*
* Data access handle manipulation functions
*/
/*
* XXX - PCMCIA Shady Meadows Retirement Community
*
* The defines in this section should be retired once the PS drivers
* get updated.
*
* XXX This is an old version of WIN_DATA_WIDTH_MASK and should be
* retired soon. RETIRE
*/
/*
* XXX The following are old versions of the IO_DATA_WIDTH_XXX names and
* should be retured soon. RETIRE
*/
/*
* XXX - REMOVAL_ALL_DEVICE_NODES typo, remove soon. RETIRE
*/
/*
* The old name of the csx_RequestSocketMask structure was
* sockmask_t for some bizzare reason. This typedef
* keeps that old name around until we can fix
* the drivers.
*/
/* XXX - RETIRE and change to a typedef XXX */
struct devnode_desc {
};
#ifdef __cplusplus
}
#endif
#endif /* _CS_H */