summaryrefslogtreecommitdiff
path: root/mesh/mesh-mgmt.c
diff options
context:
space:
mode:
authorInga Stotland <inga.stotland@intel.com>2019-12-10 15:06:00 -0800
committerBrian Gix <brian.gix@intel.com>2019-12-15 09:33:37 -0800
commit3228ce1472e88cf1d259d7a23ee8772c921468fa (patch)
tree7b942044643937f8bd55553ff89c248f4c27b40a /mesh/mesh-mgmt.c
parentce2f88bd2cf813321a46f3190c37658dde98ff05 (diff)
downloadbluez-3228ce1472e88cf1d259d7a23ee8772c921468fa.tar.gz
mesh: Remove redundant code in mesh IO mgmt
This removes unnecessary housekeeping for hci controllers
Diffstat (limited to 'mesh/mesh-mgmt.c')
-rw-r--r--mesh/mesh-mgmt.c22
1 files changed, 2 insertions, 20 deletions
diff --git a/mesh/mesh-mgmt.c b/mesh/mesh-mgmt.c
index 27272d4d2..2cf2ebac2 100644
--- a/mesh/mesh-mgmt.c
+++ b/mesh/mesh-mgmt.c
@@ -42,14 +42,8 @@ struct read_info_req {
};
static struct mgmt *mgmt_mesh;
-static struct l_queue *controllers;
static struct l_queue *read_info_regs;
-static bool simple_match(const void *a, const void *b)
-{
- return a == b;
-}
-
static void process_read_info_req(void *data, void *user_data)
{
struct read_info_reg *reg = data;
@@ -101,23 +95,14 @@ static void read_info_cb(uint8_t status, uint16_t length,
static void index_added(uint16_t index, uint16_t length, const void *param,
void *user_data)
{
- if (l_queue_find(controllers, simple_match, L_UINT_TO_PTR(index)))
- return;
-
- l_queue_push_tail(controllers, L_UINT_TO_PTR(index));
-
- if (mgmt_send(mgmt_mesh, MGMT_OP_READ_INFO, index, 0, NULL,
- read_info_cb, L_UINT_TO_PTR(index), NULL) != 0)
- return;
-
- l_queue_remove(controllers, L_UINT_TO_PTR(index));
+ mgmt_send(mgmt_mesh, MGMT_OP_READ_INFO, index, 0, NULL,
+ read_info_cb, L_UINT_TO_PTR(index), NULL);
}
static void index_removed(uint16_t index, uint16_t length, const void *param,
void *user_data)
{
l_warn("Hci dev %4.4x removed", index);
- l_queue_remove(controllers, L_UINT_TO_PTR(index));
}
static void read_index_list_cb(uint8_t status, uint16_t length,
@@ -157,9 +142,6 @@ static void read_index_list_cb(uint8_t status, uint16_t length,
static bool mesh_mgmt_init(void)
{
- if (!controllers)
- controllers = l_queue_new();
-
if (!read_info_regs)
read_info_regs = l_queue_new();