Merge remote-tracking branch 'origin/develop-3.0' into develop-3.0-jb
author黄涛 <huangtao@rock-chips.com>
Tue, 21 Aug 2012 06:14:24 +0000 (14:14 +0800)
committer黄涛 <huangtao@rock-chips.com>
Tue, 21 Aug 2012 06:14:24 +0000 (14:14 +0800)
Conflicts:
include/net/cfg80211.h

14 files changed:
1  2 
Makefile
arch/arm/Kconfig
arch/arm/configs/rk3066_sdk_defconfig
arch/arm/configs/rk30_ds1001b_defconfig
arch/arm/configs/rk30_sdk_defconfig
drivers/mmc/card/block.c
drivers/mmc/core/core.c
drivers/mmc/core/sd.c
drivers/tty/serial/Kconfig
drivers/usb/gadget/android.c
drivers/usb/gadget/f_adb.c
drivers/usb/serial/option.c
include/net/cfg80211.h
net/bluetooth/hci_core.c

diff --combined Makefile
index a8a3085a8ae35e902eede70202551bee2eb5165f,ffcda4b707a3e85e6af9fedeba7f447ce5847024..d2b9cb2841b84e4e5a6bb16392d972a77fc0e481
+++ b/Makefile
@@@ -1,6 -1,6 +1,6 @@@
  VERSION = 3
  PATCHLEVEL = 0
 -SUBLEVEL = 8
 +SUBLEVEL = 36
  EXTRAVERSION =
  NAME = Sneaky Weasel
  
@@@ -194,8 -194,11 +194,8 @@@ SUBARCH := $(shell uname -m | sed -e s/
  export KBUILD_BUILDHOST := $(SUBARCH)
  #ARCH         ?= $(SUBARCH)
  ARCH          ?= arm
 -ifneq ($(wildcard ../toolchain/arm-eabi-4.4.0),)
 -CROSS_COMPILE ?= ../toolchain/arm-eabi-4.4.0/bin/arm-eabi-
 -endif
 -ifneq ($(wildcard ../prebuilt/linux-x86/toolchain/arm-eabi-4.4.0),)
 -CROSS_COMPILE ?= ../prebuilt/linux-x86/toolchain/arm-eabi-4.4.0/bin/arm-eabi-
 +ifneq ($(wildcard ../toolchain/arm-eabi-4.4.3),)
 +CROSS_COMPILE ?= ../toolchain/arm-eabi-4.4.3/bin/arm-eabi-
  endif
  ifneq ($(wildcard ../prebuilt/linux-x86/toolchain/arm-eabi-4.4.3),)
  CROSS_COMPILE ?= ../prebuilt/linux-x86/toolchain/arm-eabi-4.4.3/bin/arm-eabi-
@@@ -1230,7 -1233,7 +1230,7 @@@ rpm: include/config/kernel.release FORC
  # Brief documentation of the typical targets used
  # ---------------------------------------------------------------------------
  
- boards := $(wildcard $(srctree)/arch/$(SRCARCH)/configs/*_defconfig)
+ boards := $(wildcard $(srctree)/arch/$(SRCARCH)/configs/rk*_defconfig)
  boards := $(notdir $(boards))
  board-dirs := $(dir $(wildcard $(srctree)/arch/$(SRCARCH)/configs/*/*_defconfig))
  board-dirs := $(sort $(notdir $(board-dirs:/=)))
diff --combined arch/arm/Kconfig
index 1e56c180cb1535edb4a6137484f4ba261d34c958,9b167ea55b5b64f051b9bb8bd5d695c867b6a3fa..8e04926d8d7a5fcdcb5e9b145a6241d6b1613817
@@@ -871,6 -871,17 +871,17 @@@ config ARCH_RK2
        help
          Support for Rockchip's RK29xx SoCs.
  
+ config ARCH_RK2928
+       bool "Rockchip RK2928"
+       select PLAT_RK
+       select CPU_V7
+       select ARM_GIC
+       select RK_PL330_DMA
+       select MIGHT_HAVE_CACHE_L2X0
+       select ARM_ERRATA_754322
+       help
+         Support for Rockchip's RK2928 SoCs.
  config ARCH_RK30
        bool "Rockchip RK30xx"
        select PLAT_RK
        help
          Support for Rockchip's RK30xx SoCs.
  
+ config ARCH_RK31
+       bool "Rockchip RK31xx"
+       select PLAT_RK
+       select CPU_V7
+       select ARM_GIC
+       select RK_PL330_DMA
+       select HAVE_SMP
+       select MIGHT_HAVE_CACHE_L2X0
+       select ARM_ERRATA_764369
+       select ARM_ERRATA_754322
+       help
+         Support for Rockchip's RK31xx SoCs.
  config PLAT_SPEAR
        bool "ST SPEAr"
        select ARM_AMBA
@@@ -986,6 -1010,7 +1010,7 @@@ source "arch/arm/mach-realview/Kconfig
  
  source "arch/arm/plat-rk/Kconfig"
  source "arch/arm/mach-rk29/Kconfig"
+ source "arch/arm/mach-rk2928/Kconfig"
  source "arch/arm/mach-rk30/Kconfig"
  
  source "arch/arm/mach-sa1100/Kconfig"
@@@ -1217,7 -1242,7 +1242,7 @@@ config ARM_ERRATA_74362
        depends on CPU_V7
        help
          This option enables the workaround for the 743622 Cortex-A9
 -        (r2p0..r2p2) erratum. Under very rare conditions, a faulty
 +        (r2p*) erratum. Under very rare conditions, a faulty
          optimisation in the Cortex-A9 Store Buffer may lead to data
          corruption. This workaround sets a specific bit in the diagnostic
          register of the Cortex-A9 which disables the Store Buffer
@@@ -1350,18 -1375,6 +1375,18 @@@ config ARM_ERRATA_76436
          relevant cache maintenance functions and sets a specific bit
          in the diagnostic control register of the SCU.
  
 +config PL310_ERRATA_769419
 +      bool "PL310 errata: no automatic Store Buffer drain"
 +      depends on CACHE_L2X0
 +      help
 +        On revisions of the PL310 prior to r3p2, the Store Buffer does
 +        not automatically drain. This can cause normal, non-cacheable
 +        writes to be retained when the memory system is idle, leading
 +        to suboptimal I/O performance for drivers using coherent DMA.
 +        This option adds a write barrier to the cpu_idle loop so that,
 +        on systems with an outer cache, the store buffer is drained
 +        explicitly.
 +
  endmenu
  
  menu "Kernel Features"
index 45f44bbcccce969302ab163e5d67bd59e308760a,2964f7e38e97323896af71718aa0405b048e9f8b..f1df9c1c8fb8233d1e555cb904b0403a9cc624ce
@@@ -10,7 -10,7 +10,6 @@@ CONFIG_RESOURCE_COUNTERS=
  CONFIG_CGROUP_SCHED=y
  CONFIG_RT_GROUP_SCHED=y
  CONFIG_BLK_DEV_INITRD=y
--CONFIG_CC_OPTIMIZE_FOR_SIZE=y
  CONFIG_PANIC_TIMEOUT=1
  # CONFIG_SYSCTL_SYSCALL is not set
  # CONFIG_ELF_CORE is not set
@@@ -22,10 -22,9 +21,8 @@@ CONFIG_MODULES=
  CONFIG_MODULE_UNLOAD=y
  CONFIG_MODULE_FORCE_UNLOAD=y
  CONFIG_ARCH_RK30=y
- CONFIG_WIFI_CONTROL_FUNC=y
- CONFIG_MACH_RK3066_SDK=y
  CONFIG_CLK_SWITCH_TO_32K=y
- # CONFIG_SWP_EMULATE is not set
+ CONFIG_MACH_RK3066_SDK=y
 -# CONFIG_SWP_EMULATE is not set
  CONFIG_FIQ_DEBUGGER=y
  CONFIG_FIQ_DEBUGGER_NO_SLEEP=y
  CONFIG_FIQ_DEBUGGER_CONSOLE=y
@@@ -57,10 -56,10 +54,12 @@@ CONFIG_VFP=
  CONFIG_NEON=y
  CONFIG_WAKELOCK=y
  CONFIG_PM_RUNTIME=y
++CONFIG_PM_DEBUG=y
  CONFIG_SUSPEND_TIME=y
  CONFIG_NET=y
  CONFIG_PACKET=y
  CONFIG_UNIX=y
++CONFIG_XFRM_USER=y
  CONFIG_NET_KEY=y
  CONFIG_INET=y
  CONFIG_IP_MULTICAST=y
@@@ -80,6 -79,6 +79,7 @@@ CONFIG_IPV6_MIP6=
  CONFIG_IPV6_TUNNEL=y
  CONFIG_IPV6_MULTIPLE_TABLES=y
  CONFIG_NETFILTER=y
++# CONFIG_BRIDGE_NETFILTER is not set
  CONFIG_NF_CONNTRACK=y
  CONFIG_NF_CONNTRACK_EVENTS=y
  CONFIG_NF_CT_PROTO_DCCP=y
@@@ -98,6 -97,6 +98,7 @@@ CONFIG_NF_CT_NETLINK=
  CONFIG_NETFILTER_TPROXY=y
  CONFIG_NETFILTER_XT_TARGET_CLASSIFY=y
  CONFIG_NETFILTER_XT_TARGET_CONNMARK=y
++CONFIG_NETFILTER_XT_TARGET_IDLETIMER=y
  CONFIG_NETFILTER_XT_TARGET_MARK=y
  CONFIG_NETFILTER_XT_TARGET_NFLOG=y
  CONFIG_NETFILTER_XT_TARGET_NFQUEUE=y
@@@ -224,7 -223,7 +225,16 @@@ CONFIG_INPUT_KEYRESET=
  # CONFIG_KEYBOARD_ATKBD is not set
  # CONFIG_INPUT_MOUSE is not set
  CONFIG_INPUT_JOYSTICK=y
++CONFIG_JOYSTICK_XPAD=y
++CONFIG_JOYSTICK_XPAD_FF=y
++CONFIG_JOYSTICK_XPAD_LEDS=y
  CONFIG_INPUT_TABLET=y
++CONFIG_TABLET_USB_ACECAD=y
++CONFIG_TABLET_USB_AIPTEK=y
++CONFIG_TABLET_USB_GTCO=y
++CONFIG_TABLET_USB_HANWANG=y
++CONFIG_TABLET_USB_KBTAB=y
++CONFIG_TABLET_USB_WACOM=y
  CONFIG_INPUT_TOUCHSCREEN=y
  CONFIG_TOUCHSCREEN_GT8XX=y
  CONFIG_INPUT_MISC=y
@@@ -255,6 -254,6 +265,7 @@@ CONFIG_I2C1_CONTROLLER_RK30=
  CONFIG_I2C2_CONTROLLER_RK30=y
  CONFIG_I2C3_CONTROLLER_RK30=y
  CONFIG_I2C4_CONTROLLER_RK30=y
++CONFIG_GPIO_SYSFS=y
  CONFIG_GPIO_WM831X=y
  CONFIG_EXPANDED_GPIO_NUM=0
  CONFIG_EXPANDED_GPIO_IRQ_NUM=0
@@@ -284,11 -283,12 +295,12 @@@ CONFIG_DISPLAY_SUPPORT=
  CONFIG_LCD_B101EW05=y
  CONFIG_FB_ROCKCHIP=y
  CONFIG_LCDC_RK30=y
- CONFIG_HDMI_RK30=y
+ CONFIG_RK_HDMI=y
  CONFIG_RGA_RK30=y
  CONFIG_LOGO=y
  # CONFIG_LOGO_LINUX_MONO is not set
  # CONFIG_LOGO_LINUX_VGA16 is not set
+ # CONFIG_LOGO_LINUX_BMP is not set
  CONFIG_SOUND=y
  CONFIG_SND=y
  # CONFIG_SND_SUPPORT_OLD_API is not set
@@@ -356,8 -356,8 +368,8 @@@ CONFIG_HID_WACOM=
  CONFIG_HID_ZEROPLUS=y
  CONFIG_ZEROPLUS_FF=y
  CONFIG_HID_ZYDACRON=y
--CONFIG_USB=y
  CONFIG_USB_ANNOUNCE_NEW_DEVICES=y
++CONFIG_USB_DEVICEFS=y
  CONFIG_USB_OTG_BLACKLIST_HUB=y
  CONFIG_USB_STORAGE=y
  CONFIG_USB_SERIAL=y
@@@ -402,13 -402,13 +414,12 @@@ CONFIG_NLS_ASCII=
  CONFIG_NLS_ISO8859_1=y
  CONFIG_PRINTK_TIME=y
  CONFIG_MAGIC_SYSRQ=y
--CONFIG_DEBUG_FS=y
  CONFIG_DEBUG_KERNEL=y
