Changeset 98807e16 in mainline
- Timestamp:
- 2011-03-06T18:38:30Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 5620bd4
- Parents:
- 3e37964
- Location:
- uspace/drv/uhci-hcd/utils
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/uhci-hcd/utils/device_keeper.c
r3e37964 r98807e16 76 76 } 77 77 /*----------------------------------------------------------------------------*/ 78 void device_keeper_reset_if_need( 79 device_keeper_t *instance, usb_target_t target, const unsigned char *data) 80 { 81 assert(instance); 82 fibril_mutex_lock(&instance->guard); 83 if (target.endpoint > 15 || target.endpoint < 0 84 || target.address >= USB_ADDRESS_COUNT || target.address < 0 85 || !instance->devices[target.address].occupied) { 86 goto the_end; 87 } 88 89 switch (data[1]) 90 { 91 case 0x01: /*clear feature*/ 92 /* recipient is enpoint, value is zero (ENDPOINT_STALL) */ 93 if (((data[0] & 0xf) == 1) && ((data[2] | data[3]) == 0)) { 94 /* enpoint number is < 16, thus first byte is enough */ 95 instance->devices[target.address].toggle_status &= ~(1 << data[4]); 96 } 97 break; 98 99 case 0x9: /* set configuration */ 100 case 0x11: /* set interface */ 101 instance->devices[target.address].toggle_status = 0; 102 break; 103 } 104 the_end: 105 fibril_mutex_unlock(&instance->guard); 106 } 107 /*----------------------------------------------------------------------------*/ 78 108 int device_keeper_get_toggle(device_keeper_t *instance, usb_target_t target) 79 109 { -
uspace/drv/uhci-hcd/utils/device_keeper.h
r3e37964 r98807e16 62 62 void device_keeper_release_default(device_keeper_t *instance); 63 63 64 void device_keeper_reset_if_need( 65 device_keeper_t *instance, usb_target_t target, const unsigned char *setup_data); 66 64 67 int device_keeper_get_toggle(device_keeper_t *instance, usb_target_t target); 65 68 66 int device_keeper_set_toggle(device_keeper_t *instance, usb_target_t target, bool toggle); 69 int device_keeper_set_toggle( 70 device_keeper_t *instance, usb_target_t target, bool toggle); 67 71 68 72 usb_address_t device_keeper_request(
Note:
See TracChangeset
for help on using the changeset viewer.