From: Vinicius Costa Gomes Date: Thu, 9 Jun 2011 21:50:52 +0000 (-0300) Subject: Bluetooth: Add support for building pairing commands X-Git-Tag: MMI-PSA29.97-13-9~18350^2~12^2~42^2~389^2~13 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=b8e66eacab21870d4f800822111c494f9ef291e3;p=GitHub%2FMotorolaMobilityLLC%2Fkernel-slsi.git 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 Signed-off-by: Gustavo F. Padovan --- 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) hci_send_acl(conn->hcon, skb, 0); } +static void build_pairing_cmd(struct l2cap_conn *conn, + struct smp_cmd_pairing *cmd, __u8 authreq) +{ + cmd->io_capability = conn->hcon->io_capability; + cmd->oob_flag = SMP_OOB_NOT_PRESENT; + cmd->max_key_size = 16; + cmd->init_key_dist = 0x00; + cmd->resp_key_dist = 0x00; + cmd->auth_req = authreq; +} + static void smp_cmd_pairing_req(struct l2cap_conn *conn, struct sk_buff *skb) { struct smp_cmd_pairing *rp = (void *) skb->data;