From: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
To: linux-bluetooth@vger.kernel.org
Cc: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
Subject: [PATCH 02/10] bnep: Rename send ctrl_rsp and make it global
Date: Wed, 11 Dec 2013 12:13:37 +0200 [thread overview]
Message-ID: <1386756825-934-3-git-send-email-ravikumar.veeramally@linux.intel.com> (raw)
In-Reply-To: <1386756825-934-1-git-send-email-ravikumar.veeramally@linux.intel.com>
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
next prev parent reply other threads:[~2013-12-11 10:13 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-12-11 10:13 [PATCH 00/10] Refactoring bnep code to reduce redundancy Ravi kumar Veeramally
2013-12-11 10:13 ` [PATCH 01/10] bnep: Rename bnep_kill_connection to bnep_conndel Ravi kumar Veeramally
2013-12-11 10:13 ` Ravi kumar Veeramally [this message]
2013-12-11 10:13 ` [PATCH 03/10] bnep: Move bnep related calls to bnep.h|c Ravi kumar Veeramally
2013-12-11 10:13 ` [PATCH 04/10] profiles/network/server: Delete function which does nothing Ravi kumar Veeramally
2013-12-11 10:13 ` [PATCH 05/10] profiles/network: Move pan sdp record function bnep and make it global Ravi kumar Veeramally
2013-12-11 10:13 ` [PATCH 06/10] android/pan: Remove channel unref which causing disconnection Ravi kumar Veeramally
2013-12-11 10:13 ` [PATCH 07/10] android/pan: Fix missing cleanup calls Ravi kumar Veeramally
2013-12-11 10:13 ` [PATCH 08/10] android/pan: Fix minor white space Ravi kumar Veeramally
2013-12-11 10:13 ` [PATCH 09/10] android/pan: Free connected pan devices on profile unregister call Ravi kumar Veeramally
2013-12-11 10:13 ` [PATCH 10/10] android/pan: Add PAN NAP sdp record fo server role Ravi kumar Veeramally
2013-12-11 13:33 ` [PATCH 00/10] Refactoring bnep code to reduce redundancy 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=1386756825-934-3-git-send-email-ravikumar.veeramally@linux.intel.com \
--to=ravikumar.veeramally@linux.intel.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).