summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFerry Zhou <tianguiz@codeaurora.org>2017-01-16 10:54:26 +0800
committerGerrit - the friendly Code Review server <code-review@localhost>2017-03-28 02:39:21 -0700
commit5dbd50aa9c6f8fa505340f51963ddf16347b2aca (patch)
treed59b800e5baa326fa6b2c46c1169e2486bb7b315
parentd6705e963dece2360ef439f5301c3a4b2070366d (diff)
qcacld-2.0: Add rx TA feature and set TA max duration
IEEE1609.4-2016, section 6.2 describes multi-channel synchronized operation. Existing software and firmware already supports optional feature described in section 6.2.6 "Sending Timing Advertisements", but has not implemented section 6.2.7 "Receiving Timing Information". Add feature receiving time advertisement, and set TA max duration after the last TA received that the local time set by TA is synchronous to other communicating OCB STAs. If the duration expires, then the OCB STA itself without UTC time source like GPS thinks that the local time of itself is not sync to other STAs and stop scheduling DSRC channel switch after the max duration. Change-Id: Idd80bd5e7eac71523255a08040edab33d2355a2f CRs-Fixed: 1112215
-rw-r--r--CORE/HDD/src/wlan_hdd_cfg80211.c1
-rw-r--r--CORE/HDD/src/wlan_hdd_ocb.c19
-rw-r--r--CORE/HDD/src/wlan_hdd_ocb.h6
-rw-r--r--CORE/MAC/inc/sirApi.h2
-rw-r--r--CORE/MAC/src/pe/lim/limProcessMessageQueue.c17
-rw-r--r--CORE/SERVICES/WMA/wma_ocb.c3
6 files changed, 43 insertions, 5 deletions
diff --git a/CORE/HDD/src/wlan_hdd_cfg80211.c b/CORE/HDD/src/wlan_hdd_cfg80211.c
index d2efd75c0841..00ab4d24e97f 100644
--- a/CORE/HDD/src/wlan_hdd_cfg80211.c
+++ b/CORE/HDD/src/wlan_hdd_cfg80211.c
@@ -420,6 +420,7 @@ wlan_hdd_txrx_stypes[NUM_NL80211_IFTYPES] = {
[NL80211_IFTYPE_STATION] = {
.tx = 0xffff,
.rx = BIT(SIR_MAC_MGMT_ACTION) |
+ BIT(SIR_MAC_MGMT_TIME_ADVERT) |
BIT(SIR_MAC_MGMT_PROBE_REQ),
},
[NL80211_IFTYPE_AP] = {
diff --git a/CORE/HDD/src/wlan_hdd_ocb.c b/CORE/HDD/src/wlan_hdd_ocb.c
index 95fde5eca899..7c44a1747b85 100644
--- a/CORE/HDD/src/wlan_hdd_ocb.c
+++ b/CORE/HDD/src/wlan_hdd_ocb.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015-2016 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2015-2017 The Linux Foundation. All rights reserved.
*
* Previously licensed under the ISC license by Qualcomm Atheros, Inc.
*
@@ -755,6 +755,9 @@ static const struct nla_policy qca_wlan_vendor_ocb_set_config_policy[
[QCA_WLAN_VENDOR_ATTR_OCB_SET_CONFIG_DEF_TX_PARAM] = {
.type = NLA_BINARY
},
+ [QCA_WLAN_VENDOR_ATTR_OCB_SET_CONFIG_TA_MAX_DURATION] = {
+ .type = NLA_U32
+ },
};
static const struct nla_policy qca_wlan_vendor_ocb_set_utc_time_policy[
@@ -901,6 +904,7 @@ static int __wlan_hdd_cfg80211_ocb_set_config(struct wiphy *wiphy,
struct nlattr *ndl_active_state_list;
uint32_t ndl_active_state_list_len;
uint32_t flags = 0;
+ uint32_t ta_max_duration = 0;
void *def_tx_param = NULL;
uint32_t def_tx_param_size = 0;
int i;
@@ -971,6 +975,11 @@ static int __wlan_hdd_cfg80211_ocb_set_config(struct wiphy *wiphy,
QCA_WLAN_VENDOR_ATTR_OCB_SET_CONFIG_DEF_TX_PARAM]);
}
+ /* Get the ta max duration. This parameter is optional. */
+ if (tb[QCA_WLAN_VENDOR_ATTR_OCB_SET_CONFIG_TA_MAX_DURATION])
+ ta_max_duration = nla_get_u32(tb[
+ QCA_WLAN_VENDOR_ATTR_OCB_SET_CONFIG_TA_MAX_DURATION]);
+
config = hdd_ocb_config_new(channel_count, schedule_size,
ndl_chan_list_len,
ndl_active_state_list_len);
@@ -982,6 +991,14 @@ static int __wlan_hdd_cfg80211_ocb_set_config(struct wiphy *wiphy,
config->channel_count = channel_count;
config->schedule_size = schedule_size;
config->flags = flags;
+ /*
+ * Set max duration after the last TA received that the local time set
+ * by TA is synchronous to other communicating OCB STAs. If it expires,
+ * the OCB STA itself without UTC time source like GPS thinks that the
+ * local time of itself is not sync to other STAs and stop scheduling
+ * DSRC channel switch.
+ */
+ config->ta_max_duration = ta_max_duration;
config->def_tx_param = def_tx_param;
config->def_tx_param_size = def_tx_param_size;
diff --git a/CORE/HDD/src/wlan_hdd_ocb.h b/CORE/HDD/src/wlan_hdd_ocb.h
index f7172f4c5bc7..535f74005cb8 100644
--- a/CORE/HDD/src/wlan_hdd_ocb.h
+++ b/CORE/HDD/src/wlan_hdd_ocb.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015-2016 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2015-2017 The Linux Foundation. All rights reserved.
*
* Previously licensed under the ISC license by Qualcomm Atheros, Inc.
*
@@ -96,6 +96,9 @@ struct dot11p_channel_sched {
* @QCA_WLAN_VENDOR_ATTR_OCB_SET_CONFIG_DEF_TX_PARAM:
* default TX parameters to use in the case that a packet is sent without
* a TX control header
+ * @QCA_WLAN_VENDOR_ATTR_OCB_SET_CONFIG_TA_MAX_DURATION:
+ * max duration after the last TA received that the local time set
+ * by TA is synchronous to other communicating OCB STAs
*/
enum qca_wlan_vendor_attr_ocb_set_config {
QCA_WLAN_VENDOR_ATTR_OCB_SET_CONFIG_INVALID = 0,
@@ -107,6 +110,7 @@ enum qca_wlan_vendor_attr_ocb_set_config {
QCA_WLAN_VENDOR_ATTR_OCB_SET_CONFIG_NDL_ACTIVE_STATE_ARRAY,
QCA_WLAN_VENDOR_ATTR_OCB_SET_CONFIG_FLAGS,
QCA_WLAN_VENDOR_ATTR_OCB_SET_CONFIG_DEF_TX_PARAM,
+ QCA_WLAN_VENDOR_ATTR_OCB_SET_CONFIG_TA_MAX_DURATION,
QCA_WLAN_VENDOR_ATTR_OCB_SET_CONFIG_AFTER_LAST,
QCA_WLAN_VENDOR_ATTR_OCB_SET_CONFIG_MAX =
QCA_WLAN_VENDOR_ATTR_OCB_SET_CONFIG_AFTER_LAST - 1,
diff --git a/CORE/MAC/inc/sirApi.h b/CORE/MAC/inc/sirApi.h
index 990d4885241c..4c2f67525565 100644
--- a/CORE/MAC/inc/sirApi.h
+++ b/CORE/MAC/inc/sirApi.h
@@ -7104,6 +7104,7 @@ struct sir_ocb_config_sched {
* @channel_count: number of channels
* @schedule_size: size of the channel schedule
* @flags: reserved
+ * @ta_max_duration: ta max duration after last ta received
* @channels: array of OCB channels
* @schedule: array of OCB schedule elements
* @dcc_ndl_chan_list_len: size of the ndl_chan array
@@ -7118,6 +7119,7 @@ struct sir_ocb_config {
uint32_t channel_count;
uint32_t schedule_size;
uint32_t flags;
+ uint32_t ta_max_duration;
struct sir_ocb_config_channel *channels;
struct sir_ocb_config_sched *schedule;
uint32_t dcc_ndl_chan_list_len;
diff --git a/CORE/MAC/src/pe/lim/limProcessMessageQueue.c b/CORE/MAC/src/pe/lim/limProcessMessageQueue.c
index 34a869430cb4..641c525708cc 100644
--- a/CORE/MAC/src/pe/lim/limProcessMessageQueue.c
+++ b/CORE/MAC/src/pe/lim/limProcessMessageQueue.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011-2016 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2011-2017 The Linux Foundation. All rights reserved.
*
* Previously licensed under the ISC license by Qualcomm Atheros, Inc.
*
@@ -815,7 +815,10 @@ limHandle80211Frames(tpAniSirGlobal pMac, tpSirMsgQ limMsg, tANI_U8 *pDeferMsg)
if((fc.subType != SIR_MAC_MGMT_PROBE_RSP )&&
(fc.subType != SIR_MAC_MGMT_BEACON)&&
(fc.subType != SIR_MAC_MGMT_PROBE_REQ)
- && (fc.subType != SIR_MAC_MGMT_ACTION ) //Public action frame can be received from non-associated stations.
+ /* TA for 11p DSRC */
+ && (fc.subType != SIR_MAC_MGMT_TIME_ADVERT)
+ /* Public action frame can be received from non-associated STAs */
+ && (fc.subType != SIR_MAC_MGMT_ACTION )
)
{
@@ -935,6 +938,16 @@ limHandle80211Frames(tpAniSirGlobal pMac, tpSirMsgQ limMsg, tANI_U8 *pDeferMsg)
limProcessDeauthFrame(pMac, pRxPacketInfo,psessionEntry);
break;
+ case SIR_MAC_MGMT_TIME_ADVERT:
+ {
+ tANI_U32 frameLen = WDA_GET_RX_PAYLOAD_LEN(pRxPacketInfo);
+ limSendSmeMgmtFrameInd(pMac, SIR_MAC_MGMT_TIME_ADVERT,
+ (tANI_U8*)pHdr, frameLen + sizeof(tSirMacMgmtHdr),
+ 0, WDA_GET_RX_CH(pRxPacketInfo), NULL,
+ WDA_GET_RX_RSSI_RAW(pRxPacketInfo));
+ }
+ break;
+
case SIR_MAC_MGMT_ACTION:
if(psessionEntry == NULL)
limProcessActionFrameNoSession(pMac, pRxPacketInfo);
diff --git a/CORE/SERVICES/WMA/wma_ocb.c b/CORE/SERVICES/WMA/wma_ocb.c
index 2bdfe5102fc7..247ef82c4d8a 100644
--- a/CORE/SERVICES/WMA/wma_ocb.c
+++ b/CORE/SERVICES/WMA/wma_ocb.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015-2016 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2015-2017 The Linux Foundation. All rights reserved.
*
* Previously licensed under the ISC license by Qualcomm Atheros, Inc.
*
@@ -311,6 +311,7 @@ int wma_ocb_set_config(tp_wma_handle wma_handle, struct sir_ocb_config *config)
cmd->channel_count = config->channel_count;
cmd->schedule_size = config->schedule_size;
cmd->flags = config->flags;
+ cmd->ta_max_duration = config->ta_max_duration;
buf_ptr += sizeof(*cmd);
/* Add the wmi_channel info */