Changeset 19746a96 in mainline
- Timestamp:
- 2011-10-16T17:10:19Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- f8dfb40
- Parents:
- 0fe2ff1
- Location:
- uspace/drv/bus/usb/ohci
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/bus/usb/ohci/root_hub.c
r0fe2ff1 r19746a96 35 35 #include <errno.h> 36 36 #include <str_error.h> 37 #include <fibril_synch.h> 37 38 38 39 #include <usb/debug.h> 40 #include <usb/dev/request.h> 41 #include <usb/classes/hub.h> 39 42 40 43 #include "root_hub.h" … … 43 46 #include <usb/dev/driver.h> 44 47 #include "ohci_regs.h" 45 46 #include <usb/dev/request.h>47 #include <usb/classes/hub.h>48 48 49 49 /** … … 189 189 #endif 190 190 191 fibril_mutex_initialize(&instance->guard); 191 192 rh_init_descriptors(instance); 192 193 … … 216 217 case USB_TRANSFER_INTERRUPT: 217 218 usb_log_debug("Root hub got INTERRUPT packet\n"); 219 fibril_mutex_lock(&instance->guard); 220 assert(instance->unfinished_interrupt_transfer == NULL); 218 221 const uint16_t mask = create_interrupt_mask(instance); 219 222 if (mask == 0) { 220 223 usb_log_debug("No changes..\n"); 221 assert(instance->unfinished_interrupt_transfer == NULL);222 224 instance->unfinished_interrupt_transfer = request; 225 fibril_mutex_unlock(&instance->guard); 223 226 return; 224 227 } 225 228 usb_log_debug("Processing changes...\n"); 226 229 interrupt_request(request, mask, instance->interrupt_mask_size); 230 fibril_mutex_unlock(&instance->guard); 227 231 break; 228 232 … … 244 248 assert(instance); 245 249 246 if (!instance->unfinished_interrupt_transfer) 247 return; 248 249 usb_log_debug("Finalizing interrupt transfer\n"); 250 const uint16_t mask = create_interrupt_mask(instance); 251 interrupt_request(instance->unfinished_interrupt_transfer, 252 mask, instance->interrupt_mask_size); 253 usb_transfer_batch_dispose(instance->unfinished_interrupt_transfer); 254 255 instance->unfinished_interrupt_transfer = NULL; 250 fibril_mutex_lock(&instance->guard); 251 if (instance->unfinished_interrupt_transfer) { 252 usb_log_debug("Finalizing interrupt transfer\n"); 253 const uint16_t mask = create_interrupt_mask(instance); 254 interrupt_request(instance->unfinished_interrupt_transfer, 255 mask, instance->interrupt_mask_size); 256 usb_transfer_batch_dispose( 257 instance->unfinished_interrupt_transfer); 258 instance->unfinished_interrupt_transfer = NULL; 259 } 260 fibril_mutex_unlock(&instance->guard); 256 261 } 257 262 /*----------------------------------------------------------------------------*/ -
uspace/drv/bus/usb/ohci/root_hub.h
r0fe2ff1 r19746a96 47 47 */ 48 48 typedef struct rh { 49 fibril_mutex_t guard; 49 50 /** pointer to ohci driver registers */ 50 51 ohci_regs_t *registers;
Note:
See TracChangeset
for help on using the changeset viewer.