Changeset b7b7898 in mainline for uspace/drv/bus/usb/usbdiag/device.h


Ignore:
Timestamp:
2017-12-22T12:03:16Z (6 years ago)
Author:
Petr Mánek <petr.manek@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
96c416a
Parents:
2986763
git-author:
Petr Mánek <petr.manek@…> (2017-12-22 12:02:50)
git-committer:
Petr Mánek <petr.manek@…> (2017-12-22 12:03:16)
Message:

usbdiag: refactoring

Reconciliated the usb_diag and usbdiag prefix in favor of the latter. Removed a ton of copy-pasta code for the burst tests in favor of single generic static burst test for every direction, which is then called by individual functions for different endpoint type. This also allowed to get rid of the ugly translation macros in device.c. Deleted unused usbdiag.h header file. Refactored the remote interface to comply with all aforementioned modifications.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/bus/usb/usbdiag/device.h

    r2986763 rb7b7898  
    3434 */
    3535
    36 #ifndef USB_DIAG_DEVICE_H_
    37 #define USB_DIAG_DEVICE_H_
     36#ifndef USBDIAG_DEVICE_H_
     37#define USBDIAG_DEVICE_H_
    3838
    3939#include <usb/dev/device.h>
    4040
    41 #define USB_DIAG_EP_INTR_IN    1
    42 #define USB_DIAG_EP_INTR_OUT   2
    43 #define USB_DIAG_EP_BULK_IN    3
    44 #define USB_DIAG_EP_BULK_OUT   4
    45 #define USB_DIAG_EP_ISOCH_IN   5
    46 #define USB_DIAG_EP_ISOCH_OUT  6
     41#define USBDIAG_EP_INTR_IN    1
     42#define USBDIAG_EP_INTR_OUT   2
     43#define USBDIAG_EP_BULK_IN    3
     44#define USBDIAG_EP_BULK_OUT   4
     45#define USBDIAG_EP_ISOCH_IN   5
     46#define USBDIAG_EP_ISOCH_OUT  6
    4747
    4848/**
    4949 * USB diagnostic device.
    5050 */
    51 typedef struct usb_diag_dev {
     51typedef struct usbdiag_dev {
    5252        usb_device_t *usb_dev;
    5353        ddf_fun_t *fun;
     
    5858        usb_pipe_t *isoch_in;
    5959        usb_pipe_t *isoch_out;
    60 } usb_diag_dev_t;
     60} usbdiag_dev_t;
    6161
    62 int usb_diag_dev_create(usb_device_t *, usb_diag_dev_t **);
    63 void usb_diag_dev_destroy(usb_diag_dev_t *);
     62int usbdiag_dev_create(usb_device_t *, usbdiag_dev_t **);
     63void usbdiag_dev_destroy(usbdiag_dev_t *);
    6464
    65 static inline usb_diag_dev_t * usb_device_to_usb_diag_dev(usb_device_t *usb_dev)
     65static inline usbdiag_dev_t * usb_device_to_usbdiag_dev(usb_device_t *usb_dev)
    6666{
    6767        assert(usb_dev);
     
    6969}
    7070
    71 static inline usb_diag_dev_t * ddf_dev_to_usb_diag_dev(ddf_dev_t *ddf_dev)
     71static inline usbdiag_dev_t * ddf_dev_to_usbdiag_dev(ddf_dev_t *ddf_dev)
    7272{
    7373        assert(ddf_dev);
    74         return usb_device_to_usb_diag_dev(usb_device_get(ddf_dev));
     74        return usb_device_to_usbdiag_dev(usb_device_get(ddf_dev));
    7575}
    7676
    77 static inline usb_diag_dev_t * ddf_fun_to_usb_diag_dev(ddf_fun_t *ddf_fun)
     77static inline usbdiag_dev_t * ddf_fun_to_usbdiag_dev(ddf_fun_t *ddf_fun)
    7878{
    7979        assert(ddf_fun);
    80         return ddf_dev_to_usb_diag_dev(ddf_fun_get_dev(ddf_fun));
     80        return ddf_dev_to_usbdiag_dev(ddf_fun_get_dev(ddf_fun));
    8181}
    8282
    83 #endif /* USB_DIAG_USBDIAG_H_ */
     83#endif /* USBDIAG_USBDIAG_H_ */
    8484
    8585/**
Note: See TracChangeset for help on using the changeset viewer.