linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/3] Fix rtl8192cu in 3.18-rc1
@ 2014-10-22 13:47 Karsten Wiese
  2014-10-22 13:47 ` [PATCH 1/3] rtl8192cu: Fix for rtlwifi's bluetooth coexist functionality Karsten Wiese
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Karsten Wiese @ 2014-10-22 13:47 UTC (permalink / raw)
  To: Larry.Finger; +Cc: linux-wireless

In 3.18-rc1 the rtl8192cu driver does not register a wlan%d device.
Attached patches fix that and the oopses I encountered.
Here the driver works again driving a device as station to a 802.11g 
access point.

Regards,
Karsten
 


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH 1/3] rtl8192cu: Fix for rtlwifi's bluetooth coexist functionality
  2014-10-22 13:47 [PATCH 0/3] Fix rtl8192cu in 3.18-rc1 Karsten Wiese
@ 2014-10-22 13:47 ` Karsten Wiese
  2014-10-22 16:30   ` Larry Finger
  2014-10-22 13:47 ` [PATCH 2/3] rtl8192cu: Call ieee80211_register_hw from rtl_usb_probe Karsten Wiese
  2014-10-22 13:47 ` [PATCH 3/3] rtl8192cu: Prevent Ooops under rtl92c_set_fw_rsvdpagepkt Karsten Wiese
  2 siblings, 1 reply; 7+ messages in thread
From: Karsten Wiese @ 2014-10-22 13:47 UTC (permalink / raw)
  To: Larry.Finger; +Cc: linux-wireless, Karsten Wiese

Initialize function pointer with a function indicating bt coexist is not there.
Prevents Ooops.

Signed-off-by: Karsten Wiese <fzuuzf@googlemail.com>
---
 drivers/net/wireless/rtlwifi/rtl8192cu/sw.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/net/wireless/rtlwifi/rtl8192cu/sw.c b/drivers/net/wireless/rtlwifi/rtl8192cu/sw.c
index 7c5fbaf..e06bafe 100644
--- a/drivers/net/wireless/rtlwifi/rtl8192cu/sw.c
+++ b/drivers/net/wireless/rtlwifi/rtl8192cu/sw.c
@@ -101,6 +101,12 @@ static void rtl92cu_deinit_sw_vars(struct ieee80211_hw *hw)
 	}
 }
 
+/* get bt coexist status */
+static bool rtl92cu_get_btc_status(void)
+{
+	return false;
+}
+
 static struct rtl_hal_ops rtl8192cu_hal_ops = {
 	.init_sw_vars = rtl92cu_init_sw_vars,
 	.deinit_sw_vars = rtl92cu_deinit_sw_vars,
@@ -148,6 +154,7 @@ static struct rtl_hal_ops rtl8192cu_hal_ops = {
 	.phy_set_bw_mode_callback = rtl92cu_phy_set_bw_mode_callback,
 	.dm_dynamic_txpower = rtl92cu_dm_dynamic_txpower,
 	.fill_h2c_cmd = rtl92c_fill_h2c_cmd,
+	.get_btc_status = rtl92cu_get_btc_status,
 };
 
 static struct rtl_mod_params rtl92cu_mod_params = {
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 2/3] rtl8192cu: Call ieee80211_register_hw from rtl_usb_probe
  2014-10-22 13:47 [PATCH 0/3] Fix rtl8192cu in 3.18-rc1 Karsten Wiese
  2014-10-22 13:47 ` [PATCH 1/3] rtl8192cu: Fix for rtlwifi's bluetooth coexist functionality Karsten Wiese
