[wireless][wapi] add extend api for private needs

Signed-off-by: meijian <meijian@xiaomi.com>
This commit is contained in:
meijian 2023-11-01 21:13:13 +08:00 committed by archer
parent 002e31c56d
commit c5541bfb56
2 changed files with 41 additions and 0 deletions

View File

@ -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
}

View File

@ -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;
}