From owner-freebsd-drivers@FreeBSD.ORG Mon May 12 15:18:10 2008 Return-Path: Delivered-To: freebsd-drivers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6CCC6106564A for ; Mon, 12 May 2008 15:18:10 +0000 (UTC) (envelope-from matthias.apitz@oclc.org) Received: from hunter.Sisis.de (mail.oclc.de [193.31.11.194]) by mx1.freebsd.org (Postfix) with ESMTP id CC3628FC18 for ; Mon, 12 May 2008 15:18:09 +0000 (UTC) (envelope-from matthias.apitz@oclc.org) Received: (from mail@localhost) by hunter.Sisis.de (8.8.8/8.8.8) id RAA21692; Mon, 12 May 2008 17:03:20 +0200 (CEST) (envelope-from matthias.apitz@oclc.org) Received: from ppp-88-217-63-116.dynamic.mnet-online.de(88.217.63.116) by hunter.Sisis.de via smap (V2.1) id xma021636; Mon, 12 May 08 17:02:43 +0200 Received: (from guru@localhost) by rebelion.Sisis.de (8.14.2/8.13.8/Submit) id m4CFAEPD015683; Mon, 12 May 2008 17:10:14 +0200 (CEST) (envelope-from matthias.apitz@oclc.org) X-Authentication-Warning: rebelion.Sisis.de: guru set sender to matthias.apitz@oclc.org using -f Date: Mon, 12 May 2008 17:10:14 +0200 From: Matthias Apitz To: Niki Denev Message-ID: <20080512151013.GA15571@rebelion.Sisis.de> References: <20080509123521.GA11366@rebelion.Sisis.de> <20080510163417.GA17718@rebelion.Sisis.de> <2e77fc10805101008ybafe7b3g8b9210cb8d2955d@mail.gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <2e77fc10805101008ybafe7b3g8b9210cb8d2955d@mail.gmail.com> User-Agent: Mutt/1.4.2.3i X-Operating-System: FreeBSD 7.0-RELEASE (i386) Cc: freebsd-drivers@freebsd.org Subject: Re: porting "nozomi" driver (Option N.V. GlobeTrotter 3G+ UMTS datacard) to FreeBSD 7.0R X-BeenThere: freebsd-drivers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Matthias Apitz List-Id: Writing device drivers for FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 May 2008 15:18:10 -0000 El día Saturday, May 10, 2008 a las 01:08:00PM -0400, Niki Denev escribió: > I can see that this is the initial port of the Linux nozomi driver that i did > back in 2006, and i got stuck exactly with the same problem, > ppp connection get's established, but only small packets are passed. > I will see if I can get my hands on this HSDPA/UMTS card > (i don't have it anymore) and help. Niki, I've solved the problem of the TCP packages by putting in nzstart() what is coming down from PPPD in pieces of fifo_buf of not more then 68 bytes, i.e. if 108 bytes is to queued it will be splited, malloc'ed and nzstart() calls STAILQ_INSERT_TAIL() with two pieces; this works fine now; remaining is what I've posted in the forum of the Linux driver: http://www.pharscape.org/component/option,com_forum/Itemid,68/page,viewtopic/p,1745/#1745 ... this makes SSH now happy and a log with TCPDUMP on both ends (in the PPP interface and the ETH0 interface of the SSH server) proofes that the data is flooding fine, nearly fine; I could already sing-on to the SSH server two times; the problem is that upstream data is not send fast enough, which let's the server missing the ACK which should come in with that data and resent its packages again; this occures if the TCP packages are big, let's say some 700 bytes; it never occurs with short packages, nor with the short LCP, and once you are logged in you can type chars fine and the output of 'ls -lR /' is coming down at normal speed; I've a full log, showing the send and received data, together with the interrupts and as well I've inserted what the TCPDUMP on the PPPD side sees, i.e. which TCP it sees outcoming from the driver and which it wants to send through the driver; I've put it here, if someone could help me with a look and some hint: http://www.unixarea.de/nozomi/messages+tcp.txt What could be the reason for not sending fast enough the data? As I said, downstream all is fine. Is there some technical documente available for that card Option N.V. GlobeTrotter 3G+? Thx in advance for any hint Matthias -- Matthias Apitz Manager Technical Support - OCLC GmbH Gruenwalder Weg 28g - 82041 Oberhaching - Germany t +49-89-61308 351 - f +49-89-61308 399 - m +49-170-4527211 e - w http://www.oclc.org/ http://www.UnixArea.de/ b http://gurucubano.blogspot.com/ Don't top-post, read RFC1855 http://www.faqs.org/rfcs/rfc1855.html A: Because it messes up the order in which people normally read text. Q: Why is it such a bad thing? A: Top-posting. Q: What is the most annoying thing on Usenet and in e-mail? From owner-freebsd-drivers@FreeBSD.ORG Tue May 13 18:17:12 2008 Return-Path: Delivered-To: freebsd-drivers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 464DA106566B for ; Tue, 13 May 2008 18:17:12 +0000 (UTC) (envelope-from sbruno@miralink.com) Received: from plato.miralink.com (mail.miralink.com [70.103.185.20]) by mx1.freebsd.org (Postfix) with ESMTP id 191FD8FC20 for ; Tue, 13 May 2008 18:17:11 +0000 (UTC) (envelope-from sbruno@miralink.com) Received: from localhost (localhost.localdomain [127.0.0.1]) by plato.miralink.com (Postfix) with ESMTP id 9701D1C8052 for ; Tue, 13 May 2008 11:17:11 -0700 (PDT) Received: from plato.miralink.com ([127.0.0.1]) by localhost (plato.miralink.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 15968-01 for ; Tue, 13 May 2008 11:17:10 -0700 (PDT) Received: from iago.office.miralink.com (iago.office.miralink.com [10.0.0.40]) by plato.miralink.com (Postfix) with ESMTP id 712781C803D for ; Tue, 13 May 2008 11:17:10 -0700 (PDT) Message-ID: <4829DB26.4070306@miralink.com> Date: Tue, 13 May 2008 11:17:10 -0700 From: Sean Bruno User-Agent: Thunderbird 2.0.0.14 (X11/20080501) MIME-Version: 1.0 To: freebsd-drivers@freebsd.org Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-DSPAM-Result: Innocent X-DSPAM-Processed: Tue May 13 11:17:11 2008 X-DSPAM-Confidence: 0.9997 X-DSPAM-Probability: 0.0000 X-DSPAM-Signature: 4829db27163981592213743 X-DSPAM-Factors: 27, X-Virus-Scanned: amavisd-new at X-Spam-Status: No, score=-4.481 tagged_above=-10 required=6.6 autolearn=ham tests=[ALL_TRUSTED=-1.8, AWL=0.018, BAYES_00=-2.599, DSPAM_HAM=-0.1] X-Spam-Score: -4.481 X-Spam-Level: Subject: Realtek Ethernet Cards(new PCI IDS)? X-BeenThere: freebsd-drivers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Writing device drivers for FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 May 2008 18:17:12 -0000 I seem to have a motherboard (Jetway 7K4K1G5D-LF) that has a Realtek ethernet controller. The driver is not picking up this controller under RELENG_63? none0@pci0:9:0: class=0x020000 card=0x10ec16f3 chip=0x816710ec rev=0x10 hdr=0x00 vendor = 'Realtek Semiconductor' device = 'RTL8169/8110 Family Gigabit Ethernet NIC' class = network subclass = ethernet none1@pci0:11:0: class=0x020000 card=0x10ec16f3 chip=0x816710ec rev=0x10 hdr=0x00 vendor = 'Realtek Semiconductor' device = 'RTL8169/8110 Family Gigabit Ethernet NIC' class = network subclass = ethernet When I load the if_rl module, I get the following: Source # kldload if_rl pci0: driver added found-> vendor=0x10ec, dev=0x8167, revid=0x10 bus=0, slot=9, func=0 class=02-00-00, hdrtype=0x00, mfdev=0 cmdreg=0x0007, statreg=0x02b0, cachelnsz=16 (dwords) lattimer=0x20 (960 ns), mingnt=0x20 (8000 ns), maxlat=0x40 (16000 ns) intpin=a, irq=18 powerspec 2 supports D0 D1 D2 D3 current D0 pci0:9:0: reprobing on driver added found-> vendor=0x10ec, dev=0x8167, revid=0x10 bus=0, slot=11, func=0 class=02-00-00, hdrtype=0x00, mfdev=0 cmdreg=0x0007, statreg=0x02b0, cachelnsz=16 (dwords) lattimer=0x20 (960 ns), mingnt=0x20 (8000 ns), maxlat=0x40 (16000 ns) intpin=a, irq=19 powerspec 2 supports D0 D1 D2 D3 current D0 pci0:11:0: reprobing on driver added pci1: driver added found-> vendor=0x1106, dev=0x3344, revid=0x01 bus=1, slot=0, func=0 class=03-00-00, hdrtype=0x00, mfdev=0 cmdreg=0x0007, statreg=0x0230, cachelnsz=0 (dwords) lattimer=0x20 (960 ns), mingnt=0x02 (500 ns), maxlat=0x00 (0 ns) intpin=a, irq=16 powerspec 2 supports D0 D1 D2 D3 current D0 pci1:0:0: reprobing on driver added From owner-freebsd-drivers@FreeBSD.ORG Tue May 13 18:20:55 2008 Return-Path: Delivered-To: freebsd-drivers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AA88E1065673 for ; Tue, 13 May 2008 18:20:55 +0000 (UTC) (envelope-from sbruno@miralink.com) Received: from plato.miralink.com (mail.miralink.com [70.103.185.20]) by mx1.freebsd.org (Postfix) with ESMTP id 81F478FC1B for ; Tue, 13 May 2008 18:20:55 +0000 (UTC) (envelope-from sbruno@miralink.com) Received: from localhost (localhost.localdomain [127.0.0.1]) by plato.miralink.com (Postfix) with ESMTP id 5C5BB1C8052 for ; Tue, 13 May 2008 11:20:55 -0700 (PDT) Received: from plato.miralink.com ([127.0.0.1]) by localhost (plato.miralink.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 15968-03 for ; Tue, 13 May 2008 11:20:54 -0700 (PDT) Received: from iago.office.miralink.com (iago.office.miralink.com [10.0.0.40]) by plato.miralink.com (Postfix) with ESMTP id 342F11C803D for ; Tue, 13 May 2008 11:20:54 -0700 (PDT) Message-ID: <4829DC05.2040108@miralink.com> Date: Tue, 13 May 2008 11:20:53 -0700 From: Sean Bruno User-Agent: Thunderbird 2.0.0.14 (X11/20080501) MIME-Version: 1.0 To: freebsd-drivers@freebsd.org References: <4829DB26.4070306@miralink.com> In-Reply-To: <4829DB26.4070306@miralink.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-DSPAM-Result: Innocent X-DSPAM-Processed: Tue May 13 11:20:55 2008 X-DSPAM-Confidence: 0.9997 X-DSPAM-Probability: 0.0000 X-DSPAM-Signature: 4829dc07172692362839998 X-DSPAM-Factors: 27, X-Virus-Scanned: amavisd-new at X-Spam-Status: No, score=-4.483 tagged_above=-10 required=6.6 autolearn=ham tests=[ALL_TRUSTED=-1.8, AWL=0.016, BAYES_00=-2.599, DSPAM_HAM=-0.1] X-Spam-Score: -4.483 X-Spam-Level: Subject: Re: Realtek Ethernet Cards(new PCI IDS)? X-BeenThere: freebsd-drivers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Writing device drivers for FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 May 2008 18:20:55 -0000 Or, I am unable to read man pages and should use the "re" driver not the "rl" driver. Sorry for the noise. Sean Sean Bruno wrote: > I seem to have a motherboard (Jetway 7K4K1G5D-LF) that has a Realtek > ethernet controller. The driver is not picking up this controller > under RELENG_63? > > > > none0@pci0:9:0: class=0x020000 card=0x10ec16f3 chip=0x816710ec > rev=0x10 hdr=0x00 vendor = 'Realtek Semiconductor' > device = 'RTL8169/8110 Family Gigabit Ethernet NIC' > class = network > subclass = ethernet > none1@pci0:11:0: class=0x020000 card=0x10ec16f3 chip=0x816710ec > rev=0x10 hdr=0x00 > vendor = 'Realtek Semiconductor' > device = 'RTL8169/8110 Family Gigabit Ethernet NIC' > class = network > subclass = ethernet > > When I load the if_rl module, I get the following: > > Source # kldload if_rl > pci0: driver added > found-> vendor=0x10ec, dev=0x8167, revid=0x10 > bus=0, slot=9, func=0 > class=02-00-00, hdrtype=0x00, mfdev=0 > cmdreg=0x0007, statreg=0x02b0, cachelnsz=16 (dwords) > lattimer=0x20 (960 ns), mingnt=0x20 (8000 ns), maxlat=0x40 (16000 ns) > intpin=a, irq=18 > powerspec 2 supports D0 D1 D2 D3 current D0 > pci0:9:0: reprobing on driver added > found-> vendor=0x10ec, dev=0x8167, revid=0x10 > bus=0, slot=11, func=0 > class=02-00-00, hdrtype=0x00, mfdev=0 > cmdreg=0x0007, statreg=0x02b0, cachelnsz=16 (dwords) > lattimer=0x20 (960 ns), mingnt=0x20 (8000 ns), maxlat=0x40 (16000 ns) > intpin=a, irq=19 > powerspec 2 supports D0 D1 D2 D3 current D0 > pci0:11:0: reprobing on driver added > pci1: driver added > found-> vendor=0x1106, dev=0x3344, revid=0x01 > bus=1, slot=0, func=0 > class=03-00-00, hdrtype=0x00, mfdev=0 > cmdreg=0x0007, statreg=0x0230, cachelnsz=0 (dwords) > lattimer=0x20 (960 ns), mingnt=0x02 (500 ns), maxlat=0x00 (0 ns) > intpin=a, irq=16 > powerspec 2 supports D0 D1 D2 D3 current D0 > pci1:0:0: reprobing on driver added > > > > _______________________________________________ > freebsd-drivers@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-drivers > To unsubscribe, send any mail to > "freebsd-drivers-unsubscribe@freebsd.org" From owner-freebsd-drivers@FreeBSD.ORG Wed May 14 10:25:08 2008 Return-Path: Delivered-To: freebsd-drivers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7DDB91065677 for ; Wed, 14 May 2008 10:25:08 +0000 (UTC) (envelope-from Matthias.Apitz@oclc.org) Received: from mail.pica.nl (mail.pica.nl [192.87.44.30]) by mx1.freebsd.org (Postfix) with ESMTP id 1B1C38FC2F for ; Wed, 14 May 2008 10:25:07 +0000 (UTC) (envelope-from Matthias.Apitz@oclc.org) Received: from rebelion.Sisis.de ([193.31.10.34]) by mail.pica.nl with Microsoft SMTPSVC(6.0.3790.3959); Wed, 14 May 2008 12:28:13 +0200 Received: (from guru@localhost) by rebelion.Sisis.de (8.14.2/8.13.8/Submit) id m4EAP3mE006132 for freebsd-drivers@freebsd.org; Wed, 14 May 2008 12:25:03 +0200 (CEST) (envelope-from matthias.apitz@oclc.org) X-Authentication-Warning: rebelion.Sisis.de: guru set sender to matthias.apitz@oclc.org using -f Date: Wed, 14 May 2008 12:25:03 +0200 From: Matthias Apitz To: freebsd-drivers@freebsd.org Message-ID: <20080514102503.GA5862@rebelion.Sisis.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.4.2.3i X-Operating-System: FreeBSD 7.0-RELEASE (i386) X-OriginalArrivalTime: 14 May 2008 10:28:13.0221 (UTC) FILETIME=[36BA5550:01C8B5AD] Subject: question about tty->t_outq && clist && cblock X-BeenThere: freebsd-drivers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Matthias Apitz List-Id: Writing device drivers for FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 May 2008 10:25:08 -0000 Hello, I've some small questions about the struct 'clist', 'cblock' and 'tty' /usr/src/sys/sys/tty.h says about 'clist' /* * Clists are character lists, which is a variable length linked list * of cblocks, with a count of the number of characters in the list. */ struct clist { int c_cc; /* Number of characters in the clist. */ int c_cbcount; /* Number of cblocks. */ int c_cbmax; /* Max # cblocks allowed for this clist. */ int c_cbreserved; /* # cblocks reserved for this clist. */ char *c_cf; /* Pointer to the first cblock. */ char *c_cl; /* Pointer to the last cblock. */ }; and about 'tty' struct tty { struct clist t_rawq; /* Device raw input queue. */ long t_rawcc; /* Raw input queue statistics. */ struct clist t_canq; /* Device canonical queue. */ long t_cancc; /* Canonical queue statistics. */ struct clist t_outq; /* Device output queue. */ ... } and /usr/src/sys/sys/clist.h about 'cblock' struct cblock { struct cblock *c_next; /* next cblock in queue */ unsigned char c_quote[CBQSIZE]; /* quoted characters */ unsigned char c_info[CBSIZE]; /* characters */ }; In the driver it seems that tty->t_outq.c_cf is pointing to the data bytes itself which the driver should send to the device and not to a 'cblock' (the comment in 'clist' says *c_cf; is Pointer to the first cblock); is this just a small error in the comment and t_outq.c_cf is really pointing to cblock.c_info[]? what would be the correct way to pick up the next 'cblock' in that chain if there is already more data to deliver when for example tty->t_outq.c_cc says 810 bytes? picking up the 4 byte pointer at t_outq.c_cf - 20? thanks in advance for some clarification matthias -- Matthias Apitz http://www.UnixArea.de/ From owner-freebsd-drivers@FreeBSD.ORG Fri May 16 15:57:05 2008 Return-Path: Delivered-To: freebsd-drivers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 683FF106564A for ; Fri, 16 May 2008 15:57:05 +0000 (UTC) (envelope-from bounces@nabble.com) Received: from kuber.nabble.com (kuber.nabble.com [216.139.236.158]) by mx1.freebsd.org (Postfix) with ESMTP id 497B78FC14 for ; Fri, 16 May 2008 15:57:05 +0000 (UTC) (envelope-from bounces@nabble.com) Received: from isper.nabble.com ([192.168.236.156]) by kuber.nabble.com with esmtp (Exim 4.63) (envelope-from ) id 1Jx20A-000728-Cn for freebsd-drivers@freebsd.org; Fri, 16 May 2008 08:37:46 -0700 Message-ID: <17277776.post@talk.nabble.com> Date: Fri, 16 May 2008 08:37:46 -0700 (PDT) From: n4ti1us To: freebsd-drivers@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Nabble-From: gaspar_i@yahoo.com Subject: Spin locks and software IRQs. X-BeenThere: freebsd-drivers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Writing device drivers for FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 May 2008 15:57:05 -0000 Hi All, I was looking at the linux kernel, and in the implementation of spinlocks, one can use different functions. One of them is spin_lock_bh(). What it does is it creates a spin lock and disables the software irqs. In FreeBSD on the other hand, the implementation of spinlocks is done by mtx_lock_spin (which is actually a macro that calls mtx_lock_spin_flags()) but the problem is that is disables all the irq vector (at the bottom of the stack it executes an "cli"). Is there any way one can implement spinlocks that only disable the bottom half (sof irq)? Alternatively, what would be the best way to manualy disable the soft irqs? And all this makes me think... Why has nobody implemented a "_bh" version so far? Is this an architectural decision, or is it just me being blind? -- View this message in context: http://www.nabble.com/Spin-locks-and-software-IRQs.-tp17277776p17277776.html Sent from the freebsd-drivers mailing list archive at Nabble.com.