From owner-freebsd-usb@FreeBSD.ORG Mon Sep 21 01:44:28 2009 Return-Path: Delivered-To: freebsd-usb@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D211F1065670 for ; Mon, 21 Sep 2009 01:44:28 +0000 (UTC) (envelope-from pldrouin@pldrouin.net) Received: from smtp.cyberfingers.net (smtp.cyberfingers.net [198.177.254.227]) by mx1.freebsd.org (Postfix) with ESMTP id 916A58FC12 for ; Mon, 21 Sep 2009 01:44:28 +0000 (UTC) Received: from mdaemon.pldrouin.net (CPE0023695b905f-CM001a666aca96.cpe.net.cable.rogers.com [99.246.67.95]) by smtp.cyberfingers.net (Postfix) with ESMTP id 21B5FAB6C12; Sun, 20 Sep 2009 21:44:26 -0400 (EDT) Message-ID: <4AB6DA79.7050209@pldrouin.net> Date: Sun, 20 Sep 2009 21:44:25 -0400 From: Pierre-Luc Drouin User-Agent: Thunderbird 2.0.0.23 (X11/20090824) MIME-Version: 1.0 To: freebsd-usb@freebsd.org, hselasky@c2i.net Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: Subject: Re: usb/138659: uftdi driver broken in RELENG_8/CURRENT X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Sep 2009 01:44:28 -0000 Hi, I am also having troubles with the uftdi driver on 8.0-BETA4. I am trying to use a fan controller (mCubed bigNG) that uses a FT232BL chip and it does not seem to be responding on FreeBSD 8.0 while the same code works perfectly on Linux (I have not tried the code on RELENG_7 yet but I could install it if necessary). Here is the very simple code I am using for testing: #include #include #include #include #include int main(); #define DEV "/dev/ttyU0" #define TBAN_SER_SOURCE1 0x05 /* Primary source */ #define TBAN_SER_SOURCE2 0x06 /* Alternative source (miniNG...) */ #define TBAN_SER_REQUEST 0x36 int main() { int fd; int result; struct termios oldtio, newtio; unsigned char buf[285]; printf("Opening device\n"); fd=open(DEV, O_RDWR | O_NOCTTY); if(fd<0) { perror(DEV); return 1; } result=tcgetattr(fd,&oldtio); if(result<0) { perror("tcgetattr"); return 1; } memcpy(&newtio,&oldtio,sizeof(struct termios)); newtio.c_cflag = B19200 | CRTSCTS | CS8 | CREAD; newtio.c_iflag = IGNPAR; newtio.c_oflag = 0; newtio.c_lflag = 0; newtio.c_cc[VMIN] = 1; newtio.c_cc[VTIME] = 0; result=tcflush(fd, TCIFLUSH); if(result<0) { perror("tcflush"); return 1; } result=tcsetattr(fd,TCSANOW,&newtio); if(result<0) { perror("tcsetattr"); return 1; } sleep(1); printf("Performing initial query\n"); buf[0]=TBAN_SER_SOURCE1; buf[1]=TBAN_SER_REQUEST; printf("Requesting status\n"); result=write(fd,buf,2); if(result<0) { perror("write"); return 1; } sleep(1); printf("Reading status\n"); result=read(fd,buf,32); if(result<0) { perror("read"); return 1; } result=tcsetattr(fd,TCSANOW,&oldtio); if(result<0) { perror("tcsetattr"); return 1; } result=close(fd); if(result<0) { perror("close"); return 1; } return 0; } It hangs while reading independently of the number of bits I am reading. Here is the output from dmesg when I load the uftdi module: Sep 20 21:31:31 ldaemon kernel: uftdi0: on usbus6 Sep 20 21:31:31 ldaemon kernel: ucom_attach_tty:317: tp = 0xffffff001f12b400, unit = 0 Sep 20 21:31:31 ldaemon kernel: ucom_attach_tty:346: ttycreate: U0 Sep 20 21:31:34 ldaemon root: Unknown USB device: vendor 0x051d product 0x0002 bus uhub0 Here is the output in /var/log/messages when I enable the debug output for ucom and uftdi: Sep 20 21:33:30 ldaemon kernel: ucom_open:554: tp = 0xffffff001f12b400 Sep 20 21:33:30 ldaemon kernel: ucom_dtr:827: onoff = 1 Sep 20 21:33:30 ldaemon kernel: ucom_line_state:799: on=0x01, off=0x00 Sep 20 21:33:30 ldaemon kernel: ucom_rts:838: onoff = 1 Sep 20 21:33:30 ldaemon kernel: ucom_line_state:799: on=0x02, off=0x00 Sep 20 21:33:30 ldaemon kernel: ucom_break:816: onoff = 0 Sep 20 21:33:30 ldaemon kernel: ucom_line_state:799: on=0x00, off=0x04 Sep 20 21:33:30 ldaemon kernel: ucom_status_change:901: Sep 20 21:33:30 ldaemon kernel: ucom_param:950: sc = 0xffffff001f12ac58 Sep 20 21:33:30 ldaemon kernel: uftdi_pre_param:653: Sep 20 21:33:30 ldaemon kernel: ucom_dtr:827: onoff = 1 Sep 20 21:33:30 ldaemon kernel: ucom_line_state:799: on=0x01, off=0x00 Sep 20 21:33:30 ldaemon kernel: ucom_rts:838: onoff = 1 Sep 20 21:33:30 ldaemon kernel: ucom_line_state:799: on=0x02, off=0x00 Sep 20 21:33:30 ldaemon kernel: ucom_cfg_open:520: Sep 20 21:33:30 ldaemon kernel: uftdi_cfg_open:354: Sep 20 21:33:30 ldaemon kernel: uftdi_read_callback:459: status change msr=0xf0 (0x00) lsr=0x60 (0x00) Sep 20 21:33:30 ldaemon kernel: ucom_status_change:901: Sep 20 21:33:30 ldaemon kernel: uftdi_cfg_get_status:705: msr=0xf0 lsr=0x60 Sep 20 21:33:30 ldaemon kernel: ucom_cfg_status_change:887: DCD changed to 1 Sep 20 21:33:30 ldaemon kernel: uftdi_cfg_param:672: Sep 20 21:33:30 ldaemon kernel: ucom_ioctl:653: cmd = 0x402c7413 Sep 20 21:33:30 ldaemon kernel: ucom_ioctl:653: cmd = 0x80047410 Sep 20 21:33:30 ldaemon kernel: ucom_ioctl:653: cmd = 0x802c7414 Sep 20 21:33:30 ldaemon kernel: ucom_param:950: sc = 0xffffff001f12ac58 Sep 20 21:33:30 ldaemon kernel: uftdi_pre_param:653: Sep 20 21:33:30 ldaemon kernel: uftdi_cfg_get_status:705: msr=0xf0 lsr=0x60 Sep 20 21:33:30 ldaemon kernel: uftdi_cfg_param:672: Sep 20 21:33:30 ldaemon kernel: ucom_get_data:1064: cnt=0 Sep 20 21:33:31 ldaemon kernel: ucom_ioctl:653: cmd = 0x80047410 Sep 20 21:33:32 ldaemon kernel: ucom_outwakeup:1009: sc = 0xffffff001f12ac58 Sep 20 21:33:32 ldaemon kernel: ucom_get_data:1064: cnt=2 Sep 20 21:33:32 ldaemon kernel: ucom_get_data:1064: cnt=0 I really need to get this working so I am ready to test things as much as I can... Thanks a lot! Pierre-Luc Drouin