/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (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 2005 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
/*
* PCMCIA nexus
*/
#ifndef _PCMCIA_H
#define _PCMCIA_H
#pragma ident "%Z%%M% %I% %E% SMI"
#ifdef __cplusplus
extern "C" {
#endif
#if defined(DEBUG)
#define PCMCIA_DEBUG
#endif
/*
*/
/*
* private interface between nexus and adapter specific driver
* This is only an "ops" type structure
*/
typedef struct pcmcia_if {
int (*pcif_set_callback)();
int (*pcif_get_adapter)();
int (*pcif_get_page)();
int (*pcif_get_socket)();
int (*pcif_get_status)();
int (*pcif_get_window)();
int (*pcif_inquire_adapter)();
int (*pcif_inquire_socket)();
int (*pcif_inquire_window)();
int (*pcif_reset_socket)();
int (*pcif_set_page)();
int (*pcif_set_window)();
int (*pcif_set_socket)();
int (*pcif_set_interrupt)();
int (*pcif_clr_interrupt)();
int (*pcic_init_dev)();
} pcmcia_if_t;
/*
* magic number and version information to identify
* variant of the PCMCIA nexus.
*/
/*
* all adapter drivers use a commonly defined structure for
* their private data. This structure must be filled in
* and set. The an_private member is for the driver writer's
* use and is not looked at by the nexus.
*/
struct pcmcia_adapter_nexus_private {
void *an_private;
};
struct pcm_regs {
};
/*
* shared interrupts are handled by the
* nexus going through the list
*/
typedef struct inthandler {
int flags;
unsigned handler_id;
void *arg1;
void *arg2;
unsigned socket;
unsigned irq;
unsigned priority;
} inthandler_t;
/*
* parent private data area
* not using the old style but will adapt on request
* this allows better framework handling and 1275 compliance
*/
struct pcmcia_parent_private {
};
/*
* macros to make indirect functions easier
* and shorter (makes cstyle happier)
*/
sock)
typedef struct pcmcia_cs {
int (*pccs_callback)();
int (*pccs_getconfig)();
} pcmcia_cs_t;
/* properties used by the nexus for setup */
/*
* per adapter structure
* this structure defines everything necessary for the
* the nexus to interact with the adapter specific driver
*/
struct pcmcia_adapter {
void *pca_power;
int pca_numpower;
int pca_numsockets;
int pca_first_socket;
};
typedef struct pcmcia_logical_window {
int lw_len;
/*
* management interface hook
*/
struct pcmcia_mif {
void (*mif_function)();
};
/* socket bit map */
/*
* Max resoruce limits - all of these have to be power-of-2 aligned
* and the PR_MAX_IO_LEN and PR_MAX_MEM_LEN values must be at
* least 64 or the allocators will panic.
*/
/*
* structures and definitions used in the private interface
*/
/* general values */
#define PC_FAILURE 0
/* set_mem() */
#define PC_MEM_AM 0
/* device classes */
#define PCC_MULTI 0
/*
* device information structure information
* this is what is used for initial construction of a device node
*/
struct pcm_device_info {
int pd_socket;
int pd_function;
int pd_type;
};
typedef
struct init_dev {
int socket;
} init_dev_t;
/*
* device descriptions
* used to determine what driver to associate with a PC Card
* so that automatic creation of device information trees can
* be supported.
*/
typedef
struct pcm_device_node {
int pd_flags;
int pd_funcid;
int pd_manfid;
int pd_manmask;
/* property names */
/* 1275 specific properties */
/* basic device types */
#define PCM_TYPE_MULTI 0
typedef
struct string_to_int {
char *sti_str;
} str_int_t;
/*
*/
/* SS is temporary until design done */
/* stuff that used to be in obpdefs.h but no longer */
/*
* new regspec and other 1275 stuff
*/
/* solaris internal only */
/* solaris internal only */
PC_REG_RELOC(n) | \
PC_REG_PREFETCH(p) | \
PC_REG_TYPE(t) | \
PC_REG_SPACE(c) | \
PC_REG_SOCKET(s) | \
PC_REG_FUNCTION(f) | \
PC_REG_BASEREG(r))
#define PC_REG_TYPE_CARDBUS 0
/*
* internal properties and other prop_op defines
*/
/* specific known properties */
#ifdef __cplusplus
}
#endif
#endif /* _PCMCIA_H */