Subject: Re: PowerBook trackpad & USB mice?
To: None <port-macppc@netbsd.org>
From: John Valdes <valdes@uchicago.edu>
List: port-macppc
Date: 02/02/2001 19:39:04
On Fri, Feb 02, 2001 at 12:15:13AM -0500, Lennart Augustsson wrote:
> John Valdes wrote:
> 
> >      pseudo-device  wsmux   2
> >      wsmouse0 at ams? mux 0
> >      wsmouse* at ums? mux 0
> >
> >    Will this work w/ macppc (yes, I know, try it and see :) ).
> 
> That looks right.  Try it. :)

Yup, it works.  As another poster indicated, I needed to point Xmacppc
to /dev/wsmouse instead of /dev/wsmouse[0-3] (so I moved /dev/wsmouse0
out of the way and made a symlink /dev/wsmouse0 -> /dev/wsmouse).  I
can now use both the trackpad and the USB mouse under X (w/ all three
buttons on the mouse :) ).  However:

> USB devices can be hot plugged, and with the wsmux they will be picked
> up and used.

This doesn't seem to work for me.  I have to have the USB mouse
plugged in when I boot in order for X to pick it up.  Likewise, if I
unplug the mouse while under X and then plug it back in, it no longer
functions.  Do I have to run a command or do anything else when I plug
the mouse in?  Is it necessary to configure some other device (pseudo
or otherwise) into the kernel for this to work?

Even worse, though, now my keyboard doesn't work with X.  W/o changing
anything under /dev, X fails to startup at all, complaining that
there's no keyboard or mouse:

  X: open kbd/mouse: No such file or directory

If I run X under ktruss, I see:

  ...
  Xmacppc  open("/dev/wskbd0", 0x2, 0x1)	Err#16 EBUSY
  Xmacppc  open("/dev/wsmouse0", 0x2, 0x1)	= 0
  Xmacppc  open("/dev/wskbd1", 0x2, 0x1)	Err#6 ENXIO
  Xmacppc  open("/dev/wskbd2", 0x2, 0x1)	Err#6 ENXIO
  Xmacppc  open("/dev/wskbd3", 0x2, 0x1)	Err#6 ENXIO
  Xmacppc  open("/dev/wskbd4", 0x2, 0x1)	Err#2 ENOENT
  Xmacppc  open("/dev/wskbd5", 0x2, 0x1)	Err#2 ENOENT
  Xmacppc  open("/dev/wskbd6", 0x2, 0x1)	Err#2 ENOENT
  Xmacppc  open("/dev/wskbd7", 0x2, 0x1)	Err#2 ENOENT

If I then symlink /dev/wskbd0 -> /dev/wskbd, I can run X, but the
keyboard is ignored; actually, all my typing goes to the console shell
from which I started X, as I can see once I quit from X.  The wskbd is
configured in the kernel w/ the line:

  wskbd0  at akbd? console ? mux 1

Though at boot, I see:

  wskbd0 at akbd0 (mux 1 ignored for console): console keyboard

I've configured a kernel w/o the "mux 1" on the wskbd0 line, but I get
the same results.  If I try "wsconscfg -k", I get the same errors
Xmacppc does:

  prompt> wsconscfg -k 0
  wsconscfg: WSMUX_ADD_DEVICE: Device busy
  prompt> wsconscfg -k 1
  wsconscfg: WSMUX_ADD_DEVICE: Device not configured

Needless to say, no matter how well the mouse now works, X is pretty
useless w/o a keyboard... :)

Suggestions?

John