Changes between Version 2 and Version 3 of nic_driver


Ignore:
Timestamp:
Oct 21, 2014, 11:32:13 AM (10 years ago)
Author:
alain
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • nic_driver

    v2 v3  
    77This component is a multi-channels, giga-bit Ethernet network controller. It is an ''external'', non replicated peripheral.
    88
    9  * The ''_nic_sync_write()'' and ''_nic_sync_read()'' functions use a ''memcpy'' strategy to transfer a flow of packets between a chained buffer in kernel space and the NIC internal chained buffer. They are blocking until completion of the transfer.
     9 * The ''_nic_sync_send()'' and ''_nic_sync_receive()'' functions use a ''physical_memcpy()''  to transfer data between a single container (4 Kbytes buffer) in user space and the NIC internal chained buffer. They are blocking until completion of the transfer. One NIC channel must be allocated to the calling task in the mapping.
     10 
     11 * 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.
    1012
    11  * The ''_nic_cma_start()'' and ''_nic_cma_stop()'' 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. In this case, one NIC channel and two CMA channels must be allocated to the task in the mapping_info data structure.
    12 
    13 The SEG_NIC_BASE address must be defined in the hard_config.h file.
     13The SEG_NIC_BASE address and the NB_NIC_CHANNELS parameter must be defined in the hard_config.h file.
    1414
    1515The addressable registers map is defined [source:soft/giet_vm/giet_drivers/nic_driver.h here].
    1616
    17 WARNING : All these functions are not completely specified yet.
     17WARNING : The CMA functions are not implemented yet.
    1818
    19  
     19== __Initialization Functions__ ==
    2020
    21  === unsigned int '''_nic_sync_write'''( ) ===
     21 === void '''_nic_global_init'''( unsigned int channels, unsigned int vis, unsigned int bc_enable, unsigned int bypass_enable ) ===
     22This function initializes the NIC global registers.
     23 * channels : number of active channels
     24 * vis : bit vector(one bit per active channel)
     25 * bc_enable : broadcast packets accepted if non zero
     26 * bypass_enable : TX -> RX bypass supported if non zero
     27This function is used only by the boot code.
     28
     29 === void '''_nic_channel_init'''( unsigned int index,  unsigned int mac4,  unsigned int mac2 ) ===
     30This function initializes the NIC registers for a given channel.
     31 * index : channel index
     32 * mac4 : 32 LSB bits of the MAC address.
     33 * mac2 : 16 MSB bits of the MAC address.
     34This function is used only by the boot code.
     35
     36== __Functions using a physical_memcpy__ ==
     37
     38 === void '''_nic_sync_send'''( void* vbase ) ===
     39This blocking function uses a physical_memcpy() to transfer one container (4 Kbytes) from a single user buffer to the NIC. The ''vbase'' argument is the user buffer virtual base address.
     40
     41 === void '''_nic_sync_receive'''( void* vbase ) ===
     42This blocking function uses a physical_memcpy() to transfer one container (4 Kbytes) from the NIC to a single user buffer. The ''vbase'' argument is the user buffer virtual base address.
     43
     44== __Functions using the chained buffer DMA__ ==
     45
     46 === void '''_nic_cma_start_send'''( ) ===
     47To be defined...
     48
     49 === void '''_nic_cma_stop_send'''( ) ===
    2250To be defined...
    2351
    24  === unsigned int '''_nic_sync_read'''( ) ===
     52=== void '''_nic_cma_start_receive'''( ) ===
     53To be defined...
     54
     55 === void '''_nic_cma_stop_receive'''( ) ===
    2556To be defined...
    2657
    27  === unsigned int '''_nic_cma_start'''( ) ===
    28 To be defined...
    29 
    30  === unsigned int '''_nic_cma_stop'''( ) ===
    31 To be defined...
     58== __ Interrupt Service Routines__ ==
    3259
    3360 === void '''_nic_rx_isr'''( unsigned int irq_type,  unsigned int irq_id,  unsigned int channel ) ===