chore(net-wireless/*): remove everything

Lets not worry about having coreos support wireless for now :)
This commit is contained in:
Brandon Philips 2013-07-07 18:50:24 -07:00
parent bfdc8d5058
commit 745715959d
144 changed files with 0 additions and 8542 deletions

View File

@ -1,12 +0,0 @@
DEFINED_PHASES=info install setup unpack
DEPEND=dev-vcs/git
DESCRIPTION=Atheros AR300x firmware
EAPI=2
HOMEPAGE=http://www.atheros.com/
IUSE=cros_workon_tree_a214d22b4c8a8f3cf46dd4a8b80451231eedb9dc
KEYWORDS=amd64 arm x86
LICENSE=Atheros
RESTRICT=binchecks strip test
SLOT=0
_eclasses_=binutils-funcs 73669d0b20960c1cc54cf381a4b89e77 cros-workon 5f2f8a42fa8e9e59f25015d9167f93a4 eutils 33ef77a15337022e05342d2c772a7a5a flag-o-matic 01a8b1eb019305bc4b4a8bd0b04e4cd8 git-2 da60d6e85fa94cef4d510cab24e01e36 multilib 5f4ad6cf85e365e8f0c6050ddd21659e portability 0be430f759a631e692678ed796e09f5c toolchain-funcs 64fc271a237429f84f36b91c9f4b9912 user 9e552f935106ff0bc92af16da64b4b29
_md5_=a3a37e110138b1fcd95df0e84c7f0057

View File

@ -1,12 +0,0 @@
DEFINED_PHASES=info install setup unpack
DEPEND=dev-vcs/git
DESCRIPTION=Atheros AR300x firmware
EAPI=2
HOMEPAGE=http://www.atheros.com/
IUSE=cros_workon_tree_
KEYWORDS=~amd64 ~arm ~x86
LICENSE=Atheros
RESTRICT=binchecks strip test
SLOT=0
_eclasses_=binutils-funcs 73669d0b20960c1cc54cf381a4b89e77 cros-workon 5f2f8a42fa8e9e59f25015d9167f93a4 eutils 33ef77a15337022e05342d2c772a7a5a flag-o-matic 01a8b1eb019305bc4b4a8bd0b04e4cd8 git-2 da60d6e85fa94cef4d510cab24e01e36 multilib 5f4ad6cf85e365e8f0c6050ddd21659e portability 0be430f759a631e692678ed796e09f5c toolchain-funcs 64fc271a237429f84f36b91c9f4b9912 user 9e552f935106ff0bc92af16da64b4b29
_md5_=5b5af88ceed54dc45fbfc34b10b1af18

View File

@ -1,12 +0,0 @@
DEFINED_PHASES=info install setup unpack
DEPEND=dev-vcs/git
DESCRIPTION=Atheros AR600x firmware
EAPI=2
HOMEPAGE=http://www.atheros.com/
IUSE=cros_workon_tree_a214d22b4c8a8f3cf46dd4a8b80451231eedb9dc
KEYWORDS=amd64 arm x86
LICENSE=Atheros
RESTRICT=binchecks strip test
SLOT=0
_eclasses_=binutils-funcs 73669d0b20960c1cc54cf381a4b89e77 cros-workon 5f2f8a42fa8e9e59f25015d9167f93a4 eutils 33ef77a15337022e05342d2c772a7a5a flag-o-matic 01a8b1eb019305bc4b4a8bd0b04e4cd8 git-2 da60d6e85fa94cef4d510cab24e01e36 multilib 5f4ad6cf85e365e8f0c6050ddd21659e portability 0be430f759a631e692678ed796e09f5c toolchain-funcs 64fc271a237429f84f36b91c9f4b9912 user 9e552f935106ff0bc92af16da64b4b29
_md5_=d345e8d2a69d715eac64c2b9abddec61

View File

@ -1,12 +0,0 @@
DEFINED_PHASES=info install setup unpack
DEPEND=dev-vcs/git
DESCRIPTION=Atheros AR600x firmware
EAPI=2
HOMEPAGE=http://www.atheros.com/
IUSE=cros_workon_tree_
KEYWORDS=~amd64 ~arm ~x86
LICENSE=Atheros
RESTRICT=binchecks strip test
SLOT=0
_eclasses_=binutils-funcs 73669d0b20960c1cc54cf381a4b89e77 cros-workon 5f2f8a42fa8e9e59f25015d9167f93a4 eutils 33ef77a15337022e05342d2c772a7a5a flag-o-matic 01a8b1eb019305bc4b4a8bd0b04e4cd8 git-2 da60d6e85fa94cef4d510cab24e01e36 multilib 5f4ad6cf85e365e8f0c6050ddd21659e portability 0be430f759a631e692678ed796e09f5c toolchain-funcs 64fc271a237429f84f36b91c9f4b9912 user 9e552f935106ff0bc92af16da64b4b29
_md5_=5ab3772defa767362c8df9cd80f5f1bf

View File

@ -1,13 +0,0 @@
DEFINED_PHASES=compile configure install postinst prepare
DEPEND=sys-devel/flex >=dev-util/pkgconfig-0.20 alsa? ( media-libs/alsa-lib[alsa_pcm_plugins_extplug,alsa_pcm_plugins_ioplug] ) caps? ( >=sys-libs/libcap-ng-0.6.2 ) gstreamer? ( >=media-libs/gstreamer-0.10 >=media-libs/gst-plugins-base-0.10 ) usb? ( dev-libs/libusb ) cups? ( net-print/cups ) sys-fs/udev dev-libs/glib sys-apps/dbus media-libs/libsndfile >=dev-libs/libnl-1.1 !net-wireless/bluez-libs !net-wireless/bluez-utils || ( >=sys-devel/automake-1.11.1:1.11 ) >=sys-devel/autoconf-2.68 sys-devel/libtool
DESCRIPTION=Bluetooth Tools and System Daemons for Linux
EAPI=2
HOMEPAGE=http://bluez.sourceforge.net/
IUSE=alsa caps +consolekit cups debug gstreamer old-daemons pcmcia test-programs usb
KEYWORDS=amd64 arm x86
LICENSE=GPL-2 LGPL-2.1
RDEPEND=alsa? ( media-libs/alsa-lib[alsa_pcm_plugins_extplug,alsa_pcm_plugins_ioplug] ) caps? ( >=sys-libs/libcap-ng-0.6.2 ) gstreamer? ( >=media-libs/gstreamer-0.10 >=media-libs/gst-plugins-base-0.10 ) usb? ( dev-libs/libusb ) cups? ( net-print/cups ) sys-fs/udev dev-libs/glib sys-apps/dbus media-libs/libsndfile >=dev-libs/libnl-1.1 !net-wireless/bluez-libs !net-wireless/bluez-utils consolekit? ( sys-auth/pambase[consolekit] ) test-programs? ( dev-python/dbus-python dev-python/pygobject )
SLOT=0
SRC_URI=mirror://kernel/linux/bluetooth/bluez-4.62.tar.gz
_eclasses_=autotools addbdf6cce5024ac93ad2084ad5e1d2d binutils-funcs 73669d0b20960c1cc54cf381a4b89e77 eutils 33ef77a15337022e05342d2c772a7a5a libtool 0fd90d183673bf1107465ec45849d1ea multilib 5f4ad6cf85e365e8f0c6050ddd21659e portability 0be430f759a631e692678ed796e09f5c toolchain-funcs 64fc271a237429f84f36b91c9f4b9912 user 9e552f935106ff0bc92af16da64b4b29
_md5_=fbe76b1f95a29c416cd2ba8b36211e87

View File

@ -1,13 +0,0 @@
DEFINED_PHASES=compile configure install postinst prepare
DEPEND=sys-devel/flex >=dev-util/pkgconfig-0.20 alsa? ( media-libs/alsa-lib[alsa_pcm_plugins_extplug,alsa_pcm_plugins_ioplug] ) caps? ( >=sys-libs/libcap-ng-0.6.2 ) gstreamer? ( >=media-libs/gstreamer-0.10 >=media-libs/gst-plugins-base-0.10 ) usb? ( dev-libs/libusb ) cups? ( net-print/cups ) sys-fs/udev dev-libs/glib sys-apps/dbus media-libs/libsndfile >=dev-libs/libnl-1.1 !net-wireless/bluez-libs !net-wireless/bluez-utils || ( >=sys-devel/automake-1.11.1:1.11 ) >=sys-devel/autoconf-2.68 sys-devel/libtool
DESCRIPTION=Bluetooth Tools and System Daemons for Linux
EAPI=2
HOMEPAGE=http://bluez.sourceforge.net/
IUSE=alsa caps +consolekit cups debug gstreamer old-daemons pcmcia test-programs usb
KEYWORDS=amd64 arm x86
LICENSE=GPL-2 LGPL-2.1
RDEPEND=alsa? ( media-libs/alsa-lib[alsa_pcm_plugins_extplug,alsa_pcm_plugins_ioplug] ) caps? ( >=sys-libs/libcap-ng-0.6.2 ) gstreamer? ( >=media-libs/gstreamer-0.10 >=media-libs/gst-plugins-base-0.10 ) usb? ( dev-libs/libusb ) cups? ( net-print/cups ) sys-fs/udev dev-libs/glib sys-apps/dbus media-libs/libsndfile >=dev-libs/libnl-1.1 !net-wireless/bluez-libs !net-wireless/bluez-utils consolekit? ( sys-auth/pambase[consolekit] ) test-programs? ( dev-python/dbus-python dev-python/pygobject )
SLOT=0
SRC_URI=mirror://kernel/linux/bluetooth/bluez-4.62.tar.gz
_eclasses_=autotools addbdf6cce5024ac93ad2084ad5e1d2d binutils-funcs 73669d0b20960c1cc54cf381a4b89e77 eutils 33ef77a15337022e05342d2c772a7a5a libtool 0fd90d183673bf1107465ec45849d1ea multilib 5f4ad6cf85e365e8f0c6050ddd21659e portability 0be430f759a631e692678ed796e09f5c toolchain-funcs 64fc271a237429f84f36b91c9f4b9912 user 9e552f935106ff0bc92af16da64b4b29
_md5_=fbe76b1f95a29c416cd2ba8b36211e87

View File

@ -1,13 +0,0 @@
DEFINED_PHASES=configure install postinst prepare setup
DEPEND=>=dev-libs/glib-2.14:2 sys-apps/dbus >=sys-fs/udev-169 alsa? ( media-libs/alsa-lib[alsa_pcm_plugins_extplug,alsa_pcm_plugins_ioplug] media-libs/libsndfile ) caps? ( >=sys-libs/libcap-ng-0.6.2 ) cups? ( net-print/cups ) gstreamer? ( >=media-libs/gstreamer-0.10:0.10 >=media-libs/gst-plugins-base-0.10:0.10 ) usb? ( dev-libs/libusb:1 ) >=dev-util/pkgconfig-0.20 >=dev-libs/check-0.9.8 sys-devel/flex || ( >=sys-devel/automake-1.11.1:1.11 ) >=sys-devel/autoconf-2.68 sys-devel/libtool >=app-admin/eselect-python-20091230 test-programs? ( =dev-lang/python-2* )
DESCRIPTION=Bluetooth Tools and System Daemons for Linux
EAPI=4
HOMEPAGE=http://www.bluez.org/
IUSE=alsa caps +consolekit cups debug gstreamer pcmcia test-programs usb
KEYWORDS=amd64 arm ~hppa ~ppc ~ppc64 x86
LICENSE=GPL-2 LGPL-2.1
RDEPEND=>=dev-libs/glib-2.14:2 sys-apps/dbus >=sys-fs/udev-169 alsa? ( media-libs/alsa-lib[alsa_pcm_plugins_extplug,alsa_pcm_plugins_ioplug] media-libs/libsndfile ) caps? ( >=sys-libs/libcap-ng-0.6.2 ) cups? ( net-print/cups ) gstreamer? ( >=media-libs/gstreamer-0.10:0.10 >=media-libs/gst-plugins-base-0.10:0.10 ) usb? ( dev-libs/libusb:1 ) !net-wireless/bluez-libs !net-wireless/bluez-utils consolekit? ( || ( sys-auth/consolekit >=sys-apps/systemd-37 ) ) test-programs? ( dev-python/dbus-python dev-python/pygobject:2 ) >=app-admin/eselect-python-20091230 test-programs? ( =dev-lang/python-2* )
SLOT=0
SRC_URI=mirror://kernel/linux/bluetooth/bluez-4.97.tar.xz http://dev.gentoo.org/~pacho/bluez/oui-20111231.txt.xz
_eclasses_=autotools addbdf6cce5024ac93ad2084ad5e1d2d binutils-funcs 73669d0b20960c1cc54cf381a4b89e77 eutils 33ef77a15337022e05342d2c772a7a5a libtool 0fd90d183673bf1107465ec45849d1ea multilib 5f4ad6cf85e365e8f0c6050ddd21659e portability 0be430f759a631e692678ed796e09f5c python 6bbd984910e27780e5d0ea543d83ef84 systemd b5da52630b2559da43198bfb56ccacba toolchain-funcs 64fc271a237429f84f36b91c9f4b9912 user 9e552f935106ff0bc92af16da64b4b29
_md5_=76d206097cc342c22ff9c9cf742c01d9

View File

@ -1,13 +0,0 @@
DEFINED_PHASES=configure install postinst prepare setup
DEPEND=>=dev-libs/glib-2.14:2 sys-apps/dbus >=sys-fs/udev-169 alsa? ( media-libs/alsa-lib[alsa_pcm_plugins_extplug(+),alsa_pcm_plugins_ioplug(+)] media-libs/libsndfile ) caps? ( >=sys-libs/libcap-ng-0.6.2 ) cups? ( net-print/cups ) gstreamer? ( >=media-libs/gstreamer-0.10:0.10 >=media-libs/gst-plugins-base-0.10:0.10 ) usb? ( virtual/libusb:0 ) readline? ( sys-libs/readline ) >=dev-util/pkgconfig-0.20 sys-devel/flex test-programs? ( >=dev-libs/check-0.9.8 ) || ( >=sys-devel/automake-1.11.1:1.11 ) >=sys-devel/autoconf-2.68 sys-devel/libtool >=app-admin/eselect-python-20091230 test-programs? ( =dev-lang/python-2* )
DESCRIPTION=Bluetooth Tools and System Daemons for Linux
EAPI=4
HOMEPAGE=http://www.bluez.org/
IUSE=alsa caps +consolekit cups debug gstreamer pcmcia test-programs usb readline
KEYWORDS=amd64 arm hppa ~ppc ~ppc64 x86
LICENSE=GPL-2 LGPL-2.1
RDEPEND=>=dev-libs/glib-2.14:2 sys-apps/dbus >=sys-fs/udev-169 alsa? ( media-libs/alsa-lib[alsa_pcm_plugins_extplug(+),alsa_pcm_plugins_ioplug(+)] media-libs/libsndfile ) caps? ( >=sys-libs/libcap-ng-0.6.2 ) cups? ( net-print/cups ) gstreamer? ( >=media-libs/gstreamer-0.10:0.10 >=media-libs/gst-plugins-base-0.10:0.10 ) usb? ( virtual/libusb:0 ) readline? ( sys-libs/readline ) !net-wireless/bluez-libs !net-wireless/bluez-utils consolekit? ( || ( sys-auth/consolekit >=sys-apps/systemd-37 ) ) test-programs? ( dev-python/dbus-python dev-python/pygobject:2 ) >=app-admin/eselect-python-20091230 test-programs? ( =dev-lang/python-2* )
SLOT=0
SRC_URI=mirror://kernel/linux/bluetooth/bluez-4.99.tar.xz http://dev.gentoo.org/~pacho/bluez/oui-20120308.txt.xz
_eclasses_=autotools addbdf6cce5024ac93ad2084ad5e1d2d binutils-funcs 73669d0b20960c1cc54cf381a4b89e77 eutils 33ef77a15337022e05342d2c772a7a5a libtool 0fd90d183673bf1107465ec45849d1ea multilib 5f4ad6cf85e365e8f0c6050ddd21659e portability 0be430f759a631e692678ed796e09f5c python 6bbd984910e27780e5d0ea543d83ef84 systemd b5da52630b2559da43198bfb56ccacba toolchain-funcs 64fc271a237429f84f36b91c9f4b9912 user 9e552f935106ff0bc92af16da64b4b29
_md5_=c562317850a05d586686e6d2921ca2a6

View File

@ -1,13 +0,0 @@
DEFINED_PHASES=configure install prepare setup
DEPEND=>=dev-libs/glib-2.14:2 sys-apps/dbus >=sys-fs/udev-169 alsa? ( media-libs/alsa-lib[alsa_pcm_plugins_extplug(+),alsa_pcm_plugins_ioplug(+)] media-libs/libsndfile ) caps? ( >=sys-libs/libcap-ng-0.6.2 ) cups? ( net-print/cups ) gstreamer? ( >=media-libs/gstreamer-0.10:0.10 >=media-libs/gst-plugins-base-0.10:0.10 ) usb? ( virtual/libusb:0 ) readline? ( sys-libs/readline ) >=dev-util/pkgconfig-0.20 sys-devel/flex test-programs? ( >=dev-libs/check-0.9.8 ) || ( >=sys-devel/automake-1.11.1:1.11 ) >=sys-devel/autoconf-2.68 sys-devel/libtool >=app-admin/eselect-python-20091230 test-programs? ( =dev-lang/python-2* )
DESCRIPTION=Bluetooth Tools and System Daemons for Linux
EAPI=4
HOMEPAGE=http://www.bluez.org/
IUSE=alsa caps +consolekit cups debug gstreamer pcmcia test-programs usb readline
KEYWORDS=amd64 arm hppa ~ppc ~ppc64 x86
LICENSE=GPL-2 LGPL-2.1
RDEPEND=>=dev-libs/glib-2.14:2 sys-apps/dbus >=sys-fs/udev-169 alsa? ( media-libs/alsa-lib[alsa_pcm_plugins_extplug(+),alsa_pcm_plugins_ioplug(+)] media-libs/libsndfile ) caps? ( >=sys-libs/libcap-ng-0.6.2 ) cups? ( net-print/cups ) gstreamer? ( >=media-libs/gstreamer-0.10:0.10 >=media-libs/gst-plugins-base-0.10:0.10 ) usb? ( virtual/libusb:0 ) readline? ( sys-libs/readline ) !net-wireless/bluez-libs !net-wireless/bluez-utils consolekit? ( || ( sys-auth/consolekit >=sys-apps/systemd-37 ) ) test-programs? ( dev-python/dbus-python dev-python/pygobject:2 ) >=app-admin/eselect-python-20091230 test-programs? ( =dev-lang/python-2* )
SLOT=0
SRC_URI=mirror://kernel/linux/bluetooth/bluez-4.99.tar.xz http://dev.gentoo.org/~pacho/bluez/oui-20120308.txt.xz
_eclasses_=autotools addbdf6cce5024ac93ad2084ad5e1d2d binutils-funcs 73669d0b20960c1cc54cf381a4b89e77 eutils 33ef77a15337022e05342d2c772a7a5a libtool 0fd90d183673bf1107465ec45849d1ea multilib 5f4ad6cf85e365e8f0c6050ddd21659e portability 0be430f759a631e692678ed796e09f5c python 6bbd984910e27780e5d0ea543d83ef84 systemd b5da52630b2559da43198bfb56ccacba toolchain-funcs 64fc271a237429f84f36b91c9f4b9912 user 9e552f935106ff0bc92af16da64b4b29
_md5_=91598d2fbb104318e06beffe96196ce6

View File

@ -1,12 +0,0 @@
DEFINED_PHASES=compile install prepare
DEPEND=dev-libs/libgcrypt dev-libs/libnl:0 net-wireless/wireless-regdb dev-python/m2crypto
DESCRIPTION=Central Regulatory Domain Agent for wireless networks.
EAPI=2
HOMEPAGE=http://wireless.kernel.org/en/developers/Regulatory
KEYWORDS=amd64 arm ppc x86 ~amd64-linux ~x86-linux
LICENSE=as-is
RDEPEND=dev-libs/libgcrypt dev-libs/libnl:0 net-wireless/wireless-regdb
SLOT=0
SRC_URI=http://wireless.kernel.org/download/crda/crda-1.1.1.tar.bz2
_eclasses_=binutils-funcs 73669d0b20960c1cc54cf381a4b89e77 multilib 5f4ad6cf85e365e8f0c6050ddd21659e toolchain-funcs 64fc271a237429f84f36b91c9f4b9912
_md5_=921c24d7b09fc5013de407a426097604

View File

@ -1,11 +0,0 @@
DEFINED_PHASES=compile info install prepare setup unpack
DEPEND=dev-vcs/git
DESCRIPTION=GCT GDM7205 WiMAX SDK
EAPI=4
HOMEPAGE=http://www.gctsemi.com/
IUSE=cros_workon_tree_3dc85a711e8560caa66ff457623c985d8256abe2
KEYWORDS=amd64 arm x86
LICENSE=BSD
SLOT=0
_eclasses_=binutils-funcs 73669d0b20960c1cc54cf381a4b89e77 cros-workon 5f2f8a42fa8e9e59f25015d9167f93a4 eutils 33ef77a15337022e05342d2c772a7a5a flag-o-matic 01a8b1eb019305bc4b4a8bd0b04e4cd8 git-2 da60d6e85fa94cef4d510cab24e01e36 multilib 5f4ad6cf85e365e8f0c6050ddd21659e portability 0be430f759a631e692678ed796e09f5c toolchain-funcs 64fc271a237429f84f36b91c9f4b9912 user 9e552f935106ff0bc92af16da64b4b29
_md5_=66eeda10c80441104df126346ff2cec7

View File

@ -1,11 +0,0 @@
DEFINED_PHASES=compile info install prepare setup unpack
DEPEND=dev-vcs/git
DESCRIPTION=GCT GDM7205 WiMAX SDK
EAPI=4
HOMEPAGE=http://www.gctsemi.com/
IUSE=cros_workon_tree_
KEYWORDS=~amd64 ~arm ~x86
LICENSE=BSD
SLOT=0
_eclasses_=binutils-funcs 73669d0b20960c1cc54cf381a4b89e77 cros-workon 5f2f8a42fa8e9e59f25015d9167f93a4 eutils 33ef77a15337022e05342d2c772a7a5a flag-o-matic 01a8b1eb019305bc4b4a8bd0b04e4cd8 git-2 da60d6e85fa94cef4d510cab24e01e36 multilib 5f4ad6cf85e365e8f0c6050ddd21659e portability 0be430f759a631e692678ed796e09f5c toolchain-funcs 64fc271a237429f84f36b91c9f4b9912 user 9e552f935106ff0bc92af16da64b4b29
_md5_=fd30ce250542cfe65f62e37a5086b503

View File

@ -1,12 +0,0 @@
DEFINED_PHASES=compile configure info install postinst prepare setup unpack
DEPEND=ssl? ( dev-libs/openssl ) dev-libs/libnl:0 madwifi? ( || ( >net-wireless/madwifi-ng-tools-0.9.3 net-wireless/madwifi-old ) ) dev-vcs/git
DESCRIPTION=IEEE 802.11 wireless LAN Host AP daemon
EAPI=2
HOMEPAGE=http://hostap.epitest.fi
IUSE=ipv6 logwatch madwifi +ssl +wps cros_workon_tree_6fa69fc25b9ed779d0e60b293e3b7c40edc95bb5
KEYWORDS=amd64 arm x86
LICENSE=|| ( GPL-2 BSD )
RDEPEND=ssl? ( dev-libs/openssl ) dev-libs/libnl:0 madwifi? ( || ( >net-wireless/madwifi-ng-tools-0.9.3 net-wireless/madwifi-old ) )
SLOT=0
_eclasses_=binutils-funcs 73669d0b20960c1cc54cf381a4b89e77 cros-workon 5f2f8a42fa8e9e59f25015d9167f93a4 eutils 33ef77a15337022e05342d2c772a7a5a flag-o-matic 01a8b1eb019305bc4b4a8bd0b04e4cd8 git-2 da60d6e85fa94cef4d510cab24e01e36 multilib 5f4ad6cf85e365e8f0c6050ddd21659e portability 0be430f759a631e692678ed796e09f5c toolchain-funcs 64fc271a237429f84f36b91c9f4b9912 user 9e552f935106ff0bc92af16da64b4b29
_md5_=59dfe3483da54fa0518a9440223d2bb9

View File

@ -1,12 +0,0 @@
DEFINED_PHASES=compile configure info install postinst prepare setup unpack
DEPEND=ssl? ( dev-libs/openssl ) dev-libs/libnl:0 madwifi? ( || ( >net-wireless/madwifi-ng-tools-0.9.3 net-wireless/madwifi-old ) ) dev-vcs/git
DESCRIPTION=IEEE 802.11 wireless LAN Host AP daemon
EAPI=2
HOMEPAGE=http://hostap.epitest.fi
IUSE=ipv6 logwatch madwifi +ssl +wps cros_workon_tree_
KEYWORDS=~amd64 ~arm ~x86
LICENSE=|| ( GPL-2 BSD )
RDEPEND=ssl? ( dev-libs/openssl ) dev-libs/libnl:0 madwifi? ( || ( >net-wireless/madwifi-ng-tools-0.9.3 net-wireless/madwifi-old ) )
SLOT=0
_eclasses_=binutils-funcs 73669d0b20960c1cc54cf381a4b89e77 cros-workon 5f2f8a42fa8e9e59f25015d9167f93a4 eutils 33ef77a15337022e05342d2c772a7a5a flag-o-matic 01a8b1eb019305bc4b4a8bd0b04e4cd8 git-2 da60d6e85fa94cef4d510cab24e01e36 multilib 5f4ad6cf85e365e8f0c6050ddd21659e portability 0be430f759a631e692678ed796e09f5c toolchain-funcs 64fc271a237429f84f36b91c9f4b9912 user 9e552f935106ff0bc92af16da64b4b29
_md5_=86b8f0be48951a5d4adf7ca08d18aa56

View File

@ -1,11 +0,0 @@
DEFINED_PHASES=install
DEPEND=>=dev-libs/libnl-1.1 dev-util/pkgconfig
DESCRIPTION=nl80211-based configuration utility for wireless devices using the mac80211 kernel stack
HOMEPAGE=http://wireless.kernel.org/en/users/Documentation/iw
KEYWORDS=amd64 arm ppc x86 ~amd64-linux ~x86-linux
LICENSE=as-is
RDEPEND=>=dev-libs/libnl-1.1
SLOT=0
SRC_URI=http://wireless.kernel.org/download/iw/iw-0.9.22.tar.bz2
_eclasses_=binutils-funcs 73669d0b20960c1cc54cf381a4b89e77 multilib 5f4ad6cf85e365e8f0c6050ddd21659e toolchain-funcs 64fc271a237429f84f36b91c9f4b9912
_md5_=fcd477bbda16843500d4d84b2bbc0a6b

View File

@ -1,11 +0,0 @@
DEFINED_PHASES=install
DEPEND=>=dev-libs/libnl-1.1 dev-util/pkgconfig
DESCRIPTION=nl80211-based configuration utility for wireless devices using the mac80211 kernel stack
HOMEPAGE=http://wireless.kernel.org/en/users/Documentation/iw
KEYWORDS=amd64 arm ppc x86 ~amd64-linux ~x86-linux
LICENSE=as-is
RDEPEND=>=dev-libs/libnl-1.1
SLOT=0
SRC_URI=http://wireless.kernel.org/download/iw/iw-3.0.tar.bz2
_eclasses_=binutils-funcs 73669d0b20960c1cc54cf381a4b89e77 multilib 5f4ad6cf85e365e8f0c6050ddd21659e toolchain-funcs 64fc271a237429f84f36b91c9f4b9912
_md5_=fcd477bbda16843500d4d84b2bbc0a6b

View File

@ -1,12 +0,0 @@
DEFINED_PHASES=install prepare
DEPEND=>=dev-libs/libnl-1.1 dev-util/pkgconfig
DESCRIPTION=nl80211-based configuration utility for wireless devices using the mac80211 kernel stack
EAPI=2
HOMEPAGE=http://wireless.kernel.org/en/users/Documentation/iw
KEYWORDS=amd64 arm ~ppc x86 ~amd64-linux ~x86-linux
LICENSE=as-is
RDEPEND=>=dev-libs/libnl-1.1
SLOT=0
SRC_URI=http://linuxwireless.org/download/iw/iw-3.1.tar.bz2
_eclasses_=binutils-funcs 73669d0b20960c1cc54cf381a4b89e77 eutils 33ef77a15337022e05342d2c772a7a5a multilib 5f4ad6cf85e365e8f0c6050ddd21659e portability 0be430f759a631e692678ed796e09f5c toolchain-funcs 64fc271a237429f84f36b91c9f4b9912 user 9e552f935106ff0bc92af16da64b4b29
_md5_=d053798fd4fa8bc5001c0256b5d3209b

View File

@ -1,12 +0,0 @@
DEFINED_PHASES=install prepare
DEPEND=>=dev-libs/libnl-1.1 dev-util/pkgconfig
DESCRIPTION=nl80211-based configuration utility for wireless devices using the mac80211 kernel stack
EAPI=2
HOMEPAGE=http://wireless.kernel.org/en/users/Documentation/iw
KEYWORDS=amd64 arm ~ppc x86 ~amd64-linux ~x86-linux
LICENSE=as-is
RDEPEND=>=dev-libs/libnl-1.1
SLOT=0
SRC_URI=http://linuxwireless.org/download/iw/iw-3.1.tar.bz2
_eclasses_=binutils-funcs 73669d0b20960c1cc54cf381a4b89e77 eutils 33ef77a15337022e05342d2c772a7a5a multilib 5f4ad6cf85e365e8f0c6050ddd21659e portability 0be430f759a631e692678ed796e09f5c toolchain-funcs 64fc271a237429f84f36b91c9f4b9912 user 9e552f935106ff0bc92af16da64b4b29
_md5_=d053798fd4fa8bc5001c0256b5d3209b

View File

@ -1,12 +0,0 @@
DEFINED_PHASES=install prepare
DEPEND=>=dev-libs/libnl-1.1 dev-util/pkgconfig
DESCRIPTION=nl80211-based configuration utility for wireless devices using the mac80211 kernel stack
EAPI=2
HOMEPAGE=http://wireless.kernel.org/en/users/Documentation/iw
KEYWORDS=amd64 arm ~ppc x86 ~amd64-linux ~x86-linux
LICENSE=as-is
RDEPEND=>=dev-libs/libnl-1.1
SLOT=0
SRC_URI=http://linuxwireless.org/download/iw/iw-3.6.tar.bz2
_eclasses_=binutils-funcs 73669d0b20960c1cc54cf381a4b89e77 eutils 33ef77a15337022e05342d2c772a7a5a multilib 5f4ad6cf85e365e8f0c6050ddd21659e portability 0be430f759a631e692678ed796e09f5c toolchain-funcs 64fc271a237429f84f36b91c9f4b9912 user 9e552f935106ff0bc92af16da64b4b29
_md5_=79426318c8c8a335c358b84cb0d65481

View File

@ -1,12 +0,0 @@
DEFINED_PHASES=install prepare
DEPEND=>=dev-libs/libnl-1.1 dev-util/pkgconfig
DESCRIPTION=nl80211-based configuration utility for wireless devices using the mac80211 kernel stack
EAPI=2
HOMEPAGE=http://wireless.kernel.org/en/users/Documentation/iw
KEYWORDS=amd64 arm ~ppc x86 ~amd64-linux ~x86-linux
LICENSE=as-is
RDEPEND=>=dev-libs/libnl-1.1
SLOT=0
SRC_URI=http://linuxwireless.org/download/iw/iw-3.6.tar.bz2
_eclasses_=binutils-funcs 73669d0b20960c1cc54cf381a4b89e77 eutils 33ef77a15337022e05342d2c772a7a5a multilib 5f4ad6cf85e365e8f0c6050ddd21659e portability 0be430f759a631e692678ed796e09f5c toolchain-funcs 64fc271a237429f84f36b91c9f4b9912 user 9e552f935106ff0bc92af16da64b4b29
_md5_=79426318c8c8a335c358b84cb0d65481

View File

@ -1,9 +0,0 @@
DEFINED_PHASES=compile install
DEPEND=|| ( >=sys-fs/udev-096 >=sys-apps/hotplug-20040923 )
DESCRIPTION=Intel (R) Centrino Wireless-N 2200 ucode
HOMEPAGE=http://intellinuxwireless.org/?p=iwlwifi
KEYWORDS=amd64 x86
LICENSE=ipw3945
SLOT=0
SRC_URI=http://intellinuxwireless.org/iwlwifi/downloads/iwlwifi-2000-ucode-18.168.6.1.tgz
_md5_=c2571b8bea43fa79175916fdc4a35ba4

View File

@ -1,9 +0,0 @@
DEFINED_PHASES=compile install
DEPEND=|| ( >=sys-fs/udev-096 >=sys-apps/hotplug-20040923 )
DESCRIPTION=Intel (R) PRO/Wireless 3945ABG/BG Network Connection
HOMEPAGE=http://intellinuxwireless.org/?p=iwlwifi
KEYWORDS=amd64 x86
LICENSE=ipw3945
SLOT=0
SRC_URI=http://intellinuxwireless.org/iwlwifi/downloads/iwlwifi-3945-ucode-15.32.2.9.tgz
_md5_=fe623ff8b21dc78c96c5823960bbe6d4

View File

@ -1,9 +0,0 @@
DEFINED_PHASES=compile install
DEPEND=|| ( >=sys-fs/udev-096 >=sys-apps/hotplug-20040923 )
DESCRIPTION=Intel (R) Wireless WiFi 4965AGN ucode
HOMEPAGE=http://intellinuxwireless.org/?p=iwlwifi
KEYWORDS=amd64 x86
LICENSE=ipw3945
SLOT=0
SRC_URI=http://intellinuxwireless.org/iwlwifi/downloads/iwlwifi-4965-ucode-228.61.2.24.tgz
_md5_=3f69a332a1d5b1d6ae170cb235e8931d

View File

@ -1,9 +0,0 @@
DEFINED_PHASES=compile install
DEPEND=|| ( >=sys-fs/udev-096 >=sys-apps/hotplug-20040923 )
DESCRIPTION=Intel (R) Wireless WiFi Advanced N 6000 ucode
HOMEPAGE=http://intellinuxwireless.org/?p=iwlwifi
KEYWORDS=amd64 x86
LICENSE=ipw3945
SLOT=0
SRC_URI=http://intellinuxwireless.org/iwlwifi/downloads/iwlwifi-6000-ucode-9.221.4.1.tgz
_md5_=a8f6bbecc5cd2eecf6c8e2d487533b26

View File

@ -1,9 +0,0 @@
DEFINED_PHASES=compile install
DEPEND=|| ( >=sys-fs/udev-096 >=sys-apps/hotplug-20040923 )
DESCRIPTION=Intel (R) Wireless WiFi Advanced N 6000 ucode
HOMEPAGE=http://intellinuxwireless.org/?p=iwlwifi
KEYWORDS=amd64 x86
LICENSE=ipw3945
SLOT=0
SRC_URI=http://intellinuxwireless.org/iwlwifi/downloads/iwlwifi-6000g2a-ucode-17.168.5.2.tgz
_md5_=3bd9e9f81c495ccb9544cd064fe1f61b

View File

@ -1,9 +0,0 @@
DEFINED_PHASES=compile install
DEPEND=|| ( >=sys-fs/udev-096 >=sys-apps/hotplug-20040923 )
DESCRIPTION=Intel (R) Wireless WiFi Advanced N 6000 ucode
HOMEPAGE=http://intellinuxwireless.org/?p=iwlwifi
KEYWORDS=amd64 x86
LICENSE=ipw3945
SLOT=0
SRC_URI=http://intellinuxwireless.org/iwlwifi/downloads/iwlwifi-6000g2b-ucode-18.168.6.1.tgz
_md5_=6600761dac378f14fc8007a8217b84f1

View File

@ -1,9 +0,0 @@
DEFINED_PHASES=compile install
DEPEND=|| ( >=sys-fs/udev-096 >=sys-apps/hotplug-20040923 )
DESCRIPTION=Intel (R) Wireless WiFi Advanced N 6000 ucode
HOMEPAGE=http://intellinuxwireless.org/?p=iwlwifi
KEYWORDS=amd64 x86
LICENSE=ipw3945
SLOT=0
SRC_URI=http://intellinuxwireless.org/iwlwifi/downloads/iwlwifi-6050-ucode-41.28.5.1.tgz
_md5_=fcc3c261c789028a951a984d2a0be433

View File

@ -1,12 +0,0 @@
DEFINED_PHASES=info install setup unpack
DEPEND=dev-vcs/git
DESCRIPTION=Marvell SD8787 firmware image
EAPI=2
HOMEPAGE=http://www.marvell.com/
IUSE=cros_workon_tree_e678d0d27c25cba5abe0581e078ede22b87ba6ab
KEYWORDS=amd64 arm x86
LICENSE=Marvell International Ltd.
RESTRICT=binchecks strip test
SLOT=0
_eclasses_=binutils-funcs 73669d0b20960c1cc54cf381a4b89e77 cros-workon 5f2f8a42fa8e9e59f25015d9167f93a4 eutils 33ef77a15337022e05342d2c772a7a5a flag-o-matic 01a8b1eb019305bc4b4a8bd0b04e4cd8 git-2 da60d6e85fa94cef4d510cab24e01e36 multilib 5f4ad6cf85e365e8f0c6050ddd21659e portability 0be430f759a631e692678ed796e09f5c toolchain-funcs 64fc271a237429f84f36b91c9f4b9912 user 9e552f935106ff0bc92af16da64b4b29
_md5_=e70e379a7b45a9cbb807c3aa00bc4beb

View File

@ -1,12 +0,0 @@
DEFINED_PHASES=info install setup unpack
DEPEND=dev-vcs/git
DESCRIPTION=Marvell SD8787 firmware image
EAPI=2
HOMEPAGE=http://www.marvell.com/
IUSE=cros_workon_tree_
KEYWORDS=~amd64 ~arm ~x86
LICENSE=Marvell International Ltd.
RESTRICT=binchecks strip test
SLOT=0
_eclasses_=binutils-funcs 73669d0b20960c1cc54cf381a4b89e77 cros-workon 5f2f8a42fa8e9e59f25015d9167f93a4 eutils 33ef77a15337022e05342d2c772a7a5a flag-o-matic 01a8b1eb019305bc4b4a8bd0b04e4cd8 git-2 da60d6e85fa94cef4d510cab24e01e36 multilib 5f4ad6cf85e365e8f0c6050ddd21659e portability 0be430f759a631e692678ed796e09f5c toolchain-funcs 64fc271a237429f84f36b91c9f4b9912 user 9e552f935106ff0bc92af16da64b4b29
_md5_=0db79cbcf6f71483db023375b3484466

View File

@ -1,8 +0,0 @@
DEFINED_PHASES=install
DESCRIPTION=Ebuild that installs Realtek 2800 USB firmware.
EAPI=4
HOMEPAGE=http://git.kernel.org/?p=linux/kernel/git/firmware/linux-firmware.git
KEYWORDS=x86 arm amd64
LICENSE=ralink-firmware
SLOT=0
_md5_=c58aae91758bbf956e8fcb7307c0fa54

View File

@ -1,9 +0,0 @@
DEFINED_PHASES=compile install
DESCRIPTION=Binary regulatory database for CRDA
HOMEPAGE=http://wireless.kernel.org/en/developers/Regulatory
KEYWORDS=amd64 arm ppc x86 ~amd64-linux ~x86-linux
LICENSE=as-is
SLOT=0
SRC_URI=http://wireless.kernel.org/download/wireless-regdb/wireless-regdb-2010.11.24.tar.bz2
_eclasses_=binutils-funcs 73669d0b20960c1cc54cf381a4b89e77 multilib 5f4ad6cf85e365e8f0c6050ddd21659e toolchain-funcs 64fc271a237429f84f36b91c9f4b9912
_md5_=67ed208f197385a2f392006d4e39cfb8

View File

@ -1,12 +0,0 @@
DEFINED_PHASES=compile configure info install postinst prepare setup unpack
DEPEND=dev-libs/libnl:0 dbus? ( sys-apps/dbus ) kernel_linux? ( eap-sim? ( sys-apps/pcsc-lite ) madwifi? ( || ( >net-wireless/madwifi-ng-tools-0.9.3 net-wireless/madwifi-old ) ) ) !kernel_linux? ( net-libs/libpcap ) qt4? ( x11-libs/qt-gui:4 x11-libs/qt-svg:4 ) !qt4? ( qt3? ( x11-libs/qt:3 ) ) readline? ( sys-libs/ncurses sys-libs/readline ) ssl? ( dev-libs/openssl chromeos-base/chaps dev-libs/engine_pkcs11 ) !ssl? ( gnutls? ( net-libs/gnutls ) ) !ssl? ( !gnutls? ( dev-libs/libtommath ) ) dev-vcs/git
DESCRIPTION=IEEE 802.1X/WPA supplicant for secure wireless transfers
EAPI=2
HOMEPAGE=http://hostap.epitest.fi/wpa_supplicant/
IUSE=dbus debug gnutls eap-sim madwifi ps3 qt3 qt4 readline ssl wps kernel_linux kernel_FreeBSD cros_workon_tree_6fa69fc25b9ed779d0e60b293e3b7c40edc95bb5
KEYWORDS=amd64 arm x86
LICENSE=|| ( GPL-2 BSD )
RDEPEND=dev-libs/libnl:0 dbus? ( sys-apps/dbus ) kernel_linux? ( eap-sim? ( sys-apps/pcsc-lite ) madwifi? ( || ( >net-wireless/madwifi-ng-tools-0.9.3 net-wireless/madwifi-old ) ) ) !kernel_linux? ( net-libs/libpcap ) qt4? ( x11-libs/qt-gui:4 x11-libs/qt-svg:4 ) !qt4? ( qt3? ( x11-libs/qt:3 ) ) readline? ( sys-libs/ncurses sys-libs/readline ) ssl? ( dev-libs/openssl chromeos-base/chaps dev-libs/engine_pkcs11 ) !ssl? ( gnutls? ( net-libs/gnutls ) ) !ssl? ( !gnutls? ( dev-libs/libtommath ) )
SLOT=0
_eclasses_=base fc89786f3f7e7bcf03334359bd5b639b binutils-funcs 73669d0b20960c1cc54cf381a4b89e77 cros-workon 5f2f8a42fa8e9e59f25015d9167f93a4 eutils 33ef77a15337022e05342d2c772a7a5a flag-o-matic 01a8b1eb019305bc4b4a8bd0b04e4cd8 git-2 da60d6e85fa94cef4d510cab24e01e36 multilib 5f4ad6cf85e365e8f0c6050ddd21659e portability 0be430f759a631e692678ed796e09f5c qt3 823f11abd98cfc43cf92b8622e420f1f qt4 83eabd1192f3f2c5a649ba2422a14d00 toolchain-funcs 64fc271a237429f84f36b91c9f4b9912 user 9e552f935106ff0bc92af16da64b4b29 versionator 865bc8b2fc9fcfb6d520bdf5a110f5ed
_md5_=a57426a6ed0a168b7009db585a6a5548

View File

@ -1,12 +0,0 @@
DEFINED_PHASES=compile configure info install postinst prepare setup unpack
DEPEND=dev-libs/libnl:0 dbus? ( sys-apps/dbus ) kernel_linux? ( eap-sim? ( sys-apps/pcsc-lite ) madwifi? ( || ( >net-wireless/madwifi-ng-tools-0.9.3 net-wireless/madwifi-old ) ) ) !kernel_linux? ( net-libs/libpcap ) qt4? ( x11-libs/qt-gui:4 x11-libs/qt-svg:4 ) !qt4? ( qt3? ( x11-libs/qt:3 ) ) readline? ( sys-libs/ncurses sys-libs/readline ) ssl? ( dev-libs/openssl chromeos-base/chaps dev-libs/engine_pkcs11 ) !ssl? ( gnutls? ( net-libs/gnutls ) ) !ssl? ( !gnutls? ( dev-libs/libtommath ) ) dev-vcs/git
DESCRIPTION=IEEE 802.1X/WPA supplicant for secure wireless transfers
EAPI=2
HOMEPAGE=http://hostap.epitest.fi/wpa_supplicant/
IUSE=dbus debug gnutls eap-sim madwifi ps3 qt3 qt4 readline ssl wps kernel_linux kernel_FreeBSD cros_workon_tree_
KEYWORDS=~amd64 ~arm ~x86
LICENSE=|| ( GPL-2 BSD )
RDEPEND=dev-libs/libnl:0 dbus? ( sys-apps/dbus ) kernel_linux? ( eap-sim? ( sys-apps/pcsc-lite ) madwifi? ( || ( >net-wireless/madwifi-ng-tools-0.9.3 net-wireless/madwifi-old ) ) ) !kernel_linux? ( net-libs/libpcap ) qt4? ( x11-libs/qt-gui:4 x11-libs/qt-svg:4 ) !qt4? ( qt3? ( x11-libs/qt:3 ) ) readline? ( sys-libs/ncurses sys-libs/readline ) ssl? ( dev-libs/openssl chromeos-base/chaps dev-libs/engine_pkcs11 ) !ssl? ( gnutls? ( net-libs/gnutls ) ) !ssl? ( !gnutls? ( dev-libs/libtommath ) )
SLOT=0
_eclasses_=base fc89786f3f7e7bcf03334359bd5b639b binutils-funcs 73669d0b20960c1cc54cf381a4b89e77 cros-workon 5f2f8a42fa8e9e59f25015d9167f93a4 eutils 33ef77a15337022e05342d2c772a7a5a flag-o-matic 01a8b1eb019305bc4b4a8bd0b04e4cd8 git-2 da60d6e85fa94cef4d510cab24e01e36 multilib 5f4ad6cf85e365e8f0c6050ddd21659e portability 0be430f759a631e692678ed796e09f5c qt3 823f11abd98cfc43cf92b8622e420f1f qt4 83eabd1192f3f2c5a649ba2422a14d00 toolchain-funcs 64fc271a237429f84f36b91c9f4b9912 user 9e552f935106ff0bc92af16da64b4b29 versionator 865bc8b2fc9fcfb6d520bdf5a110f5ed
_md5_=34dc590d42c1fb333c869cc69f5fe7de

View File

@ -1,30 +0,0 @@
# Copyright 1999-2010 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
EAPI="2"
CROS_WORKON_COMMIT="52a5bdaa8930c14ee42518354de3e5ec09911c6b"
CROS_WORKON_TREE="a214d22b4c8a8f3cf46dd4a8b80451231eedb9dc"
CROS_WORKON_PROJECT="chromiumos/third_party/atheros"
inherit cros-workon
DESCRIPTION="Atheros AR300x firmware"
HOMEPAGE="http://www.atheros.com/"
LICENSE="Atheros"
SLOT="0"
KEYWORDS="amd64 arm x86"
IUSE=""
RESTRICT="binchecks strip test"
CROS_WORKON_LOCALNAME="atheros"
DEPEND=""
RDEPEND=""
src_install() {
src_dir="${S}"/ath3k/files/firmware
dodir /lib/firmware || die
insinto /lib/firmware
doins -r ${src_dir}/* || die \
"failed installing from ${src_dir} to ${D}/lib/firmware"
}

View File

@ -1,28 +0,0 @@
# Copyright 1999-2010 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
EAPI="2"
CROS_WORKON_PROJECT="chromiumos/third_party/atheros"
inherit cros-workon
DESCRIPTION="Atheros AR300x firmware"
HOMEPAGE="http://www.atheros.com/"
LICENSE="Atheros"
SLOT="0"
KEYWORDS="~amd64 ~arm ~x86"
IUSE=""
RESTRICT="binchecks strip test"
CROS_WORKON_LOCALNAME="atheros"
DEPEND=""
RDEPEND=""
src_install() {
src_dir="${S}"/ath3k/files/firmware
dodir /lib/firmware || die
insinto /lib/firmware
doins -r ${src_dir}/* || die \
"failed installing from ${src_dir} to ${D}/lib/firmware"
}

View File

@ -1,30 +0,0 @@
# Copyright 1999-2009 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
EAPI="2"
CROS_WORKON_COMMIT="52a5bdaa8930c14ee42518354de3e5ec09911c6b"
CROS_WORKON_TREE="a214d22b4c8a8f3cf46dd4a8b80451231eedb9dc"
CROS_WORKON_PROJECT="chromiumos/third_party/atheros"
inherit cros-workon
DESCRIPTION="Atheros AR600x firmware"
HOMEPAGE="http://www.atheros.com/"
LICENSE="Atheros"
SLOT="0"
KEYWORDS="amd64 arm x86"
IUSE=""
RESTRICT="binchecks strip test"
CROS_WORKON_LOCALNAME="atheros"
DEPEND=""
RDEPEND=""
src_install() {
src_dir="${S}"/ath6k/files/firmware
dodir /lib/firmware || die
insinto /lib/firmware
doins -r ${src_dir}/* || die \
"failed installing from ${src_dir} to ${D}/lib/firmware"
}

View File

@ -1,28 +0,0 @@
# Copyright 1999-2009 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
EAPI="2"
CROS_WORKON_PROJECT="chromiumos/third_party/atheros"
inherit cros-workon
DESCRIPTION="Atheros AR600x firmware"
HOMEPAGE="http://www.atheros.com/"
LICENSE="Atheros"
SLOT="0"
KEYWORDS="~amd64 ~arm ~x86"
IUSE=""
RESTRICT="binchecks strip test"
CROS_WORKON_LOCALNAME="atheros"
DEPEND=""
RDEPEND=""
src_install() {
src_dir="${S}"/ath6k/files/firmware
dodir /lib/firmware || die
insinto /lib/firmware
doins -r ${src_dir}/* || die \
"failed installing from ${src_dir} to ${D}/lib/firmware"
}

View File

@ -1,2 +0,0 @@
DIST bluez-4.99.tar.xz 859756 SHA256 41889a91a5516eec26c4e59095ceea076de158b1ac38fd0ede9034596f511d3b SHA512 79e36a65ff9ff9c3311a8ef4819692503bb02f048a3c42dd0b9512749fb8e4d810eb832f211fb7dfebc7b6b5bf82a9363edd15741d62595f36d782804bb39ac3 WHIRLPOOL 32b8e3f67c846a17e7335395021008c181a2645fdb08b4ebe36bf4ad5221eef00f86ec7ef0d1de19c64741c884376666677ca9e129868dcaa18a5d4c0737c894
DIST oui-20120308.txt.xz 546720 SHA256 4256ba96a522333a41fd058e1880a04f77566c9ad0a62d3c0d7ac422bf8b9086 SHA512 f749b3ce9b6173760319849f1e4699f02d4f8628de78d0bc39c08b01331567b60a9bd3303a84982ad23bc6cbe7b6d9f27e2e26f699a818dac0e0e8fa6ddb44fa WHIRLPOOL 0797457e3bb54d49b295547a47894258c2c5a9954ca87c44948bdb57781e11c84d2d1be9cf6d3deb0d062e4a98b0b1fb406a1f0fbeb9d0a294da624c2e90f9ee

View File

@ -1,165 +0,0 @@
# Copyright 1999-2012 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/net-wireless/bluez/bluez-4.99.ebuild,v 1.7 2012/04/15 16:53:41 maekke Exp $
EAPI="4"
PYTHON_DEPEND="test-programs? 2"
inherit autotools multilib eutils systemd python
DESCRIPTION="Bluetooth Tools and System Daemons for Linux"
HOMEPAGE="http://www.bluez.org/"
# Because of oui.txt changing from time to time without noticement, we need to supply it
# ourselves instead of using http://standards.ieee.org/regauth/oui/oui.txt directly.
# See bugs #345263 and #349473 for reference.
OUIDATE="20120308"
SRC_URI="mirror://kernel/linux/bluetooth/bluez-${PV}.tar.xz
http://dev.gentoo.org/~pacho/bluez/oui-${OUIDATE}.txt.xz"
S="${WORKDIR}/bluez-${PV}"
LICENSE="GPL-2 LGPL-2.1"
SLOT="0"
KEYWORDS="amd64 arm hppa ~ppc ~ppc64 x86"
IUSE="alsa caps +consolekit cups debug gstreamer pcmcia test-programs usb readline"
CDEPEND="
>=dev-libs/glib-2.14:2
sys-apps/dbus
>=sys-fs/udev-169
alsa? (
media-libs/alsa-lib[alsa_pcm_plugins_extplug(+),alsa_pcm_plugins_ioplug(+)]
media-libs/libsndfile
)
caps? ( >=sys-libs/libcap-ng-0.6.2 )
cups? ( net-print/cups )
gstreamer? (
>=media-libs/gstreamer-0.10:0.10
>=media-libs/gst-plugins-base-0.10:0.10
)
usb? ( virtual/libusb:0 )
readline? ( sys-libs/readline )
"
DEPEND="${CDEPEND}
>=dev-util/pkgconfig-0.20
sys-devel/flex
test-programs? ( >=dev-libs/check-0.9.8 )
"
RDEPEND="${CDEPEND}
!net-wireless/bluez-libs
!net-wireless/bluez-utils
consolekit? (
|| ( sys-auth/consolekit
>=sys-apps/systemd-37 )
)
test-programs? (
dev-python/dbus-python
dev-python/pygobject:2
)
"
DOCS=( AUTHORS ChangeLog README )
pkg_setup() {
if use test-programs; then
python_pkg_setup
fi
}
src_prepare() {
# Change the default D-Bus configuration; the daemon is run as
# bluetooth, not root; we don't use the lp user, and we use the
# chronos user instead of at_console
epatch "${FILESDIR}/${PN}-dbus.patch"
# Change the default SDP Server socket path to a sub-directory
# under /var/run, since /var/run is not writeable by the bluetooth
# user.
epatch "${FILESDIR}/${PN}-sdp-path.patch"
# Disable initial radio power for new adapters
epatch "${FILESDIR}/${PN}-initially-powered.patch"
# Automatic pairing support, including keyboard pairing support.
# (accepted upstream, can be dropped for next release)
epatch "${FILESDIR}/${P}-autopair-0001-Rename-AUTH_TYPE_NOTIFY-to-AUTH_TYPE_NOTIFY_PASSKEY.patch"
epatch "${FILESDIR}/${P}-autopair-0002-Pass-passkey-by-pointer-rather-than-by-value.patch"
epatch "${FILESDIR}/${P}-autopair-0003-agent-add-DisplayPinCode-method.patch"
epatch "${FILESDIR}/${P}-autopair-0004-Add-AUTH_TYPE_NOTIFY_PASSKEY-to-device_request_authe.patch"
epatch "${FILESDIR}/${P}-autopair-0005-Add-display-parameter-to-plugin-pincode-callback.patch"
epatch "${FILESDIR}/${P}-autopair-0006-Display-PIN-generated-by-plugin.patch"
epatch "${FILESDIR}/${P}-autopair-0007-doc-document-DisplayPinCode.patch"
epatch "${FILESDIR}/${P}-autopair-0008-simple-agent-add-DisplayPinCode.patch"
epatch "${FILESDIR}/${P}-autopair-0009-Add-support-for-retrying-a-bonding.patch"
epatch "${FILESDIR}/${P}-autopair-0010-plugin-Add-bonding-callback-support-for-plugins.patch"
epatch "${FILESDIR}/${P}-autopair-0011-bonding-retry-if-callback-returns-TRUE.patch"
epatch "${FILESDIR}/${P}-autopair-0012-bonding-call-plugin-callback-on-cancellation.patch"
epatch "${FILESDIR}/${P}-autopair-0013-autopair-Add-autopair-plugin.patch"
# Automatic pairing of dumb devices. Not yet submitted upstream
# so kept as a separate patch on top of the above series.
epatch "${FILESDIR}/${PN}-autopair.patch"
eautoreconf
if use cups; then
sed -i \
-e "s:cupsdir = \$(libdir)/cups:cupsdir = `cups-config --serverbin`:" \
Makefile.tools Makefile.in || die
fi
}
src_configure() {
use readline || export ac_cv_header_readline_readline_h=no
econf \
--enable-hid2hci \
--enable-audio \
--enable-bccmd \
--enable-datafiles \
--enable-dfutool \
--enable-input \
--enable-network \
--enable-serial \
--enable-service \
--enable-tools \
--disable-hal \
--localstatedir=/var \
--with-systemdunitdir="$(systemd_get_unitdir)" \
--with-ouifile=/usr/share/misc/oui.txt \
$(use_enable alsa) \
$(use_enable caps capng) \
$(use_enable cups) \
$(use_enable debug) \
$(use_enable gstreamer) \
$(use_enable pcmcia) \
$(use_enable test-programs test) \
$(use_enable usb) \
--enable-health \
--enable-wiimote \
--enable-dbusoob \
--enable-autopair
}
src_install() {
if use test-programs ; then
cd "${S}/test"
dobin simple-agent simple-endpoint simple-service
dobin monitor-bluetooth
dobin avtest gaptest hsmicro hsplay hstest ipctest l2test
dobin lmptest rctest scotest sdptest
newbin list-devices list-bluetooth-devices
rm test-textfile.{c,o} || die # bug #356529
for b in apitest test-* ; do
newbin "${b}" "bluez-${b}"
done
insinto /usr/share/doc/${PF}/test-services
doins service-*
dobin "${FILESDIR}/bluetooth-unpair"
dobin "${FILESDIR}/bluetooth-unpair-all"
python_convert_shebangs -r 2 "${ED}"
cd "${S}"
fi
}

View File

@ -1,22 +0,0 @@
#!/usr/bin/env python
# Copyright (c) 2012 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import dbus
import sys
bus = dbus.SystemBus()
bluez = bus.get_object('org.bluez', '/')
adapter_path = bluez.DefaultAdapter(dbus_interface='org.bluez.Manager')
adapter = bus.get_object('org.bluez', adapter_path)
device_path = adapter.FindDevice(sys.argv[1],
dbus_interface='org.bluez.Adapter')
device = bus.get_object('org.bluez', device_path)
adapter.RemoveDevice(device, dbus_interface='org.bluez.Adapter')

View File

@ -1,46 +0,0 @@
#!/usr/bin/env python
# Copyright (c) 2012 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import dbus
import sys
bus = dbus.SystemBus()
bluez = bus.get_object('org.bluez', '/')
adapter_path = bluez.DefaultAdapter(dbus_interface='org.bluez.Manager')
adapter = bus.get_object('org.bluez', adapter_path)
all_the_things = """\
.
, = ,
,, .,,
,,. , .. ,, .,,,
,,,, ,. ,, ,,.:,,,.
,,,,, ,,.,, .,,,,i,,,
,,,,,,,YtY,,,+,,R,,
, ,,,,,,V.. tY# =,I,.
,,. ,,,,,,,V W R,;,
.,,. ,,,,: Y R=YW +,,
I; ,,,,,,,,: Y:#### =,
i.., ,,,,,,,,iX#####, , ., ,,
....t ,,,,,,,,,: :####X V,,, ,,,
i.... ,,,,,,,,,t I###+ X,,..,,,.
I.., ,,,,,,,,V =##Y, YR,,,,,
Xt .,,,,,,+,,R , BYV,,,,
,X:,,,,,,=,,,,R. ,RYYY,,,
,. :X,,,,V,,,,,,RYYYYYYY,,,,,,,,.
,,,,tX,t,,,,,,,,,YYYYYYYX,,,,,,,,,.
,,,,BB,,,,,,,,,,YYYYYYYV,,,,,,,
,,,,,BB,,,,,,,,,XYYYYYYY,,,.
,,,,,XI,,,,,,,,YYYYYYYY,,
,,,,,X:,,,,,,,YYYYYYYY,,. """
print all_the_things
for device_path in adapter.ListDevices(dbus_interface='org.bluez.Adapter'):
device = bus.get_object('org.bluez', device_path)
adapter.RemoveDevice(device, dbus_interface='org.bluez.Adapter')

View File

@ -1,83 +0,0 @@
From be1631d70689cfde701e9a1642a5afad11252af7 Mon Sep 17 00:00:00 2001
From: Scott James Remnant <scott@netsplit.com>
Date: Mon, 23 Jan 2012 10:40:25 -0800
Subject: [PATCH 01/13] Rename AUTH_TYPE_NOTIFY to AUTH_TYPE_NOTIFY_PASSKEY
This makes room for additional notification types to be added.
---
src/device.c | 8 ++++----
src/device.h | 2 +-
src/event.c | 4 ++--
3 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/src/device.c b/src/device.c
index dfc8e59..92c13f5 100644
--- a/src/device.c
+++ b/src/device.c
@@ -2453,7 +2453,7 @@ void device_simple_pairing_complete(struct btd_device *device, uint8_t status)
{
struct authentication_req *auth = device->authr;
- if (auth && auth->type == AUTH_TYPE_NOTIFY && auth->agent)
+ if (auth && auth->type == AUTH_TYPE_NOTIFY_PASSKEY && auth->agent)
agent_cancel(auth->agent);
}
@@ -2470,7 +2470,7 @@ void device_bonding_complete(struct btd_device *device, uint8_t status)
DBG("bonding %p status 0x%02x", bonding, status);
- if (auth && auth->type == AUTH_TYPE_NOTIFY && auth->agent)
+ if (auth && auth->type == AUTH_TYPE_NOTIFY_PASSKEY && auth->agent)
agent_cancel(auth->agent);
if (status) {
@@ -2724,7 +2724,7 @@ int device_request_authentication(struct btd_device *device, auth_type_t type,
err = agent_request_confirmation(agent, device, passkey,
confirm_cb, auth, NULL);
break;
- case AUTH_TYPE_NOTIFY:
+ case AUTH_TYPE_NOTIFY_PASSKEY:
err = agent_display_passkey(agent, device, passkey);
break;
default:
@@ -2764,7 +2764,7 @@ static void cancel_authentication(struct authentication_req *auth)
case AUTH_TYPE_PASSKEY:
((agent_passkey_cb) auth->cb)(agent, &err, 0, device);
break;
- case AUTH_TYPE_NOTIFY:
+ case AUTH_TYPE_NOTIFY_PASSKEY:
/* User Notify doesn't require any reply */
break;
}
diff --git a/src/device.h b/src/device.h
index 7cb9bb2..aa7f2f1 100644
--- a/src/device.h
+++ b/src/device.h
@@ -30,7 +30,7 @@ typedef enum {
AUTH_TYPE_PINCODE,
AUTH_TYPE_PASSKEY,
AUTH_TYPE_CONFIRM,
- AUTH_TYPE_NOTIFY,
+ AUTH_TYPE_NOTIFY_PASSKEY,
} auth_type_t;
struct btd_device *device_create(DBusConnection *conn,
diff --git a/src/event.c b/src/event.c
index 113a2b6..95cdbdb 100644
--- a/src/event.c
+++ b/src/event.c
@@ -202,8 +202,8 @@ int btd_event_user_notify(bdaddr_t *sba, bdaddr_t *dba, uint32_t passkey)
if (!get_adapter_and_device(sba, dba, &adapter, &device, TRUE))
return -ENODEV;
- return device_request_authentication(device, AUTH_TYPE_NOTIFY, passkey,
- FALSE, NULL);
+ return device_request_authentication(device, AUTH_TYPE_NOTIFY_PASSKEY,
+ passkey, FALSE, NULL);
}
void btd_event_simple_pairing_complete(bdaddr_t *local, bdaddr_t *peer,
--
1.7.7.3

View File

@ -1,107 +0,0 @@
From 888f24266b8ff06d7007afb5e6a38ba621750451 Mon Sep 17 00:00:00 2001
From: Scott James Remnant <scott@netsplit.com>
Date: Mon, 23 Jan 2012 10:43:48 -0800
Subject: [PATCH 02/13] Pass passkey by pointer rather than by value
This allows alternate data of a different type to be passed to
device_request_authentication() for other notification types such
as those that require a PIN.
---
src/device.c | 9 +++++----
src/device.h | 2 +-
src/event.c | 8 ++++----
3 files changed, 10 insertions(+), 9 deletions(-)
diff --git a/src/device.c b/src/device.c
index 92c13f5..8a2ae9d 100644
--- a/src/device.c
+++ b/src/device.c
@@ -2681,7 +2681,7 @@ done:
}
int device_request_authentication(struct btd_device *device, auth_type_t type,
- uint32_t passkey, gboolean secure, void *cb)
+ void *data, gboolean secure, void *cb)
{
struct authentication_req *auth;
struct agent *agent;
@@ -2707,7 +2707,6 @@ int device_request_authentication(struct btd_device *device, auth_type_t type,
auth->device = device;
auth->cb = cb;
auth->type = type;
- auth->passkey = passkey;
auth->secure = secure;
device->authr = auth;
@@ -2721,11 +2720,13 @@ int device_request_authentication(struct btd_device *device, auth_type_t type,
auth, NULL);
break;
case AUTH_TYPE_CONFIRM:
- err = agent_request_confirmation(agent, device, passkey,
+ auth->passkey = *(uint32_t *)data;
+ err = agent_request_confirmation(agent, device, auth->passkey,
confirm_cb, auth, NULL);
break;
case AUTH_TYPE_NOTIFY_PASSKEY:
- err = agent_display_passkey(agent, device, passkey);
+ auth->passkey = *(uint32_t *)data;
+ err = agent_display_passkey(agent, device, auth->passkey);
break;
default:
err = -EINVAL;
diff --git a/src/device.h b/src/device.h
index aa7f2f1..998aee7 100644
--- a/src/device.h
+++ b/src/device.h
@@ -83,7 +83,7 @@ gboolean device_is_creating(struct btd_device *device, const char *sender);
gboolean device_is_bonding(struct btd_device *device, const char *sender);
void device_cancel_bonding(struct btd_device *device, uint8_t status);
int device_request_authentication(struct btd_device *device, auth_type_t type,
- uint32_t passkey, gboolean secure, void *cb);
+ void *data, gboolean secure, void *cb);
void device_cancel_authentication(struct btd_device *device, gboolean aborted);
gboolean device_is_authenticating(struct btd_device *device);
gboolean device_is_authorizing(struct btd_device *device);
diff --git a/src/event.c b/src/event.c
index 95cdbdb..7d66b6d 100644
--- a/src/event.c
+++ b/src/event.c
@@ -130,7 +130,7 @@ int btd_event_request_pin(bdaddr_t *sba, bdaddr_t *dba, gboolean secure)
return 0;
}
- return device_request_authentication(device, AUTH_TYPE_PINCODE, 0,
+ return device_request_authentication(device, AUTH_TYPE_PINCODE, NULL,
secure, pincode_cb);
}
@@ -179,7 +179,7 @@ int btd_event_user_confirm(bdaddr_t *sba, bdaddr_t *dba, uint32_t passkey)
return -ENODEV;
return device_request_authentication(device, AUTH_TYPE_CONFIRM,
- passkey, FALSE, confirm_cb);
+ &passkey, FALSE, confirm_cb);
}
int btd_event_user_passkey(bdaddr_t *sba, bdaddr_t *dba)
@@ -190,7 +190,7 @@ int btd_event_user_passkey(bdaddr_t *sba, bdaddr_t *dba)
if (!get_adapter_and_device(sba, dba, &adapter, &device, TRUE))
return -ENODEV;
- return device_request_authentication(device, AUTH_TYPE_PASSKEY, 0,
+ return device_request_authentication(device, AUTH_TYPE_PASSKEY, NULL,
FALSE, passkey_cb);
}
@@ -203,7 +203,7 @@ int btd_event_user_notify(bdaddr_t *sba, bdaddr_t *dba, uint32_t passkey)
return -ENODEV;
return device_request_authentication(device, AUTH_TYPE_NOTIFY_PASSKEY,
- passkey, FALSE, NULL);
+ &passkey, FALSE, NULL);
}
void btd_event_simple_pairing_complete(bdaddr_t *local, bdaddr_t *peer,
--
1.7.7.3

View File

@ -1,161 +0,0 @@
From e84af9f6ba447c540512d56ccc7326af621749bc Mon Sep 17 00:00:00 2001
From: Scott James Remnant <scott@netsplit.com>
Date: Mon, 23 Jan 2012 10:56:56 -0800
Subject: [PATCH 03/13] agent: add DisplayPinCode method
In constrast to DisplayPasskey, this sends a UTF-8 string PIN code
to the agent; also we support a callback for the case where the
Agent doesn't implement this new method so we can fallback.
---
src/agent.c | 112 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-
src/agent.h | 4 ++
2 files changed, 115 insertions(+), 1 deletions(-)
diff --git a/src/agent.c b/src/agent.c
index 9b942e8..23e3b43 100644
--- a/src/agent.c
+++ b/src/agent.c
@@ -52,7 +52,8 @@ typedef enum {
AGENT_REQUEST_CONFIRMATION,
AGENT_REQUEST_PINCODE,
AGENT_REQUEST_AUTHORIZE,
- AGENT_REQUEST_CONFIRM_MODE
+ AGENT_REQUEST_CONFIRM_MODE,
+ AGENT_REQUEST_DISPLAY_PINCODE,
} agent_request_type_t;
struct agent {
@@ -699,6 +700,115 @@ int agent_display_passkey(struct agent *agent, struct btd_device *device,
return 0;
}
+static void display_pincode_reply(DBusPendingCall *call, void *user_data)
+{
+ struct agent_request *req = user_data;
+ struct agent *agent = req->agent;
+ DBusMessage *message;
+ DBusError err;
+ agent_cb cb = req->cb;
+
+ /* clear agent->request early; our callback will likely try
+ * another request */
+ agent->request = NULL;
+
+ /* steal_reply will always return non-NULL since the callback
+ * is only called after a reply has been received */
+ message = dbus_pending_call_steal_reply(call);
+
+ dbus_error_init(&err);
+ if (dbus_set_error_from_message(&err, message)) {
+ error("Agent replied with an error: %s, %s",
+ err.name, err.message);
+
+ cb(agent, &err, req->user_data);
+
+ if (dbus_error_has_name(&err, DBUS_ERROR_NO_REPLY)) {
+ agent_cancel(agent);
+ dbus_message_unref(message);
+ dbus_error_free(&err);
+ return;
+ }
+
+ dbus_error_free(&err);
+ goto done;
+ }
+
+ dbus_error_init(&err);
+ if (!dbus_message_get_args(message, &err, DBUS_TYPE_INVALID)) {
+ error("Wrong reply signature: %s", err.message);
+ cb(agent, &err, req->user_data);
+ dbus_error_free(&err);
+ goto done;
+ }
+
+ cb(agent, NULL, req->user_data);
+done:
+ dbus_message_unref(message);
+
+ agent_request_free(req, TRUE);
+}
+
+static int display_pincode_request_new(struct agent_request *req,
+ const char *device_path,
+ const char *pincode)
+{
+ struct agent *agent = req->agent;
+
+ req->msg = dbus_message_new_method_call(agent->name, agent->path,
+ "org.bluez.Agent", "DisplayPinCode");
+ if (req->msg == NULL) {
+ error("Couldn't allocate D-Bus message");
+ return -ENOMEM;
+ }
+
+ dbus_message_append_args(req->msg,
+ DBUS_TYPE_OBJECT_PATH, &device_path,
+ DBUS_TYPE_STRING, &pincode,
+ DBUS_TYPE_INVALID);
+
+ if (dbus_connection_send_with_reply(connection, req->msg,
+ &req->call, REQUEST_TIMEOUT) == FALSE) {
+ error("D-Bus send failed");
+ return -EIO;
+ }
+
+ dbus_pending_call_set_notify(req->call, display_pincode_reply,
+ req, NULL);
+
+ return 0;
+}
+
+int agent_display_pincode(struct agent *agent, struct btd_device *device,
+ const char *pincode, agent_cb cb,
+ void *user_data, GDestroyNotify destroy)
+{
+ struct agent_request *req;
+ const gchar *dev_path = device_get_path(device);
+ int err;
+
+ if (agent->request)
+ return -EBUSY;
+
+ DBG("Calling Agent.DisplayPinCode: name=%s, path=%s, pincode=%s",
+ agent->name, agent->path, pincode);
+
+ req = agent_request_new(agent, AGENT_REQUEST_DISPLAY_PINCODE, cb,
+ user_data, destroy);
+
+ err = display_pincode_request_new(req, dev_path, pincode);
+ if (err < 0)
+ goto failed;
+
+ agent->request = req;
+
+ return 0;
+
+failed:
+ agent_request_free(req, FALSE);
+ return err;
+}
+
uint8_t agent_get_io_capability(struct agent *agent)
{
return agent->capability;
diff --git a/src/agent.h b/src/agent.h
index f62bf3b..69ad42b 100644
--- a/src/agent.h
+++ b/src/agent.h
@@ -64,6 +64,10 @@ int agent_request_confirmation(struct agent *agent, struct btd_device *device,
int agent_display_passkey(struct agent *agent, struct btd_device *device,
uint32_t passkey);
+int agent_display_pincode(struct agent *agent, struct btd_device *device,
+ const char *pincode, agent_cb cb,
+ void *user_data, GDestroyNotify destroy);
+
int agent_cancel(struct agent *agent);
gboolean agent_is_busy(struct agent *agent, void *user_data);
--
1.7.7.3

View File

@ -1,151 +0,0 @@
From 16583671c03b871003430e433ddf197833ea0086 Mon Sep 17 00:00:00 2001
From: Scott James Remnant <scott@netsplit.com>
Date: Mon, 23 Jan 2012 15:16:40 -0800
Subject: [PATCH 04/13] Add AUTH_TYPE_NOTIFY_PASSKEY to
device_request_authentication
This new authentication type accepts a pincode and calls the
DisplayPinCode agent method, a fallback is provided so that if the
method is not implemented the older RequestPinCode method is used
instead.
Due to this fallback, the agent_pincode_cb is used and calling
functions should send the pincode passed to the callback to the
adapter, which may differ from that generated.
---
src/device.c | 59 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++-
src/device.h | 1 +
2 files changed, 58 insertions(+), 2 deletions(-)
diff --git a/src/device.c b/src/device.c
index 8a2ae9d..f32666e 100644
--- a/src/device.c
+++ b/src/device.c
@@ -93,6 +93,7 @@ struct authentication_req {
struct agent *agent;
struct btd_device *device;
uint32_t passkey;
+ char *pincode;
gboolean secure;
};
@@ -277,6 +278,8 @@ static void device_free(gpointer user_data)
DBG("%p", device);
+ if (device->authr)
+ g_free(device->authr->pincode);
g_free(device->authr);
g_free(device->path);
g_free(device->alias);
@@ -2453,12 +2456,15 @@ void device_simple_pairing_complete(struct btd_device *device, uint8_t status)
{
struct authentication_req *auth = device->authr;
- if (auth && auth->type == AUTH_TYPE_NOTIFY_PASSKEY && auth->agent)
+ if (auth && (auth->type == AUTH_TYPE_NOTIFY_PASSKEY
+ || auth->type == AUTH_TYPE_NOTIFY_PINCODE) && auth->agent)
agent_cancel(auth->agent);
}
static void device_auth_req_free(struct btd_device *device)
{
+ if (device->authr)
+ g_free(device->authr->pincode);
g_free(device->authr);
device->authr = NULL;
}
@@ -2470,7 +2476,8 @@ void device_bonding_complete(struct btd_device *device, uint8_t status)
DBG("bonding %p status 0x%02x", bonding, status);
- if (auth && auth->type == AUTH_TYPE_NOTIFY_PASSKEY && auth->agent)
+ if (auth && (auth->type == AUTH_TYPE_NOTIFY_PASSKEY
+ || auth->type == AUTH_TYPE_NOTIFY_PINCODE) && auth->agent)
agent_cancel(auth->agent);
if (status) {
@@ -2680,6 +2687,46 @@ done:
device->authr->agent = NULL;
}
+static void display_pincode_cb(struct agent *agent, DBusError *err, void *data)
+{
+ struct authentication_req *auth = data;
+ struct btd_device *device = auth->device;
+ struct btd_adapter *adapter = device_get_adapter(device);
+ struct agent *adapter_agent = adapter_get_agent(adapter);
+
+ if (err && (g_str_equal(DBUS_ERROR_UNKNOWN_METHOD, err->name) ||
+ g_str_equal(DBUS_ERROR_NO_REPLY, err->name))) {
+
+ /* Request a pincode if we fail to display one */
+ if (auth->agent == adapter_agent || adapter_agent == NULL) {
+ if (agent_request_pincode(agent, device, pincode_cb,
+ auth->secure, auth, NULL) < 0)
+ goto done;
+ return;
+ }
+
+ if (agent_display_pincode(adapter_agent, device, auth->pincode,
+ display_pincode_cb, auth, NULL) < 0)
+ goto done;
+
+ auth->agent = adapter_agent;
+ return;
+ }
+
+done:
+ /* No need to reply anything if the authentication already failed */
+ if (auth->cb == NULL)
+ return;
+
+ ((agent_pincode_cb) auth->cb)(agent, err, auth->pincode, device);
+
+ g_free(device->authr->pincode);
+ device->authr->pincode = NULL;
+ device->authr->cb = NULL;
+ device->authr->agent = NULL;
+}
+
+
int device_request_authentication(struct btd_device *device, auth_type_t type,
void *data, gboolean secure, void *cb)
{
@@ -2728,6 +2775,11 @@ int device_request_authentication(struct btd_device *device, auth_type_t type,
auth->passkey = *(uint32_t *)data;
err = agent_display_passkey(agent, device, auth->passkey);
break;
+ case AUTH_TYPE_NOTIFY_PINCODE:
+ auth->pincode = g_strdup((const char *)data);
+ err = agent_display_pincode(agent, device, auth->pincode,
+ display_pincode_cb, auth, NULL);
+ break;
default:
err = -EINVAL;
}
@@ -2768,6 +2820,9 @@ static void cancel_authentication(struct authentication_req *auth)
case AUTH_TYPE_NOTIFY_PASSKEY:
/* User Notify doesn't require any reply */
break;
+ case AUTH_TYPE_NOTIFY_PINCODE:
+ ((agent_pincode_cb) auth->cb)(agent, &err, NULL, device);
+ break;
}
dbus_error_free(&err);
diff --git a/src/device.h b/src/device.h
index 998aee7..561865c 100644
--- a/src/device.h
+++ b/src/device.h
@@ -31,6 +31,7 @@ typedef enum {
AUTH_TYPE_PASSKEY,
AUTH_TYPE_CONFIRM,
AUTH_TYPE_NOTIFY_PASSKEY,
+ AUTH_TYPE_NOTIFY_PINCODE,
} auth_type_t;
struct btd_device *device_create(DBusConnection *conn,
--
1.7.7.3

View File

@ -1,92 +0,0 @@
From 1630cbe326460a89d5c342847b658a499484ced0 Mon Sep 17 00:00:00 2001
From: Scott James Remnant <scott@netsplit.com>
Date: Thu, 29 Mar 2012 14:04:14 -0700
Subject: [PATCH 05/13] Add display parameter to plugin pincode callback
Pass a display parameter to the plugin pincode callback, a plugin
may set this to TRUE to indicate the PIN it generates should be
displayed on the screen for entry into the remote device.
---
plugins/wiimote.c | 2 +-
src/adapter.c | 4 ++--
src/adapter.h | 4 ++--
src/event.c | 3 ++-
4 files changed, 7 insertions(+), 6 deletions(-)
diff --git a/plugins/wiimote.c b/plugins/wiimote.c
index 1ae638b..43b6de3 100644
--- a/plugins/wiimote.c
+++ b/plugins/wiimote.c
@@ -56,7 +56,7 @@
*/
static ssize_t wii_pincb(struct btd_adapter *adapter, struct btd_device *device,
- char *pinbuf)
+ char *pinbuf, gboolean *display)
{
uint16_t vendor, product;
bdaddr_t sba, dba;
diff --git a/src/adapter.c b/src/adapter.c
index acb845e..ccf7991 100644
--- a/src/adapter.c
+++ b/src/adapter.c
@@ -3330,7 +3330,7 @@ void btd_adapter_unregister_pin_cb(struct btd_adapter *adapter,
}
ssize_t btd_adapter_get_pin(struct btd_adapter *adapter, struct btd_device *dev,
- char *pin_buf)
+ char *pin_buf, gboolean *display)
{
GSList *l;
btd_adapter_pin_cb_t cb;
@@ -3339,7 +3339,7 @@ ssize_t btd_adapter_get_pin(struct btd_adapter *adapter, struct btd_device *dev,
for (l = adapter->pin_callbacks; l != NULL; l = g_slist_next(l)) {
cb = l->data;
- ret = cb(adapter, dev, pin_buf);
+ ret = cb(adapter, dev, pin_buf, display);
if (ret > 0)
return ret;
}
diff --git a/src/adapter.h b/src/adapter.h
index ceebb97..aa66070 100644
--- a/src/adapter.h
+++ b/src/adapter.h
@@ -172,13 +172,13 @@ int btd_adapter_switch_offline(struct btd_adapter *adapter);
void btd_adapter_enable_auto_connect(struct btd_adapter *adapter);
typedef ssize_t (*btd_adapter_pin_cb_t) (struct btd_adapter *adapter,
- struct btd_device *dev, char *out);
+ struct btd_device *dev, char *out, gboolean *display);
void btd_adapter_register_pin_cb(struct btd_adapter *adapter,
btd_adapter_pin_cb_t cb);
void btd_adapter_unregister_pin_cb(struct btd_adapter *adapter,
btd_adapter_pin_cb_t cb);
ssize_t btd_adapter_get_pin(struct btd_adapter *adapter, struct btd_device *dev,
- char *pin_buf);
+ char *pin_buf, gboolean *display);
typedef void (*bt_hci_result_t) (uint8_t status, gpointer user_data);
diff --git a/src/event.c b/src/event.c
index 7d66b6d..d87b6a4 100644
--- a/src/event.c
+++ b/src/event.c
@@ -119,12 +119,13 @@ int btd_event_request_pin(bdaddr_t *sba, bdaddr_t *dba, gboolean secure)
struct btd_device *device;
char pin[17];
ssize_t pinlen;
+ gboolean display = FALSE;
if (!get_adapter_and_device(sba, dba, &adapter, &device, TRUE))
return -ENODEV;
memset(pin, 0, sizeof(pin));
- pinlen = btd_adapter_get_pin(adapter, device, pin);
+ pinlen = btd_adapter_get_pin(adapter, device, pin, &display);
if (pinlen > 0 && (!secure || pinlen == 16)) {
btd_adapter_pincode_reply(adapter, dba, pin, pinlen);
return 0;
--
1.7.7.3

View File

@ -1,31 +0,0 @@
From 2a902f071ec21572094ce9cdf54099ad275e7904 Mon Sep 17 00:00:00 2001
From: Scott James Remnant <scott@netsplit.com>
Date: Thu, 29 Mar 2012 14:07:13 -0700
Subject: [PATCH 06/13] Display PIN generated by plugin
If a plugin pincode callback sets the display parameter to TRUE, send
the generated PIN to the agent for display using the new DisplayPinCode
agent method, including its fallback to RequestPinCode.
---
src/event.c | 5 +++++
1 files changed, 5 insertions(+), 0 deletions(-)
diff --git a/src/event.c b/src/event.c
index d87b6a4..5b60fb3 100644
--- a/src/event.c
+++ b/src/event.c
@@ -127,6 +127,11 @@ int btd_event_request_pin(bdaddr_t *sba, bdaddr_t *dba, gboolean secure)
memset(pin, 0, sizeof(pin));
pinlen = btd_adapter_get_pin(adapter, device, pin, &display);
if (pinlen > 0 && (!secure || pinlen == 16)) {
+ if (display && device_is_bonding(device, NULL))
+ return device_request_authentication(device,
+ AUTH_TYPE_NOTIFY_PINCODE, pin,
+ secure, pincode_cb);
+
btd_adapter_pincode_reply(adapter, dba, pin, pinlen);
return 0;
}
--
1.7.7.3

View File

@ -1,47 +0,0 @@
From 8a9347822f86059d015ae3893387aa971fa41ab7 Mon Sep 17 00:00:00 2001
From: Scott James Remnant <scott@netsplit.com>
Date: Mon, 23 Jan 2012 15:25:39 -0800
Subject: [PATCH 07/13] doc: document DisplayPinCode
---
doc/agent-api.txt | 24 ++++++++++++++++++++++++
1 files changed, 24 insertions(+), 0 deletions(-)
diff --git a/doc/agent-api.txt b/doc/agent-api.txt
index 9ab2063..5c8d4d2 100644
--- a/doc/agent-api.txt
+++ b/doc/agent-api.txt
@@ -61,6 +61,30 @@ Methods void Release()
so the display should be zero-padded at the start if
the value contains less than 6 digits.
+ void DisplayPinCode(object device, string pincode)
+
+ This method gets called when the service daemon
+ needs to display a pincode for an authentication.
+
+ An empty reply should be returned. When the pincode
+ needs no longer to be displayed, the Cancel method
+ of the agent will be called.
+
+ If this method is not implemented the RequestPinCode
+ method will be used instead.
+
+ This is used during the pairing process of keyboards
+ that don't support Bluetooth 2.1 Secure Simple Pairing,
+ in contrast to DisplayPasskey which is used for those
+ that do.
+
+ This method will only ever be called once since
+ older keyboards do not support typing notification.
+
+ Note that the PIN will always be a 6-digit number,
+ zero-padded to 6 digits. This is for harmony with
+ the later specification.
+
void RequestConfirmation(object device, uint32 passkey)
This method gets called when the service daemon
--
1.7.7.3

View File

@ -1,28 +0,0 @@
From 4f2f55231bad4d5da2505cb674375e9bf8ac029d Mon Sep 17 00:00:00 2001
From: Scott James Remnant <scott@netsplit.com>
Date: Mon, 23 Jan 2012 15:25:56 -0800
Subject: [PATCH 08/13] simple-agent: add DisplayPinCode
---
test/simple-agent | 5 +++++
1 files changed, 5 insertions(+), 0 deletions(-)
diff --git a/test/simple-agent b/test/simple-agent
index af84815..38d0235 100755
--- a/test/simple-agent
+++ b/test/simple-agent
@@ -52,6 +52,11 @@ class Agent(dbus.service.Object):
print "DisplayPasskey (%s, %06d)" % (device, passkey)
@dbus.service.method("org.bluez.Agent",
+ in_signature="os", out_signature="")
+ def DisplayPinCode(self, device, pincode):
+ print "DisplayPinCode (%s, %s)" % (device, pincode)
+
+ @dbus.service.method("org.bluez.Agent",
in_signature="ou", out_signature="")
def RequestConfirmation(self, device, passkey):
print "RequestConfirmation (%s, %06d)" % (device, passkey)
--
1.7.7.3

View File

@ -1,90 +0,0 @@
From 0cd8c8427019cfd7e1c69fb6a5b4261863716d56 Mon Sep 17 00:00:00 2001
From: Scott James Remnant <scott@netsplit.com>
Date: Tue, 24 Jan 2012 10:34:01 -0800
Subject: [PATCH 09/13] Add support for retrying a bonding
In order to retry a bonding we need a timer that will perform the
retry, we need to stash the status and capability of the bonding
request so it can use them again, and in the case of a retrying
bonding attempt we need to not tear down the temporary D-Bus device
object on the adapter.
---
src/adapter.c | 2 +-
src/device.c | 14 ++++++++++++++
src/device.h | 1 +
3 files changed, 16 insertions(+), 1 deletions(-)
diff --git a/src/adapter.c b/src/adapter.c
index ccf7991..f065a5d 100644
--- a/src/adapter.c
+++ b/src/adapter.c
@@ -2989,7 +2989,7 @@ void adapter_remove_connection(struct btd_adapter *adapter,
if (device_is_authenticating(device))
device_cancel_authentication(device, TRUE);
- if (device_is_temporary(device)) {
+ if (device_is_temporary(device) && !device_is_retrying(device)) {
const char *path = device_get_path(device);
DBG("Removing temporary device %s", path);
diff --git a/src/device.c b/src/device.c
index f32666e..9d4517f 100644
--- a/src/device.c
+++ b/src/device.c
@@ -85,6 +85,9 @@ struct bonding_req {
DBusMessage *msg;
guint listener_id;
struct btd_device *device;
+ uint8_t capability;
+ uint8_t status;
+ guint retry_timer;
};
struct authentication_req {
@@ -2295,6 +2298,9 @@ static void bonding_request_free(struct bonding_req *bonding)
if (bonding->conn)
dbus_connection_unref(bonding->conn);
+ if (bonding->retry_timer)
+ g_source_remove(bonding->retry_timer);
+
device = bonding->device;
g_free(bonding);
@@ -2367,6 +2373,7 @@ proceed:
bonding->conn = dbus_connection_ref(conn);
bonding->msg = dbus_message_ref(msg);
+ bonding->capability = capability;
return bonding;
}
@@ -2469,6 +2476,13 @@ static void device_auth_req_free(struct btd_device *device)
device->authr = NULL;
}
+gboolean device_is_retrying(struct btd_device *device)
+{
+ struct bonding_req *bonding = device->bonding;
+
+ return bonding && bonding->retry_timer != 0;
+}
+
void device_bonding_complete(struct btd_device *device, uint8_t status)
{
struct bonding_req *bonding = device->bonding;
diff --git a/src/device.h b/src/device.h
index 561865c..b957ad6 100644
--- a/src/device.h
+++ b/src/device.h
@@ -75,6 +75,7 @@ void device_set_temporary(struct btd_device *device, gboolean temporary);
void device_set_bonded(struct btd_device *device, gboolean bonded);
void device_set_auto_connect(struct btd_device *device, gboolean enable);
gboolean device_is_connected(struct btd_device *device);
+gboolean device_is_retrying(struct btd_device *device);
DBusMessage *device_create_bonding(struct btd_device *device,
DBusConnection *conn, DBusMessage *msg,
const char *agent_path, uint8_t capability);
--
1.7.7.3

View File

@ -1,81 +0,0 @@
From 83c36231418f9deff7ba16ceb0ead5d63e177a04 Mon Sep 17 00:00:00 2001
From: Scott James Remnant <scott@netsplit.com>
Date: Tue, 24 Jan 2012 10:30:53 -0800
Subject: [PATCH 10/13] plugin: Add bonding callback support for plugins
Allow plugins to register a bonding callback on a device, this will be
called on completion or cancellation of a bonding attempt on that
device and allow retrying of the bonding attempt.
These callbacks will only be called once, in the case of retrying the
callback must be registered again separately from another callback
(e.g. the pincode callback).
---
src/device.c | 17 +++++++++++++++++
src/device.h | 8 ++++++++
2 files changed, 25 insertions(+), 0 deletions(-)
diff --git a/src/device.c b/src/device.c
index 9d4517f..9a62eef 100644
--- a/src/device.c
+++ b/src/device.c
@@ -144,6 +144,7 @@ struct btd_device {
GSList *primaries; /* List of primary services */
GSList *drivers; /* List of device drivers */
GSList *watches; /* List of disconnect_data */
+ GSList *bonding_callbacks; /* List of bonding callbacks */
gboolean temporary;
struct agent *agent;
guint disconn_timer;
@@ -264,6 +265,8 @@ static void device_free(gpointer user_data)
g_slist_free_full(device->attios, g_free);
g_slist_free_full(device->attios_offline, g_free);
+ g_slist_free(device->bonding_callbacks);
+
att_cleanup(device);
if (device->tmp_records)
@@ -2476,6 +2479,20 @@ static void device_auth_req_free(struct btd_device *device)
device->authr = NULL;
}
+void btd_device_register_bonding_cb(struct btd_device *device,
+ btd_device_bonding_cb_t cb)
+{
+ device->bonding_callbacks = g_slist_prepend(
+ device->bonding_callbacks, cb);
+}
+
+void btd_device_unregister_bonding_cb(struct btd_device *device,
+ btd_device_bonding_cb_t cb)
+{
+ device->bonding_callbacks = g_slist_remove(
+ device->bonding_callbacks, cb);
+}
+
gboolean device_is_retrying(struct btd_device *device)
{
struct bonding_req *bonding = device->bonding;
diff --git a/src/device.h b/src/device.h
index b957ad6..ce8675b 100644
--- a/src/device.h
+++ b/src/device.h
@@ -103,6 +103,14 @@ guint device_add_disconnect_watch(struct btd_device *device,
void device_remove_disconnect_watch(struct btd_device *device, guint id);
void device_set_class(struct btd_device *device, uint32_t value);
+typedef gboolean (*btd_device_bonding_cb_t) (struct btd_device *device,
+ gboolean complete, uint8_t status);
+
+void btd_device_register_bonding_cb(struct btd_device *dev,
+ btd_device_bonding_cb_t cb);
+void btd_device_unregister_bonding_cb(struct btd_device *dev,
+ btd_device_bonding_cb_t cb);
+
#define BTD_UUIDS(args...) ((const char *[]) { args, NULL } )
struct btd_device_driver {
--
1.7.7.3

View File

@ -1,79 +0,0 @@
From f3d2851b74fe790896f819efbc694e288d54d819 Mon Sep 17 00:00:00 2001
From: Scott James Remnant <scott@netsplit.com>
Date: Tue, 24 Jan 2012 10:35:30 -0800
Subject: [PATCH 11/13] bonding: retry if callback returns TRUE
When a bonding completes, pass the status to any plugin bonding
callbacks; if any return TRUE than set a timer to retry the bonding
after an appropriate backoff period.
---
src/device.c | 46 ++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 46 insertions(+), 0 deletions(-)
diff --git a/src/device.c b/src/device.c
index 9a62eef..4ad5aa0 100644
--- a/src/device.c
+++ b/src/device.c
@@ -2493,6 +2493,44 @@ void btd_device_unregister_bonding_cb(struct btd_device *device,
device->bonding_callbacks, cb);
}
+static gboolean device_bonding_retry(gpointer data)
+{
+ struct btd_device *device = data;
+ struct btd_adapter *adapter = device_get_adapter(device);
+ struct bonding_req *bonding = device->bonding;
+ int err;
+
+ if (!bonding)
+ return FALSE;
+
+ DBG("retrying bonding");
+ err = adapter_create_bonding(adapter, &device->bdaddr,
+ device->type, bonding->capability);
+ if (err < 0)
+ device_bonding_complete(device, bonding->status);
+
+ bonding->retry_timer = 0;
+ return FALSE;
+}
+
+static gboolean device_bonding_get_retry(struct btd_device *device,
+ uint8_t status)
+{
+ GSList *l;
+ btd_device_bonding_cb_t cb;
+ gboolean retry = FALSE;
+
+ for (l = device->bonding_callbacks; l != NULL; l = g_slist_next(l)) {
+ cb = l->data;
+ retry |= cb(device, TRUE, status);
+ }
+
+ g_slist_free(device->bonding_callbacks);
+ device->bonding_callbacks = NULL;
+
+ return retry;
+}
+
gboolean device_is_retrying(struct btd_device *device)
{
struct bonding_req *bonding = device->bonding;
@@ -2507,6 +2545,14 @@ void device_bonding_complete(struct btd_device *device, uint8_t status)
DBG("bonding %p status 0x%02x", bonding, status);
+ if (device_bonding_get_retry(device, status) && status) {
+ DBG("backing off and retrying");
+ bonding->status = status;
+ bonding->retry_timer = g_timeout_add(3000,
+ device_bonding_retry, device);
+ return;
+ }
+
if (auth && (auth->type == AUTH_TYPE_NOTIFY_PASSKEY
|| auth->type == AUTH_TYPE_NOTIFY_PINCODE) && auth->agent)
agent_cancel(auth->agent);
--
1.7.7.3

View File

@ -1,41 +0,0 @@
From 82ef8f4b96d62e18b5a191f6aaa9d79140ca64a4 Mon Sep 17 00:00:00 2001
From: Scott James Remnant <scott@netsplit.com>
Date: Tue, 24 Jan 2012 10:36:44 -0800
Subject: [PATCH 12/13] bonding: call plugin callback on cancellation
Call the plugin callbacks when a bonding request is cancelled.
---
src/device.c | 10 ++++++++++
1 files changed, 10 insertions(+), 0 deletions(-)
diff --git a/src/device.c b/src/device.c
index 4ad5aa0..ea0d1fb 100644
--- a/src/device.c
+++ b/src/device.c
@@ -2648,6 +2648,8 @@ void device_cancel_bonding(struct btd_device *device, uint8_t status)
struct bonding_req *bonding = device->bonding;
DBusMessage *reply;
char addr[18];
+ GSList *l;
+ btd_device_bonding_cb_t cb;
if (!bonding)
return;
@@ -2655,6 +2657,14 @@ void device_cancel_bonding(struct btd_device *device, uint8_t status)
ba2str(&device->bdaddr, addr);
DBG("Canceling bonding request for %s", addr);
+ for (l = device->bonding_callbacks; l != NULL; l = g_slist_next(l)) {
+ cb = l->data;
+ cb(device, FALSE, 0);
+ }
+
+ g_slist_free(device->bonding_callbacks);
+ device->bonding_callbacks = NULL;
+
if (device->authr)
device_cancel_authentication(device, FALSE);
--
1.7.7.3

View File

@ -1,274 +0,0 @@
From 2236069d7d5bf54ae53470c13929cba90e020710 Mon Sep 17 00:00:00 2001
From: Scott James Remnant <scott@netsplit.com>
Date: Thu, 5 Apr 2012 15:42:12 -0700
Subject: [PATCH 13/13] autopair: Add autopair plugin.
---
Makefile.am | 5 +
acinclude.m4 | 6 ++
plugins/autopair.c | 207 ++++++++++++++++++++++++++++++++++++++++++++++++++++
3 files changed, 218 insertions(+), 0 deletions(-)
create mode 100644 plugins/autopair.c
diff --git a/Makefile.am b/Makefile.am
index bd587eb..0e9129c 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -278,6 +278,11 @@ builtin_modules += dbusoob
builtin_sources += plugins/dbusoob.c
endif
+if AUTOPAIRPLUGIN
+builtin_modules += autopair
+builtin_sources += plugins/autopair.c
+endif
+
if MAINTAINER_MODE
plugin_LTLIBRARIES += plugins/external-dummy.la
plugins_external_dummy_la_SOURCES = plugins/external-dummy.c
diff --git a/acinclude.m4 b/acinclude.m4
index b0f790c..4c1849a 100644
--- a/acinclude.m4
+++ b/acinclude.m4
@@ -220,6 +220,7 @@ AC_DEFUN([AC_ARG_BLUEZ], [
dbusoob_enable=no
wiimote_enable=no
thermometer_enable=no
+ autopair_enable=no
AC_ARG_ENABLE(optimization, AC_HELP_STRING([--disable-optimization], [disable code optimization]), [
optimization_enable=${enableval}
@@ -364,6 +365,10 @@ AC_DEFUN([AC_ARG_BLUEZ], [
wiimote_enable=${enableval}
])
+ AC_ARG_ENABLE(autopair, AC_HELP_STRING([--enable-autopair], [compile with autopairing plugin]), [
+ autopair_enable=${enableval}
+ ])
+
AC_ARG_ENABLE(hal, AC_HELP_STRING([--enable-hal], [Use HAL to determine adapter class]), [
hal_enable=${enableval}
])
@@ -429,4 +434,5 @@ AC_DEFUN([AC_ARG_BLUEZ], [
AM_CONDITIONAL(DBUSOOBPLUGIN, test "${dbusoob_enable}" = "yes")
AM_CONDITIONAL(WIIMOTEPLUGIN, test "${wiimote_enable}" = "yes")
AM_CONDITIONAL(THERMOMETERPLUGIN, test "${thermometer_enable}" = "yes")
+ AM_CONDITIONAL(AUTOPAIRPLUGIN, test "${autopair_enable}" = "yes")
])
diff --git a/plugins/autopair.c b/plugins/autopair.c
new file mode 100644
index 0000000..58047b1
--- /dev/null
+++ b/plugins/autopair.c
@@ -0,0 +1,208 @@
+/*
+ *
+ * BlueZ - Bluetooth protocol stack for Linux
+ *
+ * Copyright (C) 2012 Google Inc.
+ *
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <sys/types.h>
+#include <sys/stat.h>
+
+#include <fcntl.h>
+#include <stdlib.h>
+#include <string.h>
+#include <time.h>
+#include <unistd.h>
+
+#include <glib.h>
+
+#include <bluetooth/bluetooth.h>
+
+#include "glib-compat.h"
+#include "plugin.h"
+#include "adapter.h"
+#include "device.h"
+#include "storage.h"
+#include "textfile.h"
+#include "log.h"
+
+/*
+ * Plugin to handle automatic pairing of devices with reduced user
+ * interaction, including implementing the recommendation of the HID spec
+ * for keyboard devices.
+ *
+ * The plugin works by intercepting the PIN request for devices; if the
+ * device is a keyboard a random six-digit numeric PIN is generated and
+ * returned, flagged for displaying using DisplayPinCode.
+ *
+ * Bonding callbacks are also added for the device, so should the pairing
+ * attempt fail with the PIN from this plugin, a blacklist entry is added
+ * and pairing retried. On the second pass this plugin will ignore the
+ * device due to the blacklist and the user will be prompted for a PIN
+ * instead.
+ */
+
+static GSList *blacklist = NULL;
+
+static void autopair_blacklist_device(struct btd_device *device)
+{
+ bdaddr_t *ba;
+
+ ba = g_new0(bdaddr_t, 1);
+ device_get_address(device, ba, NULL);
+ blacklist = g_slist_prepend(blacklist, ba);
+}
+
+
+static GSList *attempting = NULL;
+
+static gboolean autopair_bondingcb(struct btd_device *device,
+ gboolean complete, uint8_t status)
+{
+ GSList *match;
+
+ match = g_slist_find(attempting, device);
+ if (!match)
+ return FALSE;
+
+ attempting = g_slist_remove_link(attempting, match);
+ btd_device_unref(device);
+
+ if (complete && status != 0) {
+ /* failed: blacklist and retry with the user's agent */
+ autopair_blacklist_device(device);
+ return TRUE;
+ } else {
+ /* successful or cancelled pair */
+ return FALSE;
+ }
+}
+
+static gboolean autopair_attempt(struct btd_device *device)
+{
+ if (g_slist_find(attempting, device))
+ return FALSE;
+
+ btd_device_register_bonding_cb(device, autopair_bondingcb);
+ attempting = g_slist_prepend(attempting, btd_device_ref(device));
+
+ return TRUE;
+}
+
+static void autopair_cancel_all(void)
+{
+ GSList *l;
+ struct btd_device *device;
+
+ for (l = attempting; l != NULL; l = g_slist_next(l)) {
+ device = l->data;
+ btd_device_unregister_bonding_cb(device, autopair_bondingcb);
+ btd_device_unref(device);
+ }
+
+ g_slist_free(attempting);
+ attempting = NULL;
+}
+
+static ssize_t autopair_pincb(struct btd_adapter *adapter,
+ struct btd_device *device,
+ char *pinbuf, gboolean *display)
+{
+ char addr[18];
+ bdaddr_t local, peer;
+ uint32_t class;
+
+ if (!device_is_bonding(device, NULL))
+ return 0;
+
+ adapter_get_address(adapter, &local);
+
+ device_get_address(device, &peer, NULL);
+ ba2str(&peer, addr);
+
+ read_remote_class(&local, &peer, &class);
+
+ DBG("device %s 0x%x", addr, class);
+
+ if (g_slist_find_custom(blacklist, &peer, (GCompareFunc) bacmp)) {
+ DBG("prior autopair failed");
+ return 0;
+ }
+
+ switch ((class & 0x1f00) >> 8) {
+ case 0x05:
+ switch ((class & 0xc0) >> 6) {
+ case 0x01:
+ case 0x03:
+ if (autopair_attempt(device)) {
+ char pinstr[7];
+ srand(time(NULL));
+ snprintf(pinstr, sizeof pinstr, "%06d",
+ rand() % 1000000);
+ *display = TRUE;
+ memcpy(pinbuf, pinstr, 6);
+ return 6;
+ }
+ break;
+ }
+ break;
+ }
+
+ return 0;
+}
+
+
+static int autopair_probe(struct btd_adapter *adapter)
+{
+ btd_adapter_register_pin_cb(adapter, autopair_pincb);
+
+ return 0;
+}
+
+static void autopair_remove(struct btd_adapter *adapter)
+{
+ btd_adapter_unregister_pin_cb(adapter, autopair_pincb);
+}
+
+static struct btd_adapter_driver autopair_driver = {
+ .name = "autopair",
+ .probe = autopair_probe,
+ .remove = autopair_remove,
+};
+
+static int autopair_init(void)
+{
+ return btd_register_adapter_driver(&autopair_driver);
+}
+
+static void autopair_exit(void)
+{
+ btd_unregister_adapter_driver(&autopair_driver);
+
+ autopair_cancel_all();
+
+ g_slist_free_full(blacklist, g_free);
+}
+
+BLUETOOTH_PLUGIN_DEFINE(autopair, VERSION,
+ BLUETOOTH_PLUGIN_PRIORITY_DEFAULT, autopair_init, autopair_exit)
--
1.7.7.3

View File

@ -1,62 +0,0 @@
From 36358d4a7b3471f5a124a95fec9ed0e4871299e0 Mon Sep 17 00:00:00 2001
From: Scott James Remnant <scott@netsplit.com>
Date: Wed, 18 Apr 2012 15:53:55 -0700
Subject: [PATCH 14/14] autopair: use 0000 as PIN for dumb devices
Android tries 0000 for a set of audio devices, so follow suit and
do the same even though most audio devices support SSP these days.
BUG=chromium-os:25211
TEST=verified with audio devices after 'hciconfig hci0 sspmode 0'
---
plugins/autopair.c | 26 +++++++++++++++++++++++---
1 files changed, 23 insertions(+), 3 deletions(-)
diff --git a/plugins/autopair.c b/plugins/autopair.c
index 05de3ff..5b773c5 100644
--- a/plugins/autopair.c
+++ b/plugins/autopair.c
@@ -150,10 +150,24 @@ static ssize_t autopair_pincb(struct btd_adapter *adapter,
}
switch ((class & 0x1f00) >> 8) {
- case 0x05:
+ case 0x04: // Audio/Video
+ switch ((class & 0xfc) >> 2) {
+ case 0x01: // Wearable Headset Device
+ case 0x02: // Hands-free Device
+ case 0x06: // Headphones
+ case 0x07: // Portable Audio
+ case 0x0a: // HiFi Audio Device
+ if (autopair_attempt(device)) {
+ memcpy(pinbuf, "0000", 4);
+ return 4;
+ }
+ break;
+ }
+ break;
+ case 0x05: // Peripheral
switch ((class & 0xc0) >> 6) {
- case 0x01:
- case 0x03:
+ case 0x01: // Keyboard
+ case 0x03: // Combo keyboard/pointing device
if (autopair_attempt(device)) {
char pinstr[7];
srand(time(NULL));
@@ -164,6 +178,12 @@ static ssize_t autopair_pincb(struct btd_adapter *adapter,
return 6;
}
break;
+ case 0x02: // Pointing device
+ if (autopair_attempt(device)) {
+ memcpy(pinbuf, "0000", 4);
+ return 4;
+ }
+ break;
}
break;
}
--
1.7.7.3

View File

@ -1,28 +0,0 @@
diff --git a/src/bluetooth.conf b/src/bluetooth.conf
index 664dbd9..3263112 100644
--- a/src/bluetooth.conf
+++ b/src/bluetooth.conf
@@ -7,7 +7,7 @@
<!-- ../system.conf have denied everything, so we just punch some holes -->
- <policy user="root">
+ <policy user="bluetooth">
<allow own="org.bluez"/>
<allow send_destination="org.bluez"/>
<allow send_interface="org.bluez.Agent"/>
@@ -18,13 +18,7 @@
<allow send_interface="org.bluez.ThermometerWatcher"/>
</policy>
- <policy at_console="true">
- <allow send_destination="org.bluez"/>
- </policy>
-
- <!-- allow users of lp group (printing subsystem) to
- communicate with bluetoothd -->
- <policy group="lp">
+ <policy user="chronos">
<allow send_destination="org.bluez"/>
</policy>

View File

@ -1,13 +0,0 @@
diff --git a/src/main.conf b/src/main.conf
index 321f622..f6784fb 100644
--- a/src/main.conf
+++ b/src/main.conf
@@ -38,7 +38,7 @@ AutoConnectTimeout = 60
# What value should be assumed for the adapter Powered property when
# SetProperty(Powered, ...) hasn't been called yet. Defaults to true
-InitiallyPowered = true
+InitiallyPowered = false
# Remember the previously stored Powered state when initializing adapters
RememberPowered = true

View File

@ -1,13 +0,0 @@
diff --git a/lib/sdp.h b/lib/sdp.h
index 2fe74d5..e559a5c 100644
--- a/lib/sdp.h
+++ b/lib/sdp.h
@@ -34,7 +34,7 @@ extern "C" {
#include <stdint.h>
#include <bluetooth/bluetooth.h>
-#define SDP_UNIX_PATH "/var/run/sdp"
+#define SDP_UNIX_PATH "/var/run/bluetooth/sdp"
#define SDP_RESPONSE_TIMEOUT 20
#define SDP_REQ_BUFFER_SIZE 2048
#define SDP_RSP_BUFFER_SIZE 65535

View File

@ -1,5 +0,0 @@
DIST bluez-4.62.tar.gz 974796 SHA256 f63203cbbd5be7d9986d5df42c7a96c3edb7442d99539fbe9c7964243b286792
DIST bluez-4.97.tar.xz 838040 SHA256 7599118d1551ea4a61534d3f3bcbb75b8bccbaf97d7d1e037cfc90cf62aa29c2 SHA512 7a5537ed2006cb5a83955b5d8feaedee075ddb9f93f026c9f02d0b852b0370b77311fd5f81fd908a2a6915130f04c00d6219d8812a312a40dbc67475f6b5f3ee WHIRLPOOL 2a367d87a0acbb105f9ec8cf71be5527dcb95619bf12985eb3404ce1922e89aa44624ffa6a6eba6b190093a230a449f11ab01b951f96398047dca1e9bd88a6d1
DIST bluez-4.99.tar.xz 859756 SHA256 41889a91a5516eec26c4e59095ceea076de158b1ac38fd0ede9034596f511d3b SHA512 79e36a65ff9ff9c3311a8ef4819692503bb02f048a3c42dd0b9512749fb8e4d810eb832f211fb7dfebc7b6b5bf82a9363edd15741d62595f36d782804bb39ac3 WHIRLPOOL 32b8e3f67c846a17e7335395021008c181a2645fdb08b4ebe36bf4ad5221eef00f86ec7ef0d1de19c64741c884376666677ca9e129868dcaa18a5d4c0737c894
DIST oui-20111231.txt.xz 540056 SHA256 0a141f649cf999e101efc2e36bd876f264d75bb8ebf4d2997153067132f85d17 SHA512 191eff688dcec6e5c0fae4ee3da1b2e3bd4cd239ba9b6f0db8c5ef515a9b3150af27d72f3921aa530c3c38b95d4e82d24167728ffccb53ce0c4fc2e257b4854e WHIRLPOOL 818ead21c81026619264e3557db727c10ca3bf8302c05493c19eee2e75ccdb802df487bb19807737ad9abfff77efaf7f94e6439d7245dd38ab4187d0bc2e4800
DIST oui-20120308.txt.xz 546720 SHA256 4256ba96a522333a41fd058e1880a04f77566c9ad0a62d3c0d7ac422bf8b9086 SHA512 f749b3ce9b6173760319849f1e4699f02d4f8628de78d0bc39c08b01331567b60a9bd3303a84982ad23bc6cbe7b6d9f27e2e26f699a818dac0e0e8fa6ddb44fa WHIRLPOOL 0797457e3bb54d49b295547a47894258c2c5a9954ca87c44948bdb57781e11c84d2d1be9cf6d3deb0d062e4a98b0b1fb406a1f0fbeb9d0a294da624c2e90f9ee

View File

@ -1,170 +0,0 @@
# Copyright 1999-2010 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/net-wireless/bluez/bluez-4.62.ebuild,v 1.1 2010/03/08 14:35:09 pacho Exp $
EAPI="2"
inherit autotools multilib eutils
DESCRIPTION="Bluetooth Tools and System Daemons for Linux"
HOMEPAGE="http://bluez.sourceforge.net/"
SRC_URI="mirror://kernel/linux/bluetooth/${P}.tar.gz"
LICENSE="GPL-2 LGPL-2.1"
SLOT="0"
KEYWORDS="amd64 arm x86"
IUSE="alsa caps +consolekit cups debug gstreamer old-daemons pcmcia test-programs usb"
CDEPEND="alsa? (
media-libs/alsa-lib[alsa_pcm_plugins_extplug,alsa_pcm_plugins_ioplug]
)
caps? ( >=sys-libs/libcap-ng-0.6.2 )
gstreamer? (
>=media-libs/gstreamer-0.10
>=media-libs/gst-plugins-base-0.10 )
usb? ( dev-libs/libusb )
cups? ( net-print/cups )
sys-fs/udev
dev-libs/glib
sys-apps/dbus
media-libs/libsndfile
>=dev-libs/libnl-1.1
!net-wireless/bluez-libs
!net-wireless/bluez-utils"
DEPEND="sys-devel/flex
>=dev-util/pkgconfig-0.20
${CDEPEND}"
RDEPEND="${CDEPEND}
consolekit? ( sys-auth/pambase[consolekit] )
test-programs? (
dev-python/dbus-python
dev-python/pygobject )"
src_prepare() {
if use cups; then
epatch "${FILESDIR}/4.60/cups-location.patch"
fi
# Fix alsa files location
epatch "${FILESDIR}/${PN}-alsa_location.patch"
# Incorporate ATH3k support
epatch "${FILESDIR}/${PN}-ath3k.patch"
# Allow user chronos to send requests
epatch "${FILESDIR}/${PN}-chronos.patch"
eautoreconf
}
src_configure() {
econf \
$(use_enable caps capng) \
--enable-network \
--enable-serial \
--enable-input \
--enable-audio \
--enable-service \
$(use_enable gstreamer) \
$(use_enable alsa) \
$(use_enable usb) \
--enable-netlink \
--enable-tools \
--enable-bccmd \
--enable-hid2hci \
--enable-dfutool \
$(use_enable old-daemons hidd) \
$(use_enable old-daemons pand) \
$(use_enable old-daemons dund) \
$(use_enable cups) \
$(use_enable test-programs test) \
--enable-udevrules \
--enable-configfiles \
$(use_enable pcmcia) \
$(use_enable debug) \
--localstatedir=/var
}
src_compile() {
# TODO: Re-enable parallel-make when dependency issue with generated headers
# is fixed. See http://crosbug.com/15028
emake -j1 || die "emake failed"
}
src_install() {
emake DESTDIR="${D}" install || die "make install failed"
dodoc AUTHORS ChangeLog README || die
if use test-programs ; then
cd "${S}/test"
dobin simple-agent simple-service monitor-bluetooth
newbin list-devices list-bluetooth-devices
for b in apitest hsmicro hsplay test-* ; do
newbin "${b}" "bluez-${b}"
done
insinto /usr/share/doc/${PF}/test-services
doins service-*
cd "${S}"
fi
if use old-daemons; then
newconfd "${FILESDIR}/4.18/conf.d-hidd" hidd || die
newinitd "${FILESDIR}/4.18/init.d-hidd" hidd || die
fi
insinto /etc/bluetooth
doins \
input/input.conf \
audio/audio.conf \
network/network.conf \
serial/serial.conf \
|| die
insinto /etc/udev/rules.d/
newins "${FILESDIR}/${PN}-4.18-udev.rules" 70-bluetooth.rules || die
exeinto /$(get_libdir)/udev/
newexe "${FILESDIR}/${PN}-4.18-udev.script" bluetooth.sh || die
newinitd "${FILESDIR}/4.60/bluetooth-init.d" bluetooth || die
newconfd "${FILESDIR}/4.60/bluetooth-conf.d" bluetooth || die
}
pkg_postinst() {
udevadm control --reload-rules && udevadm trigger --subsystem-match=bluetooth
elog
elog "To use dial up networking you must install net-dialup/ppp."
elog
elog "For a password agent, there is for example net-wireless/bluez-gnome"
elog "for gnome and net-wireless/kdebluetooth for kde. You can also give a"
elog "try to net-wireless/blueman"
elog
elog "Use the old-daemons use flag to get the old daemons like hidd"
elog "installed. Please note that the init script doesn't stop the old"
elog "daemons after you update it so it's recommended to run:"
elog " /etc/init.d/bluetooth stop"
elog "before updating your configuration files or you can manually kill"
elog "the extra daemons you previously enabled in /etc/conf.d/bluetooth."
if use consolekit; then
elog ""
elog "If you want to use rfcomm as a normal user, you need to add the user"
elog "to the uucp group."
else
elog ""
elog "Since you have the consolekit use flag disabled, you will only be able to run"
elog "bluetooth clients as root. If you want to be able to run bluetooth clientes as "
elog "a regular user, you need to enable the consolekit use flag for this package."
fi
if use old-daemons; then
elog ""
elog "The hidd init script was installed because you have the old-daemons"
elog "use flag on. It is not started by default via udev so please add it"
elog "to the required runlevels using rc-update <runlevel> add hidd. If"
elog "you need init scripts for the other daemons, please file requests"
elog "to https://bugs.gentoo.org."
fi
}

View File

@ -1,187 +0,0 @@
# Copyright 1999-2011 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/net-wireless/bluez/bluez-4.97-r1.ebuild,v 1.1 2011/12/31 21:09:18 pacho Exp $
EAPI="4"
PYTHON_DEPEND="test-programs? 2"
inherit autotools multilib eutils systemd python
DESCRIPTION="Bluetooth Tools and System Daemons for Linux"
HOMEPAGE="http://www.bluez.org/"
# Because of oui.txt changing from time to time without noticement, we need to supply it
# ourselves instead of using http://standards.ieee.org/regauth/oui/oui.txt directly.
# See bugs #345263 and #349473 for reference.
OUIDATE="20111231"
SRC_URI="mirror://kernel/linux/bluetooth/${P}.tar.xz
http://dev.gentoo.org/~pacho/bluez/oui-${OUIDATE}.txt.xz"
LICENSE="GPL-2 LGPL-2.1"
SLOT="0"
KEYWORDS="amd64 arm ~hppa ~ppc ~ppc64 x86"
IUSE="alsa caps +consolekit cups debug gstreamer pcmcia test-programs usb"
CDEPEND="
>=dev-libs/glib-2.14:2
sys-apps/dbus
>=sys-fs/udev-169
alsa? (
media-libs/alsa-lib[alsa_pcm_plugins_extplug,alsa_pcm_plugins_ioplug]
media-libs/libsndfile
)
caps? ( >=sys-libs/libcap-ng-0.6.2 )
cups? ( net-print/cups )
gstreamer? (
>=media-libs/gstreamer-0.10:0.10
>=media-libs/gst-plugins-base-0.10:0.10
)
usb? ( dev-libs/libusb:1 )
"
DEPEND="${CDEPEND}
>=dev-util/pkgconfig-0.20
>=dev-libs/check-0.9.8
sys-devel/flex
"
RDEPEND="${CDEPEND}
!net-wireless/bluez-libs
!net-wireless/bluez-utils
consolekit? (
|| ( sys-auth/consolekit
>=sys-apps/systemd-37 )
)
test-programs? (
dev-python/dbus-python
dev-python/pygobject:2
)
"
DOCS=( AUTHORS ChangeLog README )
pkg_setup() {
if use test-programs; then
python_pkg_setup
fi
}
src_prepare() {
# Change the default D-Bus configuration; the daemon is run as
# bluetooth, not root; we don't use the lp user, and we use the
# chronos user instead of at_console
epatch "${FILESDIR}/${PN}-4.97-dbus.patch"
# Change the default SDP Server socket path to a sub-directory
# under /var/run, since /var/run is not writeable by the bluetooth
# user.
epatch "${FILESDIR}/${PN}-4.97-sdp-path.patch"
# Disable initial radio power for new adapters
epatch "${FILESDIR}/${PN}-4.97-initially-powered.patch"
# Automatic pairing support, including keyboard pairing support
# (in upstream review)
epatch "${FILESDIR}/${PN}-4.97-autopair-0001-Rename-AUTH_TYPE_NOTIFY-to-AUTH_TYPE_NOTIFY_PASSKEY.patch"
epatch "${FILESDIR}/${PN}-4.97-autopair-0002-Pass-passkey-by-pointer-rather-than-by-value.patch"
epatch "${FILESDIR}/${PN}-4.97-autopair-0003-agent-add-DisplayPinCode-method.patch"
epatch "${FILESDIR}/${PN}-4.97-autopair-0004-Add-AUTH_TYPE_NOTIFY_PASSKEY-to-device_request_authe.patch"
epatch "${FILESDIR}/${PN}-4.97-autopair-0005-Add-display-parameter-to-plugin-pincode-callback.patch"
epatch "${FILESDIR}/${PN}-4.97-autopair-0006-Display-PIN-generated-by-plugin.patch"
epatch "${FILESDIR}/${PN}-4.97-autopair-0007-doc-document-DisplayPinCode.patch"
epatch "${FILESDIR}/${PN}-4.97-autopair-0008-simple-agent-add-DisplayPinCode.patch"
epatch "${FILESDIR}/${PN}-4.97-autopair-0009-Add-support-for-retrying-a-bonding.patch"
epatch "${FILESDIR}/${PN}-4.97-autopair-0010-plugin-Add-bonding-callback-support-for-plugins.patch"
epatch "${FILESDIR}/${PN}-4.97-autopair-0011-bonding-retry-if-callback-returns-TRUE.patch"
epatch "${FILESDIR}/${PN}-4.97-autopair-0012-bonding-call-plugin-callback-on-cancellation.patch"
epatch "${FILESDIR}/${PN}-4.97-autopair-0013-autopair-Add-autopair-plugin.patch"
if use cups; then
sed -i \
-e "s:cupsdir = \$(libdir)/cups:cupsdir = `cups-config --serverbin`:" \
Makefile.tools Makefile.in || die
fi
}
src_configure() {
econf \
--enable-hid2hci \
--enable-audio \
--enable-bccmd \
--enable-datafiles \
--enable-dfutool \
--enable-input \
--enable-network \
--enable-serial \
--enable-service \
--enable-tools \
--disable-hal \
--localstatedir=/var \
--with-systemdunitdir="$(systemd_get_unitdir)" \
--with-ouifile=/usr/share/misc/oui.txt \
$(use_enable alsa) \
$(use_enable caps capng) \
$(use_enable cups) \
$(use_enable debug) \
$(use_enable gstreamer) \
$(use_enable pcmcia) \
$(use_enable test-programs test) \
$(use_enable usb) \
--enable-health \
--enable-maemo6 \
--enable-pnat \
--enable-wiimote \
--enable-dbusoob \
--enable-autopair
}
src_install() {
default
if use test-programs ; then
cd "${S}/test"
dobin simple-agent simple-service monitor-bluetooth
newbin list-devices list-bluetooth-devices
rm test-textfile.{c,o} || die # bug #356529
for b in apitest hsmicro hsplay test-* ; do
newbin "${b}" "bluez-${b}"
done
insinto /usr/share/doc/${PF}/test-services
doins service-*
python_convert_shebangs -r 2 "${ED}"
cd "${S}"
fi
insinto /etc/bluetooth
doins \
input/input.conf \
audio/audio.conf \
network/network.conf \
serial/serial.conf
newinitd "${FILESDIR}/rfcomm-init.d" rfcomm
newconfd "${FILESDIR}/rfcomm-conf.d" rfcomm
insinto /etc/init
newins "${FILESDIR}/${PN}-upstart.conf" bluetoothd.conf
# Install oui.txt as requested in bug #283791 and approved by upstream
insinto /usr/share/misc
newins "${WORKDIR}/oui-${OUIDATE}.txt" oui.txt
fowners bluetooth:bluetooth /var/lib/bluetooth
rm "${D}/lib/udev/rules.d/97-bluetooth.rules"
find "${D}" -name "*.la" -delete
}
pkg_postinst() {
if ! has_version "net-dialup/ppp"; then
elog "To use dial up networking you must install net-dialup/ppp."
fi
if use consolekit; then
elog "If you want to use rfcomm as a normal user, you need to add the user"
elog "to the uucp group."
fi
}

View File

@ -1,223 +0,0 @@
# Copyright 1999-2012 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/net-wireless/bluez/bluez-4.99.ebuild,v 1.7 2012/04/15 16:53:41 maekke Exp $
EAPI="4"
PYTHON_DEPEND="test-programs? 2"
inherit autotools multilib eutils systemd python
DESCRIPTION="Bluetooth Tools and System Daemons for Linux"
HOMEPAGE="http://www.bluez.org/"
# Because of oui.txt changing from time to time without noticement, we need to supply it
# ourselves instead of using http://standards.ieee.org/regauth/oui/oui.txt directly.
# See bugs #345263 and #349473 for reference.
OUIDATE="20120308"
SRC_URI="mirror://kernel/linux/bluetooth/${P}.tar.xz
http://dev.gentoo.org/~pacho/bluez/oui-${OUIDATE}.txt.xz"
LICENSE="GPL-2 LGPL-2.1"
SLOT="0"
KEYWORDS="amd64 arm hppa ~ppc ~ppc64 x86"
IUSE="alsa caps +consolekit cups debug gstreamer pcmcia test-programs usb readline"
CDEPEND="
>=dev-libs/glib-2.14:2
sys-apps/dbus
>=sys-fs/udev-169
alsa? (
media-libs/alsa-lib[alsa_pcm_plugins_extplug(+),alsa_pcm_plugins_ioplug(+)]
media-libs/libsndfile
)
caps? ( >=sys-libs/libcap-ng-0.6.2 )
cups? ( net-print/cups )
gstreamer? (
>=media-libs/gstreamer-0.10:0.10
>=media-libs/gst-plugins-base-0.10:0.10
)
usb? ( virtual/libusb:0 )
readline? ( sys-libs/readline )
"
DEPEND="${CDEPEND}
>=dev-util/pkgconfig-0.20
sys-devel/flex
test-programs? ( >=dev-libs/check-0.9.8 )
"
RDEPEND="${CDEPEND}
!net-wireless/bluez-libs
!net-wireless/bluez-utils
consolekit? (
|| ( sys-auth/consolekit
>=sys-apps/systemd-37 )
)
test-programs? (
dev-python/dbus-python
dev-python/pygobject:2
)
"
DOCS=( AUTHORS ChangeLog README )
pkg_setup() {
if use test-programs; then
python_pkg_setup
fi
}
src_prepare() {
# Change the default D-Bus configuration; the daemon is run as
# bluetooth, not root; we don't use the lp user, and we use the
# chronos user instead of at_console
epatch "${FILESDIR}/${PN}-dbus.patch"
# Change the default SDP Server socket path to a sub-directory
# under /var/run, since /var/run is not writeable by the bluetooth
# user.
epatch "${FILESDIR}/${PN}-sdp-path.patch"
# Disable initial radio power for new adapters
epatch "${FILESDIR}/${PN}-initially-powered.patch"
# Automatic pairing support, including keyboard pairing support.
# (accepted upstream, can be dropped for next release)
epatch "${FILESDIR}/${P}-autopair-0001-Rename-AUTH_TYPE_NOTIFY-to-AUTH_TYPE_NOTIFY_PASSKEY.patch"
epatch "${FILESDIR}/${P}-autopair-0002-Pass-passkey-by-pointer-rather-than-by-value.patch"
epatch "${FILESDIR}/${P}-autopair-0003-agent-add-DisplayPinCode-method.patch"
epatch "${FILESDIR}/${P}-autopair-0004-Add-AUTH_TYPE_NOTIFY_PASSKEY-to-device_request_authe.patch"
epatch "${FILESDIR}/${P}-autopair-0005-Add-display-parameter-to-plugin-pincode-callback.patch"
epatch "${FILESDIR}/${P}-autopair-0006-Display-PIN-generated-by-plugin.patch"
epatch "${FILESDIR}/${P}-autopair-0007-doc-document-DisplayPinCode.patch"
epatch "${FILESDIR}/${P}-autopair-0008-simple-agent-add-DisplayPinCode.patch"
epatch "${FILESDIR}/${P}-autopair-0009-Add-support-for-retrying-a-bonding.patch"
epatch "${FILESDIR}/${P}-autopair-0010-plugin-Add-bonding-callback-support-for-plugins.patch"
epatch "${FILESDIR}/${P}-autopair-0011-bonding-retry-if-callback-returns-TRUE.patch"
epatch "${FILESDIR}/${P}-autopair-0012-bonding-call-plugin-callback-on-cancellation.patch"
epatch "${FILESDIR}/${P}-autopair-0013-autopair-Add-autopair-plugin.patch"
# Automatic pairing of dumb devices. Not yet submitted upstream
# so kept as a separate patch on top of the above series.
epatch "${FILESDIR}/${PN}-autopair.patch"
# Playstation3 Controller pairing plugin, retrieved from
# linux-bluetooth mailing list (posted 2012-04-18).
epatch "${FILESDIR}/${P}-ps3-0001.patch"
epatch "${FILESDIR}/${P}-ps3-0002.patch"
epatch "${FILESDIR}/${P}-ps3-0003.patch"
# Fix EIR parsing causing class of devices to be lost, retrieved
# from GIT head.
epatch "${FILESDIR}/${P}-eir-Fix-incorrect-eir_has_data_type-parsing.patch"
epatch "${FILESDIR}/${P}-eir-Fix-incorrect-eir_length-parsing.patch"
eautoreconf
if use cups; then
sed -i \
-e "s:cupsdir = \$(libdir)/cups:cupsdir = `cups-config --serverbin`:" \
Makefile.tools Makefile.in || die
fi
}
src_configure() {
use readline || export ac_cv_header_readline_readline_h=no
econf \
--enable-audio \
--enable-bccmd \
--enable-datafiles \
--enable-dfutool \
--enable-input \
--enable-network \
--enable-serial \
--enable-service \
--enable-tools \
--disable-hal \
--localstatedir=/var \
--with-systemdunitdir="$(systemd_get_unitdir)" \
--with-ouifile=/usr/share/misc/oui.txt \
$(use_enable alsa) \
$(use_enable caps capng) \
$(use_enable cups) \
$(use_enable debug) \
$(use_enable gstreamer) \
$(use_enable pcmcia) \
$(use_enable test-programs test) \
$(use_enable usb) \
--enable-health \
--enable-wiimote \
--enable-dbusoob \
--enable-autopair \
--enable-playstation_peripheral
}
src_install() {
default
if use test-programs ; then
cd "${S}/test"
dobin simple-agent simple-service monitor-bluetooth
newbin list-devices list-bluetooth-devices
rm test-textfile.{c,o} || die # bug #356529
for b in apitest hsmicro hsplay test-* ; do
newbin "${b}" "bluez-${b}"
done
insinto /usr/share/doc/${PF}/test-services
doins service-*
python_convert_shebangs -r 2 "${ED}"
cd "${S}"
fi
insinto /etc/bluetooth
doins \
input/input.conf \
audio/audio.conf \
network/network.conf \
serial/serial.conf
newinitd "${FILESDIR}/bluetooth-init.d-r1" bluetooth
newinitd "${FILESDIR}/rfcomm-init.d" rfcomm
newconfd "${FILESDIR}/rfcomm-conf.d" rfcomm
insinto /etc/init
newins "${FILESDIR}/${PN}-upstart.conf" bluetoothd.conf
insinto /lib/udev/rules.d
newins "${FILESDIR}/${PN}-ps3-gamepad.rules" "99-ps3-gamepad.rules"
# Install oui.txt as requested in bug #283791 and approved by upstream
insinto /usr/share/misc
newins "${WORKDIR}/oui-${OUIDATE}.txt" oui.txt
fowners bluetooth:bluetooth /var/lib/bluetooth
rm "${D}/lib/udev/rules.d/97-bluetooth.rules"
find "${D}" -name "*.la" -delete
}
pkg_postinst() {
udevadm control --reload-rules && udevadm trigger --subsystem-match=bluetooth
if ! has_version "net-dialup/ppp"; then
elog "To use dial up networking you must install net-dialup/ppp."
fi
if use consolekit; then
elog "If you want to use rfcomm as a normal user, you need to add the user"
elog "to the uucp group."
else
elog "Since you have the consolekit use flag disabled, you will only be able to run"
elog "bluetooth clients as root. If you want to be able to run bluetooth clientes as "
elog "a regular user, you need to enable the consolekit use flag for this package or"
elog "to add the user to the plugdev group."
fi
if [ "$(rc-config list default | grep bluetooth)" = "" ] ; then
elog "You will need to add bluetooth service to default runlevel"
elog "for getting your devices detected from startup without needing"
elog "to reconnect them. For that please run:"
elog "'rc-update add bluetooth default'"
fi
}

View File

@ -1,5 +0,0 @@
# Bluetooth hidd daemon configuraton file
# Arguments to hidd
HIDD_OPTIONS="--encrypt"

View File

@ -1,18 +0,0 @@
? cups/.deps
? cups/Makefile
? cups/Makefile.in
Index: cups/Makefile.am
===================================================================
RCS file: /cvsroot/bluez/utils/cups/Makefile.am,v
retrieving revision 1.9
diff -u -r1.9 Makefile.am
--- cups/Makefile.am 20 Aug 2006 02:21:03 -0000 1.9
+++ cups/Makefile.am 1 Jun 2007 15:47:14 -0000
@@ -1,6 +1,6 @@
if CUPS
-cupsdir = $(libdir)/cups/backend
+cupsdir = `cups-config --serverbin`/backend
cups_PROGRAMS = bluetooth
else

View File

@ -1,29 +0,0 @@
#!/sbin/runscript
# Copyright 1999-2007 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/net-wireless/bluez/files/4.18/init.d-hidd,v 1.1 2008/11/28 21:21:35 dev-zero Exp $
depend() {
need bluetooth
}
start() {
ebegin "Starting hidd"
start-stop-daemon --start --quiet \
--exec /usr/bin/hidd -- ${HIDD_OPTIONS} --server
local result="$?"
local service="/etc/bluetooth/input.service"
if [ "${result}" != "0" ] && grep -q "Autostart=true" ${service}; then
eerror "You have Autostart=true in ${service}."
eerror "Change this to false if you want to use hidd."
fi
eend ${result}
}
stop() {
ebegin "Stopping hidd"
hidd --killall
start-stop-daemon --stop --quiet --exec /usr/bin/hidd
eend $?
}

View File

@ -1,31 +0,0 @@
diff -Naur bluez-4.31.orig/common/Makefile.am bluez-4.31/common/Makefile.am
--- bluez-4.31.orig/common/Makefile.am 2009-02-27 22:57:29.515330134 +0100
+++ bluez-4.31/common/Makefile.am 2009-02-27 22:58:11.249328307 +0100
@@ -4,6 +4,8 @@
libhelper_a_SOURCES = oui.h oui.c textfile.h textfile.c logging.h logging.c \
glib-helper.h glib-helper.c sdp-xml.h sdp-xml.c btio.h btio.c
+libhelper_a_LIBADD = @BLUEZ_LIBS@
+
noinst_PROGRAMS = test_textfile
test_textfile_LDADD = libhelper.a
diff -Naur bluez-4.31.orig/test/Makefile.am bluez-4.31/test/Makefile.am
--- bluez-4.31.orig/test/Makefile.am 2009-02-27 22:57:29.518659538 +0100
+++ bluez-4.31/test/Makefile.am 2009-02-27 23:07:09.294597176 +0100
@@ -23,13 +23,13 @@
bdaddr_SOURCES = bdaddr.c
-bdaddr_LDADD = @BLUEZ_LIBS@ $(top_builddir)/common/libhelper.a
+bdaddr_LDADD = $(top_builddir)/common/libhelper.a @BLUEZ_LIBS@
lmptest_LDADD = @BLUEZ_LIBS@
agent_LDADD = @DBUS_LIBS@
-btiotest_LDADD = @GLIB_LIBS@ @BLUEZ_LIBS@ $(top_builddir)/common/libhelper.a
+btiotest_LDADD = @GLIB_LIBS@ $(top_builddir)/common/libhelper.a @BLUEZ_LIBS@
noinst_MANS = bdaddr.8

View File

@ -1,39 +0,0 @@
The configure stuff is a inconsequent:
- even if neither alsa nor gstreamer support is enabled, SBC_LIBS gets substituted by libsbc.la
which doesn't get build without alsa or gstreamer. Making this conditional helps.
- ipctest needs both libipc.la and libsbc.la and fails if SBC_LIBS/SBC_CFLAGS are empty,
making the build conditional helps again.
--- acinclude.m4.orig 2009-04-06 16:26:14.570780241 +0200
+++ acinclude.m4 2009-04-06 16:26:59.540779148 +0200
@@ -330,8 +330,10 @@
AC_SUBST([GDBUS_CFLAGS], ['-I$(top_srcdir)/gdbus'])
AC_SUBST([GDBUS_LIBS], ['$(top_builddir)/gdbus/libgdbus.la'])
- AC_SUBST([SBC_CFLAGS], ['-I$(top_srcdir)/sbc'])
- AC_SUBST([SBC_LIBS], ['$(top_builddir)/sbc/libsbc.la'])
+ if (test "${alsa_enable}" = "yes" || test "${gstreamer_enable}" = "yes"); then
+ AC_SUBST([SBC_CFLAGS], ['-I$(top_srcdir)/sbc'])
+ AC_SUBST([SBC_LIBS], ['$(top_builddir)/sbc/libsbc.la'])
+ fi
AM_CONDITIONAL(SNDFILE, test "${sndfile_enable}" = "yes" && test "${sndfile_found}" = "yes")
AM_CONDITIONAL(NETLINK, test "${netlink_enable}" = "yes" && test "${netlink_found}" = "yes")
--- audio/Makefile.am.orig 2009-04-06 16:47:21.240681272 +0200
+++ audio/Makefile.am 2009-04-06 17:42:27.240597715 +0200
@@ -60,10 +60,16 @@
libipc_la_SOURCES = ipc.h ipc.c
+if AUDIOPLUGIN
+if SBC
+
noinst_PROGRAMS = ipctest
ipctest_LDADD= libipc.la @SBC_LIBS@ @GLIB_LIBS@
+endif
+endif
+
AM_CFLAGS = -fvisibility=hidden @SBC_CFLAGS@ \
@BLUEZ_CFLAGS@ @DBUS_CFLAGS@ @GLIB_CFLAGS@ @GDBUS_CFLAGS@

View File

@ -1,7 +0,0 @@
# Bluetooth configuraton file
# Bind rfcomm devices (allowed values are "true" and "false")
RFCOMM_ENABLE=true
# Config file for rfcomm
RFCOMM_CONFIG="/etc/bluetooth/rfcomm.conf"

View File

@ -1,31 +0,0 @@
#!/sbin/runscript
# Copyright 1999-2008 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/net-wireless/bluez/files/4.60/bluetooth-init.d,v 1.1 2010/02/01 19:47:46 pacho Exp $
depend() {
after coldplug
need dbus localmount
}
start() {
ebegin "Starting Bluetooth"
udevadm trigger --subsystem-match=bluetooth
eend $?
if [ "${RFCOMM_ENABLE}" = "true" -a -x /usr/bin/rfcomm ]; then
if [ -f "${RFCOMM_CONFIG}" ]; then
ebegin " Starting rfcomm"
/usr/bin/rfcomm -f "${RFCOMM_CONFIG}" bind all
eend $?
else
ewarn "Not enabling rfcomm because RFCOMM_CONFIG does not exists"
fi
fi
}
stop() {
ebegin "Shutting down Bluetooth"
eend 0
}

View File

@ -1,19 +0,0 @@
#!/sbin/runscript
# Copyright 1999-2012 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/net-wireless/bluez/files/bluetooth-init.d-r1,v 1.1 2012/01/09 23:01:55 pacho Exp $
depend() {
after coldplug
need dbus localmount hostname
}
start() {
ebegin "Udev coldplug of bluetooth devices"
udevadm trigger --subsystem-match=bluetooth --action=add
eend $?
}
stop() {
return 0
}

View File

@ -1,5 +0,0 @@
# Start/Stop bluetooth service on device insertion. Gentoo specific.
SUBSYSTEM=="bluetooth", KERNEL=="hci[0-9]*", RUN+="bluetooth.sh"
# So that normal users can dial out.
SUBSYSTEM=="tty", SUBSYSTEMS=="bluetooth", GROUP="uucp"

View File

@ -1,28 +0,0 @@
#!/bin/sh
#
# bluetooth.sh: udev external RUN script
#
# Copyright:
# 2005-2006 Henrik Brix Andersen <brix@gentoo.org>
# 2007 Petteri Räty <betelgeuse@gentoo.org>
# 2008 Tiziano Müller <dev-zero@gentoo.org>
# Distributed under the terms of the GNU General Public License v2
script=/etc/init.d/bluetooth
# Find out where sysfs is mounted. Exit if not available
sysfs=`grep -F sysfs /proc/mounts | awk '{print $2}'`
if [ "$sysfs" = "" ]; then
echo "sysfs is required"
exit 1
fi
if [ ! -d $sysfs/class/bluetooth/hci[0-9]* -a ! -d $sysfs/bus/bluetooth/devices/hci[0-9]* ]; then
if $script --quiet status; then
IN_HOTPLUG=1 $script --quiet stop
fi
else
if ! $script --quiet status; then
IN_HOTPLUG=1 $script --quiet start
fi
fi

View File

@ -1,21 +0,0 @@
#!/bin/sh
#
# bluetooth.sh: udev external RUN script
#
# Copyright:
# 2005-2006 Henrik Brix Andersen <brix@gentoo.org>
# 2007 Petteri Räty <betelgeuse@gentoo.org>
# 2008 Tiziano Müller <dev-zero@gentoo.org>
# 2011 Pacho Ramos <pacho@gentoo.org>
# Distributed under the terms of the GNU General Public License v2
# Find out where sysfs is mounted. Exit if not available
sysfs=`grep -F sysfs /proc/mounts | awk '{print $2}'`
if [ "$sysfs" = "" ]; then
echo "sysfs is required"
exit 1
fi
if [ ! -d $sysfs/class/bluetooth/hci[0-9]* -a ! -d $sysfs/bus/bluetooth/devices/hci[0-9]* ]; then
udevadm trigger --subsystem-match=bluetooth --action=add
fi

View File

@ -1,83 +0,0 @@
From be1631d70689cfde701e9a1642a5afad11252af7 Mon Sep 17 00:00:00 2001
From: Scott James Remnant <scott@netsplit.com>
Date: Mon, 23 Jan 2012 10:40:25 -0800
Subject: [PATCH 01/13] Rename AUTH_TYPE_NOTIFY to AUTH_TYPE_NOTIFY_PASSKEY
This makes room for additional notification types to be added.
---
src/device.c | 8 ++++----
src/device.h | 2 +-
src/event.c | 4 ++--
3 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/src/device.c b/src/device.c
index dfc8e59..92c13f5 100644
--- a/src/device.c
+++ b/src/device.c
@@ -2453,7 +2453,7 @@ void device_simple_pairing_complete(struct btd_device *device, uint8_t status)
{
struct authentication_req *auth = device->authr;
- if (auth && auth->type == AUTH_TYPE_NOTIFY && auth->agent)
+ if (auth && auth->type == AUTH_TYPE_NOTIFY_PASSKEY && auth->agent)
agent_cancel(auth->agent);
}
@@ -2470,7 +2470,7 @@ void device_bonding_complete(struct btd_device *device, uint8_t status)
DBG("bonding %p status 0x%02x", bonding, status);
- if (auth && auth->type == AUTH_TYPE_NOTIFY && auth->agent)
+ if (auth && auth->type == AUTH_TYPE_NOTIFY_PASSKEY && auth->agent)
agent_cancel(auth->agent);
if (status) {
@@ -2724,7 +2724,7 @@ int device_request_authentication(struct btd_device *device, auth_type_t type,
err = agent_request_confirmation(agent, device, passkey,
confirm_cb, auth, NULL);
break;
- case AUTH_TYPE_NOTIFY:
+ case AUTH_TYPE_NOTIFY_PASSKEY:
err = agent_display_passkey(agent, device, passkey);
break;
default:
@@ -2764,7 +2764,7 @@ static void cancel_authentication(struct authentication_req *auth)
case AUTH_TYPE_PASSKEY:
((agent_passkey_cb) auth->cb)(agent, &err, 0, device);
break;
- case AUTH_TYPE_NOTIFY:
+ case AUTH_TYPE_NOTIFY_PASSKEY:
/* User Notify doesn't require any reply */
break;
}
diff --git a/src/device.h b/src/device.h
index 7cb9bb2..aa7f2f1 100644
--- a/src/device.h
+++ b/src/device.h
@@ -30,7 +30,7 @@ typedef enum {
AUTH_TYPE_PINCODE,
AUTH_TYPE_PASSKEY,
AUTH_TYPE_CONFIRM,
- AUTH_TYPE_NOTIFY,
+ AUTH_TYPE_NOTIFY_PASSKEY,
} auth_type_t;
struct btd_device *device_create(DBusConnection *conn,
diff --git a/src/event.c b/src/event.c
index 113a2b6..95cdbdb 100644
--- a/src/event.c
+++ b/src/event.c
@@ -202,8 +202,8 @@ int btd_event_user_notify(bdaddr_t *sba, bdaddr_t *dba, uint32_t passkey)
if (!get_adapter_and_device(sba, dba, &adapter, &device, TRUE))
return -ENODEV;
- return device_request_authentication(device, AUTH_TYPE_NOTIFY, passkey,
- FALSE, NULL);
+ return device_request_authentication(device, AUTH_TYPE_NOTIFY_PASSKEY,
+ passkey, FALSE, NULL);
}
void btd_event_simple_pairing_complete(bdaddr_t *local, bdaddr_t *peer,
--
1.7.7.3

View File

@ -1,107 +0,0 @@
From 888f24266b8ff06d7007afb5e6a38ba621750451 Mon Sep 17 00:00:00 2001
From: Scott James Remnant <scott@netsplit.com>
Date: Mon, 23 Jan 2012 10:43:48 -0800
Subject: [PATCH 02/13] Pass passkey by pointer rather than by value
This allows alternate data of a different type to be passed to
device_request_authentication() for other notification types such
as those that require a PIN.
---
src/device.c | 9 +++++----
src/device.h | 2 +-
src/event.c | 8 ++++----
3 files changed, 10 insertions(+), 9 deletions(-)
diff --git a/src/device.c b/src/device.c
index 92c13f5..8a2ae9d 100644
--- a/src/device.c
+++ b/src/device.c
@@ -2681,7 +2681,7 @@ done:
}
int device_request_authentication(struct btd_device *device, auth_type_t type,
- uint32_t passkey, gboolean secure, void *cb)
+ void *data, gboolean secure, void *cb)
{
struct authentication_req *auth;
struct agent *agent;
@@ -2707,7 +2707,6 @@ int device_request_authentication(struct btd_device *device, auth_type_t type,
auth->device = device;
auth->cb = cb;
auth->type = type;
- auth->passkey = passkey;
auth->secure = secure;
device->authr = auth;
@@ -2721,11 +2720,13 @@ int device_request_authentication(struct btd_device *device, auth_type_t type,
auth, NULL);
break;
case AUTH_TYPE_CONFIRM:
- err = agent_request_confirmation(agent, device, passkey,
+ auth->passkey = *(uint32_t *)data;
+ err = agent_request_confirmation(agent, device, auth->passkey,
confirm_cb, auth, NULL);
break;
case AUTH_TYPE_NOTIFY_PASSKEY:
- err = agent_display_passkey(agent, device, passkey);
+ auth->passkey = *(uint32_t *)data;
+ err = agent_display_passkey(agent, device, auth->passkey);
break;
default:
err = -EINVAL;
diff --git a/src/device.h b/src/device.h
index aa7f2f1..998aee7 100644
--- a/src/device.h
+++ b/src/device.h
@@ -83,7 +83,7 @@ gboolean device_is_creating(struct btd_device *device, const char *sender);
gboolean device_is_bonding(struct btd_device *device, const char *sender);
void device_cancel_bonding(struct btd_device *device, uint8_t status);
int device_request_authentication(struct btd_device *device, auth_type_t type,
- uint32_t passkey, gboolean secure, void *cb);
+ void *data, gboolean secure, void *cb);
void device_cancel_authentication(struct btd_device *device, gboolean aborted);
gboolean device_is_authenticating(struct btd_device *device);
gboolean device_is_authorizing(struct btd_device *device);
diff --git a/src/event.c b/src/event.c
index 95cdbdb..7d66b6d 100644
--- a/src/event.c
+++ b/src/event.c
@@ -130,7 +130,7 @@ int btd_event_request_pin(bdaddr_t *sba, bdaddr_t *dba, gboolean secure)
return 0;
}
- return device_request_authentication(device, AUTH_TYPE_PINCODE, 0,
+ return device_request_authentication(device, AUTH_TYPE_PINCODE, NULL,
secure, pincode_cb);
}
@@ -179,7 +179,7 @@ int btd_event_user_confirm(bdaddr_t *sba, bdaddr_t *dba, uint32_t passkey)
return -ENODEV;
return device_request_authentication(device, AUTH_TYPE_CONFIRM,
- passkey, FALSE, confirm_cb);
+ &passkey, FALSE, confirm_cb);
}
int btd_event_user_passkey(bdaddr_t *sba, bdaddr_t *dba)
@@ -190,7 +190,7 @@ int btd_event_user_passkey(bdaddr_t *sba, bdaddr_t *dba)
if (!get_adapter_and_device(sba, dba, &adapter, &device, TRUE))
return -ENODEV;
- return device_request_authentication(device, AUTH_TYPE_PASSKEY, 0,
+ return device_request_authentication(device, AUTH_TYPE_PASSKEY, NULL,
FALSE, passkey_cb);
}
@@ -203,7 +203,7 @@ int btd_event_user_notify(bdaddr_t *sba, bdaddr_t *dba, uint32_t passkey)
return -ENODEV;
return device_request_authentication(device, AUTH_TYPE_NOTIFY_PASSKEY,
- passkey, FALSE, NULL);
+ &passkey, FALSE, NULL);
}
void btd_event_simple_pairing_complete(bdaddr_t *local, bdaddr_t *peer,
--
1.7.7.3

View File

@ -1,161 +0,0 @@
From e84af9f6ba447c540512d56ccc7326af621749bc Mon Sep 17 00:00:00 2001
From: Scott James Remnant <scott@netsplit.com>
Date: Mon, 23 Jan 2012 10:56:56 -0800
Subject: [PATCH 03/13] agent: add DisplayPinCode method
In constrast to DisplayPasskey, this sends a UTF-8 string PIN code
to the agent; also we support a callback for the case where the
Agent doesn't implement this new method so we can fallback.
---
src/agent.c | 112 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-
src/agent.h | 4 ++
2 files changed, 115 insertions(+), 1 deletions(-)
diff --git a/src/agent.c b/src/agent.c
index 9b942e8..23e3b43 100644
--- a/src/agent.c
+++ b/src/agent.c
@@ -52,7 +52,8 @@ typedef enum {
AGENT_REQUEST_CONFIRMATION,
AGENT_REQUEST_PINCODE,
AGENT_REQUEST_AUTHORIZE,
- AGENT_REQUEST_CONFIRM_MODE
+ AGENT_REQUEST_CONFIRM_MODE,
+ AGENT_REQUEST_DISPLAY_PINCODE,
} agent_request_type_t;
struct agent {
@@ -699,6 +700,115 @@ int agent_display_passkey(struct agent *agent, struct btd_device *device,
return 0;
}
+static void display_pincode_reply(DBusPendingCall *call, void *user_data)
+{
+ struct agent_request *req = user_data;
+ struct agent *agent = req->agent;
+ DBusMessage *message;
+ DBusError err;
+ agent_cb cb = req->cb;
+
+ /* clear agent->request early; our callback will likely try
+ * another request */
+ agent->request = NULL;
+
+ /* steal_reply will always return non-NULL since the callback
+ * is only called after a reply has been received */
+ message = dbus_pending_call_steal_reply(call);
+
+ dbus_error_init(&err);
+ if (dbus_set_error_from_message(&err, message)) {
+ error("Agent replied with an error: %s, %s",
+ err.name, err.message);
+
+ cb(agent, &err, req->user_data);
+
+ if (dbus_error_has_name(&err, DBUS_ERROR_NO_REPLY)) {
+ agent_cancel(agent);
+ dbus_message_unref(message);
+ dbus_error_free(&err);
+ return;
+ }
+
+ dbus_error_free(&err);
+ goto done;
+ }
+
+ dbus_error_init(&err);
+ if (!dbus_message_get_args(message, &err, DBUS_TYPE_INVALID)) {
+ error("Wrong reply signature: %s", err.message);
+ cb(agent, &err, req->user_data);
+ dbus_error_free(&err);
+ goto done;
+ }
+
+ cb(agent, NULL, req->user_data);
+done:
+ dbus_message_unref(message);
+
+ agent_request_free(req, TRUE);
+}
+
+static int display_pincode_request_new(struct agent_request *req,
+ const char *device_path,
+ const char *pincode)
+{
+ struct agent *agent = req->agent;
+
+ req->msg = dbus_message_new_method_call(agent->name, agent->path,
+ "org.bluez.Agent", "DisplayPinCode");
+ if (req->msg == NULL) {
+ error("Couldn't allocate D-Bus message");
+ return -ENOMEM;
+ }
+
+ dbus_message_append_args(req->msg,
+ DBUS_TYPE_OBJECT_PATH, &device_path,
+ DBUS_TYPE_STRING, &pincode,
+ DBUS_TYPE_INVALID);
+
+ if (dbus_connection_send_with_reply(connection, req->msg,
+ &req->call, REQUEST_TIMEOUT) == FALSE) {
+ error("D-Bus send failed");
+ return -EIO;
+ }
+
+ dbus_pending_call_set_notify(req->call, display_pincode_reply,
+ req, NULL);
+
+ return 0;
+}
+
+int agent_display_pincode(struct agent *agent, struct btd_device *device,
+ const char *pincode, agent_cb cb,
+ void *user_data, GDestroyNotify destroy)
+{
+ struct agent_request *req;
+ const gchar *dev_path = device_get_path(device);
+ int err;
+
+ if (agent->request)
+ return -EBUSY;
+
+ DBG("Calling Agent.DisplayPinCode: name=%s, path=%s, pincode=%s",
+ agent->name, agent->path, pincode);
+
+ req = agent_request_new(agent, AGENT_REQUEST_DISPLAY_PINCODE, cb,
+ user_data, destroy);
+
+ err = display_pincode_request_new(req, dev_path, pincode);
+ if (err < 0)
+ goto failed;
+
+ agent->request = req;
+
+ return 0;
+
+failed:
+ agent_request_free(req, FALSE);
+ return err;
+}
+
uint8_t agent_get_io_capability(struct agent *agent)
{
return agent->capability;
diff --git a/src/agent.h b/src/agent.h
index f62bf3b..69ad42b 100644
--- a/src/agent.h
+++ b/src/agent.h
@@ -64,6 +64,10 @@ int agent_request_confirmation(struct agent *agent, struct btd_device *device,
int agent_display_passkey(struct agent *agent, struct btd_device *device,
uint32_t passkey);
+int agent_display_pincode(struct agent *agent, struct btd_device *device,
+ const char *pincode, agent_cb cb,
+ void *user_data, GDestroyNotify destroy);
+
int agent_cancel(struct agent *agent);
gboolean agent_is_busy(struct agent *agent, void *user_data);
--
1.7.7.3

View File

@ -1,151 +0,0 @@
From 16583671c03b871003430e433ddf197833ea0086 Mon Sep 17 00:00:00 2001
From: Scott James Remnant <scott@netsplit.com>
Date: Mon, 23 Jan 2012 15:16:40 -0800
Subject: [PATCH 04/13] Add AUTH_TYPE_NOTIFY_PASSKEY to
device_request_authentication
This new authentication type accepts a pincode and calls the
DisplayPinCode agent method, a fallback is provided so that if the
method is not implemented the older RequestPinCode method is used
instead.
Due to this fallback, the agent_pincode_cb is used and calling
functions should send the pincode passed to the callback to the
adapter, which may differ from that generated.
---
src/device.c | 59 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++-
src/device.h | 1 +
2 files changed, 58 insertions(+), 2 deletions(-)
diff --git a/src/device.c b/src/device.c
index 8a2ae9d..f32666e 100644
--- a/src/device.c
+++ b/src/device.c
@@ -93,6 +93,7 @@ struct authentication_req {
struct agent *agent;
struct btd_device *device;
uint32_t passkey;
+ char *pincode;
gboolean secure;
};
@@ -277,6 +278,8 @@ static void device_free(gpointer user_data)
DBG("%p", device);
+ if (device->authr)
+ g_free(device->authr->pincode);
g_free(device->authr);
g_free(device->path);
g_free(device->alias);
@@ -2453,12 +2456,15 @@ void device_simple_pairing_complete(struct btd_device *device, uint8_t status)
{
struct authentication_req *auth = device->authr;
- if (auth && auth->type == AUTH_TYPE_NOTIFY_PASSKEY && auth->agent)
+ if (auth && (auth->type == AUTH_TYPE_NOTIFY_PASSKEY
+ || auth->type == AUTH_TYPE_NOTIFY_PINCODE) && auth->agent)
agent_cancel(auth->agent);
}
static void device_auth_req_free(struct btd_device *device)
{
+ if (device->authr)
+ g_free(device->authr->pincode);
g_free(device->authr);
device->authr = NULL;
}
@@ -2470,7 +2476,8 @@ void device_bonding_complete(struct btd_device *device, uint8_t status)
DBG("bonding %p status 0x%02x", bonding, status);
- if (auth && auth->type == AUTH_TYPE_NOTIFY_PASSKEY && auth->agent)
+ if (auth && (auth->type == AUTH_TYPE_NOTIFY_PASSKEY
+ || auth->type == AUTH_TYPE_NOTIFY_PINCODE) && auth->agent)
agent_cancel(auth->agent);
if (status) {
@@ -2680,6 +2687,46 @@ done:
device->authr->agent = NULL;
}
+static void display_pincode_cb(struct agent *agent, DBusError *err, void *data)
+{
+ struct authentication_req *auth = data;
+ struct btd_device *device = auth->device;
+ struct btd_adapter *adapter = device_get_adapter(device);
+ struct agent *adapter_agent = adapter_get_agent(adapter);
+
+ if (err && (g_str_equal(DBUS_ERROR_UNKNOWN_METHOD, err->name) ||
+ g_str_equal(DBUS_ERROR_NO_REPLY, err->name))) {
+
+ /* Request a pincode if we fail to display one */
+ if (auth->agent == adapter_agent || adapter_agent == NULL) {
+ if (agent_request_pincode(agent, device, pincode_cb,
+ auth->secure, auth, NULL) < 0)
+ goto done;
+ return;
+ }
+
+ if (agent_display_pincode(adapter_agent, device, auth->pincode,
+ display_pincode_cb, auth, NULL) < 0)
+ goto done;
+
+ auth->agent = adapter_agent;
+ return;
+ }
+
+done:
+ /* No need to reply anything if the authentication already failed */
+ if (auth->cb == NULL)
+ return;
+
+ ((agent_pincode_cb) auth->cb)(agent, err, auth->pincode, device);
+
+ g_free(device->authr->pincode);
+ device->authr->pincode = NULL;
+ device->authr->cb = NULL;
+ device->authr->agent = NULL;
+}
+
+
int device_request_authentication(struct btd_device *device, auth_type_t type,
void *data, gboolean secure, void *cb)
{
@@ -2728,6 +2775,11 @@ int device_request_authentication(struct btd_device *device, auth_type_t type,
auth->passkey = *(uint32_t *)data;
err = agent_display_passkey(agent, device, auth->passkey);
break;
+ case AUTH_TYPE_NOTIFY_PINCODE:
+ auth->pincode = g_strdup((const char *)data);
+ err = agent_display_pincode(agent, device, auth->pincode,
+ display_pincode_cb, auth, NULL);
+ break;
default:
err = -EINVAL;
}
@@ -2768,6 +2820,9 @@ static void cancel_authentication(struct authentication_req *auth)
case AUTH_TYPE_NOTIFY_PASSKEY:
/* User Notify doesn't require any reply */
break;
+ case AUTH_TYPE_NOTIFY_PINCODE:
+ ((agent_pincode_cb) auth->cb)(agent, &err, NULL, device);
+ break;
}
dbus_error_free(&err);
diff --git a/src/device.h b/src/device.h
index 998aee7..561865c 100644
--- a/src/device.h
+++ b/src/device.h
@@ -31,6 +31,7 @@ typedef enum {
AUTH_TYPE_PASSKEY,
AUTH_TYPE_CONFIRM,
AUTH_TYPE_NOTIFY_PASSKEY,
+ AUTH_TYPE_NOTIFY_PINCODE,
} auth_type_t;
struct btd_device *device_create(DBusConnection *conn,
--
1.7.7.3

View File

@ -1,92 +0,0 @@
From 1630cbe326460a89d5c342847b658a499484ced0 Mon Sep 17 00:00:00 2001
From: Scott James Remnant <scott@netsplit.com>
Date: Thu, 29 Mar 2012 14:04:14 -0700
Subject: [PATCH 05/13] Add display parameter to plugin pincode callback
Pass a display parameter to the plugin pincode callback, a plugin
may set this to TRUE to indicate the PIN it generates should be
displayed on the screen for entry into the remote device.
---
plugins/wiimote.c | 2 +-
src/adapter.c | 4 ++--
src/adapter.h | 4 ++--
src/event.c | 3 ++-
4 files changed, 7 insertions(+), 6 deletions(-)
diff --git a/plugins/wiimote.c b/plugins/wiimote.c
index 1ae638b..43b6de3 100644
--- a/plugins/wiimote.c
+++ b/plugins/wiimote.c
@@ -56,7 +56,7 @@
*/
static ssize_t wii_pincb(struct btd_adapter *adapter, struct btd_device *device,
- char *pinbuf)
+ char *pinbuf, gboolean *display)
{
uint16_t vendor, product;
bdaddr_t sba, dba;
diff --git a/src/adapter.c b/src/adapter.c
index acb845e..ccf7991 100644
--- a/src/adapter.c
+++ b/src/adapter.c
@@ -3330,7 +3330,7 @@ void btd_adapter_unregister_pin_cb(struct btd_adapter *adapter,
}
ssize_t btd_adapter_get_pin(struct btd_adapter *adapter, struct btd_device *dev,
- char *pin_buf)
+ char *pin_buf, gboolean *display)
{
GSList *l;
btd_adapter_pin_cb_t cb;
@@ -3339,7 +3339,7 @@ ssize_t btd_adapter_get_pin(struct btd_adapter *adapter, struct btd_device *dev,
for (l = adapter->pin_callbacks; l != NULL; l = g_slist_next(l)) {
cb = l->data;
- ret = cb(adapter, dev, pin_buf);
+ ret = cb(adapter, dev, pin_buf, display);
if (ret > 0)
return ret;
}
diff --git a/src/adapter.h b/src/adapter.h
index ceebb97..aa66070 100644
--- a/src/adapter.h
+++ b/src/adapter.h
@@ -172,13 +172,13 @@ int btd_adapter_switch_offline(struct btd_adapter *adapter);
void btd_adapter_enable_auto_connect(struct btd_adapter *adapter);
typedef ssize_t (*btd_adapter_pin_cb_t) (struct btd_adapter *adapter,
- struct btd_device *dev, char *out);
+ struct btd_device *dev, char *out, gboolean *display);
void btd_adapter_register_pin_cb(struct btd_adapter *adapter,
btd_adapter_pin_cb_t cb);
void btd_adapter_unregister_pin_cb(struct btd_adapter *adapter,
btd_adapter_pin_cb_t cb);
ssize_t btd_adapter_get_pin(struct btd_adapter *adapter, struct btd_device *dev,
- char *pin_buf);
+ char *pin_buf, gboolean *display);
typedef void (*bt_hci_result_t) (uint8_t status, gpointer user_data);
diff --git a/src/event.c b/src/event.c
index 7d66b6d..d87b6a4 100644
--- a/src/event.c
+++ b/src/event.c
@@ -119,12 +119,13 @@ int btd_event_request_pin(bdaddr_t *sba, bdaddr_t *dba, gboolean secure)
struct btd_device *device;
char pin[17];
ssize_t pinlen;
+ gboolean display = FALSE;
if (!get_adapter_and_device(sba, dba, &adapter, &device, TRUE))
return -ENODEV;
memset(pin, 0, sizeof(pin));
- pinlen = btd_adapter_get_pin(adapter, device, pin);
+ pinlen = btd_adapter_get_pin(adapter, device, pin, &display);
if (pinlen > 0 && (!secure || pinlen == 16)) {
btd_adapter_pincode_reply(adapter, dba, pin, pinlen);
return 0;
--
1.7.7.3

View File

@ -1,31 +0,0 @@
From 2a902f071ec21572094ce9cdf54099ad275e7904 Mon Sep 17 00:00:00 2001
From: Scott James Remnant <scott@netsplit.com>
Date: Thu, 29 Mar 2012 14:07:13 -0700
Subject: [PATCH 06/13] Display PIN generated by plugin
If a plugin pincode callback sets the display parameter to TRUE, send
the generated PIN to the agent for display using the new DisplayPinCode
agent method, including its fallback to RequestPinCode.
---
src/event.c | 5 +++++
1 files changed, 5 insertions(+), 0 deletions(-)
diff --git a/src/event.c b/src/event.c
index d87b6a4..5b60fb3 100644
--- a/src/event.c
+++ b/src/event.c
@@ -127,6 +127,11 @@ int btd_event_request_pin(bdaddr_t *sba, bdaddr_t *dba, gboolean secure)
memset(pin, 0, sizeof(pin));
pinlen = btd_adapter_get_pin(adapter, device, pin, &display);
if (pinlen > 0 && (!secure || pinlen == 16)) {
+ if (display && device_is_bonding(device, NULL))
+ return device_request_authentication(device,
+ AUTH_TYPE_NOTIFY_PINCODE, pin,
+ secure, pincode_cb);
+
btd_adapter_pincode_reply(adapter, dba, pin, pinlen);
return 0;
}
--
1.7.7.3

View File

@ -1,47 +0,0 @@
From 8a9347822f86059d015ae3893387aa971fa41ab7 Mon Sep 17 00:00:00 2001
From: Scott James Remnant <scott@netsplit.com>
Date: Mon, 23 Jan 2012 15:25:39 -0800
Subject: [PATCH 07/13] doc: document DisplayPinCode
---
doc/agent-api.txt | 24 ++++++++++++++++++++++++
1 files changed, 24 insertions(+), 0 deletions(-)
diff --git a/doc/agent-api.txt b/doc/agent-api.txt
index 9ab2063..5c8d4d2 100644
--- a/doc/agent-api.txt
+++ b/doc/agent-api.txt
@@ -61,6 +61,30 @@ Methods void Release()
so the display should be zero-padded at the start if
the value contains less than 6 digits.
+ void DisplayPinCode(object device, string pincode)
+
+ This method gets called when the service daemon
+ needs to display a pincode for an authentication.
+
+ An empty reply should be returned. When the pincode
+ needs no longer to be displayed, the Cancel method
+ of the agent will be called.
+
+ If this method is not implemented the RequestPinCode
+ method will be used instead.
+
+ This is used during the pairing process of keyboards
+ that don't support Bluetooth 2.1 Secure Simple Pairing,
+ in contrast to DisplayPasskey which is used for those
+ that do.
+
+ This method will only ever be called once since
+ older keyboards do not support typing notification.
+
+ Note that the PIN will always be a 6-digit number,
+ zero-padded to 6 digits. This is for harmony with
+ the later specification.
+
void RequestConfirmation(object device, uint32 passkey)
This method gets called when the service daemon
--
1.7.7.3

View File

@ -1,28 +0,0 @@
From 4f2f55231bad4d5da2505cb674375e9bf8ac029d Mon Sep 17 00:00:00 2001
From: Scott James Remnant <scott@netsplit.com>
Date: Mon, 23 Jan 2012 15:25:56 -0800
Subject: [PATCH 08/13] simple-agent: add DisplayPinCode
---
test/simple-agent | 5 +++++
1 files changed, 5 insertions(+), 0 deletions(-)
diff --git a/test/simple-agent b/test/simple-agent
index af84815..38d0235 100755
--- a/test/simple-agent
+++ b/test/simple-agent
@@ -52,6 +52,11 @@ class Agent(dbus.service.Object):
print "DisplayPasskey (%s, %06d)" % (device, passkey)
@dbus.service.method("org.bluez.Agent",
+ in_signature="os", out_signature="")
+ def DisplayPinCode(self, device, pincode):
+ print "DisplayPinCode (%s, %s)" % (device, pincode)
+
+ @dbus.service.method("org.bluez.Agent",
in_signature="ou", out_signature="")
def RequestConfirmation(self, device, passkey):
print "RequestConfirmation (%s, %06d)" % (device, passkey)
--
1.7.7.3

View File

@ -1,90 +0,0 @@
From 0cd8c8427019cfd7e1c69fb6a5b4261863716d56 Mon Sep 17 00:00:00 2001
From: Scott James Remnant <scott@netsplit.com>
Date: Tue, 24 Jan 2012 10:34:01 -0800
Subject: [PATCH 09/13] Add support for retrying a bonding
In order to retry a bonding we need a timer that will perform the
retry, we need to stash the status and capability of the bonding
request so it can use them again, and in the case of a retrying
bonding attempt we need to not tear down the temporary D-Bus device
object on the adapter.
---
src/adapter.c | 2 +-
src/device.c | 14 ++++++++++++++
src/device.h | 1 +
3 files changed, 16 insertions(+), 1 deletions(-)
diff --git a/src/adapter.c b/src/adapter.c
index ccf7991..f065a5d 100644
--- a/src/adapter.c
+++ b/src/adapter.c
@@ -2989,7 +2989,7 @@ void adapter_remove_connection(struct btd_adapter *adapter,
if (device_is_authenticating(device))
device_cancel_authentication(device, TRUE);
- if (device_is_temporary(device)) {
+ if (device_is_temporary(device) && !device_is_retrying(device)) {
const char *path = device_get_path(device);
DBG("Removing temporary device %s", path);
diff --git a/src/device.c b/src/device.c
index f32666e..9d4517f 100644
--- a/src/device.c
+++ b/src/device.c
@@ -85,6 +85,9 @@ struct bonding_req {
DBusMessage *msg;
guint listener_id;
struct btd_device *device;
+ uint8_t capability;
+ uint8_t status;
+ guint retry_timer;
};
struct authentication_req {
@@ -2295,6 +2298,9 @@ static void bonding_request_free(struct bonding_req *bonding)
if (bonding->conn)
dbus_connection_unref(bonding->conn);
+ if (bonding->retry_timer)
+ g_source_remove(bonding->retry_timer);
+
device = bonding->device;
g_free(bonding);
@@ -2367,6 +2373,7 @@ proceed:
bonding->conn = dbus_connection_ref(conn);
bonding->msg = dbus_message_ref(msg);
+ bonding->capability = capability;
return bonding;
}
@@ -2469,6 +2476,13 @@ static void device_auth_req_free(struct btd_device *device)
device->authr = NULL;
}
+gboolean device_is_retrying(struct btd_device *device)
+{
+ struct bonding_req *bonding = device->bonding;
+
+ return bonding && bonding->retry_timer != 0;
+}
+
void device_bonding_complete(struct btd_device *device, uint8_t status)
{
struct bonding_req *bonding = device->bonding;
diff --git a/src/device.h b/src/device.h
index 561865c..b957ad6 100644
--- a/src/device.h
+++ b/src/device.h
@@ -75,6 +75,7 @@ void device_set_temporary(struct btd_device *device, gboolean temporary);
void device_set_bonded(struct btd_device *device, gboolean bonded);
void device_set_auto_connect(struct btd_device *device, gboolean enable);
gboolean device_is_connected(struct btd_device *device);
+gboolean device_is_retrying(struct btd_device *device);
DBusMessage *device_create_bonding(struct btd_device *device,
DBusConnection *conn, DBusMessage *msg,
const char *agent_path, uint8_t capability);
--
1.7.7.3

View File

@ -1,81 +0,0 @@
From 83c36231418f9deff7ba16ceb0ead5d63e177a04 Mon Sep 17 00:00:00 2001
From: Scott James Remnant <scott@netsplit.com>
Date: Tue, 24 Jan 2012 10:30:53 -0800
Subject: [PATCH 10/13] plugin: Add bonding callback support for plugins
Allow plugins to register a bonding callback on a device, this will be
called on completion or cancellation of a bonding attempt on that
device and allow retrying of the bonding attempt.
These callbacks will only be called once, in the case of retrying the
callback must be registered again separately from another callback
(e.g. the pincode callback).
---
src/device.c | 17 +++++++++++++++++
src/device.h | 8 ++++++++
2 files changed, 25 insertions(+), 0 deletions(-)
diff --git a/src/device.c b/src/device.c
index 9d4517f..9a62eef 100644
--- a/src/device.c
+++ b/src/device.c
@@ -144,6 +144,7 @@ struct btd_device {
GSList *primaries; /* List of primary services */
GSList *drivers; /* List of device drivers */
GSList *watches; /* List of disconnect_data */
+ GSList *bonding_callbacks; /* List of bonding callbacks */
gboolean temporary;
struct agent *agent;
guint disconn_timer;
@@ -264,6 +265,8 @@ static void device_free(gpointer user_data)
g_slist_free_full(device->attios, g_free);
g_slist_free_full(device->attios_offline, g_free);
+ g_slist_free(device->bonding_callbacks);
+
att_cleanup(device);
if (device->tmp_records)
@@ -2476,6 +2479,20 @@ static void device_auth_req_free(struct btd_device *device)
device->authr = NULL;
}
+void btd_device_register_bonding_cb(struct btd_device *device,
+ btd_device_bonding_cb_t cb)
+{
+ device->bonding_callbacks = g_slist_prepend(
+ device->bonding_callbacks, cb);
+}
+
+void btd_device_unregister_bonding_cb(struct btd_device *device,
+ btd_device_bonding_cb_t cb)
+{
+ device->bonding_callbacks = g_slist_remove(
+ device->bonding_callbacks, cb);
+}
+
gboolean device_is_retrying(struct btd_device *device)
{
struct bonding_req *bonding = device->bonding;
diff --git a/src/device.h b/src/device.h
index b957ad6..ce8675b 100644
--- a/src/device.h
+++ b/src/device.h
@@ -103,6 +103,14 @@ guint device_add_disconnect_watch(struct btd_device *device,
void device_remove_disconnect_watch(struct btd_device *device, guint id);
void device_set_class(struct btd_device *device, uint32_t value);
+typedef gboolean (*btd_device_bonding_cb_t) (struct btd_device *device,
+ gboolean complete, uint8_t status);
+
+void btd_device_register_bonding_cb(struct btd_device *dev,
+ btd_device_bonding_cb_t cb);
+void btd_device_unregister_bonding_cb(struct btd_device *dev,
+ btd_device_bonding_cb_t cb);
+
#define BTD_UUIDS(args...) ((const char *[]) { args, NULL } )
struct btd_device_driver {
--
1.7.7.3

View File

@ -1,79 +0,0 @@
From f3d2851b74fe790896f819efbc694e288d54d819 Mon Sep 17 00:00:00 2001
From: Scott James Remnant <scott@netsplit.com>
Date: Tue, 24 Jan 2012 10:35:30 -0800
Subject: [PATCH 11/13] bonding: retry if callback returns TRUE
When a bonding completes, pass the status to any plugin bonding
callbacks; if any return TRUE than set a timer to retry the bonding
after an appropriate backoff period.
---
src/device.c | 46 ++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 46 insertions(+), 0 deletions(-)
diff --git a/src/device.c b/src/device.c
index 9a62eef..4ad5aa0 100644
--- a/src/device.c
+++ b/src/device.c
@@ -2493,6 +2493,44 @@ void btd_device_unregister_bonding_cb(struct btd_device *device,
device->bonding_callbacks, cb);
}
+static gboolean device_bonding_retry(gpointer data)
+{
+ struct btd_device *device = data;
+ struct btd_adapter *adapter = device_get_adapter(device);
+ struct bonding_req *bonding = device->bonding;
+ int err;
+
+ if (!bonding)
+ return FALSE;
+
+ DBG("retrying bonding");
+ err = adapter_create_bonding(adapter, &device->bdaddr,
+ device->type, bonding->capability);
+ if (err < 0)
+ device_bonding_complete(device, bonding->status);
+
+ bonding->retry_timer = 0;
+ return FALSE;
+}
+
+static gboolean device_bonding_get_retry(struct btd_device *device,
+ uint8_t status)
+{
+ GSList *l;
+ btd_device_bonding_cb_t cb;
+ gboolean retry = FALSE;
+
+ for (l = device->bonding_callbacks; l != NULL; l = g_slist_next(l)) {
+ cb = l->data;
+ retry |= cb(device, TRUE, status);
+ }
+
+ g_slist_free(device->bonding_callbacks);
+ device->bonding_callbacks = NULL;
+
+ return retry;
+}
+
gboolean device_is_retrying(struct btd_device *device)
{
struct bonding_req *bonding = device->bonding;
@@ -2507,6 +2545,14 @@ void device_bonding_complete(struct btd_device *device, uint8_t status)
DBG("bonding %p status 0x%02x", bonding, status);
+ if (device_bonding_get_retry(device, status) && status) {
+ DBG("backing off and retrying");
+ bonding->status = status;
+ bonding->retry_timer = g_timeout_add(3000,
+ device_bonding_retry, device);
+ return;
+ }
+
if (auth && (auth->type == AUTH_TYPE_NOTIFY_PASSKEY
|| auth->type == AUTH_TYPE_NOTIFY_PINCODE) && auth->agent)
agent_cancel(auth->agent);
--
1.7.7.3

View File

@ -1,41 +0,0 @@
From 82ef8f4b96d62e18b5a191f6aaa9d79140ca64a4 Mon Sep 17 00:00:00 2001
From: Scott James Remnant <scott@netsplit.com>
Date: Tue, 24 Jan 2012 10:36:44 -0800
Subject: [PATCH 12/13] bonding: call plugin callback on cancellation
Call the plugin callbacks when a bonding request is cancelled.
---
src/device.c | 10 ++++++++++
1 files changed, 10 insertions(+), 0 deletions(-)
diff --git a/src/device.c b/src/device.c
index 4ad5aa0..ea0d1fb 100644
--- a/src/device.c
+++ b/src/device.c
@@ -2648,6 +2648,8 @@ void device_cancel_bonding(struct btd_device *device, uint8_t status)
struct bonding_req *bonding = device->bonding;
DBusMessage *reply;
char addr[18];
+ GSList *l;
+ btd_device_bonding_cb_t cb;
if (!bonding)
return;
@@ -2655,6 +2657,14 @@ void device_cancel_bonding(struct btd_device *device, uint8_t status)
ba2str(&device->bdaddr, addr);
DBG("Canceling bonding request for %s", addr);
+ for (l = device->bonding_callbacks; l != NULL; l = g_slist_next(l)) {
+ cb = l->data;
+ cb(device, FALSE, 0);
+ }
+
+ g_slist_free(device->bonding_callbacks);
+ device->bonding_callbacks = NULL;
+
if (device->authr)
device_cancel_authentication(device, FALSE);
--
1.7.7.3

View File

@ -1,274 +0,0 @@
From 2236069d7d5bf54ae53470c13929cba90e020710 Mon Sep 17 00:00:00 2001
From: Scott James Remnant <scott@netsplit.com>
Date: Thu, 5 Apr 2012 15:42:12 -0700
Subject: [PATCH 13/13] autopair: Add autopair plugin.
---
Makefile.am | 5 +
acinclude.m4 | 6 ++
plugins/autopair.c | 207 ++++++++++++++++++++++++++++++++++++++++++++++++++++
3 files changed, 218 insertions(+), 0 deletions(-)
create mode 100644 plugins/autopair.c
diff --git a/Makefile.am b/Makefile.am
index bd587eb..0e9129c 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -278,6 +278,11 @@ builtin_modules += dbusoob
builtin_sources += plugins/dbusoob.c
endif
+if AUTOPAIRPLUGIN
+builtin_modules += autopair
+builtin_sources += plugins/autopair.c
+endif
+
if MAINTAINER_MODE
plugin_LTLIBRARIES += plugins/external-dummy.la
plugins_external_dummy_la_SOURCES = plugins/external-dummy.c
diff --git a/acinclude.m4 b/acinclude.m4
index b0f790c..4c1849a 100644
--- a/acinclude.m4
+++ b/acinclude.m4
@@ -220,6 +220,7 @@ AC_DEFUN([AC_ARG_BLUEZ], [
dbusoob_enable=no
wiimote_enable=no
thermometer_enable=no
+ autopair_enable=no
AC_ARG_ENABLE(optimization, AC_HELP_STRING([--disable-optimization], [disable code optimization]), [
optimization_enable=${enableval}
@@ -364,6 +365,10 @@ AC_DEFUN([AC_ARG_BLUEZ], [
wiimote_enable=${enableval}
])
+ AC_ARG_ENABLE(autopair, AC_HELP_STRING([--enable-autopair], [compile with autopairing plugin]), [
+ autopair_enable=${enableval}
+ ])
+
AC_ARG_ENABLE(hal, AC_HELP_STRING([--enable-hal], [Use HAL to determine adapter class]), [
hal_enable=${enableval}
])
@@ -429,4 +434,5 @@ AC_DEFUN([AC_ARG_BLUEZ], [
AM_CONDITIONAL(DBUSOOBPLUGIN, test "${dbusoob_enable}" = "yes")
AM_CONDITIONAL(WIIMOTEPLUGIN, test "${wiimote_enable}" = "yes")
AM_CONDITIONAL(THERMOMETERPLUGIN, test "${thermometer_enable}" = "yes")
+ AM_CONDITIONAL(AUTOPAIRPLUGIN, test "${autopair_enable}" = "yes")
])
diff --git a/plugins/autopair.c b/plugins/autopair.c
new file mode 100644
index 0000000..58047b1
--- /dev/null
+++ b/plugins/autopair.c
@@ -0,0 +1,208 @@
+/*
+ *
+ * BlueZ - Bluetooth protocol stack for Linux
+ *
+ * Copyright (C) 2012 Google Inc.
+ *
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <sys/types.h>
+#include <sys/stat.h>
+
+#include <fcntl.h>
+#include <stdlib.h>
+#include <string.h>
+#include <time.h>
+#include <unistd.h>
+
+#include <glib.h>
+
+#include <bluetooth/bluetooth.h>
+
+#include "glib-compat.h"
+#include "plugin.h"
+#include "adapter.h"
+#include "device.h"
+#include "storage.h"
+#include "textfile.h"
+#include "log.h"
+
+/*
+ * Plugin to handle automatic pairing of devices with reduced user
+ * interaction, including implementing the recommendation of the HID spec
+ * for keyboard devices.
+ *
+ * The plugin works by intercepting the PIN request for devices; if the
+ * device is a keyboard a random six-digit numeric PIN is generated and
+ * returned, flagged for displaying using DisplayPinCode.
+ *
+ * Bonding callbacks are also added for the device, so should the pairing
+ * attempt fail with the PIN from this plugin, a blacklist entry is added
+ * and pairing retried. On the second pass this plugin will ignore the
+ * device due to the blacklist and the user will be prompted for a PIN
+ * instead.
+ */
+
+static GSList *blacklist = NULL;
+
+static void autopair_blacklist_device(struct btd_device *device)
+{
+ bdaddr_t *ba;
+
+ ba = g_new0(bdaddr_t, 1);
+ device_get_address(device, ba, NULL);
+ blacklist = g_slist_prepend(blacklist, ba);
+}
+
+
+static GSList *attempting = NULL;
+
+static gboolean autopair_bondingcb(struct btd_device *device,
+ gboolean complete, uint8_t status)
+{
+ GSList *match;
+
+ match = g_slist_find(attempting, device);
+ if (!match)
+ return FALSE;
+
+ attempting = g_slist_remove_link(attempting, match);
+ btd_device_unref(device);
+
+ if (complete && status != 0) {
+ /* failed: blacklist and retry with the user's agent */
+ autopair_blacklist_device(device);
+ return TRUE;
+ } else {
+ /* successful or cancelled pair */
+ return FALSE;
+ }
+}
+
+static gboolean autopair_attempt(struct btd_device *device)
+{
+ if (g_slist_find(attempting, device))
+ return FALSE;
+
+ btd_device_register_bonding_cb(device, autopair_bondingcb);
+ attempting = g_slist_prepend(attempting, btd_device_ref(device));
+
+ return TRUE;
+}
+
+static void autopair_cancel_all(void)
+{
+ GSList *l;
+ struct btd_device *device;
+
+ for (l = attempting; l != NULL; l = g_slist_next(l)) {
+ device = l->data;
+ btd_device_unregister_bonding_cb(device, autopair_bondingcb);
+ btd_device_unref(device);
+ }
+
+ g_slist_free(attempting);
+ attempting = NULL;
+}
+
+static ssize_t autopair_pincb(struct btd_adapter *adapter,
+ struct btd_device *device,
+ char *pinbuf, gboolean *display)
+{
+ char addr[18];
+ bdaddr_t local, peer;
+ uint32_t class;
+
+ if (!device_is_bonding(device, NULL))
+ return 0;
+
+ adapter_get_address(adapter, &local);
+
+ device_get_address(device, &peer, NULL);
+ ba2str(&peer, addr);
+
+ read_remote_class(&local, &peer, &class);
+
+ DBG("device %s 0x%x", addr, class);
+
+ if (g_slist_find_custom(blacklist, &peer, (GCompareFunc) bacmp)) {
+ DBG("prior autopair failed");
+ return 0;
+ }
+
+ switch ((class & 0x1f00) >> 8) {
+ case 0x05:
+ switch ((class & 0xc0) >> 6) {
+ case 0x01:
+ case 0x03:
+ if (autopair_attempt(device)) {
+ char pinstr[7];
+ srand(time(NULL));
+ snprintf(pinstr, sizeof pinstr, "%06d",
+ rand() % 1000000);
+ *display = TRUE;
+ memcpy(pinbuf, pinstr, 6);
+ return 6;
+ }
+ break;
+ }
+ break;
+ }
+
+ return 0;
+}
+
+
+static int autopair_probe(struct btd_adapter *adapter)
+{
+ btd_adapter_register_pin_cb(adapter, autopair_pincb);
+
+ return 0;
+}
+
+static void autopair_remove(struct btd_adapter *adapter)
+{
+ btd_adapter_unregister_pin_cb(adapter, autopair_pincb);
+}
+
+static struct btd_adapter_driver autopair_driver = {
+ .name = "autopair",
+ .probe = autopair_probe,
+ .remove = autopair_remove,
+};
+
+static int autopair_init(void)
+{
+ return btd_register_adapter_driver(&autopair_driver);
+}
+
+static void autopair_exit(void)
+{
+ btd_unregister_adapter_driver(&autopair_driver);
+
+ autopair_cancel_all();
+
+ g_slist_free_full(blacklist, g_free);
+}
+
+BLUETOOTH_PLUGIN_DEFINE(autopair, VERSION,
+ BLUETOOTH_PLUGIN_PRIORITY_DEFAULT, autopair_init, autopair_exit)
--
1.7.7.3

View File

@ -1,30 +0,0 @@
From c86e19ef02a7faf845b399a50f4aa0b23b003fcf Mon Sep 17 00:00:00 2001
From: Syam Sidhardhan <s.syam@samsung.com>
Date: Mon, 16 Apr 2012 18:31:38 +0530
Subject: [PATCH 1/2] eir: Fix incorrect eir_has_data_type() parsing
Updating the "parsed" variable twice inside the for loop, leads to
incorrect parsing.
---
src/eir.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/eir.c b/src/eir.c
index 419f444..4dfadea 100644
--- a/src/eir.c
+++ b/src/eir.c
@@ -337,9 +337,9 @@ void eir_create(const char *name, int8_t tx_power, uint16_t did_vendor,
gboolean eir_has_data_type(uint8_t *data, size_t len, uint8_t type)
{
uint8_t field_len;
- size_t parsed;
+ size_t parsed = 0;
- for (parsed = 0; parsed < len - 1; parsed += field_len) {
+ while (parsed < len - 1) {
field_len = data[0];
if (field_len == 0)
--
1.7.7.3

View File

@ -1,42 +0,0 @@
From 8dbaea685b5a0e155c1433d054ead4ce332c3570 Mon Sep 17 00:00:00 2001
From: Syam Sidhardhan <s.syam@samsung.com>
Date: Mon, 16 Apr 2012 18:31:37 +0530
Subject: [PATCH 2/2] eir: Fix incorrect eir_length() parsing
Issue:
The COD value displayed via dbus during inquiry is wrong.
This is because of the incorrect return length of the eir_length(),
which leads to appending the COD at wrong location.
Analysis:
After appending the COD at the end of the eir data, we can see
there are some '00' present in the eir field length in the eir file.
XX:XX:XX:XX:XX:XX 07095359414D5043020A040B0312111F110C110E110311
0000000000000000000000040D000142
Fix:
Corrected the length calculation in eir_length(), which is determining,
which position the COD should append
---
src/eir.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/eir.c b/src/eir.c
index 4dfadea..923d7be 100644
--- a/src/eir.c
+++ b/src/eir.c
@@ -373,9 +373,9 @@ size_t eir_append_data(uint8_t *eir, size_t eir_len, uint8_t type,
size_t eir_length(uint8_t *eir, size_t maxlen)
{
uint8_t field_len;
- size_t parsed, length;
+ size_t parsed = 0, length = 0;
- for (parsed = 0, length = 0; parsed < maxlen - 1; parsed += field_len) {
+ while (parsed < maxlen - 1) {
field_len = eir[0];
if (field_len == 0)
--
1.7.7.3

View File

@ -1,72 +0,0 @@
From: Antonio Ospite <ospite-aNJ+ML1ZbiP93QAQaVx+gl6hYfS7NtTn@public.gmane.org>
Subject: [PATCH BlueZ v2 1/3] manager: add a btd_manager_get_default_adapter_address_str() call
Date: Wed, 18 Apr 2012 11:38:09 +0200
Add a new btd_* call to get the default adapter address as a string,
meant to be used by _external_ plugins, this is to avoid to make public
these symbols:
manager_get_default_adapter
adapter_get_address
bt_malloc
ba2str
---
Alternatively a version without the _str prefix can be used which
returns a bdaddr_t, but I have to make ba2str a global symbol so I can
make the conversion to string in the plugin itself.
Let me know how do you like that.
src/manager.c | 21 +++++++++++++++++++++
src/manager.h | 1 +
2 files changed, 22 insertions(+)
diff --git a/src/manager.c b/src/manager.c
index 6244516..fbd5ef8 100644
--- a/src/manager.c
+++ b/src/manager.c
@@ -270,6 +270,27 @@ struct btd_adapter *manager_get_default_adapter(void)
return manager_find_adapter_by_id(default_adapter_id);
}
+char *btd_manager_get_default_adapter_address_str(void)
+{
+ struct btd_adapter *adapter;
+ bdaddr_t adapter_bdaddr;
+ char *str;
+
+ adapter = manager_get_default_adapter();
+ if (adapter == NULL) {
+ return NULL;
+ }
+
+ adapter_get_address(adapter, &adapter_bdaddr);
+
+ str = bt_malloc(18);
+ if (str == NULL)
+ return NULL;
+
+ ba2str(&adapter_bdaddr, str);
+ return str;
+}
+
static void manager_remove_adapter(struct btd_adapter *adapter)
{
uint16_t dev_id = adapter_get_dev_id(adapter);
diff --git a/src/manager.h b/src/manager.h
index 264cd25..7df882e 100644
--- a/src/manager.h
+++ b/src/manager.h
@@ -36,6 +36,7 @@ const char *manager_get_base_path(void);
struct btd_adapter *manager_find_adapter(const bdaddr_t *sba);
struct btd_adapter *manager_find_adapter_by_id(int id);
struct btd_adapter *manager_get_default_adapter(void);
+char *btd_manager_get_default_adapter_address_str(void);
void manager_foreach_adapter(adapter_cb func, gpointer user_data);
GSList *manager_get_adapters(void);
struct btd_adapter *btd_manager_register_adapter(int id, gboolean up);
--
1.7.10

View File

@ -1,144 +0,0 @@
From: Antonio Ospite <ospite-aNJ+ML1ZbiP93QAQaVx+gl6hYfS7NtTn@public.gmane.org>
Subject: [PATCH BlueZ v2 2/3] device: add a btd_device_set_trusted() call
Date: Wed, 18 Apr 2012 11:38:10 +0200
Add a new btd_* call to set a device as trusted, meant to be used by
_external_ plugins, this avoid making public these symbols:
record_from_string
store_record
sdp_record_free
str2ba
str2ba
store_device_id
write_trust
dbus_bus_get
manager_find_adapter
adapter_get_device
dbus_connection_unref
---
If BlueZ can pull the required parameters itself from trusted devices this can
be simplified, if not then the name should be fixed to make clearer what the
function does.
src/device.c | 74 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
src/device.h | 9 +++++++
2 files changed, 83 insertions(+)
diff --git a/src/device.c b/src/device.c
index ea6fec2..6e434c1 100644
--- a/src/device.c
+++ b/src/device.c
@@ -49,6 +49,7 @@
#include "att.h"
#include "hcid.h"
#include "adapter.h"
+#include "manager.h"
#include "gattrib.h"
#include "attio.h"
#include "device.h"
@@ -2948,6 +2949,80 @@ GSList *btd_device_get_primaries(struct btd_device *device)
return device->primaries;
}
+int btd_device_set_trusted(const char *adapter_address,
+ const char *device_address,
+ char *name,
+ uint16_t vendor_id_source,
+ uint16_t vendor_id,
+ uint16_t product_id,
+ uint16_t version_id,
+ const char *uuid,
+ const char *sdp_record)
+{
+ struct btd_adapter *adapter;
+ struct btd_device *device;
+ DBusConnection *conn;
+ bdaddr_t src;
+ bdaddr_t dst;
+ sdp_record_t *record;
+ int ret = 0;
+
+ record = record_from_string(sdp_record);
+ if (record == NULL) {
+ ret = -ENODEV;
+ goto out;
+ }
+ ret = store_record(adapter_address, device_address, record);
+ sdp_record_free(record);
+ if (ret < 0)
+ goto out;
+
+ str2ba(adapter_address, &src);
+ str2ba(device_address, &dst);
+
+ /* Set the device id */
+ store_device_id(adapter_address, device_address, vendor_id_source, vendor_id,
+ product_id, version_id);
+ /* Don't write a profile here,
+ * it will be updated when the device connects */
+
+ write_trust(adapter_address, device_address, "[all]", TRUE);
+
+ conn = dbus_bus_get(DBUS_BUS_SYSTEM, NULL);
+ if (conn == NULL) {
+ DBG("Failed to get on the bus");
+ ret = -EPERM;
+ goto out;
+ }
+
+ adapter = manager_find_adapter(&src);
+ if (adapter == NULL) {
+ DBG("Failed to get the adapter");
+ ret = -EPERM;
+ goto out_dbus_unref;
+ }
+
+ /* This is needed: adapter_find_device() wouldn't need a Dbus
+ * connection but it would not be enough as it only searches for
+ * already existing devices, while adapter_get_device() will create a
+ * new device if necessary.
+ */
+ device = adapter_get_device(conn, adapter, device_address);
+ if (device == NULL) {
+ DBG("Failed to get the device");
+ ret = -ENODEV;
+ goto out_dbus_unref;
+ }
+
+ device_set_temporary(device, FALSE);
+ btd_device_add_uuid(device, uuid);
+
+out_dbus_unref:
+ dbus_connection_unref(conn);
+out:
+ return ret;
+}
+
void btd_device_add_uuid(struct btd_device *device, const char *uuid)
{
GSList *uuid_list;
diff --git a/src/device.h b/src/device.h
index 690c64d..1011e3e 100644
--- a/src/device.h
+++ b/src/device.h
@@ -57,6 +57,15 @@ void device_register_services(DBusConnection *conn, struct btd_device *device,
GSList *prim_list, int psm);
GSList *device_services_from_record(struct btd_device *device,
GSList *profiles);
+int btd_device_set_trusted(const char *adapter_address,
+ const char *device_address,
+ char *name,
+ uint16_t vendor_id_source,
+ uint16_t vendor_id,
+ uint16_t product_id,
+ uint16_t version_id,
+ const char *uuid,
+ const char *sdp_record);
void btd_device_add_uuid(struct btd_device *device, const char *uuid);
struct btd_adapter *device_get_adapter(struct btd_device *device);
void device_get_address(struct btd_device *device, bdaddr_t *bdaddr,
--
1.7.10

View File

@ -1,760 +0,0 @@
From: Antonio Ospite <ospite-aNJ+ML1ZbiP93QAQaVx+gl6hYfS7NtTn@public.gmane.org>
Subject: [PATCH BlueZ v2 3/3] Add playstation-peripheral plugin: USB pairing and LEDs settings
Date: Wed, 18 Apr 2012 11:38:11 +0200
Add a plugin which handles the connection of a Playstation peripheral,
when a new hidraw device is connected the plugin:
- Filters udev events, and select the Playstation peripheral
- Sets the Master bluetooth address in the peripheral (USB pairing)
- Sets LEDs to match the joystick system number if needed
(for USB and BT)
- Adds the device to the database of the current default
adapter (BT association)
Signed-off-by: Bastien Nocera <hadess-0MeiytkfxGOsTnJN9+BGXg@public.gmane.org>
Signed-off-by: Antonio Ospite <ospite-aNJ+ML1ZbiP93QAQaVx+gl6hYfS7NtTn@public.gmane.org>
---
For the first review round plugins/playstation-peripheral.c is the most
interesting file, in particular the handle_device_plug() and
peripheral_pair() functions.
Makefile.am | 7 +
acinclude.m4 | 10 +
plugins/playstation-peripheral-hid.c | 263 ++++++++++++++++++++++++
plugins/playstation-peripheral-hid.h | 10 +
plugins/playstation-peripheral.c | 376 ++++++++++++++++++++++++++++++++++
5 files changed, 666 insertions(+)
create mode 100644 plugins/playstation-peripheral-hid.c
create mode 100644 plugins/playstation-peripheral-hid.h
create mode 100644 plugins/playstation-peripheral.c
diff --git a/Makefile.am b/Makefile.am
index 62705f6..61c7a07 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -267,6 +267,13 @@ builtin_modules += dbusoob
builtin_sources += plugins/autopair.c
endif
+if PLAYSTATION_PERIPHERAL_PLUGIN
+plugin_LTLIBRARIES += plugins/playstation-peripheral.la
+plugins_playstation_peripheral_la_SOURCES = plugins/playstation-peripheral.c plugins/playstation-peripheral-hid.c
+plugins_playstation_peripheral_la_LDFLAGS = -module -avoid-version -no-undefined @UDEV_LIBS@
+plugins_playstation_peripheral_la_CFLAGS = -fvisibility=hidden @DBUS_CFLAGS@ @GLIB_CFLAGS@ @UDEV_CFLAGS@
+endif
+
if MAINTAINER_MODE
plugin_LTLIBRARIES += plugins/external-dummy.la
plugins_external_dummy_la_SOURCES = plugins/external-dummy.c
diff --git a/acinclude.m4 b/acinclude.m4
index dcf9a48..06efe2a 100644
--- a/acinclude.m4
+++ b/acinclude.m4
@@ -176,6 +176,7 @@ AC_DEFUN([AC_ARG_BLUEZ], [
sndfile_enable=${sndfile_found}
hal_enable=no
usb_enable=${usb_found}
+ playstation_peripheral_enable=${udev_found}
alsa_enable=${alsa_found}
gstreamer_enable=${gstreamer_found}
audio_enable=yes
@@ -265,6 +266,10 @@ AC_DEFUN([AC_ARG_BLUEZ], [
usb_enable=${enableval}
])
+ AC_ARG_ENABLE(playstation_peripheral, AC_HELP_STRING([--enable-playstation-peripheral], [enable playstation-peripheral plugin]), [
+ playstation_peripheral_enable=${enableval}
+ ])
+
AC_ARG_ENABLE(tools, AC_HELP_STRING([--enable-tools], [install Bluetooth utilities]), [
tools_enable=${enableval}
])
@@ -360,6 +365,10 @@ AC_DEFUN([AC_ARG_BLUEZ], [
AC_DEFINE(HAVE_LIBUSB, 1, [Define to 1 if you have USB library.])
fi
+ if (test "${playstation_peripheral_enable}" = "yes" && test "${udev_found}" = "yes"); then
+ AC_DEFINE(HAVE_PLAYSTATION_PERIPHERAL_PLUGIN, 1, [Define to 1 if you have playstation-peripheral plugin.])
+ fi
+
AM_CONDITIONAL(SNDFILE, test "${sndfile_enable}" = "yes" && test "${sndfile_found}" = "yes")
AM_CONDITIONAL(USB, test "${usb_enable}" = "yes" && test "${usb_found}" = "yes")
AM_CONDITIONAL(SBC, test "${alsa_enable}" = "yes" || test "${gstreamer_enable}" = "yes" ||
@@ -392,4 +401,5 @@ AC_DEFUN([AC_ARG_BLUEZ], [
AM_CONDITIONAL(WIIMOTEPLUGIN, test "${wiimote_enable}" = "yes")
AM_CONDITIONAL(THERMOMETERPLUGIN, test "${thermometer_enable}" = "yes")
AM_CONDITIONAL(AUTOPAIRPLUGIN, test "${autopair_enable}" = "yes")
+ AM_CONDITIONAL(PLAYSTATION_PERIPHERAL_PLUGIN, test "${playstation_peripheral_enable}" = "yes" && test "${udev_found}" = "yes")
])
diff --git a/plugins/playstation-peripheral-hid.c b/plugins/playstation-peripheral-hid.c
new file mode 100644
index 0000000..9c5e530
--- /dev/null
+++ b/plugins/playstation-peripheral-hid.c
@@ -0,0 +1,263 @@
+/*
+ * playstation peripheral plugin: lowlevel hid functions
+ *
+ * Copyright (C) 2011 Antonio Ospite <ospite-aNJ+ML1ZbiP93QAQaVx+gl6hYfS7NtTn@public.gmane.org>
+ *
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <stdint.h>
+#include <sys/ioctl.h>
+#include <unistd.h>
+#include <errno.h>
+
+#include <linux/hidraw.h>
+
+#include "log.h"
+#include "playstation-peripheral-hid.h"
+
+/* Fallback definitions to compile with older headers */
+#ifndef HIDIOCGFEATURE
+#define HIDIOCGFEATURE(len) _IOC(_IOC_WRITE|_IOC_READ, 'H', 0x07, len)
+#endif
+
+#ifndef HIDIOCSFEATURE
+#define HIDIOCSFEATURE(len) _IOC(_IOC_WRITE|_IOC_READ, 'H', 0x06, len)
+#endif
+
+#define BDADDR_STR_SIZE 18 /* strlen("00:00:00:00:00:00") + 1 */
+
+#define LED_1 (0x01 << 1)
+#define LED_2 (0x01 << 2)
+#define LED_3 (0x01 << 3)
+#define LED_4 (0x01 << 4)
+
+#define LED_STATUS_OFF 0
+#define LED_STATUS_ON 1
+
+/* Usb cable pairing section */
+static unsigned char *get_feature_report(int fd, uint8_t report_number,
+ unsigned int len)
+{
+ unsigned char *buf;
+ int ret;
+
+ buf = calloc(len, sizeof(*buf));
+ if (buf == NULL) {
+ error("%s:%s() calloc failed", __FILE__, __func__);
+ return NULL;
+ }
+
+ buf[0] = report_number;
+
+ ret = ioctl(fd, HIDIOCGFEATURE(len), buf);
+ if (ret < 0) {
+ error("%s:%s() HIDIOCGFEATURE ret = %d",
+ __FILE__, __func__, ret);
+ free(buf);
+ return NULL;
+ }
+
+ return buf;
+}
+
+static int set_feature_report(int fd, uint8_t *report, int len)
+{
+ int ret;
+
+ ret = ioctl(fd, HIDIOCSFEATURE(len), report);
+ if (ret < 0)
+ error("%s:%s() HIDIOCSFEATURE failed, ret = %d",
+ __FILE__, __func__, ret);
+
+ return ret;
+}
+
+char *sixaxis_get_device_bdaddr(int fd)
+{
+ unsigned char *buf;
+ char *address;
+
+ buf = get_feature_report(fd, 0xf2, 18);
+ if (buf == NULL) {
+ error("%s:%s() cannot get feature report", __FILE__, __func__);
+ return NULL;
+ }
+
+ address = calloc(BDADDR_STR_SIZE, sizeof(*address));
+ if (address == NULL) {
+ error("%s:%s() calloc failed", __FILE__, __func__);
+ free(buf);
+ return NULL;
+ }
+
+ snprintf(address, BDADDR_STR_SIZE,
+ "%02X:%02X:%02X:%02X:%02X:%02X",
+ buf[4], buf[5], buf[6], buf[7], buf[8], buf[9]);
+
+ free(buf);
+ return address;
+}
+
+char *sixaxis_get_master_bdaddr(int fd)
+{
+ unsigned char *buf;
+ char *address;
+
+ buf = get_feature_report(fd, 0xf5, 8);
+ if (buf == NULL) {
+ error("%s:%s() cannot get feature report", __FILE__, __func__);
+ return NULL;
+ }
+
+ address = calloc(BDADDR_STR_SIZE, sizeof(*address));
+ if (address == NULL) {
+ error("%s:%s() calloc failed", __FILE__, __func__);
+ free(buf);
+ return NULL;
+ }
+
+ snprintf(address, BDADDR_STR_SIZE,
+ "%02X:%02X:%02X:%02X:%02X:%02X",
+ buf[2], buf[3], buf[4], buf[5], buf[6], buf[7]);
+
+ free(buf);
+ return address;
+}
+
+int sixaxis_set_master_bdaddr(int fd, char *adapter_bdaddr)
+{
+ uint8_t *report;
+ uint8_t addr[6];
+ int ret;
+
+ ret = sscanf(adapter_bdaddr,
+ "%02hhx:%02hhx:%02hhx:%02hhx:%02hhx:%02hhx",
+ &addr[0], &addr[1], &addr[2],
+ &addr[3], &addr[4], &addr[5]);
+ if (ret != 6) {
+ error("%s:%s() Parsing the bt address failed",
+ __FILE__, __func__);
+ return -EINVAL;
+ }
+
+ report = malloc(8);
+ if (report == NULL) {
+ error("%s:%s() malloc failed", __FILE__, __func__);
+ return -ENOMEM;
+ }
+
+ report[0] = 0xf5;
+ report[1] = 0x01;
+
+ report[2] = addr[0];
+ report[3] = addr[1];
+ report[4] = addr[2];
+ report[5] = addr[3];
+ report[6] = addr[4];
+ report[7] = addr[5];
+
+ ret = set_feature_report(fd, report, 8);
+ if (ret < 0) {
+ error("%s:%s() cannot set feature report",
+ __FILE__, __func__);
+ goto out;
+ }
+
+ DBG("New Master Bluetooth address: %s", adapter_bdaddr);
+
+out:
+ free(report);
+ return ret;
+}
+
+
+/* Led setting section */
+static int set_leds(int fd, unsigned char leds_status[4])
+{
+ int ret;
+
+ /*
+ * the total time the led is active (0xff means forever)
+ * | duty_length: how long a cycle is in deciseconds:
+ * | | (0 means "blink very fast")
+ * | | ??? (Maybe a phase shift or duty_length multiplier?)
+ * | | | % of duty_length led is off (0xff means 100%)
+ * | | | | % of duty_length led is on (0xff is 100%)
+ * | | | | |
+ * 0xff, 0x27, 0x10, 0x00, 0x32,
+ */
+ unsigned char leds_report[] = {
+ 0x01,
+ 0x00, 0x00, 0x00, 0x00, 0x00, /* rumble values TBD */
+ 0x00, 0x00, 0x00, 0x00, 0x1e, /* LED_1=0x02, LED_2=0x04 ... */
+ 0xff, 0x27, 0x10, 0x00, 0x32, /* LED_4 */
+ 0xff, 0x27, 0x10, 0x00, 0x32, /* LED_3 */
+ 0xff, 0x27, 0x10, 0x00, 0x32, /* LED_2 */
+ 0xff, 0x27, 0x10, 0x00, 0x32, /* LED_1 */
+ 0x00, 0x00, 0x00, 0x00, 0x00,
+ };
+
+ int leds = 0;
+ if (leds_status[0])
+ leds |= LED_1;
+ if (leds_status[1])
+ leds |= LED_2;
+ if (leds_status[2])
+ leds |= LED_3;
+ if (leds_status[3])
+ leds |= LED_4;
+
+ leds_report[10] = leds;
+
+ ret = write(fd, leds_report, sizeof(leds_report));
+ if (ret < (ssize_t) sizeof(leds_report))
+ error("%s:%s() Unable to write to hidraw device",
+ __FILE__, __func__);
+
+ return ret;
+}
+
+int set_controller_number(int fd, unsigned int n)
+{
+ unsigned char leds_status[4] = {0, 0, 0, 0};
+
+ switch (n) {
+ case 0:
+ break;
+ case 1:
+ case 2:
+ case 3:
+ case 4:
+ leds_status[n - 1] = LED_STATUS_ON;
+ break;
+ case 5:
+ case 6:
+ case 7:
+ leds_status[4 - 1] = LED_STATUS_ON;
+ leds_status[n - 4 - 1] = LED_STATUS_ON;
+ break;
+ default:
+ error("%s:%s() Only 7 controllers supported for now",
+ __FILE__, __func__);
+ return -1;
+ }
+
+ return set_leds(fd, leds_status);
+}
diff --git a/plugins/playstation-peripheral-hid.h b/plugins/playstation-peripheral-hid.h
new file mode 100644
index 0000000..ade8fa0
--- /dev/null
+++ b/plugins/playstation-peripheral-hid.h
@@ -0,0 +1,10 @@
+#ifndef __PLAYSTATION_PERIPHERAL_HID_H
+#define __PLAYSTATION_PERIPHERAL_HID_H
+
+char *sixaxis_get_device_bdaddr(int fd);
+char *sixaxis_get_master_bdaddr(int fd);
+int sixaxis_set_master_bdaddr(int fd, char *adapter_bdaddr);
+
+int set_controller_number(int fd, unsigned int n);
+
+#endif /* __PLAYSTATION_PERIPHERAL_HID_H */
diff --git a/plugins/playstation-peripheral.c b/plugins/playstation-peripheral.c
new file mode 100644
index 0000000..90d69ee
--- /dev/null
+++ b/plugins/playstation-peripheral.c
@@ -0,0 +1,376 @@
+/*
+ * playstation peripheral plugin: support for Playstation peripherals
+ *
+ * Copyright (C) 2009 Bastien Nocera <hadess-0MeiytkfxGOsTnJN9+BGXg@public.gmane.org>
+ * Copyright (C) 2011 Antonio Ospite <ospite-aNJ+ML1ZbiP93QAQaVx+gl6hYfS7NtTn@public.gmane.org>
+ *
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ */
+
+/*
+ * In the following this terminology is used:
+ *
+ * - peripheral: a Playstation peripheral (Sixaxis, DS3, headset, etc.)
+ * - controller: an input peripheral
+ * - adapter: the bluetooth dongle on the host system.
+ * - adapter_bdaddr: the bdaddr of the bluetooth adapter.
+ * - device_bdaddr: the bdaddr of the Playstation peripheral.
+ * - master_bdaddr: the bdaddr of the adapter to be configured into the
+ * Playstation peripheral
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <stdlib.h>
+#include <stdint.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <unistd.h>
+#include <errno.h>
+#include <glib.h>
+
+#define LIBUDEV_I_KNOW_THE_API_IS_SUBJECT_TO_CHANGE 1
+#include <libudev.h>
+
+#include "plugin.h"
+#include "log.h"
+#include "adapter.h"
+#include "device.h"
+#include "manager.h"
+#include "storage.h"
+#include "sdp_lib.h"
+
+#include "playstation-peripheral-hid.h"
+
+struct playstation_peripheral {
+ uint16_t vendor_id;
+ uint16_t product_id;
+ char *name;
+ char *sdp_record;
+ char *uuid;
+
+ /* device specific callbacks to get master/device bdaddr and set
+ * master bdaddr
+ */
+ char * (*get_device_bdaddr)(int);
+ char * (*get_master_bdaddr)(int);
+ int (*set_master_bdaddr) (int, char *);
+};
+
+static struct playstation_peripheral peripherals[] = {
+ {
+ .vendor_id = 0x054c,
+ .product_id = 0x0268,
+ .name = "PLAYSTATION(R)3 Controller",
+ .sdp_record = "3601920900000A000100000900013503191124090004350D35061901000900113503190011090006350909656E09006A0901000900093508350619112409010009000D350F350D350619010009001335031900110901002513576972656C65737320436F6E74726F6C6C65720901012513576972656C65737320436F6E74726F6C6C6572090102251B536F6E7920436F6D707574657220456E7465727461696E6D656E740902000901000902010901000902020800090203082109020428010902052801090206359A35980822259405010904A101A102850175089501150026FF00810375019513150025013500450105091901291381027501950D0600FF8103150026FF0005010901A10075089504350046FF0009300931093209358102C0050175089527090181027508953009019102750895300901B102C0A1028502750895300901B102C0A10285EE750895300901B102C0A10285EF750895300901B102C0C0090207350835060904090901000902082800090209280109020A280109020B09010009020C093E8009020D280009020E2800",
+ .uuid = "00001124-0000-1000-8000-00805f9b34fb",
+ .get_device_bdaddr = sixaxis_get_device_bdaddr,
+ .get_master_bdaddr = sixaxis_get_master_bdaddr,
+ .set_master_bdaddr = sixaxis_set_master_bdaddr,
+ },
+};
+
+static struct udev *ctx;
+static struct udev_monitor *monitor;
+static guint watch_id;
+
+static int create_peripheral_association(const char *adapter_address,
+ const char *device_address,
+ struct playstation_peripheral *peripheral)
+{
+ int ret = 0;
+
+ ret = btd_device_set_trusted(adapter_address, device_address,
+ peripheral->name,
+ 0x0002, /* VersionIDSource = USB Implementer's Forum */
+ peripheral->vendor_id,
+ peripheral->product_id,
+ 0, /* version is hardcoded to 0 for now */
+ peripheral->uuid,
+ peripheral->sdp_record);
+ if (ret < 0)
+ return ret;
+
+ return 0;
+}
+
+static int peripheral_pair(int fd, char *adapter_bdaddr,
+ struct playstation_peripheral *peripheral)
+{
+ char *device_bdaddr;
+ char *master_bdaddr;
+ int ret = 0;
+
+ master_bdaddr = peripheral->get_master_bdaddr(fd);
+ if (master_bdaddr == NULL) {
+ DBG("Failed to get the Old master Bluetooth address from the device");
+ return -EPERM;
+ }
+
+ /* Only set the master bdaddr when needed, this is how the PS3 does
+ * it, perhaps to avoid unnecessary writes to some eeprom.
+ */
+ if (g_strcmp0(master_bdaddr, adapter_bdaddr) != 0) {
+ DBG("Old master Bluetooth address was: %s", master_bdaddr);
+ ret = peripheral->set_master_bdaddr(fd, adapter_bdaddr);
+ if (ret < 0) {
+ DBG("Failed to set the master Bluetooth address");
+ free(master_bdaddr);
+ return ret;
+ }
+ }
+
+ device_bdaddr = peripheral->get_device_bdaddr(fd);
+ if (device_bdaddr == NULL) {
+ DBG("Failed to get the Bluetooth address from the device");
+ free(master_bdaddr);
+ return -EPERM;
+ }
+
+ DBG("Device bdaddr %s", device_bdaddr);
+
+ ret = create_peripheral_association(adapter_bdaddr, device_bdaddr, peripheral);
+
+ free(device_bdaddr);
+ free(master_bdaddr);
+ return ret;
+}
+
+static inline struct playstation_peripheral *find_playstation_peripheral(const char *hid_id)
+{
+ unsigned int array_size = sizeof(peripherals)/sizeof(peripherals[0]);
+ unsigned int i;
+ int ret;
+ uint16_t protocol;
+ uint16_t vendor_id;
+ uint16_t product_id;
+
+ ret = sscanf(hid_id, "%hx:%hx:%hx", &protocol, &vendor_id, &product_id);
+ if (ret != 3) {
+ error("%s:%s() Parsing HID_ID failed",
+ __FILE__, __func__);
+ return NULL;
+ }
+
+ for (i = 0; i < array_size; i++) {
+ if (peripherals[i].vendor_id == vendor_id &&
+ peripherals[i].product_id == product_id)
+ return &peripherals[i];
+ }
+
+ return NULL;
+}
+
+static inline int is_usb_peripheral(const char *hid_id)
+{
+ int ret;
+ uint16_t protocol;
+ uint16_t vendor_id;
+ uint16_t product_id;
+
+ ret = sscanf(hid_id, "%hx:%hx:%hx", &protocol, &vendor_id, &product_id);
+ if (ret != 3) {
+ error("%s:%s() Parsing HID_ID failed",
+ __FILE__, __func__);
+ return 0;
+ }
+
+ DBG("%hx:%hx:%hx", protocol, vendor_id, product_id);
+ return (protocol == 3);
+}
+
+static void handle_device_plug(struct udev_device *udevice)
+{
+ struct udev_device *hid_parent;
+ struct udev_enumerate *enumerate;
+ struct udev_list_entry *devices, *dev_list_entry;
+ const char *hid_id;
+ const char *hid_phys;
+ const char *hidraw_node;
+ unsigned char is_usb = FALSE;
+ int js_num = 0;
+ int fd;
+ struct playstation_peripheral *peripheral;
+
+ hid_parent = udev_device_get_parent_with_subsystem_devtype(udevice,
+ "hid", NULL);
+ if (!hid_parent) {
+ error("%s:%s() cannot get parent hid device",
+ __FILE__, __func__);
+ return;
+ }
+
+ hid_id = udev_device_get_property_value(hid_parent, "HID_ID");
+ DBG("HID_ID: %s", hid_id);
+
+ peripheral = find_playstation_peripheral(hid_id);
+ if (!peripheral) {
+ error("No supported peripheral found");
+ return;
+ }
+
+ DBG("Found a Playstation peripheral: %s", peripheral->name);
+
+ hidraw_node = udev_device_get_devnode(udevice);
+
+ /* looking for joysticks */
+ hid_phys = udev_device_get_property_value(hid_parent, "HID_PHYS");
+
+ enumerate = udev_enumerate_new(udev_device_get_udev(udevice));
+ udev_enumerate_add_match_sysname(enumerate, "js*");
+ udev_enumerate_scan_devices(enumerate);
+
+ devices = udev_enumerate_get_list_entry(enumerate);
+ udev_list_entry_foreach(dev_list_entry, devices) {
+ const char *devname;
+ struct udev_device *js_dev;
+ struct udev_device *input_parent;
+ const char *input_phys;
+
+ devname = udev_list_entry_get_name(dev_list_entry);
+ js_dev = udev_device_new_from_syspath(udev_device_get_udev(udevice),
+ devname);
+
+ input_parent = udev_device_get_parent_with_subsystem_devtype(js_dev,
+ "input", NULL);
+ if (!input_parent) {
+ error("%s:%s() cannot get parent input device.",
+ __FILE__, __func__);
+ continue;
+ }
+
+ /* check this is the joystick relative to
+ * the hidraw device above */
+ input_phys = udev_device_get_sysattr_value(input_parent,
+ "phys");
+ if (g_strcmp0(input_phys, hid_phys) == 0) {
+ js_num = atoi(udev_device_get_sysnum(js_dev)) + 1;
+ DBG("joypad device_num: %d", js_num);
+ DBG("hidraw_node: %s", hidraw_node);
+ }
+
+ udev_device_unref(js_dev);
+ }
+
+ udev_enumerate_unref(enumerate);
+
+ fd = open(hidraw_node, O_RDWR);
+ if (fd < 0) {
+ error("%s:%s() hidraw open", __FILE__, __func__);
+ return;
+ }
+
+ is_usb = is_usb_peripheral(hid_id);
+ if (is_usb) {
+ char *adapter_bdaddr;
+
+ adapter_bdaddr = btd_manager_get_default_adapter_address_str();
+ if (adapter_bdaddr == NULL) {
+ error("No adapters, exiting");
+ return;
+ }
+
+ DBG("Adapter bdaddr %s", adapter_bdaddr);
+
+ peripheral_pair(fd, adapter_bdaddr, peripheral);
+ free(adapter_bdaddr);
+ }
+
+ if (js_num > 0)
+ set_controller_number(fd, js_num);
+
+ close(fd);
+}
+
+static gboolean device_event_idle(struct udev_device *udevice)
+{
+ handle_device_plug(udevice);
+ udev_device_unref(udevice);
+ return FALSE;
+}
+
+static gboolean monitor_event(GIOChannel *source, GIOCondition condition,
+ gpointer data)
+{
+ struct udev_device *udevice;
+
+ udevice = udev_monitor_receive_device(monitor);
+ if (udevice == NULL)
+ goto out;
+ if (g_strcmp0(udev_device_get_action(udevice), "add") != 0) {
+ udev_device_unref(udevice);
+ goto out;
+ }
+
+ /* Give UDEV some time to load kernel modules */
+ g_timeout_add_seconds(1, (GSourceFunc) device_event_idle, udevice);
+
+out:
+ return TRUE;
+}
+
+static int playstation_peripheral_init(void)
+{
+ GIOChannel *channel;
+
+ DBG("Setup Playstation peripheral plugin");
+
+ ctx = udev_new();
+ monitor = udev_monitor_new_from_netlink(ctx, "udev");
+ if (monitor == NULL) {
+ error("%s:%s() Could not get udev monitor",
+ __FILE__, __func__);
+ return -1;
+ }
+
+ /* Listen for newly connected hidraw interfaces */
+ udev_monitor_filter_add_match_subsystem_devtype(monitor,
+ "hidraw", NULL);
+ udev_monitor_enable_receiving(monitor);
+
+ channel = g_io_channel_unix_new(udev_monitor_get_fd(monitor));
+ watch_id = g_io_add_watch(channel, G_IO_IN, monitor_event, NULL);
+ g_io_channel_unref(channel);
+
+ return 0;
+}
+
+static void playstation_peripheral_exit(void)
+{
+ DBG("Cleanup Playstation peripheral plugin");
+
+ if (watch_id != 0) {
+ g_source_remove(watch_id);
+ watch_id = 0;
+ }
+ if (monitor != NULL) {
+ udev_monitor_unref(monitor);
+ monitor = NULL;
+ }
+ if (ctx != NULL) {
+ udev_unref(ctx);
+ ctx = NULL;
+ }
+}
+
+BLUETOOTH_PLUGIN_DEFINE(playstation_peripheral, VERSION,
+ BLUETOOTH_PLUGIN_PRIORITY_DEFAULT,
+ playstation_peripheral_init,
+ playstation_peripheral_exit)
--
1.7.10

View File

@ -1,16 +0,0 @@
bluez installs stuff into /etc/alsa, which is wrong since the
correct location (also stated in alsa-lib configure.in) is
/usr/share/alsa instead
Upstream report:
http://permalink.gmane.org/gmane.linux.bluez.kernel/4739
--- Makefile.am~ 2010-02-12 20:26:48.000000000 +0100
+++ Makefile.am 2010-03-05 10:17:15.000000000 +0100
@@ -241,7 +241,7 @@
audio_libasound_module_ctl_bluetooth_la_CFLAGS = @ALSA_CFLAGS@
if CONFIGFILES
-alsaconfdir = $(sysconfdir)/alsa
+alsaconfdir = $(datadir)/alsa
alsaconf_DATA = audio/bluetooth.conf
endif

View File

@ -1,62 +0,0 @@
From 36358d4a7b3471f5a124a95fec9ed0e4871299e0 Mon Sep 17 00:00:00 2001
From: Scott James Remnant <scott@netsplit.com>
Date: Wed, 18 Apr 2012 15:53:55 -0700
Subject: [PATCH 14/14] autopair: use 0000 as PIN for dumb devices
Android tries 0000 for a set of audio devices, so follow suit and
do the same even though most audio devices support SSP these days.
BUG=chromium-os:25211
TEST=verified with audio devices after 'hciconfig hci0 sspmode 0'
---
plugins/autopair.c | 26 +++++++++++++++++++++++---
1 files changed, 23 insertions(+), 3 deletions(-)
diff --git a/plugins/autopair.c b/plugins/autopair.c
index 05de3ff..5b773c5 100644
--- a/plugins/autopair.c
+++ b/plugins/autopair.c
@@ -150,10 +150,24 @@ static ssize_t autopair_pincb(struct btd_adapter *adapter,
}
switch ((class & 0x1f00) >> 8) {
- case 0x05:
+ case 0x04: // Audio/Video
+ switch ((class & 0xfc) >> 2) {
+ case 0x01: // Wearable Headset Device
+ case 0x02: // Hands-free Device
+ case 0x06: // Headphones
+ case 0x07: // Portable Audio
+ case 0x0a: // HiFi Audio Device
+ if (autopair_attempt(device)) {
+ memcpy(pinbuf, "0000", 4);
+ return 4;
+ }
+ break;
+ }
+ break;
+ case 0x05: // Peripheral
switch ((class & 0xc0) >> 6) {
- case 0x01:
- case 0x03:
+ case 0x01: // Keyboard
+ case 0x03: // Combo keyboard/pointing device
if (autopair_attempt(device)) {
char pinstr[7];
srand(time(NULL));
@@ -164,6 +178,12 @@ static ssize_t autopair_pincb(struct btd_adapter *adapter,
return 6;
}
break;
+ case 0x02: // Pointing device
+ if (autopair_attempt(device)) {
+ memcpy(pinbuf, "0000", 4);
+ return 4;
+ }
+ break;
}
break;
}
--
1.7.7.3

View File

@ -1,31 +0,0 @@
diff --git a/src/bluetooth.conf b/src/bluetooth.conf
index 664dbd9..3263112 100644
--- a/src/bluetooth.conf
+++ b/src/bluetooth.conf
@@ -7,7 +7,11 @@
<!-- ../system.conf have denied everything, so we just punch some holes -->
<policy user="root">
+ <allow send_destination="org.bluez"/>
+ </policy>
+
+ <policy user="bluetooth">
<allow own="org.bluez"/>
<allow send_destination="org.bluez"/>
<allow send_interface="org.bluez.Agent"/>
@@ -18,13 +22,7 @@
<allow send_interface="org.bluez.ThermometerWatcher"/>
</policy>
- <policy at_console="true">
- <allow send_destination="org.bluez"/>
- </policy>
-
- <!-- allow users of lp group (printing subsystem) to
- communicate with bluetoothd -->
- <policy group="lp">
+ <policy user="chronos">
<allow send_destination="org.bluez"/>
</policy>

View File

@ -1,13 +0,0 @@
diff --git a/src/main.conf b/src/main.conf
index 321f622..f6784fb 100644
--- a/src/main.conf
+++ b/src/main.conf
@@ -38,7 +38,7 @@ AutoConnectTimeout = 60
# What value should be assumed for the adapter Powered property when
# SetProperty(Powered, ...) hasn't been called yet. Defaults to true
-InitiallyPowered = true
+InitiallyPowered = false
# Remember the previously stored Powered state when initializing adapters
RememberPowered = true

View File

@ -1,14 +0,0 @@
diff -Nurp bluez-4.39.orig/src/bluetooth.conf bluez-4.39/src/bluetooth.conf
--- bluez-4.39.orig/src/bluetooth.conf 2008-12-20 20:18:10.000000000 +0100
+++ bluez-4.39/src/bluetooth.conf 2009-09-05 13:30:34.411581498 +0200
@@ -17,6 +17,10 @@
<allow send_destination="org.bluez"/>
</policy>
+ <policy group="plugdev">
+ <allow send_destination="org.bluez"/>
+ </policy>
+
<policy context="default">
<deny send_destination="org.bluez"/>
</policy>

View File

@ -1,12 +0,0 @@
# Copyright (c) 2012 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# Match the PS3 Controller RAW HID device when plugged in via USB,
# place in the bluetooth group so bluetoothd can set pairing information.
SUBSYSTEM=="hidraw", SUBSYSTEMS=="usb", ATTRS{idVendor}=="054c", ATTRS{idProduct}=="0268", GROUP="bluetooth", MODE="0660"
# Match the PS3 Controller RAW HID device when connected via Bluetooth,
# place in the bluetooth group so bluetoothd can update pairing information
# and stop the lights from flashing.
SUBSYSTEM=="hidraw", SUBSYSTEMS=="hid", KERNELS=="*:054C:0268.*", GROUP="bluetooth", MODE="0660"

View File

@ -1,13 +0,0 @@
diff --git a/lib/sdp.h b/lib/sdp.h
index 2fe74d5..e559a5c 100644
--- a/lib/sdp.h
+++ b/lib/sdp.h
@@ -34,7 +34,7 @@ extern "C" {
#include <stdint.h>
#include <bluetooth/bluetooth.h>
-#define SDP_UNIX_PATH "/var/run/sdp"
+#define SDP_UNIX_PATH "/var/run/bluetooth/sdp"
#define SDP_RESPONSE_TIMEOUT 20
#define SDP_REQ_BUFFER_SIZE 2048
#define SDP_RSP_BUFFER_SIZE 65535

Some files were not shown because too many files have changed in this diff Show More