On Sat, 10 Mar 2007, Gene Heskett wrote: > >So these broken programs think that while talking to hiddev device, they > >are in fact receiving data from serial port, right? > I believe that to be the case, this code is very old and moldy.
That's quite sad. In fact, it would quite surprise me if that would work - i.e. I am not sure whether the data that the application will obtain from hiddev will have the same format that it is expecting to obtain from serial port of the UPS. Or do you think/experience different? > Its proprietary code, supplied by Belkin, either on their web page, or > on the cd that comes with it. No src's available, but I am beating on > their tech support on a daily basis, but I'm not getting through to > anybody who can do a 2*2 and get 4. The answers I'm getting seem to > indicate they are only getting 3, even for very large values of 2. :) :) > There is a rather huge case statement in hiddev.c. Is it possible to > expand this even further so that these illegal ioctls are acked with a > return 0, making this old moldy code happy in thinking its talking to a > uart based serial port when it tries to set the baud rates and such? This looks very dirty to me, to be frank. I don't like the idea of writing mess into the ioctl() handler just because of one application being horribly broken. I think there is alternative for you that can be done completely in userland, without seeding mess into the kernel driver - do you think it would be feasible that you create a trivial and small library, that would return 0 for those braindamaged ioctl() calls that your userland application is ussing, and will call the standard ioctl() when it is valid? This can be achieved trivially by LD_PRELOADing this library to the application. It is not nice either, but at least avoids putting mess into the kernel. Please let me know, -- Jiri Kosina ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV _______________________________________________ linux-usb-devel@lists.sourceforge.net To unsubscribe, use the last form field at: https://lists.sourceforge.net/lists/listinfo/linux-usb-devel