All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH -v3 1/9] serial: remove the whole serial code
@ 2012-07-10 14:03 Gustavo Padovan
  2012-07-10 14:03 ` [PATCH -v3 2/9] health: move it to profiles Gustavo Padovan
                   ` (8 more replies)
  0 siblings, 9 replies; 11+ messages in thread
From: Gustavo Padovan @ 2012-07-10 14:03 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Gustavo Padovan

From: Gustavo Padovan <gustavo.padovan@collabora.co.uk>

---
 Makefile.am        |   19 +-
 acinclude.m4       |    6 -
 doc/serial-api.txt |   57 -----
 serial/main.c      |   59 -----
 serial/manager.c   |  127 -----------
 serial/manager.h   |   25 --
 serial/port.c      |  638 ----------------------------------------------------
 serial/port.h      |   29 ---
 serial/serial.conf |   10 -
 9 files changed, 5 insertions(+), 965 deletions(-)
 delete mode 100644 doc/serial-api.txt
 delete mode 100644 serial/main.c
 delete mode 100644 serial/manager.c
 delete mode 100644 serial/manager.h
 delete mode 100644 serial/port.c
 delete mode 100644 serial/port.h
 delete mode 100644 serial/serial.conf

diff --git a/Makefile.am b/Makefile.am
index 009762d..bd36248 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -191,13 +191,6 @@ builtin_modules += hog
 builtin_sources += input/hog_device.h input/hog_device.c
 endif
 
-if SERIALPLUGIN
-builtin_modules += serial
-builtin_sources += serial/main.c \
-			serial/manager.h serial/manager.c \
-			serial/port.h serial/port.c
-endif
-
 if NETWORKPLUGIN
 builtin_modules += network
 builtin_sources += network/main.c \
@@ -334,11 +327,10 @@ endif
 
 EXTRA_DIST += src/genbuiltin src/bluetooth.conf src/org.bluez.service \
 			src/main.conf network/network.conf \
-			input/input.conf serial/serial.conf \
+			input/input.conf proximity/proximity.conf \
 			audio/audio.conf audio/telephony-dummy.c \
 			audio/telephony-maemo5.c audio/telephony-ofono.c \
-			audio/telephony-maemo6.c sap/sap-dummy.c sap/sap-u8500.c \
-			proximity/proximity.conf
+			audio/telephony-maemo6.c sap/sap-dummy.c sap/sap-u8500.c
 
 if AUDIOPLUGIN
 if GSTREAMER
@@ -392,10 +384,9 @@ EXTRA_DIST += scripts/bluetooth-hid2hci.rules scripts/bluetooth-serial.rules
 EXTRA_DIST += doc/manager-api.txt \
 		doc/adapter-api.txt doc/device-api.txt \
 		doc/service-api.txt doc/agent-api.txt doc/attribute-api.txt \
-		doc/serial-api.txt doc/network-api.txt \
-		doc/input-api.txt doc/audio-api.txt doc/control-api.txt \
-		doc/hfp-api.txt doc/health-api.txt doc/sap-api.txt \
-		doc/media-api.txt doc/assigned-numbers.txt
+		doc/network-api.txt doc/input-api.txt doc/audio-api.txt \
+		doc/control-api.txt doc/hfp-api.txt doc/health-api.txt \
+		doc/sap-api.txt doc/media-api.txt doc/assigned-numbers.txt
 
 AM_YFLAGS = -d
 
