Re: list colon modifiers in mail(1) manpage

2013-07-18 Thread Jason McIntyre
On Fri, Jul 12, 2013 at 04:00:56AM -0700, Sunil Nimmagadda wrote:
> This diff adds colon modifiers which could be used to specify lists.
> 

a slightly modified version of this diff (as we discussed) committed.
thanks!

jmc

> Index: mail.1
> ===
> RCS file: /cvs/src/usr.bin/mail/mail.1,v
> retrieving revision 1.60
> diff -u -p -r1.60 mail.1
> --- mail.17 Nov 2010 08:05:56 -   1.60
> +++ mail.112 Jul 2013 10:43:23 -
> @@ -206,14 +206,28 @@ Thus
>  deletes messages 1 and 2, while
>  .Ic delete 1\-5
>  deletes messages 1 through 5.
> -The special name
> -.Sq *
> -addresses all messages and
> -.Sq $
> -addresses
> -the last message; thus the command
> +.Pp
> +Some special names could be used to specify a list:
> +.Bl -tag -width ":u"
> +.It *
> +all messages
> +.It $
> +last message
> +.It :n
> +new messages
> +.It :o
> +old messages
> +.It :r
> +read messages
> +.It :u
> +unread messages
> +.It :d
> +deleted messages
> +.El
> +.Pp
> +For example,
>  .Ic top
> -which prints the first few lines of a message could be used in
> +which prints the first few lines of a message could as well be used as
>  .Ic top *
>  to print the first few lines of all messages.
>  .Ss Replying to or originating mail
> 



Merge uhts(4) into ums(4).

2013-07-18 Thread Edd Barrett
Hi,

I have been working with mpi@ and matthieu@ to improve support for my
x230t, in particular the digitiser/pen. Last week I committed a small
change to uhts(4) which enables basic support for the digitiser.

During our discussions we noticed that uhts(4) is almost identical to
the code of ums(4).

The following diff merges uhts(4) into ums(4). There should be no
functional change. Please can people test for mouse regressions and
provide feedback. If this is good, then uhts(4) can disappear and the
commented lines in ums_match() can be restored.

I have CC'd people who may be interested.

Thanks

Index: share/man/man4/ums.4
===
RCS file: /cvs/src/share/man/man4/ums.4,v
retrieving revision 1.10
diff -u -p -r1.10 ums.4
--- share/man/man4/ums.426 Jun 2008 05:42:07 -  1.10
+++ share/man/man4/ums.418 Jul 2013 17:13:33 -
@@ -28,23 +28,30 @@
 .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 .\" POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd $Mdocdate: June 26 2008 $
+.Dd $Mdocdate: July 17 2013 $
 .Dt UMS 4
 .Os
 .Sh NAME
 .Nm ums
-.Nd USB mouse support
+.Nd USB HID mouse, touchscreen and digitiser support
 .Sh SYNOPSIS
 .Cd "ums* at uhidev?"
 .Cd "wsmouse* at ums? mux 0"
 .Sh DESCRIPTION
 The
 .Nm
-driver provides support for USB mice.
-Access to the mouse is through the
+driver provides support for USB HID mice, touchscreens and digitisers.
+Access to these devices is through the
 .Xr wscons 4
 driver.
+.Pp
+If the touchscreen sensor is poorly aligned, then
+.Xr xtsscale 1
+should be used to provide calibration results to the
+.Nm
+driver.
 .Sh SEE ALSO
+.Xr xtsscale 1 ,
 .Xr uhidev 4 ,
 .Xr usb 4 ,
 .Xr wsmouse 4
@@ -54,3 +61,16 @@ The
 driver
 first appeared in
 .Ox 2.8 .
