summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Makefile.am2
-rw-r--r--acinclude.m47
-rw-r--r--configure.in2
-rw-r--r--extra/Makefile.am18
-rw-r--r--extra/bcm203x.c203
-rw-r--r--extra/bcm203x.usermap1
6 files changed, 2 insertions, 231 deletions
diff --git a/Makefile.am b/Makefile.am
index dc2a1a45..dfc5a3d0 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,6 +1,6 @@
SUBDIRS = common daemon tools rfcomm hcid sdpd dund pand hidd \
- cups fuse alsa test scripts extra
+ cups fuse alsa test scripts
MAINTAINERCLEANFILES = Makefile.in \
aclocal.m4 configure config.h.in config.sub config.guess \
diff --git a/acinclude.m4 b/acinclude.m4
index c5cb152a..c4c814f0 100644
--- a/acinclude.m4
+++ b/acinclude.m4
@@ -111,7 +111,6 @@ AC_DEFUN([AC_ARG_BLUEZ], [
avctrl_enable=no
hid2hci_enable=${usb_found}
dfutool_enable=no
- bcm203x_enable=no
AC_ARG_ENABLE(fortify, AC_HELP_STRING([--disable-fortify], [disable compile time buffer checks]), [
fortify_enable=${enableval}
@@ -137,7 +136,6 @@ AC_DEFUN([AC_ARG_BLUEZ], [
avctrl_enable=${enableval}
hid2hci_enable=${enableval}
dfutool_enable=${enableval}
- bcm203x_enable=${enableval}
])
AC_ARG_ENABLE(obex, AC_HELP_STRING([--enable-obex], [enable OBEX support]), [
@@ -180,10 +178,6 @@ AC_DEFUN([AC_ARG_BLUEZ], [
dfutool_enable=${enableval}
])
- AC_ARG_ENABLE(bcm203x, AC_HELP_STRING([--enable-bcm203x], [install Broadcom 203x firmware loader]), [
- bcm203x_enable=${enableval}
- ])
-
if (test "${fortify_enable}" = "yes"); then
CFLAGS="$CFLAGS -D_FORTIFY_SOURCE=2"
fi
@@ -207,5 +201,4 @@ AC_DEFUN([AC_ARG_BLUEZ], [
AM_CONDITIONAL(AVCTRL, test "${avctrl_enable}" = "yes" && test "${usb_found}" = "yes")
AM_CONDITIONAL(HID2HCI, test "${hid2hci_enable}" = "yes" && test "${usb_found}" = "yes")
AM_CONDITIONAL(DFUTOOL, test "${dfutool_enable}" = "yes" && test "${usb_found}" = "yes")
- AM_CONDITIONAL(BCM203X, test "${bcm203x_enable}" = "yes" && test "${usb_found}" = "yes")
])
diff --git a/configure.in b/configure.in
index 5894616f..ded5f1ee 100644
--- a/configure.in
+++ b/configure.in
@@ -31,4 +31,4 @@ AC_PATH_USB
AC_ARG_BLUEZ
-AC_OUTPUT(Makefile common/Makefile daemon/Makefile tools/Makefile rfcomm/Makefile hcid/Makefile sdpd/Makefile dund/Makefile pand/Makefile hidd/Makefile cups/Makefile fuse/Makefile alsa/Makefile test/Makefile scripts/Makefile extra/Makefile)
+AC_OUTPUT(Makefile common/Makefile daemon/Makefile tools/Makefile rfcomm/Makefile hcid/Makefile sdpd/Makefile dund/Makefile pand/Makefile hidd/Makefile cups/Makefile fuse/Makefile alsa/Makefile test/Makefile scripts/Makefile)
diff --git a/extra/Makefile.am b/extra/Makefile.am
deleted file mode 100644
index c5e53d9a..00000000
--- a/extra/Makefile.am
+++ /dev/null
@@ -1,18 +0,0 @@
-
-datafiles = bcm203x.usermap
-
-if BCM203X
-usbdir = $(sysconfdir)/hotplug/usb
-
-usb_DATA = $(datafiles)
-
-usb_PROGRAMS = bcm203x
-
-bcm203x_LDADD = @USB_LIBS@
-
-AM_CFLAGS = @USB_CFLAGS@
-endif
-
-EXTRA_DIST = $(datafiles)
-
-MAINTAINERCLEANFILES = Makefile.in
diff --git a/extra/bcm203x.c b/extra/bcm203x.c
deleted file mode 100644
index 008307c3..00000000
--- a/extra/bcm203x.c
+++ /dev/null
@@ -1,203 +0,0 @@
-/*
- *
- * BlueZ - Bluetooth protocol stack for Linux
- *
- * Copyright (C) 2001-2002 Maxim Krasnyansky <maxk@qualcomm.com>
- * Copyright (C) 2003-2006 Marcel Holtmann <marcel@holtmann.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
- *
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <stdio.h>
-#include <errno.h>
-#include <fcntl.h>
-#include <stdlib.h>
-#include <string.h>
-#include <syslog.h>
-
-#include <usb.h>
-
-#ifdef NEED_USB_GET_BUSSES
-static inline struct usb_bus *usb_get_busses(void)
-{
- return usb_busses;
-}
-#endif
-
-#ifdef NEED_USB_INTERRUPT_READ
-static inline int usb_interrupt_read(usb_dev_handle *dev, int ep, char *bytes, int size, int timeout)
-{
- return usb_bulk_read(dev, ep, bytes, size, timeout);
-}
-#endif
-
-static char *fw_path = "/lib/firmware";
-
-static int load_file(struct usb_dev_handle *udev, char *filename)
-{
- char buf[4096];
- int fd, err, len;
-
- fd = open(filename, O_RDONLY);
- if (fd < 0) {
- syslog(LOG_ERR, "Can't open file %s", filename);
- return fd;
- }
-
- while (1) {
- len = read(fd, buf, sizeof(buf));
- if (len < 0) {
- syslog(LOG_ERR, "Can't read from file %s", filename);
- close(fd);
- return len;
- }
-
- if (len == 0)
- break;
-
- err = usb_bulk_write(udev, 0x02, buf, len, 100000);
- if (err < 0) {
- syslog(LOG_ERR, "Can't write bulk data packet");
- close(fd);
- return err;
- }
-
- if (err != len) {
- syslog(LOG_ERR, "Partial bulk packet written");
- close(fd);
- return -EIO;
- }
- }
-
- close(fd);
- return 0;
-}
-
-static void load_firmware(struct usb_device *dev)
-{
- struct usb_dev_handle *udev;
- char filename[PATH_MAX + 1];
- char buf[16];
-
- udev = usb_open(dev);
- if (!udev) {
- syslog(LOG_ERR, "Can't open USB device %s/%s",
- dev->bus->dirname, dev->filename);
- return;
- }
-
- if (usb_claim_interface(udev, 0) < 0) {
- usb_close(udev);
- return;
- }
-
- syslog(LOG_INFO, "Loading firmware to device %s/%s",
- dev->bus->dirname, dev->filename);
-
- snprintf(filename, PATH_MAX, "%s/%s", fw_path, "BCM2033-MD.hex");
- if (load_file(udev, filename) < 0)
- goto done;
-
- usleep(10);
-
- if (usb_bulk_write(udev, 0x02, "#", 1, 1000) < 0) {
- syslog(LOG_ERR, "Can't write bulk transfer");
- goto done;
- }
-
- memset(buf, 0, sizeof(buf));
- if (usb_interrupt_read(udev, 0x81, buf, 16, 1000) < 0) {
- syslog(LOG_ERR, "Can't read interrupt transfer");
- goto done;
- }
-
- if (buf[0] != '#') {
- syslog(LOG_ERR, "Memory select failed with '%c'", buf[0]);
- goto done;
- }
-
- snprintf(filename, PATH_MAX, "%s/%s", fw_path, "BCM2033-FW.bin");
- if (load_file(udev, filename) < 0)
- goto done;
-
- memset(buf, 0, sizeof(buf));
- if (usb_interrupt_read(udev, 0x81, buf, 16, 1000) < 0) {
- syslog(LOG_ERR, "Can't read interrupt transfer");
- goto done;
- }
-
- if (buf[0] == '.') {
- syslog(LOG_INFO, "Firmware loaded successful to device %s/%s",
- dev->bus->dirname, dev->filename);
- } else {
- syslog(LOG_ERR, "Firmware loading failed with '%c'", buf[0]);
- goto done;
- }
-
- usleep(500000);
-
-done:
- sleep(1);
-
- usb_release_interface(udev, 0);
- usb_close(udev);
-}
-
-int main(int argc, char *argv[])
-{
- struct usb_bus *bus;
- struct usb_device *dev;
- char *action, *device, *busname, *devname;
-
- action = getenv("ACTION");
- device = getenv("DEVICE");
-
- if (!action || (strcmp(action, "add") && strcmp(action, "register")))
- exit(0);
-
- openlog("bcm203x", LOG_NDELAY | LOG_PID, LOG_DAEMON);
-
- if (!device || strncmp(device, "/proc/bus/usb/", 14)) {
- syslog(LOG_ERR, "Unknown device path %s", device);
- closelog();
- exit(1);
- }
-
- busname = strtok(device + 14, "/");
- devname = strtok(NULL, "/");
-
- usb_init();
-
- usb_find_busses();
- usb_find_devices();
-
- for (bus = usb_get_busses(); bus; bus = bus->next)
- for (dev = bus->devices; dev; dev = dev->next)
- if (!strcmp(bus->dirname, busname) &&
- !strcmp(dev->filename, devname)) {
- load_firmware(dev);
- break;
- }
-
- closelog();
-
- return 0;
-}
diff --git a/extra/bcm203x.usermap b/extra/bcm203x.usermap
deleted file mode 100644
index 46bdc197..00000000
--- a/extra/bcm203x.usermap
+++ /dev/null
@@ -1 +0,0 @@
-bcm203x 0x0003 0x0a5c 0x2033 0x0000 0x0000 0x00 0x00 0x00 0x00 0x00 0x00 0x00000000