Re: Active PS/2 Multiplexing

2013-04-15 Thread mike
On Sun, 14 Apr 2013 10:57:04 +
Miod Vallat m...@online.fr wrote:

  Did you get any other feedback or test report? What was the previous
  issues preventing this for going in? I don't remember. 
 
 It used to not behave correctly after suspend, but that was fixed
 eventually. The main reason why this has never been commited was that
 none of the systems this diff had been tried on had a multiplexed
 device, except for Tobias' machine...
 

Hello,

This diff just solved my suspend/resume problem:
http://comments.gmane.org/gmane.os.openbsd.misc/203943

Is this going to eventually make it in the tree ?

Best regards,
Mike



Re: Active PS/2 Multiplexing

2013-04-15 Thread Tobias Stoeckmann
Hello mike, and hello list,

this is the first feedback I have received as of now, and nice to hear
that the diff helps someone else, too.  Having no negative feedback, I
would say it didn't hurt anyone out there (yet).

So if there are no further objections or feedback, I would go for the
diff and commit it soon.


Tobias

On Mon, Apr 15, 2013 at 09:51:33PM +0200, mike wrote:
 On Sun, 14 Apr 2013 10:57:04 +
 Miod Vallat m...@online.fr wrote:
 
   Did you get any other feedback or test report? What was the previous
   issues preventing this for going in? I don't remember. 
  
  It used to not behave correctly after suspend, but that was fixed
  eventually. The main reason why this has never been commited was that
  none of the systems this diff had been tried on had a multiplexed
  device, except for Tobias' machine...
  
 
 Hello,
 
 This diff just solved my suspend/resume problem:
 http://comments.gmane.org/gmane.os.openbsd.misc/203943
 
 Is this going to eventually make it in the tree ?
 
 Best regards,
 Mike



Re: Active PS/2 Multiplexing

2013-04-14 Thread Martin Pieuchot
On 01/04/13(Mon) 17:14, Tobias Stoeckmann wrote:
 Hi,
 
 this issue is already quite old, but let's see if anyone else has still
 issues with active PS/2 multiplexing.
 
 Active PS/2 multiplexing is a method to attach multiple input devices on
 your AUX PS/2 slot.  This should be as of today of no real use anymore,
 since it's easier to just add a USB device instead of getting into this
 mess ...
 
 But if you are as lucky as I am, you might have a laptop that uses this
 mechanism for your touchpad.  Without having this diff active, your
 touchpad will behave totally weird, like jumping cursors and random
 clicking whenever you touch it.  So if you suffer from that, give this
 patch a try.
 
 Would like to get some feedback!

I like this and as your previous versions it works for me on my vaio
laptop with a ALPS touchpad.

Did you get any other feedback or test report? What was the previous
issues preventing this for going in? I don't remember. 

fwiw you have my ok. 

Martin



Re: Active PS/2 Multiplexing

2013-04-14 Thread Miod Vallat
 Did you get any other feedback or test report? What was the previous
 issues preventing this for going in? I don't remember. 

It used to not behave correctly after suspend, but that was fixed
eventually. The main reason why this has never been commited was that
none of the systems this diff had been tried on had a multiplexed
device, except for Tobias' machine...



Active PS/2 Multiplexing

2013-04-01 Thread Tobias Stoeckmann
Hi,

this issue is already quite old, but let's see if anyone else has still
issues with active PS/2 multiplexing.

Active PS/2 multiplexing is a method to attach multiple input devices on
your AUX PS/2 slot.  This should be as of today of no real use anymore,
since it's easier to just add a USB device instead of getting into this
mess ...

But if you are as lucky as I am, you might have a laptop that uses this
mechanism for your touchpad.  Without having this diff active, your
touchpad will behave totally weird, like jumping cursors and random
clicking whenever you touch it.  So if you suffer from that, give this
patch a try.

Would like to get some feedback!


Tobias

PS: For the record and previously involved developers:  It's basically
Miod's old diff with my fix for suspend and resume to reactive multiplexing
if available.