--CONFIG_DETECT_HUNG_TASK=y
  # CONFIG_SCHED_DEBUG is not set
  CONFIG_SCHEDSTATS=y
--CONFIG_TIMER_STATS=y
  # CONFIG_DEBUG_PREEMPT is not set
--# CONFIG_FTRACE is not set
++# CONFIG_EVENT_POWER_TRACING_DEPRECATED is not set
++CONFIG_ENABLE_DEFAULT_TRACERS=y
++CONFIG_CRYPTO_SHA256=y
  CONFIG_CRYPTO_TWOFISH=y
  # CONFIG_CRYPTO_ANSI_CPRNG is not set
index ef2fde9c5323aaac1ce58e21d0c1adc134531866,b95b19713bab3a01d3a68e304c75a9524b6e4043..f16054b50ab5737b82a3026215cb640cc0c5b904
@@@ -10,6 -10,7 +10,6 @@@ CONFIG_RESOURCE_COUNTERS=
  CONFIG_CGROUP_SCHED=y
  CONFIG_RT_GROUP_SCHED=y
  CONFIG_BLK_DEV_INITRD=y
 -CONFIG_CC_OPTIMIZE_FOR_SIZE=y
  CONFIG_PANIC_TIMEOUT=1
  # CONFIG_SYSCTL_SYSCALL is not set
  # CONFIG_ELF_CORE is not set
@@@ -55,12 -56,10 +55,12 @@@ CONFIG_VFP=
  CONFIG_NEON=y
  CONFIG_WAKELOCK=y
  CONFIG_PM_RUNTIME=y
 +CONFIG_PM_DEBUG=y
  CONFIG_SUSPEND_TIME=y
  CONFIG_NET=y
  CONFIG_PACKET=y
  CONFIG_UNIX=y
 +CONFIG_XFRM_USER=y
  CONFIG_NET_KEY=y
  CONFIG_INET=y
  CONFIG_IP_MULTICAST=y
@@@ -80,7 -79,6 +80,7 @@@ CONFIG_IPV6_MIP6=
  CONFIG_IPV6_TUNNEL=y
  CONFIG_IPV6_MULTIPLE_TABLES=y
  CONFIG_NETFILTER=y
 +# CONFIG_BRIDGE_NETFILTER is not set
  CONFIG_NF_CONNTRACK=y
  CONFIG_NF_CONNTRACK_EVENTS=y
  CONFIG_NF_CT_PROTO_DCCP=y
@@@ -99,7 -97,6 +99,7 @@@ CONFIG_NF_CT_NETLINK=
  CONFIG_NETFILTER_TPROXY=y
  CONFIG_NETFILTER_XT_TARGET_CLASSIFY=y
  CONFIG_NETFILTER_XT_TARGET_CONNMARK=y
 +CONFIG_NETFILTER_XT_TARGET_IDLETIMER=y
  CONFIG_NETFILTER_XT_TARGET_MARK=y
  CONFIG_NETFILTER_XT_TARGET_NFLOG=y
  CONFIG_NETFILTER_XT_TARGET_NFQUEUE=y
@@@ -224,16 -221,7 +224,16 @@@ CONFIG_INPUT_KEYRESET=
  # CONFIG_KEYBOARD_ATKBD is not set
  # CONFIG_INPUT_MOUSE is not set
  CONFIG_INPUT_JOYSTICK=y
 +CONFIG_JOYSTICK_XPAD=y
 +CONFIG_JOYSTICK_XPAD_FF=y
 +CONFIG_JOYSTICK_XPAD_LEDS=y
  CONFIG_INPUT_TABLET=y
 +CONFIG_TABLET_USB_ACECAD=y
 +CONFIG_TABLET_USB_AIPTEK=y
 +CONFIG_TABLET_USB_GTCO=y
 +CONFIG_TABLET_USB_HANWANG=y
 +CONFIG_TABLET_USB_KBTAB=y
 +CONFIG_TABLET_USB_WACOM=y
  CONFIG_INPUT_TOUCHSCREEN=y
  CONFIG_TOUCHSCREEN_GT8XX=y
  CONFIG_INPUT_MISC=y
@@@ -288,7 -276,7 +288,7 @@@ CONFIG_DISPLAY_SUPPORT=
  CONFIG_LCD_B101EW05=y
  CONFIG_FB_ROCKCHIP=y
  CONFIG_LCDC_RK30=y
- CONFIG_HDMI_RK30=y
+ CONFIG_RK_HDMI=y
  CONFIG_RGA_RK30=y
  CONFIG_LOGO=y
  # CONFIG_LOGO_LINUX_MONO is not set
@@@ -360,8 -348,8 +360,8 @@@ CONFIG_HID_WACOM=
  CONFIG_HID_ZEROPLUS=y
  CONFIG_ZEROPLUS_FF=y
  CONFIG_HID_ZYDACRON=y
 -CONFIG_USB=y
  CONFIG_USB_ANNOUNCE_NEW_DEVICES=y
 +CONFIG_USB_DEVICEFS=y
  CONFIG_USB_OTG_BLACKLIST_HUB=y
  CONFIG_USB_STORAGE=y
  CONFIG_USB_SERIAL=y
@@@ -406,12 -394,13 +406,12 @@@ CONFIG_NLS_ASCII=
  CONFIG_NLS_ISO8859_1=y
  CONFIG_PRINTK_TIME=y
  CONFIG_MAGIC_SYSRQ=y
 -CONFIG_DEBUG_FS=y
  CONFIG_DEBUG_KERNEL=y
 -CONFIG_DETECT_HUNG_TASK=y
  # CONFIG_SCHED_DEBUG is not set
  CONFIG_SCHEDSTATS=y
 -CONFIG_TIMER_STATS=y
  # CONFIG_DEBUG_PREEMPT is not set
 -# CONFIG_FTRACE is not set
 +# CONFIG_EVENT_POWER_TRACING_DEPRECATED is not set
 +CONFIG_ENABLE_DEFAULT_TRACERS=y
 +CONFIG_CRYPTO_SHA256=y
  CONFIG_CRYPTO_TWOFISH=y
  # CONFIG_CRYPTO_ANSI_CPRNG is not set
index 6bd2bfc3d098283c5ca729e47b589ae39270491e,a32d9ff90161c225835f8f34bff8ecee3f3c7fef..8e153cc9fbc8b753a7144289a289061a246b1a68
@@@ -10,6 -10,7 +10,6 @@@ CONFIG_RESOURCE_COUNTERS=
  CONFIG_CGROUP_SCHED=y
  CONFIG_RT_GROUP_SCHED=y
  CONFIG_BLK_DEV_INITRD=y
 -CONFIG_CC_OPTIMIZE_FOR_SIZE=y
  CONFIG_PANIC_TIMEOUT=1
  # CONFIG_SYSCTL_SYSCALL is not set
  # CONFIG_ELF_CORE is not set
@@@ -22,6 -23,7 +22,6 @@@ CONFIG_MODULE_UNLOAD=
  CONFIG_MODULE_FORCE_UNLOAD=y
  CONFIG_ARCH_RK30=y
  CONFIG_WIFI_CONTROL_FUNC=y
 -# CONFIG_SWP_EMULATE is not set
  CONFIG_FIQ_DEBUGGER=y
  CONFIG_FIQ_DEBUGGER_NO_SLEEP=y
  CONFIG_FIQ_DEBUGGER_CONSOLE=y
@@@ -53,12 -55,10 +53,12 @@@ CONFIG_VFP=
  CONFIG_NEON=y
  CONFIG_WAKELOCK=y
  CONFIG_PM_RUNTIME=y
 +CONFIG_PM_DEBUG=y
  CONFIG_SUSPEND_TIME=y
  CONFIG_NET=y
  CONFIG_PACKET=y
  CONFIG_UNIX=y
 +CONFIG_XFRM_USER=y
  CONFIG_NET_KEY=y
  CONFIG_INET=y
  CONFIG_IP_MULTICAST=y
@@@ -78,7 -78,6 +78,7 @@@ CONFIG_IPV6_MIP6=
  CONFIG_IPV6_TUNNEL=y
  CONFIG_IPV6_MULTIPLE_TABLES=y
  CONFIG_NETFILTER=y
 +# CONFIG_BRIDGE_NETFILTER is not set
  CONFIG_NF_CONNTRACK=y
  CONFIG_NF_CONNTRACK_EVENTS=y
  CONFIG_NF_CT_PROTO_DCCP=y
@@@ -97,7 -96,6 +97,7 @@@ CONFIG_NF_CT_NETLINK=
  CONFIG_NETFILTER_TPROXY=y
  CONFIG_NETFILTER_XT_TARGET_CLASSIFY=y
  CONFIG_NETFILTER_XT_TARGET_CONNMARK=y
 +CONFIG_NETFILTER_XT_TARGET_IDLETIMER=y
  CONFIG_NETFILTER_XT_TARGET_MARK=y
  CONFIG_NETFILTER_XT_TARGET_NFLOG=y
  CONFIG_NETFILTER_XT_TARGET_NFQUEUE=y
@@@ -223,16 -221,7 +223,16 @@@ CONFIG_INPUT_KEYRESET=
  # CONFIG_KEYBOARD_ATKBD is not set
  # CONFIG_INPUT_MOUSE is not set
  CONFIG_INPUT_JOYSTICK=y
 +CONFIG_JOYSTICK_XPAD=y
 +CONFIG_JOYSTICK_XPAD_FF=y
 +CONFIG_JOYSTICK_XPAD_LEDS=y
  CONFIG_INPUT_TABLET=y
 +CONFIG_TABLET_USB_ACECAD=y
 +CONFIG_TABLET_USB_AIPTEK=y
 +CONFIG_TABLET_USB_GTCO=y
 +CONFIG_TABLET_USB_HANWANG=y
 +CONFIG_TABLET_USB_KBTAB=y
 +CONFIG_TABLET_USB_WACOM=y
  CONFIG_INPUT_TOUCHSCREEN=y
  CONFIG_TOUCHSCREEN_GT8XX=y
  CONFIG_INPUT_MISC=y
@@@ -240,13 -229,20 +240,20 @@@ CONFIG_INPUT_KEYCHORD=
  CONFIG_INPUT_UINPUT=y
  CONFIG_COMPASS_AK8975=y
  CONFIG_GS_MMA8452=y
+ CONFIG_GS_LIS3DH=y
  CONFIG_GYRO_L3G4200D=y
  CONFIG_LS_CM3217=y
  CONFIG_SENSOR_DEVICE=y
  CONFIG_GSENSOR_DEVICE=y
+ CONFIG_GS_KXTIK=y
  CONFIG_COMPASS_DEVICE=y
  CONFIG_GYROSCOPE_DEVICE=y
  CONFIG_LIGHT_DEVICE=y
+ CONFIG_LS_AL3006=y
+ CONFIG_LS_STK3171=y
+ CONFIG_PROXIMITY_DEVICE=y
+ CONFIG_PS_AL3006=y
+ CONFIG_PS_STK3171=y
  # CONFIG_SERIO is not set
  # CONFIG_CONSOLE_TRANSLATIONS is not set
  # CONFIG_LEGACY_PTYS is not set
@@@ -263,7 -259,6 +270,7 @@@ CONFIG_I2C1_CONTROLLER_RK30=
  CONFIG_I2C2_CONTROLLER_RK30=y
  CONFIG_I2C3_CONTROLLER_RK30=y
  CONFIG_I2C4_CONTROLLER_RK30=y
 +CONFIG_GPIO_SYSFS=y
  CONFIG_GPIO_WM831X=y
  CONFIG_EXPANDED_GPIO_NUM=0
  CONFIG_EXPANDED_GPIO_IRQ_NUM=0
@@@ -293,7 -288,7 +300,7 @@@ CONFIG_DISPLAY_SUPPORT=
  CONFIG_LCD_B101EW05=y
  CONFIG_FB_ROCKCHIP=y
  CONFIG_LCDC_RK30=y
- CONFIG_HDMI_RK30=y
+ CONFIG_RK_HDMI=y
  CONFIG_RGA_RK30=y
  CONFIG_LOGO=y
  # CONFIG_LOGO_LINUX_MONO is not set
@@@ -365,8 -360,8 +372,8 @@@ CONFIG_HID_WACOM=
  CONFIG_HID_ZEROPLUS=y
  CONFIG_ZEROPLUS_FF=y
  CONFIG_HID_ZYDACRON=y
 -CONFIG_USB=y
  CONFIG_USB_ANNOUNCE_NEW_DEVICES=y
 +CONFIG_USB_DEVICEFS=y
  CONFIG_USB_OTG_BLACKLIST_HUB=y
  CONFIG_USB_STORAGE=y
  CONFIG_USB_SERIAL=y
