eth.h 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. /*
  2. * (C) Copyright 2001
  3. * Josh Huber <huber@mclx.com>, Mission Critical Linux, Inc.
  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. /*
  24. * eth.h - header file for the polled mode GT ethernet driver
  25. */
  26. #ifndef __GT6426x_ETH_H__
  27. #define __GT6426x_ETH_H__
  28. #include <asm/types.h>
  29. #include <asm/io.h>
  30. #include <asm/byteorder.h>
  31. #include <common.h>
  32. typedef struct eth0_tx_desc_struct {
  33. volatile __u32 bytecount_reserved;
  34. volatile __u32 command_status;
  35. volatile struct eth0_tx_desc_struct * next_desc;
  36. /* Note - the following will not work for 64 bit addressing */
  37. volatile unsigned char * buff_pointer;
  38. } __attribute__ ((packed)) eth0_tx_desc_single;
  39. typedef struct eth0_rx_desc_struct {
  40. volatile __u32 buff_size_byte_count;
  41. volatile __u32 command_status;
  42. volatile struct eth0_rx_desc_struct * next_desc;
  43. volatile unsigned char * buff_pointer;
  44. } __attribute__ ((packed)) eth0_rx_desc_single;
  45. #define NT 20 /* Number of Transmit buffers */
  46. #define NR 20 /* Number of Receive buffers */
  47. #define MAX_BUFF_SIZE (1536+2*CACHE_LINE_SIZE) /* 1600 */
  48. #define ETHERNET_PORTS_DIFFERENCE_OFFSETS 0x400
  49. unsigned long TDN_ETH0 , RDN_ETH0; /* Rx/Tx current Descriptor Number*/
  50. unsigned int EVB64260_ETH0_irq;
  51. #define CLOSED 0
  52. #define OPENED 1
  53. #define PORT_ETH0 0
  54. extern eth0_tx_desc_single *eth0_tx_desc;
  55. extern eth0_rx_desc_single *eth0_rx_desc;
  56. extern char *eth0_tx_buffer;
  57. extern char *eth0_rx_buffer[NR];
  58. extern char *eth_data;
  59. extern int gt6426x_eth_poll(void *v);
  60. extern int gt6426x_eth_transmit(void *v, volatile char *p, unsigned int s);
  61. extern void gt6426x_eth_disable(void *v);
  62. extern int gt6426x_eth_probe(void *v, bd_t *bis);
  63. #endif /* __GT64260x_ETH_H__ */