Skip to content

Commit

Permalink
Merge tag 'LA.UM.8.6.2.r1-08100-89xx.0' of https://source.codeaurora.…
Browse files Browse the repository at this point in the history
  • Loading branch information
MumetNgoding committed Aug 2, 2020
2 parents 9be6424 + 7d7ebd4 commit ab30634
Show file tree
Hide file tree
Showing 18 changed files with 535 additions and 9 deletions.
167 changes: 167 additions & 0 deletions drivers/staging/prima/Android.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,167 @@
# Android makefile for the WLAN Module

# Assume no targets will be supported
WLAN_CHIPSET :=

# Build/Package options for 8960 target
ifeq ($(TARGET_BOARD_PLATFORM),msm8960)
WLAN_CHIPSET := prima
WLAN_SELECT := CONFIG_PRIMA_WLAN=m
endif

# Build/Package options for 8916, 8974, 8226, 8610, 8909, 8952, 8937, 8953 targets
ifneq (,$(filter msm8916 msm8974 msm8226 msm8610 msm8909 msm8952 msm8937 msm8953 titanium,$(TARGET_BOARD_PLATFORM)))
ifneq ($(TARGET_SUPPORTS_ANDROID_WEAR_KERNEL_4_14),true)
WLAN_CHIPSET := pronto
WLAN_SELECT := CONFIG_PRONTO_WLAN=m
endif
endif

# Build/Package only in case of supported target
ifneq ($(WLAN_CHIPSET),)

LOCAL_PATH := $(call my-dir)

ifeq ($(TARGET_SUPPORTS_WEARABLES),true)
ifneq ($(findstring device,$(LOCAL_PATH)),)
WLAN_DLKM := 1
else
ifneq ($(findstring vendor,$(LOCAL_PATH)),)
WLAN_DLKM := 1
else
WLAN_DLKM := 0
endif # findstring device
endif
else
ifneq ($(findstring vendor,$(LOCAL_PATH)),)
WLAN_DLKM := 1
else
WLAN_DLKM := 0
endif # findstring vendor
endif # TARGET_SUPPORTS_WEARABLES

# This makefile is only for DLKM
ifeq ($(WLAN_DLKM),1)

# Determine if we are Proprietary or Open Source
ifneq ($(findstring opensource,$(LOCAL_PATH)),)
WLAN_PROPRIETARY := 0
else
WLAN_PROPRIETARY := 1
endif

# DLKM_DIR was moved for JELLY_BEAN (PLATFORM_SDK 16)
ifeq (1,$(filter 1,$(shell echo "$$(( $(PLATFORM_SDK_VERSION) >= 16 ))" )))
ifneq ($(TARGET_SUPPORTS_WEARABLES),true)
DLKM_DIR := $(TOP)/device/qcom/common/dlkm
else
DLKM_DIR := $(BOARD_DLKM_DIR)
endif
else
DLKM_DIR := build/dlkm
endif

# Copy WCNSS_cfg.dat file from firmware_bin/ folder to target out directory.
ifeq ($(WLAN_PROPRIETARY),0)

$(shell mkdir -p $(TARGET_OUT_ETC)/firmware/wlan/prima)
$(shell rm -f $(TARGET_OUT_ETC)/firmware/wlan/prima/WCNSS_cfg.dat)
$(shell cp $(LOCAL_PATH)/firmware_bin/WCNSS_cfg.dat $(TARGET_OUT_ETC)/firmware/wlan/prima)

else

include $(CLEAR_VARS)
LOCAL_MODULE := WCNSS_qcom_wlan_nv.bin
LOCAL_MODULE_TAGS := optional
LOCAL_MODULE_CLASS := ETC
LOCAL_MODULE_PATH := $(PRODUCT_OUT)/persist
LOCAL_SRC_FILES := firmware_bin/$(LOCAL_MODULE)
include $(BUILD_PREBUILT)

include $(CLEAR_VARS)
LOCAL_MODULE := WCNSS_cfg.dat
LOCAL_MODULE_TAGS := optional
LOCAL_MODULE_CLASS := ETC
LOCAL_MODULE_PATH := $(TARGET_OUT_ETC)/firmware/wlan/prima
LOCAL_SRC_FILES := firmware_bin/$(LOCAL_MODULE)
include $(BUILD_PREBUILT)