diff --git a/acinclude.m4 b/acinclude.m4
index 3a2a50a..842eea3 100644
--- a/acinclude.m4
+++ b/acinclude.m4
@@ -172,7 +172,6 @@ AC_DEFUN([AC_ARG_BLUEZ], [
 	gstreamer_enable=${gstreamer_found}
 	audio_enable=yes
 	input_enable=yes
-	serial_enable=yes
 	network_enable=yes
 	sap_enable=no
 	service_enable=yes
@@ -218,10 +217,6 @@ AC_DEFUN([AC_ARG_BLUEZ], [
 	])
 	AC_SUBST([SAP_DRIVER], [sap-${sap_driver}.c])
 
-	AC_ARG_ENABLE(serial, AC_HELP_STRING([--disable-serial], [disable serial plugin]), [
-		serial_enable=${enableval}
-	])
-
 	AC_ARG_ENABLE(input, AC_HELP_STRING([--disable-input], [disable input plugin]), [
 		input_enable=${enableval}
 	])
@@ -345,7 +340,6 @@ AC_DEFUN([AC_ARG_BLUEZ], [
 	AM_CONDITIONAL(GSTREAMER, test "${gstreamer_enable}" = "yes" && test "${gstreamer_found}" = "yes")
 	AM_CONDITIONAL(AUDIOPLUGIN, test "${audio_enable}" = "yes")
 	AM_CONDITIONAL(INPUTPLUGIN, test "${input_enable}" = "yes")
-	AM_CONDITIONAL(SERIALPLUGIN, test "${serial_enable}" = "yes")
 	AM_CONDITIONAL(NETWORKPLUGIN, test "${network_enable}" = "yes")
 	AM_CONDITIONAL(SAPPLUGIN, test "${sap_enable}" = "yes")
 	AM_CONDITIONAL(SERVICEPLUGIN, test "${service_enable}" = "yes")
diff --git a/doc/serial-api.txt b/doc/serial-api.txt
deleted file mode 100644
index 42afe3d..0000000
--- a/doc/serial-api.txt
+++ /dev/null
@@ -1,57 +0,0 @@
-BlueZ D-Bus Serial API description
-**********************************
-
-Copyright (C) 2004-2010  Marcel Holtmann <marcel@holtmann.org>
-
-
-Serial hierarchy
-================
-
-Service		org.bluez
-Interface	org.bluez.Serial
-Object path	[variable prefix]/{hci0,hci1,...}/dev_XX_XX_XX_XX_XX_XX
-
-Methods		string Connect(string pattern)
-
-			Connects to a specific RFCOMM based service on a
-			remote device and then creates a RFCOMM TTY
-			device for it. The RFCOMM TTY device is returned.
-
-			Possible patterns: UUID 128 bit as string
-					   Profile short names, e.g: spp, dun
-					   RFCOMM channel as string, 1-30
-
-			Possible errors: org.bluez.Error.InvalidArguments
-					 org.bluez.Error.InProgress
-					 org.bluez.Error.ConnectionAttemptFailed
-					 org.bluez.Error.NotSupported
-
-Methods		fd ConnectFD(string pattern) [experimental]
-
-			Connects to a specific RFCOMM based service on a
-			remote device and returns a file descriptor to talk
-			 with this device.
-
-			Possible patterns: UUID 128 bit as string
-					   Profile short names, e.g: spp, dun
-					   RFCOMM channel as string, 1-30
-
-			Possible errors: org.bluez.Error.InvalidArguments
-					 org.bluez.Error.InProgress
-					 org.bluez.Error.ConnectionAttemptFailed
-					 org.bluez.Error.NotSupported
-
-
-		void Disconnect(string device)
-
-			Disconnect a RFCOMM TTY device that has been
-			created by Connect method.
-
-			To abort a connection attempt in case of errors or
-			timeouts in the client it is fine to call this method.
-
-			In that case one of patterns of the Connect method should
-			be supplied instead of the TTY device.
-
-			Possible errors: org.bluez.Error.InvalidArguments
-					 org.bluez.Error.DoesNotExist
diff --git a/serial/main.c b/serial/main.c
deleted file mode 100644
index 38ded03..0000000
--- a/serial/main.c
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- *
- *  BlueZ - Bluetooth protocol stack for Linux
- *
- *  Copyright (C) 2004-2010  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 <errno.h>
-
-#include <gdbus.h>
-
-#include "plugin.h"
-#include "manager.h"
-
-static DBusConnection *connection;
-
-static int serial_init(void)
-{
-	connection = dbus_bus_get(DBUS_BUS_SYSTEM, NULL);
-	if (connection == NULL)
-		return -EIO;
-
-	if (serial_manager_init(connection) < 0) {
-		dbus_connection_unref(connection);
-		return -EIO;
-	}
-
-	return 0;
-}
-
-static void serial_exit(void)
-{
-	serial_manager_exit();
-
-	dbus_connection_unref(connection);
-}
-
-BLUETOOTH_PLUGIN_DEFINE(serial, VERSION,
-			BLUETOOTH_PLUGIN_PRIORITY_DEFAULT, serial_init, serial_exit)
diff --git a/serial/manager.c b/serial/manager.c
deleted file mode 100644
index 6f3fc1f..0000000
--- a/serial/manager.c
+++ /dev/null
@@ -1,127 +0,0 @@
-/*
- *
- *  BlueZ - Bluetooth protocol stack for Linux
- *
- *  Copyright (C) 2004-2010  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 <errno.h>
-
-#include <bluetooth/bluetooth.h>
-#include <bluetooth/sdp.h>
-#include <bluetooth/sdp_lib.h>
-#include <bluetooth/uuid.h>
-
-#include <gdbus.h>
-
-#include "adapter.h"
-#include "device.h"
-
-#include "log.h"
-
-#include "port.h"
-#include "manager.h"
-
-static DBusConnection *connection = NULL;
-
-static int serial_probe(struct btd_device *device, const char *uuid)
-{
-	struct btd_adapter *adapter = device_get_adapter(device);
-	const gchar *path = device_get_path(device);
-	sdp_list_t *protos;
-	int ch;
-	bdaddr_t src, dst;
-	const sdp_record_t *rec;
-
-	DBG("path %s: %s", path, uuid);
-
-	rec = btd_device_get_record(device, uuid);
-	if (!rec)
-		return -EINVAL;
-
-	if (sdp_get_access_protos(rec, &protos) < 0)
-		return -EINVAL;
-
-	ch = sdp_get_proto_port(protos, RFCOMM_UUID);
-	sdp_list_foreach(protos, (sdp_list_func_t) sdp_list_free, NULL);
-	sdp_list_free(protos, NULL);
-
-	if (ch < 1 || ch > 30) {
-		error("Channel out of range: %d", ch);
-		return -EINVAL;
-	}
-
-	adapter_get_address(adapter, &src);
-	device_get_address(device, &dst, NULL);
-
-	return port_register(connection, path, &src, &dst, uuid, ch);
-}
-
-static void serial_remove(struct btd_device *device)
-{
-	const gchar *path = device_get_path(device);
-
-	DBG("path %s", path);
-
-	port_unregister(path);
-}
-
-
-static int port_probe(struct btd_device *device, GSList *uuids)
-{
-	while (uuids) {
-		serial_probe(device, uuids->data);
-		uuids = uuids->next;
-	}
-
-	return 0;
-}
-
-static void port_remove(struct btd_device *device)
-{
-	return serial_remove(device);
-}
-
-static struct btd_device_driver serial_port_driver = {
-	.name	= "serial-port",
-	.uuids	= BTD_UUIDS(RFCOMM_UUID_STR),
-	.probe	= port_probe,
-	.remove	= port_remove,
-};
-
-int serial_manager_init(DBusConnection *conn)
-{
-	connection = dbus_connection_ref(conn);
-
-	btd_register_device_driver(&serial_port_driver);
-
-	return 0;
-}
-
-void serial_manager_exit(void)
-{
-	btd_unregister_device_driver(&serial_port_driver);
-
-	dbus_connection_unref(connection);
-	connection = NULL;
-}
diff --git a/serial/manager.h b/serial/manager.h
deleted file mode 100644
index c8b96e8..0000000
--- a/serial/manager.h
+++ /dev/null
@@ -1,25 +0,0 @@
-/*
- *
- *  BlueZ - Bluetooth protocol stack for Linux
- *
- *  Copyright (C) 2004-2010  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
- *
- */
-
-int serial_manager_init(DBusConnection *conn);
-void serial_manager_exit(void);
diff --git a/serial/port.c b/serial/port.c
deleted file mode 100644
index 2422cfe..0000000
--- a/serial/port.c
+++ /dev/null
@@ -1,638 +0,0 @@
-/*
- *
- *  BlueZ - Bluetooth protocol stack for Linux
- *
- *  Copyright (C) 2004-2010  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 <errno.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <sys/ioctl.h>
-#include <fcntl.h>
-
-#include <bluetooth/bluetooth.h>
-#include <bluetooth/rfcomm.h>
-#include <bluetooth/sdp.h>
-#include <bluetooth/sdp_lib.h>
-
-#include <glib.h>
-#include <gdbus.h>
-
-#include "log.h"
-#include "glib-helper.h"
-#include "sdp-client.h"
-#include "btio.h"
-
-#include "error.h"
-#include "manager.h"
-#include "adapter.h"
-#include "device.h"
-#include "storage.h"
-#include "port.h"
-
-#define SERIAL_PORT_INTERFACE	"org.bluez.Serial"
-
-#define MAX_OPEN_TRIES		5
-#define OPEN_WAIT		300	/* ms. udev node creation retry wait */
-
-struct serial_device {
-	DBusConnection	*conn;		/* for name listener handling */
-	bdaddr_t	src;		/* Source (local) address */
-	bdaddr_t	dst;		/* Destination address */
-	char		*path;		/* Device path */
-	GSList		*ports;		/* Available ports */
-};
-
-struct serial_port {
-	DBusMessage	*msg;		/* for name listener handling */
-	int16_t		id;		/* RFCOMM device id */
-	uint8_t		channel;	/* RFCOMM channel */
-	char		*uuid;		/* service identification */
-	char		*dev;		/* RFCOMM device name */
-	int		fd;		/* Opened file descriptor */
-	GIOChannel	*io;		/* BtIO channel */
-	guint		listener_id;
-	struct serial_device *device;
-};
-
-static GSList *devices = NULL;
-
-static struct serial_device *find_device(GSList *devices, const char *path)
-{
-	GSList *l;
-
-	for (l = devices; l != NULL; l = l->next) {
-		struct serial_device *device = l->data;
-
-		if (!strcmp(device->path, path))
-			return device;
-	}
-
-	return NULL;
-}
-
-static struct serial_port *find_port(GSList *ports, const char *pattern)
-{
-	GSList *l;
-	int channel;
-	char *endptr = NULL;
-
-	channel = strtol(pattern, &endptr, 10);
-
-	for (l = ports; l != NULL; l = l->next) {
-		struct serial_port *port = l->data;
-		char *uuid_str;
-		int ret;
-
-		if (port->uuid && !strcasecmp(port->uuid, pattern))
-			return port;
-
-		if (endptr && *endptr == '\0' && port->channel == channel)
-			return port;
-
-		if (port->dev && !strcmp(port->dev, pattern))
-			return port;
-
-		if (!port->uuid)
-			continue;
-
-		uuid_str = bt_name2string(pattern);
-		if (!uuid_str)
-			continue;
-
-		ret = strcasecmp(port->uuid, uuid_str);
-		g_free(uuid_str);
-		if (ret == 0)
-			return port;
-	}
-
-	return NULL;
-}
-
-static int port_release(struct serial_port *port)
-{
-	struct rfcomm_dev_req req;
-	int rfcomm_ctl;
-	int err = 0;
-
-	if (port->id < 0) {
-		if (port->io) {
-			g_io_channel_shutdown(port->io, TRUE, NULL);
-			g_io_channel_unref(port->io);
-			port->io = NULL;
-		} else
-			bt_cancel_discovery(&port->device->src,
-						&port->device->dst);
-
-		return 0;
-	}
-
-	DBG("Serial port %s released", port->dev);
-
-	rfcomm_ctl = socket(AF_BLUETOOTH, SOCK_RAW, BTPROTO_RFCOMM);
-	if (rfcomm_ctl < 0)
-		return -errno;
-
-	if (port->fd >= 0) {
-		close(port->fd);
-		port->fd = -1;
-	}
-
-	memset(&req, 0, sizeof(req));
-	req.dev_id = port->id;
-
-	/*
-	 * We are hitting a kernel bug inside RFCOMM code when
-	 * RFCOMM_HANGUP_NOW bit is set on request's flags passed to
-	 * ioctl(RFCOMMRELEASEDEV)!
-	 */
-	req.flags = (1 << RFCOMM_HANGUP_NOW);
-
-	if (ioctl(rfcomm_ctl, RFCOMMRELEASEDEV, &req) < 0) {
-		err = -errno;
-		error("Can't release device %s: %s (%d)",
-				port->dev, strerror(-err), -err);
-	}
-
-	g_free(port->dev);
-	port->dev = NULL;
-	port->id = -1;
-	close(rfcomm_ctl);
-	return err;
-}
-
-static void serial_port_free(void *data)
-{
-	struct serial_port *port = data;
-	struct serial_device *device = port->device;
-
-	if (device && port->listener_id > 0)
-		g_dbus_remove_watch(device->conn, port->listener_id);
-
-	port_release(port);
-
-	g_free(port->uuid);
-	g_free(port);
-}
-
-static void serial_device_free(void *data)
-{
-	struct serial_device *device = data;
-
-	g_free(device->path);
-	if (device->conn)
-		dbus_connection_unref(device->conn);
-	g_free(device);
-}
-
-static void port_owner_exited(DBusConnection *conn, void *user_data)
-{
-	struct serial_port *port = user_data;
-
-	port_release(port);
-
-	port->listener_id = 0;
-}
-
-static void path_unregister(void *data)
-{
-	struct serial_device *device = data;
-
-	DBG("Unregistered interface %s on path %s", SERIAL_PORT_INTERFACE,
-		device->path);
-
-	devices = g_slist_remove(devices, device);
-	serial_device_free(device);
-}
-
-void port_release_all(void)
-{
-	g_slist_free_full(devices, serial_device_free);
-}
-
-static void open_notify(int fd, int err, struct serial_port *port)
-{
-	struct serial_device *device = port->device;
-	DBusMessage *reply;
-
-	if (err < 0) {
-		/* Max tries exceeded */
-		port_release(port);
-		reply = btd_error_failed(port->msg, strerror(-err));
-	} else {
-		port->fd = fd;
-		reply = g_dbus_create_reply(port->msg,
-				DBUS_TYPE_STRING, &port->dev,
-				DBUS_TYPE_INVALID);
-	}
-
-	/* Reply to the requestor */
-	g_dbus_send_message(device->conn, reply);
-}
-
-static gboolean open_continue(gpointer user_data)
-{
-	struct serial_port *port = user_data;
-	int fd;
-	static int ntries = MAX_OPEN_TRIES;
-
-	if (!port->listener_id)
-		return FALSE; /* Owner exited */
-
-	fd = open(port->dev, O_RDONLY | O_NOCTTY);
-	if (fd < 0) {
-		int err = -errno;
-		error("Could not open %s: %s (%d)",
-				port->dev, strerror(-err), -err);
-		if (!--ntries) {
-			/* Reporting error */
-			open_notify(fd, err, port);
-			ntries = MAX_OPEN_TRIES;
-			return FALSE;
-		}
-		return TRUE;
-	}
-
-	/* Connection succeeded */
-	open_notify(fd, 0, port);
-	return FALSE;
-}
-
-static int port_open(struct serial_port *port)
-{
-	int fd;
-
-	fd = open(port->dev, O_RDONLY | O_NOCTTY);
-	if (fd < 0) {
-		g_timeout_add(OPEN_WAIT, open_continue, port);
-		return -EINPROGRESS;
-	}
-
-	return fd;
-}
-
-static void rfcomm_connect_cb(GIOChannel *chan, GError *conn_err,
-							gpointer user_data)
-{
-	struct serial_port *port = user_data;
-	struct serial_device *device = port->device;
-	struct rfcomm_dev_req req;
-	int sk, fd;
-	DBusMessage *reply;
-
-	/* Owner exited? */
-	if (!port->listener_id)
-		return;
-
-	if (conn_err) {
-		error("%s", conn_err->message);
-		reply = btd_error_failed(port->msg, conn_err->message);
-		goto fail;
-	}
-
-	sk = g_io_channel_unix_get_fd(chan);
-
-	if (dbus_message_has_member(port->msg, "ConnectFD")) {
-		reply = g_dbus_create_reply(port->msg, DBUS_TYPE_UNIX_FD, &sk,
-							DBUS_TYPE_INVALID);
-		g_dbus_send_message(device->conn, reply);
-
-		close(sk);
-
-		g_dbus_remove_watch(device->conn, port->listener_id);
-		port->listener_id = 0;
-
-		return;
-	}
-
-	memset(&req, 0, sizeof(req));
-	req.dev_id = -1;
-	req.flags = (1 << RFCOMM_REUSE_DLC);
-	bacpy(&req.src, &device->src);
-	bacpy(&req.dst, &device->dst);
-	req.channel = port->channel;
-
-	g_io_channel_unref(port->io);
-	port->io = NULL;
-
-	port->id = ioctl(sk, RFCOMMCREATEDEV, &req);
-	if (port->id < 0) {
-		int err = -errno;
-		error("ioctl(RFCOMMCREATEDEV): %s (%d)", strerror(-err), -err);
-		reply = btd_error_failed(port->msg, strerror(-err));
-		g_io_channel_shutdown(chan, TRUE, NULL);
-		goto fail;
-	}
-
-	port->dev = g_strdup_printf("/dev/rfcomm%d", port->id);
-
-	DBG("Serial port %s created", port->dev);
-
-	g_io_channel_shutdown(chan, TRUE, NULL);
-
-	/* Addressing connect port */
-	fd = port_open(port);
-	if (fd < 0)
-		/* Open in progress: Wait the callback */
-		return;
-
-	open_notify(fd, 0, port);
-	return;
-
-fail:
-	g_dbus_send_message(device->conn, reply);
-	g_dbus_remove_watch(device->conn, port->listener_id);
-	port->listener_id = 0;
-}
-
-static void get_record_cb(sdp_list_t *recs, int err, gpointer user_data)
-{
-	struct serial_port *port = user_data;
-	struct serial_device *device = port->device;
-	sdp_record_t *record = NULL;
-	sdp_list_t *protos;
-	DBusMessage *reply;
-	GError *gerr = NULL;
-
-	if (!port->listener_id)
-		return;
-
-	if (err < 0) {
-		error("Unable to get service record: %s (%d)", strerror(-err),
-			-err);
-		reply = btd_error_failed(port->msg, strerror(-err));
-		goto failed;
-	}
-
-	if (!recs || !recs->data) {
-		error("No record found");
-		reply = btd_error_failed(port->msg, "No record found");
-		goto failed;
-	}
-
-	record = recs->data;
-
-	if (sdp_get_access_protos(record, &protos) < 0) {
-		error("Unable to get access protos from port record");
-		reply = btd_error_failed(port->msg, "Invalid channel");
-		goto failed;
-	}
-
-	port->channel = sdp_get_proto_port(protos, RFCOMM_UUID);
-
-	sdp_list_foreach(protos, (sdp_list_func_t) sdp_list_free, NULL);
-	sdp_list_free(protos, NULL);
-
-	port->io = bt_io_connect(BT_IO_RFCOMM, rfcomm_connect_cb, port,
-				NULL, &gerr,
-				BT_IO_OPT_SOURCE_BDADDR, &device->src,
-				BT_IO_OPT_DEST_BDADDR, &device->dst,
-				BT_IO_OPT_CHANNEL, port->channel,
-				BT_IO_OPT_SEC_LEVEL, BT_IO_SEC_MEDIUM,
-				BT_IO_OPT_INVALID);
-	if (!port->io) {
-		error("%s", gerr->message);
-		reply = btd_error_failed(port->msg, gerr->message);
-		g_error_free(gerr);
-		goto failed;
-	}
-
-	return;
-
-failed:
-	g_dbus_remove_watch(device->conn, port->listener_id);
-	port->listener_id = 0;
-	g_dbus_send_message(device->conn, reply);
-}
-
-static int connect_port(struct serial_port *port)
-{
-	struct serial_device *device = port->device;
-	uuid_t uuid;
-	int err;
-
-	if (!port->uuid)
-		goto connect;
-
-	err = bt_string2uuid(&uuid, port->uuid);
-	if (err < 0)
-		return err;
-
-	sdp_uuid128_to_uuid(&uuid);
-
-	return bt_search_service(&device->src, &device->dst, &uuid,
-				get_record_cb, port, NULL);
-
-connect:
-	port->io = bt_io_connect(BT_IO_RFCOMM, rfcomm_connect_cb, port,
-				NULL, NULL,
-				BT_IO_OPT_SOURCE_BDADDR, &device->src,
-				BT_IO_OPT_DEST_BDADDR, &device->dst,
-				BT_IO_OPT_CHANNEL, port->channel,
-				BT_IO_OPT_SEC_LEVEL, BT_IO_SEC_MEDIUM,
-				BT_IO_OPT_INVALID);
-	if (port->io == NULL)
-		return -EIO;
-
-	return 0;
-}
-
-static struct serial_port *create_port(struct serial_device *device,
-					const char *uuid, uint8_t channel)
-{
-	struct serial_port *port;
-
-	port = g_new0(struct serial_port, 1);
-	port->uuid = g_strdup(uuid);
-	port->channel = channel;
-	port->device = device;
-	port->id = -1;
-	port->fd = -1;
-
-	device->ports = g_slist_append(device->ports, port);
-
-	return port;
-}
-
-static DBusMessage *port_connect(DBusConnection *conn,
-					DBusMessage *msg, void *user_data)
-{
-	struct serial_device *device = user_data;
-	struct serial_port *port;
-	const char *pattern;
-	int err;
-
-	if (dbus_message_get_args(msg, NULL, DBUS_TYPE_STRING, &pattern,
-						DBUS_TYPE_INVALID) == FALSE)
-		return NULL;
-
-	port = find_port(device->ports, pattern);
-	if (!port) {
-		char *endptr = NULL;
-		int channel;
-
-		channel = strtol(pattern, &endptr, 10);
-		if ((endptr && *endptr != '\0') || channel < 1 || channel > 30)
-			return btd_error_does_not_exist(msg);
-
-		port = create_port(device, NULL, channel);
-	}
-
-	if (port->listener_id)
-		return btd_error_failed(msg, "Port already in use");
-
-	port->listener_id = g_dbus_add_disconnect_watch(conn,
-						dbus_message_get_sender(msg),
-						port_owner_exited, port,
-						NULL);
-
-	port->msg = dbus_message_ref(msg);
-
-	err = connect_port(port);
-	if (err < 0) {
-		error("%s", strerror(-err));
-		g_dbus_remove_watch(conn, port->listener_id);
-		port->listener_id = 0;
-
-		return btd_error_failed(msg, strerror(-err));
-	}
-
-	return NULL;
-}
-
-static DBusMessage *port_disconnect(DBusConnection *conn,
-					DBusMessage *msg, void *user_data)
-{
-	struct serial_device *device = user_data;
-	struct serial_port *port;
-	const char *dev, *owner, *caller;
-
-	if (dbus_message_get_args(msg, NULL, DBUS_TYPE_STRING, &dev,
-						DBUS_TYPE_INVALID) == FALSE)
-		return NULL;
-
-	port = find_port(device->ports, dev);
-	if (!port)
-		return btd_error_does_not_exist(msg);
-
-	if (!port->listener_id)
-		return btd_error_not_connected(msg);
-
-	owner = dbus_message_get_sender(port->msg);
-	caller = dbus_message_get_sender(msg);
-	if (!g_str_equal(owner, caller))
-		return btd_error_not_authorized(msg);
-
-	port_release(port);
-
-	g_dbus_remove_watch(conn, port->listener_id);
-	port->listener_id = 0;
-
-	return g_dbus_create_reply(msg, DBUS_TYPE_INVALID);
-}
-
-static const GDBusMethodTable port_methods[] = {
-	{ GDBUS_ASYNC_METHOD("Connect",
-		GDBUS_ARGS({ "pattern", "s" }),	GDBUS_ARGS({ "tty", "s" }),
-		port_connect) },
-	{ GDBUS_ASYNC_METHOD("ConnectFD",
-		GDBUS_ARGS({ "pattern", "s" }), GDBUS_ARGS({ "fd", "s" }),
-		port_connect) },
-	{ GDBUS_METHOD("Disconnect",
-		GDBUS_ARGS({ "device", "s" }), NULL,
-		port_disconnect) },
-	{ }
-};
-
-static struct serial_device *create_serial_device(DBusConnection *conn,
-					const char *path, bdaddr_t *src,
-					bdaddr_t *dst)
-{
-	struct serial_device *device;
-
-	device = g_new0(struct serial_device, 1);
-	device->conn = dbus_connection_ref(conn);
-	bacpy(&device->dst, dst);
-	bacpy(&device->src, src);
-	device->path = g_strdup(path);
-
-	if (!g_dbus_register_interface(conn, path,
-				SERIAL_PORT_INTERFACE,
-				port_methods, NULL, NULL,
-				device, path_unregister)) {
-		error("D-Bus failed to register %s interface",
-				SERIAL_PORT_INTERFACE);
-		serial_device_free(device);
-		return NULL;
-	}
-
-	DBG("Registered interface %s on path %s",
-		SERIAL_PORT_INTERFACE, path);
-
-	return device;
-}
-
-int port_register(DBusConnection *conn, const char *path, bdaddr_t *src,
-			bdaddr_t *dst, const char *uuid, uint8_t channel)
-{
-	struct serial_device *device;
-	struct serial_port *port;
-
-	device = find_device(devices, path);
-	if (!device) {
-		device = create_serial_device(conn, path, src, dst);
-		if (!device)
-			return -1;
-		devices = g_slist_append(devices, device);
-	}
-
-	if (find_port(device->ports, uuid))
-		return 0;
-
-	port = g_new0(struct serial_port, 1);
-	port->uuid = g_strdup(uuid);
-	port->channel = channel;
-	port->device = device;
-	port->id = -1;
-	port->fd = -1;
-
-	device->ports = g_slist_append(device->ports, port);
-
-	return 0;
-}
-
-int port_unregister(const char *path)
-{
-	struct serial_device *device;
-
-	device = find_device(devices, path);
-	if (!device)
-		return -ENOENT;
-
-	g_slist_free_full(device->ports, serial_port_free);
-
-	g_dbus_unregister_interface(device->conn, path, SERIAL_PORT_INTERFACE);
-
-	return 0;
-}
diff --git a/serial/port.h b/serial/port.h
deleted file mode 100644
index 74ac9f0..0000000
--- a/serial/port.h
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- *
- *  BlueZ - Bluetooth protocol stack for Linux
- *
- *  Copyright (C) 2004-2010  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
- *
- */
-
-void port_release_all(void);
-
-int port_register(DBusConnection *conn, const char *path, bdaddr_t *src,
-		  bdaddr_t *dst, const char *name, uint8_t channel);
-
-int port_unregister(const char *path);
diff --git a/serial/serial.conf b/serial/serial.conf
deleted file mode 100644
index 43ee6af..0000000
--- a/serial/serial.conf
+++ /dev/null
@@ -1,10 +0,0 @@
-# Configuration file for serial
-
-# There could be multiple proxy sections, the format is [Proxy <user chosen name>]
-#[Proxy DUN]
-
-# UUID for DUN proxy service
-#UUID=00001103-0000-1000-8000-00805F9B34FB
-
-# Address for device node
-#Address=/dev/ttyx
-- 
1.7.10.2


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

* [PATCH -v3 2/9] health: move it to profiles
  2012-07-10 14:03 [PATCH -v3 1/9] serial: remove the whole serial code Gustavo Padovan
@ 2012-07-10 14:03 ` Gustavo Padovan
  2012-07-10 14:03 ` [PATCH -v3 3/9] input: move it to profiles folder Gustavo Padovan
                   ` (7 subsequent siblings)
  8 siblings, 0 replies; 11+ messages in thread
From: Gustavo Padovan @ 2012-07-10 14:03 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Gustavo Padovan

From: Gustavo Padovan <gustavo.padovan@collabora.co.uk>

---
 Makefile.am                                 |   14 +++++++-------
 {health => profiles/health}/hdp.c           |    0
 {health => profiles/health}/hdp.h           |    0
 {health => profiles/health}/hdp_main.c      |    0
 {health => profiles/health}/hdp_manager.c   |    0
 {health => profiles/health}/hdp_manager.h   |    0
 {health => profiles/health}/hdp_types.h     |    0
 {health => profiles/health}/hdp_util.c      |    0
 {health => profiles/health}/hdp_util.h      |    0
 {health => profiles/health}/mcap.c          |    0
 {health => profiles/health}/mcap.h          |    0
 {health => profiles/health}/mcap_internal.h |    0
 {health => profiles/health}/mcap_lib.h      |    0
 {health => profiles/health}/mcap_sync.c     |    0
 14 files changed, 7 insertions(+), 7 deletions(-)
 rename {health => profiles/health}/hdp.c (100%)
 rename {health => profiles/health}/hdp.h (100%)
 rename {health => profiles/health}/hdp_main.c (100%)
 rename {health => profiles/health}/hdp_manager.c (100%)
 rename {health => profiles/health}/hdp_manager.h (100%)
 rename {health => profiles/health}/hdp_types.h (100%)
 rename {health => profiles/health}/hdp_util.c (100%)
 rename {health => profiles/health}/hdp_util.h (100%)
 rename {health => profiles/health}/mcap.c (100%)
 rename {health => profiles/health}/mcap.h (100%)
 rename {health => profiles/health}/mcap_internal.h (100%)
 rename {health => profiles/health}/mcap_lib.h (100%)
 rename {health => profiles/health}/mcap_sync.c (100%)

diff --git a/Makefile.am b/Makefile.am
index bd36248..d6e93dd 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -127,9 +127,9 @@ builtin_nodist =
 mcap_sources =
 
 if MCAP
-mcap_sources += health/mcap_lib.h health/mcap_internal.h \
-		health/mcap.h health/mcap.c \
-		health/mcap_sync.c
+mcap_sources += profiles/health/mcap_lib.h profiles/health/mcap_internal.h \
+		ptofiles/health/mcap.h profiles/health/mcap.c \
+		profiles/health/mcap_sync.c
 endif
 
 if PNATPLUGIN
@@ -207,10 +207,10 @@ endif
 
 if HEALTHPLUGIN
 builtin_modules += health
-builtin_sources += health/hdp_main.c health/hdp_types.h \
-			health/hdp_manager.h health/hdp_manager.c \
-			health/hdp.h health/hdp.c \
-			health/hdp_util.h health/hdp_util.c
+builtin_sources += profiles/health/hdp_main.c profiles/health/hdp_types.h \
+		profiles/health/hdp_manager.h profiles/health/hdp_manager.c \
+		profiles/health/hdp.h profiles/health/hdp.c \
+		profiles/health/hdp_util.h profiles/health/hdp_util.c
 endif
 
 if GATTMODULES
diff --git a/health/hdp.c b/profiles/health/hdp.c
similarity index 100%
rename from health/hdp.c
rename to profiles/health/hdp.c
diff --git a/health/hdp.h b/profiles/health/hdp.h
similarity index 100%
rename from health/hdp.h
rename to profiles/health/hdp.h
diff --git a/health/hdp_main.c b/profiles/health/hdp_main.c
similarity index 100%
rename from health/hdp_main.c
rename to profiles/health/hdp_main.c
diff --git a/health/hdp_manager.c b/profiles/health/hdp_manager.c
similarity index 100%
rename from health/hdp_manager.c
rename to profiles/health/hdp_manager.c
diff --git a/health/hdp_manager.h b/profiles/health/hdp_manager.h
similarity index 100%
rename from health/hdp_manager.h
rename to profiles/health/hdp_manager.h
diff --git a/health/hdp_types.h b/profiles/health/hdp_types.h
similarity index 100%
rename from health/hdp_types.h
rename to profiles/health/hdp_types.h
diff --git a/health/hdp_util.c b/profiles/health/hdp_util.c
similarity index 100%
rename from health/hdp_util.c
rename to profiles/health/hdp_util.c
diff --git a/health/hdp_util.h b/profiles/health/hdp_util.h
similarity index 100%
rename from health/hdp_util.h
rename to profiles/health/hdp_util.h
diff --git a/health/mcap.c b/profiles/health/mcap.c
similarity index 100%
rename from health/mcap.c
rename to profiles/health/mcap.c
diff --git a/health/mcap.h b/profiles/health/mcap.h
similarity index 100%
rename from health/mcap.h
rename to profiles/health/mcap.h
diff --git a/health/mcap_internal.h b/profiles/health/mcap_internal.h
similarity index 100%
rename from health/mcap_internal.h
rename to profiles/health/mcap_internal.h
diff --git a/health/mcap_lib.h b/profiles/health/mcap_lib.h
similarity index 100%
rename from health/mcap_lib.h
rename to profiles/health/mcap_lib.h
diff --git a/health/mcap_sync.c b/profiles/health/mcap_sync.c
similarity index 100%
rename from health/mcap_sync.c
rename to profiles/health/mcap_sync.c
-- 
1.7.10.2


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

* [PATCH -v3 3/9] input: move it to profiles folder
  2012-07-10 14:03 [PATCH -v3 1/9] serial: remove the whole serial code Gustavo Padovan
  2012-07-10 14:03 ` [PATCH -v3 2/9] health: move it to profiles Gustavo Padovan
@ 2012-07-10 14:03 ` Gustavo Padovan
  2012-07-10 14:03 ` [PATCH -v3 4/9] network: " Gustavo Padovan
                   ` (6 subsequent siblings)
  8 siblings, 0 replies; 11+ messages in thread
From: Gustavo Padovan @ 2012-07-10 14:03 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Gustavo Padovan

From: Gustavo Padovan <gustavo.padovan@collabora.co.uk>

---
 Makefile.am                            |   14 +++++++-------
 {input => profiles/input}/device.c     |    0
 {input => profiles/input}/device.h     |    0
 {input => profiles/input}/fakehid.c    |    0
 {input => profiles/input}/fakehid.h    |    0
 {input => profiles/input}/hog_device.c |    0
 {input => profiles/input}/hog_device.h |    0
 {input => profiles/input}/input.conf   |    0
 {input => profiles/input}/main.c       |    0
 {input => profiles/input}/manager.c    |    0
 {input => profiles/input}/manager.h    |    0
 {input => profiles/input}/server.c     |    0
 {input => profiles/input}/server.h     |    0
 {input => profiles/input}/sixpair.c    |    0
 14 files changed, 7 insertions(+), 7 deletions(-)
 rename {input => profiles/input}/device.c (100%)
 rename {input => profiles/input}/device.h (100%)
 rename {input => profiles/input}/fakehid.c (100%)
 rename {input => profiles/input}/fakehid.h (100%)
 rename {input => profiles/input}/hog_device.c (100%)
 rename {input => profiles/input}/hog_device.h (100%)
 rename {input => profiles/input}/input.conf (100%)
 rename {input => profiles/input}/main.c (100%)
 rename {input => profiles/input}/manager.c (100%)
 rename {input => profiles/input}/manager.h (100%)
 rename {input => profiles/input}/server.c (100%)
 rename {input => profiles/input}/server.h (100%)
 rename {input => profiles/input}/sixpair.c (100%)

diff --git a/Makefile.am b/Makefile.am
index d6e93dd..a696173 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -179,16 +179,16 @@ endif
 
 if INPUTPLUGIN
 builtin_modules += input
-builtin_sources += input/main.c \
-			input/manager.h input/manager.c \
-			input/server.h input/server.c \
-			input/device.h input/device.c \
-			input/fakehid.c input/fakehid.h
+builtin_sources += profiles/input/main.c \
+			profiles/input/manager.h profiles/input/manager.c \
+			profiles/input/server.h profiles/input/server.c \
+			profiles/input/device.h profiles/input/device.c \
+			profiles/input/fakehid.c profiles/input/fakehid.h
 endif
 
 if HOGPLUGIN
 builtin_modules += hog
-builtin_sources += input/hog_device.h input/hog_device.c
+builtin_sources += profiles/input/hog_device.h profiles/input/hog_device.c
 endif
 
 if NETWORKPLUGIN
@@ -327,7 +327,7 @@ endif
 
 EXTRA_DIST += src/genbuiltin src/bluetooth.conf src/org.bluez.service \
 			src/main.conf network/network.conf \
-			input/input.conf proximity/proximity.conf \
+			profiles/input/input.conf proximity/proximity.conf \ \
 			audio/audio.conf audio/telephony-dummy.c \
 			audio/telephony-maemo5.c audio/telephony-ofono.c \
 			audio/telephony-maemo6.c sap/sap-dummy.c sap/sap-u8500.c
diff --git a/input/device.c b/profiles/input/device.c
similarity index 100%
rename from input/device.c
rename to profiles/input/device.c
diff --git a/input/device.h b/profiles/input/device.h
similarity index 100%
rename from input/device.h
rename to profiles/input/device.h
diff --git a/input/fakehid.c b/profiles/input/fakehid.c
similarity index 100%
rename from input/fakehid.c
rename to profiles/input/fakehid.c
diff --git a/input/fakehid.h b/profiles/input/fakehid.h
similarity index 100%
rename from input/fakehid.h
rename to profiles/input/fakehid.h
diff --git a/input/hog_device.c b/profiles/input/hog_device.c
similarity index 100%
rename from input/hog_device.c
rename to profiles/input/hog_device.c
diff --git a/input/hog_device.h b/profiles/input/hog_device.h
similarity index 100%
rename from input/hog_device.h
rename to profiles/input/hog_device.h
diff --git a/input/input.conf b/profiles/input/input.conf
similarity index 100%
rename from input/input.conf
rename to profiles/input/input.conf
diff --git a/input/main.c b/profiles/input/main.c
similarity index 100%
rename from input/main.c
rename to profiles/input/main.c
diff --git a/input/manager.c b/profiles/input/manager.c
similarity index 100%
rename from input/manager.c
rename to profiles/input/manager.c
diff --git a/input/manager.h b/profiles/input/manager.h
similarity index 100%
rename from input/manager.h
rename to profiles/input/manager.h
diff --git a/input/server.c b/profiles/input/server.c
similarity index 100%
rename from input/server.c
rename to profiles/input/server.c
diff --git a/input/server.h b/profiles/input/server.h
similarity index 100%
rename from input/server.h
rename to profiles/input/server.h
diff --git a/input/sixpair.c b/profiles/input/sixpair.c
similarity index 100%
rename from input/sixpair.c
rename to profiles/input/sixpair.c
-- 
1.7.10.2


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

* [PATCH -v3 4/9] network: move it to profiles folder
  2012-07-10 14:03 [PATCH -v3 1/9] serial: remove the whole serial code Gustavo Padovan
  2012-07-10 14:03 ` [PATCH -v3 2/9] health: move it to profiles Gustavo Padovan
  2012-07-10 14:03 ` [PATCH -v3 3/9] input: move it to profiles folder Gustavo Padovan
@ 2012-07-10 14:03 ` Gustavo Padovan
  2012-07-10 14:03 ` [PATCH -v3 5/9] time: move to the " Gustavo Padovan
                   ` (5 subsequent siblings)
  8 siblings, 0 replies; 11+ messages in thread
From: Gustavo Padovan @ 2012-07-10 14:03 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Gustavo Padovan

From: Gustavo Padovan <gustavo.padovan@collabora.co.uk>

---
 Makefile.am                                |   13 +++++++------
 {network => profiles/network}/common.c     |    0
 {network => profiles/network}/common.h     |    0
 {network => profiles/network}/connection.c |    0
 {network => profiles/network}/connection.h |    0
 {network => profiles/network}/main.c       |    0
 {network => profiles/network}/manager.c    |    0
 {network => profiles/network}/manager.h    |    0
 {network => profiles/network}/network.conf |    0
 {network => profiles/network}/server.c     |    0
 {network => profiles/network}/server.h     |    0
 11 files changed, 7 insertions(+), 6 deletions(-)
 rename {network => profiles/network}/common.c (100%)
 rename {network => profiles/network}/common.h (100%)
 rename {network => profiles/network}/connection.c (100%)
 rename {network => profiles/network}/connection.h (100%)
 rename {network => profiles/network}/main.c (100%)
 rename {network => profiles/network}/manager.c (100%)
 rename {network => profiles/network}/manager.h (100%)
 rename {network => profiles/network}/network.conf (100%)
 rename {network => profiles/network}/server.c (100%)
 rename {network => profiles/network}/server.h (100%)

diff --git a/Makefile.am b/Makefile.am
index a696173..9f0d343 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -193,11 +193,12 @@ endif
 
 if NETWORKPLUGIN
 builtin_modules += network
-builtin_sources += network/main.c \
-			network/manager.h network/manager.c \
-			network/common.h network/common.c \
-			network/server.h network/server.c \
-			network/connection.h network/connection.c
+builtin_sources += profiles/network/main.c \
+			profiles/network/manager.h profiles/network/manager.c \
+			profiles/network/common.h profiles/network/common.c \
+			profiles/network/server.h profiles/network/server.c \
+			profiles/network/connection.h \
+			profiles/network/connection.c
 endif
 
 if SERVICEPLUGIN
@@ -326,7 +327,7 @@ conf_DATA += src/main.conf
 endif
 
 EXTRA_DIST += src/genbuiltin src/bluetooth.conf src/org.bluez.service \
-			src/main.conf network/network.conf \
+			src/main.conf profiles/network/network.conf \
 			profiles/input/input.conf proximity/proximity.conf \ \
 			audio/audio.conf audio/telephony-dummy.c \
 			audio/telephony-maemo5.c audio/telephony-ofono.c \
diff --git a/network/common.c b/profiles/network/common.c
similarity index 100%
rename from network/common.c
rename to profiles/network/common.c
diff --git a/network/common.h b/profiles/network/common.h
similarity index 100%
rename from network/common.h
rename to profiles/network/common.h
diff --git a/network/connection.c b/profiles/network/connection.c
similarity index 100%
rename from network/connection.c
rename to profiles/network/connection.c
diff --git a/network/connection.h b/profiles/network/connection.h
similarity index 100%
rename from network/connection.h
rename to profiles/network/connection.h
diff --git a/network/main.c b/profiles/network/main.c
similarity index 100%
rename from network/main.c
rename to profiles/network/main.c
diff --git a/network/manager.c b/profiles/network/manager.c
similarity index 100%
rename from network/manager.c
rename to profiles/network/manager.c
diff --git a/network/manager.h b/profiles/network/manager.h
similarity index 100%
rename from network/manager.h
rename to profiles/network/manager.h
diff --git a/network/network.conf b/profiles/network/network.conf
similarity index 100%
rename from network/network.conf
rename to profiles/network/network.conf
diff --git a/network/server.c b/profiles/network/server.c
similarity index 100%
rename from network/server.c
rename to profiles/network/server.c
diff --git a/network/server.h b/profiles/network/server.h
similarity index 100%
rename from network/server.h
rename to profiles/network/server.h
-- 
1.7.10.2


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

* [PATCH -v3 5/9] time: move to the profiles folder
  2012-07-10 14:03 [PATCH -v3 1/9] serial: remove the whole serial code Gustavo Padovan
                   ` (2 preceding siblings ...)
  2012-07-10 14:03 ` [PATCH -v3 4/9] network: " Gustavo Padovan
@ 2012-07-10 14:03 ` Gustavo Padovan
  2012-07-10 14:03 ` [PATCH -v3 6/9] proximity: " Gustavo Padovan
                   ` (4 subsequent siblings)
  8 siblings, 0 replies; 11+ messages in thread
From: Gustavo Padovan @ 2012-07-10 14:03 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Gustavo Padovan

From: Gustavo Padovan <gustavo.padovan@collabora.co.uk>

---
 Makefile.am                       |    5 +++--
 {time => profiles/time}/main.c    |    0
 {time => profiles/time}/manager.c |    0
 {time => profiles/time}/manager.h |    0
 {time => profiles/time}/server.c  |    0
 {time => profiles/time}/server.h  |    0
 6 files changed, 3 insertions(+), 2 deletions(-)
 rename {time => profiles/time}/main.c (100%)
 rename {time => profiles/time}/manager.c (100%)
 rename {time => profiles/time}/manager.h (100%)
 rename {time => profiles/time}/server.c (100%)
 rename {time => profiles/time}/server.h (100%)

diff --git a/Makefile.am b/Makefile.am
index 9f0d343..037ded5 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -223,8 +223,9 @@ builtin_sources += profiles/thermometer/main.c \
 			profiles/thermometer/thermometer.c \
 			profiles/alert/main.c profiles/alert/server.h \
 			profiles/alert/server.c \
-			time/main.c time/server.h time/server.c \
-			time/manager.h time/manager.c \
+			profiles/time/main.c profiles/time/server.h \
+			profiles/time/server.c profiles/time/manager.c \
+			profiles/time/manager.h \
 			plugins/gatt-example.c \
 			proximity/main.c proximity/manager.h proximity/manager.c \
 			proximity/monitor.h proximity/monitor.c \
diff --git a/time/main.c b/profiles/time/main.c
similarity index 100%
rename from time/main.c
rename to profiles/time/main.c
diff --git a/time/manager.c b/profiles/time/manager.c
similarity index 100%
rename from time/manager.c
rename to profiles/time/manager.c
diff --git a/time/manager.h b/profiles/time/manager.h
similarity index 100%
rename from time/manager.h
rename to profiles/time/manager.h
diff --git a/time/server.c b/profiles/time/server.c
similarity index 100%
rename from time/server.c
rename to profiles/time/server.c
diff --git a/time/server.h b/profiles/time/server.h
similarity index 100%
rename from time/server.h
rename to profiles/time/server.h
-- 
1.7.10.2


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

* [PATCH -v3 6/9] proximity: move to the profiles folder
  2012-07-10 14:03 [PATCH -v3 1/9] serial: remove the whole serial code Gustavo Padovan
                   ` (3 preceding siblings ...)
  2012-07-10 14:03 ` [PATCH -v3 5/9] time: move to the " Gustavo Padovan
@ 2012-07-10 14:03 ` Gustavo Padovan
  2012-07-10 14:03 ` [PATCH -v3 7/9] sap: move it to " Gustavo Padovan
                   ` (3 subsequent siblings)
  8 siblings, 0 replies; 11+ messages in thread
From: Gustavo Padovan @ 2012-07-10 14:03 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Gustavo Padovan

From: Gustavo Padovan <gustavo.padovan@collabora.co.uk>

---
 Makefile.am                                      |   15 ++++++++++-----
 {proximity => profiles/proximity}/immalert.c     |    0
 {proximity => profiles/proximity}/immalert.h     |    0
 {proximity => profiles/proximity}/linkloss.c     |    0
 {proximity => profiles/proximity}/linkloss.h     |    0
 {proximity => profiles/proximity}/main.c         |    0
 {proximity => profiles/proximity}/manager.c      |    0
 {proximity => profiles/proximity}/manager.h      |    0
 {proximity => profiles/proximity}/monitor.c      |    0
 {proximity => profiles/proximity}/monitor.h      |    0
 {proximity => profiles/proximity}/proximity.conf |    0
 {proximity => profiles/proximity}/reporter.c     |    0
 {proximity => profiles/proximity}/reporter.h     |    0
 13 files changed, 10 insertions(+), 5 deletions(-)
 rename {proximity => profiles/proximity}/immalert.c (100%)
 rename {proximity => profiles/proximity}/immalert.h (100%)
 rename {proximity => profiles/proximity}/linkloss.c (100%)
 rename {proximity => profiles/proximity}/linkloss.h (100%)
 rename {proximity => profiles/proximity}/main.c (100%)
 rename {proximity => profiles/proximity}/manager.c (100%)
 rename {proximity => profiles/proximity}/manager.h (100%)
 rename {proximity => profiles/proximity}/monitor.c (100%)
 rename {proximity => profiles/proximity}/monitor.h (100%)
 rename {proximity => profiles/proximity}/proximity.conf (100%)
 rename {proximity => profiles/proximity}/reporter.c (100%)
 rename {proximity => profiles/proximity}/reporter.h (100%)

diff --git a/Makefile.am b/Makefile.am
index 037ded5..87208cc 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -227,11 +227,16 @@ builtin_sources += profiles/thermometer/main.c \
 			profiles/time/server.c profiles/time/manager.c \
 			profiles/time/manager.h \
 			plugins/gatt-example.c \
-			proximity/main.c proximity/manager.h proximity/manager.c \
-			proximity/monitor.h proximity/monitor.c \
-			proximity/reporter.h proximity/reporter.c \
-			proximity/linkloss.h proximity/linkloss.c \
-			proximity/immalert.h proximity/immalert.c \
+			profiles/proximity/main.c profiles/proximity/manager.h \
+		       	profiles/proximity/manager.c \
+			profiles/proximity/monitor.h \
+			profiles/proximity/monitor.c \
+			profiles/proximity/reporter.h \
+			profiles/proximity/reporter.c \
+			profiles/proximity/linkloss.h \
+			profiles/proximity/linkloss.c \
+			profiles/proximity/immalert.h \
+			profiles/proximity/immalert.c \
 			profiles/deviceinfo/main.c \
 			profiles/deviceinfo/manager.h \
 			profiles/deviceinfo/manager.c \
diff --git a/proximity/immalert.c b/profiles/proximity/immalert.c
similarity index 100%
rename from proximity/immalert.c
rename to profiles/proximity/immalert.c
diff --git a/proximity/immalert.h b/profiles/proximity/immalert.h
similarity index 100%
rename from proximity/immalert.h
rename to profiles/proximity/immalert.h
diff --git a/proximity/linkloss.c b/profiles/proximity/linkloss.c
similarity index 100%
rename from proximity/linkloss.c
rename to profiles/proximity/linkloss.c
diff --git a/proximity/linkloss.h b/profiles/proximity/linkloss.h
similarity index 100%
rename from proximity/linkloss.h
rename to profiles/proximity/linkloss.h
diff --git a/proximity/main.c b/profiles/proximity/main.c
similarity index 100%
rename from proximity/main.c
rename to profiles/proximity/main.c
diff --git a/proximity/manager.c b/profiles/proximity/manager.c
similarity index 100%
rename from proximity/manager.c
rename to profiles/proximity/manager.c
diff --git a/proximity/manager.h b/profiles/proximity/manager.h
similarity index 100%
rename from proximity/manager.h
rename to profiles/proximity/manager.h
diff --git a/proximity/monitor.c b/profiles/proximity/monitor.c
similarity index 100%
rename from proximity/monitor.c
rename to profiles/proximity/monitor.c
diff --git a/proximity/monitor.h b/profiles/proximity/monitor.h
similarity index 100%
rename from proximity/monitor.h
rename to profiles/proximity/monitor.h
diff --git a/proximity/proximity.conf b/profiles/proximity/proximity.conf
similarity index 100%
rename from proximity/proximity.conf
rename to profiles/proximity/proximity.conf
diff --git a/proximity/reporter.c b/profiles/proximity/reporter.c
similarity index 100%
rename from proximity/reporter.c
rename to profiles/proximity/reporter.c
diff --git a/proximity/reporter.h b/profiles/proximity/reporter.h
similarity index 100%
rename from proximity/reporter.h
rename to profiles/proximity/reporter.h
-- 
1.7.10.2


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

* [PATCH -v3 7/9] sap: move it to profiles folder
  2012-07-10 14:03 [PATCH -v3 1/9] serial: remove the whole serial code Gustavo Padovan
                   ` (4 preceding siblings ...)
  2012-07-10 14:03 ` [PATCH -v3 6/9] proximity: " Gustavo Padovan
@ 2012-07-10 14:03 ` Gustavo Padovan
  2012-07-10 14:03 ` [PATCH -v3 8/9] plugins: remove unmaintained plugins Gustavo Padovan
                   ` (2 subsequent siblings)
  8 siblings, 0 replies; 11+ messages in thread
From: Gustavo Padovan @ 2012-07-10 14:03 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Gustavo Padovan

From: Gustavo Padovan <gustavo.padovan@collabora.co.uk>

---
 Makefile.am                       |   19 ++++++++++---------
 {sap => profiles/sap}/main.c      |    0
 {sap => profiles/sap}/manager.c   |    0
 {sap => profiles/sap}/manager.h   |    0
 {sap => profiles/sap}/sap-dummy.c |    0
 {sap => profiles/sap}/sap-u8500.c |    0
 {sap => profiles/sap}/sap.h       |    0
 {sap => profiles/sap}/server.c    |    0
 {sap => profiles/sap}/server.h    |    0
 9 files changed, 10 insertions(+), 9 deletions(-)
 rename {sap => profiles/sap}/main.c (100%)
 rename {sap => profiles/sap}/manager.c (100%)
 rename {sap => profiles/sap}/manager.h (100%)
 rename {sap => profiles/sap}/sap-dummy.c (100%)
 rename {sap => profiles/sap}/sap-u8500.c (100%)
 rename {sap => profiles/sap}/sap.h (100%)
 rename {sap => profiles/sap}/server.c (100%)
 rename {sap => profiles/sap}/server.h (100%)

diff --git a/Makefile.am b/Makefile.am
index 87208cc..b445160 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -165,16 +165,16 @@ endif
 
 if SAPPLUGIN
 builtin_modules += sap
-builtin_sources += sap/main.c \
-			sap/manager.h sap/manager.c \
-			sap/server.h sap/server.c \
-			sap/sap.h
+builtin_sources += profiles/sap/main.c profiles/sap/manager.h \
+			profiles/sap/manager.c profiles/sap/server.h \
+			profiles/sap/server.c profiles/sap/sap.h
 
-builtin_nodist += sap/sap.c
+builtin_nodist += profiles/sap/sap.c
 
-noinst_LIBRARIES += sap/libsap.a
+noinst_LIBRARIES += profiles/sap/libsap.a
 
-sap_libsap_a_SOURCES = sap/sap.h sap/sap-dummy.c sap/sap-u8500.c
+profiles_sap_libsap_a_SOURCES = profiles_sap/sap.h profiles/sap/sap-dummy.c \
+				profiles/sap/sap-u8500.c
 endif
 
 if INPUTPLUGIN
@@ -337,7 +337,8 @@ EXTRA_DIST += src/genbuiltin src/bluetooth.conf src/org.bluez.service \
 			profiles/input/input.conf proximity/proximity.conf \ \
 			audio/audio.conf audio/telephony-dummy.c \
 			audio/telephony-maemo5.c audio/telephony-ofono.c \
-			audio/telephony-maemo6.c sap/sap-dummy.c sap/sap-u8500.c
+			audio/telephony-maemo6.c profiles/sap/sap-dummy.c \
+			profiles/sap/sap-u8500.c
 
 if AUDIOPLUGIN
 if GSTREAMER
@@ -443,7 +444,7 @@ src/builtin.h: src/genbuiltin $(builtin_sources)
 audio/telephony.c: audio/@TELEPHONY_DRIVER@
 	$(AM_V_GEN)$(LN_S) $(abs_top_builddir)/$< $@
 
-sap/sap.c: sap/@SAP_DRIVER@
+profiles/sap/sap.c: profiles/sap/@SAP_DRIVER@
 	$(AM_V_GEN)$(LN_S) $(abs_top_srcdir)/$< $@
 
 scripts/%.rules:
diff --git a/sap/main.c b/profiles/sap/main.c
similarity index 100%
rename from sap/main.c
rename to profiles/sap/main.c
diff --git a/sap/manager.c b/profiles/sap/manager.c
similarity index 100%
rename from sap/manager.c
rename to profiles/sap/manager.c
diff --git a/sap/manager.h b/profiles/sap/manager.h
similarity index 100%
rename from sap/manager.h
rename to profiles/sap/manager.h
diff --git a/sap/sap-dummy.c b/profiles/sap/sap-dummy.c
similarity index 100%
rename from sap/sap-dummy.c
rename to profiles/sap/sap-dummy.c
diff --git a/sap/sap-u8500.c b/profiles/sap/sap-u8500.c
similarity index 100%
rename from sap/sap-u8500.c
rename to profiles/sap/sap-u8500.c
diff --git a/sap/sap.h b/profiles/sap/sap.h
similarity index 100%
rename from sap/sap.h
rename to profiles/sap/sap.h
diff --git a/sap/server.c b/profiles/sap/server.c
similarity index 100%
rename from sap/server.c
rename to profiles/sap/server.c
diff --git a/sap/server.h b/profiles/sap/server.h
similarity index 100%
rename from sap/server.h
rename to profiles/sap/server.h
-- 
1.7.10.2


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

* [PATCH -v3 8/9] plugins: remove unmaintained plugins
  2012-07-10 14:03 [PATCH -v3 1/9] serial: remove the whole serial code Gustavo Padovan
                   ` (5 preceding siblings ...)
  2012-07-10 14:03 ` [PATCH -v3 7/9] sap: move it to " Gustavo Padovan
@ 2012-07-10 14:03 ` Gustavo Padovan
  2012-07-10 14:03 ` [PATCH -v3 9/9] btmgmt: move it to tools Gustavo Padovan
  2012-07-10 14:22 ` [PATCH -v3 1/9] serial: remove the whole serial code Johan Hedberg
  8 siblings, 0 replies; 11+ messages in thread
From: Gustavo Padovan @ 2012-07-10 14:03 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Gustavo Padovan

From: Gustavo Padovan <gustavo.padovan@collabora.co.uk>

---
 Makefile.am         |   15 --
 acinclude.m4        |   18 --
 bootstrap-configure |    2 -
 plugins/hal.c       |  144 --------------
 plugins/maemo6.c    |  283 ---------------------------
 plugins/pnat.c      |  526 ---------------------------------------------------
 6 files changed, 988 deletions(-)
 delete mode 100644 plugins/hal.c
 delete mode 100644 plugins/maemo6.c
 delete mode 100644 plugins/pnat.c

diff --git a/Makefile.am b/Makefile.am
index b445160..d093a7f 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -132,11 +132,6 @@ mcap_sources += profiles/health/mcap_lib.h profiles/health/mcap_internal.h \
 		profiles/health/mcap_sync.c
 endif
 
-if PNATPLUGIN
-builtin_modules += pnat
-builtin_sources += plugins/pnat.c
-endif
-
 if AUDIOPLUGIN
 builtin_modules += audio
 builtin_sources += audio/main.c \
@@ -244,13 +239,8 @@ builtin_sources += profiles/thermometer/main.c \
 			profiles/deviceinfo/deviceinfo.c
 endif
 
-if HAL
-builtin_modules += hal
-builtin_sources += plugins/hal.c
-else
 builtin_modules += formfactor
 builtin_sources += plugins/formfactor.c
-endif
 
 EXTRA_DIST += plugins/hal.c plugins/formfactor.c
 
@@ -265,11 +255,6 @@ builtin_modules += wiimote
 builtin_sources += plugins/wiimote.c
 endif
 
-if MAEMO6PLUGIN
-builtin_modules += maemo6
-builtin_sources += plugins/maemo6.c
-endif
-
 if DBUSOOBPLUGIN
 builtin_modules += dbusoob
 builtin_sources += plugins/dbusoob.c
diff --git a/acinclude.m4 b/acinclude.m4
index 842eea3..39b0a18 100644
--- a/acinclude.m4
+++ b/acinclude.m4
@@ -167,7 +167,6 @@ AC_DEFUN([AC_ARG_BLUEZ], [
 	fortify_enable=yes
 	pie_enable=yes
 	sndfile_enable=${sndfile_found}
-	hal_enable=no
 	usb_enable=${usb_found}
 	gstreamer_enable=${gstreamer_found}
 	audio_enable=yes
@@ -176,7 +175,6 @@ AC_DEFUN([AC_ARG_BLUEZ], [
 	sap_enable=no
 	service_enable=yes
 	health_enable=no
-	pnat_enable=no
 	tools_enable=yes
 	cups_enable=no
 	test_enable=no
@@ -186,7 +184,6 @@ AC_DEFUN([AC_ARG_BLUEZ], [
 	dfutool_enable=no
 	datafiles_enable=yes
 	telephony_driver=dummy
-	maemo6_enable=no
 	sap_driver=dummy
 	dbusoob_enable=no
 	wiimote_enable=no
@@ -233,10 +230,6 @@ AC_DEFUN([AC_ARG_BLUEZ], [
 		health_enable=${enableval}
 	])
 
-	AC_ARG_ENABLE(pnat, AC_HELP_STRING([--enable-pnat], [enable pnat plugin]), [
-		pnat_enable=${enableval}
-	])
-
 	AC_ARG_ENABLE(gstreamer, AC_HELP_STRING([--enable-gstreamer], [enable GStreamer support]), [
 		gstreamer_enable=${enableval}
 	])
@@ -287,10 +280,6 @@ AC_DEFUN([AC_ARG_BLUEZ], [
 
 	AC_SUBST([TELEPHONY_DRIVER], [telephony-${telephony_driver}.c])
 
-	AC_ARG_ENABLE(maemo6, AC_HELP_STRING([--enable-maemo6], [compile with maemo6 plugin]), [
-		maemo6_enable=${enableval}
-	])
-
 	AC_ARG_ENABLE(dbusoob, AC_HELP_STRING([--enable-dbusoob], [compile with D-Bus OOB plugin]), [
 		dbusoob_enable=${enableval}
 	])
@@ -299,10 +288,6 @@ AC_DEFUN([AC_ARG_BLUEZ], [
 		wiimote_enable=${enableval}
 	])
 
-	AC_ARG_ENABLE(hal, AC_HELP_STRING([--enable-hal], [Use HAL to determine adapter class]), [
-		hal_enable=${enableval}
-	])
-
 	AC_ARG_ENABLE(gatt, AC_HELP_STRING([--enable-gatt], [enable gatt module]), [
 		gatt_enable=${enableval}
 	])
@@ -345,9 +330,7 @@ AC_DEFUN([AC_ARG_BLUEZ], [
 	AM_CONDITIONAL(SERVICEPLUGIN, test "${service_enable}" = "yes")
 	AM_CONDITIONAL(HEALTHPLUGIN, test "${health_enable}" = "yes")
 	AM_CONDITIONAL(MCAP, test "${health_enable}" = "yes")
-	AM_CONDITIONAL(HAL, test "${hal_enable}" = "yes")
 	AM_CONDITIONAL(READLINE, test "${readline_found}" = "yes")
-	AM_CONDITIONAL(PNATPLUGIN, test "${pnat_enable}" = "yes")
 	AM_CONDITIONAL(CUPS, test "${cups_enable}" = "yes")
 	AM_CONDITIONAL(TEST, test "${test_enable}" = "yes" && test "${check_found}" = "yes")
 	AM_CONDITIONAL(TOOLS, test "${tools_enable}" = "yes")
@@ -356,7 +339,6 @@ AC_DEFUN([AC_ARG_BLUEZ], [
 	AM_CONDITIONAL(HID2HCI, test "${hid2hci_enable}" = "yes" && test "${usb_found}" = "yes" && test "${udev_found}" = "yes")
 	AM_CONDITIONAL(DFUTOOL, test "${dfutool_enable}" = "yes" && test "${usb_found}" = "yes")
 	AM_CONDITIONAL(DATAFILES, test "${datafiles_enable}" = "yes")
-	AM_CONDITIONAL(MAEMO6PLUGIN, test "${maemo6_enable}" = "yes")
 	AM_CONDITIONAL(DBUSOOBPLUGIN, test "${dbusoob_enable}" = "yes")
 	AM_CONDITIONAL(WIIMOTEPLUGIN, test "${wiimote_enable}" = "yes")
 	AM_CONDITIONAL(GATTMODULES, test "${gatt_enable}" = "yes")
diff --git a/bootstrap-configure b/bootstrap-configure
index ff63c58..7177c65 100755
--- a/bootstrap-configure
+++ b/bootstrap-configure
@@ -24,8 +24,6 @@ fi
 		--enable-test \
 		--enable-cups \
 		--enable-dbusoob \
-		--enable-maemo6 \
-		--enable-pnat \
 		--enable-sap \
 		--enable-wiimote \
 		--disable-pcmcia \
diff --git a/plugins/hal.c b/plugins/hal.c
deleted file mode 100644
index 21d7688..0000000
--- a/plugins/hal.c
+++ /dev/null
@@ -1,144 +0,0 @@
-/*
- *
- *  BlueZ - Bluetooth protocol stack for Linux
- *
- *  Copyright (C) 2004-2010  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 <errno.h>
-#include <dbus/dbus.h>
-
-#include <bluetooth/bluetooth.h>
-
-#include "plugin.h"
-#include "adapter.h"
-#include "log.h"
-
-static void formfactor_reply(DBusPendingCall *call, void *user_data)
-{
-	struct btd_adapter *adapter = user_data;
-	const char *formfactor = NULL;
-	DBusMessage *reply;
-	uint8_t minor = 0;
-
-	reply = dbus_pending_call_steal_reply(call);
-
-	if (dbus_set_error_from_message(NULL, reply) == TRUE) {
-		error("Failed to access HAL");
-		dbus_message_unref(reply);
-		return;
-	}
-
-	if (dbus_message_get_args(reply, NULL, DBUS_TYPE_STRING, &formfactor,
-						DBUS_TYPE_INVALID) == FALSE) {
-		error("Wrong formfactor arguments");
-		dbus_message_unref(reply);
-		return;
-	}
-
-	DBG("Computer is classified as %s", formfactor);
-
-	if (formfactor != NULL) {
-		if (g_str_equal(formfactor, "laptop") == TRUE)
-			minor |= (1 << 2) | (1 << 3);
-		else if (g_str_equal(formfactor, "desktop") == TRUE)
-			minor |= 1 << 2;
-		else if (g_str_equal(formfactor, "server") == TRUE)
-			minor |= 1 << 3;
-		else if (g_str_equal(formfactor, "handheld") == TRUE)
-			minor += 1 << 4;
-	}
-
-	dbus_message_unref(reply);
-
-	/* Computer major class */
-	DBG("Setting 0x%06x for major/minor device class", (1 << 8) | minor);
-
-	btd_adapter_set_class(adapter, 0x01, minor);
-}
-
-static DBusConnection *connection;
-
-static int hal_probe(struct btd_adapter *adapter)
-{
-	const char *property = "system.formfactor";
-	DBusMessage *message;
-	DBusPendingCall *call;
-
-	connection = dbus_bus_get(DBUS_BUS_SYSTEM, NULL);
-	if (connection == NULL)
-		return -ENOMEM;
-
-	message = dbus_message_new_method_call("org.freedesktop.Hal",
-				"/org/freedesktop/Hal/devices/computer",
-						"org.freedesktop.Hal.Device",
-							"GetPropertyString");
-	if (message == NULL) {
-		error("Failed to create formfactor request");
-		dbus_connection_unref(connection);
-		return -ENOMEM;
-	}
-
-	dbus_message_append_args(message, DBUS_TYPE_STRING, &property,
-							DBUS_TYPE_INVALID);
-
-	if (dbus_connection_send_with_reply(connection, message,
-						&call, -1) == FALSE) {
-		error("Failed to send formfactor request");
-		dbus_message_unref(message);
-		dbus_connection_unref(connection);
-		return -EIO;
-	}
-
-	dbus_pending_call_set_notify(call, formfactor_reply, adapter, NULL);
-
-	dbus_pending_call_unref(call);
-
-	dbus_message_unref(message);
-
-	return 0;
-}
-
-static void hal_remove(struct btd_adapter *adapter)
-{
-	dbus_connection_unref(connection);
-}
-
-static struct btd_adapter_driver hal_driver = {
-	.name	= "hal",
-	.probe	= hal_probe,
-	.remove	= hal_remove,
-};
-
-static int hal_init(void)
-{
-	return btd_register_adapter_driver(&hal_driver);
-}
-
-static void hal_exit(void)
-{
-	btd_unregister_adapter_driver(&hal_driver);
-}
-
-BLUETOOTH_PLUGIN_DEFINE(hal, VERSION,
-		BLUETOOTH_PLUGIN_PRIORITY_LOW, hal_init, hal_exit)
diff --git a/plugins/maemo6.c b/plugins/maemo6.c
deleted file mode 100644
index 4819af4..0000000
--- a/plugins/maemo6.c
+++ /dev/null
@@ -1,283 +0,0 @@
-/*
- *
- *  BlueZ - Bluetooth protocol stack for Linux
- *
- *  Copyright (C) 2006-2010  Nokia Corporation
- *  Copyright (C) 2004-2010  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 <glib.h>
-#include <dbus/dbus.h>
-
-#include "adapter.h"
-#include "plugin.h"
-#include "log.h"
-#include "gdbus.h"
-
-/* from mce/mode-names.h */
-#define MCE_RADIO_STATE_BLUETOOTH	(1 << 3)
-
-/* from mce/dbus-names.h */
-#define MCE_SERVICE			"com.nokia.mce"
-#define MCE_REQUEST_IF			"com.nokia.mce.request"
-#define MCE_SIGNAL_IF			"com.nokia.mce.signal"
-#define MCE_REQUEST_PATH		"/com/nokia/mce/request"
-#define MCE_SIGNAL_PATH			"/com/nokia/mce/signal"
-#define MCE_RADIO_STATES_CHANGE_REQ	"req_radio_states_change"
-#define MCE_RADIO_STATES_GET		"get_radio_states"
-#define MCE_RADIO_STATES_SIG		"radio_states_ind"
-#define MCE_TKLOCK_MODE_SIG		"tklock_mode_ind"
-
-static guint watch_id;
-static guint tklock_watch_id;
-static DBusConnection *conn = NULL;
-static gboolean mce_bt_set = FALSE;
-static gboolean mce_bt_on = FALSE;
-
-static gboolean mce_tklock_mode_cb(DBusConnection *connection,
-					DBusMessage *message, void *user_data)
-{
-	struct btd_adapter *adapter = user_data;
-	DBusMessageIter args;
-	const char *sigvalue;
-
-	if (!dbus_message_iter_init(message, &args)) {
-		error("message has no arguments");
-	} else if (dbus_message_iter_get_arg_type(&args) != DBUS_TYPE_STRING) {
-		error("argument is not string");
-	} else {
-
-		dbus_message_iter_get_basic(&args, &sigvalue);
-		DBG("got signal with value %s", sigvalue);
-
-		if (g_strcmp0("unlocked", sigvalue) == 0 && mce_bt_on)
-			btd_adapter_enable_auto_connect(adapter);
-	}
-
-	return TRUE;
-}
-
-static gboolean mce_signal_callback(DBusConnection *connection,
-					DBusMessage *message, void *user_data)
-{
-	DBusMessageIter args;
-	uint32_t sigvalue;
-	struct btd_adapter *adapter = user_data;
-	int err;
-
-	DBG("received mce signal");
-
-	if (!dbus_message_iter_init(message, &args))
-		error("message has no arguments");
-	else if (DBUS_TYPE_UINT32 != dbus_message_iter_get_arg_type(&args))
-		error("argument is not uint32");
-	else {
-		dbus_message_iter_get_basic(&args, &sigvalue);
-		DBG("got signal with value %u", sigvalue);
-
-		/* set the adapter according to the mce signal
-		   and remember the value */
-		mce_bt_on = sigvalue & MCE_RADIO_STATE_BLUETOOTH ? TRUE : FALSE;
-
-		if (mce_bt_on)
-			err = btd_adapter_switch_online(adapter);
-		else
-			err = btd_adapter_switch_offline(adapter);
-
-		if (err == 0)
-			mce_bt_set = TRUE;
-
-	}
-
-	return TRUE;
-}
-
-static void read_radio_states_cb(DBusPendingCall *call, void *user_data)
-{
-	DBusError derr;
-	DBusMessage *reply;
-	dbus_uint32_t radio_states;
-	struct btd_adapter *adapter = user_data;
-	int err;
-
-	reply = dbus_pending_call_steal_reply(call);
-
-	dbus_error_init(&derr);
-	if (dbus_set_error_from_message(&derr, reply)) {
-		error("mce replied with an error: %s, %s",
-				derr.name, derr.message);
-		dbus_error_free(&derr);
-		goto done;
-	}
-
-	if (dbus_message_get_args(reply, &derr,
-				DBUS_TYPE_UINT32, &radio_states,
-				DBUS_TYPE_INVALID) == FALSE) {
-		error("unable to parse get_radio_states reply: %s, %s",
-							derr.name, derr.message);
-		dbus_error_free(&derr);
-		goto done;
-	}
-
-	DBG("radio_states: %d", radio_states);
-
-	mce_bt_on = radio_states & MCE_RADIO_STATE_BLUETOOTH ? TRUE : FALSE;
-
-	if (mce_bt_on)
-		err = btd_adapter_switch_online(adapter);
-	else
-		err = btd_adapter_switch_offline(adapter);
-
-	if (err == 0)
-		mce_bt_set = TRUE;
-
-done:
-	dbus_message_unref(reply);
-}
-
-static void adapter_powered(struct btd_adapter *adapter, gboolean powered)
-{
-	DBusMessage *msg;
-	static gboolean startup = TRUE;
-
-	DBG("adapter_powered called with %d", powered);
-
-	if (startup) {
-		DBusPendingCall *call;
-
-		/* Initialization: sync adapter state and MCE radio state */
-
-		DBG("Startup: reading MCE Bluetooth radio state...");
-		startup = FALSE;
-
-		msg = dbus_message_new_method_call(MCE_SERVICE,
-					MCE_REQUEST_PATH, MCE_REQUEST_IF,
-					MCE_RADIO_STATES_GET);
-
-		if (!dbus_connection_send_with_reply(conn, msg, &call, -1)) {
-			error("calling %s failed", MCE_RADIO_STATES_GET);
-			dbus_message_unref(msg);
-			return;
-		}
-
-		dbus_pending_call_set_notify(call, read_radio_states_cb,
-								adapter, NULL);
-		dbus_pending_call_unref(call);
-		dbus_message_unref(msg);
-		return;
-	}
-
-	/* MCE initiated operation */
-	if (mce_bt_set == TRUE) {
-		mce_bt_set = FALSE;
-		return;
-	}
-
-	/* Non MCE operation: set MCE according to adapter state */
-	if (mce_bt_on != powered) {
-		dbus_uint32_t radio_states;
-		dbus_uint32_t radio_mask = MCE_RADIO_STATE_BLUETOOTH;
-
-		msg = dbus_message_new_method_call(MCE_SERVICE,
-					MCE_REQUEST_PATH, MCE_REQUEST_IF,
-					MCE_RADIO_STATES_CHANGE_REQ);
-
-		radio_states = (powered ? MCE_RADIO_STATE_BLUETOOTH : 0);
-
-		DBG("Changing MCE Bluetooth radio state to: %d", radio_states);
-
-		dbus_message_append_args(msg, DBUS_TYPE_UINT32, &radio_states,
-					DBUS_TYPE_UINT32, &radio_mask,
-					DBUS_TYPE_INVALID);
-
-		if (dbus_connection_send(conn, msg, NULL))
-			mce_bt_on = powered;
-		else
-			error("calling %s failed", MCE_RADIO_STATES_CHANGE_REQ);
-
-		dbus_message_unref(msg);
-	}
-}
-
-static int mce_probe(struct btd_adapter *adapter)
-{
-
-	DBG("path %s", adapter_get_path(adapter));
-
-	watch_id = g_dbus_add_signal_watch(conn, NULL, MCE_SIGNAL_PATH,
-					MCE_SIGNAL_IF, MCE_RADIO_STATES_SIG,
-					mce_signal_callback, adapter, NULL);
-
-	tklock_watch_id = g_dbus_add_signal_watch(conn, NULL, MCE_SIGNAL_PATH,
-					MCE_SIGNAL_IF, MCE_TKLOCK_MODE_SIG,
-					mce_tklock_mode_cb, adapter, NULL);
-
-	btd_adapter_register_powered_callback(adapter, adapter_powered);
-
-	return 0;
-}
-
-static void mce_remove(struct btd_adapter *adapter)
-{
-	DBG("path %s", adapter_get_path(adapter));
-
-	if (watch_id > 0)
-		g_dbus_remove_watch(conn, watch_id);
-
-	if (tklock_watch_id > 0)
-		g_dbus_remove_watch(conn, tklock_watch_id);
-
-	btd_adapter_unregister_powered_callback(adapter, adapter_powered);
-}
-
-static struct btd_adapter_driver mce_driver = {
-	.name	= "mce",
-	.probe	= mce_probe,
-	.remove	= mce_remove,
-};
-
-static int maemo6_init(void)
-{
-	DBG("init maemo6 plugin");
-
-	conn = dbus_bus_get(DBUS_BUS_SYSTEM, NULL);
-	if (conn == NULL) {
-		error("Unable to connect to D-Bus");
-		return -1;
-	}
-
-	return btd_register_adapter_driver(&mce_driver);
-}
-
-static void maemo6_exit(void)
-{
-	DBG("exit maemo6 plugin");
-
-	if (conn != NULL)
-		dbus_connection_unref(conn);
-
-	btd_unregister_adapter_driver(&mce_driver);
-}
-
-BLUETOOTH_PLUGIN_DEFINE(maemo6, VERSION,
-		BLUETOOTH_PLUGIN_PRIORITY_DEFAULT, maemo6_init, maemo6_exit)
diff --git a/plugins/pnat.c b/plugins/pnat.c
deleted file mode 100644
index 3c611a9..0000000
--- a/plugins/pnat.c
+++ /dev/null
@@ -1,526 +0,0 @@
-/*
- *
- *  BlueZ - Bluetooth protocol stack for Linux
- *
- *  Copyright (C) 2010  Nokia Corporation
- *  Copyright (C) 2010  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 <errno.h>
-#include <unistd.h>
-#include <sys/socket.h>
-#include <sys/ioctl.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <sys/wait.h>
-#include <fcntl.h>
-
-#include <bluetooth/bluetooth.h>
-#include <bluetooth/rfcomm.h>
-#include <bluetooth/sdp.h>
-#include <bluetooth/sdp_lib.h>
-#include <bluetooth/uuid.h>
-
-#include <glib.h>
-
-#include <gdbus.h>
-
-#include "plugin.h"
-#include "sdpd.h"
-#include "btio.h"
-#include "adapter.h"
-#include "log.h"
-
-/* FIXME: This location should be build-time configurable */
-#define PNATD "/usr/bin/phonet-at"
-
-#define DUN_CHANNEL 1
-
-#define TTY_TIMEOUT 100
-#define TTY_TRIES 10
-
-struct dun_client {
-	bdaddr_t bda;
-
-	GIOChannel *io;	/* Client socket */
-	guint io_watch;	/* Client IO watch id */
-
-	guint tty_timer;
-	int tty_tries;
-	gboolean tty_open;
-	int tty_id;
-	char tty_name[PATH_MAX];
-
-	GPid pnatd_pid;
-};
-
-struct dun_server {
-	bdaddr_t bda;		/* Local adapter address */
-
-	uint32_t record_handle; /* Local SDP record handle */
-	GIOChannel *server;	/* Server socket */
-
-	int rfcomm_ctl;
-
-	struct dun_client client;
-};
-
-static GSList *servers = NULL;
-
-static void disconnect(struct dun_server *server)
-{
-	struct dun_client *client = &server->client;
-
-	if (!client->io)
-		return;
-
-	if (client->io_watch > 0) {
-		g_source_remove(client->io_watch);
-		client->io_watch = 0;
-	}
-
-	g_io_channel_shutdown(client->io, TRUE, NULL);
-	g_io_channel_unref(client->io);
-	client->io = NULL;
-
-	if (client->pnatd_pid > 0) {
-		kill(client->pnatd_pid, SIGTERM);
-		client->pnatd_pid = 0;
-	}
-
-	if (client->tty_timer > 0) {
-		g_source_remove(client->tty_timer);
-		client->tty_timer = 0;
-	}
-
-	if (client->tty_id >= 0) {
-		struct rfcomm_dev_req req;
-
-		memset(&req, 0, sizeof(req));
-		req.dev_id = client->tty_id;
-		req.flags = (1 << RFCOMM_HANGUP_NOW);
-		ioctl(server->rfcomm_ctl, RFCOMMRELEASEDEV, &req);
-
-		client->tty_name[0] = '\0';
-		client->tty_open = FALSE;
-		client->tty_id = -1;
-	}
-}
-
-static gboolean client_event(GIOChannel *chan,
-					GIOCondition cond, gpointer data)
-{
-	struct dun_server *server = data;
-	struct dun_client *client = &server->client;
-	char addr[18];
-
-	ba2str(&client->bda, addr);
-
-	DBG("Disconnected DUN from %s (%s)", addr, client->tty_name);
-
-	client->io_watch = 0;
-	disconnect(server);
-
-	return FALSE;
-}
-
-static void pnatd_exit(GPid pid, gint status, gpointer user_data)
-{
-	struct dun_server *server = user_data;
-	struct dun_client *client = &server->client;
-
-        if (WIFEXITED(status))
-                DBG("pnatd (%d) exited with status %d", pid,
-							WEXITSTATUS(status));
-        else
-                DBG("pnatd (%d) was killed by signal %d", pid,
-							WTERMSIG(status));
-	g_spawn_close_pid(pid);
-
-	if (pid != client->pnatd_pid)
-		return;
-
-	/* So disconnect() doesn't send SIGTERM to a non-existing process */
-	client->pnatd_pid = 0;
-
-	disconnect(server);
-}
-
-static gboolean start_pnatd(struct dun_server *server)
-{
-	struct dun_client *client = &server->client;
-	GSpawnFlags flags = G_SPAWN_DO_NOT_REAP_CHILD | G_SPAWN_SEARCH_PATH;
-	char *argv[] = { PNATD, client->tty_name, NULL };
-	GError *err = NULL;
-	GPid pid;
-
-	g_spawn_async(NULL, argv, NULL, flags, NULL, NULL, &pid, &err);
-	if (err != NULL) {
-		error("Unable to spawn pnatd: %s", err->message);
-		g_error_free(err);
-		return FALSE;
-	}
-
-	DBG("pnatd started for %s with pid %d", client->tty_name, pid);
-
-	client->pnatd_pid = pid;
-
-	/* We do not store the GSource id since g_remove_source doesn't
-	 * make sense for a child watch. If the callback gets removed
-	 * waitpid won't be called and the child remains as a zombie)
-	 */
-	g_child_watch_add(pid, pnatd_exit, server);
-
-	return TRUE;
-}
-
-static gboolean tty_try_open(gpointer user_data)
-{
-	struct dun_server *server = user_data;
-	struct dun_client *client = &server->client;
-	int tty_fd;
-
-	tty_fd = open(client->tty_name, O_RDONLY | O_NOCTTY);
-	if (tty_fd < 0) {
-		if (errno == EACCES)
-			goto disconnect;
-
-		client->tty_tries--;
-
-		if (client->tty_tries <= 0)
-			goto disconnect;
-
-		return TRUE;
-	}
-
-	DBG("%s created for DUN", client->tty_name);
-
-	client->tty_open = TRUE;
-	client->tty_timer = 0;
-
-	g_io_channel_unref(client->io);
-	g_source_remove(client->io_watch);
-
-	client->io = g_io_channel_unix_new(tty_fd);
-	client->io_watch = g_io_add_watch(client->io,
-					G_IO_HUP | G_IO_ERR | G_IO_NVAL,
-					client_event, server);
-
-	if (!start_pnatd(server))
-		goto disconnect;
-
-	return FALSE;
-
-disconnect:
-	client->tty_timer = 0;
-	disconnect(server);
-	return FALSE;
-}
-
-static gboolean create_tty(struct dun_server *server)
-{
-	struct dun_client *client = &server->client;
-	struct rfcomm_dev_req req;
-	int sk = g_io_channel_unix_get_fd(client->io);
-
-	memset(&req, 0, sizeof(req));
-	req.dev_id = -1;
-	req.flags = (1 << RFCOMM_REUSE_DLC) | (1 << RFCOMM_RELEASE_ONHUP);
-
-	bacpy(&req.src, &server->bda);
-	bacpy(&req.dst, &client->bda);
-
-	bt_io_get(client->io, BT_IO_RFCOMM, NULL,
-			BT_IO_OPT_DEST_CHANNEL, &req.channel,
-			BT_IO_OPT_INVALID);
-
-	client->tty_id = ioctl(sk, RFCOMMCREATEDEV, &req);
-	if (client->tty_id < 0) {
-		error("Can't create RFCOMM TTY: %s", strerror(errno));
-		return FALSE;
-	}
-
-	snprintf(client->tty_name, PATH_MAX - 1, "/dev/rfcomm%d",
-							client->tty_id);
-
-	client->tty_tries = TTY_TRIES;
-
-	tty_try_open(server);
-	if (!client->tty_open && client->tty_tries > 0)
-		client->tty_timer = g_timeout_add(TTY_TIMEOUT,
-							tty_try_open, server);
-
-	return TRUE;
-}
-
-static void connect_cb(GIOChannel *io, GError *err, gpointer user_data)
-{
-	struct dun_server *server = user_data;
-
-	if (err) {
-		error("Accepting DUN connection failed: %s", err->message);
-		disconnect(server);
-		return;
-	}
-
-	if (!create_tty(server)) {
-		error("Device creation failed");
-		disconnect(server);
-	}
-}
-
-static void auth_cb(DBusError *derr, void *user_data)
-{
-	struct dun_server *server = user_data;
-	struct dun_client *client = &server->client;
-	GError *err = NULL;
-
-	if (derr && dbus_error_is_set(derr)) {
-		error("DUN access denied: %s", derr->message);
-		goto drop;
-	}
-
-	if (!bt_io_accept(client->io, connect_cb, server, NULL, &err)) {
-		error("bt_io_accept: %s", err->message);
-		g_error_free(err);
-		goto drop;
-	}
-
-	return;
-
-drop:
-	disconnect(server);
-}
-
-static gboolean auth_watch(GIOChannel *chan, GIOCondition cond, gpointer data)
-{
-	struct dun_server *server = data;
-	struct dun_client *client = &server->client;
-
-	error("DUN client disconnected while waiting for authorization");
-
-	btd_cancel_authorization(&server->bda, &client->bda);
-
-	disconnect(server);
-
-	return FALSE;
-}
-
-static void confirm_cb(GIOChannel *io, gpointer user_data)
-{
-	struct dun_server *server = user_data;
-	struct dun_client *client = &server->client;
-	GError *err = NULL;
-
-	if (client->io) {
-		error("Rejecting DUN connection since one already exists");
-		return;
-	}
-
-	bt_io_get(io, BT_IO_RFCOMM, &err,
-			BT_IO_OPT_DEST_BDADDR, &client->bda,
-			BT_IO_OPT_INVALID);
-	if (err != NULL) {
-		error("Unable to get DUN source and dest address: %s",
-								err->message);
-		g_error_free(err);
-		return;
-	}
-
-	if (btd_request_authorization(&server->bda, &client->bda, DUN_GW_UUID,
-						auth_cb, user_data) < 0) {
-		error("Requesting DUN authorization failed");
-		return;
-	}
-
-	client->io_watch = g_io_add_watch(io, G_IO_ERR | G_IO_HUP | G_IO_NVAL,
-						(GIOFunc) auth_watch, server);
-	client->io = g_io_channel_ref(io);
-}
-
-static sdp_record_t *dun_record(uint8_t ch)
-{
-	sdp_list_t *svclass_id, *pfseq, *apseq, *root, *aproto;
-	uuid_t root_uuid, dun, gn, l2cap, rfcomm;
-	sdp_profile_desc_t profile;
-	sdp_list_t *proto[2];
-	sdp_record_t *record;
-	sdp_data_t *channel;
-
-	record = sdp_record_alloc();
-	if (!record)
-		return NULL;
-
-	sdp_uuid16_create(&root_uuid, PUBLIC_BROWSE_GROUP);
-	root = sdp_list_append(NULL, &root_uuid);
-	sdp_set_browse_groups(record, root);
-
-	sdp_uuid16_create(&dun, DIALUP_NET_SVCLASS_ID);
-	svclass_id = sdp_list_append(NULL, &dun);
-	sdp_uuid16_create(&gn,  GENERIC_NETWORKING_SVCLASS_ID);
-	svclass_id = sdp_list_append(svclass_id, &gn);
-	sdp_set_service_classes(record, svclass_id);
-
-	sdp_uuid16_create(&profile.uuid, DIALUP_NET_PROFILE_ID);
-	profile.version = 0x0100;
-	pfseq = sdp_list_append(NULL, &profile);
-	sdp_set_profile_descs(record, pfseq);
-
-	sdp_uuid16_create(&l2cap, L2CAP_UUID);
-	proto[0] = sdp_list_append(NULL, &l2cap);
-	apseq = sdp_list_append(NULL, proto[0]);
-
-	sdp_uuid16_create(&rfcomm, RFCOMM_UUID);
-	proto[1] = sdp_list_append(NULL, &rfcomm);
-	channel = sdp_data_alloc(SDP_UINT8, &ch);
-	proto[1] = sdp_list_append(proto[1], channel);
-	apseq = sdp_list_append(apseq, proto[1]);
-
-	aproto = sdp_list_append(0, apseq);
-	sdp_set_access_protos(record, aproto);
-
-	sdp_set_info_attr(record, "Dial-Up Networking", 0, 0);
-
-	sdp_data_free(channel);
-	sdp_list_free(root, NULL);
-	sdp_list_free(svclass_id, NULL);
-	sdp_list_free(proto[0], NULL);
-	sdp_list_free(proto[1], NULL);
-	sdp_list_free(pfseq, NULL);
-	sdp_list_free(apseq, NULL);
-	sdp_list_free(aproto, NULL);
-
-	return record;
-}
-
-static gint server_cmp(gconstpointer a, gconstpointer b)
-{
-	const struct dun_server *server = a;
-	const bdaddr_t *src = b;
-
-	return bacmp(src, &server->bda);
-}
-
-static int pnat_probe(struct btd_adapter *adapter)
-{
-	struct dun_server *server;
-	GIOChannel *io;
-	GError *err = NULL;
-	sdp_record_t *record;
-	bdaddr_t src;
-
-	adapter_get_address(adapter, &src);
-
-	server = g_new0(struct dun_server, 1);
-
-	io = bt_io_listen(BT_IO_RFCOMM, NULL, confirm_cb, server, NULL, &err,
-				BT_IO_OPT_SOURCE_BDADDR, &src,
-				BT_IO_OPT_CHANNEL, DUN_CHANNEL,
-				BT_IO_OPT_INVALID);
-	if (err != NULL) {
-		error("Failed to start DUN server: %s", err->message);
-		g_error_free(err);
-		goto fail;
-	}
-
-	record = dun_record(DUN_CHANNEL);
-	if (!record) {
-		error("Unable to allocate new service record");
-		goto fail;
-	}
-
-	if (add_record_to_server(&src, record) < 0) {
-		error("Unable to register DUN service record");
-		goto fail;
-	}
-
-	server->rfcomm_ctl = socket(AF_BLUETOOTH, SOCK_RAW, BTPROTO_RFCOMM);
-	if (server->rfcomm_ctl < 0) {
-		error("Unable to create RFCOMM control socket: %s (%d)",
-						strerror(errno), errno);
-		goto fail;
-	}
-
-	server->server = io;
-	server->record_handle = record->handle;
-	bacpy(&server->bda, &src);
-
-	servers = g_slist_append(servers, server);
-
-	return 0;
-
-fail:
-	if (io != NULL)
-		g_io_channel_unref(io);
-	g_free(server);
-	return -EIO;
-}
-
-static void pnat_remove(struct btd_adapter *adapter)
-{
-	struct dun_server *server;
-	GSList *match;
-	bdaddr_t src;
-
-	adapter_get_address(adapter, &src);
-
-	match = g_slist_find_custom(servers, &src, server_cmp);
-	if (match == NULL)
-		return;
-
-	server = match->data;
-
-	servers = g_slist_delete_link(servers, match);
-
-	disconnect(server);
-
-	remove_record_from_server(server->record_handle);
-	close(server->rfcomm_ctl);
-	g_io_channel_shutdown(server->server, TRUE, NULL);
-	g_io_channel_unref(server->server);
-	g_free(server);
-}
-
-static struct btd_adapter_driver pnat_server = {
-	.name	= "pnat-server",
-	.probe	= pnat_probe,
-	.remove	= pnat_remove,
-};
-
-static int pnat_init(void)
-{
-	DBG("Setup Phonet AT (DUN) plugin");
-
-	return btd_register_adapter_driver(&pnat_server);
-}
-
-static void pnat_exit(void)
-{
-	DBG("Cleanup Phonet AT (DUN) plugin");
-
-	btd_unregister_adapter_driver(&pnat_server);
-}
-
-BLUETOOTH_PLUGIN_DEFINE(pnat, VERSION,
-			BLUETOOTH_PLUGIN_PRIORITY_DEFAULT,
-			pnat_init, pnat_exit)
-- 
1.7.10.2


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

* [PATCH -v3 9/9] btmgmt: move it to tools
  2012-07-10 14:03 [PATCH -v3 1/9] serial: remove the whole serial code Gustavo Padovan
                   ` (6 preceding siblings ...)
  2012-07-10 14:03 ` [PATCH -v3 8/9] plugins: remove unmaintained plugins Gustavo Padovan
@ 2012-07-10 14:03 ` Gustavo Padovan
  2012-07-10 14:22 ` [PATCH -v3 1/9] serial: remove the whole serial code Johan Hedberg
  8 siblings, 0 replies; 11+ messages in thread
From: Gustavo Padovan @ 2012-07-10 14:03 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Gustavo Padovan

From: Gustavo Padovan <gustavo.padovan@collabora.co.uk>

---
 .gitignore                    |    2 +-
 Makefile.tools                |    6 +++---
 mgmt/main.c => tools/btmgmt.c |    0
 3 files changed, 4 insertions(+), 4 deletions(-)
 rename mgmt/main.c => tools/btmgmt.c (100%)

diff --git a/.gitignore b/.gitignore
index c7d079e..9a2241f 100644
--- a/.gitignore
+++ b/.gitignore
@@ -86,7 +86,7 @@ compat/dund
 compat/hidd
 compat/pand
 unit/test-eir
-mgmt/btmgmt
+tools/btmgmt
 monitor/btmon
 emulator/btvirt
 
diff --git a/Makefile.tools b/Makefile.tools
index 70d333b..fccac2d 100644
--- a/Makefile.tools
+++ b/Makefile.tools
@@ -50,10 +50,10 @@ tools_ppporc_LDADD = lib/libbluetooth-private.la
 
 tools_hcieventmask_LDADD = lib/libbluetooth-private.la
 
-noinst_PROGRAMS += mgmt/btmgmt monitor/btmon emulator/btvirt
+noinst_PROGRAMS += tools/btmgmt monitor/btmon emulator/btvirt
 
-mgmt_btmgmt_SOURCES = mgmt/main.c src/glib-helper.c
-mgmt_btmgmt_LDADD = lib/libbluetooth-private.la @GLIB_LIBS@
+tools_btmgmt_SOURCES = tools/btmgmt.c src/glib-helper.c
+tools_btmgmt_LDADD = lib/libbluetooth-private.la @GLIB_LIBS@
 
 monitor_btmon_SOURCES = monitor/main.c monitor/bt.h \
 					monitor/mainloop.h monitor/mainloop.c \
diff --git a/mgmt/main.c b/tools/btmgmt.c
similarity index 100%
rename from mgmt/main.c
rename to tools/btmgmt.c
-- 
1.7.10.2


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

* Re: [PATCH -v3 1/9] serial: remove the whole serial code
  2012-07-10 14:03 [PATCH -v3 1/9] serial: remove the whole serial code Gustavo Padovan
                   ` (7 preceding siblings ...)
  2012-07-10 14:03 ` [PATCH -v3 9/9] btmgmt: move it to tools Gustavo Padovan
@ 2012-07-10 14:22 ` Johan Hedberg
  2012-07-10 14:26   ` Gustavo Padovan
  8 siblings, 1 reply; 11+ messages in thread
From: Johan Hedberg @ 2012-07-10 14:22 UTC (permalink / raw)
  To: Gustavo Padovan; +Cc: linux-bluetooth, Gustavo Padovan

Hi Gustavo,

On Tue, Jul 10, 2012, Gustavo Padovan wrote:
> From: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
> 
> ---
>  Makefile.am        |   19 +-
>  acinclude.m4       |    6 -
>  doc/serial-api.txt |   57 -----
>  serial/main.c      |   59 -----
>  serial/manager.c   |  127 -----------
>  serial/manager.h   |   25 --
>  serial/port.c      |  638 ----------------------------------------------------
>  serial/port.h      |   29 ---
>  serial/serial.conf |   10 -
>  9 files changed, 5 insertions(+), 965 deletions(-)
>  delete mode 100644 doc/serial-api.txt
>  delete mode 100644 serial/main.c
>  delete mode 100644 serial/manager.c
>  delete mode 100644 serial/manager.h
>  delete mode 100644 serial/port.c
>  delete mode 100644 serial/port.h
>  delete mode 100644 serial/serial.conf

All patches in this set have been applied. Thanks.

Seems that audio is still missing though.

Johan

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

* Re: [PATCH -v3 1/9] serial: remove the whole serial code
  2012-07-10 14:22 ` [PATCH -v3 1/9] serial: remove the whole serial code Johan Hedberg
@ 2012-07-10 14:26   ` Gustavo Padovan
  0 siblings, 0 replies; 11+ messages in thread
From: Gustavo Padovan @ 2012-07-10 14:26 UTC (permalink / raw)
  To: linux-bluetooth, Gustavo Padovan

Hi Johan,

* Johan Hedberg <johan.hedberg@gmail.com> [2012-07-10 11:22:47 -0300]:

> Hi Gustavo,
> 
> On Tue, Jul 10, 2012, Gustavo Padovan wrote:
> > From: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
> > 
> > ---
> >  Makefile.am        |   19 +-
> >  acinclude.m4       |    6 -
> >  doc/serial-api.txt |   57 -----
> >  serial/main.c      |   59 -----
> >  serial/manager.c   |  127 -----------
> >  serial/manager.h   |   25 --
> >  serial/port.c      |  638 ----------------------------------------------------
> >  serial/port.h      |   29 ---
> >  serial/serial.conf |   10 -
> >  9 files changed, 5 insertions(+), 965 deletions(-)
> >  delete mode 100644 doc/serial-api.txt
> >  delete mode 100644 serial/main.c
> >  delete mode 100644 serial/manager.c
> >  delete mode 100644 serial/manager.h
> >  delete mode 100644 serial/port.c
> >  delete mode 100644 serial/port.h
> >  delete mode 100644 serial/serial.conf
> 
> All patches in this set have been applied. Thanks.
> 
> Seems that audio is still missing though.

It is on purpose, there still a big patchset to be applied to audio, then we
can move it.

	Gustavo

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

end of thread, other threads:[~2012-07-10 14:26 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-07-10 14:03 [PATCH -v3 1/9] serial: remove the whole serial code Gustavo Padovan
2012-07-10 14:03 ` [PATCH -v3 2/9] health: move it to profiles Gustavo Padovan
2012-07-10 14:03 ` [PATCH -v3 3/9] input: move it to profiles folder Gustavo Padovan
2012-07-10 14:03 ` [PATCH -v3 4/9] network: " Gustavo Padovan
2012-07-10 14:03 ` [PATCH -v3 5/9] time: move to the " Gustavo Padovan
2012-07-10 14:03 ` [PATCH -v3 6/9] proximity: " Gustavo Padovan
2012-07-10 14:03 ` [PATCH -v3 7/9] sap: move it to " Gustavo Padovan
2012-07-10 14:03 ` [PATCH -v3 8/9] plugins: remove unmaintained plugins Gustavo Padovan
2012-07-10 14:03 ` [PATCH -v3 9/9] btmgmt: move it to tools Gustavo Padovan
2012-07-10 14:22 ` [PATCH -v3 1/9] serial: remove the whole serial code Johan Hedberg
2012-07-10 14:26   ` Gustavo Padovan

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.