Commit 4a34a6a6 authored by Subs's avatar Subs

Convert to an external tree

parent 6f6fd565
[submodule "buildroot"]
path = buildroot
url = git://git.busybox.net/buildroot
shallow = true
This diff is collapsed.
......@@ -22,4 +22,4 @@ RUN locale-gen
RUN mkdir -p /work
WORKDIR /work
CMD echo "${RECALBOX_VERSION_LABEL}" > board/recalbox/fsoverlay/recalbox/recalbox.version && make recalbox-${ARCH}_defconfig && sed -i "s|BR2_DL_DIR=.*|BR2_DL_DIR=\"/share/dl\"|g" .config && sed -i "s|BR2_HOST_DIR=.*\"|BR2_HOST_DIR=\"/share/host\"|g" .config && $( [ "$RECALBOX_CCACHE_DIR" != "" ] && echo "BR2_CCACHE=y" >> .config && echo "BR2_CCACHE_DIR=\"$RECALBOX_CCACHE_DIR\"" >> .config && echo "BR2_CCACHE_INITIAL_SETUP=\"--max-size=500G\"" >> .config && echo "BR2_CCACHE_USE_BASEDIR=y" >> .config ) || true && make -s
CMD echo "${RECALBOX_VERSION_LABEL}" > board/recalbox/fsoverlay/recalbox/recalbox.version ; ( cd buildroot && git reset HEAD --hard && git clean -dfx ) && make recalbox-${ARCH}_defconfig && [ "$RECALBOX_CCACHE_DIR" != "" ] && RECALBOX_CCACHE="BR2_CCACHE=y" ; BR2_DL_DIR="/share/dl" BR2_CCACHE_DIR="$RECALBOX_CCACHE_DIR" make BR2_HOST_DIR=/share/host $RECALBOX_CCACHE BR2_CCACHE_INITIAL_SETUP="--max-size=500G" BR2_CCACHE_USE_BASEDIR=y
PWD := $(shell pwd)
DL_DIR := $(if $(BR2_DL_DIR),$(BR2_DL_DIR),$(PWD)/dl)
.PHONY: merge buildBR
# So here is the trick : we try to "transmit" make parameters. We handle 2 cases :
# - no parameters: resync recalbox in Buildroot
# - parameters : the user is running a specific make commande like make sdl2-reconfigure or make clean, so don't sync
# - recalbox-*_defconfig: we MUST apply the patches.SOme of them change the dependencies, they must be done BEFORE we do make the defconfig itself
ifeq ($(MAKECMDGOALS),)
all: | merge buildBR
else
recalbox-%_defconfig: | merge
BR2_DL_DIR=$(DL_DIR) $(MAKE) BR2_EXTERNAL="$(PWD)" O="$(PWD)/output" -C "$(PWD)/buildroot" $(MAKEOVERRIDES) $@
%:
BR2_DL_DIR=$(DL_DIR) $(MAKE) BR2_EXTERNAL="$(PWD)" O="$(PWD)/output" -C "$(PWD)/buildroot" $(MAKEOVERRIDES) $@
endif
merge:
BUILDROOT_DIR=$(PWD)/buildroot $(PWD)/scripts/linux/mergeToBR.sh
buildBR:
@echo $(MAKEFLAGS) $(MAKECMDGOALS)
BR2_DL_DIR=$(DL_DIR) $(MAKE) BR2_EXTERNAL="$(PWD)" O="$(PWD)/output" -C "$(PWD)/buildroot" $(MAKEOVERRIDES) $(MAKECMDGOALS)
image boot.vfat {
vfat {
extraargs = "-F 32 -n BOOT"
files = {
"boot.ini",
"Image",
"meson64_odroidc2.dtb",
"recalbox-boot.conf",
"boot-logo.bmp.gz"
}
}
size = 64M
}
image recalbox.img {
hdimage {
}
partition vfat {
partition-type = 0xC
image = "boot.vfat"
offset = 1048576
}
partition rootfs {
partition-type = 0x83
image = "rootfs.ext4"
size = 0
}
}
......@@ -100,7 +100,7 @@ case "${RECALBOX_TARGET}" in
GENIMAGE_TMP="${BUILD_DIR}/genimage.tmp"
RECALBOXIMG="${RECALBOX_BINARIES_DIR}/recalbox.img"
rm -rf "${GENIMAGE_TMP}" || exit 1
cp "board/raspberrypi/genimage.cfg" "${BINARIES_DIR}/genimage.cfg.tmp" || exit 1
cp "${BR2_EXTERNAL_RECALBOX_PATH}/board/recalbox/rpi/genimage.cfg" "${BINARIES_DIR}/genimage.cfg.tmp" || exit 1
FILES=$(find "${BINARIES_DIR}/rpi-firmware" -type f | sed -e s+"^${BINARIES_DIR}/rpi-firmware/\(.*\)$"+"file \1 \{ image = 'rpi-firmware/\1' }"+ | tr '\n' '@')
cat "${BINARIES_DIR}/genimage.cfg.tmp" | sed -e s+'@files'+"${FILES}"+ | tr '@' '\n' > "${BINARIES_DIR}/genimage.cfg" || exit 1
rm -f "${BINARIES_DIR}/genimage.cfg.tmp" || exit 1
......@@ -117,7 +117,7 @@ case "${RECALBOX_TARGET}" in
done
# /boot
cp "board/hardkernel/odroidxu4/boot.ini" ${BINARIES_DIR}/boot.ini || exit 1
cp "${BR2_EXTERNAL_RECALBOX_PATH}/board/recalbox/xu4/boot.ini" ${BINARIES_DIR}/boot.ini || exit 1
# root.tar.xz
cp "${BINARIES_DIR}/rootfs.tar.xz" "${RECALBOX_BINARIES_DIR}/root.tar.xz" || exit 1
......@@ -129,7 +129,7 @@ case "${RECALBOX_TARGET}" in
GENIMAGE_TMP="${BUILD_DIR}/genimage.tmp"
RECALBOXIMG="${RECALBOX_BINARIES_DIR}/recalbox.img"
rm -rf "${GENIMAGE_TMP}" || exit 1
cp "board/hardkernel/odroidxu4/genimage.cfg" "${BINARIES_DIR}" || exit 1
cp "${BR2_EXTERNAL_RECALBOX_PATH}/board/recalbox/xu4/genimage.cfg" "${BINARIES_DIR}" || exit 1
genimage --rootpath="${TARGET_DIR}" --inputpath="${BINARIES_DIR}" --outputpath="${RECALBOX_BINARIES_DIR}" --config="${BINARIES_DIR}/genimage.cfg" --tmppath="${GENIMAGE_TMP}" || exit 1
rm -f "${RECALBOX_BINARIES_DIR}/boot.vfat" || exit 1
xu4_fusing "${BINARIES_DIR}" "${RECALBOXIMG}" || exit 1
......@@ -142,10 +142,10 @@ case "${RECALBOX_TARGET}" in
do
cp "${BUILD_DIR}/uboot-odroidc2-v2015.01/sd_fuse/${F}" "${BINARIES_DIR}" || exit 1
done
cp board/recalbox/c2/boot-logo.bmp.gz ${BINARIES_DIR} || exit 1
cp "${BR2_EXTERNAL_RECALBOX_PATH}/board/recalbox/c2/boot-logo.bmp.gz" ${BINARIES_DIR} || exit 1
# /boot
cp "board/recalbox/c2/boot.ini" ${BINARIES_DIR}/boot.ini || exit 1
cp "${BR2_EXTERNAL_RECALBOX_PATH}/board/recalbox/c2/boot.ini" ${BINARIES_DIR}/boot.ini || exit 1
# root.tar.xz
cp "${BINARIES_DIR}/rootfs.tar.xz" "${RECALBOX_BINARIES_DIR}/root.tar.xz" || exit 1
......@@ -157,7 +157,7 @@ case "${RECALBOX_TARGET}" in
GENIMAGE_TMP="${BUILD_DIR}/genimage.tmp"
RECALBOXIMG="${RECALBOX_BINARIES_DIR}/recalbox.img"
rm -rf "${GENIMAGE_TMP}" || exit 1
cp "board/hardkernel/odroidc2/genimage.cfg" "${BINARIES_DIR}" || exit 1
cp "${BR2_EXTERNAL_RECALBOX_PATH}/board/recalbox/c2/genimage.cfg" "${BINARIES_DIR}" || exit 1
genimage --rootpath="${TARGET_DIR}" --inputpath="${BINARIES_DIR}" --outputpath="${RECALBOX_BINARIES_DIR}" --config="${BINARIES_DIR}/genimage.cfg" --tmppath="${GENIMAGE_TMP}" || exit 1
rm -f "${RECALBOX_BINARIES_DIR}/boot.vfat" || exit 1
c2_fusing "${BINARIES_DIR}" "${RECALBOXIMG}" || exit 1
......@@ -168,7 +168,7 @@ case "${RECALBOX_TARGET}" in
# /boot
rm -rf ${BINARIES_DIR}/boot || exit 1
mkdir -p ${BINARIES_DIR}/boot/grub || exit 1
cp "board/recalbox/grub2/grub.cfg" ${BINARIES_DIR}/boot/grub/grub.cfg || exit 1
cp "${BR2_EXTERNAL_RECALBOX_PATH}/board/recalbox/grub2/grub.cfg" ${BINARIES_DIR}/boot/grub/grub.cfg || exit 1
cp "${BINARIES_DIR}/bzImage" "${BINARIES_DIR}/boot" || exit 1
cp "${BINARIES_DIR}/initrd.gz" "${BINARIES_DIR}/boot" || exit 1
......@@ -178,7 +178,7 @@ case "${RECALBOX_TARGET}" in
# get UEFI files
mkdir -p "${BINARIES_DIR}/EFI/BOOT" || exit 1
cp "${BINARIES_DIR}/bootx64.efi" "${BINARIES_DIR}/EFI/BOOT" || exit 1
cp "board/recalbox/grub2/grub.cfg" "${BINARIES_DIR}/EFI/BOOT" || exit 1
cp "${BR2_EXTERNAL_RECALBOX_PATH}/board/recalbox/grub2/grub.cfg" "${BINARIES_DIR}/EFI/BOOT" || exit 1
# boot.tar.xz
(cd "${BINARIES_DIR}" && tar -cJf "${RECALBOX_BINARIES_DIR}/boot.tar.xz" EFI boot recalbox-boot.conf) || exit 1
......@@ -187,7 +187,7 @@ case "${RECALBOX_TARGET}" in
GENIMAGE_TMP="${BUILD_DIR}/genimage.tmp"
RECALBOXIMG="${RECALBOX_BINARIES_DIR}/recalbox.img"
rm -rf "${GENIMAGE_TMP}" || exit 1
cp "board/recalbox/grub2/genimage.cfg" "${BINARIES_DIR}" || exit 1
cp "${BR2_EXTERNAL_RECALBOX_PATH}/board/recalbox/grub2/genimage.cfg" "${BINARIES_DIR}" || exit 1
cp "${HOST_DIR}/usr/lib/grub/i386-pc/boot.img" "${BINARIES_DIR}" || exit 1
genimage --rootpath="${TARGET_DIR}" --inputpath="${BINARIES_DIR}" --outputpath="${RECALBOX_BINARIES_DIR}" --config="${BINARIES_DIR}/genimage.cfg" --tmppath="${GENIMAGE_TMP}" || exit 1
rm -f "${RECALBOX_BINARIES_DIR}/boot.vfat" || exit 1
......
From b4f2b77472aeb967d3a7595e8a965785c7a37c87 Mon Sep 17 00:00:00 2001
From: Phil Elwell <phil@raspberrypi.org>
Date: Tue, 16 Feb 2016 16:40:46 +0000
Subject: [PATCH 1/4] bcm43xx: Add bcm43xx-3wire variant
---
tools/hciattach.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/tools/hciattach.c b/tools/hciattach.c
index 59a76a7..5861d33 100644
--- a/tools/hciattach.c
+++ b/tools/hciattach.c
@@ -1144,6 +1144,9 @@ struct uart_t uart[] = {
{ "bcm43xx", 0x0000, 0x0000, HCI_UART_H4, 115200, 3000000,
FLOW_CTL, DISABLE_PM, NULL, bcm43xx, NULL },
+ { "bcm43xx-3wire", 0x0000, 0x0000, HCI_UART_3WIRE, 115200, 3000000,
+ 0, DISABLE_PM, NULL, bcm43xx, NULL },
+
{ "ath3k", 0x0000, 0x0000, HCI_UART_ATH3K, 115200, 115200,
FLOW_CTL, DISABLE_PM, NULL, ath3k_ps, ath3k_pm },
--
1.9.1
From e145c9621f976063e5c573db1f2053d906f63427 Mon Sep 17 00:00:00 2001
From: Phil Elwell <phil@raspberrypi.org>
Date: Tue, 16 Feb 2016 16:39:09 +0000
Subject: [PATCH 2/4] bcm43xx: The UART speed must be reset after the firmware download
---
tools/hciattach_bcm43xx.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/tools/hciattach_bcm43xx.c b/tools/hciattach_bcm43xx.c
index 81f38cb..0b792e0 100644
--- a/tools/hciattach_bcm43xx.c
+++ b/tools/hciattach_bcm43xx.c
@@ -366,11 +366,8 @@ int bcm43xx_init(int fd, int def_speed, int speed, struct termios *ti,
return -1;
if (bcm43xx_locate_patch(FIRMWARE_DIR, chip_name, fw_path)) {
- fprintf(stderr, "Patch not found, continue anyway\n");
+ fprintf(stderr, "Patch not found for %s, continue anyway\n", chip_name);
} else {
- if (bcm43xx_set_speed(fd, ti, speed))
- return -1;
-
if (bcm43xx_load_firmware(fd, fw_path))
return -1;
@@ -380,6 +377,7 @@ int bcm43xx_init(int fd, int def_speed, int speed, struct termios *ti,
return -1;
}
+ sleep(1);
if (bcm43xx_reset(fd))
return -1;
}
--
1.9.1
From d41dc2046dd08d8c95197f677e224506f5b39bdd Mon Sep 17 00:00:00 2001
From: Phil Elwell <phil@raspberrypi.org>
Date: Wed, 20 Jan 2016 16:00:37 +0000
Subject: [PATCH 3/4] Increase firmware load timeout to 30s
---
tools/hciattach.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/hciattach.c b/tools/hciattach.c
index 5861d33..4141796 100644
--- a/tools/hciattach.c
+++ b/tools/hciattach.c
@@ -1293,7 +1293,7 @@ int main(int argc, char *argv[])
{
struct uart_t *u = NULL;
int detach, printpid, raw, opt, i, n, ld, err;
- int to = 10;
+ int to = 30;
int init_speed = 0;
int send_break = 0;
pid_t pid;
--
1.9.1
From 76681284b0ea49852041fdb97a35175089a08781 Mon Sep 17 00:00:00 2001
From: Phil Elwell <phil@raspberrypi.org>
Date: Tue, 23 Feb 2016 17:52:29 +0000
Subject: [PATCH 4/4] Move the 43xx firmware into /lib/firmware
---
tools/hciattach_bcm43xx.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/hciattach_bcm43xx.c b/tools/hciattach_bcm43xx.c
index 0b792e0..207f668 100644
--- a/tools/hciattach_bcm43xx.c
+++ b/tools/hciattach_bcm43xx.c
@@ -43,7 +43,7 @@
#include "hciattach.h"
#ifndef FIRMWARE_DIR
-#define FIRMWARE_DIR "/etc/firmware"
+#define FIRMWARE_DIR "/lib/firmware"
#endif
#define FW_EXT ".hcd"
--
1.9.1
From: Szymon Janc <szymon.janc@...>
Subject: [PATCH 1/5] sixaxis: Fix PID for Navigation Controller
Newsgroups: gmane.linux.bluez.kernel
Date: 2015-06-15 18:28:26 GMT (36 weeks, 4 days, 21 hours and 32 minutes ago)
Navigation Controller is using PID 0x042f over USB but PID 0x0268
(same as Dualshock 3) over BT.
---
plugins/sixaxis.c | 17 +++++++++++++++--
1 file changed, 15 insertions(+), 2 deletions(-)
diff --git a/plugins/sixaxis.c b/plugins/sixaxis.c
index fcc93bc..50db6c1 100644
--- a/plugins/sixaxis.c
+++ b/plugins/sixaxis.c
@@ -54,6 +54,7 @@ static const struct {
uint16_t vid;
uint16_t pid;
uint16_t version;
+ uint16_t bt_pid;
} devices[] = {
{
.name = "PLAYSTATION(R)3 Controller",
@@ -68,6 +69,7 @@ static const struct {
.vid = 0x054c,
.pid = 0x042f,
.version = 0x0000,
+ .bt_pid = 0x0268,
},
};
@@ -300,8 +302,19 @@ static bool setup_device(int fd, int index, struct btd_adapter *adapter)
info("sixaxis: setting up new device");
btd_device_device_set_name(device, devices[index].name);
- btd_device_set_pnpid(device, devices[index].source, devices[index].vid,
- devices[index].pid, devices[index].version);
+
+ /* if device reports different pid/vid on BT prefer those over USB */
+ if (devices[index].bt_pid)
+ btd_device_set_pnpid(device, devices[index].source,
+ devices[index].vid,
+ devices[index].bt_pid,
+ devices[index].version);
+ else
+ btd_device_set_pnpid(device, devices[index].source,
+ devices[index].vid,
+ devices[index].pid,
+ devices[index].version);
+
btd_device_set_temporary(device, false);
return true;
--
2.1.4
From: Szymon Janc <szymon.janc@...>
Subject: [PATCH 2/5] core/device: Add support for setting SDP record
Newsgroups: gmane.linux.bluez.kernel
Date: 2015-06-15 18:28:27 GMT (36 weeks, 4 days, 21 hours and 33 minutes ago)
This allows to set SDP record for device without resolving services
over SDP. After SDP is provided profiles are probed.
---
src/device.c | 31 +++++++++++++++++++++++++++++++
src/device.h | 3 +++
2 files changed, 34 insertions(+)
diff --git a/src/device.c b/src/device.c
index 3ef0340..859aa3c 100644
--- a/src/device.c
+++ b/src/device.c
@@ -5542,6 +5542,37 @@ static sdp_list_t *read_device_records(struct btd_device *device)
return recs;
}
+void btd_device_set_record(struct btd_device *device, const char *uuid,
+ sdp_record_t *rec)
+{
+ /* This API is only used for BR/EDR */
+ struct bearer_state *state = &device->bredr_state;
+ struct browse_req *req;
+ sdp_list_t *recs = NULL;
+
+ if (!rec)
+ return;
+
+ req = browse_request_new(device, NULL);
+ if (!req)
+ return;
+
+ recs = sdp_list_append(recs, rec);
+ update_bredr_services(req, recs);
+ sdp_list_free(recs, NULL);
+
+ device->svc_refreshed = true;
+ state->svc_resolved = true;
+
+ device_probe_profiles(device, req->profiles_added);
+
+ /* Propagate services changes */
+ g_dbus_emit_property_changed(dbus_conn, req->device->path,
+ DEVICE_INTERFACE, "UUIDs");
+
+ device_svc_resolved(device, device->bdaddr_type, 0);
+}
+
const sdp_record_t *btd_device_get_record(struct btd_device *device,
const char *uuid)
{
diff --git a/src/device.h b/src/device.h
index 1955f54..aee677a 100644
--- a/src/device.h
+++ b/src/device.h
@@ -62,6 +62,9 @@ struct device_addr_type {
int device_addr_type_cmp(gconstpointer a, gconstpointer b);
GSList *btd_device_get_uuids(struct btd_device *device);
void device_probe_profiles(struct btd_device *device, GSList *profiles);
+
+void btd_device_set_record(struct btd_device *device, const char *uuid,
+ sdp_record_t *rec);
const sdp_record_t *btd_device_get_record(struct btd_device *device,
const char *uuid);
struct gatt_primary *btd_device_get_primary(struct btd_device *device,
--
2.1.4
From: Szymon Janc <szymon.janc@...>
Subject: [PATCH 3/5] sixaxis: Provide DualShock 3 SDP record while adding new device
Newsgroups: gmane.linux.bluez.kernel
Date: 2015-06-15 18:28:28 GMT (36 weeks, 4 days, 21 hours and 33 minutes ago)
This allows to skip SDP search for DualShock 3 devices. Since some
DS3 clones were reported to not provide any SDP record this should
allow to operate them.
---
Makefile.plugins | 1 +
plugins/sixaxis.c | 166 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 167 insertions(+)
diff --git a/Makefile.plugins b/Makefile.plugins
index cae43d9..2c2385d 100644
--- a/Makefile.plugins
+++ b/Makefile.plugins
@@ -118,4 +118,5 @@ plugins_sixaxis_la_SOURCES = plugins/sixaxis.c
plugins_sixaxis_la_LDFLAGS = $(AM_LDFLAGS) -module -avoid-version \
-no-undefined @UDEV_LIBS@
plugins_sixaxis_la_CFLAGS = $(AM_CFLAGS) -fvisibility=hidden @UDEV_CFLAGS@
+plugins_sixaxis_la_LIBADD = lib/libbluetooth-internal.la
endif
diff --git a/plugins/sixaxis.c b/plugins/sixaxis.c
index 50db6c1..782a89f 100644
--- a/plugins/sixaxis.c
+++ b/plugins/sixaxis.c
@@ -40,4 +40,6 @@
#include "lib/bluetooth.h"
+#include "lib/sdp.h"
+#include "lib/sdp_lib.h"
#include "lib/uuid.h"
#include "src/adapter.h"
@@ -257,6 +258,170 @@ out:
return false;
}
+static sdp_record_t *get_sdp_record(void)
+{
+ sdp_record_t *record;
+ uint16_t hid_release, hid_parser, version, timeout;
+ uint8_t sdp_disable, battery, remote_wakeup, norm_connect, boot_device;
+ uint8_t subclass, country, virtual_cable, reconnect;
+ sdp_list_t *svclass_id, *pfseq, *apseq, *root;
+ uuid_t root_uuid, hidkb_uuid, l2cap_uuid, hidp_uuid;
+ sdp_profile_desc_t profile;
+ sdp_list_t *aproto, *proto[3];
+ sdp_data_t *psm, *lang_lst, *lang_lst2, *hid_spec_lst, *hid_spec_lst2;
+ uint8_t dtd = SDP_UINT16;
+ uint8_t dtd2 = SDP_UINT8;
+ uint8_t dtd_data = SDP_TEXT_STR8;
+ void *dtds[2];
+ void *values[2];
+ void *dtds2[2];
+ void *values2[2];
+ int leng[2];
+ uint8_t hid_spec_type = 0x22;
+ uint16_t hid_attr_lang[] = { 0x409, 0x100 };
+ static const uint16_t ctrl = 0x11;
+ static const uint16_t intr = 0x13;
+ uint8_t hid_spec[] = {
+ 0x05, 0x01, 0x09, 0x04, 0xa1, 0x01, 0xa1, 0x02, 0x85, 0x01,
+ 0x75, 0x08, 0x95, 0x01, 0x15, 0x00, 0x26, 0xff, 0x00, 0x81,
+ 0x03, 0x75, 0x01, 0x95, 0x13, 0x15, 0x00, 0x25, 0x01, 0x35,
+ 0x00, 0x45, 0x01, 0x05, 0x09, 0x19, 0x01, 0x29, 0x13, 0x81,
+ 0x02, 0x75, 0x01, 0x95, 0x0d, 0x06, 0x00, 0xff, 0x81, 0x03,
+ 0x15, 0x00, 0x26, 0xff, 0x00, 0x05, 0x01, 0x09, 0x01, 0xa1,
+ 0x00, 0x75, 0x08, 0x95, 0x04, 0x35, 0x00, 0x46, 0xff, 0x00,
+ 0x09, 0x30, 0x09, 0x31, 0x09, 0x32, 0x09, 0x35, 0x81, 0x02,
+ 0xc0, 0x05, 0x01, 0x75, 0x08, 0x95, 0x27, 0x09, 0x01, 0x81,
+ 0x02, 0x75, 0x08, 0x95, 0x30, 0x09, 0x01, 0x91, 0x02, 0x75,
+ 0x08, 0x95, 0x30, 0x09, 0x01, 0xb1, 0x02, 0xc0, 0xa1, 0x02,
+ 0x85, 0x02, 0x75, 0x08, 0x95, 0x30, 0x09, 0x01, 0xb1, 0x02,
+ 0xc0, 0xa1, 0x02, 0x85, 0xee, 0x75, 0x08, 0x95, 0x30, 0x09,
+ 0x01, 0xb1, 0x02, 0xc0, 0xa1, 0x02, 0x85, 0xef, 0x75, 0x08,
+ 0x95, 0x30, 0x09, 0x01, 0xb1, 0x02, 0xc0, 0xc0, 0x00
+ };
+
+ record = sdp_record_alloc();
+ if (!record)
+ return NULL;
+
+ sdp_uuid16_create(&root_uuid, PUBLIC_BROWSE_GROUP);
+ root = sdp_list_append(0, &root_uuid);
+ sdp_set_browse_groups(record, root);
+
+ sdp_add_lang_attr(record);
+
+ sdp_uuid16_create(&hidkb_uuid, HID_SVCLASS_ID);
+ svclass_id = sdp_list_append(0, &hidkb_uuid);
+ sdp_set_service_classes(record, svclass_id);
+
+ sdp_uuid16_create(&profile.uuid, HID_PROFILE_ID);
+ profile.version = 0x0100;
+ pfseq = sdp_list_append(0, &profile);
+ sdp_set_profile_descs(record, pfseq);
+
+ /* protocols */
+ sdp_uuid16_create(&l2cap_uuid, L2CAP_UUID);
+ proto[1] = sdp_list_append(0, &l2cap_uuid);
+ psm = sdp_data_alloc(SDP_UINT16, &ctrl);
+ proto[1] = sdp_list_append(proto[1], psm);
+ apseq = sdp_list_append(0, proto[1]);
+
+ sdp_uuid16_create(&hidp_uuid, HIDP_UUID);
+ proto[2] = sdp_list_append(0, &hidp_uuid);
+ apseq = sdp_list_append(apseq, proto[2]);
+
+ aproto = sdp_list_append(0, apseq);
+ sdp_set_access_protos(record, aproto);
+
+ /* additional protocols */
+ proto[1] = sdp_list_append(0, &l2cap_uuid);
+ psm = sdp_data_alloc(SDP_UINT16, &intr);
+ proto[1] = sdp_list_append(proto[1], psm);
+ apseq = sdp_list_append(0, proto[1]);
+
+ sdp_uuid16_create(&hidp_uuid, HIDP_UUID);
+ proto[2] = sdp_list_append(0, &hidp_uuid);
+ apseq = sdp_list_append(apseq, proto[2]);
+
+ aproto = sdp_list_append(0, apseq);
+ sdp_set_add_access_protos(record, aproto);
+
+ sdp_set_info_attr(record, "Wireless Controller",
+ "Sony Computer Entertainment",
+ "Wireless Controller");
+
+ hid_release = 0x0100;
+ sdp_attr_add_new(record, SDP_ATTR_HID_DEVICE_RELEASE_NUMBER, SDP_UINT16,
+ &hid_release);
+
+ hid_parser = 0x0100;
+ sdp_attr_add_new(record, SDP_ATTR_HID_PARSER_VERSION, SDP_UINT16,
+ &hid_parser);
+
+ subclass = 0x00;
+ sdp_attr_add_new(record, SDP_ATTR_HID_DEVICE_SUBCLASS, SDP_UINT8,
+ &subclass);
+
+ country = 0x21;
+ sdp_attr_add_new(record, SDP_ATTR_HID_COUNTRY_CODE, SDP_UINT8,
+ &country);
+
+ virtual_cable = 0x01;
+ sdp_attr_add_new(record, SDP_ATTR_HID_VIRTUAL_CABLE, SDP_BOOL,
+ &virtual_cable);
+
+ reconnect = 0x01;
+ sdp_attr_add_new(record, SDP_ATTR_HID_RECONNECT_INITIATE, SDP_BOOL,
+ &reconnect);
+
+ dtds[0] = &dtd2;
+ values[0] = &hid_spec_type;
+ dtds[1] = &dtd_data;
+ values[1] = hid_spec;
+ leng[0] = 0;
+ leng[1] = sizeof(hid_spec);
+ hid_spec_lst = sdp_seq_alloc_with_length(dtds, values, leng, 2);
+ hid_spec_lst2 = sdp_data_alloc(SDP_SEQ8, hid_spec_lst);
+ sdp_attr_add(record, SDP_ATTR_HID_DESCRIPTOR_LIST, hid_spec_lst2);
+
+ dtds2[0] = &dtd;
+ values2[0] = &hid_attr_lang[0];
+ dtds2[1] = &dtd;
+ values2[1] = &hid_attr_lang[1];
+ lang_lst = sdp_seq_alloc(dtds2, values2, sizeof(hid_attr_lang) / 2);
+ lang_lst2 = sdp_data_alloc(SDP_SEQ8, lang_lst);
+ sdp_attr_add(record, SDP_ATTR_HID_LANG_ID_BASE_LIST, lang_lst2);
+
+ sdp_disable = 0x00;
+ sdp_attr_add_new(record, SDP_ATTR_HID_SDP_DISABLE, SDP_BOOL,
+ &sdp_disable);
+
+ battery = 0x01;
+ sdp_attr_add_new(record, SDP_ATTR_HID_BATTERY_POWER, SDP_BOOL,
+ &battery);
+
+ remote_wakeup = 0x01;
+ sdp_attr_add_new(record, SDP_ATTR_HID_REMOTE_WAKEUP, SDP_BOOL,
+ &remote_wakeup);
+
+ version = 0x0100;
+ sdp_attr_add_new(record, SDP_ATTR_HID_PROFILE_VERSION, SDP_UINT16,
+ &version);
+
+ timeout = 0x3e80;
+ sdp_attr_add_new(record, SDP_ATTR_HID_SUPERVISION_TIMEOUT, SDP_UINT16,
+ &timeout);
+
+ norm_connect = 0x00;
+ sdp_attr_add_new(record, SDP_ATTR_HID_NORMALLY_CONNECTABLE, SDP_BOOL,
+ &norm_connect);
+
+ boot_device = 0x00;
+ sdp_attr_add_new(record, SDP_ATTR_HID_BOOT_DEVICE, SDP_BOOL,
+ &boot_device);
+
+ return record;
+}
+
static bool setup_device(int fd, int index, struct btd_adapter *adapter)
{
char device_addr[18], master_addr[18], adapter_addr[18];
@@ -316,6 +481,7 @@ static bool setup_device(int fd, int index, struct btd_adapter *adapter)
devices[index].version);
btd_device_set_temporary(device, false);
+ btd_device_set_record(device, HID_UUID, get_sdp_record());
return true;
}
--
2.1.4
From: Szymon Janc <szymon.janc@...>
Subject: [PATCH 4/5] profiles/input: Remove not needed sixaxis checks
Newsgroups: gmane.linux.bluez.kernel
Date: 2015-06-15 18:28:29 GMT (36 weeks, 4 days, 21 hours and 33 minutes ago)
This check is now needed only for DualShock 4.
---
profiles/input/server.c | 8 --------
1 file changed, 8 deletions(-)
diff --git a/profiles/input/server.c b/profiles/input/server.c
index eb3fcf8..101108b 100644
--- a/profiles/input/server.c
+++ b/profiles/input/server.c
@@ -131,18 +131,10 @@ static bool dev_is_sixaxis(const bdaddr_t *src, const bdaddr_t *dst)
vid = btd_device_get_vendor(device);
pid = btd_device_get_product(device);
- /* DualShock 3 */
- if (vid == 0x054c && pid == 0x0268)
- return true;
-
/* DualShock 4 */
if (vid == 0x054c && pid == 0x05c4)
return true;
- /* Navigation Controller */
- if