|
@@ -4713,8 +4713,8 @@ int wlan_hdd_restore_channels(struct hdd_context *hdd_ctx,
|
|
|
static void wlan_hdd_set_dhcp_server_offload(struct hdd_adapter *adapter)
|
|
|
{
|
|
|
struct hdd_context *hdd_ctx = WLAN_HDD_GET_CTX(adapter);
|
|
|
- tpSirDhcpSrvOffloadInfo pDhcpSrvInfo;
|
|
|
- uint8_t numEntries = 0;
|
|
|
+ struct dhcp_offload_info_params dhcp_srv_info;
|
|
|
+ uint8_t num_entries = 0;
|
|
|
uint8_t srv_ip[IPADDR_NUM_ENTRIES];
|
|
|
uint8_t num;
|
|
|
uint32_t temp;
|
|
@@ -4722,45 +4722,47 @@ static void wlan_hdd_set_dhcp_server_offload(struct hdd_adapter *adapter)
|
|
|
mac_handle_t mac_handle;
|
|
|
QDF_STATUS status;
|
|
|
|
|
|
- pDhcpSrvInfo = qdf_mem_malloc(sizeof(*pDhcpSrvInfo));
|
|
|
- if (!pDhcpSrvInfo)
|
|
|
- return;
|
|
|
- pDhcpSrvInfo->vdev_id = adapter->vdev_id;
|
|
|
- pDhcpSrvInfo->dhcpSrvOffloadEnabled = true;
|
|
|
+ dhcp_srv_info.vdev_id = adapter->vdev_id;
|
|
|
+ dhcp_srv_info.dhcp_offload_enabled = true;
|
|
|
|
|
|
status = ucfg_fwol_get_dhcp_max_num_clients(hdd_ctx->psoc,
|
|
|
&dhcp_max_num_clients);
|
|
|
if (QDF_IS_STATUS_ERROR(status))
|
|
|
return;
|
|
|
|
|
|
- pDhcpSrvInfo->dhcpClientNum = dhcp_max_num_clients;
|
|
|
+ dhcp_srv_info.dhcp_client_num = dhcp_max_num_clients;
|
|
|
hdd_string_to_u8_array(hdd_ctx->config->dhcpServerIP,
|
|
|
- srv_ip, &numEntries, IPADDR_NUM_ENTRIES);
|
|
|
- if (numEntries != IPADDR_NUM_ENTRIES) {
|
|
|
- hdd_err("Incorrect IP address (%s) assigned for DHCP server!", hdd_ctx->config->dhcpServerIP);
|
|
|
- goto end;
|
|
|
+ srv_ip, &num_entries, IPADDR_NUM_ENTRIES);
|
|
|
+ if (num_entries != IPADDR_NUM_ENTRIES) {
|
|
|
+ hdd_err("Incorrect IP address (%s) assigned for DHCP server!",
|
|
|
+ hdd_ctx->config->dhcpServerIP);
|
|
|
+ return;
|
|
|
}
|
|
|
+
|
|
|
if ((srv_ip[0] >= 224) && (srv_ip[0] <= 239)) {
|
|
|
- hdd_err("Invalid IP address (%s)! It could NOT be multicast IP address!", hdd_ctx->config->dhcpServerIP);
|
|
|
- goto end;
|
|
|
+ hdd_err("Invalid IP address (%s)! It could NOT be multicast IP address!",
|
|
|
+ hdd_ctx->config->dhcpServerIP);
|
|
|
+ return;
|
|
|
}
|
|
|
+
|
|
|
if (srv_ip[IPADDR_NUM_ENTRIES - 1] >= 100) {
|
|
|
- hdd_err("Invalid IP address (%s)! The last field must be less than 100!", hdd_ctx->config->dhcpServerIP);
|
|
|
- goto end;
|
|
|
+ hdd_err("Invalid IP address (%s)! The last field must be less than 100!",
|
|
|
+ hdd_ctx->config->dhcpServerIP);
|
|
|
+ return;
|
|
|
}
|
|
|
- for (num = 0; num < numEntries; num++) {
|
|
|
+
|
|
|
+ dhcp_srv_info.dhcp_srv_addr = 0;
|
|
|
+ for (num = 0; num < num_entries; num++) {
|
|
|
temp = srv_ip[num];
|
|
|
- pDhcpSrvInfo->dhcpSrvIP |= (temp << (8 * num));
|
|
|
+ dhcp_srv_info.dhcp_srv_addr |= (temp << (8 * num));
|
|
|
}
|
|
|
+
|
|
|
mac_handle = hdd_ctx->mac_handle;
|
|
|
- if (QDF_STATUS_SUCCESS !=
|
|
|
- sme_set_dhcp_srv_offload(mac_handle, pDhcpSrvInfo)) {
|
|
|
- hdd_err("sme_setDHCPSrvOffload fail!");
|
|
|
- goto end;
|
|
|
- }
|
|
|
- hdd_debug("enable DHCP Server offload successfully!");
|
|
|
-end:
|
|
|
- qdf_mem_free(pDhcpSrvInfo);
|
|
|
+ status = sme_set_dhcp_srv_offload(mac_handle, &dhcp_srv_info);
|
|
|
+ if (QDF_IS_STATUS_SUCCESS(status))
|
|
|
+ hdd_debug("enable DHCP Server offload successfully!");
|
|
|
+ else
|
|
|
+ hdd_err("sme_set_dhcp_srv_offload fail!");
|
|
|
}
|
|
|
|
|
|
/**
|