dld_impl.h revision 605445d5657096e69d948ccb554c9ff024fa34df
/*
* 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.
*/
#ifndef _SYS_DLD_IMPL_H
#define _SYS_DLD_IMPL_H
#pragma ident "%Z%%M% %I% %E% SMI"
#include <sys/ethernet.h>
#ifdef __cplusplus
extern "C" {
#endif
#define DLD_CONTROL 0x00000001
#define DLD_DLPI 0x00000002
typedef enum {
typedef enum {
/*
* dld_str_t object definition.
*/
struct dld_str {
/*
* Major number of the device
*/
/*
* Ephemeral minor number for the object.
*/
/*
* PPA number this stream is attached to.
*/
/*
*/
/*
* Lock to protect this structure.
*/
/*
* Stream is open to DLD_CONTROL (control node) or
* DLD_DLPI (DLS provider) node.
*/
/*
* The following fields are only used for DLD_DLPI type objects.
*/
/*
* Current DLPI state.
*/
/*
* DLPI style
*/
/*
* Currently bound DLSAP.
*/
/*
* Handle of the data-link channel that is used by this object.
*/
/*
* Handle of the MAC that is used by the data-link interface.
*/
/*
* VLAN identifier of the data-link interface.
*/
/*
* Promiscuity level information.
*/
/*
* Immutable information of the MAC which the channel is using.
*/
const mac_info_t *ds_mip;
/*
* Current packet priority.
*/
/*
* Handle of our MAC notification callback.
*/
/*
* Set of enabled DL_NOTE... notifications. (See dlpi.h).
*/
/*
* Cached MAC unicast addresses.
*/
/*
* Mode: unitdata, fast-path or raw.
*/
/*
* IP polling is operational if this flag is set.
*/
/*
* State of DLPI user: may be active (regular network layer),
* passive (snoop-like monitoring), or unknown (not yet
* determined).
*/
/*
* Dummy mblk used for flow-control.
*/
/*
* Internal transmit queue and its parameters.
*/
/*
* Number of threads currently in dld. If there is a pending
* request, it is placed in ds_pending_req and the operation
* will finish when dld becomes single-threaded.
*/
} dld_str;
/*
* dld_str.c module.
*/
extern void dld_str_init(void);
extern int dld_str_fini(void);
extern void dld_str_destroy(dld_str_t *);
extern void dld_str_detach(dld_str_t *);
extern void dld_str_rx_raw(void *, mac_resource_handle_t,
mblk_t *, mac_header_info_t *);
extern void dld_str_rx_fastpath(void *, mac_resource_handle_t,
mblk_t *, mac_header_info_t *);
extern void dld_str_rx_unitdata(void *, mac_resource_handle_t,
mblk_t *, mac_header_info_t *);
extern void dld_tx_flush(dld_str_t *);
extern void dld_str_notify_ind(dld_str_t *);
/*
*/
extern void dld_finish_pending_ops(dld_str_t *);
/*
* Options: there should be a separate bit defined here for each
* DLD_PROP... defined in dld.h.
*/
#define DLD_OPT_NO_FASTPATH 0x00000001
#define DLD_OPT_NO_POLL 0x00000002
#define DLD_OPT_NO_ZEROCOPY 0x00000004
/*
* Useful macros.
*/
#define IMPLY(p, c) (!(p) || (c))
}
else \
}
#define DLD_WAKEUP(dsp) { \
if (--dsp->ds_pending_cnt == 0) \
}
#ifdef DEBUG
#else
#endif
#ifdef __cplusplus
}
#endif
#endif /* _SYS_DLD_IMPL_H */