Changeset f9d0a86 in mainline for uspace/lib/drv


Ignore:
Timestamp:
2017-11-14T12:24:42Z (8 years ago)
Author:
Aearsis <Hlavaty.Ondrej@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
6cad776
Parents:
887c9de (diff), d2d142a (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.
git-author:
Aearsis <Hlavaty.Ondrej@…> (2017-11-14 01:04:19)
git-committer:
Aearsis <Hlavaty.Ondrej@…> (2017-11-14 12:24:42)
Message:

Merge tag '0.7.1'

The merge wasn't clean, because of changes in build system. The most
significant change was partial revert of usbhc callback refactoring,
which now does not take usb transfer batch, but few named fields again.

Location:
uspace/lib/drv
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/drv/Makefile

    r887c9de rf9d0a86  
    2929
    3030USPACE_PREFIX = ../..
    31 EXTRA_CFLAGS = \
    32         -Iinclude \
    33         -Igeneric/private \
    34         -I$(LIBUSB_PREFIX)/include \
    35         -I$(LIBUSBHOST_PREFIX)/include \
    36         -I$(LIBPCM_PREFIX)/include
     31EXTRA_CFLAGS = -Igeneric/private
    3732LIBRARY = libdrv
     33LIBS = pcm
    3834
    3935SOURCES = \
  • uspace/lib/drv/generic/logbuf.c

    r887c9de rf9d0a86  
    3131 */
    3232
    33 #include <libarch/common.h>
    3433#include <stdio.h>
    3534#include <stddef.h>
  • uspace/lib/drv/generic/remote_usb.c

    r887c9de rf9d0a86  
    3535
    3636#include <async.h>
     37#include <assert.h>
    3738#include <macros.h>
    3839#include <errno.h>
    3940#include <devman.h>
    40 #include <usb/host/usb_transfer_batch.h>
    4141
    4242#include "usb_iface.h"
  • uspace/lib/drv/generic/remote_usbhc.c

    r887c9de rf9d0a86  
    3939#include <errno.h>
    4040#include <devman.h>
    41 #include <usb/host/usb_transfer_batch.h>
    4241
    4342#include "usbhc_iface.h"
     
    445444}
    446445
    447 static int callback_out(usb_transfer_batch_t *batch)
    448 {
    449         async_transaction_t *trans = batch->on_complete_data;
    450 
    451         const int err = async_answer_0(trans->caller, batch->error);
     446static int callback_out(void *arg, int error, size_t transfered_size)
     447{
     448        async_transaction_t *trans = arg;
     449
     450        const int err = async_answer_0(trans->caller, error);
    452451
    453452        async_transaction_destroy(trans);
     
    456455}
    457456
    458 static int callback_in(usb_transfer_batch_t *batch)
    459 {
    460         async_transaction_t *trans = batch->on_complete_data;
     457static int callback_in(void *arg, int error, size_t transfered_size)
     458{
     459        async_transaction_t *trans = arg;
    461460
    462461        if (trans->data_caller) {
    463                 if (batch->error == EOK) {
    464                         batch->error = async_data_read_finalize(trans->data_caller,
    465                             trans->buffer, batch->transfered_size);
     462                if (error == EOK) {
     463                        error = async_data_read_finalize(trans->data_caller,
     464                            trans->buffer, transfered_size);
    466465                } else {
    467466                        async_answer_0(trans->data_caller, EINTR);
     
    469468        }
    470469
    471         const int err = async_answer_0(trans->caller, batch->error);
     470        const int err = async_answer_0(trans->caller, error);
    472471        async_transaction_destroy(trans);
    473472        return err;
  • uspace/lib/drv/include/ddf/interrupt.h

    r887c9de rf9d0a86  
    3636#define DDF_INTERRUPT_H_
    3737
    38 #include <libarch/common.h>
    3938#include <types/common.h>
    4039#include <abi/ddi/irq.h>
  • uspace/lib/drv/include/usb_iface.h

    r887c9de rf9d0a86  
    4040#include "ddf/driver.h"
    4141#include <async.h>
    42 #include <usb/usb.h>
    4342
    4443typedef async_sess_t usb_dev_session_t;
     44
     45/** USB speeds. */
     46typedef enum {
     47        /** USB 1.1 low speed (1.5Mbits/s). */
     48        USB_SPEED_LOW,
     49        /** USB 1.1 full speed (12Mbits/s). */
     50        USB_SPEED_FULL,
     51        /** USB 2.0 high speed (480Mbits/s). */
     52        USB_SPEED_HIGH,
     53        /** USB 3.0 super speed (5Gbits/s). */
     54        USB_SPEED_SUPER,
     55        /** Psuedo-speed serving as a boundary. */
     56        USB_SPEED_MAX
     57} usb_speed_t;
     58
     59/** USB endpoint number type.
     60 * Negative values could be used to indicate error.
     61 */
     62typedef int16_t usb_endpoint_t;
     63
     64/** USB address type.
     65 * Negative values could be used to indicate error.
     66 */
     67typedef int16_t usb_address_t;
     68
     69/** USB address for the purposes of Transaction Translation.
     70 */
     71typedef struct {
     72        usb_address_t address;
     73        unsigned port;
     74} usb_tt_address_t;
     75
     76/** USB transfer type. */
     77typedef enum {
     78        USB_TRANSFER_CONTROL = 0,
     79        USB_TRANSFER_ISOCHRONOUS = 1,
     80        USB_TRANSFER_BULK = 2,
     81        USB_TRANSFER_INTERRUPT = 3
     82} usb_transfer_type_t;
     83
     84/** USB data transfer direction. */
     85typedef enum {
     86        USB_DIRECTION_IN,
     87        USB_DIRECTION_OUT,
     88        USB_DIRECTION_BOTH
     89} usb_direction_t;
     90
     91/** USB complete address type.
     92 * Pair address + endpoint is identification of transaction recipient.
     93 */
     94typedef union {
     95        struct {
     96                usb_address_t address;
     97                usb_endpoint_t endpoint;
     98        } __attribute__((packed));
     99        uint32_t packed;
     100} usb_target_t;
     101
     102/** Description of usb endpoint.
     103 */
     104typedef struct {
     105        /** Endpoint number. */
     106        usb_endpoint_t endpoint_no;
     107
     108        /** Endpoint transfer type. */
     109        usb_transfer_type_t transfer_type;
     110
     111        /** Endpoint direction. */
     112        usb_direction_t direction;
     113
     114        /** Maximum packet size for the endpoint. */
     115        size_t max_packet_size;
     116
     117        /** Number of packets per frame/uframe.
     118         * Only valid for HS INT and ISO transfers. All others should set to 1*/
     119        unsigned packets;
     120
     121        struct {
     122                unsigned polling_interval;
     123        } usb2;
     124
     125        struct {
     126                unsigned max_burst;
     127                unsigned max_streams;
     128        } usb3;
     129} usb_endpoint_desc_t;
     130
    45131
    46132extern usb_dev_session_t *usb_dev_connect(devman_handle_t);
  • uspace/lib/drv/include/usbhc_iface.h

    r887c9de rf9d0a86  
    4141
    4242#include "ddf/driver.h"
     43#include "usb_iface.h"
    4344#include <async.h>
    44 #include <usb/usb.h>
    4545
    4646extern int usbhc_reserve_default_address(async_exch_t *, usb_speed_t);
     
    5757    size_t);
    5858
    59 /** Defined in usb/host/usb_transfer_batch.h */
    60 typedef struct usb_transfer_batch usb_transfer_batch_t;
    61 
    62 /** Callback for outgoing transfer - clone of usb_transfer_batch_callback_t */
    63 typedef int (*usbhc_iface_transfer_callback_t)(usb_transfer_batch_t *);
     59/** Callback for outgoing transfer */
     60typedef int (*usbhc_iface_transfer_callback_t)(void *, int, size_t);
    6461
    6562/** USB device communication interface. */
  • uspace/lib/drv/include/usbhid_iface.h

    r887c9de rf9d0a86  
    3838
    3939#include "ddf/driver.h"
    40 #include <usb/usb.h>
    4140
    4241extern int usbhid_dev_get_event_length(async_sess_t *, size_t *);
Note: See TracChangeset for help on using the changeset viewer.