Changeset 77ad86c in mainline for uspace/lib/usb
- Timestamp:
- 2012-06-01T19:00:32Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- b713ff80
- Parents:
- 4e5dabf
- Location:
- uspace/lib/usb
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/usb/include/usb/ddfiface.h
r4e5dabf r77ad86c 33 33 * Implementations of DDF interfaces functions. 34 34 */ 35 35 36 #ifndef LIBUSB_DDFIFACE_H_ 36 37 #define LIBUSB_DDFIFACE_H_ … … 39 40 #include <usb_iface.h> 40 41 41 int usb_iface_get_hc_handle_device_impl(ddf_fun_t *, devman_handle_t *);42 int usb_iface_get_my_address_forward_impl(ddf_fun_t *, usb_address_t *);42 extern int usb_iface_get_hc_handle_device_impl(ddf_fun_t *, devman_handle_t *); 43 extern int usb_iface_get_my_address_forward_impl(ddf_fun_t *, usb_address_t *); 43 44 extern usb_iface_t usb_iface_hub_impl; 44 45 45 int usb_iface_get_my_address_from_device_data(ddf_fun_t *, usb_address_t *);46 extern int usb_iface_get_my_address_from_device_data(ddf_fun_t *, usb_address_t *); 46 47 extern usb_iface_t usb_iface_hub_child_impl; 47 48 48 int usb_iface_get_hc_handle_hc_impl(ddf_fun_t *, devman_handle_t *);49 extern int usb_iface_get_hc_handle_hc_impl(ddf_fun_t *, devman_handle_t *); 49 50 50 51 #endif 52 51 53 /** 52 54 * @} -
uspace/lib/usb/include/usb/debug.h
r4e5dabf r77ad86c 82 82 /** Default log level. */ 83 83 #ifdef CONFIG_USB_VERBOSE 84 #define USB_LOG_LEVEL_DEFAULT USB_LOG_LEVEL_DEBUG84 #define USB_LOG_LEVEL_DEFAULT USB_LOG_LEVEL_DEBUG 85 85 #else 86 #define USB_LOG_LEVEL_DEFAULT USB_LOG_LEVEL_INFO86 #define USB_LOG_LEVEL_DEFAULT USB_LOG_LEVEL_INFO 87 87 #endif 88 88 -
uspace/lib/usb/src/ddfiface.c
r4e5dabf r77ad86c 33 33 * Implementations of DDF interfaces functions (actual implementation). 34 34 */ 35 35 36 #include <devman.h> 36 37 #include <async.h> -
uspace/lib/usb/src/hc.c
r4e5dabf r77ad86c 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.