bfin_mac.h 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  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. #ifndef _BFIN_MAC_H_
  11. #define _BFIN_MAC_H_
  12. #include <linux/net_tstamp.h>
  13. #include <linux/clocksource.h>
  14. #include <linux/timecompare.h>
  15. #define BFIN_MAC_CSUM_OFFLOAD
  16. struct dma_descriptor {
  17. struct dma_descriptor *next_dma_desc;
  18. unsigned long start_addr;
  19. unsigned short config;
  20. unsigned short x_count;
  21. };
  22. struct status_area_rx {
  23. #if defined(BFIN_MAC_CSUM_OFFLOAD)
  24. unsigned short ip_hdr_csum; /* ip header checksum */
  25. /* ip payload(udp or tcp or others) checksum */
  26. unsigned short ip_payload_csum;
  27. #endif
  28. unsigned long status_word; /* the frame status word */
  29. };
  30. struct status_area_tx {
  31. unsigned long status_word; /* the frame status word */
  32. };
  33. /* use two descriptors for a packet */
  34. struct net_dma_desc_rx {
  35. struct net_dma_desc_rx *next;
  36. struct sk_buff *skb;
  37. struct dma_descriptor desc_a;
  38. struct dma_descriptor desc_b;
  39. struct status_area_rx status;
  40. };
  41. /* use two descriptors for a packet */
  42. struct net_dma_desc_tx {
  43. struct net_dma_desc_tx *next;
  44. struct sk_buff *skb;
  45. struct dma_descriptor desc_a;
  46. struct dma_descriptor desc_b;
  47. unsigned char packet[1560];
  48. struct status_area_tx status;
  49. };
  50. struct bfin_mac_local {
  51. /*
  52. * these are things that the kernel wants me to keep, so users
  53. * can find out semi-useless statistics of how well the card is
  54. * performing
  55. */
  56. struct net_device_stats stats;
  57. unsigned char Mac[6]; /* MAC address of the board */
  58. spinlock_t lock;
  59. int wol; /* Wake On Lan */
  60. int irq_wake_requested;
  61. /* MII and PHY stuffs */
  62. int old_link; /* used by bf537_adjust_link */
  63. int old_speed;
  64. int old_duplex;
  65. struct phy_device *phydev;
  66. struct mii_bus *mii_bus;
  67. #if defined(CONFIG_BFIN_MAC_USE_HWSTAMP)
  68. struct cyclecounter cycles;
  69. struct timecounter clock;
  70. struct timecompare compare;
  71. struct hwtstamp_config stamp_cfg;
  72. #endif
  73. };
  74. extern void bfin_get_ether_addr(char *addr);
  75. #endif