mxm_wifiex: fix mlanutl fail on L5.15

When use mlanutl on L5.15, will meet below error logs:
root@imx8mqevk:/usr/share/nxp_wireless# ./mlanutl mlan0 hssetpara 2 0xff 0xc8 3 400
mlanutl: Operation not supported
mlanutl: hssetpara fail

This is due to the net common api change the ndo_do_ioctl behavior, it
splits out all the users of SIOCDEVPRIVATE ioctls into a separate
ndo_siocdevprivate callback. All the ioctl functions through
SIOCDEVPRIVATE in mlanutl.c will fail if not follow this upstream api
change. So here change to use new ndo_siocdevprivate instead of
ndo_do_ioctl on L5.15.

Signed-off-by: Sherry Sun <sherry.sun@nxp.com>
Approved-by: Tian Yang <yang.tian@nxp.com>
This commit is contained in:
Sherry Sun 2021-09-17 20:02:35 +08:00
parent 61d685b925
commit b400ebe7fe
5 changed files with 35 additions and 0 deletions

View File

@ -17178,12 +17178,21 @@ int wlan_get_scan_table_ret_entry(BSSDescriptor_t *pbss_desc, t_u8 **ppbuffer,
*
* @return 0 --success, otherwise fail
*/
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 15, 0)
int woal_do_ioctl(struct net_device *dev, struct ifreq *req, void __user *data, int cmd)
#else
int woal_do_ioctl(struct net_device *dev, struct ifreq *req, int cmd)
#endif
{
int ret = 0;
ENTER();
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 15, 0)
if (in_compat_syscall()) /* not implemented yet */
return -EOPNOTSUPP;
#endif
PRINTM(MINFO, "woal_do_ioctl: ioctl cmd = 0x%x\n", cmd);
switch (cmd) {
case WOAL_ANDROID_DEF_CMD:

View File

@ -364,7 +364,11 @@ typedef struct _ssu_params_cfg {
#define PRIV_CMD_LPM "lpm"
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 15, 0)
int woal_do_ioctl(struct net_device *dev, struct ifreq *req, void __user *data, int cmd);
#else
int woal_do_ioctl(struct net_device *dev, struct ifreq *req, int cmd);
#endif
/*
* For android private commands, fixed value of ioctl is used.

View File

@ -3751,7 +3751,11 @@ const struct net_device_ops woal_netdev_ops = {
.ndo_open = woal_open,
.ndo_start_xmit = woal_hard_start_xmit,
.ndo_stop = woal_close,
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 15, 0)
.ndo_siocdevprivate = woal_do_ioctl,
#else
.ndo_do_ioctl = woal_do_ioctl,
#endif
.ndo_set_mac_address = woal_set_mac_address,
.ndo_tx_timeout = woal_tx_timeout,
.ndo_get_stats = woal_get_stats,
@ -3826,7 +3830,11 @@ const struct net_device_ops woal_uap_netdev_ops = {
.ndo_open = woal_open,
.ndo_start_xmit = woal_hard_start_xmit,
.ndo_stop = woal_close,
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 15, 0)
.ndo_siocdevprivate = woal_uap_do_ioctl,
#else
.ndo_do_ioctl = woal_uap_do_ioctl,
#endif
.ndo_set_mac_address = woal_set_mac_address,
.ndo_tx_timeout = woal_tx_timeout,
.ndo_get_stats = woal_get_stats,

View File

@ -4223,10 +4223,20 @@ void woal_uap_set_multicast_list(struct net_device *dev)
*
* @return 0 --success, otherwise fail
*/
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 15, 0)
int woal_uap_do_ioctl(struct net_device *dev, struct ifreq *req, void __user *data, int cmd)
#else
int woal_uap_do_ioctl(struct net_device *dev, struct ifreq *req, int cmd)
#endif
{
int ret = 0;
ENTER();
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 15, 0)
if (in_compat_syscall()) /* not implemented yet */
return -EOPNOTSUPP;
#endif
switch (cmd) {
case WOAL_ANDROID_DEF_CMD:
/** android default ioctl ID is SIOCDEVPRIVATE + 1 */

View File

@ -531,7 +531,11 @@ typedef struct _domain_info_param {
int woal_set_get_uap_power_mode(moal_private *priv, t_u32 action,
mlan_ds_ps_mgmt *ps_mgmt);
void woal_uap_set_multicast_list(struct net_device *dev);
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 15, 0)
int woal_uap_do_ioctl(struct net_device *dev, struct ifreq *req, void __user *data, int cmd);
#else
int woal_uap_do_ioctl(struct net_device *dev, struct ifreq *req, int cmd);
#endif
int woal_uap_bss_ctrl(moal_private *priv, t_u8 wait_option, int data);
#ifdef UAP_CFG80211
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 12, 0)