Ignore:
Timestamp:
Jan 13, 2021, 12:47:53 AM (3 years ago)
Author:
alain
Message:

cosmetic

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/hal/tsar_mips32/drivers/soclib_nic.h

    r658 r686  
    2626
    2727#include <chdev.h>
     28#include <kernel_config.h>
    2829#include <hal_kernel_types.h>
    2930
     
    4344 * in two memory mapped software FIFOs, called NIC_TX_QUEUE and NIC_RX_QUEUE, implemented
    4445 * 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 defined
    46  * parameter. The data transfer unit between is a container (one single packet).
    47  *
    48  * - The "container" structure contains a 2040 bytes data buffer, the packet length, and
    49  *   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).
    5051 *   For each container, the state variable is used as a SET/RESET flip-flop to synchronize
    5152 *   the software server thread, and the hardware NIC DMA engines.
     
    126127
    127128/********************************************************************************************
    128  * This structure defines the chbuf descriptor, used to implement both the RX and TX packets
     129 * This structure defines the soclib_nic chbuf descriptor, used to implement the RX and TX
    129130 * queues. Each container contains one single packet, and has only two states (full/empty).
    130131 * All containers are allocated in the same cluster as the associated NIC chdev descriptor.
     
    136137 *******************************************************************************************/
    137138
    138 #define SOCLIB_NIC_CHBUF_DEPTH   8
    139 
    140139typedef struct nic_chbuf_s
    141140{
    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    */
    146145}
    147146nic_chbuf_t;
    148147
    149148/********************************************************************************************
    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.
    151151 *******************************************************************************************/
    152152
     
    212212
    213213/********************************************************************************************
    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.
    220221 ********************************************************************************************
    221222 * @ chdev     : local pointer on NIC chdev descriptor.
Note: See TracChangeset for help on using the changeset viewer.