source: mainline/uspace/lib/usbdev/src/pipes.c@ 277ff98

lfn serial ticket/834-toolchain-update topic/msim-upgrade topic/simplify-dev-export
Last change on this file since 277ff98 was 277ff98, checked in by Jan Vesely <jano.vesely@…>, 14 years ago

libusbdev: Remove references to pipepriv routines.

  • Property mode set to 100644
File size: 2.8 KB
RevLine 
[6865243c]1/*
2 * Copyright (c) 2011 Vojtech Horky
[bd575647]3 * Copyright (c) 2011 Jan Vesely
[6865243c]4 * All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:
9 *
10 * - Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer.
12 * - Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in the
14 * documentation and/or other materials provided with the distribution.
15 * - The name of the author may not be used to endorse or promote products
16 * derived from this software without specific prior written permission.
17 *
18 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
19 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
20 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
21 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
22 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
23 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
24 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
25 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
27 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 */
[160b75e]29/** @addtogroup libusbdev
[6865243c]30 * @{
31 */
32/** @file
[dc04868]33 * USB endpoint pipes miscellaneous functions.
[6865243c]34 */
[357a302]35#include <usb_iface.h>
[bd575647]36#include <usb/dev/pipes.h>
[6865243c]37#include <errno.h>
[43f698b]38#include <assert.h>
[563fb40]39
[27a0012]40/** Tell USB interface assigned to given device.
41 *
42 * @param device Device in question.
[56bdd9a4]43 * @return Error code (ENOTSUP means any).
[27a0012]44 */
[8e5ce07]45int usb_device_get_assigned_interface(const ddf_dev_t *device)
[27a0012]46{
[7fc260ff]47 assert(device);
[79ae36dd]48 async_sess_t *parent_sess =
[9f7276d]49 devman_parent_device_connect(EXCHANGE_ATOMIC, device->handle,
[27a0012]50 IPC_FLAG_BLOCKING);
[79ae36dd]51 if (!parent_sess)
[56bdd9a4]52 return ENOMEM;
53
[79ae36dd]54 async_exch_t *exch = async_exchange_begin(parent_sess);
[56bdd9a4]55 if (!exch) {
56 async_hangup(parent_sess);
57 return ENOMEM;
58 }
59
60 int iface_no;
61 const int ret = usb_get_my_interface(exch, &iface_no);
62
63 return ret == EOK ? iface_no : ret;
[27a0012]64}
65
[e9ce696]66/** Prepare pipe for a long transfer.
67 *
68 * By a long transfer is mean transfer consisting of several
69 * requests to the HC.
70 * Calling such function is optional and it has positive effect of
71 * improved performance because IPC session is initiated only once.
72 *
73 * @param pipe Pipe over which the transfer will happen.
74 * @return Error code.
75 */
[2c2cbcf]76void usb_pipe_start_long_transfer(usb_pipe_t *pipe)
[e9ce696]77{
78}
79
80/** Terminate a long transfer on a pipe.
81 *
82 * @see usb_pipe_start_long_transfer
83 *
84 * @param pipe Pipe where to end the long transfer.
85 */
86void usb_pipe_end_long_transfer(usb_pipe_t *pipe)
87{
88}
89
[6865243c]90/**
91 * @}
92 */
Note: See TracBrowser for help on using the repository browser.