Changes between Version 7 and Version 8 of nic_driver
- Timestamp:
- Oct 25, 2014, 3:24:29 PM (10 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
nic_driver
v7 v8 10 10 11 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. 12 13 All these access functions return -1 in case of error (illegal arguments). 12 14 13 15 The SEG_NIC_BASE address and the NB_NIC_CHANNELS parameter must be defined in the hard_config.h file. … … 23 25 * '''bc_enable''' : broadcast packets accepted if non zero 24 26 * '''bypass_enable''' : TX -> RX bypass supported if non zero 25 This function is used only by the boot code .27 This function is used only by the boot code, and return always 0. 26 28 27 29 === void '''_nic_channel_init'''( unsigned int index, unsigned int mac4, unsigned int mac2 ) === … … 30 32 * '''mac4''' : 32 LSB bits of the MAC address. 31 33 * '''mac2''' : 16 MSB bits of the MAC address. 32 This function is used only by the boot code .34 This function is used only by the boot code, and return always 0. 33 35 34 36 == __Functions using a physical_memcpy__ == 35 37 36 === void'''_nic_sync_send'''( void* vbase ) ===38 === int '''_nic_sync_send'''( void* vbase ) === 37 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. 38 40 39 === void '''_nic_sync_receive'''( void* vbase ) === 41 Return 0 in case of success. Return -1 if buffer not mapped or not user accessible. 42 43 === int '''_nic_sync_receive'''( void* vbase ) === 40 44 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. 45 46 Return 0 in case of success. Return -1 if buffer not mapped or not user accessible. 41 47 42 48 == __Functions using the chained buffer DMA__ == 43 49 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 ) === 45 51 This non blocking funtion starts a CMA channel to transfer a flow of containers from a NIC_RX chbuf to a kernel chbuf. 46 52 * '''nic_channel''' : NIC_RX channel index … … 48 54 * '''chbuf''' : pointer on chbuf in kernel memory 49 55 The NIC channel is supposed to be already initialized. 56 57 Return 0 in case of success. Return -1 if NIC or CMA channel index too large. 50 58 51 59 === void '''_nic_cma_receive'''( unsigned int nic_channel, unsigned int cma_channel, chbuf_descriptor_t* chbuf ) === … … 55 63 * '''chbuf''' : pointer on chbuf in kernel memory 56 64 The NIC channel is supposed to be already initialized. 65 66 Return 0 in case of success. Return -1 if NIC or CMA channel index too large. 57 67 58 68 == __ Interrupt Service Routines__ ==