bfin_mac.h 2.2 KB

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