Changes between Version 2 and Version 3 of nic_driver
- Timestamp:
- Oct 21, 2014, 11:32:13 AM (10 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
nic_driver
v2 v3 7 7 This component is a multi-channels, giga-bit Ethernet network controller. It is an ''external'', non replicated peripheral. 8 8 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. 10 12 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. 13 The SEG_NIC_BASE address and the NB_NIC_CHANNELS parameter must be defined in the hard_config.h file. 14 14 15 15 The addressable registers map is defined [source:soft/giet_vm/giet_drivers/nic_driver.h here]. 16 16 17 WARNING : All these functions are not completely specified yet.17 WARNING : The CMA functions are not implemented yet. 18 18 19 19 == __Initialization Functions__ == 20 20 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 ) === 22 This 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 27 This function is used only by the boot code. 28 29 === void '''_nic_channel_init'''( unsigned int index, unsigned int mac4, unsigned int mac2 ) === 30 This 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. 34 This function is used only by the boot code. 35 36 == __Functions using a physical_memcpy__ == 37 38 === void '''_nic_sync_send'''( void* vbase ) === 39 This 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 ) === 42 This 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'''( ) === 47 To be defined... 48 49 === void '''_nic_cma_stop_send'''( ) === 22 50 To be defined... 23 51 24 === unsigned int '''_nic_sync_read'''( ) === 52 === void '''_nic_cma_start_receive'''( ) === 53 To be defined... 54 55 === void '''_nic_cma_stop_receive'''( ) === 25 56 To be defined... 26 57 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__ == 32 59 33 60 === void '''_nic_rx_isr'''( unsigned int irq_type, unsigned int irq_id, unsigned int channel ) ===