Bluetooth: Don't mask ECDH related events if CONFIG_BT_ECC disabled

It is related to b904ad387f.
This fixes checking ECDH related events in event mask.
If ECDH support is disabled in host, there is no need to check
if those are supported in the controller.

Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
This commit is contained in:
Mariusz Skamra 2018-11-22 09:41:10 +01:00 committed by Johan Hedberg
commit 474b2b3e94

View file

@ -3825,7 +3825,8 @@ static int le_set_event_mask(void)
* If "LE Read Local P-256 Public Key" and "LE Generate DH Key" are
* supported we need to enable events generated by those commands.
*/
if ((BT_CMD_TEST(bt_dev.supported_commands, 34, 1)) &&
if (IS_ENABLED(CONFIG_BT_ECC) &&
(BT_CMD_TEST(bt_dev.supported_commands, 34, 1)) &&
(BT_CMD_TEST(bt_dev.supported_commands, 34, 2))) {
mask |= BT_EVT_MASK_LE_P256_PUBLIC_KEY_COMPLETE;
mask |= BT_EVT_MASK_LE_GENERATE_DHKEY_COMPLETE;