Changeset 4fd3faf in mainline


Ignore:
Timestamp:
2011-04-08T11:58:18Z (13 years ago)
Author:
Jan Vesely <jano.vesely@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
ffc63b0
Parents:
cd1cec3b
Message:

Use per endpoint communication mutex

Location:
uspace
Files:
5 edited

Legend:

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

    rcd1cec3b r4fd3faf  
    332332            instance->transfers[batch->speed][batch->transfer_type];
    333333        assert(list);
    334         if (batch->transfer_type == USB_TRANSFER_CONTROL) {
    335                 usb_device_keeper_use_control(
    336                     &instance->manager, batch->target);
    337         }
    338334        transfer_list_add_batch(list, batch);
    339335
     
    373369                        usb_transfer_batch_t *batch =
    374370                            list_get_instance(item, usb_transfer_batch_t, link);
    375                         switch (batch->transfer_type)
    376                         {
    377                         case USB_TRANSFER_CONTROL:
    378                                 usb_device_keeper_release_control(
    379                                     &instance->manager, batch->target);
    380                                 break;
    381                         case USB_TRANSFER_INTERRUPT:
    382                         case USB_TRANSFER_ISOCHRONOUS: {
    383                                 }
    384                         default:
    385                                 break;
    386                         }
    387371                        usb_transfer_batch_finish(batch);
    388372                }
  • uspace/drv/uhci-hcd/transfer_list.c

    rcd1cec3b r4fd3faf  
    132132}
    133133/*----------------------------------------------------------------------------*/
    134 /** Check list for finished batches.
    135  *
    136  * @param[in] instance List to use.
    137  * @return Error code
    138  *
    139  * Creates a local list of finished batches and calls next_step on each and
    140  * every one. This is safer because next_step may theoretically access
    141  * this transfer list leading to the deadlock if its done inline.
     134/** Create list for finished batches.
     135 *
     136 * @param[in] instance List to use.
     137 * @param[in] done list to fill
    142138 */
    143139void transfer_list_remove_finished(transfer_list_t *instance, link_t *done)
     
    161157        }
    162158        fibril_mutex_unlock(&instance->guard);
    163 
    164159}
    165160/*----------------------------------------------------------------------------*/
  • uspace/lib/usb/include/usb/host/endpoint.h

    rcd1cec3b r4fd3faf  
    5353        fibril_mutex_t guard;
    5454        fibril_condvar_t avail;
    55         bool active;
     55        volatile bool active;
    5656        link_t same_device_eps;
    5757} endpoint_t;
  • uspace/lib/usb/src/host/batch.c

    rcd1cec3b r4fd3faf  
    7979        instance->error = EOK;
    8080        instance->ep = ep;
     81        endpoint_use(instance->ep);
    8182}
    8283/*----------------------------------------------------------------------------*/
     
    8990{
    9091        assert(instance);
     92        assert(instance->ep);
     93        endpoint_release(instance->ep);
    9194        instance->next_step(instance);
    9295}
  • uspace/lib/usb/src/host/endpoint.c

    rcd1cec3b r4fd3faf  
    6060{
    6161        assert(instance);
     62        assert(!instance->active);
    6263        list_remove(&instance->same_device_eps);
    6364        free(instance);
     
    7980        fibril_mutex_lock(&instance->guard);
    8081        instance->active = false;
     82        fibril_mutex_unlock(&instance->guard);
    8183        fibril_condvar_signal(&instance->avail);
    82         fibril_mutex_unlock(&instance->guard);
    8384}
    8485/*----------------------------------------------------------------------------*/
Note: See TracChangeset for help on using the changeset viewer.