From owner-freebsd-net@FreeBSD.ORG Sun Dec 2 03:38:26 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 9DCD2364 for ; Sun, 2 Dec 2012 03:38:26 +0000 (UTC) (envelope-from moonlightakkiy@yahoo.ca) Received: from nm14-vm0.bullet.mail.bf1.yahoo.com (nm14-vm0.bullet.mail.bf1.yahoo.com [98.139.213.164]) by mx1.freebsd.org (Postfix) with ESMTP id 01B7C8FC0C for ; Sun, 2 Dec 2012 03:38:25 +0000 (UTC) Received: from [98.139.215.141] by nm14.bullet.mail.bf1.yahoo.com with NNFMP; 02 Dec 2012 03:38:24 -0000 Received: from [98.139.213.12] by tm12.bullet.mail.bf1.yahoo.com with NNFMP; 02 Dec 2012 03:38:24 -0000 Received: from [127.0.0.1] by smtp112.mail.bf1.yahoo.com with NNFMP; 02 Dec 2012 03:38:24 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.ca; s=s1024; t=1354419504; bh=gDgQb+NYGEbZG5K2h4Hfjk2kihIV/REgvVGw7DKkxic=; 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=NtV4e6RI5Htm0wV4/08YsYFB+KeD1IEp9WH61uqhjRKGW1BUriPp6w5ScJi/33XQW1A33OmXcLLRCAg6EMo/BEbZLhYBrbe7FBYePRycljFdrOEN2IVfO9J8j0lir5b15Tg5mPPXm3iqqeOwh7efXxzWseMMD9zm6FUyzoQBy78= X-Yahoo-Newman-Id: 713105.73332.bm@smtp112.mail.bf1.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: ezmBgt8VM1kDHqNXfrVqnXF5lJw_JZXFwbqQszOidZgXG8k w0BDIIdHfRZaHHw3vccIm44_yQg50qbTMr79llAQuOT2O3yeabWTZEuonxYo dK58sAw3HQLU2iks5Q9KYiZsF0iltq1IW48fNJT5.TslSAloWwlt5CojYzFI lyxtfdFEkr.QWgTDH0UoTbfIws9q7343c8MO.OmeOvPkhcOoFa3Zb87Z6nfb TOnoXucSoMCFswFXyjztQwNH2L7MvkwQeUMC2Uj4zPn6H_WJqhfefUUZPVi4 QR9ha.A.phZkuBpXh09YaBCMla3OIjP2WJBrnnrmW9hY21TY7WO3bwJcYhiX KDu.OnS4mAHyvxtYiNoyl2qZD85vKgEkl_kL_.uNBl6Hr2P4.Oplw42l3uhP fXZPdqEfSID5olHOe361SnT8H8G0bWNJqAkIpMtZAjuvM.K2nJMRAfEdjfPm Afx.PmQaRgZOXAYr4vLBuFs0n5.ZZHpC.nsGnfWqBsMck8MU4F_Lu6_bm93c Z6VTj5PYNI20U0BVC5HHlh_DRb85rRrM53cUd87X.Y6aQoEit_DB8soxamZ7 eyhb64ykgz5H90iQLN5FQ7oWqaYTO6P3oumy1miedW5ZqjFEB2Jyt3klRDg- - X-Yahoo-SMTP: Xr6qjFWswBAEmd20sAvB4Q3keqXvXsIH9TjJ Received: from mail-vc0-f182.google.com (moonlightakkiy@209.85.220.182 with plain) by smtp112.mail.bf1.yahoo.com with SMTP; 01 Dec 2012 19:38:24 -0800 PST Received: by mail-vc0-f182.google.com with SMTP id fo14so1112501vcb.13 for ; Sat, 01 Dec 2012 19:38:24 -0800 (PST) MIME-Version: 1.0 Received: by 10.58.12.231 with SMTP id b7mr5401465vec.31.1354419504218; Sat, 01 Dec 2012 19:38:24 -0800 (PST) Received: by 10.58.182.72 with HTTP; Sat, 1 Dec 2012 19:38:23 -0800 (PST) In-Reply-To: References: Date: Sat, 1 Dec 2012 20:38:23 -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: Sun, 02 Dec 2012 03:38:26 -0000 On Sat, Dec 1, 2012 at 3:08 PM, Ramanujan Seshadri wrote: > Hello, > Thanks for the explanation. In fact when i saw the code i also thought the > same, but when i tried > to print out the transmitted A-MPDU's i found something different. > > For example, > The Counter AggSize15Count should print the the numbers in the multiples > of 15, but sometimes it doesn't. > So, my understanding is that, the MPDU's are written into these registers, > and then an ampdu is formed only when there > are enough number of MPDU;s. For example, AggSize15Count sometimes show the > counter as 54, so > there would be only (54/15) == 3 ampdu's ( 9 remainder). > > But, then i am not sure what will happen to the remaining 9 MPDU's. Does > the register wait for 6 more MPDU's > so that it can aggregate 15 MPDU's to form 1 ampdu or does it write to a > different registry like > AggSize9Count where these 9 MPDU's can get aggregated to an ampdu. > > Can you please explain ? Maybe, re-transmitted packets were counted multiple times. If you need to know exactly what is going on, you have to figure out, i.e by reading BA packet or checking what other end is receiving. Unfortunately, this is what you need to do when you are writing a driver without proper documentation. AK > > -Ram > > On Thu, Nov 29, 2012 at 3:35 AM, PseudoCylon > wrote: >> >> 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 >> >> >> > ******************************************* >> >> > >> >> > >> > >> > > >