Linux bluetooth development
 help / color / mirror / Atom feed
From: johan.hedberg@gmail.com
To: linux-bluetooth@vger.kernel.org
Subject: [PATCH v3 13/13] Bluetooth: Remove unneeded hdev->own_addr_type
Date: Sun, 23 Feb 2014 19:42:29 +0200	[thread overview]
Message-ID: <1393177349-361-13-git-send-email-johan.hedberg@gmail.com> (raw)
In-Reply-To: <1393177349-361-1-git-send-email-johan.hedberg@gmail.com>

From: Johan Hedberg <johan.hedberg@intel.com>

Now that the identity address type is always looked up for all
successful connections using the hci_copy_identity_address function the
hdev->own_addr_type variable has become completely unnecessary. Simply
remove it.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
---
 include/net/bluetooth/hci_core.h |  1 -
 net/bluetooth/hci_core.c         | 17 +----------------
 2 files changed, 1 insertion(+), 17 deletions(-)

diff --git a/include/net/bluetooth/hci_core.h b/include/net/bluetooth/hci_core.h
index 2506963c7a06..43b6d1131c4d 100644
--- a/include/net/bluetooth/hci_core.h
+++ b/include/net/bluetooth/hci_core.h
@@ -156,7 +156,6 @@ struct hci_dev {
 	bdaddr_t	bdaddr;
 	bdaddr_t	random_addr;
 	bdaddr_t	static_addr;
-	__u8		own_addr_type;
 	__u8		dev_name[HCI_MAX_NAME_LENGTH];
 	__u8		short_name[HCI_MAX_SHORT_NAME_LENGTH];
 	__u8		eir[HCI_MAX_EIR_LENGTH];
diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c
index 629919be071c..1651de959d9c 100644
--- a/net/bluetooth/hci_core.c
+++ b/net/bluetooth/hci_core.c
@@ -1506,23 +1506,8 @@ static void hci_init3_req(struct hci_request *req, unsigned long opt)
 	if (hdev->commands[5] & 0x10)
 		hci_setup_link_policy(req);
 
-	if (lmp_le_capable(hdev)) {
-		/* If the controller has a public BD_ADDR, then by default
-		 * use that one. If this is a LE only controller without
-		 * a public address, default to the random address.
-		 *
-		 * For debugging purposes it is possible to force
-		 * controllers with a public address to use the
-		 * random address instead.
-		 */
-		if (test_bit(HCI_FORCE_STATIC_ADDR, &hdev->dev_flags) ||
-		    !bacmp(&hdev->bdaddr, BDADDR_ANY))
-			hdev->own_addr_type = ADDR_LE_DEV_RANDOM;
-		else
-			hdev->own_addr_type = ADDR_LE_DEV_PUBLIC;
-
+	if (lmp_le_capable(hdev))
 		hci_set_le_support(req);
-	}
 
 	/* Read features beyond page 1 if available */
 	for (p = 2; p < HCI_MAX_PAGES && p <= hdev->max_page; p++) {
-- 
1.8.5.3


  parent reply	other threads:[~2014-02-23 17:42 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-23 17:42 [PATCH v3 01/13] Bluetooth: Ensure hci_conn always contains the local identity address johan.hedberg
2014-02-23 17:42 ` [PATCH v3 02/13] Bluetooth: Set the correct values for Identity Address Information johan.hedberg
2014-02-23 17:42 ` [PATCH v3 03/13] Bluetooth: Add SMP function for generating RPAs johan.hedberg
2014-02-23 17:42 ` [PATCH v3 04/13] Bluetooth: Add timer for regenerating local RPA johan.hedberg
2014-02-23 17:42 ` [PATCH v3 05/13] Bluetooth: Add hci_update_random_address() convenience function johan.hedberg
2014-02-23 17:42 ` [PATCH v3 06/13] Bluetooth: Use hci_update_random_address() when connecting LE johan.hedberg
2014-02-23 17:42 ` [PATCH v3 07/13] Bluetooth: Use hci_update_random_address() for enabling advertising johan.hedberg
2014-02-23 17:42 ` [PATCH v3 08/13] Bluetooth: Use hci_update_random_address() for initiating LE scan johan.hedberg
2014-02-23 17:42 ` [PATCH v3 09/13] Bluetooth: Don't write static address during power on johan.hedberg
2014-02-23 17:42 ` [PATCH v3 10/13] Bluetooth: Add debugfs entry for RPA regeneration timeout johan.hedberg
2014-02-23 17:42 ` [PATCH v3 11/13] Bluetooth: Add support for Set Privacy command johan.hedberg
2014-02-23 17:42 ` [PATCH v3 12/13] Bluetooth: Fix setting correct src_type when connecting LE johan.hedberg
2014-02-23 17:42 ` johan.hedberg [this message]
2014-02-23 20:07 ` [PATCH v4] Bluetooth: Ensure hci_conn always contains the local identity address johan.hedberg
2014-02-23 20:44   ` Marcel Holtmann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1393177349-361-13-git-send-email-johan.hedberg@gmail.com \
    --to=johan.hedberg@gmail.com \
    --cc=linux-bluetooth@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox