pcgld.h revision 7c478bd95313f5f23a4c958a745db2134aa03244
/*
* 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.
*/
/*
* Warning - This file is not an approved Public Interface.
* It may change or disappear at any time.
*/
/*
* gld - a generic LAN driver support system for drivers using the DLPI
* interface.
*
* Copyrighted as an unpublished work. (c) Copyright 1992 Sun Microsystems, Inc.
* All rights reserved.
*/
#ifndef _SYS_PCMCIA_PCGLD_H
#define _SYS_PCMCIA_PCGLD_H
#pragma ident "%Z%%M% %I% %E% SMI"
#ifdef __cplusplus
extern "C" {
#endif
/*
* structure for driver statistics
*/
struct gld_stats {
/* controlled */
};
/*
* structure for names stat structure usage as required by "netstat"
*/
struct gldkstats {
/* control */
};
/* multicast structures */
typedef struct gld_multicast_addr {
int gldm_refcnt; /* number of streams referring */
/* to entry */
unsigned char gldm_addr[ETHERADDRL];
} gld_mcast_t;
/*
* gld_mac_info structure. Used to define the per-board data for all
* drivers.
*/
typedef
struct gld_mac_info {
/* PRIVATE */
/* PRIVATE */
/* UNUSED */
char *gldm_ident;
unsigned char gldm_macaddr[ETHERADDRL];
unsigned char gldm_vendor[ETHERADDRL];
unsigned char gldm_broadcast[ETHERADDRL];
int gldm_ppa; /* PPA number -- GLD PRIVATE */
/* shared ram */
/* mode--GLD PRIVATE */
/* DRIVER */
/* PRIVATE */
struct gld_stats gldm_stats;
/* DRIVER */
int (*gldm_reset)(); /* reset procedure */
int (*gldm_start)(); /* start board */
int (*gldm_stop)(); /* stop board completely */
int (*gldm_saddr)(); /* set physical address */
int (*gldm_send)(); /* transmit procedure */
int (*gldm_prom)(); /* set promiscuous mode */
int (*gldm_gstat)(); /* get board statistics */
int (*gldm_ioctl)(); /* Driver specific ioctls */
int (*gldm_sdmulti)(); /* set/delete multicast */
/* address */
/* gldm_GLD_flags */
/* flags for mac info (hardware) status */
/* PPA number mask */
#define GLD_PPA_MASK 0x3f
#define GLD_PPA_INIT 0x40
#define GLD_USE_STYLE2 0
/* GLD Options */
/*
* gld structure. Used to define the per-stream information required to
* implement DLPI.
*/
typedef struct gld {
/* stream */
/* enabled */
struct gld_mac_info *gld_mac_info;
struct glddevice *gld_device;
} gld_t;
/* gld_flag bits */
#define GLD_PROM_SAP 0x0008
#define GLD_PROM_MULT 0x0010
/* special case SAP values */
#define GLD_802_SAP 1500
#define GLDMAXETHERSAP 0xFFFF
#define GLD_MAX_802_SAP 0xFF
/*
* driver. Possible types will be defined per the DLPI type defined in
* gldm_type
*/
#define GLDM_UNKNOWN 0
#define GLDM_AUI 1
#define GLDM_BNC 2
#define GLDM_TP 3
#define GLDM_FIBER 4
/*
* definitions for the per driver class structure
*/
typedef struct glddevice {
int gld_status;
int gld_minors;
int gld_major;
int gld_multisize;
int gld_type; /* for use before attach */
int gld_minsdu;
int gld_maxsdu;
/* layers */
int gld_ndevice; /* number of devices linked */
int gld_nextppa; /* number to use for next PPA default */
} glddev_t;
/* initialized */
/*
* definitions for debug tracing
*/
#ifdef DEBUG
#define GLD_DEBUG 1
#endif
/*
* other definitions
*/
/*
* definitions for module_info
*/
#define GLDIDNUM 0x8020
/* define structure for DLSAP value parsing */
struct gld_dlsap {
unsigned char glda_addr[ETHERADDRL];
unsigned short glda_sap;
};
/* union used in calculating hash values */
union gldhash {
struct {
unsigned a0:1;
unsigned a1:1;
unsigned a2:1;
unsigned a3:1;
unsigned a4:1;
unsigned a5:1;
unsigned a6:1;
unsigned a7:1;
unsigned a8:1;
unsigned a9:1;
unsigned a10:1;
unsigned a11:1;
unsigned a12:1;
unsigned a13:1;
unsigned a14:1;
unsigned a15:1;
unsigned a16:1;
unsigned a17:1;
unsigned a18:1;
unsigned a19:1;
unsigned a20:1;
unsigned a21:1;
unsigned a22:1;
unsigned a23:1;
unsigned a24:1;
unsigned a25:1;
unsigned a26:1;
unsigned a27:1;
unsigned a28:1;
unsigned a29:1;
unsigned a30:1;
unsigned a31:1;
} bits;
};
/*
* new interface to allow informing of status changes with hardware
* via the gld_status_change() function
*/
/*
* miscellaneous linkage glue
*/
/*
* defines to make porting older ISC LLC drivers to GLD easier
*/
#define LLC_ADDR_LEN ETHERADDRL
#define GLD_EHDR_SIZE sizeof (struct ether_header)
#define LOW(x) ((x)&0xFF)
#if defined(_KERNEL)
extern int pcgld_wsrv(queue_t *q);
extern int pcgld_rsrv(queue_t *q);
extern int pcgld_unregister(gld_mac_info_t *);
extern uchar_t pcgldbroadcastaddr[];
#endif
/*
* EISA support functions
*/
#ifdef __cplusplus
}
#endif
#endif /* _SYS_PCMCIA_PCGLD_H */