2007-11-20 00:20:12 +08:00
|
|
|
/* ZD1211 USB-WLAN driver for Linux
|
2007-11-19 23:00:29 +08:00
|
|
|
*
|
2007-11-20 00:20:12 +08:00
|
|
|
* Copyright (C) 2005-2007 Ulrich Kunitz <kune@deine-taler.de>
|
|
|
|
* Copyright (C) 2006-2007 Daniel Drake <dsd@gentoo.org>
|
|
|
|
* Copyright (C) 2006-2007 Michael Wu <flamingice@sourmilk.net>
|
2008-09-10 14:19:49 +08:00
|
|
|
* Copyright (C) 2007-2008 Luis R. Rodriguez <mcgrof@winlab.rutgers.edu>
|
[PATCH] ZyDAS ZD1211 USB-WLAN driver
There are 60+ USB wifi adapters available on the market based on the ZyDAS
ZD1211 chip.
Unlike the predecessor (ZD1201), ZD1211 does not have a hardware MAC, so most
data operations are coordinated by the device driver. The ZD1211 chip sits
alongside an RF transceiver which is also controlled by the driver. Our driver
currently supports 2 RF types, we know of one other available in a few marketed
products which we will be supporting soon.
Our driver also supports the newer revision of ZD1211, called ZD1211B. The
initialization and RF operations are slightly different for the new revision,
but the main difference is 802.11e support. Our driver does not support the
QoS features yet, but we think we know how to use them.
This driver is based on ZyDAS's own GPL driver available from www.zydas.com.tw.
ZyDAS engineers have been responsive and supportive of our efforts, so thumbs
up to them. Additionally, the firmware is redistributable and they have
provided device specs.
This driver has been written primarily by Ulrich Kunitz and myself. Graham
Gower, Greg KH, Remco and Bryan Rittmeyer have also contributed. The
developers of ieee80211 and softmac have made our lives so much easier- thanks!
We maintain a small info-page: http://zd1211.ath.cx/wiki/DriverRewrite
If there is enough time for review, we would like to aim for inclusion in
2.6.18. The driver works nicely as a STA, and can connect to both open and
encrypted networks (we are using software-based encryption for now). We will
work towards supporting more advanced features in the future (ad-hoc, master
mode, 802.11a, ...).
Signed-off-by: Daniel Drake <dsd@gentoo.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2006-06-03 00:11:32 +08:00
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <linux/netdevice.h>
|
|
|
|
#include <linux/etherdevice.h>
|
include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h
percpu.h is included by sched.h and module.h and thus ends up being
included when building most .c files. percpu.h includes slab.h which
in turn includes gfp.h making everything defined by the two files
universally available and complicating inclusion dependencies.
percpu.h -> slab.h dependency is about to be removed. Prepare for
this change by updating users of gfp and slab facilities include those
headers directly instead of assuming availability. As this conversion
needs to touch large number of source files, the following script is
used as the basis of conversion.
http://userweb.kernel.org/~tj/misc/slabh-sweep.py
The script does the followings.
* Scan files for gfp and slab usages and update includes such that
only the necessary includes are there. ie. if only gfp is used,
gfp.h, if slab is used, slab.h.
* When the script inserts a new include, it looks at the include
blocks and try to put the new include such that its order conforms
to its surrounding. It's put in the include block which contains
core kernel includes, in the same order that the rest are ordered -
alphabetical, Christmas tree, rev-Xmas-tree or at the end if there
doesn't seem to be any matching order.
* If the script can't find a place to put a new include (mostly
because the file doesn't have fitting include block), it prints out
an error message indicating which .h file needs to be added to the
file.
The conversion was done in the following steps.
1. The initial automatic conversion of all .c files updated slightly
over 4000 files, deleting around 700 includes and adding ~480 gfp.h
and ~3000 slab.h inclusions. The script emitted errors for ~400
files.
2. Each error was manually checked. Some didn't need the inclusion,
some needed manual addition while adding it to implementation .h or
embedding .c file was more appropriate for others. This step added
inclusions to around 150 files.
3. The script was run again and the output was compared to the edits
from #2 to make sure no file was left behind.
4. Several build tests were done and a couple of problems were fixed.
e.g. lib/decompress_*.c used malloc/free() wrappers around slab
APIs requiring slab.h to be added manually.
5. The script was run on all .h files but without automatically
editing them as sprinkling gfp.h and slab.h inclusions around .h
files could easily lead to inclusion dependency hell. Most gfp.h
inclusion directives were ignored as stuff from gfp.h was usually
wildly available and often used in preprocessor macros. Each
slab.h inclusion directive was examined and added manually as
necessary.
6. percpu.h was updated not to include slab.h.
7. Build test were done on the following configurations and failures
were fixed. CONFIG_GCOV_KERNEL was turned off for all tests (as my
distributed build env didn't work with gcov compiles) and a few
more options had to be turned off depending on archs to make things
build (like ipr on powerpc/64 which failed due to missing writeq).
* x86 and x86_64 UP and SMP allmodconfig and a custom test config.
* powerpc and powerpc64 SMP allmodconfig
* sparc and sparc64 SMP allmodconfig
* ia64 SMP allmodconfig
* s390 SMP allmodconfig
* alpha SMP allmodconfig
* um on x86_64 SMP allmodconfig
8. percpu.h modifications were reverted so that it could be applied as
a separate patch and serve as bisection point.
Given the fact that I had only a couple of failures from tests on step
6, I'm fairly confident about the coverage of this conversion patch.
If there is a breakage, it's likely to be something in one of the arch
headers which should be easily discoverable easily on most builds of
the specific arch.
Signed-off-by: Tejun Heo <tj@kernel.org>
Guess-its-ok-by: Christoph Lameter <cl@linux-foundation.org>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Lee Schermerhorn <Lee.Schermerhorn@hp.com>
2010-03-24 16:04:11 +08:00
|
|
|
#include <linux/slab.h>
|
[PATCH] ZyDAS ZD1211 USB-WLAN driver
There are 60+ USB wifi adapters available on the market based on the ZyDAS
ZD1211 chip.
Unlike the predecessor (ZD1201), ZD1211 does not have a hardware MAC, so most
data operations are coordinated by the device driver. The ZD1211 chip sits
alongside an RF transceiver which is also controlled by the driver. Our driver
currently supports 2 RF types, we know of one other available in a few marketed
products which we will be supporting soon.
Our driver also supports the newer revision of ZD1211, called ZD1211B. The
initialization and RF operations are slightly different for the new revision,
but the main difference is 802.11e support. Our driver does not support the
QoS features yet, but we think we know how to use them.
This driver is based on ZyDAS's own GPL driver available from www.zydas.com.tw.
ZyDAS engineers have been responsive and supportive of our efforts, so thumbs
up to them. Additionally, the firmware is redistributable and they have
provided device specs.
This driver has been written primarily by Ulrich Kunitz and myself. Graham
Gower, Greg KH, Remco and Bryan Rittmeyer have also contributed. The
developers of ieee80211 and softmac have made our lives so much easier- thanks!
We maintain a small info-page: http://zd1211.ath.cx/wiki/DriverRewrite
If there is enough time for review, we would like to aim for inclusion in
2.6.18. The driver works nicely as a STA, and can connect to both open and
encrypted networks (we are using software-based encryption for now). We will
work towards supporting more advanced features in the future (ad-hoc, master
mode, 802.11a, ...).
Signed-off-by: Daniel Drake <dsd@gentoo.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2006-06-03 00:11:32 +08:00
|
|
|
#include <linux/usb.h>
|
|
|
|
#include <linux/jiffies.h>
|
|
|
|
#include <net/ieee80211_radiotap.h>
|
|
|
|
|
|
|
|
#include "zd_def.h"
|
|
|
|
#include "zd_chip.h"
|
|
|
|
#include "zd_mac.h"
|
|
|
|
#include "zd_rf.h"
|
|
|
|
|
2008-09-10 14:19:49 +08:00
|
|
|
struct zd_reg_alpha2_map {
|
|
|
|
u32 reg;
|
|
|
|
char alpha2[2];
|
|
|
|
};
|
|
|
|
|
|
|
|
static struct zd_reg_alpha2_map reg_alpha2_map[] = {
|
|
|
|
{ ZD_REGDOMAIN_FCC, "US" },
|
|
|
|
{ ZD_REGDOMAIN_IC, "CA" },
|
|
|
|
{ ZD_REGDOMAIN_ETSI, "DE" }, /* Generic ETSI, use most restrictive */
|
|
|
|
{ ZD_REGDOMAIN_JAPAN, "JP" },
|
2010-06-17 02:41:36 +08:00
|
|
|
{ ZD_REGDOMAIN_JAPAN_2, "JP" },
|
|
|
|
{ ZD_REGDOMAIN_JAPAN_3, "JP" },
|
2008-09-10 14:19:49 +08:00
|
|
|
{ ZD_REGDOMAIN_SPAIN, "ES" },
|
|
|
|
{ ZD_REGDOMAIN_FRANCE, "FR" },
|
|
|
|
};
|
|
|
|
|
2007-11-19 23:00:29 +08:00
|
|
|
/* This table contains the hardware specific values for the modulation rates. */
|
|
|
|
static const struct ieee80211_rate zd_rates[] = {
|
2008-01-25 02:38:38 +08:00
|
|
|
{ .bitrate = 10,
|
|
|
|
.hw_value = ZD_CCK_RATE_1M, },
|
|
|
|
{ .bitrate = 20,
|
|
|
|
.hw_value = ZD_CCK_RATE_2M,
|
|
|
|
.hw_value_short = ZD_CCK_RATE_2M | ZD_CCK_PREA_SHORT,
|
|
|
|
.flags = IEEE80211_RATE_SHORT_PREAMBLE },
|
|
|
|
{ .bitrate = 55,
|
|
|
|
.hw_value = ZD_CCK_RATE_5_5M,
|
|
|
|
.hw_value_short = ZD_CCK_RATE_5_5M | ZD_CCK_PREA_SHORT,
|
|
|
|
.flags = IEEE80211_RATE_SHORT_PREAMBLE },
|
|
|
|
{ .bitrate = 110,
|
|
|
|
.hw_value = ZD_CCK_RATE_11M,
|
|
|
|
.hw_value_short = ZD_CCK_RATE_11M | ZD_CCK_PREA_SHORT,
|
|
|
|
.flags = IEEE80211_RATE_SHORT_PREAMBLE },
|
|
|
|
{ .bitrate = 60,
|
|
|
|
.hw_value = ZD_OFDM_RATE_6M,
|
|
|
|
.flags = 0 },
|
|
|
|
{ .bitrate = 90,
|
|
|
|
.hw_value = ZD_OFDM_RATE_9M,
|
|
|
|
.flags = 0 },
|
|
|
|
{ .bitrate = 120,
|
|
|
|
.hw_value = ZD_OFDM_RATE_12M,
|
|
|
|
.flags = 0 },
|
|
|
|
{ .bitrate = 180,
|
|
|
|
.hw_value = ZD_OFDM_RATE_18M,
|
|
|
|
.flags = 0 },
|
|
|
|
{ .bitrate = 240,
|
|
|
|
.hw_value = ZD_OFDM_RATE_24M,
|
|
|
|
.flags = 0 },
|
|
|
|
{ .bitrate = 360,
|
|
|
|
.hw_value = ZD_OFDM_RATE_36M,
|
|
|
|
.flags = 0 },
|
|
|
|
{ .bitrate = 480,
|
|
|
|
.hw_value = ZD_OFDM_RATE_48M,
|
|
|
|
.flags = 0 },
|
|
|
|
{ .bitrate = 540,
|
|
|
|
.hw_value = ZD_OFDM_RATE_54M,
|
|
|
|
.flags = 0 },
|
2007-11-19 23:00:29 +08:00
|
|
|
};
|
|
|
|
|
2009-10-22 18:04:52 +08:00
|
|
|
/*
|
|
|
|
* Zydas retry rates table. Each line is listed in the same order as
|
|
|
|
* in zd_rates[] and contains all the rate used when a packet is sent
|
|
|
|
* starting with a given rates. Let's consider an example :
|
|
|
|
*
|
|
|
|
* "11 Mbits : 4, 3, 2, 1, 0" means :
|
|
|
|
* - packet is sent using 4 different rates
|
|
|
|
* - 1st rate is index 3 (ie 11 Mbits)
|
|
|
|
* - 2nd rate is index 2 (ie 5.5 Mbits)
|
|
|
|
* - 3rd rate is index 1 (ie 2 Mbits)
|
|
|
|
* - 4th rate is index 0 (ie 1 Mbits)
|
|
|
|
*/
|
|
|
|
|
|
|
|
static const struct tx_retry_rate zd_retry_rates[] = {
|
|
|
|
{ /* 1 Mbits */ 1, { 0 }},
|
|
|
|
{ /* 2 Mbits */ 2, { 1, 0 }},
|
|
|
|
{ /* 5.5 Mbits */ 3, { 2, 1, 0 }},
|
|
|
|
{ /* 11 Mbits */ 4, { 3, 2, 1, 0 }},
|
|
|
|
{ /* 6 Mbits */ 5, { 4, 3, 2, 1, 0 }},
|
|
|
|
{ /* 9 Mbits */ 6, { 5, 4, 3, 2, 1, 0}},
|
|
|
|
{ /* 12 Mbits */ 5, { 6, 3, 2, 1, 0 }},
|
|
|
|
{ /* 18 Mbits */ 6, { 7, 6, 3, 2, 1, 0 }},
|
|
|
|
{ /* 24 Mbits */ 6, { 8, 6, 3, 2, 1, 0 }},
|
|
|
|
{ /* 36 Mbits */ 7, { 9, 8, 6, 3, 2, 1, 0 }},
|
|
|
|
{ /* 48 Mbits */ 8, {10, 9, 8, 6, 3, 2, 1, 0 }},
|
|
|
|
{ /* 54 Mbits */ 9, {11, 10, 9, 8, 6, 3, 2, 1, 0 }}
|
|
|
|
};
|
|
|
|
|
2007-11-19 23:00:29 +08:00
|
|
|
static const struct ieee80211_channel zd_channels[] = {
|
2008-01-25 02:38:38 +08:00
|
|
|
{ .center_freq = 2412, .hw_value = 1 },
|
|
|
|
{ .center_freq = 2417, .hw_value = 2 },
|
|
|
|
{ .center_freq = 2422, .hw_value = 3 },
|
|
|
|
{ .center_freq = 2427, .hw_value = 4 },
|
|
|
|
{ .center_freq = 2432, .hw_value = 5 },
|
|
|
|
{ .center_freq = 2437, .hw_value = 6 },
|
|
|
|
{ .center_freq = 2442, .hw_value = 7 },
|
|
|
|
{ .center_freq = 2447, .hw_value = 8 },
|
|
|
|
{ .center_freq = 2452, .hw_value = 9 },
|
|
|
|
{ .center_freq = 2457, .hw_value = 10 },
|
|
|
|
{ .center_freq = 2462, .hw_value = 11 },
|
|
|
|
{ .center_freq = 2467, .hw_value = 12 },
|
|
|
|
{ .center_freq = 2472, .hw_value = 13 },
|
|
|
|
{ .center_freq = 2484, .hw_value = 14 },
|
2007-11-19 23:00:29 +08:00
|
|
|
};
|
[PATCH] ZyDAS ZD1211 USB-WLAN driver
There are 60+ USB wifi adapters available on the market based on the ZyDAS
ZD1211 chip.
Unlike the predecessor (ZD1201), ZD1211 does not have a hardware MAC, so most
data operations are coordinated by the device driver. The ZD1211 chip sits
alongside an RF transceiver which is also controlled by the driver. Our driver
currently supports 2 RF types, we know of one other available in a few marketed
products which we will be supporting soon.
Our driver also supports the newer revision of ZD1211, called ZD1211B. The
initialization and RF operations are slightly different for the new revision,
but the main difference is 802.11e support. Our driver does not support the
QoS features yet, but we think we know how to use them.
This driver is based on ZyDAS's own GPL driver available from www.zydas.com.tw.
ZyDAS engineers have been responsive and supportive of our efforts, so thumbs
up to them. Additionally, the firmware is redistributable and they have
provided device specs.
This driver has been written primarily by Ulrich Kunitz and myself. Graham
Gower, Greg KH, Remco and Bryan Rittmeyer have also contributed. The
developers of ieee80211 and softmac have made our lives so much easier- thanks!
We maintain a small info-page: http://zd1211.ath.cx/wiki/DriverRewrite
If there is enough time for review, we would like to aim for inclusion in
2.6.18. The driver works nicely as a STA, and can connect to both open and
encrypted networks (we are using software-based encryption for now). We will
work towards supporting more advanced features in the future (ad-hoc, master
mode, 802.11a, ...).
Signed-off-by: Daniel Drake <dsd@gentoo.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2006-06-03 00:11:32 +08:00
|
|
|
|
2006-09-13 09:42:38 +08:00
|
|
|
static void housekeeping_init(struct zd_mac *mac);
|
|
|
|
static void housekeeping_enable(struct zd_mac *mac);
|
|
|
|
static void housekeeping_disable(struct zd_mac *mac);
|
2011-02-01 02:48:55 +08:00
|
|
|
static void beacon_init(struct zd_mac *mac);
|
|
|
|
static void beacon_enable(struct zd_mac *mac);
|
|
|
|
static void beacon_disable(struct zd_mac *mac);
|
2011-02-01 02:49:43 +08:00
|
|
|
static void set_rts_cts(struct zd_mac *mac, unsigned int short_preamble);
|
|
|
|
static int zd_mac_config_beacon(struct ieee80211_hw *hw,
|
2011-06-20 19:42:49 +08:00
|
|
|
struct sk_buff *beacon, bool in_intr);
|
2006-09-13 09:42:38 +08:00
|
|
|
|
2008-09-10 14:19:49 +08:00
|
|
|
static int zd_reg2alpha2(u8 regdomain, char *alpha2)
|
|
|
|
{
|
|
|
|
unsigned int i;
|
|
|
|
struct zd_reg_alpha2_map *reg_map;
|
|
|
|
for (i = 0; i < ARRAY_SIZE(reg_alpha2_map); i++) {
|
|
|
|
reg_map = ®_alpha2_map[i];
|
|
|
|
if (regdomain == reg_map->reg) {
|
|
|
|
alpha2[0] = reg_map->alpha2[0];
|
|
|
|
alpha2[1] = reg_map->alpha2[1];
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
2011-06-20 19:42:28 +08:00
|
|
|
static int zd_check_signal(struct ieee80211_hw *hw, int signal)
|
|
|
|
{
|
|
|
|
struct zd_mac *mac = zd_hw_mac(hw);
|
|
|
|
|
|
|
|
dev_dbg_f_cond(zd_mac_dev(mac), signal < 0 || signal > 100,
|
|
|
|
"%s: signal value from device not in range 0..100, "
|
|
|
|
"but %d.\n", __func__, signal);
|
|
|
|
|
|
|
|
if (signal < 0)
|
|
|
|
signal = 0;
|
|
|
|
else if (signal > 100)
|
|
|
|
signal = 100;
|
|
|
|
|
|
|
|
return signal;
|
|
|
|
}
|
|
|
|
|
2007-11-19 23:00:29 +08:00
|
|
|
int zd_mac_preinit_hw(struct ieee80211_hw *hw)
|
[PATCH] ZyDAS ZD1211 USB-WLAN driver
There are 60+ USB wifi adapters available on the market based on the ZyDAS
ZD1211 chip.
Unlike the predecessor (ZD1201), ZD1211 does not have a hardware MAC, so most
data operations are coordinated by the device driver. The ZD1211 chip sits
alongside an RF transceiver which is also controlled by the driver. Our driver
currently supports 2 RF types, we know of one other available in a few marketed
products which we will be supporting soon.
Our driver also supports the newer revision of ZD1211, called ZD1211B. The
initialization and RF operations are slightly different for the new revision,
but the main difference is 802.11e support. Our driver does not support the
QoS features yet, but we think we know how to use them.
This driver is based on ZyDAS's own GPL driver available from www.zydas.com.tw.
ZyDAS engineers have been responsive and supportive of our efforts, so thumbs
up to them. Additionally, the firmware is redistributable and they have
provided device specs.
This driver has been written primarily by Ulrich Kunitz and myself. Graham
Gower, Greg KH, Remco and Bryan Rittmeyer have also contributed. The
developers of ieee80211 and softmac have made our lives so much easier- thanks!
We maintain a small info-page: http://zd1211.ath.cx/wiki/DriverRewrite
If there is enough time for review, we would like to aim for inclusion in
2.6.18. The driver works nicely as a STA, and can connect to both open and
encrypted networks (we are using software-based encryption for now). We will
work towards supporting more advanced features in the future (ad-hoc, master
mode, 802.11a, ...).
Signed-off-by: Daniel Drake <dsd@gentoo.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2006-06-03 00:11:32 +08:00
|
|
|
{
|
|
|
|
int r;
|
|
|
|
u8 addr[ETH_ALEN];
|
2007-11-19 23:00:29 +08:00
|
|
|
struct zd_mac *mac = zd_hw_mac(hw);
|
2007-07-02 01:22:32 +08:00
|
|
|
|
|
|
|
r = zd_chip_read_mac_addr_fw(&mac->chip, addr);
|
|
|
|
if (r)
|
|
|
|
return r;
|
|
|
|
|
2007-11-19 23:00:29 +08:00
|
|
|
SET_IEEE80211_PERM_ADDR(hw, addr);
|
|
|
|
|
2007-07-02 01:22:32 +08:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2007-11-19 23:00:29 +08:00
|
|
|
int zd_mac_init_hw(struct ieee80211_hw *hw)
|
2007-07-02 01:22:32 +08:00
|
|
|
{
|
|
|
|
int r;
|
2007-11-19 23:00:29 +08:00
|
|
|
struct zd_mac *mac = zd_hw_mac(hw);
|
2007-07-02 01:22:32 +08:00
|
|
|
struct zd_chip *chip = &mac->chip;
|
2008-09-10 14:19:49 +08:00
|
|
|
char alpha2[2];
|
[PATCH] ZyDAS ZD1211 USB-WLAN driver
There are 60+ USB wifi adapters available on the market based on the ZyDAS
ZD1211 chip.
Unlike the predecessor (ZD1201), ZD1211 does not have a hardware MAC, so most
data operations are coordinated by the device driver. The ZD1211 chip sits
alongside an RF transceiver which is also controlled by the driver. Our driver
currently supports 2 RF types, we know of one other available in a few marketed
products which we will be supporting soon.
Our driver also supports the newer revision of ZD1211, called ZD1211B. The
initialization and RF operations are slightly different for the new revision,
but the main difference is 802.11e support. Our driver does not support the
QoS features yet, but we think we know how to use them.
This driver is based on ZyDAS's own GPL driver available from www.zydas.com.tw.
ZyDAS engineers have been responsive and supportive of our efforts, so thumbs
up to them. Additionally, the firmware is redistributable and they have
provided device specs.
This driver has been written primarily by Ulrich Kunitz and myself. Graham
Gower, Greg KH, Remco and Bryan Rittmeyer have also contributed. The
developers of ieee80211 and softmac have made our lives so much easier- thanks!
We maintain a small info-page: http://zd1211.ath.cx/wiki/DriverRewrite
If there is enough time for review, we would like to aim for inclusion in
2.6.18. The driver works nicely as a STA, and can connect to both open and
encrypted networks (we are using software-based encryption for now). We will
work towards supporting more advanced features in the future (ad-hoc, master
mode, 802.11a, ...).
Signed-off-by: Daniel Drake <dsd@gentoo.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2006-06-03 00:11:32 +08:00
|
|
|
u8 default_regdomain;
|
|
|
|
|
|
|
|
r = zd_chip_enable_int(chip);
|
|
|
|
if (r)
|
|
|
|
goto out;
|
2007-07-02 01:22:32 +08:00
|
|
|
r = zd_chip_init_hw(chip);
|
[PATCH] ZyDAS ZD1211 USB-WLAN driver
There are 60+ USB wifi adapters available on the market based on the ZyDAS
ZD1211 chip.
Unlike the predecessor (ZD1201), ZD1211 does not have a hardware MAC, so most
data operations are coordinated by the device driver. The ZD1211 chip sits
alongside an RF transceiver which is also controlled by the driver. Our driver
currently supports 2 RF types, we know of one other available in a few marketed
products which we will be supporting soon.
Our driver also supports the newer revision of ZD1211, called ZD1211B. The
initialization and RF operations are slightly different for the new revision,
but the main difference is 802.11e support. Our driver does not support the
QoS features yet, but we think we know how to use them.
This driver is based on ZyDAS's own GPL driver available from www.zydas.com.tw.
ZyDAS engineers have been responsive and supportive of our efforts, so thumbs
up to them. Additionally, the firmware is redistributable and they have
provided device specs.
This driver has been written primarily by Ulrich Kunitz and myself. Graham
Gower, Greg KH, Remco and Bryan Rittmeyer have also contributed. The
developers of ieee80211 and softmac have made our lives so much easier- thanks!
We maintain a small info-page: http://zd1211.ath.cx/wiki/DriverRewrite
If there is enough time for review, we would like to aim for inclusion in
2.6.18. The driver works nicely as a STA, and can connect to both open and
encrypted networks (we are using software-based encryption for now). We will
work towards supporting more advanced features in the future (ad-hoc, master
mode, 802.11a, ...).
Signed-off-by: Daniel Drake <dsd@gentoo.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2006-06-03 00:11:32 +08:00
|
|
|
if (r)
|
|
|
|
goto disable_int;
|
|
|
|
|
|
|
|
ZD_ASSERT(!irqs_disabled());
|
|
|
|
|
|
|
|
r = zd_read_regdomain(chip, &default_regdomain);
|
|
|
|
if (r)
|
|
|
|
goto disable_int;
|
|
|
|
spin_lock_irq(&mac->lock);
|
|
|
|
mac->regdomain = mac->default_regdomain = default_regdomain;
|
|
|
|
spin_unlock_irq(&mac->lock);
|
|
|
|
|
2006-08-02 05:43:32 +08:00
|
|
|
/* We must inform the device that we are doing encryption/decryption in
|
|
|
|
* software at the moment. */
|
|
|
|
r = zd_set_encryption_type(chip, ENC_SNIFFER);
|
[PATCH] ZyDAS ZD1211 USB-WLAN driver
There are 60+ USB wifi adapters available on the market based on the ZyDAS
ZD1211 chip.
Unlike the predecessor (ZD1201), ZD1211 does not have a hardware MAC, so most
data operations are coordinated by the device driver. The ZD1211 chip sits
alongside an RF transceiver which is also controlled by the driver. Our driver
currently supports 2 RF types, we know of one other available in a few marketed
products which we will be supporting soon.
Our driver also supports the newer revision of ZD1211, called ZD1211B. The
initialization and RF operations are slightly different for the new revision,
but the main difference is 802.11e support. Our driver does not support the
QoS features yet, but we think we know how to use them.
This driver is based on ZyDAS's own GPL driver available from www.zydas.com.tw.
ZyDAS engineers have been responsive and supportive of our efforts, so thumbs
up to them. Additionally, the firmware is redistributable and they have
provided device specs.
This driver has been written primarily by Ulrich Kunitz and myself. Graham
Gower, Greg KH, Remco and Bryan Rittmeyer have also contributed. The
developers of ieee80211 and softmac have made our lives so much easier- thanks!
We maintain a small info-page: http://zd1211.ath.cx/wiki/DriverRewrite
If there is enough time for review, we would like to aim for inclusion in
2.6.18. The driver works nicely as a STA, and can connect to both open and
encrypted networks (we are using software-based encryption for now). We will
work towards supporting more advanced features in the future (ad-hoc, master
mode, 802.11a, ...).
Signed-off-by: Daniel Drake <dsd@gentoo.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2006-06-03 00:11:32 +08:00
|
|
|
if (r)
|
|
|
|
goto disable_int;
|
|
|
|
|
2008-09-10 14:19:49 +08:00
|
|
|
r = zd_reg2alpha2(mac->regdomain, alpha2);
|
2009-02-21 13:04:30 +08:00
|
|
|
if (r)
|
|
|
|
goto disable_int;
|
[PATCH] ZyDAS ZD1211 USB-WLAN driver
There are 60+ USB wifi adapters available on the market based on the ZyDAS
ZD1211 chip.
Unlike the predecessor (ZD1201), ZD1211 does not have a hardware MAC, so most
data operations are coordinated by the device driver. The ZD1211 chip sits
alongside an RF transceiver which is also controlled by the driver. Our driver
currently supports 2 RF types, we know of one other available in a few marketed
products which we will be supporting soon.
Our driver also supports the newer revision of ZD1211, called ZD1211B. The
initialization and RF operations are slightly different for the new revision,
but the main difference is 802.11e support. Our driver does not support the
QoS features yet, but we think we know how to use them.
This driver is based on ZyDAS's own GPL driver available from www.zydas.com.tw.
ZyDAS engineers have been responsive and supportive of our efforts, so thumbs
up to them. Additionally, the firmware is redistributable and they have
provided device specs.
This driver has been written primarily by Ulrich Kunitz and myself. Graham
Gower, Greg KH, Remco and Bryan Rittmeyer have also contributed. The
developers of ieee80211 and softmac have made our lives so much easier- thanks!
We maintain a small info-page: http://zd1211.ath.cx/wiki/DriverRewrite
If there is enough time for review, we would like to aim for inclusion in
2.6.18. The driver works nicely as a STA, and can connect to both open and
encrypted networks (we are using software-based encryption for now). We will
work towards supporting more advanced features in the future (ad-hoc, master
mode, 802.11a, ...).
Signed-off-by: Daniel Drake <dsd@gentoo.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2006-06-03 00:11:32 +08:00
|
|
|
|
2009-02-21 13:04:30 +08:00
|
|
|
r = regulatory_hint(hw->wiphy, alpha2);
|
[PATCH] ZyDAS ZD1211 USB-WLAN driver
There are 60+ USB wifi adapters available on the market based on the ZyDAS
ZD1211 chip.
Unlike the predecessor (ZD1201), ZD1211 does not have a hardware MAC, so most
data operations are coordinated by the device driver. The ZD1211 chip sits
alongside an RF transceiver which is also controlled by the driver. Our driver
currently supports 2 RF types, we know of one other available in a few marketed
products which we will be supporting soon.
Our driver also supports the newer revision of ZD1211, called ZD1211B. The
initialization and RF operations are slightly different for the new revision,
but the main difference is 802.11e support. Our driver does not support the
QoS features yet, but we think we know how to use them.
This driver is based on ZyDAS's own GPL driver available from www.zydas.com.tw.
ZyDAS engineers have been responsive and supportive of our efforts, so thumbs
up to them. Additionally, the firmware is redistributable and they have
provided device specs.
This driver has been written primarily by Ulrich Kunitz and myself. Graham
Gower, Greg KH, Remco and Bryan Rittmeyer have also contributed. The
developers of ieee80211 and softmac have made our lives so much easier- thanks!
We maintain a small info-page: http://zd1211.ath.cx/wiki/DriverRewrite
If there is enough time for review, we would like to aim for inclusion in
2.6.18. The driver works nicely as a STA, and can connect to both open and
encrypted networks (we are using software-based encryption for now). We will
work towards supporting more advanced features in the future (ad-hoc, master
mode, 802.11a, ...).
Signed-off-by: Daniel Drake <dsd@gentoo.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2006-06-03 00:11:32 +08:00
|
|
|
disable_int:
|
|
|
|
zd_chip_disable_int(chip);
|
|
|
|
out:
|
|
|
|
return r;
|
|
|
|
}
|
|
|
|
|
|
|
|
void zd_mac_clear(struct zd_mac *mac)
|
|
|
|
{
|
2006-12-01 08:58:07 +08:00
|
|
|
flush_workqueue(zd_workqueue);
|
[PATCH] ZyDAS ZD1211 USB-WLAN driver
There are 60+ USB wifi adapters available on the market based on the ZyDAS
ZD1211 chip.
Unlike the predecessor (ZD1201), ZD1211 does not have a hardware MAC, so most
data operations are coordinated by the device driver. The ZD1211 chip sits
alongside an RF transceiver which is also controlled by the driver. Our driver
currently supports 2 RF types, we know of one other available in a few marketed
products which we will be supporting soon.
Our driver also supports the newer revision of ZD1211, called ZD1211B. The
initialization and RF operations are slightly different for the new revision,
but the main difference is 802.11e support. Our driver does not support the
QoS features yet, but we think we know how to use them.
This driver is based on ZyDAS's own GPL driver available from www.zydas.com.tw.
ZyDAS engineers have been responsive and supportive of our efforts, so thumbs
up to them. Additionally, the firmware is redistributable and they have
provided device specs.
This driver has been written primarily by Ulrich Kunitz and myself. Graham
Gower, Greg KH, Remco and Bryan Rittmeyer have also contributed. The
developers of ieee80211 and softmac have made our lives so much easier- thanks!
We maintain a small info-page: http://zd1211.ath.cx/wiki/DriverRewrite
If there is enough time for review, we would like to aim for inclusion in
2.6.18. The driver works nicely as a STA, and can connect to both open and
encrypted networks (we are using software-based encryption for now). We will
work towards supporting more advanced features in the future (ad-hoc, master
mode, 802.11a, ...).
Signed-off-by: Daniel Drake <dsd@gentoo.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2006-06-03 00:11:32 +08:00
|
|
|
zd_chip_clear(&mac->chip);
|
2006-08-13 01:00:17 +08:00
|
|
|
ZD_ASSERT(!spin_is_locked(&mac->lock));
|
|
|
|
ZD_MEMCLEAR(mac, sizeof(struct zd_mac));
|
[PATCH] ZyDAS ZD1211 USB-WLAN driver
There are 60+ USB wifi adapters available on the market based on the ZyDAS
ZD1211 chip.
Unlike the predecessor (ZD1201), ZD1211 does not have a hardware MAC, so most
data operations are coordinated by the device driver. The ZD1211 chip sits
alongside an RF transceiver which is also controlled by the driver. Our driver
currently supports 2 RF types, we know of one other available in a few marketed
products which we will be supporting soon.
Our driver also supports the newer revision of ZD1211, called ZD1211B. The
initialization and RF operations are slightly different for the new revision,
but the main difference is 802.11e support. Our driver does not support the
QoS features yet, but we think we know how to use them.
This driver is based on ZyDAS's own GPL driver available from www.zydas.com.tw.
ZyDAS engineers have been responsive and supportive of our efforts, so thumbs
up to them. Additionally, the firmware is redistributable and they have
provided device specs.
This driver has been written primarily by Ulrich Kunitz and myself. Graham
Gower, Greg KH, Remco and Bryan Rittmeyer have also contributed. The
developers of ieee80211 and softmac have made our lives so much easier- thanks!
We maintain a small info-page: http://zd1211.ath.cx/wiki/DriverRewrite
If there is enough time for review, we would like to aim for inclusion in
2.6.18. The driver works nicely as a STA, and can connect to both open and
encrypted networks (we are using software-based encryption for now). We will
work towards supporting more advanced features in the future (ad-hoc, master
mode, 802.11a, ...).
Signed-off-by: Daniel Drake <dsd@gentoo.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2006-06-03 00:11:32 +08:00
|
|
|
}
|
|
|
|
|
2007-07-22 05:42:13 +08:00
|
|
|
static int set_rx_filter(struct zd_mac *mac)
|
[PATCH] ZyDAS ZD1211 USB-WLAN driver
There are 60+ USB wifi adapters available on the market based on the ZyDAS
ZD1211 chip.
Unlike the predecessor (ZD1201), ZD1211 does not have a hardware MAC, so most
data operations are coordinated by the device driver. The ZD1211 chip sits
alongside an RF transceiver which is also controlled by the driver. Our driver
currently supports 2 RF types, we know of one other available in a few marketed
products which we will be supporting soon.
Our driver also supports the newer revision of ZD1211, called ZD1211B. The
initialization and RF operations are slightly different for the new revision,
but the main difference is 802.11e support. Our driver does not support the
QoS features yet, but we think we know how to use them.
This driver is based on ZyDAS's own GPL driver available from www.zydas.com.tw.
ZyDAS engineers have been responsive and supportive of our efforts, so thumbs
up to them. Additionally, the firmware is redistributable and they have
provided device specs.
This driver has been written primarily by Ulrich Kunitz and myself. Graham
Gower, Greg KH, Remco and Bryan Rittmeyer have also contributed. The
developers of ieee80211 and softmac have made our lives so much easier- thanks!
We maintain a small info-page: http://zd1211.ath.cx/wiki/DriverRewrite
If there is enough time for review, we would like to aim for inclusion in
2.6.18. The driver works nicely as a STA, and can connect to both open and
encrypted networks (we are using software-based encryption for now). We will
work towards supporting more advanced features in the future (ad-hoc, master
mode, 802.11a, ...).
Signed-off-by: Daniel Drake <dsd@gentoo.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2006-06-03 00:11:32 +08:00
|
|
|
{
|
2007-11-19 23:00:29 +08:00
|
|
|
unsigned long flags;
|
|
|
|
u32 filter = STA_RX_FILTER;
|
[PATCH] ZyDAS ZD1211 USB-WLAN driver
There are 60+ USB wifi adapters available on the market based on the ZyDAS
ZD1211 chip.
Unlike the predecessor (ZD1201), ZD1211 does not have a hardware MAC, so most
data operations are coordinated by the device driver. The ZD1211 chip sits
alongside an RF transceiver which is also controlled by the driver. Our driver
currently supports 2 RF types, we know of one other available in a few marketed
products which we will be supporting soon.
Our driver also supports the newer revision of ZD1211, called ZD1211B. The
initialization and RF operations are slightly different for the new revision,
but the main difference is 802.11e support. Our driver does not support the
QoS features yet, but we think we know how to use them.
This driver is based on ZyDAS's own GPL driver available from www.zydas.com.tw.
ZyDAS engineers have been responsive and supportive of our efforts, so thumbs
up to them. Additionally, the firmware is redistributable and they have
provided device specs.
This driver has been written primarily by Ulrich Kunitz and myself. Graham
Gower, Greg KH, Remco and Bryan Rittmeyer have also contributed. The
developers of ieee80211 and softmac have made our lives so much easier- thanks!
We maintain a small info-page: http://zd1211.ath.cx/wiki/DriverRewrite
If there is enough time for review, we would like to aim for inclusion in
2.6.18. The driver works nicely as a STA, and can connect to both open and
encrypted networks (we are using software-based encryption for now). We will
work towards supporting more advanced features in the future (ad-hoc, master
mode, 802.11a, ...).
Signed-off-by: Daniel Drake <dsd@gentoo.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2006-06-03 00:11:32 +08:00
|
|
|
|
2007-11-19 23:00:29 +08:00
|
|
|
spin_lock_irqsave(&mac->lock, flags);
|
|
|
|
if (mac->pass_ctrl)
|
|
|
|
filter |= RX_FILTER_CTRL;
|
|
|
|
spin_unlock_irqrestore(&mac->lock, flags);
|
|
|
|
|
|
|
|
return zd_iowrite32(&mac->chip, CR_RX_FILTER, filter);
|
2007-07-22 05:42:13 +08:00
|
|
|
}
|
|
|
|
|
2011-02-01 02:48:06 +08:00
|
|
|
static int set_mac_and_bssid(struct zd_mac *mac)
|
|
|
|
{
|
|
|
|
int r;
|
|
|
|
|
|
|
|
if (!mac->vif)
|
|
|
|
return -1;
|
|
|
|
|
|
|
|
r = zd_write_mac_addr(&mac->chip, mac->vif->addr);
|
|
|
|
if (r)
|
|
|
|
return r;
|
|
|
|
|
|
|
|
/* Vendor driver after setting MAC either sets BSSID for AP or
|
|
|
|
* filter for other modes.
|
|
|
|
*/
|
|
|
|
if (mac->type != NL80211_IFTYPE_AP)
|
|
|
|
return set_rx_filter(mac);
|
|
|
|
else
|
|
|
|
return zd_write_bssid(&mac->chip, mac->vif->addr);
|
|
|
|
}
|
|
|
|
|
2007-07-22 05:42:13 +08:00
|
|
|
static int set_mc_hash(struct zd_mac *mac)
|
|
|
|
{
|
|
|
|
struct zd_mc_hash hash;
|
|
|
|
zd_mc_clear(&hash);
|
|
|
|
return zd_chip_set_multicast_hash(&mac->chip, &hash);
|
|
|
|
}
|
|
|
|
|
2011-02-01 02:49:52 +08:00
|
|
|
int zd_op_start(struct ieee80211_hw *hw)
|
[PATCH] ZyDAS ZD1211 USB-WLAN driver
There are 60+ USB wifi adapters available on the market based on the ZyDAS
ZD1211 chip.
Unlike the predecessor (ZD1201), ZD1211 does not have a hardware MAC, so most
data operations are coordinated by the device driver. The ZD1211 chip sits
alongside an RF transceiver which is also controlled by the driver. Our driver
currently supports 2 RF types, we know of one other available in a few marketed
products which we will be supporting soon.
Our driver also supports the newer revision of ZD1211, called ZD1211B. The
initialization and RF operations are slightly different for the new revision,
but the main difference is 802.11e support. Our driver does not support the
QoS features yet, but we think we know how to use them.
This driver is based on ZyDAS's own GPL driver available from www.zydas.com.tw.
ZyDAS engineers have been responsive and supportive of our efforts, so thumbs
up to them. Additionally, the firmware is redistributable and they have
provided device specs.
This driver has been written primarily by Ulrich Kunitz and myself. Graham
Gower, Greg KH, Remco and Bryan Rittmeyer have also contributed. The
developers of ieee80211 and softmac have made our lives so much easier- thanks!
We maintain a small info-page: http://zd1211.ath.cx/wiki/DriverRewrite
If there is enough time for review, we would like to aim for inclusion in
2.6.18. The driver works nicely as a STA, and can connect to both open and
encrypted networks (we are using software-based encryption for now). We will
work towards supporting more advanced features in the future (ad-hoc, master
mode, 802.11a, ...).
Signed-off-by: Daniel Drake <dsd@gentoo.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2006-06-03 00:11:32 +08:00
|
|
|
{
|
2007-11-19 23:00:29 +08:00
|
|
|
struct zd_mac *mac = zd_hw_mac(hw);
|
[PATCH] ZyDAS ZD1211 USB-WLAN driver
There are 60+ USB wifi adapters available on the market based on the ZyDAS
ZD1211 chip.
Unlike the predecessor (ZD1201), ZD1211 does not have a hardware MAC, so most
data operations are coordinated by the device driver. The ZD1211 chip sits
alongside an RF transceiver which is also controlled by the driver. Our driver
currently supports 2 RF types, we know of one other available in a few marketed
products which we will be supporting soon.
Our driver also supports the newer revision of ZD1211, called ZD1211B. The
initialization and RF operations are slightly different for the new revision,
but the main difference is 802.11e support. Our driver does not support the
QoS features yet, but we think we know how to use them.
This driver is based on ZyDAS's own GPL driver available from www.zydas.com.tw.
ZyDAS engineers have been responsive and supportive of our efforts, so thumbs
up to them. Additionally, the firmware is redistributable and they have
provided device specs.
This driver has been written primarily by Ulrich Kunitz and myself. Graham
Gower, Greg KH, Remco and Bryan Rittmeyer have also contributed. The
developers of ieee80211 and softmac have made our lives so much easier- thanks!
We maintain a small info-page: http://zd1211.ath.cx/wiki/DriverRewrite
If there is enough time for review, we would like to aim for inclusion in
2.6.18. The driver works nicely as a STA, and can connect to both open and
encrypted networks (we are using software-based encryption for now). We will
work towards supporting more advanced features in the future (ad-hoc, master
mode, 802.11a, ...).
Signed-off-by: Daniel Drake <dsd@gentoo.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2006-06-03 00:11:32 +08:00
|
|
|
struct zd_chip *chip = &mac->chip;
|
2007-07-02 01:22:32 +08:00
|
|
|
struct zd_usb *usb = &chip->usb;
|
[PATCH] ZyDAS ZD1211 USB-WLAN driver
There are 60+ USB wifi adapters available on the market based on the ZyDAS
ZD1211 chip.
Unlike the predecessor (ZD1201), ZD1211 does not have a hardware MAC, so most
data operations are coordinated by the device driver. The ZD1211 chip sits
alongside an RF transceiver which is also controlled by the driver. Our driver
currently supports 2 RF types, we know of one other available in a few marketed
products which we will be supporting soon.
Our driver also supports the newer revision of ZD1211, called ZD1211B. The
initialization and RF operations are slightly different for the new revision,
but the main difference is 802.11e support. Our driver does not support the
QoS features yet, but we think we know how to use them.
This driver is based on ZyDAS's own GPL driver available from www.zydas.com.tw.
ZyDAS engineers have been responsive and supportive of our efforts, so thumbs
up to them. Additionally, the firmware is redistributable and they have
provided device specs.
This driver has been written primarily by Ulrich Kunitz and myself. Graham
Gower, Greg KH, Remco and Bryan Rittmeyer have also contributed. The
developers of ieee80211 and softmac have made our lives so much easier- thanks!
We maintain a small info-page: http://zd1211.ath.cx/wiki/DriverRewrite
If there is enough time for review, we would like to aim for inclusion in
2.6.18. The driver works nicely as a STA, and can connect to both open and
encrypted networks (we are using software-based encryption for now). We will
work towards supporting more advanced features in the future (ad-hoc, master
mode, 802.11a, ...).
Signed-off-by: Daniel Drake <dsd@gentoo.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2006-06-03 00:11:32 +08:00
|
|
|
int r;
|
|
|
|
|
2007-07-02 01:22:32 +08:00
|
|
|
if (!usb->initialized) {
|
|
|
|
r = zd_usb_init_hw(usb);
|
|
|
|
if (r)
|
|
|
|
goto out;
|
|
|
|
}
|
|
|
|
|
[PATCH] ZyDAS ZD1211 USB-WLAN driver
There are 60+ USB wifi adapters available on the market based on the ZyDAS
ZD1211 chip.
Unlike the predecessor (ZD1201), ZD1211 does not have a hardware MAC, so most
data operations are coordinated by the device driver. The ZD1211 chip sits
alongside an RF transceiver which is also controlled by the driver. Our driver
currently supports 2 RF types, we know of one other available in a few marketed
products which we will be supporting soon.
Our driver also supports the newer revision of ZD1211, called ZD1211B. The
initialization and RF operations are slightly different for the new revision,
but the main difference is 802.11e support. Our driver does not support the
QoS features yet, but we think we know how to use them.
This driver is based on ZyDAS's own GPL driver available from www.zydas.com.tw.
ZyDAS engineers have been responsive and supportive of our efforts, so thumbs
up to them. Additionally, the firmware is redistributable and they have
provided device specs.
This driver has been written primarily by Ulrich Kunitz and myself. Graham
Gower, Greg KH, Remco and Bryan Rittmeyer have also contributed. The
developers of ieee80211 and softmac have made our lives so much easier- thanks!
We maintain a small info-page: http://zd1211.ath.cx/wiki/DriverRewrite
If there is enough time for review, we would like to aim for inclusion in
2.6.18. The driver works nicely as a STA, and can connect to both open and
encrypted networks (we are using software-based encryption for now). We will
work towards supporting more advanced features in the future (ad-hoc, master
mode, 802.11a, ...).
Signed-off-by: Daniel Drake <dsd@gentoo.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2006-06-03 00:11:32 +08:00
|
|
|
r = zd_chip_enable_int(chip);
|
|
|
|
if (r < 0)
|
|
|
|
goto out;
|
|
|
|
|
|
|
|
r = zd_chip_set_basic_rates(chip, CR_RATES_80211B | CR_RATES_80211G);
|
|
|
|
if (r < 0)
|
|
|
|
goto disable_int;
|
2007-07-22 05:42:13 +08:00
|
|
|
r = set_rx_filter(mac);
|
|
|
|
if (r)
|
|
|
|
goto disable_int;
|
|
|
|
r = set_mc_hash(mac);
|
[PATCH] ZyDAS ZD1211 USB-WLAN driver
There are 60+ USB wifi adapters available on the market based on the ZyDAS
ZD1211 chip.
Unlike the predecessor (ZD1201), ZD1211 does not have a hardware MAC, so most
data operations are coordinated by the device driver. The ZD1211 chip sits
alongside an RF transceiver which is also controlled by the driver. Our driver
currently supports 2 RF types, we know of one other available in a few marketed
products which we will be supporting soon.
Our driver also supports the newer revision of ZD1211, called ZD1211B. The
initialization and RF operations are slightly different for the new revision,
but the main difference is 802.11e support. Our driver does not support the
QoS features yet, but we think we know how to use them.
This driver is based on ZyDAS's own GPL driver available from www.zydas.com.tw.
ZyDAS engineers have been responsive and supportive of our efforts, so thumbs
up to them. Additionally, the firmware is redistributable and they have
provided device specs.
This driver has been written primarily by Ulrich Kunitz and myself. Graham
Gower, Greg KH, Remco and Bryan Rittmeyer have also contributed. The
developers of ieee80211 and softmac have made our lives so much easier- thanks!
We maintain a small info-page: http://zd1211.ath.cx/wiki/DriverRewrite
If there is enough time for review, we would like to aim for inclusion in
2.6.18. The driver works nicely as a STA, and can connect to both open and
encrypted networks (we are using software-based encryption for now). We will
work towards supporting more advanced features in the future (ad-hoc, master
mode, 802.11a, ...).
Signed-off-by: Daniel Drake <dsd@gentoo.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2006-06-03 00:11:32 +08:00
|
|
|
if (r)
|
|
|
|
goto disable_int;
|
|
|
|
r = zd_chip_switch_radio_on(chip);
|
|
|
|
if (r < 0)
|
|
|
|
goto disable_int;
|
2007-11-19 23:00:29 +08:00
|
|
|
r = zd_chip_enable_rxtx(chip);
|
[PATCH] ZyDAS ZD1211 USB-WLAN driver
There are 60+ USB wifi adapters available on the market based on the ZyDAS
ZD1211 chip.
Unlike the predecessor (ZD1201), ZD1211 does not have a hardware MAC, so most
data operations are coordinated by the device driver. The ZD1211 chip sits
alongside an RF transceiver which is also controlled by the driver. Our driver
currently supports 2 RF types, we know of one other available in a few marketed
products which we will be supporting soon.
Our driver also supports the newer revision of ZD1211, called ZD1211B. The
initialization and RF operations are slightly different for the new revision,
but the main difference is 802.11e support. Our driver does not support the
QoS features yet, but we think we know how to use them.
This driver is based on ZyDAS's own GPL driver available from www.zydas.com.tw.
ZyDAS engineers have been responsive and supportive of our efforts, so thumbs
up to them. Additionally, the firmware is redistributable and they have
provided device specs.
This driver has been written primarily by Ulrich Kunitz and myself. Graham
Gower, Greg KH, Remco and Bryan Rittmeyer have also contributed. The
developers of ieee80211 and softmac have made our lives so much easier- thanks!
We maintain a small info-page: http://zd1211.ath.cx/wiki/DriverRewrite
If there is enough time for review, we would like to aim for inclusion in
2.6.18. The driver works nicely as a STA, and can connect to both open and
encrypted networks (we are using software-based encryption for now). We will
work towards supporting more advanced features in the future (ad-hoc, master
mode, 802.11a, ...).
Signed-off-by: Daniel Drake <dsd@gentoo.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2006-06-03 00:11:32 +08:00
|
|
|
if (r < 0)
|
|
|
|
goto disable_radio;
|
|
|
|
r = zd_chip_enable_hwint(chip);
|
|
|
|
if (r < 0)
|
2007-11-19 23:00:29 +08:00
|
|
|
goto disable_rxtx;
|
[PATCH] ZyDAS ZD1211 USB-WLAN driver
There are 60+ USB wifi adapters available on the market based on the ZyDAS
ZD1211 chip.
Unlike the predecessor (ZD1201), ZD1211 does not have a hardware MAC, so most
data operations are coordinated by the device driver. The ZD1211 chip sits
alongside an RF transceiver which is also controlled by the driver. Our driver
currently supports 2 RF types, we know of one other available in a few marketed
products which we will be supporting soon.
Our driver also supports the newer revision of ZD1211, called ZD1211B. The
initialization and RF operations are slightly different for the new revision,
but the main difference is 802.11e support. Our driver does not support the
QoS features yet, but we think we know how to use them.
This driver is based on ZyDAS's own GPL driver available from www.zydas.com.tw.
ZyDAS engineers have been responsive and supportive of our efforts, so thumbs
up to them. Additionally, the firmware is redistributable and they have
provided device specs.
This driver has been written primarily by Ulrich Kunitz and myself. Graham
Gower, Greg KH, Remco and Bryan Rittmeyer have also contributed. The
developers of ieee80211 and softmac have made our lives so much easier- thanks!
We maintain a small info-page: http://zd1211.ath.cx/wiki/DriverRewrite
If there is enough time for review, we would like to aim for inclusion in
2.6.18. The driver works nicely as a STA, and can connect to both open and
encrypted networks (we are using software-based encryption for now). We will
work towards supporting more advanced features in the future (ad-hoc, master
mode, 802.11a, ...).
Signed-off-by: Daniel Drake <dsd@gentoo.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2006-06-03 00:11:32 +08:00
|
|
|
|
2006-09-13 09:42:38 +08:00
|
|
|
housekeeping_enable(mac);
|
2011-02-01 02:48:55 +08:00
|
|
|
beacon_enable(mac);
|
|
|
|
set_bit(ZD_DEVICE_RUNNING, &mac->flags);
|
[PATCH] ZyDAS ZD1211 USB-WLAN driver
There are 60+ USB wifi adapters available on the market based on the ZyDAS
ZD1211 chip.
Unlike the predecessor (ZD1201), ZD1211 does not have a hardware MAC, so most
data operations are coordinated by the device driver. The ZD1211 chip sits
alongside an RF transceiver which is also controlled by the driver. Our driver
currently supports 2 RF types, we know of one other available in a few marketed
products which we will be supporting soon.
Our driver also supports the newer revision of ZD1211, called ZD1211B. The
initialization and RF operations are slightly different for the new revision,
but the main difference is 802.11e support. Our driver does not support the
QoS features yet, but we think we know how to use them.
This driver is based on ZyDAS's own GPL driver available from www.zydas.com.tw.
ZyDAS engineers have been responsive and supportive of our efforts, so thumbs
up to them. Additionally, the firmware is redistributable and they have
provided device specs.
This driver has been written primarily by Ulrich Kunitz and myself. Graham
Gower, Greg KH, Remco and Bryan Rittmeyer have also contributed. The
developers of ieee80211 and softmac have made our lives so much easier- thanks!
We maintain a small info-page: http://zd1211.ath.cx/wiki/DriverRewrite
If there is enough time for review, we would like to aim for inclusion in
2.6.18. The driver works nicely as a STA, and can connect to both open and
encrypted networks (we are using software-based encryption for now). We will
work towards supporting more advanced features in the future (ad-hoc, master
mode, 802.11a, ...).
Signed-off-by: Daniel Drake <dsd@gentoo.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2006-06-03 00:11:32 +08:00
|
|
|
return 0;
|
2007-11-19 23:00:29 +08:00
|
|
|
disable_rxtx:
|
|
|
|
zd_chip_disable_rxtx(chip);
|
[PATCH] ZyDAS ZD1211 USB-WLAN driver
There are 60+ USB wifi adapters available on the market based on the ZyDAS
ZD1211 chip.
Unlike the predecessor (ZD1201), ZD1211 does not have a hardware MAC, so most
data operations are coordinated by the device driver. The ZD1211 chip sits
alongside an RF transceiver which is also controlled by the driver. Our driver
currently supports 2 RF types, we know of one other available in a few marketed
products which we will be supporting soon.
Our driver also supports the newer revision of ZD1211, called ZD1211B. The
initialization and RF operations are slightly different for the new revision,
but the main difference is 802.11e support. Our driver does not support the
QoS features yet, but we think we know how to use them.
This driver is based on ZyDAS's own GPL driver available from www.zydas.com.tw.
ZyDAS engineers have been responsive and supportive of our efforts, so thumbs
up to them. Additionally, the firmware is redistributable and they have
provided device specs.
This driver has been written primarily by Ulrich Kunitz and myself. Graham
Gower, Greg KH, Remco and Bryan Rittmeyer have also contributed. The
developers of ieee80211 and softmac have made our lives so much easier- thanks!
We maintain a small info-page: http://zd1211.ath.cx/wiki/DriverRewrite
If there is enough time for review, we would like to aim for inclusion in
2.6.18. The driver works nicely as a STA, and can connect to both open and
encrypted networks (we are using software-based encryption for now). We will
work towards supporting more advanced features in the future (ad-hoc, master
mode, 802.11a, ...).
Signed-off-by: Daniel Drake <dsd@gentoo.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2006-06-03 00:11:32 +08:00
|
|
|
disable_radio:
|
|
|
|
zd_chip_switch_radio_off(chip);
|
|
|
|
disable_int:
|
|
|
|
zd_chip_disable_int(chip);
|
|
|
|
out:
|
|
|
|
return r;
|
|
|
|
}
|
|
|
|
|
2011-02-01 02:49:52 +08:00
|
|
|
void zd_op_stop(struct ieee80211_hw *hw)
|
2007-11-19 23:00:29 +08:00
|
|
|
{
|
|
|
|
struct zd_mac *mac = zd_hw_mac(hw);
|
|
|
|
struct zd_chip *chip = &mac->chip;
|
|
|
|
struct sk_buff *skb;
|
|
|
|
struct sk_buff_head *ack_wait_queue = &mac->ack_wait_queue;
|
2006-06-12 06:18:54 +08:00
|
|
|
|
2011-02-01 02:48:55 +08:00
|
|
|
clear_bit(ZD_DEVICE_RUNNING, &mac->flags);
|
|
|
|
|
2007-11-19 23:00:29 +08:00
|
|
|
/* The order here deliberately is a little different from the open()
|
[PATCH] ZyDAS ZD1211 USB-WLAN driver
There are 60+ USB wifi adapters available on the market based on the ZyDAS
ZD1211 chip.
Unlike the predecessor (ZD1201), ZD1211 does not have a hardware MAC, so most
data operations are coordinated by the device driver. The ZD1211 chip sits
alongside an RF transceiver which is also controlled by the driver. Our driver
currently supports 2 RF types, we know of one other available in a few marketed
products which we will be supporting soon.
Our driver also supports the newer revision of ZD1211, called ZD1211B. The
initialization and RF operations are slightly different for the new revision,
but the main difference is 802.11e support. Our driver does not support the
QoS features yet, but we think we know how to use them.
This driver is based on ZyDAS's own GPL driver available from www.zydas.com.tw.
ZyDAS engineers have been responsive and supportive of our efforts, so thumbs
up to them. Additionally, the firmware is redistributable and they have
provided device specs.
This driver has been written primarily by Ulrich Kunitz and myself. Graham
Gower, Greg KH, Remco and Bryan Rittmeyer have also contributed. The
developers of ieee80211 and softmac have made our lives so much easier- thanks!
We maintain a small info-page: http://zd1211.ath.cx/wiki/DriverRewrite
If there is enough time for review, we would like to aim for inclusion in
2.6.18. The driver works nicely as a STA, and can connect to both open and
encrypted networks (we are using software-based encryption for now). We will
work towards supporting more advanced features in the future (ad-hoc, master
mode, 802.11a, ...).
Signed-off-by: Daniel Drake <dsd@gentoo.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2006-06-03 00:11:32 +08:00
|
|
|
* method, since we need to make sure there is no opportunity for RX
|
2007-11-19 23:00:29 +08:00
|
|
|
* frames to be processed by mac80211 after we have stopped it.
|
[PATCH] ZyDAS ZD1211 USB-WLAN driver
There are 60+ USB wifi adapters available on the market based on the ZyDAS
ZD1211 chip.
Unlike the predecessor (ZD1201), ZD1211 does not have a hardware MAC, so most
data operations are coordinated by the device driver. The ZD1211 chip sits
alongside an RF transceiver which is also controlled by the driver. Our driver
currently supports 2 RF types, we know of one other available in a few marketed
products which we will be supporting soon.
Our driver also supports the newer revision of ZD1211, called ZD1211B. The
initialization and RF operations are slightly different for the new revision,
but the main difference is 802.11e support. Our driver does not support the
QoS features yet, but we think we know how to use them.
This driver is based on ZyDAS's own GPL driver available from www.zydas.com.tw.
ZyDAS engineers have been responsive and supportive of our efforts, so thumbs
up to them. Additionally, the firmware is redistributable and they have
provided device specs.
This driver has been written primarily by Ulrich Kunitz and myself. Graham
Gower, Greg KH, Remco and Bryan Rittmeyer have also contributed. The
developers of ieee80211 and softmac have made our lives so much easier- thanks!
We maintain a small info-page: http://zd1211.ath.cx/wiki/DriverRewrite
If there is enough time for review, we would like to aim for inclusion in
2.6.18. The driver works nicely as a STA, and can connect to both open and
encrypted networks (we are using software-based encryption for now). We will
work towards supporting more advanced features in the future (ad-hoc, master
mode, 802.11a, ...).
Signed-off-by: Daniel Drake <dsd@gentoo.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2006-06-03 00:11:32 +08:00
|
|
|
*/
|
|
|
|
|
2007-11-19 23:00:29 +08:00
|
|
|
zd_chip_disable_rxtx(chip);
|
2011-02-01 02:48:55 +08:00
|
|
|
beacon_disable(mac);
|
2006-09-13 09:42:38 +08:00
|
|
|
housekeeping_disable(mac);
|
2006-11-22 08:06:48 +08:00
|
|
|
flush_workqueue(zd_workqueue);
|
|
|
|
|
[PATCH] ZyDAS ZD1211 USB-WLAN driver
There are 60+ USB wifi adapters available on the market based on the ZyDAS
ZD1211 chip.
Unlike the predecessor (ZD1201), ZD1211 does not have a hardware MAC, so most
data operations are coordinated by the device driver. The ZD1211 chip sits
alongside an RF transceiver which is also controlled by the driver. Our driver
currently supports 2 RF types, we know of one other available in a few marketed
products which we will be supporting soon.
Our driver also supports the newer revision of ZD1211, called ZD1211B. The
initialization and RF operations are slightly different for the new revision,
but the main difference is 802.11e support. Our driver does not support the
QoS features yet, but we think we know how to use them.
This driver is based on ZyDAS's own GPL driver available from www.zydas.com.tw.
ZyDAS engineers have been responsive and supportive of our efforts, so thumbs
up to them. Additionally, the firmware is redistributable and they have
provided device specs.
This driver has been written primarily by Ulrich Kunitz and myself. Graham
Gower, Greg KH, Remco and Bryan Rittmeyer have also contributed. The
developers of ieee80211 and softmac have made our lives so much easier- thanks!
We maintain a small info-page: http://zd1211.ath.cx/wiki/DriverRewrite
If there is enough time for review, we would like to aim for inclusion in
2.6.18. The driver works nicely as a STA, and can connect to both open and
encrypted networks (we are using software-based encryption for now). We will
work towards supporting more advanced features in the future (ad-hoc, master
mode, 802.11a, ...).
Signed-off-by: Daniel Drake <dsd@gentoo.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2006-06-03 00:11:32 +08:00
|
|
|
zd_chip_disable_hwint(chip);
|
|
|
|
zd_chip_switch_radio_off(chip);
|
|
|
|
zd_chip_disable_int(chip);
|
|
|
|
|
|
|
|
|
2007-11-19 23:00:29 +08:00
|
|
|
while ((skb = skb_dequeue(ack_wait_queue)))
|
2008-05-15 18:55:29 +08:00
|
|
|
dev_kfree_skb_any(skb);
|
[PATCH] ZyDAS ZD1211 USB-WLAN driver
There are 60+ USB wifi adapters available on the market based on the ZyDAS
ZD1211 chip.
Unlike the predecessor (ZD1201), ZD1211 does not have a hardware MAC, so most
data operations are coordinated by the device driver. The ZD1211 chip sits
alongside an RF transceiver which is also controlled by the driver. Our driver
currently supports 2 RF types, we know of one other available in a few marketed
products which we will be supporting soon.
Our driver also supports the newer revision of ZD1211, called ZD1211B. The
initialization and RF operations are slightly different for the new revision,
but the main difference is 802.11e support. Our driver does not support the
QoS features yet, but we think we know how to use them.
This driver is based on ZyDAS's own GPL driver available from www.zydas.com.tw.
ZyDAS engineers have been responsive and supportive of our efforts, so thumbs
up to them. Additionally, the firmware is redistributable and they have
provided device specs.
This driver has been written primarily by Ulrich Kunitz and myself. Graham
Gower, Greg KH, Remco and Bryan Rittmeyer have also contributed. The
developers of ieee80211 and softmac have made our lives so much easier- thanks!
We maintain a small info-page: http://zd1211.ath.cx/wiki/DriverRewrite
If there is enough time for review, we would like to aim for inclusion in
2.6.18. The driver works nicely as a STA, and can connect to both open and
encrypted networks (we are using software-based encryption for now). We will
work towards supporting more advanced features in the future (ad-hoc, master
mode, 802.11a, ...).
Signed-off-by: Daniel Drake <dsd@gentoo.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2006-06-03 00:11:32 +08:00
|
|
|
}
|
|
|
|
|
2011-02-01 02:49:43 +08:00
|
|
|
int zd_restore_settings(struct zd_mac *mac)
|
|
|
|
{
|
|
|
|
struct sk_buff *beacon;
|
|
|
|
struct zd_mc_hash multicast_hash;
|
|
|
|
unsigned int short_preamble;
|
|
|
|
int r, beacon_interval, beacon_period;
|
|
|
|
u8 channel;
|
|
|
|
|
|
|
|
dev_dbg_f(zd_mac_dev(mac), "\n");
|
|
|
|
|
|
|
|
spin_lock_irq(&mac->lock);
|
|
|
|
multicast_hash = mac->multicast_hash;
|
|
|
|
short_preamble = mac->short_preamble;
|
|
|
|
beacon_interval = mac->beacon.interval;
|
|
|
|
beacon_period = mac->beacon.period;
|
|
|
|
channel = mac->channel;
|
|
|
|
spin_unlock_irq(&mac->lock);
|
|
|
|
|
|
|
|
r = set_mac_and_bssid(mac);
|
|
|
|
if (r < 0) {
|
|
|
|
dev_dbg_f(zd_mac_dev(mac), "set_mac_and_bssid failed, %d\n", r);
|
|
|
|
return r;
|
|
|
|
}
|
|
|
|
|
|
|
|
r = zd_chip_set_channel(&mac->chip, channel);
|
|
|
|
if (r < 0) {
|
|
|
|
dev_dbg_f(zd_mac_dev(mac), "zd_chip_set_channel failed, %d\n",
|
|
|
|
r);
|
|
|
|
return r;
|
|
|
|
}
|
|
|
|
|
|
|
|
set_rts_cts(mac, short_preamble);
|
|
|
|
|
|
|
|
r = zd_chip_set_multicast_hash(&mac->chip, &multicast_hash);
|
|
|
|
if (r < 0) {
|
|
|
|
dev_dbg_f(zd_mac_dev(mac),
|
|
|
|
"zd_chip_set_multicast_hash failed, %d\n", r);
|
|
|
|
return r;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (mac->type == NL80211_IFTYPE_MESH_POINT ||
|
|
|
|
mac->type == NL80211_IFTYPE_ADHOC ||
|
|
|
|
mac->type == NL80211_IFTYPE_AP) {
|
|
|
|
if (mac->vif != NULL) {
|
|
|
|
beacon = ieee80211_beacon_get(mac->hw, mac->vif);
|
2011-06-20 19:42:39 +08:00
|
|
|
if (beacon)
|
2011-06-20 19:42:49 +08:00
|
|
|
zd_mac_config_beacon(mac->hw, beacon, false);
|
2011-02-01 02:49:43 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
zd_set_beacon_interval(&mac->chip, beacon_interval,
|
|
|
|
beacon_period, mac->type);
|
|
|
|
|
|
|
|
spin_lock_irq(&mac->lock);
|
|
|
|
mac->beacon.last_update = jiffies;
|
|
|
|
spin_unlock_irq(&mac->lock);
|
|
|
|
}
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2007-11-19 23:00:29 +08:00
|
|
|
/**
|
2009-10-22 18:04:52 +08:00
|
|
|
* zd_mac_tx_status - reports tx status of a packet if required
|
2007-11-19 23:00:29 +08:00
|
|
|
* @hw - a &struct ieee80211_hw pointer
|
|
|
|
* @skb - a sk-buffer
|
2008-05-15 18:55:29 +08:00
|
|
|
* @flags: extra flags to set in the TX status info
|
|
|
|
* @ackssi: ACK signal strength
|
2009-01-08 10:09:16 +08:00
|
|
|
* @success - True for successful transmission of the frame
|
2007-11-19 23:00:29 +08:00
|
|
|
*
|
|
|
|
* This information calls ieee80211_tx_status_irqsafe() if required by the
|
|
|
|
* control information. It copies the control information into the status
|
|
|
|
* information.
|
|
|
|
*
|
|
|
|
* If no status information has been requested, the skb is freed.
|
|
|
|
*/
|
2009-10-22 18:04:52 +08:00
|
|
|
static void zd_mac_tx_status(struct ieee80211_hw *hw, struct sk_buff *skb,
|
|
|
|
int ackssi, struct tx_status *tx_status)
|
2006-11-22 08:06:48 +08:00
|
|
|
{
|
2008-05-15 18:55:29 +08:00
|
|
|
struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb);
|
2009-10-22 18:04:52 +08:00
|
|
|
int i;
|
|
|
|
int success = 1, retry = 1;
|
|
|
|
int first_idx;
|
|
|
|
const struct tx_retry_rate *retries;
|
2008-05-15 18:55:29 +08:00
|
|
|
|
2008-10-21 18:40:02 +08:00
|
|
|
ieee80211_tx_info_clear_status(info);
|
2006-11-22 08:06:48 +08:00
|
|
|
|
2009-10-22 18:04:52 +08:00
|
|
|
if (tx_status) {
|
|
|
|
success = !tx_status->failure;
|
|
|
|
retry = tx_status->retry + success;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (success) {
|
|
|
|
/* success */
|
2008-10-21 18:40:02 +08:00
|
|
|
info->flags |= IEEE80211_TX_STAT_ACK;
|
2009-10-22 18:04:52 +08:00
|
|
|
} else {
|
|
|
|
/* failure */
|
|
|
|
info->flags &= ~IEEE80211_TX_STAT_ACK;
|
|
|
|
}
|
|
|
|
|
|
|
|
first_idx = info->status.rates[0].idx;
|
|
|
|
ZD_ASSERT(0<=first_idx && first_idx<ARRAY_SIZE(zd_retry_rates));
|
|
|
|
retries = &zd_retry_rates[first_idx];
|
2010-02-27 14:12:34 +08:00
|
|
|
ZD_ASSERT(1 <= retry && retry <= retries->count);
|
2009-10-22 18:04:52 +08:00
|
|
|
|
|
|
|
info->status.rates[0].idx = retries->rate[0];
|
|
|
|
info->status.rates[0].count = 1; // (retry > 1 ? 2 : 1);
|
|
|
|
|
|
|
|
for (i=1; i<IEEE80211_TX_MAX_RATES-1 && i<retry; i++) {
|
|
|
|
info->status.rates[i].idx = retries->rate[i];
|
|
|
|
info->status.rates[i].count = 1; // ((i==retry-1) && success ? 1:2);
|
|
|
|
}
|
|
|
|
for (; i<IEEE80211_TX_MAX_RATES && i<retry; i++) {
|
2010-02-27 14:12:34 +08:00
|
|
|
info->status.rates[i].idx = retries->rate[retry - 1];
|
2009-10-22 18:04:52 +08:00
|
|
|
info->status.rates[i].count = 1; // (success ? 1:2);
|
|
|
|
}
|
|
|
|
if (i<IEEE80211_TX_MAX_RATES)
|
|
|
|
info->status.rates[i].idx = -1; /* terminate */
|
|
|
|
|
2011-06-20 19:42:28 +08:00
|
|
|
info->status.ack_signal = zd_check_signal(hw, ackssi);
|
2008-05-15 18:55:29 +08:00
|
|
|
ieee80211_tx_status_irqsafe(hw, skb);
|
2006-11-22 08:06:48 +08:00
|
|
|
}
|
|
|
|
|
2007-11-19 23:00:29 +08:00
|
|
|
/**
|
|
|
|
* zd_mac_tx_failed - callback for failed frames
|
|
|
|
* @dev: the mac80211 wireless device
|
|
|
|
*
|
2009-12-12 05:35:37 +08:00
|
|
|
* This function is called if a frame couldn't be successfully
|
2007-11-19 23:00:29 +08:00
|
|
|
* transferred. The first frame from the tx queue, will be selected and
|
|
|
|
* reported as error to the upper layers.
|
|
|
|
*/
|
2009-10-22 18:04:52 +08:00
|
|
|
void zd_mac_tx_failed(struct urb *urb)
|
2006-11-22 08:06:48 +08:00
|
|
|
{
|
2009-10-22 18:04:52 +08:00
|
|
|
struct ieee80211_hw * hw = zd_usb_to_hw(urb->context);
|
|
|
|
struct zd_mac *mac = zd_hw_mac(hw);
|
|
|
|
struct sk_buff_head *q = &mac->ack_wait_queue;
|
2007-11-19 23:00:29 +08:00
|
|
|
struct sk_buff *skb;
|
2009-10-22 18:04:52 +08:00
|
|
|
struct tx_status *tx_status = (struct tx_status *)urb->transfer_buffer;
|
|
|
|
unsigned long flags;
|
|
|
|
int success = !tx_status->failure;
|
|
|
|
int retry = tx_status->retry + success;
|
|
|
|
int found = 0;
|
|
|
|
int i, position = 0;
|
2006-11-22 08:06:48 +08:00
|
|
|
|
2009-10-22 18:04:52 +08:00
|
|
|
q = &mac->ack_wait_queue;
|
|
|
|
spin_lock_irqsave(&q->lock, flags);
|
|
|
|
|
|
|
|
skb_queue_walk(q, skb) {
|
|
|
|
struct ieee80211_hdr *tx_hdr;
|
|
|
|
struct ieee80211_tx_info *info;
|
|
|
|
int first_idx, final_idx;
|
|
|
|
const struct tx_retry_rate *retries;
|
|
|
|
u8 final_rate;
|
|
|
|
|
|
|
|
position ++;
|
|
|
|
|
|
|
|
/* if the hardware reports a failure and we had a 802.11 ACK
|
|
|
|
* pending, then we skip the first skb when searching for a
|
|
|
|
* matching frame */
|
|
|
|
if (tx_status->failure && mac->ack_pending &&
|
|
|
|
skb_queue_is_first(q, skb)) {
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
|
|
|
tx_hdr = (struct ieee80211_hdr *)skb->data;
|
|
|
|
|
|
|
|
/* we skip all frames not matching the reported destination */
|
|
|
|
if (unlikely(memcmp(tx_hdr->addr1, tx_status->mac, ETH_ALEN))) {
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* we skip all frames not matching the reported final rate */
|
2008-02-20 19:09:25 +08:00
|
|
|
|
2009-10-22 18:04:52 +08:00
|
|
|
info = IEEE80211_SKB_CB(skb);
|
|
|
|
first_idx = info->status.rates[0].idx;
|
|
|
|
ZD_ASSERT(0<=first_idx && first_idx<ARRAY_SIZE(zd_retry_rates));
|
|
|
|
retries = &zd_retry_rates[first_idx];
|
2010-02-27 14:12:34 +08:00
|
|
|
if (retry <= 0 || retry > retries->count)
|
2009-10-22 18:04:52 +08:00
|
|
|
continue;
|
|
|
|
|
2010-02-27 14:12:34 +08:00
|
|
|
final_idx = retries->rate[retry - 1];
|
2009-10-22 18:04:52 +08:00
|
|
|
final_rate = zd_rates[final_idx].hw_value;
|
|
|
|
|
|
|
|
if (final_rate != tx_status->rate) {
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
|
|
|
found = 1;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (found) {
|
|
|
|
for (i=1; i<=position; i++) {
|
|
|
|
skb = __skb_dequeue(q);
|
|
|
|
zd_mac_tx_status(hw, skb,
|
|
|
|
mac->ack_pending ? mac->ack_signal : 0,
|
|
|
|
i == position ? tx_status : NULL);
|
|
|
|
mac->ack_pending = 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
spin_unlock_irqrestore(&q->lock, flags);
|
2006-11-22 08:06:48 +08:00
|
|
|
}
|
|
|
|
|
2007-11-19 23:00:29 +08:00
|
|
|
/**
|
|
|
|
* zd_mac_tx_to_dev - callback for USB layer
|
|
|
|
* @skb: a &sk_buff pointer
|
|
|
|
* @error: error value, 0 if transmission successful
|
|
|
|
*
|
|
|
|
* Informs the MAC layer that the frame has successfully transferred to the
|
|
|
|
* device. If an ACK is required and the transfer to the device has been
|
|
|
|
* successful, the packets are put on the @ack_wait_queue with
|
|
|
|
* the control set removed.
|
|
|
|
*/
|
|
|
|
void zd_mac_tx_to_dev(struct sk_buff *skb, int error)
|
|
|
|
{
|
2008-05-15 18:55:29 +08:00
|
|
|
struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb);
|
2008-10-21 18:40:02 +08:00
|
|
|
struct ieee80211_hw *hw = info->rate_driver_data[0];
|
2009-10-22 18:04:52 +08:00
|
|
|
struct zd_mac *mac = zd_hw_mac(hw);
|
|
|
|
|
|
|
|
ieee80211_tx_info_clear_status(info);
|
2006-11-22 08:06:48 +08:00
|
|
|
|
2008-05-15 18:55:29 +08:00
|
|
|
skb_pull(skb, sizeof(struct zd_ctrlset));
|
|
|
|
if (unlikely(error ||
|
|
|
|
(info->flags & IEEE80211_TX_CTL_NO_ACK))) {
|
2009-10-22 18:04:52 +08:00
|
|
|
/*
|
|
|
|
* FIXME : do we need to fill in anything ?
|
|
|
|
*/
|
|
|
|
ieee80211_tx_status_irqsafe(hw, skb);
|
2007-11-19 23:00:29 +08:00
|
|
|
} else {
|
2009-10-22 18:04:52 +08:00
|
|
|
struct sk_buff_head *q = &mac->ack_wait_queue;
|
2008-05-15 18:55:29 +08:00
|
|
|
|
|
|
|
skb_queue_tail(q, skb);
|
2009-10-22 18:04:52 +08:00
|
|
|
while (skb_queue_len(q) > ZD_MAC_MAX_ACK_WAITERS) {
|
|
|
|
zd_mac_tx_status(hw, skb_dequeue(q),
|
|
|
|
mac->ack_pending ? mac->ack_signal : 0,
|
|
|
|
NULL);
|
|
|
|
mac->ack_pending = 0;
|
|
|
|
}
|
[PATCH] ZyDAS ZD1211 USB-WLAN driver
There are 60+ USB wifi adapters available on the market based on the ZyDAS
ZD1211 chip.
Unlike the predecessor (ZD1201), ZD1211 does not have a hardware MAC, so most
data operations are coordinated by the device driver. The ZD1211 chip sits
alongside an RF transceiver which is also controlled by the driver. Our driver
currently supports 2 RF types, we know of one other available in a few marketed
products which we will be supporting soon.
Our driver also supports the newer revision of ZD1211, called ZD1211B. The
initialization and RF operations are slightly different for the new revision,
but the main difference is 802.11e support. Our driver does not support the
QoS features yet, but we think we know how to use them.
This driver is based on ZyDAS's own GPL driver available from www.zydas.com.tw.
ZyDAS engineers have been responsive and supportive of our efforts, so thumbs
up to them. Additionally, the firmware is redistributable and they have
provided device specs.
This driver has been written primarily by Ulrich Kunitz and myself. Graham
Gower, Greg KH, Remco and Bryan Rittmeyer have also contributed. The
developers of ieee80211 and softmac have made our lives so much easier- thanks!
We maintain a small info-page: http://zd1211.ath.cx/wiki/DriverRewrite
If there is enough time for review, we would like to aim for inclusion in
2.6.18. The driver works nicely as a STA, and can connect to both open and
encrypted networks (we are using software-based encryption for now). We will
work towards supporting more advanced features in the future (ad-hoc, master
mode, 802.11a, ...).
Signed-off-by: Daniel Drake <dsd@gentoo.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2006-06-03 00:11:32 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2006-11-22 08:06:38 +08:00
|
|
|
static int zd_calc_tx_length_us(u8 *service, u8 zd_rate, u16 tx_length)
|
[PATCH] ZyDAS ZD1211 USB-WLAN driver
There are 60+ USB wifi adapters available on the market based on the ZyDAS
ZD1211 chip.
Unlike the predecessor (ZD1201), ZD1211 does not have a hardware MAC, so most
data operations are coordinated by the device driver. The ZD1211 chip sits
alongside an RF transceiver which is also controlled by the driver. Our driver
currently supports 2 RF types, we know of one other available in a few marketed
products which we will be supporting soon.
Our driver also supports the newer revision of ZD1211, called ZD1211B. The
initialization and RF operations are slightly different for the new revision,
but the main difference is 802.11e support. Our driver does not support the
QoS features yet, but we think we know how to use them.
This driver is based on ZyDAS's own GPL driver available from www.zydas.com.tw.
ZyDAS engineers have been responsive and supportive of our efforts, so thumbs
up to them. Additionally, the firmware is redistributable and they have
provided device specs.
This driver has been written primarily by Ulrich Kunitz and myself. Graham
Gower, Greg KH, Remco and Bryan Rittmeyer have also contributed. The
developers of ieee80211 and softmac have made our lives so much easier- thanks!
We maintain a small info-page: http://zd1211.ath.cx/wiki/DriverRewrite
If there is enough time for review, we would like to aim for inclusion in
2.6.18. The driver works nicely as a STA, and can connect to both open and
encrypted networks (we are using software-based encryption for now). We will
work towards supporting more advanced features in the future (ad-hoc, master
mode, 802.11a, ...).
Signed-off-by: Daniel Drake <dsd@gentoo.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2006-06-03 00:11:32 +08:00
|
|
|
{
|
2007-08-06 08:24:31 +08:00
|
|
|
/* ZD_PURE_RATE() must be used to remove the modulation type flag of
|
2007-11-19 23:00:29 +08:00
|
|
|
* the zd-rate values.
|
|
|
|
*/
|
[PATCH] ZyDAS ZD1211 USB-WLAN driver
There are 60+ USB wifi adapters available on the market based on the ZyDAS
ZD1211 chip.
Unlike the predecessor (ZD1201), ZD1211 does not have a hardware MAC, so most
data operations are coordinated by the device driver. The ZD1211 chip sits
alongside an RF transceiver which is also controlled by the driver. Our driver
currently supports 2 RF types, we know of one other available in a few marketed
products which we will be supporting soon.
Our driver also supports the newer revision of ZD1211, called ZD1211B. The
initialization and RF operations are slightly different for the new revision,
but the main difference is 802.11e support. Our driver does not support the
QoS features yet, but we think we know how to use them.
This driver is based on ZyDAS's own GPL driver available from www.zydas.com.tw.
ZyDAS engineers have been responsive and supportive of our efforts, so thumbs
up to them. Additionally, the firmware is redistributable and they have
provided device specs.
This driver has been written primarily by Ulrich Kunitz and myself. Graham
Gower, Greg KH, Remco and Bryan Rittmeyer have also contributed. The
developers of ieee80211 and softmac have made our lives so much easier- thanks!
We maintain a small info-page: http://zd1211.ath.cx/wiki/DriverRewrite
If there is enough time for review, we would like to aim for inclusion in
2.6.18. The driver works nicely as a STA, and can connect to both open and
encrypted networks (we are using software-based encryption for now). We will
work towards supporting more advanced features in the future (ad-hoc, master
mode, 802.11a, ...).
Signed-off-by: Daniel Drake <dsd@gentoo.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2006-06-03 00:11:32 +08:00
|
|
|
static const u8 rate_divisor[] = {
|
2007-11-19 23:00:29 +08:00
|
|
|
[ZD_PURE_RATE(ZD_CCK_RATE_1M)] = 1,
|
|
|
|
[ZD_PURE_RATE(ZD_CCK_RATE_2M)] = 2,
|
|
|
|
/* Bits must be doubled. */
|
|
|
|
[ZD_PURE_RATE(ZD_CCK_RATE_5_5M)] = 11,
|
|
|
|
[ZD_PURE_RATE(ZD_CCK_RATE_11M)] = 11,
|
|
|
|
[ZD_PURE_RATE(ZD_OFDM_RATE_6M)] = 6,
|
|
|
|
[ZD_PURE_RATE(ZD_OFDM_RATE_9M)] = 9,
|
|
|
|
[ZD_PURE_RATE(ZD_OFDM_RATE_12M)] = 12,
|
|
|
|
[ZD_PURE_RATE(ZD_OFDM_RATE_18M)] = 18,
|
|
|
|
[ZD_PURE_RATE(ZD_OFDM_RATE_24M)] = 24,
|
|
|
|
[ZD_PURE_RATE(ZD_OFDM_RATE_36M)] = 36,
|
|
|
|
[ZD_PURE_RATE(ZD_OFDM_RATE_48M)] = 48,
|
|
|
|
[ZD_PURE_RATE(ZD_OFDM_RATE_54M)] = 54,
|
[PATCH] ZyDAS ZD1211 USB-WLAN driver
There are 60+ USB wifi adapters available on the market based on the ZyDAS
ZD1211 chip.
Unlike the predecessor (ZD1201), ZD1211 does not have a hardware MAC, so most
data operations are coordinated by the device driver. The ZD1211 chip sits
alongside an RF transceiver which is also controlled by the driver. Our driver
currently supports 2 RF types, we know of one other available in a few marketed
products which we will be supporting soon.
Our driver also supports the newer revision of ZD1211, called ZD1211B. The
initialization and RF operations are slightly different for the new revision,
but the main difference is 802.11e support. Our driver does not support the
QoS features yet, but we think we know how to use them.
This driver is based on ZyDAS's own GPL driver available from www.zydas.com.tw.
ZyDAS engineers have been responsive and supportive of our efforts, so thumbs
up to them. Additionally, the firmware is redistributable and they have
provided device specs.
This driver has been written primarily by Ulrich Kunitz and myself. Graham
Gower, Greg KH, Remco and Bryan Rittmeyer have also contributed. The
developers of ieee80211 and softmac have made our lives so much easier- thanks!
We maintain a small info-page: http://zd1211.ath.cx/wiki/DriverRewrite
If there is enough time for review, we would like to aim for inclusion in
2.6.18. The driver works nicely as a STA, and can connect to both open and
encrypted networks (we are using software-based encryption for now). We will
work towards supporting more advanced features in the future (ad-hoc, master
mode, 802.11a, ...).
Signed-off-by: Daniel Drake <dsd@gentoo.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2006-06-03 00:11:32 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
u32 bits = (u32)tx_length * 8;
|
|
|
|
u32 divisor;
|
|
|
|
|
2007-08-06 08:24:31 +08:00
|
|
|
divisor = rate_divisor[ZD_PURE_RATE(zd_rate)];
|
[PATCH] ZyDAS ZD1211 USB-WLAN driver
There are 60+ USB wifi adapters available on the market based on the ZyDAS
ZD1211 chip.
Unlike the predecessor (ZD1201), ZD1211 does not have a hardware MAC, so most
data operations are coordinated by the device driver. The ZD1211 chip sits
alongside an RF transceiver which is also controlled by the driver. Our driver
currently supports 2 RF types, we know of one other available in a few marketed
products which we will be supporting soon.
Our driver also supports the newer revision of ZD1211, called ZD1211B. The
initialization and RF operations are slightly different for the new revision,
but the main difference is 802.11e support. Our driver does not support the
QoS features yet, but we think we know how to use them.
This driver is based on ZyDAS's own GPL driver available from www.zydas.com.tw.
ZyDAS engineers have been responsive and supportive of our efforts, so thumbs
up to them. Additionally, the firmware is redistributable and they have
provided device specs.
This driver has been written primarily by Ulrich Kunitz and myself. Graham
Gower, Greg KH, Remco and Bryan Rittmeyer have also contributed. The
developers of ieee80211 and softmac have made our lives so much easier- thanks!
We maintain a small info-page: http://zd1211.ath.cx/wiki/DriverRewrite
If there is enough time for review, we would like to aim for inclusion in
2.6.18. The driver works nicely as a STA, and can connect to both open and
encrypted networks (we are using software-based encryption for now). We will
work towards supporting more advanced features in the future (ad-hoc, master
mode, 802.11a, ...).
Signed-off-by: Daniel Drake <dsd@gentoo.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2006-06-03 00:11:32 +08:00
|
|
|
if (divisor == 0)
|
|
|
|
return -EINVAL;
|
|
|
|
|
2006-11-22 08:06:38 +08:00
|
|
|
switch (zd_rate) {
|
|
|
|
case ZD_CCK_RATE_5_5M:
|
[PATCH] ZyDAS ZD1211 USB-WLAN driver
There are 60+ USB wifi adapters available on the market based on the ZyDAS
ZD1211 chip.
Unlike the predecessor (ZD1201), ZD1211 does not have a hardware MAC, so most
data operations are coordinated by the device driver. The ZD1211 chip sits
alongside an RF transceiver which is also controlled by the driver. Our driver
currently supports 2 RF types, we know of one other available in a few marketed
products which we will be supporting soon.
Our driver also supports the newer revision of ZD1211, called ZD1211B. The
initialization and RF operations are slightly different for the new revision,
but the main difference is 802.11e support. Our driver does not support the
QoS features yet, but we think we know how to use them.
This driver is based on ZyDAS's own GPL driver available from www.zydas.com.tw.
ZyDAS engineers have been responsive and supportive of our efforts, so thumbs
up to them. Additionally, the firmware is redistributable and they have
provided device specs.
This driver has been written primarily by Ulrich Kunitz and myself. Graham
Gower, Greg KH, Remco and Bryan Rittmeyer have also contributed. The
developers of ieee80211 and softmac have made our lives so much easier- thanks!
We maintain a small info-page: http://zd1211.ath.cx/wiki/DriverRewrite
If there is enough time for review, we would like to aim for inclusion in
2.6.18. The driver works nicely as a STA, and can connect to both open and
encrypted networks (we are using software-based encryption for now). We will
work towards supporting more advanced features in the future (ad-hoc, master
mode, 802.11a, ...).
Signed-off-by: Daniel Drake <dsd@gentoo.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2006-06-03 00:11:32 +08:00
|
|
|
bits = (2*bits) + 10; /* round up to the next integer */
|
|
|
|
break;
|
2006-11-22 08:06:38 +08:00
|
|
|
case ZD_CCK_RATE_11M:
|
[PATCH] ZyDAS ZD1211 USB-WLAN driver
There are 60+ USB wifi adapters available on the market based on the ZyDAS
ZD1211 chip.
Unlike the predecessor (ZD1201), ZD1211 does not have a hardware MAC, so most
data operations are coordinated by the device driver. The ZD1211 chip sits
alongside an RF transceiver which is also controlled by the driver. Our driver
currently supports 2 RF types, we know of one other available in a few marketed
products which we will be supporting soon.
Our driver also supports the newer revision of ZD1211, called ZD1211B. The
initialization and RF operations are slightly different for the new revision,
but the main difference is 802.11e support. Our driver does not support the
QoS features yet, but we think we know how to use them.
This driver is based on ZyDAS's own GPL driver available from www.zydas.com.tw.
ZyDAS engineers have been responsive and supportive of our efforts, so thumbs
up to them. Additionally, the firmware is redistributable and they have
provided device specs.
This driver has been written primarily by Ulrich Kunitz and myself. Graham
Gower, Greg KH, Remco and Bryan Rittmeyer have also contributed. The
developers of ieee80211 and softmac have made our lives so much easier- thanks!
We maintain a small info-page: http://zd1211.ath.cx/wiki/DriverRewrite
If there is enough time for review, we would like to aim for inclusion in
2.6.18. The driver works nicely as a STA, and can connect to both open and
encrypted networks (we are using software-based encryption for now). We will
work towards supporting more advanced features in the future (ad-hoc, master
mode, 802.11a, ...).
Signed-off-by: Daniel Drake <dsd@gentoo.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2006-06-03 00:11:32 +08:00
|
|
|
if (service) {
|
|
|
|
u32 t = bits % 11;
|
|
|
|
*service &= ~ZD_PLCP_SERVICE_LENGTH_EXTENSION;
|
|
|
|
if (0 < t && t <= 3) {
|
|
|
|
*service |= ZD_PLCP_SERVICE_LENGTH_EXTENSION;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
bits += 10; /* round up to the next integer */
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
return bits/divisor;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void cs_set_control(struct zd_mac *mac, struct zd_ctrlset *cs,
|
2008-10-21 18:40:02 +08:00
|
|
|
struct ieee80211_hdr *header,
|
|
|
|
struct ieee80211_tx_info *info)
|
[PATCH] ZyDAS ZD1211 USB-WLAN driver
There are 60+ USB wifi adapters available on the market based on the ZyDAS
ZD1211 chip.
Unlike the predecessor (ZD1201), ZD1211 does not have a hardware MAC, so most
data operations are coordinated by the device driver. The ZD1211 chip sits
alongside an RF transceiver which is also controlled by the driver. Our driver
currently supports 2 RF types, we know of one other available in a few marketed
products which we will be supporting soon.
Our driver also supports the newer revision of ZD1211, called ZD1211B. The
initialization and RF operations are slightly different for the new revision,
but the main difference is 802.11e support. Our driver does not support the
QoS features yet, but we think we know how to use them.
This driver is based on ZyDAS's own GPL driver available from www.zydas.com.tw.
ZyDAS engineers have been responsive and supportive of our efforts, so thumbs
up to them. Additionally, the firmware is redistributable and they have
provided device specs.
This driver has been written primarily by Ulrich Kunitz and myself. Graham
Gower, Greg KH, Remco and Bryan Rittmeyer have also contributed. The
developers of ieee80211 and softmac have made our lives so much easier- thanks!
We maintain a small info-page: http://zd1211.ath.cx/wiki/DriverRewrite
If there is enough time for review, we would like to aim for inclusion in
2.6.18. The driver works nicely as a STA, and can connect to both open and
encrypted networks (we are using software-based encryption for now). We will
work towards supporting more advanced features in the future (ad-hoc, master
mode, 802.11a, ...).
Signed-off-by: Daniel Drake <dsd@gentoo.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2006-06-03 00:11:32 +08:00
|
|
|
{
|
|
|
|
/*
|
2006-11-22 08:06:48 +08:00
|
|
|
* CONTROL TODO:
|
[PATCH] ZyDAS ZD1211 USB-WLAN driver
There are 60+ USB wifi adapters available on the market based on the ZyDAS
ZD1211 chip.
Unlike the predecessor (ZD1201), ZD1211 does not have a hardware MAC, so most
data operations are coordinated by the device driver. The ZD1211 chip sits
alongside an RF transceiver which is also controlled by the driver. Our driver
currently supports 2 RF types, we know of one other available in a few marketed
products which we will be supporting soon.
Our driver also supports the newer revision of ZD1211, called ZD1211B. The
initialization and RF operations are slightly different for the new revision,
but the main difference is 802.11e support. Our driver does not support the
QoS features yet, but we think we know how to use them.
This driver is based on ZyDAS's own GPL driver available from www.zydas.com.tw.
ZyDAS engineers have been responsive and supportive of our efforts, so thumbs
up to them. Additionally, the firmware is redistributable and they have
provided device specs.
This driver has been written primarily by Ulrich Kunitz and myself. Graham
Gower, Greg KH, Remco and Bryan Rittmeyer have also contributed. The
developers of ieee80211 and softmac have made our lives so much easier- thanks!
We maintain a small info-page: http://zd1211.ath.cx/wiki/DriverRewrite
If there is enough time for review, we would like to aim for inclusion in
2.6.18. The driver works nicely as a STA, and can connect to both open and
encrypted networks (we are using software-based encryption for now). We will
work towards supporting more advanced features in the future (ad-hoc, master
mode, 802.11a, ...).
Signed-off-by: Daniel Drake <dsd@gentoo.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2006-06-03 00:11:32 +08:00
|
|
|
* - if backoff needed, enable bit 0
|
|
|
|
* - if burst (backoff not needed) disable bit 0
|
|
|
|
*/
|
|
|
|
|
|
|
|
cs->control = 0;
|
|
|
|
|
|
|
|
/* First fragment */
|
2008-10-21 18:40:02 +08:00
|
|
|
if (info->flags & IEEE80211_TX_CTL_FIRST_FRAGMENT)
|
[PATCH] ZyDAS ZD1211 USB-WLAN driver
There are 60+ USB wifi adapters available on the market based on the ZyDAS
ZD1211 chip.
Unlike the predecessor (ZD1201), ZD1211 does not have a hardware MAC, so most
data operations are coordinated by the device driver. The ZD1211 chip sits
alongside an RF transceiver which is also controlled by the driver. Our driver
currently supports 2 RF types, we know of one other available in a few marketed
products which we will be supporting soon.
Our driver also supports the newer revision of ZD1211, called ZD1211B. The
initialization and RF operations are slightly different for the new revision,
but the main difference is 802.11e support. Our driver does not support the
QoS features yet, but we think we know how to use them.
This driver is based on ZyDAS's own GPL driver available from www.zydas.com.tw.
ZyDAS engineers have been responsive and supportive of our efforts, so thumbs
up to them. Additionally, the firmware is redistributable and they have
provided device specs.
This driver has been written primarily by Ulrich Kunitz and myself. Graham
Gower, Greg KH, Remco and Bryan Rittmeyer have also contributed. The
developers of ieee80211 and softmac have made our lives so much easier- thanks!
We maintain a small info-page: http://zd1211.ath.cx/wiki/DriverRewrite
If there is enough time for review, we would like to aim for inclusion in
2.6.18. The driver works nicely as a STA, and can connect to both open and
encrypted networks (we are using software-based encryption for now). We will
work towards supporting more advanced features in the future (ad-hoc, master
mode, 802.11a, ...).
Signed-off-by: Daniel Drake <dsd@gentoo.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2006-06-03 00:11:32 +08:00
|
|
|
cs->control |= ZD_CS_NEED_RANDOM_BACKOFF;
|
|
|
|
|
2009-05-15 01:34:59 +08:00
|
|
|
/* No ACK expected (multicast, etc.) */
|
|
|
|
if (info->flags & IEEE80211_TX_CTL_NO_ACK)
|
|
|
|
cs->control |= ZD_CS_NO_ACK;
|
[PATCH] ZyDAS ZD1211 USB-WLAN driver
There are 60+ USB wifi adapters available on the market based on the ZyDAS
ZD1211 chip.
Unlike the predecessor (ZD1201), ZD1211 does not have a hardware MAC, so most
data operations are coordinated by the device driver. The ZD1211 chip sits
alongside an RF transceiver which is also controlled by the driver. Our driver
currently supports 2 RF types, we know of one other available in a few marketed
products which we will be supporting soon.
Our driver also supports the newer revision of ZD1211, called ZD1211B. The
initialization and RF operations are slightly different for the new revision,
but the main difference is 802.11e support. Our driver does not support the
QoS features yet, but we think we know how to use them.
This driver is based on ZyDAS's own GPL driver available from www.zydas.com.tw.
ZyDAS engineers have been responsive and supportive of our efforts, so thumbs
up to them. Additionally, the firmware is redistributable and they have
provided device specs.
This driver has been written primarily by Ulrich Kunitz and myself. Graham
Gower, Greg KH, Remco and Bryan Rittmeyer have also contributed. The
developers of ieee80211 and softmac have made our lives so much easier- thanks!
We maintain a small info-page: http://zd1211.ath.cx/wiki/DriverRewrite
If there is enough time for review, we would like to aim for inclusion in
2.6.18. The driver works nicely as a STA, and can connect to both open and
encrypted networks (we are using software-based encryption for now). We will
work towards supporting more advanced features in the future (ad-hoc, master
mode, 802.11a, ...).
Signed-off-by: Daniel Drake <dsd@gentoo.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2006-06-03 00:11:32 +08:00
|
|
|
|
|
|
|
/* PS-POLL */
|
2008-06-15 14:33:39 +08:00
|
|
|
if (ieee80211_is_pspoll(header->frame_control))
|
[PATCH] ZyDAS ZD1211 USB-WLAN driver
There are 60+ USB wifi adapters available on the market based on the ZyDAS
ZD1211 chip.
Unlike the predecessor (ZD1201), ZD1211 does not have a hardware MAC, so most
data operations are coordinated by the device driver. The ZD1211 chip sits
alongside an RF transceiver which is also controlled by the driver. Our driver
currently supports 2 RF types, we know of one other available in a few marketed
products which we will be supporting soon.
Our driver also supports the newer revision of ZD1211, called ZD1211B. The
initialization and RF operations are slightly different for the new revision,
but the main difference is 802.11e support. Our driver does not support the
QoS features yet, but we think we know how to use them.
This driver is based on ZyDAS's own GPL driver available from www.zydas.com.tw.
ZyDAS engineers have been responsive and supportive of our efforts, so thumbs
up to them. Additionally, the firmware is redistributable and they have
provided device specs.
This driver has been written primarily by Ulrich Kunitz and myself. Graham
Gower, Greg KH, Remco and Bryan Rittmeyer have also contributed. The
developers of ieee80211 and softmac have made our lives so much easier- thanks!
We maintain a small info-page: http://zd1211.ath.cx/wiki/DriverRewrite
If there is enough time for review, we would like to aim for inclusion in
2.6.18. The driver works nicely as a STA, and can connect to both open and
encrypted networks (we are using software-based encryption for now). We will
work towards supporting more advanced features in the future (ad-hoc, master
mode, 802.11a, ...).
Signed-off-by: Daniel Drake <dsd@gentoo.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2006-06-03 00:11:32 +08:00
|
|
|
cs->control |= ZD_CS_PS_POLL_FRAME;
|
|
|
|
|
2008-10-21 18:40:02 +08:00
|
|
|
if (info->control.rates[0].flags & IEEE80211_TX_RC_USE_RTS_CTS)
|
2006-11-22 08:06:48 +08:00
|
|
|
cs->control |= ZD_CS_RTS;
|
|
|
|
|
2008-10-21 18:40:02 +08:00
|
|
|
if (info->control.rates[0].flags & IEEE80211_TX_RC_USE_CTS_PROTECT)
|
2006-11-22 08:06:48 +08:00
|
|
|
cs->control |= ZD_CS_SELF_CTS;
|
[PATCH] ZyDAS ZD1211 USB-WLAN driver
There are 60+ USB wifi adapters available on the market based on the ZyDAS
ZD1211 chip.
Unlike the predecessor (ZD1201), ZD1211 does not have a hardware MAC, so most
data operations are coordinated by the device driver. The ZD1211 chip sits
alongside an RF transceiver which is also controlled by the driver. Our driver
currently supports 2 RF types, we know of one other available in a few marketed
products which we will be supporting soon.
Our driver also supports the newer revision of ZD1211, called ZD1211B. The
initialization and RF operations are slightly different for the new revision,
but the main difference is 802.11e support. Our driver does not support the
QoS features yet, but we think we know how to use them.
This driver is based on ZyDAS's own GPL driver available from www.zydas.com.tw.
ZyDAS engineers have been responsive and supportive of our efforts, so thumbs
up to them. Additionally, the firmware is redistributable and they have
provided device specs.
This driver has been written primarily by Ulrich Kunitz and myself. Graham
Gower, Greg KH, Remco and Bryan Rittmeyer have also contributed. The
developers of ieee80211 and softmac have made our lives so much easier- thanks!
We maintain a small info-page: http://zd1211.ath.cx/wiki/DriverRewrite
If there is enough time for review, we would like to aim for inclusion in
2.6.18. The driver works nicely as a STA, and can connect to both open and
encrypted networks (we are using software-based encryption for now). We will
work towards supporting more advanced features in the future (ad-hoc, master
mode, 802.11a, ...).
Signed-off-by: Daniel Drake <dsd@gentoo.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2006-06-03 00:11:32 +08:00
|
|
|
|
|
|
|
/* FIXME: Management frame? */
|
|
|
|
}
|
|
|
|
|
2011-06-20 19:42:39 +08:00
|
|
|
static bool zd_mac_match_cur_beacon(struct zd_mac *mac, struct sk_buff *beacon)
|
|
|
|
{
|
|
|
|
if (!mac->beacon.cur_beacon)
|
|
|
|
return false;
|
|
|
|
|
|
|
|
if (mac->beacon.cur_beacon->len != beacon->len)
|
|
|
|
return false;
|
|
|
|
|
|
|
|
return !memcmp(beacon->data, mac->beacon.cur_beacon->data, beacon->len);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void zd_mac_free_cur_beacon_locked(struct zd_mac *mac)
|
|
|
|
{
|
|
|
|
ZD_ASSERT(mutex_is_locked(&mac->chip.mutex));
|
|
|
|
|
|
|
|
kfree_skb(mac->beacon.cur_beacon);
|
|
|
|
mac->beacon.cur_beacon = NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void zd_mac_free_cur_beacon(struct zd_mac *mac)
|
|
|
|
{
|
|
|
|
mutex_lock(&mac->chip.mutex);
|
|
|
|
zd_mac_free_cur_beacon_locked(mac);
|
|
|
|
mutex_unlock(&mac->chip.mutex);
|
|
|
|
}
|
|
|
|
|
2011-06-20 19:42:49 +08:00
|
|
|
static int zd_mac_config_beacon(struct ieee80211_hw *hw, struct sk_buff *beacon,
|
|
|
|
bool in_intr)
|
2008-03-04 04:32:15 +08:00
|
|
|
{
|
|
|
|
struct zd_mac *mac = zd_hw_mac(hw);
|
2011-02-01 02:49:05 +08:00
|
|
|
int r, ret, num_cmds, req_pos = 0;
|
2008-03-04 04:32:15 +08:00
|
|
|
u32 tmp, j = 0;
|
|
|
|
/* 4 more bytes for tail CRC */
|
|
|
|
u32 full_len = beacon->len + 4;
|
2011-02-01 02:48:55 +08:00
|
|
|
unsigned long end_jiffies, message_jiffies;
|
2011-02-01 02:49:05 +08:00
|
|
|
struct zd_ioreq32 *ioreqs;
|
|
|
|
|
2011-06-20 19:42:39 +08:00
|
|
|
mutex_lock(&mac->chip.mutex);
|
|
|
|
|
|
|
|
/* Check if hw already has this beacon. */
|
|
|
|
if (zd_mac_match_cur_beacon(mac, beacon)) {
|
|
|
|
r = 0;
|
|
|
|
goto out_nofree;
|
|
|
|
}
|
|
|
|
|
2011-02-01 02:49:05 +08:00
|
|
|
/* Alloc memory for full beacon write at once. */
|
|
|
|
num_cmds = 1 + zd_chip_is_zd1211b(&mac->chip) + full_len;
|
|
|
|
ioreqs = kmalloc(num_cmds * sizeof(struct zd_ioreq32), GFP_KERNEL);
|
2011-06-20 19:42:39 +08:00
|
|
|
if (!ioreqs) {
|
|
|
|
r = -ENOMEM;
|
|
|
|
goto out_nofree;
|
|
|
|
}
|
2008-07-04 11:30:49 +08:00
|
|
|
|
2011-02-01 02:48:55 +08:00
|
|
|
r = zd_iowrite32_locked(&mac->chip, 0, CR_BCN_FIFO_SEMAPHORE);
|
2008-07-04 11:30:49 +08:00
|
|
|
if (r < 0)
|
2011-02-01 02:48:55 +08:00
|
|
|
goto out;
|
|
|
|
r = zd_ioread32_locked(&mac->chip, &tmp, CR_BCN_FIFO_SEMAPHORE);
|
2008-07-04 11:30:49 +08:00
|
|
|
if (r < 0)
|
2011-02-01 02:48:55 +08:00
|
|
|
goto release_sema;
|
2011-06-20 19:42:49 +08:00
|
|
|
if (in_intr && tmp & 0x2) {
|
|
|
|
r = -EBUSY;
|
|
|
|
goto release_sema;
|
|
|
|
}
|
2008-07-04 11:30:49 +08:00
|
|
|
|
2011-02-01 02:48:55 +08:00
|
|
|
end_jiffies = jiffies + HZ / 2; /*~500ms*/
|
|
|
|
message_jiffies = jiffies + HZ / 10; /*~100ms*/
|
2008-03-04 04:32:15 +08:00
|
|
|
while (tmp & 0x2) {
|
2011-02-01 02:48:55 +08:00
|
|
|
r = zd_ioread32_locked(&mac->chip, &tmp, CR_BCN_FIFO_SEMAPHORE);
|
2008-07-04 11:30:49 +08:00
|
|
|
if (r < 0)
|
2011-02-01 02:48:55 +08:00
|
|
|
goto release_sema;
|
|
|
|
if (time_is_before_eq_jiffies(message_jiffies)) {
|
|
|
|
message_jiffies = jiffies + HZ / 10;
|
|
|
|
dev_err(zd_mac_dev(mac),
|
|
|
|
"CR_BCN_FIFO_SEMAPHORE not ready\n");
|
|
|
|
if (time_is_before_eq_jiffies(end_jiffies)) {
|
|
|
|
dev_err(zd_mac_dev(mac),
|
|
|
|
"Giving up beacon config.\n");
|
|
|
|
r = -ETIMEDOUT;
|
2011-02-01 02:50:02 +08:00
|
|
|
goto reset_device;
|
2008-03-04 04:32:15 +08:00
|
|
|
}
|
|
|
|
}
|
2011-02-01 02:48:55 +08:00
|
|
|
msleep(20);
|
2008-03-04 04:32:15 +08:00
|
|
|
}
|
|
|
|
|
2011-02-01 02:49:05 +08:00
|
|
|
ioreqs[req_pos].addr = CR_BCN_FIFO;
|
|
|
|
ioreqs[req_pos].value = full_len - 1;
|
|
|
|
req_pos++;
|
2008-07-04 11:30:49 +08:00
|
|
|
if (zd_chip_is_zd1211b(&mac->chip)) {
|
2011-02-01 02:49:05 +08:00
|
|
|
ioreqs[req_pos].addr = CR_BCN_LENGTH;
|
|
|
|
ioreqs[req_pos].value = full_len - 1;
|
|
|
|
req_pos++;
|
2008-07-04 11:30:49 +08:00
|
|
|
}
|
2008-03-04 04:32:15 +08:00
|
|
|
|
2008-07-04 11:30:49 +08:00
|
|
|
for (j = 0 ; j < beacon->len; j++) {
|
2011-02-01 02:49:05 +08:00
|
|
|
ioreqs[req_pos].addr = CR_BCN_FIFO;
|
|
|
|
ioreqs[req_pos].value = *((u8 *)(beacon->data + j));
|
|
|
|
req_pos++;
|
2008-07-04 11:30:49 +08:00
|
|
|
}
|
2008-03-04 04:32:15 +08:00
|
|
|
|
2008-07-04 11:30:49 +08:00
|
|
|
for (j = 0; j < 4; j++) {
|
2011-02-01 02:49:05 +08:00
|
|
|
ioreqs[req_pos].addr = CR_BCN_FIFO;
|
|
|
|
ioreqs[req_pos].value = 0x0;
|
|
|
|
req_pos++;
|
2008-07-04 11:30:49 +08:00
|
|
|
}
|
|
|
|
|
2011-02-01 02:49:05 +08:00
|
|
|
BUG_ON(req_pos != num_cmds);
|
|
|
|
|
|
|
|
r = zd_iowrite32a_locked(&mac->chip, ioreqs, num_cmds);
|
|
|
|
|
2011-02-01 02:48:55 +08:00
|
|
|
release_sema:
|
|
|
|
/*
|
|
|
|
* Try very hard to release device beacon semaphore, as otherwise
|
|
|
|
* device/driver can be left in unusable state.
|
|
|
|
*/
|
|
|
|
end_jiffies = jiffies + HZ / 2; /*~500ms*/
|
|
|
|
ret = zd_iowrite32_locked(&mac->chip, 1, CR_BCN_FIFO_SEMAPHORE);
|
|
|
|
while (ret < 0) {
|
2011-06-20 19:42:49 +08:00
|
|
|
if (in_intr || time_is_before_eq_jiffies(end_jiffies)) {
|
2011-02-01 02:48:55 +08:00
|
|
|
ret = -ETIMEDOUT;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
msleep(20);
|
|
|
|
ret = zd_iowrite32_locked(&mac->chip, 1, CR_BCN_FIFO_SEMAPHORE);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (ret < 0)
|
|
|
|
dev_err(zd_mac_dev(mac), "Could not release "
|
|
|
|
"CR_BCN_FIFO_SEMAPHORE!\n");
|
|
|
|
if (r < 0 || ret < 0) {
|
|
|
|
if (r >= 0)
|
|
|
|
r = ret;
|
2011-06-20 19:42:39 +08:00
|
|
|
|
|
|
|
/* We don't know if beacon was written successfully or not,
|
|
|
|
* so clear current. */
|
|
|
|
zd_mac_free_cur_beacon_locked(mac);
|
|
|
|
|
2011-02-01 02:48:55 +08:00
|
|
|
goto out;
|
|
|
|
}
|
2008-03-04 04:32:15 +08:00
|
|
|
|
2011-06-20 19:42:39 +08:00
|
|
|
/* Beacon has now been written successfully, update current. */
|
|
|
|
zd_mac_free_cur_beacon_locked(mac);
|
|
|
|
mac->beacon.cur_beacon = beacon;
|
|
|
|
beacon = NULL;
|
|
|
|
|
2008-03-04 04:32:15 +08:00
|
|
|
/* 802.11b/g 2.4G CCK 1Mb
|
|
|
|
* 802.11a, not yet implemented, uses different values (see GPL vendor
|
|
|
|
* driver)
|
|
|
|
*/
|
2011-02-01 02:48:55 +08:00
|
|
|
r = zd_iowrite32_locked(&mac->chip, 0x00000400 | (full_len << 19),
|
|
|
|
CR_BCN_PLCP_CFG);
|
|
|
|
out:
|
2011-02-01 02:49:05 +08:00
|
|
|
kfree(ioreqs);
|
2011-06-20 19:42:39 +08:00
|
|
|
out_nofree:
|
|
|
|
kfree_skb(beacon);
|
|
|
|
mutex_unlock(&mac->chip.mutex);
|
|
|
|
|
2011-02-01 02:48:55 +08:00
|
|
|
return r;
|
2011-02-01 02:50:02 +08:00
|
|
|
|
|
|
|
reset_device:
|
2011-06-20 19:42:39 +08:00
|
|
|
zd_mac_free_cur_beacon_locked(mac);
|
|
|
|
kfree_skb(beacon);
|
|
|
|
|
2011-02-01 02:50:02 +08:00
|
|
|
mutex_unlock(&mac->chip.mutex);
|
|
|
|
kfree(ioreqs);
|
|
|
|
|
|
|
|
/* semaphore stuck, reset device to avoid fw freeze later */
|
|
|
|
dev_warn(zd_mac_dev(mac), "CR_BCN_FIFO_SEMAPHORE stuck, "
|
|
|
|
"reseting device...");
|
|
|
|
usb_queue_reset_device(mac->chip.usb.intf);
|
|
|
|
|
|
|
|
return r;
|
2008-03-04 04:32:15 +08:00
|
|
|
}
|
|
|
|
|
[PATCH] ZyDAS ZD1211 USB-WLAN driver
There are 60+ USB wifi adapters available on the market based on the ZyDAS
ZD1211 chip.
Unlike the predecessor (ZD1201), ZD1211 does not have a hardware MAC, so most
data operations are coordinated by the device driver. The ZD1211 chip sits
alongside an RF transceiver which is also controlled by the driver. Our driver
currently supports 2 RF types, we know of one other available in a few marketed
products which we will be supporting soon.
Our driver also supports the newer revision of ZD1211, called ZD1211B. The
initialization and RF operations are slightly different for the new revision,
but the main difference is 802.11e support. Our driver does not support the
QoS features yet, but we think we know how to use them.
This driver is based on ZyDAS's own GPL driver available from www.zydas.com.tw.
ZyDAS engineers have been responsive and supportive of our efforts, so thumbs
up to them. Additionally, the firmware is redistributable and they have
provided device specs.
This driver has been written primarily by Ulrich Kunitz and myself. Graham
Gower, Greg KH, Remco and Bryan Rittmeyer have also contributed. The
developers of ieee80211 and softmac have made our lives so much easier- thanks!
We maintain a small info-page: http://zd1211.ath.cx/wiki/DriverRewrite
If there is enough time for review, we would like to aim for inclusion in
2.6.18. The driver works nicely as a STA, and can connect to both open and
encrypted networks (we are using software-based encryption for now). We will
work towards supporting more advanced features in the future (ad-hoc, master
mode, 802.11a, ...).
Signed-off-by: Daniel Drake <dsd@gentoo.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2006-06-03 00:11:32 +08:00
|
|
|
static int fill_ctrlset(struct zd_mac *mac,
|
2008-05-15 18:55:29 +08:00
|
|
|
struct sk_buff *skb)
|
[PATCH] ZyDAS ZD1211 USB-WLAN driver
There are 60+ USB wifi adapters available on the market based on the ZyDAS
ZD1211 chip.
Unlike the predecessor (ZD1201), ZD1211 does not have a hardware MAC, so most
data operations are coordinated by the device driver. The ZD1211 chip sits
alongside an RF transceiver which is also controlled by the driver. Our driver
currently supports 2 RF types, we know of one other available in a few marketed
products which we will be supporting soon.
Our driver also supports the newer revision of ZD1211, called ZD1211B. The
initialization and RF operations are slightly different for the new revision,
but the main difference is 802.11e support. Our driver does not support the
QoS features yet, but we think we know how to use them.
This driver is based on ZyDAS's own GPL driver available from www.zydas.com.tw.
ZyDAS engineers have been responsive and supportive of our efforts, so thumbs
up to them. Additionally, the firmware is redistributable and they have
provided device specs.
This driver has been written primarily by Ulrich Kunitz and myself. Graham
Gower, Greg KH, Remco and Bryan Rittmeyer have also contributed. The
developers of ieee80211 and softmac have made our lives so much easier- thanks!
We maintain a small info-page: http://zd1211.ath.cx/wiki/DriverRewrite
If there is enough time for review, we would like to aim for inclusion in
2.6.18. The driver works nicely as a STA, and can connect to both open and
encrypted networks (we are using software-based encryption for now). We will
work towards supporting more advanced features in the future (ad-hoc, master
mode, 802.11a, ...).
Signed-off-by: Daniel Drake <dsd@gentoo.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2006-06-03 00:11:32 +08:00
|
|
|
{
|
|
|
|
int r;
|
2007-11-19 23:00:29 +08:00
|
|
|
struct ieee80211_hdr *hdr = (struct ieee80211_hdr *) skb->data;
|
|
|
|
unsigned int frag_len = skb->len + FCS_LEN;
|
[PATCH] ZyDAS ZD1211 USB-WLAN driver
There are 60+ USB wifi adapters available on the market based on the ZyDAS
ZD1211 chip.
Unlike the predecessor (ZD1201), ZD1211 does not have a hardware MAC, so most
data operations are coordinated by the device driver. The ZD1211 chip sits
alongside an RF transceiver which is also controlled by the driver. Our driver
currently supports 2 RF types, we know of one other available in a few marketed
products which we will be supporting soon.
Our driver also supports the newer revision of ZD1211, called ZD1211B. The
initialization and RF operations are slightly different for the new revision,
but the main difference is 802.11e support. Our driver does not support the
QoS features yet, but we think we know how to use them.
This driver is based on ZyDAS's own GPL driver available from www.zydas.com.tw.
ZyDAS engineers have been responsive and supportive of our efforts, so thumbs
up to them. Additionally, the firmware is redistributable and they have
provided device specs.
This driver has been written primarily by Ulrich Kunitz and myself. Graham
Gower, Greg KH, Remco and Bryan Rittmeyer have also contributed. The
developers of ieee80211 and softmac have made our lives so much easier- thanks!
We maintain a small info-page: http://zd1211.ath.cx/wiki/DriverRewrite
If there is enough time for review, we would like to aim for inclusion in
2.6.18. The driver works nicely as a STA, and can connect to both open and
encrypted networks (we are using software-based encryption for now). We will
work towards supporting more advanced features in the future (ad-hoc, master
mode, 802.11a, ...).
Signed-off-by: Daniel Drake <dsd@gentoo.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2006-06-03 00:11:32 +08:00
|
|
|
unsigned int packet_length;
|
2008-05-15 18:55:27 +08:00
|
|
|
struct ieee80211_rate *txrate;
|
[PATCH] ZyDAS ZD1211 USB-WLAN driver
There are 60+ USB wifi adapters available on the market based on the ZyDAS
ZD1211 chip.
Unlike the predecessor (ZD1201), ZD1211 does not have a hardware MAC, so most
data operations are coordinated by the device driver. The ZD1211 chip sits
alongside an RF transceiver which is also controlled by the driver. Our driver
currently supports 2 RF types, we know of one other available in a few marketed
products which we will be supporting soon.
Our driver also supports the newer revision of ZD1211, called ZD1211B. The
initialization and RF operations are slightly different for the new revision,
but the main difference is 802.11e support. Our driver does not support the
QoS features yet, but we think we know how to use them.
This driver is based on ZyDAS's own GPL driver available from www.zydas.com.tw.
ZyDAS engineers have been responsive and supportive of our efforts, so thumbs
up to them. Additionally, the firmware is redistributable and they have
provided device specs.
This driver has been written primarily by Ulrich Kunitz and myself. Graham
Gower, Greg KH, Remco and Bryan Rittmeyer have also contributed. The
developers of ieee80211 and softmac have made our lives so much easier- thanks!
We maintain a small info-page: http://zd1211.ath.cx/wiki/DriverRewrite
If there is enough time for review, we would like to aim for inclusion in
2.6.18. The driver works nicely as a STA, and can connect to both open and
encrypted networks (we are using software-based encryption for now). We will
work towards supporting more advanced features in the future (ad-hoc, master
mode, 802.11a, ...).
Signed-off-by: Daniel Drake <dsd@gentoo.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2006-06-03 00:11:32 +08:00
|
|
|
struct zd_ctrlset *cs = (struct zd_ctrlset *)
|
|
|
|
skb_push(skb, sizeof(struct zd_ctrlset));
|
2008-05-15 18:55:29 +08:00
|
|
|
struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb);
|
[PATCH] ZyDAS ZD1211 USB-WLAN driver
There are 60+ USB wifi adapters available on the market based on the ZyDAS
ZD1211 chip.
Unlike the predecessor (ZD1201), ZD1211 does not have a hardware MAC, so most
data operations are coordinated by the device driver. The ZD1211 chip sits
alongside an RF transceiver which is also controlled by the driver. Our driver
currently supports 2 RF types, we know of one other available in a few marketed
products which we will be supporting soon.
Our driver also supports the newer revision of ZD1211, called ZD1211B. The
initialization and RF operations are slightly different for the new revision,
but the main difference is 802.11e support. Our driver does not support the
QoS features yet, but we think we know how to use them.
This driver is based on ZyDAS's own GPL driver available from www.zydas.com.tw.
ZyDAS engineers have been responsive and supportive of our efforts, so thumbs
up to them. Additionally, the firmware is redistributable and they have
provided device specs.
This driver has been written primarily by Ulrich Kunitz and myself. Graham
Gower, Greg KH, Remco and Bryan Rittmeyer have also contributed. The
developers of ieee80211 and softmac have made our lives so much easier- thanks!
We maintain a small info-page: http://zd1211.ath.cx/wiki/DriverRewrite
If there is enough time for review, we would like to aim for inclusion in
2.6.18. The driver works nicely as a STA, and can connect to both open and
encrypted networks (we are using software-based encryption for now). We will
work towards supporting more advanced features in the future (ad-hoc, master
mode, 802.11a, ...).
Signed-off-by: Daniel Drake <dsd@gentoo.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2006-06-03 00:11:32 +08:00
|
|
|
|
|
|
|
ZD_ASSERT(frag_len <= 0xffff);
|
|
|
|
|
2012-02-05 21:51:53 +08:00
|
|
|
/*
|
|
|
|
* Firmware computes the duration itself (for all frames except PSPoll)
|
|
|
|
* and needs the field set to 0 at input, otherwise firmware messes up
|
|
|
|
* duration_id and sets bits 14 and 15 on.
|
|
|
|
*/
|
|
|
|
if (!ieee80211_is_pspoll(hdr->frame_control))
|
|
|
|
hdr->duration_id = 0;
|
|
|
|
|
2008-05-15 18:55:29 +08:00
|
|
|
txrate = ieee80211_get_tx_rate(mac->hw, info);
|
2008-05-15 18:55:27 +08:00
|
|
|
|
|
|
|
cs->modulation = txrate->hw_value;
|
2008-10-21 18:40:02 +08:00
|
|
|
if (info->control.rates[0].flags & IEEE80211_TX_RC_USE_SHORT_PREAMBLE)
|
2008-05-15 18:55:27 +08:00
|
|
|
cs->modulation = txrate->hw_value_short;
|
[PATCH] ZyDAS ZD1211 USB-WLAN driver
There are 60+ USB wifi adapters available on the market based on the ZyDAS
ZD1211 chip.
Unlike the predecessor (ZD1201), ZD1211 does not have a hardware MAC, so most
data operations are coordinated by the device driver. The ZD1211 chip sits
alongside an RF transceiver which is also controlled by the driver. Our driver
currently supports 2 RF types, we know of one other available in a few marketed
products which we will be supporting soon.
Our driver also supports the newer revision of ZD1211, called ZD1211B. The
initialization and RF operations are slightly different for the new revision,
but the main difference is 802.11e support. Our driver does not support the
QoS features yet, but we think we know how to use them.
This driver is based on ZyDAS's own GPL driver available from www.zydas.com.tw.
ZyDAS engineers have been responsive and supportive of our efforts, so thumbs
up to them. Additionally, the firmware is redistributable and they have
provided device specs.
This driver has been written primarily by Ulrich Kunitz and myself. Graham
Gower, Greg KH, Remco and Bryan Rittmeyer have also contributed. The
developers of ieee80211 and softmac have made our lives so much easier- thanks!
We maintain a small info-page: http://zd1211.ath.cx/wiki/DriverRewrite
If there is enough time for review, we would like to aim for inclusion in
2.6.18. The driver works nicely as a STA, and can connect to both open and
encrypted networks (we are using software-based encryption for now). We will
work towards supporting more advanced features in the future (ad-hoc, master
mode, 802.11a, ...).
Signed-off-by: Daniel Drake <dsd@gentoo.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2006-06-03 00:11:32 +08:00
|
|
|
|
|
|
|
cs->tx_length = cpu_to_le16(frag_len);
|
|
|
|
|
2008-10-21 18:40:02 +08:00
|
|
|
cs_set_control(mac, cs, hdr, info);
|
[PATCH] ZyDAS ZD1211 USB-WLAN driver
There are 60+ USB wifi adapters available on the market based on the ZyDAS
ZD1211 chip.
Unlike the predecessor (ZD1201), ZD1211 does not have a hardware MAC, so most
data operations are coordinated by the device driver. The ZD1211 chip sits
alongside an RF transceiver which is also controlled by the driver. Our driver
currently supports 2 RF types, we know of one other available in a few marketed
products which we will be supporting soon.
Our driver also supports the newer revision of ZD1211, called ZD1211B. The
initialization and RF operations are slightly different for the new revision,
but the main difference is 802.11e support. Our driver does not support the
QoS features yet, but we think we know how to use them.
This driver is based on ZyDAS's own GPL driver available from www.zydas.com.tw.
ZyDAS engineers have been responsive and supportive of our efforts, so thumbs
up to them. Additionally, the firmware is redistributable and they have
provided device specs.
This driver has been written primarily by Ulrich Kunitz and myself. Graham
Gower, Greg KH, Remco and Bryan Rittmeyer have also contributed. The
developers of ieee80211 and softmac have made our lives so much easier- thanks!
We maintain a small info-page: http://zd1211.ath.cx/wiki/DriverRewrite
If there is enough time for review, we would like to aim for inclusion in
2.6.18. The driver works nicely as a STA, and can connect to both open and
encrypted networks (we are using software-based encryption for now). We will
work towards supporting more advanced features in the future (ad-hoc, master
mode, 802.11a, ...).
Signed-off-by: Daniel Drake <dsd@gentoo.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2006-06-03 00:11:32 +08:00
|
|
|
|
|
|
|
packet_length = frag_len + sizeof(struct zd_ctrlset) + 10;
|
|
|
|
ZD_ASSERT(packet_length <= 0xffff);
|
|
|
|
/* ZD1211B: Computing the length difference this way, gives us
|
|
|
|
* flexibility to compute the packet length.
|
|
|
|
*/
|
2007-07-02 01:22:32 +08:00
|
|
|
cs->packet_length = cpu_to_le16(zd_chip_is_zd1211b(&mac->chip) ?
|
[PATCH] ZyDAS ZD1211 USB-WLAN driver
There are 60+ USB wifi adapters available on the market based on the ZyDAS
ZD1211 chip.
Unlike the predecessor (ZD1201), ZD1211 does not have a hardware MAC, so most
data operations are coordinated by the device driver. The ZD1211 chip sits
alongside an RF transceiver which is also controlled by the driver. Our driver
currently supports 2 RF types, we know of one other available in a few marketed
products which we will be supporting soon.
Our driver also supports the newer revision of ZD1211, called ZD1211B. The
initialization and RF operations are slightly different for the new revision,
but the main difference is 802.11e support. Our driver does not support the
QoS features yet, but we think we know how to use them.
This driver is based on ZyDAS's own GPL driver available from www.zydas.com.tw.
ZyDAS engineers have been responsive and supportive of our efforts, so thumbs
up to them. Additionally, the firmware is redistributable and they have
provided device specs.
This driver has been written primarily by Ulrich Kunitz and myself. Graham
Gower, Greg KH, Remco and Bryan Rittmeyer have also contributed. The
developers of ieee80211 and softmac have made our lives so much easier- thanks!
We maintain a small info-page: http://zd1211.ath.cx/wiki/DriverRewrite
If there is enough time for review, we would like to aim for inclusion in
2.6.18. The driver works nicely as a STA, and can connect to both open and
encrypted networks (we are using software-based encryption for now). We will
work towards supporting more advanced features in the future (ad-hoc, master
mode, 802.11a, ...).
Signed-off-by: Daniel Drake <dsd@gentoo.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2006-06-03 00:11:32 +08:00
|
|
|
packet_length - frag_len : packet_length);
|
|
|
|
|
|
|
|
/*
|
|
|
|
* CURRENT LENGTH:
|
|
|
|
* - transmit frame length in microseconds
|
|
|
|
* - seems to be derived from frame length
|
|
|
|
* - see Cal_Us_Service() in zdinlinef.h
|
|
|
|
* - if macp->bTxBurstEnable is enabled, then multiply by 4
|
|
|
|
* - bTxBurstEnable is never set in the vendor driver
|
|
|
|
*
|
|
|
|
* SERVICE:
|
|
|
|
* - "for PLCP configuration"
|
|
|
|
* - always 0 except in some situations at 802.11b 11M
|
|
|
|
* - see line 53 of zdinlinef.h
|
|
|
|
*/
|
|
|
|
cs->service = 0;
|
2007-08-06 08:24:31 +08:00
|
|
|
r = zd_calc_tx_length_us(&cs->service, ZD_RATE(cs->modulation),
|
[PATCH] ZyDAS ZD1211 USB-WLAN driver
There are 60+ USB wifi adapters available on the market based on the ZyDAS
ZD1211 chip.
Unlike the predecessor (ZD1201), ZD1211 does not have a hardware MAC, so most
data operations are coordinated by the device driver. The ZD1211 chip sits
alongside an RF transceiver which is also controlled by the driver. Our driver
currently supports 2 RF types, we know of one other available in a few marketed
products which we will be supporting soon.
Our driver also supports the newer revision of ZD1211, called ZD1211B. The
initialization and RF operations are slightly different for the new revision,
but the main difference is 802.11e support. Our driver does not support the
QoS features yet, but we think we know how to use them.
This driver is based on ZyDAS's own GPL driver available from www.zydas.com.tw.
ZyDAS engineers have been responsive and supportive of our efforts, so thumbs
up to them. Additionally, the firmware is redistributable and they have
provided device specs.
This driver has been written primarily by Ulrich Kunitz and myself. Graham
Gower, Greg KH, Remco and Bryan Rittmeyer have also contributed. The
developers of ieee80211 and softmac have made our lives so much easier- thanks!
We maintain a small info-page: http://zd1211.ath.cx/wiki/DriverRewrite
If there is enough time for review, we would like to aim for inclusion in
2.6.18. The driver works nicely as a STA, and can connect to both open and
encrypted networks (we are using software-based encryption for now). We will
work towards supporting more advanced features in the future (ad-hoc, master
mode, 802.11a, ...).
Signed-off-by: Daniel Drake <dsd@gentoo.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2006-06-03 00:11:32 +08:00
|
|
|
le16_to_cpu(cs->tx_length));
|
|
|
|
if (r < 0)
|
|
|
|
return r;
|
|
|
|
cs->current_length = cpu_to_le16(r);
|
2007-11-19 23:00:29 +08:00
|
|
|
cs->next_frame_length = 0;
|
[PATCH] ZyDAS ZD1211 USB-WLAN driver
There are 60+ USB wifi adapters available on the market based on the ZyDAS
ZD1211 chip.
Unlike the predecessor (ZD1201), ZD1211 does not have a hardware MAC, so most
data operations are coordinated by the device driver. The ZD1211 chip sits
alongside an RF transceiver which is also controlled by the driver. Our driver
currently supports 2 RF types, we know of one other available in a few marketed
products which we will be supporting soon.
Our driver also supports the newer revision of ZD1211, called ZD1211B. The
initialization and RF operations are slightly different for the new revision,
but the main difference is 802.11e support. Our driver does not support the
QoS features yet, but we think we know how to use them.
This driver is based on ZyDAS's own GPL driver available from www.zydas.com.tw.
ZyDAS engineers have been responsive and supportive of our efforts, so thumbs
up to them. Additionally, the firmware is redistributable and they have
provided device specs.
This driver has been written primarily by Ulrich Kunitz and myself. Graham
Gower, Greg KH, Remco and Bryan Rittmeyer have also contributed. The
developers of ieee80211 and softmac have made our lives so much easier- thanks!
We maintain a small info-page: http://zd1211.ath.cx/wiki/DriverRewrite
If there is enough time for review, we would like to aim for inclusion in
2.6.18. The driver works nicely as a STA, and can connect to both open and
encrypted networks (we are using software-based encryption for now). We will
work towards supporting more advanced features in the future (ad-hoc, master
mode, 802.11a, ...).
Signed-off-by: Daniel Drake <dsd@gentoo.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2006-06-03 00:11:32 +08:00
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2007-11-19 23:00:29 +08:00
|
|
|
/**
|
|
|
|
* zd_op_tx - transmits a network frame to the device
|
|
|
|
*
|
|
|
|
* @dev: mac80211 hardware device
|
|
|
|
* @skb: socket buffer
|
|
|
|
* @control: the control structure
|
|
|
|
*
|
|
|
|
* This function transmit an IEEE 802.11 network frame to the device. The
|
|
|
|
* control block of the skbuff will be initialized. If necessary the incoming
|
|
|
|
* mac80211 queues will be stopped.
|
|
|
|
*/
|
2011-02-24 21:42:06 +08:00
|
|
|
static void zd_op_tx(struct ieee80211_hw *hw, struct sk_buff *skb)
|
[PATCH] ZyDAS ZD1211 USB-WLAN driver
There are 60+ USB wifi adapters available on the market based on the ZyDAS
ZD1211 chip.
Unlike the predecessor (ZD1201), ZD1211 does not have a hardware MAC, so most
data operations are coordinated by the device driver. The ZD1211 chip sits
alongside an RF transceiver which is also controlled by the driver. Our driver
currently supports 2 RF types, we know of one other available in a few marketed
products which we will be supporting soon.
Our driver also supports the newer revision of ZD1211, called ZD1211B. The
initialization and RF operations are slightly different for the new revision,
but the main difference is 802.11e support. Our driver does not support the
QoS features yet, but we think we know how to use them.
This driver is based on ZyDAS's own GPL driver available from www.zydas.com.tw.
ZyDAS engineers have been responsive and supportive of our efforts, so thumbs
up to them. Additionally, the firmware is redistributable and they have
provided device specs.
This driver has been written primarily by Ulrich Kunitz and myself. Graham
Gower, Greg KH, Remco and Bryan Rittmeyer have also contributed. The
developers of ieee80211 and softmac have made our lives so much easier- thanks!
We maintain a small info-page: http://zd1211.ath.cx/wiki/DriverRewrite
If there is enough time for review, we would like to aim for inclusion in
2.6.18. The driver works nicely as a STA, and can connect to both open and
encrypted networks (we are using software-based encryption for now). We will
work towards supporting more advanced features in the future (ad-hoc, master
mode, 802.11a, ...).
Signed-off-by: Daniel Drake <dsd@gentoo.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2006-06-03 00:11:32 +08:00
|
|
|
{
|
2007-11-19 23:00:29 +08:00
|
|
|
struct zd_mac *mac = zd_hw_mac(hw);
|
2008-05-15 18:55:29 +08:00
|
|
|
struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb);
|
2007-11-19 23:00:29 +08:00
|
|
|
int r;
|
[PATCH] ZyDAS ZD1211 USB-WLAN driver
There are 60+ USB wifi adapters available on the market based on the ZyDAS
ZD1211 chip.
Unlike the predecessor (ZD1201), ZD1211 does not have a hardware MAC, so most
data operations are coordinated by the device driver. The ZD1211 chip sits
alongside an RF transceiver which is also controlled by the driver. Our driver
currently supports 2 RF types, we know of one other available in a few marketed
products which we will be supporting soon.
Our driver also supports the newer revision of ZD1211, called ZD1211B. The
initialization and RF operations are slightly different for the new revision,
but the main difference is 802.11e support. Our driver does not support the
QoS features yet, but we think we know how to use them.
This driver is based on ZyDAS's own GPL driver available from www.zydas.com.tw.
ZyDAS engineers have been responsive and supportive of our efforts, so thumbs
up to them. Additionally, the firmware is redistributable and they have
provided device specs.
This driver has been written primarily by Ulrich Kunitz and myself. Graham
Gower, Greg KH, Remco and Bryan Rittmeyer have also contributed. The
developers of ieee80211 and softmac have made our lives so much easier- thanks!
We maintain a small info-page: http://zd1211.ath.cx/wiki/DriverRewrite
If there is enough time for review, we would like to aim for inclusion in
2.6.18. The driver works nicely as a STA, and can connect to both open and
encrypted networks (we are using software-based encryption for now). We will
work towards supporting more advanced features in the future (ad-hoc, master
mode, 802.11a, ...).
Signed-off-by: Daniel Drake <dsd@gentoo.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2006-06-03 00:11:32 +08:00
|
|
|
|
2008-05-15 18:55:29 +08:00
|
|
|
r = fill_ctrlset(mac, skb);
|
2007-11-19 23:00:29 +08:00
|
|
|
if (r)
|
2009-03-17 03:47:33 +08:00
|
|
|
goto fail;
|
[PATCH] ZyDAS ZD1211 USB-WLAN driver
There are 60+ USB wifi adapters available on the market based on the ZyDAS
ZD1211 chip.
Unlike the predecessor (ZD1201), ZD1211 does not have a hardware MAC, so most
data operations are coordinated by the device driver. The ZD1211 chip sits
alongside an RF transceiver which is also controlled by the driver. Our driver
currently supports 2 RF types, we know of one other available in a few marketed
products which we will be supporting soon.
Our driver also supports the newer revision of ZD1211, called ZD1211B. The
initialization and RF operations are slightly different for the new revision,
but the main difference is 802.11e support. Our driver does not support the
QoS features yet, but we think we know how to use them.
This driver is based on ZyDAS's own GPL driver available from www.zydas.com.tw.
ZyDAS engineers have been responsive and supportive of our efforts, so thumbs
up to them. Additionally, the firmware is redistributable and they have
provided device specs.
This driver has been written primarily by Ulrich Kunitz and myself. Graham
Gower, Greg KH, Remco and Bryan Rittmeyer have also contributed. The
developers of ieee80211 and softmac have made our lives so much easier- thanks!
We maintain a small info-page: http://zd1211.ath.cx/wiki/DriverRewrite
If there is enough time for review, we would like to aim for inclusion in
2.6.18. The driver works nicely as a STA, and can connect to both open and
encrypted networks (we are using software-based encryption for now). We will
work towards supporting more advanced features in the future (ad-hoc, master
mode, 802.11a, ...).
Signed-off-by: Daniel Drake <dsd@gentoo.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2006-06-03 00:11:32 +08:00
|
|
|
|
2008-10-21 18:40:02 +08:00
|
|
|
info->rate_driver_data[0] = hw;
|
2008-05-15 18:55:29 +08:00
|
|
|
|
2007-11-19 23:00:29 +08:00
|
|
|
r = zd_usb_tx(&mac->chip.usb, skb);
|
2008-05-15 18:55:29 +08:00
|
|
|
if (r)
|
2009-03-17 03:47:33 +08:00
|
|
|
goto fail;
|
2011-02-24 21:42:06 +08:00
|
|
|
return;
|
2009-03-17 03:47:33 +08:00
|
|
|
|
|
|
|
fail:
|
|
|
|
dev_kfree_skb(skb);
|
[PATCH] ZyDAS ZD1211 USB-WLAN driver
There are 60+ USB wifi adapters available on the market based on the ZyDAS
ZD1211 chip.
Unlike the predecessor (ZD1201), ZD1211 does not have a hardware MAC, so most
data operations are coordinated by the device driver. The ZD1211 chip sits
alongside an RF transceiver which is also controlled by the driver. Our driver
currently supports 2 RF types, we know of one other available in a few marketed
products which we will be supporting soon.
Our driver also supports the newer revision of ZD1211, called ZD1211B. The
initialization and RF operations are slightly different for the new revision,
but the main difference is 802.11e support. Our driver does not support the
QoS features yet, but we think we know how to use them.
This driver is based on ZyDAS's own GPL driver available from www.zydas.com.tw.
ZyDAS engineers have been responsive and supportive of our efforts, so thumbs
up to them. Additionally, the firmware is redistributable and they have
provided device specs.
This driver has been written primarily by Ulrich Kunitz and myself. Graham
Gower, Greg KH, Remco and Bryan Rittmeyer have also contributed. The
developers of ieee80211 and softmac have made our lives so much easier- thanks!
We maintain a small info-page: http://zd1211.ath.cx/wiki/DriverRewrite
If there is enough time for review, we would like to aim for inclusion in
2.6.18. The driver works nicely as a STA, and can connect to both open and
encrypted networks (we are using software-based encryption for now). We will
work towards supporting more advanced features in the future (ad-hoc, master
mode, 802.11a, ...).
Signed-off-by: Daniel Drake <dsd@gentoo.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2006-06-03 00:11:32 +08:00
|
|
|
}
|
|
|
|
|
2007-11-19 23:00:29 +08:00
|
|
|
/**
|
|
|
|
* filter_ack - filters incoming packets for acknowledgements
|
|
|
|
* @dev: the mac80211 device
|
|
|
|
* @rx_hdr: received header
|
|
|
|
* @stats: the status for the received packet
|
2006-11-22 08:05:53 +08:00
|
|
|
*
|
2007-11-19 23:00:29 +08:00
|
|
|
* This functions looks for ACK packets and tries to match them with the
|
|
|
|
* frames in the tx queue. If a match is found the frame will be dequeued and
|
|
|
|
* the upper layers is informed about the successful transmission. If
|
|
|
|
* mac80211 queues have been stopped and the number of frames still to be
|
|
|
|
* transmitted is low the queues will be opened again.
|
[PATCH] ZyDAS ZD1211 USB-WLAN driver
There are 60+ USB wifi adapters available on the market based on the ZyDAS
ZD1211 chip.
Unlike the predecessor (ZD1201), ZD1211 does not have a hardware MAC, so most
data operations are coordinated by the device driver. The ZD1211 chip sits
alongside an RF transceiver which is also controlled by the driver. Our driver
currently supports 2 RF types, we know of one other available in a few marketed
products which we will be supporting soon.
Our driver also supports the newer revision of ZD1211, called ZD1211B. The
initialization and RF operations are slightly different for the new revision,
but the main difference is 802.11e support. Our driver does not support the
QoS features yet, but we think we know how to use them.
This driver is based on ZyDAS's own GPL driver available from www.zydas.com.tw.
ZyDAS engineers have been responsive and supportive of our efforts, so thumbs
up to them. Additionally, the firmware is redistributable and they have
provided device specs.
This driver has been written primarily by Ulrich Kunitz and myself. Graham
Gower, Greg KH, Remco and Bryan Rittmeyer have also contributed. The
developers of ieee80211 and softmac have made our lives so much easier- thanks!
We maintain a small info-page: http://zd1211.ath.cx/wiki/DriverRewrite
If there is enough time for review, we would like to aim for inclusion in
2.6.18. The driver works nicely as a STA, and can connect to both open and
encrypted networks (we are using software-based encryption for now). We will
work towards supporting more advanced features in the future (ad-hoc, master
mode, 802.11a, ...).
Signed-off-by: Daniel Drake <dsd@gentoo.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2006-06-03 00:11:32 +08:00
|
|
|
*
|
2007-11-19 23:00:29 +08:00
|
|
|
* Returns 1 if the frame was an ACK, 0 if it was ignored.
|
[PATCH] ZyDAS ZD1211 USB-WLAN driver
There are 60+ USB wifi adapters available on the market based on the ZyDAS
ZD1211 chip.
Unlike the predecessor (ZD1201), ZD1211 does not have a hardware MAC, so most
data operations are coordinated by the device driver. The ZD1211 chip sits
alongside an RF transceiver which is also controlled by the driver. Our driver
currently supports 2 RF types, we know of one other available in a few marketed
products which we will be supporting soon.
Our driver also supports the newer revision of ZD1211, called ZD1211B. The
initialization and RF operations are slightly different for the new revision,
but the main difference is 802.11e support. Our driver does not support the
QoS features yet, but we think we know how to use them.
This driver is based on ZyDAS's own GPL driver available from www.zydas.com.tw.
ZyDAS engineers have been responsive and supportive of our efforts, so thumbs
up to them. Additionally, the firmware is redistributable and they have
provided device specs.
This driver has been written primarily by Ulrich Kunitz and myself. Graham
Gower, Greg KH, Remco and Bryan Rittmeyer have also contributed. The
developers of ieee80211 and softmac have made our lives so much easier- thanks!
We maintain a small info-page: http://zd1211.ath.cx/wiki/DriverRewrite
If there is enough time for review, we would like to aim for inclusion in
2.6.18. The driver works nicely as a STA, and can connect to both open and
encrypted networks (we are using software-based encryption for now). We will
work towards supporting more advanced features in the future (ad-hoc, master
mode, 802.11a, ...).
Signed-off-by: Daniel Drake <dsd@gentoo.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2006-06-03 00:11:32 +08:00
|
|
|
*/
|
2007-11-19 23:00:29 +08:00
|
|
|
static int filter_ack(struct ieee80211_hw *hw, struct ieee80211_hdr *rx_hdr,
|
|
|
|
struct ieee80211_rx_status *stats)
|
[PATCH] ZyDAS ZD1211 USB-WLAN driver
There are 60+ USB wifi adapters available on the market based on the ZyDAS
ZD1211 chip.
Unlike the predecessor (ZD1201), ZD1211 does not have a hardware MAC, so most
data operations are coordinated by the device driver. The ZD1211 chip sits
alongside an RF transceiver which is also controlled by the driver. Our driver
currently supports 2 RF types, we know of one other available in a few marketed
products which we will be supporting soon.
Our driver also supports the newer revision of ZD1211, called ZD1211B. The
initialization and RF operations are slightly different for the new revision,
but the main difference is 802.11e support. Our driver does not support the
QoS features yet, but we think we know how to use them.
This driver is based on ZyDAS's own GPL driver available from www.zydas.com.tw.
ZyDAS engineers have been responsive and supportive of our efforts, so thumbs
up to them. Additionally, the firmware is redistributable and they have
provided device specs.
This driver has been written primarily by Ulrich Kunitz and myself. Graham
Gower, Greg KH, Remco and Bryan Rittmeyer have also contributed. The
developers of ieee80211 and softmac have made our lives so much easier- thanks!
We maintain a small info-page: http://zd1211.ath.cx/wiki/DriverRewrite
If there is enough time for review, we would like to aim for inclusion in
2.6.18. The driver works nicely as a STA, and can connect to both open and
encrypted networks (we are using software-based encryption for now). We will
work towards supporting more advanced features in the future (ad-hoc, master
mode, 802.11a, ...).
Signed-off-by: Daniel Drake <dsd@gentoo.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2006-06-03 00:11:32 +08:00
|
|
|
{
|
2009-10-22 18:04:52 +08:00
|
|
|
struct zd_mac *mac = zd_hw_mac(hw);
|
2007-11-19 23:00:29 +08:00
|
|
|
struct sk_buff *skb;
|
|
|
|
struct sk_buff_head *q;
|
|
|
|
unsigned long flags;
|
2009-10-22 18:04:52 +08:00
|
|
|
int found = 0;
|
|
|
|
int i, position = 0;
|
[PATCH] ZyDAS ZD1211 USB-WLAN driver
There are 60+ USB wifi adapters available on the market based on the ZyDAS
ZD1211 chip.
Unlike the predecessor (ZD1201), ZD1211 does not have a hardware MAC, so most
data operations are coordinated by the device driver. The ZD1211 chip sits
alongside an RF transceiver which is also controlled by the driver. Our driver
currently supports 2 RF types, we know of one other available in a few marketed
products which we will be supporting soon.
Our driver also supports the newer revision of ZD1211, called ZD1211B. The
initialization and RF operations are slightly different for the new revision,
but the main difference is 802.11e support. Our driver does not support the
QoS features yet, but we think we know how to use them.
This driver is based on ZyDAS's own GPL driver available from www.zydas.com.tw.
ZyDAS engineers have been responsive and supportive of our efforts, so thumbs
up to them. Additionally, the firmware is redistributable and they have
provided device specs.
This driver has been written primarily by Ulrich Kunitz and myself. Graham
Gower, Greg KH, Remco and Bryan Rittmeyer have also contributed. The
developers of ieee80211 and softmac have made our lives so much easier- thanks!
We maintain a small info-page: http://zd1211.ath.cx/wiki/DriverRewrite
If there is enough time for review, we would like to aim for inclusion in
2.6.18. The driver works nicely as a STA, and can connect to both open and
encrypted networks (we are using software-based encryption for now). We will
work towards supporting more advanced features in the future (ad-hoc, master
mode, 802.11a, ...).
Signed-off-by: Daniel Drake <dsd@gentoo.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2006-06-03 00:11:32 +08:00
|
|
|
|
2008-06-15 14:33:39 +08:00
|
|
|
if (!ieee80211_is_ack(rx_hdr->frame_control))
|
[PATCH] ZyDAS ZD1211 USB-WLAN driver
There are 60+ USB wifi adapters available on the market based on the ZyDAS
ZD1211 chip.
Unlike the predecessor (ZD1201), ZD1211 does not have a hardware MAC, so most
data operations are coordinated by the device driver. The ZD1211 chip sits
alongside an RF transceiver which is also controlled by the driver. Our driver
currently supports 2 RF types, we know of one other available in a few marketed
products which we will be supporting soon.
Our driver also supports the newer revision of ZD1211, called ZD1211B. The
initialization and RF operations are slightly different for the new revision,
but the main difference is 802.11e support. Our driver does not support the
QoS features yet, but we think we know how to use them.
This driver is based on ZyDAS's own GPL driver available from www.zydas.com.tw.
ZyDAS engineers have been responsive and supportive of our efforts, so thumbs
up to them. Additionally, the firmware is redistributable and they have
provided device specs.
This driver has been written primarily by Ulrich Kunitz and myself. Graham
Gower, Greg KH, Remco and Bryan Rittmeyer have also contributed. The
developers of ieee80211 and softmac have made our lives so much easier- thanks!
We maintain a small info-page: http://zd1211.ath.cx/wiki/DriverRewrite
If there is enough time for review, we would like to aim for inclusion in
2.6.18. The driver works nicely as a STA, and can connect to both open and
encrypted networks (we are using software-based encryption for now). We will
work towards supporting more advanced features in the future (ad-hoc, master
mode, 802.11a, ...).
Signed-off-by: Daniel Drake <dsd@gentoo.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2006-06-03 00:11:32 +08:00
|
|
|
return 0;
|
|
|
|
|
2009-10-22 18:04:52 +08:00
|
|
|
q = &mac->ack_wait_queue;
|
2007-11-19 23:00:29 +08:00
|
|
|
spin_lock_irqsave(&q->lock, flags);
|
2008-09-23 15:23:30 +08:00
|
|
|
skb_queue_walk(q, skb) {
|
2007-11-19 23:00:29 +08:00
|
|
|
struct ieee80211_hdr *tx_hdr;
|
|
|
|
|
2009-10-22 18:04:52 +08:00
|
|
|
position ++;
|
|
|
|
|
|
|
|
if (mac->ack_pending && skb_queue_is_first(q, skb))
|
|
|
|
continue;
|
|
|
|
|
2007-11-19 23:00:29 +08:00
|
|
|
tx_hdr = (struct ieee80211_hdr *)skb->data;
|
2008-11-28 14:10:45 +08:00
|
|
|
if (likely(!memcmp(tx_hdr->addr2, rx_hdr->addr1, ETH_ALEN)))
|
2007-11-19 23:00:29 +08:00
|
|
|
{
|
2009-10-22 18:04:52 +08:00
|
|
|
found = 1;
|
|
|
|
break;
|
2007-11-19 23:00:29 +08:00
|
|
|
}
|
|
|
|
}
|
2009-10-22 18:04:52 +08:00
|
|
|
|
|
|
|
if (found) {
|
|
|
|
for (i=1; i<position; i++) {
|
|
|
|
skb = __skb_dequeue(q);
|
|
|
|
zd_mac_tx_status(hw, skb,
|
|
|
|
mac->ack_pending ? mac->ack_signal : 0,
|
|
|
|
NULL);
|
|
|
|
mac->ack_pending = 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
mac->ack_pending = 1;
|
|
|
|
mac->ack_signal = stats->signal;
|
2011-02-01 02:48:16 +08:00
|
|
|
|
|
|
|
/* Prevent pending tx-packet on AP-mode */
|
|
|
|
if (mac->type == NL80211_IFTYPE_AP) {
|
|
|
|
skb = __skb_dequeue(q);
|
|
|
|
zd_mac_tx_status(hw, skb, mac->ack_signal, NULL);
|
|
|
|
mac->ack_pending = 0;
|
|
|
|
}
|
2009-10-22 18:04:52 +08:00
|
|
|
}
|
|
|
|
|
2007-11-19 23:00:29 +08:00
|
|
|
spin_unlock_irqrestore(&q->lock, flags);
|
|
|
|
return 1;
|
[PATCH] ZyDAS ZD1211 USB-WLAN driver
There are 60+ USB wifi adapters available on the market based on the ZyDAS
ZD1211 chip.
Unlike the predecessor (ZD1201), ZD1211 does not have a hardware MAC, so most
data operations are coordinated by the device driver. The ZD1211 chip sits
alongside an RF transceiver which is also controlled by the driver. Our driver
currently supports 2 RF types, we know of one other available in a few marketed
products which we will be supporting soon.
Our driver also supports the newer revision of ZD1211, called ZD1211B. The
initialization and RF operations are slightly different for the new revision,
but the main difference is 802.11e support. Our driver does not support the
QoS features yet, but we think we know how to use them.
This driver is based on ZyDAS's own GPL driver available from www.zydas.com.tw.
ZyDAS engineers have been responsive and supportive of our efforts, so thumbs
up to them. Additionally, the firmware is redistributable and they have
provided device specs.
This driver has been written primarily by Ulrich Kunitz and myself. Graham
Gower, Greg KH, Remco and Bryan Rittmeyer have also contributed. The
developers of ieee80211 and softmac have made our lives so much easier- thanks!
We maintain a small info-page: http://zd1211.ath.cx/wiki/DriverRewrite
If there is enough time for review, we would like to aim for inclusion in
2.6.18. The driver works nicely as a STA, and can connect to both open and
encrypted networks (we are using software-based encryption for now). We will
work towards supporting more advanced features in the future (ad-hoc, master
mode, 802.11a, ...).
Signed-off-by: Daniel Drake <dsd@gentoo.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2006-06-03 00:11:32 +08:00
|
|
|
}
|
|
|
|
|
2007-11-19 23:00:29 +08:00
|
|
|
int zd_mac_rx(struct ieee80211_hw *hw, const u8 *buffer, unsigned int length)
|
[PATCH] ZyDAS ZD1211 USB-WLAN driver
There are 60+ USB wifi adapters available on the market based on the ZyDAS
ZD1211 chip.
Unlike the predecessor (ZD1201), ZD1211 does not have a hardware MAC, so most
data operations are coordinated by the device driver. The ZD1211 chip sits
alongside an RF transceiver which is also controlled by the driver. Our driver
currently supports 2 RF types, we know of one other available in a few marketed
products which we will be supporting soon.
Our driver also supports the newer revision of ZD1211, called ZD1211B. The
initialization and RF operations are slightly different for the new revision,
but the main difference is 802.11e support. Our driver does not support the
QoS features yet, but we think we know how to use them.
This driver is based on ZyDAS's own GPL driver available from www.zydas.com.tw.
ZyDAS engineers have been responsive and supportive of our efforts, so thumbs
up to them. Additionally, the firmware is redistributable and they have
provided device specs.
This driver has been written primarily by Ulrich Kunitz and myself. Graham
Gower, Greg KH, Remco and Bryan Rittmeyer have also contributed. The
developers of ieee80211 and softmac have made our lives so much easier- thanks!
We maintain a small info-page: http://zd1211.ath.cx/wiki/DriverRewrite
If there is enough time for review, we would like to aim for inclusion in
2.6.18. The driver works nicely as a STA, and can connect to both open and
encrypted networks (we are using software-based encryption for now). We will
work towards supporting more advanced features in the future (ad-hoc, master
mode, 802.11a, ...).
Signed-off-by: Daniel Drake <dsd@gentoo.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2006-06-03 00:11:32 +08:00
|
|
|
{
|
2007-11-19 23:00:29 +08:00
|
|
|
struct zd_mac *mac = zd_hw_mac(hw);
|
|
|
|
struct ieee80211_rx_status stats;
|
|
|
|
const struct rx_status *status;
|
|
|
|
struct sk_buff *skb;
|
|
|
|
int bad_frame = 0;
|
2008-06-15 14:33:39 +08:00
|
|
|
__le16 fc;
|
|
|
|
int need_padding;
|
2008-01-25 02:38:38 +08:00
|
|
|
int i;
|
|
|
|
u8 rate;
|
2006-08-30 06:50:29 +08:00
|
|
|
|
2007-11-19 23:00:29 +08:00
|
|
|
if (length < ZD_PLCP_HEADER_SIZE + 10 /* IEEE80211_1ADDR_LEN */ +
|
|
|
|
FCS_LEN + sizeof(struct rx_status))
|
|
|
|
return -EINVAL;
|
[PATCH] ZyDAS ZD1211 USB-WLAN driver
There are 60+ USB wifi adapters available on the market based on the ZyDAS
ZD1211 chip.
Unlike the predecessor (ZD1201), ZD1211 does not have a hardware MAC, so most
data operations are coordinated by the device driver. The ZD1211 chip sits
alongside an RF transceiver which is also controlled by the driver. Our driver
currently supports 2 RF types, we know of one other available in a few marketed
products which we will be supporting soon.
Our driver also supports the newer revision of ZD1211, called ZD1211B. The
initialization and RF operations are slightly different for the new revision,
but the main difference is 802.11e support. Our driver does not support the
QoS features yet, but we think we know how to use them.
This driver is based on ZyDAS's own GPL driver available from www.zydas.com.tw.
ZyDAS engineers have been responsive and supportive of our efforts, so thumbs
up to them. Additionally, the firmware is redistributable and they have
provided device specs.
This driver has been written primarily by Ulrich Kunitz and myself. Graham
Gower, Greg KH, Remco and Bryan Rittmeyer have also contributed. The
developers of ieee80211 and softmac have made our lives so much easier- thanks!
We maintain a small info-page: http://zd1211.ath.cx/wiki/DriverRewrite
If there is enough time for review, we would like to aim for inclusion in
2.6.18. The driver works nicely as a STA, and can connect to both open and
encrypted networks (we are using software-based encryption for now). We will
work towards supporting more advanced features in the future (ad-hoc, master
mode, 802.11a, ...).
Signed-off-by: Daniel Drake <dsd@gentoo.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2006-06-03 00:11:32 +08:00
|
|
|
|
2007-11-19 23:00:29 +08:00
|
|
|
memset(&stats, 0, sizeof(stats));
|
[PATCH] ZyDAS ZD1211 USB-WLAN driver
There are 60+ USB wifi adapters available on the market based on the ZyDAS
ZD1211 chip.
Unlike the predecessor (ZD1201), ZD1211 does not have a hardware MAC, so most
data operations are coordinated by the device driver. The ZD1211 chip sits
alongside an RF transceiver which is also controlled by the driver. Our driver
currently supports 2 RF types, we know of one other available in a few marketed
products which we will be supporting soon.
Our driver also supports the newer revision of ZD1211, called ZD1211B. The
initialization and RF operations are slightly different for the new revision,
but the main difference is 802.11e support. Our driver does not support the
QoS features yet, but we think we know how to use them.
This driver is based on ZyDAS's own GPL driver available from www.zydas.com.tw.
ZyDAS engineers have been responsive and supportive of our efforts, so thumbs
up to them. Additionally, the firmware is redistributable and they have
provided device specs.
This driver has been written primarily by Ulrich Kunitz and myself. Graham
Gower, Greg KH, Remco and Bryan Rittmeyer have also contributed. The
developers of ieee80211 and softmac have made our lives so much easier- thanks!
We maintain a small info-page: http://zd1211.ath.cx/wiki/DriverRewrite
If there is enough time for review, we would like to aim for inclusion in
2.6.18. The driver works nicely as a STA, and can connect to both open and
encrypted networks (we are using software-based encryption for now). We will
work towards supporting more advanced features in the future (ad-hoc, master
mode, 802.11a, ...).
Signed-off-by: Daniel Drake <dsd@gentoo.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2006-06-03 00:11:32 +08:00
|
|
|
|
2007-11-19 23:00:29 +08:00
|
|
|
/* Note about pass_failed_fcs and pass_ctrl access below:
|
|
|
|
* mac locking intentionally omitted here, as this is the only unlocked
|
|
|
|
* reader and the only writer is configure_filter. Plus, if there were
|
|
|
|
* any races accessing these variables, it wouldn't really matter.
|
|
|
|
* If mac80211 ever provides a way for us to access filter flags
|
|
|
|
* from outside configure_filter, we could improve on this. Also, this
|
|
|
|
* situation may change once we implement some kind of DMA-into-skb
|
|
|
|
* RX path. */
|
[PATCH] ZyDAS ZD1211 USB-WLAN driver
There are 60+ USB wifi adapters available on the market based on the ZyDAS
ZD1211 chip.
Unlike the predecessor (ZD1201), ZD1211 does not have a hardware MAC, so most
data operations are coordinated by the device driver. The ZD1211 chip sits
alongside an RF transceiver which is also controlled by the driver. Our driver
currently supports 2 RF types, we know of one other available in a few marketed
products which we will be supporting soon.
Our driver also supports the newer revision of ZD1211, called ZD1211B. The
initialization and RF operations are slightly different for the new revision,
but the main difference is 802.11e support. Our driver does not support the
QoS features yet, but we think we know how to use them.
This driver is based on ZyDAS's own GPL driver available from www.zydas.com.tw.
ZyDAS engineers have been responsive and supportive of our efforts, so thumbs
up to them. Additionally, the firmware is redistributable and they have
provided device specs.
This driver has been written primarily by Ulrich Kunitz and myself. Graham
Gower, Greg KH, Remco and Bryan Rittmeyer have also contributed. The
developers of ieee80211 and softmac have made our lives so much easier- thanks!
We maintain a small info-page: http://zd1211.ath.cx/wiki/DriverRewrite
If there is enough time for review, we would like to aim for inclusion in
2.6.18. The driver works nicely as a STA, and can connect to both open and
encrypted networks (we are using software-based encryption for now). We will
work towards supporting more advanced features in the future (ad-hoc, master
mode, 802.11a, ...).
Signed-off-by: Daniel Drake <dsd@gentoo.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2006-06-03 00:11:32 +08:00
|
|
|
|
2007-11-19 23:00:29 +08:00
|
|
|
/* Caller has to ensure that length >= sizeof(struct rx_status). */
|
|
|
|
status = (struct rx_status *)
|
2007-10-03 01:36:53 +08:00
|
|
|
(buffer + (length - sizeof(struct rx_status)));
|
[PATCH] ZyDAS ZD1211 USB-WLAN driver
There are 60+ USB wifi adapters available on the market based on the ZyDAS
ZD1211 chip.
Unlike the predecessor (ZD1201), ZD1211 does not have a hardware MAC, so most
data operations are coordinated by the device driver. The ZD1211 chip sits
alongside an RF transceiver which is also controlled by the driver. Our driver
currently supports 2 RF types, we know of one other available in a few marketed
products which we will be supporting soon.
Our driver also supports the newer revision of ZD1211, called ZD1211B. The
initialization and RF operations are slightly different for the new revision,
but the main difference is 802.11e support. Our driver does not support the
QoS features yet, but we think we know how to use them.
This driver is based on ZyDAS's own GPL driver available from www.zydas.com.tw.
ZyDAS engineers have been responsive and supportive of our efforts, so thumbs
up to them. Additionally, the firmware is redistributable and they have
provided device specs.
This driver has been written primarily by Ulrich Kunitz and myself. Graham
Gower, Greg KH, Remco and Bryan Rittmeyer have also contributed. The
developers of ieee80211 and softmac have made our lives so much easier- thanks!
We maintain a small info-page: http://zd1211.ath.cx/wiki/DriverRewrite
If there is enough time for review, we would like to aim for inclusion in
2.6.18. The driver works nicely as a STA, and can connect to both open and
encrypted networks (we are using software-based encryption for now). We will
work towards supporting more advanced features in the future (ad-hoc, master
mode, 802.11a, ...).
Signed-off-by: Daniel Drake <dsd@gentoo.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2006-06-03 00:11:32 +08:00
|
|
|
if (status->frame_status & ZD_RX_ERROR) {
|
2007-11-19 23:00:29 +08:00
|
|
|
if (mac->pass_failed_fcs &&
|
|
|
|
(status->frame_status & ZD_RX_CRC32_ERROR)) {
|
|
|
|
stats.flag |= RX_FLAG_FAILED_FCS_CRC;
|
|
|
|
bad_frame = 1;
|
|
|
|
} else {
|
|
|
|
return -EINVAL;
|
2007-01-29 09:00:03 +08:00
|
|
|
}
|
[PATCH] ZyDAS ZD1211 USB-WLAN driver
There are 60+ USB wifi adapters available on the market based on the ZyDAS
ZD1211 chip.
Unlike the predecessor (ZD1201), ZD1211 does not have a hardware MAC, so most
data operations are coordinated by the device driver. The ZD1211 chip sits
alongside an RF transceiver which is also controlled by the driver. Our driver
currently supports 2 RF types, we know of one other available in a few marketed
products which we will be supporting soon.
Our driver also supports the newer revision of ZD1211, called ZD1211B. The
initialization and RF operations are slightly different for the new revision,
but the main difference is 802.11e support. Our driver does not support the
QoS features yet, but we think we know how to use them.
This driver is based on ZyDAS's own GPL driver available from www.zydas.com.tw.
ZyDAS engineers have been responsive and supportive of our efforts, so thumbs
up to them. Additionally, the firmware is redistributable and they have
provided device specs.
This driver has been written primarily by Ulrich Kunitz and myself. Graham
Gower, Greg KH, Remco and Bryan Rittmeyer have also contributed. The
developers of ieee80211 and softmac have made our lives so much easier- thanks!
We maintain a small info-page: http://zd1211.ath.cx/wiki/DriverRewrite
If there is enough time for review, we would like to aim for inclusion in
2.6.18. The driver works nicely as a STA, and can connect to both open and
encrypted networks (we are using software-based encryption for now). We will
work towards supporting more advanced features in the future (ad-hoc, master
mode, 802.11a, ...).
Signed-off-by: Daniel Drake <dsd@gentoo.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2006-06-03 00:11:32 +08:00
|
|
|
}
|
2007-01-29 09:00:03 +08:00
|
|
|
|
2008-01-25 02:38:38 +08:00
|
|
|
stats.freq = zd_channels[_zd_chip_get_channel(&mac->chip) - 1].center_freq;
|
|
|
|
stats.band = IEEE80211_BAND_2GHZ;
|
2011-06-20 19:42:28 +08:00
|
|
|
stats.signal = zd_check_signal(hw, status->signal_strength);
|
2008-01-25 02:38:38 +08:00
|
|
|
|
|
|
|
rate = zd_rx_rate(buffer, status);
|
|
|
|
|
|
|
|
/* todo: return index in the big switches in zd_rx_rate instead */
|
|
|
|
for (i = 0; i < mac->band.n_bitrates; i++)
|
|
|
|
if (rate == mac->band.bitrates[i].hw_value)
|
|
|
|
stats.rate_idx = i;
|
2007-11-19 23:00:29 +08:00
|
|
|
|
|
|
|
length -= ZD_PLCP_HEADER_SIZE + sizeof(struct rx_status);
|
|
|
|
buffer += ZD_PLCP_HEADER_SIZE;
|
|
|
|
|
|
|
|
/* Except for bad frames, filter each frame to see if it is an ACK, in
|
|
|
|
* which case our internal TX tracking is updated. Normally we then
|
|
|
|
* bail here as there's no need to pass ACKs on up to the stack, but
|
|
|
|
* there is also the case where the stack has requested us to pass
|
|
|
|
* control frames on up (pass_ctrl) which we must consider. */
|
|
|
|
if (!bad_frame &&
|
|
|
|
filter_ack(hw, (struct ieee80211_hdr *)buffer, &stats)
|
|
|
|
&& !mac->pass_ctrl)
|
|
|
|
return 0;
|
[PATCH] ZyDAS ZD1211 USB-WLAN driver
There are 60+ USB wifi adapters available on the market based on the ZyDAS
ZD1211 chip.
Unlike the predecessor (ZD1201), ZD1211 does not have a hardware MAC, so most
data operations are coordinated by the device driver. The ZD1211 chip sits
alongside an RF transceiver which is also controlled by the driver. Our driver
currently supports 2 RF types, we know of one other available in a few marketed
products which we will be supporting soon.
Our driver also supports the newer revision of ZD1211, called ZD1211B. The
initialization and RF operations are slightly different for the new revision,
but the main difference is 802.11e support. Our driver does not support the
QoS features yet, but we think we know how to use them.
This driver is based on ZyDAS's own GPL driver available from www.zydas.com.tw.
ZyDAS engineers have been responsive and supportive of our efforts, so thumbs
up to them. Additionally, the firmware is redistributable and they have
provided device specs.
This driver has been written primarily by Ulrich Kunitz and myself. Graham
Gower, Greg KH, Remco and Bryan Rittmeyer have also contributed. The
developers of ieee80211 and softmac have made our lives so much easier- thanks!
We maintain a small info-page: http://zd1211.ath.cx/wiki/DriverRewrite
If there is enough time for review, we would like to aim for inclusion in
2.6.18. The driver works nicely as a STA, and can connect to both open and
encrypted networks (we are using software-based encryption for now). We will
work towards supporting more advanced features in the future (ad-hoc, master
mode, 802.11a, ...).
Signed-off-by: Daniel Drake <dsd@gentoo.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2006-06-03 00:11:32 +08:00
|
|
|
|
2009-07-30 08:08:07 +08:00
|
|
|
fc = get_unaligned((__le16*)buffer);
|
2008-06-15 14:33:39 +08:00
|
|
|
need_padding = ieee80211_is_data_qos(fc) ^ ieee80211_has_a4(fc);
|
2007-12-30 00:24:23 +08:00
|
|
|
|
|
|
|
skb = dev_alloc_skb(length + (need_padding ? 2 : 0));
|
2007-11-19 23:00:29 +08:00
|
|
|
if (skb == NULL)
|
|
|
|
return -ENOMEM;
|
2007-12-30 00:24:23 +08:00
|
|
|
if (need_padding) {
|
2010-05-18 19:44:54 +08:00
|
|
|
/* Make sure the payload data is 4 byte aligned. */
|
2007-12-30 00:24:23 +08:00
|
|
|
skb_reserve(skb, 2);
|
|
|
|
}
|
|
|
|
|
2009-10-22 18:04:52 +08:00
|
|
|
/* FIXME : could we avoid this big memcpy ? */
|
2007-11-19 23:00:29 +08:00
|
|
|
memcpy(skb_put(skb, length), buffer, length);
|
|
|
|
|
2009-06-17 19:13:00 +08:00
|
|
|
memcpy(IEEE80211_SKB_RXCB(skb), &stats, sizeof(stats));
|
|
|
|
ieee80211_rx_irqsafe(hw, skb);
|
[PATCH] ZyDAS ZD1211 USB-WLAN driver
There are 60+ USB wifi adapters available on the market based on the ZyDAS
ZD1211 chip.
Unlike the predecessor (ZD1201), ZD1211 does not have a hardware MAC, so most
data operations are coordinated by the device driver. The ZD1211 chip sits
alongside an RF transceiver which is also controlled by the driver. Our driver
currently supports 2 RF types, we know of one other available in a few marketed
products which we will be supporting soon.
Our driver also supports the newer revision of ZD1211, called ZD1211B. The
initialization and RF operations are slightly different for the new revision,
but the main difference is 802.11e support. Our driver does not support the
QoS features yet, but we think we know how to use them.
This driver is based on ZyDAS's own GPL driver available from www.zydas.com.tw.
ZyDAS engineers have been responsive and supportive of our efforts, so thumbs
up to them. Additionally, the firmware is redistributable and they have
provided device specs.
This driver has been written primarily by Ulrich Kunitz and myself. Graham
Gower, Greg KH, Remco and Bryan Rittmeyer have also contributed. The
developers of ieee80211 and softmac have made our lives so much easier- thanks!
We maintain a small info-page: http://zd1211.ath.cx/wiki/DriverRewrite
If there is enough time for review, we would like to aim for inclusion in
2.6.18. The driver works nicely as a STA, and can connect to both open and
encrypted networks (we are using software-based encryption for now). We will
work towards supporting more advanced features in the future (ad-hoc, master
mode, 802.11a, ...).
Signed-off-by: Daniel Drake <dsd@gentoo.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2006-06-03 00:11:32 +08:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2007-11-19 23:00:29 +08:00
|
|
|
static int zd_op_add_interface(struct ieee80211_hw *hw,
|
2009-12-23 20:15:45 +08:00
|
|
|
struct ieee80211_vif *vif)
|
[PATCH] ZyDAS ZD1211 USB-WLAN driver
There are 60+ USB wifi adapters available on the market based on the ZyDAS
ZD1211 chip.
Unlike the predecessor (ZD1201), ZD1211 does not have a hardware MAC, so most
data operations are coordinated by the device driver. The ZD1211 chip sits
alongside an RF transceiver which is also controlled by the driver. Our driver
currently supports 2 RF types, we know of one other available in a few marketed
products which we will be supporting soon.
Our driver also supports the newer revision of ZD1211, called ZD1211B. The
initialization and RF operations are slightly different for the new revision,
but the main difference is 802.11e support. Our driver does not support the
QoS features yet, but we think we know how to use them.
This driver is based on ZyDAS's own GPL driver available from www.zydas.com.tw.
ZyDAS engineers have been responsive and supportive of our efforts, so thumbs
up to them. Additionally, the firmware is redistributable and they have
provided device specs.
This driver has been written primarily by Ulrich Kunitz and myself. Graham
Gower, Greg KH, Remco and Bryan Rittmeyer have also contributed. The
developers of ieee80211 and softmac have made our lives so much easier- thanks!
We maintain a small info-page: http://zd1211.ath.cx/wiki/DriverRewrite
If there is enough time for review, we would like to aim for inclusion in
2.6.18. The driver works nicely as a STA, and can connect to both open and
encrypted networks (we are using software-based encryption for now). We will
work towards supporting more advanced features in the future (ad-hoc, master
mode, 802.11a, ...).
Signed-off-by: Daniel Drake <dsd@gentoo.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2006-06-03 00:11:32 +08:00
|
|
|
{
|
2007-11-19 23:00:29 +08:00
|
|
|
struct zd_mac *mac = zd_hw_mac(hw);
|
[PATCH] ZyDAS ZD1211 USB-WLAN driver
There are 60+ USB wifi adapters available on the market based on the ZyDAS
ZD1211 chip.
Unlike the predecessor (ZD1201), ZD1211 does not have a hardware MAC, so most
data operations are coordinated by the device driver. The ZD1211 chip sits
alongside an RF transceiver which is also controlled by the driver. Our driver
currently supports 2 RF types, we know of one other available in a few marketed
products which we will be supporting soon.
Our driver also supports the newer revision of ZD1211, called ZD1211B. The
initialization and RF operations are slightly different for the new revision,
but the main difference is 802.11e support. Our driver does not support the
QoS features yet, but we think we know how to use them.
This driver is based on ZyDAS's own GPL driver available from www.zydas.com.tw.
ZyDAS engineers have been responsive and supportive of our efforts, so thumbs
up to them. Additionally, the firmware is redistributable and they have
provided device specs.
This driver has been written primarily by Ulrich Kunitz and myself. Graham
Gower, Greg KH, Remco and Bryan Rittmeyer have also contributed. The
developers of ieee80211 and softmac have made our lives so much easier- thanks!
We maintain a small info-page: http://zd1211.ath.cx/wiki/DriverRewrite
If there is enough time for review, we would like to aim for inclusion in
2.6.18. The driver works nicely as a STA, and can connect to both open and
encrypted networks (we are using software-based encryption for now). We will
work towards supporting more advanced features in the future (ad-hoc, master
mode, 802.11a, ...).
Signed-off-by: Daniel Drake <dsd@gentoo.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2006-06-03 00:11:32 +08:00
|
|
|
|
2008-09-11 06:01:58 +08:00
|
|
|
/* using NL80211_IFTYPE_UNSPECIFIED to indicate no mode selected */
|
|
|
|
if (mac->type != NL80211_IFTYPE_UNSPECIFIED)
|
2007-11-19 23:00:29 +08:00
|
|
|
return -EOPNOTSUPP;
|
[PATCH] ZyDAS ZD1211 USB-WLAN driver
There are 60+ USB wifi adapters available on the market based on the ZyDAS
ZD1211 chip.
Unlike the predecessor (ZD1201), ZD1211 does not have a hardware MAC, so most
data operations are coordinated by the device driver. The ZD1211 chip sits
alongside an RF transceiver which is also controlled by the driver. Our driver
currently supports 2 RF types, we know of one other available in a few marketed
products which we will be supporting soon.
Our driver also supports the newer revision of ZD1211, called ZD1211B. The
initialization and RF operations are slightly different for the new revision,
but the main difference is 802.11e support. Our driver does not support the
QoS features yet, but we think we know how to use them.
This driver is based on ZyDAS's own GPL driver available from www.zydas.com.tw.
ZyDAS engineers have been responsive and supportive of our efforts, so thumbs
up to them. Additionally, the firmware is redistributable and they have
provided device specs.
This driver has been written primarily by Ulrich Kunitz and myself. Graham
Gower, Greg KH, Remco and Bryan Rittmeyer have also contributed. The
developers of ieee80211 and softmac have made our lives so much easier- thanks!
We maintain a small info-page: http://zd1211.ath.cx/wiki/DriverRewrite
If there is enough time for review, we would like to aim for inclusion in
2.6.18. The driver works nicely as a STA, and can connect to both open and
encrypted networks (we are using software-based encryption for now). We will
work towards supporting more advanced features in the future (ad-hoc, master
mode, 802.11a, ...).
Signed-off-by: Daniel Drake <dsd@gentoo.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2006-06-03 00:11:32 +08:00
|
|
|
|
2009-12-23 20:15:45 +08:00
|
|
|
switch (vif->type) {
|
2008-09-11 06:01:58 +08:00
|
|
|
case NL80211_IFTYPE_MONITOR:
|
|
|
|
case NL80211_IFTYPE_MESH_POINT:
|
|
|
|
case NL80211_IFTYPE_STATION:
|
|
|
|
case NL80211_IFTYPE_ADHOC:
|
2011-02-01 02:50:21 +08:00
|
|
|
case NL80211_IFTYPE_AP:
|
2009-12-23 20:15:45 +08:00
|
|
|
mac->type = vif->type;
|
2007-11-19 23:00:29 +08:00
|
|
|
break;
|
|
|
|
default:
|
|
|
|
return -EOPNOTSUPP;
|
2006-12-11 03:13:12 +08:00
|
|
|
}
|
[PATCH] ZyDAS ZD1211 USB-WLAN driver
There are 60+ USB wifi adapters available on the market based on the ZyDAS
ZD1211 chip.
Unlike the predecessor (ZD1201), ZD1211 does not have a hardware MAC, so most
data operations are coordinated by the device driver. The ZD1211 chip sits
alongside an RF transceiver which is also controlled by the driver. Our driver
currently supports 2 RF types, we know of one other available in a few marketed
products which we will be supporting soon.
Our driver also supports the newer revision of ZD1211, called ZD1211B. The
initialization and RF operations are slightly different for the new revision,
but the main difference is 802.11e support. Our driver does not support the
QoS features yet, but we think we know how to use them.
This driver is based on ZyDAS's own GPL driver available from www.zydas.com.tw.
ZyDAS engineers have been responsive and supportive of our efforts, so thumbs
up to them. Additionally, the firmware is redistributable and they have
provided device specs.
This driver has been written primarily by Ulrich Kunitz and myself. Graham
Gower, Greg KH, Remco and Bryan Rittmeyer have also contributed. The
developers of ieee80211 and softmac have made our lives so much easier- thanks!
We maintain a small info-page: http://zd1211.ath.cx/wiki/DriverRewrite
If there is enough time for review, we would like to aim for inclusion in
2.6.18. The driver works nicely as a STA, and can connect to both open and
encrypted networks (we are using software-based encryption for now). We will
work towards supporting more advanced features in the future (ad-hoc, master
mode, 802.11a, ...).
Signed-off-by: Daniel Drake <dsd@gentoo.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2006-06-03 00:11:32 +08:00
|
|
|
|
2011-02-01 02:48:06 +08:00
|
|
|
mac->vif = vif;
|
|
|
|
|
|
|
|
return set_mac_and_bssid(mac);
|
2007-11-19 23:00:29 +08:00
|
|
|
}
|
[PATCH] ZyDAS ZD1211 USB-WLAN driver
There are 60+ USB wifi adapters available on the market based on the ZyDAS
ZD1211 chip.
Unlike the predecessor (ZD1201), ZD1211 does not have a hardware MAC, so most
data operations are coordinated by the device driver. The ZD1211 chip sits
alongside an RF transceiver which is also controlled by the driver. Our driver
currently supports 2 RF types, we know of one other available in a few marketed
products which we will be supporting soon.
Our driver also supports the newer revision of ZD1211, called ZD1211B. The
initialization and RF operations are slightly different for the new revision,
but the main difference is 802.11e support. Our driver does not support the
QoS features yet, but we think we know how to use them.
This driver is based on ZyDAS's own GPL driver available from www.zydas.com.tw.
ZyDAS engineers have been responsive and supportive of our efforts, so thumbs
up to them. Additionally, the firmware is redistributable and they have
provided device specs.
This driver has been written primarily by Ulrich Kunitz and myself. Graham
Gower, Greg KH, Remco and Bryan Rittmeyer have also contributed. The
developers of ieee80211 and softmac have made our lives so much easier- thanks!
We maintain a small info-page: http://zd1211.ath.cx/wiki/DriverRewrite
If there is enough time for review, we would like to aim for inclusion in
2.6.18. The driver works nicely as a STA, and can connect to both open and
encrypted networks (we are using software-based encryption for now). We will
work towards supporting more advanced features in the future (ad-hoc, master
mode, 802.11a, ...).
Signed-off-by: Daniel Drake <dsd@gentoo.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2006-06-03 00:11:32 +08:00
|
|
|
|
2007-11-19 23:00:29 +08:00
|
|
|
static void zd_op_remove_interface(struct ieee80211_hw *hw,
|
2009-12-23 20:15:45 +08:00
|
|
|
struct ieee80211_vif *vif)
|
2007-11-19 23:00:29 +08:00
|
|
|
{
|
|
|
|
struct zd_mac *mac = zd_hw_mac(hw);
|
2008-09-11 06:01:58 +08:00
|
|
|
mac->type = NL80211_IFTYPE_UNSPECIFIED;
|
2011-02-01 02:48:06 +08:00
|
|
|
mac->vif = NULL;
|
2011-02-01 02:48:25 +08:00
|
|
|
zd_set_beacon_interval(&mac->chip, 0, 0, NL80211_IFTYPE_UNSPECIFIED);
|
2007-11-19 23:00:29 +08:00
|
|
|
zd_write_mac_addr(&mac->chip, NULL);
|
2011-06-20 19:42:39 +08:00
|
|
|
|
|
|
|
zd_mac_free_cur_beacon(mac);
|
2007-11-19 23:00:29 +08:00
|
|
|
}
|
2007-12-01 18:26:05 +08:00
|
|
|
|
2008-10-09 18:18:51 +08:00
|
|
|
static int zd_op_config(struct ieee80211_hw *hw, u32 changed)
|
2007-11-19 23:00:29 +08:00
|
|
|
{
|
|
|
|
struct zd_mac *mac = zd_hw_mac(hw);
|
2008-10-09 18:18:51 +08:00
|
|
|
struct ieee80211_conf *conf = &hw->conf;
|
|
|
|
|
2011-02-01 02:49:43 +08:00
|
|
|
spin_lock_irq(&mac->lock);
|
|
|
|
mac->channel = conf->channel->hw_value;
|
|
|
|
spin_unlock_irq(&mac->lock);
|
|
|
|
|
2008-01-25 02:38:38 +08:00
|
|
|
return zd_chip_set_channel(&mac->chip, conf->channel->hw_value);
|
2007-11-19 23:00:29 +08:00
|
|
|
}
|
2006-08-30 06:50:29 +08:00
|
|
|
|
2011-02-01 02:48:35 +08:00
|
|
|
static void zd_beacon_done(struct zd_mac *mac)
|
|
|
|
{
|
|
|
|
struct sk_buff *skb, *beacon;
|
|
|
|
|
2011-02-01 02:48:55 +08:00
|
|
|
if (!test_bit(ZD_DEVICE_RUNNING, &mac->flags))
|
|
|
|
return;
|
2011-02-01 02:48:35 +08:00
|
|
|
if (!mac->vif || mac->vif->type != NL80211_IFTYPE_AP)
|
|
|
|
return;
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Send out buffered broad- and multicast frames.
|
|
|
|
*/
|
|
|
|
while (!ieee80211_queue_stopped(mac->hw, 0)) {
|
|
|
|
skb = ieee80211_get_buffered_bc(mac->hw, mac->vif);
|
|
|
|
if (!skb)
|
|
|
|
break;
|
|
|
|
zd_op_tx(mac->hw, skb);
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Fetch next beacon so that tim_count is updated.
|
|
|
|
*/
|
|
|
|
beacon = ieee80211_beacon_get(mac->hw, mac->vif);
|
2011-06-20 19:42:39 +08:00
|
|
|
if (beacon)
|
2011-06-20 19:42:49 +08:00
|
|
|
zd_mac_config_beacon(mac->hw, beacon, true);
|
2011-02-01 02:48:35 +08:00
|
|
|
|
2011-02-01 02:48:55 +08:00
|
|
|
spin_lock_irq(&mac->lock);
|
|
|
|
mac->beacon.last_update = jiffies;
|
|
|
|
spin_unlock_irq(&mac->lock);
|
2011-02-01 02:48:35 +08:00
|
|
|
}
|
|
|
|
|
2008-09-10 14:19:49 +08:00
|
|
|
static void zd_process_intr(struct work_struct *work)
|
2008-03-04 04:32:15 +08:00
|
|
|
{
|
|
|
|
u16 int_status;
|
2011-02-01 02:47:27 +08:00
|
|
|
unsigned long flags;
|
2008-03-04 04:32:15 +08:00
|
|
|
struct zd_mac *mac = container_of(work, struct zd_mac, process_intr);
|
|
|
|
|
2011-02-01 02:47:27 +08:00
|
|
|
spin_lock_irqsave(&mac->lock, flags);
|
|
|
|
int_status = le16_to_cpu(*(__le16 *)(mac->intr_buffer + 4));
|
|
|
|
spin_unlock_irqrestore(&mac->lock, flags);
|
|
|
|
|
2011-02-01 02:48:35 +08:00
|
|
|
if (int_status & INT_CFG_NEXT_BCN) {
|
|
|
|
/*dev_dbg_f_limit(zd_mac_dev(mac), "INT_CFG_NEXT_BCN\n");*/
|
|
|
|
zd_beacon_done(mac);
|
|
|
|
} else {
|
2008-03-04 04:32:15 +08:00
|
|
|
dev_dbg_f(zd_mac_dev(mac), "Unsupported interrupt\n");
|
2011-02-01 02:48:35 +08:00
|
|
|
}
|
2008-03-04 04:32:15 +08:00
|
|
|
|
|
|
|
zd_chip_enable_hwint(&mac->chip);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2009-08-17 22:16:53 +08:00
|
|
|
static u64 zd_op_prepare_multicast(struct ieee80211_hw *hw,
|
2010-04-02 05:22:57 +08:00
|
|
|
struct netdev_hw_addr_list *mc_list)
|
2009-08-17 22:16:53 +08:00
|
|
|
{
|
|
|
|
struct zd_mac *mac = zd_hw_mac(hw);
|
|
|
|
struct zd_mc_hash hash;
|
2010-04-02 05:22:57 +08:00
|
|
|
struct netdev_hw_addr *ha;
|
2009-08-17 22:16:53 +08:00
|
|
|
|
|
|
|
zd_mc_clear(&hash);
|
|
|
|
|
2010-04-02 05:22:57 +08:00
|
|
|
netdev_hw_addr_list_for_each(ha, mc_list) {
|
|
|
|
dev_dbg_f(zd_mac_dev(mac), "mc addr %pM\n", ha->addr);
|
|
|
|
zd_mc_add_addr(&hash, ha->addr);
|
2009-08-17 22:16:53 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
return hash.low | ((u64)hash.high << 32);
|
|
|
|
}
|
|
|
|
|
2007-11-19 23:00:29 +08:00
|
|
|
#define SUPPORTED_FIF_FLAGS \
|
|
|
|
(FIF_PROMISC_IN_BSS | FIF_ALLMULTI | FIF_FCSFAIL | FIF_CONTROL | \
|
2008-02-10 23:03:55 +08:00
|
|
|
FIF_OTHER_BSS | FIF_BCN_PRBRESP_PROMISC)
|
2007-11-19 23:00:29 +08:00
|
|
|
static void zd_op_configure_filter(struct ieee80211_hw *hw,
|
|
|
|
unsigned int changed_flags,
|
|
|
|
unsigned int *new_flags,
|
2009-08-17 22:16:53 +08:00
|
|
|
u64 multicast)
|
[PATCH] ZyDAS ZD1211 USB-WLAN driver
There are 60+ USB wifi adapters available on the market based on the ZyDAS
ZD1211 chip.
Unlike the predecessor (ZD1201), ZD1211 does not have a hardware MAC, so most
data operations are coordinated by the device driver. The ZD1211 chip sits
alongside an RF transceiver which is also controlled by the driver. Our driver
currently supports 2 RF types, we know of one other available in a few marketed
products which we will be supporting soon.
Our driver also supports the newer revision of ZD1211, called ZD1211B. The
initialization and RF operations are slightly different for the new revision,
but the main difference is 802.11e support. Our driver does not support the
QoS features yet, but we think we know how to use them.
This driver is based on ZyDAS's own GPL driver available from www.zydas.com.tw.
ZyDAS engineers have been responsive and supportive of our efforts, so thumbs
up to them. Additionally, the firmware is redistributable and they have
provided device specs.
This driver has been written primarily by Ulrich Kunitz and myself. Graham
Gower, Greg KH, Remco and Bryan Rittmeyer have also contributed. The
developers of ieee80211 and softmac have made our lives so much easier- thanks!
We maintain a small info-page: http://zd1211.ath.cx/wiki/DriverRewrite
If there is enough time for review, we would like to aim for inclusion in
2.6.18. The driver works nicely as a STA, and can connect to both open and
encrypted networks (we are using software-based encryption for now). We will
work towards supporting more advanced features in the future (ad-hoc, master
mode, 802.11a, ...).
Signed-off-by: Daniel Drake <dsd@gentoo.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2006-06-03 00:11:32 +08:00
|
|
|
{
|
2009-08-17 22:16:53 +08:00
|
|
|
struct zd_mc_hash hash = {
|
|
|
|
.low = multicast,
|
|
|
|
.high = multicast >> 32,
|
|
|
|
};
|
2007-11-19 23:00:29 +08:00
|
|
|
struct zd_mac *mac = zd_hw_mac(hw);
|
|
|
|
unsigned long flags;
|
2011-02-01 02:47:46 +08:00
|
|
|
int r;
|
[PATCH] ZyDAS ZD1211 USB-WLAN driver
There are 60+ USB wifi adapters available on the market based on the ZyDAS
ZD1211 chip.
Unlike the predecessor (ZD1201), ZD1211 does not have a hardware MAC, so most
data operations are coordinated by the device driver. The ZD1211 chip sits
alongside an RF transceiver which is also controlled by the driver. Our driver
currently supports 2 RF types, we know of one other available in a few marketed
products which we will be supporting soon.
Our driver also supports the newer revision of ZD1211, called ZD1211B. The
initialization and RF operations are slightly different for the new revision,
but the main difference is 802.11e support. Our driver does not support the
QoS features yet, but we think we know how to use them.
This driver is based on ZyDAS's own GPL driver available from www.zydas.com.tw.
ZyDAS engineers have been responsive and supportive of our efforts, so thumbs
up to them. Additionally, the firmware is redistributable and they have
provided device specs.
This driver has been written primarily by Ulrich Kunitz and myself. Graham
Gower, Greg KH, Remco and Bryan Rittmeyer have also contributed. The
developers of ieee80211 and softmac have made our lives so much easier- thanks!
We maintain a small info-page: http://zd1211.ath.cx/wiki/DriverRewrite
If there is enough time for review, we would like to aim for inclusion in
2.6.18. The driver works nicely as a STA, and can connect to both open and
encrypted networks (we are using software-based encryption for now). We will
work towards supporting more advanced features in the future (ad-hoc, master
mode, 802.11a, ...).
Signed-off-by: Daniel Drake <dsd@gentoo.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2006-06-03 00:11:32 +08:00
|
|
|
|
2007-11-19 23:00:29 +08:00
|
|
|
/* Only deal with supported flags */
|
|
|
|
changed_flags &= SUPPORTED_FIF_FLAGS;
|
|
|
|
*new_flags &= SUPPORTED_FIF_FLAGS;
|
|
|
|
|
2010-01-03 17:20:01 +08:00
|
|
|
/*
|
|
|
|
* If multicast parameter (as returned by zd_op_prepare_multicast)
|
|
|
|
* has changed, no bit in changed_flags is set. To handle this
|
|
|
|
* situation, we do not return if changed_flags is 0. If we do so,
|
|
|
|
* we will have some issue with IPv6 which uses multicast for link
|
|
|
|
* layer address resolution.
|
|
|
|
*/
|
2009-08-17 22:16:53 +08:00
|
|
|
if (*new_flags & (FIF_PROMISC_IN_BSS | FIF_ALLMULTI))
|
2007-11-19 23:00:29 +08:00
|
|
|
zd_mc_add_all(&hash);
|
|
|
|
|
|
|
|
spin_lock_irqsave(&mac->lock, flags);
|
|
|
|
mac->pass_failed_fcs = !!(*new_flags & FIF_FCSFAIL);
|
|
|
|
mac->pass_ctrl = !!(*new_flags & FIF_CONTROL);
|
|
|
|
mac->multicast_hash = hash;
|
|
|
|
spin_unlock_irqrestore(&mac->lock, flags);
|
2009-08-17 22:16:53 +08:00
|
|
|
|
2011-02-01 02:47:46 +08:00
|
|
|
zd_chip_set_multicast_hash(&mac->chip, &hash);
|
2007-11-19 23:00:29 +08:00
|
|
|
|
2011-02-01 02:47:46 +08:00
|
|
|
if (changed_flags & FIF_CONTROL) {
|
|
|
|
r = set_rx_filter(mac);
|
|
|
|
if (r)
|
|
|
|
dev_err(zd_mac_dev(mac), "set_rx_filter error %d\n", r);
|
|
|
|
}
|
2007-11-19 23:00:29 +08:00
|
|
|
|
|
|
|
/* no handling required for FIF_OTHER_BSS as we don't currently
|
|
|
|
* do BSSID filtering */
|
|
|
|
/* FIXME: in future it would be nice to enable the probe response
|
|
|
|
* filter (so that the driver doesn't see them) until
|
|
|
|
* FIF_BCN_PRBRESP_PROMISC is set. however due to atomicity here, we'd
|
|
|
|
* have to schedule work to enable prbresp reception, which might
|
|
|
|
* happen too late. For now we'll just listen and forward them all the
|
|
|
|
* time. */
|
[PATCH] ZyDAS ZD1211 USB-WLAN driver
There are 60+ USB wifi adapters available on the market based on the ZyDAS
ZD1211 chip.
Unlike the predecessor (ZD1201), ZD1211 does not have a hardware MAC, so most
data operations are coordinated by the device driver. The ZD1211 chip sits
alongside an RF transceiver which is also controlled by the driver. Our driver
currently supports 2 RF types, we know of one other available in a few marketed
products which we will be supporting soon.
Our driver also supports the newer revision of ZD1211, called ZD1211B. The
initialization and RF operations are slightly different for the new revision,
but the main difference is 802.11e support. Our driver does not support the
QoS features yet, but we think we know how to use them.
This driver is based on ZyDAS's own GPL driver available from www.zydas.com.tw.
ZyDAS engineers have been responsive and supportive of our efforts, so thumbs
up to them. Additionally, the firmware is redistributable and they have
provided device specs.
This driver has been written primarily by Ulrich Kunitz and myself. Graham
Gower, Greg KH, Remco and Bryan Rittmeyer have also contributed. The
developers of ieee80211 and softmac have made our lives so much easier- thanks!
We maintain a small info-page: http://zd1211.ath.cx/wiki/DriverRewrite
If there is enough time for review, we would like to aim for inclusion in
2.6.18. The driver works nicely as a STA, and can connect to both open and
encrypted networks (we are using software-based encryption for now). We will
work towards supporting more advanced features in the future (ad-hoc, master
mode, 802.11a, ...).
Signed-off-by: Daniel Drake <dsd@gentoo.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2006-06-03 00:11:32 +08:00
|
|
|
}
|
|
|
|
|
2011-02-01 02:47:56 +08:00
|
|
|
static void set_rts_cts(struct zd_mac *mac, unsigned int short_preamble)
|
[PATCH] ZyDAS ZD1211 USB-WLAN driver
There are 60+ USB wifi adapters available on the market based on the ZyDAS
ZD1211 chip.
Unlike the predecessor (ZD1201), ZD1211 does not have a hardware MAC, so most
data operations are coordinated by the device driver. The ZD1211 chip sits
alongside an RF transceiver which is also controlled by the driver. Our driver
currently supports 2 RF types, we know of one other available in a few marketed
products which we will be supporting soon.
Our driver also supports the newer revision of ZD1211, called ZD1211B. The
initialization and RF operations are slightly different for the new revision,
but the main difference is 802.11e support. Our driver does not support the
QoS features yet, but we think we know how to use them.
This driver is based on ZyDAS's own GPL driver available from www.zydas.com.tw.
ZyDAS engineers have been responsive and supportive of our efforts, so thumbs
up to them. Additionally, the firmware is redistributable and they have
provided device specs.
This driver has been written primarily by Ulrich Kunitz and myself. Graham
Gower, Greg KH, Remco and Bryan Rittmeyer have also contributed. The
developers of ieee80211 and softmac have made our lives so much easier- thanks!
We maintain a small info-page: http://zd1211.ath.cx/wiki/DriverRewrite
If there is enough time for review, we would like to aim for inclusion in
2.6.18. The driver works nicely as a STA, and can connect to both open and
encrypted networks (we are using software-based encryption for now). We will
work towards supporting more advanced features in the future (ad-hoc, master
mode, 802.11a, ...).
Signed-off-by: Daniel Drake <dsd@gentoo.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2006-06-03 00:11:32 +08:00
|
|
|
{
|
2007-11-19 23:00:29 +08:00
|
|
|
mutex_lock(&mac->chip.mutex);
|
|
|
|
zd_chip_set_rts_cts_rate_locked(&mac->chip, short_preamble);
|
|
|
|
mutex_unlock(&mac->chip.mutex);
|
[PATCH] ZyDAS ZD1211 USB-WLAN driver
There are 60+ USB wifi adapters available on the market based on the ZyDAS
ZD1211 chip.
Unlike the predecessor (ZD1201), ZD1211 does not have a hardware MAC, so most
data operations are coordinated by the device driver. The ZD1211 chip sits
alongside an RF transceiver which is also controlled by the driver. Our driver
currently supports 2 RF types, we know of one other available in a few marketed
products which we will be supporting soon.
Our driver also supports the newer revision of ZD1211, called ZD1211B. The
initialization and RF operations are slightly different for the new revision,
but the main difference is 802.11e support. Our driver does not support the
QoS features yet, but we think we know how to use them.
This driver is based on ZyDAS's own GPL driver available from www.zydas.com.tw.
ZyDAS engineers have been responsive and supportive of our efforts, so thumbs
up to them. Additionally, the firmware is redistributable and they have
provided device specs.
This driver has been written primarily by Ulrich Kunitz and myself. Graham
Gower, Greg KH, Remco and Bryan Rittmeyer have also contributed. The
developers of ieee80211 and softmac have made our lives so much easier- thanks!
We maintain a small info-page: http://zd1211.ath.cx/wiki/DriverRewrite
If there is enough time for review, we would like to aim for inclusion in
2.6.18. The driver works nicely as a STA, and can connect to both open and
encrypted networks (we are using software-based encryption for now). We will
work towards supporting more advanced features in the future (ad-hoc, master
mode, 802.11a, ...).
Signed-off-by: Daniel Drake <dsd@gentoo.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2006-06-03 00:11:32 +08:00
|
|
|
}
|
|
|
|
|
2007-12-28 21:32:58 +08:00
|
|
|
static void zd_op_bss_info_changed(struct ieee80211_hw *hw,
|
|
|
|
struct ieee80211_vif *vif,
|
|
|
|
struct ieee80211_bss_conf *bss_conf,
|
|
|
|
u32 changes)
|
[PATCH] ZyDAS ZD1211 USB-WLAN driver
There are 60+ USB wifi adapters available on the market based on the ZyDAS
ZD1211 chip.
Unlike the predecessor (ZD1201), ZD1211 does not have a hardware MAC, so most
data operations are coordinated by the device driver. The ZD1211 chip sits
alongside an RF transceiver which is also controlled by the driver. Our driver
currently supports 2 RF types, we know of one other available in a few marketed
products which we will be supporting soon.
Our driver also supports the newer revision of ZD1211, called ZD1211B. The
initialization and RF operations are slightly different for the new revision,
but the main difference is 802.11e support. Our driver does not support the
QoS features yet, but we think we know how to use them.
This driver is based on ZyDAS's own GPL driver available from www.zydas.com.tw.
ZyDAS engineers have been responsive and supportive of our efforts, so thumbs
up to them. Additionally, the firmware is redistributable and they have
provided device specs.
This driver has been written primarily by Ulrich Kunitz and myself. Graham
Gower, Greg KH, Remco and Bryan Rittmeyer have also contributed. The
developers of ieee80211 and softmac have made our lives so much easier- thanks!
We maintain a small info-page: http://zd1211.ath.cx/wiki/DriverRewrite
If there is enough time for review, we would like to aim for inclusion in
2.6.18. The driver works nicely as a STA, and can connect to both open and
encrypted networks (we are using software-based encryption for now). We will
work towards supporting more advanced features in the future (ad-hoc, master
mode, 802.11a, ...).
Signed-off-by: Daniel Drake <dsd@gentoo.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2006-06-03 00:11:32 +08:00
|
|
|
{
|
2007-11-19 23:00:29 +08:00
|
|
|
struct zd_mac *mac = zd_hw_mac(hw);
|
2009-04-23 22:13:26 +08:00
|
|
|
int associated;
|
2007-11-19 23:00:29 +08:00
|
|
|
|
|
|
|
dev_dbg_f(zd_mac_dev(mac), "changes: %x\n", changes);
|
|
|
|
|
2009-04-23 22:13:26 +08:00
|
|
|
if (mac->type == NL80211_IFTYPE_MESH_POINT ||
|
2011-02-01 02:50:21 +08:00
|
|
|
mac->type == NL80211_IFTYPE_ADHOC ||
|
|
|
|
mac->type == NL80211_IFTYPE_AP) {
|
2009-04-23 22:13:26 +08:00
|
|
|
associated = true;
|
|
|
|
if (changes & BSS_CHANGED_BEACON) {
|
|
|
|
struct sk_buff *beacon = ieee80211_beacon_get(hw, vif);
|
|
|
|
|
|
|
|
if (beacon) {
|
2011-02-01 02:48:55 +08:00
|
|
|
zd_chip_disable_hwint(&mac->chip);
|
2011-06-20 19:42:49 +08:00
|
|
|
zd_mac_config_beacon(hw, beacon, false);
|
2011-02-01 02:48:55 +08:00
|
|
|
zd_chip_enable_hwint(&mac->chip);
|
2009-04-23 22:13:26 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (changes & BSS_CHANGED_BEACON_ENABLED) {
|
2011-02-01 02:48:25 +08:00
|
|
|
u16 interval = 0;
|
|
|
|
u8 period = 0;
|
2009-04-23 22:13:26 +08:00
|
|
|
|
2011-02-01 02:48:25 +08:00
|
|
|
if (bss_conf->enable_beacon) {
|
|
|
|
period = bss_conf->dtim_period;
|
|
|
|
interval = bss_conf->beacon_int;
|
|
|
|
}
|
2009-04-23 22:13:26 +08:00
|
|
|
|
2011-02-01 02:48:55 +08:00
|
|
|
spin_lock_irq(&mac->lock);
|
|
|
|
mac->beacon.period = period;
|
|
|
|
mac->beacon.interval = interval;
|
|
|
|
mac->beacon.last_update = jiffies;
|
|
|
|
spin_unlock_irq(&mac->lock);
|
|
|
|
|
2011-02-01 02:48:25 +08:00
|
|
|
zd_set_beacon_interval(&mac->chip, interval, period,
|
|
|
|
mac->type);
|
2009-04-23 22:13:26 +08:00
|
|
|
}
|
|
|
|
} else
|
|
|
|
associated = is_valid_ether_addr(bss_conf->bssid);
|
|
|
|
|
|
|
|
spin_lock_irq(&mac->lock);
|
|
|
|
mac->associated = associated;
|
|
|
|
spin_unlock_irq(&mac->lock);
|
|
|
|
|
|
|
|
/* TODO: do hardware bssid filtering */
|
|
|
|
|
2007-12-28 21:32:58 +08:00
|
|
|
if (changes & BSS_CHANGED_ERP_PREAMBLE) {
|
2011-02-01 02:47:56 +08:00
|
|
|
spin_lock_irq(&mac->lock);
|
2007-12-28 21:32:58 +08:00
|
|
|
mac->short_preamble = bss_conf->use_short_preamble;
|
2011-02-01 02:47:56 +08:00
|
|
|
spin_unlock_irq(&mac->lock);
|
|
|
|
|
|
|
|
set_rts_cts(mac, bss_conf->use_short_preamble);
|
2007-11-19 23:00:29 +08:00
|
|
|
}
|
[PATCH] ZyDAS ZD1211 USB-WLAN driver
There are 60+ USB wifi adapters available on the market based on the ZyDAS
ZD1211 chip.
Unlike the predecessor (ZD1201), ZD1211 does not have a hardware MAC, so most
data operations are coordinated by the device driver. The ZD1211 chip sits
alongside an RF transceiver which is also controlled by the driver. Our driver
currently supports 2 RF types, we know of one other available in a few marketed
products which we will be supporting soon.
Our driver also supports the newer revision of ZD1211, called ZD1211B. The
initialization and RF operations are slightly different for the new revision,
but the main difference is 802.11e support. Our driver does not support the
QoS features yet, but we think we know how to use them.
This driver is based on ZyDAS's own GPL driver available from www.zydas.com.tw.
ZyDAS engineers have been responsive and supportive of our efforts, so thumbs
up to them. Additionally, the firmware is redistributable and they have
provided device specs.
This driver has been written primarily by Ulrich Kunitz and myself. Graham
Gower, Greg KH, Remco and Bryan Rittmeyer have also contributed. The
developers of ieee80211 and softmac have made our lives so much easier- thanks!
We maintain a small info-page: http://zd1211.ath.cx/wiki/DriverRewrite
If there is enough time for review, we would like to aim for inclusion in
2.6.18. The driver works nicely as a STA, and can connect to both open and
encrypted networks (we are using software-based encryption for now). We will
work towards supporting more advanced features in the future (ad-hoc, master
mode, 802.11a, ...).
Signed-off-by: Daniel Drake <dsd@gentoo.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2006-06-03 00:11:32 +08:00
|
|
|
}
|
|
|
|
|
2011-09-21 19:06:11 +08:00
|
|
|
static u64 zd_op_get_tsf(struct ieee80211_hw *hw, struct ieee80211_vif *vif)
|
2009-02-25 07:49:18 +08:00
|
|
|
{
|
|
|
|
struct zd_mac *mac = zd_hw_mac(hw);
|
|
|
|
return zd_chip_get_tsf(&mac->chip);
|
|
|
|
}
|
|
|
|
|
2007-11-19 23:00:29 +08:00
|
|
|
static const struct ieee80211_ops zd_ops = {
|
|
|
|
.tx = zd_op_tx,
|
|
|
|
.start = zd_op_start,
|
|
|
|
.stop = zd_op_stop,
|
|
|
|
.add_interface = zd_op_add_interface,
|
|
|
|
.remove_interface = zd_op_remove_interface,
|
|
|
|
.config = zd_op_config,
|
2009-08-17 22:16:53 +08:00
|
|
|
.prepare_multicast = zd_op_prepare_multicast,
|
2007-11-19 23:00:29 +08:00
|
|
|
.configure_filter = zd_op_configure_filter,
|
2007-12-28 21:32:58 +08:00
|
|
|
.bss_info_changed = zd_op_bss_info_changed,
|
2009-02-25 07:49:18 +08:00
|
|
|
.get_tsf = zd_op_get_tsf,
|
2007-11-19 23:00:29 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
struct ieee80211_hw *zd_mac_alloc_hw(struct usb_interface *intf)
|
[PATCH] ZyDAS ZD1211 USB-WLAN driver
There are 60+ USB wifi adapters available on the market based on the ZyDAS
ZD1211 chip.
Unlike the predecessor (ZD1201), ZD1211 does not have a hardware MAC, so most
data operations are coordinated by the device driver. The ZD1211 chip sits
alongside an RF transceiver which is also controlled by the driver. Our driver
currently supports 2 RF types, we know of one other available in a few marketed
products which we will be supporting soon.
Our driver also supports the newer revision of ZD1211, called ZD1211B. The
initialization and RF operations are slightly different for the new revision,
but the main difference is 802.11e support. Our driver does not support the
QoS features yet, but we think we know how to use them.
This driver is based on ZyDAS's own GPL driver available from www.zydas.com.tw.
ZyDAS engineers have been responsive and supportive of our efforts, so thumbs
up to them. Additionally, the firmware is redistributable and they have
provided device specs.
This driver has been written primarily by Ulrich Kunitz and myself. Graham
Gower, Greg KH, Remco and Bryan Rittmeyer have also contributed. The
developers of ieee80211 and softmac have made our lives so much easier- thanks!
We maintain a small info-page: http://zd1211.ath.cx/wiki/DriverRewrite
If there is enough time for review, we would like to aim for inclusion in
2.6.18. The driver works nicely as a STA, and can connect to both open and
encrypted networks (we are using software-based encryption for now). We will
work towards supporting more advanced features in the future (ad-hoc, master
mode, 802.11a, ...).
Signed-off-by: Daniel Drake <dsd@gentoo.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2006-06-03 00:11:32 +08:00
|
|
|
{
|
2007-11-19 23:00:29 +08:00
|
|
|
struct zd_mac *mac;
|
|
|
|
struct ieee80211_hw *hw;
|
[PATCH] ZyDAS ZD1211 USB-WLAN driver
There are 60+ USB wifi adapters available on the market based on the ZyDAS
ZD1211 chip.
Unlike the predecessor (ZD1201), ZD1211 does not have a hardware MAC, so most
data operations are coordinated by the device driver. The ZD1211 chip sits
alongside an RF transceiver which is also controlled by the driver. Our driver
currently supports 2 RF types, we know of one other available in a few marketed
products which we will be supporting soon.
Our driver also supports the newer revision of ZD1211, called ZD1211B. The
initialization and RF operations are slightly different for the new revision,
but the main difference is 802.11e support. Our driver does not support the
QoS features yet, but we think we know how to use them.
This driver is based on ZyDAS's own GPL driver available from www.zydas.com.tw.
ZyDAS engineers have been responsive and supportive of our efforts, so thumbs
up to them. Additionally, the firmware is redistributable and they have
provided device specs.
This driver has been written primarily by Ulrich Kunitz and myself. Graham
Gower, Greg KH, Remco and Bryan Rittmeyer have also contributed. The
developers of ieee80211 and softmac have made our lives so much easier- thanks!
We maintain a small info-page: http://zd1211.ath.cx/wiki/DriverRewrite
If there is enough time for review, we would like to aim for inclusion in
2.6.18. The driver works nicely as a STA, and can connect to both open and
encrypted networks (we are using software-based encryption for now). We will
work towards supporting more advanced features in the future (ad-hoc, master
mode, 802.11a, ...).
Signed-off-by: Daniel Drake <dsd@gentoo.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2006-06-03 00:11:32 +08:00
|
|
|
|
2007-11-19 23:00:29 +08:00
|
|
|
hw = ieee80211_alloc_hw(sizeof(struct zd_mac), &zd_ops);
|
|
|
|
if (!hw) {
|
|
|
|
dev_dbg_f(&intf->dev, "out of memory\n");
|
|
|
|
return NULL;
|
2006-08-30 06:50:29 +08:00
|
|
|
}
|
2007-11-19 23:00:29 +08:00
|
|
|
|
|
|
|
mac = zd_hw_mac(hw);
|
|
|
|
|
|
|
|
memset(mac, 0, sizeof(*mac));
|
|
|
|
spin_lock_init(&mac->lock);
|
|
|
|
mac->hw = hw;
|
|
|
|
|
2008-09-11 06:01:58 +08:00
|
|
|
mac->type = NL80211_IFTYPE_UNSPECIFIED;
|
2007-11-19 23:00:29 +08:00
|
|
|
|
|
|
|
memcpy(mac->channels, zd_channels, sizeof(zd_channels));
|
|
|
|
memcpy(mac->rates, zd_rates, sizeof(zd_rates));
|
2008-01-25 02:38:38 +08:00
|
|
|
mac->band.n_bitrates = ARRAY_SIZE(zd_rates);
|
|
|
|
mac->band.bitrates = mac->rates;
|
|
|
|
mac->band.n_channels = ARRAY_SIZE(zd_channels);
|
|
|
|
mac->band.channels = mac->channels;
|
|
|
|
|
|
|
|
hw->wiphy->bands[IEEE80211_BAND_2GHZ] = &mac->band;
|
|
|
|
|
2008-03-04 04:32:15 +08:00
|
|
|
hw->flags = IEEE80211_HW_RX_INCLUDES_FCS |
|
2011-02-01 02:48:35 +08:00
|
|
|
IEEE80211_HW_SIGNAL_UNSPEC |
|
|
|
|
IEEE80211_HW_HOST_BROADCAST_PS_BUFFERING;
|
2007-11-19 23:00:29 +08:00
|
|
|
|
2008-08-30 07:26:43 +08:00
|
|
|
hw->wiphy->interface_modes =
|
|
|
|
BIT(NL80211_IFTYPE_MESH_POINT) |
|
|
|
|
BIT(NL80211_IFTYPE_STATION) |
|
2011-02-01 02:50:21 +08:00
|
|
|
BIT(NL80211_IFTYPE_ADHOC) |
|
|
|
|
BIT(NL80211_IFTYPE_AP);
|
2008-08-30 07:26:43 +08:00
|
|
|
|
2008-05-09 01:15:40 +08:00
|
|
|
hw->max_signal = 100;
|
2007-11-19 23:00:29 +08:00
|
|
|
hw->queues = 1;
|
|
|
|
hw->extra_tx_headroom = sizeof(struct zd_ctrlset);
|
|
|
|
|
2009-10-22 18:04:52 +08:00
|
|
|
/*
|
|
|
|
* Tell mac80211 that we support multi rate retries
|
|
|
|
*/
|
|
|
|
hw->max_rates = IEEE80211_TX_MAX_RATES;
|
|
|
|
hw->max_rate_tries = 18; /* 9 rates * 2 retries/rate */
|
|
|
|
|
2007-11-19 23:00:29 +08:00
|
|
|
skb_queue_head_init(&mac->ack_wait_queue);
|
2009-10-22 18:04:52 +08:00
|
|
|
mac->ack_pending = 0;
|
2007-11-19 23:00:29 +08:00
|
|
|
|
|
|
|
zd_chip_init(&mac->chip, hw, intf);
|
|
|
|
housekeeping_init(mac);
|
2011-02-01 02:48:55 +08:00
|
|
|
beacon_init(mac);
|
2008-03-04 04:32:15 +08:00
|
|
|
INIT_WORK(&mac->process_intr, zd_process_intr);
|
2007-11-19 23:00:29 +08:00
|
|
|
|
|
|
|
SET_IEEE80211_DEV(hw, &intf->dev);
|
|
|
|
return hw;
|
[PATCH] ZyDAS ZD1211 USB-WLAN driver
There are 60+ USB wifi adapters available on the market based on the ZyDAS
ZD1211 chip.
Unlike the predecessor (ZD1201), ZD1211 does not have a hardware MAC, so most
data operations are coordinated by the device driver. The ZD1211 chip sits
alongside an RF transceiver which is also controlled by the driver. Our driver
currently supports 2 RF types, we know of one other available in a few marketed
products which we will be supporting soon.
Our driver also supports the newer revision of ZD1211, called ZD1211B. The
initialization and RF operations are slightly different for the new revision,
but the main difference is 802.11e support. Our driver does not support the
QoS features yet, but we think we know how to use them.
This driver is based on ZyDAS's own GPL driver available from www.zydas.com.tw.
ZyDAS engineers have been responsive and supportive of our efforts, so thumbs
up to them. Additionally, the firmware is redistributable and they have
provided device specs.
This driver has been written primarily by Ulrich Kunitz and myself. Graham
Gower, Greg KH, Remco and Bryan Rittmeyer have also contributed. The
developers of ieee80211 and softmac have made our lives so much easier- thanks!
We maintain a small info-page: http://zd1211.ath.cx/wiki/DriverRewrite
If there is enough time for review, we would like to aim for inclusion in
2.6.18. The driver works nicely as a STA, and can connect to both open and
encrypted networks (we are using software-based encryption for now). We will
work towards supporting more advanced features in the future (ad-hoc, master
mode, 802.11a, ...).
Signed-off-by: Daniel Drake <dsd@gentoo.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2006-06-03 00:11:32 +08:00
|
|
|
}
|
|
|
|
|
2011-02-01 02:48:55 +08:00
|
|
|
#define BEACON_WATCHDOG_DELAY round_jiffies_relative(HZ)
|
|
|
|
|
|
|
|
static void beacon_watchdog_handler(struct work_struct *work)
|
|
|
|
{
|
|
|
|
struct zd_mac *mac =
|
|
|
|
container_of(work, struct zd_mac, beacon.watchdog_work.work);
|
|
|
|
struct sk_buff *beacon;
|
|
|
|
unsigned long timeout;
|
|
|
|
int interval, period;
|
|
|
|
|
|
|
|
if (!test_bit(ZD_DEVICE_RUNNING, &mac->flags))
|
|
|
|
goto rearm;
|
|
|
|
if (mac->type != NL80211_IFTYPE_AP || !mac->vif)
|
|
|
|
goto rearm;
|
|
|
|
|
|
|
|
spin_lock_irq(&mac->lock);
|
|
|
|
interval = mac->beacon.interval;
|
|
|
|
period = mac->beacon.period;
|
2011-06-20 19:42:54 +08:00
|
|
|
timeout = mac->beacon.last_update +
|
|
|
|
msecs_to_jiffies(interval * 1024 / 1000) * 3;
|
2011-02-01 02:48:55 +08:00
|
|
|
spin_unlock_irq(&mac->lock);
|
|
|
|
|
|
|
|
if (interval > 0 && time_is_before_jiffies(timeout)) {
|
|
|
|
dev_dbg_f(zd_mac_dev(mac), "beacon interrupt stalled, "
|
|
|
|
"restarting. "
|
|
|
|
"(interval: %d, dtim: %d)\n",
|
|
|
|
interval, period);
|
|
|
|
|
|
|
|
zd_chip_disable_hwint(&mac->chip);
|
|
|
|
|
|
|
|
beacon = ieee80211_beacon_get(mac->hw, mac->vif);
|
|
|
|
if (beacon) {
|
2011-06-20 19:42:39 +08:00
|
|
|
zd_mac_free_cur_beacon(mac);
|
|
|
|
|
2011-06-20 19:42:49 +08:00
|
|
|
zd_mac_config_beacon(mac->hw, beacon, false);
|
2011-02-01 02:48:55 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
zd_set_beacon_interval(&mac->chip, interval, period, mac->type);
|
|
|
|
|
|
|
|
zd_chip_enable_hwint(&mac->chip);
|
|
|
|
|
|
|
|
spin_lock_irq(&mac->lock);
|
|
|
|
mac->beacon.last_update = jiffies;
|
|
|
|
spin_unlock_irq(&mac->lock);
|
|
|
|
}
|
|
|
|
|
|
|
|
rearm:
|
|
|
|
queue_delayed_work(zd_workqueue, &mac->beacon.watchdog_work,
|
|
|
|
BEACON_WATCHDOG_DELAY);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void beacon_init(struct zd_mac *mac)
|
|
|
|
{
|
|
|
|
INIT_DELAYED_WORK(&mac->beacon.watchdog_work, beacon_watchdog_handler);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void beacon_enable(struct zd_mac *mac)
|
|
|
|
{
|
|
|
|
dev_dbg_f(zd_mac_dev(mac), "\n");
|
|
|
|
|
|
|
|
mac->beacon.last_update = jiffies;
|
|
|
|
queue_delayed_work(zd_workqueue, &mac->beacon.watchdog_work,
|
|
|
|
BEACON_WATCHDOG_DELAY);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void beacon_disable(struct zd_mac *mac)
|
|
|
|
{
|
|
|
|
dev_dbg_f(zd_mac_dev(mac), "\n");
|
|
|
|
cancel_delayed_work_sync(&mac->beacon.watchdog_work);
|
2011-06-20 19:42:39 +08:00
|
|
|
|
|
|
|
zd_mac_free_cur_beacon(mac);
|
2011-02-01 02:48:55 +08:00
|
|
|
}
|
|
|
|
|
2006-09-13 09:42:38 +08:00
|
|
|
#define LINK_LED_WORK_DELAY HZ
|
|
|
|
|
2006-11-22 22:57:56 +08:00
|
|
|
static void link_led_handler(struct work_struct *work)
|
2006-09-13 09:42:38 +08:00
|
|
|
{
|
2006-11-22 22:57:56 +08:00
|
|
|
struct zd_mac *mac =
|
|
|
|
container_of(work, struct zd_mac, housekeeping.link_led_work.work);
|
2006-09-13 09:42:38 +08:00
|
|
|
struct zd_chip *chip = &mac->chip;
|
|
|
|
int is_associated;
|
|
|
|
int r;
|
|
|
|
|
2011-02-01 02:49:52 +08:00
|
|
|
if (!test_bit(ZD_DEVICE_RUNNING, &mac->flags))
|
|
|
|
goto requeue;
|
|
|
|
|
2006-09-13 09:42:38 +08:00
|
|
|
spin_lock_irq(&mac->lock);
|
2007-11-19 23:00:29 +08:00
|
|
|
is_associated = mac->associated;
|
2006-09-13 09:42:38 +08:00
|
|
|
spin_unlock_irq(&mac->lock);
|
|
|
|
|
|
|
|
r = zd_chip_control_leds(chip,
|
2009-08-05 05:04:17 +08:00
|
|
|
is_associated ? ZD_LED_ASSOCIATED : ZD_LED_SCANNING);
|
2006-09-13 09:42:38 +08:00
|
|
|
if (r)
|
2007-11-19 23:00:29 +08:00
|
|
|
dev_dbg_f(zd_mac_dev(mac), "zd_chip_control_leds error %d\n", r);
|
2006-09-13 09:42:38 +08:00
|
|
|
|
2011-02-01 02:49:52 +08:00
|
|
|
requeue:
|
2006-09-13 09:42:38 +08:00
|
|
|
queue_delayed_work(zd_workqueue, &mac->housekeeping.link_led_work,
|
|
|
|
LINK_LED_WORK_DELAY);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void housekeeping_init(struct zd_mac *mac)
|
|
|
|
{
|
2006-11-22 22:57:56 +08:00
|
|
|
INIT_DELAYED_WORK(&mac->housekeeping.link_led_work, link_led_handler);
|
2006-09-13 09:42:38 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
static void housekeeping_enable(struct zd_mac *mac)
|
|
|
|
{
|
|
|
|
dev_dbg_f(zd_mac_dev(mac), "\n");
|
|
|
|
queue_delayed_work(zd_workqueue, &mac->housekeeping.link_led_work,
|
|
|
|
0);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void housekeeping_disable(struct zd_mac *mac)
|
|
|
|
{
|
|
|
|
dev_dbg_f(zd_mac_dev(mac), "\n");
|
2010-12-14 23:21:17 +08:00
|
|
|
cancel_delayed_work_sync(&mac->housekeeping.link_led_work);
|
2009-08-05 05:04:17 +08:00
|
|
|
zd_chip_control_leds(&mac->chip, ZD_LED_OFF);
|
2006-09-13 09:42:38 +08:00
|
|
|
}
|