From 5a9f7927ee43d6561f163796242383483264eb54 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Thu, 28 May 2020 10:53:16 -0600 Subject: [PATCH] nxstyle fixes --- drivers/usbhost/usbhost_ft232r.c | 14 ++----- include/nuttx/usb/usbhost.h | 66 +++++++++++++------------------- 2 files changed, 31 insertions(+), 49 deletions(-) diff --git a/drivers/usbhost/usbhost_ft232r.c b/drivers/usbhost/usbhost_ft232r.c index d85bfb8125..bfabcf8a91 100644 --- a/drivers/usbhost/usbhost_ft232r.c +++ b/drivers/usbhost/usbhost_ft232r.c @@ -828,16 +828,10 @@ static int ft232r_setdivisor(uint32_t *divisor, uint32_t baud) } else { - int divfrac[9] = {0, - 500, - 250, - 125, - 375, - 625, - 750, - 875, - 1000 - }; + int divfrac[9] = + { + 0, 500, 250, 125, 375, 625, 750, 875, 1000 + }; double frac = (double)USBHOST_FT232R_MAX_BAUD / (double)baud; diff --git a/include/nuttx/usb/usbhost.h b/include/nuttx/usb/usbhost.h index b1f06fd488..f217b5917b 100644 --- a/include/nuttx/usb/usbhost.h +++ b/include/nuttx/usb/usbhost.h @@ -1,44 +1,30 @@ /************************************************************************************ * include/nuttx/usb/usbhost.h * - * Copyright (C) 2010-2015 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. The + * ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at * - * References: + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + * + ************************************************************************************/ + +/* References: * "Universal Serial Bus Mass Storage Class, Specification Overview," * Revision 1.2, USB Implementer's Forum, June 23, 2003. * * "Universal Serial Bus Mass Storage Class, Bulk-Only Transport," * Revision 1.0, USB Implementer's Forum, September 31, 1999. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * 3. Neither the name NuttX nor the names of its contributors may be - * used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, - * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS - * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED - * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN - * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - * - ************************************************************************************/ + */ #ifndef __INCLUDE_NUTTX_USB_USBHOST_H #define __INCLUDE_NUTTX_USB_USBHOST_H @@ -687,6 +673,7 @@ typedef FAR void *usbhost_ep_t; * represented by struct usbhost_driver_s. Connected to the HCD are one * or more hubs. At a minimum, the root hub is always present. Each hub * has from 1 to 4 ports. + */ /* Every class connects to the host controller driver (HCD) via a port on a * hub. That hub may be an external hub or the internal, root hub. The @@ -760,11 +747,12 @@ struct usbhost_class_s struct usbhost_epdesc_s { FAR struct usbhost_hubport_s *hport; /* Hub port that supports the endpoint */ - uint8_t addr; /* Endpoint address */ - bool in; /* Direction: true->IN */ - uint8_t xfrtype; /* Transfer type. See USB_EP_ATTR_XFER_* in usb.h */ - uint8_t interval; /* Polling interval */ - uint16_t mxpacketsize; /* Max packetsize */ + uint8_t addr; /* Endpoint address */ + bool in; /* Direction: true->IN */ + uint8_t xfrtype; /* Transfer type. See USB_EP_ATTR_XFER_* + * in usb.h */ + uint8_t interval; /* Polling interval */ + uint16_t mxpacketsize; /* Max packetsize */ }; /* struct usbhost_connection_s provides as interface between platform-specific @@ -938,7 +926,7 @@ extern "C" #endif /************************************************************************************ - * Public Functions + * Public Function Prototypes ************************************************************************************/ /************************************************************************************ @@ -987,7 +975,7 @@ const struct usbhost_registry_s * usbhost_findclass(FAR const struct usbhost_id_s *id); #ifdef CONFIG_USBHOST_HUB - /*********************************************************************************** +/************************************************************************************ * Name: usbhost_hub_initialize * * Description: