Changes in uspace/lib/net/generic/packet_remote.c [14f1db0:c5b59ce] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified uspace/lib/net/generic/packet_remote.c ¶
r14f1db0 rc5b59ce 38 38 #include <async.h> 39 39 #include <errno.h> 40 #include <err.h> 40 41 #include <ipc/ipc.h> 41 42 #include <sys/mman.h> 42 43 43 #include <net_err.h>44 44 #include <net_messages.h> 45 45 #include <packet/packet.h> … … 64 64 * 65 65 */ 66 static int packet_return(int phone, packet_ref packet, packet_id_t packet_id, size_t size){ 66 static int 67 packet_return(int phone, packet_ref packet, packet_id_t packet_id, size_t size) 68 { 67 69 ERROR_DECLARE; 68 70 69 71 ipc_call_t answer; 70 72 aid_t message = async_send_1(phone, NET_PACKET_GET, packet_id, &answer); 73 71 74 *packet = (packet_t) as_get_mappable_page(size); 72 if (ERROR_OCCURRED(async_share_in_start_0_0(phone, *packet, size)) 73 ||ERROR_OCCURRED(pm_add(*packet))) {75 if (ERROR_OCCURRED(async_share_in_start_0_0(phone, *packet, size)) || 76 ERROR_OCCURRED(pm_add(*packet))) { 74 77 munmap(*packet, size); 75 78 async_wait_for(message, NULL); … … 91 94 92 95 *packet = pm_find(packet_id); 93 if (! (*packet)) {96 if (!*packet) { 94 97 ipcarg_t size; 95 98 96 ERROR_PROPAGATE(async_req_1_1(phone, NET_PACKET_GET_SIZE, packet_id, &size)); 99 ERROR_PROPAGATE(async_req_1_1(phone, NET_PACKET_GET_SIZE, 100 packet_id, &size)); 97 101 ERROR_PROPAGATE(packet_return(phone, packet, packet_id, size)); 98 102 } 99 if ((* * packet).next) {103 if ((*packet)->next) { 100 104 packet_t next; 101 105 102 return packet_translate_remote(phone, &next, (* * packet).next);106 return packet_translate_remote(phone, &next, (*packet)->next); 103 107 } 104 108 … … 114 118 ipcarg_t size; 115 119 116 if (ERROR_OCCURRED(async_req_4_2(phone, NET_PACKET_CREATE_4, max_content,117 addr_len, max_prefix, max_suffix, &packet_id, &size)))120 if (ERROR_OCCURRED(async_req_4_2(phone, NET_PACKET_CREATE_4, 121 max_content, addr_len, max_prefix, max_suffix, &packet_id, &size))) 118 122 return NULL; 119 123 … … 121 125 packet_t packet = pm_find(packet_id); 122 126 if (!packet) { 123 if (ERROR_OCCURRED(packet_return(phone, &packet, packet_id, size))) 127 if (ERROR_OCCURRED(packet_return(phone, &packet, packet_id, 128 size))) 124 129 return NULL; 125 130 } … … 141 146 packet_t packet = pm_find(packet_id); 142 147 if (!packet) { 143 if (ERROR_OCCURRED(packet_return(phone, &packet, packet_id, size))) 148 if (ERROR_OCCURRED(packet_return(phone, &packet, packet_id, 149 size))) 144 150 return NULL; 145 151 }
Note:
See TracChangeset
for help on using the changeset viewer.