Changeset 2b0db98 in mainline for uspace/lib


Ignore:
Timestamp:
2011-01-07T14:02:56Z (15 years ago)
Author:
Lubos Slovak <lubos.slovak@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
6986418
Parents:
d99120f (diff), 0f191a2 (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.
Message:

Merged development into lelian/hidd

Location:
uspace/lib
Files:
4 added
1 deleted
32 edited
1 moved

Legend:

Unmodified
Added
Removed
  • uspace/lib/c/Makefile

    rd99120f r2b0db98  
    8787        generic/ipc.c \
    8888        generic/async.c \
    89         generic/async_rel.c \
     89        generic/async_sess.c \
    9090        generic/loader.c \
    9191        generic/getopt.c \
  • uspace/lib/c/generic/async.c

    rd99120f r2b0db98  
    749749                return ENOMEM;
    750750        }
     751
     752        _async_sess_init();
    751753       
    752754        return 0;
  • uspace/lib/c/generic/device/hw_res.c

    rd99120f r2b0db98  
    3838#include <malloc.h>
    3939
    40 bool get_hw_resources(int dev_phone, hw_resource_list_t *hw_resources)
     40int get_hw_resources(int dev_phone, hw_resource_list_t *hw_resources)
    4141{
    4242        sysarg_t count = 0;
    4343        int rc = async_req_1_1(dev_phone, DEV_IFACE_ID(HW_RES_DEV_IFACE), GET_RESOURCE_LIST, &count);
    4444        hw_resources->count = count;
    45         if (EOK != rc) {
    46                 return false;
    47         }
     45        if (rc != EOK)
     46                return rc;
    4847       
    4948        size_t size = count * sizeof(hw_resource_t);
    5049        hw_resources->resources = (hw_resource_t *)malloc(size);
    51         if (NULL == hw_resources->resources) {
    52                 return false;
    53         }
     50        if (!hw_resources->resources)
     51                return ENOMEM;
    5452       
    5553        rc = async_data_read_start(dev_phone, hw_resources->resources, size);
    56         if (EOK != rc) {
     54        if (rc != EOK) {
    5755                free(hw_resources->resources);
    5856                hw_resources->resources = NULL;
    59                 return false;
     57                return rc;
    6058        }
    6159                 
    62         return true;     
     60        return EOK;
    6361}
    6462
  • uspace/lib/c/generic/devmap.c

    rd99120f r2b0db98  
    127127/** Register new device.
    128128 *
    129  * @param namespace Namespace name.
     129 * The @p interface is used when forwarding connection to the driver.
     130 * If not 0, the first argument is the interface and the second argument
     131 * is the devmap handle of the device.
     132 * When the interface is zero (default), the first argument is directly
     133 * the handle (to ensure backward compatibility).
     134 *
     135 * @param fqdn Fully qualified device name.
     136 * @param[out] handle Handle to the created instance of device.
     137 * @param interface Interface when forwarding.
     138 *
     139 */
     140int devmap_device_register_with_iface(const char *fqdn,
     141    devmap_handle_t *handle, sysarg_t interface)
     142{
     143        int phone = devmap_get_phone(DEVMAP_DRIVER, IPC_FLAG_BLOCKING);
     144       
     145        if (phone < 0)
     146                return phone;
     147       
     148        async_serialize_start();
     149       
     150        ipc_call_t answer;
     151        aid_t req = async_send_2(phone, DEVMAP_DEVICE_REGISTER, interface, 0,
     152            &answer);
     153       
     154        sysarg_t retval = async_data_write_start(phone, fqdn, str_size(fqdn));
     155        if (retval != EOK) {
     156                async_wait_for(req, NULL);
     157                async_serialize_end();
     158                return retval;
     159        }
     160       
     161        async_wait_for(req, &retval);
     162       
     163        async_serialize_end();
     164       
     165        if (retval != EOK) {
     166                if (handle != NULL)
     167                        *handle = -1;
     168                return retval;
     169        }
     170       
     171        if (handle != NULL)
     172                *handle = (devmap_handle_t) IPC_GET_ARG1(answer);
     173       
     174        return retval;
     175}
     176
     177/** Register new device.
     178 *
    130179 * @param fqdn      Fully qualified device name.
    131180 * @param handle    Output: Handle to the created instance of device.
     
    134183int devmap_device_register(const char *fqdn, devmap_handle_t *handle)
    135184{
    136         int phone = devmap_get_phone(DEVMAP_DRIVER, IPC_FLAG_BLOCKING);
    137        
    138         if (phone < 0)
    139                 return phone;
    140        
    141         async_serialize_start();
    142        
    143         ipc_call_t answer;
    144         aid_t req = async_send_2(phone, DEVMAP_DEVICE_REGISTER, 0, 0,
    145             &answer);
    146        
    147         sysarg_t retval = async_data_write_start(phone, fqdn, str_size(fqdn));
    148         if (retval != EOK) {
    149                 async_wait_for(req, NULL);
    150                 async_serialize_end();
    151                 return retval;
    152         }
    153        
    154         async_wait_for(req, &retval);
    155        
    156         async_serialize_end();
    157        
    158         if (retval != EOK) {
    159                 if (handle != NULL)
    160                         *handle = -1;
    161                 return retval;
    162         }
    163        
    164         if (handle != NULL)
    165                 *handle = (devmap_handle_t) IPC_GET_ARG1(answer);
    166        
    167         return retval;
    168 }
     185        return devmap_device_register_with_iface(fqdn, handle, 0);
     186}
     187
    169188
    170189int devmap_device_get_handle(const char *fqdn, devmap_handle_t *handle, unsigned int flags)
     
    260279       
    261280        if (flags & IPC_FLAG_BLOCKING) {
    262                 phone = ipc_connect_me_to_blocking(PHONE_NS, SERVICE_DEVMAP,
     281                phone = async_connect_me_to_blocking(PHONE_NS, SERVICE_DEVMAP,
    263282                    DEVMAP_CONNECT_TO_DEVICE, handle);
    264283        } else {
    265                 phone = ipc_connect_me_to(PHONE_NS, SERVICE_DEVMAP,
     284                phone = async_connect_me_to(PHONE_NS, SERVICE_DEVMAP,
    266285                    DEVMAP_CONNECT_TO_DEVICE, handle);
    267286        }
  • uspace/lib/c/generic/fibril_synch.c

    rd99120f r2b0db98  
    139139static void _fibril_mutex_unlock_unsafe(fibril_mutex_t *fm)
    140140{
    141         assert(fm->counter <= 0);
    142141        if (fm->counter++ < 0) {
    143142                link_t *tmp;
     
    165164void fibril_mutex_unlock(fibril_mutex_t *fm)
    166165{
     166        assert(fibril_mutex_is_locked(fm));
    167167        futex_down(&async_futex);
    168168        _fibril_mutex_unlock_unsafe(fm);
    169169        futex_up(&async_futex);
     170}
     171
     172bool fibril_mutex_is_locked(fibril_mutex_t *fm)
     173{
     174        bool locked = false;
     175       
     176        futex_down(&async_futex);
     177        if (fm->counter <= 0)
     178                locked = true;
     179        futex_up(&async_futex);
     180       
     181        return locked;
    170182}
    171183
     
    230242{
    231243        futex_down(&async_futex);
    232         assert(frw->readers || (frw->writers == 1));
    233244        if (frw->readers) {
    234245                if (--frw->readers) {
     
    296307void fibril_rwlock_read_unlock(fibril_rwlock_t *frw)
    297308{
     309        assert(fibril_rwlock_is_read_locked(frw));
    298310        _fibril_rwlock_common_unlock(frw);
    299311}
     
    301313void fibril_rwlock_write_unlock(fibril_rwlock_t *frw)
    302314{
     315        assert(fibril_rwlock_is_write_locked(frw));
    303316        _fibril_rwlock_common_unlock(frw);
     317}
     318
     319bool fibril_rwlock_is_read_locked(fibril_rwlock_t *frw)
     320{
     321        bool locked = false;
     322
     323        futex_down(&async_futex);
     324        if (frw->readers)
     325                locked = true;
     326        futex_up(&async_futex);
     327
     328        return locked;
     329}
     330
     331bool fibril_rwlock_is_write_locked(fibril_rwlock_t *frw)
     332{
     333        bool locked = false;
     334
     335        futex_down(&async_futex);
     336        if (frw->writers) {
     337                assert(frw->writers == 1);
     338                locked = true;
     339        }
     340        futex_up(&async_futex);
     341
     342        return locked;
     343}
     344
     345bool fibril_rwlock_is_locked(fibril_rwlock_t *frw)
     346{
     347        return fibril_rwlock_is_read_locked(frw) ||
     348            fibril_rwlock_is_write_locked(frw);
    304349}
    305350
     
    314359{
    315360        awaiter_t wdata;
     361
     362        assert(fibril_mutex_is_locked(fm));
    316363
    317364        if (timeout < 0)
  • uspace/lib/c/generic/libc.c

    rd99120f r2b0db98  
    5050#include <ipc/ipc.h>
    5151#include <async.h>
    52 #include <async_rel.h>
    5352#include <as.h>
    5453#include <loader/pcb.h>
     
    6665        __heap_init();
    6766        __async_init();
    68         (void) async_rel_init();
    6967        fibril_t *fibril = fibril_setup();
    7068        __tcb_set(fibril->tcb);
  • uspace/lib/c/generic/net/icmp_api.c

    rd99120f r2b0db98  
    8989            tos, (sysarg_t) dont_fragment, NULL);
    9090
    91         // send the address
     91        /* Send the address */
    9292        async_data_write_start(icmp_phone, addr, (size_t) addrlen);
    9393
  • uspace/lib/c/generic/net/inet.c

    rd99120f r2b0db98  
    6464        switch (family) {
    6565        case AF_INET:
    66                 // check the output buffer size
     66                /* Check output buffer size */
    6767                if (length < INET_ADDRSTRLEN)
    6868                        return ENOMEM;
    6969                       
    70                 // fill the buffer with the IPv4 address
     70                /* Fill buffer with IPv4 address */
    7171                snprintf(address, length, "%hhu.%hhu.%hhu.%hhu",
    7272                    data[0], data[1], data[2], data[3]);
     
    7575
    7676        case AF_INET6:
    77                 // check the output buffer size
     77                /* Check output buffer size */
    7878                if (length < INET6_ADDRSTRLEN)
    7979                        return ENOMEM;
    8080               
    81                 // fill the buffer with the IPv6 address
     81                /* Fill buffer with IPv6 address */
    8282                snprintf(address, length,
    8383                    "%hhx%hhx:%hhx%hhx:%hhx%hhx:%hhx%hhx:%hhx%hhx:%hhx%hhx:"
     
    124124                return EINVAL;
    125125
    126         // set the processing parameters
     126        /* Set processing parameters */
    127127        switch (family) {
    128128        case AF_INET:
     
    142142        }
    143143
    144         // erase if no address
     144        /* Erase if no address */
    145145        if (!address) {
    146146                bzero(data, count);
     
    148148        }
    149149
    150         // process the string from the beginning
     150        /* Process string from the beginning */
    151151        next = address;
    152152        index = 0;
    153153        do {
    154                 // if the actual character is set
     154                /* If the actual character is set */
    155155                if (next && *next) {
    156156
    157                         // if not on the first character
     157                        /* If not on the first character */
    158158                        if (index) {
    159                                 // move to the next character
     159                                /* Move to the next character */
    160160                                ++next;
    161161                        }
    162162
    163                         // parse the actual integral value
     163                        /* Parse the actual integral value */
    164164                        value = strtoul(next, &last, base);
    165                         // remember the last problematic character
    166                         // should be either '.' or ':' but is ignored to be more
    167                         // generic
     165                        /*
     166                         * Remember the last problematic character
     167                         * should be either '.' or ':' but is ignored to be
     168                         * more generic
     169                         */
    168170                        next = last;
    169171
    170                         // fill the address data byte by byte
     172                        /* Fill the address data byte by byte */
    171173                        shift = bytes - 1;
    172174                        do {
    173                                 // like little endian
     175                                /* like little endian */
    174176                                data[index + shift] = value;
    175177                                value >>= 8;
     
    178180                        index += bytes;
    179181                } else {
    180                         // erase the rest of the address
     182                        /* Erase the rest of the address */
    181183                        bzero(data + index, count - index);
    182184                        return EOK;
  • uspace/lib/c/generic/net/modules.c

    rd99120f r2b0db98  
    6363    int answer_count)
    6464{
    65         // choose the most efficient answer function
     65        /* Choose the most efficient answer function */
    6666        if (answer || (!answer_count)) {
    6767                switch (answer_count) {
     
    178178        int phone;
    179179
    180         // if no timeout is set
     180        /* If no timeout is set */
    181181        if (timeout <= 0)
    182182                return async_connect_me_to_blocking(PHONE_NS, need, 0, 0);
     
    187187                        return phone;
    188188
    189                 // end if no time is left
     189                /* Abort if no time is left */
    190190                if (timeout <= 0)
    191191                        return ETIMEOUT;
    192192
    193                 // wait the minimum of the module wait time and the timeout
     193                /* Wait the minimum of the module wait time and the timeout */
    194194                usleep((timeout <= MODULE_WAIT_TIME) ?
    195195                    timeout : MODULE_WAIT_TIME);
    196196                timeout -= MODULE_WAIT_TIME;
    197197        }
    198 }
    199 
    200 /** Receives data from the other party.
    201  *
    202  * The received data buffer is allocated and returned.
    203  *
    204  * @param[out] data     The data buffer to be filled.
    205  * @param[out] length   The buffer length.
    206  * @return              EOK on success.
    207  * @return              EBADMEM if the data or the length parameter is NULL.
    208  * @return              EINVAL if the client does not send data.
    209  * @return              ENOMEM if there is not enough memory left.
    210  * @return              Other error codes as defined for the
    211  *                      async_data_write_finalize() function.
    212  */
    213 int data_receive(void **data, size_t *length)
    214 {
    215         ipc_callid_t callid;
    216         int rc;
    217 
    218         if (!data || !length)
    219                 return EBADMEM;
    220 
    221         // fetch the request
    222         if (!async_data_write_receive(&callid, length))
    223                 return EINVAL;
    224 
    225         // allocate the buffer
    226         *data = malloc(*length);
    227         if (!*data)
    228                 return ENOMEM;
    229 
    230         // fetch the data
    231         rc = async_data_write_finalize(callid, *data, *length);
    232         if (rc != EOK) {
    233                 free(data);
    234                 return rc;
    235         }
    236 
    237         return EOK;
    238198}
    239199
     
    254214        ipc_callid_t callid;
    255215
    256         // fetch the request
     216        /* Fetch the request */
    257217        if (!async_data_read_receive(&callid, &length))
    258218                return EINVAL;
    259219
    260         // check the requested data size
     220        /* Check the requested data size */
    261221        if (length < data_length) {
    262222                async_data_read_finalize(callid, data, length);
     
    264224        }
    265225
    266         // send the data
     226        /* Send the data */
    267227        return async_data_read_finalize(callid, data, data_length);
    268228}
     
    282242        if (answer) {
    283243                IPC_SET_RETVAL(*answer, 0);
    284                 // just to be precize
     244                /* Just to be precise */
    285245                IPC_SET_IMETHOD(*answer, 0);
    286246                IPC_SET_ARG1(*answer, 0);
  • uspace/lib/c/generic/net/packet.c

    rd99120f r2b0db98  
    191191        }
    192192        gpm_destroy(&pm_globals.packet_map);
    193         // leave locked
     193        /* leave locked */
    194194}
    195195
  • uspace/lib/c/generic/net/socket_client.c

    rd99120f r2b0db98  
    220220                fibril_rwlock_read_lock(&socket_globals.lock);
    221221
    222                 // find the socket
     222                /* Find the socket */
    223223                socket = sockets_find(socket_get_sockets(),
    224224                    SOCKET_GET_SOCKET_ID(call));
     
    232232                case NET_SOCKET_RECEIVED:
    233233                        fibril_mutex_lock(&socket->receive_lock);
    234                         // push the number of received packet fragments
     234                        /* Push the number of received packet fragments */
    235235                        rc = dyn_fifo_push(&socket->received,
    236236                            SOCKET_GET_DATA_FRAGMENTS(call),
    237237                            SOCKET_MAX_RECEIVED_SIZE);
    238238                        if (rc == EOK) {
    239                                 // signal the received packet
     239                                /* Signal the received packet */
    240240                                fibril_condvar_signal(&socket->receive_signal);
    241241                        }
     
    244244
    245245                case NET_SOCKET_ACCEPTED:
    246                         // push the new socket identifier
     246                        /* Push the new socket identifier */
    247247                        fibril_mutex_lock(&socket->accept_lock);
    248248                        rc = dyn_fifo_push(&socket->accepted, 1,
    249249                            SOCKET_MAX_ACCEPTED_SIZE);
    250250                        if (rc == EOK) {
    251                                 // signal the accepted socket
     251                                /* Signal the accepted socket */
    252252                                fibril_condvar_signal(&socket->accept_signal);
    253253                        }
     
    264264                        fibril_rwlock_write_lock(&socket->sending_lock);
    265265
    266                         // set the data fragment size
     266                        /* Set the data fragment size */
    267267                        socket->data_fragment_size =
    268268                            SOCKET_GET_DATA_FRAGMENT_SIZE(call);
     
    342342                        socket_id = 1;
    343343                        ++count;
    344                 // only this branch for last_id
     344                /* Only this branch for last_id */
    345345                } else {
    346346                        if (socket_id < INT_MAX) {
     
    408408        int rc;
    409409
    410         // find the appropriate service
     410        /* Find the appropriate service */
    411411        switch (domain) {
    412412        case PF_INET:
     
    457457                return phone;
    458458
    459         // create a new socket structure
     459        /* Create a new socket structure */
    460460        socket = (socket_t *) malloc(sizeof(socket_t));
    461461        if (!socket)
     
    465465        fibril_rwlock_write_lock(&socket_globals.lock);
    466466
    467         // request a new socket
     467        /* Request a new socket */
    468468        socket_id = socket_generate_new_id();
    469469        if (socket_id <= 0) {
     
    484484        socket->header_size = (size_t) header_size;
    485485
    486         // finish the new socket initialization
     486        /* Finish the new socket initialization */
    487487        socket_initialize(socket, socket_id, phone, service);
    488         // store the new socket
     488        /* Store the new socket */
    489489        rc = sockets_add(socket_get_sockets(), socket_id, socket);
    490490
     
    531531        fibril_rwlock_read_lock(&socket_globals.lock);
    532532
    533         // find the socket
     533        /* Find the socket */
    534534        socket = sockets_find(socket_get_sockets(), socket_id);
    535535        if (!socket) {
     
    538538        }
    539539
    540         // request the message
     540        /* Request the message */
    541541        message_id = async_send_3(socket->phone, message,
    542542            (sysarg_t) socket->socket_id, arg2, socket->service, NULL);
    543         // send the address
     543        /* Send the address */
    544544        async_data_write_start(socket->phone, data, datalength);
    545545
     
    566566                return EINVAL;
    567567
    568         // send the address
     568        /* Send the address */
    569569        return socket_send_data(socket_id, NET_SOCKET_BIND, 0, my_addr,
    570570            (size_t) addrlen);
     
    591591        fibril_rwlock_read_lock(&socket_globals.lock);
    592592
    593         // find the socket
     593        /* Find the socket */
    594594        socket = sockets_find(socket_get_sockets(), socket_id);
    595595        if (!socket) {
     
    598598        }
    599599
    600         // request listen backlog change
     600        /* Request listen backlog change */
    601601        result = (int) async_req_3_0(socket->phone, NET_SOCKET_LISTEN,
    602602            (sysarg_t) socket->socket_id, (sysarg_t) backlog, socket->service);
     
    634634        fibril_rwlock_write_lock(&socket_globals.lock);
    635635
    636         // find the socket
     636        /* Find the socket */
    637637        socket = sockets_find(socket_get_sockets(), socket_id);
    638638        if (!socket) {
     
    643643        fibril_mutex_lock(&socket->accept_lock);
    644644
    645         // wait for an accepted socket
     645        /* Wait for an accepted socket */
    646646        ++ socket->blocked;
    647647        while (dyn_fifo_value(&socket->accepted) <= 0) {
    648648                fibril_rwlock_write_unlock(&socket_globals.lock);
    649649                fibril_condvar_wait(&socket->accept_signal, &socket->accept_lock);
    650                 // drop the accept lock to avoid deadlock
     650                /* Drop the accept lock to avoid deadlock */
    651651                fibril_mutex_unlock(&socket->accept_lock);
    652652                fibril_rwlock_write_lock(&socket_globals.lock);
     
    655655        -- socket->blocked;
    656656
    657         // create a new scoket
     657        /* Create a new socket */
    658658        new_socket = (socket_t *) malloc(sizeof(socket_t));
    659659        if (!new_socket) {
     
    681681        }
    682682
    683         // request accept
     683        /* Request accept */
    684684        message_id = async_send_5(socket->phone, NET_SOCKET_ACCEPT,
    685685            (sysarg_t) socket->socket_id, 0, socket->service, 0,
    686686            new_socket->socket_id, &answer);
    687687
    688         // read address
     688        /* Read address */
    689689        ipc_data_read_start(socket->phone, cliaddr, *addrlen);
    690690        fibril_rwlock_write_unlock(&socket_globals.lock);
     
    695695                        result = EINVAL;
    696696
    697                 // dequeue the accepted socket if successful
     697                /* Dequeue the accepted socket if successful */
    698698                dyn_fifo_pop(&socket->accepted);
    699                 // set address length
     699                /* Set address length */
    700700                *addrlen = SOCKET_GET_ADDRESS_LENGTH(answer);
    701701                new_socket->data_fragment_size =
    702702                    SOCKET_GET_DATA_FRAGMENT_SIZE(answer);
    703703        } else if (result == ENOTSOCK) {
    704                 // empty the queue if no accepted sockets
     704                /* Empty the queue if no accepted sockets */
    705705                while (dyn_fifo_pop(&socket->accepted) > 0)
    706706                        ;
     
    731731                return EDESTADDRREQ;
    732732
    733         // send the address
     733        /* Send the address */
    734734        return socket_send_data(socket_id, NET_SOCKET_CONNECT, 0, serv_addr,
    735735            addrlen);
     
    744744        int accepted_id;
    745745
    746         // destroy all accepted sockets
     746        /* Destroy all accepted sockets */
    747747        while ((accepted_id = dyn_fifo_pop(&socket->accepted)) >= 0)
    748748                socket_destroy(sockets_find(socket_get_sockets(), accepted_id));
     
    780780        }
    781781
    782         // request close
     782        /* Request close */
    783783        rc = (int) async_req_3_0(socket->phone, NET_SOCKET_CLOSE,
    784784            (sysarg_t) socket->socket_id, 0, socket->service);
     
    787787                return rc;
    788788        }
    789         // free the socket structure
     789        /* Free the socket structure */
    790790        socket_destroy(socket);
    791791
     
    833833        fibril_rwlock_read_lock(&socket_globals.lock);
    834834
    835         // find socket
     835        /* Find socket */
    836836        socket = sockets_find(socket_get_sockets(), socket_id);
    837837        if (!socket) {
     
    842842        fibril_rwlock_read_lock(&socket->sending_lock);
    843843
    844         // compute data fragment count
     844        /* Compute data fragment count */
    845845        if (socket->data_fragment_size > 0) {
    846846                fragments = (datalength + socket->header_size) /
     
    853853        }
    854854
    855         // request send
     855        /* Request send */
    856856        message_id = async_send_5(socket->phone, message,
    857857            (sysarg_t) socket->socket_id,
     
    859859            socket->service, (sysarg_t) flags, fragments, &answer);
    860860
    861         // send the address if given
     861        /* Send the address if given */
    862862        if (!toaddr ||
    863863            (async_data_write_start(socket->phone, toaddr, addrlen) == EOK)) {
    864864                if (fragments == 1) {
    865                         // send all if only one fragment
     865                        /* Send all if only one fragment */
    866866                        async_data_write_start(socket->phone, data, datalength);
    867867                } else {
    868                         // send the first fragment
     868                        /* Send the first fragment */
    869869                        async_data_write_start(socket->phone, data,
    870870                            socket->data_fragment_size - socket->header_size);
     
    872872                            socket->data_fragment_size - socket->header_size;
    873873       
    874                         // send the middle fragments
     874                        /* Send the middle fragments */
    875875                        while (--fragments > 1) {
    876876                                async_data_write_start(socket->phone, data,
     
    880880                        }
    881881
    882                         // send the last fragment
     882                        /* Send the last fragment */
    883883                        async_data_write_start(socket->phone, data,
    884884                            (datalength + socket->header_size) %
     
    892892            (SOCKET_GET_DATA_FRAGMENT_SIZE(answer) !=
    893893            socket->data_fragment_size)) {
    894                 // set the data fragment size
     894                /* Set the data fragment size */
    895895                socket->data_fragment_size =
    896896                    SOCKET_GET_DATA_FRAGMENT_SIZE(answer);
     
    917917int send(int socket_id, void *data, size_t datalength, int flags)
    918918{
    919         // without the address
     919        /* Without the address */
    920920        return sendto_core(NET_SOCKET_SEND, socket_id, data, datalength, flags,
    921921            NULL, 0);
     
    950950                return EDESTADDRREQ;
    951951
    952         // with the address
     952        /* With the address */
    953953        return sendto_core(NET_SOCKET_SENDTO, socket_id, data, datalength,
    954954            flags, toaddr, addrlen);
     
    966966 *                      read. The actual address length is set. Used only if
    967967 *                      fromaddr is not NULL.
    968  * @return              EOK on success.
     968 * @return              Positive received message size in bytes on success.
     969 * @return              Zero if no more data (other side closed the connection).
    969970 * @return              ENOTSOCK if the socket is not found.
    970971 * @return              EBADMEM if the data parameter is NULL.
     
    972973 * @return              Other error codes as defined for the spcific message.
    973974 */
    974 static int
     975static ssize_t
    975976recvfrom_core(sysarg_t message, int socket_id, void *data, size_t datalength,
    976977    int flags, struct sockaddr *fromaddr, socklen_t *addrlen)
     
    984985        size_t index;
    985986        ipc_call_t answer;
     987        ssize_t retval;
    986988
    987989        if (!data)
     
    996998        fibril_rwlock_read_lock(&socket_globals.lock);
    997999
    998         // find the socket
     1000        /* Find the socket */
    9991001        socket = sockets_find(socket_get_sockets(), socket_id);
    10001002        if (!socket) {
     
    10041006
    10051007        fibril_mutex_lock(&socket->receive_lock);
    1006         // wait for a received packet
     1008        /* Wait for a received packet */
    10071009        ++socket->blocked;
    1008         while ((result = dyn_fifo_value(&socket->received)) <= 0) {
     1010        while ((result = dyn_fifo_value(&socket->received)) < 0) {
    10091011                fibril_rwlock_read_unlock(&socket_globals.lock);
    10101012                fibril_condvar_wait(&socket->receive_signal,
    10111013                    &socket->receive_lock);
    10121014
    1013                 // drop the receive lock to avoid deadlock
     1015                /* Drop the receive lock to avoid deadlock */
    10141016                fibril_mutex_unlock(&socket->receive_lock);
    10151017                fibril_rwlock_read_lock(&socket_globals.lock);
     
    10191021        fragments = (size_t) result;
    10201022
    1021         // prepare lengths if more fragments
     1023        if (fragments == 0) {
     1024                /* No more data, other side has closed the connection. */
     1025                fibril_mutex_unlock(&socket->receive_lock);
     1026                fibril_rwlock_read_unlock(&socket_globals.lock);
     1027                return 0;
     1028        }
     1029
     1030        /* Prepare lengths if more fragments */
    10221031        if (fragments > 1) {
    10231032                lengths = (size_t *) malloc(sizeof(size_t) * fragments +
     
    10291038                }
    10301039
    1031                 // request packet data
     1040                /* Request packet data */
    10321041                message_id = async_send_4(socket->phone, message,
    10331042                    (sysarg_t) socket->socket_id, 0, socket->service,
    10341043                    (sysarg_t) flags, &answer);
    10351044
    1036                 // read the address if desired
     1045                /* Read the address if desired */
    10371046                if(!fromaddr ||
    10381047                    (async_data_read_start(socket->phone, fromaddr,
    10391048                    *addrlen) == EOK)) {
    1040                         // read the fragment lengths
     1049                        /* Read the fragment lengths */
    10411050                        if (async_data_read_start(socket->phone, lengths,
    10421051                            sizeof(int) * (fragments + 1)) == EOK) {
    10431052                                if (lengths[fragments] <= datalength) {
    10441053
    1045                                         // read all fragments if long enough
     1054                                        /* Read all fragments if long enough */
    10461055                                        for (index = 0; index < fragments;
    10471056                                            ++index) {
     
    10571066
    10581067                free(lengths);
    1059         } else {
    1060                 // request packet data
     1068        } else { /* fragments == 1 */
     1069                /* Request packet data */
    10611070                message_id = async_send_4(socket->phone, message,
    10621071                    (sysarg_t) socket->socket_id, 0, socket->service,
    10631072                    (sysarg_t) flags, &answer);
    10641073
    1065                 // read the address if desired
     1074                /* Read the address if desired */
    10661075                if (!fromaddr ||
    10671076                    (async_data_read_start(socket->phone, fromaddr,
    10681077                        *addrlen) == EOK)) {
    1069                         // read all if only one fragment
     1078                        /* Read all if only one fragment */
    10701079                        async_data_read_start(socket->phone, data, datalength);
    10711080                }
     
    10751084        result = (int) ipc_result;
    10761085        if (result == EOK) {
    1077                 // dequeue the received packet
     1086                /* Dequeue the received packet */
    10781087                dyn_fifo_pop(&socket->received);
    1079                 // return read data length
    1080                 result = SOCKET_GET_READ_DATA_LENGTH(answer);
    1081                 // set address length
     1088                /* Return read data length */
     1089                retval = SOCKET_GET_READ_DATA_LENGTH(answer);
     1090                /* Set address length */
    10821091                if (fromaddr && addrlen)
    10831092                        *addrlen = SOCKET_GET_ADDRESS_LENGTH(answer);
     1093        } else {
     1094                retval = (ssize_t) result;
    10841095        }
    10851096
    10861097        fibril_mutex_unlock(&socket->receive_lock);
    10871098        fibril_rwlock_read_unlock(&socket_globals.lock);
    1088         return result;
     1099        return retval;
    10891100}
    10901101
     
    10951106 * @param[in] datalength The data length.
    10961107 * @param[in] flags     Various receive flags.
    1097  * @return              EOK on success.
     1108 * @return              Positive received message size in bytes on success.
     1109 * @return              Zero if no more data (other side closed the connection).
    10981110 * @return              ENOTSOCK if the socket is not found.
    10991111 * @return              EBADMEM if the data parameter is NULL.
     
    11021114 *                      message.
    11031115 */
    1104 int recv(int socket_id, void *data, size_t datalength, int flags)
    1105 {
    1106         // without the address
     1116ssize_t recv(int socket_id, void *data, size_t datalength, int flags)
     1117{
     1118        /* Without the address */
    11071119        return recvfrom_core(NET_SOCKET_RECV, socket_id, data, datalength,
    11081120            flags, NULL, NULL);
     
    11181130 * @param[in,out] addrlen The address length. The maximum address length is
    11191131 *                      read. The actual address length is set.
    1120  * @return              EOK on success.
     1132 * @return              Positive received message size in bytes on success.
     1133 * @return              Zero if no more data (other side closed the connection).
    11211134 * @return              ENOTSOCK if the socket is not found.
    11221135 * @return              EBADMEM if the data or fromaddr parameter is NULL.
     
    11251138 *                      message.
    11261139 */
    1127 int
     1140ssize_t
    11281141recvfrom(int socket_id, void *data, size_t datalength, int flags,
    11291142    struct sockaddr *fromaddr, socklen_t *addrlen)
     
    11351148                return NO_DATA;
    11361149
    1137         // with the address
     1150        /* With the address */
    11381151        return recvfrom_core(NET_SOCKET_RECVFROM, socket_id, data, datalength,
    11391152            flags, fromaddr, addrlen);
     
    11701183        fibril_rwlock_read_lock(&socket_globals.lock);
    11711184
    1172         // find the socket
     1185        /* Find the socket */
    11731186        socket = sockets_find(socket_get_sockets(), socket_id);
    11741187        if (!socket) {
     
    11771190        }
    11781191
    1179         // request option value
     1192        /* Request option value */
    11801193        message_id = async_send_3(socket->phone, NET_SOCKET_GETSOCKOPT,
    11811194            (sysarg_t) socket->socket_id, (sysarg_t) optname, socket->service,
    11821195            NULL);
    11831196
    1184         // read the length
     1197        /* Read the length */
    11851198        if (async_data_read_start(socket->phone, optlen,
    11861199            sizeof(*optlen)) == EOK) {
    1187                 // read the value
     1200                /* Read the value */
    11881201                async_data_read_start(socket->phone, value, *optlen);
    11891202        }
     
    12121225    size_t optlen)
    12131226{
    1214         // send the value
     1227        /* Send the value */
    12151228        return socket_send_data(socket_id, NET_SOCKET_SETSOCKOPT,
    12161229            (sysarg_t) optname, value, optlen);
  • uspace/lib/c/generic/task.c

    rd99120f r2b0db98  
    6565 *
    6666 * @return Zero on success or negative error code.
    67  *
    6867 */
    6968int task_set_name(const char *name)
    7069{
    7170        return __SYSCALL2(SYS_TASK_SET_NAME, (sysarg_t) name, str_size(name));
     71}
     72
     73/** Kill a task.
     74 *
     75 * @param task_id ID of task to kill.
     76 *
     77 * @return Zero on success or negative error code.
     78 */
     79
     80int task_kill(task_id_t task_id)
     81{
     82        return (int) __SYSCALL1(SYS_TASK_KILL, (sysarg_t) &task_id);
    7283}
    7384
  • uspace/lib/c/include/async.h

    rd99120f r2b0db98  
    3737
    3838#include <ipc/ipc.h>
     39#include <async_sess.h>
    3940#include <fibril.h>
    4041#include <sys/time.h>
  • uspace/lib/c/include/device/hw_res.h

    rd99120f r2b0db98  
    9595
    9696
    97 bool get_hw_resources(int dev_phone, hw_resource_list_t *hw_resources);
    98 
    99 bool enable_interrupt(int dev_phone);
     97extern int get_hw_resources(int, hw_resource_list_t *);
     98extern bool enable_interrupt(int);
    10099
    101100
  • uspace/lib/c/include/devmap.h

    rd99120f r2b0db98  
    4545extern int devmap_driver_register(const char *, async_client_conn_t);
    4646extern int devmap_device_register(const char *, devmap_handle_t *);
     47extern int devmap_device_register_with_iface(const char *, devmap_handle_t *, sysarg_t);
    4748
    4849extern int devmap_device_get_handle(const char *, devmap_handle_t *, unsigned int);
  • uspace/lib/c/include/fibril_synch.h

    rd99120f r2b0db98  
    105105extern bool fibril_mutex_trylock(fibril_mutex_t *);
    106106extern void fibril_mutex_unlock(fibril_mutex_t *);
     107extern bool fibril_mutex_is_locked(fibril_mutex_t *);
    107108
    108109extern void fibril_rwlock_initialize(fibril_rwlock_t *);
     
    111112extern void fibril_rwlock_read_unlock(fibril_rwlock_t *);
    112113extern void fibril_rwlock_write_unlock(fibril_rwlock_t *);
     114extern bool fibril_rwlock_is_read_locked(fibril_rwlock_t *);
     115extern bool fibril_rwlock_is_write_locked(fibril_rwlock_t *);
     116extern bool fibril_rwlock_is_locked(fibril_rwlock_t *);
    113117
    114118extern void fibril_condvar_initialize(fibril_condvar_t *);
  • uspace/lib/c/include/ipc/dev_iface.h

    rd99120f r2b0db98  
    3939        CHAR_DEV_IFACE,
    4040
     41        /** Interface provided by any USB device. */
     42        USB_DEV_IFACE,
    4143        /** Interface provided by USB host controller. */
    4244        USBHC_DEV_IFACE,
  • uspace/lib/c/include/ipc/devman.h

    rd99120f r2b0db98  
    123123        DEVMAN_CLIENT,
    124124        DEVMAN_CONNECT_TO_DEVICE,
     125        DEVMAN_CONNECT_FROM_DEVMAP,
    125126        DEVMAN_CONNECT_TO_PARENTS_DEVICE
    126127} devman_interface_t;
  • uspace/lib/c/include/ipc/kbd.h

    rd99120f r2b0db98  
    3939
    4040#include <ipc/ipc.h>
     41#include <ipc/dev_iface.h>
    4142
    4243typedef enum {
    43         KBD_YIELD = IPC_FIRST_USER_METHOD,
     44        KBD_YIELD = DEV_FIRST_CUSTOM_METHOD,
    4445        KBD_RECLAIM
    4546} kbd_request_t;
  • uspace/lib/c/include/net/modules.h

    rd99120f r2b0db98  
    4949#include <sys/time.h>
    5050
    51 /** Converts the data length between different types.
    52  *
    53  * @param[in] type_from The source type.
    54  * @param[in] type_to   The destination type.
    55  * @param[in] count     The number units of the source type size.
    56  */
    57 #define CONVERT_SIZE(type_from, type_to, count) \
    58         ((sizeof(type_from) / sizeof(type_to)) * (count))
    59 
    60 /** Registers the module service at the name server.
    61  *
    62  * @param[in] me        The module service.
    63  * @param[out] phonehash The created phone hash.
    64  */
    65 #define REGISTER_ME(me, phonehash) \
    66         ipc_connect_to_me(PHONE_NS, (me), 0, 0, (phonehash))
    67 
    6851/** Connect to the needed module function type definition.
    6952 *
     
    8063extern int connect_to_service(services_t);
    8164extern int connect_to_service_timeout(services_t, suseconds_t);
    82 extern int data_receive(void **, size_t *);
    8365extern int data_reply(void *, size_t);
    8466extern void refresh_answer(ipc_call_t *, int *);
  • uspace/lib/c/include/net/socket.h

    rd99120f r2b0db98  
    6060extern int sendto(int, const void *, size_t, int, const struct sockaddr *,
    6161    socklen_t);
    62 extern int recv(int, void *, size_t, int);
    63 extern int recvfrom(int, void *, size_t, int, struct sockaddr *, socklen_t *);
     62extern ssize_t recv(int, void *, size_t, int);
     63extern ssize_t recvfrom(int, void *, size_t, int, struct sockaddr *, socklen_t *);
    6464extern int getsockopt(int, int, int, void *, size_t *);
    6565extern int setsockopt(int, int, int, const void *, size_t);
  • uspace/lib/c/include/task.h

    rd99120f r2b0db98  
    4747extern task_id_t task_get_id(void);
    4848extern int task_set_name(const char *);
     49extern int task_kill(task_id_t);
     50
    4951extern task_id_t task_spawn(const char *, const char *const[], int *);
    5052extern int task_spawnv(task_id_t *, const char *path, const char *const []);
  • uspace/lib/drv/Makefile

    rd99120f r2b0db98  
    3636        generic/dev_iface.c \
    3737        generic/remote_res.c \
     38        generic/remote_usb.c \
    3839        generic/remote_usbhc.c \
    3940        generic/remote_char.c
  • uspace/lib/drv/generic/dev_iface.c

    rd99120f r2b0db98  
    3939#include "remote_res.h"
    4040#include "remote_char.h"
     41#include "remote_usb.h"
    4142#include "remote_usbhc.h"
    4243
     
    4546                &remote_res_iface,
    4647                &remote_char_iface,
     48                &remote_usb_iface,
    4749                &remote_usbhc_iface
    4850        }
  • uspace/lib/drv/generic/remote_usbhc.c

    rd99120f r2b0db98  
    5959//static void remote_usbhc(device_t *, void *, ipc_callid_t, ipc_call_t *);
    6060
    61 /** Remote USB interface operations. */
     61/** Remote USB host controller interface operations. */
    6262static remote_iface_func_ptr_t remote_usbhc_iface_ops [] = {
    6363        remote_usbhc_get_address,
     
    8484};
    8585
    86 /** Remote USB interface structure.
     86/** Remote USB host controller interface structure.
    8787 */
    8888remote_iface_t remote_usbhc_iface = {
  • uspace/lib/drv/include/remote_usb.h

    rd99120f r2b0db98  
    11/*
    2  * Copyright (c) 2010 Jakub Jermar
     2 * Copyright (c) 2010 Vojtech Horky
    33 * All rights reserved.
    44 *
     
    2727 */
    2828
    29 /** @addtogroup libc
     29/** @addtogroup libdrv
    3030 * @{
    3131 */
     
    3333 */
    3434
    35 #ifndef LIBC_ASYNC_REL_H_
    36 #define LIBC_ASYNC_REL_H_
     35#ifndef LIBDRV_REMOTE_USB_H_
     36#define LIBDRV_REMOTE_USB_H_
    3737
    38 extern int async_rel_init(void);
    39 extern int async_relation_create(int);
    40 extern void async_relation_destroy(int, int);
     38remote_iface_t remote_usb_iface;
    4139
    4240#endif
    4341
    44 /** @}
     42/**
     43 * @}
    4544 */
  • uspace/lib/drv/include/usbhc_iface.h

    rd99120f r2b0db98  
    3131 */
    3232/** @file
    33  * @brief USB interface definition.
     33 * @brief USB host controller interface definition.
    3434 */
    3535
     
    226226    usbhc_iface_transfer_in_callback_t, void *);
    227227
    228 /** USB devices communication interface. */
     228/** USB host controller communication interface. */
    229229typedef struct {
    230230        int (*tell_address)(device_t *, devman_handle_t, usb_address_t *);
  • uspace/lib/packet/generic/packet_server.c

    rd99120f r2b0db98  
    135135/** Creates a new packet of dimensions at least as given.
    136136 *
    137  * Should be used only when the global data are locked.
    138  *
    139137 * @param[in] length    The total length of the packet, including the header,
    140138 *                      the addresses and the data of the packet.
     
    153151        packet_t *packet;
    154152        int rc;
     153
     154        assert(fibril_mutex_is_locked(&ps_globals.lock));
    155155
    156156        // already locked
     
    233233/** Release the packet and returns it to the appropriate free packet queue.
    234234 *
    235  * Should be used only when the global data are locked.
    236  *
    237235 * @param[in] packet    The packet to be released.
    238236 *
     
    242240        int index;
    243241        int result;
     242
     243        assert(fibril_mutex_is_locked(&ps_globals.lock));
    244244
    245245        for (index = 0; (index < FREE_QUEUES_COUNT - 1) &&
  • uspace/lib/usb/include/usb/hcdhubd.h

    rd99120f r2b0db98  
    207207int usb_hc_add_child_device(device_t *, const char *, const char *, bool);
    208208
     209
     210/**
     211 * @}
     212 */
     213
    209214#endif
  • uspace/lib/usb/include/usb/usbdrv.h

    rd99120f r2b0db98  
    4141#include <usb/descriptor.h>
    4242
    43 int usb_drv_hc_connect(device_t *, unsigned int);
     43int usb_drv_find_hc(device_t *, devman_handle_t *);
     44int usb_drv_hc_connect(device_t *, devman_handle_t, unsigned int);
     45int usb_drv_hc_connect_auto(device_t *, unsigned int);
    4446
    4547int usb_drv_reserve_default_address(int);
  • uspace/lib/usb/src/hcdhubd.c

    rd99120f r2b0db98  
    3636#include <usb/devreq.h>
    3737#include <usbhc_iface.h>
     38#include <usb_iface.h>
    3839#include <usb/descriptor.h>
    3940#include <driver.h>
     
    4546#include "hcdhubd_private.h"
    4647
     48
     49static int usb_iface_get_hc_handle(device_t *dev, devman_handle_t *handle)
     50{
     51        assert(dev);
     52        assert(dev->parent != NULL);
     53
     54        device_t *parent = dev->parent;
     55
     56        if (parent->ops && parent->ops->interfaces[USB_DEV_IFACE]) {
     57                usb_iface_t *usb_iface
     58                    = (usb_iface_t *) parent->ops->interfaces[USB_DEV_IFACE];
     59                assert(usb_iface != NULL);
     60                if (usb_iface->get_hc_handle) {
     61                        int rc = usb_iface->get_hc_handle(parent, handle);
     62                        return rc;
     63                }
     64        }
     65
     66        return ENOTSUP;
     67}
     68
     69static usb_iface_t usb_iface = {
     70        .get_hc_handle = usb_iface_get_hc_handle
     71};
     72
     73static device_ops_t child_ops = {
     74        .interfaces[USB_DEV_IFACE] = &usb_iface
     75};
     76
    4777/** Callback when new device is detected and must be handled by this driver.
    4878 *
     
    129159        }
    130160        child->name = child_info->name;
     161        child->parent = child_info->parent;
     162        child->ops = &child_ops;
    131163
    132164        match_id = create_match_id();
  • uspace/lib/usb/src/recognise.c

    rd99120f r2b0db98  
    3333 * @brief Functions for recognising kind of attached devices.
    3434 */
     35#include <usb_iface.h>
    3536#include <usb/usbdrv.h>
    3637#include <usb/classes/classes.h>
     
    3839#include <errno.h>
    3940
     41static int usb_iface_get_hc_handle(device_t *dev, devman_handle_t *handle)
     42{
     43        assert(dev);
     44        assert(dev->parent != NULL);
     45
     46        device_t *parent = dev->parent;
     47
     48        if (parent->ops && parent->ops->interfaces[USB_DEV_IFACE]) {
     49                usb_iface_t *usb_iface
     50                    = (usb_iface_t *) parent->ops->interfaces[USB_DEV_IFACE];
     51                assert(usb_iface != NULL);
     52                if (usb_iface->get_hc_handle) {
     53                        int rc = usb_iface->get_hc_handle(parent, handle);
     54                        return rc;
     55                }
     56        }
     57
     58        return ENOTSUP;
     59}
     60
     61static usb_iface_t usb_iface = {
     62        .get_hc_handle = usb_iface_get_hc_handle
     63};
     64
     65static device_ops_t child_ops = {
     66        .interfaces[USB_DEV_IFACE] = &usb_iface
     67};
    4068
    4169#define BCD_INT(a) (((unsigned int)(a)) / 256)
     
    285313                goto failure;
    286314        }
     315        child->parent = parent;
    287316        child->name = child_name;
     317        child->ops = &child_ops;
    288318       
    289319        rc = usb_drv_create_device_match_ids(hc, &child->match_ids, address);
  • uspace/lib/usb/src/usbdrv.c

    rd99120f r2b0db98  
    3535#include <usb/usbdrv.h>
    3636#include <usbhc_iface.h>
     37#include <usb_iface.h>
    3738#include <errno.h>
    3839#include <str_error.h>
     
    5455} transfer_info_t;
    5556
     57/** Find handle of host controller the device is physically attached to.
     58 *
     59 * @param[in] dev Device looking for its host controller.
     60 * @param[out] handle Host controller devman handle.
     61 * @return Error code.
     62 */
     63int usb_drv_find_hc(device_t *dev, devman_handle_t *handle)
     64{
     65        if (dev == NULL) {
     66                return EBADMEM;
     67        }
     68        if (handle == NULL) {
     69                return EBADMEM;
     70        }
     71
     72        int parent_phone = devman_parent_device_connect(dev->handle,
     73            IPC_FLAG_BLOCKING);
     74        if (parent_phone < 0) {
     75                return parent_phone;
     76        }
     77
     78        devman_handle_t h;
     79        int rc = async_req_1_1(parent_phone, DEV_IFACE_ID(USB_DEV_IFACE),
     80            IPC_M_USB_GET_HOST_CONTROLLER_HANDLE, &h);
     81
     82        ipc_hangup(parent_phone);
     83
     84        if (rc != EOK) {
     85                return rc;
     86        }
     87
     88        *handle = h;
     89
     90        return EOK;
     91}
     92
     93/** Connect to host controller the device is physically attached to.
     94 *
     95 * @param dev Device asking for connection.
     96 * @param hc_handle Devman handle of the host controller.
     97 * @param flags Connection flags (blocking connection).
     98 * @return Phone to the HC or error code.
     99 */
     100int usb_drv_hc_connect(device_t *dev, devman_handle_t hc_handle,
     101    unsigned int flags)
     102{
     103        return devman_device_connect(hc_handle, flags);
     104}
     105
    56106/** Connect to host controller the device is physically attached to.
    57107 *
     
    60110 * @return Phone to corresponding HC or error code.
    61111 */
    62 int usb_drv_hc_connect(device_t *dev, unsigned int flags)
    63 {
     112int usb_drv_hc_connect_auto(device_t *dev, unsigned int flags)
     113{
     114        int rc;
     115        devman_handle_t hc_handle;
     116
    64117        /*
    65118         * Call parent hub to obtain device handle of respective HC.
    66119         */
    67 
    68         /*
    69          * FIXME: currently we connect always to virtual host controller.
    70          */
    71         int rc;
    72         devman_handle_t handle;
    73 
    74         rc = devman_device_get_handle("/virt/usbhc", &handle, flags);
     120        rc = usb_drv_find_hc(dev, &hc_handle);
    75121        if (rc != EOK) {
    76122                return rc;
    77123        }
    78124       
    79         int phone = devman_device_connect(handle, flags);
    80 
    81         return phone;
     125        return usb_drv_hc_connect(dev, hc_handle, flags);
    82126}
    83127
Note: See TracChangeset for help on using the changeset viewer.