@ 2014-10-22 13:47 ` Karsten Wiese
  2014-10-22 16:31   ` Larry Finger
  2014-10-22 13:47 ` [PATCH 3/3] rtl8192cu: Prevent Ooops under rtl92c_set_fw_rsvdpagepkt Karsten Wiese
  2 siblings, 1 reply; 7+ messages in thread
From: Karsten Wiese @ 2014-10-22 13:47 UTC (permalink / raw)
  To: Larry.Finger; +Cc: linux-wireless, Karsten Wiese

In a previous patch the call to ieee80211_register_hw was moved from the
load firmware callback to the rtl_pci_probe only.
rt8192cu also uses this callback. Currently it doesnt create a wlan%d device.
Fill in the call to ieee80211_register_hw in rtl_usb_probe.

Signed-off-by: Karsten Wiese <fzuuzf@googlemail.com>
---
 drivers/net/wireless/rtlwifi/usb.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/drivers/net/wireless/rtlwifi/usb.c b/drivers/net/wireless/rtlwifi/usb.c
index 10cf69c..46ee956 100644
--- a/drivers/net/wireless/rtlwifi/usb.c
+++ b/drivers/net/wireless/rtlwifi/usb.c
@@ -1117,7 +1117,18 @@ int rtl_usb_probe(struct usb_interface *intf,
 	}
 	rtlpriv->cfg->ops->init_sw_leds(hw);
 
+	err = ieee80211_register_hw(hw);
+	if (err) {
+		RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
+			 "Can't register mac80211 hw.\n");
+		err = -ENODEV;
+		goto error_out;
+	}
+	rtlpriv->mac80211.mac80211_registered = 1;
+
+	set_bit(RTL_STATUS_INTERFACE_START, &rtlpriv->status);
 	return 0;
+
 error_out:
 	rtl_deinit_core(hw);
 	_rtl_usb_io_handler_release(hw);
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 3/3] rtl8192cu: Prevent Ooops under rtl92c_set_fw_rsvdpagepkt
  2014-10-22 13:47 [PATCH 0/3] Fix rtl8192cu in 3.18-rc1 Karsten Wiese
  2014-10-22 13:47 ` [PATCH 1/3] rtl8192cu: Fix for rtlwifi's bluetooth coexist functionality Karsten Wiese
  2014-10-22 13:47 ` [PATCH 2/3] rtl8192cu: Call ieee80211_register_hw from rtl_usb_probe Karsten Wiese
@ 2014-10-22 13:47 ` Karsten Wiese
  2014-10-22 16:35   ` Larry Finger
  2 siblings, 1 reply; 7+ messages in thread
From: Karsten Wiese @ 2014-10-22 13:47 UTC (permalink / raw)
  To: Larry.Finger; +Cc: linux-wireless, Karsten Wiese

rtl92c_set_fw_rsvdpagepkt is used by rtl8192cu and its pci sibling rtl8192ce.
rtl_cmd_send_packet crashes when called inside rtl8192cu because it works on
memory allocated only by rtl8192ce.
Fix the crash by calling a dummy function when used in rtl8192cu.
Comparision with the realtek vendor driver makes me think, something is missing in
the dummy function.
Short test as WPA2 station show good results connected to an 802.11g basestation.
Traffic stops after few MBytes as WPA2 station connected to an 802.11n basestation.

Signed-off-by: Karsten Wiese <fzuuzf@googlemail.com>
---
 drivers/net/wireless/rtlwifi/rtl8192c/fw_common.c |  8 ++++++--
 drivers/net/wireless/rtlwifi/rtl8192c/fw_common.h |  4 +++-
 drivers/net/wireless/rtlwifi/rtl8192ce/hw.c       |  2 +-
 drivers/net/wireless/rtlwifi/rtl8192cu/hw.c       | 17 ++++++++++++++++-
 drivers/net/wireless/rtlwifi/rtl8192cu/hw.h       |  1 -
 5 files changed, 26 insertions(+), 6 deletions(-)

diff --git a/drivers/net/wireless/rtlwifi/rtl8192c/fw_common.c b/drivers/net/wireless/rtlwifi/rtl8192c/fw_common.c
index a00861b..29983bc 100644
--- a/drivers/net/wireless/rtlwifi/rtl8192c/fw_common.c
+++ b/drivers/net/wireless/rtlwifi/rtl8192c/fw_common.c
@@ -656,7 +656,8 @@ static u8 reserved_page_packet[TOTAL_RESERVED_PKT_LEN] = {
 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
 };
 
-void rtl92c_set_fw_rsvdpagepkt(struct ieee80211_hw *hw, bool b_dl_finished)
+void rtl92c_set_fw_rsvdpagepkt(struct ieee80211_hw *hw,
+	 bool (*cmd_send_packet)(struct ieee80211_hw *, struct sk_buff *))
 {
 	struct rtl_priv *rtlpriv = rtl_priv(hw);
 	struct rtl_mac *mac = rtl_mac(rtl_priv(hw));
@@ -722,7 +723,10 @@ void rtl92c_set_fw_rsvdpagepkt(struct ieee80211_hw *hw, bool b_dl_finished)
 	memcpy((u8 *)skb_put(skb, totalpacketlen),
 	       &reserved_page_packet, totalpacketlen);
 
-	rtstatus = rtl_cmd_send_packet(hw, skb);
+	if (cmd_send_packet)
+		rtstatus = cmd_send_packet(hw, skb);
+	else
+		rtstatus = rtl_cmd_send_packet(hw, skb);
 
 	if (rtstatus)
 		b_dlok = true;
diff --git a/drivers/net/wireless/rtlwifi/rtl8192c/fw_common.h b/drivers/net/wireless/rtlwifi/rtl8192c/fw_common.h
index a815bd6..b64ae45 100644
--- a/drivers/net/wireless/rtlwifi/rtl8192c/fw_common.h
+++ b/drivers/net/wireless/rtlwifi/rtl8192c/fw_common.h
@@ -109,7 +109,9 @@ void rtl92c_fill_h2c_cmd(struct ieee80211_hw *hw, u8 element_id,
 			 u32 cmd_len, u8 *p_cmdbuffer);
 void rtl92c_firmware_selfreset(struct ieee80211_hw *hw);
 void rtl92c_set_fw_pwrmode_cmd(struct ieee80211_hw *hw, u8 mode);
-void rtl92c_set_fw_rsvdpagepkt(struct ieee80211_hw *hw, bool b_dl_finished);
+void rtl92c_set_fw_rsvdpagepkt
+	(struct ieee80211_hw *hw,
+	 bool (*cmd_send_packet)(struct ieee80211_hw *, struct sk_buff *));
 void rtl92c_set_fw_joinbss_report_cmd(struct ieee80211_hw *hw, u8 mstatus);
 void usb_writeN_async(struct rtl_priv *rtlpriv, u32 addr, void *data, u16 len);
 void rtl92c_set_p2p_ps_offload_cmd(struct ieee80211_hw *hw, u8 p2p_ps_state);
diff --git a/drivers/net/wireless/rtlwifi/rtl8192ce/hw.c b/drivers/net/wireless/rtlwifi/rtl8192ce/hw.c
index 8ec0f03..55357d6 100644
--- a/drivers/net/wireless/rtlwifi/rtl8192ce/hw.c
+++ b/drivers/net/wireless/rtlwifi/rtl8192ce/hw.c
@@ -459,7 +459,7 @@ void rtl92ce_set_hw_reg(struct ieee80211_hw *hw, u8 variable, u8 *val)
 				rtl_write_byte(rtlpriv, REG_FWHW_TXQ_CTRL + 2,
 					       tmp_reg422 & (~BIT(6)));
 
-				rtl92c_set_fw_rsvdpagepkt(hw, 0);
+				rtl92c_set_fw_rsvdpagepkt(hw, NULL);
 
 				_rtl92ce_set_bcn_ctrl_reg(hw, BIT(3), 0);
 				_rtl92ce_set_bcn_ctrl_reg(hw, 0, BIT(4));
diff --git a/drivers/net/wireless/rtlwifi/rtl8192cu/hw.c b/drivers/net/wireless/rtlwifi/rtl8192cu/hw.c
index 04aa0b5..873363a 100644
--- a/drivers/net/wireless/rtlwifi/rtl8192cu/hw.c
+++ b/drivers/net/wireless/rtlwifi/rtl8192cu/hw.c
@@ -1592,6 +1592,20 @@ void rtl92cu_get_hw_reg(struct ieee80211_hw *hw, u8 variable, u8 *val)
 	}
 }
 
+bool usb_cmd_send_packet(struct ieee80211_hw *hw, struct sk_buff *skb)
+{
+  /* Currently nothing happens here.
+   * Traffic stops after some seconds in WPA2 802.11n mode.
+   * Maybe because rtl8192cu chip should be set from here?
+   * If I understand correctly, the realtek vendor driver sends some urbs
+   * if its "here".
+   *
+   * This is maybe necessary:
+   * rtlpriv->cfg->ops->fill_tx_cmddesc(hw, buffer, 1, 1, skb);
+   */
+	return true;
+}
+
 void rtl92cu_set_hw_reg(struct ieee80211_hw *hw, u8 variable, u8 *val)
 {
 	struct rtl_priv *rtlpriv = rtl_priv(hw);
@@ -1939,7 +1953,8 @@ void rtl92cu_set_hw_reg(struct ieee80211_hw *hw, u8 variable, u8 *val)
 					recover = true;
 				rtl_write_byte(rtlpriv, REG_FWHW_TXQ_CTRL + 2,
 					       tmp_reg422 & (~BIT(6)));
-				rtl92c_set_fw_rsvdpagepkt(hw, 0);
+				rtl92c_set_fw_rsvdpagepkt(hw,
+							  &usb_cmd_send_packet);
 				_rtl92cu_set_bcn_ctrl_reg(hw, BIT(3), 0);
 				_rtl92cu_set_bcn_ctrl_reg(hw, 0, BIT(4));
 				if (recover)
diff --git a/drivers/net/wireless/rtlwifi/rtl8192cu/hw.h b/drivers/net/wireless/rtlwifi/rtl8192cu/hw.h
index 0f7812e..c1e33b0 100644
--- a/drivers/net/wireless/rtlwifi/rtl8192cu/hw.h
+++ b/drivers/net/wireless/rtlwifi/rtl8192cu/hw.h
@@ -104,7 +104,6 @@ bool rtl92cu_gpio_radio_on_off_checking(struct ieee80211_hw *hw, u8 * valid);
 void rtl92cu_set_check_bssid(struct ieee80211_hw *hw, bool check_bssid);
 int rtl92c_download_fw(struct ieee80211_hw *hw);
 void rtl92c_set_fw_pwrmode_cmd(struct ieee80211_hw *hw, u8 mode);
-void rtl92c_set_fw_rsvdpagepkt(struct ieee80211_hw *hw, bool dl_finished);
 void rtl92c_set_fw_joinbss_report_cmd(struct ieee80211_hw *hw, u8 mstatus);
 void rtl92c_fill_h2c_cmd(struct ieee80211_hw *hw,
 			 u8 element_id, u32 cmd_len, u8 *p_cmdbuffer);
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH 1/3] rtl8192cu: Fix for rtlwifi's bluetooth coexist functionality
  2014-10-22 13:47 ` [PATCH 1/3] rtl8192cu: Fix for rtlwifi's bluetooth coexist functionality Karsten Wiese
