Search Linux Wireless

Re: Specifing rate control algorithm?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxxxxxx>
---
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
-
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]
  Powered by Linux