Changeset 5ab4a48 in mainline
- Timestamp:
- 2011-04-17T10:48:44Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 4125b7d
- Parents:
- 2c2cbcf
- Location:
- uspace
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/usbmouse/init.c
r2c2cbcf r5ab4a48 125 125 } 126 126 127 /* Open the control pipe. */128 rc = usb_pipe_start_session(&dev->ctrl_pipe);129 if (rc != EOK) {130 goto leave;131 }132 133 127 /* Set the boot protocol. */ 134 128 rc = usb_control_request_set(&dev->ctrl_pipe, … … 140 134 } 141 135 142 /* Close the control pipe (ignore errors). */ 143 usb_pipe_end_session(&dev->ctrl_pipe); 144 145 146 /* Everything allright. */ 136 /* Everything all right. */ 147 137 dev->driver_data = mouse; 148 138 mouse->mouse_fun->driver_data = mouse; -
uspace/lib/usb/include/usb/pipes.h
r2c2cbcf r5ab4a48 177 177 int usb_pipe_unregister(usb_pipe_t *, usb_hc_connection_t *); 178 178 179 int usb_pipe_start_session(usb_pipe_t *);180 int usb_pipe_end_session(usb_pipe_t *);181 bool usb_pipe_is_session_started(usb_pipe_t *);182 183 179 void usb_pipe_start_long_transfer(usb_pipe_t *); 184 180 void usb_pipe_end_long_transfer(usb_pipe_t *); -
uspace/lib/usb/src/pipes.c
r2c2cbcf r5ab4a48 229 229 } 230 230 231 232 /** Start a session on the endpoint pipe.233 *234 * A session is something inside what any communication occurs.235 * It is expected that sessions would be started right before the transfer236 * and ended - see usb_pipe_end_session() - after the last237 * transfer.238 * The reason for this is that session actually opens some communication239 * channel to the host controller (or to the physical hardware if you240 * wish) and thus it involves acquiring kernel resources.241 * Since they are limited, sessions shall not be longer than strictly242 * necessary.243 *244 * @deprecated245 * Obsoleted with introduction of usb_pipe_start_long_transfer246 *247 * @param pipe Endpoint pipe to start the session on.248 * @return Error code.249 */250 int usb_pipe_start_session(usb_pipe_t *pipe)251 {252 usb_log_warning("usb_pipe_start_session() was deprecated.\n");253 return EOK;254 }255 256 257 /** Ends a session on the endpoint pipe.258 *259 * @deprecated260 * Obsoleted with introduction of usb_pipe_end_long_transfer261 *262 * @see usb_pipe_start_session263 *264 * @param pipe Endpoint pipe to end the session on.265 * @return Error code.266 */267 int usb_pipe_end_session(usb_pipe_t *pipe)268 {269 usb_log_warning("usb_pipe_end_session() was deprecated.\n");270 return EOK;271 }272 273 /** Tell whether a session is started (open) on the endpoint pipe.274 *275 * The expected usage of this function is in assertions for some276 * nested functions.277 *278 * @param pipe Endpoint pipe in question.279 * @return Whether @p pipe has opened a session.280 */281 bool usb_pipe_is_session_started(usb_pipe_t *pipe)282 {283 pipe_acquire(pipe);284 bool started = pipe->refcount > 0;285 pipe_release(pipe);286 return started;287 }288 289 231 /** Prepare pipe for a long transfer. 290 232 *
Note:
See TracChangeset
for help on using the changeset viewer.