netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jouni Malinen <jkmaline@cc.hut.fi>
To: Jeff Garzik <jgarzik@pobox.com>
Cc: netdev@oss.sgi.com
Subject: [PATCH wireless-2.6 6/10] hostap: Clear station statistic on accounting start
Date: Sat, 12 Mar 2005 16:32:57 -0800	[thread overview]
Message-ID: <20050313003257.GG8253@jm.kir.nu> (raw)
In-Reply-To: <20050313001706.GA8253@jm.kir.nu>

>From Gunter Burchardt <gbur@informatik.uni-rostock.de>

Added new ioctl command for hostapd to clear station specific
accounting data when starting a new accounting session.

Signed-off-by: Jouni Malinen <jkmaline@cc.hut.fi>

Index: jm-wireless-2.6/drivers/net/wireless/hostap/hostap_ap.c
===================================================================
--- jm-wireless-2.6.orig/drivers/net/wireless/hostap/hostap_ap.c	2005-03-12 16:10:40.000000000 -0800
+++ jm-wireless-2.6/drivers/net/wireless/hostap/hostap_ap.c	2005-03-12 16:10:56.000000000 -0800
@@ -2582,6 +2582,31 @@
 }
 
 
+static int prism2_hostapd_sta_clear_stats(struct ap_data *ap,
+					  struct prism2_hostapd_param *param)
+{
+	struct sta_info *sta;
+	int rate;
+
+	spin_lock_bh(&ap->sta_table_lock);
+	sta = ap_get_sta(ap, param->sta_addr);
+	if (sta) {
+		sta->rx_packets = sta->tx_packets = 0;
+		sta->rx_bytes = sta->tx_bytes = 0;
+		for (rate = 0; rate < WLAN_RATE_COUNT; rate++) {
+			sta->tx_count[rate] = 0;
+			sta->rx_count[rate] = 0;
+		}
+	}
+	spin_unlock_bh(&ap->sta_table_lock);
+
+	if (!sta)
+		return -ENOENT;
+
+	return 0;
+}
+
+
 static int prism2_hostapd(struct ap_data *ap,
 			  struct prism2_hostapd_param *param)
 {
@@ -2597,6 +2622,8 @@
 		return prism2_hostapd_get_info_sta(ap, param);
 	case PRISM2_HOSTAPD_SET_FLAGS_STA:
 		return prism2_hostapd_set_flags_sta(ap, param);
+	case PRISM2_HOSTAPD_STA_CLEAR_STATS:
+		return prism2_hostapd_sta_clear_stats(ap, param);
 	default:
 		printk(KERN_WARNING "prism2_hostapd: unknown cmd=%d\n",
 		       param->cmd);
Index: jm-wireless-2.6/drivers/net/wireless/hostap/hostap_common.h
===================================================================
--- jm-wireless-2.6.orig/drivers/net/wireless/hostap/hostap_common.h	2005-03-12 16:10:40.000000000 -0800
+++ jm-wireless-2.6/drivers/net/wireless/hostap/hostap_common.h	2005-03-12 16:10:56.000000000 -0800
@@ -482,6 +482,7 @@
 	PRISM2_HOSTAPD_SET_GENERIC_ELEMENT = 12,
 	PRISM2_HOSTAPD_MLME = 13,
 	PRISM2_HOSTAPD_SCAN_REQ = 14,
+	PRISM2_HOSTAPD_STA_CLEAR_STATS = 15,
 };
 
 #define PRISM2_HOSTAPD_MAX_BUF_SIZE 1024



-- 
Jouni Malinen                                            PGP id EFC895FA

  parent reply	other threads:[~2005-03-13  0:32 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-03-13  0:17 [PATCH wireless-2.6 0/10] hostap: Updates from Host AP repository Jouni Malinen
2005-03-13  0:28 ` [PATCH wireless-2.6 1/10] hostap: Clear station statistic on accounting start Jouni Malinen
2005-03-13  0:29 ` [PATCH wireless-2.6 2/10] hostap: Include asm/io.h Jouni Malinen
2005-03-22 23:13   ` Jeff Garzik
2005-03-13  0:30 ` [PATCH wireless-2.6 3/10] hostap: Disable interrupts before Genesis mode Jouni Malinen
2005-03-13  0:31 ` [PATCH wireless-2.6 4/10] hostap: Add support for multi-func SanDisk ConnectPlus Jouni Malinen
2005-03-13  0:32 ` [PATCH wireless-2.6 5/10] hostap: Fix procfs rmdir after ifname change Jouni Malinen
2005-03-13  0:32 ` Jouni Malinen [this message]
2005-03-13  0:34 ` [PATCH wireless-2.6 7/10] hostap: Rate limiting for debug messages Jouni Malinen
2005-03-22 23:11   ` Jeff Garzik
2005-03-25  2:46     ` Jouni Malinen
2005-03-25  3:54       ` Jeff Garzik
2005-03-13  0:34 ` [PATCH wireless-2.6 8/10] hostap: Improved suspend Jouni Malinen
2005-03-13  0:35 ` [PATCH wireless-2.6 9/10] hostap: Filter disconnect events Jouni Malinen
2005-03-13  0:41 ` [PATCH wireless-2.6 10/10] hostap: Update to use the new WE18 proposal Jouni Malinen
2005-03-22 23:11   ` Jeff Garzik

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=20050313003257.GG8253@jm.kir.nu \
    --to=jkmaline@cc.hut.fi \
    --cc=jgarzik@pobox.com \
    --cc=netdev@oss.sgi.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).