Corrected missing definitions in Makefile and removed is_compat_task

This commit is contained in:
Brandon Bailey 2017-04-06 14:39:17 -06:00
parent 2a91169c6f
commit 84b99f69c2
3 changed files with 138 additions and 122 deletions

View file

@ -23,7 +23,18 @@ EXTRA_LDFLAGS += --strip-debug
CONFIG_AUTOCFG_CP = n
########################## WIFI IC ############################
CONFIG_MULTIDRV = n
CONFIG_RTL8188E = n
CONFIG_RTL8812A = n
CONFIG_RTL8821A = n
CONFIG_RTL8192E = n
CONFIG_RTL8723B = n
CONFIG_RTL8814A = n
CONFIG_RTL8723C = n
CONFIG_RTL8188F = n
CONFIG_RTL8822B = y
CONFIG_RTL8723D = n
CONFIG_RTL8821C = n
######################### Interface ###########################
CONFIG_USB_HCI = y
@ -77,16 +88,58 @@ CONFIG_MP_VHT_HW_TX_MODE = n
CONFIG_PLATFORM_I386_PC = y
CONFIG_PLATFORM_ANDROID_X86 = n
CONFIG_PLATFORM_ANDROID_INTEL_X86 = n
CONFIG_PLATFORM_JB_X86 = n
CONFIG_PLATFORM_ARM_S3C2K4 = n
CONFIG_PLATFORM_ARM_PXA2XX = n
CONFIG_PLATFORM_ARM_S3C6K4 = n
CONFIG_PLATFORM_MIPS_RMI = n
CONFIG_PLATFORM_RTD2880B = n
CONFIG_PLATFORM_MIPS_AR9132 = n
CONFIG_PLATFORM_RTK_DMP = n
CONFIG_PLATFORM_MIPS_PLM = n
CONFIG_PLATFORM_MSTAR389 = n
CONFIG_PLATFORM_MT53XX = n
CONFIG_PLATFORM_ARM_MX51_241H = n
CONFIG_PLATFORM_FS_MX61 = n
CONFIG_PLATFORM_ACTIONS_ATJ227X = n
CONFIG_PLATFORM_TEGRA3_CARDHU = n
CONFIG_PLATFORM_TEGRA4_DALMORE = n
CONFIG_PLATFORM_ARM_TCC8900 = n
CONFIG_PLATFORM_ARM_TCC8920 = n
CONFIG_PLATFORM_ARM_TCC8920_JB42 = n
CONFIG_PLATFORM_ARM_TCC8930_JB42 = n
CONFIG_PLATFORM_ARM_RK2818 = n
CONFIG_PLATFORM_ARM_RK3066 = n
CONFIG_PLATFORM_ARM_RK3188 = n
CONFIG_PLATFORM_ARM_URBETTER = n
CONFIG_PLATFORM_ARM_TI_PANDA = n
CONFIG_PLATFORM_MIPS_JZ4760 = n
CONFIG_PLATFORM_DMP_PHILIPS = n
CONFIG_PLATFORM_MSTAR_TITANIA12 = n
CONFIG_PLATFORM_MSTAR = n
CONFIG_PLATFORM_SZEBOOK = n
CONFIG_PLATFORM_ARM_SUNxI = n
CONFIG_PLATFORM_ARM_SUN6I = n
CONFIG_PLATFORM_ARM_SUN7I = n
CONFIG_PLATFORM_ARM_SUN8I_W3P1 = n
CONFIG_PLATFORM_ARM_SUN8I_W5P1 = n
CONFIG_PLATFORM_ACTIONS_ATM702X = n
CONFIG_PLATFORM_ACTIONS_ATV5201 = n
CONFIG_PLATFORM_ACTIONS_ATM705X = n
CONFIG_PLATFORM_ARM_SUN50IW1P1 = n
CONFIG_PLATFORM_ARM_RTD299X = n
CONFIG_PLATFORM_ARM_SPREADTRUM_6820 = n
CONFIG_PLATFORM_ARM_SPREADTRUM_8810 = n
CONFIG_PLATFORM_AML = y
# Setting to n
CONFIG_PLATFORM_AML = y
CONFIG_PLATFORM_ARM_WMT = n
CONFIG_PLATFORM_TI_DM365 = n
CONFIG_PLATFORM_MOZART = n
CONFIG_PLATFORM_RTK119X = n
CONFIG_PLATFORM_RTK129X = n
CONFIG_PLATFORM_NOVATEK_NT72668 = n
CONFIG_PLATFORM_HISILICON = n
###############################################################
CONFIG_DRVEXT_MODULE = n

