LinuxForum.Fans
Тема

Собрать и установить дравер Wi-Fi

Автор: Vovancheg 14 сообщений 6245 просмотров
#233399

Доброго времени суток!
Нужна помощь в сборке и установке драйвера Wi-Fi
Ситуация следующая:
Имеется медиаплеер, с прошивой на базе Linux на борту, купил к нему usb адаптер wi-fi.
Что сделал:
Скопировал дрова с прилагаемого CD для Linux в папку tmp на плеер, далее

Показать
Venus login: root
Password:


BusyBox v1.18.5 (2012-02-04 12:06:08 MSK) built-in shell (ash)
Enter 'help' for a list of built-in commands.

~ # cd /tmp/rtl8192su_linux_2.4_2.6.0003.0301.2010/
/tmp/rtl8192su_linux_2.4_2.6.0003.0301.2010 # make config
-sh: make: not found
/tmp/rtl8192su_linux_2.4_2.6.0003.0301.2010 # ls
HAL runwpa
Makefile wireless-rtl-ac-dc-power.sh
RadioPower.sh wlan0dhcp
firmware wlan0down
ieee80211 wlan0up
ifcfg-wlan0 wpa1.conf
readme.txt wpa_supplicant-0.6.9.tar.gz
release_note
/tmp/rtl8192su_linux_2.4_2.6.0003.0301.2010 # ./Makefile
-sh: ./Makefile: Permission denied
/tmp/rtl8192su_linux_2.4_2.6.0003.0301.2010 # chmod +x Makefile
/tmp/rtl8192su_linux_2.4_2.6.0003.0301.2010 # ./Makefile
./Makefile: line 1: shell: not found
./Makefile: line 1: LINUX_KSRC_MODULE: not found
./Makefile: line 2: shell: not found
./Makefile: line 2: RTL819x_DIR: not found
./Makefile: line 3: shell: not found
./Makefile: line 3: KVER: not found
./Makefile: line 4: KVER: not found
./Makefile: line 4: KSRC: not found
./Makefile: line 5: RTL819x_DIR: not found
./Makefile: line 5: RTL819x_FIRM_DIR: not found
./Makefile: line 6: HAL_SUB_DIR: not found
./Makefile: line 7: RTL819x_DIR: not found
./Makefile: line 7: MODULE_FILE: not found
./Makefile: line 11: all:: not found
./Makefile: line 12: syntax error: unexpected word (expecting ")")
/tmp/rtl8192su_linux_2.4_2.6.0003.0301.2010 #

~ # uname -a
Linux Venus 2.6.12.6-VENUS #323636_r7 Fri Dec 23 15:17:58 MSK 2011 mips GNU/Linux

Что не так можете помочь?

#233402

в readme.txt нет описания установки?

#233403
Vovancheg написал:
text
/tmp/rtl8192su_linux_2.4_2.6.0003.0301.2010 # ./Makefile
-sh: ./Makefile: Permission denied
/tmp/rtl8192su_linux_2.4_2.6.0003.0301.2010 # chmod +x Makefile
/tmp/rtl8192su_linux_2.4_2.6.0003.0301.2010 # ./Makefile

Что это за странные действия?
Что написано в readme.txt?

#233413

в readme написано что нужно собрать драйвер и сделать make install

Показать
Release Date: 2009-0825, ver 0003
RTL8192SU Linux driver
--This driver supports RealTek rtl8192SU USB Wireless LAN NIC
for
2.6 kernel:
Fedora Core 2/3/4/5, Debian 3.1, Mandrake 10.2/Mandriva 2006,
SUSE 9.3/10.1/10.2, Gentoo 3.1, Ubuntu 7.10/8.04, etc.
2.4 kernel:
Redhat 9.0/9.1

===============================================================================
Component
===============================================================================
The driver is composed of several parts:
1. Firmare to make nic work
1.1 firmare/RTL8192SU

2. Module source code
2.1 ieee80211
2.2 HAL/rtl8192u
2.3 wpa_supplicant-0.5.10 (User can download the latest version from
internet also, but it is suggested to use default package contained
in the distribution because there should less compilation issue.)

3. Script to build the modules
3.1 Makefile

4. Script to load/unload modules
4.1 wlan0up
4.2 wlan0down

5. Script and configuration for DHCP
5.1 wlan0dhcp
5.2 ifcfg-wlan0

