npe.h 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. /*
  2. * (C) Copyright 2005
  3. * Stefan Roese, DENX Software Engineering, sr@denx.de.
  4. *
  5. * See file CREDITS for list of people who contributed to this
  6. * project.
  7. *
  8. * This program is free software; you can redistribute it and/or
  9. * modify it under the terms of the GNU General Public License as
  10. * published by the Free Software Foundation; either version 2 of
  11. * the License, or (at your option) any later version.
  12. *
  13. * This program is distributed in the hope that it will be useful,
  14. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. * GNU General Public License for more details.
  17. *
  18. * You should have received a copy of the GNU General Public License
  19. * along with this program; if not, write to the Free Software
  20. * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
  21. * MA 02111-1307 USA
  22. */
  23. #ifndef NPE_H
  24. #define NPE_H
  25. /*
  26. * defines...
  27. */
  28. #define CONFIG_SYS_NPE_NUMS 1
  29. #ifdef CONFIG_HAS_ETH1
  30. #undef CONFIG_SYS_NPE_NUMS
  31. #define CONFIG_SYS_NPE_NUMS 2
  32. #endif
  33. #define NPE_NUM_PORTS 3
  34. #define ACTIVE_PORTS 1
  35. #define NPE_PKT_SIZE 1600
  36. #define CONFIG_DEVS_ETH_INTEL_NPE_MAX_RX_DESCRIPTORS 64
  37. #define CONFIG_DEVS_ETH_INTEL_NPE_MAX_TX_DESCRIPTORS 2
  38. #define NPE_MBUF_POOL_SIZE \
  39. ((CONFIG_DEVS_ETH_INTEL_NPE_MAX_TX_DESCRIPTORS + \
  40. CONFIG_DEVS_ETH_INTEL_NPE_MAX_RX_DESCRIPTORS) * \
  41. sizeof(IX_OSAL_MBUF) * ACTIVE_PORTS)
  42. #define NPE_PKT_POOL_SIZE \
  43. ((CONFIG_DEVS_ETH_INTEL_NPE_MAX_TX_DESCRIPTORS + \
  44. CONFIG_DEVS_ETH_INTEL_NPE_MAX_RX_DESCRIPTORS) * \
  45. NPE_PKT_SIZE * ACTIVE_PORTS)
  46. #define NPE_MEM_POOL_SIZE (NPE_MBUF_POOL_SIZE + NPE_PKT_POOL_SIZE)
  47. #define PHY_AUTONEGOTIATE_TIMEOUT 4000 /* 4000 ms autonegotiate timeout */
  48. /*
  49. * structs...
  50. */
  51. struct npe {
  52. u8 active; /* NPE active */
  53. u8 eth_id; /* IX_ETH_PORT_1 or IX_ETH_PORT_2 */
  54. u8 phy_no; /* which PHY (0 - 31) */
  55. u8 mac_address[6];
  56. IX_OSAL_MBUF *rxQHead;
  57. IX_OSAL_MBUF *txQHead;
  58. u8 *tx_pkts;
  59. u8 *rx_pkts;
  60. IX_OSAL_MBUF *rx_mbufs;
  61. IX_OSAL_MBUF *tx_mbufs;
  62. int print_speed;
  63. int rx_read;
  64. int rx_write;
  65. int rx_len[PKTBUFSRX];
  66. };
  67. /*
  68. * prototypes...
  69. */
  70. extern int npe_miiphy_read (char *devname, unsigned char addr,
  71. unsigned char reg, unsigned short *value);
  72. extern int npe_miiphy_write (char *devname, unsigned char addr,
  73. unsigned char reg, unsigned short value);
  74. #endif /* ifndef NPE_H */