added injection support to compat-wireless. a few old patches were added and will be updated or removed

This commit is contained in:
Zero_Chaos 2009-05-26 19:02:35 +00:00
parent 4de1c23742
commit cf19de7c75
14 changed files with 1124 additions and 2 deletions

View file

@ -1,3 +1,15 @@
AUX 4000_mac80211_2.6.28-rc4-wl_frag+ack_v3.patch 1063 RMD160 0b8d08feefbf0de9d532c73066fda755ffeaf6f9 SHA1 0eea3b55ed7cb436a1464d35345d329cc47a0137 SHA256 4ae0d3926ed563cb961df0d3236b321ad86698843a2a6df26476657c5e20dac0
AUX 4002_mac80211-2.6.29-fix-tx-ctl-no-ack-retry-count.patch 559 RMD160 f6fb33ff15e989e280f5a6f230f88a36a0284e3e SHA1 ef5fb0bc41a6a169d82a8c04eae07e94df68b807 SHA256 2c9222e0c6aaafabac091766c7e0a71442f0e9521ec1c65fc7024fbca60a3354
AUX 4004_zd1211rw-2.6.28.patch 1412 RMD160 70c7cd8a8e03199b33c76ff16974d4a4980b846f SHA1 0bf4c9df519246ffbee94b7ffeb454b2408b8dfb SHA256 6696295acb2a8d12a33208525cba9ce8bd2971c9c0adaabb31debfa9ec15c7be
AUX 4007_ath5k-pass-failed-crc.patch 568 RMD160 1f38abc77887fc23b5f09b1ddd7e4159ab190e91 SHA1 22ecfbd59b4e7f1038ac9415003e182cddae8df2 SHA256 12e8549aa3fd85d83fc7c80ab2dbd4ed5a22ae446af6979bfbdd4a3c2d4e9fe6
AUX 4012_openwrt-b43-disable_qos_when_openfw.patch 721 RMD160 cd67c2425cd5b29f637781652a49a951a9ffda21 SHA1 382947ee332836c43c4eeb32eb8358b88e18fd22 SHA256 f03374faa0d41a5dca7e20079d7a7bd59aebd309b56aa6c7f7108b596d3f0da2
AUX failed_ath5k-frequency-chaos-2.6.28.patch 5787 RMD160 978b39113ebdc4ec1543bd4379d4428431524cb6 SHA1 a1b9268aedeb0d9035fd13214fe465145f1c5334 SHA256 8e9e0888e890a2970274a7ba9d40d75e01ebaedb0e16700d8994b9ecfe921185
AUX failed_ath5k-injection-2.6.28.patch 737 RMD160 00e2360da1291228e1cfb195cceefae37198a62d SHA1 be353ccf984d6e87fe050ebcd19f935ef1f4212a SHA256 fe8d9355c0381675b41589a9c092460c12af050a7de09aca8a394dc4e0e604be
AUX failed_b43-openfwwf-loader.patch 11448 RMD160 2a43ab1047e4a4ba344c91509766f9f24c04bd75 SHA1 bbf9265ea03696fb772dc7352327d69c8d85b80f SHA256 6624841e6f7bb57f45c60bfe91ddb3613e70acbb206ac37240cd95d277789849
AUX failed_ieee80211_inject-2.6.22.patch 772 RMD160 ff6f70125009e3cd151ad12d8c2f1aa9333f5556 SHA1 8a1773b86a2742a4ae63f61dda48231b10b591bf SHA256 7403780cd3df720439f54b6cad88a803aacc0260af8fbbab0cfa25e523ae2ae9
AUX failed_ipw2200_ipw2200-1.2.1-inject.patch 2207 RMD160 b7ff866af15d91bc882f8c9f0f4f743e63e53b6f SHA1 2ff94a5031c826044fee3508e479cd04bb3abd00 SHA256 21cd575d13ef9a6d2beafea9070ca68296b4f187f2d46d23ea450b8eb1c78761
AUX failed_linux-wlanng-kernel-2.6.28.patch 11623 RMD160 23d11bb21ba059b7a0d7a2c597e5ae8224670dde SHA1 8d8d11912160dd8b38b805c928ea746ff9192ba8 SHA256 fd4bd200617c5f28e3a0ae58e5fa02f80279ad98aafed6c2e3d5b249a9b617c6
AUX failed_openembedded-orinoco-remove-all-which-are-in-hostap-HACK.patch 6606 RMD160 e479eb0e796aec521e2269d50e9ccc4426e1da55 SHA1 c76220bb8f3a118a224e555517b7e111603da47e SHA256 6b761693587871591fc0ce96273d37f769f61d28f637c1692d931300c4f04504
AUX whynot.patch 2981 RMD160 1e55bb970bb1240e5fce8a8758d78a66a8b5133b SHA1 230a45817a92882c3a30995d29607dfa918667c1 SHA256 9f2bd3bb62603bc8a1f1f50de283a3d01d1d2bda14b78482625b38102d7662ee
DIST compat-wireless-2.6.30-rc6.tar.bz2 1678784 RMD160 f0d69b99d37732a39ba01fdd869d150db8a55037 SHA1 1e91215069ba8cd46654836279dacc964d9dc854 SHA256 6b2beba044860624d44a0a8cc5a701b1243d9dd89f7d028daca12b4ca41d6512
EBUILD compat-wireless-2.6.30_rc6.ebuild 1492 RMD160 84bd74d308445c0710b201e78c2be187eae14f2d SHA1 c01e3dc4f1a260e6a47abb94fa3ae9b361af703a SHA256 72b51d2c275d542161c33ec6247f4d0b6b858fbe208648e3832d32707d9299bb
EBUILD compat-wireless-2.6.30_rc6.ebuild 1565 RMD160 e57c6d6217312fcf92899905c7debb41bd4ba285 SHA1 ba1a3727adabb63b42672a321340923a66ef0e24 SHA256 8e04a57a7a3d7bab3352e6905225e823ced42601de406bccd67246f0954e2eb7

View file

