diff options
author | Vinicius Costa Gomes <vinicius.gomes@openbossa.org> | 2011-06-09 17:50:52 -0400 |
---|---|---|
committer | Gustavo F. Padovan <padovan@profusion.mobi> | 2011-06-13 15:05:36 -0400 |
commit | b8e66eacab21870d4f800822111c494f9ef291e3 (patch) | |
tree | 315c5fb08b93f85d7d2ce79af912679af63a6974 | |
parent | 88167aed0d2e84364c8f0d9e48429c21fc7894c3 (diff) |
Bluetooth: Add support for building pairing commands
Before we are able to do a proper exchange of pairing parameters,
we need a unified way of building pairing requests and responses.
For IO Capability we use the value that was set by userspace,
using the management interface.
Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@openbossa.org>
Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
-rw-r--r-- | net/bluetooth/smp.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/net/bluetooth/smp.c b/net/bluetooth/smp.c index da46d76fc13d..d29700de5a44 100644 --- a/net/bluetooth/smp.c +++ b/net/bluetooth/smp.c | |||
@@ -181,6 +181,17 @@ static void smp_send_cmd(struct l2cap_conn *conn, u8 code, u16 len, void *data) | |||
181 | hci_send_acl(conn->hcon, skb, 0); | 181 | hci_send_acl(conn->hcon, skb, 0); |
182 | } | 182 | } |
183 | 183 | ||
184 | static void build_pairing_cmd(struct l2cap_conn *conn, | ||
185 | struct smp_cmd_pairing *cmd, __u8 authreq) | ||
186 | { | ||
187 | cmd->io_capability = conn->hcon->io_capability; | ||
188 | cmd->oob_flag = SMP_OOB_NOT_PRESENT; | ||
189 | cmd->max_key_size = 16; | ||
190 | cmd->init_key_dist = 0x00; | ||
191 | cmd->resp_key_dist = 0x00; | ||
192 | cmd->auth_req = authreq; | ||
193 | } | ||
194 | |||
184 | static void smp_cmd_pairing_req(struct l2cap_conn *conn, struct sk_buff *skb) | 195 | static void smp_cmd_pairing_req(struct l2cap_conn *conn, struct sk_buff *skb) |
185 | { | 196 | { |
186 | struct smp_cmd_pairing *rp = (void *) skb->data; | 197 | struct smp_cmd_pairing *rp = (void *) skb->data; |