Re: usb/188046: commit references a PR

2014-04-01 Thread dfilter service
The following reply was made to PR usb/188046; it has been noted by GNATS.

From: dfil...@freebsd.org (dfilter service)
To: bug-follo...@freebsd.org
Cc:  
Subject: Re: usb/188046: commit references a PR
Date: Tue,  1 Apr 2014 10:34:43 + (UTC)

 Author: hselasky
 Date: Tue Apr  1 10:34:39 2014
 New Revision: 263985
 URL: http://svnweb.freebsd.org/changeset/base/263985
 
 Log:
   Add new USB ID.
   
   Submitted by:Tuomo Latto djv+f...@iki.fi
   PR:  usb/188046
   MFC after:   1 week
 
 Modified:
   head/sys/dev/usb/usbdevs
   head/sys/dev/usb/wlan/if_run.c
 
 Modified: head/sys/dev/usb/usbdevs
 ==
 --- head/sys/dev/usb/usbdevs   Tue Apr  1 08:19:30 2014(r263984)
 +++ head/sys/dev/usb/usbdevs   Tue Apr  1 10:34:39 2014(r263985)
 @@ -4535,5 +4535,6 @@ product ZYXEL G220V2 0x340f  G-220 v2
  product ZYXEL G2020x3410  G-202
  product ZYXEL RT2870_10x3416  RT2870
  product ZYXEL RT2870_20x341a  RT2870
 +product ZYXEL RT3070  0x341e  NWD2105
  product ZYXEL RTL8192CU   0x341f  RTL8192CU
  product ZYXEL NWD2705 0x3421  NWD2705
 
 Modified: head/sys/dev/usb/wlan/if_run.c
 ==
 --- head/sys/dev/usb/wlan/if_run.c Tue Apr  1 08:19:30 2014
(r263984)
 +++ head/sys/dev/usb/wlan/if_run.c Tue Apr  1 10:34:39 2014
(r263985)
 @@ -316,6 +316,7 @@ static const STRUCT_USB_HOST_ID run_devs
  RUN_DEV(ZINWELL,  RT3072_2),
  RUN_DEV(ZYXEL,RT2870_1),
  RUN_DEV(ZYXEL,RT2870_2),
 +RUN_DEV(ZYXEL,RT3070),
  RUN_DEV_EJECT(ZYXEL,  NWD2705),
  RUN_DEV_EJECT(RALINK, RT_STOR),
  #undef RUN_DEV_EJECT
 ___
 svn-src-...@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/svn-src-all
 To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
 
___
freebsd-usb@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-usb
To unsubscribe, send any mail to freebsd-usb-unsubscr...@freebsd.org


Re: usb/188119: multiple keybard

2014-04-01 Thread Hans Petter Selasky
The following reply was made to PR usb/188119; it has been noted by GNATS.

From: Hans Petter Selasky h...@selasky.org
To: zhiqiang feng windy...@gmail.com, freebsd-gnats-sub...@freebsd.org
Cc:  
Subject: Re: usb/188119: multiple keybard
Date: Tue, 01 Apr 2014 12:36:50 +0200

 On 03/31/14 10:48, zhiqiang feng wrote:
 
  Number: 188119
  Category:   usb
  Synopsis:   multiple keybard
  Confidential:   no
  Severity:   non-critical
  Priority:   low
  Responsible:freebsd-usb
  State:  open
  Quarter:
  Keywords:
  Date-Required:
  Class:  sw-bug
  Submitter-Id:   current-users
  Arrival-Date:   Mon Mar 31 08:50:00 UTC 2014
  Closed-Date:
  Last-Modified:
  Originator: zhiqiang feng
  Release:10.0-RELEASE
  Organization:
  ITDCL
  Environment:
  FreeBSD vpn.gzzn.com 10.0-RELEASE FreeBSD 10.0-RELEASE #0 r260789: Thu Jan 
  16 22:34:59 UTC 2014 r...@snap.freebsd.org:/usr/obj/usr/src/sys/GENERIC  
  amd64
  Description:
  I plug yubikey(usb keyboard) into my machine to input the keys, then unplug 
  the yubikey, my ps/2 keyboard will not work any more, the keyboard hardware 
  is ok, then I plug yubikey again then the keybard will work again.
  How-To-Repeat:
 
  Fix:
 
 
  Release-Note:
  Audit-Trail:
  Unformatted:
 
 Hi,
 
 I think this might be a HAL/X.org issue.
 
 Does the keyboard still work if you switch to the text-console?
 
 --HPS
 
___
freebsd-usb@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-usb
To unsubscribe, send any mail to freebsd-usb-unsubscr...@freebsd.org


uftdi driver - new ioctls to support FTDI bitbang and other modes

2014-04-01 Thread Ian Lepore
The attached patch, which I hope to commit sometime soon, adds support
for bitbang, MPSSE, CPU_FIFO, and other modes supported by the FTDI
serial adapter chips, using ioctl() calls.  This allows full control of
all the FTDI features that embedded folks like, using any language that
supports fd-based IO.  You can, for example, program an fpga in MPSSE
mode just by configuring the mode with a couple ioctl() calls, then
writing the bitfile image to the fd as if it were going out a serial
port.  You can also do jtag work this way.

In addition to adding the new ioctls, this change removes all the code
that reset the chip at attach and open/close time, and also the code
that turned on RTS/CTS flow control on open without any permission to do
so (that was just always a bug in the driver).  

