qcacld-3.0: Converge on struct gateway_update_req_param

The driver currently defines two different data structures to hold
Gateway Update parameters:
- legacy struct gateway_param_update_req
- unified WMI struct gateway_update_req_param

To align with the converged software architecture remove the legacy
definition and exclusively use the unified WMI definition.

Change-Id: Icc56c4d83808e3661593d2e4735533442d48eb7e
CRs-Fixed: 2404089
This commit is contained in:
Jeff Johnson
2019-02-22 17:05:14 -08:00
committed by nshrivas
parent 814ce703b4
commit 38d0ce6787
7 changed files with 24 additions and 67 deletions

View File

@@ -75,7 +75,7 @@ static int __wlan_hdd_cfg80211_set_gateway_params(struct wiphy *wiphy,
struct hdd_adapter *adapter = WLAN_HDD_GET_PRIV_PTR(dev); struct hdd_adapter *adapter = WLAN_HDD_GET_PRIV_PTR(dev);
struct hdd_context *hdd_ctx = wiphy_priv(wiphy); struct hdd_context *hdd_ctx = wiphy_priv(wiphy);
struct nlattr *tb[QCA_WLAN_VENDOR_ATTR_GW_PARAM_CONFIG_MAX + 1]; struct nlattr *tb[QCA_WLAN_VENDOR_ATTR_GW_PARAM_CONFIG_MAX + 1];
struct gateway_param_update_req req = { 0 }; struct gateway_update_req_param req = { 0 };
int ret; int ret;
QDF_STATUS status; QDF_STATUS status;
bool subnet_detection_enabled; bool subnet_detection_enabled;
@@ -148,9 +148,9 @@ static int __wlan_hdd_cfg80211_set_gateway_params(struct wiphy *wiphy,
req.max_retries = 3; req.max_retries = 3;
req.timeout = 100; /* in milliseconds */ req.timeout = 100; /* in milliseconds */
req.session_id = adapter->vdev_id; req.vdev_id = adapter->vdev_id;
hdd_debug("Configuring gateway for session %d", req.session_id); hdd_debug("Configuring gateway for session %d", req.vdev_id);
hdd_debug("mac:%pM, ipv4:%pI4 (type %d), ipv6:%pI6c (type %d)", hdd_debug("mac:%pM, ipv4:%pI4 (type %d), ipv6:%pI6c (type %d)",
req.gw_mac_addr.bytes, req.gw_mac_addr.bytes,
req.ipv4_addr, req.ipv4_addr_type, req.ipv4_addr, req.ipv4_addr_type,

View File

@@ -4604,34 +4604,6 @@ enum powersave_qpower_mode {
QPOWER_DUTY_CYCLING = 2 QPOWER_DUTY_CYCLING = 2
}; };
#ifdef FEATURE_LFR_SUBNET_DETECTION
/**
* struct gateway_param_update_req - gateway parameter update request
* @request_id: request id
* @session_id: session id
* @max_retries: Max ARP/NS retry attempts
* @timeout: Retry interval
* @ipv4_addr_type: on ipv4 network
* @ipv6_addr_type: on ipv6 network
* @gw_mac_addr: gateway mac addr
* @ipv4_addr: ipv4 addr
* @ipv6_addr: ipv6 addr
*/
struct gateway_param_update_req {
uint32_t request_id;
uint32_t session_id;
uint32_t max_retries;
uint32_t timeout;
uint32_t ipv4_addr_type;
uint32_t ipv6_addr_type;
struct qdf_mac_addr gw_mac_addr;
uint8_t ipv4_addr[QDF_IPV4_ADDR_SIZE];
uint8_t ipv6_addr[QDF_IPV6_ADDR_SIZE];
};
#else
struct gateway_param_update_req;
#endif /* FEATURE_LFR_SUBNET_DETECTION */
/** /**
* struct sir_sme_ext_change_chan_req - channel change request * struct sir_sme_ext_change_chan_req - channel change request
* @message_type: message id * @message_type: message id

View File

@@ -1528,7 +1528,7 @@ sme_get_opclass(mac_handle_t mac_handle, uint8_t channel, uint8_t bw_offset,
#ifdef FEATURE_LFR_SUBNET_DETECTION #ifdef FEATURE_LFR_SUBNET_DETECTION
QDF_STATUS sme_gateway_param_update(mac_handle_t mac_handle, QDF_STATUS sme_gateway_param_update(mac_handle_t mac_handle,
struct gateway_param_update_req *request); struct gateway_update_req_param *request);
#endif #endif
void sme_update_fine_time_measurement_capab(mac_handle_t mac_handle, void sme_update_fine_time_measurement_capab(mac_handle_t mac_handle,

View File

@@ -11978,11 +11978,11 @@ QDF_STATUS sme_soc_set_dual_mac_config(struct policy_mgr_dual_mac_config msg)
* This routine will update gateway parameters to WMA * This routine will update gateway parameters to WMA
*/ */
QDF_STATUS sme_gateway_param_update(mac_handle_t mac_handle, QDF_STATUS sme_gateway_param_update(mac_handle_t mac_handle,
struct gateway_param_update_req *gw_params) struct gateway_update_req_param *gw_params)
{ {
QDF_STATUS qdf_status; QDF_STATUS qdf_status;
struct scheduler_msg message = {0}; struct scheduler_msg message = {0};
struct gateway_param_update_req *request_buf; struct gateway_update_req_param *request_buf;
request_buf = qdf_mem_malloc(sizeof(*request_buf)); request_buf = qdf_mem_malloc(sizeof(*request_buf));
if (!request_buf) if (!request_buf)

View File

@@ -1750,12 +1750,24 @@ QDF_STATUS
wma_config_debug_module_cmd(wmi_unified_t wmi_handle, A_UINT32 param, wma_config_debug_module_cmd(wmi_unified_t wmi_handle, A_UINT32 param,
A_UINT32 val, A_UINT32 *module_id_bitmap, A_UINT32 val, A_UINT32 *module_id_bitmap,
A_UINT32 bitmap_len); A_UINT32 bitmap_len);
#ifdef FEATURE_LFR_SUBNET_DETECTION #ifdef FEATURE_LFR_SUBNET_DETECTION
/**
* wma_set_gateway_params() - set gateway parameters
* @wma: WMA handle
* @req: gateway update request parameter structure
*
* This function takes the incoming @req and sends it down to the
* firmware
*
* Return: QDF_STATUS
*/
QDF_STATUS wma_set_gateway_params(tp_wma_handle wma, QDF_STATUS wma_set_gateway_params(tp_wma_handle wma,
struct gateway_param_update_req *req); struct gateway_update_req_param *req);
#else #else
static inline QDF_STATUS wma_set_gateway_params(tp_wma_handle wma, static inline
struct gateway_param_update_req *req) QDF_STATUS wma_set_gateway_params(tp_wma_handle wma,
struct gateway_update_req_param *req)
{ {
return QDF_STATUS_SUCCESS; return QDF_STATUS_SUCCESS;
} }

View File

@@ -8783,8 +8783,7 @@ static QDF_STATUS wma_mc_process_msg(struct scheduler_msg *msg)
qdf_mem_free(msg->bodyptr); qdf_mem_free(msg->bodyptr);
break; break;
case WMA_GW_PARAM_UPDATE_REQ: case WMA_GW_PARAM_UPDATE_REQ:
wma_set_gateway_params(wma_handle, wma_set_gateway_params(wma_handle, msg->bodyptr);
(struct gateway_param_update_req *)msg->bodyptr);
qdf_mem_free(msg->bodyptr); qdf_mem_free(msg->bodyptr);
break; break;
case WMA_SET_ADAPT_DWELLTIME_CONF_PARAMS: case WMA_SET_ADAPT_DWELLTIME_CONF_PARAMS:

View File

@@ -5041,41 +5041,15 @@ int wma_roam_event_callback(WMA_HANDLE handle, uint8_t *event_buf,
} }
#ifdef FEATURE_LFR_SUBNET_DETECTION #ifdef FEATURE_LFR_SUBNET_DETECTION
/**
* wma_set_gateway_params() - set gateway parameters
* @wma: WMA handle
* @req: gateway parameter update request structure
*
* This function reads the incoming @req and fill in the destination
* WMI structure and sends down the gateway configs down to the firmware
*
* Return: QDF_STATUS
*/
QDF_STATUS wma_set_gateway_params(tp_wma_handle wma, QDF_STATUS wma_set_gateway_params(tp_wma_handle wma,
struct gateway_param_update_req *req) struct gateway_update_req_param *req)
{ {
struct gateway_update_req_param params = {0};
if (!wma) { if (!wma) {
WMA_LOGE("%s: wma handle is NULL", __func__); WMA_LOGE("%s: wma handle is NULL", __func__);
return QDF_STATUS_E_INVAL; return QDF_STATUS_E_INVAL;
} }
params.request_id = req->request_id; return wmi_unified_set_gateway_params_cmd(wma->wmi_handle, req);
params.vdev_id = req->session_id;
params.max_retries = req->max_retries;
params.timeout = req->timeout;
params.ipv4_addr_type = req->ipv4_addr_type;
params.ipv6_addr_type = req->ipv6_addr_type;
qdf_mem_copy(&params.gw_mac_addr, &req->gw_mac_addr,
sizeof(struct qdf_mac_addr));
qdf_mem_copy(params.ipv4_addr, req->ipv4_addr,
QDF_IPV4_ADDR_SIZE);
qdf_mem_copy(params.ipv6_addr, req->ipv6_addr,
QDF_IPV6_ADDR_SIZE);
return wmi_unified_set_gateway_params_cmd(wma->wmi_handle,
&params);
} }
#endif /* FEATURE_LFR_SUBNET_DETECTION */ #endif /* FEATURE_LFR_SUBNET_DETECTION */