Skip to content

Commit ab30634

Browse files
committed
"LA.UM.8.6.2.r1-08100-89xx.0"
2 parents 9be6424 + 7d7ebd4 commit ab30634

18 files changed

+535
-9
lines changed

drivers/staging/prima/Android.mk

+167
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,167 @@
1+
# Android makefile for the WLAN Module
2+
3+
# Assume no targets will be supported
4+
WLAN_CHIPSET :=
5+
6+
# Build/Package options for 8960 target
7+
ifeq ($(TARGET_BOARD_PLATFORM),msm8960)
8+
WLAN_CHIPSET := prima
9+
WLAN_SELECT := CONFIG_PRIMA_WLAN=m
10+
endif
11+
12+
# Build/Package options for 8916, 8974, 8226, 8610, 8909, 8952, 8937, 8953 targets
13+
ifneq (,$(filter msm8916 msm8974 msm8226 msm8610 msm8909 msm8952 msm8937 msm8953 titanium,$(TARGET_BOARD_PLATFORM)))
14+
ifneq ($(TARGET_SUPPORTS_ANDROID_WEAR_KERNEL_4_14),true)
15+
WLAN_CHIPSET := pronto
16+
WLAN_SELECT := CONFIG_PRONTO_WLAN=m
17+
endif
18+
endif
19+
20+
# Build/Package only in case of supported target
21+
ifneq ($(WLAN_CHIPSET),)
22+
23+
LOCAL_PATH := $(call my-dir)
24+
25+
ifeq ($(TARGET_SUPPORTS_WEARABLES),true)
26+
ifneq ($(findstring device,$(LOCAL_PATH)),)
27+
WLAN_DLKM := 1
28+
else
29+
ifneq ($(findstring vendor,$(LOCAL_PATH)),)
30+
WLAN_DLKM := 1
31+
else
32+
WLAN_DLKM := 0
33+
endif # findstring device
34+
endif
35+
else
36+
ifneq ($(findstring vendor,$(LOCAL_PATH)),)
37+
WLAN_DLKM := 1
38+
else
39+
WLAN_DLKM := 0
40+
endif # findstring vendor
41+
endif # TARGET_SUPPORTS_WEARABLES
42+
43+
# This makefile is only for DLKM
44+
ifeq ($(WLAN_DLKM),1)
45+
46+
# Determine if we are Proprietary or Open Source
47+
ifneq ($(findstring opensource,$(LOCAL_PATH)),)
48+
WLAN_PROPRIETARY := 0
49+
else
50+
WLAN_PROPRIETARY := 1
51+
endif
52+
53+
# DLKM_DIR was moved for JELLY_BEAN (PLATFORM_SDK 16)
54+
ifeq (1,$(filter 1,$(shell echo "$$(( $(PLATFORM_SDK_VERSION) >= 16 ))" )))
55+
ifneq ($(TARGET_SUPPORTS_WEARABLES),true)
56+
DLKM_DIR := $(TOP)/device/qcom/common/dlkm
57+
else
58+
DLKM_DIR := $(BOARD_DLKM_DIR)
59+
endif
60+
else
61+
DLKM_DIR := build/dlkm
62+
endif
63+
64+
# Copy WCNSS_cfg.dat file from firmware_bin/ folder to target out directory.
65+
ifeq ($(WLAN_PROPRIETARY),0)
66+
67+
$(shell mkdir -p $(TARGET_OUT_ETC)/firmware/wlan/prima)
68+
$(shell rm -f $(TARGET_OUT_ETC)/firmware/wlan/prima/WCNSS_cfg.dat)
69+
$(shell cp $(LOCAL_PATH)/firmware_bin/WCNSS_cfg.dat $(TARGET_OUT_ETC)/firmware/wlan/prima)
70+
71+
else
72+
73+
include $(CLEAR_VARS)
74+
LOCAL_MODULE := WCNSS_qcom_wlan_nv.bin
75+
LOCAL_MODULE_TAGS := optional
76+
LOCAL_MODULE_CLASS := ETC
77+
LOCAL_MODULE_PATH := $(PRODUCT_OUT)/persist
78+
LOCAL_SRC_FILES := firmware_bin/$(LOCAL_MODULE)
79+
include $(BUILD_PREBUILT)
80+
81+
include $(CLEAR_VARS)
82+
LOCAL_MODULE := WCNSS_cfg.dat
83+
LOCAL_MODULE_TAGS := optional
84+
LOCAL_MODULE_CLASS := ETC
85+
LOCAL_MODULE_PATH := $(TARGET_OUT_ETC)/firmware/wlan/prima
86+
LOCAL_SRC_FILES := firmware_bin/$(LOCAL_MODULE)
87+
include $(BUILD_PREBUILT)
88+
89+
include $(CLEAR_VARS)
90+
LOCAL_MODULE := WCNSS_qcom_cfg.ini
91+
LOCAL_MODULE_TAGS := optional
92+
LOCAL_MODULE_CLASS := ETC
93+
LOCAL_MODULE_PATH := $(PRODUCT_OUT)/persist
94+
LOCAL_SRC_FILES := firmware_bin/$(LOCAL_MODULE)
95+
include $(BUILD_PREBUILT)
96+
97+
endif
98+
99+
ifeq ($(TARGET_KERNEL_VERSION),)
100+
$(info "WLAN: TARGET_KERNEL_VERSION is not defined, assuming default")
101+
TARGET_KERNEL_SOURCE := kernel
102+
KERNEL_TO_BUILD_ROOT_OFFSET := ../
103+
endif
104+
105+
ifeq ($(KERNEL_TO_BUILD_ROOT_OFFSET),)
106+
$(info "WLAN: KERNEL_TO_BUILD_ROOT_OFFSET is not defined, assuming default")
107+
KERNEL_TO_BUILD_ROOT_OFFSET := ../
108+
endif
109+
110+
# Build wlan.ko as either prima_wlan.ko or pronto_wlan.ko
111+
###########################################################
112+
113+
# This is set once per LOCAL_PATH, not per (kernel) module
114+
115+
ifeq ($(KBUILD_OPTIONS),)
116+
KBUILD_OPTIONS += WLAN_PROPRIETARY=$(WLAN_PROPRIETARY)
117+
KBUILD_OPTIONS += TARGET_SUPPORTS_WEARABLES=$(TARGET_SUPPORTS_WEARABLES)
118+
KBUILD_OPTIONS += KERNEL_TO_BUILD_ROOT_OFFSET=$(KERNEL_TO_BUILD_ROOT_OFFSET)
119+
endif
120+
121+
# We are actually building wlan.ko here, as per the
122+
# requirement we are specifying <chipset>_wlan.ko as LOCAL_MODULE.
123+
# This means we need to rename the module to <chipset>_wlan.ko
124+
# after wlan.ko is built.
125+
KBUILD_OPTIONS += MODNAME=wlan
126+
KBUILD_OPTIONS += BOARD_PLATFORM=$(TARGET_BOARD_PLATFORM)
127+
KBUILD_OPTIONS += $(WLAN_SELECT)
128+
129+
130+
ifeq ($(KERNEL_TO_BUILD_ROOT_OFFSET),../../)
131+
VERSION=$(shell grep -w "VERSION =" $(TOP)/kernel/msm-$(TARGET_KERNEL_VERSION)/Makefile | sed 's/^VERSION = //' )
132+
PATCHLEVEL=$(shell grep -w "PATCHLEVEL =" $(TOP)/kernel/msm-$(TARGET_KERNEL_VERSION)/Makefile | sed 's/^PATCHLEVEL = //' )
133+
else
134+
VERSION=$(shell grep -w "VERSION =" $(TOP)/kernel/Makefile | sed 's/^VERSION = //' )
135+
PATCHLEVEL=$(shell grep -w "PATCHLEVEL =" $(TOP)/kernel/Makefile | sed 's/^PATCHLEVEL = //' )
136+
endif
137+
138+
include $(CLEAR_VARS)
139+
LOCAL_MODULE := $(WLAN_CHIPSET)_wlan.ko
140+
LOCAL_MODULE_KBUILD_NAME := wlan.ko
141+
LOCAL_MODULE_TAGS := optional
142+
LOCAL_MODULE_DEBUG_ENABLE := true
143+
ifeq ($(PRODUCT_VENDOR_MOVE_ENABLED), true)
144+
ifeq ($(WIFI_DRIVER_INSTALL_TO_KERNEL_OUT),true)
145+
LOCAL_MODULE_PATH := $(KERNEL_MODULES_OUT)
146+
else
147+
LOCAL_MODULE_PATH := $(TARGET_OUT_VENDOR)/lib/modules/$(WLAN_CHIPSET)
148+
endif
149+
else
150+
LOCAL_MODULE_PATH := $(TARGET_OUT)/lib/modules/$(WLAN_CHIPSET)
151+
endif # PRODUCT_VENDOR_MOVE_ENABLED
152+
include $(DLKM_DIR)/AndroidKernelModule.mk
153+
###########################################################
154+
155+
#Create symbolic link
156+
ifeq ($(PRODUCT_VENDOR_MOVE_ENABLED), true)
157+
$(shell mkdir -p $(TARGET_OUT_VENDOR)/lib/modules; \
158+
ln -sf /$(TARGET_COPY_OUT_VENDOR)/lib/modules/$(WLAN_CHIPSET)/$(WLAN_CHIPSET)_wlan.ko \
159+
$(TARGET_OUT_VENDOR)/lib/modules/wlan.ko)
160+
else
161+
$(shell mkdir -p $(TARGET_OUT)/lib/modules; \
162+
ln -sf /system/lib/modules/$(WLAN_CHIPSET)/$(WLAN_CHIPSET)_wlan.ko \
163+
$(TARGET_OUT)/lib/modules/wlan.ko)
164+
endif # PRODUCT_VENDOR_MOVE_ENABLED
165+
endif # DLKM check
166+
167+
endif # supported target check

