/*
* 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 2006 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
/*
* gldpriv.h - Private interfaces/structures needed by gld.c
*
* The definitions in this file are private to GLD and may change at any time.
* They must not be used by any driver.
*/
#ifndef _SYS_GLDPRIV_H
#define _SYS_GLDPRIV_H
#pragma ident "%Z%%M% %I% %E% SMI"
#ifdef __cplusplus
extern "C" {
#endif
#ifdef DEBUG
#endif
/*
* The version number should not be changed.
*/
/* gld_global_options bits */
/* gld per instance options */
/*
* This version of GLD allows a "Virtual-LAN-PPA" to be specified in
* the same manner as Cassini: the virtual PPA number is composed of
* the VLAN tag number (1-4094), multiplied by 1000(!), plus the real
* (hardware) PPA. Thus "bge23001" refers to the "device" which
* transports packets with tag VLAN "23" over the hardware of "bge1".
*
* This scheme limits the number of physical devices of a single type to
* 1000 e.g. bge0 .. bge999 (since bge1000 would instead be interpreted
* as VLAN1 over bge0).
*/
/*
* Minor numbers:
*
* For each device type, GLD creates a single "style 2" node with minor 0.
* For each instance of that device type, GLD also creates a "style 1"
* node with minor number one greater than the PPA. Thus, nodes with
* minor numbers 0..1000 may exist in the /dev* filesystem.
*
* So, on open:
*
* Minor 0 implies DLPI "style 2": the STREAM is not intrinsically
* (and may be changed) dynamically, by DLPI_ATTACH/DETACH messages.
*
* Minors 1..1000 are "style 1", where the PPA is entirely defined by
* the minor; GLD defines the mapping as PPA=minor-1 (minor=PPA+1).
* Note that the upper bound of 1000 is (now) limited by the VLAN
* mapping scheme set out above.
*
* GLD devices are "self-cloning": each new open will cause a new minor
* number to be allocated; these are selected from the range 1001..0x3ffff.
* This minor number is only associated with the open stream and doesn't
* appear in the /dev* filesystem; manually created nodes with minors in
* this range will be rejected by gld_open().
*/
#define GLD_USE_STYLE2 0
/* gldm_GLD_flags */
/* This is the largest macaddr currently supported by GLD */
/* multicast structures */
typedef struct gld_multicast_addr {
/* to this per-mac entry */
} gld_mcast_t;
/* gld_flag bits -- GLD PRIVATE */
/*
* gld structure. Used to define the per-stream information required to
* implement DLPI.
*/
typedef struct gld {
void *gld_vlan;
int (*gld_send)();
} gld_t;
/*
* definitions for the per driver class structure
*/
typedef struct glddevice {
/* style 2 streams */
int gld_minsdu;
int gld_maxsdu;
} glddev_t;
typedef struct pktinfo {
} pktinfo_t;
/*
* Flags input to the gld_interpret_*() interpreter routines.
*/
typedef enum packet_flag {
/*
* Flags input to the gld_interpret_mdt_*() interpreter routines.
*/
typedef enum mdt_packet_flag {
/*
* Describes characteristics of the Media Access Layer.
* The mtu_size is the size of the largest frame.
* The interpreter is the function that "knows" how to interpret the frame.
*/
typedef struct {
int hdr_size;
char *mac_string;
/*
* structure for names stat structure usage as required by "netstat"
*/
typedef union media_kstats {
struct dot3kstat {
} dot3;
struct dot5kstat {
} dot5;
struct fddikstat {
} fddi;
struct gldkstats {
/* control */
};
typedef struct gld_vlan {
int gldv_nstreams;
/* The number of streams that are in promiscous mode */
/* The number of streams that are interested in VLAN tagged packets. */
} gld_vlan_t;
/* Per-mac info used by GLD */
struct gld_mac_pvt {
};
/* return values from gld_cmds */
/* caller argument to gld_start */
#define GLD_WPUT 0
/*
* definitions for debug tracing
*/
/*
* Lock manipulation macros for GLDM_LOCK. Conceptually, the
* GLD layer treats the lock as a rw lock; for v0 binary and
* semantic compatibility, the underlying implementation still
* uses a mutex, whereas for v2 drivers, the more scalable rwlock
* is used instead. See notes in gld.h.
*/
}
/* lock held in read or write mode? */
/* lock held in write mode? */
/*
* Note that unlike bcmp, we return zero if they are different.
*/
else \
mac_copy((a), (b), (l)); \
}
/*
* Macros to access possibly-unaligned variables
*/
#if (_ALIGNMENT_REQUIRED == 0)
#else /* ALIGNMENT_REQUIRED */
}
#if defined(_LITTLE_ENDIAN)
#elif defined(_BIG_ENDIAN)
#else /* unknown endian */
#error "what endian is this machine?"
#endif /* endian */
#endif /* ALIGNMENT_REQUIRED */
/* ================================================================ */
/* Route Determination Entity definitions (IEEE 802.2 1994 edition) */
/* ================================================================ */
struct rde_pdu {
};
/* ============================================================= */
/* Source Routing fields and definitions (IEEE 802.2 and 802.1D) */
/* ============================================================= */
/*
* Source Routing Route Information field.
*/
struct gld_ri {
#if defined(_BIT_FIELDS_LTOH)
#elif defined(_BIT_FIELDS_HTOL)
struct tr_rd { /* route designator fields */
} rd[MAX_RDFLDS];
#else
#error "which way do bit fields get allocated?"
#endif
};
/*
* Source route table info
*/
struct srtab {
};
/* ================================================================= */
/* Media dependent defines for media dependent routines in gldutil.c */
/* ================================================================= */
/*
* Some "semi-generic" defines used by ether, token, and fddi,
* and probably anything else with addrlen == 6 && saplen == -2.
*/
struct gld_dlsap {
unsigned short glda_sap;
};
struct llc_snap_hdr {
};
/* ======================== */
/* FDDI related definitions */
/* ======================== */
struct fddi_mac_frm {
};
/* ============================== */
/* Token Ring related definitions */
/* ============================== */
struct tr_mac_frm_nori {
};
struct tr_mac_frm {
};
/*
* Note that the pad field is used to save the value of tci.
*/
void gld_init_ether(gld_mac_info_t *);
void gld_init_fddi(gld_mac_info_t *);
void gld_init_tr(gld_mac_info_t *);
void gld_init_ib(gld_mac_info_t *);
void gld_uninit_ether(gld_mac_info_t *);
void gld_uninit_fddi(gld_mac_info_t *);
void gld_uninit_tr(gld_mac_info_t *);
void gld_uninit_ib(gld_mac_info_t *);
#ifdef __cplusplus
}
#endif
#endif /* _SYS_GLDPRIV_H */