summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorVinicius Costa Gomes <vinicius.gomes@openbossa.org>2011-09-05 13:31:30 -0400
committerGustavo F. Padovan <padovan@profusion.mobi>2011-09-21 11:58:12 -0400
commit1c1def09c446aae441410b70e6439ffe44dee866 (patch)
tree037e722c234649ff21406cf9c3f3e79aaee2aa78 /include
parent142c69c6eaab26587264881bb71546e30aafdcee (diff)
Bluetooth: Move SMP fields to a separate structure
The objective is to make the core to have as little as possible information about SMP procedures and logic. Now, all the SMP specific information is hidden from the core. Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@openbossa.org> Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Diffstat (limited to 'include')
-rw-r--r--include/net/bluetooth/hci_core.h2
-rw-r--r--include/net/bluetooth/l2cap.h8
-rw-r--r--include/net/bluetooth/smp.h10
3 files changed, 11 insertions, 9 deletions
diff --git a/include/net/bluetooth/hci_core.h b/include/net/bluetooth/hci_core.h
index 4b17cd7fb164..ee1ee1bfae9e 100644
--- a/include/net/bluetooth/hci_core.h
+++ b/include/net/bluetooth/hci_core.h
@@ -195,8 +195,6 @@ struct hci_dev {
195 195
196 __u16 init_last_cmd; 196 __u16 init_last_cmd;
197 197
198 struct crypto_blkcipher *tfm;
199
200 struct inquiry_cache inq_cache; 198 struct inquiry_cache inq_cache;
201 struct hci_conn_hash conn_hash; 199 struct hci_conn_hash conn_hash;
202 struct list_head blacklist; 200 struct list_head blacklist;
diff --git a/include/net/bluetooth/l2cap.h b/include/net/bluetooth/l2cap.h
index 4f34ad25e75c..7f878b9d5642 100644
--- a/include/net/bluetooth/l2cap.h
+++ b/include/net/bluetooth/l2cap.h
@@ -409,14 +409,8 @@ struct l2cap_conn {
409 409
410 __u8 disc_reason; 410 __u8 disc_reason;
411 411
412 __u8 preq[7]; /* SMP Pairing Request */
413 __u8 prsp[7]; /* SMP Pairing Response */
414 __u8 prnd[16]; /* SMP Pairing Random */
415 __u8 pcnf[16]; /* SMP Pairing Confirm */
416 __u8 tk[16]; /* SMP Temporary Key */
417 __u8 smp_key_size;
418
419 struct timer_list security_timer; 412 struct timer_list security_timer;
413 struct smp_chan *smp_chan;
420 414
421 struct list_head chan_l; 415 struct list_head chan_l;
422 rwlock_t chan_lock; 416 rwlock_t chan_lock;
diff --git a/include/net/bluetooth/smp.h b/include/net/bluetooth/smp.h
index 46c457612300..a9ba72c1dc79 100644
--- a/include/net/bluetooth/smp.h
+++ b/include/net/bluetooth/smp.h
@@ -115,6 +115,16 @@ struct smp_cmd_security_req {
115#define SMP_MIN_ENC_KEY_SIZE 7 115#define SMP_MIN_ENC_KEY_SIZE 7
116#define SMP_MAX_ENC_KEY_SIZE 16 116#define SMP_MAX_ENC_KEY_SIZE 16
117 117
118struct smp_chan {
119 u8 preq[7]; /* SMP Pairing Request */
120 u8 prsp[7]; /* SMP Pairing Response */
121 u8 prnd[16]; /* SMP Pairing Random */
122 u8 pcnf[16]; /* SMP Pairing Confirm */
123 u8 tk[16]; /* SMP Temporary Key */
124 u8 smp_key_size;
125 struct crypto_blkcipher *tfm;
126};
127
118/* SMP Commands */ 128/* SMP Commands */
119int smp_conn_security(struct l2cap_conn *conn, __u8 sec_level); 129int smp_conn_security(struct l2cap_conn *conn, __u8 sec_level);
120int smp_sig_channel(struct l2cap_conn *conn, struct sk_buff *skb); 130int smp_sig_channel(struct l2cap_conn *conn, struct sk_buff *skb);