6. Example of supplicant configuration file:
6.1 wpa1.conf

7. Script to run wpa_supplicant
7.1 runwpa

===============================================================================
Installation
===============================================================================
<<Method 1>>
Runing the scripts accomplish all operations including building up modules
from the source code, installing driver to the kernel and starting up the nic.
1. Build up the drivers from the source code
make

2. Install the driver to the kernel
make install
reboot

3. bring up wlan if nic is not brought up by GUI, such as NetworkManager
ifconfig wlan0 up
Note: use ifconfig to check whether wlan0 is brought up and use iwconfig to check your wlan interface name,
since it may change wlan0 to wlan1,etc.

<<Method 2>>
Or only load the driver module to kernel and start up nic.
1. Build up the drivers from the source code
make
2. Copy firmware to /lib/firmware/ or /lib/firmware/(KERNEL_VERSION)/
cp -rf firmware/RTL8192SU /lib/firmware
or
cp -rf firmware/RTL8192SU /lib/firmware/(KERNEL_VERSION)
Note: This depends on whether (KERNEL_VERSION) subdirectory exists under /lib/firmware

3. Load driver module to kernel and start up nic.
./wlan0up
Note: when "insmod: error inserting 'xxxx.ko': -1 File exists" comes out
after run ./wlan0up, please run ./wlan0down first, then it should
be ok..
Note: If you see the message of "unkown symbol" during ./wlan0up, it
is suggested to build driver by <<Method 1>>.

===============================================================================
Set wireless lan MIBs
===============================================================================
This driver uses Wireless Extension as an interface allowing you to set
Wireless LAN specific parameters.

Current driver supports "iwlist" to show the device status of nic
iwlist wlan0 [parameters]
where
parameter explaination [parameters]
----------------------- -------------
Show available chan and freq freq / channel
Show and Scan BSS and IBSS scan[ning]
Show supported bit-rate rate / bit[rate]

For example:
iwlist wlan0 channel
iwlist wlan0 scan
iwlist wlan0 rate

Driver also supports "iwconfig", manipulate driver private ioctls, to set
MIBs.

iwconfig wlan0 [parameters] [val]
where
parameter explaination [parameters] [val] constraints
----------------------- ------------- ------------------
Connect to AP by address ap [mac_addr]
Set the essid, join (I)BSS essid [essid]
Set operation mode mode {Managed|Ad-hoc}
Set keys and security mode key/enc[ryption] {N|open|restricted|off}

For example:
iwconfig wlan0 ap XX:XX:XX:XX:XX:XX
iwconfig wlan0 essid "ap_name"
iwconfig wlan0 mode Ad-hoc
iwconfig wlan0 essid "name" mode Ad-hoc
iwconfig wlan0 key 0123456789 [2] open
iwconfig wlan0 key off
iwconfig wlan0 key restricted [3] 0123456789
Note: Better to set these MIBS without GUI such as NetworkManager and be sure that our
nic has been brought up before these settings. WEP key index 2-4 is not supportted by
NetworkManager.

===============================================================================
Getting IP address
===============================================================================
After start up the nic, the network needs to obtain an IP address before
transmit/receive data.
This can be done by setting the static IP via "ifconfig wlan0 IP_ADDRESS"
command, or using DHCP.

If using DHCP, setting steps is as below:
(1)connect to an AP via "iwconfig" settings
iwconfig wlan0 essid [name] or
iwconfig wlan0 ap XX:XX:XX:XX:XX:XX

(2)run the script which run the dhclient
./wlan0dhcp
or
dhcpcd wlan0
(Some network admins require that you use the
hostname and domainname provided by the DHCP server.
In that case, use
dhcpcd -HD wlan0)


===============================================================================
WPAPSK/WPA2PSK
===============================================================================
Wpa_supplicant helps to secure wireless connection with the protection of
WPAPSK/WPA2PSK mechanism.

If the version of Wireless Extension in your system is equal or larger than 18,
WEXT driver interface is recommended. Otherwise, IPW driver interface is advised.
Note: Wireless Extension is defined us "#define WIRELESS_EXT" in Kernel
Note: To check the version of wireless extension, please type "iwconfig -v"


If IPW driver interface is used, it us suggested to follow the steps from 1 to 6.
If wpa_supplicant has been installed in your system, only steps 5 and 6 are required
to be executed for WEXT driver interface.

To see detailed description for driver interface and wpa_supplicant, please type
"man wpa_supplicant".

