/*
* 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 _BFE_H
#define _BFE_H
#include "bfe_hw.h"
#ifdef __cplusplus
extern "C" {
#endif
/*
* Use to increment descriptor slot number.
*/
/*
* I/O instructions
*/
/*
* These macros allows use to write to descriptor memory.
*/
typedef struct bfe_cards {
char *cardname;
} bfe_cards_t;
/*
* Chip's state.
*/
typedef enum {
/*
* PHY state.
*/
typedef enum {
/*
* Chip's mode
*/
/*
* Every packet has this header which is put by the card.
*/
typedef struct bfe_rx_header {
typedef struct bfe_stats {
} bfe_stats_t;
typedef struct {
int state;
int speed;
int duplex;
int flowctrl;
int mau;
} bfe_link_t;
/*
* Device registers handle
*/
typedef struct {
} bfe_acc_t;
/*
* BCM4401 Chip state
*/
typedef struct bfe_chip {
int link;
int state;
int speed;
int duplex;
} bfe_chip_t;
/*
* Ring Management framework.
*/
/*
* TX and RX descriptor format in the hardware.
*/
typedef struct bfe_desc {
} bfe_desc_t;
/*
* DMA handle for each descriptor
*/
typedef struct bfe_dma {
} bfe_dma_t;
/* Keep it power of 2 */
#define BFE_RING_UNALLOCATED 0
struct bfe;
typedef struct bfe_ring {
/* Lock for the ring */
/* Actual lock pointer. It may point to global lock */
/* DMA handle for all buffers in descriptor table */
/* DMA buffer holding descriptor table */
/* DMA handle for the descriptor table */
/* DMA buffer length */
/* Flags associated to the ring */
int r_flags;
/* Pointer back to bfe instance */
/* Current slot number (or descriptor number) in the ring */
/* Consumed descriptor if got the interrupt (only used for TX) */
} bfe_ring_t;
/*
* Device driver's private data per instance.
*/
typedef struct bfe {
/* devinfo stuff */
int bfe_unit;
/* PCI Configuration handle */
/* Device registers handle and regset */
/* Ethernet addr */
/* MAC layer handle */
/* Interrupt management */
/* Ring Management */
int bfe_tx_resched;
/* Chip details */
/* rw lock for chip */
/* Multicast table */
/* Timeout and PHY state */
int bfe_phy_id;
/* MII register set */
/* Transceiver fields */
} bfe_t;
static int bfe_identify_hardware(bfe_t *);
#ifdef __cplusplus
}
#endif
#endif /* _BFE_H */