linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: jketreno <jketreno@linux.intel.com>
To: Johannes Berg <johannes@sipsolutions.net>
Cc: Jiri Benc <jbenc@suse.cz>,
	linux-wireless <linux-wireless@vger.kernel.org>,
	"John W. Linville" <linville@tuxdriver.com>,
	Michael Wu <flamingice@sourmilk.net>
Subject: Re: Specifing rate control algorithm?
Date: Thu, 10 May 2007 12:36:38 -0700	[thread overview]
Message-ID: <46437446.6030302@linux.intel.com> (raw)
In-Reply-To: <1178817104.3806.33.camel@johannes.berg>

Johannes Berg wrote:
> On Thu, 2007-05-10 at 09:17 -0700, James Ketrenos wrote:
> 
>> This commit simply adds an optional rate control algorithm name
>> parameter to ieeee80211_register_hw.
> 
> Why don't we just add a char *preferred_rate_control; to the hw
> definition structure instead? That way, we can even show it in
> sys/debugfs later so the user will still know what the driver preferred
> after changing it.
> 
> johannes

How's this?


[PATCH] mac80211: Add preferred_rate_control to ieee80211_hw

There may be a hardware specific rate control algorithm a driver wishes
to use.  Currently, however, the stack assigns the first loaded
algorithm to all drivers calling ieee80211_register_hw.

This commit simply adds an preferred_rate_control to ieee80211_hw and
updates ieee80211_register_hw to use it.

Signed-off-by: James Ketrenos <jketreno@linux.intel.com>
---
 include/net/mac80211.h   |    4 ++++
 net/mac80211/ieee80211.c |   10 +++++++---
 2 files changed, 11 insertions(+), 3 deletions(-)

diff --git a/include/net/mac80211.h b/include/net/mac80211.h
index ef9b613..f9ad839 100644
--- a/include/net/mac80211.h
+++ b/include/net/mac80211.h
@@ -533,6 +533,10 @@ struct ieee80211_hw {
 	/* Number of available hardware TX queues for data packets.
 	 * WMM requires at least four queues. */
 	int queues;
+
+	/* Preferred rate control algorithm. Leave as NULL for stack
+	 * to select algorithm */
+	char *preferred_rate_control;
 };
 
 static inline void SET_IEEE80211_DEV(struct ieee80211_hw *hw, struct device *dev)
diff --git a/net/mac80211/ieee80211.c b/net/mac80211/ieee80211.c
index 873ccb0..6dcc002 100644
--- a/net/mac80211/ieee80211.c
+++ b/net/mac80211/ieee80211.c
@@ -4875,10 +4875,14 @@ int ieee80211_register_hw(struct ieee80211_hw *hw)
 
 	ieee80211_debugfs_add_netdev(IEEE80211_DEV_TO_SUB_IF(local->mdev));
 
-	result = ieee80211_init_rate_ctrl_alg(local, NULL);
+	result = ieee80211_init_rate_ctrl_alg(local, 
+					      hw->preferred_rate_control);
+
 	if (result < 0) {
-		printk(KERN_DEBUG "%s: Failed to initialize rate control "
-		       "algorithm\n", local->mdev->name);
+		printk(KERN_DEBUG "%s: Failed to initialize %s rate control "
+		       "algorithm\n", local->mdev->name,
+		       hw->preferred_rate_control ? 
+		       hw->preferred_rate_control : "default");
 		goto fail_rate;
 	}
 
-- 
1.5.1.3

  parent reply	other threads:[~2007-05-10 18:05 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-05-09 23:05 Specifing rate control algorithm? James Ketrenos
2007-05-10 11:27 ` Jiri Benc
2007-05-10 15:48   ` Jouni Malinen
2007-05-10 16:00     ` Tomas Winkler
2007-05-10 16:17   ` James Ketrenos
2007-05-10 17:11     ` Johannes Berg
2007-05-10 17:26       ` Jouni Malinen
2007-05-10 19:36       ` jketreno [this message]
2007-05-11 11:36         ` Johannes Berg
2007-05-10 17:42     ` Jiri Benc
2007-05-10 20:17       ` jketreno
2007-05-10 19:23         ` Jiri Benc
2007-05-10 22:24           ` Tomas Winkler
2007-05-11  0:12             ` John W. Linville
2007-05-11  8:09               ` Andy Green
2007-05-11  9:07                 ` Jeff Garzik
2007-05-11  9:36                   ` Andy Green
2007-05-11 14:23                 ` Jouni Malinen
2007-05-11 15:04                   ` Andy Green
2007-05-11 15:42                     ` Jouni Malinen
2007-05-11 10:21             ` Jiri Benc

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=46437446.6030302@linux.intel.com \
    --to=jketreno@linux.intel.com \
    --cc=flamingice@sourmilk.net \
    --cc=jbenc@suse.cz \
    --cc=johannes@sipsolutions.net \
    --cc=linux-wireless@vger.kernel.org \
    --cc=linville@tuxdriver.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).