Changeset 686 for trunk/hal/tsar_mips32/drivers/soclib_nic.h
- Timestamp:
- Jan 13, 2021, 12:47:53 AM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/hal/tsar_mips32/drivers/soclib_nic.h
r658 r686 26 26 27 27 #include <chdev.h> 28 #include <kernel_config.h> 28 29 #include <hal_kernel_types.h> 29 30 … … 43 44 * in two memory mapped software FIFOs, called NIC_TX_QUEUE and NIC_RX_QUEUE, implemented 44 45 * as chained buffers (chbuf). Each slot in these FIFOs is a container, containing one 45 * single packet. The number of containers, defining the queue depth, is a software defined46 * parameter. The data transfer unit between is acontainer (one single packet).47 * 48 * - The "container" structure contains a 2040 bytes data buffer, the packet length, and49 * the container state: full (owned by the reader) / empty (owned by the writer).46 * single packet. The number of containers, defining the queue depth, is defined by the 47 * CONFIG_SOCK_QUEUES_DEPTH. The data transfer unit is one container (one single packet). 48 * 49 * - One container contains a 2040 bytes data buffer, the packet length (4bytes), and the 50 * container state (4 bytes) : full (owned by the reader) / empty (owned by the writer). 50 51 * For each container, the state variable is used as a SET/RESET flip-flop to synchronize 51 52 * the software server thread, and the hardware NIC DMA engines. … … 126 127 127 128 /******************************************************************************************** 128 * This structure defines the chbuf descriptor, used to implement both the RX and TX packets129 * This structure defines the soclib_nic chbuf descriptor, used to implement the RX and TX 129 130 * queues. Each container contains one single packet, and has only two states (full/empty). 130 131 * All containers are allocated in the same cluster as the associated NIC chdev descriptor. … … 136 137 *******************************************************************************************/ 137 138 138 #define SOCLIB_NIC_CHBUF_DEPTH 8139 140 139 typedef struct nic_chbuf_s 141 140 { 142 uint32_t wid; /*! current container write index*/143 uint32_t rid; /*! current container read index*/144 uint64_t cont_pad[ SOCLIB_NIC_CHBUF_DEPTH]; /*! containers physical base addresses*/145 uint32_t * cont_ptr[ SOCLIB_NIC_CHBUF_DEPTH]; /*! containers virtual base addresses*/141 uint32_t wid; /*! current container write index */ 142 uint32_t rid; /*! current container read index */ 143 uint64_t cont_pad[CONFIG_SOCK_QUEUES_DEPTH]; /*! containers physical base addresses */ 144 uint32_t * cont_ptr[CONFIG_SOCK_QUEUES_DEPTH]; /*! containers virtual base addresses */ 146 145 } 147 146 nic_chbuf_t; 148 147 149 148 /******************************************************************************************** 150 * This structure defines the container descriptor format. 149 * This structure defines the soclib_nic container descriptor format. 150 * One container occupies exactly 2048 bytes. 151 151 *******************************************************************************************/ 152 152 … … 212 212 213 213 /******************************************************************************************** 214 * This ISR is executed when a new RX container has been moved to an empty TX queue, 215 * or when a TX container has been removed from a full TX queue. In both cases, it 216 * reactivate the corresponding server thread from the BLOCKED_ISR condition. 217 * It is also executed in case of error reported by the DMA engines accessing the TX or RX 218 * queues. It simply print an error message on the kernel terminal. 219 * TODO improve this error handling... 214 * This ISR is executed in four cases : 215 * - when a RX container has been moved to an empty RX queue by the RX DMA engine, 216 * - when a TX container has been removed from a full TX queue by the TX DMA engine, 217 * - when an error is reported by the RX DMA engine accessing the RX queue, 218 * - when an error is reported by the TX DMA engine accessing the TX queue, 219 * In all cases it simply reactivates the corresponding TX or RX server thread, 220 * and signal the event type in writing the relevant value in the command "error" field. 220 221 ******************************************************************************************** 221 222 * @ chdev : local pointer on NIC chdev descriptor.
Note: See TracChangeset
for help on using the changeset viewer.