Changes in / [98e15b1:6ab7f3e9] in mainline


Ignore:
Location:
uspace
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/ehci-hcd/hc_iface.c

    r98e15b1 r6ab7f3e9  
    4848            methodname, __FILE__, __LINE__)
    4949
     50/** Reserve default address.
     51 *
     52 * This function may block the caller.
     53 *
     54 * @param[in] fun Device function the action was invoked on.
     55 * @param[in] speed Speed of the device for which the default address is
     56 *      reserved.
     57 * @return Error code.
     58 */
     59static int reserve_default_address(ddf_fun_t *fun, usb_speed_t speed)
     60{
     61        UNSUPPORTED("reserve_default_address");
     62
     63        return ENOTSUP;
     64}
     65
     66/** Release default address.
     67 *
     68 * @param[in] fun Device function the action was invoked on.
     69 * @return Error code.
     70 */
     71static int release_default_address(ddf_fun_t *fun)
     72{
     73        UNSUPPORTED("release_default_address");
     74
     75        return ENOTSUP;
     76}
     77
    5078/** Found free USB address.
    5179 *
     
    304332/** Host controller interface implementation for EHCI. */
    305333usbhc_iface_t ehci_hc_iface = {
     334        .reserve_default_address = reserve_default_address,
     335        .release_default_address = release_default_address,
    306336        .request_address = request_address,
    307337        .bind_address = bind_address,
  • uspace/drv/usbhub/usbhub.c

    r98e15b1 r6ab7f3e9  
    515515        fibril_mutex_unlock(&hub->pending_ops_mutex);
    516516
    517         usb_device_destroy(hub->usb_device);
    518 
    519517        free(hub->ports);
    520518        free(hub);
  • uspace/drv/usbmouse/init.c

    r98e15b1 r6ab7f3e9  
    3939#include <usb/hid/hid.h>
    4040#include <usb/dev/request.h>
    41 #include <usb/hid/request.h>
    4241#include <errno.h>
    4342
     
    127126       
    128127        /* Set the boot protocol. */
    129         rc = usbhid_req_set_protocol(&dev->ctrl_pipe, dev->interface_no,
    130             USB_HID_PROTOCOL_BOOT);
     128        rc = usb_control_request_set(&dev->ctrl_pipe,
     129            USB_REQUEST_TYPE_CLASS, USB_REQUEST_RECIPIENT_INTERFACE,
     130            USB_HIDREQ_SET_PROTOCOL, USB_HID_PROTOCOL_BOOT, dev->interface_no,
     131            NULL, 0);
    131132        if (rc != EOK) {
    132133                goto leave;
  • uspace/drv/usbmouse/mouse.c

    r98e15b1 r6ab7f3e9  
    117117        async_hangup(mouse->console_phone);
    118118        mouse->console_phone = -1;
    119 
    120         usb_device_destroy(dev);
    121119}
    122120
  • uspace/lib/drv/include/usbhc_iface.h

    r98e15b1 r6ab7f3e9  
    212212/** USB host controller communication interface. */
    213213typedef struct {
     214        int (*reserve_default_address)(ddf_fun_t *, usb_speed_t);
     215        int (*release_default_address)(ddf_fun_t *);
    214216        int (*request_address)(ddf_fun_t *, usb_speed_t, usb_address_t *);
    215217        int (*bind_address)(ddf_fun_t *, usb_address_t, devman_handle_t);
  • uspace/lib/usbdev/include/usb/dev/driver.h

    r98e15b1 r6ab7f3e9  
    168168int usb_device_destroy_pipes(ddf_dev_t *, usb_endpoint_mapping_t *, size_t);
    169169int usb_device_create(ddf_dev_t *, usb_endpoint_description_t **, usb_device_t **, const char **);
    170 void usb_device_destroy(usb_device_t *);
    171170
    172171size_t usb_interface_count_alternates(uint8_t *, size_t, uint8_t);
  • uspace/lib/usbdev/src/devdrv.c

    r98e15b1 r6ab7f3e9  
    533533}
    534534
    535 /** Destroy instance of a USB device.
    536  *
    537  * @param dev Device to be destroyed.
    538  */
    539 void usb_device_destroy(usb_device_t *dev)
    540 {
    541         if (dev == NULL) {
    542                 return;
    543         }
    544 
    545         /* Ignore errors and hope for the best. */
    546         usb_device_destroy_pipes(dev->ddf_dev, dev->pipes, dev->pipes_count);
    547         if (dev->descriptors.configuration != NULL) {
    548                 free(dev->descriptors.configuration);
    549         }
    550 
    551         if (dev->alternate_interfaces != NULL) {
    552                 if (dev->alternate_interfaces->alternatives != NULL) {
    553                         free(dev->alternate_interfaces->alternatives);
    554                 }
    555                 free(dev->alternate_interfaces);
    556         }
    557 
    558         free(dev);
    559 }
    560 
    561535/**
    562536 * @}
  • uspace/srv/hid/console/console.c

    r98e15b1 r6ab7f3e9  
    5757#include <io/style.h>
    5858#include <io/screenbuffer.h>
    59 #include <inttypes.h>
    6059
    6160#include "console.h"
     
    6867/** Interval for checking for new keyboard (1/4s). */
    6968#define HOTPLUG_WATCH_INTERVAL (1000 * 250)
    70 
    71 /* Kernel defines 32 but does not export it. */
    72 #define MAX_IPC_OUTGOING_PHONES 128
    73 /** To allow proper phone closing. */
    74 static ipc_callid_t driver_phones[MAX_IPC_OUTGOING_PHONES] = { 0 };
    7569
    7670/** Phone to the keyboard driver. */
     
    9690                                       contents and related settings. */
    9791} console_t;
    98 
    99 
    10092
    10193/** Array of data for virtual consoles */
     
    409401}
    410402
    411 static void close_driver_phone(ipc_callid_t hash)
    412 {
    413         int i;
    414         for (i = 0; i < MAX_IPC_OUTGOING_PHONES; i++) {
    415                 if (driver_phones[i] == hash) {
    416                         printf("Device %" PRIxn " gone.\n", hash);
    417                         driver_phones[i] = 0;
    418                         async_hangup(i);
    419                         return;
    420                 }
    421         }
    422 }
    423 
    424403/** Handler for keyboard */
    425404static void keyboard_events(ipc_callid_t iid, ipc_call_t *icall)
     
    436415                case IPC_M_PHONE_HUNGUP:
    437416                        /* TODO: Handle hangup */
    438                         close_driver_phone(iid);
    439417                        return;
    440418                case KBD_EVENT:
     
    480458                case IPC_M_PHONE_HUNGUP:
    481459                        /* TODO: Handle hangup */
    482                         close_driver_phone(iid);
    483460                        return;
    484461                case MEVENT_BUTTON:
     
    738715}
    739716
    740 static int async_connect_to_me_hack(int phone, sysarg_t arg1, sysarg_t arg2,
    741 sysarg_t arg3, async_client_conn_t client_receiver, ipc_callid_t *hash)
    742 {
    743         sysarg_t task_hash;
    744         sysarg_t phone_hash;
    745         int rc = async_req_3_5(phone, IPC_M_CONNECT_TO_ME, arg1, arg2, arg3,
    746             NULL, NULL, NULL, &task_hash, &phone_hash);
    747         if (rc != EOK)
    748                 return rc;
    749 
    750         if (client_receiver != NULL)
    751                 async_new_connection(task_hash, phone_hash, phone_hash, NULL,
    752                     client_receiver);
    753 
    754         if (hash != NULL) {
    755                 *hash = phone_hash;
    756         }
    757 
    758         return EOK;
    759 }
    760 
    761717static int connect_keyboard_or_mouse(const char *devname,
    762718    async_client_conn_t handler, const char *path)
     
    773729        }
    774730       
    775         ipc_callid_t hash;
    776         int rc = async_connect_to_me_hack(phone, SERVICE_CONSOLE, 0, phone,
    777             handler, &hash);
     731        int rc = async_connect_to_me(phone, SERVICE_CONSOLE, 0, 0, handler);
    778732        if (rc != EOK) {
    779733                printf(NAME ": " \
     
    783737        }
    784738       
    785         driver_phones[phone] = hash;
    786 
    787         printf(NAME ": found %s \"%s\" (%" PRIxn ").\n", devname, path, hash);
     739        printf(NAME ": found %s \"%s\".\n", devname, path);
    788740
    789741        return phone;
Note: See TracChangeset for help on using the changeset viewer.