最近とっても無線Lanのアクセスポイントがほしいと思っている。
というのも、wiiがあってだな。
まあ、アダプタつければ有線でもかまわないんだが、なんかそれは負けなきがする。
あと、ノートもあってだな。
で、昨日サーバ用のLanケーブルを買いにビックカメラへ行ったわけなんだけども、そこでついでにちょろっと無線lanコーナーのぞいてみた。
11g/bとかだとUSBでつなげて親機になれるやつ結構あるけど、11nはまだないんだろうなーっておもってたんだけど、あった。
CG-WLUSB300N。
他にもあったが、これが一番安かった。
コレガなのは心配だが、この値段ならあきらめもきくので、とりあえず買った。
で、問題は、自分はlinuxで無線lanなんぞ使ったことがない。
とりあえず、きっとカーネルモジュールにこいつのドライバなんて付属してないだろうと思うわけで、製品みてもサポートOSにLinuxなんて入っているわけがない。
そうなると悪戦苦闘することは目に見えていたが、まあとりあえずやってみようと。
ダメだったらノート用の11nの子機にすればいいだろうし、最悪ヤフオクでうっぱらえばいいだろう。
ということで挑戦が始まった。
とりあえず、ぶっさしてみる。
# lsusb
Bus 006 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 001 Device 002: ID 07aa:0043 Corega K.K.
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
とりあえず刺さったことは認識されたみたい。
# lsusb -v -s 02
Bus 001 Device 002: ID 07aa:0043 Corega K.K.
Device Descriptor:
bLength 18
bDescriptorType 1
bcdUSB 2.00
bDeviceClass 0 (Defined at Interface level)
bDeviceSubClass 0
bDeviceProtocol 0
bMaxPacketSize0 64
idVendor 0x07aa Corega K.K.
idProduct 0x0043
bcdDevice 1.00
iManufacturer 1 Realtek
iProduct 2 CG-WLUSB300N
iSerial 3 00e04c000001
以下略
どうもチップは蟹のようだがわからん。
そこで、付属のドライバCDの中身をのぞいてみる。
I:DriverCG-WLUSB300NWinXP2Knet8192u.inf
;; net8192u.inf
;;
;; Realtek RTL8192U Wireless 802.11n USB 2.0 Network Adapter
;;
;; Copyright (C) 2008 Realtek Semiconductor Corp.
;;
;; this release is primarily for WHQL test.
;;
RTL8192Uっていうチップらしい。
んで、とりあえず蟹さんのサイトいってみてドライバ探すも当然のごとく無い。
さて、困ったといろいろ調べていると、linuxでwindows用の無線lanドライバを使えるようにしている素敵なプロジェクトがあるようだ。
ndiswrapperってやつらしい。
んじゃ、まず探してみようじゃないか。
# aptitude search ndiswrapper
p ndiswrapper-common – ndiswrapper 用ユーティリティの利用に必要な共通
p ndiswrapper-source – Source for the ndiswrapper Linux kernel module
p ndiswrapper-utils-1.9 – ndiswrapper Linux カーネルモジュール用ユーザス
どうやらdebian/sidではバイナリは配布されていないようだがソースがあるなら十分だ。
つっこむしかないだろ。
# aptitude install ndiswrapper-source ndiswrapper-utils-1.9
# dpkg -L ndiswrapper-source
/.
/usr
/usr/src
/usr/src/ndiswrapper.tar.bz2
/usr/share
/usr/share/doc
/usr/share/doc/ndiswrapper-source
/usr/share/doc/ndiswrapper-source/changelog.gz
/usr/share/doc/ndiswrapper-source/NEWS.Debian.gz
/usr/share/doc/ndiswrapper-source/copyright
/usr/share/doc/ndiswrapper-source/README.Debian
/usr/share/doc/ndiswrapper-source/changelog.Debian.gz
# cd /usr/src
# tar jxvf ndiswrapper.tar.bz2
# cd modules/ndiswrapper
# make
Makefile:34: *** Cannot find kernel version in /lib/modules/2.6.26-2-amd64/build, is it configured?. 中止.
あ、はい。
怒られた。
kernel-header入れてないようです。
# aptitude install linux-headers-2.6.26-2-amd64
# make
# make install
いけた。
んじゃ、窓用のドライバをゲットしてだな。
# wget http://corega.jp/support/download/driver/wlusb300n_101.exe
# unzip wlusb300n_101.exe
# cd wlusb300n_101/Driver/CG-WLUSB300N/WinX64/
# ndiswrapper -i net8192u.inf
installing net8192u …
# ndiswrapper -l
net8192u : driver installed
device (07AA:0043) present
どうやらndiswrapperにインストール成功したようだ。
これでmodprobeしてやればしあわせになれるんじゃね?
# modprobe ndiswrapper
強制終了
\(^o^)/
しかもlsmodしたら存在していてなおかつbusyになってるとかなんなの?死ぬの?
まあ、まて。
まずは順を追っていこうじゃないか。
ひとまず窓用ドライバを引っこ抜いた状態でmodprobeしてみようじゃないか。
# ndiswrapper -r net8192u
# modprobe ndiswrapper
何事もなくいける。
ということは窓用のドライバが問題なんだな。
ということでXP64用のドライバじゃなくて32bit用のドライバで試してみよう。
とりあえず32bit用のディレクトリに移動して
# ndiswrapper -i net8192u.inf
installing net8192u …
# ndiswrapper -l
net8192u : driver installed
device (07AA:0043) present
# modprobe ndiswrapper
# lsmod | grep ndis
ndiswrapper 216448 0
お。いけたくさくね?
が、見えない。
シスログみてみる。
Apr 27 12:29:21 debian kernel: [ 2102.790391] ndiswrapper version 1.54 loaded (smp=yes, preempt=no)
Apr 27 12:29:22 debian kernel: [ 2102.924469] usb 1-3: reset high speed USB device using ehci_hcd and address 2
Apr 27 12:29:22 debian loadndisdriver: loadndisdriver: load_driver(358): couldn’t load driver net8192u
Apr 27 12:29:22 debian kernel: [ 2103.069043] usbcore: registered new interface driver ndiswrapper
。。。
もうちょっと詳しい情報がないか調べる。
[ 874.315111] ndiswrapper (check_nt_hdr:150): kernel is 64-bit, but Windows driver is not 64-bit;bad magic: 010B
[ 874.315163] ndiswrapper (load_sys_files:206): couldn’t prepare driver ‘net8192u’
[ 874.316795] ndiswrapper (load_wrap_driver:108): couldn’t load driver net8192u; check system log for messages from ‘loadndisdriver’
やっぱ64bitドライバじゃないとダメなんじゃないか。
だがしかしXP用のやつはハングしたんだよなー。
残ってるのはVista用なんだがこっちも間違いなくダメだよな。
まあ、とりあえずやってみる。
で、やっぱだめだった。dmesgたたいたらいろいろエラーはいてる。
とりあえず、もっかいXP64用のドライバでたたいてdmesgはかせる。
[ 2792.589989] ndiswrapper version 1.54 loaded (smp=yes, preempt=no)
[ 2792.728772] usb 1-3: reset high speed USB device using ehci_hcd and address 2
[ 2792.867153] ndiswrapper (link_pe_images:575): fixing KI_USER_SHARED_DATA address in the driver
[ 2792.868757] ndiswrapper: driver net8192u (Realtek Semiconductor Corp.,10/28/2008,5.1352.1028.2008) loaded
[ 2792.872342] BUG: unable to handle kernel NULL pointer dereference at 0000000000000018
[ 2792.872357] IP: [<ffffffffa01e74c6>] :ndiswrapper:USBD_InterfaceIsDeviceHighSpeed+0x7/0x12
[ 2792.872396] PGD 1f7d4d067 PUD 1f14bf067 PMD 0
[ 2792.872405] Oops: 0000 [1] SMP
BUG?
バグですか?
OKわかった。
カーネルのバージョン戻すわ。
。。。
2.6.24, 2.6.26系全滅。
むかついて2.6.29にしてもダメ。
無駄だろうけどmodule-assistant使って
m-a prepare
m-a a-i ndiswrapper
でいれてみたけどやっぱだめ。
一応2chでCG-WLUSB300Nがubuntuでさっくりndiswrapperで動いたって報告があったんだけども。
ubuntuでいけるならdebianでも余裕だと思うんだが。
ndiswrapperの問題なのかwindowsドライバの方の問題のどっちかだとは思う。
64bitだからか?
realtekのサイトにいってもwindowsドライバさえ配布してないし、なんか怪しい。
ひとまず今日のところは引き下がります。
追記
Debian lenny 32bit + ndiswrapperなら動きました。
64bit環境においてndiswrapperかWindowsドライバのどちらかが問題なのだと思われます。
「linuxで無線lan(挫折)」への1件のフィードバック