bfin_mac.h 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. /*
  2. * File: drivers/net/bfin_mac.c
  3. * Based on:
  4. * Maintainer:
  5. * Bryan Wu <bryan.wu@analog.com>
  6. *
  7. * Original author:
  8. * Luke Yang <luke.yang@analog.com>
  9. *
  10. * Created:
  11. * Description:
  12. *
  13. * Modified:
  14. * Copyright 2004-2006 Analog Devices Inc.
  15. *
  16. * Bugs: Enter bugs at http://blackfin.uclinux.org/
  17. *
  18. * This program is free software ; you can redistribute it and/or modify
  19. * it under the terms of the GNU General Public License as published by
  20. * the Free Software Foundation ; either version 2, or (at your option)
  21. * any later version.
  22. *
  23. * This program is distributed in the hope that it will be useful,
  24. * but WITHOUT ANY WARRANTY ; without even the implied warranty of
  25. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  26. * GNU General Public License for more details.
  27. *
  28. * You should have received a copy of the GNU General Public License
  29. * along with this program ; see the file COPYING.
  30. * If not, write to the Free Software Foundation,
  31. * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  32. */
  33. #define BFIN_MAC_CSUM_OFFLOAD
  34. struct dma_descriptor {
  35. struct dma_descriptor *next_dma_desc;
  36. unsigned long start_addr;
  37. unsigned short config;
  38. unsigned short x_count;
  39. };
  40. struct status_area_rx {
  41. #if defined(BFIN_MAC_CSUM_OFFLOAD)
  42. unsigned short ip_hdr_csum; /* ip header checksum */
  43. /* ip payload(udp or tcp or others) checksum */
  44. unsigned short ip_payload_csum;
  45. #endif
  46. unsigned long status_word; /* the frame status word */
  47. };
  48. struct status_area_tx {
  49. unsigned long status_word; /* the frame status word */
  50. };
  51. /* use two descriptors for a packet */
  52. struct net_dma_desc_rx {
  53. struct net_dma_desc_rx *next;
  54. struct sk_buff *skb;
  55. struct dma_descriptor desc_a;
  56. struct dma_descriptor desc_b;
  57. struct status_area_rx status;
  58. };
  59. /* use two descriptors for a packet */
  60. struct net_dma_desc_tx {
  61. struct net_dma_desc_tx *next;
  62. struct sk_buff *skb;
  63. struct dma_descriptor desc_a;
  64. struct dma_descriptor desc_b;
  65. unsigned char packet[1560];
  66. struct status_area_tx status;
  67. };
  68. struct bf537mac_local {
  69. /*
  70. * these are things that the kernel wants me to keep, so users
  71. * can find out semi-useless statistics of how well the card is
  72. * performing
  73. */
  74. struct net_device_stats stats;
  75. unsigned char Mac[6]; /* MAC address of the board */
  76. spinlock_t lock;
  77. /* MII and PHY stuffs */
  78. int old_link; /* used by bf537_adjust_link */
  79. int old_speed;
  80. int old_duplex;
  81. struct phy_device *phydev;
  82. struct mii_bus mii_bus;
  83. };
  84. extern void get_bf537_ether_addr(char *addr);