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