Linux bluetooth development
 help / color / mirror / Atom feed
From: Emeltchenko Andrei <Andrei.Emeltchenko.news@gmail.com>
To: Marcel Holtmann <marcel@holtmann.org>
Cc: linux-bluetooth@vger.kernel.org
Subject: Re: [PATCHv2 5/8] Bluetooth: Add HCI Read Data Block Size function
Date: Thu, 1 Dec 2011 15:37:33 +0200	[thread overview]
Message-ID: <20111201133731.GF2216@aemeltch-MOBL1> (raw)
In-Reply-To: <1322745223.26198.35.camel@aeonflux>

Hi Marcel,

On Thu, Dec 01, 2011 at 02:13:43PM +0100, Marcel Holtmann wrote:
> Hi Andrei,
> 
> > Upstream Code Aurora function with minor trivial fixes.
> > Origin: git://codeaurora.org/kernel/msm.git
> > 
> > Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
> > ---
> >  include/net/bluetooth/hci.h      |    8 ++++++++
> >  include/net/bluetooth/hci_core.h |    2 ++
> >  net/bluetooth/hci_event.c        |   31 +++++++++++++++++++++++++++++++
> >  3 files changed, 41 insertions(+), 0 deletions(-)
> > 
> > diff --git a/include/net/bluetooth/hci.h b/include/net/bluetooth/hci.h
> > index a6a2509..c5de256 100644
> > --- a/include/net/bluetooth/hci.h
> > +++ b/include/net/bluetooth/hci.h
> > @@ -741,6 +741,14 @@ struct hci_rp_read_bd_addr {
> >  	bdaddr_t bdaddr;
> >  } __packed;
> >  
> > +#define HCI_OP_READ_DATA_BLOCK_SIZE	0x100a
> > +struct hci_rp_read_data_block_size {
> > +	__u8     status;
> > +	__le16   max_acl_len;
> > +	__le16   block_len;
> > +	__le16   num_blocks;
> > +} __packed;
> > +
> >  #define HCI_OP_WRITE_PAGE_SCAN_ACTIVITY	0x0c1c
> >  struct hci_cp_write_page_scan_activity {
> >  	__le16   interval;
> > diff --git a/include/net/bluetooth/hci_core.h b/include/net/bluetooth/hci_core.h
> > index a7fd63a..869ab72 100644
> > --- a/include/net/bluetooth/hci_core.h
> > +++ b/include/net/bluetooth/hci_core.h
> > @@ -172,6 +172,8 @@ struct hci_dev {
> >  
> >  	__u8		flow_ctl_mode;
> >  
> > +	__u16		block_len;
> > +
> >  	unsigned int	auto_accept_delay;
> >  
> >  	unsigned long	quirks;
> > diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c
> > index efad012..a646310 100644
> > --- a/net/bluetooth/hci_event.c
> > +++ b/net/bluetooth/hci_event.c
> > @@ -774,6 +774,33 @@ static void hci_cc_read_bd_addr(struct hci_dev *hdev, struct sk_buff *skb)
> >  	hci_req_complete(hdev, HCI_OP_READ_BD_ADDR, rp->status);
> >  }
> >  
> > +static void hci_cc_read_data_block_size(struct hci_dev *hdev,
> > +							struct sk_buff *skb)
> > +{
> > +	struct hci_rp_read_data_block_size *rp = (void *) skb->data;
> > +
> > +	BT_DBG("%s status 0x%x", hdev->name, rp->status);
> > +
> > +	if (rp->status)
> > +		return;
> > +
> > +	if (hdev->flow_ctl_mode == HCI_FLOW_CTL_MODE_BLOCK_BASED) {
> > +		hdev->acl_mtu  = __le16_to_cpu(rp->max_acl_len);
> > +		hdev->sco_mtu = 0;
> > +		hdev->block_len = __le16_to_cpu(rp->block_len);
> > +		/* acl_pkts indicates the number of blocks */
> > +		hdev->acl_pkts = __le16_to_cpu(rp->num_blocks);
> > +		hdev->sco_pkts = 0;
> > +		hdev->acl_cnt = hdev->acl_pkts;
> > +		hdev->sco_cnt = 0;
> > +	}
> 
> I am still not convinced that overloading the variables is a good idea.
> And so far nobody has me convinced that this is the best way.

I think that we can use different variables like block_cnt and acl_blocks,
then function split as you mentioned in other comment does make sense.

Best regards 
Andrei Emeltchenko 

  reply	other threads:[~2011-12-01 13:37 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-01 12:42 [PATCHv2 0/8] AMP/BREDR initialization patches Emeltchenko Andrei
2011-12-01 12:42 ` [PATCHv2 1/8] Bluetooth: remove old code Emeltchenko Andrei
2011-12-02 12:27   ` Gustavo Padovan
2011-12-01 12:42 ` [PATCHv2 2/8] Bluetooth: Split ctrl init to BREDR and AMP parts Emeltchenko Andrei
2011-12-01 12:42 ` [PATCHv2 3/8] Bluetooth: Add HCI Read Flow Control Mode function Emeltchenko Andrei
2011-12-01 12:42 ` [PATCHv2 4/8] Bluetooth: Initialize default flow control mode Emeltchenko Andrei
2011-12-01 12:42 ` [PATCHv2 5/8] Bluetooth: Add HCI Read Data Block Size function Emeltchenko Andrei
2011-12-01 13:13   ` Marcel Holtmann
2011-12-01 13:37     ` Emeltchenko Andrei [this message]
2011-12-02 12:25       ` Emeltchenko Andrei
2011-12-02 15:28         ` Marcel Holtmann
2011-12-01 12:42 ` [PATCHv2 6/8] Bluetooth: Recalculate sched for HCI block flow ctrl Emeltchenko Andrei
2011-12-01 12:42 ` [PATCHv2 7/8] Bluetooth: Use SNIFF mode only for BREDR controller Emeltchenko Andrei
2011-12-01 13:11   ` Marcel Holtmann
2011-12-01 13:32     ` Emeltchenko Andrei
2011-12-01 12:42 ` [PATCHv2 8/8] Bluetooth: Complete Read Local Version HCI cmd Emeltchenko Andrei
2011-12-01 13:12   ` Marcel Holtmann
2011-12-01 13:23     ` Emeltchenko Andrei

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=20111201133731.GF2216@aemeltch-MOBL1 \
    --to=andrei.emeltchenko.news@gmail.com \
    --cc=linux-bluetooth@vger.kernel.org \
    --cc=marcel@holtmann.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