drivers/staging/prima/CORE/HDD/inc/wlan_hdd_main.h

+12
Original file line numberDiff line numberDiff line change
@@ -2349,6 +2349,18 @@ hdd_wlan_nla_put_u64(struct sk_buff *skb, int attrtype, u64 value)
23492349
}
23502350
#endif
23512351

2352+
#if (LINUX_VERSION_CODE < KERNEL_VERSION(4, 12, 0))
2353+
static inline void hdd_dev_setup_destructor(struct net_device *dev)
2354+
{
2355+
dev->destructor = free_netdev;
2356+
}
2357+
#else
2358+
static inline void hdd_dev_setup_destructor(struct net_device *dev)
2359+
{
2360+
dev->needs_free_netdev = true;
2361+
}
2362+
#endif /* KERNEL_VERSION(4, 12, 0) */
2363+
23522364
/*
23532365
* hdd_parse_disable_chn_cmd() - Parse the channel list received
23542366
* in command.

drivers/staging/prima/CORE/HDD/src/wlan_hdd_assoc.c

+5
Original file line numberDiff line numberDiff line change
@@ -800,8 +800,13 @@ static void hdd_copy_vht_operation(hdd_station_ctx_t *hdd_sta_ctx,
800800
vos_mem_zero(hdd_vht_ops, sizeof(struct ieee80211_vht_operation));
801801

802802
hdd_vht_ops->chan_width = roam_vht_ops->chanWidth;
803+
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,14,0))
804+
hdd_vht_ops->center_freq_seg0_idx = roam_vht_ops->chanCenterFreqSeg1;
805+
hdd_vht_ops->center_freq_seg1_idx = roam_vht_ops->chanCenterFreqSeg2;
806+
#else
803807
hdd_vht_ops->center_freq_seg1_idx = roam_vht_ops->chanCenterFreqSeg1;
804808
hdd_vht_ops->center_freq_seg2_idx = roam_vht_ops->chanCenterFreqSeg2;
809+
#endif
805810
hdd_vht_ops->basic_mcs_set = roam_vht_ops->basicMCSSet;
806811
}
807812

drivers/staging/prima/CORE/HDD/src/wlan_hdd_cfg80211.c

+12
Original file line numberDiff line numberDiff line change
@@ -135,10 +135,12 @@
135135
.flags = flag, \
136136
}
137137

138+
#if (LINUX_VERSION_CODE < KERNEL_VERSION(4, 14, 0))
138139
#ifdef WLAN_FEATURE_VOWIFI_11R
139140
#define WLAN_AKM_SUITE_FT_8021X 0x000FAC03
140141
#define WLAN_AKM_SUITE_FT_PSK 0x000FAC04
141142
#endif
143+
#endif
142144

143145
#define HDD_CHANNEL_14 14
144146
#define WLAN_HDD_MAX_FEATURE_SET 8
@@ -14429,7 +14431,11 @@ static struct cfg80211_bss* wlan_hdd_cfg80211_inform_bss(
1442914431
freq = ieee80211_channel_to_frequency(chan_no);
1443014432
#endif
1443114433

14434+
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,14,0))
14435+
chan = ieee80211_get_channel(wiphy, freq);
14436+
#else
1443214437
chan = __ieee80211_get_channel(wiphy, freq);
14438+
#endif
1443314439

1443414440
if (!chan) {
1443514441
hddLog(VOS_TRACE_LEVEL_ERROR, "%s chan pointer is NULL", __func__);
@@ -14602,7 +14608,13 @@ wlan_hdd_cfg80211_inform_bss_frame( hdd_adapter_t *pAdapter,
1460214608
#else
1460314609
freq = ieee80211_channel_to_frequency(chan_no);
1460414610
#endif
14611+
14612+
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,14,0))
14613+
chan = ieee80211_get_channel(wiphy, freq);
14614+
#else
1460514615
chan = __ieee80211_get_channel(wiphy, freq);
14616+
#endif
14617+
1460614618
/*when the band is changed on the fly using the GUI, three things are done
1460714619
* 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)
1460814620
* as part of the scan abort, message willbe queued to PE and we proceed with flushing and changinh the band.

drivers/staging/prima/CORE/HDD/src/wlan_hdd_hostapd.c

+5-2
Original file line numberDiff line numberDiff line change
@@ -1097,7 +1097,11 @@ static VOS_STATUS hdd_chan_change_notify(hdd_adapter_t *hostapd_adapter,
10971097

10981098
freq = vos_chan_to_freq(oper_chan);
10991099

1100+
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,14,0))
1101+
chan = ieee80211_get_channel(hostapd_adapter->wdev.wiphy, freq);
1102+
#else
11001103
chan = __ieee80211_get_channel(hostapd_adapter->wdev.wiphy, freq);
1104+
#endif
11011105

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

57355739
vos_mem_copy(pWlanHostapdDev->dev_addr, (void *)macAddr,sizeof(tSirMacAddr));
57365740
vos_mem_copy(pHostapdAdapter->macAddressCurrent.bytes, (void *)macAddr, sizeof(tSirMacAddr));
5737-
5738-
pWlanHostapdDev->destructor = free_netdev;
5741+
hdd_dev_setup_destructor(pWlanHostapdDev);
57395742
pWlanHostapdDev->ieee80211_ptr = &pHostapdAdapter->wdev ;
57405743
pHostapdAdapter->wdev.wiphy = pHddCtx->wiphy;
57415744
pHostapdAdapter->wdev.netdev = pWlanHostapdDev;

drivers/staging/prima/CORE/HDD/src/wlan_hdd_main.c

+30-1
Original file line numberDiff line numberDiff line change
@@ -250,6 +250,7 @@ static int hdd_ParseUserParams(tANI_U8 *pValue, tANI_U8 **ppArg);
250250
void wlan_hdd_restart_timer_cb(v_PVOID_t usrDataForCallback);
251251
void hdd_set_wlan_suspend_mode(bool suspend);
252252
void hdd_set_vowifi_mode(hdd_context_t *hdd_ctx, bool enable);
253+
void hdd_set_olpc_mode(tHalHandle hHal, bool low_power);
253254

254255
v_U16_t hdd_select_queue(struct net_device *dev,
255256
struct sk_buff *skb
@@ -878,6 +879,19 @@ static int hdd_parse_setrmcactionperiod_command(tANI_U8 *pValue,
878879
return 0;
879880
}
880881

882+
/*
883+
+ * hdd_set_olpc_mode() - Process the OLPCMODE command and invoke the SME api
884+
*
885+
* @hHal: context handler
886+
* @low_power: Value to be sent as a part of the OLPCMODE command
887+
*
888+
* Return: void
889+
*/
890+
void hdd_set_olpc_mode(tHalHandle hHal, bool low_power)
891+
{
892+
sme_update_olpc_mode(hHal, low_power);
893+
}
894+
881895
/**
882896
* hdd_set_vowifi_mode() - Process VOWIFI command.
883897
* @hdd_ctx: context handler
@@ -4078,6 +4092,21 @@ static int hdd_driver_command(hdd_adapter_t *pAdapter,
40784092

40794093
ptr = (tANI_U8*)command + 11;
40804094
hdd_set_vowifi_mode(pHddCtx, *ptr - '0');
4095+
}
4096+
4097+
else if (strncmp(command, "OLPCMODE", 8) == 0)
4098+
{
4099+
tANI_U8 *ptr;
4100+
4101+
ret = hdd_drv_cmd_validate(command, 8);
4102+
if (ret)
4103+
goto exit;
4104+
4105+
VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO,
4106+
" Received Command to go to low power mode in %s", __func__);
4107+
4108+
ptr = (tANI_U8*)command + 9;
4109+
hdd_set_olpc_mode((tHalHandle)(pHddCtx->hHal), *ptr - '0');
40814110
}
40824111

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

91319160
hdd_set_station_ops( pAdapter->dev );
91329161

9133-
pWlanDev->destructor = free_netdev;
9162+
hdd_dev_setup_destructor(pWlanDev);
91349163
pWlanDev->ieee80211_ptr = &pAdapter->wdev ;
91359164
pAdapter->wdev.wiphy = pHddCtx->wiphy;
91369165
pAdapter->wdev.netdev = pWlanDev;

drivers/staging/prima/CORE/MAC/src/include/sirParams.h

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2012-2017, 2019 The Linux Foundation. All rights reserved.
2+
* Copyright (c) 2012-2017, 2019-2020 The Linux Foundation. All rights reserved.
33
*
44
* Previously licensed under the ISC license by Qualcomm Atheros, Inc.
55
*
@@ -826,6 +826,7 @@ struct sir_mgmt_msg {
826826
/* ARP Debug stats */
827827
#define SIR_HAL_SET_ARP_STATS_REQ (SIR_HAL_ITC_MSG_TYPES_BEGIN + 303)
828828
#define SIR_HAL_GET_ARP_STATS_REQ (SIR_HAL_ITC_MSG_TYPES_BEGIN + 304)
829+
#define SIR_HAL_LOW_POWER_MODE (SIR_HAL_ITC_MSG_TYPES_BEGIN + 305)
829830
#define SIR_HAL_VOWIFI_MODE (SIR_HAL_ITC_MSG_TYPES_BEGIN + 306)
830831
#define SIR_HAL_QPOWER (SIR_HAL_ITC_MSG_TYPES_BEGIN + 307)
831832