(1)Download latetest source code for wpa supplicant or use wpa_supplicant-0.5.10
attached in this package. (It is suggested to use default package contained
in the distribution because there should less compilation issue.)

Unpack source code of WPA supplicant:

tar -zxvf wpa_supplicant-0.5.10.tar.gz (e.g.)
cd wpa_supplicant-0.5.10

(2)Create .config file:
cp defconfig .config

(3)Edit .config file, uncomment the following line if ipw driver interface
will be applied:
#CONFIG_DRIVER_IPW=y.

(4)Build and install WPA supplicant:
make
cp wpa_cli wpa_supplicant /usr/local/bin

NOTE:
1. If make error for lack of <include/md5.h>, install the openssl lib(two ways):
(1) Install the openssl lib from corresponding installation disc:
Fedora Core 2/3/4/5(openssl-0.9.71x-xx),
Mandrake10.2/Mandriva10.2(openssl-0.9.7x-xmdk),
Debian 3.1(libssl-dev), Suse 9.3/10.0/10.1(openssl_devl),
Gentoo(dev-libs/openssl), etc.
(2) Download the openssl open source package from www.openssl.org, build and
install it.
2. If make errors happen in RedHat(and also Fedora Core) for kssl.h,
please add lines below into Makefile
CPPFLAGS+=-I/usr/kerboros/include

(5)Edit wpa_supplicant.conf to set up SSID and its passphrase.
For example, the following setting in "wpa1.conf" means SSID
to join is "BufAG54_Ch6" and its passphrase is "87654321".

Example 1: Configuration for WPA-PWK
network={
ssid="BufAG54_Ch6"
#scan_ssid=1 //see note 3
proto=WPA
key_mgmt=WPA-PSK
pairwise=CCMP TKIP
group=CCMP TKIP WEP104 WEP40
psk="87654321"
priority=2
}

Example 2: Configuration for LEAP
network={
ssid="BufAG54_Ch6"
key_mgmt=IEEE8021X
group=WEP40 WEP104
eap=LEAP
identity="user1"
password="1111"
}
Example 3: Linking to hidden ssid given AP's security policy exactly.(see note 3 below)
ap_scan=2
network={
ssid="Hidden_ssid"
proto=WPA
key_mgmt=WPA-PSK
pairwise=CCMP
group=CCMP
psk="12345678"
}

Example 4: Linking to ad-hoc (see note 4 below)
ap_scan=2
network={
ssid="Ad-hoc"
mode=1
proto=WPA
key_mgmt=WPA-NONE
pairwise=NONE
group=TKIP
psk="12345678"
}
Note: 1. proto=WPA for WPA, proto=RSN for WPA2.
2. If user needs to connect an AP with WPA or WPA2 mixed mode, it is suggested
to set the cipher of pairwise and group to both CCMP and TKIP unless you
know exactly which cipher type AP is configured.
3. When connecting to hidden ssid, explicit security policy should be given with
ap_scan=2 being setting.
4. It is suggested setting ap_scan to 2 and mode to 1 when linking to or creating an ad-hoc. Group and pairwise
cipher type should also be explicit, always with group setting to TKIP or CCMP and pairwise setting
to NONE. Lower version wpa_supplicant may not allow setting group to CCMP with pairwise setting to NONE.
So if any problem, you may try to set both group and pairwise to CCMP, leaving other setting unchanged, when
connecting to an CCMP-encrypted ad-hoc.
5. More config setting option, please refer to wpa_supplicant.conf in wpa_supplicant.tar.gz that we provide.

(6)Execute WPA supplicant (Assume rtl8192E and related modules had been
loaded):
./runwpa

Note: The script runwpa will check Wireless Extension version automatically.
If the version of Wireless Extension is equal or larger than 18, the
option of "-D wext" is selected. If the version of Wireless extension
is less than 18, the option of "-D ipw" is selected.

===============================================================================
For kernel 2.4 notes
===============================================================================
First of all, we have to install the necessary tools for building the driver. In the RedHat9 installation, please
choose the "Customize the set of packages to be install" and include two packages "Development Tools", "Kernel Development".

The RedHat 9 (kernel 2.4.20-8) just suppports the WEP security for Wifi. We have to patch the kernel with updating
wireless extension so that the kernel just supports the WPA, WPA2 functionalities by stardard wireless extension. This
driver had been verified on the patched 2.4.20-8 kernel and the WPA/WPA2 PSK works fine on the patched kernel.

