diff options
author | Waldemar Brodkorb <wbx@openadk.org> | 2010-09-17 15:29:05 +0200 |
---|---|---|
committer | Waldemar Brodkorb <wbx@openadk.org> | 2010-09-17 15:29:05 +0200 |
commit | b2e4bbd4e62982852b8a7da8f618d01d2013641e (patch) | |
tree | 968e7998c78e750162e60c747ab039f78d2f8289 /target | |
parent | 1a2a22729ff0256725a3561e46f465efc18801f7 (diff) | |
parent | d6aaf0be5bfa8e5944d9ae44cf175f9388564ac6 (diff) |
Merge branch 'master' of git+ssh://openadk.org/git/openadk
Conflicts:
package/binutils/Makefile
Diffstat (limited to 'target')
-rw-r--r-- | target/Config.in | 39 | ||||
-rw-r--r-- | target/Makefile | 8 | ||||
-rw-r--r-- | target/lemote/kernel.config | 170 | ||||
-rw-r--r-- | target/lemote/patches/lemote.patch | 32413 | ||||
-rw-r--r-- | target/linux/Config.in | 1 | ||||
-rw-r--r-- | target/linux/config/Config.in.multimedia | 2 | ||||
-rw-r--r-- | target/linux/config/Config.in.netdevice | 9 | ||||
-rw-r--r-- | target/linux/config/Config.in.network | 1 | ||||
-rw-r--r-- | target/linux/config/Config.in.usb | 5 | ||||
-rw-r--r-- | target/linux/kernel.control | 2 | ||||
-rw-r--r-- | target/native/Makefile | 4 | ||||
-rw-r--r-- | target/native/target.mk | 18 | ||||
-rw-r--r-- | target/target.lst | 36 |
13 files changed, 74 insertions, 32634 deletions
diff --git a/target/Config.in b/target/Config.in index fc3e07b97..8d18ad8c5 100644 --- a/target/Config.in +++ b/target/Config.in @@ -20,6 +20,9 @@ config ADK_TARGET_WITH_MINIPCI config ADK_TARGET_WITH_VGA bool +config ADK_TARGET_WITH_HDD + bool + config ADK_TARGET_WITH_INPUT bool @@ -202,6 +205,7 @@ config ADK_TARGET default "rescue-mipsel" if ADK_mipsel_rescue default "shuttle" if ADK_shuttle + # c library config ADK_uclibc tristate @@ -229,6 +233,8 @@ config ADK_LINUX_NATIVE bool "Native platform" select ADK_NATIVE depends on ADK_HOST_LINUX + select ADK_TARGET_WITH_VGA + select ADK_TARGET_WITH_USB help Make a native build. Use host tools. No toolchain will be created. @@ -274,28 +280,8 @@ config ADK_LINUX_CRIS_FOXBOARD config ADK_LINUX_MIPS64_LEMOTE bool "Lemote Subnotebook Yeeloong" select ADK_lemote + select ADK_HARDWARE_YEELONG select ADK_LINUX_64 - select ADK_KERNEL_USB - select ADK_KERNEL_NLS - select ADK_KERNEL_EXT2_FS - select ADK_KERNEL_SCSI - select ADK_KERNEL_ATA - select ADK_KERNEL_BLK_DEV_SD - select ADK_KERNEL_INPUT_KEYBOARD - select ADK_KERNEL_NETDEVICES - select ADK_KERNEL_NET_PCI - select ADK_KERNEL_NET_ETHERNET - select ADK_KERNEL_MII - select ADK_KERNEL_SWAP - select ADK_TARGET_WITH_USB - select ADK_TARGET_WITH_VGA - select ADK_TARGET_WITH_INPUT - select ADK_TARGET_WITH_RTC - select ADK_PACKAGE_KMOD_USB_CONTROLLER - select ADK_KPACKAGE_KMOD_MAC80211 - select ADK_KPACKAGE_KMOD_SND - select ADK_KPACKAGE_KMOD_SND_CS5535AUDIO - select ADK_KPACKAGE_KMOD_SND_OSSEMUL help Lemote Subnotebook. http://www.lemote.com/english/index.html @@ -385,16 +371,7 @@ config ADK_LINUX_TOOLCHAIN config ADK_LINUX_X86_IBMX40 bool "IBM X40 laptop" select ADK_ibmx40 - select ADK_TARGET_WITH_USB - select ADK_TARGET_WITH_VGA - select ADK_TARGET_WITH_PCI - select ADK_TARGET_WITH_INPUT - select ADK_TARGET_WITH_CARDBUS - select ADK_KERNEL_INPUT_KEYBOARD - select ADK_KERNEL_SCSI - select ADK_KERNEL_NETDEVICES - select ADK_KERNEL_NET_PCI - select ADK_KERNEL_NET_ETHERNET + select ADK_HARDWARE_IBMX40 help Support for a IBM X40 laptop. Status: development diff --git a/target/Makefile b/target/Makefile index 5e7259d8a..dc2d3dd5a 100644 --- a/target/Makefile +++ b/target/Makefile @@ -39,9 +39,13 @@ config-prepare: $(TOPDIR)/.config sed 's/=y/=m/' >${BUILD_DIR}/.kernelconfig.modkernel @sed -n '/^# ADK_KERNEL/s//# CONFIG/p' ${TOPDIR}/.config \ >${BUILD_DIR}/.kernelconfig.nokernel -# if native build, first try /proc/config.gz ifeq ($(ADK_NATIVE),y) - @if [ -f /proc/config.gz ];then zcat /proc/config.gz > ${BUILD_DIR}/.kernelconfig.board; else cp ${ADK_TARGET}/kernel.config.$(ARCH) ${BUILD_DIR}/.kernelconfig.board; fi + @if [ -f /etc/adktarget ];then \ + target=$$(cat /etc/adktarget); \ + cp $(TOPDIR)/target/$$target/kernel.config ${BUILD_DIR}/.kernelconfig.board; \ + else \ + if [ -f /proc/config.gz ];then zcat /proc/config.gz > ${BUILD_DIR}/.kernelconfig.board; else cp ${ADK_TARGET}/kernel.config.$(ARCH) ${BUILD_DIR}/.kernelconfig.board; fi; \ + fi else @cp ${ADK_TARGET}/kernel.config ${BUILD_DIR}/.kernelconfig.board endif diff --git a/target/lemote/kernel.config b/target/lemote/kernel.config index 6b536c015..f6188f044 100644 --- a/target/lemote/kernel.config +++ b/target/lemote/kernel.config @@ -1,7 +1,7 @@ # # Automatically generated make config: don't edit # Linux kernel version: 2.6.35 -# Thu Aug 5 22:28:58 2010 +# Thu Aug 12 17:36:41 2010 # CONFIG_MIPS=y @@ -360,7 +360,7 @@ CONFIG_SUSPEND_NVS=y CONFIG_SUSPEND=y CONFIG_SUSPEND_FREEZER=y CONFIG_HIBERNATION=y -CONFIG_PM_STD_PARTITION="/dev/mapper/swap" +CONFIG_PM_STD_PARTITION="/dev/sda3" # CONFIG_PM_RUNTIME is not set CONFIG_PM_OPS=y CONFIG_MIPS_EXTERNAL_TIMER=y @@ -508,7 +508,6 @@ CONFIG_BLK_DEV=y # # CONFIG_BLK_DEV_NBD is not set # CONFIG_BLK_DEV_SX8 is not set -# CONFIG_BLK_DEV_UB is not set # CONFIG_BLK_DEV_RAM is not set # CONFIG_CDROM_PKTCDVD is not set # CONFIG_ATA_OVER_ETH is not set @@ -739,22 +738,11 @@ CONFIG_8139TOO_TUNE_TWISTER=y CONFIG_WLAN=y # CONFIG_ATMEL is not set # CONFIG_PRISM54 is not set -# CONFIG_USB_ZD1201 is not set # CONFIG_HOSTAP is not set # # Enable WiMAX (Networking options) to see the WiMAX drivers # - -# -# USB Network Adapters -# -# CONFIG_USB_CATC is not set -# CONFIG_USB_KAWETH is not set -# CONFIG_USB_PEGASUS is not set -# CONFIG_USB_RTL8150 is not set -# CONFIG_USB_USBNET is not set -# CONFIG_USB_IPHETH is not set # CONFIG_WAN is not set # CONFIG_FDDI is not set # CONFIG_HIPPI is not set @@ -810,8 +798,6 @@ CONFIG_MOUSE_PS2_SYNAPTICS=y # CONFIG_MOUSE_PS2_SENTELIC is not set # CONFIG_MOUSE_PS2_TOUCHKIT is not set # CONFIG_MOUSE_SERIAL is not set -# CONFIG_MOUSE_APPLETOUCH is not set -# CONFIG_MOUSE_BCM5974 is not set # CONFIG_MOUSE_INPORT is not set # CONFIG_MOUSE_LOGIBM is not set # CONFIG_MOUSE_PC110PAD is not set @@ -954,16 +940,7 @@ CONFIG_SSB_POSSIBLE=y # Sonics Silicon Backplane # # CONFIG_SSB is not set -CONFIG_MFD_SUPPORT=y -# CONFIG_MFD_CORE is not set -# CONFIG_MFD_SM501 is not set -# CONFIG_HTC_PASIC3 is not set -# CONFIG_MFD_TMIO is not set -# CONFIG_ABX500_CORE is not set -# CONFIG_MFD_TIMBERDALE is not set -# CONFIG_LPC_SCH is not set -# CONFIG_MFD_RDC321X is not set -# CONFIG_MFD_JANZ_CMODIO is not set +# CONFIG_MFD_SUPPORT is not set # CONFIG_REGULATOR is not set # CONFIG_MEDIA_SUPPORT is not set @@ -1049,133 +1026,24 @@ CONFIG_DUMMY_CONSOLE=y CONFIG_FRAMEBUFFER_CONSOLE=y # CONFIG_FRAMEBUFFER_CONSOLE_DETECT_PRIMARY is not set # CONFIG_FRAMEBUFFER_CONSOLE_ROTATION is not set -# CONFIG_FONTS is not set -CONFIG_FONT_8x8=y +CONFIG_FONTS=y +# CONFIG_FONT_8x8 is not set CONFIG_FONT_8x16=y +# CONFIG_FONT_6x11 is not set +# CONFIG_FONT_7x14 is not set +# CONFIG_FONT_PEARL_8x8 is not set +# CONFIG_FONT_ACORN_8x8 is not set +# CONFIG_FONT_MINI_4x6 is not set +# CONFIG_FONT_SUN8x16 is not set +# CONFIG_FONT_SUN12x22 is not set +# CONFIG_FONT_10x18 is not set CONFIG_LOGO=y # CONFIG_LOGO_LINUX_MONO is not set # CONFIG_LOGO_LINUX_VGA16 is not set CONFIG_LOGO_LINUX_CLUT224=y # CONFIG_SOUND is not set -CONFIG_HID_SUPPORT=y -CONFIG_HID=y -# CONFIG_HIDRAW is not set - -# -# USB Input Devices -# -# CONFIG_USB_HID is not set -# CONFIG_HID_PID is not set - -# -# USB HID Boot Protocol drivers -# -# CONFIG_USB_KBD is not set -# CONFIG_USB_MOUSE is not set - -# -# Special HID drivers -# -CONFIG_USB_SUPPORT=y -CONFIG_USB_ARCH_HAS_HCD=y -CONFIG_USB_ARCH_HAS_OHCI=y -CONFIG_USB_ARCH_HAS_EHCI=y -CONFIG_USB=y -# CONFIG_USB_DEBUG is not set -# CONFIG_USB_ANNOUNCE_NEW_DEVICES is not set - -# -# Miscellaneous USB options -# -# CONFIG_USB_DEVICEFS is not set -# CONFIG_USB_DEVICE_CLASS is not set -CONFIG_USB_DYNAMIC_MINORS=y -# CONFIG_USB_OTG_WHITELIST is not set -# CONFIG_USB_OTG_BLACKLIST_HUB is not set -# CONFIG_USB_MON is not set -# CONFIG_USB_WUSB is not set -# CONFIG_USB_WUSB_CBAF is not set - -# -# USB Host Controller Drivers -# -# CONFIG_USB_C67X00_HCD is not set -# CONFIG_USB_XHCI_HCD is not set -CONFIG_USB_EHCI_HCD=y -CONFIG_USB_EHCI_ROOT_HUB_TT=y -# CONFIG_USB_EHCI_TT_NEWSCHED is not set -# CONFIG_USB_OXU210HP_HCD is not set -# CONFIG_USB_ISP116X_HCD is not set -# CONFIG_USB_ISP1760_HCD is not set -# CONFIG_USB_ISP1362_HCD is not set -CONFIG_USB_OHCI_HCD=y -# CONFIG_USB_OHCI_BIG_ENDIAN_DESC is not set -# CONFIG_USB_OHCI_BIG_ENDIAN_MMIO is not set -CONFIG_USB_OHCI_LITTLE_ENDIAN=y -# CONFIG_USB_UHCI_HCD is not set -# CONFIG_USB_SL811_HCD is not set -# CONFIG_USB_R8A66597_HCD is not set -# CONFIG_USB_WHCI_HCD is not set -# CONFIG_USB_HWA_HCD is not set - -# -# USB Device Class drivers -# -# CONFIG_USB_ACM is not set -# CONFIG_USB_PRINTER is not set -# CONFIG_USB_WDM is not set -# CONFIG_USB_TMC is not set - -# -# NOTE: USB_STORAGE depends on SCSI but BLK_DEV_SD may -# - -# -# also be needed; see USB_STORAGE Help for more info -# -# CONFIG_USB_STORAGE is not set -# CONFIG_USB_LIBUSUAL is not set - -# -# USB Imaging devices -# -# CONFIG_USB_MDC800 is not set -# CONFIG_USB_MICROTEK is not set - -# -# USB port drivers -# -# CONFIG_USB_SERIAL is not set - -# -# USB Miscellaneous drivers -# -# CONFIG_USB_EMI62 is not set -# CONFIG_USB_EMI26 is not set -# CONFIG_USB_ADUTUX is not set -# CONFIG_USB_SEVSEG is not set -# CONFIG_USB_RIO500 is not set -# CONFIG_USB_LEGOTOWER is not set -# CONFIG_USB_LCD is not set -# CONFIG_USB_LED is not set -# CONFIG_USB_CYPRESS_CY7C63 is not set -# CONFIG_USB_CYTHERM is not set -# CONFIG_USB_IDMOUSE is not set -# CONFIG_USB_FTDI_ELAN is not set -# CONFIG_USB_APPLEDISPLAY is not set -# CONFIG_USB_SISUSBVGA is not set -# CONFIG_USB_LD is not set -# CONFIG_USB_TRANCEVIBRATOR is not set -# CONFIG_USB_IOWARRIOR is not set -# CONFIG_USB_TEST is not set -# CONFIG_USB_ISIGHTFW is not set -# CONFIG_USB_GADGET is not set - -# -# OTG and related infrastructure -# -# CONFIG_USB_GPIO_VBUS is not set -# CONFIG_NOP_USB_XCEIV is not set +# CONFIG_HID_SUPPORT is not set +# CONFIG_USB_SUPPORT is not set # CONFIG_UWB is not set CONFIG_MMC=y # CONFIG_MMC_DEBUG is not set @@ -1244,21 +1112,13 @@ CONFIG_RTC_DRV_CMOS=y # CONFIG_UIO is not set CONFIG_STAGING=y # CONFIG_STAGING_EXCLUDE_BUILD is not set -# CONFIG_USB_IP_COMMON is not set -# CONFIG_PRISM2_USB is not set # CONFIG_ECHO is not set # CONFIG_COMEDI is not set -# CONFIG_ASUS_OLED is not set # CONFIG_R8187SE is not set -# CONFIG_RTL8192SU is not set -# CONFIG_RTL8192U is not set # CONFIG_RTL8192E is not set -# CONFIG_TRANZPORT is not set # CONFIG_POHMELFS is not set # CONFIG_IDE_PHISON is not set # CONFIG_VT6655 is not set -# CONFIG_VT6656 is not set -# CONFIG_FB_UDL is not set # CONFIG_VME_BUS is not set # diff --git a/target/lemote/patches/lemote.patch b/target/lemote/patches/lemote.patch index 7785becb0..5922697e7 100644 --- a/target/lemote/patches/lemote.patch +++ b/target/lemote/patches/lemote.patch @@ -1468,32419 +1468,6 @@ diff -Nur linux-2.6.35.orig/drivers/ide/ide-iops.c linux-2.6.35/drivers/ide/ide- for (list = nien_quirk_list; *list != NULL; list++) if (strstr(m, *list) != NULL) { drive->dev_flags |= IDE_DFLAG_NIEN_QUIRK; -diff -Nur linux-2.6.35.orig/drivers/net/wireless/Kconfig linux-2.6.35/drivers/net/wireless/Kconfig ---- linux-2.6.35.orig/drivers/net/wireless/Kconfig 2010-08-02 00:11:14.000000000 +0200 -+++ linux-2.6.35/drivers/net/wireless/Kconfig 2010-08-05 21:12:33.893625922 +0200 -@@ -219,6 +219,19 @@ - - source "drivers/net/wireless/rtl818x/Kconfig" - -+config RTL8187B -+ tristate "Realtek 8187B wifi support for yeeloong2f laptop" -+ depends on MAC80211 && USB && LEMOTE_MACH2F -+ depends on RFKILL || !RFKILL -+ select CRYPTO -+ select WIRELESS_EXT -+ select WEXT_PRIV -+ ---help--- -+ This is a driver for RTL8187B based cards, this driver is especially -+ for yeeloon2f laptop. -+ -+ Thanks to Realtek for their support! -+ - config ADM8211 - tristate "ADMtek ADM8211 support" - depends on MAC80211 && PCI && EXPERIMENTAL -diff -Nur linux-2.6.35.orig/drivers/net/wireless/Makefile linux-2.6.35/drivers/net/wireless/Makefile ---- linux-2.6.35.orig/drivers/net/wireless/Makefile 2010-08-02 00:11:14.000000000 +0200 -+++ linux-2.6.35/drivers/net/wireless/Makefile 2010-08-05 21:12:33.933623443 +0200 -@@ -24,6 +24,7 @@ - obj-$(CONFIG_ZD1211RW) += zd1211rw/ - obj-$(CONFIG_RTL8180) += rtl818x/ - obj-$(CONFIG_RTL8187) += rtl818x/ -+obj-$(CONFIG_RTL8187B) += rtl8187b/ - - # 16-bit wireless PCMCIA client drivers - obj-$(CONFIG_PCMCIA_RAYCS) += ray_cs.o -diff -Nur linux-2.6.35.orig/drivers/net/wireless/rtl8187b/dot11d.h linux-2.6.35/drivers/net/wireless/rtl8187b/dot11d.h ---- linux-2.6.35.orig/drivers/net/wireless/rtl8187b/dot11d.h 1970-01-01 01:00:00.000000000 +0100 -+++ linux-2.6.35/drivers/net/wireless/rtl8187b/dot11d.h 2010-08-05 21:12:33.973622039 +0200 -@@ -0,0 +1,102 @@ -+#ifndef __INC_DOT11D_H -+#define __INC_DOT11D_H -+ -+#include "ieee80211/ieee80211.h" -+ -+//#define ENABLE_DOT11D -+ -+//#define DOT11D_MAX_CHNL_NUM 83 -+ -+typedef struct _CHNL_TXPOWER_TRIPLE { -+ u8 FirstChnl; -+ u8 NumChnls; -+ u8 MaxTxPowerInDbm; -+}CHNL_TXPOWER_TRIPLE, *PCHNL_TXPOWER_TRIPLE; -+ -+typedef enum _DOT11D_STATE { -+ DOT11D_STATE_NONE = 0, -+ DOT11D_STATE_LEARNED, -+ DOT11D_STATE_DONE, -+}DOT11D_STATE; -+ -+typedef struct _RT_DOT11D_INFO { -+ //DECLARE_RT_OBJECT(RT_DOT11D_INFO); -+ -+ bool bEnabled; // dot11MultiDomainCapabilityEnabled -+ -+ u16 CountryIeLen; // > 0 if CountryIeBuf[] contains valid country information element. -+ u8 CountryIeBuf[MAX_IE_LEN]; -+ u8 CountryIeSrcAddr[6]; // Source AP of the country IE. -+ u8 CountryIeWatchdog; -+ -+ u8 channel_map[MAX_CHANNEL_NUMBER+1]; //!!!Value 0: Invalid, 1: Valid (active scan), 2: Valid (passive scan) -+ //u8 ChnlListLen; // #Bytes valid in ChnlList[]. -+ //u8 ChnlList[DOT11D_MAX_CHNL_NUM]; -+ u8 MaxTxPwrDbmList[MAX_CHANNEL_NUMBER+1]; -+ -+ DOT11D_STATE State; -+}RT_DOT11D_INFO, *PRT_DOT11D_INFO; -+#define eqMacAddr(a,b) ( ((a)[0]==(b)[0] && (a)[1]==(b)[1] && (a)[2]==(b)[2] && (a)[3]==(b)[3] && (a)[4]==(b)[4] && (a)[5]==(b)[5]) ? 1:0 ) -+#define cpMacAddr(des,src) ((des)[0]=(src)[0],(des)[1]=(src)[1],(des)[2]=(src)[2],(des)[3]=(src)[3],(des)[4]=(src)[4],(des)[5]=(src)[5]) -+#define GET_DOT11D_INFO(__pIeeeDev) ((PRT_DOT11D_INFO)((__pIeeeDev)->pDot11dInfo)) -+ -+#define IS_DOT11D_ENABLE(__pIeeeDev) GET_DOT11D_INFO(__pIeeeDev)->bEnabled -+#define IS_COUNTRY_IE_VALID(__pIeeeDev) (GET_DOT11D_INFO(__pIeeeDev)->CountryIeLen > 0) -+ -+#define IS_EQUAL_CIE_SRC(__pIeeeDev, __pTa) eqMacAddr(GET_DOT11D_INFO(__pIeeeDev)->CountryIeSrcAddr, __pTa) -+#define UPDATE_CIE_SRC(__pIeeeDev, __pTa) cpMacAddr(GET_DOT11D_INFO(__pIeeeDev)->CountryIeSrcAddr, __pTa) -+ -+#define IS_COUNTRY_IE_CHANGED(__pIeeeDev, __Ie) \ -+ (((__Ie).Length == 0 || (__Ie).Length != GET_DOT11D_INFO(__pIeeeDev)->CountryIeLen) ? \ -+ FALSE : \ -+ (!memcmp(GET_DOT11D_INFO(__pIeeeDev)->CountryIeBuf, (__Ie).Octet, (__Ie).Length))) -+ -+#define CIE_WATCHDOG_TH 1 -+#define GET_CIE_WATCHDOG(__pIeeeDev) GET_DOT11D_INFO(__pIeeeDev)->CountryIeWatchdog -+#define RESET_CIE_WATCHDOG(__pIeeeDev) GET_CIE_WATCHDOG(__pIeeeDev) = 0 -+#define UPDATE_CIE_WATCHDOG(__pIeeeDev) ++GET_CIE_WATCHDOG(__pIeeeDev) -+ -+#define IS_DOT11D_STATE_DONE(__pIeeeDev) (GET_DOT11D_INFO(__pIeeeDev)->State == DOT11D_STATE_DONE) -+ -+ -+void -+Dot11d_Init( -+ struct ieee80211_device *dev -+ ); -+ -+void -+Dot11d_Reset( -+ struct ieee80211_device *dev -+ ); -+ -+void -+Dot11d_UpdateCountryIe( -+ struct ieee80211_device *dev, -+ u8 * pTaddr, -+ u16 CoutryIeLen, -+ u8 * pCoutryIe -+ ); -+ -+u8 -+DOT11D_GetMaxTxPwrInDbm( -+ struct ieee80211_device *dev, -+ u8 Channel -+ ); -+ -+void -+DOT11D_ScanComplete( -+ struct ieee80211_device * dev -+ ); -+ -+int IsLegalChannel( -+ struct ieee80211_device * dev, -+ u8 channel -+); -+ -+int ToLegalChannel( -+ struct ieee80211_device * dev, -+ u8 channel -+); -+ -+void dump_chnl_map(u8 * channel_map); -+#endif // #ifndef __INC_DOT11D_H -diff -Nur linux-2.6.35.orig/drivers/net/wireless/rtl8187b/ieee80211/arc4.c linux-2.6.35/drivers/net/wireless/rtl8187b/ieee80211/arc4.c ---- linux-2.6.35.orig/drivers/net/wireless/rtl8187b/ieee80211/arc4.c 1970-01-01 01:00:00.000000000 +0100 -+++ linux-2.6.35/drivers/net/wireless/rtl8187b/ieee80211/arc4.c 2010-08-05 21:12:34.013621816 +0200 -@@ -0,0 +1,103 @@ -+/* -+ * Cryptographic API -+ * -+ * ARC4 Cipher Algorithm -+ * -+ * Jon Oberheide <jon@oberheide.org> -+ * -+ * This program is free software; you can redistribute it and/or modify -+ * it under the terms of the GNU General Public License as published by -+ * the Free Software Foundation; either version 2 of the License, or -+ * (at your option) any later version. -+ * -+ */ -+#include <linux/module.h> -+#include <linux/init.h> -+#include "rtl_crypto.h" -+ -+#define ARC4_MIN_KEY_SIZE 1 -+#define ARC4_MAX_KEY_SIZE 256 -+#define ARC4_BLOCK_SIZE 1 -+ -+struct arc4_ctx { -+ u8 S[256]; -+ u8 x, y; -+}; -+ -+static int arc4_set_key(void *ctx_arg, const u8 *in_key, unsigned int key_len, u32 *flags) -+{ -+ struct arc4_ctx *ctx = ctx_arg; -+ int i, j = 0, k = 0; -+ -+ ctx->x = 1; -+ ctx->y = 0; -+ -+ for(i = 0; i < 256; i++) -+ ctx->S[i] = i; -+ -+ for(i = 0; i < 256; i++) -+ { -+ u8 a = ctx->S[i]; -+ j = (j + in_key[k] + a) & 0xff; -+ ctx->S[i] = ctx->S[j]; -+ ctx->S[j] = a; -+ if(++k >= key_len) -+ k = 0; -+ } -+ -+ return 0; -+} -+ -+static void arc4_crypt(void *ctx_arg, u8 *out, const u8 *in) -+{ -+ struct arc4_ctx *ctx = ctx_arg; -+ -+ u8 *const S = ctx->S; -+ u8 x = ctx->x; -+ u8 y = ctx->y; -+ u8 a, b; -+ -+ a = S[x]; -+ y = (y + a) & 0xff; -+ b = S[y]; -+ S[x] = b; -+ S[y] = a; -+ x = (x + 1) & 0xff; -+ *out++ = *in ^ S[(a + b) & 0xff]; -+ -+ ctx->x = x; -+ ctx->y = y; -+} -+ -+static struct crypto_alg arc4_alg = { -+ .cra_name = "arc4", -+ .cra_flags = CRYPTO_ALG_TYPE_CIPHER, -+ .cra_blocksize = ARC4_BLOCK_SIZE, -+ .cra_ctxsize = sizeof(struct arc4_ctx), -+ .cra_module = THIS_MODULE, -+ .cra_list = LIST_HEAD_INIT(arc4_alg.cra_list), -+ .cra_u = { .cipher = { -+ .cia_min_keysize = ARC4_MIN_KEY_SIZE, -+ .cia_max_keysize = ARC4_MAX_KEY_SIZE, -+ .cia_setkey = arc4_set_key, -+ .cia_encrypt = arc4_crypt, -+ .cia_decrypt = arc4_crypt } } -+}; -+ -+static int __init arc4_init(void) -+{ -+ return crypto_register_alg(&arc4_alg); -+} -+ -+ -+static void __exit arc4_exit(void) -+{ -+ crypto_unregister_alg(&arc4_alg); -+} -+ -+module_init(arc4_init); -+module_exit(arc4_exit); -+ -+MODULE_LICENSE("GPL"); -+MODULE_DESCRIPTION("ARC4 Cipher Algorithm"); -+MODULE_AUTHOR("Jon Oberheide <jon@oberheide.org>"); -diff -Nur linux-2.6.35.orig/drivers/net/wireless/rtl8187b/ieee80211/dot11d.c linux-2.6.35/drivers/net/wireless/rtl8187b/ieee80211/dot11d.c ---- linux-2.6.35.orig/drivers/net/wireless/rtl8187b/ieee80211/dot11d.c 1970-01-01 01:00:00.000000000 +0100 -+++ linux-2.6.35/drivers/net/wireless/rtl8187b/ieee80211/dot11d.c 2010-08-05 21:12:34.063620315 +0200 -@@ -0,0 +1,244 @@ -+#ifdef ENABLE_DOT11D -+//----------------------------------------------------------------------------- -+// File: -+// Dot11d.c -+// -+// Description: -+// Implement 802.11d. -+// -+//----------------------------------------------------------------------------- -+ -+#include "dot11d.h" -+ -+void -+Dot11d_Init(struct ieee80211_device *ieee) -+{ -+ PRT_DOT11D_INFO pDot11dInfo = GET_DOT11D_INFO(ieee); -+ -+ pDot11dInfo->bEnabled = 0; -+ -+ pDot11dInfo->State = DOT11D_STATE_NONE; -+ pDot11dInfo->CountryIeLen = 0; -+ memset(pDot11dInfo->channel_map, 0, MAX_CHANNEL_NUMBER+1); -+ memset(pDot11dInfo->MaxTxPwrDbmList, 0xFF, MAX_CHANNEL_NUMBER+1); -+ RESET_CIE_WATCHDOG(ieee); -+ -+ //printk("Dot11d_Init()\n"); -+} -+ -+// -+// Description: -+// Reset to the state as we are just entering a regulatory domain. -+// -+void -+Dot11d_Reset(struct ieee80211_device *ieee) -+{ -+ u32 i; -+ PRT_DOT11D_INFO pDot11dInfo = GET_DOT11D_INFO(ieee); -+ -+ // Clear old channel map -+ memset(pDot11dInfo->channel_map, 0, MAX_CHANNEL_NUMBER+1); -+ memset(pDot11dInfo->MaxTxPwrDbmList, 0xFF, MAX_CHANNEL_NUMBER+1); -+ // Set new channel map -+ for (i=1; i<=11; i++) { -+ (pDot11dInfo->channel_map)[i] = 1; -+ } -+ for (i=12; i<=14; i++) { -+ (pDot11dInfo->channel_map)[i] = 2; -+ } -+ -+ pDot11dInfo->State = DOT11D_STATE_NONE; -+ pDot11dInfo->CountryIeLen = 0; -+ RESET_CIE_WATCHDOG(ieee); -+ -+ //printk("Dot11d_Reset()\n"); -+} -+ -+// -+// Description: -+// Update country IE from Beacon or Probe Resopnse -+// and configure PHY for operation in the regulatory domain. -+// -+// TODO: -+// Configure Tx power. -+// -+// Assumption: -+// 1. IS_DOT11D_ENABLE() is TRUE. -+// 2. Input IE is an valid one. -+// -+void -+Dot11d_UpdateCountryIe( -+ struct ieee80211_device *dev, -+ u8 * pTaddr, -+ u16 CoutryIeLen, -+ u8 * pCoutryIe -+ ) -+{ -+ PRT_DOT11D_INFO pDot11dInfo = GET_DOT11D_INFO(dev); -+ u8 i, j, NumTriples, MaxChnlNum; -+ PCHNL_TXPOWER_TRIPLE pTriple; -+ -+ if((CoutryIeLen - 3)%3 != 0) -+ { -+ printk("Dot11d_UpdateCountryIe(): Invalid country IE, skip it........1\n"); -+ Dot11d_Reset(dev); -+ return; -+ } -+ -+ memset(pDot11dInfo->channel_map, 0, MAX_CHANNEL_NUMBER+1); -+ memset(pDot11dInfo->MaxTxPwrDbmList, 0xFF, MAX_CHANNEL_NUMBER+1); -+ MaxChnlNum = 0; -+ NumTriples = (CoutryIeLen - 3) / 3; // skip 3-byte country string. -+ pTriple = (PCHNL_TXPOWER_TRIPLE)(pCoutryIe + 3); -+ for(i = 0; i < NumTriples; i++) -+ { -+ if(MaxChnlNum >= pTriple->FirstChnl) -+ { // It is not in a monotonically increasing order, so stop processing. -+ printk("Dot11d_UpdateCountryIe(): Invalid country IE, skip it........1\n"); -+ Dot11d_Reset(dev); -+ return; -+ } -+ if(MAX_CHANNEL_NUMBER < (pTriple->FirstChnl + pTriple->NumChnls)) -+ { // It is not a valid set of channel id, so stop processing. -+ printk("Dot11d_UpdateCountryIe(): Invalid country IE, skip it........2\n"); -+ Dot11d_Reset(dev); -+ return; -+ } -+ -+ for(j = 0 ; j < pTriple->NumChnls; j++) -+ { -+ pDot11dInfo->channel_map[pTriple->FirstChnl + j] = 1; -+ pDot11dInfo->MaxTxPwrDbmList[pTriple->FirstChnl + j] = pTriple->MaxTxPowerInDbm; -+ MaxChnlNum = pTriple->FirstChnl + j; -+ } -+ -+ pTriple = (PCHNL_TXPOWER_TRIPLE)((u8*)pTriple + 3); -+ } -+#if 1 -+ //printk("Dot11d_UpdateCountryIe(): Channel List:\n"); -+ printk("Channel List:"); -+ for(i=1; i<= MAX_CHANNEL_NUMBER; i++) -+ if(pDot11dInfo->channel_map[i] > 0) -+ printk(" %d", i); -+ printk("\n"); -+#endif -+ -+ UPDATE_CIE_SRC(dev, pTaddr); -+ -+ pDot11dInfo->CountryIeLen = CoutryIeLen; -+ memcpy(pDot11dInfo->CountryIeBuf, pCoutryIe,CoutryIeLen); -+ pDot11dInfo->State = DOT11D_STATE_LEARNED; -+} -+ -+void dump_chnl_map(u8 * channel_map) -+{ -+ int i; -+ printk("Channel List:"); -+ for(i=1; i<= MAX_CHANNEL_NUMBER; i++) -+ if(channel_map[i] > 0) -+ printk(" %d(%d)", i, channel_map[i]); -+ printk("\n"); -+} -+ -+u8 -+DOT11D_GetMaxTxPwrInDbm( -+ struct ieee80211_device *dev, -+ u8 Channel -+ ) -+{ -+ PRT_DOT11D_INFO pDot11dInfo = GET_DOT11D_INFO(dev); -+ u8 MaxTxPwrInDbm = 255; -+ -+ if(MAX_CHANNEL_NUMBER < Channel) -+ { -+ printk("DOT11D_GetMaxTxPwrInDbm(): Invalid Channel\n"); -+ return MaxTxPwrInDbm; -+ } -+ if(pDot11dInfo->channel_map[Channel]) -+ { -+ MaxTxPwrInDbm = pDot11dInfo->MaxTxPwrDbmList[Channel]; -+ } -+ -+ return MaxTxPwrInDbm; -+} -+ -+ -+void -+DOT11D_ScanComplete( -+ struct ieee80211_device * dev -+ ) -+{ -+ PRT_DOT11D_INFO pDot11dInfo = GET_DOT11D_INFO(dev); -+ -+ switch(pDot11dInfo->State) -+ { -+ case DOT11D_STATE_LEARNED: -+ pDot11dInfo->State = DOT11D_STATE_DONE; -+ break; -+ -+ case DOT11D_STATE_DONE: -+ if( GET_CIE_WATCHDOG(dev) == 0 ) -+ { // Reset country IE if previous one is gone. -+ Dot11d_Reset(dev); -+ } -+ break; -+ case DOT11D_STATE_NONE: -+ break; -+ } -+} -+ -+int IsLegalChannel( -+ struct ieee80211_device * dev, -+ u8 channel -+) -+{ -+ PRT_DOT11D_INFO pDot11dInfo = GET_DOT11D_INFO(dev); -+ -+ if(MAX_CHANNEL_NUMBER < channel) -+ { -+ printk("IsLegalChannel(): Invalid Channel\n"); -+ return 0; -+ } -+ if(pDot11dInfo->channel_map[channel] > 0) -+ return 1; -+ return 0; -+} -+ -+int ToLegalChannel( -+ struct ieee80211_device * dev, -+ u8 channel -+) -+{ -+ PRT_DOT11D_INFO pDot11dInfo = GET_DOT11D_INFO(dev); -+ u8 default_chn = 0; -+ u32 i = 0; -+ -+ for (i=1; i<= MAX_CHANNEL_NUMBER; i++) -+ { -+ if(pDot11dInfo->channel_map[i] > 0) -+ { -+ default_chn = i; -+ break; -+ } -+ } -+ -+ if(MAX_CHANNEL_NUMBER < channel) -+ { -+ printk("IsLegalChannel(): Invalid Channel\n"); -+ return default_chn; -+ } -+ -+ if(pDot11dInfo->channel_map[channel] > 0) -+ return channel; -+ -+ return default_chn; -+} -+ -+EXPORT_SYMBOL(Dot11d_Init); -+EXPORT_SYMBOL(Dot11d_Reset); -+EXPORT_SYMBOL(Dot11d_UpdateCountryIe); -+EXPORT_SYMBOL(DOT11D_GetMaxTxPwrInDbm); -+EXPORT_SYMBOL(DOT11D_ScanComplete); -+EXPORT_SYMBOL(IsLegalChannel); -+EXPORT_SYMBOL(ToLegalChannel); -+#endif -diff -Nur linux-2.6.35.orig/drivers/net/wireless/rtl8187b/ieee80211/dot11d.h linux-2.6.35/drivers/net/wireless/rtl8187b/ieee80211/dot11d.h ---- linux-2.6.35.orig/drivers/net/wireless/rtl8187b/ieee80211/dot11d.h 1970-01-01 01:00:00.000000000 +0100 -+++ linux-2.6.35/drivers/net/wireless/rtl8187b/ieee80211/dot11d.h 2010-08-05 21:12:34.103620371 +0200 -@@ -0,0 +1,102 @@ -+#ifndef __INC_DOT11D_H -+#define __INC_DOT11D_H -+ -+#include "ieee80211.h" -+ -+//#define ENABLE_DOT11D -+ -+//#define DOT11D_MAX_CHNL_NUM 83 -+ -+typedef struct _CHNL_TXPOWER_TRIPLE { -+ u8 FirstChnl; -+ u8 NumChnls; -+ u8 MaxTxPowerInDbm; -+}CHNL_TXPOWER_TRIPLE, *PCHNL_TXPOWER_TRIPLE; -+ -+typedef enum _DOT11D_STATE { -+ DOT11D_STATE_NONE = 0, -+ DOT11D_STATE_LEARNED, -+ DOT11D_STATE_DONE, -+}DOT11D_STATE; -+ -+typedef struct _RT_DOT11D_INFO { -+ //DECLARE_RT_OBJECT(RT_DOT11D_INFO); -+ -+ bool bEnabled; // dot11MultiDomainCapabilityEnabled -+ -+ u16 CountryIeLen; // > 0 if CountryIeBuf[] contains valid country information element. -+ u8 CountryIeBuf[MAX_IE_LEN]; -+ u8 CountryIeSrcAddr[6]; // Source AP of the country IE. -+ u8 CountryIeWatchdog; -+ -+ u8 channel_map[MAX_CHANNEL_NUMBER+1]; //!!!Value 0: Invalid, 1: Valid (active scan), 2: Valid (passive scan) -+ //u8 ChnlListLen; // #Bytes valid in ChnlList[]. -+ //u8 ChnlList[DOT11D_MAX_CHNL_NUM]; -+ u8 MaxTxPwrDbmList[MAX_CHANNEL_NUMBER+1]; -+ -+ DOT11D_STATE State; -+}RT_DOT11D_INFO, *PRT_DOT11D_INFO; -+#define eqMacAddr(a,b) ( ((a)[0]==(b)[0] && (a)[1]==(b)[1] && (a)[2]==(b)[2] && (a)[3]==(b)[3] && (a)[4]==(b)[4] && (a)[5]==(b)[5]) ? 1:0 ) -+#define cpMacAddr(des,src) ((des)[0]=(src)[0],(des)[1]=(src)[1],(des)[2]=(src)[2],(des)[3]=(src)[3],(des)[4]=(src)[4],(des)[5]=(src)[5]) -+#define GET_DOT11D_INFO(__pIeeeDev) ((PRT_DOT11D_INFO)((__pIeeeDev)->pDot11dInfo)) -+ -+#define IS_DOT11D_ENABLE(__pIeeeDev) GET_DOT11D_INFO(__pIeeeDev)->bEnabled -+#define IS_COUNTRY_IE_VALID(__pIeeeDev) (GET_DOT11D_INFO(__pIeeeDev)->CountryIeLen > 0) -+ -+#define IS_EQUAL_CIE_SRC(__pIeeeDev, __pTa) eqMacAddr(GET_DOT11D_INFO(__pIeeeDev)->CountryIeSrcAddr, __pTa) -+#define UPDATE_CIE_SRC(__pIeeeDev, __pTa) cpMacAddr(GET_DOT11D_INFO(__pIeeeDev)->CountryIeSrcAddr, __pTa) -+ -+#define IS_COUNTRY_IE_CHANGED(__pIeeeDev, __Ie) \ -+ (((__Ie).Length == 0 || (__Ie).Length != GET_DOT11D_INFO(__pIeeeDev)->CountryIeLen) ? \ -+ FALSE : \ -+ (!memcmp(GET_DOT11D_INFO(__pIeeeDev)->CountryIeBuf, (__Ie).Octet, (__Ie).Length))) -+ -+#define CIE_WATCHDOG_TH 1 -+#define GET_CIE_WATCHDOG(__pIeeeDev) GET_DOT11D_INFO(__pIeeeDev)->CountryIeWatchdog -+#define RESET_CIE_WATCHDOG(__pIeeeDev) GET_CIE_WATCHDOG(__pIeeeDev) = 0 -+#define UPDATE_CIE_WATCHDOG(__pIeeeDev) ++GET_CIE_WATCHDOG(__pIeeeDev) -+ -+#define IS_DOT11D_STATE_DONE(__pIeeeDev) (GET_DOT11D_INFO(__pIeeeDev)->State == DOT11D_STATE_DONE) -+ -+ -+void -+Dot11d_Init( -+ struct ieee80211_device *dev -+ ); -+ -+void -+Dot11d_Reset( -+ struct ieee80211_device *dev -+ ); -+ -+void -+Dot11d_UpdateCountryIe( -+ struct ieee80211_device *dev, -+ u8 * pTaddr, -+ u16 CoutryIeLen, -+ u8 * pCoutryIe -+ ); -+ -+u8 -+DOT11D_GetMaxTxPwrInDbm( -+ struct ieee80211_device *dev, -+ u8 Channel -+ ); -+ -+void -+DOT11D_ScanComplete( -+ struct ieee80211_device * dev -+ ); -+ -+int IsLegalChannel( -+ struct ieee80211_device * dev, -+ u8 channel -+); -+ -+int ToLegalChannel( -+ struct ieee80211_device * dev, -+ u8 channel -+); -+ -+void dump_chnl_map(u8 * channel_map); -+#endif // #ifndef __INC_DOT11D_H -diff -Nur linux-2.6.35.orig/drivers/net/wireless/rtl8187b/ieee80211/ieee80211_crypt.c linux-2.6.35/drivers/net/wireless/rtl8187b/ieee80211/ieee80211_crypt.c ---- linux-2.6.35.orig/drivers/net/wireless/rtl8187b/ieee80211/ieee80211_crypt.c 1970-01-01 01:00:00.000000000 +0100 -+++ linux-2.6.35/drivers/net/wireless/rtl8187b/ieee80211/ieee80211_crypt.c 2010-08-05 21:12:34.143621803 +0200 -@@ -0,0 +1,275 @@ -+/* -+ * Host AP crypto routines -+ * -+ * Copyright (c) 2002-2003, Jouni Malinen <jkmaline@cc.hut.fi> -+ * Portions Copyright (C) 2004, Intel Corporation <jketreno@linux.intel.com> -+ * -+ * This program is free software; you can redistribute it and/or modify -+ * it under the terms of the GNU General Public License version 2 as -+ * published by the Free Software Foundation. See README and COPYING for -+ * more details. -+ * -+ */ -+ -+//#include <linux/config.h> -+#include <linux/version.h> -+#include <linux/module.h> -+#include <linux/init.h> -+#include <linux/slab.h> -+#include <asm/string.h> -+#include <asm/errno.h> -+ -+#include "ieee80211.h" -+ -+MODULE_AUTHOR("Jouni Malinen"); -+MODULE_DESCRIPTION("HostAP crypto"); -+MODULE_LICENSE("GPL"); -+ -+struct ieee80211_crypto_alg { -+ struct list_head list; -+ struct ieee80211_crypto_ops *ops; -+}; -+ -+ -+struct ieee80211_crypto { -+ struct list_head algs; -+ spinlock_t lock; -+}; -+ -+static struct ieee80211_crypto *hcrypt; -+ -+void ieee80211_crypt_deinit_entries(struct ieee80211_device *ieee, -+ int force) -+{ -+ struct list_head *ptr, *n; -+ struct ieee80211_crypt_data *entry; -+ -+ for (ptr = ieee->crypt_deinit_list.next, n = ptr->next; -+ ptr != &ieee->crypt_deinit_list; ptr = n, n = ptr->next) { -+ entry = list_entry(ptr, struct ieee80211_crypt_data, list); -+ -+ if (atomic_read(&entry->refcnt) != 0 && !force) -+ continue; -+ -+ list_del(ptr); -+ -+ if (entry->ops) { -+ entry->ops->deinit(entry->priv); -+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0) -+ module_put(entry->ops->owner); -+#else -+ __MOD_DEC_USE_COUNT(entry->ops->owner); -+#endif -+ } -+ kfree(entry); -+ } -+} -+ -+void ieee80211_crypt_deinit_handler(unsigned long data) -+{ -+ struct ieee80211_device *ieee = (struct ieee80211_device *)data; -+ unsigned long flags; -+ -+ spin_lock_irqsave(&ieee->lock, flags); -+ ieee80211_crypt_deinit_entries(ieee, 0); -+ if (!list_empty(&ieee->crypt_deinit_list)) { -+ printk(KERN_DEBUG "%s: entries remaining in delayed crypt " -+ "deletion list\n", ieee->dev->name); |