Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/net/generic/packet_remote.c

    rc5b59ce r14f1db0  
    3838#include <async.h>
    3939#include <errno.h>
    40 #include <err.h>
    4140#include <ipc/ipc.h>
    4241#include <sys/mman.h>
    4342
     43#include <net_err.h>
    4444#include <net_messages.h>
    4545#include <packet/packet.h>
     
    6464 *
    6565 */
    66 static int
    67 packet_return(int phone, packet_ref packet, packet_id_t packet_id, size_t size)
    68 {
     66static int packet_return(int phone, packet_ref packet, packet_id_t packet_id, size_t size){
    6967        ERROR_DECLARE;
    7068       
    7169        ipc_call_t answer;
    7270        aid_t message = async_send_1(phone, NET_PACKET_GET, packet_id, &answer);
    73 
    7471        *packet = (packet_t) as_get_mappable_page(size);
    75         if (ERROR_OCCURRED(async_share_in_start_0_0(phone, *packet, size)) ||
    76             ERROR_OCCURRED(pm_add(*packet))) {
     72        if (ERROR_OCCURRED(async_share_in_start_0_0(phone, *packet, size))
     73            || ERROR_OCCURRED(pm_add(*packet))) {
    7774                munmap(*packet, size);
    7875                async_wait_for(message, NULL);
     
    9491       
    9592        *packet = pm_find(packet_id);
    96         if (!*packet) {
     93        if (!(*packet)) {
    9794                ipcarg_t size;
    9895               
    99                 ERROR_PROPAGATE(async_req_1_1(phone, NET_PACKET_GET_SIZE,
    100                     packet_id, &size));
     96                ERROR_PROPAGATE(async_req_1_1(phone, NET_PACKET_GET_SIZE, packet_id, &size));
    10197                ERROR_PROPAGATE(packet_return(phone, packet, packet_id, size));
    10298        }
    103         if ((*packet)->next) {
     99        if ((** packet).next) {
    104100                packet_t next;
    105101               
    106                 return packet_translate_remote(phone, &next, (*packet)->next);
     102                return packet_translate_remote(phone, &next, (** packet).next);
    107103        }
    108104       
     
    118114        ipcarg_t size;
    119115       
    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)))
     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)))
    122118                return NULL;
    123119       
     
    125121        packet_t packet = pm_find(packet_id);
    126122        if (!packet) {
    127                 if (ERROR_OCCURRED(packet_return(phone, &packet, packet_id,
    128                     size)))
     123                if (ERROR_OCCURRED(packet_return(phone, &packet, packet_id, size)))
    129124                        return NULL;
    130125        }
     
    146141        packet_t packet = pm_find(packet_id);
    147142        if (!packet) {
    148                 if (ERROR_OCCURRED(packet_return(phone, &packet, packet_id,
    149                     size)))
     143                if (ERROR_OCCURRED(packet_return(phone, &packet, packet_id, size)))
    150144                        return NULL;
    151145        }
Note: See TracChangeset for help on using the changeset viewer.