Changeset 58563585 in mainline for uspace/drv


Ignore:
Timestamp:
2016-08-31T11:15:39Z (9 years ago)
Author:
Martin Decky <martin@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
10cb47e
Parents:
7a67416
Message:

code review and cstyle cleanup (no change in functionality)

Location:
uspace/drv
Files:
46 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/bus/usb/ehci/main.c

    r7a67416 r58563585  
    2727 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    2828 */
     29
    2930/** @addtogroup drvusbehci
    3031 * @{
     
    3334 * Main routines of EHCI driver.
    3435 */
     36
    3537#include <ddf/driver.h>
    3638#include <ddf/interrupt.h>
     
    7072
    7173
    72 static int ehci_driver_init(hcd_t *hcd, const hw_res_list_parsed_t *res, bool irq)
     74static int ehci_driver_init(hcd_t *hcd, const hw_res_list_parsed_t *res,
     75    bool irq)
    7376{
    7477        assert(hcd);
     
    138141        return ddf_driver_main(&ehci_driver);
    139142}
     143
    140144/**
    141145 * @}
  • uspace/drv/bus/usb/ehci/res.h

    r7a67416 r58563585  
    3939#include <device/hw_res_parsed.h>
    4040
    41 int disable_legacy(ddf_dev_t *);
     41extern int disable_legacy(ddf_dev_t *);
    4242
    4343#endif
  • uspace/drv/bus/usb/ohci/endpoint_list.h

    r7a67416 r58563585  
    7676void endpoint_list_add_ep(endpoint_list_t *instance, ohci_endpoint_t *ep);
    7777void endpoint_list_remove_ep(endpoint_list_t *instance, ohci_endpoint_t *ep);
     78
    7879#endif
     80
    7981/**
    8082 * @}
  • uspace/drv/bus/usb/ohci/hc.c

    r7a67416 r58563585  
    177177                usb_log_error("Failed to create OHCI memory structures: %s.\n",
    178178                    str_error(ret));
    179                 //TODO: We should disable pio access here
     179                // TODO: We should disable pio access here
    180180                return ret;
    181181        }
     
    393393                    ohci_emulation_reg, OHCI_RD(*ohci_emulation_reg));
    394394                /* Zero everything but A20State */
    395                 //TODO: should we ack interrupts before doing this?
     395                // TODO: should we ack interrupts before doing this?
    396396                OHCI_CLR(*ohci_emulation_reg, ~0x100);
    397397                usb_log_debug(
     
    403403        if (OHCI_RD(instance->registers->control) & C_IR) {
    404404                usb_log_debug("SMM driver: request ownership change.\n");
    405                 //TODO: should we ack interrupts before doing this?
     405                // TODO: should we ack interrupts before doing this?
    406406                OHCI_SET(instance->registers->command_status, CS_OCR);
    407407                /* Hope that SMM actually knows its stuff or we can hang here */
  • uspace/drv/bus/usb/ohci/hc.h

    r7a67416 r58563585  
    2626 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    2727 */
     28
    2829/** @addtogroup drvusbohci
    2930 * @{
     
    3233 * @brief OHCI host controller driver structure
    3334 */
     35
    3436#ifndef DRV_OHCI_HC_H
    3537#define DRV_OHCI_HC_H
     
    7880} hc_t;
    7981
    80 int hc_init(hc_t *instance, const hw_res_list_parsed_t *hw_res, bool interrupts);
    81 void hc_fini(hc_t *instance);
     82extern int hc_init(hc_t *, const hw_res_list_parsed_t *, bool);
     83extern void hc_fini(hc_t *);
    8284
    83 void hc_enqueue_endpoint(hc_t *instance, const endpoint_t *ep);
    84 void hc_dequeue_endpoint(hc_t *instance, const endpoint_t *ep);
     85extern void hc_enqueue_endpoint(hc_t *, const endpoint_t *);
     86extern void hc_dequeue_endpoint(hc_t *, const endpoint_t *);
    8587
    8688int ohci_hc_gen_irq_code(irq_code_t *code, const hw_res_list_parsed_t *hw_res);
    8789
    88 void ohci_hc_interrupt(hcd_t *hcd, uint32_t status);
    89 int ohci_hc_status(hcd_t *hcd, uint32_t *status);
    90 int ohci_hc_schedule(hcd_t *hcd, usb_transfer_batch_t *batch);
     90extern void ohci_hc_interrupt(hcd_t *, uint32_t);
     91extern int ohci_hc_status(hcd_t *, uint32_t *);
     92extern int ohci_hc_schedule(hcd_t *, usb_transfer_batch_t *);
     93
    9194#endif
     95
    9296/**
    9397 * @}
  • uspace/drv/bus/usb/ohci/hw_struct/completion_codes.h

    r7a67416 r58563585  
    5454};
    5555
    56 inline static unsigned cc_to_rc(unsigned cc)
     56inline static unsigned int cc_to_rc(unsigned int cc)
    5757{
    5858        switch (cc) {
  • uspace/drv/bus/usb/ohci/hw_struct/endpoint_descriptor.c

    r7a67416 r58563585  
    2626 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    2727 */
     28
    2829/** @addtogroup drvusbohci
    2930 * @{
  • uspace/drv/bus/usb/ohci/hw_struct/hcca.h

    r7a67416 r58563585  
    2626 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    2727 */
     28
    2829/** @addtogroup drvusbohci
    2930 * @{
     
    3233 * @brief OHCI driver
    3334 */
     35
    3436#ifndef DRV_OHCI_HW_STRUCT_HCCA_H
    3537#define DRV_OHCI_HW_STRUCT_HCCA_H
     
    8587        OHCI_MEM32_WR(hcca->int_ep[index], pa);
    8688}
     89
    8790#endif
     91
    8892/**
    8993 * @}
  • uspace/drv/bus/usb/ohci/hw_struct/iso_transfer_descriptor.h

    r7a67416 r58563585  
    2626 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    2727 */
     28
    2829/** @addtogroup drvusbohci
    2930 * @{
     
    3233 * @brief OHCI driver
    3334 */
     35
    3436#ifndef DRV_OHCI_HW_STRUCT_ISO_TRANSFER_DESCRIPTOR_H
    3537#define DRV_OHCI_HW_STRUCT_ISO_TRANSFER_DESCRIPTOR_H
     
    6870
    6971} __attribute__((packed)) itd_t;
     72
    7073#endif
     74
    7175/**
    7276 * @}
  • uspace/drv/bus/usb/ohci/hw_struct/mem_access.h

    r7a67416 r58563585  
    2626 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    2727 */
     28
    2829/** @addtogroup drvusbohci
    2930 * @{
     
    3233 * @brief OHCI driver
    3334 */
     35
    3436#ifndef DRV_OHCI_HW_MEM_ACCESS_H
    3537#define DRV_OHCI_HW_MEM_ACCESS_H
  • uspace/drv/bus/usb/ohci/hw_struct/transfer_descriptor.c

    r7a67416 r58563585  
    2626 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    2727 */
     28
    2829/** @addtogroup drvusbohci
    2930 * @{
  • uspace/drv/bus/usb/ohci/hw_struct/transfer_descriptor.h

    r7a67416 r58563585  
    2626 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    2727 */
     28
    2829/** @addtogroup drvusbohci
    2930 * @{
     
    3233 * @brief OHCI driver
    3334 */
     35
    3436#ifndef DRV_OHCI_HW_STRUCT_TRANSFER_DESCRIPTOR_H
    3537#define DRV_OHCI_HW_STRUCT_TRANSFER_DESCRIPTOR_H
     
    139141        return OHCI_MEM32_RD(instance->be) - OHCI_MEM32_RD(instance->cbp) + 1;
    140142}
     143
    141144#endif
     145
    142146/**
    143147 * @}
  • uspace/drv/bus/usb/ohci/main.c

    r7a67416 r58563585  
    2727 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    2828 */
     29
    2930/** @addtogroup drvusbohci
    3031 * @{
     
    128129        return ddf_driver_main(&ohci_driver);
    129130}
     131
    130132/**
    131133 * @}
  • uspace/drv/bus/usb/ohci/ohci_batch.c

    r7a67416 r58563585  
    2626 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    2727 */
     28
    2829/** @addtogroup drvusbohci
    2930 * @{
  • uspace/drv/bus/usb/ohci/ohci_endpoint.c

    r7a67416 r58563585  
    2626 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    2727 */
     28
    2829/** @addtogroup drvusbohci
    2930 * @{
     
    117118        }
    118119}
     120
    119121/**
    120122 * @}
  • uspace/drv/bus/usb/ohci/ohci_regs.h

    r7a67416 r58563585  
    2626 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    2727 */
     28
    2829/** @addtogroup drvusbohci
    2930 * @{
     
    3233 * @brief OHCI host controller register structure
    3334 */
     35
    3436#ifndef DRV_OHCI_OHCI_REGS_H
    3537#define DRV_OHCI_OHCI_REGS_H
     38
    3639#include <ddi.h>
    3740#include <sys/types.h>
     
    246249#define RHPS_CHANGE_WC_MASK (0x1f0000)
    247250} ohci_regs_t;
     251
    248252#endif
     253
    249254/**
    250255 * @}
  • uspace/drv/bus/usb/uhci/hc.c

    r7a67416 r58563585  
    2626 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    2727 */
     28
    2829/** @addtogroup drvusbuhcihc
    2930 * @{
  • uspace/drv/bus/usb/uhci/hc.h

    r7a67416 r58563585  
    3333 * @brief UHCI host controller driver structure
    3434 */
     35
    3536#ifndef DRV_UHCI_HC_H
    3637#define DRV_UHCI_HC_H
     
    123124} hc_t;
    124125
    125 int hc_init(hc_t *instance, const hw_res_list_parsed_t *hw_res, bool interupts);
    126 void hc_fini(hc_t *instance);
     126extern int hc_init(hc_t *, const hw_res_list_parsed_t *, bool);
     127extern void hc_fini(hc_t *);
    127128
    128 int uhci_hc_gen_irq_code(irq_code_t *code, const hw_res_list_parsed_t *hw_res);
     129extern int uhci_hc_gen_irq_code(irq_code_t *, const hw_res_list_parsed_t *);
    129130
    130 void uhci_hc_interrupt(hcd_t *hcd, uint32_t status);
    131 int uhci_hc_status(hcd_t *hcd, uint32_t *status);
    132 int uhci_hc_schedule(hcd_t *hcd, usb_transfer_batch_t *batch);
     131extern void uhci_hc_interrupt(hcd_t *, uint32_t);
     132extern int uhci_hc_status(hcd_t *, uint32_t *);
     133extern int uhci_hc_schedule(hcd_t *, usb_transfer_batch_t *);
    133134
    134135#endif
  • uspace/drv/bus/usb/uhci/hw_struct/link_pointer.h

    r7a67416 r58563585  
    2626 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    2727 */
     28
    2829/** @addtogroup drvusbuhcihc
    2930 * @{
     
    3233 * @brief UHCI driver
    3334 */
     35
    3436#ifndef DRV_UHCI_HW_STRUCT_LINK_POINTER_H
    3537#define DRV_UHCI_HW_STRUCT_LINK_POINTER_H
     
    5860
    5961#endif
     62
    6063/**
    6164 * @}
  • uspace/drv/bus/usb/uhci/hw_struct/queue_head.h

    r7a67416 r58563585  
    2626 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    2727 */
     28
    2829/** @addtogroup drvusbuhcihc
    2930 * @{
     
    3233 * @brief UHCI driver
    3334 */
     35
    3436#ifndef DRV_UHCI_HW_STRUCT_QH_H
    3537#define DRV_UHCI_HW_STRUCT_QH_H
     
    103105        }
    104106}
     107
    105108#endif
     109
    106110/**
    107111 * @}
  • uspace/drv/bus/usb/uhci/hw_struct/transfer_descriptor.c

    r7a67416 r58563585  
    2626 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    2727 */
     28
    2829/** @addtogroup drvusbuhcihc
    2930 * @{
  • uspace/drv/bus/usb/uhci/hw_struct/transfer_descriptor.h

    r7a67416 r58563585  
    2626 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    2727 */
     28
    2829/** @addtogroup drvusbuhcihc
    2930 * @{
     
    3233 * @brief UHCI driver
    3334 */
     35
    3436#ifndef DRV_UHCI_HW_STRUCT_TRANSFER_DESCRIPTOR_H
    3537#define DRV_UHCI_HW_STRUCT_TRANSFER_DESCRIPTOR_H
     
    165167
    166168#endif
     169
    167170/**
    168171 * @}
  • uspace/drv/bus/usb/uhci/main.c

    r7a67416 r58563585  
    2626 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    2727 */
     28
    2829/** @addtogroup drvusbuhci
    2930 * @{
  • uspace/drv/bus/usb/uhci/transfer_list.h

    r7a67416 r58563585  
    2626 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    2727 */
     28
    2829/** @addtogroup drvusbuhcihc
    2930 * @{
     
    3233 * @brief UHCI driver transfer list structure
    3334 */
     35
    3436#ifndef DRV_UHCI_TRANSFER_LIST_H
    3537#define DRV_UHCI_TRANSFER_LIST_H
     
    6163void transfer_list_remove_finished(transfer_list_t *instance, list_t *done);
    6264void transfer_list_abort_all(transfer_list_t *instance);
     65
    6366#endif
     67
    6468/**
    6569 * @}
  • uspace/drv/bus/usb/uhci/uhci_batch.c

    r7a67416 r58563585  
    2626 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    2727 */
     28
    2829/** @addtogroup drvusbuhcihc
    2930 * @{
  • uspace/drv/bus/usb/uhci/uhci_batch.h

    r7a67416 r58563585  
    2626 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    2727 */
     28
    2829/** @addtogroup drvusbuhcihc
    2930 * @{
     
    3233 * @brief UHCI driver USB tranfer helper functions
    3334 */
     35
    3436#ifndef DRV_UHCI_BATCH_H
    3537#define DRV_UHCI_BATCH_H
     
    119121
    120122#endif
     123
    121124/**
    122125 * @}
  • uspace/drv/bus/usb/usbhid/mouse/mousedev.c

    r7a67416 r58563585  
    254254                    "will not be destroyed.\n", ddf_fun_get_name(fun)); \
    255255        } \
    256 } else (void)0
     256} else (void) 0
    257257
    258258/** Get highest index of a button mentioned in given report.
     
    325325
    326326        if (hid_dev == NULL) {
    327                 usb_log_error("Failed to init keyboard structure: no structure"
     327                usb_log_error("Failed to init mouse structure: no structure"
    328328                    " given.\n");
    329329                return EINVAL;
  • uspace/drv/bus/usb/usbhub/port.c

    r7a67416 r58563585  
    2727 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    2828 */
     29
    2930/** @addtogroup drvusbhub
    3031 * @{
     
    175176                } else {
    176177                        /* Handle the case we were in reset */
    177                         //usb_hub_port_reset_fail(port);
     178                        // FIXME: usb_hub_port_reset_fail(port);
    178179                        /* If enabled change was reported leave the removal
    179180                         * to that handler, it shall ACK the change too. */
     
    186187        /* Enable change, ports are automatically disabled on errors. */
    187188        if (status & USB_HUB_PORT_C_STATUS_ENABLED) {
    188                 //TODO: maybe HS reset failed?
     189                // TODO: maybe HS reset failed?
    189190                usb_log_info("(%p-%u): Port disabled because of errors.\n", hub,
    190191                   port->port_number);
  • uspace/drv/bus/usb/usbhub/port.h

    r7a67416 r58563585  
    2727 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    2828 */
     29
    2930/** @addtogroup drvusbhub
    3031 * @{
     
    3334 * Hub ports related functions.
    3435 */
     36
    3537#ifndef DRV_USBHUB_PORT_H
    3638#define DRV_USBHUB_PORT_H
     
    4547typedef struct {
    4648        /** Port number as reported in descriptors. */
    47         unsigned port_number;
     49        unsigned int port_number;
    4850        /** Device communication pipe. */
    4951        usb_pipe_t *control_pipe;
     
    6971 * @param port Port to be initialized.
    7072 */
    71 static inline void usb_hub_port_init(usb_hub_port_t *port, unsigned port_number,
    72     usb_pipe_t *control_pipe)
     73static inline void usb_hub_port_init(usb_hub_port_t *port,
     74    unsigned int port_number, usb_pipe_t *control_pipe)
    7375{
    7476        assert(port);
     
    8082        fibril_condvar_initialize(&port->reset_cv);
    8183}
     84
    8285int usb_hub_port_fini(usb_hub_port_t *port, usb_hub_dev_t *hub);
    8386int usb_hub_port_clear_feature(
     
    8992
    9093#endif
     94
    9195/**
    9296 * @}
  • uspace/drv/bus/usb/usbhub/status.h

    r7a67416 r58563585  
    2727 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    2828 */
     29
    2930/** @addtogroup drvusbhub
    3031 * @{
     
    114115}
    115116
    116 #endif  /* HUB_STATUS_H */
     117#endif
     118
    117119/**
    118120 * @}
  • uspace/drv/bus/usb/usbhub/usbhub.c

    r7a67416 r58563585  
    2727 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    2828 */
     29
    2930/** @addtogroup drvusbhub
    3031 * @{
     
    5657
    5758#define HUB_FNC_NAME "hub"
     59
    5860/** Hub status-change endpoint description.
    5961 *
     
    229231    uint8_t *change_bitmap, size_t change_bitmap_size, void *arg)
    230232{
    231 //      usb_log_debug("hub_port_changes_callback\n");
    232233        usb_hub_dev_t *hub = arg;
    233234        assert(hub);
     
    314315            hub_dev->per_port_power ? "per port" : "ganged");
    315316
    316         for (unsigned port = 0; port < hub_dev->port_count; ++port) {
     317        for (unsigned int port = 0; port < hub_dev->port_count; ++port) {
    317318                usb_log_debug("(%p): Powering port %u.", hub_dev, port);
    318319                const int ret = usb_hub_port_set_feature(
  • uspace/drv/bus/usb/usbhub/usbhub.h

    r7a67416 r58563585  
    2727 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    2828 */
     29
    2930/** @addtogroup drvusbhub
    3031 * @{
     
    3334 * @brief Hub driver.
    3435 */
     36
    3537#ifndef DRV_USBHUB_USBHUB_H
    3638#define DRV_USBHUB_USBHUB_H
     
    8284extern const usb_endpoint_description_t hub_status_change_endpoint_description;
    8385
    84 int usb_hub_device_add(usb_device_t *usb_dev);
    85 int usb_hub_device_remove(usb_device_t *usb_dev);
    86 int usb_hub_device_gone(usb_device_t *usb_dev);
     86extern int usb_hub_device_add(usb_device_t *);
     87extern int usb_hub_device_remove(usb_device_t *);
     88extern int usb_hub_device_gone(usb_device_t *);
    8789
    88 bool hub_port_changes_callback(usb_device_t *dev,
    89     uint8_t *change_bitmap, size_t change_bitmap_size, void *arg);
     90extern bool hub_port_changes_callback(usb_device_t *, uint8_t *, size_t,
     91    void *);
    9092
    9193#endif
     94
    9295/**
    9396 * @}
  • uspace/drv/bus/usb/usbmast/bo_trans.c

    r7a67416 r58563585  
    3434 * USB mass storage bulk-only transport.
    3535 */
     36
    3637#include <stdbool.h>
    3738#include <errno.h>
  • uspace/drv/bus/usb/usbmast/main.c

    r7a67416 r58563585  
    3535 * Main routines of USB mass storage driver.
    3636 */
     37
    3738#include <as.h>
    3839#include <async.h>
  • uspace/drv/bus/usb/usbmast/scsi_ms.c

    r7a67416 r58563585  
    3535 * SCSI functions for USB mass storage driver.
    3636 */
     37
    3738#include <bitops.h>
    3839#include <byteorder.h>
  • uspace/drv/bus/usb/usbmid/explore.c

    r7a67416 r58563585  
    3434 * Exploration of available interfaces in the USB device.
    3535 */
     36
    3637#include <errno.h>
    3738#include <str_error.h>
  • uspace/drv/bus/usb/usbmid/usbmid.c

    r7a67416 r58563585  
    3535 * Helper functions.
    3636 */
     37
    3738#include <errno.h>
    3839#include <str_error.h>
  • uspace/drv/bus/usb/usbmid/usbmid.h

    r7a67416 r58563585  
    6262} usb_mid_t;
    6363
    64 int usbmid_explore_device(usb_device_t *);
    65 int usbmid_spawn_interface_child(usb_device_t *, usbmid_interface_t **,
     64extern int usbmid_explore_device(usb_device_t *);
     65extern int usbmid_spawn_interface_child(usb_device_t *, usbmid_interface_t **,
    6666    const usb_standard_device_descriptor_t *,
    6767    const usb_standard_interface_descriptor_t *);
    68 void usbmid_dump_descriptors(uint8_t *, size_t);
    69 int usbmid_interface_destroy(usbmid_interface_t *mid_iface);
     68extern void usbmid_dump_descriptors(uint8_t *, size_t);
     69extern int usbmid_interface_destroy(usbmid_interface_t *mid_iface);
    7070
    7171static inline usbmid_interface_t * usbmid_interface_from_link(link_t *item)
     
    7575
    7676#endif
     77
    7778/**
    7879 * @}
  • uspace/drv/bus/usb/vhc/devconn.c

    r7a67416 r58563585  
    9595}
    9696
    97 int vhc_virtdev_plug_hub(vhc_data_t *vhc, usbvirt_device_t *dev, uintptr_t *handle, usb_address_t address)
     97int vhc_virtdev_plug_hub(vhc_data_t *vhc, usbvirt_device_t *dev,
     98    uintptr_t *handle, usb_address_t address)
    9899{
    99100        return vhc_virtdev_plug_generic(vhc, NULL, dev, handle, false, address);
  • uspace/drv/bus/usb/vhc/hub/virthub.c

    r7a67416 r58563585  
    3333 * @brief
    3434 */
     35
    3536#include <usb/classes/classes.h>
    3637#include <usb/classes/hub.h>
  • uspace/drv/bus/usb/vhc/hub/virthub.h

    r7a67416 r58563585  
    3333 * @brief USB hub as a virtual USB device.
    3434 */
     35
    3536#ifndef VHC_HUB_VIRTHUB_H_
    3637#define VHC_HUB_VIRTHUB_H_
     
    8687
    8788#endif
     89
    8890/**
    8991 * @}
  • uspace/drv/bus/usb/vhc/hub/virthubops.c

    r7a67416 r58563585  
    3333 * @brief Virtual USB hub operations.
    3434 */
     35
    3536#include <errno.h>
    3637#include <usb/classes/hub.h>
  • uspace/drv/bus/usb/vhc/main.c

    r7a67416 r58563585  
    4343#include <usb/debug.h>
    4444#include "vhcd.h"
    45 
    4645
    4746static ddf_dev_ops_t vhc_ops = {
  • uspace/drv/bus/usb/vhc/transfer.c

    r7a67416 r58563585  
    233233                if (rc == EOK) {
    234234                        if (is_set_address_transfer(transfer)) {
    235                                 usb_device_request_setup_packet_t *setup
    236                                     = (void*)transfer->batch->setup_buffer;
     235                                usb_device_request_setup_packet_t *setup =
     236                                    (void*) transfer->batch->setup_buffer;
    237237                                dev->address = setup->value;
    238238                                usb_log_debug2("Address changed to %d\n",
  • uspace/drv/bus/usb/vhc/vhcd.h

    r7a67416 r58563585  
    3333 * @brief Virtual USB host controller common definitions.
    3434 */
     35
    3536#ifndef VHCD_VHCD_H_
    3637#define VHCD_VHCD_H_
     
    4142
    4243#include <usb/host/hcd.h>
    43 
    4444
    4545#define NAME "vhc"
     
    6767} vhc_transfer_t;
    6868
    69 
    7069void on_client_close(ddf_fun_t *fun);
    7170void default_connection_handler(ddf_fun_t *fun, ipc_callid_t icallid,
     
    8281
    8382#endif
     83
    8484/**
    8585 * @}
  • uspace/drv/nic/ar9271/ath_usb.c

    r7a67416 r58563585  
    100100        usb_pipe_t *pipe = &usb_device_get_mapped_ep(
    101101            ath_usb->usb_device, ath_usb->output_ctrl_pipe_number)->pipe;
    102 
     102       
    103103        return usb_pipe_write(pipe, buffer, buffer_size);
    104104}
     
    120120        usb_pipe_t *pipe = &usb_device_get_mapped_ep(
    121121            ath_usb->usb_device, ath_usb->input_ctrl_pipe_number)->pipe;
    122 
     122       
    123123        return usb_pipe_read(pipe, buffer, buffer_size, transferred_size);
    124124}
     
    141141        memcpy(complete_buffer + sizeof(ath_usb_data_header_t),
    142142            buffer, buffer_size);
    143 
     143       
    144144        ath_usb_data_header_t *data_header =
    145145            (ath_usb_data_header_t *) complete_buffer;
    146146        data_header->length = host2uint16_t_le(buffer_size);
    147147        data_header->tag = host2uint16_t_le(TX_TAG);
    148 
     148       
    149149        ath_usb_t *ath_usb = (ath_usb_t *) ath->specific_data;
    150150        usb_pipe_t *pipe = &usb_device_get_mapped_ep(
    151151            ath_usb->usb_device, ath_usb->output_data_pipe_number)->pipe;
    152 
     152       
    153153        int ret_val = usb_pipe_write(pipe, complete_buffer,
    154154            complete_buffer_size);
    155 
     155       
    156156        free(complete_buffer);
    157 
     157       
    158158        return ret_val;
    159159}
     
    175175        usb_pipe_t *pipe = &usb_device_get_mapped_ep(
    176176            ath_usb->usb_device, ath_usb->input_data_pipe_number)->pipe;
    177 
     177       
    178178        return usb_pipe_read(pipe, buffer, buffer_size, transferred_size);
    179179}
Note: See TracChangeset for help on using the changeset viewer.