Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp1193913ybt; Tue, 7 Jul 2020 09:45:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzC7nd2Yz298V8thifpNooCmKPNg/RRtd/92VMrCbkEwGhGEWc3hJn3CCRykZu1xXKkYGFK X-Received: by 2002:a17:907:41dc:: with SMTP id og20mr25011215ejb.183.1594140326455; Tue, 07 Jul 2020 09:45:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594140326; cv=none; d=google.com; s=arc-20160816; b=J/EnhttVFZx2rNR7nRoLaxRjOznzcBJrIaaRa9Pj9MWQB5bzAgGAl57SzCP0yOoUqx oHbw1RN7SvrLN5N31HK+yxQQXqOREreAbZPq48rd840ySEW3rZWzzyeLhHOqG7fUgZ2A s8SeZ52/nBGToaA3M4jtHtLbrleCfqwQ5Sq96Lr1Mbkyw/VREYMpR9rBoAzGdd6Gp7e2 8YCtdr0qo47UqZ2KOBkZDcwRb22zwE9EV0Bdw9UzJVRHZ/fJV571uEvdY/GzPlVJWK7j myCIiTY73t5bm/E+oULRl1nsx2lJBJ+2E7i1QEpxSxR9x/s1lgoOuyZ7GRl+yz6iKM5S bNVA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:ironport-sdr:ironport-sdr; bh=+AYShNhjQ32BDdxYbFP+IIIG7S03511dD68iQLW8g1c=; b=wUgv6CQSq3/S0e8iUS5CtnMu5trdHfDO4u29nz/AUX4ymD/H4EOgFaT2qnIw10p8PJ M8y4Om+62vvqNiXCleyTOY4NsybdPAaLVI9wmq/06USFoKCyh7MzYXfFovzm4lyjeJoQ 9o+dwnSMQNCo4NxeN8AsjpVVROms2jXujIL66vHDjmbwpm2j7OTRVk2otSHV2uE1Gd7Q fMGBz0ehAeXxlaA8kTjXU3zq/osz/tT03MPVPNleKxhnH3HQwOyuT3WSWRBLQ7giw9NX F50idIZYmccetHKQNI5STCrwMjgPv1kSh1pdpBKusIWRuRWDL/z9XH0kfM6lvGW9lzRv A6CA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i6si16394886edv.52.2020.07.07.09.44.53; Tue, 07 Jul 2020 09:45:26 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726911AbgGGQot (ORCPT + 99 others); Tue, 7 Jul 2020 12:44:49 -0400 Received: from mga03.intel.com ([134.134.136.65]:62900 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728073AbgGGQot (ORCPT ); Tue, 7 Jul 2020 12:44:49 -0400 IronPort-SDR: 4MMHdr2gbIQbT9W2XLLV/MwOsyUhWBDfncWD7lA76htGQRnumqNBb2PQZ5TcQZAmTfVd+XfqsU eakmiqgQslwQ== X-IronPort-AV: E=McAfee;i="6000,8403,9675"; a="147657525" X-IronPort-AV: E=Sophos;i="5.75,324,1589266800"; d="scan'208";a="147657525" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga007.jf.intel.com ([10.7.209.58]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Jul 2020 09:44:40 -0700 IronPort-SDR: JLP6Xz/YBRmEUso3fbskmMKTEYHUoAE+f0LEAY67oo4ZRwa8GmEF64m2AzHmQrkO2paptUhRI8 cXIwwojdTClw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.75,324,1589266800"; d="scan'208";a="323592430" Received: from jdlachim-mobl.amr.corp.intel.com (HELO ingas-nuc1.intel.com) ([10.255.230.123]) by orsmga007.jf.intel.com with ESMTP; 07 Jul 2020 09:44:40 -0700 From: Inga Stotland To: linux-bluetooth@vger.kernel.org Cc: brian.gix@intel.com, Inga Stotland Subject: [PATCH BlueZ 1/2] mesh: Get rid of "unreliable opcodes" in config server Date: Tue, 7 Jul 2020 09:44:38 -0700 Message-Id: <20200707164439.24146-1-inga.stotland@intel.com> X-Mailer: git-send-email 2.26.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-bluetooth-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org This removes an old notion of unreliable opcodes in config server model , i.e., a correctly formatted acknowledged message always gets a response. --- mesh/cfgmod-server.c | 31 +++++++++++-------------------- mesh/model.h | 2 -- 2 files changed, 11 insertions(+), 22 deletions(-) diff --git a/mesh/cfgmod-server.c b/mesh/cfgmod-server.c index c525d9d24..8ba9bc6ec 100644 --- a/mesh/cfgmod-server.c +++ b/mesh/cfgmod-server.c @@ -98,9 +98,8 @@ static void config_pub_get(struct mesh_node *node, uint16_t net_idx, } static void config_pub_set(struct mesh_node *node, uint16_t net_idx, - uint16_t src, uint16_t dst, - const uint8_t *pkt, bool virt, - bool vendor, bool unreliable) + uint16_t src, uint16_t dst, + const uint8_t *pkt, bool virt, bool vendor) { uint32_t mod_id; uint16_t ele_addr, idx, ota = UNASSIGNED_ADDRESS; @@ -143,9 +142,8 @@ static void config_pub_set(struct mesh_node *node, uint16_t net_idx, status, ele_addr, ota, mod_id, idx); if (status != MESH_STATUS_SUCCESS) { - if (!unreliable) - send_pub_status(node, net_idx, src, dst, status, - ele_addr, mod_id, 0, 0, 0, 0, 0, 0); + send_pub_status(node, net_idx, src, dst, status, ele_addr, + mod_id, 0, 0, 0, 0, 0, 0); return; } @@ -180,10 +178,8 @@ static void config_pub_set(struct mesh_node *node, uint16_t net_idx, status = MESH_STATUS_STORAGE_FAIL; } - if (!unreliable) - send_pub_status(node, net_idx, src, dst, status, ele_addr, - mod_id, ota, idx, cred_flag, ttl, - period, retransmit); + send_pub_status(node, net_idx, src, dst, status, ele_addr, mod_id, ota, + idx, cred_flag, ttl, period, retransmit); } static void send_sub_status(struct mesh_node *node, uint16_t net_idx, @@ -311,7 +307,6 @@ static void config_sub_set(struct mesh_node *node, uint16_t net_idx, bool virt, uint32_t opcode) { uint16_t grp, ele_addr; - bool unreliable = !!(opcode & OP_UNRELIABLE); uint32_t mod_id; const uint8_t *addr = NULL; int status = MESH_STATUS_SUCCESS; @@ -369,7 +364,7 @@ static void config_sub_set(struct mesh_node *node, uint16_t net_idx, } else grp = UNASSIGNED_ADDRESS; - switch (opcode & ~OP_UNRELIABLE) { + switch (opcode) { default: l_debug("Bad opcode: %x", opcode); return; @@ -411,8 +406,8 @@ static void config_sub_set(struct mesh_node *node, uint16_t net_idx, grp = UNASSIGNED_ADDRESS; /* Fall Through */ case OP_CONFIG_MODEL_SUB_DELETE: - status = mesh_model_sub_del(node, ele_addr, mod_id, - addr, virt, &grp); + status = mesh_model_sub_del(node, ele_addr, mod_id, addr, virt, + &grp); if (status == MESH_STATUS_SUCCESS) save_config_sub(node, ele_addr, mod_id, vendor, addr, @@ -421,10 +416,7 @@ static void config_sub_set(struct mesh_node *node, uint16_t net_idx, break; } - if (!unreliable) - send_sub_status(node, net_idx, src, dst, status, ele_addr, - grp, mod_id); - + send_sub_status(node, net_idx, src, dst, status, ele_addr, grp, mod_id); } static void send_model_app_status(struct mesh_node *node, uint16_t net_idx, @@ -786,8 +778,7 @@ static bool cfg_srv_pkt(uint16_t src, uint16_t dst, uint16_t app_idx, return true; config_pub_set(node, net_idx, src, dst, pkt, virt, - size == 13 || size == 27, - !!(opcode & OP_UNRELIABLE)); + size == 13 || size == 27); break; case OP_CONFIG_MODEL_PUB_GET: diff --git a/mesh/model.h b/mesh/model.h index f717fb00c..0377d3fdd 100644 --- a/mesh/model.h +++ b/mesh/model.h @@ -19,8 +19,6 @@ struct mesh_model; -#define OP_UNRELIABLE 0x0100 - #define MAX_BINDINGS 10 #define MAX_GRP_PER_MOD 10 -- 2.26.2