平台:
Wifi模块:雷凌RT2070(芯片其实和3070一样,只是去掉了802.11n的功能)
Linux内核:Linux 2.6.27
UI:Android 1.5
MCU:NXP LPC3250
问题:
从官网上下载最新的Ralink3070的驱动,编译后,加载rt3070sta.k正常,ifconfig ra0 up时出现
- / # ifconfig ra0 up
- ifconfig: page allocation failure. order:6, mode:0x0
- [<c002e12c>] (dump_stack+0x0/0x14) from [<c006f5f4>] (__alloc_pages_internal+0x3e8/0x400)
- [<c006f20c>] (__alloc_pages_internal+0x0/0x400) from [<c002f988>] (__dma_alloc+0x160/0x3b0)
- [<c002f828>] (__dma_alloc+0x0/0x3b0) from [<c002fc60>] (dma_alloc_coherent+0x58/0x64)
- [<c002fc08>] (dma_alloc_coherent+0x0/0x64) from [<c02002d0>] (hcd_buffer_alloc+0x9c/0xa4)
- r7:00000000 r6:c4861000 r5:c033559c r4:00000020
- [<c0200234>] (hcd_buffer_alloc+0x0/0xa4) from [<c01f45f4>] (usb_buffer_alloc+0x24/0x30)
- r5:c48610d8 r4:00000003
- [<c01f45d0>] (usb_buffer_alloc+0x0/0x30) from [<bf0496bc>] (NICInitTransmit+0xf0/0x7a4 [rt3070sta])
- [<bf0495cc>] (NICInitTransmit+0x0/0x7a4 [rt3070sta]) from [<bf049f10>] (RTMPAllocTxRxRingMemory+0x40/0xac [rt3070sta])
- [<bf049ed0>] (RTMPAllocTxRxRingMemory+0x0/0xac [rt3070sta]) from [<bf03b8bc>] (rt28xx_init+0xc0/0x3dc [rt3070sta])
- r5:c4861000 r4:00000000
- [<bf03b7fc>] (rt28xx_init+0x0/0x3dc [rt3070sta]) from [<bf048504>] (rt28xx_open+0x50/0xcc [rt3070sta])
- [<bf0484b4>] (rt28xx_open+0x0/0xcc [rt3070sta]) from [<bf0487b4>] (MainVirtualIF_open+0x30/0x130 [rt3070sta])
- r5:c3c84800 r4:c4861000
- [<bf048784>] (MainVirtualIF_open+0x0/0x130 [rt3070sta]) from [<c0242f00>] (dev_open+0xa0/0x104)
- r5:c3c8482c r4:c3c84800
- [<c0242e60>] (dev_open+0x0/0x104) from [<c0241f94>] (dev_change_flags+0x98/0x170)
- r5:00000001 r4:c3c84800
- [<c0241efc>] (dev_change_flags+0x0/0x170) from [<c0286720>] (devinet_ioctl+0x374/0x790)
- r7:c3949ec0 r6:00000001 r5:00000000 r4:00008914
- [<c02863ac>] (devinet_ioctl+0x0/0x790) from [<c028709c>] (inet_ioctl+0xcc/0xfc)
- [<c0286fd0>] (inet_ioctl+0x0/0xfc) from [<c0234fe8>] (sock_ioctl+0x1e8/0x240)
- [<c0234e00>] (sock_ioctl+0x0/0x240) from [<c009872c>] (vfs_ioctl+0x34/0x78)
- r6:00008914 r5:00008914 r4:be8abb2c
- [<c00986f8>] (vfs_ioctl+0x0/0x78) from [<c00989dc>] (do_vfs_ioctl+0x26c/0x28c)
- r5:be8abb2c r4:c1c386e0
- [<c0098770>] (do_vfs_ioctl+0x0/0x28c) from [<c0098a3c>] (sys_ioctl+0x40/0x64)
- r7:c1c386e0 r6:00008914 r5:be8abb2c r4:00000003
- [<c00989fc>] (sys_ioctl+0x0/0x64) from [<c0029c40>] (ret_fast_syscall+0x0/0x2c)
- r7:00000036 r6:00000003 r5:00019388 r4:be8abb2c
- Mem-info:
- DMA per-cpu:
- CPU 0: hi: 18, btch: 3 usd: 16
- Active:11398 inactive:1429 dirty:0 writeback:0 unstable:0
- free:377 slab:543 mapped:5270 pagetables:526 bounce:0
- DMA free:1508kB min:1016kB low:1268kB high:1524kB active:45592kB inactive:5716kB
- present:65024kB pages_scanned:0 all_unreclaimable? no
- lowmem_reserve[]: 0 0 0
- DMA: 291*4kB 7*8kB 4*16kB 1*32kB 1*64kB 1*128kB 0*256kB 0*512kB 0*1024kB 0*2048k
- B 0*4096kB = 1508kB
- 7089 total pagecache pages
- 0 pages in swap cache
- Swap cache stats: add 0, delete 0, find 0/0
- Free swap = 0kB
- Total swap = 0kB
- 16384 pages of RAM
- 559 free pages
- 1486 reserved pages
- 543 slab pages
- 25361 pages shared
- 0 pages swap cached
- <-- ERROR in Alloc TX TxContext[3] HTTX_BUFFER !!
- <-- RTMPAllocTxRxRingMemory, Status=3
- ERROR!!! RTMPAllocDMAMemory failed, Status[=0x00000003]
- !!! rt28xx Initialized fail !!!
- error: SIOCSIFFLAGS (Operation not permitted)
/ # ifconfig ra0 up ifconfig: page allocation failure. order:6, mode:0x0 [<c002e12c>] (dump_stack+0x0/0x14) from [<c006f5f4>] (__alloc_pages_internal+0x3e8/0x400) [<c006f20c>] (__alloc_pages_internal+0x0/0x400) from [<c002f988>] (__dma_alloc+0x160/0x3b0) [<c002f828>] (__dma_alloc+0x0/0x3b0) from [<c002fc60>] (dma_alloc_coherent+0x58/0x64) [<c002fc08>] (dma_alloc_coherent+0x0/0x64) from [<c02002d0>] (hcd_buffer_alloc+0x9c/0xa4) r7:00000000 r6:c4861000 r5:c033559c r4:00000020 [<c0200234>] (hcd_buffer_alloc+0x0/0xa4) from [<c01f45f4>] (usb_buffer_alloc+0x24/0x30) r5:c48610d8 r4:00000003 [<c01f45d0>] (usb_buffer_alloc+0x0/0x30) from [<bf0496bc>] (NICInitTransmit+0xf0/0x7a4 [rt3070sta]) [<bf0495cc>] (NICInitTransmit+0x0/0x7a4 [rt3070sta]) from [<bf049f10>] (RTMPAllocTxRxRingMemory+0x40/0xac [rt3070sta]) [<bf049ed0>] (RTMPAllocTxRxRingMemory+0x0/0xac [rt3070sta]) from [<bf03b8bc>] (rt28xx_init+0xc0/0x3dc [rt3070sta]) r5:c4861000 r4:00000000 [<bf03b7fc>] (rt28xx_init+0x0/0x3dc [rt3070sta]) from [<bf048504>] (rt28xx_open+0x50/0xcc [rt3070sta]) [<bf0484b4>] (rt28xx_open+0x0/0xcc [rt3070sta]) from [<bf0487b4>] (MainVirtualIF_open+0x30/0x130 [rt3070sta]) r5:c3c84800 r4:c4861000 [<bf048784>] (MainVirtualIF_open+0x0/0x130 [rt3070sta]) from [<c0242f00>] (dev_open+0xa0/0x104) r5:c3c8482c r4:c3c84800 [<c0242e60>] (dev_open+0x0/0x104) from [<c0241f94>] (dev_change_flags+0x98/0x170) r5:00000001 r4:c3c84800 [<c0241efc>] (dev_change_flags+0x0/0x170) from [<c0286720>] (devinet_ioctl+0x374/0x790) r7:c3949ec0 r6:00000001 r5:00000000 r4:00008914 [<c02863ac>] (devinet_ioctl+0x0/0x790) from [<c028709c>] (inet_ioctl+0xcc/0xfc) [<c0286fd0>] (inet_ioctl+0x0/0xfc) from [<c0234fe8>] (sock_ioctl+0x1e8/0x240) [<c0234e00>] (sock_ioctl+0x0/0x240) from [<c009872c>] (vfs_ioctl+0x34/0x78) r6:00008914 r5:00008914 r4:be8abb2c [<c00986f8>] (vfs_ioctl+0x0/0x78) from [<c00989dc>] (do_vfs_ioctl+0x26c/0x28c) r5:be8abb2c r4:c1c386e0 [<c0098770>] (do_vfs_ioctl+0x0/0x28c) from [<c0098a3c>] (sys_ioctl+0x40/0x64) r7:c1c386e0 r6:00008914 r5:be8abb2c r4:00000003 [<c00989fc>] (sys_ioctl+0x0/0x64) from [<c0029c40>] (ret_fast_syscall+0x0/0x2c) r7:00000036 r6:00000003 r5:00019388 r4:be8abb2c Mem-info: DMA per-cpu: CPU 0: hi: 18, btch: 3 usd: 16 Active:11398 inactive:1429 dirty:0 writeback:0 unstable:0 free:377 slab:543 mapped:5270 pagetables:526 bounce:0 DMA free:1508kB min:1016kB low:1268kB high:1524kB active:45592kB inactive:5716kB present:65024kB pages_scanned:0 all_unreclaimable? no lowmem_reserve[]: 0 0 0 DMA: 291*4kB 7*8kB 4*16kB 1*32kB 1*64kB 1*128kB 0*256kB 0*512kB 0*1024kB 0*2048k B 0*4096kB = 1508kB 7089 total pagecache pages 0 pages in swap cache Swap cache stats: add 0, delete 0, find 0/0 Free swap = 0kB Total swap = 0kB 16384 pages of RAM 559 free pages 1486 reserved pages 543 slab pages 25361 pages shared 0 pages swap cached <-- ERROR in Alloc TX TxContext[3] HTTX_BUFFER !! <-- RTMPAllocTxRxRingMemory, Status=3 ERROR!!! RTMPAllocDMAMemory failed, Status[=0x00000003] !!! rt28xx Initialized fail !!! error: SIOCSIFFLAGS (Operation not permitted)
错误。
原因:
3070的驱动中HTTX_BUFFER.field.WirelessPacket[MAX_TXBULK_SIZE],MAX_TXBULK_SIZE过大
[include/chip/mac_usb.h:169]
- typedef struct __HTTX_BUFFER{
- union{
- UCHAR WirelessPacket[MAX_TXBULK_SIZE];
- HEADER_802_11 NullFrame;
- PSPOLL_FRAME PsPollPacket;
- RTS_FRAME RTSFrame;
- }field;
- UCHAR Aggregation[4];
- } HTTX_BUFFER, *PHTTX_BUFFER;
typedef struct __HTTX_BUFFER{ union{ UCHAR WirelessPacket[MAX_TXBULK_SIZE]; HEADER_802_11 NullFrame; PSPOLL_FRAME PsPollPacket; RTS_FRAME RTSFrame; }field; UCHAR Aggregation[4]; //Buffer for save Aggregation size. } HTTX_BUFFER, *PHTTX_BUFFER;
MAX_TXBULK_SIZE定义在include/iface/rtmp_usb.h
- #define MAX_TXBULK_SIZE (LOCAL_TXBUF_SIZE*BULKAGGRE_SIZE)
#define MAX_TXBULK_SIZE (LOCAL_TXBUF_SIZE*BULKAGGRE_SIZE)
LOCAL_TXBUF_SIZE=2048, 只需把BULKAGGRE_SIZE从默认的100改为60就好了。
BULKAGGRE_SIZE定义在include/os/rt_linux.h中
类似的错误信息,其他的原因:
1、http://blog.chinaunix.net/u3/109825/showart_2143279.html
2、http://ubuntuforums.org/showthread.php?p=5888081
评论