linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Johan Hedberg <johan.hedberg@gmail.com>
To: linux-bluetooth@vger.kernel.org
Subject: [PATCH 02/15] Bluetooth: Rename mgmt connected events to match user space
Date: Wed, 18 Jan 2012 20:51:44 +0200	[thread overview]
Message-ID: <1326912717-6347-3-git-send-email-johan.hedberg@gmail.com> (raw)
In-Reply-To: <1326912717-6347-1-git-send-email-johan.hedberg@gmail.com>

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

User space uses device_(dis)connected instead of just (dis)connected so
rename the defines and functions to match this.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
---
 include/net/bluetooth/hci_core.h |    6 +++---
 include/net/bluetooth/mgmt.h     |    4 ++--
 net/bluetooth/hci_event.c        |    6 +++---
 net/bluetooth/mgmt.c             |   12 +++++++-----
 4 files changed, 15 insertions(+), 13 deletions(-)

diff --git a/include/net/bluetooth/hci_core.h b/include/net/bluetooth/hci_core.h
index 393acd0..f3fbfd6 100644
--- a/include/net/bluetooth/hci_core.h
+++ b/include/net/bluetooth/hci_core.h
@@ -896,10 +896,10 @@ int mgmt_connectable(struct hci_dev *hdev, u8 connectable);
 int mgmt_write_scan_failed(struct hci_dev *hdev, u8 scan, u8 status);
 int mgmt_new_link_key(struct hci_dev *hdev, struct link_key *key,
 								u8 persistent);
