davinci_emac.h 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478
  1. /*
  2. * File : davinci_emac.h
  3. * This file is part of RT-Thread RTOS
  4. * COPYRIGHT (C) 2006, RT-Thread Development Team
  5. *
  6. * This program is free software; you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License as published by
  8. * the Free Software Foundation; either version 2 of the License, or
  9. * (at your option) any later version.
  10. *
  11. * This program is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. * GNU General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU General Public License along
  17. * with this program; if not, write to the Free Software Foundation, Inc.,
  18. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  19. *
  20. * Change Logs:
  21. * Date Author Notes
  22. * 2013-01-30 weety first version
  23. */
  24. #ifndef _DAVINCI_EMAC_H
  25. #define _DAVINCI_EMAC_H
  26. #include <mii.h>
  27. #ifndef NET_IP_ALIGN
  28. #define NET_IP_ALIGN 2
  29. #endif
  30. enum {
  31. EMAC_VERSION_1, /* DM644x */
  32. EMAC_VERSION_2, /* DM646x */
  33. };
  34. #define __iomem
  35. #define BIT(nr) (1UL << (nr))
  36. /* Configuration items */
  37. #define EMAC_DEF_PASS_CRC (0) /* Do not pass CRC upto frames */
  38. #define EMAC_DEF_QOS_EN (0) /* EMAC proprietary QoS disabled */
  39. #define EMAC_DEF_NO_BUFF_CHAIN (0) /* No buffer chain */
  40. #define EMAC_DEF_MACCTRL_FRAME_EN (0) /* Discard Maccontrol frames */
  41. #define EMAC_DEF_SHORT_FRAME_EN (0) /* Discard short frames */
  42. #define EMAC_DEF_ERROR_FRAME_EN (0) /* Discard error frames */
  43. #define EMAC_DEF_PROM_EN (0) /* Promiscous disabled */
  44. #define EMAC_DEF_PROM_CH (0) /* Promiscous channel is 0 */
  45. #define EMAC_DEF_BCAST_EN (1) /* Broadcast enabled */
  46. #define EMAC_DEF_BCAST_CH (0) /* Broadcast channel is 0 */
  47. #define EMAC_DEF_MCAST_EN (1) /* Multicast enabled */
  48. #define EMAC_DEF_MCAST_CH (0) /* Multicast channel is 0 */
  49. #define EMAC_DEF_TXPRIO_FIXED (1) /* TX Priority is fixed */
  50. #define EMAC_DEF_TXPACING_EN (0) /* TX pacing NOT supported*/
  51. #define EMAC_DEF_BUFFER_OFFSET (0) /* Buffer offset to DMA (future) */
  52. #define EMAC_DEF_MIN_ETHPKTSIZE (60) /* Minimum ethernet pkt size */
  53. #define EMAC_DEF_MAX_FRAME_SIZE (1500 + 14 + 4 + 4)
  54. #define EMAC_DEF_TX_CH (0) /* Default 0th channel */
  55. #define EMAC_DEF_RX_CH (0) /* Default 0th channel */
  56. #define EMAC_DEF_MDIO_TICK_MS (10) /* typically 1 tick=1 ms) */
  57. #define EMAC_DEF_MAX_TX_CH (1) /* Max TX channels configured */
  58. #define EMAC_DEF_MAX_RX_CH (1) /* Max RX channels configured */
  59. #define EMAC_POLL_WEIGHT (64) /* Default NAPI poll weight */
  60. /* Buffer descriptor parameters */
  61. #define EMAC_DEF_TX_MAX_SERVICE (32) /* TX max service BD's */
  62. #define EMAC_DEF_RX_MAX_SERVICE (64) /* should = netdev->weight */
  63. /* EMAC register related defines */
  64. #define EMAC_ALL_MULTI_REG_VALUE (0xFFFFFFFF)
  65. #define EMAC_NUM_MULTICAST_BITS (64)
  66. #define EMAC_TEARDOWN_VALUE (0xFFFFFFFC)
  67. #define EMAC_TX_CONTROL_TX_ENABLE_VAL (0x1)
  68. #define EMAC_RX_CONTROL_RX_ENABLE_VAL (0x1)
  69. #define EMAC_MAC_HOST_ERR_INTMASK_VAL (0x2)
  70. #define EMAC_RX_UNICAST_CLEAR_ALL (0xFF)
  71. #define EMAC_INT_MASK_CLEAR (0xFF)
  72. /* RX MBP register bit positions */
  73. #define EMAC_RXMBP_PASSCRC_MASK BIT(30)
  74. #define EMAC_RXMBP_QOSEN_MASK BIT(29)
  75. #define EMAC_RXMBP_NOCHAIN_MASK BIT(28)
  76. #define EMAC_RXMBP_CMFEN_MASK BIT(24)
  77. #define EMAC_RXMBP_CSFEN_MASK BIT(23)
  78. #define EMAC_RXMBP_CEFEN_MASK BIT(22)
  79. #define EMAC_RXMBP_CAFEN_MASK BIT(21)
  80. #define EMAC_RXMBP_PROMCH_SHIFT (16)
  81. #define EMAC_RXMBP_PROMCH_MASK (0x7 << 16)
  82. #define EMAC_RXMBP_BROADEN_MASK BIT(13)
  83. #define EMAC_RXMBP_BROADCH_SHIFT (8)
  84. #define EMAC_RXMBP_BROADCH_MASK (0x7 << 8)
  85. #define EMAC_RXMBP_MULTIEN_MASK BIT(5)
  86. #define EMAC_RXMBP_MULTICH_SHIFT (0)
  87. #define EMAC_RXMBP_MULTICH_MASK (0x7)
  88. #define EMAC_RXMBP_CHMASK (0x7)
  89. /* EMAC register definitions/bit maps used */
  90. # define EMAC_MBP_RXPROMISC (0x00200000)
  91. # define EMAC_MBP_PROMISCCH(ch) (((ch) & 0x7) << 16)
  92. # define EMAC_MBP_RXBCAST (0x00002000)
  93. # define EMAC_MBP_BCASTCHAN(ch) (((ch) & 0x7) << 8)
  94. # define EMAC_MBP_RXMCAST (0x00000020)
  95. # define EMAC_MBP_MCASTCHAN(ch) ((ch) & 0x7)
  96. /* EMAC mac_control register */
  97. #define EMAC_MACCONTROL_TXPTYPE BIT(9)
  98. #define EMAC_MACCONTROL_TXPACEEN BIT(6)
  99. #define EMAC_MACCONTROL_GMIIEN BIT(5)
  100. #define EMAC_MACCONTROL_GIGABITEN BIT(7)
  101. #define EMAC_MACCONTROL_FULLDUPLEXEN BIT(0)
  102. #define EMAC_MACCONTROL_RMIISPEED_MASK BIT(15)
  103. /* GIGABIT MODE related bits */
  104. #define EMAC_DM646X_MACCONTORL_GIG BIT(7)
  105. #define EMAC_DM646X_MACCONTORL_GIGFORCE BIT(17)
  106. /* EMAC mac_status register */
  107. #define EMAC_MACSTATUS_TXERRCODE_MASK (0xF00000)
  108. #define EMAC_MACSTATUS_TXERRCODE_SHIFT (20)
  109. #define EMAC_MACSTATUS_TXERRCH_MASK (0x7)
  110. #define EMAC_MACSTATUS_TXERRCH_SHIFT (16)
  111. #define EMAC_MACSTATUS_RXERRCODE_MASK (0xF000)
  112. #define EMAC_MACSTATUS_RXERRCODE_SHIFT (12)
  113. #define EMAC_MACSTATUS_RXERRCH_MASK (0x7)
  114. #define EMAC_MACSTATUS_RXERRCH_SHIFT (8)
  115. /* EMAC RX register masks */
  116. #define EMAC_RX_MAX_LEN_MASK (0xFFFF)
  117. #define EMAC_RX_BUFFER_OFFSET_MASK (0xFFFF)
  118. /* MAC_IN_VECTOR (0x180) register bit fields */
  119. #define EMAC_DM644X_MAC_IN_VECTOR_HOST_INT BIT(17)
  120. #define EMAC_DM644X_MAC_IN_VECTOR_STATPEND_INT BIT(16)
  121. #define EMAC_DM644X_MAC_IN_VECTOR_RX_INT_VEC BIT(8)
  122. #define EMAC_DM644X_MAC_IN_VECTOR_TX_INT_VEC BIT(0)
  123. /** NOTE:: For DM646x the IN_VECTOR has changed */
  124. #define EMAC_DM646X_MAC_IN_VECTOR_RX_INT_VEC BIT(EMAC_DEF_RX_CH)
  125. #define EMAC_DM646X_MAC_IN_VECTOR_TX_INT_VEC BIT(16 + EMAC_DEF_TX_CH)
  126. #define EMAC_DM646X_MAC_IN_VECTOR_HOST_INT BIT(26)
  127. #define EMAC_DM646X_MAC_IN_VECTOR_STATPEND_INT BIT(27)
  128. /* CPPI bit positions */
  129. #define EMAC_CPPI_SOP_BIT BIT(31)
  130. #define EMAC_CPPI_EOP_BIT BIT(30)
  131. #define EMAC_CPPI_OWNERSHIP_BIT BIT(29)
  132. #define EMAC_CPPI_EOQ_BIT BIT(28)
  133. #define EMAC_CPPI_TEARDOWN_COMPLETE_BIT BIT(27)
  134. #define EMAC_CPPI_PASS_CRC_BIT BIT(26)
  135. #define EMAC_RX_BD_BUF_SIZE (0xFFFF)
  136. #define EMAC_BD_LENGTH_FOR_CACHE (16) /* only CPPI bytes */
  137. #define EMAC_RX_BD_PKT_LENGTH_MASK (0xFFFF)
  138. /* Max hardware defines */
  139. #define EMAC_MAX_TXRX_CHANNELS (8) /* Max hardware channels */
  140. #define EMAC_DEF_MAX_MULTICAST_ADDRESSES (64) /* Max mcast addr's */
  141. /* EMAC Peripheral Device Register Memory Layout structure */
  142. #define EMAC_TXIDVER 0x0
  143. #define EMAC_TXCONTROL 0x4
  144. #define EMAC_TXTEARDOWN 0x8
  145. #define EMAC_RXIDVER 0x10
  146. #define EMAC_RXCONTROL 0x14
  147. #define EMAC_RXTEARDOWN 0x18
  148. #define EMAC_TXINTSTATRAW 0x80
  149. #define EMAC_TXINTSTATMASKED 0x84
  150. #define EMAC_TXINTMASKSET 0x88
  151. #define EMAC_TXINTMASKCLEAR 0x8C
  152. #define EMAC_MACINVECTOR 0x90
  153. #define EMAC_DM646X_MACEOIVECTOR 0x94
  154. #define EMAC_RXINTSTATRAW 0xA0
  155. #define EMAC_RXINTSTATMASKED 0xA4
  156. #define EMAC_RXINTMASKSET 0xA8
  157. #define EMAC_RXINTMASKCLEAR 0xAC
  158. #define EMAC_MACINTSTATRAW 0xB0
  159. #define EMAC_MACINTSTATMASKED 0xB4
  160. #define EMAC_MACINTMASKSET 0xB8
  161. #define EMAC_MACINTMASKCLEAR 0xBC
  162. #define EMAC_RXMBPENABLE 0x100
  163. #define EMAC_RXUNICASTSET 0x104
  164. #define EMAC_RXUNICASTCLEAR 0x108
  165. #define EMAC_RXMAXLEN 0x10C
  166. #define EMAC_RXBUFFEROFFSET 0x110
  167. #define EMAC_RXFILTERLOWTHRESH 0x114
  168. #define EMAC_MACCONTROL 0x160
  169. #define EMAC_MACSTATUS 0x164
  170. #define EMAC_EMCONTROL 0x168
  171. #define EMAC_FIFOCONTROL 0x16C
  172. #define EMAC_MACCONFIG 0x170
  173. #define EMAC_SOFTRESET 0x174
  174. #define EMAC_MACSRCADDRLO 0x1D0
  175. #define EMAC_MACSRCADDRHI 0x1D4
  176. #define EMAC_MACHASH1 0x1D8
  177. #define EMAC_MACHASH2 0x1DC
  178. #define EMAC_MACADDRLO 0x500
  179. #define EMAC_MACADDRHI 0x504
  180. #define EMAC_MACINDEX 0x508
  181. /* EMAC HDP and Completion registors */
  182. #define EMAC_TXHDP(ch) (0x600 + (ch * 4))
  183. #define EMAC_RXHDP(ch) (0x620 + (ch * 4))
  184. #define EMAC_TXCP(ch) (0x640 + (ch * 4))
  185. #define EMAC_RXCP(ch) (0x660 + (ch * 4))
  186. /* EMAC statistics registers */
  187. #define EMAC_RXGOODFRAMES 0x200
  188. #define EMAC_RXBCASTFRAMES 0x204
  189. #define EMAC_RXMCASTFRAMES 0x208
  190. #define EMAC_RXPAUSEFRAMES 0x20C
  191. #define EMAC_RXCRCERRORS 0x210
  192. #define EMAC_RXALIGNCODEERRORS 0x214
  193. #define EMAC_RXOVERSIZED 0x218
  194. #define EMAC_RXJABBER 0x21C
  195. #define EMAC_RXUNDERSIZED 0x220
  196. #define EMAC_RXFRAGMENTS 0x224
  197. #define EMAC_RXFILTERED 0x228
  198. #define EMAC_RXQOSFILTERED 0x22C
  199. #define EMAC_RXOCTETS 0x230
  200. #define EMAC_TXGOODFRAMES 0x234
  201. #define EMAC_TXBCASTFRAMES 0x238
  202. #define EMAC_TXMCASTFRAMES 0x23C
  203. #define EMAC_TXPAUSEFRAMES 0x240
  204. #define EMAC_TXDEFERRED 0x244
  205. #define EMAC_TXCOLLISION 0x248
  206. #define EMAC_TXSINGLECOLL 0x24C
  207. #define EMAC_TXMULTICOLL 0x250
  208. #define EMAC_TXEXCESSIVECOLL 0x254
  209. #define EMAC_TXLATECOLL 0x258
  210. #define EMAC_TXUNDERRUN 0x25C
  211. #define EMAC_TXCARRIERSENSE 0x260
  212. #define EMAC_TXOCTETS 0x264
  213. #define EMAC_NETOCTETS 0x280
  214. #define EMAC_RXSOFOVERRUNS 0x284
  215. #define EMAC_RXMOFOVERRUNS 0x288
  216. #define EMAC_RXDMAOVERRUNS 0x28C
  217. /* EMAC DM644x control registers */
  218. #define EMAC_CTRL_EWCTL (0x4)
  219. #define EMAC_CTRL_EWINTTCNT (0x8)
  220. /* EMAC MDIO related */
  221. /* Mask & Control defines */
  222. #define MDIO_CONTROL_CLKDIV (0xFF)
  223. #define MDIO_CONTROL_ENABLE BIT(30)
  224. #define MDIO_USERACCESS_GO BIT(31)
  225. #define MDIO_USERACCESS_WRITE BIT(30)
  226. #define MDIO_USERACCESS_READ (0)
  227. #define MDIO_USERACCESS_REGADR (0x1F << 21)
  228. #define MDIO_USERACCESS_PHYADR (0x1F << 16)
  229. #define MDIO_USERACCESS_DATA (0xFFFF)
  230. #define MDIO_USERPHYSEL_LINKSEL BIT(7)
  231. #define MDIO_VER_MODID (0xFFFF << 16)
  232. #define MDIO_VER_REVMAJ (0xFF << 8)
  233. #define MDIO_VER_REVMIN (0xFF)
  234. #define MDIO_USERACCESS(inst) (0x80 + (inst * 8))
  235. #define MDIO_USERPHYSEL(inst) (0x84 + (inst * 8))
  236. #define MDIO_CONTROL (0x04)
  237. /* EMAC DM646X control module registers */
  238. #define EMAC_DM646X_CMRXINTEN (0x14)
  239. #define EMAC_DM646X_CMTXINTEN (0x18)
  240. /* EMAC EOI codes for C0 */
  241. #define EMAC_DM646X_MAC_EOI_C0_RXEN (0x01)
  242. #define EMAC_DM646X_MAC_EOI_C0_TXEN (0x02)
  243. /* EMAC Stats Clear Mask */
  244. #define EMAC_STATS_CLR_MASK (0xFFFFFFFF)
  245. /** net_buf_obj: EMAC network bufferdata structure
  246. *
  247. * EMAC network buffer data structure
  248. */
  249. struct emac_netbufobj {
  250. void *buf_token;
  251. char *data_ptr;
  252. int length;
  253. };
  254. /** net_pkt_obj: EMAC network packet data structure
  255. *
  256. * EMAC network packet data structure - supports buffer list (for future)
  257. */
  258. struct emac_netpktobj {
  259. void *pkt_token; /* data token may hold tx/rx chan id */
  260. struct emac_netbufobj *buf_list; /* array of network buffer objects */
  261. int num_bufs;
  262. int pkt_length;
  263. };
  264. /** emac_tx_bd: EMAC TX Buffer descriptor data structure
  265. *
  266. * EMAC TX Buffer descriptor data structure
  267. */
  268. struct emac_tx_bd {
  269. int h_next;
  270. int buff_ptr;
  271. int off_b_len;
  272. int mode; /* SOP, EOP, ownership, EOQ, teardown,Qstarv, length */
  273. struct emac_tx_bd __iomem *next;
  274. void *buf_token;
  275. };
  276. /** emac_txch: EMAC TX Channel data structure
  277. *
  278. * EMAC TX Channel data structure
  279. */
  280. struct emac_txch {
  281. /* Config related */
  282. rt_uint32_t num_bd;
  283. rt_uint32_t service_max;
  284. /* CPPI specific */
  285. rt_uint32_t alloc_size;
  286. void __iomem *bd_mem;
  287. struct emac_tx_bd __iomem *bd_pool_head;
  288. struct emac_tx_bd __iomem *active_queue_head;
  289. struct emac_tx_bd __iomem *active_queue_tail;
  290. struct emac_tx_bd __iomem *last_hw_bdprocessed;
  291. rt_uint32_t queue_active;
  292. rt_uint32_t teardown_pending;
  293. rt_uint32_t *tx_complete;
  294. /** statistics */
  295. rt_uint32_t proc_count; /* TX: # of times emac_tx_bdproc is called */
  296. rt_uint32_t mis_queued_packets;
  297. rt_uint32_t queue_reinit;
  298. rt_uint32_t end_of_queue_add;
  299. rt_uint32_t out_of_tx_bd;
  300. rt_uint32_t no_active_pkts; /* IRQ when there were no packets to process */
  301. rt_uint32_t active_queue_count;
  302. };
  303. /** emac_rx_bd: EMAC RX Buffer descriptor data structure
  304. *
  305. * EMAC RX Buffer descriptor data structure
  306. */
  307. struct emac_rx_bd {
  308. int h_next;
  309. int buff_ptr;
  310. int off_b_len;
  311. int mode;
  312. struct emac_rx_bd __iomem *next;
  313. void *data_ptr;
  314. void *buf_token;
  315. };
  316. /** emac_rxch: EMAC RX Channel data structure
  317. *
  318. * EMAC RX Channel data structure
  319. */
  320. struct emac_rxch {
  321. /* configuration info */
  322. rt_uint32_t num_bd;
  323. rt_uint32_t service_max;
  324. rt_uint32_t buf_size;
  325. char mac_addr[6];
  326. /** CPPI specific */
  327. rt_uint32_t alloc_size;
  328. void __iomem *bd_mem;
  329. struct emac_rx_bd __iomem *bd_pool_head;
  330. struct emac_rx_bd __iomem *active_queue_head;
  331. struct emac_rx_bd __iomem *active_queue_tail;
  332. rt_uint32_t queue_active;
  333. rt_uint32_t teardown_pending;
  334. /* packet and buffer objects */
  335. struct emac_netpktobj pkt_queue;
  336. struct emac_netbufobj buf_queue;
  337. /** statistics */
  338. rt_uint32_t proc_count; /* number of times emac_rx_bdproc is called */
  339. rt_uint32_t processed_bd;
  340. rt_uint32_t recycled_bd;
  341. rt_uint32_t out_of_rx_bd;
  342. rt_uint32_t out_of_rx_buffers;
  343. rt_uint32_t queue_reinit;
  344. rt_uint32_t end_of_queue_add;
  345. rt_uint32_t end_of_queue;
  346. rt_uint32_t mis_queued_packets;
  347. };
  348. struct net_device_stats
  349. {
  350. unsigned long rx_packets; /* total packets received */
  351. unsigned long tx_packets; /* total packets transmitted */
  352. unsigned long rx_bytes; /* total bytes received */
  353. unsigned long tx_bytes; /* total bytes transmitted */
  354. unsigned long rx_errors; /* bad packets received */
  355. unsigned long tx_errors; /* packet transmit problems */
  356. unsigned long rx_dropped; /* no space in linux buffers */
  357. unsigned long tx_dropped; /* no space available in linux */
  358. unsigned long multicast; /* multicast packets received */
  359. unsigned long collisions;
  360. /* detailed rx_errors: */
  361. unsigned long rx_length_errors;
  362. unsigned long rx_over_errors; /* receiver ring buff overflow */
  363. unsigned long rx_crc_errors; /* recved pkt with crc error */
  364. unsigned long rx_frame_errors; /* recv'd frame alignment error */
  365. unsigned long rx_fifo_errors; /* recv'r fifo overrun */
  366. unsigned long rx_missed_errors; /* receiver missed packet */
  367. /* detailed tx_errors */
  368. unsigned long tx_aborted_errors;
  369. unsigned long tx_carrier_errors;
  370. unsigned long tx_fifo_errors;
  371. unsigned long tx_heartbeat_errors;
  372. unsigned long tx_window_errors;
  373. /* for cslip etc */
  374. unsigned long rx_compressed;
  375. unsigned long tx_compressed;
  376. };
  377. /* emac_priv: EMAC private data structure
  378. *
  379. * EMAC adapter private data structure
  380. */
  381. #define MAX_ADDR_LEN 6
  382. struct emac_priv {
  383. /* inherit from ethernet device */
  384. struct eth_device parent;
  385. /* interface address info. */
  386. rt_uint8_t mac_addr[MAX_ADDR_LEN]; /* hw address */
  387. unsigned short phy_addr;
  388. struct rt_semaphore tx_lock;
  389. struct rt_semaphore rx_lock;
  390. void __iomem *remap_addr;
  391. rt_uint32_t emac_base_phys;
  392. void __iomem *emac_base;
  393. void __iomem *ctrl_base;
  394. void __iomem *emac_ctrl_ram;
  395. void __iomem *mdio_base;
  396. rt_uint32_t ctrl_ram_size;
  397. rt_uint32_t hw_ram_addr;
  398. struct emac_txch *txch[EMAC_DEF_MAX_TX_CH];
  399. struct emac_rxch *rxch[EMAC_DEF_MAX_RX_CH];
  400. rt_uint32_t link; /* 1=link on, 0=link off */
  401. rt_uint32_t speed; /* 0=Auto Neg, 1=No PHY, 10,100, 1000 - mbps */
  402. rt_uint32_t duplex; /* Link duplex: 0=Half, 1=Full */
  403. rt_uint32_t rx_buf_size;
  404. rt_uint32_t isr_count;
  405. rt_uint8_t rmii_en;
  406. rt_uint8_t version;
  407. struct net_device_stats net_dev_stats;
  408. rt_uint32_t mac_hash1;
  409. rt_uint32_t mac_hash2;
  410. rt_uint32_t multicast_hash_cnt[EMAC_NUM_MULTICAST_BITS];
  411. rt_uint32_t rx_addr_type;
  412. /* periodic timer required for MDIO polling */
  413. struct rt_timer timer;
  414. rt_uint32_t periodic_ticks;
  415. rt_uint32_t timer_active;
  416. rt_uint32_t phy_mask;
  417. /* mii_bus,phy members */
  418. struct rt_semaphore lock;
  419. };
  420. #endif /* _DAVINCI_EMAC_H */