Changeset 58563585 in mainline for uspace/drv/bus/usb/usbhub


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/bus/usb/usbhub
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • 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 * @}
Note: See TracChangeset for help on using the changeset viewer.