Back to home page

OSCL-LXR

 
 

    


0001 /*
0002  * Header for Bestcomm FEC tasks driver
0003  *
0004  *
0005  * Copyright (C) 2006-2007 Sylvain Munaut <tnt@246tNt.com>
0006  * Copyright (C) 2003-2004 MontaVista, Software, Inc.
0007  *                         ( by Dale Farnsworth <dfarnsworth@mvista.com> )
0008  *
0009  * This file is licensed under the terms of the GNU General Public License
0010  * version 2. This program is licensed "as is" without any warranty of any
0011  * kind, whether express or implied.
0012  */
0013 
0014 #ifndef __BESTCOMM_FEC_H__
0015 #define __BESTCOMM_FEC_H__
0016 
0017 
0018 struct bcom_fec_bd {
0019     u32 status;
0020     u32 skb_pa;
0021 };
0022 
0023 #define BCOM_FEC_TX_BD_TFD  0x08000000ul    /* transmit frame done */
0024 #define BCOM_FEC_TX_BD_TC   0x04000000ul    /* transmit CRC */
0025 #define BCOM_FEC_TX_BD_ABC  0x02000000ul    /* append bad CRC */
0026 
0027 #define BCOM_FEC_RX_BD_L    0x08000000ul    /* buffer is last in frame */
0028 #define BCOM_FEC_RX_BD_BC   0x00800000ul    /* DA is broadcast */
0029 #define BCOM_FEC_RX_BD_MC   0x00400000ul    /* DA is multicast and not broadcast */
0030 #define BCOM_FEC_RX_BD_LG   0x00200000ul    /* Rx frame length violation */
0031 #define BCOM_FEC_RX_BD_NO   0x00100000ul    /* Rx non-octet aligned frame */
0032 #define BCOM_FEC_RX_BD_CR   0x00040000ul    /* Rx CRC error */
0033 #define BCOM_FEC_RX_BD_OV   0x00020000ul    /* overrun */
0034 #define BCOM_FEC_RX_BD_TR   0x00010000ul    /* Rx frame truncated */
0035 #define BCOM_FEC_RX_BD_LEN_MASK 0x000007fful    /* mask for length of received frame */
0036 #define BCOM_FEC_RX_BD_ERRORS   (BCOM_FEC_RX_BD_LG | BCOM_FEC_RX_BD_NO | \
0037         BCOM_FEC_RX_BD_CR | BCOM_FEC_RX_BD_OV | BCOM_FEC_RX_BD_TR)
0038 
0039 
0040 extern struct bcom_task *
0041 bcom_fec_rx_init(int queue_len, phys_addr_t fifo, int maxbufsize);
0042 
0043 extern int
0044 bcom_fec_rx_reset(struct bcom_task *tsk);
0045 
0046 extern void
0047 bcom_fec_rx_release(struct bcom_task *tsk);
0048 
0049 
0050 extern struct bcom_task *
0051 bcom_fec_tx_init(int queue_len, phys_addr_t fifo);
0052 
0053 extern int
0054 bcom_fec_tx_reset(struct bcom_task *tsk);
0055 
0056 extern void
0057 bcom_fec_tx_release(struct bcom_task *tsk);
0058 
0059 
0060 #endif /* __BESTCOMM_FEC_H__ */
0061