diff --git a/include/wireless/wapi.h b/include/wireless/wapi.h index d4cf69036..aa481fe42 100644 --- a/include/wireless/wapi.h +++ b/include/wireless/wapi.h @@ -963,6 +963,16 @@ int wapi_set_pta_prio(int sock, FAR const char *ifname, int wapi_get_pta_prio(int sock, FAR const char *ifname, enum wapi_pta_prio_e *pta_prio); +/**************************************************************************** + * Name: wapi_extend_params + * + * Description: + * wapi extension interface for privatization method. + * + ****************************************************************************/ + +int wapi_extend_params(int sock, int cmd, FAR struct iwreq *wrq); + #undef EXTERN #ifdef __cplusplus } diff --git a/wireless/wapi/src/wireless.c b/wireless/wapi/src/wireless.c index 92eba66a1..36a3b0544 100644 --- a/wireless/wapi/src/wireless.c +++ b/wireless/wapi/src/wireless.c @@ -1628,3 +1628,34 @@ int wapi_get_pta_prio(int sock, FAR const char *ifname, return ret; } +/**************************************************************************** + * Name: wapi_extend_params + * + * Description: + * wapi extension interface for privatization method. + * + ****************************************************************************/ + +int wapi_extend_params(int sock, int cmd, FAR struct iwreq *wrq) +{ + int ret; + + WAPI_VALIDATE_PTR(wrq); + + if (cmd < SIOCIWFIRSTPRIV || cmd > SIOCIWLASTPRIV) + { + wlerr("extend ioctl cmd invalid"); + return -EINVAL; + } + + ret = ioctl(sock, cmd, (unsigned long)((uintptr_t)wrq)); + if (ret < 0) + { + int errcode = errno; + wlerr("extend ioctl(%d): %d", cmd, errcode); + ret = -errcode; + } + + return ret; +} +