From 7a7a6e85bb6a6a9ac67d969dd7ddf6599e7b7000 Mon Sep 17 00:00:00 2001 From: Varun Reddy Yeturu Date: Wed, 26 Jul 2017 10:59:39 -0700 Subject: [PATCH 01/11] qcacmn: Pass config parameters for bad RSSI roaming to firmware Fill the roaming parameters wmi_roam_bg_scan_roaming_param and send them to firmware to be consumed for the background roaming at bad RSSI Change-Id: I08786141d28f8459aad27aaf53816ec4cdec7f08 CRs-Fixed: 2082906 --- wmi/inc/wmi_unified_param.h | 4 ++++ wmi/src/wmi_unified_tlv.c | 17 +++++++++++++++++ 2 files changed, 21 insertions(+) diff --git a/wmi/inc/wmi_unified_param.h b/wmi/inc/wmi_unified_param.h index 1c2e1629b291..0a11f47ebe52 100644 --- a/wmi/inc/wmi_unified_param.h +++ b/wmi/inc/wmi_unified_param.h @@ -1976,6 +1976,8 @@ struct roam_offload_scan_params { * @dense_min_aps_cnt: dense roam minimum APs * @initial_dense_status: dense status detected by host * @traffic_threshold: dense roam RSSI threshold + * @bg_scan_bad_rssi_thresh: Bad RSSI threshold to perform bg scan + * @bg_scan_client_bitmap: Bitmap used to identify the client scans to snoop */ struct roam_offload_scan_rssi_params { int8_t rssi_thresh; @@ -1999,6 +2001,8 @@ struct roam_offload_scan_rssi_params { int initial_dense_status; int traffic_threshold; int32_t rssi_thresh_offset_5g; + int8_t bg_scan_bad_rssi_thresh; + uint32_t bg_scan_client_bitmap; }; /** diff --git a/wmi/src/wmi_unified_tlv.c b/wmi/src/wmi_unified_tlv.c index 7814ba21f433..f8bffbc021da 100644 --- a/wmi/src/wmi_unified_tlv.c +++ b/wmi/src/wmi_unified_tlv.c @@ -5905,6 +5905,7 @@ static QDF_STATUS send_roam_scan_offload_rssi_thresh_cmd_tlv(wmi_unified_t wmi_h wmi_roam_scan_extended_threshold_param *ext_thresholds = NULL; wmi_roam_earlystop_rssi_thres_param *early_stop_thresholds = NULL; wmi_roam_dense_thres_param *dense_thresholds = NULL; + wmi_roam_bg_scan_roaming_param *bg_scan_params = NULL; len = sizeof(wmi_roam_scan_rssi_threshold_fixed_param); len += WMI_TLV_HDR_SIZE; /* TLV for ext_thresholds*/ @@ -5913,6 +5914,8 @@ static QDF_STATUS send_roam_scan_offload_rssi_thresh_cmd_tlv(wmi_unified_t wmi_h len += sizeof(wmi_roam_earlystop_rssi_thres_param); len += WMI_TLV_HDR_SIZE; /* TLV for dense thresholds*/ len += sizeof(wmi_roam_dense_thres_param); + len += WMI_TLV_HDR_SIZE; /* TLV for BG Scan*/ + len += sizeof(wmi_roam_bg_scan_roaming_param); buf = wmi_buf_alloc(wmi_handle, len); if (!buf) { WMI_LOGE("%s : wmi_buf_alloc failed", __func__); @@ -5995,6 +5998,20 @@ static QDF_STATUS send_roam_scan_offload_rssi_thresh_cmd_tlv(wmi_unified_t wmi_h WMITLV_GET_STRUCT_TLVLEN (wmi_roam_dense_thres_param)); + buf_ptr += sizeof(wmi_roam_dense_thres_param); + WMITLV_SET_HDR(buf_ptr, WMITLV_TAG_ARRAY_STRUC, + sizeof(wmi_roam_bg_scan_roaming_param)); + buf_ptr += WMI_TLV_HDR_SIZE; + bg_scan_params = (wmi_roam_bg_scan_roaming_param *) buf_ptr; + bg_scan_params->roam_bg_scan_bad_rssi_thresh = + roam_req->bg_scan_bad_rssi_thresh; + bg_scan_params->roam_bg_scan_client_bitmap = + roam_req->bg_scan_client_bitmap; + WMITLV_SET_HDR(&bg_scan_params->tlv_header, + WMITLV_TAG_STRUC_wmi_roam_bg_scan_roaming_param, + WMITLV_GET_STRUCT_TLVLEN + (wmi_roam_bg_scan_roaming_param)); + status = wmi_unified_cmd_send(wmi_handle, buf, len, WMI_ROAM_SCAN_RSSI_THRESHOLD); if (QDF_IS_STATUS_ERROR(status)) { From 0090e226f1307513d37e66f27cc587352c47e9dd Mon Sep 17 00:00:00 2001 From: Ravi Kumar Bokka Date: Wed, 9 Nov 2016 18:07:56 +0530 Subject: [PATCH 02/11] qcacmn: Add ini param to control the crash inject qcacld-2.0 to qcacmn propagation Currently the crash can be injected by iwpriv command and FW gets crashed. Changes are done to add the gEnableCrashInject ini parameter 1) This ini param is disabled by default. 2) If this param is disabled the crash inject is ignored. Change-Id: I7e908be1e37090a9d343dc04411fe387f776a937 CRs-Fixed: 1087774 --- wmi/inc/wmi_unified_api.h | 9 +++++++++ wmi/inc/wmi_unified_priv.h | 1 + wmi/src/wmi_unified.c | 5 +++++ 3 files changed, 15 insertions(+) diff --git a/wmi/inc/wmi_unified_api.h b/wmi/inc/wmi_unified_api.h index 949c4bc66bf4..cc94f2392523 100644 --- a/wmi/inc/wmi_unified_api.h +++ b/wmi/inc/wmi_unified_api.h @@ -292,6 +292,15 @@ void wmi_set_is_wow_bus_suspended(wmi_unified_t wmi_handle, A_BOOL val); */ void wmi_tag_crash_inject(wmi_unified_t wmi_handle, A_BOOL flag); +/** + * WMI API to set target assert + * @param wmi_handle: handle to WMI. + * @param val: target assert config value. + * + * Return: none. + */ +void wmi_set_tgt_assert(wmi_unified_t wmi_handle, bool val); + /** * generic function to block unified WMI command * @param wmi_handle : handle to WMI. diff --git a/wmi/inc/wmi_unified_priv.h b/wmi/inc/wmi_unified_priv.h index f7e0498a129d..2a5cd02125ba 100644 --- a/wmi/inc/wmi_unified_priv.h +++ b/wmi/inc/wmi_unified_priv.h @@ -1438,6 +1438,7 @@ struct wmi_unified { #endif qdf_atomic_t is_wow_bus_suspended; bool tag_crash_inject; + bool tgt_force_assert_enable; enum wmi_target_type target_type; struct wmi_rx_ops rx_ops; struct wmi_ops *ops; diff --git a/wmi/src/wmi_unified.c b/wmi/src/wmi_unified.c index 5a50526b02b1..8c6386e05fe2 100644 --- a/wmi/src/wmi_unified.c +++ b/wmi/src/wmi_unified.c @@ -3013,6 +3013,11 @@ void wmi_set_is_wow_bus_suspended(wmi_unified_t wmi_handle, A_BOOL val) qdf_atomic_set(&wmi_handle->is_wow_bus_suspended, val); } +void wmi_set_tgt_assert(wmi_unified_t wmi_handle, bool val) +{ + wmi_handle->tgt_force_assert_enable = val; +} + #ifndef CONFIG_MCL /** * API to flush all the previous packets associated with the wmi endpoint From 56ce86e04f295e053dc15f04610b1ef115a83040 Mon Sep 17 00:00:00 2001 From: Jiachao Wu Date: Wed, 23 Aug 2017 15:27:11 +0800 Subject: [PATCH 03/11] qcacmn: Pass beacon tx rate value to FW Set bcn_tx_rate when send WMI_VDEV_START_REQUEST_CMDID to FW. Change-Id: I402d996fe4382d8dfd765e3bf7957d4696549b00 CRs-Fixed: 2097703 --- wmi/inc/wmi_unified_param.h | 20 ++++++++++++++++++++ wmi/src/wmi_unified_tlv.c | 4 ++++ 2 files changed, 24 insertions(+) diff --git a/wmi/inc/wmi_unified_param.h b/wmi/inc/wmi_unified_param.h index 0a11f47ebe52..bc8e9994d924 100644 --- a/wmi/inc/wmi_unified_param.h +++ b/wmi/inc/wmi_unified_param.h @@ -609,6 +609,24 @@ struct mac_ssid { uint8_t mac_ssid[WMI_MAC_MAX_SSID_LENGTH]; } qdf_packed; +/** + * enum wmi_bcn_tx_rate_code - beacon tx rate code + */ +enum wmi_bcn_tx_rate_code { + WMI_BCN_TX_RATE_CODE_1_M = 0x43, + WMI_BCN_TX_RATE_CODE_2_M = 0x42, + WMI_BCN_TX_RATE_CODE_5_5_M = 0x41, + WMI_BCN_TX_RATE_CODE_6_M = 0x03, + WMI_BCN_TX_RATE_CODE_9_M = 0x07, + WMI_BCN_TX_RATE_CODE_11M = 0x40, + WMI_BCN_TX_RATE_CODE_12_M = 0x02, + WMI_BCN_TX_RATE_CODE_18_M = 0x06, + WMI_BCN_TX_RATE_CODE_24_M = 0x01, + WMI_BCN_TX_RATE_CODE_36_M = 0x05, + WMI_BCN_TX_RATE_CODE_48_M = 0x00, + WMI_BCN_TX_RATE_CODE_54_M = 0x04, +}; + /** * struct vdev_start_params - vdev start cmd parameter * @vdev_id: vdev id @@ -643,6 +661,7 @@ struct mac_ssid { * @dot11_mode: Phy mode (VHT20/VHT80...) * @disable_hw_ack: Disable hw ack if chan is dfs channel for cac * @channel_param: Channel params required by target. + * @bcn_tx_rate_code: Beacon tx rate code. * @ldpc_rx_enabled: Enable/Disable LDPC RX for this vdev */ struct vdev_start_params { @@ -677,6 +696,7 @@ struct vdev_start_params { uint8_t disable_hw_ack; struct channel_param channel; #endif + enum wmi_bcn_tx_rate_code bcn_tx_rate_code; bool ldpc_rx_enabled; }; diff --git a/wmi/src/wmi_unified_tlv.c b/wmi/src/wmi_unified_tlv.c index f8bffbc021da..bd2f07b8435c 100644 --- a/wmi/src/wmi_unified_tlv.c +++ b/wmi/src/wmi_unified_tlv.c @@ -343,6 +343,10 @@ static QDF_STATUS send_vdev_start_cmd_tlv(wmi_unified_t wmi_handle, cmd->beacon_interval = req->beacon_intval; cmd->dtim_period = req->dtim_period; + cmd->bcn_tx_rate = req->bcn_tx_rate_code; + if (req->bcn_tx_rate_code) + cmd->flags |= WMI_UNIFIED_VDEV_START_BCN_TX_RATE_PRESENT; + if (!req->is_restart) { cmd->beacon_interval = req->beacon_intval; cmd->dtim_period = req->dtim_period; From 527d2b2994d2f4021d88b4341b7f50437a47e0e1 Mon Sep 17 00:00:00 2001 From: Gurumoorthi Gnanasambandhan Date: Mon, 11 Sep 2017 17:40:08 +0530 Subject: [PATCH 04/11] qcacmn: Aggregation failure in PMF Mismatch between structure ieee80211_cipher definition and initialize order.miclen is taken as 0 instead of 8 because of wrong order. CR Fixed: 2096266 Change-Id: Iadcdb971d3b09abee5b189e9882b2f5055d93b6c --- umac/cmn_services/crypto/src/wlan_crypto_ccmp.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/umac/cmn_services/crypto/src/wlan_crypto_ccmp.c b/umac/cmn_services/crypto/src/wlan_crypto_ccmp.c index 382da3019acb..09ebd800b459 100644 --- a/umac/cmn_services/crypto/src/wlan_crypto_ccmp.c +++ b/umac/cmn_services/crypto/src/wlan_crypto_ccmp.c @@ -237,8 +237,8 @@ const struct wlan_crypto_cipher ccmp_cipher_table = { "AES-CCM", WLAN_CRYPTO_CIPHER_AES_CCM, WLAN_CRYPTO_IV_LEN + WLAN_CRYPTO_KEYID_LEN + WLAN_CRYPTO_EXT_IV_LEN, - WLAN_CRYPTO_MIC_LEN, 0, + WLAN_CRYPTO_MIC_LEN, 128, ccmp_setkey, ccmp_encap, @@ -252,8 +252,8 @@ const struct wlan_crypto_cipher ccmp256_cipher_table = { "AES-CCM256", WLAN_CRYPTO_CIPHER_AES_CCM_256, WLAN_CRYPTO_IV_LEN + WLAN_CRYPTO_KEYID_LEN + WLAN_CRYPTO_EXT_IV_LEN, - WLAN_CRYPTO_MIC256_LEN, 0, + WLAN_CRYPTO_MIC256_LEN, 256, ccmp_setkey, ccmp_encap, @@ -267,8 +267,8 @@ const struct wlan_crypto_cipher gcmp_cipher_table = { "AES-GCM", WLAN_CRYPTO_CIPHER_AES_GCM, WLAN_CRYPTO_IV_LEN + WLAN_CRYPTO_KEYID_LEN + WLAN_CRYPTO_EXT_IV_LEN, - WLAN_CRYPTO_MIC_LEN, 0, + WLAN_CRYPTO_MIC_LEN, 128, ccmp_setkey, ccmp_encap, @@ -282,8 +282,8 @@ const struct wlan_crypto_cipher gcmp256_cipher_table = { "AES-GCM256", WLAN_CRYPTO_CIPHER_AES_GCM_256, WLAN_CRYPTO_IV_LEN + WLAN_CRYPTO_KEYID_LEN + WLAN_CRYPTO_EXT_IV_LEN, - WLAN_CRYPTO_MIC256_LEN, 0, + WLAN_CRYPTO_MIC256_LEN, 256, ccmp_setkey, ccmp_encap, From fcf0cc659373b38174132e598ed0a8d9048d4c6d Mon Sep 17 00:00:00 2001 From: Jeff Johnson Date: Mon, 18 Sep 2017 07:42:14 -0700 Subject: [PATCH 05/11] qcacmn: Avoid NULL pointer dereference in nl_srv Currently nl_srv_bcast() and nl_srv_ucast() allocate a temporary buffer to hold the netlink message which is subsequently sent to userspace. The value returned by qdf_mem_malloc() is not checked for NULL, and hence if NULL is returned it will be dereferenced. However in reality a temporary buffer is not required. Update the functions to directly send the message from the skb. Change-Id: Ia12e1695498323c4e29b8280b9265c20393a2fe7 CRs-Fixed: 2111674 --- utils/nlink/src/wlan_nlink_srv.c | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/utils/nlink/src/wlan_nlink_srv.c b/utils/nlink/src/wlan_nlink_srv.c index 4be9b17dc46d..2c7d56a946cd 100644 --- a/utils/nlink/src/wlan_nlink_srv.c +++ b/utils/nlink/src/wlan_nlink_srv.c @@ -493,22 +493,17 @@ int nl_srv_bcast(struct sk_buff *skb, int mcgroup_id, int app_id) struct nlmsghdr *nlh = (struct nlmsghdr *)skb->data; void *msg = NLMSG_DATA(nlh); uint32_t msg_len = nlmsg_len(nlh); - uint8_t *tempbuf; int status; - tempbuf = (uint8_t *)qdf_mem_malloc(msg_len); - qdf_mem_copy(tempbuf, msg, msg_len); - status = send_msg_to_cld80211(mcgroup_id, 0, app_id, tempbuf, msg_len); + status = send_msg_to_cld80211(mcgroup_id, 0, app_id, msg, msg_len); if (status) { QDF_TRACE(QDF_MODULE_ID_HDD, QDF_TRACE_LEVEL_ERROR, "send msg to cld80211 fails for app id %d", app_id); dev_kfree_skb(skb); - qdf_mem_free(tempbuf); return -EPERM; } dev_kfree_skb(skb); - qdf_mem_free(tempbuf); return 0; } qdf_export_symbol(nl_srv_bcast); @@ -534,23 +529,18 @@ int nl_srv_ucast(struct sk_buff *skb, int dst_pid, int flag, struct nlmsghdr *nlh = (struct nlmsghdr *)skb->data; void *msg = NLMSG_DATA(nlh); uint32_t msg_len = nlmsg_len(nlh); - uint8_t *tempbuf; int status; - tempbuf = (uint8_t *)qdf_mem_malloc(msg_len); - qdf_mem_copy(tempbuf, msg, msg_len); status = send_msg_to_cld80211(mcgroup_id, dst_pid, app_id, - tempbuf, msg_len); + msg, msg_len); if (status) { QDF_TRACE(QDF_MODULE_ID_HDD, QDF_TRACE_LEVEL_ERROR, "send msg to cld80211 fails for app id %d", app_id); dev_kfree_skb(skb); - qdf_mem_free(tempbuf); return -EPERM; } dev_kfree_skb(skb); - qdf_mem_free(tempbuf); return 0; } #else From 7df3f4f74ba883dbac71a550699f72e7847993b4 Mon Sep 17 00:00:00 2001 From: Kai Chen Date: Fri, 18 Aug 2017 13:48:06 -0700 Subject: [PATCH 06/11] qcacmn: Regulatory add 4.9 channel support Add 4.9 channel support. Populate 4.9 channel to channel list Change-Id: I5a8f990fd28cba027b5200cb3dd8dc1949a7db7c CRs-Fixed: 2105631 --- .../lmac_if/inc/wlan_lmac_if_def.h | 2 ++ .../lmac_if/src/wlan_lmac_if.c | 3 +++ umac/regulatory/core/src/reg_services.c | 22 ++++++++++++++----- umac/regulatory/core/src/reg_services.h | 9 ++++++++ .../inc/reg_services_public_struct.h | 8 +++++++ .../dispatcher/inc/wlan_reg_services_api.h | 4 ++++ 6 files changed, 43 insertions(+), 5 deletions(-) diff --git a/umac/global_umac_dispatcher/lmac_if/inc/wlan_lmac_if_def.h b/umac/global_umac_dispatcher/lmac_if/inc/wlan_lmac_if_def.h index 98c54ea0d21b..19da7f8cffe6 100644 --- a/umac/global_umac_dispatcher/lmac_if/inc/wlan_lmac_if_def.h +++ b/umac/global_umac_dispatcher/lmac_if/inc/wlan_lmac_if_def.h @@ -604,6 +604,8 @@ struct wlan_lmac_if_reg_rx_ops { enum dfs_reg *dfs_reg); QDF_STATUS (*reg_ch_avoid_event_handler)(struct wlan_objmgr_psoc *psoc, struct ch_avoid_ind_type *ch_avoid_ind); + uint32_t (*reg_freq_to_chan)(struct wlan_objmgr_pdev *pdev, + uint32_t freq); }; #ifdef CONVERGED_P2P_ENABLE diff --git a/umac/global_umac_dispatcher/lmac_if/src/wlan_lmac_if.c b/umac/global_umac_dispatcher/lmac_if/src/wlan_lmac_if.c index 0bdfa17b96b4..dea3f1157a8c 100644 --- a/umac/global_umac_dispatcher/lmac_if/src/wlan_lmac_if.c +++ b/umac/global_umac_dispatcher/lmac_if/src/wlan_lmac_if.c @@ -211,6 +211,9 @@ static void wlan_lmac_if_umac_reg_rx_ops_register( rx_ops->reg_rx_ops.reg_ch_avoid_event_handler = tgt_reg_process_ch_avoid_event; + + rx_ops->reg_rx_ops.reg_freq_to_chan = + wlan_reg_freq_to_chan; } #ifdef CONVERGED_P2P_ENABLE diff --git a/umac/regulatory/core/src/reg_services.c b/umac/regulatory/core/src/reg_services.c index 2e0325b9bbbd..4c02b2898360 100644 --- a/umac/regulatory/core/src/reg_services.c +++ b/umac/regulatory/core/src/reg_services.c @@ -1750,7 +1750,7 @@ static void reg_populate_band_channels(enum channel_enum start_chan, enum channel_enum end_chan, struct cur_reg_rule *rule_start_ptr, uint32_t num_reg_rules, - uint16_t min_bw, + uint16_t min_reg_bw, struct regulatory_channel *mas_chan_list) { struct cur_reg_rule *found_rule_ptr; @@ -1759,19 +1759,23 @@ static void reg_populate_band_channels(enum channel_enum start_chan, enum channel_enum chan_enum; uint32_t rule_num, bw; uint16_t max_bw; + uint16_t min_bw; for (chan_enum = start_chan; chan_enum <= end_chan; chan_enum++) { found_rule_ptr = NULL; max_bw = QDF_MIN((uint16_t)20, channel_map[chan_enum].max_bw); - min_bw = QDF_MAX(min_bw, channel_map[chan_enum].min_bw); + min_bw = QDF_MAX(min_reg_bw, channel_map[chan_enum].min_bw); - for (bw = max_bw; ((bw >= min_bw) && (NULL == found_rule_ptr)); - bw = bw/2) { + if (channel_map[chan_enum].chan_num == INVALID_CHANNEL_NUM) + continue; + + for (bw = max_bw; bw >= min_bw; bw = bw/2) { for (rule_num = 0, cur_rule_ptr = rule_start_ptr; rule_num < num_reg_rules; cur_rule_ptr++, rule_num++) { + if ((cur_rule_ptr->start_freq <= mas_chan_list[chan_enum].center_freq - bw/2) && @@ -1782,11 +1786,13 @@ static void reg_populate_band_channels(enum channel_enum start_chan, break; } } - break; + if (found_rule_ptr) + break; } if (found_rule_ptr) { mas_chan_list[chan_enum].max_bw = bw; + reg_fill_channel_info(chan_enum, found_rule_ptr, mas_chan_list, min_bw); } @@ -2610,6 +2616,12 @@ QDF_STATUS reg_process_master_chan_list(struct cur_regulatory_info reg_rule_5g, num_5g_reg_rules, min_bw_5g, mas_chan_list); + if (num_5g_reg_rules != 0) + reg_populate_band_channels(MIN_49GHZ_CHANNEL, + MAX_49GHZ_CHANNEL, + reg_rule_5g, num_5g_reg_rules, + min_bw_5g, mas_chan_list); + soc_reg->cc_src = SOURCE_DRIVER; if (soc_reg->new_user_ctry_pending == true) { soc_reg->new_user_ctry_pending = false; diff --git a/umac/regulatory/core/src/reg_services.h b/umac/regulatory/core/src/reg_services.h index 5e906261d53d..ce8ce69adf30 100644 --- a/umac/regulatory/core/src/reg_services.h +++ b/umac/regulatory/core/src/reg_services.h @@ -47,6 +47,15 @@ ((chan_num >= REG_MIN_24GHZ_CH_NUM) && \ (chan_num <= REG_MAX_24GHZ_CH_NUM)) +#ifndef CONFIG_LEGACY_CHAN_ENUM +#define REG_MIN_49GHZ_CH_FREQ channel_map[MIN_49GHZ_CHANNEL].center_freq +#define REG_MAX_49GHZ_CH_FREQ channel_map[MAX_49GHZ_CHANNEL].center_freq + +#define REG_IS_49GHZ_FREQ(freq) \ + ((freq >= REG_MIN_49GHZ_CH_FREQ) && \ + (freq <= REG_MAX_49GHZ_CH_FREQ)) +#endif + #define REG_IS_5GHZ_CH(chan_num) \ ((chan_num >= REG_MIN_5GHZ_CH_NUM) && \ (chan_num <= REG_MAX_5GHZ_CH_NUM)) diff --git a/umac/regulatory/dispatcher/inc/reg_services_public_struct.h b/umac/regulatory/dispatcher/inc/reg_services_public_struct.h index 02c92e6ce215..f127a4681c0f 100644 --- a/umac/regulatory/dispatcher/inc/reg_services_public_struct.h +++ b/umac/regulatory/dispatcher/inc/reg_services_public_struct.h @@ -170,6 +170,10 @@ enum channel_enum { MAX_24GHZ_CHANNEL = CHAN_ENUM_14, NUM_24GHZ_CHANNELS = (MAX_24GHZ_CHANNEL - MIN_24GHZ_CHANNEL + 1), + MIN_49GHZ_CHANNEL = INVALID_CHANNEL_NUM, + MAX_49GHZ_CHANNEL = INVALID_CHANNEL_NUM - 1, + NUM_49GHZ_CHANNELS = MAX_49GHZ_CHANNEL - MIN_49GHZ_CHANNEL + 1, + MIN_5GHZ_CHANNEL = CHAN_ENUM_36, MAX_5GHZ_CHANNEL = CHAN_ENUM_184, NUM_5GHZ_CHANNELS = (MAX_5GHZ_CHANNEL - MIN_5GHZ_CHANNEL + 1), @@ -389,6 +393,10 @@ enum channel_enum { MAX_24GHZ_CHANNEL = CHAN_ENUM_2484, NUM_24GHZ_CHANNELS = (MAX_24GHZ_CHANNEL - MIN_24GHZ_CHANNEL + 1), + MIN_49GHZ_CHANNEL = CHAN_ENUM_4912, + MAX_49GHZ_CHANNEL = CHAN_ENUM_5080, + NUM_49GHZ_CHANNELS = (MAX_49GHZ_CHANNEL - MIN_49GHZ_CHANNEL + 1), + MIN_5GHZ_CHANNEL = CHAN_ENUM_5180, MAX_5GHZ_CHANNEL = CHAN_ENUM_5920, NUM_5GHZ_CHANNELS = (MAX_5GHZ_CHANNEL - MIN_5GHZ_CHANNEL + 1), diff --git a/umac/regulatory/dispatcher/inc/wlan_reg_services_api.h b/umac/regulatory/dispatcher/inc/wlan_reg_services_api.h index 2b562f8eca37..4ce923b86046 100644 --- a/umac/regulatory/dispatcher/inc/wlan_reg_services_api.h +++ b/umac/regulatory/dispatcher/inc/wlan_reg_services_api.h @@ -41,6 +41,10 @@ #define WLAN_REG_IS_5GHZ_CH(chan) REG_IS_5GHZ_CH(chan) #define WLAN_REG_IS_11P_CH(chan) REG_IS_11P_CH(chan) +#ifndef CONFIG_LEGACY_CHAN_ENUM +#define WLAN_REG_IS_49GHZ_FREQ(freq) REG_IS_49GHZ_FREQ(freq) +#endif + #define WLAN_REG_CH_NUM(ch_enum) REG_CH_NUM(ch_enum) #define WLAN_REG_CH_TO_FREQ(ch_enum) REG_CH_TO_FREQ(ch_enum) From 4ff1c130d34d08212113241ed395019805001892 Mon Sep 17 00:00:00 2001 From: Dustin Brown Date: Thu, 17 Aug 2017 16:57:01 -0700 Subject: [PATCH 07/11] qcacmn: Remove vma from vm_operations_struct->fault handler Linux kernel 4.10 removes the vm_area_struct parameter from the vm_operations_struct->fault handler. Add conditional compilation to provided the appropriate fault handler signature based on the version of the Linux kernel being compiled against. Change-Id: I467f4d8426ecfa55e4f2aac26a5326901239a752 CRs-Fixed: 2094824 --- utils/pktlog/linux_ac.c | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/utils/pktlog/linux_ac.c b/utils/pktlog/linux_ac.c index 7e0aab5d5880..5f7af30610e0 100644 --- a/utils/pktlog/linux_ac.c +++ b/utils/pktlog/linux_ac.c @@ -1003,7 +1003,8 @@ static inline unsigned long pktlog_get_fault_address(struct vm_fault *vmf) } #endif /* KERNEL_VERSION(4, 10, 0) */ -static int pktlog_fault(struct vm_area_struct *vma, struct vm_fault *vmf) +static int +pktlog_fault_handler(struct vm_area_struct *vma, struct vm_fault *vmf) { unsigned long address = pktlog_get_fault_address(vmf); @@ -1018,8 +1019,20 @@ static int pktlog_fault(struct vm_area_struct *vma, struct vm_fault *vmf) return 0; } +#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 10, 0) +static int pktlog_fault(struct vm_area_struct *vma, struct vm_fault *vmf) +{ + return pktlog_fault_handler(vma, vmf); +} +#else +static int pktlog_fault(struct vm_fault *vmf) +{ + return pktlog_fault_handler(vmf->vma, vmf); +} +#endif + static struct vm_operations_struct pktlog_vmops = { - open: pktlog_vopen, + open: pktlog_vopen, close:pktlog_vclose, fault:pktlog_fault, }; From fb49db3c83005cfd91ee0ba1352dfcebb344b95f Mon Sep 17 00:00:00 2001 From: psimha Date: Thu, 31 Aug 2017 15:33:33 -0700 Subject: [PATCH 08/11] qcacmn: Check to prevent crash when reading stats Add a check for update_dp_stats before calling it. This is registered only for WIN & causes a crash on MCL. Change-Id: I584b7dba73bcc2426deb97641c30b4d704ce0d8b CRs-Fixed: 2111735 --- dp/wifi3.0/dp_main.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dp/wifi3.0/dp_main.c b/dp/wifi3.0/dp_main.c index 34263b536849..785dcfae176a 100644 --- a/dp/wifi3.0/dp_main.c +++ b/dp/wifi3.0/dp_main.c @@ -3710,7 +3710,8 @@ void dp_aggregate_vdev_stats(struct dp_vdev *vdev) peer->stats.tx.last_ack_rssi; } - soc->cdp_soc.ol_ops->update_dp_stats(vdev->pdev->osif_pdev, + if (soc->cdp_soc.ol_ops->update_dp_stats) + soc->cdp_soc.ol_ops->update_dp_stats(vdev->pdev->osif_pdev, &vdev->stats, vdev->vdev_id, UPDATE_VDEV_STATS); } From 11e51e2863a2f9163d8ecc45ba3910741f69c95d Mon Sep 17 00:00:00 2001 From: Karunakar Dasineni Date: Mon, 18 Sep 2017 15:48:04 -0700 Subject: [PATCH 09/11] qcacmn: Add pld_stub/inc to qdf include path Add pld_stub/inc to include path in WIN qdf Kbuild. Change-Id: I5a00e4a797384445513f9d48d03c8caa6585e0c0 CRs-Fixed: 2111926 --- qdf/Kbuild | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/qdf/Kbuild b/qdf/Kbuild index cb09c428df14..4f3762b1f779 100644 --- a/qdf/Kbuild +++ b/qdf/Kbuild @@ -26,7 +26,8 @@ INCS += -I$(obj)/$(HOST_CMN_CONVG_PTT)/inc \ -I$(obj)/$(HOST_CMN_CONVG_LOGGING)/inc \ -I$(obj)/$(DEPTH)/cmn_dev/utils/host_diag_log/inc \ -I$(obj)/$(DEPTH)/cmn_dev/utils/host_diag_log/src \ - -I$(obj)/$(DEPTH)/cmn_dev/utils/ptt/inc + -I$(obj)/$(DEPTH)/cmn_dev/utils/ptt/inc \ + -I$(obj)/$(DEPTH)/cmn_dev/pld_stub/inc obj-m += qdf.o From 502dceb933eefe56b2b0a428f637fe3f96498c5b Mon Sep 17 00:00:00 2001 From: Neil Zhao Date: Tue, 8 Aug 2017 11:30:05 -0700 Subject: [PATCH 10/11] qcacmn: fix vdev id limited to 32 issue Issue: create 33 VAPs on both WIFI0 and WIFI1, will see fw crash Root cause: 2nd DWORD in vdev id map array is never used, so max id is 32 Fix: map_index needed to be updated before used to calculate adjust_ix. CRs-Fixed: 2089479 Change-Id: If808d13dbd375197fe637bb53da0bcc3d654ec9e --- umac/cmn_services/obj_mgr/src/wlan_objmgr_psoc_obj.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/umac/cmn_services/obj_mgr/src/wlan_objmgr_psoc_obj.c b/umac/cmn_services/obj_mgr/src/wlan_objmgr_psoc_obj.c index cc45ad82205c..b49639017591 100644 --- a/umac/cmn_services/obj_mgr/src/wlan_objmgr_psoc_obj.c +++ b/umac/cmn_services/obj_mgr/src/wlan_objmgr_psoc_obj.c @@ -812,9 +812,9 @@ QDF_STATUS wlan_objmgr_psoc_vdev_attach(struct wlan_objmgr_psoc *psoc, * The map is two DWORDS(32 bits), so, map_index * adjust_ix derived based on the id value */ - if (id == ((map_index+1)*map_entry_size)) { - adjust_ix = map_index*map_entry_size; + if (id == ((map_index + 1) * map_entry_size)) { map_index++; + adjust_ix = map_index * map_entry_size; } } /* If no free slot, return failure */ From 1d1801c53dbc82094d528eba77b1e0c0a0e67b6d Mon Sep 17 00:00:00 2001 From: Neil Zhao Date: Thu, 10 Aug 2017 11:51:33 -0700 Subject: [PATCH 11/11] qcacmn: add useful debug prints CRs-Fixed: 2089479 Change-Id: I3378fa874095974cd4dce771a6725eee5adc9a41 --- wmi/src/wmi_unified_tlv.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/wmi/src/wmi_unified_tlv.c b/wmi/src/wmi_unified_tlv.c index bd2f07b8435c..d8c6e24c7724 100644 --- a/wmi/src/wmi_unified_tlv.c +++ b/wmi/src/wmi_unified_tlv.c @@ -104,8 +104,8 @@ static QDF_STATUS send_vdev_create_cmd_tlv(wmi_unified_t wmi_handle, cmd->num_cfg_txrx_streams = num_bands; copy_vdev_create_pdev_id(wmi_handle, cmd, param); WMI_CHAR_ARRAY_TO_MAC_ADDR(macaddr, &cmd->vdev_macaddr); - WMI_LOGD("%s: ID = %d VAP Addr = %02x:%02x:%02x:%02x:%02x:%02x", - __func__, param->if_id, + WMI_LOGD("%s: ID = %d[pdev:%d] VAP Addr = %02x:%02x:%02x:%02x:%02x:%02x", + __func__, param->if_id, cmd->pdev_id, macaddr[0], macaddr[1], macaddr[2], macaddr[3], macaddr[4], macaddr[5]); buf_ptr = (uint8_t *)cmd + sizeof(*cmd);