linux wifi 8192移植 及部分wifi工具的使用

8192 在imx53 linux上移植
8192wifi驱动

1.编译8192.ko

编译过程是进入8192,执行
./make_drv
选1
添加一个新的CONFIG_PLATFORM_ARM_MX53=y,把其他的那个改成n
 编辑Makefile
添加下面代码
 ifeq ($(CONFIG_PLATFORM_ARM_MX53), y)
EXTRA_CFLAGS += -DCONFIG_LITTLE_ENDIAN -DCONFIG_WISTRON_PLATFORM
ARCH := arm
CROSS_COMPILE := /opt/freescale/usr/local/gcc-4.4.4-glibc-2.11.1-multilib-1.0/arm-fsl-linux-gnueabi/bin/arm-none-linux-gnueabi-
KVER  := 2.6.35
KSRC ?= /home/vmuser/ltib_x7/ltib/rpm/BUILD/X7_kernel
endif
执行
make
会产生8192cu.ko
搞到板子上
insmod 8192cu.ko


2. 启动wlan0

ifconfig -a 会发现wlan0
ifconfig wlan0 192.168.2.1

ifconfig wlan0 up


3.设置8192为client

#wpa_supplicant 服务端程序,使用配置脚本wpa_supplicant.conf 自动连接到ap
#wpa_cli用于交互的客户端程序,比如可以用于手动连接到某个ap
./wpa_supplicant -i wlan0 -c  /etc/wpa_supplicant.conf   &
#自动获取ip地址
udhcpc -i wlan0


#/etc/wpa_supplicant.conf            
ctrl_interface=/var/run/wpa_supplicant
ctrl_interface_group=root
#ap_scan=1
network={
ssid="mywlan"
psk="1234567890"
        proto=WPA2
        key_mgmt=WPA-PSK
pairwise=TKIP
group=TKIP
        priority=20
}



4.设置8192为ap:

#hostapd 服务端程序,使用脚本hostapd.conf自动配置信息,配置文件hostapd.conf
#hostapd_cli用于交互的客户端程序,比如
#hostpd_cli all_sta列出所有的已连接的client
#iwlist wlan0 scan ; cat /proc/net/rtl819xC/wlan0/best_channel 查看最好的channel
./hostapd ./hostapd.conf -B
#启动dhcp服务器:
#配置文件位于/etc/dhcpd.conf 
dhcpd wlan0
//hostapd.conf
interface=wlan0
bridge=br0
ssid=songtest
hw_mode=g
channel=11
wpa_key_mgmt=WPA-PSK

logger_syslog=-1
logger_syslog_level=2
logger_stdout=-1
logger_stdout_level=2

dump_file=/tmp/hostapd.dump
ctrl_interface=/var/run/hostapd
ctrl_interface_group=0

beacon_int=100
dtim_period=2
max_num_sta=255
rts_threshold=2347
fragm_threshold=2346
macaddr_acl=0
auth_algs=3
ignore_broadcast_ssid=0
wmm_enabled=1

wmm_ac_bk_cwmin=4
wmm_ac_bk_cwmax=10
wmm_ac_bk_aifs=7
wmm_ac_bk_txop_limit=0
wmm_ac_bk_acm=0

wmm_ac_be_aifs=3
wmm_ac_be_cwmin=4
wmm_ac_be_cwmax=10
wmm_ac_be_txop_limit=0
wmm_ac_be_acm=0
wmm_ac_vi_aifs=2
wmm_ac_vi_cwmin=3
wmm_ac_vi_cwmax=4
wmm_ac_vi_txop_limit=94
wmm_ac_vi_acm=0

wmm_ac_vo_aifs=2
wmm_ac_vo_cwmin=2
wmm_ac_vo_cwmax=3
wmm_ac_vo_txop_limit=47
wmm_ac_vo_acm=0
ieee80211n=1
ht_capab=[HT40-][SHORT-GI-20][SHORT-GI-40]
eapol_key_index_workaround=0
eap_server=0
own_ip_addr=192.168.2.1

wpa=2
wpa_passphrase=1234567890
wpa_pairwise=CCMP

#/etc/dhcpd.conf 
ddns-update-style interim;
ignore client-updates;
option SIP code 120 = string;
subnet 192.168.2.0  netmask 255.255.255.0 {

# --- default gateway
        option routers                  192.168.2.1,192.168.2.2,192.168.2.3;
        option subnet-mask              255.255.255.0;
        option nis-domain               "domain.org";
        option domain-name              "domain.org";
#       option SIP                      0:7:65:78:61:6d:70:6c:65:3:63:6f:6d:0:7:65:78:61:6d:70:6c:65:3:6e:65:74;
        option SIP                      1:24:45:67:89;
        option domain-name-servers      203.145.184.13;
        option broadcast-address        192.168.1.255;
        option time-offset              -18000; # Eastern Standard Time
#       option ntp-servers              192.168.1.1;
#       option netbios-name-servers     192.168.1.1;
# --- Selects point-to-point node (default is hybrid). Don't change this unless
# -- you understand Netbios very well
#       option netbios-node-type 2;

        range dynamic-bootp 192.168.2.3 192.168.2.254;


        #default-lease-time 1000;
        default-lease-time 21600;
        #max-lease-time 1200;
        max-lease-time 6000;

        # we want the nameserver to appear at a fixed address
        host ns {
                next-server marvin.redhat.com;
                hardware ethernet 12:34:56:78:AB:CD;
                fixed-address 207.175.42.254;
        }
        host anand {
                        hardware ethernet 00:11:11:07:80:68;
                        fixed-address 192.168.2.155;
                        option host-name "anand";
        }
        host dhcphost {
                        hardware ethernet 00:04:9f:96:9c:4d;
                        fixed-address 192.168.2.168;
                        option host-name "dhcphost";
        }
}


直接使用无线管理工具 wireless_tools ,也能实现8192与远端 AP 的链接以及无线网络的通信。
其中, iwconfig 用来配置无线网卡, iwlist 用来搜索无线网络。
ifconfig wlan0 192.168.2.2 netmask 255.255.254.0 up /*打开网络*/
iwlist wlan0 scanning /*不知道无线网络名时搜索网络名 */
iwconfig wlan0 essid “mywlan”/*指定无线网络名 dlink*/
iwconfig wlan0 key 1234567890 /*指定访问密码*/



  • 0
    点赞
  • 6
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值