1
0
Fork 0
forked from nuttx/nuttx-update

Update and move ieee802154.h socket header file. Fix some comments in net/pkt.

This commit is contained in:
Gregory Nutt 2017-08-18 07:08:02 -06:00
parent 50e2e08742
commit d7c90ae71b
4 changed files with 47 additions and 23 deletions

View file

@ -33,8 +33,8 @@
*
****************************************************************************/
#ifndef __INCLUDE_NET_IEEE802154_H
#define __INCLUDE_NET_IEEE802154_H
#ifndef __INCLUDE_NETPACKET_IEEE802154_H
#define __INCLUDE_NETPACKET_IEEE802154_H
/****************************************************************************
* Included Files
@ -85,13 +85,12 @@ struct ieee802154_addr_s
* bind() - Associates local address with socket
* connect() - Associates a remote address with the socket (for send())
* sendto() - Send to specified remote address
* recvfrom()- Receive from specified remote address.
* recvfrom()- Receive from indicated remote address.
*/
struct sockaddr_ieee802154_s
{
sa_family_t sa_family; /* AF_IEEE802154 */
uint8_t sa_msdu_handle; /* Data carried with MSDU */
struct ieee802154_addr_s sa_addr; /* Radio address */
};
@ -99,4 +98,4 @@ struct sockaddr_ieee802154_s
* Public Function Prototypes
****************************************************************************/
#endif /* __INCLUDE_NET_IEEE802154_H */
#endif /* __INCLUDE_NETPACKET_IEEE802154_H */

View file

@ -59,10 +59,30 @@
/****************************************************************************
* Public Function Prototypes
****************************************************************************/
/* This function provides the interface between Ethernet device drivers and
* packet socket logic. All frames that are received should be provided to
* pkt_input() prior to other routing.
*/
/****************************************************************************
* Name: pkt_input
*
* Description:
* Handle incoming packet input
*
* This function provides the interface between Ethernet device drivers and
* packet socket logic. All frames that are received should be provided to
* pkt_input() prior to other routing.
*
* Parameters:
* dev - The device driver structure containing the received packet
*
* Return:
* OK The packet has been processed and can be deleted
* ERROR There is a matching connection, but could not dispatch the packet
* yet. Useful when a packet arrives before a recv call is in
* place.
*
* Assumptions:
* Called from the network diver with the network locked.
*
****************************************************************************/
struct net_driver_s; /* Forward reference */
int pkt_input(FAR struct net_driver_s *dev);

View file

@ -115,7 +115,7 @@ struct socket; /* Forward reference */
void pkt_initialize(void);
/****************************************************************************
* Name: pkt_palloc()
* Name: pkt_alloc()
*
* Description:
* Allocate a new, uninitialized packet socket connection structure. This
@ -144,11 +144,11 @@ void pkt_free(FAR struct pkt_conn_s *conn);
* connection to be used with the provided Ethernet header
*
* Assumptions:
* This function is called from UIP logic at interrupt level
* This function is called from network logic at with the network locked.
*
****************************************************************************/
struct pkt_conn_s *pkt_active(FAR struct eth_hdr_s *buf);
FAR struct pkt_conn_s *pkt_active(FAR struct eth_hdr_s *buf);
/****************************************************************************
* Name: pkt_nextconn()
@ -157,12 +157,11 @@ struct pkt_conn_s *pkt_active(FAR struct eth_hdr_s *buf);
* Traverse the list of allocated packet connections
*
* Assumptions:
* This function is called from UIP logic at interrupt level (or with
* interrupts disabled).
* This function is called from network logic at with the network locked.
*
****************************************************************************/
struct pkt_conn_s *pkt_nextconn(FAR struct pkt_conn_s *conn);
FAR struct pkt_conn_s *pkt_nextconn(FAR struct pkt_conn_s *conn);
/****************************************************************************
* Name: pkt_callback
@ -174,7 +173,7 @@ struct pkt_conn_s *pkt_nextconn(FAR struct pkt_conn_s *conn);
* OK if packet has been processed, otherwise ERROR.
*
* Assumptions:
* This function is called at the interrupt level with interrupts disabled.
* This function is called from network logic at with the network locked.
*
****************************************************************************/
@ -187,16 +186,21 @@ uint16_t pkt_callback(FAR struct net_driver_s *dev,
* Description:
* Handle incoming packet input
*
* This function provides the interface between Ethernet device drivers and
* packet socket logic. All frames that are received should be provided to
* pkt_input() prior to other routing.
*
* Parameters:
* dev - The device driver structure containing the received packet
*
* Return:
* OK The packet has been processed and can be deleted
* ERROR Hold the packet and try again later. There is a listening socket
* but no recv in place to catch the packet yet.
* OK The packet has been processed and can be deleted
* ERROR There is a matching connection, but could not dispatch the packet
* yet. Useful when a packet arrives before a recv call is in
* place.
*
* Assumptions:
* Called from the interrupt level or with interrupts disabled.
* Called from the network diver with the network locked.
*
****************************************************************************/
@ -267,7 +271,8 @@ FAR struct net_driver_s *pkt_find_device(FAR struct pkt_conn_s *conn);
* None
*
* Assumptions:
* Called from the interrupt level or with interrupts disabled.
* Called from the network device interface (devif) with the network
* locked.
*
****************************************************************************/

View file

@ -76,8 +76,8 @@
* Return:
* OK The packet has been processed and can be deleted
* ERROR There is a matching connection, but could not dispatch the packet
* yet. Currently useful for UDP when a packet arrives before a recv
* call is in place.
* yet. Useful when a packet arrives before a recv call is in
* place.
*
* Assumptions:
* Called from the interrupt level or with interrupts disabled.