linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] rtlwifi: rtl8192c: Add init codes for "fw_version" and "fw_subversion".
@ 2015-06-06 11:02 Taehee Yoo
  2015-06-06 16:18 ` Larry Finger
  0 siblings, 1 reply; 3+ messages in thread
From: Taehee Yoo @ 2015-06-06 11:02 UTC (permalink / raw)
  To: Larry.Finger; +Cc: ap420073, linux-wireless

The variable "fw_version" is used in the _ResetDigitalProcedure1().
but It is not initialized. so I add init codes for "fw_version" and
"fw_subversion".

Signed-off-by: Taehee Yoo <ap420073@gmail.com>
---
 drivers/net/wireless/rtlwifi/rtl8192c/fw_common.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/net/wireless/rtlwifi/rtl8192c/fw_common.c b/drivers/net/wireless/rtlwifi/rtl8192c/fw_common.c
index 29983bc..9b5ce28 100644
--- a/drivers/net/wireless/rtlwifi/rtl8192c/fw_common.c
+++ b/drivers/net/wireless/rtlwifi/rtl8192c/fw_common.c
@@ -233,6 +233,8 @@ int rtl92c_download_fw(struct ieee80211_hw *hw)
 	pfwheader = (struct rtl92c_firmware_header *)rtlhal->pfirmware;
 	pfwdata = (u8 *)rtlhal->pfirmware;
 	fwsize = rtlhal->fwsize;
+	rtlhal->fw_version = pfwheader->version;
+	rtlhal->fw_subversion = pfwheader->subversion;
 
 	if (IS_FW_HEADER_EXIST(pfwheader)) {
 		RT_TRACE(rtlpriv, COMP_FW, DBG_DMESG,
-- 
2.1.4


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

* Re: [PATCH] rtlwifi: rtl8192c: Add init codes for "fw_version" and "fw_subversion".
  2015-06-06 11:02 [PATCH] rtlwifi: rtl8192c: Add init codes for "fw_version" and "fw_subversion" Taehee Yoo
@ 2015-06-06 16:18 ` Larry Finger
  2015-06-07 12:12   ` Taehee Yoo
  0 siblings, 1 reply; 3+ messages in thread
From: Larry Finger @ 2015-06-06 16:18 UTC (permalink / raw)
  To: Taehee Yoo; +Cc: linux-wireless

On 06/06/2015 06:02 AM, Taehee Yoo wrote:
> The variable "fw_version" is used in the _ResetDigitalProcedure1().
> but It is not initialized. so I add init codes for "fw_version" and
> "fw_subversion".
>
> Signed-off-by: Taehee Yoo <ap420073@gmail.com>
> ---
>   drivers/net/wireless/rtlwifi/rtl8192c/fw_common.c | 2 ++
>   1 file changed, 2 insertions(+)
>
> diff --git a/drivers/net/wireless/rtlwifi/rtl8192c/fw_common.c b/drivers/net/wireless/rtlwifi/rtl8192c/fw_common.c
> index 29983bc..9b5ce28 100644
> --- a/drivers/net/wireless/rtlwifi/rtl8192c/fw_common.c
> +++ b/drivers/net/wireless/rtlwifi/rtl8192c/fw_common.c
> @@ -233,6 +233,8 @@ int rtl92c_download_fw(struct ieee80211_hw *hw)
>   	pfwheader = (struct rtl92c_firmware_header *)rtlhal->pfirmware;
>   	pfwdata = (u8 *)rtlhal->pfirmware;
>   	fwsize = rtlhal->fwsize;
> +	rtlhal->fw_version = pfwheader->version;
> +	rtlhal->fw_subversion = pfwheader->subversion;
>
>   	if (IS_FW_HEADER_EXIST(pfwheader)) {
>   		RT_TRACE(rtlpriv, COMP_FW, DBG_DMESG,

This patch is not correct. If the firmware does not have a header, then you will 
be changing fw_version and fw_subversion to random bytes from the body of the 
firmware. At present, they are initialized to zero as part of the rtl_priv 
struct. You need to move the two new statements inside the IS_FW_HEADER_EXIST 
test, but before pfwdata is adjusted to remove the header.

Larry



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

* Re: [PATCH] rtlwifi: rtl8192c: Add init codes for "fw_version" and "fw_subversion".
  2015-06-06 16:18 ` Larry Finger
@ 2015-06-07 12:12   ` Taehee Yoo
  0 siblings, 0 replies; 3+ messages in thread
From: Taehee Yoo @ 2015-06-07 12:12 UTC (permalink / raw)
  To: Larry Finger; +Cc: linux-wireless@vger.kernel.org

2015-06-07 1:18 GMT+09:00 Larry Finger <Larry.Finger@lwfinger.net>:
> On 06/06/2015 06:02 AM, Taehee Yoo wrote:
>>
>> The variable "fw_version" is used in the _ResetDigitalProcedure1().
>> but It is not initialized. so I add init codes for "fw_version" and
>> "fw_subversion".
>>
>> Signed-off-by: Taehee Yoo <ap420073@gmail.com>
>> ---
>>   drivers/net/wireless/rtlwifi/rtl8192c/fw_common.c | 2 ++
>>   1 file changed, 2 insertions(+)
>>
>> diff --git a/drivers/net/wireless/rtlwifi/rtl8192c/fw_common.c
>> b/drivers/net/wireless/rtlwifi/rtl8192c/fw_common.c
>> index 29983bc..9b5ce28 100644
>> --- a/drivers/net/wireless/rtlwifi/rtl8192c/fw_common.c
>> +++ b/drivers/net/wireless/rtlwifi/rtl8192c/fw_common.c
>> @@ -233,6 +233,8 @@ int rtl92c_download_fw(struct ieee80211_hw *hw)
>>         pfwheader = (struct rtl92c_firmware_header *)rtlhal->pfirmware;
>>         pfwdata = (u8 *)rtlhal->pfirmware;
>>         fwsize = rtlhal->fwsize;
>> +       rtlhal->fw_version = pfwheader->version;
>> +       rtlhal->fw_subversion = pfwheader->subversion;
>>
>>         if (IS_FW_HEADER_EXIST(pfwheader)) {
>>                 RT_TRACE(rtlpriv, COMP_FW, DBG_DMESG,
>
>
> This patch is not correct. If the firmware does not have a header, then you
> will be changing fw_version and fw_subversion to random bytes from the body
> of the firmware. At present, they are initialized to zero as part of the
> rtl_priv struct. You need to move the two new statements inside the
> IS_FW_HEADER_EXIST test, but before pfwdata is adjusted to remove the
> header.
>
> Larry
>
>

Thank you for your review!
I will resend a patch as V2.

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

end of thread, other threads:[~2015-06-07 12:12 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-06-06 11:02 [PATCH] rtlwifi: rtl8192c: Add init codes for "fw_version" and "fw_subversion" Taehee Yoo
2015-06-06 16:18 ` Larry Finger
2015-06-07 12:12   ` Taehee Yoo

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).