@ -17,7 +17,7 @@ inherit linux-mod linux-info
LICENSE="GPL-2"
SLOT="0"
KEYWORDS="amd64 x86"
IUSE="kernel_linux"
IUSE="kernel_linux +injection"
S=${WORKDIR}/${MY_P}
@ -30,6 +30,7 @@ S=${WORKDIR}/${MY_P}
#}
src_compile() {
if use injection; then epatch "${FILESDIR}"/40??_*.patch; fi
addpredict "${KERNEL_DIR}"
epatch "${FILESDIR}"/whynot.patch
# addpredict /lib/modules/"${KV_FULL}"

View file

@ -0,0 +1,27 @@
diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c
index 0855cac..221bed6 100644
--- a/net/mac80211/tx.c
+++ b/net/mac80211/tx.c
@@ -611,11 +611,19 @@ ieee80211_tx_h_sequence(struct ieee80211_tx_data *tx)
/*
* Packet injection may want to control the sequence
- * number, if we have no matching interface then we
- * neither assign one ourselves nor ask the driver to.
+ * number, so if an injected packet is found, skip
+ * renumbering it. Also make the packet NO_ACK to avoid
+ * excessive retries (ACKing and retrying should be
+ * handled by the injecting application).
+ * FIXME This may break hostapd and some other injectors.
+ * This should be done using a radiotap flag.
*/
- if (unlikely(!info->control.vif))
+ if (unlikely((info->flags & IEEE80211_TX_CTL_INJECTED) &&
+ !(tx->sdata->u.mntr_flags & MONITOR_FLAG_COOK_FRAMES))) {
+ if (!ieee80211_has_morefrags(hdr->frame_control))
+ info->flags |= IEEE80211_TX_CTL_NO_ACK;
return TX_CONTINUE;
+ }
if (unlikely(ieee80211_is_ctl(hdr->frame_control)))
return TX_CONTINUE;

View file

@ -0,0 +1,17 @@
tx.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c
index b47435d..751934b 100644
--- a/net/mac80211/tx.c
+++ b/net/mac80211/tx.c
@@ -539,7 +539,8 @@ ieee80211_tx_h_rate_ctrl(struct ieee80211_tx_data *tx)
if (tx->sta)
tx->sta->last_tx_rate = txrc.reported_rate;
- if (unlikely(!info->control.rates[0].count))
+ if (unlikely(!info->control.rates[0].count) ||
+ info->flags & IEEE80211_TX_CTL_NO_ACK)
info->control.rates[0].count = 1;
if (is_multicast_ether_addr(hdr->addr1)) {

View file

@ -0,0 +1,37 @@
diff -Naur linux-2.6.28-pentoo-r1-orig/drivers/net/wireless/zd1211rw/zd_mac.c linux-2.6.28-pentoo-r1-improved/drivers/net/wireless/zd1211rw/zd_mac.c
--- linux-2.6.28-pentoo-r1-orig/drivers/net/wireless/zd1211rw/zd_mac.c 2009-01-18 17:49:00.000000000 -0500
+++ linux-2.6.28-pentoo-r1-improved/drivers/net/wireless/zd1211rw/zd_mac.c 2009-01-18 18:46:44.000000000 -0500
@@ -191,14 +191,19 @@
static int set_rx_filter(struct zd_mac *mac)
{
unsigned long flags;
- u32 filter = STA_RX_FILTER;
+ struct zd_ioreq32 ioreqs[] = {
+ {CR_RX_FILTER, STA_RX_FILTER},
+ { CR_SNIFFER_ON, 0U },
+ };
spin_lock_irqsave(&mac->lock, flags);
- if (mac->pass_ctrl)
- filter |= RX_FILTER_CTRL;
+ if (mac->pass_ctrl) {
+ ioreqs[0].value |= 0xFFFFFFFF;
+ ioreqs[1].value = 0x1;
+ }
spin_unlock_irqrestore(&mac->lock, flags);
- return zd_iowrite32(&mac->chip, CR_RX_FILTER, filter);
+ return zd_iowrite32a(&mac->chip, ioreqs, ARRAY_SIZE(ioreqs));
}
static int set_mc_hash(struct zd_mac *mac)
@@ -657,7 +662,8 @@
/* Caller has to ensure that length >= sizeof(struct rx_status). */
status = (struct rx_status *)
(buffer + (length - sizeof(struct rx_status)));
- if (status->frame_status & ZD_RX_ERROR) {
+ if ((status->frame_status & ZD_RX_ERROR) ||
+ (status->frame_status & ~0x21)) {
if (mac->pass_failed_fcs &&
(status->frame_status & ZD_RX_CRC32_ERROR)) {
stats.flag |= RX_FLAG_FAILED_FCS_CRC;

View file

@ -0,0 +1,15 @@
diff -Naur linux-2.6.28/drivers/net/wireless/ath5k/base.c linux-2.6.28-chaos/drivers/net/wireless/ath5k/base.c
--- linux-2.6.28/drivers/net/wireless/ath5k/base.c 2008-12-24 18:26:37.000000000 -0500
+++ linux-2.6.28-chaos/drivers/net/wireless/ath5k/base.c 2009-02-06 21:38:43.000000000 -0500
@@ -1732,6 +1738,11 @@
goto accept;
}
+ /* Allow CRC errors through */
+ if (rs.rs_status & AR5K_RXERR_CRC) {
+ goto accept;
+ }
+
/* let crypto-error packets fall through in MNTR */
if ((rs.rs_status &
~(AR5K_RXERR_DECRYPT|AR5K_RXERR_MIC)) ||

View file

@ -0,0 +1,12 @@
diff -Naur linux-2.6.28-pentoo-r4/drivers/net/wireless/b43/main.c linux-2.6.28-pentoo-r4-patched/drivers/net/wireless/b43/main.c
--- linux-2.6.28-pentoo-r4/drivers/net/wireless/b43/main.c 2008-12-24 18:26:37.000000000 -0500
+++ linux-2.6.28-pentoo-r4-patched/drivers/net/wireless/b43/main.c 2009-04-08 00:03:57.000000000 -0400
@@ -2299,6 +2299,8 @@
b43info(dev->wl, "Loading OpenSource firmware version %u.%u%s\n",
dev->fw.rev, dev->fw.patch,
dev->fw.pcm_request_failed ? " (Hardware crypto not supported)" : "");
+ /* The OpenSource firmware does not support qos for now. */
+ b43_modparam_qos = 0;
} else {
b43info(dev->wl, "Loading firmware version %u.%u "
"(20%.2i-%.2i-%.2i %.2i:%.2i:%.2i)\n",

View file

@ -0,0 +1,152 @@
diff -Naur linux-2.6.28/drivers/net/wireless/ath5k/base.c linux-2.6.28-chaos/drivers/net/wireless/ath5k/base.c
--- linux-2.6.28/drivers/net/wireless/ath5k/base.c 2008-12-24 18:26:37.000000000 -0500
+++ linux-2.6.28-chaos/drivers/net/wireless/ath5k/base.c 2009-02-06 21:38:43.000000000 -0500
@@ -272,7 +272,7 @@
static void ath5k_detach(struct pci_dev *pdev,
struct ieee80211_hw *hw);
/* Channel/mode setup */
-static inline short ath5k_ieee2mhz(short chan);
+static inline short ath5k_ieee2mhz(int chan, unsigned int chfreq);
static unsigned int ath5k_copy_channels(struct ath5k_hw *ah,
struct ieee80211_channel *channels,
unsigned int mode,
@@ -848,12 +848,16 @@
* Convert IEEE channel number to MHz frequency.
*/
static inline short
-ath5k_ieee2mhz(short chan)
+ath5k_ieee2mhz(int chan, unsigned int chfreq)
{
- if (chan <= 14 || chan >= 27)
- return ieee80211chan2mhz(chan);
+ if (chfreq == CHANNEL_5GHZ)
+ return (chan + 1000) * 5;
else
- return 2212 + chan * 20;
+// XXX: This part needs to be fixed
+ if (chan <= 14 || chan >= 27)
+ return ieee80211chan2mhz(chan);
+ else
+ return 2212 + chan * 20;
}
static unsigned int
@@ -862,22 +866,25 @@
unsigned int mode,
unsigned int max)
{
- unsigned int i, count, size, chfreq, freq, ch;
+ unsigned int i, count, size, chfreq, freq;
+ int ch;
if (!test_bit(mode, ah->ah_modes))
return 0;
switch (mode) {
+ /* I don't even like channel numbers */
case AR5K_MODE_11A:
case AR5K_MODE_11A_TURBO:
- /* 1..220, but 2GHz frequencies are filtered by check_channel */
- size = 220 ;
+ size = 241 ; // going over 6.0GHz may be dangerous so I am limiting it
+ ch = -40; // might be able to push this to -201 or so, needs more testing
chfreq = CHANNEL_5GHZ;
break;
case AR5K_MODE_11B:
case AR5K_MODE_11G:
case AR5K_MODE_11G_TURBO:
- size = 26;
+ size = 70;
+ ch = -43;
chfreq = CHANNEL_2GHZ;
break;
default:
@@ -885,9 +892,8 @@
return 0;
}
- for (i = 0, count = 0; i < size && max > 0; i++) {
- ch = i + 1 ;
- freq = ath5k_ieee2mhz(ch);
+ for (i = 0, count = 0; i < size && max > 0; i++,ch++) {
+ freq = ath5k_ieee2mhz(ch,chfreq);
/* Check if channel is supported by the chipset */
if (!ath5k_channel_ok(ah, freq, chfreq))
diff -Naur linux-2.6.28/drivers/net/wireless/ath5k/base.h linux-2.6.28-chaos/drivers/net/wireless/ath5k/base.h
--- linux-2.6.28/drivers/net/wireless/ath5k/base.h 2008-12-24 18:26:37.000000000 -0500
+++ linux-2.6.28-chaos/drivers/net/wireless/ath5k/base.h 2009-02-06 21:38:43.000000000 -0500
@@ -93,11 +93,7 @@
};
-#if CHAN_DEBUG
-#define ATH_CHAN_MAX (26+26+26+200+200)
-#else
-#define ATH_CHAN_MAX (14+14+14+252+20)
-#endif
+#define ATH_CHAN_MAX (70+70+70+240+240) // b+g+gT+a+aT XXX: This is probably excessive
/* Software Carrier, keeps track of the driver state
* associated with an instance of a device */
diff -Naur linux-2.6.28/drivers/net/wireless/ath5k/caps.c linux-2.6.28-chaos/drivers/net/wireless/ath5k/caps.c
--- linux-2.6.28/drivers/net/wireless/ath5k/caps.c 2008-12-24 18:26:37.000000000 -0500
+++ linux-2.6.28-chaos/drivers/net/wireless/ath5k/caps.c 2009-02-06 21:38:43.000000000 -0500
@@ -69,9 +69,9 @@
if (AR5K_EEPROM_HDR_11A(ee_header)) {
/* 4920 */
- ah->ah_capabilities.cap_range.range_5ghz_min = 5005;
- ah->ah_capabilities.cap_range.range_5ghz_max = 6100;
-
+ ah->ah_capabilities.cap_range.range_5ghz_min = 4800;
+ ah->ah_capabilities.cap_range.range_5ghz_max = 6000; /* 6100 is what the code said but */
+ /* it fried my Ubiquiti SRC */
/* Set supported modes */
__set_bit(AR5K_MODE_11A,
ah->ah_capabilities.cap_mode);
@@ -87,7 +87,7 @@
if (AR5K_EEPROM_HDR_11B(ee_header) ||
AR5K_EEPROM_HDR_11G(ee_header)) {
/* 2312 */
- ah->ah_capabilities.cap_range.range_2ghz_min = 2412;
+ ah->ah_capabilities.cap_range.range_2ghz_min = 2192; /* this is the bottom of the registers */
ah->ah_capabilities.cap_range.range_2ghz_max = 2732;
if (AR5K_EEPROM_HDR_11B(ee_header))
diff -Naur linux-2.6.28/net/mac80211/tx.c linux-2.6.28-chaos/net/mac80211/tx.c
--- linux-2.6.28/net/mac80211/tx.c 2008-12-24 18:26:37.000000000 -0500
+++ linux-2.6.28-chaos/net/mac80211/tx.c 2009-02-06 21:38:53.000000000 -0500
@@ -1378,10 +1378,32 @@
struct net_device *dev)
{
struct ieee80211_local *local = wdev_priv(dev->ieee80211_ptr);
+ struct ieee80211_channel *chan = local->hw.conf.channel;
struct ieee80211_radiotap_header *prthdr =
(struct ieee80211_radiotap_header *)skb->data;
u16 len_rthdr;
+ /*
+ * Frame injection is not allowed if beaconing is not allowed
+ * or if we need radar detection. Beaconing is usually not allowed when
+ * the mode or operation (Adhoc, AP, Mesh) does not support DFS.
+ * Passive scan is also used in world regulatory domains where
+ * your country is not known and as such it should be treated as
+ * NO TX unless the channel is explicitly allowed in which case
+ * your current regulatory domain would not have the passive scan
+ * flag.
+ *
+ * Since AP mode uses monitor interfaces to inject/TX management
+ * frames we can make AP mode the exception to this rule once it
+ * supports radar detection as its implementation can deal with
+ * radar detection by itself. We can do that later by adding a
+ * monitor flag interfaces used for AP support.
+ */
+ if ((chan->flags & (IEEE80211_CHAN_NO_IBSS | IEEE80211_CHAN_RADAR |
+ IEEE80211_CHAN_PASSIVE_SCAN)))
+ return TX_DROP;
+ /* This was intended for the kernel patch but it didn't work; goto fail; */
+
/* check for not even having the fixed radiotap header part */
if (unlikely(skb->len < sizeof(struct ieee80211_radiotap_header)))
goto fail; /* too short to be possibly valid */

View file

@ -0,0 +1,14 @@
diff -Naur linux-2.6.28-pentoo-r1-orig/drivers/net/wireless/ath5k/base.c linux-2.6.28-pentoo-r1-improved/drivers/net/wireless/ath5k/base.c
--- linux-2.6.28-pentoo-r1-orig/drivers/net/wireless/ath5k/base.c 2009-01-18 17:49:00.000000000 -0500
+++ linux-2.6.28-pentoo-r1-improved/drivers/net/wireless/ath5k/base.c 2009-01-18 17:56:09.000000000 -0500
@@ -1175,7 +1175,9 @@
bf->skbaddr = pci_map_single(sc->pdev, skb->data, skb->len,
PCI_DMA_TODEVICE);
- if (info->flags & IEEE80211_TX_CTL_NO_ACK)
+ if (info->flags & IEEE80211_TX_CTL_NO_ACK ||
+ (info->flags & IEEE80211_TX_CTL_INJECTED &&
+ !(ieee80211_has_morefrags(((struct ieee80211_hdr *)skb->data)->frame_control))))
flags |= AR5K_TXDESC_NOACK;
pktlen = skb->len;

View file

@ -0,0 +1,354 @@
From: Michael Buesch <mb@bu3sch.de>
Date: Fri, 23 Jan 2009 20:21:51 +0000 (+0100)
Subject: b43: Automatically probe for opensource firmware
X-Git-Tag: master-2009-03-04~360
X-Git-Url: http://git.kernel.org/?p=linux%2Fkernel%2Fgit%2Flinville%2Fwireless-testing.git;a=commitdiff_plain;h=b00f2457e512d4bcc1b6cb3a4844ef3cb3280c3a;hp=e8299e7642f1987e1d15951ddd18401e3048be14
b43: Automatically probe for opensource firmware
First probe for proprietary firmware and then probe for opensource firmware.
This way around it's a win-win situation.
1) If proprietary fw is available, it will work.
2) If opensource firmware is available, but no proprietary (Distros can only ship open fw)
it might work.
3) If both open and proprietary are available, it will work, because it selects
the proprietary. We currently don't prefer the open fw in this case, because it doesn't
work on all devices. It would introduce a regression otherwise.
The remaining FIXMEs in this patch are harmless, because they only matter on multiband
devices, which are not implemented yet anyway.
Signed-off-by: Michael Buesch <mb@bu3sch.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
---
diff --git a/drivers/net/wireless/b43/b43.h b/drivers/net/wireless/b43/b43.h
index a53c378..9e0da21 100644
--- a/drivers/net/wireless/b43/b43.h
+++ b/drivers/net/wireless/b43/b43.h
@@ -655,10 +655,39 @@ struct b43_wl {
struct work_struct txpower_adjust_work;
};
+/* The type of the firmware file. */
+enum b43_firmware_file_type {
+ B43_FWTYPE_PROPRIETARY,
+ B43_FWTYPE_OPENSOURCE,
+ B43_NR_FWTYPES,
+};
+
+/* Context data for fetching firmware. */
+struct b43_request_fw_context {
+ /* The device we are requesting the fw for. */
+ struct b43_wldev *dev;
+ /* The type of firmware to request. */
+ enum b43_firmware_file_type req_type;
+ /* Error messages for each firmware type. */
+ char errors[B43_NR_FWTYPES][128];
+ /* Temporary buffer for storing the firmware name. */
+ char fwname[64];
+ /* A fatal error occured while requesting. Firmware reqest
+ * can not continue, as any other reqest will also fail. */
+ int fatal_failure;
+};
+
/* In-memory representation of a cached microcode file. */
struct b43_firmware_file {
const char *filename;
const struct firmware *data;
+ /* Type of the firmware file name. Note that this does only indicate
+ * the type by the firmware name. NOT the file contents.
+ * If you want to check for proprietary vs opensource, use (struct b43_firmware)->opensource
+ * instead! The (struct b43_firmware)->opensource flag is derived from the actual firmware
+ * binary code, not just the filename.
+ */
+ enum b43_firmware_file_type type;
};
/* Pointers to the firmware data and meta information about it. */
@@ -677,7 +706,8 @@ struct b43_firmware {
/* Firmware patchlevel */
u16 patch;
- /* Set to true, if we are using an opensource firmware. */
+ /* Set to true, if we are using an opensource firmware.
+ * Use this to check for proprietary vs opensource. */
bool opensource;
/* Set to true, if the core needs a PCM firmware, but
* we failed to load one. This is always false for
diff --git a/drivers/net/wireless/b43/main.c b/drivers/net/wireless/b43/main.c
index 675a73a..cbb3d45 100644
--- a/drivers/net/wireless/b43/main.c
+++ b/drivers/net/wireless/b43/main.c
@@ -1934,7 +1934,7 @@ static irqreturn_t b43_interrupt_handler(int irq, void *dev_id)
return ret;
}
-static void do_release_fw(struct b43_firmware_file *fw)
+void b43_do_release_fw(struct b43_firmware_file *fw)
{
release_firmware(fw->data);
fw->data = NULL;
@@ -1943,10 +1943,10 @@ static void do_release_fw(struct b43_firmware_file *fw)
static void b43_release_firmware(struct b43_wldev *dev)
{
- do_release_fw(&dev->fw.ucode);
- do_release_fw(&dev->fw.pcm);
- do_release_fw(&dev->fw.initvals);
- do_release_fw(&dev->fw.initvals_band);
+ b43_do_release_fw(&dev->fw.ucode);
+ b43_do_release_fw(&dev->fw.pcm);
+ b43_do_release_fw(&dev->fw.initvals);
+ b43_do_release_fw(&dev->fw.initvals_band);
}
static void b43_print_fw_helptext(struct b43_wl *wl, bool error)
@@ -1963,12 +1963,10 @@ static void b43_print_fw_helptext(struct b43_wl *wl, bool error)
b43warn(wl, text);
}
-static int do_request_fw(struct b43_wldev *dev,
- const char *name,
- struct b43_firmware_file *fw,
- bool silent)
+int b43_do_request_fw(struct b43_request_fw_context *ctx,
+ const char *name,
+ struct b43_firmware_file *fw)
{
- char path[sizeof(modparam_fwpostfix) + 32];
const struct firmware *blob;
struct b43_fw_header *hdr;
u32 size;
@@ -1976,29 +1974,49 @@ static int do_request_fw(struct b43_wldev *dev,
if (!name) {
/* Don't fetch anything. Free possibly cached firmware. */
- do_release_fw(fw);
+ /* FIXME: We should probably keep it anyway, to save some headache
+ * on suspend/resume with multiband devices. */
+ b43_do_release_fw(fw);
return 0;
}
if (fw->filename) {
- if (strcmp(fw->filename, name) == 0)
+ if ((fw->type == ctx->req_type) &&
+ (strcmp(fw->filename, name) == 0))
return 0; /* Already have this fw. */
/* Free the cached firmware first. */
- do_release_fw(fw);
+ /* FIXME: We should probably do this later after we successfully
+ * got the new fw. This could reduce headache with multiband devices.
+ * We could also redesign this to cache the firmware for all possible
+ * bands all the time. */
+ b43_do_release_fw(fw);
+ }
+
+ switch (ctx->req_type) {
+ case B43_FWTYPE_PROPRIETARY:
+ snprintf(ctx->fwname, sizeof(ctx->fwname),
+ "b43%s/%s.fw",
+ modparam_fwpostfix, name);
+ break;
+ case B43_FWTYPE_OPENSOURCE:
+ snprintf(ctx->fwname, sizeof(ctx->fwname),
+ "b43-open%s/%s.fw",
+ modparam_fwpostfix, name);
+ break;
+ default:
+ B43_WARN_ON(1);
+ return -ENOSYS;
}
-
- snprintf(path, ARRAY_SIZE(path),
- "b43%s/%s.fw",
- modparam_fwpostfix, name);
- err = request_firmware(&blob, path, dev->dev->dev);
+ err = request_firmware(&blob, ctx->fwname, ctx->dev->dev->dev);
if (err == -ENOENT) {
- if (!silent) {
- b43err(dev->wl, "Firmware file \"%s\" not found\n",
- path);
- }
+ snprintf(ctx->errors[ctx->req_type],
+ sizeof(ctx->errors[ctx->req_type]),
+ "Firmware file \"%s\" not found\n", ctx->fwname);
return err;
} else if (err) {
- b43err(dev->wl, "Firmware file \"%s\" request failed (err=%d)\n",
- path, err);
+ snprintf(ctx->errors[ctx->req_type],
+ sizeof(ctx->errors[ctx->req_type]),
+ "Firmware file \"%s\" request failed (err=%d)\n",
+ ctx->fwname, err);
return err;
}
if (blob->size < sizeof(struct b43_fw_header))
@@ -2021,20 +2039,24 @@ static int do_request_fw(struct b43_wldev *dev,
fw->data = blob;
fw->filename = name;
+ fw->type = ctx->req_type;
return 0;
err_format:
- b43err(dev->wl, "Firmware file \"%s\" format error.\n", path);
+ snprintf(ctx->errors[ctx->req_type],
+ sizeof(ctx->errors[ctx->req_type]),
+ "Firmware file \"%s\" format error.\n", ctx->fwname);
release_firmware(blob);
return -EPROTO;
}
-static int b43_request_firmware(struct b43_wldev *dev)
+static int b43_try_request_fw(struct b43_request_fw_context *ctx)
{
- struct b43_firmware *fw = &dev->fw;
- const u8 rev = dev->dev->id.revision;
+ struct b43_wldev *dev = ctx->dev;
+ struct b43_firmware *fw = &ctx->dev->fw;
+ const u8 rev = ctx->dev->dev->id.revision;
const char *filename;
u32 tmshigh;
int err;
@@ -2049,7 +2071,7 @@ static int b43_request_firmware(struct b43_wldev *dev)
filename = "ucode13";
else
goto err_no_ucode;
- err = do_request_fw(dev, filename, &fw->ucode, 0);
+ err = b43_do_request_fw(ctx, filename, &fw->ucode);
if (err)
goto err_load;
@@ -2061,7 +2083,7 @@ static int b43_request_firmware(struct b43_wldev *dev)
else
goto err_no_pcm;
fw->pcm_request_failed = 0;
- err = do_request_fw(dev, filename, &fw->pcm, 1);
+ err = b43_do_request_fw(ctx, filename, &fw->pcm);
if (err == -ENOENT) {
/* We did not find a PCM file? Not fatal, but
* core rev <= 10 must do without hwcrypto then. */
@@ -2097,7 +2119,7 @@ static int b43_request_firmware(struct b43_wldev *dev)
default:
goto err_no_initvals;
}
- err = do_request_fw(dev, filename, &fw->initvals, 0);
+ err = b43_do_request_fw(ctx, filename, &fw->initvals);
if (err)
goto err_load;
@@ -2131,30 +2153,34 @@ static int b43_request_firmware(struct b43_wldev *dev)
default:
goto err_no_initvals;
}
- err = do_request_fw(dev, filename, &fw->initvals_band, 0);
+ err = b43_do_request_fw(ctx, filename, &fw->initvals_band);
if (err)
goto err_load;
return 0;
-err_load:
- b43_print_fw_helptext(dev->wl, 1);
- goto error;
-
err_no_ucode:
- err = -ENODEV;
- b43err(dev->wl, "No microcode available for core rev %u\n", rev);
+ err = ctx->fatal_failure = -EOPNOTSUPP;
+ b43err(dev->wl, "The driver does not know which firmware (ucode) "
+ "is required for your device (wl-core rev %u)\n", rev);
goto error;
err_no_pcm:
- err = -ENODEV;
- b43err(dev->wl, "No PCM available for core rev %u\n", rev);
+ err = ctx->fatal_failure = -EOPNOTSUPP;
+ b43err(dev->wl, "The driver does not know which firmware (PCM) "
+ "is required for your device (wl-core rev %u)\n", rev);
goto error;
err_no_initvals:
- err = -ENODEV;
- b43err(dev->wl, "No Initial Values firmware file for PHY %u, "
- "core rev %u\n", dev->phy.type, rev);
+ err = ctx->fatal_failure = -EOPNOTSUPP;
+ b43err(dev->wl, "The driver does not know which firmware (initvals) "
+ "is required for your device (wl-core rev %u)\n", rev);
+ goto error;
+
+err_load:
+ /* We failed to load this firmware image. The error message
+ * already is in ctx->errors. Return and let our caller decide
+ * what to do. */
goto error;
error:
@@ -2162,6 +2188,48 @@ error:
return err;
}
+static int b43_request_firmware(struct b43_wldev *dev)
+{
+ struct b43_request_fw_context *ctx;
+ unsigned int i;
+ int err;
+ const char *errmsg;
+
+ ctx = kzalloc(sizeof(*ctx), GFP_KERNEL);
+ if (!ctx)
+ return -ENOMEM;
+ ctx->dev = dev;
+
+ ctx->req_type = B43_FWTYPE_PROPRIETARY;
+ err = b43_try_request_fw(ctx);
+ if (!err)
+ goto out; /* Successfully loaded it. */
+ err = ctx->fatal_failure;
+ if (err)
+ goto out;
+
+ ctx->req_type = B43_FWTYPE_OPENSOURCE;
+ err = b43_try_request_fw(ctx);
+ if (!err)
+ goto out; /* Successfully loaded it. */
+ err = ctx->fatal_failure;
+ if (err)
+ goto out;
+
+ /* Could not find a usable firmware. Print the errors. */
+ for (i = 0; i < B43_NR_FWTYPES; i++) {
+ errmsg = ctx->errors[i];
+ if (strlen(errmsg))
+ b43err(dev->wl, errmsg);
+ }
+ b43_print_fw_helptext(dev->wl, 1);
+ err = -ENOENT;
+
+out:
+ kfree(ctx);
+ return err;
+}
+
static int b43_upload_microcode(struct b43_wldev *dev)
{
const size_t hdr_len = sizeof(struct b43_fw_header);
diff --git a/drivers/net/wireless/b43/main.h b/drivers/net/wireless/b43/main.h
index f871a25..e6d90f3 100644
--- a/drivers/net/wireless/b43/main.h
+++ b/drivers/net/wireless/b43/main.h
@@ -121,4 +121,11 @@ void b43_power_saving_ctl_bits(struct b43_wldev *dev, unsigned int ps_flags);
void b43_mac_suspend(struct b43_wldev *dev);
void b43_mac_enable(struct b43_wldev *dev);
+
+struct b43_request_fw_context;
+int b43_do_request_fw(struct b43_request_fw_context *ctx,
+ const char *name,
+ struct b43_firmware_file *fw);
+void b43_do_release_fw(struct b43_firmware_file *fw);
+
#endif /* B43_MAIN_H_ */

View file

@ -0,0 +1,26 @@
--- linux-2.6.23_orig/net/ieee80211/ieee80211_tx.c 2007-10-09 22:31:38.000000000 +0200
+++ linux-2.6.23/net/ieee80211/ieee80211_tx.c 2007-10-14 19:39:49.000000000 +0200
@@ -293,6 +293,23 @@
ether_type = ntohs(((struct ethhdr *)skb->data)->h_proto);
+ if(ieee->iw_mode == IW_MODE_MONITOR)
+ {
+ txb = ieee80211_alloc_txb(1, skb->len,
+ ieee->tx_headroom, GFP_ATOMIC);
+ if (unlikely(!txb)) {
+ printk(KERN_WARNING "%s: Could not allocate TXB\n",
+ ieee->dev->name);
+ goto failed;
+ }
+
+ txb->encrypted = 0;
+ txb->payload_size = skb->len;
+ skb_copy_from_linear_data(skb, skb_put(txb->fragments[0],skb->len), skb->len);
+
+ goto success;
+ }
+
crypt = ieee->crypt[ieee->tx_keyidx];
encrypt = !(ether_type == ETH_P_PAE && ieee->ieee802_1x) &&

View file

@ -0,0 +1,76 @@
diff -Naur linux-2.6.28.orig/drivers/net/wireless/ipw2200.c linux-2.6.28/drivers/net/wireless/ipw2200.c
--- linux-2.6.28.orig/drivers/net/wireless/ipw2200.c 2008-12-25 00:26:37.000000000 +0100
+++ linux-2.6.28/drivers/net/wireless/ipw2200.c 2009-01-08 20:04:54.149380378 +0100
@@ -1908,6 +1908,64 @@
static DEVICE_ATTR(channels, S_IRUSR, show_channels, NULL);
+static int ipw_tx_skb(struct ipw_priv *priv, struct ieee80211_txb *txb, int pri);
+
+/* SYSFS INJECT */
+static ssize_t store_inject(struct device *d,
+ struct device_attribute *attr,
+ const char *buf, size_t count)
+{
+ struct ipw_priv *priv = (struct ipw_priv *)d->driver_data;
+ struct ieee80211_device *ieee = priv->ieee;
+ struct ieee80211_txb * txb;
+ struct sk_buff *skb_frag;
+ unsigned char * newbuf;
+ unsigned long flags;
+
+ // should test (ieee->is_queue_full)
+
+ // Fw only accepts data, so avoid accidental fw errors.
+ if ( (buf[0]&0x0c) != '\x08') {
+ //printk("ipw2200: inject: discarding non-data frame (type=%02X)\n",(int)(unsigned char)buf[0]);
+ return count;
+ }
+
+ if (count>1500) {
+ count=1500;
+ printk("ipw2200: inject: cutting down frame to 1500 bytes\n");
+ }
+
+ spin_lock_irqsave(&priv->lock, flags);
+
+ // Create a txb with one skb
+ txb = kmalloc(sizeof(struct ieee80211_txb) + sizeof(u8 *), GFP_ATOMIC);
+ if (!txb)
+ goto nosepuede;
+ txb->nr_frags=1;
+ txb->frag_size = ieee->tx_headroom;
+ txb->fragments[0]=__dev_alloc_skb(count + ieee->tx_headroom, GFP_ATOMIC);
+ if (!txb->fragments[0]) {
+ kfree(txb);
+ goto nosepuede;
+ }
+ skb_reserve(txb->fragments[0], ieee->tx_headroom);
+ txb->encrypted=0;
+ txb->payload_size=count;
+ skb_frag = txb->fragments[0];
+ newbuf=skb_put(skb_frag, count);
+
+ // copy data into txb->skb and send it
+ memcpy(newbuf, buf, count);
+
+ ipw_tx_skb(priv, txb, 0);
+
+nosepuede:
+ spin_unlock_irqrestore(&priv->lock, flags);
+ return count;
+}
+
+static DEVICE_ATTR(inject, S_IWUSR, NULL, store_inject);
+
static void notify_wx_assoc_event(struct ipw_priv *priv)
{
union iwreq_data wrqu;
@@ -11482,6 +11540,7 @@
#ifdef CONFIG_IPW2200_PROMISCUOUS
&dev_attr_rtap_iface.attr,
&dev_attr_rtap_filter.attr,
+ &dev_attr_inject.attr,
#endif
NULL
};

View file

@ -0,0 +1,299 @@
diff -Naur linux-2.6.28-pentoo-r4/drivers/staging/wlan-ng/hfa384x.c linux-2.6.28-pentoo-r4-fauxpas/drivers/staging/wlan-ng/hfa384x.c
--- linux-2.6.28-pentoo-r4/drivers/staging/wlan-ng/hfa384x.c 2008-12-24 18:26:37.000000000 -0500
+++ linux-2.6.28-pentoo-r4-fauxpas/drivers/staging/wlan-ng/hfa384x.c 2009-04-04 22:53:46.000000000 -0400
@@ -1873,8 +1873,16 @@
DBFENTER;
- cmd.cmd = HFA384x_CMD_CMDCODE_SET(HFA384x_CMDCODE_MONITOR) |
- HFA384x_CMD_AINFO_SET(enable);
+// cmd.cmd = HFA384x_CMD_CMDCODE_SET(HFA384x_CMDCODE_MONITOR) |
+// HFA384x_CMD_AINFO_SET(enable);
+ if (enable == HFA384x_MONITOR_ENABLE) {
+ // KoreK: get into test mode 0x0a
+ cmd.cmd = HFA384x_CMD_CMDCODE_SET(HFA384x_CMDCODE_MONITOR) |
+ HFA384x_CMD_AINFO_SET(0x0a);
+ } else {
+ cmd.cmd = HFA384x_CMD_CMDCODE_SET(HFA384x_CMDCODE_MONITOR) |
+ HFA384x_CMD_AINFO_SET(enable);
+ }
cmd.parm0 = 0;
cmd.parm1 = 0;
cmd.parm2 = 0;
@@ -3114,11 +3122,32 @@
#endif
/* if we're using host WEP, increase size by IV+ICV */
- if (p80211_wep->data) {
- txdesc.data_len = host2hfa384x_16(skb->len+8);
- // txdesc.tx_control |= HFA384x_TX_NOENCRYPT_SET(1);
- } else {
- txdesc.data_len = host2hfa384x_16(skb->len);
+// if (p80211_wep->data) {
+// txdesc.data_len = host2hfa384x_16(skb->len+8);
+// // txdesc.tx_control |= HFA384x_TX_NOENCRYPT_SET(1);
+// } else {
+// txdesc.data_len = host2hfa384x_16(skb->len);
+// }
+
+ if (skb->protocol != htons(ETH_P_80211_RAW)) {
+ /* if we're using host WEP, increase size by IV+ICV */
+ if (p80211_wep->data) {
+ txdesc.data_len = host2hfa384x_16(skb->len+8);
+ // txdesc.tx_control |= HFA384x_TX_NOENCRYPT_SET(1);
+ } else {
+ txdesc.data_len = host2hfa384x_16(skb->len);
+ }
+ } else {
+ /* KoreK: raw injection (monitor mode): pull the rest of
+ the header and ssanity check on txdesc.data_len */
+ memcpy(&(txdesc.data_len), skb->data, 16);
+ skb_pull(skb,16);
+ if (txdesc.data_len != host2hfa384x_16(skb->len)) {
+ printk(KERN_DEBUG "mismatch frame_len, drop frame\n");
+ return 0;
+ }
+
+ txdesc.tx_control |= HFA384x_TX_RETRYSTRAT_SET(1);
}
txdesc.tx_control = host2hfa384x_16(txdesc.tx_control);
@@ -3142,7 +3171,8 @@
spin_lock(&hw->cmdlock);
/* Copy descriptor+payload to FID */
- if (p80211_wep->data) {
+// if (p80211_wep->data) {
+ if (p80211_wep->data && (skb->protocol != htons(ETH_P_80211_RAW))) {
result = hfa384x_copy_to_bap4(hw, HFA384x_BAP_PROC, fid, 0,
&txdesc, sizeof(txdesc),
p80211_wep->iv, sizeof(p80211_wep->iv),
@@ -3588,6 +3618,17 @@
{
case 0:
+ /* KoreK: this testmode uses macport 0 */
+ if ((wlandev->netdev->type == ARPHRD_IEEE80211) ||
+ (wlandev->netdev->type == ARPHRD_IEEE80211_PRISM)) {
+ if ( ! HFA384x_RXSTATUS_ISFCSERR(rxdesc.status) ) {
+ hfa384x_int_rxmonitor( wlandev, rxfid, &rxdesc);
+ } else {
+ WLAN_LOG_DEBUG(3,"Received monitor frame: FCSerr set\n");
+ }
+ goto done;
+ }
+
fc = ieee2host16(rxdesc.frame_control);
/* If exclude and we receive an unencrypted, drop it */
diff -Naur linux-2.6.28-pentoo-r4/drivers/staging/wlan-ng/hfa384x_usb.c linux-2.6.28-pentoo-r4-fauxpas/drivers/staging/wlan-ng/hfa384x_usb.c
--- linux-2.6.28-pentoo-r4/drivers/staging/wlan-ng/hfa384x_usb.c 2008-12-24 18:26:37.000000000 -0500
+++ linux-2.6.28-pentoo-r4-fauxpas/drivers/staging/wlan-ng/hfa384x_usb.c 2009-04-04 23:13:53.000000000 -0400
@@ -1430,8 +1430,17 @@
DBFENTER;
- cmd.cmd = HFA384x_CMD_CMDCODE_SET(HFA384x_CMDCODE_MONITOR) |
- HFA384x_CMD_AINFO_SET(enable);
+// cmd.cmd = HFA384x_CMD_CMDCODE_SET(HFA384x_CMDCODE_MONITOR) |
+// HFA384x_CMD_AINFO_SET(enable);
+ if (enable == HFA384x_MONITOR_ENABLE) {
+ // KoreK: get into test mode 0x0a
+ cmd.cmd = HFA384x_CMD_CMDCODE_SET(HFA384x_CMDCODE_MONITOR) |
+ HFA384x_CMD_AINFO_SET(0x0a);
+ } else {
+ cmd.cmd = HFA384x_CMD_CMDCODE_SET(HFA384x_CMDCODE_MONITOR) |
+ HFA384x_CMD_AINFO_SET(enable);
+ }
+
cmd.parm0 = 0;
cmd.parm1 = 0;
cmd.parm2 = 0;
@@ -3431,37 +3440,71 @@
HFA384x_TX_MACPORT_SET(0) | HFA384x_TX_STRUCTYPE_SET(1) |
HFA384x_TX_TXEX_SET(0) | HFA384x_TX_TXOK_SET(0);
#endif
- hw->txbuff.txfrm.desc.tx_control =
- host2hfa384x_16(hw->txbuff.txfrm.desc.tx_control);
+// hw->txbuff.txfrm.desc.tx_control =
+// host2hfa384x_16(hw->txbuff.txfrm.desc.tx_control);
- /* copy the header over to the txdesc */
- memcpy(&(hw->txbuff.txfrm.desc.frame_control), p80211_hdr, sizeof(p80211_hdr_t));
-
- /* if we're using host WEP, increase size by IV+ICV */
- if (p80211_wep->data) {
- hw->txbuff.txfrm.desc.data_len = host2hfa384x_16(skb->len+8);
- // hw->txbuff.txfrm.desc.tx_control |= HFA384x_TX_NOENCRYPT_SET(1);
- usbpktlen+=8;
- } else {
- hw->txbuff.txfrm.desc.data_len = host2hfa384x_16(skb->len);
+// /* copy the header over to the txdesc */
+// memcpy(&(hw->txbuff.txfrm.desc.frame_control), p80211_hdr, sizeof(p80211_hdr_t));
+ if (skb->protocol != htons(ETH_P_80211_RAW)) {
+ hw->txbuff.txfrm.desc.tx_control =
+ host2hfa384x_16(hw->txbuff.txfrm.desc.tx_control);
+
+ /* copy the header over to the txdesc */
+ memcpy(&(hw->txbuff.txfrm.desc.frame_control), p80211_hdr,
+ sizeof(p80211_hdr_t));
+
+ /* if we're using host WEP, increase size by IV+ICV */
+ if (p80211_wep->data) {
+ hw->txbuff.txfrm.desc.data_len = host2hfa384x_16(skb->len+8);
+ // hw->txbuff.txfrm.desc.tx_control |= HFA384x_TX_NOENCRYPT_SET(1);
+ usbpktlen+=8;
+ } else {
+ hw->txbuff.txfrm.desc.data_len = host2hfa384x_16(skb->len);
+ }
+ } else {
+ /* KoreK: raw injection (monitor mode): pull the rest of
+ the header and ssanity check on txdesc.data_len */
+ memcpy(&(hw->txbuff.txfrm.desc.data_len), skb->data, 16);
+ skb_pull(skb,16);
+ if (hw->txbuff.txfrm.desc.data_len != host2hfa384x_16(skb->len)) {
+ printk(KERN_DEBUG "mismatch frame_len, drop frame\n");
+ return 0;
+ }
+// /* if we're using host WEP, increase size by IV+ICV */
+// if (p80211_wep->data) {
+// hw->txbuff.txfrm.desc.data_len = host2hfa384x_16(skb->len+8);
+// // hw->txbuff.txfrm.desc.tx_control |= HFA384x_TX_NOENCRYPT_SET(1);
+// usbpktlen+=8;
+// } else {
+// hw->txbuff.txfrm.desc.data_len = host2hfa384x_16(skb->len);
+ hw->txbuff.txfrm.desc.tx_control |= HFA384x_TX_RETRYSTRAT_SET(1);
+ hw->txbuff.txfrm.desc.tx_control =
+ host2hfa384x_16(hw->txbuff.txfrm.desc.tx_control);
+
+ /* copy the header over to the txdesc */
+ memcpy(&(hw->txbuff.txfrm.desc.frame_control), p80211_hdr,
+ sizeof(p80211_hdr_t));
}
usbpktlen += skb->len;
/* copy over the WEP IV if we are using host WEP */
ptr = hw->txbuff.txfrm.data;
- if (p80211_wep->data) {
+// if (p80211_wep->data) {
+ if (p80211_wep->data && skb->protocol != htons(ETH_P_80211_RAW)) {
memcpy(ptr, p80211_wep->iv, sizeof(p80211_wep->iv));
ptr+= sizeof(p80211_wep->iv);
memcpy(ptr, p80211_wep->data, skb->len);
} else {
memcpy(ptr, skb->data, skb->len);
}
+
/* copy over the packet data */
ptr+= skb->len;
/* copy over the WEP ICV if we are using host WEP */
- if (p80211_wep->data) {
+// if (p80211_wep->data) {
+ if (p80211_wep->data && skb->protocol != htons(ETH_P_80211_RAW)) {
memcpy(ptr, p80211_wep->icv, sizeof(p80211_wep->icv));
}
@@ -4223,6 +4266,17 @@
switch( HFA384x_RXSTATUS_MACPORT_GET(usbin->rxfrm.desc.status) )
{
case 0:
+ /* KoreK: this testmode uses macport 0 */
+ if ((wlandev->netdev->type == ARPHRD_IEEE80211) ||
+ (wlandev->netdev->type == ARPHRD_IEEE80211_PRISM)) {
+ if ( ! HFA384x_RXSTATUS_ISFCSERR(usbin->rxfrm.desc.status) ) {
+ hfa384x_int_rxmonitor(wlandev, &usbin->rxfrm);
+ } else {
+ WLAN_LOG_DEBUG(3,"Received monitor frame: FCSerr set\n");
+ }
+ goto done;
+ }
+
fc = ieee2host16(usbin->rxfrm.desc.frame_control);
/* If exclude and we receive an unencrypted, drop it */
diff -Naur linux-2.6.28-pentoo-r4/drivers/staging/wlan-ng/p80211netdev.c linux-2.6.28-pentoo-r4-fauxpas/drivers/staging/wlan-ng/p80211netdev.c
--- linux-2.6.28-pentoo-r4/drivers/staging/wlan-ng/p80211netdev.c 2008-12-24 18:26:37.000000000 -0500
+++ linux-2.6.28-pentoo-r4-fauxpas/drivers/staging/wlan-ng/p80211netdev.c 2009-04-04 22:42:15.000000000 -0400
@@ -512,7 +512,7 @@
* and return success .
* TODO: we need a saner way to handle this
*/
- if(skb->protocol != ETH_P_80211_RAW) {
+ if(skb->protocol != htons(ETH_P_80211_RAW)) {
p80211netdev_start_queue(wlandev);
WLAN_LOG_NOTICE(
"Tx attempt prior to association, frame dropped.\n");
@@ -524,7 +524,7 @@
}
/* Check for raw transmits */
- if(skb->protocol == ETH_P_80211_RAW) {
+ if(skb->protocol == htons(ETH_P_80211_RAW)) {
if (!capable(CAP_NET_ADMIN)) {
result = 1;
goto failed;
@@ -952,8 +952,9 @@
dev->set_mac_address = p80211knetdev_set_mac_address;
#endif
#ifdef HAVE_TX_TIMEOUT
- dev->tx_timeout = &p80211knetdev_tx_timeout;
- dev->watchdog_timeo = (wlan_watchdog * HZ) / 1000;
+// korek: still not implemented (XXX: Why exactly do we remove this???)
+// dev->tx_timeout = &p80211knetdev_tx_timeout;
+// dev->watchdog_timeo = (wlan_watchdog * HZ) / 1000;
#endif
netif_carrier_off(dev);
}
diff -Naur linux-2.6.28-pentoo-r4/drivers/staging/wlan-ng/prism2mgmt.c linux-2.6.28-pentoo-r4-fauxpas/drivers/staging/wlan-ng/prism2mgmt.c
--- linux-2.6.28-pentoo-r4/drivers/staging/wlan-ng/prism2mgmt.c 2008-12-24 18:26:37.000000000 -0500
+++ linux-2.6.28-pentoo-r4-fauxpas/drivers/staging/wlan-ng/prism2mgmt.c 2009-04-04 23:18:35.000000000 -0400
@@ -2860,9 +2860,12 @@
}
/* Now if we're already sniffing, we can skip the rest */
- if (wlandev->netdev->type != ARPHRD_ETHER) {
+// if (wlandev->netdev->type != ARPHRD_ETHER) {
+ if ((wlandev->netdev->type != ARPHRD_IEEE80211) &&
+ (wlandev->netdev->type != ARPHRD_IEEE80211_PRISM)) {
/* Set the port type to pIbss */
- word = HFA384x_PORTTYPE_PSUEDOIBSS;
+// word = HFA384x_PORTTYPE_PSUEDOIBSS;
+ word = 5; // HFA384x_PORTTYPE_PSUEDOIBSS;
result = hfa384x_drvr_setconfig16(hw,
HFA384x_RID_CNFPORTTYPE, word);
if ( result ) {
@@ -2874,6 +2877,8 @@
}
if ((msg->keepwepflags.status == P80211ENUM_msgitem_status_data_ok) && (msg->keepwepflags.data != P80211ENUM_truth_true)) {
/* Set the wepflags for no decryption */
+ /* doesn't work - done from the CLI */
+ /* Fix? KoreK */
word = HFA384x_WEPFLAGS_DISABLE_TXCRYPT |
HFA384x_WEPFLAGS_DISABLE_RXCRYPT;
result = hfa384x_drvr_setconfig16(hw, HFA384x_RID_CNFWEPFLAGS, word);
@@ -2919,7 +2924,9 @@
goto failed;
}
- if (wlandev->netdev->type == ARPHRD_ETHER) {
+// if (wlandev->netdev->type == ARPHRD_ETHER) {
+ if ((wlandev->netdev->type != ARPHRD_IEEE80211) &&
+ (wlandev->netdev->type != ARPHRD_IEEE80211_PRISM)) {
WLAN_LOG_INFO("monitor mode enabled\n");
}
diff -Naur linux-2.6.28-pentoo-r4/drivers/staging/wlan-ng/prism2sta.c linux-2.6.28-pentoo-r4-fauxpas/drivers/staging/wlan-ng/prism2sta.c
--- linux-2.6.28-pentoo-r4/drivers/staging/wlan-ng/prism2sta.c 2008-12-24 18:26:37.000000000 -0500
+++ linux-2.6.28-pentoo-r4-fauxpas/drivers/staging/wlan-ng/prism2sta.c 2009-04-04 23:20:58.000000000 -0400
@@ -411,7 +411,9 @@
DBFENTER;
/* If necessary, set the 802.11 WEP bit */
- if ((wlandev->hostwep & (HOSTWEP_PRIVACYINVOKED | HOSTWEP_ENCRYPT)) == HOSTWEP_PRIVACYINVOKED) {
+// if ((wlandev->hostwep & (HOSTWEP_PRIVACYINVOKED | HOSTWEP_ENCRYPT)) == HOSTWEP_PRIVACYINVOKED) {
+ if (((wlandev->hostwep & (HOSTWEP_PRIVACYINVOKED | HOSTWEP_ENCRYPT)) == HOSTWEP_PRIVACYINVOKED)
+ && (skb->protocol != htons(ETH_P_80211_RAW))) {
p80211_hdr->a3.fc |= host2ieee16(WLAN_SET_FC_ISWEP(1));
}

View file

@ -0,0 +1,80 @@
diff -Naur linux-2.6.28-pentoo-r4/drivers/net/wireless/orinoco_cs.c linux-2.6.28-pentoo-r4-patched/drivers/net/wireless/orinoco_cs.c
--- linux-2.6.28-pentoo-r4/drivers/net/wireless/orinoco_cs.c 2008-12-24 18:26:37.000000000 -0500
+++ linux-2.6.28-pentoo-r4-patched/drivers/net/wireless/orinoco_cs.c 2009-04-08 00:22:05.000000000 -0400
@@ -418,33 +418,21 @@
"Pavel Roskin <proski@gnu.org>, et al)";
static struct pcmcia_device_id orinoco_cs_ids[] = {
- PCMCIA_DEVICE_MANF_CARD(0x000b, 0x7100), /* SonicWALL Long Range Wireless Card */
- PCMCIA_DEVICE_MANF_CARD(0x000b, 0x7300), /* Sohoware NCP110, Philips 802.11b */
PCMCIA_DEVICE_MANF_CARD(0x0089, 0x0002), /* AnyPoint(TM) Wireless II PC Card */
- PCMCIA_DEVICE_MANF_CARD(0x0101, 0x0777), /* 3Com AirConnect PCI 777A */
- PCMCIA_DEVICE_MANF_CARD(0x0126, 0x8000), /* PROXIM RangeLAN-DS/LAN PC CARD */
PCMCIA_DEVICE_MANF_CARD(0x0138, 0x0002), /* Compaq WL100 11 Mbps Wireless Adapter */
PCMCIA_DEVICE_MANF_CARD(0x0156, 0x0002), /* Lucent Orinoco and old Intersil */
PCMCIA_DEVICE_MANF_CARD(0x016b, 0x0001), /* Ericsson WLAN Card C11 */
PCMCIA_DEVICE_MANF_CARD(0x01eb, 0x080a), /* Nortel Networks eMobility 802.11 Wireless Adapter */
PCMCIA_DEVICE_MANF_CARD(0x01ff, 0x0008), /* Intermec MobileLAN 11Mbps 802.11b WLAN Card */
- PCMCIA_DEVICE_MANF_CARD(0x0250, 0x0002), /* Samsung SWL2000-N 11Mb/s WLAN Card */
PCMCIA_DEVICE_MANF_CARD(0x0261, 0x0002), /* AirWay 802.11 Adapter (PCMCIA) */
PCMCIA_DEVICE_MANF_CARD(0x0268, 0x0001), /* ARtem Onair */
PCMCIA_DEVICE_MANF_CARD(0x026f, 0x0305), /* Buffalo WLI-PCM-S11 */
- PCMCIA_DEVICE_MANF_CARD(0x0274, 0x1612), /* Linksys WPC11 Version 2.5 */
- PCMCIA_DEVICE_MANF_CARD(0x0274, 0x1613), /* Linksys WPC11 Version 3 */
- PCMCIA_DEVICE_MANF_CARD(0x028a, 0x0002), /* Compaq HNW-100 11 Mbps Wireless Adapter */
PCMCIA_DEVICE_MANF_CARD(0x028a, 0x0673), /* Linksys WCF12 Wireless CompactFlash Card */
- PCMCIA_DEVICE_MANF_CARD(0x02aa, 0x0002), /* ASUS SpaceLink WL-100 */
PCMCIA_DEVICE_MANF_CARD(0x02ac, 0x0002), /* SpeedStream SS1021 Wireless Adapter */
PCMCIA_DEVICE_MANF_CARD(0x02ac, 0x3021), /* SpeedStream Wireless Adapter */
PCMCIA_DEVICE_MANF_CARD(0x14ea, 0xb001), /* PLANEX RoadLannerWave GW-NS11H */
- PCMCIA_DEVICE_MANF_CARD(0x50c2, 0x7300), /* Airvast WN-100 */
PCMCIA_DEVICE_MANF_CARD(0x9005, 0x0021), /* Adaptec Ultra Wireless ANW-8030 */
PCMCIA_DEVICE_MANF_CARD(0xc001, 0x0008), /* CONTEC FLEXSCAN/FX-DDS110-PCC */
- PCMCIA_DEVICE_MANF_CARD(0xc250, 0x0002), /* Conceptronic CON11Cpro, EMTAC A2424i */
- PCMCIA_DEVICE_MANF_CARD(0xd601, 0x0002), /* Safeway 802.11b, ZCOMAX AirRunner/XI-300 */
PCMCIA_DEVICE_MANF_CARD(0xd601, 0x0005), /* D-Link DCF660, Sandisk Connect SDWCFB-000 */
PCMCIA_DEVICE_PROD_ID12(" ", "IEEE 802.11 Wireless LAN/PC Card", 0x3b6e20c8, 0xefccafe9),
PCMCIA_DEVICE_PROD_ID12("3Com", "3CRWE737A AirConnect Wireless LAN PC Card", 0x41240e5b, 0x56010af3),
@@ -453,31 +441,25 @@
PCMCIA_DEVICE_PROD_ID123("AIRVAST", "IEEE 802.11b Wireless PCMCIA Card", "HFA3863", 0xea569531, 0x4bcb9645, 0x355cb092),
PCMCIA_DEVICE_PROD_ID12("Allied Telesyn", "AT-WCL452 Wireless PCMCIA Radio", 0x5cd01705, 0x4271660f),
PCMCIA_DEVICE_PROD_ID12("ASUS", "802_11b_PC_CARD_25", 0x78fc06ee, 0xdb9aa842),
- PCMCIA_DEVICE_PROD_ID12("ASUS", "802_11B_CF_CARD_25", 0x78fc06ee, 0x45a50c1e),
PCMCIA_DEVICE_PROD_ID12("Avaya Communication", "Avaya Wireless PC Card", 0xd8a43b78, 0x0d341169),
PCMCIA_DEVICE_PROD_ID12("BENQ", "AWL100 PCMCIA ADAPTER", 0x35dadc74, 0x01f7fedb),
PCMCIA_DEVICE_PROD_ID12("BUFFALO", "WLI-PCM-L11G", 0x2decece3, 0xf57ca4b3),
- PCMCIA_DEVICE_PROD_ID12("BUFFALO", "WLI-CF-S11G", 0x2decece3, 0x82067c18),
PCMCIA_DEVICE_PROD_ID12("Cabletron", "RoamAbout 802.11 DS", 0x32d445f5, 0xedeffd90),
- PCMCIA_DEVICE_PROD_ID12("Compaq", "WL200_11Mbps_Wireless_PCI_Card", 0x54f7c49c, 0x15a75e5b),
PCMCIA_DEVICE_PROD_ID123("corega", "WL PCCL-11", "ISL37300P", 0x0a21501a, 0x59868926, 0xc9049a39),
PCMCIA_DEVICE_PROD_ID12("corega K.K.", "Wireless LAN PCC-11", 0x5261440f, 0xa6405584),
PCMCIA_DEVICE_PROD_ID12("corega K.K.", "Wireless LAN PCCA-11", 0x5261440f, 0xdf6115f9),
PCMCIA_DEVICE_PROD_ID12("corega_K.K.", "Wireless_LAN_PCCB-11", 0x29e33311, 0xee7a27ae),
PCMCIA_DEVICE_PROD_ID12("D", "Link DRC-650 11Mbps WLAN Card", 0x71b18589, 0xf144e3ac),
- PCMCIA_DEVICE_PROD_ID12("D", "Link DWL-650 11Mbps WLAN Card", 0x71b18589, 0xb6f1b0ab),
PCMCIA_DEVICE_PROD_ID12("D-Link Corporation", "D-Link DWL-650H 11Mbps WLAN Adapter", 0xef544d24, 0xcd8ea916),
PCMCIA_DEVICE_PROD_ID12("Digital Data Communications", "WPC-0100", 0xfdd73470, 0xe0b6f146),
PCMCIA_DEVICE_PROD_ID12("ELSA", "AirLancer MC-11", 0x4507a33a, 0xef54f0e3),
PCMCIA_DEVICE_PROD_ID12("HyperLink", "Wireless PC Card 11Mbps", 0x56cc3f1a, 0x0bcf220c),
PCMCIA_DEVICE_PROD_ID123("Instant Wireless ", " Network PC CARD", "Version 01.02", 0x11d901af, 0x6e9bd926, 0x4b74baa0),
PCMCIA_DEVICE_PROD_ID12("Intel", "PRO/Wireless 2011 LAN PC Card", 0x816cc815, 0x07f58077),
- PCMCIA_DEVICE_PROD_ID12("INTERSIL", "HFA384x/IEEE", 0x74c5e40d, 0xdb472a18),
PCMCIA_DEVICE_PROD_ID12("INTERSIL", "I-GATE 11M PC Card / PC Card plus", 0x74c5e40d, 0x8304ff77),
PCMCIA_DEVICE_PROD_ID12("Intersil", "PRISM 2_5 PCMCIA ADAPTER", 0x4b801a17, 0x6345a0bf),
PCMCIA_DEVICE_PROD_ID123("Intersil", "PRISM Freedom PCMCIA Adapter", "ISL37100P", 0x4b801a17, 0xf222ec2d, 0x630d52b2),
PCMCIA_DEVICE_PROD_ID12("LeArtery", "SYNCBYAIR 11Mbps Wireless LAN PC Card", 0x7e3b326a, 0x49893e92),
- PCMCIA_DEVICE_PROD_ID12("Linksys", "Wireless CompactFlash Card", 0x0733cc81, 0x0c52f395),
PCMCIA_DEVICE_PROD_ID12("Lucent Technologies", "WaveLAN/IEEE", 0x23eb9949, 0xc562e72a),
PCMCIA_DEVICE_PROD_ID12("MELCO", "WLI-PCM-L11", 0x481e0094, 0x7360e410),
PCMCIA_DEVICE_PROD_ID12("MELCO", "WLI-PCM-L11G", 0x481e0094, 0xf57ca4b3),
@@ -495,10 +477,8 @@
PCMCIA_DEVICE_PROD_ID12("PROXIM", "LAN PCI CARD HARMONY 80211B", 0xc6536a5e, 0x9f494e26),
PCMCIA_DEVICE_PROD_ID12("SAMSUNG", "11Mbps WLAN Card", 0x43d74cb4, 0x579bd91b),
PCMCIA_DEVICE_PROD_ID12("SMC", "SMC2532W-B EliteConnect Wireless Adapter", 0xc4f8b18b, 0x196bd757),
- PCMCIA_DEVICE_PROD_ID12("SMC", "SMC2632W", 0xc4f8b18b, 0x474a1f2a),
PCMCIA_DEVICE_PROD_ID12("Symbol Technologies", "LA4111 Spectrum24 Wireless LAN PC Card", 0x3f02b4d6, 0x3663cb0e),
PCMCIA_DEVICE_PROD_ID123("The Linksys Group, Inc.", "Instant Wireless Network PC Card", "ISL37300P", 0xa5f472c2, 0x590eb502, 0xc9049a39),
- PCMCIA_DEVICE_PROD_ID12("ZoomAir 11Mbps High", "Rate wireless Networking", 0x273fe3db, 0x32a1eaee),
PCMCIA_DEVICE_NULL,
};
MODULE_DEVICE_TABLE(pcmcia, orinoco_cs_ids);