Changeset 1825


Ignore:
Timestamp:
04/24/07 21:52:45 (6 years ago)
Author:
andrew
Message:

Initial Linux gadgetfs support. Fix usb-net USB config descriptors.

Location:
trunk/src/host/qemu-neo1973
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/host/qemu-neo1973/Makefile.target

    r1667 r1825  
    339339# USB layer 
    340340VL_OBJS+= usb.o usb-hub.o usb-linux.o usb-hid.o usb-ohci.o usb-msd.o usb-net.o 
     341VL_OBJS+= usb-linux-gadget.o 
    341342 
    342343# PCI network cards 
  • trunk/src/host/qemu-neo1973/hw/usb-net.c

    r1640 r1825  
    112112        STRING_PRODUCT,      /*  u8  iProduct; */ 
    113113        STRING_SERIALNUMBER, /*  u8  iSerialNumber; */ 
    114         0x02                 /*  u8  bNumConfigurations; */ 
     114        0x01                 /*  u8  bNumConfigurations; */ 
    115115}; 
    116116 
     
    119119        0x09,                /*  u8  bLength */ 
    120120        USB_DT_CONFIG,       /*  u8  bDescriptorType */ 
    121         0x00, 0x00,          /*  le16 wTotalLength */ 
     121        0x43, 0x00,          /*  le16 wTotalLength */ 
    122122        0x02,                /*  u8  bNumInterfaces */ 
    123123        DEV_RNDIS_CONFIG_VALUE, /*  u8  bConfigurationValue */ 
     
    194194        0x09,                /*  u8  bLength */ 
    195195        USB_DT_CONFIG,       /*  u8  bDescriptorType */ 
    196         0x00, 0x00,          /*  le16 wTotalLength */ 
     196        0x50, 0x00,          /*  le16 wTotalLength */ 
    197197        0x02,                /*  u8  bNumInterfaces */ 
    198198        DEV_RNDIS_CONFIG_VALUE, /*  u8  bConfigurationValue */ 
     
    973973                case USB_DT_CONFIG: 
    974974                        switch (value & 0xff) { 
    975                         case 0: 
     975                        case 1: 
    976976                                ret = sizeof(qemu_net_rndis_config_descriptor); 
    977977                                memcpy(data, qemu_net_rndis_config_descriptor, ret); 
    978978                                break; 
    979979 
    980                         case 1: 
     980                        case 0: 
    981981                                ret = sizeof(qemu_net_cdc_config_descriptor); 
    982982                                memcpy(data, qemu_net_cdc_config_descriptor, ret); 
  • trunk/src/host/qemu-neo1973/hw/usb.h

    r1640 r1825  
    215215void usb_host_info(void); 
    216216 
     217/* usb-linux-gadget.c */ 
     218int usb_gadget_init(void); 
     219 
    217220/* usb-hid.c */ 
    218221USBDevice *usb_mouse_init(void); 
  • trunk/src/host/qemu-neo1973/vl.c

    r1639 r1825  
    61366136           "-usb            enable the USB driver (will be the default soon)\n" 
    61376137           "-usbdevice name add the host or guest USB device 'name'\n" 
     6138           "-usbgadget      enable the linux USB GadgetFS as an HCD\n" 
    61386139#if defined(TARGET_PPC) || defined(TARGET_SPARC) 
    61396140           "-g WxH[xDEPTH]  Set the initial graphical resolution and depth\n" 
     
    62886289    QEMU_OPTION_usb, 
    62896290    QEMU_OPTION_usbdevice, 
     6291    QEMU_OPTION_usbgadget, 
    62906292    QEMU_OPTION_smp, 
    62916293    QEMU_OPTION_vnc, 
     
    63706372    { "win2k-hack", 0, QEMU_OPTION_win2k_hack }, 
    63716373    { "usbdevice", HAS_ARG, QEMU_OPTION_usbdevice }, 
     6374    { "usbgadget", 0, QEMU_OPTION_usbgadget }, 
    63726375    { "smp", HAS_ARG, QEMU_OPTION_smp }, 
    63736376    { "vnc", HAS_ARG, QEMU_OPTION_vnc }, 
     
    66276630    char usb_devices[MAX_USB_CMDLINE][128]; 
    66286631    int usb_devices_index; 
     6632    int usbgadget_enabled = 0; 
    66296633    int fds[2]; 
    66306634 
     
    70397043                usb_devices_index++; 
    70407044                break; 
     7045            case QEMU_OPTION_usbgadget: 
     7046                usbgadget_enabled = 1; 
     7047                break; 
    70417048            case QEMU_OPTION_smp: 
    70427049                smp_cpus = atoi(optarg); 
     
    73257332    } 
    73267333 
     7334    if (usbgadget_enabled) { 
     7335        if (usb_gadget_init() < 0) { 
     7336            fprintf(stderr, "Warning: could not find USB gadgetfs\n"); 
     7337        } 
     7338    } 
     7339 
    73277340    gui_timer = qemu_new_timer(rt_clock, gui_update, NULL); 
    73287341    qemu_mod_timer(gui_timer, qemu_get_clock(rt_clock)); 
Note: See TracChangeset for help on using the changeset viewer.