]> git.sur5r.net Git - freertos/blob - Demo/CORTEX_A2F200_SoftConsole/MicroSemi_Code/drivers/mss_ethernet_mac/mss_ethernet_mac.h
Add in basic uIP files into the A2F demo. Ping is working, but nothing else has...
[freertos] / Demo / CORTEX_A2F200_SoftConsole / MicroSemi_Code / drivers / mss_ethernet_mac / mss_ethernet_mac.h
1 /***************************************************************************//**\r
2  * @file\r
3  * SmartFusion MSS Ethernet MAC header file.\r
4  *\r
5  * (c) Copyright 2007 Actel Corporation\r
6  *\r
7  * SVN $Revision: 2364 $\r
8  * SVN $Date: 2010-03-01 17:58:41 +0000 (Mon, 01 Mar 2010) $\r
9  *\r
10  *******************************************************************************/\r
11 \r
12 #ifndef __MSS_ETHERNET_MAC_H\r
13 #define __MSS_ETHERNET_MAC_H    1\r
14 \r
15 #include <stdint.h>\r
16 \r
17 #ifdef __cplusplus\r
18 extern "C" {\r
19 #endif \r
20 \r
21 /******************************** DEFINES *************************************/\r
22 \r
23 /*******************************************************************************\r
24  * Configure values.\r
25  */\r
26 /**\r
27  * Receive all.\r
28  * When set, all incoming frames are received, regardless of their destination address.\r
29  * An address check is performed, and the result of the check is written into the receive\r
30  * descriptor.\r
31  */\r
32 #define MSS_MAC_CFG_RECEIVE_ALL                         0x00000001u\r
33 \r
34 /**\r
35  * Transmit threshold mode.\r
36  * 1 - Transmit FIFO threshold set for 100 Mbps mode\r
37  * 0 - Transmit FIFO threshold set for 10 Mbps mode\r
38  * This bit can be changed only when a transmit process is in a stopped state.\r
39  */\r
40 #define MSS_MAC_CFG_TRANSMIT_THRESHOLD_MODE             0x00000002u\r
41 \r
42 /**\r
43  * Store and forward.\r
44  * When set, the transmission starts after a full packet is written into the transmit\r
45  * FIFO, regardless of the current FIFO threshold level.\r
46  * This bit can be changed only when the transmit process is in the stopped state.\r
47  */\r
48 #define MSS_MAC_CFG_STORE_AND_FORWARD                   0x00000004u\r
49 \r
50 /**\r
51  * Threshold control bits.\r
52  * These bits, together with TTM, SF, and PS, control the threshold level for the\r
53  * transmit FIFO.\r
54  */\r
55 #define MSS_MAC_CFG_THRESHOLD_CONTROL_00                0x00000000u\r
56 #define MSS_MAC_CFG_THRESHOLD_CONTROL_01                0x00000008u\r
57 #define MSS_MAC_CFG_THRESHOLD_CONTROL_10                0x00000010u\r
58 #define MSS_MAC_CFG_THRESHOLD_CONTROL_11                0x00000018u\r
59 \r
60 /**\r
61  * Full-duplex mode.\r
62  * 0 - Half-duplex mode <br>\r
63  * 1 - Forcing full-duplex mode <br>\r
64  * Changing of this bit is allowed only when both the transmitter and receiver processes\r
65  * are in the stopped state.\r
66  */\r
67 #define MSS_MAC_CFG_FULL_DUPLEX_MODE                    0x00000020u\r
68 \r
69 /**\r
70  * Pass all multicast.\r
71  * When set, all frames with multicast destination addresses will be received, regardless\r
72  * of the address check result.\r
73  */\r
74 #define MSS_MAC_CFG_PASS_ALL_MULTICAST                  0x00000040u\r
75 \r
76 /**\r
77  * Promiscuous mode.\r
78  * When set, all frames will be received regardless of the address check result. An\r
79  * address check is not performed.\r
80  */\r
81 #define MSS_MAC_CFG_PROMISCUOUS_MODE                    0x00000080u\r
82 \r
83 /**\r
84  * Inverse filtering (read-only).\r
85  * If this bit is set when working in a perfect filtering mode, the receiver performs an\r
86  * inverse filtering during the address check process.\r
87  * The 'filtering type' bits of the setup frame determine the state of this bit.\r
88  */\r
89 #define MSS_MAC_CFG_INVERSE_FILTERING                   0x00000100u\r
90 \r
91 /**\r
92  * Pass bad frames.\r
93  * When set, Core10/100 transfers all frames into the data buffers, regardless of the\r
94  * receive errors. This allows the runt frames, collided fragments, and truncated frames\r
95  * to be received.\r
96  */\r
97 #define MSS_MAC_CFG_PASS_BAD_FRAMES                     0x00000200u\r
98 \r
99 /**\r
100  * Hash-only filtering mode (read-only).\r
101  * When set, Core10/100 performs an imperfect filtering over both the multicast and\r
102  * physical addresses.\r
103  * The 'filtering type' bits of the setup frame determine the state of this bit.\r
104  */\r
105 #define MSS_MAC_CFG_HASH_ONLY_FILTERING_MODE            0x00000400u\r
106 \r
107 /**\r
108  * Hash/perfect receive filtering mode (read-only).\r
109  * 0 - Perfect filtering of the incoming frames is performed according to the physical\r
110  * addresses specified in a setup frame. <br>\r
111  * 1 - Imperfect filtering over the frames with the multicast addresses is performed\r
112  * according to the hash table specified in a setup frame. <br>\r
113  * A physical address check is performed according to the CSR6.2 (HO, hash-only) bit.\r
114  * When both the HO and HP bits are set, an imperfect filtering is performed on all of\r
115  * the addresses.\r
116  * The 'filtering type' bits of the setup frame determine the state of this bit.\r
117  */\r
118 #define MSS_MAC_CFG_HASH_PERFECT_RECEIVE_FILTERING_MODE 0x00000800u\r
119 \r
120 \r
121 /*******************************************************************************\r
122  * Link status values.\r
123  */\r
124 #define MSS_MAC_LINK_STATUS_LINK  0x0001u   /**< Link up/down */\r
125 #define MSS_MAC_LINK_STATUS_100MB 0x0002u   /**< Connection is 100Mb/10Mb */\r
126 #define MSS_MAC_LINK_STATUS_FDX   0x0004u   /**< Connection is full/half duplex */\r
127 \r
128 \r
129 /**\r
130  * Size of the max packet that can be received/transmited.\r
131  */\r
132 #define MSS_MAX_PACKET_SIZE  1514uL\r
133 \r
134 /**\r
135  * Size of a receive/transmit buffer.\r
136  * Buffer size must be enough big to hold a full frame and must be multiple of\r
137  * four. For rx buffer +4 bytes allocated for crc values. These bytes doesn't\r
138  * copied to the user buffer.\r
139  */\r
140 #define MSS_TX_BUFF_SIZE  ((MSS_MAX_PACKET_SIZE + 3u) & (~(uint32_t)3))\r
141 #define MSS_RX_BUFF_SIZE  ((MSS_MAX_PACKET_SIZE + 7u) & (~(uint32_t)3))\r
142 \r
143 /*******************************************************************************\r
144  * Time out values.\r
145  */\r
146 #define MSS_MAC_NONBLOCKING             0u\r
147 #define MSS_MAC_BLOCKING                0xFFFFFFFFUL\r
148 \r
149 /***************************************************************************//**\r
150  * MAC events.\r
151  */\r
152 #define MSS_MAC_EVENT_PACKET_SEND               1u\r
153 #define MSS_MAC_EVENT_PACKET_RECEIVED   2u\r
154 \r
155 /***************************************************************************//**\r
156  * PHY addresses.\r
157  */\r
158 #define MSS_PHY_ADDRESS_MIN                             0u\r
159 #define MSS_PHY_ADDRESS_MAX                             31u\r
160 #define MSS_PHY_ADDRESS_AUTO_DETECT             255u\r
161 \r
162 /***************************************************************************//**\r
163  * Listener function type defines the function prototype that might be followed \r
164  * by MAC_isr which is triggered with each receive and transmit related interrupts.\r
165  * Listener functions should follow the following prototype:\r
166  *              void MAC_Listener( uint32_t events );\r
167  * The parameter is used to inform the listener function about the triggering event\r
168  * or events. Events input to the system are:\r
169  *      #define MSS_MAC_EVENT_PACKET_SEND               1\r
170  *      #define MSS_MAC_EVENT_PACKET_RECEIVED   2\r
171  * Listener function should be defined by the application using this driver if \r
172  * needed. This function may be assigned to the driver using MAC_set_callback\r
173  * routine and may be un assigned again by using the same routine with a NULL pointer\r
174  * as the event listener function. It is recommended to use this property for interrupt\r
175  * triggered systems and it is not recommended for polling mechanisms.\r
176  */\r
177 typedef void (*MSS_MAC_callback_t)(uint32_t events);\r
178 \r
179 /***************************************************************************//**\r
180  * Statistics counter identifiers are used with MAC_get_statistics routine to \r
181  * receive the count of the requested errors/interrupts occurrences.\r
182  *\r
183  * MSS_MAC_RX_INTERRUPTS\r
184  *      Used to receive the number of receive interrupts occurred.\r
185  *\r
186  * MSS_MAC_RX_FILTERING_FAIL\r
187  *      Used to receive the number of received frames which did not pass the\r
188  *      address recognition process.\r
189  *\r
190  * MSS_MAC_RX_DESCRIPTOR_ERROR\r
191  *      Used to receive the number of occurrences of; no receive buffer was\r
192  *      available when trying to store the received data.\r
193  *\r
194  * MSS_MAC_RX_RUNT_FRAME\r
195  *      Used to receive the number of occurrences of; the frame is damaged by a\r
196  *      collision or by a premature termination before the end of a collision\r
197  *      window.\r
198  *\r
199  * MSS_MAC_RX_NOT_FIRST\r
200  *      Used to receive the number of occurrences of; start of the frame is not\r
201  *      the first descriptor of a frame.\r
202  *\r
203  * MSS_MAC_RX_NOT_LAST\r
204  *      Used to receive the number of occurrences of; end of the frame is not\r
205  *      the first descriptor of a frame.\r
206  *\r
207  * MSS_MAC_RX_FRAME_TOO_LONG\r
208  *      Used to receive the number of occurrences of; a current frame is longer\r
209  *      than maximum size of 1,518 bytes, as specified by 802.3.\r
210  *\r
211  * MSS_MAC_RX_COLLISION_SEEN\r
212  *      Used to receive the number of occurrences of; a late collision was seen\r
213  *      (collision after 64 bytes following SFD).\r
214  *\r
215  * MSS_MAC_RX_CRC_ERROR\r
216  *      Used to receive the number of occurrences of; a CRC error has occurred\r
217  *      in the received frame.\r
218  *\r
219  * MSS_MAC_RX_FIFO_OVERFLOW\r
220  *      Used to receive the number of frames not accepted due to the receive\r
221  *      FIFO overflow.\r
222  *\r
223  * MSS_MAC_RX_MISSED_FRAME\r
224  *      Used to receive the number of frames not accepted due to the\r
225  *      unavailability of the receive descriptor.\r
226  *\r
227  * MSS_MAC_TX_INTERRUPTS\r
228  *      Used to receive the number of transmit interrupts occurred.\r
229  *\r
230  * MSS_MAC_TX_LOSS_OF_CARRIER\r
231  *      Used to receive the number of occurrences of; a loss of the carrier\r
232  *      during a transmission.\r
233  *\r
234  * MSS_MAC_TX_NO_CARRIER\r
235  *      Used to receive the number of occurrences of; the carrier was not asserted\r
236  *      by an external transceiver during the transmission.\r
237  *\r
238  * MSS_MAC_TX_LATE_COLLISION\r
239  *      Used to receive the number of occurrences of; a collision was detected\r
240  *      after transmitting 64 bytes.\r
241  *\r
242  * MSS_MAC_TX_EXCESSIVE_COLLISION\r
243  *      Used to receive the number of occurrences of; the transmission was aborted\r
244  *      after 16 retries.\r
245  *\r
246  * MSS_MAC_TX_COLLISION_COUNT\r
247  *      Used to receive the number of collisions occurred.\r
248  *\r
249  * MSS_MAC_TX_UNDERFLOW_ERROR\r
250  *      Used to receive the number of occurrences of; the FIFO was empty during\r
251  *      the frame transmission.\r
252  */\r
253 typedef enum {\r
254         MSS_MAC_RX_INTERRUPTS,\r
255         MSS_MAC_RX_FILTERING_FAIL,\r
256         MSS_MAC_RX_DESCRIPTOR_ERROR,\r
257         MSS_MAC_RX_RUNT_FRAME,\r
258         MSS_MAC_RX_NOT_FIRST,\r
259         MSS_MAC_RX_NOT_LAST,\r
260         MSS_MAC_RX_FRAME_TOO_LONG,\r
261         MSS_MAC_RX_COLLISION_SEEN,\r
262         MSS_MAC_RX_CRC_ERROR,\r
263         MSS_MAC_RX_FIFO_OVERFLOW,\r
264         MSS_MAC_RX_MISSED_FRAME,\r
265         \r
266         MSS_MAC_TX_INTERRUPTS,\r
267         MSS_MAC_TX_LOSS_OF_CARRIER,\r
268         MSS_MAC_TX_NO_CARRIER,\r
269         MSS_MAC_TX_LATE_COLLISION,\r
270         MSS_MAC_TX_EXCESSIVE_COLLISION,\r
271         MSS_MAC_TX_COLLISION_COUNT,\r
272         MSS_MAC_TX_UNDERFLOW_ERROR\r
273 } mss_mac_statistics_id_t; \r
274 \r
275 /******************************* FUNCTIONS ************************************/\r
276 \r
277 /***************************************************************************//**\r
278  * Initializes an Ethernet MAC controller and data structures.\r
279  * This function will prepare the Ethernet Controller for first time use in a\r
280  * given hardware/software configuration. This function should be called before\r
281  * any other Ethernet API functions are called.\r
282  *\r
283  * Initialization of registers - config registers, enable Tx/Rx interrupts,\r
284  * enable Tx/Rx, initialize MAC addr, init PHY, autonegotiation, MAC address\r
285  * filter table (unicast/multicast)/hash init\r
286  *\r
287  */\r
288 void\r
289 MSS_MAC_init\r
290 (\r
291     uint8_t phy_address\r
292 );\r
293 \r
294 \r
295 /***************************************************************************//**\r
296  * Sets the configuration of the Ethernet Controller.\r
297  * After the MAC_init function has been called, this API function can be\r
298  * used to configure the various features of the Ethernet Controller.\r
299  *\r
300  * @param configuration The logical OR of the following values:\r
301  *    - #MSS_MAC_CFG_RECEIVE_ALL\r
302  *    - #MSS_MAC_CFG_TRANSMIT_THRESHOLD_MODE\r
303  *    - #MSS_MAC_CFG_STORE_AND_FORWARD\r
304  *    - #MSS_MAC_CFG_THRESHOLD_CONTROL_[00,01,10,11]\r
305  *    - #MSS_MAC_CFG_FULL_DUPLEX_MODE\r
306  *    - #MSS_MAC_CFG_PASS_ALL_MULTICAST\r
307  *    - #MSS_MAC_CFG_PROMISCUOUS_MODE\r
308  *    - #MSS_MAC_CFG_PASS_BAD_FRAMES\r
309  * @see   MAC_get_configuration()\r
310  */\r
311 void\r
312 MSS_MAC_configure\r
313 (\r
314     uint32_t configuration\r
315 );\r
316 \r
317 \r
318 /***************************************************************************//**\r
319  * Returns the configuration of the Ethernet Controller.\r
320  * After the MAC_init function has been called, this API function can be used to \r
321  * get the configuration of the Ethernet Controller.\r
322  *\r
323  * @return              The logical OR of the following values:\r
324  *    - #MSS_MAC_CFG_RECEIVE_ALL\r
325  *    - #MSS_MAC_CFG_TRANSMIT_THRESHOLD_MODE\r
326  *    - #MSS_MAC_CFG_STORE_AND_FORWARD\r
327  *    - #MSS_MAC_CFG_THRESHOLD_CONTROL_[00,01,10,11]\r
328  *    - #MSS_MAC_CFG_FULL_DUPLEX_MODE\r
329  *    - #MSS_MAC_CFG_PASS_ALL_MULTICAST\r
330  *    - #MSS_MAC_CFG_PROMISCUOUS_MODE\r
331  *    - #MSS_MAC_CFG_INVERSE_FILTERING\r
332  *    - #MSS_MAC_CFG_PASS_BAD_FRAMES\r
333  *    - #MSS_MAC_CFG_HASH_ONLY_FILTERING_MODE\r
334  *    - #MSS_MAC_CFG_HASH_PERFECT_RECEIVE_FILTERING_MODE\r
335  * @see   MAC_configure()\r
336  */\r
337 int32_t\r
338 MSS_MAC_get_configuration\r
339 (\r
340     void\r
341 );\r
342 \r
343 \r
344 /***************************************************************************//**\r
345  * Sends a packet to the Ethernet Controller.\r
346  * This function writes pacLen bytes of the packet contained in pacData into the\r
347  * transmit FIFO of the controller and then activates the transmitter for this\r
348  * packet. If space is available in FIFO, the function will return once lBufLen\r
349  * bytes of the packet have been placed into the FIFO and the transmitter has been\r
350  * started. The function will not wait for the transmission to complete. If space\r
351  * is not available in FIFO, the function will keep trying till time_out expires,\r
352  * if MSS_MAC_BLOCKING value is given as time_out, function will wait for the\r
353  * transmission to complete.\r
354  *\r
355  * @param pacData       the pointer to the packet data to be transmitted.\r
356  * @param pacLen        number of bytes in the packet to be transmitted.\r
357  * @param time_out      Time out value for transmision.\r
358  *                                          If value is #MSS_MAC_BLOCKING, there will be no time out.\r
359  *                                      If value is #MSS_MAC_NONBLOCKING, function will return immediately \r
360  *                                      on buffer full case.\r
361  *                                      Otherwise value must be greater than 0 and smaller than \r
362  *                                      0x01000000.\r
363  * @return                              Returns 0 if time out occurs otherwise returns size \r
364  *                                              of the packet.\r
365  * @see   MAC_rx_packet()\r
366  */\r
367 int32_t\r
368 MSS_MAC_tx_packet\r
369 (\r
370     const uint8_t *pacData,\r
371     uint16_t pacLen,\r
372     uint32_t time_out\r
373 );\r
374 \r
375 \r
376 /***************************************************************************//**\r
377  * Returns available packet's size.\r
378  *\r
379  * @return              Size of packet, bigger than 0, if a packet is available,\r
380  *                      if not, returns 0. \r
381  * @see   MAC_rx_packet()\r
382  */\r
383 int32_t\r
384 MSS_MAC_rx_pckt_size\r
385 (\r
386     void\r
387 );\r
388 \r
389 \r
390 \r
391 /***************************************************************************//**\r
392  * Prepares the RX descriptor for receiving packets.\r
393  *\r
394  * @return              void\r
395  * @see   MAC_rx_packet()\r
396  */\r
397 void\r
398 MSS_MAC_prepare_rx_descriptor\r
399 (\r
400     void\r
401 );\r
402 \r
403 /***************************************************************************//**\r
404  * Receives a packet from the Ethernet Controller.\r
405  * This function reads a packet from the receive FIFO of the controller and\r
406  * places it into pacData. If time_out parameter is zero the function will return \r
407  * immediately (after the copy operation if data is available. Otherwise the function\r
408  * will keep trying to read till time_out expires or data is read, if MSS_MAC_BLOCKING \r
409  * value is given as time_out, function will wait for the reception to complete.\r
410  *\r
411  * @param pacData       The pointer to the buffer where received packet data will\r
412  *                      be copied. Memory for the buffer should be allocated prior \r
413  *                      to calling this function.\r
414  * @param pacLen        Size of the buffer, which the received data will be copied in,\r
415  *                      given in number of bytes.\r
416  * @param time_out      Time out value in milli seconds for receiving.\r
417  *                                          if value is #MSS_MAC_BLOCKING, there will be no time out.\r
418  *                                          if value is #MSS_MAC_NONBLOCKING, function will return immediately\r
419  *                                          if there is no packet waiting.\r
420  *                                          Otherwise value must be greater than 0 and smaller than \r
421  *                                          0x01000000.\r
422  * @return              Size of packet if packet fits in pacData.\r
423  *                                          0 if there is no received packet.\r
424  * @see   MAC_rx_pckt_size()\r
425  * @see   MAC_tx_packet()\r
426  */\r
427 int32_t\r
428 MSS_MAC_rx_packet\r
429 (\r
430     uint8_t **pacData,\r
431     uint16_t pacLen,\r
432     uint32_t time_out\r
433 );\r
434 \r
435 \r
436 /***************************************************************************//**\r
437   Receives a packet from the Ethernet Controller.\r
438   The MSS_MAC_rx_packet_ptrset() function is very similar to the MSS_MAC_rx_packet()\r
439   function, in that it receives data from the MSS Ethernet MAC. The difference\r
440   is that it sets pacData to point to the memory buffer where the MSS Ethernet\r
441   MAC copied the received packet instead of copying the received packet into a\r
442   buffer provided by the application. After this function is called and data is\r
443   used by the user application or copied to another buffer, the\r
444   MSS_MAC_prepare_rx_descriptor() function must be called to free up the receive\r
445   memory buffer used by the MSS Ethernet MAC\r
446  \r
447   @param pacData\r
448    The pacData parameter is a pointer to a memory buffer pointer. The uint8_t\r
449    pointer pointed to by the pacData parameter will contain the address of the\r
450    memory buffer containing the received packet after this function returns. The\r
451    value of pacData is only valid if the return value is larger than zero,\r
452    indicating that a packet was received.\r
453    \r
454   @param time_out\r
455     The time_out parameter is the timeout value for the transmission in milliseconds.\r
456     The time_out parameter value can be one of the following values:\r
457         \95 Unsigned integer greater than 0 and less than 0x01000000\r
458         \95 MSS_MAC_BLOCKING \96 there will be no timeout. \r
459         \95 MSS_MAC_NONBLOCKING \96 the function will return immediately if no packets\r
460           have been received. \r
461 \r
462   @return\r
463         The function returns the size of the packet if the packet fits in pacData.\r
464     Returns zero if there is no received packet.\r
465                         \r
466   @see   MAC_rx_pckt_size()\r
467   @see   MAC_tx_packet()\r
468  */\r
469 int32_t\r
470 MSS_MAC_rx_packet_ptrset\r
471 (\r
472     uint8_t **pacData,\r
473     uint32_t time_out\r
474 );\r
475 \r
476 /***************************************************************************//**\r
477  * Returns the status of connection by reading it from the PHY.\r
478  *\r
479  * @return              the logical OR of the following values:\r
480  *      #MSS_MAC_LINK_STATUS_LINK    - Link up/down\r
481  *      #MSS_MAC_LINK_STATUS_100MB   - Connection is 100Mb/10Mb\r
482  *      #MSS_MAC_LINK_STATUS_FDX     - Connection is full/half duplex\r
483  * @see   MAC_auto_setup_link()\r
484  */\r
485 int32_t\r
486 MSS_MAC_link_status\r
487 (\r
488     void\r
489 );\r
490 \r
491 \r
492 /***************************************************************************//**\r
493  * Setups the link between PHY and MAC and returns the status of connection.\r
494  *\r
495  * @return              the logical OR of the following values:\r
496  *      #MSS_MAC_LINK_STATUS_LINK    - Link up/down\r
497  *      #MSS_MAC_LINK_STATUS_100MB   - Connection is 100Mb/10Mb\r
498  *      #MSS_MAC_LINK_STATUS_FDX     - Connection is full/half duplex\r
499  * @see   MAC_link_status()\r
500  */\r
501 int32_t\r
502 MSS_MAC_auto_setup_link\r
503 (\r
504     void\r
505 );\r
506 \r
507 \r
508 /***************************************************************************//**\r
509  * Sets mac address.\r
510  *\r
511  * @param new_address   Pointer to then new address value (6 bytes of data)\r
512  * @see   MAC_get_mac_address()\r
513  */\r
514 void\r
515 MSS_MAC_set_mac_address\r
516 (\r
517     const uint8_t *new_address\r
518 );\r
519 \r
520 \r
521 /***************************************************************************//**\r
522  * Returns mac address.\r
523  *\r
524  * @param address       Pointer to the parameter to receive the MAC address.\r
525  * @see   MAC_set_mac_address()\r
526  */\r
527 void\r
528 MSS_MAC_get_mac_address\r
529 (\r
530     uint8_t *address\r
531 );\r
532 \r
533 \r
534 /***************************************************************************//**\r
535  * Sets mac address filters.\r
536  * If less than 15 addresses are subscribed, system works on perfect filtering mode\r
537  * else system works in hash table mode\r
538  *\r
539  * @param filter_count  number of addresses\r
540  * @param filters       Pointer to addresses to be filtered\r
541  */\r
542 void\r
543 MSS_MAC_set_mac_filters\r
544 (\r
545     uint16_t filter_count,\r
546         const uint8_t *filters\r
547 );\r
548 \r
549 /***************************************************************************//**\r
550  * Sets MAC event listener.\r
551  * Sets the given event listener function to be triggered inside MAC_isr().\r
552  * Assigning NULL pointer as the listener function will disable it.\r
553  *\r
554  * @param listener      function pointer to a MSS_MAC_callback_t function\r
555  * @see   MAC_isr()\r
556  */\r
557 void\r
558 MSS_MAC_set_callback\r
559 (\r
560     MSS_MAC_callback_t listener\r
561 );\r
562 \r
563 \r
564 /***************************************************************************//**\r
565  * Returns description of latest error happened.\r
566  *\r
567  * @return              A string describing the error. This string must not be \r
568  *                                              modified by the application.\r
569  */\r
570 const int8_t* \r
571 MSS_MAC_last_error\r
572 (\r
573     void\r
574 );\r
575 \r
576 \r
577 /***************************************************************************//**\r
578  * Returns statistics counter of stat_id identifier.\r
579  * \r
580  * @param stat_id               Identifier of statistics counter.\r
581  * @return                              Statistics counter of stat_id identifier.\r
582  *                                              On error returns 0.\r
583  */\r
584 uint32_t\r
585 MSS_MAC_get_statistics\r
586 (\r
587         mss_mac_statistics_id_t stat_id\r
588 );\r
589 \r
590 #ifdef __cplusplus\r
591 }\r
592 #endif\r
593 \r
594 #endif  /* __MSS_ETHERNET_MAC_H */\r
595 \r