linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Luis R. Rodriguez" <mcgrof@gmail.com>
To: John Linville <linville@tuxdriver.com>
Cc: linux-wireless@vger.kernel.org, Jiri Slaby <jirislaby@gmail.com>,
	Nick Kossifidis <mickflemm@gmail.com>
Subject: [PATCH 7/7] ath5k: Add documentation for struct ath5k_rate
Date: Thu, 1 Nov 2007 00:40:59 -0400	[thread overview]
Message-ID: <20071101044059.GH21987@pogo> (raw)
In-Reply-To: <20071101043933.GG21987@pogo>

This adds documentation for struct ath5k_rate. This also removes
some unused variables, lp_ack_duration and sp_ack_duration which
are simply unnecessary. We obviously have information about the rest
of the rate values, we can add more as we go, this just starts this up.
I'll next target cleaning up the RATE macros, think that may be there
the other G mode issues are in.

Changes to ath5k.h
Changes-licensed-under: ISC

Signed-off-by: Luis R. Rodriguez <mcgrof@gmail.com>
---
 drivers/net/wireless/ath5k/ath5k.h |   58 +++++++++++++++++++++++++++++++----
 1 files changed, 51 insertions(+), 7 deletions(-)

diff --git a/drivers/net/wireless/ath5k/ath5k.h b/drivers/net/wireless/ath5k/ath5k.h
index c8ab09a..7147fb4 100644
--- a/drivers/net/wireless/ath5k/ath5k.h
+++ b/drivers/net/wireless/ath5k/ath5k.h
@@ -549,17 +549,61 @@ struct ath5k_athchan_2ghz {
  * 	 used by the rate control algorytm on MadWiFi.
  */
 
-#define AR5K_MAX_RATES	32 /*max number of rates on the rate table*/
+/* Max number of rates on the rate table and what it seems 
+ * Atheros hardware supports */
+#define AR5K_MAX_RATES 32
 
+/**
+ * struct ath5k_rate - rate structure
+ *
+ * This structure is used to get the RX rate or set the TX rate on the
+ * hardware descriptors. It is also used for internal modulation control
+ * and settings.
+ *
+ * @valid: is this a valid rate for the current mode
+ * @modulation: respective mac80211 modulation
+ * @rate_kbps: rate in kbit/s
+ * @rate_code: hardware rate value, used in &struct ath5k_desc, on RX on
+ *     &struct ath5k_rx_status.rs_rate and on TX on
+ *     &struct ath5k_tx_status.ts_rate. Seems the ar5xxx harware supports
+ *     up to 32 rates, indexed by 1-32. This means we really only need 
+ *     6 bits for the rate_code.
+ * @dot11_rate: respective IEEE-802.11 rate value
+ * @control_rate: index of rate assumed to be used to send control frames.
+ *     This can be used to set override the value on the rate duration
+ *     registers. This is only useful if we can override in the harware at
+ *     what rate we want to send control frames at. Note that IEEE-802.11
+ *     Ch. 9.6 (after IEEE 802.11g changes) defines the rate at which we
+ *     should send ACK/CTS, if we change this value we can be breaking 
+ *     the spec.
+ *
+ * On RX after the &struct ath5k_desc is parsed by the appropriate 
+ * ah_proc_rx_desc() the respective hardware rate value is set in 
+ * &struct ath5k_rx_status.rs_rate. On TX the desired rate is set in
+ * &struct ath5k_tx_status.ts_rate which is later used to setup the
+ * &struct ath5k_desc correctly. This is the hardware rate map we are
+ * aware of:
+ *
+ * rate_code   1       2       3       4       5       6       7       8
+ * rate_kbps   3000    ?       ?       ?       ?       ?       ?       ?
+ *
+ * rate_code   9       10      11      12      13      14      15      16
+ * rate_kbps   ?       ?       ?       ?       ?       ?       ?       ?
+ *
+ * rate_code   17      18      19      20      21      22      23      24
+ * rate_kbps   ?       ?       ?       ?       ?       ?       ?       ?
+ *
+ * rate_code   25      26      27      28      29      30      31      32
+ * rate_kbps   ?       ?       ?       ?       ?       ?       ?       ?
+ *
+ */
 struct ath5k_rate {
-	u8	valid;		/* Valid for rate control */
+	u8	valid;
 	u32	modulation;
-	u16	rate_kbps;	/* Rate in kbps used in computetxtime */
-	u8	rate_code;	/* Rate mapping for h/w descriptors */
+	u16	rate_kbps;
+	u8	rate_code;
 	u8	dot11_rate;
-	u8	control_rate;	/* Rate for management frames -not used */
-	u16	lp_ack_duration;/* long preamble ACK duration -not used */
-	u16	sp_ack_duration;/* short preamble ACK duration -not used */
+	u8	control_rate;
 };
 
 /* XXX: GRR all this stuff to get leds blinking ??? (check out setcurmode) */
-- 
1.5.2.5


  reply	other threads:[~2007-11-01  4:41 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-11-01  4:35 [PATCH 2/7] ath5k: Remove opaque pointers from ath5k_hw_attach() Luis R. Rodriguez
2007-11-01  4:37 ` [PATCH 3/7] ath5k: Clean up ath5k rate duration settings Luis R. Rodriguez
2007-11-01  4:38   ` [PATCH 4/7] ath5k: Fix clock on OFDM timing computation Luis R. Rodriguez
2007-11-01  4:38     ` [PATCH 5/7] ath5k: Move OFDM timings into a helper routine Luis R. Rodriguez
2007-11-01  4:39       ` [PATCH 6/7] ath5k: Clear up settings of AR5K_RSSI_THR register settings Luis R. Rodriguez
2007-11-01  4:40         ` Luis R. Rodriguez [this message]
2007-11-01 13:16           ` [PATCH 7/7] ath5k: Add documentation for struct ath5k_rate Nick Kossifidis
2007-11-01 16:47             ` Luis R. Rodriguez
2007-11-01 21:56           ` Luis R. Rodriguez
2007-11-01 22:06             ` Randy Dunlap
2007-11-02  3:11               ` Luis R. Rodriguez
2007-11-01 13:27         ` [PATCH 6/7] ath5k: Clear up settings of AR5K_RSSI_THR register settings Nick Kossifidis
2007-11-01 21:55         ` Luis R. Rodriguez
2007-11-01 21:53       ` [PATCH 5/7] ath5k: Move OFDM timings into a helper routine Luis R. Rodriguez
2007-11-01 21:57         ` Jiri Slaby
2007-11-01 22:01           ` Luis R. Rodriguez
2007-11-01 22:02             ` Jiri Slaby
2007-11-01 22:21           ` Jiri Slaby
2007-11-01 22:27             ` Nick Kossifidis
2007-11-01 21:50   ` [PATCH 3/7] ath5k: Clean up ath5k rate duration settings Luis R. Rodriguez
2007-11-01 13:06 ` [PATCH 2/7] ath5k: Remove opaque pointers from ath5k_hw_attach() Nick Kossifidis
2007-11-01 17:27 ` Christoph Hellwig
2007-11-01 18:44   ` Luis R. Rodriguez

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20071101044059.GH21987@pogo \
    --to=mcgrof@gmail.com \
    --cc=jirislaby@gmail.com \
    --cc=linux-wireless@vger.kernel.org \
    --cc=linville@tuxdriver.com \
    --cc=mickflemm@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).