-int mgmt_connected(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 link_type,
-								u8 addr_type);
-int mgmt_disconnected(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 link_type,
+int mgmt_device_connected(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 link_type,
 								u8 addr_type);
+int mgmt_device_disconnected(struct hci_dev *hdev, bdaddr_t *bdaddr,
+						u8 link_type, u8 addr_type);
 int mgmt_disconnect_failed(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 status);
 int mgmt_connect_failed(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 link_type,
 						u8 addr_type, u8 status);
diff --git a/include/net/bluetooth/mgmt.h b/include/net/bluetooth/mgmt.h
index be65d34..d1d13dc 100644
--- a/include/net/bluetooth/mgmt.h
+++ b/include/net/bluetooth/mgmt.h
@@ -328,9 +328,9 @@ struct mgmt_ev_new_link_key {
 	struct mgmt_link_key_info key;
 } __packed;
 
-#define MGMT_EV_CONNECTED		0x000A
+#define MGMT_EV_DEVICE_CONNECTED	0x000A
 
-#define MGMT_EV_DISCONNECTED		0x000B
+#define MGMT_EV_DEVICE_DISCONNECTED	0x000B
 
 #define MGMT_EV_CONNECT_FAILED		0x000C
 struct mgmt_ev_connect_failed {
diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c
index 4eef43c..8d7505a 100644
--- a/net/bluetooth/hci_event.c
+++ b/net/bluetooth/hci_event.c
@@ -1643,7 +1643,7 @@ static inline void hci_conn_complete_evt(struct hci_dev *hdev, struct sk_buff *s
 			conn->state = BT_CONFIG;
 			hci_conn_hold(conn);
 			conn->disc_timeout = HCI_DISCONN_TIMEOUT;
-			mgmt_connected(hdev, &ev->bdaddr, conn->type,
+			mgmt_device_connected(hdev, &ev->bdaddr, conn->type,
 							conn->dst_type);
 		} else
 			conn->state = BT_CONNECTED;
@@ -1789,7 +1789,7 @@ static inline void hci_disconn_complete_evt(struct hci_dev *hdev, struct sk_buff
 		if (ev->status != 0)
 			mgmt_disconnect_failed(hdev, &conn->dst, ev->status);
 		else
-			mgmt_disconnected(hdev, &conn->dst, conn->type,
+			mgmt_device_disconnected(hdev, &conn->dst, conn->type,
 							conn->dst_type);
 	}
 
@@ -3188,7 +3188,7 @@ static inline void hci_le_conn_complete_evt(struct hci_dev *hdev, struct sk_buff
 		goto unlock;
 	}
 
-	mgmt_connected(hdev, &ev->bdaddr, conn->type, conn->dst_type);
+	mgmt_device_connected(hdev, &ev->bdaddr, conn->type, conn->dst_type);
 
 	conn->sec_level = BT_SECURITY_LOW;
 	conn->handle = __le16_to_cpu(ev->handle);
diff --git a/net/bluetooth/mgmt.c b/net/bluetooth/mgmt.c
index e7bbad8..c8042c6 100644
--- a/net/bluetooth/mgmt.c
+++ b/net/bluetooth/mgmt.c
@@ -2464,7 +2464,7 @@ int mgmt_new_link_key(struct hci_dev *hdev, struct link_key *key,
 	return mgmt_event(MGMT_EV_NEW_LINK_KEY, hdev, &ev, sizeof(ev), NULL);
 }
 
-int mgmt_connected(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 link_type,
+int mgmt_device_connected(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 link_type,
 								u8 addr_type)
 {
 	struct mgmt_addr_info ev;
@@ -2472,7 +2472,8 @@ int mgmt_connected(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 link_type,
 	bacpy(&ev.bdaddr, bdaddr);
 	ev.type = link_to_mgmt(link_type, addr_type);
 
-	return mgmt_event(MGMT_EV_CONNECTED, hdev, &ev, sizeof(ev), NULL);
+	return mgmt_event(MGMT_EV_DEVICE_CONNECTED, hdev, &ev, sizeof(ev),
+									NULL);
 }
 
 static void disconnect_rsp(struct pending_cmd *cmd, void *data)
@@ -2509,8 +2510,8 @@ static void remove_keys_rsp(struct pending_cmd *cmd, void *data)
 	mgmt_pending_remove(cmd);
 }
 
-int mgmt_disconnected(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 link_type,
-								u8 addr_type)
+int mgmt_device_disconnected(struct hci_dev *hdev, bdaddr_t *bdaddr,
+						u8 link_type, u8 addr_type)
 {
 	struct mgmt_addr_info ev;
 	struct sock *sk = NULL;
@@ -2521,7 +2522,8 @@ int mgmt_disconnected(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 link_type,
 	bacpy(&ev.bdaddr, bdaddr);
 	ev.type = link_to_mgmt(link_type, addr_type);
 
-	err = mgmt_event(MGMT_EV_DISCONNECTED, hdev, &ev, sizeof(ev), sk);
+	err = mgmt_event(MGMT_EV_DEVICE_DISCONNECTED, hdev, &ev, sizeof(ev),
+									sk);
 
 	if (sk)
 		sock_put(sk);
-- 
1.7.8.3


  parent reply	other threads:[~2012-01-18 18:51 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-18 18:51 [PATCH 0/15] Bluetooth: Update to latest mgmt API Johan Hedberg
2012-01-18 18:51 ` [PATCH 01/15] Bluetooth: Fix clearing persistent flags Johan Hedberg
2012-01-18 19:02   ` Marcel Holtmann
2012-01-18 18:51 ` Johan Hedberg [this message]
2012-01-18 19:03   ` [PATCH 02/15] Bluetooth: Rename mgmt connected events to match user space Marcel Holtmann
2012-01-18 18:51 ` [PATCH 03/15] Bluetooth: Add eir_len parameter to mgmt_ev_device_found Johan Hedberg
2012-01-18 19:04   ` Marcel Holtmann
2012-01-18 18:51 ` [PATCH 04/15] Bluetooth: Rename eir_has_complete_name to eir_has_data_type Johan Hedberg
2012-01-18 19:05   ` Marcel Holtmann
2012-01-18 18:51 ` [PATCH 05/15] Bluetooth: Add missing EIR defines to hci.h Johan Hedberg
2012-01-18 19:05   ` Marcel Holtmann
2012-01-18 18:51 ` [PATCH 06/15] Bluetooth: Move eir_has_data_field to hci_core.h Johan Hedberg
2012-01-18 19:06   ` Marcel Holtmann
2012-01-18 18:51 ` [PATCH 07/15] Bluetooth: Merge device class into the EIR data in mgmt_ev_device_found Johan Hedberg
2012-01-18 19:08   ` Marcel Holtmann
2012-01-18 19:18   ` Anderson Lizardo
2012-01-18 20:29     ` Johan Hedberg
2012-01-18 20:40       ` Anderson Lizardo
2012-01-18 20:58         ` Johan Hedberg
2012-01-19  9:26   ` Andrei Emeltchenko
2012-01-18 18:51 ` [PATCH 08/15] Bluetooth: Rename conn->pend to conn->flags Johan Hedberg
2012-01-18 19:12   ` Marcel Holtmann
2012-01-18 18:51 ` [PATCH 09/15] Bluetooth: Merge boolean members of struct hci_conn into flags Johan Hedberg
2012-01-18 19:12   ` Marcel Holtmann
2012-01-18 19:25     ` Johan Hedberg
2012-01-18 19:31       ` Marcel Holtmann
2012-01-18 18:51 ` [PATCH 10/15] Bluetooth: Add a convenience function to check for SSP enabled Johan Hedberg
2012-01-18 19:14   ` Marcel Holtmann
2012-01-19  9:30   ` Andrei Emeltchenko
2012-01-19  9:39     ` Johan Hedberg
2012-01-18 18:51 ` [PATCH 11/15] Bluetooth: Convert hdev->ssp_mode to a flag Johan Hedberg
2012-01-18 19:14   ` Marcel Holtmann
2012-01-18 18:51 ` [PATCH 12/15] Bluetooth: Convert hdev->out to a bool type Johan Hedberg
2012-01-18 19:15   ` Marcel Holtmann
2012-01-18 18:51 ` [PATCH 13/15] Bluetooth: Update device_connected and device_found events to latest API Johan Hedberg
2012-01-18 19:17   ` Marcel Holtmann
2012-01-18 18:51 ` [PATCH 14/15] Bluetooth: Rename hdev->flags to hdev->compat_flags Johan Hedberg
2012-01-18 19:18   ` Marcel Holtmann
2012-01-18 18:51 ` [PATCH 15/15] Bluetooth: Rename hdev->dev_flags to hdev-flags Johan Hedberg

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=1326912717-6347-3-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;
as well as URLs for NNTP newsgroup(s).