167 | | === 6) int '''_sys_nic_write'''( unsigned int is_rx, unsigned int channel ) === |
168 | | This function displays on TTY0 the values stored in the NIC instrumentation registers (packet counters). |
169 | | * '''is_rx''' : boolean (RX channels if non zero) |
170 | | * '''channel''' : RX or TX channel index |
| 167 | === 6) int '''_sys_nic_write'''( unsigned int index , unsigned int vaddr , unsigned int count ) === |
| 168 | This blocking function moves a RAW packet from the user buffer to the kernel NIC_TX_FIFO, after building the ETH/IP/UDP headers. In this first implementation, we use a polling strategy in case of FIFO full. |
| 169 | * '''index''' : socket index. |
| 170 | * '''vaddr''' : virtual base address of source user buffer. |
| 171 | * '''count''' : number of bytes. |
| 172 | Returns number of bytes written if success / returns -1 if error |
| 173 | |
| 174 | === 7) int '''_sys_nic_read'''( unsigned int index , unsigned int vaddr , unsigned int count ) === |
| 175 | This blocking function moves a RAW packet from the kernel NIC_RX_FIFO, to the user buffer, after removing the ETH/IP/UDP headers. In this first implementation, we use a polling strategy in case of FIFO empty. |
| 176 | * '''index''' : socket index. |
| 177 | * '''vaddr''' : virtual base address of destination user buffer. |
| 178 | * '''count''' : max number of bytes in user buffer. |
| 179 | Returns number of bytes read if success / returns -1 if error |
| 180 | |