* [Bluez-devel] hid2hci and Logitech Hub @ 2003-12-25 12:48 Alexander Holler 2003-12-25 14:37 ` Marcel Holtmann 0 siblings, 1 reply; 9+ messages in thread From: Alexander Holler @ 2003-12-25 12:48 UTC (permalink / raw) To: bluez-devel Hello, I've just tried hid2hic with my Logitech Hub. It doesn't work. After changing the vendor and product numbers, I receive -1 (errno: broken pipe) from the ioctl. Then I've tried some of the control transfers I've logged using SnoopyPro and Windows XP. None of them are working. I allways receive -1 (Device or resource busy). What makes me wonder is that in the windows logs, the transfers are allways of type 21 (out, class, interface), but hid2hci normally uses type 40 (out, vendor, device). Any pointers? Regards, Alexander ------------------------------------------------------- This SF.net email is sponsored by: IBM Linux Tutorials. Become an expert in LINUX or just sharpen your skills. Sign up for IBM's Free Linux Tutorials. Learn everything from the bash shell to sys admin. Click now! http://ads.osdn.com/?ad_id=1278&alloc_id=3371&op=click _______________________________________________ Bluez-devel mailing list Bluez-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/bluez-devel ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [Bluez-devel] hid2hci and Logitech Hub 2003-12-25 12:48 [Bluez-devel] hid2hci and Logitech Hub Alexander Holler @ 2003-12-25 14:37 ` Marcel Holtmann [not found] ` <30700000.1072366993@[192.168.207.2]> 0 siblings, 1 reply; 9+ messages in thread From: Marcel Holtmann @ 2003-12-25 14:37 UTC (permalink / raw) To: Alexander Holler; +Cc: BlueZ Mailing List Hi Alexander, > I've just tried hid2hic with my Logitech Hub. the hid2hci don't work for the Logitech Hub. It is for the HID proxy dongle from EPoX. > Then I've tried some of the control transfers I've logged using SnoopyPro > and Windows XP. None of them are working. I allways receive -1 (Device or > resource busy). > > What makes me wonder is that in the windows logs, the transfers are allways > of type 21 (out, class, interface), but hid2hci normally uses type 40 (out, > vendor, device). Logitech uses some specific HID reports to switch the device from HID to HCI mode. They use the report ID 16 for that and we also must send the same reports through hiddev interface of the USB HID driver, but by now I haven't figured out how to do it the right way. Regards Marcel ------------------------------------------------------- This SF.net email is sponsored by: IBM Linux Tutorials. Become an expert in LINUX or just sharpen your skills. Sign up for IBM's Free Linux Tutorials. Learn everything from the bash shell to sys admin. Click now! http://ads.osdn.com/?ad_id=1278&alloc_id=3371&op=click _______________________________________________ Bluez-devel mailing list Bluez-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/bluez-devel ^ permalink raw reply [flat|nested] 9+ messages in thread
[parent not found: <30700000.1072366993@[192.168.207.2]>]
* Re: [Bluez-devel] hid2hci and Logitech Hub [not found] ` <30700000.1072366993@[192.168.207.2]> @ 2003-12-25 16:28 ` Marcel Holtmann 2003-12-26 2:02 ` Alexander Holler 0 siblings, 1 reply; 9+ messages in thread From: Marcel Holtmann @ 2003-12-25 16:28 UTC (permalink / raw) To: Alexander Holler; +Cc: BlueZ Mailing List Hi Alexander, make sure that you always post also the answers to the mailing list ;) > > Logitech uses some specific HID reports to switch the device from HID to > > HCI mode. They use the report ID 16 for that and we also must send the > > same reports through hiddev interface of the USB HID driver, but by now > > I haven't figured out how to do it the right way. > > Ah, thanks, then I've got allways 'device busy' because the hid-driver uses > the interface. > As I've just found an example to send HID reports, I will try if I have > luck finding the correct sequence. I think it will be this one 0x10, 0xff, 0x81, 0x80, 0x00, 0x00, 0x00 The 0x10 is the report ID. > PS: 2.6 and the patch for 2.6 still oops when I disable the > bluetooth-device of my nb. Commenting out release of the isoc_iface (which > is still done automacally) helps. I will write these days a report to the > usb-helpline. For now simply compile your kernel without USB SCO support. I still haven't found the time to look deeper into it. > PPS: Is there anywhere a irc channel or jabber conference for > bluez-users/devels? Not that I know of. > PPPS: I would prefer /usr/local as preset prefix for installing the lib2 > (and the headers). ;) I prefer /usr, but that is no problem anyway. Use --prefix ;) > PPPPS: In a report to Logitech about some problems with the DiNovo (The > device shows 12-hour format instead 24-hour format) I've asked them too > about some help switching the hub. Maybe I will get an answer, because that > should reach one of the developers. The first answer from them was > deinstall and reinstall, but deinstalling the widcomm-stack doesn't switch > back the hub to hid-modus, so I haven't a chance to interact with my > computer (for reset) after the stack was deinstalled. So my second report > where I've asked about how to switch the hub could reach someone with > enough knowledge. ;) Keep me informed if you got any success. > I would be nice using the MediaPad under Linux, showing important messages > on the lcd. ;) That is not really hard to achieve. I already reverse engineered most of the protocol they use on report ID 16 and 17, but I don't found the time to write it up. Regards Marcel ------------------------------------------------------- This SF.net email is sponsored by: IBM Linux Tutorials. Become an expert in LINUX or just sharpen your skills. Sign up for IBM's Free Linux Tutorials. Learn everything from the bash shell to sys admin. Click now! http://ads.osdn.com/?ad_id=1278&alloc_id=3371&op=click _______________________________________________ Bluez-devel mailing list Bluez-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/bluez-devel ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [Bluez-devel] hid2hci and Logitech Hub 2003-12-25 16:28 ` Marcel Holtmann @ 2003-12-26 2:02 ` Alexander Holler 2003-12-26 2:44 ` Marcel Holtmann 0 siblings, 1 reply; 9+ messages in thread From: Alexander Holler @ 2003-12-26 2:02 UTC (permalink / raw) To: bluez-devel Hi Marcel, --On Donnerstag, Dezember 25, 2003 17:28:42 +0100 Marcel Holtmann <marcel@holtmann.org> wrote: > make sure that you always post also the answers to the mailing list ;) I though that's nothing from interrest for the mailing list. ;) >> > Logitech uses some specific HID reports to switch the device from HID >> > to HCI mode. They use the report ID 16 for that and we also must send >> > the same reports through hiddev interface of the USB HID driver, but >> > by now I haven't figured out how to do it the right way. > > I think it will be this one > > 0x10, 0xff, 0x81, 0x80, 0x00, 0x00, 0x00 > > The 0x10 is the report ID. As the report info for 0x10 shows 1 field and the maxusage from that field is 1, it seems there is no way sending 6 bytes (usages?) with one report 0x10 using hiddev (if I have understood that part of hiddev correct ;) ). I've tried sending 6 reports (0x10) with the values 0xff ... 0x00. That hasn't worked (allways remember, I've just started collecting some knowledge of usb, bluetooth and hid ;) ). >> PS: 2.6 and the patch for 2.6 still oops when I disable the >> bluetooth-device of my nb. Commenting out release of the isoc_iface >> (which is still done automacally) helps. I will write these days a >> report to the usb-helpline. > > For now simply compile your kernel without USB SCO support. I still > haven't found the time to look deeper into it. Just remove or comment out the release of the isoc_iface. The release isn't needed and that avoids the oops. ;) > That is not really hard to achieve. I already reverse engineered most of > the protocol they use on report ID 16 and 17, but I don't found the time > to write it up. Nice to hear. I will ask you after I got the hub working as hci. ;) Regards, Alexander ------------------------------------------------------- This SF.net email is sponsored by: IBM Linux Tutorials. Become an expert in LINUX or just sharpen your skills. Sign up for IBM's Free Linux Tutorials. Learn everything from the bash shell to sys admin. Click now! http://ads.osdn.com/?ad_id=1278&alloc_id=3371&op=click _______________________________________________ Bluez-devel mailing list Bluez-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/bluez-devel ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [Bluez-devel] hid2hci and Logitech Hub 2003-12-26 2:02 ` Alexander Holler @ 2003-12-26 2:44 ` Marcel Holtmann 2003-12-26 4:26 ` Alexander Holler 0 siblings, 1 reply; 9+ messages in thread From: Marcel Holtmann @ 2003-12-26 2:44 UTC (permalink / raw) To: Alexander Holler; +Cc: BlueZ Mailing List Hi Alexander, > I though that's nothing from interrest for the mailing list. ;) you start this thread on the mailing list, so keep it there ;) > As the report info for 0x10 shows 1 field and the maxusage from that field > is 1, it seems there is no way sending 6 bytes (usages?) with one report > 0x10 using hiddev (if I have understood that part of hiddev correct ;) ). I can't tell you how it is with hiddev, but the report ID 16 has six bytes and the report ID 17 has 19 bytes. Count for yourself. Usage Page (Undefined) Usage (0x01) Collection (Application) Report ID (16) Report Size (8) Report Count (6) Logical Minimum (0) Logical Maximum (65535) Usage (0x01) Input (0x0000) Usage (0x01) Output (0x0000) End Collection Usage Page (Undefined) Usage (0x02) Collection (Application) Report ID (17) Report Size (8) Report Count (19) Logical Minimum (0) Logical Maximum (65535) Usage (0x02) Input (0x0000) Usage (0x02) Output (0x0000) End Collection > I've tried sending 6 reports (0x10) with the values 0xff ... 0x00. That > hasn't worked (allways remember, I've just started collecting some > knowledge of usb, bluetooth and hid ;) ). With what kind of code? > Just remove or comment out the release of the isoc_iface. The release isn't > needed and that avoids the oops. ;) Trust me that it is better to check it in detail. You always have to know why you are doing some things this way and I don't know it right now. Regards Marcel ------------------------------------------------------- This SF.net email is sponsored by: IBM Linux Tutorials. Become an expert in LINUX or just sharpen your skills. Sign up for IBM's Free Linux Tutorials. Learn everything from the bash shell to sys admin. Click now! http://ads.osdn.com/?ad_id=1278&alloc_id=3371&op=click _______________________________________________ Bluez-devel mailing list Bluez-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/bluez-devel ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [Bluez-devel] hid2hci and Logitech Hub 2003-12-26 2:44 ` Marcel Holtmann @ 2003-12-26 4:26 ` Alexander Holler 2003-12-26 15:06 ` Marcel Holtmann 0 siblings, 1 reply; 9+ messages in thread From: Alexander Holler @ 2003-12-26 4:26 UTC (permalink / raw) To: BlueZ Mailing List Hi Marcel, --On Freitag, Dezember 26, 2003 03:44:13 +0100 Marcel Holtmann <marcel@holtmann.org> wrote: >> As the report info for 0x10 shows 1 field and the maxusage from that >> field is 1, it seems there is no way sending 6 bytes (usages?) with one >> report 0x10 using hiddev (if I have understood that part of hiddev >> correct ;) ). > > I can't tell you how it is with hiddev, but the report ID 16 has six > bytes and the report ID 17 has 19 bytes. Count for yourself. > > Usage Page (Undefined) > Usage (0x01) > Collection (Application) > Report ID (16) > Report Size (8) > Report Count (6) > Logical Minimum (0) > Logical Maximum (65535) > Usage (0x01) > Input (0x0000) > Usage (0x01) > Output (0x0000) > End Collection > > Usage Page (Undefined) > Usage (0x02) > Collection (Application) > Report ID (17) > Report Size (8) > Report Count (19) > Logical Minimum (0) > Logical Maximum (65535) > Usage (0x02) > Input (0x0000) > Usage (0x02) > Output (0x0000) > End Collection Hmm, such an report I've searched. How to do you got this? I've used the HIDIOCGREPORTINFO and HIDIOCGFIELDINFO ioctl from hiddev. There is an example ( http://www.frogmouth.net/hid-doco/examples/hiddev-misc/dump-events.c ) which output prints the same as my findings: Report id: 16 (1 fields) Field: 0: app: ff000001 phys 0000 flags 0 (1 usages) unit 0 exp 0 Usage: ff000001 val 255 idx 0 >> I've tried sending 6 reports (0x10) with the values 0xff ... 0x00. That >> hasn't worked (allways remember, I've just started collecting some >> knowledge of usb, bluetooth and hid ;) ). > > With what kind of code? Looking at hiddev.c and the documentation I've found, normally it should work with that code: -------------------------- #include <fcntl.h> #include <stdio.h> #include <sys/ioctl.h> #include <asm/types.h> #include <linux/hiddev.h> int main(void) { char switch_sequence[] = { 0xff, 0x81, 0x80, 0x00, 0x00, 0x00 }; struct hiddev_report_info rinfo; struct hiddev_usage_ref uref; struct hiddev_field_info finfo; int fd; if ((fd = open("/dev/usb/hid/hiddev0", O_RDONLY)) <= 0) { // I have only one hiddev printf("error opening device\n"); return 1; } int rc=ioctl(fd, HIDIOCINITREPORT,0); printf("rc: %d\n", rc); if(rc) perror(NULL); memset( &rinfo, 0, sizeof(rinfo) ); rinfo.report_type = HID_REPORT_TYPE_OUTPUT; rinfo.report_id = 0x10; rc=ioctl(fd, HIDIOCGREPORTINFO, &rinfo); printf("rc: %d\n", rc); if(rc) perror(NULL); printf("rinfo.num_fields: %u\n", rinfo.num_fields); memset( &finfo, 0, sizeof(finfo) ); finfo.report_type=HID_REPORT_TYPE_OUTPUT; finfo.report_id=0x10; finfo.field_index=0; rc=ioctl(fd, HIDIOCGFIELDINFO, &finfo); printf("rc: %d\n", rc); if(rc) perror(NULL); printf("finfo.maxusage: %u\n", finfo.maxusage); int i; for(i=0; i< 6; ++i ) { memset( &uref, 0, sizeof(uref) ); uref.report_type = HID_REPORT_TYPE_OUTPUT; uref.report_id = 0x10; uref.field_index = i; uref.usage_index = 0; uref.usage_code = 0 ; uref.value = switch_sequence[i]; rc=ioctl(fd, HIDIOCSUSAGE, &uref); printf("rc: %d\n", rc); if(rc) perror(NULL); } memset( &rinfo, 0, sizeof(rinfo) ); rinfo.report_type = HID_REPORT_TYPE_OUTPUT; rinfo.report_id = 0x10; rinfo.num_fields = 6; rc=ioctl(fd, HIDIOCSREPORT, &rinfo); printf("rc: %d\n", rc); if(rc) perror(NULL); close(fd); return 0; } -------------------------- The above doesn't work. I've also tried to increment usage_index, which doesn't work too (as the code in hiddev.c shows too). But reading other messages on the usb-ml it seems I'm not the only one having problems sending multiples bytes with hiddev. The next thing I will try, is using usbfs, but first I have to read how. ;) >> Just remove or comment out the release of the isoc_iface. The release >> isn't needed and that avoids the oops. ;) > > Trust me that it is better to check it in detail. You always have to > know why you are doing some things this way and I don't know it right > now. Surely, but the comment to usb_driver_release_interface clearly says the call of that function in hci_usb.c is not needed: ------------- * When the USB subsystem disconnect()s a driver from some interface, * it automatically invokes this method for that interface. That * means that even drivers that used usb_driver_claim_interface() * usually won't need to call this. ----------------- So removing it, isn't wrong and it avoids the oops. ;) I think that maybe something is released twice. I've digged somewhat deeper into the usb code, but haven't find something. So I will this left 'as an excercise for the reader'. Choke, I will report it to the usb-ml. ;) Regards, Alexander ------------------------------------------------------- This SF.net email is sponsored by: IBM Linux Tutorials. Become an expert in LINUX or just sharpen your skills. Sign up for IBM's Free Linux Tutorials. Learn everything from the bash shell to sys admin. Click now! http://ads.osdn.com/?ad_id=1278&alloc_id=3371&op=click _______________________________________________ Bluez-devel mailing list Bluez-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/bluez-devel ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [Bluez-devel] hid2hci and Logitech Hub 2003-12-26 4:26 ` Alexander Holler @ 2003-12-26 15:06 ` Marcel Holtmann 2003-12-26 16:49 ` Alexander Holler 0 siblings, 1 reply; 9+ messages in thread From: Marcel Holtmann @ 2003-12-26 15:06 UTC (permalink / raw) To: Alexander Holler; +Cc: BlueZ Mailing List Hi Alexander, > Hmm, such an report I've searched. How to do you got this? I decoded the HID report descriptor of the HID mouse interface. > But reading other messages on the usb-ml it seems I'm not the only one > having problems sending multiples bytes with hiddev. The complete hiddev interface is a mess and I even don't understand the basic parts at the moment. > The next thing I will try, is using usbfs, but first I have to read how. ;) Won't work until you unload the USB HID driver and this is not what we want to do. The only way is hiddev :( > Surely, but the comment to usb_driver_release_interface clearly says the > call of that function in hci_usb.c is not needed: > > ------------- > * When the USB subsystem disconnect()s a driver from some interface, > * it automatically invokes this method for that interface. That > * means that even drivers that used usb_driver_claim_interface() > * usually won't need to call this. > ----------------- > > So removing it, isn't wrong and it avoids the oops. ;) This is wrong, because it is only invoked for the interface that is probed. It is not invoked for the additional interface we claim with SCO audio support. Leaving this command out only works in the case you unplug the device. If you only unload the driver you got trouble in the USB subsystem. > I think that maybe something is released twice. I've digged somewhat deeper > into the usb code, but haven't find something. So I will this left 'as an > excercise for the reader'. Choke, I will report it to the usb-ml. ;) Our code is correct and it works perfect with my OHCI controller. It only hard lock the system if I plug the device into the UHCI controller on my motherboard. 00:1f.2 USB Controller: Intel Corp. 82801BA/BAM USB (Hub #1) (rev 12) 00:1f.4 USB Controller: Intel Corp. 82801BA/BAM USB (Hub #2) (rev 12) 02:0c.0 USB Controller: NEC Corporation USB (rev 43) 02:0c.1 USB Controller: NEC Corporation USB (rev 43) 02:0c.2 USB Controller: NEC Corporation USB 2.0 (rev 04) The Intel one is the onboard UHCI controller and the NEC is a USB 2.0 PCI card that also includes and USB 1.1 OHCI controller. Regards Marcel ------------------------------------------------------- This SF.net email is sponsored by: IBM Linux Tutorials. Become an expert in LINUX or just sharpen your skills. Sign up for IBM's Free Linux Tutorials. Learn everything from the bash shell to sys admin. Click now! http://ads.osdn.com/?ad_id=1278&alloc_id=3371&op=click _______________________________________________ Bluez-devel mailing list Bluez-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/bluez-devel ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [Bluez-devel] hid2hci and Logitech Hub 2003-12-26 15:06 ` Marcel Holtmann @ 2003-12-26 16:49 ` Alexander Holler 2003-12-26 19:15 ` Marcel Holtmann 0 siblings, 1 reply; 9+ messages in thread From: Alexander Holler @ 2003-12-26 16:49 UTC (permalink / raw) To: BlueZ Mailing List Hi Marcel, --On Freitag, Dezember 26, 2003 16:06:43 +0100 Marcel Holtmann <marcel@holtmann.org> wrote: >> Hmm, such an report I've searched. How to do you got this? > > I decoded the HID report descriptor of the HID mouse interface. > The complete hiddev interface is a mess and I even don't understand the > basic parts at the moment. I've looked somewhat deeper into it. When your description is right, it seems that the problem is in the usb-hid-parser. According to your discovery, the report 16 should have 6 fields, each 8 bits wide (I've read some hid-pages ;) ). I've now put some printk's to hid_register_field in hid-core.c, the parser only registers only one field for report 16. So hiddev is correct and it complains about trying to send 6 fields with report 16. Isn't there any free parser for Windows which outputs the report descriptions (just for checking before looking deeper into the linux parser)? Regards, Alexander ------------------------------------------------------- This SF.net email is sponsored by: IBM Linux Tutorials. Become an expert in LINUX or just sharpen your skills. Sign up for IBM's Free Linux Tutorials. Learn everything from the bash shell to sys admin. Click now! http://ads.osdn.com/?ad_id=1278&alloc_id=3371&op=click _______________________________________________ Bluez-devel mailing list Bluez-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/bluez-devel ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [Bluez-devel] hid2hci and Logitech Hub 2003-12-26 16:49 ` Alexander Holler @ 2003-12-26 19:15 ` Marcel Holtmann 0 siblings, 0 replies; 9+ messages in thread From: Marcel Holtmann @ 2003-12-26 19:15 UTC (permalink / raw) To: Alexander Holler; +Cc: BlueZ Mailing List Hi Alexander, > I've looked somewhat deeper into it. When your description is right, it > seems that the problem is in the usb-hid-parser. According to your > discovery, the report 16 should have 6 fields, each 8 bits wide (I've read > some hid-pages ;) ). it have 6 fields, each 8 bits wide. Logitech uses the same report for control of the Mediapad and I already have proven that it works. > I've now put some printk's to hid_register_field in hid-core.c, the parser > only registers only one field for report 16. So hiddev is correct and it > complains about trying to send 6 fields with report 16. So the HID parser must be fixed first. Keep on looking at it. > Isn't there any free parser for Windows which outputs the report > descriptions (just for checking before looking deeper into the linux > parser)? I don't know of anyone. Regards Marcel ------------------------------------------------------- This SF.net email is sponsored by: IBM Linux Tutorials. Become an expert in LINUX or just sharpen your skills. Sign up for IBM's Free Linux Tutorials. Learn everything from the bash shell to sys admin. Click now! http://ads.osdn.com/?ad_id=1278&alloc_id=3371&op=click _______________________________________________ Bluez-devel mailing list Bluez-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/bluez-devel ^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2003-12-26 19:15 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-12-25 12:48 [Bluez-devel] hid2hci and Logitech Hub Alexander Holler
2003-12-25 14:37 ` Marcel Holtmann
[not found] ` <30700000.1072366993@[192.168.207.2]>
2003-12-25 16:28 ` Marcel Holtmann
2003-12-26 2:02 ` Alexander Holler
2003-12-26 2:44 ` Marcel Holtmann
2003-12-26 4:26 ` Alexander Holler
2003-12-26 15:06 ` Marcel Holtmann
2003-12-26 16:49 ` Alexander Holler
2003-12-26 19:15 ` Marcel Holtmann
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.