@@@ -411,12 -406,13 +418,12 @@@ CONFIG_NLS_ASCII=
  CONFIG_NLS_ISO8859_1=y
  CONFIG_PRINTK_TIME=y
  CONFIG_MAGIC_SYSRQ=y
 -CONFIG_DEBUG_FS=y
  CONFIG_DEBUG_KERNEL=y
 -CONFIG_DETECT_HUNG_TASK=y
  # CONFIG_SCHED_DEBUG is not set
  CONFIG_SCHEDSTATS=y
 -CONFIG_TIMER_STATS=y
  # CONFIG_DEBUG_PREEMPT is not set
 -# CONFIG_FTRACE is not set
 +# CONFIG_EVENT_POWER_TRACING_DEPRECATED is not set
 +CONFIG_ENABLE_DEFAULT_TRACERS=y
 +CONFIG_CRYPTO_SHA256=y
  CONFIG_CRYPTO_TWOFISH=y
  # CONFIG_CRYPTO_ANSI_CPRNG is not set
diff --combined drivers/mmc/card/block.c
index 7f9935ad89a2e7f33416f950896cb15fa32f38ea,99a4909b1d09a1448facc465c0b6f62c23a3957b..0b3ff459606607d324c5d1c336bb7c1e58244ea5
@@@ -247,9 -247,6 +247,9 @@@ static struct mmc_blk_ioc_data *mmc_blk
                goto idata_err;
        }
  
 +      if (!idata->buf_bytes)
 +              return idata;
 +
        idata->buf = kzalloc(idata->buf_bytes, GFP_KERNEL);
        if (!idata->buf) {
                err = -ENOMEM;
@@@ -296,6 -293,25 +296,6 @@@ static int mmc_blk_ioctl_cmd(struct blo
        if (IS_ERR(idata))
                return PTR_ERR(idata);
  
 -      cmd.opcode = idata->ic.opcode;
 -      cmd.arg = idata->ic.arg;
 -      cmd.flags = idata->ic.flags;
 -
 -      data.sg = &sg;
 -      data.sg_len = 1;
 -      data.blksz = idata->ic.blksz;
 -      data.blocks = idata->ic.blocks;
 -
 -      sg_init_one(data.sg, idata->buf, idata->buf_bytes);
 -
 -      if (idata->ic.write_flag)
 -              data.flags = MMC_DATA_WRITE;
 -      else
 -              data.flags = MMC_DATA_READ;
 -
 -      mrq.cmd = &cmd;
 -      mrq.data = &data;
 -
        md = mmc_blk_get(bdev->bd_disk);
        if (!md) {
                err = -EINVAL;
                goto cmd_done;
        }
  
 +      cmd.opcode = idata->ic.opcode;
 +      cmd.arg = idata->ic.arg;
 +      cmd.flags = idata->ic.flags;
 +
 +      if (idata->buf_bytes) {
 +              data.sg = &sg;
 +              data.sg_len = 1;
 +              data.blksz = idata->ic.blksz;
 +              data.blocks = idata->ic.blocks;
 +
 +              sg_init_one(data.sg, idata->buf, idata->buf_bytes);
 +
 +              if (idata->ic.write_flag)
 +                      data.flags = MMC_DATA_WRITE;
 +              else
 +                      data.flags = MMC_DATA_READ;
 +
 +              /* data.flags must already be set before doing this. */
 +              mmc_set_data_timeout(&data, card);
 +
 +              /* Allow overriding the timeout_ns for empirical tuning. */
 +              if (idata->ic.data_timeout_ns)
 +                      data.timeout_ns = idata->ic.data_timeout_ns;
 +
 +              if ((cmd.flags & MMC_RSP_R1B) == MMC_RSP_R1B) {
 +                      /*
 +                       * Pretend this is a data transfer and rely on the
 +                       * host driver to compute timeout.  When all host
 +                       * drivers support cmd.cmd_timeout for R1B, this
 +                       * can be changed to:
 +                       *
 +                       *     mrq.data = NULL;
 +                       *     cmd.cmd_timeout = idata->ic.cmd_timeout_ms;
 +                       */
 +                      data.timeout_ns = idata->ic.cmd_timeout_ms * 1000000;
 +              }
 +
 +              mrq.data = &data;
 +      }
 +
 +      mrq.cmd = &cmd;
 +
        mmc_claim_host(card->host);
  
        if (idata->ic.is_acmd) {
                        goto cmd_rel_host;
        }
  
 -      /* data.flags must already be set before doing this. */
 -      mmc_set_data_timeout(&data, card);
 -      /* Allow overriding the timeout_ns for empirical tuning. */
 -      if (idata->ic.data_timeout_ns)
 -              data.timeout_ns = idata->ic.data_timeout_ns;
 -
 -      if ((cmd.flags & MMC_RSP_R1B) == MMC_RSP_R1B) {
 -              /*
 -               * Pretend this is a data transfer and rely on the host driver
 -               * to compute timeout.  When all host drivers support
 -               * cmd.cmd_timeout for R1B, this can be changed to:
 -               *
 -               *     mrq.data = NULL;
 -               *     cmd.cmd_timeout = idata->ic.cmd_timeout_ms;
 -               */
 -              data.timeout_ns = idata->ic.cmd_timeout_ms * 1000000;
 -      }
 -
        mmc_wait_for_req(card->host, &mrq);
  
        if (cmd.error) {
@@@ -851,6 -843,10 +851,10 @@@ static int mmc_blk_issue_rw_rq(struct m
                brq.mrq.cmd = &brq.cmd;
                brq.mrq.data = &brq.data;
  
+             #if defined(CONFIG_SDMMC_RK29) && !defined(CONFIG_SDMMC_RK29_OLD)
+                 brq.cmd.retries = 2; //suppot retry read-write; added by xbw@2012-07-14
+             #endif
                brq.cmd.arg = blk_rq_pos(req);
                if (!mmc_card_blockaddr(card))
                        brq.cmd.arg <<= 9;
diff --combined drivers/mmc/core/core.c
index f18ba0aecca70c445661578d98dcfe3350727cc9,b9e3ae536102ac8de2d89ec559560c59c0f500dc..51af2722861ed6a795fb9fc79671f92e345fd1f3
@@@ -236,7 -236,7 +236,7 @@@ void mmc_wait_for_req(struct mmc_host *
          //calculate the timeout value for SDMMC; added by xbw at 2011-09-27
          if(mrq->data)
          {
-             unit = 3*(1<<20);// unit=3MB
+             unit = 2*(1<<20);// unit=2MB
              datasize = mrq->data->blksz*mrq->data->blocks;
              multi = datasize/unit;
              multi += (datasize%unit)?1:0;
      {
          host->doneflag = 0;
          mrq->cmd->error = -EIO;
-         printk(KERN_WARNING "%s..%d.. !!!!! wait for CMD%d timeout [%s]\n",\
-             __FUNCTION__, __LINE__, mrq->cmd->opcode, mmc_hostname(host));
+         if(0 == mrq->cmd->retries)
+         {
+             printk(KERN_WARNING "%s..%d.. !!!!! wait for CMD%d timeout [%s]\n",\
+                 __FUNCTION__, __LINE__, mrq->cmd->opcode, mmc_hostname(host));
+         }
      }
  #else
        wait_for_completion(&complete);
@@@ -1107,7 -1111,7 +1111,7 @@@ static void mmc_power_up(struct mmc_hos
        mmc_host_clk_release(host);
  }
  
 -static void mmc_power_off(struct mmc_host *host)
 +void mmc_power_off(struct mmc_host *host)
  {
        mmc_host_clk_hold(host);
  
@@@ -1227,7 -1231,8 +1231,7 @@@ void mmc_attach_bus(struct mmc_host *ho
  }
  
  /*
 - * Remove the current bus handler from a host. Assumes that there are
 - * no interesting cards left, so the bus is powered down.
 + * Remove the current bus handler from a host.
   */
  void mmc_detach_bus(struct mmc_host *host)
  {
  
        spin_unlock_irqrestore(&host->lock, flags);
  
 -      mmc_power_off(host);
 -
        mmc_bus_put(host);
  }
  
@@@ -1891,7 -1898,6 +1895,7 @@@ void mmc_stop_host(struct mmc_host *hos
  
                mmc_claim_host(host);
                mmc_detach_bus(host);
 +              mmc_power_off(host);
                mmc_release_host(host);
                mmc_bus_put(host);
                return;
@@@ -2008,6 -2014,10 +2012,10 @@@ int mmc_suspend_host(struct mmc_host *h
        if (host->bus_ops && !host->bus_dead) {
                if (host->bus_ops->suspend)
                        err = host->bus_ops->suspend(host);
+ #if defined(CONFIG_SDMMC_RK29) && defined(CONFIG_SDMMC_RK29_OLD)
+                //deleted all detail code. //fix the crash bug when error occur during suspend. Modiefyed by xbw at 2012-08-09
+ #else
                if (err == -ENOSYS || !host->bus_ops->resume) {
                        /*
                         * We simply "remove" the card in this case.
                                host->bus_ops->remove(host);
                        mmc_claim_host(host);
                        mmc_detach_bus(host);
 +                      mmc_power_off(host);
                        mmc_release_host(host);
                        host->pm_flags = 0;
                        err = 0;
                }
+ #endif
        }
        mmc_bus_put(host);
  
@@@ -2122,7 -2132,6 +2131,7 @@@ int mmc_pm_notify(struct notifier_bloc
                        host->bus_ops->remove(host);
  
                mmc_detach_bus(host);
 +              mmc_power_off(host);
                mmc_release_host(host);
                host->pm_flags = 0;
                break;
diff --combined drivers/mmc/core/sd.c
index 2ee448439041322e6f5581e6a4fd8cc503e67922,dcbd5b0e6dea189eede0477bc1cab0f50c5e0a96..e31529c123c5c41a5cecac0a33668a60074fa2b5
@@@ -306,7 -306,9 +306,9 @@@ static int mmc_read_switch(struct mmc_c
                goto out;
        }
  
-       if (card->scr.sda_spec3) {
+     //mask the the SD Ver3.0 support,modifyed by xbw at 2012-8-09
+       //if (card->scr.sda_spec3) {
+       if(0) {
                card->sw_caps.sd3_bus_mode = status[13];
  
                /* Find out Driver Strengths supported by the card */
@@@ -1074,7 -1076,6 +1076,7 @@@ static void mmc_sd_detect(struct mmc_ho
  
                mmc_claim_host(host);
                mmc_detach_bus(host);
 +              mmc_power_off(host);
                mmc_release_host(host);
        }
  }
index 358f51500f67e39cfa57c3d499702d814b877052,950b98efebe1a9910ff35bedf82031625d18e976..814f55a565838bb1c89b156074c720642ca94a7a
@@@ -1526,9 -1526,13 +1526,13 @@@ config UART0_CTS_RTS_RK2
        depends on UART0_RK29
  
  config UART0_DMA_RK29
-       bool "Serial port 0 DMA support (EXPERIMENTAL)"
+       int "Serial port 0 DMA support (EXPERIMENTAL)"
        depends on UART0_RK29
+       default 0
+       help 
+                1:enable dma tx
+                2:enable dma rx
+                3:both enable dma tx and rx 
  config UART1_RK29
        bool "Serial port 1 support"
        depends on SERIAL_RK29
@@@ -1538,9 -1542,13 +1542,13 @@@ config UART1_CTS_RTS_RK2
        depends on UART1_RK29 && !ARCH_RK29
  
  config UART1_DMA_RK29
-       bool "Serial port 1 DMA support (EXPERIMENTAL)"
+       int "Serial port 1 DMA support (EXPERIMENTAL)"
        depends on UART1_RK29
+       default 0
+       help 
+                1:enable dma tx
+                2:enable dma rx
+                3:both enable dma tx and rx 
  config UART2_RK29
        bool "Serial port 2 support"
        depends on SERIAL_RK29
@@@ -1550,21 -1558,29 +1558,29 @@@ config UART2_CTS_RTS_RK2
        depends on UART2_RK29 && !ARCH_RK30
  
  config UART2_DMA_RK29
-       bool "Serial port 2 DMA support (EXPERIMENTAL)"
+       int "Serial port 2 DMA support (EXPERIMENTAL)"
        depends on UART2_RK29
+       default 0
+       help 
+                1:enable dma tx
+                2:enable dma rx
+                3:both enable dma tx and rx 
  config UART3_RK29
        bool "Serial port 3 support"
-       depends on SERIAL_RK29
+       depends on SERIAL_RK29 && !ARCH_RK2928
  
  config UART3_CTS_RTS_RK29
        bool "Serial port 3 CTS/RTS support"
        depends on UART3_RK29
  
  config UART3_DMA_RK29
-       bool "Serial port 3 DMA support (EXPERIMENTAL)"
+       int "Serial port 3 DMA support (EXPERIMENTAL)"
        depends on UART3_RK29
+       default 0
+       help 
+                1:enable dma tx
+                2:enable dma rx
+                3:both enable dma tx and rx 
  config SERIAL_RK29_CONSOLE
        bool "Serial console support"
        depends on SERIAL_RK29=y
@@@ -1650,7 -1666,7 +1666,7 @@@ config SERIAL_IFX6X6
          Support for the IFX6x60 modem devices on Intel MID platforms.
  
  config SERIAL_PCH_UART
 -      tristate "Intel EG20T PCH / OKI SEMICONDUCTOR IOH(ML7213/ML7223) UART"
 +      tristate "Intel EG20T PCH/LAPIS Semicon IOH(ML7213/ML7223/ML7831) UART"
        depends on PCI
        select SERIAL_CORE
        help
          which is an IOH(Input/Output Hub) for x86 embedded processor.
          Enabling PCH_DMA, this PCH UART works as DMA mode.
  
 -        This driver also can be used for OKI SEMICONDUCTOR IOH(Input/
 -        Output Hub), ML7213 and ML7223.
 -        ML7213 IOH is for IVI(In-Vehicle Infotainment) use and ML7223 IOH is
 -        for MP(Media Phone) use.
 -        ML7213/ML7223 is companion chip for Intel Atom E6xx series.
 -        ML7213/ML7223 is completely compatible for Intel EG20T PCH.
 +        This driver also can be used for LAPIS Semiconductor IOH(Input/
 +        Output Hub), ML7213, ML7223 and ML7831.
 +        ML7213 IOH is for IVI(In-Vehicle Infotainment) use, ML7223 IOH is
 +        for MP(Media Phone) use and ML7831 IOH is for general purpose use.
 +        ML7213/ML7223/ML7831 is companion chip for Intel Atom E6xx series.
 +        ML7213/ML7223/ML7831 is completely compatible for Intel EG20T PCH.
  
  config SERIAL_MSM_SMD
        bool "Enable tty device interface for some SMD ports"
index c5bca332c2a195fe2424ff20b2f2610561672f14,a2189fd4f0b121f99212987b2daa5c2cf5afcb79..a9c3f78c00f340dd5fbd1728d5640b8d7ff6d2ac
@@@ -45,7 -45,6 +45,7 @@@
  #include "epautoconf.c"
  #include "composite.c"
  
 +#include "f_audio_source.c"
  #include "f_mass_storage.c"
  #include "u_serial.c"
  #include "f_acm.c"
@@@ -83,11 -82,6 +83,11 @@@ struct android_usb_function 
        int (*init)(struct android_usb_function *, struct usb_composite_dev *);
        /* Optional: cleanup during gadget unbind */
        void (*cleanup)(struct android_usb_function *);
 +      /* Optional: called when the function is added the list of
 +       *              enabled functions */
 +      void (*enable)(struct android_usb_function *);
 +      /* Optional: called when it is removed */
 +      void (*disable)(struct android_usb_function *);
  
        int (*bind_config)(struct android_usb_function *, struct usb_configuration *);
  
@@@ -106,7 -100,6 +106,7 @@@ struct android_dev 
        struct device *dev;
  
        bool enabled;
 +      int disable_depth;
        struct mutex mutex;
        bool connected;
        bool sw_connected;
@@@ -160,6 -153,8 +160,6 @@@ static struct usb_configuration android
        .label          = "android",
        .unbind         = android_unbind_config,
        .bConfigurationValue = 1,
 -      .bmAttributes   = USB_CONFIG_ATT_ONE | USB_CONFIG_ATT_SELFPOWER,
 -      .bMaxPower      = 0xFA, /* 500ma */
  };
  
  static void android_work(struct work_struct *data)
        }
  }
  
 +static void android_enable(struct android_dev *dev)
 +{
 +      struct usb_composite_dev *cdev = dev->cdev;
 +
 +      BUG_ON(!mutex_is_locked(&dev->mutex));
 +      BUG_ON(!dev->disable_depth);
 +
 +      if (--dev->disable_depth == 0) {
 +              usb_add_config(cdev, &android_config_driver,
 +                                      android_bind_config);
 +              usb_gadget_connect(cdev->gadget);
 +      }
 +}
 +
 +static void android_disable(struct android_dev *dev)
 +{
 +      struct usb_composite_dev *cdev = dev->cdev;
 +
 +      BUG_ON(!mutex_is_locked(&dev->mutex));
 +
 +      if (dev->disable_depth++ == 0) {
 +              usb_gadget_disconnect(cdev->gadget);
 +              /* Cancel pending control requests */
 +              usb_ep_dequeue(cdev->gadget->ep0, cdev->req);
 +              usb_remove_config(cdev, &android_config_driver);
 +      }
 +}
  
  /*-------------------------------------------------------------------------*/
  /* Supported functions initialization */
  
 +struct adb_data {
 +      bool opened;
 +      bool enabled;
 +};
 +
  static int adb_function_init(struct android_usb_function *f, struct usb_composite_dev *cdev)
  {
 +      f->config = kzalloc(sizeof(struct adb_data), GFP_KERNEL);
 +      if (!f->config)
 +              return -ENOMEM;
 +
        return adb_setup();
  }
  
  static void adb_function_cleanup(struct android_usb_function *f)
  {
        adb_cleanup();
 +      kfree(f->config);
  }
  
  static int adb_function_bind_config(struct android_usb_function *f, struct usb_configuration *c)
        return adb_bind_config(c);
  }
  
 +static void adb_android_function_enable(struct android_usb_function *f)
 +{
 +      struct android_dev *dev = _android_dev;
 +      struct adb_data *data = f->config;
 +
 +      data->enabled = true;
 +
 +      /* Disable the gadget until adbd is ready */
 +      if (!data->opened)
 +              android_disable(dev);
 +}
 +
 +static void adb_android_function_disable(struct android_usb_function *f)
 +{
 +      struct android_dev *dev = _android_dev;
 +      struct adb_data *data = f->config;
 +
 +      data->enabled = false;
 +
 +      /* Balance the disable that was called in closed_callback */
 +      if (!data->opened)
 +              android_enable(dev);
 +}
 +
  static struct android_usb_function adb_function = {
        .name           = "adb",
 +      .enable         = adb_android_function_enable,
 +      .disable        = adb_android_function_disable,
        .init           = adb_function_init,
        .cleanup        = adb_function_cleanup,
        .bind_config    = adb_function_bind_config,
  };
  
 +static void adb_ready_callback(void)
 +{
 +      struct android_dev *dev = _android_dev;
 +      struct adb_data *data = adb_function.config;
 +
 +      mutex_lock(&dev->mutex);
 +
 +      data->opened = true;
 +
 +      if (data->enabled)
 +              android_enable(dev);
 +
 +      mutex_unlock(&dev->mutex);
 +}
 +
 +static void adb_closed_callback(void)
 +{
 +      struct android_dev *dev = _android_dev;
 +      struct adb_data *data = adb_function.config;
 +
 +      mutex_lock(&dev->mutex);
 +
 +      data->opened = false;
 +
 +      if (data->enabled)
 +              android_disable(dev);
 +
 +      mutex_unlock(&dev->mutex);
 +}
 +
  
  #define MAX_ACM_INSTANCES 4
  struct acm_function_config {
@@@ -688,8 -590,11 +688,11 @@@ static ssize_t mass_storage_inquiry_sto
        struct mass_storage_function_config *config = f->config;
        if (size >= sizeof(config->common->inquiry_string))
                return -EINVAL;
-       if (sscanf(buf, "%s", config->common->inquiry_string) != 1)
-               return -EINVAL;
+       //if (sscanf(buf, "%s", config->common->inquiry_string) != 1)
+       //      return -EINVAL;
+       
+       memcpy(config->common->inquiry_string,buf,sizeof config->common->inquiry_string);
        return size;
  }
  
@@@ -743,67 -648,6 +746,67 @@@ static struct android_usb_function acce
        .ctrlrequest    = accessory_function_ctrlrequest,
  };
  
 +static int audio_source_function_init(struct android_usb_function *f,
 +                      struct usb_composite_dev *cdev)
 +{
 +      struct audio_source_config *config;
 +
 +      config = kzalloc(sizeof(struct audio_source_config), GFP_KERNEL);
 +      if (!config)
 +              return -ENOMEM;
 +      config->card = -1;
 +      config->device = -1;
 +      f->config = config;
 +      return 0;
 +}
 +
 +static void audio_source_function_cleanup(struct android_usb_function *f)
 +{
 +      kfree(f->config);
 +}
 +
 +static int audio_source_function_bind_config(struct android_usb_function *f,
 +                                              struct usb_configuration *c)
 +{
 +      struct audio_source_config *config = f->config;
 +
 +      return audio_source_bind_config(c, config);
 +}
 +
 +static void audio_source_function_unbind_config(struct android_usb_function *f,
 +                                              struct usb_configuration *c)
 +{
 +      struct audio_source_config *config = f->config;
 +
 +      config->card = -1;
 +      config->device = -1;
 +}
 +
 +static ssize_t audio_source_pcm_show(struct device *dev,
 +              struct device_attribute *attr, char *buf)
 +{
 +      struct android_usb_function *f = dev_get_drvdata(dev);
 +      struct audio_source_config *config = f->config;
 +
 +      /* print PCM card and device numbers */
 +      return sprintf(buf, "%d %d\n", config->card, config->device);
 +}
 +
 +static DEVICE_ATTR(pcm, S_IRUGO | S_IWUSR, audio_source_pcm_show, NULL);
 +
 +static struct device_attribute *audio_source_function_attributes[] = {
 +      &dev_attr_pcm,
 +      NULL
 +};
 +
 +static struct android_usb_function audio_source_function = {
 +      .name           = "audio_source",
 +      .init           = audio_source_function_init,
 +      .cleanup        = audio_source_function_cleanup,
 +      .bind_config    = audio_source_function_bind_config,
 +      .unbind_config  = audio_source_function_unbind_config,
 +      .attributes     = audio_source_function_attributes,
 +};
  
  static struct android_usb_function *supported_functions[] = {
        &adb_function,
        &rndis_function,
        &mass_storage_function,
        &accessory_function,
 +      &audio_source_function,
        NULL
  };
  
@@@ -996,13 -839,13 +999,13 @@@ static ssize_t enable_store(struct devi
  {
        struct android_dev *dev = dev_get_drvdata(pdev);
        struct usb_composite_dev *cdev = dev->cdev;
 +      struct android_usb_function *f;
        int enabled = 0;
  
        mutex_lock(&dev->mutex);
  
        sscanf(buff, "%d", &enabled);
        if (enabled && !dev->enabled) {
 -              cdev->next_string_id = 0;
                /* update values in composite driver's copy of device descriptor */
                cdev->desc.idVendor = device_desc.idVendor;
                cdev->desc.idProduct = device_desc.idProduct;
                cdev->desc.bDeviceClass = device_desc.bDeviceClass;
                cdev->desc.bDeviceSubClass = device_desc.bDeviceSubClass;
                cdev->desc.bDeviceProtocol = device_desc.bDeviceProtocol;
 -              usb_add_config(cdev, &android_config_driver,
 -                                      android_bind_config);
 -              usb_gadget_connect(cdev->gadget);
 +              list_for_each_entry(f, &dev->enabled_functions, enabled_list) {
 +                      if (f->enable)
 +                              f->enable(f);
 +              }
 +              android_enable(dev);
                dev->enabled = true;
        } else if (!enabled && dev->enabled) {
 -              usb_gadget_disconnect(cdev->gadget);
 -              /* Cancel pending control requests */
 -              usb_ep_dequeue(cdev->gadget->ep0, cdev->req);
 -              usb_remove_config(cdev, &android_config_driver);
 +              android_disable(dev);
 +              list_for_each_entry(f, &dev->enabled_functions, enabled_list) {
 +                      if (f->disable)
 +                              f->disable(f);
 +              }
                dev->enabled = false;
        } else {
                pr_err("android_usb: already %s\n",
@@@ -1085,7 -925,10 +1088,7 @@@ field ## _store(struct device *dev, str
                const char *buf, size_t size)                           \
  {                                                                     \
        if (size >= sizeof(buffer)) return -EINVAL;                     \
 -      if (sscanf(buf, "%s", buffer) == 1) {                           \
 -              return size;                                            \
 -      }                                                               \
 -      return -1;                                                      \
 +      return strlcpy(buffer, buf, sizeof(buffer));                    \
  }                                                                     \
  static DEVICE_ATTR(field, S_IRUGO | S_IWUSR, field ## _show, field ## _store);
  
@@@ -1196,6 -1039,7 +1199,6 @@@ static int android_bind(struct usb_comp
                device_desc.bcdDevice = __constant_cpu_to_le16(0x9999);
        }
  
 -      usb_gadget_set_selfpowered(gadget);
        dev->cdev = cdev;
  
        return 0;
@@@ -1269,11 -1113,6 +1272,11 @@@ static void android_disconnect(struct u
        unsigned long flags;
  
        composite_disconnect(gadget);
 +      /* accessory HID support can be active while the
 +         accessory function is not actually enabled,
 +         so we need to inform it when we are disconnected.
 +       */
 +      acc_disconnect();
  
        spin_lock_irqsave(&cdev->lock, flags);
        dev->connected = 0;
@@@ -1318,7 -1157,6 +1321,7 @@@ static int __init init(void
        if (!dev)
                return -ENOMEM;
  
 +      dev->disable_depth = 1;
        dev->functions = supported_functions;
        INIT_LIST_HEAD(&dev->enabled_functions);
        INIT_WORK(&dev->work, android_work);
index de61944d780f3937710dc81c050d603360a51510,076da888fae8e6566cfb5d01216acb6bc8782a8c..f79221e3fcfac4e7de1e264ef8ec00e3f30ade5e
@@@ -72,7 -72,7 +72,7 @@@ static struct usb_endpoint_descriptor a
        .bDescriptorType        = USB_DT_ENDPOINT,
        .bEndpointAddress       = USB_DIR_IN,
        .bmAttributes           = USB_ENDPOINT_XFER_BULK,
-       .wMaxPacketSize         = __constant_cpu_to_le16(64),
+       .wMaxPacketSize         = __constant_cpu_to_le16(512),
  };
  
  static struct usb_endpoint_descriptor adb_highspeed_out_desc = {
@@@ -111,8 -111,6 +111,8 @@@ static struct usb_descriptor_header *hs
        NULL,
  };
  
 +static void adb_ready_callback(void);
 +static void adb_closed_callback(void);
  
  /* temporary variable used between adb_open() and adb_gadget_bind() */
  static struct adb_dev *_adb_dev;
@@@ -408,7 -406,7 +408,7 @@@ static ssize_t adb_write(struct file *f
  
  static int adb_open(struct inode *ip, struct file *fp)
  {
 -      printk(KERN_INFO "adb_open\n");
 +      pr_info("adb_open\n");
        if (!_adb_dev)
                return -ENODEV;
  
        /* clear the error latch */
        _adb_dev->error = 0;
  
 +      adb_ready_callback();
 +
        return 0;
  }
  
  static int adb_release(struct inode *ip, struct file *fp)
  {
 -      printk(KERN_INFO "adb_release\n");
 +      pr_info("adb_release\n");
 +
 +      adb_closed_callback();
 +
        adb_unlock(&_adb_dev->open_excl);
        return 0;
  }
index 0bd7c7f899e5fd163f97409bac54aee7cc95517b,ab31c05b731ac863e57917d24d4b4f634e4e2115..f16c676b9de1191a578a085645a40e5762014df1
@@@ -47,7 -47,6 +47,7 @@@
  /* Function prototypes */
  static int  option_probe(struct usb_serial *serial,
                        const struct usb_device_id *id);
 +static void option_release(struct usb_serial *serial);
  static int option_send_setup(struct usb_serial_port *port);
  static void option_instat_callback(struct urb *urb);
  
  #define HUAWEI_PRODUCT_E14AC                  0x14AC
  #define HUAWEI_PRODUCT_K3806                  0x14AE
  #define HUAWEI_PRODUCT_K4605                  0x14C6
 +#define HUAWEI_PRODUCT_K5005                  0x14C8
  #define HUAWEI_PRODUCT_K3770                  0x14C9
  #define HUAWEI_PRODUCT_K3771                  0x14CA
  #define HUAWEI_PRODUCT_K4510                  0x14CB
  #define HUAWEI_PRODUCT_K4511                  0x14CC
  #define HUAWEI_PRODUCT_ETS1220                        0x1803
  #define HUAWEI_PRODUCT_E353                   0x1506
 +#define HUAWEI_PRODUCT_E173S                  0x1C05
  
  #define QUANTA_VENDOR_ID                      0x0408
  #define QUANTA_PRODUCT_Q101                   0xEA02
  #define NOVATELWIRELESS_PRODUCT_G1            0xA001
  #define NOVATELWIRELESS_PRODUCT_G1_M          0xA002
  #define NOVATELWIRELESS_PRODUCT_G2            0xA010
 +#define NOVATELWIRELESS_PRODUCT_MC551         0xB001
  
  /* AMOI PRODUCTS */
  #define AMOI_VENDOR_ID                                0x1614
  #define TELIT_VENDOR_ID                               0x1bc7
  #define TELIT_PRODUCT_UC864E                  0x1003
  #define TELIT_PRODUCT_UC864G                  0x1004
 +#define TELIT_PRODUCT_CC864_DUAL              0x1005
 +#define TELIT_PRODUCT_CC864_SINGLE            0x1006
 +#define TELIT_PRODUCT_DE910_DUAL              0x1010
  
  /* ZTE PRODUCTS */
  #define ZTE_VENDOR_ID                         0x19d2
  #define ZTE_PRODUCT_AC2726                    0xfff5
  #define ZTE_PRODUCT_AC100                     0x0094
  #define ZTE_PRODUCT_AC8710T                   0xffff
 +#define ZTE_PRODUCT_MC2718                    0xffe8
 +#define ZTE_PRODUCT_AD3812                    0xffeb
 +#define ZTE_PRODUCT_MC2716                    0xffed
  
  #define BENQ_VENDOR_ID                                0x04a5
  #define BENQ_PRODUCT_H10                      0x4068
  #define SC8800G_VENDOR_ID     0x067b
  #define SC8800G_PRODUCT_ID    0x2303
  
 -/* YUGA products  www.yuga-info.com*/
 +/* YUGA products  www.yuga-info.com gavin.kx@qq.com */
  #define YUGA_VENDOR_ID                                0x257A
  #define YUGA_PRODUCT_CEM600                   0x1601
  #define YUGA_PRODUCT_CEM610                   0x1602
  #define YUGA_PRODUCT_CEU516                   0x160C
  #define YUGA_PRODUCT_CEU528                   0x160D
  #define YUGA_PRODUCT_CEU526                   0x160F
 +#define YUGA_PRODUCT_CEU881                   0x161F
 +#define YUGA_PRODUCT_CEU882                   0x162F
  
  #define YUGA_PRODUCT_CWM600                   0x2601
  #define YUGA_PRODUCT_CWM610                   0x2602
  #define YUGA_PRODUCT_CWU518                   0x260B
  #define YUGA_PRODUCT_CWU516                   0x260C
  #define YUGA_PRODUCT_CWU528                   0x260D
 +#define YUGA_PRODUCT_CWU581                   0x260E
  #define YUGA_PRODUCT_CWU526                   0x260F
 -
 -#define YUGA_PRODUCT_CLM600                   0x2601
 -#define YUGA_PRODUCT_CLM610                   0x2602
 -#define YUGA_PRODUCT_CLM500                   0x2603
 -#define YUGA_PRODUCT_CLM510                   0x2604
 -#define YUGA_PRODUCT_CLM800                   0x2605
 -#define YUGA_PRODUCT_CLM900                   0x2606
 -
 -#define YUGA_PRODUCT_CLU718                   0x2607
 -#define YUGA_PRODUCT_CLU716                   0x2608
 -#define YUGA_PRODUCT_CLU728                   0x2609
 -#define YUGA_PRODUCT_CLU726                   0x260A
 -#define YUGA_PRODUCT_CLU518                   0x260B
 -#define YUGA_PRODUCT_CLU516                   0x260C
 -#define YUGA_PRODUCT_CLU528                   0x260D
 -#define YUGA_PRODUCT_CLU526                   0x260F
 +#define YUGA_PRODUCT_CWU582                   0x261F
 +#define YUGA_PRODUCT_CWU583                   0x262F
 +
 +#define YUGA_PRODUCT_CLM600                   0x3601
 +#define YUGA_PRODUCT_CLM610                   0x3602
 +#define YUGA_PRODUCT_CLM500                   0x3603
 +#define YUGA_PRODUCT_CLM510                   0x3604
 +#define YUGA_PRODUCT_CLM800                   0x3605
 +#define YUGA_PRODUCT_CLM900                   0x3606
 +
 +#define YUGA_PRODUCT_CLU718                   0x3607
 +#define YUGA_PRODUCT_CLU716                   0x3608
 +#define YUGA_PRODUCT_CLU728                   0x3609
 +#define YUGA_PRODUCT_CLU726                   0x360A
 +#define YUGA_PRODUCT_CLU518                   0x360B
 +#define YUGA_PRODUCT_CLU516                   0x360C
 +#define YUGA_PRODUCT_CLU528                   0x360D
 +#define YUGA_PRODUCT_CLU526                   0x360F
 +
 +/* Viettel products */
 +#define VIETTEL_VENDOR_ID                     0x2262
 +#define VIETTEL_PRODUCT_VT1000                        0x0002
 +
 +/* ZD Incorporated */
 +#define ZD_VENDOR_ID                          0x0685
 +#define ZD_PRODUCT_7000                               0x7000
 +
 +/* LG products */
 +#define LG_VENDOR_ID                          0x1004
 +#define LG_PRODUCT_L02C                               0x618f
 +
 +/* MediaTek products */
 +#define MEDIATEK_VENDOR_ID                    0x0e8d
 +#define MEDIATEK_PRODUCT_DC_1COM              0x00a0
 +#define MEDIATEK_PRODUCT_DC_4COM              0x00a5
 +#define MEDIATEK_PRODUCT_DC_5COM              0x00a4
 +#define MEDIATEK_PRODUCT_7208_1COM            0x7101
 +#define MEDIATEK_PRODUCT_7208_2COM            0x7102
 +#define MEDIATEK_PRODUCT_FP_1COM              0x0003
 +#define MEDIATEK_PRODUCT_FP_2COM              0x0023
 +#define MEDIATEK_PRODUCT_FPDC_1COM            0x0043
 +#define MEDIATEK_PRODUCT_FPDC_2COM            0x0033
 +
 +/* Cellient products */
 +#define CELLIENT_VENDOR_ID                    0x2692
 +#define CELLIENT_PRODUCT_MEN200                       0x9005
  
  /* some devices interfaces need special handling due to a number of reasons */
  enum option_blacklist_reason {
                OPTION_BLACKLIST_RESERVED_IF = 2
  };
  
 +#define MAX_BL_NUM  8
  struct option_blacklist_info {
 -      const u32 infolen;      /* number of interface numbers on blacklist */
 -      const u8  *ifaceinfo;   /* pointer to the array holding the numbers */
 -      enum option_blacklist_reason reason;
 +      /* bitfield of interface numbers for OPTION_BLACKLIST_SENDSETUP */
 +      const unsigned long sendsetup;
 +      /* bitfield of interface numbers for OPTION_BLACKLIST_RESERVED_IF */
 +      const unsigned long reserved;
  };
  
 -static const u8 four_g_w14_no_sendsetup[] = { 0, 1 };
  static const struct option_blacklist_info four_g_w14_blacklist = {
 -      .infolen = ARRAY_SIZE(four_g_w14_no_sendsetup),
 -      .ifaceinfo = four_g_w14_no_sendsetup,
 -      .reason = OPTION_BLACKLIST_SENDSETUP
 +      .sendsetup = BIT(0) | BIT(1),
  };
  
 -static const u8 alcatel_x200_no_sendsetup[] = { 0, 1 };
  static const struct option_blacklist_info alcatel_x200_blacklist = {
 -      .infolen = ARRAY_SIZE(alcatel_x200_no_sendsetup),
 -      .ifaceinfo = alcatel_x200_no_sendsetup,
 -      .reason = OPTION_BLACKLIST_SENDSETUP
 +      .sendsetup = BIT(0) | BIT(1),
 +};
 +
 +static const struct option_blacklist_info zte_0037_blacklist = {
 +      .sendsetup = BIT(0) | BIT(1),
  };
  
 -static const u8 zte_k3765_z_no_sendsetup[] = { 0, 1, 2 };
  static const struct option_blacklist_info zte_k3765_z_blacklist = {
 -      .infolen = ARRAY_SIZE(zte_k3765_z_no_sendsetup),
 -      .ifaceinfo = zte_k3765_z_no_sendsetup,
 -      .reason = OPTION_BLACKLIST_SENDSETUP
 +      .sendsetup = BIT(0) | BIT(1) | BIT(2),
 +      .reserved = BIT(4),
 +};
 +
 +static const struct option_blacklist_info zte_ad3812_z_blacklist = {
 +      .sendsetup = BIT(0) | BIT(1) | BIT(2),
 +};
 +
 +static const struct option_blacklist_info zte_mc2718_z_blacklist = {
 +      .sendsetup = BIT(1) | BIT(2) | BIT(3) | BIT(4),
 +};
 +
 +static const struct option_blacklist_info zte_mc2716_z_blacklist = {
 +      .sendsetup = BIT(1) | BIT(2) | BIT(3),
 +};
 +
 +static const struct option_blacklist_info huawei_cdc12_blacklist = {
 +      .reserved = BIT(1) | BIT(2),
 +};
 +
 +static const struct option_blacklist_info net_intf1_blacklist = {
 +      .reserved = BIT(1),
 +};
 +
 +static const struct option_blacklist_info net_intf2_blacklist = {
 +      .reserved = BIT(2),
 +};
 +
 +static const struct option_blacklist_info net_intf3_blacklist = {
 +      .reserved = BIT(3),
 +};
 +
 +static const struct option_blacklist_info net_intf4_blacklist = {
 +      .reserved = BIT(4),
 +};
 +
 +static const struct option_blacklist_info net_intf5_blacklist = {
 +      .reserved = BIT(5),
 +};
 +
 +static const struct option_blacklist_info zte_mf626_blacklist = {
 +      .sendsetup = BIT(0) | BIT(1),
 +      .reserved = BIT(4),
  };
  
  static const struct usb_device_id option_ids[] = {
        { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E143D, 0xff, 0xff, 0xff) },
        { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E143E, 0xff, 0xff, 0xff) },
        { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E143F, 0xff, 0xff, 0xff) },
 -      { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_K4505, 0xff, 0xff, 0xff) },
 -      { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_K3765, 0xff, 0xff, 0xff) },
 +      { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E173S, 0xff, 0xff, 0xff) },
 +      { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_K4505, 0xff, 0xff, 0xff),
 +              .driver_info = (kernel_ulong_t) &huawei_cdc12_blacklist },
 +      { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_K3765, 0xff, 0xff, 0xff),
 +              .driver_info = (kernel_ulong_t) &huawei_cdc12_blacklist },
        { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_ETS1220, 0xff, 0xff, 0xff) },
        { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E14AC, 0xff, 0xff, 0xff) },
        { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_K3806, 0xff, 0xff, 0xff) },
 -      { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_K4605, 0xff, 0xff, 0xff) },
 +      { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_K4605, 0xff, 0xff, 0xff),
 +              .driver_info = (kernel_ulong_t) &huawei_cdc12_blacklist },
 +      { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_K4605, 0xff, 0x01, 0x31) },
 +      { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_K4605, 0xff, 0x01, 0x32) },
 +      { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_K5005, 0xff, 0x01, 0x31) },
 +      { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_K5005, 0xff, 0x01, 0x32) },
 +      { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_K5005, 0xff, 0x01, 0x33) },
        { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_K3770, 0xff, 0x02, 0x31) },
        { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_K3770, 0xff, 0x02, 0x32) },
        { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_K3771, 0xff, 0x02, 0x31) },
        { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_K4511, 0xff, 0x01, 0x31) },
        { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_K4511, 0xff, 0x01, 0x32) },
        { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E353, 0xff, 0x01, 0x01) },
 +      { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E353, 0xff, 0x01, 0x02) },
 +      { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E353, 0xff, 0x01, 0x03) },
        { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E353, 0xff, 0x01, 0x10) },
        { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E353, 0xff, 0x01, 0x12) },
        { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E353, 0xff, 0x01, 0x13) },
 +      { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E353, 0xff, 0x02, 0x01) },  /* E398 3G Modem */
 +      { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E353, 0xff, 0x02, 0x02) },  /* E398 3G PC UI Interface */
 +      { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E353, 0xff, 0x02, 0x03) },  /* E398 3G Application Interface */
        { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_V640) },
        { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_V620) },
        { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_V740) },
        { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_EVDO_EMBEDDED_FULLSPEED) },
        { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_HSPA_EMBEDDED_FULLSPEED) },
        { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_EVDO_HIGHSPEED) },
 +      { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_HSPA_HIGHSPEED) },
        { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_HSPA_HIGHSPEED3) },
        { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_HSPA_HIGHSPEED4) },
        { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_HSPA_HIGHSPEED5) },
        { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_G1) },
        { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_G1_M) },
        { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_G2) },
 +      /* Novatel Ovation MC551 a.k.a. Verizon USB551L */
 +      { USB_DEVICE_AND_INTERFACE_INFO(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_MC551, 0xff, 0xff, 0xff) },
  
        { USB_DEVICE(AMOI_VENDOR_ID, AMOI_PRODUCT_H01) },
        { USB_DEVICE(AMOI_VENDOR_ID, AMOI_PRODUCT_H01A) },
        { USB_DEVICE(KYOCERA_VENDOR_ID, KYOCERA_PRODUCT_KPC680) },
        { USB_DEVICE(QUALCOMM_VENDOR_ID, 0x6000)}, /* ZTE AC8700 */
        { USB_DEVICE(QUALCOMM_VENDOR_ID, 0x6613)}, /* Onda H600/ZTE MF330 */
 +      { USB_DEVICE(QUALCOMM_VENDOR_ID, 0x9000)}, /* SIMCom SIM5218 */
        { USB_DEVICE(CMOTECH_VENDOR_ID, CMOTECH_PRODUCT_6280) }, /* BP3-USB & BP3-EXT HSDPA */
        { USB_DEVICE(CMOTECH_VENDOR_ID, CMOTECH_PRODUCT_6008) },
        { USB_DEVICE(TELIT_VENDOR_ID, TELIT_PRODUCT_UC864E) },
        { USB_DEVICE(TELIT_VENDOR_ID, TELIT_PRODUCT_UC864G) },
 +      { USB_DEVICE(TELIT_VENDOR_ID, TELIT_PRODUCT_CC864_DUAL) },
 +      { USB_DEVICE(TELIT_VENDOR_ID, TELIT_PRODUCT_CC864_SINGLE) },
 +      { USB_DEVICE(TELIT_VENDOR_ID, TELIT_PRODUCT_DE910_DUAL) },
        { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, ZTE_PRODUCT_MF622, 0xff, 0xff, 0xff) }, /* ZTE WCDMA products */
 -      { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0002, 0xff, 0xff, 0xff) },
 +      { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0002, 0xff, 0xff, 0xff),
 +              .driver_info = (kernel_ulong_t)&net_intf1_blacklist },
        { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0003, 0xff, 0xff, 0xff) },
        { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0004, 0xff, 0xff, 0xff) },
        { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0005, 0xff, 0xff, 0xff) },
        { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x000f, 0xff, 0xff, 0xff) },
        { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0010, 0xff, 0xff, 0xff) },
        { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0011, 0xff, 0xff, 0xff) },
 -      { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0012, 0xff, 0xff, 0xff) },
 +      { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0012, 0xff, 0xff, 0xff),
 +              .driver_info = (kernel_ulong_t)&net_intf1_blacklist },
        { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0013, 0xff, 0xff, 0xff) },
 -      { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0014, 0xff, 0xff, 0xff) },
        { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, ZTE_PRODUCT_MF628, 0xff, 0xff, 0xff) },
        { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0016, 0xff, 0xff, 0xff) },
 -      { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0017, 0xff, 0xff, 0xff) },
 +      { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0017, 0xff, 0xff, 0xff),
 +              .driver_info = (kernel_ulong_t)&net_intf3_blacklist },
        { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0018, 0xff, 0xff, 0xff) },
        { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0019, 0xff, 0xff, 0xff) },
        { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0020, 0xff, 0xff, 0xff) },
 -      { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0021, 0xff, 0xff, 0xff) },
 +      { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0021, 0xff, 0xff, 0xff),
 +              .driver_info = (kernel_ulong_t)&net_intf4_blacklist },
        { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0022, 0xff, 0xff, 0xff) },
        { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0023, 0xff, 0xff, 0xff) },
        { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0024, 0xff, 0xff, 0xff) },
 -      { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0025, 0xff, 0xff, 0xff) },
 -      /* { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0026, 0xff, 0xff, 0xff) }, */
 +      { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0025, 0xff, 0xff, 0xff),
 +              .driver_info = (kernel_ulong_t)&net_intf1_blacklist },
        { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0028, 0xff, 0xff, 0xff) },
        { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0029, 0xff, 0xff, 0xff) },
        { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0030, 0xff, 0xff, 0xff) },
        { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, ZTE_PRODUCT_MF626, 0xff,
 -        0xff, 0xff), .driver_info = (kernel_ulong_t)&four_g_w14_blacklist },
 +        0xff, 0xff), .driver_info = (kernel_ulong_t)&zte_mf626_blacklist },
        { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0032, 0xff, 0xff, 0xff) },
        { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0033, 0xff, 0xff, 0xff) },
        { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0034, 0xff, 0xff, 0xff) },
 -      { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0037, 0xff, 0xff, 0xff) },
 +      { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0037, 0xff, 0xff, 0xff),
 +              .driver_info = (kernel_ulong_t)&zte_0037_blacklist },
        { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0038, 0xff, 0xff, 0xff) },
        { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0039, 0xff, 0xff, 0xff) },
        { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0040, 0xff, 0xff, 0xff) },
 -      { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0042, 0xff, 0xff, 0xff) },
 +      { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0042, 0xff, 0xff, 0xff),
 +              .driver_info = (kernel_ulong_t)&net_intf4_blacklist },
        { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0043, 0xff, 0xff, 0xff) },
        { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0044, 0xff, 0xff, 0xff) },
        { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0048, 0xff, 0xff, 0xff) },
 -      { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0049, 0xff, 0xff, 0xff) },
 +      { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0049, 0xff, 0xff, 0xff),
 +              .driver_info = (kernel_ulong_t)&net_intf5_blacklist },
        { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0050, 0xff, 0xff, 0xff) },
        { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0051, 0xff, 0xff, 0xff) },
 -      { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0052, 0xff, 0xff, 0xff) },
 -      /* { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0053, 0xff, 0xff, 0xff) }, */
 +      { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0052, 0xff, 0xff, 0xff),
 +              .driver_info = (kernel_ulong_t)&net_intf4_blacklist },
        { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0054, 0xff, 0xff, 0xff) },
 -      { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0055, 0xff, 0xff, 0xff) },
 +      { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0055, 0xff, 0xff, 0xff),
 +              .driver_info = (kernel_ulong_t)&net_intf1_blacklist },
        { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0056, 0xff, 0xff, 0xff) },
        { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0057, 0xff, 0xff, 0xff) },
 -      { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0058, 0xff, 0xff, 0xff) },
 -      { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0059, 0xff, 0xff, 0xff) },
 +      { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0058, 0xff, 0xff, 0xff),
 +              .driver_info = (kernel_ulong_t)&net_intf4_blacklist },
        { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0061, 0xff, 0xff, 0xff) },
        { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0062, 0xff, 0xff, 0xff) },
 -      { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0063, 0xff, 0xff, 0xff) },
 +      { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0063, 0xff, 0xff, 0xff),
 +              .driver_info = (kernel_ulong_t)&net_intf4_blacklist },
        { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0064, 0xff, 0xff, 0xff) },
        { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0065, 0xff, 0xff, 0xff) },
        { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0066, 0xff, 0xff, 0xff) },
        { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0067, 0xff, 0xff, 0xff) },
        { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0069, 0xff, 0xff, 0xff) },
 -      { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0070, 0xff, 0xff, 0xff) },
        { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0076, 0xff, 0xff, 0xff) },
        { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0077, 0xff, 0xff, 0xff) },
        { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0078, 0xff, 0xff, 0xff) },
        { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0083, 0xff, 0xff, 0xff) },
        { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0086, 0xff, 0xff, 0xff) },
        { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0087, 0xff, 0xff, 0xff) },
 -      { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0104, 0xff, 0xff, 0xff) },
 +      { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0088, 0xff, 0xff, 0xff) },
 +      { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0089, 0xff, 0xff, 0xff) },
 +      { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0090, 0xff, 0xff, 0xff) },
 +      { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0091, 0xff, 0xff, 0xff) },
 +      { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0092, 0xff, 0xff, 0xff) },
 +      { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0093, 0xff, 0xff, 0xff) },
 +      { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0094, 0xff, 0xff, 0xff) },
 +      { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0095, 0xff, 0xff, 0xff) },
 +      { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0096, 0xff, 0xff, 0xff) },
 +      { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0097, 0xff, 0xff, 0xff) },
 +      { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0104, 0xff, 0xff, 0xff),
 +              .driver_info = (kernel_ulong_t)&net_intf4_blacklist },
        { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0105, 0xff, 0xff, 0xff) },
        { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0106, 0xff, 0xff, 0xff) },
        { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0108, 0xff, 0xff, 0xff) },
 -      { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0113, 0xff, 0xff, 0xff) },
 +      { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0113, 0xff, 0xff, 0xff),
 +              .driver_info = (kernel_ulong_t)&net_intf5_blacklist },
        { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0117, 0xff, 0xff, 0xff) },
        { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0118, 0xff, 0xff, 0xff) },
        { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0121, 0xff, 0xff, 0xff) },
        { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0143, 0xff, 0xff, 0xff) },
        { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0144, 0xff, 0xff, 0xff) },
        { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0145, 0xff, 0xff, 0xff) },
 -      { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0146, 0xff, 0xff, 0xff) },
 -      { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0147, 0xff, 0xff, 0xff) },
        { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0148, 0xff, 0xff, 0xff) },
 -      { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0149, 0xff, 0xff, 0xff) },
 -      { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0150, 0xff, 0xff, 0xff) },
        { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0151, 0xff, 0xff, 0xff) },
 -      { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0152, 0xff, 0xff, 0xff) },
        { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0153, 0xff, 0xff, 0xff) },
 -      { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0154, 0xff, 0xff, 0xff) },
        { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0155, 0xff, 0xff, 0xff) },
        { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0156, 0xff, 0xff, 0xff) },
        { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0157, 0xff, 0xff, 0xff) },
        { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0158, 0xff, 0xff, 0xff) },
        { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0159, 0xff, 0xff, 0xff) },
 -      { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0160, 0xff, 0xff, 0xff) },
        { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0161, 0xff, 0xff, 0xff) },
        { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0162, 0xff, 0xff, 0xff) },
 +      { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0164, 0xff, 0xff, 0xff) },
 +      { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0165, 0xff, 0xff, 0xff) },
 +      { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0167, 0xff, 0xff, 0xff),
 +        .driver_info = (kernel_ulong_t)&net_intf4_blacklist },
        { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1008, 0xff, 0xff, 0xff) },
        { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1010, 0xff, 0xff, 0xff) },
        { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1012, 0xff, 0xff, 0xff) },
        { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1298, 0xff, 0xff, 0xff) },
        { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1299, 0xff, 0xff, 0xff) },
        { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1300, 0xff, 0xff, 0xff) },
 +      { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1402, 0xff, 0xff, 0xff),
 +              .driver_info = (kernel_ulong_t)&net_intf2_blacklist },
 +      { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x2002, 0xff,
 +        0xff, 0xff), .driver_info = (kernel_ulong_t)&zte_k3765_z_blacklist },
 +      { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x2003, 0xff, 0xff, 0xff) },
 +
        { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0014, 0xff, 0xff, 0xff) }, /* ZTE CDMA products */
        { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0027, 0xff, 0xff, 0xff) },
        { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0059, 0xff, 0xff, 0xff) },
        { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0060, 0xff, 0xff, 0xff) },
        { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0070, 0xff, 0xff, 0xff) },
        { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0073, 0xff, 0xff, 0xff) },
 +      { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0094, 0xff, 0xff, 0xff) },
        { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0130, 0xff, 0xff, 0xff) },
 +      { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0133, 0xff, 0xff, 0xff) },
        { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0141, 0xff, 0xff, 0xff) },
 -      { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x2002, 0xff,
 -        0xff, 0xff), .driver_info = (kernel_ulong_t)&zte_k3765_z_blacklist },
 -      { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x2003, 0xff, 0xff, 0xff) },
 +      { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0147, 0xff, 0xff, 0xff) },
 +      { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0152, 0xff, 0xff, 0xff) },
 +      { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0168, 0xff, 0xff, 0xff) },
 +      { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0170, 0xff, 0xff, 0xff) },
 +      { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0176, 0xff, 0xff, 0xff) },
 +      { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0178, 0xff, 0xff, 0xff) },
 +
        { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, ZTE_PRODUCT_CDMA_TECH, 0xff, 0xff, 0xff) },
        { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, ZTE_PRODUCT_AC8710, 0xff, 0xff, 0xff) },
        { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, ZTE_PRODUCT_AC2726, 0xff, 0xff, 0xff) },
        { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0xF006, 0xff, 0xff, 0xff) },
        { USB_DEVICE(ZTE_VENDOR_ID, ZTE_PRODUCT_AC100)},
        { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, ZTE_PRODUCT_AC8710T, 0xff, 0xff, 0xff) },
 +      { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, ZTE_PRODUCT_MC2718, 0xff, 0xff, 0xff),
 +       .driver_info = (kernel_ulong_t)&zte_mc2718_z_blacklist },
 +      { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, ZTE_PRODUCT_AD3812, 0xff, 0xff, 0xff),
 +       .driver_info = (kernel_ulong_t)&zte_ad3812_z_blacklist },
 +      { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, ZTE_PRODUCT_MC2716, 0xff, 0xff, 0xff),
 +       .driver_info = (kernel_ulong_t)&zte_mc2716_z_blacklist },
        { USB_DEVICE(BENQ_VENDOR_ID, BENQ_PRODUCT_H10) },
        { USB_DEVICE(DLINK_VENDOR_ID, DLINK_PRODUCT_DWM_652) },
        { USB_DEVICE(ALINK_VENDOR_ID, DLINK_PRODUCT_DWM_652_U5) }, /* Yes, ALINK_VENDOR_ID */
        { USB_DEVICE(ZTE_VENDOR_ID, 0xFFFF) },
        { USB_DEVICE(LEADCORE_VENDOR_ID, 0x5700) },
        { USB_DEVICE(LEADCORE_VENDOR_ID, 0x6341) },
