public inbox for linux-bluetooth@vger.kernel.org
 help / color / mirror / Atom feed
From: Johan Hedberg <johan.hedberg@gmail.com>
To: zhangfei gao <zhangfei.gao@gmail.com>
Cc: linux-bluetooth@vger.kernel.org
Subject: Re: Any flag indicating bt/fm is ready to run "hcitool cmd"
Date: Wed, 12 Jan 2011 10:37:26 +0200	[thread overview]
Message-ID: <20110112083726.GA28156@jh-x301> (raw)
In-Reply-To: <AANLkTinFt0Rsbk6LoTk8YnYeqGqzxwTwrWgRakCaQoWo@mail.gmail.com>

Hi,

On Wed, Jan 12, 2011, zhangfei gao wrote:
> Is there any flag indicating bt/fm is ready to run "hcitool cmd", ie,
> "hciconfig hci0 up" is really finished.
> 
> We met error "Send failed: File descriptor in bad state", if run
> hcitool immediately after "hciconfig hci0 up"
> For example:
> hciconfig hci0 up
> hcitool cmd 3f 66 02 26 00 00 00 30

The HCIDEVUP ioctl is at least synchronized with the open() callback for
the HCI driver so in that sense if the driver is working fine it should
be possible to send commands when it returns. There is however an issue
with existing kernels that HCIDEVUP doesn't wait for all of the kernels
own HCI commands to finish before returning to user space. There was a
patch sent for this some time ago which you might be interested in
trying: http://marc.info/?l=linux-bluetooth&m=129296529630642&w=4

Johan

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

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-12  7:02 Any flag indicating bt/fm is ready to run "hcitool cmd" zhangfei gao
2011-01-12  8:37 ` Johan Hedberg [this message]
2011-01-13  6:53   ` zhangfei gao
2011-01-13 12:26     ` Johan Hedberg

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=20110112083726.GA28156@jh-x301 \
    --to=johan.hedberg@gmail.com \
    --cc=linux-bluetooth@vger.kernel.org \
    --cc=zhangfei.gao@gmail.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