Re: [PATCH v3 3/8] core: Add support for retrying a bonding

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Alex,

On Tue, Apr 23, 2013, Alex Deymo wrote:
> --- a/src/adapter.c
> +++ b/src/adapter.c
> @@ -4253,7 +4253,7 @@ static void adapter_remove_connection(struct btd_adapter *adapter,
>  	if (device_is_authenticating(device))
>  		device_cancel_authentication(device, TRUE);
>  
> -	if (device_is_temporary(device)) {
> +	if (device_is_temporary(device) && !device_is_retrying(device)) {
>  		const char *path = device_get_path(device);
>  
>  		DBG("Removing temporary device %s", path);
> diff --git a/src/device.c b/src/device.c
> index 5686443..291ae5f 100644
> --- a/src/device.c
> +++ b/src/device.c
> @@ -86,6 +86,9 @@ struct bonding_req {
>  	struct btd_device *device;
>  	struct agent *agent;
>  	struct pincb_iter *cb_iter;
> +	uint8_t capability;
> +	uint8_t status;
> +	guint retry_timer;
>  };
>  
>  typedef enum {
> @@ -1400,7 +1403,8 @@ static void device_svc_resolved(struct btd_device *dev, int err)
>  
>  static struct bonding_req *bonding_request_new(DBusMessage *msg,
>  						struct btd_device *device,
> -						struct agent *agent)
> +						struct agent *agent,
> +						uint8_t io_cap)
>  {
>  	struct bonding_req *bonding;
>  	char addr[18];
> @@ -1414,6 +1418,8 @@ static struct bonding_req *bonding_request_new(DBusMessage *msg,
>  
>  	bonding->cb_iter = pincb_iter_new(device->adapter);
>  
> +	bonding->capability = io_cap;

Do you really need to store this? Since you've got bonding->agent you
could just use agent_get_io_capability()?

> +gboolean device_is_retrying(struct btd_device *device)
> +{
> +	struct bonding_req *bonding = device->bonding;
> +
> +	return bonding && bonding->retry_timer != 0;

We try to keep the convention of using > 0 instead of != 0 for testing
for valid GSource ID values.

Johan
--
To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux