mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-09 13:49:24 -04:00
qcacld-3.0: Cache ARP/NS offload request at wma layer
qcacld-2.0 to qcacld-3.0 propagation As Current WMI interface need both the ARP/NS configuration in single command. To support active offload host need to cache the ARP/NS at wma layer so host can fill the other request and configure down to firmware complete request (ARP+NS). Change-Id: Ie0a57d216379817ff0ae48f4f582c9108e8ecca1 CRs-Fixed: 1059739
This commit is contained in:
parent
4133c00bec
commit
8d2d9ecdca
3 changed files with 54 additions and 12 deletions
|
|
@ -907,7 +907,8 @@ typedef struct {
|
|||
* @chain_mask: chain mask can be used by the vdev
|
||||
* @mac_id: the mac on which vdev is on
|
||||
* @wep_default_key_idx: wep default index for group key
|
||||
*
|
||||
* @arp_offload_req: cached arp offload request
|
||||
* @ns_offload_req: cached ns offload request
|
||||
* It stores parameters per vdev in wma.
|
||||
*/
|
||||
struct wma_txrx_node {
|
||||
|
|
@ -985,6 +986,8 @@ struct wma_txrx_node {
|
|||
uint8_t nss_5g;
|
||||
bool p2p_lo_in_progress;
|
||||
uint8_t wep_default_key_idx;
|
||||
tSirHostOffloadReq arp_offload_req;
|
||||
tSirHostOffloadReq ns_offload_req;
|
||||
};
|
||||
|
||||
#if defined(QCA_WIFI_FTM)
|
||||
|
|
|
|||
|
|
@ -1407,6 +1407,13 @@ int wma_vdev_stop_resp_handler(void *handle, uint8_t *cmd_param_info,
|
|||
status = -EINVAL;
|
||||
goto free_req_msg;
|
||||
}
|
||||
|
||||
/* Clear arp and ns offload cache */
|
||||
qdf_mem_zero(&iface->ns_offload_req,
|
||||
sizeof(iface->ns_offload_req));
|
||||
qdf_mem_zero(&iface->arp_offload_req,
|
||||
sizeof(iface->arp_offload_req));
|
||||
|
||||
if (wma_is_vdev_in_ibss_mode(wma, resp_event->vdev_id))
|
||||
wma_delete_all_ibss_peers(wma, resp_event->vdev_id);
|
||||
else if (WMA_IS_VDEV_IN_NDI_MODE(wma->interfaces,
|
||||
|
|
|
|||
|
|
@ -5336,7 +5336,7 @@ out:
|
|||
* wma_enable_arp_ns_offload() - enable ARP NS offload
|
||||
* @wma: wma handle
|
||||
* @tpSirHostOffloadReq: offload request
|
||||
* @arp_only: flag
|
||||
* @config_arp: config arp flag
|
||||
*
|
||||
* To configure ARP NS off load data to firmware
|
||||
* when target goes to wow mode.
|
||||
|
|
@ -5345,41 +5345,73 @@ out:
|
|||
*/
|
||||
QDF_STATUS wma_enable_arp_ns_offload(tp_wma_handle wma,
|
||||
tpSirHostOffloadReq
|
||||
pHostOffloadParams, bool arp_only)
|
||||
offload_req, bool config_arp)
|
||||
{
|
||||
int32_t res;
|
||||
uint8_t vdev_id;
|
||||
tpSirHostOffloadReq ns_offload_req;
|
||||
tpSirHostOffloadReq arp_offload_req;
|
||||
|
||||
/* Get the vdev id */
|
||||
if (!wma_find_vdev_by_bssid(wma, pHostOffloadParams->bssid.bytes,
|
||||
if (!wma_find_vdev_by_bssid(wma, offload_req->bssid.bytes,
|
||||
&vdev_id)) {
|
||||
WMA_LOGE("vdev handle is invalid for %pM",
|
||||
pHostOffloadParams->bssid.bytes);
|
||||
qdf_mem_free(pHostOffloadParams);
|
||||
offload_req->bssid.bytes);
|
||||
qdf_mem_free(offload_req);
|
||||
return QDF_STATUS_E_INVAL;
|
||||
}
|
||||
|
||||
if (!wma->interfaces[vdev_id].vdev_up) {
|
||||
WMA_LOGE("vdev %d is not up skipping arp/ns offload", vdev_id);
|
||||
qdf_mem_free(pHostOffloadParams);
|
||||
qdf_mem_free(offload_req);
|
||||
return QDF_STATUS_E_FAILURE;
|
||||
}
|
||||
|
||||
/*
|
||||
* config_arp is true means arp request comes from upper layer
|
||||
* Hence ns request need to used from wma cached request.
|
||||
*/
|
||||
if (config_arp) {
|
||||
arp_offload_req = offload_req;
|
||||
ns_offload_req = &wma->interfaces[vdev_id].ns_offload_req;
|
||||
WMA_LOGD(" %s: ARP Offload vdev_id: %d enable: %d",
|
||||
__func__, vdev_id,
|
||||
offload_req->enableOrDisable);
|
||||
} else {
|
||||
ns_offload_req = offload_req;
|
||||
arp_offload_req = &wma->interfaces[vdev_id].arp_offload_req;
|
||||
WMA_LOGD(" %s: NS Offload vdev_id: %d enable: %d ns_count: %u",
|
||||
__func__, vdev_id,
|
||||
offload_req->enableOrDisable,
|
||||
offload_req->num_ns_offload_count);
|
||||
}
|
||||
|
||||
res = wmi_unified_enable_arp_ns_offload_cmd(wma->wmi_handle,
|
||||
(struct host_offload_req_param *)pHostOffloadParams,
|
||||
arp_only,
|
||||
vdev_id);
|
||||
(struct host_offload_req_param *)arp_offload_req,
|
||||
(struct host_offload_req_param *)ns_offload_req,
|
||||
config_arp,
|
||||
vdev_id);
|
||||
if (res) {
|
||||
WMA_LOGE("Failed to enable ARP NDP/NSffload");
|
||||
qdf_mem_free(pHostOffloadParams);
|
||||
qdf_mem_free(offload_req);
|
||||
return QDF_STATUS_E_FAILURE;
|
||||
}
|
||||
|
||||
qdf_mem_free(pHostOffloadParams);
|
||||
if (config_arp) {
|
||||
qdf_mem_copy(&wma->interfaces[vdev_id].arp_offload_req,
|
||||
offload_req,
|
||||
sizeof(wma->interfaces[vdev_id].arp_offload_req));
|
||||
} else {
|
||||
qdf_mem_copy(&wma->interfaces[vdev_id].ns_offload_req,
|
||||
offload_req,
|
||||
sizeof(wma->interfaces[vdev_id].ns_offload_req));
|
||||
}
|
||||
|
||||
qdf_mem_free(offload_req);
|
||||
return QDF_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* wma_process_cesium_enable_ind() - enables cesium functionality in target
|
||||
* @wma: wma handle
|
||||
|
|
|
|||
Loading…
Reference in a new issue