Search Linux Wireless

Re: rtl8723ae Weak Signal Problems

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 01/28/2013 07:53 PM, Dylan wrote:
Quick summary if you don't want to read my rambling:

  * Using the compat-drivers-3.8-rc5-1-u package
  * Using the rtl8723ae chipset and driver
  * Experiencing extremely weak signal
  * No clue what information I need to submit - I'm not having any clear
    crashes or anything, just a way-weaker-than-appropriate signal with
    a driver change being the only issue
  * Seems to have problems with Cisco access points (can't connect at
    all) but I'm not 100% certain

Strange that you see weaker signals with the kernel driver than with the vendor version. I get -56 dBm for the kernel, and -62 dBm for the vendor driver. I am using the code in the current wireless-testing git repo with some modifications that are currently under testing. Those changes will bring the kernel drivers up to the level of the 20130109 vendor driver.

If you want to compile the vendor driver under kernels 3.7 or 3.8, the necessary patches for rtl_92ce_92se_92de_8723ae_88ee_linux_mac80211_0010.0109.2013 are attached. The one named fix_build_3.9 is needed to handle the changes now in wireless-testing that will appear in mainline kernel 3.9; however, once the official version becomes 3.9, this file will need to be updated as the kernel version tests will then be wrong.

As to problems in connecting to the Cisco routers, I have no clue. I do not have access to a Cisco router with 802.11n capability. It might be helpful if you gave us the models for the routers that are involved. Perhaps some one else in the list will have had experience. Debugging this issue will probably come down to capturing the traffic in the air using wireshark, but we will forgo that step for now. In the meantime, please post the part of the dmesg output that shows the authentication/association sequence.

Larry

Index: rtl_92ce_92se_92de_8723ae_88ee_linux_mac80211_0010.0109.2013/base.c
===================================================================
--- rtl_92ce_92se_92de_8723ae_88ee_linux_mac80211_0010.0109.2013.orig/base.c
+++ rtl_92ce_92se_92de_8723ae_88ee_linux_mac80211_0010.0109.2013/base.c
@@ -1438,9 +1438,17 @@ int rtl_send_smps_action(struct ieee8021
 		/* rtlpriv->cfg->ops->update_rate_tbl(hw, sta, 0); */
 
 		info->control.rates[0].idx = 0;
-		info->control.sta = sta;
 		info->band = hw->conf.channel->band;
+/*<delete in kernel start>*/
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,7,0))
+ 		info->control.sta = sta;
 		rtlpriv->intf_ops->adapter_tx(hw, skb, &tcb_desc);
+#else
+/*<delete in kernel end>*/
+		rtlpriv->intf_ops->adapter_tx(hw, sta, skb, &tcb_desc);
+/*<delete in kernel start>*/
+#endif
+/*<delete in kernel end>*/
 	}
 	return 1;
 
Index: rtl_92ce_92se_92de_8723ae_88ee_linux_mac80211_0010.0109.2013/core.c
===================================================================
--- rtl_92ce_92se_92de_8723ae_88ee_linux_mac80211_0010.0109.2013.orig/core.c
+++ rtl_92ce_92se_92de_8723ae_88ee_linux_mac80211_0010.0109.2013/core.c
@@ -33,6 +33,10 @@
 #include "base.h"
 #include "ps.h"
 
+#ifndef IEEE80211_KEY_FLAG_SW_MGMT
+#define IEEE80211_KEY_FLAG_SW_MGMT IEEE80211_KEY_FLAG_SW_MGMT_TX
+#endif
+
 /*mutex for start & stop is must here. */
 static int rtl_op_start(struct ieee80211_hw *hw)
 {
@@ -112,8 +116,16 @@ err_free:
 	return NETDEV_TX_OK;
 }
 #else
-/*<delete in kernel end>*/
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,7,0))
 static void rtl_op_tx(struct ieee80211_hw *hw, struct sk_buff *skb)
+#else
+/*<delete in kernel end>*/
+static void rtl_op_tx(struct ieee80211_hw *hw,
+		      struct ieee80211_tx_control *control,
+		      struct sk_buff *skb)
+/*<delete in kernel start>*/
+#endif
+/*<delete in kernel end>*/
 {
 	struct rtl_priv *rtlpriv = rtl_priv(hw);
 	struct rtl_hal *rtlhal = rtl_hal(rtl_priv(hw));
@@ -127,9 +139,17 @@ static void rtl_op_tx(struct ieee80211_h
 	if (!test_bit(RTL_STATUS_INTERFACE_START, &rtlpriv->status))
 		goto err_free;
 
+/*<delete in kernel start>*/
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,7,0))
 	if (!rtlpriv->intf_ops->waitq_insert(hw, skb))
 		rtlpriv->intf_ops->adapter_tx(hw, skb, &tcb_desc);
-
+#else
+/*<delete in kernel end>*/
+	if (!rtlpriv->intf_ops->waitq_insert(hw, control->sta, skb))
+	        rtlpriv->intf_ops->adapter_tx(hw, control->sta, skb, &tcb_desc);
+/*<delete in kernel start>*/
+#endif
+/*<delete in kernel end>*/
 	return;
 
 err_free:
Index: rtl_92ce_92se_92de_8723ae_88ee_linux_mac80211_0010.0109.2013/pci.c
===================================================================
--- rtl_92ce_92se_92de_8723ae_88ee_linux_mac80211_0010.0109.2013.orig/pci.c
+++ rtl_92ce_92se_92de_8723ae_88ee_linux_mac80211_0010.0109.2013/pci.c
@@ -601,7 +601,14 @@ static void _rtl_pci_tx_chk_waitq(struct
 			if (info->flags & IEEE80211_TX_CTL_AMPDU)
 				_rtl_pci_update_earlymode_info(hw, skb, &tcb_desc, tid);
 
+/*<delete in kernel start>*/
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,7,0))
 			rtlpriv->intf_ops->adapter_tx(hw, skb, &tcb_desc);
+#else
+/*<delete in kernel end>*/
+			rtlpriv->intf_ops->adapter_tx(hw, NULL, skb, &tcb_desc);
+#endif
+/*<delete in kernel end>*/
 		}
 	}
 }
@@ -1064,8 +1071,17 @@ static void _rtl_pci_prepare_bcn_tasklet
 	hdr = rtl_get_hdr(pskb);
 	info = IEEE80211_SKB_CB(pskb);
 	pdesc = &ring->desc[0];
+/*<delete in kernel start>*/
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,7,0))
 	rtlpriv->cfg->ops->fill_tx_desc(hw, hdr, (u8 *) pdesc,
 		info, pskb, BEACON_QUEUE, &tcb_desc);
+#else
+/*<delete in kernel end>*/
+	rtlpriv->cfg->ops->fill_tx_desc(hw, hdr, (u8 *) pdesc,
+		info, NULL, pskb, BEACON_QUEUE, &tcb_desc);
+/*<delete in kernel start>*/
+#endif
+/*<delete in kernel end>*/
 
 	__skb_queue_tail(&ring->queue, pskb);
 
@@ -1373,11 +1389,25 @@ int rtl_pci_reset_trx_ring(struct ieee80
 	return 0;
 }
 
+/*<delete in kernel start>*/
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,7,0))
 static bool rtl_pci_tx_chk_waitq_insert(struct ieee80211_hw *hw, struct sk_buff *skb)
-{
+#else
+/*<delete in kernel end>*/
+static bool rtl_pci_tx_chk_waitq_insert(struct ieee80211_hw *hw,
+					struct ieee80211_sta *sta,
+					struct sk_buff *skb)
+{
+/*<delete in kernel start>*/
+#endif
+/*<delete in kernel end>*/
 	struct rtl_priv *rtlpriv = rtl_priv(hw);
+/*<delete in kernel start>*/
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,7,0))
 	struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb);
 	struct ieee80211_sta *sta = info->control.sta;
+#endif
+/*<delete in kernel end>*/
 	struct rtl_sta_info *sta_entry = NULL;
 	u8 tid = rtl_get_tid(skb);
 	u16 fc = rtl_get_fc(skb);
@@ -1414,13 +1444,28 @@ static bool rtl_pci_tx_chk_waitq_insert(
 	return true;
 }
 
+/*<delete in kernel start>*/
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,7,0))
 int rtl_pci_tx(struct ieee80211_hw *hw, struct sk_buff *skb,
 		struct rtl_tcb_desc *ptcb_desc)
+#else
+/*<delete in kernel end>*/
+static int rtl_pci_tx(struct ieee80211_hw *hw,
+		     struct ieee80211_sta *sta,
+		     struct sk_buff *skb,
+		     struct rtl_tcb_desc *ptcb_desc)
+/*<delete in kernel start>*/
+#endif
+/*<delete in kernel end>*/
 {
 	struct rtl_priv *rtlpriv = rtl_priv(hw);
 	struct rtl_sta_info *sta_entry = NULL;
 	struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb);
+/*<delete in kernel start>*/
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,7,0))
 	struct ieee80211_sta *sta = info->control.sta;
+#endif
+/*<delete in kernel end>*/
 	struct rtl8192_tx_ring *ring;
 	struct rtl_tx_desc *pdesc;
 	u8 idx;
@@ -1492,8 +1537,17 @@ int rtl_pci_tx(struct ieee80211_hw *hw,
 	if (ieee80211_is_data(fc))
 		rtlpriv->cfg->ops->led_control(hw, LED_CTL_TX);
 
+/*<delete in kernel start>*/
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,7,0))
 	rtlpriv->cfg->ops->fill_tx_desc(hw, hdr, (u8 *) pdesc,
 			info, skb, hw_queue, ptcb_desc);
+#else
+/*<delete in kernel end>*/
+	rtlpriv->cfg->ops->fill_tx_desc(hw, hdr, (u8 *) pdesc,
+			info, sta, skb, hw_queue, ptcb_desc);
+/*<delete in kernel start>*/
+#endif
+/*<delete in kernel end>*/
 
 	__skb_queue_tail(&ring->queue, skb);
 
Index: rtl_92ce_92se_92de_8723ae_88ee_linux_mac80211_0010.0109.2013/rtl8192ce/trx.c
===================================================================
--- rtl_92ce_92se_92de_8723ae_88ee_linux_mac80211_0010.0109.2013.orig/rtl8192ce/trx.c
+++ rtl_92ce_92se_92de_8723ae_88ee_linux_mac80211_0010.0109.2013/rtl8192ce/trx.c
@@ -511,17 +511,35 @@ bool rtl92ce_rx_query_desc(struct ieee80
 	return true;
 }
 
+/*<delete in kernel start>*/
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,7,0))
 void rtl92ce_tx_fill_desc(struct ieee80211_hw *hw,
 			  struct ieee80211_hdr *hdr, u8 *pdesc_tx,
 			  struct ieee80211_tx_info *info, struct sk_buff *skb,
 			  u8 hw_queue, struct rtl_tcb_desc *ptcb_desc)
 {
+#else
+/*<delete in kernel end>*/
+void rtl92ce_tx_fill_desc(struct ieee80211_hw *hw,
+			  struct ieee80211_hdr *hdr, u8 *pdesc_tx,
+			  struct ieee80211_tx_info *info,
+			  struct ieee80211_sta *sta,
+			  struct sk_buff *skb,
+			  u8 hw_queue, struct rtl_tcb_desc *ptcb_desc)
+/*<delete in kernel start>*/
+#endif
+/*<delete in kernel end>*/
+{
 	struct rtl_priv *rtlpriv = rtl_priv(hw);
 	struct rtl_mac *mac = rtl_mac(rtl_priv(hw));
 	struct rtl_pci *rtlpci = rtl_pcidev(rtl_pcipriv(hw));
 	struct rtl_ps_ctl *ppsc = rtl_psc(rtl_priv(hw));
 	bool b_defaultadapter = true;
+/*<delete in kernel start>*/
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,7,0))
 	struct ieee80211_sta *sta = info->control.sta;
+#endif
+/*<delete in kernel end>*/
 	u8 *pdesc = (u8 *) pdesc_tx;
 	u16 seq_number;
 	u16 fc = le16_to_cpu(hdr->frame_control);
Index: rtl_92ce_92se_92de_8723ae_88ee_linux_mac80211_0010.0109.2013/rtl8192ce/trx.h
===================================================================
--- rtl_92ce_92se_92de_8723ae_88ee_linux_mac80211_0010.0109.2013.orig/rtl8192ce/trx.h
+++ rtl_92ce_92se_92de_8723ae_88ee_linux_mac80211_0010.0109.2013/rtl8192ce/trx.h
@@ -700,6 +700,13 @@ struct rx_desc_92c {
 void rtl92ce_tx_fill_desc(struct ieee80211_hw *hw,
 			  struct ieee80211_hdr *hdr,
 			  u8 * pdesc, struct ieee80211_tx_info *info,
+/*<delete in kernel start>*/
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,7,0))
+/*<delete in kernel end>*/
+			  struct ieee80211_sta *sta,
+/*<delete in kernel start>*/
+#endif
+/*<delete in kernel end>*/
 			  struct sk_buff *skb, u8 hw_queue,
 			  struct rtl_tcb_desc *ptcb_desc);
 bool rtl92ce_rx_query_desc(struct ieee80211_hw *hw,
Index: rtl_92ce_92se_92de_8723ae_88ee_linux_mac80211_0010.0109.2013/rtl8192de/trx.c
===================================================================
--- rtl_92ce_92se_92de_8723ae_88ee_linux_mac80211_0010.0109.2013.orig/rtl8192de/trx.c
+++ rtl_92ce_92se_92de_8723ae_88ee_linux_mac80211_0010.0109.2013/rtl8192de/trx.c
@@ -467,17 +467,35 @@ static void _rtl92de_insert_emcontent(st
 	SET_EARLYMODE_LEN4(virtualaddress, ptcb_desc->empkt_len[4]);
 }
 
+/*<delete in kernel start>*/
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,7,0))
+void rtl92de_tx_fill_desc(struct ieee80211_hw *hw,
+			  struct ieee80211_hdr *hdr,
+			  u8 * pdesc, struct ieee80211_tx_info *info,
+			  struct sk_buff *skb, u8 hw_queue,
+			  struct rtl_tcb_desc *ptcb_desc)
+#else
+/*<delete in kernel end>*/
 void rtl92de_tx_fill_desc(struct ieee80211_hw *hw,
 			  struct ieee80211_hdr *hdr, u8 *pdesc_tx,
-			  struct ieee80211_tx_info *info, struct sk_buff *skb,
+			  struct ieee80211_tx_info *info,
+			  struct ieee80211_sta *sta,
+			  struct sk_buff *skb,
 			  u8 hw_queue, struct rtl_tcb_desc *ptcb_desc)
+/*<delete in kernel start>*/
+#endif
+/*<delete in kernel end>*/
 {
 	struct rtl_priv *rtlpriv = rtl_priv(hw);
 	struct rtl_mac *mac = rtl_mac(rtl_priv(hw));
 	struct rtl_pci *rtlpci = rtl_pcidev(rtl_pcipriv(hw));
 	struct rtl_hal *rtlhal = rtl_hal(rtlpriv);
 	struct rtl_ps_ctl *ppsc = rtl_psc(rtl_priv(hw));
+/*<delete in kernel start>*/
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,7,0))
 	struct ieee80211_sta *sta = info->control.sta;
+#endif
+/*<delete in kernel end>*/
 	u8 *pdesc = (u8 *) pdesc_tx;
 	u16 seq_number;
 	u16 fc = le16_to_cpu(hdr->frame_control);
Index: rtl_92ce_92se_92de_8723ae_88ee_linux_mac80211_0010.0109.2013/rtl8192de/trx.h
===================================================================
--- rtl_92ce_92se_92de_8723ae_88ee_linux_mac80211_0010.0109.2013.orig/rtl8192de/trx.h
+++ rtl_92ce_92se_92de_8723ae_88ee_linux_mac80211_0010.0109.2013/rtl8192de/trx.h
@@ -711,11 +711,24 @@ struct rx_desc_92d {
 
 } __packed;
 
+/*<delete in kernel start>*/
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,7,0))
 void rtl92de_tx_fill_desc(struct ieee80211_hw *hw,
 			  struct ieee80211_hdr *hdr,
 			  u8 * pdesc, struct ieee80211_tx_info *info,
 			  struct sk_buff *skb, u8 hw_queue,
 			  struct rtl_tcb_desc *ptcb_desc);
+#else
+/*<delete in kernel end>*/
+void rtl92de_tx_fill_desc(struct ieee80211_hw *hw,
+			  struct ieee80211_hdr *hdr, u8 *pdesc_tx,
+			  struct ieee80211_tx_info *info,
+			  struct ieee80211_sta *sta,
+			  struct sk_buff *skb,
+			  u8 hw_queue, struct rtl_tcb_desc *ptcb_desc);
+/*<delete in kernel start>*/
+#endif
+/*<delete in kernel end>*/
 bool rtl92de_rx_query_desc(struct ieee80211_hw *hw,
 			   struct rtl_stats *status,
 			   struct ieee80211_rx_status *rx_status,
Index: rtl_92ce_92se_92de_8723ae_88ee_linux_mac80211_0010.0109.2013/rtl8192se/trx.c
===================================================================
--- rtl_92ce_92se_92de_8723ae_88ee_linux_mac80211_0010.0109.2013.orig/rtl8192se/trx.c
+++ rtl_92ce_92se_92de_8723ae_88ee_linux_mac80211_0010.0109.2013/rtl8192se/trx.c
@@ -478,16 +478,30 @@ bool rtl92se_rx_query_desc(struct ieee80
 	return true;
 }
 
-void rtl92se_tx_fill_desc(struct ieee80211_hw *hw,
-		struct ieee80211_hdr *hdr, u8 *pdesc_tx,
-		struct ieee80211_tx_info *info, struct sk_buff *skb,
-		u8 hw_queue, struct rtl_tcb_desc *ptcb_desc)
+/*<delete in kernel start>*/
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,7,0))
+void rtl92se_tx_fill_desc(struct ieee80211_hw *hw, struct ieee80211_hdr *hdr,
+	u8 *pdesc_tx, struct ieee80211_tx_info *info, struct sk_buff* skb,
+	u8 hw_queue, struct rtl_tcb_desc *ptcb_desc)
+#else
+void rtl92se_tx_fill_desc(struct ieee80211_hw *hw, struct ieee80211_hdr *hdr,
+			  u8 *pdesc_tx, struct ieee80211_tx_info *info,
+			  struct ieee80211_sta *sta,
+			  struct sk_buff *skb, u8 hw_queue,
+			  struct rtl_tcb_desc *ptcb_desc)
+/*<delete in kernel start>*/
+#endif
+/*<delete in kernel end>*/
 {
 	struct rtl_priv *rtlpriv = rtl_priv(hw);
 	struct rtl_mac *mac = rtl_mac(rtl_priv(hw));
 	struct rtl_pci *rtlpci = rtl_pcidev(rtl_pcipriv(hw));
 	struct rtl_hal *rtlhal = rtl_hal(rtl_priv(hw));
+/*<delete in kernel start>*/
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,7,0))
 	struct ieee80211_sta *sta = info->control.sta;
+#endif
+/*<delete in kernel end>*/
 	u8 *pdesc = (u8 *) pdesc_tx;
 	u16 seq_number;
 	u16 fc = le16_to_cpu(hdr->frame_control);
Index: rtl_92ce_92se_92de_8723ae_88ee_linux_mac80211_0010.0109.2013/rtl8192se/trx.h
===================================================================
--- rtl_92ce_92se_92de_8723ae_88ee_linux_mac80211_0010.0109.2013.orig/rtl8192se/trx.h
+++ rtl_92ce_92se_92de_8723ae_88ee_linux_mac80211_0010.0109.2013/rtl8192se/trx.h
@@ -27,9 +27,20 @@
 #ifndef __REALTEK_PCI92SE_TRX_H__
 #define __REALTEK_PCI92SE_TRX_H__
 
+/*<delete in kernel start>*/
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,7,0))
 void rtl92se_tx_fill_desc(struct ieee80211_hw *hw, struct ieee80211_hdr *hdr,
 	u8 *pdesc, struct ieee80211_tx_info *info, struct sk_buff* skb,
 	u8 hw_queue, struct rtl_tcb_desc *ptcb_desc);
+#else
+void rtl92se_tx_fill_desc(struct ieee80211_hw *hw, struct ieee80211_hdr *hdr,
+			  u8 *pdesc, struct ieee80211_tx_info *info,
+			  struct ieee80211_sta *sta,
+			  struct sk_buff *skb, u8 hw_queue,
+			  struct rtl_tcb_desc *ptcb_desc);
+/*<delete in kernel start>*/
+#endif
+/*<delete in kernel end>*/
 void rtl92se_tx_fill_cmddesc(struct ieee80211_hw *hw, u8 *pdesc, bool b_firstseg,
 	bool b_lastseg, struct sk_buff *skb);
 bool rtl92se_rx_query_desc(struct ieee80211_hw *hw, struct rtl_stats *status,
Index: rtl_92ce_92se_92de_8723ae_88ee_linux_mac80211_0010.0109.2013/wifi.h
===================================================================
--- rtl_92ce_92se_92de_8723ae_88ee_linux_mac80211_0010.0109.2013.orig/wifi.h
+++ rtl_92ce_92se_92de_8723ae_88ee_linux_mac80211_0010.0109.2013/wifi.h
@@ -106,6 +106,9 @@
 #define	MAX_CHNL_GROUP_24G		6 
 #define	MAX_CHNL_GROUP_5G		14 
 
+#ifndef RX_FLAG_MACTIME_MPDU
+#define RX_FLAG_MACTIME_MPDU RX_FLAG_MACTIME_START
+#endif
 
 struct txpower_info_2g {
 	u8 index_cck_base[MAX_RF_PATH][MAX_CHNL_GROUP_24G];
@@ -1586,6 +1589,13 @@ struct rtl_hal_ops {
 	void (*fill_tx_desc) (struct ieee80211_hw * hw,
 			      struct ieee80211_hdr * hdr, u8 * pdesc_tx,
 			      struct ieee80211_tx_info * info,
+/*<delete in kernel start>*/
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,7,0))
+/*<delete in kernel end>*/
+			      struct ieee80211_sta *sta,
+/*<delete in kernel start>*/
+#endif
+/*<delete in kernel end>*/
 			      struct sk_buff * skb, u8 hw_queue,
 			      struct rtl_tcb_desc *ptcb_desc);
 	void (*fill_tx_cmddesc) (struct ieee80211_hw * hw, u8 * pdesc,
@@ -1637,11 +1647,32 @@ struct rtl_intf_ops {
 	bool (*check_buddy_priv)(struct ieee80211_hw *hw,
 			struct rtl_priv **buddy_priv);
 
+/*<delete in kernel start>*/
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,7,0))
 	int (*adapter_tx) (struct ieee80211_hw * hw, struct sk_buff * skb,
 			struct rtl_tcb_desc *ptcb_desc);
+#else
+/*<delete in kernel end>*/
+	int (*adapter_tx) (struct ieee80211_hw *hw,
+			   struct ieee80211_sta *sta,
+			   struct sk_buff *skb,
+			   struct rtl_tcb_desc *ptcb_desc);
+/*<delete in kernel start>*/
+#endif
+/*<delete in kernel end>*/
 	void (*flush)(struct ieee80211_hw *hw, bool drop);
 	int (*reset_trx_ring) (struct ieee80211_hw * hw);
+/*<delete in kernel start>*/
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,7,0))
 	bool (*waitq_insert) (struct ieee80211_hw *hw, struct sk_buff *skb);
+#else
+/*<delete in kernel end>*/
+	bool (*waitq_insert) (struct ieee80211_hw *hw,
+			      struct ieee80211_sta *sta,
+			      struct sk_buff *skb);
+/*<delete in kernel start>*/
+#endif
+/*<delete in kernel end>*/
 
 	/*pci */
 	void (*disable_aspm) (struct ieee80211_hw * hw);
Index: rtl_92ce_92se_92de_8723ae_88ee_linux_mac80211_0010.0109.2013/rtl8188ee/fw.c
===================================================================
--- rtl_92ce_92se_92de_8723ae_88ee_linux_mac80211_0010.0109.2013.orig/rtl8188ee/fw.c
+++ rtl_92ce_92se_92de_8723ae_88ee_linux_mac80211_0010.0109.2013/rtl8188ee/fw.c
@@ -228,7 +228,7 @@ int rtl88e_download_fw(struct ieee80211_
 		RT_TRACE(COMP_FW, DBG_DMESG,
 			 ("Firmware Version(%d), Signature(%#x),Size(%d)\n",
 			  pfwheader->version, pfwheader->signature,
-			  sizeof(struct rtl92c_firmware_header)));
+			  (int)sizeof(struct rtl92c_firmware_header)));
 
 		pfwdata = pfwdata + sizeof(struct rtl92c_firmware_header);
 		fwsize = fwsize - sizeof(struct rtl92c_firmware_header);
Index: rtl_92ce_92se_92de_8723ae_88ee_linux_mac80211_0010.0109.2013/rtl8188ee/trx.c
===================================================================
--- rtl_92ce_92se_92de_8723ae_88ee_linux_mac80211_0010.0109.2013.orig/rtl8188ee/trx.c
+++ rtl_92ce_92se_92de_8723ae_88ee_linux_mac80211_0010.0109.2013/rtl8188ee/trx.c
@@ -628,16 +628,33 @@ bool rtl88ee_rx_query_desc(struct ieee80
 	return true;
 }
 
+/*<delete in kernel start>*/
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,7,0))
 void rtl88ee_tx_fill_desc(struct ieee80211_hw *hw,
 			  struct ieee80211_hdr *hdr, u8 *pdesc_tx,
 			  struct ieee80211_tx_info *info, struct sk_buff *skb,
 			  u8 hw_queue, struct rtl_tcb_desc *ptcb_desc)
+#else
+/*<delete in kernel end>*/
+void rtl88ee_tx_fill_desc(struct ieee80211_hw *hw,
+			  struct ieee80211_hdr *hdr, u8 *pdesc_tx,
+			  struct ieee80211_tx_info *info,
+			  struct ieee80211_sta *sta,
+			  struct sk_buff *skb,
+			  u8 hw_queue, struct rtl_tcb_desc *ptcb_desc)
+/*<delete in kernel start>*/
+#endif
+/*<delete in kernel end>*/
 {
 	struct rtl_priv *rtlpriv = rtl_priv(hw);
 	struct rtl_mac *mac = rtl_mac(rtl_priv(hw));
 	struct rtl_pci *rtlpci = rtl_pcidev(rtl_pcipriv(hw));
 	struct rtl_hal *rtlhal = rtl_hal(rtlpriv);
+/*<delete in kernel start>*/
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,7,0))
 	struct ieee80211_sta *sta = info->control.sta;
+#endif
+/*<delete in kernel end>*/
 	u8 *pdesc = (u8 *) pdesc_tx;
 	u16 seq_number;
 	u16 fc = le16_to_cpu(hdr->frame_control);
Index: rtl_92ce_92se_92de_8723ae_88ee_linux_mac80211_0010.0109.2013/rtl8188ee/trx.h
===================================================================
--- rtl_92ce_92se_92de_8723ae_88ee_linux_mac80211_0010.0109.2013.orig/rtl8188ee/trx.h
+++ rtl_92ce_92se_92de_8723ae_88ee_linux_mac80211_0010.0109.2013/rtl8188ee/trx.h
@@ -779,11 +779,23 @@ struct rx_desc_88e {
 
 } __packed;
 
+/*<delete in kernel start>*/
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,7,0))
 void rtl88ee_tx_fill_desc(struct ieee80211_hw *hw,
-			  struct ieee80211_hdr *hdr,
-			  u8 * pdesc, struct ieee80211_tx_info *info,
-			  struct sk_buff *skb, u8 hw_queue,
-			  struct rtl_tcb_desc *ptcb_desc);
+			  struct ieee80211_hdr *hdr, u8 *pdesc_tx,
+			  struct ieee80211_tx_info *info, struct sk_buff *skb,
+			  u8 hw_queue, struct rtl_tcb_desc *ptcb_desc);
+#else
+/*<delete in kernel end>*/
+void rtl88ee_tx_fill_desc(struct ieee80211_hw *hw,
+			  struct ieee80211_hdr *hdr, u8 *pdesc_tx,
+			  struct ieee80211_tx_info *info,
+			  struct ieee80211_sta *sta,
+			  struct sk_buff *skb,
+			  u8 hw_queue, struct rtl_tcb_desc *ptcb_desc);
+/*<delete in kernel start>*/
+#endif
+/*<delete in kernel end>*/
 bool rtl88ee_rx_query_desc(struct ieee80211_hw *hw,
 			   struct rtl_stats *status,
 			   struct ieee80211_rx_status *rx_status,
Index: rtl_92ce_92se_92de_8723ae_88ee_linux_mac80211_0010.0109.2013/rtl8192ce/fw.c
===================================================================
--- rtl_92ce_92se_92de_8723ae_88ee_linux_mac80211_0010.0109.2013.orig/rtl8192ce/fw.c
+++ rtl_92ce_92se_92de_8723ae_88ee_linux_mac80211_0010.0109.2013/rtl8192ce/fw.c
@@ -239,7 +239,7 @@ int rtl92c_download_fw(struct ieee80211_
 		RT_TRACE(COMP_FW, DBG_DMESG,
 			 ("Firmware Version(%d), Signature(%#x),Size(%d)\n",
 			  pfwheader->version, pfwheader->signature,
-			  sizeof(struct rtl92c_firmware_header)));
+			  (int)sizeof(struct rtl92c_firmware_header)));
 
 		pfwdata = pfwdata + sizeof(struct rtl92c_firmware_header);
 		fwsize = fwsize - sizeof(struct rtl92c_firmware_header);
Index: rtl_92ce_92se_92de_8723ae_88ee_linux_mac80211_0010.0109.2013/rtl8192de/phy.c
===================================================================
--- rtl_92ce_92se_92de_8723ae_88ee_linux_mac80211_0010.0109.2013.orig/rtl8192de/phy.c
+++ rtl_92ce_92se_92de_8723ae_88ee_linux_mac80211_0010.0109.2013/rtl8192de/phy.c
@@ -3001,8 +3001,8 @@ void rtl92d_phy_reset_iqk_result(struct
 
 	RT_TRACE(COMP_INIT, DBG_LOUD,
 			("settings regs %d default regs %d\n",
-			sizeof(rtlphy->iqk_matrix_regsetting) /
-			sizeof(struct iqk_matrix_regs),
+			(int)(sizeof(rtlphy->iqk_matrix_regsetting) /
+			sizeof(struct iqk_matrix_regs)),
 			IQK_MATRIX_REG_NUM));
 	/* 0xe94, 0xe9c, 0xea4, 0xeac, 0xeb4, 0xebc, 0xec4, 0xecc */
 	for (i = 0; i < IQK_MATRIX_SETTINGS_NUM; i++) {
Index: rtl_92ce_92se_92de_8723ae_88ee_linux_mac80211_0010.0109.2013/rtl8723e/fw.c
===================================================================
--- rtl_92ce_92se_92de_8723ae_88ee_linux_mac80211_0010.0109.2013.orig/rtl8723e/fw.c
+++ rtl_92ce_92se_92de_8723ae_88ee_linux_mac80211_0010.0109.2013/rtl8723e/fw.c
@@ -204,7 +204,7 @@ int rtl8723e_download_fw(struct ieee8021
 		RT_TRACE(COMP_FW, DBG_DMESG,
 			 ("Firmware Version(%d), Signature(%#x),Size(%d)\n",
 			  pfwheader->version, pfwheader->signature,
-			  sizeof(struct rtl8723e_firmware_header)));
+			  (int)sizeof(struct rtl8723e_firmware_header)));
 
 		pfwdata = pfwdata + sizeof(struct rtl8723e_firmware_header);
 		fwsize = fwsize - sizeof(struct rtl8723e_firmware_header);
Index: rtl_92ce_92se_92de_8723ae_88ee_linux_mac80211_0010.0109.2013/rtl8723e/trx.c
===================================================================
--- rtl_92ce_92se_92de_8723ae_88ee_linux_mac80211_0010.0109.2013.orig/rtl8723e/trx.c
+++ rtl_92ce_92se_92de_8723ae_88ee_linux_mac80211_0010.0109.2013/rtl8723e/trx.c
@@ -510,10 +510,23 @@ bool rtl8723e_rx_query_desc(struct ieee8
 	return true;
 }
 
+/*<delete in kernel start>*/
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,7,0))
 void rtl8723e_tx_fill_desc(struct ieee80211_hw *hw,
 			  struct ieee80211_hdr *hdr, u8 *pdesc_tx,
 			  struct ieee80211_tx_info *info, struct sk_buff *skb,
 			  u8 hw_queue, struct rtl_tcb_desc *ptcb_desc)
+#else
+/*<delete in kernel end>*/
+void rtl8723e_tx_fill_desc(struct ieee80211_hw *hw,
+			  struct ieee80211_hdr *hdr, u8 *pdesc_tx,
+			  struct ieee80211_tx_info *info,
+			  struct ieee80211_sta *sta,
+			  struct sk_buff *skb,
+			  u8 hw_queue, struct rtl_tcb_desc *ptcb_desc)
+/*<delete in kernel start>*/
+#endif
+/*<delete in kernel end>*/
 {
 	struct rtl_priv *rtlpriv = rtl_priv(hw);
 	struct rtl_mac *mac = rtl_mac(rtl_priv(hw));
@@ -521,7 +534,11 @@ void rtl8723e_tx_fill_desc(struct ieee80
 	struct rtl_ps_ctl *ppsc = rtl_psc(rtl_priv(hw));
 	bool b_defaultadapter = true;
 //	bool b_trigger_ac = false;
+/*<delete in kernel start>*/
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,7,0))
 	struct ieee80211_sta *sta = info->control.sta;
+#endif
+/*<delete in kernel end>*/
 	u8 *pdesc = (u8 *) pdesc_tx;
 	u16 seq_number;
 	u16 fc = le16_to_cpu(hdr->frame_control);
Index: rtl_92ce_92se_92de_8723ae_88ee_linux_mac80211_0010.0109.2013/rtl8723e/trx.h
===================================================================
--- rtl_92ce_92se_92de_8723ae_88ee_linux_mac80211_0010.0109.2013.orig/rtl8723e/trx.h
+++ rtl_92ce_92se_92de_8723ae_88ee_linux_mac80211_0010.0109.2013/rtl8723e/trx.h
@@ -705,11 +705,24 @@ struct rx_desc_8723e {
 
 } __packed;
 
+/*<delete in kernel start>*/
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,7,0))
 void rtl8723e_tx_fill_desc(struct ieee80211_hw *hw,
 			  struct ieee80211_hdr *hdr,
 			  u8 * pdesc, struct ieee80211_tx_info *info,
 			  struct sk_buff *skb, u8 hw_queue,
 			  struct rtl_tcb_desc *ptcb_desc);
+#else
+/*<delete in kernel end>*/
+void rtl8723e_tx_fill_desc(struct ieee80211_hw *hw,
+			  struct ieee80211_hdr *hdr,
+			  u8 *pdesc, struct ieee80211_tx_info *info,
+			  struct ieee80211_sta *sta,
+			  struct sk_buff *skb, u8 hw_queue,
+			  struct rtl_tcb_desc *ptcb_desc);
+/*<delete in kernel start>*/
+#endif
+/*<delete in kernel end>*/
 bool rtl8723e_rx_query_desc(struct ieee80211_hw *hw,
 			   struct rtl_stats *status,
 			   struct ieee80211_rx_status *rx_status,
Index: rtl_92ce_92se_92de_8723ae_88ee_linux_mac80211_0010.0109.2013/rtl8723e/trx.c
===================================================================
--- rtl_92ce_92se_92de_8723ae_88ee_linux_mac80211_0010.0109.2013.orig/rtl8723e/trx.c
+++ rtl_92ce_92se_92de_8723ae_88ee_linux_mac80211_0010.0109.2013/rtl8723e/trx.c
@@ -554,6 +554,11 @@ void rtl8723e_tx_fill_desc(struct ieee80
 					    PCI_DMA_TODEVICE);
 	u8 bw_40 = 0;
 
+	if (pci_dma_mapping_error(rtlpci->pdev, mapping)) {
+		RT_TRACE(COMP_SEND, DBG_TRACE,
+			 ("DMA mapping error"));
+		return;
+	}
 	if (mac->opmode == NL80211_IFTYPE_STATION) {
 		bw_40 = mac->bw_40;
 	} else if (mac->opmode == NL80211_IFTYPE_AP ||
@@ -733,6 +738,11 @@ void rtl8723e_tx_fill_cmddesc(struct iee
 	struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)(skb->data);
 	u16 fc = le16_to_cpu(hdr->frame_control);
 
+	if (pci_dma_mapping_error(rtlpci->pdev, mapping)) {
+		RT_TRACE(COMP_SEND, DBG_TRACE,
+			 ("DMA mapping error"));
+		return;
+	}
 	CLEAR_PCI_TX_DESC_CONTENT(pdesc, TX_DESC_SIZE);
 
 	if (b_firstseg)
Index: rtl_92ce_92se_92de_8723ae_88ee_linux_mac80211_0010.0109.2013/rtl8192se/trx.c
===================================================================
--- rtl_92ce_92se_92de_8723ae_88ee_linux_mac80211_0010.0109.2013.orig/rtl8192se/trx.c
+++ rtl_92ce_92se_92de_8723ae_88ee_linux_mac80211_0010.0109.2013/rtl8192se/trx.c
@@ -514,6 +514,11 @@ void rtl92se_tx_fill_desc(struct ieee802
 		    PCI_DMA_TODEVICE);
 	u8 bw_40 = 0;
 
+	if (pci_dma_mapping_error(rtlpci->pdev, mapping)) {
+		RT_TRACE(COMP_SEND, DBG_TRACE,
+			 ("DMA mapping error"));
+		return;
+	}
 	if (mac->opmode == NL80211_IFTYPE_STATION) {
 		bw_40 = mac->bw_40;
 	} else if (mac->opmode == NL80211_IFTYPE_AP ||
@@ -690,6 +695,7 @@ void rtl92se_tx_fill_desc(struct ieee802
 void rtl92se_tx_fill_cmddesc(struct ieee80211_hw *hw, u8 *pdesc,
 	bool b_firstseg, bool b_lastseg, struct sk_buff *skb)
 {
+	struct rtl_priv *rtlpriv = rtl_priv(hw);
 	struct rtl_pci *rtlpci = rtl_pcidev(rtl_pcipriv(hw));
 	struct rtl_hal *rtlhal = rtl_hal(rtl_priv(hw));
 	struct rtl_tcb_desc *tcb_desc = (struct rtl_tcb_desc *)(skb->cb);
@@ -697,7 +703,12 @@ void rtl92se_tx_fill_cmddesc(struct ieee
 	dma_addr_t mapping = pci_map_single(rtlpci->pdev, skb->data, skb->len,
 			PCI_DMA_TODEVICE);
 
-    /* Clear all status	*/
+	if (pci_dma_mapping_error(rtlpci->pdev, mapping)) {
+		RT_TRACE(COMP_SEND, DBG_TRACE,
+			 ("DMA mapping error"));
+		return;
+	}
+	/* Clear all status	*/
 	CLEAR_PCI_TX_DESC_CONTENT(pdesc, TX_CMDDESC_SIZE_RTL8192S);
 
 	/* This bit indicate this packet is used for FW download. */
Index: rtl_92ce_92se_92de_8723ae_88ee_linux_mac80211_0010.0109.2013/rtl8192de/trx.c
===================================================================
--- rtl_92ce_92se_92de_8723ae_88ee_linux_mac80211_0010.0109.2013.orig/rtl8192de/trx.c
+++ rtl_92ce_92se_92de_8723ae_88ee_linux_mac80211_0010.0109.2013/rtl8192de/trx.c
@@ -526,6 +526,11 @@ void rtl92de_tx_fill_desc(struct ieee802
 	buf_len = skb->len;
 	mapping = pci_map_single(rtlpci->pdev, skb->data, skb->len,
 				 PCI_DMA_TODEVICE);
+	if (pci_dma_mapping_error(rtlpci->pdev, mapping)) {
+		RT_TRACE(COMP_SEND, DBG_TRACE,
+			 ("DMA mapping error"));
+		return;
+	}
 	CLEAR_PCI_TX_DESC_CONTENT(pdesc, sizeof(struct tx_desc_92d));
 	if (ieee80211_is_nullfunc(fc) || ieee80211_is_ctl(fc)) {
 		b_firstseg = true;
@@ -699,6 +704,11 @@ void rtl92de_tx_fill_cmddesc(struct ieee
 	struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)(skb->data);
 	u16 fc = le16_to_cpu(hdr->frame_control);
 
+	if (pci_dma_mapping_error(rtlpci->pdev, mapping)) {
+		RT_TRACE(COMP_SEND, DBG_TRACE,
+			 ("DMA mapping error"));
+		return;
+	}
 	CLEAR_PCI_TX_DESC_CONTENT(pdesc, TX_DESC_SIZE);
 	if (b_firstseg)
 		SET_TX_DESC_OFFSET(pdesc, USB_HWDESC_HEADER_LEN);
Index: rtl_92ce_92se_92de_8723ae_88ee_linux_mac80211_0010.0109.2013/rtl8192ce/trx.c
===================================================================
--- rtl_92ce_92se_92de_8723ae_88ee_linux_mac80211_0010.0109.2013.orig/rtl8192ce/trx.c
+++ rtl_92ce_92se_92de_8723ae_88ee_linux_mac80211_0010.0109.2013/rtl8192ce/trx.c
@@ -553,8 +553,14 @@ void rtl92ce_tx_fill_desc(struct ieee802
 	dma_addr_t mapping = pci_map_single(rtlpci->pdev,
 					    skb->data, skb->len,
 					    PCI_DMA_TODEVICE);
+
 	u8 bw_40 = 0;
 
+	if (pci_dma_mapping_error(rtlpci->pdev, mapping)) {
+		RT_TRACE(COMP_SEND, DBG_TRACE,
+			 ("DMA mapping error"));
+		return;
+	}
 	if (mac->opmode == NL80211_IFTYPE_STATION) {
 		bw_40 = mac->bw_40;
 	} else if (mac->opmode == NL80211_IFTYPE_AP ||
@@ -733,6 +739,11 @@ void rtl92ce_tx_fill_cmddesc(struct ieee
 	struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)(skb->data);
 	u16 fc = le16_to_cpu(hdr->frame_control);
 
+	if (pci_dma_mapping_error(rtlpci->pdev, mapping)) {
+		RT_TRACE(COMP_SEND, DBG_TRACE,
+			 ("DMA mapping error"));
+		return;
+	}
 	CLEAR_PCI_TX_DESC_CONTENT(pdesc, TX_DESC_SIZE);
 
 	if (b_firstseg)
Index: rtl_92ce_92se_92de_8723ae_88ee_linux_mac80211_0010.0109.2013/pci.c
===================================================================
--- rtl_92ce_92se_92de_8723ae_88ee_linux_mac80211_0010.0109.2013.orig/pci.c
+++ rtl_92ce_92se_92de_8723ae_88ee_linux_mac80211_0010.0109.2013/pci.c
@@ -742,6 +742,8 @@ static int _rtl_pci_init_one_rxdesc(stru
 				skb_tail_pointer(skb), rtlpci->rxbuffersize,
 				PCI_DMA_FROMDEVICE);
 	bufferaddress = cpu_to_le32(*((dma_addr_t *) skb->cb));
+	if (pci_dma_mapping_error(rtlpci->pdev, bufferaddress))
+		return 0;
 	
 	rtlpriv->cfg->ops->set_desc((u8 *) entry, false, HW_DESC_RXBUFF_ADDR,
 				    (u8 *) & bufferaddress);
Index: rtl_92ce_92se_92de_8723ae_88ee_linux_mac80211_0010.0109.2013/rtl8188ee/trx.c
===================================================================
--- rtl_92ce_92se_92de_8723ae_88ee_linux_mac80211_0010.0109.2013.orig/rtl8188ee/trx.c
+++ rtl_92ce_92se_92de_8723ae_88ee_linux_mac80211_0010.0109.2013/rtl8188ee/trx.c
@@ -686,6 +686,11 @@ void rtl88ee_tx_fill_desc(struct ieee802
 	buf_len = skb->len;
 	mapping = pci_map_single(rtlpci->pdev, skb->data, skb->len,
 				 PCI_DMA_TODEVICE);
+	if (pci_dma_mapping_error(rtlpci->pdev, mapping)) {
+		RT_TRACE(COMP_SEND, DBG_TRACE,
+			 ("DMA mapping error"));
+		return;
+	}
 	CLEAR_PCI_TX_DESC_CONTENT(pdesc, sizeof(struct tx_desc_88e));
 	if (ieee80211_is_nullfunc(fc) || ieee80211_is_ctl(fc)) {
 		b_firstseg = true;
@@ -858,6 +863,11 @@ void rtl88ee_tx_fill_cmddesc(struct ieee
 	struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)(skb->data);
 	u16 fc = le16_to_cpu(hdr->frame_control);
 
+	if (pci_dma_mapping_error(rtlpci->pdev, mapping)) {
+		RT_TRACE(COMP_SEND, DBG_TRACE,
+			 ("DMA mapping error"));
+		return;
+	}
 	CLEAR_PCI_TX_DESC_CONTENT(pdesc, TX_DESC_SIZE);
 
 	if (b_firstseg)
Index: rtl_92ce_92se_92de_8723ae_88ee_linux_mac80211_0010.0109.2013/core.c
===================================================================
--- rtl_92ce_92se_92de_8723ae_88ee_linux_mac80211_0010.0109.2013.orig/core.c
+++ rtl_92ce_92se_92de_8723ae_88ee_linux_mac80211_0010.0109.2013/core.c
@@ -1004,7 +1004,13 @@ static int rtl_op_ampdu_action(struct ie
 			 ("IEEE80211_AMPDU_TX_START: TID:%d\n", tid));
 		return rtl_tx_agg_start(hw, vif, sta, tid, ssn);
 		break;
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,8,0))
 	case IEEE80211_AMPDU_TX_STOP:
+#else
+	case IEEE80211_AMPDU_TX_STOP_CONT:
+	case IEEE80211_AMPDU_TX_STOP_FLUSH:
+	case IEEE80211_AMPDU_TX_STOP_FLUSH_CONT:
+#endif
 		RT_TRACE(COMP_MAC80211, DBG_TRACE,
 			 ("IEEE80211_AMPDU_TX_STOP: TID:%d\n", tid));
 		return rtl_tx_agg_stop(hw, vif, sta, tid);
Index: rtl_92ce_92se_92de_8723ae_88ee_linux_mac80211_0010.0109.2013/regd.c
===================================================================
--- rtl_92ce_92se_92de_8723ae_88ee_linux_mac80211_0010.0109.2013.orig/regd.c
+++ rtl_92ce_92se_92de_8723ae_88ee_linux_mac80211_0010.0109.2013/regd.c
@@ -158,8 +158,6 @@ static void _rtl_reg_apply_beaconing_fla
 	const struct ieee80211_reg_rule *reg_rule;
 	struct ieee80211_channel *ch;
 	unsigned int i;
-	u32 bandwidth = 0;
-	int r;
 
 	for (band = 0; band < IEEE80211_NUM_BANDS; band++) {
 
@@ -174,9 +172,20 @@ static void _rtl_reg_apply_beaconing_fla
 			    (ch->flags & IEEE80211_CHAN_RADAR))
 				continue;
 			if (initiator == NL80211_REGDOM_SET_BY_COUNTRY_IE) {
+/*<delete in kernel start>*/
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,8,0))
+				int r;
+				u32 bandwidth = 0;
 				r = freq_reg_info(wiphy, ch->center_freq,
 						  bandwidth, &reg_rule);
 				if (r)
+#else
+/*<delete in kernel end>*/
+				reg_rule = freq_reg_info(wiphy, ch->center_freq);
+				if (IS_ERR(reg_rule))
+/*<delete in kernel start>*/
+#endif
+/*<delete in kernel end>*/
 					continue;
 
 				/*
@@ -210,8 +219,12 @@ static void _rtl_reg_apply_active_scan_f
 	struct ieee80211_supported_band *sband;
 	struct ieee80211_channel *ch;
 	const struct ieee80211_reg_rule *reg_rule;
+/*<delete in kernel start>*/
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,8,0))
 	u32 bandwidth = 0;
 	int r;
+#endif
+/*<delete in kernel end>*/
 
 	if (!wiphy->bands[IEEE80211_BAND_2GHZ])
 		return;
@@ -239,16 +252,34 @@ static void _rtl_reg_apply_active_scan_f
 	 */
 
 	ch = &sband->channels[11];	/* CH 12 */
+/*<delete in kernel start>*/
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,8,0))
 	r = freq_reg_info(wiphy, ch->center_freq, bandwidth, &reg_rule);
 	if (!r) {
+#else
+/*<delete in kernel end>*/
+	reg_rule = freq_reg_info(wiphy, ch->center_freq);
+	if (!IS_ERR(reg_rule)) {
+/*<delete in kernel start>*/
+#endif
+/*<delete in kernel end>*/
 		if (!(reg_rule->flags & NL80211_RRF_PASSIVE_SCAN))
 			if (ch->flags & IEEE80211_CHAN_PASSIVE_SCAN)
 				ch->flags &= ~IEEE80211_CHAN_PASSIVE_SCAN;
 	}
 
 	ch = &sband->channels[12];	/* CH 13 */
+/*<delete in kernel start>*/
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,8,0))
 	r = freq_reg_info(wiphy, ch->center_freq, bandwidth, &reg_rule);
 	if (!r) {
+#else
+/*<delete in kernel end>*/
+	reg_rule = freq_reg_info(wiphy, ch->center_freq);
+	if (!IS_ERR(reg_rule)) {
+/*<delete in kernel start>*/
+#endif
+/*<delete in kernel end>*/
 		if (!(reg_rule->flags & NL80211_RRF_PASSIVE_SCAN))
 			if (ch->flags & IEEE80211_CHAN_PASSIVE_SCAN)
 				ch->flags &= ~IEEE80211_CHAN_PASSIVE_SCAN;
Index: rtl_92ce_92se_92de_8723ae_88ee_linux_mac80211_0010.0109.2013/pci.c
===================================================================
--- rtl_92ce_92se_92de_8723ae_88ee_linux_mac80211_0010.0109.2013.orig/pci.c
+++ rtl_92ce_92se_92de_8723ae_88ee_linux_mac80211_0010.0109.2013/pci.c
@@ -1896,8 +1896,8 @@ static bool _rtl_pci_find_adapter(struct
  * hw pointer in rtl_pci_get_hw_pointer */
 struct ieee80211_hw *hw_export = NULL;
 
-int __devinit rtl_pci_probe(struct pci_dev *pdev,
-			    const struct pci_device_id *id)
+int rtl_pci_probe(struct pci_dev *pdev,
+		  const struct pci_device_id *id)
 {
 	struct ieee80211_hw *hw = NULL;
 
Index: rtl_92ce_92se_92de_8723ae_88ee_linux_mac80211_0010.0109.2013/pci.h
===================================================================
--- rtl_92ce_92se_92de_8723ae_88ee_linux_mac80211_0010.0109.2013.orig/pci.h
+++ rtl_92ce_92se_92de_8723ae_88ee_linux_mac80211_0010.0109.2013/pci.h
@@ -244,8 +244,8 @@ int rtl_pci_reset_trx_ring(struct ieee80
 
 extern struct rtl_intf_ops rtl_pci_ops;
 
-int __devinit rtl_pci_probe(struct pci_dev *pdev,
-			    const struct pci_device_id *id);
+int rtl_pci_probe(struct pci_dev *pdev,
+	    const struct pci_device_id *id);
 void rtl_pci_disconnect(struct pci_dev *pdev);
 int rtl_pci_suspend(struct device *dev);
 int rtl_pci_resume(struct device *dev);
Index: rtl_92ce_92se_92de_8723ae_88ee_linux_mac80211_0010.0109.2013/rtl8188ee/sw.c
===================================================================
--- rtl_92ce_92se_92de_8723ae_88ee_linux_mac80211_0010.0109.2013.orig/rtl8188ee/sw.c
+++ rtl_92ce_92se_92de_8723ae_88ee_linux_mac80211_0010.0109.2013/rtl8188ee/sw.c
@@ -369,7 +369,7 @@ struct rtl_hal_cfg rtl88ee_hal_cfg = {
 	.maps[RTL_RC_HT_RATEMCS15] = DESC92C_RATEMCS15,
 };
 
-static struct pci_device_id rtl88ee_pci_ids[] __devinitdata = {
+static struct pci_device_id rtl88ee_pci_ids[] = {
 	{RTL_PCI_DEVICE(PCI_VENDOR_ID_REALTEK, 0x8179, rtl88ee_hal_cfg)},
 	{},
 };
Index: rtl_92ce_92se_92de_8723ae_88ee_linux_mac80211_0010.0109.2013/rtl8192ce/sw.c
===================================================================
--- rtl_92ce_92se_92de_8723ae_88ee_linux_mac80211_0010.0109.2013.orig/rtl8192ce/sw.c
+++ rtl_92ce_92se_92de_8723ae_88ee_linux_mac80211_0010.0109.2013/rtl8192ce/sw.c
@@ -336,7 +336,7 @@ struct rtl_hal_cfg rtl92ce_hal_cfg = {
 	.maps[RTL_RC_HT_RATEMCS15] = DESC92C_RATEMCS15,
 };
 
-static struct pci_device_id rtl92ce_pci_ids[] __devinitdata = {
+static struct pci_device_id rtl92ce_pci_ids[] = {
 	{RTL_PCI_DEVICE(PCI_VENDOR_ID_REALTEK, 0x8191, rtl92ce_hal_cfg)},
 	{RTL_PCI_DEVICE(PCI_VENDOR_ID_REALTEK, 0x8178, rtl92ce_hal_cfg)},
 	{RTL_PCI_DEVICE(PCI_VENDOR_ID_REALTEK, 0x8177, rtl92ce_hal_cfg)},
Index: rtl_92ce_92se_92de_8723ae_88ee_linux_mac80211_0010.0109.2013/rtl8192de/sw.c
===================================================================
--- rtl_92ce_92se_92de_8723ae_88ee_linux_mac80211_0010.0109.2013.orig/rtl8192de/sw.c
+++ rtl_92ce_92se_92de_8723ae_88ee_linux_mac80211_0010.0109.2013/rtl8192de/sw.c
@@ -188,7 +188,7 @@ int rtl92d_init_sw_vars(struct ieee80211
 	release_firmware(firmware);
 
 	/* for early mode */
-	rtlpriv->rtlhal.b_earlymode_eanble = true;
+	rtlpriv->rtlhal.b_earlymode_eanble = false;
 	rtlpriv->rtlhal.max_earlymode_num = 5;
 	for (tid = 0; tid < 8; tid++)
 		skb_queue_head_init(&rtlpriv->mac80211.skb_waitq[tid]);
@@ -356,7 +356,7 @@ struct rtl_hal_cfg rtl92de_hal_cfg = {
 	.maps[RTL_RC_HT_RATEMCS15] = DESC92D_RATEMCS15,
 };
 
-struct pci_device_id rtl92de_pci_ids[] __devinitdata = {
+struct pci_device_id rtl92de_pci_ids[] = {
 	{RTL_PCI_DEVICE(PCI_VENDOR_ID_REALTEK, 0x8193, rtl92de_hal_cfg)},
 	{RTL_PCI_DEVICE(PCI_VENDOR_ID_REALTEK, 0x002B, rtl92de_hal_cfg)},
 	{},
@@ -412,13 +412,13 @@ static int __init rtl92de_module_init(vo
 {
 	int ret = 0;
 
+	spin_lock_init(&globalmutex_for_poweron_and_poweroff);
+	spin_lock_init(&globalmutex_for_fwdownload);
+	spin_lock_init(&globalmutex_for_power_and_efuse);
 	ret = pci_register_driver(&rtl92de_driver);
 	if (ret)
 		RT_ASSERT(false, (": No device found\n"));
 
-	spin_lock_init(&globalmutex_for_poweron_and_poweroff);
-	spin_lock_init(&globalmutex_for_fwdownload);
-	spin_lock_init(&globalmutex_for_power_and_efuse);
 	return ret;
 }
 
Index: rtl_92ce_92se_92de_8723ae_88ee_linux_mac80211_0010.0109.2013/rtl8192se/sw.c
===================================================================
--- rtl_92ce_92se_92de_8723ae_88ee_linux_mac80211_0010.0109.2013.orig/rtl8192se/sw.c
+++ rtl_92ce_92se_92de_8723ae_88ee_linux_mac80211_0010.0109.2013/rtl8192se/sw.c
@@ -363,7 +363,7 @@ struct rtl_hal_cfg rtl92se_hal_cfg = {
 	.maps[RTL_RC_HT_RATEMCS15] = DESC92S_RATEMCS15,
 };
 
-struct pci_device_id rtl92se_pci_ids[] __devinitdata = {
+struct pci_device_id rtl92se_pci_ids[] = {
 	{RTL_PCI_DEVICE(PCI_VENDOR_ID_REALTEK, 0x8192, rtl92se_hal_cfg)},
 	{RTL_PCI_DEVICE(PCI_VENDOR_ID_REALTEK, 0x8171, rtl92se_hal_cfg)},
 	{RTL_PCI_DEVICE(PCI_VENDOR_ID_REALTEK, 0x8172, rtl92se_hal_cfg)},
Index: rtl_92ce_92se_92de_8723ae_88ee_linux_mac80211_0010.0109.2013/rtl8723e/sw.c
===================================================================
--- rtl_92ce_92se_92de_8723ae_88ee_linux_mac80211_0010.0109.2013.orig/rtl8723e/sw.c
+++ rtl_92ce_92se_92de_8723ae_88ee_linux_mac80211_0010.0109.2013/rtl8723e/sw.c
@@ -356,7 +356,7 @@ struct rtl_hal_cfg rtl8723e_hal_cfg = {
 	.maps[RTL_RC_HT_RATEMCS15] = DESC92C_RATEMCS15,
 };
 
-static struct pci_device_id rtl8723e_pci_ids[] __devinitdata = {
+static struct pci_device_id rtl8723e_pci_ids[] = {
 	{RTL_PCI_DEVICE(PCI_VENDOR_ID_REALTEK, 0x8723, rtl8723e_hal_cfg)},
 	{},
 };

[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Wireless Personal Area Network]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Hiking]     [MIPS Linux]     [ARM Linux]     [Linux RAID]

  Powered by Linux