scfdscp.h revision 25cf1a301a396c38e8adf52c15f537b80d2483f7
/*
* 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
*/
/*
* All Rights Reserved, Copyright (c) FUJITSU LIMITED 2006
*/
#ifndef _SCFDSCP_H
#define _SCFDSCP_H
#pragma ident "%Z%%M% %I% %E% SMI"
#ifdef __cplusplus
extern "C" {
#endif
/*
* Discriptor define
*/
/* TxDSC max count (0x6000) */
/* RxDSC max count (0x9c00) */
/*
* Re-try max count define
*/
/*
* Que max count define
*/
/*
* Mailbox interface code
*/
typedef enum {
MBIF_DSCP, /* DSCP mailbox interface code */
MBIF_DKMD, /* DKMD mailbox interface code */
/* Add mailbox interface code */
MBIF_MAX /* Max interface code */
} scf_mbif_t;
/*
* Callback event queue
*/
typedef struct scf_event_que {
/*
* Recv data queue
*/
typedef struct scf_rdata_que {
/*
* DSCP main control table
*/
typedef struct scf_dscp_main {
/* main status */
/* init() parameter */
void (*event_handler)(scf_event_t, void *);
/* event handler function */
void *arg; /* Callback argument */
/* cv_init() condition */
/* flag */
/* memo counter */
/*
*/
typedef union scf_dscreg {
/* Basic code format */
struct {
} base;
struct { /* DCR bit format */
unsigned : 2;
unsigned : 2;
} bdcr;
struct { /* DSR bit format */
} bdsr;
} scf_dscreg_t;
/*
*/
typedef struct scf_dscp_dsc {
/*
* DSCP Tx SRAM table
*/
typedef struct scf_tx_sram {
/*
* DSCP common table
*/
typedef struct scf_dscp_comtbl {
/* DSCP main control table */
/* size */
/* TxDSC re-try max count */
/* TxDSC table address and size */
/* RxDSC table address and size */
/* Tx SRAM table address and size */
/* TxDSC offset */
/* Tx SRAM offset */
/*
* DSCP main status (scf_dscp_main_t : status)
*/
/* (A0) Cconnection idle state */
#define SCF_ST_IDLE 0x0000
#ifdef _SCF_SP_SIDE
/* (A1) init() after, INIT_REQ recv state */
#define SCF_ST_EST_INIT_REQ_RECV_WAIT 0x0001
#else /* _SCF_SP_SIDE */
/* (B0) Send INIT_REQ, TxEND recv wait state */
#define SCF_ST_EST_TXEND_RECV_WAIT 0x0010
#endif /* _SCF_SP_SIDE */
/* (C0) Connection establishment state */
#define SCF_ST_ESTABLISHED 0x0020
/* (C1) Recv FINI_REQ, fini() wait state */
#define SCF_ST_EST_FINI_WAIT 0x0021
/* (D0) Send FINI_REQ, TxEND recv wait state */
#define SCF_ST_CLOSE_TXEND_RECV_WAIT 0x0030
/*
* DSCP Tx discriptor status (scf_dscp_dsc_t : status)
*/
/* (SA0) Idle state */
#define SCF_TX_ST_IDLE 0x0000
/* (SB0) TxREQ send wait & SRAM trans wait state */
#define SCF_TX_ST_SRAM_TRANS_WAIT 0x0010
#ifdef _SCF_SP_SIDE
/* (SB1) TxREQ send wait & SRAM trans comp wait state */
#define SCF_TX_ST_SRAM_COMP_WAIT 0x0011
#endif /* _SCF_SP_SIDE */
/* (SB2) TxREQ send wait & TxREQ send wait state */
#define SCF_TX_ST_TXREQ_SEND_WAIT 0x0012
/* (SC0) Send TxREQ, TxACK recv wait state */
#define SCF_TX_ST_TXACK_RECV_WAIT 0x0020
/* (SC1) Send TxREQ, TxEND recv wait state */
#define SCF_TX_ST_TXEND_RECV_WAIT 0x0021
/*
* DSCP Rx discriptor status (scf_dscp_dsc_t : status)
*/
/* (RA0) Idle state */
#define SCF_RX_ST_IDLE 0x0000
/* (RB0) Recv RxREQ, RxACK send wait state */
#define SCF_RX_ST_RXACK_SEND_WAIT 0x0010
/* (RB1) Recv RxREQ, SRAM trans wait state */
#define SCF_RX_ST_SRAM_TRANS_WAIT 0x0011
#ifdef _SCF_SP_SIDE
/* (RB2) Recv RxREQ, SRAM comp wait state */
#define SCF_RX_ST_SRAM_COMP_WAIT 0x0012
#endif /* _SCF_SP_SIDE */
/* (RB3) Recv RxREQ, RxEND send wait state */
#define SCF_RX_ST_RXEND_SEND_WAIT 0x0013
/*
* DSC controlflag (scf_dscreg_t : c_flag)
*/
/* emergency=0, interrupt=1, first=1, last=0 */
/*
* DSC controlflag (scf_dscreg_t : id)
*/
/*
* DSC controlflag (scf_dscreg_t : code)
*/
/*
* DSC controlflag (scf_dscreg_t : code) id = DSC_CNTL_LOCAL
*/
/*
* DSC controlflag (scf_dscreg_t : status)
*/
/*
* DSC controlflag (scf_dscreg_t : offset)
*/
/*
* scf_dscp_sram_get() return value
*/
/*
* Main status change macro
*/
#define SCF_SET_STATUS(p, st) \
p->old_status = p->status; \
"main status change = 0x%04x 0x%04x", \
p->status, p->old_status)
/*
*/
#define SCF_SET_DSC_STATUS(p, st) \
p->old_status = p->status; \
"DSC status change = 0x%04x 0x%04x", \
p->status, p->old_status)
/*
* Use scf_dscp_tx_mat_notice() code
*/
/*
* Use scf_dscp_rx_mat_notice() code
*/
#ifdef __cplusplus
}
#endif
#endif /* _SCFDSCP_H */