public inbox for linux-bluetooth@vger.kernel.org
 help / color / mirror / Atom feed
From: Andrei Emeltchenko <Andrei.Emeltchenko.news@gmail.com>
To: linux-bluetooth@vger.kernel.org
Subject: Re: [RFC] Bluetooth: AMP: Do not set name for AMP ctrl
Date: Thu, 7 Jun 2012 09:40:43 +0300	[thread overview]
Message-ID: <20120607064040.GA32366@aemeltch-MOBL1> (raw)
In-Reply-To: <20120606152736.GA25191@x220.ccr.corp.intel.com>

Hi Johan,

On Wed, Jun 06, 2012 at 11:27:36PM +0800, Johan Hedberg wrote:
> Hi,
> 
> On Wed, Jun 06, 2012, Johan Hedberg wrote:
> > On Wed, Jun 06, 2012, Andrei Emeltchenko wrote:
> > > AMP controllers do not understand this command
> > > 
> > > ...
> > > < HCI Command: Write Local Name (0x03|0x0013) plen 248
> > >    name ''
> > > > HCI Event: Command Complete (0x0e) plen 4
> > >    Write Local Name (0x03|0x0013) ncmd 1
> > >    status 0x01
> > >    Error: Unknown HCI Command
> > > ...
> > > 
> > > Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
> > > ---
> > >  net/bluetooth/mgmt.c |    3 +++
> > >  1 file changed, 3 insertions(+)
> > > 
> > > diff --git a/net/bluetooth/mgmt.c b/net/bluetooth/mgmt.c
> > > index 958f764..9afcc84 100644
> > > --- a/net/bluetooth/mgmt.c
> > > +++ b/net/bluetooth/mgmt.c
> > > @@ -2135,6 +2135,9 @@ static int set_local_name(struct sock *sk, struct hci_dev *hdev, void *data,
> > >  
> > >  	BT_DBG("");
> > >  
> > > +	if (hdev->amp_type != HCI_BREDR)
> > > +		return -ENOTSUPP;
> > > +
> > >  	hci_dev_lock(hdev);
> > >  
> > >  	memcpy(hdev->short_name, cp->short_name, sizeof(hdev->short_name));
> > 
> > This will essentially make write() fail on the mgmt socket which isn't
> > necessarily the most intuitive behavior (one might think there's
> > something wrong with the socket). What would probably make more sense is
> > to send a proper cmd_status reply with MGMT_STATUS_NOT_SUPPORTED.
> 
> Actually, should we even be exposing AMP controllers to begin with
> through mgmt? Maybe we shouldn't even tell user space about them through
> mgmt?

This seems to be right. BTW: What is the best way to disable mgmt for
device?
 - Clear HCI_MGMT flag ?
 - Do not run mgmt_powered ?

BTW: Where that flag HCI_MGMT is set and how this check supposed to be
working?

test_and_set_bit(HCI_MGMT, &hdev->dev_flags))

Best regards 
Andrei Emeltchenko  


  reply	other threads:[~2012-06-07  6:40 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-06-06 15:00 [RFC] Bluetooth: AMP: Do not set name for AMP ctrl Andrei Emeltchenko
2012-06-06 15:22 ` Johan Hedberg
2012-06-06 15:27   ` Johan Hedberg
2012-06-07  6:40     ` Andrei Emeltchenko [this message]
2012-06-07 15:18       ` Johan Hedberg
2012-06-08  8:09         ` [PATCH] Bluetooth: mgmt: Fix managing AMP device Andrei Emeltchenko
2012-06-12 13:31           ` [PATCHv2] " Andrei Emeltchenko

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=20120607064040.GA32366@aemeltch-MOBL1 \
    --to=andrei.emeltchenko.news@gmail.com \
    --cc=linux-bluetooth@vger.kernel.org \
    /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