Skip to contentSkip to conversation

USB mouse kernel patch for Lombard gpm multiple mice support

DISCUSSION David King 2 participants 2 messages Sep 2, 1999

lore
Share & tools
lore

David King

author
#0 lore raw

I've been lurking on this list for tips on getting my Lombard to work nicely under Linux. Using the latest stable samba rsync sources I've been able to build a kernel which does accelerated X, ethernet, sleeping, and
USB. The only thing left preventing me from being comfortable was one
quirk.

Unlike other mouse drivers, the USB mouse device driver can only be openned if a mouse is attached. This makes using gpm in multiple mouse mode on a laptop difficult as sometimes I'd like to work without the USB mouse attached. It seemed wrong to have to restart gpm to make this change so without further ado here is my kernel patch to drivers/usb/mouse.c

-David
[email protected]

*** mouse.c.19990902 Wed Jul 28 20:37:13 1999
--- mouse.c Thu Sep 2 14:42:45 1999
***************
*** 6,11 ****
--- 6,16 ----
*
* Brad Keryan 4/3/1999
*

+  * (dsmk) David King 9/2/1999 - rewrote mouse detect logic so that client 
+  * programs such as gpm can open the mouse device even though there is
+  * currently no mouse detected.  This enables one to use gpm's multiple 
+  * mouse software with USB mice with hotswapping on my Powerbook G3 1999.
+  * 

* version 0.20: Linus rewrote read_mouse() to do PS/2 and do it
* correctly. Events are added together, not queued, to keep the rodent sober. *
***************
*** 128,135 ****

  {
        struct mouse_state *mouse = &static_mouse_state;

! if (!mouse->present)

!               return -EINVAL;
        if (mouse->active++)
                return 0;
        /* flush state */
--- 133,144 ----
  {
        struct mouse_state *mouse = &static_mouse_state;

! /* no longer bomb out when mouse is not present. Instead

!        * we wait producing no data until a mouse is present
!        * -dsmk 9/2/1999
!        */
!       /*if (!mouse->present)
!         return -EINVAL; */
        if (mouse->active++)
                return 0;
        /* flush state */
***************
*** 139,145 ****
        MOD_INC_USE_COUNT;
  
        /* start the usb controller's polling of the mouse */

! mouse->irq_handle = usb_request_irq(mouse->dev, usb_rcvctrlpipe(mouse->d
ev, mouse->bEndpointAddress), mouse_irq, mouse->bInterval, NULL);

        return 0;
  }
--- 148,158 ----
        MOD_INC_USE_COUNT;
  
        /* start the usb controller's polling of the mouse */

! /* only do this if we have a mouse already
! * -dsmk 9/2/1999
! */
! if (mouse->present)
! mouse->irq_handle = usb_request_irq(mouse->dev, usb_rcvctrlpipe(mouse-

Quoted 1 line

dev, mouse->bEndpointAddress), mouse_irq, mouse->bInterval, NULL);

        return 0;

}
***************
*** 305,311 ****
--- 318,333 ----

        mouse->bEndpointAddress = endpoint->bEndpointAddress;
        mouse->bInterval = endpoint->bInterval;

+ /* if we did not have a mouse before then we need to set up an

+        * irq if someone already has the mouse active
+        * -dsmk 9/2/1999
+        */

+ if (! mouse->present && mouse->active) {
+ mouse->irq_handle = usb_request_irq(mouse->dev, usb_rcvctrlpipe(mouse-

Quoted 1 line

dev, mouse->bEndpointAddress), mouse_irq, mouse->bInterval, NULL);

+ }
+

        mouse->present = 1;
+ 
        return 0;

}

----
David King, Boston University Distributed Systems Programmer at large [email protected]
(617) 353-8250

[[ This message was sent via the linuxppc-dev mailing list. Replies are ]] [[ not forced back to the list, so be sure to Cc linuxppc-dev if your ]] [[ reply is of general interest. Please check http://lists.linuxppc.org/ ]]
[[ and http://www.linuxppc.org/ for useful information before posting. ]]

#1 lore raw
Quoted 5 lines · David King

I've been lurking on this list for tips on getting my Lombard to work nicely under Linux. Using the latest stable samba rsync sources I've been able to build a kernel which does accelerated X, ethernet, sleeping, and
USB. The only thing left preventing me from being comfortable was one
quirk.

I've been working towards a very similar goal (333 MHz Lombard I just got yesterday). Unfortunately, I'm still kinda stuck on _which_ kernel tree I'm supposed to be using. I'm pretty handy with patch, and I've become aware of the issues with the bmac driver (broken in some 2.2.10 kernels, fixed in vger) and the atyfb, but I've still got a few things I've got to work out.

I have X working at 1024x768 at 32bpp with the cfb32 (unaccelerated driver). It performs decently, but I'd like the accelerated driver. I'll get that working later.

I have a 3 button USB mouse (Logitech WingMan) I'd like to use with X, but I can't seem to find a kernel that will (1) not pull a Machine check error when I build it (raw vger does this) and (2) FIND my USB mouse. The lombard.vmlinux that I'm using (from linuxppc.org) loads the USB code segments, but plugging in a mouse dumps a bunch of stuff to the console:

get_descriptor failed, waiting
[...]
giving up

Wondered if you'd seen that and know of a fix for it. I'm building a kernel as modules now to see if that makes a difference.

=== on to the real question ===

Feel free to ignore the USB ramblings above, I think I can figure them out, I just want to know what kernel tree source you're using. :)

Is it paul's linux-pmac with patches, or is it vger (current CVS from, say cvs.on.openprojects.net) with some patches, etc? Also, would you be so kind as to send your kernel config my way, so I can pick out the settings for the USB devices and atyfb?

Right now I'm using my own kernels from the linux-pmac 2.2.10 with a patched bmac. Ethernet works great, atyfb isn't recognizing my devices, and USB is throwing those errors. I figure I'd better figure out which tree is working for people. :)

Signature · 6 lines
Shaw Terwilliger ([email protected])

[[ This message was sent via the linuxppc-dev mailing list.  Replies are ]]
[[ not  forced  back  to the list, so be sure to Cc linuxppc-dev if your ]]
[[ reply is of general interest. Please check http://lists.linuxppc.org/ ]]
[[ and http://www.linuxppc.org/ for useful information before posting.   ]]