First of all, we must have three patch file to update the wireless extension.
1. iw241_we16-6.diff (http://www.hpl.hp.com/personal/Jean_Tourrilhes/Linux/iw241_we16-6.diff)
2. iw249_we17-13.diff (http://www.hpl.hp.com/personal/Jean_Tourrilhes/Linux/iw249_we17-13.diff)
3. iw240_we18-5.diff (http://www.hpl.hp.com/personal/Jean_Tourrilhes/Linux/iw240_we18-5.diff)

Copy these three patch files to the patient directory of the linux kernel source folder and use the following
command to patch the RedHat 9 kernel.
$> patch -p0 < ./iw241_we16-6.diff
$> patch -p0 < ./iw249_we17-13.diff
$> patch -p0 < ./iw240_we18-5.diff

After patching the kernel, please remember to re-build the updated kernel/modules and use it for your target platform.
Now, the patched kernel had got the ability to support the WPA/WPA2 PSK functionalities with wireless extension interface.

Reminding: At the first time to use the wpa_supplicant, pleasee remember to compile the wpa_supplicant with the updated
kernel so that the wpa_supplicant will get the latest wireless extension version for supporting more functionalities.

Finally, the kernel 2.4 can't support the WPS functionality.
#233445
Vovancheg написал:
-sh: make: not found

Похоже у вас нет утилиты make.

Vovancheg написал:
/tmp/rtl8192su_linux_2.4_2.6.0003.0301.2010 # ./Makefile
-sh: ./Makefile: Permission denied
/tmp/rtl8192su_linux_2.4_2.6.0003.0301.2010 # chmod +x Makefile
/tmp/rtl8192su_linux_2.4_2.6.0003.0301.2010 # ./Makefile

Makefile не нужно запускать ! Он содержит правила для make.
http://ru.wikipedia.org/wiki/Make

#233477
Vovancheg написал:
1. Build up the drivers from the source code
make

2. Install the driver to the kernel
make install
reboot

Вот же написано как устанавливать.

#234539

Vovancheg, идея без спец. подготовки мёртвая.
для начала надо разжиться исходниками прошивки т.к. вам её понадобится пересобрать её полностью...
ЗЫ: людей знающих этот процесс хоть сколь-нибудь подробно на форуме, к сожалению, нет....

#234544

Fat-Zer, может так взлетит? :rolleyes:
(сам я нифига в этом не понимаю)

#234553
drBatty написал:
может так взлетит?

просто - точно не взлетит... на плеере стоит флешка, на которой записан образ(скорей всего в какой-нить squashfs или jffs2). Даже если повезёт и ФС записываемая, то компилятора и утилит для сборки там нет... придётся заниматься кросс-компиляцией(архитектура на железке - mips). Отсюда первая трабла - собрать кросс-тулчейн. А для того. чтобы собрать модуль нужны ещё, как минимум, исходники ядра, а то и объектники... Их нужно выцыганить как-то у производителя, если он правоверный, то он их выложил на сайте, если нет, то при лучшем раскладе вышлет после переписки...
Потом драйвер вафли не станет компилиться, ибо не заточен он под мипс и вообще написан быдлом - придётся править.

В общем "собрать модуль" вроде звучит не сложно, а проблем на год-два самообучения...

#234557

Насколько мне известно, в медиаплеерах должно указываться какой конкретно поддерживается чип wifi.

#234558
Fat-Zer написал:
В общем "собрать модуль" вроде звучит не сложно, а проблем на год-два самообучения...

оно да. но может в инете уже есть success story?

#234565
drBatty написал:
оно да. но может в инете уже есть success story?

может быть... тогда флаг в руки и гугл в зубы...
мне правда он выдал только о том, что на ufo что-то похожее потыкали палочкой и отошли... там есть ссылка на xbmc.org, но там, вроде, альтернативную прошивку предлагают...

#234567

Fat-Zer, ну я тоже ничего путного не знаю. и мой гугл тоже...

#236088

Благодарю всех за ответы и внимание.
Гемор с данной вайфлёй устранился. Я отправил исходники драйвера и мне собрали готовый модуль, добавил его вручную, вроде все работает.

P.S. Linux конечно интересно, но на его изучение просто нет времени.

Войдите или зарегистрируйтесь, чтобы ответить.