@ 2014-10-22 16:30   ` Larry Finger
  0 siblings, 0 replies; 7+ messages in thread
From: Larry Finger @ 2014-10-22 16:30 UTC (permalink / raw)
  To: Karsten Wiese; +Cc: linux-wireless

On 10/22/2014 08:47 AM, Karsten Wiese wrote:
> Initialize function pointer with a function indicating bt coexist is not there.
> Prevents Ooops.
>
> Signed-off-by: Karsten Wiese <fzuuzf@googlemail.com>
> ---

I have been working on a better fix; however, I am traveling and unable to 
finish testing it. As a result, this one should be applied.

Acked-by: Larry Finger <Larry.Finger@lwfinger.net>

Larry

>   drivers/net/wireless/rtlwifi/rtl8192cu/sw.c | 7 +++++++
>   1 file changed, 7 insertions(+)
>
> diff --git a/drivers/net/wireless/rtlwifi/rtl8192cu/sw.c b/drivers/net/wireless/rtlwifi/rtl8192cu/sw.c
> index 7c5fbaf..e06bafe 100644
> --- a/drivers/net/wireless/rtlwifi/rtl8192cu/sw.c
> +++ b/drivers/net/wireless/rtlwifi/rtl8192cu/sw.c
> @@ -101,6 +101,12 @@ static void rtl92cu_deinit_sw_vars(struct ieee80211_hw *hw)
>   	}
>   }
>
> +/* get bt coexist status */
> +static bool rtl92cu_get_btc_status(void)
> +{
> +	return false;
> +}
> +
>   static struct rtl_hal_ops rtl8192cu_hal_ops = {
>   	.init_sw_vars = rtl92cu_init_sw_vars,
>   	.deinit_sw_vars = rtl92cu_deinit_sw_vars,
> @@ -148,6 +154,7 @@ static struct rtl_hal_ops rtl8192cu_hal_ops = {
>   	.phy_set_bw_mode_callback = rtl92cu_phy_set_bw_mode_callback,
>   	.dm_dynamic_txpower = rtl92cu_dm_dynamic_txpower,
>   	.fill_h2c_cmd = rtl92c_fill_h2c_cmd,
> +	.get_btc_status = rtl92cu_get_btc_status,
>   };
>
>   static struct rtl_mod_params rtl92cu_mod_params = {
>


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 2/3] rtl8192cu: Call ieee80211_register_hw from rtl_usb_probe
  2014-10-22 13:47 ` [PATCH 2/3] rtl8192cu: Call ieee80211_register_hw from rtl_usb_probe Karsten Wiese
