diff --git a/packages/linux-drivers/amlogic/qca9377-aml/package.mk b/packages/linux-drivers/amlogic/qca9377-aml/package.mk
new file mode 100644
index 0000000000..9d5dd2b50b
--- /dev/null
+++ b/packages/linux-drivers/amlogic/qca9377-aml/package.mk
@@ -0,0 +1,55 @@
+################################################################################
+# This file is part of LibreELEC - https://libreelec.tv
+# Copyright (C) 2017-present Team LibreELEC
+#
+# LibreELEC 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.
+#
+# LibreELEC is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with LibreELEC. If not, see .
+################################################################################
+
+PKG_NAME="qca9377-aml"
+PKG_VERSION="0cc65f9"
+PKG_SHA256="336f6e95fc16874a81daf5289c656688a90c5df566ffeaea708f7ac2f5198b9e"
+PKG_ARCH="arm aarch64"
+PKG_LICENSE="GPL"
+PKG_SITE="https://boundarydevices.com/new-silex-wifi-802-11ac-bt4-1-module/"
+PKG_URL="https://github.com/boundarydevices/qcacld-2.0/archive/$PKG_VERSION.tar.gz"
+PKG_SOURCE_DIR="qcacld-2.0-$PKG_VERSION*"
+PKG_DEPENDS_TARGET="toolchain linux"
+PKG_NEED_UNPACK="$LINUX_DEPENDS"
+PKG_SECTION="driver"
+PKG_SHORTDESC="qca9377 Linux driver"
+PKG_LONGDESC="qca9377 Linux Driver"
+PKG_IS_KERNEL_PKG="yes"
+PKG_TOOLCHAIN="manual"
+
+post_unpack() {
+ sed -i 's,-Wall,,g; s,-Werror,,g' $PKG_BUILD/Kbuild
+ sed -i 's,CDEFINES :=,CDEFINES := -Wno-misleading-indentation -Wno-unused-variable -Wno-unused-function,g' $PKG_BUILD/Kbuild
+}
+
+pre_make_target() {
+ unset LDFLAGS
+ unset CFLAGS
+}
+
+make_target() {
+ make KERNEL_SRC="$(kernel_path)" \
+ ARCH=$TARGET_KERNEL_ARCH \
+ CROSS_COMPILE=$TARGET_PREFIX \
+ CONFIG_CLD_HL_SDIO_CORE=y
+}
+
+makeinstall_target() {
+ mkdir -p $INSTALL/$(get_full_module_dir)/$PKG_NAME
+ find $PKG_BUILD/ -name \*.ko -not -path '*/\.*' -exec cp {} $INSTALL/$(get_full_module_dir)/$PKG_NAME \;
+}
diff --git a/packages/linux-drivers/amlogic/qca9377-aml/patches/qca9377-aml-001-Modify-SDIO-and-firmware-handling-to-support-chips-u.patch b/packages/linux-drivers/amlogic/qca9377-aml/patches/qca9377-aml-001-Modify-SDIO-and-firmware-handling-to-support-chips-u.patch
new file mode 100644
index 0000000000..3523e59c84
--- /dev/null
+++ b/packages/linux-drivers/amlogic/qca9377-aml/patches/qca9377-aml-001-Modify-SDIO-and-firmware-handling-to-support-chips-u.patch
@@ -0,0 +1,538 @@
+From 7d4ee23fb20cc5e17d8d79db20a0d6704ac3df6c Mon Sep 17 00:00:00 2001
+From: kszaq
+Date: Tue, 10 Jan 2017 22:43:12 +0100
+Subject: [PATCH] Modify SDIO and firmware handling to support chips used in
+ Amlogic devices
+
+---
+ CORE/HDD/src/wlan_hdd_cfg.c | 10 +-
+ CORE/HDD/src/wlan_hdd_main.c | 180 ++++++++++++++++++++-
+ CORE/SERVICES/BMI/ol_fw.c | 8 +-
+ CORE/SERVICES/HIF/sdio/linux/if_ath_sdio.c | 6 -
+ .../sdio/linux/native_sdio/include/hif_internal.h | 2 +-
+ CORE/SERVICES/HIF/sdio/linux/native_sdio/src/hif.c | 62 +++----
+ 6 files changed, 209 insertions(+), 59 deletions(-)
+
+diff --git a/CORE/HDD/src/wlan_hdd_cfg.c b/CORE/HDD/src/wlan_hdd_cfg.c
+index af7f399..5eedfcb 100644
+--- a/CORE/HDD/src/wlan_hdd_cfg.c
++++ b/CORE/HDD/src/wlan_hdd_cfg.c
+@@ -60,6 +60,8 @@
+ #include
+ #include
+
++extern int qca_request_firmware(const struct firmware **firmware_p, const char *name,struct device *device);
++
+ static char *mac_param;
+ module_param_named(mac, mac_param, charp, S_IRUGO);
+ MODULE_PARM_DESC(mac, "mac address override");
+@@ -4411,11 +4413,11 @@ VOS_STATUS hdd_parse_config_ini(hdd_context_t* pHddCtx)
+
+ memset(cfgIniTable, 0, sizeof(cfgIniTable));
+
+- status = request_firmware(&fw, WLAN_INI_FILE, pHddCtx->parent_dev);
++ status = qca_request_firmware(&fw, WLAN_INI_FILE, pHddCtx->parent_dev);
+
+ if(status)
+ {
+- hddLog(VOS_TRACE_LEVEL_FATAL, "%s: request_firmware failed %d",__func__, status);
++ hddLog(VOS_TRACE_LEVEL_FATAL, "%s: qca_request_firmware failed %d",__func__, status);
+ vos_status = VOS_STATUS_E_FAILURE;
+ goto config_exit;
+ }
+@@ -5104,11 +5106,11 @@ VOS_STATUS hdd_update_mac_config(hdd_context_t *pHddCtx)
+ }
+
+ memset(macTable, 0, sizeof(macTable));
+- status = request_firmware(&fw, WLAN_MAC_FILE, pHddCtx->parent_dev);
++ status = qca_request_firmware(&fw, WLAN_MAC_FILE, pHddCtx->parent_dev);
+
+ if (status)
+ {
+- hddLog(VOS_TRACE_LEVEL_WARN, "%s: request_firmware failed %d",
++ hddLog(VOS_TRACE_LEVEL_WARN, "%s: qca_request_firmware failed %d",
+ __func__, status);
+ vos_status = VOS_STATUS_E_FAILURE;
+ return vos_status;
+diff --git a/CORE/HDD/src/wlan_hdd_main.c b/CORE/HDD/src/wlan_hdd_main.c
+index 1919627..3bcc6b0 100644
+--- a/CORE/HDD/src/wlan_hdd_main.c
++++ b/CORE/HDD/src/wlan_hdd_main.c
+@@ -239,6 +239,163 @@ static VOS_STATUS hdd_parse_ese_beacon_req(tANI_U8 *pValue,
+ /*
+ * Android DRIVER command structures
+ */
++//tkun add
++ typedef char A_CHAR;
++ #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20)
++ #define GET_INODE_FROM_FILEP(filp) \
++ (filp)->f_path.dentry->d_inode
++ #else
++ #define GET_INODE_FROM_FILEP(filp) \
++ (filp)->f_dentry->d_inode
++ #endif
++// #define A_MALLOC(size) kmalloc((size), GFP_KERNEL)
++ #define A_MALLOC_NOWAIT(size) kmalloc((size), GFP_ATOMIC)
++// #define A_FREE(addr) kfree(addr);addr=NULL;
++//#define A_MEMCPY(dst, src, len) memcpy((dst), (src), (len))
++// #define A_MEMZERO(addr, len) memset((addr), 0, (len))
++ #define A_MEMCMP(addr1, addr2, len) memcmp((addr1), (addr2), (len))
++ #define A_ROUND_UP(x, y) ((((x) + ((y) - 1)) / (y)) * (y))
++
++ char qcafwpath[256] = "/lib/firmware";
++
++ int android_readwrite_file(const A_CHAR *filename, A_CHAR *rbuf, const A_CHAR *wbuf, size_t length)
++ {
++ int ret = 0;
++ struct file *filp = (struct file *)-ENOENT;
++ mm_segment_t oldfs;
++ oldfs = get_fs();
++ set_fs(KERNEL_DS);
++
++ // printk("%s: filename %s \n",__func__,filename);
++ do {
++ int mode = (wbuf) ? O_RDWR : O_RDONLY;
++ filp = filp_open(filename, mode, S_IRUSR);
++ if (IS_ERR(filp) || !filp->f_op) {
++ printk("%s: file %s filp_open error\n", __FUNCTION__, filename);
++ ret = -ENOENT;
++ break;
++ }
++
++ if (length==0) {
++ /* Read the length of the file only */
++ struct inode *inode;
++
++ inode = GET_INODE_FROM_FILEP(filp);
++ if (!inode) {
++ // printk("%s: Get inode from %s failed\n", __FUNCTION__, filen ame);
++ ret = -ENOENT;
++ break;
++ }
++ ret = i_size_read(inode->i_mapping->host);
++ break;
++ }
++
++ if (wbuf) {
++ if ( (ret=filp->f_op->write(filp, wbuf, length, &filp->f_pos)) < 0) {
++// printk("%s: Write %u bytes to file %s error %d\n", __FUNCTION__,
++ // length, filename, ret);
++ break;
++ }
++ } else {
++ if ( (ret=filp->f_op->read(filp, rbuf, length, &filp->f_pos)) < 0) {
++// printk ("%s: Read %u bytes from file %s error %d\n", __FUNCTION__,
++ // length, filename, ret);
++ break;
++ }
++ }
++ } while (0);
++
++ if (!IS_ERR(filp)) {
++ filp_close(filp, NULL);
++ }
++ set_fs(oldfs);
++
++ return ret;
++ }
++
++
++ int android_request_firmware(const struct firmware **firmware_p, const char *name,struct device *device)
++ {
++ int ret = 0;
++ struct firmware *firmware;
++ char filename[256];
++ const char *raw_filename = name;
++ *firmware_p = firmware = A_MALLOC(sizeof(*firmware));
++ if (!firmware)
++ return -ENOMEM;
++ A_MEMZERO(firmware, sizeof(*firmware));
++ do {
++ size_t length, bufsize, bmisize;
++
++ if (snprintf(filename, sizeof(filename), "%s/%s", qcafwpath,
++ raw_filename) >= sizeof(filename)) {
++ printk("snprintf: %s/%s\n", qcafwpath, raw_filename);
++ ret = -1;
++ break;
++ }
++ if ( (ret=android_readwrite_file(filename, NULL, NULL, 0)) < 0) {
++ break;
++ } else {
++ length = ret;
++ }
++
++ if (strcmp(raw_filename, "softmac") == 0) {
++ bufsize = length = 17;
++ } else {
++ bufsize = ALIGN(length, PAGE_SIZE);
++ bmisize = A_ROUND_UP(length, 4);
++ bufsize = max(bmisize, bufsize);
++ }
++ firmware->data = vmalloc(bufsize);
++ firmware->size = length;
++
++ // printk("AR6K: %s(): raw_filename=%s, bufsize=%d\n", __FUNCTION__, ra w_filename, bufsize);
++
++ if (!firmware->data) {
++ printk("%s: Cannot allocate buffer for firmware\n", __FUNCTION__);
++ ret = -ENOMEM;
++ break;
++ }
++
++ if ( (ret=android_readwrite_file(filename, (char*)firmware->data, NULL, length)) != length) {
++// printk("%s: file read error, ret %d request %d\n", __FUNCTION__,ret,length);
++// ret = -1;
++ break;
++ }
++
++ } while (0);
++
++ if (ret<0) {
++ if (firmware) {
++ if (firmware->data)
++ vfree(firmware->data);
++ A_FREE(firmware);
++ }
++ *firmware_p = NULL;
++ } else {
++ ret = 0;
++ }
++ return ret;
++ }
++
++ void android_release_firmware(const struct firmware *firmware)
++ {
++ if (firmware) {
++ if (firmware->data)
++ vfree(firmware->data);
++ kfree(firmware);
++ }
++ }
++extern int qca_request_firmware(const struct firmware **firmware_p,const char *name,struct device *device)
++ {
++ // int uevent = 1;
++
++ //return _request_firmware(firmware_p, name, device, uevent, false);
++
++ return android_request_firmware(firmware_p, name,device);
++
++
++ }
+ struct android_wifi_reassoc_params {
+ unsigned char bssid[18];
+ int channel;
+@@ -7778,7 +7935,7 @@ VOS_STATUS hdd_get_cfg_file_size(v_VOID_t *pCtx, char *pFileName, v_SIZE_t *pBuf
+
+ ENTER();
+
+- status = request_firmware(&pHddCtx->fw, pFileName, pHddCtx->parent_dev);
++ status = qca_request_firmware(&pHddCtx->fw, pFileName, pHddCtx->parent_dev);
+
+ if(status || !pHddCtx->fw || !pHddCtx->fw->data) {
+ hddLog(VOS_TRACE_LEVEL_FATAL,"%s: CFG download failed",__func__);
+@@ -7819,7 +7976,7 @@ VOS_STATUS hdd_read_cfg_file(v_VOID_t *pCtx, char *pFileName,
+
+ ENTER();
+
+- status = request_firmware(&pHddCtx->fw, pFileName, pHddCtx->parent_dev);
++ status = qca_request_firmware(&pHddCtx->fw, pFileName, pHddCtx->parent_dev);
+
+ if(status || !pHddCtx->fw || !pHddCtx->fw->data) {
+ hddLog(VOS_TRACE_LEVEL_FATAL,"%s: CFG download failed",__func__);
+@@ -12860,15 +13017,34 @@ static int hdd_driver_init( void)
+ \return - 0 for success, non zero for failure
+
+ --------------------------------------------------------------------------*/
++#if (LINUX_VERSION_CODE < KERNEL_VERSION(3, 14, 0))
++extern int wifi_setup_dt(void);
++extern void wifi_teardown_dt(void);
++#endif
++extern void extern_wifi_set_enable(int is_on);
++extern void sdio_reinit(void);
++
+ #ifdef MODULE
+ static int __init hdd_module_init ( void)
+ {
++#if (LINUX_VERSION_CODE < KERNEL_VERSION(3, 14, 0))
++ wifi_setup_dt();
++#endif
++ extern_wifi_set_enable(0);
++ mdelay(200);
++ extern_wifi_set_enable(1);
++ mdelay(200);
++sdio_reinit();
++
+ return hdd_driver_init();
+ }
+ #else /* #ifdef MODULE */
+ static int __init hdd_module_init ( void)
+ {
+ /* Driver initialization is delayed to fwpath_changed_handler */
++#if (LINUX_VERSION_CODE < KERNEL_VERSION(3, 14, 0))
++wifi_teardown_dt();
++#endif
+ return 0;
+ }
+ #endif /* #ifdef MODULE */
+diff --git a/CORE/SERVICES/BMI/ol_fw.c b/CORE/SERVICES/BMI/ol_fw.c
+index 66d741e..6e0e8d8 100644
+--- a/CORE/SERVICES/BMI/ol_fw.c
++++ b/CORE/SERVICES/BMI/ol_fw.c
+@@ -118,7 +118,7 @@ static int ol_get_fw_files_for_target(struct ol_fw_files *pfw_files,
+ return 0;
+ }
+ #endif
+-
++extern int qca_request_firmware(const struct firmware **firmware_p, const char *name,struct device *device);
+ #ifdef HIF_USB
+ static A_STATUS ol_usb_extra_initialization(struct ol_softc *scn);
+ #endif
+@@ -164,7 +164,7 @@ static int ol_transfer_single_bin_file(struct ol_softc *scn,
+ __func__));
+ }
+
+- if (request_firmware(&fw_entry, filename, scn->sc_osdev->device) != 0)
++ if (qca_request_firmware(&fw_entry, filename, scn->sc_osdev->device) != 0)
+ {
+ AR_DEBUG_PRINTF(ATH_DEBUG_ERR,
+ ("%s: Failed to get %s\n",
+@@ -492,7 +492,7 @@ static int ol_transfer_bin_file(struct ol_softc *scn, ATH_BIN_FILE file,
+ break;
+ }
+
+- if (request_firmware(&fw_entry, filename, scn->sc_osdev->device) != 0)
++ if (qca_request_firmware(&fw_entry, filename, scn->sc_osdev->device) != 0)
+ {
+ printk("%s: Failed to get %s\n", __func__, filename);
+
+@@ -506,7 +506,7 @@ static int ol_transfer_bin_file(struct ol_softc *scn, ATH_BIN_FILE file,
+ filename = scn->fw_files.board_data;
+ printk("%s: Trying to load default %s\n",
+ __func__, filename);
+- if (request_firmware(&fw_entry, filename,
++ if (qca_request_firmware(&fw_entry, filename,
+ scn->sc_osdev->device) != 0) {
+ printk("%s: Failed to get %s\n",
+ __func__, filename);
+diff --git a/CORE/SERVICES/HIF/sdio/linux/if_ath_sdio.c b/CORE/SERVICES/HIF/sdio/linux/if_ath_sdio.c
+index c99020e..6bafed8 100644
+--- a/CORE/SERVICES/HIF/sdio/linux/if_ath_sdio.c
++++ b/CORE/SERVICES/HIF/sdio/linux/if_ath_sdio.c
+@@ -234,12 +234,6 @@ ath_hif_sdio_remove(void *context, void *hif_handle)
+ {
+ ENTER();
+
+- if (!sc) {
+- VOS_TRACE(VOS_MODULE_ID_HIF, VOS_TRACE_LEVEL_ERROR,
+- "Global SDIO context is NULL");
+- return A_ERROR;
+- }
+-
+ athdiag_procfs_remove();
+
+ #ifndef TARGET_DUMP_FOR_NON_QC_PLATFORM
+diff --git a/CORE/SERVICES/HIF/sdio/linux/native_sdio/include/hif_internal.h b/CORE/SERVICES/HIF/sdio/linux/native_sdio/include/hif_internal.h
+index 382e38c..234bc09 100644
+--- a/CORE/SERVICES/HIF/sdio/linux/native_sdio/include/hif_internal.h
++++ b/CORE/SERVICES/HIF/sdio/linux/native_sdio/include/hif_internal.h
+@@ -112,7 +112,7 @@ struct hif_device {
+ A_BOOL swap_mailbox;
+ };
+
+-#define HIF_DMA_BUFFER_SIZE (4 * 1024)
++#define HIF_DMA_BUFFER_SIZE (56 * 1024)
+ #define CMD53_FIXED_ADDRESS 1
+ #define CMD53_INCR_ADDRESS 2
+
+diff --git a/CORE/SERVICES/HIF/sdio/linux/native_sdio/src/hif.c b/CORE/SERVICES/HIF/sdio/linux/native_sdio/src/hif.c
+index d45ebd9..9fb1057 100644
+--- a/CORE/SERVICES/HIF/sdio/linux/native_sdio/src/hif.c
++++ b/CORE/SERVICES/HIF/sdio/linux/native_sdio/src/hif.c
+@@ -64,7 +64,8 @@
+ ((request->request & HIF_WRITE)&& \
+ (request->address >= 0x1000 && request->address < 0x1FFFF))
+ #endif
+-unsigned int mmcbusmode = 0;
++//unsigned int mmcbusmode = 0;
++unsigned int mmcbusmode = 5;
+ module_param(mmcbusmode, uint, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
+ MODULE_PARM_DESC(mmcbusmode, "Set MMC driver Bus Mode: 1-SDR12, 2-SDR25, 3-SDR50, 4-DDR50, 5-SDR104");
+ EXPORT_SYMBOL(mmcbusmode);
+@@ -74,7 +75,9 @@ module_param(mmcbuswidth, uint, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
+ MODULE_PARM_DESC(mmcbuswidth, "Set MMC driver Bus Width: 1-1Bit, 4-4Bit, 8-8Bit");
+ EXPORT_SYMBOL(mmcbuswidth);
+
+-unsigned int mmcclock = 0;
++//unsigned int mmcclock = 0;
++//unsigned int mmcclock = 166666666;
++unsigned int mmcclock = 200000000;
+ module_param(mmcclock, uint, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
+ MODULE_PARM_DESC(mmcclock, "Set MMC driver Clock value");
+ EXPORT_SYMBOL(mmcclock);
+@@ -95,7 +98,7 @@ unsigned int asyncintdelay = 2;
+ module_param(asyncintdelay, uint, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
+ MODULE_PARM_DESC(asyncintdelay, "Delay clock count for aysnc interrupt, 2 is default, vaild values are 1 and 2");
+ #else
+-unsigned int asyncintdelay = 0;
++unsigned int asyncintdelay = 2;
+ module_param(asyncintdelay, uint, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
+ MODULE_PARM_DESC(asyncintdelay, "Delay clock count for aysnc interrupt, 0 is default, vaild values are 1 and 2");
+ #endif
+@@ -412,12 +415,6 @@ __HIFReadWrite(HIF_DEVICE *device,
+ tbuffer = device->dma_buffer;
+ /* copy the write data to the dma buffer */
+ AR_DEBUG_ASSERT(length <= HIF_DMA_BUFFER_SIZE);
+- if (length > HIF_DMA_BUFFER_SIZE) {
+- AR_DEBUG_PRINTF(ATH_DEBUG_ERROR,
+- ("AR6000: Invalid write length: %d\n", length));
+- status = A_EINVAL;
+- break;
+- }
+ memcpy(tbuffer, buffer, length);
+ bounced = TRUE;
+ } else {
+@@ -440,12 +437,6 @@ __HIFReadWrite(HIF_DEVICE *device,
+ if (BUFFER_NEEDS_BOUNCE(buffer)) {
+ AR_DEBUG_ASSERT(device->dma_buffer != NULL);
+ AR_DEBUG_ASSERT(length <= HIF_DMA_BUFFER_SIZE);
+- if (length > HIF_DMA_BUFFER_SIZE) {
+- AR_DEBUG_PRINTF(ATH_DEBUG_ERROR,
+- ("AR6000: Invalid read length: %d\n", length));
+- status = A_EINVAL;
+- break;
+- }
+ tbuffer = device->dma_buffer;
+ bounced = TRUE;
+ } else {
+@@ -695,7 +686,7 @@ static int async_task(void *param)
+ complete_and_exit(&device->async_completion, 0);
+ return 0;
+ }
+-#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,32))
++#if 1
+ static A_INT32 IssueSDCommand(HIF_DEVICE *device, A_UINT32 opcode, A_UINT32 arg, A_UINT32 flags, A_UINT32 *resp)
+ {
+ struct mmc_command cmd;
+@@ -719,6 +710,7 @@ static A_INT32 IssueSDCommand(HIF_DEVICE *device, A_UINT32 opcode, A_UINT32 arg,
+ return err;
+ }
+ #endif
++//extern int sdio_reset_comm(struct mmc_card *card);
+ A_STATUS ReinitSDIO(HIF_DEVICE *device)
+ {
+ A_INT32 err = 0;
+@@ -733,10 +725,12 @@ A_STATUS ReinitSDIO(HIF_DEVICE *device)
+ host = card->host;
+
+ AR_DEBUG_PRINTF(ATH_DEBUG_TRACE, ("AR6000: +ReinitSDIO \n"));
++
++// err = sdio_reset_comm(card);
++#if 1
+ sdio_claim_host(func);
+
+ do {
+-#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,32))
+ /* 2.6.32 kernel does part of the SDIO initalization upon resume */
+ A_BOOL lt_2_6_32 = (LINUX_VERSION_CODEocr) {
+- /* Issue CMD5, arg = 0 */
+- err = IssueSDCommand(device, SD_IO_SEND_OP_COND, 0, (MMC_RSP_R4 | MMC_CMD_BCR), &resp);
+- if (err) {
+- AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("ReinitSDIO: CMD5 failed : %d \n",err));
+- break;
+- }
+- host->ocr = resp;
+- }
+
+ /* Issue CMD5, arg = ocr. Wait till card is ready */
+ for (i=0;i<100;i++) {
+- err = IssueSDCommand(device, SD_IO_SEND_OP_COND, host->ocr, (MMC_RSP_R4 | MMC_CMD_BCR), &resp);
++ err = IssueSDCommand(device, SD_IO_SEND_OP_COND, 0, (MMC_RSP_R4 | MMC_CMD_BCR), &resp);
+ if (err) {
+ AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("ReinitSDIO: CMD5 failed : %d \n",err));
+ break;
+@@ -828,7 +813,7 @@ A_STATUS ReinitSDIO(HIF_DEVICE *device)
+ break;
+ }
+ }
+-#endif
++
+ /* Enable high speed */
+ if (card->host->caps & MMC_CAP_SD_HIGHSPEED) {
+ AR_DEBUG_PRINTF(ATH_DEBUG_TRACE, ("ReinitSDIO: Set high speed mode\n"));
+@@ -891,7 +876,7 @@ A_STATUS ReinitSDIO(HIF_DEVICE *device)
+
+ sdio_release_host(func);
+ AR_DEBUG_PRINTF(ATH_DEBUG_TRACE, ("AR6000: -ReinitSDIO \n"));
+-
++#endif
+ return (err) ? A_ERROR : A_OK;
+ }
+
+@@ -1320,6 +1305,7 @@ static int hifDeviceInserted(struct sdio_func *func, const struct sdio_device_id
+ /*
+ TODO: MMC SDIO3.0 Setting should also be modified in ReInit() function when Power Manage work.
+ */
++#if 1
+ {
+ A_UINT32 clock, clock_set = 12500000;
+ #if LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0)
+@@ -1578,7 +1564,7 @@ TODO: MMC SDIO3.0 Setting should also be modified in ReInit() function when Powe
+
+ sdio_release_host(func);
+ }
+-
++#endif
+ spin_lock_init(&device->lock);
+
+ spin_lock_init(&device->asynclock);
+@@ -2070,12 +2056,10 @@ static int hifDeviceSuspend(struct device *dev)
+ return -1;
+ }
+ } else {
+- if (wma_suspend_target(temp_module, 0)) {
+- AR_DEBUG_PRINTF(ATH_DEBUG_ERROR, ("PDEV Suspend Failed\n"));
+- return -1;
+- }
++ if (wma_suspend_target(temp_module, 0)) {
++ printk(KERN_ERR "wma_suspend_target failed.\n");
++ }
+ }
+-
+ if (pm_flag & MMC_PM_WAKE_SDIO_IRQ){
+ AR_DEBUG_PRINTF(ATH_DEBUG_INFO, ("hifDeviceSuspend: wow enter\n"));
+ config = HIF_DEVICE_POWER_DOWN;
+@@ -2295,9 +2279,7 @@ static HIF_DEVICE *
+ addHifDevice(struct sdio_func *func)
+ {
+ HIF_DEVICE *hifdevice = NULL;
+-#if(LINUX_VERSION_CODE < KERNEL_VERSION(3,15,0)) && !defined(WITH_BACKPORTS)
+ int ret = 0;
+-#endif
+ ENTER();
+ AR_DEBUG_ASSERT(func != NULL);
+ hifdevice = (HIF_DEVICE *)A_MALLOC(sizeof(HIF_DEVICE));
+@@ -2310,13 +2292,9 @@ addHifDevice(struct sdio_func *func)
+ hifdevice->func = func;
+ hifdevice->powerConfig = HIF_DEVICE_POWER_UP;
+ hifdevice->DeviceState = HIF_DEVICE_STATE_ON;
+-#if(LINUX_VERSION_CODE < KERNEL_VERSION(3,15,0)) && !defined(WITH_BACKPORTS)
+ ret = sdio_set_drvdata(func, hifdevice);
++
+ EXIT("status %d", ret);
+-#else
+- sdio_set_drvdata(func, hifdevice);
+- EXIT();
+-#endif
+ return hifdevice;
+ }
+
+--
+2.7.4
+
diff --git a/packages/linux-drivers/amlogic/qca9377-aml/udev.d/99-qca9377-wireless.rules b/packages/linux-drivers/amlogic/qca9377-aml/udev.d/99-qca9377-wireless.rules
new file mode 100644
index 0000000000..3515891f51
--- /dev/null
+++ b/packages/linux-drivers/amlogic/qca9377-aml/udev.d/99-qca9377-wireless.rules
@@ -0,0 +1 @@
+ACTION=="add|change", SUBSYSTEM=="net", ENV{INTERFACE}=="wlan*", ATTRS{vendor}=="0x0271", RUN+="/usr/bin/systemctl restart connman.service"