drivers/staging/prima/CORE/SME/inc/smeInside.h

+1
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,7 @@ typedef struct tagSmeCmd
210210
struct csr_set_tx_max_pwr_per_band set_tx_max_pwr_per_band;
211211
tpSirUpdateChanList chan_list;
212212
tpRoamParams RoamParams;
213+
bool olpc_mode_enable;
213214
}u;
214215
}tSmeCmd;
215216

drivers/staging/prima/CORE/SME/inc/smeInternal.h

+1
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ typedef enum eSmeCommandType
7878
eSmeCommandSetMaxTxPower,
7979
eSmeCommandSetMaxTxPowerPerBand,
8080
eSmeCommandUpdateChannelList,
81+
eSmeCommandOlpcMode,
8182
#ifdef FEATURE_WLAN_TDLS
8283
//eSmeTdlsCommandMask = 0x80000, //To identify TDLS commands <TODO>
8384
//These can be considered as csr commands.

drivers/staging/prima/CORE/SME/inc/sme_Api.h

+11
Original file line numberDiff line numberDiff line change
@@ -233,6 +233,7 @@ sme_SetLinkLayerStatsIndCB
233233

234234
void sme_set_vowifi_mode(tpAniSirGlobal pMac, bool enable);
235235
void sme_set_qpower(tpAniSirGlobal pMac, uint8_t enable);
236+
void sme_set_olpc_mode(tpAniSirGlobal pMac, bool enable);
236237

