forked from nuttx/nuttx-update
Update and move ieee802154.h socket header file. Fix some comments in net/pkt.
This commit is contained in:
parent
50e2e08742
commit
d7c90ae71b
4 changed files with 47 additions and 23 deletions
|
@ -33,8 +33,8 @@
|
||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#ifndef __INCLUDE_NET_IEEE802154_H
|
#ifndef __INCLUDE_NETPACKET_IEEE802154_H
|
||||||
#define __INCLUDE_NET_IEEE802154_H
|
#define __INCLUDE_NETPACKET_IEEE802154_H
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Included Files
|
* Included Files
|
||||||
|
@ -85,13 +85,12 @@ struct ieee802154_addr_s
|
||||||
* bind() - Associates local address with socket
|
* bind() - Associates local address with socket
|
||||||
* connect() - Associates a remote address with the socket (for send())
|
* connect() - Associates a remote address with the socket (for send())
|
||||||
* sendto() - Send to specified remote address
|
* sendto() - Send to specified remote address
|
||||||
* recvfrom()- Receive from specified remote address.
|
* recvfrom()- Receive from indicated remote address.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
struct sockaddr_ieee802154_s
|
struct sockaddr_ieee802154_s
|
||||||
{
|
{
|
||||||
sa_family_t sa_family; /* AF_IEEE802154 */
|
sa_family_t sa_family; /* AF_IEEE802154 */
|
||||||
uint8_t sa_msdu_handle; /* Data carried with MSDU */
|
|
||||||
struct ieee802154_addr_s sa_addr; /* Radio address */
|
struct ieee802154_addr_s sa_addr; /* Radio address */
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -99,4 +98,4 @@ struct sockaddr_ieee802154_s
|
||||||
* Public Function Prototypes
|
* Public Function Prototypes
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#endif /* __INCLUDE_NET_IEEE802154_H */
|
#endif /* __INCLUDE_NETPACKET_IEEE802154_H */
|
|
@ -59,10 +59,30 @@
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Public Function Prototypes
|
* Public Function Prototypes
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
/* This function provides the interface between Ethernet device drivers and
|
|
||||||
|
/****************************************************************************
|
||||||
|
* 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
|
* packet socket logic. All frames that are received should be provided to
|
||||||
* pkt_input() prior to other routing.
|
* 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 */
|
struct net_driver_s; /* Forward reference */
|
||||||
int pkt_input(FAR struct net_driver_s *dev);
|
int pkt_input(FAR struct net_driver_s *dev);
|
||||||
|
|
|
@ -115,7 +115,7 @@ struct socket; /* Forward reference */
|
||||||
void pkt_initialize(void);
|
void pkt_initialize(void);
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Name: pkt_palloc()
|
* Name: pkt_alloc()
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
* Allocate a new, uninitialized packet socket connection structure. This
|
* 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
|
* connection to be used with the provided Ethernet header
|
||||||
*
|
*
|
||||||
* Assumptions:
|
* 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()
|
* 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
|
* Traverse the list of allocated packet connections
|
||||||
*
|
*
|
||||||
* Assumptions:
|
* Assumptions:
|
||||||
* This function is called from UIP logic at interrupt level (or with
|
* This function is called from network logic at with the network locked.
|
||||||
* interrupts disabled).
|
|
||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
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
|
* 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.
|
* OK if packet has been processed, otherwise ERROR.
|
||||||
*
|
*
|
||||||
* Assumptions:
|
* 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:
|
* Description:
|
||||||
* Handle incoming packet input
|
* 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:
|
* Parameters:
|
||||||
* dev - The device driver structure containing the received packet
|
* dev - The device driver structure containing the received packet
|
||||||
*
|
*
|
||||||
* Return:
|
* Return:
|
||||||
* OK The packet has been processed and can be deleted
|
* OK The packet has been processed and can be deleted
|
||||||
* ERROR Hold the packet and try again later. There is a listening socket
|
* ERROR There is a matching connection, but could not dispatch the packet
|
||||||
* but no recv in place to catch the packet yet.
|
* yet. Useful when a packet arrives before a recv call is in
|
||||||
|
* place.
|
||||||
*
|
*
|
||||||
* Assumptions:
|
* 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
|
* None
|
||||||
*
|
*
|
||||||
* Assumptions:
|
* Assumptions:
|
||||||
* Called from the interrupt level or with interrupts disabled.
|
* Called from the network device interface (devif) with the network
|
||||||
|
* locked.
|
||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
|
|
|
@ -76,8 +76,8 @@
|
||||||
* Return:
|
* Return:
|
||||||
* OK The packet has been processed and can be deleted
|
* OK The packet has been processed and can be deleted
|
||||||
* ERROR There is a matching connection, but could not dispatch the packet
|
* ERROR There is a matching connection, but could not dispatch the packet
|
||||||
* yet. Currently useful for UDP when a packet arrives before a recv
|
* yet. Useful when a packet arrives before a recv call is in
|
||||||
* call is in place.
|
* place.
|
||||||
*
|
*
|
||||||
* Assumptions:
|
* Assumptions:
|
||||||
* Called from the interrupt level or with interrupts disabled.
|
* Called from the interrupt level or with interrupts disabled.
|
||||||
|
|
Loading…
Reference in a new issue