bfin_mac.h 2.1 KB

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