Changeset 816f5f4 in mainline for uspace/lib/usbdev/src/devdrv.c


Ignore:
Timestamp:
2017-10-15T16:55:48Z (7 years ago)
Author:
Michal Staruch <salmelu@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
9b2f69e
Parents:
2770b66
Message:

Remote USB (async) sending structures

remote_usb_register_endpoint is now sending a whole new structure, instead of 5 numeric arguments pulled out of structure.
This allows future extensibility for the structure as well as a working code to be used for other remote async calls.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/usbdev/src/devdrv.c

    r2770b66 r816f5f4  
    5656        /** Connection to device on USB bus */
    5757        usb_dev_session_t *bus_session;
    58        
     58
    5959        /** devman handle */
    6060        devman_handle_t handle;
    61        
     61
    6262        /** The default control pipe. */
    6363        usb_pipe_t ctrl_pipe;
    64        
     64
    6565        /** Other endpoint pipes.
    6666         *
     
    6969         */
    7070        usb_endpoint_mapping_t *pipes;
    71        
     71
    7272        /** Number of other endpoint pipes. */
    7373        size_t pipes_count;
    74        
     74
    7575        /** Current interface.
    7676         *
     
    7979         */
    8080        int interface_no;
    81        
     81
    8282        /** Alternative interfaces. */
    8383        usb_alternate_interfaces_t alternate_interfaces;
    84        
     84
    8585        /** Some useful descriptors for USB device. */
    8686        usb_device_descriptors_t descriptors;
    87        
     87
    8888        /** Generic DDF device backing this one. DO NOT TOUCH! */
    8989        ddf_dev_t *ddf_dev;
    90        
     90
    9191        /** Custom driver data.
    9292         *
     
    146146                return rc;
    147147        }
    148        
     148
    149149        /* Change current alternative */
    150150        usb_dev->alternate_interfaces.current = alternate_setting;
     
    296296        assert(usb_dev);
    297297        assert(usb_dev->pipes || usb_dev->pipes_count == 0);
    298        
     298
    299299        /* Destroy the pipes. */
    300300        for (size_t i = 0; i < usb_dev->pipes_count; ++i) {
     
    304304                        usb_pipe_unregister(&usb_dev->pipes[i].pipe);
    305305        }
    306        
     306
    307307        free(usb_dev->pipes);
    308308        usb_dev->pipes = NULL;
     
    332332        assert(usb_dev);
    333333        for (unsigned i = 0; i < usb_dev->pipes_count; ++i) {
    334                 if (usb_dev->pipes[i].pipe.endpoint_no == ep)
     334                if (usb_dev->pipes[i].pipe.desc.endpoint_no == ep)
    335335                        return &usb_dev->pipes[i];
    336336        }
     
    462462        assert(handle);
    463463        assert(iface_no);
    464        
     464
    465465        async_exch_t *exch = async_exchange_begin(sess);
    466466        if (!exch)
    467467                return EPARTY;
    468        
     468
    469469        int ret = usb_get_my_device_handle(exch, handle);
    470470        if (ret == EOK) {
     
    475475                }
    476476        }
    477        
     477
    478478        async_exchange_end(exch);
    479479        return ret;
     
    504504                return ENOMEM;
    505505        }
    506        
     506
    507507        return usb_device_init(usb_dev, ddf_dev, desc, err, h, iface_no);
    508508}
Note: See TracChangeset for help on using the changeset viewer.