Changes between Version 7 and Version 8 of nic_driver


Ignore:
Timestamp:
Oct 25, 2014, 3:24:29 PM (10 years ago)
Author:
alain
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • nic_driver

    v7 v8  
    1010 
    1111 * The ''_nic_cma_start_send()'' and ''_nic_cma_start_receive()'' functions use the ''vci_chbuf_dma'' component to transfer a flow of packets between a chained buffer in kernel space and the NIC internal chained buffer. They are non blocking. One NIC channel and two CMA channels (TX  and RX) must be allocated to the calling task in the mapping.
     12
     13All these access functions return -1 in case of error (illegal arguments).
    1214
    1315The SEG_NIC_BASE address and the NB_NIC_CHANNELS parameter must be defined in the hard_config.h file.
     
    2325 * '''bc_enable''' : broadcast packets accepted if non zero
    2426 * '''bypass_enable''' : TX -> RX bypass supported if non zero
    25 This function is used only by the boot code.
     27This function is used only by the boot code, and return always 0.
    2628
    2729 === void '''_nic_channel_init'''( unsigned int index,  unsigned int mac4,  unsigned int mac2 ) ===
     
    3032 * '''mac4''' : 32 LSB bits of the MAC address.
    3133 * '''mac2''' : 16 MSB bits of the MAC address.
    32 This function is used only by the boot code.
     34This function is used only by the boot code, and return always 0.
    3335
    3436== __Functions using a physical_memcpy__ ==
    3537
    36  === void '''_nic_sync_send'''( void* vbase ) ===
     38 === int '''_nic_sync_send'''( void* vbase ) ===
    3739This blocking function uses a physical_memcpy() to transfer one container (4 Kbytes) from a single user buffer to the NIC channel allocated to the calling task. The '''vbase''' argument is the user buffer virtual base address.
    3840
    39  === void '''_nic_sync_receive'''( void* vbase ) ===
     41Return 0 in case of success. Return -1 if buffer not mapped or not user accessible.
     42
     43 === int '''_nic_sync_receive'''( void* vbase ) ===
    4044This blocking function uses a physical_memcpy() to transfer one container (4 Kbytes) from the NIC channel allocated to the calling task, to a single user buffer. The '''vbase''' argument is the user buffer virtual base address.
     45
     46Return 0 in case of success. Return -1 if buffer not mapped or not user accessible.
    4147
    4248== __Functions using the chained buffer DMA__ ==
    4349
    44  === void '''_nic_cma_send'''( unsigned int nic_channel,  unsigned int cma_channel,  chbuf_descriptor_t* chbuf ) ===
     50 === int '''_nic_cma_send'''( unsigned int nic_channel,  unsigned int cma_channel,  chbuf_descriptor_t* chbuf ) ===
    4551 This non blocking funtion starts a CMA channel to transfer a flow of containers from a NIC_RX chbuf to a kernel chbuf.
    4652 * '''nic_channel''' : NIC_RX channel index
     
    4854 * '''chbuf'''       : pointer on chbuf in kernel memory
    4955 The NIC channel is supposed to be already initialized.
     56
     57Return 0 in case of success. Return -1 if NIC or CMA channel index too large.
    5058
    5159=== void '''_nic_cma_receive'''(  unsigned int nic_channel,  unsigned int cma_channel,  chbuf_descriptor_t* chbuf ) ===
     
    5563 * '''chbuf'''       : pointer on chbuf in kernel memory
    5664The NIC channel is supposed to be already initialized.
     65
     66Return 0 in case of success. Return -1 if NIC or CMA channel index too large.
    5767
    5868== __ Interrupt Service Routines__ ==