From therightsock at gmail.com Sat Aug 1 08:51:08 2009 From: therightsock at gmail.com (trs) Date: Sat, 1 Aug 2009 09:51:08 -0400 Subject: [Avila] 2348-4 Firmware Message-ID: <4a437dc00908010651g4cfe7fcet961b5f904942c9fa@mail.gmail.com> I have a 2348-4 from around 2006, with an old version of StarOS V3 installed. I'd like to replace StarOS with OpenWRT, which instructions indicate a point during boot to press Ctrl+C to enter RedBoot. I don't have that on this board, though -- it boots immediately in StarOS. Is there a way via serial, or some means other than JTAG, to replace the bootloader and install OpenWRT? -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.gateworks.com/pipermail/avila/attachments/20090801/fbcb873c/attachment.htm From gedmonds at gateworks.com Mon Aug 3 11:35:06 2009 From: gedmonds at gateworks.com (Gordon Edmonds) Date: Mon, 3 Aug 2009 09:35:06 -0700 Subject: [Avila] 2348-4 Firmware In-Reply-To: <4a437dc00908010651g4cfe7fcet961b5f904942c9fa@mail.gmail.com> Message-ID: Hello, I don't think StarOS has a facility to reprogram the bootloader. You will be less frustrated reprogramming with the GW11008 USB based JTAG Programmer (US$100). You can find it online at shop.gateworks.com. Also, be aware that there are some differences between the StarOS version of the GW2348, and the standard version. The StarOS version has a smaller power supply and no temperature/voltage monitor. The stock OpenWRT version will run on the board, but be careful before you load the board with multiple high-power radio cards. The standard version of the GW2348-4 can handle almost 30 Watts. Let me know if we can be of further assistance. Regards, Gordon Edmonds Gateworks Corporation 3026 S. Higuera, San Luis Obispo, CA 93401 Ph: 805-781-2000 Fax: 805-781-2001 Email: gedmonds at gateworks.com Web: www.gateworks.com _____ From: avila-bounces at lists.gateworks.com [mailto:avila-bounces at lists.gateworks.com] On Behalf Of trs Sent: Saturday, August 01, 2009 6:51 AM To: avila at lists.gateworks.com Subject: [Avila] 2348-4 Firmware I have a 2348-4 from around 2006, with an old version of StarOS V3 installed. I'd like to replace StarOS with OpenWRT, which instructions indicate a point during boot to press Ctrl+C to enter RedBoot. I don't have that on this board, though -- it boots immediately in StarOS. Is there a way via serial, or some means other than JTAG, to replace the bootloader and install OpenWRT? -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.gateworks.com/pipermail/avila/attachments/20090803/aaa93a16/attachment.htm From mohsen.v1980 at yahoo.com Thu Aug 20 08:51:32 2009 From: mohsen.v1980 at yahoo.com (Mohsen Vahabzadeh) Date: Thu, 20 Aug 2009 06:51:32 -0700 (PDT) Subject: [Avila] GW2345 redboot problem Message-ID: <670602.83078.qm@web43509.mail.sp1.yahoo.com> Hi, i have a very strange problem with my gw2345 board. when i try to power off/on or pushing the reset button then the system will halt after showing "done, booting the kernel" message. i the rewrite redboot image via flash programmer (just redboot) and the system works fine and i can reboot in linux & .... rebooting in linux or typing reset command in redboot do not harm until i power off and power on the system. Best Regard, Mohsen -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.gateworks.com/pipermail/avila/attachments/20090820/a03eb79c/attachment.htm From mohsen.v1980 at yahoo.com Thu Aug 20 09:27:35 2009 From: mohsen.v1980 at yahoo.com (Mohsen) Date: Thu, 20 Aug 2009 07:27:35 -0700 (PDT) Subject: [Avila] GW2345 redboot problem In-Reply-To: <670602.83078.qm@web43509.mail.sp1.yahoo.com> Message-ID: <506796.3742.qm@web43507.mail.sp1.yahoo.com> now the condition is worst. when i power off/on the board then the "No Devices on IDE controller 0" appears and the board stops. when i rewrite the redboot image via flash programmer everything goes correctly? and no problem appears until next power off. Regards, Mohsen --- On Thu, 8/20/09, Mohsen Vahabzadeh wrote: From: Mohsen Vahabzadeh Subject: [Avila] GW2345 redboot problem To: avila at lists.gateworks.com Date: Thursday, August 20, 2009, 1:51 PM Hi, i have a very strange problem with my gw2345 board. when i try to power off/on or pushing the reset button then the system will halt after showing "done, booting the kernel" message. i the rewrite redboot image via flash programmer (just redboot) and the system works fine and i can reboot in linux & .... rebooting in linux or typing reset command in redboot do not harm until i power off and power on the system. Best Regard, Mohsen -----Inline Attachment Follows----- _______________________________________________ Avila mailing list Avila at lists.gateworks.com http://lists.gateworks.com/cgi-bin/mailman/listinfo/avila -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.gateworks.com/pipermail/avila/attachments/20090820/5508ce02/attachment.htm From dacker at roinet.com Thu Aug 20 09:33:24 2009 From: dacker at roinet.com (David Acker) Date: Thu, 20 Aug 2009 10:33:24 -0400 Subject: [Avila] GW2345 redboot problem In-Reply-To: <506796.3742.qm@web43507.mail.sp1.yahoo.com> References: <506796.3742.qm@web43507.mail.sp1.yahoo.com> Message-ID: <4A8D5EB4.2030405@roinet.com> Mohsen wrote: > now the condition is worst. > > when i power off/on the board then the "No Devices on IDE controller 0" > appears and the board stops. > when i rewrite the redboot image via flash programmer everything goes > correctly and no problem appears until next power off. I have found that my gw2348-4 will sometimes hang on boot or when launching the kernel when attached to the USB JTAG programmer. If I run: ./jtag -w It seems to reboot fine. -ack From mohsen.v1980 at yahoo.com Thu Aug 20 10:14:43 2009 From: mohsen.v1980 at yahoo.com (Mohsen) Date: Thu, 20 Aug 2009 08:14:43 -0700 (PDT) Subject: [Avila] GW2345 redboot problem In-Reply-To: <4A8D5EB4.2030405@roinet.com> Message-ID: <321015.28548.qm@web43507.mail.sp1.yahoo.com> Thank you David.the problem is solved! it seems that the GW2345 is not fully compatible with USB Jtag programmer. thanks again Regards, Mohsen --- On Thu, 8/20/09, David Acker wrote: From: David Acker Subject: Re: [Avila] GW2345 redboot problem To: "Mohsen" Cc: avila at lists.gateworks.com Date: Thursday, August 20, 2009, 2:33 PM Mohsen wrote: > now the condition is worst. > > when i power off/on the board then the "No Devices on IDE controller 0" appears and the board stops. > when i rewrite the redboot image via flash programmer everything goes correctly? and no problem appears until next power off. I have found that my gw2348-4 will sometimes hang on boot or when launching the kernel when attached to the USB JTAG programmer.? If I run: ../jtag -w It seems to reboot fine. -ack -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.gateworks.com/pipermail/avila/attachments/20090820/6927e8a6/attachment.htm From clang at gateworks.com Wed Aug 26 12:07:18 2009 From: clang at gateworks.com (clang at gateworks.com) Date: Wed, 26 Aug 2009 17:07:18 +0000 Subject: [Avila] Gateworks SVN Commit r84 - in trunk/u-boot-pismo: board/mv_feroceon/mv_dd board/mv_feroceon/mv_dd/dd_family/boardEnv board/mv_feroceon/mv_dd/dd_family/ctrlEnv include/configs Message-ID: Author: clang Date: 2009-08-26 17:07:12 +0000 (Wed, 26 Aug 2009) New Revision: 84 Modified: trunk/u-boot-pismo/board/mv_feroceon/mv_dd/dd_family/boardEnv/mvBoardEnvLib.c trunk/u-boot-pismo/board/mv_feroceon/mv_dd/dd_family/boardEnv/mvBoardEnvSpec.h trunk/u-boot-pismo/board/mv_feroceon/mv_dd/dd_family/ctrlEnv/mvCtrlEnvSpec.h trunk/u-boot-pismo/board/mv_feroceon/mv_dd/mv_main.c trunk/u-boot-pismo/include/configs/mv_dd.h Log: Update u-boot to enable the third gigabit port and allow the 'reset' command to work properly Modified: trunk/u-boot-pismo/board/mv_feroceon/mv_dd/dd_family/boardEnv/mvBoardEnvLib.c =================================================================== --- trunk/u-boot-pismo/board/mv_feroceon/mv_dd/dd_family/boardEnv/mvBoardEnvLib.c 2009-07-20 16:51:06 UTC (rev 83) +++ trunk/u-boot-pismo/board/mv_feroceon/mv_dd/dd_family/boardEnv/mvBoardEnvLib.c 2009-08-26 17:07:12 UTC (rev 84) @@ -819,7 +819,7 @@ { MV_REG_WRITE(CPU_RESET_OUT_MASK_REG, (CPU_SOFT_RESET_OUT_MASK)); MV_REG_WRITE(CPU_SOFT_RESET_OUT_REG, (CPU_SOFT_RESET_OUT)); -// MV_REG_WRITE(GPP_DATA_OUT_REG(0), (1 << DB_78200_SW_RESET)); + //MV_REG_WRITE(GPP_DATA_OUT_REG(0), (1 << DB_78200_SW_RESET)); while(1); } Modified: trunk/u-boot-pismo/board/mv_feroceon/mv_dd/dd_family/boardEnv/mvBoardEnvSpec.h =================================================================== --- trunk/u-boot-pismo/board/mv_feroceon/mv_dd/dd_family/boardEnv/mvBoardEnvSpec.h 2009-07-20 16:51:06 UTC (rev 83) +++ trunk/u-boot-pismo/board/mv_feroceon/mv_dd/dd_family/boardEnv/mvBoardEnvSpec.h 2009-08-26 17:07:12 UTC (rev 84) @@ -155,19 +155,19 @@ /* MPP[10] = GE_RXD2 MPP[11] = GE_RXD3 */ /* MPP[12] = GPIO[12] MPP[13] = SYSRSTn */ /* MPP[14] = GPIO[14] MPP[15] = GPIO[15] */ -#define DB_78XX0_MPP8_15 0x00302222 +#define DB_78XX0_MPP8_15 0x22222222 /* MPP[16] = UART2_TXD MPP[17] = UART2_RXD */ /* MPP[18] = UART0_CTS MPP[19] = UART0_RTS */ /* MPP[20] = UART1_CTS MPP[21] = UART1_RTS */ /* MPP[22] = UART3_TXD MPP[23] = UART3_RXD */ -#define DB_78XX0_MPP16_23 0x00000044 +#define DB_78XX0_MPP16_23 0x00000000 /* MPP[24] = DC MPP[25] = DC */ /* MPP[26] = DC MPP[26] = DC */ /* MPP[28] = DC MPP[27] = DC */ /* MPP[30] = DC MPP[28] = DC */ -#define DB_78XX0_MPP24_31 0x00000000 +#define DB_78XX0_MPP24_31 0x51441111 /* MPP[0] = GE_TXCLK MPP[1] = GE_TXCTL */ /* MPP[2] = GE_RXCTL MPP[3] = GE_RXCLK */ @@ -177,15 +177,15 @@ /* MPP[8] = GE_RXD0 MPP[9] = GE_RXD1 */ /* MPP[10] = GE_RXD2 MPP[11] = GE_RXD3 */ -/* MPP[12] = GPIO[12] - USB1_VBUS MPP[13] = MV_SYS_RST */ -/* MPP[14] = SATA1_ACT MPP[15] = SATA2_ACT */ -#define DB_78200_MPP8_15 0x00302222 +/* MPP[12] = GE2 MPP[13] = GE2 */ +/* MPP[14] = GE2 MPP[15] = GE2 */ +#define DB_78200_MPP8_15 0x22222222 -/* MPP[16] = UART2_TXD MPP[17] = UART2_RXD */ -/* MPP[18] = UART0_CTS MPP[19] = UART0_RTS */ -/* MPP[20] = UART1_CTS MPP[21] = UART1_RTS */ -/* MPP[22] = UART3_TXD MPP[23] = UART3_RXD */ -#define DB_78200_MPP16_23 0x00000044 +/* MPP[16] = GE2 MPP[17] = GE2 */ +/* MPP[18] = GE2 MPP[19] = GE2 */ +/* MPP[20] = GE2 MPP[21] = GE2 */ +/* MPP[22] = GE2 MPP[23] = GE2 */ +#define DB_78200_MPP16_23 0x22222222 /* MPP[24] = DC MPP[25] = DC */ /* MPP[26] = DC MPP[26] = DC */ @@ -194,10 +194,10 @@ #define DB_78200_MPP24_31 0x00000000 /* MPP[24] = DC MPP[25] = DC */ -/* MPP[26] = DC MPP[26] = 0DC */ -/* MPP[28] = DC MPP[27] = DC */ -/* MPP[30] = DC MPP[28] = DC */ -#define DB_78200_MPP32_39 0x11112222 +/* MPP[26] = gpio MPP[27] = dc */ +/* MPP[28] = uart2 MPP[29] = uart2 */ +/* MPP[30] = gpio MPP[31] = rst */ +#define DB_78200_MPP32_39 0x51441111 #define DB_78XX0_HAS_PTP_BRIDGE 1 @@ -254,11 +254,11 @@ /* Other GPIOs */ /* DB-78100-A-BP */ #define DB_78XX0_LED_GPP_PIN(ledNum) (0) -#define DB_78XX0_SW_RESET 13 +#define DB_78XX0_SW_RESET 7 #define DB_78XX0_USB_VBUS_PIN(usb) 12 /* DB-78200-A-BP */ -#define DB_78200_SW_RESET 13 +#define DB_78200_SW_RESET 7 #define DB_78200_GPIO_OUTPUT_EN (BIT7) /* RD-AMC */ @@ -326,8 +326,8 @@ #define MV_BOARD_RTC_I2C_ADDR_TYPE ADDR7_BIT /* Ethernet stuff */ -#define MV78XX0_ETH_MAX_PORTS 2 -#define MV78200_ETH_MAX_PORTS 2 +#define MV78XX0_ETH_MAX_PORTS 3 +#define MV78200_ETH_MAX_PORTS 3 #define BOARD_ETH_START_PORT_NUM 0 #define BOARD_ETH_END_PORT_NUM 3 Modified: trunk/u-boot-pismo/board/mv_feroceon/mv_dd/dd_family/ctrlEnv/mvCtrlEnvSpec.h =================================================================== --- trunk/u-boot-pismo/board/mv_feroceon/mv_dd/dd_family/ctrlEnv/mvCtrlEnvSpec.h 2009-07-20 16:51:06 UTC (rev 83) +++ trunk/u-boot-pismo/board/mv_feroceon/mv_dd/dd_family/ctrlEnv/mvCtrlEnvSpec.h 2009-08-26 17:07:12 UTC (rev 84) @@ -76,8 +76,8 @@ #define INTER_REGS_SIZE _1M -#define MV78XX0_ETH_MAX_PORTS 2 -#define MV78200_ETH_MAX_PORTS 2 +#define MV78XX0_ETH_MAX_PORTS 3 +#define MV78200_ETH_MAX_PORTS 3 #define INTERNAL_REG_BASE_DEFAULT 0xD0000000 Modified: trunk/u-boot-pismo/board/mv_feroceon/mv_dd/mv_main.c =================================================================== --- trunk/u-boot-pismo/board/mv_feroceon/mv_dd/mv_main.c 2009-07-20 16:51:06 UTC (rev 83) +++ trunk/u-boot-pismo/board/mv_feroceon/mv_dd/mv_main.c 2009-08-26 17:07:12 UTC (rev 84) @@ -307,7 +307,7 @@ if (whoAmI() == MASTER_CPU) mvEgigaPhySwitchInit(); - mvCtrlPwrClckSet(ETH_GIG_UNIT_ID, 2, MV_FALSE); + //mvCtrlPwrClckSet(ETH_GIG_UNIT_ID, 2, MV_FALSE); mvCtrlPwrClckSet(ETH_GIG_UNIT_ID, 3, MV_FALSE); #endif /* #if defined(MV_INCLUDE_UNM_ETH) || defined(MV_INCLUDE_GIG_ETH) */ @@ -840,10 +840,12 @@ #endif #if defined(MV78200) && defined(CONFIG_MV78200) + printf("setup gigabit\n"); char ethnum[20]; /* U-boot none sherd device policy */ for(i=0; i < mvCtrlEthMaxPortGet(); i++) { + printf("i = %i\n", i); /* interface name */ sprintf( ethnum, "eth%dcpu", i ); env = getenv(ethnum); Modified: trunk/u-boot-pismo/include/configs/mv_dd.h =================================================================== --- trunk/u-boot-pismo/include/configs/mv_dd.h 2009-07-20 16:51:06 UTC (rev 83) +++ trunk/u-boot-pismo/include/configs/mv_dd.h 2009-08-26 17:07:12 UTC (rev 84) @@ -289,6 +289,7 @@ #define CONFIG_NET_MULTI #define CONFIG_HAS_ETH1 #define CONFIG_HAS_ETH2 +#define CONFIG_HAS_ETH3 #define ENV_ETH_PRIME "egiga0" #if defined(RD_MV78XX0_H3C) From clang at gateworks.com Wed Aug 26 12:09:30 2009 From: clang at gateworks.com (clang at gateworks.com) Date: Wed, 26 Aug 2009 17:09:30 +0000 Subject: [Avila] Gateworks SVN Commit r85 - trunk/u-boot-pismo Message-ID: Author: clang Date: 2009-08-26 17:09:25 +0000 (Wed, 26 Aug 2009) New Revision: 85 Modified: trunk/u-boot-pismo/u-boot.bin Log: update binary u-boot with latest fixes for 2367 Modified: trunk/u-boot-pismo/u-boot.bin =================================================================== (Binary files differ) From clang at gateworks.com Wed Aug 26 13:24:29 2009 From: clang at gateworks.com (clang at gateworks.com) Date: Wed, 26 Aug 2009 18:24:29 +0000 Subject: [Avila] Gateworks SVN Commit r86 - in trunk/marvell_owrt_8.09: package/madwifi package/madwifi/files/lib/wifi package/madwifi/patches target/linux/marvell Message-ID: Author: clang Date: 2009-08-26 18:24:23 +0000 (Wed, 26 Aug 2009) New Revision: 86 Modified: trunk/marvell_owrt_8.09/package/madwifi/Config.in trunk/marvell_owrt_8.09/package/madwifi/Makefile trunk/marvell_owrt_8.09/package/madwifi/files/lib/wifi/madwifi.sh trunk/marvell_owrt_8.09/package/madwifi/patches/102-multicall_binary.patch trunk/marvell_owrt_8.09/package/madwifi/patches/104-autocreate_none.patch trunk/marvell_owrt_8.09/package/madwifi/patches/105-ratectl_attach.patch trunk/marvell_owrt_8.09/package/madwifi/patches/111-minstrel_crash.patch trunk/marvell_owrt_8.09/package/madwifi/patches/113-no_ibss_pwrsave.patch trunk/marvell_owrt_8.09/package/madwifi/patches/122-replayfail_workaround.patch trunk/marvell_owrt_8.09/package/madwifi/patches/123-ccmp_checks.patch trunk/marvell_owrt_8.09/package/madwifi/patches/124-linux24_compat.patch trunk/marvell_owrt_8.09/package/madwifi/patches/126-rxerr_frames.patch trunk/marvell_owrt_8.09/package/madwifi/patches/200-no_debug.patch trunk/marvell_owrt_8.09/package/madwifi/patches/201-debug_fix.patch trunk/marvell_owrt_8.09/package/madwifi/patches/300-napi_polling.patch trunk/marvell_owrt_8.09/package/madwifi/patches/305-pureg_fix.patch trunk/marvell_owrt_8.09/package/madwifi/patches/309-micfail_detect.patch trunk/marvell_owrt_8.09/package/madwifi/patches/310-noise_get.patch trunk/marvell_owrt_8.09/package/madwifi/patches/311-bssid_alloc.patch trunk/marvell_owrt_8.09/package/madwifi/patches/312-erpupdate.patch trunk/marvell_owrt_8.09/package/madwifi/patches/317-bmask.patch trunk/marvell_owrt_8.09/package/madwifi/patches/323-dfs_optional.patch trunk/marvell_owrt_8.09/package/madwifi/patches/324-alignment.patch trunk/marvell_owrt_8.09/package/madwifi/patches/325-channel_spam.patch trunk/marvell_owrt_8.09/package/madwifi/patches/327-queue.patch trunk/marvell_owrt_8.09/package/madwifi/patches/330-beaconcal.patch trunk/marvell_owrt_8.09/package/madwifi/patches/331-memory_alloc.patch trunk/marvell_owrt_8.09/package/madwifi/patches/332-reset_beacons.patch trunk/marvell_owrt_8.09/package/madwifi/patches/333-apscan_mode.patch trunk/marvell_owrt_8.09/package/madwifi/patches/334-input.patch trunk/marvell_owrt_8.09/package/madwifi/patches/340-maxrate.patch trunk/marvell_owrt_8.09/package/madwifi/patches/341-minrate.patch trunk/marvell_owrt_8.09/package/madwifi/patches/342-performance.patch trunk/marvell_owrt_8.09/package/madwifi/patches/343-txqueue_races.patch trunk/marvell_owrt_8.09/package/madwifi/patches/344-minstrel_failcnt.patch trunk/marvell_owrt_8.09/package/madwifi/patches/345-minstrel_sampling.patch trunk/marvell_owrt_8.09/package/madwifi/patches/346-protmode_trig.patch trunk/marvell_owrt_8.09/package/madwifi/patches/347-tuning.patch trunk/marvell_owrt_8.09/package/madwifi/patches/348-ackcts.patch trunk/marvell_owrt_8.09/package/madwifi/patches/349-reset.patch trunk/marvell_owrt_8.09/package/madwifi/patches/350-wisoc_softled.patch trunk/marvell_owrt_8.09/package/madwifi/patches/351-scanlist.patch trunk/marvell_owrt_8.09/target/linux/marvell/config-default Log: Update to latest OpenWrt build Modified: trunk/marvell_owrt_8.09/package/madwifi/Config.in =================================================================== --- trunk/marvell_owrt_8.09/package/madwifi/Config.in 2009-08-26 17:09:25 UTC (rev 85) +++ trunk/marvell_owrt_8.09/package/madwifi/Config.in 2009-08-26 18:24:23 UTC (rev 86) @@ -2,27 +2,10 @@ config MADWIFI_DEBUG bool "Enable compilation of debugging features" - depends on DEVEL && PACKAGE_kmod-madwifi + depends on EXPERIMENTAL && PACKAGE_kmod-madwifi default n choice - prompt "Madwifi version" - depends on PACKAGE_kmod-madwifi - default MADWIFI_STABLE - help - This option allows you to select the version of MadWifi to be built. - -config MADWIFI_STABLE - bool "Use the OpenWrt stable version of madwifi" - -config MADWIFI_UPSTREAM - depends !LINUX_2_6_26 - depends !TARGET_atheros - bool "Use the upstream release version 0.9.4" - -endchoice - -choice prompt "Rate control algorithm selection" depends on PACKAGE_kmod-madwifi default MADWIFI_RCA_MINSTREL Modified: trunk/marvell_owrt_8.09/package/madwifi/Makefile =================================================================== --- trunk/marvell_owrt_8.09/package/madwifi/Makefile 2009-08-26 17:09:25 UTC (rev 85) +++ trunk/marvell_owrt_8.09/package/madwifi/Makefile 2009-08-26 18:24:23 UTC (rev 86) @@ -1,44 +1,28 @@ +# +# Copyright (C) 2006-2008 OpenWrt.org # -# Copyright (C) 2006-2009 OpenWrt.org -# # This is free software, licensed under the GNU General Public License v2. # See /LICENSE for more information. # -# $Id: Makefile 14312 2009-01-31 16:17:30Z agb $ +# $Id: Makefile 11319 2008-06-01 12:08:02Z nbd $ include $(TOPDIR)/rules.mk include $(INCLUDE_DIR)/kernel.mk PKG_NAME:=madwifi - -ifneq ($(CONFIG_MADWIFI_UPSTREAM),) - PKG_VERSION:=0.9.4 - PKG_RELEASE:=2 - - PKG_SOURCE:=madwifi-$(PKG_VERSION).tar.gz - PKG_SOURCE_URL:=http://downloads.sourceforge.net/madwifi/ - PKG_MD5SUM:=399d20de8d855a59f20058857c2178ad - - PKG_BUILD_DIR:=$(KERNEL_BUILD_DIR)/madwifi-$(PKG_VERSION) - - PATCH_DIR=./patches-upstream -else +PKG_REV:=3314 +PKG_VERSION:=r$(PKG_REV) # PKG_BRANCH:=madwifi-dfs - PKG_REV:=3314 - PKG_VERSION:=r$(PKG_REV) - PKG_RELEASE:=2 +PKG_RELEASE:=1 - PKG_SOURCE_PROTO:=svn - PKG_SOURCE_VERSION:=$(PKG_REV) - PKG_SOURCE_SUBDIR:=$(if $(PKG_BRANCH),$(PKG_BRANCH),madwifi-trunk)-$(PKG_VERSION) - PKG_SOURCE_URL:=http://svn.madwifi.org/madwifi/$(if $(PKG_BRANCH),branches/$(PKG_BRANCH),trunk) - PKG_SOURCE:=$(PKG_SOURCE_SUBDIR).tar.gz +PKG_SOURCE_PROTO:=svn +PKG_SOURCE_VERSION:=$(PKG_REV) +PKG_SOURCE_SUBDIR:=$(if $(PKG_BRANCH),$(PKG_BRANCH),madwifi-trunk)-$(PKG_VERSION) +PKG_SOURCE_URL:=http://svn.madwifi.org/madwifi/$(if $(PKG_BRANCH),branches/$(PKG_BRANCH),trunk) +PKG_SOURCE:=$(PKG_SOURCE_SUBDIR).tar.gz - PKG_BUILD_DIR:=$(KERNEL_BUILD_DIR)/$(if $(PKG_BRANCH),$(PKG_BRANCH),madwifi-trunk)-$(PKG_VERSION) +PKG_BUILD_DIR:=$(KERNEL_BUILD_DIR)/$(if $(PKG_BRANCH),$(PKG_BRANCH),madwifi-trunk)-$(PKG_VERSION) - PATCH_DIR=./patches -endif - include $(INCLUDE_DIR)/package.mk ifneq ($(CONFIG_TARGET_atheros),) @@ -54,21 +38,12 @@ BUS:= endif -ifneq ($(CONFIG_CPU_MIPS32_R2),) - ifeq ($(ARCH),mips) - HAL_TARGET:=mips32r2-be-elf - endif - ifeq ($(ARCH),mipsel) - HAL_TARGET:=mips32r2-le-elf - endif -else - ifeq ($(ARCH),mips) - HAL_TARGET:=$(if $(CONFIG_MADWIFI_UPSTREAM),mips-be-elf,mips32-be-elf) - endif - ifeq ($(ARCH),mipsel) - HAL_TARGET:=$(if $(CONFIG_MADWIFI_UPSTREAM),mips-le-elf,mips32-le-elf) - endif +ifeq ($(ARCH),mips) + HAL_TARGET:=mips-be-elf endif +ifeq ($(ARCH),mipsel) + HAL_TARGET:=mips-le-elf +endif ifeq ($(ARCH),i386) HAL_TARGET:=i386-elf endif @@ -76,22 +51,19 @@ HAL_TARGET:=i386-elf endif ifeq ($(BOARD),ixp4xx) - HAL_TARGET:=xscale-be-elf$(if $(CONFIG_EABI_SUPPORT),gnueabi) + HAL_TARGET:=xscale-be-elf endif ifeq ($(BOARD),marvell) - HAL_TARGET:=xscale-le-elf$(if $(CONFIG_EABI_SUPPORT),gnueabi) + HAL_TARGET:=xscale-le-elf endif ifeq ($(BOARD),iop32x) - HAL_TARGET:=xscale-le-elf$(if $(CONFIG_EABI_SUPPORT),gnueabi) + HAL_TARGET:=xscale-le-elf endif -ifeq ($(BOARD),orion) - HAL_TARGET:=xscale-le-elf$(if $(CONFIG_EABI_SUPPORT),gnueabi) -endif ifeq ($(ARCH),powerpc) HAL_TARGET:=powerpc-be-elf endif ifeq ($(BOARD),storm) - HAL_TARGET:=armv4-le-elf$(if $(CONFIG_EABI_SUPPORT),gnueabi) + HAL_TARGET:=armv4-le-elf endif ifneq ($(CONFIG_TARGET_atheros),) HAL_TARGET:=wisoc @@ -146,14 +118,12 @@ MADWIFI_AUTOLOAD+= ath_pci endif -MADWIFI_APPLETS:=80211stats athchans athctrl athkey athstats wlanconfig ath_info +MADWIFI_APPLETS:=80211stats,athchans,athctrl,athkey,athstats,wlanconfig ifdef CONFIG_MADWIFI_DEBUG - MADWIFI_APPLETS += athdebug 80211debug + MADWIFI_APPLETS:=$(strip $(MADWIFI_APPLETS)),athdebug,80211debug endif -ifndef CONFIG_MADWIFI_UPSTREAM - MADWIFI_APPLETS += madwifi_multi -endif + define KernelPackage/madwifi SUBMENU:=Wireless Drivers TITLE:=Driver for Atheros wireless chipsets @@ -181,29 +151,22 @@ KERNELPATH="$(LINUX_DIR)" \ LDOPTS="--no-warn-mismatch " \ ATH_RATE="ath_rate/$(RATE_CONTROL)" \ - DO_MULTI=1 \ - $(if $(CONFIG_MADWIFI_DEBUG),,DEBUG=) WARNINGS="-Wno-unused" + WARNINGS="-Wno-unused" \ + $(if $(CONFIG_MADWIFI_DEBUG),,DEBUG="") \ + DO_MULTI=1 MAKE_VARS:= \ COPTS="-DCONFIG_ATHEROS_RATE_DEFAULT='\"$(RATE_CONTROL)\"' -DATH_REVERSE_ENGINEERING=1" \ -ifeq ($(CONFIG_MADWIFI_UPSTREAM),) - HALFILE:=$(lastword $(sort $(wildcard ./ath_hal-*.tgz))) -endif - +HALFILE:=$(lastword $(sort $(wildcard ./ath_hal-*.tgz))) ifneq ($(HALFILE),) - define Build/Prepare/HAL + define Build/Prepare + $(call Build/Prepare/Default) rm -rf $(PKG_BUILD_DIR)/tmp mkdir -p $(PKG_BUILD_DIR)/tmp tar xvzf $(HALFILE) -C $(PKG_BUILD_DIR)/tmp $(CP) $(PKG_BUILD_DIR)/tmp/ath_hal*/* $(PKG_BUILD_DIR)/hal/ rm -rf $(PKG_BUILD_DIR)/tmp - endef -endif - -define Build/Prepare - $(call Build/Prepare/Default) - $(call Build/Prepare/HAL) # patch cflags $(SED) 's, -E[LB],,' \ -e 's, -mips2,,' \ @@ -211,7 +174,8 @@ $(PKG_BUILD_DIR)/hal/public/*.inc $(SED) 's,march=armv4,march=armv5te,' \ $(PKG_BUILD_DIR)/hal/public/xscale*.inc -endef + endef +endif ifeq ($(findstring AHB,$(BUS)),AHB) define Build/Compile/ahb @@ -244,9 +208,10 @@ endef define KernelPackage/madwifi/install + $(INSTALL_DIR) $(1)/lib/wifi + $(INSTALL_DATA) ./files/lib/wifi/madwifi.sh $(1)/lib/wifi $(INSTALL_DIR) $(1)/usr/sbin - $(CP) ./files/* $(1)/ - $(CP) $(foreach applet,$(MADWIFI_APPLETS),$(PKG_BUILD_DIR)/tools/$(applet)) $(1)/usr/sbin/ + $(CP) $(PKG_BUILD_DIR)/tools/{madwifi_multi,$(MADWIFI_APPLETS)} $(1)/usr/sbin/ endef $(eval $(call KernelPackage,madwifi)) Modified: trunk/marvell_owrt_8.09/package/madwifi/files/lib/wifi/madwifi.sh =================================================================== --- trunk/marvell_owrt_8.09/package/madwifi/files/lib/wifi/madwifi.sh 2009-08-26 17:09:25 UTC (rev 85) +++ trunk/marvell_owrt_8.09/package/madwifi/files/lib/wifi/madwifi.sh 2009-08-26 18:24:23 UTC (rev 86) @@ -14,24 +14,25 @@ config_get mode "$vif" mode case "$mode" in - adhoc|ahdemo|sta|ap|monitor) + adhoc|ahdemo|sta|ap) append $mode "$vif" ;; wds) + config_get addr "$vif" bssid config_get ssid "$vif" ssid - [ -z "$ssid" ] && continue - - config_set "$vif" wds 1 - config_set "$vif" mode sta - mode="sta" - addr="$ssid" + [ -z "$addr" -a -n "$ssid" ] && { + config_set "$vif" wds 1 + config_set "$vif" mode sta + mode="sta" + addr="$ssid" + } ${addr:+append $mode "$vif"} ;; *) echo "$device($vif): Invalid mode, ignored."; continue;; esac done - case "${adhoc:+1}:${sta:+1}:${ap:+1}" in + case "${adhoc:+1}:${sta:+1}:${ap+1}" in # valid mode combinations 1::) wds="";; 1::1);; @@ -42,7 +43,7 @@ *) echo "$device: Invalid mode combination in config"; return 1;; esac - config_set "$device" vifs "${ap:+$ap }${adhoc:+$adhoc }${ahdemo:+$ahdemo }${sta:+$sta }${wds:+$wds }${monitor:+$monitor}" + config_set "$device" vifs "${ap:+$ap }${adhoc:+$adhoc }${ahdemo:+$ahdemo }${sta:+$sta }${wds:+$wds }" } @@ -50,14 +51,18 @@ local device="$1" set_wifi_down "$device" + # kill all running hostapd and wpa_supplicant processes that + # are running on atheros vifs + for pid in `pidof hostapd wpa_supplicant`; do + grep ath /proc/$pid/cmdline >/dev/null && \ + kill $pid + done include /lib/network cd /proc/sys/net for dev in *; do grep "$device" "$dev/%parent" >/dev/null 2>/dev/null && { - [ -f "/var/run/wifi-${dev}.pid" ] && - kill "$(cat "/var/run/wifi-${dev}.pid")" - ifconfig "$dev" down + ifconfig "$dev" down unbridge "$dev" wlanconfig "$dev" destroy } @@ -69,23 +74,17 @@ local device="$1" config_get channel "$device" channel config_get vifs "$device" vifs - config_get txpower "$device" txpower [ auto = "$channel" ] && channel=0 local first=1 for vif in $vifs; do - local start_hostapd vif_txpower nosbeacon= config_get ifname "$vif" ifname config_get enc "$vif" encryption - config_get eap_type "$vif" eap_type config_get mode "$vif" mode - case "$mode" in - sta) config_get nosbeacon "$device" nosbeacon;; - adhoc) config_get nosbeacon "$vif" sw_merge;; - esac + [ "$mode" = sta ] && config_get nosbeacon "$device" nosbeacon config_get ifname "$vif" ifname ifname=$(wlanconfig "$ifname" create wlandev "$device" wlanmode "$mode" ${nosbeacon:+nosbeacon}) @@ -95,27 +94,23 @@ } config_set "$vif" ifname "$ifname" - # only need to change freq band and channel on the first vif - config_get hwmode "$device" hwmode - [ -z "$hwmode" ] && config_get hwmode "$device" mode - - pureg=0 - case "$hwmode" in - *b) hwmode=11b;; - *bg) hwmode=11g;; - *g) hwmode=11g; pureg=1;; - *gdt) hwmode=11gdt;; - *a) hwmode=11a;; - *adt) hwmode=11adt;; - *ast) hwmode=11ast;; - *fh) hwmode=fh;; - *) hwmode=auto;; - esac - iwpriv "$ifname" mode "$hwmode" - iwpriv "$ifname" pureg "$pureg" - [ "$first" = 1 ] && { + # only need to change freq band and channel on the first vif + config_get agmode "$device" agmode + pureg=0 + case "$agmode" in + *b) agmode=11b;; + *bg) agmode=11g;; + *g) agmode=11g; pureg=1;; + *a) agmode=11a;; + *) agmode=auto;; + esac iwconfig "$ifname" channel "$channel" >/dev/null 2>/dev/null + ifconfig "$ifname" up + sleep 1 + iwpriv "$ifname" mode "$agmode" + iwpriv "$ifname" pureg "$pureg" + iwconfig "$ifname" channel "$channel" >/dev/null 2>/dev/null } config_get_bool hidden "$vif" hidden 0 @@ -133,11 +128,7 @@ esac iwpriv "$ifname" wds "$wds" - [ "$mode" = ap -a "$wds" = 1 ] && { - config_get_bool wdssep "$vif" wdssep 1 - [ -n "$wdssep" ] && iwpriv "$ifname" wdssep "$wdssep" - } - + wpa= case "$enc" in WEP|wep) for idx in 1 2 3 4; do @@ -151,13 +142,16 @@ *) iwconfig "$ifname" enc "$key";; esac ;; - psk*|wpa*) - start_hostapd=1 + PSK|psk|PSK2|psk2) config_get key "$vif" key ;; esac case "$mode" in + wds) + config_get addr "$vif" bssid + iwpriv "$ifname" wds_add "$addr" + ;; adhoc|ahdemo) config_get addr "$vif" bssid [ -z "$addr" ] || { @@ -171,43 +165,13 @@ [ -n "$bgscan" ] && iwpriv "$ifname" bgscan "$bgscan" config_get_bool antdiv "$device" diversity - config_get antrx "$device" rxantenna - config_get anttx "$device" txantenna - config_get_bool softled "$device" softled 1 - - devname="$(cat /proc/sys/dev/$device/dev_name)" - antgpio= - case "$devname" in - NanoStation2) antgpio=7;; - NanoStation5) antgpio=1;; - esac - if [ -n "$antgpio" ]; then - softled=0 - config_get antenna "$device" antenna - case "$antenna" in - external) antdiv=0; antrx=1; anttx=1 ;; - horizontal) antdiv=0; antrx=1; anttx=1 ;; - vertical) antdiv=0; antrx=2; anttx=2 ;; - auto) antdiv=1; antrx=0; anttx=0 ;; - esac - - [ -x "$(which gpioctl 2>/dev/null)" ] || antenna= - case "$antenna" in - horizontal|vertical|auto) - gpioctl "dirout" "$antgpio" >/dev/null 2>&1 - gpioctl "set" "$antgpio" >/dev/null 2>&1 - ;; - external) - gpioctl "dirout" "$antgpio" >/dev/null 2>&1 - gpioctl "clear" "$antgpio" >/dev/null 2>&1 - ;; - esac - fi - [ -n "$antdiv" ] && sysctl -w dev."$device".diversity="$antdiv" >&- + + config_get antrx "$device" rxantenna [ -n "$antrx" ] && sysctl -w dev."$device".rxantenna="$antrx" >&- + + config_get anttx "$device" txantenna [ -n "$anttx" ] && sysctl -w dev."$device".txantenna="$anttx" >&- - [ -n "$softled" ] && sysctl -w dev."$device".softled="$softled" >&- config_get distance "$device" distance [ -n "$distance" ] && athctrl -i "$device" -d "$distance" >&- @@ -227,6 +191,9 @@ config_get rts "$vif" rts [ -n "$rts" ] && iwconfig "$ifname" rts "${rts%%.*}" + config_get_bool doth "$vif" 80211h + [ -n "$doth" ] && iwpriv "$ifname" doth "$doth" + config_get_bool comp "$vif" compression [ -n "$comp" ] && iwpriv "$ifname" compression "$comp" @@ -254,9 +221,6 @@ config_get_bool doth "$vif" doth 0 [ -n "$doth" ] && iwpriv "$ifname" doth "$doth" - config_get_bool probereq "$vif" probereq - [ -n "$probereq" ] && iwpriv "$ifname" probereq "$probereq" - config_get maclist "$vif" maclist [ -n "$maclist" ] && { # flush MAC list @@ -281,6 +245,8 @@ esac ifconfig "$ifname" up + iwconfig "$ifname" channel "$channel" >/dev/null 2>/dev/null + local net_cfg bridge net_cfg="$(find_net_config "$vif")" [ -z "$net_cfg" ] || { @@ -288,28 +254,16 @@ config_set "$vif" bridge "$bridge" start_net "$ifname" "$net_cfg" } - [ -n "$ssid" ] && iwconfig "$ifname" essid on iwconfig "$ifname" essid "$ssid" set_wifi_up "$vif" "$ifname" - - # TXPower settings only work if device is up already - # while atheros hardware theoretically is capable of per-vif (even per-packet) txpower - # adjustment it does not work with the current atheros hal/madwifi driver - - config_get vif_txpower "$vif" txpower - # use vif_txpower (from wifi-iface) instead of txpower (from wifi-device) if - # the latter doesn't exist - txpower="${txpower:-$vif_txpower}" - [ -z "$txpower" ] || iwconfig "$ifname" txpower "${txpower%%.*}" - case "$mode" in ap) config_get_bool isolate "$vif" isolate 0 iwpriv "$ifname" ap_bridge "$((isolate^1))" - if [ -n "$start_hostapd" ] && eval "type hostapd_setup_vif" 2>/dev/null >/dev/null; then + if eval "type hostapd_setup_vif" 2>/dev/null >/dev/null; then hostapd_setup_vif "$vif" madwifi || { - echo "enable_atheros($device): Failed to set up hostapd for interface $ifname" >&2 + echo "enable_atheros($device): Failed to set up wpa for interface $ifname" >&2 # make sure this wifi interface won't accidentally stay open without encryption ifconfig "$ifname" down wlanconfig "$ifname" destroy @@ -318,14 +272,42 @@ fi ;; wds|sta) - if eval "type wpa_supplicant_setup_vif" 2>/dev/null >/dev/null; then - wpa_supplicant_setup_vif "$vif" madwifi || { - echo "enable_atheros($device): Failed to set up wpa_supplicant for interface $ifname" >&2 - ifconfig "$ifname" down - wlanconfig "$ifname" destroy - continue - } - fi + config_get_bool usepassphrase "$vif" passphrase 1 + case "$enc" in + PSK|psk|PSK2|psk2) + case "$enc" in + PSK|psk) + proto='proto=WPA' + if [ "$usepassphrase" = "1" ]; then + passphrase="psk=\"${key}\"" + else + passphrase="psk=${key}" + fi + ;; + PSK2|psk2) + proto='proto=RSN' + if [ "$usepassphrase" = "1" ]; then + passphrase="psk=\"${key}\"" + else + passphrase="psk=${key}" + fi + ;; + esac + cat > /var/run/wpa_supplicant-$ifname.conf <&-); do config_get type "$dev" type - devname="$(cat /proc/sys/dev/$dev/dev_name)" - case "$devname" in - NanoStation*) - EXTRA_DEV=" -# Ubiquiti NanoStation features - option antenna auto # (auto|horizontal|vertical|external) -" - ;; - esac [ "$type" = atheros ] && return cat < #include @@ -8,7 +10,7 @@ #undef ARRAY_SIZE #define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0])) -@@ -185,7 +186,7 @@ sysctlbyname(const char *oid0, void *old +@@ -185,7 +186,7 @@ #endif /* __linux__ */ int @@ -17,8 +19,10 @@ { const char *ifname = "ath0"; const char *cp, *tp; ---- a/tools/80211stats.c -+++ b/tools/80211stats.c +Index: madwifi-trunk-r3314/tools/80211stats.c +=================================================================== +--- madwifi-trunk-r3314.orig/tools/80211stats.c ++++ madwifi-trunk-r3314/tools/80211stats.c @@ -59,6 +59,7 @@ #include "net80211/ieee80211.h" #include "net80211/ieee80211_crypto.h" @@ -27,7 +31,7 @@ #ifndef SIOCG80211STATS #define SIOCG80211STATS (SIOCDEVPRIVATE + 2) -@@ -240,7 +241,7 @@ print_sta_stats(FILE *fd, const u_int8_t +@@ -240,7 +241,7 @@ } int @@ -36,8 +40,10 @@ { int c, len; struct ieee80211req_sta_info *si; ---- a/tools/athchans.c -+++ b/tools/athchans.c +Index: madwifi-trunk-r3314/tools/athchans.c +=================================================================== +--- madwifi-trunk-r3314.orig/tools/athchans.c ++++ madwifi-trunk-r3314/tools/athchans.c @@ -58,6 +58,7 @@ #include "net80211/ieee80211.h" #include "net80211/ieee80211_crypto.h" @@ -46,7 +52,7 @@ static int s = -1; static const char *progname; -@@ -140,8 +141,9 @@ usage(void) +@@ -140,8 +141,9 @@ } #define MAXCHAN ((int)(sizeof(struct ieee80211req_chanlist) * NBBY)) @@ -57,8 +63,10 @@ { const char *ifname = "wifi0"; struct ieee80211req_chanlist chanlist; ---- a/tools/athctrl.c -+++ b/tools/athctrl.c +Index: madwifi-trunk-r3314/tools/athctrl.c +=================================================================== +--- madwifi-trunk-r3314.orig/tools/athctrl.c ++++ madwifi-trunk-r3314/tools/athctrl.c @@ -52,6 +52,7 @@ #include @@ -67,7 +75,7 @@ static int setsysctrl(const char *dev, const char *control , u_long value) -@@ -88,7 +89,7 @@ static void usage(void) +@@ -88,7 +89,7 @@ } int @@ -76,8 +84,10 @@ { char device[IFNAMSIZ + 1]; int distance = -1; ---- a/tools/athdebug.c -+++ b/tools/athdebug.c +Index: madwifi-trunk-r3314/tools/athdebug.c +=================================================================== +--- madwifi-trunk-r3314.orig/tools/athdebug.c ++++ madwifi-trunk-r3314/tools/athdebug.c @@ -51,6 +51,7 @@ #include #include @@ -86,7 +96,7 @@ #undef ARRAY_SIZE #define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0])) -@@ -194,7 +195,7 @@ sysctlbyname(const char *oid0, void *old +@@ -194,7 +195,7 @@ #endif /* __linux__ */ int @@ -95,8 +105,10 @@ { #ifdef __linux__ const char *ifname = "wifi0"; ---- a/tools/athkey.c -+++ b/tools/athkey.c +Index: madwifi-trunk-r3314/tools/athkey.c +=================================================================== +--- madwifi-trunk-r3314.orig/tools/athkey.c ++++ madwifi-trunk-r3314/tools/athkey.c @@ -58,6 +58,7 @@ #include "net80211/ieee80211.h" #include "net80211/ieee80211_crypto.h" @@ -105,7 +117,7 @@ static int s = -1; static const char *progname; -@@ -213,8 +214,7 @@ usage(void) +@@ -213,8 +214,7 @@ exit(-1); } @@ -115,8 +127,10 @@ { const char *ifname = "wifi0"; struct ieee80211req_key setkey; ---- a/tools/athstats.c -+++ b/tools/athstats.c +Index: madwifi-trunk-r3314/tools/athstats.c +=================================================================== +--- madwifi-trunk-r3314.orig/tools/athstats.c ++++ madwifi-trunk-r3314/tools/athstats.c @@ -65,6 +65,7 @@ #undef ARRAY_SIZE @@ -125,7 +139,7 @@ static const struct { u_int phyerr; -@@ -228,7 +229,7 @@ catchalarm(int signo) +@@ -228,7 +229,7 @@ } int @@ -134,11 +148,12 @@ { #ifdef __linux__ const char *ifname = "wifi0"; +Index: madwifi-trunk-r3314/tools/do_multi.c +=================================================================== --- /dev/null -+++ b/tools/do_multi.c -@@ -0,0 +1,33 @@ ++++ madwifi-trunk-r3314/tools/do_multi.c +@@ -0,0 +1,32 @@ +#include -+#include +#include "do_multi.h" + +int @@ -170,8 +185,10 @@ + + return ret; +} +Index: madwifi-trunk-r3314/tools/do_multi.h +=================================================================== --- /dev/null -+++ b/tools/do_multi.h ++++ madwifi-trunk-r3314/tools/do_multi.h @@ -0,0 +1,15 @@ +#ifdef DO_MULTI +int a80211debug_init(int argc, char *argv[]); @@ -188,9 +205,11 @@ +#else +#define CMD(name) main +#endif ---- a/tools/Makefile -+++ b/tools/Makefile -@@ -46,56 +46,55 @@ ifeq ($(HAL),) +Index: madwifi-trunk-r3314/tools/Makefile +=================================================================== +--- madwifi-trunk-r3314.orig/tools/Makefile ++++ madwifi-trunk-r3314/tools/Makefile +@@ -46,56 +46,55 @@ HAL= $(TOP)/hal endif @@ -274,8 +293,10 @@ clean: - rm -f $(ALL) core a.out + rm -f $(ALLPROGS) madwifi_multi *.o core a.out ---- a/tools/wlanconfig.c -+++ b/tools/wlanconfig.c +Index: madwifi-trunk-r3314/tools/wlanconfig.c +=================================================================== +--- madwifi-trunk-r3314.orig/tools/wlanconfig.c ++++ madwifi-trunk-r3314/tools/wlanconfig.c @@ -61,6 +61,7 @@ #include "net80211/ieee80211.h" #include "net80211/ieee80211_crypto.h" @@ -284,7 +305,7 @@ /* * These are taken from ieee80211_node.h -@@ -100,7 +101,7 @@ size_t strlcat(char *, const char *, siz +@@ -100,7 +101,7 @@ static int verbose = 0; int @@ -293,8 +314,10 @@ { const char *ifname, *cmd; unsigned char bnounit = 0; ---- a/tools/ath_info.c -+++ b/tools/ath_info.c +Index: madwifi-trunk-r3314/tools/ath_info.c +=================================================================== +--- madwifi-trunk-r3314.orig/tools/ath_info.c ++++ madwifi-trunk-r3314/tools/ath_info.c @@ -98,6 +98,7 @@ #include #include @@ -303,7 +326,7 @@ #undef ARRAY_SIZE #define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0])) -@@ -738,7 +739,8 @@ static void usage(const char *n) +@@ -738,7 +739,8 @@ "unlawful radio transmissions!\n\n"); } Modified: trunk/marvell_owrt_8.09/package/madwifi/patches/104-autocreate_none.patch =================================================================== --- trunk/marvell_owrt_8.09/package/madwifi/patches/104-autocreate_none.patch 2009-08-26 17:09:25 UTC (rev 85) +++ trunk/marvell_owrt_8.09/package/madwifi/patches/104-autocreate_none.patch 2009-08-26 18:24:23 UTC (rev 86) @@ -1,6 +1,8 @@ ---- a/ath/if_ath.c -+++ b/ath/if_ath.c -@@ -516,7 +516,7 @@ ath_attach(u_int16_t devid, struct net_d +Index: madwifi-trunk-r3314/ath/if_ath.c +=================================================================== +--- madwifi-trunk-r3314.orig/ath/if_ath.c ++++ madwifi-trunk-r3314/ath/if_ath.c +@@ -516,7 +516,7 @@ HAL_STATUS status; int error = 0; unsigned int i; Modified: trunk/marvell_owrt_8.09/package/madwifi/patches/105-ratectl_attach.patch =================================================================== --- trunk/marvell_owrt_8.09/package/madwifi/patches/105-ratectl_attach.patch 2009-08-26 17:09:25 UTC (rev 85) +++ trunk/marvell_owrt_8.09/package/madwifi/patches/105-ratectl_attach.patch 2009-08-26 18:24:23 UTC (rev 86) @@ -1,6 +1,8 @@ ---- a/net80211/ieee80211_rate.c -+++ b/net80211/ieee80211_rate.c -@@ -100,8 +100,18 @@ struct ath_ratectrl *ieee80211_rate_atta +Index: madwifi-trunk-r3314/net80211/ieee80211_rate.c +=================================================================== +--- madwifi-trunk-r3314.orig/net80211/ieee80211_rate.c ++++ madwifi-trunk-r3314/net80211/ieee80211_rate.c +@@ -100,8 +100,18 @@ ieee80211_load_module(buf); if (!ratectls[id].attach) { Modified: trunk/marvell_owrt_8.09/package/madwifi/patches/111-minstrel_crash.patch =================================================================== --- trunk/marvell_owrt_8.09/package/madwifi/patches/111-minstrel_crash.patch 2009-08-26 17:09:25 UTC (rev 85) +++ trunk/marvell_owrt_8.09/package/madwifi/patches/111-minstrel_crash.patch 2009-08-26 18:24:23 UTC (rev 86) @@ -1,6 +1,8 @@ ---- a/ath_rate/minstrel/minstrel.c -+++ b/ath_rate/minstrel/minstrel.c -@@ -393,6 +393,9 @@ ath_rate_get_mrr(struct ath_softc *sc, s +Index: madwifi-trunk-r3314/ath_rate/minstrel/minstrel.c +=================================================================== +--- madwifi-trunk-r3314.orig/ath_rate/minstrel/minstrel.c ++++ madwifi-trunk-r3314/ath_rate/minstrel/minstrel.c +@@ -393,6 +393,9 @@ struct minstrel_node *sn = ATH_NODE_MINSTREL(an); int rc1, rc2, rc3; /* Index into the rate table, so for example, it is 0..11 */ Modified: trunk/marvell_owrt_8.09/package/madwifi/patches/113-no_ibss_pwrsave.patch =================================================================== --- trunk/marvell_owrt_8.09/package/madwifi/patches/113-no_ibss_pwrsave.patch 2009-08-26 17:09:25 UTC (rev 85) +++ trunk/marvell_owrt_8.09/package/madwifi/patches/113-no_ibss_pwrsave.patch 2009-08-26 18:24:23 UTC (rev 86) @@ -1,6 +1,8 @@ ---- a/net80211/ieee80211_scan.c -+++ b/net80211/ieee80211_scan.c -@@ -291,7 +291,8 @@ scan_restart_pwrsav(unsigned long arg) +Index: madwifi-trunk-r3314/net80211/ieee80211_scan.c +=================================================================== +--- madwifi-trunk-r3314.orig/net80211/ieee80211_scan.c ++++ madwifi-trunk-r3314/net80211/ieee80211_scan.c +@@ -291,7 +291,8 @@ struct ieee80211com *ic = vap->iv_ic; int delay; Modified: trunk/marvell_owrt_8.09/package/madwifi/patches/122-replayfail_workaround.patch =================================================================== --- trunk/marvell_owrt_8.09/package/madwifi/patches/122-replayfail_workaround.patch 2009-08-26 17:09:25 UTC (rev 85) +++ trunk/marvell_owrt_8.09/package/madwifi/patches/122-replayfail_workaround.patch 2009-08-26 18:24:23 UTC (rev 86) @@ -1,6 +1,8 @@ ---- a/net80211/ieee80211_linux.c -+++ b/net80211/ieee80211_linux.c -@@ -331,6 +331,9 @@ ieee80211_notify_replay_failure(struct i +Index: madwifi-trunk-r3314/net80211/ieee80211_linux.c +=================================================================== +--- madwifi-trunk-r3314.orig/net80211/ieee80211_linux.c ++++ madwifi-trunk-r3314/net80211/ieee80211_linux.c +@@ -331,6 +331,9 @@ k->wk_cipher->ic_name, k->wk_keyix, (unsigned long long)rsc); Modified: trunk/marvell_owrt_8.09/package/madwifi/patches/123-ccmp_checks.patch =================================================================== --- trunk/marvell_owrt_8.09/package/madwifi/patches/123-ccmp_checks.patch 2009-08-26 17:09:25 UTC (rev 85) +++ trunk/marvell_owrt_8.09/package/madwifi/patches/123-ccmp_checks.patch 2009-08-26 18:24:23 UTC (rev 86) @@ -1,6 +1,8 @@ ---- a/net80211/ieee80211_crypto_ccmp.c -+++ b/net80211/ieee80211_crypto_ccmp.c -@@ -475,6 +475,9 @@ ccmp_encrypt(struct ieee80211_key *key, +Index: madwifi-trunk-r3314/net80211/ieee80211_crypto_ccmp.c +=================================================================== +--- madwifi-trunk-r3314.orig/net80211/ieee80211_crypto_ccmp.c ++++ madwifi-trunk-r3314/net80211/ieee80211_crypto_ccmp.c +@@ -475,6 +475,9 @@ uint8_t *mic, *pos; u_int space; @@ -10,7 +12,7 @@ ctx->cc_vap->iv_stats.is_crypto_ccmp++; skb = skb0; -@@ -589,6 +592,9 @@ ccmp_decrypt(struct ieee80211_key *key, +@@ -589,6 +592,9 @@ uint8_t *pos, *mic; u_int space; Modified: trunk/marvell_owrt_8.09/package/madwifi/patches/124-linux24_compat.patch =================================================================== --- trunk/marvell_owrt_8.09/package/madwifi/patches/124-linux24_compat.patch 2009-08-26 17:09:25 UTC (rev 85) +++ trunk/marvell_owrt_8.09/package/madwifi/patches/124-linux24_compat.patch 2009-08-26 18:24:23 UTC (rev 86) @@ -1,6 +1,8 @@ ---- a/ath/if_athvar.h -+++ b/ath/if_athvar.h -@@ -126,6 +126,11 @@ typedef void irqreturn_t; +Index: madwifi-trunk-r3314/ath/if_athvar.h +=================================================================== +--- madwifi-trunk-r3314.orig/ath/if_athvar.h ++++ madwifi-trunk-r3314/ath/if_athvar.h +@@ -126,6 +126,11 @@ #define ATH_GET_NETDEV_DEV(ndev) ((ndev)->class_dev.dev) #endif @@ -12,8 +14,10 @@ #if LINUX_VERSION_CODE < KERNEL_VERSION(2,4,23) static inline struct net_device *_alloc_netdev(int sizeof_priv, const char *mask, void (*setup)(struct net_device *)) ---- a/ath/if_ath_radar.c -+++ b/ath/if_ath_radar.c +Index: madwifi-trunk-r3314/ath/if_ath_radar.c +=================================================================== +--- madwifi-trunk-r3314.orig/ath/if_ath_radar.c ++++ madwifi-trunk-r3314/ath/if_ath_radar.c @@ -92,6 +92,13 @@ #define nofloat_pct(_value, _pct) \ ( (_value * (1000 + _pct)) / 1000 ) @@ -28,9 +32,11 @@ struct radar_pattern_specification { /* The name of the rule/specification (i.e. what did we detect) */ const char *name; ---- a/ath/if_ath.c -+++ b/ath/if_ath.c -@@ -4705,6 +4705,46 @@ ath_beacon_setup(struct ath_softc *sc, s +Index: madwifi-trunk-r3314/ath/if_ath.c +=================================================================== +--- madwifi-trunk-r3314.orig/ath/if_ath.c ++++ madwifi-trunk-r3314/ath/if_ath.c +@@ -4705,6 +4705,46 @@ #undef USE_SHPREAMBLE } @@ -77,8 +83,10 @@ /* * Generate beacon frame and queue cab data for a VAP. */ +Index: madwifi-trunk-r3314/net80211/sort.c +=================================================================== --- /dev/null -+++ b/net80211/sort.c ++++ madwifi-trunk-r3314/net80211/sort.c @@ -0,0 +1,120 @@ +/* + * A fast, small, non-recursive O(nlog n) sort for the Linux kernel Modified: trunk/marvell_owrt_8.09/package/madwifi/patches/126-rxerr_frames.patch =================================================================== --- trunk/marvell_owrt_8.09/package/madwifi/patches/126-rxerr_frames.patch 2009-08-26 17:09:25 UTC (rev 85) +++ trunk/marvell_owrt_8.09/package/madwifi/patches/126-rxerr_frames.patch 2009-08-26 18:24:23 UTC (rev 86) @@ -1,6 +1,8 @@ ---- a/ath/if_ath.c -+++ b/ath/if_ath.c -@@ -6474,8 +6474,9 @@ ath_rx_tasklet(TQUEUE_ARG data) +Index: madwifi-trunk-r3314/ath/if_ath.c +=================================================================== +--- madwifi-trunk-r3314.orig/ath/if_ath.c ++++ madwifi-trunk-r3314/ath/if_ath.c +@@ -6474,8 +6474,9 @@ /* * Reject error frames if we have no vaps that * are operating in monitor mode. Modified: trunk/marvell_owrt_8.09/package/madwifi/patches/200-no_debug.patch =================================================================== --- trunk/marvell_owrt_8.09/package/madwifi/patches/200-no_debug.patch 2009-08-26 17:09:25 UTC (rev 85) +++ trunk/marvell_owrt_8.09/package/madwifi/patches/200-no_debug.patch 2009-08-26 18:24:23 UTC (rev 86) @@ -1,5 +1,7 @@ ---- a/ath/if_ath.c -+++ b/ath/if_ath.c +Index: madwifi-trunk-r3314/ath/if_ath.c +=================================================================== +--- madwifi-trunk-r3314.orig/ath/if_ath.c ++++ madwifi-trunk-r3314/ath/if_ath.c @@ -42,7 +42,6 @@ * This software is derived from work of Atsushi Onoe; his contribution * is greatly appreciated. @@ -8,7 +10,7 @@ #include "if_ath_debug.h" #include "opt_ah.h" -@@ -368,8 +367,10 @@ static unsigned int ath_get_dfs_cac_time +@@ -368,8 +367,10 @@ static void ath_set_dfs_cac_time(struct ieee80211com *, unsigned int seconds); static unsigned int ath_test_radar(struct ieee80211com *); @@ -20,7 +22,7 @@ static u_int32_t ath_get_clamped_maxtxpower(struct ath_softc *sc); static u_int32_t ath_set_clamped_maxtxpower(struct ath_softc *sc, u_int32_t new_clamped_maxtxpower); -@@ -520,9 +521,11 @@ ath_attach(u_int16_t devid, struct net_d +@@ -520,9 +521,11 @@ u_int8_t csz; sc->devid = devid; @@ -32,7 +34,7 @@ /* Allocate space for dynamically determined maximum VAP count */ sc->sc_bslot = -@@ -1038,8 +1041,9 @@ ath_attach(u_int16_t devid, struct net_d +@@ -1038,8 +1041,9 @@ ic->ic_vap_delete = ath_vap_delete; ic->ic_test_radar = ath_test_radar; @@ -43,7 +45,7 @@ ic->ic_set_dfs_testmode = ath_set_dfs_testmode; ic->ic_get_dfs_testmode = ath_get_dfs_testmode; -@@ -1297,12 +1301,14 @@ ath_vap_create(struct ieee80211com *ic, +@@ -1297,12 +1301,14 @@ /* If no default VAP debug flags are passed, allow a few to * transfer down from the driver to new VAPs so we can have load * time debugging for VAPs too. */ @@ -58,7 +60,7 @@ } ic->ic_debug = (sc->sc_default_ieee80211_debug & IEEE80211_MSG_IC); -@@ -10496,9 +10502,11 @@ ATH_SYSCTL_DECL(ath_sysctl_halparam, ctl +@@ -10496,9 +10502,11 @@ /* XXX validate? */ sc->sc_ledpin = val; break; @@ -70,7 +72,7 @@ break; case ATH_TXANTENNA: /* -@@ -10918,9 +10926,11 @@ ath_dynamic_sysctl_register(struct ath_s +@@ -10918,9 +10926,11 @@ } /* initialize values */ @@ -82,7 +84,7 @@ sc->sc_txantenna = 0; /* default to auto-selection */ sc->sc_txintrperiod = ATH_TXQ_INTR_PERIOD; } -@@ -11762,6 +11772,7 @@ ath_test_radar(struct ieee80211com *ic) +@@ -11762,6 +11772,7 @@ } /* This is called by a private ioctl (iwpriv) to dump the HAL obfuscation table */ @@ -90,7 +92,7 @@ static unsigned int ath_dump_hal_map(struct ieee80211com *ic) { -@@ -11770,7 +11781,7 @@ ath_dump_hal_map(struct ieee80211com *ic +@@ -11770,7 +11781,7 @@ ath_hal_dump_map(sc->sc_ah); return 0; } @@ -99,8 +101,10 @@ /* If we are shutting down or blowing off the DFS channel availability check * then we call this to stop the behavior before we take the rest of the * necessary actions (such as a DFS reaction to radar). */ ---- a/ath_rate/amrr/amrr.c -+++ b/ath_rate/amrr/amrr.c +Index: madwifi-trunk-r3314/ath_rate/amrr/amrr.c +=================================================================== +--- madwifi-trunk-r3314.orig/ath_rate/amrr/amrr.c ++++ madwifi-trunk-r3314/ath_rate/amrr/amrr.c @@ -70,7 +70,9 @@ #include "amrr.h" @@ -111,8 +115,10 @@ #ifdef AMRR_DEBUG #define DPRINTF(sc, _fmt, ...) do { \ if (sc->sc_debug & 0x10) \ ---- a/ath_rate/minstrel/minstrel.c -+++ b/ath_rate/minstrel/minstrel.c +Index: madwifi-trunk-r3314/ath_rate/minstrel/minstrel.c +=================================================================== +--- madwifi-trunk-r3314.orig/ath_rate/minstrel/minstrel.c ++++ madwifi-trunk-r3314/ath_rate/minstrel/minstrel.c @@ -117,7 +117,9 @@ #include "minstrel.h" @@ -123,8 +129,10 @@ #ifdef MINSTREL_DEBUG enum { ATH_DEBUG_RATE = 0x00000010 /* rate control */ ---- a/ath_rate/onoe/onoe.c -+++ b/ath_rate/onoe/onoe.c +Index: madwifi-trunk-r3314/ath_rate/onoe/onoe.c +=================================================================== +--- madwifi-trunk-r3314.orig/ath_rate/onoe/onoe.c ++++ madwifi-trunk-r3314/ath_rate/onoe/onoe.c @@ -66,7 +66,9 @@ #include "onoe.h" @@ -135,8 +143,10 @@ #ifdef ONOE_DEBUG enum { ATH_DEBUG_RATE = 0x00000010, /* rate control */ ---- a/ath_rate/sample/sample.c -+++ b/ath_rate/sample/sample.c +Index: madwifi-trunk-r3314/ath_rate/sample/sample.c +=================================================================== +--- madwifi-trunk-r3314.orig/ath_rate/sample/sample.c ++++ madwifi-trunk-r3314/ath_rate/sample/sample.c @@ -68,7 +68,9 @@ #include "sample.h" @@ -148,9 +158,11 @@ #ifdef SAMPLE_DEBUG enum { ATH_DEBUG_RATE = 0x00000010, /* rate control */ ---- a/tools/do_multi.c -+++ b/tools/do_multi.c -@@ -10,16 +10,20 @@ main(int argc, char *argv[]) +Index: madwifi-trunk-r3314/tools/do_multi.c +=================================================================== +--- madwifi-trunk-r3314.orig/tools/do_multi.c ++++ madwifi-trunk-r3314/tools/do_multi.c +@@ -9,16 +9,20 @@ progname = basename(argv[0]); @@ -171,9 +183,11 @@ if(strcmp(progname, "athkey") == 0) ret = athkey_init(argc, argv); if(strcmp(progname, "athstats") == 0) ---- a/tools/Makefile -+++ b/tools/Makefile -@@ -48,6 +48,8 @@ endif +Index: madwifi-trunk-r3314/tools/Makefile +=================================================================== +--- madwifi-trunk-r3314.orig/tools/Makefile ++++ madwifi-trunk-r3314/tools/Makefile +@@ -48,6 +48,8 @@ all: compile @@ -182,7 +196,7 @@ ALLPROGS= athstats 80211stats athkey athchans athctrl \ athdebug 80211debug wlanconfig ath_info -@@ -55,7 +57,7 @@ OBJS= $(patsubst %,%.o,$(ALLPROGS)) +@@ -55,7 +57,7 @@ INCS= -I. -I../ath -I$(HAL) -I$(TOP) -I$(ATH_HAL) CFLAGS= -g -O2 -Wall @@ -191,8 +205,10 @@ LDFLAGS= ---- a/net80211/ieee80211_linux.h -+++ b/net80211/ieee80211_linux.h +Index: madwifi-trunk-r3314/net80211/ieee80211_linux.h +=================================================================== +--- madwifi-trunk-r3314.orig/net80211/ieee80211_linux.h ++++ madwifi-trunk-r3314/net80211/ieee80211_linux.h @@ -29,8 +29,6 @@ #ifndef _NET80211_IEEE80211_LINUX_H_ #define _NET80211_IEEE80211_LINUX_H_ @@ -202,9 +218,11 @@ /* #define ATH_DEBUG_SPINLOCKS */ /* announce before spinlocking */ #include ---- a/Makefile.inc -+++ b/Makefile.inc -@@ -148,7 +148,8 @@ ATH_RATE= $(TOP)/ath_rate +Index: madwifi-trunk-r3314/Makefile.inc +=================================================================== +--- madwifi-trunk-r3314.orig/Makefile.inc ++++ madwifi-trunk-r3314/Makefile.inc +@@ -148,7 +148,8 @@ TOOLS= $(TOP)/tools WARNINGS = -Werror @@ -214,8 +232,10 @@ INCS= -include $(TOP)/include/compat.h -I$(TOP)/include # TARGET defines the target platform architecture. It must match one of ---- a/ath/if_ath_radar.c -+++ b/ath/if_ath_radar.c +Index: madwifi-trunk-r3314/ath/if_ath_radar.c +=================================================================== +--- madwifi-trunk-r3314.orig/ath/if_ath_radar.c ++++ madwifi-trunk-r3314/ath/if_ath_radar.c @@ -19,8 +19,6 @@ * $Id: if_ath_radar.c 2464 2007-06-15 22:51:56Z mtaylor $ */ @@ -234,9 +254,11 @@ #include "net80211/if_athproto.h" #include "if_athvar.h" ---- a/ath/if_ath_hal.h -+++ b/ath/if_ath_hal.h -@@ -1081,6 +1081,7 @@ static inline HAL_BOOL ath_hal_disable(s +Index: madwifi-trunk-r3314/ath/if_ath_hal.h +=================================================================== +--- madwifi-trunk-r3314.orig/ath/if_ath_hal.h ++++ madwifi-trunk-r3314/ath/if_ath_hal.h +@@ -1081,6 +1081,7 @@ tail -f /var/log/messages | sed -f hal_unmangle.sed */ @@ -244,7 +266,7 @@ static inline void ath_hal_dump_map(struct ath_hal *ah) { #ifdef CONFIG_KALLSYMS -@@ -1345,7 +1346,7 @@ static inline void ath_hal_dump_map(stru +@@ -1345,7 +1346,7 @@ #endif /* #ifndef CONFIG_KALLSYMS */ } @@ -253,9 +275,11 @@ #include "if_ath_hal_wrappers.h" #endif /* #ifndef _IF_ATH_HAL_H_ */ ---- a/net80211/ieee80211_var.h -+++ b/net80211/ieee80211_var.h -@@ -492,9 +492,10 @@ struct ieee80211com { +Index: madwifi-trunk-r3314/net80211/ieee80211_var.h +=================================================================== +--- madwifi-trunk-r3314.orig/net80211/ieee80211_var.h ++++ madwifi-trunk-r3314/net80211/ieee80211_var.h +@@ -492,9 +492,10 @@ /* inject a fake radar signal -- used while on a 802.11h DFS channels */ unsigned int (*ic_test_radar)(struct ieee80211com *); @@ -267,9 +291,11 @@ /* DFS channel availability check time (in seconds) */ void (*ic_set_dfs_cac_time)(struct ieee80211com *, unsigned int); unsigned int (*ic_get_dfs_cac_time)(struct ieee80211com *); ---- a/net80211/ieee80211_wireless.c -+++ b/net80211/ieee80211_wireless.c -@@ -1548,6 +1548,7 @@ ieee80211_get_txcont_power(struct net_de +Index: madwifi-trunk-r3314/net80211/ieee80211_wireless.c +=================================================================== +--- madwifi-trunk-r3314.orig/net80211/ieee80211_wireless.c ++++ madwifi-trunk-r3314/net80211/ieee80211_wireless.c +@@ -1548,6 +1548,7 @@ return 0; } @@ -277,7 +303,7 @@ static int ieee80211_ioctl_hal_map(struct net_device *dev, struct iw_request_info *info, void *w, char *extra) -@@ -1558,7 +1559,7 @@ ieee80211_ioctl_hal_map(struct net_devic +@@ -1558,7 +1559,7 @@ params[0] = ic->ic_dump_hal_map(ic); return 0; } @@ -286,7 +312,7 @@ static int ieee80211_ioctl_radar(struct net_device *dev, struct iw_request_info *info, -@@ -5258,8 +5259,10 @@ static const struct iw_priv_args ieee802 +@@ -5258,8 +5259,10 @@ IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, "getwmmparams" }, { IEEE80211_IOCTL_RADAR, 0, 0, "doth_radar" }, @@ -297,7 +323,7 @@ /* * These depends on sub-ioctl support which added in version 12. */ -@@ -5695,7 +5698,9 @@ static const iw_handler ieee80211_priv_h +@@ -5695,7 +5698,9 @@ set_priv(IEEE80211_IOCTL_SETMLME, ieee80211_ioctl_setmlme), set_priv(IEEE80211_IOCTL_SETKEY, ieee80211_ioctl_setkey), set_priv(IEEE80211_IOCTL_DELKEY, ieee80211_ioctl_delkey), @@ -307,20 +333,11 @@ set_priv(IEEE80211_IOCTL_ADDMAC, ieee80211_ioctl_addmac), set_priv(IEEE80211_IOCTL_DELMAC, ieee80211_ioctl_delmac), set_priv(IEEE80211_IOCTL_WDSADDMAC, ieee80211_ioctl_wdsmac), ---- a/ath/if_ath_debug.h -+++ b/ath/if_ath_debug.h -@@ -54,6 +54,10 @@ enum { - ATH_DEBUG_GLOBAL = (ATH_DEBUG_SKB|ATH_DEBUG_SKB_REF) - }; - -+#define EPRINTF(_sc, _fmt, ...) \ -+ printk(KERN_ERR "%s: %s: " _fmt, \ -+ SC_DEV_NAME(_sc), __func__, ## __VA_ARGS__) -+ - #ifdef AR_DEBUG - - /* DEBUG-ONLY DEFINITIONS */ -@@ -68,20 +72,9 @@ enum { +Index: madwifi-trunk-r3314/ath/if_ath_debug.h +=================================================================== +--- madwifi-trunk-r3314.orig/ath/if_ath_debug.h ++++ madwifi-trunk-r3314/ath/if_ath_debug.h +@@ -68,13 +68,6 @@ ath_keyprint((_sc), __func__, _ix, _hk, _mac); \ } while (0) @@ -334,14 +351,7 @@ #define IFF_DUMPPKTS(_sc, _m) DFLAG_ISSET((_sc), (_m)) --#define EPRINTF(_sc, _fmt, ...) \ -- printk(KERN_ERR "%s: %s: " _fmt, \ -- SC_DEV_NAME(_sc), __func__, ## __VA_ARGS__) -- - #define WPRINTF(_sc, _fmt, ...) \ - printk(KERN_WARNING "%s: %s: " _fmt, \ - SC_DEV_NAME(_sc), __func__, ## __VA_ARGS__) -@@ -89,5 +82,14 @@ enum { +@@ -89,5 +82,15 @@ #define IPRINTF(_sc, _fmt, ...) \ printk(KERN_INFO "%s: %s: " _fmt, \ SC_DEV_NAME(_sc), __func__, ## __VA_ARGS__) @@ -349,6 +359,7 @@ +#define DFLAG_ISSET(sc, _m) 0 +#define DPRINTF(sc, _m, _fmt, ...) +#define KEYPRINTF(sc, k, ix, mac) ++#define EPRINTF(...) +#define WPRINTF(...) +#define IPRINTF(...) +#define IFF_DUMPPKTS(...) 0 @@ -356,9 +367,11 @@ +#endif #endif /* #ifndef _IF_ATH_DEBUG_H_ */ ---- a/net80211/ieee80211_node.c -+++ b/net80211/ieee80211_node.c -@@ -920,6 +920,9 @@ node_cleanup(struct ieee80211_node *ni) +Index: madwifi-trunk-r3314/net80211/ieee80211_node.c +=================================================================== +--- madwifi-trunk-r3314.orig/net80211/ieee80211_node.c ++++ madwifi-trunk-r3314/net80211/ieee80211_node.c +@@ -920,6 +920,9 @@ ni->ni_rxkeyoff = 0; } @@ -368,7 +381,7 @@ static void node_print_message( u_int32_t flags, int show_counter, -@@ -972,7 +975,7 @@ static void node_print_message( +@@ -972,7 +975,7 @@ adjusted_refcount); va_end(args); } @@ -377,29 +390,3 @@ static void #ifdef IEEE80211_DEBUG_REFCNT ---- a/ath/if_ath_pci.c -+++ b/ath/if_ath_pci.c -@@ -134,8 +134,10 @@ ath_pci_probe(struct pci_dev *pdev, cons - u16 vdevice; - int i; - -- if (pci_enable_device(pdev)) -+ if (pci_enable_device(pdev)) { -+ printk(KERN_ERR "%s: failed to enable PCI device\n", dev_info); - return -EIO; -+ } - - /* XXX 32-bit addressing only */ - if (pci_set_dma_mask(pdev, 0xffffffff)) { -@@ -244,8 +246,10 @@ ath_pci_probe(struct pci_dev *pdev, cons - sc->aps_sc.sc_ledpin = 1; - } - -- if (ath_attach(vdevice, dev, NULL) != 0) -+ if ((i = ath_attach(vdevice, dev, NULL)) != 0) { -+ printk(KERN_ERR "%s: ath_attach failed: %d\n", dev_info, i); - goto bad4; -+ } - - athname = ath_hal_probe(id->vendor, vdevice); - printk(KERN_INFO "%s: %s: %s: mem=0x%lx, irq=%d\n", Modified: trunk/marvell_owrt_8.09/package/madwifi/patches/201-debug_fix.patch =================================================================== --- trunk/marvell_owrt_8.09/package/madwifi/patches/201-debug_fix.patch 2009-08-26 17:09:25 UTC (rev 85) +++ trunk/marvell_owrt_8.09/package/madwifi/patches/201-debug_fix.patch 2009-08-26 18:24:23 UTC (rev 86) @@ -1,5 +1,7 @@ ---- a/ath_hal/ah_os.c -+++ b/ath_hal/ah_os.c +Index: madwifi-trunk-r3314/ath_hal/ah_os.c +=================================================================== +--- madwifi-trunk-r3314.orig/ath_hal/ah_os.c ++++ madwifi-trunk-r3314/ath_hal/ah_os.c @@ -65,7 +65,7 @@ #include @@ -9,7 +11,7 @@ #endif int ath_hal_dma_beacon_response_time = 2; /* in TUs */ -@@ -327,6 +327,8 @@ EXPORT_SYMBOL(OS_MARK); +@@ -327,6 +327,8 @@ * useful for debugging and figuring out, which hal function sets which * registers */ char *ath_hal_func = NULL; Modified: trunk/marvell_owrt_8.09/package/madwifi/patches/300-napi_polling.patch =================================================================== --- trunk/marvell_owrt_8.09/package/madwifi/patches/300-napi_polling.patch 2009-08-26 17:09:25 UTC (rev 85) +++ trunk/marvell_owrt_8.09/package/madwifi/patches/300-napi_polling.patch 2009-08-26 18:24:23 UTC (rev 86) @@ -1,6 +1,8 @@ ---- a/ath/if_ath.c -+++ b/ath/if_ath.c -@@ -184,7 +184,11 @@ static void ath_recv_mgmt(struct ieee802 +Index: madwifi-trunk-r3314/ath/if_ath.c +=================================================================== +--- madwifi-trunk-r3314.orig/ath/if_ath.c ++++ madwifi-trunk-r3314/ath/if_ath.c +@@ -184,7 +184,11 @@ struct sk_buff *, int, int, u_int64_t); static void ath_setdefantenna(struct ath_softc *, u_int); static struct ath_txq *ath_txq_setup(struct ath_softc *, int, int); @@ -13,7 +15,7 @@ static int ath_hardstart(struct sk_buff *, struct net_device *); static int ath_mgtstart(struct ieee80211com *, struct sk_buff *); #ifdef ATH_SUPERG_COMP -@@ -376,6 +380,9 @@ static u_int32_t ath_set_clamped_maxtxpo +@@ -376,6 +380,9 @@ u_int32_t new_clamped_maxtxpower); static u_int32_t ath_get_real_maxtxpower(struct ath_softc *sc); @@ -23,7 +25,7 @@ /* calibrate every 30 secs in steady state but check every second at first. */ static int ath_calinterval = ATH_SHORT_CALINTERVAL; static int ath_countrycode = CTRY_DEFAULT; /* country code */ -@@ -547,7 +554,6 @@ ath_attach(u_int16_t devid, struct net_d +@@ -547,7 +554,6 @@ atomic_set(&sc->sc_txbuf_counter, 0); @@ -31,7 +33,7 @@ ATH_INIT_TQUEUE(&sc->sc_txtq, ath_tx_tasklet, dev); ATH_INIT_TQUEUE(&sc->sc_bmisstq, ath_bmiss_tasklet, dev); ATH_INIT_TQUEUE(&sc->sc_bstucktq, ath_bstuck_tasklet, dev); -@@ -821,6 +827,12 @@ ath_attach(u_int16_t devid, struct net_d +@@ -821,6 +827,12 @@ dev->set_mac_address = ath_set_mac_address; dev->change_mtu = ath_change_mtu; dev->tx_queue_len = ATH_TXBUF - ATH_TXBUF_MGT_RESERVED; @@ -44,7 +46,7 @@ #ifdef USE_HEADERLEN_RESV dev->hard_header_len += sizeof(struct ieee80211_qosframe) + sizeof(struct llc) + -@@ -2220,6 +2232,7 @@ ath_intr(int irq, void *dev_id, struct p +@@ -2216,6 +2228,7 @@ (status & HAL_INT_GLOBAL) ? " HAL_INT_GLOBAL" : "" ); @@ -52,7 +54,7 @@ status &= sc->sc_imask; /* discard unasked for bits */ /* As soon as we know we have a real interrupt we intend to service, * we will check to see if we need an initial hardware TSF reading. -@@ -2277,7 +2290,21 @@ ath_intr(int irq, void *dev_id, struct p +@@ -2273,7 +2286,23 @@ } if (status & (HAL_INT_RX | HAL_INT_RXPHY)) { ath_uapsd_processtriggers(sc, hw_tsf); @@ -64,8 +66,10 @@ + if (netif_rx_schedule_prep(dev)) +#endif + { ++#ifndef ATH_PRECISE_TSF + sc->sc_imask &= ~HAL_INT_RX; + ath_hal_intrset(ah, sc->sc_imask); ++#endif +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,24) + __netif_rx_schedule(dev, &sc->sc_napi); +#else @@ -75,7 +79,7 @@ } if (status & HAL_INT_TX) { #ifdef ATH_SUPERG_DYNTURBO -@@ -2303,6 +2330,11 @@ ath_intr(int irq, void *dev_id, struct p +@@ -2299,6 +2328,11 @@ } } #endif @@ -87,7 +91,7 @@ ATH_SCHEDULE_TQUEUE(&sc->sc_txtq, &needmark); } if (status & HAL_INT_BMISS) { -@@ -2515,6 +2547,7 @@ ath_init(struct net_device *dev) +@@ -2511,6 +2545,7 @@ if (sc->sc_tx99 != NULL) sc->sc_tx99->start(sc->sc_tx99); #endif @@ -95,7 +99,7 @@ done: ATH_UNLOCK(sc); -@@ -2555,6 +2588,9 @@ ath_stop_locked(struct net_device *dev) +@@ -2551,6 +2586,9 @@ if (sc->sc_tx99 != NULL) sc->sc_tx99->stop(sc->sc_tx99); #endif @@ -105,7 +109,7 @@ netif_stop_queue(dev); /* XXX re-enabled by ath_newstate */ dev->flags &= ~IFF_RUNNING; /* NB: avoid recursion */ ieee80211_stop_running(ic); /* stop all VAPs */ -@@ -4013,12 +4049,47 @@ ath_key_set(struct ieee80211vap *vap, co +@@ -4009,6 +4047,39 @@ return ath_keyset(sc, k, mac, vap->iv_bss); } @@ -145,15 +149,7 @@ /* * Block/unblock tx+rx processing while a key change is done. * We assume the caller serializes key management operations - * so we only need to worry about synchronization with other - * uses that originate in the driver. - */ -+#define IS_UP(_dev) \ -+ (((_dev)->flags & (IFF_RUNNING|IFF_UP)) == (IFF_RUNNING|IFF_UP)) - static void - ath_key_update_begin(struct ieee80211vap *vap) - { -@@ -4032,14 +4103,9 @@ ath_key_update_begin(struct ieee80211vap +@@ -4026,13 +4097,7 @@ * When called from the rx tasklet we cannot use * tasklet_disable because it will block waiting * for us to complete execution. @@ -164,26 +160,23 @@ */ - if (!in_softirq()) - tasklet_disable(&sc->sc_rxtq); -- netif_stop_queue(dev); -+ if (IS_UP(vap->iv_dev)) -+ netif_stop_queue(dev); + netif_stop_queue(dev); } - static void -@@ -4051,9 +4117,9 @@ ath_key_update_end(struct ieee80211vap * - #endif +@@ -4043,9 +4108,9 @@ + struct ath_softc *sc = dev->priv; DPRINTF(sc, ATH_DEBUG_KEYCACHE, "End\n"); - netif_wake_queue(dev); - if (!in_softirq()) /* NB: see above */ - tasklet_enable(&sc->sc_rxtq); + -+ if (IS_UP(vap->iv_dev)) ++ if (dev->flags&IFF_RUNNING) + netif_wake_queue(dev); } /* -@@ -6360,15 +6426,25 @@ ath_setdefantenna(struct ath_softc *sc, +@@ -6350,15 +6415,25 @@ sc->sc_rxotherant = 0; } @@ -213,7 +206,7 @@ struct ieee80211com *ic = &sc->sc_ic; struct ath_hal *ah = sc ? sc->sc_ah : NULL; struct ath_desc *ds; -@@ -6378,8 +6454,10 @@ ath_rx_tasklet(TQUEUE_ARG data) +@@ -6368,8 +6443,10 @@ unsigned int len; int type; u_int phyerr; @@ -224,23 +217,23 @@ do { bf = STAILQ_FIRST(&sc->sc_rxbuf); if (bf == NULL) { /* XXX ??? can this happen */ -@@ -6403,6 +6481,15 @@ ath_rx_tasklet(TQUEUE_ARG data) +@@ -6393,6 +6470,15 @@ /* NB: never process the self-linked entry at the end */ break; } + -+ if (rx_limit-- < 2) { ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,24) ++ processed++; ++#endif ++ if (rx_limit-- < 0) { + early_stop = 1; + break; + } -+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,24) -+ processed++; -+#endif + skb = bf->bf_skb; if (skb == NULL) { EPRINTF(sc, "Dropping; buffer contains NULL skbuff.\n"); -@@ -6450,6 +6537,7 @@ ath_rx_tasklet(TQUEUE_ARG data) +@@ -6440,6 +6526,7 @@ sc->sc_stats.ast_rx_phyerr++; phyerr = rs->rs_phyerr & 0x1f; sc->sc_stats.ast_rx_phy[phyerr]++; @@ -248,7 +241,7 @@ } if (rs->rs_status & HAL_RXERR_DECRYPT) { /* -@@ -6645,9 +6733,39 @@ rx_next: +@@ -6635,9 +6722,43 @@ STAILQ_INSERT_TAIL(&sc->sc_rxbuf, bf, bf_list); ATH_RXBUF_UNLOCK_IRQ(sc); } while (ath_rxbuf_init(sc, bf) == 0); @@ -257,6 +250,7 @@ + /* Check if more data is received while we were + * processing the descriptor chain. + */ ++#ifndef ATH_PRECISE_TSF + local_irq_save(flags); + if (sc->sc_isr & HAL_INT_RX) { + u_int64_t hw_tsf = ath_hal_gettsf64(ah); @@ -265,7 +259,12 @@ + ath_uapsd_processtriggers(sc, hw_tsf); + goto process_rx_again; + } ++#endif ++#ifndef ATH_PRECISE_TSF ++ sc->sc_imask |= HAL_INT_RX; ++ ath_hal_intrset(ah, sc->sc_imask); + local_irq_restore(flags); ++#endif + } + +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,24) @@ -275,8 +274,6 @@ + *budget -= processed; + dev->quota -= processed; +#endif -+ sc->sc_imask |= HAL_INT_RX; -+ ath_hal_intrset(ah, sc->sc_imask); /* rx signal state monitoring */ ath_hal_rxmonitor(ah, &sc->sc_halstats, &sc->sc_curchan); @@ -288,7 +285,7 @@ #undef PA2DESC } -@@ -8298,12 +8416,24 @@ ath_tx_tasklet_q0(TQUEUE_ARG data) +@@ -8288,12 +8409,24 @@ { struct net_device *dev = (struct net_device *)data; struct ath_softc *sc = dev->priv; @@ -313,7 +310,7 @@ netif_wake_queue(dev); if (sc->sc_softled) -@@ -8319,7 +8449,9 @@ ath_tx_tasklet_q0123(TQUEUE_ARG data) +@@ -8309,7 +8442,9 @@ { struct net_device *dev = (struct net_device *)data; struct ath_softc *sc = dev->priv; @@ -323,7 +320,7 @@ /* * Process each active queue. */ -@@ -8340,6 +8472,16 @@ ath_tx_tasklet_q0123(TQUEUE_ARG data) +@@ -8330,6 +8465,16 @@ if (sc->sc_uapsdq && txqactive(sc->sc_ah, sc->sc_uapsdq->axq_qnum)) ath_tx_processq(sc, sc->sc_uapsdq); @@ -340,7 +337,7 @@ netif_wake_queue(dev); if (sc->sc_softled) -@@ -8355,13 +8497,25 @@ ath_tx_tasklet(TQUEUE_ARG data) +@@ -8345,13 +8490,25 @@ struct net_device *dev = (struct net_device *)data; struct ath_softc *sc = dev->priv; unsigned int i; @@ -366,7 +363,7 @@ netif_wake_queue(dev); if (sc->sc_softled) -@@ -10296,9 +10450,9 @@ ath_change_mtu(struct net_device *dev, i +@@ -10284,9 +10441,9 @@ dev->mtu = mtu; if ((dev->flags & IFF_RUNNING) && !sc->sc_invalid) { /* NB: the rx buffers may need to be reallocated */ @@ -378,8 +375,10 @@ } ATH_UNLOCK(sc); ---- a/ath/if_athvar.h -+++ b/ath/if_athvar.h +Index: madwifi-trunk-r3314/ath/if_athvar.h +=================================================================== +--- madwifi-trunk-r3314.orig/ath/if_athvar.h ++++ madwifi-trunk-r3314/ath/if_athvar.h @@ -53,6 +53,10 @@ # include #endif @@ -391,7 +390,7 @@ /* * Deduce if tasklets are available. If not then * fall back to using the immediate work queue. -@@ -616,6 +620,9 @@ struct ath_rp { +@@ -616,6 +620,9 @@ struct ath_softc { struct ieee80211com sc_ic; /* NB: must be first */ struct net_device *sc_dev; @@ -401,7 +400,7 @@ void __iomem *sc_iobase; /* address of the device */ struct semaphore sc_lock; /* dev-level lock */ struct net_device_stats sc_devstats; /* device statistics */ -@@ -730,7 +737,6 @@ struct ath_softc { +@@ -730,7 +737,6 @@ struct ath_buf *sc_rxbufcur; /* current rx buffer */ u_int32_t *sc_rxlink; /* link ptr in last RX desc */ spinlock_t sc_rxbuflock; @@ -409,7 +408,7 @@ struct ATH_TQ_STRUCT sc_rxorntq; /* rxorn intr tasklet */ u_int8_t sc_defant; /* current default antenna */ u_int8_t sc_rxotherant; /* RXs on non-default antenna */ -@@ -745,6 +751,7 @@ struct ath_softc { +@@ -745,6 +751,7 @@ u_int sc_txintrperiod; /* tx interrupt batching */ struct ath_txq sc_txq[HAL_NUM_TX_QUEUES]; struct ath_txq *sc_ac2q[WME_NUM_AC]; /* WME AC -> h/w qnum */ @@ -417,7 +416,7 @@ struct ATH_TQ_STRUCT sc_txtq; /* tx intr tasklet */ u_int8_t sc_grppoll_str[GRPPOLL_RATE_STR_LEN]; struct ath_descdma sc_bdma; /* beacon descriptors */ -@@ -858,6 +865,8 @@ typedef void (*ath_callback) (struct ath +@@ -858,6 +865,8 @@ #define ATH_TXBUF_LOCK_CHECK(_sc) #endif @@ -426,9 +425,11 @@ #define ATH_RXBUF_LOCK_INIT(_sc) spin_lock_init(&(_sc)->sc_rxbuflock) #define ATH_RXBUF_LOCK_DESTROY(_sc) ---- a/net80211/ieee80211_input.c -+++ b/net80211/ieee80211_input.c -@@ -1198,7 +1198,7 @@ ieee80211_deliver_data(struct ieee80211_ +Index: madwifi-trunk-r3314/net80211/ieee80211_input.c +=================================================================== +--- madwifi-trunk-r3314.orig/net80211/ieee80211_input.c ++++ madwifi-trunk-r3314/net80211/ieee80211_input.c +@@ -1198,7 +1198,7 @@ /* attach vlan tag */ struct ieee80211_node *ni_tmp = SKB_CB(skb)->ni; if (vlan_hwaccel_receive_skb(skb, vap->iv_vlgrp, ni->ni_vlan) == NET_RX_DROP) { @@ -437,7 +438,7 @@ * device was too busy */ if (ni_tmp != NULL) { /* node reference was leaked */ -@@ -1209,8 +1209,8 @@ ieee80211_deliver_data(struct ieee80211_ +@@ -1209,8 +1209,8 @@ skb = NULL; /* SKB is no longer ours */ } else { struct ieee80211_node *ni_tmp = SKB_CB(skb)->ni; @@ -448,7 +449,7 @@ * device was too busy */ if (ni_tmp != NULL) { /* node reference was leaked */ -@@ -2322,8 +2322,8 @@ forward_mgmt_to_app(struct ieee80211vap +@@ -2322,8 +2322,8 @@ skb1->protocol = __constant_htons(0x0019); /* ETH_P_80211_RAW */ ni_tmp = SKB_CB(skb1)->ni; @@ -459,9 +460,11 @@ * device was too busy */ if (ni_tmp != NULL) { /* node reference was leaked */ ---- a/net80211/ieee80211_monitor.c -+++ b/net80211/ieee80211_monitor.c -@@ -584,8 +584,8 @@ ieee80211_input_monitor(struct ieee80211 +Index: madwifi-trunk-r3314/net80211/ieee80211_monitor.c +=================================================================== +--- madwifi-trunk-r3314.orig/net80211/ieee80211_monitor.c ++++ madwifi-trunk-r3314/net80211/ieee80211_monitor.c +@@ -584,8 +584,8 @@ skb1->protocol = __constant_htons(0x0019); /* ETH_P_80211_RAW */ @@ -472,8 +475,10 @@ * device was too busy, reclaim the ref. in * the skb. */ if (SKB_CB(skb1)->ni != NULL) ---- a/net80211/ieee80211_skb.c -+++ b/net80211/ieee80211_skb.c +Index: madwifi-trunk-r3314/net80211/ieee80211_skb.c +=================================================================== +--- madwifi-trunk-r3314.orig/net80211/ieee80211_skb.c ++++ madwifi-trunk-r3314/net80211/ieee80211_skb.c @@ -73,7 +73,7 @@ #undef dev_queue_xmit #undef kfree_skb @@ -483,7 +488,7 @@ #undef pskb_copy #undef skb_clone #undef skb_copy -@@ -638,8 +638,8 @@ int vlan_hwaccel_receive_skb_debug(stru +@@ -638,8 +638,8 @@ grp, vlan_tag); } @@ -494,7 +499,7 @@ } struct sk_buff * alloc_skb_debug(unsigned int length, gfp_t gfp_mask, -@@ -760,7 +760,7 @@ struct sk_buff * skb_copy_expand_debug(c +@@ -760,7 +760,7 @@ } EXPORT_SYMBOL(vlan_hwaccel_receive_skb_debug); @@ -503,9 +508,11 @@ EXPORT_SYMBOL(alloc_skb_debug); EXPORT_SYMBOL(dev_alloc_skb_debug); EXPORT_SYMBOL(skb_clone_debug); ---- a/net80211/ieee80211_skb.h -+++ b/net80211/ieee80211_skb.h -@@ -116,7 +116,7 @@ int ieee80211_skb_references(void); +Index: madwifi-trunk-r3314/net80211/ieee80211_skb.h +=================================================================== +--- madwifi-trunk-r3314.orig/net80211/ieee80211_skb.h ++++ madwifi-trunk-r3314/net80211/ieee80211_skb.h +@@ -116,7 +116,7 @@ int vlan_hwaccel_receive_skb_debug(struct sk_buff *skb, struct vlan_group *grp, unsigned short vlan_tag, const char* func, int line); @@ -514,7 +521,7 @@ struct sk_buff * alloc_skb_debug(unsigned int length, gfp_t gfp_mask, const char *func, int line); struct sk_buff * dev_alloc_skb_debug(unsigned int length, -@@ -151,7 +151,7 @@ struct sk_buff * skb_copy_expand_debug(c +@@ -151,7 +151,7 @@ #undef dev_queue_xmit #undef kfree_skb #undef kfree_skb_fast @@ -523,7 +530,7 @@ #undef pskb_copy #undef skb_clone #undef skb_copy -@@ -168,8 +168,8 @@ struct sk_buff * skb_copy_expand_debug(c +@@ -168,8 +168,8 @@ skb_copy_expand_debug(_skb, _newheadroom, _newtailroom, _gfp_mask, __func__, __LINE__) #define vlan_hwaccel_receive_skb(_skb, _grp, _tag) \ vlan_hwaccel_receive_skb_debug(_skb, _grp, _tag, __func__, __LINE__) Modified: trunk/marvell_owrt_8.09/package/madwifi/patches/305-pureg_fix.patch =================================================================== --- trunk/marvell_owrt_8.09/package/madwifi/patches/305-pureg_fix.patch 2009-08-26 17:09:25 UTC (rev 85) +++ trunk/marvell_owrt_8.09/package/madwifi/patches/305-pureg_fix.patch 2009-08-26 18:24:23 UTC (rev 86) @@ -1,6 +1,8 @@ ---- a/ath/if_ath.c -+++ b/ath/if_ath.c -@@ -4158,7 +4158,9 @@ ath_calcrxfilter(struct ath_softc *sc) +Index: madwifi-trunk-r3314/ath/if_ath.c +=================================================================== +--- madwifi-trunk-r3314.orig/ath/if_ath.c ++++ madwifi-trunk-r3314/ath/if_ath.c +@@ -4149,7 +4149,9 @@ rfilt |= HAL_RX_FILTER_PROM; if (ic->ic_opmode == IEEE80211_M_STA || sc->sc_opmode == HAL_M_IBSS || /* NB: AHDEMO too */ @@ -11,9 +13,11 @@ rfilt |= HAL_RX_FILTER_BEACON; if (sc->sc_nmonvaps > 0) rfilt |= (HAL_RX_FILTER_CONTROL | HAL_RX_FILTER_BEACON | ---- a/net80211/ieee80211_input.c -+++ b/net80211/ieee80211_input.c -@@ -346,11 +346,12 @@ ieee80211_input(struct ieee80211vap * va +Index: madwifi-trunk-r3314/net80211/ieee80211_input.c +=================================================================== +--- madwifi-trunk-r3314.orig/net80211/ieee80211_input.c ++++ madwifi-trunk-r3314/net80211/ieee80211_input.c +@@ -346,11 +346,12 @@ bssid = wh->i_addr3; } /* @@ -29,7 +33,7 @@ /* * allow MGT frames to vap->iv_xrvap. * this will allow roaming between XR and normal vaps -@@ -366,18 +367,14 @@ ieee80211_input(struct ieee80211vap * va +@@ -366,18 +367,14 @@ vap->iv_stats.is_rx_wrongbss++; goto out; } @@ -49,7 +53,7 @@ break; case IEEE80211_M_WDS: if (skb->len < sizeof(struct ieee80211_frame_addr4)) { -@@ -3066,7 +3063,7 @@ ieee80211_recv_mgmt(struct ieee80211vap +@@ -3066,7 +3063,7 @@ u_int8_t *frm, *efrm; u_int8_t *ssid, *rates, *xrates, *suppchan, *wpa, *rsn, *wme, *ath; u_int8_t rate; @@ -58,7 +62,7 @@ u_int8_t qosinfo; if (ni_or_null == NULL) -@@ -3096,11 +3093,15 @@ ieee80211_recv_mgmt(struct ieee80211vap +@@ -3096,11 +3093,15 @@ * o station mode when associated (to collect state * updates such as 802.11g slot time), or * o adhoc mode (to discover neighbors) @@ -75,7 +79,7 @@ vap->iv_stats.is_rx_mgtdiscard++; return; } -@@ -3184,6 +3185,7 @@ ieee80211_recv_mgmt(struct ieee80211vap +@@ -3184,6 +3185,7 @@ break; } scan.erp = frm[2]; @@ -83,7 +87,7 @@ break; case IEEE80211_ELEMID_RSN: scan.rsn = frm; -@@ -3421,6 +3423,20 @@ ieee80211_recv_mgmt(struct ieee80211vap +@@ -3421,6 +3423,20 @@ ieee80211_bg_scan(vap); return; } @@ -104,9 +108,11 @@ /* * If scanning, just pass information to the scan module. */ ---- a/net80211/ieee80211_node.c -+++ b/net80211/ieee80211_node.c -@@ -383,10 +383,16 @@ ieee80211_create_ibss(struct ieee80211va +Index: madwifi-trunk-r3314/net80211/ieee80211_node.c +=================================================================== +--- madwifi-trunk-r3314.orig/net80211/ieee80211_node.c ++++ madwifi-trunk-r3314/net80211/ieee80211_node.c +@@ -383,10 +383,16 @@ /* Update country ie information */ ieee80211_build_countryie(ic); @@ -125,9 +131,11 @@ (void) ieee80211_sta_join1(PASS_NODE(ni)); } ---- a/net80211/ieee80211_proto.c -+++ b/net80211/ieee80211_proto.c -@@ -595,6 +595,28 @@ static const struct ieee80211_rateset ba +Index: madwifi-trunk-r3314/net80211/ieee80211_proto.c +=================================================================== +--- madwifi-trunk-r3314.orig/net80211/ieee80211_proto.c ++++ madwifi-trunk-r3314/net80211/ieee80211_proto.c +@@ -595,6 +595,28 @@ { 4, { 2, 4, 11, 22 } }, /* IEEE80211_MODE_TURBO_G (mixed b/g) */ }; @@ -156,9 +164,11 @@ /* * Mark the basic rates for the 11g rate table based on the * specified mode. For 11b compatibility we mark only 11b ---- a/net80211/ieee80211_var.h -+++ b/net80211/ieee80211_var.h -@@ -708,6 +708,7 @@ int ieee80211_media_setup(struct ieee802 +Index: madwifi-trunk-r3314/net80211/ieee80211_var.h +=================================================================== +--- madwifi-trunk-r3314.orig/net80211/ieee80211_var.h ++++ madwifi-trunk-r3314/net80211/ieee80211_var.h +@@ -708,6 +708,7 @@ void ieee80211_build_sc_ie(struct ieee80211com *); void ieee80211_dfs_action(struct ieee80211com *); void ieee80211_expire_channel_excl_restrictions(struct ieee80211com *); Modified: trunk/marvell_owrt_8.09/package/madwifi/patches/309-micfail_detect.patch =================================================================== --- trunk/marvell_owrt_8.09/package/madwifi/patches/309-micfail_detect.patch 2009-08-26 17:09:25 UTC (rev 85) +++ trunk/marvell_owrt_8.09/package/madwifi/patches/309-micfail_detect.patch 2009-08-26 18:24:23 UTC (rev 86) @@ -1,6 +1,8 @@ ---- a/ath/if_ath.c -+++ b/ath/if_ath.c -@@ -6457,6 +6457,7 @@ ath_rx_poll(struct net_device *dev, int +Index: madwifi-trunk-r3314/ath/if_ath.c +=================================================================== +--- madwifi-trunk-r3314.orig/ath/if_ath.c ++++ madwifi-trunk-r3314/ath/if_ath.c +@@ -6446,6 +6446,7 @@ int type; u_int phyerr; u_int processed = 0, early_stop = 0; @@ -8,7 +10,7 @@ DPRINTF(sc, ATH_DEBUG_RX_PROC, "invoked\n"); process_rx_again: -@@ -6558,24 +6559,8 @@ process_rx_again: +@@ -6547,24 +6548,8 @@ } if (rs->rs_status & HAL_RXERR_MIC) { sc->sc_stats.ast_rx_badmic++; @@ -35,7 +37,7 @@ } /* * Reject error frames if we have no vaps that -@@ -6614,8 +6599,9 @@ rx_accept: +@@ -6603,8 +6588,9 @@ /* * Finished monitor mode handling, now reject * error frames before passing to other vaps @@ -46,7 +48,7 @@ ieee80211_dev_kfree_skb(&skb); goto rx_next; } -@@ -6623,6 +6609,26 @@ rx_accept: +@@ -6612,6 +6598,26 @@ /* remove the CRC */ skb_trim(skb, skb->len - IEEE80211_CRC_LEN); @@ -73,7 +75,7 @@ /* * From this point on we assume the frame is at least * as large as ieee80211_frame_min; verify that. -@@ -6635,6 +6641,7 @@ rx_accept: +@@ -6624,6 +6630,7 @@ goto rx_next; } @@ -81,9 +83,11 @@ /* * Normal receive. */ ---- a/net80211/ieee80211_crypto_ccmp.c -+++ b/net80211/ieee80211_crypto_ccmp.c -@@ -73,7 +73,7 @@ static int ccmp_setkey(struct ieee80211_ +Index: madwifi-trunk-r3314/net80211/ieee80211_crypto_ccmp.c +=================================================================== +--- madwifi-trunk-r3314.orig/net80211/ieee80211_crypto_ccmp.c ++++ madwifi-trunk-r3314/net80211/ieee80211_crypto_ccmp.c +@@ -73,7 +73,7 @@ static int ccmp_encap(struct ieee80211_key *, struct sk_buff *, u_int8_t); static int ccmp_decap(struct ieee80211_key *, struct sk_buff *, int); static int ccmp_enmic(struct ieee80211_key *, struct sk_buff *, int); @@ -92,7 +96,7 @@ static const struct ieee80211_cipher ccmp = { .ic_name = "AES-CCM", -@@ -308,7 +308,7 @@ ccmp_decap(struct ieee80211_key *k, stru +@@ -308,7 +308,7 @@ * Verify and strip MIC from the frame. */ static int @@ -101,9 +105,11 @@ { return 1; } ---- a/net80211/ieee80211_crypto.h -+++ b/net80211/ieee80211_crypto.h -@@ -145,7 +145,7 @@ struct ieee80211_cipher { +Index: madwifi-trunk-r3314/net80211/ieee80211_crypto.h +=================================================================== +--- madwifi-trunk-r3314.orig/net80211/ieee80211_crypto.h ++++ madwifi-trunk-r3314/net80211/ieee80211_crypto.h +@@ -145,7 +145,7 @@ int (*ic_encap)(struct ieee80211_key *, struct sk_buff *, u_int8_t); int (*ic_decap)(struct ieee80211_key *, struct sk_buff *, int); int (*ic_enmic)(struct ieee80211_key *, struct sk_buff *, int); @@ -112,7 +118,7 @@ }; extern const struct ieee80211_cipher ieee80211_cipher_none; -@@ -163,10 +163,10 @@ struct ieee80211_key *ieee80211_crypto_d +@@ -163,10 +163,10 @@ */ static __inline int ieee80211_crypto_demic(struct ieee80211vap *vap, struct ieee80211_key *k, @@ -125,9 +131,11 @@ } /* ---- a/net80211/ieee80211_crypto_none.c -+++ b/net80211/ieee80211_crypto_none.c -@@ -52,7 +52,7 @@ static int none_setkey(struct ieee80211_ +Index: madwifi-trunk-r3314/net80211/ieee80211_crypto_none.c +=================================================================== +--- madwifi-trunk-r3314.orig/net80211/ieee80211_crypto_none.c ++++ madwifi-trunk-r3314/net80211/ieee80211_crypto_none.c +@@ -52,7 +52,7 @@ static int none_encap(struct ieee80211_key *, struct sk_buff *, u_int8_t); static int none_decap(struct ieee80211_key *, struct sk_buff *, int); static int none_enmic(struct ieee80211_key *, struct sk_buff *, int); @@ -136,7 +144,7 @@ const struct ieee80211_cipher ieee80211_cipher_none = { .ic_name = "NONE", -@@ -137,7 +137,7 @@ none_enmic(struct ieee80211_key *k, stru +@@ -137,7 +137,7 @@ } static int @@ -145,9 +153,11 @@ { struct ieee80211vap *vap = k->wk_private; ---- a/net80211/ieee80211_crypto_tkip.c -+++ b/net80211/ieee80211_crypto_tkip.c -@@ -57,7 +57,7 @@ static int tkip_setkey(struct ieee80211_ +Index: madwifi-trunk-r3314/net80211/ieee80211_crypto_tkip.c +=================================================================== +--- madwifi-trunk-r3314.orig/net80211/ieee80211_crypto_tkip.c ++++ madwifi-trunk-r3314/net80211/ieee80211_crypto_tkip.c +@@ -57,7 +57,7 @@ static int tkip_encap(struct ieee80211_key *, struct sk_buff *, u_int8_t); static int tkip_enmic(struct ieee80211_key *, struct sk_buff *, int); static int tkip_decap(struct ieee80211_key *, struct sk_buff *, int); @@ -156,7 +166,7 @@ static const struct ieee80211_cipher tkip = { .ic_name = "TKIP", -@@ -339,7 +339,7 @@ tkip_decap(struct ieee80211_key *k, stru +@@ -339,7 +339,7 @@ * Verify and strip MIC from the frame. */ static int @@ -165,7 +175,7 @@ { struct tkip_ctx *ctx = k->wk_private; struct sk_buff *skb; -@@ -355,7 +355,7 @@ tkip_demic(struct ieee80211_key *k, stru +@@ -355,7 +355,7 @@ } wh = (struct ieee80211_frame *) skb0->data; /* NB: skb left pointing at last in chain */ @@ -174,9 +184,11 @@ struct ieee80211vap *vap = ctx->tc_vap; u8 mic[IEEE80211_WEP_MICLEN]; u8 mic0[IEEE80211_WEP_MICLEN]; ---- a/net80211/ieee80211_crypto_wep.c -+++ b/net80211/ieee80211_crypto_wep.c -@@ -54,7 +54,7 @@ static int wep_setkey(struct ieee80211_k +Index: madwifi-trunk-r3314/net80211/ieee80211_crypto_wep.c +=================================================================== +--- madwifi-trunk-r3314.orig/net80211/ieee80211_crypto_wep.c ++++ madwifi-trunk-r3314/net80211/ieee80211_crypto_wep.c +@@ -54,7 +54,7 @@ static int wep_encap(struct ieee80211_key *, struct sk_buff *, u_int8_t); static int wep_decap(struct ieee80211_key *, struct sk_buff *, int); static int wep_enmic(struct ieee80211_key *, struct sk_buff *, int); @@ -185,7 +197,7 @@ static const struct ieee80211_cipher wep = { .ic_name = "WEP", -@@ -244,7 +244,7 @@ wep_decap(struct ieee80211_key *k, struc +@@ -244,7 +244,7 @@ * Verify and strip MIC from the frame. */ static int @@ -194,9 +206,11 @@ { return 1; } ---- a/net80211/ieee80211_input.c -+++ b/net80211/ieee80211_input.c -@@ -669,7 +669,7 @@ ieee80211_input(struct ieee80211vap * va +Index: madwifi-trunk-r3314/net80211/ieee80211_input.c +=================================================================== +--- madwifi-trunk-r3314.orig/net80211/ieee80211_input.c ++++ madwifi-trunk-r3314/net80211/ieee80211_input.c +@@ -669,7 +669,7 @@ * Next strip any MSDU crypto bits. */ if (key != NULL && @@ -205,7 +219,7 @@ IEEE80211_DISCARD_MAC(vap, IEEE80211_MSG_INPUT, ni->ni_macaddr, "data", "%s", "demic error"); IEEE80211_NODE_STAT(ni, rx_demicfail); -@@ -4293,6 +4293,47 @@ ath_eth_type_trans(struct sk_buff *skb, +@@ -4293,6 +4293,47 @@ } #endif @@ -253,9 +267,11 @@ #ifdef IEEE80211_DEBUG /* * Debugging support. ---- a/net80211/ieee80211_proto.h -+++ b/net80211/ieee80211_proto.h -@@ -90,6 +90,7 @@ int ieee80211_iserp_rateset(struct ieee8 +Index: madwifi-trunk-r3314/net80211/ieee80211_proto.h +=================================================================== +--- madwifi-trunk-r3314.orig/net80211/ieee80211_proto.h ++++ madwifi-trunk-r3314/net80211/ieee80211_proto.h +@@ -90,6 +90,7 @@ void ieee80211_set11gbasicrates(struct ieee80211_rateset *, enum ieee80211_phymode); enum ieee80211_phymode ieee80211_get11gbasicrates(struct ieee80211_rateset *); void ieee80211_send_pspoll(struct ieee80211_node *); @@ -263,9 +279,11 @@ /* * Return the size of the 802.11 header for a management or data frame. ---- a/net80211/ieee80211_linux.c -+++ b/net80211/ieee80211_linux.c -@@ -337,8 +337,8 @@ ieee80211_notify_replay_failure(struct i +Index: madwifi-trunk-r3314/net80211/ieee80211_linux.c +=================================================================== +--- madwifi-trunk-r3314.orig/net80211/ieee80211_linux.c ++++ madwifi-trunk-r3314/net80211/ieee80211_linux.c +@@ -337,8 +337,8 @@ /* TODO: needed parameters: count, keyid, key type, src address, TSC */ snprintf(buf, sizeof(buf), "%s(keyid=%d %scast addr=" MAC_FMT ")", tag, k->wk_keyix, @@ -276,9 +294,11 @@ memset(&wrqu, 0, sizeof(wrqu)); wrqu.data.length = strlen(buf); wireless_send_event(dev, IWEVCUSTOM, &wrqu, buf); ---- a/net80211/ieee80211_output.c -+++ b/net80211/ieee80211_output.c -@@ -1074,13 +1074,16 @@ ieee80211_encap(struct ieee80211_node *n +Index: madwifi-trunk-r3314/net80211/ieee80211_output.c +=================================================================== +--- madwifi-trunk-r3314.orig/net80211/ieee80211_output.c ++++ madwifi-trunk-r3314/net80211/ieee80211_output.c +@@ -1074,13 +1074,16 @@ cip = (struct ieee80211_cipher *) key->wk_cipher; ciphdrsize = cip->ic_header; tailsize += (cip->ic_trailer + cip->ic_miclen); @@ -298,9 +318,11 @@ /* * Allocate sk_buff for each subsequent fragment; First fragment ---- a/net80211/ieee80211_node.c -+++ b/net80211/ieee80211_node.c -@@ -2264,11 +2264,13 @@ ieee80211_node_leave(struct ieee80211_no +Index: madwifi-trunk-r3314/net80211/ieee80211_node.c +=================================================================== +--- madwifi-trunk-r3314.orig/net80211/ieee80211_node.c ++++ madwifi-trunk-r3314/net80211/ieee80211_node.c +@@ -2264,11 +2264,13 @@ /* From this point onwards we can no longer find the node, * so no more references are generated */ Modified: trunk/marvell_owrt_8.09/package/madwifi/patches/310-noise_get.patch =================================================================== --- trunk/marvell_owrt_8.09/package/madwifi/patches/310-noise_get.patch 2009-08-26 17:09:25 UTC (rev 85) +++ trunk/marvell_owrt_8.09/package/madwifi/patches/310-noise_get.patch 2009-08-26 18:24:23 UTC (rev 86) @@ -1,6 +1,8 @@ ---- a/ath/if_ath.c -+++ b/ath/if_ath.c -@@ -1699,8 +1699,6 @@ ath_uapsd_processtriggers(struct ath_sof +Index: madwifi-trunk-r3314/ath/if_ath.c +=================================================================== +--- madwifi-trunk-r3314.orig/ath/if_ath.c ++++ madwifi-trunk-r3314/ath/if_ath.c +@@ -1695,8 +1695,6 @@ * get to reality. This value is used in monitor mode and by tools like * Wireshark and Kismet. */ @@ -9,7 +11,7 @@ ATH_RXBUF_LOCK_IRQ(sc); if (sc->sc_rxbufcur == NULL) sc->sc_rxbufcur = STAILQ_FIRST(&sc->sc_rxbuf); -@@ -8975,6 +8973,7 @@ ath_calibrate(unsigned long arg) +@@ -8966,6 +8964,7 @@ sc->sc_curchan.channel); sc->sc_stats.ast_per_calfail++; } @@ -17,7 +19,7 @@ ath_hal_process_noisefloor(ah); if (isIQdone == AH_TRUE) { -@@ -9043,6 +9042,7 @@ ath_set_channel(struct ieee80211com *ic) +@@ -9034,6 +9033,7 @@ struct ath_softc *sc = dev->priv; (void) ath_chan_set(sc, ic->ic_curchan); @@ -25,7 +27,7 @@ /* * If we are returning to our bss channel then mark state * so the next recv'd beacon's TSF will be used to sync the -@@ -9311,6 +9311,7 @@ ath_newstate(struct ieee80211vap *vap, e +@@ -9302,6 +9302,7 @@ } ath_hal_process_noisefloor(ah); @@ -33,9 +35,11 @@ /* * Reset rssi stats; maybe not the best place... */ ---- a/net80211/ieee80211_wireless.c -+++ b/net80211/ieee80211_wireless.c -@@ -4358,6 +4358,7 @@ get_sta_info(void *arg, struct ieee80211 +Index: madwifi-trunk-r3314/net80211/ieee80211_wireless.c +=================================================================== +--- madwifi-trunk-r3314.orig/net80211/ieee80211_wireless.c ++++ madwifi-trunk-r3314/net80211/ieee80211_wireless.c +@@ -4358,6 +4358,7 @@ si->isi_state = ni->ni_flags; si->isi_authmode = ni->ni_authmode; si->isi_rssi = ic->ic_node_getrssi(ni); @@ -43,9 +47,11 @@ si->isi_capinfo = ni->ni_capinfo; si->isi_athflags = ni->ni_ath_flags; si->isi_erp = ni->ni_erp; ---- a/net80211/ieee80211_ioctl.h -+++ b/net80211/ieee80211_ioctl.h -@@ -311,6 +311,7 @@ struct ieee80211req_sta_info { +Index: madwifi-trunk-r3314/net80211/ieee80211_ioctl.h +=================================================================== +--- madwifi-trunk-r3314.orig/net80211/ieee80211_ioctl.h ++++ madwifi-trunk-r3314/net80211/ieee80211_ioctl.h +@@ -311,6 +311,7 @@ u_int16_t isi_state; /* state flags */ u_int8_t isi_authmode; /* authentication algorithm */ u_int8_t isi_rssi; Modified: trunk/marvell_owrt_8.09/package/madwifi/patches/311-bssid_alloc.patch =================================================================== --- trunk/marvell_owrt_8.09/package/madwifi/patches/311-bssid_alloc.patch 2009-08-26 17:09:25 UTC (rev 85) +++ trunk/marvell_owrt_8.09/package/madwifi/patches/311-bssid_alloc.patch 2009-08-26 18:24:23 UTC (rev 86) @@ -1,6 +1,8 @@ ---- a/ath/if_ath.c -+++ b/ath/if_ath.c -@@ -1354,7 +1354,7 @@ ath_vap_create(struct ieee80211com *ic, +Index: madwifi-trunk-r3314/ath/if_ath.c +=================================================================== +--- madwifi-trunk-r3314.orig/ath/if_ath.c ++++ madwifi-trunk-r3314/ath/if_ath.c +@@ -1354,7 +1354,7 @@ TAILQ_FOREACH(v, &ic->ic_vaps, iv_next) id_mask |= (1 << ATH_GET_VAP_ID(v->iv_myaddr)); Modified: trunk/marvell_owrt_8.09/package/madwifi/patches/312-erpupdate.patch =================================================================== --- trunk/marvell_owrt_8.09/package/madwifi/patches/312-erpupdate.patch 2009-08-26 17:09:25 UTC (rev 85) +++ trunk/marvell_owrt_8.09/package/madwifi/patches/312-erpupdate.patch 2009-08-26 18:24:23 UTC (rev 86) @@ -1,6 +1,8 @@ ---- a/net80211/ieee80211_beacon.c -+++ b/net80211/ieee80211_beacon.c -@@ -542,10 +542,10 @@ ieee80211_beacon_update(struct ieee80211 +Index: madwifi-trunk-r3314/net80211/ieee80211_beacon.c +=================================================================== +--- madwifi-trunk-r3314.orig/net80211/ieee80211_beacon.c ++++ madwifi-trunk-r3314/net80211/ieee80211_beacon.c +@@ -542,10 +542,10 @@ vap->iv_flags &= ~IEEE80211_F_XRUPDATE; } #endif @@ -13,9 +15,11 @@ } } /* if it is a mode change beacon for dynamic turbo case */ ---- a/net80211/ieee80211_input.c -+++ b/net80211/ieee80211_input.c -@@ -3431,9 +3431,12 @@ ieee80211_recv_mgmt(struct ieee80211vap +Index: madwifi-trunk-r3314/net80211/ieee80211_input.c +=================================================================== +--- madwifi-trunk-r3314.orig/net80211/ieee80211_input.c ++++ madwifi-trunk-r3314/net80211/ieee80211_input.c +@@ -3431,9 +3431,12 @@ /* Assume no ERP IE == 11b AP */ if ((!has_erp || (has_erp && (scan.erp & IEEE80211_ERP_NON_ERP_PRESENT))) && !(ic->ic_flags & IEEE80211_F_USEPROT)) { @@ -29,9 +33,11 @@ } } ---- a/net80211/ieee80211_node.c -+++ b/net80211/ieee80211_node.c -@@ -2025,8 +2025,12 @@ ieee80211_node_join_11g(struct ieee80211 +Index: madwifi-trunk-r3314/net80211/ieee80211_node.c +=================================================================== +--- madwifi-trunk-r3314.orig/net80211/ieee80211_node.c ++++ madwifi-trunk-r3314/net80211/ieee80211_node.c +@@ -2025,8 +2025,12 @@ } /* Update ERP element if this is first non ERP station */ @@ -46,7 +52,7 @@ } else ni->ni_flags |= IEEE80211_NODE_ERP; } -@@ -2229,6 +2233,8 @@ ieee80211_node_leave_11g(struct ieee8021 +@@ -2229,6 +2233,8 @@ IEEE80211_NOTE(vap, IEEE80211_MSG_ASSOC, ni, "non-ERP station leaves, count now %d", ic->ic_nonerpsta); if (ic->ic_nonerpsta == 0) { @@ -55,7 +61,7 @@ IEEE80211_DPRINTF(vap, IEEE80211_MSG_ASSOC, "%s: disable use of protection\n", __func__); ic->ic_flags &= ~IEEE80211_F_USEPROT; -@@ -2240,7 +2246,9 @@ ieee80211_node_leave_11g(struct ieee8021 +@@ -2240,7 +2246,9 @@ ic->ic_flags |= IEEE80211_F_SHPREAMBLE; ic->ic_flags &= ~IEEE80211_F_USEBARKER; } Modified: trunk/marvell_owrt_8.09/package/madwifi/patches/317-bmask.patch =================================================================== --- trunk/marvell_owrt_8.09/package/madwifi/patches/317-bmask.patch 2009-08-26 17:09:25 UTC (rev 85) +++ trunk/marvell_owrt_8.09/package/madwifi/patches/317-bmask.patch 2009-08-26 18:24:23 UTC (rev 86) @@ -1,6 +1,8 @@ ---- a/ath/if_ath.c -+++ b/ath/if_ath.c -@@ -8689,6 +8689,10 @@ ath_startrecv(struct ath_softc *sc) +Index: madwifi-trunk-r3314/ath/if_ath.c +=================================================================== +--- madwifi-trunk-r3314.orig/ath/if_ath.c ++++ madwifi-trunk-r3314/ath/if_ath.c +@@ -8680,6 +8680,10 @@ sc->sc_rxbufcur = NULL; Modified: trunk/marvell_owrt_8.09/package/madwifi/patches/323-dfs_optional.patch =================================================================== --- trunk/marvell_owrt_8.09/package/madwifi/patches/323-dfs_optional.patch 2009-08-26 17:09:25 UTC (rev 85) +++ trunk/marvell_owrt_8.09/package/madwifi/patches/323-dfs_optional.patch 2009-08-26 18:24:23 UTC (rev 86) @@ -1,6 +1,8 @@ ---- a/ath/if_ath.c -+++ b/ath/if_ath.c -@@ -1778,17 +1778,14 @@ ath_uapsd_processtriggers(struct ath_sof +Index: madwifi-trunk-r3314/ath/if_ath.c +=================================================================== +--- madwifi-trunk-r3314.orig/ath/if_ath.c ++++ madwifi-trunk-r3314/ath/if_ath.c +@@ -1774,17 +1774,14 @@ * may have occurred in the intervening timeframe. */ bf->bf_channoise = ic->ic_channoise; @@ -25,9 +27,11 @@ /* Prepare wireless header for examination */ bus_dma_sync_single(sc->sc_bdev, bf->bf_skbaddr, ---- a/ath/if_ath_radar.c -+++ b/ath/if_ath_radar.c -@@ -265,7 +265,7 @@ int ath_radar_update(struct ath_softc *s +Index: madwifi-trunk-r3314/ath/if_ath_radar.c +=================================================================== +--- madwifi-trunk-r3314.orig/ath/if_ath_radar.c ++++ madwifi-trunk-r3314/ath/if_ath_radar.c +@@ -261,7 +261,7 @@ unsigned int new_rxfilt = old_rxfilt; ath_hal_intrset(ah, old_ier & ~HAL_INT_GLOBAL); Modified: trunk/marvell_owrt_8.09/package/madwifi/patches/324-alignment.patch =================================================================== --- trunk/marvell_owrt_8.09/package/madwifi/patches/324-alignment.patch 2009-08-26 17:09:25 UTC (rev 85) +++ trunk/marvell_owrt_8.09/package/madwifi/patches/324-alignment.patch 2009-08-26 18:24:23 UTC (rev 86) @@ -1,6 +1,8 @@ ---- a/net80211/ieee80211_input.c -+++ b/net80211/ieee80211_input.c -@@ -1275,14 +1275,8 @@ ieee80211_decap(struct ieee80211vap *vap +Index: madwifi-trunk-r3314/net80211/ieee80211_input.c +=================================================================== +--- madwifi-trunk-r3314.orig/net80211/ieee80211_input.c ++++ madwifi-trunk-r3314/net80211/ieee80211_input.c +@@ -1275,14 +1275,8 @@ eh->ether_type = ether_type; if (!ALIGNED_POINTER(skb->data + sizeof(*eh), u_int32_t)) { Modified: trunk/marvell_owrt_8.09/package/madwifi/patches/325-channel_spam.patch =================================================================== --- trunk/marvell_owrt_8.09/package/madwifi/patches/325-channel_spam.patch 2009-08-26 17:09:25 UTC (rev 85) +++ trunk/marvell_owrt_8.09/package/madwifi/patches/325-channel_spam.patch 2009-08-26 18:24:23 UTC (rev 86) @@ -1,6 +1,8 @@ ---- a/ath/if_ath.c -+++ b/ath/if_ath.c -@@ -9792,7 +9792,9 @@ ath_getchannels(struct net_device *dev, +Index: madwifi-trunk-r3314/ath/if_ath.c +=================================================================== +--- madwifi-trunk-r3314.orig/ath/if_ath.c ++++ madwifi-trunk-r3314/ath/if_ath.c +@@ -9783,7 +9783,9 @@ /* * Convert HAL channels to ieee80211 ones. */ @@ -10,7 +12,7 @@ for (i = 0; i < nchan; i++) { HAL_CHANNEL *c = &chans[i]; struct ieee80211_channel *ichan = &ic->ic_channels[i]; -@@ -9819,6 +9821,7 @@ ath_getchannels(struct net_device *dev, +@@ -9810,6 +9812,7 @@ ic->ic_chan_non_occupy[i].tv_sec = 0; ic->ic_chan_non_occupy[i].tv_usec = 0; @@ -18,7 +20,7 @@ IPRINTF(sc, "Channel %3d (%4d MHz) Max Tx Power %d dBm%s " "[%d hw %d reg] Flags%s%s%s%s%s%s%s%s%s%s%s%s%" "s%s%s%s%s%s%s%s%s%s%s%s\n", -@@ -9907,6 +9910,7 @@ ath_getchannels(struct net_device *dev, +@@ -9898,6 +9901,7 @@ (c->privFlags & 0x0080 ? " PF & (1 << 7)" : "") ); Modified: trunk/marvell_owrt_8.09/package/madwifi/patches/327-queue.patch =================================================================== --- trunk/marvell_owrt_8.09/package/madwifi/patches/327-queue.patch 2009-08-26 17:09:25 UTC (rev 85) +++ trunk/marvell_owrt_8.09/package/madwifi/patches/327-queue.patch 2009-08-26 18:24:23 UTC (rev 86) @@ -1,6 +1,8 @@ ---- a/ath/if_ath.c -+++ b/ath/if_ath.c -@@ -8438,8 +8438,6 @@ process_tx_again: +Index: madwifi-trunk-r3314/ath/if_ath.c +=================================================================== +--- madwifi-trunk-r3314.orig/ath/if_ath.c ++++ madwifi-trunk-r3314/ath/if_ath.c +@@ -8431,8 +8431,6 @@ ath_hal_intrset(sc->sc_ah, sc->sc_imask); local_irq_restore(flags); @@ -9,7 +11,7 @@ if (sc->sc_softled) ath_led_event(sc, ATH_LED_TX); } -@@ -8486,8 +8484,6 @@ process_tx_again: +@@ -8479,8 +8477,6 @@ ath_hal_intrset(sc->sc_ah, sc->sc_imask); local_irq_restore(flags); @@ -18,7 +20,7 @@ if (sc->sc_softled) ath_led_event(sc, ATH_LED_TX); } -@@ -8520,8 +8516,6 @@ process_tx_again: +@@ -8513,8 +8509,6 @@ ath_hal_intrset(sc->sc_ah, sc->sc_imask); local_irq_restore(flags); @@ -27,9 +29,11 @@ if (sc->sc_softled) ath_led_event(sc, ATH_LED_TX); } ---- a/net80211/ieee80211_input.c -+++ b/net80211/ieee80211_input.c -@@ -1132,7 +1132,7 @@ ieee80211_deliver_data(struct ieee80211_ +Index: madwifi-trunk-r3314/net80211/ieee80211_input.c +=================================================================== +--- madwifi-trunk-r3314.orig/net80211/ieee80211_input.c ++++ madwifi-trunk-r3314/net80211/ieee80211_input.c +@@ -1132,7 +1132,7 @@ (vap->iv_flags & IEEE80211_F_NOBRIDGE) == 0) { struct sk_buff *skb1 = NULL; Modified: trunk/marvell_owrt_8.09/package/madwifi/patches/330-beaconcal.patch =================================================================== --- trunk/marvell_owrt_8.09/package/madwifi/patches/330-beaconcal.patch 2009-08-26 17:09:25 UTC (rev 85) +++ trunk/marvell_owrt_8.09/package/madwifi/patches/330-beaconcal.patch 2009-08-26 18:24:23 UTC (rev 86) @@ -1,6 +1,8 @@ ---- a/ath/if_ath.c -+++ b/ath/if_ath.c -@@ -397,6 +397,7 @@ static int countrycode = -1; +Index: madwifi-trunk-r3314/ath/if_ath.c +=================================================================== +--- madwifi-trunk-r3314.orig/ath/if_ath.c ++++ madwifi-trunk-r3314/ath/if_ath.c +@@ -397,6 +397,7 @@ static int maxvaps = -1; static int outdoor = -1; static int xchanmode = -1; @@ -8,7 +10,7 @@ static const char *hal_status_desc[] = { "No error", -@@ -422,6 +423,7 @@ static struct notifier_block ath_event_b +@@ -422,6 +423,7 @@ }; #if (LINUX_VERSION_CODE < KERNEL_VERSION(2,5,52)) @@ -16,7 +18,7 @@ MODULE_PARM(countrycode, "i"); MODULE_PARM(maxvaps, "i"); MODULE_PARM(outdoor, "i"); -@@ -434,6 +436,7 @@ MODULE_PARM(autocreate, "s"); +@@ -434,6 +436,7 @@ MODULE_PARM(ratectl, "s"); #else #include @@ -24,7 +26,7 @@ module_param(countrycode, int, 0600); module_param(maxvaps, int, 0600); module_param(outdoor, int, 0600); -@@ -2600,7 +2603,8 @@ ath_stop_locked(struct net_device *dev) +@@ -2598,7 +2601,8 @@ } if (!sc->sc_invalid) { del_timer_sync(&sc->sc_dfs_cac_timer); @@ -34,7 +36,7 @@ } ath_draintxq(sc); if (!sc->sc_invalid) { -@@ -2617,6 +2621,20 @@ ath_stop_locked(struct net_device *dev) +@@ -2615,6 +2619,20 @@ return 0; } @@ -55,7 +57,7 @@ /* * Stop the device, grabbing the top-level lock to protect * against concurrent entry through ath_init (which can happen -@@ -2742,6 +2760,12 @@ ath_reset(struct net_device *dev) +@@ -2740,6 +2758,12 @@ HAL_STATUS status; /* @@ -68,7 +70,7 @@ * Convert to a HAL channel description with the flags * constrained to reflect the current operating mode. */ -@@ -5154,6 +5178,8 @@ ath_beacon_send(struct ath_softc *sc, in +@@ -5145,6 +5169,8 @@ "Invoking ath_hal_txstart with sc_bhalq: %d\n", sc->sc_bhalq); ath_hal_txstart(ah, sc->sc_bhalq); @@ -77,7 +79,7 @@ sc->sc_stats.ast_be_xmit++; /* XXX per-VAP? */ } -@@ -5403,6 +5429,7 @@ ath_beacon_config(struct ath_softc *sc, +@@ -5394,6 +5420,7 @@ ath_hal_beacontimers(ah, &bs); sc->sc_imask |= HAL_INT_BMISS; ath_hal_intrset(ah, sc->sc_imask); @@ -85,7 +87,7 @@ } else { ath_hal_intrset(ah, 0); if (reset_tsf) -@@ -5414,8 +5441,11 @@ ath_beacon_config(struct ath_softc *sc, +@@ -5405,8 +5432,11 @@ */ intval |= HAL_BEACON_ENA; sc->sc_imask |= HAL_INT_SWBA; @@ -98,7 +100,7 @@ #ifdef ATH_SUPERG_DYNTURBO ath_beacon_dturbo_config(vap, intval & ~(HAL_BEACON_RESET_TSF | HAL_BEACON_ENA)); -@@ -8879,6 +8909,9 @@ ath_chan_set(struct ath_softc *sc, struc +@@ -8870,6 +8900,9 @@ /* Enter DFS wait period */ mod_timer(&sc->sc_dfs_cac_timer, jiffies + (sc->sc_dfs_cac_period * HZ)); @@ -108,7 +110,7 @@ } /* * re configure beacons when it is a turbo mode switch. -@@ -8988,8 +9021,11 @@ ath_calibrate(unsigned long arg) +@@ -8979,8 +9012,11 @@ sc->sc_curchan.channel, sc->sc_curchan.channelFlags, isIQdone ? "done" : "not done"); @@ -122,7 +124,7 @@ } static void -@@ -9096,7 +9132,8 @@ ath_newstate(struct ieee80211vap *vap, e +@@ -9087,7 +9123,8 @@ ieee80211_state_name[vap->iv_state], ieee80211_state_name[nstate]); @@ -132,7 +134,7 @@ ath_hal_setledstate(ah, leds[nstate]); /* set LED */ netif_stop_queue(dev); /* before we do anything else */ -@@ -9321,7 +9358,8 @@ ath_newstate(struct ieee80211vap *vap, e +@@ -9312,7 +9349,8 @@ "VAP -> DFSWAIT_PENDING \n"); /* start calibration timer with a really small value * 1/10 sec */ @@ -142,7 +144,7 @@ /* wake the receiver */ netif_wake_queue(dev); /* don't do the other usual stuff... */ -@@ -9364,7 +9402,7 @@ done: +@@ -9355,7 +9393,7 @@ error = avp->av_newstate(vap, nstate, arg); /* Finally, start any timers. */ @@ -151,9 +153,11 @@ /* start periodic recalibration timer */ mod_timer(&sc->sc_cal_ch, jiffies + (ath_calinterval * HZ)); } ---- a/ath/if_athvar.h -+++ b/ath/if_athvar.h -@@ -778,6 +778,8 @@ struct ath_softc { +Index: madwifi-trunk-r3314/ath/if_athvar.h +=================================================================== +--- madwifi-trunk-r3314.orig/ath/if_athvar.h ++++ madwifi-trunk-r3314/ath/if_athvar.h +@@ -778,6 +778,8 @@ struct ieee80211vap **sc_bslot; /* beacon xmit slots */ int sc_bnext; /* next slot for beacon xmit */ Modified: trunk/marvell_owrt_8.09/package/madwifi/patches/331-memory_alloc.patch =================================================================== --- trunk/marvell_owrt_8.09/package/madwifi/patches/331-memory_alloc.patch 2009-08-26 17:09:25 UTC (rev 85) +++ trunk/marvell_owrt_8.09/package/madwifi/patches/331-memory_alloc.patch 2009-08-26 18:24:23 UTC (rev 86) @@ -1,6 +1,8 @@ ---- a/ath/if_ath.c -+++ b/ath/if_ath.c -@@ -3320,17 +3320,18 @@ ath_hardstart(struct sk_buff *skb, struc +Index: madwifi-trunk-r3314/ath/if_ath.c +=================================================================== +--- madwifi-trunk-r3314.orig/ath/if_ath.c ++++ madwifi-trunk-r3314/ath/if_ath.c +@@ -3318,17 +3318,18 @@ * without affecting any other bridge ports. */ if (skb_cloned(skb)) { /* Remember the original SKB so we can free up our references */ @@ -25,7 +27,7 @@ eh = (struct ether_header *)skb->data; #ifdef ATH_SUPERG_FF -@@ -3601,6 +3602,8 @@ ath_mgtstart(struct ieee80211com *ic, st +@@ -3599,6 +3600,8 @@ sc->sc_stats.ast_tx_mgmt++; return 0; bad: Modified: trunk/marvell_owrt_8.09/package/madwifi/patches/332-reset_beacons.patch =================================================================== --- trunk/marvell_owrt_8.09/package/madwifi/patches/332-reset_beacons.patch 2009-08-26 17:09:25 UTC (rev 85) +++ trunk/marvell_owrt_8.09/package/madwifi/patches/332-reset_beacons.patch 2009-08-26 18:24:23 UTC (rev 86) @@ -1,6 +1,8 @@ ---- a/ath/if_ath.c -+++ b/ath/if_ath.c -@@ -8920,7 +8920,7 @@ ath_chan_set(struct ath_softc *sc, struc +Index: madwifi-trunk-r3314/ath/if_ath.c +=================================================================== +--- madwifi-trunk-r3314.orig/ath/if_ath.c ++++ madwifi-trunk-r3314/ath/if_ath.c +@@ -8911,7 +8911,7 @@ * re configure beacons when it is a turbo mode switch. * HW seems to turn off beacons during turbo mode switch. */ Modified: trunk/marvell_owrt_8.09/package/madwifi/patches/333-apscan_mode.patch =================================================================== --- trunk/marvell_owrt_8.09/package/madwifi/patches/333-apscan_mode.patch 2009-08-26 17:09:25 UTC (rev 85) +++ trunk/marvell_owrt_8.09/package/madwifi/patches/333-apscan_mode.patch 2009-08-26 18:24:23 UTC (rev 86) @@ -1,6 +1,8 @@ ---- a/net80211/ieee80211_scan_ap.c -+++ b/net80211/ieee80211_scan_ap.c -@@ -783,12 +783,6 @@ pick_channel(struct ieee80211_scan_state +Index: madwifi-trunk-r3314/net80211/ieee80211_scan_ap.c +=================================================================== +--- madwifi-trunk-r3314.orig/net80211/ieee80211_scan_ap.c ++++ madwifi-trunk-r3314/net80211/ieee80211_scan_ap.c +@@ -781,12 +781,6 @@ /* break the loop as the subsequent chans won't be * better */ break; Modified: trunk/marvell_owrt_8.09/package/madwifi/patches/334-input.patch =================================================================== --- trunk/marvell_owrt_8.09/package/madwifi/patches/334-input.patch 2009-08-26 17:09:25 UTC (rev 85) +++ trunk/marvell_owrt_8.09/package/madwifi/patches/334-input.patch 2009-08-26 18:24:23 UTC (rev 86) @@ -1,6 +1,8 @@ ---- a/net80211/ieee80211_input.c -+++ b/net80211/ieee80211_input.c -@@ -950,6 +950,9 @@ ieee80211_input_all(struct ieee80211com +Index: madwifi-trunk-r3314/net80211/ieee80211_input.c +=================================================================== +--- madwifi-trunk-r3314.orig/net80211/ieee80211_input.c ++++ madwifi-trunk-r3314/net80211/ieee80211_input.c +@@ -950,6 +950,9 @@ TAILQ_FOREACH(vap, &ic->ic_vaps, iv_next) { struct sk_buff *skb1; Modified: trunk/marvell_owrt_8.09/package/madwifi/patches/340-maxrate.patch =================================================================== --- trunk/marvell_owrt_8.09/package/madwifi/patches/340-maxrate.patch 2009-08-26 17:09:25 UTC (rev 85) +++ trunk/marvell_owrt_8.09/package/madwifi/patches/340-maxrate.patch 2009-08-26 18:24:23 UTC (rev 86) @@ -1,6 +1,8 @@ ---- a/ath/if_ath.c -+++ b/ath/if_ath.c -@@ -1307,6 +1307,7 @@ ath_vap_create(struct ieee80211com *ic, +Index: madwifi-trunk-r3314/ath/if_ath.c +=================================================================== +--- madwifi-trunk-r3314.orig/ath/if_ath.c ++++ madwifi-trunk-r3314/ath/if_ath.c +@@ -1307,6 +1307,7 @@ vap->iv_key_set = ath_key_set; vap->iv_key_update_begin = ath_key_update_begin; vap->iv_key_update_end = ath_key_update_end; @@ -8,9 +10,11 @@ if (sc->sc_default_ieee80211_debug) { /* User specified defaults for new VAPs were provided, so * use those (only). */ ---- a/ath_rate/minstrel/minstrel.c -+++ b/ath_rate/minstrel/minstrel.c -@@ -622,8 +622,12 @@ ath_rate_ctl_reset(struct ath_softc *sc, +Index: madwifi-trunk-r3314/ath_rate/minstrel/minstrel.c +=================================================================== +--- madwifi-trunk-r3314.orig/ath_rate/minstrel/minstrel.c ++++ madwifi-trunk-r3314/ath_rate/minstrel/minstrel.c +@@ -622,8 +622,12 @@ return; } sn->static_rate_ndx = -1; @@ -24,9 +28,11 @@ for (x = 0; x < ni->ni_rates.rs_nrates; x++) { sn->rs_rateattempts [x] = 0; sn->rs_thisprob [x] = 0; ---- a/ath_rate/sample/sample.c -+++ b/ath_rate/sample/sample.c -@@ -835,7 +835,12 @@ ath_rate_ctl_reset(struct ath_softc *sc, +Index: madwifi-trunk-r3314/ath_rate/sample/sample.c +=================================================================== +--- madwifi-trunk-r3314.orig/ath_rate/sample/sample.c ++++ madwifi-trunk-r3314/ath_rate/sample/sample.c +@@ -835,7 +835,12 @@ } sn->static_rate_ndx = -1; @@ -40,9 +46,11 @@ for (x = 0; x < ni->ni_rates.rs_nrates; x++) { sn->rates[x].rate = ni->ni_rates.rs_rates[x] & IEEE80211_RATE_VAL; sn->rates[x].rix = sc->sc_rixmap[sn->rates[x].rate]; ---- a/net80211/ieee80211_ioctl.h -+++ b/net80211/ieee80211_ioctl.h -@@ -641,6 +641,7 @@ enum { +Index: madwifi-trunk-r3314/net80211/ieee80211_ioctl.h +=================================================================== +--- madwifi-trunk-r3314.orig/net80211/ieee80211_ioctl.h ++++ madwifi-trunk-r3314/net80211/ieee80211_ioctl.h +@@ -641,6 +641,7 @@ FCC requires 30m, so that is the default. */ IEEE80211_PARAM_BEACON_MISS_THRESH = 73, /* Beacon miss threshold (in beacons) */ IEEE80211_PARAM_BEACON_MISS_THRESH_MS = 74, /* Beacon miss threshold (in ms) */ @@ -50,9 +58,11 @@ }; #define SIOCG80211STATS (SIOCDEVPRIVATE+2) ---- a/net80211/ieee80211_var.h -+++ b/net80211/ieee80211_var.h -@@ -281,6 +281,7 @@ struct ieee80211vap { +Index: madwifi-trunk-r3314/net80211/ieee80211_var.h +=================================================================== +--- madwifi-trunk-r3314.orig/net80211/ieee80211_var.h ++++ madwifi-trunk-r3314/net80211/ieee80211_var.h +@@ -281,6 +281,7 @@ struct ieee80211_spy iv_spy; /* IWSPY support */ struct ieee80211_app_ie app_ie[IEEE80211_APPIE_NUM_OF_FRAME]; /* app-specified IEs by frame type */ u_int32_t app_filter; /* filters which management frames are forwarded to app */ @@ -60,9 +70,11 @@ }; /* Debug functions need the defintion of struct ieee80211vap because iv_debug ---- a/net80211/ieee80211_wireless.c -+++ b/net80211/ieee80211_wireless.c -@@ -2839,6 +2839,12 @@ ieee80211_ioctl_setparam(struct net_devi +Index: madwifi-trunk-r3314/net80211/ieee80211_wireless.c +=================================================================== +--- madwifi-trunk-r3314.orig/net80211/ieee80211_wireless.c ++++ madwifi-trunk-r3314/net80211/ieee80211_wireless.c +@@ -2839,6 +2839,12 @@ else ic->ic_flags_ext &= ~IEEE80211_FEXT_MARKDFS; break; @@ -75,7 +87,7 @@ #ifdef ATH_REVERSE_ENGINEERING case IEEE80211_PARAM_DUMPREGS: ieee80211_dump_registers(dev, info, w, extra); -@@ -3174,6 +3180,9 @@ ieee80211_ioctl_getparam(struct net_devi +@@ -3174,6 +3180,9 @@ else param[0] = 0; break; @@ -85,7 +97,7 @@ default: return -EOPNOTSUPP; } -@@ -5610,6 +5619,10 @@ static const struct iw_priv_args ieee802 +@@ -5610,6 +5619,10 @@ 0, IW_PRIV_TYPE_APPIEBUF, "getiebuf" }, { IEEE80211_IOCTL_FILTERFRAME, IW_PRIV_TYPE_FILTER , 0, "setfilter" }, Modified: trunk/marvell_owrt_8.09/package/madwifi/patches/341-minrate.patch =================================================================== --- trunk/marvell_owrt_8.09/package/madwifi/patches/341-minrate.patch 2009-08-26 17:09:25 UTC (rev 85) +++ trunk/marvell_owrt_8.09/package/madwifi/patches/341-minrate.patch 2009-08-26 18:24:23 UTC (rev 86) @@ -1,6 +1,8 @@ ---- a/ath/if_ath.c -+++ b/ath/if_ath.c -@@ -1308,6 +1308,7 @@ ath_vap_create(struct ieee80211com *ic, +Index: madwifi-trunk-r3314/ath/if_ath.c +=================================================================== +--- madwifi-trunk-r3314.orig/ath/if_ath.c ++++ madwifi-trunk-r3314/ath/if_ath.c +@@ -1308,6 +1308,7 @@ vap->iv_key_update_begin = ath_key_update_begin; vap->iv_key_update_end = ath_key_update_end; vap->iv_maxrateindex = 0; @@ -8,9 +10,11 @@ if (sc->sc_default_ieee80211_debug) { /* User specified defaults for new VAPs were provided, so * use those (only). */ ---- a/ath_rate/minstrel/minstrel.c -+++ b/ath_rate/minstrel/minstrel.c -@@ -638,9 +638,15 @@ ath_rate_ctl_reset(struct ath_softc *sc, +Index: madwifi-trunk-r3314/ath_rate/minstrel/minstrel.c +=================================================================== +--- madwifi-trunk-r3314.orig/ath_rate/minstrel/minstrel.c ++++ madwifi-trunk-r3314/ath_rate/minstrel/minstrel.c +@@ -638,9 +638,15 @@ sn->rs_succ_hist [x] = 0; sn->rs_att_hist [x] = 0; sn->rs_this_tp [x] = 0; @@ -27,7 +31,7 @@ if (sn->rates[x].rix == 0xff) { DPRINTF(sc, "%s: %s ignore bogus rix at %d\n", dev_info, __func__, x); -@@ -649,7 +655,7 @@ ath_rate_ctl_reset(struct ath_softc *sc, +@@ -649,7 +655,7 @@ sn->rates[x].rateCode = rt->info[sn->rates[x].rix].rateCode; sn->rates[x].shortPreambleRateCode = rt->info[sn->rates[x].rix].rateCode | @@ -36,9 +40,11 @@ } ath_fill_sample_table(sn); ---- a/ath_rate/sample/sample.c -+++ b/ath_rate/sample/sample.c -@@ -842,8 +842,15 @@ ath_rate_ctl_reset(struct ath_softc *sc, +Index: madwifi-trunk-r3314/ath_rate/sample/sample.c +=================================================================== +--- madwifi-trunk-r3314.orig/ath_rate/sample/sample.c ++++ madwifi-trunk-r3314/ath_rate/sample/sample.c +@@ -842,8 +842,15 @@ sn->num_rates = vap->iv_maxrateindex; for (x = 0; x < ni->ni_rates.rs_nrates; x++) { @@ -56,9 +62,11 @@ if (sn->rates[x].rix == 0xff) { DPRINTF(sc, ATH_DEBUG_RATE, "%s: %s ignore bogus rix at %u\n", dev_info, __func__, x); ---- a/net80211/ieee80211_ioctl.h -+++ b/net80211/ieee80211_ioctl.h -@@ -642,6 +642,7 @@ enum { +Index: madwifi-trunk-r3314/net80211/ieee80211_ioctl.h +=================================================================== +--- madwifi-trunk-r3314.orig/net80211/ieee80211_ioctl.h ++++ madwifi-trunk-r3314/net80211/ieee80211_ioctl.h +@@ -642,6 +642,7 @@ IEEE80211_PARAM_BEACON_MISS_THRESH = 73, /* Beacon miss threshold (in beacons) */ IEEE80211_PARAM_BEACON_MISS_THRESH_MS = 74, /* Beacon miss threshold (in ms) */ IEEE80211_PARAM_MAXRATE = 75, /* Maximum rate (by table index) */ @@ -66,9 +74,11 @@ }; #define SIOCG80211STATS (SIOCDEVPRIVATE+2) ---- a/net80211/ieee80211_var.h -+++ b/net80211/ieee80211_var.h -@@ -282,6 +282,7 @@ struct ieee80211vap { +Index: madwifi-trunk-r3314/net80211/ieee80211_var.h +=================================================================== +--- madwifi-trunk-r3314.orig/net80211/ieee80211_var.h ++++ madwifi-trunk-r3314/net80211/ieee80211_var.h +@@ -282,6 +282,7 @@ struct ieee80211_app_ie app_ie[IEEE80211_APPIE_NUM_OF_FRAME]; /* app-specified IEs by frame type */ u_int32_t app_filter; /* filters which management frames are forwarded to app */ int iv_maxrateindex; @@ -76,9 +86,11 @@ }; /* Debug functions need the defintion of struct ieee80211vap because iv_debug ---- a/net80211/ieee80211_wireless.c -+++ b/net80211/ieee80211_wireless.c -@@ -2845,6 +2845,12 @@ ieee80211_ioctl_setparam(struct net_devi +Index: madwifi-trunk-r3314/net80211/ieee80211_wireless.c +=================================================================== +--- madwifi-trunk-r3314.orig/net80211/ieee80211_wireless.c ++++ madwifi-trunk-r3314/net80211/ieee80211_wireless.c +@@ -2845,6 +2845,12 @@ else vap->iv_maxrateindex = 0; break; @@ -91,7 +103,7 @@ #ifdef ATH_REVERSE_ENGINEERING case IEEE80211_PARAM_DUMPREGS: ieee80211_dump_registers(dev, info, w, extra); -@@ -3183,6 +3189,9 @@ ieee80211_ioctl_getparam(struct net_devi +@@ -3183,6 +3189,9 @@ case IEEE80211_PARAM_MAXRATE: param[0] = vap->iv_maxrateindex; break; @@ -101,7 +113,7 @@ default: return -EOPNOTSUPP; } -@@ -5623,6 +5632,10 @@ static const struct iw_priv_args ieee802 +@@ -5623,6 +5632,10 @@ IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, 0, "maxrate"}, {IEEE80211_PARAM_MAXRATE, 0, IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, "get_maxrate"}, Modified: trunk/marvell_owrt_8.09/package/madwifi/patches/342-performance.patch =================================================================== --- trunk/marvell_owrt_8.09/package/madwifi/patches/342-performance.patch 2009-08-26 17:09:25 UTC (rev 85) +++ trunk/marvell_owrt_8.09/package/madwifi/patches/342-performance.patch 2009-08-26 18:24:23 UTC (rev 86) @@ -1,6 +1,8 @@ ---- a/ath/if_ath.c -+++ b/ath/if_ath.c -@@ -3239,7 +3239,6 @@ ath_hardstart(struct sk_buff *skb, struc +Index: madwifi-trunk-r3314/ath/if_ath.c +=================================================================== +--- madwifi-trunk-r3314.orig/ath/if_ath.c ++++ madwifi-trunk-r3314/ath/if_ath.c +@@ -3237,7 +3237,6 @@ struct ath_softc *sc = dev->priv; struct ieee80211_node *ni = NULL; struct ath_buf *bf = NULL; @@ -8,7 +10,7 @@ ath_bufhead bf_head; struct ath_buf *tbf, *tempbf; struct sk_buff *tskb; -@@ -3251,6 +3250,7 @@ ath_hardstart(struct sk_buff *skb, struc +@@ -3249,6 +3248,7 @@ */ int requeue = 0; #ifdef ATH_SUPERG_FF @@ -16,7 +18,7 @@ unsigned int pktlen; struct ieee80211com *ic = &sc->sc_ic; struct ath_node *an; -@@ -3316,27 +3316,9 @@ ath_hardstart(struct sk_buff *skb, struc +@@ -3314,27 +3314,9 @@ requeue = 1; goto hardstart_fail; } @@ -44,9 +46,11 @@ /* NB: use this lock to protect an->an_tx_ffbuf (and txq->axq_stageq) * in athff_can_aggregate() call too. */ ATH_TXQ_LOCK_IRQ(txq); ---- a/net80211/ieee80211_output.c -+++ b/net80211/ieee80211_output.c -@@ -283,7 +283,7 @@ ieee80211_hardstart(struct sk_buff *skb, +Index: madwifi-trunk-r3314/net80211/ieee80211_output.c +=================================================================== +--- madwifi-trunk-r3314.orig/net80211/ieee80211_output.c ++++ madwifi-trunk-r3314/net80211/ieee80211_output.c +@@ -283,7 +283,7 @@ * normal vap. */ if (vap->iv_xrvap && (ni == vap->iv_bss) && vap->iv_xrvap->iv_sta_assoc) { @@ -55,7 +59,7 @@ if (skb1) { memset(SKB_CB(skb1), 0, sizeof(struct ieee80211_cb)); #ifdef IEEE80211_DEBUG_REFCNT -@@ -566,7 +566,7 @@ ieee80211_skbhdr_adjust(struct ieee80211 +@@ -566,7 +566,7 @@ struct ieee80211_key *key, struct sk_buff *skb, int ismulticast) { /* XXX pre-calculate per node? */ @@ -64,7 +68,7 @@ int need_tailroom = 0; #ifdef ATH_SUPERG_FF int isff = ATH_FF_MAGIC_PRESENT(skb); -@@ -608,109 +608,56 @@ ieee80211_skbhdr_adjust(struct ieee80211 +@@ -608,109 +608,56 @@ need_tailroom += cip->ic_miclen; } @@ -212,9 +216,11 @@ } #define KEY_UNDEFINED(k) ((k).wk_cipher == &ieee80211_cipher_none) ---- a/net80211/ieee80211_input.c -+++ b/net80211/ieee80211_input.c -@@ -204,7 +204,6 @@ ieee80211_input(struct ieee80211vap * va +Index: madwifi-trunk-r3314/net80211/ieee80211_input.c +=================================================================== +--- madwifi-trunk-r3314.orig/net80211/ieee80211_input.c ++++ madwifi-trunk-r3314/net80211/ieee80211_input.c +@@ -204,7 +204,6 @@ struct ieee80211_frame *wh; struct ieee80211_key *key; struct ether_header *eh; @@ -222,7 +228,7 @@ #ifdef ATH_SUPERG_FF struct llc *llc; #endif -@@ -244,20 +243,6 @@ ieee80211_input(struct ieee80211vap * va +@@ -244,20 +243,6 @@ vap->iv_stats.is_rx_tooshort++; goto out; } @@ -243,7 +249,7 @@ /* * Bit of a cheat here, we use a pointer for a 3-address -@@ -738,7 +723,7 @@ ieee80211_input(struct ieee80211vap * va +@@ -738,7 +723,7 @@ /* ether_type must be length as FF frames are always LLC/SNAP encap'd */ frame_len = ntohs(eh_tmp->ether_type); @@ -252,7 +258,7 @@ if (skb1 == NULL) goto err; ieee80211_skb_copy_noderef(skb, skb1); -@@ -1137,7 +1122,7 @@ ieee80211_deliver_data(struct ieee80211_ +@@ -1137,7 +1122,7 @@ if (ETHER_IS_MULTICAST(eh->ether_dhost) && !netif_queue_stopped(dev)) { /* Create a SKB for the BSS to send out. */ Modified: trunk/marvell_owrt_8.09/package/madwifi/patches/343-txqueue_races.patch =================================================================== --- trunk/marvell_owrt_8.09/package/madwifi/patches/343-txqueue_races.patch 2009-08-26 17:09:25 UTC (rev 85) +++ trunk/marvell_owrt_8.09/package/madwifi/patches/343-txqueue_races.patch 2009-08-26 18:24:23 UTC (rev 86) @@ -1,8 +1,10 @@ Merged from madwifi trunk r3551, r3552 ---- a/ath/if_ath.c -+++ b/ath/if_ath.c -@@ -8251,6 +8251,17 @@ ath_tx_processq(struct ath_softc *sc, st +Index: madwifi-trunk-r3314/ath/if_ath.c +=================================================================== +--- madwifi-trunk-r3314.orig/ath/if_ath.c ++++ madwifi-trunk-r3314/ath/if_ath.c +@@ -8244,6 +8244,17 @@ goto bf_fail; } @@ -20,9 +22,11 @@ ATH_TXQ_REMOVE_HEAD(txq, bf_list); ATH_TXQ_UNLOCK_IRQ(txq); ---- a/ath/if_athvar.h -+++ b/ath/if_athvar.h -@@ -586,7 +586,8 @@ struct ath_vap { +Index: madwifi-trunk-r3314/ath/if_athvar.h +=================================================================== +--- madwifi-trunk-r3314.orig/ath/if_athvar.h ++++ madwifi-trunk-r3314/ath/if_athvar.h +@@ -586,7 +586,8 @@ } while (0) #define ATH_TXQ_REMOVE_HEAD(_tq, _field) do { \ STAILQ_REMOVE_HEAD(&(_tq)->axq_q, _field); \ Modified: trunk/marvell_owrt_8.09/package/madwifi/patches/344-minstrel_failcnt.patch =================================================================== --- trunk/marvell_owrt_8.09/package/madwifi/patches/344-minstrel_failcnt.patch 2009-08-26 17:09:25 UTC (rev 85) +++ trunk/marvell_owrt_8.09/package/madwifi/patches/344-minstrel_failcnt.patch 2009-08-26 18:24:23 UTC (rev 86) @@ -1,6 +1,8 @@ ---- a/ath_rate/minstrel/minstrel.c -+++ b/ath_rate/minstrel/minstrel.c -@@ -475,7 +475,7 @@ ath_rate_tx_complete(struct ath_softc *s +Index: madwifi-trunk-r3314/ath_rate/minstrel/minstrel.c +=================================================================== +--- madwifi-trunk-r3314.orig/ath_rate/minstrel/minstrel.c ++++ madwifi-trunk-r3314/ath_rate/minstrel/minstrel.c +@@ -475,7 +475,7 @@ /* 'tries' is the total number of times we have endeavoured to * send this packet, and is a sum of the #attempts at each * level in the multi-rate retry chain */ Modified: trunk/marvell_owrt_8.09/package/madwifi/patches/345-minstrel_sampling.patch =================================================================== --- trunk/marvell_owrt_8.09/package/madwifi/patches/345-minstrel_sampling.patch 2009-08-26 17:09:25 UTC (rev 85) +++ trunk/marvell_owrt_8.09/package/madwifi/patches/345-minstrel_sampling.patch 2009-08-26 18:24:23 UTC (rev 86) @@ -1,6 +1,8 @@ ---- a/ath/if_ath.c -+++ b/ath/if_ath.c -@@ -8101,6 +8101,7 @@ ath_tx_start(struct net_device *dev, str +Index: madwifi-trunk-r3314/ath/if_ath.c +=================================================================== +--- madwifi-trunk-r3314.orig/ath/if_ath.c ++++ madwifi-trunk-r3314/ath/if_ath.c +@@ -8094,6 +8094,7 @@ ath_hal_setupxtxdesc(sc->sc_ah, ds, mrr.rate1, mrr.retries1, mrr.rate2, mrr.retries2, mrr.rate3, mrr.retries3); @@ -8,9 +10,11 @@ } #ifndef ATH_SUPERG_FF ---- a/ath/if_athvar.h -+++ b/ath/if_athvar.h -@@ -446,6 +446,7 @@ struct ath_buf { +Index: madwifi-trunk-r3314/ath/if_athvar.h +=================================================================== +--- madwifi-trunk-r3314.orig/ath/if_athvar.h ++++ madwifi-trunk-r3314/ath/if_athvar.h +@@ -446,6 +446,7 @@ u_int16_t bf_flags; /* tx descriptor flags */ u_int64_t bf_tsf; int16_t bf_channoise; @@ -18,9 +22,11 @@ #ifdef ATH_SUPERG_FF /* XXX: combine this with bf_skbaddr if it ever changes to accommodate * multiple segments. ---- a/ath_rate/minstrel/minstrel.c -+++ b/ath_rate/minstrel/minstrel.c -@@ -333,15 +333,19 @@ ath_rate_findrate(struct ath_softc *sc, +Index: madwifi-trunk-r3314/ath_rate/minstrel/minstrel.c +=================================================================== +--- madwifi-trunk-r3314.orig/ath_rate/minstrel/minstrel.c ++++ madwifi-trunk-r3314/ath_rate/minstrel/minstrel.c +@@ -333,15 +333,19 @@ if (sn->static_rate_ndx >= 0) { ndx = sn->static_rate_ndx; } else { @@ -41,7 +47,7 @@ } /* Don't look for slowest rate (i.e. slowest -@@ -398,11 +402,14 @@ ath_rate_get_mrr(struct ath_softc *sc, s +@@ -398,11 +402,14 @@ if (sn->num_rates <= 0) return; @@ -58,7 +64,7 @@ rc1 = sn->max_tp_rate; } else { rc1 = sn->max_tp_rate2; -@@ -525,6 +532,9 @@ ath_rate_tx_complete(struct ath_softc *s +@@ -525,6 +532,9 @@ if (tries <= tries1) return; @@ -68,9 +74,11 @@ if (tries2 < 0) return; tries = tries - tries1; ---- a/net80211/ieee80211_rate.h -+++ b/net80211/ieee80211_rate.h -@@ -87,6 +87,7 @@ struct ieee80211_mrr { +Index: madwifi-trunk-r3314/net80211/ieee80211_rate.h +=================================================================== +--- madwifi-trunk-r3314.orig/net80211/ieee80211_rate.h ++++ madwifi-trunk-r3314/net80211/ieee80211_rate.h +@@ -87,6 +87,7 @@ int retries2; int rate3; int retries3; Modified: trunk/marvell_owrt_8.09/package/madwifi/patches/346-protmode_trig.patch =================================================================== --- trunk/marvell_owrt_8.09/package/madwifi/patches/346-protmode_trig.patch 2009-08-26 17:09:25 UTC (rev 85) +++ trunk/marvell_owrt_8.09/package/madwifi/patches/346-protmode_trig.patch 2009-08-26 18:24:23 UTC (rev 86) @@ -1,6 +1,8 @@ ---- a/net80211/ieee80211.c -+++ b/net80211/ieee80211.c -@@ -333,7 +333,9 @@ ieee80211_ifattach(struct ieee80211com * +Index: madwifi-trunk-r3314/net80211/ieee80211.c +=================================================================== +--- madwifi-trunk-r3314.orig/net80211/ieee80211.c ++++ madwifi-trunk-r3314/net80211/ieee80211.c +@@ -333,7 +333,9 @@ IEEE80211_MS_TO_TU(IEEE80211_BMISSTHRESH_DEFAULT_MS), ic->ic_lintval), ic->ic_lintval); } @@ -11,9 +13,11 @@ IEEE80211_LOCK_INIT(ic, "ieee80211com"); IEEE80211_VAPS_LOCK_INIT(ic, "ieee80211com_vaps"); TAILQ_INIT(&ic->ic_vaps); ---- a/net80211/ieee80211_input.c -+++ b/net80211/ieee80211_input.c -@@ -3411,14 +3411,18 @@ ieee80211_recv_mgmt(struct ieee80211vap +Index: madwifi-trunk-r3314/net80211/ieee80211_input.c +=================================================================== +--- madwifi-trunk-r3314.orig/net80211/ieee80211_input.c ++++ madwifi-trunk-r3314/net80211/ieee80211_input.c +@@ -3411,14 +3411,18 @@ IEEE80211_IS_CHAN_ANYG(ic->ic_curchan)) { /* Assume no ERP IE == 11b AP */ @@ -37,9 +41,11 @@ } } ---- a/net80211/ieee80211_ioctl.h -+++ b/net80211/ieee80211_ioctl.h -@@ -643,6 +643,8 @@ enum { +Index: madwifi-trunk-r3314/net80211/ieee80211_ioctl.h +=================================================================== +--- madwifi-trunk-r3314.orig/net80211/ieee80211_ioctl.h ++++ madwifi-trunk-r3314/net80211/ieee80211_ioctl.h +@@ -643,6 +643,8 @@ IEEE80211_PARAM_BEACON_MISS_THRESH_MS = 74, /* Beacon miss threshold (in ms) */ IEEE80211_PARAM_MAXRATE = 75, /* Maximum rate (by table index) */ IEEE80211_PARAM_MINRATE = 76, /* Maximum rate (by table index) */ @@ -48,8 +54,10 @@ }; #define SIOCG80211STATS (SIOCDEVPRIVATE+2) ---- a/net80211/ieee80211_var.h -+++ b/net80211/ieee80211_var.h +Index: madwifi-trunk-r3314/net80211/ieee80211_var.h +=================================================================== +--- madwifi-trunk-r3314.orig/net80211/ieee80211_var.h ++++ madwifi-trunk-r3314/net80211/ieee80211_var.h @@ -128,6 +128,9 @@ #define IEEE80211_APPIE_MAX 1024 @@ -60,7 +68,7 @@ #define IEEE80211_PWRCONSTRAINT_VAL(ic) \ (((ic)->ic_bsschan->ic_maxregpower > (ic)->ic_curchanmaxpwr) ? \ (ic)->ic_bsschan->ic_maxregpower - (ic)->ic_curchanmaxpwr : 0) -@@ -324,6 +327,9 @@ struct ieee80211com { +@@ -324,6 +327,9 @@ u_int16_t ic_newtxpowlimit; /* tx power limit to change to (in 0.5 dBm) */ u_int16_t ic_uapsdmaxtriggers; /* max triggers that could arrive */ u_int8_t ic_coverageclass; /* coverage class */ @@ -70,9 +78,11 @@ /* Channel state: * ---- a/net80211/ieee80211_wireless.c -+++ b/net80211/ieee80211_wireless.c -@@ -2312,6 +2312,12 @@ ieee80211_ioctl_setparam(struct net_devi +Index: madwifi-trunk-r3314/net80211/ieee80211_wireless.c +=================================================================== +--- madwifi-trunk-r3314.orig/net80211/ieee80211_wireless.c ++++ madwifi-trunk-r3314/net80211/ieee80211_wireless.c +@@ -2312,6 +2312,12 @@ IEEE80211_IS_CHAN_ANYG(ic->ic_bsschan)) retv = ENETRESET; break; @@ -85,7 +95,7 @@ case IEEE80211_PARAM_MCASTCIPHER: if ((vap->iv_caps & cipher2cap(value)) == 0 && !ieee80211_crypto_available(vap, value)) -@@ -2955,6 +2961,12 @@ ieee80211_ioctl_getparam(struct net_devi +@@ -2955,6 +2961,12 @@ case IEEE80211_PARAM_PROTMODE: param[0] = ic->ic_protmode; break; @@ -98,7 +108,7 @@ case IEEE80211_PARAM_MCASTCIPHER: param[0] = rsn->rsn_mcastcipher; break; -@@ -5346,6 +5358,14 @@ static const struct iw_priv_args ieee802 +@@ -5346,6 +5358,14 @@ IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, 0, "protmode" }, { IEEE80211_PARAM_PROTMODE, 0, IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, "get_protmode" }, @@ -113,9 +123,11 @@ { IEEE80211_PARAM_MCASTCIPHER, IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, 0, "mcastcipher" }, { IEEE80211_PARAM_MCASTCIPHER, ---- a/net80211/ieee80211_node.c -+++ b/net80211/ieee80211_node.c -@@ -1877,6 +1877,17 @@ ieee80211_node_timeout(unsigned long arg +Index: madwifi-trunk-r3314/net80211/ieee80211_node.c +=================================================================== +--- madwifi-trunk-r3314.orig/net80211/ieee80211_node.c ++++ madwifi-trunk-r3314/net80211/ieee80211_node.c +@@ -1877,6 +1877,17 @@ ieee80211_scan_timeout(ic); ieee80211_timeout_stations(&ic->ic_sta); Modified: trunk/marvell_owrt_8.09/package/madwifi/patches/347-tuning.patch =================================================================== --- trunk/marvell_owrt_8.09/package/madwifi/patches/347-tuning.patch 2009-08-26 17:09:25 UTC (rev 85) +++ trunk/marvell_owrt_8.09/package/madwifi/patches/347-tuning.patch 2009-08-26 18:24:23 UTC (rev 86) @@ -1,6 +1,8 @@ ---- a/ath/if_ath.c -+++ b/ath/if_ath.c -@@ -10274,11 +10274,11 @@ ath_setcurmode(struct ath_softc *sc, enu +Index: madwifi-trunk-r3314/ath/if_ath.c +=================================================================== +--- madwifi-trunk-r3314.orig/ath/if_ath.c ++++ madwifi-trunk-r3314/ath/if_ath.c +@@ -10265,11 +10265,11 @@ sc->sc_currates = rt; sc->sc_curmode = mode; /* @@ -15,9 +17,11 @@ /* rate index used to send mgt frames */ sc->sc_minrateix = 0; } ---- a/ath/if_athvar.h -+++ b/ath/if_athvar.h -@@ -272,6 +272,10 @@ static inline struct net_device *_alloc_ +Index: madwifi-trunk-r3314/ath/if_athvar.h +=================================================================== +--- madwifi-trunk-r3314.orig/ath/if_athvar.h ++++ madwifi-trunk-r3314/ath/if_athvar.h +@@ -272,6 +272,10 @@ #define AES_ICV_FIELD_SIZE 8 /* AES ICV field size */ #define EXT_IV_FIELD_SIZE 4 /* ext IV field size */ @@ -28,9 +32,11 @@ /* XR specific macros */ #define XR_DEFAULT_GRPPOLL_RATE_STR "0.25 1 1 3 3 6 6 20" ---- a/ath_rate/minstrel/minstrel.c -+++ b/ath_rate/minstrel/minstrel.c -@@ -197,7 +197,7 @@ calc_usecs_unicast_packet(struct ath_sof +Index: madwifi-trunk-r3314/ath_rate/minstrel/minstrel.c +=================================================================== +--- madwifi-trunk-r3314.orig/ath_rate/minstrel/minstrel.c ++++ madwifi-trunk-r3314/ath_rate/minstrel/minstrel.c +@@ -197,7 +197,7 @@ unsigned int x = 0, tt = 0; unsigned int cix = rt->info[rix].controlRate; int rts = 0, cts = 0; @@ -39,7 +45,7 @@ KASSERT(rt != NULL, ("no rate table, mode %u", sc->sc_curmode)); -@@ -281,7 +281,7 @@ calc_usecs_unicast_packet(struct ath_sof +@@ -281,7 +281,7 @@ tt += (long_retries + 1) * ath_hal_computetxtime(sc->sc_ah, rt, length, rix, AH_TRUE); for (x = 0; x <= short_retries + long_retries; x++) { @@ -48,9 +54,11 @@ tt += (t_slot * cw / 2); } return tt; ---- a/ath_rate/minstrel/minstrel.h -+++ b/ath_rate/minstrel/minstrel.h -@@ -180,14 +180,6 @@ struct minstrel_node { +Index: madwifi-trunk-r3314/ath_rate/minstrel/minstrel.h +=================================================================== +--- madwifi-trunk-r3314.orig/ath_rate/minstrel/minstrel.h ++++ madwifi-trunk-r3314/ath_rate/minstrel/minstrel.h +@@ -180,14 +180,6 @@ #define MAX(a,b) ((a) > (b) ? (a) : (b)) #endif @@ -65,9 +73,11 @@ /* * Definitions for pulling the rate and trie counts from * a 5212 h/w descriptor. These Don't belong here; the ---- a/ath_rate/sample/sample.c -+++ b/ath_rate/sample/sample.c -@@ -170,7 +170,7 @@ calc_usecs_unicast_packet(struct ath_sof +Index: madwifi-trunk-r3314/ath_rate/sample/sample.c +=================================================================== +--- madwifi-trunk-r3314.orig/ath_rate/sample/sample.c ++++ madwifi-trunk-r3314/ath_rate/sample/sample.c +@@ -170,7 +170,7 @@ struct ieee80211com *ic = &sc->sc_ic; unsigned int tt = 0; unsigned int x; @@ -76,7 +86,7 @@ unsigned int cix = rt->info[rix].controlRate; KASSERT(rt != NULL, ("no rate table, mode %u", sc->sc_curmode)); -@@ -254,7 +254,7 @@ calc_usecs_unicast_packet(struct ath_sof +@@ -254,7 +254,7 @@ tt += (long_retries+1)*ath_hal_computetxtime(sc->sc_ah, rt, length, rix, AH_TRUE); for (x = 0; x <= short_retries + long_retries; x++) { @@ -85,9 +95,11 @@ tt += (t_slot * cw / 2); } return tt; ---- a/ath_rate/sample/sample.h -+++ b/ath_rate/sample/sample.h -@@ -106,9 +106,6 @@ struct sample_node { +Index: madwifi-trunk-r3314/ath_rate/sample/sample.h +=================================================================== +--- madwifi-trunk-r3314.orig/ath_rate/sample/sample.h ++++ madwifi-trunk-r3314/ath_rate/sample/sample.h +@@ -106,9 +106,6 @@ #define MAX(a,b) ((a) > (b) ? (a) : (b)) #endif Modified: trunk/marvell_owrt_8.09/package/madwifi/patches/348-ackcts.patch =================================================================== --- trunk/marvell_owrt_8.09/package/madwifi/patches/348-ackcts.patch 2009-08-26 17:09:25 UTC (rev 85) +++ trunk/marvell_owrt_8.09/package/madwifi/patches/348-ackcts.patch 2009-08-26 18:24:23 UTC (rev 86) @@ -1,6 +1,8 @@ ---- a/ath/if_ath.c -+++ b/ath/if_ath.c -@@ -2723,6 +2723,9 @@ ar_device(int devid) +Index: madwifi-trunk-r3314/ath/if_ath.c +=================================================================== +--- madwifi-trunk-r3314.orig/ath/if_ath.c ++++ madwifi-trunk-r3314/ath/if_ath.c +@@ -2721,6 +2721,9 @@ static int ath_set_ack_bitrate(struct ath_softc *sc, int high) { @@ -10,7 +12,7 @@ if (ar_device(sc->devid) == 5212 || ar_device(sc->devid) == 5213) { /* set ack to be sent at low bit-rate */ /* registers taken from the OpenBSD 5212 HAL */ -@@ -10789,8 +10792,13 @@ ATH_SYSCTL_DECL(ath_sysctl_halparam, ctl +@@ -10780,8 +10783,13 @@ break; #endif case ATH_ACKRATE: @@ -26,9 +28,11 @@ break; case ATH_RP: ath_rp_record(sc, ---- a/ath/if_athvar.h -+++ b/ath/if_athvar.h -@@ -681,6 +681,7 @@ struct ath_softc { +Index: madwifi-trunk-r3314/ath/if_athvar.h +=================================================================== +--- madwifi-trunk-r3314.orig/ath/if_athvar.h ++++ madwifi-trunk-r3314/ath/if_athvar.h +@@ -681,6 +681,7 @@ unsigned int sc_devstopped:1; /* stopped due to of no tx bufs */ unsigned int sc_stagbeacons:1; /* use staggered beacons */ unsigned int sc_dfswait:1; /* waiting on channel for radar detect */ Modified: trunk/marvell_owrt_8.09/package/madwifi/patches/349-reset.patch =================================================================== --- trunk/marvell_owrt_8.09/package/madwifi/patches/349-reset.patch 2009-08-26 17:09:25 UTC (rev 85) +++ trunk/marvell_owrt_8.09/package/madwifi/patches/349-reset.patch 2009-08-26 18:24:23 UTC (rev 86) @@ -1,6 +1,17 @@ ---- a/ath/if_ath.c -+++ b/ath/if_ath.c -@@ -8862,8 +8862,7 @@ ath_chan_set(struct ath_softc *sc, struc +Index: madwifi-trunk-r3314/ath/if_ath.c +=================================================================== +--- madwifi-trunk-r3314.orig/ath/if_ath.c ++++ madwifi-trunk-r3314/ath/if_ath.c +@@ -2479,7 +2479,7 @@ + */ + sc->sc_curchan.channel = ic->ic_curchan->ic_freq; + sc->sc_curchan.channelFlags = ath_chan2flags(ic->ic_curchan); +- if (!ath_hal_reset(ah, sc->sc_opmode, &sc->sc_curchan, AH_FALSE, &status)) { ++ if (!ath_hal_reset(ah, sc->sc_opmode, &sc->sc_curchan, AH_TRUE, &status)) { + EPRINTF(sc, "unable to reset hardware: '%s' (HAL status %u) " + "(freq %u flags 0x%x)\n", + ath_get_hal_status_desc(status), status, +@@ -8853,8 +8853,7 @@ * needed to do the reset with chanchange = AH_FALSE in order * to receive traffic when peforming high velocity channel * changes. */ Modified: trunk/marvell_owrt_8.09/package/madwifi/patches/350-wisoc_softled.patch =================================================================== --- trunk/marvell_owrt_8.09/package/madwifi/patches/350-wisoc_softled.patch 2009-08-26 17:09:25 UTC (rev 85) +++ trunk/marvell_owrt_8.09/package/madwifi/patches/350-wisoc_softled.patch 2009-08-26 18:24:23 UTC (rev 86) @@ -1,6 +1,8 @@ ---- a/ath/if_ath_ahb.c -+++ b/ath/if_ath_ahb.c -@@ -245,6 +245,8 @@ init_ath_wmac(u_int16_t devid, u_int16_t +Index: madwifi-trunk-r3314/ath/if_ath_ahb.c +=================================================================== +--- madwifi-trunk-r3314.orig/ath/if_ath_ahb.c ++++ madwifi-trunk-r3314/ath/if_ath_ahb.c +@@ -245,6 +245,8 @@ num_activesc++; /* Ready to process interrupts */ Modified: trunk/marvell_owrt_8.09/package/madwifi/patches/351-scanlist.patch =================================================================== --- trunk/marvell_owrt_8.09/package/madwifi/patches/351-scanlist.patch 2009-08-26 17:09:25 UTC (rev 85) +++ trunk/marvell_owrt_8.09/package/madwifi/patches/351-scanlist.patch 2009-08-26 18:24:23 UTC (rev 86) @@ -1,6 +1,8 @@ ---- a/net80211/ieee80211_scan_sta.c -+++ b/net80211/ieee80211_scan_sta.c -@@ -317,147 +317,6 @@ found: +Index: madwifi-trunk-r3314/net80211/ieee80211_scan_sta.c +=================================================================== +--- madwifi-trunk-r3314.orig/net80211/ieee80211_scan_sta.c 2008-06-01 04:46:05.000000000 +0200 ++++ madwifi-trunk-r3314/net80211/ieee80211_scan_sta.c 2008-06-01 04:46:33.000000000 +0200 +@@ -317,147 +317,6 @@ #undef ISPROBE } @@ -148,7 +150,7 @@ /* * Start a station-mode scan by populating the channel list. */ -@@ -466,81 +325,14 @@ sta_start(struct ieee80211_scan_state *s +@@ -466,81 +325,14 @@ { struct ieee80211com *ic = vap->iv_ic; struct sta_table *st = ss->ss_priv; @@ -232,7 +234,7 @@ /* XXX tunables */ /* * The scanner will stay on station for ss_maxdwell ms (using a -@@ -749,17 +541,7 @@ match_bss(struct ieee80211vap *vap, +@@ -749,17 +541,7 @@ fail = 0; if (isclr(ic->ic_chan_active, ieee80211_chan2ieee(ic, se->se_chan))) fail |= 0x01; @@ -251,7 +253,7 @@ if (vap->iv_opmode == IEEE80211_M_IBSS) { if ((se->se_capinfo & IEEE80211_CAPINFO_IBSS) == 0) fail |= 0x02; -@@ -1168,78 +950,6 @@ static const struct ieee80211_scanner st +@@ -1168,78 +950,6 @@ .scan_default = ieee80211_sta_join, }; @@ -330,7 +332,7 @@ /* * Select a channel to start an adhoc network on. -@@ -1405,7 +1115,7 @@ static const struct ieee80211_scanner ad +@@ -1405,7 +1115,7 @@ .scan_name = "default", .scan_attach = sta_attach, .scan_detach = sta_detach, @@ -339,9 +341,11 @@ .scan_restart = sta_restart, .scan_cancel = sta_cancel, .scan_end = adhoc_pick_bss, ---- a/net80211/ieee80211.c -+++ b/net80211/ieee80211.c -@@ -278,6 +278,11 @@ ieee80211_ifattach(struct ieee80211com * +Index: madwifi-trunk-r3314/net80211/ieee80211.c +=================================================================== +--- madwifi-trunk-r3314.orig/net80211/ieee80211.c 2008-06-01 04:46:30.000000000 +0200 ++++ madwifi-trunk-r3314/net80211/ieee80211.c 2008-06-01 04:46:33.000000000 +0200 +@@ -278,6 +278,11 @@ ("channel with bogus ieee number %u", c->ic_ieee)); setbit(ic->ic_chan_avail, c->ic_ieee); @@ -353,9 +357,11 @@ /* Identify mode capabilities. */ if (IEEE80211_IS_CHAN_A(c)) ic->ic_modecaps |= 1 << IEEE80211_MODE_11A; ---- a/net80211/_ieee80211.h -+++ b/net80211/_ieee80211.h -@@ -132,6 +132,11 @@ enum ieee80211_scanmode { +Index: madwifi-trunk-r3314/net80211/_ieee80211.h +=================================================================== +--- madwifi-trunk-r3314.orig/net80211/_ieee80211.h 2008-06-01 04:46:05.000000000 +0200 ++++ madwifi-trunk-r3314/net80211/_ieee80211.h 2008-06-01 04:46:33.000000000 +0200 +@@ -132,6 +132,11 @@ IEEE80211_SCAN_FIRST = 2, /* take first suitable candidate */ }; @@ -367,7 +373,7 @@ /* * Channels are specified by frequency and attributes. */ -@@ -142,6 +147,7 @@ struct ieee80211_channel { +@@ -142,6 +147,7 @@ int8_t ic_maxregpower; /* maximum regulatory tx power in dBm */ int8_t ic_maxpower; /* maximum tx power in dBm */ int8_t ic_minpower; /* minimum tx power in dBm */ @@ -375,9 +381,11 @@ }; #define IEEE80211_CHAN_MAX 255 ---- a/net80211/ieee80211_ioctl.h -+++ b/net80211/ieee80211_ioctl.h -@@ -555,6 +555,7 @@ struct ieee80211req_scan_result { +Index: madwifi-trunk-r3314/net80211/ieee80211_ioctl.h +=================================================================== +--- madwifi-trunk-r3314.orig/net80211/ieee80211_ioctl.h 2008-06-01 04:46:30.000000000 +0200 ++++ madwifi-trunk-r3314/net80211/ieee80211_ioctl.h 2008-06-01 04:46:33.000000000 +0200 +@@ -555,6 +555,7 @@ #define IEEE80211_IOCTL_WDSADDMAC (SIOCIWFIRSTPRIV+26) #define IEEE80211_IOCTL_WDSDELMAC (SIOCIWFIRSTPRIV+28) #define IEEE80211_IOCTL_KICKMAC (SIOCIWFIRSTPRIV+30) @@ -385,9 +393,11 @@ enum { IEEE80211_WMMPARAMS_CWMIN = 1, ---- a/net80211/ieee80211_scan_ap.c -+++ b/net80211/ieee80211_scan_ap.c -@@ -129,131 +129,7 @@ struct ap_state { +Index: madwifi-trunk-r3314/net80211/ieee80211_scan_ap.c +=================================================================== +--- madwifi-trunk-r3314.orig/net80211/ieee80211_scan_ap.c 2008-06-01 04:46:25.000000000 +0200 ++++ madwifi-trunk-r3314/net80211/ieee80211_scan_ap.c 2008-06-01 04:46:33.000000000 +0200 +@@ -129,131 +129,7 @@ static int ap_flush(struct ieee80211_scan_state *); static void action_tasklet(IEEE80211_TQUEUE_ARG); @@ -519,7 +529,7 @@ /* * Attach prior to any scanning work. -@@ -327,29 +203,6 @@ saveie(u_int8_t **iep, const u_int8_t *i +@@ -327,29 +203,6 @@ ieee80211_saveie(iep, ie); } @@ -549,7 +559,7 @@ /* * Start an ap scan by populating the channel list. */ -@@ -358,8 +211,6 @@ ap_start(struct ieee80211_scan_state *ss +@@ -358,8 +211,6 @@ { struct ap_state *as = ss->ss_priv; struct ieee80211com *ic = NULL; @@ -558,7 +568,7 @@ int i; unsigned int mode = 0; -@@ -368,80 +219,8 @@ ap_start(struct ieee80211_scan_state *ss +@@ -368,80 +219,8 @@ /* Determine mode flags to match, or leave zero for auto mode */ as->as_vap_desired_mode = vap->iv_des_mode; as->as_required_mode = 0; @@ -640,7 +650,7 @@ ss->ss_next = 0; /* XXX tunables */ ss->ss_mindwell = msecs_to_jiffies(200); /* 200ms */ -@@ -761,13 +540,6 @@ pick_channel(struct ieee80211_scan_state +@@ -759,13 +538,6 @@ if (IEEE80211_IS_CHAN_RADAR(c->chan)) continue; @@ -654,9 +664,11 @@ /* Verify mode matches any fixed mode specified */ if((c->chan->ic_flags & as->as_required_mode) != as->as_required_mode) ---- a/net80211/ieee80211_scan.c -+++ b/net80211/ieee80211_scan.c -@@ -958,6 +958,80 @@ ieee80211_scan_flush(struct ieee80211com +Index: madwifi-trunk-r3314/net80211/ieee80211_scan.c +=================================================================== +--- madwifi-trunk-r3314.orig/net80211/ieee80211_scan.c 2008-06-01 04:46:11.000000000 +0200 ++++ madwifi-trunk-r3314/net80211/ieee80211_scan.c 2008-06-01 05:24:44.000000000 +0200 +@@ -958,6 +958,80 @@ } } @@ -737,9 +749,11 @@ /* * Execute radar channel change. This is called when a radar/dfs * signal is detected. AP mode only. Return 1 on success, 0 on ---- a/net80211/ieee80211_scan.h -+++ b/net80211/ieee80211_scan.h -@@ -219,4 +219,7 @@ void ieee80211_scanner_register(enum iee +Index: madwifi-trunk-r3314/net80211/ieee80211_scan.h +=================================================================== +--- madwifi-trunk-r3314.orig/net80211/ieee80211_scan.h 2008-06-01 04:46:05.000000000 +0200 ++++ madwifi-trunk-r3314/net80211/ieee80211_scan.h 2008-06-01 04:46:33.000000000 +0200 +@@ -219,4 +219,7 @@ void ieee80211_scanner_unregister(enum ieee80211_opmode, const struct ieee80211_scanner *); void ieee80211_scanner_unregister_all(const struct ieee80211_scanner *); @@ -747,9 +761,11 @@ + struct ieee80211_scan_state *ss, + enum ieee80211_phymode mode); #endif /* _NET80211_IEEE80211_SCAN_H_ */ ---- a/net80211/ieee80211_wireless.c -+++ b/net80211/ieee80211_wireless.c -@@ -3873,6 +3873,106 @@ ieee80211_ioctl_kickmac(struct net_devic +Index: madwifi-trunk-r3314/net80211/ieee80211_wireless.c +=================================================================== +--- madwifi-trunk-r3314.orig/net80211/ieee80211_wireless.c 2008-06-01 04:46:30.000000000 +0200 ++++ madwifi-trunk-r3314/net80211/ieee80211_wireless.c 2008-06-01 04:46:33.000000000 +0200 +@@ -3873,6 +3873,106 @@ return ieee80211_ioctl_setmlme(dev, info, w, (char *)&mlme); } @@ -856,7 +872,7 @@ static int ieee80211_ioctl_addmac(struct net_device *dev, struct iw_request_info *info, void *w, char *extra) -@@ -5656,6 +5756,8 @@ static const struct iw_priv_args ieee802 +@@ -5656,6 +5756,8 @@ IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, 0, "minrate"}, {IEEE80211_PARAM_MINRATE, 0, IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, "get_minrate"}, @@ -865,7 +881,7 @@ #ifdef ATH_REVERSE_ENGINEERING /* -@@ -5753,6 +5855,7 @@ static const iw_handler ieee80211_priv_h +@@ -5753,6 +5855,7 @@ set_priv(IEEE80211_IOCTL_WDSADDMAC, ieee80211_ioctl_wdsmac), set_priv(IEEE80211_IOCTL_WDSDELMAC, ieee80211_ioctl_wdsdelmac), set_priv(IEEE80211_IOCTL_KICKMAC, ieee80211_ioctl_kickmac), Modified: trunk/marvell_owrt_8.09/target/linux/marvell/config-default =================================================================== --- trunk/marvell_owrt_8.09/target/linux/marvell/config-default 2009-08-26 17:09:25 UTC (rev 85) +++ trunk/marvell_owrt_8.09/target/linux/marvell/config-default 2009-08-26 18:24:23 UTC (rev 86) @@ -1,7 +1,7 @@ # # Automatically generated make config: don't edit # Linux kernel version: 2.6.22.18-mv -# Thu Feb 12 11:28:13 2009 +# Fri Aug 14 19:22:54 2009 # CONFIG_ARM=y CONFIG_SYS_SUPPORTS_APM_EMULATION=y @@ -51,7 +51,9 @@ CONFIG_SYSFS_DEPRECATED=y # CONFIG_RELAY is not set CONFIG_BLK_DEV_INITRD=y -CONFIG_INITRAMFS_SOURCE="" +CONFIG_INITRAMFS_SOURCE="/usr/src/openwrt/new_marvell/8.09/build_dir/arm/root-marvell /usr/src/openwrt/new_marvell/8.09/target/linux/generic-2.6/image/initramfs-base-files.txt" +CONFIG_INITRAMFS_ROOT_UID=0 +CONFIG_INITRAMFS_ROOT_GID=0 CONFIG_CC_OPTIMIZE_FOR_SIZE=y CONFIG_SYSCTL=y # CONFIG_EMBEDDED is not set @@ -181,7 +183,7 @@ CONFIG_USE_DSP=y CONFIG_L2_CACHE_ENABLE=y # CONFIG_CPU_L2_DCACHE_WRITETHROUGH is not set -# CONFIG_FEROCEON_PROC is not set +CONFIG_FEROCEON_PROC=y # CONFIG_MV_GENERIC_NAS_FS is not set CONFIG_UBOOT_STRUCT=y # CONFIG_MV_DBG_TRACE is not set @@ -203,7 +205,7 @@ # SoC Networking support # CONFIG_MV_ETHERNET=y -CONFIG_MV_ETH_PORTS_NUM=2 +CONFIG_MV_ETH_PORTS_NUM=3 # # Network Interface Configuration @@ -212,6 +214,8 @@ CONFIG_MV_ETH_0_MACADDR="64:00:00:00:00:01" CONFIG_MV_ETH_1_MTU=1500 CONFIG_MV_ETH_1_MACADDR="64:00:00:00:00:02" +CONFIG_MV_ETH_2_MTU=1500 +CONFIG_MV_ETH_2_MACADDR="00:00:00:00:00:82" # # Rx/Tx Queue Configuration @@ -455,7 +459,7 @@ # CONFIG_NF_CONNTRACK_IPV4=y CONFIG_NF_CONNTRACK_PROC_COMPAT=y -# CONFIG_IP_NF_QUEUE is not set +CONFIG_IP_NF_QUEUE=m CONFIG_IP_NF_IPTABLES=y # CONFIG_IP_NF_MATCH_IPRANGE is not set CONFIG_IP_NF_MATCH_IPP2P=m @@ -488,7 +492,7 @@ CONFIG_NF_NAT_H323=y # CONFIG_NF_NAT_SIP is not set CONFIG_IP_NF_MANGLE=y -CONFIG_IP_NF_TARGET_IMQ=m +# CONFIG_IP_NF_TARGET_IMQ is not set CONFIG_IP_NF_TARGET_TOS=m CONFIG_IP_NF_TARGET_ECN=m CONFIG_IP_NF_TARGET_TTL=m @@ -767,12 +771,7 @@ # CONFIG_DUMMY is not set # CONFIG_BONDING is not set # CONFIG_EQUALIZER is not set -CONFIG_IMQ=m -# CONFIG_IMQ_BEHAVIOR_AA is not set -# CONFIG_IMQ_BEHAVIOR_AB is not set -CONFIG_IMQ_BEHAVIOR_BA=y -# CONFIG_IMQ_BEHAVIOR_BB is not set -CONFIG_IMQ_NUM_DEVS=2 +# CONFIG_IMQ is not set # CONFIG_TUN is not set # CONFIG_ARCNET is not set @@ -946,10 +945,10 @@ # CONFIG_SENSORS_PCA9539 is not set # CONFIG_SENSORS_PCF8591 is not set # CONFIG_SENSORS_MAX6875 is not set -# CONFIG_I2C_DEBUG_CORE is not set -# CONFIG_I2C_DEBUG_ALGO is not set -# CONFIG_I2C_DEBUG_BUS is not set -# CONFIG_I2C_DEBUG_CHIP is not set +CONFIG_I2C_DEBUG_CORE=y +CONFIG_I2C_DEBUG_ALGO=y +CONFIG_I2C_DEBUG_BUS=y +CONFIG_I2C_DEBUG_CHIP=y # # SPI support @@ -964,6 +963,7 @@ CONFIG_HWMON=y # CONFIG_HWMON_VID is not set # CONFIG_SENSORS_ABITUGURU is not set +CONFIG_SENSORS_GSP=y CONFIG_SENSORS_AD7418=y # CONFIG_SENSORS_ADM1021 is not set # CONFIG_SENSORS_ADM1025 is not set @@ -1096,7 +1096,7 @@ CONFIG_RTC_CLASS=y CONFIG_RTC_HCTOSYS=y CONFIG_RTC_HCTOSYS_DEVICE="rtc0" -# CONFIG_RTC_DEBUG is not set +CONFIG_RTC_DEBUG=y # # RTC interfaces From clang at gateworks.com Wed Aug 26 13:31:23 2009 From: clang at gateworks.com (clang at gateworks.com) Date: Wed, 26 Aug 2009 18:31:23 +0000 Subject: [Avila] Gateworks SVN Commit r87 - trunk/marvell_owrt_8.09/package Message-ID: Author: clang Date: 2009-08-26 18:31:18 +0000 (Wed, 26 Aug 2009) New Revision: 87 Removed: trunk/marvell_owrt_8.09/package/madwifi/ Log: remove old madwifi From clang at gateworks.com Wed Aug 26 13:33:14 2009 From: clang at gateworks.com (clang at gateworks.com) Date: Wed, 26 Aug 2009 18:33:14 +0000 Subject: [Avila] Gateworks SVN Commit r88 - in trunk/marvell_owrt_8.09/package: . madwifi madwifi/files madwifi/files/lib madwifi/files/lib/wifi madwifi/patches Message-ID: Author: clang Date: 2009-08-26 18:33:09 +0000 (Wed, 26 Aug 2009) New Revision: 88 Added: trunk/marvell_owrt_8.09/package/madwifi/ trunk/marvell_owrt_8.09/package/madwifi/Config.in trunk/marvell_owrt_8.09/package/madwifi/Makefile trunk/marvell_owrt_8.09/package/madwifi/ath_hal-20080528.tgz trunk/marvell_owrt_8.09/package/madwifi/files/ trunk/marvell_owrt_8.09/package/madwifi/files/lib/ trunk/marvell_owrt_8.09/package/madwifi/files/lib/wifi/ trunk/marvell_owrt_8.09/package/madwifi/files/lib/wifi/madwifi.sh trunk/marvell_owrt_8.09/package/madwifi/patches/ trunk/marvell_owrt_8.09/package/madwifi/patches/102-multicall_binary.patch trunk/marvell_owrt_8.09/package/madwifi/patches/104-autocreate_none.patch trunk/marvell_owrt_8.09/package/madwifi/patches/105-ratectl_attach.patch trunk/marvell_owrt_8.09/package/madwifi/patches/111-minstrel_crash.patch trunk/marvell_owrt_8.09/package/madwifi/patches/113-no_ibss_pwrsave.patch trunk/marvell_owrt_8.09/package/madwifi/patches/122-replayfail_workaround.patch trunk/marvell_owrt_8.09/package/madwifi/patches/123-ccmp_checks.patch trunk/marvell_owrt_8.09/package/madwifi/patches/124-linux24_compat.patch trunk/marvell_owrt_8.09/package/madwifi/patches/126-rxerr_frames.patch trunk/marvell_owrt_8.09/package/madwifi/patches/200-no_debug.patch trunk/marvell_owrt_8.09/package/madwifi/patches/201-debug_fix.patch trunk/marvell_owrt_8.09/package/madwifi/patches/300-napi_polling.patch trunk/marvell_owrt_8.09/package/madwifi/patches/305-pureg_fix.patch trunk/marvell_owrt_8.09/package/madwifi/patches/309-micfail_detect.patch trunk/marvell_owrt_8.09/package/madwifi/patches/310-noise_get.patch trunk/marvell_owrt_8.09/package/madwifi/patches/311-bssid_alloc.patch trunk/marvell_owrt_8.09/package/madwifi/patches/312-erpupdate.patch trunk/marvell_owrt_8.09/package/madwifi/patches/317-bmask.patch trunk/marvell_owrt_8.09/package/madwifi/patches/323-dfs_optional.patch trunk/marvell_owrt_8.09/package/madwifi/patches/324-alignment.patch trunk/marvell_owrt_8.09/package/madwifi/patches/325-channel_spam.patch trunk/marvell_owrt_8.09/package/madwifi/patches/327-queue.patch trunk/marvell_owrt_8.09/package/madwifi/patches/330-beaconcal.patch trunk/marvell_owrt_8.09/package/madwifi/patches/331-memory_alloc.patch trunk/marvell_owrt_8.09/package/madwifi/patches/332-reset_beacons.patch trunk/marvell_owrt_8.09/package/madwifi/patches/333-apscan_mode.patch trunk/marvell_owrt_8.09/package/madwifi/patches/334-input.patch trunk/marvell_owrt_8.09/package/madwifi/patches/340-maxrate.patch trunk/marvell_owrt_8.09/package/madwifi/patches/341-minrate.patch trunk/marvell_owrt_8.09/package/madwifi/patches/342-performance.patch trunk/marvell_owrt_8.09/package/madwifi/patches/343-txqueue_races.patch trunk/marvell_owrt_8.09/package/madwifi/patches/344-minstrel_failcnt.patch trunk/marvell_owrt_8.09/package/madwifi/patches/345-minstrel_sampling.patch trunk/marvell_owrt_8.09/package/madwifi/patches/346-protmode_trig.patch trunk/marvell_owrt_8.09/package/madwifi/patches/347-tuning.patch trunk/marvell_owrt_8.09/package/madwifi/patches/348-ackcts.patch trunk/marvell_owrt_8.09/package/madwifi/patches/349-reset.patch trunk/marvell_owrt_8.09/package/madwifi/patches/350-wisoc_softled.patch trunk/marvell_owrt_8.09/package/madwifi/patches/351-scanlist.patch Log: restore correct madwifi Added: trunk/marvell_owrt_8.09/package/madwifi/Config.in =================================================================== --- trunk/marvell_owrt_8.09/package/madwifi/Config.in (rev 0) +++ trunk/marvell_owrt_8.09/package/madwifi/Config.in 2009-08-26 18:33:09 UTC (rev 88) @@ -0,0 +1,70 @@ +# MadWifi configuration + +config MADWIFI_DEBUG + bool "Enable compilation of debugging features" + depends on EXPERIMENTAL && PACKAGE_kmod-madwifi + default n + +choice + prompt "Rate control algorithm selection" + depends on PACKAGE_kmod-madwifi + default MADWIFI_RCA_MINSTREL + help + This option controls how MadWifi chooses its bitrate. + +config MADWIFI_RCA_MINSTREL + bool "Use the Minstrel rate control algorithm" + help + This code is takes a wandering minstrel approach. Wander around the + different rates, singing wherever you can. And then, look at the + performance, and make a choice. Note that the wandering minstrel will + always wander in directions where he/she feels he/she will get paid + the best for his/her work. + +config MADWIFI_RCA_ONOE + bool "Use the Onoe rate control algorithm" + help + Onoe is a credit based RCA where the value of the credit is determined + by the frequency of successful, erroneous and retransmissions + accumulated during a fixed invocation period of 1000 ms. If less than + 10% of the packets need to be retransmitted at a particular rate, Onoe + keeps increasing its credit point till the threshold value of 10 is + reached. At this point, the current transmission rate is increased to + the next available higher rate and the process repeated with credit + score of zero. Similar logic holds for deducting the credit score and + moving to a lower bit-rate for failed packet + transmission/retransmission attempts. However, once a bit-rate has + been marked as failure in the previous attempt, Onoe will not attempt + to select that bit-rate until 10 seconds have elapsed since the last + attempt. Due to the manner in which it operates, Onoe is conservative + in rate selection and is less sensitive to individual packet failure. + +config MADWIFI_RCA_AMRR + bool "Use the AMRR rate control algorithm" + help + AMRR uses Binary Exponential Backoff (BEB) technique to adapt the + length (threshold) of the sampling period used to change the values of + bit-rate and transmission count parameters. It uses probe packets and + depending on their transmission status adaptively changes the threshold + value. The adaptation mechanism ensures fewer failed + transmission/retransmission and higher throughput by not switching to a + higher rate as specified by the backoff mechanism. In addition to this, + the AMRR employs heuristics to capture the short-term variations of the + channel by judiciously setting the rate and transmission count + parameters. + +config MADWIFI_RCA_SAMPLERATE + bool "Use the SampleRate rate control algorithm" + help + SampleRate decides on the transmission bit-rate based on the past + history of performance; it keeps a record of the number of successive + failures, the number of successful transmits and the total transmission + time along with the destination for that bit-rate. Stale samples are + removed based on a EWMA windowing mechanism. If in the sampling + process, no successful acknowledgment is received or the number of + packets sent is multiple of 10 on a specific link, it transmits the + packet with the highest rate which has not failed 4 successive times. + Other than that it transmits packets at the rate which has the lowest + average transmission time. + +endchoice Added: trunk/marvell_owrt_8.09/package/madwifi/Makefile =================================================================== --- trunk/marvell_owrt_8.09/package/madwifi/Makefile (rev 0) +++ trunk/marvell_owrt_8.09/package/madwifi/Makefile 2009-08-26 18:33:09 UTC (rev 88) @@ -0,0 +1,217 @@ +# +# Copyright (C) 2006-2008 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# +# $Id: Makefile 11319 2008-06-01 12:08:02Z nbd $ + +include $(TOPDIR)/rules.mk +include $(INCLUDE_DIR)/kernel.mk + +PKG_NAME:=madwifi +PKG_REV:=3314 +PKG_VERSION:=r$(PKG_REV) +# PKG_BRANCH:=madwifi-dfs +PKG_RELEASE:=1 + +PKG_SOURCE_PROTO:=svn +PKG_SOURCE_VERSION:=$(PKG_REV) +PKG_SOURCE_SUBDIR:=$(if $(PKG_BRANCH),$(PKG_BRANCH),madwifi-trunk)-$(PKG_VERSION) +PKG_SOURCE_URL:=http://svn.madwifi.org/madwifi/$(if $(PKG_BRANCH),branches/$(PKG_BRANCH),trunk) +PKG_SOURCE:=$(PKG_SOURCE_SUBDIR).tar.gz + +PKG_BUILD_DIR:=$(KERNEL_BUILD_DIR)/$(if $(PKG_BRANCH),$(PKG_BRANCH),madwifi-trunk)-$(PKG_VERSION) + +include $(INCLUDE_DIR)/package.mk + +ifneq ($(CONFIG_TARGET_atheros),) + BUS:=AHB +else + ifneq ($(CONFIG_PCI_SUPPORT),) + BUS:=PCI + endif +endif + +# XXX: remove this check later when we have PCI support properly detected on all targets +ifneq ($(CONFIG_TARGET_ar7)$(CONFIG_TARGET_uml),) + BUS:= +endif + +ifeq ($(ARCH),mips) + HAL_TARGET:=mips-be-elf +endif +ifeq ($(ARCH),mipsel) + HAL_TARGET:=mips-le-elf +endif +ifeq ($(ARCH),i386) + HAL_TARGET:=i386-elf +endif +ifeq ($(ARCH),i686) + HAL_TARGET:=i386-elf +endif +ifeq ($(BOARD),ixp4xx) + HAL_TARGET:=xscale-be-elf +endif +ifeq ($(BOARD),marvell) + HAL_TARGET:=xscale-le-elf +endif +ifeq ($(BOARD),iop32x) + HAL_TARGET:=xscale-le-elf +endif +ifeq ($(ARCH),powerpc) + HAL_TARGET:=powerpc-be-elf +endif +ifeq ($(BOARD),storm) + HAL_TARGET:=armv4-le-elf +endif +ifneq ($(CONFIG_TARGET_atheros),) + HAL_TARGET:=wisoc +endif + +ifdef CONFIG_MADWIFI_RCA_MINSTREL + RATE_CONTROL:=minstrel +endif + +ifdef CONFIG_MADWIFI_RCA_ONOE + RATE_CONTROL:=onoe +endif + +ifdef CONFIG_MADWIFI_RCA_AMRR + RATE_CONTROL:=amrr +endif + +ifdef CONFIG_MADWIFI_RCA_SAMPLERATE + RATE_CONTROL:=sample +endif + +MADWIFI_FILES:= \ + $(PKG_BUILD_DIR)/net80211/wlan.$(LINUX_KMOD_SUFFIX) \ + $(PKG_BUILD_DIR)/net80211/wlan_scan_ap.$(LINUX_KMOD_SUFFIX) \ + $(PKG_BUILD_DIR)/net80211/wlan_scan_sta.$(LINUX_KMOD_SUFFIX) \ + $(PKG_BUILD_DIR)/ath_hal/ath_hal.$(LINUX_KMOD_SUFFIX) \ + $(PKG_BUILD_DIR)/ath_rate/$(RATE_CONTROL)/ath_rate_$(RATE_CONTROL).$(LINUX_KMOD_SUFFIX) \ + $(PKG_BUILD_DIR)/net80211/wlan_acl.$(LINUX_KMOD_SUFFIX) \ + $(PKG_BUILD_DIR)/net80211/wlan_ccmp.$(LINUX_KMOD_SUFFIX) \ + $(PKG_BUILD_DIR)/net80211/wlan_tkip.$(LINUX_KMOD_SUFFIX) \ + $(PKG_BUILD_DIR)/net80211/wlan_wep.$(LINUX_KMOD_SUFFIX) \ + $(PKG_BUILD_DIR)/net80211/wlan_xauth.$(LINUX_KMOD_SUFFIX) \ + +MADWIFI_AUTOLOAD:= \ + wlan \ + wlan_scan_ap \ + wlan_scan_sta \ + ath_hal \ + ath_rate_$(RATE_CONTROL) \ + wlan_acl \ + wlan_ccmp \ + wlan_tkip \ + wlan_wep \ + wlan_xauth \ + +ifeq ($(findstring AHB,$(BUS)),AHB) + MADWIFI_FILES+= $(PKG_BUILD_DIR)/ath/ath_ahb.$(LINUX_KMOD_SUFFIX) + MADWIFI_AUTOLOAD+= ath_ahb +endif +ifeq ($(findstring PCI,$(BUS)),PCI) + MADWIFI_FILES+= $(PKG_BUILD_DIR)/ath/ath_pci.$(LINUX_KMOD_SUFFIX) + MADWIFI_AUTOLOAD+= ath_pci +endif + +MADWIFI_APPLETS:=80211stats,athchans,athctrl,athkey,athstats,wlanconfig +ifdef CONFIG_MADWIFI_DEBUG + MADWIFI_APPLETS:=$(strip $(MADWIFI_APPLETS)),athdebug,80211debug +endif + + +define KernelPackage/madwifi + SUBMENU:=Wireless Drivers + TITLE:=Driver for Atheros wireless chipsets + URL:=http://madwifi.org/ + DEPENDS:=+wireless-tools @PCI_SUPPORT||TARGET_atheros @!TARGET_ar7 @!TARGET_avr32 @!TARGET_etrax @!TARGET_uml + FILES:=$(MADWIFI_FILES) + AUTOLOAD:=$(call AutoLoad,50,$(MADWIFI_AUTOLOAD)) +endef + +define KernelPackage/madwifi/description + This package contains a driver for Atheros 802.11a/b/g chipsets. +endef + +define KernelPackage/madwifi/config + source "$(SOURCE)/Config.in" +endef + +MAKE_ARGS:= \ + PATH="$(TARGET_PATH)" \ + ARCH="$(LINUX_KARCH)" \ + CROSS_COMPILE="$(TARGET_CROSS)" \ + TARGET="$(HAL_TARGET)" \ + TOOLPREFIX="$(KERNEL_CROSS)" \ + TOOLPATH="$(KERNEL_CROSS)" \ + KERNELPATH="$(LINUX_DIR)" \ + LDOPTS="--no-warn-mismatch " \ + ATH_RATE="ath_rate/$(RATE_CONTROL)" \ + WARNINGS="-Wno-unused" \ + $(if $(CONFIG_MADWIFI_DEBUG),,DEBUG="") \ + DO_MULTI=1 + +MAKE_VARS:= \ + COPTS="-DCONFIG_ATHEROS_RATE_DEFAULT='\"$(RATE_CONTROL)\"' -DATH_REVERSE_ENGINEERING=1" \ + +HALFILE:=$(lastword $(sort $(wildcard ./ath_hal-*.tgz))) +ifneq ($(HALFILE),) + define Build/Prepare + $(call Build/Prepare/Default) + rm -rf $(PKG_BUILD_DIR)/tmp + mkdir -p $(PKG_BUILD_DIR)/tmp + tar xvzf $(HALFILE) -C $(PKG_BUILD_DIR)/tmp + $(CP) $(PKG_BUILD_DIR)/tmp/ath_hal*/* $(PKG_BUILD_DIR)/hal/ + rm -rf $(PKG_BUILD_DIR)/tmp + # patch cflags + $(SED) 's, -E[LB],,' \ + -e 's, -mips2,,' \ + -e 's, -mapcs-32,,' \ + $(PKG_BUILD_DIR)/hal/public/*.inc + $(SED) 's,march=armv4,march=armv5te,' \ + $(PKG_BUILD_DIR)/hal/public/xscale*.inc + endef +endif + +ifeq ($(findstring AHB,$(BUS)),AHB) + define Build/Compile/ahb + $(MAKE_VARS) $(MAKE) -C $(PKG_BUILD_DIR) $(MAKE_ARGS) BUS="AHB" modules + $(MAKE) -C $(PKG_BUILD_DIR) $(MAKE_ARGS) CFLAGS="$(TARGET_CFLAGS)" tools + endef +endif + +ifeq ($(findstring PCI,$(BUS)),PCI) + define Build/Compile/pci + $(MAKE_VARS) $(MAKE) -C $(PKG_BUILD_DIR) $(MAKE_ARGS) BUS="PCI" modules + $(MAKE) -C $(PKG_BUILD_DIR) $(MAKE_ARGS) CFLAGS="$(TARGET_CFLAGS)" tools + endef +endif + +define Build/Configure + $(SED) 's,-E[LB] ,,g' $(PKG_BUILD_DIR)/hal/public/*.inc +endef + +define Build/Compile + $(call Build/Compile/ahb) + $(call Build/Compile/pci) +endef + +define Build/InstallDev + mkdir -p $(1)/usr/include/madwifi + $(CP) $(PKG_BUILD_DIR)/include $(1)/usr/include/madwifi/ + mkdir -p $(1)/usr/include/madwifi/net80211 + $(CP) $(PKG_BUILD_DIR)/net80211/*.h $(1)/usr/include/madwifi/net80211/ +endef + +define KernelPackage/madwifi/install + $(INSTALL_DIR) $(1)/lib/wifi + $(INSTALL_DATA) ./files/lib/wifi/madwifi.sh $(1)/lib/wifi + $(INSTALL_DIR) $(1)/usr/sbin + $(CP) $(PKG_BUILD_DIR)/tools/{madwifi_multi,$(MADWIFI_APPLETS)} $(1)/usr/sbin/ +endef + +$(eval $(call KernelPackage,madwifi)) Added: trunk/marvell_owrt_8.09/package/madwifi/ath_hal-20080528.tgz =================================================================== (Binary files differ) Property changes on: trunk/marvell_owrt_8.09/package/madwifi/ath_hal-20080528.tgz ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/marvell_owrt_8.09/package/madwifi/files/lib/wifi/madwifi.sh =================================================================== --- trunk/marvell_owrt_8.09/package/madwifi/files/lib/wifi/madwifi.sh (rev 0) +++ trunk/marvell_owrt_8.09/package/madwifi/files/lib/wifi/madwifi.sh 2009-08-26 18:33:09 UTC (rev 88) @@ -0,0 +1,340 @@ +#!/bin/sh +append DRIVERS "atheros" + +scan_atheros() { + local device="$1" + local wds + local adhoc sta ap + + config_get vifs "$device" vifs + for vif in $vifs; do + + config_get ifname "$vif" ifname + config_set "$vif" ifname "${ifname:-ath}" + + config_get mode "$vif" mode + case "$mode" in + adhoc|ahdemo|sta|ap) + append $mode "$vif" + ;; + wds) + config_get addr "$vif" bssid + config_get ssid "$vif" ssid + [ -z "$addr" -a -n "$ssid" ] && { + config_set "$vif" wds 1 + config_set "$vif" mode sta + mode="sta" + addr="$ssid" + } + ${addr:+append $mode "$vif"} + ;; + *) echo "$device($vif): Invalid mode, ignored."; continue;; + esac + done + + case "${adhoc:+1}:${sta:+1}:${ap+1}" in + # valid mode combinations + 1::) wds="";; + 1::1);; + :1:1)config_set "$device" nosbeacon 1;; # AP+STA, can't use beacon timers for STA + :1:);; + ::1);; + ::);; + *) echo "$device: Invalid mode combination in config"; return 1;; + esac + + config_set "$device" vifs "${ap:+$ap }${adhoc:+$adhoc }${ahdemo:+$ahdemo }${sta:+$sta }${wds:+$wds }" +} + + +disable_atheros() ( + local device="$1" + + set_wifi_down "$device" + # kill all running hostapd and wpa_supplicant processes that + # are running on atheros vifs + for pid in `pidof hostapd wpa_supplicant`; do + grep ath /proc/$pid/cmdline >/dev/null && \ + kill $pid + done + + include /lib/network + cd /proc/sys/net + for dev in *; do + grep "$device" "$dev/%parent" >/dev/null 2>/dev/null && { + ifconfig "$dev" down + unbridge "$dev" + wlanconfig "$dev" destroy + } + done + return 0 +) + +enable_atheros() { + local device="$1" + config_get channel "$device" channel + config_get vifs "$device" vifs + + [ auto = "$channel" ] && channel=0 + + local first=1 + for vif in $vifs; do + nosbeacon= + config_get ifname "$vif" ifname + config_get enc "$vif" encryption + config_get mode "$vif" mode + + [ "$mode" = sta ] && config_get nosbeacon "$device" nosbeacon + + config_get ifname "$vif" ifname + ifname=$(wlanconfig "$ifname" create wlandev "$device" wlanmode "$mode" ${nosbeacon:+nosbeacon}) + [ $? -ne 0 ] && { + echo "enable_atheros($device): Failed to set up $mode vif $ifname" >&2 + continue + } + config_set "$vif" ifname "$ifname" + + [ "$first" = 1 ] && { + # only need to change freq band and channel on the first vif + config_get agmode "$device" agmode + pureg=0 + case "$agmode" in + *b) agmode=11b;; + *bg) agmode=11g;; + *g) agmode=11g; pureg=1;; + *a) agmode=11a;; + *) agmode=auto;; + esac + iwconfig "$ifname" channel "$channel" >/dev/null 2>/dev/null + ifconfig "$ifname" up + sleep 1 + iwpriv "$ifname" mode "$agmode" + iwpriv "$ifname" pureg "$pureg" + iwconfig "$ifname" channel "$channel" >/dev/null 2>/dev/null + } + + config_get_bool hidden "$vif" hidden 0 + iwpriv "$ifname" hide_ssid "$hidden" + + config_get ff "$vif" ff + if [ -n "$ff" ]; then + iwpriv "$ifname" ff "$ff" + fi + + config_get wds "$vif" wds + case "$wds" in + 1|on|enabled) wds=1;; + *) wds=0;; + esac + iwpriv "$ifname" wds "$wds" + + wpa= + case "$enc" in + WEP|wep) + for idx in 1 2 3 4; do + config_get key "$vif" "key${idx}" + iwconfig "$ifname" enc "[$idx]" "${key:-off}" + done + config_get key "$vif" key + key="${key:-1}" + case "$key" in + [1234]) iwconfig "$ifname" enc "[$key]";; + *) iwconfig "$ifname" enc "$key";; + esac + ;; + PSK|psk|PSK2|psk2) + config_get key "$vif" key + ;; + esac + + case "$mode" in + wds) + config_get addr "$vif" bssid + iwpriv "$ifname" wds_add "$addr" + ;; + adhoc|ahdemo) + config_get addr "$vif" bssid + [ -z "$addr" ] || { + iwconfig "$ifname" ap "$addr" + } + ;; + esac + config_get ssid "$vif" ssid + + config_get_bool bgscan "$vif" bgscan + [ -n "$bgscan" ] && iwpriv "$ifname" bgscan "$bgscan" + + config_get_bool antdiv "$device" diversity + [ -n "$antdiv" ] && sysctl -w dev."$device".diversity="$antdiv" >&- + + config_get antrx "$device" rxantenna + [ -n "$antrx" ] && sysctl -w dev."$device".rxantenna="$antrx" >&- + + config_get anttx "$device" txantenna + [ -n "$anttx" ] && sysctl -w dev."$device".txantenna="$anttx" >&- + + config_get distance "$device" distance + [ -n "$distance" ] && athctrl -i "$device" -d "$distance" >&- + + config_get txpwr "$vif" txpower + [ -n "$txpwr" ] && iwconfig "$ifname" txpower "${txpwr%%.*}" + + config_get rate "$vif" rate + [ -n "$rate" ] && iwconfig "$ifname" rate "${rate%%.*}" + + config_get mcast_rate "$vif" mcast_rate + [ -n "$mcast_rate" ] && iwpriv "$ifname" mcast_rate "${mcast_rate%%.*}" + + config_get frag "$vif" frag + [ -n "$frag" ] && iwconfig "$ifname" frag "${frag%%.*}" + + config_get rts "$vif" rts + [ -n "$rts" ] && iwconfig "$ifname" rts "${rts%%.*}" + + config_get_bool doth "$vif" 80211h + [ -n "$doth" ] && iwpriv "$ifname" doth "$doth" + + config_get_bool comp "$vif" compression + [ -n "$comp" ] && iwpriv "$ifname" compression "$comp" + + config_get_bool minrate "$vif" minrate + [ -n "$minrate" ] && iwpriv "$ifname" minrate "$minrate" + + config_get_bool maxrate "$vif" maxrate + [ -n "$maxrate" ] && iwpriv "$ifname" maxrate "$maxrate" + + config_get_bool burst "$vif" bursting + [ -n "$burst" ] && iwpriv "$ifname" burst "$burst" + + config_get_bool wmm "$vif" wmm + [ -n "$wmm" ] && iwpriv "$ifname" wmm "$wmm" + + config_get_bool xr "$vif" xr + [ -n "$xr" ] && iwpriv "$ifname" xr "$xr" + + config_get_bool ar "$vif" ar + [ -n "$ar" ] && iwpriv "$ifname" ar "$ar" + + config_get_bool turbo "$vif" turbo + [ -n "$turbo" ] && iwpriv "$ifname" turbo "$turbo" + + config_get_bool doth "$vif" doth 0 + [ -n "$doth" ] && iwpriv "$ifname" doth "$doth" + + config_get maclist "$vif" maclist + [ -n "$maclist" ] && { + # flush MAC list + iwpriv "$ifname" maccmd 3 + for mac in $maclist; do + iwpriv "$ifname" addmac "$mac" + done + } + + config_get macpolicy "$vif" macpolicy + case "$macpolicy" in + allow) + iwpriv "$ifname" maccmd 1 + ;; + deny) + iwpriv "$ifname" maccmd 2 + ;; + *) + # default deny policy if mac list exists + [ -n "$maclist" ] && iwpriv "$ifname" maccmd 2 + ;; + esac + + ifconfig "$ifname" up + iwconfig "$ifname" channel "$channel" >/dev/null 2>/dev/null + + local net_cfg bridge + net_cfg="$(find_net_config "$vif")" + [ -z "$net_cfg" ] || { + bridge="$(bridge_interface "$net_cfg")" + config_set "$vif" bridge "$bridge" + start_net "$ifname" "$net_cfg" + } + iwconfig "$ifname" essid "$ssid" + set_wifi_up "$vif" "$ifname" + case "$mode" in + ap) + config_get_bool isolate "$vif" isolate 0 + iwpriv "$ifname" ap_bridge "$((isolate^1))" + + if eval "type hostapd_setup_vif" 2>/dev/null >/dev/null; then + hostapd_setup_vif "$vif" madwifi || { + echo "enable_atheros($device): Failed to set up wpa for interface $ifname" >&2 + # make sure this wifi interface won't accidentally stay open without encryption + ifconfig "$ifname" down + wlanconfig "$ifname" destroy + continue + } + fi + ;; + wds|sta) + config_get_bool usepassphrase "$vif" passphrase 1 + case "$enc" in + PSK|psk|PSK2|psk2) + case "$enc" in + PSK|psk) + proto='proto=WPA' + if [ "$usepassphrase" = "1" ]; then + passphrase="psk=\"${key}\"" + else + passphrase="psk=${key}" + fi + ;; + PSK2|psk2) + proto='proto=RSN' + if [ "$usepassphrase" = "1" ]; then + passphrase="psk=\"${key}\"" + else + passphrase="psk=${key}" + fi + ;; + esac + cat > /var/run/wpa_supplicant-$ifname.conf <&-); do + config_get type "$dev" type + [ "$type" = atheros ] && return + cat < + #include + #include ++#include "do_multi.h" + + #undef ARRAY_SIZE + #define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0])) +@@ -185,7 +186,7 @@ + #endif /* __linux__ */ + + int +-main(int argc, char *argv[]) ++CMD(a80211debug)(int argc, char *argv[]) + { + const char *ifname = "ath0"; + const char *cp, *tp; +Index: madwifi-trunk-r3314/tools/80211stats.c +=================================================================== +--- madwifi-trunk-r3314.orig/tools/80211stats.c ++++ madwifi-trunk-r3314/tools/80211stats.c +@@ -59,6 +59,7 @@ + #include "net80211/ieee80211.h" + #include "net80211/ieee80211_crypto.h" + #include "net80211/ieee80211_ioctl.h" ++#include "do_multi.h" + + #ifndef SIOCG80211STATS + #define SIOCG80211STATS (SIOCDEVPRIVATE + 2) +@@ -240,7 +241,7 @@ + } + + int +-main(int argc, char *argv[]) ++CMD(a80211stats)(int argc, char *argv[]) + { + int c, len; + struct ieee80211req_sta_info *si; +Index: madwifi-trunk-r3314/tools/athchans.c +=================================================================== +--- madwifi-trunk-r3314.orig/tools/athchans.c ++++ madwifi-trunk-r3314/tools/athchans.c +@@ -58,6 +58,7 @@ + #include "net80211/ieee80211.h" + #include "net80211/ieee80211_crypto.h" + #include "net80211/ieee80211_ioctl.h" ++#include "do_multi.h" + + static int s = -1; + static const char *progname; +@@ -140,8 +141,9 @@ + } + + #define MAXCHAN ((int)(sizeof(struct ieee80211req_chanlist) * NBBY)) ++ + int +-main(int argc, char *argv[]) ++CMD(athchans)(int argc, char *argv[]) + { + const char *ifname = "wifi0"; + struct ieee80211req_chanlist chanlist; +Index: madwifi-trunk-r3314/tools/athctrl.c +=================================================================== +--- madwifi-trunk-r3314.orig/tools/athctrl.c ++++ madwifi-trunk-r3314/tools/athctrl.c +@@ -52,6 +52,7 @@ + #include + + #include ++#include "do_multi.h" + + static int + setsysctrl(const char *dev, const char *control , u_long value) +@@ -88,7 +89,7 @@ + } + + int +-main(int argc, char *argv[]) ++CMD(athctrl)(int argc, char *argv[]) + { + char device[IFNAMSIZ + 1]; + int distance = -1; +Index: madwifi-trunk-r3314/tools/athdebug.c +=================================================================== +--- madwifi-trunk-r3314.orig/tools/athdebug.c ++++ madwifi-trunk-r3314/tools/athdebug.c +@@ -51,6 +51,7 @@ + #include + #include + #include ++#include "do_multi.h" + + #undef ARRAY_SIZE + #define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0])) +@@ -194,7 +195,7 @@ + #endif /* __linux__ */ + + int +-main(int argc, char *argv[]) ++CMD(athdebug)(int argc, char *argv[]) + { + #ifdef __linux__ + const char *ifname = "wifi0"; +Index: madwifi-trunk-r3314/tools/athkey.c +=================================================================== +--- madwifi-trunk-r3314.orig/tools/athkey.c ++++ madwifi-trunk-r3314/tools/athkey.c +@@ -58,6 +58,7 @@ + #include "net80211/ieee80211.h" + #include "net80211/ieee80211_crypto.h" + #include "net80211/ieee80211_ioctl.h" ++#include "do_multi.h" + + static int s = -1; + static const char *progname; +@@ -213,8 +214,7 @@ + exit(-1); + } + +-int +-main(int argc, char *argv[]) ++int CMD(athkey)(int argc, char *argv[]) + { + const char *ifname = "wifi0"; + struct ieee80211req_key setkey; +Index: madwifi-trunk-r3314/tools/athstats.c +=================================================================== +--- madwifi-trunk-r3314.orig/tools/athstats.c ++++ madwifi-trunk-r3314/tools/athstats.c +@@ -65,6 +65,7 @@ + + #undef ARRAY_SIZE + #define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0])) ++#include "do_multi.h" + + static const struct { + u_int phyerr; +@@ -228,7 +229,7 @@ + } + + int +-main(int argc, char *argv[]) ++CMD(athstats)(int argc, char *argv[]) + { + #ifdef __linux__ + const char *ifname = "wifi0"; +Index: madwifi-trunk-r3314/tools/do_multi.c +=================================================================== +--- /dev/null ++++ madwifi-trunk-r3314/tools/do_multi.c +@@ -0,0 +1,32 @@ ++#include ++#include "do_multi.h" ++ ++int ++main(int argc, char *argv[]) ++{ ++ char *progname; ++ int ret = 0; ++ ++ progname = basename(argv[0]); ++ ++ if(strcmp(progname, "80211debug") == 0) ++ ret = a80211debug_init(argc, argv); ++ if(strcmp(progname, "80211stats") == 0) ++ ret = a80211stats_init(argc, argv); ++ if(strcmp(progname, "athchans") == 0) ++ ret = athchans_init(argc, argv); ++ if(strcmp(progname, "athctrl") == 0) ++ ret = athctrl_init(argc, argv); ++ if(strcmp(progname, "athdebug") == 0) ++ ret = athdebug_init(argc, argv); ++ if(strcmp(progname, "athkey") == 0) ++ ret = athkey_init(argc, argv); ++ if(strcmp(progname, "athstats") == 0) ++ ret = athstats_init(argc, argv); ++ if(strcmp(progname, "wlanconfig") == 0) ++ ret = wlanconfig_init(argc, argv); ++ if(strcmp(progname, "ath_info") == 0) ++ ret = athinfo_init(argc, argv); ++ ++ return ret; ++} +Index: madwifi-trunk-r3314/tools/do_multi.h +=================================================================== +--- /dev/null ++++ madwifi-trunk-r3314/tools/do_multi.h +@@ -0,0 +1,15 @@ ++#ifdef DO_MULTI ++int a80211debug_init(int argc, char *argv[]); ++int a80211stats_init(int argc, char *argv[]); ++int athchans_init(int argc, char *argv[]); ++int athctrl_init(int argc, char *argv[]); ++int athdebug_init(int argc, char *argv[]); ++int athkey_init(int argc, char *argv[]); ++int athstats_init(int argc, char *argv[]); ++int wlanconfig_init(int argc, char *argv[]); ++int athinfo_init(int argc, char *argv[]); ++ ++#define CMD(name) name##_init ++#else ++#define CMD(name) main ++#endif +Index: madwifi-trunk-r3314/tools/Makefile +=================================================================== +--- madwifi-trunk-r3314.orig/tools/Makefile ++++ madwifi-trunk-r3314/tools/Makefile +@@ -46,56 +46,55 @@ + HAL= $(TOP)/hal + endif + ++all: compile + +-ALL= athstats 80211stats athkey athchans athctrl \ ++ALLPROGS= athstats 80211stats athkey athchans athctrl \ + athdebug 80211debug wlanconfig ath_info + +-all: $(ALL) ++OBJS= $(patsubst %,%.o,$(ALLPROGS)) + +-INCS= -I. -I$(HAL) -I$(TOP) -I$(ATH_HAL) ++INCS= -I. -I../ath -I$(HAL) -I$(TOP) -I$(ATH_HAL) + CFLAGS= -g -O2 -Wall + ALL_CFLAGS= $(CFLAGS) $(INCS) + LDFLAGS= + +-all: $(ALL) + +-athstats: athstats.c +- $(CC) -o athstats $(ALL_CFLAGS) -I$(TOP)/ath $(LDFLAGS) athstats.c +-80211stats: 80211stats.c +- $(CC) -o 80211stats $(ALL_CFLAGS) $(LDFLAGS) 80211stats.c +-athkey: athkey.c +- $(CC) -o athkey $(ALL_CFLAGS) $(LDFLAGS) athkey.c +-athchans: athchans.c +- $(CC) -o athchans $(ALL_CFLAGS) $(LDFLAGS) athchans.c +-athctrl: athctrl.c +- $(CC) -o athctrl $(ALL_CFLAGS) $(LDFLAGS) athctrl.c +-athdebug: athdebug.c +- $(CC) -o athdebug $(ALL_CFLAGS) $(LDFLAGS) athdebug.c +-wlanconfig: wlanconfig.c +- $(CC) -o wlanconfig $(ALL_CFLAGS) $(LDFLAGS) wlanconfig.c +-80211debug: 80211debug.c +- $(CC) -o 80211debug $(ALL_CFLAGS) $(LDFLAGS) 80211debug.c +-ath_info: ath_info.c +- $(CC) -o ath_info $(CFLAGS) ath_info.c ++ifneq ($(DO_MULTI),) ++ALL_CFLAGS += -DDO_MULTI=1 ++%.o: %.c ++ ${CC} $(ALL_CFLAGS) -c -o $@ $< ++ ++madwifi_multi: $(OBJS) do_multi.o ++ $(CC) -o $@ $^ ++ ++compile: madwifi_multi ++ for i in $(ALLPROGS); do \ ++ ln -s -f madwifi_multi $$i; \ ++ done ++else ++$(ALLPROGS): ++ $(CC) $(ALL_CFLAGS) -o $@ $@.c ++ ++compile: $(ALLPROGS) ++endif + + + install: $(ALL) + install -d $(DESTDIR)$(BINDIR) +- for i in $(ALL); do \ ++ for i in $(ALLPROGS) $(if $(DO_MULTI),madwifi_multi); do \ + install $$i $(DESTDIR)$(BINDIR)/$$i; \ +- $(STRIP) $(DESTDIR)$(BINDIR)/$$i; \ + done + install -d $(DESTDIR)$(MANDIR)/man8 + install -m 0644 man/*.8 $(DESTDIR)$(MANDIR)/man8 + install $(TOP)/scripts/madwifi-unload $(DESTDIR)$(BINDIR)/madwifi-unload + + uninstall: +- for i in $(ALL); do \ ++ for i in $(ALLPROGS) $(if $(DO_MULTI),madwifi_multi); do \ + rm -f $(DESTDIR)$(BINDIR)/$$i; \ + done +- for i in $(ALL:=.8); do \ +- rm -f $(DESTDIR)$(MANDIR)/man8/$$i; \ ++ for i in $(ALLPROGS); do \ ++ rm -f $(DESTDIR)$(MANDIR)/man8/$$i.8; \ + done + + clean: +- rm -f $(ALL) core a.out ++ rm -f $(ALLPROGS) madwifi_multi *.o core a.out +Index: madwifi-trunk-r3314/tools/wlanconfig.c +=================================================================== +--- madwifi-trunk-r3314.orig/tools/wlanconfig.c ++++ madwifi-trunk-r3314/tools/wlanconfig.c +@@ -61,6 +61,7 @@ + #include "net80211/ieee80211.h" + #include "net80211/ieee80211_crypto.h" + #include "net80211/ieee80211_ioctl.h" ++#include "do_multi.h" + + /* + * These are taken from ieee80211_node.h +@@ -100,7 +101,7 @@ + static int verbose = 0; + + int +-main(int argc, char *argv[]) ++CMD(wlanconfig)(int argc, char *argv[]) + { + const char *ifname, *cmd; + unsigned char bnounit = 0; +Index: madwifi-trunk-r3314/tools/ath_info.c +=================================================================== +--- madwifi-trunk-r3314.orig/tools/ath_info.c ++++ madwifi-trunk-r3314/tools/ath_info.c +@@ -98,6 +98,7 @@ + #include + #include + #include ++#include "do_multi.h" + + #undef ARRAY_SIZE + #define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0])) +@@ -738,7 +739,8 @@ + "unlawful radio transmissions!\n\n"); + } + +-int main(int argc, char *argv[]) ++int ++CMD(athinfo)(int argc, char *argv[]) + { + u_int32_t dev_addr; + u_int16_t eeprom_header, srev, phy_rev_5ghz, phy_rev_2ghz; Added: trunk/marvell_owrt_8.09/package/madwifi/patches/104-autocreate_none.patch =================================================================== --- trunk/marvell_owrt_8.09/package/madwifi/patches/104-autocreate_none.patch (rev 0) +++ trunk/marvell_owrt_8.09/package/madwifi/patches/104-autocreate_none.patch 2009-08-26 18:33:09 UTC (rev 88) @@ -0,0 +1,13 @@ +Index: madwifi-trunk-r3314/ath/if_ath.c +=================================================================== +--- madwifi-trunk-r3314.orig/ath/if_ath.c ++++ madwifi-trunk-r3314/ath/if_ath.c +@@ -516,7 +516,7 @@ + HAL_STATUS status; + int error = 0; + unsigned int i; +- int autocreatemode = IEEE80211_M_STA; ++ int autocreatemode = -1; + u_int8_t csz; + + sc->devid = devid; Added: trunk/marvell_owrt_8.09/package/madwifi/patches/105-ratectl_attach.patch =================================================================== --- trunk/marvell_owrt_8.09/package/madwifi/patches/105-ratectl_attach.patch (rev 0) +++ trunk/marvell_owrt_8.09/package/madwifi/patches/105-ratectl_attach.patch 2009-08-26 18:33:09 UTC (rev 88) @@ -0,0 +1,25 @@ +Index: madwifi-trunk-r3314/net80211/ieee80211_rate.c +=================================================================== +--- madwifi-trunk-r3314.orig/net80211/ieee80211_rate.c ++++ madwifi-trunk-r3314/net80211/ieee80211_rate.c +@@ -100,8 +100,18 @@ + ieee80211_load_module(buf); + + if (!ratectls[id].attach) { +- printk(KERN_ERR "Error loading module \"%s\"\n", buf); +- return NULL; ++ /* pick the first available rate control module */ ++ printk(KERN_INFO "Rate control module \"%s\" not available\n", buf); ++ for (id = 0; id < IEEE80211_RATE_MAX; id++) { ++ if (ratectls[id].attach) ++ break; ++ } ++ if (!ratectls[id].attach) { ++ printk(KERN_ERR "No rate control module available"); ++ return NULL; ++ } else { ++ printk(KERN_INFO "Using \"%s\" instead.\n", module_names[id]); ++ } + } + + ctl = ratectls[id].attach(sc); Added: trunk/marvell_owrt_8.09/package/madwifi/patches/111-minstrel_crash.patch =================================================================== --- trunk/marvell_owrt_8.09/package/madwifi/patches/111-minstrel_crash.patch (rev 0) +++ trunk/marvell_owrt_8.09/package/madwifi/patches/111-minstrel_crash.patch 2009-08-26 18:33:09 UTC (rev 88) @@ -0,0 +1,14 @@ +Index: madwifi-trunk-r3314/ath_rate/minstrel/minstrel.c +=================================================================== +--- madwifi-trunk-r3314.orig/ath_rate/minstrel/minstrel.c ++++ madwifi-trunk-r3314/ath_rate/minstrel/minstrel.c +@@ -393,6 +393,9 @@ + struct minstrel_node *sn = ATH_NODE_MINSTREL(an); + int rc1, rc2, rc3; /* Index into the rate table, so for example, it is 0..11 */ + ++ if (sn->num_rates <= 0) ++ return; ++ + if (sn->is_sampling) { + sn->is_sampling = 0; + if (sn->rs_sample_rate_slower) Added: trunk/marvell_owrt_8.09/package/madwifi/patches/113-no_ibss_pwrsave.patch =================================================================== --- trunk/marvell_owrt_8.09/package/madwifi/patches/113-no_ibss_pwrsave.patch (rev 0) +++ trunk/marvell_owrt_8.09/package/madwifi/patches/113-no_ibss_pwrsave.patch 2009-08-26 18:33:09 UTC (rev 88) @@ -0,0 +1,14 @@ +Index: madwifi-trunk-r3314/net80211/ieee80211_scan.c +=================================================================== +--- madwifi-trunk-r3314.orig/net80211/ieee80211_scan.c ++++ madwifi-trunk-r3314/net80211/ieee80211_scan.c +@@ -291,7 +291,8 @@ + struct ieee80211com *ic = vap->iv_ic; + int delay; + +- ieee80211_sta_pwrsave(vap, 1); ++ if (vap->iv_opmode != IEEE80211_M_IBSS) ++ ieee80211_sta_pwrsave(vap, 1); + /* + * Use an initial 1ms delay to ensure the null + * data frame has a chance to go out. Added: trunk/marvell_owrt_8.09/package/madwifi/patches/122-replayfail_workaround.patch =================================================================== --- trunk/marvell_owrt_8.09/package/madwifi/patches/122-replayfail_workaround.patch (rev 0) +++ trunk/marvell_owrt_8.09/package/madwifi/patches/122-replayfail_workaround.patch 2009-08-26 18:33:09 UTC (rev 88) @@ -0,0 +1,14 @@ +Index: madwifi-trunk-r3314/net80211/ieee80211_linux.c +=================================================================== +--- madwifi-trunk-r3314.orig/net80211/ieee80211_linux.c ++++ madwifi-trunk-r3314/net80211/ieee80211_linux.c +@@ -331,6 +331,9 @@ + k->wk_cipher->ic_name, k->wk_keyix, + (unsigned long long)rsc); + ++ /* disabled for now due to bogus events for unknown reasons */ ++ return; ++ + /* TODO: needed parameters: count, keyid, key type, src address, TSC */ + snprintf(buf, sizeof(buf), "%s(keyid=%d %scast addr=" MAC_FMT ")", tag, + k->wk_keyix, Added: trunk/marvell_owrt_8.09/package/madwifi/patches/123-ccmp_checks.patch =================================================================== --- trunk/marvell_owrt_8.09/package/madwifi/patches/123-ccmp_checks.patch (rev 0) +++ trunk/marvell_owrt_8.09/package/madwifi/patches/123-ccmp_checks.patch 2009-08-26 18:33:09 UTC (rev 88) @@ -0,0 +1,24 @@ +Index: madwifi-trunk-r3314/net80211/ieee80211_crypto_ccmp.c +=================================================================== +--- madwifi-trunk-r3314.orig/net80211/ieee80211_crypto_ccmp.c ++++ madwifi-trunk-r3314/net80211/ieee80211_crypto_ccmp.c +@@ -475,6 +475,9 @@ + uint8_t *mic, *pos; + u_int space; + ++ if (ctx->cc_tfm == NULL) ++ return 0; ++ + ctx->cc_vap->iv_stats.is_crypto_ccmp++; + + skb = skb0; +@@ -589,6 +592,9 @@ + uint8_t *pos, *mic; + u_int space; + ++ if (ctx->cc_tfm == NULL) ++ return 0; ++ + ctx->cc_vap->iv_stats.is_crypto_ccmp++; + + skb = skb0; Added: trunk/marvell_owrt_8.09/package/madwifi/patches/124-linux24_compat.patch =================================================================== --- trunk/marvell_owrt_8.09/package/madwifi/patches/124-linux24_compat.patch (rev 0) +++ trunk/marvell_owrt_8.09/package/madwifi/patches/124-linux24_compat.patch 2009-08-26 18:33:09 UTC (rev 88) @@ -0,0 +1,210 @@ +Index: madwifi-trunk-r3314/ath/if_athvar.h +=================================================================== +--- madwifi-trunk-r3314.orig/ath/if_athvar.h ++++ madwifi-trunk-r3314/ath/if_athvar.h +@@ -126,6 +126,11 @@ + #define ATH_GET_NETDEV_DEV(ndev) ((ndev)->class_dev.dev) + #endif + ++#ifndef NETDEV_TX_OK ++#define NETDEV_TX_OK 0 ++#define NETDEV_TX_BUSY 1 ++#endif ++ + #if LINUX_VERSION_CODE < KERNEL_VERSION(2,4,23) + static inline struct net_device *_alloc_netdev(int sizeof_priv, const char *mask, + void (*setup)(struct net_device *)) +Index: madwifi-trunk-r3314/ath/if_ath_radar.c +=================================================================== +--- madwifi-trunk-r3314.orig/ath/if_ath_radar.c ++++ madwifi-trunk-r3314/ath/if_ath_radar.c +@@ -92,6 +92,13 @@ + #define nofloat_pct(_value, _pct) \ + ( (_value * (1000 + _pct)) / 1000 ) + ++#ifndef list_for_each_entry_reverse ++#define list_for_each_entry_reverse(pos, head, member) \ ++ for (pos = list_entry((head)->prev, typeof(*pos), member); \ ++ prefetch(pos->member.prev), &pos->member != (head); \ ++ pos = list_entry(pos->member.prev, typeof(*pos), member)) ++#endif ++ + struct radar_pattern_specification { + /* The name of the rule/specification (i.e. what did we detect) */ + const char *name; +Index: madwifi-trunk-r3314/ath/if_ath.c +=================================================================== +--- madwifi-trunk-r3314.orig/ath/if_ath.c ++++ madwifi-trunk-r3314/ath/if_ath.c +@@ -4705,6 +4705,46 @@ + #undef USE_SHPREAMBLE + } + ++#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,15) ++static inline int atomic_cmpxchg(atomic_t *v, int old, int new) ++{ ++ int ret; ++ unsigned long flags; ++ ++ local_irq_save(flags); ++ ret = v->counter; ++ if (likely(ret == old)) ++ v->counter = new; ++ local_irq_restore(flags); ++ ++ return ret; ++} ++ ++/** ++ * atomic_add_unless - add unless the number is a given value ++ * @v: pointer of type atomic_t ++ * @a: the amount to add to v... ++ * @u: ...unless v is equal to u. ++ * ++ * Atomically adds @a to @v, so long as it was not @u. ++ * Returns non-zero if @v was not @u, and zero otherwise. ++ */ ++static __inline__ int atomic_add_unless(atomic_t *v, int a, int u) ++{ ++ int c, old; ++ c = atomic_read(v); ++ for (;;) { ++ if (unlikely(c == (u))) ++ break; ++ old = atomic_cmpxchg((v), c, c + (a)); ++ if (likely(old == c)) ++ break; ++ c = old; ++ } ++ return c != (u); ++} ++#endif ++ + /* + * Generate beacon frame and queue cab data for a VAP. + */ +Index: madwifi-trunk-r3314/net80211/sort.c +=================================================================== +--- /dev/null ++++ madwifi-trunk-r3314/net80211/sort.c +@@ -0,0 +1,120 @@ ++/* ++ * A fast, small, non-recursive O(nlog n) sort for the Linux kernel ++ * ++ * Jan 23 2005 Matt Mackall ++ */ ++ ++#include ++#include ++#include ++ ++static void u32_swap(void *a, void *b, int size) ++{ ++ u32 t = *(u32 *)a; ++ *(u32 *)a = *(u32 *)b; ++ *(u32 *)b = t; ++} ++ ++static void generic_swap(void *a, void *b, int size) ++{ ++ char t; ++ ++ do { ++ t = *(char *)a; ++ *(char *)a++ = *(char *)b; ++ *(char *)b++ = t; ++ } while (--size > 0); ++} ++ ++/** ++ * sort - sort an array of elements ++ * @base: pointer to data to sort ++ * @num: number of elements ++ * @size: size of each element ++ * @cmp: pointer to comparison function ++ * @swap: pointer to swap function or NULL ++ * ++ * This function does a heapsort on the given array. You may provide a ++ * swap function optimized to your element type. ++ * ++ * Sorting time is O(n log n) both on average and worst-case. While ++ * qsort is about 20% faster on average, it suffers from exploitable ++ * O(n*n) worst-case behavior and extra memory requirements that make ++ * it less suitable for kernel use. ++ */ ++ ++static void sort(void *base, size_t num, size_t size, ++ int (*cmp)(const void *, const void *), ++ void (*swap)(void *, void *, int size)) ++{ ++ /* pre-scale counters for performance */ ++ int i = (num/2 - 1) * size, n = num * size, c, r; ++ ++ if (!swap) ++ swap = (size == 4 ? u32_swap : generic_swap); ++ ++ /* heapify */ ++ for ( ; i >= 0; i -= size) { ++ for (r = i; r * 2 + size < n; r = c) { ++ c = r * 2 + size; ++ if (c < n - size && cmp(base + c, base + c + size) < 0) ++ c += size; ++ if (cmp(base + r, base + c) >= 0) ++ break; ++ swap(base + r, base + c, size); ++ } ++ } ++ ++ /* sort */ ++ for (i = n - size; i >= 0; i -= size) { ++ swap(base, base + i, size); ++ for (r = 0; r * 2 + size < i; r = c) { ++ c = r * 2 + size; ++ if (c < i - size && cmp(base + c, base + c + size) < 0) ++ c += size; ++ if (cmp(base + r, base + c) >= 0) ++ break; ++ swap(base + r, base + c, size); ++ } ++ } ++} ++ ++EXPORT_SYMBOL(sort); ++ ++#if 0 ++/* a simple boot-time regression test */ ++ ++int cmpint(const void *a, const void *b) ++{ ++ return *(int *)a - *(int *)b; ++} ++ ++static int sort_test(void) ++{ ++ int *a, i, r = 1; ++ ++ a = kmalloc(1000 * sizeof(int), GFP_KERNEL); ++ BUG_ON(!a); ++ ++ printk("testing sort()\n"); ++ ++ for (i = 0; i < 1000; i++) { ++ r = (r * 725861) % 6599; ++ a[i] = r; ++ } ++ ++ sort(a, 1000, sizeof(int), cmpint, NULL); ++ ++ for (i = 0; i < 999; i++) ++ if (a[i] > a[i+1]) { ++ printk("sort() failed!\n"); ++ break; ++ } ++ ++ kfree(a); ++ ++ return 0; ++} ++ ++module_init(sort_test); ++#endif Added: trunk/marvell_owrt_8.09/package/madwifi/patches/126-rxerr_frames.patch =================================================================== --- trunk/marvell_owrt_8.09/package/madwifi/patches/126-rxerr_frames.patch (rev 0) +++ trunk/marvell_owrt_8.09/package/madwifi/patches/126-rxerr_frames.patch 2009-08-26 18:33:09 UTC (rev 88) @@ -0,0 +1,15 @@ +Index: madwifi-trunk-r3314/ath/if_ath.c +=================================================================== +--- madwifi-trunk-r3314.orig/ath/if_ath.c ++++ madwifi-trunk-r3314/ath/if_ath.c +@@ -6474,8 +6474,9 @@ + /* + * Reject error frames if we have no vaps that + * are operating in monitor mode. ++ * Reject empty frames as well + */ +- if (sc->sc_nmonvaps == 0) ++ if ((sc->sc_nmonvaps == 0) || (rs->rs_datalen == 0)) + goto rx_next; + } + rx_accept: Added: trunk/marvell_owrt_8.09/package/madwifi/patches/200-no_debug.patch =================================================================== --- trunk/marvell_owrt_8.09/package/madwifi/patches/200-no_debug.patch (rev 0) +++ trunk/marvell_owrt_8.09/package/madwifi/patches/200-no_debug.patch 2009-08-26 18:33:09 UTC (rev 88) @@ -0,0 +1,392 @@ +Index: madwifi-trunk-r3314/ath/if_ath.c +=================================================================== +--- madwifi-trunk-r3314.orig/ath/if_ath.c ++++ madwifi-trunk-r3314/ath/if_ath.c +@@ -42,7 +42,6 @@ + * This software is derived from work of Atsushi Onoe; his contribution + * is greatly appreciated. + */ +-#define AR_DEBUG + #include "if_ath_debug.h" + #include "opt_ah.h" + +@@ -368,8 +367,10 @@ + static void ath_set_dfs_cac_time(struct ieee80211com *, unsigned int seconds); + + static unsigned int ath_test_radar(struct ieee80211com *); +-static unsigned int ath_dump_hal_map(struct ieee80211com *ic); ++#ifdef AR_DEBUG + ++static unsigned int ath_dump_hal_map(struct ieee80211com *ic); ++#endif + static u_int32_t ath_get_clamped_maxtxpower(struct ath_softc *sc); + static u_int32_t ath_set_clamped_maxtxpower(struct ath_softc *sc, + u_int32_t new_clamped_maxtxpower); +@@ -520,9 +521,11 @@ + u_int8_t csz; + + sc->devid = devid; ++#ifdef AR_DEBUG + ath_debug_global = (ath_debug & ATH_DEBUG_GLOBAL); + sc->sc_debug = (ath_debug & ~ATH_DEBUG_GLOBAL); + DPRINTF(sc, ATH_DEBUG_ANY, "%s: devid 0x%x\n", __func__, devid); ++#endif + + /* Allocate space for dynamically determined maximum VAP count */ + sc->sc_bslot = +@@ -1038,8 +1041,9 @@ + ic->ic_vap_delete = ath_vap_delete; + + ic->ic_test_radar = ath_test_radar; ++#ifdef AR_DEBUG + ic->ic_dump_hal_map = ath_dump_hal_map; +- ++#endif + ic->ic_set_dfs_testmode = ath_set_dfs_testmode; + ic->ic_get_dfs_testmode = ath_get_dfs_testmode; + +@@ -1297,12 +1301,14 @@ + /* If no default VAP debug flags are passed, allow a few to + * transfer down from the driver to new VAPs so we can have load + * time debugging for VAPs too. */ ++#ifdef AR_DEBUG + vap->iv_debug = 0 | + ((sc->sc_debug & ATH_DEBUG_RATE) ? IEEE80211_MSG_XRATE : 0) | + ((sc->sc_debug & ATH_DEBUG_XMIT) ? IEEE80211_MSG_OUTPUT : 0) | + ((sc->sc_debug & ATH_DEBUG_RECV) ? IEEE80211_MSG_INPUT : 0) | + 0 + ; ++#endif + } + ic->ic_debug = (sc->sc_default_ieee80211_debug & IEEE80211_MSG_IC); + +@@ -10496,9 +10502,11 @@ + /* XXX validate? */ + sc->sc_ledpin = val; + break; ++#ifdef AR_DEBUG + case ATH_DEBUG: + sc->sc_debug = (val & ~ATH_DEBUG_GLOBAL); + ath_debug_global = (val & ATH_DEBUG_GLOBAL); ++#endif + break; + case ATH_TXANTENNA: + /* +@@ -10918,9 +10926,11 @@ + } + + /* initialize values */ ++#ifdef AR_DEBUG + ath_debug_global = (ath_debug & ATH_DEBUG_GLOBAL); + sc->sc_debug = (ath_debug & ~ATH_DEBUG_GLOBAL); + sc->sc_default_ieee80211_debug = ieee80211_debug; ++#endif + sc->sc_txantenna = 0; /* default to auto-selection */ + sc->sc_txintrperiod = ATH_TXQ_INTR_PERIOD; + } +@@ -11762,6 +11772,7 @@ + } + + /* This is called by a private ioctl (iwpriv) to dump the HAL obfuscation table */ ++#ifdef AR_DEBUG + static unsigned int + ath_dump_hal_map(struct ieee80211com *ic) + { +@@ -11770,7 +11781,7 @@ + ath_hal_dump_map(sc->sc_ah); + return 0; + } +- ++#endif + /* If we are shutting down or blowing off the DFS channel availability check + * then we call this to stop the behavior before we take the rest of the + * necessary actions (such as a DFS reaction to radar). */ +Index: madwifi-trunk-r3314/ath_rate/amrr/amrr.c +=================================================================== +--- madwifi-trunk-r3314.orig/ath_rate/amrr/amrr.c ++++ madwifi-trunk-r3314/ath_rate/amrr/amrr.c +@@ -70,7 +70,9 @@ + + #include "amrr.h" + ++#ifdef AR_DEBUG + #define AMRR_DEBUG ++#endif + #ifdef AMRR_DEBUG + #define DPRINTF(sc, _fmt, ...) do { \ + if (sc->sc_debug & 0x10) \ +Index: madwifi-trunk-r3314/ath_rate/minstrel/minstrel.c +=================================================================== +--- madwifi-trunk-r3314.orig/ath_rate/minstrel/minstrel.c ++++ madwifi-trunk-r3314/ath_rate/minstrel/minstrel.c +@@ -117,7 +117,9 @@ + + #include "minstrel.h" + ++#ifdef AR_DEBUG + #define MINSTREL_DEBUG ++#endif + #ifdef MINSTREL_DEBUG + enum { + ATH_DEBUG_RATE = 0x00000010 /* rate control */ +Index: madwifi-trunk-r3314/ath_rate/onoe/onoe.c +=================================================================== +--- madwifi-trunk-r3314.orig/ath_rate/onoe/onoe.c ++++ madwifi-trunk-r3314/ath_rate/onoe/onoe.c +@@ -66,7 +66,9 @@ + + #include "onoe.h" + ++#ifdef AR_DEBUG + #define ONOE_DEBUG ++#endif + #ifdef ONOE_DEBUG + enum { + ATH_DEBUG_RATE = 0x00000010, /* rate control */ +Index: madwifi-trunk-r3314/ath_rate/sample/sample.c +=================================================================== +--- madwifi-trunk-r3314.orig/ath_rate/sample/sample.c ++++ madwifi-trunk-r3314/ath_rate/sample/sample.c +@@ -68,7 +68,9 @@ + + #include "sample.h" + +-#define SAMPLE_DEBUG ++#ifdef AR_DEBUG ++#define SAMPLE_DEBUG ++#endif + #ifdef SAMPLE_DEBUG + enum { + ATH_DEBUG_RATE = 0x00000010, /* rate control */ +Index: madwifi-trunk-r3314/tools/do_multi.c +=================================================================== +--- madwifi-trunk-r3314.orig/tools/do_multi.c ++++ madwifi-trunk-r3314/tools/do_multi.c +@@ -9,16 +9,20 @@ + + progname = basename(argv[0]); + ++#ifdef AR_DEBUG + if(strcmp(progname, "80211debug") == 0) + ret = a80211debug_init(argc, argv); ++#endif + if(strcmp(progname, "80211stats") == 0) + ret = a80211stats_init(argc, argv); + if(strcmp(progname, "athchans") == 0) + ret = athchans_init(argc, argv); + if(strcmp(progname, "athctrl") == 0) + ret = athctrl_init(argc, argv); ++#ifdef AR_DEBUG + if(strcmp(progname, "athdebug") == 0) + ret = athdebug_init(argc, argv); ++#endif + if(strcmp(progname, "athkey") == 0) + ret = athkey_init(argc, argv); + if(strcmp(progname, "athstats") == 0) +Index: madwifi-trunk-r3314/tools/Makefile +=================================================================== +--- madwifi-trunk-r3314.orig/tools/Makefile ++++ madwifi-trunk-r3314/tools/Makefile +@@ -48,6 +48,8 @@ + + all: compile + ++DEBUG = -DAR_DEBUG ++ + ALLPROGS= athstats 80211stats athkey athchans athctrl \ + athdebug 80211debug wlanconfig ath_info + +@@ -55,7 +57,7 @@ + + INCS= -I. -I../ath -I$(HAL) -I$(TOP) -I$(ATH_HAL) + CFLAGS= -g -O2 -Wall +-ALL_CFLAGS= $(CFLAGS) $(INCS) ++ALL_CFLAGS= $(CFLAGS) $(INCS) $(DEBUG) + LDFLAGS= + + +Index: madwifi-trunk-r3314/net80211/ieee80211_linux.h +=================================================================== +--- madwifi-trunk-r3314.orig/net80211/ieee80211_linux.h ++++ madwifi-trunk-r3314/net80211/ieee80211_linux.h +@@ -29,8 +29,6 @@ + #ifndef _NET80211_IEEE80211_LINUX_H_ + #define _NET80211_IEEE80211_LINUX_H_ + +-#define IEEE80211_DEBUG +-#define IEEE80211_DEBUG_REFCNT /* Node reference count debugging */ + /* #define ATH_DEBUG_SPINLOCKS */ /* announce before spinlocking */ + + #include +Index: madwifi-trunk-r3314/Makefile.inc +=================================================================== +--- madwifi-trunk-r3314.orig/Makefile.inc ++++ madwifi-trunk-r3314/Makefile.inc +@@ -148,7 +148,8 @@ + TOOLS= $(TOP)/tools + + WARNINGS = -Werror +-COPTS+= $(WARNINGS) ++DEBUG = -DAR_DEBUG -DIEEE80211_DEBUG ++COPTS+= $(WARNINGS) $(DEBUG) + INCS= -include $(TOP)/include/compat.h -I$(TOP)/include + + # TARGET defines the target platform architecture. It must match one of +Index: madwifi-trunk-r3314/ath/if_ath_radar.c +=================================================================== +--- madwifi-trunk-r3314.orig/ath/if_ath_radar.c ++++ madwifi-trunk-r3314/ath/if_ath_radar.c +@@ -19,8 +19,6 @@ + * $Id: if_ath_radar.c 2464 2007-06-15 22:51:56Z mtaylor $ + */ + #include "opt_ah.h" +- +-#define AR_DEBUG + #include "if_ath_debug.h" + + #ifndef AUTOCONF_INCLUDED +@@ -56,8 +54,6 @@ + #include + #endif + +-#define AR_DEBUG +- + #include "net80211/if_athproto.h" + #include "if_athvar.h" + +Index: madwifi-trunk-r3314/ath/if_ath_hal.h +=================================================================== +--- madwifi-trunk-r3314.orig/ath/if_ath_hal.h ++++ madwifi-trunk-r3314/ath/if_ath_hal.h +@@ -1081,6 +1081,7 @@ + + tail -f /var/log/messages | sed -f hal_unmangle.sed + */ ++#ifdef AR_DEBUG + static inline void ath_hal_dump_map(struct ath_hal *ah) + { + #ifdef CONFIG_KALLSYMS +@@ -1345,7 +1346,7 @@ + #endif /* #ifndef CONFIG_KALLSYMS */ + + } +- ++#endif + #include "if_ath_hal_wrappers.h" + + #endif /* #ifndef _IF_ATH_HAL_H_ */ +Index: madwifi-trunk-r3314/net80211/ieee80211_var.h +=================================================================== +--- madwifi-trunk-r3314.orig/net80211/ieee80211_var.h ++++ madwifi-trunk-r3314/net80211/ieee80211_var.h +@@ -492,9 +492,10 @@ + /* inject a fake radar signal -- used while on a 802.11h DFS channels */ + unsigned int (*ic_test_radar)(struct ieee80211com *); + ++#ifdef AR_DEBUG + /* dump HAL */ + unsigned int (*ic_dump_hal_map)(struct ieee80211com *); +- ++#endif + /* DFS channel availability check time (in seconds) */ + void (*ic_set_dfs_cac_time)(struct ieee80211com *, unsigned int); + unsigned int (*ic_get_dfs_cac_time)(struct ieee80211com *); +Index: madwifi-trunk-r3314/net80211/ieee80211_wireless.c +=================================================================== +--- madwifi-trunk-r3314.orig/net80211/ieee80211_wireless.c ++++ madwifi-trunk-r3314/net80211/ieee80211_wireless.c +@@ -1548,6 +1548,7 @@ + return 0; + } + ++#ifdef AR_DEBUG + static int + ieee80211_ioctl_hal_map(struct net_device *dev, struct iw_request_info *info, + void *w, char *extra) +@@ -1558,7 +1559,7 @@ + params[0] = ic->ic_dump_hal_map(ic); + return 0; + } +- ++#endif + + static int + ieee80211_ioctl_radar(struct net_device *dev, struct iw_request_info *info, +@@ -5258,8 +5259,10 @@ + IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, "getwmmparams" }, + { IEEE80211_IOCTL_RADAR, + 0, 0, "doth_radar" }, ++#ifdef AR_DEBUG + { IEEE80211_IOCTL_HALMAP, + 0, 0, "dump_hal_map" }, ++#endif + /* + * These depends on sub-ioctl support which added in version 12. + */ +@@ -5695,7 +5698,9 @@ + set_priv(IEEE80211_IOCTL_SETMLME, ieee80211_ioctl_setmlme), + set_priv(IEEE80211_IOCTL_SETKEY, ieee80211_ioctl_setkey), + set_priv(IEEE80211_IOCTL_DELKEY, ieee80211_ioctl_delkey), ++#ifdef AR_DEBUG + set_priv(IEEE80211_IOCTL_HALMAP, ieee80211_ioctl_hal_map), ++#endif + set_priv(IEEE80211_IOCTL_ADDMAC, ieee80211_ioctl_addmac), + set_priv(IEEE80211_IOCTL_DELMAC, ieee80211_ioctl_delmac), + set_priv(IEEE80211_IOCTL_WDSADDMAC, ieee80211_ioctl_wdsmac), +Index: madwifi-trunk-r3314/ath/if_ath_debug.h +=================================================================== +--- madwifi-trunk-r3314.orig/ath/if_ath_debug.h ++++ madwifi-trunk-r3314/ath/if_ath_debug.h +@@ -68,13 +68,6 @@ + ath_keyprint((_sc), __func__, _ix, _hk, _mac); \ + } while (0) + +-#else /* #ifdef AR_DEBUG */ +- +-#define DFLAG_ISSET(sc, _m) 0 +-#define DPRINTF(sc, _m, _fmt, ...) +-#define KEYPRINTF(sc, k, ix, mac) +- +-#endif /* #ifdef AR_DEBUG */ + + #define IFF_DUMPPKTS(_sc, _m) DFLAG_ISSET((_sc), (_m)) + +@@ -89,5 +82,15 @@ + #define IPRINTF(_sc, _fmt, ...) \ + printk(KERN_INFO "%s: %s: " _fmt, \ + SC_DEV_NAME(_sc), __func__, ## __VA_ARGS__) ++#else ++#define DFLAG_ISSET(sc, _m) 0 ++#define DPRINTF(sc, _m, _fmt, ...) ++#define KEYPRINTF(sc, k, ix, mac) ++#define EPRINTF(...) ++#define WPRINTF(...) ++#define IPRINTF(...) ++#define IFF_DUMPPKTS(...) 0 ++ ++#endif + + #endif /* #ifndef _IF_ATH_DEBUG_H_ */ +Index: madwifi-trunk-r3314/net80211/ieee80211_node.c +=================================================================== +--- madwifi-trunk-r3314.orig/net80211/ieee80211_node.c ++++ madwifi-trunk-r3314/net80211/ieee80211_node.c +@@ -920,6 +920,9 @@ + ni->ni_rxkeyoff = 0; + } + ++#ifndef IEEE80211_DEBUG ++#define node_print_message(...) do {} while(0) ++#else + static void node_print_message( + u_int32_t flags, + int show_counter, +@@ -972,7 +975,7 @@ + adjusted_refcount); + va_end(args); + } +-EXPORT_SYMBOL(node_print_message); ++#endif + + static void + #ifdef IEEE80211_DEBUG_REFCNT Added: trunk/marvell_owrt_8.09/package/madwifi/patches/201-debug_fix.patch =================================================================== --- trunk/marvell_owrt_8.09/package/madwifi/patches/201-debug_fix.patch (rev 0) +++ trunk/marvell_owrt_8.09/package/madwifi/patches/201-debug_fix.patch 2009-08-26 18:33:09 UTC (rev 88) @@ -0,0 +1,22 @@ +Index: madwifi-trunk-r3314/ath_hal/ah_os.c +=================================================================== +--- madwifi-trunk-r3314.orig/ath_hal/ah_os.c ++++ madwifi-trunk-r3314/ath_hal/ah_os.c +@@ -65,7 +65,7 @@ + #include + + #ifdef AH_DEBUG +-static int ath_hal_debug = 0; ++static int ath_hal_debug = 99; + #endif + + int ath_hal_dma_beacon_response_time = 2; /* in TUs */ +@@ -327,6 +327,8 @@ + * useful for debugging and figuring out, which hal function sets which + * registers */ + char *ath_hal_func = NULL; ++EXPORT_SYMBOL(ath_hal_func); ++ + #endif + + /* Added: trunk/marvell_owrt_8.09/package/madwifi/patches/300-napi_polling.patch =================================================================== --- trunk/marvell_owrt_8.09/package/madwifi/patches/300-napi_polling.patch (rev 0) +++ trunk/marvell_owrt_8.09/package/madwifi/patches/300-napi_polling.patch 2009-08-26 18:33:09 UTC (rev 88) @@ -0,0 +1,543 @@ +Index: madwifi-trunk-r3314/ath/if_ath.c +=================================================================== +--- madwifi-trunk-r3314.orig/ath/if_ath.c ++++ madwifi-trunk-r3314/ath/if_ath.c +@@ -184,7 +184,11 @@ + struct sk_buff *, int, int, u_int64_t); + static void ath_setdefantenna(struct ath_softc *, u_int); + static struct ath_txq *ath_txq_setup(struct ath_softc *, int, int); +-static void ath_rx_tasklet(TQUEUE_ARG); ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,24) ++static int ath_rx_poll(struct napi_struct *napi, int budget); ++#else ++static int ath_rx_poll(struct net_device *dev, int *budget); ++#endif + static int ath_hardstart(struct sk_buff *, struct net_device *); + static int ath_mgtstart(struct ieee80211com *, struct sk_buff *); + #ifdef ATH_SUPERG_COMP +@@ -376,6 +380,9 @@ + u_int32_t new_clamped_maxtxpower); + static u_int32_t ath_get_real_maxtxpower(struct ath_softc *sc); + ++static void ath_poll_disable(struct net_device *dev); ++static void ath_poll_enable(struct net_device *dev); ++ + /* calibrate every 30 secs in steady state but check every second at first. */ + static int ath_calinterval = ATH_SHORT_CALINTERVAL; + static int ath_countrycode = CTRY_DEFAULT; /* country code */ +@@ -547,7 +554,6 @@ + + atomic_set(&sc->sc_txbuf_counter, 0); + +- ATH_INIT_TQUEUE(&sc->sc_rxtq, ath_rx_tasklet, dev); + ATH_INIT_TQUEUE(&sc->sc_txtq, ath_tx_tasklet, dev); + ATH_INIT_TQUEUE(&sc->sc_bmisstq, ath_bmiss_tasklet, dev); + ATH_INIT_TQUEUE(&sc->sc_bstucktq, ath_bstuck_tasklet, dev); +@@ -821,6 +827,12 @@ + dev->set_mac_address = ath_set_mac_address; + dev->change_mtu = ath_change_mtu; + dev->tx_queue_len = ATH_TXBUF - ATH_TXBUF_MGT_RESERVED; ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,24) ++ netif_napi_add(dev, &sc->sc_napi, ath_rx_poll, 64); ++#else ++ dev->poll = ath_rx_poll; ++ dev->weight = 64; ++#endif + #ifdef USE_HEADERLEN_RESV + dev->hard_header_len += sizeof(struct ieee80211_qosframe) + + sizeof(struct llc) + +@@ -2216,6 +2228,7 @@ + (status & HAL_INT_GLOBAL) ? " HAL_INT_GLOBAL" : "" + ); + ++ sc->sc_isr = status; + status &= sc->sc_imask; /* discard unasked for bits */ + /* As soon as we know we have a real interrupt we intend to service, + * we will check to see if we need an initial hardware TSF reading. +@@ -2273,7 +2286,23 @@ + } + if (status & (HAL_INT_RX | HAL_INT_RXPHY)) { + ath_uapsd_processtriggers(sc, hw_tsf); +- ATH_SCHEDULE_TQUEUE(&sc->sc_rxtq, &needmark); ++ sc->sc_isr &= ~HAL_INT_RX; ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,24) ++ if (netif_rx_schedule_prep(dev, &sc->sc_napi)) ++#else ++ if (netif_rx_schedule_prep(dev)) ++#endif ++ { ++#ifndef ATH_PRECISE_TSF ++ sc->sc_imask &= ~HAL_INT_RX; ++ ath_hal_intrset(ah, sc->sc_imask); ++#endif ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,24) ++ __netif_rx_schedule(dev, &sc->sc_napi); ++#else ++ __netif_rx_schedule(dev); ++#endif ++ } + } + if (status & HAL_INT_TX) { + #ifdef ATH_SUPERG_DYNTURBO +@@ -2299,6 +2328,11 @@ + } + } + #endif ++ /* disable transmit interrupt */ ++ sc->sc_isr &= ~HAL_INT_TX; ++ ath_hal_intrset(ah, sc->sc_imask & ~HAL_INT_TX); ++ sc->sc_imask &= ~HAL_INT_TX; ++ + ATH_SCHEDULE_TQUEUE(&sc->sc_txtq, &needmark); + } + if (status & HAL_INT_BMISS) { +@@ -2511,6 +2545,7 @@ + if (sc->sc_tx99 != NULL) + sc->sc_tx99->start(sc->sc_tx99); + #endif ++ ath_poll_enable(dev); + + done: + ATH_UNLOCK(sc); +@@ -2551,6 +2586,9 @@ + if (sc->sc_tx99 != NULL) + sc->sc_tx99->stop(sc->sc_tx99); + #endif ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,24) ++ ath_poll_disable(dev); ++#endif + netif_stop_queue(dev); /* XXX re-enabled by ath_newstate */ + dev->flags &= ~IFF_RUNNING; /* NB: avoid recursion */ + ieee80211_stop_running(ic); /* stop all VAPs */ +@@ -4009,6 +4047,39 @@ + return ath_keyset(sc, k, mac, vap->iv_bss); + } + ++static void ath_poll_disable(struct net_device *dev) ++{ ++ struct ath_softc *sc = dev->priv; ++ ++ /* ++ * XXX Using in_softirq is not right since we might ++ * be called from other soft irq contexts than ++ * ath_rx_poll ++ */ ++ if (!in_softirq()) { ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,24) ++ napi_disable(&sc->sc_napi); ++#else ++ netif_poll_disable(dev); ++#endif ++ } ++} ++ ++static void ath_poll_enable(struct net_device *dev) ++{ ++ struct ath_softc *sc = dev->priv; ++ ++ /* NB: see above */ ++ if (!in_softirq()) { ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,24) ++ napi_enable(&sc->sc_napi); ++#else ++ netif_poll_enable(dev); ++#endif ++ } ++} ++ ++ + /* + * Block/unblock tx+rx processing while a key change is done. + * We assume the caller serializes key management operations +@@ -4026,13 +4097,7 @@ + * When called from the rx tasklet we cannot use + * tasklet_disable because it will block waiting + * for us to complete execution. +- * +- * XXX Using in_softirq is not right since we might +- * be called from other soft irq contexts than +- * ath_rx_tasklet. + */ +- if (!in_softirq()) +- tasklet_disable(&sc->sc_rxtq); + netif_stop_queue(dev); + } + +@@ -4043,9 +4108,9 @@ + struct ath_softc *sc = dev->priv; + + DPRINTF(sc, ATH_DEBUG_KEYCACHE, "End\n"); +- netif_wake_queue(dev); +- if (!in_softirq()) /* NB: see above */ +- tasklet_enable(&sc->sc_rxtq); ++ ++ if (dev->flags&IFF_RUNNING) ++ netif_wake_queue(dev); + } + + /* +@@ -6350,15 +6415,25 @@ + sc->sc_rxotherant = 0; + } + +-static void +-ath_rx_tasklet(TQUEUE_ARG data) ++static int ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,24) ++ath_rx_poll(struct napi_struct *napi, int budget) ++#else ++ath_rx_poll(struct net_device *dev, int *budget) ++#endif + { + #define PA2DESC(_sc, _pa) \ + ((struct ath_desc *)((caddr_t)(_sc)->sc_rxdma.dd_desc + \ + ((_pa) - (_sc)->sc_rxdma.dd_desc_paddr))) +- struct net_device *dev = (struct net_device *)data; +- struct ath_buf *bf; ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,24) ++ struct ath_softc *sc = container_of(napi, struct ath_softc, sc_napi); ++ struct net_device *dev = sc->sc_dev; ++ u_int rx_limit = budget; ++#else + struct ath_softc *sc = dev->priv; ++ u_int rx_limit = min(dev->quota, *budget); ++#endif ++ struct ath_buf *bf; + struct ieee80211com *ic = &sc->sc_ic; + struct ath_hal *ah = sc ? sc->sc_ah : NULL; + struct ath_desc *ds; +@@ -6368,8 +6443,10 @@ + unsigned int len; + int type; + u_int phyerr; ++ u_int processed = 0, early_stop = 0; + + DPRINTF(sc, ATH_DEBUG_RX_PROC, "invoked\n"); ++process_rx_again: + do { + bf = STAILQ_FIRST(&sc->sc_rxbuf); + if (bf == NULL) { /* XXX ??? can this happen */ +@@ -6393,6 +6470,15 @@ + /* NB: never process the self-linked entry at the end */ + break; + } ++ ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,24) ++ processed++; ++#endif ++ if (rx_limit-- < 0) { ++ early_stop = 1; ++ break; ++ } ++ + skb = bf->bf_skb; + if (skb == NULL) { + EPRINTF(sc, "Dropping; buffer contains NULL skbuff.\n"); +@@ -6440,6 +6526,7 @@ + sc->sc_stats.ast_rx_phyerr++; + phyerr = rs->rs_phyerr & 0x1f; + sc->sc_stats.ast_rx_phy[phyerr]++; ++ goto rx_next; + } + if (rs->rs_status & HAL_RXERR_DECRYPT) { + /* +@@ -6635,9 +6722,43 @@ + STAILQ_INSERT_TAIL(&sc->sc_rxbuf, bf, bf_list); + ATH_RXBUF_UNLOCK_IRQ(sc); + } while (ath_rxbuf_init(sc, bf) == 0); ++ if (!early_stop) { ++ unsigned long flags; ++ /* Check if more data is received while we were ++ * processing the descriptor chain. ++ */ ++#ifndef ATH_PRECISE_TSF ++ local_irq_save(flags); ++ if (sc->sc_isr & HAL_INT_RX) { ++ u_int64_t hw_tsf = ath_hal_gettsf64(ah); ++ sc->sc_isr &= ~HAL_INT_RX; ++ local_irq_restore(flags); ++ ath_uapsd_processtriggers(sc, hw_tsf); ++ goto process_rx_again; ++ } ++#endif ++#ifndef ATH_PRECISE_TSF ++ sc->sc_imask |= HAL_INT_RX; ++ ath_hal_intrset(ah, sc->sc_imask); ++ local_irq_restore(flags); ++#endif ++ } ++ ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,24) ++ netif_rx_complete(dev, napi); ++#else ++ netif_rx_complete(dev); ++ *budget -= processed; ++ dev->quota -= processed; ++#endif + + /* rx signal state monitoring */ + ath_hal_rxmonitor(ah, &sc->sc_halstats, &sc->sc_curchan); ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,24) ++ return processed; ++#else ++ return early_stop; ++#endif + #undef PA2DESC + } + +@@ -8288,12 +8409,24 @@ + { + struct net_device *dev = (struct net_device *)data; + struct ath_softc *sc = dev->priv; ++ unsigned long flags; + ++process_tx_again: + if (txqactive(sc->sc_ah, 0)) + ath_tx_processq(sc, &sc->sc_txq[0]); + if (txqactive(sc->sc_ah, sc->sc_cabq->axq_qnum)) + ath_tx_processq(sc, sc->sc_cabq); + ++ local_irq_save(flags); ++ if (sc->sc_isr & HAL_INT_TX) { ++ sc->sc_isr &= ~HAL_INT_TX; ++ local_irq_restore(flags); ++ goto process_tx_again; ++ } ++ sc->sc_imask |= HAL_INT_TX; ++ ath_hal_intrset(sc->sc_ah, sc->sc_imask); ++ local_irq_restore(flags); ++ + netif_wake_queue(dev); + + if (sc->sc_softled) +@@ -8309,7 +8442,9 @@ + { + struct net_device *dev = (struct net_device *)data; + struct ath_softc *sc = dev->priv; ++ unsigned long flags; + ++process_tx_again: + /* + * Process each active queue. + */ +@@ -8330,6 +8465,16 @@ + if (sc->sc_uapsdq && txqactive(sc->sc_ah, sc->sc_uapsdq->axq_qnum)) + ath_tx_processq(sc, sc->sc_uapsdq); + ++ local_irq_save(flags); ++ if (sc->sc_isr & HAL_INT_TX) { ++ sc->sc_isr &= ~HAL_INT_TX; ++ local_irq_restore(flags); ++ goto process_tx_again; ++ } ++ sc->sc_imask |= HAL_INT_TX; ++ ath_hal_intrset(sc->sc_ah, sc->sc_imask); ++ local_irq_restore(flags); ++ + netif_wake_queue(dev); + + if (sc->sc_softled) +@@ -8345,13 +8490,25 @@ + struct net_device *dev = (struct net_device *)data; + struct ath_softc *sc = dev->priv; + unsigned int i; ++ unsigned long flags; + + /* Process each active queue. This includes sc_cabq, sc_xrtq and + * sc_uapsdq */ ++process_tx_again: + for (i = 0; i < HAL_NUM_TX_QUEUES; i++) + if (ATH_TXQ_SETUP(sc, i) && txqactive(sc->sc_ah, i)) + ath_tx_processq(sc, &sc->sc_txq[i]); + ++ local_irq_save(flags); ++ if (sc->sc_isr & HAL_INT_TX) { ++ sc->sc_isr &= ~HAL_INT_TX; ++ local_irq_restore(flags); ++ goto process_tx_again; ++ } ++ sc->sc_imask |= HAL_INT_TX; ++ ath_hal_intrset(sc->sc_ah, sc->sc_imask); ++ local_irq_restore(flags); ++ + netif_wake_queue(dev); + + if (sc->sc_softled) +@@ -10284,9 +10441,9 @@ + dev->mtu = mtu; + if ((dev->flags & IFF_RUNNING) && !sc->sc_invalid) { + /* NB: the rx buffers may need to be reallocated */ +- tasklet_disable(&sc->sc_rxtq); ++ ath_poll_disable(dev); + error = ath_reset(dev); +- tasklet_enable(&sc->sc_rxtq); ++ ath_poll_enable(dev); + } + ATH_UNLOCK(sc); + +Index: madwifi-trunk-r3314/ath/if_athvar.h +=================================================================== +--- madwifi-trunk-r3314.orig/ath/if_athvar.h ++++ madwifi-trunk-r3314/ath/if_athvar.h +@@ -53,6 +53,10 @@ + # include + #endif + ++#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0) ++#define irqs_disabled() 0 ++#endif ++ + /* + * Deduce if tasklets are available. If not then + * fall back to using the immediate work queue. +@@ -616,6 +620,9 @@ + struct ath_softc { + struct ieee80211com sc_ic; /* NB: must be first */ + struct net_device *sc_dev; ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,24) ++ struct napi_struct sc_napi; ++#endif + void __iomem *sc_iobase; /* address of the device */ + struct semaphore sc_lock; /* dev-level lock */ + struct net_device_stats sc_devstats; /* device statistics */ +@@ -730,7 +737,6 @@ + struct ath_buf *sc_rxbufcur; /* current rx buffer */ + u_int32_t *sc_rxlink; /* link ptr in last RX desc */ + spinlock_t sc_rxbuflock; +- struct ATH_TQ_STRUCT sc_rxtq; /* rx intr tasklet */ + struct ATH_TQ_STRUCT sc_rxorntq; /* rxorn intr tasklet */ + u_int8_t sc_defant; /* current default antenna */ + u_int8_t sc_rxotherant; /* RXs on non-default antenna */ +@@ -745,6 +751,7 @@ + u_int sc_txintrperiod; /* tx interrupt batching */ + struct ath_txq sc_txq[HAL_NUM_TX_QUEUES]; + struct ath_txq *sc_ac2q[WME_NUM_AC]; /* WME AC -> h/w qnum */ ++ HAL_INT sc_isr; /* unmasked ISR state */ + struct ATH_TQ_STRUCT sc_txtq; /* tx intr tasklet */ + u_int8_t sc_grppoll_str[GRPPOLL_RATE_STR_LEN]; + struct ath_descdma sc_bdma; /* beacon descriptors */ +@@ -858,6 +865,8 @@ + #define ATH_TXBUF_LOCK_CHECK(_sc) + #endif + ++#define ATH_DISABLE_INTR local_irq_disable ++#define ATH_ENABLE_INTR local_irq_enable + + #define ATH_RXBUF_LOCK_INIT(_sc) spin_lock_init(&(_sc)->sc_rxbuflock) + #define ATH_RXBUF_LOCK_DESTROY(_sc) +Index: madwifi-trunk-r3314/net80211/ieee80211_input.c +=================================================================== +--- madwifi-trunk-r3314.orig/net80211/ieee80211_input.c ++++ madwifi-trunk-r3314/net80211/ieee80211_input.c +@@ -1198,7 +1198,7 @@ + /* attach vlan tag */ + struct ieee80211_node *ni_tmp = SKB_CB(skb)->ni; + if (vlan_hwaccel_receive_skb(skb, vap->iv_vlgrp, ni->ni_vlan) == NET_RX_DROP) { +- /* If netif_rx dropped the packet because ++ /* If netif_receive_skb dropped the packet because + * device was too busy */ + if (ni_tmp != NULL) { + /* node reference was leaked */ +@@ -1209,8 +1209,8 @@ + skb = NULL; /* SKB is no longer ours */ + } else { + struct ieee80211_node *ni_tmp = SKB_CB(skb)->ni; +- if (netif_rx(skb) == NET_RX_DROP) { +- /* If netif_rx dropped the packet because ++ if (netif_receive_skb(skb) == NET_RX_DROP) { ++ /* If netif_receive_skb dropped the packet because + * device was too busy */ + if (ni_tmp != NULL) { + /* node reference was leaked */ +@@ -2322,8 +2322,8 @@ + skb1->protocol = __constant_htons(0x0019); /* ETH_P_80211_RAW */ + + ni_tmp = SKB_CB(skb1)->ni; +- if (netif_rx(skb1) == NET_RX_DROP) { +- /* If netif_rx dropped the packet because ++ if (netif_receive_skb(skb1) == NET_RX_DROP) { ++ /* If netif_receive_skb dropped the packet because + * device was too busy */ + if (ni_tmp != NULL) { + /* node reference was leaked */ +Index: madwifi-trunk-r3314/net80211/ieee80211_monitor.c +=================================================================== +--- madwifi-trunk-r3314.orig/net80211/ieee80211_monitor.c ++++ madwifi-trunk-r3314/net80211/ieee80211_monitor.c +@@ -584,8 +584,8 @@ + skb1->protocol = + __constant_htons(0x0019); /* ETH_P_80211_RAW */ + +- if (netif_rx(skb1) == NET_RX_DROP) { +- /* If netif_rx dropped the packet because ++ if (netif_receive_skb(skb1) == NET_RX_DROP) { ++ /* If netif_receive_skb dropped the packet because + * device was too busy, reclaim the ref. in + * the skb. */ + if (SKB_CB(skb1)->ni != NULL) +Index: madwifi-trunk-r3314/net80211/ieee80211_skb.c +=================================================================== +--- madwifi-trunk-r3314.orig/net80211/ieee80211_skb.c ++++ madwifi-trunk-r3314/net80211/ieee80211_skb.c +@@ -73,7 +73,7 @@ + #undef dev_queue_xmit + #undef kfree_skb + #undef kfree_skb_fast +-#undef netif_rx ++#undef netif_receive_skb + #undef pskb_copy + #undef skb_clone + #undef skb_copy +@@ -638,8 +638,8 @@ + grp, vlan_tag); + } + +-int netif_rx_debug(struct sk_buff *skb, const char* func, int line) { +- return netif_rx(untrack_skb(skb, 0, func, line, __func__, __LINE__)); ++int netif_receive_skb_debug(struct sk_buff *skb, const char* func, int line) { ++ return netif_receive_skb(untrack_skb(skb, 0, func, line, __func__, __LINE__)); + } + + struct sk_buff * alloc_skb_debug(unsigned int length, gfp_t gfp_mask, +@@ -760,7 +760,7 @@ + } + + EXPORT_SYMBOL(vlan_hwaccel_receive_skb_debug); +-EXPORT_SYMBOL(netif_rx_debug); ++EXPORT_SYMBOL(netif_receive_skb_debug); + EXPORT_SYMBOL(alloc_skb_debug); + EXPORT_SYMBOL(dev_alloc_skb_debug); + EXPORT_SYMBOL(skb_clone_debug); +Index: madwifi-trunk-r3314/net80211/ieee80211_skb.h +=================================================================== +--- madwifi-trunk-r3314.orig/net80211/ieee80211_skb.h ++++ madwifi-trunk-r3314/net80211/ieee80211_skb.h +@@ -116,7 +116,7 @@ + int vlan_hwaccel_receive_skb_debug(struct sk_buff *skb, + struct vlan_group *grp, unsigned short vlan_tag, + const char* func, int line); +-int netif_rx_debug(struct sk_buff *skb, const char* func, int line); ++int netif_receive_skb_debug(struct sk_buff *skb, const char* func, int line); + struct sk_buff * alloc_skb_debug(unsigned int length, gfp_t gfp_mask, + const char *func, int line); + struct sk_buff * dev_alloc_skb_debug(unsigned int length, +@@ -151,7 +151,7 @@ + #undef dev_queue_xmit + #undef kfree_skb + #undef kfree_skb_fast +-#undef netif_rx ++#undef netif_receive_skb + #undef pskb_copy + #undef skb_clone + #undef skb_copy +@@ -168,8 +168,8 @@ + skb_copy_expand_debug(_skb, _newheadroom, _newtailroom, _gfp_mask, __func__, __LINE__) + #define vlan_hwaccel_receive_skb(_skb, _grp, _tag) \ + vlan_hwaccel_receive_skb_debug(_skb, _grp, _tag, __func__, __LINE__) +-#define netif_rx(_skb) \ +- netif_rx_debug(_skb, __func__, __LINE__) ++#define netif_receive_skb(_skb) \ ++ netif_receive_skb_debug(_skb, __func__, __LINE__) + #define alloc_skb(_length, _gfp_mask) \ + alloc_skb_debug(_length, _gfp_mask, __func__, __LINE__) + #define dev_alloc_skb(_length) \ Added: trunk/marvell_owrt_8.09/package/madwifi/patches/305-pureg_fix.patch =================================================================== --- trunk/marvell_owrt_8.09/package/madwifi/patches/305-pureg_fix.patch (rev 0) +++ trunk/marvell_owrt_8.09/package/madwifi/patches/305-pureg_fix.patch 2009-08-26 18:33:09 UTC (rev 88) @@ -0,0 +1,178 @@ +Index: madwifi-trunk-r3314/ath/if_ath.c +=================================================================== +--- madwifi-trunk-r3314.orig/ath/if_ath.c ++++ madwifi-trunk-r3314/ath/if_ath.c +@@ -4149,7 +4149,9 @@ + rfilt |= HAL_RX_FILTER_PROM; + if (ic->ic_opmode == IEEE80211_M_STA || + sc->sc_opmode == HAL_M_IBSS || /* NB: AHDEMO too */ +- (sc->sc_nostabeacons) || sc->sc_scanning) ++ (sc->sc_nostabeacons) || sc->sc_scanning || ++ ((ic->ic_opmode == IEEE80211_M_HOSTAP) && ++ (ic->ic_protmode != IEEE80211_PROT_NONE))) + rfilt |= HAL_RX_FILTER_BEACON; + if (sc->sc_nmonvaps > 0) + rfilt |= (HAL_RX_FILTER_CONTROL | HAL_RX_FILTER_BEACON | +Index: madwifi-trunk-r3314/net80211/ieee80211_input.c +=================================================================== +--- madwifi-trunk-r3314.orig/net80211/ieee80211_input.c ++++ madwifi-trunk-r3314/net80211/ieee80211_input.c +@@ -346,11 +346,12 @@ + bssid = wh->i_addr3; + } + /* +- * Validate the bssid. ++ * Validate the bssid. Let beacons get through though for 11g protection mode. + */ +-#ifdef ATH_SUPERG_XR + if (!IEEE80211_ADDR_EQ(bssid, vap->iv_bssid) && +- !IEEE80211_ADDR_EQ(bssid, dev->broadcast)) { ++ !IEEE80211_ADDR_EQ(bssid, dev->broadcast) && ++ (subtype != IEEE80211_FC0_SUBTYPE_BEACON)) { ++#ifdef ATH_SUPERG_XR + /* + * allow MGT frames to vap->iv_xrvap. + * this will allow roaming between XR and normal vaps +@@ -366,18 +367,14 @@ + vap->iv_stats.is_rx_wrongbss++; + goto out; + } +- } + #else +- if (!IEEE80211_ADDR_EQ(bssid, vap->iv_bssid) && +- !IEEE80211_ADDR_EQ(bssid, dev->broadcast)) { + /* not interested in */ + IEEE80211_DISCARD_MAC(vap, IEEE80211_MSG_INPUT, + bssid, NULL, "%s", "not to bss"); + vap->iv_stats.is_rx_wrongbss++; + goto out; +- } +- + #endif ++ } + break; + case IEEE80211_M_WDS: + if (skb->len < sizeof(struct ieee80211_frame_addr4)) { +@@ -3066,7 +3063,7 @@ + u_int8_t *frm, *efrm; + u_int8_t *ssid, *rates, *xrates, *suppchan, *wpa, *rsn, *wme, *ath; + u_int8_t rate; +- int reassoc, resp, allocbs = 0; ++ int reassoc, resp, allocbs = 0, has_erp = 0; + u_int8_t qosinfo; + + if (ni_or_null == NULL) +@@ -3096,11 +3093,15 @@ + * o station mode when associated (to collect state + * updates such as 802.11g slot time), or + * o adhoc mode (to discover neighbors) ++ * o ap mode in protection mode (beacons only) + * Frames otherwise received are discarded. + */ + if (!((ic->ic_flags & IEEE80211_F_SCAN) || + (vap->iv_opmode == IEEE80211_M_STA && ni->ni_associd) || +- vap->iv_opmode == IEEE80211_M_IBSS)) { ++ (vap->iv_opmode == IEEE80211_M_IBSS) || ++ ((subtype == IEEE80211_FC0_SUBTYPE_BEACON) && ++ (vap->iv_opmode == IEEE80211_M_HOSTAP) && ++ (ic->ic_protmode != IEEE80211_PROT_NONE)))) { + vap->iv_stats.is_rx_mgtdiscard++; + return; + } +@@ -3184,6 +3185,7 @@ + break; + } + scan.erp = frm[2]; ++ has_erp = 1; + break; + case IEEE80211_ELEMID_RSN: + scan.rsn = frm; +@@ -3421,6 +3423,20 @@ + ieee80211_bg_scan(vap); + return; + } ++ ++ /* Update AP protection mode when in 11G mode */ ++ if ((vap->iv_opmode == IEEE80211_M_HOSTAP) && ++ IEEE80211_IS_CHAN_ANYG(ic->ic_curchan)) { ++ ++ /* Assume no ERP IE == 11b AP */ ++ if ((!has_erp || (has_erp && (scan.erp & IEEE80211_ERP_NON_ERP_PRESENT))) && ++ !(ic->ic_flags & IEEE80211_F_USEPROT)) { ++ ++ ic->ic_flags |= IEEE80211_F_USEPROT; ++ ic->ic_flags_ext |= IEEE80211_FEXT_ERPUPDATE; ++ } ++ } ++ + /* + * If scanning, just pass information to the scan module. + */ +Index: madwifi-trunk-r3314/net80211/ieee80211_node.c +=================================================================== +--- madwifi-trunk-r3314.orig/net80211/ieee80211_node.c ++++ madwifi-trunk-r3314/net80211/ieee80211_node.c +@@ -383,10 +383,16 @@ + /* Update country ie information */ + ieee80211_build_countryie(ic); + +- if (IEEE80211_IS_CHAN_HALF(chan)) ++ if (IEEE80211_IS_CHAN_HALF(chan)) { + ni->ni_rates = ic->ic_sup_half_rates; +- else if (IEEE80211_IS_CHAN_QUARTER(chan)) ++ } else if (IEEE80211_IS_CHAN_QUARTER(chan)) { + ni->ni_rates = ic->ic_sup_quarter_rates; ++ } ++ ++ if ((vap->iv_flags & IEEE80211_F_PUREG) && ++ IEEE80211_IS_CHAN_ANYG(chan)) { ++ ieee80211_setpuregbasicrates(&ni->ni_rates); ++ } + + (void) ieee80211_sta_join1(PASS_NODE(ni)); + } +Index: madwifi-trunk-r3314/net80211/ieee80211_proto.c +=================================================================== +--- madwifi-trunk-r3314.orig/net80211/ieee80211_proto.c ++++ madwifi-trunk-r3314/net80211/ieee80211_proto.c +@@ -595,6 +595,28 @@ + { 4, { 2, 4, 11, 22 } }, /* IEEE80211_MODE_TURBO_G (mixed b/g) */ + }; + ++static const struct ieee80211_rateset basicpureg[] = { ++ { 7, {2, 4, 11, 22, 12, 24, 48 } }, ++}; ++ ++/* ++ * Mark basic rates for the 11g rate table based on the pureg setting ++ */ ++void ++ieee80211_setpuregbasicrates(struct ieee80211_rateset *rs) ++{ ++ int i, j; ++ ++ for (i = 0; i < rs->rs_nrates; i++) { ++ rs->rs_rates[i] &= IEEE80211_RATE_VAL; ++ for (j = 0; j < basicpureg[0].rs_nrates; j++) ++ if (basicpureg[0].rs_rates[j] == rs->rs_rates[i]) { ++ rs->rs_rates[i] |= IEEE80211_RATE_BASIC; ++ break; ++ } ++ } ++} ++ + /* + * Mark the basic rates for the 11g rate table based on the + * specified mode. For 11b compatibility we mark only 11b +Index: madwifi-trunk-r3314/net80211/ieee80211_var.h +=================================================================== +--- madwifi-trunk-r3314.orig/net80211/ieee80211_var.h ++++ madwifi-trunk-r3314/net80211/ieee80211_var.h +@@ -708,6 +708,7 @@ + void ieee80211_build_sc_ie(struct ieee80211com *); + void ieee80211_dfs_action(struct ieee80211com *); + void ieee80211_expire_channel_excl_restrictions(struct ieee80211com *); ++void ieee80211_setpuregbasicrates(struct ieee80211_rateset *rs); + + /* + * Iterate through ic_channels to enumerate all distinct ic_ieee channel numbers. Added: trunk/marvell_owrt_8.09/package/madwifi/patches/309-micfail_detect.patch =================================================================== --- trunk/marvell_owrt_8.09/package/madwifi/patches/309-micfail_detect.patch (rev 0) +++ trunk/marvell_owrt_8.09/package/madwifi/patches/309-micfail_detect.patch 2009-08-26 18:33:09 UTC (rev 88) @@ -0,0 +1,343 @@ +Index: madwifi-trunk-r3314/ath/if_ath.c +=================================================================== +--- madwifi-trunk-r3314.orig/ath/if_ath.c ++++ madwifi-trunk-r3314/ath/if_ath.c +@@ -6446,6 +6446,7 @@ + int type; + u_int phyerr; + u_int processed = 0, early_stop = 0; ++ u_int mic_fail = 0; + + DPRINTF(sc, ATH_DEBUG_RX_PROC, "invoked\n"); + process_rx_again: +@@ -6547,24 +6548,8 @@ + } + if (rs->rs_status & HAL_RXERR_MIC) { + sc->sc_stats.ast_rx_badmic++; +- /* +- * Do minimal work required to hand off +- * the 802.11 header for notification. +- */ +- /* XXX frag's and QoS frames */ +- if (len >= sizeof (struct ieee80211_frame)) { +- bus_dma_sync_single(sc->sc_bdev, +- bf->bf_skbaddr, len, +- BUS_DMA_FROMDEVICE); +-#if 0 +-/* XXX revalidate MIC, lookup ni to find VAP */ +- ieee80211_notify_michael_failure(ic, +- (struct ieee80211_frame *)skb->data, +- sc->sc_splitmic ? +- rs->rs_keyix - 32 : rs->rs_keyix +- ); +-#endif +- } ++ mic_fail = 1; ++ goto rx_accept; + } + /* + * Reject error frames if we have no vaps that +@@ -6603,8 +6588,9 @@ + /* + * Finished monitor mode handling, now reject + * error frames before passing to other vaps ++ * Ignore MIC failures here, as we need to recheck them + */ +- if (rs->rs_status != 0) { ++ if (rs->rs_status & ~(HAL_RXERR_MIC | HAL_RXERR_DECRYPT)) { + ieee80211_dev_kfree_skb(&skb); + goto rx_next; + } +@@ -6612,6 +6598,26 @@ + /* remove the CRC */ + skb_trim(skb, skb->len - IEEE80211_CRC_LEN); + ++ if (mic_fail) { ++ /* Ignore control frames which are reported with mic error */ ++ if ((((struct ieee80211_frame *)skb->data)->i_fc[0] & ++ IEEE80211_FC0_TYPE_MASK) == IEEE80211_FC0_TYPE_CTL) ++ goto drop_micfail; ++ ++ ni = ieee80211_find_rxnode(ic, (const struct ieee80211_frame_min *) skb->data); ++ ++ if (ni && ni->ni_table) { ++ ieee80211_check_mic(ni, skb); ++ ieee80211_unref_node(&ni); ++ } ++ ++drop_micfail: ++ dev_kfree_skb_any(skb); ++ skb = NULL; ++ mic_fail = 0; ++ goto rx_next; ++ } ++ + /* + * From this point on we assume the frame is at least + * as large as ieee80211_frame_min; verify that. +@@ -6624,6 +6630,7 @@ + goto rx_next; + } + ++ /* MIC failure. Drop the packet in any case */ + /* + * Normal receive. + */ +Index: madwifi-trunk-r3314/net80211/ieee80211_crypto_ccmp.c +=================================================================== +--- madwifi-trunk-r3314.orig/net80211/ieee80211_crypto_ccmp.c ++++ madwifi-trunk-r3314/net80211/ieee80211_crypto_ccmp.c +@@ -73,7 +73,7 @@ + static int ccmp_encap(struct ieee80211_key *, struct sk_buff *, u_int8_t); + static int ccmp_decap(struct ieee80211_key *, struct sk_buff *, int); + static int ccmp_enmic(struct ieee80211_key *, struct sk_buff *, int); +-static int ccmp_demic(struct ieee80211_key *, struct sk_buff *, int); ++static int ccmp_demic(struct ieee80211_key *, struct sk_buff *, int, int); + + static const struct ieee80211_cipher ccmp = { + .ic_name = "AES-CCM", +@@ -308,7 +308,7 @@ + * Verify and strip MIC from the frame. + */ + static int +-ccmp_demic(struct ieee80211_key *k, struct sk_buff *skb, int hdrlen) ++ccmp_demic(struct ieee80211_key *k, struct sk_buff *skb, int hdrlen, int force) + { + return 1; + } +Index: madwifi-trunk-r3314/net80211/ieee80211_crypto.h +=================================================================== +--- madwifi-trunk-r3314.orig/net80211/ieee80211_crypto.h ++++ madwifi-trunk-r3314/net80211/ieee80211_crypto.h +@@ -145,7 +145,7 @@ + int (*ic_encap)(struct ieee80211_key *, struct sk_buff *, u_int8_t); + int (*ic_decap)(struct ieee80211_key *, struct sk_buff *, int); + int (*ic_enmic)(struct ieee80211_key *, struct sk_buff *, int); +- int (*ic_demic)(struct ieee80211_key *, struct sk_buff *, int); ++ int (*ic_demic)(struct ieee80211_key *, struct sk_buff *, int, int); + }; + extern const struct ieee80211_cipher ieee80211_cipher_none; + +@@ -163,10 +163,10 @@ + */ + static __inline int + ieee80211_crypto_demic(struct ieee80211vap *vap, struct ieee80211_key *k, +- struct sk_buff *skb, int hdrlen) ++ struct sk_buff *skb, int hdrlen, int force) + { + const struct ieee80211_cipher *cip = k->wk_cipher; +- return (cip->ic_miclen > 0 ? cip->ic_demic(k, skb, hdrlen) : 1); ++ return (cip->ic_miclen > 0 ? cip->ic_demic(k, skb, hdrlen, force) : 1); + } + + /* +Index: madwifi-trunk-r3314/net80211/ieee80211_crypto_none.c +=================================================================== +--- madwifi-trunk-r3314.orig/net80211/ieee80211_crypto_none.c ++++ madwifi-trunk-r3314/net80211/ieee80211_crypto_none.c +@@ -52,7 +52,7 @@ + static int none_encap(struct ieee80211_key *, struct sk_buff *, u_int8_t); + static int none_decap(struct ieee80211_key *, struct sk_buff *, int); + static int none_enmic(struct ieee80211_key *, struct sk_buff *, int); +-static int none_demic(struct ieee80211_key *, struct sk_buff *, int); ++static int none_demic(struct ieee80211_key *, struct sk_buff *, int, int); + + const struct ieee80211_cipher ieee80211_cipher_none = { + .ic_name = "NONE", +@@ -137,7 +137,7 @@ + } + + static int +-none_demic(struct ieee80211_key *k, struct sk_buff *skb, int hdrlen) ++none_demic(struct ieee80211_key *k, struct sk_buff *skb, int hdrlen, int force) + { + struct ieee80211vap *vap = k->wk_private; + +Index: madwifi-trunk-r3314/net80211/ieee80211_crypto_tkip.c +=================================================================== +--- madwifi-trunk-r3314.orig/net80211/ieee80211_crypto_tkip.c ++++ madwifi-trunk-r3314/net80211/ieee80211_crypto_tkip.c +@@ -57,7 +57,7 @@ + static int tkip_encap(struct ieee80211_key *, struct sk_buff *, u_int8_t); + static int tkip_enmic(struct ieee80211_key *, struct sk_buff *, int); + static int tkip_decap(struct ieee80211_key *, struct sk_buff *, int); +-static int tkip_demic(struct ieee80211_key *, struct sk_buff *, int); ++static int tkip_demic(struct ieee80211_key *, struct sk_buff *, int, int); + + static const struct ieee80211_cipher tkip = { + .ic_name = "TKIP", +@@ -339,7 +339,7 @@ + * Verify and strip MIC from the frame. + */ + static int +-tkip_demic(struct ieee80211_key *k, struct sk_buff *skb0, int hdrlen) ++tkip_demic(struct ieee80211_key *k, struct sk_buff *skb0, int hdrlen, int force) + { + struct tkip_ctx *ctx = k->wk_private; + struct sk_buff *skb; +@@ -355,7 +355,7 @@ + } + wh = (struct ieee80211_frame *) skb0->data; + /* NB: skb left pointing at last in chain */ +- if (k->wk_flags & IEEE80211_KEY_SWMIC) { ++ if ((k->wk_flags & IEEE80211_KEY_SWMIC) || force) { + struct ieee80211vap *vap = ctx->tc_vap; + u8 mic[IEEE80211_WEP_MICLEN]; + u8 mic0[IEEE80211_WEP_MICLEN]; +Index: madwifi-trunk-r3314/net80211/ieee80211_crypto_wep.c +=================================================================== +--- madwifi-trunk-r3314.orig/net80211/ieee80211_crypto_wep.c ++++ madwifi-trunk-r3314/net80211/ieee80211_crypto_wep.c +@@ -54,7 +54,7 @@ + static int wep_encap(struct ieee80211_key *, struct sk_buff *, u_int8_t); + static int wep_decap(struct ieee80211_key *, struct sk_buff *, int); + static int wep_enmic(struct ieee80211_key *, struct sk_buff *, int); +-static int wep_demic(struct ieee80211_key *, struct sk_buff *, int); ++static int wep_demic(struct ieee80211_key *, struct sk_buff *, int, int); + + static const struct ieee80211_cipher wep = { + .ic_name = "WEP", +@@ -244,7 +244,7 @@ + * Verify and strip MIC from the frame. + */ + static int +-wep_demic(struct ieee80211_key *k, struct sk_buff *skb, int hdrlen) ++wep_demic(struct ieee80211_key *k, struct sk_buff *skb, int hdrlen, int force) + { + return 1; + } +Index: madwifi-trunk-r3314/net80211/ieee80211_input.c +=================================================================== +--- madwifi-trunk-r3314.orig/net80211/ieee80211_input.c ++++ madwifi-trunk-r3314/net80211/ieee80211_input.c +@@ -669,7 +669,7 @@ + * Next strip any MSDU crypto bits. + */ + if (key != NULL && +- !ieee80211_crypto_demic(vap, key, skb, hdrspace)) { ++ !ieee80211_crypto_demic(vap, key, skb, hdrspace, 0)) { + IEEE80211_DISCARD_MAC(vap, IEEE80211_MSG_INPUT, + ni->ni_macaddr, "data", "%s", "demic error"); + IEEE80211_NODE_STAT(ni, rx_demicfail); +@@ -4293,6 +4293,47 @@ + } + #endif + ++/* ++ * Process a frame w/ hw detected MIC failure. ++ * The frame will be dropped in any case. ++ */ ++void ++ieee80211_check_mic(struct ieee80211_node *ni, struct sk_buff *skb) ++{ ++ struct ieee80211vap *vap = ni->ni_vap; ++ ++ struct ieee80211_frame *wh; ++ struct ieee80211_key *key; ++ int hdrspace; ++ struct ieee80211com *ic = vap->iv_ic; ++ ++ if (skb->len < sizeof(struct ieee80211_frame_min)) { ++ IEEE80211_DISCARD_MAC(vap, IEEE80211_MSG_ANY, ++ ni->ni_macaddr, NULL, ++ "too short (1): len %u", skb->len); ++ vap->iv_stats.is_rx_tooshort++; ++ return; ++ } ++ ++ wh = (struct ieee80211_frame *)skb->data; ++ ++ hdrspace = ieee80211_hdrspace(ic, wh); ++ key = ieee80211_crypto_decap(ni, skb, hdrspace); ++ if (key == NULL) { ++ /* NB: stats+msgs handled in crypto_decap */ ++ IEEE80211_NODE_STAT(ni, rx_wepfail); ++ return; ++ } ++ ++ if (!ieee80211_crypto_demic(vap, key, skb, hdrspace, 1)) { ++ IEEE80211_DISCARD_MAC(vap, IEEE80211_MSG_INPUT, ++ ni->ni_macaddr, "data", "%s", "demic error"); ++ IEEE80211_NODE_STAT(ni, rx_demicfail); ++ } ++ return; ++} ++EXPORT_SYMBOL(ieee80211_check_mic); ++ + #ifdef IEEE80211_DEBUG + /* + * Debugging support. +Index: madwifi-trunk-r3314/net80211/ieee80211_proto.h +=================================================================== +--- madwifi-trunk-r3314.orig/net80211/ieee80211_proto.h ++++ madwifi-trunk-r3314/net80211/ieee80211_proto.h +@@ -90,6 +90,7 @@ + void ieee80211_set11gbasicrates(struct ieee80211_rateset *, enum ieee80211_phymode); + enum ieee80211_phymode ieee80211_get11gbasicrates(struct ieee80211_rateset *); + void ieee80211_send_pspoll(struct ieee80211_node *); ++void ieee80211_check_mic(struct ieee80211_node *, struct sk_buff *); + + /* + * Return the size of the 802.11 header for a management or data frame. +Index: madwifi-trunk-r3314/net80211/ieee80211_linux.c +=================================================================== +--- madwifi-trunk-r3314.orig/net80211/ieee80211_linux.c ++++ madwifi-trunk-r3314/net80211/ieee80211_linux.c +@@ -337,8 +337,8 @@ + /* TODO: needed parameters: count, keyid, key type, src address, TSC */ + snprintf(buf, sizeof(buf), "%s(keyid=%d %scast addr=" MAC_FMT ")", tag, + k->wk_keyix, +- IEEE80211_IS_MULTICAST(wh->i_addr1) ? "broad" : "uni", +- MAC_ADDR(wh->i_addr1)); ++ IEEE80211_IS_MULTICAST(wh->i_addr2) ? "broad" : "uni", ++ MAC_ADDR(wh->i_addr2)); + memset(&wrqu, 0, sizeof(wrqu)); + wrqu.data.length = strlen(buf); + wireless_send_event(dev, IWEVCUSTOM, &wrqu, buf); +Index: madwifi-trunk-r3314/net80211/ieee80211_output.c +=================================================================== +--- madwifi-trunk-r3314.orig/net80211/ieee80211_output.c ++++ madwifi-trunk-r3314/net80211/ieee80211_output.c +@@ -1074,13 +1074,16 @@ + cip = (struct ieee80211_cipher *) key->wk_cipher; + ciphdrsize = cip->ic_header; + tailsize += (cip->ic_trailer + cip->ic_miclen); ++ ++ /* add the 8 bytes MIC length */ ++ if (cip->ic_cipher == IEEE80211_CIPHER_TKIP) ++ pktlen += IEEE80211_WEP_MICLEN; + } + + pdusize = vap->iv_fragthreshold - (hdrsize_nopad + ciphdrsize); + fragcnt = *framecnt = +- ((pktlen - (hdrsize_nopad + ciphdrsize)) / pdusize) + +- (((pktlen - (hdrsize_nopad + ciphdrsize)) % +- pdusize == 0) ? 0 : 1); ++ ((pktlen - hdrsize_nopad) / pdusize) + ++ (((pktlen - hdrsize_nopad) % pdusize == 0) ? 0 : 1); + + /* + * Allocate sk_buff for each subsequent fragment; First fragment +Index: madwifi-trunk-r3314/net80211/ieee80211_node.c +=================================================================== +--- madwifi-trunk-r3314.orig/net80211/ieee80211_node.c ++++ madwifi-trunk-r3314/net80211/ieee80211_node.c +@@ -2264,11 +2264,13 @@ + /* From this point onwards we can no longer find the node, + * so no more references are generated + */ +- ieee80211_remove_wds_addr(nt, ni->ni_macaddr); +- ieee80211_del_wds_node(nt, ni); +- IEEE80211_NODE_TABLE_LOCK_IRQ(nt); +- node_table_leave_locked(nt, ni); +- IEEE80211_NODE_TABLE_UNLOCK_IRQ(nt); ++ if (nt) { ++ ieee80211_remove_wds_addr(nt, ni->ni_macaddr); ++ ieee80211_del_wds_node(nt, ni); ++ IEEE80211_NODE_TABLE_LOCK_IRQ(nt); ++ node_table_leave_locked(nt, ni); ++ IEEE80211_NODE_TABLE_UNLOCK_IRQ(nt); ++ } + + /* + * If node wasn't previously associated all Added: trunk/marvell_owrt_8.09/package/madwifi/patches/310-noise_get.patch =================================================================== --- trunk/marvell_owrt_8.09/package/madwifi/patches/310-noise_get.patch (rev 0) +++ trunk/marvell_owrt_8.09/package/madwifi/patches/310-noise_get.patch 2009-08-26 18:33:09 UTC (rev 88) @@ -0,0 +1,61 @@ +Index: madwifi-trunk-r3314/ath/if_ath.c +=================================================================== +--- madwifi-trunk-r3314.orig/ath/if_ath.c ++++ madwifi-trunk-r3314/ath/if_ath.c +@@ -1695,8 +1695,6 @@ + * get to reality. This value is used in monitor mode and by tools like + * Wireshark and Kismet. + */ +- ic->ic_channoise = ath_hal_get_channel_noise(ah, &(sc->sc_curchan)); +- + ATH_RXBUF_LOCK_IRQ(sc); + if (sc->sc_rxbufcur == NULL) + sc->sc_rxbufcur = STAILQ_FIRST(&sc->sc_rxbuf); +@@ -8966,6 +8964,7 @@ + sc->sc_curchan.channel); + sc->sc_stats.ast_per_calfail++; + } ++ ic->ic_channoise = ath_hal_get_channel_noise(ah, &(sc->sc_curchan)); + + ath_hal_process_noisefloor(ah); + if (isIQdone == AH_TRUE) { +@@ -9034,6 +9033,7 @@ + struct ath_softc *sc = dev->priv; + + (void) ath_chan_set(sc, ic->ic_curchan); ++ ic->ic_channoise = ath_hal_get_channel_noise(sc->sc_ah, &(sc->sc_curchan)); + /* + * If we are returning to our bss channel then mark state + * so the next recv'd beacon's TSF will be used to sync the +@@ -9302,6 +9302,7 @@ + } + + ath_hal_process_noisefloor(ah); ++ ic->ic_channoise = ath_hal_get_channel_noise(ah, &(sc->sc_curchan)); + /* + * Reset rssi stats; maybe not the best place... + */ +Index: madwifi-trunk-r3314/net80211/ieee80211_wireless.c +=================================================================== +--- madwifi-trunk-r3314.orig/net80211/ieee80211_wireless.c ++++ madwifi-trunk-r3314/net80211/ieee80211_wireless.c +@@ -4358,6 +4358,7 @@ + si->isi_state = ni->ni_flags; + si->isi_authmode = ni->ni_authmode; + si->isi_rssi = ic->ic_node_getrssi(ni); ++ si->isi_noise = ic->ic_channoise; + si->isi_capinfo = ni->ni_capinfo; + si->isi_athflags = ni->ni_ath_flags; + si->isi_erp = ni->ni_erp; +Index: madwifi-trunk-r3314/net80211/ieee80211_ioctl.h +=================================================================== +--- madwifi-trunk-r3314.orig/net80211/ieee80211_ioctl.h ++++ madwifi-trunk-r3314/net80211/ieee80211_ioctl.h +@@ -311,6 +311,7 @@ + u_int16_t isi_state; /* state flags */ + u_int8_t isi_authmode; /* authentication algorithm */ + u_int8_t isi_rssi; ++ int8_t isi_noise; + u_int16_t isi_capinfo; /* capabilities */ + u_int8_t isi_athflags; /* Atheros capabilities */ + u_int8_t isi_erp; /* ERP element */ Added: trunk/marvell_owrt_8.09/package/madwifi/patches/311-bssid_alloc.patch =================================================================== --- trunk/marvell_owrt_8.09/package/madwifi/patches/311-bssid_alloc.patch (rev 0) +++ trunk/marvell_owrt_8.09/package/madwifi/patches/311-bssid_alloc.patch 2009-08-26 18:33:09 UTC (rev 88) @@ -0,0 +1,13 @@ +Index: madwifi-trunk-r3314/ath/if_ath.c +=================================================================== +--- madwifi-trunk-r3314.orig/ath/if_ath.c ++++ madwifi-trunk-r3314/ath/if_ath.c +@@ -1354,7 +1354,7 @@ + TAILQ_FOREACH(v, &ic->ic_vaps, iv_next) + id_mask |= (1 << ATH_GET_VAP_ID(v->iv_myaddr)); + +- for (id = 1; id < ath_maxvaps; id++) { ++ for (id = 0; id < ath_maxvaps; id++) { + /* get the first available slot */ + if ((id_mask & (1 << id)) == 0) { + ATH_SET_VAP_BSSID(vap->iv_myaddr, id); Added: trunk/marvell_owrt_8.09/package/madwifi/patches/312-erpupdate.patch =================================================================== --- trunk/marvell_owrt_8.09/package/madwifi/patches/312-erpupdate.patch (rev 0) +++ trunk/marvell_owrt_8.09/package/madwifi/patches/312-erpupdate.patch 2009-08-26 18:33:09 UTC (rev 88) @@ -0,0 +1,74 @@ +Index: madwifi-trunk-r3314/net80211/ieee80211_beacon.c +=================================================================== +--- madwifi-trunk-r3314.orig/net80211/ieee80211_beacon.c ++++ madwifi-trunk-r3314/net80211/ieee80211_beacon.c +@@ -542,10 +542,10 @@ + vap->iv_flags &= ~IEEE80211_F_XRUPDATE; + } + #endif +- if ((ic->ic_flags_ext & IEEE80211_FEXT_ERPUPDATE) && ++ if ((vap->iv_flags_ext & IEEE80211_FEXT_ERPUPDATE) && + (bo->bo_erp != NULL)) { + (void)ieee80211_add_erp(bo->bo_erp, ic); +- ic->ic_flags_ext &= ~IEEE80211_FEXT_ERPUPDATE; ++ vap->iv_flags_ext &= ~IEEE80211_FEXT_ERPUPDATE; + } + } + /* if it is a mode change beacon for dynamic turbo case */ +Index: madwifi-trunk-r3314/net80211/ieee80211_input.c +=================================================================== +--- madwifi-trunk-r3314.orig/net80211/ieee80211_input.c ++++ madwifi-trunk-r3314/net80211/ieee80211_input.c +@@ -3431,9 +3431,12 @@ + /* Assume no ERP IE == 11b AP */ + if ((!has_erp || (has_erp && (scan.erp & IEEE80211_ERP_NON_ERP_PRESENT))) && + !(ic->ic_flags & IEEE80211_F_USEPROT)) { ++ struct ieee80211vap *tmpvap; + + ic->ic_flags |= IEEE80211_F_USEPROT; +- ic->ic_flags_ext |= IEEE80211_FEXT_ERPUPDATE; ++ TAILQ_FOREACH(tmpvap, &ic->ic_vaps, iv_next) { ++ tmpvap->iv_flags_ext |= IEEE80211_FEXT_ERPUPDATE; ++ } + } + } + +Index: madwifi-trunk-r3314/net80211/ieee80211_node.c +=================================================================== +--- madwifi-trunk-r3314.orig/net80211/ieee80211_node.c ++++ madwifi-trunk-r3314/net80211/ieee80211_node.c +@@ -2025,8 +2025,12 @@ + } + + /* Update ERP element if this is first non ERP station */ +- if (ic->ic_nonerpsta == 1) +- ic->ic_flags_ext |= IEEE80211_FEXT_ERPUPDATE; ++ if (ic->ic_nonerpsta == 1) { ++ struct ieee80211vap *tmpvap; ++ TAILQ_FOREACH(tmpvap, &ic->ic_vaps, iv_next) { ++ tmpvap->iv_flags_ext |= IEEE80211_FEXT_ERPUPDATE; ++ } ++ } + } else + ni->ni_flags |= IEEE80211_NODE_ERP; + } +@@ -2229,6 +2233,8 @@ + IEEE80211_NOTE(vap, IEEE80211_MSG_ASSOC, ni, + "non-ERP station leaves, count now %d", ic->ic_nonerpsta); + if (ic->ic_nonerpsta == 0) { ++ struct ieee80211vap *tmpvap; ++ + IEEE80211_DPRINTF(vap, IEEE80211_MSG_ASSOC, + "%s: disable use of protection\n", __func__); + ic->ic_flags &= ~IEEE80211_F_USEPROT; +@@ -2240,7 +2246,9 @@ + ic->ic_flags |= IEEE80211_F_SHPREAMBLE; + ic->ic_flags &= ~IEEE80211_F_USEBARKER; + } +- ic->ic_flags_ext |= IEEE80211_FEXT_ERPUPDATE; ++ TAILQ_FOREACH(tmpvap, &ic->ic_vaps, iv_next) { ++ tmpvap->iv_flags_ext |= IEEE80211_FEXT_ERPUPDATE; ++ } + } + } + } Added: trunk/marvell_owrt_8.09/package/madwifi/patches/317-bmask.patch =================================================================== --- trunk/marvell_owrt_8.09/package/madwifi/patches/317-bmask.patch (rev 0) +++ trunk/marvell_owrt_8.09/package/madwifi/patches/317-bmask.patch 2009-08-26 18:33:09 UTC (rev 88) @@ -0,0 +1,15 @@ +Index: madwifi-trunk-r3314/ath/if_ath.c +=================================================================== +--- madwifi-trunk-r3314.orig/ath/if_ath.c ++++ madwifi-trunk-r3314/ath/if_ath.c +@@ -8680,6 +8680,10 @@ + + sc->sc_rxbufcur = NULL; + ++ /* configure bssid mask */ ++ if (sc->sc_hasbmask) ++ ath_hal_setbssidmask(ah, sc->sc_bssidmask); ++ + bf = STAILQ_FIRST(&sc->sc_rxbuf); + ath_hal_putrxbuf(ah, bf->bf_daddr); + ath_hal_rxena(ah); /* enable recv descriptors */ Added: trunk/marvell_owrt_8.09/package/madwifi/patches/323-dfs_optional.patch =================================================================== --- trunk/marvell_owrt_8.09/package/madwifi/patches/323-dfs_optional.patch (rev 0) +++ trunk/marvell_owrt_8.09/package/madwifi/patches/323-dfs_optional.patch 2009-08-26 18:33:09 UTC (rev 88) @@ -0,0 +1,42 @@ +Index: madwifi-trunk-r3314/ath/if_ath.c +=================================================================== +--- madwifi-trunk-r3314.orig/ath/if_ath.c ++++ madwifi-trunk-r3314/ath/if_ath.c +@@ -1774,17 +1774,14 @@ + * may have occurred in the intervening timeframe. */ + bf->bf_channoise = ic->ic_channoise; + +- if (rs->rs_status) { +- if ((HAL_RXERR_PHY == rs->rs_status) && +- (HAL_PHYERR_RADAR == +- (rs->rs_phyerr & 0x1f)) && +- (0 == (bf->bf_status & +- ATH_BUFSTATUS_RADAR_DONE))) { +- check_for_radar = 1; +- } +- /* Skip past the error now */ ++ if ((HAL_RXERR_PHY == rs->rs_status) && ++ (HAL_PHYERR_RADAR == (rs->rs_phyerr & 0x1f)) && ++ (0 == (bf->bf_status & ATH_BUFSTATUS_RADAR_DONE)) && ++ (ic->ic_flags & IEEE80211_F_DOTH)) ++ check_for_radar = 1; ++ ++ if (rs->rs_status) /* Skip past the error now */ + continue; +- } + + /* Prepare wireless header for examination */ + bus_dma_sync_single(sc->sc_bdev, bf->bf_skbaddr, +Index: madwifi-trunk-r3314/ath/if_ath_radar.c +=================================================================== +--- madwifi-trunk-r3314.orig/ath/if_ath_radar.c ++++ madwifi-trunk-r3314/ath/if_ath_radar.c +@@ -261,7 +261,7 @@ + unsigned int new_rxfilt = old_rxfilt; + + ath_hal_intrset(ah, old_ier & ~HAL_INT_GLOBAL); +- if (required) { ++ if ((required) && (ic->ic_flags & IEEE80211_F_DOTH)) { + new_radar |= AR5K_PHY_RADAR_ENABLE; + new_filter |= AR5K_AR5212_PHY_ERR_FIL_RADAR; + new_rxfilt |= (HAL_RX_FILTER_PHYERR | Added: trunk/marvell_owrt_8.09/package/madwifi/patches/324-alignment.patch =================================================================== --- trunk/marvell_owrt_8.09/package/madwifi/patches/324-alignment.patch (rev 0) +++ trunk/marvell_owrt_8.09/package/madwifi/patches/324-alignment.patch 2009-08-26 18:33:09 UTC (rev 88) @@ -0,0 +1,21 @@ +Index: madwifi-trunk-r3314/net80211/ieee80211_input.c +=================================================================== +--- madwifi-trunk-r3314.orig/net80211/ieee80211_input.c ++++ madwifi-trunk-r3314/net80211/ieee80211_input.c +@@ -1275,14 +1275,8 @@ + eh->ether_type = ether_type; + + if (!ALIGNED_POINTER(skb->data + sizeof(*eh), u_int32_t)) { +- struct sk_buff *tskb; +- +- /* XXX: does this always work? */ +- tskb = skb_copy(skb, GFP_ATOMIC); +- if (tskb) +- ieee80211_skb_copy_noderef(skb, tskb); +- ieee80211_dev_kfree_skb(&skb); +- skb = tskb; ++ memmove(skb->data - 2, skb->data, skb->len); ++ skb->data -= 2; + } + return skb; + } Added: trunk/marvell_owrt_8.09/package/madwifi/patches/325-channel_spam.patch =================================================================== --- trunk/marvell_owrt_8.09/package/madwifi/patches/325-channel_spam.patch (rev 0) +++ trunk/marvell_owrt_8.09/package/madwifi/patches/325-channel_spam.patch 2009-08-26 18:33:09 UTC (rev 88) @@ -0,0 +1,30 @@ +Index: madwifi-trunk-r3314/ath/if_ath.c +=================================================================== +--- madwifi-trunk-r3314.orig/ath/if_ath.c ++++ madwifi-trunk-r3314/ath/if_ath.c +@@ -9783,7 +9783,9 @@ + /* + * Convert HAL channels to ieee80211 ones. + */ ++#ifdef AR_DEBUG + IPRINTF(sc, "HAL returned %d channels.\n", nchan); ++#endif + for (i = 0; i < nchan; i++) { + HAL_CHANNEL *c = &chans[i]; + struct ieee80211_channel *ichan = &ic->ic_channels[i]; +@@ -9810,6 +9812,7 @@ + ic->ic_chan_non_occupy[i].tv_sec = 0; + ic->ic_chan_non_occupy[i].tv_usec = 0; + ++#ifdef AR_DEBUG + IPRINTF(sc, "Channel %3d (%4d MHz) Max Tx Power %d dBm%s " + "[%d hw %d reg] Flags%s%s%s%s%s%s%s%s%s%s%s%s%" + "s%s%s%s%s%s%s%s%s%s%s%s\n", +@@ -9898,6 +9901,7 @@ + (c->privFlags & 0x0080 ? + " PF & (1 << 7)" : "") + ); ++#endif + } + ic->ic_nchans = nchan; + kfree(chans); Added: trunk/marvell_owrt_8.09/package/madwifi/patches/327-queue.patch =================================================================== --- trunk/marvell_owrt_8.09/package/madwifi/patches/327-queue.patch (rev 0) +++ trunk/marvell_owrt_8.09/package/madwifi/patches/327-queue.patch 2009-08-26 18:33:09 UTC (rev 88) @@ -0,0 +1,44 @@ +Index: madwifi-trunk-r3314/ath/if_ath.c +=================================================================== +--- madwifi-trunk-r3314.orig/ath/if_ath.c ++++ madwifi-trunk-r3314/ath/if_ath.c +@@ -8431,8 +8431,6 @@ + ath_hal_intrset(sc->sc_ah, sc->sc_imask); + local_irq_restore(flags); + +- netif_wake_queue(dev); +- + if (sc->sc_softled) + ath_led_event(sc, ATH_LED_TX); + } +@@ -8479,8 +8477,6 @@ + ath_hal_intrset(sc->sc_ah, sc->sc_imask); + local_irq_restore(flags); + +- netif_wake_queue(dev); +- + if (sc->sc_softled) + ath_led_event(sc, ATH_LED_TX); + } +@@ -8513,8 +8509,6 @@ + ath_hal_intrset(sc->sc_ah, sc->sc_imask); + local_irq_restore(flags); + +- netif_wake_queue(dev); +- + if (sc->sc_softled) + ath_led_event(sc, ATH_LED_TX); + } +Index: madwifi-trunk-r3314/net80211/ieee80211_input.c +=================================================================== +--- madwifi-trunk-r3314.orig/net80211/ieee80211_input.c ++++ madwifi-trunk-r3314/net80211/ieee80211_input.c +@@ -1132,7 +1132,7 @@ + (vap->iv_flags & IEEE80211_F_NOBRIDGE) == 0) { + struct sk_buff *skb1 = NULL; + +- if (ETHER_IS_MULTICAST(eh->ether_dhost)) { ++ if (ETHER_IS_MULTICAST(eh->ether_dhost) && !netif_queue_stopped(dev)) { + /* Create a SKB for the BSS to send out. */ + skb1 = skb_copy(skb, GFP_ATOMIC); + if (skb1) Added: trunk/marvell_owrt_8.09/package/madwifi/patches/330-beaconcal.patch =================================================================== --- trunk/marvell_owrt_8.09/package/madwifi/patches/330-beaconcal.patch (rev 0) +++ trunk/marvell_owrt_8.09/package/madwifi/patches/330-beaconcal.patch 2009-08-26 18:33:09 UTC (rev 88) @@ -0,0 +1,168 @@ +Index: madwifi-trunk-r3314/ath/if_ath.c +=================================================================== +--- madwifi-trunk-r3314.orig/ath/if_ath.c ++++ madwifi-trunk-r3314/ath/if_ath.c +@@ -397,6 +397,7 @@ + static int maxvaps = -1; + static int outdoor = -1; + static int xchanmode = -1; ++static int beacon_cal = 1; + + static const char *hal_status_desc[] = { + "No error", +@@ -422,6 +423,7 @@ + }; + + #if (LINUX_VERSION_CODE < KERNEL_VERSION(2,5,52)) ++MODULE_PARM(beacon_cal, "i"); + MODULE_PARM(countrycode, "i"); + MODULE_PARM(maxvaps, "i"); + MODULE_PARM(outdoor, "i"); +@@ -434,6 +436,7 @@ + MODULE_PARM(ratectl, "s"); + #else + #include ++module_param(beacon_cal, int, 0600); + module_param(countrycode, int, 0600); + module_param(maxvaps, int, 0600); + module_param(outdoor, int, 0600); +@@ -2598,7 +2601,8 @@ + } + if (!sc->sc_invalid) { + del_timer_sync(&sc->sc_dfs_cac_timer); +- del_timer_sync(&sc->sc_cal_ch); ++ if (!sc->sc_beacon_cal) ++ del_timer_sync(&sc->sc_cal_ch); + } + ath_draintxq(sc); + if (!sc->sc_invalid) { +@@ -2615,6 +2619,20 @@ + return 0; + } + ++static void ath_set_beacon_cal(struct ath_softc *sc, int val) ++{ ++ if (sc->sc_beacon_cal == !!val) ++ return; ++ ++ if (val) { ++ del_timer_sync(&sc->sc_cal_ch); ++ } else { ++ sc->sc_cal_ch.expires = jiffies + (ath_calinterval * HZ); ++ add_timer(&sc->sc_cal_ch); ++ } ++ sc->sc_beacon_cal = !!val && beacon_cal; ++} ++ + /* + * Stop the device, grabbing the top-level lock to protect + * against concurrent entry through ath_init (which can happen +@@ -2740,6 +2758,12 @@ + HAL_STATUS status; + + /* ++ * XXX: starting the calibration too early seems to lead to ++ * problems with the beacons. ++ */ ++ sc->sc_lastcal = jiffies; ++ ++ /* + * Convert to a HAL channel description with the flags + * constrained to reflect the current operating mode. + */ +@@ -5145,6 +5169,8 @@ + "Invoking ath_hal_txstart with sc_bhalq: %d\n", + sc->sc_bhalq); + ath_hal_txstart(ah, sc->sc_bhalq); ++ if (sc->sc_beacon_cal && (jiffies > sc->sc_lastcal + (ath_calinterval * HZ))) ++ ath_calibrate((unsigned long) sc->sc_dev); + + sc->sc_stats.ast_be_xmit++; /* XXX per-VAP? */ + } +@@ -5394,6 +5420,7 @@ + ath_hal_beacontimers(ah, &bs); + sc->sc_imask |= HAL_INT_BMISS; + ath_hal_intrset(ah, sc->sc_imask); ++ ath_set_beacon_cal(sc, 0); + } else { + ath_hal_intrset(ah, 0); + if (reset_tsf) +@@ -5405,8 +5432,11 @@ + */ + intval |= HAL_BEACON_ENA; + sc->sc_imask |= HAL_INT_SWBA; ++ ath_set_beacon_cal(sc, 1); + ath_beaconq_config(sc); +- } ++ } else ++ ath_set_beacon_cal(sc, 0); ++ + #ifdef ATH_SUPERG_DYNTURBO + ath_beacon_dturbo_config(vap, intval & + ~(HAL_BEACON_RESET_TSF | HAL_BEACON_ENA)); +@@ -8870,6 +8900,9 @@ + /* Enter DFS wait period */ + mod_timer(&sc->sc_dfs_cac_timer, + jiffies + (sc->sc_dfs_cac_period * HZ)); ++ ++ /* This is a good time to start a calibration */ ++ ath_set_beacon_cal(sc, 1); + } + /* + * re configure beacons when it is a turbo mode switch. +@@ -8979,8 +9012,11 @@ + sc->sc_curchan.channel, sc->sc_curchan.channelFlags, + isIQdone ? "done" : "not done"); + +- sc->sc_cal_ch.expires = jiffies + (ath_calinterval * HZ); +- add_timer(&sc->sc_cal_ch); ++ sc->sc_lastcal = jiffies; ++ if (!sc->sc_beacon_cal) { ++ sc->sc_cal_ch.expires = jiffies + (ath_calinterval * HZ); ++ add_timer(&sc->sc_cal_ch); ++ } + } + + static void +@@ -9087,7 +9123,8 @@ + ieee80211_state_name[vap->iv_state], + ieee80211_state_name[nstate]); + +- del_timer(&sc->sc_cal_ch); /* periodic calibration timer */ ++ if (!sc->sc_beacon_cal) ++ del_timer(&sc->sc_cal_ch); /* periodic calibration timer */ + + ath_hal_setledstate(ah, leds[nstate]); /* set LED */ + netif_stop_queue(dev); /* before we do anything else */ +@@ -9312,7 +9349,8 @@ + "VAP -> DFSWAIT_PENDING \n"); + /* start calibration timer with a really small value + * 1/10 sec */ +- mod_timer(&sc->sc_cal_ch, jiffies + (HZ/10)); ++ if (!sc->sc_beacon_cal) ++ mod_timer(&sc->sc_cal_ch, jiffies + (HZ/10)); + /* wake the receiver */ + netif_wake_queue(dev); + /* don't do the other usual stuff... */ +@@ -9355,7 +9393,7 @@ + error = avp->av_newstate(vap, nstate, arg); + + /* Finally, start any timers. */ +- if (nstate == IEEE80211_S_RUN) { ++ if (nstate == IEEE80211_S_RUN && !sc->sc_beacon_cal) { + /* start periodic recalibration timer */ + mod_timer(&sc->sc_cal_ch, jiffies + (ath_calinterval * HZ)); + } +Index: madwifi-trunk-r3314/ath/if_athvar.h +=================================================================== +--- madwifi-trunk-r3314.orig/ath/if_athvar.h ++++ madwifi-trunk-r3314/ath/if_athvar.h +@@ -778,6 +778,8 @@ + struct ieee80211vap **sc_bslot; /* beacon xmit slots */ + int sc_bnext; /* next slot for beacon xmit */ + ++ int sc_beacon_cal; /* use beacon timer for calibration */ ++ u_int64_t sc_lastcal; /* last time the calibration was performed */ + struct timer_list sc_cal_ch; /* calibration timer */ + HAL_NODE_STATS sc_halstats; /* station-mode rssi stats */ + Added: trunk/marvell_owrt_8.09/package/madwifi/patches/331-memory_alloc.patch =================================================================== --- trunk/marvell_owrt_8.09/package/madwifi/patches/331-memory_alloc.patch (rev 0) +++ trunk/marvell_owrt_8.09/package/madwifi/patches/331-memory_alloc.patch 2009-08-26 18:33:09 UTC (rev 88) @@ -0,0 +1,38 @@ +Index: madwifi-trunk-r3314/ath/if_ath.c +=================================================================== +--- madwifi-trunk-r3314.orig/ath/if_ath.c ++++ madwifi-trunk-r3314/ath/if_ath.c +@@ -3318,17 +3318,18 @@ + * without affecting any other bridge ports. */ + if (skb_cloned(skb)) { + /* Remember the original SKB so we can free up our references */ +- struct sk_buff *skb_orig = skb; +- skb = skb_copy(skb, GFP_ATOMIC); +- if (skb == NULL) { ++ struct sk_buff *skb_new; ++ skb_new = skb_copy(skb, GFP_ATOMIC); ++ if (skb_new == NULL) { + DPRINTF(sc, ATH_DEBUG_XMIT, + "Dropping; skb_copy failure.\n"); + /* No free RAM, do not requeue! */ + goto hardstart_fail; + } +- ieee80211_skb_copy_noderef(skb_orig, skb); +- ieee80211_dev_kfree_skb(&skb_orig); +- } ++ ieee80211_skb_copy_noderef(skb, skb_new); ++ ieee80211_dev_kfree_skb(&skb); ++ skb = skb_new; ++ } + eh = (struct ether_header *)skb->data; + + #ifdef ATH_SUPERG_FF +@@ -3599,6 +3600,8 @@ + sc->sc_stats.ast_tx_mgmt++; + return 0; + bad: ++ if (skb) ++ ieee80211_dev_kfree_skb(&skb); + ath_return_txbuf(sc, &bf); + return error; + } Added: trunk/marvell_owrt_8.09/package/madwifi/patches/332-reset_beacons.patch =================================================================== --- trunk/marvell_owrt_8.09/package/madwifi/patches/332-reset_beacons.patch (rev 0) +++ trunk/marvell_owrt_8.09/package/madwifi/patches/332-reset_beacons.patch 2009-08-26 18:33:09 UTC (rev 88) @@ -0,0 +1,13 @@ +Index: madwifi-trunk-r3314/ath/if_ath.c +=================================================================== +--- madwifi-trunk-r3314.orig/ath/if_ath.c ++++ madwifi-trunk-r3314/ath/if_ath.c +@@ -8911,7 +8911,7 @@ + * re configure beacons when it is a turbo mode switch. + * HW seems to turn off beacons during turbo mode switch. + */ +- if (sc->sc_beacons && tswitch && !sc->sc_dfs_cac) ++ if (sc->sc_beacons && !sc->sc_dfs_cac) + ath_beacon_config(sc, NULL); + /* + * Re-enable interrupts. Added: trunk/marvell_owrt_8.09/package/madwifi/patches/333-apscan_mode.patch =================================================================== --- trunk/marvell_owrt_8.09/package/madwifi/patches/333-apscan_mode.patch (rev 0) +++ trunk/marvell_owrt_8.09/package/madwifi/patches/333-apscan_mode.patch 2009-08-26 18:33:09 UTC (rev 88) @@ -0,0 +1,17 @@ +Index: madwifi-trunk-r3314/net80211/ieee80211_scan_ap.c +=================================================================== +--- madwifi-trunk-r3314.orig/net80211/ieee80211_scan_ap.c ++++ madwifi-trunk-r3314/net80211/ieee80211_scan_ap.c +@@ -781,12 +781,6 @@ + /* break the loop as the subsequent chans won't be + * better */ + break; +- +- if (!IEEE80211_ARE_CHANS_SAME_MODE(c->chan, +- ic->ic_bsschan)) +- /* break the loop as the subsequent chans won't be +- * better */ +- break; + } + + if (sta_assoc != 0) { Added: trunk/marvell_owrt_8.09/package/madwifi/patches/334-input.patch =================================================================== --- trunk/marvell_owrt_8.09/package/madwifi/patches/334-input.patch (rev 0) +++ trunk/marvell_owrt_8.09/package/madwifi/patches/334-input.patch 2009-08-26 18:33:09 UTC (rev 88) @@ -0,0 +1,14 @@ +Index: madwifi-trunk-r3314/net80211/ieee80211_input.c +=================================================================== +--- madwifi-trunk-r3314.orig/net80211/ieee80211_input.c ++++ madwifi-trunk-r3314/net80211/ieee80211_input.c +@@ -950,6 +950,9 @@ + TAILQ_FOREACH(vap, &ic->ic_vaps, iv_next) { + struct sk_buff *skb1; + ++ if ((vap->iv_dev->flags & (IFF_UP|IFF_RUNNING)) != (IFF_UP|IFF_RUNNING)) ++ continue; ++ + if (TAILQ_NEXT(vap, iv_next) != NULL) { + skb1 = skb_copy(skb, GFP_ATOMIC); + if (skb1 == NULL) { Added: trunk/marvell_owrt_8.09/package/madwifi/patches/340-maxrate.patch =================================================================== --- trunk/marvell_owrt_8.09/package/madwifi/patches/340-maxrate.patch (rev 0) +++ trunk/marvell_owrt_8.09/package/madwifi/patches/340-maxrate.patch 2009-08-26 18:33:09 UTC (rev 88) @@ -0,0 +1,110 @@ +Index: madwifi-trunk-r3314/ath/if_ath.c +=================================================================== +--- madwifi-trunk-r3314.orig/ath/if_ath.c ++++ madwifi-trunk-r3314/ath/if_ath.c +@@ -1307,6 +1307,7 @@ + vap->iv_key_set = ath_key_set; + vap->iv_key_update_begin = ath_key_update_begin; + vap->iv_key_update_end = ath_key_update_end; ++ vap->iv_maxrateindex = 0; + if (sc->sc_default_ieee80211_debug) { + /* User specified defaults for new VAPs were provided, so + * use those (only). */ +Index: madwifi-trunk-r3314/ath_rate/minstrel/minstrel.c +=================================================================== +--- madwifi-trunk-r3314.orig/ath_rate/minstrel/minstrel.c ++++ madwifi-trunk-r3314/ath_rate/minstrel/minstrel.c +@@ -622,8 +622,12 @@ + return; + } + sn->static_rate_ndx = -1; ++ if (vap->iv_maxrateindex == 0 || ni->ni_rates.rs_nrates <= 0 ++ || vap->iv_maxrateindex > ni->ni_rates.rs_nrates) ++ sn->num_rates = ni->ni_rates.rs_nrates; ++ else ++ sn->num_rates = vap->iv_maxrateindex; + +- sn->num_rates = ni->ni_rates.rs_nrates; + for (x = 0; x < ni->ni_rates.rs_nrates; x++) { + sn->rs_rateattempts [x] = 0; + sn->rs_thisprob [x] = 0; +Index: madwifi-trunk-r3314/ath_rate/sample/sample.c +=================================================================== +--- madwifi-trunk-r3314.orig/ath_rate/sample/sample.c ++++ madwifi-trunk-r3314/ath_rate/sample/sample.c +@@ -835,7 +835,12 @@ + } + sn->static_rate_ndx = -1; + +- sn->num_rates = ni->ni_rates.rs_nrates; ++ if (vap->iv_maxrateindex == 0 || ni->ni_rates.rs_nrates <= 0 ++ || vap->iv_maxrateindex > ni->ni_rates.rs_nrates) ++ sn->num_rates = ni->ni_rates.rs_nrates; ++ else ++ sn->num_rates = vap->iv_maxrateindex; ++ + for (x = 0; x < ni->ni_rates.rs_nrates; x++) { + sn->rates[x].rate = ni->ni_rates.rs_rates[x] & IEEE80211_RATE_VAL; + sn->rates[x].rix = sc->sc_rixmap[sn->rates[x].rate]; +Index: madwifi-trunk-r3314/net80211/ieee80211_ioctl.h +=================================================================== +--- madwifi-trunk-r3314.orig/net80211/ieee80211_ioctl.h ++++ madwifi-trunk-r3314/net80211/ieee80211_ioctl.h +@@ -641,6 +641,7 @@ + FCC requires 30m, so that is the default. */ + IEEE80211_PARAM_BEACON_MISS_THRESH = 73, /* Beacon miss threshold (in beacons) */ + IEEE80211_PARAM_BEACON_MISS_THRESH_MS = 74, /* Beacon miss threshold (in ms) */ ++ IEEE80211_PARAM_MAXRATE = 75, /* Maximum rate (by table index) */ + }; + + #define SIOCG80211STATS (SIOCDEVPRIVATE+2) +Index: madwifi-trunk-r3314/net80211/ieee80211_var.h +=================================================================== +--- madwifi-trunk-r3314.orig/net80211/ieee80211_var.h ++++ madwifi-trunk-r3314/net80211/ieee80211_var.h +@@ -281,6 +281,7 @@ + struct ieee80211_spy iv_spy; /* IWSPY support */ + struct ieee80211_app_ie app_ie[IEEE80211_APPIE_NUM_OF_FRAME]; /* app-specified IEs by frame type */ + u_int32_t app_filter; /* filters which management frames are forwarded to app */ ++ int iv_maxrateindex; + }; + + /* Debug functions need the defintion of struct ieee80211vap because iv_debug +Index: madwifi-trunk-r3314/net80211/ieee80211_wireless.c +=================================================================== +--- madwifi-trunk-r3314.orig/net80211/ieee80211_wireless.c ++++ madwifi-trunk-r3314/net80211/ieee80211_wireless.c +@@ -2839,6 +2839,12 @@ + else + ic->ic_flags_ext &= ~IEEE80211_FEXT_MARKDFS; + break; ++ case IEEE80211_PARAM_MAXRATE: ++ if (value > 0) ++ vap->iv_maxrateindex = value; ++ else ++ vap->iv_maxrateindex = 0; ++ break; + #ifdef ATH_REVERSE_ENGINEERING + case IEEE80211_PARAM_DUMPREGS: + ieee80211_dump_registers(dev, info, w, extra); +@@ -3174,6 +3180,9 @@ + else + param[0] = 0; + break; ++ case IEEE80211_PARAM_MAXRATE: ++ param[0] = vap->iv_maxrateindex; ++ break; + default: + return -EOPNOTSUPP; + } +@@ -5610,6 +5619,10 @@ + 0, IW_PRIV_TYPE_APPIEBUF, "getiebuf" }, + { IEEE80211_IOCTL_FILTERFRAME, + IW_PRIV_TYPE_FILTER , 0, "setfilter" }, ++ {IEEE80211_PARAM_MAXRATE, ++ IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, 0, "maxrate"}, ++ {IEEE80211_PARAM_MAXRATE, ++ 0, IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, "get_maxrate"}, + + #ifdef ATH_REVERSE_ENGINEERING + /* Added: trunk/marvell_owrt_8.09/package/madwifi/patches/341-minrate.patch =================================================================== --- trunk/marvell_owrt_8.09/package/madwifi/patches/341-minrate.patch (rev 0) +++ trunk/marvell_owrt_8.09/package/madwifi/patches/341-minrate.patch 2009-08-26 18:33:09 UTC (rev 88) @@ -0,0 +1,126 @@ +Index: madwifi-trunk-r3314/ath/if_ath.c +=================================================================== +--- madwifi-trunk-r3314.orig/ath/if_ath.c ++++ madwifi-trunk-r3314/ath/if_ath.c +@@ -1308,6 +1308,7 @@ + vap->iv_key_update_begin = ath_key_update_begin; + vap->iv_key_update_end = ath_key_update_end; + vap->iv_maxrateindex = 0; ++ vap->iv_minrateindex = 0; + if (sc->sc_default_ieee80211_debug) { + /* User specified defaults for new VAPs were provided, so + * use those (only). */ +Index: madwifi-trunk-r3314/ath_rate/minstrel/minstrel.c +=================================================================== +--- madwifi-trunk-r3314.orig/ath_rate/minstrel/minstrel.c ++++ madwifi-trunk-r3314/ath_rate/minstrel/minstrel.c +@@ -638,9 +638,15 @@ + sn->rs_succ_hist [x] = 0; + sn->rs_att_hist [x] = 0; + sn->rs_this_tp [x] = 0; +- ++ if (vap->iv_minrateindex && vap->iv_minrateindexni_rates.rs_nrates) ++ { ++ int idx = vap->iv_minrateindex; ++ sn->rates[x].rate = ni->ni_rates.rs_rates[idx] & IEEE80211_RATE_VAL; ++ sn->rates[x].rix = sc->sc_rixmap[sn->rates[idx].rate]; ++ }else{ + sn->rates[x].rate = ni->ni_rates.rs_rates[x] & IEEE80211_RATE_VAL; + sn->rates[x].rix = sc->sc_rixmap[sn->rates[x].rate]; ++ } + if (sn->rates[x].rix == 0xff) { + DPRINTF(sc, "%s: %s ignore bogus rix at %d\n", + dev_info, __func__, x); +@@ -649,7 +655,7 @@ + sn->rates[x].rateCode = rt->info[sn->rates[x].rix].rateCode; + sn->rates[x].shortPreambleRateCode = + rt->info[sn->rates[x].rix].rateCode | +- rt->info[sn->rates[x].rix].shortPreamble; ++ rt->info[sn->rates[x].rix].shortPreamble; + } + + ath_fill_sample_table(sn); +Index: madwifi-trunk-r3314/ath_rate/sample/sample.c +=================================================================== +--- madwifi-trunk-r3314.orig/ath_rate/sample/sample.c ++++ madwifi-trunk-r3314/ath_rate/sample/sample.c +@@ -842,8 +842,15 @@ + sn->num_rates = vap->iv_maxrateindex; + + for (x = 0; x < ni->ni_rates.rs_nrates; x++) { +- sn->rates[x].rate = ni->ni_rates.rs_rates[x] & IEEE80211_RATE_VAL; +- sn->rates[x].rix = sc->sc_rixmap[sn->rates[x].rate]; ++ if (vap->iv_minrateindex && vap->iv_minrateindexni_rates.rs_nrates) ++ { ++ int idx = vap->iv_minrateindex; ++ sn->rates[x].rate = ni->ni_rates.rs_rates[idx] & IEEE80211_RATE_VAL; ++ sn->rates[x].rix = sc->sc_rixmap[sn->rates[idx].rate]; ++ }else{ ++ sn->rates[x].rate = ni->ni_rates.rs_rates[x] & IEEE80211_RATE_VAL; ++ sn->rates[x].rix = sc->sc_rixmap[sn->rates[x].rate]; ++ } + if (sn->rates[x].rix == 0xff) { + DPRINTF(sc, ATH_DEBUG_RATE, "%s: %s ignore bogus rix at %u\n", + dev_info, __func__, x); +Index: madwifi-trunk-r3314/net80211/ieee80211_ioctl.h +=================================================================== +--- madwifi-trunk-r3314.orig/net80211/ieee80211_ioctl.h ++++ madwifi-trunk-r3314/net80211/ieee80211_ioctl.h +@@ -642,6 +642,7 @@ + IEEE80211_PARAM_BEACON_MISS_THRESH = 73, /* Beacon miss threshold (in beacons) */ + IEEE80211_PARAM_BEACON_MISS_THRESH_MS = 74, /* Beacon miss threshold (in ms) */ + IEEE80211_PARAM_MAXRATE = 75, /* Maximum rate (by table index) */ ++ IEEE80211_PARAM_MINRATE = 76, /* Maximum rate (by table index) */ + }; + + #define SIOCG80211STATS (SIOCDEVPRIVATE+2) +Index: madwifi-trunk-r3314/net80211/ieee80211_var.h +=================================================================== +--- madwifi-trunk-r3314.orig/net80211/ieee80211_var.h ++++ madwifi-trunk-r3314/net80211/ieee80211_var.h +@@ -282,6 +282,7 @@ + struct ieee80211_app_ie app_ie[IEEE80211_APPIE_NUM_OF_FRAME]; /* app-specified IEs by frame type */ + u_int32_t app_filter; /* filters which management frames are forwarded to app */ + int iv_maxrateindex; ++ int iv_minrateindex; + }; + + /* Debug functions need the defintion of struct ieee80211vap because iv_debug +Index: madwifi-trunk-r3314/net80211/ieee80211_wireless.c +=================================================================== +--- madwifi-trunk-r3314.orig/net80211/ieee80211_wireless.c ++++ madwifi-trunk-r3314/net80211/ieee80211_wireless.c +@@ -2845,6 +2845,12 @@ + else + vap->iv_maxrateindex = 0; + break; ++ case IEEE80211_PARAM_MINRATE: ++ if (value > 0) ++ vap->iv_minrateindex = value; ++ else ++ vap->iv_minrateindex = 0; ++ break; + #ifdef ATH_REVERSE_ENGINEERING + case IEEE80211_PARAM_DUMPREGS: + ieee80211_dump_registers(dev, info, w, extra); +@@ -3183,6 +3189,9 @@ + case IEEE80211_PARAM_MAXRATE: + param[0] = vap->iv_maxrateindex; + break; ++ case IEEE80211_PARAM_MINRATE: ++ param[0] = vap->iv_minrateindex; ++ break; + default: + return -EOPNOTSUPP; + } +@@ -5623,6 +5632,10 @@ + IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, 0, "maxrate"}, + {IEEE80211_PARAM_MAXRATE, + 0, IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, "get_maxrate"}, ++ {IEEE80211_PARAM_MINRATE, ++ IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, 0, "minrate"}, ++ {IEEE80211_PARAM_MINRATE, ++ 0, IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, "get_minrate"}, + + #ifdef ATH_REVERSE_ENGINEERING + /* Added: trunk/marvell_owrt_8.09/package/madwifi/patches/342-performance.patch =================================================================== --- trunk/marvell_owrt_8.09/package/madwifi/patches/342-performance.patch (rev 0) +++ trunk/marvell_owrt_8.09/package/madwifi/patches/342-performance.patch 2009-08-26 18:33:09 UTC (rev 88) @@ -0,0 +1,269 @@ +Index: madwifi-trunk-r3314/ath/if_ath.c +=================================================================== +--- madwifi-trunk-r3314.orig/ath/if_ath.c ++++ madwifi-trunk-r3314/ath/if_ath.c +@@ -3237,7 +3237,6 @@ + struct ath_softc *sc = dev->priv; + struct ieee80211_node *ni = NULL; + struct ath_buf *bf = NULL; +- struct ether_header *eh; + ath_bufhead bf_head; + struct ath_buf *tbf, *tempbf; + struct sk_buff *tskb; +@@ -3249,6 +3248,7 @@ + */ + int requeue = 0; + #ifdef ATH_SUPERG_FF ++ struct ether_header *eh; + unsigned int pktlen; + struct ieee80211com *ic = &sc->sc_ic; + struct ath_node *an; +@@ -3314,27 +3314,9 @@ + requeue = 1; + goto hardstart_fail; + } +-#endif + +- /* If the skb data is shared, we will copy it so we can strip padding +- * without affecting any other bridge ports. */ +- if (skb_cloned(skb)) { +- /* Remember the original SKB so we can free up our references */ +- struct sk_buff *skb_new; +- skb_new = skb_copy(skb, GFP_ATOMIC); +- if (skb_new == NULL) { +- DPRINTF(sc, ATH_DEBUG_XMIT, +- "Dropping; skb_copy failure.\n"); +- /* No free RAM, do not requeue! */ +- goto hardstart_fail; +- } +- ieee80211_skb_copy_noderef(skb, skb_new); +- ieee80211_dev_kfree_skb(&skb); +- skb = skb_new; +- } + eh = (struct ether_header *)skb->data; + +-#ifdef ATH_SUPERG_FF + /* NB: use this lock to protect an->an_tx_ffbuf (and txq->axq_stageq) + * in athff_can_aggregate() call too. */ + ATH_TXQ_LOCK_IRQ(txq); +Index: madwifi-trunk-r3314/net80211/ieee80211_output.c +=================================================================== +--- madwifi-trunk-r3314.orig/net80211/ieee80211_output.c ++++ madwifi-trunk-r3314/net80211/ieee80211_output.c +@@ -283,7 +283,7 @@ + * normal vap. */ + if (vap->iv_xrvap && (ni == vap->iv_bss) && + vap->iv_xrvap->iv_sta_assoc) { +- struct sk_buff *skb1 = skb_copy(skb, GFP_ATOMIC); ++ struct sk_buff *skb1 = skb_clone(skb, GFP_ATOMIC); + if (skb1) { + memset(SKB_CB(skb1), 0, sizeof(struct ieee80211_cb)); + #ifdef IEEE80211_DEBUG_REFCNT +@@ -566,7 +566,7 @@ + struct ieee80211_key *key, struct sk_buff *skb, int ismulticast) + { + /* XXX pre-calculate per node? */ +- int need_headroom = LLC_SNAPFRAMELEN + hdrsize + IEEE80211_ADDR_LEN; ++ int need_headroom = LLC_SNAPFRAMELEN + hdrsize; + int need_tailroom = 0; + #ifdef ATH_SUPERG_FF + int isff = ATH_FF_MAGIC_PRESENT(skb); +@@ -608,109 +608,56 @@ + need_tailroom += cip->ic_miclen; + } + +- if (skb_shared(skb)) { +- /* Take our own reference to the node in the clone */ +- ieee80211_ref_node(SKB_CB(skb)->ni); +- /* Unshare the node, decrementing users in the old skb */ +- skb = skb_unshare(skb, GFP_ATOMIC); ++ need_headroom -= skb_headroom(skb); ++ if (isff) ++ need_tailroom -= skb_tailroom(skb2); ++ else ++ need_tailroom -= skb_tailroom(skb); ++ ++ if (need_headroom < 0) ++ need_headroom = 0; ++ if (need_tailroom < 0) ++ need_tailroom = 0; ++ ++ if (skb_cloned(skb) || (need_headroom > 0) || ++ (!isff && (need_tailroom > 0))) { ++ ++ if (pskb_expand_head(skb, need_headroom, need_tailroom, GFP_ATOMIC)) { ++ IEEE80211_DPRINTF(vap, IEEE80211_MSG_OUTPUT, ++ "%s: cannot expand storage (tail)\n", __func__); ++ goto error; ++ } + } + + #ifdef ATH_SUPERG_FF + if (isff) { +- if (skb == NULL) { +- IEEE80211_DPRINTF(vap, IEEE80211_MSG_OUTPUT, +- "%s: cannot unshare for encapsulation\n", +- __func__); +- vap->iv_stats.is_tx_nobuf++; +- ieee80211_dev_kfree_skb(&skb2); +- +- return NULL; +- } ++ inter_headroom -= skb_headroom(skb2); ++ if (inter_headroom < 0) ++ inter_headroom = 0; ++ if ((skb_cloned(skb2) || ++ (inter_headroom > 0) || (need_tailroom > 0))) { + +- /* first skb header */ +- if (skb_headroom(skb) < need_headroom) { +- struct sk_buff *tmp = skb; +- skb = skb_realloc_headroom(skb, need_headroom); +- if (skb == NULL) { ++ if (pskb_expand_head(skb2, inter_headroom, ++ need_tailroom, GFP_ATOMIC)) { + IEEE80211_DPRINTF(vap, IEEE80211_MSG_OUTPUT, +- "%s: cannot expand storage (head1)\n", +- __func__); +- vap->iv_stats.is_tx_nobuf++; +- ieee80211_dev_kfree_skb(&skb2); +- return NULL; +- } else +- ieee80211_skb_copy_noderef(tmp, skb); +- ieee80211_dev_kfree_skb(&tmp); +- /* NB: cb[] area was copied, but not next ptr. must do that +- * prior to return on success. */ +- } +- +- /* second skb with header and tail adjustments possible */ +- if (skb_tailroom(skb2) < need_tailroom) { +- int n = 0; +- if (inter_headroom > skb_headroom(skb2)) +- n = inter_headroom - skb_headroom(skb2); +- if (pskb_expand_head(skb2, n, +- need_tailroom - skb_tailroom(skb2), GFP_ATOMIC)) { +- ieee80211_dev_kfree_skb(&skb2); +- IEEE80211_DPRINTF(vap, IEEE80211_MSG_OUTPUT, +- "%s: cannot expand storage (tail2)\n", +- __func__); +- vap->iv_stats.is_tx_nobuf++; +- /* this shouldn't happen, but don't send first ff either */ +- ieee80211_dev_kfree_skb(&skb); ++ "%s: cannot expand storage (tail)\n", __func__); ++ goto error; + } +- } else if (skb_headroom(skb2) < inter_headroom) { +- struct sk_buff *tmp = skb2; +- +- skb2 = skb_realloc_headroom(skb2, inter_headroom); +- if (skb2 == NULL) { +- IEEE80211_DPRINTF(vap, IEEE80211_MSG_OUTPUT, +- "%s: cannot expand storage (head2)\n", +- __func__); +- vap->iv_stats.is_tx_nobuf++; +- /* this shouldn't happen, but don't send first ff either */ +- ieee80211_dev_kfree_skb(&skb); +- skb = NULL; +- } else +- ieee80211_skb_copy_noderef(tmp, skb); +- ieee80211_dev_kfree_skb(&tmp); + } +- if (skb) { +- skb->next = skb2; +- } +- return skb; ++ skb->next = skb2; + } + #endif /* ATH_SUPERG_FF */ +- if (skb == NULL) { +- IEEE80211_DPRINTF(vap, IEEE80211_MSG_OUTPUT, +- "%s: cannot unshare for encapsulation\n", __func__); +- vap->iv_stats.is_tx_nobuf++; +- } else if (skb_tailroom(skb) < need_tailroom) { +- int n = 0; +- if (need_headroom > skb_headroom(skb)) +- n = need_headroom - skb_headroom(skb); +- if (pskb_expand_head(skb, n, need_tailroom - +- skb_tailroom(skb), GFP_ATOMIC)) { +- IEEE80211_DPRINTF(vap, IEEE80211_MSG_OUTPUT, +- "%s: cannot expand storage (tail)\n", __func__); +- vap->iv_stats.is_tx_nobuf++; +- ieee80211_dev_kfree_skb(&skb); +- } +- } else if (skb_headroom(skb) < need_headroom) { +- struct sk_buff *tmp = skb; +- skb = skb_realloc_headroom(skb, need_headroom); +- /* Increment reference count after copy */ +- if (skb == NULL) { +- IEEE80211_DPRINTF(vap, IEEE80211_MSG_OUTPUT, +- "%s: cannot expand storage (head)\n", __func__); +- vap->iv_stats.is_tx_nobuf++; +- } else +- ieee80211_skb_copy_noderef(tmp, skb); +- ieee80211_dev_kfree_skb(&tmp); +- } + + return skb; ++ ++error: ++ vap->iv_stats.is_tx_nobuf++; ++ ieee80211_dev_kfree_skb(&skb); ++#ifdef ATH_SUPERG_FF ++ if (skb2) ++ ieee80211_dev_kfree_skb(&skb2); ++#endif ++ return NULL; + } + + #define KEY_UNDEFINED(k) ((k).wk_cipher == &ieee80211_cipher_none) +Index: madwifi-trunk-r3314/net80211/ieee80211_input.c +=================================================================== +--- madwifi-trunk-r3314.orig/net80211/ieee80211_input.c ++++ madwifi-trunk-r3314/net80211/ieee80211_input.c +@@ -204,7 +204,6 @@ + struct ieee80211_frame *wh; + struct ieee80211_key *key; + struct ether_header *eh; +- struct sk_buff *skb2; + #ifdef ATH_SUPERG_FF + struct llc *llc; + #endif +@@ -244,20 +243,6 @@ + vap->iv_stats.is_rx_tooshort++; + goto out; + } +- /* Clone the SKB... we assume somewhere in this driver that we 'own' +- * the skbuff passed into hard start and we do a lot of messing with it +- * but bridges under some cases will not clone for the first pass of skb +- * to a bridge port, but will then clone for subsequent ones. This is +- * odd behavior but it means that if we have trashed the skb we are given +- * then other ports get clones of the residual garbage. +- */ +- if ((skb2 = skb_copy(skb, GFP_ATOMIC)) == NULL) { +- vap->iv_devstats.tx_dropped++; +- goto out; +- } +- ieee80211_skb_copy_noderef(skb, skb2); +- ieee80211_dev_kfree_skb(&skb); +- skb = skb2; + + /* + * Bit of a cheat here, we use a pointer for a 3-address +@@ -738,7 +723,7 @@ + /* ether_type must be length as FF frames are always LLC/SNAP encap'd */ + frame_len = ntohs(eh_tmp->ether_type); + +- skb1 = skb_copy(skb, GFP_ATOMIC); ++ skb1 = skb_clone(skb, GFP_ATOMIC); + if (skb1 == NULL) + goto err; + ieee80211_skb_copy_noderef(skb, skb1); +@@ -1137,7 +1122,7 @@ + + if (ETHER_IS_MULTICAST(eh->ether_dhost) && !netif_queue_stopped(dev)) { + /* Create a SKB for the BSS to send out. */ +- skb1 = skb_copy(skb, GFP_ATOMIC); ++ skb1 = skb_clone(skb, GFP_ATOMIC); + if (skb1) + SKB_CB(skb1)->ni = ieee80211_ref_node(vap->iv_bss); + } Added: trunk/marvell_owrt_8.09/package/madwifi/patches/343-txqueue_races.patch =================================================================== --- trunk/marvell_owrt_8.09/package/madwifi/patches/343-txqueue_races.patch (rev 0) +++ trunk/marvell_owrt_8.09/package/madwifi/patches/343-txqueue_races.patch 2009-08-26 18:33:09 UTC (rev 88) @@ -0,0 +1,38 @@ +Merged from madwifi trunk r3551, r3552 + +Index: madwifi-trunk-r3314/ath/if_ath.c +=================================================================== +--- madwifi-trunk-r3314.orig/ath/if_ath.c ++++ madwifi-trunk-r3314/ath/if_ath.c +@@ -8244,6 +8244,17 @@ + goto bf_fail; + } + ++ /* We make sure we don't remove the TX descriptor on ++ * which the HW is pointing since it contains the ++ * ds_link field, except if this is the last TX ++ * descriptor in the queue */ ++ ++ if ((txq->axq_depth > 1) && ++ (bf->bf_daddr == ath_hal_gettxbuf(ah, txq->axq_qnum))) { ++ ATH_TXQ_UNLOCK_IRQ_EARLY(txq); ++ goto bf_fail; ++ } ++ + ATH_TXQ_REMOVE_HEAD(txq, bf_list); + ATH_TXQ_UNLOCK_IRQ(txq); + +Index: madwifi-trunk-r3314/ath/if_athvar.h +=================================================================== +--- madwifi-trunk-r3314.orig/ath/if_athvar.h ++++ madwifi-trunk-r3314/ath/if_athvar.h +@@ -586,7 +586,8 @@ + } while (0) + #define ATH_TXQ_REMOVE_HEAD(_tq, _field) do { \ + STAILQ_REMOVE_HEAD(&(_tq)->axq_q, _field); \ +- (_tq)->axq_depth--; \ ++ if (--(_tq)->axq_depth <= 0) \ ++ (_tq)->axq_link = NULL; \ + } while (0) + /* move buffers from MCASTQ to CABQ */ + #define ATH_TXQ_MOVE_MCASTQ(_tqs,_tqd) do { \ Added: trunk/marvell_owrt_8.09/package/madwifi/patches/344-minstrel_failcnt.patch =================================================================== --- trunk/marvell_owrt_8.09/package/madwifi/patches/344-minstrel_failcnt.patch (rev 0) +++ trunk/marvell_owrt_8.09/package/madwifi/patches/344-minstrel_failcnt.patch 2009-08-26 18:33:09 UTC (rev 88) @@ -0,0 +1,13 @@ +Index: madwifi-trunk-r3314/ath_rate/minstrel/minstrel.c +=================================================================== +--- madwifi-trunk-r3314.orig/ath_rate/minstrel/minstrel.c ++++ madwifi-trunk-r3314/ath_rate/minstrel/minstrel.c +@@ -475,7 +475,7 @@ + /* 'tries' is the total number of times we have endeavoured to + * send this packet, and is a sum of the #attempts at each + * level in the multi-rate retry chain */ +- tries = ts->ts_shortretry + ts->ts_longretry + 1; ++ tries = ts->ts_longretry + 1; + + if (sn->num_rates <= 0) { + DPRINTF(sc, "%s: " MAC_FMT " %s no rates yet\n", dev_info, Added: trunk/marvell_owrt_8.09/package/madwifi/patches/345-minstrel_sampling.patch =================================================================== --- trunk/marvell_owrt_8.09/package/madwifi/patches/345-minstrel_sampling.patch (rev 0) +++ trunk/marvell_owrt_8.09/package/madwifi/patches/345-minstrel_sampling.patch 2009-08-26 18:33:09 UTC (rev 88) @@ -0,0 +1,88 @@ +Index: madwifi-trunk-r3314/ath/if_ath.c +=================================================================== +--- madwifi-trunk-r3314.orig/ath/if_ath.c ++++ madwifi-trunk-r3314/ath/if_ath.c +@@ -8094,6 +8094,7 @@ + ath_hal_setupxtxdesc(sc->sc_ah, ds, mrr.rate1, mrr.retries1, + mrr.rate2, mrr.retries2, + mrr.rate3, mrr.retries3); ++ bf->rcflags = mrr.privflags; + } + + #ifndef ATH_SUPERG_FF +Index: madwifi-trunk-r3314/ath/if_athvar.h +=================================================================== +--- madwifi-trunk-r3314.orig/ath/if_athvar.h ++++ madwifi-trunk-r3314/ath/if_athvar.h +@@ -446,6 +446,7 @@ + u_int16_t bf_flags; /* tx descriptor flags */ + u_int64_t bf_tsf; + int16_t bf_channoise; ++ unsigned int rcflags; + #ifdef ATH_SUPERG_FF + /* XXX: combine this with bf_skbaddr if it ever changes to accommodate + * multiple segments. +Index: madwifi-trunk-r3314/ath_rate/minstrel/minstrel.c +=================================================================== +--- madwifi-trunk-r3314.orig/ath_rate/minstrel/minstrel.c ++++ madwifi-trunk-r3314/ath_rate/minstrel/minstrel.c +@@ -333,15 +333,19 @@ + if (sn->static_rate_ndx >= 0) { + ndx = sn->static_rate_ndx; + } else { ++ int delta; + sn->packet_count++; + sn->random_n = (sn->a * sn->random_n) + sn->b; + offset = sn->random_n & 0xf; +- if ((((100 * sn->sample_count) / (sn->sample_count + sn->packet_count)) < ath_lookaround_rate) && (offset < 2)) { ++ delta = (sn->packet_count * ath_lookaround_rate / 100) - sn->sample_count; ++ if ((delta > 0) && (offset < 2)) { + sn->sample_count++; + sn->is_sampling = 1; + if (sn->packet_count >= 10000) { + sn->sample_count = 0; + sn->packet_count = 0; ++ } else if (delta > sn->num_rates * 2) { ++ sn->sample_count += ((delta - sn->num_rates * 2) * ath_lookaround_rate) / 100; + } + + /* Don't look for slowest rate (i.e. slowest +@@ -398,11 +402,14 @@ + if (sn->num_rates <= 0) + return; + ++ mrr->privflags = sn->is_sampling; + if (sn->is_sampling) { + sn->is_sampling = 0; +- if (sn->rs_sample_rate_slower) ++ if (sn->rs_sample_rate_slower) { + rc1 = sn->rs_sample_rate; +- else ++ if (sn->sample_count > 0) ++ sn->sample_count--; ++ } else + rc1 = sn->max_tp_rate; + } else { + rc1 = sn->max_tp_rate2; +@@ -525,6 +532,9 @@ + if (tries <= tries1) + return; + ++ if (bf->rcflags) ++ sn->sample_count++; ++ + if (tries2 < 0) + return; + tries = tries - tries1; +Index: madwifi-trunk-r3314/net80211/ieee80211_rate.h +=================================================================== +--- madwifi-trunk-r3314.orig/net80211/ieee80211_rate.h ++++ madwifi-trunk-r3314/net80211/ieee80211_rate.h +@@ -87,6 +87,7 @@ + int retries2; + int rate3; + int retries3; ++ int privflags; + }; + + struct ieee80211_rate_ops { Added: trunk/marvell_owrt_8.09/package/madwifi/patches/346-protmode_trig.patch =================================================================== --- trunk/marvell_owrt_8.09/package/madwifi/patches/346-protmode_trig.patch (rev 0) +++ trunk/marvell_owrt_8.09/package/madwifi/patches/346-protmode_trig.patch 2009-08-26 18:33:09 UTC (rev 88) @@ -0,0 +1,147 @@ +Index: madwifi-trunk-r3314/net80211/ieee80211.c +=================================================================== +--- madwifi-trunk-r3314.orig/net80211/ieee80211.c ++++ madwifi-trunk-r3314/net80211/ieee80211.c +@@ -333,7 +333,9 @@ + IEEE80211_MS_TO_TU(IEEE80211_BMISSTHRESH_DEFAULT_MS), + ic->ic_lintval), ic->ic_lintval); + } +- ++ ic->ic_protmode_timeout = IEEE80211_PROTMODE_TIMEOUT; ++ ic->ic_protmode_rssi = IEEE80211_PROTMODE_RSSITHR; ++ + IEEE80211_LOCK_INIT(ic, "ieee80211com"); + IEEE80211_VAPS_LOCK_INIT(ic, "ieee80211com_vaps"); + TAILQ_INIT(&ic->ic_vaps); +Index: madwifi-trunk-r3314/net80211/ieee80211_input.c +=================================================================== +--- madwifi-trunk-r3314.orig/net80211/ieee80211_input.c ++++ madwifi-trunk-r3314/net80211/ieee80211_input.c +@@ -3411,14 +3411,18 @@ + IEEE80211_IS_CHAN_ANYG(ic->ic_curchan)) { + + /* Assume no ERP IE == 11b AP */ +- if ((!has_erp || (has_erp && (scan.erp & IEEE80211_ERP_NON_ERP_PRESENT))) && +- !(ic->ic_flags & IEEE80211_F_USEPROT)) { ++ if ((!has_erp || (has_erp && ++ (scan.erp & IEEE80211_ERP_NON_ERP_PRESENT))) && ++ (rssi > ic->ic_protmode_rssi)) { + struct ieee80211vap *tmpvap; + +- ic->ic_flags |= IEEE80211_F_USEPROT; +- TAILQ_FOREACH(tmpvap, &ic->ic_vaps, iv_next) { +- tmpvap->iv_flags_ext |= IEEE80211_FEXT_ERPUPDATE; ++ if (!(ic->ic_flags & IEEE80211_F_USEPROT)) { ++ ic->ic_flags |= IEEE80211_F_USEPROT; ++ TAILQ_FOREACH(tmpvap, &ic->ic_vaps, iv_next) { ++ tmpvap->iv_flags_ext |= IEEE80211_FEXT_ERPUPDATE; ++ } + } ++ ic->ic_protmode_lasttrig = jiffies; + } + } + +Index: madwifi-trunk-r3314/net80211/ieee80211_ioctl.h +=================================================================== +--- madwifi-trunk-r3314.orig/net80211/ieee80211_ioctl.h ++++ madwifi-trunk-r3314/net80211/ieee80211_ioctl.h +@@ -643,6 +643,8 @@ + IEEE80211_PARAM_BEACON_MISS_THRESH_MS = 74, /* Beacon miss threshold (in ms) */ + IEEE80211_PARAM_MAXRATE = 75, /* Maximum rate (by table index) */ + IEEE80211_PARAM_MINRATE = 76, /* Maximum rate (by table index) */ ++ IEEE80211_PARAM_PROTMODE_RSSI = 77, /* RSSI Threshold for enabling protection mode */ ++ IEEE80211_PARAM_PROTMODE_TIMEOUT = 78, /* Timeout for expiring protection mode */ + }; + + #define SIOCG80211STATS (SIOCDEVPRIVATE+2) +Index: madwifi-trunk-r3314/net80211/ieee80211_var.h +=================================================================== +--- madwifi-trunk-r3314.orig/net80211/ieee80211_var.h ++++ madwifi-trunk-r3314/net80211/ieee80211_var.h +@@ -128,6 +128,9 @@ + + #define IEEE80211_APPIE_MAX 1024 + ++#define IEEE80211_PROTMODE_RSSITHR 15 /* default rssi threshold for protection mode trigger */ ++#define IEEE80211_PROTMODE_TIMEOUT 30 /* timeout for keeping protection mode alive */ ++ + #define IEEE80211_PWRCONSTRAINT_VAL(ic) \ + (((ic)->ic_bsschan->ic_maxregpower > (ic)->ic_curchanmaxpwr) ? \ + (ic)->ic_bsschan->ic_maxregpower - (ic)->ic_curchanmaxpwr : 0) +@@ -324,6 +327,9 @@ + u_int16_t ic_newtxpowlimit; /* tx power limit to change to (in 0.5 dBm) */ + u_int16_t ic_uapsdmaxtriggers; /* max triggers that could arrive */ + u_int8_t ic_coverageclass; /* coverage class */ ++ u_int8_t ic_protmode_rssi; /* rssi threshold for protection mode */ ++ u_int64_t ic_protmode_lasttrig; /* last trigger for protection mode */ ++ u_int16_t ic_protmode_timeout; /* protection mode timeout */ + + /* Channel state: + * +Index: madwifi-trunk-r3314/net80211/ieee80211_wireless.c +=================================================================== +--- madwifi-trunk-r3314.orig/net80211/ieee80211_wireless.c ++++ madwifi-trunk-r3314/net80211/ieee80211_wireless.c +@@ -2312,6 +2312,12 @@ + IEEE80211_IS_CHAN_ANYG(ic->ic_bsschan)) + retv = ENETRESET; + break; ++ case IEEE80211_PARAM_PROTMODE_TIMEOUT: ++ ic->ic_protmode_timeout = value; ++ break; ++ case IEEE80211_PARAM_PROTMODE_RSSI: ++ ic->ic_protmode_rssi = value; ++ break; + case IEEE80211_PARAM_MCASTCIPHER: + if ((vap->iv_caps & cipher2cap(value)) == 0 && + !ieee80211_crypto_available(vap, value)) +@@ -2955,6 +2961,12 @@ + case IEEE80211_PARAM_PROTMODE: + param[0] = ic->ic_protmode; + break; ++ case IEEE80211_PARAM_PROTMODE_TIMEOUT: ++ param[0] = ic->ic_protmode_timeout; ++ break; ++ case IEEE80211_PARAM_PROTMODE_RSSI: ++ param[0] = ic->ic_protmode_rssi; ++ break; + case IEEE80211_PARAM_MCASTCIPHER: + param[0] = rsn->rsn_mcastcipher; + break; +@@ -5346,6 +5358,14 @@ + IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, 0, "protmode" }, + { IEEE80211_PARAM_PROTMODE, + 0, IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, "get_protmode" }, ++ { IEEE80211_PARAM_PROTMODE_RSSI, ++ IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, 0, "protrssi" }, ++ { IEEE80211_PARAM_PROTMODE_RSSI, ++ 0, IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, "get_protrssi" }, ++ { IEEE80211_PARAM_PROTMODE_TIMEOUT, ++ IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, 0, "prottime" }, ++ { IEEE80211_PARAM_PROTMODE_TIMEOUT, ++ 0, IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, "get_prottime" }, + { IEEE80211_PARAM_MCASTCIPHER, + IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, 0, "mcastcipher" }, + { IEEE80211_PARAM_MCASTCIPHER, +Index: madwifi-trunk-r3314/net80211/ieee80211_node.c +=================================================================== +--- madwifi-trunk-r3314.orig/net80211/ieee80211_node.c ++++ madwifi-trunk-r3314/net80211/ieee80211_node.c +@@ -1877,6 +1877,17 @@ + + ieee80211_scan_timeout(ic); + ieee80211_timeout_stations(&ic->ic_sta); ++ if ((ic->ic_flags & IEEE80211_F_USEPROT) && ++ (ic->ic_protmode_lasttrig + ic->ic_protmode_timeout * HZ < ++ jiffies)) { ++ struct ieee80211vap *tmpvap; ++ ++ /* expire protection mode */ ++ ic->ic_flags &= ~IEEE80211_F_USEPROT; ++ TAILQ_FOREACH(tmpvap, &ic->ic_vaps, iv_next) { ++ tmpvap->iv_flags_ext |= IEEE80211_FEXT_ERPUPDATE; ++ } ++ } + + ic->ic_inact.expires = jiffies + IEEE80211_INACT_WAIT * HZ; + add_timer(&ic->ic_inact); Added: trunk/marvell_owrt_8.09/package/madwifi/patches/347-tuning.patch =================================================================== --- trunk/marvell_owrt_8.09/package/madwifi/patches/347-tuning.patch (rev 0) +++ trunk/marvell_owrt_8.09/package/madwifi/patches/347-tuning.patch 2009-08-26 18:33:09 UTC (rev 88) @@ -0,0 +1,111 @@ +Index: madwifi-trunk-r3314/ath/if_ath.c +=================================================================== +--- madwifi-trunk-r3314.orig/ath/if_ath.c ++++ madwifi-trunk-r3314/ath/if_ath.c +@@ -10265,11 +10265,11 @@ + sc->sc_currates = rt; + sc->sc_curmode = mode; + /* +- * All protection frames are transmitted at 2Mb/s for +- * 11g, otherwise at 1Mb/s. ++ * All protection frames are transmitted at 11Mb/s for ++ * 11g, otherwise at 2Mb/s. + * XXX select protection rate index from rate table. + */ +- sc->sc_protrix = (mode == IEEE80211_MODE_11G ? 1 : 0); ++ sc->sc_protrix = (mode == IEEE80211_MODE_11G ? 3 : 1); + /* rate index used to send mgt frames */ + sc->sc_minrateix = 0; + } +Index: madwifi-trunk-r3314/ath/if_athvar.h +=================================================================== +--- madwifi-trunk-r3314.orig/ath/if_athvar.h ++++ madwifi-trunk-r3314/ath/if_athvar.h +@@ -272,6 +272,10 @@ + #define AES_ICV_FIELD_SIZE 8 /* AES ICV field size */ + #define EXT_IV_FIELD_SIZE 4 /* ext IV field size */ + ++/* This is what the HAL uses by default for 11a+g */ ++#define ATH_DEFAULT_CWMIN 15 ++#define ATH_DEFAULT_CWMAX 1023 ++ + /* XR specific macros */ + + #define XR_DEFAULT_GRPPOLL_RATE_STR "0.25 1 1 3 3 6 6 20" +Index: madwifi-trunk-r3314/ath_rate/minstrel/minstrel.c +=================================================================== +--- madwifi-trunk-r3314.orig/ath_rate/minstrel/minstrel.c ++++ madwifi-trunk-r3314/ath_rate/minstrel/minstrel.c +@@ -197,7 +197,7 @@ + unsigned int x = 0, tt = 0; + unsigned int cix = rt->info[rix].controlRate; + int rts = 0, cts = 0; +- int cw = WIFI_CW_MIN; ++ int cw = ATH_DEFAULT_CWMIN; + + KASSERT(rt != NULL, ("no rate table, mode %u", sc->sc_curmode)); + +@@ -281,7 +281,7 @@ + tt += (long_retries + 1) * ath_hal_computetxtime(sc->sc_ah, rt, length, + rix, AH_TRUE); + for (x = 0; x <= short_retries + long_retries; x++) { +- cw = MIN(WIFI_CW_MAX, (cw + 1) * 2); ++ cw = MIN(ATH_DEFAULT_CWMAX, (cw + 1) * 2); + tt += (t_slot * cw / 2); + } + return tt; +Index: madwifi-trunk-r3314/ath_rate/minstrel/minstrel.h +=================================================================== +--- madwifi-trunk-r3314.orig/ath_rate/minstrel/minstrel.h ++++ madwifi-trunk-r3314/ath_rate/minstrel/minstrel.h +@@ -180,14 +180,6 @@ + #define MAX(a,b) ((a) > (b) ? (a) : (b)) + #endif + +-#if 0 +-#define WIFI_CW_MIN 31 +-#define WIFI_CW_MAX 1023 +-#else +-#define WIFI_CW_MIN 3 +-#define WIFI_CW_MAX 10 +-#endif +- + /* + * Definitions for pulling the rate and trie counts from + * a 5212 h/w descriptor. These Don't belong here; the +Index: madwifi-trunk-r3314/ath_rate/sample/sample.c +=================================================================== +--- madwifi-trunk-r3314.orig/ath_rate/sample/sample.c ++++ madwifi-trunk-r3314/ath_rate/sample/sample.c +@@ -170,7 +170,7 @@ + struct ieee80211com *ic = &sc->sc_ic; + unsigned int tt = 0; + unsigned int x; +- unsigned int cw = WIFI_CW_MIN; ++ unsigned int cw = ATH_DEFAULT_CWMIN; + unsigned int cix = rt->info[rix].controlRate; + KASSERT(rt != NULL, ("no rate table, mode %u", sc->sc_curmode)); + +@@ -254,7 +254,7 @@ + tt += (long_retries+1)*ath_hal_computetxtime(sc->sc_ah, rt, length, + rix, AH_TRUE); + for (x = 0; x <= short_retries + long_retries; x++) { +- cw = MIN(WIFI_CW_MAX, (cw + 1) * 2); ++ cw = MIN(ATH_DEFAULT_CWMAX, (cw + 1) * 2); + tt += (t_slot * cw / 2); + } + return tt; +Index: madwifi-trunk-r3314/ath_rate/sample/sample.h +=================================================================== +--- madwifi-trunk-r3314.orig/ath_rate/sample/sample.h ++++ madwifi-trunk-r3314/ath_rate/sample/sample.h +@@ -106,9 +106,6 @@ + #define MAX(a,b) ((a) > (b) ? (a) : (b)) + #endif + +-#define WIFI_CW_MIN 31 +-#define WIFI_CW_MAX 1023 +- + /* + * Definitions for pulling the rate and trie counts from + * a 5212 h/w descriptor. These Don't belong here; the Added: trunk/marvell_owrt_8.09/package/madwifi/patches/348-ackcts.patch =================================================================== --- trunk/marvell_owrt_8.09/package/madwifi/patches/348-ackcts.patch (rev 0) +++ trunk/marvell_owrt_8.09/package/madwifi/patches/348-ackcts.patch 2009-08-26 18:33:09 UTC (rev 88) @@ -0,0 +1,42 @@ +Index: madwifi-trunk-r3314/ath/if_ath.c +=================================================================== +--- madwifi-trunk-r3314.orig/ath/if_ath.c ++++ madwifi-trunk-r3314/ath/if_ath.c +@@ -2721,6 +2721,9 @@ + static int + ath_set_ack_bitrate(struct ath_softc *sc, int high) + { ++ if (!sc->sc_ackrate_override) ++ return 0; ++ + if (ar_device(sc->devid) == 5212 || ar_device(sc->devid) == 5213) { + /* set ack to be sent at low bit-rate */ + /* registers taken from the OpenBSD 5212 HAL */ +@@ -10780,8 +10783,13 @@ + break; + #endif + case ATH_ACKRATE: +- sc->sc_ackrate = val; +- ath_set_ack_bitrate(sc, sc->sc_ackrate); ++ if (val == -1) ++ sc->sc_ackrate_override = 0; ++ else { ++ sc->sc_ackrate_override = 1; ++ sc->sc_ackrate = val; ++ ath_set_ack_bitrate(sc, sc->sc_ackrate); ++ } + break; + case ATH_RP: + ath_rp_record(sc, +Index: madwifi-trunk-r3314/ath/if_athvar.h +=================================================================== +--- madwifi-trunk-r3314.orig/ath/if_athvar.h ++++ madwifi-trunk-r3314/ath/if_athvar.h +@@ -681,6 +681,7 @@ + unsigned int sc_devstopped:1; /* stopped due to of no tx bufs */ + unsigned int sc_stagbeacons:1; /* use staggered beacons */ + unsigned int sc_dfswait:1; /* waiting on channel for radar detect */ ++ unsigned int sc_ackrate_override:1; /* override ack rate */ + unsigned int sc_ackrate:1; /* send acks at high bitrate */ + unsigned int sc_dfs_cac:1; /* waiting on channel for radar detect */ + unsigned int sc_hasintmit:1; /* Interference mitigation */ Added: trunk/marvell_owrt_8.09/package/madwifi/patches/349-reset.patch =================================================================== --- trunk/marvell_owrt_8.09/package/madwifi/patches/349-reset.patch (rev 0) +++ trunk/marvell_owrt_8.09/package/madwifi/patches/349-reset.patch 2009-08-26 18:33:09 UTC (rev 88) @@ -0,0 +1,23 @@ +Index: madwifi-trunk-r3314/ath/if_ath.c +=================================================================== +--- madwifi-trunk-r3314.orig/ath/if_ath.c ++++ madwifi-trunk-r3314/ath/if_ath.c +@@ -2479,7 +2479,7 @@ + */ + sc->sc_curchan.channel = ic->ic_curchan->ic_freq; + sc->sc_curchan.channelFlags = ath_chan2flags(ic->ic_curchan); +- if (!ath_hal_reset(ah, sc->sc_opmode, &sc->sc_curchan, AH_FALSE, &status)) { ++ if (!ath_hal_reset(ah, sc->sc_opmode, &sc->sc_curchan, AH_TRUE, &status)) { + EPRINTF(sc, "unable to reset hardware: '%s' (HAL status %u) " + "(freq %u flags 0x%x)\n", + ath_get_hal_status_desc(status), status, +@@ -8853,8 +8853,7 @@ + * needed to do the reset with chanchange = AH_FALSE in order + * to receive traffic when peforming high velocity channel + * changes. */ +- if (!ath_hal_reset(ah, sc->sc_opmode, &hchan, AH_TRUE, &status) || +- !ath_hal_reset(ah, sc->sc_opmode, &hchan, AH_FALSE, &status)) { ++ if (!ath_hal_reset(ah, sc->sc_opmode, &hchan, AH_TRUE, &status)) { + EPRINTF(sc, "Unable to reset channel %u (%u MHz) " + "flags 0x%x '%s' (HAL status %u)\n", + ieee80211_chan2ieee(ic, chan), chan->ic_freq, Added: trunk/marvell_owrt_8.09/package/madwifi/patches/350-wisoc_softled.patch =================================================================== --- trunk/marvell_owrt_8.09/package/madwifi/patches/350-wisoc_softled.patch (rev 0) +++ trunk/marvell_owrt_8.09/package/madwifi/patches/350-wisoc_softled.patch 2009-08-26 18:33:09 UTC (rev 88) @@ -0,0 +1,13 @@ +Index: madwifi-trunk-r3314/ath/if_ath_ahb.c +=================================================================== +--- madwifi-trunk-r3314.orig/ath/if_ath_ahb.c ++++ madwifi-trunk-r3314/ath/if_ath_ahb.c +@@ -245,6 +245,8 @@ + num_activesc++; + /* Ready to process interrupts */ + ++ sc->aps_sc.sc_softled = 1; /* SoftLED over GPIO */ ++ sc->aps_sc.sc_ledpin = config->board->sysLedGpio; + sc->aps_sc.sc_invalid = 0; + return 0; + Added: trunk/marvell_owrt_8.09/package/madwifi/patches/351-scanlist.patch =================================================================== --- trunk/marvell_owrt_8.09/package/madwifi/patches/351-scanlist.patch (rev 0) +++ trunk/marvell_owrt_8.09/package/madwifi/patches/351-scanlist.patch 2009-08-26 18:33:09 UTC (rev 88) @@ -0,0 +1,891 @@ +Index: madwifi-trunk-r3314/net80211/ieee80211_scan_sta.c +=================================================================== +--- madwifi-trunk-r3314.orig/net80211/ieee80211_scan_sta.c 2008-06-01 04:46:05.000000000 +0200 ++++ madwifi-trunk-r3314/net80211/ieee80211_scan_sta.c 2008-06-01 04:46:33.000000000 +0200 +@@ -317,147 +317,6 @@ + #undef ISPROBE + } + +-static struct ieee80211_channel * +-find11gchannel(struct ieee80211com *ic, int i, int freq) +-{ +- struct ieee80211_channel *c; +- int j; +- +- /* +- * The normal ordering in the channel list is b channel +- * immediately followed by g so optimize the search for +- * this. We'll still do a full search just in case. +- */ +- for (j = i+1; j < ic->ic_nchans; j++) { +- c = &ic->ic_channels[j]; +- if (c->ic_freq == freq && IEEE80211_IS_CHAN_ANYG(c)) +- return c; +- } +- for (j = 0; j < i; j++) { +- c = &ic->ic_channels[j]; +- if (c->ic_freq == freq && IEEE80211_IS_CHAN_ANYG(c)) +- return c; +- } +- return NULL; +-} +-static const u_int chanflags[] = { +- IEEE80211_CHAN_B, /* IEEE80211_MODE_AUTO */ +- IEEE80211_CHAN_A, /* IEEE80211_MODE_11A */ +- IEEE80211_CHAN_B, /* IEEE80211_MODE_11B */ +- IEEE80211_CHAN_PUREG, /* IEEE80211_MODE_11G */ +- IEEE80211_CHAN_FHSS, /* IEEE80211_MODE_FH */ +- IEEE80211_CHAN_A, /* IEEE80211_MODE_TURBO_A */ /* for turbo mode look for AP in normal channel */ +- IEEE80211_CHAN_PUREG, /* IEEE80211_MODE_TURBO_G */ +- IEEE80211_CHAN_ST, /* IEEE80211_MODE_TURBO_STATIC_A */ +-}; +- +-static void +-add_channels(struct ieee80211com *ic, +- struct ieee80211_scan_state *ss, +- enum ieee80211_phymode mode, const u_int16_t freq[], int nfreq) +-{ +- struct ieee80211_channel *c, *cg; +- u_int modeflags; +- int i; +- +- KASSERT(mode < ARRAY_SIZE(chanflags), ("Unexpected mode %u", mode)); +- modeflags = chanflags[mode]; +- for (i = 0; i < nfreq; i++) { +- c = ieee80211_find_channel(ic, freq[i], modeflags); +- if (c == NULL || isclr(ic->ic_chan_active, c->ic_ieee)) +- continue; +- if (mode == IEEE80211_MODE_AUTO) { +- /* +- * XXX special-case 11b/g channels so we select +- * the g channel if both are present. +- */ +- if (IEEE80211_IS_CHAN_B(c) && +- (cg = find11gchannel(ic, i, c->ic_freq)) != NULL) +- c = cg; +- } +- if (ss->ss_last >= IEEE80211_SCAN_MAX) +- break; +- ss->ss_chans[ss->ss_last++] = c; +- } +-} +- +-static const u_int16_t rcl1[] = /* 8 FCC channel: 52, 56, 60, 64, 36, 40, 44, 48 */ +-{ 5260, 5280, 5300, 5320, 5180, 5200, 5220, 5240 }; +-static const u_int16_t rcl2[] = /* 4 MKK channels: 34, 38, 42, 46 */ +-{ 5170, 5190, 5210, 5230 }; +-static const u_int16_t rcl3[] = /* 2.4Ghz ch: 1,6,11,7,13 */ +-{ 2412, 2437, 2462, 2442, 2472 }; +-static const u_int16_t rcl4[] = /* 5 FCC channel: 149, 153, 161, 165 */ +-{ 5745, 5765, 5785, 5805, 5825 }; +-static const u_int16_t rcl7[] = /* 11 ETSI channel: 100,104,108,112,116,120,124,128,132,136,140 */ +-{ 5500, 5520, 5540, 5560, 5580, 5600, 5620, 5640, 5660, 5680, 5700 }; +-static const u_int16_t rcl8[] = /* 2.4Ghz ch: 2,3,4,5,8,9,10,12 */ +-{ 2417, 2422, 2427, 2432, 2447, 2452, 2457, 2467 }; +-static const u_int16_t rcl9[] = /* 2.4Ghz ch: 14 */ +-{ 2484 }; +-static const u_int16_t rcl10[] = /* Added Korean channels 2312-2372 */ +-{ 2312, 2317, 2322, 2327, 2332, 2337, 2342, 2347, 2352, 2357, 2362, 2367, 2372 }; +-static const u_int16_t rcl11[] = /* Added Japan channels in 4.9/5.0 spectrum */ +-{ 5040, 5060, 5080, 4920, 4940, 4960, 4980 }; +-#ifdef ATH_TURBO_SCAN +-static const u_int16_t rcl5[] = /* 3 static turbo channels */ +-{ 5210, 5250, 5290 }; +-static const u_int16_t rcl6[] = /* 2 static turbo channels */ +-{ 5760, 5800 }; +-static const u_int16_t rcl6x[] = /* 4 FCC3 turbo channels */ +-{ 5540, 5580, 5620, 5660 }; +-static const u_int16_t rcl12[] = /* 2.4Ghz Turbo channel 6 */ +-{ 2437 }; +-static const u_int16_t rcl13[] = /* dynamic Turbo channels */ +-{ 5200, 5240, 5280, 5765, 5805 }; +-#endif /* ATH_TURBO_SCAN */ +- +-struct scanlist { +- u_int16_t mode; +- u_int16_t count; +- const u_int16_t *list; +-}; +- +-#define IEEE80211_MODE_TURBO_STATIC_A IEEE80211_MODE_MAX +-#define X(a) .count = sizeof(a)/sizeof(a[0]), .list = a +- +-static const struct scanlist staScanTable[] = { +- { IEEE80211_MODE_11B, X(rcl3) }, +- { IEEE80211_MODE_11A, X(rcl1) }, +- { IEEE80211_MODE_11A, X(rcl2) }, +- { IEEE80211_MODE_11B, X(rcl8) }, +- { IEEE80211_MODE_11B, X(rcl9) }, +- { IEEE80211_MODE_11A, X(rcl4) }, +-#ifdef ATH_TURBO_SCAN +- { IEEE80211_MODE_TURBO_STATIC_A, X(rcl5) }, +- { IEEE80211_MODE_TURBO_STATIC_A, X(rcl6) }, +- { IEEE80211_MODE_TURBO_A, X(rcl6x) }, +- { IEEE80211_MODE_TURBO_A, X(rcl13) }, +-#endif /* ATH_TURBO_SCAN */ +- { IEEE80211_MODE_11A, X(rcl7) }, +- { IEEE80211_MODE_11B, X(rcl10) }, +- { IEEE80211_MODE_11A, X(rcl11) }, +-#ifdef ATH_TURBO_SCAN +- { IEEE80211_MODE_TURBO_G, X(rcl12) }, +-#endif /* ATH_TURBO_SCAN */ +- { .list = NULL } +-}; +- +-#undef X +- +-static int +-checktable(const struct scanlist *scan, const struct ieee80211_channel *c) +-{ +- int i; +- +- for (; scan->list != NULL; scan++) { +- for (i = 0; i < scan->count; i++) +- if (scan->list[i] == c->ic_freq) +- return 1; +- } +- return 0; +-} +- + /* + * Start a station-mode scan by populating the channel list. + */ +@@ -466,81 +325,14 @@ + { + struct ieee80211com *ic = vap->iv_ic; + struct sta_table *st = ss->ss_priv; +- const struct scanlist *scan; + enum ieee80211_phymode mode; + struct ieee80211_channel *c; + int i; + + ss->ss_last = 0; +- /* +- * Use the table of ordered channels to construct the list +- * of channels for scanning. Any channels in the ordered +- * list not in the master list will be discarded. +- */ +- for (scan = staScanTable; scan->list != NULL; scan++) { +- mode = scan->mode; +- if (vap->iv_des_mode != IEEE80211_MODE_AUTO) { +- /* +- * If a desired mode was specified, scan only +- * channels that satisfy that constraint. +- */ +- if (vap->iv_des_mode != mode) { +- /* +- * The scan table marks 2.4Ghz channels as b +- * so if the desired mode is 11g, then use +- * the 11b channel list but upgrade the mode. +- */ +- if (vap->iv_des_mode != IEEE80211_MODE_11G || +- mode != IEEE80211_MODE_11B) +- continue; +- mode = IEEE80211_MODE_11G; /* upgrade */ +- } +- } else { +- /* +- * This lets ieee80211_scan_add_channels +- * upgrade an 11b channel to 11g if available. +- */ +- if (mode == IEEE80211_MODE_11B) +- mode = IEEE80211_MODE_AUTO; +- } +- /* XR does not operate on turbo channels */ +- if ((vap->iv_flags & IEEE80211_F_XR) && +- (mode == IEEE80211_MODE_TURBO_A || +- mode == IEEE80211_MODE_TURBO_G)) +- continue; +- /* +- * Add the list of the channels; any that are not +- * in the master channel list will be discarded. +- */ +- add_channels(ic, ss, mode, scan->list, scan->count); +- } +- +- /* +- * Add the channels from the ic (from HAL) that are not present +- * in the staScanTable. +- */ +- for (i = 0; i < ic->ic_nchans; i++) { +- c = &ic->ic_channels[i]; +- /* +- * scan dynamic turbo channels in normal mode. +- */ +- if (IEEE80211_IS_CHAN_DTURBO(c)) +- continue; +- mode = ieee80211_chan2mode(c); +- if (vap->iv_des_mode != IEEE80211_MODE_AUTO) { +- /* +- * If a desired mode was specified, scan only +- * channels that satisfy that constraint. +- */ +- if (vap->iv_des_mode != mode) +- continue; +- +- } +- if (!checktable(staScanTable, c)) +- ss->ss_chans[ss->ss_last++] = c; +- } +- ++ ieee80211_scan_add_channels(ic, ss, vap->iv_des_mode); + ss->ss_next = 0; ++ + /* XXX tunables */ + /* + * The scanner will stay on station for ss_maxdwell ms (using a +@@ -749,17 +541,7 @@ + fail = 0; + if (isclr(ic->ic_chan_active, ieee80211_chan2ieee(ic, se->se_chan))) + fail |= 0x01; +- /* +- * NB: normally the desired mode is used to construct +- * the channel list, but it's possible for the scan +- * cache to include entries for stations outside this +- * list so we check the desired mode here to weed them +- * out. +- */ +- if (vap->iv_des_mode != IEEE80211_MODE_AUTO && +- (se->se_chan->ic_flags & IEEE80211_CHAN_ALLTURBO) != +- chanflags[vap->iv_des_mode]) +- fail |= 0x01; ++ + if (vap->iv_opmode == IEEE80211_M_IBSS) { + if ((se->se_capinfo & IEEE80211_CAPINFO_IBSS) == 0) + fail |= 0x02; +@@ -1168,78 +950,6 @@ + .scan_default = ieee80211_sta_join, + }; + +-/* +- * Start an adhoc-mode scan by populating the channel list. +- */ +-static int +-adhoc_start(struct ieee80211_scan_state *ss, struct ieee80211vap *vap) +-{ +- struct ieee80211com *ic = vap->iv_ic; +- struct sta_table *st = ss->ss_priv; +- const struct scanlist *scan; +- enum ieee80211_phymode mode; +- +- ss->ss_last = 0; +- /* +- * Use the table of ordered channels to construct the list +- * of channels for scanning. Any channels in the ordered +- * list not in the master list will be discarded. +- */ +- for (scan = staScanTable; scan->list != NULL; scan++) { +- mode = scan->mode; +- if (vap->iv_des_mode != IEEE80211_MODE_AUTO) { +- /* +- * If a desired mode was specified, scan only +- * channels that satisfy that constraint. +- */ +- if (vap->iv_des_mode != mode) { +- /* +- * The scan table marks 2.4Ghz channels as b +- * so if the desired mode is 11g, then use +- * the 11b channel list but upgrade the mode. +- */ +- if (vap->iv_des_mode != IEEE80211_MODE_11G || +- mode != IEEE80211_MODE_11B) +- continue; +- mode = IEEE80211_MODE_11G; /* upgrade */ +- } +- } else { +- /* +- * This lets ieee80211_scan_add_channels +- * upgrade an 11b channel to 11g if available. +- */ +- if (mode == IEEE80211_MODE_11B) +- mode = IEEE80211_MODE_AUTO; +- } +- /* XR does not operate on turbo channels */ +- if ((vap->iv_flags & IEEE80211_F_XR) && +- (mode == IEEE80211_MODE_TURBO_A || +- mode == IEEE80211_MODE_TURBO_G)) +- continue; +- /* +- * Add the list of the channels; any that are not +- * in the master channel list will be discarded. +- */ +- add_channels(ic, ss, mode, scan->list, scan->count); +- } +- ss->ss_next = 0; +- /* XXX tunables */ +- ss->ss_mindwell = msecs_to_jiffies(200); /* 200ms */ +- ss->ss_maxdwell = msecs_to_jiffies(200); /* 200ms */ +- +-#ifdef IEEE80211_DEBUG +- if (ieee80211_msg_scan(vap)) { +- printk("%s: scan set ", vap->iv_dev->name); +- ieee80211_scan_dump_channels(ss); +- printk(" dwell min %ld max %ld\n", +- ss->ss_mindwell, ss->ss_maxdwell); +- } +-#endif /* IEEE80211_DEBUG */ +- +- st->st_newscan = 1; +- +- return 0; +-} + + /* + * Select a channel to start an adhoc network on. +@@ -1405,7 +1115,7 @@ + .scan_name = "default", + .scan_attach = sta_attach, + .scan_detach = sta_detach, +- .scan_start = adhoc_start, ++ .scan_start = sta_start, + .scan_restart = sta_restart, + .scan_cancel = sta_cancel, + .scan_end = adhoc_pick_bss, +Index: madwifi-trunk-r3314/net80211/ieee80211.c +=================================================================== +--- madwifi-trunk-r3314.orig/net80211/ieee80211.c 2008-06-01 04:46:30.000000000 +0200 ++++ madwifi-trunk-r3314/net80211/ieee80211.c 2008-06-01 04:46:33.000000000 +0200 +@@ -278,6 +278,11 @@ + ("channel with bogus ieee number %u", c->ic_ieee)); + setbit(ic->ic_chan_avail, c->ic_ieee); + ++ if (c->ic_scanflags & IEEE80211_NOSCAN_DEFAULT) ++ c->ic_scanflags |= IEEE80211_NOSCAN_SET; ++ else ++ c->ic_scanflags &= ~IEEE80211_NOSCAN_SET; ++ + /* Identify mode capabilities. */ + if (IEEE80211_IS_CHAN_A(c)) + ic->ic_modecaps |= 1 << IEEE80211_MODE_11A; +Index: madwifi-trunk-r3314/net80211/_ieee80211.h +=================================================================== +--- madwifi-trunk-r3314.orig/net80211/_ieee80211.h 2008-06-01 04:46:05.000000000 +0200 ++++ madwifi-trunk-r3314/net80211/_ieee80211.h 2008-06-01 04:46:33.000000000 +0200 +@@ -132,6 +132,11 @@ + IEEE80211_SCAN_FIRST = 2, /* take first suitable candidate */ + }; + ++enum ieee80211_scanflags { ++ IEEE80211_NOSCAN_DEFAULT = (1 << 0), ++ IEEE80211_NOSCAN_SET = (1 << 1), ++}; ++ + /* + * Channels are specified by frequency and attributes. + */ +@@ -142,6 +147,7 @@ + int8_t ic_maxregpower; /* maximum regulatory tx power in dBm */ + int8_t ic_maxpower; /* maximum tx power in dBm */ + int8_t ic_minpower; /* minimum tx power in dBm */ ++ u_int8_t ic_scanflags; + }; + + #define IEEE80211_CHAN_MAX 255 +Index: madwifi-trunk-r3314/net80211/ieee80211_ioctl.h +=================================================================== +--- madwifi-trunk-r3314.orig/net80211/ieee80211_ioctl.h 2008-06-01 04:46:30.000000000 +0200 ++++ madwifi-trunk-r3314/net80211/ieee80211_ioctl.h 2008-06-01 04:46:33.000000000 +0200 +@@ -555,6 +555,7 @@ + #define IEEE80211_IOCTL_WDSADDMAC (SIOCIWFIRSTPRIV+26) + #define IEEE80211_IOCTL_WDSDELMAC (SIOCIWFIRSTPRIV+28) + #define IEEE80211_IOCTL_KICKMAC (SIOCIWFIRSTPRIV+30) ++#define IEEE80211_IOCTL_SETSCANLIST (SIOCIWFIRSTPRIV+31) + + enum { + IEEE80211_WMMPARAMS_CWMIN = 1, +Index: madwifi-trunk-r3314/net80211/ieee80211_scan_ap.c +=================================================================== +--- madwifi-trunk-r3314.orig/net80211/ieee80211_scan_ap.c 2008-06-01 04:46:25.000000000 +0200 ++++ madwifi-trunk-r3314/net80211/ieee80211_scan_ap.c 2008-06-01 04:46:33.000000000 +0200 +@@ -129,131 +129,7 @@ + + static int ap_flush(struct ieee80211_scan_state *); + static void action_tasklet(IEEE80211_TQUEUE_ARG); +-static struct ieee80211_channel *find11gchannel(struct ieee80211com *ic, +- int i, int freq); + +-static const u_int chanflags[] = { +- IEEE80211_CHAN_B, /* IEEE80211_MODE_AUTO */ +- IEEE80211_CHAN_A, /* IEEE80211_MODE_11A */ +- IEEE80211_CHAN_B, /* IEEE80211_MODE_11B */ +- IEEE80211_CHAN_PUREG, /* IEEE80211_MODE_11G */ +- IEEE80211_CHAN_FHSS, /* IEEE80211_MODE_FH */ +- IEEE80211_CHAN_A, /* IEEE80211_MODE_TURBO_A */ /* for turbo mode +- * look for AP in +- * normal channel +- */ +- IEEE80211_CHAN_PUREG, /* IEEE80211_MODE_TURBO_G */ +- IEEE80211_CHAN_ST, /* IEEE80211_MODE_TURBO_STATIC_A */ +-}; +- +-static const u_int16_t rcl1[] = /* 8 FCC channel: 52, 56, 60, 64, +- * 36, 40, 44, 48 */ +-{ 5260, 5280, 5300, 5320, 5180, 5200, 5220, 5240 }; +-static const u_int16_t rcl2[] = /* 4 MKK channels: 34, 38, 42, 46 */ +-{ 5170, 5190, 5210, 5230 }; +-static const u_int16_t rcl3[] = /* 2.4Ghz ch: 1,6,11,7,13 */ +-{ 2412, 2437, 2462, 2442, 2472 }; +-static const u_int16_t rcl4[] = /* 5 FCC channel: 149, 153, 161, 165 */ +-{ 5745, 5765, 5785, 5805, 5825 }; +-static const u_int16_t rcl7[] = /* 11 ETSI channel: 100, 104, 108, 112, +- * 116, 120, 124, 128, +- * 132, 136, 140 */ +-{ 5500, 5520, 5540, 5560, 5580, 5600, 5620, 5640, 5660, 5680, 5700 }; +-static const u_int16_t rcl8[] = /* 2.4Ghz ch: 2,3,4,5,8,9,10,12 */ +-{ 2417, 2422, 2427, 2432, 2447, 2452, 2457, 2467 }; +-static const u_int16_t rcl9[] = /* 2.4Ghz ch: 14 */ +-{ 2484 }; +-static const u_int16_t rcl10[] = /* Added Korean channels 2312-2372 */ +-{ 2312, 2317, 2322, 2327, 2332, 2337, 2342, 2347, 2352, 2357, 2362, 2367, 2372 }; +-static const u_int16_t rcl11[] = /* Added Japan channels in 4.9/5.0 spectrum */ +-{ 5040, 5060, 5080, 4920, 4940, 4960, 4980 }; +-#ifdef ATH_TURBO_SCAN +-static const u_int16_t rcl5[] = /* 3 static turbo channels */ +-{ 5210, 5250, 5290 }; +-static const u_int16_t rcl6[] = /* 2 static turbo channels */ +-{ 5760, 5800 }; +-static const u_int16_t rcl6x[] = /* 4 FCC3 turbo channels */ +-{ 5540, 5580, 5620, 5660 }; +-static const u_int16_t rcl12[] = /* 2.4Ghz Turbo channel 6 */ +-{ 2437 }; +-static const u_int16_t rcl13[] = /* dynamic Turbo channels */ +-{ 5200, 5240, 5280, 5765, 5805 }; +-#endif /* ATH_TURBO_SCAN */ +- +-struct scanlist { +- u_int16_t mode; +- u_int16_t count; +- const u_int16_t *list; +-}; +- +-#define IEEE80211_MODE_TURBO_STATIC_A IEEE80211_MODE_MAX +-#define X(a) .count = ARRAY_SIZE(a), .list = a +- +-static const struct scanlist staScanTable[] = { +- { IEEE80211_MODE_11B, X(rcl3) }, +- { IEEE80211_MODE_11A, X(rcl1) }, +- { IEEE80211_MODE_11A, X(rcl2) }, +- { IEEE80211_MODE_11B, X(rcl8) }, +- { IEEE80211_MODE_11B, X(rcl9) }, +- { IEEE80211_MODE_11A, X(rcl4) }, +-#ifdef ATH_TURBO_SCAN +- { IEEE80211_MODE_TURBO_STATIC_A, X(rcl5) }, +- { IEEE80211_MODE_TURBO_STATIC_A, X(rcl6) }, +- { IEEE80211_MODE_TURBO_A, X(rcl6x) }, +- { IEEE80211_MODE_TURBO_A, X(rcl13) }, +-#endif /* ATH_TURBO_SCAN */ +- { IEEE80211_MODE_11A, X(rcl7) }, +- { IEEE80211_MODE_11B, X(rcl10) }, +- { IEEE80211_MODE_11A, X(rcl11) }, +-#ifdef ATH_TURBO_SCAN +- { IEEE80211_MODE_TURBO_G, X(rcl12) }, +-#endif /* ATH_TURBO_SCAN */ +- { .list = NULL } +-}; +- +-#undef X +-/* This function must be invoked with locks acquired */ +-static void +-add_channels(struct ieee80211com *ic, +- struct ieee80211_scan_state *ss, +- enum ieee80211_phymode mode, const u_int16_t freq[], int nfreq) +-{ +- struct ieee80211_channel *c, *cg; +- u_int modeflags; +- int i; +- +- KASSERT(mode < ARRAY_SIZE(chanflags), ("Unexpected mode %u", mode)); +- modeflags = chanflags[mode]; +- for (i = 0; i < nfreq; i++) { +- c = ieee80211_find_channel(ic, freq[i], modeflags); +- if ((c == NULL) || isclr(ic->ic_chan_active, c->ic_ieee)) +- continue; +- if (mode == IEEE80211_MODE_AUTO) { +- /* XXX special-case 11b/g channels so we select +- * the g channel if both are present. */ +- if (IEEE80211_IS_CHAN_B(c) && +- (cg = find11gchannel(ic, i, c->ic_freq)) != NULL) +- c = cg; +- } +- if (ss->ss_last >= IEEE80211_SCAN_MAX) +- break; +- ss->ss_chans[ss->ss_last++] = c; +- } +-} +- +-/* This function must be invoked with locks acquired */ +-static int +-checktable(const struct scanlist *scan, const struct ieee80211_channel *c) +-{ +- int i; +- +- for (; scan->list != NULL; scan++) { +- for (i = 0; i < scan->count; i++) +- if (scan->list[i] == c->ic_freq) +- return 1; +- } +- return 0; +-} + + /* + * Attach prior to any scanning work. +@@ -327,29 +203,6 @@ + ieee80211_saveie(iep, ie); + } + +-/* This function must be invoked with locks acquired */ +-static struct ieee80211_channel * +-find11gchannel(struct ieee80211com *ic, int i, int freq) +-{ +- struct ieee80211_channel *c; +- int j; +- +- /* The normal ordering in the channel list is b channel +- * immediately followed by g so optimize the search for +- * this. We'll still do a full search just in case. */ +- for (j = i + 1; j < ic->ic_nchans; j++) { +- c = &ic->ic_channels[j]; +- if ((c->ic_freq == freq) && IEEE80211_IS_CHAN_ANYG(c)) +- return c; +- } +- for (j = 0; j < i; j++) { +- c = &ic->ic_channels[j]; +- if ((c->ic_freq == freq) && IEEE80211_IS_CHAN_ANYG(c)) +- return c; +- } +- return NULL; +-} +- + /* + * Start an ap scan by populating the channel list. + */ +@@ -358,8 +211,6 @@ + { + struct ap_state *as = ss->ss_priv; + struct ieee80211com *ic = NULL; +- const struct scanlist *sl = NULL; +- struct ieee80211_channel *c = NULL; + int i; + unsigned int mode = 0; + +@@ -368,80 +219,8 @@ + /* Determine mode flags to match, or leave zero for auto mode */ + as->as_vap_desired_mode = vap->iv_des_mode; + as->as_required_mode = 0; +- if (as->as_vap_desired_mode != IEEE80211_MODE_AUTO) { +- as->as_required_mode = chanflags[as->as_vap_desired_mode]; +- if ((vap->iv_ath_cap & IEEE80211_ATHC_TURBOP) && +- (as->as_required_mode != IEEE80211_CHAN_ST)) { +- /* Fixup for dynamic turbo flags */ +- if (as->as_vap_desired_mode == IEEE80211_MODE_11G) +- as->as_required_mode = IEEE80211_CHAN_108G; +- else +- as->as_required_mode = IEEE80211_CHAN_108A; +- } +- } +- +- ss->ss_last = 0; +- /* Use the table of ordered channels to construct the list +- * of channels for scanning. Any channels in the ordered +- * list not in the master list will be discarded. */ +- for (sl = staScanTable; sl->list != NULL; sl++) { +- mode = sl->mode; +- +- /* The scan table marks 2.4Ghz channels as b +- * so if the desired mode is 11g, then use +- * the 11b channel list but upgrade the mode. */ +- if (as->as_vap_desired_mode && +- (as->as_vap_desired_mode != mode) && +- (as->as_vap_desired_mode == IEEE80211_MODE_11G) && +- (mode == IEEE80211_MODE_11B)) +- mode = IEEE80211_MODE_11G; +- +- /* If we are in "AUTO" mode, upgrade the mode to auto. +- * This lets add_channels upgrade an 11b channel to +- * 11g if available. */ +- if (!as->as_vap_desired_mode && (mode == IEEE80211_MODE_11B)) +- mode = IEEE80211_MODE_AUTO; +- +- /* Add the list of the channels; any that are not +- * in the master channel list will be discarded. */ +- add_channels(ic, ss, mode, sl->list, sl->count); +- } +- +- /* Add the channels from the ic (from HAL) that are not present +- * in the staScanTable, assuming they pass the sanity checks... */ +- for (i = 0; i < ic->ic_nchans; i++) { +- c = &ic->ic_channels[i]; +- +- /* XR is not supported on turbo channels */ +- if (IEEE80211_IS_CHAN_TURBO(c) && vap->iv_flags & IEEE80211_F_XR) +- continue; ++ ieee80211_scan_add_channels(ic, ss, vap->iv_des_mode); + +- /* Dynamic channels are scanned in base mode */ +- if (!as->as_required_mode && !IEEE80211_IS_CHAN_ST(c)) +- continue; +- +- /* Use any 11g channel instead of 11b one. */ +- if (vap->iv_des_mode == IEEE80211_MODE_AUTO && +- IEEE80211_IS_CHAN_B(c) && +- find11gchannel(ic, i, c->ic_freq)) +- continue; +- +- /* Do not add channels already put into the scan list by the +- * scan table - these have already been filtered by mode +- * and for whether they are in the active channel list. */ +- if (checktable(staScanTable, c)) +- continue; +- +- /* Make sure the channel is active */ +- if ((c == NULL) || isclr(ic->ic_chan_active, c->ic_ieee)) +- continue; +- +- /* Don't overrun */ +- if (ss->ss_last >= IEEE80211_SCAN_MAX) +- break; +- +- ss->ss_chans[ss->ss_last++] = c; +- } + ss->ss_next = 0; + /* XXX tunables */ + ss->ss_mindwell = msecs_to_jiffies(200); /* 200ms */ +@@ -759,13 +538,6 @@ + if (IEEE80211_IS_CHAN_RADAR(c->chan)) + continue; + +- /* Do not select 802.11a ST if mode is specified and is not +- * 802.11a ST */ +- if (as->as_required_mode && +- IEEE80211_IS_CHAN_STURBO(c->chan) && +- (as->as_vap_desired_mode != IEEE80211_MODE_TURBO_STATIC_A)) +- continue; +- + /* Verify mode matches any fixed mode specified */ + if((c->chan->ic_flags & as->as_required_mode) != + as->as_required_mode) +Index: madwifi-trunk-r3314/net80211/ieee80211_scan.c +=================================================================== +--- madwifi-trunk-r3314.orig/net80211/ieee80211_scan.c 2008-06-01 04:46:11.000000000 +0200 ++++ madwifi-trunk-r3314/net80211/ieee80211_scan.c 2008-06-01 05:24:44.000000000 +0200 +@@ -958,6 +958,80 @@ + } + } + ++static const u_int chanflags[] = { ++ 0, /* IEEE80211_MODE_AUTO */ ++ IEEE80211_CHAN_A, /* IEEE80211_MODE_11A */ ++ IEEE80211_CHAN_B, /* IEEE80211_MODE_11B */ ++ IEEE80211_CHAN_PUREG, /* IEEE80211_MODE_11G */ ++ IEEE80211_CHAN_FHSS, /* IEEE80211_MODE_FH */ ++ IEEE80211_CHAN_A, /* IEEE80211_MODE_TURBO_A */ /* for turbo mode look for AP in normal channel */ ++ IEEE80211_CHAN_PUREG, /* IEEE80211_MODE_TURBO_G */ ++ IEEE80211_CHAN_ST, /* IEEE80211_MODE_TURBO_STATIC_A */ ++}; ++ ++static struct ieee80211_channel * ++find11gchannel(struct ieee80211com *ic, int i, int freq) ++{ ++ struct ieee80211_channel *c; ++ int j; ++ ++ /* ++ * The normal ordering in the channel list is b channel ++ * immediately followed by g so optimize the search for ++ * this. We'll still do a full search just in case. ++ */ ++ for (j = i+1; j < ic->ic_nchans; j++) { ++ c = &ic->ic_channels[j]; ++ if (c->ic_freq == freq && IEEE80211_IS_CHAN_ANYG(c)) ++ return c; ++ } ++ for (j = 0; j < i; j++) { ++ c = &ic->ic_channels[j]; ++ if (c->ic_freq == freq && IEEE80211_IS_CHAN_ANYG(c)) ++ return c; ++ } ++ return NULL; ++} ++ ++ ++void ++ieee80211_scan_add_channels(struct ieee80211com *ic, ++ struct ieee80211_scan_state *ss, ++ enum ieee80211_phymode mode) ++{ ++ struct ieee80211_channel *c, *cg; ++ u_int modeflags; ++ int i; ++ ++ KASSERT(mode < ARRAY_SIZE(chanflags), ("Unexpected mode %u", mode)); ++ modeflags = chanflags[mode]; ++ for (i = 0; i < ic->ic_nchans; i++) { ++ c = &ic->ic_channels[i]; ++ if (c == NULL || isclr(ic->ic_chan_active, c->ic_ieee)) ++ continue; ++ if (c->ic_scanflags & IEEE80211_NOSCAN_SET) ++ continue; ++ if (modeflags && ++ ((c->ic_flags & IEEE80211_CHAN_ALLTURBO) != ++ (modeflags & IEEE80211_CHAN_ALLTURBO))) ++ continue; ++ if (mode == IEEE80211_MODE_AUTO) { ++ /* ++ * XXX special-case 11b/g channels so we select ++ * the g channel if both are present. ++ */ ++ if (IEEE80211_IS_CHAN_B(c) && ++ (cg = find11gchannel(ic, i, c->ic_freq)) != NULL) ++ continue; ++ } ++ if (ss->ss_last >= IEEE80211_SCAN_MAX) ++ break; ++ ss->ss_chans[ss->ss_last++] = c; ++ } ++} ++EXPORT_SYMBOL(ieee80211_scan_add_channels); ++ ++ + /* + * Execute radar channel change. This is called when a radar/dfs + * signal is detected. AP mode only. Return 1 on success, 0 on +Index: madwifi-trunk-r3314/net80211/ieee80211_scan.h +=================================================================== +--- madwifi-trunk-r3314.orig/net80211/ieee80211_scan.h 2008-06-01 04:46:05.000000000 +0200 ++++ madwifi-trunk-r3314/net80211/ieee80211_scan.h 2008-06-01 04:46:33.000000000 +0200 +@@ -219,4 +219,7 @@ + void ieee80211_scanner_unregister(enum ieee80211_opmode, + const struct ieee80211_scanner *); + void ieee80211_scanner_unregister_all(const struct ieee80211_scanner *); ++void ieee80211_scan_add_channels(struct ieee80211com *ic, ++ struct ieee80211_scan_state *ss, ++ enum ieee80211_phymode mode); + #endif /* _NET80211_IEEE80211_SCAN_H_ */ +Index: madwifi-trunk-r3314/net80211/ieee80211_wireless.c +=================================================================== +--- madwifi-trunk-r3314.orig/net80211/ieee80211_wireless.c 2008-06-01 04:46:30.000000000 +0200 ++++ madwifi-trunk-r3314/net80211/ieee80211_wireless.c 2008-06-01 04:46:33.000000000 +0200 +@@ -3873,6 +3873,106 @@ + return ieee80211_ioctl_setmlme(dev, info, w, (char *)&mlme); + } + ++static inline void setflag(struct ieee80211_channel *c, int flag) ++{ ++ if (flag) ++ c->ic_scanflags |= IEEE80211_NOSCAN_SET; ++ else ++ c->ic_scanflags &= ~IEEE80211_NOSCAN_SET; ++} ++ ++static void setscanflag(struct ieee80211com *ic, int min, int max, int set) ++{ ++ int i; ++ ++ for (i = 0; i < ic->ic_nchans; i++) { ++ struct ieee80211_channel *c = &ic->ic_channels[i]; ++ ++ if (min == -1) { ++ if (!(c->ic_scanflags & IEEE80211_NOSCAN_DEFAULT)) ++ setflag(c, set); ++ } else if ((c->ic_freq >= min) && (c->ic_freq <= max)) { ++ setflag(c, set); ++ } ++ } ++} ++ ++static int ++ieee80211_ioctl_setscanlist(struct net_device *dev, ++ struct iw_request_info *info, ++ struct iw_point *data, char *extra) ++{ ++ struct ieee80211vap *vap = dev->priv; ++ struct ieee80211com *ic = vap->iv_ic; ++ char *s, *next; ++ int val = 1; ++ ++ if (data->length <= 0) ++ return -EINVAL; ++ ++ s = kmalloc(data->length + 1, GFP_KERNEL); ++ if (!s) ++ return -ENOMEM; ++ ++ memset(s, 0, data->length + 1); ++ if (copy_from_user(s, data->pointer, data->length)) ++ return -EFAULT; ++ ++ s[data->length - 1] = '\0'; /* ensure null termination */ ++ ++ switch(*s) { ++ case '-': ++ val = 1; ++ break; ++ case '+': ++ val = 0; ++ break; ++ default: ++ goto error; ++ } ++ s++; ++ next = s; ++ do { ++ next = strchr(s, ','); ++ if (next) { ++ *next = 0; ++ next++; ++ } ++ if (!strcmp(s, "ALL")) { ++ setscanflag(ic, 0, 10000, val); ++ } else if (!strcmp(s, "REG")) { ++ setscanflag(ic, -1, -1, val); ++ } else { ++ int min, max; ++ char *n, *end = NULL; ++ ++ n = strchr(s, '-'); ++ if (n) { ++ *n = 0; ++ n++; ++ } ++ min = simple_strtoul(s, &end, 10); ++ if (end && *end) ++ goto error; ++ if (n) { ++ max = simple_strtoul(n, &end, 10); ++ if (end && *end) ++ goto error; ++ } else { ++ max = min; ++ } ++ setscanflag(ic, min, max, val); ++ } ++ s = next; ++ } while (next); ++ return 0; ++ ++error: ++ if (s) ++ kfree(s); ++ return -EINVAL; ++} ++ + static int + ieee80211_ioctl_addmac(struct net_device *dev, struct iw_request_info *info, + void *w, char *extra) +@@ -5656,6 +5756,8 @@ + IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, 0, "minrate"}, + {IEEE80211_PARAM_MINRATE, + 0, IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, "get_minrate"}, ++ { IEEE80211_IOCTL_SETSCANLIST, ++ IW_PRIV_TYPE_CHAR | 255, 0, "setscanlist"}, + + #ifdef ATH_REVERSE_ENGINEERING + /* +@@ -5753,6 +5855,7 @@ + set_priv(IEEE80211_IOCTL_WDSADDMAC, ieee80211_ioctl_wdsmac), + set_priv(IEEE80211_IOCTL_WDSDELMAC, ieee80211_ioctl_wdsdelmac), + set_priv(IEEE80211_IOCTL_KICKMAC, ieee80211_ioctl_kickmac), ++ set_priv(IEEE80211_IOCTL_SETSCANLIST, ieee80211_ioctl_setscanlist), + #ifdef ATH_REVERSE_ENGINEERING + set_priv(IEEE80211_IOCTL_READREG, ieee80211_ioctl_readreg), + set_priv(IEEE80211_IOCTL_WRITEREG, ieee80211_ioctl_writereg), From naw at greptar.com Mon Aug 31 11:05:34 2009 From: naw at greptar.com (Nathan Wharton) Date: Mon, 31 Aug 2009 11:05:34 -0500 Subject: [Avila] GPS access via gpsd In-Reply-To: <515045.33487.qm@web82103.mail.mud.yahoo.com> References: <188640.77238.qm@web82106.mail.mud.yahoo.com> <515045.33487.qm@web82103.mail.mud.yahoo.com> Message-ID: <56afad540908310905q78d192bdpc7c2f83db29e6e94@mail.gmail.com> I am using a 2350 with the GPS module on openwrt trunk with those patches present. About half the time after a cold boot the added messages for trimble don't show up in the stream, only the 2 default messages. Even though the data coming from the GPS looks good, it seems that commands to the GPS must be getting garbled. I have to issue a command several times before the GPS will respond to it. On Fri, Feb 27, 2009 at 12:50 PM, Tim Harvey wrote: > ah... I see the kernel version for ixp4xx was bumped to 2.6.28 just last > week and the cambria-uart patch is a part of that kernel not the kernel ver > in the 8.09 release. So hopefully this will resolve my issues. > > I'll report my findings tomorrow. > > Thanks, > > Tim > > > > ----- Original Message ---- > From: Imre Kaloz > To: Tim Harvey ; avila at lists.gateworks.com > Sent: Friday, February 27, 2009 8:57:14 AM > Subject: Re: [Avila] GPS access via gpsd > > Hello Tim, > > On 2009.02.27. 17:41:28 Tim Harvey wrote: > > > Has anyone had issues with the GPS module using gpsd? I'm currently > using a GW2350 with on-board GPS module and it would appear that perhaps the > Trimble module is using something other than 8N1 serial configuration as > this is what gpsd uses (hard-coded) and looking at gpsd logs some of the > messages from the gps have some duplicate characters indicative of serial > misconfiguration. I'm told that Trimble often uses 7E1 but I haven't been > able to confirm this. Before I go on a possible goose chase and start > patching gpsd I was wondering if anyone else had seen some issues like this > or had more info? I'm using gpsd 2.37 and OpenWRT 8.09 (also tried gpsd > 2.38 with the same results). > > > > Basically, the state of my GW2350+GPS is such that many of the messages > from the GPS are tossed by gpsd and it takes many minutes to get a fix and > often the fix is lost or I get funny data. > > > > I've used the 'GPS module' on a GW2348-4 in the past and don't recall > these issues but perhaps I just didn't notice them back then. It was also a > different version of gpsd, and a completely different toolchain/build. Are > there any differences in the part used with the GPS module on the avila and > the one on the Cambria? > > Please try trunk instead of 8.09, and let me know if everything works > there. > > > Regards, > > Imre > > > _______________________________________________ > Avila mailing list > Avila at lists.gateworks.com > http://lists.gateworks.com/cgi-bin/mailman/listinfo/avila > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.gateworks.com/pipermail/avila/attachments/20090831/8152ab2a/attachment.htm