Changeset ae3a941 in mainline for uspace/lib/usb/include


Ignore:
Timestamp:
2018-02-26T16:51:40Z (7 years ago)
Author:
Ondřej Hlavatý <aearsis@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
e773f58
Parents:
3692678
Message:

usb: cstyle

Location:
uspace/lib/usb/include/usb
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/usb/include/usb/classes/hub.h

    r3692678 rae3a941  
    178178         */
    179179        uint8_t max_current;
    180 } __attribute__ ((packed)) usb_hub_descriptor_header_t;
     180} __attribute__((packed)) usb_hub_descriptor_header_t;
    181181
    182182/** One bit for the device and one bit for every port */
     
    187187 */
    188188typedef enum {
    189     /** This request resets a value reported in the hub status. */
    190     USB_HUB_REQ_TYPE_CLEAR_HUB_FEATURE = 0x20,
    191     /** This request resets a value reported in the port status. */
    192     USB_HUB_REQ_TYPE_CLEAR_PORT_FEATURE = 0x23,
    193     /**
    194     * This is an optional per-port diagnostic request that returns the bus
    195     * state value, as sampled at the last EOF2 point.
    196     */
    197     USB_HUB_REQ_TYPE_GET_STATE = 0xA3,
    198     /** This request returns the hub descriptor. */
    199     USB_HUB_REQ_TYPE_GET_DESCRIPTOR = 0xA0,
    200     /**
    201     * This request returns the current hub status and the states that have
    202     * changed since the previous acknowledgment.
    203     */
    204     USB_HUB_REQ_TYPE_GET_HUB_STATUS = 0xA0,
    205     /**
    206     * This request returns the current port status and the current value of the
    207     * port status change bits.
    208     */
    209     USB_HUB_REQ_TYPE_GET_PORT_STATUS = 0xA3,
    210     /** This request overwrites the hub descriptor. */
    211     USB_HUB_REQ_TYPE_SET_DESCRIPTOR = 0x20,
    212     /** This request sets a value reported in the hub status. */
    213     USB_HUB_REQ_TYPE_SET_HUB_FEATURE = 0x20,
    214     /**
    215     * This request sets the value that the hub uses to determine the index
    216     * into the Route String Index for the hub.
    217     */
    218     USB_HUB_REQ_TYPE_SET_HUB_DEPTH = 0x20,
    219     /** This request sets a value reported in the port status. */
    220     USB_HUB_REQ_TYPE_SET_PORT_FEATURE = 0x23,
     189        /** This request resets a value reported in the hub status. */
     190        USB_HUB_REQ_TYPE_CLEAR_HUB_FEATURE = 0x20,
     191        /** This request resets a value reported in the port status. */
     192        USB_HUB_REQ_TYPE_CLEAR_PORT_FEATURE = 0x23,
     193        /**
     194        * This is an optional per-port diagnostic request that returns the bus
     195        * state value, as sampled at the last EOF2 point.
     196        */
     197        USB_HUB_REQ_TYPE_GET_STATE = 0xA3,
     198        /** This request returns the hub descriptor. */
     199        USB_HUB_REQ_TYPE_GET_DESCRIPTOR = 0xA0,
     200        /**
     201        * This request returns the current hub status and the states that have
     202        * changed since the previous acknowledgment.
     203        */
     204        USB_HUB_REQ_TYPE_GET_HUB_STATUS = 0xA0,
     205        /**
     206        * This request returns the current port status and the current value of the
     207        * port status change bits.
     208        */
     209        USB_HUB_REQ_TYPE_GET_PORT_STATUS = 0xA3,
     210        /** This request overwrites the hub descriptor. */
     211        USB_HUB_REQ_TYPE_SET_DESCRIPTOR = 0x20,
     212        /** This request sets a value reported in the hub status. */
     213        USB_HUB_REQ_TYPE_SET_HUB_FEATURE = 0x20,
     214        /**
     215        * This request sets the value that the hub uses to determine the index
     216        * into the Route String Index for the hub.
     217        */
     218        USB_HUB_REQ_TYPE_SET_HUB_DEPTH = 0x20,
     219        /** This request sets a value reported in the port status. */
     220        USB_HUB_REQ_TYPE_SET_PORT_FEATURE = 0x23,
    221221} usb_hub_bm_request_type_t;
    222222
    223 /** @brief hub class request codes*/
    224 /// \TODO these are duplicit to standart descriptors
     223/**
     224 * @brief hub class request codes
     225 */
    225226typedef enum {
    226     /**  */
    227     USB_HUB_REQUEST_GET_STATUS = 0,
    228     /** */
    229     USB_HUB_REQUEST_CLEAR_FEATURE = 1,
    230     /** USB 1.0 only */
    231     USB_HUB_REQUEST_GET_STATE = 2,
    232     /** */
    233     USB_HUB_REQUEST_SET_FEATURE = 3,
    234     /** */
    235     USB_HUB_REQUEST_GET_DESCRIPTOR = 6,
    236     /** */
    237     USB_HUB_REQUEST_SET_DESCRIPTOR = 7,
    238     /** */
    239     USB_HUB_REQUEST_CLEAR_TT_BUFFER = 8,
    240     /** */
    241     USB_HUB_REQUEST_RESET_TT = 9,
    242     /** */
    243     USB_HUB_GET_TT_STATE = 10,
    244     /** */
    245     USB_HUB_STOP_TT = 11,
    246     /** USB 3+ only */
    247     USB_HUB_REQUEST_SET_HUB_DEPTH = 12,
     227        USB_HUB_REQUEST_GET_STATUS = 0,
     228        USB_HUB_REQUEST_CLEAR_FEATURE = 1,
     229        /** USB 1.0 only */
     230        USB_HUB_REQUEST_GET_STATE = 2,
     231        USB_HUB_REQUEST_SET_FEATURE = 3,
     232        USB_HUB_REQUEST_GET_DESCRIPTOR = 6,
     233        USB_HUB_REQUEST_SET_DESCRIPTOR = 7,
     234        USB_HUB_REQUEST_CLEAR_TT_BUFFER = 8,
     235        USB_HUB_REQUEST_RESET_TT = 9,
     236        USB_HUB_GET_TT_STATE = 10,
     237        USB_HUB_STOP_TT = 11,
     238        /** USB 3+ only */
     239        USB_HUB_REQUEST_SET_HUB_DEPTH = 12,
    248240} usb_hub_request_t;
    249241
  • uspace/lib/usb/include/usb/descriptor.h

    r3692678 rae3a941  
    101101        /** Number of possible configurations. */
    102102        uint8_t configuration_count;
    103 } __attribute__ ((packed)) usb_standard_device_descriptor_t;
     103} __attribute__((packed)) usb_standard_device_descriptor_t;
    104104
    105105/** USB device qualifier decriptor is basically a cut down version of the device
     
    129129        uint8_t configuration_count;
    130130        uint8_t reserved;
    131 } __attribute__ ((packed)) usb_standard_device_qualifier_descriptor_t;
     131} __attribute__((packed)) usb_standard_device_qualifier_descriptor_t;
    132132
    133133/** Standard USB configuration descriptor.
     
    156156         */
    157157        uint8_t max_power;
    158 } __attribute__ ((packed)) usb_standard_configuration_descriptor_t;
     158} __attribute__((packed)) usb_standard_configuration_descriptor_t;
    159159
    160160/** USB Other Speed Configuration descriptor shows values that would change
     
    191191        /** String descriptor describing this interface. */
    192192        uint8_t str_interface;
    193 } __attribute__ ((packed)) usb_standard_interface_descriptor_t;
     193} __attribute__((packed)) usb_standard_interface_descriptor_t;
    194194
    195195/** Standard USB endpoint descriptor.
     
    223223         */
    224224        uint8_t poll_interval;
    225 } __attribute__ ((packed)) usb_standard_endpoint_descriptor_t;
     225} __attribute__((packed)) usb_standard_endpoint_descriptor_t;
    226226
    227227/** Superspeed USB endpoint companion descriptor.
     
    254254         */
    255255        uint16_t bytes_per_interval;
    256 } __attribute__ ((packed)) usb_superspeed_endpoint_companion_descriptor_t;
     256} __attribute__((packed)) usb_superspeed_endpoint_companion_descriptor_t;
    257257
    258258/** Part of standard USB HID descriptor specifying one class descriptor.
     
    265265        /** Length of class-specific descriptor in bytes. */
    266266        uint16_t length;
    267 } __attribute__ ((packed)) usb_standard_hid_class_descriptor_info_t;
     267} __attribute__((packed)) usb_standard_hid_class_descriptor_info_t;
    268268
    269269/** Standard USB HID descriptor.
     
    296296        /** First mandatory class descriptor (Report) info. */
    297297        usb_standard_hid_class_descriptor_info_t report_desc_info;
    298 } __attribute__ ((packed)) usb_standard_hid_descriptor_t;
     298} __attribute__((packed)) usb_standard_hid_descriptor_t;
    299299
    300300#endif
  • uspace/lib/usb/include/usb/port.h

    r3692678 rae3a941  
    9090
    9191/* And these are to be called from the connected handler. */
    92 int usb_port_condvar_wait_timeout(usb_port_t *port, fibril_condvar_t *, suseconds_t);
     92int usb_port_condvar_wait_timeout(usb_port_t *port,
     93    fibril_condvar_t *, suseconds_t);
    9394
    9495/**
  • uspace/lib/usb/include/usb/usb.h

    r3692678 rae3a941  
    5454#define uint32_usb2host(n) uint32_t_le2host((n))
    5555
    56 const char * usb_str_transfer_type(usb_transfer_type_t t);
    57 const char * usb_str_transfer_type_short(usb_transfer_type_t t);
     56const char *usb_str_transfer_type(usb_transfer_type_t);
     57const char *usb_str_transfer_type_short(usb_transfer_type_t);
    5858
    5959const char *usb_str_direction(usb_direction_t);
     
    149149static inline bool usb_target_same(usb_target_t a, usb_target_t b)
    150150{
    151         return (a.address == b.address)
    152             && (a.endpoint == b.endpoint);
     151        return (a.address == b.address) && (a.endpoint == b.endpoint);
    153152}
    154153
     
    167166        USB_PID_SETUP = _MAKE_PID(3, 1),
    168167
    169         USB_PID_DATA0 = _MAKE_PID(0 ,3),
    170         USB_PID_DATA1 = _MAKE_PID(2 ,3),
     168        USB_PID_DATA0 = _MAKE_PID(0, 3),
     169        USB_PID_DATA1 = _MAKE_PID(2, 3),
    171170
    172         USB_PID_ACK = _MAKE_PID(0 ,2),
    173         USB_PID_NAK = _MAKE_PID(2 ,2),
    174         USB_PID_STALL = _MAKE_PID(3 ,2),
     171        USB_PID_ACK = _MAKE_PID(0, 2),
     172        USB_PID_NAK = _MAKE_PID(2, 2),
     173        USB_PID_STALL = _MAKE_PID(3, 2),
    175174
    176         USB_PID_PRE = _MAKE_PID(3 ,0),
     175        USB_PID_PRE = _MAKE_PID(3, 0),
    177176        /* USB_PID_ = _MAKE_PID( ,), */
    178177#undef _MAKE_PID
Note: See TracChangeset for help on using the changeset viewer.