Bluetooth: Make SMP context private to smp.c
authorJohan Hedberg <johan.hedberg@intel.com>
Tue, 20 May 2014 06:45:47 +0000 (09:45 +0300)
committerMarcel Holtmann <marcel@holtmann.org>
Tue, 20 May 2014 15:44:11 +0000 (08:44 -0700)
There are no users of the smp_chan struct outside of smp.c so move it
away from smp.h. The addition of the l2cap.h include to hci_core.c,
hci_conn.c and mgmt.c is something that should have been there already
previously to avoid warnings of undeclared struct l2cap_conn, but the
compiler warning was apparently shadowed away by the mention of
l2cap_conn in the struct smp_chan definition.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
net/bluetooth/hci_conn.c
net/bluetooth/hci_core.c
net/bluetooth/mgmt.c
net/bluetooth/smp.c
net/bluetooth/smp.h

index a987e7def025f69bf56b19817b954ec4e455284c..1bb8900086ddb2489970f25d0c03a384aaed4982 100644 (file)
@@ -28,6 +28,7 @@
 
 #include <net/bluetooth/bluetooth.h>
 #include <net/bluetooth/hci_core.h>
+#include <net/bluetooth/l2cap.h>
 
 #include "smp.h"
 #include "a2mp.h"
index 313bd1c164d6c0f21f74e61557921af42c9963ba..0a43cce9a914b84613c7ee2d6fc30fdfdb2a0bc5 100644 (file)
@@ -34,6 +34,7 @@
 
 #include <net/bluetooth/bluetooth.h>
 #include <net/bluetooth/hci_core.h>
+#include <net/bluetooth/l2cap.h>
 
 #include "smp.h"
 
index 370cd42f488be7f71ba610123a83066a36cc56e1..f8ca69dd1984ec6de30e7c7357cf26e6907af1e8 100644 (file)
@@ -29,6 +29,7 @@
 
 #include <net/bluetooth/bluetooth.h>
 #include <net/bluetooth/hci_core.h>
+#include <net/bluetooth/l2cap.h>
 #include <net/bluetooth/mgmt.h>
 
 #include "smp.h"
index b5b926399e76e95fdebf74ff30988b7d38b4c4c5..df91ed28084f1f04f4d68b24566748911e856fda 100644 (file)
 
 #define AUTH_REQ_MASK   0x07
 
+#define SMP_FLAG_TK_VALID      1
+#define SMP_FLAG_CFM_PENDING   2
+#define SMP_FLAG_MITM_AUTH     3
+#define SMP_FLAG_COMPLETE      4
+#define SMP_FLAG_INITIATOR     5
+
+struct smp_chan {
+       struct l2cap_conn *conn;
+       u8              preq[7]; /* SMP Pairing Request */
+       u8              prsp[7]; /* SMP Pairing Response */
+       u8              prnd[16]; /* SMP Pairing Random (local) */
+       u8              rrnd[16]; /* SMP Pairing Random (remote) */
+       u8              pcnf[16]; /* SMP Pairing Confirm */
+       u8              tk[16]; /* SMP Temporary Key */
+       u8              enc_key_size;
+       u8              remote_key_dist;
+       bdaddr_t        id_addr;
+       u8              id_addr_type;
+       u8              irk[16];
+       struct smp_csrk *csrk;
+       struct smp_csrk *slave_csrk;
+       struct smp_ltk  *ltk;
+       struct smp_ltk  *slave_ltk;
+       struct smp_irk  *remote_irk;
+       unsigned long   smp_flags;
+       struct work_struct confirm;
+       struct work_struct random;
+};
+
 static inline void swap128(const u8 src[16], u8 dst[16])
 {
        int i;
index afd16231db137295385c1682fad05ec25f647181..5a8dc36460a1b7e3a61b08d18407708673a7d1a5 100644 (file)
@@ -116,35 +116,6 @@ struct smp_cmd_security_req {
 #define SMP_MIN_ENC_KEY_SIZE           7
 #define SMP_MAX_ENC_KEY_SIZE           16
 
-#define SMP_FLAG_TK_VALID      1
-#define SMP_FLAG_CFM_PENDING   2
-#define SMP_FLAG_MITM_AUTH     3
-#define SMP_FLAG_COMPLETE      4
-#define SMP_FLAG_INITIATOR     5
-
-struct smp_chan {
-       struct l2cap_conn *conn;
-       u8              preq[7]; /* SMP Pairing Request */
-       u8              prsp[7]; /* SMP Pairing Response */
-       u8              prnd[16]; /* SMP Pairing Random (local) */
-       u8              rrnd[16]; /* SMP Pairing Random (remote) */
-       u8              pcnf[16]; /* SMP Pairing Confirm */
-       u8              tk[16]; /* SMP Temporary Key */
-       u8              enc_key_size;
-       u8              remote_key_dist;
-       bdaddr_t        id_addr;
-       u8              id_addr_type;
-       u8              irk[16];
-       struct smp_csrk *csrk;
-       struct smp_csrk *slave_csrk;
-       struct smp_ltk  *ltk;
-       struct smp_ltk  *slave_ltk;
-       struct smp_irk  *remote_irk;
-       unsigned long   smp_flags;
-       struct work_struct confirm;
-       struct work_struct random;
-};
-
 /* SMP Commands */
 bool smp_sufficient_security(struct hci_conn *hcon, u8 sec_level);
 int smp_conn_security(struct hci_conn *hcon, __u8 sec_level);