Changes in uspace/lib/usbdev/src/pipepriv.c [160b75e:79ae36dd] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/usbdev/src/pipepriv.c
r160b75e r79ae36dd 44 44 void pipe_start_transaction(usb_pipe_t *pipe) 45 45 { 46 fibril_mutex_lock(&pipe->hc_ phone_mutex);46 fibril_mutex_lock(&pipe->hc_sess_mutex); 47 47 } 48 48 … … 53 53 void pipe_end_transaction(usb_pipe_t *pipe) 54 54 { 55 fibril_mutex_unlock(&pipe->hc_ phone_mutex);55 fibril_mutex_unlock(&pipe->hc_sess_mutex); 56 56 } 57 57 … … 85 85 { 86 86 pipe_acquire(pipe); 87 87 88 88 if (pipe->refcount == 0) { 89 89 /* Need to open the phone by ourselves. */ 90 int phone = devman_device_connect(pipe->wire->hc_handle, 0); 91 if (phone < 0) { 90 async_sess_t *sess = 91 devman_device_connect(EXCHANGE_SERIALIZE, pipe->wire->hc_handle, 0); 92 if (!sess) { 92 93 if (hide_failure) { 93 94 pipe->refcount_soft++; 94 phone = EOK; 95 pipe_release(pipe); 96 return EOK; 95 97 } 98 96 99 pipe_release(pipe); 97 return phone;100 return ENOMEM; 98 101 } 102 99 103 /* 100 104 * No locking is needed, refcount is zero and whole pipe 101 105 * mutex is locked. 102 106 */ 103 pipe->hc_phone = phone; 107 108 pipe->hc_sess = sess; 104 109 } 110 105 111 pipe->refcount++; 106 107 112 pipe_release(pipe); 108 113 109 114 return EOK; 110 115 } … … 117 122 { 118 123 pipe_acquire(pipe); 124 119 125 if (pipe->refcount_soft > 0) { 120 126 pipe->refcount_soft--; … … 122 128 return; 123 129 } 130 124 131 assert(pipe->refcount > 0); 132 125 133 pipe->refcount--; 134 126 135 if (pipe->refcount == 0) { 127 136 /* We were the last users, let's hang-up. */ 128 async_hangup(pipe->hc_ phone);129 pipe->hc_ phone = -1;137 async_hangup(pipe->hc_sess); 138 pipe->hc_sess = NULL; 130 139 } 140 131 141 pipe_release(pipe); 132 142 }
Note:
See TracChangeset
for help on using the changeset viewer.