Comment 65 for bug 32415

Revision history for this message
kisch (kisch) wrote : Re: Bluetooth Mouse and Keyboard Broken in Dapper/Edgy/Feisty

Here comes the patch.

It applies to bluez-utils 2.25 and 3.7 (and all versions inbetween, presumably).

The patch can safely be applied to the source tree for all platforms.
It checks at compile time that it's being build for PowerPC 32bit, otherwise it doesn't change the implementation.
Then it checks at runtime that it's running on a ppc64 system - in this case the structs passed through 64bit-broken bluetooth HIDP ioctls are re-packed into the layout that's expected by the 64bit kernel.

I had to wrap ioctl HIDPCONNADD as well as HIDPGETCONNLIST, which also contains a pointer in its request struct.

The patch is tested on PowerPC 32bit and 64bit (Apple Powerbook G4 and PowerMac G5).
As a result hidd is working as expected now, my bluetooth keyboard and mouse are detected, connected, and appear as input devices.

It's of course possible that there are still other 64bit issues in the bluetooth API and -utils.

- Bernd