Changes between Version 4 and Version 5 of nic_driver
- Timestamp:
- Oct 22, 2014, 10:33:14 AM (10 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
nic_driver
v4 v5 15 15 The addressable registers map is defined [source:soft/giet_vm/giet_drivers/nic_driver.h here]. 16 16 17 WARNING : The CMAfunctions are not implemented yet.17 WARNING : The NIC_TX functions are not implemented yet. 18 18 19 19 == __Initialization Functions__ == … … 21 21 === void '''_nic_global_init'''( unsigned int channels, unsigned int vis, unsigned int bc_enable, unsigned int bypass_enable ) === 22 22 This function initializes the NIC global registers. 23 * channels: number of active channels24 * vis: bit vector(one bit per active channel)25 * bc_enable: broadcast packets accepted if non zero26 * bypass_enable: TX -> RX bypass supported if non zero23 * '''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 27 This function is used only by the boot code. 28 28 29 29 === void '''_nic_channel_init'''( unsigned int index, unsigned int mac4, unsigned int mac2 ) === 30 30 This function initializes the NIC registers for a given channel. 31 * index: channel index32 * mac4: 32 LSB bits of the MAC address.33 * mac2: 16 MSB bits of the MAC address.31 * '''index''' : channel index 32 * '''mac4''' : 32 LSB bits of the MAC address. 33 * '''mac2''' : 16 MSB bits of the MAC address. 34 34 This function is used only by the boot code. 35 35 … … 37 37 38 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 channel allocated to the calling task. The '' vbase'' argument is the user buffer virtual base address.39 This 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. 40 40 41 41 === void '''_nic_sync_receive'''( void* vbase ) === 42 This 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.42 This 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. 43 43 44 44 == __Functions using the chained buffer DMA__ == 45 45 46 === void '''_nic_cma_start_send'''( ) === 47 To be defined... 46 === void '''_nic_cma_start_send'''( unsigned int nic_channel, unsigned int cma_channel, chbuf_descriptor_t* chbuf ) === 47 This non blocking funtion starts a CMA channel to transfer a flow of containers from a NIC_RX chbuf to a kernel chbuf. 48 * '''nic_channel''' : NIC_RX channel index 49 * '''cma_channel''' : CMA channel index 50 * '''chbuf''' : pointer on chbuf in kernel memory 51 The NIC channel is supposed to be already initialized. 48 52 49 === void '''_nic_cma_stop_send'''( ) === 50 To be defined... 51 52 === void '''_nic_cma_start_receive'''( ) === 53 To be defined... 54 55 === void '''_nic_cma_stop_receive'''( ) === 56 To be defined... 53 === void '''_nic_cma_start_receive'''( unsigned int nic_channel, unsigned int cma_channel, chbuf_descriptor_t* chbuf ) === 54 This non blocking funtion starts a CMA channel to transfer a flow of containers from a NIC_RX chbuf to a kernel chbuf. 55 * '''nic_channel''' : NIC_RX channel index 56 * '''cma_channel''' : CMA channel index 57 * '''chbuf''' : pointer on chbuf in kernel memory 58 The NIC channel is supposed to be already initialized. 57 59 58 60 == __ Interrupt Service Routines__ == … … 60 62 === void '''_nic_rx_isr'''( unsigned int irq_type, unsigned int irq_id, unsigned int channel ) === 61 63 This interrupt Service Routine handles IRQs from a NIC_RX channel. 64 WARNING : Not implemented yet... 62 65 63 66 === void '''_nic_tx_isr'''( unsigned int irq_type, unsigned int irq_id, unsigned int channel ) === 64 67 This interrupt Service Routine handles IRQs from a NIC_TX channel. 65 68 WARNING : Not implemented yet...