-       { USB_DEVICE(0x230d, 0x000d) },
+       { USB_DEVICE(0x230D, 0x000D) },
        { USB_DEVICE(0x0E8D, 0x00A2) },
        { USB_DEVICE(0x1E89, 0x1A20) },
        { USB_DEVICE(0x12D1, 0x1C05) },
        { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0007, 0xff, 0xff, 0xff) },
        { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0167, 0xff, 0xff, 0xff) },
+       { USB_DEVICE(HUAWEI_VENDOR_ID, 0x14A8) },
        { USB_DEVICE(0x20A6, 0x1105) },
+       { USB_DEVICE(0x1EE8, 0x005F) }, // Onda-MSA14.4
+       { USB_DEVICE(0x0421, 0x061E) }, // Nokia CS-11
+       { USB_DEVICE(0x0BDB, 0x190A) },
+       { USB_DEVICE(0x1d09, 0x1010) },
+     { USB_DEVICE(0x19D2, 0x1181) },
+       { USB_DEVICE(0x2020, 0x1005)},//S830 3G Dongle
+ // cmy end
+ //xxh
+    { USB_DEVICE_AND_INTERFACE_INFO(0x05c6, 0x1000, 0xff, 0xff, 0xff) },
+    { USB_DEVICE_AND_INTERFACE_INFO(0x05c6, 0x6000, 0xff, 0xff, 0xff) },
+    { USB_DEVICE_AND_INTERFACE_INFO(0x20A6, 0xF00E, 0xff, 0xff, 0xff) },
+    { USB_DEVICE_AND_INTERFACE_INFO(0x20A6, 0x1105, 0xff, 0xff, 0xff) },
+    { USB_DEVICE(0x21f5, 0x1101)},
+    { USB_DEVICE(0x230d,0x0101)},
+    { USB_DEVICE_AND_INTERFACE_INFO(0x230d, 0x1101, 0xff, 0xff, 0xff) },
+    { USB_DEVICE(0x2077,0xa000)},
+    { USB_DEVICE(0x1c9e,0x6061)},
+    { USB_DEVICE(0x1c9e,0x9605)},
+    { USB_DEVICE(0x19d2, 0x0170) },
+    { USB_DEVICE(0x19d2, 0xffe8) },
+    { USB_DEVICE(0x19D2,0x1177) },//K3770-Z
+    { USB_DEVICE(0x230D, 0x000c) },
+    { USB_DEVICE(0x21F5, 0x2009) },
+    { USB_DEVICE(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E353) },
+    { USB_DEVICE(0x15eb,0x0001)},
+ //xxh end
  
        { USB_DEVICE(OLIVETTI_VENDOR_ID, OLIVETTI_PRODUCT_OLICARD100) },
        { USB_DEVICE(CELOT_VENDOR_ID, CELOT_PRODUCT_CT680M) }, /* CT-650 CDMA 450 1xEVDO modem */
        { USB_DEVICE(YUGA_VENDOR_ID, YUGA_PRODUCT_CLU516) },
        { USB_DEVICE(YUGA_VENDOR_ID, YUGA_PRODUCT_CLU528) },
        { USB_DEVICE(YUGA_VENDOR_ID, YUGA_PRODUCT_CLU526) },
 +      { USB_DEVICE(YUGA_VENDOR_ID, YUGA_PRODUCT_CEU881) },
 +      { USB_DEVICE(YUGA_VENDOR_ID, YUGA_PRODUCT_CEU882) },
 +      { USB_DEVICE(YUGA_VENDOR_ID, YUGA_PRODUCT_CWU581) },
 +      { USB_DEVICE(YUGA_VENDOR_ID, YUGA_PRODUCT_CWU582) },
 +      { USB_DEVICE(YUGA_VENDOR_ID, YUGA_PRODUCT_CWU583) },
 +      { USB_DEVICE_AND_INTERFACE_INFO(VIETTEL_VENDOR_ID, VIETTEL_PRODUCT_VT1000, 0xff, 0xff, 0xff) },
 +      { USB_DEVICE_AND_INTERFACE_INFO(ZD_VENDOR_ID, ZD_PRODUCT_7000, 0xff, 0xff, 0xff) },
 +      { USB_DEVICE(LG_VENDOR_ID, LG_PRODUCT_L02C) }, /* docomo L-02C modem */
 +      { USB_DEVICE_AND_INTERFACE_INFO(MEDIATEK_VENDOR_ID, 0x00a1, 0xff, 0x00, 0x00) },
 +      { USB_DEVICE_AND_INTERFACE_INFO(MEDIATEK_VENDOR_ID, 0x00a1, 0xff, 0x02, 0x01) },
 +      { USB_DEVICE_AND_INTERFACE_INFO(MEDIATEK_VENDOR_ID, 0x00a2, 0xff, 0x00, 0x00) },
 +      { USB_DEVICE_AND_INTERFACE_INFO(MEDIATEK_VENDOR_ID, 0x00a2, 0xff, 0x02, 0x01) },        /* MediaTek MT6276M modem & app port */
 +      { USB_DEVICE_AND_INTERFACE_INFO(MEDIATEK_VENDOR_ID, MEDIATEK_PRODUCT_DC_1COM, 0x0a, 0x00, 0x00) },
 +      { USB_DEVICE_AND_INTERFACE_INFO(MEDIATEK_VENDOR_ID, MEDIATEK_PRODUCT_DC_5COM, 0xff, 0x02, 0x01) },
 +      { USB_DEVICE_AND_INTERFACE_INFO(MEDIATEK_VENDOR_ID, MEDIATEK_PRODUCT_DC_5COM, 0xff, 0x00, 0x00) },
 +      { USB_DEVICE_AND_INTERFACE_INFO(MEDIATEK_VENDOR_ID, MEDIATEK_PRODUCT_DC_4COM, 0xff, 0x02, 0x01) },
 +      { USB_DEVICE_AND_INTERFACE_INFO(MEDIATEK_VENDOR_ID, MEDIATEK_PRODUCT_DC_4COM, 0xff, 0x00, 0x00) },
 +      { USB_DEVICE_AND_INTERFACE_INFO(MEDIATEK_VENDOR_ID, MEDIATEK_PRODUCT_7208_1COM, 0x02, 0x00, 0x00) },
 +      { USB_DEVICE_AND_INTERFACE_INFO(MEDIATEK_VENDOR_ID, MEDIATEK_PRODUCT_7208_2COM, 0x02, 0x02, 0x01) },
 +      { USB_DEVICE_AND_INTERFACE_INFO(MEDIATEK_VENDOR_ID, MEDIATEK_PRODUCT_FP_1COM, 0x0a, 0x00, 0x00) },
 +      { USB_DEVICE_AND_INTERFACE_INFO(MEDIATEK_VENDOR_ID, MEDIATEK_PRODUCT_FP_2COM, 0x0a, 0x00, 0x00) },
 +      { USB_DEVICE_AND_INTERFACE_INFO(MEDIATEK_VENDOR_ID, MEDIATEK_PRODUCT_FPDC_1COM, 0x0a, 0x00, 0x00) },
 +      { USB_DEVICE_AND_INTERFACE_INFO(MEDIATEK_VENDOR_ID, MEDIATEK_PRODUCT_FPDC_2COM, 0x0a, 0x00, 0x00) },
 +      { USB_DEVICE(CELLIENT_VENDOR_ID, CELLIENT_PRODUCT_MEN200) },
        { } /* Terminating entry */
  };
  MODULE_DEVICE_TABLE(usb, option_ids);
