Changeset eb522e8 in mainline for uspace/lib/net/generic/packet_remote.c
- Timestamp:
- 2011-06-01T08:43:42Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 8d6c1f1
- Parents:
- 9e2e715 (diff), e51a514 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/net/generic/packet_remote.c
r9e2e715 reb522e8 38 38 #include <async.h> 39 39 #include <errno.h> 40 #include <ipc/ipc.h>41 40 #include <ipc/packet.h> 42 41 #include <sys/mman.h> … … 64 63 */ 65 64 static int 66 packet_return(int phone, packet_ refpacket, packet_id_t packet_id, size_t size)65 packet_return(int phone, packet_t **packet, packet_id_t packet_id, size_t size) 67 66 { 68 67 ipc_call_t answer; … … 72 71 message = async_send_1(phone, NET_PACKET_GET, packet_id, &answer); 73 72 74 *packet = (packet_t ) as_get_mappable_page(size);73 *packet = (packet_t *) as_get_mappable_page(size); 75 74 rc = async_share_in_start_0_0(phone, *packet, size); 76 75 if (rc != EOK) { … … 86 85 } 87 86 88 ipcarg_t result;87 sysarg_t result; 89 88 async_wait_for(message, &result); 90 89 … … 100 99 * @param[out] packet The packet reference. 101 100 * @param[in] packet_id The packet identifier. 102 * @return sEOK on success.103 * @return sEINVAL if the packet parameter is NULL.104 * @return sOther error codes as defined for the NET_PACKET_GET_SIZE101 * @return EOK on success. 102 * @return EINVAL if the packet parameter is NULL. 103 * @return Other error codes as defined for the NET_PACKET_GET_SIZE 105 104 * message. 106 * @return sOther error codes as defined for the packet_return()105 * @return Other error codes as defined for the packet_return() 107 106 * function. 108 107 */ 109 int packet_translate_remote(int phone, packet_ refpacket, packet_id_t packet_id)108 int packet_translate_remote(int phone, packet_t **packet, packet_id_t packet_id) 110 109 { 111 110 int rc; … … 116 115 *packet = pm_find(packet_id); 117 116 if (!*packet) { 118 ipcarg_t size;117 sysarg_t size; 119 118 120 119 rc = async_req_1_1(phone, NET_PACKET_GET_SIZE, packet_id, … … 127 126 } 128 127 if ((*packet)->next) { 129 packet_t next;128 packet_t *next; 130 129 131 130 return packet_translate_remote(phone, &next, (*packet)->next); … … 145 144 * @param[in] max_content The maximal content length in bytes. 146 145 * @param[in] max_suffix The maximal suffix length in bytes. 147 * @return sThe packet reference.148 * @return sNULL on error.149 */ 150 packet_t packet_get_4_remote(int phone, size_t max_content, size_t addr_len,146 * @return The packet reference. 147 * @return NULL on error. 148 */ 149 packet_t *packet_get_4_remote(int phone, size_t max_content, size_t addr_len, 151 150 size_t max_prefix, size_t max_suffix) 152 151 { 153 ipcarg_t packet_id;154 ipcarg_t size;152 sysarg_t packet_id; 153 sysarg_t size; 155 154 int rc; 156 155 … … 161 160 162 161 163 packet_t packet = pm_find(packet_id);162 packet_t *packet = pm_find(packet_id); 164 163 if (!packet) { 165 164 rc = packet_return(phone, &packet, packet_id, size); … … 177 176 * @param[in] phone The packet server module phone. 178 177 * @param[in] content The maximal content length in bytes. 179 * @return sThe packet reference.180 * @return sNULL on error.181 */ 182 packet_t packet_get_1_remote(int phone, size_t content)183 { 184 ipcarg_t packet_id;185 ipcarg_t size;178 * @return The packet reference. 179 * @return NULL on error. 180 */ 181 packet_t *packet_get_1_remote(int phone, size_t content) 182 { 183 sysarg_t packet_id; 184 sysarg_t size; 186 185 int rc; 187 186 … … 191 190 return NULL; 192 191 193 packet_t packet = pm_find(packet_id);192 packet_t *packet = pm_find(packet_id); 194 193 if (!packet) { 195 194 rc = packet_return(phone, &packet, packet_id, size);
Note:
See TracChangeset
for help on using the changeset viewer.