From: Ivo van Doorn <ivdoorn@gmail.com>
To: netdev@vger.kernel.org
Cc: rt2x00-devel@lfcorreia.dyndns.org
Subject: [PATCH 10/32] rt2x00: Move TSF counting activation to correct funtion
Date: Fri, 28 Apr 2006 00:03:01 +0200 [thread overview]
Message-ID: <200604280003.01974.IvDoorn@gmail.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 6697 bytes --]
From: Ivo van Doorn <IvDoorn@gmail.com>
Move the enabling of TSF counting into *_config_mode
where it actually belongs.
For rt2500usb this means that the rt2500usb_reset_tsf function
is now removed since it is still unknown in what registers the
TSF counters are stored in.
Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
diff -uprN wireless-dev-rt2x00/drivers/net/wireless/d80211/rt2x00/rt2400pci.c wireless-dev-rt2x00-patch/drivers/net/wireless/d80211/rt2x00/rt2400pci.c
--- wireless-dev-rt2x00/drivers/net/wireless/d80211/rt2x00/rt2400pci.c 2006-04-27 21:41:52.000000000 +0200
+++ wireless-dev-rt2x00-patch/drivers/net/wireless/d80211/rt2x00/rt2400pci.c 2006-04-27 21:42:29.000000000 +0200
@@ -385,6 +385,9 @@ rt2400pci_config_mode(struct rt2x00_pci
{
u32 reg;
+ /*
+ * Apply hardware packet filter.
+ */
rt2x00_register_read(rt2x00pci, RXCSR0, ®);
if (mode == IW_MODE_ADHOC
@@ -408,6 +411,19 @@ rt2400pci_config_mode(struct rt2x00_pci
}
rt2x00_register_write(rt2x00pci, RXCSR0, reg);
+
+ /*
+ * Enable TSF counter.
+ */
+ rt2x00_register_read(rt2x00pci, CSR14, ®);
+ rt2x00_set_field32(®, CSR14_TSF_COUNT, 1);
+ if (mode == IW_MODE_ADHOC)
+ rt2x00_set_field32(®, CSR14_TSF_SYNC, 2);
+ else if (mode == IW_MODE_INFRA)
+ rt2x00_set_field32(®, CSR14_TSF_SYNC, 1);
+ else
+ rt2x00_set_field32(®, CSR14_TSF_SYNC, 0);
+ rt2x00_register_write(rt2x00pci, CSR14, reg);
}
static void
@@ -1723,21 +1739,10 @@ static void
rt2400pci_reset_tsf(struct net_device *net_dev)
{
struct rt2x00_pci *rt2x00pci = ieee80211_dev_hw_data(net_dev);
- struct ieee80211_conf *conf = ieee80211_get_hw_conf(net_dev);
u32 reg = 0;
rt2x00_register_write(rt2x00pci, CSR16, reg);
rt2x00_register_write(rt2x00pci, CSR17, reg);
-
- rt2x00_register_read(rt2x00pci, CSR14, ®);
- rt2x00_set_field32(®, CSR14_TSF_COUNT, 1);
- if (conf->mode == IW_MODE_ADHOC)
- rt2x00_set_field32(®, CSR14_TSF_SYNC, 2);
- else if (conf->mode == IW_MODE_INFRA)
- rt2x00_set_field32(®, CSR14_TSF_SYNC, 1);
- else
- rt2x00_set_field32(®, CSR14_TSF_SYNC, 0);
- rt2x00_register_write(rt2x00pci, CSR14, reg);
}
static int
diff -uprN wireless-dev-rt2x00/drivers/net/wireless/d80211/rt2x00/rt2500pci.c wireless-dev-rt2x00-patch/drivers/net/wireless/d80211/rt2x00/rt2500pci.c
--- wireless-dev-rt2x00/drivers/net/wireless/d80211/rt2x00/rt2500pci.c 2006-04-27 21:41:52.000000000 +0200
+++ wireless-dev-rt2x00-patch/drivers/net/wireless/d80211/rt2x00/rt2500pci.c 2006-04-27 21:42:29.000000000 +0200
@@ -385,6 +385,9 @@ rt2500pci_config_mode(struct rt2x00_pci
{
u32 reg;
+ /*
+ * Apply hardware packet filter.
+ */
rt2x00_register_read(rt2x00pci, RXCSR0, ®);
if (mode == IW_MODE_ADHOC
@@ -411,6 +414,19 @@ rt2500pci_config_mode(struct rt2x00_pci
rt2x00_set_field32(®, RXCSR0_DROP_BCAST, 0);
rt2x00_register_write(rt2x00pci, RXCSR0, reg);
+
+ /*
+ * Enable TSF counter.
+ */
+ rt2x00_register_read(rt2x00pci, CSR14, ®);
+ rt2x00_set_field32(®, CSR14_TSF_COUNT, 1);
+ if (mode == IW_MODE_ADHOC)
+ rt2x00_set_field32(®, CSR14_TSF_SYNC, 2);
+ else if (mode == IW_MODE_INFRA)
+ rt2x00_set_field32(®, CSR14_TSF_SYNC, 1);
+ else
+ rt2x00_set_field32(®, CSR14_TSF_SYNC, 0);
+ rt2x00_register_write(rt2x00pci, CSR14, reg);
}
static void
@@ -1809,21 +1825,10 @@ static void
rt2500pci_reset_tsf(struct net_device *net_dev)
{
struct rt2x00_pci *rt2x00pci = ieee80211_dev_hw_data(net_dev);
- struct ieee80211_conf *conf = ieee80211_get_hw_conf(net_dev);
u32 reg = 0;
rt2x00_register_write(rt2x00pci, CSR16, reg);
rt2x00_register_write(rt2x00pci, CSR17, reg);
-
- rt2x00_register_read(rt2x00pci, CSR14, ®);
- rt2x00_set_field32(®, CSR14_TSF_COUNT, 1);
- if (conf->mode == IW_MODE_ADHOC)
- rt2x00_set_field32(®, CSR14_TSF_SYNC, 2);
- else if (conf->mode == IW_MODE_INFRA)
- rt2x00_set_field32(®, CSR14_TSF_SYNC, 1);
- else
- rt2x00_set_field32(®, CSR14_TSF_SYNC, 0);
- rt2x00_register_write(rt2x00pci, CSR14, reg);
}
static int
diff -uprN wireless-dev-rt2x00/drivers/net/wireless/d80211/rt2x00/rt2500usb.c wireless-dev-rt2x00-patch/drivers/net/wireless/d80211/rt2x00/rt2500usb.c
--- wireless-dev-rt2x00/drivers/net/wireless/d80211/rt2x00/rt2500usb.c 2006-04-27 21:41:52.000000000 +0200
+++ wireless-dev-rt2x00-patch/drivers/net/wireless/d80211/rt2x00/rt2500usb.c 2006-04-27 21:42:29.000000000 +0200
@@ -268,6 +268,9 @@ rt2500usb_config_mode(struct rt2x00_usb
{
u16 reg;
+ /*
+ * Apply hardware packet filter.
+ */
rt2x00_register_read(rt2x00usb, TXRX_CSR2, ®);
if (mode == IW_MODE_ADHOC
@@ -1509,24 +1512,6 @@ rt2500usb_get_tx_stats(struct net_device
return 0;
}
-static void
-rt2500usb_reset_tsf(struct net_device *net_dev)
-{
- struct rt2x00_usb *rt2x00usb = ieee80211_dev_hw_data(net_dev);
- struct ieee80211_conf *conf = ieee80211_get_hw_conf(net_dev);
- u16 reg = 0;
-
- rt2x00_register_read(rt2x00usb, TXRX_CSR19, ®);
- rt2x00_set_field16_nb(®, TXRX_CSR19_TSF_COUNT, 1);
- if (conf->mode == IW_MODE_ADHOC)
- rt2x00_set_field16_nb(®, TXRX_CSR19_TSF_SYNC, 2);
- else if (conf->mode == IW_MODE_INFRA)
- rt2x00_set_field16_nb(®, TXRX_CSR19_TSF_SYNC, 1);
- else
- rt2x00_set_field16_nb(®, TXRX_CSR19_TSF_SYNC, 0);
- rt2x00_register_write(rt2x00usb, TXRX_CSR19, reg);
-}
-
static int
rt2500usb_beacon_update(struct net_device *net_dev,
struct sk_buff *skb, struct ieee80211_tx_control *control)
@@ -1880,7 +1865,6 @@ rt2500usb_init_hw(struct rt2x00_usb *rt2
hw->set_mac_address = rt2500usb_set_mac_address;
hw->conf_tx = rt2500usb_conf_tx;
hw->get_tx_stats = rt2500usb_get_tx_stats;
- hw->reset_tsf = rt2500usb_reset_tsf;
hw->beacon_update = rt2500usb_beacon_update;
/*
diff -uprN wireless-dev-rt2x00/drivers/net/wireless/d80211/rt2x00/rt2500usb.h wireless-dev-rt2x00-patch/drivers/net/wireless/d80211/rt2x00/rt2500usb.h
--- wireless-dev-rt2x00/drivers/net/wireless/d80211/rt2x00/rt2500usb.h 2006-04-27 21:36:19.000000000 +0200
+++ wireless-dev-rt2x00-patch/drivers/net/wireless/d80211/rt2x00/rt2500usb.h 2006-04-27 21:42:29.000000000 +0200
@@ -748,7 +748,6 @@ static int rt2500usb_conf_tx(struct net_
int queue, const struct ieee80211_tx_queue_params *params);
static int rt2500usb_get_tx_stats(struct net_device *net_dev,
struct ieee80211_tx_queue_stats *stats);
-static void rt2500usb_reset_tsf(struct net_device *net_dev);
static int rt2500usb_beacon_update(struct net_device *net_dev,
struct sk_buff *skb, struct ieee80211_tx_control *control);
[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]
reply other threads:[~2006-04-27 22:01 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=200604280003.01974.IvDoorn@gmail.com \
--to=ivdoorn@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=rt2x00-devel@lfcorreia.dyndns.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).