forked from nuttx/nuttx-update
Merge remote-tracking branch 'origin/master' into ieee802154
This commit is contained in:
commit
be415489f2
2 changed files with 14 additions and 43 deletions
|
@ -164,14 +164,11 @@
|
|||
* 3. To the IEEE802.15.4 radio device layer, as documented in,
|
||||
* include/nuttx/wireless/ieee802154/ioeee802154_radio.h.
|
||||
*
|
||||
* SIOCSWPANID - Join the specified PAN ID
|
||||
* This is a placeholder; no 6LoWPAN IOCTL commands have been defined.
|
||||
*/
|
||||
|
||||
#define SIOCSWPANID _WLIOC(0x0033) /* Join PAN ID */
|
||||
#define SIOCGWPANID _WLIOC(0x0034) /* Return PAN ID */
|
||||
|
||||
#define WL_FIRSTCHAR 0x0035
|
||||
#define WL_NNETCMDS 0x0034
|
||||
#define WL_FIRSTCHAR 0x0033
|
||||
#define WL_NNETCMDS 0x0032
|
||||
|
||||
/* Character Driver IOCTL commands *************************************************/
|
||||
/* Non-compatible, NuttX only IOCTL definitions for use with low-level wireless
|
||||
|
@ -179,23 +176,23 @@
|
|||
* requires a file descriptor created by the open() interface.
|
||||
*/
|
||||
|
||||
#define WLIOC_SETRADIOFREQ _WLIOC(0x0035) /* arg: Pointer to uint32_t, frequency
|
||||
#define WLIOC_SETRADIOFREQ _WLIOC(0x0033) /* arg: Pointer to uint32_t, frequency
|
||||
* value (in Mhz) */
|
||||
#define WLIOC_GETRADIOFREQ _WLIOC(0x0036) /* arg: Pointer to uint32_t, frequency
|
||||
#define WLIOC_GETRADIOFREQ _WLIOC(0x0034) /* arg: Pointer to uint32_t, frequency
|
||||
* value (in Mhz) */
|
||||
#define WLIOC_SETADDR _WLIOC(0x0037) /* arg: Pointer to address value, format
|
||||
#define WLIOC_SETADDR _WLIOC(0x0035) /* arg: Pointer to address value, format
|
||||
* of the address is driver specific */
|
||||
#define WLIOC_GETADDR _WLIOC(0x0038) /* arg: Pointer to address value, format
|
||||
#define WLIOC_GETADDR _WLIOC(0x0036) /* arg: Pointer to address value, format
|
||||
* of the address is driver specific */
|
||||
#define WLIOC_SETTXPOWER _WLIOC(0x0039) /* arg: Pointer to int32_t, output power
|
||||
#define WLIOC_SETTXPOWER _WLIOC(0x0036) /* arg: Pointer to int32_t, output power
|
||||
* (in dBm) */
|
||||
#define WLIOC_GETTXPOWER _WLIOC(0x003a) /* arg: Pointer to int32_t, output power
|
||||
#define WLIOC_GETTXPOWER _WLIOC(0x0038) /* arg: Pointer to int32_t, output power
|
||||
* (in dBm) */
|
||||
|
||||
/* Device-specific IOCTL commands **************************************************/
|
||||
|
||||
#define WL_FIRST 0x0001 /* First common command */
|
||||
#define WL_NCMDS 0x003a /* Number of common commands */
|
||||
#define WL_NCMDS 0x0038 /* Number of common commands */
|
||||
|
||||
/* User defined ioctl commands are also supported. These will be forwarded
|
||||
* by the upper-half QE driver to the lower-half QE driver via the ioctl()
|
||||
|
|
|
@ -348,6 +348,7 @@ static void ioctl_set_ipv6addr(FAR net_ipv6addr_t outaddr,
|
|||
static int netdev_sixlowpan_ioctl(FAR struct socket *psock, int cmd,
|
||||
FAR struct sixlowpan_req_s *req)
|
||||
{
|
||||
#if 0 /* None yet defined */
|
||||
FAR struct ieee802154_driver_s *ieee;
|
||||
int ret = -ENOTTY;
|
||||
|
||||
|
@ -358,42 +359,15 @@ static int netdev_sixlowpan_ioctl(FAR struct socket *psock, int cmd,
|
|||
switch (cmd)
|
||||
{
|
||||
|
||||
case SIOCSWPANID: /* Join PAN ID */
|
||||
{
|
||||
ieee = (FAR struct ieee802154_driver_s *)netdev_findbyname(req->ifr_name);
|
||||
if (ieee == NULL)
|
||||
{
|
||||
ret = -ENODEV;
|
||||
}
|
||||
else
|
||||
{
|
||||
ieee->i_panid = req->u.panid.panid;
|
||||
ret = OK;
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case SIOCGWPANID: /* Return PAN ID */
|
||||
{
|
||||
ieee = (FAR struct ieee802154_driver_s *)netdev_findbyname(req->ifr_name);
|
||||
if (ieee == NULL)
|
||||
{
|
||||
ret = -ENODEV;
|
||||
}
|
||||
else
|
||||
{
|
||||
req->u.panid.panid = ieee->i_panid;
|
||||
ret = OK;
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
return -ENOTTY;
|
||||
}
|
||||
}
|
||||
|
||||
return ret;
|
||||
#else
|
||||
return -ENOTTY;
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
Loading…
Reference in a new issue