qcacmn: Send TDLS frames with lower AC

If ACM enabled and access is not granted for AC_VI, then send
TDLS frames with lower access category instead of dropping them.

Change-Id: I2201536dc4475764f33eebce1faa0a7df0b2c454
CRs-Fixed: 2119433
This commit is contained in:
Frank Liu 2017-05-17 14:03:37 +08:00 • committed by snandini
commit f54299ee6f
9 changed files with 36 additions and 25 deletions

View file

@ -648,7 +648,7 @@ static int tdls_validate_setup_frames(struct tdls_soc_priv_obj *tdls_soc,
return 0;
}
int tdls_validate_mgmt_request(struct tdls_validate_action_req *tdls_validate)
int tdls_validate_mgmt_request(struct tdls_action_frame_request *tdls_mgmt_req)
{
struct tdls_vdev_priv_obj *tdls_vdev;
struct tdls_soc_priv_obj *tdls_soc;
@ -656,6 +656,8 @@ int tdls_validate_mgmt_request(struct tdls_validate_action_req *tdls_validate)
struct tdls_peer *temp_peer;
QDF_STATUS status;
struct tdls_validate_action_req *tdls_validate =
tdls_mgmt_req->chk_frame;
if (!tdls_validate || !tdls_validate->vdev)
return -EINVAL;
@ -711,21 +713,15 @@ int tdls_validate_mgmt_request(struct tdls_validate_action_req *tdls_validate)
}
}
/*
* Discard TDLS Discovery request and setup confirm if violates
* ACM rules
*/
if ((TDLS_DISCOVERY_REQUEST == tdls_validate->action_code ||
TDLS_SETUP_CONFIRM == tdls_validate->action_code)) {
/* call hdd_wmm_is_acm_allowed() */
if (!tdls_soc->tdls_wmm_cb(&tdls_vdev->vdev)) {
tdls_err("admission ctrl set to VI, action %d declined",
tdls_validate->action_code);
return -EPERM;
}
/* call hdd_wmm_is_acm_allowed() */
if (!tdls_soc->tdls_wmm_cb(&tdls_vdev->vdev)) {
tdls_debug("admission ctrl set to VI, send the frame with least AC (BK) for action %d",
tdls_validate->action_code);
tdls_mgmt_req->use_default_ac = false;
} else {
tdls_mgmt_req->use_default_ac = true;
}
if (TDLS_SETUP_REQUEST == tdls_validate->action_code ||
TDLS_SETUP_RESPONSE == tdls_validate->action_code) {
if (tdls_soc->max_num_tdls_sta <=

View file

@ -286,14 +286,6 @@ void tdls_reset_nss(struct tdls_soc_priv_obj *tdls_soc,
int tdls_set_cap(struct tdls_vdev_priv_obj *tdls_vdev, const uint8_t *mac,
enum tdls_peer_capab cap);
/**
* tdls_validate_mgmt_request() -validate mgmt request
* @tdls_validate: action frame request
*
* Return: 0 for success or -EINVAL otherwise
*/
int tdls_validate_mgmt_request(struct tdls_validate_action_req *tdls_validate);
/**
* tdls_process_send_mgmt_rsp() - handle response for send mgmt
* @rsp: TDLS send mgmt response
@ -355,7 +347,7 @@ QDF_STATUS tdls_process_connection_tracker_notify(struct wlan_objmgr_vdev *vdev,
*
* Return: 0 for success or -EINVAL otherwise
*/
int tdls_validate_mgmt_request(struct tdls_validate_action_req *tdls_validate);
int tdls_validate_mgmt_request(struct tdls_action_frame_request *tdls_mgmt_req);
/**
* tdls_set_responder() - Set/clear TDLS peer's responder role

View file

@ -34,7 +34,6 @@
#include <wlan_tdls_public_structs.h>
#include <scheduler_api.h>
#include "wlan_serialization_api.h"
#include "wlan_tdls_mgmt.h"
/* Bit mask flag for tdls_option to FW */
#define ENA_TDLS_OFFCHAN (1 << 0) /* TDLS Off Channel support */

View file

@ -291,6 +291,10 @@ static QDF_STATUS tdls_activate_send_mgmt_request(
tdls_mgmt_req->length = sizeof(struct tdls_send_mgmt_request) +
action_req->tdls_mgmt.len;
if (action_req->use_default_ac)
tdls_mgmt_req->ac = WIFI_AC_VI;
else
tdls_mgmt_req->ac = WIFI_AC_BK;
/* Send the request to PE. */
qdf_mem_zero(&msg, sizeof(msg));
@ -370,7 +374,7 @@ QDF_STATUS tdls_process_mgmt_req(
enum wlan_serialization_status ser_cmd_status;
/* If connected and in Infra. Only then allow this */
status = tdls_validate_mgmt_request(tdls_mgmt_req->chk_frame);
status = tdls_validate_mgmt_request(tdls_mgmt_req);
if (status != QDF_STATUS_SUCCESS) {
status = tdls_internal_send_mgmt_tx_done(tdls_mgmt_req,
status);

View file

@ -73,6 +73,7 @@ struct tdls_send_mgmt_request {
uint32_t peer_capability;
struct qdf_mac_addr bssid;
struct qdf_mac_addr peer_mac;
enum wifi_traffic_ac ac;
/* Variable length. Dont add any field after this. */
uint8_t add_ie[1];
};

View file

@ -985,6 +985,7 @@ struct tdls_action_frame_request {
const uint8_t *cmd_buf;
uint8_t len;
struct tdls_send_mgmt tdls_mgmt;
bool use_default_ac;
};
/**

View file

@ -26,6 +26,7 @@
#include <wlan_tdls_tgt_api.h>
#include "../../core/src/wlan_tdls_main.h"
#include "../../core/src/wlan_tdls_cmds_process.h"
#include "../../core/src/wlan_tdls_mgmt.h"
static inline struct wlan_lmac_if_tdls_tx_ops *
wlan_psoc_get_tdls_txops(struct wlan_objmgr_psoc *psoc)

View file

@ -27,6 +27,7 @@
#include "../../core/src/wlan_tdls_main.h"
#include "../../core/src/wlan_tdls_cmds_process.h"
#include "../../core/src/wlan_tdls_ct.h"
#include "../../core/src/wlan_tdls_mgmt.h"
#include <wlan_objmgr_global_obj.h>
#include <wlan_objmgr_cmn.h>
#include "wlan_policy_mgr_api.h"