Functions | |
int | dsi_packet_get (dsi_socket_t *socket, dsi_packet_t **packet) |
Request next send/receive packet. | |
int | dsi_packet_get_abort (dsi_socket_t *socket) |
Abort an ongoing packet_get() in the work-thread. | |
int | dsi_packet_get_nr (dsi_socket_t *socket, unsigned nr, dsi_packet_t **packet) |
Wait for specific packet. | |
int | dsi_packet_commit (dsi_socket_t *socket, dsi_packet_t *packet) |
Commit send / release receive packet. | |
int | dsi_packet_add_data (dsi_socket_t *socket, dsi_packet_t *packet, void *addr, l4_size_t size, l4_uint32_t flags) |
Add data area to packet's scatter gather list. | |
int | dsi_packet_get_data (dsi_socket_t *socket, dsi_packet_t *packet, void **addr, l4_size_t *size) |
Get next data area from packet. | |
int | dsi_packet_set_no (dsi_socket_t *socket, dsi_packet_t *packet, l4_uint32_t no) |
Set packet number. | |
int | dsi_packet_get_no (dsi_socket_t *socket, dsi_packet_t *packet, l4_uint32_t *no) |
Get packet number. |
int dsi_packet_add_data | ( | dsi_socket_t * | socket, | |
dsi_packet_t * | packet, | |||
void * | addr, | |||
l4_size_t | size, | |||
l4_uint32_t | flags | |||
) |
Add data area to packet's scatter gather list.
socket | Socket descriptor | |
packet | Packet descriptor | |
addr | data start address | |
size | data size | |
flags | data area flags, can be a combination of
|
Definition at line 928 of file packet.c.
References __get_sg_elem(), __is_valid_packet(), dsi_sg_elem::addr, dsi_socket::data_area, dsi_socket::data_size, dsi_is_valid_socket(), dsi_sg_elem::flags, dsi_socket::header, dsi_ctrl_header::max_sg_len, dsi_sg_elem::next, dsi_packet::sg_idx, dsi_packet::sg_len, dsi_packet::sg_list, dsi_socket::sg_lists, and dsi_sg_elem::size.
int dsi_packet_commit | ( | dsi_socket_t * | socket, | |
dsi_packet_t * | packet | |||
) |
Commit send / release receive packet.
socket | socket descriptor | |
packet | packet to commit |
0 | success | |
-L4_EINVAL | invalid socket/packet descriptor | |
-DSI_ENODATA | tried to commit empty send packet | |
-DSI_ENOPACKET | peer in blocking mode: committing required a sync-message which failed |
Definition at line 874 of file packet.c.
References __commit_receive_packet(), __commit_send_packet(), and dsi_is_valid_socket().
int dsi_packet_get | ( | dsi_socket_t * | socket, | |
dsi_packet_t ** | packet | |||
) |
Request next send/receive packet.
socket | Socket descriptor |
packet | Pointer to next packet | |
0 | on success (packet contains valid index) | |
-DSI_ENOPACKET | non-blocking mode: next packet still used by the receive component | |
-DSI_ENOPACKET | blocking mode: block/unblock-ipc returned an error | |
-DSI_EEOS | aborted by dsi_packet_get_abort() | |
-DSI_ECONNECT | blocking mode: communication peer does not exist |
Definition at line 723 of file packet.c.
References __get_receive_packet(), __get_send_packet(), dsi_is_valid_socket(), dsi_socket::packets, and dsi_packet::sg_idx.
int dsi_packet_get_abort | ( | dsi_socket_t * | socket | ) |
Abort an ongoing packet_get() in the work-thread.
socket | Socket descriptor |
0 | on success (packet_get was ongoing), error otherwise | |
-DSI_ENOPACKET | the work-thread was not blocking inside a packet_get. The next dsi_packet_get() will return -DSI_EEOS | |
-DSI_EINVAL | invalid socket descriptor |
The intended use of this function is to unblock the worker if the socket should be shut down by an service thread.
This function must not called more than once per socket.
Definition at line 798 of file packet.c.
References dsi_is_valid_socket(), dsi_socket::flags, dsi_socket::packet_get_abort_env, and dsi_socket::work_th.
int dsi_packet_get_data | ( | dsi_socket_t * | socket, | |
dsi_packet_t * | packet, | |||
void ** | addr, | |||
l4_size_t * | size | |||
) |
Get next data area from packet.
socket | Socket descriptor | |
packet | Packet descriptor |
addr | Start address (absolute) of data area | |
size | Size of data area |
Get next data area from packet. If the packet contains more than one area, get_data returns the next area in the scatter gather list and dsi_packet_get_data must be called repeatedly to get the rest of the scatter gather list.
Definition at line 1037 of file packet.c.
References __is_valid_packet(), dsi_sg_elem::addr, dsi_socket::data_area, dsi_is_valid_socket(), dsi_sg_elem::flags, dsi_sg_elem::next, dsi_packet::sg_idx, dsi_socket::sg_lists, and dsi_sg_elem::size.
int dsi_packet_get_no | ( | dsi_socket_t * | socket, | |
dsi_packet_t * | packet, | |||
l4_uint32_t * | no | |||
) |
Get packet number.
socket | Socket descriptor | |
packet | Packet descriptor |
no | Packet number |
Definition at line 1141 of file packet.c.
References __is_valid_packet(), dsi_is_valid_socket(), and dsi_packet::no.
int dsi_packet_get_nr | ( | dsi_socket_t * | socket, | |
unsigned | nr, | |||
dsi_packet_t ** | packet | |||
) |
Wait for specific packet.
socket | Socket descriptor | |
packet | Packet descriptor |
0 | success (packet contains valid packet) | |
-DSI_ENOPACKET | - non-blocking mode: next packet still used by the receive component
| |
-DSI_ENODATA | tried to commit empty send packet |
This function requests a packet with a given sequence number. It should be used together with unblocking synchronisation.
int dsi_packet_set_no | ( | dsi_socket_t * | socket, | |
dsi_packet_t * | packet, | |||
l4_uint32_t | no | |||
) |
Set packet number.
socket | Socket descriptor | |
packet | Packet descriptor | |
np | Packet number |
Definition at line 1103 of file packet.c.
References __is_valid_packet(), dsi_is_valid_socket(), and dsi_packet::no.