Date: Thu, 29 Nov 2012 01:35:56 -0700 From: PseudoCylon <moonlightakkiy@yahoo.ca> To: Ramanujan Seshadri <ksramanujan@gmail.com> Cc: freebsd-net@freebsd.org Subject: Re: Ralink RT2860 Driver Code Message-ID: <CAFZ_MYKDGDHDi7iax5gR2trJ9expv-km9=cwCgKNHZF2h8ip2Q@mail.gmail.com> In-Reply-To: <CAK=C58%2BGPSTRZRWPE-c-9vwAECoV5pG8a7P7bv4uqDi_hqiNFA@mail.gmail.com> References: <CAFZ_MYKUAtz=Lem-LQsC_Jgw6zzWPx6EibxJqrCB32faWx8PVA@mail.gmail.com> <CAK=C58%2B3bnU=_jqtitT8cauO9_CSuvAhMpp7VAgCp4h6EBhXyQ@mail.gmail.com> <CAFZ_MY%2Bm=YNMC6iODQuSkEt7-UU=hAEgXLxqgiCoO%2Bgtu3O%2BHA@mail.gmail.com> <CAK=C58%2BGPSTRZRWPE-c-9vwAECoV5pG8a7P7bv4uqDi_hqiNFA@mail.gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, Nov 28, 2012 at 9:35 PM, Ramanujan Seshadri <ksramanujan@gmail.com> 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 <moonlightakkiy@yahoo.ca> > wrote: >> >> On Tue, Nov 27, 2012 at 1:23 PM, Ramanujan Seshadri >> <ksramanujan@gmail.com> 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 <moonlightakkiy@yahoo.ca> >> > wrote: >> >> >> >> > ------------------------------ >> >> > >> >> > Message: 12 >> >> > Date: Tue, 27 Nov 2012 04:33:37 -0500 >> >> > From: Ramanujan Seshadri <ksramanujan@gmail.com> >> >> > To: freebsd-net@freebsd.org >> >> > Subject: Ralink RT2860 Driver Code >> >> > Message-ID: >> >> > >> >> > <CAK=C58L7YAp+YGk3PZ2VJG9toaKWcBHHi7xsaxth6-KYf0d6xg@mail.gmail.com> >> >> > 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 >> >> > ******************************************* >> > >> > > >
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAFZ_MYKDGDHDi7iax5gR2trJ9expv-km9=cwCgKNHZF2h8ip2Q>