bfin_mac.h 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. /*
  2. * Blackfin On-Chip MAC Driver
  3. *
  4. * Copyright 2004-2007 Analog Devices Inc.
  5. *
  6. * Enter bugs at http://blackfin.uclinux.org/
  7. *
  8. * Licensed under the GPL-2 or later.
  9. */
  10. #define BFIN_MAC_CSUM_OFFLOAD
  11. struct dma_descriptor {
  12. struct dma_descriptor *next_dma_desc;
  13. unsigned long start_addr;
  14. unsigned short config;
  15. unsigned short x_count;
  16. };
  17. struct status_area_rx {
  18. #if defined(BFIN_MAC_CSUM_OFFLOAD)
  19. unsigned short ip_hdr_csum; /* ip header checksum */
  20. /* ip payload(udp or tcp or others) checksum */
  21. unsigned short ip_payload_csum;
  22. #endif
  23. unsigned long status_word; /* the frame status word */
  24. };
  25. struct status_area_tx {
  26. unsigned long status_word; /* the frame status word */
  27. };
  28. /* use two descriptors for a packet */
  29. struct net_dma_desc_rx {
  30. struct net_dma_desc_rx *next;
  31. struct sk_buff *skb;
  32. struct dma_descriptor desc_a;
  33. struct dma_descriptor desc_b;
  34. struct status_area_rx status;
  35. };
  36. /* use two descriptors for a packet */
  37. struct net_dma_desc_tx {
  38. struct net_dma_desc_tx *next;
  39. struct sk_buff *skb;
  40. struct dma_descriptor desc_a;
  41. struct dma_descriptor desc_b;
  42. unsigned char packet[1560];
  43. struct status_area_tx status;
  44. };
  45. struct bfin_mac_local {
  46. /*
  47. * these are things that the kernel wants me to keep, so users
  48. * can find out semi-useless statistics of how well the card is
  49. * performing
  50. */
  51. struct net_device_stats stats;
  52. unsigned char Mac[6]; /* MAC address of the board */
  53. spinlock_t lock;
  54. /* MII and PHY stuffs */
  55. int old_link; /* used by bf537_adjust_link */
  56. int old_speed;
  57. int old_duplex;
  58. struct phy_device *phydev;
  59. struct mii_bus *mii_bus;
  60. };
  61. extern void bfin_get_ether_addr(char *addr);