Linux bluetooth development
 help / color / mirror / Atom feed
From: Szymon Janc <szymon.janc@tieto.com>
To: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
Cc: linux-bluetooth@vger.kernel.org
Subject: Re: [PATCH_v3 3/4] android/pan: Implement PAN enable HAL api at daemon side
Date: Wed, 08 Jan 2014 10:24:56 +0100	[thread overview]
Message-ID: <7986762.b1HJLuCvE7@uw000953> (raw)
In-Reply-To: <1389097880-14783-4-git-send-email-ravikumar.veeramally@linux.intel.com>

Hi Ravi,

> ---
>  android/pan.c | 32 ++++++++++++++++++++++++++------
>  1 file changed, 26 insertions(+), 6 deletions(-)
> 
> diff --git a/android/pan.c b/android/pan.c
> index 0eef284..0e12245 100644
> --- a/android/pan.c
> +++ b/android/pan.c
> @@ -585,18 +585,38 @@ static void bt_pan_enable(const void *buf, uint16_t len)
>  {
>  	const struct hal_cmd_pan_enable *cmd = buf;
>  	uint8_t status;
> +	int err;
> +
> +	DBG("");
> +
> +	if (local_role == cmd->local_role) {
> +		status = HAL_STATUS_SUCCESS;
> +		goto reply;
> +	}
> +
> +	/* destroy existing server */
> +	destroy_nap_device();
>  
>  	switch (cmd->local_role) {
>  	case HAL_PAN_ROLE_PANU:
> -	case HAL_PAN_ROLE_NAP:
> -		DBG("Not Implemented");
> -		status  = HAL_STATUS_FAILED;
> -		break;
> -	default:
>  		status = HAL_STATUS_UNSUPPORTED;
> -		break;
> +		goto reply;
> +	case HAL_PAN_ROLE_NONE:
> +		status = HAL_STATUS_SUCCESS;
> +		goto reply;
> +	}

Why do you remove default here? Daemon should verify parameter correctness.

> +
> +	local_role = cmd->local_role;
> +	err = register_nap_server();
> +	if (err < 0) {
> +		status = HAL_STATUS_FAILED;
> +		destroy_nap_device();
> +		goto reply;
>  	}
>  
> +	status = HAL_STATUS_SUCCESS;
> +
> +reply:
>  	ipc_send_rsp(HAL_SERVICE_ID_PAN, HAL_OP_PAN_ENABLE, status);
>  }
>  
> 

-- 
BR
Szymon Janc



  reply	other threads:[~2014-01-08  9:24 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-07 12:31 [PATCH_v3 0/4] Add support for NAP role Ravi kumar Veeramally
2014-01-07 12:31 ` [PATCH_v3 1/4] android/pan: Register Network Access Point Ravi kumar Veeramally
2014-01-08  9:18   ` Szymon Janc
2014-01-08  9:27     ` Ravi kumar Veeramally
2014-01-07 12:31 ` [PATCH_v3 2/4] android/pan: Listen for incoming connections and accept in NAP role Ravi kumar Veeramally
2014-01-08  9:07   ` Luiz Augusto von Dentz
2014-01-08  9:34     ` Ravi kumar Veeramally
2014-01-07 12:31 ` [PATCH_v3 3/4] android/pan: Implement PAN enable HAL api at daemon side Ravi kumar Veeramally
2014-01-08  9:24   ` Szymon Janc [this message]
2014-01-08  9:29     ` Ravi kumar Veeramally
2014-01-07 12:31 ` [PATCH_v3 4/4] android/pan: Remove connected PAN devices on profile unregister call Ravi kumar Veeramally

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7986762.b1HJLuCvE7@uw000953 \
    --to=szymon.janc@tieto.com \
    --cc=linux-bluetooth@vger.kernel.org \
    --cc=ravikumar.veeramally@linux.intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox