]> git.sur5r.net Git - freertos/blob - FreeRTOS/Demo/CORTEX_A9_Zynq_ZC702/RTOSDemo/src/Full_Demo/lwIP_port/include/netif/xaxiemacif.h
Move the Zynq's lwIP example from the Full demo into its own configuration as having...
[freertos] / FreeRTOS / Demo / CORTEX_A9_Zynq_ZC702 / RTOSDemo / src / Full_Demo / lwIP_port / include / netif / xaxiemacif.h
1 /*
2  * Copyright (c) 2010-2013 Xilinx, Inc.  All rights reserved.
3  *
4  * Xilinx, Inc.
5  * XILINX IS PROVIDING THIS DESIGN, CODE, OR INFORMATION "AS IS" AS A
6  * COURTESY TO YOU.  BY PROVIDING THIS DESIGN, CODE, OR INFORMATION AS
7  * ONE POSSIBLE   IMPLEMENTATION OF THIS FEATURE, APPLICATION OR
8  * STANDARD, XILINX IS MAKING NO REPRESENTATION THAT THIS IMPLEMENTATION
9  * IS FREE FROM ANY CLAIMS OF INFRINGEMENT, AND YOU ARE RESPONSIBLE
10  * FOR OBTAINING ANY RIGHTS YOU MAY REQUIRE FOR YOUR IMPLEMENTATION.
11  * XILINX EXPRESSLY DISCLAIMS ANY WARRANTY WHATSOEVER WITH RESPECT TO
12  * THE ADEQUACY OF THE IMPLEMENTATION, INCLUDING BUT NOT LIMITED TO
13  * ANY WARRANTIES OR REPRESENTATIONS THAT THIS IMPLEMENTATION IS FREE
14  * FROM CLAIMS OF INFRINGEMENT, IMPLIED WARRANTIES OF MERCHANTABILITY
15  * AND FITNESS FOR A PARTICULAR PURPOSE.
16  *
17  */
18
19 #ifndef __NETIF_XAXIEMACIF_H__
20 #define __NETIF_XAXIEMACIF_H__
21
22 #ifdef __cplusplus
23 extern "C" {
24 #endif
25
26 #include "xlwipconfig.h"
27 #include "lwip/netif.h"
28 #include "netif/etharp.h"
29 #include "netif/xadapter.h"
30
31 #include "xparameters.h"
32 #include "xstatus.h"
33
34 #include "xaxiethernet.h"
35 #ifdef XLWIP_CONFIG_INCLUDE_AXI_ETHERNET_FIFO
36 #include "xllfifo.h"
37 #else
38 #include "xaxidma.h"
39 #include "xaxidma_hw.h"
40 #endif
41
42 #include "netif/xpqueue.h"
43 #include "xlwipconfig.h"
44
45 void    xaxiemacif_setmac(u32_t index, u8_t *addr);
46 u8_t*   xaxiemacif_getmac(u32_t index);
47 err_t   xaxiemacif_init(struct netif *netif);
48 int     xaxiemacif_input(struct netif *netif);
49
50 unsigned get_IEEE_phy_speed(XAxiEthernet *xaxiemacp);
51 unsigned configure_IEEE_phy_speed(XAxiEthernet *xaxiemacp, unsigned speed);
52 unsigned Phy_Setup (XAxiEthernet *xaxiemacp);
53
54 /* xaxiemacif_hw.c */
55 void    xaxiemac_error_handler(XAxiEthernet * Temac);
56
57 /* structure within each netif, encapsulating all information required for
58  * using a particular temac instance
59  */
60 typedef struct {
61 #ifdef XLWIP_CONFIG_INCLUDE_AXI_ETHERNET_FIFO
62         XLlFifo      axififo;
63 #else
64         XAxiDma      axidma;
65 #endif
66         XAxiEthernet axi_ethernet;
67
68         /* queue to store overflow packets */
69         pq_queue_t *recv_q;
70         pq_queue_t *send_q;
71
72         /* pointers to memory holding buffer descriptors (used only with SDMA) */
73         void *rx_bdspace;
74         void *tx_bdspace;
75 } xaxiemacif_s;
76
77 extern xaxiemacif_s xaxiemacif;
78
79 int     is_tx_space_available(xaxiemacif_s *emac);
80
81 /* xaxiemacif_dma.c */
82 #ifndef XLWIP_CONFIG_INCLUDE_AXI_ETHERNET_FIFO
83 XStatus init_axi_dma(struct xemac_s *xemac);
84 int  process_sent_bds(XAxiDma_BdRing *txring);
85
86 void axidma_send_handler(void *arg);
87 XStatus axidma_sgsend(xaxiemacif_s *xaxiemacif, struct pbuf *p);
88 #endif
89
90 #ifdef __cplusplus
91 }
92 #endif
93
94 #endif /* __NETIF_XAXIEMACIF_H__ */