Linux bluetooth development
 help / color / mirror / Atom feed
From: Bastien Nocera <hadess@hadess.net>
To: linux-bluetooth@vger.kernel.org
Subject: Powered property and rfkill
Date: Mon, 04 Jan 2016 16:28:13 +0100	[thread overview]
Message-ID: <1451921293.8726.9.camel@hadess.net> (raw)

Hey,

I was wondering the reasoning behind the recent changes in rfkill
handling for hci interfaces, in particular the addition
of MGMT_STATUS_RFKILLED as an error message.

Before those changes (for which I couldn't find an initial kernel side
commit), the Powered state of the adapter was tied to its rfkill
status.

When a soft rfkilled device showed up, which was to be the default
adapter, bluetoothd would remember that it was powered, and unrfkill
it. If the state was unpowered, or it had been rfkilled, GNOME's
Bluetooth panel would set Powered to true, un-rfkill'ing the adapter.

In 99% of cases, this meant that plugging in a Bluetooth adapter would
work out of the box.

Now, bluetoothd doesn't remember the power state, and the rfkill isn't
tied to the Powered state. Calling to set the Power state will fail
with the "Blocked" error, and we're expecting something else to unset
the adapter's rfkill status.

What did the developers making those changes hope that would unrfkill
and power up the adapter when plugged in?

Note that this might be a side-effect of the machine I'm using which
has 2 layers of Bluetooth rfkill:
$ rfkill list bluetooth
0: tpacpi_bluetooth_sw: Bluetooth
	Soft blocked: no
	Hard blocked: no
4: hci0: Bluetooth
	Soft blocked: yes
	Hard blocked: no

hci0 won't be visible if tpacpi_bluetooth_sw is soft-killed. The work-
around I have planned is to wait for "hci*" to appear if the Bluetooth
rfkill we unset doesn't start with "hci".

Any better ideas?

Cheers

             reply	other threads:[~2016-01-04 15:28 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-04 15:28 Bastien Nocera [this message]
2016-01-04 18:11 ` Powered property and rfkill Marcel Holtmann
2016-01-05  0:01   ` Bastien Nocera
2016-01-05  7:07     ` Marcel Holtmann

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=1451921293.8726.9.camel@hadess.net \
    --to=hadess@hadess.net \
    --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