@@ -1875,69 +1875,6 @@ void __hci_req_update_class(struct hci_request *req)
1875
1875
hci_req_add (req , HCI_OP_WRITE_CLASS_OF_DEV , sizeof (cod ), cod );
1876
1876
}
1877
1877
1878
- static void write_iac (struct hci_request * req )
1879
- {
1880
- struct hci_dev * hdev = req -> hdev ;
1881
- struct hci_cp_write_current_iac_lap cp ;
1882
-
1883
- if (!hci_dev_test_flag (hdev , HCI_DISCOVERABLE ))
1884
- return ;
1885
-
1886
- if (hci_dev_test_flag (hdev , HCI_LIMITED_DISCOVERABLE )) {
1887
- /* Limited discoverable mode */
1888
- cp .num_iac = min_t (u8 , hdev -> num_iac , 2 );
1889
- cp .iac_lap [0 ] = 0x00 ; /* LIAC */
1890
- cp .iac_lap [1 ] = 0x8b ;
1891
- cp .iac_lap [2 ] = 0x9e ;
1892
- cp .iac_lap [3 ] = 0x33 ; /* GIAC */
1893
- cp .iac_lap [4 ] = 0x8b ;
1894
- cp .iac_lap [5 ] = 0x9e ;
1895
- } else {
1896
- /* General discoverable mode */
1897
- cp .num_iac = 1 ;
1898
- cp .iac_lap [0 ] = 0x33 ; /* GIAC */
1899
- cp .iac_lap [1 ] = 0x8b ;
1900
- cp .iac_lap [2 ] = 0x9e ;
1901
- }
1902
-
1903
- hci_req_add (req , HCI_OP_WRITE_CURRENT_IAC_LAP ,
1904
- (cp .num_iac * 3 ) + 1 , & cp );
1905
- }
1906
-
1907
- static int discoverable_update (struct hci_request * req , unsigned long opt )
1908
- {
1909
- struct hci_dev * hdev = req -> hdev ;
1910
-
1911
- hci_dev_lock (hdev );
1912
-
1913
- if (hci_dev_test_flag (hdev , HCI_BREDR_ENABLED )) {
1914
- write_iac (req );
1915
- __hci_req_update_scan (req );
1916
- __hci_req_update_class (req );
1917
- }
1918
-
1919
- /* Advertising instances don't use the global discoverable setting, so
1920
- * only update AD if advertising was enabled using Set Advertising.
1921
- */
1922
- if (hci_dev_test_flag (hdev , HCI_ADVERTISING )) {
1923
- __hci_req_update_adv_data (req , 0x00 );
1924
-
1925
- /* Discoverable mode affects the local advertising
1926
- * address in limited privacy mode.
1927
- */
1928
- if (hci_dev_test_flag (hdev , HCI_LIMITED_PRIVACY )) {
1929
- if (ext_adv_capable (hdev ))
1930
- __hci_req_start_ext_adv (req , 0x00 );
1931
- else
1932
- __hci_req_enable_advertising (req );
1933
- }
1934
- }
1935
-
1936
- hci_dev_unlock (hdev );
1937
-
1938
- return 0 ;
1939
- }
1940
-
1941
1878
void __hci_abort_conn (struct hci_request * req , struct hci_conn * conn ,
1942
1879
u8 reason )
1943
1880
{
@@ -2307,33 +2244,8 @@ int hci_req_configure_datapath(struct hci_dev *hdev, struct bt_codec *codec)
2307
2244
return err ;
2308
2245
}
2309
2246
2310
- static void discov_off (struct work_struct * work )
2311
- {
2312
- struct hci_dev * hdev = container_of (work , struct hci_dev ,
2313
- discov_off .work );
2314
-
2315
- bt_dev_dbg (hdev , "" );
2316
-
2317
- hci_dev_lock (hdev );
2318
-
2319
- /* When discoverable timeout triggers, then just make sure
2320
- * the limited discoverable flag is cleared. Even in the case
2321
- * of a timeout triggered from general discoverable, it is
2322
- * safe to unconditionally clear the flag.
2323
- */
2324
- hci_dev_clear_flag (hdev , HCI_LIMITED_DISCOVERABLE );
2325
- hci_dev_clear_flag (hdev , HCI_DISCOVERABLE );
2326
- hdev -> discov_timeout = 0 ;
2327
-
2328
- hci_dev_unlock (hdev );
2329
-
2330
- hci_req_sync (hdev , discoverable_update , 0 , HCI_CMD_TIMEOUT , NULL );
2331
- mgmt_new_settings (hdev );
2332
- }
2333
-
2334
2247
void hci_request_setup (struct hci_dev * hdev )
2335
2248
{
2336
- INIT_DELAYED_WORK (& hdev -> discov_off , discov_off );
2337
2249
INIT_DELAYED_WORK (& hdev -> le_scan_disable , le_scan_disable_work );
2338
2250
INIT_DELAYED_WORK (& hdev -> le_scan_restart , le_scan_restart_work );
2339
2251
INIT_DELAYED_WORK (& hdev -> adv_instance_expire , adv_timeout_expire );
@@ -2344,7 +2256,6 @@ void hci_request_cancel_all(struct hci_dev *hdev)
2344
2256
{
2345
2257
__hci_cmd_sync_cancel (hdev , ENODEV );
2346
2258
2347
- cancel_delayed_work_sync (& hdev -> discov_off );
2348
2259
cancel_delayed_work_sync (& hdev -> le_scan_disable );
2349
2260
cancel_delayed_work_sync (& hdev -> le_scan_restart );
2350
2261
0 commit comments