237238
#ifdef WLAN_FEATURE_EXTSCAN
238239
/* ---------------------------------------------------------------------------
@@ -4164,4 +4165,14 @@ struct roam_ext_params {
41644165
*/
41654166
eHalStatus sme_UpdateBlacklist(tHalHandle hHal, uint8_t session_id,
41664167
struct roam_ext_params *roam_params);
4168+
4169+
/**
4170+
* sme_update_olpc_mode() - Send OLPC mode command received from user space
4171+
* @hal: The handle returned by mac_open
4172+
* @enable: OLPC mode enable/disable
4173+
*
4174+
* Return: HAL_STATUS
4175+
*/
4176+
eHalStatus sme_update_olpc_mode(tHalHandle hHal, bool enable);
4177+
41674178
#endif //#if !defined( __SME_API_H )

drivers/staging/prima/CORE/SME/src/csr/csrApiRoam.c

+5
Original file line numberDiff line numberDiff line change
@@ -18969,6 +18969,11 @@ eHalStatus csrIsFullPowerNeeded( tpAniSirGlobal pMac, tSmeCmd *pCommand,
1896918969
fNeedFullPower = eANI_BOOLEAN_TRUE;
1897018970
}
1897118971

18972+
else if (pCommand->command == eSmeCommandOlpcMode)
18973+
{
18974+
fNeedFullPower = eANI_BOOLEAN_TRUE;
18975+
}
18976+
1897218977
break;
1897318978
case REQUEST_STOP_UAPSD:
1897418979
case REQUEST_EXIT_WOWL:

0 commit comments

Comments
 (0)