mirror of
https://github.com/apache/nuttx.git
synced 2026-05-27 11:26:12 +08:00
Reserved word 'private' in C header files is a problem for C++
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@1890 42af7a65-404d-4744-a932-0658087f49c3
This commit is contained in:
@@ -782,5 +782,7 @@
|
|||||||
* Add configuration options to suppress or eliminate cloning of file
|
* Add configuration options to suppress or eliminate cloning of file
|
||||||
and/or socket descriptors when a new task is started by task_create():
|
and/or socket descriptors when a new task is started by task_create():
|
||||||
CONFIG_FDCLONE_DISABLE, CONFIG_FDCLONE_STDIO, CONFIG_SDCLONE_DISABLE.
|
CONFIG_FDCLONE_DISABLE, CONFIG_FDCLONE_STDIO, CONFIG_SDCLONE_DISABLE.
|
||||||
|
* Use of C++ reserved word 'private' in C header files causes problems
|
||||||
|
for C++ that include them.
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
<tr align="center" bgcolor="#e4e4e4">
|
<tr align="center" bgcolor="#e4e4e4">
|
||||||
<td>
|
<td>
|
||||||
<h1><big><font color="#3c34ec"><i>NuttX RTOS</i></font></big></h1>
|
<h1><big><font color="#3c34ec"><i>NuttX RTOS</i></font></big></h1>
|
||||||
<p>Last Updated: June 15, 2009</p>
|
<p>Last Updated: June 16, 2009</p>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
@@ -1474,6 +1474,8 @@ nuttx-0.4.9 2009-xx-xx Gregory Nutt <spudmonkey@racsa.co.cr>
|
|||||||
* dup() and dup2() will now clone socket descriptors
|
* dup() and dup2() will now clone socket descriptors
|
||||||
* All socket descriptors ar now cloned when when a new task is started
|
* All socket descriptors ar now cloned when when a new task is started
|
||||||
via task_create().
|
via task_create().
|
||||||
|
* Use of C++ reserved word 'private' in C header files causes problems
|
||||||
|
for C++ that include them.
|
||||||
|
|
||||||
pascal-0.1.3 2009-xx-xx Gregory Nutt <spudmonkey@racsa.co.cr>
|
pascal-0.1.3 2009-xx-xx Gregory Nutt <spudmonkey@racsa.co.cr>
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* drivers/pipe_common.c
|
* drivers/pipe_common.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 2008 Gregory Nutt. All rights reserved.
|
* Copyright (C) 2008-2009 Gregory Nutt. All rights reserved.
|
||||||
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
|
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
@@ -33,10 +33,6 @@
|
|||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
/****************************************************************************
|
|
||||||
* Compilation Switches
|
|
||||||
****************************************************************************/
|
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Included Files
|
* Included Files
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
@@ -550,14 +546,14 @@ int pipecommon_poll(FAR struct file *filep, FAR struct pollfd *fds,
|
|||||||
/* Bind the poll structure and this slot */
|
/* Bind the poll structure and this slot */
|
||||||
|
|
||||||
dev->d_fds[i] = fds;
|
dev->d_fds[i] = fds;
|
||||||
fds->private = &dev->d_fds[i];
|
fds->priv = &dev->d_fds[i];
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (i >= CONFIG_DEV_PIPE_NPOLLWAITERS)
|
if (i >= CONFIG_DEV_PIPE_NPOLLWAITERS)
|
||||||
{
|
{
|
||||||
fds->private = NULL;
|
fds->priv = NULL;
|
||||||
ret = -EBUSY;
|
ret = -EBUSY;
|
||||||
goto errout;
|
goto errout;
|
||||||
}
|
}
|
||||||
@@ -599,7 +595,7 @@ int pipecommon_poll(FAR struct file *filep, FAR struct pollfd *fds,
|
|||||||
{
|
{
|
||||||
/* This is a request to tear down the poll. */
|
/* This is a request to tear down the poll. */
|
||||||
|
|
||||||
struct pollfd **slot = (struct pollfd **)fds->private;
|
struct pollfd **slot = (struct pollfd **)fds->priv;
|
||||||
|
|
||||||
#ifdef CONFIG_DEBUG
|
#ifdef CONFIG_DEBUG
|
||||||
if (!slot)
|
if (!slot)
|
||||||
@@ -612,7 +608,7 @@ int pipecommon_poll(FAR struct file *filep, FAR struct pollfd *fds,
|
|||||||
/* Remove all memory of the poll setup */
|
/* Remove all memory of the poll setup */
|
||||||
|
|
||||||
*slot = NULL;
|
*slot = NULL;
|
||||||
fds->private = NULL;
|
fds->priv = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
errout:
|
errout:
|
||||||
|
|||||||
+5
-5
@@ -436,14 +436,14 @@ int uart_poll(FAR struct file *filep, FAR struct pollfd *fds, boolean setup)
|
|||||||
/* Bind the poll structure and this slot */
|
/* Bind the poll structure and this slot */
|
||||||
|
|
||||||
dev->fds[i] = fds;
|
dev->fds[i] = fds;
|
||||||
fds->private = &dev->fds[i];
|
fds->priv = &dev->fds[i];
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (i >= CONFIG_DEV_CONSOLE_NPOLLWAITERS)
|
if (i >= CONFIG_DEV_CONSOLE_NPOLLWAITERS)
|
||||||
{
|
{
|
||||||
fds->private = NULL;
|
fds->priv = NULL;
|
||||||
ret = -EBUSY;
|
ret = -EBUSY;
|
||||||
goto errout;
|
goto errout;
|
||||||
}
|
}
|
||||||
@@ -481,11 +481,11 @@ int uart_poll(FAR struct file *filep, FAR struct pollfd *fds, boolean setup)
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
else if (fds->private)
|
else if (fds->priv)
|
||||||
{
|
{
|
||||||
/* This is a request to tear down the poll. */
|
/* This is a request to tear down the poll. */
|
||||||
|
|
||||||
struct pollfd **slot = (struct pollfd **)fds->private;
|
struct pollfd **slot = (struct pollfd **)fds->priv;
|
||||||
|
|
||||||
#ifdef CONFIG_DEBUG
|
#ifdef CONFIG_DEBUG
|
||||||
if (!slot)
|
if (!slot)
|
||||||
@@ -498,7 +498,7 @@ int uart_poll(FAR struct file *filep, FAR struct pollfd *fds, boolean setup)
|
|||||||
/* Remove all memory of the poll setup */
|
/* Remove all memory of the poll setup */
|
||||||
|
|
||||||
*slot = NULL;
|
*slot = NULL;
|
||||||
fds->private = NULL;
|
fds->priv = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
errout:
|
errout:
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* drivers/usbdev/usbdev_storage.c
|
* drivers/usbdev/usbdev_storage.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 2008 Gregory Nutt. All rights reserved.
|
* Copyright (C) 2008-2009 Gregory Nutt. All rights reserved.
|
||||||
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
|
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
|
||||||
*
|
*
|
||||||
* Mass storage class device. Bulk-only with SCSI subclass.
|
* Mass storage class device. Bulk-only with SCSI subclass.
|
||||||
@@ -1604,7 +1604,7 @@ static int usbstrg_idlestate(FAR struct usbstrg_dev_s *priv)
|
|||||||
|
|
||||||
req = privreq->req;
|
req = privreq->req;
|
||||||
req->len = CONFIG_USBSTRG_BULKOUTREQLEN;
|
req->len = CONFIG_USBSTRG_BULKOUTREQLEN;
|
||||||
req->private = privreq;
|
req->priv = privreq;
|
||||||
req->callback = usbstrg_rdcomplete;
|
req->callback = usbstrg_rdcomplete;
|
||||||
|
|
||||||
if (EP_SUBMIT(priv->epbulkout, req) != OK)
|
if (EP_SUBMIT(priv->epbulkout, req) != OK)
|
||||||
@@ -2046,7 +2046,7 @@ static int usbstrg_cmdreadstate(FAR struct usbstrg_dev_s *priv)
|
|||||||
/* And submit the request to the bulk IN endpoint */
|
/* And submit the request to the bulk IN endpoint */
|
||||||
|
|
||||||
req->len = priv->nreqbytes;
|
req->len = priv->nreqbytes;
|
||||||
req->private = privreq;
|
req->priv = privreq;
|
||||||
req->callback = usbstrg_wrcomplete;
|
req->callback = usbstrg_wrcomplete;
|
||||||
req->flags = 0;
|
req->flags = 0;
|
||||||
|
|
||||||
@@ -2189,7 +2189,7 @@ static int usbstrg_cmdwritestate(FAR struct usbstrg_dev_s *priv)
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
req->len = CONFIG_USBSTRG_BULKOUTREQLEN;
|
req->len = CONFIG_USBSTRG_BULKOUTREQLEN;
|
||||||
req->private = privreq;
|
req->priv = privreq;
|
||||||
req->callback = usbstrg_rdcomplete;
|
req->callback = usbstrg_rdcomplete;
|
||||||
|
|
||||||
ret = EP_SUBMIT(priv->epbulkout, req);
|
ret = EP_SUBMIT(priv->epbulkout, req);
|
||||||
@@ -2283,7 +2283,7 @@ static int usbstrg_cmdfinishstate(FAR struct usbstrg_dev_s *priv)
|
|||||||
req = privreq->req;
|
req = privreq->req;
|
||||||
req->len = priv->nreqbytes;
|
req->len = priv->nreqbytes;
|
||||||
req->callback = usbstrg_wrcomplete;
|
req->callback = usbstrg_wrcomplete;
|
||||||
req->private = privreq;
|
req->priv = privreq;
|
||||||
req->flags = USBDEV_REQFLAGS_NULLPKT;
|
req->flags = USBDEV_REQFLAGS_NULLPKT;
|
||||||
|
|
||||||
ret = EP_SUBMIT(priv->epbulkin, privreq->req);
|
ret = EP_SUBMIT(priv->epbulkin, privreq->req);
|
||||||
@@ -2429,7 +2429,7 @@ static int usbstrg_cmdstatusstate(FAR struct usbstrg_dev_s *priv)
|
|||||||
|
|
||||||
req->len = USBSTRG_CSW_SIZEOF;
|
req->len = USBSTRG_CSW_SIZEOF;
|
||||||
req->callback = usbstrg_wrcomplete;
|
req->callback = usbstrg_wrcomplete;
|
||||||
req->private = privreq;
|
req->priv = privreq;
|
||||||
req->flags = USBDEV_REQFLAGS_NULLPKT;
|
req->flags = USBDEV_REQFLAGS_NULLPKT;
|
||||||
|
|
||||||
ret = EP_SUBMIT(priv->epbulkin, req);
|
ret = EP_SUBMIT(priv->epbulkin, req);
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* drivers/usbdev/usbdev_serial.c
|
* drivers/usbdev/usbdev_serial.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 2008 Gregory Nutt. All rights reserved.
|
* Copyright (C) 2008-2009 Gregory Nutt. All rights reserved.
|
||||||
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
|
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
|
||||||
*
|
*
|
||||||
* This logic emulates the Prolific PL2303 serial/USB converter
|
* This logic emulates the Prolific PL2303 serial/USB converter
|
||||||
@@ -613,7 +613,7 @@ static int usbclass_sndpacket(FAR struct usbser_dev_s *priv)
|
|||||||
/* Then submit the request to the endpoint */
|
/* Then submit the request to the endpoint */
|
||||||
|
|
||||||
req->len = len;
|
req->len = len;
|
||||||
req->private = reqcontainer;
|
req->priv = reqcontainer;
|
||||||
req->flags = USBDEV_REQFLAGS_NULLPKT;
|
req->flags = USBDEV_REQFLAGS_NULLPKT;
|
||||||
ret = EP_SUBMIT(ep, req);
|
ret = EP_SUBMIT(ep, req);
|
||||||
if (ret != OK)
|
if (ret != OK)
|
||||||
@@ -1045,7 +1045,7 @@ static int usbclass_setconfig(FAR struct usbser_dev_s *priv, ubyte config)
|
|||||||
usbtrace(TRACE_CLSERROR(USBSER_TRACEERR_EPINTINCONFIGFAIL), 0);
|
usbtrace(TRACE_CLSERROR(USBSER_TRACEERR_EPINTINCONFIGFAIL), 0);
|
||||||
goto errout;
|
goto errout;
|
||||||
}
|
}
|
||||||
priv->epintin->private = priv;
|
priv->epintin->priv = priv;
|
||||||
|
|
||||||
/* Configure the IN bulk endpoint */
|
/* Configure the IN bulk endpoint */
|
||||||
|
|
||||||
@@ -1070,7 +1070,7 @@ static int usbclass_setconfig(FAR struct usbser_dev_s *priv, ubyte config)
|
|||||||
goto errout;
|
goto errout;
|
||||||
}
|
}
|
||||||
|
|
||||||
priv->epbulkin->private = priv;
|
priv->epbulkin->priv = priv;
|
||||||
|
|
||||||
/* Configure the OUT bulk endpoint */
|
/* Configure the OUT bulk endpoint */
|
||||||
|
|
||||||
@@ -1086,7 +1086,7 @@ static int usbclass_setconfig(FAR struct usbser_dev_s *priv, ubyte config)
|
|||||||
goto errout;
|
goto errout;
|
||||||
}
|
}
|
||||||
|
|
||||||
priv->epbulkout->private = priv;
|
priv->epbulkout->priv = priv;
|
||||||
|
|
||||||
/* Queue read requests in the bulk OUT endpoint */
|
/* Queue read requests in the bulk OUT endpoint */
|
||||||
|
|
||||||
@@ -1148,7 +1148,7 @@ static void usbclass_rdcomplete(FAR struct usbdev_ep_s *ep,
|
|||||||
/* Sanity check */
|
/* Sanity check */
|
||||||
|
|
||||||
#ifdef CONFIG_DEBUG
|
#ifdef CONFIG_DEBUG
|
||||||
if (!ep || !ep->private || !req)
|
if (!ep || !ep->priv || !req)
|
||||||
{
|
{
|
||||||
usbtrace(TRACE_CLSERROR(USBSER_TRACEERR_INVALIDARG), 0);
|
usbtrace(TRACE_CLSERROR(USBSER_TRACEERR_INVALIDARG), 0);
|
||||||
return;
|
return;
|
||||||
@@ -1157,7 +1157,7 @@ static void usbclass_rdcomplete(FAR struct usbdev_ep_s *ep,
|
|||||||
|
|
||||||
/* Extract references to private data */
|
/* Extract references to private data */
|
||||||
|
|
||||||
priv = (FAR struct usbser_dev_s*)ep->private;
|
priv = (FAR struct usbser_dev_s*)ep->priv;
|
||||||
|
|
||||||
/* Process the received data unless this is some unusual condition */
|
/* Process the received data unless this is some unusual condition */
|
||||||
|
|
||||||
@@ -1215,7 +1215,7 @@ static void usbclass_wrcomplete(FAR struct usbdev_ep_s *ep,
|
|||||||
/* Sanity check */
|
/* Sanity check */
|
||||||
|
|
||||||
#ifdef CONFIG_DEBUG
|
#ifdef CONFIG_DEBUG
|
||||||
if (!ep || !ep->private || !req || !req->private)
|
if (!ep || !ep->priv || !req || !req->priv)
|
||||||
{
|
{
|
||||||
usbtrace(TRACE_CLSERROR(USBSER_TRACEERR_INVALIDARG), 0);
|
usbtrace(TRACE_CLSERROR(USBSER_TRACEERR_INVALIDARG), 0);
|
||||||
return;
|
return;
|
||||||
@@ -1224,8 +1224,8 @@ static void usbclass_wrcomplete(FAR struct usbdev_ep_s *ep,
|
|||||||
|
|
||||||
/* Extract references to our private data */
|
/* Extract references to our private data */
|
||||||
|
|
||||||
priv = (FAR struct usbser_dev_s *)ep->private;
|
priv = (FAR struct usbser_dev_s *)ep->priv;
|
||||||
reqcontainer = (FAR struct usbser_req_s *)req->private;
|
reqcontainer = (FAR struct usbser_req_s *)req->priv;
|
||||||
|
|
||||||
/* Return the write request to the free list */
|
/* Return the write request to the free list */
|
||||||
|
|
||||||
@@ -1280,8 +1280,8 @@ static int usbclass_bind(FAR struct usbdev_s *dev, FAR struct usbdevclass_driver
|
|||||||
|
|
||||||
/* Bind the structures */
|
/* Bind the structures */
|
||||||
|
|
||||||
priv->usbdev = dev;
|
priv->usbdev = dev;
|
||||||
dev->ep0->private = priv;
|
dev->ep0->priv = priv;
|
||||||
|
|
||||||
/* Preallocate control request */
|
/* Preallocate control request */
|
||||||
|
|
||||||
@@ -1310,7 +1310,7 @@ static int usbclass_bind(FAR struct usbdev_s *dev, FAR struct usbdevclass_driver
|
|||||||
ret = -ENODEV;
|
ret = -ENODEV;
|
||||||
goto errout;
|
goto errout;
|
||||||
}
|
}
|
||||||
priv->epintin->private = priv;
|
priv->epintin->priv = priv;
|
||||||
|
|
||||||
/* Pre-allocate the IN bulk endpoint */
|
/* Pre-allocate the IN bulk endpoint */
|
||||||
|
|
||||||
@@ -1321,7 +1321,7 @@ static int usbclass_bind(FAR struct usbdev_s *dev, FAR struct usbdevclass_driver
|
|||||||
ret = -ENODEV;
|
ret = -ENODEV;
|
||||||
goto errout;
|
goto errout;
|
||||||
}
|
}
|
||||||
priv->epbulkin->private = priv;
|
priv->epbulkin->priv = priv;
|
||||||
|
|
||||||
/* Pre-allocate the OUT bulk endpoint */
|
/* Pre-allocate the OUT bulk endpoint */
|
||||||
|
|
||||||
@@ -1332,7 +1332,7 @@ static int usbclass_bind(FAR struct usbdev_s *dev, FAR struct usbdevclass_driver
|
|||||||
ret = -ENODEV;
|
ret = -ENODEV;
|
||||||
goto errout;
|
goto errout;
|
||||||
}
|
}
|
||||||
priv->epbulkout->private = priv;
|
priv->epbulkout->priv = priv;
|
||||||
|
|
||||||
/* Pre-allocate read requests */
|
/* Pre-allocate read requests */
|
||||||
|
|
||||||
@@ -1352,7 +1352,7 @@ static int usbclass_bind(FAR struct usbdev_s *dev, FAR struct usbdevclass_driver
|
|||||||
ret = -ENOMEM;
|
ret = -ENOMEM;
|
||||||
goto errout;
|
goto errout;
|
||||||
}
|
}
|
||||||
reqcontainer->req->private = reqcontainer;
|
reqcontainer->req->priv = reqcontainer;
|
||||||
reqcontainer->req->callback = usbclass_rdcomplete;
|
reqcontainer->req->callback = usbclass_rdcomplete;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1374,7 +1374,7 @@ static int usbclass_bind(FAR struct usbdev_s *dev, FAR struct usbdevclass_driver
|
|||||||
ret = -ENOMEM;
|
ret = -ENOMEM;
|
||||||
goto errout;
|
goto errout;
|
||||||
}
|
}
|
||||||
reqcontainer->req->private = reqcontainer;
|
reqcontainer->req->priv = reqcontainer;
|
||||||
reqcontainer->req->callback = usbclass_wrcomplete;
|
reqcontainer->req->callback = usbclass_wrcomplete;
|
||||||
|
|
||||||
flags = irqsave();
|
flags = irqsave();
|
||||||
@@ -1422,7 +1422,7 @@ static void usbclass_unbind(FAR struct usbdev_s *dev)
|
|||||||
|
|
||||||
/* Extract reference to private data */
|
/* Extract reference to private data */
|
||||||
|
|
||||||
priv = (FAR struct usbser_dev_s *)dev->ep0->private;
|
priv = (FAR struct usbser_dev_s *)dev->ep0->priv;
|
||||||
|
|
||||||
#ifdef CONFIG_DEBUG
|
#ifdef CONFIG_DEBUG
|
||||||
if (!priv)
|
if (!priv)
|
||||||
@@ -1547,7 +1547,7 @@ static int usbclass_setup(FAR struct usbdev_s *dev, const struct usb_ctrlreq_s *
|
|||||||
/* Extract reference to private data */
|
/* Extract reference to private data */
|
||||||
|
|
||||||
usbtrace(TRACE_CLASSSETUP, ctrl->req);
|
usbtrace(TRACE_CLASSSETUP, ctrl->req);
|
||||||
priv = (FAR struct usbser_dev_s *)dev->ep0->private;
|
priv = (FAR struct usbser_dev_s *)dev->ep0->priv;
|
||||||
|
|
||||||
#ifdef CONFIG_DEBUG
|
#ifdef CONFIG_DEBUG
|
||||||
if (!priv || !priv->ctrlreq)
|
if (!priv || !priv->ctrlreq)
|
||||||
@@ -1806,7 +1806,7 @@ static void usbclass_disconnect(FAR struct usbdev_s *dev)
|
|||||||
|
|
||||||
/* Extract reference to private data */
|
/* Extract reference to private data */
|
||||||
|
|
||||||
priv = (FAR struct usbser_dev_s *)dev->ep0->private;
|
priv = (FAR struct usbser_dev_s *)dev->ep0->priv;
|
||||||
|
|
||||||
#ifdef CONFIG_DEBUG
|
#ifdef CONFIG_DEBUG
|
||||||
if (!priv)
|
if (!priv)
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* drivers/usbdev/usbdev_storage.c
|
* drivers/usbdev/usbdev_storage.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 2008 Gregory Nutt. All rights reserved.
|
* Copyright (C) 2008-2009 Gregory Nutt. All rights reserved.
|
||||||
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
|
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
|
||||||
*
|
*
|
||||||
* Mass storage class device. Bulk-only with SCSI subclass.
|
* Mass storage class device. Bulk-only with SCSI subclass.
|
||||||
@@ -504,8 +504,8 @@ static int usbstrg_bind(FAR struct usbdev_s *dev, FAR struct usbdevclass_driver_
|
|||||||
|
|
||||||
/* Bind the structures */
|
/* Bind the structures */
|
||||||
|
|
||||||
priv->usbdev = dev;
|
priv->usbdev = dev;
|
||||||
dev->ep0->private = priv;
|
dev->ep0->priv = priv;
|
||||||
|
|
||||||
/* The configured EP0 size should match the reported EP0 size. We could
|
/* The configured EP0 size should match the reported EP0 size. We could
|
||||||
* easily adapt to the reported EP0 size, but then we could not use the
|
* easily adapt to the reported EP0 size, but then we could not use the
|
||||||
@@ -541,7 +541,7 @@ static int usbstrg_bind(FAR struct usbdev_s *dev, FAR struct usbdevclass_driver_
|
|||||||
ret = -ENODEV;
|
ret = -ENODEV;
|
||||||
goto errout;
|
goto errout;
|
||||||
}
|
}
|
||||||
priv->epbulkin->private = priv;
|
priv->epbulkin->priv = priv;
|
||||||
|
|
||||||
/* Pre-allocate the OUT bulk endpoint */
|
/* Pre-allocate the OUT bulk endpoint */
|
||||||
|
|
||||||
@@ -552,7 +552,7 @@ static int usbstrg_bind(FAR struct usbdev_s *dev, FAR struct usbdevclass_driver_
|
|||||||
ret = -ENODEV;
|
ret = -ENODEV;
|
||||||
goto errout;
|
goto errout;
|
||||||
}
|
}
|
||||||
priv->epbulkout->private = priv;
|
priv->epbulkout->priv = priv;
|
||||||
|
|
||||||
/* Pre-allocate read requests */
|
/* Pre-allocate read requests */
|
||||||
|
|
||||||
@@ -566,7 +566,7 @@ static int usbstrg_bind(FAR struct usbdev_s *dev, FAR struct usbdevclass_driver_
|
|||||||
ret = -ENOMEM;
|
ret = -ENOMEM;
|
||||||
goto errout;
|
goto errout;
|
||||||
}
|
}
|
||||||
reqcontainer->req->private = reqcontainer;
|
reqcontainer->req->priv = reqcontainer;
|
||||||
reqcontainer->req->callback = usbstrg_rdcomplete;
|
reqcontainer->req->callback = usbstrg_rdcomplete;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -582,7 +582,7 @@ static int usbstrg_bind(FAR struct usbdev_s *dev, FAR struct usbdevclass_driver_
|
|||||||
ret = -ENOMEM;
|
ret = -ENOMEM;
|
||||||
goto errout;
|
goto errout;
|
||||||
}
|
}
|
||||||
reqcontainer->req->private = reqcontainer;
|
reqcontainer->req->priv = reqcontainer;
|
||||||
reqcontainer->req->callback = usbstrg_wrcomplete;
|
reqcontainer->req->callback = usbstrg_wrcomplete;
|
||||||
|
|
||||||
flags = irqsave();
|
flags = irqsave();
|
||||||
@@ -629,7 +629,7 @@ static void usbstrg_unbind(FAR struct usbdev_s *dev)
|
|||||||
|
|
||||||
/* Extract reference to private data */
|
/* Extract reference to private data */
|
||||||
|
|
||||||
priv = (FAR struct usbstrg_dev_s *)dev->ep0->private;
|
priv = (FAR struct usbstrg_dev_s *)dev->ep0->priv;
|
||||||
|
|
||||||
#ifdef CONFIG_DEBUG
|
#ifdef CONFIG_DEBUG
|
||||||
if (!priv)
|
if (!priv)
|
||||||
@@ -743,7 +743,7 @@ static int usbstrg_setup(FAR struct usbdev_s *dev, const struct usb_ctrlreq_s *c
|
|||||||
/* Extract reference to private data */
|
/* Extract reference to private data */
|
||||||
|
|
||||||
usbtrace(TRACE_CLASSSETUP, ctrl->req);
|
usbtrace(TRACE_CLASSSETUP, ctrl->req);
|
||||||
priv = (FAR struct usbstrg_dev_s *)dev->ep0->private;
|
priv = (FAR struct usbstrg_dev_s *)dev->ep0->priv;
|
||||||
|
|
||||||
#ifdef CONFIG_DEBUG
|
#ifdef CONFIG_DEBUG
|
||||||
if (!priv || !priv->ctrlreq)
|
if (!priv || !priv->ctrlreq)
|
||||||
@@ -1018,7 +1018,7 @@ static void usbstrg_disconnect(FAR struct usbdev_s *dev)
|
|||||||
|
|
||||||
/* Extract reference to private data */
|
/* Extract reference to private data */
|
||||||
|
|
||||||
priv = (FAR struct usbstrg_dev_s *)dev->ep0->private;
|
priv = (FAR struct usbstrg_dev_s *)dev->ep0->priv;
|
||||||
|
|
||||||
#ifdef CONFIG_DEBUG
|
#ifdef CONFIG_DEBUG
|
||||||
if (!priv)
|
if (!priv)
|
||||||
@@ -1139,7 +1139,7 @@ int usbstrg_setconfig(FAR struct usbstrg_dev_s *priv, ubyte config)
|
|||||||
goto errout;
|
goto errout;
|
||||||
}
|
}
|
||||||
|
|
||||||
priv->epbulkin->private = priv;
|
priv->epbulkin->priv = priv;
|
||||||
|
|
||||||
/* Configure the OUT bulk endpoint */
|
/* Configure the OUT bulk endpoint */
|
||||||
|
|
||||||
@@ -1155,7 +1155,7 @@ int usbstrg_setconfig(FAR struct usbstrg_dev_s *priv, ubyte config)
|
|||||||
goto errout;
|
goto errout;
|
||||||
}
|
}
|
||||||
|
|
||||||
priv->epbulkout->private = priv;
|
priv->epbulkout->priv = priv;
|
||||||
|
|
||||||
/* Queue read requests in the bulk OUT endpoint */
|
/* Queue read requests in the bulk OUT endpoint */
|
||||||
|
|
||||||
@@ -1164,7 +1164,7 @@ int usbstrg_setconfig(FAR struct usbstrg_dev_s *priv, ubyte config)
|
|||||||
privreq = &priv->rdreqs[i];
|
privreq = &priv->rdreqs[i];
|
||||||
req = privreq->req;
|
req = privreq->req;
|
||||||
req->len = CONFIG_USBSTRG_BULKOUTREQLEN;
|
req->len = CONFIG_USBSTRG_BULKOUTREQLEN;
|
||||||
req->private = privreq;
|
req->priv = privreq;
|
||||||
req->callback = usbstrg_rdcomplete;
|
req->callback = usbstrg_rdcomplete;
|
||||||
ret = EP_SUBMIT(priv->epbulkout, req);
|
ret = EP_SUBMIT(priv->epbulkout, req);
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
@@ -1227,7 +1227,7 @@ void usbstrg_wrcomplete(FAR struct usbdev_ep_s *ep, FAR struct usbdev_req_s *req
|
|||||||
/* Sanity check */
|
/* Sanity check */
|
||||||
|
|
||||||
#ifdef CONFIG_DEBUG
|
#ifdef CONFIG_DEBUG
|
||||||
if (!ep || !ep->private || !req || !req->private)
|
if (!ep || !ep->priv || !req || !req->priv)
|
||||||
{
|
{
|
||||||
usbtrace(TRACE_CLSERROR(USBSTRG_TRACEERR_WRCOMPLETEINVALIDARGS), 0);
|
usbtrace(TRACE_CLSERROR(USBSTRG_TRACEERR_WRCOMPLETEINVALIDARGS), 0);
|
||||||
return;
|
return;
|
||||||
@@ -1236,8 +1236,8 @@ void usbstrg_wrcomplete(FAR struct usbdev_ep_s *ep, FAR struct usbdev_req_s *req
|
|||||||
|
|
||||||
/* Extract references to private data */
|
/* Extract references to private data */
|
||||||
|
|
||||||
priv = (FAR struct usbstrg_dev_s*)ep->private;
|
priv = (FAR struct usbstrg_dev_s*)ep->priv;
|
||||||
privreq = (FAR struct usbstrg_req_s *)req->private;
|
privreq = (FAR struct usbstrg_req_s *)req->priv;
|
||||||
|
|
||||||
/* Return the write request to the free list */
|
/* Return the write request to the free list */
|
||||||
|
|
||||||
@@ -1287,7 +1287,7 @@ void usbstrg_rdcomplete(FAR struct usbdev_ep_s *ep, FAR struct usbdev_req_s *req
|
|||||||
/* Sanity check */
|
/* Sanity check */
|
||||||
|
|
||||||
#ifdef CONFIG_DEBUG
|
#ifdef CONFIG_DEBUG
|
||||||
if (!ep || !ep->private || !req || !req->private)
|
if (!ep || !ep->priv || !req || !req->priv)
|
||||||
{
|
{
|
||||||
usbtrace(TRACE_CLSERROR(USBSTRG_TRACEERR_RDCOMPLETEINVALIDARGS), 0);
|
usbtrace(TRACE_CLSERROR(USBSTRG_TRACEERR_RDCOMPLETEINVALIDARGS), 0);
|
||||||
return;
|
return;
|
||||||
@@ -1296,8 +1296,8 @@ void usbstrg_rdcomplete(FAR struct usbdev_ep_s *ep, FAR struct usbdev_req_s *req
|
|||||||
|
|
||||||
/* Extract references to private data */
|
/* Extract references to private data */
|
||||||
|
|
||||||
priv = (FAR struct usbstrg_dev_s*)ep->private;
|
priv = (FAR struct usbstrg_dev_s*)ep->priv;
|
||||||
privreq = (FAR struct usbstrg_req_s *)req->private;
|
privreq = (FAR struct usbstrg_req_s *)req->priv;
|
||||||
|
|
||||||
/* Process the received data unless this is some unusual condition */
|
/* Process the received data unless this is some unusual condition */
|
||||||
|
|
||||||
@@ -1335,7 +1335,7 @@ void usbstrg_rdcomplete(FAR struct usbdev_ep_s *ep, FAR struct usbdev_req_s *req
|
|||||||
/* Return the read request to the bulk out endpoint for re-filling */
|
/* Return the read request to the bulk out endpoint for re-filling */
|
||||||
|
|
||||||
req = privreq->req;
|
req = privreq->req;
|
||||||
req->private = privreq;
|
req->priv = privreq;
|
||||||
req->callback = usbstrg_rdcomplete;
|
req->callback = usbstrg_rdcomplete;
|
||||||
|
|
||||||
ret = EP_SUBMIT(priv->epbulkout, req);
|
ret = EP_SUBMIT(priv->epbulkout, req);
|
||||||
|
|||||||
+2
-2
@@ -1,7 +1,7 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* fs/fs_poll.c
|
* fs/fs_poll.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 2008 Gregory Nutt. All rights reserved.
|
* Copyright (C) 2008-2009 Gregory Nutt. All rights reserved.
|
||||||
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
|
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
@@ -165,7 +165,7 @@ static inline int poll_setup(FAR struct pollfd *fds, nfds_t nfds, sem_t *sem)
|
|||||||
|
|
||||||
fds[i].sem = sem;
|
fds[i].sem = sem;
|
||||||
fds[i].revents = 0;
|
fds[i].revents = 0;
|
||||||
fds[i].private = NULL;
|
fds[i].priv = NULL;
|
||||||
|
|
||||||
/* Set up the poll */
|
/* Set up the poll */
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* fs_registerblockdriver.c
|
* fs_registerblockdriver.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 2007, 2008 Gregory Nutt. All rights reserved.
|
* Copyright (C) 2007-2009 Gregory Nutt. All rights reserved.
|
||||||
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
|
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
@@ -69,7 +69,7 @@
|
|||||||
|
|
||||||
STATUS register_blockdriver(const char *path,
|
STATUS register_blockdriver(const char *path,
|
||||||
const struct block_operations *bops,
|
const struct block_operations *bops,
|
||||||
mode_t mode, void *private)
|
mode_t mode, void *priv)
|
||||||
{
|
{
|
||||||
struct inode *node;
|
struct inode *node;
|
||||||
STATUS ret = -ENOMEM;
|
STATUS ret = -ENOMEM;
|
||||||
@@ -93,7 +93,7 @@ STATUS register_blockdriver(const char *path,
|
|||||||
#ifdef CONFIG_FILE_MODE
|
#ifdef CONFIG_FILE_MODE
|
||||||
node->i_mode = mode;
|
node->i_mode = mode;
|
||||||
#endif
|
#endif
|
||||||
node->i_private = private;
|
node->i_private = priv;
|
||||||
ret = OK;
|
ret = OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* fs/fs_registerdriver.c
|
* fs/fs_registerdriver.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 2007, 2008 Gregory Nutt. All rights reserved.
|
* Copyright (C) 2007-2009 Gregory Nutt. All rights reserved.
|
||||||
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
|
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
@@ -67,9 +67,8 @@
|
|||||||
* Name: register_driver
|
* Name: register_driver
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
STATUS register_driver(const char *path,
|
STATUS register_driver(const char *path, const struct file_operations *fops,
|
||||||
const struct file_operations *fops,
|
mode_t mode, void *priv)
|
||||||
mode_t mode, void *private)
|
|
||||||
{
|
{
|
||||||
struct inode *node;
|
struct inode *node;
|
||||||
STATUS ret = ERROR;
|
STATUS ret = ERROR;
|
||||||
@@ -92,7 +91,7 @@ STATUS register_driver(const char *path,
|
|||||||
#ifdef CONFIG_FILE_MODE
|
#ifdef CONFIG_FILE_MODE
|
||||||
node->i_mode = mode;
|
node->i_mode = mode;
|
||||||
#endif
|
#endif
|
||||||
node->i_private = private;
|
node->i_private = priv;
|
||||||
ret = OK;
|
ret = OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
* are used by uIP programs as well as internal uIP structures and function
|
* are used by uIP programs as well as internal uIP structures and function
|
||||||
* declarations.
|
* declarations.
|
||||||
*
|
*
|
||||||
* Copyright (C) 2007, 2008, 2009 Gregory Nutt. All rights reserved.
|
* Copyright (C) 2007-2009 Gregory Nutt. All rights reserved.
|
||||||
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
|
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
|
||||||
*
|
*
|
||||||
* This logic was leveraged from uIP which also has a BSD-style license:
|
* This logic was leveraged from uIP which also has a BSD-style license:
|
||||||
@@ -203,7 +203,7 @@ struct uip_ip_hdr
|
|||||||
* flink - Supports a singly linked list
|
* flink - Supports a singly linked list
|
||||||
* event - Provides the address of the callback function entry point.
|
* event - Provides the address of the callback function entry point.
|
||||||
* pvconn is a pointer to one of struct uip_conn or struct uip_udp_conn.
|
* pvconn is a pointer to one of struct uip_conn or struct uip_udp_conn.
|
||||||
* private - Holds a reference to application specific data that will
|
* priv - Holds a reference to application specific data that will
|
||||||
* provided
|
* provided
|
||||||
* flags - Set by the application to inform the uIP layer which flags
|
* flags - Set by the application to inform the uIP layer which flags
|
||||||
* are and are not handled by the callback.
|
* are and are not handled by the callback.
|
||||||
@@ -213,8 +213,8 @@ struct uip_driver_s; /* Forward reference */
|
|||||||
struct uip_callback_s
|
struct uip_callback_s
|
||||||
{
|
{
|
||||||
FAR struct uip_callback_s *flink;
|
FAR struct uip_callback_s *flink;
|
||||||
uint16 (*event)(struct uip_driver_s *dev, void *pvconn, void *pvprivate, uint16 flags);
|
uint16 (*event)(struct uip_driver_s *dev, void *pvconn, void *pvpriv, uint16 flags);
|
||||||
void *private;
|
void *priv;
|
||||||
uint16 flags;
|
uint16 flags;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
+2
-2
@@ -351,7 +351,7 @@ EXTERN int files_dup(FAR struct file *filep1, FAR struct file *filep2);
|
|||||||
#if defined(CONFIG_NET) && CONFIG_NSOCKET_DESCRIPTORS > 0
|
#if defined(CONFIG_NET) && CONFIG_NSOCKET_DESCRIPTORS > 0
|
||||||
EXTERN int file_dup(int fd);
|
EXTERN int file_dup(int fd);
|
||||||
#else
|
#else
|
||||||
# defile file_dup(fd) dup(fd)
|
# define file_dup(fd) dup(fd)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* fs_filedup2.c *************************************************************/
|
/* fs_filedup2.c *************************************************************/
|
||||||
@@ -363,7 +363,7 @@ EXTERN int file_dup(int fd);
|
|||||||
#if defined(CONFIG_NET) && CONFIG_NSOCKET_DESCRIPTORS > 0
|
#if defined(CONFIG_NET) && CONFIG_NSOCKET_DESCRIPTORS > 0
|
||||||
EXTERN int file_dup2(int fd1, int fd2);
|
EXTERN int file_dup2(int fd1, int fd2);
|
||||||
#else
|
#else
|
||||||
# defile file_dup2(fd1, fd2) dup2(fd1, fd2)
|
# define file_dup2(fd1, fd2) dup2(fd1, fd2)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* fs_openblockdriver.c ******************************************************/
|
/* fs_openblockdriver.c ******************************************************/
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
/************************************************************************************
|
/************************************************************************************
|
||||||
* include/nuttx/usbdev.h
|
* include/nuttx/usbdev.h
|
||||||
*
|
*
|
||||||
* Copyright (C) 2008 Gregory Nutt. All rights reserved.
|
* Copyright (C) 2008-2009 Gregory Nutt. All rights reserved.
|
||||||
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
|
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
|
||||||
*
|
*
|
||||||
* NOTE: This interface was inspired by the Linux gadget interface by
|
* NOTE: This interface was inspired by the Linux gadget interface by
|
||||||
@@ -199,7 +199,7 @@ struct usbdev_req_s
|
|||||||
/* Callback when the transfer completes */
|
/* Callback when the transfer completes */
|
||||||
|
|
||||||
void (*callback)(FAR struct usbdev_ep_s *ep, FAR struct usbdev_req_s *req);
|
void (*callback)(FAR struct usbdev_ep_s *ep, FAR struct usbdev_req_s *req);
|
||||||
void *private; /* Used only by callee */
|
void *priv; /* Used only by callee */
|
||||||
};
|
};
|
||||||
|
|
||||||
/* Endpoint-specific interface to USB controller hardware. */
|
/* Endpoint-specific interface to USB controller hardware. */
|
||||||
@@ -240,7 +240,7 @@ struct usbdev_ep_s
|
|||||||
const struct usbdev_epops_s *ops; /* Endpoint operations */
|
const struct usbdev_epops_s *ops; /* Endpoint operations */
|
||||||
ubyte eplog; /* Logical endpoint address */
|
ubyte eplog; /* Logical endpoint address */
|
||||||
uint16 maxpacket; /* Maximum packet size for this endpoint */
|
uint16 maxpacket; /* Maximum packet size for this endpoint */
|
||||||
void *private; /* For use by class driver */
|
void *priv; /* For use by class driver */
|
||||||
};
|
};
|
||||||
|
|
||||||
/* struct usbdev_s represents a usb device */
|
/* struct usbdev_s represents a usb device */
|
||||||
|
|||||||
+2
-2
@@ -1,7 +1,7 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* include/poll.h
|
* include/poll.h
|
||||||
*
|
*
|
||||||
* Copyright (C) 2008 Gregory Nutt. All rights reserved.
|
* Copyright (C) 2008-2009 Gregory Nutt. All rights reserved.
|
||||||
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
|
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
@@ -108,7 +108,7 @@ struct pollfd
|
|||||||
sem_t *sem; /* Pointer to semaphore used to post output event */
|
sem_t *sem; /* Pointer to semaphore used to post output event */
|
||||||
pollevent_t events; /* The input event flags */
|
pollevent_t events; /* The input event flags */
|
||||||
pollevent_t revents; /* The output event flags */
|
pollevent_t revents; /* The output event flags */
|
||||||
FAR void *private; /* For use by drivers */
|
FAR void *priv; /* For use by drivers */
|
||||||
};
|
};
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
|
|||||||
+5
-5
@@ -76,7 +76,7 @@ static inline int tcp_setup_callbacks(FAR struct socket *psock,
|
|||||||
FAR struct tcp_connect_s *pstate);
|
FAR struct tcp_connect_s *pstate);
|
||||||
static inline void tcp_teardown_callbacks(struct tcp_connect_s *pstate, int status);
|
static inline void tcp_teardown_callbacks(struct tcp_connect_s *pstate, int status);
|
||||||
static uint16 tcp_connect_interrupt(struct uip_driver_s *dev, void *pvconn,
|
static uint16 tcp_connect_interrupt(struct uip_driver_s *dev, void *pvconn,
|
||||||
void *pvprivate, uint16 flags);
|
void *pvpriv, uint16 flags);
|
||||||
#ifdef CONFIG_NET_IPv6
|
#ifdef CONFIG_NET_IPv6
|
||||||
static inline int tcp_connect(FAR struct socket *psock, const struct sockaddr_in6 *inaddr);
|
static inline int tcp_connect(FAR struct socket *psock, const struct sockaddr_in6 *inaddr);
|
||||||
#else
|
#else
|
||||||
@@ -161,7 +161,7 @@ static inline int tcp_setup_callbacks(FAR struct socket *psock,
|
|||||||
if (pstate->tc_cb)
|
if (pstate->tc_cb)
|
||||||
{
|
{
|
||||||
pstate->tc_cb->flags = UIP_NEWDATA|UIP_CLOSE|UIP_ABORT|UIP_TIMEDOUT|UIP_CONNECTED;
|
pstate->tc_cb->flags = UIP_NEWDATA|UIP_CLOSE|UIP_ABORT|UIP_TIMEDOUT|UIP_CONNECTED;
|
||||||
pstate->tc_cb->private = (void*)pstate;
|
pstate->tc_cb->priv = (void*)pstate;
|
||||||
pstate->tc_cb->event = tcp_connect_interrupt;
|
pstate->tc_cb->event = tcp_connect_interrupt;
|
||||||
|
|
||||||
/* Set up to receive callbacks on connection-related events */
|
/* Set up to receive callbacks on connection-related events */
|
||||||
@@ -223,13 +223,13 @@ static inline void tcp_teardown_callbacks(struct tcp_connect_s *pstate, int stat
|
|||||||
|
|
||||||
#ifdef CONFIG_NET_TCP
|
#ifdef CONFIG_NET_TCP
|
||||||
static uint16 tcp_connect_interrupt(struct uip_driver_s *dev, void *pvconn,
|
static uint16 tcp_connect_interrupt(struct uip_driver_s *dev, void *pvconn,
|
||||||
void *pvprivate, uint16 flags)
|
void *pvpriv, uint16 flags)
|
||||||
{
|
{
|
||||||
struct tcp_connect_s *pstate = (struct tcp_connect_s *)pvprivate;
|
struct tcp_connect_s *pstate = (struct tcp_connect_s *)pvpriv;
|
||||||
|
|
||||||
nvdbg("flags: %04x\n", flags);
|
nvdbg("flags: %04x\n", flags);
|
||||||
|
|
||||||
/* 'private' might be null in some race conditions (?) */
|
/* 'priv' might be null in some race conditions (?) */
|
||||||
|
|
||||||
if (pstate)
|
if (pstate)
|
||||||
{
|
{
|
||||||
|
|||||||
+4
-4
@@ -88,9 +88,9 @@ struct tcp_close_s
|
|||||||
|
|
||||||
#ifdef CONFIG_NET_TCP
|
#ifdef CONFIG_NET_TCP
|
||||||
static uint16 netclose_interrupt(struct uip_driver_s *dev, void *pvconn,
|
static uint16 netclose_interrupt(struct uip_driver_s *dev, void *pvconn,
|
||||||
void *pvprivate, uint16 flags)
|
void *pvpriv, uint16 flags)
|
||||||
{
|
{
|
||||||
struct tcp_close_s *pstate = (struct tcp_close_s *)pvprivate;
|
struct tcp_close_s *pstate = (struct tcp_close_s *)pvpriv;
|
||||||
|
|
||||||
nvdbg("flags: %04x\n", flags);
|
nvdbg("flags: %04x\n", flags);
|
||||||
|
|
||||||
@@ -105,7 +105,7 @@ static uint16 netclose_interrupt(struct uip_driver_s *dev, void *pvconn,
|
|||||||
/* The disconnection is complete */
|
/* The disconnection is complete */
|
||||||
|
|
||||||
pstate->cl_cb->flags = 0;
|
pstate->cl_cb->flags = 0;
|
||||||
pstate->cl_cb->private = NULL;
|
pstate->cl_cb->priv = NULL;
|
||||||
pstate->cl_cb->event = NULL;
|
pstate->cl_cb->event = NULL;
|
||||||
sem_post(&pstate->cl_sem);
|
sem_post(&pstate->cl_sem);
|
||||||
nvdbg("Resuming\n");
|
nvdbg("Resuming\n");
|
||||||
@@ -167,7 +167,7 @@ static inline void netclose_disconnect(FAR struct socket *psock)
|
|||||||
sem_init(&state.cl_sem, 0, 0);
|
sem_init(&state.cl_sem, 0, 0);
|
||||||
|
|
||||||
state.cl_cb->flags = UIP_NEWDATA|UIP_POLL|UIP_CLOSE|UIP_ABORT;
|
state.cl_cb->flags = UIP_NEWDATA|UIP_POLL|UIP_CLOSE|UIP_ABORT;
|
||||||
state.cl_cb->private = (void*)&state;
|
state.cl_cb->priv = (void*)&state;
|
||||||
state.cl_cb->event = netclose_interrupt;
|
state.cl_cb->event = netclose_interrupt;
|
||||||
|
|
||||||
/* Notify the device driver of the availaibilty of TX data */
|
/* Notify the device driver of the availaibilty of TX data */
|
||||||
|
|||||||
+9
-9
@@ -1,7 +1,7 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* net/net_poll.c
|
* net/net_poll.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 2008 Gregory Nutt. All rights reserved.
|
* Copyright (C) 2008-2009 Gregory Nutt. All rights reserved.
|
||||||
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
|
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
@@ -102,13 +102,13 @@
|
|||||||
|
|
||||||
#ifdef HAVE_NETPOLL
|
#ifdef HAVE_NETPOLL
|
||||||
static uint16 poll_interrupt(struct uip_driver_s *dev, FAR void *conn,
|
static uint16 poll_interrupt(struct uip_driver_s *dev, FAR void *conn,
|
||||||
FAR void *pvprivate, uint16 flags)
|
FAR void *pvpriv, uint16 flags)
|
||||||
{
|
{
|
||||||
FAR struct pollfd *fds = (FAR struct pollfd *)pvprivate;
|
FAR struct pollfd *fds = (FAR struct pollfd *)pvpriv;
|
||||||
|
|
||||||
nvdbg("flags: %04x\n", flags);
|
nvdbg("flags: %04x\n", flags);
|
||||||
|
|
||||||
/* 'private' might be null in some race conditions (?) */
|
/* 'priv' might be null in some race conditions (?) */
|
||||||
|
|
||||||
if (fds)
|
if (fds)
|
||||||
{
|
{
|
||||||
@@ -194,12 +194,12 @@ static inline int net_pollsetup(FAR struct socket *psock, struct pollfd *fds)
|
|||||||
/* Initialize the callbcack structure */
|
/* Initialize the callbcack structure */
|
||||||
|
|
||||||
cb->flags = UIP_NEWDATA|UIP_BACKLOG|UIP_POLL|UIP_CLOSE|UIP_ABORT|UIP_TIMEDOUT;
|
cb->flags = UIP_NEWDATA|UIP_BACKLOG|UIP_POLL|UIP_CLOSE|UIP_ABORT|UIP_TIMEDOUT;
|
||||||
cb->private = (FAR void *)fds;
|
cb->priv = (FAR void *)fds;
|
||||||
cb->event = poll_interrupt;
|
cb->event = poll_interrupt;
|
||||||
|
|
||||||
/* Save the nps reference in the poll structure for use at teardown as well */
|
/* Save the nps reference in the poll structure for use at teardown as well */
|
||||||
|
|
||||||
fds->private = (FAR void *)cb;
|
fds->priv = (FAR void *)cb;
|
||||||
|
|
||||||
/* Check for read data availability now */
|
/* Check for read data availability now */
|
||||||
|
|
||||||
@@ -246,7 +246,7 @@ static inline int net_pollteardown(FAR struct socket *psock, struct pollfd *fds)
|
|||||||
/* Sanity check */
|
/* Sanity check */
|
||||||
|
|
||||||
#ifdef CONFIG_DEBUG
|
#ifdef CONFIG_DEBUG
|
||||||
if (!conn || !fds->private)
|
if (!conn || !fds->priv)
|
||||||
{
|
{
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
@@ -254,7 +254,7 @@ static inline int net_pollteardown(FAR struct socket *psock, struct pollfd *fds)
|
|||||||
|
|
||||||
/* Recover the socket descriptor poll state info from the poll structure */
|
/* Recover the socket descriptor poll state info from the poll structure */
|
||||||
|
|
||||||
cb = (FAR struct uip_callback_s *)fds->private;
|
cb = (FAR struct uip_callback_s *)fds->priv;
|
||||||
if (cb)
|
if (cb)
|
||||||
{
|
{
|
||||||
/* Release the callback */
|
/* Release the callback */
|
||||||
@@ -265,7 +265,7 @@ static inline int net_pollteardown(FAR struct socket *psock, struct pollfd *fds)
|
|||||||
|
|
||||||
/* Release the poll/select data slot */
|
/* Release the poll/select data slot */
|
||||||
|
|
||||||
fds->private = NULL;
|
fds->priv = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
return OK;
|
return OK;
|
||||||
|
|||||||
+14
-14
@@ -359,13 +359,13 @@ static inline void recvfrom_tcpsender(struct uip_driver_s *dev, struct recvfrom_
|
|||||||
|
|
||||||
#ifdef CONFIG_NET_TCP
|
#ifdef CONFIG_NET_TCP
|
||||||
static uint16 recvfrom_tcpinterrupt(struct uip_driver_s *dev, void *conn,
|
static uint16 recvfrom_tcpinterrupt(struct uip_driver_s *dev, void *conn,
|
||||||
void *pvprivate, uint16 flags)
|
void *pvpriv, uint16 flags)
|
||||||
{
|
{
|
||||||
struct recvfrom_s *pstate = (struct recvfrom_s *)pvprivate;
|
struct recvfrom_s *pstate = (struct recvfrom_s *)pvpriv;
|
||||||
|
|
||||||
nvdbg("flags: %04x\n", flags);
|
nvdbg("flags: %04x\n", flags);
|
||||||
|
|
||||||
/* 'private' might be null in some race conditions (?) */
|
/* 'priv' might be null in some race conditions (?) */
|
||||||
|
|
||||||
if (pstate)
|
if (pstate)
|
||||||
{
|
{
|
||||||
@@ -400,7 +400,7 @@ static uint16 recvfrom_tcpinterrupt(struct uip_driver_s *dev, void *conn,
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
pstate->rf_cb->flags = 0;
|
pstate->rf_cb->flags = 0;
|
||||||
pstate->rf_cb->private = NULL;
|
pstate->rf_cb->priv = NULL;
|
||||||
pstate->rf_cb->event = NULL;
|
pstate->rf_cb->event = NULL;
|
||||||
|
|
||||||
/* Wake up the waiting thread, returning the number of bytes
|
/* Wake up the waiting thread, returning the number of bytes
|
||||||
@@ -428,7 +428,7 @@ static uint16 recvfrom_tcpinterrupt(struct uip_driver_s *dev, void *conn,
|
|||||||
/* Stop further callbacks */
|
/* Stop further callbacks */
|
||||||
|
|
||||||
pstate->rf_cb->flags = 0;
|
pstate->rf_cb->flags = 0;
|
||||||
pstate->rf_cb->private = NULL;
|
pstate->rf_cb->priv = NULL;
|
||||||
pstate->rf_cb->event = NULL;
|
pstate->rf_cb->event = NULL;
|
||||||
|
|
||||||
/* Report not connected */
|
/* Report not connected */
|
||||||
@@ -454,7 +454,7 @@ static uint16 recvfrom_tcpinterrupt(struct uip_driver_s *dev, void *conn,
|
|||||||
nvdbg("TCP timeout\n");
|
nvdbg("TCP timeout\n");
|
||||||
|
|
||||||
pstate->rf_cb->flags = 0;
|
pstate->rf_cb->flags = 0;
|
||||||
pstate->rf_cb->private = NULL;
|
pstate->rf_cb->priv = NULL;
|
||||||
pstate->rf_cb->event = NULL;
|
pstate->rf_cb->event = NULL;
|
||||||
|
|
||||||
/* Report an error only if no data has been received */
|
/* Report an error only if no data has been received */
|
||||||
@@ -542,13 +542,13 @@ static inline void recvfrom_udpsender(struct uip_driver_s *dev, struct recvfrom_
|
|||||||
|
|
||||||
#ifdef CONFIG_NET_UDP
|
#ifdef CONFIG_NET_UDP
|
||||||
static uint16 recvfrom_udpinterrupt(struct uip_driver_s *dev, void *pvconn,
|
static uint16 recvfrom_udpinterrupt(struct uip_driver_s *dev, void *pvconn,
|
||||||
void *pvprivate, uint16 flags)
|
void *pvpriv, uint16 flags)
|
||||||
{
|
{
|
||||||
struct recvfrom_s *pstate = (struct recvfrom_s *)pvprivate;
|
struct recvfrom_s *pstate = (struct recvfrom_s *)pvpriv;
|
||||||
|
|
||||||
nvdbg("flags: %04x\n", flags);
|
nvdbg("flags: %04x\n", flags);
|
||||||
|
|
||||||
/* 'private' might be null in some race conditions (?) */
|
/* 'priv' might be null in some race conditions (?) */
|
||||||
|
|
||||||
if (pstate)
|
if (pstate)
|
||||||
{
|
{
|
||||||
@@ -567,7 +567,7 @@ static uint16 recvfrom_udpinterrupt(struct uip_driver_s *dev, void *pvconn,
|
|||||||
/* Don't allow any further UDP call backs. */
|
/* Don't allow any further UDP call backs. */
|
||||||
|
|
||||||
pstate->rf_cb->flags = 0;
|
pstate->rf_cb->flags = 0;
|
||||||
pstate->rf_cb->private = NULL;
|
pstate->rf_cb->priv = NULL;
|
||||||
pstate->rf_cb->event = NULL;
|
pstate->rf_cb->event = NULL;
|
||||||
|
|
||||||
/* Save the sender's address in the caller's 'from' location */
|
/* Save the sender's address in the caller's 'from' location */
|
||||||
@@ -594,7 +594,7 @@ static uint16 recvfrom_udpinterrupt(struct uip_driver_s *dev, void *pvconn,
|
|||||||
/* Stop further callbacks */
|
/* Stop further callbacks */
|
||||||
|
|
||||||
pstate->rf_cb->flags = 0;
|
pstate->rf_cb->flags = 0;
|
||||||
pstate->rf_cb->private = NULL;
|
pstate->rf_cb->priv = NULL;
|
||||||
pstate->rf_cb->event = NULL;
|
pstate->rf_cb->event = NULL;
|
||||||
|
|
||||||
/* Report not connected */
|
/* Report not connected */
|
||||||
@@ -622,7 +622,7 @@ static uint16 recvfrom_udpinterrupt(struct uip_driver_s *dev, void *pvconn,
|
|||||||
/* Stop further callbacks */
|
/* Stop further callbacks */
|
||||||
|
|
||||||
pstate->rf_cb->flags = 0;
|
pstate->rf_cb->flags = 0;
|
||||||
pstate->rf_cb->private = NULL;
|
pstate->rf_cb->priv = NULL;
|
||||||
pstate->rf_cb->event = NULL;
|
pstate->rf_cb->event = NULL;
|
||||||
|
|
||||||
/* Report a timeout error */
|
/* Report a timeout error */
|
||||||
@@ -795,7 +795,7 @@ static ssize_t udp_recvfrom(FAR struct socket *psock, FAR void *buf, size_t len,
|
|||||||
/* Set up the callback in the connection */
|
/* Set up the callback in the connection */
|
||||||
|
|
||||||
state.rf_cb->flags = UIP_NEWDATA|UIP_POLL|UIP_CLOSE|UIP_ABORT|UIP_TIMEDOUT;
|
state.rf_cb->flags = UIP_NEWDATA|UIP_POLL|UIP_CLOSE|UIP_ABORT|UIP_TIMEDOUT;
|
||||||
state.rf_cb->private = (void*)&state;
|
state.rf_cb->priv = (void*)&state;
|
||||||
state.rf_cb->event = recvfrom_udpinterrupt;
|
state.rf_cb->event = recvfrom_udpinterrupt;
|
||||||
|
|
||||||
/* Enable the UDP socket */
|
/* Enable the UDP socket */
|
||||||
@@ -898,7 +898,7 @@ static ssize_t tcp_recvfrom(FAR struct socket *psock, FAR void *buf, size_t len,
|
|||||||
if (state.rf_cb)
|
if (state.rf_cb)
|
||||||
{
|
{
|
||||||
state.rf_cb->flags = UIP_NEWDATA|UIP_POLL|UIP_CLOSE|UIP_ABORT|UIP_TIMEDOUT;
|
state.rf_cb->flags = UIP_NEWDATA|UIP_POLL|UIP_CLOSE|UIP_ABORT|UIP_TIMEDOUT;
|
||||||
state.rf_cb->private = (void*)&state;
|
state.rf_cb->priv = (void*)&state;
|
||||||
state.rf_cb->event = recvfrom_tcpinterrupt;
|
state.rf_cb->event = recvfrom_tcpinterrupt;
|
||||||
|
|
||||||
/* Wait for either the receive to complete or for an error/timeout to occur.
|
/* Wait for either the receive to complete or for an error/timeout to occur.
|
||||||
|
|||||||
+5
-5
@@ -1,7 +1,7 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* net/send.c
|
* net/send.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 2007, 2008 Gregory Nutt. All rights reserved.
|
* Copyright (C) 2007-2009 Gregory Nutt. All rights reserved.
|
||||||
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
|
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
@@ -196,10 +196,10 @@ static inline int send_timeout(struct send_s *pstate)
|
|||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
static uint16 send_interrupt(struct uip_driver_s *dev, void *pvconn,
|
static uint16 send_interrupt(struct uip_driver_s *dev, void *pvconn,
|
||||||
void *pvprivate, uint16 flags)
|
void *pvpriv, uint16 flags)
|
||||||
{
|
{
|
||||||
struct uip_conn *conn = (struct uip_conn*)pvconn;
|
struct uip_conn *conn = (struct uip_conn*)pvconn;
|
||||||
struct send_s *pstate = (struct send_s *)pvprivate;
|
struct send_s *pstate = (struct send_s *)pvpriv;
|
||||||
|
|
||||||
nvdbg("flags: %04x acked: %d sent: %d\n", flags, pstate->snd_acked, pstate->snd_sent);
|
nvdbg("flags: %04x acked: %d sent: %d\n", flags, pstate->snd_acked, pstate->snd_sent);
|
||||||
|
|
||||||
@@ -328,7 +328,7 @@ end_wait:
|
|||||||
/* Do not allow any further callbacks */
|
/* Do not allow any further callbacks */
|
||||||
|
|
||||||
pstate->snd_cb->flags = 0;
|
pstate->snd_cb->flags = 0;
|
||||||
pstate->snd_cb->private = NULL;
|
pstate->snd_cb->priv = NULL;
|
||||||
pstate->snd_cb->event = NULL;
|
pstate->snd_cb->event = NULL;
|
||||||
|
|
||||||
/* Wake up the waiting thread */
|
/* Wake up the waiting thread */
|
||||||
@@ -468,7 +468,7 @@ ssize_t send(int sockfd, const void *buf, size_t len, int flags)
|
|||||||
/* Set up the callback in the connection */
|
/* Set up the callback in the connection */
|
||||||
|
|
||||||
state.snd_cb->flags = UIP_ACKDATA|UIP_REXMIT|UIP_POLL|UIP_CLOSE|UIP_ABORT|UIP_TIMEDOUT;
|
state.snd_cb->flags = UIP_ACKDATA|UIP_REXMIT|UIP_POLL|UIP_CLOSE|UIP_ABORT|UIP_TIMEDOUT;
|
||||||
state.snd_cb->private = (void*)&state;
|
state.snd_cb->priv = (void*)&state;
|
||||||
state.snd_cb->event = send_interrupt;
|
state.snd_cb->event = send_interrupt;
|
||||||
|
|
||||||
/* Notify the device driver of the availaibilty of TX data */
|
/* Notify the device driver of the availaibilty of TX data */
|
||||||
|
|||||||
+6
-6
@@ -1,7 +1,7 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* net/sendto.c
|
* net/sendto.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 2007, 2008 Gregory Nutt. All rights reserved.
|
* Copyright (C) 2007-2009 Gregory Nutt. All rights reserved.
|
||||||
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
|
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
@@ -82,7 +82,7 @@ struct sendto_s
|
|||||||
* Parameters:
|
* Parameters:
|
||||||
* dev The sructure of the network driver that caused the interrupt
|
* dev The sructure of the network driver that caused the interrupt
|
||||||
* conn An instance of the UDP connection structure cast to void *
|
* conn An instance of the UDP connection structure cast to void *
|
||||||
* pvprivate An instance of struct sendto_s cast to void*
|
* pvpriv An instance of struct sendto_s cast to void*
|
||||||
* flags Set of events describing why the callback was invoked
|
* flags Set of events describing why the callback was invoked
|
||||||
*
|
*
|
||||||
* Returned Value:
|
* Returned Value:
|
||||||
@@ -94,9 +94,9 @@ struct sendto_s
|
|||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#ifdef CONFIG_NET_UDP
|
#ifdef CONFIG_NET_UDP
|
||||||
static uint16 sendto_interrupt(struct uip_driver_s *dev, void *conn, void *pvprivate, uint16 flags)
|
static uint16 sendto_interrupt(struct uip_driver_s *dev, void *conn, void *pvpriv, uint16 flags)
|
||||||
{
|
{
|
||||||
struct sendto_s *pstate = (struct sendto_s *)pvprivate;
|
struct sendto_s *pstate = (struct sendto_s *)pvpriv;
|
||||||
|
|
||||||
nvdbg("flags: %04x\n", flags);
|
nvdbg("flags: %04x\n", flags);
|
||||||
if (pstate)
|
if (pstate)
|
||||||
@@ -138,7 +138,7 @@ static uint16 sendto_interrupt(struct uip_driver_s *dev, void *conn, void *pvpri
|
|||||||
/* Don't allow any further call backs. */
|
/* Don't allow any further call backs. */
|
||||||
|
|
||||||
pstate->st_cb->flags = 0;
|
pstate->st_cb->flags = 0;
|
||||||
pstate->st_cb->private = NULL;
|
pstate->st_cb->priv = NULL;
|
||||||
pstate->st_cb->event = NULL;
|
pstate->st_cb->event = NULL;
|
||||||
|
|
||||||
/* Wake up the waiting thread */
|
/* Wake up the waiting thread */
|
||||||
@@ -315,7 +315,7 @@ ssize_t sendto(int sockfd, const void *buf, size_t len, int flags,
|
|||||||
if (state.st_cb)
|
if (state.st_cb)
|
||||||
{
|
{
|
||||||
state.st_cb->flags = UIP_POLL|UIP_CLOSE|UIP_ABORT|UIP_TIMEDOUT;
|
state.st_cb->flags = UIP_POLL|UIP_CLOSE|UIP_ABORT|UIP_TIMEDOUT;
|
||||||
state.st_cb->private = (void*)&state;
|
state.st_cb->priv = (void*)&state;
|
||||||
state.st_cb->event = sendto_interrupt;
|
state.st_cb->event = sendto_interrupt;
|
||||||
|
|
||||||
/* Enable the UDP socket */
|
/* Enable the UDP socket */
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* net/uip/uip_callback.c
|
* net/uip/uip_callback.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 2008 Gregory Nutt. All rights reserved.
|
* Copyright (C) 2008-2009 Gregory Nutt. All rights reserved.
|
||||||
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
|
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
@@ -236,7 +236,7 @@ uint16 uip_callbackexecute(FAR struct uip_driver_s *dev, void *pvconn, uint16 fl
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
nvdbg("Call event=%p with flags=%04x\n", list->event, flags);
|
nvdbg("Call event=%p with flags=%04x\n", list->event, flags);
|
||||||
flags = list->event(dev, pvconn, list->private, flags);
|
flags = list->event(dev, pvconn, list->priv, flags);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Set up for the next time through the loop */
|
/* Set up for the next time through the loop */
|
||||||
|
|||||||
@@ -134,7 +134,7 @@ static inline int ping_timeout(struct icmp_ping_s *pstate)
|
|||||||
* Parameters:
|
* Parameters:
|
||||||
* dev The structure of the network driver that caused the interrupt
|
* dev The structure of the network driver that caused the interrupt
|
||||||
* conn The received packet, cast to void *
|
* conn The received packet, cast to void *
|
||||||
* pvprivate An instance of struct icmp_ping_s cast to void*
|
* pvpriv An instance of struct icmp_ping_s cast to void*
|
||||||
* flags Set of events describing why the callback was invoked
|
* flags Set of events describing why the callback was invoked
|
||||||
*
|
*
|
||||||
* Returned Value:
|
* Returned Value:
|
||||||
@@ -146,9 +146,9 @@ static inline int ping_timeout(struct icmp_ping_s *pstate)
|
|||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
static uint16 ping_interrupt(struct uip_driver_s *dev, void *conn,
|
static uint16 ping_interrupt(struct uip_driver_s *dev, void *conn,
|
||||||
void *pvprivate, uint16 flags)
|
void *pvpriv, uint16 flags)
|
||||||
{
|
{
|
||||||
struct icmp_ping_s *pstate = (struct icmp_ping_s *)pvprivate;
|
struct icmp_ping_s *pstate = (struct icmp_ping_s *)pvpriv;
|
||||||
ubyte *ptr;
|
ubyte *ptr;
|
||||||
int failcode = -ETIMEDOUT;
|
int failcode = -ETIMEDOUT;
|
||||||
int i;
|
int i;
|
||||||
@@ -269,7 +269,7 @@ end_wait:
|
|||||||
/* Do not allow any further callbacks */
|
/* Do not allow any further callbacks */
|
||||||
|
|
||||||
pstate->png_cb->flags = 0;
|
pstate->png_cb->flags = 0;
|
||||||
pstate->png_cb->private = NULL;
|
pstate->png_cb->priv = NULL;
|
||||||
pstate->png_cb->event = NULL;
|
pstate->png_cb->event = NULL;
|
||||||
|
|
||||||
/* Wake up the waiting thread */
|
/* Wake up the waiting thread */
|
||||||
@@ -334,7 +334,7 @@ int uip_ping(uip_ipaddr_t addr, uint16 id, uint16 seqno, uint16 datalen, int dse
|
|||||||
if (state.png_cb)
|
if (state.png_cb)
|
||||||
{
|
{
|
||||||
state.png_cb->flags = UIP_POLL|UIP_ECHOREPLY;
|
state.png_cb->flags = UIP_POLL|UIP_ECHOREPLY;
|
||||||
state.png_cb->private = (void*)&state;
|
state.png_cb->priv = (void*)&state;
|
||||||
state.png_cb->event = ping_interrupt;
|
state.png_cb->event = ping_interrupt;
|
||||||
state.png_result = -EINTR; /* Assume sem-wait interrupted by signal */
|
state.png_result = -EINTR; /* Assume sem-wait interrupted by signal */
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user