Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp140858ybi; Thu, 11 Jul 2019 16:24:21 -0700 (PDT) X-Google-Smtp-Source: APXvYqwJvXExD7VSCQwuK94h6rCsf9bV9dxhNCAqHGrYzlzCHGdP+QWyWjdgNcCJ5e9DDp8oIgBl X-Received: by 2002:a17:90a:f98a:: with SMTP id cq10mr7726377pjb.43.1562887461163; Thu, 11 Jul 2019 16:24:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562887461; cv=none; d=google.com; s=arc-20160816; b=gShpQBaDj+cbQrxrn7+fB5YPjFjD9Hzpldag9fqiRwPXdxzQKhUBesn9f6L6EfMInR 0XhDQBL7aSggl0ehZm2e1fdSgabTVBBFyQnPeoU2dg2wWlJY9chM6H3oxLGC2L2qumNy 0CYZ0sKbUokljvUT7eu+1gcdOmRFeFFthU4lKmfZHVI6vlEsVPjgFET/Gu4dFm7E6J57 oTVycGWFfwRCaU/9FnZ3tGkw/Wx3J59kj9rwG7vWEh2scaySffnp9Zmxjfmq0Gg3KLJ0 VyIlCpw3E3kgIldxmxfD8YzM7UltTY9VlUeTU52zyGUrvWYgVe3et//onvzvhJ2X291i N8Fg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from; bh=U9GZA5c7tEhPZWUILZMdwvKCXKe9Av8xOuX5sfliAEI=; b=uvK5RzT25fCLQj6cvToEq5FvRsRem/Aw0OcZ7PIjemudXvqlwwQIBVrBzV9oSxDXzT 29o1k4FBLcAcnWADlDde7GYX5Nac5MSG+Np6c0Gf3kV4dqFvY4pTyBFOiMf0LKaC+xh9 0TsFBpL6IxF4118YGBkza1KZyzQK7EoPwbroYLhVEutwCOdGu0DpGi7v9SI/nLFnLpjK AOFMXmlSSQUhif7TxgiBn+2re0fh4/d/hHOKt2BJueDt5Nx/TBlJV/vbzmUXJv7UB83v BGFqi4/Hj4LqhibY/VyTpODYh6/CVWvMRhElDoGYnn7BOn5Kh6QnLEpKwRDTBJ5KMgcS bEcA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-bluetooth-owner@vger.kernel.org designates 209.132.180.67 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. [209.132.180.67]) by mx.google.com with ESMTP id d4si6177786pgc.75.2019.07.11.16.24.06; Thu, 11 Jul 2019 16:24:21 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-bluetooth-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-bluetooth-owner@vger.kernel.org designates 209.132.180.67 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 S1729089AbfGKXAZ (ORCPT + 99 others); Thu, 11 Jul 2019 19:00:25 -0400 Received: from mga01.intel.com ([192.55.52.88]:39428 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726587AbfGKXAZ (ORCPT ); Thu, 11 Jul 2019 19:00:25 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 11 Jul 2019 16:00:24 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.63,480,1557212400"; d="scan'208";a="166516215" Received: from bgix-dell-lap.sea.intel.com ([10.255.80.129]) by fmsmga008.fm.intel.com with ESMTP; 11 Jul 2019 16:00:24 -0700 From: Brian Gix To: linux-bluetooth@vger.kernel.org Cc: inga.stotland@intel.com, michal.lowas-rzechonek@silvair.com, brian.gix@intel.com Subject: [PATCH BlueZ v2 3/9] mesh: Add special Beacon handler for Provisioning Date: Thu, 11 Jul 2019 15:59:46 -0700 Message-Id: <20190711225952.1599-4-brian.gix@intel.com> X-Mailer: git-send-email 2.14.5 In-Reply-To: <20190711225952.1599-1-brian.gix@intel.com> References: <20190711225952.1599-1-brian.gix@intel.com> Sender: linux-bluetooth-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org Provisioning uses the same AD type for Provisioning that is also used by the Secure Network Beacon, but their usage is distinct from each other. This change allows us to enable/disable Unprovisioned Device Beacon capture without disrupting SNB handling. --- mesh/mesh-io-generic.c | 2 +- mesh/mesh-io.c | 6 ++++-- mesh/mesh-io.h | 7 ++++--- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/mesh/mesh-io-generic.c b/mesh/mesh-io-generic.c index 42aaa0947..576c5df1b 100644 --- a/mesh/mesh-io-generic.c +++ b/mesh/mesh-io-generic.c @@ -40,7 +40,7 @@ struct mesh_io_private { struct l_timeout *tx_timeout; struct l_queue *rx_regs; struct l_queue *tx_pkts; - uint8_t filters[3]; /* Simple filtering on AD type only */ + uint8_t filters[4]; bool sending; struct tx_pkt *tx; uint16_t interval; diff --git a/mesh/mesh-io.c b/mesh/mesh-io.c index 62a8c0e2c..94a92e885 100644 --- a/mesh/mesh-io.c +++ b/mesh/mesh-io.c @@ -86,12 +86,14 @@ struct mesh_io *mesh_io_new(enum mesh_io_type type, void *opts) if (api->set) { uint8_t pkt = MESH_AD_TYPE_NETWORK; - uint8_t bec = MESH_AD_TYPE_BEACON; uint8_t prv = MESH_AD_TYPE_PROVISION; + uint8_t snb[2] = {MESH_AD_TYPE_BEACON, 0x01}; + uint8_t prvb[2] = {MESH_AD_TYPE_BEACON, 0x00}; - api->set(io, 1, &bec, 1, NULL, NULL); + api->set(io, 1, snb, sizeof(snb), NULL, NULL); api->set(io, 2, &prv, 1, NULL, NULL); api->set(io, 3, &pkt, 1, NULL, NULL); + api->set(io, 4, prvb, sizeof(prvb), NULL, NULL); } if (l_queue_push_head(io_list, io)) diff --git a/mesh/mesh-io.h b/mesh/mesh-io.h index 6585205c7..1c10779aa 100644 --- a/mesh/mesh-io.h +++ b/mesh/mesh-io.h @@ -19,9 +19,10 @@ struct mesh_io; -#define MESH_IO_FILTER_BEACON 1 -#define MESH_IO_FILTER_PROV 2 -#define MESH_IO_FILTER_NET 3 +#define MESH_IO_FILTER_BEACON 1 +#define MESH_IO_FILTER_PROV 2 +#define MESH_IO_FILTER_NET 3 +#define MESH_IO_FILTER_PROV_BEACON 4 #define MESH_IO_TX_COUNT_UNLIMITED 0 -- 2.14.5