@@ -22,6 +22,8 @@ void rtw_stop_drv_threads(struct adapter *padapter);
void rtw_cancel_all_timer(struct adapter *padapter);
int rtw_ioctl(struct net_device *dev, struct ifreq *rq, int cmd);
+int rtw_android_priv_cmd(struct net_device *dev, struct ifreq *rq,
+ void __user *data, int cmd);
int rtw_init_netdev_name(struct net_device *pnetdev, const char *ifname);
struct net_device *rtw_init_netdev(struct adapter *padapter);
@@ -46,6 +46,7 @@ enum ANDROID_WIFI_CMD {
};
int rtw_android_cmdstr_to_num(char *cmdstr);
-int rtw_android_priv_cmd(struct net_device *net, struct ifreq *ifr, int cmd);
+int rtw_android_priv_cmd(struct net_device *net, struct ifreq *ifr,
+ void __user *data, int cmd);
#endif /* __RTW_ANDROID_H__ */
@@ -3011,9 +3011,6 @@ int rtw_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
ret = rtw_hostapd_ioctl(dev, &wrq->u.data);
break;
#endif /* CONFIG_88EU_AP_MODE */
- case (SIOCDEVPRIVATE + 1):
- ret = rtw_android_priv_cmd(dev, rq, cmd);
- break;
default:
ret = -EOPNOTSUPP;
break;
@@ -290,6 +290,7 @@ static const struct net_device_ops rtw_netdev_ops = {
.ndo_set_mac_address = rtw_net_set_mac_address,
.ndo_get_stats = rtw_net_get_stats,
.ndo_do_ioctl = rtw_ioctl,
+ .ndo_siocdevprivate = rtw_android_priv_cmd,
};
int rtw_init_netdev_name(struct net_device *pnetdev, const char *ifname)
@@ -127,7 +127,8 @@ static int android_get_p2p_addr(struct net_device *net, char *command,
return ETH_ALEN;
}
-int rtw_android_priv_cmd(struct net_device *net, struct ifreq *ifr, int cmd)
+int rtw_android_priv_cmd(struct net_device *net, struct ifreq *ifr,
+ void __user *data, int cmd)
{
int ret = 0;
char *command;
@@ -135,9 +136,15 @@ int rtw_android_priv_cmd(struct net_device *net, struct ifreq *ifr, int cmd)
int bytes_written = 0;
struct android_wifi_priv_cmd priv_cmd;
- if (!ifr->ifr_data)
+ if (cmd != SIOCDEVPRIVATE)
+ return -EOPNOTSUPP;
+
+ if (in_compat_syscall()) /* to be implemented */
+ return -EOPNOTSUPP;
+
+ if (!data)
return -EINVAL;
- if (copy_from_user(&priv_cmd, ifr->ifr_data, sizeof(priv_cmd)))
+ if (copy_from_user(&priv_cmd, data, sizeof(priv_cmd)))
return -EFAULT;
if (priv_cmd.total_len < 1)
return -EINVAL;
@@ -54,6 +54,8 @@ void rtw_stop_drv_threads(struct adapter *padapter);
void rtw_cancel_all_timer(struct adapter *padapter);
int rtw_ioctl(struct net_device *dev, struct ifreq *rq, int cmd);
+int rtw_siocdevprivate(struct net_device *dev, struct ifreq *rq,
+ void __user *data, int cmd);
int rtw_init_netdev_name(struct net_device *pnetdev, const char *ifname);
struct net_device *rtw_init_netdev(struct adapter *padapter);
@@ -5134,6 +5134,21 @@ static int rtw_ioctl_wext_private(struct net_device *dev, union iwreq_data *wrq_
return err;
}
+int rtw_siocdevprivate(struct net_device *dev, struct ifreq *rq,
+ void __user *data, int cmd)
+{
+ struct iwreq *wrq = (struct iwreq *)rq;
+
+ /* little hope of fixing this, better remove the whole function */
+ if (in_compat_syscall())
+ return -EOPNOTSUPP;
+
+ if (cmd != SIOCDEVPRIVATE)
+ return -EOPNOTSUPP;
+
+ return rtw_ioctl_wext_private(dev, &wrq->u);
+}
+
int rtw_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
{
struct iwreq *wrq = (struct iwreq *)rq;
@@ -5146,9 +5161,6 @@ int rtw_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
case RTL_IOCTL_HOSTAPD:
ret = rtw_hostapd_ioctl(dev, &wrq->u.data);
break;
- case SIOCDEVPRIVATE:
- ret = rtw_ioctl_wext_private(dev, &wrq->u);
- break;
default:
ret = -EOPNOTSUPP;
break;
@@ -470,6 +470,7 @@ static const struct net_device_ops rtw_netdev_ops = {
.ndo_set_mac_address = rtw_net_set_mac_address,
.ndo_get_stats = rtw_net_get_stats,
.ndo_do_ioctl = rtw_ioctl,
+ .ndo_siocdevprivate = rtw_siocdevprivate,
};
int rtw_init_netdev_name(struct net_device *pnetdev, const char *ifname)