00001 00011 #ifndef _RXL_CNTRL_H_ 00012 #define _RXL_CNTRL_H_ 00013 00038 /* 00039 * INCLUDE FILES 00040 **************************************************************************************** 00041 */ 00042 // standard includes 00043 #include "co_int.h" 00044 00045 // for co_list 00046 #include "co_list.h" 00047 00048 // for co_ring 00049 #include "co_ring.h" 00050 00051 #include "dma.h" 00052 00053 /* 00054 * DEFINES 00055 **************************************************************************************** 00056 */ 00058 #if NX_FULLY_HOSTED 00059 #define RX_DATA_UPLOAD_CHAN IPC_DMA_CHANNEL_INTERNAL 00060 #else 00061 #define RX_DATA_UPLOAD_CHAN IPC_DMA_CHANNEL_DATA_RX 00062 #endif 00063 00065 #define DMA_HD_RXPATTERN 0xAAAAAA00 00066 00068 enum rx_upload_flags 00069 { 00071 RX_NO_UPLOAD = CO_BIT(0), 00072 }; 00073 00074 /* 00075 * MACROS 00076 **************************************************************************************** 00077 */ 00078 00079 #if (NX_UMAC_PRESENT) 00081 #define RXL_CNTRL_FRAME_INFO_SET(bit) \ 00082 (rxl_cntrl_env.rx_status.frame_info |= RXL_CNTRL_ ## bit) 00083 00085 #define RXL_CNTRL_FRAME_INFO_GET(bit) \ 00086 (rxl_cntrl_env.rx_status.frame_info & RXL_CNTRL_ ## bit) 00087 #endif //(NX_UMAC_PRESENT) 00088 00090 #define RX_LLICTRL(irqenable) \ 00091 ((irqenable)?(IPC_DMA_LLI_COUNTER_EN|(IPC_DMA_LLI_DATA_RX0<<IPC_DMA_LLI_COUNTER_POS) \ 00092 | IPC_DMA_LLI_IRQ_EN|(IPC_DMA_LLI_DATA_RX0 << IPC_DMA_LLI_IRQ_POS)) : 0) 00093 00094 /* 00095 * ENUMERATIONS 00096 **************************************************************************************** 00097 */ 00098 00099 /* 00100 * TYPES DECLARATION 00101 **************************************************************************************** 00102 */ 00103 // forward declarations 00104 struct rxdesc; 00105 00107 typedef void (*cb_rx_dma_func_ptr)(void *); 00108 00110 struct rxl_cntrl_env_tag 00111 { 00113 struct co_list upload_pending; 00115 uint16_t bridgedmacnt; 00116 #if !NX_FULLY_HOSTED 00118 uint8_t packet_cnt; 00120 uint8_t packet_thd; 00121 #endif 00122 }; 00123 00125 struct rx_upload_cntrl_tag 00126 { 00128 struct co_list_hdr list_hdr; 00130 cb_rx_dma_func_ptr cb; 00132 void *env; 00135 struct rxdesc *rxdesc; 00137 uint8_t flags; 00138 }; 00139 00140 /* 00141 * GLOBAL VARIABLES 00142 **************************************************************************************** 00143 */ 00145 extern struct rxl_cntrl_env_tag rxl_cntrl_env; 00146 00147 /* 00148 * FUNCTION DEFINITIONS 00149 **************************************************************************************** 00150 */ 00158 __INLINE void rxl_upload_cntrl_push_pending(struct rx_upload_cntrl_tag *upload_cntrl) 00159 { 00160 // Insert the element in the pending list 00161 co_list_push_back(&rxl_cntrl_env.upload_pending, &upload_cntrl->list_hdr); 00162 } 00163 00171 __INLINE bool rxl_upload_pending(void) 00172 { 00173 return (!co_list_is_empty(&rxl_cntrl_env.upload_pending)); 00174 } 00175 00181 void rxl_init(void); 00182 00191 void rxl_reset(void); 00192 00204 void rxl_cntrl_evt(int dummy); 00205 00215 void rxl_host_irq_mitigation_update(void *env); 00216 00226 void rxl_timeout_int_handler(void); 00227 00236 void rxl_dma_int_handler(void); 00237 00249 void rxl_dma_evt(int dummy); 00250 00251 00253 00254 #endif // _RXL_CNTRL_H_
1.6.1