View file

@ -12905,10 +12905,9 @@ static int rtw_ioctl_standard_wext_private(struct net_device *dev, struct ifreq
}
static int rtw_ioctl_wext_private(struct net_device *dev, struct ifreq *rq) {
#ifdef CONFIG_COMPAT
if (is_compat_task())
return rtw_ioctl_compat_wext_private(dev, rq);
else
#endif /* CONFIG_COMPAT */
return rtw_ioctl_standard_wext_private(dev, rq);
}

View file

@ -19,27 +19,27 @@
******************************************************************************/
#ifdef CONFIG_GPIO_WAKEUP
#include <linux/gpio.h>
#include <linux/gpio.h>
#endif
#include <drv_types.h>
#if defined(RTW_ENABLE_WIFI_CONTROL_FUNC)
#include <linux/platform_device.h>
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 35))
#include <linux/wlan_plat.h>
#else
#include <linux/wifi_tiwlan.h>
#endif
#include <linux/platform_device.h>
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 35))
#include <linux/wlan_plat.h>
#else
#include <linux/wifi_tiwlan.h>
#endif
#endif /* defined(RTW_ENABLE_WIFI_CONTROL_FUNC) */
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 0, 0))
#define strnicmp strncasecmp
#define strnicmp strncasecmp
#endif /* Linux kernel >= 4.0.0 */
#ifdef CONFIG_GPIO_WAKEUP
#include <linux/interrupt.h>
#include <linux/irq.h>
#include <linux/interrupt.h>
#include <linux/irq.h>
#endif
#include "rtw_version.h"
@ -96,7 +96,7 @@ const char *android_wifi_cmd_str[ANDROID_WIFI_CMD_MAX] = {
#if defined(CONFIG_GTK_OL) && (LINUX_VERSION_CODE < KERNEL_VERSION(3, 1, 0))
"GTK_REKEY_OFFLOAD",
#endif /* CONFIG_GTK_OL */
/* Private command for P2P disable*/
/* Private command for P2P disable*/
"P2P_DISABLE",
"DRIVER_VERSION"
};
@ -184,8 +184,7 @@ unsigned int oob_gpio = 0;
* total_len: the length of the command.
*
* */
static int rtw_android_pno_setup(struct net_device *net, char *command, int total_len)
{
static int rtw_android_pno_setup(struct net_device *net, char *command, int total_len) {
pno_ssid_t pno_ssids_local[MAX_PNO_LIST_COUNT];
int res = -1;
int nssid = 0;
@ -286,8 +285,7 @@ exit_proc:
* */
int rtw_android_cfg80211_pno_setup(struct net_device *net,
struct cfg80211_ssid *ssids, int n_ssids, int interval)
{
struct cfg80211_ssid *ssids, int n_ssids, int interval) {
int res = -1;
int nssid = 0;
int pno_time = 0;
@ -325,8 +323,7 @@ exit_proc:
return res;
}
int rtw_android_pno_enable(struct net_device *net, int pno_enable)
{
int rtw_android_pno_enable(struct net_device *net, int pno_enable) {
_adapter *padapter = (_adapter *)rtw_netdev_priv(net);
struct pwrctrl_priv *pwrctl = adapter_to_pwrctl(padapter);
@ -353,8 +350,7 @@ int rtw_android_pno_enable(struct net_device *net, int pno_enable)
}
#endif /* CONFIG_PNO_SUPPORT */
int rtw_android_cmdstr_to_num(char *cmdstr)
{
int rtw_android_cmdstr_to_num(char *cmdstr) {
int cmd_num;
for (cmd_num = 0 ; cmd_num < ANDROID_WIFI_CMD_MAX; cmd_num++)
if (0 == strnicmp(cmdstr , android_wifi_cmd_str[cmd_num], strlen(android_wifi_cmd_str[cmd_num])))
@ -363,8 +359,7 @@ int rtw_android_cmdstr_to_num(char *cmdstr)
return cmd_num;
}
int rtw_android_get_rssi(struct net_device *net, char *command, int total_len)
{
int rtw_android_get_rssi(struct net_device *net, char *command, int total_len) {
_adapter *padapter = (_adapter *)rtw_netdev_priv(net);
struct mlme_priv *pmlmepriv = &(padapter->mlmepriv);
struct wlan_network *pcur_network = &pmlmepriv->cur_network;
@ -378,8 +373,7 @@ int rtw_android_get_rssi(struct net_device *net, char *command, int total_len)
return bytes_written;
}
int rtw_android_get_link_speed(struct net_device *net, char *command, int total_len)
{
int rtw_android_get_link_speed(struct net_device *net, char *command, int total_len) {
_adapter *padapter = (_adapter *)rtw_netdev_priv(net);
struct mlme_priv *pmlmepriv = &(padapter->mlmepriv);
struct wlan_network *pcur_network = &pmlmepriv->cur_network;
@ -392,8 +386,7 @@ int rtw_android_get_link_speed(struct net_device *net, char *command, int total_
return bytes_written;
}
int rtw_android_get_macaddr(struct net_device *net, char *command, int total_len)
{
int rtw_android_get_macaddr(struct net_device *net, char *command, int total_len) {
_adapter *adapter = (_adapter *)rtw_netdev_priv(net);
int bytes_written = 0;
@ -401,8 +394,7 @@ int rtw_android_get_macaddr(struct net_device *net, char *command, int total_len
return bytes_written;
}
int rtw_android_set_country(struct net_device *net, char *command, int total_len)
{
int rtw_android_set_country(struct net_device *net, char *command, int total_len) {
_adapter *adapter = (_adapter *)rtw_netdev_priv(net);
char *country_code = command + strlen(android_wifi_cmd_str[ANDROID_WIFI_CMD_COUNTRY]) + 1;
int ret = _FAIL;
@ -412,8 +404,7 @@ int rtw_android_set_country(struct net_device *net, char *command, int total_len
return (ret == _SUCCESS) ? 0 : -1;
}
int rtw_android_get_p2p_dev_addr(struct net_device *net, char *command, int total_len)
{
int rtw_android_get_p2p_dev_addr(struct net_device *net, char *command, int total_len) {
int bytes_written = 0;
/* We use the same address as our HW MAC address */
@ -423,8 +414,7 @@ int rtw_android_get_p2p_dev_addr(struct net_device *net, char *command, int tota
return bytes_written;
}
int rtw_android_set_block_scan(struct net_device *net, char *command, int total_len)
{
int rtw_android_set_block_scan(struct net_device *net, char *command, int total_len) {
_adapter *adapter = (_adapter *)rtw_netdev_priv(net);
char *block_value = command + strlen(android_wifi_cmd_str[ANDROID_WIFI_CMD_BLOCK_SCAN]) + 1;
@ -435,8 +425,7 @@ int rtw_android_set_block_scan(struct net_device *net, char *command, int total_
return 0;
}
int rtw_android_set_block(struct net_device *net, char *command, int total_len)
{
int rtw_android_set_block(struct net_device *net, char *command, int total_len) {
_adapter *adapter = (_adapter *)rtw_netdev_priv(net);
char *block_value = command + strlen(android_wifi_cmd_str[ANDROID_WIFI_CMD_BLOCK]) + 1;
@ -447,8 +436,7 @@ int rtw_android_set_block(struct net_device *net, char *command, int total_len)
return 0;
}
int rtw_android_setband(struct net_device *net, char *command, int total_len)
{
int rtw_android_setband(struct net_device *net, char *command, int total_len) {
_adapter *adapter = (_adapter *)rtw_netdev_priv(net);
char *arg = command + strlen(android_wifi_cmd_str[ANDROID_WIFI_CMD_SETBAND]) + 1;
u32 band = WIFI_FREQUENCY_BAND_AUTO;
@ -460,8 +448,7 @@ int rtw_android_setband(struct net_device *net, char *command, int total_len)
return (ret == _SUCCESS) ? 0 : -1;
}
int rtw_android_getband(struct net_device *net, char *command, int total_len)
{
int rtw_android_getband(struct net_device *net, char *command, int total_len) {
_adapter *adapter = (_adapter *)rtw_netdev_priv(net);
int bytes_written = 0;
@ -471,8 +458,7 @@ int rtw_android_getband(struct net_device *net, char *command, int total_len)
}
#ifdef CONFIG_WFD
int rtw_android_set_miracast_mode(struct net_device *net, char *command, int total_len)
{
int rtw_android_set_miracast_mode(struct net_device *net, char *command, int total_len) {
_adapter *adapter = (_adapter *)rtw_netdev_priv(net);
struct wifi_display_info *wfd_info = &adapter->wfd_info;
char *arg = command + strlen(android_wifi_cmd_str[ANDROID_WIFI_CMD_MIRACAST]) + 1;
@ -507,8 +493,7 @@ exit:
}
#endif /* CONFIG_WFD */
int get_int_from_command(char *pcmd)
{
int get_int_from_command(char *pcmd) {
int i = 0;
for (i = 0; i < strlen(pcmd); i++) {
@ -522,8 +507,7 @@ int get_int_from_command(char *pcmd)
}
#if defined(CONFIG_GTK_OL) && (LINUX_VERSION_CODE < KERNEL_VERSION(3, 1, 0))
int rtw_gtk_offload(struct net_device *net, u8 *cmd_ptr)
{
int rtw_gtk_offload(struct net_device *net, u8 *cmd_ptr) {
int i;
/* u8 *cmd_ptr = priv_cmd.buf; */
struct sta_info *psta;
@ -566,8 +550,7 @@ int rtw_gtk_offload(struct net_device *net, u8 *cmd_ptr)
}
#endif /* CONFIG_GTK_OL */
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, int cmd) {
int ret = 0;
char *command = NULL;
int cmd_num;
@ -593,7 +576,6 @@ int rtw_android_priv_cmd(struct net_device *net, struct ifreq *ifr, int cmd)
goto exit;
}
#ifdef CONFIG_COMPAT
if (is_compat_task()) {
/* User space is 32-bit, use compat ioctl */
compat_android_wifi_priv_cmd compat_priv_cmd;
@ -604,7 +586,7 @@ int rtw_android_priv_cmd(struct net_device *net, struct ifreq *ifr, int cmd)
priv_cmd.buf = compat_ptr(compat_priv_cmd.buf);
priv_cmd.used_len = compat_priv_cmd.used_len;
priv_cmd.total_len = compat_priv_cmd.total_len;
} else
#endif /* CONFIG_COMPAT */
if (copy_from_user(&priv_cmd, ifr->ifr_data, sizeof(android_wifi_priv_cmd))) {
ret = -EFAULT;
@ -935,8 +917,7 @@ static struct resource *wifi_irqres = NULL;
static int wifi_add_dev(void);
static void wifi_del_dev(void);
int rtw_android_wifictrl_func_add(void)
{
int rtw_android_wifictrl_func_add(void) {
int ret = 0;
sema_init(&wifi_control_sem, 0);
@ -956,16 +937,14 @@ int rtw_android_wifictrl_func_add(void)
return ret;
}
void rtw_android_wifictrl_func_del(void)
{
void rtw_android_wifictrl_func_del(void) {
if (g_wifidev_registered) {
wifi_del_dev();
g_wifidev_registered = 0;
}
}
void *wl_android_prealloc(int section, unsigned long size)
{
void *wl_android_prealloc(int section, unsigned long size) {
void *alloc_ptr = NULL;
if (wifi_control_data && wifi_control_data->mem_prealloc) {
alloc_ptr = wifi_control_data->mem_prealloc(section, size);
@ -981,8 +960,7 @@ void *wl_android_prealloc(int section, unsigned long size)
return NULL;
}
int wifi_get_irq_number(unsigned long *irq_flags_ptr)
{
int wifi_get_irq_number(unsigned long *irq_flags_ptr) {
if (wifi_irqres) {
*irq_flags_ptr = wifi_irqres->flags & IRQF_TRIGGER_MASK;
return (int)wifi_irqres->start;
@ -994,8 +972,7 @@ int wifi_get_irq_number(unsigned long *irq_flags_ptr)
#endif
}
int wifi_set_power(int on, unsigned long msec)
{
int wifi_set_power(int on, unsigned long msec) {
RTW_INFO("%s = %d\n", __FUNCTION__, on);
if (wifi_control_data && wifi_control_data->set_power)
wifi_control_data->set_power(on);
@ -1005,8 +982,7 @@ int wifi_set_power(int on, unsigned long msec)
}
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 35))
int wifi_get_mac_addr(unsigned char *buf)
{
int wifi_get_mac_addr(unsigned char *buf) {
RTW_INFO("%s\n", __FUNCTION__);
if (!buf)
return -EINVAL;
@ -1017,8 +993,7 @@ int wifi_get_mac_addr(unsigned char *buf)
#endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 35)) */
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 39)) || defined(COMPAT_KERNEL_RELEASE)
void *wifi_get_country_code(char *ccode)
{
void *wifi_get_country_code(char *ccode) {
RTW_INFO("%s\n", __FUNCTION__);
if (!ccode)
return NULL;
@ -1028,16 +1003,14 @@ void *wifi_get_country_code(char *ccode)
}
#endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 39)) */
static int wifi_set_carddetect(int on)
{
static int wifi_set_carddetect(int on) {
RTW_INFO("%s = %d\n", __FUNCTION__, on);
if (wifi_control_data && wifi_control_data->set_carddetect)
wifi_control_data->set_carddetect(on);
return 0;
}
static int wifi_probe(struct platform_device *pdev)
{
static int wifi_probe(struct platform_device *pdev) {
struct wifi_platform_data *wifi_ctrl =
(struct wifi_platform_data *)(pdev->dev.platform_data);
int wifi_wake_gpio = 0;
@ -1081,8 +1054,7 @@ static int wifi_probe(struct platform_device *pdev)
#ifdef RTW_SUPPORT_PLATFORM_SHUTDOWN
extern PADAPTER g_test_adapter;
static void shutdown_card(void)
{
static void shutdown_card(void) {
u32 addr;
u8 tmp8, cnt = 0;
@ -1145,8 +1117,7 @@ static void shutdown_card(void)
}
#endif /* RTW_SUPPORT_PLATFORM_SHUTDOWN */
static int wifi_remove(struct platform_device *pdev)
{
static int wifi_remove(struct platform_device *pdev) {
struct wifi_platform_data *wifi_ctrl =
(struct wifi_platform_data *)(pdev->dev.platform_data);
@ -1161,8 +1132,7 @@ static int wifi_remove(struct platform_device *pdev)
}
#ifdef RTW_SUPPORT_PLATFORM_SHUTDOWN
static void wifi_shutdown(struct platform_device *pdev)
{
static void wifi_shutdown(struct platform_device *pdev) {
struct wifi_platform_data *wifi_ctrl =
(struct wifi_platform_data *)(pdev->dev.platform_data);
@ -1177,8 +1147,7 @@ static void wifi_shutdown(struct platform_device *pdev)
}
#endif /* RTW_SUPPORT_PLATFORM_SHUTDOWN */
static int wifi_suspend(struct platform_device *pdev, pm_message_t state)
{
static int wifi_suspend(struct platform_device *pdev, pm_message_t state) {
RTW_INFO("##> %s\n", __FUNCTION__);
#if (LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 39)) && defined(OOB_INTR_ONLY)
bcmsdh_oob_intr_set(0);
@ -1186,8 +1155,7 @@ static int wifi_suspend(struct platform_device *pdev, pm_message_t state)
return 0;
}
static int wifi_resume(struct platform_device *pdev)
{
static int wifi_resume(struct platform_device *pdev) {
RTW_INFO("##> %s\n", __FUNCTION__);
#if (LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 39)) && defined(OOB_INTR_ONLY)
if (dhd_os_check_if_up(bcmsdh_get_drvdata()))
@ -1220,16 +1188,14 @@ static struct platform_driver wifi_device_legacy = {
}
};
static int wifi_add_dev(void)
{
static int wifi_add_dev(void) {
RTW_INFO("## Calling platform_driver_register\n");
platform_driver_register(&wifi_device);
platform_driver_register(&wifi_device_legacy);
return 0;
}
static void wifi_del_dev(void)
{
static void wifi_del_dev(void) {
RTW_INFO("## Unregister platform_driver_register\n");
platform_driver_unregister(&wifi_device);
platform_driver_unregister(&wifi_device_legacy);
@ -1238,8 +1204,7 @@ static void wifi_del_dev(void)
#ifdef CONFIG_GPIO_WAKEUP
#ifdef CONFIG_PLATFORM_INTEL_BYT
int wifi_configure_gpio(void)
{
int wifi_configure_gpio(void) {
if (gpio_request(oob_gpio, "oob_irq")) {
RTW_INFO("## %s Cannot request GPIO\n", __FUNCTION__);
return -1;
@ -1260,8 +1225,7 @@ int wifi_configure_gpio(void)
return 0;
}
#endif /* CONFIG_PLATFORM_INTEL_BYT */
void wifi_free_gpio(unsigned int gpio)
{
void wifi_free_gpio(unsigned int gpio) {
#ifdef CONFIG_PLATFORM_INTEL_BYT
if (gpio)
gpio_free(gpio);