mirror of
https://github.com/apache/nuttx.git
synced 2026-06-06 08:36:24 +08:00
drivers/: Fixes to spacing and alignement
This commit is contained in:
+44
-43
@@ -92,7 +92,7 @@ struct cdcacm_dev_s
|
||||
FAR struct usbdev_s *usbdev; /* usbdev driver pointer */
|
||||
|
||||
uint8_t config; /* Configuration number */
|
||||
uint8_t nwrq; /* Number of queue write requests (in reqlist)*/
|
||||
uint8_t nwrq; /* Number of queue write requests (in reqlist) */
|
||||
uint8_t nrdq; /* Number of queue read requests (in epbulkout) */
|
||||
uint8_t minor; /* The device minor number */
|
||||
bool rxenabled; /* true: UART RX "interrupts" enabled */
|
||||
@@ -201,7 +201,8 @@ static int cdcuart_setup(FAR struct uart_dev_s *dev);
|
||||
static void cdcuart_shutdown(FAR struct uart_dev_s *dev);
|
||||
static int cdcuart_attach(FAR struct uart_dev_s *dev);
|
||||
static void cdcuart_detach(FAR struct uart_dev_s *dev);
|
||||
static int cdcuart_ioctl(FAR struct file *filep,int cmd,unsigned long arg);
|
||||
static int cdcuart_ioctl(FAR struct file *filep, int cmd,
|
||||
unsigned long arg);
|
||||
static void cdcuart_rxint(FAR struct uart_dev_s *dev, bool enable);
|
||||
#ifdef CONFIG_SERIAL_IFLOWCONTROL
|
||||
static bool cdcuart_rxflowcontrol(FAR struct uart_dev_s *dev,
|
||||
@@ -829,7 +830,7 @@ static void cdcacm_rdcomplete(FAR struct usbdev_ep_s *ep,
|
||||
|
||||
/* Extract references to private data */
|
||||
|
||||
priv = (FAR struct cdcacm_dev_s*)ep->priv;
|
||||
priv = (FAR struct cdcacm_dev_s *)ep->priv;
|
||||
|
||||
/* Process the received data unless this is some unusual condition */
|
||||
|
||||
@@ -898,7 +899,7 @@ static void cdcacm_wrcomplete(FAR struct usbdev_ep_s *ep,
|
||||
/* Return the write request to the free list */
|
||||
|
||||
flags = irqsave();
|
||||
sq_addlast((sq_entry_t*)reqcontainer, &priv->reqlist);
|
||||
sq_addlast((FAR sq_entry_t *)reqcontainer, &priv->reqlist);
|
||||
priv->nwrq++;
|
||||
irqrestore(flags);
|
||||
|
||||
@@ -944,7 +945,7 @@ static void cdcacm_wrcomplete(FAR struct usbdev_ep_s *ep,
|
||||
static int cdcacm_bind(FAR struct usbdevclass_driver_s *driver,
|
||||
FAR struct usbdev_s *dev)
|
||||
{
|
||||
FAR struct cdcacm_dev_s *priv = ((FAR struct cdcacm_driver_s*)driver)->dev;
|
||||
FAR struct cdcacm_dev_s *priv = ((FAR struct cdcacm_driver_s *)driver)->dev;
|
||||
FAR struct cdcacm_req_s *reqcontainer;
|
||||
irqstate_t flags;
|
||||
uint16_t reqlen;
|
||||
@@ -1079,7 +1080,7 @@ static int cdcacm_bind(FAR struct usbdevclass_driver_s *driver,
|
||||
reqcontainer->req->callback = cdcacm_wrcomplete;
|
||||
|
||||
flags = irqsave();
|
||||
sq_addlast((sq_entry_t*)reqcontainer, &priv->reqlist);
|
||||
sq_addlast((FAR sq_entry_t *)reqcontainer, &priv->reqlist);
|
||||
priv->nwrq++; /* Count of write requests available */
|
||||
irqrestore(flags);
|
||||
}
|
||||
@@ -1132,7 +1133,7 @@ static void cdcacm_unbind(FAR struct usbdevclass_driver_s *driver,
|
||||
|
||||
/* Extract reference to private data */
|
||||
|
||||
priv = ((FAR struct cdcacm_driver_s*)driver)->dev;
|
||||
priv = ((FAR struct cdcacm_driver_s *)driver)->dev;
|
||||
|
||||
#ifdef CONFIG_DEBUG
|
||||
if (!priv)
|
||||
@@ -1261,7 +1262,7 @@ static int cdcacm_setup(FAR struct usbdevclass_driver_s *driver,
|
||||
/* Extract reference to private data */
|
||||
|
||||
usbtrace(TRACE_CLASSSETUP, ctrl->req);
|
||||
priv = ((FAR struct cdcacm_driver_s*)driver)->dev;
|
||||
priv = ((FAR struct cdcacm_driver_s *)driver)->dev;
|
||||
|
||||
#ifdef CONFIG_DEBUG
|
||||
if (!priv || !priv->ctrlreq)
|
||||
@@ -1387,7 +1388,7 @@ static int cdcacm_setup(FAR struct usbdevclass_driver_s *driver,
|
||||
{
|
||||
if (ctrl->type == USB_DIR_IN)
|
||||
{
|
||||
*(uint8_t*)ctrlreq->buf = priv->config;
|
||||
*(FAR uint8_t *)ctrlreq->buf = priv->config;
|
||||
ret = 1;
|
||||
}
|
||||
}
|
||||
@@ -1412,13 +1413,13 @@ static int cdcacm_setup(FAR struct usbdevclass_driver_s *driver,
|
||||
|
||||
case USB_REQ_GETINTERFACE:
|
||||
{
|
||||
if (ctrl->type == (USB_DIR_IN|USB_REQ_RECIPIENT_INTERFACE) &&
|
||||
if (ctrl->type == (USB_DIR_IN | USB_REQ_RECIPIENT_INTERFACE) &&
|
||||
priv->config == CDCACM_CONFIGIDNONE)
|
||||
{
|
||||
if ((index == CDCACM_NOTIFID && value == CDCACM_NOTALTIFID) ||
|
||||
(index == CDCACM_DATAIFID && value == CDCACM_DATAALTIFID))
|
||||
{
|
||||
*(uint8_t*) ctrlreq->buf = value;
|
||||
*(FAR uint8_t *) ctrlreq->buf = value;
|
||||
ret = 1;
|
||||
}
|
||||
else
|
||||
@@ -1449,7 +1450,7 @@ static int cdcacm_setup(FAR struct usbdevclass_driver_s *driver,
|
||||
|
||||
case ACM_GET_LINE_CODING:
|
||||
{
|
||||
if (ctrl->type == (USB_DIR_IN|USB_REQ_TYPE_CLASS|USB_REQ_RECIPIENT_INTERFACE) &&
|
||||
if (ctrl->type == (USB_DIR_IN | USB_REQ_TYPE_CLASS | USB_REQ_RECIPIENT_INTERFACE) &&
|
||||
index == CDCACM_NOTIFID)
|
||||
{
|
||||
/* Return the current line status from the private data structure */
|
||||
@@ -1470,7 +1471,7 @@ static int cdcacm_setup(FAR struct usbdevclass_driver_s *driver,
|
||||
|
||||
case ACM_SET_LINE_CODING:
|
||||
{
|
||||
if (ctrl->type == (USB_DIR_OUT|USB_REQ_TYPE_CLASS|USB_REQ_RECIPIENT_INTERFACE) &&
|
||||
if (ctrl->type == (USB_DIR_OUT | USB_REQ_TYPE_CLASS | USB_REQ_RECIPIENT_INTERFACE) &&
|
||||
len == SIZEOF_CDC_LINECODING && /* dataout && len == outlen && */
|
||||
index == CDCACM_NOTIFID)
|
||||
{
|
||||
@@ -1511,7 +1512,7 @@ static int cdcacm_setup(FAR struct usbdevclass_driver_s *driver,
|
||||
|
||||
case ACM_SET_CTRL_LINE_STATE:
|
||||
{
|
||||
if (ctrl->type == (USB_DIR_OUT|USB_REQ_TYPE_CLASS|USB_REQ_RECIPIENT_INTERFACE) &&
|
||||
if (ctrl->type == (USB_DIR_OUT | USB_REQ_TYPE_CLASS | USB_REQ_RECIPIENT_INTERFACE) &&
|
||||
index == CDCACM_NOTIFID)
|
||||
{
|
||||
/* Save the control line state in the private data structure. Only bits
|
||||
@@ -1537,11 +1538,11 @@ static int cdcacm_setup(FAR struct usbdevclass_driver_s *driver,
|
||||
}
|
||||
break;
|
||||
|
||||
/* Sends special carrier*/
|
||||
/* Sends special carrier */
|
||||
|
||||
case ACM_SEND_BREAK:
|
||||
{
|
||||
if (ctrl->type == (USB_DIR_OUT|USB_REQ_TYPE_CLASS|USB_REQ_RECIPIENT_INTERFACE) &&
|
||||
if (ctrl->type == (USB_DIR_OUT | USB_REQ_TYPE_CLASS | USB_REQ_RECIPIENT_INTERFACE) &&
|
||||
index == CDCACM_NOTIFID)
|
||||
{
|
||||
/* If there is a registered callback to handle the SendBreak request,
|
||||
@@ -1633,7 +1634,7 @@ static void cdcacm_disconnect(FAR struct usbdevclass_driver_s *driver,
|
||||
|
||||
/* Extract reference to private data */
|
||||
|
||||
priv = ((FAR struct cdcacm_driver_s*)driver)->dev;
|
||||
priv = ((FAR struct cdcacm_driver_s *)driver)->dev;
|
||||
|
||||
#ifdef CONFIG_DEBUG
|
||||
if (!priv)
|
||||
@@ -1698,7 +1699,7 @@ static void cdcacm_suspend(FAR struct usbdevclass_driver_s *driver,
|
||||
|
||||
/* Extract reference to private data */
|
||||
|
||||
priv = ((FAR struct cdcacm_driver_s*)driver)->dev;
|
||||
priv = ((FAR struct cdcacm_driver_s *)driver)->dev;
|
||||
|
||||
/* And let the "upper half" driver now that we are suspended */
|
||||
|
||||
@@ -1732,7 +1733,7 @@ static void cdcacm_resume(FAR struct usbdevclass_driver_s *driver,
|
||||
|
||||
/* Extract reference to private data */
|
||||
|
||||
priv = ((FAR struct cdcacm_driver_s*)driver)->dev;
|
||||
priv = ((FAR struct cdcacm_driver_s *)driver)->dev;
|
||||
|
||||
/* Are we still configured? */
|
||||
|
||||
@@ -1775,7 +1776,7 @@ static int cdcuart_setup(FAR struct uart_dev_s *dev)
|
||||
|
||||
/* Extract reference to private data */
|
||||
|
||||
priv = (FAR struct cdcacm_dev_s*)dev->priv;
|
||||
priv = (FAR struct cdcacm_dev_s *)dev->priv;
|
||||
|
||||
/* Check if we have been configured */
|
||||
|
||||
@@ -1832,8 +1833,8 @@ static int cdcuart_attach(FAR struct uart_dev_s *dev)
|
||||
* Name: cdcuart_detach
|
||||
*
|
||||
* Description:
|
||||
* Does not apply to the USB serial class device
|
||||
*
|
||||
* Does not apply to the USB serial class device
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
static void cdcuart_detach(FAR struct uart_dev_s *dev)
|
||||
@@ -1849,7 +1850,7 @@ static void cdcuart_detach(FAR struct uart_dev_s *dev)
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
static int cdcuart_ioctl(FAR struct file *filep,int cmd,unsigned long arg)
|
||||
static int cdcuart_ioctl(FAR struct file *filep, int cmd, unsigned long arg)
|
||||
{
|
||||
struct inode *inode = filep->f_inode;
|
||||
struct cdcacm_dev_s *priv = inode->i_private;
|
||||
@@ -1933,7 +1934,7 @@ static int cdcuart_ioctl(FAR struct file *filep,int cmd,unsigned long arg)
|
||||
* 1. Format and send a request header with:
|
||||
*
|
||||
* bmRequestType:
|
||||
* USB_REQ_DIR_IN|USB_REQ_TYPE_CLASS|USB_REQ_RECIPIENT_INTERFACE
|
||||
* USB_REQ_DIR_IN | USB_REQ_TYPE_CLASS | USB_REQ_RECIPIENT_INTERFACE
|
||||
* bRequest: ACM_SERIAL_STATE
|
||||
* wValue: 0
|
||||
* wIndex: 0
|
||||
@@ -1949,7 +1950,7 @@ static int cdcuart_ioctl(FAR struct file *filep,int cmd,unsigned long arg)
|
||||
#ifdef CONFIG_SERIAL_TERMIOS
|
||||
case TCGETS:
|
||||
{
|
||||
struct termios *termiosp = (struct termios*)arg;
|
||||
struct termios *termiosp = (FAR struct termios *)arg;
|
||||
|
||||
if (!termiosp)
|
||||
{
|
||||
@@ -1967,7 +1968,7 @@ static int cdcuart_ioctl(FAR struct file *filep,int cmd,unsigned long arg)
|
||||
|
||||
case TCSETS:
|
||||
{
|
||||
struct termios *termiosp = (struct termios*)arg;
|
||||
struct termios *termiosp = (FAR struct termios *)arg;
|
||||
|
||||
if (!termiosp)
|
||||
{
|
||||
@@ -2075,7 +2076,7 @@ static void cdcuart_rxint(FAR struct uart_dev_s *dev, bool enable)
|
||||
|
||||
/* Extract reference to private data */
|
||||
|
||||
priv = (FAR struct cdcacm_dev_s*)dev->priv;
|
||||
priv = (FAR struct cdcacm_dev_s *)dev->priv;
|
||||
serdev = &priv->serdev;
|
||||
|
||||
/* We need exclusive access to the RX buffer and private structure
|
||||
@@ -2085,19 +2086,19 @@ static void cdcuart_rxint(FAR struct uart_dev_s *dev, bool enable)
|
||||
flags = irqsave();
|
||||
if (enable)
|
||||
{
|
||||
/* RX "interrupts" are enabled. Is this a transition from disabled
|
||||
* to enabled state?
|
||||
*/
|
||||
/* RX "interrupts" are enabled. Is this a transition from disabled
|
||||
* to enabled state?
|
||||
*/
|
||||
|
||||
if (!priv->rxenabled)
|
||||
{
|
||||
/* Yes. During the time that RX interrupts are disabled, the
|
||||
* the serial driver will be extracting data from the circular
|
||||
* buffer and modifying recv.tail. During this time, we
|
||||
* should avoid modifying recv.head; When interrupts are restored,
|
||||
* we can update the head pointer for all of the data that we
|
||||
* put into circular buffer while "interrupts" were disabled.
|
||||
*/
|
||||
if (!priv->rxenabled)
|
||||
{
|
||||
/* Yes. During the time that RX interrupts are disabled, the
|
||||
* the serial driver will be extracting data from the circular
|
||||
* buffer and modifying recv.tail. During this time, we
|
||||
* should avoid modifying recv.head; When interrupts are restored,
|
||||
* we can update the head pointer for all of the data that we
|
||||
* put into circular buffer while "interrupts" were disabled.
|
||||
*/
|
||||
|
||||
if (priv->rxhead != serdev->recv.head)
|
||||
{
|
||||
@@ -2204,7 +2205,7 @@ static void cdcuart_txint(FAR struct uart_dev_s *dev, bool enable)
|
||||
|
||||
/* Extract references to private data */
|
||||
|
||||
priv = (FAR struct cdcacm_dev_s*)dev->priv;
|
||||
priv = (FAR struct cdcacm_dev_s *)dev->priv;
|
||||
|
||||
/* If the new state is enabled and if there is data in the XMIT buffer,
|
||||
* send the next packet now.
|
||||
@@ -2233,7 +2234,7 @@ static void cdcuart_txint(FAR struct uart_dev_s *dev, bool enable)
|
||||
|
||||
static bool cdcuart_txempty(FAR struct uart_dev_s *dev)
|
||||
{
|
||||
FAR struct cdcacm_dev_s *priv = (FAR struct cdcacm_dev_s*)dev->priv;
|
||||
FAR struct cdcacm_dev_s *priv = (FAR struct cdcacm_dev_s *)dev->priv;
|
||||
|
||||
usbtrace(CDCACM_CLASSAPI_TXEMPTY, 0);
|
||||
|
||||
@@ -2287,7 +2288,7 @@ int cdcacm_classobject(int minor, FAR struct usbdevclass_driver_s **classdev)
|
||||
|
||||
/* Allocate the structures needed */
|
||||
|
||||
alloc = (FAR struct cdcacm_alloc_s*)kmm_malloc(sizeof(struct cdcacm_alloc_s));
|
||||
alloc = (FAR struct cdcacm_alloc_s *)kmm_malloc(sizeof(struct cdcacm_alloc_s));
|
||||
if (!alloc)
|
||||
{
|
||||
usbtrace(TRACE_CLSERROR(USBSER_TRACEERR_ALLOCDEVSTRUCT), 0);
|
||||
@@ -2414,7 +2415,7 @@ int cdcacm_initialize(int minor, FAR void **handle)
|
||||
|
||||
if (handle)
|
||||
{
|
||||
*handle = (FAR void*)drvr;
|
||||
*handle = (FAR void *)drvr;
|
||||
}
|
||||
|
||||
return ret;
|
||||
|
||||
@@ -602,7 +602,7 @@ int16_t cdcacm_mkcfgdesc(FAR uint8_t *buf)
|
||||
{
|
||||
cdcacm_cpepdesc((FAR const struct usb_epdesc_s *)group->desc,
|
||||
group->hsepsize,
|
||||
(FAR struct usb_epdesc_s*)dest);
|
||||
(FAR struct usb_epdesc_s *)dest);
|
||||
}
|
||||
else
|
||||
#endif
|
||||
|
||||
@@ -267,7 +267,7 @@ static void composite_freereq(FAR struct usbdev_ep_s *ep,
|
||||
static int composite_bind(FAR struct usbdevclass_driver_s *driver,
|
||||
FAR struct usbdev_s *dev)
|
||||
{
|
||||
FAR struct composite_dev_s *priv = ((FAR struct composite_driver_s*)driver)->dev;
|
||||
FAR struct composite_dev_s *priv = ((FAR struct composite_driver_s *)driver)->dev;
|
||||
int ret;
|
||||
|
||||
usbtrace(TRACE_CLASSBIND, 0);
|
||||
@@ -352,7 +352,7 @@ static void composite_unbind(FAR struct usbdevclass_driver_s *driver,
|
||||
|
||||
/* Extract reference to private data */
|
||||
|
||||
priv = ((FAR struct composite_driver_s*)driver)->dev;
|
||||
priv = ((FAR struct composite_driver_s *)driver)->dev;
|
||||
|
||||
#ifdef CONFIG_DEBUG
|
||||
if (!priv)
|
||||
@@ -417,7 +417,7 @@ static int composite_setup(FAR struct usbdevclass_driver_s *driver,
|
||||
/* Extract a reference to private data */
|
||||
|
||||
usbtrace(TRACE_CLASSSETUP, ctrl->req);
|
||||
priv = ((FAR struct composite_driver_s*)driver)->dev;
|
||||
priv = ((FAR struct composite_driver_s *)driver)->dev;
|
||||
|
||||
#ifdef CONFIG_DEBUG
|
||||
if (!priv)
|
||||
@@ -562,7 +562,7 @@ static int composite_setup(FAR struct usbdevclass_driver_s *driver,
|
||||
|
||||
case USB_REQ_GETINTERFACE:
|
||||
{
|
||||
if (ctrl->type == (USB_DIR_IN|USB_REQ_RECIPIENT_INTERFACE) &&
|
||||
if (ctrl->type == (USB_DIR_IN | USB_REQ_RECIPIENT_INTERFACE) &&
|
||||
priv->config == COMPOSITE_CONFIGIDNONE)
|
||||
{
|
||||
ret = composite_classsetup(priv, dev, ctrl, dataout, outlen);
|
||||
@@ -651,7 +651,7 @@ static void composite_disconnect(FAR struct usbdevclass_driver_s *driver,
|
||||
|
||||
/* Extract reference to private data */
|
||||
|
||||
priv = ((FAR struct composite_driver_s*)driver)->dev;
|
||||
priv = ((FAR struct composite_driver_s *)driver)->dev;
|
||||
|
||||
#ifdef CONFIG_DEBUG
|
||||
if (!priv)
|
||||
@@ -704,7 +704,7 @@ static void composite_suspend(FAR struct usbdevclass_driver_s *driver,
|
||||
|
||||
/* Extract reference to private data */
|
||||
|
||||
priv = ((FAR struct composite_driver_s*)driver)->dev;
|
||||
priv = ((FAR struct composite_driver_s *)driver)->dev;
|
||||
|
||||
#ifdef CONFIG_DEBUG
|
||||
if (!priv)
|
||||
@@ -746,7 +746,7 @@ static void composite_resume(FAR struct usbdevclass_driver_s *driver,
|
||||
|
||||
/* Extract reference to private data */
|
||||
|
||||
priv = ((FAR struct composite_driver_s*)driver)->dev;
|
||||
priv = ((FAR struct composite_driver_s *)driver)->dev;
|
||||
|
||||
#ifdef CONFIG_DEBUG
|
||||
if (!priv)
|
||||
@@ -798,7 +798,7 @@ FAR void *composite_initialize(void)
|
||||
|
||||
/* Allocate the structures needed */
|
||||
|
||||
alloc = (FAR struct composite_alloc_s*)kmm_malloc(sizeof(struct composite_alloc_s));
|
||||
alloc = (FAR struct composite_alloc_s *)kmm_malloc(sizeof(struct composite_alloc_s));
|
||||
if (!alloc)
|
||||
{
|
||||
usbtrace(TRACE_CLSERROR(USBCOMPOSITE_TRACEERR_ALLOCDEVSTRUCT), 0);
|
||||
|
||||
+37
-37
@@ -256,7 +256,7 @@ struct pl2303_dev_s
|
||||
FAR struct usbdev_s *usbdev; /* usbdev driver pointer */
|
||||
|
||||
uint8_t config; /* Configuration number */
|
||||
uint8_t nwrq; /* Number of queue write requests (in reqlist)*/
|
||||
uint8_t nwrq; /* Number of queue write requests (in reqlist) */
|
||||
uint8_t nrdq; /* Number of queue read requests (in epbulkout) */
|
||||
bool rxenabled; /* true: UART RX "interrupts" enabled */
|
||||
uint8_t linest[7]; /* Fake line status */
|
||||
@@ -926,7 +926,7 @@ static int16_t usbclass_mkcfgdesc(uint8_t *buf, uint8_t speed, uint8_t type)
|
||||
static int16_t usbclass_mkcfgdesc(uint8_t *buf)
|
||||
#endif
|
||||
{
|
||||
FAR struct usb_cfgdesc_s *cfgdesc = (struct usb_cfgdesc_s*)buf;
|
||||
FAR struct usb_cfgdesc_s *cfgdesc = (FAR struct usb_cfgdesc_s *)buf;
|
||||
#ifdef CONFIG_USBDEV_DUALSPEED
|
||||
bool hispeed = (speed == USB_SPEED_HIGH);
|
||||
uint16_t bulkmxpacket;
|
||||
@@ -975,9 +975,9 @@ static int16_t usbclass_mkcfgdesc(uint8_t *buf)
|
||||
bulkmxpacket = 64;
|
||||
}
|
||||
|
||||
usbclass_mkepbulkdesc(&g_epbulkoutdesc, bulkmxpacket, (struct usb_epdesc_s*)buf);
|
||||
usbclass_mkepbulkdesc(&g_epbulkoutdesc, bulkmxpacket, (FAR struct usb_epdesc_s *)buf);
|
||||
buf += USB_SIZEOF_EPDESC;
|
||||
usbclass_mkepbulkdesc(&g_epbulkindesc, bulkmxpacket, (struct usb_epdesc_s*)buf);
|
||||
usbclass_mkepbulkdesc(&g_epbulkindesc, bulkmxpacket, (FAR struct usb_epdesc_s *)buf);
|
||||
#else
|
||||
memcpy(buf, &g_epbulkoutdesc, USB_SIZEOF_EPDESC);
|
||||
buf += USB_SIZEOF_EPDESC;
|
||||
@@ -1212,7 +1212,7 @@ static void usbclass_rdcomplete(FAR struct usbdev_ep_s *ep,
|
||||
|
||||
/* Extract references to private data */
|
||||
|
||||
priv = (FAR struct pl2303_dev_s*)ep->priv;
|
||||
priv = (FAR struct pl2303_dev_s *)ep->priv;
|
||||
|
||||
/* Process the received data unless this is some unusual condition */
|
||||
|
||||
@@ -1280,7 +1280,7 @@ static void usbclass_wrcomplete(FAR struct usbdev_ep_s *ep,
|
||||
/* Return the write request to the free list */
|
||||
|
||||
flags = irqsave();
|
||||
sq_addlast((sq_entry_t*)reqcontainer, &priv->reqlist);
|
||||
sq_addlast((FAR sq_entry_t *)reqcontainer, &priv->reqlist);
|
||||
priv->nwrq++;
|
||||
irqrestore(flags);
|
||||
|
||||
@@ -1320,7 +1320,7 @@ static void usbclass_wrcomplete(FAR struct usbdev_ep_s *ep,
|
||||
static int usbclass_bind(FAR struct usbdevclass_driver_s *driver,
|
||||
FAR struct usbdev_s *dev)
|
||||
{
|
||||
FAR struct pl2303_dev_s *priv = ((FAR struct pl2303_driver_s*)driver)->dev;
|
||||
FAR struct pl2303_dev_s *priv = ((FAR struct pl2303_driver_s *)driver)->dev;
|
||||
FAR struct pl2303_req_s *reqcontainer;
|
||||
irqstate_t flags;
|
||||
uint16_t reqlen;
|
||||
@@ -1449,7 +1449,7 @@ static int usbclass_bind(FAR struct usbdevclass_driver_s *driver,
|
||||
reqcontainer->req->callback = usbclass_wrcomplete;
|
||||
|
||||
flags = irqsave();
|
||||
sq_addlast((sq_entry_t*)reqcontainer, &priv->reqlist);
|
||||
sq_addlast((FAR sq_entry_t *)reqcontainer, &priv->reqlist);
|
||||
priv->nwrq++; /* Count of write requests available */
|
||||
irqrestore(flags);
|
||||
}
|
||||
@@ -1498,7 +1498,7 @@ static void usbclass_unbind(FAR struct usbdevclass_driver_s *driver,
|
||||
|
||||
/* Extract reference to private data */
|
||||
|
||||
priv = ((FAR struct pl2303_driver_s*)driver)->dev;
|
||||
priv = ((FAR struct pl2303_driver_s *)driver)->dev;
|
||||
|
||||
#ifdef CONFIG_DEBUG
|
||||
if (!priv)
|
||||
@@ -1626,7 +1626,7 @@ static int usbclass_setup(FAR struct usbdevclass_driver_s *driver,
|
||||
/* Extract reference to private data */
|
||||
|
||||
usbtrace(TRACE_CLASSSETUP, ctrl->req);
|
||||
priv = ((FAR struct pl2303_driver_s*)driver)->dev;
|
||||
priv = ((FAR struct pl2303_driver_s *)driver)->dev;
|
||||
|
||||
#ifdef CONFIG_DEBUG
|
||||
if (!priv || !priv->ctrlreq)
|
||||
@@ -1722,7 +1722,7 @@ static int usbclass_setup(FAR struct usbdevclass_driver_s *driver,
|
||||
{
|
||||
if (ctrl->type == USB_DIR_IN)
|
||||
{
|
||||
*(uint8_t*)ctrlreq->buf = priv->config;
|
||||
*(FAR uint8_t *)ctrlreq->buf = priv->config;
|
||||
ret = 1;
|
||||
}
|
||||
}
|
||||
@@ -1746,7 +1746,7 @@ static int usbclass_setup(FAR struct usbdevclass_driver_s *driver,
|
||||
|
||||
case USB_REQ_GETINTERFACE:
|
||||
{
|
||||
if (ctrl->type == (USB_DIR_IN|USB_REQ_RECIPIENT_INTERFACE) &&
|
||||
if (ctrl->type == (USB_DIR_IN | USB_REQ_RECIPIENT_INTERFACE) &&
|
||||
priv->config == PL2303_CONFIGIDNONE)
|
||||
{
|
||||
if (index != PL2303_INTERFACEID)
|
||||
@@ -1755,7 +1755,7 @@ static int usbclass_setup(FAR struct usbdevclass_driver_s *driver,
|
||||
}
|
||||
else
|
||||
{
|
||||
*(uint8_t*) ctrlreq->buf = PL2303_ALTINTERFACEID;
|
||||
*(FAR uint8_t *) ctrlreq->buf = PL2303_ALTINTERFACEID;
|
||||
ret = 1;
|
||||
}
|
||||
}
|
||||
@@ -1817,7 +1817,7 @@ static int usbclass_setup(FAR struct usbdevclass_driver_s *driver,
|
||||
{
|
||||
if ((ctrl->type & USB_DIR_IN) != 0)
|
||||
{
|
||||
*(uint32_t*)ctrlreq->buf = 0xdeadbeef;
|
||||
*(FAR uint32_t *)ctrlreq->buf = 0xdeadbeef;
|
||||
ret = 4;
|
||||
}
|
||||
else
|
||||
@@ -1886,7 +1886,7 @@ static void usbclass_disconnect(FAR struct usbdevclass_driver_s *driver,
|
||||
|
||||
/* Extract reference to private data */
|
||||
|
||||
priv = ((FAR struct pl2303_driver_s*)driver)->dev;
|
||||
priv = ((FAR struct pl2303_driver_s *)driver)->dev;
|
||||
|
||||
#ifdef CONFIG_DEBUG
|
||||
if (!priv)
|
||||
@@ -1949,7 +1949,7 @@ static void usbclass_suspend(FAR struct usbdevclass_driver_s *driver,
|
||||
|
||||
/* Extract reference to private data */
|
||||
|
||||
priv = ((FAR struct pl2303_driver_s*)driver)->dev;
|
||||
priv = ((FAR struct pl2303_driver_s *)driver)->dev;
|
||||
|
||||
/* And let the "upper half" driver now that we are suspended */
|
||||
|
||||
@@ -1983,7 +1983,7 @@ static void usbclass_resume(FAR struct usbdevclass_driver_s *driver,
|
||||
|
||||
/* Extract reference to private data */
|
||||
|
||||
priv = ((FAR struct pl2303_driver_s*)driver)->dev;
|
||||
priv = ((FAR struct pl2303_driver_s *)driver)->dev;
|
||||
|
||||
/* Are we still configured? */
|
||||
|
||||
@@ -2026,7 +2026,7 @@ static int usbser_setup(FAR struct uart_dev_s *dev)
|
||||
|
||||
/* Extract reference to private data */
|
||||
|
||||
priv = (FAR struct pl2303_dev_s*)dev->priv;
|
||||
priv = (FAR struct pl2303_dev_s *)dev->priv;
|
||||
|
||||
/* Check if we have been configured */
|
||||
|
||||
@@ -2083,8 +2083,8 @@ static int usbser_attach(FAR struct uart_dev_s *dev)
|
||||
* Name: usbser_detach
|
||||
*
|
||||
* Description:
|
||||
* Does not apply to the USB serial class device
|
||||
*
|
||||
* Does not apply to the USB serial class device
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
static void usbser_detach(FAR struct uart_dev_s *dev)
|
||||
@@ -2129,7 +2129,7 @@ static void usbser_rxint(FAR struct uart_dev_s *dev, bool enable)
|
||||
|
||||
/* Extract reference to private data */
|
||||
|
||||
priv = (FAR struct pl2303_dev_s*)dev->priv;
|
||||
priv = (FAR struct pl2303_dev_s *)dev->priv;
|
||||
serdev = &priv->serdev;
|
||||
|
||||
/* We need exclusive access to the RX buffer and private structure
|
||||
@@ -2139,19 +2139,19 @@ static void usbser_rxint(FAR struct uart_dev_s *dev, bool enable)
|
||||
flags = irqsave();
|
||||
if (enable)
|
||||
{
|
||||
/* RX "interrupts" are enabled. Is this a transition from disabled
|
||||
* to enabled state?
|
||||
*/
|
||||
/* RX "interrupts" are enabled. Is this a transition from disabled
|
||||
* to enabled state?
|
||||
*/
|
||||
|
||||
if (!priv->rxenabled)
|
||||
{
|
||||
/* Yes. During the time that RX interrupts are disabled, the
|
||||
* the serial driver will be extracting data from the circular
|
||||
* buffer and modifying recv.tail. During this time, we
|
||||
* should avoid modifying recv.head; When interrupts are restored,
|
||||
* we can update the head pointer for all of the data that we
|
||||
* put into cicular buffer while "interrupts" were disabled.
|
||||
*/
|
||||
if (!priv->rxenabled)
|
||||
{
|
||||
/* Yes. During the time that RX interrupts are disabled, the
|
||||
* the serial driver will be extracting data from the circular
|
||||
* buffer and modifying recv.tail. During this time, we
|
||||
* should avoid modifying recv.head; When interrupts are restored,
|
||||
* we can update the head pointer for all of the data that we
|
||||
* put into cicular buffer while "interrupts" were disabled.
|
||||
*/
|
||||
|
||||
if (priv->rxhead != serdev->recv.head)
|
||||
{
|
||||
@@ -2220,7 +2220,7 @@ static void usbser_txint(FAR struct uart_dev_s *dev, bool enable)
|
||||
|
||||
/* Extract references to private data */
|
||||
|
||||
priv = (FAR struct pl2303_dev_s*)dev->priv;
|
||||
priv = (FAR struct pl2303_dev_s *)dev->priv;
|
||||
|
||||
/* If the new state is enabled and if there is data in the XMIT buffer,
|
||||
* send the next packet now.
|
||||
@@ -2249,7 +2249,7 @@ static void usbser_txint(FAR struct uart_dev_s *dev, bool enable)
|
||||
|
||||
static bool usbser_txempty(FAR struct uart_dev_s *dev)
|
||||
{
|
||||
FAR struct pl2303_dev_s *priv = (FAR struct pl2303_dev_s*)dev->priv;
|
||||
FAR struct pl2303_dev_s *priv = (FAR struct pl2303_dev_s *)dev->priv;
|
||||
|
||||
usbtrace(PL2303_CLASSAPI_TXEMPTY, 0);
|
||||
|
||||
@@ -2290,7 +2290,7 @@ int usbdev_serialinitialize(int minor)
|
||||
|
||||
/* Allocate the structures needed */
|
||||
|
||||
alloc = (FAR struct pl2303_alloc_s*)kmm_malloc(sizeof(struct pl2303_alloc_s));
|
||||
alloc = (FAR struct pl2303_alloc_s *)kmm_malloc(sizeof(struct pl2303_alloc_s));
|
||||
if (!alloc)
|
||||
{
|
||||
usbtrace(TRACE_CLSERROR(USBSER_TRACEERR_ALLOCDEVSTRUCT), 0);
|
||||
@@ -2315,7 +2315,7 @@ int usbdev_serialinitialize(int minor)
|
||||
priv->linest[3] = (115200 >> 24) & 0xff;
|
||||
priv->linest[4] = 0; /* One stop bit */
|
||||
priv->linest[5] = 0; /* No parity */
|
||||
priv->linest[6] = 8; /*8 data bits */
|
||||
priv->linest[6] = 8; /* 8 data bits */
|
||||
|
||||
/* Initialize the serial driver sub-structure */
|
||||
|
||||
|
||||
+16
-15
@@ -255,7 +255,7 @@ static void usbmsc_freereq(FAR struct usbdev_ep_s *ep, struct usbdev_req_s *req)
|
||||
static int usbmsc_bind(FAR struct usbdevclass_driver_s *driver,
|
||||
FAR struct usbdev_s *dev)
|
||||
{
|
||||
FAR struct usbmsc_dev_s *priv = ((FAR struct usbmsc_driver_s*)driver)->dev;
|
||||
FAR struct usbmsc_dev_s *priv = ((FAR struct usbmsc_driver_s *)driver)->dev;
|
||||
FAR struct usbmsc_req_s *reqcontainer;
|
||||
irqstate_t flags;
|
||||
int ret = OK;
|
||||
@@ -361,7 +361,7 @@ static int usbmsc_bind(FAR struct usbdevclass_driver_s *driver,
|
||||
reqcontainer->req->callback = usbmsc_wrcomplete;
|
||||
|
||||
flags = irqsave();
|
||||
sq_addlast((sq_entry_t*)reqcontainer, &priv->wrreqlist);
|
||||
sq_addlast((FAR sq_entry_t *)reqcontainer, &priv->wrreqlist);
|
||||
irqrestore(flags);
|
||||
}
|
||||
|
||||
@@ -413,7 +413,7 @@ static void usbmsc_unbind(FAR struct usbdevclass_driver_s *driver,
|
||||
|
||||
/* Extract reference to private data */
|
||||
|
||||
priv = ((FAR struct usbmsc_driver_s*)driver)->dev;
|
||||
priv = ((FAR struct usbmsc_driver_s *)driver)->dev;
|
||||
|
||||
#ifdef CONFIG_DEBUG
|
||||
if (!priv)
|
||||
@@ -699,7 +699,7 @@ static int usbmsc_setup(FAR struct usbdevclass_driver_s *driver,
|
||||
|
||||
case USB_REQ_GETINTERFACE:
|
||||
{
|
||||
if (ctrl->type == (USB_DIR_IN|USB_REQ_RECIPIENT_INTERFACE) &&
|
||||
if (ctrl->type == (USB_DIR_IN | USB_REQ_RECIPIENT_INTERFACE) &&
|
||||
priv->config == USBMSC_CONFIGIDNONE)
|
||||
{
|
||||
if (index != USBMSC_INTERFACEID)
|
||||
@@ -1083,13 +1083,13 @@ void usbmsc_wrcomplete(FAR struct usbdev_ep_s *ep, FAR struct usbdev_req_s *req)
|
||||
|
||||
/* Extract references to private data */
|
||||
|
||||
priv = (FAR struct usbmsc_dev_s*)ep->priv;
|
||||
priv = (FAR struct usbmsc_dev_s *)ep->priv;
|
||||
privreq = (FAR struct usbmsc_req_s *)req->priv;
|
||||
|
||||
/* Return the write request to the free list */
|
||||
|
||||
flags = irqsave();
|
||||
sq_addlast((sq_entry_t*)privreq, &priv->wrreqlist);
|
||||
sq_addlast((FAR sq_entry_t *)privreq, &priv->wrreqlist);
|
||||
irqrestore(flags);
|
||||
|
||||
/* Process the received data unless this is some unusual condition */
|
||||
@@ -1144,7 +1144,7 @@ void usbmsc_rdcomplete(FAR struct usbdev_ep_s *ep, FAR struct usbdev_req_s *req)
|
||||
|
||||
/* Extract references to private data */
|
||||
|
||||
priv = (FAR struct usbmsc_dev_s*)ep->priv;
|
||||
priv = (FAR struct usbmsc_dev_s *)ep->priv;
|
||||
privreq = (FAR struct usbmsc_req_s *)req->priv;
|
||||
|
||||
/* Process the received data unless this is some unusual condition */
|
||||
@@ -1158,7 +1158,7 @@ void usbmsc_rdcomplete(FAR struct usbdev_ep_s *ep, FAR struct usbdev_req_s *req)
|
||||
/* Add the filled read request from the rdreqlist */
|
||||
|
||||
flags = irqsave();
|
||||
sq_addlast((sq_entry_t*)privreq, &priv->rdreqlist);
|
||||
sq_addlast((FAR sq_entry_t *)privreq, &priv->rdreqlist);
|
||||
irqrestore(flags);
|
||||
|
||||
/* Signal the worker thread that there is received data to be processed */
|
||||
@@ -1326,7 +1326,7 @@ int usbmsc_configure(unsigned int nluns, void **handle)
|
||||
|
||||
/* Allocate the structures needed */
|
||||
|
||||
alloc = (FAR struct usbmsc_alloc_s*)kmm_malloc(sizeof(struct usbmsc_alloc_s));
|
||||
alloc = (FAR struct usbmsc_alloc_s *)kmm_malloc(sizeof(struct usbmsc_alloc_s));
|
||||
if (!alloc)
|
||||
{
|
||||
usbtrace(TRACE_CLSERROR(USBMSC_TRACEERR_ALLOCDEVSTRUCT), 0);
|
||||
@@ -1347,7 +1347,9 @@ int usbmsc_configure(unsigned int nluns, void **handle)
|
||||
|
||||
/* Allocate the LUN table */
|
||||
|
||||
priv->luntab = (struct usbmsc_lun_s*)kmm_malloc(priv->nluns*sizeof(struct usbmsc_lun_s));
|
||||
priv->luntab = (FAR struct usbmsc_lun_s *)
|
||||
kmm_malloc(priv->nluns*sizeof(struct usbmsc_lun_s));
|
||||
|
||||
if (!priv->luntab)
|
||||
{
|
||||
ret = -ENOMEM;
|
||||
@@ -1369,7 +1371,7 @@ int usbmsc_configure(unsigned int nluns, void **handle)
|
||||
|
||||
/* Return the handle and success */
|
||||
|
||||
*handle = (FAR void*)alloc;
|
||||
*handle = (FAR void *)alloc;
|
||||
return OK;
|
||||
|
||||
errout:
|
||||
@@ -1489,7 +1491,7 @@ int usbmsc_bindlun(FAR void *handle, FAR const char *drvrpath,
|
||||
|
||||
if (!priv->iobuffer)
|
||||
{
|
||||
priv->iobuffer = (uint8_t*)kmm_malloc(geo.geo_sectorsize);
|
||||
priv->iobuffer = (FAR uint8_t *)kmm_malloc(geo.geo_sectorsize);
|
||||
if (!priv->iobuffer)
|
||||
{
|
||||
usbtrace(TRACE_CLSERROR(USBMSC_TRACEERR_ALLOCIOBUFFER), geo.geo_sectorsize);
|
||||
@@ -1501,14 +1503,14 @@ int usbmsc_bindlun(FAR void *handle, FAR const char *drvrpath,
|
||||
else if (priv->iosize < geo.geo_sectorsize)
|
||||
{
|
||||
void *tmp;
|
||||
tmp = (uint8_t*)kmm_realloc(priv->iobuffer, geo.geo_sectorsize);
|
||||
tmp = (FAR uint8_t *)kmm_realloc(priv->iobuffer, geo.geo_sectorsize);
|
||||
if (!tmp)
|
||||
{
|
||||
usbtrace(TRACE_CLSERROR(USBMSC_TRACEERR_REALLOCIOBUFFER), geo.geo_sectorsize);
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
priv->iobuffer = (uint8_t*)tmp;
|
||||
priv->iobuffer = (FAR uint8_t *)tmp;
|
||||
priv->iosize = geo.geo_sectorsize;
|
||||
}
|
||||
|
||||
@@ -1701,7 +1703,6 @@ errout_with_lock:
|
||||
*
|
||||
* Returned Value:
|
||||
* 0 on success; a negated errno on failure
|
||||
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
|
||||
@@ -482,7 +482,7 @@ static inline int usbmsc_cmdrequestsense(FAR struct usbmsc_dev_s *priv,
|
||||
|
||||
memset(response, 0, SCSIRESP_FIXEDSENSEDATA_SIZEOF);
|
||||
|
||||
response->code = SCSIRESP_SENSEDATA_RESPVALID|SCSIRESP_SENSEDATA_CURRENTFIXED;
|
||||
response->code = SCSIRESP_SENSEDATA_RESPVALID | SCSIRESP_SENSEDATA_CURRENTFIXED;
|
||||
response->flags = (uint8_t)(sd >> 16);
|
||||
usbmsc_putbe32(response->info, sdinfo);
|
||||
response->len = SCSIRESP_FIXEDSENSEDATA_SIZEOF - 7;
|
||||
@@ -506,7 +506,7 @@ static inline int usbmsc_cmdrequestsense(FAR struct usbmsc_dev_s *priv,
|
||||
|
||||
static inline int usbmsc_cmdread6(FAR struct usbmsc_dev_s *priv)
|
||||
{
|
||||
FAR struct scsicmd_read6_s *read6 = (FAR struct scsicmd_read6_s*)priv->cdb;
|
||||
FAR struct scsicmd_read6_s *read6 = (FAR struct scsicmd_read6_s *)priv->cdb;
|
||||
FAR struct usbmsc_lun_s *lun = priv->lun;
|
||||
int ret;
|
||||
|
||||
@@ -647,7 +647,7 @@ static inline int usbmsc_cmdinquiry(FAR struct usbmsc_dev_s *priv,
|
||||
{
|
||||
if (!priv->lun)
|
||||
{
|
||||
response->qualtype = SCSIRESP_INQUIRYPQ_NOTCAPABLE|SCSIRESP_INQUIRYPD_UNKNOWN;
|
||||
response->qualtype = SCSIRESP_INQUIRYPQ_NOTCAPABLE | SCSIRESP_INQUIRYPD_UNKNOWN;
|
||||
}
|
||||
else if ((inquiry->flags != 0) || (inquiry->pagecode != 0))
|
||||
{
|
||||
@@ -994,7 +994,7 @@ static int inline usbmsc_cmdreadcapacity10(FAR struct usbmsc_dev_s *priv,
|
||||
|
||||
static inline int usbmsc_cmdread10(FAR struct usbmsc_dev_s *priv)
|
||||
{
|
||||
struct scsicmd_read10_s *read10 = (struct scsicmd_read10_s*)priv->cdb;
|
||||
struct scsicmd_read10_s *read10 = (struct scsicmd_read10_s *)priv->cdb;
|
||||
FAR struct usbmsc_lun_s *lun = priv->lun;
|
||||
int ret;
|
||||
|
||||
@@ -1009,7 +1009,7 @@ static inline int usbmsc_cmdread10(FAR struct usbmsc_dev_s *priv)
|
||||
|
||||
/* Verify that we can support this read command */
|
||||
|
||||
if ((read10->flags & ~(SCSICMD_READ10FLAGS_DPO|SCSICMD_READ10FLAGS_FUA)) != 0)
|
||||
if ((read10->flags & ~(SCSICMD_READ10FLAGS_DPO | SCSICMD_READ10FLAGS_FUA)) != 0)
|
||||
{
|
||||
usbtrace(TRACE_CLSERROR(USBMSC_TRACEERR_READ10FLAGS), 0);
|
||||
lun->sd = SCSI_KCQIR_INVALIDFIELDINCBA;
|
||||
@@ -1071,7 +1071,7 @@ static inline int usbmsc_cmdwrite10(FAR struct usbmsc_dev_s *priv)
|
||||
|
||||
/* Verify that we can support this write command */
|
||||
|
||||
if ((write10->flags & ~(SCSICMD_WRITE10FLAGS_DPO|SCSICMD_WRITE10FLAGS_FUA)) != 0)
|
||||
if ((write10->flags & ~(SCSICMD_WRITE10FLAGS_DPO | SCSICMD_WRITE10FLAGS_FUA)) != 0)
|
||||
{
|
||||
usbtrace(TRACE_CLSERROR(USBMSC_TRACEERR_WRITE10FLAGS), 0);
|
||||
lun->sd = SCSI_KCQIR_INVALIDFIELDINCBA;
|
||||
@@ -1315,7 +1315,7 @@ static int inline usbmsc_cmdmodesense10(FAR struct usbmsc_dev_s *priv,
|
||||
|
||||
static inline int usbmsc_cmdread12(FAR struct usbmsc_dev_s *priv)
|
||||
{
|
||||
struct scsicmd_read12_s *read12 = (struct scsicmd_read12_s*)priv->cdb;
|
||||
struct scsicmd_read12_s *read12 = (struct scsicmd_read12_s *)priv->cdb;
|
||||
FAR struct usbmsc_lun_s *lun = priv->lun;
|
||||
int ret;
|
||||
|
||||
@@ -1330,7 +1330,7 @@ static inline int usbmsc_cmdread12(FAR struct usbmsc_dev_s *priv)
|
||||
|
||||
/* Verify that we can support this read command */
|
||||
|
||||
if ((read12->flags & ~(SCSICMD_READ12FLAGS_DPO|SCSICMD_READ12FLAGS_FUA)) != 0)
|
||||
if ((read12->flags & ~(SCSICMD_READ12FLAGS_DPO | SCSICMD_READ12FLAGS_FUA)) != 0)
|
||||
{
|
||||
usbtrace(TRACE_CLSERROR(USBMSC_TRACEERR_READ12FLAGS), 0);
|
||||
lun->sd = SCSI_KCQIR_INVALIDFIELDINCBA;
|
||||
@@ -1392,7 +1392,7 @@ static inline int usbmsc_cmdwrite12(FAR struct usbmsc_dev_s *priv)
|
||||
|
||||
/* Verify that we can support this write command */
|
||||
|
||||
if ((write12->flags & ~(SCSICMD_WRITE12FLAGS_DPO|SCSICMD_WRITE12FLAGS_FUA)) != 0)
|
||||
if ((write12->flags & ~(SCSICMD_WRITE12FLAGS_DPO | SCSICMD_WRITE12FLAGS_FUA)) != 0)
|
||||
{
|
||||
usbtrace(TRACE_CLSERROR(USBMSC_TRACEERR_WRITE12FLAGS), 0);
|
||||
lun->sd = SCSI_KCQIR_INVALIDFIELDINCBA;
|
||||
@@ -1652,7 +1652,7 @@ static int usbmsc_idlestate(FAR struct usbmsc_dev_s *priv)
|
||||
|
||||
/* Handle the CBW */
|
||||
|
||||
usbmsc_dumpdata("SCSCI CBW", (uint8_t*)cbw, USBMSC_CBW_SIZEOF - USBMSC_MAXCDBLEN);
|
||||
usbmsc_dumpdata("SCSCI CBW", (FAR uint8_t *)cbw, USBMSC_CBW_SIZEOF - USBMSC_MAXCDBLEN);
|
||||
usbmsc_dumpdata(" CDB", cbw->cdb, MIN(cbw->cdblen, USBMSC_MAXCDBLEN));
|
||||
|
||||
/* Check for properly formatted CBW? */
|
||||
@@ -2541,7 +2541,7 @@ static int usbmsc_cmdstatusstate(FAR struct usbmsc_dev_s *priv)
|
||||
}
|
||||
|
||||
req = privreq->req;
|
||||
csw = (struct usbmsc_csw_s*)req->buf;
|
||||
csw = (FAR struct usbmsc_csw_s *)req->buf;
|
||||
|
||||
/* Extract the sense data from the LUN structure */
|
||||
|
||||
@@ -2578,7 +2578,7 @@ static int usbmsc_cmdstatusstate(FAR struct usbmsc_dev_s *priv)
|
||||
usbmsc_putle32(csw->residue, priv->residue);
|
||||
csw->status = status;
|
||||
|
||||
usbmsc_dumpdata("SCSCI CSW", (uint8_t*)csw, USBMSC_CSW_SIZEOF);
|
||||
usbmsc_dumpdata("SCSCI CSW", (FAR uint8_t *)csw, USBMSC_CSW_SIZEOF);
|
||||
|
||||
req->len = USBMSC_CSW_SIZEOF;
|
||||
req->callback = usbmsc_wrcomplete;
|
||||
@@ -2590,7 +2590,7 @@ static int usbmsc_cmdstatusstate(FAR struct usbmsc_dev_s *priv)
|
||||
{
|
||||
usbtrace(TRACE_CLSERROR(USBMSC_TRACEERR_SNDSTATUSSUBMIT), (uint16_t)-ret);
|
||||
flags = irqsave();
|
||||
(void)sq_addlast((sq_entry_t*)privreq, &priv->wrreqlist);
|
||||
(void)sq_addlast((FAR sq_entry_t *)privreq, &priv->wrreqlist);
|
||||
irqrestore(flags);
|
||||
}
|
||||
|
||||
@@ -2701,8 +2701,8 @@ int usbmsc_scsi_main(int argc, char *argv[])
|
||||
* drive the state machine.
|
||||
*/
|
||||
|
||||
if ((eventset & (USBMSC_EVENT_DISCONNECT|USBMSC_EVENT_RESET|USBMSC_EVENT_CFGCHANGE|
|
||||
USBMSC_EVENT_IFCHANGE|USBMSC_EVENT_ABORTBULKOUT)) != 0)
|
||||
if ((eventset & (USBMSC_EVENT_DISCONNECT | USBMSC_EVENT_RESET | USBMSC_EVENT_CFGCHANGE |
|
||||
USBMSC_EVENT_IFCHANGE | USBMSC_EVENT_ABORTBULKOUT)) != 0)
|
||||
{
|
||||
/* These events require that the current configuration be reset */
|
||||
|
||||
@@ -2720,7 +2720,7 @@ int usbmsc_scsi_main(int argc, char *argv[])
|
||||
|
||||
/* These events required that we send a deferred EP0 setup response */
|
||||
|
||||
if ((eventset & (USBMSC_EVENT_RESET|USBMSC_EVENT_CFGCHANGE|USBMSC_EVENT_IFCHANGE)) != 0)
|
||||
if ((eventset & (USBMSC_EVENT_RESET | USBMSC_EVENT_CFGCHANGE | USBMSC_EVENT_IFCHANGE)) != 0)
|
||||
{
|
||||
usbmsc_deferredresponse(priv, false);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user