diff mbox

rtl8723ae Weak Signal Problems

Message ID 51080904.5000103@lwfinger.net (mailing list archive)
State Not Applicable, archived
Headers show

Commit Message

Larry Finger Jan. 29, 2013, 5:38 p.m. UTC
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/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)},
 	{},
 };

Comments

Larry Finger Jan. 30, 2013, 8:30 p.m. UTC | #1
On 01/30/2013 11:54 AM, Dylan wrote:

Please do not drop the Cc to wireless.

> I apologize for the late response and limited information.
>
> The patch doesn't work for me - same problems as before, i.e. the patch doesn't
> seem to have changed anything. I attached a log. I expect you can make more
> sense of it than I.
>
> I can give you the model number of only one of the router/access points - the
> Cisco DPC3825 which I have. Unfortunately I can't offer much analysis of it as
> it's in modem only mode now and it's not very practical to reactivate it as an
> access point at this time. I could try to find out what my school is using as well.
>
> I've noticed that with the compat wireless drivers I'm ALSO experiencing similar
> problems with an RTL8188CU card. I expect that's relevant. Funnily enough I have
> three wireless cards on hand and all of them are some form of Realtek card.

The vendor driver you are using, 
/rtl_92ce_92se_92de_8723ae_linux_mac80211_0006.0514.2012/, is relatively old. My 
patches were for rtl_92ce_92se_92de_8723ae_88ee_linux_mac80211_0010.0109.2013, 
however, since I wrote earlier, I found 
rtl_92ce_92se_92de_8723ae_88ee_linux_mac80211_0011.0128.2013, which you will 
find on the Realtek web site under the RTL8188CE listing for Linux. That one 
includes my feedback to Realtek about the 01092013 version, and it should build 
on mainline kernels through 3.8, but not the current wireless-testing, but I 
doubt that you are using that tree. With that driver, my RTL8723AE got 
throughput of 60-70 Mbps for both RX and TX. I did have an unexplained kernel 
panic while running that driver, thus there might be a severe bug in it. I don't 
know if it is rtl8723e, but that is the only panic that I have had with 3.8-rc4.

The driver for the RTL8188CU/RTL8192CU is a mess. Unfortunately, I am not 
getting musch help from Realtek. For that reason, I am concentrating on the CE 
models. Their PCIe group is more responsive.

Larry

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Dylan Feb. 4, 2013, 3:54 p.m. UTC | #2
On 01/30/2013 03:30 PM, Larry Finger wrote:
> On 01/30/2013 11:54 AM, Dylan wrote:
>
> Please do not drop the Cc to wireless.
>
>> I apologize for the late response and limited information.
>>
>> The patch doesn't work for me - same problems as before, i.e. the 
>> patch doesn't
>> seem to have changed anything. I attached a log. I expect you can 
>> make more
>> sense of it than I.
>>
>> I can give you the model number of only one of the router/access 
>> points - the
>> Cisco DPC3825 which I have. Unfortunately I can't offer much analysis 
>> of it as
>> it's in modem only mode now and it's not very practical to reactivate 
>> it as an
>> access point at this time. I could try to find out what my school is 
>> using as well.
>>
>> I've noticed that with the compat wireless drivers I'm ALSO 
>> experiencing similar
>> problems with an RTL8188CU card. I expect that's relevant. Funnily 
>> enough I have
>> three wireless cards on hand and all of them are some form of Realtek 
>> card.
>
> The vendor driver you are using, 
> /rtl_92ce_92se_92de_8723ae_linux_mac80211_0006.0514.2012/, is 
> relatively old. My patches were for 
> rtl_92ce_92se_92de_8723ae_88ee_linux_mac80211_0010.0109.2013, however, 
> since I wrote earlier, I found 
> rtl_92ce_92se_92de_8723ae_88ee_linux_mac80211_0011.0128.2013, which 
> you will find on the Realtek web site under the RTL8188CE listing for 
> Linux. That one includes my feedback to Realtek about the 01092013 
> version, and it should build on mainline kernels through 3.8, but not 
> the current wireless-testing, but I doubt that you are using that 
> tree. With that driver, my RTL8723AE got throughput of 60-70 Mbps for 
> both RX and TX. I did have an unexplained kernel panic while running 
> that driver, thus there might be a severe bug in it. I don't know if 
> it is rtl8723e, but that is the only panic that I have had with 3.8-rc4.
>
> The driver for the RTL8188CU/RTL8192CU is a mess. Unfortunately, I am 
> not getting musch help from Realtek. For that reason, I am 
> concentrating on the CE models. Their PCIe group is more responsive.
>
> Larry
>
Sorry, just used to hitting Reply and NOT Reply All. It seems possible 
that the problem may in fact be with the router. Or partially with the 
router anyway. I DO have weak signal problems with the rtl8723ae Linux 
drivers and always have but they may not be any worse than they were 
before. One of my roommates is having trouble as well (though everyone 
else using the router is fine as far as I can tell). I've noticed from 
diagnostics with the router that most clients seem to be getting a ping 
of about 6ms with occasional spikes, which seems a bit odd (I've 
generally had pings of about 2ms with my own routers when I've checked 
in the past) but I don't think it's necessarily anything to worry about. 
I'll e-mail again if I can confirm with any certainty that it's either 
the router or the wireless drivers.
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

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,