Re: usb/162307: [uslcom][patch] cp2103 usb-to-serial driver does not support modem control lines

2011-11-09 Thread JD Louw
The following reply was made to PR usb/162307; it has been noted by GNATS.

From: JD Louw jdl@gmail.com
To: bug-follo...@freebsd.org, j...@nanoteq.com
Cc:  
Subject: Re: usb/162307: [uslcom][patch] cp2103 usb-to-serial driver does not
 support modem control lines
Date: Wed, 9 Nov 2011 10:33:47 +0200

 --bcaec544f0ae90b72e04b14925bc
 Content-Type: multipart/alternative; boundary=bcaec544f0ae90b72b04b14925ba
 
 --bcaec544f0ae90b72b04b14925ba
 Content-Type: text/plain; charset=ISO-8859-1
 
 Tested OK.
 
 Recently I came across new app note (AN571) on SiLabs's website, describing
 the cp210x registers in detail. Attached is another minor patch with some
 further cleanups:
 
 1) Use interface no 0 (wIndex field) for all control transfers
 2) Remove reserved mask on flow control.
 
 I plan on adding GPIO support later on. Should I add this as a custom IOCTL?
 
 Thanks
 
 --bcaec544f0ae90b72b04b14925ba
 Content-Type: text/html; charset=ISO-8859-1
 
 Tested OK.divbr/divdivRecently I came across new app note (AN571) on 
SiLabs#39;s website, describing the cp210x registers in detail. Attached is 
another minor patch with some further cleanups:/divdivbr/div
 div1) Use interface no 0 (wIndex field) for all control 
transfers/divdiv2) Remove reserved mask on flow 
control./divdivbr/divdivI plan on adding GPIO support later on. 
Should I add this as a custom IOCTL?/div
 divbr/divdivThanks/divdivbr/div
 
 --bcaec544f0ae90b72b04b14925ba--
 --bcaec544f0ae90b72e04b14925bc
 Content-Type: text/plain; charset=US-ASCII; name=cleanup.patch.txt
 Content-Disposition: attachment; filename=cleanup.patch.txt
 Content-Transfer-Encoding: base64
 X-Attachment-Id: f_gus2238t0
 
 LS0tIHVzbGNvbV8xXzIyLmMJMjAxMS0xMS0wNyAxOTo0NTozMS4wMDAwMDAwMDAgKzAyMDAKKysr
 IHVzbGNvbV8xXzIyX2ZpeF9mbG93LmMJMjAxMS0xMS0wNyAyMToyMTo0NS4wMDAwMDAwMDAgKzAy
 MDAKQ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ae90b72e04b14925bc--
___
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/162307: [uslcom][patch] cp2103 usb-to-serial driver does not support modem control lines

2011-11-09 Thread Hans Petter Selasky
On Wednesday 09 November 2011 10:00:32 JD Louw wrote:
 The following reply was made to PR usb/162307; it has been noted by GNATS.
 
 From: JD Louw jdl@gmail.com
 To: bug-follo...@freebsd.org, j...@nanoteq.com
 Cc:
 Subject: Re: usb/162307: [uslcom][patch] cp2103 usb-to-serial driver does
 not support modem control lines
 Date: Wed, 9 Nov 2011 10:33:47 +0200
 
  --bcaec544f0ae90b72e04b14925bc
  Content-Type: multipart/alternative; boundary=bcaec544f0ae90b72b04b14925ba
 
  --bcaec544f0ae90b72b04b14925ba
  Content-Type: text/plain; charset=ISO-8859-1
 
  Tested OK.
 
  Recently I came across new app note (AN571) on SiLabs's website,
 describing the cp210x registers in detail. Attached is another minor patch
 with some further cleanups:
 
  1) Use interface no 0 (wIndex field) for all control transfers
  2) Remove reserved mask on flow control.
 
  I plan on adding GPIO support later on. Should I add this as a custom
 IOCTL?

Hi,

Modem drivers can have custom IOCTL's.

Try to look at other modem drivers, if they already have something like that. 
Else you need to define your own ioctl file, which you can put in 
/sys/dev/usb/ which is then automagically exported to userspace.

Patch committed:
http://svn.freebsd.org/changeset/base/227383

--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


Re: usb/162307: commit references a PR

2011-11-09 Thread dfilter service
The following reply was made to PR usb/162307; it has been noted by GNATS.

From: dfil...@freebsd.org (dfilter service)
To: bug-follo...@freebsd.org
Cc:  
Subject: Re: usb/162307: commit references a PR
Date: Wed,  9 Nov 2011 09:16:11 + (UTC)

 Author: hselasky
 Date: Wed Nov  9 09:15:57 2011
 New Revision: 227383
 URL: http://svn.freebsd.org/changeset/base/227383
 
 Log:
   Some minor corrections to a modem driver.
   
   PR:  usb/162307
   MFC after:   3 days
 
 Modified:
   head/sys/dev/usb/serial/uslcom.c
 
 Modified: head/sys/dev/usb/serial/uslcom.c
 ==
 --- head/sys/dev/usb/serial/uslcom.c   Wed Nov  9 07:48:48 2011
(r227382)
 +++ head/sys/dev/usb/serial/uslcom.c   Wed Nov  9 09:15:57 2011
