usb/125264: [patch] sysctl for set usb mouse rate (very useful for gamers - FPS games)

2008-07-04 Thread vvd

Number: 125264
Category:   usb
Synopsis:   [patch] sysctl for set usb mouse rate (very useful for gamers 
- FPS games)
Confidential:   no
Severity:   non-critical
Priority:   low
Responsible:freebsd-usb
State:  open
Quarter:
Keywords:   
Date-Required:
Class:  change-request
Submitter-Id:   current-users
Arrival-Date:   Fri Jul 04 15:00:09 UTC 2008
Closed-Date:
Last-Modified:
Originator: VVD [EMAIL PROTECTED]
Release:FreeBSD 7.0-STABLE i386
Organization:
no
Environment:
System: FreeBSD vvd.home 7.0-STABLE FreeBSD 7.0-STABLE #0: Tue Jul 1 04:39:52 
MSD 2008 [EMAIL PROTECTED]:/usr/obj/usr/src/sys/VVD2 i386
Platform independent patch.
Tested on: i386, motherboard ASUS P4P8X, mice Logitech MX300 and Logitech G5, 
game ezQuake 1.9.

Description:
Add options UMS_HZ=INT_VALUE in kernel config.
USB mouse rate: value from 1 to 1000, other values set default rate - mouse 
specific.
Most mice suport till 250Hz and 500Hz. Greater value - smoother movements.
Some of professional gaming mice support 1000Hz and have default rate 500Hz.
User can to change this value using sysctl hw.usb.ums.hz.
For applying it user must take out mouse and insert it back.

How-To-Repeat:
Use usb mouse. :-D

Fix:

--- ums_hz.diff begins here ---
--- sys/conf/options.orig   2008-07-01 04:22:39.0 +0400
+++ sys/conf/options2008-07-01 04:22:45.0 +0400
@@ -621,6 +621,7 @@
 UPLCOM_INTR_INTERVAL   opt_uplcom.h
 UVSCOM_DEFAULT_OPKTSIZEopt_uvscom.h
 UVSCOM_INTR_INTERVAL   opt_uvscom.h
+UMS_HZ opt_ums.h
 
 # Embedded system options
 INIT_PATH
--- sys/dev/usb/ums.c.orig  2008-06-16 19:51:35.0 +0400
+++ sys/dev/usb/ums.c   2008-07-01 04:23:41.0 +0400
@@ -69,6 +69,13 @@
 
 #include sys/mouse.h
 
+#include opt_ums.h
+#ifdef UMS_HZ
+static int ums_hz = UMS_HZ;
+SYSCTL_NODE(_hw_usb, OID_AUTO, ums, CTLFLAG_RW, 0, USB ums);
+SYSCTL_INT(_hw_usb_ums, OID_AUTO, hz, CTLFLAG_RW, ums_hz, 0, );
+#endif
+
 #ifdef USB_DEBUG
 #define DPRINTF(x) if (umsdebug) printf x
 #define DPRINTFN(n,x)  if (umsdebug(n)) printf x
@@ -700,7 +707,12 @@
err = usbd_open_pipe_intr(sc-sc_iface, sc-sc_ep_addr,
USBD_SHORT_XFER_OK, sc-sc_intrpipe, sc,
sc-sc_ibuf, sc-sc_isize, ums_intr,
-   USBD_DEFAULT_INTERVAL);
+#ifdef UMS_HZ
+   (ums_hz  0  ums_hz = 1000) ? 1000 / ums_hz 
: USBD_DEFAULT_INTERVAL
+#else
+   USBD_DEFAULT_INTERVAL
+#endif
+   );
if (err) {
DPRINTF((ums_enable: usbd_open_pipe_intr failed, error=%d\n,
 err));
--- sys/conf/NOTES.orig 2008-07-02 01:00:01.0 +0400
+++ sys/conf/NOTES  2008-07-02 01:06:12.0 +0400
@@ -2431,6 +2431,12 @@
 device umodem
 # USB mouse
 device ums
+# USB mouse rate (1 to 1000, other values set default rate - mouse specific).
+# Most mice suport till 250Hz and 500Hz. Greater value - smoother movements.
+# Some of professional gaming mice support 1000Hz and have default rate 
500Hz.
+# You can to change this value using sysctl hw.usb.ums.hz.
+# For applying it you must take out mouse and insert it back.
+optionsUMS_HZ=-1
 # Diamond Rio 500 MP3 player
 device urio
 # USB scanners
Release-Note:
Audit-Trail:
Unformatted:
___
freebsd-usb@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-usb
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: usb/125264: [patch] sysctl for set usb mouse rate (very useful for gamers - FPS games)

2008-07-04 Thread Hans Petter Selasky
On Friday 04 July 2008, [EMAIL PROTECTED] wrote:
 Number: 125264
 Category:   usb
 Synopsis:   [patch] sysctl for set usb mouse rate (very useful for
  gamers - FPS games) Confidential:   no
 Severity:   non-critical
 Priority:   low
 Responsible:freebsd-usb
 State:  open
 Quarter:
 Keywords:
 Date-Required:
 Class:  change-request
 Submitter-Id:   current-users
 Arrival-Date:   Fri Jul 04 15:00:09 UTC 2008
 Closed-Date:
 Last-Modified:
 Originator: VVD [EMAIL PROTECTED]
 Release:FreeBSD 7.0-STABLE i386
 Organization:

 no

 Environment:

 System: FreeBSD vvd.home 7.0-STABLE FreeBSD 7.0-STABLE #0: Tue Jul 1
 04:39:52 MSD 2008 [EMAIL PROTECTED]:/usr/obj/usr/src/sys/VVD2 i386 Platform
 independent patch.
 Tested on: i386, motherboard ASUS P4P8X, mice Logitech MX300 and Logitech
 G5, game ezQuake 1.9.

 Description:

 Add options UMS_HZ=INT_VALUE in kernel config.
 USB mouse rate: value from 1 to 1000, other values set default rate - mouse
 specific. Most mice suport till 250Hz and 500Hz. Greater value - smoother
 movements. Some of professional gaming mice support 1000Hz and have
 default rate 500Hz. User can to change this value using sysctl
 hw.usb.ums.hz.
 For applying it user must take out mouse and insert it back.

 How-To-Repeat:

 Use usb mouse. :-D

 Fix:

 --- ums_hz.diff begins here ---
 --- sys/conf/options.orig 2008-07-01 04:22:39.0 +0400
 +++ sys/conf/options  2008-07-01 04:22:45.0 +0400
 @@ -621,6 +621,7 @@
  UPLCOM_INTR_INTERVAL opt_uplcom.h
  UVSCOM_DEFAULT_OPKTSIZE  opt_uvscom.h
  UVSCOM_INTR_INTERVAL opt_uvscom.h
 +UMS_HZ   opt_ums.h

  # Embedded system options
  INIT_PATH
 --- sys/dev/usb/ums.c.orig2008-06-16 19:51:35.0 +0400
 +++ sys/dev/usb/ums.c 2008-07-01 04:23:41.0 +0400
 @@ -69,6 +69,13 @@

  #include sys/mouse.h

 +#include opt_ums.h
 +#ifdef UMS_HZ
 +static int ums_hz = UMS_HZ;
 +SYSCTL_NODE(_hw_usb, OID_AUTO, ums, CTLFLAG_RW, 0, USB ums);
 +SYSCTL_INT(_hw_usb_ums, OID_AUTO, hz, CTLFLAG_RW, ums_hz, 0, );
 +#endif
 +
  #ifdef USB_DEBUG
  #define DPRINTF(x)   if (umsdebug) printf x
  #define DPRINTFN(n,x)if (umsdebug(n)) printf x
 @@ -700,7 +707,12 @@
   err = usbd_open_pipe_intr(sc-sc_iface, sc-sc_ep_addr,
   USBD_SHORT_XFER_OK, sc-sc_intrpipe, sc,
   sc-sc_ibuf, sc-sc_isize, ums_intr,
 - USBD_DEFAULT_INTERVAL);
 +#ifdef UMS_HZ
 + (ums_hz  0  ums_hz = 1000) ? 1000 / ums_hz 
 : USBD_DEFAULT_INTERVAL
 +#else
 + USBD_DEFAULT_INTERVAL
 +#endif
 + );
   if (err) {
   DPRINTF((ums_enable: usbd_open_pipe_intr failed, error=%d\n,
err));
 --- sys/conf/NOTES.orig   2008-07-02 01:00:01.0 +0400
 +++ sys/conf/NOTES2008-07-02 01:06:12.0 +0400
 @@ -2431,6 +2431,12 @@
  device   umodem
  # USB mouse
  device   ums
 +# USB mouse rate (1 to 1000, other values set default rate - mouse
 specific). +# Most mice suport till 250Hz and 500Hz. Greater value -
 smoother movements. +# Some of professional gaming mice support 1000Hz
 and have default rate 500Hz. +# You can to change this value using sysctl
 hw.usb.ums.hz.
 +# For applying it you must take out mouse and insert it back.
 +options  UMS_HZ=-1
  # Diamond Rio 500 MP3 player
  device   urio
  # USB scanners


Hi,

If the mouse is LOW speed you should not poll that often. Maybe you need to 
add a USB speed check (See usbd_get_speed() or something similar.)

--HPS
___
freebsd-usb@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-usb
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: may I commit this small umodem patch ?

2008-07-04 Thread Hans Petter Selasky
On Friday 04 July 2008, Luigi Rizzo wrote:
 On Fri, Jul 04, 2008 at 11:33:15PM +0200, Hans Petter Selasky wrote:
  On Thursday 03 July 2008, Luigi Rizzo wrote:
   On Thu, Jul 03, 2008 at 05:07:00PM +0200, Gary Jennejohn wrote:
On Thu, 3 Jul 2008 16:07:19 +0200
   
Luigi Rizzo [EMAIL PROTECTED] wrote:
 There was a discussion back in september about adding
 support for basic CDC tty devices in umodem.c.
 This lets you talk to a number of usb devices built around
 microcontrollers (e.g. Atmel), and puts us on par with
 Linux and Windows in terms of supporting these devices.

 Because this simply requires the small patch below to the
 probe/attach routine, so if there are no objections I plan to add
 this to the system (CURRENT then RELENG_7 and RELENG_6) in the next
 few days.
 
  What about flow control? Is flow control required for these devices?

 the ones I am talking about don't implement any form of flow control.
 I suppose they would otherwise match the previous check.

 luigi

I mean, are you going to upload firmware through these interfaces?

--HPS
___
freebsd-usb@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-usb
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: may I commit this small umodem patch ?

2008-07-04 Thread Luigi Rizzo
On Sat, Jul 05, 2008 at 12:28:47AM +0200, Hans Petter Selasky wrote:
 On Friday 04 July 2008, Luigi Rizzo wrote:
  On Fri, Jul 04, 2008 at 11:33:15PM +0200, Hans Petter Selasky wrote:
   On Thursday 03 July 2008, Luigi Rizzo wrote:
On Thu, Jul 03, 2008 at 05:07:00PM +0200, Gary Jennejohn wrote:
 On Thu, 3 Jul 2008 16:07:19 +0200

 Luigi Rizzo [EMAIL PROTECTED] wrote:
  There was a discussion back in september about adding
  support for basic CDC tty devices in umodem.c.
  This lets you talk to a number of usb devices built around
  microcontrollers (e.g. Atmel), and puts us on par with
  Linux and Windows in terms of supporting these devices.
 
  Because this simply requires the small patch below to the
  probe/attach routine, so if there are no objections I plan to add
  this to the system (CURRENT then RELENG_7 and RELENG_6) in the next
  few days.
  
   What about flow control? Is flow control required for these devices?
 
  the ones I am talking about don't implement any form of flow control.
  I suppose they would otherwise match the previous check.
 
  luigi
 
 I mean, are you going to upload firmware through these interfaces?

