From owner-freebsd-usb@FreeBSD.ORG Sat Jan 29 18:00:43 2005 Return-Path: Delivered-To: freebsd-usb@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 4C83216A55A for ; Sat, 29 Jan 2005 18:00:43 +0000 (GMT) Received: from mailfe10.swip.net (mailfe10.swipnet.se [212.247.155.33]) by mx1.FreeBSD.org (Postfix) with ESMTP id 020D743D46 for ; Sat, 29 Jan 2005 18:00:23 +0000 (GMT) (envelope-from hselasky@c2i.net) X-T2-Posting-ID: Y1QAsIk9O44SO+J/q9KNyQ== Received: from [193.217.202.190] (HELO curly.tele2.no) by mailfe10.swip.net (CommuniGate Pro SMTP 4.2.7) with ESMTP id 75970707; Sat, 29 Jan 2005 19:00:20 +0100 Received: (from root@localhost) by curly.tele2.no (8.12.5/8.12.3) id j0TI7sNs000623; Sat, 29 Jan 2005 19:07:54 +0100 (CET) (envelope-from hselasky@c2i.net) Date: Sat, 29 Jan 2005 19:07:52 +0100 From: Hans Petter Selasky To: Kiselev <1801@083.pfr.ru>, freebsd-usb@freebsd.org Message-ID: <20050129190752.A347@curly.tele2.no> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: ; from 1801@083.pfr.ru on Sat, Jan 29, 2005 at 06:23:45PM +0300 Subject: Re: Re: problem with udbp and netgraph in the usb LAN X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 29 Jan 2005 18:00:44 -0000 On Sat, Jan 29, 2005 at 06:23:45PM +0300, Kiselev wrote: > On Thu, Jan 27, 2005 at 09:54:14AM +0300, 1801 wrote: > > Hi, all > > I have usb2usb link cable (no name)and try make usb network on two > > hosts (FreeBSD 5.3). > > I do everything as written in man 4 udbp: > > kldload netgraph > > kldload udbp > > Result : > > udbp0: Prolific Technology Inc. PL2302 Host-Host interface, rev > > 1.00/0.01, addr2, iclass 255/0. > > Then make: > > ngctl mkpeer udbp0: iface data inet, ifconfig ng0 10.0.0.1 10.0.0.2 on > > both hosts. I assume that you use ifconfig ng0 10.0.0.2 10.0.0.1 on the remote host. > > How to make steady connection? > > Thanks in advance, Yuri. > > >> What kind of USB controller do you have? > >> Looking through the code I found this problem: > >> If a transmitted packet has a length that is divisible by > >> "MaxPacketLength" then udbp_in_transfer_cb() will not be called. In > >> other words the transmission will stop. So when udbp is sending > >> packets, the flag USBD_FORCE_SHORT_XFER must be set? > >> > >> -- > >> HPS > > My USB controller is: > ohci0: mem 0xee000000-0xee000fff irq 20 at > device 2.2 > on pci0 > ohci0: [GIANT-LOCKED] > usb0: on ohci0 > ohci1: mem 0xee001000-0xee001fff irq 23 at > device 2.3 > on pci0 > ohci1: [GIANT-LOCKED] > usb1: on ohci1. > How to execute the idea set the flag USBD_FORCE_SHORT_XFER? > I do not found anything in the(sysctl, rc.conf, GENERIC), and what to > correct in > the /usr/src/sys/dev/usb/ohci.c: if ((flags & USBD_FORCE_SHORT_XFER) && > i don't know. > Thanks in advance, Yuri > In the file /usr/src/sys/dev/usb/udbp.c: Add "#define USB_DEBUG" at the beginning. In the function udbp_setup_out_transfer() change: (void) usbd_setup_xfer( sc->sc_bulkout_xfer, sc->sc_bulkout_pipe, priv, sc->sc_bulkout_buffer, pktlen, USBD_SHORT_XFER_OK, UDBP_TIMEOUT, udbp_out_transfer_cb); into: (void) usbd_setup_xfer( sc->sc_bulkout_xfer, sc->sc_bulkout_pipe, priv, sc->sc_bulkout_buffer, pktlen, USBD_SHORT_XFER_OK|USBD_FORCE_SHORT_XFER, UDBP_TIMEOUT, udbp_out_transfer_cb); Then "cd /usr/src/sys/modules/udbp" and "make clean" and "make all install clean" Unplug your device. Reload the udbp module or reboot the computer. Run "sysctl hw.usb.udbp.debug=15", plug your device and try again. -- HPS