Ignore:
Timestamp:
2010-10-25T13:23:33Z (15 years ago)
Author:
Vojtech Horky <vojtechhorky@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
23cb44b
Parents:
355f7c2
Message:

Code cleanup, various bugfixes

The internal functions of virtual device framework always get
device structure as parameter, thus possible enabling more devices
within single task (that is not possible because currently there
is no way to pass extra argument into callback_connection()).

Also, added some missing comments and completely removed the device
id nonsense (devices can send their descriptors and the hub is able
to enable/disable its ports).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/hw/bus/usb/hcd/virtual/devices.c

    r355f7c2 rca07cd3  
    4343#include <str_error.h>
    4444
    45 #include <usbvirt/ids.h>
    4645#include <usbvirt/hub.h>
    4746
     
    5554
    5655LIST_INITIALIZE(devices);
    57 
    58 /** Recognise device by id.
    59  *
    60  * @param id Device id.
    61  * @param phone Callback phone.
    62  */
    63 virtdev_connection_t *virtdev_recognise(int id, int phone)
    64 {
    65         virtdev_connection_t * dev = virtdev_add_device(phone);
    66        
    67         /*
    68          * We do not want to mess-up the virtdev_add_device() as
    69          * the id is needed only before device probing/detection
    70          * is implemented.
    71          *
    72          * However, that does not mean that this will happen soon.
    73          */
    74         if (dev) {
    75                 dev->id = id;
    76         }
    77        
    78         return dev;
    79 }
    8056
    8157/** Create virtual device.
Note: See TracChangeset for help on using the changeset viewer.