Changeset 8f30c2e in mainline for uspace/drv/uhci-hcd/iface.c


Ignore:
Timestamp:
2011-04-07T14:19:15Z (13 years ago)
Author:
Jan Vesely <jano.vesely@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
feb10c88
Parents:
fd3940c1
Message:

Force endpoint existence for all transfers

root hub polling time to 250ms

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/uhci-hcd/iface.c

    rfd3940c1 r8f30c2e  
    232232        const size_t bw = bandwidth_count_usb11(ep->speed, ep->transfer_type,
    233233            size, ep->max_packet_size);
    234         if (res_bw < bw)
    235         {
     234        if (res_bw < bw) {
    236235                usb_log_error("Endpoint(%d:%d) INT IN needs %zu bw "
    237236                    "but only %zu is reserved.\n",
     
    289288        const size_t bw = bandwidth_count_usb11(ep->speed, ep->transfer_type,
    290289            size, ep->max_packet_size);
    291         if (res_bw < bw)
    292         {
     290        if (res_bw < bw) {
    293291                usb_log_error("Endpoint(%d:%d) INT IN needs %zu bw "
    294292                    "but only %zu bw is reserved.\n",
     
    429427        hc_t *hc = fun_to_hc(fun);
    430428        assert(hc);
    431         usb_speed_t speed =
    432             usb_device_keeper_get_speed(&hc->manager, target.address);
    433         usb_log_debug("Control WRITE (%d) %d:%d %zu(%zu).\n",
    434             speed, target.address, target.endpoint, size, max_packet_size);
     429
     430        usb_log_debug("Control WRITE %d:%d %zu(%zu).\n",
     431            target.address, target.endpoint, size, max_packet_size);
     432
    435433        endpoint_t *ep = usb_endpoint_manager_get_ep(&hc->ep_manager,
    436434            target.address, target.endpoint, USB_DIRECTION_BOTH, NULL);
    437435        if (ep == NULL) {
    438                 usb_log_warning("Endpoint(%d:%d) not registered for CONTROL.\n",
     436                usb_log_error("Endpoint(%d:%d) not registered for CONTROL.\n",
    439437                        target.address, target.endpoint);
    440         }
     438                return ENOENT;
     439        }
     440        assert(ep->speed ==
     441            usb_device_keeper_get_speed(&hc->manager, target.address));
     442        assert(ep->max_packet_size == max_packet_size);
     443        assert(ep->transfer_type == USB_TRANSFER_CONTROL);
    441444
    442445        if (setup_size != 8)
     
    444447
    445448        usb_transfer_batch_t *batch =
    446             batch_get(fun, target, USB_TRANSFER_CONTROL, max_packet_size, speed,
    447                 data, size, setup_data, setup_size, NULL, callback, arg, ep);
     449            batch_get(fun, target, ep->transfer_type, ep->max_packet_size,
     450                ep->speed, data, size, setup_data, setup_size, NULL, callback,
     451                arg, ep);
    448452        if (!batch)
    449453                return ENOMEM;
     
    478482        hc_t *hc = fun_to_hc(fun);
    479483        assert(hc);
    480         usb_speed_t speed =
    481             usb_device_keeper_get_speed(&hc->manager, target.address);
    482 
    483         usb_log_debug("Control READ(%d) %d:%d %zu(%zu).\n",
    484             speed, target.address, target.endpoint, size, max_packet_size);
     484
     485        usb_log_debug("Control READ %d:%d %zu(%zu).\n",
     486            target.address, target.endpoint, size, max_packet_size);
     487
    485488        endpoint_t *ep = usb_endpoint_manager_get_ep(&hc->ep_manager,
    486489            target.address, target.endpoint, USB_DIRECTION_BOTH, NULL);
    487490        if (ep == NULL) {
    488                 usb_log_warning("Endpoint(%d:%d) not registered for CONTROL.\n",
    489                         target.address, target.endpoint);
    490         }
     491                usb_log_error("Endpoint(%d:%d) not registered for CONTROL.\n",
     492                    target.address, target.endpoint);
     493                return ENOENT;
     494        }
     495        assert(ep->speed ==
     496            usb_device_keeper_get_speed(&hc->manager, target.address));
     497        assert(ep->max_packet_size == max_packet_size);
     498        assert(ep->transfer_type == USB_TRANSFER_CONTROL);
     499
    491500        usb_transfer_batch_t *batch =
    492             batch_get(fun, target, USB_TRANSFER_CONTROL, max_packet_size, speed,
    493                 data, size, setup_data, setup_size, callback, NULL, arg, ep);
     501            batch_get(fun, target, ep->transfer_type, ep->max_packet_size,
     502                ep->speed, data, size, setup_data, setup_size,
     503                callback, NULL, arg, ep);
    494504        if (!batch)
    495505                return ENOMEM;
Note: See TracChangeset for help on using the changeset viewer.