When FTDI chips are configured as GPIO or MPSSE or other special-purpose
uses by an attached serial eeprom, the chip will power on with certain
pins driven or floating, and it's important that the driver not do
anything to the chip to perturb that unless it receives a specific
command to do so.  When used for plain old serial comms the chip
powers on into the right mode and never needs to be reset while it's
running to operate properly, so this change is transparent to most
users.

-- Ian


Index: sys/dev/usb/serial/uftdi_reg.h
===
--- sys/dev/usb/serial/uftdi_reg.h	(revision 264013)
+++ sys/dev/usb/serial/uftdi_reg.h	(working copy)
@@ -28,6 +28,10 @@
 	 * reg */
 #define	FTDI_SIO_SET_EVENT_CHAR	6	/* Set the event character */
 #define	FTDI_SIO_SET_ERROR_CHAR	7	/* Set the error character */
+#define	FTDI_SIO_SET_LATENCY	9	/* Set the latency timer */
+#define	FTDI_SIO_GET_LATENCY	10	/* Read the latency timer */
+#define	FTDI_SIO_SET_BITMODE	11	/* Set the bit bang I/O mode */
+#define	FTDI_SIO_GET_BITMODE	12	/* Read pin states in bit bang mode */
 
 /* Port Identifier Table */
 #define	FTDI_PIT_DEFAULT 	0	/* SIOA */
Index: sys/dev/usb/serial/uftdi.c
===
--- sys/dev/usb/serial/uftdi.c	(revision 264031)
+++ sys/dev/usb/serial/uftdi.c	(working copy)
@@ -38,7 +38,14 @@ __FBSDID($FreeBSD$);
  */
 
 /*
- * FTDI FT2232x, FT8U100AX and FT8U232AM serial adapter driver
+ * FTDI FT232x, FT2232x, FT4232x, FT8U100AX and FT8U232xM serial adapters.
+ *
+ * Note that we specifically do not do a reset or otherwise alter the state of
+ * the chip during attach, detach, open, and close, because it could be
+ * pre-initialized (via an attached serial eeprom) to power-on into a mode such
+ * as bitbang in which the pins are being driven to a specific state which we
+ * must not perturb.  The device gets reset at power-on, and doesn't need to be
+ * reset again after that to function, except as directed by ioctl() calls.
  */
 
 #include sys/stdint.h
@@ -64,6 +71,7 @@ __FBSDID($FreeBSD$);
 #include dev/usb/usbdi.h
 #include dev/usb/usbdi_util.h
 #include dev/usb/usb_core.h
+#include dev/usb/usb_ioctl.h
 #include usbdevs.h
 
 #define	USB_DEBUG_VAR uftdi_debug
@@ -72,6 +80,7 @@ __FBSDID($FreeBSD$);
 
 #include dev/usb/serial/usb_serial.h
 #include dev/usb/serial/uftdi_reg.h
+#include dev/usb/uftdiio.h
 
 #ifdef USB_DEBUG
 static int uftdi_debug = 0;
@@ -175,6 +184,7 @@ static usb_callback_t uftdi_read_callback;
 
 static void	uftdi_free(struct ucom_softc *);
 static void	uftdi_cfg_open(struct ucom_softc *);
+static void	uftdi_cfg_close(struct ucom_softc *);
 static void	uftdi_cfg_set_dtr(struct ucom_softc *, uint8_t);
 static void	uftdi_cfg_set_rts(struct ucom_softc *, uint8_t);
 static void	uftdi_cfg_set_break(struct ucom_softc *, uint8_t);
@@ -184,6 +194,15 @@ static int	uftdi_pre_param(struct ucom_softc *, st
 static void	uftdi_cfg_param(struct ucom_softc *, struct termios *);
 static void	uftdi_cfg_get_status(struct ucom_softc *, uint8_t *,
 		uint8_t *);
+static int	uftdi_reset(struct ucom_softc *, int);
+static int	uftdi_set_bitmode(struct ucom_softc *, uint8_t, uint8_t);
+static int	uftdi_get_bitmode(struct ucom_softc *, uint8_t *);
+static int	uftdi_set_latency(struct ucom_softc *, int);
+static int	uftdi_get_latency(struct ucom_softc *, int *);
+static int	uftdi_set_event_char(struct ucom_softc *, int);
+static int	uftdi_set_error_char(struct ucom_softc *, int);
+static int	uftdi_ioctl(struct ucom_softc *, uint32_t, caddr_t, int,
+		struct thread *);
 static void	uftdi_start_read(struct ucom_softc *);
 static void	uftdi_stop_read(struct ucom_softc *);
 static void	uftdi_start_write(struct ucom_softc *);
@@ -218,7 +237,9 @@ static const struct ucom_callback uftdi_callback =
 	.ucom_cfg_set_break = uftdi_cfg_set_break,
 	.ucom_cfg_param = uftdi_cfg_param,
 	.ucom_cfg_open = uftdi_cfg_open,
+	.ucom_cfg_close = uftdi_cfg_close,
 	.ucom_pre_param = uftdi_pre_param,
+	.ucom_ioctl = uftdi_ioctl,
 	.ucom_start_read = uftdi_start_read,
 	.ucom_stop_read = uftdi_stop_read,
 	.ucom_start_write = uftdi_start_write,