typo in icmp6(4)

2011-05-07 Thread Andreas Bartelt
Hello,

I've noticed a typo in the icmp6(4) man page regarding icmp6 type 4 code 
2. Diff is attached.

According to the (informational) RFC 4890 this kind of icmp6 message 
must not be dropped for the correct functioning of IPv6. Is there a key 
word planned for this icmp6 code which could be used in PF?

Best regards,
Andreas
Index: share/man/man4/icmp6.4
===
RCS file: /usr/cvsync/cvs/src/share/man/man4/icmp6.4,v
retrieving revision 1.23
diff -u -r1.23 icmp6.4
--- share/man/man4/icmp6.4  8 Dec 2009 07:57:57 -   1.23
+++ share/man/man4/icmp6.4  7 May 2011 19:05:11 -
@@ -126,7 +126,7 @@
 .It 1 Ta reassemb Ta timex Ta Time exceeded in reassembly
 .It 0 Ta badhead Ta paramprob Ta Erroneous header field
 .It 1 Ta nxthdr Ta paramprob Ta Unrecognized next header
-.It 2 Ta  Ta redir Ta Unrecognized option
+.It 2 Ta  Ta paramprob Ta Unrecognized option
 .It 0 Ta redironlink Ta redir Ta Redirection to on-link node
 .It 1 Ta redirrouter Ta redir Ta Redirection to better router
 .El



Synaptics touchpad

2011-05-07 Thread Alexandr Shadchin
Hi,

Default touchpad behaves as mouse (compatible with xf86-input-mouse)
for full power need used xf86-input-synaptics. 

Please check work of touchpad in compat mode (xf86-input-mouse),
who are interested check xf86-input-synaptics.

Driver xf86-input-synaptics need to build manually:

update src and xenocara tree
cd /usr/src
make obj includes
cd /usr/xenocara/driver/xf86-input-synaptics
make -f Makefile.bsd-wrapper obj build

-- 
Alexandr Shadchin

Index: pms.c
===
RCS file: /cvs/src/sys/dev/pckbc/pms.c,v
retrieving revision 1.18
diff -u -p -r1.18 pms.c
--- pms.c   3 Jan 2011 19:46:34 -   1.18
+++ pms.c   7 May 2011 21:27:46 -
@@ -28,6 +28,7 @@
 #include sys/systm.h
 #include sys/device.h
 #include sys/ioctl.h
+#include sys/malloc.h
 
 #include machine/bus.h
 
@@ -40,12 +41,15 @@
 
 #define DEVNAME(sc)((sc)-sc_dev.dv_xname)
 
