Changeset 52cc968 in mainline


Ignore:
Timestamp:
2011-04-07T22:11:49Z (13 years ago)
Author:
Jan Vesely <jano.vesely@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
6a32665d, a8a7063
Parents:
2e6bbcf
Message:

Dead code elimination.

File:
1 edited

Legend:

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

    r2e6bbcf r52cc968  
    268268        if (ret != EOK)
    269269                return ret;
    270 #if 0
    271         assert(fun);
    272         hc_t *hc = fun_to_hc(fun);
    273         assert(hc);
    274 
    275         usb_log_debug("Interrupt OUT %d:%d %zu(%zu).\n",
    276             target.address, target.endpoint, size, max_packet_size);
    277 
    278         size_t res_bw;
    279         endpoint_t *ep = usb_endpoint_manager_get_ep(&hc->ep_manager,
    280             target.address, target.endpoint, USB_DIRECTION_OUT, &res_bw);
    281         if (ep == NULL) {
    282                 usb_log_error("Endpoint(%d:%d) not registered for INT OUT.\n",
    283                         target.address, target.endpoint);
    284                 return ENOENT;
    285         }
    286         const size_t bw = bandwidth_count_usb11(ep->speed, ep->transfer_type,
    287             size, ep->max_packet_size);
    288         if (res_bw < bw) {
    289                 usb_log_error("Endpoint(%d:%d) INT OUT needs %zu bw "
    290                     "but only %zu is reserved.\n",
    291                     target.address, target.endpoint, bw, res_bw);
    292                 return ENOSPC;
    293         }
    294 
    295         assert(ep->speed ==
    296             usb_device_keeper_get_speed(&hc->manager, target.address));
    297         assert(ep->max_packet_size == max_packet_size);
    298         assert(ep->transfer_type == USB_TRANSFER_INTERRUPT);
    299 
    300         usb_transfer_batch_t *batch =
    301             batch_get(fun, ep, data, size, NULL, 0, NULL, callback, arg);
    302         if (!batch)
    303                 return ENOMEM;
    304 #endif
    305270        batch_interrupt_out(batch);
    306271        ret = hc_schedule(hc, batch);
     
    332297        if (ret != EOK)
    333298                return ret;
    334 #if 0
    335         assert(fun);
    336         hc_t *hc = fun_to_hc(fun);
    337         assert(hc);
    338 
    339         usb_log_debug("Interrupt IN %d:%d %zu(%zu).\n",
    340             target.address, target.endpoint, size, max_packet_size);
    341 
    342         size_t res_bw;
    343         endpoint_t *ep = usb_endpoint_manager_get_ep(&hc->ep_manager,
    344             target.address, target.endpoint, USB_DIRECTION_IN, &res_bw);
    345         if (ep == NULL) {
    346                 usb_log_error("Endpoint(%d:%d) not registered for INT IN.\n",
    347                     target.address, target.endpoint);
    348                 return ENOSPC;
    349         }
    350         const size_t bw = bandwidth_count_usb11(ep->speed, ep->transfer_type,
    351             size, ep->max_packet_size);
    352         if (res_bw < bw) {
    353                 usb_log_error("Endpoint(%d:%d) INT IN needs %zu bw "
    354                     "but only %zu bw is reserved.\n",
    355                     target.address, target.endpoint, bw, res_bw);
    356                 return ENOENT;
    357         }
    358 
    359         assert(ep->speed ==
    360             usb_device_keeper_get_speed(&hc->manager, target.address));
    361         assert(ep->max_packet_size == max_packet_size);
    362         assert(ep->transfer_type == USB_TRANSFER_INTERRUPT);
    363 
    364         usb_transfer_batch_t *batch =
    365             batch_get(fun, ep, data, size, NULL, 0, callback, NULL, arg);
    366         if (!batch)
    367                 return ENOMEM;
    368 #endif
    369299        batch_interrupt_in(batch);
    370300        ret = hc_schedule(hc, batch);
     
    396326        if (ret != EOK)
    397327                return ret;
    398 #if 0
    399         assert(fun);
    400         hc_t *hc = fun_to_hc(fun);
    401         assert(hc);
    402 
    403         usb_log_debug("Bulk OUT %d:%d %zu(%zu).\n",
    404             target.address, target.endpoint, size, max_packet_size);
    405 
    406         endpoint_t *ep = usb_endpoint_manager_get_ep(&hc->ep_manager,
    407             target.address, target.endpoint, USB_DIRECTION_OUT, NULL);
    408         if (ep == NULL) {
    409                 usb_log_error("Endpoint(%d:%d) not registered for BULK OUT.\n",
    410                         target.address, target.endpoint);
    411                 return ENOENT;
    412         }
    413         assert(ep->speed ==
    414             usb_device_keeper_get_speed(&hc->manager, target.address));
    415         assert(ep->max_packet_size == max_packet_size);
    416         assert(ep->transfer_type == USB_TRANSFER_BULK);
    417 
    418         usb_transfer_batch_t *batch =
    419             batch_get(fun, ep, data, size, NULL, 0, NULL, callback, arg);
    420         if (!batch)
    421                 return ENOMEM;
    422 #endif
    423328        batch_bulk_out(batch);
    424329        ret = hc_schedule(hc, batch);
     
    450355        if (ret != EOK)
    451356                return ret;
    452 #if 0
    453         assert(fun);
    454         hc_t *hc = fun_to_hc(fun);
    455         assert(hc);
    456 
    457         usb_log_debug("Bulk IN %d:%d %zu(%zu).\n",
    458             target.address, target.endpoint, size, max_packet_size);
    459 
    460         endpoint_t *ep = usb_endpoint_manager_get_ep(&hc->ep_manager,
    461             target.address, target.endpoint, USB_DIRECTION_IN, NULL);
    462         if (ep == NULL) {
    463                 usb_log_error("Endpoint(%d:%d) not registered for BULK IN.\n",
    464                         target.address, target.endpoint);
    465                 return ENOENT;
    466         }
    467         assert(ep->speed ==
    468             usb_device_keeper_get_speed(&hc->manager, target.address));
    469         assert(ep->max_packet_size == max_packet_size);
    470         assert(ep->transfer_type == USB_TRANSFER_BULK);
    471 
    472         usb_transfer_batch_t *batch =
    473             batch_get(fun, ep, data, size, NULL, 0, callback, NULL, arg);
    474         if (!batch)
    475                 return ENOMEM;
    476 #endif
    477357        batch_bulk_in(batch);
    478358        ret = hc_schedule(hc, batch);
     
    508388        if (ret != EOK)
    509389                return ret;
    510 #if 0
    511         assert(fun);
    512         hc_t *hc = fun_to_hc(fun);
    513         assert(hc);
    514 
    515         usb_log_debug("Control WRITE %d:%d %zu(%zu).\n",
    516             target.address, target.endpoint, size, max_packet_size);
    517 
    518         endpoint_t *ep = usb_endpoint_manager_get_ep(&hc->ep_manager,
    519             target.address, target.endpoint, USB_DIRECTION_BOTH, NULL);
    520         if (ep == NULL) {
    521                 usb_log_error("Endpoint(%d:%d) not registered for CONTROL.\n",
    522                         target.address, target.endpoint);
    523                 return ENOENT;
    524         }
    525         assert(ep->speed ==
    526             usb_device_keeper_get_speed(&hc->manager, target.address));
    527         assert(ep->max_packet_size == max_packet_size);
    528         assert(ep->transfer_type == USB_TRANSFER_CONTROL);
    529 
    530         if (setup_size != 8)
    531                 return EINVAL;
    532 
    533         usb_transfer_batch_t *batch =
    534             batch_get(fun, ep, data, size, setup_data, setup_size,
    535                 NULL, callback, arg);
    536         if (!batch)
    537                 return ENOMEM;
    538 #endif
    539390        usb_device_keeper_reset_if_need(&hc->manager, target, setup_data);
    540391        batch_control_write(batch);
     
    571422        if (ret != EOK)
    572423                return ret;
    573 #if 0
    574         assert(fun);
    575         hc_t *hc = fun_to_hc(fun);
    576         assert(hc);
    577 
    578         usb_log_debug("Control READ %d:%d %zu(%zu).\n",
    579             target.address, target.endpoint, size, max_packet_size);
    580 
    581         endpoint_t *ep = usb_endpoint_manager_get_ep(&hc->ep_manager,
    582             target.address, target.endpoint, USB_DIRECTION_BOTH, NULL);
    583         if (ep == NULL) {
    584                 usb_log_error("Endpoint(%d:%d) not registered for CONTROL.\n",
    585                     target.address, target.endpoint);
    586                 return ENOENT;
    587         }
    588         assert(ep->speed ==
    589             usb_device_keeper_get_speed(&hc->manager, target.address));
    590         assert(ep->max_packet_size == max_packet_size);
    591         assert(ep->transfer_type == USB_TRANSFER_CONTROL);
    592 
    593         usb_transfer_batch_t *batch =
    594             batch_get(fun, ep, data, size, setup_data, setup_size,
    595                 callback, NULL, arg);
    596         if (!batch)
    597                 return ENOMEM;
    598 #endif
    599424        batch_control_read(batch);
    600425        ret = hc_schedule(hc, batch);
Note: See TracChangeset for help on using the changeset viewer.