[PATCH 02/10] bnep: Rename send ctrl_rsp and make it global

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Renaming send_bnep_ctrl_rsp to bnep_send_ctrl_rsp and moving
to bnep.h. It is required in android/*.
---
 profiles/network/bnep.c   | 11 +++++++++++
 profiles/network/bnep.h   |  2 ++
 profiles/network/server.c | 13 +------------
 3 files changed, 14 insertions(+), 12 deletions(-)

diff --git a/profiles/network/bnep.c b/profiles/network/bnep.c
index aa980a2..57dfbf9 100644
--- a/profiles/network/bnep.c
+++ b/profiles/network/bnep.c
@@ -464,3 +464,14 @@ int bnep_del_from_bridge(const char *devname, const char *bridge)
 
 	return 0;
 }
+
+ssize_t bnep_send_ctrl_rsp(int sk, uint8_t type, uint8_t ctrl, uint16_t resp)
+{
+	struct bnep_control_rsp rsp;
+
+	rsp.type = type;
+	rsp.ctrl = ctrl;
+	rsp.resp = htons(resp);
+
+	return send(sk, &rsp, sizeof(rsp), 0);
+}
diff --git a/profiles/network/bnep.h b/profiles/network/bnep.h
index 1905a98..dea0319 100644
--- a/profiles/network/bnep.h
+++ b/profiles/network/bnep.h
@@ -39,3 +39,5 @@ typedef void (*bnep_connect_cb) (GIOChannel *chan, char *iface, int err,
 								void *data);
 int bnep_connect(int sk, uint16_t src, uint16_t dst, bnep_connect_cb conn_cb,
 								void *data);
+
+ssize_t bnep_send_ctrl_rsp(int sk, uint8_t type, uint8_t ctrl, uint16_t resp);
\ No newline at end of file
diff --git a/profiles/network/server.c b/profiles/network/server.c
index c777cc1..296ddd8 100644
--- a/profiles/network/server.c
+++ b/profiles/network/server.c
@@ -251,17 +251,6 @@ static sdp_record_t *server_record_new(const char *name, uint16_t id)
 	return record;
 }
 
-static ssize_t send_bnep_ctrl_rsp(int sk, uint16_t val)
-{
-	struct bnep_control_rsp rsp;
-
-	rsp.type = BNEP_CONTROL;
-	rsp.ctrl = BNEP_SETUP_CONN_RSP;
-	rsp.resp = htons(val);
-
-	return send(sk, &rsp, sizeof(rsp), 0);
-}
-
 static int server_connadd(struct network_server *ns,
 				struct network_session *session,
 				uint16_t dst_role)
@@ -462,7 +451,7 @@ static gboolean bnep_setup(GIOChannel *chan,
 	rsp = BNEP_SUCCESS;
 
 reply:
-	send_bnep_ctrl_rsp(sk, rsp);
+	bnep_send_ctrl_rsp(sk, BNEP_CONTROL, BNEP_SETUP_CONN_RSP, rsp);
 
 	return FALSE;
 }
-- 
1.8.3.2

--
To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux