2013-05-08 21:45:39 +00:00
|
|
|
/******************************************************************************
|
|
|
|
*
|
|
|
|
* Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved.
|
2014-12-19 06:59:46 +00:00
|
|
|
*
|
2013-05-08 21:45:39 +00:00
|
|
|
* This program is free software; you can redistribute it and/or modify it
|
|
|
|
* under the terms of version 2 of the GNU General Public License as
|
|
|
|
* published by the Free Software Foundation.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful, but WITHOUT
|
|
|
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
|
|
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
|
|
|
* more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License along with
|
|
|
|
* this program; if not, write to the Free Software Foundation, Inc.,
|
|
|
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
|
|
|
|
*
|
|
|
|
*
|
|
|
|
******************************************************************************/
|
|
|
|
|
|
|
|
#include <linux/module.h>
|
|
|
|
#include <linux/netdevice.h>
|
|
|
|
|
|
|
|
#include <rtw_android.h>
|
|
|
|
#include <osdep_service.h>
|
|
|
|
#include <rtw_debug.h>
|
|
|
|
#include <ioctl_cfg80211.h>
|
|
|
|
#include <rtw_ioctl_set.h>
|
|
|
|
|
2014-12-17 01:03:30 +00:00
|
|
|
#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
|
|
|
|
#endif /* defined(RTW_ENABLE_WIFI_CONTROL_FUNC) */
|
|
|
|
|
2013-05-29 19:26:48 +00:00
|
|
|
static const char *android_wifi_cmd_str[ANDROID_WIFI_CMD_MAX] = {
|
2013-05-08 21:45:39 +00:00
|
|
|
"START",
|
|
|
|
"STOP",
|
|
|
|
"SCAN-ACTIVE",
|
|
|
|
"SCAN-PASSIVE",
|
|
|
|
"RSSI",
|
|
|
|
"LINKSPEED",
|
|
|
|
"RXFILTER-START",
|
|
|
|
"RXFILTER-STOP",
|
|
|
|
"RXFILTER-ADD",
|
|
|
|
"RXFILTER-REMOVE",
|
|
|
|
"BTCOEXSCAN-START",
|
|
|
|
"BTCOEXSCAN-STOP",
|
|
|
|
"BTCOEXMODE",
|
|
|
|
"SETSUSPENDOPT",
|
|
|
|
"P2P_DEV_ADDR",
|
|
|
|
"SETFWPATH",
|
|
|
|
"SETBAND",
|
|
|
|
"GETBAND",
|
|
|
|
"COUNTRY",
|
|
|
|
"P2P_SET_NOA",
|
|
|
|
"P2P_GET_NOA",
|
|
|
|
"P2P_SET_PS",
|
|
|
|
"SET_AP_WPS_P2P_IE",
|
2014-12-17 01:03:30 +00:00
|
|
|
#ifdef PNO_SUPPORT
|
|
|
|
"PNOSSIDCLR",
|
|
|
|
"PNOSETUP ",
|
|
|
|
"PNOFORCE",
|
|
|
|
"PNODEBUG",
|
|
|
|
#endif
|
|
|
|
|
2013-05-08 21:45:39 +00:00
|
|
|
"MACADDR",
|
2014-12-17 01:03:30 +00:00
|
|
|
|
2013-05-08 21:45:39 +00:00
|
|
|
"BLOCK",
|
|
|
|
"WFD-ENABLE",
|
|
|
|
"WFD-DISABLE",
|
|
|
|
"WFD-SET-TCPPORT",
|
|
|
|
"WFD-SET-MAXTPUT",
|
2014-12-19 06:59:46 +00:00
|
|
|
"WFD-SET-DEVTYPE",
|
2013-05-08 21:45:39 +00:00
|
|
|
};
|
|
|
|
|
2014-12-17 01:03:30 +00:00
|
|
|
#ifdef PNO_SUPPORT
|
|
|
|
#define PNO_TLV_PREFIX 'S'
|
|
|
|
#define PNO_TLV_VERSION '1'
|
2014-12-19 06:59:46 +00:00
|
|
|
#define PNO_TLV_SUBVERSION '2'
|
2014-12-17 01:03:30 +00:00
|
|
|
#define PNO_TLV_RESERVED '0'
|
|
|
|
#define PNO_TLV_TYPE_SSID_IE 'S'
|
|
|
|
#define PNO_TLV_TYPE_TIME 'T'
|
|
|
|
#define PNO_TLV_FREQ_REPEAT 'R'
|
|
|
|
#define PNO_TLV_FREQ_EXPO_MAX 'M'
|
|
|
|
|
|
|
|
typedef struct cmd_tlv {
|
|
|
|
char prefix;
|
|
|
|
char version;
|
|
|
|
char subver;
|
|
|
|
char reserved;
|
|
|
|
} cmd_tlv_t;
|
|
|
|
#endif /* PNO_SUPPORT */
|
|
|
|
|
|
|
|
typedef struct android_wifi_priv_cmd {
|
|
|
|
char *buf;
|
2013-05-08 21:45:39 +00:00
|
|
|
int used_len;
|
|
|
|
int total_len;
|
2014-12-17 01:03:30 +00:00
|
|
|
} android_wifi_priv_cmd;
|
2013-05-08 21:45:39 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Local (static) functions and variables
|
|
|
|
*/
|
|
|
|
|
|
|
|
/* Initialize g_wifi_on to 1 so dhd_bus_start will be called for the first
|
|
|
|
* time (only) in dhd_open, subsequential wifi on will be handled by
|
|
|
|
* wl_android_wifi_on
|
|
|
|
*/
|
2014-12-29 02:13:24 +00:00
|
|
|
static int g_wifi_on = true;
|
2014-12-17 01:03:30 +00:00
|
|
|
|
|
|
|
static unsigned int oob_irq;
|
|
|
|
|
|
|
|
#ifdef PNO_SUPPORT
|
|
|
|
static int wl_android_set_pno_setup(struct net_device *dev, char *command, int total_len)
|
|
|
|
{
|
|
|
|
wlc_ssid_t ssids_local[MAX_PFN_LIST_COUNT];
|
|
|
|
int res = -1;
|
|
|
|
int nssid = 0;
|
|
|
|
cmd_tlv_t *cmd_tlv_temp;
|
|
|
|
char *str_ptr;
|
|
|
|
int tlv_size_left;
|
|
|
|
int pno_time = 0;
|
|
|
|
int pno_repeat = 0;
|
|
|
|
int pno_freq_expo_max = 0;
|
|
|
|
|
|
|
|
#ifdef PNO_SET_DEBUG
|
|
|
|
int i;
|
|
|
|
char pno_in_example[] = {
|
|
|
|
'P', 'N', 'O', 'S', 'E', 'T', 'U', 'P', ' ',
|
|
|
|
'S', '1', '2', '0',
|
|
|
|
'S',
|
|
|
|
0x05,
|
|
|
|
'd', 'l', 'i', 'n', 'k',
|
|
|
|
'S',
|
|
|
|
0x04,
|
|
|
|
'G', 'O', 'O', 'G',
|
|
|
|
'T',
|
|
|
|
'0', 'B',
|
|
|
|
'R',
|
|
|
|
'2',
|
|
|
|
'M',
|
|
|
|
'2',
|
|
|
|
0x00
|
|
|
|
};
|
|
|
|
#endif /* PNO_SET_DEBUG */
|
|
|
|
|
|
|
|
DHD_INFO(("%s: command=%s, len=%d\n", __FUNCTION__, command, total_len));
|
|
|
|
|
|
|
|
if (total_len < (strlen(CMD_PNOSETUP_SET) + sizeof(cmd_tlv_t))) {
|
2015-08-15 21:38:30 +00:00
|
|
|
DBG_88E("%s argument=%d less min size\n", __FUNCTION__, total_len);
|
2014-12-17 01:03:30 +00:00
|
|
|
goto exit_proc;
|
|
|
|
}
|
|
|
|
|
|
|
|
#ifdef PNO_SET_DEBUG
|
|
|
|
memcpy(command, pno_in_example, sizeof(pno_in_example));
|
|
|
|
for (i = 0; i < sizeof(pno_in_example); i++)
|
|
|
|
printf("%02X ", command[i]);
|
|
|
|
printf("\n");
|
|
|
|
total_len = sizeof(pno_in_example);
|
|
|
|
#endif
|
|
|
|
|
|
|
|
str_ptr = command + strlen(CMD_PNOSETUP_SET);
|
|
|
|
tlv_size_left = total_len - strlen(CMD_PNOSETUP_SET);
|
|
|
|
|
|
|
|
cmd_tlv_temp = (cmd_tlv_t *)str_ptr;
|
|
|
|
memset(ssids_local, 0, sizeof(ssids_local));
|
|
|
|
|
|
|
|
if ((cmd_tlv_temp->prefix == PNO_TLV_PREFIX) &&
|
|
|
|
(cmd_tlv_temp->version == PNO_TLV_VERSION) &&
|
|
|
|
(cmd_tlv_temp->subver == PNO_TLV_SUBVERSION)) {
|
|
|
|
|
|
|
|
str_ptr += sizeof(cmd_tlv_t);
|
|
|
|
tlv_size_left -= sizeof(cmd_tlv_t);
|
|
|
|
|
|
|
|
if ((nssid = wl_iw_parse_ssid_list_tlv(&str_ptr, ssids_local,
|
|
|
|
MAX_PFN_LIST_COUNT, &tlv_size_left)) <= 0) {
|
2015-08-15 21:38:30 +00:00
|
|
|
DBG_88E("SSID is not presented or corrupted ret=%d\n", nssid);
|
2014-12-17 01:03:30 +00:00
|
|
|
goto exit_proc;
|
|
|
|
} else {
|
|
|
|
if ((str_ptr[0] != PNO_TLV_TYPE_TIME) || (tlv_size_left <= 1)) {
|
2015-08-15 21:38:30 +00:00
|
|
|
DBG_88E("%s scan duration corrupted field size %d\n",
|
2014-12-17 01:03:30 +00:00
|
|
|
__FUNCTION__, tlv_size_left);
|
|
|
|
goto exit_proc;
|
|
|
|
}
|
|
|
|
str_ptr++;
|
|
|
|
pno_time = simple_strtoul(str_ptr, &str_ptr, 16);
|
|
|
|
DHD_INFO(("%s: pno_time=%d\n", __FUNCTION__, pno_time));
|
|
|
|
|
|
|
|
if (str_ptr[0] != 0) {
|
|
|
|
if ((str_ptr[0] != PNO_TLV_FREQ_REPEAT)) {
|
2015-08-15 21:38:30 +00:00
|
|
|
DBG_88E("%s pno repeat : corrupted field\n",
|
2014-12-17 01:03:30 +00:00
|
|
|
__FUNCTION__);
|
|
|
|
goto exit_proc;
|
|
|
|
}
|
|
|
|
str_ptr++;
|
|
|
|
pno_repeat = simple_strtoul(str_ptr, &str_ptr, 16);
|
|
|
|
DHD_INFO(("%s :got pno_repeat=%d\n", __FUNCTION__, pno_repeat));
|
|
|
|
if (str_ptr[0] != PNO_TLV_FREQ_EXPO_MAX) {
|
2015-08-15 21:38:30 +00:00
|
|
|
DBG_88E("%s FREQ_EXPO_MAX corrupted field size\n",
|
2014-12-17 01:03:30 +00:00
|
|
|
__FUNCTION__);
|
|
|
|
goto exit_proc;
|
|
|
|
}
|
|
|
|
str_ptr++;
|
|
|
|
pno_freq_expo_max = simple_strtoul(str_ptr, &str_ptr, 16);
|
|
|
|
DHD_INFO(("%s: pno_freq_expo_max=%d\n",
|
|
|
|
__FUNCTION__, pno_freq_expo_max));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} else {
|
2015-08-15 21:38:30 +00:00
|
|
|
DBG_88E("%s get wrong TLV command\n", __FUNCTION__);
|
2014-12-17 01:03:30 +00:00
|
|
|
goto exit_proc;
|
|
|
|
}
|
|
|
|
|
|
|
|
res = dhd_dev_pno_set(dev, ssids_local, nssid, pno_time, pno_repeat, pno_freq_expo_max);
|
|
|
|
|
|
|
|
exit_proc:
|
|
|
|
return res;
|
|
|
|
}
|
|
|
|
#endif /* PNO_SUPPORT */
|
2013-05-08 21:45:39 +00:00
|
|
|
|
|
|
|
int rtw_android_cmdstr_to_num(char *cmdstr)
|
|
|
|
{
|
|
|
|
int cmd_num;
|
2015-08-15 18:06:32 +00:00
|
|
|
for (cmd_num=0 ; cmd_num<ANDROID_WIFI_CMD_MAX; cmd_num++)
|
2015-02-24 15:42:06 +00:00
|
|
|
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 0, 0))
|
|
|
|
if (!strncasecmp(cmdstr, android_wifi_cmd_str[cmd_num],
|
|
|
|
strlen(android_wifi_cmd_str[cmd_num])))
|
|
|
|
#else
|
2015-08-15 18:02:34 +00:00
|
|
|
if (0 == strnicmp(cmdstr, android_wifi_cmd_str[cmd_num],
|
2015-02-24 15:42:06 +00:00
|
|
|
strlen(android_wifi_cmd_str[cmd_num])))
|
|
|
|
#endif
|
2013-05-08 21:45:39 +00:00
|
|
|
break;
|
2014-12-19 06:59:46 +00:00
|
|
|
|
2013-05-08 21:45:39 +00:00
|
|
|
return cmd_num;
|
|
|
|
}
|
|
|
|
|
2014-12-17 01:03:30 +00:00
|
|
|
static int rtw_android_get_rssi(struct net_device *net, char *command, int total_len)
|
2013-05-08 21:45:39 +00:00
|
|
|
{
|
2014-12-17 23:13:53 +00:00
|
|
|
struct adapter *padapter = (struct adapter *)rtw_netdev_priv(net);
|
2018-08-30 18:19:58 +00:00
|
|
|
struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
|
2013-05-08 21:45:39 +00:00
|
|
|
struct wlan_network *pcur_network = &pmlmepriv->cur_network;
|
|
|
|
int bytes_written = 0;
|
|
|
|
|
2015-08-15 18:02:34 +00:00
|
|
|
if (check_fwstate(pmlmepriv, _FW_LINKED) == true) {
|
2014-12-19 06:59:46 +00:00
|
|
|
bytes_written += snprintf(&command[bytes_written], total_len, "%s rssi %d",
|
2014-12-17 01:03:30 +00:00
|
|
|
pcur_network->network.Ssid.Ssid, padapter->recvpriv.rssi);
|
2013-05-08 21:45:39 +00:00
|
|
|
}
|
2014-12-17 01:03:30 +00:00
|
|
|
|
2013-05-08 21:45:39 +00:00
|
|
|
return bytes_written;
|
|
|
|
}
|
|
|
|
|
2014-12-17 01:03:30 +00:00
|
|
|
static int rtw_android_get_link_speed(struct net_device *net, char *command, int total_len)
|
2013-05-08 21:45:39 +00:00
|
|
|
{
|
2014-12-17 23:13:53 +00:00
|
|
|
struct adapter *padapter = (struct adapter *)rtw_netdev_priv(net);
|
2018-08-30 18:19:58 +00:00
|
|
|
struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
|
2014-12-17 01:03:30 +00:00
|
|
|
struct wlan_network *pcur_network = &pmlmepriv->cur_network;
|
|
|
|
int bytes_written = 0;
|
|
|
|
u16 link_speed = 0;
|
|
|
|
|
|
|
|
link_speed = rtw_get_cur_max_rate(padapter)/10;
|
|
|
|
bytes_written = snprintf(command, total_len, "LinkSpeed %d", link_speed);
|
2013-05-08 21:45:39 +00:00
|
|
|
|
|
|
|
return bytes_written;
|
|
|
|
}
|
|
|
|
|
2014-12-17 01:03:30 +00:00
|
|
|
static int rtw_android_get_macaddr(struct net_device *net, char *command, int total_len)
|
2013-05-08 21:45:39 +00:00
|
|
|
{
|
2014-12-17 23:13:53 +00:00
|
|
|
struct adapter *adapter = (struct adapter *)rtw_netdev_priv(net);
|
2014-12-17 01:03:30 +00:00
|
|
|
int bytes_written = 0;
|
2014-12-19 06:59:46 +00:00
|
|
|
|
2014-12-17 01:03:30 +00:00
|
|
|
bytes_written = snprintf(command, total_len, "Macaddr = "MAC_FMT, MAC_ARG(net->dev_addr));
|
2013-05-08 21:45:39 +00:00
|
|
|
return bytes_written;
|
|
|
|
}
|
|
|
|
|
2014-12-17 01:03:30 +00:00
|
|
|
static int rtw_android_set_country(struct net_device *net, char *command, int total_len)
|
2013-05-08 21:45:39 +00:00
|
|
|
{
|
2014-12-17 23:13:53 +00:00
|
|
|
struct adapter *adapter = (struct adapter *)rtw_netdev_priv(net);
|
2013-05-08 21:45:39 +00:00
|
|
|
char *country_code = command + strlen(android_wifi_cmd_str[ANDROID_WIFI_CMD_COUNTRY]) + 1;
|
2014-12-17 01:03:30 +00:00
|
|
|
int ret = _FAIL;
|
2014-12-19 06:59:46 +00:00
|
|
|
|
2013-05-08 21:45:39 +00:00
|
|
|
ret = rtw_set_country(adapter, country_code);
|
2014-12-17 01:03:30 +00:00
|
|
|
|
|
|
|
return (ret==_SUCCESS)?0:-1;
|
2013-05-08 21:45:39 +00:00
|
|
|
}
|
|
|
|
|
2014-12-17 01:03:30 +00:00
|
|
|
static int rtw_android_get_p2p_dev_addr(struct net_device *net, char *command, int total_len)
|
2013-05-08 21:45:39 +00:00
|
|
|
{
|
2014-12-17 01:03:30 +00:00
|
|
|
int bytes_written = 0;
|
|
|
|
|
2015-02-20 04:11:26 +00:00
|
|
|
/* We use the same address as our HW MAC address */
|
2015-02-19 20:50:04 +00:00
|
|
|
memcpy(command, net->dev_addr, ETH_ALEN);
|
2014-12-19 06:59:46 +00:00
|
|
|
|
2014-12-17 01:03:30 +00:00
|
|
|
bytes_written = ETH_ALEN;
|
|
|
|
return bytes_written;
|
2013-05-08 21:45:39 +00:00
|
|
|
}
|
|
|
|
|
2014-12-17 01:03:30 +00:00
|
|
|
static int rtw_android_set_block(struct net_device *net, char *command, int total_len)
|
2013-05-08 21:45:39 +00:00
|
|
|
{
|
2014-12-17 23:13:53 +00:00
|
|
|
struct adapter *adapter = (struct adapter *)rtw_netdev_priv(net);
|
2014-12-17 01:03:30 +00:00
|
|
|
char *block_value = command + strlen(android_wifi_cmd_str[ANDROID_WIFI_CMD_BLOCK]) + 1;
|
|
|
|
|
2014-12-29 02:13:24 +00:00
|
|
|
wdev_to_priv(adapter->rtw_wdev)->block = (*block_value=='0')?false:true;
|
2013-05-08 21:45:39 +00:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2014-12-17 01:03:30 +00:00
|
|
|
static int get_int_from_command(char *pcmd)
|
|
|
|
{
|
|
|
|
int i = 0;
|
|
|
|
|
2015-08-15 18:06:32 +00:00
|
|
|
for ( i = 0; i < strlen( pcmd ); i++ )
|
2014-12-17 01:03:30 +00:00
|
|
|
{
|
|
|
|
if ( pcmd[ i ] == '=' )
|
|
|
|
{
|
2015-02-20 04:11:26 +00:00
|
|
|
/* Skip the '=' and space characters. */
|
2014-12-17 01:03:30 +00:00
|
|
|
i += 2;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return ( rtw_atoi( pcmd + i ) );
|
|
|
|
}
|
|
|
|
|
2013-05-08 21:45:39 +00:00
|
|
|
int rtw_android_priv_cmd(struct net_device *net, struct ifreq *ifr, int cmd)
|
|
|
|
{
|
|
|
|
int ret = 0;
|
|
|
|
char *command = NULL;
|
|
|
|
int cmd_num;
|
|
|
|
int bytes_written = 0;
|
2014-12-17 01:03:30 +00:00
|
|
|
android_wifi_priv_cmd priv_cmd;
|
2014-12-17 23:13:53 +00:00
|
|
|
struct adapter* padapter = ( struct adapter * ) rtw_netdev_priv(net);
|
2015-03-02 04:48:40 +00:00
|
|
|
#ifdef CONFIG_P2P
|
2014-12-17 01:03:30 +00:00
|
|
|
struct wifi_display_info *pwfd_info;
|
|
|
|
#endif
|
2013-05-08 21:45:39 +00:00
|
|
|
|
|
|
|
rtw_lock_suspend();
|
2014-12-17 01:03:30 +00:00
|
|
|
|
2013-05-08 21:45:39 +00:00
|
|
|
if (!ifr->ifr_data) {
|
|
|
|
ret = -EINVAL;
|
|
|
|
goto exit;
|
|
|
|
}
|
2014-12-17 01:03:30 +00:00
|
|
|
if (copy_from_user(&priv_cmd, ifr->ifr_data, sizeof(android_wifi_priv_cmd))) {
|
2013-05-08 21:45:39 +00:00
|
|
|
ret = -EFAULT;
|
|
|
|
goto exit;
|
|
|
|
}
|
2014-12-19 06:59:46 +00:00
|
|
|
|
2015-08-15 21:38:30 +00:00
|
|
|
/* DBG_88E("%s priv_cmd.buf=%p priv_cmd.total_len=%d priv_cmd.used_len=%d\n",__func__,priv_cmd.buf,priv_cmd.total_len,priv_cmd.used_len); */
|
2014-12-17 01:03:30 +00:00
|
|
|
command = rtw_zmalloc(priv_cmd.total_len);
|
|
|
|
if (!command)
|
|
|
|
{
|
2015-08-15 21:38:30 +00:00
|
|
|
DBG_88E("%s: failed to allocate memory\n", __FUNCTION__);
|
2013-05-08 21:45:39 +00:00
|
|
|
ret = -ENOMEM;
|
|
|
|
goto exit;
|
|
|
|
}
|
2014-12-17 01:03:30 +00:00
|
|
|
|
2021-04-09 21:34:42 +00:00
|
|
|
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 18, 0))
|
2019-10-16 16:47:29 +00:00
|
|
|
if (!access_ok(priv_cmd.buf, priv_cmd.total_len)) {
|
|
|
|
#else
|
|
|
|
if (!access_ok(VERIFY_READ, (const void __user *)priv_cmd.buf,
|
|
|
|
priv_cmd.total_len)) {
|
|
|
|
#endif
|
2015-08-15 21:38:30 +00:00
|
|
|
DBG_88E("%s: failed to access memory\n", __FUNCTION__);
|
2013-05-08 21:45:39 +00:00
|
|
|
ret = -EFAULT;
|
|
|
|
goto exit;
|
2014-12-17 01:03:30 +00:00
|
|
|
}
|
2015-01-29 21:27:28 +00:00
|
|
|
if (copy_from_user(command, (const void __user *)priv_cmd.buf, priv_cmd.total_len)) {
|
2013-05-08 21:45:39 +00:00
|
|
|
ret = -EFAULT;
|
|
|
|
goto exit;
|
|
|
|
}
|
2014-12-17 01:03:30 +00:00
|
|
|
|
2015-08-15 21:38:30 +00:00
|
|
|
DBG_88E("%s: Android private cmd \"%s\" on %s\n"
|
2014-12-17 01:03:30 +00:00
|
|
|
, __FUNCTION__, command, ifr->ifr_name);
|
|
|
|
|
2013-05-08 21:45:39 +00:00
|
|
|
cmd_num = rtw_android_cmdstr_to_num(command);
|
2014-12-19 06:59:46 +00:00
|
|
|
|
2015-08-15 18:05:44 +00:00
|
|
|
switch (cmd_num) {
|
2013-05-08 21:45:39 +00:00
|
|
|
case ANDROID_WIFI_CMD_START:
|
2015-02-20 04:11:26 +00:00
|
|
|
/* bytes_written = wl_android_wifi_on(net); */
|
2013-05-08 21:45:39 +00:00
|
|
|
goto response;
|
|
|
|
case ANDROID_WIFI_CMD_SETFWPATH:
|
|
|
|
goto response;
|
|
|
|
}
|
2014-12-17 01:03:30 +00:00
|
|
|
|
2013-05-08 21:45:39 +00:00
|
|
|
if (!g_wifi_on) {
|
2015-08-15 21:38:30 +00:00
|
|
|
DBG_88E("%s: Ignore private cmd \"%s\" - iface %s is down\n"
|
2014-12-17 01:03:30 +00:00
|
|
|
,__FUNCTION__, command, ifr->ifr_name);
|
2013-05-08 21:45:39 +00:00
|
|
|
ret = 0;
|
|
|
|
goto exit;
|
|
|
|
}
|
2014-12-17 01:03:30 +00:00
|
|
|
|
2015-08-15 18:05:44 +00:00
|
|
|
switch (cmd_num) {
|
2014-12-17 01:03:30 +00:00
|
|
|
|
2013-05-08 21:45:39 +00:00
|
|
|
case ANDROID_WIFI_CMD_STOP:
|
|
|
|
break;
|
|
|
|
case ANDROID_WIFI_CMD_SCAN_ACTIVE:
|
|
|
|
break;
|
|
|
|
case ANDROID_WIFI_CMD_SCAN_PASSIVE:
|
|
|
|
break;
|
|
|
|
case ANDROID_WIFI_CMD_RSSI:
|
2014-12-17 01:03:30 +00:00
|
|
|
bytes_written = rtw_android_get_rssi(net, command, priv_cmd.total_len);
|
2013-05-08 21:45:39 +00:00
|
|
|
break;
|
|
|
|
case ANDROID_WIFI_CMD_LINKSPEED:
|
2014-12-17 01:03:30 +00:00
|
|
|
bytes_written = rtw_android_get_link_speed(net, command, priv_cmd.total_len);
|
2013-05-08 21:45:39 +00:00
|
|
|
break;
|
|
|
|
case ANDROID_WIFI_CMD_MACADDR:
|
2014-12-17 01:03:30 +00:00
|
|
|
bytes_written = rtw_android_get_macaddr(net, command, priv_cmd.total_len);
|
2013-05-08 21:45:39 +00:00
|
|
|
break;
|
|
|
|
case ANDROID_WIFI_CMD_BLOCK:
|
2014-12-17 01:03:30 +00:00
|
|
|
bytes_written = rtw_android_set_block(net, command, priv_cmd.total_len);
|
2013-05-08 21:45:39 +00:00
|
|
|
break;
|
|
|
|
case ANDROID_WIFI_CMD_RXFILTER_START:
|
|
|
|
break;
|
|
|
|
case ANDROID_WIFI_CMD_RXFILTER_STOP:
|
|
|
|
break;
|
|
|
|
case ANDROID_WIFI_CMD_RXFILTER_ADD:
|
|
|
|
break;
|
|
|
|
case ANDROID_WIFI_CMD_RXFILTER_REMOVE:
|
|
|
|
break;
|
|
|
|
case ANDROID_WIFI_CMD_BTCOEXSCAN_START:
|
|
|
|
/* TBD: BTCOEXSCAN-START */
|
|
|
|
break;
|
|
|
|
case ANDROID_WIFI_CMD_BTCOEXSCAN_STOP:
|
|
|
|
/* TBD: BTCOEXSCAN-STOP */
|
|
|
|
break;
|
|
|
|
case ANDROID_WIFI_CMD_BTCOEXMODE:
|
|
|
|
break;
|
|
|
|
case ANDROID_WIFI_CMD_SETSUSPENDOPT:
|
|
|
|
break;
|
|
|
|
case ANDROID_WIFI_CMD_SETBAND:
|
2014-12-17 01:03:30 +00:00
|
|
|
{
|
|
|
|
uint band = *(command + strlen("SETBAND") + 1) - '0';
|
2014-12-17 23:13:53 +00:00
|
|
|
struct adapter* padapter = ( struct adapter * ) rtw_netdev_priv(net);
|
2014-12-17 01:03:30 +00:00
|
|
|
|
|
|
|
if (padapter->chip_type == RTL8192D)
|
|
|
|
padapter->setband = band;
|
|
|
|
|
2013-05-08 21:45:39 +00:00
|
|
|
break;
|
2014-12-17 01:03:30 +00:00
|
|
|
}
|
2013-05-08 21:45:39 +00:00
|
|
|
case ANDROID_WIFI_CMD_GETBAND:
|
|
|
|
break;
|
|
|
|
case ANDROID_WIFI_CMD_COUNTRY:
|
2014-12-17 01:03:30 +00:00
|
|
|
bytes_written = rtw_android_set_country(net, command, priv_cmd.total_len);
|
|
|
|
break;
|
|
|
|
#ifdef PNO_SUPPORT
|
|
|
|
case ANDROID_WIFI_CMD_PNOSSIDCLR_SET:
|
|
|
|
break;
|
|
|
|
case ANDROID_WIFI_CMD_PNOSETUP_SET:
|
2013-05-08 21:45:39 +00:00
|
|
|
break;
|
2014-12-17 01:03:30 +00:00
|
|
|
case ANDROID_WIFI_CMD_PNOENABLE_SET:
|
|
|
|
break;
|
|
|
|
#endif
|
2013-05-08 21:45:39 +00:00
|
|
|
case ANDROID_WIFI_CMD_P2P_DEV_ADDR:
|
2014-12-17 01:03:30 +00:00
|
|
|
bytes_written = rtw_android_get_p2p_dev_addr(net, command, priv_cmd.total_len);
|
2013-05-08 21:45:39 +00:00
|
|
|
break;
|
|
|
|
case ANDROID_WIFI_CMD_P2P_SET_NOA:
|
|
|
|
break;
|
|
|
|
case ANDROID_WIFI_CMD_P2P_GET_NOA:
|
|
|
|
break;
|
|
|
|
case ANDROID_WIFI_CMD_P2P_SET_PS:
|
|
|
|
break;
|
2014-12-17 01:03:30 +00:00
|
|
|
case ANDROID_WIFI_CMD_SET_AP_WPS_P2P_IE:
|
|
|
|
{
|
|
|
|
int skip = strlen(android_wifi_cmd_str[ANDROID_WIFI_CMD_SET_AP_WPS_P2P_IE]) + 3;
|
|
|
|
bytes_written = rtw_cfg80211_set_mgnt_wpsp2pie(net, command + skip, priv_cmd.total_len - skip, *(command + skip - 2) - '0');
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
2015-03-02 04:48:40 +00:00
|
|
|
#ifdef CONFIG_P2P
|
2014-12-17 01:03:30 +00:00
|
|
|
case ANDROID_WIFI_CMD_WFD_ENABLE:
|
2015-02-20 04:11:26 +00:00
|
|
|
/* Commented by Albert 2012/07/24 */
|
|
|
|
/* We can enable the WFD function by using the following command: */
|
|
|
|
/* wpa_cli driver wfd-enable */
|
2014-12-17 01:03:30 +00:00
|
|
|
|
|
|
|
pwfd_info = &padapter->wfd_info;
|
2015-08-15 18:02:34 +00:00
|
|
|
if ( padapter->wdinfo.driver_interface == DRIVER_CFG80211 )
|
2014-12-29 02:13:24 +00:00
|
|
|
pwfd_info->wfd_enable = true;
|
2014-12-17 01:03:30 +00:00
|
|
|
break;
|
|
|
|
case ANDROID_WIFI_CMD_WFD_DISABLE:
|
2015-02-20 04:11:26 +00:00
|
|
|
/* Commented by Albert 2012/07/24 */
|
|
|
|
/* We can disable the WFD function by using the following command: */
|
|
|
|
/* wpa_cli driver wfd-disable */
|
2014-12-17 01:03:30 +00:00
|
|
|
|
|
|
|
pwfd_info = &padapter->wfd_info;
|
2015-08-15 18:02:34 +00:00
|
|
|
if ( padapter->wdinfo.driver_interface == DRIVER_CFG80211 )
|
2014-12-29 02:13:24 +00:00
|
|
|
pwfd_info->wfd_enable = false;
|
2014-12-17 01:03:30 +00:00
|
|
|
break;
|
|
|
|
case ANDROID_WIFI_CMD_WFD_SET_TCPPORT:
|
2015-02-20 04:11:26 +00:00
|
|
|
/* Commented by Albert 2012/07/24 */
|
|
|
|
/* We can set the tcp port number by using the following command: */
|
|
|
|
/* wpa_cli driver wfd-set-tcpport = 554 */
|
2014-12-17 01:03:30 +00:00
|
|
|
|
|
|
|
pwfd_info = &padapter->wfd_info;
|
2015-08-15 18:02:34 +00:00
|
|
|
if ( padapter->wdinfo.driver_interface == DRIVER_CFG80211 )
|
2014-12-17 01:03:30 +00:00
|
|
|
pwfd_info->rtsp_ctrlport = (u16)get_int_from_command(priv_cmd.buf);
|
|
|
|
break;
|
|
|
|
case ANDROID_WIFI_CMD_WFD_SET_MAX_TPUT:
|
|
|
|
break;
|
|
|
|
case ANDROID_WIFI_CMD_WFD_SET_DEVTYPE:
|
|
|
|
{
|
2015-02-20 04:11:26 +00:00
|
|
|
/* Commented by Albert 2012/08/28 */
|
|
|
|
/* Specify the WFD device type ( WFD source/primary sink ) */
|
2014-12-19 06:59:46 +00:00
|
|
|
|
2014-12-17 01:03:30 +00:00
|
|
|
struct wifi_display_info *pwfd_info;
|
2014-12-17 23:13:53 +00:00
|
|
|
struct adapter* padapter = ( struct adapter * ) rtw_netdev_priv(net);
|
2014-12-19 06:59:46 +00:00
|
|
|
|
2014-12-17 01:03:30 +00:00
|
|
|
pwfd_info = &padapter->wfd_info;
|
|
|
|
if (padapter->wdinfo.driver_interface == DRIVER_CFG80211) {
|
|
|
|
pwfd_info->wfd_device_type = (u8)get_int_from_command(priv_cmd.buf);
|
2014-12-19 06:59:46 +00:00
|
|
|
|
2014-12-17 01:03:30 +00:00
|
|
|
pwfd_info->wfd_device_type &= WFD_DEVINFO_DUAL;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
#endif
|
2013-05-08 21:45:39 +00:00
|
|
|
default:
|
2015-08-15 21:38:30 +00:00
|
|
|
DBG_88E("Unknown PRIVATE command %s - ignored\n", command);
|
2013-05-08 21:45:39 +00:00
|
|
|
snprintf(command, 3, "OK");
|
|
|
|
bytes_written = strlen("OK");
|
|
|
|
}
|
|
|
|
|
|
|
|
response:
|
|
|
|
if (bytes_written >= 0) {
|
|
|
|
if ((bytes_written == 0) && (priv_cmd.total_len > 0))
|
|
|
|
command[0] = '\0';
|
|
|
|
if (bytes_written >= priv_cmd.total_len) {
|
2015-08-15 21:38:30 +00:00
|
|
|
DBG_88E("%s: bytes_written = %d\n", __FUNCTION__, bytes_written);
|
2013-05-08 21:45:39 +00:00
|
|
|
bytes_written = priv_cmd.total_len;
|
|
|
|
} else {
|
|
|
|
bytes_written++;
|
|
|
|
}
|
|
|
|
priv_cmd.used_len = bytes_written;
|
2015-01-29 21:27:28 +00:00
|
|
|
if (copy_to_user((void __user *)priv_cmd.buf, command, bytes_written)) {
|
2015-08-15 21:38:30 +00:00
|
|
|
DBG_88E("%s: failed to copy data to user buffer\n", __FUNCTION__);
|
2013-05-08 21:45:39 +00:00
|
|
|
ret = -EFAULT;
|
|
|
|
}
|
2014-12-17 01:03:30 +00:00
|
|
|
}
|
|
|
|
else {
|
2013-05-08 21:45:39 +00:00
|
|
|
ret = bytes_written;
|
|
|
|
}
|
2014-12-17 01:03:30 +00:00
|
|
|
|
2013-05-08 21:45:39 +00:00
|
|
|
exit:
|
|
|
|
rtw_unlock_suspend();
|
2014-12-17 01:03:30 +00:00
|
|
|
if (command) {
|
|
|
|
rtw_mfree(command, priv_cmd.total_len);
|
|
|
|
}
|
|
|
|
|
2013-05-08 21:45:39 +00:00
|
|
|
return ret;
|
|
|
|
}
|
2014-12-17 01:03:30 +00:00
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Functions for Android WiFi card detection
|
|
|
|
*/
|
|
|
|
#if defined(RTW_ENABLE_WIFI_CONTROL_FUNC)
|
|
|
|
|
|
|
|
static int g_wifidev_registered = 0;
|
|
|
|
static struct semaphore wifi_control_sem;
|
|
|
|
static struct wifi_platform_data *wifi_control_data = NULL;
|
|
|
|
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 ret = 0;
|
|
|
|
sema_init(&wifi_control_sem, 0);
|
|
|
|
|
|
|
|
ret = wifi_add_dev();
|
|
|
|
if (ret) {
|
2015-08-15 21:38:30 +00:00
|
|
|
DBG_88E("%s: platform_driver_register failed\n", __FUNCTION__);
|
2014-12-17 01:03:30 +00:00
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
g_wifidev_registered = 1;
|
|
|
|
|
|
|
|
/* Waiting callback after platform_driver_register is done or exit with error */
|
|
|
|
if (down_timeout(&wifi_control_sem, msecs_to_jiffies(1000)) != 0) {
|
|
|
|
ret = -EINVAL;
|
2015-08-15 21:38:30 +00:00
|
|
|
DBG_88E("%s: platform_driver_register timeout\n", __FUNCTION__);
|
2014-12-17 01:03:30 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
|
|
|
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 *alloc_ptr = NULL;
|
|
|
|
if (wifi_control_data && wifi_control_data->mem_prealloc) {
|
|
|
|
alloc_ptr = wifi_control_data->mem_prealloc(section, size);
|
|
|
|
if (alloc_ptr) {
|
2015-08-15 21:38:30 +00:00
|
|
|
DBG_88E("success alloc section %d\n", section);
|
2014-12-17 01:03:30 +00:00
|
|
|
if (size != 0L)
|
|
|
|
memset(alloc_ptr, 0, size);
|
|
|
|
return alloc_ptr;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2015-08-15 21:38:30 +00:00
|
|
|
DBG_88E("can't alloc section %d\n", section);
|
2014-12-17 01:03:30 +00:00
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
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;
|
|
|
|
}
|
|
|
|
#ifdef CUSTOM_OOB_GPIO_NUM
|
|
|
|
return CUSTOM_OOB_GPIO_NUM;
|
|
|
|
#else
|
|
|
|
return -1;
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
|
|
|
int wifi_set_power(int on, unsigned long msec)
|
|
|
|
{
|
2015-08-15 21:38:30 +00:00
|
|
|
DBG_88E("%s = %d\n", __FUNCTION__, on);
|
2014-12-17 01:03:30 +00:00
|
|
|
if (wifi_control_data && wifi_control_data->set_power) {
|
|
|
|
wifi_control_data->set_power(on);
|
|
|
|
}
|
|
|
|
if (msec)
|
|
|
|
msleep(msec);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 35))
|
|
|
|
int wifi_get_mac_addr(unsigned char *buf)
|
|
|
|
{
|
2015-08-15 21:38:30 +00:00
|
|
|
DBG_88E("%s\n", __FUNCTION__);
|
2014-12-17 01:03:30 +00:00
|
|
|
if (!buf)
|
|
|
|
return -EINVAL;
|
|
|
|
if (wifi_control_data && wifi_control_data->get_mac_addr) {
|
|
|
|
return wifi_control_data->get_mac_addr(buf);
|
|
|
|
}
|
|
|
|
return -EOPNOTSUPP;
|
|
|
|
}
|
|
|
|
#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)
|
|
|
|
{
|
2015-08-15 21:38:30 +00:00
|
|
|
DBG_88E("%s\n", __FUNCTION__);
|
2014-12-17 01:03:30 +00:00
|
|
|
if (!ccode)
|
|
|
|
return NULL;
|
|
|
|
if (wifi_control_data && wifi_control_data->get_country_code) {
|
|
|
|
return wifi_control_data->get_country_code(ccode);
|
|
|
|
}
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
#endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 39)) */
|
|
|
|
|
|
|
|
static int wifi_set_carddetect(int on)
|
|
|
|
{
|
2015-08-15 21:38:30 +00:00
|
|
|
DBG_88E("%s = %d\n", __FUNCTION__, on);
|
2014-12-17 01:03:30 +00:00
|
|
|
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)
|
|
|
|
{
|
|
|
|
struct wifi_platform_data *wifi_ctrl =
|
|
|
|
(struct wifi_platform_data *)(pdev->dev.platform_data);
|
|
|
|
int wifi_wake_gpio = 0;
|
|
|
|
|
2015-08-15 21:38:30 +00:00
|
|
|
DBG_88E("## %s\n", __FUNCTION__);
|
2014-12-17 01:03:30 +00:00
|
|
|
wifi_irqres = platform_get_resource_byname(pdev, IORESOURCE_IRQ, "bcmdhd_wlan_irq");
|
|
|
|
|
|
|
|
if (wifi_irqres == NULL)
|
|
|
|
wifi_irqres = platform_get_resource_byname(pdev,
|
|
|
|
IORESOURCE_IRQ, "bcm4329_wlan_irq");
|
|
|
|
else
|
|
|
|
wifi_wake_gpio = wifi_irqres->start;
|
|
|
|
|
|
|
|
wifi_control_data = wifi_ctrl;
|
|
|
|
|
|
|
|
wifi_set_power(1, 0); /* Power On */
|
|
|
|
wifi_set_carddetect(1); /* CardDetect (0->1) */
|
|
|
|
|
|
|
|
up(&wifi_control_sem);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
static int wifi_remove(struct platform_device *pdev)
|
|
|
|
{
|
|
|
|
struct wifi_platform_data *wifi_ctrl =
|
|
|
|
(struct wifi_platform_data *)(pdev->dev.platform_data);
|
|
|
|
|
2015-08-15 21:38:30 +00:00
|
|
|
DBG_88E("## %s\n", __FUNCTION__);
|
2014-12-17 01:03:30 +00:00
|
|
|
wifi_control_data = wifi_ctrl;
|
|
|
|
|
|
|
|
wifi_set_power(0, 0); /* Power Off */
|
|
|
|
wifi_set_carddetect(0); /* CardDetect (1->0) */
|
|
|
|
|
|
|
|
up(&wifi_control_sem);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
static int wifi_suspend(struct platform_device *pdev, pm_message_t state)
|
|
|
|
{
|
2015-08-15 21:38:30 +00:00
|
|
|
DBG_88E("##> %s\n", __FUNCTION__);
|
2014-12-17 01:03:30 +00:00
|
|
|
#if (LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 39)) && defined(OOB_INTR_ONLY)
|
|
|
|
bcmsdh_oob_intr_set(0);
|
|
|
|
#endif
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
static int wifi_resume(struct platform_device *pdev)
|
|
|
|
{
|
2015-08-15 21:38:30 +00:00
|
|
|
DBG_88E("##> %s\n", __FUNCTION__);
|
2014-12-17 01:03:30 +00:00
|
|
|
#if (LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 39)) && defined(OOB_INTR_ONLY)
|
|
|
|
if (dhd_os_check_if_up(bcmsdh_get_drvdata()))
|
|
|
|
bcmsdh_oob_intr_set(1);
|
|
|
|
#endif
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* temporarily use these two */
|
|
|
|
static struct platform_driver wifi_device = {
|
|
|
|
.probe = wifi_probe,
|
|
|
|
.remove = wifi_remove,
|
|
|
|
.suspend = wifi_suspend,
|
|
|
|
.resume = wifi_resume,
|
|
|
|
.driver = {
|
|
|
|
.name = "bcmdhd_wlan",
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
static struct platform_driver wifi_device_legacy = {
|
|
|
|
.probe = wifi_probe,
|
|
|
|
.remove = wifi_remove,
|
|
|
|
.suspend = wifi_suspend,
|
|
|
|
.resume = wifi_resume,
|
|
|
|
.driver = {
|
|
|
|
.name = "bcm4329_wlan",
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
static int wifi_add_dev(void)
|
|
|
|
{
|
2015-08-15 21:38:30 +00:00
|
|
|
DBG_88E("## Calling platform_driver_register\n");
|
2014-12-17 01:03:30 +00:00
|
|
|
platform_driver_register(&wifi_device);
|
|
|
|
platform_driver_register(&wifi_device_legacy);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void wifi_del_dev(void)
|
|
|
|
{
|
2015-08-15 21:38:30 +00:00
|
|
|
DBG_88E("## Unregister platform_driver_register\n");
|
2014-12-17 01:03:30 +00:00
|
|
|
platform_driver_unregister(&wifi_device);
|
|
|
|
platform_driver_unregister(&wifi_device_legacy);
|
|
|
|
}
|
|
|
|
#endif /* defined(RTW_ENABLE_WIFI_CONTROL_FUNC) */
|