/*
* 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 2009 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#ifndef _SYS_DMFE_IMPL_H
#define _SYS_DMFE_IMPL_H
#include <sys/ethernet.h>
#include <sys/dditypes.h>
#include <sys/mac_provider.h>
#include <sys/mac_ether.h>
#include "dmfe.h"
/*
* Describes the identity of a specific chip
*/
typedef struct {
} chip_id_t;
/*
* Describes the state of a descriptor ring
*
* NOTE: n_free and next_busy are only used for the Tx descriptors
* and are not valid on the receive side.
*/
typedef struct {
} desc_state_t;
/*
* Describes one chunk of allocated DMA-able memory
*/
typedef struct {
int spare3;
int ncookies;
} dma_area_t;
/*
* Indexes into the driver-specific kstats, divided into:
*
* cyclic activity
* reasons for waking the factotum
* the factotum's activities
*/
enum {
};
/*
* Actual state of the DM9102A chip
*/
enum chip_state {
};
/*
* Required state according to MAC
*/
enum mac_state {
};
/*
* (Internal) return values from ioctl subroutines
*/
enum ioc_reply {
};
/*
* Per-instance soft-state structure
*/
typedef struct dmfe {
/*
* These fields are set by attach() and unchanged thereafter ...
*/
/*
* Locks:
*
* <milock> is used only by the MII (PHY) level code, to ensure
* exclusive access during the bit-twiddling needed to send
* signals along the MII serial bus. These operations are
* --S--L--O--W-- so we keep this lock separate, so that
* faster operations (e.g. interrupts) aren't delayed by
* waiting for it.
*
* <oplock> is a general "outer" lock, protecting most r/w data
* and chip state. It is also acquired by the interrupt
* handler.
*
* <rxlock> is used to protect the Rx-side buffers, descriptors,
* and statistics during a single call to dmfe_getp().
* This is called from inside the interrupt handler, but
* <oplock> is not held across this call.
*
* <txlock> is an "inner" lock, and protects only the Tx-side
* data below and in the ring buffers/descriptors. The
* Tx-side code uses only this lock, avoiding contention
* with the receive-side code.
*
* Any of the locks can be acquired singly, but where multiple
* locks are acquired, they *must* be in the order:
*
* milock >>> oplock >>> rxlock >>> txlock.
*
* *None* of these locks may be held across calls out to the
* MAC routines mac_rx() or mac_tx_notify(); MAC locks must
* be regarded as *outermost* locks in all cases, as they will
* already be held before calling the ioctl() or get_stats()
* entry points - which then have to acquire multiple locks, in
* the order described here.
*/
/*
* DMFE Extended kstats, protected by <oplock>
*/
/*
* GLD statistics; the prefix tells which lock each is protected by.
*/
/*
* These two sets of desciptors are manipulated during
*/
/*
* Miscellaneous Tx-side variables (protected by txlock)
*/
/*
* Miscellaneous operating variables (protected by oplock)
*/
/*
* Current Ethernet address & multicast map ...
*/
/*
* Guard element used to check data integrity
*/
} dmfe_t;
/*
* 'Progress' bit flags ...
*/
/*
* Sync a DMA area described by a dma_area_t
*/
/*
* Next value of a cyclic index
*/
/*
* Copy an ethernet address
*/
/*
*/
do { \
} while (0)
do { \
} while (0)
/*
* Inter-source-file linkage ...
*/
/* dmfe_log.c */
void dmfe_log_init(void);
void dmfe_log_fini(void);
/* dmfe_main.c */
/* dmfe_mii.c */
#endif /* _SYS_DMFE_IMPL_H */