If the current poll setup only has POLLIN, adding POLLOUT does not cause the
protocol stack to refocus on flags such as TCP_ACK or UDP_POLL, the user is
not notified when flags for POLLOUT relationships appear and vice versa,
so we have to call poll_setup again.
Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
It's better to raise error before client sends its (NIOVEC+1)th buffer
(and release buffers held by server), otherwise the client may stuck at
getting (NIOVEC+1)th tx buffer if NIOVEC is equal to rpmsg buffer num.
Signed-off-by: Zhe Weng <wengzhe@xiaomi.com>
Found a problem:
When sendto handler gets an error, it will release all its rx buffer,
then iov_base becomes NULL. But it cannot let client stop its request,
then the next data from client cannot be handled by usrsock server
correctly.
It's better to note down the remaining bytes, then we can stop at
correct time.
Signed-off-by: Zhe Weng <wengzhe@xiaomi.com>
since mmap may exist in block_operations, but truncate may not,
moving mmap beforee truncate could make three struct more compatible
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
- Add mmap into file_operations and remove it from ioctl definitions.
- Add mm_map structure definitions to support future unmapping
- Modify all drivers to initialize the operations struct accordingly
Signed-off-by: Jukka Laitinen <jukkax@ssrc.tii.ae>
- Add truncate into file_operations
- Move truncate to be common for mountpt_operations and file_operations
- Modify all drivers to initialize the operations struct accordingly
Signed-off-by: Jukka Laitinen <jukkax@ssrc.tii.ae>
move usrsock rpmsg driver from userspace to kernel to reduce extra
context switch for usrsock operations
Signed-off-by: liangchaozhong <liangchaozhong@xiaomi.com>