include $(CLEAR_VARS)
LOCAL_MODULE := WCNSS_qcom_cfg.ini
LOCAL_MODULE_TAGS := optional
LOCAL_MODULE_CLASS := ETC
LOCAL_MODULE_PATH := $(PRODUCT_OUT)/persist
LOCAL_SRC_FILES := firmware_bin/$(LOCAL_MODULE)
include $(BUILD_PREBUILT)

endif

ifeq ($(TARGET_KERNEL_VERSION),)
$(info "WLAN: TARGET_KERNEL_VERSION is not defined, assuming default")
TARGET_KERNEL_SOURCE := kernel
KERNEL_TO_BUILD_ROOT_OFFSET := ../
endif

ifeq ($(KERNEL_TO_BUILD_ROOT_OFFSET),)
$(info "WLAN: KERNEL_TO_BUILD_ROOT_OFFSET is not defined, assuming default")
KERNEL_TO_BUILD_ROOT_OFFSET := ../
endif

# Build wlan.ko as either prima_wlan.ko or pronto_wlan.ko
###########################################################

# This is set once per LOCAL_PATH, not per (kernel) module

ifeq ($(KBUILD_OPTIONS),)
KBUILD_OPTIONS += WLAN_PROPRIETARY=$(WLAN_PROPRIETARY)
KBUILD_OPTIONS += TARGET_SUPPORTS_WEARABLES=$(TARGET_SUPPORTS_WEARABLES)
KBUILD_OPTIONS += KERNEL_TO_BUILD_ROOT_OFFSET=$(KERNEL_TO_BUILD_ROOT_OFFSET)
endif

# We are actually building wlan.ko here, as per the
# requirement we are specifying <chipset>_wlan.ko as LOCAL_MODULE.
# This means we need to rename the module to <chipset>_wlan.ko
# after wlan.ko is built.
KBUILD_OPTIONS += MODNAME=wlan
KBUILD_OPTIONS += BOARD_PLATFORM=$(TARGET_BOARD_PLATFORM)
KBUILD_OPTIONS += $(WLAN_SELECT)


ifeq ($(KERNEL_TO_BUILD_ROOT_OFFSET),../../)
VERSION=$(shell grep -w "VERSION =" $(TOP)/kernel/msm-$(TARGET_KERNEL_VERSION)/Makefile | sed 's/^VERSION = //' )
PATCHLEVEL=$(shell grep -w "PATCHLEVEL =" $(TOP)/kernel/msm-$(TARGET_KERNEL_VERSION)/Makefile | sed 's/^PATCHLEVEL = //' )
else
VERSION=$(shell grep -w "VERSION =" $(TOP)/kernel/Makefile | sed 's/^VERSION = //' )
PATCHLEVEL=$(shell grep -w "PATCHLEVEL =" $(TOP)/kernel/Makefile | sed 's/^PATCHLEVEL = //' )
endif

include $(CLEAR_VARS)
LOCAL_MODULE := $(WLAN_CHIPSET)_wlan.ko
LOCAL_MODULE_KBUILD_NAME := wlan.ko
LOCAL_MODULE_TAGS := optional
LOCAL_MODULE_DEBUG_ENABLE := true
ifeq ($(PRODUCT_VENDOR_MOVE_ENABLED), true)
ifeq ($(WIFI_DRIVER_INSTALL_TO_KERNEL_OUT),true)
LOCAL_MODULE_PATH := $(KERNEL_MODULES_OUT)
else
LOCAL_MODULE_PATH := $(TARGET_OUT_VENDOR)/lib/modules/$(WLAN_CHIPSET)
endif
else
LOCAL_MODULE_PATH := $(TARGET_OUT)/lib/modules/$(WLAN_CHIPSET)
endif # PRODUCT_VENDOR_MOVE_ENABLED
include $(DLKM_DIR)/AndroidKernelModule.mk
###########################################################

