Changeset d824daf in mainline for uspace/lib


Ignore:
Timestamp:
2011-04-10T00:09:23Z (15 years ago)
Author:
Vojtech Horky <vojtechhorky@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
82e8861, edc4c66
Parents:
d32ed36 (diff), 1c258d1 (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:

Remove explicit reservation of default address

Location:
uspace/lib
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/drv/generic/remote_usbhc.c

    rd32ed36 rd824daf  
    5050static void remote_usbhc_control_write(ddf_fun_t *, void *, ipc_callid_t, ipc_call_t *);
    5151static void remote_usbhc_control_read(ddf_fun_t *, void *, ipc_callid_t, ipc_call_t *);
    52 static void remote_usbhc_reserve_default_address(ddf_fun_t *, void *, ipc_callid_t, ipc_call_t *);
    53 static void remote_usbhc_release_default_address(ddf_fun_t *, void *, ipc_callid_t, ipc_call_t *);
    5452static void remote_usbhc_request_address(ddf_fun_t *, void *, ipc_callid_t, ipc_call_t *);
    5553static void remote_usbhc_bind_address(ddf_fun_t *, void *, ipc_callid_t, ipc_call_t *);
     
    6159/** Remote USB host controller interface operations. */
    6260static remote_iface_func_ptr_t remote_usbhc_iface_ops [] = {
    63         remote_usbhc_reserve_default_address,
    64         remote_usbhc_release_default_address,
    65 
    6661        remote_usbhc_request_address,
    6762        remote_usbhc_bind_address,
     
    127122
    128123        return trans;
    129 }
    130 
    131 void remote_usbhc_reserve_default_address(ddf_fun_t *fun, void *iface,
    132     ipc_callid_t callid, ipc_call_t *call)
    133 {
    134         usbhc_iface_t *usb_iface = (usbhc_iface_t *) iface;
    135 
    136         if (!usb_iface->reserve_default_address) {
    137                 async_answer_0(callid, ENOTSUP);
    138                 return;
    139         }
    140        
    141         usb_speed_t speed = DEV_IPC_GET_ARG1(*call);
    142        
    143         int rc = usb_iface->reserve_default_address(fun, speed);
    144 
    145         async_answer_0(callid, rc);
    146 }
    147 
    148 void remote_usbhc_release_default_address(ddf_fun_t *fun, void *iface,
    149     ipc_callid_t callid, ipc_call_t *call)
    150 {
    151         usbhc_iface_t *usb_iface = (usbhc_iface_t *) iface;
    152 
    153         if (!usb_iface->release_default_address) {
    154                 async_answer_0(callid, ENOTSUP);
    155                 return;
    156         }
    157 
    158         int rc = usb_iface->release_default_address(fun);
    159 
    160         async_answer_0(callid, rc);
    161124}
    162125
  • uspace/lib/drv/include/usbhc_iface.h

    rd32ed36 rd824daf  
    8484 */
    8585typedef enum {
    86         /** Reserve usage of default address.
    87          * This call informs the host controller that the caller will be
    88          * using default USB address. It is duty of the HC driver to ensure
    89          * that only single entity will have it reserved.
    90          * The address is returned via IPC_M_USBHC_RELEASE_DEFAULT_ADDRESS.
    91          * The caller can start using the address after receiving EOK
    92          * answer.
    93          */
    94         IPC_M_USBHC_RESERVE_DEFAULT_ADDRESS,
    95 
    96         /** Release usage of default address.
    97          * @see IPC_M_USBHC_RESERVE_DEFAULT_ADDRESS
    98          */
    99         IPC_M_USBHC_RELEASE_DEFAULT_ADDRESS,
    100 
    10186        /** Asks for address assignment by host controller.
    10287         * Answer:
  • uspace/lib/usb/include/usb/hub.h

    rd32ed36 rd824daf  
    5959} usb_hc_attached_device_t;
    6060
    61 int usb_hc_reserve_default_address(usb_hc_connection_t *, usb_speed_t);
    62 int usb_hc_release_default_address(usb_hc_connection_t *);
    63 
    6461usb_address_t usb_hc_request_address(usb_hc_connection_t *, usb_speed_t);
    6562int usb_hc_register_device(usb_hc_connection_t *,
  • uspace/lib/usb/src/hub.c

    rd32ed36 rd824daf  
    4242#include <usb/debug.h>
    4343
     44/** How much time to wait between attempts to register endpoint 0:0.
     45 * The value is based on typical value for port reset + some overhead.
     46 */
     47#define ENDPOINT_0_0_REGISTER_ATTEMPT_DELAY_USEC (1000 * (10 + 2))
     48
    4449/** Check that HC connection is alright.
    4550 *
     
    5358                } \
    5459        } while (false)
    55 
    56 
    57 /** Tell host controller to reserve default address.
    58  * @deprecated
    59  *
    60  * @param connection Opened connection to host controller.
    61  * @param speed Speed of the device that will respond on the default address.
    62  * @return Error code.
    63  */
    64 int usb_hc_reserve_default_address(usb_hc_connection_t *connection,
    65     usb_speed_t speed)
    66 {
    67         CHECK_CONNECTION(connection);
    68 
    69         usb_log_warning("usb_hc_reserve_default_address() considered obsolete");
    70 
    71         return async_req_2_0(connection->hc_phone,
    72             DEV_IFACE_ID(USBHC_DEV_IFACE),
    73             IPC_M_USBHC_RESERVE_DEFAULT_ADDRESS, speed);
    74 }
    75 
    76 /** Tell host controller to release default address.
    77  * @deprecated
    78  *
    79  * @param connection Opened connection to host controller.
    80  * @return Error code.
    81  */
    82 int usb_hc_release_default_address(usb_hc_connection_t *connection)
    83 {
    84         CHECK_CONNECTION(connection);
    85 
    86         usb_log_warning("usb_hc_release_default_address() considered obsolete");
    87 
    88         return async_req_1_0(connection->hc_phone,
    89             DEV_IFACE_ID(USBHC_DEV_IFACE),
    90             IPC_M_USBHC_RELEASE_DEFAULT_ADDRESS);
    91 }
    9260
    9361/** Ask host controller for free address assignment.
     
    269237                if (rc != EOK) {
    270238                        /* Do not overheat the CPU ;-). */
    271                         async_usleep(10);
     239                        async_usleep(ENDPOINT_0_0_REGISTER_ATTEMPT_DELAY_USEC);
    272240                }
    273241        } while (rc != EOK);
Note: See TracChangeset for help on using the changeset viewer.