@ 2014-10-22 16:31   ` Larry Finger
  0 siblings, 0 replies; 7+ messages in thread
From: Larry Finger @ 2014-10-22 16:31 UTC (permalink / raw)
  To: Karsten Wiese; +Cc: linux-wireless

On 10/22/2014 08:47 AM, Karsten Wiese wrote:
> In a previous patch the call to ieee80211_register_hw was moved from the
> load firmware callback to the rtl_pci_probe only.
> rt8192cu also uses this callback. Currently it doesnt create a wlan%d device.
> Fill in the call to ieee80211_register_hw in rtl_usb_probe.
>
> Signed-off-by: Karsten Wiese <fzuuzf@googlemail.com>
> ---
>   drivers/net/wireless/rtlwifi/usb.c | 11 +++++++++++
>   1 file changed, 11 insertions(+)

Sorry that I missed this one.

Acked-by: Larry Finger <Larry.Finger@lwfinger.net>

Larry


>
> diff --git a/drivers/net/wireless/rtlwifi/usb.c b/drivers/net/wireless/rtlwifi/usb.c
> index 10cf69c..46ee956 100644
> --- a/drivers/net/wireless/rtlwifi/usb.c
> +++ b/drivers/net/wireless/rtlwifi/usb.c
> @@ -1117,7 +1117,18 @@ int rtl_usb_probe(struct usb_interface *intf,
>   	}
>   	rtlpriv->cfg->ops->init_sw_leds(hw);
>
> +	err = ieee80211_register_hw(hw);
> +	if (err) {
> +		RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
> +			 "Can't register mac80211 hw.\n");
> +		err = -ENODEV;
> +		goto error_out;
> +	}
> +	rtlpriv->mac80211.mac80211_registered = 1;
> +
> +	set_bit(RTL_STATUS_INTERFACE_START, &rtlpriv->status);
>   	return 0;
> +
>   error_out:
>   	rtl_deinit_core(hw);
>   	_rtl_usb_io_handler_release(hw);
>


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 3/3] rtl8192cu: Prevent Ooops under rtl92c_set_fw_rsvdpagepkt
  2014-10-22 13:47 ` [PATCH 3/3] rtl8192cu: Prevent Ooops under rtl92c_set_fw_rsvdpagepkt Karsten Wiese