@@@ -1366,7 -1233,7 +1394,7 @@@ static struct usb_serial_driver option_
        .ioctl             = usb_wwan_ioctl,
        .attach            = usb_wwan_startup,
        .disconnect        = usb_wwan_disconnect,
 -      .release           = usb_wwan_release,
 +      .release           = option_release,
        .read_int_callback = option_instat_callback,
  #ifdef CONFIG_PM
        .suspend           = usb_wwan_suspend,
  
  static int debug;
  
 -/* per port private data */
 -
 -#define N_IN_URB 4
 -#define N_OUT_URB 4
 -#define IN_BUFLEN 4096
 -#define OUT_BUFLEN 4096
 -
 -struct option_port_private {
 -      /* Input endpoints and buffer for this port */
 -      struct urb *in_urbs[N_IN_URB];
 -      u8 *in_buffer[N_IN_URB];
 -      /* Output endpoints and buffer for this port */
 -      struct urb *out_urbs[N_OUT_URB];
 -      u8 *out_buffer[N_OUT_URB];
 -      unsigned long out_busy;         /* Bit vector of URBs in use */
 -      int opened;
 -      struct usb_anchor delayed;
 -
 -      /* Settings for the port */
 -      int rts_state;  /* Handshaking pins (outputs) */
 -      int dtr_state;
 -      int cts_state;  /* Handshaking pins (inputs) */
 -      int dsr_state;
 -      int dcd_state;
 -      int ri_state;
 -
 -      unsigned long tx_start_time[N_OUT_URB];
 -};
 -
  /* Functions used by new usb-serial code. */
  static int __init option_init(void)
  {
@@@ -1407,35 -1303,10 +1435,35 @@@ static void __exit option_exit(void
  module_init(option_init);
  module_exit(option_exit);
  
 +static bool is_blacklisted(const u8 ifnum, enum option_blacklist_reason reason,
 +                         const struct option_blacklist_info *blacklist)
 +{
 +      unsigned long num;
 +      const unsigned long *intf_list;
 +
 +      if (blacklist) {
 +              if (reason == OPTION_BLACKLIST_SENDSETUP)
 +                      intf_list = &blacklist->sendsetup;
 +              else if (reason == OPTION_BLACKLIST_RESERVED_IF)
 +                      intf_list = &blacklist->reserved;
 +              else {
 +                      BUG_ON(reason);
 +                      return false;
 +              }
 +
 +              for_each_set_bit(num, intf_list, MAX_BL_NUM + 1) {
 +                      if (num == ifnum)
 +                              return true;
 +              }
 +      }
 +      return false;
 +}
 +
  static int option_probe(struct usb_serial *serial,
                        const struct usb_device_id *id)
  {
        struct usb_wwan_intf_private *data;
 +
        /* D-Link DWM 652 still exposes CD-Rom emulation interface in modem mode */
        if (serial->dev->descriptor.idVendor == DLINK_VENDOR_ID &&
                serial->dev->descriptor.idProduct == DLINK_PRODUCT_DWM_652 &&
                serial->interface->cur_altsetting->desc.bInterfaceClass != 0xff)
                return -ENODEV;
  
 -      /* Don't bind network interfaces on Huawei K3765, K4505 & K4605 */
 -      if (serial->dev->descriptor.idVendor == HUAWEI_VENDOR_ID &&
 -              (serial->dev->descriptor.idProduct == HUAWEI_PRODUCT_K3765 ||
 -                      serial->dev->descriptor.idProduct == HUAWEI_PRODUCT_K4505 ||
 -                      serial->dev->descriptor.idProduct == HUAWEI_PRODUCT_K4605) &&
 -              (serial->interface->cur_altsetting->desc.bInterfaceNumber == 1 ||
 -                      serial->interface->cur_altsetting->desc.bInterfaceNumber == 2))
 +      /* Don't bind reserved interfaces (like network ones) which often have
 +       * the same class/subclass/protocol as the serial interfaces.  Look at
 +       * the Windows driver .INF files for reserved interface numbers.
 +       */
 +      if (is_blacklisted(
 +              serial->interface->cur_altsetting->desc.bInterfaceNumber,
 +              OPTION_BLACKLIST_RESERVED_IF,
 +              (const struct option_blacklist_info *) id->driver_info))
                return -ENODEV;
  
        /* Don't bind network interface on Samsung GT-B3730, it is handled by a separate module */
                return -ENODEV;
  
        data = serial->private = kzalloc(sizeof(struct usb_wwan_intf_private), GFP_KERNEL);
 -
        if (!data)
                return -ENOMEM;
        data->send_setup = option_send_setup;
        return 0;
  }
  
 -static enum option_blacklist_reason is_blacklisted(const u8 ifnum,
 -                              const struct option_blacklist_info *blacklist)
 +static void option_release(struct usb_serial *serial)
  {
 -      const u8  *info;
 -      int i;
 +      struct usb_wwan_intf_private *priv = usb_get_serial_data(serial);
  
 -      if (blacklist) {
 -              info = blacklist->ifaceinfo;
 +      usb_wwan_release(serial);
  
 -              for (i = 0; i < blacklist->infolen; i++) {
 -                      if (info[i] == ifnum)
 -                              return blacklist->reason;
 -              }
 -      }
 -      return OPTION_BLACKLIST_NONE;
 +      kfree(priv);
  }
  
  static void option_instat_callback(struct urb *urb)
        int err;
        int status = urb->status;
        struct usb_serial_port *port =  urb->context;
 -      struct option_port_private *portdata = usb_get_serial_port_data(port);
 +      struct usb_wwan_port_private *portdata =
 +                                      usb_get_serial_port_data(port);
        static int err_times = 0;
  
        dbg("%s", __func__);
@@@ -1559,13 -1437,14 +1587,13 @@@ static int option_send_setup(struct usb
        struct usb_serial *serial = port->serial;
        struct usb_wwan_intf_private *intfdata =
                (struct usb_wwan_intf_private *) serial->private;
 -      struct option_port_private *portdata;
 +      struct usb_wwan_port_private *portdata;
        int ifNum = serial->interface->cur_altsetting->desc.bInterfaceNumber;
        int val = 0;
        dbg("%s", __func__);
  
 -      if (is_blacklisted(ifNum,
 -                         (struct option_blacklist_info *) intfdata->private)
 -          == OPTION_BLACKLIST_SENDSETUP) {
 +      if (is_blacklisted(ifNum, OPTION_BLACKLIST_SENDSETUP,
 +                      (struct option_blacklist_info *) intfdata->private)) {
                dbg("No send_setup on blacklisted interface #%d\n", ifNum);
                return -EIO;
        }
diff --combined include/net/cfg80211.h
index a2a97f34b9cbcc5d112bd339766b54b8a690267f,fc55a37ea6ae79dfb3313c6240acbb45c37a8e95..a2a97f34b9cbcc5d112bd339766b54b8a690267f
mode 100644,100755..100755
@@@ -426,7 -426,6 +426,7 @@@ struct station_parameters 
   * @STATION_INFO_RX_BITRATE: @rxrate fields are filled
   * @STATION_INFO_BSS_PARAM: @bss_param filled
   * @STATION_INFO_CONNECTED_TIME: @connected_time filled
 + * @STATION_INFO_ASSOC_REQ_IES: @assoc_req_ies filled
   */
  enum station_info_flags {
        STATION_INFO_INACTIVE_TIME      = 1<<0,
        STATION_INFO_SIGNAL_AVG         = 1<<13,
        STATION_INFO_RX_BITRATE         = 1<<14,
        STATION_INFO_BSS_PARAM          = 1<<15,
 -      STATION_INFO_CONNECTED_TIME     = 1<<16
 +      STATION_INFO_CONNECTED_TIME     = 1<<16,
 +      STATION_INFO_ASSOC_REQ_IES      = 1<<17
  };
  
  /**
@@@ -538,11 -536,6 +538,11 @@@ struct sta_bss_parameters 
   *    This number should increase every time the list of stations
   *    changes, i.e. when a station is added or removed, so that
   *    userspace can tell whether it got a consistent snapshot.
 + * @assoc_req_ies: IEs from (Re)Association Request.
 + *    This is used only when in AP mode with drivers that do not use
 + *    user space MLME/SME implementation. The information is provided for
 + *    the cfg80211_new_sta() calls to notify user space of the IEs.
 + * @assoc_req_ies_len: Length of assoc_req_ies buffer in octets.
   */
  struct station_info {
        u32 filled;
  
        int generation;
  
 -#if defined(CONFIG_MT6620)    
        const u8 *assoc_req_ies;
 -    size_t assoc_req_ies_len;
 -#endif    
 +      size_t assoc_req_ies_len;
 +
 +      /*
 +       * Note: Add a new enum station_info_flags value for each new field and
 +       * use it to check which fields are initialized.
 +       */
  };
  
  /**
@@@ -812,15 -802,6 +812,15 @@@ struct cfg80211_scan_request 
        struct ieee80211_channel *channels[0];
  };
  
 +/**
 + * struct cfg80211_match_set - sets of attributes to match
 + *
 + * @ssid: SSID to be matched
 + */
 +struct cfg80211_match_set {
 +      struct cfg80211_ssid ssid;
 +};
 +
  /**
   * struct cfg80211_sched_scan_request - scheduled scan request description
   *
   * @interval: interval between each scheduled scan cycle
   * @ie: optional information element(s) to add into Probe Request or %NULL
   * @ie_len: length of ie in octets
 + * @match_sets: sets of parameters to be matched for a scan result
 + *    entry to be considered valid and to be passed to the host
 + *    (others are filtered out).
 + *    If ommited, all results are passed.
 + * @n_match_sets: number of match sets
   * @wiphy: the wiphy this was for
   * @dev: the interface
   * @channels: channels to scan
@@@ -846,8 -822,6 +846,8 @@@ struct cfg80211_sched_scan_request 
        u32 interval;
        const u8 *ie;
        size_t ie_len;
 +      struct cfg80211_match_set *match_sets;
 +      int n_match_sets;
  
        /* internal */
        struct wiphy *wiphy;
@@@ -1747,16 -1721,9 +1747,16 @@@ struct wiphy_wowlan_support 
   *    this variable determines its size
   * @max_scan_ssids: maximum number of SSIDs the device can scan for in
   *    any given scan
 + * @max_sched_scan_ssids: maximum number of SSIDs the device can scan
 + *    for in any given scheduled scan
 + * @max_match_sets: maximum number of match sets the device can handle
 + *    when performing a scheduled scan, 0 if filtering is not
 + *    supported.
   * @max_scan_ie_len: maximum length of user-controlled IEs device can
   *    add to probe request frames transmitted during a scan, must not
   *    include fixed IEs like supported rates
 + * @max_sched_scan_ie_len: same as max_scan_ie_len, but for scheduled
 + *    scans
   * @coverage_class: current coverage class
   * @fw_version: firmware version for ethtool reporting
   * @hw_version: hardware version for ethtool reporting
@@@ -1808,10 -1775,7 +1808,10 @@@ struct wiphy 
  
        int bss_priv_size;
        u8 max_scan_ssids;
 +      u8 max_sched_scan_ssids;
 +      u8 max_match_sets;
        u16 max_scan_ie_len;
 +      u16 max_sched_scan_ie_len;
  
        int n_cipher_suites;
        const u32 *cipher_suites;
diff --combined net/bluetooth/hci_core.c
index f38e633c75466f54438c3bf6cb4550d7806b250f,ca8e80e6e5df73552690a019e6766f59e9cfe9f2..7f3ba322779a56b390ba59aa11f9ca4e93b19134
mode 100644,100755..100755
@@@ -510,11 -510,6 +510,11 @@@ int hci_dev_open(__u16 dev
  
        hci_req_lock(hdev);
  
 +      if (test_bit(HCI_UNREGISTER, &hdev->flags)) {
 +              ret = -ENODEV;
 +              goto done;
 +      }
 +
        if (hdev->rfkill && rfkill_blocked(hdev->rfkill)) {
                ret = -ERFKILL;
                goto done;
@@@ -1535,6 -1530,7 +1535,7 @@@ int hci_register_dev(struct hci_dev *hd
  
        hci_register_sysfs(hdev);
  
+ #if !defined(CONFIG_MT6620)
        hdev->rfkill = rfkill_alloc(hdev->name, &hdev->dev,
                                RFKILL_TYPE_BLUETOOTH, &hci_rfkill_ops, hdev);
        if (hdev->rfkill) {
        set_bit(HCI_AUTO_OFF, &hdev->flags);
        set_bit(HCI_SETUP, &hdev->flags);
        queue_work(hdev->workqueue, &hdev->power_on);
+ #endif
  
        hci_notify(hdev, HCI_DEV_REG);
  
@@@ -1568,8 -1565,6 +1570,8 @@@ int hci_unregister_dev(struct hci_dev *
  
        BT_DBG("%p name %s bus %d", hdev, hdev->name, hdev->bus);
  
 +      set_bit(HCI_UNREGISTER, &hdev->flags);
 +
        write_lock_bh(&hci_dev_list_lock);
        list_del(&hdev->list);
        write_unlock_bh(&hci_dev_list_lock);