Add better behavior & fix for bluetooth with Lenovo Thinkpads (Code included)

Bug #183682 reported by Jerone Young
4
Affects Status Importance Assigned to Milestone
acpi-support (Ubuntu)
Invalid
Medium
Unassigned

Bug Description

I have a fix for the behavior of the current ibm-wireless.sh script.

1) The current check to see if disabled was is no longer valid.
    jerone@laptop:~$ cat /proc/acpi/ibm/bluetooth
   status: enabled
   commands: enable, disable

   You now have 2 lines and not just 1.

2) Lenovo Thinkpads all have an rf_kill switch for the wireless network card
   So DO NOT manipulate the wireless card. ONLY the bluetooth!

I will attach a patch for acpi-support & a file (just for convinence)

Revision history for this message
Jerone Young (jerone) wrote :
Revision history for this message
Jerone Young (jerone) wrote :

Signed-off-by: <email address hidden>

Revision history for this message
Parthan SR (parth-technofreak) wrote :

confirming as patch is available.

Changed in acpi-support:
status: New → Confirmed
Revision history for this message
Jerone Young (jerone) wrote :

Is anyone paying attention to this fix?

Revision history for this message
Daniel Hahler (blueyed) wrote :

To get your fix included in Ubuntu, it would help if you tried transforming it into a debdiff (http://wiki.ubuntu.com/PackagingGuide/Recipes/Debdiff) and submit it for review (http://wiki.ubuntu.com/SponsorshipProcess). If you prefer somebody else to do that, that's fine - please just indicate if you're available to do that.

Changed in acpi-support:
importance: Undecided → Medium
Revision history for this message
Jerone Young (jerone) wrote :

It would be awsome if you could do this for me. My Hardy install seems to be in total disarry, and it will be about a week or two before I get a chance to do a reinstall. Big Thanks for doing this for me (who ever ends up doing it) ;-)

There is another thing you should know (not that the patch should not be included) . But in the latest firmware by Lenovo 2.09 (released 12/27/07) for Thinkpad T61/R61 Lenovo , has now disabled the acpi event for the FN+F5 under Linux. Firmwares before it do it, but Lenovo keeps changing things..this will possibly be reenabled in later firmware, but Lenovo keeps switching things. Just so you know if anyone is trying to test.

Revision history for this message
Daniel Hahler (blueyed) wrote :

Ok, I've created a new version of acpi-support, which includes your patch (and all others I've found on launchpad).

I'm waiting for feedback on some of the bugs I've touched and then will request sponsorship for my debdiff.
I've uploaded it to my PPA, you can test it from there already: https://edge.launchpad.net/~blueyed/+archive?field.name_filter=acpi-support&field.status_filter=published - once it's build.

Thank you for your contribution.

Changed in acpi-support:
assignee: nobody → blueyed
status: Confirmed → In Progress
Revision history for this message
Steve Langasek (vorlon) wrote :

I don't think this patch is correct.

- grep -q disabled $BLUETOOTH
+ grep -i -n1 -q disabled $BLUETOOTH

As shown above, there is only *one* line that may match 'disabled', and that's the 'status' line. The following 'commands:' line lists only 'disable' without the 'd', so this patch is a no-op (except that it makes the check a little more fragile in the case of other file format changes).

case "$manufacturer" in
    LENOVO*)
        #if you are Lenovo Thinkpad
        #All Lenovo laptops now have an rf_kill swith
        #for wireless cards. So only manipulate bluetooh.

I assume this refers to the hardware kill switch? Yes, I have a hardware kill switch on my Lenovo laptop, but at least at one time, toggling the switch was known to crash the kernel. So I don't use the hardware kill switch, I rely on Fn-F5 doing the right thing for my wireless+bluetooth. (Which it currently doesn't anyway, but that's orthogonal.)

So I don't think this patch should be applied.

Revision history for this message
Jerone Young (jerone) wrote :

Actually that is correct. The reason you use "grep -i -n1 -q disabled $BLUETOOTH" is that if you
cat you get:
root@thinkpad:/home/jerone# cat /proc/acpi/ibm/bluetooth
status: disabled
commands: enable, disable

The first line will allways be the status. But the 2nd line is the commands. We only want to see the first line.

Also havig FN+F5 toggle both bluetooh & wireless is extremely confusing to users as there is an rf_kill switch if you want to kill it.

Now under Windows FN+F5 calls up a program that you then choose if you want to enable/disable bluetooth.

Most perfer FN+F5 just be for bluetooth. There is another bugzilla with people who have the same feelings:
https://bugs.launchpad.net/ubuntu/+source/acpi-support/+bug/24680

Revision history for this message
Daniel Hahler (blueyed) wrote :

Jerone, I think Steve is right about the no-op grep change.. otherwise, to make it more specific you could have used "grep ^status: $BLUETOOTH | grep -q disabled", but this (and your change) makes it more fragile probably. However, if the match should be more specific, explicitly selecting the status line (by prefix instead of line number) makes more sense IMHO.

Revision history for this message
Jerone Young (jerone) wrote :

True. The behavior before with was it would only have "disabled" & not have 2 lines with labels status & commands. I created a new file that adds the old grep line back.

Revision history for this message
Jerone Young (jerone) wrote :

Change grep line back to original.

Revision history for this message
Daniel Hahler (blueyed) wrote :

JFI: The patch has been dropped for now from the "cherry-pick debdiff" at bug 193842.

Changed in acpi-support:
assignee: blueyed → nobody
status: In Progress → Triaged
Revision history for this message
Jerone Young (jerone) wrote :

Since now with package linux-backports the led on the wireless works. There is now some indication to the user that wireless is being toggled when they try to enable bluetooth. Given this this bug is now invalid.

Changed in acpi-support:
status: Triaged → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.