qcacld-3.0: Implement ECSA Action Frame

qcacld-2.0 to qcacld-3.0 propagation.

Implement:
1. Send & receive logic of ECSA action frame from P2P-CLI/GO
2. Trigger channel change on P2P GO side once ECSA action frame
   is received by,
  i) Adding CSA & ESCA IE in beacon template and updating
     FW to send it out
  ii) Notifying supplicant of channel change for P2P GO.

This change include UMAC changes.

CRs-fixed: 895240
Change-Id: Ie6c9154fb44ec75c699e37aaba660c637869c099
This commit is contained in:
Abhishek Singh
2015-10-19 17:42:01 +05:30
committed by Satish Singh
orang tua e8df7b2e33
melakukan 07acefecec
21 mengubah file dengan 1615 tambahan dan 907 penghapusan

Melihat File

@@ -5396,4 +5396,28 @@ enum powersave_mode {
PS_DUTY_CYCLING_QPOWER = 5
};
/**
* struct sir_sme_ext_change_chan_req - channel change request
* @message_type: message id
* @length: msg length
* @new_channel: new channel
* @session_id: session id
*/
struct sir_sme_ext_cng_chan_req {
uint16_t message_type; /* eWNI_SME_EXT_CHANGE_CHANNEL */
uint16_t length;
uint32_t new_channel;
uint8_t session_id;
};
/**
* struct sir_sme_ext_change_chan_ind.
* @session_id: session id
* @new_channel: new channel to change
*/
struct sir_sme_ext_cng_chan_ind {
uint8_t session_id;
uint8_t new_channel;
};
#endif /* __SIR_API_H */

Melihat File

@@ -214,6 +214,8 @@
/* Public Action for 20/40 BSS Coexistence */
#define SIR_MAC_ACTION_2040_BSS_COEXISTENCE 0
#define SIR_MAC_ACTION_EXT_CHANNEL_SWITCH_ID 4
#ifdef WLAN_FEATURE_11W
/* 11w SA query request/response action frame category code */
@@ -355,6 +357,10 @@
#define SIR_MAC_EXTENDED_RATE_EID 50
#define SIR_MAC_EXTENDED_RATE_EID_MIN 0
#define SIR_MAC_EXTENDED_RATE_EID_MAX 255
#define SIR_MAC_CHNL_EXTENDED_SWITCH_ANN_EID 60
#define SIR_MAC_CHNL_EXTENDED_SWITCH_ANN_EID_MIN 0
#define SIR_MAC_CHNL_EXTENDED_SWITCH_ANN_EID_MAX 255
/* reserved 51-69 */
#define SIR_MAC_RM_ENABLED_CAPABILITY_EID 70
#define SIR_MAC_RM_ENABLED_CAPABILITY_EID_MIN 5

Melihat File

@@ -247,6 +247,8 @@ enum eWniMsgTypes {
eWNI_SME_ROC_CMD,
eWNI_SME_SET_THERMAL_LEVEL_IND,
eWNI_SME_SET_IE_REQ,
eWNI_SME_EXT_CHANGE_CHANNEL,
eWNI_SME_EXT_CHANGE_CHANNEL_IND,
eWNI_SME_MSG_TYPES_END
};

Melihat File

@@ -390,6 +390,15 @@ FF VhtUserPositionArray(16) // 8.4.1.52
userPositionArray[16];
}
FF ext_chan_switch_ann_action(4)
{
{
switch_mode: 8;
op_class: 8;
new_channel: 8;
switch_count: 8;
}
}
/////////////////////////////////////////////////////////////////////////////
// TLVs //
@@ -3600,6 +3609,13 @@ FRAME TimingAdvertisementFrame // 8.3.3.15
OPTIE Vendor3IE;
}
FRAME ext_channel_switch_action_frame
{
FF Category;
FF Action;
FF ext_chan_switch_ann_action;
}
// Local Variables:
// mode: c++
// fill-column: 77

Melihat File

