Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Bluetooth: mgmt: Add idle_timeout to configurable system parameters

While the configurable system parameters allow controlling the SNIFF
mode parameters, they do not include the idle_timeout parameter
responsible for enabling SNIFF mode.

Add the idle_timeout parameter to allow controlling the idle timeout
of BR/EDR connections.

Signed-off-by: Stefan Sørensen <ssorensen@roku.com>
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>

authored by

Stefan Sørensen and committed by
Luiz Augusto von Dentz
48fea7d4 4bb09101

+21
+21
net/bluetooth/mgmt_config.c
··· 11 11 #include "mgmt_util.h" 12 12 #include "mgmt_config.h" 13 13 14 + #define HDEV_PARAM_U32(_param_name_) \ 15 + struct {\ 16 + struct mgmt_tlv_hdr entry; \ 17 + __le32 value; \ 18 + } __packed _param_name_ 19 + 14 20 #define HDEV_PARAM_U16(_param_name_) \ 15 21 struct {\ 16 22 struct mgmt_tlv_hdr entry; \ ··· 33 27 { \ 34 28 { cpu_to_le16(_param_code_), sizeof(__u16) }, \ 35 29 cpu_to_le16(hdev->_param_name_) \ 30 + } 31 + 32 + #define TLV_SET_U32(_param_code_, _param_name_) \ 33 + { \ 34 + { cpu_to_le16(_param_code_), sizeof(__u32) }, \ 35 + cpu_to_le32(hdev->_param_name_) \ 36 36 } 37 37 38 38 #define TLV_SET_U8(_param_code_, _param_name_) \ ··· 90 78 HDEV_PARAM_U16(advmon_allowlist_duration); 91 79 HDEV_PARAM_U16(advmon_no_filter_duration); 92 80 HDEV_PARAM_U8(enable_advmon_interleave_scan); 81 + HDEV_PARAM_U32(idle_timeout); 93 82 } __packed rp = { 94 83 TLV_SET_U16(0x0000, def_page_scan_type), 95 84 TLV_SET_U16(0x0001, def_page_scan_int), ··· 124 111 TLV_SET_U16(0x001d, advmon_allowlist_duration), 125 112 TLV_SET_U16(0x001e, advmon_no_filter_duration), 126 113 TLV_SET_U8(0x001f, enable_advmon_interleave_scan), 114 + TLV_SET_U32(0x0020, idle_timeout), 127 115 }; 128 116 129 117 bt_dev_dbg(hdev, "sock %p", sk); ··· 136 122 } 137 123 138 124 #define TO_TLV(x) ((struct mgmt_tlv *)(x)) 125 + #define TLV_GET_LE32(tlv) le32_to_cpu(*((__le32 *)(TO_TLV(tlv)->value))) 139 126 #define TLV_GET_LE16(tlv) le16_to_cpu(*((__le16 *)(TO_TLV(tlv)->value))) 140 127 #define TLV_GET_U8(tlv) (*((__u8 *)(TO_TLV(tlv)->value))) 141 128 ··· 205 190 break; 206 191 case 0x001f: 207 192 exp_type_len = sizeof(u8); 193 + break; 194 + case 0x0020: 195 + exp_type_len = sizeof(u32); 208 196 break; 209 197 default: 210 198 exp_type_len = 0; ··· 331 313 break; 332 314 case 0x0001f: 333 315 hdev->enable_advmon_interleave_scan = TLV_GET_U8(buffer); 316 + break; 317 + case 0x00020: 318 + hdev->idle_timeout = TLV_GET_LE32(buffer); 334 319 break; 335 320 default: 336 321 bt_dev_warn(hdev, "unsupported parameter %u", type);