Changeset 97c7682 in mainline for uspace/lib/usb/src/hc.c


Ignore:
Timestamp:
2012-07-14T11:18:40Z (12 years ago)
Author:
Jan Vesely <jano.vesely@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
804d9b6
Parents:
0747468 (diff), f0348c8 (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.
Message:

Merge mainline changes.

Text conflict in boot/arch/arm32/Makefile.inc:

Trivial conflict around ifeq condition.

Text conflict in kernel/arch/arm32/include/mm/page.h:

Added defines and set_pt_levelx_present function.
COnflict looked horrible because of the armv4/v7 split.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/usb/src/hc.c

    r0747468 r97c7682  
    2727 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    2828 */
     29
    2930/** @addtogroup libusb
    3031 * @{
     
    3334 * General communication with host controller driver (implementation).
    3435 */
     36
    3537#include <usb/debug.h>
    3638
     
    4446{
    4547        assert(connection);
     48       
    4649        fibril_mutex_lock(&connection->guard);
    4750        if (connection->ref_count == 0) {
     
    5558                }
    5659        }
     60       
    5761        ++connection->ref_count;
    5862        fibril_mutex_unlock(&connection->guard);
    5963        return EOK;
    6064}
    61 /*----------------------------------------------------------------------------*/
     65
    6266static int usb_hc_connection_del_ref(usb_hc_connection_t *connection)
    6367{
    6468        assert(connection);
     69       
    6570        fibril_mutex_lock(&connection->guard);
    6671        if (connection->ref_count == 0) {
    6772                /* Closing already closed connection... */
    68                 assert(connection->hc_sess = NULL);
     73                assert(connection->hc_sess == NULL);
    6974                fibril_mutex_unlock(&connection->guard);
    7075                return EOK;
    7176        }
     77       
    7278        --connection->ref_count;
    7379        int ret = EOK;
     
    125131        return rc;
    126132}
    127 /*----------------------------------------------------------------------------*/
     133
    128134void usb_hc_connection_deinitialize(usb_hc_connection_t *connection)
    129135{
     
    140146        fibril_mutex_unlock(&connection->guard);
    141147}
    142 /*----------------------------------------------------------------------------*/
     148
    143149/** Open connection to host controller.
    144150 *
     
    150156        return usb_hc_connection_add_ref(connection);
    151157}
    152 /*----------------------------------------------------------------------------*/
     158
    153159/** Close connection to the host controller.
    154160 *
     
    160166        return usb_hc_connection_del_ref(connection);
    161167}
    162 /*----------------------------------------------------------------------------*/
     168
    163169/** Ask host controller for free address assignment.
    164170 *
     
    182188        return ret == EOK ? address : ret;
    183189}
    184 /*----------------------------------------------------------------------------*/
     190
    185191int usb_hc_bind_address(usb_hc_connection_t * connection,
    186192    usb_address_t address, devman_handle_t handle)
     
    194200        return ret;
    195201}
    196 /*----------------------------------------------------------------------------*/
     202
    197203/** Get handle of USB device with given address.
    198204 *
     
    213219        return ret;
    214220}
    215 /*----------------------------------------------------------------------------*/
     221
    216222int usb_hc_release_address(usb_hc_connection_t *connection,
    217223    usb_address_t address)
     
    225231        return ret;
    226232}
    227 /*----------------------------------------------------------------------------*/
     233
    228234int usb_hc_register_endpoint(usb_hc_connection_t *connection,
    229235    usb_address_t address, usb_endpoint_t endpoint, usb_transfer_type_t type,
     
    239245        return ret;
    240246}
    241 /*----------------------------------------------------------------------------*/
     247
    242248int usb_hc_unregister_endpoint(usb_hc_connection_t *connection,
    243249    usb_address_t address, usb_endpoint_t endpoint, usb_direction_t direction)
     
    252258        return ret;
    253259}
    254 /*----------------------------------------------------------------------------*/
     260
    255261int usb_hc_read(usb_hc_connection_t *connection, usb_address_t address,
    256262    usb_endpoint_t endpoint, uint64_t setup, void *data, size_t size,
     
    266272        return ret;
    267273}
    268 /*----------------------------------------------------------------------------*/
     274
    269275int usb_hc_write(usb_hc_connection_t *connection, usb_address_t address,
    270276    usb_endpoint_t endpoint, uint64_t setup, const void *data, size_t size)
Note: See TracChangeset for help on using the changeset viewer.