diff options
author | Srinivas Dasari <dasaris@codeaurora.org> | 2018-03-08 21:11:01 +0530 |
---|---|---|
committer | Roshan Pius <rpius@google.com> | 2018-03-30 10:52:40 -0700 |
commit | 619c8b89e87de363ceaa7731cf8205b9d8a99cb6 (patch) | |
tree | 42287ae92d9fa0b2791b1b7ede40e2e56649b771 /qcwcn | |
parent | 53d1b8962c4c40ea330794616a7a99ee8d7b5786 (diff) | |
download | wlan-619c8b89e87de363ceaa7731cf8205b9d8a99cb6.tar.gz |
WiFi-Hal: Cleanup unused command register/deregister code
wifi_register_cmd and wifi_unregister_cmd APIs are not used
anymore and can be cleaned up.
Bug: 74215851
Change-Id: I2c7de027515ffa85a3c58cea2b41f02c3ee0e56e
(cherry-picked from b690ce2542d5ec41014d760860704be50067136d)
Diffstat (limited to 'qcwcn')
-rw-r--r-- | qcwcn/wifi_hal/common.cpp | 47 | ||||
-rw-r--r-- | qcwcn/wifi_hal/common.h | 9 | ||||
-rw-r--r-- | qcwcn/wifi_hal/wifi_hal.cpp | 13 |
3 files changed, 0 insertions, 69 deletions
diff --git a/qcwcn/wifi_hal/common.cpp b/qcwcn/wifi_hal/common.cpp index 1afaef6..c54577c 100644 --- a/qcwcn/wifi_hal/common.cpp +++ b/qcwcn/wifi_hal/common.cpp @@ -189,53 +189,6 @@ void wifi_unregister_vendor_handler(wifi_handle handle, uint32_t id, int subcmd) } -wifi_error wifi_register_cmd(wifi_handle handle, int id, WifiCommand *cmd) -{ - hal_info *info = (hal_info *)handle; - - if (info->num_cmd < info->alloc_cmd) { - info->cmd[info->num_cmd].id = id; - info->cmd[info->num_cmd].cmd = cmd; - info->num_cmd++; - ALOGV("Successfully added command %d: %p", id, cmd); - return WIFI_SUCCESS; - } else { - return WIFI_ERROR_OUT_OF_MEMORY; - } -} - -WifiCommand *wifi_unregister_cmd(wifi_handle handle, int id) -{ - hal_info *info = (hal_info *)handle; - - for (int i = 0; i < info->num_cmd; i++) { - if (info->cmd[i].id == id) { - WifiCommand *cmd = info->cmd[i].cmd; - memmove(&info->cmd[i], &info->cmd[i+1], (info->num_cmd - i) * sizeof(cmd_info)); - info->num_cmd--; - ALOGV("Successfully removed command %d: %p", id, cmd); - return cmd; - } - } - - return NULL; -} - -void wifi_unregister_cmd(wifi_handle handle, WifiCommand *cmd) -{ - hal_info *info = (hal_info *)handle; - - for (int i = 0; i < info->num_cmd; i++) { - if (info->cmd[i].cmd == cmd) { - int id = info->cmd[i].id; - memmove(&info->cmd[i], &info->cmd[i+1], (info->num_cmd - i) * sizeof(cmd_info)); - info->num_cmd--; - ALOGV("Successfully removed command %d: %p", id, cmd); - return; - } - } -} - #ifdef __cplusplus extern "C" { diff --git a/qcwcn/wifi_hal/common.h b/qcwcn/wifi_hal/common.h index a0c3b1e..1c10f1f 100644 --- a/qcwcn/wifi_hal/common.h +++ b/qcwcn/wifi_hal/common.h @@ -50,7 +50,6 @@ #define SOCKET_BUFFER_SIZE (32768U) #define RECV_BUF_SIZE (4096) #define DEFAULT_EVENT_CB_SIZE (64) -#define DEFAULT_CMD_SIZE (64) #define NUM_RING_BUFS 5 #define MAC_ADDR_ARRAY(a) (a)[0], (a)[1], (a)[2], (a)[3], (a)[4], (a)[5] @@ -111,10 +110,6 @@ typedef struct hal_info_s { int alloc_event_cb; // number of allocated callback objects pthread_mutex_t cb_lock; // mutex for the event_cb access - cmd_info *cmd; // Outstanding commands - int num_cmd; // number of commands - int alloc_cmd; // number of commands allocated - interface_info **interfaces; // array of interfaces int num_interfaces; // number of interfaces @@ -157,10 +152,6 @@ wifi_error wifi_register_vendor_handler(wifi_handle handle, void wifi_unregister_handler(wifi_handle handle, int cmd); void wifi_unregister_vendor_handler(wifi_handle handle, uint32_t id, int subcmd); -wifi_error wifi_register_cmd(wifi_handle handle, int id, WifiCommand *cmd); -WifiCommand *wifi_unregister_cmd(wifi_handle handle, int id); -void wifi_unregister_cmd(wifi_handle handle, WifiCommand *cmd); - interface_info *getIfaceInfo(wifi_interface_handle); wifi_handle getWifiHandle(wifi_interface_handle handle); hal_info *getHalInfo(wifi_handle handle); diff --git a/qcwcn/wifi_hal/wifi_hal.cpp b/qcwcn/wifi_hal/wifi_hal.cpp index 050211c..bb42d93 100644 --- a/qcwcn/wifi_hal/wifi_hal.cpp +++ b/qcwcn/wifi_hal/wifi_hal.cpp @@ -520,15 +520,6 @@ wifi_error wifi_initialize(wifi_handle *handle) info->alloc_event_cb = DEFAULT_EVENT_CB_SIZE; info->num_event_cb = 0; - info->cmd = (cmd_info *)malloc(sizeof(cmd_info) * DEFAULT_CMD_SIZE); - if (info->cmd == NULL) { - ALOGE("Could not allocate cmd info"); - ret = WIFI_ERROR_OUT_OF_MEMORY; - goto unload; - } - info->alloc_cmd = DEFAULT_CMD_SIZE; - info->num_cmd = 0; - info->nl80211_family_id = genl_ctrl_resolve(cmd_sock, "nl80211"); if (info->nl80211_family_id < 0) { ALOGE("Could not resolve nl80211 familty id"); @@ -697,7 +688,6 @@ unload: if (event_sock) nl_socket_free(event_sock); if (info) { - if (info->cmd) free(info->cmd); if (info->cldctx) { cld80211lib_cleanup(info); } else if (info->user_sock) { @@ -769,9 +759,6 @@ static void internal_cleaned_up_handler(wifi_handle handle) free(info->interfaces); } - if (info->cmd) - free(info->cmd); - if (info->cldctx != NULL) { cld80211lib_cleanup(info); } else if (info->user_sock != 0) { |