mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-27 09:02:06 +00:00
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>
This commit is contained in:
parent
fc75cc8684
commit
88d3a8acf3
1 changed files with 3 additions and 2 deletions
|
@ -34,6 +34,7 @@
|
||||||
#define SMP_TIMEOUT msecs_to_jiffies(30000)
|
#define SMP_TIMEOUT msecs_to_jiffies(30000)
|
||||||
|
|
||||||
#define AUTH_REQ_MASK 0x07
|
#define AUTH_REQ_MASK 0x07
|
||||||
|
#define KEY_DIST_MASK 0x07
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
SMP_FLAG_TK_VALID,
|
SMP_FLAG_TK_VALID,
|
||||||
|
@ -703,7 +704,7 @@ static void smp_distribute_keys(struct smp_chan *smp)
|
||||||
rsp = (void *) &smp->prsp[1];
|
rsp = (void *) &smp->prsp[1];
|
||||||
|
|
||||||
/* The responder sends its keys first */
|
/* The responder sends its keys first */
|
||||||
if (hcon->out && (smp->remote_key_dist & 0x07))
|
if (hcon->out && (smp->remote_key_dist & KEY_DIST_MASK))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
req = (void *) &smp->preq[1];
|
req = (void *) &smp->preq[1];
|
||||||
|
@ -789,7 +790,7 @@ static void smp_distribute_keys(struct smp_chan *smp)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* If there are still keys to be received wait for them */
|
/* If there are still keys to be received wait for them */
|
||||||
if ((smp->remote_key_dist & 0x07))
|
if (smp->remote_key_dist & KEY_DIST_MASK)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
set_bit(SMP_FLAG_COMPLETE, &smp->flags);
|
set_bit(SMP_FLAG_COMPLETE, &smp->flags);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue