diff -urN a/net/wireless/wext-compat.c b/net/wireless/wext-compat.c
--- a/net/wireless/wext-compat.c	2016-06-14 14:45:07.165166599 +0800
+++ b/net/wireless/wext-compat.c	2016-06-14 14:45:02.869166529 +0800
@@ -1523,9 +1523,66 @@
 	[IW_IOCTL_IDX(SIOCSIWENCODEEXT)]= (iw_handler) cfg80211_wext_siwencodeext,
 	[IW_IOCTL_IDX(SIOCSIWPMKSA)]	= (iw_handler) cfg80211_wext_siwpmksa,
 };
+//rtk added below
+#define RTL8192CD_IOCTL_SET_MIB                         (SIOCDEVPRIVATE + 0x1)  // 0x89f1
+#define RTL8192CD_IOCTL_GET_MIB                         (SIOCDEVPRIVATE + 0x2)  // 0x89f2
+#define RTL8192CD_IOCTL_WRITE_REG                               (SIOCDEVPRIVATE + 0x3)  // 0x89f3
+#define RTL8192CD_IOCTL_READ_REG                                (SIOCDEVPRIVATE + 0x4)  // 0x89f4
+#define RTL8192CD_IOCTL_WRITE_MEM                               (SIOCDEVPRIVATE + 0x5)  // 0x89f5
+#define RTL8192CD_IOCTL_READ_MEM                                (SIOCDEVPRIVATE + 0x6)  // 0x89f6
+#define RTL8192CD_IOCTL_DEL_STA                         (SIOCDEVPRIVATE + 0x7)  // 0x89f7
+#define RTL8192CD_IOCTL_WRITE_EEPROM                    (SIOCDEVPRIVATE + 0x8)  // 0x89f8
+#define RTL8192CD_IOCTL_READ_EEPROM                     (SIOCDEVPRIVATE + 0x9)  // 0x89f9
+#define RTL8192CD_IOCTL_WRITE_BB_REG                    (SIOCDEVPRIVATE + 0xa)  // 0x89fa
+#define RTL8192CD_IOCTL_READ_BB_REG                     (SIOCDEVPRIVATE + 0xb)  // 0x89fb
+#define RTL8192CD_IOCTL_WRITE_RF_REG                    (SIOCDEVPRIVATE + 0xc)  // 0x89fc
+#define RTL8192CD_IOCTL_READ_RF_REG                     (SIOCDEVPRIVATE + 0xd)  // 0x89fd
+
+
+#define SIOCGIWRTLREGDUMP               0x8B78
+
+struct iw_priv_args privtab[] = {
+        { RTL8192CD_IOCTL_SET_MIB, IW_PRIV_TYPE_CHAR | 450, 0, "set_mib" },
+        { RTL8192CD_IOCTL_GET_MIB, IW_PRIV_TYPE_CHAR | 40, IW_PRIV_TYPE_BYTE | 128, "get_mib" },
+#if 1
+        { RTL8192CD_IOCTL_WRITE_REG, IW_PRIV_TYPE_CHAR | 128, 0, "write_reg" },
+        { RTL8192CD_IOCTL_READ_REG, IW_PRIV_TYPE_CHAR | 128, IW_PRIV_TYPE_BYTE | 128, "read_reg" },
+        { RTL8192CD_IOCTL_WRITE_MEM, IW_PRIV_TYPE_CHAR | 128, 0, "write_mem" },
+        { RTL8192CD_IOCTL_READ_MEM, IW_PRIV_TYPE_CHAR | 128, IW_PRIV_TYPE_BYTE | 128, "read_mem" },
+        { RTL8192CD_IOCTL_WRITE_BB_REG, IW_PRIV_TYPE_CHAR | 128, 0, "write_bb" },
+        { RTL8192CD_IOCTL_READ_BB_REG, IW_PRIV_TYPE_CHAR | 128, IW_PRIV_TYPE_BYTE | 128, "read_bb" },
+        { RTL8192CD_IOCTL_WRITE_RF_REG, IW_PRIV_TYPE_CHAR | 128, 0, "write_rf" },
+        { RTL8192CD_IOCTL_READ_RF_REG, IW_PRIV_TYPE_CHAR | 128, IW_PRIV_TYPE_BYTE | 128, "read_rf" },
+#endif
+
+        { SIOCGIWRTLREGDUMP, IW_PRIV_TYPE_CHAR | 40, 0, "reg_dump" },
+#if 0
+        { RTL8192CD_IOCTL_DEL_STA, IW_PRIV_TYPE_CHAR | 128, 0, "del_sta" },
+        { RTL8192CD_IOCTL_WRITE_EEPROM, IW_PRIV_TYPE_CHAR | 128, 0, "write_eeprom" },
+        { RTL8192CD_IOCTL_READ_EEPROM, IW_PRIV_TYPE_CHAR | 128, IW_PRIV_TYPE_BYTE | 128, "read_eeprom" },
+        { SIOCSRFPWRADJ, IW_PRIV_TYPE_CHAR | 40, IW_PRIV_TYPE_CHAR | 128, "rf_pwr" },
+        { SIOCGIWRTLREGDUMP, IW_PRIV_TYPE_CHAR | 40, 0, "reg_dump" },
+        { SIOCRADIOOFF, IW_PRIV_TYPE_CHAR | 128, 0, "radio_off" },
+#ifdef EN_EFUSE
+        { SIOCEFUSE_GET, IW_PRIV_TYPE_CHAR | 128, IW_PRIV_TYPE_CHAR | 512, "efuse_get" },
+        { SIOCEFUSE_SET, IW_PRIV_TYPE_CHAR | 512, IW_PRIV_TYPE_CHAR | 128, "efuse_set" },
+        { SIOCEFUSE_SYNC, IW_PRIV_TYPE_CHAR | 128, IW_PRIV_TYPE_CHAR |  128, "efuse_sync" },
+#endif
+        { SIOC92DAUTOCH, IW_PRIV_TYPE_CHAR | 128, 0, "autoch" },
+#endif
+};
+
+static iw_handler rtl_private_handler[] =
+{
+        NULL, // return NULL to redirect to dev->ioctl
+};
 
 const struct iw_handler_def cfg80211_wext_handler = {
 	.num_standard		= ARRAY_SIZE(cfg80211_handlers),
 	.standard		= cfg80211_handlers,
 	.get_wireless_stats = cfg80211_wireless_stats,
+        .private = rtl_private_handler,
+        .private_args = (struct iw_priv_args *)privtab,
+        .num_private = sizeof(rtl_private_handler) / sizeof(iw_handler),
+        .num_private_args = sizeof(privtab) / sizeof(struct iw_priv_args)	
 };
