fec.h 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. /*
  2. * Header for Bestcomm FEC tasks driver
  3. *
  4. *
  5. * Copyright (C) 2006-2007 Sylvain Munaut <tnt@246tNt.com>
  6. * Copyright (C) 2003-2004 MontaVista, Software, Inc.
  7. * ( by Dale Farnsworth <dfarnsworth@mvista.com> )
  8. *
  9. * This file is licensed under the terms of the GNU General Public License
  10. * version 2. This program is licensed "as is" without any warranty of any
  11. * kind, whether express or implied.
  12. */
  13. #ifndef __BESTCOMM_FEC_H__
  14. #define __BESTCOMM_FEC_H__
  15. struct bcom_fec_bd {
  16. u32 status;
  17. u32 skb_pa;
  18. };
  19. #define BCOM_FEC_TX_BD_TFD 0x08000000ul /* transmit frame done */
  20. #define BCOM_FEC_TX_BD_TC 0x04000000ul /* transmit CRC */
  21. #define BCOM_FEC_TX_BD_ABC 0x02000000ul /* append bad CRC */
  22. #define BCOM_FEC_RX_BD_L 0x08000000ul /* buffer is last in frame */
  23. #define BCOM_FEC_RX_BD_BC 0x00800000ul /* DA is broadcast */
  24. #define BCOM_FEC_RX_BD_MC 0x00400000ul /* DA is multicast and not broadcast */
  25. #define BCOM_FEC_RX_BD_LG 0x00200000ul /* Rx frame length violation */
  26. #define BCOM_FEC_RX_BD_NO 0x00100000ul /* Rx non-octet aligned frame */
  27. #define BCOM_FEC_RX_BD_CR 0x00040000ul /* Rx CRC error */
  28. #define BCOM_FEC_RX_BD_OV 0x00020000ul /* overrun */
  29. #define BCOM_FEC_RX_BD_TR 0x00010000ul /* Rx frame truncated */
  30. #define BCOM_FEC_RX_BD_LEN_MASK 0x000007fful /* mask for length of received frame */
  31. #define BCOM_FEC_RX_BD_ERRORS (BCOM_FEC_RX_BD_LG | BCOM_FEC_RX_BD_NO | \
  32. BCOM_FEC_RX_BD_CR | BCOM_FEC_RX_BD_OV | BCOM_FEC_RX_BD_TR)
  33. extern struct bcom_task *
  34. bcom_fec_rx_init(int queue_len, phys_addr_t fifo, int maxbufsize);
  35. extern int
  36. bcom_fec_rx_reset(struct bcom_task *tsk);
  37. extern void
  38. bcom_fec_rx_release(struct bcom_task *tsk);
  39. extern struct bcom_task *
  40. bcom_fec_tx_init(int queue_len, phys_addr_t fifo);
  41. extern int
  42. bcom_fec_tx_reset(struct bcom_task *tsk);
  43. extern void
  44. bcom_fec_tx_release(struct bcom_task *tsk);
  45. #endif /* __BESTCOMM_FEC_H__ */