(r227383)
 @@ -100,18 +100,17 @@ SYSCTL_INT(_hw_usb_uslcom, OID_AUTO, deb
  #define   USLCOM_PARITY_ODD   0x10
  #define   USLCOM_PARITY_EVEN  0x20
  
 -#define   USLCOM_PORT_NO  0x /* XXX think this should be 0 
--hps */
 +#define   USLCOM_PORT_NO  0x
  
  /* USLCOM_BREAK values */
  #define   USLCOM_BREAK_OFF0x00
  #define   USLCOM_BREAK_ON 0x01
  
  /* USLCOM_SET_FLOWCTRL values - 1st word */
 -#define   USLCOM_FLOW_DTR_ON  0x0001
 +#define   USLCOM_FLOW_DTR_ON  0x0001 /* DTR static active */
  #define   USLCOM_FLOW_CTS_HS  0x0008 /* CTS handshake */
 -#define   USLCOM_FLOW_RESERVED0xFF80
  /* USLCOM_SET_FLOWCTRL values - 2nd word */
 -#define   USLCOM_FLOW_RTS_ON  0x0040
 +#define   USLCOM_FLOW_RTS_ON  0x0040 /* RTS static active */
  #define   USLCOM_FLOW_RTS_HS  0x0080 /* RTS handshake */
  
  enum {
 @@ -540,14 +539,12 @@ uslcom_param(struct ucom_softc *ucom, st
}
 
if (t-c_cflag  CRTSCTS) {
 -  flowctrl[0] = htole32(USLCOM_FLOW_RESERVED |
 -  USLCOM_FLOW_DTR_ON | USLCOM_FLOW_CTS_HS);
 +  flowctrl[0] = htole32(USLCOM_FLOW_DTR_ON | USLCOM_FLOW_CTS_HS);
flowctrl[1] = htole32(USLCOM_FLOW_RTS_HS);
flowctrl[2] = 0;
flowctrl[3] = 0;
} else {
 -  flowctrl[0] = htole32(USLCOM_FLOW_RESERVED |
 -  USLCOM_FLOW_DTR_ON);
 +  flowctrl[0] = htole32(USLCOM_FLOW_DTR_ON);
flowctrl[1] = htole32(USLCOM_FLOW_RTS_ON);
flowctrl[2] = 0;
flowctrl[3] = 0;
 @@ -692,7 +689,7 @@ tr_setup:  
req.bmRequestType = USLCOM_READ;
req.bRequest = USLCOM_RCTRL;
USETW(req.wValue, 0);
 -  USETW(req.wIndex, 0);
 +  USETW(req.wIndex, USLCOM_PORT_NO);
USETW(req.wLength, sizeof(buf));
 
usbd_xfer_set_frames(xfer, 2);
 ___
 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


usb_alloc_device: Failure selecting configuration index 0:USB_ERR_TIMEOUT, port 1, addr 2 (ignored)

2011-11-09 Thread Shah, Vishal
Hi All,

 

This is regarding the issue we are seeing in the FreeBSD 8 USB driver. I
have a USB flash device from which the system is booted. Occasionally
USB device fails to get initialized in the system. So I enabled
USB_DEBUG option and added few more printfs for debugging purpose. After
multiple iterations of rebooting I am able to reproduce the issue and I
see following messages on console while booting the system. Have any
similar issue been reported previously? 

  

parent_dev=0xff0004208300, bus=0xff8001053c90, parent_hub=0,
depth=0, port_index=0, port_no=1, speed=3, usb_mode=0\r\r\n

parent_dev=0xff0004233400, bus=0xff800105cc90, parent_hub=0,
depth=0, port_index=0, port_no=1, speed=3, usb_mode=0\r\r\n

adding unit addr=1, rev=200, class=9, subclass=0, protocol=1,
maxpacket=64, len=8, speed=3\r\r\n

setting config 0\r\r\n

new dev (addr 1), udev=0xff00041b1000, parent_hub=0\r\r\n

ugen0.1:  at usbus0\r\r\n

usb_probe_and_attach: enter\r\r\n

iclass=9/0/0 iindex=0/0\r\r\n

adding unit addr=1, rev=200, class=9, subclass=0, protocol=1,
maxpacket=64, len=8, speed=3\r\r\n

setting config 0\r\r\n

new dev (addr 1), udev=0xff00020f9800, parent_hub=0\r\r\n

ugen1.1:  at usbus1\r\r\n

usb_probe_and_attach: enter\r\r\n

iclass=9/0/0 iindex=0/0\r\r\n

parent_dev=0xff0004332100, bus=0xff800105cc90,
parent_hub=0xff00020f9800, depth=1, port_index=0, port_no=1,
speed=3, usb_mode=0\r\r\n

adding unit addr=2, rev=200, class=0, subclass=0, protocol=0,
maxpacket=64, len=8, speed=3\r\r\n

setting config 0\r\r\n

Root mount waiting for: usbus1\r\r\n

Root mount waiting for: usbus1\r\r\n

setting config 0\r\r\n

Root mount waiting for: usbus1\r\r\n

usb_alloc_device: Failure selecting configuration index
0:USB_ERR_TIMEOUT, port 1, addr 2 (ignored)\r\r\n

new dev (addr 2), udev=0xff0004357800,
parent_hub=0xff00020f9800\r\r\n

ugen1.2:  at usbus1\r\r\n

usb_probe_and_attach: enter\r\r\n

/dev/da0s1: No such file or directory\r\n

 

 

Can you please guide me in resolving this issue?  Thanks in advance.

 

Thanks,

Vishal

___
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