netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Kimdon <david.kimdon@devicescape.com>
To: netdev@vger.kernel.org
Cc: "John W. Linville" <linville@tuxdriver.com>,
	Jiri Benc <jbenc@suse.cz>,
	Elliot Schwartz <elliot.schwartz@devicescape.com>
Subject: [patch 3/5] d80211: remove rate limit code
Date: Tue, 3 Oct 2006 11:12:22 -0700	[thread overview]
Message-ID: <20061003181222.GC19403@devicescape.com> (raw)
In-Reply-To: 20061003181118.537800000@devicescape.com

[-- Attachment #1: rate-limit-removal.patch --]
[-- Type: text/plain, Size: 6896 bytes --]

From: Elliot Schwartz <elliot.schwartz@devicescape.com>

Remove unused and more or less pointless rate limiting code. This
would have just dropped multicast frames arbitrarily when the limit is
reached which is quite useless and does not really belong to 802.11
code.

Signed-off-by: Elliot Schwartz <elliot.schwartz@devicescape.com>

Index: wireless-dev/net/d80211/hostapd_ioctl.h
===================================================================
--- wireless-dev.orig/net/d80211/hostapd_ioctl.h
+++ wireless-dev/net/d80211/hostapd_ioctl.h
@@ -58,8 +58,8 @@ enum {
 	PRISM2_PARAM_CTS_PROTECT_ERP_FRAMES = 1001,
 	PRISM2_PARAM_DROP_UNENCRYPTED = 1002,
 	PRISM2_PARAM_PREAMBLE = 1003,
-	PRISM2_PARAM_RATE_LIMIT = 1004,
-	PRISM2_PARAM_RATE_LIMIT_BURST = 1005,
+	PRISM2_PARAM_RATE_LIMIT = 1004, /* no longer used */
+	PRISM2_PARAM_RATE_LIMIT_BURST = 1005,  /* no longer used */
 	PRISM2_PARAM_SHORT_SLOT_TIME = 1006,
 	PRISM2_PARAM_TEST_MODE = 1007,
 	PRISM2_PARAM_NEXT_MODE = 1008,
Index: wireless-dev/net/d80211/ieee80211.c
===================================================================
--- wireless-dev.orig/net/d80211/ieee80211.c
+++ wireless-dev/net/d80211/ieee80211.c
@@ -843,38 +843,6 @@ ieee80211_tx_h_misc(struct ieee80211_txr
 }
 
 
-static void ieee80211_rate_limit(unsigned long data)
-{
-	struct ieee80211_local *local = (struct ieee80211_local *) data;
-
-	if (local->rate_limit) {
-                local->rate_limit_bucket += local->rate_limit;
-                if (local->rate_limit_bucket > local->rate_limit_burst)
-                        local->rate_limit_bucket = local->rate_limit_burst;
-		local->rate_limit_timer.expires = jiffies + HZ;
-		add_timer(&local->rate_limit_timer);
-	}
-}
-
-
-static ieee80211_txrx_result
-ieee80211_tx_h_rate_limit(struct ieee80211_txrx_data *tx)
-{
-
-	if (likely(!tx->local->rate_limit || tx->u.tx.unicast))
-                return TXRX_CONTINUE;
-
-	/* rate limit */
-        if (tx->local->rate_limit_bucket) {
-                tx->local->rate_limit_bucket--;
-                return TXRX_CONTINUE;
-        }
-
-	I802_DEBUG_INC(tx->local->tx_handlers_drop_rate_limit);
-	return TXRX_DROP;
-}
-
-
 static ieee80211_txrx_result
 ieee80211_tx_h_check_assoc(struct ieee80211_txrx_data *tx)
 {
@@ -4206,7 +4174,6 @@ static ieee80211_rx_handler ieee80211_rx
 
 static ieee80211_tx_handler ieee80211_tx_handlers[] =
 {
-	ieee80211_tx_h_rate_limit,
 	ieee80211_tx_h_check_assoc,
 	ieee80211_tx_h_ps_buf,
 	ieee80211_tx_h_select_key,
@@ -4369,9 +4336,6 @@ struct net_device *ieee80211_alloc_hw(si
         init_timer(&local->scan.timer); /* clear it out */
 
         spin_lock_init(&local->generic_lock);
-	init_timer(&local->rate_limit_timer);
-	local->rate_limit_timer.function = ieee80211_rate_limit;
-	local->rate_limit_timer.data = (unsigned long) local;
 	init_timer(&local->stat_timer);
 	local->stat_timer.function = ieee80211_stat_refresh;
 	local->stat_timer.data = (unsigned long) local;
@@ -4582,8 +4546,6 @@ void ieee80211_unregister_hw(struct net_
 	}
 	rtnl_unlock();
 
-	if (local->rate_limit)
-		del_timer_sync(&local->rate_limit_timer);
 	if (local->stat_time)
 		del_timer_sync(&local->stat_timer);
 	if (local->scan_work.data) {
Index: wireless-dev/net/d80211/ieee80211_i.h
===================================================================
--- wireless-dev.orig/net/d80211/ieee80211_i.h
+++ wireless-dev/net/d80211/ieee80211_i.h
@@ -470,10 +470,6 @@ struct ieee80211_local {
         u32 stat_time;
         struct timer_list stat_timer;
 
-        struct timer_list rate_limit_timer;
-        u32 rate_limit;
-        u32 rate_limit_burst;
-        u32 rate_limit_bucket;
         struct proc_dir_entry *proc, *proc_sta, *proc_iface;
 
 	struct work_struct sta_proc_add;
@@ -493,7 +489,6 @@ struct ieee80211_local {
 	unsigned int tx_handlers_drop_unencrypted;
 	unsigned int tx_handlers_drop_fragment;
 	unsigned int tx_handlers_drop_wep;
-	unsigned int tx_handlers_drop_rate_limit;
 	unsigned int tx_handlers_drop_not_assoc;
 	unsigned int tx_handlers_drop_unauth_port;
 	unsigned int rx_handlers_drop;
Index: wireless-dev/net/d80211/ieee80211_ioctl.c
===================================================================
--- wireless-dev.orig/net/d80211/ieee80211_ioctl.c
+++ wireless-dev/net/d80211/ieee80211_ioctl.c
@@ -2405,25 +2405,6 @@ static int ieee80211_ioctl_prism2_param(
 		local->short_preamble = value;
 		break;
 
-	case PRISM2_PARAM_RATE_LIMIT_BURST:
-		local->rate_limit_burst = value;
-                local->rate_limit_bucket = value;
-		break;
-
-	case PRISM2_PARAM_RATE_LIMIT:
-		/* number of packets (tokens) allowed per second */
-		if (!local->rate_limit && value) {
-                        if (!local->rate_limit_burst) local->rate_limit_burst =
-				value;
-                        local->rate_limit_bucket = local->rate_limit_burst;
-			local->rate_limit_timer.expires = jiffies + HZ;
-			add_timer(&local->rate_limit_timer);
-		} else if (local->rate_limit && !value) {
-			del_timer_sync(&local->rate_limit_timer);
-		}
-		local->rate_limit = value;
-		break;
-
         case PRISM2_PARAM_STAT_TIME:
                 if (!local->stat_time && value) {
                         local->stat_timer.expires = jiffies + HZ * value / 100;
@@ -2656,14 +2637,6 @@ static int ieee80211_ioctl_get_prism2_pa
 		*param = local->short_preamble;
 		break;
 
-	case PRISM2_PARAM_RATE_LIMIT_BURST:
-		*param = local->rate_limit_burst;
-		break;
-
-	case PRISM2_PARAM_RATE_LIMIT:
-		*param = local->rate_limit;
-		break;
-
         case PRISM2_PARAM_STAT_TIME:
                 *param = local->stat_time;
                 break;
Index: wireless-dev/net/d80211/ieee80211_sysfs.c
===================================================================
--- wireless-dev.orig/net/d80211/ieee80211_sysfs.c
+++ wireless-dev/net/d80211/ieee80211_sysfs.c
@@ -241,7 +241,6 @@ IEEE80211_LOCAL_ATTR(tx_handlers_queued,
 IEEE80211_LOCAL_ATTR(tx_handlers_drop_unencrypted, tx_handlers_drop_unencrypted, "%u");
 IEEE80211_LOCAL_ATTR(tx_handlers_drop_fragment, tx_handlers_drop_fragment, "%u");
 IEEE80211_LOCAL_ATTR(tx_handlers_drop_wep, tx_handlers_drop_wep, "%u");
-IEEE80211_LOCAL_ATTR(tx_handlers_drop_rate_limit, tx_handlers_drop_rate_limit, "%u");
 IEEE80211_LOCAL_ATTR(tx_handlers_drop_not_assoc, tx_handlers_drop_not_assoc, "%u");
 IEEE80211_LOCAL_ATTR(tx_handlers_drop_unauth_port, tx_handlers_drop_unauth_port, "%u");
 IEEE80211_LOCAL_ATTR(rx_handlers_drop, rx_handlers_drop, "%u");
@@ -352,7 +351,6 @@ static struct attribute *ieee80211_stats
 	&class_device_attr_tx_handlers_drop_unencrypted.attr,
 	&class_device_attr_tx_handlers_drop_fragment.attr,
 	&class_device_attr_tx_handlers_drop_wep.attr,
-	&class_device_attr_tx_handlers_drop_rate_limit.attr,
 	&class_device_attr_tx_handlers_drop_not_assoc.attr,
 	&class_device_attr_tx_handlers_drop_unauth_port.attr,
 	&class_device_attr_rx_handlers_drop.attr,

--

  parent reply	other threads:[~2006-10-03 18:12 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20061003181118.537800000@devicescape.com>
2006-10-03 18:12 ` [patch 1/5] d80211: Fix overflow when creating AVS header David Kimdon
2006-10-03 18:12 ` [patch 2/5] d80211: remove unused xr structure members, interface, etc David Kimdon
2006-10-03 18:12 ` David Kimdon [this message]
2006-10-03 18:12 ` [patch 4/5] d80211: retain PS frames for at least STA listen interval David Kimdon
2006-10-03 18:12 ` [patch 5/5] d80211: allow wireless vlan interface to have same MAC an AP interface David Kimdon
2006-10-04 16:47   ` Jiri Benc
2006-10-08 21:32   ` Johannes Berg
2006-10-09 21:38     ` [patch 5/5] d80211: allow wireless vlan interface to have sameMAC " Jouni Malinen
2006-10-09 21:49       ` Johannes Berg
2006-10-10 10:50       ` Johannes Berg
2006-10-10 13:42         ` [patch 5/5] d80211: allow wireless vlan interface to havesameMAC " David Kimdon
2006-10-10 13:47           ` Johannes Berg

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=20061003181222.GC19403@devicescape.com \
    --to=david.kimdon@devicescape.com \
    --cc=elliot.schwartz@devicescape.com \
    --cc=jbenc@suse.cz \
    --cc=linville@tuxdriver.com \
    --cc=netdev@vger.kernel.org \
    /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).