wireless/ieee802154: Removes radio IOCTL. Starts bringing radio and MAC closer with well-defined interface.

This commit is contained in:
Anthony Merlino
2017-05-05 11:15:28 -04:00
parent abc15c8429
commit dd40014279
18 changed files with 270 additions and 1890 deletions
+1 -17
View File
@@ -74,7 +74,6 @@
#if defined(CONFIG_NETDEV_IOCTL) && defined(CONFIG_NET_6LOWPAN)
# include <nuttx/wireless/ieee802154/ieee802154_mac.h>
# include <nuttx/wireless/ieee802154/ieee802154_radio.h>
#endif
#include "arp/arp.h"
@@ -353,22 +352,7 @@ static int netdev_iee802154_ioctl(FAR struct socket *psock, int cmd,
if (arg != 0ul)
{
/* Verify that this is either a valid IEEE802.15.4 radio IOCTL command
* or a valid IEEE802.15.4 MAC IOCTL command.
*/
if (_PHY802154IOCVALID(cmd))
{
/* Get the IEEE802.15.4 network device to receive the radio IOCTL
* commdand
*/
FAR struct ieee802154_netradio_s *radio =
(FAR struct ieee802154_netradio_s *)((uintptr_t)arg);
ifname = radio->ifr_name;
}
else if (_MAC802154IOCVALID(cmd))
if (_MAC802154IOCVALID(cmd))
{
/* Get the IEEE802.15.4 MAC device to receive the radio IOCTL
* commdand
+7 -6
View File
@@ -57,7 +57,6 @@
#include <debug.h>
#include <nuttx/net/sixlowpan.h>
#include <nuttx/wireless/ieee802154/ieee802154_radio.h>
#include "sixlowpan/sixlowpan_internal.h"
@@ -165,7 +164,7 @@ bool sixlowpan_ismacbased(const net_ipv6addr_t ipaddr,
* Name: sixlowpan_src_panid
*
* Description:
* Get the source PAN ID from the IEEE802.15.4 radio.
* Get the source PAN ID from the IEEE802.15.4 MAC layer.
*
* Input parameters:
* ieee - A reference IEEE802.15.4 MAC network device structure.
@@ -181,18 +180,20 @@ int sixlowpan_src_panid(FAR struct ieee802154_driver_s *ieee,
FAR uint16_t *panid)
{
FAR struct net_driver_s *dev = &ieee->i_dev;
struct ieee802154_netradio_s arg;
struct ieee802154_netmac_s arg;
int ret;
memcpy(arg.ifr_name, ieee->i_dev.d_ifname, IFNAMSIZ);
ret = dev->d_ioctl(dev, PHY802154IOC_GET_PANID, (unsigned long)((uintptr_t)&arg));
arg.u.getreq.pib_attr = IEEE802154_PIB_MAC_PAN_ID;
ret = dev->d_ioctl(dev, MAC802154IOC_MLME_GET_REQUEST,
(unsigned long)((uintptr_t)&arg));
if (ret < 0)
{
wlerr("ERROR: PHY802154IOC_GET_PANID failed: %d\n", ret);
wlerr("ERROR: MAC802154IOC_MLME_GET_REQUEST failed: %d\n", ret);
return ret;
}
*panid = arg.u.panid;
*panid = arg.u.getreq.attr_value->panid;
return OK;
}