#Create symbolic link
ifeq ($(PRODUCT_VENDOR_MOVE_ENABLED), true)
$(shell mkdir -p $(TARGET_OUT_VENDOR)/lib/modules; \
ln -sf /$(TARGET_COPY_OUT_VENDOR)/lib/modules/$(WLAN_CHIPSET)/$(WLAN_CHIPSET)_wlan.ko \
$(TARGET_OUT_VENDOR)/lib/modules/wlan.ko)
else
$(shell mkdir -p $(TARGET_OUT)/lib/modules; \
ln -sf /system/lib/modules/$(WLAN_CHIPSET)/$(WLAN_CHIPSET)_wlan.ko \
$(TARGET_OUT)/lib/modules/wlan.ko)
endif # PRODUCT_VENDOR_MOVE_ENABLED
endif # DLKM check

endif # supported target check
12 changes: 12 additions & 0 deletions drivers/staging/prima/CORE/HDD/inc/wlan_hdd_main.h
Original file line number Diff line number Diff line change
Expand Up @@ -2349,6 +2349,18 @@ hdd_wlan_nla_put_u64(struct sk_buff *skb, int attrtype, u64 value)
}
#endif

#if (LINUX_VERSION_CODE < KERNEL_VERSION(4, 12, 0))
static inline void hdd_dev_setup_destructor(struct net_device *dev)
{
dev->destructor = free_netdev;
}
#else
static inline void hdd_dev_setup_destructor(struct net_device *dev)
{
dev->needs_free_netdev = true;
}
#endif /* KERNEL_VERSION(4, 12, 0) */