the OS only know about bytes.

are firmware, software, data or random noise.
if you want to know whether the sam7 uploader works, yes it does.
___
freebsd-usb@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-usb
To unsubscribe, send any mail to [EMAIL PROTECTED]


recognizing a usb device

2008-07-04 Thread Chuck Robey
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Is there any way to be able to recognizing a filename that the user has given
me as a sub device?  I figure I can try a udbhid ioctl to see if it's a USB HID
device, but is there any other way to recognize a usb device?

Using an ioctl, it just sort of seems like a messy way to do it.  I was sort of
hoping that there might've been some sort of sysctl giving ghe names, but if
there is, I couldn't find it.
-BEGIN PGP SIGNATURE-
Version: GnuPG v2.0.9 (FreeBSD)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkhuwp0ACgkQz62J6PPcoOkkUwCghk9/RWuzJmvzv3P7FHNli4ns
qMoAn0Y0WSoDS7XyxxDhpDimboPyL587
=rHrm
-END PGP SIGNATURE-
___
freebsd-usb@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-usb
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: may I commit this small umodem patch ?

2008-07-04 Thread Xiaofan Chen
On Sat, Jul 5, 2008 at 5:39 AM, Luigi Rizzo [EMAIL PROTECTED] wrote:
 What about flow control? Is flow control required for these devices?

 the ones I am talking about don't implement any form of flow control.
 I suppose they would otherwise match the previous check.


They are many of this device and they do not have flow control.
I got two of them right here. One is for NXP LPC-P2148 and the other
is using Microchip PIC18F USB PICs.

Last time it was discussed here.
http://lists.freebsd.org/pipermail/freebsd-usb/2008-April/004907.html

I've tried the lpcusb based generic CDC-ACM device under
Linux/Windows/NetBSD successfully but not FreeBSD.

Xiaofan
___
freebsd-usb@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-usb
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: usb/125264: [patch] sysctl for set usb mouse rate (very useful for gamers - FPS games)

2008-07-04 Thread VVD
The following reply was made to PR usb/125264; it has been noted by GNATS.

From: VVD [EMAIL PROTECTED]
To: [EMAIL PROTECTED],
[EMAIL PROTECTED]
Cc:  
Subject: Re: usb/125264: [patch] sysctl for set usb mouse rate (very useful for 
gamers - FPS games)
Date: Sat, 5 Jul 2008 06:10:01 +0400

 Hi,
 
 AFAIK, all mice are LOW speed usb devices. Didn't understand how to use
 usbd_get_speed() for ums - have no field like speed. High rate need only for
 more smooth mouse moving.
 Linux have custom mouse rate patch from ~2.6.1x. Logitech have Setpoint
 drivers for Win with possibility to set mouse rate from 125 to 1000. Time
 for FreeBSD to have this feature. :-]
 
 With best regards.
 
 
___
freebsd-usb@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-usb
To unsubscribe, send any mail to [EMAIL PROTECTED]


USB mouse not seen at boot

2008-07-04 Thread Mikhail Teterin
Hello!

I'm trying to switch a computer from psm- to ums-connected mouse and am
seeing a strange problem.

Although ums_load is enabled in loader.conf, the mouse is not seen at
boot. Its light (it is a laser-based device) remains off, until I unplug
it from the USB-port and then plug back in.

After that everything is dandy, it lights up, and is detected as:

ums0: ARROW STRONG USB 3D Mouse, class 0/0, rev 1.00/0.10, addr 2 on uhub0
ums0: 5 buttons and Z dir.

Xorg sees it and life is good.

But why does it have to be reconnected every time at boot?

The only unusual thing I did with it was setting
moused_nondefault_enable=NO to prevent moused from ever starting --
this PC starts xdm on boot and does not use text consoles.

Any ideas? Thanks!

-mi
___
freebsd-usb@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-usb
To unsubscribe, send any mail to [EMAIL PROTECTED]