OESF Portables Forum

Everything Else => Zaurus Distro Support and Discussion => Distros, Development, and Model Specific Forums => Archived Forums => Sharp ROMs => Topic started by: trejkaz on December 30, 2004, 12:21:16 am

Title: Cacko: Bluetooth Not Resuming On Resume
Post by: trejkaz on December 30, 2004, 12:21:16 am
ROM: Cacko 1.21b
Zaurus: SL-C860
Bluetooth card: D-Link DCF-650BT

Updated /etc/bluetooth/uart with the BlueMonkey line (since this card masquerades as a BlueMonkey card... sigh.)

Card works perfectly on insert, but deactivates on suspend and on resume, it doesn't come back up.

Running "hciconfig hci0 up" straight after makes it work, but it's less than convenient to have to do this every time my device happens to suspend.  Same goes for pulling out the card... that works too, but is a pain.

Taking a look at /etc/apm.d/resume.d/R45bluetooth, it seems that "cardctl eject" and "cardctl insert" are supposed to be getting run on resume.  But obviously neither is actually happening.  When I try running "cardctl eject" from the console, I get this:

Code: [Select]
ioctl(): Device or resource busy
I assume that this is the underlying problem.  Anyone have any ideas on how to solve it?
Title: Cacko: Bluetooth Not Resuming On Resume
Post by: gizard on December 30, 2004, 05:36:29 am
I have a Socket card and I have to physically pull the card out and the insert it again after a resume - it then works fine.
Title: Cacko: Bluetooth Not Resuming On Resume
Post by: trejkaz on December 30, 2004, 05:48:51 am
So you have exactly the same problem as I have. -sigh-

I found a workaround.  I discovered that the hciattach process was the one preventing "cardctl eject" from taking place.

Add a "killall hciattach" to the resume portion of the /etc/apm.d/bluetooth script, and it now works fine after reset:

Code: [Select]
     killall hciattach
      rfcomm bind all
      cardctl eject
      cardctl insert
      hciconfig hci0 up

It's a bit of a dirty hack, but it makes it work fine through reset.  The "correct" solution would be for hciattach to not be running in the first place.  It isn't running on my Linux desktop which also uses bluez, so it shouldn't need to be running on the Linux handheld. :-)
Title: Cacko: Bluetooth Not Resuming On Resume
Post by: tumnus on December 31, 2004, 04:17:36 pm
hciattach is required for your card because it has a UART based interface. hciattach initialises the interface and allows the hci_uart driver to work with the card.
Title: Cacko: Bluetooth Not Resuming On Resume
Post by: trejkaz on December 31, 2004, 10:30:46 pm
I guess it really is a bug in Cacko then.  Maybe it will be fixed for 1.22.