Re: [PATCH] adapter: Add retry when bonding device returns connection failure

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

 



Hi,

> Here is what Ive actually had in mind:
>
> diff --git a/src/adapter.c b/src/adapter.c
> index bb49a1ecad23..f1cc4f2ed25a 100644
> --- a/src/adapter.c
> +++ b/src/adapter.c
> @@ -8363,12 +8363,17 @@ static void bonding_attempt_complete(struct
> btd_adapter *adapter,
>         else
>                 device = btd_adapter_find_device(adapter, bdaddr, addr_type);
>
> -       if (status == MGMT_STATUS_AUTH_FAILED && adapter->pincode_requested) {
> -               /* On faliure, issue a bonding_retry if possible. */
> +       switch (status) {
> +       case MGMT_STATUS_AUTH_FAILED:
> +               if (!adapter->pincode_requested)
> +                       break;
> +       /* fall through */
> +       case MGMT_STATUS_CONNECT_FAILED:
>                 if (device != NULL) {
>                         if (device_bonding_attempt_retry(device) == 0)
>                                 return;
>                 }
> +               break;
>         }
>
>         /* Ignore disconnects during retry. */

Great, I think you are right if kernel does not continue to return MGMT_STATUS_CONNECT_FAILED status.

My idea is to retry only once after returning MGMT_STATUS_CONNECT_FAILED,
it can avoid repeated retry when continuing to return MGMT_STATUS_CONNECT_FAILED.

Cheers,
Chengyi




[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