Skip to content

Commit d5ea32d

Browse files
dwinkler2holtmann
authored andcommitted
Bluetooth: Add MGMT capability flags for tx power and ext advertising
For new advertising features, it will be important for userspace to know the capabilities of the controller and kernel. If the controller and kernel support extended advertising, we include flags indicating hardware offloading support and support for setting tx power of adv instances. In the future, vendor-specific commands may allow the setting of tx power in advertising instances, but for now this feature is only marked available if extended advertising is supported. This change is manually verified in userspace by ensuring the advertising manager's supported_flags field is updated with new flags on hatch chromebook (ext advertising supported). Signed-off-by: Daniel Winkler <danielwinkler@google.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
1 parent 8759748 commit d5ea32d

2 files changed

Lines changed: 4 additions & 0 deletions

File tree

‎include/net/bluetooth/mgmt.h‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -572,6 +572,8 @@ struct mgmt_rp_add_advertising {
572572
#define MGMT_ADV_FLAG_SEC_1M BIT(7)
573573
#define MGMT_ADV_FLAG_SEC_2M BIT(8)
574574
#define MGMT_ADV_FLAG_SEC_CODED BIT(9)
575+
#define MGMT_ADV_FLAG_CAN_SET_TX_POWER BIT(10)
576+
#define MGMT_ADV_FLAG_HW_OFFLOAD BIT(11)
575577

576578
#define MGMT_ADV_FLAG_SEC_MASK (MGMT_ADV_FLAG_SEC_1M | MGMT_ADV_FLAG_SEC_2M | \
577579
MGMT_ADV_FLAG_SEC_CODED)

‎net/bluetooth/mgmt.c‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7206,6 +7206,8 @@ static u32 get_supported_adv_flags(struct hci_dev *hdev)
72067206

72077207
if (ext_adv_capable(hdev)) {
72087208
flags |= MGMT_ADV_FLAG_SEC_1M;
7209+
flags |= MGMT_ADV_FLAG_HW_OFFLOAD;
7210+
flags |= MGMT_ADV_FLAG_CAN_SET_TX_POWER;
72097211

72107212
if (hdev->le_features[1] & HCI_LE_PHY_2M)
72117213
flags |= MGMT_ADV_FLAG_SEC_2M;

0 commit comments

Comments
 (0)