@@ -35,7 +35,7 @@
*
*
* This file was automatically generated by 'framesc'
* Wed Oct 14 10:14:42 2015 from the following file(s):
* Mon Nov 16 10:55:21 2015 from the following file(s):
*
* dot11f.frms
*
@@ -544,6 +544,32 @@ void dot11f_pack_ff_vht_user_position_array(tpAniSirGlobal,
uint8_t *);
typedef struct sDot11fFfext_chan_switch_ann_action {
uint32_t switch_mode:8;
uint32_t op_class:8;
uint32_t new_channel:8;
uint32_t switch_count:8;
} tDot11fFfext_chan_switch_ann_action;
#define DOT11F_FF_EXT_CHAN_SWITCH_ANN_ACTION_LEN (4)
void dot11f_unpack_ff_ext_chan_switch_ann_action(tpAniSirGlobal, uint8_t *,
tDot11fFfext_chan_switch_ann_action *);
void dot11f_pack_ff_ext_chan_switch_ann_action(tpAniSirGlobal,
tDot11fFfext_chan_switch_ann_action *,
uint8_t *);
#define EXT_CHAN_SWITCH_ANN_ACTION_SWITCH_MODE_OFFSET 0
#define EXT_CHAN_SWITCH_ANN_ACTION_SWITCH_MODE_WIDTH 8
#define EXT_CHAN_SWITCH_ANN_ACTION_OP_CLASS_OFFSET 8
#define EXT_CHAN_SWITCH_ANN_ACTION_OP_CLASS_WIDTH 8
#define EXT_CHAN_SWITCH_ANN_ACTION_NEW_CHANNEL_OFFSET 16
#define EXT_CHAN_SWITCH_ANN_ACTION_NEW_CHANNEL_WIDTH 8
#define EXT_CHAN_SWITCH_ANN_ACTION_SWITCH_COUNT_OFFSET 24
#define EXT_CHAN_SWITCH_ANN_ACTION_SWITCH_COUNT_WIDTH 8
/*********************************************************************
* TLVs *
********************************************************************/
@@ -8890,6 +8916,32 @@ uint32_t dot11f_get_packed_wmm_del_ts_size(tpAniSirGlobal pCtx,
} /* End extern "C". */
#endif /* C++ */
typedef struct sDot11fext_channel_switch_action_frame {
tDot11fFfCategory Category;
tDot11fFfAction Action;
tDot11fFfext_chan_switch_ann_action ext_chan_switch_ann_action;
} tDot11fext_channel_switch_action_frame;
#define DOT11F_EXT_CHANNEL_SWITCH_ACTION_FRAME (46)
#ifdef __cplusplus
extern "C" {
#endif /* C++ */
uint32_t dot11f_unpack_ext_channel_switch_action_frame(tpAniSirGlobal pCtx,
uint8_t *pBuf, uint32_t nBuf,
tDot11fext_channel_switch_action_frame * pFrm);
uint32_t dot11f_pack_ext_channel_switch_action_frame(tpAniSirGlobal pCtx,
tDot11fext_channel_switch_action_frame *pFrm, uint8_t *pBuf,
uint32_t nBuf, uint32_t *pnConsumed);
uint32_t dot11f_get_packed_ext_channel_switch_action_frame_size(tpAniSirGlobal pCtx,
tDot11fext_channel_switch_action_frame *pFrm,
uint32_t *pnNeeded);
#ifdef __cplusplus
} /* End extern "C". */
#endif /* C++ */
typedef struct sDot11fht2040_bss_coexistence_mgmt_action_frame{
tDot11fFfCategory Category;
tDot11fFfAction Action;
@@ -8897,7 +8949,7 @@ typedef struct sDot11fht2040_bss_coexistence_mgmt_action_frame{
tDot11fIEht2040_bss_intolerant_report ht2040_bss_intolerant_report;
} tDot11fht2040_bss_coexistence_mgmt_action_frame;
#define DOT11F_HT2040_BSS_COEXISTENCE_MGMT_ACTION_FRAME (46)
#define DOT11F_HT2040_BSS_COEXISTENCE_MGMT_ACTION_FRAME (47)
#ifdef __cplusplus
extern "C" {

Melihat File

@@ -56,7 +56,7 @@
#include "rrm_api.h"
#endif
#include "lim_session_utils.h"
#include "cds_concurrency.h"
#include "wma_types.h"
@@ -338,6 +338,110 @@ static void __lim_process_channel_switch_action_frame(tpAniSirGlobal mac_ctx,
return;
}
/**
* lim_process_ext_channel_switch_action_frame()- Process ECSA Action
* Frames.
* @mac_ctx: pointer to global mac structure
* @rx_packet_info: rx packet meta information
* @session_entry: Session entry.
*
* This function is called when ECSA action frame is received.
*
* Return: void
*/
static void
lim_process_ext_channel_switch_action_frame(tpAniSirGlobal mac_ctx,
uint8_t *rx_packet_info, tpPESession session_entry)
{
tpSirMacMgmtHdr hdr;
uint8_t *body;
tDot11fext_channel_switch_action_frame *ext_channel_switch_frame;
uint32_t frame_len;
uint32_t status;
uint8_t target_channel;
hdr = WMA_GET_RX_MAC_HEADER(rx_packet_info);
body = WMA_GET_RX_MPDU_DATA(rx_packet_info);
frame_len = WMA_GET_RX_PAYLOAD_LEN(rx_packet_info);
lim_log(mac_ctx, LOG1, FL("Received EXT Channel switch action frame"));
ext_channel_switch_frame =
cdf_mem_malloc(sizeof(*ext_channel_switch_frame));
if (NULL == ext_channel_switch_frame) {
lim_log(mac_ctx, LOGE, FL("AllocateMemory failed"));
return;
}
/* Unpack channel switch frame */
status = dot11f_unpack_ext_channel_switch_action_frame(mac_ctx,
body, frame_len, ext_channel_switch_frame);
if (DOT11F_FAILED(status)) {
lim_log(mac_ctx, LOGE,
FL("Failed to parse CHANSW action frame (0x%08x, len %d):"),
status, frame_len);
cdf_mem_free(ext_channel_switch_frame);
return;
} else if (DOT11F_WARNED(status)) {
lim_log(mac_ctx, LOGW,
FL("There were warnings while unpacking CHANSW Request (0x%08x, %d bytes):"),
status, frame_len);
}
target_channel =
ext_channel_switch_frame->ext_chan_switch_ann_action.new_channel;
/* Free ext_channel_switch_frame here as its no longer needed */
cdf_mem_free(ext_channel_switch_frame);
/*
* Now, validate if channel change is required for the passed
* channel and if is valid in the current regulatory domain,
* and no concurrent session is running.
*/
if (!((session_entry->currentOperChannel != target_channel) &&
((cds_get_channel_state(target_channel)
== CHANNEL_STATE_ENABLE) ||
(cds_get_channel_state(target_channel) == CHANNEL_STATE_DFS &&
!cds_concurrent_open_sessions_running())))) {
lim_log(mac_ctx, LOGE, FL("Channel %d is not valid"),
target_channel);
return;
}
if (eLIM_AP_ROLE == session_entry->limSystemRole) {
struct sir_sme_ext_cng_chan_ind *ext_cng_chan_ind;
tSirMsgQ mmh_msg;
ext_cng_chan_ind = cdf_mem_malloc(sizeof(*ext_cng_chan_ind));
if (NULL == ext_cng_chan_ind) {
lim_log(mac_ctx, LOGP,
FL("AllocateMemory failed for ext_cng_chan_ind"));
return;
}
cdf_mem_zero(ext_cng_chan_ind,
sizeof(*ext_cng_chan_ind));
ext_cng_chan_ind->session_id =
session_entry->smeSessionId;
/* No need to extract op mode as BW will be decided in
* in SAP FSM depending on previous BW.
*/
ext_cng_chan_ind->new_channel = target_channel;
mmh_msg.type = eWNI_SME_EXT_CHANGE_CHANNEL_IND;
mmh_msg.bodyptr = ext_cng_chan_ind;
mmh_msg.bodyval = 0;
lim_sys_process_mmh_msg_api(mac_ctx, &mmh_msg, ePROT);
}
return;
} /*** end lim_process_ext_channel_switch_action_frame() ***/
#ifdef WLAN_FEATURE_11AC
/**
* __lim_process_operating_mode_action_frame() - To process op mode frames
@@ -1943,7 +2047,10 @@ void lim_process_action_frame(tpAniSirGlobal mac_ctx,
WMA_GET_RX_CH(rx_pkt_info), session, rssi);
break;
#endif
case SIR_MAC_ACTION_EXT_CHANNEL_SWITCH_ID:
lim_process_ext_channel_switch_action_frame(mac_ctx,
rx_pkt_info, session);
break;
default:
lim_log(mac_ctx, LOGE,
FL("Unhandled public action frame -- %x "),

Melihat File

@@ -1353,6 +1353,7 @@ void lim_process_messages(tpAniSirGlobal mac_ctx, tpSirMsgQ msg)
#if defined(FEATURE_WLAN_ESE) && defined(FEATURE_WLAN_ESE_UPLOAD)
case eWNI_SME_GET_TSM_STATS_REQ:
#endif /* FEATURE_WLAN_ESE && FEATURE_WLAN_ESE_UPLOAD */
case eWNI_SME_EXT_CHANGE_CHANNEL:
/* These messages are from HDD.No need to respond to HDD */
lim_process_normal_hdd_msg(mac_ctx, msg, false);
break;

Melihat File

@@ -64,6 +64,7 @@
#if defined WLAN_FEATURE_VOWIFI_11R
#include <lim_ft.h>
#endif
#include "cds_regdomain_common.h"
/*
* This overhead is time for sending NOA start to host in case of GO/sending
@@ -114,6 +115,10 @@ static void lim_process_update_add_ies(tpAniSirGlobal pMac, uint32_t *pMsg);
extern void pe_register_wma_handle(tpAniSirGlobal pMac);
static void lim_process_ext_change_channel(tpAniSirGlobal mac_ctx,
uint32_t *msg);
/**
* lim_process_set_hw_mode() - Send set HW mode command to WMA
* @mac: Globacl MAC pointer
@@ -4988,6 +4993,9 @@ bool lim_process_sme_req_messages(tpAniSirGlobal pMac, tpSirMsgQ pMsg)
case eWNI_SME_SET_IE_REQ:
lim_process_set_ie_req(pMac, pMsgBuf);
break;
case eWNI_SME_EXT_CHANGE_CHANNEL:
lim_process_ext_change_channel(pMac, pMsgBuf);
break;
default:
cdf_mem_free((void *)pMsg->bodyptr);
pMsg->bodyptr = NULL;
@@ -5464,6 +5472,58 @@ end:
update_ie->pAdditionIEBuffer = NULL;
}
/**
* send_extended_chan_switch_action_frame()- function to send ECSA
* action frame for each sta connected to SAP/GO and AP in case of
* STA .
* @mac_ctx: pointer to global mac structure
* @new_channel: new channel to switch to.
* @ch_bandwidth: BW of channel to calculate op_class
* @session_entry: pe session
*
* This function is called to send ECSA frame for STA/CLI and SAP/GO.
*
* Return: void
*/
static void send_extended_chan_switch_action_frame(tpAniSirGlobal mac_ctx,
uint16_t new_channel, uint8_t ch_bandwidth,
tpPESession session_entry)
{
uint16_t op_class;
uint8_t switch_mode = 0, i;
tpDphHashNode psta;
op_class = cds_regdm_get_opclass_from_channel(
mac_ctx->scan.countryCodeCurrent,
new_channel,
ch_bandwidth);
if (LIM_IS_AP_ROLE(session_entry) &&
(mac_ctx->sap.SapDfsInfo.disable_dfs_ch_switch == false))
switch_mode = 1;
if (LIM_IS_AP_ROLE(session_entry)) {
for (i = 0; i < mac_ctx->lim.maxStation; i++) {
psta =
session_entry->dph.dphHashTable.pDphNodeArray + i;
if (psta && psta->added)
lim_send_extended_chan_switch_action_frame(
mac_ctx,
psta->staAddr,
switch_mode, op_class, new_channel,
LIM_MAX_CSA_IE_UPDATES, session_entry);
}
} else if (LIM_IS_STA_ROLE(session_entry)) {
lim_send_extended_chan_switch_action_frame(mac_ctx,
session_entry->bssId,
switch_mode, op_class, new_channel,
LIM_MAX_CSA_IE_UPDATES, session_entry);
}
}
/**
* lim_process_sme_dfs_csa_ie_request() - process sme dfs csa ie req
*
@@ -5595,9 +5655,55 @@ skip_vht:
lim_send_beacon_ind(mac_ctx, session_entry);
lim_log(mac_ctx, LOG1, FL("Updated CSA IE, IE COUNT = %d"),
session_entry->gLimChannelSwitch.switchCount);
/* Send ECSA Action frame after updating the beacon */
send_extended_chan_switch_action_frame(mac_ctx,
session_entry->gLimChannelSwitch.primaryChannel,
session_entry->gLimChannelSwitch.ch_width,
session_entry);
session_entry->gLimChannelSwitch.switchCount--;
}
/**
* lim_process_ext_change_channel()- function to send ECSA
* action frame for STA/CLI .
* @mac_ctx: pointer to global mac structure
* @msg: params from sme for new channel.
*
* This function is called to send ECSA frame for STA/CLI.
*
* Return: void
*/
static void lim_process_ext_change_channel(tpAniSirGlobal mac_ctx,
uint32_t *msg)
{
struct sir_sme_ext_cng_chan_req *ext_chng_channel =
(struct sir_sme_ext_cng_chan_req *) msg;
tpPESession session_entry = NULL;
if (NULL == msg) {
lim_log(mac_ctx, LOGE, FL("Buffer is Pointing to NULL"));
return;
}
session_entry =
pe_find_session_by_sme_session_id(mac_ctx,
ext_chng_channel->session_id);
if (NULL == session_entry) {
lim_log(mac_ctx, LOGE,
FL("Session not found for given session %d"),
ext_chng_channel->session_id);
return;
}
if (LIM_IS_AP_ROLE(session_entry)) {
lim_log(mac_ctx, LOGE,
FL("not an STA/CLI session"));
return;
}
send_extended_chan_switch_action_frame(mac_ctx,
ext_chng_channel->new_channel,
0, session_entry);
}
/**
* lim_process_nss_update_request() - process sme nss update req
*

Melihat File

@@ -4092,6 +4092,139 @@ lim_send_channel_switch_mgmt_frame(tpAniSirGlobal pMac,
} /* End lim_send_channel_switch_mgmt_frame. */
/**
* lim_send_extended_chan_switch_action_frame()- function to send ECSA
* action frame over the air .
* @mac_ctx: pointer to global mac structure
* @peer: Destination mac.
* @mode: channel switch mode
* @new_op_class: new op class
* @new_channel: new channel to switch
* @count: channel switch count
*
* This function is called to send ECSA frame.
*
* Return: success if frame is sent else return failure
*/
tSirRetStatus
lim_send_extended_chan_switch_action_frame(tpAniSirGlobal mac_ctx,
tSirMacAddr peer, uint8_t mode, uint8_t new_op_class,
uint8_t new_channel, uint8_t count, tpPESession session_entry)
{
tDot11fext_channel_switch_action_frame frm;
uint8_t *frame;
tpSirMacMgmtHdr mac_hdr;
uint32_t num_bytes, n_payload, status;
void *packet;
CDF_STATUS cdf_status;
uint8_t txFlag = 0;
uint8_t sme_session_id = 0;
if (session_entry == NULL) {
lim_log(mac_ctx, LOGE, FL("Session entry is NULL!!!"));
return eSIR_FAILURE;
}
sme_session_id = session_entry->smeSessionId;
cdf_mem_set(&frm, sizeof(frm), 0);
frm.Category.category = SIR_MAC_ACTION_PUBLIC_USAGE;
frm.Action.action = SIR_MAC_ACTION_EXT_CHANNEL_SWITCH_ID;
frm.ext_chan_switch_ann_action.switch_mode = mode;
frm.ext_chan_switch_ann_action.op_class = new_op_class;
frm.ext_chan_switch_ann_action.new_channel = new_channel;
frm.ext_chan_switch_ann_action.switch_count = count;
status = dot11f_get_packed_ext_channel_switch_action_frame_size(mac_ctx,
&frm, &n_payload);
if (DOT11F_FAILED(status)) {
lim_log(mac_ctx, LOGP,
FL("Failed to get packed size for Channel Switch 0x%08x."),
status);
/* We'll fall back on the worst case scenario*/
n_payload = sizeof(tDot11fext_channel_switch_action_frame);
} else if (DOT11F_WARNED(status)) {
lim_log(mac_ctx, LOGW,
FL("There were warnings while calculating the packed size for a Ext Channel Switch (0x%08x)."),
status);
}
num_bytes = n_payload + sizeof(tSirMacMgmtHdr);
cdf_status = cds_packet_alloc((uint16_t)num_bytes,
(void **) &frame, (void **) &packet);
if (!CDF_IS_STATUS_SUCCESS(cdf_status)) {
lim_log(mac_ctx, LOGP,
FL("Failed to allocate %d bytes for a Ext Channel Switch."),
num_bytes);
return eSIR_FAILURE;
}
/* Paranoia*/
cdf_mem_set(frame, num_bytes, 0);
/* Next, we fill out the buffer descriptor */
lim_populate_mac_header(mac_ctx, frame, SIR_MAC_MGMT_FRAME,
SIR_MAC_MGMT_ACTION, peer, session_entry->selfMacAddr);
mac_hdr = (tpSirMacMgmtHdr) frame;
cdf_mem_copy((uint8_t *) mac_hdr->bssId,
(uint8_t *) session_entry->bssId,
sizeof(tSirMacAddr));
status = dot11f_pack_ext_channel_switch_action_frame(mac_ctx, &frm,
frame + sizeof(tSirMacMgmtHdr), n_payload, &n_payload);
if (DOT11F_FAILED(status)) {
lim_log(mac_ctx, LOGE,
FL("Failed to pack a Channel Switch 0x%08x."),
status);
cds_packet_free((void *)packet);
return eSIR_FAILURE;
} else if (DOT11F_WARNED(status)) {
lim_log(mac_ctx, LOGW,
FL("There were warnings while packing a Channel Switch 0x%08x."),
status);
}
if ((SIR_BAND_5_GHZ ==
lim_get_rf_band(session_entry->currentOperChannel)) ||
(session_entry->pePersona == CDF_P2P_CLIENT_MODE) ||
(session_entry->pePersona == CDF_P2P_GO_MODE)) {
txFlag |= HAL_USE_BD_RATE2_FOR_MANAGEMENT_FRAME;
}
lim_log(mac_ctx, LOG1,
FL("Send Ext channel Switch to :"MAC_ADDRESS_STR" with swcount %d, swmode %d , newchannel %d newops %d"),
MAC_ADDR_ARRAY(mac_hdr->da),
frm.ext_chan_switch_ann_action.switch_count,
frm.ext_chan_switch_ann_action.switch_mode,
frm.ext_chan_switch_ann_action.new_channel,
frm.ext_chan_switch_ann_action.op_class);
MTRACE(cdf_trace(CDF_MODULE_ID_PE, TRACE_CODE_TX_MGMT,
session_entry->peSessionId, mac_hdr->fc.subType));
cdf_status = wma_tx_frame(mac_ctx, packet, (uint16_t) num_bytes,
TXRX_FRM_802_11_MGMT,
ANI_TXDIR_TODS,
7,
lim_tx_complete, frame,
txFlag, sme_session_id, 0);
MTRACE(cdf_trace(CDF_MODULE_ID_PE, TRACE_CODE_TX_COMPLETE,
session_entry->peSessionId, cdf_status));
if (!CDF_IS_STATUS_SUCCESS(cdf_status)) {
lim_log(mac_ctx, LOGE,
FL("Failed to send a Ext Channel Switch %X!"),
cdf_status);
/* Pkt will be freed up by the callback */
return eSIR_FAILURE;
}
return eSIR_SUCCESS;
} /* End lim_send_extended_chan_switch_action_frame */
#ifdef WLAN_FEATURE_11AC
tSirRetStatus
lim_send_vht_opmode_notification_frame(tpAniSirGlobal pMac,

Melihat File

@@ -496,6 +496,10 @@ tSirRetStatus lim_send_channel_switch_mgmt_frame(tpAniSirGlobal, tSirMacAddr,
uint8_t, uint8_t, uint8_t,
tpPESession);
tSirRetStatus lim_send_extended_chan_switch_action_frame(tpAniSirGlobal mac_ctx,
tSirMacAddr peer, uint8_t mode, uint8_t new_op_class,
uint8_t new_channel, uint8_t count, tpPESession session_entry);
#ifdef WLAN_FEATURE_11AC
tSirRetStatus lim_send_vht_opmode_notification_frame(tpAniSirGlobal pMac,
tSirMacAddr peer, uint8_t nMode,

Melihat File

@@ -573,6 +573,15 @@ void lim_update_probe_rsp_template_ie_bitmap_beacon2(tpAniSirGlobal pMac,
}
/* EXT Channel Switch Announcement CHNL_EXTENDED_SWITCH_ANN_EID*/
if (beacon2->ext_chan_switch_ann.present) {
set_probe_rsp_ie_bitmap(DefProbeRspIeBitmap,
SIR_MAC_CHNL_EXTENDED_SWITCH_ANN_EID);
cdf_mem_copy((void *)&prb_rsp->ext_chan_switch_ann,
(void *)&beacon2->ext_chan_switch_ann,
sizeof(beacon2->ext_chan_switch_ann));
}
#ifdef FEATURE_AP_MCC_CH_AVOIDANCE
if (beacon2->QComVendorIE.present) {
set_probe_rsp_ie_bitmap(DefProbeRspIeBitmap,

File diff ditekan karena terlalu besar Load Diff

Melihat File

@@ -187,6 +187,7 @@ typedef enum {
eSAP_ACS_SCAN_SUCCESS_EVENT,
#endif
eSAP_ACS_CHANNEL_SELECTED,
eSAP_ECSA_CHANGE_CHAN_IND,
} eSapHddEvent;
typedef enum {
@@ -407,6 +408,15 @@ struct sap_ch_selected_s {
struct sap_roc_ready_ind_s {
uint32_t scan_id;
};
/**
* struct sap_ch_change_ind - channel change indication
* @new_chan: channel to change
*/
struct sap_ch_change_ind {
uint16_t new_chan;
};
/*
* This struct will be filled in and passed to tpWLAN_SAPEventCB that is
* provided during wlansap_start_bss call The event id corresponding to
@@ -450,7 +460,7 @@ typedef struct sap_Event_s {
tSap_DfsNolInfo sapDfsNolInfo;
struct sap_ch_selected_s sap_ch_selected;
struct sap_roc_ready_ind_s sap_roc_ind;
struct sap_ch_change_ind sap_chan_cng_ind;
} sapevt;
} tSap_Event, *tpSap_Event;

Melihat File

@@ -974,6 +974,10 @@ wlansap_roam_callback(void *ctx, tCsrRoamInfo *csr_roam_info, uint32_t roamId,
CDF_TRACE(CDF_MODULE_ID_SAP, CDF_TRACE_LEVEL_INFO_HIGH,
FL("Received set channel response"));
break;
case eCSR_ROAM_EXT_CHG_CHNL_IND:
CDF_TRACE(CDF_MODULE_ID_SAP, CDF_TRACE_LEVEL_INFO_HIGH,
FL("Received set channel Indication"));
break;
default:
CDF_TRACE(CDF_MODULE_ID_SAP, CDF_TRACE_LEVEL_ERROR,
FL("CSR roam_status not handled roam_status = %s (%d)\n"),
@@ -1198,6 +1202,12 @@ wlansap_roam_callback(void *ctx, tCsrRoamInfo *csr_roam_info, uint32_t roamId,
sap_ctx->sapsMachine = eSAP_DISCONNECTED;
/* Inform cfg80211 and hostapd that BSS is not alive anymore */
break;
case eCSR_ROAM_EXT_CHG_CHNL_UPDATE_IND:
cdf_status = sap_signal_hdd_event(sap_ctx, csr_roam_info,
eSAP_ECSA_CHANGE_CHAN_IND, NULL);
if (!CDF_IS_STATUS_SUCCESS(cdf_status))
cdf_ret_status = CDF_STATUS_E_FAILURE;
break;
default:
CDF_TRACE(CDF_MODULE_ID_SAP, CDF_TRACE_LEVEL_ERROR,
FL("CSR roam_result = %s (%d) not handled\n"),

Melihat File

@@ -2814,7 +2814,14 @@ CDF_STATUS sap_signal_hdd_event(ptSapContext sap_ctx,
sap_ap_event.sapevt.sapDfsNolInfo.pDfsList = (void *)
(&mac_ctx->sap.SapDfsInfo.sapDfsChannelNolList[0]);
break;
case eSAP_ECSA_CHANGE_CHAN_IND:
CDF_TRACE(CDF_MODULE_ID_SAP, CDF_TRACE_LEVEL_INFO_HIGH,
"In %s, SAP event callback event = %s",
__func__, "eSAP_ECSA_CHANGE_CHAN_IND");
sap_ap_event.sapHddEventCode = eSAP_ECSA_CHANGE_CHAN_IND;
sap_ap_event.sapevt.sap_chan_cng_ind.new_chan =
csr_roaminfo->target_channel;
break;
default:
CDF_TRACE(CDF_MODULE_ID_SAP, CDF_TRACE_LEVEL_ERROR,
FL("SAP Unknown callback event = %d"),

Melihat File

@@ -2179,7 +2179,7 @@ CDF_STATUS wlansap_de_register_mgmt_frame
SIDE EFFECTS
============================================================================*/
CDF_STATUS
wlansap_channel_change_request(void *pSapCtx, uint8_t targetChannel)
wlansap_channel_change_request(void *pSapCtx, uint8_t target_channel)
{
ptSapContext sapContext = NULL;
CDF_STATUS cdf_ret_status = CDF_STATUS_E_FAILURE;
@@ -2205,7 +2205,7 @@ wlansap_channel_change_request(void *pSapCtx, uint8_t targetChannel)
}
mac_ctx = PMAC_STRUCT(hHal);
phy_mode = sapContext->csr_roamProfile.phyMode;
sapContext->csr_roamProfile.ChannelInfo.ChannelList[0] = targetChannel;
sapContext->csr_roamProfile.ChannelInfo.ChannelList[0] = target_channel;
/*
* We are getting channel bonding mode from sapDfsInfor structure
* because we've implemented channel width fallback mechanism for DFS
@@ -2214,8 +2214,12 @@ wlansap_channel_change_request(void *pSapCtx, uint8_t targetChannel)
cb_mode = mac_ctx->sap.SapDfsInfo.new_cbMode;
vht_channel_width = mac_ctx->sap.SapDfsInfo.new_chanWidth;
ch_params.ch_width = vht_channel_width;
sme_set_ch_params(hHal, phy_mode, targetChannel, 0, &ch_params);
sme_set_ch_params(hHal, phy_mode, target_channel, 0, &ch_params);
sapContext->ch_params.ch_width = vht_channel_width;
/* Update the channel as this will be used to
* send event to supplicant
*/
sapContext->channel = target_channel;
sapContext->csr_roamProfile.ch_params.ch_width = vht_channel_width;
cdf_ret_status = sme_roam_channel_change_req(hHal, sapContext->bssid,
cb_mode, &sapContext->csr_roamProfile);

Melihat File

@@ -528,6 +528,7 @@ typedef enum {
/* Channel sw update notification */
eCSR_ROAM_DFS_CHAN_SW_NOTIFY,
eCSR_ROAM_EXT_CHG_CHNL_IND,
} eRoamCmdStatus;
/* comment inside indicates what roaming callback gets */
@@ -636,6 +637,7 @@ typedef enum {
eCSR_ROAM_RESULT_CHANNEL_CHANGE_FAILURE,
eCSR_ROAM_RESULT_DFS_CHANSW_UPDATE_SUCCESS,
eCSR_ROAM_RESULT_DFS_CHANSW_UPDATE_FAILURE,
eCSR_ROAM_EXT_CHG_CHNL_UPDATE_IND,
} eCsrRoamResult;
/*----------------------------------------------------------------------------
@@ -1374,6 +1376,7 @@ typedef struct tagCsrRoamInfo {
uint8_t replay_ctr[SIR_REPLAY_CTR_LEN];
#endif
tSirSmeChanInfo chan_info;
uint8_t target_channel;
} tCsrRoamInfo;
typedef struct tagCsrFreqScanInfo {
@@ -1400,6 +1403,7 @@ typedef struct sSirSmeAssocIndToUpperLayerCnf {
/* Timing and fine Timing measurement capability clubbed together */
uint8_t timingMeasCap;
tSirSmeChanInfo chan_info;
uint8_t target_channel;
} tSirSmeAssocIndToUpperLayerCnf, *tpSirSmeAssocIndToUpperLayerCnf;
typedef struct tagCsrSummaryStatsInfo {

Melihat File

@@ -946,6 +946,8 @@ CDF_STATUS sme_set_led_flashing(tHalHandle hHal, uint8_t type,
CDF_STATUS sme_handle_dfs_chan_scan(tHalHandle hHal, uint8_t dfs_flag);
CDF_STATUS sme_set_mas(uint32_t val);
CDF_STATUS sme_set_miracast(tHalHandle hal, uint8_t filter_type);
CDF_STATUS sme_ext_change_channel(tHalHandle hHal, uint32_t channel,
uint8_t session_id);
CDF_STATUS sme_configure_modulated_dtim(tHalHandle hal, uint8_t session_id,
uint32_t modulated_dtim);

Melihat File

@@ -1919,6 +1919,48 @@ CDF_STATUS dfs_msg_processor(tpAniSirGlobal pMac, uint16_t msgType, void *pMsgBu
return status;
}
/**
* sme_extended_change_channel_ind()- function to indicate ECSA
* action frame is received in lim to SAP
* @mac_ctx: pointer to global mac structure
* @msg_buf: contain new channel and session id.
*
* This function is called to post ECSA action frame
* receive event to SAP.
*
* Return: success if msg indicated to SAP else return failure
*/
static CDF_STATUS sme_extended_change_channel_ind(tpAniSirGlobal mac_ctx,
void *msg_buf)
{
struct sir_sme_ext_cng_chan_ind *ext_chan_ind;
CDF_STATUS status = CDF_STATUS_SUCCESS;
uint32_t session_id = 0;
tCsrRoamInfo roamInfo = {0};
eRoamCmdStatus roam_status;
eCsrRoamResult roam_result;
ext_chan_ind = msg_buf;
if (NULL == ext_chan_ind) {
sms_log(mac_ctx, LOGE,
FL("pMsg is NULL for eWNI_SME_EXT_CHANGE_CHANNEL_IND"));
return CDF_STATUS_E_FAILURE;
}
session_id = ext_chan_ind->session_id;
roamInfo.target_channel = ext_chan_ind->new_channel;
roam_status = eCSR_ROAM_EXT_CHG_CHNL_IND;
roam_result = eCSR_ROAM_EXT_CHG_CHNL_UPDATE_IND;
sms_log(mac_ctx, LOG1,
FL("sapdfs: Received eWNI_SME_EXT_CHANGE_CHANNEL_IND for session id [%d]"),
session_id);
/* Indicate Ext Channel Change event to SAP */
csr_roam_call_callback(mac_ctx, session_id, &roamInfo, 0,
roam_status, roam_result);
return status;
}
#if defined(FEATURE_WLAN_ESE) && defined(FEATURE_WLAN_ESE_UPLOAD)
/*------------------------------------------------------------------
*
@@ -2681,6 +2723,10 @@ CDF_STATUS sme_process_msg(tHalHandle hHal, cds_msg_t *pMsg)
pMac->sme.set_thermal_level_cb(pMac->hHdd,
pMsg->bodyval);
break;
case eWNI_SME_EXT_CHANGE_CHANNEL_IND:
status = sme_extended_change_channel_ind(pMac, pMsg->bodyptr);
cdf_mem_free(pMsg->bodyptr);
break;
default:
if ((pMsg->type >= eWNI_SME_MSG_TYPES_BEGIN)
@@ -8078,6 +8124,45 @@ CDF_STATUS sme_update_roam_scan_home_away_time(tHalHandle hHal,
return status;
}
/**
* sme_ext_change_channel()- function to post send ECSA
* action frame to csr.
* @hHal: Hal context
* @channel: new channel to switch
* @session_id: senssion it should be sent on.
*
* This function is called to post ECSA frame to csr.
*
* Return: success if msg is sent else return failure
*/
CDF_STATUS sme_ext_change_channel(tHalHandle h_hal, uint32_t channel,
uint8_t session_id)
{
CDF_STATUS status = CDF_STATUS_SUCCESS;
tpAniSirGlobal mac_ctx = PMAC_STRUCT(h_hal);
uint8_t channel_state;
sms_log(mac_ctx, LOGE, FL(" Set Channel %d "), channel);
channel_state =
cds_get_channel_state(channel);
if (CHANNEL_STATE_DISABLE == channel_state) {
sms_log(mac_ctx, LOGE, FL(" Invalid channel %d "), channel);
return CDF_STATUS_E_INVAL;
}
status = sme_acquire_global_lock(&mac_ctx->sme);
if (CDF_STATUS_SUCCESS == status) {
/* update the channel list to the firmware */
status = csr_send_ext_change_channel(mac_ctx,
channel, session_id);
sme_release_global_lock(&mac_ctx->sme);
}
return status;
}
/* ---------------------------------------------------------------------------
\fn sme_get_roam_intra_band
\brief get Intra band roaming

Melihat File

@@ -18344,6 +18344,36 @@ csr_roam_update_add_ies(tpAniSirGlobal pMac,
return status;
}
/**
* csr_send_ext_change_channel()- function to post send ECSA
* action frame to lim.
* @mac_ctx: pointer to global mac structure
* @channel: new channel to switch
* @session_id: senssion it should be sent on.
*
* This function is called to post ECSA frame to lim.
*
* Return: success if msg posted to LIM else return failure
*/
CDF_STATUS csr_send_ext_change_channel(tpAniSirGlobal mac_ctx, uint32_t channel,
uint8_t session_id)
{
CDF_STATUS status = CDF_STATUS_SUCCESS;
struct sir_sme_ext_cng_chan_req *msg;
msg = cdf_mem_malloc(sizeof(*msg));
if (NULL == msg)
return CDF_STATUS_E_NOMEM;
cdf_mem_zero(msg, sizeof(*msg));
msg->message_type = eWNI_SME_EXT_CHANGE_CHANNEL;
msg->length = sizeof(*msg);
msg->new_channel = channel;
msg->session_id = session_id;
status = cds_send_mb_message_to_mac(msg);
return status;
}
/**
* csr_roam_send_chan_sw_ie_request() - Request to transmit CSA IE
* @mac_ctx: Global MAC context

Melihat File

@@ -1056,6 +1056,8 @@ void csr_add_vote_for_country_info(tpAniSirGlobal pMac, uint8_t *pCountryCode);
void csr_clear_votes_for_country_info(tpAniSirGlobal pMac);
#endif
CDF_STATUS csr_send_ext_change_channel(tpAniSirGlobal mac_ctx,
uint32_t channel, uint8_t session_id);
#ifdef QCA_HT_2040_COEX
CDF_STATUS csr_set_ht2040_mode(tpAniSirGlobal pMac, uint32_t sessionId,