Loading system/btif/src/bluetooth.cc +0 −10 Original line number Diff line number Diff line Loading @@ -428,13 +428,6 @@ static bool is_profile(const char* p1, const char* p2) { * ****************************************************************************/ #ifdef TARGET_FLOSS static int global_hci_adapter = 0; static int set_adapter_index(int adapter) { global_hci_adapter = adapter; } int GetAdapterIndex() { return global_hci_adapter; } #endif static int init(bt_callbacks_t* callbacks, bool start_restricted, bool is_common_criteria_mode, int config_compare_result, const char** init_flags, bool is_atv, const char* user_data_directory) { Loading Loading @@ -1233,9 +1226,6 @@ static void interop_database_add_remove_name(bool do_add, const char* feature_na EXPORT_SYMBOL bt_interface_t bluetoothInterface = { sizeof(bluetoothInterface), #ifdef TARGET_FLOSS .set_adapter_index = set_adapter_index, #endif .init = init, .enable = enable, .disable = disable, Loading system/gd/common/init_flags.h +2 −0 Original line number Diff line number Diff line Loading @@ -31,6 +31,8 @@ public: } init_flags::load(std::move(rusted_flags)); } inline static int GetAdapterIndex() { return init_flags::get_hci_adapter(); } }; } // namespace common Loading system/gd/hal/hci_hal_host.cc +2 −3 Original line number Diff line number Diff line Loading @@ -31,6 +31,7 @@ #include <utility> #include <vector> #include "common/init_flags.h" #include "hal/hci_hal.h" #include "hal/link_clocker.h" #include "hal/mgmt.h" Loading @@ -40,8 +41,6 @@ #include "os/reactor.h" #include "os/thread.h" extern int GetAdapterIndex(); namespace { constexpr int INVALID_FD = -1; Loading Loading @@ -207,7 +206,7 @@ int ConnectToSocket() { } // Determine which hci index we should connect to. int hci_interface = GetAdapterIndex(); int hci_interface = bluetooth::common::InitFlags::GetAdapterIndex(); if (waitHciDev(hci_interface) != 0) { ::close(socket_fd); Loading system/gd/hal/mgmt.cc +2 −3 Original line number Diff line number Diff line Loading @@ -30,10 +30,9 @@ #include <cerrno> #include "common/init_flags.h" #include "os/log.h" extern int GetAdapterIndex(); namespace bluetooth { namespace hal { Loading Loading @@ -83,7 +82,7 @@ static int btsocket_open_mgmt(uint16_t hci) { * be HCI_OP_NOP (0x0000). */ uint16_t Mgmt::get_vs_opcode(uint16_t vendor_specification) { int hci = GetAdapterIndex(); int hci = bluetooth::common::InitFlags::GetAdapterIndex(); int fd = btsocket_open_mgmt(hci); uint16_t ret_opcode = HCI_OP_NOP; Loading system/gd/metrics/chromeos/metrics_event.cc +3 −4 Original line number Diff line number Diff line Loading @@ -25,6 +25,7 @@ #include <map> #include <utility> #include "common/init_flags.h" #include "hci/hci_packets.h" #include "include/hardware/bluetooth.h" #include "include/hardware/bt_av.h" Loading @@ -32,8 +33,6 @@ #include "include/hardware/bt_hh.h" #include "stack/include/hci_error_code.h" extern int GetAdapterIndex(); namespace bluetooth { namespace metrics { Loading Loading @@ -674,7 +673,7 @@ static int64_t GetChipsetInfoId(const char* path, const char* file) { static std::string GetChipsetInfoModuleName() { std::string module; int adapter_index = GetAdapterIndex(); int adapter_index = bluetooth::common::InitFlags::GetAdapterIndex(); std::string path = base::StringPrintf(kChipsetInfoModaliasPath, adapter_index); if (base::ReadFileToString(base::FilePath(path), &module)) { Loading @@ -687,7 +686,7 @@ static MetricTransportType GetChipsetInfoTransport(void) { MetricTransportType transport = MetricTransportType::TRANSPORT_TYPE_UNKNOWN; base::FilePath module_realpath; std::string module_name; int adapter_index = GetAdapterIndex(); int adapter_index = bluetooth::common::InitFlags::GetAdapterIndex(); std::string path = base::StringPrintf(kChipInfoModuleDirPath, adapter_index); // examples of module_realpath: /sys/module/btusb and /sys/module/hci_uart Loading Loading
system/btif/src/bluetooth.cc +0 −10 Original line number Diff line number Diff line Loading @@ -428,13 +428,6 @@ static bool is_profile(const char* p1, const char* p2) { * ****************************************************************************/ #ifdef TARGET_FLOSS static int global_hci_adapter = 0; static int set_adapter_index(int adapter) { global_hci_adapter = adapter; } int GetAdapterIndex() { return global_hci_adapter; } #endif static int init(bt_callbacks_t* callbacks, bool start_restricted, bool is_common_criteria_mode, int config_compare_result, const char** init_flags, bool is_atv, const char* user_data_directory) { Loading Loading @@ -1233,9 +1226,6 @@ static void interop_database_add_remove_name(bool do_add, const char* feature_na EXPORT_SYMBOL bt_interface_t bluetoothInterface = { sizeof(bluetoothInterface), #ifdef TARGET_FLOSS .set_adapter_index = set_adapter_index, #endif .init = init, .enable = enable, .disable = disable, Loading
system/gd/common/init_flags.h +2 −0 Original line number Diff line number Diff line Loading @@ -31,6 +31,8 @@ public: } init_flags::load(std::move(rusted_flags)); } inline static int GetAdapterIndex() { return init_flags::get_hci_adapter(); } }; } // namespace common Loading
system/gd/hal/hci_hal_host.cc +2 −3 Original line number Diff line number Diff line Loading @@ -31,6 +31,7 @@ #include <utility> #include <vector> #include "common/init_flags.h" #include "hal/hci_hal.h" #include "hal/link_clocker.h" #include "hal/mgmt.h" Loading @@ -40,8 +41,6 @@ #include "os/reactor.h" #include "os/thread.h" extern int GetAdapterIndex(); namespace { constexpr int INVALID_FD = -1; Loading Loading @@ -207,7 +206,7 @@ int ConnectToSocket() { } // Determine which hci index we should connect to. int hci_interface = GetAdapterIndex(); int hci_interface = bluetooth::common::InitFlags::GetAdapterIndex(); if (waitHciDev(hci_interface) != 0) { ::close(socket_fd); Loading
system/gd/hal/mgmt.cc +2 −3 Original line number Diff line number Diff line Loading @@ -30,10 +30,9 @@ #include <cerrno> #include "common/init_flags.h" #include "os/log.h" extern int GetAdapterIndex(); namespace bluetooth { namespace hal { Loading Loading @@ -83,7 +82,7 @@ static int btsocket_open_mgmt(uint16_t hci) { * be HCI_OP_NOP (0x0000). */ uint16_t Mgmt::get_vs_opcode(uint16_t vendor_specification) { int hci = GetAdapterIndex(); int hci = bluetooth::common::InitFlags::GetAdapterIndex(); int fd = btsocket_open_mgmt(hci); uint16_t ret_opcode = HCI_OP_NOP; Loading
system/gd/metrics/chromeos/metrics_event.cc +3 −4 Original line number Diff line number Diff line Loading @@ -25,6 +25,7 @@ #include <map> #include <utility> #include "common/init_flags.h" #include "hci/hci_packets.h" #include "include/hardware/bluetooth.h" #include "include/hardware/bt_av.h" Loading @@ -32,8 +33,6 @@ #include "include/hardware/bt_hh.h" #include "stack/include/hci_error_code.h" extern int GetAdapterIndex(); namespace bluetooth { namespace metrics { Loading Loading @@ -674,7 +673,7 @@ static int64_t GetChipsetInfoId(const char* path, const char* file) { static std::string GetChipsetInfoModuleName() { std::string module; int adapter_index = GetAdapterIndex(); int adapter_index = bluetooth::common::InitFlags::GetAdapterIndex(); std::string path = base::StringPrintf(kChipsetInfoModaliasPath, adapter_index); if (base::ReadFileToString(base::FilePath(path), &module)) { Loading @@ -687,7 +686,7 @@ static MetricTransportType GetChipsetInfoTransport(void) { MetricTransportType transport = MetricTransportType::TRANSPORT_TYPE_UNKNOWN; base::FilePath module_realpath; std::string module_name; int adapter_index = GetAdapterIndex(); int adapter_index = bluetooth::common::InitFlags::GetAdapterIndex(); std::string path = base::StringPrintf(kChipInfoModuleDirPath, adapter_index); // examples of module_realpath: /sys/module/btusb and /sys/module/hci_uart Loading