Index: arch/hppa/gsc/gsckbc.c
===
RCS file: /var/www/cvs/src/sys/arch/hppa/gsc/gsckbc.c,v
retrieving revision 1.14
diff -u -p -r1.14 gsckbc.c
--- arch/hppa/gsc/gsckbc.c  10 Aug 2012 17:49:31 -  1.14
+++ arch/hppa/gsc/gsckbc.c  1 Apr 2013 14:56:22 -
@@ -469,7 +469,7 @@ pckbc_poll_data1(iot, ioh, ioh_c, slot, 
bus_space_tag_t iot;
bus_space_handle_t ioh, ioh_c;
pckbc_slot_t slot;
-   int checkaux;   /* ignored on hppa */
+   struct pckbc_internal *t;   /* ignored on hppa */
 {
int i;
u_char stat;
@@ -568,7 +568,7 @@ pckbc_flush(self, slot)
 {
struct pckbc_internal *t = self;
 
-   pckbc_poll_data1(t-t_iot, t-t_ioh_d, t-t_ioh_d, slot, 0);
+   pckbc_poll_data1(t-t_iot, t-t_ioh_d, t-t_ioh_d, slot, t);
 }
 
 int
@@ -580,7 +580,7 @@ pckbc_poll_data(self, slot)
struct pckbc_slotdata *q = t-t_slotdata[slot];
int c;
 
-   c = pckbc_poll_data1(t-t_iot, t-t_ioh_d, t-t_ioh_d, slot, 0);
+   c = pckbc_poll_data1(t-t_iot, t-t_ioh_d, t-t_ioh_d, slot, t);
if (c != -1  q  CMD_IN_QUEUE(q)) {
/* we jumped into a running command - try to
 deliver the response */
@@ -655,7 +655,7 @@ pckbc_poll_cmd1(t, slot, cmd)
return;
}
for (i = 10; i; i--) { /* 1s ??? */
-   c = pckbc_poll_data1(iot, ioh, ioh, slot, 0);
+   c = pckbc_poll_data1(iot, ioh, ioh, slot, t);
if (c != -1)
break;
}
@@ -696,7 +696,7 @@ pckbc_poll_cmd1(t, slot, cmd)
else
i = 10; /* 1s ??? */
while (i--) {
-   c = pckbc_poll_data1(iot, ioh, ioh, slot, 0);
+   c = pckbc_poll_data1(iot, ioh, ioh, slot, t);
if (c != -1)
break;
}
Index: dev/ic/i8042reg.h
===
RCS file: /var/www/cvs/src/sys/dev/ic/i8042reg.h,v
retrieving revision 1.5
diff -u -p -r1.5 i8042reg.h
--- dev/ic/i8042reg.h   18 Aug 2001 15:30:39 -  1.5
+++ dev/ic/i8042reg.h   1 Apr 2013 14:46:09 -
@@ -44,3 +44,17 @@
 #defineKC8_MENABLE 0x02/* enable mouse interrupt */
 #defineKC8_KENABLE 0x01/* enable keyboard interrupt */
 #defineCMDBYTE (KC8_TRANS|KC8_CPU|KC8_MENABLE|KC8_KENABLE)
+
+/*
+ * Defines for Active PS/2 Multiplexing
+ */
+
+#defineKBC_APM_ENB10xf0
+#defineKBC_APM_ENB20x56
+#defineKBC_APM_ENB30xa4
+
+#defineKBC_APM_DIS10xf0
+#defineKBC_APM_DIS20x56
+#defineKBC_APM_DIS30xa5
+
+#defineKBC_APM_PREFIX(p)   (0x90 | (p))
Index: dev/ic/pckbc.c
===
RCS file: /var/www/cvs/src/sys/dev/ic/pckbc.c,v
retrieving revision 1.33
diff -u -p -r1.33 pckbc.c
--- dev/ic/pckbc.c  15 Feb 2013 08:49:51 -  1.33
+++ dev/ic/pckbc.c  1 Apr 2013 15:03:38 -
@@ -105,8 +105,20 @@ void pckbc_poll(void *);
 int pckbc_cmdresponse(struct pckbc_internal *, pckbc_slot_t, u_char);
 void pckbc_start(struct pckbc_internal *, pckbc_slot_t);
 int pckbcintr_internal(struct pckbc_internal *, struct pckbc_softc *);
+int pckbc_enable_apm(struct pckbc_internal *);
+int pckbc_disable_apm(struct pckbc_internal *);
 
-const char *pckbc_slot_names[] = { kbd, aux };
+const char *pckbc_slot_names[] = {
+   kbd slot,
+#ifdef PCKBC_APM
+   aux slot #0,
+   aux slot #1,
+   aux slot #2,
+   aux slot #3,
+#else
+   aux slot
+#endif
+};
 
 #define KBC_DEVCMD_ACK 0xfa
 #define KBC_DEVCMD_RESEND  0xfe
@@ -137,31 +149,58 @@ pckbc_send_cmd(bus_space_tag_t iot, bus_
return (1);
 }
 
+/*
+ * NOTE: Active PS/2 Multiplexing behaviour is only checked if t != NULL.
+ * This behaviour is intentional.
+ */
 int
 pckbc_poll_data1(bus_space_tag_t iot, bus_space_handle_t ioh_d