dman.h revision 03831d35f7499c87d51205817c93e9a8d42c4bae
/*
* 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 2001 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
/*
* ****** NOTICE **** This header file is maintained in the SMS gate,
* ****** NOTICE **** the ON gate, and the ssc driver gate. Any changes
* ****** NOTICE **** to it must also be made to in all gates.
*/
#ifndef _DMAN_H
#define _DMAN_H
#pragma ident "%Z%%M% %I% %E% SMI"
#ifdef __cplusplus
extern "C" {
#endif
/*
* Ethernet stuff
*/
#define ETHERHEADER_SIZE (sizeof (struct ether_header))
typedef struct ether_header ehdr_t;
typedef struct ether_addr eaddr_t;
#define IS_BROADCAST(eap) \
#define IS_MULTICAST(eap) \
#define IS_UNICAST(eap) \
/*
* Private DLPI full dlsap address format - stolen from eri.h
*/
typedef struct man_dladdr_s {
struct ether_addr dl_phys;
} man_dladdr_t;
#define MAN_MAX_EXPANDERS 18
#define TRUE 1
#define FALSE 0
/*
* Caller IDs for man_sendit processing decision on canput failure.
*/
#define MAN_UPPER 0x1
#define MAN_LOWER 0x2
/*
* MAN device information structure, one per man instance
*
* global list pointed to by MAN_XX_head
*/
typedef struct man_s {
int man_meta_ppa; /* mxx device minor */
int man_refcnt; /* DL_ATTACHes to us */
int man_suspended; /* DDI_SUSPEND on device */
int man_eaddr_v; /* ether addr valid */
/*
* Failover timers, used by man_dest_t.
*/
} man_t;
/*
* MAN link state definitions
*/
#define MAN_LINKUNKNOWN 0x0
#define MAN_LINKINIT 0x1
#define MAN_LINKGOOD 0x2
#define MAN_LINKSTALE 0x3
#define MAN_LINKFAIL 0x4
/*
* MAN timer types and times.
*/
#define MAN_TIMER_INIT 0x1
#define MAN_TIMER_LINKCHECK 0x2
#define MAN_TIMER_DLPIRESET 0x4
/*
* MAN DR variables
*/
/*
* Device info - this must stay 64 bit aligned.
*/
typedef struct md_s {
} man_dev_t;
/*
* mdev_state definitions
*/
/*
* MAN lower multiplexor data structure
*/
typedef struct man_dest_s {
int md_pg_id; /* pathgroup for destination */
int md_dlpistate; /* DLPI State of netdev below us */
int md_muxid; /* muxid of netdev linked below us */
void * md_switch_id; /* ID of switch request */
/*
* Failover variables, only valid for active path.
*/
int md_linkstate; /* link state */
int md_link_updown_msg; /* Last up/down message */
int md_dlpierrors; /* # of DLPI errors */
} man_dest_t;
/*
* md_state values
*/
/*
* md_link_updwon_msg states.
*/
/*
* Upper per-stream instance state information.
*
* Each instance is dynamically allocated at open() and free'd at close().
* Each per-stream instance points to at most one per-device structure
* using the ms_manp field. All instances are threaded together into one
* list of active instances ordered on sequence of opens.
*/
typedef struct manstr_s {
int ms_flags; /* State for this MAN upper stream */
int ms_minor; /* minor number of this stream */
int ms_dlpistate; /* DLPI State of this MAN instance */
int ms_meta_ppa; /* mxx device minor # */
} manstr_t;
/*
* ms_flags values.
*/
/*
* Paths in pathgroup lists.
*/
typedef struct mpa_s {
} man_path_t;
/*
* Pathgroup list, one per destination ID. Each pathgroup connects
* to one destination. Hence we put that destination ethernet address
* here. It is read from here and stored in man_dest_t.md_dst_eaddr
* each time a new path is switched to.
*/
typedef struct man_pg_s {
int mpg_flags;
} man_pg_t;
/*
* mpg_pg_flags fields.
*/
#define MAN_PG_IDLE 0x0
#define MAN_PG_SWITCHING 0x1
/*
* MAN IOCTL Definitions.
*/
/*
* Pathgroup assignment data structure - this must stay 64 bit aligned.
*/
typedef struct mi_path_t {
} mi_path_t;
/*
* Linkcheck time assignment data structure - this must stay 64 bit aligned.
*/
typedef struct mi_time_t {
} mi_time_t;
/*
* SC IP address assignment data structure. See man_pinger().
*/
typedef struct man_sc_ipaddrs_s {
/*
* SC IPv6 address assignment data structure. See man_pinger().
*/
typedef struct man_sc_ip6addrs_s {
/*
* Array of dests to apply operation to.
*/
typedef struct man_adest_s {
int a_man_ppa; /* man instance */
int a_pg_id; /* pg_id of dests */
} man_adest_t;
/*
* work structure for MAN background thread.
*/
typedef struct man_work_s {
int mw_type; /* work request type */
int mw_status; /* Status of work request */
} man_work_t;
/*
* Values for mw_flags
*/
#define MAN_WFLAGS_NOWAITER 0x0
#define MAN_WFLAGS_CVWAITER 0x1
#define MAN_WFLAGS_QWAITER 0x2
#define MAN_WFLAGS_DONE 0x4
/*
* Values for mw_type.
*/
#define MAN_MINPSZ (0) /* min packet size */
/*
* State definitions for man_config_state
*/
/*
* IOSRAM definitions
*/
#define MANC_VERSION 0x1
typedef struct manc_s {
int manc_ip_type; /* AF_INET or AF_INET6 */
} manc_t;
typedef struct man_mb_s {
typedef struct ml_s {
int l_muxid;
typedef struct man_workq_s {
} man_workq_t;
/*
* PCI stuff.
*/
/*
* Misc defines
*/
#define MAN_DDI_BUFLEN 128
#define MAN_DEVTYPE_PROP "device_type"
#define MAN_REG_PROP "reg"
#define MAN_PORTID_PROP "portid"
#define MAN_DEVTYPE_PCI "pci"
#define MAN_PCI_B_CSR_BASE 0x00700000
#define MAN_SCHIZO_MASK 0xF
#define MAN_SCHIZO_0_ID 0xC
/* ------------------------------------------------------------------------- */
/*
* Patchable debug flag.
* Set this to nonzero to enable error messages.
*/
/*
* The following parameters may be configured by the user. If they are not
* configured by the user, the values will be based on the capabilities of
* the transceiver.
* The value "MAN_NOTUSR" is ORed with the parameter value to indicate values
* which are NOT configured by the user.
*/
/* command */
#define MAN_ND_GET ND_GET
#define MAN_ND_SET ND_SET
#define MAN_NOTUSR 0x0f000000
#define MAN_MASK_1BIT 0x1
#define MAN_MASK_2BIT 0x3
#define MAN_MASK_8BIT 0xff
typedef struct param_s {
char *param_name;
} param_t;
#if defined(DEBUG)
#define MAN_INIT 0x00000001
#define MAN_OCLOSE 0x00000002
#define MAN_CONFIG 0x00000004
#define MAN_SWITCH 0x00000008
#define MAN_IOSRAM 0x00000010
#define MAN_LINK 0x00000020
#define MAN_PATH 0x00000040
#define MAN_DEST 0x00000080
#define MAN_KSTAT 0x00000100
#define MAN_KSTAT2 0x00000200
#define MAN_DDI 0x000001FF
#define MAN_UWPUT 0x00000400
#define MAN_LWPUT 0x00000800
#define MAN_LRPUT 0x00001000
#define MAN_LRPUT2 0x00002000
#define MAN_UWSRV 0x00004000
#define MAN_LWSRV 0x00008000
#define MAN_LRSRV 0x00010000
#define MAN_DATA 0x00020000
#define MAN_DLPI 0x00040000
#define MAN_STATE 0x00080000
#define MAN_WARN 0x00100000
#define MAN_KMEM 0x00200000
#define MAN_DR 0x00400000
#define MAN_ALL 0xFFFFFFFF
#else
#endif /* DEBUG */
#ifdef __cplusplus
}
#endif
#endif /* _DMAN_H */