All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Remove hid2hci from bluez
@ 2009-06-14 22:54 Mario_Limonciello
  2009-06-14 23:33 ` Bastien Nocera
  2009-06-15  8:20 ` Simon Kenyon
  0 siblings, 2 replies; 11+ messages in thread
From: Mario_Limonciello @ 2009-06-14 22:54 UTC (permalink / raw)
  To: linux-bluetooth

[-- Attachment #1: Type: text/plain, Size: 133 bytes --]

Hi:

Since hid2hci has been accepted into udev-extras, I'd like to remove it
from bluez source.  Attached is a patch.

Regards

[-- Attachment #2: 0001-Remove-hid2hci-from-bluez.patch --]
[-- Type: application/octet-stream, Size: 18367 bytes --]

From 5a631382e95a08ba69561d18ff48098c12e0a217 Mon Sep 17 00:00:00 2001
From: Mario Limonciello <mario_limonciello@dell.com>
Date: Sun, 14 Jun 2009 09:59:19 -0500
Subject: [PATCH] Remove hid2hci from bluez.  
 It's now been moved into udev-extras
 and will be maintained there instead.

---
 acinclude.m4                    |    6 -
 bootstrap-configure             |    1 -
 scripts/Makefile.am             |    8 +-
 scripts/bluetooth-hid2hci.rules |   36 ----
 tools/Makefile.am               |   18 +--
 tools/hid2hci.8                 |   51 ------
 tools/hid2hci.c                 |  375 ---------------------------------------
 7 files changed, 5 insertions(+), 490 deletions(-)
 delete mode 100644 scripts/bluetooth-hid2hci.rules
 delete mode 100644 tools/hid2hci.8
 delete mode 100644 tools/hid2hci.c

diff --git a/acinclude.m4 b/acinclude.m4
index eb7cdeb..ce716de 100644
--- a/acinclude.m4
+++ b/acinclude.m4
@@ -193,7 +193,6 @@ AC_DEFUN([AC_ARG_BLUEZ], [
 	cups_enable=no
 	test_enable=no
 	bccmd_enable=no
-	hid2hci_enable=no
 	dfutool_enable=no
 	manpages_enable=yes
 	configfiles_enable=yes
@@ -253,10 +252,6 @@ AC_DEFUN([AC_ARG_BLUEZ], [
 		bccmd_enable=${enableval}
 	])
 
-	AC_ARG_ENABLE(hid2hci, AC_HELP_STRING([--enable-hid2hci], [install HID mode switching utility]), [
-		hid2hci_enable=${enableval}
-	])
-
 	AC_ARG_ENABLE(dfutool, AC_HELP_STRING([--enable-dfutool], [install DFU firmware upgrade utility]), [
 		dfutool_enable=${enableval}
 	])
@@ -351,7 +346,6 @@ AC_DEFUN([AC_ARG_BLUEZ], [
 	AM_CONDITIONAL(TEST, test "${test_enable}" = "yes")
 	AM_CONDITIONAL(TOOLS, test "${tools_enable}" = "yes")
 	AM_CONDITIONAL(BCCMD, test "${bccmd_enable}" = "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(MANPAGES, test "${manpages_enable}" = "yes")
 	AM_CONDITIONAL(CONFIGFILES, test "${configfiles_enable}" = "yes")
diff --git a/bootstrap-configure b/bootstrap-configure
index 5ec8e4c..f865c39 100755
--- a/bootstrap-configure
+++ b/bootstrap-configure
@@ -20,7 +20,6 @@ fi
 		--enable-tools \
 		--enable-bccmd \
 		--enable-dfutool \
-		--enable-hid2hci \
 		--enable-hidd \
 		--enable-pand \
 		--enable-dund \
diff --git a/scripts/Makefile.am b/scripts/Makefile.am
index 494a9c2..311f5c7 100644
--- a/scripts/Makefile.am
+++ b/scripts/Makefile.am
@@ -4,10 +4,6 @@ rulesdir = $(sysconfdir)/udev
 
 rules_DATA =
 
-if HID2HCI
-rules_DATA += bluetooth-hid2hci.rules
-endif
-
 if PCMCIARULES
 rules_DATA += bluetooth-serial.rules
 endif
@@ -19,8 +15,8 @@ udevdir = $(libexecdir)/udev
 udev_SCRIPTS = bluetooth_serial
 endif
 
-EXTRA_DIST = bluetooth.init bluetooth.default bluetooth-hid2hci.rules \
-				bluetooth-serial.rules bluetooth_serial
+EXTRA_DIST = bluetooth.init bluetooth.default bluetooth-serial.rules\
+				bluetooth_serial
 
 MAINTAINERCLEANFILES = Makefile.in
 
diff --git a/scripts/bluetooth-hid2hci.rules b/scripts/bluetooth-hid2hci.rules
deleted file mode 100644
index 1b231d1..0000000
--- a/scripts/bluetooth-hid2hci.rules
+++ /dev/null
@@ -1,36 +0,0 @@
-# Variety of Dell Bluetooth devices
-#
-# it looks like a bit of an odd rule, because it is matching
-# on a mouse device that is self powered, but that is where
-# a HID report needs to be sent to switch modes.
-#
-# Known supported devices:
-#   413c:8154
-#   413c:8158
-#   413c:8162
-ACTION=="add", ENV{ID_VENDOR}=="413c", ENV{ID_CLASS}=="mouse", ATTRS{bmAttributes}=="e0", KERNEL=="mouse*", RUN+="/usr/sbin/hid2hci --method dell -v $env{ID_VENDOR} -p $env{ID_MODEL} --mode hci"
-
-# Logitech devices
-ACTION=="add", ENV{ID_VENDOR}=="046d", ENV{ID_MODEL}=="c703" RUN+="/usr/sbin/hid2hci --method logitech -v $env{ID_VENDOR} -p $env{ID_MODEL} --mode hci"
-ACTION=="add", ENV{ID_VENDOR}=="046d", ENV{ID_MODEL}=="c704" RUN+="/usr/sbin/hid2hci --method logitech -v $env{ID_VENDOR} -p $env{ID_MODEL} --mode hci"
-ACTION=="add", ENV{ID_VENDOR}=="046d", ENV{ID_MODEL}=="c705" RUN+="/usr/sbin/hid2hci --method logitech -v $env{ID_VENDOR} -p $env{ID_MODEL} --mode hci"
-ACTION=="add", ENV{ID_VENDOR}=="046d", ENV{ID_MODEL}=="c70a" RUN+="/usr/sbin/hid2hci --method logitech -v $env{ID_VENDOR} -p $env{ID_MODEL} --mode hci"
-ACTION=="add", ENV{ID_VENDOR}=="046d", ENV{ID_MODEL}=="c70b" RUN+="/usr/sbin/hid2hci --method logitech -v $env{ID_VENDOR} -p $env{ID_MODEL} --mode hci"
-ACTION=="add", ENV{ID_VENDOR}=="046d", ENV{ID_MODEL}=="c70c" RUN+="/usr/sbin/hid2hci --method logitech -v $env{ID_VENDOR} -p $env{ID_MODEL} --mode hci"
-ACTION=="add", ENV{ID_VENDOR}=="046d", ENV{ID_MODEL}=="c70e" RUN+="/usr/sbin/hid2hci --method logitech -v $env{ID_VENDOR} -p $env{ID_MODEL} --mode hci"
-ACTION=="add", ENV{ID_VENDOR}=="046d", ENV{ID_MODEL}=="c713" RUN+="/usr/sbin/hid2hci --method logitech -v $env{ID_VENDOR} -p $env{ID_MODEL} --mode hci"
-ACTION=="add", ENV{ID_VENDOR}=="046d", ENV{ID_MODEL}=="c714" RUN+="/usr/sbin/hid2hci --method logitech -v $env{ID_VENDOR} -p $env{ID_MODEL} --mode hci"
-ACTION=="add", ENV{ID_VENDOR}=="046d", ENV{ID_MODEL}=="c71b" RUN+="/usr/sbin/hid2hci --method logitech -v $env{ID_VENDOR} -p $env{ID_MODEL} --mode hci"
-ACTION=="add", ENV{ID_VENDOR}=="046d", ENV{ID_MODEL}=="c71c" RUN+="/usr/sbin/hid2hci --method logitech -v $env{ID_VENDOR} -p $env{ID_MODEL} --mode hci"
-
-# CSR devices (in HID mode)
-ACTION=="add", ENV{ID_VENDOR}=="0a12", ENV{ID_MODEL}=="1000" RUN+="/usr/sbin/hid2hci --method csr -v $env{ID_VENDOR} -p $env{ID_MODEL} --mode hci"
-ACTION=="add", ENV{ID_VENDOR}=="0458", ENV{ID_MODEL}=="1000" RUN+="/usr/sbin/hid2hci --method csr -v $env{ID_VENDOR} -p $env{ID_MODEL} --mode hci"
-ACTION=="add", ENV{ID_VENDOR}=="05ac", ENV{ID_MODEL}=="1000" RUN+="/usr/sbin/hid2hci --method csr -v $env{ID_VENDOR} -p $env{ID_MODEL} --mode hci"
-
-# CSR devices (in HCI mode)
-#ACTION=="add", ENV{ID_VENDOR}=="0a12", ENV{ID_MODEL}=="0001" RUN+="/usr/sbin/hid2hci --method csr -v $env{ID_VENDOR} -p $env{ID_MODEL} --mode hid"
-#ACTION=="add", ENV{ID_VENDOR}=="0458", ENV{ID_MODEL}=="003f" RUN+="/usr/sbin/hid2hci --method csr -v $env{ID_VENDOR} -p $env{ID_MODEL} --mode hid"
-#ACTION=="add", ENV{ID_VENDOR}=="05ac", ENV{ID_MODEL}=="8203" RUN+="/usr/sbin/hid2hci --method csr -v $env{ID_VENDOR} -p $env{ID_MODEL} --mode hid"
-#ACTION=="add", ENV{ID_VENDOR}=="05ac", ENV{ID_MODEL}=="8204" RUN+="/usr/sbin/hid2hci --method csr -v $env{ID_VENDOR} -p $env{ID_MODEL} --mode hid"
-#ACTION=="add", ENV{ID_VENDOR}=="05ac", ENV{ID_MODEL}=="8207" RUN+="/usr/sbin/hid2hci --method csr -v $env{ID_VENDOR} -p $env{ID_MODEL} --mode hid"
diff --git a/tools/Makefile.am b/tools/Makefile.am
index 6b0ad49..887b4ee 100644
--- a/tools/Makefile.am
+++ b/tools/Makefile.am
@@ -15,14 +15,6 @@ bccmd_programs =
 bccmd_manfiles =
 endif
 
-if HID2HCI
-hid2hci_programs = hid2hci
-hid2hci_manfiles = hid2hci.8
-else
-hid2hci_programs =
-hid2hci_manfiles =
-endif
-
 if DFUTOOL
 dfutool_programs = dfutool
 dfutool_manfiles = dfutool.1
@@ -37,7 +29,7 @@ else
 usb_programs =
 endif
 
-sbin_PROGRAMS = hciattach hciconfig $(bccmd_programs) $(avctrl_programs) $(hid2hci_programs)
+sbin_PROGRAMS = hciattach hciconfig $(bccmd_programs) $(avctrl_programs)
 
 bin_PROGRAMS = $(tools_programs) $(dfutool_programs) $(dfubabel_programs)
 
@@ -77,10 +69,6 @@ bccmd_LDADD += @USB_LIBS@
 endif
 endif
 
-if HID2HCI
-hid2hci_LDADD = @USB_LIBS@
-endif
-
 if DFUTOOL
 dfutool_SOURCES = dfutool.c dfu.h dfu.c
 dfutool_LDADD = @USB_LIBS@
@@ -97,10 +85,10 @@ INCLUDES = -I$(top_srcdir)/common
 
 if MANPAGES
 man_MANS = hciattach.8 hciconfig.8 $(tools_manfiles) \
-		$(bccmd_manfiles) $(hid2hci_manfiles) $(dfutool_manfiles)
+		$(bccmd_manfiles) $(dfutool_manfiles)
 endif
 
 EXTRA_DIST = hciattach.8 hciconfig.8 hcitool.1 l2ping.1 sdptool.1 ciptool.1 \
-		 bccmd.8 avctrl.8 hid2hci.8 dfutool.1 dfubabel.1 example.psr
+		 bccmd.8 avctrl.8 dfutool.1 dfubabel.1 example.psr
 
 MAINTAINERCLEANFILES = Makefile.in
diff --git a/tools/hid2hci.8 b/tools/hid2hci.8
deleted file mode 100644
index 5d35274..0000000
--- a/tools/hid2hci.8
+++ /dev/null
@@ -1,51 +0,0 @@
-.\"
-.\"	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., 675 Mass Ave, Cambridge, MA 02139, USA.
-.\"
-.\"
-.TH HID2HCI 8 "MAY 15, 2009" "" ""
-
-.SH NAME
-hid2hci \- Bluetooth HID to HCI mode switching utility
-.SH SYNOPSIS
-.BR "hid2hci
-[
-.I options
-]
-.SH DESCRIPTION
-.B hid2hci
-is used to set up switch supported Bluetooth devices into the HCI
-mode and back.
-.SH OPTIONS
-.TP
-.BI -h
-Gives a list of possible options.
-.TP
-.BI -q
-Don't display any messages.
-.TP
-.BI -r [hid,hci]
-Sets the mode to switch the device into
-.TP
-.BI -v
-Specifies the 4 digit vendor ID assigned to the device being switched
-.TP
-.BI -p
-Specifies the 4 digit product ID assigned to the device being switched
-.TP
-.BI -m [csr, logitech, dell]
-Which vendor method to use for switching the device.
-.SH AUTHOR
-Written by Marcel Holtmann <marcel@holtmann.org>.
-.br
diff --git a/tools/hid2hci.c b/tools/hid2hci.c
deleted file mode 100644
index 11d707f..0000000
--- a/tools/hid2hci.c
+++ /dev/null
@@ -1,375 +0,0 @@
-/*
- *
- *  BlueZ - Bluetooth protocol stack for Linux
- *
- *  Copyright (C) 2003-2009  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 <stdint.h>
-#include <string.h>
-#include <getopt.h>
-#include <sys/ioctl.h>
-
-#include <usb.h>
-
-#ifdef NEED_USB_GET_BUSSES
-static inline struct usb_bus *usb_get_busses(void)
-{
-	return usb_busses;
-}
-#endif
-
-#ifndef USB_DIR_OUT
-#define USB_DIR_OUT	0x00
-#endif
-
-static char devpath[PATH_MAX + 1] = "/dev";
-
-struct hiddev_devinfo {
-	unsigned int bustype;
-	unsigned int busnum;
-	unsigned int devnum;
-	unsigned int ifnum;
-	short vendor;
-	short product;
-	short version;
-	unsigned num_applications;
-};
-
-struct hiddev_report_info {
-	unsigned report_type;
-	unsigned report_id;
-	unsigned num_fields;
-};
-
-typedef __signed__ int __s32;
-
-struct hiddev_usage_ref {
-	unsigned report_type;
-	unsigned report_id;
-	unsigned field_index;
-	unsigned usage_index;
-	unsigned usage_code;
-	__s32 value;
-};
-
-#define HIDIOCGDEVINFO		_IOR('H', 0x03, struct hiddev_devinfo)
-#define HIDIOCINITREPORT	_IO('H', 0x05)
-#define HIDIOCSREPORT		_IOW('H', 0x08, struct hiddev_report_info)
-#define HIDIOCSUSAGE		_IOW('H', 0x0C, struct hiddev_usage_ref)
-
-#define HID_REPORT_TYPE_OUTPUT	2
-
-#define HCI 0
-#define HID 1
-
-struct device_info {
-	struct usb_device *dev;
-	int mode;
-	uint16_t vendor;
-	uint16_t product;
-};
-
-static int switch_csr(struct device_info *devinfo)
-{
-	struct usb_dev_handle *udev;
-	int err;
-
-	udev = usb_open(devinfo->dev);
-	if (!udev)
-		return -errno;
-
-	err = usb_control_msg(udev, USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
-				0, devinfo->mode, 0, NULL, 0, 10000);
-
-	if (err == 0) {
-		err = -1;
-		errno = EALREADY;
-	} else {
-		if (errno == ETIMEDOUT)
-			err = 0;
-	}
-
-	usb_close(udev);
-
-	return err;
-}
-
-static int send_report(int fd, const char *buf, size_t size)
-{
-	struct hiddev_report_info rinfo;
-	struct hiddev_usage_ref uref;
-	unsigned int i;
-	int err;
-
-	for (i = 0; i < size; i++) {
-		memset(&uref, 0, sizeof(uref));
-		uref.report_type = HID_REPORT_TYPE_OUTPUT;
-		uref.report_id   = 0x10;
-		uref.field_index = 0;
-		uref.usage_index = i;
-		uref.usage_code  = 0xff000001;
-		uref.value       = buf[i] & 0x000000ff;
-		err = ioctl(fd, HIDIOCSUSAGE, &uref);
-		if (err < 0)
-			return err;
-	}
-
-	memset(&rinfo, 0, sizeof(rinfo));
-	rinfo.report_type = HID_REPORT_TYPE_OUTPUT;
-	rinfo.report_id   = 0x10;
-	rinfo.num_fields  = 1;
-	err = ioctl(fd, HIDIOCSREPORT, &rinfo);
-
-	return err;
-}
-
-static int switch_logitech(struct device_info *devinfo)
-{
-	char devname[PATH_MAX + 1];
-	int i, fd, err = -1;
-
-	for (i = 0; i < 16; i++) {
-		struct hiddev_devinfo dinfo;
-		char rep1[] = { 0xff, 0x80, 0x80, 0x01, 0x00, 0x00 };
-		char rep2[] = { 0xff, 0x80, 0x00, 0x00, 0x30, 0x00 };
-		char rep3[] = { 0xff, 0x81, 0x80, 0x00, 0x00, 0x00 };
-
-		sprintf(devname, "%s/hiddev%d", devpath, i);
-		fd = open(devname, O_RDWR);
-		if (fd < 0) {
-			sprintf(devname, "%s/usb/hiddev%d", devpath, i);
-			fd = open(devname, O_RDWR);
-			if (fd < 0) {
-				sprintf(devname, "%s/usb/hid/hiddev%d", devpath, i);
-				fd = open(devname, O_RDWR);
-				if (fd < 0)
-					continue;
-			}
-		}
-
-		memset(&dinfo, 0, sizeof(dinfo));
-		err = ioctl(fd, HIDIOCGDEVINFO, &dinfo);
-		if (err < 0 || (int) dinfo.busnum != atoi(devinfo->dev->bus->dirname) ||
-				(int) dinfo.devnum != atoi(devinfo->dev->filename)) {
-			close(fd);
-			continue;
-		}
-
-		err = ioctl(fd, HIDIOCINITREPORT, 0);
-		if (err < 0) {
-			close(fd);
-			break;
-		}
-
-		err = send_report(fd, rep1, sizeof(rep1));
-		if (err < 0) {
-			close(fd);
-			break;
-		}
-
-		err = send_report(fd, rep2, sizeof(rep2));
-		if (err < 0) {
-			close(fd);
-			break;
-		}
-
-		err = send_report(fd, rep3, sizeof(rep3));
-		close(fd);
-		break;
-	}
-
-	return err;
-}
-
-static int switch_dell(struct device_info *devinfo)
-{
-	char report[] = { 0x7f, 0x00, 0x00, 0x00 };
-
-	struct usb_dev_handle *handle;
-	int err;
-
-	switch (devinfo->mode) {
-	case HCI:
-		report[1] = 0x13;
-		break;
-	case HID:
-		report[1] = 0x14;
-		break;
-	}
-
-	handle = usb_open(devinfo->dev);
-	if (!handle)
-		return -EIO;
-
-	/* Don't need to check return, as might not be in use */
-	usb_detach_kernel_driver_np(handle, 0);
-
-	if (usb_claim_interface(handle, 0) < 0) {
-		usb_close(handle);
-		return -EIO;
-	}
-
-	err = usb_control_msg(handle,
-		USB_ENDPOINT_OUT | USB_TYPE_CLASS | USB_RECIP_INTERFACE,
-			USB_REQ_SET_CONFIGURATION, 0x7f | (0x03 << 8), 0,
-						report, sizeof(report), 5000);
-
-	if (err == 0) {
-		err = -1;
-		errno = EALREADY;
-	} else {
-		if (errno == ETIMEDOUT)
-			err = 0;
-	}
-
-	usb_close(handle);
-
-	return err;
-}
-
-static int find_device(struct device_info* devinfo)
-{
-	struct usb_bus *bus;
-	struct usb_device *dev;
-
-	usb_find_busses();
-	usb_find_devices();
-
-	for (bus = usb_get_busses(); bus; bus = bus->next)
-		for (dev = bus->devices; dev; dev = dev->next) {
-			if (dev->descriptor.idVendor == devinfo->vendor &&
-			    dev->descriptor.idProduct == devinfo->product) {
-				devinfo->dev=dev;
-				return 1;
-			}
-		}
-	return 0;
-}
-
-static void usage(char* error)
-{
-	if (error)
-		fprintf(stderr,"\n%s\n", error);
-	else
-		printf("hid2hci - Bluetooth HID to HCI mode switching utility\n\n");
-
-	printf("Usage:\n"
-		"\thid2hci [options]\n"
-		"\n");
-
-	printf("Options:\n"
-		"\t-h, --help           Display help\n"
-		"\t-q, --quiet          Don't display any messages\n"
-		"\t-r, --mode=          Mode to switch to [hid, hci]\n"
-		"\t-v, --vendor=        Vendor ID to act upon\n"
-		"\t-p, --product=       Product ID to act upon\n"
-		"\t-m, --method=        Method to use to switch [csr, logitech, dell]\n"
-		"\n");
-	if (error)
-		exit(1);
-}
-
-static struct option main_options[] = {
-	{ "help",	no_argument, 0, 'h' },
-	{ "quiet",	no_argument, 0, 'q' },
-	{ "mode",	required_argument, 0, 'r' },
-	{ "vendor",	required_argument, 0, 'v' },
-	{ "product",	required_argument, 0, 'p' },
-	{ "method",	required_argument, 0, 'm' },
-	{ 0, 0, 0, 0 }
-};
-
-int main(int argc, char *argv[])
-{
-	struct device_info dev = { NULL, HCI, 0, 0 };
-	int opt, quiet = 0;
-	int (*method)(struct device_info *dev) = NULL;
-
-	while ((opt = getopt_long(argc, argv, "+r:v:p:m:qh", main_options, NULL)) != -1) {
-		switch (opt) {
-		case 'r':
-			if (optarg && !strcmp(optarg, "hid"))
-				dev.mode = HID;
-			else if (optarg && !strcmp(optarg, "hci"))
-				dev.mode = HCI;
-			else
-				usage("ERROR: Undefined radio mode\n");
-			break;
-		case 'v':
-			sscanf(optarg, "%4hx", &dev.vendor);
-			break;
-		case 'p':
-			sscanf(optarg, "%4hx", &dev.product);
-			break;
-		case 'm':
-			if (optarg && !strcmp(optarg, "csr"))
-				method = switch_csr;
-			else if (optarg && !strcmp(optarg, "logitech"))
-				method = switch_logitech;
-			else if (optarg && !strcmp(optarg, "dell"))
-				method = switch_dell;
-			else
-				usage("ERROR: Undefined switching method\n");
-			break;
-		case 'q':
-			quiet = 1;
-			break;
-		case 'h':
-			usage(NULL);
-		default:
-			exit(0);
-		}
-	}
-
-	if (!quiet && (!dev.vendor || !dev.product || !method))
-		usage("ERROR: Vendor ID, Product ID, and Switching Method must all be defined.\n");
-
-	argc -= optind;
-	argv += optind;
-	optind = 0;
-
-	usb_init();
-
-	if (!find_device(&dev)) {
-		if (!quiet)
-			fprintf(stderr, "Device %04x:%04x not found on USB bus.\n",
-				dev.vendor, dev.product);
-		exit(1);
-	}
-
-	if (!quiet)
-		printf("Attempting to switch device %04x:%04x to %s mode ",
-			dev.vendor, dev.product, dev.mode ? "HID" : "HCI");
-	fflush(stdout);
-
-	if (method(&dev) < 0 && !quiet)
-		printf("failed (%s)\n", strerror(errno));
-	else if (!quiet)
-		printf("was successful\n");
-
-	return errno;
-}
-- 
1.6.0.4


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* Re: [PATCH] Remove hid2hci from bluez
  2009-06-14 22:54 [PATCH] Remove hid2hci from bluez Mario_Limonciello
@ 2009-06-14 23:33 ` Bastien Nocera
  2009-06-15 14:13   ` Mario Limonciello
  2009-06-15  8:20 ` Simon Kenyon
  1 sibling, 1 reply; 11+ messages in thread
From: Bastien Nocera @ 2009-06-14 23:33 UTC (permalink / raw)
  To: Mario_Limonciello; +Cc: linux-bluetooth

On Sun, 2009-06-14 at 17:54 -0500, Mario_Limonciello@Dell.com wrote:
> Hi:
> 
> Since hid2hci has been accepted into udev-extras, I'd like to remove it
> from bluez source.  Attached is a patch.

I really wonder how good an idea that is, given that, ultimately, we'd
want to remove hid2hci from everything, and handle the switching from
within bluetoothd.

If we had specs for the devices (or at least rev-eng'ed specs), we'd
need to do link keys management, and switching the devices to hci mode
from within the same codebase.

So I'd rather hid2hci didn't go into udev-extras, and stayed in bluez
until a better solution comes along.

(Still no luck on getting specs from Broadcom about the Dell adapters at
least?)

Cheers


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH] Remove hid2hci from bluez
  2009-06-14 22:54 [PATCH] Remove hid2hci from bluez Mario_Limonciello
  2009-06-14 23:33 ` Bastien Nocera
@ 2009-06-15  8:20 ` Simon Kenyon
  2009-06-15 10:03   ` Bastien Nocera
  1 sibling, 1 reply; 11+ messages in thread
From: Simon Kenyon @ 2009-06-15  8:20 UTC (permalink / raw)
  Cc: linux-bluetooth

Mario_Limonciello@Dell.com wrote:
> Hi:
>
> Since hid2hci has been accepted into udev-extras, I'd like to remove it
> from bluez source.  Attached is a patch.
>
> Regards
>   
am i correct in thinking that this is a fedora package?
what about all the other distributions out there?
--
simon

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH] Remove hid2hci from bluez
  2009-06-15  8:20 ` Simon Kenyon
@ 2009-06-15 10:03   ` Bastien Nocera
  2009-06-15 15:07     ` Simon Kenyon
  0 siblings, 1 reply; 11+ messages in thread
From: Bastien Nocera @ 2009-06-15 10:03 UTC (permalink / raw)
  To: Simon Kenyon; +Cc: linux-bluetooth

On Mon, 2009-06-15 at 09:20 +0100, Simon Kenyon wrote:
> Mario_Limonciello@Dell.com wrote:
> > Hi:
> >
> > Since hid2hci has been accepted into udev-extras, I'd like to remove it
> > from bluez source.  Attached is a patch.
> >
> > Regards
> >   
> am i correct in thinking that this is a fedora package?

No.

> what about all the other distributions out there?

N/A.


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH] Remove hid2hci from bluez
  2009-06-14 23:33 ` Bastien Nocera
@ 2009-06-15 14:13   ` Mario Limonciello
  2009-06-15 14:28     ` Bastien Nocera
  0 siblings, 1 reply; 11+ messages in thread
From: Mario Limonciello @ 2009-06-15 14:13 UTC (permalink / raw)
  To: Bastien Nocera; +Cc: linux-bluetooth

[-- Attachment #1: Type: text/plain, Size: 1199 bytes --]

Hi Bastien:

Bastien Nocera wrote:
> I really wonder how good an idea that is, given that, ultimately, we'd
> want to remove hid2hci from everything, and handle the switching from
> within bluetoothd.
>   
This is a conflicting goal with the on-demand stuff I feel.  You can't
have the on-demand stuff and this working if the BT radio is only
exposed after the device switches modes.
> If we had specs for the devices (or at least rev-eng'ed specs), we'd
> need to do link keys management, and switching the devices to hci mode
> from within the same codebase.
>   
I agree here, but I don't see the docs showing up anytime soon.
> So I'd rather hid2hci didn't go into udev-extras, and stayed in bluez
> until a better solution comes along.
>   
Why?  What's it's benefit living in the bluez tree?  By moving to
udev-extras, it now lives in /lib/udev and will work even if the /usr
gets mounted on NFS late.
> (Still no luck on getting specs from Broadcom about the Dell adapters at
> least?)
>   
I'll send another ping to ask about these again, but I wouldn't hold my
breath.

Regards

-- 
Mario Limonciello
*Dell | Linux Engineering*
mario_limonciello@dell.com


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 260 bytes --]

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH] Remove hid2hci from bluez
  2009-06-15 14:13   ` Mario Limonciello
@ 2009-06-15 14:28     ` Bastien Nocera
  2009-06-15 14:43       ` Mario Limonciello
  2009-06-15 19:08       ` Marcel Holtmann
  0 siblings, 2 replies; 11+ messages in thread
From: Bastien Nocera @ 2009-06-15 14:28 UTC (permalink / raw)
  To: Mario Limonciello; +Cc: linux-bluetooth

On Mon, 2009-06-15 at 09:13 -0500, Mario Limonciello wrote:
> Hi Bastien:
> 
> Bastien Nocera wrote:
> > I really wonder how good an idea that is, given that, ultimately, we'd
> > want to remove hid2hci from everything, and handle the switching from
> > within bluetoothd.
> >   
> This is a conflicting goal with the on-demand stuff I feel.  You can't
> have the on-demand stuff and this working if the BT radio is only
> exposed after the device switches modes.

Why? Instead of calling hid2hci, it would launch bluetoothd --udev, like
the other rules. Problem solved.

> > If we had specs for the devices (or at least rev-eng'ed specs), we'd
> > need to do link keys management, and switching the devices to hci mode
> > from within the same codebase.
> >   
> I agree here, but I don't see the docs showing up anytime soon.
> > So I'd rather hid2hci didn't go into udev-extras, and stayed in bluez
> > until a better solution comes along.
> >   
> Why?  What's it's benefit living in the bluez tree?  By moving to
> udev-extras, it now lives in /lib/udev and will work even if the /usr
> gets mounted on NFS late.

If that's the only benefit, then, frankly, who cares.

The main point is that people with an interested in Bluetooth will need
to go and fetch the code, and ask for patches to be committed.

We're losing direct commit access to the code, and gaining something
that could have been achieved in the distro package.

> > (Still no luck on getting specs from Broadcom about the Dell adapters at
> > least?)
> >   
> I'll send another ping to ask about these again, but I wouldn't hold my
> breath.
> 
> Regards
> 


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH] Remove hid2hci from bluez
  2009-06-15 14:28     ` Bastien Nocera
@ 2009-06-15 14:43       ` Mario Limonciello
  2009-06-15 19:08       ` Marcel Holtmann
  1 sibling, 0 replies; 11+ messages in thread
From: Mario Limonciello @ 2009-06-15 14:43 UTC (permalink / raw)
  To: linux-bluetooth

[-- Attachment #1: Type: text/plain, Size: 1118 bytes --]

Hi Bastien:

Bastien Nocera wrote:
> On Mon, 2009-06-15 at 09:13 -0500, Mario Limonciello wrote:
>   
>
> Why? Instead of calling hid2hci, it would launch bluetoothd --udev, like
> the other rules. Problem solved.
>   
Good point, that's sensible enough.
>   
>
> If that's the only benefit, then, frankly, who cares.
>
> The main point is that people with an interested in Bluetooth will need
> to go and fetch the code, and ask for patches to be committed.
>
> We're losing direct commit access to the code, and gaining something
> that could have been achieved in the distro package.
>
>   
Eh, direct commit access?  You submit it to this mailing list and Marcel
has to ack it, you submit it to linux-hotplug and Kay or Martin acks
it.  Seems to be 6 eggs in one hand, half a dozen in the other.  Look
over the history, and those hacking on hid2hci have been me and Marcel:
http://git.kernel.org/?p=bluetooth/bluez.git;a=history;f=tools/hid2hci.c;h=11d707fd76e940b884c9078907ab1
504cd7350d4;hb=HEAD



-- 
Mario Limonciello
*Dell | Linux Engineering*
mario_limonciello@dell.com


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 260 bytes --]

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH] Remove hid2hci from bluez
  2009-06-15 10:03   ` Bastien Nocera
@ 2009-06-15 15:07     ` Simon Kenyon
  0 siblings, 0 replies; 11+ messages in thread
From: Simon Kenyon @ 2009-06-15 15:07 UTC (permalink / raw)
  To: Bastien Nocera; +Cc: linux-bluetooth

Bastien Nocera wrote:
> On Mon, 2009-06-15 at 09:20 +0100, Simon Kenyon wrote:
>   
>> Mario_Limonciello@Dell.com wrote:
>>     
>>> Hi:
>>>
>>> Since hid2hci has been accepted into udev-extras, I'd like to remove it
>>> from bluez source.  Attached is a patch.
>>>
>>> Regards
>>>   
>>>       
>> am i correct in thinking that this is a fedora package?
>>     
>
> No.
>
>   
>> what about all the other distributions out there?
>>     
>
> N/A.
>   
apologies
i see it on git.kernel.org
--
simon

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH] Remove hid2hci from bluez
  2009-06-15 14:28     ` Bastien Nocera
  2009-06-15 14:43       ` Mario Limonciello
@ 2009-06-15 19:08       ` Marcel Holtmann
  2009-06-19 17:04         ` Mario Limonciello
  2009-06-19 17:05         ` Mario Limonciello
  1 sibling, 2 replies; 11+ messages in thread
From: Marcel Holtmann @ 2009-06-15 19:08 UTC (permalink / raw)
  To: Bastien Nocera; +Cc: Mario Limonciello, linux-bluetooth

Hi Bastien,

> > > I really wonder how good an idea that is, given that, ultimately, we'd
> > > want to remove hid2hci from everything, and handle the switching from
> > > within bluetoothd.
> > >   
> > This is a conflicting goal with the on-demand stuff I feel.  You can't
> > have the on-demand stuff and this working if the BT radio is only
> > exposed after the device switches modes.
> 
> Why? Instead of calling hid2hci, it would launch bluetoothd --udev, like
> the other rules. Problem solved.
> 
> > > If we had specs for the devices (or at least rev-eng'ed specs), we'd
> > > need to do link keys management, and switching the devices to hci mode
> > > from within the same codebase.
> > >   
> > I agree here, but I don't see the docs showing up anytime soon.
> > > So I'd rather hid2hci didn't go into udev-extras, and stayed in bluez
> > > until a better solution comes along.
> > >   
> > Why?  What's it's benefit living in the bluez tree?  By moving to
> > udev-extras, it now lives in /lib/udev and will work even if the /usr
> > gets mounted on NFS late.
> 
> If that's the only benefit, then, frankly, who cares.
> 
> The main point is that people with an interested in Bluetooth will need
> to go and fetch the code, and ask for patches to be committed.
> 
> We're losing direct commit access to the code, and gaining something
> that could have been achieved in the distro package.

that is non-sense. Kay is quick with pulling/merging patches and we
could get commit access if we really wanted to. I just don't bother
since it works good enough for me.

Regards

Marcel



^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH] Remove hid2hci from bluez
  2009-06-15 19:08       ` Marcel Holtmann
@ 2009-06-19 17:04         ` Mario Limonciello
  2009-06-19 17:05         ` Mario Limonciello
  1 sibling, 0 replies; 11+ messages in thread
From: Mario Limonciello @ 2009-06-19 17:04 UTC (permalink / raw)
  To: Marcel Holtmann; +Cc: Bastien Nocera, linux-bluetooth


[-- Attachment #1.1: Type: text/plain, Size: 532 bytes --]

Hi Marcel:

Marcel Holtmann wrote:
> Hi Bastien,
>
> that is non-sense. Kay is quick with pulling/merging patches and we
> could get commit access if we really wanted to. I just don't bother
> since it works good enough for me.
>
> Regards
>
> Marcel
Kay has merged this into mainline udev (all the stuff in extras was
moved there).  Since another release is due out today, can this be
removed from bluez before that release?

Thanks,
-- 
Mario Limonciello
*Dell | Linux Engineering*
mario_limonciello@dell.com

[-- Attachment #1.2: Type: text/html, Size: 1301 bytes --]

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 260 bytes --]

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH] Remove hid2hci from bluez
  2009-06-15 19:08       ` Marcel Holtmann
  2009-06-19 17:04         ` Mario Limonciello
@ 2009-06-19 17:05         ` Mario Limonciello
  1 sibling, 0 replies; 11+ messages in thread
From: Mario Limonciello @ 2009-06-19 17:05 UTC (permalink / raw)
  To: linux-bluetooth

[-- Attachment #1: Type: text/plain, Size: 543 bytes --]

Hi Marcel:

Marcel Holtmann wrote:
> Hi Bastien,
>
>   
>
> that is non-sense. Kay is quick with pulling/merging patches and we
> could get commit access if we really wanted to. I just don't bother
> since it works good enough for me.
>
> Regards
>
> Marcel
Kay has merged this into mainline udev (all the stuff in extras was
moved there).  Since another release is due out today, can this be
removed from bluez before that release?

Thanks,
-- 
Mario Limonciello
*Dell | Linux Engineering*
mario_limonciello@dell.com


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 260 bytes --]

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2009-06-19 17:05 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-06-14 22:54 [PATCH] Remove hid2hci from bluez Mario_Limonciello
2009-06-14 23:33 ` Bastien Nocera
2009-06-15 14:13   ` Mario Limonciello
2009-06-15 14:28     ` Bastien Nocera
2009-06-15 14:43       ` Mario Limonciello
2009-06-15 19:08       ` Marcel Holtmann
2009-06-19 17:04         ` Mario Limonciello
2009-06-19 17:05         ` Mario Limonciello
2009-06-15  8:20 ` Simon Kenyon
2009-06-15 10:03   ` Bastien Nocera
2009-06-15 15:07     ` Simon Kenyon

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.