sys_init_module: 'athrs_gmac'->init suspiciously returned 1, it should follow 0/-E convention
sys_init_module: loading module anyway...
Call Trace:
[<801e5b48>] dump_stack+0x8/0x34
[<80046acc>] sys_init_module+0x150/0x214
[<8000d984>] stack_done+0x20/0x3c
Cpu 0
$ 0 : 00000000 00000074 0000007c 00000001
$ 4 : 80248350 00001e95 00000001 00001e95
$ 8 : 0000000a 00000000 00000001 20646576
$12 : 000000cd 00000032 00000001 00000000
$16 : 00000200 81f90840 80ccc000 00000000
$20 : 80ccfca0 80ccfc88 00437a8c 00000002
$24 : 00000002 c0875be0
$28 : 81c86000 81c87d38 0000003a 80166d50
Hi : 00000000
Lo : 1efac000
epc : 80166d50 skb_put+0x74/0x90
Tainted: P
ra : 80166d50 skb_put+0x74/0x90
Status: 1000ff03 KERNEL EXL IE
Cause : 10800024
PrId : 00019374 (MIPS 24Kc)
Modules linked in: umac(+) ath_dev(P) ath_rate_atheros(P) ath_hal(P) asf(P) adf nf_nat_sip nf_conntrack_sip nf_nat_rtsp nf_conntrack_rtsp nf_nat_h323 nf_nat_tftp nf_conntrack_tftp nf_nat_ftp nf_conntrack_ftp nf_nat_pptp nf_conntrack_pptp tp_domain athrs_gmac statistics wlan_warn pptp pppol2tp br_filter ts_kmp cls_fw cls_basic sch_sfq sch_prio sch_htb ipt_TRIGGER ipt_REJECT ipt_REDIRECT ipt_MASQUERADE iptable_nat iptable_filter ip_tables nf_nat_proto_gre nf_nat nf_conntrack_ipv4 nf_defrag_ipv4 xt_state xt_conntrack nf_conntrack_h323 nf_conntrack_proto_gre nf_conntrack ipt_multiurl xt_time xt_string xt_multiport xt_mac xt_iprange xt_comment xt_TCPMSS xt_MARK xt_tcpudp x_tables
Process insmod (pid: 395, threadinfo=81c86000, task=81c84a18, tls=00000000)
Stack : 00000040 c09559bc 00000e10 00000708 81f99043 81f99020 81f99e30 81f99840
802238ac 00000200 00000000 c09559bc 80ccc000 c09585e8 80ccfca0 c095d66c
00000003 00000001 00000001 00000001 00000001 c07ee690 00000200 00000000
00000001 80ccc000 c09382b4 00436ef8 00437a8c 00000002 0000003a c094be00
c0ad5000 81c87e10 80ccfb84 c095c474 00000008 00000001 00000001 00000001
...
Call Trace:
[<80166d50>] skb_put+0x74/0x90
[<c09559bc>] ath_tx_paprd_init+0x3d4/0x578 [ath_dev]
[<c094be00>] ath_tx_init+0xbc/0x18c [ath_dev]
[<c0a913e0>] __ath_attach+0xd4/0x288 [umac]
[<c0a91c94>] init_ahb+0x1c0/0x26c [umac]
[<c0ad9040>] init_module+0x40/0x6c [umac]
[<80002468>] _stext+0x68/0x1ec
vlan init params fail.
sys_init_module: 'athrs_gmac'->init suspiciously returned 1, it should follow 0/-E convention
sys_init_module: loading module anyway...
Call Trace:
[<801e5b48>] dump_stack+0x8/0x34
[<80046acc>] sys_init_module+0x150/0x214
[<8000d984>] stack_done+0x20/0x3c
sudo apt-get install libacl1-dev
P0 P1 P2-P5
CPU WAN LAN
*/
* Port map
* P0 P5 P1-P4
* CPU WAN LAN
*/
export INSTALL_ROOT_FOR_BOARD=$(TOPDIR)/rootfs.$(BOARD_TYPE)
rm -Rf $(INSTALL_ROOT_FOR_BOARD)
cp -Rf $(INSTALL_ROOT) $(INSTALL_ROOT_FOR_BOARD)
NetUSB: version magic '2.6.31--LSDK-9.2.0_U6.616 mod_unload modversions MIPS32_R2 32BIT ' should be '2.6.31--LSDK-9.2.0_U6.616 mod_unload MIPS32_R2 32BIT '
CFG_CMD_MII | CFG_CMD_PING | CFG_CMD_NET | CFG_CMD_JFFS2 | CFG_CMD_ENV | \
CFG_CMD_FLASH | CFG_CMD_LOADS | CFG_CMD_RUN | CFG_CMD_LOADB | CFG_CMD_ELF | CFG_CMD_ETHREG ))
#ifdef CONFIG_PID_MR302001
SETBITVAL(gpio, GPIO_JUMPSTART_LED_BIT, GPIO_JUMPSTART_LED_ON);
SETBITVAL(gpio, GPIO_INTERNET_LED_BIT, GPIO_INTERNET_LED_ON);
SETBITVAL(gpio, GPIO_WLAN_LED_BIT, GPIO_WLAN_LED_ON);
SETBITVAL(gpio, 17, 0)
mv y.tab.c cfparse.c
GPN | GetParameterNames | 用来取得装置上的数据名称 |
GPV | GetParameterValues | 可以取得一个或多个数值,也可以取得完整径或部份路径的数值 |
SPV | SetParameterValues | 用来设定参数数值 |
GPA | GetParameterAttributes | 用来取得参数的特性:只读或可读写,以及主被动回报 |
SPA | SetParameterAttributes | 用来设定参数的特性:只读或可读写,以及主被动回报 |
- | Download | 用以指示 CPE 下载档案处理作为固件更新(FIrmware Upgrade)、设定更新(Config Upgrade),或其它特定的档案处理 |
- | Upload | 用以指示 CPE 上传档案处理作为设定备份(Config Export),或其它特定的档案处理(例如 System log export) |
ADD | AddObject | 新增参数 |
DEL | DeleteObject | 移除参数 |
{
skb->mark = CONVERT_PORT_ID (get_portid(vid));
}
{
0x00000001, 0x00000002, 0x00000004, 0x00000008,
0x00000010, 0x00000020, 0x00000040, 0x00000080,
0x00000100, 0x00000200, 0x00000400, 0x00000800,
0x00001000, 0x00002000, 0x00004000, 0x00008000,
0x00010000, 0x00020000, 0x00040000, 0x00080000,
0x00100000, 0x00200000, 0x00400000, 0x00800000,
0x01000000, 0x02000000, 0x04000000, 0x08000000,
0x10000000, 0x20000000, 0x40000000, 0x80000000
};
#define CONVERT_PORT_ID(nr) (port_id_array[(nr)])
{
for(;;)
{
ath_reg_wr(ATH_RESET, ATH_RESET_FULL_CHIP);
}
}
{
static struct timer_list wdt_timer;
init_timer(&wdt_timer);
wdt_timer.expires = jiffies + timeout*HZ;
wdt_timer.function = tp_reset_cpu_force;
wdt_timer.data = 1;
add_timer(&wdt_timer);
}
2.屏蔽掉所有非IPv6的包。
约定:
wan口eth1
lan口eth0、wlan0、wlan1
依赖:
ebtables、birdge-utils
命令样例
- brctl addif br-lan eth0
- brctl addif br-lan eth1
- brctl addif br-lan wlan0
- brctl addif br-lan wlan1
- ebtables -t broute -A BROUTING -p ! ipv6 -j DROP
$ 0 : 00000000 00000000 c0d0f09c 00000000
$ 4 : 81421ca0 81f7c000 81f6b420 81f7c000
$ 8 : 0000000c 00000002 00000002 ffffffff
$12 : 0000000f c0380000 c0380000 00000000
$16 : 00000000 00000001 81421ca0 81f7c000
$20 : 81421cc4 81421ca0 81f6b420 c0d435b0
$24 : 00000000 8011dd2c
$28 : 817c2000 817c3c68 801f0000 8011dad8
Hi : 00000733
Lo : 00179845
epc : c0d0f0d8 ath_netdev_hardstart+0x3c/0x284 [umac]
Tainted: P
ra : 8011dad8 dev_hard_start_xmit+0x244/0x328
Status: 1000ff03 KERNEL EXL IE
Cause : 80800008
BadVA : 0000001c
PrId : 00019374 (MIPS 24Kc)
txctl->mcast_rate = vap->iv_mcast_rate;
/* wangqun 2014-02-24 15:53:55
*
* for Bug 48543, dut以11M速率对mDNS(bonjour)报文进行转发,
* 建议使用1M
*
*/
if (unlikely(wbuf_is_bonjour(wbuf))) {
txctl->use_minrate = 1;
txctl->mcast_rate = 1000; //1/* 1Mbps */
ifneq ($(TP_CONFIG_FILE),)
@echo "--------Use new kernel config file dir!----------"
$(Q)$< -D $(TP_CONFIG_FILE) $(Kconfig)
else
$(Q)$< -D arch/$(SRCARCH)/configs/$@ $(Kconfig)
endif
Linux 提供了这样一个参数min_free_kbytes,用来确定系统开始回收内存的阀值,控制系统的空闲内存。值越高,内核越早开始回收内存,空闲内存越高。
[root@zyite-app01 root]# cat /proc/sys/vm/min_free_kbytes
163840
echo 963840 > /proc/sys/vm/min_free_kbytes
|
其他可选的临时解决方法:
关闭oom-killer
echo "0" > /proc/sys/vm/oom-kill
vi /etc/sysctl.conf
vm.oom-kill = 0
echo 1 > /proc/sys/vm/drop_caches
{
int i, j;
UINT8 *pStr = string;
int len = strlen(pStr);
for (i = 0, j = 0; i < len; i++)
{
if (pStr[i] == '\'') /*如果是单引号,要加上双引号*/
{
buffer[j++] = '"';
buffer[j++] = '\'';
buffer[j++] = '"';
}
{
buffer[j++] = '\''';
buffer[j++] = "%";
}
}
buffer[j] = 0;
return buffer;
}
[<8004fa40>] oom_kill_process+0x70/0x200
[<80050030>] __out_of_memory+0x170/0x1a8
[<800500dc>] out_of_memory+0x74/0xa0
[<80052fb0>] __alloc_pages_nodemask+0x440/0x55c
[<8004cd20>] grab_cache_page_write_begin+0x88/0xf4
[<80093c94>] block_write_begin+0x60/0x144
[<800940ec>] cont_write_begin+0x374/0x3e4
[<c0e5d74c>] fat_write_begin+0x54/0x60 [fat]
[<8004d9b0>] generic_file_buffered_write+0x114/0x38c
[<8004e2f8>] __generic_file_aio_write_nolock+0x454/0x4b0
[<8004eeec>] generic_file_aio_write+0x8c/0x12c
[<8006e130>] do_sync_write+0xd4/0x130
[<8006ed30>] vfs_write+0xac/0x140
[<8006ee28>] sys_pwrite64+0x64/0x9c
[<8000e204>] stack_done+0x20/0x3c
Normal per-cpu:
CPU 0: hi: 0, btch: 1 usd: 0
Active_anon:332 active_file:1842 inactive_anon:404
inactive_file:2122 unevictable:29 dirty:1 writeback:2126 unstable:0
free:190 slab:1664 mapped:779 pagetables:73 bounce:0
Normal free:760kB min:720kB low:900kB high:1080kB active_anon:1328kB inactive_anon:1616kB active_file:7368kB inactive_file:8488kB unevictable:116kB present:32512kB pages_scanned:16096 all_unreclaimable? no
lowmem_reserve[]: 0 0
Normal: 10*4kB 0*8kB 1*16kB 2*32kB 0*64kB 1*128kB 0*256kB 1*512kB 0*1024kB 0*2048kB 0*4096kB = 760kB
3993 total pagecache pages
8192 pages RAM
692 pages reserved
4943 pages shared
2969 pages non-shared
Out of memory: kill process 980 (smbd) score 177 or a child
Killed process 980 (smbd)
OutBuffer = (char *)malloc(BUFFER_SIZE + LARGE_WRITEX_HDR_SIZE + SAFETY_MARGIN);
[<801d2fdc>] dump_stack+0x8/0x34
[<8004fa40>] oom_kill_process+0x70/0x200
[<80050030>] __out_of_memory+0x170/0x1a8
[<800500dc>] out_of_memory+0x74/0xa0
[<80052fb0>] __alloc_pages_nodemask+0x440/0x55c
[<800553f4>] __do_page_cache_readahead+0xe0/0x23c
[<8005557c>] ra_submit+0x2c/0x38
[<8004d1d0>] filemap_fault+0x1f8/0x408
[<8005d4dc>] __do_fault+0x70/0x44c
[<8005ec88>] handle_mm_fault+0x32c/0xb5c
[<800101b0>] do_page_fault+0x100/0x300
page = get_page_from_freelist(gfp_mask|__GFP_HARDWALL, nodemask, order,
zonelist, high_zoneidx, ALLOC_WMARK_LOW|ALLOC_CPUSET,
preferred_zone, migratetype);
if (unlikely(!page))
page = __alloc_pages_slowpath(gfp_mask, order,
zonelist, high_zoneidx, nodemask,
preferred_zone, migratetype);
{
int nBoardType = swGetBoardType();
switch (nBoardType)
{
case BOARD_PB92:
case BOARD_AP151:
return wlanIntRateTable_450M[index];
case BOARD_AP123:
case BOARD_AP143:
/* added by ZQQ, support ap121, 09Jun14 */
case BOARD_AP121:
return wlanIntRateTable_150M[index];
/* by ZQQ, 09Jun14 */
default:
return wlanIntRateTable_300M[index];
}
}
svn merge -r HEAD:888 ./testsvn
svn ci -m "*)roll back to ver888"
#define devdbg(hw_cdc_net, fmt, arg...) \
printk(KERN_DEBUG "%s: " fmt "\n" , (hw_cdc_net)->net->name , ## arg)
#else
#define devdbg(hw_cdc_net, fmt, arg...) do {} while(0)
#endif
172.16.0.0~172.31.255.255
192.168.0.0~192.168.255.255
bridge name bridge id STP enabled interfaces
brIPPHONE 8000.00037fffffff no eth0.263
eth1.263
brMutliIPTV 8000.00037fffffff no eth0.1110
eth1.1110
brIPTV 8000.00037fffffff no eth0.4000
eth1.4000
br0 8000.000aeb130919 no eth0.1257
eth0
ath0
D: Ver= 2.00 Cls=ef(misc ) Sub=02 Prot=01 MxPS=64 #Cfgs= 1
P: Vendor=19d2 ProdID=1403 Rev=f0.18
S: Manufacturer=ZTE,Incorporated
S: Product=ZTE CDMA Technologies MSM
S: SerialNumber=AC6000ZTED000000
C:* #Ifs= 3 Cfg#= 1 Atr=c0 MxPwr=500mA
A: FirstIf#= 0 IfCount= 2 Cls=e0(wlcon) Sub=01 Prot=03
I:* If#= 0 Alt= 0 #EPs= 1 Cls=e0(wlcon) Sub=01 Prot=03 Driver=rndis_host
E: Ad=81(I) Atr=03(Int.) MxPS= 64 Ivl=2ms
I:* If#= 1 Alt= 0 #EPs= 2 Cls=0a(data ) Sub=00 Prot=00 Driver=rndis_host
E: Ad=82(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
E: Ad=01(O) Atr=02(Bulk) MxPS= 512 Ivl=4ms
I:* If#= 2 Alt= 0 #EPs= 2 Cls=08(stor.) Sub=06 Prot=50 Driver=(none)
E: Ad=02(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
E: Ad=83(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
{
return (desc->bInterfaceClass == USB_CLASS_WIRELESS_CONTROLLER &&
desc->bInterfaceSubClass == 1 &&
desc->bInterfaceProtocol == 3);
}
0x02, 0x16),
.driver_info = (unsigned long)&cdc_ncm_info,
},
ifeq ($(CONFIG_WIRELESS_CERTIFICATION), 1)
sed 's/# CONFIG_ETHREG is not set/CONFIG_ETHREG=y/' $(TOPDIR)/apps/$(BUSYBOX)/.config > $(TOPDIR)/apps/$(BUSYBOX)/.config.tmp; \
rm -f $(TOPDIR)/apps/$(BUSYBOX)/.config && mv $(TOPDIR)/apps/$(BUSYBOX)/.config.tmp $(TOPDIR)/apps/$(BUSYBOX)/.config
endif
cd $(TOPDIR)/apps/$(BUSYBOX); \
# echo 2 > /proc/sys/vm/drop_caches
To free pagecache, dentries and inodes:
echo 3 > /proc/sys/vm/drop_caches
ath_bstuck_tasklet: stuck beacon; resetting (bmiss count 9)
ath_bstuck_tasklet: stuck beacon; resetting (bmiss count 9)
ath_bstuck_tasklet: stuck beacon; resetting (bmiss count 9)
ath_bstuck_tasklet: stuck beacon; resetting (bmiss count 9)
ath_bstuck_tasklet: stuck beacon; resetting (bmiss count 9)
Wed Jan 1 01:17:19 2014,comm.c[151](verify_cb): subject = /OU=TP-LINK Branch/O=ACS/CN=192.168.1.100/ST=Internet/C=CN/L=Net
Wed Jan 1 01:17:19 2014,comm.c[153](verify_cb): err 20:unable to get local issuer certificate
pthread_attr_t attr2;
param.sched_priority = sched_get_priority_max(SCHED_RR);
pthread_attr_init(&attr2);
pthread_attr_setschedpolicy(&attr2,SCHED_RR);
pthread_attr_setschedparam(&attr2,¶m);
# cat passwd
root:x:0:0:root:/root:/bin/sh
admin:x:500:500:admin:/tmp/dropbear:/bin/sh
842 FTP正常的时候
# cat passwd
root:x:0:0:root:/root:/bin/sh
nobody:x:65534:65534:nobody:/home:/bin/sh
bin:x:1:1:bin:/bin:/bin/sh
admin:x:500:500:admin:/home:/bin/sh
guest:x:500:500:guest:/home:/bin/sh
LAN_FACT_IF_NAME = eth0.1
echo "rcS already have mount -t usbfs none /proc/bus/usb" ;\
else \
sed 's/mount -t ramfs -n none \/var/mount -t ramfs -n none \/var\nmount -t usbfs none \/proc\/bus\/usb/' $(INSTALL_ROOT_FOR_BOARD)/etc/rc.d/rcS > $(INSTALL_ROOT_FOR_BOARD)/etc/rc.d/rcS.tmp && \
mv -f $(INSTALL_ROOT_FOR_BOARD)/etc/rc.d/rcS.tmp $(INSTALL_ROOT_FOR_BOARD)/etc/rc.d/rcS && \
chmod 755 $(INSTALL_ROOT_FOR_BOARD)/etc/rc.d/rcS ; \
fi
ifneq ($(TP_CONFIG_FILE),)
@echo "--------Use new kernel config file dir!----------"
$(Q)$< -D $(TP_CONFIG_FILE) $(Kconfig)
else
$(Q)$< -D arch/$(SRCARCH)/configs/$@ $(Kconfig)
endif
CFLAGS_gpio.o += -DATH_SUPPORT_LED=$(ATH_SUPPORT_LED)
CFLAGS_gpio.o += -DGPIO_PIN_FUNC_0=$(GPIO_PIN_FUNC_0)
CFLAGS_gpio.o += -DGPIO_PIN_FUNC_1=$(GPIO_PIN_FUNC_1)
CFLAGS_gpio.o += -DGPIO_PIN_FUNC_2=$(GPIO_PIN_FUNC_2)
endif
3G USB的灯是GPIO26控制,高电平点亮。
USB电源使能用的GPIO8控制,高电平使能
(*p)++是先取出*p的值,让这个值++
*(P++)是先取出*p的值,让p++
所以,*p++等价于*(P++)
#define IF_RA_MANAGED 0x40
#define IF_RA_OTHERCONF 0x40
TRUNK_DIR=../
SCRIPT_DIR=$TRUNK_DIR/build/build_products
CONFIG_DIR=$TRUNK_DIR/build/products_config
i=0
mkdir $TRUNK_DIR/build/allimages
find $SCRIPT_DIR -type f -print |
while read LINE
do
#echo "Build For " $LINE
if ` echo $LINE | grep ".svn" > /dev/null `; then
# skip for svn
continue;
fi
if ` echo $LINE | grep "build_all_products.sh" > /dev/null `; then
# skip for ourself
continue;
fi
foldername=`echo $LINE | awk -F/ '{print substr($NF,7,length($NF) - 9)}'`
echo $foldername
if test -d $CONFIG_DIR/$foldername
then
echo $CONFIG_DIR/$foldername "exist, build it"
#chmod u+x $LINE
#/bin/bash $LINE
let i++
echo $i
else
echo $CONFIG_DIR/$foldername "not exist, skip it"
fi
echo "Build Done For " $LINE
done
echo "Build" $i products
升级软件:apt-get upgrade
更新系统:apt-get dist-upgrade
2.3、安装基础编译环境
1 | apt-get install build-essential |
2.3、编译安装 Zlib 库 (可不装)
1 2 3 4 5 | wget http://zlib.net/zlib-1.2.5.tar.gz tar -zxf zlib-1.2.5.tar.gz cd zlib-1.2.5/ ./configure --prefix=/usr/localmake && make install |
2.4、卸载旧版本 OpenSSL
1 2 | apt-get purge openssl rm -rf /etc/ssl #删除配置文件 |
vim /etc/ppp/pppoe.conf
修改下面几个值,其他的不要动
ETH=eth0 #根据服务网卡设定
USER=zhaosan
LINUX_PLUGIN=/etc/ppp/plugins/rp-pppoe.so
vim /etc/ppp/pppoe-server-options
下面是全部内容
require-chap
login
lcp-echo-interval 10
lcp-echo-failure 2
vim /etc/ppp/chap-secrets
"zhaosan" * "123456" *
vim options
local
ipv6 ,
in6_dev->cnf.forwarding = 1, in6_dev->cnf.accept_ra = 1
ndisc_router_discovery 1210 not accept, return
ndisc_router_discovery 1185 dev name = br0
ar9300_handle_radar_bb_panic: BB status=0x04008009 rifs=1 - disable
ar9300_reset[4523]: ar9300_stop_dma_receive failed
ndisc_router_discovery 1185 dev name = eth0.2
in6_dev->cnf.forwarding = 1, in6_dev->cnf.accept_ra = 1
ndisc_router_discovery 1210 not accept, return
ndisc_router_discovery 1185 dev name = ppp0
in6_dev->cnf.forwarding = 1, in6_dev->cnf.accept_ra = 1
ndisc_router_discovery 1210 not accept, return
ndisc_router_discovery 1185 dev name = ppp0
in6_dev->cnf.forwarding = 1, in6_dev->cnf.accept_ra = 1
ndisc_router_discovery 1210 not accept, return
ndisc_router_discovery 1185 dev name = ppp0
in6_dev->cnf.forwarding = 1, in6_dev->cnf.accept_ra = 1
ndisc_router_discovery 1210 not accept, return
ndisc_router_discovery 1185 dev name = ppp0
in6_dev->cnf.forwarding = 1, in6_dev->cnf.accept_ra = 1
ndisc_router_discovery 1210 not accept, return
240e:fa:2060:fc00::/64 dev br0 metric 1024 mtu 1500 advmss 1440 hoplimit 0
fe80::/64 dev eth0.2 proto kernel metric 256 mtu 1500 advmss 1440 hoplimit 0
fe80::/64 dev br0 proto kernel metric 256 mtu 1500 advmss 1440 hoplimit 0
fe80::/64 dev eth0 proto kernel metric 256 mtu 1500 advmss 1440 hoplimit 0
fe80::/64 dev wifi0 proto kernel metric 256 mtu 1500 advmss 1440 hoplimit 0
fe80::/64 dev eth0.1 proto kernel metric 256 mtu 1500 advmss 1440 hoplimit 0
fe80::/64 dev ath0 proto kernel metric 256 mtu 1500 advmss 1440 hoplimit 0
fe80::/64 dev ppp0 proto kernel metric 256 mtu 1480 advmss 1420 hoplimit 0
fe80::/10 dev ppp0 metric 1 mtu 1480 advmss 1420 hoplimit 0
fe80::/10 dev ppp0 proto kernel metric 256 mtu 1480 advmss 1420 hoplimit 0
ff00::/8 dev eth0.2 metric 256 mtu 1500 advmss 1440 hoplimit 0
ff00::/8 dev br0 metric 256 mtu 1500 advmss 1440 hoplimit 0
ff00::/8 dev eth0 metric 256 mtu 1500 advmss 1440 hoplimit 0
ff00::/8 dev wifi0 metric 256 mtu 1500 advmss 1440 hoplimit 0
ff00::/8 dev eth0.1 metric 256 mtu 1500 advmss 1440 hoplimit 0
ff00::/8 dev ath0 metric 256 mtu 1500 advmss 1440 hoplimit 0
ff00::/8 dev ppp0 metric 256 mtu 1480 advmss 1420 hoplimit 0
default via fe80::452c:96b1:b99b:966a dev ppp0 metric 255 mtu 1480 advmss 1420 hoplimit 0
default via fe80::452c:96b1:b99b:966a dev ppp0 proto kernel metric 1024 expires 672sec mtu 1480 advmss 1420 hoplimit 64
obj-m := hello.o
KERNELBUILD :=/lib/modules/$(shell uname -r)/build
default:
make -C $(KERNELBUILD) M=$(shell pwd) modules
clean:
rm -rf *.o *.ko *.mod.c .*.cmd *.markers *.order *.symvers .tmp_versions
(注意makefile里面要求的tab)
KERNELBUILD :=/lib/modules/$(shell uname -r)/build是编译内核模块需要的Makefile的路径,Ubuntu下是
/lib/modules/2.6.31-14-generic/build
make -C $(KERNELBUILD) M=$(shell pwd) modules 编译内核模块。-C 将工作目录转到KERNELBUILD,调用该目录下的Makefile,并向这个Makefile传递参数M的值是$(shell pwd) modules。
3. 编译模块
#sudo make (调用第一个命令default)
这时,在hello.c 所在文件夹就会有 hello.ko ,这个就是我们需要的内核模块啦
#sudo make clean
清理编译垃圾,hello.ko 也会清理掉。
4. 插入模块,让其工作。注意必须是root权限
我们用dmesg 就可以看到 产生的内核信息啦,Hello world!
$(SCRIPT_DIR)/feeds update -a
$(SCRIPT_DIR)/feeds install -a
mkdir -p /home/project/svn/IPlatform/board/model_qca_qca953x/sdk/ILQ_1_2_CS/build_dir/target-mips_r2_uClibc-0.9.33.2/busybox-1.19.4
cp -fpR ./src/* /home/project/svn/IPlatform/board/model_qca_qca953x/sdk/ILQ_1_2_CS/build_dir/target-mips_r2_uClibc-0.9.33.2/busybox-1.19.4
< --- & lt ;
> --- & gt ;
' --- & apos ;
" --- & quot ;
["provider"] = {
["read"] = { cb = provider_get }
},
["dyndns"] = {
["read"] = { cb = dyndns_get },
["write"] = { cb = dyndns_set },
["login"] = { cb = dyndns_login },
["logout"] = { cb = dyndns_logout },
["refresh"] = { cb = dyndns_refresh }
},
["noip"] = {
["read"] = { cb = noip_get },
["write"] = { cb = noip_set },
["login"] = { cb = noip_login },
["logout"] = { cb = noip_logout },
["refresh"] = { cb = noip_refresh }
}
}
function dispatch(http_form)
return ctl.dispatch(dispatch_tbl, http_form)
end
function _index()
return ctl._index(dispatch)
end
function index()
entry({"admin", "ddns"}, call("_index")).leaf = true
end
var URL_UPNP_SERVICE = $.su.url("/admin/upnp?form=service"); //data/upnp.json
enable = {
["read"] = {cb = read_enable},
["write"] = {cb = write_enable}
},
service = {
[".super"] = {cb = get_clients}
}
}
local sys = require "luci.sys"
local ctypes = require "luci.model.checktypes"
local enable = http_form["enable"]
if not ctypes.check_onoff(enable) then
return false, "invalid args"
end
if read_enable().enable ~= enable then
uci_r:set("upnpd", "config", "enable_upnp", enable == "on" and "1" or "0") --[[设置enable_upnp参数]]--
uci_r:commit("upnpd") --[[保存参数,写入flash]]--
sys.fork_exec(enable == "on" and UPNP_SH_ENABLE or UPNP_SH_DISABLE) --[[执行脚本]]--
end
return {
enable = enable
}
end
inet addr:192.168.0.100 Bcast:192.168.0.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:20 errors:0 dropped:0 overruns:0 frame:0
TX packets:148 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:3765 (3.6 KiB) TX bytes:9206 (8.9 KiB)
ath7 Link encap:Ethernet HWaddr 00:0A:EB:13:09:1A
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:886 errors:0 dropped:0 overruns:0 frame:0
TX packets:300 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:227757 (222.4 KiB) TX bytes:26312 (25.6 KiB)
# ifconfig ppp0
ppp0 Link encap:Point-Point Protocol
inet addr:192.168.5.103 P-t-P:192.168.5.101 Mask:255.255.255.255
UP POINTOPOINT RUNNING NOARP MULTICAST MTU:1480 Metric:1
RX packets:18 errors:0 dropped:0 overruns:0 frame:0
TX packets:40 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:3
RX bytes:738 (738.0 B) TX bytes:2183 (2.1 KiB)
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
192.168.5.101 * 255.255.255.255 UH 0 0 0 ppp0
192.168.1.0 * 255.255.255.0 U 0 0 0 br0
239.0.0.0 * 255.0.0.0 U 0 0 0 br0
default 192.168.5.101 0.0.0.0 UG 0 0 0 ppp0
{
WLAN_BASIC_CFG wlanBasicCfg;
swWlanBasicCfgGet(type, &wlanBasicCfg);
if (!wlanBasicCfg.bBridgeEnable)
{
PRINTF_ECHO("ERROR: APC Router ==> wlanBasicCfg.bBridgeEnable Not TRUE !!!");
return;
}
wlanMakeVap(type, ATH_VAP_AP, swWlanGetRealIdxByVidx(type, 0));
wlanSecurityInit(type, swWlanGetRealIdxByVidx(type, 0), 0);
wlanMacFiltInit(type, swWlanGetRealIdxByVidx(type, 0));
wlanWpsUp(type, swWlanGetRealIdxByVidx(type, 0));
wlanMakeVap(type, ATH_VAP_STA, wlanGetSTANum(type));
execFormatCmd("iwpriv %s vap_ind 0", wlanGetApDevName(type));
execFormatCmd("iwpriv ath%d vap_ind 0", wlanGetSTANum(type));
wlanWispFinalConf(type);
execFormatCmd("ifconfig %s down", wlanGetApDevName(type));
execFormatCmd("ifconfig %s down", wlanGetSTADevName(type));
sleep(3);
execFormatCmd("ifconfig %s up", wlanGetApDevName(type));
execFormatCmd("ifconfig %s up", wlanGetSTADevName(type));
}
if(unlikely(!(expr))) { \
printk(KERN_ERR "Assertion failed! %s:%s %s:%d\n", \
#expr, __FUNCTION__, __FILE__, __LINE__); \
panic("Take care of the assert first\n"); \
} \
}while(0);
CONFIG_GPIO_WIFI_SW_HOLD_TIME=3
ath_dev.ko ath_pktlog.ko
3
MemFree: 7972 kB
Buffers: 1504 kB
end
function _index()
return ctl._index(dispatch)
end
function index()
entry({"admin", "quick_setup"}, call("_index")).leaf = true
end
local dispatch_tbl = {
quick_setup = {
["read"] = {cb = read},
["write"] = {cb = write}
},
check_internet = {
[".super"] = {cb = check_internet}
},
check_router = {
[".super"] = {cb = check_router}
}
}
local data = {}
-- Wire type
data.wire_type = get_wire_type()
local success = true
for _, dsp in pairs(ext_dispatch_tbl) do
local target = require(dsp.controller)[dsp.target]
target = (type(target) == "function") and target
if target then
for _, v in pairs(dsp.forms) do
local form = {
form = v.form,
operation = "read"
}
local ret = target(form)
if ret.success then
updateonly_and_prefix(data, ret.data, v.prefix)
else
success = false
end
end
end
end
return success and data
end
我们也遇到了fat32系统拷贝单个大文件(或压缩包)时出现延迟或者拷贝失败的情况。
这个是由于samba在拷贝之前对文件进行了ftruncate,而linux下vfat对ftruncate的支持是存在问题的,导致返回时间过长或者返回失败。
之前有考虑过两种解决办法,
1、修改samba,在拷贝之前,不进行扩展。这样对ntfs和vfat都不会进行扩展,其结果是,在拷贝开始时,无法知道存储设备是否有足够的可用空间。(拷贝时,刷新客户端,发现文件是逐渐变大的)
2、修改vfat文件系统,使其不进行扩展;而ntfs仍然进行扩展。这个修改了文件系统,存在一定风险。
4900现在使用和ADSL一样的处理方法,在fs/fat/file.c中直接跳过fat_cont_expand 函数
2015.3.24 周二
IPF的权限问题,在samba中如果编译过一些在编译软件过程中被删除的目录,会提示被禁止,因为samba是通过root权限登录的,如果修改过文件,那么这个文件所在的目录所有者发生变化,变成root,这时候用非root账号删除,没有权限。
开会讨论IPF裁剪,我要负责ledctrl、switch_led、led_cli、ntpd
添加了WISP的修改,文件系统变大了,partition中定义是2d0000大小。
设备通过对外发送免费ARP报文来实现以下功能:
- 确定其它设备的IP地址是否与本机的IP地址冲突。当其它设备收到免费ARP报文后,如果发现报文中的IP地址和自己的IP地址相同,则给发送免费ARP报文的设备返回一个ARP应答,告知该设备IP地址冲突。
- 设备改变了硬件地址,通过发送免费ARP报文通知其它设备更新ARP表项。
ethreg -g addr或ethreg -g addr=value
获取国家码(国家码表allCountry):
iwpriv ath0 get_countrycode
ath0 get_countrycode:276
设置信道命令:iwconfig ath0 channel 6
设置工作模式和频率:iwconfig ath0 mode master freq 6
xp添加MAC地址绑定
arp -s 192.168.0.254 60-E3-27-F1-49-88
单引号‘’:取消除单引号以外的任何字符的特殊含义。
如:echo ‘my name is $name’其结果为:my name is $name,此时$只作为一个普通字符使用了。
双引号“”:取消除双引号、$号以及_号以外的所有字符的特殊含义
单引号是强引用,引号里的值是什么,变量的值就是什么;
双引号是弱引用,引号里的值若再包含变量,那在赋值的时候,所有这些变量就被立即替换了。
802.11g也如a是一样的意思,只不过。由于802.11g只有1、6、11这3个信道,所以使用40M频宽的信道时只剩下了一个不重叠信道,所以在使用802.11ng时,不建议使用40MHz的频宽,使用默认的20MHz频宽即可
override BOARD_TYPE = board956x
export REAL_BOARD_TYPE := $(BOARD_TYPE)
endif
·在多径环境下,后一符号的前端有可能比前一符号的末端更快到达接收机,从而导致符号间产生干扰。保护间隔是前后符号间的一段空白时间,可以为延迟信号提供更长的缓冲时间。
·保护间隔长度根据多径状态选择,802.11a/g使用800ns的保护间隔,802.11n默认也采用800ns的保护间隔,但一定环境下可以采用400ns的保护间隔
{
u32 owner;
u16 type;
u16 length;
u8 data[0];
} __attribute ((packed)) UCM_MSG_BODY;
./hpAVCommon.o: could not read symbols: Bad value
例如Debian在生成package的时候,编译完之后,不能立刻在当前环境执行make install,需要执行make install DESTDIR=$(pwd)/debian/tmp把生成的文件安装到build目录的里面$(pwd)/debian/tmp。然后使用那个目录里面的全部内容生成Debian包(实际上包里面还会包含control和maintainer script等)。这个包里面的文件所有者必须是root,所以需要以root来执行打包命令。但是应该避免在制作Debian包的时候使用root权限。为了解决这个矛盾,fakeroot被开发出来了。在fakeroot环境中,操作文件就像使用root操作文件一样。但是,实际上系统中文件的权限还是原来的权限。这个包里面的文件所有者必须是root,所以需要以root来执行打包命令。
fakeroot与sudo的区别编辑
fakeroot不能获得root的权限,sudo可以。
fakeroot只是伪装成root,它不能改变需要root权限才能改变的文件,它只是让程序执行时按照有root权限的情况来运行,而对文件的操作实际上是在普通用户下进行的。
1 fakeroot tar cvf /tmp/local.tar /usr/local
2 sudo tar cvf /tmp/local.tar /usr/local
上面两条命令都会在/tmp下建立local.tar,tar内的文件名都会以/开头,但前一条命令生成的文件属于当前用户,后一条命令生成的文件是root的。
$n 第n个参数值,n=1..9
$* 所有命令行参数
$@ 所有命令行参数,如果它被包含在引号里,形如”$@”,则每个参数也各自被引号包括
$# 命令行参数个数
$$ 当前进程的进程ID(PID)
$! 最近后台进程的进程ID
$? 最近使用命令的退出状态
make[3]: arm-uclibc-linux-2.6.36-strip: Command not found
(.text+0x2051c): undefined reference to `eraseRadioFlash'
@$(call makemod, $(TP_KERNEL_MODULES)/br_guest_filter, br_guest_filter.ko);
$(call mkrule, parentCtrl):
@$(call makemod, $(TP_KERNEL_MODULES)/parentCtrl, parentCtrl.ko);
ath_gpio_config_output (GPIO_LED_POWER);
//LOW LEVEL TURN ON ALL
ath_gpio_out_val(GPIO_LED_POWER, 1);//ZQQ
#endif
./include/wrn/wm/common/wmData.h:29: warning: useless type name in empty declaration
./include/wrn/wm/common/wmData.h:30: warning: useless type name in empty declaration
rpm/wps/httpWps.o: In function `_writeWifiCloneJson':
/home/project/plc_platform/tp-software/develop/private/apps/web_server/rpm/wps/httpWps.c:67: undefined reference to `utl_bandMode_band2bandMode'
cd $(1) && (if test -f $(2); then cp -f $(2) $(if $(3), $(3), $(LINUX_MODULES_INSTALL));fi); \
elif [ -z "$(@:%_clean=)" ]; then $(MAKEMODULES) clean SUBDIRS=$(strip $(1)); \
else $(MAKEMODULES) SUBDIRS=$(strip $(1)) modules; fi
wifid[wifi_exec_cmd:1182]: insmod /lib/modules/2.6.31/net/asf.ko
asf: version magic '2.6.31 mod_unload MIPS32_R2 32BIT ' should be '2.6.31--LSDK-9.2.0_U5.508 mod_unload MIPS32_R2 32BIT '
wifid[wifi_exec_cmd:1182]: insmod /lib/modules/2.6.31/net/ath_hal.ko
TL-WPA8730 mips #1 Fri Jan 29 16:18:24 HKT 2016 (none)
TL-WPA8730 login: ath_hal: version magic '2.6.31 mod_unload MIPS32_R2 32BIT ' should be '2.6.31--LSDK-9.2.0_U5.508 mod_unload MIPS32_R2 32BIT '
wifid[wifi_exec_cmd:1182]: insmod /lib/modules/2.6.31/net/ath_rate_atheros.ko
ath_rate_atheros: version magic '2.6.31 mod_unload MIPS32_R2 32BIT ' should be '2.6.31--LSDK-9.2.0_U5.508 mod_unload MIPS32_R2 32BIT '
wifid[wifi_exec_cmd:1182]: insmod /lib/modules/2.6.31/net/ath_dfs.ko
ath_dfs: version magic '2.6.31 mod_unload MIPS32_R2 32BIT ' should be '2.6.31--LSDK-9.2.0_U5.508 mod_unload MIPS32_R2 32BIT '
wifid[wifi_exec_cmd:1182]: insmod /lib/modules/2.6.31/net/ath_dev.ko
ath_dev: version magic '2.6.31 mod_unload MIPS32_R2 32BIT ' should be '2.6.31--LSDK-9.2.0_U5.508 mod_unload MIPS32_R2 32BIT '
wifid[wifi_exec_cmd:1182]: insmod /lib/modules/2.6.31/net/umac.ko
umac: version magic '2.6.31 mod_unload MIPS32_R2 32BIT ' should be '2.6.31--LSDK-9.2.0_U5.508 mod_unload MIPS32_R2 32BIT '
[ 0.776000] [<800f02c8>] unlzma+0xfb4/0x118c
[NM_Error](nm_api_readPtnFromNvram) 00133: partition name not found([ 3.140000] Now flash open!
name:device-id).[ 3.140000] Erase from 0X630000 to 0X630460:
[usrcfg_error: usrconf_load:916]md5 verify error[ 3.088000] Now flash open!
MemTotal: 15384 kB
MemFree: 3420 kB
Buffers: 12 kB
Cached: 1544 kB
SwapCached: 0 kB
@echo ===$(obj)u-boot.bin===
@$(LZMA) e $(obj)u-boot.bin u-boot.bin.lzma
@./tools/mkimage -A mips -T firmware -C lzma \
-a 0x$(shell grep "T _start" $(TOPDIR)/System.map | awk '{ printf "%s",
-e 0x$(shell grep "T _start" $(TOPDIR)/System.map | awk '{ printf "%s",
-n 'u-boot image' -d $(obj)u-boot.bin.lzma $@
-l ==> list image header information
./mkimage [-x] -A arch -O os -T type -C comp -a addr -e ep -n name -d data_file[:data_file...] image
-A ==> set architecture to 'arch'
-O ==> set operating system to 'os'
-T ==> set image type to 'type'
-C ==> set compression type 'comp'
-a ==> set load address to 'addr' (hex)
-e ==> set entry point to 'ep' (hex)
-n ==> set image name to 'name'
-d ==> use image data from 'datafile'
-x ==> set XIP (execute in place)
80010030 T relocate_code
80010094 t in_ram
80010100 T ath_set_tuning_caps
800101a0 T do_go
800102c0 T print_image_hdr
800106c8 T do_bootd
80010718 T fake_image_header
800107f0 T do_bootm
800109c0 T flash_sect_erase
80010bc8 T do_flerase
80011000 T test_algorithm_t
800113ac T do_mem_mct
80011820 T do_mem_mtest
80011a04 T cmd_get_data_size
uint32_t ih_magic; /* Image Header Magic Number */
uint32_t ih_hcrc; /* Image Header CRC Checksum */
uint32_t ih_time; /* Image Creation Timestamp */
uint32_t ih_size; /* Image Data Size */
uint32_t ih_load; /* Data Load Address */
uint32_t ih_ep; /* Entry Point Address */
uint32_t ih_dcrc; /* Image Data CRC Checksum */
uint8_t ih_os; /* Operating System */
uint8_t ih_arch; /* CPU architecture */
uint8_t ih_type; /* Image Type */
uint8_t ih_comp; /* Compression Type */
uint8_t ih_name[IH_NMLEN]; /* Image Name */
} image_header_t;
(*fn)(gd->ram_size);
80010030 T relocate_code
80010094 t in_ram
80010100 T ath_set_tuning_caps
800101a0 T do_go
800102c0 T print_image_hdr
800106c8 T do_bootd
80010718 T fake_image_header
800107f0 T do_bootm
800109c0 T flash_sect_erase
80010bc8 T do_flerase
UINT32 CountryNum;
UINT8 IsoName[3];
char* pCountryName;
BOOL SupportABand;
UINT8 RegDomainNum11A;
BOOL SupportGBand;
UINT8 RegDomainNum11G;
} COUNTRY_CODE_TO_COUNTRY_REGION;
{8, "AL", "ALBANIA" , TRUE, A_BAND_REGION_7, TRUE, G_BAND_REGION_1},
{12, "DZ", "ALGERIA" , TRUE, A_BAND_REGION_7, TRUE, G_BAND_REGION_1},
{32, "AR", "ARGENTINA" , TRUE, A_BAND_REGION_7, TRUE, G_BAND_REGION_1},
{51, "AM", "ARMENIA" , TRUE, A_BAND_REGION_2, TRUE, G_BAND_REGION_1},
{533, "AW", "ARUBA" , TRUE, A_BAND_REGION_1, TRUE, G_BAND_REGION_1},
{36, "AU", "AUSTRALIA" , TRUE, A_BAND_REGION_7, TRUE, G_BAND_REGION_1},
{40, "AT", "AUSTRIA" , TRUE, A_BAND_REGION_1, TRUE, G_BAND_REGION_1},
{31, "AZ", "AZERBAIJAN" , TRUE, A_BAND_REGION_2, TRUE, G_BAND_REGION_1},
{44, "BS", "BAHAMAS" , TRUE, A_BAND_REGION_7, TRUE, G_BAND_REGION_1},
{48, "BH", "BAHRAIN" , TRUE, A_BAND_REGION_0, TRUE, G_BAND_REGION_1},
{50, "BD", "BANGLADESH" , TRUE, A_BAND_REGION_7, TRUE, G_BAND_REGION_1},
{52, "BB", "BARBADOS" , TRUE, A_BAND_REGION_7, TRUE, G_BAND_REGION_1},
{112, "BY", "BELARUS" , TRUE, A_BAND_REGION_1, TRUE, G_BAND_REGION_1},
{56, "BE", "BELGIUM" , TRUE, A_BAND_REGION_1, TRUE, G_BAND_REGION_1},
{84, "BZ", "BELIZE" , TRUE, A_BAND_REGION_4, TRUE, G_BAND_REGION_1},
{60, "BM", "BERUMUDA" , TRUE, A_BAND_REGION_7, TRUE, G_BAND_REGION_0},
{68, "BO", "BOLIVIA" , TRUE, A_BAND_REGION_4, TRUE, G_BAND_REGION_1},
{70, "BA", "BOSNIA AND HERZEGOVINA" , TRUE, A_BAND_REGION_1, TRUE, G_BAND_REGION_1},
{76, "BR", "BRAZIL" , TRUE, A_BAND_REGION_7, TRUE, G_BAND_REGION_1},
{96, "BN", "BRUNEI DARUSSALAM" , TRUE, A_BAND_REGION_0, TRUE, G_BAND_REGION_1},
{100, "BG", "BULGARIA" , TRUE, A_BAND_REGION_1, TRUE, G_BAND_REGION_1},
{116, "KH", "CAMBODIA" , TRUE, A_BAND_REGION_1, TRUE, G_BAND_REGION_1},
{124, "CA", "CANADA" , TRUE, A_BAND_REGION_7, TRUE, G_BAND_REGION_0},
{152, "CL", "CHILE" , TRUE, A_BAND_REGION_0, TRUE, G_BAND_REGION_1},
{156, "CN", "CHINA" , TRUE, A_BAND_REGION_4, TRUE, G_BAND_REGION_1},
{170, "CO", "COLOMBIA" , TRUE, A_BAND_REGION_7, TRUE, G_BAND_REGION_0},
{188, "CR", "COSTA RICA" , TRUE, A_BAND_REGION_7, TRUE, G_BAND_REGION_1},
{191, "HR", "CROATIA" , TRUE, A_BAND_REGION_1, TRUE, G_BAND_REGION_1},
{196, "CY", "CYPRUS" , TRUE, A_BAND_REGION_1, TRUE, G_BAND_REGION_1},
{203, "CZ", "CZECH REPUBLIC" , TRUE, A_BAND_REGION_1, TRUE, G_BAND_REGION_1},
{208, "DK", "DENMARK" , TRUE, A_BAND_REGION_1, TRUE, G_BAND_REGION_1},
{214, "DO", "DOMINICAN REPUBLIC" , TRUE, A_BAND_REGION_7, TRUE, G_BAND_REGION_0},
{218, "EC", "ECUADOR" , TRUE, A_BAND_REGION_7, TRUE, G_BAND_REGION_1},
{818, "EG", "EGYPT" , TRUE, A_BAND_REGION_2, TRUE, G_BAND_REGION_1},
{222, "SV", "EL SALVADOR" , TRUE, A_BAND_REGION_7, TRUE, G_BAND_REGION_1},
{233, "EE", "ESTONIA" , TRUE, A_BAND_REGION_1, TRUE, G_BAND_REGION_1},
{246, "FI", "FINLAND" , TRUE, A_BAND_REGION_1, TRUE, G_BAND_REGION_1},
{250, "FR", "FRANCE" , TRUE, A_BAND_REGION_1, TRUE, G_BAND_REGION_1},
{268, "GE", "GEORGIA" , TRUE, A_BAND_REGION_2, TRUE, G_BAND_REGION_1},
{276, "DE", "GERMANY" , TRUE, A_BAND_REGION_1, TRUE, G_BAND_REGION_1},
{300, "GR", "GREECE" , TRUE, A_BAND_REGION_1, TRUE, G_BAND_REGION_1},
{304, "GL", "GREENLAND" , TRUE, A_BAND_REGION_1, TRUE, G_BAND_REGION_1},
{308, "GD", "GRENADA" , TRUE, A_BAND_REGION_7, TRUE, G_BAND_REGION_0},
{316, "GU", "GUAM" , TRUE, A_BAND_REGION_7, TRUE, G_BAND_REGION_0},
{320, "GT", "GUATEMALA" , TRUE, A_BAND_REGION_7, TRUE, G_BAND_REGION_0},
{332, "HT", "HAITI" , TRUE, A_BAND_REGION_1, TRUE, G_BAND_REGION_1},
{340, "HN", "HONDURAS" , TRUE, A_BAND_REGION_7, TRUE, G_BAND_REGION_1},
{344, "HK", "HONG KONG" , TRUE, A_BAND_REGION_7, TRUE, G_BAND_REGION_1},
{348, "HU", "HUNGARY" , TRUE, A_BAND_REGION_1, TRUE, G_BAND_REGION_1},
{352, "IS", "ICELAND" , TRUE, A_BAND_REGION_1, TRUE, G_BAND_REGION_1},
{356, "IN", "INDIA" , TRUE, A_BAND_REGION_0, TRUE, G_BAND_REGION_1},
{360, "ID", "INDONESIA" , TRUE, A_BAND_REGION_5, TRUE, G_BAND_REGION_1},
{364, "IR", "IRAN" , TRUE, A_BAND_REGION_4, TRUE, G_BAND_REGION_1},
{372, "IE", "IRELAND" , TRUE, A_BAND_REGION_1, TRUE, G_BAND_REGION_1},
{376, "IL", "ISRAEL" , TRUE, A_BAND_REGION_2, TRUE, G_BAND_REGION_1},
{380, "IT", "ITALY" , TRUE, A_BAND_REGION_1, TRUE, G_BAND_REGION_1},
{388, "JM", "JAMAICA" , TRUE, A_BAND_REGION_7, TRUE, G_BAND_REGION_1},
{392, "JP", "JAPAN" , TRUE, A_BAND_REGION_1, TRUE, G_BAND_REGION_5},
{400, "JO", "JORDAN" , TRUE, A_BAND_REGION_6, TRUE, G_BAND_REGION_1},
{398, "KZ", "KAZAKHSTAN" , TRUE, A_BAND_REGION_4, TRUE, G_BAND_REGION_1},
{404, "KE", "KENYA" , TRUE, A_BAND_REGION_4, TRUE, G_BAND_REGION_1},
{408, "KP", "NORTH KOREA" , TRUE, A_BAND_REGION_20, TRUE, G_BAND_REGION_1},
{412, "KR", "KOREA REPUBLIC" , TRUE, A_BAND_REGION_20, TRUE, G_BAND_REGION_1},
{414, "KW", "KUWAIT" , TRUE, A_BAND_REGION_2, TRUE, G_BAND_REGION_1},
{428, "LV", "LATVIA" , TRUE, A_BAND_REGION_1, TRUE, G_BAND_REGION_1},
{422, "LB", "LEBANON" , TRUE, A_BAND_REGION_4, TRUE, G_BAND_REGION_1},
{438, "LI", "LIECHTENSTEIN" , TRUE, A_BAND_REGION_1, TRUE, G_BAND_REGION_1},
{440, "LT", "LITHUANIA" , TRUE, A_BAND_REGION_1, TRUE, G_BAND_REGION_1},
{442, "LU", "LUXEMBOURG" , TRUE, A_BAND_REGION_1, TRUE, G_BAND_REGION_1},
{446, "MO", "MACAU SAR" , TRUE, A_BAND_REGION_7, TRUE, G_BAND_REGION_1},
{807, "MK", "MACEDONIA, FYRO" , TRUE, A_BAND_REGION_1, TRUE, G_BAND_REGION_1},
{458, "MY", "MALAYSIA" , TRUE, A_BAND_REGION_7, TRUE, G_BAND_REGION_1},
{470, "MT", "MALTA" , TRUE, A_BAND_REGION_1, TRUE, G_BAND_REGION_1},
{480, "MU", "MAURITIUS" , TRUE, A_BAND_REGION_1, TRUE, G_BAND_REGION_1},
{484, "MX", "MEXICO" , TRUE, A_BAND_REGION_7, TRUE, G_BAND_REGION_1},
{492, "MC", "MONACO" , TRUE, A_BAND_REGION_2, TRUE, G_BAND_REGION_1},
{504, "MA", "MOROCCO" , TRUE, A_BAND_REGION_10, TRUE, G_BAND_REGION_1},
{524, "NP", "NEPAL" , TRUE, A_BAND_REGION_4, TRUE, G_BAND_REGION_1},
{528, "NL", "NETHERLANDS" , TRUE, A_BAND_REGION_1, TRUE, G_BAND_REGION_1},
{554, "NZ", "NEW ZEALAND" , TRUE, A_BAND_REGION_7, TRUE, G_BAND_REGION_1},
{558, "NI", "NICARAGUA" , TRUE, A_BAND_REGION_7, TRUE, G_BAND_REGION_0},
{578, "NO", "NORWAY" , TRUE, A_BAND_REGION_1, TRUE, G_BAND_REGION_1},
{512, "OM", "OMAN" , TRUE, A_BAND_REGION_7, TRUE, G_BAND_REGION_1},
{586, "PK", "PAKISTAN" , TRUE, A_BAND_REGION_4, TRUE, G_BAND_REGION_1},
{591, "PA", "PANAMA" , TRUE, A_BAND_REGION_7, TRUE, G_BAND_REGION_0},
{598, "PG", "PAPUA NEW GUINEA" , TRUE, A_BAND_REGION_7, TRUE, G_BAND_REGION_1},
{600, "PY", "PARAGUAY" , TRUE, A_BAND_REGION_7, TRUE, G_BAND_REGION_1},
{604, "PE", "PERU" , TRUE, A_BAND_REGION_7, TRUE, G_BAND_REGION_1},
{608, "PH", "PHILIPPINES" , TRUE, A_BAND_REGION_7, TRUE, G_BAND_REGION_1},
{616, "PL", "POLAND" , TRUE, A_BAND_REGION_1, TRUE, G_BAND_REGION_1},
{620, "PT", "PORTUGAL" , TRUE, A_BAND_REGION_1, TRUE, G_BAND_REGION_1},
{630, "PR", "PUERTO RICO" , TRUE, A_BAND_REGION_7, TRUE, G_BAND_REGION_0},
{634, "QA", "QATAR" , TRUE, A_BAND_REGION_4, TRUE, G_BAND_REGION_1},
{642, "RO", "ROMANIA" , TRUE, A_BAND_REGION_1, TRUE, G_BAND_REGION_1},
{643, "RU", "RUSSIA" , TRUE, A_BAND_REGION_22, TRUE, G_BAND_REGION_1},
{646, "RW", "RWANDA" , TRUE, A_BAND_REGION_4, TRUE, G_BAND_REGION_1},
{682, "SA", "SAUDI ARABIA" , TRUE, A_BAND_REGION_7, TRUE, G_BAND_REGION_1},
{688, "RS", "REPUBLIC OF SERBIA" , TRUE, A_BAND_REGION_1, TRUE, G_BAND_REGION_1},
{499, "ME", "MONTENEGRO" , TRUE, A_BAND_REGION_1, TRUE, G_BAND_REGION_1},
{702, "SG", "SINGAPORE" , TRUE, A_BAND_REGION_7, TRUE, G_BAND_REGION_1},
{703, "SK", "SLOVAKIA" , TRUE, A_BAND_REGION_1, TRUE, G_BAND_REGION_1},
{705, "SI", "SLOVENIA" , TRUE, A_BAND_REGION_1, TRUE, G_BAND_REGION_1},
{710, "ZA", "SOUTH AFRICA" , TRUE, A_BAND_REGION_7, TRUE, G_BAND_REGION_1},
{724, "ES", "SPAIN" , TRUE, A_BAND_REGION_1, TRUE, G_BAND_REGION_1},
{144, "LK", "SRI LANKA" , TRUE, A_BAND_REGION_7, TRUE, G_BAND_REGION_1},
{752, "SE", "SWEDEN" , TRUE, A_BAND_REGION_1, TRUE, G_BAND_REGION_1},
{756, "CH", "SWITZERLAND" , TRUE, A_BAND_REGION_1, TRUE, G_BAND_REGION_1},
{760, "SY", "SYRIAN ARAB REPUBLIC" , TRUE, A_BAND_REGION_23, TRUE, G_BAND_REGION_1},
{158, "TW", "TAIWAN" , TRUE, A_BAND_REGION_23, TRUE, G_BAND_REGION_0},
{834, "TZ", "TANZANIA" , TRUE, A_BAND_REGION_4, TRUE, G_BAND_REGION_1},
{764, "TH", "THAILAND" , TRUE, A_BAND_REGION_7, TRUE, G_BAND_REGION_1},
{780, "TT", "TRINIDAD AND TOBAGO" , TRUE, A_BAND_REGION_7, TRUE, G_BAND_REGION_1},
{788, "TN", "TUNISIA" , TRUE, A_BAND_REGION_2, TRUE, G_BAND_REGION_1},
{792, "TR", "TURKEY" , TRUE, A_BAND_REGION_2, TRUE, G_BAND_REGION_1},
{800, "UG", "UGANDA" , TRUE, A_BAND_REGION_21, TRUE, G_BAND_REGION_1},
{804, "UA", "UKRAINE" , TRUE, A_BAND_REGION_24, TRUE, G_BAND_REGION_1},
{784, "AE", "UNITED ARAB EMIRATES" , TRUE, A_BAND_REGION_1, TRUE, G_BAND_REGION_1},
{826, "GB", "UNITED KINGDOM" , TRUE, A_BAND_REGION_1, TRUE, G_BAND_REGION_1},
{841, "US", "UNITED STATES" , TRUE, A_BAND_REGION_9, TRUE, G_BAND_REGION_0},
{858, "UY", "URUGUAY" , TRUE, A_BAND_REGION_7, TRUE, G_BAND_REGION_1},
{860, "UZ", "UZBEKISTAN" , TRUE, A_BAND_REGION_7, TRUE, G_BAND_REGION_0},
{862, "VE", "VENEZUELA" , TRUE, A_BAND_REGION_7, TRUE, G_BAND_REGION_1},
{704, "VN", "VIET NAM" , TRUE, A_BAND_REGION_2, TRUE, G_BAND_REGION_1},
{887, "YE", "YEMEN" , TRUE, A_BAND_REGION_1, TRUE, G_BAND_REGION_1},
{716, "ZW", "ZIMBABWE" , TRUE, A_BAND_REGION_1, TRUE, G_BAND_REGION_1},
{999, "", "", 0, 0, 0, 0}
};
"AUTO",
"11B",
"11G",
"11NGHT20",
"11NGHT40",
"11NGHT40PLUS",
"11NGHT40MINUS",
"11A",
"11NAHT20",
"11NAHT40",
"11NAHT40PLUS",
"11NAHT40MINUS",
"11ACVHT20",
"11ACVHT40",
"11ACVHT40PLUS",
"11ACVHT40MINUS",
"11ACVHT80",
};
[WRP][_wrpOpDo:81]Inconsist outMsgLen! opid = b0001 0 != 140
====>>>>[opWifi_AP_saveCfg:1150]0 != 680 Inconsist inMsgLen!
[WRP][_wrpOpDo:81]Inconsist outMsgLen! opid = b0001 0 != 140
====>>>>[opWifi_AP_saveCfg:1150]0 != 680 Inconsist inMsgLen!
[WRP][_wrpOpDo:81]Inconsist outMsgLen! opid = b0001 0 != 140
[17770.792000] FWLOG: [18201195] WHAL_ERROR_RESET_CHANNF1 ( )
[17770.800000] FWLOG: [18201195] WHAL_ERROR_RESET_ERRID ( 0x1 )
[18071.816000] FWLOG: [18509419] WHAL_ERROR_RESET_CHANNF1 ( )
[18071.820000] FWLOG: [18509419] WHAL_ERROR_RESET_ERRID ( 0x1 )
[util.c:60:utl_file2json]utl_file2json 60 open file = /tmp/region.channel.info
[util.c:62:utl_file2json]ERROR 0>(fd = open(filename, 00)) fail
Wireless tools for Linux是一个Linux命令行工具包,用来设置支持Linux Wireless Extension的无线设备。
Wireless Tools (WT)就是用来操作Wireless Extensions的工具集,它包括以下工具:
iwconfig:设置基本无线参数
iwlist:扫描、列出频率,比特率,密钥等
iwspy:获取每个节点链接的质量
iwpriv:操作Wireless Extensions 特定驱动
{
int ret = 0;
ret = ucl_op_addUcMod(iModIndex, ucWifiInfo);
ret |= ucl_op_addMod(iModIndex, opWifiFun);
return ret;
}
#define WIFI_BAND_MODE_2G 1
#define WIFI_BAND_MODE_5G (1 << 1)
#define WIFI_BAND_MODE_CONCURRENT 3
WPA2 (WPA 第二版) 是 Wi-Fi 联盟对采用 IEEE 802.11i 安全增强功能的产品的认证计划。简单一点理解,WPA2是基于WPA的一种新的
AES:Advanced Encryption Standard(高级加密标准),安全性比 TKIP 好,推荐使用。
加密方式。
WPA = IEEE 802.11i draft 3 =IEEE802.1X/EAP+WEP(选择性项目)/TKIP WPA2 = IEEE 802.11i = IEEE802.1X/EAP+WEP(选择性项目)/TKIP/CCMP
CCMP(Counter CBC-MAC Protocol) 计数器模式密码块链消息完整码协议。CCMP主要是两个算法所组合而成的,分别是CTR mode以及CBC-MAC mode。CTR mode为加密算法,CBC-MAC用于讯息完整性的运算
driver=atheros
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
ssid=TP-LINK_7B00_1111
max_num_sta=255
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_cwmax=10
wmm_ac_be_cwmin=4
wmm_ac_be_txop_limit=0
wmm_ac_be_acm=0
wmm_ac_vi_aifs=2
wmm_ac_vi_cwmax=4
wmm_ac_vi_cwmin=3
wmm_ac_vi_txop_limit=94
wmm_ac_vi_acm=0
wmm_ac_vo_aifs=2
wmm_ac_vo_cwmax=3
wmm_ac_vo_cwmin=2
wmm_ac_vo_txop_limit=47
wmm_ac_vo_acm=0
auth_algs=1 /*以上是公共部分*/
wpa=3
wpa_pairwise=CCMP
rsn_pairwise=CCMP
wpa_key_mgmt=WPA-PSK
wpa_passphrase=12345670
wpa_group_rekey=0
ath0 getmac:14:CC:20:16:FB:DA
14:CC:20:16:FB:DB
5250MHz-5350MHz
5470MHz-5725MHz
5725MHz-5850MHz
11n有两种频宽模式:HT(High Throughput)20和HT40。
HT20是出于兼容性考虑:比如,一个区域内存在11b/g信号,那么为了尽量减少对它们的干扰,需要设定为HT20,以减少频带的重叠。
HT40是出于高性能考虑:HT40相当于两个HT20的捆绑,一个是主,一个是辅。主信道发送beacon报文和部分数据报文,辅信道发送其他报文。
由于HT40所需带宽为40M,在一个蜂窝式无线覆盖区域最好不要在2.4GHz使用,最好在5GHz使用。
#define WIFI_CONFIG_GUEST_NETWORK (1 << 2)
#define WIFI_CONFIG_PARENT_CTRL (1 << 3)
#define WIFI_CONFIG_REGION (1 << 4)
[ 98.760000] eth0: received packet with own address as source address
[ 104.768000] eth0: received packet with own address as source address
[ 111.776000] eth0: received packet with own address as source address
[ 116.936000] eth0: received packet with own address as source address
[ 120.784000] eth0: received packet with own address as source address
{
"enable": 1,
"type": 1,
"entrySize": 1,
"Entry": [{
"stime": 0,
"etime": 1,
"days": 127,
"enable": 1
}]
}
~ # ====>>>>[/home/project/plc_platform/tp-software/develop/private/apps/wifiSched/src/wifiSched.c:_mainloop:946][_mainloop:946] call wifiSched_mainProc
====>>>>name = enable, node->valueint = 1
====>>>>name = type, node->valueint = 1
====>>>>[wifiSched_conf.c:_WifiSched_getData_fromJson:135][_WifiSched_getData_fromJson:135] wifiSchedCfg->offType = 0, wifiSchedCfg->enabled = 1
====>>>>[wifiSched_conf.c:_WifiSched_getData_fromJson:137][_WifiSched_getData_fromJson:137] wifiSchedCfg->offType = 0, wifiSchedCfg->enabled = 1
Running make clean... yes ./configure: line 28921: syntax error near unexpected token `done' ./configure: line 28921: `done'
也很奇怪,在configure文件中这一行的内容并不是done。编译过程中实际的configure文件并不是svn上的文件,而是通过auto config生成的文件
Generated by GNU Autoconf 2.63 for wolfssl 3.9.0.
实战Makefile.am
Makefile.am是一种比Makefile更高层次的规则。只需指定要生成什么目标,它由什么源文件生成,要安装到什么目录等构成。 表一列出了可执行文件、静态库、头文件和数据文件,四种书写Makefile.am文件个一般格式。
表 1Makefile.am一般格式
对于可执行文件和静态库类型,如果只想编译,不想安装到系统中,可以用noinst_PROGRAMS代替bin_PROGRAMS,noinst_LIBRARIES代替lib_LIBRARIES。 Makefile.am还提供了一些全局变量供所有的目标体使用:
表 2 Makefile.am中可用的全局变量
在Makefile.am中尽量使用相对路径,系统预定义了两个基本路径:
表 3Makefile.am中可用的路径变量
export INSTALL_ROOT_FOR_BOARD := $(IMAGEPATH)/rootfs.board
HT40是出于高性能考虑:HT40相当于两个HT20的捆绑,一个是主,一个是辅。主信道发送beacon报文和部分数据报文,辅信道发送其他报文。
由于HT40所需带宽为40M,在一个蜂窝式无线覆盖区域最好不要在2.4GHz使用,最好在5GHz使用。
在2.4G使用HT40,则有效通道有3~13,非重叠的只有3,11.
11na_ht20代表802.11na的20兆频宽,连接速率有130M,11na_ht40代表802.11na的40兆频宽,连接速率有300M。由于802.11n有个特性是40M频宽,该频宽是通过以前的两个20M信道叠加起来后生成的,并且叠加时两信道一个是主信道一个是副信道,这里的plus和minus都是针对主信道说的,所以11na_ht40plus代表40M频宽时的2个信道叠加向上加的叠加,例如当前信道是149,配成40M频宽需要叠加另外一个信道,就是149+153两个信道组成的40MHz频宽,11na_ht40minus代表信道叠加时是向下减的叠加,例如配了这个,信道161,就等于是161+157组成了40M频宽的新信道。
802.11g也如a是一样的意思,只不过。由于802.11g只有1、6、11这3个信道,所以使用40M频宽的信道时只剩下了一个不重叠信道,所以在使用802.11ng时,不建议使用40MHz的频宽,使用默认的20MHz频宽即可。
[2016:09:21:11:44:19]ESW: Link Status Changed - Port3 Link UP
[2016:09:21:11:44:19]wifid[wifi_exec_cmd:491]: ifconfig ra0 up
[2016:09:21:11:44:20][PLCD_LOG][main:627]: start plcd OK!
[2016:09:21:11:44:20]ESW: Link Status Changed - Port1 Link UP
[2016:09:21:11:44:25]0x1300 = 00064300
[2016:09:21:11:44:25]wifid[wifi_exec_cmd:491]: brctl addif br0 ra0
{
if (ll < MAX_NUM_OF_CHANNELS)
pChannelInfo->dirtyness[ll]++;
}
{
if (ll >= 0)
pChannelInfo->dirtyness[ll]++;
}
for (loop = (channel_idx+1); loop <= (channel_idx+AboveBound); loop++)
{
if (loop >= MAX_NUM_OF_CHANNELS)
break;
if (pAd->ChannelList[loop].Channel - pAd->ChannelList[loop-1].Channel > 4)
break;
pChannelInfo->dirtyness[loop] +=
((9 - (loop - channel_idx)) * 4);
}
/* check neighbor channel */
for (loop=(channel_idx-1); loop >= (channel_idx-BelowBound); loop--)
{
if (loop < 0)
break;
if (pAd->ChannelList[loop+1].Channel - pAd->ChannelList[loop].Channel > 4)
continue;
pChannelInfo->dirtyness[loop] +=
((9 - (channel_idx - loop)) * 4);
}
[2016:09:22:17:21:56]RTMPSuspendMsduTransmission 2344 SCANNING, suspend MSDU transmission ...
[2016:09:22:17:22:01]~ # RTMPResumeMsduTransmission 2395 SCAN done, resume MSDU transmission ...
OBJS = $(foreach dir,$(DIRS),$(wildcard $(dir)/*.o $(dir)/*.a $(dir)/*.bin))
clean:
@rm -f $(OBJS)zh