diff options
author | Johan Hedberg <johan.hedberg@intel.com> | 2012-11-07 19:22:59 -0500 |
---|---|---|
committer | Gustavo Padovan <gustavo.padovan@collabora.co.uk> | 2012-11-18 20:03:00 -0500 |
commit | bbaf444a89dd7dd7effd8ed2f4e4ec64da3cc1da (patch) | |
tree | cc265122c83264b509353adad12d6dfe917f27c5 /net/bluetooth/mgmt.c | |
parent | 57527f8d4d71b5167a02fb6713857f55d3974748 (diff) |
Bluetooth: Use proper invalid value for tx_power
The core specification defines 127 as the "not available" value (well,
"reserved" for BR/EDR and "not available" for LE - but essentially the
same). Therefore, instead of testing for 0 (which is in fact a valid
value) we should be using this invalid value to test if the tx_power is
available.
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Acked-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Diffstat (limited to 'net/bluetooth/mgmt.c')
-rw-r--r-- | net/bluetooth/mgmt.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/net/bluetooth/mgmt.c b/net/bluetooth/mgmt.c index a1a62baaaafb..dedbb1d8b2d2 100644 --- a/net/bluetooth/mgmt.c +++ b/net/bluetooth/mgmt.c | |||
@@ -484,7 +484,7 @@ static void create_eir(struct hci_dev *hdev, u8 *data) | |||
484 | ptr += (name_len + 2); | 484 | ptr += (name_len + 2); |
485 | } | 485 | } |
486 | 486 | ||
487 | if (hdev->inq_tx_power) { | 487 | if (hdev->inq_tx_power != HCI_TX_POWER_INVALID) { |
488 | ptr[0] = 2; | 488 | ptr[0] = 2; |
489 | ptr[1] = EIR_TX_POWER; | 489 | ptr[1] = EIR_TX_POWER; |
490 | ptr[2] = (u8) hdev->inq_tx_power; | 490 | ptr[2] = (u8) hdev->inq_tx_power; |