From owner-freebsd-net@FreeBSD.ORG Thu Nov 29 08:36:05 2012 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 27488F8 for ; Thu, 29 Nov 2012 08:36:05 +0000 (UTC) (envelope-from moonlightakkiy@yahoo.ca) Received: from nm8-vm1.bullet.mail.ne1.yahoo.com (nm8-vm1.bullet.mail.ne1.yahoo.com [98.138.91.65]) by mx1.freebsd.org (Postfix) with ESMTP id C354D8FC0C for ; Thu, 29 Nov 2012 08:36:04 +0000 (UTC) Received: from [98.138.226.177] by nm8.bullet.mail.ne1.yahoo.com with NNFMP; 29 Nov 2012 08:35:57 -0000 Received: from [98.138.226.124] by tm12.bullet.mail.ne1.yahoo.com with NNFMP; 29 Nov 2012 08:35:57 -0000 Received: from [127.0.0.1] by smtp203.mail.ne1.yahoo.com with NNFMP; 29 Nov 2012 08:35:57 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.ca; s=s1024; t=1354178157; bh=LHx4I7HWwC5y+0gRnrZmdP5u+RAkj1vRANFLyVBFmLQ=; h=X-Yahoo-Newman-Id:X-Yahoo-Newman-Property:X-YMail-OSG:X-Yahoo-SMTP:Received:Received:MIME-Version:Received:Received:In-Reply-To:References:Date:Message-ID:Subject:From:To:Cc:Content-Type; b=AuFKRyEFMVAi2QrzA3EskD+KeTmVEt6LL3RfVpSnhxJggP2ocuQMICJjKx5mYXM3Z48cN+lX8J9zm3fhz/Jvi0rDJPp6BtHRqR4yI6//eeGk1Kfxd9Kwrk+xxMKwKKilE5SXkh6Jyjn83YNjoY4VSqGJIdHjF750Et0Osxeg0r4= X-Yahoo-Newman-Id: 822722.40325.bm@smtp203.mail.ne1.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: XAfINfwVM1kiGY2iEL9gP6uoVGxc5NmqmhwrEf6xTve1TLd lEzjQVsg0jtNWrPNZYh2GQRJ4vJ.xFT38XZW4Z_4Kj3wR27i8uaWDy1tLGYk JPjWcsamkD526G86YsSdd0HgEaIp3f2ynwp4jKzg32xBvYST4qlInjbY5hV7 mQK44Q09Z7AX1xIacosmtzwW10n7f9t7p1k9uKx5VpJxY3yqjQvgacPrw__h a_CWLxDlhe9jD6KDwIfaKI8AcgImkE62z47HKUYxWOIwALFBs37y0LMywDJX 8JKMbDgwFyWIeRuoGYJWo8ayLQ660MmP7nmaOOKKYLr94kPmkvM6pt1rhcAq zltoqW5JMgbl_XjlFNtCKet85x8I73UOyKtSLY6.1h4qB8iytTs3g4447.jN bPx05tSKltPDNIUuJxHc5GhQld49XI4zq0RPXqoxWrYuI9cteUtoCE4LKiOS UYvcZRuT9bNgs50n4qY2kuJO47NIrrHVVWfTkQqtDiZvY7Bu6hpIxk4fcVoa TP6vENQtqjYaTlPDkBhRBOGf4zUwWEgVN0Ja_ysAcDAFhXhcbPcj.G6mSDJx 287ZIS4SAIJP2IFCd0R4vmwxL4Py3HtBwkC.NZmKQJL1qKE5MdFSq2g8D5g- - X-Yahoo-SMTP: Xr6qjFWswBAEmd20sAvB4Q3keqXvXsIH9TjJ Received: from mail-vc0-f182.google.com (moonlightakkiy@209.85.220.182 with plain) by smtp203.mail.ne1.yahoo.com with SMTP; 29 Nov 2012 00:35:57 -0800 PST Received: by mail-vc0-f182.google.com with SMTP id fo13so19605650vcb.13 for ; Thu, 29 Nov 2012 00:35:57 -0800 (PST) MIME-Version: 1.0 Received: by 10.58.132.229 with SMTP id ox5mr32083562veb.46.1354178157056; Thu, 29 Nov 2012 00:35:57 -0800 (PST) Received: by 10.58.182.72 with HTTP; Thu, 29 Nov 2012 00:35:56 -0800 (PST) In-Reply-To: References: Date: Thu, 29 Nov 2012 01:35:56 -0700 Message-ID: Subject: Re: Ralink RT2860 Driver Code From: PseudoCylon To: Ramanujan Seshadri Content-Type: text/plain; charset=ISO-8859-1 Cc: freebsd-net@freebsd.org X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Nov 2012 08:36:05 -0000 On Wed, Nov 28, 2012 at 9:35 PM, Ramanujan Seshadri wrote: > Hello, > > Thanks for the reply. I just had one more doubt. > > In the counters to update the transmitted A-MPDU counter (Function Name: > NICUpdateRawCounters), i saw these lines of codes > > pRalinkCounters->TransmittedAMPDUCount.u.LowPart += > TxAggCnt0.field.AggSize1Count; > pRalinkCounters->TransmittedAMPDUCount.u.LowPart += > (TxAggCnt0.field.AggSize2Count >> 1); > pRalinkCounters->TransmittedAMPDUCount.u.LowPart += > (TxAggCnt0.field.AggSize3Count /3); > . > . > . > . > pRalinkCounters->TransmittedAMPDUCount.u.LowPart += > (TxAggCnt0.field.AggSize15Count/ 15); > pRalinkCounters->TransmittedAMPDUCount.u.LowPart += > (TxAggCnt0.field.AggSize16Count >> 4); > > Can you please explain the reason why the 'i'th counter is being divided by > i, for example .TxAggCnt0.field.AggSize15Count is being divided by 15. [NB] For people who haven't seen Ralink's code, the above codes are theirs. I guess I didn't explain well. Those counters show number of mpdu packets, i.e. AggSize15Count == 30 means 30 mpdu or 2 (30/15) ampdu packets. (Because I don't have any datasheet, that how I interpret Ralink's code.) > > Also if these were little endian counters then i could not understand the > reason why the four counters "TxAggCnt0.field.AggSize2Count, > TxAggCnt0.field.AggSize4Count, TxAggCnt0.field.AggSize8Count > and TxAggCnt0.field.AggSize16Count " are shifted right by some bits, which > means that they are multiplying them (since it is little endian registers) > and why they are dividing the others. RTMP_IO_READ32() does byte swapping. The values should be saved into AggSizeNCount with host's byte order. So, right sifting means dividing regardless of the byte order. >>1 == /2 ... >>4 == /16 They are playing nice to CPUs, I think. AK > > Thanks for the help. > > -ram > > > On Tue, Nov 27, 2012 at 6:07 PM, PseudoCylon > wrote: >> >> On Tue, Nov 27, 2012 at 1:23 PM, Ramanujan Seshadri >> wrote: >> > I want to know how many MPDU's are aggregated in each AMPDU >> > transmission. >> >> You could use following statistic counters >> RT2860_TX_AGG_CNT0 to 7 >> >> https://gitorious.org/run/run/blobs/11n_rc3/dev/usb/wlan/if_runreg.h#line186 >> Each 32-bit little-endian read-on-clear register contains 2 16-bit >> counters (total 16 16-bit counters). >> counter at offset 0x1720 MPDU count 1 >> counter at offset 0x1722 MPDU count 2 >> ... >> counter at offset 0x173c MPDU count 15 >> counter at offset 0x173e MPDU count >= 16 >> >> These regs are identical on RT2800 and RT2700 (pci/usb). >> >> Example (see #if 0 part) >> https://gitorious.org/run/run/blobs/11n_rc3/dev/usb/wlan/if_run.c#line2493 >> >> You can only find out statistical numbers (total Tx counts past X >> sec). You cannot find out an MPDU count in a particular packet, i.e. >> an aggregated packet just Tx'd, unless you read the counters on each >> Tx. >> >> >> AK >> >> > >> > -ram >> > >> > >> > On Tue, Nov 27, 2012 at 2:11 PM, PseudoCylon >> > wrote: >> >> >> >> > ------------------------------ >> >> > >> >> > Message: 12 >> >> > Date: Tue, 27 Nov 2012 04:33:37 -0500 >> >> > From: Ramanujan Seshadri >> >> > To: freebsd-net@freebsd.org >> >> > Subject: Ralink RT2860 Driver Code >> >> > Message-ID: >> >> > >> >> > >> >> > Content-Type: text/plain; charset=ISO-8859-1 >> >> > >> >> > Hello, >> >> > Can i know how to get the MPDU's aggregated in each AMPDU in a >> >> > ralink >> >> > driver code for RT2860. I saw the existing counters of ralink and >> >> > tried >> >> > to >> >> > get some info, but was not very useful. >> >> > Any help is greatly appreciated. >> >> > >> >> >> >> https://gitorious.org/run/run/trees/11n_rc3/dev/usb/wlan >> >> >> >> What info are you trying to get? >> >> >> >> >> >> AK >> >> >> >> > Thanks >> >> > ram >> >> > >> >> > >> >> > ------------------------------ >> >> > >> >> > _______________________________________________ >> >> > freebsd-net@freebsd.org mailing list >> >> > http://lists.freebsd.org/mailman/listinfo/freebsd-net >> >> > To unsubscribe, send any mail to >> >> > "freebsd-net-unsubscribe@freebsd.org" >> >> > >> >> > End of freebsd-net Digest, Vol 504, Issue 2 >> >> > ******************************************* >> > >> > > >