+#define WSMOUSE_BUTTON(x)  (1  ((x) - 1))
+
 struct pms_softc;
 
 struct pms_protocol {
int type;
 #define PMS_STANDARD   0
 #define PMS_INTELLI1
+#define PMS_SYNAPTICS  2
u_int packetsize;
int (*enable)(struct pms_softc *);
int (*ioctl)(struct pms_softc *, u_long, caddr_t, int, struct proc *);
@@ -54,6 +58,30 @@ struct pms_protocol {
void (*disable)(struct pms_softc *);
 };
 
+struct synaptics_softc {
+   int identify;
+   int capabilities, ext_capabilities;
+   int model, ext_model;
+   int resolution, dimension;
+
+   int mode;
+
+   int res_x, res_y;
+   int min_x, min_y;
+   int max_x, max_y;
+
+   /* Compat mode */
+   int wsmode;
+   int old_x, old_y;
+   int count;
+#define SYNAPTICS_COUNT2
+#define SYNAPTICS_SCALE4
+#define SYNAPTICS_PRESSURE 30
+#define SYNAPTICS_MAXSPEED 30
+
+   int dev_pt_attach;
+};
+
 struct pms_softc { /* driver status information */
struct device sc_dev;
 
@@ -64,56 +92,48 @@ struct pms_softc {  /* driver status inf
 #define PMS_STATE_ENABLED  1
 #define PMS_STATE_SUSPENDED2
 
+   int sc_dev_enable;
+#define PMS_DEV_IGNORE 0x00
+#define PMS_DEV_PRIMARY0x01
+#define PMS_DEV_SECONDARY  0x02
+
int poll;
int inputstate;
+   int is_touchpad;
 
const struct pms_protocol *protocol;
+   struct synaptics_softc *synaptics;
 
u_char packet[8];
 
struct device *sc_wsmousedev;
+   struct device *sc_pt_wsmousedev;
 };
 
-#define PMS_BUTTON1DOWN0x0001  /* left */
-#define PMS_BUTTON2DOWN0x0002  /* middle */
-#define PMS_BUTTON3DOWN0x0004  /* right */
-
 static const u_int butmap[8] = {
0,
-   PMS_BUTTON1DOWN,
-   PMS_BUTTON3DOWN,
-   PMS_BUTTON1DOWN | PMS_BUTTON3DOWN,
-   PMS_BUTTON2DOWN,
-   PMS_BUTTON1DOWN | PMS_BUTTON2DOWN,
-   PMS_BUTTON2DOWN | PMS_BUTTON3DOWN,
-   PMS_BUTTON1DOWN | PMS_BUTTON2DOWN | PMS_BUTTON3DOWN
+   WSMOUSE_BUTTON(1),
+   WSMOUSE_BUTTON(3),
+   WSMOUSE_BUTTON(1) | WSMOUSE_BUTTON(3),
+   WSMOUSE_BUTTON(2),
+   WSMOUSE_BUTTON(1) | WSMOUSE_BUTTON(2),
+   WSMOUSE_BUTTON(2) | WSMOUSE_BUTTON(3),
+   WSMOUSE_BUTTON(1) | WSMOUSE_BUTTON(2) | WSMOUSE_BUTTON(3)
 };
 
-/* PS/2 mouse data packet */
-#define PMS_PS2_BUTTONSMASK0x07
-#define PMS_PS2_BUTTON10x01/* left */
-#define PMS_PS2_BUTTON20x04/* middle */
-#define PMS_PS2_BUTTON30x02/* right */
-#define PMS_PS2_XNEG   0x10
-#define PMS_PS2_YNEG   0x20
-
-#define PMS_INTELLI_MAGIC1 200
-#define PMS_INTELLI_MAGIC2 100
-#define PMS_INTELLI_MAGIC3 80
-#define PMS_INTELLI_ID 0x03
-
 intpmsprobe(struct device *, void *, void *);
 void   pmsattach(struct device *, struct device *, void *);
 intpmsactivate(struct device *, int);
 
 void   pmsinput(void *, int);
 
-intpms_change_state(struct pms_softc *, int);
+intpms_change_state(struct pms_softc *, int, int);
 intpms_ioctl(void *, u_long, caddr_t, int, struct proc *);
 intpms_enable(void *);
 void   pms_disable(void *);
 
 intpms_cmd(struct pms_softc *, u_char *, int, u_char *, int);
+intpms_spec_cmd(struct pms_softc *, int);
 intpms_get_devid(struct pms_softc *, u_char *);
 intpms_get_status(struct pms_softc *, u_char *);
 intpms_set_rate(struct pms_softc *, int);
@@ -129,6 +149,21 @@ intpms_ioctl_mouse(struct pms_softc *, 
 intpms_sync_mouse(struct pms_softc *, int);
 void   pms_proc_mouse(struct pms_softc *);
 
+intpms_enable_synaptics(struct pms_softc *);
+intpms_ioctl_synaptics(struct pms_softc *, u_long, caddr_t, int, struct 
proc *);
+intpms_sync_synaptics(struct pms_softc *, int);
+void   pms_proc_synaptics(struct pms_softc *);
+void   pms_disable_synaptics(struct pms_softc *);
+
+intsynaptics_set_mode(struct pms_softc *, 

Eliminating unused WDC_CAPABILITY_* flags

2011-05-07 Thread Matthew Dempsky
I have plans to revamp dev/ic/wdc.c, but in the mean time, I want to
make some small cleanups so the final diff is easier to follow.

First cleanup: The HWLOCK, ATA_NOSTREAM, and ATAPI_NOSTREAM
'capabilities' don't appear to be set by any wdc-based adapters.
They've been here since r1.1, so I think it's just cruft that can be
safely removed... right?

(Conversely, the SATA and SINGLE_DRIVE capabilities are set by some
adapters, but don't actually do anything.  I'm tempted to kill them
too out of principle, but I don't think that's necessary just yet.)

ok?

Index: dev/ic/wdc.c
===
RCS file: /home/mdempsky/anoncvs/cvs/src/sys/dev/ic/wdc.c,v
retrieving revision 1.113
diff -u -p -r1.113 wdc.c
--- dev/ic/wdc.c18 Apr 2011 04:16:13 -  1.113
+++ dev/ic/wdc.c7 May 2011 19:57:00 -
@@ -861,9 +861,6 @@ wdcstart(struct channel_softc *chp)
if ((chp-ch_flags  WDCF_IRQ_WAIT) != 0)
panic(wdcstart: channel waiting for irq);
 #endif /* DIAGNOSTIC */
-   if (chp-wdc-cap  WDC_CAPABILITY_HWLOCK)
-   if (!(chp-wdc-claim_hw)(chp, 0))
-   return;
 
WDCDEBUG_PRINT((wdcstart: xfer %p channel %d drive %d\n, xfer,
chp-channel, xfer-drive), DEBUG_XFERS);
@@ -1919,7 +1916,6 @@ wdc_get_xfer(int flags)
 void
 wdc_free_xfer(struct channel_softc *chp, struct wdc_xfer *xfer)
 {
-   struct wdc_softc *wdc = chp-wdc;
int s;
 
if (xfer-c_flags  C_PRIVATEXFER) {
@@ -1928,8 +1924,6 @@ wdc_free_xfer(struct channel_softc *chp,
return;
}
 
-   if (wdc-cap  WDC_CAPABILITY_HWLOCK)
-   (*wdc-free_hw)(chp);
s = splbio();
chp-ch_flags = ~WDCF_ACTIVE;
TAILQ_REMOVE(chp-ch_queue-sc_xfer, xfer, c_xferchain);
Index: dev/ic/wdcvar.h
===
RCS file: /home/mdempsky/anoncvs/cvs/src/sys/dev/ic/wdcvar.h,v
retrieving revision 1.49
diff -u -p -r1.49 wdcvar.h
--- dev/ic/wdcvar.h 18 Apr 2011 04:16:14 -  1.49
+++ dev/ic/wdcvar.h 8 May 2011 03:10:11 -
@@ -157,9 +157,6 @@ struct wdc_softc { /* Per controller sta
 #define WDC_CAPABILITY_MODE   0x0004   /* controller knows its PIO/DMA modes */
 #define WDC_CAPABILITY_DMA0x0008   /* DMA */
 #define WDC_CAPABILITY_UDMA   0x0010   /* Ultra-DMA/33 */
-#define WDC_CAPABILITY_HWLOCK 0x0020   /* Needs to lock HW */
-#define WDC_CAPABILITY_ATA_NOSTREAM 0x0040 /* Don't use stream funcs on ATA */
-#define WDC_CAPABILITY_ATAPI_NOSTREAM 0x0080 /* Don't use stream f on ATAPI */
 #define WDC_CAPABILITY_NO_EXTRA_RESETS 0x0100 /* only reset once */
 #define WDC_CAPABILITY_PREATA 0x0200   /* ctrl can be a pre-ata one */
 #define WDC_CAPABILITY_IRQACK 0x0400   /* callback to ack interrupt */
@@ -195,10 +192,6 @@ struct wdc_softc { /* Per controller sta
 #define WDC_DMAST_NOIRQ0x01 /* missing IRQ */
 #define WDC_DMAST_ERR  0x02 /* DMA error */
 #define WDC_DMAST_UNDER0x04 /* DMA underrun */
-
-   /* if WDC_CAPABILITY_HWLOCK set in 'cap' */
-   int (*claim_hw)(void *, int);
-   void(*free_hw)(void *);
 
/* if WDC_CAPABILITY_MODE set in 'cap' */
void(*set_modes)(struct channel_softc *);