Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 3 May 2011 12:36:51 -0700
From:      Maksim Yevmenkin <maksim.yevmenkin@gmail.com>
To:        David Demelier <demelier.david@gmail.com>
Cc:        freebsd-bluetooth@freebsd.org
Subject:   Re: Bluetooth mouse does not connect after reboot
Message-ID:  <BANLkTimHnsfCBob_DByxMd3CjtKw7K41LA@mail.gmail.com>
In-Reply-To: <4DC0563D.7080005@gmail.com>
References:  <4D3889D2.80508@gmail.com> <201101202043.p0KKhDIB076736@lurza.secnetix.de> <AANLkTindTyEBAgGV3cBcSs6tGMtN8JtQ3_sHOF4n%2BnEs@mail.gmail.com> <4DBF0D26.8020703@gmail.com> <BANLkTi=dYv5R6jkqNhTj6m%2BZHK=afLXvow@mail.gmail.com> <4DC0513A.5000805@gmail.com> <BANLkTikeiZ61NwRSRh7xNqMTy97soxjc_A@mail.gmail.com> <4DC0563D.7080005@gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
--000325556f3afd23bd04a264423e
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

On Tue, May 3, 2011 at 12:23 PM, David Demelier
<demelier.david@gmail.com> wrote:
>>>>> I'm sorry to disturb you again.. I'm still guessin where to search ho=
w
>>>>> to
>>>>> get these horizontal events with my bluetooth mouse. I thing the
>>>>> mouse_info
>>>>> structure does not need to be extended I have a USB mouse that has th=
e
>>>>> same
>>>>> horizontal buttons and they just works !
>>>>>
>>>>> They sends 7 and 8 events to X (checked with xev)
>>>>>
>>>>> What can I do to extend bthidd and this button support ?
>>>>
>>>> like i said before, you need to decode AC_Pan data from the report. i
>>>> just took a quick look at ums(4) driver and, it appears, that AC_Pan
>>>> events are translated into button events, i.e. values< =A0 =A00 is mas=
k (1
>>>> << =A0 =A03) and values> =A0 =A00 is mask (1<< =A0 =A04) . you can add=
 identical
>>>> translation to bthidd(8) to see if it works. you will need to modify
>>>> hid_interrupt() function in hid.c
>>>
>>> Max,
>>>
>>> I successfully made the patch but it's not the same mask. This diff jus=
t
>>> works!
>>>
>>> --- hid.c.orig =A02011-05-02 22:09:48.000000000 +0200
>>> +++ hid.c =A0 =A0 =A0 2011-05-03 20:57:46.000000000 +0200
>>> @@ -168,6 +168,16 @@
>>> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0usage =3D HID_USAGE(h.usage);
>>> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0val =3D hid_get_data(data,&h);
>>>
>>> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 /* Horizontal buttons */
>>> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 if (page =3D=3D HUP_CONSUMER&& =A0usage =
=3D=3D HUC_AC_PAN) {
>>> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 if (val< =A00)
>>> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 mouse_but=
t |=3D (1<< =A05);
>>> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 else if (val> =A00)
>>> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 mouse_but=
t |=3D (1<< =A06);
>>> +
>>> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 mevents ++;
>>> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 }
>>> +
>>> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0switch (page) {
>>> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0case HUP_GENERIC_DESKTOP:
>>> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0switch (usage) {
>>>
>>> Do you think it's a diff suitable to commit ?
>>>
>>> I'm so happy to make my horizontal buttons working :):)
>>
>> ah, i see you already figured it out :) i can commit something like
>> this, i suppose. i would just move the statement into switch() below.
>> i suppose we could just document that ac_pan is encoded as 8 and 9
>> button presses.
>>
>
> Yes but why is the mask different from the ums ones ? Also can you commit
> this to -STABLE thus I'll be able to use it without patching it.

i *think* its because usb mouse operates on level1 (see mouse(4) for
details), and, status for "extended" mouse buttons reported
separately, i.e. from mouse(4) man page: byte 8, bits 0-6 reflect the
state of the buttons 4-10.

i can not commit this directly to -stable. i need to commit this to
-head first and then mfc it after a week or so.

i'm attaching a slightly different patch (dont worry you still get all
the credit). please try it and let me know if it works for you.

thanks,
max

--000325556f3afd23bd04a264423e
Content-Type: text/plain; charset=US-ASCII; name="bthidd.diff.txt"
Content-Disposition: attachment; filename="bthidd.diff.txt"
Content-Transfer-Encoding: base64
X-Attachment-Id: f_gn98n4at0

SW5kZXg6IGhpZC5jCj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT0KLS0tIGhpZC5jCShyZXZpc2lvbiAyMjE0MDApCisrKyBo
aWQuYwkod29ya2luZyBjb3B5KQpAQCAtMjI5LDYgKzIyOSwxNiBAQAogCQkJCWJyZWFrOwogCiAJ
CQlzd2l0Y2ggKHVzYWdlKSB7CisJCQljYXNlIEhVQ19BQ19QQU46CisJCQkJLyogSG9yaXpvbnRh
bCBzY3JvbGwgKi8KKwkJCQlpZiAodmFsIDwgMCkKKwkJCQkJbW91c2VfYnV0dCB8PSAoMSA8PCA1
KTsKKwkJCQllbHNlCisJCQkJCW1vdXNlX2J1dHQgfD0gKDEgPDwgNik7CisKKwkJCQltZXZlbnRz
ICsrOworCQkJCWJyZWFrOworCiAJCQljYXNlIDB4YjU6IC8qIFNjYW4gTmV4dCBUcmFjayAqLwog
CQkJCXZhbCA9IDB4MTk7CiAJCQkJYnJlYWs7Cg==
--000325556f3afd23bd04a264423e--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?BANLkTimHnsfCBob_DByxMd3CjtKw7K41LA>