/*
* hdd_parse_disable_chn_cmd() - Parse the channel list received
* in command.
Expand Down
5 changes: 5 additions & 0 deletions drivers/staging/prima/CORE/HDD/src/wlan_hdd_assoc.c
Original file line number Diff line number Diff line change
Expand Up @@ -800,8 +800,13 @@ static void hdd_copy_vht_operation(hdd_station_ctx_t *hdd_sta_ctx,
vos_mem_zero(hdd_vht_ops, sizeof(struct ieee80211_vht_operation));

hdd_vht_ops->chan_width = roam_vht_ops->chanWidth;
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,14,0))
hdd_vht_ops->center_freq_seg0_idx = roam_vht_ops->chanCenterFreqSeg1;
hdd_vht_ops->center_freq_seg1_idx = roam_vht_ops->chanCenterFreqSeg2;
#else
hdd_vht_ops->center_freq_seg1_idx = roam_vht_ops->chanCenterFreqSeg1;
hdd_vht_ops->center_freq_seg2_idx = roam_vht_ops->chanCenterFreqSeg2;
#endif
hdd_vht_ops->basic_mcs_set = roam_vht_ops->basicMCSSet;
}

Expand Down
12 changes: 12 additions & 0 deletions drivers/staging/prima/CORE/HDD/src/wlan_hdd_cfg80211.c
Original file line number Diff line number Diff line change
Expand Up @@ -135,10 +135,12 @@
.flags = flag, \
}

#if (LINUX_VERSION_CODE < KERNEL_VERSION(4, 14, 0))
#ifdef WLAN_FEATURE_VOWIFI_11R
#define WLAN_AKM_SUITE_FT_8021X 0x000FAC03
#define WLAN_AKM_SUITE_FT_PSK 0x000FAC04
#endif
#endif

#define HDD_CHANNEL_14 14
#define WLAN_HDD_MAX_FEATURE_SET 8
Expand Down Expand Up @@ -14429,7 +14431,11 @@ static struct cfg80211_bss* wlan_hdd_cfg80211_inform_bss(
freq = ieee80211_channel_to_frequency(chan_no);
#endif

#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,14,0))
chan = ieee80211_get_channel(wiphy, freq);
#else
chan = __ieee80211_get_channel(wiphy, freq);
#endif

if (!chan) {
hddLog(VOS_TRACE_LEVEL_ERROR, "%s chan pointer is NULL", __func__);
Expand Down Expand Up @@ -14602,7 +14608,13 @@ wlan_hdd_cfg80211_inform_bss_frame( hdd_adapter_t *pAdapter,
#else
freq = ieee80211_channel_to_frequency(chan_no);
#endif

#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,14,0))
chan = ieee80211_get_channel(wiphy, freq);
#else
chan = __ieee80211_get_channel(wiphy, freq);
#endif

/*when the band is changed on the fly using the GUI, three things are done
* 1. scan abort 2.flush scan results from cache 3.update the band with the new band user specified(refer to the hdd_setBand_helper function)
* as part of the scan abort, message willbe queued to PE and we proceed with flushing and changinh the band.
Expand Down
7 changes: 5 additions & 2 deletions drivers/staging/prima/CORE/HDD/src/wlan_hdd_hostapd.c
Original file line number Diff line number Diff line change
Expand Up @@ -1097,7 +1097,11 @@ static VOS_STATUS hdd_chan_change_notify(hdd_adapter_t *hostapd_adapter,

freq = vos_chan_to_freq(oper_chan);

#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,14,0))
chan = ieee80211_get_channel(hostapd_adapter->wdev.wiphy, freq);
#else
chan = __ieee80211_get_channel(hostapd_adapter->wdev.wiphy, freq);
#endif

if (!chan) {
VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR,
Expand Down Expand Up @@ -5734,8 +5738,7 @@ hdd_adapter_t* hdd_wlan_create_ap_dev( hdd_context_t *pHddCtx, tSirMacAddr macAd

vos_mem_copy(pWlanHostapdDev->dev_addr, (void *)macAddr,sizeof(tSirMacAddr));
vos_mem_copy(pHostapdAdapter->macAddressCurrent.bytes, (void *)macAddr, sizeof(tSirMacAddr));

pWlanHostapdDev->destructor = free_netdev;
hdd_dev_setup_destructor(pWlanHostapdDev);
pWlanHostapdDev->ieee80211_ptr = &pHostapdAdapter->wdev ;
pHostapdAdapter->wdev.wiphy = pHddCtx->wiphy;
pHostapdAdapter->wdev.netdev = pWlanHostapdDev;
Expand Down
31 changes: 30 additions & 1 deletion drivers/staging/prima/CORE/HDD/src/wlan_hdd_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,7 @@ static int hdd_ParseUserParams(tANI_U8 *pValue, tANI_U8 **ppArg);
void wlan_hdd_restart_timer_cb(v_PVOID_t usrDataForCallback);
void hdd_set_wlan_suspend_mode(bool suspend);
void hdd_set_vowifi_mode(hdd_context_t *hdd_ctx, bool enable);
void hdd_set_olpc_mode(tHalHandle hHal, bool low_power);

v_U16_t hdd_select_queue(struct net_device *dev,
struct sk_buff *skb
Expand Down Expand Up @@ -878,6 +879,19 @@ static int hdd_parse_setrmcactionperiod_command(tANI_U8 *pValue,
return 0;
}

/*
+ * hdd_set_olpc_mode() - Process the OLPCMODE command and invoke the SME api
*
* @hHal: context handler
* @low_power: Value to be sent as a part of the OLPCMODE command
*
* Return: void
*/
void hdd_set_olpc_mode(tHalHandle hHal, bool low_power)
{
sme_update_olpc_mode(hHal, low_power);
}

