Costmetic changes
This commit is contained in:
parent
b1e09d4847
commit
63071a563a
@ -163,6 +163,24 @@ static uint16_t connection_event(FAR struct net_driver_s *dev,
|
|||||||
|
|
||||||
else if ((flags & TCP_CONNECTED) != 0)
|
else if ((flags & TCP_CONNECTED) != 0)
|
||||||
{
|
{
|
||||||
|
#if 0 /* REVISIT: Assertion fires. Why? */
|
||||||
|
#ifdef CONFIG_NETDEV_MULTINIC
|
||||||
|
FAR struct tcp_conn_s *conn = (FAR struct tcp_conn_s *)psock->s_conn;
|
||||||
|
|
||||||
|
/* Make sure that this is the device bound to the connection */
|
||||||
|
|
||||||
|
DEBUGASSERT(conn->dev == NULL || conn->dev == dev);
|
||||||
|
conn->dev = dev;
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* If there is no local address assigned to the socket (perhaps
|
||||||
|
* because it was INADDR_ANY), then assign it the address of the
|
||||||
|
* connecting device.
|
||||||
|
*
|
||||||
|
* TODO: Implement this.
|
||||||
|
*/
|
||||||
|
|
||||||
/* Indicate that the socket is now connected */
|
/* Indicate that the socket is now connected */
|
||||||
|
|
||||||
psock->s_flags |= _SF_CONNECTED;
|
psock->s_flags |= _SF_CONNECTED;
|
||||||
|
@ -157,7 +157,7 @@ static inline void recvfrom_add_recvlen(FAR struct recvfrom_s *pstate,
|
|||||||
* The number of bytes taken from the packet.
|
* The number of bytes taken from the packet.
|
||||||
*
|
*
|
||||||
* Assumptions:
|
* Assumptions:
|
||||||
* Running at the interrupt level
|
* The network is locked.
|
||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
@ -205,7 +205,7 @@ static size_t recvfrom_newdata(FAR struct net_driver_s *dev,
|
|||||||
* None.
|
* None.
|
||||||
*
|
*
|
||||||
* Assumptions:
|
* Assumptions:
|
||||||
* Running at the interrupt level
|
* The network is locked.
|
||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
@ -249,7 +249,7 @@ static void recvfrom_newpktdata(FAR struct net_driver_s *dev,
|
|||||||
* None.
|
* None.
|
||||||
*
|
*
|
||||||
* Assumptions:
|
* Assumptions:
|
||||||
* Running at the interrupt level
|
* The network is locked.
|
||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
@ -321,7 +321,7 @@ static inline void recvfrom_newtcpdata(FAR struct net_driver_s *dev,
|
|||||||
* None.
|
* None.
|
||||||
*
|
*
|
||||||
* Assumptions:
|
* Assumptions:
|
||||||
* Running at the interrupt level
|
* The network is locked.
|
||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
@ -353,7 +353,7 @@ static inline void recvfrom_newudpdata(FAR struct net_driver_s *dev,
|
|||||||
* None
|
* None
|
||||||
*
|
*
|
||||||
* Assumptions:
|
* Assumptions:
|
||||||
* Running at the interrupt level
|
* The network is locked.
|
||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
@ -520,7 +520,7 @@ out:
|
|||||||
* TRUE:timeout FALSE:no timeout
|
* TRUE:timeout FALSE:no timeout
|
||||||
*
|
*
|
||||||
* Assumptions:
|
* Assumptions:
|
||||||
* Running at the interrupt level
|
* The network is locked.
|
||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
@ -616,7 +616,7 @@ static inline void recvfrom_pktsender(FAR struct net_driver_s *dev,
|
|||||||
|
|
||||||
#ifdef CONFIG_NET_PKT
|
#ifdef CONFIG_NET_PKT
|
||||||
static uint16_t recvfrom_pktinterrupt(FAR struct net_driver_s *dev,
|
static uint16_t recvfrom_pktinterrupt(FAR struct net_driver_s *dev,
|
||||||
FAR void *conn, FAR void *pvpriv,
|
FAR void *pvconn, FAR void *pvpriv,
|
||||||
uint16_t flags)
|
uint16_t flags)
|
||||||
{
|
{
|
||||||
struct recvfrom_s *pstate = (struct recvfrom_s *)pvpriv;
|
struct recvfrom_s *pstate = (struct recvfrom_s *)pvpriv;
|
||||||
@ -744,24 +744,40 @@ static inline void recvfrom_tcpsender(FAR struct net_driver_s *dev,
|
|||||||
*
|
*
|
||||||
* 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 connection structure associated with the socket
|
* pvconn The connection structure associated with the socket
|
||||||
* flags Set of events describing why the callback was invoked
|
* flags Set of events describing why the callback was invoked
|
||||||
*
|
*
|
||||||
* Returned Value:
|
* Returned Value:
|
||||||
* None
|
* None
|
||||||
*
|
*
|
||||||
* Assumptions:
|
* Assumptions:
|
||||||
* Running at the interrupt level
|
* The network is locked.
|
||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#ifdef CONFIG_NET_TCP
|
#ifdef CONFIG_NET_TCP
|
||||||
static uint16_t recvfrom_tcpinterrupt(FAR struct net_driver_s *dev,
|
static uint16_t recvfrom_tcpinterrupt(FAR struct net_driver_s *dev,
|
||||||
FAR void *conn, FAR void *pvpriv,
|
FAR void *pvconn, FAR void *pvpriv,
|
||||||
uint16_t flags)
|
uint16_t flags)
|
||||||
{
|
{
|
||||||
FAR struct recvfrom_s *pstate = (struct recvfrom_s *)pvpriv;
|
FAR struct recvfrom_s *pstate = (struct recvfrom_s *)pvpriv;
|
||||||
|
|
||||||
|
#if 0 /* REVISIT: The assertion fires. Why? */
|
||||||
|
#ifdef CONFIG_NETDEV_MULTINIC
|
||||||
|
FAR struct tcp_conn_s *conn = (FAR struct tcp_conn_s *)pvconn;
|
||||||
|
|
||||||
|
/* The TCP socket is connected and, hence, should be bound to a device.
|
||||||
|
* Make sure that the polling device is the own that we are bound to.
|
||||||
|
*/
|
||||||
|
|
||||||
|
DEBUGASSERT(conn->dev == NULL || conn->dev == dev);
|
||||||
|
if (conn->dev != NULL && conn->dev != dev)
|
||||||
|
{
|
||||||
|
return flags;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
nllvdbg("flags: %04x\n", flags);
|
nllvdbg("flags: %04x\n", flags);
|
||||||
|
|
||||||
/* 'priv' might be null in some race conditions (?) */
|
/* 'priv' might be null in some race conditions (?) */
|
||||||
@ -956,7 +972,7 @@ static uint16_t recvfrom_tcpinterrupt(FAR struct net_driver_s *dev,
|
|||||||
* None
|
* None
|
||||||
*
|
*
|
||||||
* Assumptions:
|
* Assumptions:
|
||||||
* Running at the interrupt level
|
* The network is locked.
|
||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
@ -1049,7 +1065,8 @@ static inline void recvfrom_udpsender(struct net_driver_s *dev, struct recvfrom_
|
|||||||
* Terminate the UDP transfer.
|
* Terminate the UDP transfer.
|
||||||
*
|
*
|
||||||
* Parameters:
|
* Parameters:
|
||||||
* conn The connection structure associated with the socket
|
* pstate - The recvfrom state structure
|
||||||
|
* result - The result of the operation
|
||||||
*
|
*
|
||||||
* Returned Value:
|
* Returned Value:
|
||||||
* None
|
* None
|
||||||
@ -1086,14 +1103,14 @@ static void recvfrom_udp_terminate(FAR struct recvfrom_s *pstate, int result)
|
|||||||
*
|
*
|
||||||
* 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 connection structure associated with the socket
|
* pvconn The connection structure associated with the socket
|
||||||
* flags Set of events describing why the callback was invoked
|
* flags Set of events describing why the callback was invoked
|
||||||
*
|
*
|
||||||
* Returned Value:
|
* Returned Value:
|
||||||
* None
|
* None
|
||||||
*
|
*
|
||||||
* Assumptions:
|
* Assumptions:
|
||||||
* Running at the interrupt level
|
* The network is locked.
|
||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
|
@ -243,7 +243,7 @@ bool tcp_islistener(uint16_t portno)
|
|||||||
* Accept the new connection for the specified listening port.
|
* Accept the new connection for the specified listening port.
|
||||||
*
|
*
|
||||||
* Assumptions:
|
* Assumptions:
|
||||||
* Called at interrupt level
|
* Called with the network locked.
|
||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user