Skip to content

Commit 628531c

Browse files
ge0rgholtmann
authored andcommitted
Bluetooth: Provide defaults for LE advertising interval
Store the default values for minimum and maximum advertising interval with all the other controller defaults. These vaules are sent to the adapter whenever advertising is (re)enabled. Signed-off-by: Georg Lukas <[email protected]> Signed-off-by: Marcel Holtmann <[email protected]>
1 parent 66d8e83 commit 628531c

File tree

3 files changed

+6
-2
lines changed

3 files changed

+6
-2
lines changed

include/net/bluetooth/hci_core.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,8 @@ struct hci_dev {
203203
__u16 page_scan_window;
204204
__u8 page_scan_type;
205205
__u8 le_adv_channel_map;
206+
__u16 le_adv_min_interval;
207+
__u16 le_adv_max_interval;
206208
__u8 le_scan_type;
207209
__u16 le_scan_interval;
208210
__u16 le_scan_window;

net/bluetooth/hci_core.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3923,6 +3923,8 @@ struct hci_dev *hci_alloc_dev(void)
39233923
hdev->sniff_min_interval = 80;
39243924

39253925
hdev->le_adv_channel_map = 0x07;
3926+
hdev->le_adv_min_interval = 0x0800;
3927+
hdev->le_adv_max_interval = 0x0800;
39263928
hdev->le_scan_interval = 0x0060;
39273929
hdev->le_scan_window = 0x0030;
39283930
hdev->le_conn_min_interval = 0x0028;

net/bluetooth/mgmt.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1086,8 +1086,8 @@ static void enable_advertising(struct hci_request *req)
10861086
return;
10871087

10881088
memset(&cp, 0, sizeof(cp));
1089-
cp.min_interval = cpu_to_le16(0x0800);
1090-
cp.max_interval = cpu_to_le16(0x0800);
1089+
cp.min_interval = cpu_to_le16(hdev->le_adv_min_interval);
1090+
cp.max_interval = cpu_to_le16(hdev->le_adv_max_interval);
10911091
cp.type = connectable ? LE_ADV_IND : LE_ADV_NONCONN_IND;
10921092
cp.own_address_type = own_addr_type;
10931093
cp.channel_map = hdev->le_adv_channel_map;

0 commit comments

Comments
 (0)