+.Sh AUTHORS
+.An -nosplit
+HID touchscreen and digitiser support was written by
+.An Robert Nagy
+and
+.An Matthieu Herrb
+then later merged into the generic
+.Xr ums 4
+driver by
+.An Edd Barrett.
+.Sh CAVEATS
+Touchscreen and digitiser pressure sensitivity is not yet implemented.
+
Index: share/man/man4/usb.4
===
RCS file: /cvs/src/share/man/man4/usb.4,v
retrieving revision 1.140
diff -u -p -r1.140 usb.4
--- share/man/man4/usb.41 Jun 2013 17:04:57 -   1.140
+++ share/man/man4/usb.418 Jul 2013 17:13:33 -
@@ -252,7 +252,7 @@ HID touchscreen support
 keyboards that follow the boot protocol
 .It Xr ums 4
 .Tn USB
-mouse devices
+HID mouse, touchscreen and digitiser devices
 .It Xr uoaklux 4
 Toradex OAK USB illuminance sensor
 .It Xr uoakrh 4
Index: sys/dev/usb/hidms.c
===
RCS file: /cvs/src/sys/dev/usb/hidms.c,v
retrieving revision 1.4
diff -u -p -r1.4 hidms.c
--- sys/dev/usb/hidms.c 19 Aug 2011 18:46:22 -  1.4
+++ sys/dev/usb/hidms.c 18 Jul 2013 17:13:38 -
@@ -194,6 +194,27 @@ hidms_setup(struct device *self, struct 
break;
ms->sc_num_buttons = i - 1;
 
+   if (hid_locate(desc, dlen, HID_USAGE2(HUP_DIGITIZERS,
+   HUD_TIP_SWITCH), id, hid_input,
+   &ms->sc_loc_btn[ms->sc_num_buttons], NULL)){
+   ms->sc_flags |= HIDMS_TIP;
+   ms->sc_num_buttons++;
+   }
+
+   if (hid_locate(desc, dlen, HID_USAGE2(HUP_DIGITIZERS,
+   HUD_ERASER), id, hid_input,
+   &ms->sc_loc_btn[ms->sc_num_buttons], NULL)){
+   ms->sc_flags |= HIDMS_ERASER;
+   ms->sc_num_buttons++;
+   }
+
+   if (hid_locate(desc, dlen, HID_USAGE2(HUP_DIGITIZERS,
+   HUD_BARREL_SWITCH), id, hid_input,
+   &ms->sc_loc_btn[ms->sc_num_buttons], NULL)){
+   ms->sc_flags |= HIDMS_BARREL;
+   ms->sc_num_buttons++;
+   }
+
/*
 * The Microsoft Wireless Notebook Optical Mouse seems to be in worse
 * shape than the Wireless Intellimouse 2.0, as its X, Y, wheel, and
@@ -216,6 +237,11 @@ hidms_setup(struct device *self, struct 
/* Parse descriptors to get touch panel bounds */
d = hid_start_parse(desc, dlen, hid_input);
while (hid_get_item(d, &h)) {
+   if (h.kind != hid_input ||
+   HID_GET_USAGE_PAGE(h.usage) != HUP_GENERIC_DESKTOP)
+   continue;
+   DPRINTF(("hidms: usage=0x%x range %d..%d\n",
+   h.usage, h.logical_minimum, h.logical_maximum));
switch (HID_GET_USAGE(h.usage)) {
case HUG_X:
if (ms->sc_flags & HIDMS_ABSX) {
@@ -255,6 +281,14 @@ hidms_attach(struct hidms *ms, const str
printf(", Z and W dir");
break;
}
+
+   if (ms->sc_flags & HIDMS_TIP)
+   printf(", tip");
+   if (ms->sc_flags & HIDMS_BARREL)
+   printf(", barrel");
+   if (ms->sc_flags & HIDMS_ERASER)
+   

Re: Stairstep mouse motion

2013-07-18 Thread Edd Barrett
Hi,

On Mon, Jul 08, 2013 at 08:26:56PM +0300, Henri Kemppainen wrote:
> Here's a diff that does just that.  If ws receives more than one
> delta along an axis, it will not sum these; each will go in a separate
> event.  But if it gets an X delta followed by an Y delta (or vice versa),
> these will be combined into a single event.

I have also been experiencing these jagged staircase lines on my x230t.
FWIW here are the outcomes of my experiments:

Prior to applying your diff (the most recent one):
Touchpad: smooth lines.
Nipple:   jagged lines.
Pen:  jagged lines.

After applying your diff:
Touchpad: smooth lines.
Nipple:   smooth lines.
Pen:  jagged lines.

I wonder if it is because the pen is an absolute pointing device.  You
probably need extra magic in the WSCONS_EVENT_MOUSE_ABSOLUTE_* cases.

-- 
Best Regards
Edd Barrett

http://www.theunixzoo.co.uk



Re: Merge uhts(4) into ums(4).

2013-07-18 Thread Jason McIntyre
On Thu, Jul 18, 2013 at 08:08:47PM +0100, Edd Barrett wrote:
> Hi,
> 
> I have been working with mpi@ and matthieu@ to improve support for my
> x230t, in particular the digitiser/pen. Last week I committed a small
> change to uhts(4) which enables basic support for the digitiser.
> 
> During our discussions we noticed that uhts(4) is almost identical to
> the code of ums(4).
> 
> The following diff merges uhts(4) into ums(4). There should be no
> functional change. Please can people test for mouse regressions and
> provide feedback. If this is good, then uhts(4) can disappear and the
> commented lines in ums_match() can be restored.
> 
> I have CC'd people who may be interested.
> 
> Thanks
> 
> Index: share/man/man4/ums.4
> ===
> RCS file: /cvs/src/share/man/man4/ums.4,v
> retrieving revision 1.10
> diff -u -p -r1.10 ums.4
> --- share/man/man4/ums.4  26 Jun 2008 05:42:07 -  1.10
> +++ share/man/man4/ums.4  18 Jul 2013 17:13:33 -
> @@ -28,23 +28,30 @@
>  .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 
> THE
>  .\" POSSIBILITY OF SUCH DAMAGE.
>  .\"
> -.Dd $Mdocdate: June 26 2008 $
> +.Dd $Mdocdate: July 17 2013 $
>  .Dt UMS 4
>  .Os
>  .Sh NAME
>  .Nm ums
> -.Nd USB mouse support
> +.Nd USB HID mouse, touchscreen and digitiser support
>  .Sh SYNOPSIS
>  .Cd "ums* at uhidev?"
>  .Cd "wsmouse* at ums? mux 0"
>  .Sh DESCRIPTION
>  The
>  .Nm
> -driver provides support for USB mice.
> -Access to the mouse is through the
> +driver provides support for USB HID mice, touchscreens and digitisers.
> +Access to these devices is through the
>  .Xr wscons 4
>  driver.
> +.Pp
> +If the touchscreen sensor is poorly aligned, then
> +.Xr xtsscale 1
> +should be used to provide calibration results to the
> +.Nm
> +driver.
>  .Sh SEE ALSO
> +.Xr xtsscale 1 ,
>  .Xr uhidev 4 ,
>  .Xr usb 4 ,
>  .Xr wsmouse 4
> @@ -54,3 +61,16 @@ The
>  driver
>  first appeared in
>  .Ox 2.8 .
> +.Sh AUTHORS
> +.An -nosplit
> +HID touchscreen and digitiser support was written by
> +.An Robert Nagy
> +and
> +.An Matthieu Herrb
> +then later merged into the generic
> +.Xr ums 4
> +driver by
> +.An Edd Barrett.

you want a space before the full stop (above)

> +.Sh CAVEATS
> +Touchscreen and digitiser pressure sensitivity is not yet implemented.
> +

and zap this blank line

> Index: share/man/man4/usb.4
> ===
> RCS file: /cvs/src/share/man/man4/usb.4,v
> retrieving revision 1.140
> diff -u -p -r1.140 usb.4
> --- share/man/man4/usb.4  1 Jun 2013 17:04:57 -   1.140
> +++ share/man/man4/usb.4  18 Jul 2013 17:13:33 -
> @@ -252,7 +252,7 @@ HID touchscreen support
>  keyboards that follow the boot protocol
>  .It Xr ums 4
>  .Tn USB
> -mouse devices
> +HID mouse, touchscreen and digitiser devices

the Nd should match exactly, so either change "suuport" in the man page,
or "devices" here

>  .It Xr uoaklux 4
>  Toradex OAK USB illuminance sensor
>  .It Xr uoakrh 4

jmc



ndp expire time

2013-07-18 Thread Alexander Bluhm
Hi,

ndp uses an int expire_time for time calculations.  This should be
time_t.

The routing messages and IPv6 prefixes and default router also have
wrong expire time type.  But this has to wait until ABI unlock.

ok?

bluhm


Index: usr.sbin/ndp/ndp.c
===
RCS file: /data/mirror/openbsd/cvs/src/usr.sbin/ndp/ndp.c,v
retrieving revision 1.47
diff -u -p -u -p -r1.47 ndp.c
--- usr.sbin/ndp/ndp.c  21 Mar 2013 04:43:17 -  1.47
+++ usr.sbin/ndp/ndp.c  18 Jul 2013 22:49:26 -
@@ -335,7 +335,8 @@ getsocket(void)
 struct sockaddr_in6 so_mask = {sizeof(so_mask), AF_INET6 };
 struct sockaddr_in6 blank_sin = {sizeof(blank_sin), AF_INET6 }, sin_m;
 struct sockaddr_dl blank_sdl = {sizeof(blank_sdl), AF_LINK }, sdl_m;
-intexpire_time, flags, found_entry;
+time_t expire_time;
+intflags, found_entry;
 struct {
struct  rt_msghdr m_rtm;
charm_space[512];
@@ -379,7 +380,8 @@ set(int argc, char **argv)
ea = (u_char *)LLADDR(&sdl_m);
if (ndp_ether_aton(eaddr, ea) == 0)
sdl_m.sdl_alen = 6;
-   flags = expire_time = 0;
+   expire_time = 0;
+   flags = 0;
while (argc-- > 0) {
if (strncmp(argv[0], "temp", 4) == 0) {
struct timeval time;



uvm(9) patch

2013-07-18 Thread Daniel Dickman
minor patch for uvm(9) :-

- remove redundant sentence about misc functions
- note that pmap(9) is the MD portion of UVM.
- Convert reference to Chuck's dissertation to .Rs/.Re section
- uvm is no longer "new".
- Remove "(Missouri)". St. Louis should be enough to remove any confusion
  between wustl.edu and washington.edu.

jmc was okay with this but asked me to send to tech.

Index: uvm.9
===
RCS file: /home/cvs/src/share/man/man9/uvm.9,v
retrieving revision 1.49
diff -u -r1.49 uvm.9
--- uvm.9   17 Jul 2013 20:21:55 -  1.49
+++ uvm.9   19 Jul 2013 03:33:03 -
@@ -72,7 +72,10 @@
 The swapper process swaps in runnable processes that are currently swapped out,
 if there is room.
 .Pp
-There are also several miscellaneous functions.
+UVM has a machine independent and a machine dependent layer.
+See
+.Xr pmap 9
+for the machine dependent layer.
 .Sh INITIALISATION
 .nr nS 1
 .Ft void
@@ -1044,9 +1047,15 @@
 .Xr ddb 4 ,
 .Xr options 4 ,
 .Xr pmap 9
+.Rs
+.%A Charles D. Cranor
+.%T "Design and Implementation of the UVM Virtual Memory System, D.Sc. 
dissertation"
+.%C St. Louis, Missouri
+.%Q Department of Computer Science, Sever Institute of Technology, Washington 
University
+.%D August 1998
+.Re
 .Sh HISTORY
-UVM is a new VM system developed at Washington University in St. Louis
-(Missouri).
+The UVM virtual memory system was developed at Washington University in St. 
Louis.
 UVM's roots lie partly in the Mach-based
 .Bx 4.4
 VM system, the
@@ -1063,8 +1072,6 @@
 .Bx
 including page loanout, map entry passing, simplified
 copy-on-write, and clustered anonymous memory pageout.
-UVM is also further documented in an August 1998 dissertation
-by Charles D. Cranor.
 .Pp
 UVM appeared in
 .Ox 2.9 .