qcacld-3.0: Remove unused tdls structures in pe
It alloc memory with structures in sir_api.h, and process/parse them with structures in tdls component, which will cause memory corruption potentially. So, this change refacor these functions and let them use unified structures. Remove unused structures in sir_api.h Here are these functions: - lim_send_sme_tdls_add_sta_rsp - lim_send_tdls_comp_mgmt_rsp - lim_send_sme_tdls_del_sta_rsp - lim_send_sme_mgmt_tx_completion Remove below unused tdls structures: - tSirTdlsDelAllPeerInd - tSirTdlsDelStaInd - tSirTdlsEventnotify - tSirTdlsLinkEstablishReq - tSirTdlsLinkEstablishReqRsp - tSirTdlsAddStaRsp - tSirTdlsDelStaRsp - tSirMgmtTxCompletionInd Change-Id: Ic595cadefcdbeb2df44f97563c4652db409213a2 CRs-Fixed: 2373706
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2017-2018 The Linux Foundation. All rights reserved.
|
* Copyright (c) 2017-2019 The Linux Foundation. All rights reserved.
|
||||||
*
|
*
|
||||||
* Permission to use, copy, modify, and/or distribute this software for
|
* Permission to use, copy, modify, and/or distribute this software for
|
||||||
* any purpose with or without fee is hereby granted, provided that the
|
* any purpose with or without fee is hereby granted, provided that the
|
||||||
@@ -29,53 +29,6 @@
|
|||||||
((TDLS_SETUP_REQUEST <= action) && \
|
((TDLS_SETUP_REQUEST <= action) && \
|
||||||
(TDLS_SETUP_CONFIRM >= action))
|
(TDLS_SETUP_CONFIRM >= action))
|
||||||
|
|
||||||
/**
|
|
||||||
* enum legacy_result_code - defined to comply with tSirResultCodes, need refine
|
|
||||||
* when mlme converged.
|
|
||||||
* @legacy_result_success: success
|
|
||||||
* @legacy_result_max: max result value
|
|
||||||
*/
|
|
||||||
enum legacy_result_code {
|
|
||||||
legacy_result_success,
|
|
||||||
legacy_result_max = 0x7FFFFFFF
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* struct tdls_send_mgmt_rsp - TDLS Response struct PE --> TDLS module
|
|
||||||
* same as struct tSirSmeRsp
|
|
||||||
* @message_type: message type eWNI_SME_TDLS_SEND_MGMT_RSP
|
|
||||||
* @length: message length
|
|
||||||
* @session_id: session id
|
|
||||||
* @transaction_id: transaction id
|
|
||||||
* @status_code: status code as tSirResultCodes
|
|
||||||
* @psoc: soc object
|
|
||||||
*/
|
|
||||||
struct tdls_send_mgmt_rsp {
|
|
||||||
uint16_t message_type;
|
|
||||||
uint16_t length;
|
|
||||||
uint8_t session_id;
|
|
||||||
uint16_t transaction_id;
|
|
||||||
enum legacy_result_code status_code;
|
|
||||||
struct wlan_objmgr_psoc *psoc;
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* struct tdls_mgmt_tx_completion_ind - TDLS TX completion PE --> TDLS module
|
|
||||||
* same as struct sSirMgmtTxCompletionInd
|
|
||||||
* @message_type: message type eWNI_SME_MGMT_FRM_TX_COMPLETION_IND
|
|
||||||
* @length: message length
|
|
||||||
* @session_id: session id
|
|
||||||
* @tx_complete_status: tx complete status
|
|
||||||
* @psoc: soc object
|
|
||||||
*/
|
|
||||||
struct tdls_mgmt_tx_completion_ind {
|
|
||||||
uint16_t message_type;
|
|
||||||
uint16_t length;
|
|
||||||
uint8_t session_id; /* Session ID */
|
|
||||||
uint32_t tx_complete_status;
|
|
||||||
struct wlan_objmgr_psoc *psoc;
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* struct tdls_add_sta_req - TDLS request struct TDLS module --> PE
|
* struct tdls_add_sta_req - TDLS request struct TDLS module --> PE
|
||||||
* same as struct tSirTdlsAddStaReq;
|
* same as struct tSirTdlsAddStaReq;
|
||||||
@@ -117,31 +70,6 @@ struct tdls_add_sta_req {
|
|||||||
uint8_t max_sp;
|
uint8_t max_sp;
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
|
||||||
* struct tdls_add_sta_rsp - TDLS Response struct PE --> TDLS module
|
|
||||||
* same as struct sSirTdlsAddStaRsp
|
|
||||||
* @message_type: message type eWNI_SME_TDLS_ADD_STA_RSP
|
|
||||||
* @length: message length
|
|
||||||
* @status_code: status code as tSirResultCodes
|
|
||||||
* @peermac: MAC address of the TDLS peer
|
|
||||||
* @session_id: session id
|
|
||||||
* @sta_id: sta id
|
|
||||||
* @sta_type: sta type
|
|
||||||
* @tdls_oper: add peer type
|
|
||||||
* @psoc: soc object
|
|
||||||
*/
|
|
||||||
struct tdls_add_sta_rsp {
|
|
||||||
uint16_t message_type;
|
|
||||||
uint16_t length;
|
|
||||||
QDF_STATUS status_code;
|
|
||||||
struct qdf_mac_addr peermac;
|
|
||||||
uint8_t session_id;
|
|
||||||
uint16_t sta_id;
|
|
||||||
uint16_t sta_type;
|
|
||||||
enum tdls_add_oper tdls_oper;
|
|
||||||
struct wlan_objmgr_psoc *psoc;
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* struct tdls_del_sta_req - TDLS Request struct TDLS module --> PE
|
* struct tdls_del_sta_req - TDLS Request struct TDLS module --> PE
|
||||||
* same as sSirTdlsDelStaReq
|
* same as sSirTdlsDelStaReq
|
||||||
@@ -161,27 +89,6 @@ struct tdls_del_sta_req {
|
|||||||
struct qdf_mac_addr peermac;
|
struct qdf_mac_addr peermac;
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
|
||||||
* struct tdls_del_sta_rsp - TDLS Response struct PE --> TDLS module
|
|
||||||
* same as sSirTdlsDelStaRsp
|
|
||||||
* @message_type: message type eWNI_SME_TDLS_DEL_STA_RSP
|
|
||||||
* @length: message length
|
|
||||||
* @session_id: session id
|
|
||||||
* @status_code: status code as tSirResultCodes
|
|
||||||
* @peermac: MAC address of the TDLS peer
|
|
||||||
* @sta_id: sta id
|
|
||||||
* @psoc: soc object
|
|
||||||
*/
|
|
||||||
struct tdls_del_sta_rsp {
|
|
||||||
uint16_t message_type;
|
|
||||||
uint16_t length;
|
|
||||||
uint8_t session_id;
|
|
||||||
QDF_STATUS status_code;
|
|
||||||
struct qdf_mac_addr peermac;
|
|
||||||
uint16_t sta_id;
|
|
||||||
struct wlan_objmgr_psoc *psoc;
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* tdls_process_add_peer() - add TDLS peer
|
* tdls_process_add_peer() - add TDLS peer
|
||||||
* @req: TDLS add peer request
|
* @req: TDLS add peer request
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2017-2018 The Linux Foundation. All rights reserved.
|
* Copyright (c) 2017-2019 The Linux Foundation. All rights reserved.
|
||||||
*
|
*
|
||||||
* Permission to use, copy, modify, and/or distribute this software for
|
* Permission to use, copy, modify, and/or distribute this software for
|
||||||
* any purpose with or without fee is hereby granted, provided that the
|
* any purpose with or without fee is hereby granted, provided that the
|
||||||
@@ -1167,4 +1167,81 @@ struct tdls_set_secoffchanneloffset {
|
|||||||
tdls_offchan_parms_callback callback;
|
tdls_offchan_parms_callback callback;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* enum legacy_result_code - defined to comply with tSirResultCodes, need refine
|
||||||
|
* when mlme converged.
|
||||||
|
* @legacy_result_success: success
|
||||||
|
* @legacy_result_max: max result value
|
||||||
|
*/
|
||||||
|
enum legacy_result_code {
|
||||||
|
legacy_result_success,
|
||||||
|
legacy_result_max = 0x7FFFFFFF
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* struct tdls_send_mgmt_rsp - TDLS Response struct PE --> TDLS module
|
||||||
|
* same as struct tSirSmeRsp
|
||||||
|
* @session_id: session id
|
||||||
|
* @transaction_id: transaction id
|
||||||
|
* @status_code: status code as tSirResultCodes
|
||||||
|
* @psoc: soc object
|
||||||
|
*/
|
||||||
|
struct tdls_send_mgmt_rsp {
|
||||||
|
uint8_t session_id;
|
||||||
|
uint16_t transaction_id;
|
||||||
|
enum legacy_result_code status_code;
|
||||||
|
struct wlan_objmgr_psoc *psoc;
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* struct tdls_mgmt_tx_completion_ind - TDLS TX completion PE --> TDLS module
|
||||||
|
* same as struct sSirMgmtTxCompletionInd
|
||||||
|
* @session_id: session id
|
||||||
|
* @tx_complete_status: tx complete status
|
||||||
|
* @psoc: soc object
|
||||||
|
*/
|
||||||
|
struct tdls_mgmt_tx_completion_ind {
|
||||||
|
uint8_t session_id; /* Session ID */
|
||||||
|
uint32_t tx_complete_status;
|
||||||
|
struct wlan_objmgr_psoc *psoc;
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* struct tdls_add_sta_rsp - TDLS Response struct PE --> TDLS module
|
||||||
|
* same as struct sSirTdlsAddStaRsp
|
||||||
|
* @status_code: status code as tSirResultCodes
|
||||||
|
* @peermac: MAC address of the TDLS peer
|
||||||
|
* @session_id: session id
|
||||||
|
* @sta_id: sta id
|
||||||
|
* @sta_type: sta type
|
||||||
|
* @tdls_oper: add peer type
|
||||||
|
* @psoc: soc object
|
||||||
|
*/
|
||||||
|
struct tdls_add_sta_rsp {
|
||||||
|
QDF_STATUS status_code;
|
||||||
|
struct qdf_mac_addr peermac;
|
||||||
|
uint8_t session_id;
|
||||||
|
uint16_t sta_id;
|
||||||
|
uint16_t sta_type;
|
||||||
|
enum tdls_add_oper tdls_oper;
|
||||||
|
struct wlan_objmgr_psoc *psoc;
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* struct tdls_del_sta_rsp - TDLS Response struct PE --> TDLS module
|
||||||
|
* same as sSirTdlsDelStaRsp
|
||||||
|
* @session_id: session id
|
||||||
|
* @status_code: status code as tSirResultCodes
|
||||||
|
* @peermac: MAC address of the TDLS peer
|
||||||
|
* @sta_id: sta id
|
||||||
|
* @psoc: soc object
|
||||||
|
*/
|
||||||
|
struct tdls_del_sta_rsp {
|
||||||
|
uint8_t session_id;
|
||||||
|
QDF_STATUS status_code;
|
||||||
|
struct qdf_mac_addr peermac;
|
||||||
|
uint16_t sta_id;
|
||||||
|
struct wlan_objmgr_psoc *psoc;
|
||||||
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@@ -2597,50 +2597,6 @@ typedef struct sSirTdlsAddStaReq {
|
|||||||
uint8_t max_sp;
|
uint8_t max_sp;
|
||||||
} tSirTdlsAddStaReq, *tpSirSmeTdlsAddStaReq;
|
} tSirTdlsAddStaReq, *tpSirSmeTdlsAddStaReq;
|
||||||
|
|
||||||
/* TDLS Response struct PE-->SME */
|
|
||||||
typedef struct sSirTdlsAddStaRsp {
|
|
||||||
uint16_t messageType;
|
|
||||||
uint16_t length;
|
|
||||||
tSirResultCodes statusCode;
|
|
||||||
struct qdf_mac_addr peermac;
|
|
||||||
uint8_t sessionId; /* Session ID */
|
|
||||||
uint16_t staId;
|
|
||||||
uint16_t staType;
|
|
||||||
enum tdls_add_oper tdlsAddOper;
|
|
||||||
struct wlan_objmgr_psoc *psoc;
|
|
||||||
} tSirTdlsAddStaRsp;
|
|
||||||
|
|
||||||
/* TDLS Request struct SME-->PE */
|
|
||||||
typedef struct {
|
|
||||||
uint16_t messageType; /* eWNI_SME_TDLS_LINK_ESTABLISH_REQ */
|
|
||||||
uint16_t length;
|
|
||||||
uint8_t sessionId; /* Session ID */
|
|
||||||
uint16_t transactionId; /* Transaction ID for cmd */
|
|
||||||
uint8_t uapsdQueues; /* Peer's uapsd Queues Information */
|
|
||||||
uint8_t maxSp; /* Peer's Supported Maximum Service Period */
|
|
||||||
uint8_t isBufSta; /* Does Peer Support as Buffer Station. */
|
|
||||||
/* Does Peer Support as TDLS Off Channel. */
|
|
||||||
uint8_t isOffChannelSupported;
|
|
||||||
uint8_t isResponder; /* Is Peer a responder. */
|
|
||||||
/* For multi-session, for PE to locate peSession ID */
|
|
||||||
struct qdf_mac_addr bssid;
|
|
||||||
struct qdf_mac_addr peermac;
|
|
||||||
uint8_t supportedChannelsLen;
|
|
||||||
uint8_t supportedChannels[SIR_MAC_MAX_SUPP_CHANNELS];
|
|
||||||
uint8_t supportedOperClassesLen;
|
|
||||||
uint8_t supportedOperClasses[REG_MAX_SUPP_OPER_CLASSES];
|
|
||||||
} tSirTdlsLinkEstablishReq, *tpSirTdlsLinkEstablishReq;
|
|
||||||
|
|
||||||
/* TDLS Request struct SME-->PE */
|
|
||||||
typedef struct {
|
|
||||||
uint16_t messageType; /* eWNI_SME_TDLS_LINK_ESTABLISH_RSP */
|
|
||||||
uint16_t length;
|
|
||||||
uint8_t sessionId; /* Session ID */
|
|
||||||
uint16_t transactionId; /* Transaction ID for cmd */
|
|
||||||
tSirResultCodes statusCode;
|
|
||||||
struct qdf_mac_addr peermac;
|
|
||||||
} tSirTdlsLinkEstablishReqRsp, *tpSirTdlsLinkEstablishReqRsp;
|
|
||||||
|
|
||||||
/* TDLS Request struct SME-->PE */
|
/* TDLS Request struct SME-->PE */
|
||||||
typedef struct sSirTdlsDelStaReq {
|
typedef struct sSirTdlsDelStaReq {
|
||||||
uint16_t messageType; /* eWNI_SME_TDLS_DISCOVERY_START_REQ */
|
uint16_t messageType; /* eWNI_SME_TDLS_DISCOVERY_START_REQ */
|
||||||
@@ -2651,44 +2607,6 @@ typedef struct sSirTdlsDelStaReq {
|
|||||||
struct qdf_mac_addr bssid;
|
struct qdf_mac_addr bssid;
|
||||||
struct qdf_mac_addr peermac;
|
struct qdf_mac_addr peermac;
|
||||||
} tSirTdlsDelStaReq, *tpSirSmeTdlsDelStaReq;
|
} tSirTdlsDelStaReq, *tpSirSmeTdlsDelStaReq;
|
||||||
/* TDLS Response struct PE-->SME */
|
|
||||||
typedef struct sSirTdlsDelStaRsp {
|
|
||||||
uint16_t messageType;
|
|
||||||
uint16_t length;
|
|
||||||
uint8_t sessionId; /* Session ID */
|
|
||||||
tSirResultCodes statusCode;
|
|
||||||
struct qdf_mac_addr peermac;
|
|
||||||
uint16_t staId;
|
|
||||||
struct wlan_objmgr_psoc *psoc;
|
|
||||||
} tSirTdlsDelStaRsp, *tpSirTdlsDelStaRsp;
|
|
||||||
/* TDLS Delete Indication struct PE-->SME */
|
|
||||||
typedef struct sSirTdlsDelStaInd {
|
|
||||||
uint16_t messageType;
|
|
||||||
uint16_t length;
|
|
||||||
uint8_t sessionId; /* Session ID */
|
|
||||||
struct qdf_mac_addr peermac;
|
|
||||||
uint16_t staId;
|
|
||||||
uint16_t reasonCode;
|
|
||||||
} tSirTdlsDelStaInd, *tpSirTdlsDelStaInd;
|
|
||||||
typedef struct sSirTdlsDelAllPeerInd {
|
|
||||||
uint16_t messageType;
|
|
||||||
uint16_t length;
|
|
||||||
uint8_t sessionId; /* Session ID */
|
|
||||||
} tSirTdlsDelAllPeerInd, *tpSirTdlsDelAllPeerInd;
|
|
||||||
typedef struct sSirMgmtTxCompletionInd {
|
|
||||||
uint16_t messageType;
|
|
||||||
uint16_t length;
|
|
||||||
uint8_t sessionId; /* Session ID */
|
|
||||||
uint32_t txCompleteStatus;
|
|
||||||
struct wlan_objmgr_psoc *psoc;
|
|
||||||
} tSirMgmtTxCompletionInd, *tpSirMgmtTxCompletionInd;
|
|
||||||
|
|
||||||
typedef struct sSirTdlsEventnotify {
|
|
||||||
uint8_t sessionId;
|
|
||||||
struct qdf_mac_addr peermac;
|
|
||||||
uint16_t messageType;
|
|
||||||
uint32_t peer_reason;
|
|
||||||
} tSirTdlsEventnotify;
|
|
||||||
#endif /* FEATURE_WLAN_TDLS */
|
#endif /* FEATURE_WLAN_TDLS */
|
||||||
|
|
||||||
/* Reset AP Caps Changed */
|
/* Reset AP Caps Changed */
|
||||||
|
@@ -73,6 +73,7 @@
|
|||||||
#include "wlan_tdls_tgt_api.h"
|
#include "wlan_tdls_tgt_api.h"
|
||||||
#include "wlan_mlme_public_struct.h"
|
#include "wlan_mlme_public_struct.h"
|
||||||
#include "wlan_mlme_api.h"
|
#include "wlan_mlme_api.h"
|
||||||
|
#include "wlan_tdls_public_structs.h"
|
||||||
|
|
||||||
/* define NO_PAD_TDLS_MIN_8023_SIZE to NOT padding: See CR#447630
|
/* define NO_PAD_TDLS_MIN_8023_SIZE to NOT padding: See CR#447630
|
||||||
There was IOT issue with cisco 1252 open mode, where it pads
|
There was IOT issue with cisco 1252 open mode, where it pads
|
||||||
@@ -2677,38 +2678,43 @@ static QDF_STATUS lim_send_sme_tdls_add_sta_rsp(struct mac_context *mac,
|
|||||||
uint8_t updateSta,
|
uint8_t updateSta,
|
||||||
tDphHashNode *pStaDs, uint8_t status)
|
tDphHashNode *pStaDs, uint8_t status)
|
||||||
{
|
{
|
||||||
struct scheduler_msg mmhMsg = { 0 };
|
struct scheduler_msg msg = { 0 };
|
||||||
tSirTdlsAddStaRsp *addStaRsp = NULL;
|
struct tdls_add_sta_rsp *add_sta_rsp;
|
||||||
|
QDF_STATUS ret;
|
||||||
|
|
||||||
mmhMsg.type = eWNI_SME_TDLS_ADD_STA_RSP;
|
msg.type = eWNI_SME_TDLS_ADD_STA_RSP;
|
||||||
|
|
||||||
addStaRsp = qdf_mem_malloc(sizeof(tSirTdlsAddStaRsp));
|
add_sta_rsp = qdf_mem_malloc(sizeof(*add_sta_rsp));
|
||||||
if (!addStaRsp)
|
if (!add_sta_rsp)
|
||||||
return QDF_STATUS_E_NOMEM;
|
return QDF_STATUS_E_NOMEM;
|
||||||
|
|
||||||
addStaRsp->sessionId = sessionId;
|
add_sta_rsp->session_id = sessionId;
|
||||||
addStaRsp->statusCode = status;
|
add_sta_rsp->status_code = status;
|
||||||
if (pStaDs) {
|
if (pStaDs) {
|
||||||
addStaRsp->staId = pStaDs->staIndex;
|
add_sta_rsp->sta_id = pStaDs->staIndex;
|
||||||
}
|
}
|
||||||
if (peerMac) {
|
if (peerMac) {
|
||||||
qdf_mem_copy(addStaRsp->peermac.bytes,
|
qdf_mem_copy(add_sta_rsp->peermac.bytes,
|
||||||
(uint8_t *) peerMac, QDF_MAC_ADDR_SIZE);
|
(uint8_t *) peerMac, QDF_MAC_ADDR_SIZE);
|
||||||
}
|
}
|
||||||
if (updateSta)
|
if (updateSta)
|
||||||
addStaRsp->tdlsAddOper = TDLS_OPER_UPDATE;
|
add_sta_rsp->tdls_oper = TDLS_OPER_UPDATE;
|
||||||
else
|
else
|
||||||
addStaRsp->tdlsAddOper = TDLS_OPER_ADD;
|
add_sta_rsp->tdls_oper = TDLS_OPER_ADD;
|
||||||
|
|
||||||
addStaRsp->length = sizeof(tSirTdlsAddStaRsp);
|
add_sta_rsp->psoc = mac->psoc;
|
||||||
addStaRsp->messageType = eWNI_SME_TDLS_ADD_STA_RSP;
|
msg.bodyptr = add_sta_rsp;
|
||||||
addStaRsp->psoc = mac->psoc;
|
msg.callback = tgt_tdls_add_peer_rsp;
|
||||||
mmhMsg.bodyptr = addStaRsp;
|
|
||||||
mmhMsg.callback = tgt_tdls_add_peer_rsp;
|
|
||||||
|
|
||||||
return scheduler_post_message(QDF_MODULE_ID_PE,
|
ret = scheduler_post_message(QDF_MODULE_ID_PE,
|
||||||
QDF_MODULE_ID_TDLS,
|
QDF_MODULE_ID_TDLS,
|
||||||
QDF_MODULE_ID_TARGET_IF, &mmhMsg);
|
QDF_MODULE_ID_TARGET_IF, &msg);
|
||||||
|
if (QDF_IS_STATUS_ERROR(ret)) {
|
||||||
|
pe_err("post msg fail, %d", ret);
|
||||||
|
qdf_mem_free(add_sta_rsp);
|
||||||
|
}
|
||||||
|
|
||||||
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -2776,30 +2782,32 @@ lim_send_tdls_comp_mgmt_rsp(struct mac_context *mac_ctx, uint16_t msg_type,
|
|||||||
uint16_t sme_transaction_id)
|
uint16_t sme_transaction_id)
|
||||||
{
|
{
|
||||||
struct scheduler_msg msg = {0};
|
struct scheduler_msg msg = {0};
|
||||||
tSirSmeRsp *sme_rsp;
|
struct tdls_send_mgmt_rsp *sme_rsp;
|
||||||
|
QDF_STATUS status;
|
||||||
|
|
||||||
pe_debug("Sending message %s with reasonCode %s",
|
pe_debug("Sending message %s with reasonCode %s",
|
||||||
lim_msg_str(msg_type), lim_result_code_str(result_code));
|
lim_msg_str(msg_type), lim_result_code_str(result_code));
|
||||||
|
|
||||||
sme_rsp = qdf_mem_malloc(sizeof(tSirSmeRsp));
|
sme_rsp = qdf_mem_malloc(sizeof(*sme_rsp));
|
||||||
if (!sme_rsp)
|
if (!sme_rsp)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
sme_rsp->messageType = msg_type;
|
sme_rsp->status_code = (enum legacy_result_code)result_code;
|
||||||
sme_rsp->length = sizeof(tSirSmeRsp);
|
|
||||||
sme_rsp->statusCode = result_code;
|
|
||||||
|
|
||||||
sme_rsp->sessionId = sme_session_id;
|
sme_rsp->session_id = sme_session_id;
|
||||||
sme_rsp->transactionId = sme_transaction_id;
|
sme_rsp->transaction_id = sme_transaction_id;
|
||||||
|
|
||||||
msg.type = msg_type;
|
msg.type = msg_type;
|
||||||
sme_rsp->psoc = mac_ctx->psoc;
|
sme_rsp->psoc = mac_ctx->psoc;
|
||||||
msg.bodyptr = sme_rsp;
|
msg.bodyptr = sme_rsp;
|
||||||
msg.callback = tgt_tdls_send_mgmt_rsp;
|
msg.callback = tgt_tdls_send_mgmt_rsp;
|
||||||
scheduler_post_message(QDF_MODULE_ID_PE,
|
status = scheduler_post_message(QDF_MODULE_ID_PE,
|
||||||
QDF_MODULE_ID_TDLS,
|
QDF_MODULE_ID_TDLS,
|
||||||
QDF_MODULE_ID_TARGET_IF, &msg);
|
QDF_MODULE_ID_TARGET_IF, &msg);
|
||||||
|
if (QDF_IS_STATUS_ERROR(status)) {
|
||||||
|
pe_err("post msg fail, %d", status);
|
||||||
|
qdf_mem_free(sme_rsp);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -2942,32 +2950,37 @@ static QDF_STATUS lim_send_sme_tdls_del_sta_rsp(struct mac_context *mac,
|
|||||||
struct qdf_mac_addr peerMac,
|
struct qdf_mac_addr peerMac,
|
||||||
tDphHashNode *pStaDs, uint8_t status)
|
tDphHashNode *pStaDs, uint8_t status)
|
||||||
{
|
{
|
||||||
struct scheduler_msg mmhMsg = { 0 };
|
struct scheduler_msg msg = { 0 };
|
||||||
tSirTdlsDelStaRsp *pDelSta = NULL;
|
struct tdls_del_sta_rsp *del_sta_rsp;
|
||||||
|
QDF_STATUS ret;
|
||||||
|
|
||||||
mmhMsg.type = eWNI_SME_TDLS_DEL_STA_RSP;
|
msg.type = eWNI_SME_TDLS_DEL_STA_RSP;
|
||||||
|
|
||||||
pDelSta = qdf_mem_malloc(sizeof(tSirTdlsDelStaRsp));
|
del_sta_rsp = qdf_mem_malloc(sizeof(*del_sta_rsp));
|
||||||
if (!pDelSta)
|
if (!del_sta_rsp)
|
||||||
return QDF_STATUS_E_NOMEM;
|
return QDF_STATUS_E_NOMEM;
|
||||||
|
|
||||||
pDelSta->sessionId = sessionId;
|
del_sta_rsp->session_id = sessionId;
|
||||||
pDelSta->statusCode = status;
|
del_sta_rsp->status_code = status;
|
||||||
if (pStaDs) {
|
if (pStaDs) {
|
||||||
pDelSta->staId = pStaDs->staIndex;
|
del_sta_rsp->sta_id = pStaDs->staIndex;
|
||||||
} else
|
} else
|
||||||
pDelSta->staId = STA_INVALID_IDX;
|
del_sta_rsp->sta_id = STA_INVALID_IDX;
|
||||||
|
|
||||||
qdf_copy_macaddr(&pDelSta->peermac, &peerMac);
|
qdf_copy_macaddr(&del_sta_rsp->peermac, &peerMac);
|
||||||
|
|
||||||
pDelSta->length = sizeof(tSirTdlsDelStaRsp);
|
del_sta_rsp->psoc = mac->psoc;
|
||||||
pDelSta->messageType = eWNI_SME_TDLS_DEL_STA_RSP;
|
msg.bodyptr = del_sta_rsp;
|
||||||
pDelSta->psoc = mac->psoc;
|
msg.callback = tgt_tdls_del_peer_rsp;
|
||||||
mmhMsg.bodyptr = pDelSta;
|
ret = scheduler_post_message(QDF_MODULE_ID_PE,
|
||||||
mmhMsg.callback = tgt_tdls_del_peer_rsp;
|
QDF_MODULE_ID_TDLS,
|
||||||
return scheduler_post_message(QDF_MODULE_ID_PE,
|
QDF_MODULE_ID_TARGET_IF, &msg);
|
||||||
QDF_MODULE_ID_TDLS,
|
if (QDF_IS_STATUS_ERROR(ret)) {
|
||||||
QDF_MODULE_ID_TARGET_IF, &mmhMsg);
|
pe_err("post msg fail, %d", ret);
|
||||||
|
qdf_mem_free(del_sta_rsp);
|
||||||
|
}
|
||||||
|
|
||||||
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2012-2018 The Linux Foundation. All rights reserved.
|
* Copyright (c) 2012-2019 The Linux Foundation. All rights reserved.
|
||||||
*
|
*
|
||||||
* Permission to use, copy, modify, and/or distribute this software for
|
* Permission to use, copy, modify, and/or distribute this software for
|
||||||
* any purpose with or without fee is hereby granted, provided that the
|
* any purpose with or without fee is hereby granted, provided that the
|
||||||
@@ -1075,33 +1075,33 @@ lim_send_sme_mgmt_tx_completion(struct mac_context *mac,
|
|||||||
uint32_t sme_session_id,
|
uint32_t sme_session_id,
|
||||||
uint32_t txCompleteStatus)
|
uint32_t txCompleteStatus)
|
||||||
{
|
{
|
||||||
struct scheduler_msg mmhMsg = {0};
|
struct scheduler_msg msg = {0};
|
||||||
tSirMgmtTxCompletionInd *pSirMgmtTxCompletionInd;
|
struct tdls_mgmt_tx_completion_ind *mgmt_tx_completion_ind;
|
||||||
|
QDF_STATUS status;
|
||||||
|
|
||||||
pSirMgmtTxCompletionInd =
|
mgmt_tx_completion_ind =
|
||||||
qdf_mem_malloc(sizeof(tSirMgmtTxCompletionInd));
|
qdf_mem_malloc(sizeof(*mgmt_tx_completion_ind));
|
||||||
if (!pSirMgmtTxCompletionInd)
|
if (!mgmt_tx_completion_ind)
|
||||||
return;
|
return;
|
||||||
/* messageType */
|
|
||||||
pSirMgmtTxCompletionInd->messageType =
|
|
||||||
eWNI_SME_MGMT_FRM_TX_COMPLETION_IND;
|
|
||||||
pSirMgmtTxCompletionInd->length = sizeof(tSirMgmtTxCompletionInd);
|
|
||||||
|
|
||||||
/* sessionId */
|
/* sessionId */
|
||||||
pSirMgmtTxCompletionInd->sessionId = sme_session_id;
|
mgmt_tx_completion_ind->session_id = sme_session_id;
|
||||||
|
|
||||||
pSirMgmtTxCompletionInd->txCompleteStatus = txCompleteStatus;
|
mgmt_tx_completion_ind->tx_complete_status = txCompleteStatus;
|
||||||
|
|
||||||
mmhMsg.type = eWNI_SME_MGMT_FRM_TX_COMPLETION_IND;
|
msg.type = eWNI_SME_MGMT_FRM_TX_COMPLETION_IND;
|
||||||
mmhMsg.bodyptr = pSirMgmtTxCompletionInd;
|
msg.bodyptr = mgmt_tx_completion_ind;
|
||||||
mmhMsg.bodyval = 0;
|
msg.bodyval = 0;
|
||||||
|
|
||||||
pSirMgmtTxCompletionInd->psoc = mac->psoc;
|
mgmt_tx_completion_ind->psoc = mac->psoc;
|
||||||
mmhMsg.callback = tgt_tdls_send_mgmt_tx_completion;
|
msg.callback = tgt_tdls_send_mgmt_tx_completion;
|
||||||
scheduler_post_message(QDF_MODULE_ID_PE,
|
status = scheduler_post_message(QDF_MODULE_ID_PE,
|
||||||
QDF_MODULE_ID_TDLS,
|
QDF_MODULE_ID_TDLS,
|
||||||
QDF_MODULE_ID_TARGET_IF, &mmhMsg);
|
QDF_MODULE_ID_TARGET_IF, &msg);
|
||||||
return;
|
if (QDF_IS_STATUS_ERROR(status)) {
|
||||||
|
pe_err("post msg fail, %d", status);
|
||||||
|
qdf_mem_free(mgmt_tx_completion_ind);
|
||||||
|
}
|
||||||
} /*** end lim_send_sme_tdls_delete_all_peer_ind() ***/
|
} /*** end lim_send_sme_tdls_delete_all_peer_ind() ***/
|
||||||
|
|
||||||
#endif /* FEATURE_WLAN_TDLS */
|
#endif /* FEATURE_WLAN_TDLS */
|
||||||
|
Reference in New Issue
Block a user