From: Stefano Brivio <stefano.brivio@polimi.it>
To: Michael Buesch <mb@bu3sch.de>, John Linville <linville@tuxdriver.com>
Cc: Mattias Nissler <mattias.nissler@gmx.de>, linux-wireless@vger.kernel.org
Subject: [PATCH v2 2/2] mac80211: fix breakage
Date: Fri, 21 Dec 2007 00:44:44 +0100 [thread overview]
Message-ID: <20071221004444.30c818cd@morte> (raw)
In-Reply-To: <200712202035.45909.mb@bu3sch.de>
Properly fix breakage introduced by:
commit 14d9eab2febd9caa8821d2b578d84e961dda3103
Author: Stefano Brivio <stefano.brivio@polimi.it>
Date: Wed Dec 19 01:26:16 2007 +0100
Always build rc80211-simple into mac80211, and let rc80211-pid to be selected
through a modparam and built as a module. The default rate control algorithm
to be used can be set into the kernel configuration as well.
Signed-off-by: Stefano Brivio <stefano.brivio@polimi.it>
---
John,
sorry for the delay. In case you didn't merge the previous patch, this is the
proper fix for the breakage.
---
Index: wireless-2.6/net/mac80211/ieee80211.c
===================================================================
--- wireless-2.6.orig/net/mac80211/ieee80211.c
+++ wireless-2.6/net/mac80211/ieee80211.c
@@ -1323,21 +1323,32 @@ static int __init ieee80211_init(void)
BUILD_BUG_ON(sizeof(struct ieee80211_tx_packet_data) > sizeof(skb->cb));
+ ret = ieee80211_rate_control_register(&mac80211_rcsimple);
+ if (ret)
+ goto fail;
+
ret = ieee80211_wme_register();
if (ret) {
printk(KERN_DEBUG "ieee80211_init: failed to "
"initialize WME (err=%d)\n", ret);
- return ret;
+ goto fail;
}
ieee80211_debugfs_netdev_init();
ieee80211_regdomain_init();
return 0;
+
+fail:
+ ieee80211_rate_control_unregister(&mac80211_rcsimple);
+
+ return ret;
}
static void __exit ieee80211_exit(void)
{
+ ieee80211_rate_control_unregister(&mac80211_rcsimple);
+
ieee80211_wme_unregister();
ieee80211_debugfs_netdev_exit();
}
Index: wireless-2.6/net/mac80211/ieee80211_rate.h
===================================================================
--- wireless-2.6.orig/net/mac80211/ieee80211_rate.h
+++ wireless-2.6/net/mac80211/ieee80211_rate.h
@@ -58,6 +58,9 @@ struct rate_control_ref {
struct kref kref;
};
+/* default 'simple' algorithm */
+extern struct rate_control_ops mac80211_rcsimple;
+
int ieee80211_rate_control_register(struct rate_control_ops *ops);
void ieee80211_rate_control_unregister(struct rate_control_ops *ops);
Index: wireless-2.6/net/mac80211/ieee80211_rate.c
===================================================================
--- wireless-2.6.orig/net/mac80211/ieee80211_rate.c
+++ wireless-2.6/net/mac80211/ieee80211_rate.c
@@ -94,8 +94,7 @@ ieee80211_try_rate_control_ops_get(const
return ops;
}
-/* Get the rate control algorithm. If `name' is NULL, get the first
- * available algorithm. */
+/* Get the rate control algorithm. */
static struct rate_control_ops *
ieee80211_rate_control_ops_get(const char *name)
{
Index: wireless-2.6/net/mac80211/Kconfig
===================================================================
--- wireless-2.6.orig/net/mac80211/Kconfig
+++ wireless-2.6/net/mac80211/Kconfig
@@ -35,7 +35,6 @@ config MAC80211_RC_DEFAULT_PID
config MAC80211_RC_DEFAULT_SIMPLE
bool "Simple rate control algorithm"
depends on MAC80211
- select MAC80211_RC_SIMPLE
help
Select the simple rate control as the default rate
control algorithm. Note that this is a non-responsive,
@@ -62,18 +61,6 @@ config MAC80211_RC_PID
Say Y or M unless you're sure you want to use a
different rate control algorithm.
-config MAC80211_RC_SIMPLE
- tristate "Simple rate control algorithm (DEPRECATED)"
- default n
- depends on MAC80211
- help
- This option enables a very simple, non-responsive TX
- rate control algorithm. This algorithm is deprecated
- and will be removed from the kernel in near future.
- It has been replaced by the PID algorithm.
-
- Say N unless you know what you are doing.
-
config MAC80211_LEDS
bool "Enable LED triggers"
depends on MAC80211 && LEDS_TRIGGERS
Index: wireless-2.6/net/mac80211/rc80211_pid_algo.c
===================================================================
--- wireless-2.6.orig/net/mac80211/rc80211_pid_algo.c
+++ wireless-2.6/net/mac80211/rc80211_pid_algo.c
@@ -498,7 +498,8 @@ static void rate_control_pid_free_sta(vo
kfree(spinfo);
}
-struct rate_control_ops mac80211_rcpid = {
+static struct rate_control_ops mac80211_rcpid = {
+ .module = THIS_MODULE,
.name = "pid",
.tx_status = rate_control_pid_tx_status,
.get_rate = rate_control_pid_get_rate,
@@ -513,3 +514,16 @@ struct rate_control_ops mac80211_rcpid =
.remove_sta_debugfs = rate_control_pid_remove_sta_debugfs,
#endif
};
+
+static int __init rate_control_pid_init(void)
+{
+ return ieee80211_rate_control_register(&mac80211_rcpid);
+}
+
+static void __exit rate_control_pid_exit(void)
+{
+ ieee80211_rate_control_unregister(&mac80211_rcpid);
+}
+
+subsys_initcall(rate_control_pid_init);
+module_exit(rate_control_pid_exit);
--
Ciao
Stefano
prev parent reply other threads:[~2007-12-20 23:53 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-12-20 19:20 mac80211: rc algos broken Michael Buesch
2007-12-20 19:35 ` Michael Buesch
2007-12-20 20:51 ` Stefano Brivio
2007-12-21 14:13 ` John W. Linville
2007-12-20 23:02 ` [PATCH 1/2] rc80211-pid: fix debugfs missing symbols Stefano Brivio
2007-12-20 23:05 ` [PATCH 2/2] mac80211: fix breakage Stefano Brivio
2007-12-20 23:44 ` Stefano Brivio [this message]
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=20071221004444.30c818cd@morte \
--to=stefano.brivio@polimi.it \
--cc=linux-wireless@vger.kernel.org \
--cc=linville@tuxdriver.com \
--cc=mattias.nissler@gmx.de \
--cc=mb@bu3sch.de \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.