qcacmn: IOT SIM target interface
IOT SIM target interface updates Change-Id: Ia9b048ecccd476df822e61f4ccb16e70352f630d CRs-Fixed: 2665426
Этот коммит содержится в:

коммит произвёл
nshrivas

родитель
d281143698
Коммит
77c068dda2
@@ -21,4 +21,7 @@
|
||||
#include <qdf_types.h>
|
||||
#include "../../core/iot_sim_cmn_api_i.h"
|
||||
|
||||
QDF_STATUS tgt_send_simulation_cmd(struct wlan_objmgr_pdev *pdev,
|
||||
struct simulation_test_params *param);
|
||||
|
||||
#endif /* _WLAN_IOT_SIM_TGT_API_H_ */
|
||||
|
@@ -19,6 +19,7 @@
|
||||
|
||||
#include <wlan_objmgr_cmn.h>
|
||||
#include <wlan_lmac_if_def.h>
|
||||
#include <wmi_unified_param.h>
|
||||
|
||||
/* Forward Declarations */
|
||||
struct wmi_iot_sim_cmd_ops;
|
||||
|
@@ -34,3 +34,12 @@ tgt_get_target_handle(struct wlan_objmgr_pdev *pdev)
|
||||
}
|
||||
return isc->p_iot_sim_target_handle;
|
||||
}
|
||||
|
||||
QDF_STATUS tgt_send_simulation_cmd(struct wlan_objmgr_pdev *pdev,
|
||||
struct simulation_test_params *param)
|
||||
{
|
||||
struct wlan_objmgr_psoc *psoc = NULL;
|
||||
|
||||
psoc = wlan_pdev_get_psoc(pdev);
|
||||
return psoc->soc_cb.tx_ops.iot_sim_tx_ops.iot_sim_send_cmd(pdev, param);
|
||||
}
|
||||
|
@@ -26,94 +26,8 @@
|
||||
QDF_STATUS iot_sim_cmd_handler(struct wlan_objmgr_vdev *vdev, qdf_nbuf_t nbuf)
|
||||
{
|
||||
struct wlan_objmgr_pdev *pdev = vdev->vdev_objmgr.wlan_pdev;
|
||||
u8 type, subtype, seq = 0;
|
||||
struct iot_sim_context *isc;
|
||||
u8 *buf = qdf_nbuf_data(nbuf);
|
||||
|
||||
type = (buf[0] & IEEE80211_FC0_TYPE_MASK) >> IEEE80211_FC0_TYPE_SHIFT;
|
||||
subtype = (buf[0] & IEEE80211_FC0_SUBTYPE_MASK);
|
||||
subtype >>= IEEE80211_FC0_SUBTYPE_SHIFT;
|
||||
isc = wlan_objmgr_pdev_get_comp_private_obj(pdev, WLAN_IOT_SIM_COMP);
|
||||
|
||||
if (!isc) {
|
||||
iot_sim_err("pdev IOT_SIM object is NULL!");
|
||||
return QDF_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
if (type == 0x00 && subtype == 0xb0) {
|
||||
/* Authentication frame */
|
||||
int auth_seq_index = IEEE80211_FRAME_BODY_OFFSET + 2;
|
||||
|
||||
seq = le16toh(*(u_int16_t *)(buf + auth_seq_index));
|
||||
}
|
||||
|
||||
/* Only broadcast peer is getting handled right now.
|
||||
* Need to add support for peer based content modification
|
||||
*/
|
||||
if ((isc->bcast_peer.rule_per_seq[seq]) &&
|
||||
(isc->bcast_peer.rule_per_seq[seq]->rule_per_type[type][subtype])) {
|
||||
if (isc->bcast_peer.rule_per_seq[seq]->
|
||||
rule_per_type[type][subtype]) {
|
||||
struct iot_sim_rule *piot_sim_rule =
|
||||
isc->bcast_peer.rule_per_seq[seq]->
|
||||
rule_per_type[type][subtype];
|
||||
qdf_size_t buf_len = qdf_nbuf_len(nbuf);
|
||||
|
||||
if (piot_sim_rule->frm_content && piot_sim_rule->len) {
|
||||
int offset;
|
||||
|
||||
if (piot_sim_rule->offset ==
|
||||
IEEE80211_FRAME_BODY_OFFSET) {
|
||||
offset = IEEE80211_FRAME_BODY_OFFSET;
|
||||
} else if (buf[piot_sim_rule->offset] ==
|
||||
piot_sim_rule->frm_content[0]) {
|
||||
offset = piot_sim_rule->offset;
|
||||
} else if (piot_sim_rule->offset == 0) {
|
||||
offset = 0;
|
||||
} else {
|
||||
offset = IEEE80211_FRAME_BODY_OFFSET;
|
||||
while (((offset + 1) < buf_len) &&
|
||||
(buf[offset] <
|
||||
piot_sim_rule->frm_content[0])) {
|
||||
offset += buf[offset + 1] + 2;
|
||||
}
|
||||
}
|
||||
|
||||
if (offset <= buf_len) {
|
||||
buf += offset;
|
||||
qdf_mem_copy(buf,
|
||||
piot_sim_rule->
|
||||
frm_content,
|
||||
piot_sim_rule->len);
|
||||
qdf_nbuf_set_pktlen(nbuf,
|
||||
offset +
|
||||
piot_sim_rule->len);
|
||||
iot_sim_err("Content updated for peer");
|
||||
iot_sim_err("frame type:%d, subtype:%d",
|
||||
type, subtype);
|
||||
iot_sim_err("seq:%d", seq);
|
||||
} else {
|
||||
iot_sim_err("Failed to modify content");
|
||||
iot_sim_err("type:%d, subtype:%d",
|
||||
type, subtype);
|
||||
iot_sim_err("seq:%d", seq);
|
||||
}
|
||||
} else {
|
||||
iot_sim_err("Content update rule not set");
|
||||
iot_sim_err("frame type:%d, subtype:%d, seq:%d",
|
||||
type, subtype, seq);
|
||||
}
|
||||
} else {
|
||||
iot_sim_err("Content update rule not set");
|
||||
iot_sim_err("frame type:%d, subtype:%d, seq:%d",
|
||||
type, subtype, seq);
|
||||
}
|
||||
} else {
|
||||
iot_sim_err("Content update rule not set for peer frame");
|
||||
iot_sim_err("type:%d, subtype:%d, seq:%d", type, subtype, seq);
|
||||
}
|
||||
|
||||
return QDF_STATUS_SUCCESS;
|
||||
return iot_sim_frame_update(pdev, nbuf);
|
||||
}
|
||||
|
||||
QDF_STATUS
|
||||
|
Ссылка в новой задаче
Block a user