mirror of
https://github.com/nxp-imx/mwifiex.git
synced 2024-11-14 19:15:35 +00:00
13b6fdb0b4
changes: 1. WCSWREL-191: Fixed the error when loading module param from user config for SD8801 2. WCSWREL-186: Fixed the issue of mlanutl failing on kernel higher than L5.15 3. Fixed low throughput issue for WPA3 SAE 4. Added driver change for WLAN throughput improvement on 8997 SoC 5. Updated README to recommend not to use WEP/TKIP for all chipsets 6. WCSWREL-180: Fix P2P test fail on kernel higher than L5.12 7. WCSWREL-156: kernel_write/kernel_read not allowed by drivers for L5.10 kernel GKI buildou 8. Alternative for pm_qos_add_request/pm_qos_remove_request Signed-off-by: Sherry Sun <sherry.sun@nxp.com> Approved-by: Tian Yang <yang.tian@nxp.com>
181 lines
4.6 KiB
C
181 lines
4.6 KiB
C
/** @file moal_uap_priv.c
|
|
*
|
|
* @brief This file contains standard ioctl functions
|
|
*
|
|
*
|
|
* Copyright 2010-2021 NXP
|
|
*
|
|
* This software file (the File) is distributed by NXP
|
|
* under the terms of the GNU General Public License Version 2, June 1991
|
|
* (the License). You may use, redistribute and/or modify the File in
|
|
* accordance with the terms and conditions of the License, a copy of which
|
|
* is available by writing to the Free Software Foundation, Inc.,
|
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA or on the
|
|
* worldwide web at http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
|
|
*
|
|
* THE FILE IS DISTRIBUTED AS-IS, WITHOUT WARRANTY OF ANY KIND, AND THE
|
|
* IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE
|
|
* ARE EXPRESSLY DISCLAIMED. The License provides additional details about
|
|
* this warranty disclaimer.
|
|
*
|
|
*/
|
|
|
|
/************************************************************************
|
|
Change log:
|
|
08/06/2010: initial version
|
|
************************************************************************/
|
|
|
|
#include "moal_main.h"
|
|
#include "moal_uap.h"
|
|
#include "moal_uap_priv.h"
|
|
|
|
/********************************************************
|
|
Local Variables
|
|
********************************************************/
|
|
|
|
/********************************************************
|
|
Global Variables
|
|
********************************************************/
|
|
|
|
/********************************************************
|
|
Local Functions
|
|
********************************************************/
|
|
|
|
/********************************************************
|
|
Global Functions
|
|
********************************************************/
|
|
|
|
/**
|
|
* @brief ioctl function for wireless IOCTLs
|
|
*
|
|
* @param dev A pointer to net_device structure
|
|
* @param req A pointer to ifreq structure
|
|
* @param cmd Command
|
|
*
|
|
* @return 0 --success, otherwise fail
|
|
*/
|
|
int woal_uap_do_priv_ioctl(struct net_device *dev, struct ifreq *req, int cmd)
|
|
{
|
|
moal_private *priv = (moal_private *)netdev_priv(dev);
|
|
struct iwreq *wrq = (struct iwreq *)req;
|
|
int ret = 0;
|
|
|
|
ENTER();
|
|
|
|
switch (cmd) {
|
|
case WOAL_UAP_SETNONE_GETNONE:
|
|
switch (wrq->u.data.flags) {
|
|
case WOAL_UAP_START:
|
|
break;
|
|
case WOAL_UAP_STOP:
|
|
ret = woal_uap_bss_ctrl(priv, MOAL_IOCTL_WAIT,
|
|
UAP_BSS_STOP);
|
|
break;
|
|
case WOAL_AP_BSS_START:
|
|
ret = woal_uap_bss_ctrl(priv, MOAL_IOCTL_WAIT,
|
|
UAP_BSS_START);
|
|
break;
|
|
case WOAL_AP_BSS_STOP:
|
|
ret = woal_uap_bss_ctrl(priv, MOAL_IOCTL_WAIT,
|
|
UAP_BSS_STOP);
|
|
break;
|
|
default:
|
|
ret = -EINVAL;
|
|
break;
|
|
}
|
|
break;
|
|
case WOAL_UAP_SETONEINT_GETWORDCHAR:
|
|
switch (wrq->u.data.flags) {
|
|
case WOAL_UAP_VERSION:
|
|
ret = woal_get_driver_version(priv, req);
|
|
break;
|
|
case WOAL_UAP_VEREXT:
|
|
ret = woal_get_driver_verext(priv, req);
|
|
break;
|
|
default:
|
|
ret = -EOPNOTSUPP;
|
|
break;
|
|
}
|
|
break;
|
|
case WOAL_UAP_SET_GET_256_CHAR:
|
|
switch (wrq->u.data.flags) {
|
|
case WOAL_WL_FW_RELOAD:
|
|
break;
|
|
case WOAL_AP_SET_CFG:
|
|
ret = woal_uap_set_ap_cfg(
|
|
priv, (t_u8 __force *)wrq->u.data.pointer,
|
|
wrq->u.data.length);
|
|
break;
|
|
default:
|
|
ret = -EINVAL;
|
|
break;
|
|
}
|
|
break;
|
|
case WOAL_UAP_SETONEINT_GETONEINT:
|
|
switch (wrq->u.data.flags) {
|
|
#ifdef WIFI_DIRECT_SUPPORT
|
|
#if defined(STA_SUPPORT) && defined(UAP_SUPPORT)
|
|
case WOAL_UAP_SET_GET_BSS_ROLE:
|
|
ret = woal_set_get_bss_role(priv, wrq);
|
|
break;
|
|
#endif
|
|
#endif
|
|
default:
|
|
ret = -EINVAL;
|
|
break;
|
|
}
|
|
break;
|
|
case WOAL_UAP_HOST_CMD:
|
|
ret = woal_host_command(priv, wrq);
|
|
break;
|
|
case WOAL_UAP_FROYO_START:
|
|
break;
|
|
case WOAL_UAP_FROYO_STOP:
|
|
ret = woal_uap_bss_ctrl(priv, MOAL_IOCTL_WAIT, UAP_BSS_STOP);
|
|
break;
|
|
case WOAL_UAP_FROYO_AP_BSS_START:
|
|
ret = woal_uap_bss_ctrl(priv, MOAL_IOCTL_WAIT, UAP_BSS_START);
|
|
break;
|
|
case WOAL_UAP_FROYO_AP_BSS_STOP:
|
|
ret = woal_uap_bss_ctrl(priv, MOAL_IOCTL_WAIT, UAP_BSS_STOP);
|
|
break;
|
|
case WOAL_UAP_FROYO_WL_FW_RELOAD:
|
|
break;
|
|
case WOAL_UAP_FROYO_AP_SET_CFG:
|
|
ret = woal_uap_set_ap_cfg(priv,
|
|
(t_u8 __force *)wrq->u.data.pointer,
|
|
wrq->u.data.length);
|
|
break;
|
|
default:
|
|
ret = -EINVAL;
|
|
break;
|
|
}
|
|
|
|
LEAVE();
|
|
return ret;
|
|
}
|
|
|
|
/**
|
|
* @brief Handle get info resp
|
|
*
|
|
* @param priv Pointer to moal_private structure
|
|
* @param info Pointer to mlan_ds_get_info structure
|
|
*
|
|
* @return N/A
|
|
*/
|
|
void woal_ioctl_get_uap_info_resp(moal_private *priv, mlan_ds_get_info *info)
|
|
{
|
|
ENTER();
|
|
switch (info->sub_command) {
|
|
case MLAN_OID_GET_STATS:
|
|
priv->w_stats.discard.fragment =
|
|
info->param.ustats.fcs_error_count;
|
|
priv->w_stats.discard.retries = info->param.ustats.retry_count;
|
|
priv->w_stats.discard.misc =
|
|
info->param.ustats.ack_failure_count;
|
|
break;
|
|
default:
|
|
break;
|
|
}
|
|
LEAVE();
|
|
}
|