/**
* hdd_set_vowifi_mode() - Process VOWIFI command.
* @hdd_ctx: context handler
Expand Down Expand Up @@ -4078,6 +4092,21 @@ static int hdd_driver_command(hdd_adapter_t *pAdapter,

ptr = (tANI_U8*)command + 11;
hdd_set_vowifi_mode(pHddCtx, *ptr - '0');
}

else if (strncmp(command, "OLPCMODE", 8) == 0)
{
tANI_U8 *ptr;

ret = hdd_drv_cmd_validate(command, 8);
if (ret)
goto exit;

VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO,
" Received Command to go to low power mode in %s", __func__);

ptr = (tANI_U8*)command + 9;
hdd_set_olpc_mode((tHalHandle)(pHddCtx->hHal), *ptr - '0');
}

else if(strncmp(command, "SETSUSPENDMODE", 14) == 0)
Expand Down Expand Up @@ -9130,7 +9159,7 @@ static hdd_adapter_t* hdd_alloc_station_adapter( hdd_context_t *pHddCtx, tSirMac

hdd_set_station_ops( pAdapter->dev );

pWlanDev->destructor = free_netdev;
hdd_dev_setup_destructor(pWlanDev);
pWlanDev->ieee80211_ptr = &pAdapter->wdev ;
pAdapter->wdev.wiphy = pHddCtx->wiphy;
pAdapter->wdev.netdev = pWlanDev;
Expand Down
3 changes: 2 additions & 1 deletion drivers/staging/prima/CORE/MAC/src/include/sirParams.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2012-2017, 2019 The Linux Foundation. All rights reserved.
* Copyright (c) 2012-2017, 2019-2020 The Linux Foundation. All rights reserved.
*
* Previously licensed under the ISC license by Qualcomm Atheros, Inc.
*
Expand Down Expand Up @@ -826,6 +826,7 @@ struct sir_mgmt_msg {
/* ARP Debug stats */
#define SIR_HAL_SET_ARP_STATS_REQ (SIR_HAL_ITC_MSG_TYPES_BEGIN + 303)
#define SIR_HAL_GET_ARP_STATS_REQ (SIR_HAL_ITC_MSG_TYPES_BEGIN + 304)
#define SIR_HAL_LOW_POWER_MODE (SIR_HAL_ITC_MSG_TYPES_BEGIN + 305)
#define SIR_HAL_VOWIFI_MODE (SIR_HAL_ITC_MSG_TYPES_BEGIN + 306)
#define SIR_HAL_QPOWER (SIR_HAL_ITC_MSG_TYPES_BEGIN + 307)

Expand Down
1 change: 1 addition & 0 deletions drivers/staging/prima/CORE/SME/inc/smeInside.h
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,7 @@ typedef struct tagSmeCmd
struct csr_set_tx_max_pwr_per_band set_tx_max_pwr_per_band;
tpSirUpdateChanList chan_list;
tpRoamParams RoamParams;
bool olpc_mode_enable;
}u;
}tSmeCmd;

Expand Down
1 change: 1 addition & 0 deletions drivers/staging/prima/CORE/SME/inc/smeInternal.h
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ typedef enum eSmeCommandType
eSmeCommandSetMaxTxPower,
eSmeCommandSetMaxTxPowerPerBand,
eSmeCommandUpdateChannelList,
eSmeCommandOlpcMode,
#ifdef FEATURE_WLAN_TDLS
//eSmeTdlsCommandMask = 0x80000, //To identify TDLS commands <TODO>
//These can be considered as csr commands.
Expand Down
11 changes: 11 additions & 0 deletions drivers/staging/prima/CORE/SME/inc/sme_Api.h
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,7 @@ sme_SetLinkLayerStatsIndCB

void sme_set_vowifi_mode(tpAniSirGlobal pMac, bool enable);
void sme_set_qpower(tpAniSirGlobal pMac, uint8_t enable);
void sme_set_olpc_mode(tpAniSirGlobal pMac, bool enable);

#ifdef WLAN_FEATURE_EXTSCAN
/* ---------------------------------------------------------------------------
Expand Down Expand Up @@ -4164,4 +4165,14 @@ struct roam_ext_params {
*/
eHalStatus sme_UpdateBlacklist(tHalHandle hHal, uint8_t session_id,
struct roam_ext_params *roam_params);

/**
* sme_update_olpc_mode() - Send OLPC mode command received from user space
* @hal: The handle returned by mac_open
* @enable: OLPC mode enable/disable
*
* Return: HAL_STATUS
*/
eHalStatus sme_update_olpc_mode(tHalHandle hHal, bool enable);

#endif //#if !defined( __SME_API_H )
5 changes: 5 additions & 0 deletions drivers/staging/prima/CORE/SME/src/csr/csrApiRoam.c
Original file line number Diff line number Diff line change
Expand Up @@ -18969,6 +18969,11 @@ eHalStatus csrIsFullPowerNeeded( tpAniSirGlobal pMac, tSmeCmd *pCommand,
fNeedFullPower = eANI_BOOLEAN_TRUE;
}

else if (pCommand->command == eSmeCommandOlpcMode)
{
fNeedFullPower = eANI_BOOLEAN_TRUE;
}

break;
case REQUEST_STOP_UAPSD:
case REQUEST_EXIT_WOWL:
Expand Down
Loading

0 comments on commit ab30634

Please sign in to comment.