diff options
| -rw-r--r-- | hcid/adapter.c | 47 | ||||
| -rw-r--r-- | hcid/adapter.h | 16 | ||||
| -rw-r--r-- | hcid/dbus-hci.c | 21 | 
3 files changed, 0 insertions, 84 deletions
| diff --git a/hcid/adapter.c b/hcid/adapter.c index 7e6b0cce..6a7a1700 100644 --- a/hcid/adapter.c +++ b/hcid/adapter.c @@ -598,53 +598,6 @@ done:  	return dbus_message_new_method_return(msg);  } -gboolean dc_pending_timeout_handler(void *data) -{ -	int dd; -	struct adapter *adapter = data; -	struct pending_dc_info *pending_dc = adapter->pending_dc; -	DBusMessage *reply; - -	dd = hci_open_dev(adapter->dev_id); - -	if (dd < 0) { -		error_no_such_adapter(pending_dc->conn, -				      pending_dc->msg); -		dc_pending_timeout_cleanup(adapter); -		return FALSE; -	} - -	/* Send the HCI disconnect command */ -	if (hci_disconnect(dd, htobs(pending_dc->conn_handle), -				HCI_OE_USER_ENDED_CONNECTION, -				500) < 0) { -		int err = errno; -		error("Disconnect failed"); -		error_failed_errno(pending_dc->conn, pending_dc->msg, err); -	} else { -		reply = dbus_message_new_method_return(pending_dc->msg); -		if (reply) { -			dbus_connection_send(pending_dc->conn, reply, NULL); -			dbus_message_unref(reply); -		} else -			error("Failed to allocate disconnect reply"); -	} - -	hci_close_dev(dd); -	dc_pending_timeout_cleanup(adapter); - -	return FALSE; -} - -void dc_pending_timeout_cleanup(struct adapter *adapter) -{ -	dbus_connection_unref(adapter->pending_dc->conn); -	dbus_message_unref(adapter->pending_dc->msg); -	g_free(adapter->pending_dc); -	adapter->pending_dc = NULL; -} - -  static void reply_authentication_failure(struct bonding_request_info *bonding)  {  	DBusMessage *reply; diff --git a/hcid/adapter.h b/hcid/adapter.h index f6ed7a22..5488c105 100644 --- a/hcid/adapter.h +++ b/hcid/adapter.h @@ -84,13 +84,6 @@ struct active_conn_info {  	uint16_t handle;  }; -struct pending_dc_info { -	DBusConnection *conn; -	DBusMessage *msg; -	uint16_t conn_handle; -	guint timeout_id; -}; -  struct adapter {  	uint16_t dev_id;  	int up; @@ -120,7 +113,6 @@ struct adapter {  	struct bonding_request_info *bonding;  	GSList *auth_reqs;		/* Received and replied HCI  					   authentication requests */ -	struct pending_dc_info *pending_dc;  	GSList *devices;		/* Devices structure pointers */  	GSList *sessions;		/* Request Mode sessions */  }; @@ -140,20 +132,12 @@ void adapter_remove_device(DBusConnection *conn, struct adapter *adapter,  struct device *adapter_create_device(DBusConnection *conn,  				struct adapter *adapter, const char *address); -const char *major_class_str(uint32_t class); - -const char *minor_class_str(uint32_t class); -  const char *mode2str(uint8_t mode);  uint8_t str2mode(const char *addr, const char *mode); -GSList *service_classes_str(uint32_t class); -  int pending_remote_name_cancel(struct adapter *adapter); -void dc_pending_timeout_cleanup(struct adapter *adapter); -  void remove_pending_device(struct adapter *adapter);  void adapter_auth_request_replied(struct adapter *adapter, bdaddr_t *dba); diff --git a/hcid/dbus-hci.c b/hcid/dbus-hci.c index d18ca1c6..b4891c22 100644 --- a/hcid/dbus-hci.c +++ b/hcid/dbus-hci.c @@ -426,14 +426,6 @@ int unregister_adapter_path(const char *path)  		adapter->active_conn = NULL;  	} -	/* Check if there is a pending RemoteDeviceDisconnect request */ -	if (adapter->pending_dc) { -		error_no_such_adapter(adapter->pending_dc->conn, -				      adapter->pending_dc->msg); -		g_source_remove(adapter->pending_dc->timeout_id); -		dc_pending_timeout_cleanup(adapter); -	} -  	if (adapter->devices) {  		g_slist_foreach(adapter->devices, do_unregister,  							connection); @@ -1866,19 +1858,6 @@ void hcid_dbus_disconn_complete(bdaddr_t *local, uint8_t status,  		adapter->bonding = NULL;  	} -	/* Check if there is a pending RemoteDeviceDisconnect request */ -	if (adapter->pending_dc) { -		reply = dbus_message_new_method_return(adapter->pending_dc->msg); -		if (reply) { -			dbus_connection_send(connection, reply, NULL); -			dbus_message_unref(reply); -		} else -			error("Failed to allocate disconnect reply"); - -		g_source_remove(adapter->pending_dc->timeout_id); -		dc_pending_timeout_cleanup(adapter); -	} -  	adapter->active_conn = g_slist_remove(adapter->active_conn, dev);  	g_free(dev); | 
