diff options
author | Andy Green <andy.green@linaro.org> | 2015-01-02 09:11:45 +0800 |
---|---|---|
committer | Andy Green <andy.green@linaro.org> | 2015-01-06 11:14:58 +0800 |
commit | 96466af7ad1a8ee09fb309829d6e8864b8d75fd4 (patch) | |
tree | f31cbeedcb0e065a9ba7bbe06de77e58e8280a1e | |
parent | d04dea35d69b4690ecf7fc40e4e1d9b81f5817d7 (diff) |
prima fb05253 uplevelmainline-basis-test-2015-01-06-2
Signed-off-by: Andy Green <andy.green@linaro.org>
63 files changed, 2951 insertions, 672 deletions
diff --git a/arch/arm/boot/dts/msm8916-memory.dtsi b/arch/arm/boot/dts/msm8916-memory.dtsi index a2565250551b..898e6df03d24 100644 --- a/arch/arm/boot/dts/msm8916-memory.dtsi +++ b/arch/arm/boot/dts/msm8916-memory.dtsi @@ -10,8 +10,6 @@ * GNU General Public License for more details. */ -//#include "msm8916-ion.dtsi" - / { memory { #address-cells = <2>; diff --git a/arch/arm/boot/dts/msm8916-pm.dtsi b/arch/arm/boot/dts/msm8916-pm.dtsi index b060b77be254..d289e897a00c 100644 --- a/arch/arm/boot/dts/msm8916-pm.dtsi +++ b/arch/arm/boot/dts/msm8916-pm.dtsi @@ -173,7 +173,7 @@ qcom,mpm@601d0 { - status = "disabled"; + //status = "disabled"; compatible = "qcom,mpm-v2"; reg = <0x601d0 0x1000>, /* MSM_RPM_MPM_BASE 4K */ diff --git a/arch/arm/boot/dts/msm8916-regulator.dtsi b/arch/arm/boot/dts/msm8916-regulator.dtsi index 749c55261a3b..a097ca241db5 100644 --- a/arch/arm/boot/dts/msm8916-regulator.dtsi +++ b/arch/arm/boot/dts/msm8916-regulator.dtsi @@ -181,6 +181,8 @@ pm8916_l3: regulator-l3 { regulator-min-microvolt = <500000>; regulator-max-microvolt = <1287500>; + qcom,init-voltage = <1287500>; + qcom,init-enable = <1>; status = "okay"; }; diff --git a/arch/arm/boot/dts/msm8916.dtsi b/arch/arm/boot/dts/msm8916.dtsi index 22b8a00ddf56..f9751860ed73 100644 --- a/arch/arm/boot/dts/msm8916.dtsi +++ b/arch/arm/boot/dts/msm8916.dtsi @@ -749,7 +749,6 @@ qcom,wcnss-wlan@0a000000 { -// compatible = "qcom,wcn36xx"; compatible = "qcom,wcnss_wlan"; reg = <0x0a000000 0x280000>, <0xb011008 0x04>, @@ -800,7 +799,7 @@ <&clock_gcc clk_wcnss_m_clk>; clock-names = "xo", "rf_clk", "measure", "wcnss_debug"; - qcom,has-autodetect-xo; + qcom,has-autodetect-xo; qcom,wlan-rx-buff-count = <512>; qcom,is-pronto-vt; qcom,has-pronto-hw; diff --git a/arch/arm/configs/msm8916-qrd_defconfig b/arch/arm/configs/msm8916-qrd_defconfig index 2d3702ce6ac5..bdfc2c97d7d0 100644 --- a/arch/arm/configs/msm8916-qrd_defconfig +++ b/arch/arm/configs/msm8916-qrd_defconfig @@ -38,7 +38,7 @@ CONFIG_ARCH_MSM8916=y CONFIG_ARM_KERNMEM_PERMS=y CONFIG_SMP=y CONFIG_PREEMPT=y -CONFIG_THUMB2_KERNEL=y +CONFIG_AEABI=y CONFIG_HIGHMEM=y CONFIG_CMA=y CONFIG_CP_ACCESS=y @@ -69,17 +69,19 @@ CONFIG_INET_ESP=y # CONFIG_INET_LRO is not set CONFIG_IPV6=y CONFIG_CFG80211=y +CONFIG_NL80211_TESTMODE=y +CONFIG_CFG80211_INTERNAL_REGDB=y CONFIG_MAC80211=y # CONFIG_MAC80211_RC_MINSTREL is not set CONFIG_RFKILL=y CONFIG_DEVTMPFS=y CONFIG_DEVTMPFS_MOUNT=y CONFIG_DMA_CMA=y +CONFIG_CMA_SIZE_MBYTES=64 CONFIG_BLK_DEV_LOOP=y CONFIG_BLK_DEV_RAM=y CONFIG_BLK_DEV_RAM_COUNT=2 CONFIG_BLK_DEV_RAM_SIZE=1024 -CONFIG_QPNP_MISC=y CONFIG_SCSI=y CONFIG_BLK_DEV_SD=y CONFIG_CHR_DEV_SG=y @@ -95,23 +97,22 @@ CONFIG_DUMMY=y # CONFIG_USB_NET_DRIVERS is not set CONFIG_WCNSS_CORE=y CONFIG_WCNSS_CORE_PRONTO=y -CONFIG_ATH_CARDS=y -CONFIG_ATH_DEBUG=y +CONFIG_WCNSS_MEM_PRE_ALLOC=y # CONFIG_RTL_CARDS is not set +CONFIG_PRONTO_WLAN=y +CONFIG_PRIMA_WLAN_LFR=y CONFIG_SERIAL_MSM=y CONFIG_SERIAL_MSM_CONSOLE=y CONFIG_HW_RANDOM=y CONFIG_MSM_SMD_PKT=y -CONFIG_SPMI=y CONFIG_DEBUG_GPIO=y CONFIG_GPIO_SYSFS=y CONFIG_POWER_SUPPLY=y -CONFIG_MFD_SPMI_PMIC=y CONFIG_REGULATOR=y CONFIG_REGULATOR_FIXED_VOLTAGE=y +CONFIG_REGULATOR_PROXY_CONSUMER=y +CONFIG_REGULATOR_MEM_ACC=y CONFIG_REGULATOR_RPM_SMD=y -CONFIG_REGULATOR_QPNP=y -CONFIG_REGULATOR_SPM=y CONFIG_FB=y CONFIG_FB_SIMPLE=y CONFIG_FRAMEBUFFER_CONSOLE=y @@ -134,14 +135,10 @@ CONFIG_MMC_SDHCI=y CONFIG_MMC_SDHCI_PLTFM=y CONFIG_MMC_SDHCI_MSM=y CONFIG_MSM_SMD_DEBUG=y -CONFIG_MSM_RPM_LOG=y CONFIG_MSM_SMEM=y -CONFIG_MSM_SMEM_LOGGING=y CONFIG_MSM_SMP2P=y CONFIG_MSM_SMP2P_TEST=y CONFIG_MSM_L2_SPM=y -CONFIG_MSM_MEMORY_DUMP_V2=y -CONFIG_MSM_COMMON_LOG=y CONFIG_MSM_WATCHDOG_V2=y CONFIG_MSM_SUBSYSTEM_RESTART=y CONFIG_MSM_PIL=y diff --git a/drivers/clk/qcom/clock-gcc-8916.c b/drivers/clk/qcom/clock-gcc-8916.c index ed6c0e8fbc74..e1a680df4c9e 100644 --- a/drivers/clk/qcom/clock-gcc-8916.c +++ b/drivers/clk/qcom/clock-gcc-8916.c @@ -2921,7 +2921,7 @@ static struct clk_lookup msm_clocks_gcc_mdss[] = { CLK_LIST(gcc_mdss_byte0_clk), }; -static int __init msm_gcc_mdss_probe(struct platform_device *pdev) +static int msm_gcc_mdss_probe(struct platform_device *pdev) { int counter = 0, ret = 0; diff --git a/drivers/net/wireless/Kconfig b/drivers/net/wireless/Kconfig index 455167f53af0..757e4cc08306 100644 --- a/drivers/net/wireless/Kconfig +++ b/drivers/net/wireless/Kconfig @@ -343,5 +343,6 @@ source "drivers/net/wireless/zd1211rw/Kconfig" source "drivers/net/wireless/mwifiex/Kconfig" source "drivers/net/wireless/cw1200/Kconfig" source "drivers/net/wireless/rsi/Kconfig" +source "drivers/net/wireless/prima/Kconfig" endif # WLAN diff --git a/drivers/net/wireless/Makefile b/drivers/net/wireless/Makefile index b04503c6786e..bd9102beceea 100644 --- a/drivers/net/wireless/Makefile +++ b/drivers/net/wireless/Makefile @@ -61,5 +61,5 @@ obj-$(CONFIG_BRCMSMAC) += brcm80211/ obj-$(CONFIG_CW1200) += cw1200/ obj-$(CONFIG_RSI_91X) += rsi/ -obj-$(CONFIG_WCNSS_CORE) += wcnss/ -obj-$(CONFIG_CNSS) += cnss/ +obj-$(CONFIG_WCNSS_CORE) += wcnss/ prima/ + diff --git a/drivers/net/wireless/prima/CORE/HDD/inc/wlan_hdd_hostapd.h b/drivers/net/wireless/prima/CORE/HDD/inc/wlan_hdd_hostapd.h index 793b97509f7a..51678dc53cfe 100644 --- a/drivers/net/wireless/prima/CORE/HDD/inc/wlan_hdd_hostapd.h +++ b/drivers/net/wireless/prima/CORE/HDD/inc/wlan_hdd_hostapd.h @@ -95,8 +95,8 @@ hdd_TranslateWPAToCsrAuthType(u_int8_t auth_suite[4]); eCsrEncryptionType hdd_TranslateWPAToCsrEncryptionType(u_int8_t cipher_suite[4]); -VOS_STATUS hdd_softap_sta_deauth(hdd_adapter_t*,v_U8_t*); -void hdd_softap_sta_disassoc(hdd_adapter_t*,v_U8_t*); +VOS_STATUS hdd_softap_sta_deauth(hdd_adapter_t*, const v_U8_t*); +void hdd_softap_sta_disassoc(hdd_adapter_t*, const v_U8_t*); void hdd_softap_tkip_mic_fail_counter_measure(hdd_adapter_t*,v_BOOL_t); int hdd_softap_unpackIE( tHalHandle halHandle, eCsrEncryptionType *pEncryptType, diff --git a/drivers/net/wireless/prima/CORE/HDD/inc/wlan_hdd_main.h b/drivers/net/wireless/prima/CORE/HDD/inc/wlan_hdd_main.h index 895da827a41b..38c2b9035622 100644 --- a/drivers/net/wireless/prima/CORE/HDD/inc/wlan_hdd_main.h +++ b/drivers/net/wireless/prima/CORE/HDD/inc/wlan_hdd_main.h @@ -68,9 +68,6 @@ #include <wlan_hdd_wmm.h> #include <wlan_hdd_cfg.h> #include <linux/spinlock.h> -#ifdef WLAN_OPEN_SOURCE -#include <linux/wakelock.h> -#endif #include <wlan_hdd_ftm.h> #ifdef FEATURE_WLAN_TDLS #include "wlan_hdd_tdls.h" @@ -1217,12 +1214,6 @@ struct hdd_context_s /* Thermal mitigation information */ hdd_thermal_mitigation_info_t tmInfo; -#ifdef WLAN_OPEN_SOURCE -#ifdef WLAN_FEATURE_HOLD_RX_WAKELOCK - struct wake_lock rx_wake_lock; -#endif -#endif - /* * Framework initiated driver restarting * hdd_reload_timer : Restart retry timer @@ -1240,10 +1231,6 @@ struct hdd_context_s is invoked*/ v_BOOL_t is_dynamic_channel_range_set; -#ifdef WLAN_OPEN_SOURCE - struct wake_lock sap_wake_lock; -#endif - #ifdef FEATURE_WLAN_TDLS eTDLSSupportMode tdls_mode; eTDLSSupportMode tdls_mode_last; diff --git a/drivers/net/wireless/prima/CORE/HDD/inc/wlan_hdd_p2p.h b/drivers/net/wireless/prima/CORE/HDD/inc/wlan_hdd_p2p.h index f1295731fbc0..8cef73ace789 100644 --- a/drivers/net/wireless/prima/CORE/HDD/inc/wlan_hdd_p2p.h +++ b/drivers/net/wireless/prima/CORE/HDD/inc/wlan_hdd_p2p.h @@ -152,37 +152,9 @@ void hdd_sendActionCnf( hdd_adapter_t *pAdapter, tANI_BOOLEAN actionSendSuccess int wlan_hdd_check_remain_on_channel(hdd_adapter_t *pAdapter); VOS_STATUS wlan_hdd_cancel_existing_remain_on_channel(hdd_adapter_t *pAdapter); -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,6,0)) -int wlan_hdd_mgmt_tx( struct wiphy *wiphy, struct wireless_dev *wdev, - struct ieee80211_channel *chan, bool offchan, -#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,8,0)) - enum nl80211_channel_type channel_type, - bool channel_type_valid, -#endif - unsigned int wait, - const u8 *buf, size_t len, bool no_cck, - bool dont_wait_for_ack, u64 *cookie ); -#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0)) -int wlan_hdd_mgmt_tx( struct wiphy *wiphy, struct net_device *dev, - struct ieee80211_channel *chan, bool offchan, - enum nl80211_channel_type channel_type, - bool channel_type_valid, unsigned int wait, - const u8 *buf, size_t len, bool no_cck, - bool dont_wait_for_ack, u64 *cookie ); -#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,38)) -int wlan_hdd_mgmt_tx( struct wiphy *wiphy, struct net_device *dev, - struct ieee80211_channel *chan, bool offchan, - enum nl80211_channel_type channel_type, - bool channel_type_valid, unsigned int wait, - const u8 *buf, size_t len, u64 *cookie ); -#else -int wlan_hdd_mgmt_tx( struct wiphy *wiphy, struct net_device *dev, - struct ieee80211_channel *chan, - enum nl80211_channel_type channel_type, - bool channel_type_valid, - const u8 *buf, size_t len, u64 *cookie ); -#endif - +int wlan_hdd_mgmt_tx(struct wiphy *wiphy, struct wireless_dev *wdev, + struct cfg80211_mgmt_tx_params *params, + u64 *cookie); #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,7,0)) struct wireless_dev* wlan_hdd_add_virtual_intf( diff --git a/drivers/net/wireless/prima/CORE/HDD/inc/wlan_hdd_wmm.h b/drivers/net/wireless/prima/CORE/HDD/inc/wlan_hdd_wmm.h index 807c2ee8afa0..05d1dbe7b5be 100644 --- a/drivers/net/wireless/prima/CORE/HDD/inc/wlan_hdd_wmm.h +++ b/drivers/net/wireless/prima/CORE/HDD/inc/wlan_hdd_wmm.h @@ -248,7 +248,7 @@ VOS_STATUS hdd_wmm_adapter_close ( hdd_adapter_t* pAdapter ); @return : queue_index/linux AC value. ===========================================================================*/ -v_U16_t hdd_wmm_select_queue(struct net_device * dev, struct sk_buff *skb); +v_U16_t hdd_wmm_select_queue(struct net_device * dev, struct sk_buff *skb, void *accel_priv, select_queue_fallback_t fallback); /**============================================================================ @brief hdd_hostapd_select_queue() - Function which will classify the packet @@ -261,7 +261,7 @@ v_U16_t hdd_wmm_select_queue(struct net_device * dev, struct sk_buff *skb); @return : Qdisc queue index ===========================================================================*/ -v_U16_t hdd_hostapd_select_queue(struct net_device * dev, struct sk_buff *skb); +v_U16_t hdd_hostapd_select_queue(struct net_device * dev, struct sk_buff *skb, void *accel_priv, select_queue_fallback_t fallback); diff --git a/drivers/net/wireless/prima/CORE/HDD/src/wlan_hdd_assoc.c b/drivers/net/wireless/prima/CORE/HDD/src/wlan_hdd_assoc.c index d1be3a72bd79..c1fb91cb9534 100644 --- a/drivers/net/wireless/prima/CORE/HDD/src/wlan_hdd_assoc.c +++ b/drivers/net/wireless/prima/CORE/HDD/src/wlan_hdd_assoc.c @@ -779,10 +779,7 @@ static eHalStatus hdd_DisConnectHandler( hdd_adapter_t *pAdapter, tCsrRoamInfo * netif_tx_disable(dev); netif_carrier_off(dev); - INIT_COMPLETION(pAdapter->disconnect_comp_var); - VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO, - "%s: Set HDD connState to eConnectionState_Disconnecting", - __func__); + reinit_completion(&pAdapter->disconnect_comp_var); hdd_connSetConnectionState( pHddStaCtx, eConnectionState_Disconnecting ); /* If only STA mode is on */ if((pHddCtx->concurrency_mode <= 1) && (pHddCtx->no_of_sessions[WLAN_HDD_INFRA_STATION] <=1)) @@ -1195,7 +1192,7 @@ static eHalStatus hdd_AssociationCompletionHandler( hdd_adapter_t *pAdapter, tCs // Initialize the Linkup event completion variable - INIT_COMPLETION(pAdapter->linkup_event_var); + reinit_completion(&pAdapter->linkup_event_var); /* Sometimes Switching ON the Carrier is taking time to activate the device properly. Before allowing any @@ -1643,7 +1640,7 @@ static void hdd_RoamIbssIndicationHandler( hdd_adapter_t *pAdapter, return; } - cfg80211_ibss_joined(pAdapter->dev, bss->bssid, GFP_KERNEL); + cfg80211_ibss_joined(pAdapter->dev, bss->bssid, /* struct ieee80211_channel *channel*/ NULL, GFP_KERNEL); cfg80211_put_bss( #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,9,0)) pHddCtx->wiphy, @@ -1785,6 +1782,8 @@ static eHalStatus roamIbssConnectHandler( hdd_adapter_t *pAdapter, tCsrRoamInfo __func__, pAdapter->dev->name); return eHAL_STATUS_FAILURE; } + /* send ibss join indication to nl80211 */ + // cfg80211_ibss_joined(pAdapter->dev, &pRoamInfo->bssid[0], /* channel*/ NULL, GFP_KERNEL); cfg80211_put_bss( #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,9,0)) WLAN_HDD_GET_CTX(pAdapter)->wiphy, @@ -3344,7 +3343,7 @@ int iw_set_essid(struct net_device *dev, { VOS_STATUS vosStatus; // need to issue a disconnect to CSR. - INIT_COMPLETION(pAdapter->disconnect_comp_var); + reinit_completion(&pAdapter->disconnect_comp_var); vosStatus = sme_RoamDisconnect( hHal, pAdapter->sessionId, eCSR_DISCONNECT_REASON_UNSPECIFIED ); if(VOS_STATUS_SUCCESS == vosStatus) @@ -3987,7 +3986,7 @@ void hdd_indicateUnprotMgmtFrame( hdd_adapter_t *pAdapter, } else if (type == SIR_MAC_MGMT_FRAME && subType == SIR_MAC_MGMT_DEAUTH) { - cfg80211_send_unprot_deauth(pAdapter->dev, pbFrames, nFrameLength); + cfg80211_rx_unprot_mlme_mgmt(pAdapter->dev, pbFrames, nFrameLength); pAdapter->hdd_stats.hddPmfStats.numUnprotDeauthRx++; } else diff --git a/drivers/net/wireless/prima/CORE/HDD/src/wlan_hdd_cfg.c b/drivers/net/wireless/prima/CORE/HDD/src/wlan_hdd_cfg.c index bd0a242e4cf8..be9854c11b34 100644 --- a/drivers/net/wireless/prima/CORE/HDD/src/wlan_hdd_cfg.c +++ b/drivers/net/wireless/prima/CORE/HDD/src/wlan_hdd_cfg.c @@ -196,6 +196,7 @@ static void cbNotifySetEnableSSR(hdd_context_t *pHddCtx, unsigned long NotifyId) sme_UpdateEnableSSR((tHalHandle)(pHddCtx->hHal), pHddCtx->cfg_ini->enableSSR); } +#ifdef FEATURE_WLAN_LFR #ifdef WLAN_FEATURE_ROAM_SCAN_OFFLOAD static void cbNotifyUpdateRoamScanOffloadEnabled(hdd_context_t *pHddCtx, unsigned long NotifyId) { @@ -213,6 +214,7 @@ static void cbNotifySetEnableFastRoamInConcurrency(hdd_context_t *pHddCtx, unsig } #endif +#endif REG_TABLE_ENTRY g_registry_table[] = { @@ -1127,6 +1129,7 @@ REG_TABLE_ENTRY g_registry_table[] = CFG_OKC_FEATURE_ENABLED_MAX, cbNotifySetOkcFeatureEnabled, 0 ), #endif +#ifdef FEATURE_WLAN_LFR #ifdef WLAN_FEATURE_ROAM_SCAN_OFFLOAD REG_DYNAMIC_VARIABLE( CFG_ROAM_SCAN_OFFLOAD_ENABLED, WLAN_PARAM_Integer, hdd_config_t, isRoamOffloadScanEnabled, @@ -1136,6 +1139,7 @@ REG_TABLE_ENTRY g_registry_table[] = CFG_ROAM_SCAN_OFFLOAD_ENABLED_MAX, cbNotifyUpdateRoamScanOffloadEnabled, 0), #endif +#endif REG_VARIABLE( CFG_QOS_WMM_PKT_CLASSIFY_BASIS_NAME , WLAN_PARAM_Integer, hdd_config_t, PktClassificationBasis, VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT, @@ -2701,6 +2705,7 @@ REG_VARIABLE( CFG_TDLS_WMM_MODE_ENABLE, WLAN_PARAM_Integer, CFG_SCAN_OFFLOAD_DEFAULT, CFG_SCAN_OFFLOAD_DISABLE, CFG_SCAN_OFFLOAD_ENABLE ), +#ifdef FEATURE_WLAN_LFR #ifdef WLAN_FEATURE_ROAM_SCAN_OFFLOAD REG_DYNAMIC_VARIABLE( CFG_ENABLE_FAST_ROAM_IN_CONCURRENCY, WLAN_PARAM_Integer, @@ -2711,7 +2716,7 @@ REG_VARIABLE( CFG_TDLS_WMM_MODE_ENABLE, WLAN_PARAM_Integer, CFG_ENABLE_FAST_ROAM_IN_CONCURRENCY_MAX, cbNotifySetEnableFastRoamInConcurrency, 0 ), #endif - +#endif REG_VARIABLE( CFG_ENABLE_ADAPT_RX_DRAIN_NAME, WLAN_PARAM_Integer, hdd_config_t, fEnableAdaptRxDrain, VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK , diff --git a/drivers/net/wireless/prima/CORE/HDD/src/wlan_hdd_cfg80211.c b/drivers/net/wireless/prima/CORE/HDD/src/wlan_hdd_cfg80211.c index 16423d4ce8bf..1e9566f674eb 100644 --- a/drivers/net/wireless/prima/CORE/HDD/src/wlan_hdd_cfg80211.c +++ b/drivers/net/wireless/prima/CORE/HDD/src/wlan_hdd_cfg80211.c @@ -710,12 +710,12 @@ int wlan_hdd_cfg80211_init(struct device *dev, #ifndef CONFIG_ENABLE_LINUX_REG /* the flag for the other case would be initialzed in vos_init_wiphy_from_nv_bin */ - wiphy->flags |= WIPHY_FLAG_STRICT_REGULATORY; + wiphy->regulatory_flags |= REGULATORY_STRICT_REG; #endif /* This will disable updating of NL channels from passive to * active if a beacon is received on passive channel. */ - wiphy->flags |= WIPHY_FLAG_DISABLE_BEACON_HINTS; + wiphy->regulatory_flags |= REGULATORY_DISABLE_BEACON_HINTS; #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0)) @@ -723,7 +723,7 @@ int wlan_hdd_cfg80211_init(struct device *dev, | WIPHY_FLAG_AP_PROBE_RESP_OFFLOAD | WIPHY_FLAG_HAS_REMAIN_ON_CHANNEL | WIPHY_FLAG_OFFCHAN_TX; - wiphy->country_ie_pref = NL80211_COUNTRY_IE_IGNORE_CORE; + wiphy->regulatory_flags |= REGULATORY_COUNTRY_IE_IGNORE; #endif #if defined (WLAN_FEATURE_VOWIFI_11R) || defined (FEATURE_WLAN_CCX) || defined(FEATURE_WLAN_LFR) @@ -830,6 +830,8 @@ int wlan_hdd_cfg80211_init(struct device *dev, continue; } +//pr_err("%s: adding %d channels to band idx %d\n", __func__, wiphy->bands[i]->n_channels, i); + for (j = 0; j < wiphy->bands[i]->n_channels; j++) { struct ieee80211_supported_band *band = wiphy->bands[i]; @@ -913,7 +915,7 @@ void wlan_hdd_cfg80211_update_reg_info(struct wiphy *wiphy) struct ieee80211_supported_band *band = wiphy->bands[IEEE80211_BAND_5GHZ]; // Mark UNII -1 band channel as passive if (WLAN_HDD_CHANNEL_IN_UNII_1_BAND(band->channels[j].center_freq)) - band->channels[j].flags |= IEEE80211_CHAN_PASSIVE_SCAN; + band->channels[j].flags |= IEEE80211_CHAN_NO_IR; } } } @@ -1173,10 +1175,10 @@ int wlan_hdd_cfg80211_alloc_new_beacon(hdd_adapter_t *pAdapter, } -v_U8_t* wlan_hdd_cfg80211_get_ie_ptr(v_U8_t *pIes, int length, v_U8_t eid) +const v_U8_t* wlan_hdd_cfg80211_get_ie_ptr(const v_U8_t *pIes, int length, v_U8_t eid) { int left = length; - v_U8_t *ptr = pIes; + const v_U8_t *ptr = pIes; v_U8_t elem_id,elem_len; while(left >= 2) @@ -1216,7 +1218,7 @@ static int wlan_hdd_rate_is_11g(u8 rate) } /* Check for 11g rate and set proper 11g only mode */ -static void wlan_hdd_check_11gmode(u8 *pIe, u8* require_ht, +static void wlan_hdd_check_11gmode(const u8 *pIe, u8* require_ht, u8* pCheckRatesfor11g, eSapPhyMode* pSapHw_mode) { u8 i, num_rates = pIe[0]; @@ -1252,7 +1254,7 @@ static void wlan_hdd_set_sapHwmode(hdd_adapter_t *pHostapdAdapter) struct ieee80211_mgmt *pMgmt_frame = (struct ieee80211_mgmt*)pBeacon->head; u8 checkRatesfor11g = TRUE; u8 require_ht = FALSE; - u8 *pIe=NULL; + const u8 *pIe=NULL; pConfig->SapHw_mode= eSAP_DOT11_MODE_11b; @@ -1880,7 +1882,7 @@ static int wlan_hdd_cfg80211_start_bss(hdd_adapter_t *pHostapdAdapter, tsap_Config_t *pConfig; beacon_data_t *pBeacon = NULL; struct ieee80211_mgmt *pMgmt_frame; - v_U8_t *pIe=NULL; + const v_U8_t *pIe=NULL; v_U16_t capab_info; eCsrAuthType RSNAuthType; eCsrEncryptionType RSNEncryptType; @@ -2756,7 +2758,6 @@ static int wlan_hdd_cfg80211_change_beacon(struct wiphy *wiphy, #endif //(LINUX_VERSION_CODE > KERNEL_VERSION(3,3,0)) - static int __wlan_hdd_cfg80211_change_bss (struct wiphy *wiphy, struct net_device *dev, struct bss_parameters *params) @@ -3175,7 +3176,7 @@ static int __wlan_hdd_cfg80211_change_iface( struct wiphy *wiphy, ( eCSR_BSS_TYPE_START_IBSS == LastBSSType ) ) { /*need to issue a disconnect to CSR.*/ - INIT_COMPLETION(pAdapter->disconnect_comp_var); + reinit_completion(&pAdapter->disconnect_comp_var); if( eHAL_STATUS_SUCCESS == sme_RoamDisconnect( WLAN_HDD_GET_HAL_CTX(pAdapter), pAdapter->sessionId, @@ -3387,7 +3388,7 @@ static int wlan_hdd_tdls_add_station(struct wiphy *wiphy, return -EPERM; } - INIT_COMPLETION(pAdapter->tdls_add_station_comp); + reinit_completion(&pAdapter->tdls_add_station_comp); if (!update) { @@ -3429,7 +3430,7 @@ error: static int wlan_hdd_change_station(struct wiphy *wiphy, struct net_device *dev, - u8 *mac, + const u8 *mac, struct station_parameters *params) { VOS_STATUS status = VOS_STATUS_SUCCESS; @@ -3692,7 +3693,7 @@ static int __wlan_hdd_cfg80211_add_key( struct wiphy *wiphy, { vos_mem_zero(&setKey,sizeof(tCsrRoamSetKey)); wlan_hdd_cfg80211_set_key_wapi(pAdapter, key_index, mac_addr, - params->key, params->key_len); + (u8 *)params->key, params->key_len); return 0; } #endif @@ -4422,7 +4423,10 @@ static struct cfg80211_bss* wlan_hdd_cfg80211_inform_bss( { rssi = (VOS_MIN ((pBssDesc->rssi + pBssDesc->sinr), 0))*100; - return (cfg80211_inform_bss(wiphy, chan, pBssDesc->bssId, + return (cfg80211_inform_bss(wiphy, chan, +/* enum cfg80211_bss_frame_type ftype, */ + CFG80211_BSS_FTYPE_UNKNOWN, + pBssDesc->bssId, le64_to_cpu(*(__le64 *)pBssDesc->timeStamp), pBssDesc->capabilityInfo, pBssDesc->beaconInterval, ie, ie_length, @@ -4759,14 +4763,14 @@ static int wlan_hdd_cfg80211_update_bss( struct wiphy *wiphy, } void -hddPrintMacAddr(tCsrBssid macAddr, tANI_U8 logLevel) +hddPrintMacAddr(const tCsrBssid macAddr, tANI_U8 logLevel) { VOS_TRACE(VOS_MODULE_ID_HDD, logLevel, MAC_ADDRESS_STR, MAC_ADDR_ARRAY(macAddr)); } /****** end hddPrintMacAddr() ******/ void -hddPrintPmkId(tANI_U8 *pmkId, tANI_U8 logLevel) +hddPrintPmkId(const tANI_U8 *pmkId, tANI_U8 logLevel) { VOS_TRACE(VOS_MODULE_ID_HDD, logLevel, "%02X:%02X:%02X:%02X:%02X:%02X:%02X:%02X:%02X:%02X:%02X:%02X:%02X:%02X:%02X:%02X", @@ -5405,7 +5409,7 @@ int __wlan_hdd_cfg80211_scan( struct wiphy *wiphy, } } - INIT_COMPLETION(pScanInfo->scan_req_completion_event); + reinit_completion(&pScanInfo->scan_req_completion_event); /* acquire the wakelock to avoid the apps suspend during the scan. To * address the following issues. @@ -5909,12 +5913,12 @@ static int wlan_hdd_cfg80211_set_cipher( hdd_adapter_t *pAdapter, * This function is used to parse WPA/RSN IE's. */ int wlan_hdd_cfg80211_set_ie( hdd_adapter_t *pAdapter, - u8 *ie, + const u8 *ie, size_t ie_len ) { hdd_wext_state_t *pWextState = WLAN_HDD_GET_WEXT_STATE_PTR(pAdapter); - u8 *genie = ie; + const u8 *genie = ie; v_U16_t remLen = ie_len; #ifdef FEATURE_WLAN_WAPI v_U32_t akmsuite[MAX_NUM_AKM_SUITES]; @@ -6130,7 +6134,7 @@ int wlan_hdd_cfg80211_set_ie( hdd_adapter_t *pAdapter, * Parse the received IE to find the WPA IE * */ -static bool hdd_isWPAIEPresent(u8 *ie, u8 ie_len) +static bool hdd_isWPAIEPresent(const u8 *ie, u8 ie_len) { v_U8_t eLen = 0; v_U16_t remLen = ie_len; @@ -6256,7 +6260,7 @@ int wlan_hdd_cfg80211_set_privacy( hdd_adapter_t *pAdapter, /*parse WPA/RSN IE, and set the correspoing fileds in Roam profile*/ if (req->ie_len) { - status = wlan_hdd_cfg80211_set_ie(pAdapter, req->ie, req->ie_len); + status = wlan_hdd_cfg80211_set_ie(pAdapter, (u8 *)req->ie, req->ie_len); if ( 0 > status) { hddLog(VOS_TRACE_LEVEL_ERROR, "%s: failed to parse the WPA/RSN IE", @@ -6325,7 +6329,7 @@ static int wlan_hdd_try_disconnect( hdd_adapter_t *pAdapter ) (eConnectionState_IbssConnected == pHddStaCtx->conn_info.connState)) { /* Issue disconnect to CSR */ - INIT_COMPLETION(pAdapter->disconnect_comp_var); + reinit_completion(&pAdapter->disconnect_comp_var); if( eHAL_STATUS_SUCCESS == sme_RoamDisconnect( WLAN_HDD_GET_HAL_CTX(pAdapter), pAdapter->sessionId, @@ -6498,7 +6502,7 @@ int wlan_hdd_disconnect( hdd_adapter_t *pAdapter, u16 reason ) "%s: Set HDD connState to eConnectionState_Disconnecting", __func__); pHddStaCtx->conn_info.connState = eConnectionState_Disconnecting; - INIT_COMPLETION(pAdapter->disconnect_comp_var); + reinit_completion(&pAdapter->disconnect_comp_var); /*issue disconnect*/ @@ -6701,7 +6705,7 @@ static int wlan_hdd_cfg80211_set_privacy_ibss( { tDot11fIEWPA dot11WPAIE; tHalHandle halHandle = WLAN_HDD_GET_HAL_CTX(pAdapter); - u8 *ie; + const u8 *ie; memset(&dot11WPAIE, 0, sizeof(dot11WPAIE)); ie = wlan_hdd_cfg80211_get_ie_ptr (params->ie, @@ -6941,7 +6945,7 @@ static int wlan_hdd_cfg80211_leave_ibss( struct wiphy *wiphy, } /* Issue Disconnect request */ - INIT_COMPLETION(pAdapter->disconnect_comp_var); + reinit_completion(&pAdapter->disconnect_comp_var); sme_RoamDisconnect( WLAN_HDD_GET_HAL_CTX(pAdapter), pAdapter->sessionId, eCSR_DISCONNECT_REASON_IBSS_LEAVE); @@ -7235,7 +7239,7 @@ static int wlan_hdd_cfg80211_get_txpower(struct wiphy *wiphy, } static int wlan_hdd_cfg80211_get_station(struct wiphy *wiphy, struct net_device *dev, - u8* mac, struct station_info *sinfo) + const u8* mac, struct station_info *sinfo) { hdd_adapter_t *pAdapter = WLAN_HDD_GET_PRIV_PTR( dev ); hdd_station_ctx_t *pHddStaCtx = WLAN_HDD_GET_STATION_CTX_PTR(pAdapter); @@ -7744,7 +7748,7 @@ static int wlan_hdd_set_txq_params(struct wiphy *wiphy, #endif //LINUX_VERSION_CODE static int wlan_hdd_cfg80211_del_station(struct wiphy *wiphy, - struct net_device *dev, u8 *mac) + struct net_device *dev, struct station_del_parameters *params) { hdd_adapter_t *pAdapter = WLAN_HDD_GET_PRIV_PTR(dev); hdd_context_t *pHddCtx; @@ -7778,7 +7782,7 @@ static int wlan_hdd_cfg80211_del_station(struct wiphy *wiphy, || (WLAN_HDD_P2P_GO == pAdapter->device_mode) ) { - if( NULL == mac ) + if( NULL == params->mac ) { v_U16_t i; for(i = 0; i < WLAN_MAX_STA_COUNT; i++) @@ -7800,13 +7804,13 @@ static int wlan_hdd_cfg80211_del_station(struct wiphy *wiphy, else { - vos_status = hdd_softap_GetStaId(pAdapter,(v_MACADDR_t *)mac, &staId); + vos_status = hdd_softap_GetStaId(pAdapter,(v_MACADDR_t *)params->mac, &staId); if (!VOS_IS_STATUS_SUCCESS(vos_status)) { hddLog(VOS_TRACE_LEVEL_INFO, "%s: Skip this DEL STA as this is not used::" MAC_ADDRESS_STR, - __func__, MAC_ADDR_ARRAY(mac)); + __func__, MAC_ADDR_ARRAY(params->mac)); return -ENOENT; } @@ -7815,7 +7819,7 @@ static int wlan_hdd_cfg80211_del_station(struct wiphy *wiphy, hddLog(VOS_TRACE_LEVEL_INFO, "%s: Skip this DEL STA as deauth is in progress::" MAC_ADDRESS_STR, - __func__, MAC_ADDR_ARRAY(mac)); + __func__, MAC_ADDR_ARRAY(params->mac)); return -ENOENT; } @@ -7825,9 +7829,9 @@ static int wlan_hdd_cfg80211_del_station(struct wiphy *wiphy, "%s: Delete STA with MAC::" MAC_ADDRESS_STR, __func__, - MAC_ADDR_ARRAY(mac)); + MAC_ADDR_ARRAY(params->mac)); - vos_status = hdd_softap_sta_deauth(pAdapter, mac); + vos_status = hdd_softap_sta_deauth(pAdapter, params->mac); if (!VOS_IS_STATUS_SUCCESS(vos_status)) { pAdapter->aStaInfo[staId].isDeauthInProgress = FALSE; @@ -7835,7 +7839,7 @@ static int wlan_hdd_cfg80211_del_station(struct wiphy *wiphy, "%s: STA removal failed for ::" MAC_ADDRESS_STR, __func__, - MAC_ADDR_ARRAY(mac)); + MAC_ADDR_ARRAY(params->mac)); return -ENOENT; } @@ -7848,9 +7852,11 @@ static int wlan_hdd_cfg80211_del_station(struct wiphy *wiphy, } static int wlan_hdd_cfg80211_add_station(struct wiphy *wiphy, - struct net_device *dev, u8 *mac, struct station_parameters *params) + struct net_device *dev, const u8 *mac, struct station_parameters *params) { +#ifdef FEATURE_WLAN_TDLS hdd_adapter_t *pAdapter = WLAN_HDD_GET_PRIV_PTR(dev); +#endif int status = -EPERM; #ifdef FEATURE_WLAN_TDLS u32 mask, set; @@ -8536,7 +8542,7 @@ static int __wlan_hdd_cfg80211_sched_scan_start(struct wiphy *wiphy, pPnoRequest->modePNO = SIR_PNO_MODE_IMMEDIATE; - INIT_COMPLETION(pAdapter->pno_comp_var); + reinit_completion(&pAdapter->pno_comp_var); pPnoRequest->statusCallback = hdd_cfg80211_sched_scan_start_status_cb; pPnoRequest->callbackContext = pAdapter; pAdapter->pno_req_status = 0; @@ -8893,7 +8899,7 @@ static int wlan_hdd_cfg80211_tdls_mgmt(struct wiphy *wiphy, struct net_device *d } pAdapter->mgmtTxCompletionStatus = TDLS_CTX_MAGIC; - INIT_COMPLETION(pAdapter->tdls_mgmt_comp); + reinit_completion(&pAdapter->tdls_mgmt_comp); status = sme_SendTdlsMgmtFrame(WLAN_HDD_GET_HAL_CTX(pAdapter), pAdapter->sessionId, peerMac, action_code, dialog_token, status_code, peer_capability, (tANI_U8 *)buf, len, responder); @@ -9020,7 +9026,7 @@ static int wlan_hdd_cfg80211_tdls_oper(struct wiphy *wiphy, struct net_device *d pAdapter, peer,&tdlsLinkEstablishParams)) { return -EINVAL; } - INIT_COMPLETION(pAdapter->tdls_link_establish_req_comp); + reinit_completion(&pAdapter->tdls_link_establish_req_comp); sme_SendTdlsLinkEstablishParams(WLAN_HDD_GET_HAL_CTX(pAdapter), pAdapter->sessionId, peer, &tdlsLinkEstablishParams); @@ -9104,7 +9110,7 @@ static int wlan_hdd_cfg80211_tdls_oper(struct wiphy *wiphy, struct net_device *d { long status; - INIT_COMPLETION(pAdapter->tdls_del_station_comp); + reinit_completion(&pAdapter->tdls_del_station_comp); sme_DeleteTdlsPeerSta( WLAN_HDD_GET_HAL_CTX(pAdapter), pAdapter->sessionId, peer ); @@ -9517,6 +9523,7 @@ static int wlan_hdd_cfg80211_set_mac_acl(struct wiphy *wiphy, return 0; } +#ifdef CONFIG_NL80211_TESTMODE #ifdef WLAN_NL80211_TESTMODE #ifdef FEATURE_WLAN_LPHB static void wlan_hdd_cfg80211_lphb_wait_timeout_ind_handler @@ -9673,7 +9680,7 @@ static int wlan_hdd_cfg80211_testmode(struct wiphy *wiphy, void *data, int len) return err; } #endif /* CONFIG_NL80211_TESTMODE */ - +#endif static int wlan_hdd_cfg80211_dump_survey(struct wiphy *wiphy, struct net_device *dev, int idx, struct survey_info *survey) @@ -9978,9 +9985,11 @@ static struct cfg80211_ops wlan_hdd_cfg80211_ops = .resume = wlan_hdd_cfg80211_resume_wlan, .suspend = wlan_hdd_cfg80211_suspend_wlan, .set_mac_acl = wlan_hdd_cfg80211_set_mac_acl, +#ifdef CONFIG_NL80211_TESTMODE #ifdef WLAN_NL80211_TESTMODE .testmode_cmd = wlan_hdd_cfg80211_testmode, #endif +#endif .dump_survey = wlan_hdd_cfg80211_dump_survey, }; diff --git a/drivers/net/wireless/prima/CORE/HDD/src/wlan_hdd_dev_pwr.c b/drivers/net/wireless/prima/CORE/HDD/src/wlan_hdd_dev_pwr.c index 6d92979d1869..2333150d3e39 100644 --- a/drivers/net/wireless/prima/CORE/HDD/src/wlan_hdd_dev_pwr.c +++ b/drivers/net/wireless/prima/CORE/HDD/src/wlan_hdd_dev_pwr.c @@ -143,7 +143,7 @@ static int wlan_suspend(hdd_context_t* pHddCtx) */ VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO, "%s: Suspending Mc, Rx and Tx Threads",__func__); - INIT_COMPLETION(pHddCtx->tx_sus_event_var); + reinit_completion(&pHddCtx->tx_sus_event_var); /* Indicate Tx Thread to Suspend */ set_bit(TX_SUSPEND_EVENT_MASK, &vosSchedContext->txEventFlag); @@ -179,7 +179,7 @@ tx_suspend: /* Set the Tx Thread as Suspended */ pHddCtx->isTxThreadSuspended = TRUE; - INIT_COMPLETION(pHddCtx->rx_sus_event_var); + reinit_completion(&pHddCtx->rx_sus_event_var); /* Indicate Rx Thread to Suspend */ set_bit(RX_SUSPEND_EVENT_MASK, &vosSchedContext->rxEventFlag); @@ -220,7 +220,7 @@ rx_suspend: /* Set the Rx Thread as Suspended */ pHddCtx->isRxThreadSuspended = TRUE; - INIT_COMPLETION(pHddCtx->mc_sus_event_var); + reinit_completion(&pHddCtx->mc_sus_event_var); /* Indicate MC Thread to Suspend */ set_bit(MC_SUSPEND_EVENT_MASK, &vosSchedContext->mcEventFlag); diff --git a/drivers/net/wireless/prima/CORE/HDD/src/wlan_hdd_early_suspend.c b/drivers/net/wireless/prima/CORE/HDD/src/wlan_hdd_early_suspend.c index 1b18d6b16c02..84b2cf1c9948 100644 --- a/drivers/net/wireless/prima/CORE/HDD/src/wlan_hdd_early_suspend.c +++ b/drivers/net/wireless/prima/CORE/HDD/src/wlan_hdd_early_suspend.c @@ -60,7 +60,6 @@ #include <linux/wait.h> #include <wlan_hdd_includes.h> #include <wlan_qct_driver.h> -#include <linux/wakelock.h> #include "halTypes.h" #include "sme_Api.h" @@ -171,7 +170,7 @@ eHalStatus hdd_exit_standby(hdd_context_t *pHddCtx) long ret; hddLog(VOS_TRACE_LEVEL_INFO, "%s: WLAN being resumed from standby",__func__); - INIT_COMPLETION(pHddCtx->full_pwr_comp_var); + reinit_completion(&pHddCtx->full_pwr_comp_var); g_full_pwr_status = eHAL_STATUS_FAILURE; status = sme_RequestFullPower(pHddCtx->hHal, hdd_suspend_full_pwr_callback, pHddCtx, @@ -233,7 +232,7 @@ VOS_STATUS hdd_enter_standby(hdd_context_t *pHddCtx) //here especially in scenarios where PMC is already in IMPS or REQUEST_IMPS. //Core s/w needs to be optimized to handle this. Until then we request full //power before issuing request for standby. - INIT_COMPLETION(pHddCtx->full_pwr_comp_var); + reinit_completion(&pHddCtx->full_pwr_comp_var); g_full_pwr_status = eHAL_STATUS_FAILURE; halStatus = sme_RequestFullPower(pHddCtx->hHal, hdd_suspend_full_pwr_callback, pHddCtx, eSME_FULL_PWR_NEEDED_BY_HDD); @@ -277,7 +276,7 @@ VOS_STATUS hdd_enter_standby(hdd_context_t *pHddCtx) //queues here. Also do not assert if the failure code is eHAL_STATUS_PMC_NOT_NOW as PMC //will send this failure code in case of concurrent sessions. Power Save cannot be supported //when there are concurrent sessions. - INIT_COMPLETION(pHddCtx->standby_comp_var); + reinit_completion(&pHddCtx->standby_comp_var); g_standby_status = eHAL_STATUS_FAILURE; halStatus = sme_RequestStandby(pHddCtx->hHal, hdd_suspend_standby_cbk, pHddCtx); @@ -340,7 +339,7 @@ VOS_STATUS hdd_enter_deep_sleep(hdd_context_t *pHddCtx, hdd_adapter_t *pAdapter) sme_DisablePowerSave(pHddCtx->hHal, ePMC_BEACON_MODE_POWER_SAVE); //Ensure that device is in full power as we will touch H/W during vos_Stop - INIT_COMPLETION(pHddCtx->full_pwr_comp_var); + reinit_completion(&pHddCtx->full_pwr_comp_var); g_full_pwr_status = eHAL_STATUS_FAILURE; halStatus = sme_RequestFullPower(pHddCtx->hHal, hdd_suspend_full_pwr_callback, pHddCtx, eSME_FULL_PWR_NEEDED_BY_HDD); @@ -369,7 +368,7 @@ VOS_STATUS hdd_enter_deep_sleep(hdd_context_t *pHddCtx, hdd_adapter_t *pAdapter) //Issue a disconnect. This is required to inform the supplicant that //STA is getting disassociated and for GUI to be updated properly - INIT_COMPLETION(pAdapter->disconnect_comp_var); + reinit_completion(&pAdapter->disconnect_comp_var); halStatus = sme_RoamDisconnect(pHddCtx->hHal, pAdapter->sessionId, eCSR_DISCONNECT_REASON_UNSPECIFIED); //Success implies disconnect command got queued up successfully diff --git a/drivers/net/wireless/prima/CORE/HDD/src/wlan_hdd_hostapd.c b/drivers/net/wireless/prima/CORE/HDD/src/wlan_hdd_hostapd.c index 8a9175b69fa7..003efa969239 100644 --- a/drivers/net/wireless/prima/CORE/HDD/src/wlan_hdd_hostapd.c +++ b/drivers/net/wireless/prima/CORE/HDD/src/wlan_hdd_hostapd.c @@ -742,13 +742,6 @@ VOS_STATUS hdd_hostapd_SAPEventCB( tpSap_Event pSapEvent, v_PVOID_t usrDataForCa if (!VOS_IS_STATUS_SUCCESS(vos_status)) hddLog(LOGE, FL("Failed to start AP inactivity timer")); } -#ifdef WLAN_OPEN_SOURCE - if (wake_lock_active(&pHddCtx->sap_wake_lock)) - { - wake_unlock(&pHddCtx->sap_wake_lock); - } - wake_lock_timeout(&pHddCtx->sap_wake_lock, msecs_to_jiffies(HDD_SAP_WAKE_LOCK_DURATION)); -#endif #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,38)) { struct station_info staInfo; @@ -3703,7 +3696,7 @@ hdd_adapter_t* hdd_wlan_create_ap_dev( hdd_context_t *pHddCtx, tSirMacAddr macAd hdd_adapter_t *pHostapdAdapter = NULL; v_CONTEXT_t pVosContext= NULL; - pWlanHostapdDev = alloc_netdev_mq(sizeof(hdd_adapter_t), iface_name, ether_setup, NUM_TX_QUEUES); + pWlanHostapdDev = alloc_netdev_mq(sizeof(hdd_adapter_t), iface_name, NET_NAME_UNKNOWN, ether_setup, NUM_TX_QUEUES); if (pWlanHostapdDev != NULL) { diff --git a/drivers/net/wireless/prima/CORE/HDD/src/wlan_hdd_main.c b/drivers/net/wireless/prima/CORE/HDD/src/wlan_hdd_main.c index 2475bd3eac8d..1bf6c61f95e0 100644 --- a/drivers/net/wireless/prima/CORE/HDD/src/wlan_hdd_main.c +++ b/drivers/net/wireless/prima/CORE/HDD/src/wlan_hdd_main.c @@ -115,7 +115,7 @@ int wlan_hdd_ftm_start(hdd_context_t *pAdapter); #include "sapApi.h" #include <linux/semaphore.h> #include <linux/ctype.h> -#include <mach/subsystem_restart.h> +#include <soc/qcom/subsystem_restart.h> #include <wlan_hdd_hostapd.h> #include <wlan_hdd_softap_tx_rx.h> #include "cfgApi.h" @@ -205,9 +205,6 @@ static VOS_STATUS wlan_hdd_init_channels_for_cc(hdd_context_t *pHddCtx); #define WLAN_HDD_DRIVER_MIRACAST_CFG_MIN_VAL 0 #define WLAN_HDD_DRIVER_MIRACAST_CFG_MAX_VAL 2 -#ifdef WLAN_OPEN_SOURCE -static struct wake_lock wlan_wake_lock; -#endif /* set when SSR is needed after unload */ static e_hdd_ssr_required isSsrRequired = HDD_SSR_NOT_REQUIRED; @@ -219,7 +216,7 @@ void wlan_hdd_restart_timer_cb(v_PVOID_t usrDataForCallback); void hdd_set_wlan_suspend_mode(bool suspend); v_U16_t hdd_select_queue(struct net_device *dev, - struct sk_buff *skb); + struct sk_buff *skb, void *accel_priv, select_queue_fallback_t fallback); #ifdef WLAN_FEATURE_PACKET_FILTERING static void hdd_set_multicast_list(struct net_device *dev); @@ -563,7 +560,7 @@ void hdd_checkandupdate_phymode( hdd_context_t *pHddCtx) VOS_STATUS vosStatus; // need to issue a disconnect to CSR. - INIT_COMPLETION(pAdapter->disconnect_comp_var); + reinit_completion(&pAdapter->disconnect_comp_var); vosStatus = sme_RoamDisconnect(WLAN_HDD_GET_HAL_CTX(pAdapter), pAdapter->sessionId, eCSR_DISCONNECT_REASON_UNSPECIFIED ); @@ -634,7 +631,7 @@ void hdd_checkandupdate_phymode( hdd_adapter_t *pAdapter, char *country_code) VOS_STATUS vosStatus; // need to issue a disconnect to CSR. - INIT_COMPLETION(pAdapter->disconnect_comp_var); + reinit_completion(&pAdapter->disconnect_comp_var); vosStatus = sme_RoamDisconnect(WLAN_HDD_GET_HAL_CTX(pAdapter), pAdapter->sessionId, eCSR_DISCONNECT_REASON_UNSPECIFIED ); @@ -1586,7 +1583,7 @@ int hdd_return_batch_scan_rsp_to_user { if (TRUE == pAdapter->hdd_wait_for_get_batch_scan_rsp) { - INIT_COMPLETION(pAdapter->hdd_get_batch_scan_req_var); + reinit_completion(&pAdapter->hdd_get_batch_scan_req_var); rc = wait_for_completion_timeout( &pAdapter->hdd_get_batch_scan_req_var, msecs_to_jiffies(HDD_GET_BATCH_SCAN_RSP_TIME_OUT)); @@ -1780,7 +1777,7 @@ int hdd_handle_batch_scan_ioctl halStatus); if (TRUE == pAdapter->hdd_wait_for_set_batch_scan_rsp) { - INIT_COMPLETION(pAdapter->hdd_set_batch_scan_req_var); + reinit_completion(&pAdapter->hdd_set_batch_scan_req_var); rc = wait_for_completion_timeout( &pAdapter->hdd_set_batch_scan_req_var, msecs_to_jiffies(HDD_SET_BATCH_SCAN_REQ_TIME_OUT)); @@ -2167,7 +2164,7 @@ int hdd_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd) country_code = command + 8; - INIT_COMPLETION(pAdapter->change_country_code); + reinit_completion(&pAdapter->change_country_code); hdd_checkandupdate_dfssetting(pAdapter, country_code); #ifndef CONFIG_ENABLE_LINUX_REG hdd_checkandupdate_phymode(pAdapter, country_code); @@ -2803,6 +2800,9 @@ int hdd_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd) tANI_U8 temp = 0; u64 cookie; hdd_station_ctx_t *pHddStaCtx = NULL; + struct cfg80211_mgmt_tx_params sp; + + pHddStaCtx = WLAN_HDD_GET_STATION_CTX_PTR(pAdapter); /* if not associated, no need to send action frame */ @@ -2885,18 +2885,19 @@ int hdd_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd) vos_mem_free(buf); buf = NULL; - wlan_hdd_mgmt_tx( NULL, -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,6,0)) - &(pAdapter->wdev), -#else - dev, -#endif - &chan, 0, -#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,8,0)) - NL80211_CHAN_HT20, 1, -#endif - dwellTime, finalBuf, finalLen, 1, - 1, &cookie ); + + memset(&sp, 0 , sizeof(sp)); + + sp.chan = &chan; + sp.offchan = 0; + sp.wait = dwellTime; + sp.buf = finalBuf; + sp.len = finalLen; + sp.no_cck = true; + sp.dont_wait_for_ack = true; + + wlan_hdd_mgmt_tx(NULL, &(pAdapter->wdev), + &sp, &cookie ); vos_mem_free(finalBuf); } else if (strncmp(command, "GETROAMSCANCHANNELMINTIME", 25) == 0) @@ -5399,8 +5400,10 @@ static hdd_adapter_t* hdd_alloc_station_adapter( hdd_context_t *pHddCtx, tSirMac hdd_adapter_t *pAdapter = NULL; /* * cfg80211 initialization and registration.... - */ - pWlanDev = alloc_netdev_mq(sizeof( hdd_adapter_t ), name, ether_setup, NUM_TX_QUEUES); + */ + + pWlanDev = alloc_netdev_mq(sizeof( hdd_adapter_t ), name, NET_NAME_UNKNOWN, + ether_setup, NUM_TX_QUEUES); if(pWlanDev != NULL) { @@ -5560,7 +5563,7 @@ VOS_STATUS hdd_init_station_mode( hdd_adapter_t *pAdapter ) VOS_STATUS status = VOS_STATUS_E_FAILURE; long rc = 0; - INIT_COMPLETION(pAdapter->session_open_comp_var); + reinit_completion(&pAdapter->session_open_comp_var); sme_SetCurrDeviceMode(pHddCtx->hHal, pAdapter->device_mode); //Open a SME session for future operation halStatus = sme_OpenSession( pHddCtx->hHal, hdd_smeRoamCallback, pAdapter, @@ -5659,7 +5662,7 @@ error_init_txrx: error_register_wext: if (test_bit(SME_SESSION_OPENED, &pAdapter->event_flags)) { - INIT_COMPLETION(pAdapter->session_close_comp_var); + reinit_completion(&pAdapter->session_close_comp_var); if (eHAL_STATUS_SUCCESS == sme_CloseSession(pHddCtx->hHal, pAdapter->sessionId, hdd_smeCloseSessionCallback, pAdapter)) @@ -5688,7 +5691,7 @@ void hdd_cleanup_actionframe( hdd_context_t *pHddCtx, hdd_adapter_t *pAdapter ) if( NULL != cfgState->buf ) { long rc; - INIT_COMPLETION(pAdapter->tx_action_cnf_event); + reinit_completion(&pAdapter->tx_action_cnf_event); rc = wait_for_completion_interruptible_timeout( &pAdapter->tx_action_cnf_event, msecs_to_jiffies(ACTION_FRAME_TX_TIMEOUT)); @@ -6012,7 +6015,7 @@ VOS_STATUS hdd_disable_bmps_imps(hdd_context_t *pHddCtx, tANI_U8 session_type) (TRUE == disableImps)) { /* Now, get the chip into Full Power now */ - INIT_COMPLETION(pHddCtx->full_pwr_comp_var); + reinit_completion(&pHddCtx->full_pwr_comp_var); halStatus = sme_RequestFullPower(pHddCtx->hHal, hdd_full_pwr_cbk, pHddCtx, eSME_FULL_PWR_NEEDED_BY_HDD); @@ -6532,7 +6535,7 @@ VOS_STATUS hdd_stop_adapter( hdd_context_t *pHddCtx, hdd_adapter_t *pAdapter ) #endif if (test_bit(SME_SESSION_OPENED, &pAdapter->event_flags)) { - INIT_COMPLETION(pAdapter->session_close_comp_var); + reinit_completion(&pAdapter->session_close_comp_var); if (eHAL_STATUS_SUCCESS == sme_CloseSession(pHddCtx->hHal, pAdapter->sessionId, hdd_smeCloseSessionCallback, pAdapter)) @@ -6817,7 +6820,7 @@ VOS_STATUS hdd_start_all_adapters( hdd_context_t *pHddCtx ) case WLAN_HDD_P2P_GO: hddLog(VOS_TRACE_LEVEL_ERROR, "%s [SSR] send stop ap to supplicant", __func__); - cfg80211_ap_stopped(pAdapter->dev, GFP_KERNEL); +// cfg80211_ap_stopped(pAdapter->dev, GFP_KERNEL); break; case WLAN_HDD_MONITOR: @@ -7299,9 +7302,9 @@ static void hdd_set_multicast_list(struct net_device *dev) --------------------------------------------------------------------------*/ v_U16_t hdd_select_queue(struct net_device *dev, - struct sk_buff *skb) + struct sk_buff *skb, void *accel_priv, select_queue_fallback_t fallback) { - return hdd_wmm_select_queue(dev, skb); + return hdd_wmm_select_queue(dev, skb, NULL, NULL); } @@ -7630,14 +7633,6 @@ void hdd_wlan_exit(hdd_context_t *pHddCtx) "%s: Failed to close VOSS Scheduler",__func__); VOS_ASSERT( VOS_IS_STATUS_SUCCESS( vosStatus ) ); } -#ifdef WLAN_OPEN_SOURCE -#ifdef WLAN_FEATURE_HOLD_RX_WAKELOCK - /* Destroy the wake lock */ - wake_lock_destroy(&pHddCtx->rx_wake_lock); -#endif - /* Destroy the wake lock */ - wake_lock_destroy(&pHddCtx->sap_wake_lock); -#endif #ifdef CONFIG_ENABLE_LINUX_REG vosStatus = vos_nv_close(); @@ -7835,29 +7830,16 @@ VOS_STATUS hdd_post_voss_start_config(hdd_context_t* pHddCtx) /* wake lock APIs for HDD */ void hdd_prevent_suspend(void) { -#ifdef WLAN_OPEN_SOURCE - wake_lock(&wlan_wake_lock); -#else wcnss_prevent_suspend(); -#endif } void hdd_allow_suspend(void) { -#ifdef WLAN_OPEN_SOURCE - wake_unlock(&wlan_wake_lock); -#else wcnss_allow_suspend(); -#endif } void hdd_prevent_suspend_timeout(v_U32_t timeout) { -#ifdef WLAN_OPEN_SOURCE - wake_lock_timeout(&wlan_wake_lock, msecs_to_jiffies(timeout)); -#else - /* Do nothing as there is no API in wcnss for timeout*/ -#endif } /**--------------------------------------------------------------------------- @@ -8654,7 +8636,7 @@ int hdd_wlan_startup(struct device *dev ) if (country_code) { eHalStatus ret; - INIT_COMPLETION(pAdapter->change_country_code); + reinit_completion(&pAdapter->change_country_code); hdd_checkandupdate_dfssetting(pAdapter, country_code); #ifndef CONFIG_ENABLE_LINUX_REG hdd_checkandupdate_phymode(pAdapter, country_code); @@ -8825,19 +8807,6 @@ int hdd_wlan_startup(struct device *dev ) pHddCtx->isLoadUnloadInProgress = WLAN_HDD_NO_LOAD_UNLOAD_IN_PROGRESS; -#ifdef WLAN_OPEN_SOURCE -#ifdef WLAN_FEATURE_HOLD_RX_WAKELOCK - /* Initialize the wake lcok */ - wake_lock_init(&pHddCtx->rx_wake_lock, - WAKE_LOCK_SUSPEND, - "qcom_rx_wakelock"); -#endif - /* Initialize the wake lcok */ - wake_lock_init(&pHddCtx->sap_wake_lock, - WAKE_LOCK_SUSPEND, - "qcom_sap_wakelock"); -#endif - vos_event_init(&pHddCtx->scan_info.scan_finished_event); pHddCtx->scan_info.scan_pending_option = WEXT_SCAN_PENDING_GIVEUP; @@ -8973,10 +8942,6 @@ static int hdd_driver_init( void) ENTER(); -#ifdef WLAN_OPEN_SOURCE - wake_lock_init(&wlan_wake_lock, WAKE_LOCK_SUSPEND, "wlan"); -#endif - hddTraceInit(); pr_info("%s: loading driver v%s\n", WLAN_MODULE_NAME, QWLAN_VERSIONSTR TIMER_MANAGER_STR MEMORY_DEBUG_STR); @@ -8987,9 +8952,6 @@ static int hdd_driver_init( void) { hddLog(VOS_TRACE_LEVEL_FATAL, "%s: Libra WLAN not Powered Up. " "exiting", __func__); -#ifdef WLAN_OPEN_SOURCE - wake_lock_destroy(&wlan_wake_lock); -#endif #ifdef WLAN_LOGGING_SOCK_SVC_ENABLE wlan_logging_sock_deinit_svc(); @@ -9013,9 +8975,6 @@ static int hdd_driver_init( void) } if (max_retries >= 5) { hddLog(VOS_TRACE_LEVEL_FATAL,"%s: WCNSS driver not ready", __func__); -#ifdef WLAN_OPEN_SOURCE - wake_lock_destroy(&wlan_wake_lock); -#endif #ifdef WLAN_LOGGING_SOCK_SVC_ENABLE wlan_logging_sock_deinit_svc(); @@ -9095,10 +9054,6 @@ static int hdd_driver_init( void) vos_mem_exit(); #endif -#ifdef WLAN_OPEN_SOURCE - wake_lock_destroy(&wlan_wake_lock); -#endif - #ifdef WLAN_LOGGING_SOCK_SVC_ENABLE wlan_logging_sock_deinit_svc(); #endif @@ -9182,7 +9137,7 @@ static void hdd_driver_exit(void) } else { - INIT_COMPLETION(pHddCtx->ssr_comp_var); + reinit_completion(&pHddCtx->ssr_comp_var); if (pHddCtx->isLogpInProgress) { @@ -9228,10 +9183,6 @@ static void hdd_driver_exit(void) #endif done: -#ifdef WLAN_OPEN_SOURCE - wake_lock_destroy(&wlan_wake_lock); -#endif - pr_info("%s: driver unloaded\n", WLAN_MODULE_NAME); } @@ -9380,7 +9331,7 @@ void hdd_set_conparam ( v_UINT_t newParam ) --------------------------------------------------------------------------*/ -VOS_STATUS hdd_softap_sta_deauth(hdd_adapter_t *pAdapter, v_U8_t *pDestMacAddress) +VOS_STATUS hdd_softap_sta_deauth(hdd_adapter_t *pAdapter, const v_U8_t *pDestMacAddress) { v_CONTEXT_t pVosContext = (WLAN_HDD_GET_CTX(pAdapter))->pvosContext; VOS_STATUS vosStatus = VOS_STATUS_E_FAULT; @@ -9414,7 +9365,7 @@ VOS_STATUS hdd_softap_sta_deauth(hdd_adapter_t *pAdapter, v_U8_t *pDestMacAddres --------------------------------------------------------------------------*/ -void hdd_softap_sta_disassoc(hdd_adapter_t *pAdapter,v_U8_t *pDestMacAddress) +void hdd_softap_sta_disassoc(hdd_adapter_t *pAdapter, const v_U8_t *pDestMacAddress) { v_CONTEXT_t pVosContext = (WLAN_HDD_GET_CTX(pAdapter))->pvosContext; @@ -9711,8 +9662,7 @@ static VOS_STATUS wlan_hdd_framework_restart(hdd_context_t *pHddCtx) * the driver. * */ - - cfg80211_send_unprot_deauth(pAdapterNode->pAdapter->dev, (u_int8_t*)mgmt, len ); + cfg80211_rx_unprot_mlme_mgmt(pAdapterNode->pAdapter->dev, (u_int8_t*)mgmt, len ); } status = hdd_get_next_adapter ( pHddCtx, pAdapterNode, &pNext ); pAdapterNode = pNext; @@ -9849,7 +9799,7 @@ int wlan_hdd_scan_abort(hdd_adapter_t *pAdapter) pScanInfo = &pHddCtx->scan_info; if (pScanInfo->mScanPending) { - INIT_COMPLETION(pScanInfo->abortscan_event_var); + reinit_completion(&pScanInfo->abortscan_event_var); hdd_abort_mac_scan(pHddCtx, eCSR_SCAN_ABORT_DEFAULT); status = wait_for_completion_interruptible_timeout( diff --git a/drivers/net/wireless/prima/CORE/HDD/src/wlan_hdd_p2p.c b/drivers/net/wireless/prima/CORE/HDD/src/wlan_hdd_p2p.c index 82df31bbb1d1..2db4b61c5ea1 100644 --- a/drivers/net/wireless/prima/CORE/HDD/src/wlan_hdd_p2p.c +++ b/drivers/net/wireless/prima/CORE/HDD/src/wlan_hdd_p2p.c @@ -309,7 +309,7 @@ VOS_STATUS wlan_hdd_cancel_existing_remain_on_channel(hdd_adapter_t *pAdapter) return VOS_STATUS_E_FAILURE; } - INIT_COMPLETION(pAdapter->cancel_rem_on_chan_var); + reinit_completion(&pAdapter->cancel_rem_on_chan_var); pRemainChanCtx->hdd_remain_on_chan_cancel_in_progress = TRUE; /* Issue abort remain on chan request to sme. @@ -396,7 +396,7 @@ void wlan_hdd_remain_on_chan_timeout(void *data) } pRemainChanCtx->hdd_remain_on_chan_cancel_in_progress = TRUE; - INIT_COMPLETION(pAdapter->cancel_rem_on_chan_var); + reinit_completion(&pAdapter->cancel_rem_on_chan_var); hddLog( LOG1,"%s: Cancel Remain on Channel on timeout", __func__); if ( ( WLAN_HDD_INFRA_STATION == pAdapter->device_mode ) || ( WLAN_HDD_P2P_CLIENT == pAdapter->device_mode ) || @@ -524,7 +524,7 @@ static int wlan_hdd_request_remain_on_channel( struct wiphy *wiphy, pAdapterNode = pNext; } hdd_prevent_suspend(); - INIT_COMPLETION(pAdapter->rem_on_chan_ready_event); + reinit_completion(&pAdapter->rem_on_chan_ready_event); //call sme API to start remain on channel. if ( ( WLAN_HDD_INFRA_STATION == pAdapter->device_mode ) || @@ -805,7 +805,7 @@ int wlan_hdd_cfg80211_cancel_remain_on_channel( struct wiphy *wiphy, else pRemainChanCtx->hdd_remain_on_chan_cancel_in_progress = TRUE; } - INIT_COMPLETION(pAdapter->cancel_rem_on_chan_var); + reinit_completion(&pAdapter->cancel_rem_on_chan_var); /* Issue abort remain on chan request to sme. * The remain on channel callback will make sure the remain_on_chan * expired event is sent. @@ -843,56 +843,25 @@ int wlan_hdd_cfg80211_cancel_remain_on_channel( struct wiphy *wiphy, return 0; } -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,6,0)) -int wlan_hdd_mgmt_tx( struct wiphy *wiphy, struct wireless_dev *wdev, - struct ieee80211_channel *chan, bool offchan, -#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,8,0)) - enum nl80211_channel_type channel_type, - bool channel_type_valid, -#endif - unsigned int wait, - const u8 *buf, size_t len, bool no_cck, - bool dont_wait_for_ack, u64 *cookie ) -#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0)) -int wlan_hdd_mgmt_tx( struct wiphy *wiphy, struct net_device *dev, - struct ieee80211_channel *chan, bool offchan, - enum nl80211_channel_type channel_type, - bool channel_type_valid, unsigned int wait, - const u8 *buf, size_t len, bool no_cck, - bool dont_wait_for_ack, u64 *cookie ) -#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,38)) -int wlan_hdd_mgmt_tx( struct wiphy *wiphy, struct net_device *dev, - struct ieee80211_channel *chan, bool offchan, - enum nl80211_channel_type channel_type, - bool channel_type_valid, unsigned int wait, - const u8 *buf, size_t len, u64 *cookie ) -#else -int wlan_hdd_mgmt_tx( struct wiphy *wiphy, struct net_device *dev, - struct ieee80211_channel *chan, - enum nl80211_channel_type channel_type, - bool channel_type_valid, - const u8 *buf, size_t len, u64 *cookie ) -#endif //LINUX_VERSION_CODE +int wlan_hdd_mgmt_tx(struct wiphy *wiphy, struct wireless_dev *wdev, + struct cfg80211_mgmt_tx_params *params, + u64 *cookie) { -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,6,0)) struct net_device *dev = wdev->netdev; -#endif hdd_adapter_t *pAdapter = WLAN_HDD_GET_PRIV_PTR( dev ); hdd_cfg80211_state_t *cfgState = WLAN_HDD_GET_CFG_STATE_PTR( pAdapter ); hdd_remain_on_chan_ctx_t *pRemainChanCtx = cfgState->remain_on_chan_ctx; hdd_context_t *pHddCtx = WLAN_HDD_GET_CTX( pAdapter ); - tANI_U8 type = WLAN_HDD_GET_TYPE_FRM_FC(buf[0]); - tANI_U8 subType = WLAN_HDD_GET_SUBTYPE_FRM_FC(buf[0]); + tANI_U8 type = WLAN_HDD_GET_TYPE_FRM_FC(params->buf[0]); + tANI_U8 subType = WLAN_HDD_GET_SUBTYPE_FRM_FC(params->buf[0]); tActionFrmType actionFrmType = WLAN_HDD_ACTION_FRM_TYPE_MAX; bool noack = 0; int status; #ifdef WLAN_FEATURE_11W - tANI_U8 *pTxFrmBuf = (tANI_U8 *) buf; // For SA Query, we have to set protect bit + tANI_U8 *pTxFrmBuf = (tANI_U8 *) params->buf; // For SA Query, we have to set protect bit #endif -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,38)) hdd_adapter_t *goAdapter; -#endif MTRACE(vos_trace(VOS_MODULE_ID_HDD, TRACE_CODE_HDD_ACTION, pAdapter->sessionId, pAdapter->device_mode )); @@ -912,9 +881,9 @@ int wlan_hdd_mgmt_tx( struct wiphy *wiphy, struct net_device *dev, #ifdef WLAN_FEATURE_P2P_DEBUG if ((type == SIR_MAC_MGMT_FRAME) && (subType == SIR_MAC_MGMT_ACTION) && - (buf[WLAN_HDD_PUBLIC_ACTION_FRAME_OFFSET] == WLAN_HDD_PUBLIC_ACTION_FRAME)) + (params->buf[WLAN_HDD_PUBLIC_ACTION_FRAME_OFFSET] == WLAN_HDD_PUBLIC_ACTION_FRAME)) { - actionFrmType = buf[WLAN_HDD_PUBLIC_ACTION_FRAME_TYPE_OFFSET]; + actionFrmType = params->buf[WLAN_HDD_PUBLIC_ACTION_FRAME_TYPE_OFFSET]; if(actionFrmType >= MAX_P2P_ACTION_FRAME_TYPE) { hddLog(VOS_TRACE_LEVEL_ERROR,"[P2P] unknown[%d] ---> OTA", @@ -942,14 +911,11 @@ int wlan_hdd_mgmt_tx( struct wiphy *wiphy, struct net_device *dev, } #endif -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0)) - noack = dont_wait_for_ack; -#endif - + noack = params->dont_wait_for_ack; //If the wait is coming as 0 with off channel set //then set the wait to 200 ms - if (offchan && !wait) - wait = ACTION_FRAME_DEFAULT_WAIT; + if (params->offchan && !params->wait) + params->wait = ACTION_FRAME_DEFAULT_WAIT; //Call sme API to send out a action frame. // OR can we send it directly through data path?? @@ -978,7 +944,7 @@ int wlan_hdd_mgmt_tx( struct wiphy *wiphy, struct net_device *dev, * supplicant. */ tANI_U8 dstMac[ETH_ALEN] = {0}; - memcpy(&dstMac, &buf[WLAN_HDD_80211_FRM_DA_OFFSET], ETH_ALEN); + memcpy(&dstMac, ¶ms->buf[WLAN_HDD_80211_FRM_DA_OFFSET], ETH_ALEN); hddLog(VOS_TRACE_LEVEL_INFO, "%s: Deauth/Disassoc received for STA:" MAC_ADDRESS_STR, @@ -1008,7 +974,7 @@ int wlan_hdd_mgmt_tx( struct wiphy *wiphy, struct net_device *dev, if( subType == SIR_MAC_MGMT_ACTION) { hddLog( LOG1, "Action frame tx request : %s", - hdd_getActionString(buf[WLAN_HDD_PUBLIC_ACTION_FRAME_OFFSET])); + hdd_getActionString(params->buf[WLAN_HDD_PUBLIC_ACTION_FRAME_OFFSET])); } #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,38)) @@ -1016,26 +982,26 @@ int wlan_hdd_mgmt_tx( struct wiphy *wiphy, struct net_device *dev, //If GO adapter exists and operating on same frequency //then we will not request remain on channel - if( goAdapter && ( ieee80211_frequency_to_channel(chan->center_freq) + if( goAdapter && ( ieee80211_frequency_to_channel(params->chan->center_freq) == goAdapter->sessionCtx.ap.operatingChannel ) ) { /* if GO exist and is not off channel * wait time should be zero. */ - wait = 0; + params->wait = 0; goto send_frame; } #endif #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,38)) - if( offchan && wait) + if(params->offchan && params->wait) { int status; // In case of P2P Client mode if we are already // on the same channel then send the frame directly if( (cfgState->remain_on_chan_ctx != NULL) && - (cfgState->current_freq == chan->center_freq) + (cfgState->current_freq == params->chan->center_freq) ) { if ( VOS_TIMER_STATE_RUNNING == vos_timer_getCurrentState( @@ -1056,15 +1022,15 @@ int wlan_hdd_mgmt_tx( struct wiphy *wiphy, struct net_device *dev, if ( actionFrmType == WLAN_HDD_INVITATION_REQ || actionFrmType == WLAN_HDD_GO_NEG_REQ || actionFrmType == WLAN_HDD_GO_NEG_RESP ) - wait = wait + ACTION_FRAME_RSP_WAIT; + params->wait = params->wait + ACTION_FRAME_RSP_WAIT; else if ( actionFrmType == WLAN_HDD_GO_NEG_CNF || actionFrmType == WLAN_HDD_INVITATION_RESP ) - wait = wait + ACTION_FRAME_ACK_WAIT; + params->wait = params->wait + ACTION_FRAME_ACK_WAIT; vos_timer_stop( &cfgState->remain_on_chan_ctx->hdd_remain_on_chan_timer); status = vos_timer_start( &cfgState->remain_on_chan_ctx->hdd_remain_on_chan_timer, - wait); + params->wait); if ( status != VOS_STATUS_SUCCESS ) { hddLog( LOGE, "Remain on Channel timer start failed"); @@ -1072,7 +1038,7 @@ int wlan_hdd_mgmt_tx( struct wiphy *wiphy, struct net_device *dev, hddLog(VOS_TRACE_LEVEL_INFO, "action frame: extending the wait time %u", - wait); + params->wait); goto send_frame; } else @@ -1096,21 +1062,18 @@ int wlan_hdd_mgmt_tx( struct wiphy *wiphy, struct net_device *dev, } } hddLog(VOS_TRACE_LEVEL_INFO, - "action frame: Request ROC for wait time %u", wait); + "action frame: Request ROC for wait time %u", params->wait); - INIT_COMPLETION(pAdapter->offchannel_tx_event); + reinit_completion(&pAdapter->offchannel_tx_event); status = wlan_hdd_request_remain_on_channel(wiphy, dev, - chan, -#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,8,0)) - channel_type, -#endif - wait, cookie, + params->chan, + params->wait, cookie, OFF_CHANNEL_ACTION_TX); if(0 != status) { if( (-EBUSY == status) && - (cfgState->current_freq == chan->center_freq) ) + (cfgState->current_freq == params->chan->center_freq) ) { goto send_frame; } @@ -1126,7 +1089,7 @@ int wlan_hdd_mgmt_tx( struct wiphy *wiphy, struct net_device *dev, goto err_rem_channel; } } - else if ( offchan ) + else if (params->offchan ) { /* Check before sending action frame whether we already remain on channel */ @@ -1140,13 +1103,13 @@ int wlan_hdd_mgmt_tx( struct wiphy *wiphy, struct net_device *dev, if(!noack) { - cfgState->buf = vos_mem_malloc( len ); //buf; + cfgState->buf = vos_mem_malloc( params->len ); //buf; if( cfgState->buf == NULL ) return -ENOMEM; - cfgState->len = len; + cfgState->len = params->len; - vos_mem_copy( cfgState->buf, buf, len); + vos_mem_copy( cfgState->buf, params->buf, params->len); #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,38)) if( cfgState->remain_on_chan_ctx ) @@ -1173,9 +1136,9 @@ int wlan_hdd_mgmt_tx( struct wiphy *wiphy, struct net_device *dev, if ((type == SIR_MAC_MGMT_FRAME) && (subType == SIR_MAC_MGMT_ACTION) && - (buf[WLAN_HDD_PUBLIC_ACTION_FRAME_OFFSET] == WLAN_HDD_PUBLIC_ACTION_FRAME)) + (params->buf[WLAN_HDD_PUBLIC_ACTION_FRAME_OFFSET] == WLAN_HDD_PUBLIC_ACTION_FRAME)) { - actionFrmType = buf[WLAN_HDD_PUBLIC_ACTION_FRAME_TYPE_OFFSET]; + actionFrmType = params->buf[WLAN_HDD_PUBLIC_ACTION_FRAME_TYPE_OFFSET]; hddLog(LOG1, "Tx Action Frame %u.", actionFrmType); if (actionFrmType == WLAN_HDD_PROV_DIS_REQ) { @@ -1191,7 +1154,7 @@ int wlan_hdd_mgmt_tx( struct wiphy *wiphy, struct net_device *dev, #ifdef WLAN_FEATURE_11W if ((type == SIR_MAC_MGMT_FRAME) && (subType == SIR_MAC_MGMT_ACTION) && - (buf[WLAN_HDD_PUBLIC_ACTION_FRAME_OFFSET] == WLAN_HDD_SA_QUERY_ACTION_FRAME)) + (params->buf[WLAN_HDD_PUBLIC_ACTION_FRAME_OFFSET] == WLAN_HDD_SA_QUERY_ACTION_FRAME)) { VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, "%s: Calling sme_sendAction. For Category %s", __func__, "SA Query"); @@ -1201,7 +1164,7 @@ int wlan_hdd_mgmt_tx( struct wiphy *wiphy, struct net_device *dev, #endif if (eHAL_STATUS_SUCCESS != sme_sendAction( WLAN_HDD_GET_HAL_CTX(pAdapter), - sessionId, buf, len, wait, noack)) + sessionId, params->buf, params->len, params->wait, noack)) { VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, "%s: sme_sendAction returned fail", __func__); @@ -1214,7 +1177,7 @@ int wlan_hdd_mgmt_tx( struct wiphy *wiphy, struct net_device *dev, { if( VOS_STATUS_SUCCESS != WLANSAP_SendAction( (WLAN_HDD_GET_CTX(pAdapter))->pvosContext, - buf, len, 0 ) ) + params->buf, params->len, 0 ) ) { VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, "%s: WLANSAP_SendAction returned fail", __func__); @@ -1237,7 +1200,7 @@ err_rem_channel: #else pAdapter->dev, #endif - *cookie, buf, len, FALSE, GFP_KERNEL ); + *cookie, params->buf, params->len, FALSE, GFP_KERNEL ); return 0; } @@ -1728,11 +1691,6 @@ void hdd_sendMgmtFrameOverMonitorIface( hdd_adapter_t *pMonAdapter, int needed_headroom = 0; int flag = HDD_RX_FLAG_IV_STRIPPED | HDD_RX_FLAG_DECRYPTED | HDD_RX_FLAG_MMIC_STRIPPED; -#ifdef WLAN_OPEN_SOURCE -#ifdef WLAN_FEATURE_HOLD_RX_WAKELOCK - hdd_context_t* pHddCtx = (hdd_context_t*)(pMonAdapter->pHddCtx); -#endif -#endif hddLog( LOG1, FL("Indicate Frame over Monitor Intf")); if (NULL == pbFrames) @@ -1779,11 +1737,6 @@ void hdd_sendMgmtFrameOverMonitorIface( hdd_adapter_t *pMonAdapter, skb->dev = pMonAdapter->dev; skb->protocol = eth_type_trans( skb, skb->dev ); skb->ip_summed = CHECKSUM_NONE; -#ifdef WLAN_OPEN_SOURCE -#ifdef WLAN_FEATURE_HOLD_RX_WAKELOCK - wake_lock_timeout(&pHddCtx->rx_wake_lock, msecs_to_jiffies(HDD_WAKE_LOCK_DURATION)); -#endif -#endif rxstat = netif_rx_ni(skb); if( NET_RX_SUCCESS == rxstat ) { @@ -2131,11 +2084,6 @@ static void hdd_wlan_tx_complete( hdd_adapter_t* pAdapter, struct ieee80211_radiotap_header *rthdr; unsigned char *pos; struct sk_buff *skb = cfgState->skb; -#ifdef WLAN_OPEN_SOURCE -#ifdef WLAN_FEATURE_HOLD_RX_WAKELOCK - hdd_context_t *pHddCtx = (hdd_context_t*)(pAdapter->pHddCtx); -#endif -#endif /* 2 Byte for TX flags and 1 Byte for Retry count */ u32 rtHdrLen = sizeof(*rthdr) + 3; @@ -2195,11 +2143,6 @@ static void hdd_wlan_tx_complete( hdd_adapter_t* pAdapter, skb->pkt_type = PACKET_OTHERHOST; skb->protocol = htons(ETH_P_802_2); memset( skb->cb, 0, sizeof( skb->cb ) ); -#ifdef WLAN_OPEN_SOURCE -#ifdef WLAN_FEATURE_HOLD_RX_WAKELOCK - wake_lock_timeout(&pHddCtx->rx_wake_lock, msecs_to_jiffies(HDD_WAKE_LOCK_DURATION)); -#endif -#endif if (in_interrupt()) netif_rx( skb ); else diff --git a/drivers/net/wireless/prima/CORE/HDD/src/wlan_hdd_softap_tx_rx.c b/drivers/net/wireless/prima/CORE/HDD/src/wlan_hdd_softap_tx_rx.c index f53f72d89a72..ab673153bd6a 100644 --- a/drivers/net/wireless/prima/CORE/HDD/src/wlan_hdd_softap_tx_rx.c +++ b/drivers/net/wireless/prima/CORE/HDD/src/wlan_hdd_softap_tx_rx.c @@ -1529,11 +1529,6 @@ VOS_STATUS hdd_softap_rx_packet_cbk( v_VOID_t *vosContext, skb->protocol = eth_type_trans(skb, skb->dev); skb->ip_summed = CHECKSUM_NONE; -#ifdef WLAN_OPEN_SOURCE -#ifdef WLAN_FEATURE_HOLD_RX_WAKELOCK - wake_lock_timeout(&pHddCtx->rx_wake_lock, msecs_to_jiffies(HDD_WAKE_LOCK_DURATION)); -#endif -#endif rxstat = netif_rx_ni(skb); if (NET_RX_SUCCESS == rxstat) { diff --git a/drivers/net/wireless/prima/CORE/HDD/src/wlan_hdd_trace.c b/drivers/net/wireless/prima/CORE/HDD/src/wlan_hdd_trace.c index 433bbbbb20e7..1d7bd766d763 100644 --- a/drivers/net/wireless/prima/CORE/HDD/src/wlan_hdd_trace.c +++ b/drivers/net/wireless/prima/CORE/HDD/src/wlan_hdd_trace.c @@ -8,7 +8,7 @@ Qualcomm Technologies Confidential and Proprietary. ========================================================================*/ - +#ifdef TRACE_RECORD #include "vos_trace.h" #include "vos_types.h" #include "wlan_hdd_trace.h" @@ -90,3 +90,5 @@ void hddTraceInit() { vosTraceRegister(VOS_MODULE_ID_HDD, (tpvosTraceCb)&hddTraceDump); } + +#endif diff --git a/drivers/net/wireless/prima/CORE/HDD/src/wlan_hdd_tx_rx.c b/drivers/net/wireless/prima/CORE/HDD/src/wlan_hdd_tx_rx.c index 170be1ee3732..76d6087398fc 100644 --- a/drivers/net/wireless/prima/CORE/HDD/src/wlan_hdd_tx_rx.c +++ b/drivers/net/wireless/prima/CORE/HDD/src/wlan_hdd_tx_rx.c @@ -488,7 +488,7 @@ int hdd_mon_hard_start_xmit(struct sk_buff *skb, struct net_device *dev) skb->protocol = htons(HDD_ETHERTYPE_802_1_X); - hdd_hostapd_select_queue(pPgBkAdapter->dev, skb); + hdd_hostapd_select_queue(pPgBkAdapter->dev, skb, NULL, NULL); return hdd_softap_hard_start_xmit( skb, pPgBkAdapter->dev ); } else @@ -1721,11 +1721,6 @@ VOS_STATUS hdd_rx_packet_cbk( v_VOID_t *vosContext, ++pAdapter->hdd_stats.hddTxRxStats.rxPackets; ++pAdapter->stats.rx_packets; pAdapter->stats.rx_bytes += skb->len; -#ifdef WLAN_OPEN_SOURCE -#ifdef WLAN_FEATURE_HOLD_RX_WAKELOCK - wake_lock_timeout(&pHddCtx->rx_wake_lock, msecs_to_jiffies(HDD_WAKE_LOCK_DURATION)); -#endif -#endif rxstat = netif_rx_ni(skb); if (NET_RX_SUCCESS == rxstat) { diff --git a/drivers/net/wireless/prima/CORE/HDD/src/wlan_hdd_wext.c b/drivers/net/wireless/prima/CORE/HDD/src/wlan_hdd_wext.c index bfddd7229a78..d501a3222de9 100644 --- a/drivers/net/wireless/prima/CORE/HDD/src/wlan_hdd_wext.c +++ b/drivers/net/wireless/prima/CORE/HDD/src/wlan_hdd_wext.c @@ -1217,7 +1217,7 @@ VOS_STATUS wlan_hdd_check_ula_done(hdd_adapter_t *pAdapter) if (VOS_FALSE == pHddStaCtx->conn_info.uIsAuthenticated) { - INIT_COMPLETION(pAdapter->ula_complete); + reinit_completion(&pAdapter->ula_complete); /*To avoid race condition between the set key and the last EAPOL packet, notify TL to finish upper layer authentication incase if the @@ -1375,7 +1375,7 @@ static int iw_set_mode(struct net_device *dev, { VOS_STATUS vosStatus; // need to issue a disconnect to CSR. - INIT_COMPLETION(pAdapter->disconnect_comp_var); + reinit_completion(&pAdapter->disconnect_comp_var); vosStatus = sme_RoamDisconnect( WLAN_HDD_GET_HAL_CTX(pAdapter), pAdapter->sessionId, eCSR_DISCONNECT_REASON_IBSS_LEAVE ); @@ -3438,7 +3438,7 @@ static int iw_set_encode(struct net_device *dev,struct iw_request_info *info, if(eConnectionState_Associated == pHddStaCtx->conn_info.connState) { - INIT_COMPLETION(pAdapter->disconnect_comp_var); + reinit_completion(&pAdapter->disconnect_comp_var); status = sme_RoamDisconnect( WLAN_HDD_GET_HAL_CTX(pAdapter), pAdapter->sessionId, eCSR_DISCONNECT_REASON_UNSPECIFIED ); if(eHAL_STATUS_SUCCESS == status) { @@ -3957,7 +3957,7 @@ static int iw_set_mlme(struct net_device *dev, if( mlme->reason_code == HDD_REASON_MICHAEL_MIC_FAILURE ) reason = eCSR_DISCONNECT_REASON_MIC_ERROR; - INIT_COMPLETION(pAdapter->disconnect_comp_var); + reinit_completion(&pAdapter->disconnect_comp_var); status = sme_RoamDisconnect( WLAN_HDD_GET_HAL_CTX(pAdapter), pAdapter->sessionId,reason); if(eHAL_STATUS_SUCCESS == status) @@ -4012,7 +4012,7 @@ static int iw_setint_getnone(struct net_device *dev, struct iw_request_info *inf #ifdef CONFIG_HAS_EARLYSUSPEND v_U8_t nEnableSuspendOld; #endif - INIT_COMPLETION(pWextState->completion_var); + reinit_completion(&pWextState->completion_var); if ((WLAN_HDD_GET_CTX(pAdapter))->isLogpInProgress) { @@ -7427,7 +7427,7 @@ int hdd_setBand(struct net_device *dev, u8 ui_band) __func__, csrGetCurrentBand(hHal), band); pHddStaCtx->conn_info.connState = eConnectionState_NotConnected; - INIT_COMPLETION(pAdapter->disconnect_comp_var); + reinit_completion(&pAdapter->disconnect_comp_var); status = sme_RoamDisconnect( WLAN_HDD_GET_HAL_CTX(pAdapter), pAdapter->sessionId, eCSR_DISCONNECT_REASON_UNSPECIFIED); diff --git a/drivers/net/wireless/prima/CORE/HDD/src/wlan_hdd_wmm.c b/drivers/net/wireless/prima/CORE/HDD/src/wlan_hdd_wmm.c index 122ded5be290..5e1899d63982 100644 --- a/drivers/net/wireless/prima/CORE/HDD/src/wlan_hdd_wmm.c +++ b/drivers/net/wireless/prima/CORE/HDD/src/wlan_hdd_wmm.c @@ -1857,7 +1857,9 @@ v_VOID_t hdd_wmm_classify_pkt ( hdd_adapter_t* pAdapter, @return : Qdisc queue index ===========================================================================*/ -v_U16_t hdd_hostapd_select_queue(struct net_device * dev, struct sk_buff *skb) + +v_U16_t hdd_hostapd_select_queue(struct net_device * dev, struct sk_buff *skb, + void *accel_priv, select_queue_fallback_t fallback) { WLANTL_ACEnumType ac; sme_QosWmmUpType up = SME_QOS_WMM_UP_BE; @@ -1920,7 +1922,7 @@ done: @return : Qdisc queue index ===========================================================================*/ -v_U16_t hdd_wmm_select_queue(struct net_device * dev, struct sk_buff *skb) +v_U16_t hdd_wmm_select_queue(struct net_device * dev, struct sk_buff *skb, void *accel_priv, select_queue_fallback_t fallback) { WLANTL_ACEnumType ac; sme_QosWmmUpType up = SME_QOS_WMM_UP_BE; diff --git a/drivers/net/wireless/prima/CORE/MAC/src/cfg/cfgProcMsg.c b/drivers/net/wireless/prima/CORE/MAC/src/cfg/cfgProcMsg.c index 13decafd7191..0cbca04b44b3 100644 --- a/drivers/net/wireless/prima/CORE/MAC/src/cfg/cfgProcMsg.c +++ b/drivers/net/wireless/prima/CORE/MAC/src/cfg/cfgProcMsg.c @@ -745,6 +745,8 @@ processCfgDownloadReq(tpAniSirGlobal pMac, tANI_U16 length, tANI_U8 pStr[CFG_MAX_STR_LEN]; tpCfgBinHdr pHdr; tANI_U32 logLevel; + u8 * orig = (u8 *)pConfig; + u32 origlen = length; // First Dword must contain the AP or STA magic dword PELOGW(cfgLog(pMac, LOGW, FL("CFG size %d bytes MAGIC dword is 0x%x"), @@ -770,7 +772,7 @@ processCfgDownloadReq(tpAniSirGlobal pMac, tANI_U16 length, pHdr = (tpCfgBinHdr) pConfig; pConfig += (sizeof(tCfgBinHdr) >> 2); - PELOGW(cfgLog(pMac, LOGW, FL("CFG hdr totParams %d intParams %d strBufSize %d/%d"), + PELOGE(cfgLog(pMac, LOGE, FL("CFG hdr totParams %d intParams %d strBufSize %d/%d"), pHdr->controlSize,pHdr->iBufSize, pHdr->sBufSize, pMac->cfg.gCfgMaxSBufSize);) @@ -781,6 +783,9 @@ processCfgDownloadReq(tpAniSirGlobal pMac, tANI_U16 length, { PELOGE(cfgLog(pMac, LOGE, FL("<CFG> DNLD_RSP invalid length %d (exp %d)"), length, expLen);) + + print_hex_dump(KERN_ERR, "cfg data:", DUMP_PREFIX_OFFSET, 16, 1, orig, origlen, true); + retVal = WNI_CFG_INVALID_LEN; goto end; } diff --git a/drivers/net/wireless/prima/CORE/MAC/src/include/dot11f.h b/drivers/net/wireless/prima/CORE/MAC/src/include/dot11f.h index 5501ab24429d..de8372388a2d 100644 --- a/drivers/net/wireless/prima/CORE/MAC/src/include/dot11f.h +++ b/drivers/net/wireless/prima/CORE/MAC/src/include/dot11f.h @@ -96,7 +96,7 @@ typedef struct sDot11fFfAID { #define DOT11F_FF_AID_LEN ( 2 ) -void dot11fUnpackFfAID(tpAniSirGlobal, tANI_U8*, tDot11fFfAID*); +void dot11fUnpackFfAID(tpAniSirGlobal, const tANI_U8*, tDot11fFfAID*); void dot11fPackFfAID(tpAniSirGlobal, tDot11fFfAID*, tANI_U8*); @@ -5806,7 +5806,7 @@ typedef struct sDot11fIEWPA { #ifdef __cplusplus extern "C" { #endif /* C++ */ -tANI_U32 dot11fUnpackIeWPA(tpAniSirGlobal, tANI_U8*,tANI_U8, tDot11fIEWPA*); +tANI_U32 dot11fUnpackIeWPA(tpAniSirGlobal, const tANI_U8*,tANI_U8, tDot11fIEWPA*); tANI_U32 dot11fPackIeWPA(tpAniSirGlobal, tDot11fIEWPA*, tANI_U8*, tANI_U32, tANI_U32*); diff --git a/drivers/net/wireless/prima/CORE/SAP/inc/sapApi.h b/drivers/net/wireless/prima/CORE/SAP/inc/sapApi.h index 743dc0900ec9..5e111de07bd3 100644 --- a/drivers/net/wireless/prima/CORE/SAP/inc/sapApi.h +++ b/drivers/net/wireless/prima/CORE/SAP/inc/sapApi.h @@ -1008,7 +1008,7 @@ WLANSAP_StopBss VOS_STATUS WLANSAP_DisassocSta ( - v_PVOID_t pvosGCtx, v_U8_t *pPeerStaMac + v_PVOID_t pvosGCtx, const v_U8_t *pPeerStaMac ); /*========================================================================== @@ -1036,7 +1036,7 @@ WLANSAP_DisassocSta VOS_STATUS WLANSAP_DeauthSta ( - v_PVOID_t pvosGCtx, v_U8_t *pPeerStaMac + v_PVOID_t pvosGCtx, const v_U8_t *pPeerStaMac ); /*========================================================================== diff --git a/drivers/net/wireless/prima/CORE/SAP/src/sapModule.c b/drivers/net/wireless/prima/CORE/SAP/src/sapModule.c index 9dbd1bcd099f..8ef315523f59 100644 --- a/drivers/net/wireless/prima/CORE/SAP/src/sapModule.c +++ b/drivers/net/wireless/prima/CORE/SAP/src/sapModule.c @@ -1242,7 +1242,7 @@ VOS_STATUS WLANSAP_DisassocSta ( v_PVOID_t pvosGCtx, - v_U8_t *pPeerStaMac + const v_U8_t *pPeerStaMac ) { ptSapContext pSapCtx = VOS_GET_SAP_CB(pvosGCtx); @@ -1290,7 +1290,7 @@ VOS_STATUS WLANSAP_DeauthSta ( v_PVOID_t pvosGCtx, - v_U8_t *pPeerStaMac + const v_U8_t *pPeerStaMac ) { eHalStatus halStatus = eHAL_STATUS_FAILURE; diff --git a/drivers/net/wireless/prima/CORE/SME/inc/sme_Api.h b/drivers/net/wireless/prima/CORE/SME/inc/sme_Api.h index 796161d7ae08..5f6387d572ab 100644 --- a/drivers/net/wireless/prima/CORE/SME/inc/sme_Api.h +++ b/drivers/net/wireless/prima/CORE/SME/inc/sme_Api.h @@ -623,7 +623,7 @@ eHalStatus sme_RoamGetAssociatedStas(tHalHandle hHal, tANI_U8 sessionId, \param pPeerMacAddr - Caller allocated memory filled with peer MAC address (6 bytes) \return eHalStatus SUCCESS Roam callback will be called to indicate actual results -------------------------------------------------------------------------------*/ -eHalStatus sme_RoamDisconnectSta(tHalHandle hHal, tANI_U8 sessionId, tANI_U8 *pPeerMacAddr); +eHalStatus sme_RoamDisconnectSta(tHalHandle hHal, tANI_U8 sessionId, const tANI_U8 *pPeerMacAddr); /* --------------------------------------------------------------------------- \fn sme_RoamDeauthSta @@ -634,7 +634,7 @@ eHalStatus sme_RoamDisconnectSta(tHalHandle hHal, tANI_U8 sessionId, tANI_U8 *pP \return eHalStatus SUCCESS Roam callback will be called to indicate actual results -------------------------------------------------------------------------------*/ eHalStatus sme_RoamDeauthSta(tHalHandle hHal, tANI_U8 sessionId, - tANI_U8 *pPeerMacAddr); + const tANI_U8 *pPeerMacAddr); /* --------------------------------------------------------------------------- \fn sme_RoamTKIPCounterMeasures @@ -3170,7 +3170,7 @@ eHalStatus smeIssueFastRoamNeighborAPEvent (tHalHandle hHal, void smeGetCommandQStatus( tHalHandle hHal ); -eHalStatus sme_RoamDelPMKIDfromCache( tHalHandle hHal, tANI_U8 sessionId, tANI_U8 *pBSSId ); +eHalStatus sme_RoamDelPMKIDfromCache( tHalHandle hHal, tANI_U8 sessionId, const tANI_U8 *pBSSId ); #ifdef FEATURE_WLAN_BATCH_SCAN /* --------------------------------------------------------------------------- \fn sme_SetBatchScanReq @@ -3225,7 +3225,7 @@ sme_StopBatchScanInd #endif -eHalStatus sme_RoamDelPMKIDfromCache( tHalHandle hHal, tANI_U8 sessionId, tANI_U8 *pBSSId ); +eHalStatus sme_RoamDelPMKIDfromCache( tHalHandle hHal, tANI_U8 sessionId, const tANI_U8 *pBSSId ); #ifdef FEATURE_WLAN_CH_AVOID /* --------------------------------------------------------------------------- diff --git a/drivers/net/wireless/prima/CORE/SME/src/csr/csrApiRoam.c b/drivers/net/wireless/prima/CORE/SME/src/csr/csrApiRoam.c index 6223358ca4c3..33435057eaef 100644 --- a/drivers/net/wireless/prima/CORE/SME/src/csr/csrApiRoam.c +++ b/drivers/net/wireless/prima/CORE/SME/src/csr/csrApiRoam.c @@ -79,6 +79,7 @@ #include "pmc.h" #include "vos_nvitem.h" #include "macTrace.h" +#include "sme_Api.h" #ifdef WLAN_FEATURE_NEIGHBOR_ROAMING #include "csrNeighborRoam.h" #endif /* WLAN_FEATURE_NEIGHBOR_ROAMING */ @@ -2645,7 +2646,7 @@ eHalStatus csrRoamIssueDisassociate( tpAniSirGlobal pMac, tANI_U32 sessionId, ---------------------------------------------------------------------------*/ eHalStatus csrRoamIssueDisassociateStaCmd( tpAniSirGlobal pMac, tANI_U32 sessionId, - tANI_U8 *pPeerMacAddr, + const tANI_U8 *pPeerMacAddr, tANI_U32 reason) { eHalStatus status = eHAL_STATUS_SUCCESS; @@ -2687,7 +2688,7 @@ eHalStatus csrRoamIssueDisassociateStaCmd( tpAniSirGlobal pMac, ---------------------------------------------------------------------------*/ eHalStatus csrRoamIssueDeauthStaCmd( tpAniSirGlobal pMac, tANI_U32 sessionId, - tANI_U8 *pPeerMacAddr, + const tANI_U8 *pPeerMacAddr, tANI_U32 reason) { eHalStatus status = eHAL_STATUS_SUCCESS; @@ -11917,7 +11918,7 @@ eHalStatus csrRoamSetPMKIDCache( tpAniSirGlobal pMac, tANI_U32 sessionId, } eHalStatus csrRoamDelPMKIDfromCache( tpAniSirGlobal pMac, tANI_U32 sessionId, - tANI_U8 *pBSSId ) + const tANI_U8 *pBSSId ) { eHalStatus status = eHAL_STATUS_FAILURE; tCsrRoamSession *pSession = CSR_GET_SESSION( pMac, sessionId ); diff --git a/drivers/net/wireless/prima/CORE/SME/src/csr/csrInsideApi.h b/drivers/net/wireless/prima/CORE/SME/src/csr/csrInsideApi.h index 08cbfa91c6dc..d3e70947392c 100644 --- a/drivers/net/wireless/prima/CORE/SME/src/csr/csrInsideApi.h +++ b/drivers/net/wireless/prima/CORE/SME/src/csr/csrInsideApi.h @@ -894,7 +894,7 @@ void csrCallRoamingCompletionCallback(tpAniSirGlobal pMac, tCsrRoamSession *pSes ---------------------------------------------------------------------------*/ eHalStatus csrRoamIssueDisassociateStaCmd( tpAniSirGlobal pMac, tANI_U32 sessionId, - tANI_U8 *pPeerMacAddr, + const tANI_U8 *pPeerMacAddr, tANI_U32 reason); /* --------------------------------------------------------------------------- @@ -907,7 +907,7 @@ eHalStatus csrRoamIssueDisassociateStaCmd( tpAniSirGlobal pMac, ---------------------------------------------------------------------------*/ eHalStatus csrRoamIssueDeauthStaCmd( tpAniSirGlobal pMac, tANI_U32 sessionId, - tANI_U8 *pPeerMacAddr, + const tANI_U8 *pPeerMacAddr, tANI_U32 reason); /* --------------------------------------------------------------------------- @@ -1002,6 +1002,6 @@ eHalStatus csrScanCreateEntryInScanCache(tpAniSirGlobal pMac, tANI_U32 sessionId eHalStatus csrUpdateChannelList(tpAniSirGlobal pMac); eHalStatus csrRoamDelPMKIDfromCache( tpAniSirGlobal pMac, tANI_U32 sessionId, - tANI_U8 *pBSSId ); + const tANI_U8 *pBSSId ); #endif diff --git a/drivers/net/wireless/prima/CORE/SME/src/sme_common/sme_Api.c b/drivers/net/wireless/prima/CORE/SME/src/sme_common/sme_Api.c index 0f4e9e2e271a..b8ecfbe9756f 100644 --- a/drivers/net/wireless/prima/CORE/SME/src/sme_common/sme_Api.c +++ b/drivers/net/wireless/prima/CORE/SME/src/sme_common/sme_Api.c @@ -1861,7 +1861,7 @@ eHalStatus sme_ProcessMsg(tHalHandle hHal, vos_msg_t* pMsg) status = sme_AcquireGlobalLock( &pMac->sme ); if ( HAL_STATUS_SUCCESS( status ) ) { - if( SME_IS_START(pMac) ) + if (SME_IS_START(pMac) ) { switch (pMsg->type) { // TODO: Will be modified to do a range check for msgs instead of having cases for each msgs case eWNI_PMC_ENTER_BMPS_RSP: @@ -3064,7 +3064,7 @@ eHalStatus sme_RoamStopBss(tHalHandle hHal, tANI_U8 sessionId) \return eHalStatus SUCCESS Roam callback will be called to indicate actual results -------------------------------------------------------------------------------*/ eHalStatus sme_RoamDisconnectSta(tHalHandle hHal, tANI_U8 sessionId, - tANI_U8 *pPeerMacAddr) + const tANI_U8 *pPeerMacAddr) { eHalStatus status = eHAL_STATUS_FAILURE; tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); @@ -3102,7 +3102,7 @@ eHalStatus sme_RoamDisconnectSta(tHalHandle hHal, tANI_U8 sessionId, \return eHalStatus SUCCESS Roam callback will be called to indicate actual results -------------------------------------------------------------------------------*/ eHalStatus sme_RoamDeauthSta(tHalHandle hHal, tANI_U8 sessionId, - tANI_U8 *pPeerMacAddr) + const tANI_U8 *pPeerMacAddr) { eHalStatus status = eHAL_STATUS_FAILURE; tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); @@ -3381,7 +3381,7 @@ eHalStatus sme_RoamSetPMKIDCache( tHalHandle hHal, tANI_U8 sessionId, tPmkidCach return (status); } -eHalStatus sme_RoamDelPMKIDfromCache( tHalHandle hHal, tANI_U8 sessionId, tANI_U8 *pBSSId ) +eHalStatus sme_RoamDelPMKIDfromCache( tHalHandle hHal, tANI_U8 sessionId, const tANI_U8 *pBSSId ) { eHalStatus status = eHAL_STATUS_FAILURE; tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); diff --git a/drivers/net/wireless/prima/CORE/SVC/src/logging/wlan_logging_sock_svc.c b/drivers/net/wireless/prima/CORE/SVC/src/logging/wlan_logging_sock_svc.c index 30f01e95b2fa..2579bb68618d 100644 --- a/drivers/net/wireless/prima/CORE/SVC/src/logging/wlan_logging_sock_svc.c +++ b/drivers/net/wireless/prima/CORE/SVC/src/logging/wlan_logging_sock_svc.c @@ -565,7 +565,7 @@ int wlan_logging_sock_deactivate_svc(void) gapp_pid = INVALID_PID; gwlan_logging.exit = true; - INIT_COMPLETION(gwlan_logging.shutdown_comp); + reinit_completion(&gwlan_logging.shutdown_comp); wake_up_interruptible(&gwlan_logging.wait_queue); wait_for_completion_interruptible(&gwlan_logging.shutdown_comp); diff --git a/drivers/net/wireless/prima/CORE/SYS/legacy/src/pal/inc/palApi.h b/drivers/net/wireless/prima/CORE/SYS/legacy/src/pal/inc/palApi.h index 051abb78e428..c712fafede2e 100644 --- a/drivers/net/wireless/prima/CORE/SYS/legacy/src/pal/inc/palApi.h +++ b/drivers/net/wireless/prima/CORE/SYS/legacy/src/pal/inc/palApi.h @@ -328,7 +328,7 @@ eHalStatus palZeroMemory( tHddHandle hHdd, void *pMemory, tANI_U32 numBytes ) locations are equal or now equal. -------------------------------------------------------------------------------*/ -tANI_BOOLEAN palEqualMemory( tHddHandle hHdd, void *pMemory1, void *pMemory2, tANI_U32 numBytes ); +tANI_BOOLEAN palEqualMemory( tHddHandle hHdd, const void *pMemory1, const void *pMemory2, tANI_U32 numBytes ); #endif /** --------------------------------------------------------------------------- diff --git a/drivers/net/wireless/prima/CORE/SYS/legacy/src/pal/src/palApiComm.c b/drivers/net/wireless/prima/CORE/SYS/legacy/src/pal/src/palApiComm.c index d30b55a01b0d..21c0582f9d64 100644 --- a/drivers/net/wireless/prima/CORE/SYS/legacy/src/pal/src/palApiComm.c +++ b/drivers/net/wireless/prima/CORE/SYS/legacy/src/pal/src/palApiComm.c @@ -103,7 +103,7 @@ eHalStatus palCopyMemory( tHddHandle hHdd, void *pDst, const void *pSrc, tANI_U3 -tANI_BOOLEAN palEqualMemory( tHddHandle hHdd, void *pMemory1, void *pMemory2, tANI_U32 numBytes ) +tANI_BOOLEAN palEqualMemory( tHddHandle hHdd, const void *pMemory1, const void *pMemory2, tANI_U32 numBytes ) { return( vos_mem_compare( pMemory1, pMemory2, numBytes ) ); } diff --git a/drivers/net/wireless/prima/CORE/SYS/legacy/src/utils/src/dot11f.c b/drivers/net/wireless/prima/CORE/SYS/legacy/src/utils/src/dot11f.c index d94c1103aa63..4d634a74626d 100644 --- a/drivers/net/wireless/prima/CORE/SYS/legacy/src/utils/src/dot11f.c +++ b/drivers/net/wireless/prima/CORE/SYS/legacy/src/utils/src/dot11f.c @@ -286,7 +286,7 @@ static void framesDump(tpAniSirGlobal pCtx, int nSev, tANI_U8 *pBuf, int nBuf) static void framesntohs(tpAniSirGlobal pCtx, tANI_U16 *pOut, - tANI_U8 *pIn, + const tANI_U8 *pIn, tFRAMES_BOOL fMsb) { (void)pCtx; @@ -5279,7 +5279,7 @@ tANI_U32 dot11fUnpackIeWMMParams(tpAniSirGlobal pCtx, tANI_U8 *pBuf, tANI_U8 iel #define SigIeWMMParams ( 0x0081 ) -tANI_U32 dot11fUnpackIeWPA(tpAniSirGlobal pCtx, tANI_U8 *pBuf, tANI_U8 ielen, tDot11fIEWPA *pDst) +tANI_U32 dot11fUnpackIeWPA(tpAniSirGlobal pCtx, const tANI_U8 *pBuf, tANI_U8 ielen, tDot11fIEWPA *pDst) { tANI_U32 status = DOT11F_PARSE_SUCCESS; (void) pBuf; (void)ielen; /* Shutup the compiler */ diff --git a/drivers/net/wireless/prima/CORE/TL/src/wlan_qct_tl.c b/drivers/net/wireless/prima/CORE/TL/src/wlan_qct_tl.c index 7d6f25cbd759..f556337b2142 100644 --- a/drivers/net/wireless/prima/CORE/TL/src/wlan_qct_tl.c +++ b/drivers/net/wireless/prima/CORE/TL/src/wlan_qct_tl.c @@ -490,7 +490,7 @@ WLANTL_Open } /* Set the default log level to VOS_TRACE_LEVEL_ERROR */ - vos_trace_setLevel(VOS_MODULE_ID_TL, VOS_TRACE_LEVEL_ERROR); + vos_trace_setLevel(VOS_MODULE_ID_TL, VOS_TRACE_LEVEL_ALL); smeContext = vos_get_context(VOS_MODULE_ID_SME, pvosGCtx); if ( NULL == smeContext ) diff --git a/drivers/net/wireless/prima/CORE/VOSS/inc/vos_memory.h b/drivers/net/wireless/prima/CORE/VOSS/inc/vos_memory.h index 1776c56eb877..a6caad456d6d 100644 --- a/drivers/net/wireless/prima/CORE/VOSS/inc/vos_memory.h +++ b/drivers/net/wireless/prima/CORE/VOSS/inc/vos_memory.h @@ -227,7 +227,7 @@ v_VOID_t vos_mem_move( v_VOID_t *pDst, const v_VOID_t *pSrc, v_SIZE_t numBytes ) locations are equal or not equal. -------------------------------------------------------------------------------*/ -v_BOOL_t vos_mem_compare( v_VOID_t *pMemory1, v_VOID_t *pMemory2, v_U32_t numBytes ); +v_BOOL_t vos_mem_compare( const v_VOID_t *pMemory1, const v_VOID_t *pMemory2, v_U32_t numBytes ); /** --------------------------------------------------------------------------- @@ -252,7 +252,7 @@ v_BOOL_t vos_mem_compare( v_VOID_t *pMemory1, v_VOID_t *pMemory2, v_U32_t numByt > 0 -- *pMemory1 is bigger than *pMemory2 -------------------------------------------------------------------------------*/ -v_SINT_t vos_mem_compare2( v_VOID_t *pMemory1, v_VOID_t *pMemory2, v_U32_t numBytes ); +v_SINT_t vos_mem_compare2(const v_VOID_t *pMemory1, const v_VOID_t *pMemory2, v_U32_t numBytes ); /*---------------------------------------------------------------------------- diff --git a/drivers/net/wireless/prima/CORE/VOSS/src/vos_event.c b/drivers/net/wireless/prima/CORE/VOSS/src/vos_event.c index 256142913d3c..9ede2558a6e8 100644 --- a/drivers/net/wireless/prima/CORE/VOSS/src/vos_event.c +++ b/drivers/net/wireless/prima/CORE/VOSS/src/vos_event.c @@ -256,7 +256,7 @@ VOS_STATUS vos_event_reset ( vos_event_t* event ) } // (re)initialize event - INIT_COMPLETION(event->complete); + reinit_completion(&event->complete); return VOS_STATUS_SUCCESS; } diff --git a/drivers/net/wireless/prima/CORE/VOSS/src/vos_memory.c b/drivers/net/wireless/prima/CORE/VOSS/src/vos_memory.c index 608a8ed330bd..ed53d82e3343 100644 --- a/drivers/net/wireless/prima/CORE/VOSS/src/vos_memory.c +++ b/drivers/net/wireless/prima/CORE/VOSS/src/vos_memory.c @@ -434,7 +434,7 @@ v_VOID_t vos_mem_move( v_VOID_t *pDst, const v_VOID_t *pSrc, v_SIZE_t numBytes ) memmove(pDst, pSrc, numBytes); } -v_BOOL_t vos_mem_compare( v_VOID_t *pMemory1, v_VOID_t *pMemory2, v_U32_t numBytes ) +v_BOOL_t vos_mem_compare( const v_VOID_t *pMemory1, const v_VOID_t *pMemory2, v_U32_t numBytes ) { if (0 == numBytes) { @@ -454,7 +454,7 @@ v_BOOL_t vos_mem_compare( v_VOID_t *pMemory1, v_VOID_t *pMemory2, v_U32_t numByt } -v_SINT_t vos_mem_compare2( v_VOID_t *pMemory1, v_VOID_t *pMemory2, v_U32_t numBytes ) +v_SINT_t vos_mem_compare2( const v_VOID_t *pMemory1, const v_VOID_t *pMemory2, v_U32_t numBytes ) { return( (v_SINT_t) memcmp( pMemory1, pMemory2, numBytes ) ); diff --git a/drivers/net/wireless/prima/CORE/VOSS/src/vos_nvitem.c b/drivers/net/wireless/prima/CORE/VOSS/src/vos_nvitem.c index 92cf384f97e6..a079b78e6b2c 100644 --- a/drivers/net/wireless/prima/CORE/VOSS/src/vos_nvitem.c +++ b/drivers/net/wireless/prima/CORE/VOSS/src/vos_nvitem.c @@ -2450,6 +2450,10 @@ VOS_STATUS vos_nv_readDefaultCountryTable( uNvTables *tableData ) VOS_STATUS status = VOS_STATUS_SUCCESS; memcpy(&tableData->defaultCountryTable, &pnvEFSTable->halnv.tables.defaultCountryTable, sizeof(sDefaultCountry)); + +//tableData->defaultCountryTable.countryCode[0] = 'T'; +//tableData->defaultCountryTable.countryCode[1] = 'W'; + pr_info("DefaultCountry is %c%c\n", tableData->defaultCountryTable.countryCode[0], tableData->defaultCountryTable.countryCode[1]); @@ -2730,7 +2734,7 @@ static int create_crda_regulatory_entry(struct wiphy *wiphy, continue; if (wiphy->bands[i] == NULL) { - pr_info("error: wiphy->bands[i] is NULL, i = %d\n", i); + pr_info("%s: error: wiphy->bands[i] is NULL, i = %d\n", __func__, i); return -1; } // internal channels[] is one continous array for both 2G and 5G bands @@ -3298,7 +3302,7 @@ VOS_STATUS vos_nv_getRegDomainFromCountryCode( v_REGDOMAIN_t *pRegDomain, if (COUNTRY_NV == source) { - INIT_COMPLETION(pHddCtx->linux_reg_req); + reinit_completion(&pHddCtx->linux_reg_req); regulatory_hint(wiphy, country_code); wait_result = wait_for_completion_interruptible_timeout( &pHddCtx->linux_reg_req, @@ -3338,11 +3342,9 @@ VOS_STATUS vos_nv_getRegDomainFromCountryCode( v_REGDOMAIN_t *pRegDomain, } else if (COUNTRY_IE == source || COUNTRY_USER == source) { -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,9,0)) - regulatory_hint_user(country_code,NL80211_USER_REG_HINT_USER); -#else - regulatory_hint_user(country_code); -#endif +//!!! +// regulatory_hint_user(country_code,NL80211_USER_REG_HINT_USER); + *pRegDomain = temp_reg_domain; } @@ -3405,7 +3407,7 @@ static int create_linux_regulatory_entry(struct wiphy *wiphy, { VOS_TRACE(VOS_MODULE_ID_VOSS, VOS_TRACE_LEVEL_ERROR, - "error: wiphy->bands is NULL, i = %d", i); + "%s: error: wiphy->bands is NULL, i = %d", __func__, i); return -1; } @@ -3452,7 +3454,7 @@ static int create_linux_regulatory_entry(struct wiphy *wiphy, VOS_TRACE(VOS_MODULE_ID_VOSS, VOS_TRACE_LEVEL_INFO, "%s: Remove passive scan restriction for %u", __func__, wiphy->bands[i]->channels[j].center_freq); - wiphy->bands[i]->channels[j].flags &= ~IEEE80211_CHAN_PASSIVE_SCAN; + wiphy->bands[i]->channels[j].flags &= ~IEEE80211_CHAN_NO_IR; } } @@ -3471,7 +3473,7 @@ static int create_linux_regulatory_entry(struct wiphy *wiphy, } /* nv cannot distinguish between DFS and passive channels */ else if (wiphy->bands[i]->channels[j].flags & - (IEEE80211_CHAN_RADAR | IEEE80211_CHAN_PASSIVE_SCAN)) + (IEEE80211_CHAN_RADAR | IEEE80211_CHAN_NO_IR)) { pnvEFSTable->halnv.tables.regDomains[temp_reg_domain].channels[k].enabled = NV_CHANNEL_DFS; @@ -3744,7 +3746,7 @@ int wlan_hdd_linux_reg_notifier(struct wiphy *wiphy, ((request->alpha2[0]== 'U'&& request->alpha2[1]=='S') && pHddCtx->nEnableStrictRegulatoryForFCC)) { - wiphy->bands[IEEE80211_BAND_5GHZ]->channels[j].flags |= IEEE80211_CHAN_PASSIVE_SCAN; + wiphy->bands[IEEE80211_BAND_5GHZ]->channels[j].flags |= IEEE80211_CHAN_NO_IR; } } } @@ -3791,7 +3793,7 @@ VOS_STATUS vos_init_wiphy_from_nv_bin(void) /* default country is world roaming */ reg_domain = REGDOMAIN_WORLD; - wiphy->flags |= WIPHY_FLAG_CUSTOM_REGULATORY; + wiphy->regulatory_flags |= REGULATORY_CUSTOM_REG; } else if (REGDOMAIN_WORLD == pnvEFSTable->halnv.tables.defaultCountryTable.regDomain) { @@ -3801,7 +3803,7 @@ VOS_STATUS vos_init_wiphy_from_nv_bin(void) else { reg_domain = pnvEFSTable->halnv.tables.defaultCountryTable.regDomain; - wiphy->flags |= WIPHY_FLAG_STRICT_REGULATORY; + wiphy->regulatory_flags |= REGULATORY_STRICT_REG; } temp_reg_domain = cur_reg_domain = reg_domain; @@ -3812,7 +3814,7 @@ VOS_STATUS vos_init_wiphy_from_nv_bin(void) if (wiphy->bands[i] == NULL) { - pr_info("error: wiphy->bands[i] is NULL, i = %d\n", i); + pr_info("%s: error: wiphy->bands[i] is NULL, i = %d\n", __func__, i); continue; } @@ -3831,7 +3833,7 @@ VOS_STATUS vos_init_wiphy_from_nv_bin(void) else if (pnvEFSTable->halnv.tables.regDomains[reg_domain].channels[k].enabled == NV_CHANNEL_DFS) { - wiphy->bands[i]->channels[j].flags |= IEEE80211_CHAN_PASSIVE_SCAN; + wiphy->bands[i]->channels[j].flags |= IEEE80211_CHAN_NO_IR; wiphy->bands[i]->channels[j].max_power = (pnvEFSTable->halnv.tables.regDomains[reg_domain].channels[k].pwrLimit)*100; @@ -3985,7 +3987,7 @@ VOS_STATUS vos_nv_getRegDomainFromCountryCode( v_REGDOMAIN_t *pRegDomain, wiphy = pHddCtx->wiphy; - INIT_COMPLETION(pHddCtx->driver_crda_req); + reinit_completion(&pHddCtx->driver_crda_req); regulatory_hint(wiphy, countryCode); status = wait_for_completion_interruptible_timeout( &pHddCtx->driver_crda_req, @@ -4198,7 +4200,7 @@ int wlan_hdd_crda_reg_notifier(struct wiphy *wiphy, if (NULL == wiphy->bands[i]) { VOS_TRACE(VOS_MODULE_ID_VOSS, VOS_TRACE_LEVEL_ERROR, - "error: wiphy->bands[i] is NULL, i = %d", i); + "%s: error: wiphy->bands[i] is NULL, i = %d", __func__, i); continue; } @@ -4249,13 +4251,12 @@ int wlan_hdd_crda_reg_notifier(struct wiphy *wiphy, { wiphy->bands[i]->channels[j].flags &= ~(IEEE80211_CHAN_DISABLED |IEEE80211_CHAN_RADAR); - wiphy->bands[i]->channels[j].flags |= IEEE80211_CHAN_PASSIVE_SCAN; + wiphy->bands[i]->channels[j].flags |= IEEE80211_CHAN_NO_IR; } else { wiphy->bands[i]->channels[j].flags &= ~(IEEE80211_CHAN_DISABLED - |IEEE80211_CHAN_PASSIVE_SCAN - |IEEE80211_CHAN_NO_IBSS + |IEEE80211_CHAN_NO_IR |IEEE80211_CHAN_RADAR); } } @@ -4282,7 +4283,7 @@ int wlan_hdd_crda_reg_notifier(struct wiphy *wiphy, wiphy->bands[IEEE80211_BAND_5GHZ]->channels[j].center_freq == 5240) && ((domainIdCurrent == REGDOMAIN_FCC) && pHddCtx->nEnableStrictRegulatoryForFCC)) { - wiphy->bands[IEEE80211_BAND_5GHZ]->channels[j].flags |= IEEE80211_CHAN_PASSIVE_SCAN; + wiphy->bands[IEEE80211_BAND_5GHZ]->channels[j].flags |= IEEE80211_CHAN_NO_IR; } else if ((wiphy->bands[IEEE80211_BAND_5GHZ]->channels[j].center_freq == 5180 || wiphy->bands[IEEE80211_BAND_5GHZ]->channels[j].center_freq == 5200 || @@ -4290,7 +4291,7 @@ int wlan_hdd_crda_reg_notifier(struct wiphy *wiphy, wiphy->bands[IEEE80211_BAND_5GHZ]->channels[j].center_freq == 5240) && ((domainIdCurrent != REGDOMAIN_FCC) || !pHddCtx->nEnableStrictRegulatoryForFCC)) { - wiphy->bands[IEEE80211_BAND_5GHZ]->channels[j].flags &= ~IEEE80211_CHAN_PASSIVE_SCAN; + wiphy->bands[IEEE80211_BAND_5GHZ]->channels[j].flags &= ~IEEE80211_CHAN_NO_IR; } } } diff --git a/drivers/net/wireless/prima/CORE/VOSS/src/vos_power.c b/drivers/net/wireless/prima/CORE/VOSS/src/vos_power.c index 81b78e343b10..41c6945755de 100644 --- a/drivers/net/wireless/prima/CORE/VOSS/src/vos_power.c +++ b/drivers/net/wireless/prima/CORE/VOSS/src/vos_power.c @@ -94,8 +94,8 @@ when who what, where, why #include <vos_power.h> #ifdef MSM_PLATFORM -#include <mach/mpp.h> -#include <mach/vreg.h> +//#include <mach/mpp.h> +//#include <mach/vreg.h> #include <linux/err.h> #include <linux/delay.h> #endif //MSM_PLATFORM diff --git a/drivers/net/wireless/prima/CORE/VOSS/src/vos_sched.c b/drivers/net/wireless/prima/CORE/VOSS/src/vos_sched.c index 0f6e66e11a38..e9c6219a0ca1 100644 --- a/drivers/net/wireless/prima/CORE/VOSS/src/vos_sched.c +++ b/drivers/net/wireless/prima/CORE/VOSS/src/vos_sched.c @@ -623,7 +623,7 @@ VosMCThread /* Mc Thread Suspended */ complete(&pHddCtx->mc_sus_event_var); - INIT_COMPLETION(pSchedContext->ResumeMcEvent); + reinit_completion(&pSchedContext->ResumeMcEvent); spin_unlock(&pSchedContext->McThreadLock); /* Wait foe Resume Indication */ @@ -1010,7 +1010,7 @@ static int VosTXThread ( void * Arg ) /* Tx Thread Suspended */ complete(&pHddCtx->tx_sus_event_var); - INIT_COMPLETION(pSchedContext->ResumeTxEvent); + reinit_completion(&pSchedContext->ResumeTxEvent); spin_unlock(&pSchedContext->TxThreadLock); /* Wait foe Resume Indication */ @@ -1212,7 +1212,7 @@ static int VosRXThread ( void * Arg ) /* Rx Thread Suspended */ complete(&pHddCtx->rx_sus_event_var); - INIT_COMPLETION(pSchedContext->ResumeRxEvent); + reinit_completion(&pSchedContext->ResumeRxEvent); spin_unlock(&pSchedContext->RxThreadLock); /* Wait for Resume Indication */ diff --git a/drivers/net/wireless/prima/CORE/VOSS/src/vos_sched.h b/drivers/net/wireless/prima/CORE/VOSS/src/vos_sched.h index 826a183556af..f2fdd0dc6320 100644 --- a/drivers/net/wireless/prima/CORE/VOSS/src/vos_sched.h +++ b/drivers/net/wireless/prima/CORE/VOSS/src/vos_sched.h @@ -88,7 +88,6 @@ #include "i_vos_types.h" #include "i_vos_packet.h" #include <linux/wait.h> -#include <linux/wakelock.h> #include <vos_power.h> #define TX_POST_EVENT_MASK 0x001 diff --git a/drivers/net/wireless/prima/CORE/VOSS/src/vos_utils.c b/drivers/net/wireless/prima/CORE/VOSS/src/vos_utils.c index 7a35653aa05d..15a5a3ccb12d 100644 --- a/drivers/net/wireless/prima/CORE/VOSS/src/vos_utils.c +++ b/drivers/net/wireless/prima/CORE/VOSS/src/vos_utils.c @@ -311,7 +311,7 @@ int hmac_sha1(v_U8_t *key, v_U8_t ksize, char *plaintext, v_U8_t psize, case -EBUSY: ret = wait_for_completion_interruptible(&tresult.completion); if (!ret && !tresult.err) { - INIT_COMPLETION(tresult.completion); + reinit_completion(&tresult.completion); break; } else { VOS_TRACE(VOS_MODULE_ID_VOSS,VOS_TRACE_LEVEL_ERROR, "wait_for_completion_interruptible failed"); @@ -466,7 +466,7 @@ int hmac_md5(v_U8_t *key, v_U8_t ksize, char *plaintext, v_U8_t psize, case -EBUSY: ret = wait_for_completion_interruptible(&tresult.completion); if (!ret && !tresult.err) { - INIT_COMPLETION(tresult.completion); + reinit_completion(&tresult.completion); break; } else { VOS_TRACE(VOS_MODULE_ID_VOSS,VOS_TRACE_LEVEL_ERROR, "wait_for_completion_interruptible failed"); diff --git a/drivers/net/wireless/prima/CORE/WDA/inc/legacy/palTypes.h b/drivers/net/wireless/prima/CORE/WDA/inc/legacy/palTypes.h index dca900c3cb07..25f6baf46080 100644 --- a/drivers/net/wireless/prima/CORE/WDA/inc/legacy/palTypes.h +++ b/drivers/net/wireless/prima/CORE/WDA/inc/legacy/palTypes.h @@ -113,7 +113,7 @@ #endif -#elif !defined(ANI_OS_TYPE_ANDROID) && !defined(ANI_OS_TYPE_QNX) // NONE +#elif !defined(ANI_OS_TYPE_ANDROID) && !defined(ANI_OS_TYPE_QNX) && !defined(ANI_OS_TYPE_LINUX) // NONE #error "NONE of the ANI_OS_TYPE_xxx are defined for this build" #endif diff --git a/drivers/net/wireless/prima/CORE/WDA/src/wlan_qct_wda.c b/drivers/net/wireless/prima/CORE/WDA/src/wlan_qct_wda.c index 770fbf27e46f..72e30ae1baa4 100644 --- a/drivers/net/wireless/prima/CORE/WDA/src/wlan_qct_wda.c +++ b/drivers/net/wireless/prima/CORE/WDA/src/wlan_qct_wda.c @@ -287,7 +287,7 @@ VOS_STATUS WDA_open(v_PVOID_t pVosContext, v_PVOID_t pOSContext, "VOS wait On Wdi Ind Event init failed - status = %d", status); goto error; } - vos_trace_setLevel(VOS_MODULE_ID_WDA,VOS_TRACE_LEVEL_ERROR); + vos_trace_setLevel(VOS_MODULE_ID_WDA,VOS_TRACE_LEVEL_ALL); wdaContext->driverMode = pMacParams->driverType; if(WDI_STATUS_SUCCESS != WDI_Init(pOSContext, &wdaContext->pWdiContext, &wdiDevCapability, pMacParams->driverType)) @@ -363,7 +363,7 @@ void WDA_wdiStartCallback(WDI_StartRspParamsType *wdiRspParams, if (WDI_STATUS_SUCCESS != wdiRspParams->wdiStatus) { VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_FATAL, - "%s: WDI_Start() failure reported", __func__ ); + "%s: WDI_Start() failure reported wdi status = %d", __func__, wdiRspParams->wdiStatus ); } else { @@ -1783,6 +1783,11 @@ VOS_STATUS WDA_prepareConfigTLV(v_PVOID_t pVosContext, + sizeof(tHalCfg) + tlvStruct->length) ; wdiStartParams->usConfigBufferLen = (tANI_U8 *)tlvStruct - tlvStructStart ; + + tlvStructStart[0xb] = 0x89; + tlvStructStart[0xc] = 0x89; + tlvStructStart[0xd] = 0xff; + #ifdef WLAN_DEBUG { int i; diff --git a/drivers/net/wireless/prima/CORE/WDI/TRP/CTS/src/wlan_qct_wdi_cts.c b/drivers/net/wireless/prima/CORE/WDI/TRP/CTS/src/wlan_qct_wdi_cts.c index c7a7335db99a..24a662700f44 100644 --- a/drivers/net/wireless/prima/CORE/WDI/TRP/CTS/src/wlan_qct_wdi_cts.c +++ b/drivers/net/wireless/prima/CORE/WDI/TRP/CTS/src/wlan_qct_wdi_cts.c @@ -98,24 +98,14 @@ #include "wlan_qct_os_list.h" #include "wlan_qct_wdi.h" #include "wlan_qct_wdi_i.h" -#ifdef CONFIG_ANDROID -#ifdef EXISTS_MSM_SMD -#include <mach/msm_smd.h> -#else -#include <soc/qcom/smd.h> -#endif #include <linux/delay.h> -#else -#include "msm_smd.h" -#endif +#include <soc/qcom/smd.h> /* Global context for CTS handle, it is required to keep this * transport open during SSR shutdown */ static WCTS_HandleType gwctsHandle; /*---------------------------------------------------------------------------- * Preprocessor Definitions and Constants - * -------------------------------------------------------------------------*/ - /* Magic value to validate a WCTS CB (value is little endian ASCII: WCTS */ #define WCTS_CB_MAGIC 0x53544357 diff --git a/drivers/net/wireless/prima/CORE/WDI/WPAL/src/wlan_qct_pal_api.c b/drivers/net/wireless/prima/CORE/WDI/WPAL/src/wlan_qct_pal_api.c index 86af574dbe79..aded86cc36d8 100644 --- a/drivers/net/wireless/prima/CORE/WDI/WPAL/src/wlan_qct_pal_api.c +++ b/drivers/net/wireless/prima/CORE/WDI/WPAL/src/wlan_qct_pal_api.c @@ -65,7 +65,7 @@ #include "vos_api.h" #include "dma-mapping.h" -#include <mach/subsystem_restart.h> +#include <soc/qcom/subsystem_restart.h> #include <linux/wcnss_wlan.h> typedef struct sPalStruct diff --git a/drivers/net/wireless/prima/CORE/WDI/WPAL/src/wlan_qct_pal_device.c b/drivers/net/wireless/prima/CORE/WDI/WPAL/src/wlan_qct_pal_device.c index b5153cbfe31e..8c96b3a5e114 100644 --- a/drivers/net/wireless/prima/CORE/WDI/WPAL/src/wlan_qct_pal_device.c +++ b/drivers/net/wireless/prima/CORE/WDI/WPAL/src/wlan_qct_pal_device.c @@ -77,11 +77,7 @@ #include <linux/irqreturn.h> #include <linux/interrupt.h> #include <linux/io.h> -#ifdef EXISTS_MSM_SMSM -#include <mach/msm_smsm.h> -#else #include <soc/qcom/smsm.h> -#endif #include "wlan_qct_pal_api.h" #include "wlan_qct_pal_device.h" #include "wlan_hdd_main.h" diff --git a/drivers/net/wireless/prima/Kconfig b/drivers/net/wireless/prima/Kconfig index d3f811bbc9c5..5ed8eb11b4d1 100644 --- a/drivers/net/wireless/prima/Kconfig +++ b/drivers/net/wireless/prima/Kconfig @@ -45,7 +45,7 @@ config QCOM_VOWIFI_11R bool "Enable Fast Transition (11r) feature" default n -config CONFIG_ENABLE_LINUX_REG +config ENABLE_LINUX_REG bool "Enable linux regulatory feature" default n diff --git a/drivers/net/wireless/prima/Makefile b/drivers/net/wireless/prima/Makefile index f0f52b133693..a9fa9f03cfb3 100644 --- a/drivers/net/wireless/prima/Makefile +++ b/drivers/net/wireless/prima/Makefile @@ -1,55 +1,10 @@ -# We can build either as part of a standalone Kernel build or part -# of an Android build. Determine which mechanism is being used -ifeq ($(MODNAME),) - KERNEL_BUILD := 1 -else - KERNEL_BUILD := 0 -endif - -ifeq ($(KERNEL_BUILD),1) - # These are provided in Android-based builds - # Need to explicitly define for Kernel-based builds MODNAME := wlan - WLAN_ROOT := drivers/staging/prima -endif - -ifeq ($(KERNEL_BUILD), 0) - # These are configurable via Kconfig for kernel-based builds - # Need to explicitly configure for Android-based builds - - #Flag to enable BlueTooth AMP feature - CONFIG_PRIMA_WLAN_BTAMP := n - - #Flag to enable Legacy Fast Roaming(LFR) - CONFIG_PRIMA_WLAN_LFR := y - - #JB kernel has PMKSA patches, hence enabling this flag - CONFIG_PRIMA_WLAN_OKC := y - - # JB kernel has CPU enablement patches, so enable - CONFIG_PRIMA_WLAN_11AC_HIGH_TP := y - - #Flag to enable TDLS feature - CONFIG_QCOM_TDLS := y - - #Flag to enable Fast Transition (11r) feature - CONFIG_QCOM_VOWIFI_11R := y - - #Flag to enable Protected Managment Frames (11w) feature - ifneq ($(CONFIG_PRONTO_WLAN),) - CONFIG_WLAN_FEATURE_11W := y - endif - - #Flag to enable new Linux Regulatory implementation - CONFIG_ENABLE_LINUX_REG := y - -endif + WLAN_ROOT := drivers/net/wireless/prima # To enable CCX upload, dependent config # CONFIG_QCOM_CCX must be enabled. CONFIG_QCOM_CCX_UPLOAD := n -# Feature flags which are not (currently) configurable via Kconfig #Whether to build debug version BUILD_DEBUG_VERSION := 1 @@ -64,15 +19,7 @@ PANIC_ON_BUG := 1 RE_ENABLE_WIFI_ON_WDI_TIMEOUT := 0 -ifeq ($(CONFIG_CFG80211),y) HAVE_CFG80211 := 1 -else -ifeq ($(CONFIG_CFG80211),m) -HAVE_CFG80211 := 1 -else -HAVE_CFG80211 := 0 -endif -endif ############ BAP ############ BAP_DIR := CORE/BAP @@ -507,12 +454,12 @@ EXTRA_CFLAGS += $(INCS) CDEFINES := -DANI_BUS_TYPE_PLATFORM=1 \ -DANI_LITTLE_BYTE_ENDIAN \ -DANI_LITTLE_BIT_ENDIAN \ + -DANI_OS_TYPE_ANDROID=6\ -DQC_WLAN_CHIPSET_PRIMA \ -DINTEGRATION_READY \ -DDOT11F_LITTLE_ENDIAN_HOST \ -DGEN6_ONWARDS \ -DANI_COMPILER_TYPE_GCC \ - -DANI_OS_TYPE_ANDROID=6 \ -DANI_LOGDUMP \ -DWLAN_PERF \ -DPTT_SOCK_SVC_ENABLE \ @@ -521,8 +468,8 @@ CDEFINES := -DANI_BUS_TYPE_PLATFORM=1 \ -DMSM_PLATFORM \ -DHAL_SELF_STA_PER_BSS=1 \ -DWLAN_FEATURE_VOWIFI_11R \ - -DWLAN_FEATURE_NEIGHBOR_ROAMING \ - -DWLAN_FEATURE_NEIGHBOR_ROAMING_DEBUG \ + -DWLAN_FEATURE_NEIGHBOR_ROAMING \ + -DWLAN_FEATURE_NEIGHBOR_ROAMING_DEBUG \ -DWLAN_FEATURE_VOWIFI_11R_DEBUG \ -DFEATURE_WLAN_WAPI \ -DFEATURE_OEM_DATA_SUPPORT\ @@ -637,13 +584,7 @@ ifeq ($(RE_ENABLE_WIFI_ON_WDI_TIMEOUT),1) CDEFINES += -DWDI_RE_ENABLE_WIFI_ON_WDI_TIMEOUT endif -ifeq ($(KERNEL_BUILD),1) CDEFINES += -DWLAN_OPEN_SOURCE -endif - -ifeq ($(findstring opensource, $(WLAN_ROOT)), opensource) -CDEFINES += -DWLAN_OPEN_SOURCE -endif ifeq ($(CONFIG_ENABLE_LINUX_REG), y) CDEFINES += -DCONFIG_ENABLE_LINUX_REG diff --git a/drivers/net/wireless/wcnss/wcnss_vreg.c b/drivers/net/wireless/wcnss/wcnss_vreg.c index 71e2cf9d2f90..8cc5f0ed66c2 100644 --- a/drivers/net/wireless/wcnss/wcnss_vreg.c +++ b/drivers/net/wireless/wcnss/wcnss_vreg.c @@ -17,15 +17,11 @@ #include <linux/delay.h> #include <linux/regulator/consumer.h> #include <linux/regulator/rpm-smd-regulator.h> -//#include <linux/mfd/pm8xxx/pm8921.h> -//#include <linux/mfd/pm8xxx/gpio.h> #include <linux/wcnss_wlan.h> #include <linux/semaphore.h> #include <linux/list.h> #include <linux/slab.h> #include <linux/clk.h> -//#include <mach/msm_xo.h> -//#include <mach/msm_iomap.h> #define DEBUG @@ -76,7 +72,7 @@ struct vregs_info { const int uA_load; struct regulator *regulator; }; - +#if 0 /* IRIS regulators for Riva hardware */ static struct vregs_info iris_vregs_riva[] = { {"iris_vddxo", VREG_NULL_CONFIG, 1800000, 0, 1800000, 10000, NULL}, @@ -92,7 +88,6 @@ static struct vregs_info riva_vregs[] = { {"riva_vddcx", VREG_NULL_CONFIG, 1050000, 0, 1150000, 0, NULL}, {"riva_vddpx", VREG_NULL_CONFIG, 1800000, 0, 1800000, 0, NULL}, }; - /* IRIS regulators for Pronto hardware */ static struct vregs_info iris_vregs_pronto[] = { {"qcom,iris-vddxo", VREG_NULL_CONFIG, 1800000, 0, @@ -138,7 +133,7 @@ static struct vregs_info pronto_vregs_pronto_v2[] = { {"qcom,pronto-vddpx", VREG_NULL_CONFIG, 1800000, 0, 1800000, 0, NULL}, }; - +#endif struct host_driver { char name[20]; @@ -160,6 +155,7 @@ int xo_auto_detect(u32 reg) return WCNSS_XO_48MHZ; case IRIS_3620: + //pr_err("xo auto detect says wcn3620 / 19MHz\n"); return WCNSS_XO_19MHZ; default: @@ -184,9 +180,11 @@ configure_iris_xo(struct device *dev, struct clk *clk_rf = NULL; bool use_48mhz_xo; + //pr_err("%s\n", __func__); + //WARN_ON(1); + use_48mhz_xo = cfg->use_48mhz_xo; - if (wcnss_hardware_type() == WCNSS_PRONTO_HW) { pmu_offset = PRONTO_PMU_OFFSET; spare_offset = PRONTO_SPARE_OFFSET; @@ -196,17 +194,6 @@ configure_iris_xo(struct device *dev, return PTR_ERR(clk); } - } else { - pmu_offset = RIVA_PMU_OFFSET; - spare_offset = RIVA_SPARE_OFFSET; - - clk = clk_get(dev, "cxo"); - if (IS_ERR(clk)) { - pr_err("Couldn't get cxo clock\n"); - return PTR_ERR(clk); - } - } - if (on) { msm_wcnss_base = cfg->msm_wcnss_base; if (!msm_wcnss_base) { @@ -224,51 +211,51 @@ configure_iris_xo(struct device *dev, /* NV bit is set to indicate that platform driver is capable * of doing NV download. */ - pr_debug("wcnss: Indicate NV bin download\n"); + //pr_err("wcnss: Indicate NV bin download\n"); spare_reg = msm_wcnss_base + spare_offset; - reg = readl_relaxed(spare_reg); + reg = readl(spare_reg); reg |= NVBIN_DLND_BIT; - writel_relaxed(reg, spare_reg); + writel(reg, spare_reg); pmu_conf_reg = msm_wcnss_base + pmu_offset; - writel_relaxed(0, pmu_conf_reg); - reg = readl_relaxed(pmu_conf_reg); - reg |= WCNSS_PMU_CFG_GC_BUS_MUX_SEL_TOP | + writel(0, pmu_conf_reg); + reg = readl(pmu_conf_reg) | WCNSS_PMU_CFG_GC_BUS_MUX_SEL_TOP | WCNSS_PMU_CFG_IRIS_XO_EN; - writel_relaxed(reg, pmu_conf_reg); + writel(reg, pmu_conf_reg); if (wcnss_xo_auto_detect_enabled()) { iris_read_reg = msm_wcnss_base + PRONTO_IRIS_REG_READ_OFFSET; - iris_reg = readl_relaxed(iris_read_reg); + iris_reg = readl(iris_read_reg); + //pr_err("iris_reg = 0x%x\n", iris_reg); } if (iris_reg != WCNSS_INVALID_IRIS_REG) { iris_reg &= 0xffff; iris_reg |= PRONTO_IRIS_REG_CHIP_ID; - writel_relaxed(iris_reg, iris_read_reg); + writel(iris_reg, iris_read_reg); /* Iris read */ - reg = readl_relaxed(pmu_conf_reg); + reg = readl(pmu_conf_reg); reg |= WCNSS_PMU_CFG_IRIS_XO_READ; - writel_relaxed(reg, pmu_conf_reg); + writel(reg, pmu_conf_reg); /* Wait for PMU_CFG.iris_reg_read_sts */ - while (readl_relaxed(pmu_conf_reg) & + while (readl(pmu_conf_reg) & WCNSS_PMU_CFG_IRIS_XO_READ_STS) cpu_relax(); - iris_reg = readl_relaxed(iris_read_reg); - pr_info("wcnss: IRIS Reg: %08x\n", iris_reg); + iris_reg = readl(iris_read_reg); + //pr_err("wcnss: IRIS Reg: %08x\n", iris_reg); if (iris_reg == PRONTO_IRIS_REG_CHIP_ID) { - pr_info("wcnss: IRIS Card not Preset\n"); - auto_detect = WCNSS_XO_INVALID; + //pr_err("wcnss: IRIS Card not Present, 19MHz\n"); + auto_detect = WCNSS_XO_19MHZ; /* Reset iris read bit */ reg &= ~WCNSS_PMU_CFG_IRIS_XO_READ; /* Clear XO_MODE[b2:b1] bits. Clear implies 19.2 MHz TCXO */ - reg &= ~(WCNSS_PMU_CFG_IRIS_XO_MODE); + reg &= ~WCNSS_PMU_CFG_IRIS_XO_MODE; goto xo_configure; } auto_detect = xo_auto_detect(iris_reg); @@ -278,7 +265,7 @@ configure_iris_xo(struct device *dev, } else if (wcnss_xo_auto_detect_enabled()) /* Default to 48 MHZ */ - auto_detect = WCNSS_XO_48MHZ; + auto_detect = WCNSS_XO_19MHZ; else auto_detect = WCNSS_XO_INVALID; @@ -288,40 +275,42 @@ configure_iris_xo(struct device *dev, if ((use_48mhz_xo && auto_detect == WCNSS_XO_INVALID) || auto_detect == WCNSS_XO_48MHZ) { reg |= WCNSS_PMU_CFG_IRIS_XO_MODE_48; + //pr_err("%s: 48MHz\n", __func__); if (iris_xo_set) *iris_xo_set = WCNSS_XO_48MHZ; - } + } //else + // pr_err("%s: 19.2MHz\n", __func__); xo_configure: - writel_relaxed(reg, pmu_conf_reg); + writel(reg, pmu_conf_reg); /* Reset IRIS */ reg |= WCNSS_PMU_CFG_IRIS_RESET; - writel_relaxed(reg, pmu_conf_reg); + writel(reg, pmu_conf_reg); /* Wait for PMU_CFG.iris_reg_reset_sts */ - while (readl_relaxed(pmu_conf_reg) & + while (readl(pmu_conf_reg) & WCNSS_PMU_CFG_IRIS_RESET_STS) cpu_relax(); /* Reset iris reset bit */ reg &= ~WCNSS_PMU_CFG_IRIS_RESET; - writel_relaxed(reg, pmu_conf_reg); + writel(reg, pmu_conf_reg); /* Start IRIS XO configuration */ reg |= WCNSS_PMU_CFG_IRIS_XO_CFG; - writel_relaxed(reg, pmu_conf_reg); + writel(reg, pmu_conf_reg); /* Wait for XO configuration to finish */ - while (readl_relaxed(pmu_conf_reg) & + while (readl(pmu_conf_reg) & WCNSS_PMU_CFG_IRIS_XO_CFG_STS) cpu_relax(); /* Stop IRIS XO configuration */ reg &= ~(WCNSS_PMU_CFG_GC_BUS_MUX_SEL_TOP | WCNSS_PMU_CFG_IRIS_XO_CFG); - writel_relaxed(reg, pmu_conf_reg); + writel(reg, pmu_conf_reg); clk_disable_unprepare(clk); if ((!use_48mhz_xo && auto_detect == WCNSS_XO_INVALID) @@ -340,6 +329,9 @@ xo_configure: } if (iris_xo_set) *iris_xo_set = WCNSS_XO_19MHZ; + + //pr_err("%s: got rf_clk %d\n", __func__,(u32)clk_get_rate(clk_rf)); + } } else if ((!use_48mhz_xo && auto_detect == WCNSS_XO_INVALID) @@ -353,7 +345,9 @@ xo_configure: } /* Add some delay for XO to settle */ - msleep(20); +// msleep(20); + + //pr_err("%s exit OK\n", __func__); fail: clk_put(clk); @@ -363,7 +357,7 @@ fail: return rc; } - +#if 0 /* Helper routine to turn off all WCNSS & IRIS vregs */ static void wcnss_vregs_off(struct vregs_info regulators[], uint size) { @@ -416,6 +410,10 @@ static int wcnss_vregs_on(struct device *dev, int i, rc = 0, reg_cnt; for (i = 0; i < size; i++) { + + + pr_err("%s: reg %s on\n", __func__, regulators[i].name); + /* Get regulator source */ regulators[i].regulator = regulator_get(dev, regulators[i].name); @@ -506,6 +504,7 @@ static int wcnss_iris_vregs_on(struct device *dev, break; case WCNSS_PRONTO_HW: if (is_pronto_vt) { + pr_err("%s: iris vregs pronto v2 on\n", __func__); ret = wcnss_vregs_on(dev, iris_vregs_pronto_v2, ARRAY_SIZE(iris_vregs_pronto_v2)); } else { @@ -567,7 +566,7 @@ static int wcnss_core_vregs_on(struct device *dev, return ret; } - +#endif int wcnss_wlan_power(struct device *dev, struct wcnss_wlan_config *cfg, enum wcnss_opcode on, int *iris_xo_set) @@ -575,19 +574,19 @@ int wcnss_wlan_power(struct device *dev, int rc = 0; enum wcnss_hw_type hw_type = wcnss_hardware_type(); - dev_err(dev, "%s: %d hw type %d\n", __func__, on, hw_type); + //dev_err(dev, "%s: %d hw type %d, pronto_vt=%d\n", __func__, on, hw_type, cfg->is_pronto_vt); down(&wcnss_power_on_lock); if (on) { /* RIVA regulator settings */ - rc = wcnss_core_vregs_on(dev, hw_type, - cfg->is_pronto_vt); +// rc = wcnss_core_vregs_on(dev, hw_type, +// cfg->is_pronto_vt); if (rc) goto fail_wcnss_on; /* IRIS regulator settings */ - rc = wcnss_iris_vregs_on(dev, hw_type, - cfg->is_pronto_vt); +// rc = wcnss_iris_vregs_on(dev, hw_type, +// cfg->is_pronto_vt); if (rc) goto fail_iris_on; @@ -603,18 +602,20 @@ int wcnss_wlan_power(struct device *dev, is_power_on = false; configure_iris_xo(dev, cfg, WCNSS_WLAN_SWITCH_OFF, NULL); - wcnss_iris_vregs_off(hw_type, cfg->is_pronto_vt); - wcnss_core_vregs_off(hw_type, cfg->is_pronto_vt); +// wcnss_iris_vregs_off(hw_type, cfg->is_pronto_vt); +// wcnss_core_vregs_off(hw_type, cfg->is_pronto_vt); } + //pr_err("%s: returned %d\n", __func__, rc); + up(&wcnss_power_on_lock); return rc; fail_iris_xo: - wcnss_iris_vregs_off(hw_type, cfg->is_pronto_vt); +// wcnss_iris_vregs_off(hw_type, cfg->is_pronto_vt); fail_iris_on: - wcnss_core_vregs_off(hw_type, cfg->is_pronto_vt); +// wcnss_core_vregs_off(hw_type, cfg->is_pronto_vt); fail_wcnss_on: up(&wcnss_power_on_lock); diff --git a/drivers/net/wireless/wcnss/wcnss_wlan.c b/drivers/net/wireless/wcnss/wcnss_wlan.c index a3487c2dc49a..788d10385cea 100644 --- a/drivers/net/wireless/wcnss/wcnss_wlan.c +++ b/drivers/net/wireless/wcnss/wcnss_wlan.c @@ -1009,10 +1009,12 @@ void wcnss_log_debug_regs_on_bite(void) void wcnss_reset_intr(void) { if (wcnss_hardware_type() == WCNSS_PRONTO_HW) { + //pr_err("%s\n", __func__); wcnss_pronto_log_debug_regs(); wmb(); __raw_writel(1 << 16, penv->fiq_reg); } else { + BUG(); wcnss_riva_log_debug_regs(); wmb(); __raw_writel(1 << 24, MSM_APCS_GCC_BASE + 0x8); @@ -1467,7 +1469,7 @@ module_param_call(enable_wcnss_suspend_notify, enable_wcnss_suspend_notify_set, int wcnss_xo_auto_detect_enabled(void) { - return (has_autodetect_xo == 1 ? 1 : 0); + return !!has_autodetect_xo; } void wcnss_set_iris_xo_mode(int iris_xo_mode_set) @@ -2092,7 +2094,7 @@ static void wcnss_nvbin_dnld(void) ret = wcnss_smd_tx(outbuffer, dnld_req_msg->hdr.msg_len); retry_count = 0; - while ((ret == -ENOSPC) && (retry_count <= 3)) { + while ((ret == -ENOSPC) && (retry_count <= 8)) { pr_debug("wcnss: %s: smd tx failed, ENOSPC\n", __func__); pr_debug("fragment: %d, len: %d, TotFragments: %d, retry_count: %d\n", @@ -2115,6 +2117,8 @@ static void wcnss_nvbin_dnld(void) } } + //pr_err("%s: fw download sent ok\n", __func__); + err_dnld: /* free buffer */ kfree(outbuffer); @@ -2439,6 +2443,7 @@ wcnss_trigger_config(struct platform_device *pdev) if (wcnss_hardware_type() == WCNSS_PRONTO_HW) { + pr_err("is pronto\n"); res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "pronto_phy_base"); if (!res) { @@ -2450,6 +2455,7 @@ wcnss_trigger_config(struct platform_device *pdev) penv->msm_wcnss_base = (void *) devm_ioremap_resource(&pdev->dev, res); } else { + pr_err("is riva\n"); res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "riva_phy_base"); if (!res) { @@ -2671,25 +2677,6 @@ wcnss_trigger_config(struct platform_device *pdev) } } -#if 0 - penv->adc_tm_dev = qpnp_get_adc_tm(&penv->pdev->dev, "wcnss"); - if (IS_ERR(penv->adc_tm_dev)) { - pr_err("%s: adc get failed\n", __func__); - penv->adc_tm_dev = NULL; - } else { - INIT_DELAYED_WORK(&penv->vbatt_work, wcnss_update_vbatt); - penv->fw_vbatt_state = WCNSS_CONFIG_UNSPECIFIED; - } -#endif - - // int xo_mode; -// ret = wcnss_wlan_power(&pdev->dev, &penv->wlan_config, - // WCNSS_WLAN_SWITCH_ON, &xo_mode); - // wcnss_set_iris_xo_mode(xo_mode); - // if (ret) - // pr_err("Failed to execute wcnss_wlan_power\n"); - - do { /* trigger initialization of the WCNSS */ penv->pil = subsystem_get(WCNSS_PIL_DEVICE); @@ -2854,7 +2841,7 @@ static int wcnss_notif_cb(struct notifier_block *this, unsigned long code, struct notif_data *data = (struct notif_data *)ss_handle; int ret, xo_mode; - pr_debug("%s: wcnss notification event: %lu\n", __func__, code); + // pr_err("%s: wcnss notification event: %lu\n", __func__, code); if (code == SUBSYS_PROXY_VOTE) { if (pdev && pwlanconfig) { diff --git a/drivers/regulator/mem-acc-regulator.c b/drivers/regulator/mem-acc-regulator.c new file mode 100644 index 000000000000..7d614c23e1fc --- /dev/null +++ b/drivers/regulator/mem-acc-regulator.c @@ -0,0 +1,595 @@ +/* Copyright (c) 2014, The Linux Foundation. All rights reserved. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 and + * only version 2 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. + */ +#define pr_fmt(fmt) "ACC: %s: " fmt, __func__ + +#include <linux/module.h> +#include <linux/types.h> +#include <linux/init.h> +#include <linux/slab.h> +#include <linux/err.h> +#include <linux/of.h> +#include <linux/of_device.h> +#include <linux/io.h> +#include <linux/platform_device.h> +#include <linux/regulator/driver.h> +#include <linux/regulator/machine.h> +#include <linux/regulator/of_regulator.h> +#include <soc/qcom/scm.h> + +#define MEM_ACC_SEL_MASK 0x3 + +#define BYTES_PER_FUSE_ROW 8 + +/* mem-acc config flags */ +#define MEM_ACC_SKIP_L1_CONFIG BIT(0) + +enum { + MEMORY_L1, + MEMORY_L2, + MEMORY_MAX, +}; + +struct mem_acc_regulator { + struct device *dev; + struct regulator_desc rdesc; + struct regulator_dev *rdev; + + int corner; + bool mem_acc_supported[MEMORY_MAX]; + + u32 *acc_sel_mask[MEMORY_MAX]; + u32 *acc_sel_bit_pos[MEMORY_MAX]; + u32 num_acc_sel[MEMORY_MAX]; + u32 *acc_en_bit_pos; + u32 num_acc_en; + u32 *corner_acc_map; + u32 num_corners; + + void __iomem *acc_sel_base[MEMORY_MAX]; + void __iomem *acc_en_base; + phys_addr_t acc_sel_addr[MEMORY_MAX]; + phys_addr_t acc_en_addr; + u32 flags; + + /* eFuse parameters */ + phys_addr_t efuse_addr; + void __iomem *efuse_base; +}; + +static u64 mem_acc_read_efuse_row(struct mem_acc_regulator *mem_acc_vreg, + u32 row_num, bool use_tz_api) +{ + int rc; + u64 efuse_bits; + struct mem_acc_read_req { + u32 row_address; + int addr_type; + } req; + + struct mem_acc_read_rsp { + u32 row_data[2]; + u32 status; + } rsp; + + if (!use_tz_api) { + efuse_bits = readq_relaxed(mem_acc_vreg->efuse_base + + row_num * BYTES_PER_FUSE_ROW); + return efuse_bits; + } + + req.row_address = mem_acc_vreg->efuse_addr + + row_num * BYTES_PER_FUSE_ROW; + req.addr_type = 0; + efuse_bits = 0; + + rc = scm_call(SCM_SVC_FUSE, SCM_FUSE_READ, + &req, sizeof(req), &rsp, sizeof(rsp)); + + if (rc) { + pr_err("read row %d failed, err code = %d", row_num, rc); + } else { + efuse_bits = ((u64)(rsp.row_data[1]) << 32) + + (u64)rsp.row_data[0]; + } + + return efuse_bits; +} + +static int mem_acc_fuse_is_setting_expected( + struct mem_acc_regulator *mem_acc_vreg, u32 sel_array[5]) +{ + u64 fuse_bits; + u32 ret; + + fuse_bits = mem_acc_read_efuse_row(mem_acc_vreg, sel_array[0], + sel_array[4]); + ret = (fuse_bits >> sel_array[1]) & ((1 << sel_array[2]) - 1); + if (ret == sel_array[3]) + ret = 1; + else + ret = 0; + + pr_info("[row:%d] = 0x%llx @%d:%d == %d ?: %s\n", + sel_array[0], fuse_bits, + sel_array[1], sel_array[2], + sel_array[3], + (ret == 1) ? "yes" : "no"); + return ret; +} + +static inline u32 apc_to_acc_corner(struct mem_acc_regulator *mem_acc_vreg, + int corner) +{ + /* + * corner_acc_map maps the corner from index 0 and APC corner value + * starts from the value 1 + */ + return mem_acc_vreg->corner_acc_map[corner - 1]; +} + +static void __update_acc_sel(struct mem_acc_regulator *mem_acc_vreg, + int corner, int mem_type) +{ + u32 acc_data, acc_data_old, i, bit, acc_corner; + + /* + * Do not configure the L1 ACC corner if the the corresponding flag is + * set. + */ + if ((mem_type == MEMORY_L1) + && (mem_acc_vreg->flags & MEM_ACC_SKIP_L1_CONFIG)) + return; + + acc_data = readl_relaxed(mem_acc_vreg->acc_sel_base[mem_type]); + acc_data_old = acc_data; + for (i = 0; i < mem_acc_vreg->num_acc_sel[mem_type]; i++) { + bit = mem_acc_vreg->acc_sel_bit_pos[mem_type][i]; + acc_data &= ~mem_acc_vreg->acc_sel_mask[mem_type][i]; + acc_corner = apc_to_acc_corner(mem_acc_vreg, corner); + acc_data |= (acc_corner << bit) & + mem_acc_vreg->acc_sel_mask[mem_type][i]; + } + pr_debug("corner=%d old_acc_sel=0x%02x new_acc_sel=0x%02x mem_type=%d\n", + corner, acc_data_old, acc_data, mem_type); + writel_relaxed(acc_data, mem_acc_vreg->acc_sel_base[mem_type]); +} + +static void update_acc_sel(struct mem_acc_regulator *mem_acc_vreg, int corner) +{ + int i; + + for (i = 0; i < MEMORY_MAX; i++) { + if (mem_acc_vreg->mem_acc_supported[i]) + __update_acc_sel(mem_acc_vreg, corner, i); + } +} + +static int mem_acc_regulator_set_voltage(struct regulator_dev *rdev, + int corner, int corner_max, unsigned *selector) +{ + struct mem_acc_regulator *mem_acc_vreg = rdev_get_drvdata(rdev); + int i; + + if (corner > mem_acc_vreg->num_corners) { + pr_err("Invalid corner=%d requested\n", corner); + return -EINVAL; + } + + pr_debug("old corner=%d, new corner=%d\n", + mem_acc_vreg->corner, corner); + + if (corner == mem_acc_vreg->corner) + return 0; + + /* go up or down one level at a time */ + if (corner > mem_acc_vreg->corner) { + for (i = mem_acc_vreg->corner + 1; i <= corner; i++) { + pr_debug("UP: to corner %d\n", i); + update_acc_sel(mem_acc_vreg, i); + } + } else { + for (i = mem_acc_vreg->corner - 1; i >= corner; i--) { + pr_debug("DOWN: to corner %d\n", i); + update_acc_sel(mem_acc_vreg, i); + } + } + + pr_debug("new voltage corner set %d\n", corner); + + mem_acc_vreg->corner = corner; + + return 0; +} + +static int mem_acc_regulator_get_voltage(struct regulator_dev *rdev) +{ + struct mem_acc_regulator *mem_acc_vreg = rdev_get_drvdata(rdev); + + return mem_acc_vreg->corner; +} + +static struct regulator_ops mem_acc_corner_ops = { + .set_voltage = mem_acc_regulator_set_voltage, + .get_voltage = mem_acc_regulator_get_voltage, +}; + +static int __mem_acc_sel_init(struct mem_acc_regulator *mem_acc_vreg, + int mem_type) +{ + int i; + u32 bit; + + mem_acc_vreg->acc_sel_mask[mem_type] = devm_kzalloc(mem_acc_vreg->dev, + mem_acc_vreg->num_acc_sel[mem_type] * sizeof(u32), GFP_KERNEL); + if (!mem_acc_vreg->acc_sel_mask[mem_type]) { + pr_err("Unable to allocate memory for mem_type=%d\n", mem_type); + return -ENOMEM; + } + + for (i = 0; i < mem_acc_vreg->num_acc_sel[mem_type]; i++) { + bit = mem_acc_vreg->acc_sel_bit_pos[mem_type][i]; + mem_acc_vreg->acc_sel_mask[mem_type][i] = + MEM_ACC_SEL_MASK << bit; + } + + return 0; +} + +static int mem_acc_sel_init(struct mem_acc_regulator *mem_acc_vreg) +{ + int i, rc; + + for (i = 0; i < MEMORY_MAX; i++) { + if (mem_acc_vreg->mem_acc_supported[i]) { + rc = __mem_acc_sel_init(mem_acc_vreg, i); + if (rc) { + pr_err("Unable to intialize mem_type=%d rc=%d\n", + i, rc); + return rc; + } + } + } + + return 0; +} + +static void mem_acc_en_init(struct mem_acc_regulator *mem_acc_vreg) +{ + int i, bit; + u32 acc_data; + + acc_data = readl_relaxed(mem_acc_vreg->acc_en_base); + pr_debug("init: acc_en_register=%x\n", acc_data); + for (i = 0; i < mem_acc_vreg->num_acc_en; i++) { + bit = mem_acc_vreg->acc_en_bit_pos[i]; + acc_data |= BIT(bit); + } + pr_debug("final: acc_en_register=%x\n", acc_data); + writel_relaxed(acc_data, mem_acc_vreg->acc_en_base); +} + +static int populate_acc_data(struct mem_acc_regulator *mem_acc_vreg, + const char *prop_name, u32 **value, u32 *len) +{ + int rc; + + if (!of_get_property(mem_acc_vreg->dev->of_node, prop_name, len)) { + pr_err("Unable to find %s property\n", prop_name); + return -EINVAL; + } + *len /= sizeof(u32); + if (!(*len)) { + pr_err("Incorrect entries in %s\n", prop_name); + return -EINVAL; + } + + *value = devm_kzalloc(mem_acc_vreg->dev, (*len) * sizeof(u32), + GFP_KERNEL); + if (!(*value)) { + pr_err("Unable to allocate memory for %s\n", prop_name); + return -ENOMEM; + } + + pr_debug("Found %s, data-length = %d\n", prop_name, *len); + + rc = of_property_read_u32_array(mem_acc_vreg->dev->of_node, + prop_name, *value, *len); + if (rc) { + pr_err("Unable to populate %s rc=%d\n", prop_name, rc); + return rc; + } + + return 0; +} + +static int mem_acc_sel_setup(struct mem_acc_regulator *mem_acc_vreg, + struct resource *res, int mem_type) +{ + int len, rc; + char *mem_select_str; + + mem_acc_vreg->acc_sel_addr[mem_type] = res->start; + len = res->end - res->start + 1; + pr_debug("'acc_sel_addr' = %pa mem_type=%d (len=%d)\n", + &res->start, mem_type, len); + + mem_acc_vreg->acc_sel_base[mem_type] = devm_ioremap(mem_acc_vreg->dev, + mem_acc_vreg->acc_sel_addr[mem_type], len); + if (!mem_acc_vreg->acc_sel_base[mem_type]) { + pr_err("Unable to map 'acc_sel_addr' %pa for mem_type=%d\n", + &mem_acc_vreg->acc_sel_addr[mem_type], mem_type); + return -EINVAL; + } + + switch (mem_type) { + case MEMORY_L1: + mem_select_str = "qcom,acc-sel-l1-bit-pos"; + break; + case MEMORY_L2: + mem_select_str = "qcom,acc-sel-l2-bit-pos"; + break; + } + + rc = populate_acc_data(mem_acc_vreg, mem_select_str, + &mem_acc_vreg->acc_sel_bit_pos[mem_type], + &mem_acc_vreg->num_acc_sel[mem_type]); + if (rc) + pr_err("Unable to populate '%s' rc=%d\n", mem_select_str, rc); + + return rc; +} + +static int mem_acc_efuse_init(struct platform_device *pdev, + struct mem_acc_regulator *mem_acc_vreg) +{ + struct resource *res; + int len, rc = 0; + u32 l1_config_skip_fuse_sel[5]; + + res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "efuse_addr"); + if (!res || !res->start) { + mem_acc_vreg->efuse_base = NULL; + pr_debug("'efuse_addr' resource missing or not used.\n"); + return 0; + } + + mem_acc_vreg->efuse_addr = res->start; + len = res->end - res->start + 1; + + pr_info("efuse_addr = %pa (len=0x%x)\n", &res->start, len); + + mem_acc_vreg->efuse_base = ioremap(mem_acc_vreg->efuse_addr, len); + if (!mem_acc_vreg->efuse_base) { + pr_err("Unable to map efuse_addr %pa\n", + &mem_acc_vreg->efuse_addr); + return -EINVAL; + } + + if (of_find_property(mem_acc_vreg->dev->of_node, + "qcom,l1-config-skip-fuse-sel", NULL)) { + rc = of_property_read_u32_array(mem_acc_vreg->dev->of_node, + "qcom,l1-config-skip-fuse-sel", + l1_config_skip_fuse_sel, 5); + if (rc < 0) { + pr_err("Read failed - qcom,l1-config-skip-fuse-sel rc=%d\n", + rc); + goto err_out; + } + + if (mem_acc_fuse_is_setting_expected(mem_acc_vreg, + l1_config_skip_fuse_sel)) { + mem_acc_vreg->flags |= MEM_ACC_SKIP_L1_CONFIG; + pr_debug("Skip L1 configuration enabled\n"); + } + } + + +err_out: + iounmap(mem_acc_vreg->efuse_base); + return rc; +} + +static int mem_acc_init(struct platform_device *pdev, + struct mem_acc_regulator *mem_acc_vreg) +{ + struct resource *res; + int len, rc, i; + + res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "acc-en"); + if (!res || !res->start) { + pr_debug("'acc-en' resource missing or not used.\n"); + } else { + mem_acc_vreg->acc_en_addr = res->start; + len = res->end - res->start + 1; + pr_debug("'acc_en_addr' = %pa (len=0x%x)\n", &res->start, len); + + mem_acc_vreg->acc_en_base = devm_ioremap(mem_acc_vreg->dev, + mem_acc_vreg->acc_en_addr, len); + if (!mem_acc_vreg->acc_en_base) { + pr_err("Unable to map 'acc_en_addr' %pa\n", + &mem_acc_vreg->acc_en_addr); + return -EINVAL; + } + + rc = populate_acc_data(mem_acc_vreg, "qcom,acc-en-bit-pos", + &mem_acc_vreg->acc_en_bit_pos, + &mem_acc_vreg->num_acc_en); + if (rc) { + pr_err("Unable to populate 'qcom,acc-en-bit-pos' rc=%d\n", + rc); + return rc; + } + } + + rc = mem_acc_efuse_init(pdev, mem_acc_vreg); + if (rc) { + pr_err("Wrong eFuse address specified: rc=%d\n", rc); + return rc; + } + + res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "acc-sel-l1"); + if (!res || !res->start) { + pr_debug("'acc-sel-l1' resource missing or not used.\n"); + } else { + rc = mem_acc_sel_setup(mem_acc_vreg, res, MEMORY_L1); + if (rc) { + pr_err("Unable to setup mem-acc for mem_type=%d rc=%d\n", + MEMORY_L1, rc); + return rc; + } + mem_acc_vreg->mem_acc_supported[MEMORY_L1] = true; + } + + res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "acc-sel-l2"); + if (!res || !res->start) { + pr_debug("'acc-sel-l2' resource missing or not used.\n"); + } else { + rc = mem_acc_sel_setup(mem_acc_vreg, res, MEMORY_L2); + if (rc) { + pr_err("Unable to setup mem-acc for mem_type=%d rc=%d\n", + MEMORY_L2, rc); + return rc; + } + mem_acc_vreg->mem_acc_supported[MEMORY_L2] = true; + } + + rc = populate_acc_data(mem_acc_vreg, "qcom,corner-acc-map", + &mem_acc_vreg->corner_acc_map, + &mem_acc_vreg->num_corners); + if (rc) { + pr_err("Unable to find 'qcom,corner-acc-map' rc=%d\n", rc); + return rc; + } + + pr_debug("num_corners = %d\n", mem_acc_vreg->num_corners); + + /* Check if at least one valid mem-acc config. is specified */ + for (i = 0; i < MEMORY_MAX; i++) { + if (mem_acc_vreg->mem_acc_supported[i]) + break; + } + if (i == MEMORY_MAX) { + pr_err("No mem-acc configuration specified\n"); + return -EINVAL; + } + + if (mem_acc_vreg->num_acc_en) + mem_acc_en_init(mem_acc_vreg); + + rc = mem_acc_sel_init(mem_acc_vreg); + if (rc) { + pr_err("Unable to intialize mem_acc_sel reg rc=%d\n", rc); + return rc; + } + + return 0; +} + +static int mem_acc_regulator_probe(struct platform_device *pdev) +{ + struct regulator_config reg_config = {}; + struct mem_acc_regulator *mem_acc_vreg; + struct regulator_desc *rdesc; + struct regulator_init_data *init_data; + int rc; + + if (!pdev->dev.of_node) { + pr_err("Device tree node is missing\n"); + return -EINVAL; + } + + mem_acc_vreg = devm_kzalloc(&pdev->dev, sizeof(*mem_acc_vreg), + GFP_KERNEL); + if (!mem_acc_vreg) { + pr_err("Can't allocate mem_acc_vreg memory\n"); + return -ENOMEM; + } + mem_acc_vreg->dev = &pdev->dev; + + rc = mem_acc_init(pdev, mem_acc_vreg); + if (rc) { + pr_err("Unable to initialize mem_acc configuration rc=%d\n", + rc); + return rc; + } + + rdesc = &mem_acc_vreg->rdesc; + rdesc->owner = THIS_MODULE; + rdesc->type = REGULATOR_VOLTAGE; + rdesc->ops = &mem_acc_corner_ops; + + init_data = of_get_regulator_init_data(&pdev->dev, pdev->dev.of_node, rdesc); + if (!init_data) { + pr_err("regulator init data is missing\n"); + return -EINVAL; + } + init_data->constraints.input_uV + = init_data->constraints.max_uV; + init_data->constraints.valid_ops_mask + |= REGULATOR_CHANGE_VOLTAGE; + rdesc->name = init_data->constraints.name; + + reg_config.dev = &pdev->dev; + reg_config.init_data = init_data; + reg_config.driver_data = mem_acc_vreg; + reg_config.of_node = pdev->dev.of_node; + mem_acc_vreg->rdev = regulator_register(rdesc, ®_config); + if (IS_ERR(mem_acc_vreg->rdev)) { + rc = PTR_ERR(mem_acc_vreg->rdev); + if (rc != -EPROBE_DEFER) + pr_err("regulator_register failed: rc=%d\n", rc); + return rc; + } + + platform_set_drvdata(pdev, mem_acc_vreg); + + return 0; +} + +static int mem_acc_regulator_remove(struct platform_device *pdev) +{ + struct mem_acc_regulator *mem_acc_vreg = platform_get_drvdata(pdev); + + regulator_unregister(mem_acc_vreg->rdev); + + return 0; +} + +static struct of_device_id mem_acc_regulator_match_table[] = { + { .compatible = "qcom,mem-acc-regulator", }, + {} +}; + +static struct platform_driver mem_acc_regulator_driver = { + .probe = mem_acc_regulator_probe, + .remove = mem_acc_regulator_remove, + .driver = { + .name = "qcom,mem-acc-regulator", + .of_match_table = mem_acc_regulator_match_table, + .owner = THIS_MODULE, + }, +}; + +int __init mem_acc_regulator_init(void) +{ + return platform_driver_register(&mem_acc_regulator_driver); +} +postcore_initcall(mem_acc_regulator_init); + +static void __exit mem_acc_regulator_exit(void) +{ + platform_driver_unregister(&mem_acc_regulator_driver); +} +module_exit(mem_acc_regulator_exit); + +MODULE_DESCRIPTION("MEM-ACC-SEL regulator driver"); +MODULE_LICENSE("GPL v2"); diff --git a/drivers/regulator/rpm-smd-regulator.c b/drivers/regulator/rpm-smd-regulator.c index dbe3352eadf8..a2972f6b8eb8 100644 --- a/drivers/regulator/rpm-smd-regulator.c +++ b/drivers/regulator/rpm-smd-regulator.c @@ -337,7 +337,7 @@ static void rpm_regulator_req(struct rpm_regulator *regulator, int set, } pos += scnprintf(buf + pos, buflen - pos, "\n"); - printk(buf); + pr_err("%s", buf); } #define RPM_VREG_SET_PARAM(_regulator, _param, _val) \ @@ -618,6 +618,8 @@ static int rpm_vreg_enable(struct regulator_dev *rdev) int rc; u32 prev_enable; + //pr_err("%s: %s\n", __func__, reg->rdesc.name); + rpm_vreg_lock(reg->rpm_vreg); prev_enable = reg->req.param[RPM_REGULATOR_PARAM_ENABLE]; @@ -638,6 +640,8 @@ static int rpm_vreg_disable(struct regulator_dev *rdev) struct rpm_regulator *reg = rdev_get_drvdata(rdev); int rc; u32 prev_enable; + //pr_err("%s: %s\n", __func__, reg->rdesc.name); + rpm_vreg_lock(reg->rpm_vreg); @@ -1352,7 +1356,6 @@ static int rpm_vreg_device_probe(struct platform_device *pdev) int rc = 0; int i, regulator_type; u32 val; - const struct regulator_desc desc; if (!dev->of_node) { dev_err(dev, "%s: device tree information missing\n", __func__); @@ -1433,7 +1436,7 @@ static int rpm_vreg_device_probe(struct platform_device *pdev) reg->set_active = !!(val & RPM_SET_CONFIG_ACTIVE); reg->set_sleep = !!(val & RPM_SET_CONFIG_SLEEP); - init_data = of_get_regulator_init_data(dev, node, &desc); + init_data = of_get_regulator_init_data(dev, node, ®->rdesc); if (init_data == NULL) { dev_err(dev, "%s: unable to allocate memory\n", __func__); rc = -ENOMEM; diff --git a/drivers/soc/qcom/Kconfig b/drivers/soc/qcom/Kconfig index 348682044e83..fe3179d3434f 100644 --- a/drivers/soc/qcom/Kconfig +++ b/drivers/soc/qcom/Kconfig @@ -117,6 +117,17 @@ config MSM_SMD_DEBUG what channels caused interrupt activity, and when internal state change events occur. +config MSM_MPM_OF + bool "Modem Power Manager" + depends on OF + help + MPM is a dedicated hardware resource responsible for entering and + waking up from a system wide low power mode. The MPM driver tracks + the wakeup interrupts and configures the MPM to monitor the wakeup + interrupts when going to a system wide sleep mode. This config option + enables the MPM driver that supports initialization from a device + tree + config MSM_RPM_SMD select MSM_MPM_OF bool "RPM driver using SMD protocol" diff --git a/drivers/soc/qcom/Makefile b/drivers/soc/qcom/Makefile index 7a9b4152e2c8..e112532f2ea2 100644 --- a/drivers/soc/qcom/Makefile +++ b/drivers/soc/qcom/Makefile @@ -14,6 +14,8 @@ obj-$(CONFIG_MSM_IPC_ROUTER_SMD_XPRT) += ipc_router_smd_xprt.o obj-$(CONFIG_MSM_MEMORY_DUMP) += memory_dump.o obj-$(CONFIG_MSM_MEMORY_DUMP_V2) += memory_dump_v2.o obj-$(CONFIG_MSM_RPM_SMD) += rpm-smd.o +obj-$(CONFIG_MSM_MPM_OF) += mpm-of.o + ifdef CONFIG_DEBUG_FS obj-$(CONFIG_MSM_RPM_SMD) += rpm-smd-debug.o endif diff --git a/drivers/soc/qcom/mpm-of.c b/drivers/soc/qcom/mpm-of.c new file mode 100644 index 000000000000..88d23b78431e --- /dev/null +++ b/drivers/soc/qcom/mpm-of.c @@ -0,0 +1,958 @@ +/* Copyright (c) 2010-2014, The Linux Foundation. All rights reserved. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 and + * only version 2 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. + * + */ + +#include <linux/module.h> +#include <linux/kernel.h> +#include <linux/types.h> +#include <linux/init.h> +#include <linux/bitmap.h> +#include <linux/bitops.h> +#include <linux/interrupt.h> +#include <linux/io.h> +#include <linux/irq.h> +#include <linux/irqdomain.h> +#include <linux/list.h> +#include <linux/platform_device.h> +#include <linux/of.h> +#include <linux/of_address.h> +#include <linux/slab.h> +#include <linux/spinlock.h> +#include <linux/clk.h> +#include <linux/err.h> +#include <linux/power_supply.h> +#include <linux/regulator/consumer.h> +#include <linux/regulator/rpm-smd-regulator.h> +#include <linux/workqueue.h> +#include <linux/irqchip/arm-gic.h> +#include <linux/clk/msm-clk.h> +#include <linux/irqchip/msm-gpio-irq.h> +#include <linux/irqchip/msm-mpm-irq.h> +#include <linux/mutex.h> +#include <asm/arch_timer.h> + +void irq_set_pending(unsigned int irq); + +enum { + MSM_MPM_GIC_IRQ_DOMAIN, + MSM_MPM_GPIO_IRQ_DOMAIN, + MSM_MPM_NR_IRQ_DOMAINS, +}; + +enum { + MSM_MPM_SET_ENABLED, + MSM_MPM_SET_WAKEUP, + MSM_NR_IRQS_SET, +}; + +struct mpm_irqs_a2m { + struct irq_domain *domain; + struct device_node *parent; + irq_hw_number_t hwirq; + unsigned long pin; + struct hlist_node node; +}; +#define MAX_DOMAIN_NAME 5 + +struct mpm_irqs { + struct irq_domain *domain; + unsigned long *enabled_irqs; + unsigned long *wakeup_irqs; + unsigned long size; + char domain_name[MAX_DOMAIN_NAME]; +}; + +static struct mpm_irqs unlisted_irqs[MSM_MPM_NR_IRQ_DOMAINS]; + +static struct hlist_head irq_hash[MSM_MPM_NR_MPM_IRQS]; +static unsigned int msm_mpm_irqs_m2a[MSM_MPM_NR_MPM_IRQS]; +#define MSM_MPM_REG_WIDTH DIV_ROUND_UP(MSM_MPM_NR_MPM_IRQS, 32) + +#define MSM_MPM_IRQ_INDEX(irq) (irq / 32) +#define MSM_MPM_IRQ_MASK(irq) BIT(irq % 32) + +#define hashfn(val) (val % MSM_MPM_NR_MPM_IRQS) +#define SCLK_HZ (32768) +#define ARCH_TIMER_HZ (19200000) + +struct msm_mpm_device_data { + uint16_t *irqs_m2a; + unsigned int irqs_m2a_size; + uint16_t *bypassed_apps_irqs; + unsigned int bypassed_apps_irqs_size; + void __iomem *mpm_request_reg_base; + void __iomem *mpm_status_reg_base; + void __iomem *mpm_apps_ipc_reg; + unsigned int mpm_apps_ipc_val; + unsigned int mpm_ipc_irq; +}; +static struct msm_mpm_device_data msm_mpm_dev_data; + +static struct clk *xo_clk; +static bool xo_enabled; +static bool msm_mpm_in_suspend; +static struct workqueue_struct *msm_mpm_wq; +static struct work_struct msm_mpm_work; +static struct completion wake_wq; + +enum mpm_reg_offsets { + MSM_MPM_REG_WAKEUP, + MSM_MPM_REG_ENABLE, + MSM_MPM_REG_FALLING_EDGE, + MSM_MPM_REG_RISING_EDGE, + MSM_MPM_REG_POLARITY, + MSM_MPM_REG_STATUS, +}; + +static DEFINE_SPINLOCK(msm_mpm_lock); + +static uint32_t msm_mpm_enabled_irq[MSM_MPM_REG_WIDTH]; +static uint32_t msm_mpm_wake_irq[MSM_MPM_REG_WIDTH]; +static uint32_t msm_mpm_falling_edge[MSM_MPM_REG_WIDTH]; +static uint32_t msm_mpm_rising_edge[MSM_MPM_REG_WIDTH]; +static uint32_t msm_mpm_polarity[MSM_MPM_REG_WIDTH]; + +enum { + MSM_MPM_DEBUG_NON_DETECTABLE_IRQ = BIT(0), + MSM_MPM_DEBUG_PENDING_IRQ = BIT(1), + MSM_MPM_DEBUG_WRITE = BIT(2), + MSM_MPM_DEBUG_NON_DETECTABLE_IRQ_IDLE = BIT(3), +}; + +static int msm_mpm_debug_mask = 1; +module_param_named( + debug_mask, msm_mpm_debug_mask, int, S_IRUGO | S_IWUSR | S_IWGRP +); + +enum mpm_state { + MSM_MPM_IRQ_MAPPING_DONE = BIT(0), + MSM_MPM_DEVICE_PROBED = BIT(1), +}; + +static enum mpm_state msm_mpm_initialized; + +static inline bool msm_mpm_is_initialized(void) +{ + return msm_mpm_initialized & + (MSM_MPM_IRQ_MAPPING_DONE | MSM_MPM_DEVICE_PROBED); + +} + +static inline uint32_t msm_mpm_read( + unsigned int reg, unsigned int subreg_index) +{ + unsigned int offset = reg * MSM_MPM_REG_WIDTH + subreg_index; + return __raw_readl(msm_mpm_dev_data.mpm_request_reg_base + offset * 4); +} + +static inline void msm_mpm_write( + unsigned int reg, unsigned int subreg_index, uint32_t value) +{ + unsigned int offset = reg * MSM_MPM_REG_WIDTH + subreg_index; + + __raw_writel(value, msm_mpm_dev_data.mpm_request_reg_base + offset * 4); + if (MSM_MPM_DEBUG_WRITE & msm_mpm_debug_mask) + pr_info("%s: reg %u.%u: 0x%08x\n", + __func__, reg, subreg_index, value); +} + +static inline void msm_mpm_send_interrupt(void) +{ + __raw_writel(msm_mpm_dev_data.mpm_apps_ipc_val, + msm_mpm_dev_data.mpm_apps_ipc_reg); + /* Ensure the write is complete before returning. */ + wmb(); +} + +static irqreturn_t msm_mpm_irq(int irq, void *dev_id) +{ + /* + * When the system resumes from deep sleep mode, the RPM hardware wakes + * up the Apps processor by triggering this interrupt. This interrupt + * has to be enabled and set as wake for the irq to get SPM out of + * sleep. Handle the interrupt here to make sure that it gets cleared. + */ + return IRQ_HANDLED; +} + +static void msm_mpm_set(cycle_t wakeup, bool wakeset) +{ + uint32_t *irqs; + unsigned int reg; + int i; + uint32_t *expiry_timer; + + expiry_timer = (uint32_t *)&wakeup; + + irqs = wakeset ? msm_mpm_wake_irq : msm_mpm_enabled_irq; + for (i = 0; i < MSM_MPM_REG_WIDTH; i++) { + reg = MSM_MPM_REG_WAKEUP; + msm_mpm_write(reg, i, expiry_timer[i]); + + reg = MSM_MPM_REG_ENABLE; + msm_mpm_write(reg, i, irqs[i]); + + reg = MSM_MPM_REG_FALLING_EDGE; + msm_mpm_write(reg, i, msm_mpm_falling_edge[i]); + + reg = MSM_MPM_REG_RISING_EDGE; + msm_mpm_write(reg, i, msm_mpm_rising_edge[i]); + + reg = MSM_MPM_REG_POLARITY; + msm_mpm_write(reg, i, msm_mpm_polarity[i]); + + reg = MSM_MPM_REG_STATUS; + msm_mpm_write(reg, i, 0); + } + + /* + * Ensure that the set operation is complete before sending the + * interrupt + */ + wmb(); + msm_mpm_send_interrupt(); +} + +static inline unsigned int msm_mpm_get_irq_m2a(unsigned int pin) +{ + return msm_mpm_irqs_m2a[pin]; +} + +static inline uint16_t msm_mpm_get_irq_a2m(struct irq_data *d) +{ + struct mpm_irqs_a2m *node = NULL; + + hlist_for_each_entry(node, &irq_hash[hashfn(d->hwirq)], node) { + if ((node->hwirq == d->hwirq) + && (d->domain == node->domain)) { + /* + * Update the linux irq mapping. No update required for + * bypass interrupts + */ + if (node->pin != 0xff) + msm_mpm_irqs_m2a[node->pin] = d->irq; + break; + } + } + return node ? node->pin : 0; +} + +static int msm_mpm_enable_irq_exclusive( + struct irq_data *d, bool enable, bool wakeset) +{ + uint16_t mpm_pin; + + WARN_ON(!d); + if (!d) + return 0; + + mpm_pin = msm_mpm_get_irq_a2m(d); + + if (mpm_pin == 0xff) + return 0; + + if (mpm_pin) { + uint32_t *mpm_irq_masks = wakeset ? + msm_mpm_wake_irq : msm_mpm_enabled_irq; + uint32_t index = MSM_MPM_IRQ_INDEX(mpm_pin); + uint32_t mask = MSM_MPM_IRQ_MASK(mpm_pin); + + if (enable) + mpm_irq_masks[index] |= mask; + else + mpm_irq_masks[index] &= ~mask; + } else { + int i; + unsigned long *irq_apps; + + for (i = 0; i < MSM_MPM_NR_IRQ_DOMAINS; i++) { + if (d->domain == unlisted_irqs[i].domain) + break; + } + + if (i == MSM_MPM_NR_IRQ_DOMAINS) + return 0; + irq_apps = wakeset ? unlisted_irqs[i].wakeup_irqs : + unlisted_irqs[i].enabled_irqs; + + if (enable) + __set_bit(d->hwirq, irq_apps); + else + __clear_bit(d->hwirq, irq_apps); + + if ((msm_mpm_initialized & MSM_MPM_DEVICE_PROBED) + && !wakeset && !msm_mpm_in_suspend) + complete(&wake_wq); + } + + return 0; +} + +static void msm_mpm_set_edge_ctl(int pin, unsigned int flow_type) +{ + uint32_t index; + uint32_t mask; + + index = MSM_MPM_IRQ_INDEX(pin); + mask = MSM_MPM_IRQ_MASK(pin); + + if (flow_type & IRQ_TYPE_EDGE_FALLING) + msm_mpm_falling_edge[index] |= mask; + else + msm_mpm_falling_edge[index] &= ~mask; + + if (flow_type & IRQ_TYPE_EDGE_RISING) + msm_mpm_rising_edge[index] |= mask; + else + msm_mpm_rising_edge[index] &= ~mask; + +} + +static int msm_mpm_set_irq_type_exclusive( + struct irq_data *d, unsigned int flow_type) +{ + uint32_t mpm_irq; + + mpm_irq = msm_mpm_get_irq_a2m(d); + + if (mpm_irq == 0xff) + return 0; + + if (mpm_irq) { + uint32_t index = MSM_MPM_IRQ_INDEX(mpm_irq); + uint32_t mask = MSM_MPM_IRQ_MASK(mpm_irq); + + if (index >= MSM_MPM_REG_WIDTH) + return -EFAULT; + + msm_mpm_set_edge_ctl(mpm_irq, flow_type); + + if (flow_type & IRQ_TYPE_LEVEL_HIGH) + msm_mpm_polarity[index] |= mask; + else + msm_mpm_polarity[index] &= ~mask; + } + return 0; +} + +static int __msm_mpm_enable_irq(struct irq_data *d, bool enable) +{ + unsigned long flags; + int rc; + + if (!msm_mpm_is_initialized()) + return -EINVAL; + + spin_lock_irqsave(&msm_mpm_lock, flags); + + rc = msm_mpm_enable_irq_exclusive(d, enable, false); + spin_unlock_irqrestore(&msm_mpm_lock, flags); + + return rc; +} + +static void msm_mpm_enable_irq(struct irq_data *d) +{ + __msm_mpm_enable_irq(d, true); +} + +static void msm_mpm_disable_irq(struct irq_data *d) +{ + __msm_mpm_enable_irq(d, false); +} + +static int msm_mpm_set_irq_wake(struct irq_data *d, unsigned int on) +{ + unsigned long flags; + int rc; + + if (!msm_mpm_is_initialized()) + return -EINVAL; + + spin_lock_irqsave(&msm_mpm_lock, flags); + rc = msm_mpm_enable_irq_exclusive(d, (bool)on, true); + spin_unlock_irqrestore(&msm_mpm_lock, flags); + + return rc; +} + +static int msm_mpm_set_irq_type(struct irq_data *d, unsigned int flow_type) +{ + unsigned long flags; + int rc; + + if (!msm_mpm_is_initialized()) + return -EINVAL; + + spin_lock_irqsave(&msm_mpm_lock, flags); + rc = msm_mpm_set_irq_type_exclusive(d, flow_type); + spin_unlock_irqrestore(&msm_mpm_lock, flags); + + return rc; +} + +/****************************************************************************** + * Public functions + *****************************************************************************/ +int msm_mpm_enable_pin(unsigned int pin, unsigned int enable) +{ + uint32_t index = MSM_MPM_IRQ_INDEX(pin); + uint32_t mask = MSM_MPM_IRQ_MASK(pin); + unsigned long flags; + + if (!msm_mpm_is_initialized()) + return -EINVAL; + + if (pin >= MSM_MPM_NR_MPM_IRQS) + return -EINVAL; + + spin_lock_irqsave(&msm_mpm_lock, flags); + + if (enable) + msm_mpm_enabled_irq[index] |= mask; + else + msm_mpm_enabled_irq[index] &= ~mask; + + spin_unlock_irqrestore(&msm_mpm_lock, flags); + return 0; +} + +int msm_mpm_set_pin_wake(unsigned int pin, unsigned int on) +{ + uint32_t index = MSM_MPM_IRQ_INDEX(pin); + uint32_t mask = MSM_MPM_IRQ_MASK(pin); + unsigned long flags; + + if (!msm_mpm_is_initialized()) + return -EINVAL; + + if (pin >= MSM_MPM_NR_MPM_IRQS) + return -EINVAL; + + spin_lock_irqsave(&msm_mpm_lock, flags); + + if (on) + msm_mpm_wake_irq[index] |= mask; + else + msm_mpm_wake_irq[index] &= ~mask; + + spin_unlock_irqrestore(&msm_mpm_lock, flags); + return 0; +} + +int msm_mpm_set_pin_type(unsigned int pin, unsigned int flow_type) +{ + uint32_t index = MSM_MPM_IRQ_INDEX(pin); + uint32_t mask = MSM_MPM_IRQ_MASK(pin); + unsigned long flags; + + if (!msm_mpm_is_initialized()) + return -EINVAL; + + if (pin >= MSM_MPM_NR_MPM_IRQS) + return -EINVAL; + + spin_lock_irqsave(&msm_mpm_lock, flags); + + msm_mpm_set_edge_ctl(pin, flow_type); + + if (flow_type & IRQ_TYPE_LEVEL_HIGH) + msm_mpm_polarity[index] |= mask; + else + msm_mpm_polarity[index] &= ~mask; + + spin_unlock_irqrestore(&msm_mpm_lock, flags); + return 0; +} + +static bool msm_mpm_interrupts_detectable(int d, bool from_idle) +{ + unsigned long *irq_bitmap; + bool debug_mask, ret = false; + struct mpm_irqs *unlisted = &unlisted_irqs[d]; + + if (!msm_mpm_is_initialized()) + return false; + + if (from_idle) { + irq_bitmap = unlisted->enabled_irqs; + debug_mask = msm_mpm_debug_mask & + MSM_MPM_DEBUG_NON_DETECTABLE_IRQ_IDLE; + } else { + irq_bitmap = unlisted->wakeup_irqs; + debug_mask = msm_mpm_debug_mask & + MSM_MPM_DEBUG_NON_DETECTABLE_IRQ; + } + + ret = (bool) __bitmap_empty(irq_bitmap, unlisted->size); + + if (debug_mask && !ret) { + int i = 0; + i = find_first_bit(irq_bitmap, unlisted->size); + pr_info("%s(): %s preventing system sleep modes during %s\n", + __func__, unlisted->domain_name, + from_idle ? "idle" : "suspend"); + + while (i < unlisted->size) { + pr_info("\thwirq: %d\n", i); + i = find_next_bit(irq_bitmap, unlisted->size, i + 1); + } + } + + return ret; +} + +bool msm_mpm_gpio_irqs_detectable(bool from_idle) +{ + return msm_mpm_interrupts_detectable(MSM_MPM_GPIO_IRQ_DOMAIN, + from_idle); +} +bool msm_mpm_irqs_detectable(bool from_idle) +{ + return msm_mpm_interrupts_detectable(MSM_MPM_GIC_IRQ_DOMAIN, + from_idle); +} + +void msm_mpm_enter_sleep(uint32_t sclk_count, bool from_idle, + const struct cpumask *cpumask) +{ + cycle_t wakeup = (u64)sclk_count * ARCH_TIMER_HZ; + + if (!msm_mpm_is_initialized()) { + pr_err("%s(): MPM not initialized\n", __func__); + return; + } + + if (sclk_count) { + do_div(wakeup, SCLK_HZ); + wakeup += arch_counter_get_cntpct(); + } else { + wakeup = (~0ULL); + } + + msm_mpm_set(wakeup, !from_idle); + if (cpumask) + irq_set_affinity(msm_mpm_dev_data.mpm_ipc_irq, cpumask); +} + +void msm_mpm_exit_sleep(bool from_idle) +{ + unsigned long pending; + uint32_t *enabled_intr; + int i; + int k; + + if (!msm_mpm_is_initialized()) { + pr_err("%s(): MPM not initialized\n", __func__); + return; + } + + enabled_intr = from_idle ? msm_mpm_enabled_irq : + msm_mpm_wake_irq; + + for (i = 0; i < MSM_MPM_REG_WIDTH; i++) { + pending = msm_mpm_read(MSM_MPM_REG_STATUS, i); + pending &= enabled_intr[i]; + + if (MSM_MPM_DEBUG_PENDING_IRQ & msm_mpm_debug_mask) + pr_info("%s: enabled_intr.%d pending.%d: 0x%08x 0x%08lx\n", + __func__, i, i, enabled_intr[i], pending); + + k = find_first_bit(&pending, 32); + while (k < 32) { + unsigned int mpm_irq = 32 * i + k; + unsigned int apps_irq = msm_mpm_get_irq_m2a(mpm_irq); + struct irq_desc *desc = apps_irq ? + irq_to_desc(apps_irq) : NULL; + + if (desc && !irqd_is_level_type(&desc->irq_data)) { + irq_set_pending(apps_irq); + if (from_idle) { + raw_spin_lock(&desc->lock); + check_irq_resend(desc, apps_irq); + raw_spin_unlock(&desc->lock); + } + } + + k = find_next_bit(&pending, 32, k + 1); + } + } +} +static void msm_mpm_sys_low_power_modes(bool allow) +{ + static DEFINE_MUTEX(enable_xo_mutex); + + mutex_lock(&enable_xo_mutex); + if (allow) { + if (xo_enabled) { + clk_disable_unprepare(xo_clk); + xo_enabled = false; + } + } else { + if (!xo_enabled) { + /* If we cannot enable XO clock then we want to flag it, + * than having to deal with not being able to wakeup + * from a non-monitorable interrupt + */ + BUG_ON(clk_prepare_enable(xo_clk)); + xo_enabled = true; + } + } + mutex_unlock(&enable_xo_mutex); +} + +void msm_mpm_suspend_prepare(void) +{ + bool allow; + unsigned long flags; + + spin_lock_irqsave(&msm_mpm_lock, flags); + + allow = msm_mpm_irqs_detectable(false) && + msm_mpm_gpio_irqs_detectable(false); + msm_mpm_in_suspend = true; + + spin_unlock_irqrestore(&msm_mpm_lock, flags); + msm_mpm_sys_low_power_modes(allow); +} +EXPORT_SYMBOL(msm_mpm_suspend_prepare); + +void msm_mpm_suspend_wake(void) +{ + bool allow; + unsigned long flags; + + spin_lock_irqsave(&msm_mpm_lock, flags); + + allow = msm_mpm_irqs_detectable(true) && + msm_mpm_gpio_irqs_detectable(true); + + spin_unlock_irqrestore(&msm_mpm_lock, flags); + msm_mpm_sys_low_power_modes(allow); + msm_mpm_in_suspend = false; +} +EXPORT_SYMBOL(msm_mpm_suspend_wake); + +static void msm_mpm_work_fn(struct work_struct *work) +{ + unsigned long flags; + while (1) { + bool allow; + wait_for_completion(&wake_wq); + spin_lock_irqsave(&msm_mpm_lock, flags); + allow = msm_mpm_irqs_detectable(true) && + msm_mpm_gpio_irqs_detectable(true); + if (msm_mpm_in_suspend) { + spin_unlock_irqrestore(&msm_mpm_lock, flags); + continue; + } + + spin_unlock_irqrestore(&msm_mpm_lock, flags); + msm_mpm_sys_low_power_modes(allow); + } +} + +static int msm_mpm_dev_probe(struct platform_device *pdev) +{ + struct resource *res = NULL; + int offset, ret; + struct msm_mpm_device_data *dev = &msm_mpm_dev_data; + const char *clk_name; + char *key; + + if (msm_mpm_initialized & MSM_MPM_DEVICE_PROBED) { + pr_warn("MPM device probed multiple times\n"); + return 0; + } + + key = "clock-names"; + ret = of_property_read_string(pdev->dev.of_node, key, &clk_name); + if (ret) { + pr_err("%s(): Cannot read clock name%s\n", __func__, key); + return -EINVAL; + } + + xo_clk = devm_clk_get(&pdev->dev, clk_name); + + if (IS_ERR(xo_clk)) { + pr_err("%s(): Cannot get clk resource for XO\n", __func__); + return PTR_ERR(xo_clk); + } + + res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "vmpm"); + if (!res) { + pr_err("%s(): Missing RPM memory resource\n", __func__); + return -EINVAL; + } + + dev->mpm_request_reg_base = devm_ioremap_resource(&pdev->dev, res); + + if (!dev->mpm_request_reg_base) { + pr_err("%s(): Unable to iomap\n", __func__); + return -EADDRNOTAVAIL; + } + + res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "ipc"); + if (!res) { + pr_err("%s(): Missing GCC memory resource\n", __func__); + return -EINVAL; + } + + dev->mpm_apps_ipc_reg = devm_ioremap(&pdev->dev, res->start, + resource_size(res)); + if (!dev->mpm_apps_ipc_reg) { + pr_err("%s(): Unable to iomap IPC register\n", __func__); + return -EADDRNOTAVAIL; + } + + if (of_property_read_u32(pdev->dev.of_node, + "qcom,ipc-bit-offset", &offset)) { + pr_info("%s(): Cannot read ipc bit offset\n", __func__); + return -EINVAL; + } + + dev->mpm_apps_ipc_val = (1 << offset); + + dev->mpm_ipc_irq = platform_get_irq(pdev, 0); + + if (dev->mpm_ipc_irq == -ENXIO) { + pr_info("%s(): Cannot find IRQ resource\n", __func__); + return -ENXIO; + } + ret = devm_request_irq(&pdev->dev, dev->mpm_ipc_irq, msm_mpm_irq, + IRQF_TRIGGER_RISING | IRQF_NO_SUSPEND, pdev->name, + msm_mpm_irq); + + if (ret) { + pr_info("%s(): request_irq failed errno: %d\n", __func__, ret); + return ret; + } + ret = irq_set_irq_wake(dev->mpm_ipc_irq, 1); + + if (ret) { + pr_err("%s: failed to set wakeup irq %u: %d\n", + __func__, dev->mpm_ipc_irq, ret); + return ret; + + } + + init_completion(&wake_wq); + + INIT_WORK(&msm_mpm_work, msm_mpm_work_fn); + msm_mpm_wq = create_singlethread_workqueue("mpm"); + + if (msm_mpm_wq) + queue_work(msm_mpm_wq, &msm_mpm_work); + else { + pr_warn("%s(): Failed to create wq. So voting against XO off", + __func__); + /* Throw a BUG. Otherwise, its possible that system allows + * XO shutdown when there are non-monitored interrupts are + * pending and cause errors at a later point in time. + */ + BUG_ON(clk_prepare_enable(xo_clk)); + xo_enabled = true; + } + + msm_mpm_initialized |= MSM_MPM_DEVICE_PROBED; + return 0; +} + +static inline int __init mpm_irq_domain_linear_size(struct irq_domain *d) +{ + return d->revmap_size; +} + +static inline int __init mpm_irq_domain_legacy_size(struct irq_domain *d) +{ + return d->revmap_size; +} + +static void __init __of_mpm_init(struct device_node *node) +{ + const __be32 *list; + + struct mpm_of { + char *pkey; + char *map; + char name[MAX_DOMAIN_NAME]; + struct irq_chip *chip; + int (*get_max_irqs)(struct irq_domain *d); + }; + int i; + + struct mpm_of mpm_of_map[MSM_MPM_NR_IRQ_DOMAINS] = { + { + "qcom,gic-parent", + "qcom,gic-map", + "gic", + &gic_arch_extn, + mpm_irq_domain_linear_size, + }, + { + "qcom,gpio-parent", + "qcom,gpio-map", + "gpio", + #ifdef CONFIG_USE_PINCTRL_IRQ + &mpm_tlmm_irq_extn, + #else + &msm_gpio_irq_extn, + #endif + mpm_irq_domain_legacy_size, + }, + }; + + if (msm_mpm_initialized & MSM_MPM_IRQ_MAPPING_DONE) { + pr_warn("%s(): MPM driver mapping exists\n", __func__); + return; + } + + for (i = 0; i < MSM_MPM_NR_MPM_IRQS; i++) + INIT_HLIST_HEAD(&irq_hash[i]); + + for (i = 0; i < MSM_MPM_NR_IRQ_DOMAINS; i++) { + struct device_node *parent = NULL; + struct mpm_irqs_a2m *mpm_node = NULL; + struct irq_domain *domain = NULL; + int size; + + parent = of_parse_phandle(node, mpm_of_map[i].pkey, 0); + + if (!parent) { + pr_warn("%s(): %s Not found\n", __func__, + mpm_of_map[i].pkey); + continue; + } + + domain = irq_find_host(parent); + + if (!domain) { + pr_warn("%s(): Cannot find irq controller for %s\n", + __func__, mpm_of_map[i].pkey); + continue; + } + + size = mpm_of_map[i].get_max_irqs(domain); + unlisted_irqs[i].size = size; + memcpy(unlisted_irqs[i].domain_name, mpm_of_map[i].name, + MAX_DOMAIN_NAME); + + unlisted_irqs[i].enabled_irqs = + kzalloc(BITS_TO_LONGS(size) * sizeof(unsigned long), + GFP_KERNEL); + + if (!unlisted_irqs[i].enabled_irqs) + goto failed_malloc; + + unlisted_irqs[i].wakeup_irqs = + kzalloc(BITS_TO_LONGS(size) * sizeof(unsigned long), + GFP_KERNEL); + + if (!unlisted_irqs[i].wakeup_irqs) + goto failed_malloc; + + unlisted_irqs[i].domain = domain; + + list = of_get_property(node, mpm_of_map[i].map, &size); + + if (!list || !size) { + __WARN(); + continue; + } + + /* + * Size is in bytes. Convert to size of uint32_t + */ + size /= sizeof(*list); + + /* + * The data is represented by a tuple mapping hwirq to a MPM + * pin. The number of mappings in the device tree would be + * size/2 + */ + mpm_node = kzalloc(sizeof(struct mpm_irqs_a2m) * size / 2, + GFP_KERNEL); + if (!mpm_node) + goto failed_malloc; + + while (size) { + unsigned long pin = be32_to_cpup(list++); + irq_hw_number_t hwirq = be32_to_cpup(list++); + + mpm_node->pin = pin; + mpm_node->hwirq = hwirq; + mpm_node->parent = parent; + mpm_node->domain = domain; + INIT_HLIST_NODE(&mpm_node->node); + + hlist_add_head(&mpm_node->node, + &irq_hash[hashfn(mpm_node->hwirq)]); + size -= 2; + mpm_node++; + } + + if (mpm_of_map[i].chip) { + mpm_of_map[i].chip->irq_mask = msm_mpm_disable_irq; + mpm_of_map[i].chip->irq_unmask = msm_mpm_enable_irq; + mpm_of_map[i].chip->irq_disable = msm_mpm_disable_irq; + mpm_of_map[i].chip->irq_set_type = msm_mpm_set_irq_type; + mpm_of_map[i].chip->irq_set_wake = msm_mpm_set_irq_wake; + } + + } + msm_mpm_initialized |= MSM_MPM_IRQ_MAPPING_DONE; + + return; + +failed_malloc: + for (i = 0; i < MSM_MPM_NR_IRQ_DOMAINS; i++) { + mpm_of_map[i].chip->irq_mask = NULL; + mpm_of_map[i].chip->irq_unmask = NULL; + mpm_of_map[i].chip->irq_disable = NULL; + mpm_of_map[i].chip->irq_set_type = NULL; + mpm_of_map[i].chip->irq_set_wake = NULL; + + kfree(unlisted_irqs[i].enabled_irqs); + kfree(unlisted_irqs[i].wakeup_irqs); + + } +} + +static struct of_device_id msm_mpm_match_table[] = { + {.compatible = "qcom,mpm-v2"}, + {}, +}; + +static struct platform_driver msm_mpm_dev_driver = { + .probe = msm_mpm_dev_probe, + .driver = { + .name = "mpm-v2", + .owner = THIS_MODULE, + .of_match_table = msm_mpm_match_table, + }, +}; + +int __init msm_mpm_device_init(void) +{ + return platform_driver_register(&msm_mpm_dev_driver); +} +arch_initcall(msm_mpm_device_init); + +void __init of_mpm_init(void) +{ + struct device_node *node; + + node = of_find_matching_node(NULL, msm_mpm_match_table); + WARN_ON(!node); + if (node) + __of_mpm_init(node); +} diff --git a/drivers/soc/qcom/peripheral-loader.c b/drivers/soc/qcom/peripheral-loader.c index 3ac151c6d91f..c774b33bafa5 100644 --- a/drivers/soc/qcom/peripheral-loader.c +++ b/drivers/soc/qcom/peripheral-loader.c @@ -39,6 +39,8 @@ #include <asm/setup.h> #include <asm-generic/io-64-nonatomic-lo-hi.h> +#include <asm-generic/cacheflush.h> + #include "peripheral-loader.h" #define pil_err(desc, fmt, ...) \ @@ -254,17 +256,6 @@ static irqreturn_t proxy_unvote_intr_handler(int irq, void *dev_id) return IRQ_HANDLED; } -static int cma_region_is_removed(struct device *dev) -{ - struct device_node *np; - - np = of_parse_phandle(dev->of_node, "linux,contiguous-region", 0); - if (np) - return of_property_read_bool(np, "linux,remove-completely"); - - return 0; -} - static bool segment_is_relocatable(const struct elf32_phdr *p) { return !!(p->p_flags & BIT(27)); @@ -524,23 +515,16 @@ struct pil_map_fw_info { static void *map_fw_mem(phys_addr_t paddr, size_t size, void *data) { - struct pil_map_fw_info *info = data; void *base; - if (cma_region_is_removed(info->dev)) - base = ioremap(paddr, size); - else if (info && info->relocated && info->region) - base = info->region + (paddr - info->base_addr); + base = ioremap_nocache(paddr, size); return base; } static void unmap_fw_mem(void *vaddr, void *data) { - struct pil_map_fw_info *info = data; - - if (cma_region_is_removed(info->dev)) - iounmap(vaddr); + iounmap(vaddr); } static int pil_load_seg(struct pil_desc *desc, struct pil_seg *seg) @@ -549,78 +533,48 @@ static int pil_load_seg(struct pil_desc *desc, struct pil_seg *seg) phys_addr_t paddr; char fw_name[30]; int num = seg->num; - struct pil_map_fw_info map_fw_info = { - .relocated = seg->relocated, - .region = desc->priv->region, - .base_addr = desc->priv->region_start, - .dev = desc->dev, - }; const struct firmware *fw; - void *map_data = desc->map_data ? desc->map_data : &map_fw_info; if (seg->filesz) { snprintf(fw_name, ARRAY_SIZE(fw_name), "%s.b%02d", desc->name, num); + //pr_err("%s\n", fw_name); ret = request_firmware_direct(&fw, fw_name, desc->dev); - - pr_err("%s: memcpy to offset 0x%x\n", __func__, seg->paddr - desc->priv->region_start); - memcpy(desc->priv->region + (seg->paddr - desc->priv->region_start), - fw->data, seg->filesz); - wmb(); - -//, desc->dev, seg->paddr, -// seg->filesz, desc->map_fw_mem, -// desc->unmap_fw_mem, map_data); if (ret < 0) { pil_err(desc, "Failed to locate blob %s or blob is too big.\n", fw_name); return ret; } -#if 0 - if (ret != seg->filesz) { + if (fw->size != seg->filesz) { pil_err(desc, "Blob size %u doesn't match %lu\n", ret, seg->filesz); return -EPERM; } -#endif + + //pr_err("%s: memcpy to PA 0x%x len 0x%x\n", __func__, + //(u32)seg->paddr, (u32)seg->filesz); + memcpy(desc->priv->region + (seg->paddr - desc->priv->region_start), + fw->data, seg->filesz); + + + //print_hex_dump(KERN_ERR, "", DUMP_PREFIX_OFFSET, 16, 1, desc->priv->region + (seg->paddr - desc->priv->region_start), 48, true); + + wmb(); + flush_cache_all(); + release_firmware(fw); + ret = 0; - } + } //else + //pr_err("zero len seg\n"); /* Zero out trailing memory */ paddr = seg->paddr + seg->filesz; count = seg->sz - seg->filesz; - while (count > 0) { - int size, orig_size; - u8 __iomem *buf; - u8 bytes_before; - u8 bytes_after; - - orig_size = size = min_t(size_t, IOMAP_SIZE, count); - buf = desc->map_fw_mem(paddr, size, map_data); - if (!buf) { - pil_err(desc, "Failed to map memory\n"); - return -ENOMEM; - } - - if ((unsigned long)buf & 0x7) { - bytes_before = 8 - ((unsigned long)buf & 0x7); - memset_io(buf, 0, bytes_before); - size -= bytes_before; - buf += bytes_before; - } - - if (size & 0x7) { - bytes_after = size & 0x7; - memset_io(buf + size - bytes_after, 0, bytes_after); - size -= bytes_after; - } - memset(buf, 0, size); + if (count > 0) { + memset(desc->priv->region + paddr - desc->priv->region_start, 0, count); - desc->unmap_fw_mem(buf, map_data); - - count -= orig_size; - paddr += orig_size; + //pr_err("%s: zeroing PA 0x%x len %d\n", __func__, (u32)paddr, count); } if (desc->ops->verify_blob) { @@ -635,8 +589,6 @@ static int pil_load_seg(struct pil_desc *desc, struct pil_seg *seg) static int pil_parse_devicetree(struct pil_desc *desc) { int clk_ready = 0; -// !!! -#if 0 if (desc->ops->proxy_unvote && of_find_property(desc->dev->of_node, "qcom,gpio-proxy-unvote", @@ -659,7 +611,9 @@ static int pil_parse_devicetree(struct pil_desc *desc) return clk_ready; } } -#endif + + dev_err(desc->dev, "%s: completed OK\n", __func__); + desc->proxy_unvote_irq = clk_ready; return 0; } @@ -879,6 +833,8 @@ int pil_desc_init(struct pil_desc *desc) if (!desc->unmap_fw_mem) desc->unmap_fw_mem = unmap_fw_mem; + dev_err(desc->dev, "%s: completed OK\n", __func__); + return 0; err_parse_dt: ida_simple_remove(&pil_ida, priv->id); diff --git a/drivers/soc/qcom/smd.c b/drivers/soc/qcom/smd.c index 9b2ea99f048d..c6543bf329cd 100644 --- a/drivers/soc/qcom/smd.c +++ b/drivers/soc/qcom/smd.c @@ -47,6 +47,8 @@ #include "smd_private.h" #include "smem_private.h" +#define DEBUG + #define SMSM_SNAPSHOT_CNT 64 #define SMSM_SNAPSHOT_SIZE ((SMSM_NUM_ENTRIES + 1) * 4 + sizeof(uint64_t)) #define RSPIN_INIT_WAIT_MS 1000 @@ -163,33 +165,27 @@ void *smsm_log_ctx; #if defined(CONFIG_MSM_SMD_DEBUG) #define SMD_DBG(x...) do { \ - if (msm_smd_debug_mask & MSM_SMD_DEBUG) \ - IPC_LOG_SMD(KERN_DEBUG, x); \ + printk(KERN_DEBUG, x); \ } while (0) #define SMSM_DBG(x...) do { \ - if (msm_smd_debug_mask & MSM_SMSM_DEBUG) \ - IPC_LOG_SMSM(KERN_DEBUG, x); \ + printk(KERN_DEBUG, x); \ } while (0) #define SMD_INFO(x...) do { \ - if (msm_smd_debug_mask & MSM_SMD_INFO) \ - IPC_LOG_SMD(KERN_INFO, x); \ + printk(KERN_INFO, x); \ } while (0) #define SMSM_INFO(x...) do { \ - if (msm_smd_debug_mask & MSM_SMSM_INFO) \ - IPC_LOG_SMSM(KERN_INFO, x); \ + printk(KERN_INFO, x); \ } while (0) #define SMD_POWER_INFO(x...) do { \ - if (msm_smd_debug_mask & MSM_SMD_POWER_INFO) \ - IPC_LOG_SMD(KERN_INFO, x); \ + printk(KERN_INFO, x); \ } while (0) #define SMSM_POWER_INFO(x...) do { \ - if (msm_smd_debug_mask & MSM_SMSM_POWER_INFO) \ - IPC_LOG_SMSM(KERN_INFO, x); \ + printk(KERN_INFO, x); \ } while (0) #else #define SMD_DBG(x...) do { } while (0) diff --git a/net/wireless/db.txt b/net/wireless/db.txt index a2fc3a09ccdc..d0db7298cca9 100644 --- a/net/wireless/db.txt +++ b/net/wireless/db.txt @@ -1,17 +1,1001 @@ -# -# This file is a placeholder to prevent accidental build breakage if someone -# enables CONFIG_CFG80211_INTERNAL_REGDB. Almost no one actually needs to -# enable that build option. -# -# You should be using CRDA instead. It is even better if you use the CRDA -# package provided by your distribution, since they will probably keep it -# up-to-date on your behalf. -# -# If you _really_ intend to use CONFIG_CFG80211_INTERNAL_REGDB then you will -# need to replace this file with one containing appropriately formatted -# regulatory rules that cover the regulatory domains you will be using. Your -# best option is to extract the db.txt file from the wireless-regdb git -# repository: -# -# git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-regdb.git -# +# This is the world regulatory domain +country 00: + (2402 - 2472 @ 40), (3, 20) + # Channel 12 - 13. + (2457 - 2482 @ 40), (3, 20), PASSIVE-SCAN, NO-IBSS + # Channel 14. Only JP enables this and for 802.11b only + (2474 - 2494 @ 20), (3, 20), PASSIVE-SCAN, NO-IBSS, NO-OFDM + # Channel 36 - 48 + (5170 - 5250 @ 80), (3, 20), PASSIVE-SCAN, NO-IBSS + (5250 - 5330 @ 80), (3, 20), PASSIVE-SCAN, NO-IBSS + (5490 - 5710 @ 80), (3, 20), PASSIVE-SCAN, NO-IBSS + # NB: 5260 MHz - 5700 MHz requies DFS + # Channel 149 - 165 + (5735 - 5835 @ 80), (3, 20), PASSIVE-SCAN, NO-IBSS + # IEEE 802.11ad (60GHz), channels 1..3 + (57240 - 63720 @ 2160), (N/A, 0) + + +country AE: + (2402 - 2482 @ 40), (N/A, 20) + (5170 - 5250 @ 80), (3, 17) + (5250 - 5330 @ 80), (3, 24), DFS + (5490 - 5730 @ 80), (3, 24), DFS + (5735 - 5835 @ 80), (3, 30) + +country AL: + (2402 - 2482 @ 40), (N/A, 20) + (5150 - 5250 @ 80), (N/A, 20) + (5250 - 5350 @ 80), (N/A, 20), DFS + (5470 - 5725 @ 80), (N/A, 27), DFS + +country AM: + (2402 - 2482 @ 40), (N/A, 20) + (5170 - 5250 @ 20), (N/A, 18) + (5250 - 5330 @ 20), (N/A, 18), DFS + +country AN: + (2402 - 2482 @ 40), (N/A, 20) + (5170 - 5250 @ 80), (N/A, 20) + (5250 - 5330 @ 80), (N/A, 20), DFS + (5490 - 5710 @ 80), (N/A, 27), DFS + +country AR: + (2402 - 2482 @ 40), (N/A, 20) + (5170 - 5250 @ 80), (3, 17) + (5250 - 5330 @ 80), (3, 24), DFS + (5490 - 5730 @ 80), (3, 24), DFS + (5735 - 5835 @ 80), (3, 30) + +country AS: + (2402 - 2472 @ 40), (N/A, 30) + (5150 - 5250 @ 80), (6, 17) + (5250 - 5350 @ 80), (6, 24), DFS + (5470 - 5725 @ 80), (6, 24), DFS + (5725 - 5850 @ 80), (6, 30) + +country AT: DFS-ETSI + (2402 - 2482 @ 40), (N/A, 20) + (5170 - 5250 @ 80), (N/A, 20) + (5250 - 5330 @ 80), (N/A, 20), DFS + (5490 - 5710 @ 80), (N/A, 27), DFS + # 60 gHz band channels 1-4, ref: Etsi En 302 567 + (57240 - 65880 @ 2160), (N/A, 40), NO-OUTDOOR + +country AU: + (2402 - 2482 @ 40), (N/A, 20) + (5170 - 5250 @ 80), (3, 17) + (5250 - 5330 @ 80), (3, 24), DFS + (5490 - 5730 @ 80), (3, 24), DFS + (5735 - 5835 @ 80), (3, 30) + +country AW: + (2402 - 2482 @ 40), (N/A, 20) + (5170 - 5250 @ 40), (N/A, 20) + (5250 - 5330 @ 40), (N/A, 20), DFS + (5490 - 5710 @ 40), (N/A, 27), DFS + +country AZ: + (2402 - 2482 @ 40), (N/A, 20) + (5170 - 5250 @ 80), (N/A, 18) + (5250 - 5330 @ 80), (N/A, 18), DFS + +country BA: DFS-ETSI + (2402 - 2482 @ 40), (N/A, 20) + (5170 - 5250 @ 80), (N/A, 20) + (5250 - 5330 @ 80), (N/A, 20), DFS + (5490 - 5710 @ 80), (N/A, 27), DFS + # 60 gHz band channels 1-4, ref: Etsi En 302 567 + (57240 - 65880 @ 2160), (N/A, 40), NO-OUTDOOR + +country BB: + (2402 - 2482 @ 40), (N/A, 20) + (5170 - 5250 @ 80), (3, 23) + (5250 - 5330 @ 80), (3, 23), DFS + (5735 - 5835 @ 80), (3, 30) + +country BD: + (2402 - 2482 @ 40), (N/A, 20) + (5725 - 5850 @ 80), (N/A, 30) + +country BE: DFS-ETSI + (2402 - 2482 @ 40), (N/A, 20) + (5170 - 5250 @ 80), (N/A, 20) + (5250 - 5330 @ 80), (N/A, 20), DFS + (5490 - 5710 @ 80), (N/A, 27), DFS + # 60 gHz band channels 1-4, ref: Etsi En 302 567 + (57240 - 65880 @ 2160), (N/A, 40), NO-OUTDOOR + +country BG: DFS-ETSI + (2402 - 2482 @ 40), (N/A, 20) + (5170 - 5250 @ 80), (N/A, 23) + (5250 - 5290 @ 80), (N/A, 23), DFS + (5490 - 5710 @ 80), (N/A, 30), DFS + # 60 gHz band channels 1-4, ref: Etsi En 302 567 + (57240 - 65880 @ 2160), (N/A, 40), NO-OUTDOOR + +country BH: + (2402 - 2482 @ 40), (N/A, 20) + (5170 - 5250 @ 20), (N/A, 20) + (5250 - 5330 @ 20), (N/A, 20), DFS + (5735 - 5835 @ 20), (N/A, 20) + +country BM: + (2402 - 2472 @ 40), (N/A, 30) + (5150 - 5250 @ 80), (6, 17) + (5250 - 5350 @ 80), (6, 24), DFS + (5470 - 5725 @ 80), (6, 24), DFS + (5725 - 5850 @ 80), (6, 30) + +country BN: + (2402 - 2482 @ 40), (N/A, 20) + (5170 - 5250 @ 80), (N/A, 20) + (5250 - 5330 @ 80), (N/A, 20), DFS + (5735 - 5835 @ 80), (N/A, 30) + +country BO: + (2402 - 2482 @ 40), (N/A, 30) + (5735 - 5835 @ 80), (N/A, 30) + +country BR: + (2402 - 2482 @ 40), (N/A, 20) + (5170 - 5250 @ 80), (3, 17) + (5250 - 5330 @ 80), (3, 24), DFS + (5490 - 5730 @ 80), (3, 24), DFS + (5735 - 5835 @ 80), (3, 30) + +country BS: + (2402 - 2482 @ 40), (N/A, 20) + (5150 - 5250 @ 80), (6, 17) + (5250 - 5350 @ 80), (6, 24), DFS + (5470 - 5725 @ 80), (6, 24), DFS + (5725 - 5850 @ 80), (6, 30) + +country BY: + (2402 - 2482 @ 40), (N/A, 20) + (5170 - 5250 @ 80), (N/A, 20) + (5250 - 5330 @ 80), (N/A, 20), DFS + (5490 - 5710 @ 80), (N/A, 27), DFS + +country BZ: + (2402 - 2482 @ 40), (N/A, 30) + (5735 - 5835 @ 80), (N/A, 30) + +country CA: + (2402 - 2472 @ 40), (N/A, 27) + (5170 - 5250 @ 80), (3, 17) + (5250 - 5330 @ 80), (3, 24), DFS + (5490 - 5730 @ 80), (3, 24), DFS + (5735 - 5835 @ 80), (3, 30) + +country CH: DFS-ETSI + (2402 - 2482 @ 40), (N/A, 20) + (5170 - 5250 @ 80), (N/A, 20) + (5250 - 5330 @ 80), (N/A, 20), DFS + (5490 - 5710 @ 80), (N/A, 27), DFS + # 60 gHz band channels 1-4, ref: Etsi En 302 567 + (57240 - 65880 @ 2160), (N/A, 40), NO-OUTDOOR + +country CL: + (2402 - 2482 @ 40), (N/A, 20) + (5170 - 5250 @ 80), (N/A, 20) + (5250 - 5330 @ 80), (N/A, 20), DFS + (5735 - 5835 @ 80), (N/A, 20) + +country CN: + (2402 - 2482 @ 40), (N/A, 20) + (5150 - 5250 @ 80), (6, 23) + (5250 - 5350 @ 80), (6, 23), DFS + (5725 - 5850 @ 80), (6, 30) + (5735 - 5835 @ 80), (N/A, 30) + # 60 gHz band channels 1,4: 28dBm, channels 2,3: 44dBm + # ref: http://www.miit.gov.cn/n11293472/n11505629/n11506593/n11960250/n11960606/n11960700/n12330791.files/n12330790.pdf + (57240 - 59400 @ 2160), (N/A, 28) + (59400 - 63720 @ 2160), (N/A, 44) + (63720 - 65880 @ 2160), (N/A, 28) + +country CO: + (2402 - 2472 @ 40), (N/A, 27) + (5170 - 5250 @ 80), (3, 17) + (5250 - 5330 @ 80), (3, 24), DFS + (5490 - 5730 @ 80), (3, 24), DFS + (5735 - 5835 @ 80), (3, 30) + +country CR: + (2402 - 2482 @ 40), (N/A, 20) + (5170 - 5250 @ 20), (3, 17) + (5250 - 5330 @ 20), (3, 24), DFS + (5490 - 5730 @ 20), (3, 24), DFS + (5735 - 5835 @ 20), (3, 30) + +country CY: DFS-ETSI + (2402 - 2482 @ 40), (N/A, 20) + (5170 - 5250 @ 80), (N/A, 20) + (5250 - 5330 @ 80), (N/A, 20), DFS + (5490 - 5710 @ 80), (N/A, 27), DFS + # 60 gHz band channels 1-4, ref: Etsi En 302 567 + (57240 - 65880 @ 2160), (N/A, 40), NO-OUTDOOR + +# Data from http://www.ctu.eu/164/download/VOR/VOR-12-08-2005-34.pdf +# and http://www.ctu.eu/164/download/VOR/VOR-12-05-2007-6-AN.pdf +# Power at 5250 - 5350 MHz and 5470 - 5725 MHz can be doubled if TPC is +# implemented. +country CZ: DFS-ETSI + (2400 - 2483.5 @ 40), (N/A, 100 mW) + (5150 - 5250 @ 80), (N/A, 200 mW), NO-OUTDOOR + (5250 - 5350 @ 80), (N/A, 100 mW), NO-OUTDOOR, DFS + (5470 - 5725 @ 80), (N/A, 500 mW), DFS + # 60 gHz band channels 1-4, ref: Etsi En 302 567 + (57240 - 65880 @ 2160), (N/A, 40), NO-OUTDOOR + +# Data from "Frequenznutzungsplan" (as published in April 2008), downloaded from +# http://www.bundesnetzagentur.de/cae/servlet/contentblob/38448/publicationFile/2659/Frequenznutzungsplan2008_Id17448pdf.pdf +# For the 5GHz range also see +# http://www.bundesnetzagentur.de/cae/servlet/contentblob/38216/publicationFile/6579/WLAN5GHzVfg7_2010_28042010pdf.pdf +# The values have been reduced by a factor of 2 (3db) for non TPC devices +# (in other words: devices with TPC can use twice the tx power of this table). +# Note that the docs do not require TPC for 5150--5250; the reduction to +# 100mW thus is not strictly required -- however the conservative 100mW +# limit is used here as the non-interference with radar and satellite +# apps relies on the attenuation by the building walls only in the +# absence of DFS; the neighbour countries have 100mW limit here as well. + +country DE: DFS-ETSI + # entries 279004 and 280006 + (2400 - 2483.5 @ 40), (N/A, 100 mW) + # entry 303005 + (5150 - 5250 @ 80), (N/A, 100 mW), NO-OUTDOOR + # entries 304002 and 305002 + (5250 - 5350 @ 80), (N/A, 100 mW), NO-OUTDOOR, DFS + # entries 308002, 309001 and 310003 + (5470 - 5725 @ 80), (N/A, 500 mW), DFS + # 60 gHz band channels 1-4, ref: Etsi En 302 567 + (57240 - 65880 @ 2160), (N/A, 40), NO-OUTDOOR + +country DK: DFS-ETSI + (2402 - 2482 @ 40), (N/A, 20) + (5170 - 5250 @ 80), (N/A, 20) + (5250 - 5330 @ 80), (N/A, 20), DFS + (5490 - 5710 @ 80), (N/A, 27), DFS + # 60 gHz band channels 1-4, ref: Etsi En 302 567 + (57240 - 65880 @ 2160), (N/A, 40), NO-OUTDOOR + +country DO: + (2402 - 2472 @ 40), (N/A, 27) + (5170 - 5250 @ 80), (3, 17) + (5250 - 5330 @ 80), (3, 23), DFS + (5735 - 5835 @ 80), (3, 30) + +country DZ: + (2402 - 2482 @ 40), (N/A, 20) + (5150 - 5250 @ 80), (N/A, 23) + (5250 - 5350 @ 80), (N/A,23), DFS + (5470 - 5670 @ 80), (N/A, 20), DFS + +country EC: + (2402 - 2482 @ 40), (N/A, 20) + (5170 - 5250 @ 20), (3, 17) + (5250 - 5330 @ 20), (3, 24), DFS + (5490 - 5730 @ 20), (3, 24), DFS + (5735 - 5835 @ 20), (3, 30) + +country EE: DFS-ETSI + (2402 - 2482 @ 40), (N/A, 20) + (5170 - 5250 @ 80), (N/A, 20) + (5250 - 5330 @ 80), (N/A, 20), DFS + (5490 - 5710 @ 80), (N/A, 27), DFS + # 60 gHz band channels 1-4, ref: Etsi En 302 567 + (57240 - 65880 @ 2160), (N/A, 40), NO-OUTDOOR + +country EG: + (2402 - 2482 @ 40), (N/A, 20) + (5170 - 5250 @ 20), (N/A, 20) + (5250 - 5330 @ 20), (N/A, 20), DFS + +country ES: DFS-ETSI + (2400 - 2483.5 @ 40), (N/A, 100 mW) + (5150 - 5250 @ 80), (N/A, 100 mW), NO-OUTDOOR + (5250 - 5350 @ 80), (N/A, 100 mW), NO-OUTDOOR, DFS + (5470 - 5725 @ 80), (N/A, 500 mW), DFS + # 60 gHz band channels 1-4, ref: Etsi En 302 567 + (57240 - 65880 @ 2160), (N/A, 40), NO-OUTDOOR + +country ET: DFS-ETSI + (2402 - 2482 @ 40), (N/A, 20) + (5170 - 5250 @ 80), (N/A, 20) + (5250 - 5330 @ 80), (N/A, 20), DFS + (5490 - 5710 @ 80), (N/A, 27), DFS + +country FI: DFS-ETSI + (2402 - 2482 @ 40), (N/A, 20) + (5170 - 5250 @ 80), (N/A, 20) + (5250 - 5330 @ 80), (N/A, 20), DFS + (5490 - 5710 @ 80), (N/A, 27), DFS + # 60 gHz band channels 1-4, ref: Etsi En 302 567 + (57240 - 65880 @ 2160), (N/A, 40), NO-OUTDOOR + +country FR: DFS-ETSI + (2402 - 2482 @ 40), (N/A, 20) + (5170 - 5250 @ 80), (N/A, 20) + (5250 - 5330 @ 80), (N/A, 20), DFS + (5490 - 5710 @ 80), (N/A, 27), DFS + # 60 gHz band channels 1-4, ref: Etsi En 302 567 + (57240 - 65880 @ 2160), (N/A, 40), NO-OUTDOOR + +country GF: + (2402 - 2482 @ 40), (N/A, 20) + (5150 - 5250 @ 80), (N/A, 20) + (5250 - 5350 @ 80), (N/A, 20), DFS + (5470 - 5725 @ 80), (N/A, 20), DFS + +country GE: + (2402 - 2482 @ 40), (N/A, 20) + (5170 - 5250 @ 80), (N/A, 18) + (5250 - 5330 @ 80), (N/A, 18), DFS + # 60 gHz band channels 1-4, ref: Etsi En 302 567 + (57240 - 65880 @ 2160), (N/A, 40), NO-OUTDOOR + +country GB: DFS-ETSI + (2402 - 2482 @ 40), (N/A, 20) + (5170 - 5250 @ 80), (N/A, 20) + (5250 - 5330 @ 80), (N/A, 20), DFS + (5490 - 5710 @ 80), (N/A, 27), DFS + # 60 gHz band channels 1-4, ref: Etsi En 302 567 + (57240 - 65880 @ 2160), (N/A, 40), NO-OUTDOOR + +country GD: + (2402 - 2472 @ 40), (3, 30) + (5170 - 5250 @ 80), (6, 17) + (5250 - 5330 @ 80), (6, 24), DFS + (5490 - 5730 @ 80), (6, 24), DFS + (5735 - 5835 @ 80), (6, 30) + +country GP: + (2402 - 2482 @ 40), (N/A, 20) + (5150 - 5250 @ 80), (N/A, 20) + (5250 - 5350 @ 80), (N/A, 20), DFS + (5470 - 5725 @ 80), (N/A, 27), DFS + +country GR: DFS-ETSI + (2402 - 2482 @ 40), (N/A, 20) + (5170 - 5250 @ 80), (N/A, 20) + (5250 - 5330 @ 80), (N/A, 20), DFS + (5490 - 5710 @ 80), (N/A, 27), DFS + # 60 gHz band channels 1-4, ref: Etsi En 302 567 + (57240 - 65880 @ 2160), (N/A, 40), NO-OUTDOOR + +country GL: DFS-ETSI + (2402 - 2482 @ 40), (N/A, 20) + (5170 - 5250 @ 20), (N/A, 20) + (5250 - 5330 @ 20), (N/A, 20), DFS + (5490 - 5710 @ 20), (N/A, 27), DFS + +country GT: + (2402 - 2472 @ 40), (3, 30) + (5170 - 5250 @ 80), (6, 17) + (5250 - 5330 @ 80), (6, 23), DFS + (5735 - 5835 @ 80), (6, 30) + +country GU: + (2402 - 2472 @ 40), (3, 30) + (5170 - 5250 @ 20), (6, 17) + (5250 - 5330 @ 20), (6, 24), DFS + (5490 - 5730 @ 20), (6, 24), DFS + (5735 - 5835 @ 20), (6, 30) + +country HN: + (2402 - 2482 @ 40), (N/A, 20) + (5170 - 5250 @ 80), (6, 17) + (5250 - 5330 @ 80), (6, 24), DFS + (5490 - 5730 @ 80), (6, 24), DFS + (5735 - 5835 @ 80), (6, 30) + +country HK: + (2402 - 2482 @ 40), (N/A, 20) + (5170 - 5250 @ 80), (6, 17) + (5250 - 5330 @ 80), (6, 24), DFS + (5490 - 5730 @ 80), (6, 24), DFS + (5735 - 5835 @ 80), (6, 30) + +country HR: DFS-ETSI + (2402 - 2482 @ 40), (N/A, 20) + (5170 - 5250 @ 80), (N/A, 20) + (5250 - 5330 @ 80), (N/A, 20), DFS + (5490 - 5710 @ 80), (N/A, 27), DFS + # 60 gHz band channels 1-4, ref: Etsi En 302 567 + (57240 - 65880 @ 2160), (N/A, 40), NO-OUTDOOR + +country HT: + (2402 - 2482 @ 40), (N/A, 20) + (5170 - 5250 @ 80), (N/A, 20) + (5250 - 5330 @ 80), (N/A, 20), DFS + (5490 - 5710 @ 80), (N/A, 27), DFS + +country HU: DFS-ETSI + (2402 - 2482 @ 40), (N/A, 20) + (5170 - 5250 @ 80), (N/A, 20) + (5250 - 5330 @ 80), (N/A, 20), DFS + (5490 - 5710 @ 80), (N/A, 27), DFS + # 60 gHz band channels 1-4, ref: Etsi En 302 567 + (57240 - 65880 @ 2160), (N/A, 40), NO-OUTDOOR + +country ID: + # ref: http://www.postel.go.id/content/ID/regulasi/standardisasi/kepdir/bwa%205,8%20ghz.pdf + (2402 - 2482 @ 20), (N/A, 20) + (5735 - 5815 @ 20), (N/A, 23) + +country IE: DFS-ETSI + (2402 - 2482 @ 40), (N/A, 20) + (5170 - 5250 @ 80), (N/A, 20) + (5250 - 5330 @ 80), (N/A, 20), DFS + (5490 - 5710 @ 80), (N/A, 27), DFS + # 60 gHz band channels 1-4, ref: Etsi En 302 567 + (57240 - 65880 @ 2160), (N/A, 40), NO-OUTDOOR + +country IL: + (2402 - 2482 @ 40), (N/A, 20) + (5150 - 5250 @ 80), (N/A, 200 mW), NO-OUTDOOR + (5250 - 5350 @ 80), (N/A, 200 mW), NO-OUTDOOR, DFS + +country IN: + (2402 - 2482 @ 40), (N/A, 20) + (5170 - 5250 @ 80), (N/A, 20) + (5250 - 5330 @ 80), (N/A, 20), DFS + (5735 - 5835 @ 80), (N/A, 20) + +country IS: DFS-ETSI + (2402 - 2482 @ 40), (N/A, 20) + (5170 - 5250 @ 80), (N/A, 20) + (5250 - 5330 @ 80), (N/A, 20), DFS + (5490 - 5710 @ 80), (N/A, 27), DFS + # 60 gHz band channels 1-4, ref: Etsi En 302 567 + (57240 - 65880 @ 2160), (N/A, 40), NO-OUTDOOR + +country IR: + (2402 - 2482 @ 40), (N/A, 20) + (5735 - 5835 @ 80), (N/A, 30) + +country IT: DFS-ETSI + (2402 - 2482 @ 40), (N/A, 20) + (5170 - 5250 @ 80), (N/A, 20) + (5250 - 5330 @ 80), (N/A, 20), DFS + (5490 - 5710 @ 80), (N/A, 27), DFS + # 60 gHz band channels 1-4, ref: Etsi En 302 567 + (57240 - 65880 @ 2160), (N/A, 40), NO-OUTDOOR + +country JM: + (2402 - 2482 @ 40), (N/A, 20) + (5170 - 5250 @ 80), (6, 17) + (5250 - 5330 @ 80), (6, 24), DFS + (5490 - 5730 @ 80), (6, 24), DFS + (5735 - 5835 @ 80), (6, 30) + +country JP: + (2402 - 2482 @ 40), (N/A, 20) + (2474 - 2494 @ 20), (N/A, 20), NO-OFDM + (4910 - 4990 @ 40), (N/A, 23) + (5030 - 5090 @ 40), (N/A, 23) + (5170 - 5250 @ 80), (N/A, 20) + (5250 - 5330 @ 80), (N/A, 20), DFS + (5490 - 5710 @ 160), (N/A, 23), DFS + +country JO: + (2402 - 2482 @ 40), (N/A, 20) + (5150 - 5250 @ 80), (N/A, 23) + (5725 - 5850 @ 80), (N/A, 23) + +country KE: + (2402 - 2482 @ 40), (N/A, 20) + (5150 - 5250 @ 80), (N/A, 23) + (5470 - 5570 @ 80), (N/A, 30), DFS + (5725 - 5775 @ 80), (N/A, 23) + +country KH: + (2402 - 2482 @ 40), (N/A, 20) + (5170 - 5250 @ 80), (N/A, 20) + (5250 - 5330 @ 80), (N/A, 20), DFS + (5490 - 5710 @ 80), (N/A, 27), DFS + +country KY: + (2402 - 2472 @ 40), (N/A, 27) + (5170 - 5250 @ 80), (3, 17) + (5250 - 5330 @ 80), (3, 24), DFS + (5490 - 5730 @ 80), (3, 24), DFS + (5735 - 5835 @ 80), (3, 30) + +country KP: + (2402 - 2482 @ 20), (N/A, 20) + (5170 - 5330 @ 20), (6, 20) + (5160 - 5250 @ 20), (6, 20), DFS + (5490 - 5630 @ 20), (6, 30), DFS + (5735 - 5815 @ 20), (6, 30) + +country KR: + (2402 - 2482 @ 20), (N/A, 20) + (5150 - 5250 @ 80), (6, 20) + (5250 - 5350 @ 80), (6, 20), DFS + (5470 - 5725 @ 80), (6, 30), DFS + (5725 - 5825 @ 80), (6, 30) + +country KW: + (2402 - 2482 @ 40), (N/A, 20) + (5170 - 5250 @ 80), (N/A, 20) + (5250 - 5330 @ 80), (N/A, 20), DFS + +country KZ: + (2402 - 2482 @ 40), (N/A, 20) + +country LB: + (2402 - 2482 @ 40), (N/A, 20) + (5150 - 5250 @ 80), (6, 17) + (5250 - 5350 @ 80), (6, 24), DFS + (5470 - 5725 @ 80), (6, 24), DFS + (5725 - 5850 @ 80), (6, 30) + +country LI: DFS-ETSI + (2402 - 2482 @ 40), (N/A, 20) + (5170 - 5250 @ 80), (N/A, 20) + (5250 - 5330 @ 80), (N/A, 20), DFS + (5490 - 5710 @ 80), (N/A, 27), DFS + +country LK: + (2402 - 2482 @ 40), (N/A, 20) + (5170 - 5250 @ 20), (3, 17) + (5250 - 5330 @ 20), (3, 20), DFS + (5490 - 5730 @ 20), (3, 20), DFS + (5735 - 5835 @ 20), (3, 30) + +country LT: DFS-ETSI + (2402 - 2482 @ 40), (N/A, 20) + (5170 - 5250 @ 80), (N/A, 20) + (5250 - 5330 @ 80), (N/A, 20), DFS + (5490 - 5710 @ 80), (N/A, 27), DFS + # 60 gHz band channels 1-4, ref: Etsi En 302 567 + (57240 - 65880 @ 2160), (N/A, 40), NO-OUTDOOR + +country LU: DFS-ETSI + (2402 - 2482 @ 40), (N/A, 20) + (5170 - 5250 @ 80), (N/A, 20) + (5250 - 5330 @ 80), (N/A, 20), DFS + (5490 - 5710 @ 80), (N/A, 27), DFS + # 60 gHz band channels 1-4, ref: Etsi En 302 567 + (57240 - 65880 @ 2160), (N/A, 40), NO-OUTDOOR + +country LV: DFS-ETSI + (2402 - 2482 @ 40), (N/A, 20) + (5170 - 5250 @ 80), (N/A, 20) + (5250 - 5330 @ 80), (N/A, 20), DFS + (5490 - 5710 @ 80), (N/A, 27), DFS + # 60 gHz band channels 1-4, ref: Etsi En 302 567 + (57240 - 65880 @ 2160), (N/A, 40), NO-OUTDOOR + +country MC: DFS-ETSI + (2402 - 2482 @ 40), (N/A, 20) + (5150 - 5250 @ 80), (N/A, 20) + (5250 - 5350 @ 80), (N/A, 20), DFS + (5470 - 5725 @ 80), (N/A, 27), DFS + +country MA: + (2402 - 2482 @ 40), (N/A, 20) + (5170 - 5250 @ 80), (N/A, 20) + (5735 - 5835 @ 80), (N/A, 20), DFS + +country MO: + (2402 - 2482 @ 40), (N/A, 20) + (5170 - 5250 @ 40), (3, 23) + (5250 - 5330 @ 40), (3, 23), DFS + (5735 - 5835 @ 40), (3, 30) + +country MP: + (2402 - 2472 @ 40), (N/A, 30) + (5150 - 5250 @ 80), (6, 17) + (5250 - 5350 @ 80), (6, 24), DFS + (5470 - 5725 @ 80), (6, 24), DFS + (5725 - 5850 @ 80), (6, 30) + +country MK: DFS-ETSI + (2402 - 2482 @ 40), (N/A, 20) + (5170 - 5250 @ 40), (N/A, 20) + (5250 - 5330 @ 40), (N/A, 20), DFS + (5490 - 5710 @ 40), (N/A, 27), DFS + # 60 gHz band channels 1-4, ref: Etsi En 302 567 + (57240 - 65880 @ 2160), (N/A, 40), NO-OUTDOOR + +country MN: + (2402 - 2482 @ 40), (N/A, 20) + (5150 - 5250 @ 80), (6, 17) + (5250 - 5350 @ 80), (6, 24), DFS + (5470 - 5725 @ 80), (6, 24), DFS + (5725 - 5850 @ 80), (6, 30) + +country MT: DFS-ETSI + (2402 - 2482 @ 40), (N/A, 20) + (5170 - 5250 @ 40), (N/A, 20) + (5250 - 5330 @ 40), (N/A, 20), DFS + (5490 - 5710 @ 40), (N/A, 27), DFS + # 60 gHz band channels 1-4, ref: Etsi En 302 567 + (57240 - 65880 @ 2160), (N/A, 40), NO-OUTDOOR + +country MQ: DFS-ETSI + (2402 - 2482 @ 40), (N/A, 20) + (5150 - 5250 @ 80), (N/A, 20) + (5250 - 5350 @ 80), (N/A, 20), DFS + (5470 - 5725 @ 80), (N/A, 27), DFS + +country MU: + (2402 - 2482 @ 40), (N/A, 20) + (5150 - 5250 @ 80), (6, 17) + (5250 - 5350 @ 80), (6, 24), DFS + (5470 - 5725 @ 80), (6, 24), DFS + (5725 - 5850 @ 80), (6, 30) + +country MY: + (2402 - 2482 @ 40), (N/A, 20) + (5170 - 5250 @ 80), (N/A, 17) + (5250 - 5330 @ 80), (N/A, 23), DFS + (5735 - 5835 @ 80), (N/A, 30) + +country MX: + (2402 - 2472 @ 40), (3, 27) + (5170 - 5250 @ 80), (3, 17) + (5250 - 5330 @ 80), (3, 24), DFS + (5490 - 5730 @ 80), (3, 24), DFS + (5735 - 5835 @ 80), (3, 30) + +country MW: + (2402 - 2482 @ 40), (N/A, 20) + (5150 - 5250 @ 80), (N/A, 20) + (5250 - 5350 @ 80), (N/A, 20), DFS + (5470 - 5725 @ 80), (N/A, 27), DFS + +country NG: + (2402 - 2482 @ 40), (N/A, 20) + (5250 - 5350 @ 80), (N/A, 30), DFS + (5725 - 5850 @ 80), (N/A, 30) + +country NI: + (2402 - 2472 @ 40), (N/A, 30) + (5150 - 5250 @ 80), (6, 17) + (5250 - 5350 @ 80), (6, 24), DFS + (5470 - 5725 @ 80), (6, 24), DFS + (5725 - 5850 @ 80), (6, 30) + +country NL: DFS-ETSI + (2402 - 2482 @ 40), (N/A, 20) + (5170 - 5250 @ 80), (N/A, 20), NO-OUTDOOR + (5250 - 5330 @ 80), (N/A, 20), NO-OUTDOOR, DFS + (5490 - 5710 @ 80), (N/A, 27), DFS + # 60 gHz band channels 1-4, ref: Etsi En 302 567 + (57240 - 65880 @ 2160), (N/A, 40), NO-OUTDOOR + +country NO: DFS-ETSI + (2402 - 2482 @ 40), (N/A, 20) + (5170 - 5250 @ 80), (N/A, 20) + (5250 - 5330 @ 80), (N/A, 20), DFS + (5490 - 5710 @ 80), (N/A, 27), DFS + # 60 gHz band channels 1-4, ref: Etsi En 302 567 + (57240 - 65880 @ 2160), (N/A, 40), NO-OUTDOOR + +country NP: + (2402 - 2482 @ 40), (N/A, 20) + (5150 - 5250 @ 80), (N/A, 20) + (5250 - 5350 @ 80), (N/A, 20), DFS + (5725 - 5850 @ 80), (N/A, 20) + +country NZ: + (2402 - 2482 @ 40), (N/A, 30) + (5170 - 5250 @ 80), (6, 17) + (5250 - 5330 @ 80), (6, 24), DFS + (5490 - 5730 @ 80), (6, 24), DFS + (5735 - 5835 @ 80), (6, 30) + +country OM: + (2402 - 2482 @ 40), (N/A, 20) + (5150 - 5250 @ 80), (N/A, 20) + (5250 - 5350 @ 80), (N/A, 20), DFS + (5470 - 5725 @ 80), (N/A, 27), DFS + +country PA: + (2402 - 2472 @ 40), (N/A, 30) + (5170 - 5250 @ 80), (6, 17) + (5250 - 5330 @ 80), (6, 23), DFS + (5735 - 5835 @ 80), (6, 30) + +country PE: + (2402 - 2482 @ 40), (N/A, 20) + (5170 - 5250 @ 80), (6, 20) + (5250 - 5330 @ 80), (6, 20), DFS + (5490 - 5730 @ 80), (6, 27), DFS + (5735 - 5835 @ 80), (6, 30) + +country PF: + (2402 - 2482 @ 40), (N/A, 20) + (5150 - 5250 @ 80), (N/A, 20) + (5250 - 5350 @ 80), (N/A, 20), DFS + (5470 - 5725 @ 80), (N/A, 27), DFS + +country PG: + (2402 - 2482 @ 40), (N/A, 20) + (5150 - 5250 @ 80), (6, 17) + (5250 - 5350 @ 80), (6, 24), DFS + (5470 - 5725 @ 80), (6, 24), DFS + (5725 - 5850 @ 80), (6, 30) + +country PH: + (2402 - 2482 @ 40), (N/A, 20) + (5170 - 5250 @ 80), (6, 17) + (5250 - 5330 @ 80), (6, 24), DFS + (5490 - 5730 @ 80), (6, 24), DFS + (5735 - 5835 @ 80), (6, 30) + +country PK: + (2402 - 2482 @ 40), (N/A, 20) + (5735 - 5835 @ 80), (N/A, 30) + +country PL: DFS-ETSI + (2402 - 2482 @ 40), (N/A, 20) + (5170 - 5250 @ 80), (N/A, 20) + (5250 - 5330 @ 80), (N/A, 20), DFS + (5490 - 5710 @ 80), (N/A, 27), DFS + # 60 gHz band channels 1-4, ref: Etsi En 302 567 + (57240 - 65880 @ 2160), (N/A, 40), NO-OUTDOOR + +country PT: DFS-ETSI + (2402 - 2482 @ 40), (N/A, 20) + (5170 - 5250 @ 80), (N/A, 20) + (5250 - 5330 @ 80), (N/A, 20), DFS + (5490 - 5710 @ 80), (N/A, 27), DFS + # 60 gHz band channels 1-4, ref: Etsi En 302 567 + (57240 - 65880 @ 2160), (N/A, 40), NO-OUTDOOR + +country PR: + (2402 - 2472 @ 40), (3, 30) + (5170 - 5250 @ 80), (6, 17) + (5250 - 5330 @ 80), (6, 24), DFS + (5490 - 5730 @ 80), (6, 24), DFS + (5735 - 5835 @ 80), (6, 30) + +country PY: + (2402 - 2482 @ 40), (N/A, 20) + (5150 - 5250 @ 80), (6, 17) + (5250 - 5350 @ 80), (6, 24), DFS + (5470 - 5725 @ 80), (6, 24), DFS + (5725 - 5850 @ 80), (6, 30) + +country QA: + (2402 - 2482 @ 40), (N/A, 20) + (5735 - 5835 @ 80), (N/A, 30) + +country RE: + (2402 - 2482 @ 40), (N/A, 20) + (5150 - 5250 @ 80), (N/A, 20) + (5250 - 5350 @ 80), (N/A, 20), DFS + (5470 - 5725 @ 80), (N/A, 27), DFS + +country RO: DFS-ETSI + (2402 - 2482 @ 40), (N/A, 20) + (5170 - 5250 @ 80), (N/A, 20) + (5250 - 5330 @ 80), (N/A, 20), DFS + (5490 - 5710 @ 80), (N/A, 27), DFS + # 60 gHz band channels 1-4, ref: Etsi En 302 567 + (57240 - 65880 @ 2160), (N/A, 40), NO-OUTDOOR + + +# Source: +# http://www.ratel.rs/upload/documents/Plan_namene/Plan_namene-sl_glasnik.pdf +country RS: + (2400 - 2483.5 @ 40), (N/A, 100 mW) + (5150 - 5250 @ 80), (N/A, 200 mW), NO-OUTDOOR + (5250 - 5350 @ 80), (N/A, 200 mW), DFS + (5470 - 5725 @ 80), (3, 1000 mW), DFS + # 60 gHz band channels 1-4, ref: Etsi En 302 567 + (57240 - 65880 @ 2160), (N/A, 40), NO-OUTDOOR + +country RU: + (2402 - 2482 @ 40), (N/A, 20) + (5150 - 5250 @ 40), (N/A, 20) + (5250 - 5350 @ 40), (N/A, 20), DFS + (5650 - 5725 @ 40), (N/A, 30), DFS + (5725 - 5825 @ 40), (N/A, 30) + +country RW: + (2402 - 2482 @ 40), (N/A, 20) + (5150 - 5250 @ 80), (6, 17) + (5250 - 5330 @ 80), (6, 24), DFS + (5470 - 5725 @ 80), (6, 24), DFS + (5725 - 5835 @ 80), (6, 30) + +country SA: + (2402 - 2482 @ 40), (N/A, 20) + (5170 - 5250 @ 80), (3, 17) + (5250 - 5330 @ 80), (3, 24), DFS + (5490 - 5710 @ 80), (3, 24), DFS + (5735 - 5835 @ 80), (3, 30) + +country SE: DFS-ETSI + (2402 - 2482 @ 40), (N/A, 20) + (5170 - 5250 @ 80), (N/A, 20) + (5250 - 5330 @ 80), (N/A, 20), DFS + (5490 - 5710 @ 80), (N/A, 27), DFS + # 60 gHz band channels 1-4, ref: Etsi En 302 567 + (57240 - 65880 @ 2160), (N/A, 40), NO-OUTDOOR + +country SG: + (2402 - 2482 @ 40), (N/A, 20) + (5170 - 5250 @ 80), (6, 17) + (5250 - 5330 @ 80), (6, 24), DFS + (5490 - 5730 @ 80), (6, 24), DFS + (5735 - 5835 @ 80), (6, 30) + +country SI: DFS-ETSI + (2402 - 2482 @ 40), (N/A, 20) + (5170 - 5250 @ 80), (N/A, 20) + (5250 - 5330 @ 80), (N/A, 20), DFS + (5490 - 5710 @ 80), (N/A, 27), DFS + # 60 gHz band channels 1-4, ref: Etsi En 302 567 + (57240 - 65880 @ 2160), (N/A, 40), NO-OUTDOOR + +country SK: DFS-ETSI + (2402 - 2482 @ 40), (N/A, 20) + (5170 - 5250 @ 80), (N/A, 20) + (5250 - 5330 @ 80), (N/A, 20), DFS + (5490 - 5710 @ 80), (N/A, 27), DFS + # 60 gHz band channels 1-4, ref: Etsi En 302 567 + (57240 - 65880 @ 2160), (N/A, 40), NO-OUTDOOR + +country SR: DFS-ETSI + (2400 - 2483.5 @ 40), (N/A, 100 mW) + (5150 - 5250 @ 80), (N/A, 100 mW), NO-OUTDOOR + (5250 - 5350 @ 80), (N/A, 100 mW), NO-OUTDOOR, DFS + (5470 - 5725 @ 80), (N/A, 500 mW), DFS + +country SV: + (2402 - 2482 @ 40), (N/A, 20) + (5170 - 5250 @ 20), (3, 17) + (5250 - 5330 @ 20), (3, 23), DFS + (5735 - 5835 @ 20), (3, 30) + +country SY: + (2402 - 2482 @ 40), (N/A, 20) + +country TW: + (2402 - 2472 @ 40), (3, 27) + (5270 - 5330 @ 40), (6, 17), DFS + (5490 - 5730 @ 80), (6, 30), DFS + (5735 - 5815 @ 80), (6, 30) + +country TH: + (2402 - 2482 @ 40), (N/A, 20) + (5170 - 5250 @ 80), (3, 17) + (5250 - 5330 @ 80), (3, 24), DFS + (5490 - 5730 @ 80), (3, 24), DFS + (5735 - 5835 @ 80), (3, 30) + +country TT: + (2402 - 2482 @ 40), (N/A, 20) + (5170 - 5250 @ 40), (3, 17) + (5250 - 5330 @ 40), (3, 20), DFS + (5490 - 5730 @ 40), (3, 20), DFS + (5735 - 5835 @ 40), (3, 30) + +country TN: + (2402 - 2482 @ 40), (N/A, 20) + (5170 - 5250 @ 20), (N/A, 20) + (5250 - 5330 @ 20), (N/A, 20), DFS + +country TR: DFS-ETSI + (2402 - 2482 @ 40), (N/A, 20) + (5170 - 5250 @ 80), (N/A, 20) + (5250 - 5330 @ 80), (N/A, 20), DFS + (5490 - 5710 @ 80), (N/A, 27), DFS + # 60 gHz band channels 1-4, ref: Etsi En 302 567 + (57240 - 65880 @ 2160), (N/A, 40), NO-OUTDOOR + +# Source: +# #914 / 06 Sep 2007: http://www.ucrf.gov.ua/uk/doc/nkrz/1196068874 +# #1174 / 23 Oct 2008: http://www.nkrz.gov.ua/uk/activities/ruling/1225269361 +# (appendix 8) +# Listed 5GHz range is a lowest common denominator for all related +# rules in the referenced laws. Such a range is used because of +# disputable definitions there. +country UA: + (2400 - 2483.5 @ 40), (N/A, 20), NO-OUTDOOR + (5150 - 5250 @ 40), (N/A, 20), NO-OUTDOOR + (5250 - 5350 @ 40), (N/A, 20), NO-OUTDOOR, DFS + (5470 - 5670 @ 40), (N/A, 20), DFS + (5725 - 5850 @ 40), (N/A, 20) + # 60 gHz band channels 1-4, ref: Etsi En 302 567 + (57240 - 65880 @ 2160), (N/A, 40), NO-OUTDOOR + +country UG: + (2402 - 2482 @ 40), (N/A, 20) + (5150 - 5250 @ 80), (6, 20) + (5250 - 5350 @ 80), (6, 20), DFS + (5470 - 5725 @ 80), (6, 20), DFS + (5725 - 5825 @ 80), (6, 20) + +country US: DFS-FCC + (2402 - 2472 @ 40), (3, 27) + (5170 - 5250 @ 80), (3, 17) + (5250 - 5330 @ 80), (3, 23), DFS + (5490 - 5600 @ 80), (3, 23), DFS + (5650 - 5730 @ 40), (3, 23), DFS + (5735 - 5835 @ 80), (3, 30) + # 60g band + # reference: http://cfr.regstoday.com/47cfr15.aspx#47_CFR_15p255 + # channels 1,2,3, EIRP=40dBm(43dBm peak) + (57240 - 63720 @ 2160), (N/A, 40) + +# Public Safety FCCA, FCC4 +# 27dBm [4.9GHz 1/4 rate], 30dBm [1/2 rate], 33dBm [full rate], and 5GHz same as FCC1 +# db.txt cannot express the limitation on 5G so disable all 5G channels for FCC4 +country PS: + (2402 - 2472 @ 40), (N/A, 30) + #(4940 - 4990 @ 40), (6, 27) + #(5150 - 5250 @ 80), (6, 30) + #(5250 - 5350 @ 80), (6, 30), DFS + #(5725 - 5850 @ 80), (6, 33) + +country UY: + (2402 - 2482 @ 40), (N/A, 20) + (5170 - 5250 @ 40), (3, 17) + (5250 - 5330 @ 40), (3, 20), DFS + (5490 - 5730 @ 40), (3, 20), DFS + (5735 - 5835 @ 40), (3, 30) + +country UZ: + (2402 - 2472 @ 40), (3, 27) + (5170 - 5250 @ 40), (3, 17) + (5250 - 5330 @ 40), (3, 20), DFS + (5490 - 5730 @ 40), (3, 20), DFS + (5735 - 5835 @ 40), (3, 30) + +country VE: + (2402 - 2482 @ 40), (N/A, 20) + (5150 - 5250 @ 80), (6, 17) + (5250 - 5350 @ 80), (6, 23), DFS + (5725 - 5850 @ 80), (6, 30) + + +country VN: + (2402 - 2482 @ 40), (N/A, 20) + (5170 - 5250 @ 80), (3, 17) + (5250 - 5330 @ 80), (3, 24), DFS + (5490 - 5730 @ 80), (3, 24), DFS + (5735 - 5835 @ 80), (3, 30) + +country VI: + (2402 - 2472 @ 40), (N/A, 30) + (5150 - 5250 @ 80), (6, 17) + (5250 - 5350 @ 80), (6, 24), DFS + (5470 - 5725 @ 80), (6, 24), DFS + (5725 - 5850 @ 80), (6, 30) + +country WS: DFS-ETSI + (2402 - 2482 @ 40), (N/A, 20) + (5170 - 5250 @ 20), (3, 17) + (5250 - 5330 @ 80), (3, 24), DFS + (5490 - 5710 @ 80), (3, 24), DFS + +country YE: + (2402 - 2482 @ 40), (N/A, 20) + +country YT: DFS-ETSI + (2402 - 2482 @ 40), (N/A, 20) + (5150 - 5250 @ 80), (N/A, 20) + (5250 - 5350 @ 80), (N/A, 20), DFS + (5470 - 5725 @ 80), (N/A, 27), DFS + +country ZA: + (2402 - 2482 @ 40), (N/A, 20) + (5170 - 5250 @ 80), (3, 17) + (5250 - 5330 @ 80), (3, 24), DFS + (5490 - 5710 @ 80), (3, 24), DFS + (5735 - 5835 @ 80), (3, 30) + +country ZW: + (2402 - 2482 @ 40), (N/A, 20) + (5150 - 5250 @ 80), (N/A, 20) + (5250 - 5350 @ 80), (N/A, 20), DFS + (5470 - 5725 @ 80), (N/A, 27), DFS + |