| 1 | = GIET-VM / NIC Driver = |
| 2 | |
| 3 | [[PageOutline]] |
| 4 | |
| 5 | The [source:soft/giet_vm/giet_drivers/nic_driver.c nic_driver.c] and [source:soft/giet_vm/giet_drivers/nic_driver.h nic_driver.h] files define the NIC driver. |
| 6 | |
| 7 | This component is a multi-channels, giga-bit Ethernet network controller. It is an ''external'', non replicated peripheral. |
| 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. |
| 10 | |
| 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. |
| 14 | |
| 15 | The addressable registers map is defined [source:soft/giet_vm/giet_drivers/nic_driver.h here]. |
| 16 | |
| 17 | WARNING : All these functions are not completely specifiedI yet. |
| 18 | |
| 19 | |
| 20 | |
| 21 | === unsigned int '''_nic_sync_write'''( ) === |
| 22 | To be defined... |
| 23 | |
| 24 | === unsigned int '''_nic_sync_read'''( ) === |
| 25 | To be defined... |
| 26 | |
| 27 | === unsigned int '''_nic_cma_start()''' === |
| 28 | To be defined... |
| 29 | |
| 30 | === unsigned int '''_nic_cma_stop()''' === |
| 31 | To be defined... |
| 32 | |
| 33 | === void '''_nic_rx_isr'''( unsigned int irq_type, unsigned int irq_id, unsigned int channel ) === |
| 34 | This interrupt Service Routine handles IRQs from a NIC_RX channel. |
| 35 | |
| 36 | === void '''_nic_tx_isr'''( unsigned int irq_type, unsigned int irq_id, unsigned int channel ) === |
| 37 | This interrupt Service Routine handles IRQs from a NIC_TX channel. |
| 38 | |