fec.h 3.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. /*
  2. * fec.h -- Fast Ethernet Controller definitions
  3. *
  4. * Some definitions copied from commproc.h for MPC8xx:
  5. * MPC8xx Communication Processor Module.
  6. * Copyright (c) 1997 Dan Malek (dmalek@jlc.net)
  7. *
  8. * See file CREDITS for list of people who contributed to this
  9. * project.
  10. *
  11. * This program is free software; you can redistribute it and/or
  12. * modify it under the terms of the GNU General Public License as
  13. * published by the Free Software Foundation; either version 2 of
  14. * the License, or (at your option) any later version.
  15. *
  16. * This program is distributed in the hope that it will be useful,
  17. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  18. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  19. * GNU General Public License for more details.
  20. *
  21. * You should have received a copy of the GNU General Public License
  22. * along with this program; if not, write to the Free Software
  23. * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
  24. * MA 02111-1307 USA
  25. */
  26. #ifndef fec_h
  27. #define fec_h
  28. /* Buffer descriptors used FEC.
  29. */
  30. typedef struct cpm_buf_desc {
  31. ushort cbd_sc; /* Status and Control */
  32. ushort cbd_datlen; /* Data length in buffer */
  33. uint cbd_bufaddr; /* Buffer address in host memory */
  34. } cbd_t;
  35. #define BD_SC_EMPTY ((ushort)0x8000) /* Recieve is empty */
  36. #define BD_SC_READY ((ushort)0x8000) /* Transmit is ready */
  37. #define BD_SC_WRAP ((ushort)0x2000) /* Last buffer descriptor */
  38. #define BD_SC_INTRPT ((ushort)0x1000) /* Interrupt on change */
  39. #define BD_SC_LAST ((ushort)0x0800) /* Last buffer in frame */
  40. #define BD_SC_TC ((ushort)0x0400) /* Transmit CRC */
  41. #define BD_SC_CM ((ushort)0x0200) /* Continous mode */
  42. #define BD_SC_ID ((ushort)0x0100) /* Rec'd too many idles */
  43. #define BD_SC_P ((ushort)0x0100) /* xmt preamble */
  44. #define BD_SC_BR ((ushort)0x0020) /* Break received */
  45. #define BD_SC_FR ((ushort)0x0010) /* Framing error */
  46. #define BD_SC_PR ((ushort)0x0008) /* Parity error */
  47. #define BD_SC_OV ((ushort)0x0002) /* Overrun */
  48. #define BD_SC_CD ((ushort)0x0001) /* Carrier Detect lost */
  49. /* Buffer descriptor control/status used by Ethernet receive.
  50. */
  51. #define BD_ENET_RX_EMPTY ((ushort)0x8000)
  52. #define BD_ENET_RX_WRAP ((ushort)0x2000)
  53. #define BD_ENET_RX_INTR ((ushort)0x1000)
  54. #define BD_ENET_RX_LAST ((ushort)0x0800)
  55. #define BD_ENET_RX_FIRST ((ushort)0x0400)
  56. #define BD_ENET_RX_MISS ((ushort)0x0100)
  57. #define BD_ENET_RX_LG ((ushort)0x0020)
  58. #define BD_ENET_RX_NO ((ushort)0x0010)
  59. #define BD_ENET_RX_SH ((ushort)0x0008)
  60. #define BD_ENET_RX_CR ((ushort)0x0004)
  61. #define BD_ENET_RX_OV ((ushort)0x0002)
  62. #define BD_ENET_RX_CL ((ushort)0x0001)
  63. #define BD_ENET_RX_STATS ((ushort)0x013f) /* All status bits */
  64. /* Buffer descriptor control/status used by Ethernet transmit.
  65. */
  66. #define BD_ENET_TX_READY ((ushort)0x8000)
  67. #define BD_ENET_TX_PAD ((ushort)0x4000)
  68. #define BD_ENET_TX_WRAP ((ushort)0x2000)
  69. #define BD_ENET_TX_INTR ((ushort)0x1000)
  70. #define BD_ENET_TX_LAST ((ushort)0x0800)
  71. #define BD_ENET_TX_TC ((ushort)0x0400)
  72. #define BD_ENET_TX_DEF ((ushort)0x0200)
  73. #define BD_ENET_TX_HB ((ushort)0x0100)
  74. #define BD_ENET_TX_LC ((ushort)0x0080)
  75. #define BD_ENET_TX_RL ((ushort)0x0040)
  76. #define BD_ENET_TX_RCMASK ((ushort)0x003c)
  77. #define BD_ENET_TX_UN ((ushort)0x0002)
  78. #define BD_ENET_TX_CSL ((ushort)0x0001)
  79. #define BD_ENET_TX_STATS ((ushort)0x03ff) /* All status bits */
  80. #endif /* fec_h */