summaryrefslogtreecommitdiff
path: root/emulator/usbpt
diff options
context:
space:
mode:
Diffstat (limited to 'emulator/usbpt')
-rw-r--r--emulator/usbpt/BoardConfig.mk3
-rw-r--r--emulator/usbpt/bluetooth/bluetooth.mk2
-rw-r--r--emulator/usbpt/bluetooth/bluetooth.prop20
-rw-r--r--emulator/usbpt/bluetooth/btusb/BoardConfig.mk10
-rw-r--r--emulator/usbpt/bluetooth/btusb/hal/bdroid_buildcfg.h9
-rw-r--r--emulator/usbpt/bluetooth/btusb/init.btusb.rc14
-rw-r--r--emulator/usbpt/bluetooth/modules.blocklist2
-rw-r--r--emulator/usbpt/bluetooth/usb_modeswitch/usb_modeswitch.c4
-rw-r--r--emulator/usbpt/car_usbpt.mk4
-rw-r--r--emulator/usbpt/modules.blocklist10
-rw-r--r--emulator/usbpt/protocan/manifest.protocan.xml4
-rw-r--r--emulator/usbpt/protocan/protocan.mk8
-rw-r--r--emulator/usbpt/protocan/protocanbus/sepolicy/dumpstate.te2
-rw-r--r--emulator/usbpt/protocan/protocanbus/sepolicy/service.te2
-rw-r--r--emulator/usbpt/usbip-service/TEST_MAPPING2
-rw-r--r--emulator/usbpt/wifi/BoardConfig.mk14
-rw-r--r--emulator/usbpt/wifi/init.wifiusb.rc19
-rw-r--r--emulator/usbpt/wifi/wifi.mk17
18 files changed, 112 insertions, 34 deletions
diff --git a/emulator/usbpt/BoardConfig.mk b/emulator/usbpt/BoardConfig.mk
index ea43a0b..9352b25 100644
--- a/emulator/usbpt/BoardConfig.mk
+++ b/emulator/usbpt/BoardConfig.mk
@@ -13,4 +13,5 @@
# limitations under the License.
#
-include device/generic/car/emulator/usbpt/bluetooth/BoardConfig.mk
+#include device/generic/car/emulator/usbpt/bluetooth/BoardConfig.mk
+#include device/generic/car/emulator/usbpt/wifi/BoardConfig.mk
diff --git a/emulator/usbpt/bluetooth/bluetooth.mk b/emulator/usbpt/bluetooth/bluetooth.mk
index 935097f..599d455 100644
--- a/emulator/usbpt/bluetooth/bluetooth.mk
+++ b/emulator/usbpt/bluetooth/bluetooth.mk
@@ -18,10 +18,10 @@
PRODUCT_PACKAGES += \
android.hardware.bluetooth@1.1-service.btlinux \
+ android.hardware.bluetooth.audio@2.2-impl \
PRODUCT_COPY_FILES += \
device/generic/car/emulator/usbpt/bluetooth/vendor.qemu.preferred.bt.service.rc:$(TARGET_COPY_OUT_VENDOR)/etc/init/vendor.qemu.preferred.bt.service.rc \
- device/generic/car/emulator/usbpt/bluetooth/modules.blocklist:$(TARGET_COPY_OUT_VENDOR_RAMDISK)/lib/modules/modules.blocklist \
PRODUCT_SYSTEM_PROPERTIES += \
persist.bluetooth.enablenewavrcp=false \
diff --git a/emulator/usbpt/bluetooth/bluetooth.prop b/emulator/usbpt/bluetooth/bluetooth.prop
new file mode 100644
index 0000000..fdd00c0
--- /dev/null
+++ b/emulator/usbpt/bluetooth/bluetooth.prop
@@ -0,0 +1,20 @@
+# The default Bluetooth Class of Device
+# Service Field: 0x26 -> 38
+# - Bit 17: Networking
+# - Bit 18: Rendering
+# - Bit 21: Audio
+# Major Class: 0x04 -> 4 (Audio / Video)
+# Minor Class: 0x08 -> 8 (Car Audio)
+bluetooth.device.class_of_device=38,4,8
+bluetooth.device.default_name=gCar Emulator
+
+# The Bluetooth profiles that cars expect to have enabled. All other profiles
+# are disabled by default.
+bluetooth.profile.a2dp.sink.enabled=true
+bluetooth.profile.avrcp.controller.enabled=true
+bluetooth.profile.gatt.enabled=true
+bluetooth.profile.hfp.hf.enabled=true
+bluetooth.profile.map.client.enabled=true
+bluetooth.profile.pan.nap.enabled=true
+bluetooth.profile.pan.panu.enabled=true
+bluetooth.profile.pbap.client.enabled=true
diff --git a/emulator/usbpt/bluetooth/btusb/BoardConfig.mk b/emulator/usbpt/bluetooth/btusb/BoardConfig.mk
index 7011ee7..2a13328 100644
--- a/emulator/usbpt/bluetooth/btusb/BoardConfig.mk
+++ b/emulator/usbpt/bluetooth/btusb/BoardConfig.mk
@@ -12,13 +12,3 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
-
-BOARD_BLUETOOTH_BDROID_BUILDCFG_INCLUDE_DIR := device/generic/car/emulator/usbpt/bluetooth/btusb/hal
-
-TARGET_KERNEL_USE ?= 5.10
-
-ifeq ($(TARGET_ARCH),x86_64)
-BOARD_VENDOR_KERNEL_MODULES += kernel/prebuilts/common-modules/virtual-device/$(TARGET_KERNEL_USE)/x86-64/btusb.ko
-else ifeq ($(TARGET_ARCH),arm64)
-BOARD_VENDOR_KERNEL_MODULES += kernel/prebuilts/common-modules/virtual-device/$(TARGET_KERNEL_USE)/arm64/btusb.ko
-endif
diff --git a/emulator/usbpt/bluetooth/btusb/hal/bdroid_buildcfg.h b/emulator/usbpt/bluetooth/btusb/hal/bdroid_buildcfg.h
deleted file mode 100644
index 132b683..0000000
--- a/emulator/usbpt/bluetooth/btusb/hal/bdroid_buildcfg.h
+++ /dev/null
@@ -1,9 +0,0 @@
-#ifndef _BDROID_BUILDCFG_H
-#define _BDROID_BUILDCFG_H
-#define BTM_DEF_LOCAL_NAME "gCar Emulator"
-#define BTA_AV_SINK_INCLUDED TRUE
-/* Handsfree device */
-#define BTA_DM_COD {0x26, 0x04, 0x08}
-/* Workaround for error at connection. */
-#define BT_CLEAN_TURN_ON_DISABLED 1
-#endif
diff --git a/emulator/usbpt/bluetooth/btusb/init.btusb.rc b/emulator/usbpt/bluetooth/btusb/init.btusb.rc
index 4603f83..55b5160 100644
--- a/emulator/usbpt/bluetooth/btusb/init.btusb.rc
+++ b/emulator/usbpt/bluetooth/btusb/init.btusb.rc
@@ -1,3 +1,17 @@
+# Copyright (C) 2022 The Android Open-Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
on early-init
write /sys/module/firmware_class/parameters/path /vendor/firmware/
diff --git a/emulator/usbpt/bluetooth/modules.blocklist b/emulator/usbpt/bluetooth/modules.blocklist
deleted file mode 100644
index 5816cd8..0000000
--- a/emulator/usbpt/bluetooth/modules.blocklist
+++ /dev/null
@@ -1,2 +0,0 @@
-# List of sub-device specific modules to not load automatically
-blocklist btusb.ko
diff --git a/emulator/usbpt/bluetooth/usb_modeswitch/usb_modeswitch.c b/emulator/usbpt/bluetooth/usb_modeswitch/usb_modeswitch.c
index 3b7c48b..9b092ee 100644
--- a/emulator/usbpt/bluetooth/usb_modeswitch/usb_modeswitch.c
+++ b/emulator/usbpt/bluetooth/usb_modeswitch/usb_modeswitch.c
@@ -1707,13 +1707,13 @@ struct libusb_device* search_devices( int *numFound, int vendor, char* productLi
if (!vendor || *productList == '\0')
return NULL;
- listcopy = malloc(strlen(productList)+1);
-
if (libusb_get_device_list(ctx, &devs) < 0) {
perror("Libusb failed to get USB access!");
return 0;
}
+ listcopy = malloc(strlen(productList)+1);
+
while ((dev = devs[i++]) != NULL) {
struct libusb_device_descriptor descriptor;
libusb_get_device_descriptor(dev, &descriptor);
diff --git a/emulator/usbpt/car_usbpt.mk b/emulator/usbpt/car_usbpt.mk
index 922c5b3..e0e24bc 100644
--- a/emulator/usbpt/car_usbpt.mk
+++ b/emulator/usbpt/car_usbpt.mk
@@ -16,7 +16,9 @@
$(call inherit-product, device/generic/car/emulator/usbpt/bluetooth/bluetooth.mk)
$(call inherit-product, device/generic/car/emulator/usbpt/protocan/protocan.mk)
$(call inherit-product, device/generic/car/emulator/usbpt/usbip-service/usbip-service.mk)
+$(call inherit-product, device/generic/car/emulator/usbpt/wifi/wifi.mk)
# Required for USB passthrough
PRODUCT_COPY_FILES += \
- frameworks/native/data/etc/android.hardware.usb.host.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.usb.host.xml
+ frameworks/native/data/etc/android.hardware.usb.host.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.usb.host.xml \
+ device/generic/car/emulator/usbpt/modules.blocklist:$(TARGET_COPY_OUT_VENDOR_RAMDISK)/lib/modules/modules.blocklist \
diff --git a/emulator/usbpt/modules.blocklist b/emulator/usbpt/modules.blocklist
new file mode 100644
index 0000000..34559e0
--- /dev/null
+++ b/emulator/usbpt/modules.blocklist
@@ -0,0 +1,10 @@
+# List of sub-device specific modules to not load automatically
+blocklist btusb.ko
+blocklist mt76x2u.ko
+blocklist mt76x2_common.ko
+blocklist mt76x0u.ko
+blocklist mt76x02_usb.ko
+blocklist mt76x0_common.ko
+blocklist mt76x02_lib.ko
+blocklist mt76_usb.ko
+blocklist mt76.ko
diff --git a/emulator/usbpt/protocan/manifest.protocan.xml b/emulator/usbpt/protocan/manifest.protocan.xml
index f23cbf9..7227a48 100644
--- a/emulator/usbpt/protocan/manifest.protocan.xml
+++ b/emulator/usbpt/protocan/manifest.protocan.xml
@@ -5,10 +5,6 @@
<impl level="generic"></impl>
<version>1.0</version>
<interface>
- <name>ICanController</name>
- <instance>socketcan</instance>
- </interface>
- <interface>
<name>ICanBus</name>
<instance>BCAN</instance>
<instance>CCAN</instance>
diff --git a/emulator/usbpt/protocan/protocan.mk b/emulator/usbpt/protocan/protocan.mk
index 4f02d52..4f54992 100644
--- a/emulator/usbpt/protocan/protocan.mk
+++ b/emulator/usbpt/protocan/protocan.mk
@@ -17,8 +17,12 @@
# CAN bus HAL
PRODUCT_PACKAGES += android.hardware.automotive.can@1.0-service
PRODUCT_PACKAGES += canhalconfigurator
-PRODUCT_COPY_FILES += device/generic/car/emulator/usbpt/protocan/canbus_config.pb:system/etc/canbus_config.pb
-PRODUCT_PACKAGES_DEBUG += canhalctrl \
+PRODUCT_COPY_FILES += device/generic/car/emulator/usbpt/protocan/canbus_config.pb:$(TARGET_COPY_OUT_VENDOR)/etc/canbus_config.pb
+
+# TODO(b/259994014): Remove CAN packages from here after AAOS baseline is
+# applied to all car emulators
+PRODUCT_PACKAGES_DEBUG += \
+ canhalctrl \
canhaldump \
canhalsend
diff --git a/emulator/usbpt/protocan/protocanbus/sepolicy/dumpstate.te b/emulator/usbpt/protocan/protocanbus/sepolicy/dumpstate.te
new file mode 100644
index 0000000..b43e786
--- /dev/null
+++ b/emulator/usbpt/protocan/protocanbus/sepolicy/dumpstate.te
@@ -0,0 +1,2 @@
+# Allow dumpstate to make binder calls to hal_vehiclebus_default
+binder_call(dumpstate, hal_vehiclebus_default)
diff --git a/emulator/usbpt/protocan/protocanbus/sepolicy/service.te b/emulator/usbpt/protocan/protocanbus/sepolicy/service.te
index 1016fe4..08c20e9 100644
--- a/emulator/usbpt/protocan/protocanbus/sepolicy/service.te
+++ b/emulator/usbpt/protocan/protocanbus/sepolicy/service.te
@@ -1 +1 @@
-type hal_vehiclebus_service, vendor_service, protected_service, service_manager_type;
+type hal_vehiclebus_service, hal_service_type, protected_service, service_manager_type;
diff --git a/emulator/usbpt/usbip-service/TEST_MAPPING b/emulator/usbpt/usbip-service/TEST_MAPPING
index c977d11..61eb9ae 100644
--- a/emulator/usbpt/usbip-service/TEST_MAPPING
+++ b/emulator/usbpt/usbip-service/TEST_MAPPING
@@ -1,7 +1,7 @@
{
"presubmit": [
{
- "name": "usbpip_test",
+ "name": "usbip_test",
"host": true
}
]
diff --git a/emulator/usbpt/wifi/BoardConfig.mk b/emulator/usbpt/wifi/BoardConfig.mk
new file mode 100644
index 0000000..2a13328
--- /dev/null
+++ b/emulator/usbpt/wifi/BoardConfig.mk
@@ -0,0 +1,14 @@
+# Copyright (C) 2022 The Android Open Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
diff --git a/emulator/usbpt/wifi/init.wifiusb.rc b/emulator/usbpt/wifi/init.wifiusb.rc
new file mode 100644
index 0000000..5b09e12
--- /dev/null
+++ b/emulator/usbpt/wifi/init.wifiusb.rc
@@ -0,0 +1,19 @@
+# Copyright (C) 2022 The Android Open-Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+on early-init
+ write /sys/module/firmware_class/parameters/path /vendor/firmware/
+
+on boot
+ exec u:r:vendor_modprobe:s0 -- /vendor/bin/modprobe -a -d /vendor/lib/modules mt76.ko mt76-usb.ko mt76x02-lib.ko mt76x02-usb.ko mt76x0-common.ko mt76x0u.ko mt76x2-common.ko mt76x2u.ko
diff --git a/emulator/usbpt/wifi/wifi.mk b/emulator/usbpt/wifi/wifi.mk
new file mode 100644
index 0000000..e2da0f9
--- /dev/null
+++ b/emulator/usbpt/wifi/wifi.mk
@@ -0,0 +1,17 @@
+#
+# Copyright (C) 2022 The Android Open Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+PRODUCT_COPY_FILES += \
+ device/generic/car/emulator/usbpt/wifi/init.wifiusb.rc:$(TARGET_COPY_OUT_VENDOR)/etc/init/init.wifiusb.rc \