Changes in uspace/lib/usb/src/hc.c [77ad86c:6df2202] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/usb/src/hc.c
r77ad86c r6df2202 27 27 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 28 */ 29 30 29 /** @addtogroup libusb 31 30 * @{ … … 34 33 * General communication with host controller driver (implementation). 35 34 */ 36 37 35 #include <usb/debug.h> 38 36 … … 46 44 { 47 45 assert(connection); 48 49 46 fibril_mutex_lock(&connection->guard); 50 47 if (connection->ref_count == 0) { … … 58 55 } 59 56 } 60 61 57 ++connection->ref_count; 62 58 fibril_mutex_unlock(&connection->guard); 63 59 return EOK; 64 60 } 65 61 /*----------------------------------------------------------------------------*/ 66 62 static int usb_hc_connection_del_ref(usb_hc_connection_t *connection) 67 63 { 68 64 assert(connection); 69 70 65 fibril_mutex_lock(&connection->guard); 71 66 if (connection->ref_count == 0) { … … 75 70 return EOK; 76 71 } 77 78 72 --connection->ref_count; 79 73 int ret = EOK; … … 131 125 return rc; 132 126 } 133 127 /*----------------------------------------------------------------------------*/ 134 128 void usb_hc_connection_deinitialize(usb_hc_connection_t *connection) 135 129 { … … 146 140 fibril_mutex_unlock(&connection->guard); 147 141 } 148 142 /*----------------------------------------------------------------------------*/ 149 143 /** Open connection to host controller. 150 144 * … … 156 150 return usb_hc_connection_add_ref(connection); 157 151 } 158 152 /*----------------------------------------------------------------------------*/ 159 153 /** Close connection to the host controller. 160 154 * … … 166 160 return usb_hc_connection_del_ref(connection); 167 161 } 168 162 /*----------------------------------------------------------------------------*/ 169 163 /** Ask host controller for free address assignment. 170 164 * … … 188 182 return ret == EOK ? address : ret; 189 183 } 190 184 /*----------------------------------------------------------------------------*/ 191 185 int usb_hc_bind_address(usb_hc_connection_t * connection, 192 186 usb_address_t address, devman_handle_t handle) … … 200 194 return ret; 201 195 } 202 196 /*----------------------------------------------------------------------------*/ 203 197 /** Get handle of USB device with given address. 204 198 * … … 219 213 return ret; 220 214 } 221 215 /*----------------------------------------------------------------------------*/ 222 216 int usb_hc_release_address(usb_hc_connection_t *connection, 223 217 usb_address_t address) … … 231 225 return ret; 232 226 } 233 227 /*----------------------------------------------------------------------------*/ 234 228 int usb_hc_register_endpoint(usb_hc_connection_t *connection, 235 229 usb_address_t address, usb_endpoint_t endpoint, usb_transfer_type_t type, … … 245 239 return ret; 246 240 } 247 241 /*----------------------------------------------------------------------------*/ 248 242 int usb_hc_unregister_endpoint(usb_hc_connection_t *connection, 249 243 usb_address_t address, usb_endpoint_t endpoint, usb_direction_t direction) … … 258 252 return ret; 259 253 } 260 254 /*----------------------------------------------------------------------------*/ 261 255 int usb_hc_read(usb_hc_connection_t *connection, usb_address_t address, 262 256 usb_endpoint_t endpoint, uint64_t setup, void *data, size_t size, … … 272 266 return ret; 273 267 } 274 268 /*----------------------------------------------------------------------------*/ 275 269 int usb_hc_write(usb_hc_connection_t *connection, usb_address_t address, 276 270 usb_endpoint_t endpoint, uint64_t setup, const void *data, size_t size)
Note:
See TracChangeset
for help on using the changeset viewer.