diff options
author | Johan Hedberg <johan.hedberg@intel.com> | 2014-09-05 15:19:53 -0400 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2014-09-08 13:07:56 -0400 |
commit | 88d3a8acf33e8f4989a1032998eb819a89829573 (patch) | |
tree | 6de040ff096b0a2587a2c6f8a9c9445aba2bcc6a /net/bluetooth | |
parent | fc75cc8684d21d3649b28c4c37d4ce3f000759e4 (diff) |
Bluetooth: Add define for key distribution mask
This patch adds a define for the allowed bits of the key distribution
mask so we don't have to have magic 0x07 constants throughout the code.
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Diffstat (limited to 'net/bluetooth')
-rw-r--r-- | net/bluetooth/smp.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/net/bluetooth/smp.c b/net/bluetooth/smp.c index c71589f4b435..5003d224c4b6 100644 --- a/net/bluetooth/smp.c +++ b/net/bluetooth/smp.c | |||
@@ -34,6 +34,7 @@ | |||
34 | #define SMP_TIMEOUT msecs_to_jiffies(30000) | 34 | #define SMP_TIMEOUT msecs_to_jiffies(30000) |
35 | 35 | ||
36 | #define AUTH_REQ_MASK 0x07 | 36 | #define AUTH_REQ_MASK 0x07 |
37 | #define KEY_DIST_MASK 0x07 | ||
37 | 38 | ||
38 | enum { | 39 | enum { |
39 | SMP_FLAG_TK_VALID, | 40 | SMP_FLAG_TK_VALID, |
@@ -703,7 +704,7 @@ static void smp_distribute_keys(struct smp_chan *smp) | |||
703 | rsp = (void *) &smp->prsp[1]; | 704 | rsp = (void *) &smp->prsp[1]; |
704 | 705 | ||
705 | /* The responder sends its keys first */ | 706 | /* The responder sends its keys first */ |
706 | if (hcon->out && (smp->remote_key_dist & 0x07)) | 707 | if (hcon->out && (smp->remote_key_dist & KEY_DIST_MASK)) |
707 | return; | 708 | return; |
708 | 709 | ||
709 | req = (void *) &smp->preq[1]; | 710 | req = (void *) &smp->preq[1]; |
@@ -789,7 +790,7 @@ static void smp_distribute_keys(struct smp_chan *smp) | |||
789 | } | 790 | } |
790 | 791 | ||
791 | /* If there are still keys to be received wait for them */ | 792 | /* If there are still keys to be received wait for them */ |
792 | if ((smp->remote_key_dist & 0x07)) | 793 | if (smp->remote_key_dist & KEY_DIST_MASK) |
793 | return; | 794 | return; |
794 | 795 | ||
795 | set_bit(SMP_FLAG_COMPLETE, &smp->flags); | 796 | set_bit(SMP_FLAG_COMPLETE, &smp->flags); |