diff options
| author | Diogo Ferreira <defer@cyngn.com> | 2016-04-15 18:34:08 +0100 |
|---|---|---|
| committer | Mister Oyster <oysterized@gmail.com> | 2017-06-04 19:23:39 +0200 |
| commit | e5141469bf3130a2f309e57e93fec46e210b1353 (patch) | |
| tree | d58a8a4116e7b0637fa367911e3437856c5b4d38 /drivers | |
| parent | 32b40da073dfe62b420e4284fa74e09d8142c292 (diff) | |
mt6735: Add an option to multiplex AP and STA on wlan0
This adds CONFIG_MTK_COMBO_AOSP_TETHERING_SUPPORT which, when enabled,
allows ap and wlan to co-exist in the same interface, as Android
expects.
Most of this functionality is also available (albeit not compilable broken)
under CFG_TC1_FEATURE but that has larger implications around the radio
and usb stack that we do not want to adopt.
Change-Id: Ib1d1be40566f1bb9ccc7be45b49ec8d1f3b3ba58
Ticket: PORRIDGE-30
Diffstat (limited to 'drivers')
4 files changed, 13 insertions, 8 deletions
diff --git a/drivers/misc/mediatek/connectivity/Kconfig b/drivers/misc/mediatek/connectivity/Kconfig index ea1c3954f..16588dd44 100644 --- a/drivers/misc/mediatek/connectivity/Kconfig +++ b/drivers/misc/mediatek/connectivity/Kconfig @@ -279,6 +279,10 @@ config MTK_GPS_REGISTER_SETTING help GPS register settings. +config MTK_COMBO_AOSP_TETHERING_SUPPORT + bool "Multiplex wlan0 for both AP and STA" + default n + config MTK_COMBO_DISABLE_5G_FOR_P2P bool "Disable 5Ghz bands from P2P negotiations" default n diff --git a/drivers/misc/mediatek/connectivity/common/conn_soc/linux/pub/wmt_chrdev_wifi.c b/drivers/misc/mediatek/connectivity/common/conn_soc/linux/pub/wmt_chrdev_wifi.c index 7ccb60ed8..a075f46b5 100644 --- a/drivers/misc/mediatek/connectivity/common/conn_soc/linux/pub/wmt_chrdev_wifi.c +++ b/drivers/misc/mediatek/connectivity/common/conn_soc/linux/pub/wmt_chrdev_wifi.c @@ -60,7 +60,7 @@ UINT32 gDbgLevel = WIFI_LOG_DBG; #define VERSION "1.0" #define WLAN_IFACE_NAME "wlan0" -#if CFG_TC1_FEATURE +#if CFG_TC1_FEATURE || defined(CONFIG_MTK_COMBO_AOSP_TETHERING_SUPPORT) #define LEGACY_IFACE_NAME "legacy0" #endif @@ -73,7 +73,7 @@ enum { static INT32 wlan_mode = WLAN_MODE_HALT; static INT32 powered; static INT8 *ifname = WLAN_IFACE_NAME; -#if CFG_TC1_FEATURE +#if CFG_TC1_FEATURE || defined(CONFIG_MTK_COMBO_AOSP_TETHERING_SUPPORT) volatile INT32 wlan_if_changed = 0; EXPORT_SYMBOL(wlan_if_changed); #endif @@ -368,7 +368,7 @@ ssize_t WIFI_write(struct file *filp, const char __user *buf, size_t count, loff powered = 0; retval = count; wlan_mode = WLAN_MODE_HALT; -#if CFG_TC1_FEATURE +#if CFG_TC1_FEATURE || defined(CONFIG_MTK_COMBO_AOSP_TETHERING_SUPPORT) ifname = WLAN_IFACE_NAME; wlan_if_changed = 0; #endif @@ -491,7 +491,7 @@ ssize_t WIFI_write(struct file *filp, const char __user *buf, size_t count, loff } if (local[0] == 'S' || local[0] == 'P') { -#if CFG_TC1_FEATURE +#if CFG_TC1_FEATURE || defined(CONFIG_MTK_COMBO_AOSP_TETHERING_SUPPORT) /* Restore NIC name to wlan0 */ rtnl_lock(); if (strcmp(ifname, WLAN_IFACE_NAME) != 0) { @@ -518,7 +518,7 @@ ssize_t WIFI_write(struct file *filp, const char __user *buf, size_t count, loff retval = count; } } else if (local[0] == 'A') { -#if CFG_TC1_FEATURE +#if CFG_TC1_FEATURE || defined(CONFIG_MTK_COMBO_AOSP_TETHERING_SUPPORT) /* Change NIC name to legacy0, since wlan0 is used for AP */ rtnl_lock(); if (strcmp(ifname, LEGACY_IFACE_NAME) != 0) { diff --git a/drivers/misc/mediatek/connectivity/wlan/gen2/os/linux/gl_init.c b/drivers/misc/mediatek/connectivity/wlan/gen2/os/linux/gl_init.c index bbe91d87a..6a8b2a588 100644 --- a/drivers/misc/mediatek/connectivity/wlan/gen2/os/linux/gl_init.c +++ b/drivers/misc/mediatek/connectivity/wlan/gen2/os/linux/gl_init.c @@ -721,8 +721,9 @@ MODULE_SUPPORTED_DEVICE(NIC_NAME); MODULE_LICENSE("GPL"); #define NIC_INF_NAME "wlan%d" /* interface name */ -#if CFG_TC1_FEATURE +#if CFG_TC1_FEATURE || defined(CONFIG_MTK_COMBO_AOSP_TETHERING_SUPPORT) #define NIC_INF_NAME_IN_AP_MODE "legacy%d" +extern volatile int wlan_if_changed; #endif /* support to change debug module info dynamically */ @@ -2314,7 +2315,7 @@ static struct wireless_dev *wlanNetCreate(PVOID pvData) prGlueInfo = (P_GLUE_INFO_T) wiphy_priv(prWdev->wiphy); kalMemZero(prGlueInfo, sizeof(GLUE_INFO_T)); /* 4 <3.1> Create net device */ -#if CFG_TC1_FEATURE +#if CFG_TC1_FEATURE || defined(CONFIG_MTK_COMBO_AOSP_TETHERING_SUPPORT) if (wlan_if_changed) { prGlueInfo->prDevHandler = alloc_netdev_mq(sizeof(P_GLUE_INFO_T), NIC_INF_NAME_IN_AP_MODE, ether_setup, CFG_MAX_TXQ_NUM); diff --git a/drivers/misc/mediatek/connectivity/wlan/gen2/os/linux/gl_p2p_init.c b/drivers/misc/mediatek/connectivity/wlan/gen2/os/linux/gl_p2p_init.c index 89f54c5ca..080bfc205 100644 --- a/drivers/misc/mediatek/connectivity/wlan/gen2/os/linux/gl_p2p_init.c +++ b/drivers/misc/mediatek/connectivity/wlan/gen2/os/linux/gl_p2p_init.c @@ -41,7 +41,7 @@ */ #define P2P_MODE_INF_NAME "p2p%d" -#if CFG_TC1_FEATURE +#if CFG_TC1_FEATURE || defined(CONFIG_MTK_COMBO_AOSP_TETHERING_SUPPORT) #define AP_MODE_INF_NAME "wlan%d" #else #define AP_MODE_INF_NAME "ap%d" |
