Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 28 Oct 2004 15:07:48 EDT
From:      "Rogier R. Mulhuijzen" <lists@bsdchicks.com>
To:        freebsd-current@freebsd.org
Cc:        wpaul@freebsd.org
Subject:   [PATCH] added WEP authmode shared to NDISulator
Message-ID:  <BasiliX-1.1.0-109899046841814384aabff@artemis.drwilco.net>

next in thread | raw e-mail | index | archive | help
--781d78fe615ff318c6430a9fba1b50c5-1098990468
Content-Type: text/plain

To make the NDISulator do Shared authmode (pretty much required to do WEP it seems, at least on the AP I use):

http://bsdchicks.com/patches/if_ndis.patch

It includes my previous patch that makes wicontrol -L and dstumbler work.

However, I think this one should not be put into FreeBSD at all. Seems to me like net80211 should be patched to make this something universal. I'll spend some time on that in the near future.

Unless the way I did this is the way drivers should do it. Comments?

In the meanwhile, anyone who wants to use the NDISulator with a WEP enabled network, like me, can abuse this patch.

Greetings,

       DocWilco


--781d78fe615ff318c6430a9fba1b50c5-1098990468
Content-Type: application/octet-stream
Content-Transfer-Encoding: base64
Content-Description: if_ndis.patch
Content-Disposition: attachment; filename="if_ndis.patch"

LS0tIHN5cy9kZXYvaWZfbmRpcy9pZl9uZGlzLmMub3JpZwlXZWQgT2N0IDI3
IDE3OjAxOjU1IDIwMDQKKysrIHN5cy9kZXYvaWZfbmRpcy9pZl9uZGlzLmMJ
VGh1IE9jdCAyOCAxOTo0MTowMyAyMDA0CkBAIC0xMDcsNiArMTA3LDcgQEAK
IHN0YXRpYyBpbnQgbmRpc19pb2N0bAkJKHN0cnVjdCBpZm5ldCAqLCB1X2xv
bmcsIGNhZGRyX3QpOwogc3RhdGljIGludCBuZGlzX3dpX2lvY3RsX2dldAko
c3RydWN0IGlmbmV0ICosIHVfbG9uZywgY2FkZHJfdCk7CiBzdGF0aWMgaW50
IG5kaXNfd2lfaW9jdGxfc2V0CShzdHJ1Y3QgaWZuZXQgKiwgdV9sb25nLCBj
YWRkcl90KTsKK3N0YXRpYyBpbnQgbmRpc19pb2N0bF9hdX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odSBPY3QgMjggMTk6MjM6NTIgMjAwNApAQCAtMTE2LDYgKzExNiw3IEBA
CiAJdWludDMyX3QJCW5kaXNfZmlsdGVyOwogCWludAkJCW5kaXNfaWZfZmxh
Z3M7CiAJaW50CQkJbmRpc19za2lwOworCXVpbnQxNl90CQluZGlzXzgwMjEx
X2F1dGhtb2RlOwogCiAjaWYgX19GcmVlQlNEX3ZlcnNpb24gPCA1MDIxMTMK
IAlzdHJ1Y3Qgc3lzY3RsX2N0eF9saXN0CW5kaXNfY3R4Owo=
--781d78fe615ff318c6430a9fba1b50c5-1098990468--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?BasiliX-1.1.0-109899046841814384aabff>