@ 2014-10-22 16:35   ` Larry Finger
  0 siblings, 0 replies; 7+ messages in thread
From: Larry Finger @ 2014-10-22 16:35 UTC (permalink / raw)
  To: Karsten Wiese; +Cc: linux-wireless

On 10/22/2014 08:47 AM, Karsten Wiese wrote:
> rtl92c_set_fw_rsvdpagepkt is used by rtl8192cu and its pci sibling rtl8192ce.
> rtl_cmd_send_packet crashes when called inside rtl8192cu because it works on
> memory allocated only by rtl8192ce.
> Fix the crash by calling a dummy function when used in rtl8192cu.
> Comparision with the realtek vendor driver makes me think, something is missing in
> the dummy function.
> Short test as WPA2 station show good results connected to an 802.11g basestation.
> Traffic stops after few MBytes as WPA2 station connected to an 802.11n basestation.
>
> Signed-off-by: Karsten Wiese <fzuuzf@googlemail.com>

This one needs to be applied; however, I will be taking another look at it after 
I finish my traveling.

Acked-by: Larry Finger <Larry.Finger@lwfinger.net>

Larry


> ---
>   drivers/net/wireless/rtlwifi/rtl8192c/fw_common.c |  8 ++++++--
>   drivers/net/wireless/rtlwifi/rtl8192c/fw_common.h |  4 +++-
>   drivers/net/wireless/rtlwifi/rtl8192ce/hw.c       |  2 +-
>   drivers/net/wireless/rtlwifi/rtl8192cu/hw.c       | 17 ++++++++++++++++-
>   drivers/net/wireless/rtlwifi/rtl8192cu/hw.h       |  1 -
>   5 files changed, 26 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/net/wireless/rtlwifi/rtl8192c/fw_common.c b/drivers/net/wireless/rtlwifi/rtl8192c/fw_common.c
> index a00861b..29983bc 100644
> --- a/drivers/net/wireless/rtlwifi/rtl8192c/fw_common.c
> +++ b/drivers/net/wireless/rtlwifi/rtl8192c/fw_common.c
> @@ -656,7 +656,8 @@ static u8 reserved_page_packet[TOTAL_RESERVED_PKT_LEN] = {
>   	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
>   };
>
> -void rtl92c_set_fw_rsvdpagepkt(struct ieee80211_hw *hw, bool b_dl_finished)
> +void rtl92c_set_fw_rsvdpagepkt(struct ieee80211_hw *hw,
> +	 bool (*cmd_send_packet)(struct ieee80211_hw *, struct sk_buff *))
>   {
>   	struct rtl_priv *rtlpriv = rtl_priv(hw);
>   	struct rtl_mac *mac = rtl_mac(rtl_priv(hw));
> @@ -722,7 +723,10 @@ void rtl92c_set_fw_rsvdpagepkt(struct ieee80211_hw *hw, bool b_dl_finished)
>   	memcpy((u8 *)skb_put(skb, totalpacketlen),
>   	       &reserved_page_packet, totalpacketlen);
>
> -	rtstatus = rtl_cmd_send_packet(hw, skb);
> +	if (cmd_send_packet)
> +		rtstatus = cmd_send_packet(hw, skb);
> +	else
> +		rtstatus = rtl_cmd_send_packet(hw, skb);
>
>   	if (rtstatus)
>   		b_dlok = true;
> diff --git a/drivers/net/wireless/rtlwifi/rtl8192c/fw_common.h b/drivers/net/wireless/rtlwifi/rtl8192c/fw_common.h
> index a815bd6..b64ae45 100644
> --- a/drivers/net/wireless/rtlwifi/rtl8192c/fw_common.h
> +++ b/drivers/net/wireless/rtlwifi/rtl8192c/fw_common.h
> @@ -109,7 +109,9 @@ void rtl92c_fill_h2c_cmd(struct ieee80211_hw *hw, u8 element_id,
>   			 u32 cmd_len, u8 *p_cmdbuffer);
>   void rtl92c_firmware_selfreset(struct ieee80211_hw *hw);
>   void rtl92c_set_fw_pwrmode_cmd(struct ieee80211_hw *hw, u8 mode);
> -void rtl92c_set_fw_rsvdpagepkt(struct ieee80211_hw *hw, bool b_dl_finished);
> +void rtl92c_set_fw_rsvdpagepkt
> +	(struct ieee80211_hw *hw,
> +	 bool (*cmd_send_packet)(struct ieee80211_hw *, struct sk_buff *));
>   void rtl92c_set_fw_joinbss_report_cmd(struct ieee80211_hw *hw, u8 mstatus);
>   void usb_writeN_async(struct rtl_priv *rtlpriv, u32 addr, void *data, u16 len);
>   void rtl92c_set_p2p_ps_offload_cmd(struct ieee80211_hw *hw, u8 p2p_ps_state);
> diff --git a/drivers/net/wireless/rtlwifi/rtl8192ce/hw.c b/drivers/net/wireless/rtlwifi/rtl8192ce/hw.c
> index 8ec0f03..55357d6 100644
> --- a/drivers/net/wireless/rtlwifi/rtl8192ce/hw.c
> +++ b/drivers/net/wireless/rtlwifi/rtl8192ce/hw.c
> @@ -459,7 +459,7 @@ void rtl92ce_set_hw_reg(struct ieee80211_hw *hw, u8 variable, u8 *val)
>   				rtl_write_byte(rtlpriv, REG_FWHW_TXQ_CTRL + 2,
>   					       tmp_reg422 & (~BIT(6)));
>
> -				rtl92c_set_fw_rsvdpagepkt(hw, 0);
> +				rtl92c_set_fw_rsvdpagepkt(hw, NULL);
>
>   				_rtl92ce_set_bcn_ctrl_reg(hw, BIT(3), 0);
>   				_rtl92ce_set_bcn_ctrl_reg(hw, 0, BIT(4));
> diff --git a/drivers/net/wireless/rtlwifi/rtl8192cu/hw.c b/drivers/net/wireless/rtlwifi/rtl8192cu/hw.c
> index 04aa0b5..873363a 100644
> --- a/drivers/net/wireless/rtlwifi/rtl8192cu/hw.c
> +++ b/drivers/net/wireless/rtlwifi/rtl8192cu/hw.c
> @@ -1592,6 +1592,20 @@ void rtl92cu_get_hw_reg(struct ieee80211_hw *hw, u8 variable, u8 *val)
>   	}
>   }
>
> +bool usb_cmd_send_packet(struct ieee80211_hw *hw, struct sk_buff *skb)
> +{
> +  /* Currently nothing happens here.
> +   * Traffic stops after some seconds in WPA2 802.11n mode.
> +   * Maybe because rtl8192cu chip should be set from here?
> +   * If I understand correctly, the realtek vendor driver sends some urbs
> +   * if its "here".
> +   *
> +   * This is maybe necessary:
> +   * rtlpriv->cfg->ops->fill_tx_cmddesc(hw, buffer, 1, 1, skb);
> +   */
> +	return true;
> +}
> +
>   void rtl92cu_set_hw_reg(struct ieee80211_hw *hw, u8 variable, u8 *val)
>   {
>   	struct rtl_priv *rtlpriv = rtl_priv(hw);
> @@ -1939,7 +1953,8 @@ void rtl92cu_set_hw_reg(struct ieee80211_hw *hw, u8 variable, u8 *val)
>   					recover = true;
>   				rtl_write_byte(rtlpriv, REG_FWHW_TXQ_CTRL + 2,
>   					       tmp_reg422 & (~BIT(6)));
> -				rtl92c_set_fw_rsvdpagepkt(hw, 0);
> +				rtl92c_set_fw_rsvdpagepkt(hw,
> +							  &usb_cmd_send_packet);
>   				_rtl92cu_set_bcn_ctrl_reg(hw, BIT(3), 0);
>   				_rtl92cu_set_bcn_ctrl_reg(hw, 0, BIT(4));
>   				if (recover)
> diff --git a/drivers/net/wireless/rtlwifi/rtl8192cu/hw.h b/drivers/net/wireless/rtlwifi/rtl8192cu/hw.h
> index 0f7812e..c1e33b0 100644
> --- a/drivers/net/wireless/rtlwifi/rtl8192cu/hw.h
> +++ b/drivers/net/wireless/rtlwifi/rtl8192cu/hw.h
> @@ -104,7 +104,6 @@ bool rtl92cu_gpio_radio_on_off_checking(struct ieee80211_hw *hw, u8 * valid);
>   void rtl92cu_set_check_bssid(struct ieee80211_hw *hw, bool check_bssid);
>   int rtl92c_download_fw(struct ieee80211_hw *hw);
>   void rtl92c_set_fw_pwrmode_cmd(struct ieee80211_hw *hw, u8 mode);
> -void rtl92c_set_fw_rsvdpagepkt(struct ieee80211_hw *hw, bool dl_finished);
>   void rtl92c_set_fw_joinbss_report_cmd(struct ieee80211_hw *hw, u8 mstatus);
>   void rtl92c_fill_h2c_cmd(struct ieee80211_hw *hw,
>   			 u8 element_id, u32 cmd_len, u8 *p_cmdbuffer);
>


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2014-10-22 16:35 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-10-22 13:47 [PATCH 0/3] Fix rtl8192cu in 3.18-rc1 Karsten Wiese
2014-10-22 13:47 ` [PATCH 1/3] rtl8192cu: Fix for rtlwifi's bluetooth coexist functionality Karsten Wiese
2014-10-22 16:30   ` Larry Finger
2014-10-22 13:47 ` [PATCH 2/3] rtl8192cu: Call ieee80211_register_hw from rtl_usb_probe Karsten Wiese
2014-10-22 16:31   ` Larry Finger
2014-10-22 13:47 ` [PATCH 3/3] rtl8192cu: Prevent Ooops under rtl92c_set_fw_rsvdpagepkt Karsten Wiese
2014-10-22 16:35   ` Larry Finger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).