History log of /linux-master/drivers/staging/wlan-ng/prism2fw.c
Revision Date Author Comments
# 22d99db4 16-Oct-2023 Calvince Otieno <calvncce@gmail.com>

staging: wlan-ng: replace strncpy() with strscpy()

Checkpatch suggests the use of strscpy() instead of strncpy().
The advantages are that it always adds a NUL terminator and it prevents
a read overflow if the src string is not properly terminated. One
potential disadvantage is that it doesn't zero pad the string like
strncpy() does.
In this code, strscpy() and strncpy() are equivalent and it does not
affect runtime behavior. The string is zeroed on the line before
using memset(). The resulting string was always NUL terminated and
PRISM2_USB_FWFILE is string literal "prism2_ru.fw" so it's NUL
terminated.
However, even though using strscpy() does not fix any bugs, it's
still nicer and makes checkpatch happy.

Signed-off-by: Calvince Otieno <calvncce@gmail.com>
Reviewed-by: Dan Carpenter <dan.carpenter@linaro.org>
Link: https://lore.kernel.org/r/ZSzapU+eKWvHVwxi@lab-ubuntu
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 5d88ce50 17-May-2023 Bagas Sanjaya <bagasdotme@gmail.com>

drivers: staging: wlan-ng: Remove GPL/MPL boilerplate

Remove the license boilerplate as there is already SPDX license
identifier added in b24413180f5600 ("License cleanup: add SPDX GPL-2.0
license identifier to files with no license") which fulfills the same
intention as the boilerplate.

Cc: Dan Carpenter <error27@gmail.com>
Cc: Kate Stewart <kstewart@linuxfoundation.org>
Cc: Philippe Ombredanne <pombredanne@nexb.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Simon Horman <simon.horman@corigine.com>
Signed-off-by: Bagas Sanjaya <bagasdotme@gmail.com>
Link: https://lore.kernel.org/r/20230517090418.1093091-4-bagasdotme@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 238f55be 10-Mar-2023 Archana <craechal@gmail.com>

staging: wlan-ng: small cleanup in plugimage()

It's cleaner to set "j = -1;" before the if block and remove the else
statement.

Signed-off-by: Archana <craechal@gmail.com>
Reviewed-by: Dan Carpenter <error27@gmail.com>
Link: https://lore.kernel.org/r/20230311121253.10225-2-craechal@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 95a4919a 10-Mar-2023 Archana <craechal@gmail.com>

staging: wlan-ng: small cleanup in writeimage()

It is cleaner to use "goto free_result;" as is being followed
in rest of the implementation of writeimage function, and
remove unnecessary kfree statements.

Signed-off-by: Archana <craechal@gmail.com>
Reviewed-by: Dan Carpenter <error27@gmail.com>
Link: https://lore.kernel.org/r/20230311121253.10225-1-craechal@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# c10fe0cc 17-Jul-2021 Len Baker <len.baker@gmx.com>

staging/wlan-ng: Remove all strcpy() uses in favor of strscpy()

strcpy() performs no bounds checking on the destination buffer. This
could result in linear overflows beyond the end of the buffer, leading
to all kinds of misbehaviors. The safe replacement is strscpy().

Signed-off-by: Len Baker <len.baker@gmx.com>
Link: https://lore.kernel.org/r/20210717152032.10164-1-len.baker@gmx.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 9a47dc5f 24-Dec-2018 Prathamesh Deshpande <prathameshdeshpande7@gmail.com>

staging: wlan-ng: prism2fw.c: Fix "Possible unnecessary 'out of memory' message" checkpatch.pl warning"

This patch removes unnecessary out of memory warning
message from wlan-ng prism2fw.c file.

Signed-off-by: Prathamesh Deshpande <prathameshdeshpande7@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 700fe657 19-Nov-2018 Tim Collier <osdevtc@gmail.com>

staging: wlan-ng: remove unused variable in prism2fw.c

Remove the unused crcend variable from the crcimage function.

Signed-off-by: Tim Collier <osdevtc@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# c677b196 06-Nov-2018 Rohit Sarkar <rohitsarkar5398@gmail.com>

staging: wlan-ng: Fix a typo.

"Exiting" instead of "Exitting"

Signed-off-by: Rohit Sarkar <rohitsarkar5398@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 7ae2637a 26-Sep-2018 Tim Collier <osdevtc@gmail.com>

staging: wlan-ng: rename DIDmib_p2_p2NIC_p2PRISupRange in p80211metadef.h

Rename DIDmib_p2_p2NIC_p2PRISupRange in p80211metadef.h to
DIDMIB_P2_NIC_PRISUPRANGE to fix "Avoid CamelCase" message from
checkpatch and conform to the coding style guidelines. Also shorten
name by removing repeated use of "P2" to ease readability and reduce
long lines.

Signed-off-by: Tim Collier <osdevtc@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 8fb830b5 26-Sep-2018 Tim Collier <osdevtc@gmail.com>

staging: wlan-ng: rename DIDmsg_p2req_ramdl_write_resultcode in p80211metadef.h

Rename DIDmsg_p2req_ramdl_write_resultcode in p80211metadef.h to
DIDMSG_P2REQ_RAMDL_WRITE_RESULTCODE to fix "Avoid CamelCase" message
from checkpatch and conform to the coding style guidelines.

Signed-off-by: Tim Collier <osdevtc@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 74f11efc 26-Sep-2018 Tim Collier <osdevtc@gmail.com>

staging: wlan-ng: rename DIDmsg_p2req_ramdl_write_data in p80211metadef.h

Rename DIDmsg_p2req_ramdl_write_data in p80211metadef.h to
DIDMSG_P2REQ_RAMDL_WRITE_DATA to fix "Avoid CamelCase" message from
checkpatch and conform to the coding style guidelines.

Signed-off-by: Tim Collier <osdevtc@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 9940d6b6 26-Sep-2018 Tim Collier <osdevtc@gmail.com>

staging: wlan-ng: rename DIDmsg_p2req_ramdl_write_len in p80211metadef.h

Rename DIDmsg_p2req_ramdl_write_len to DIDMSG_P2REQ_RAMDL_WRITE_LEN to
fix "Avoid CamelCase" message from checkpatch and conform to the
coding style guidelines.

Signed-off-by: Tim Collier <osdevtc@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# c2a348b8 26-Sep-2018 Tim Collier <osdevtc@gmail.com>

staging: wlan-ng: rename DIDmsg_p2req_ramdl_write_addr in p80211metadef.h

Rename DIDmsg_p2req_ramdl_write_addr in p80211metadef.h to
DIDMSG_P2REQ_RAMDL_WRITE_ADDR to fix "Avoid CamelCase" message from
checkpatch and conform to the coding style guidelines.

Signed-off-by: Tim Collier <osdevtc@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# e0959e9b 26-Sep-2018 Tim Collier <osdevtc@gmail.com>

staging: wlan-ng: rename DIDmsg_p2req_ramdl_write in p80211metadef.h

Rename DIDmsg_p2req_ramdl_write in p80211metadef.h to
DIDMSG_P2REQ_RAMDL_WRITE to fix "Avoid CamelCase" message from
checkpatch and conform to the coding style guidelines.

Signed-off-by: Tim Collier <osdevtc@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 8843c1fb 26-Sep-2018 Tim Collier <osdevtc@gmail.com>

staging: wlan-ng: rename DIDmsg_p2req_ramdl_state_resultcode in p80211metadef.h

Rename DIDmsg_p2req_ramdl_state_resultcode in p80211metadef.h to
DIDMSG_P2REQ_RAMDL_STATE_RESULTCODE to fix "Avoid CamelCase" message
from checkpatch and conform to the coding style guidelines.

Signed-off-by: Tim Collier <osdevtc@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 9ea4ffec 26-Sep-2018 Tim Collier <osdevtc@gmail.com>

staging: wlan-ng: rename DIDmsg_p2req_ramdl_state_exeaddr in p80211metadef.h

Rename DIDmsg_p2req_ramdl_state_exeaddr in p80211metadef.h to
DIDMSG_P2REQ_RAMDL_STATE_EXEADDR to fix "Avoid CamelCase" message from
checkpatch and conform to the coding style guidelines.

Signed-off-by: Tim Collier <osdevtc@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 380ad4f6 26-Sep-2018 Tim Collier <osdevtc@gmail.com>

staging: wlan-ng: rename DIDmsg_p2req_ramdl_state_enable in p80211metadef.h

Rename DIDmsg_p2req_ramdl_state_enable in p80211metadef.h to
DIDMSG_P2REQ_RAMDL_STATE_ENABLE to fix "Avoid CamelCase" message from
checkpatch and conform to the coding style guidelines.

Signed-off-by: Tim Collier <osdevtc@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# f1364a0d 26-Sep-2018 Tim Collier <osdevtc@gmail.com>

staging: wlan-ng: rename DIDmsg_p2req_ramdl_state in p80211metadef.h

Rename DIDmsg_p2req_ramdl_state to DIDMSG_P2REQ_RAMDL_STATE in
p80211metadef.h to fix "Avoid CamelCase" message from checkpatch and
conform to the coding style guidelines.

Signed-off-by: Tim Collier <osdevtc@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 020600ae 26-Sep-2018 Tim Collier <osdevtc@gmail.com>

staging: wlan-ng: rename DIDmsg_p2req_readpda_resultcode in p80211metadef.h

Rename DIDmsg_p2req_readpda_resultcode in p80211metadef.h to
DIDMSG_P2REQ_READPDA_RESULTCODE to fix "Avoid CamelCase" message from
checkpatch and conform to the coding style guidelines.

Signed-off-by: Tim Collier <osdevtc@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 5a16b37e 26-Sep-2018 Tim Collier <osdevtc@gmail.com>

staging: wlan-ng: rename DIDmsg_p2req_readpda_pda in p80211metadef.h

Rename DIDmsg_p2req_readpda_pda in p80211metadef.h to
DIDMSG_P2REQ_READPDA_PDA to fix "Avoid CamelCase" message from
checkpatch and conform to the coding style guidelines.

Signed-off-by: Tim Collier <osdevtc@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# f9f0e98f 26-Sep-2018 Tim Collier <osdevtc@gmail.com>

staging: wlan-ng: rename DIDmsg_p2req_readpda in p80211metadef.h

Rename DIDmsg_p2req_readpda in p80211metadef.h to DIDMSG_P2REQ_READPDA
to fix "Avoid CamelCase" message from checkpatch and conform to the
coding style guidelines.

Signed-off-by: Tim Collier <osdevtc@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 42ccd88b 26-Sep-2018 Tim Collier <osdevtc@gmail.com>

staging: wlan-ng: rename DIDmsg_dot11req_mibget_resultcode in p80211metadef.h

Rename DIDmsg_dot11req_mibget_resultcode in p80211metadef.h to
DIDMSG_DOT11REQ_MIBGET_RESULTCODE to fix "Avoid CamelCase" message
from checkpatch and conform to the coding style guidelines.

Signed-off-by: Tim Collier <osdevtc@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 86ec6062 26-Sep-2018 Tim Collier <osdevtc@gmail.com>

staging: wlan-ng: rename DIDmsg_dot11req_mibget_mibattribute in p80211metadef.h

Rename DIDmsg_dot11req_mibget_mibattribute in p80211metadef.h to
DIDMSG_DOT11REQ_MIBGET_MIBATTRIBUTE to fix "Avoid CamelCase" message
from checkpatch and conform to the coding style guidelines.

Signed-off-by: Tim Collier <osdevtc@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 08ac8573 26-Sep-2018 Tim Collier <osdevtc@gmail.com>

staging: wlan-ng: rename DIDmsg_dot11req_mibget in p80211metadef.h

Rename DIDmsg_dot11req_mibget in p80211metadef.h to
DIDMSG_DOT11REQ_MIBGET to fix "Avoid CamelCase" message from
checkpatch and conform to the coding style guidelines.

Signed-off-by: Tim Collier <osdevtc@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 8627995c 28-Aug-2018 Tim Collier <osdevtc@gmail.com>

staging: wlan-ng: remove redundant code in "#if 0" blocks

Remove two blocks of code that checkpatch identified as redundant
because they were enclosed in "#if...#endif". In the case of
prism2fw.c the associated "TODO" comment was retained.

Signed-off-by: Tim Collier <osdevtc@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 0148f49c 06-Jul-2018 Tim Collier <osdevtc@gmail.com>

staging: wlan-ng: fix expression continuation in prism2fw.c

checkpatch reports "CHECK: Logical continuations should be on the
previous line" when a continuation line begins with an
operator. Reformat the code so that the operator appears at the end of
the line being continued.

Signed-off-by: Tim Collier <osdevtc@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# f7056d33 07-Nov-2017 Greg Kroah-Hartman <gregkh@linuxfoundation.org>

staging: wlan-ng: add SPDX identifiers to all wlan-ng driver files

It's good to have SPDX identifiers in all files to make it easier to
audit the kernel tree for correct licenses.

Update the wlan-ng driver files with the correct SPDX license identifier
based on the license text in the file itself. The SPDX identifier is a
legally binding shorthand, which can be used instead of the full boiler
plate text.

This work is based on a script and data from Thomas Gleixner, Philippe
Ombredanne, and Kate Stewart.

Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Kate Stewart <kstewart@linuxfoundation.org>
Cc: Philippe Ombredanne <pombredanne@nexb.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# d6d6fc83 18-Jul-2017 Simo Koskinen <koskisoft@gmail.com>

Staging: wlan-ng: Fixing coding style warnings

Removes following warnings found by checkpatch.pl script:

WARNING: Prefer using '"%s...", __func__' to using 'xxx',
this function's name, in a string

Signed-off-by: Simo Koskinen <koskisoft@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# b1bb2e33 12-May-2017 Thibaut SAUTEREAU <thibaut.sautereau@telecom-sudparis.eu>

staging: wlan-ng: convert endianness in situ for prism2fw

Fix several sparse warnings about casts to restricted
little-endian.

Signed-off-by: Thibaut SAUTEREAU <thibaut.sautereau@telecom-sudparis.eu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 76b4580b 08-Apr-2017 Maciek Borzecki <maciek.borzecki@gmail.com>

staging wlan-ng: fix type mismatch warnings in mkpdrlist()

struct hfa384x_pdrec len and code fields as clearly little endian,
mark both fields as such. pda->buf is also clearly little endian.

Fixes sparse warnings:

drivers/staging/wlan-ng/prism2fw.c:613:16: warning: cast to restricted __le16
drivers/staging/wlan-ng/prism2fw.c:616:21: warning: cast to restricted __le16
drivers/staging/wlan-ng/prism2fw.c:625:21: warning: cast to restricted __le16

Signed-off-by: Maciek Borzecki <maciek.borzecki@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# b586fbd3 07-Nov-2016 Sergio Paracuellos <sergio.paracuellos@gmail.com>

staging: wlan-ng: remove unnecessary parenthesis in prism2fw.c

This patch removes unnecessary parentheses in different statements of
prism2fw.c file in order to to comply with the standard kernel
coding style.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 98c1a778 07-Nov-2016 Sergio Paracuellos <sergio.paracuellos@gmail.com>

staging: wlan-ng: remove unnecessary blank lines in prism2fw.c

This patch removes unnecessary blank lines in prism2fw.c file to
comply with the standard kernel coding style.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 86605dd0 07-Nov-2016 Sergio Paracuellos <sergio.paracuellos@gmail.com>

staging: wlan-ng: fix parenthesis alignment in prism2fw.c

This patch fix open parenthesis alignment matching in prism2fw.c file
to comply with the standard kernel coding style.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# cfea8abf 09-Oct-2016 Sergio Paracuellos <sergio.paracuellos@gmail.com>

staging: wlan-ng: get memory from kernel allocators instead of big static buffer

This patch fix the following sparse warnings in prism2fw.c:
warning: memset with byte count of 120000

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 33630b00 09-Oct-2016 Sergio Paracuellos <sergio.paracuellos@gmail.com>

staging: wlan-ng: fix block comment warnings in prism2fw.c

This patch fix the following checkpatch.pl warnings in prism2fw.c

WARNING: Block comments should align the * on each line
WARNING: Block comments use a trailing */ on a separate line
Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 4f026e89 28-Sep-2016 Sergio Paracuellos <sergio.paracuellos@gmail.com>

staging: wlang-ng: avoid new typedef: hfa384x_pdrec_t

This patch fixes the following checkpatch.pl warning in hfa384x.h:
WARNING: do not add new typedefs

It applies for typedef hfa384x_pdrec_t

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 65f170c6 28-Sep-2016 Sergio Paracuellos <sergio.paracuellos@gmail.com>

staging: wlang-ng: avoid new typedef: hfa384x_caplevel_t

This patch fixes the following checkpatch.pl warning in hfa384x.h:
WARNING: do not add new typedefs

It applies for typedef hfa384x_caplevel_t

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 5f046456 28-Sep-2016 Sergio Paracuellos <sergio.paracuellos@gmail.com>

staging: wlang-ng: avoid new typedef: hfa384x_compident_t

This patch fixes the following checkpatch.pl warning in hfa384x.h:
WARNING: do not add new typedefs

It applies for typedef hfa384x_compident_t

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# ac033ec9 25-Sep-2016 Sergio Paracuellos <sergio.paracuellos@gmail.com>

staging: wlan-ng: avoid new typedef: p80211itemd_t

This patch fixes the following checkpatch.pl warning in p80211types.h:
WARNING: do not add new typedefs

It applies for typedef p80211itemd_t

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 0e21fa46 22-Sep-2016 Jannik Becher <becher.jannik@gmail.com>

staging: wlan-ng: remove unnecessary spaces before casts

Fixed a coding style issue by removing unnecessary spaces before casts.

Signed-off-by: Jannik Becher <Becher.Jannik@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# c9573a8d 18-Sep-2016 sayli karnik <karniksayli1995@gmail.com>

staging: wlan-ng: Remove the typedef to the 'wlandevice' structure

This patch removes the typedef 'wlandevice_t' to the 'wlandevice'
structure.

Signed-off-by: sayli karnik <karniksayli1995@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# e26eaf45 24-Apr-2016 Claudiu Beznea <claudiu.beznea@gmail.com>

Staging: wlan-ng: memory allocated inside mkimage() is not freed if subsequent calls fails.

This patch frees memory allocated inside mkimage() in case mkimage()
or any other subsequent calls inside prism2_fwapply() from prism2fw.c
file fails. To fix this I introduces goto labels where the free
operation is done in case some operations fails. After the introduction
of goto labels has been done, in order to use the same return path,
"return x" instuctions were replaced with "goto" instuctions.

Signed-off-by: Claudiu Beznea <claudiu.beznea@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# c631cb07 07-Mar-2016 Sandhya Bankar <bankarsandhya512@gmail.com>

Staging: wlan-ng: Handle error condition.

Handle error condition.

Signed-off-by: Sandhya Bankar <bankarsandhya512@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# e2e77528 27-Feb-2016 Eva Rachel Retuya <eraretuya@gmail.com>

staging: wlan-ng: simplify NULL tests

Replace direct comparisons to NULL i.e. 'x == NULL' with '!x' for
consistency. Coccinelle semantic patch used:

@@
identifier func;
expression x;
statement Z;
@@

x = func(...);

if (
(
+ !
x
- == NULL
|
+ !
- NULL ==
x
)
) Z

Signed-off-by: Eva Rachel Retuya <eraretuya@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 3ac8480a 23-Sep-2015 Tillmann Heidsieck <theidsieck@leenox.de>

staging: wlan-ng remove unnessecary variable

The result variable is not set anywhere beyond its initialization,
therefore it can be remove.

Signed-off-by: Tillmann Heidsieck <theidsieck@leenox.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# c739c987 23-Sep-2015 Tillmann Heidsieck <theidsieck@leenox.de>

staging: wlan-ng remove redundant conditional

We exit the above loop either if curroff >= (HFA384x_PDA_LEN_MAX / 2 - 1)
or if we found the END marker in the element beyond the current one. The
first case is checked for in the preceding if statement, therefore the
second if statement is redundant and can be removed.

Signed-off-by: Tillmann Heidsieck <theidsieck@leenox.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 4ccb726c 23-Sep-2015 Tillmann Heidsieck <theidsieck@leenox.de>

staging: wlan-ng fix buffer overflow in firmware handling

We test for an END marker in the element beyond the current one, this
effectively limits the size of the array to be HFA384x_PDA_LEN_MAX/2 - 1
not HFA384x_PDR_END_OF_PDA/2. This patch fixes a possible buffer
overflow in case there was no END marker.

Signed-off-by: Tillmann Heidsieck <theidsieck@leenox.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# cfa6954c 01-Jun-2015 Douglas Barbonaglia Sathler Figueiredo <eng.douglasfigueiredo@gmail.com>

staging: wlan-ng: fix long line

Style (line over 80 chars) in drivers/staging/wlan-ng/prism2fw.c

Signed-off-by: Douglas Barbonaglia Sathler Figueiredo <eng.douglasfigueiredo@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# e3c2b451 16-Nov-2014 Aede Symen Hoekstra <aedesymen@gmail.com>

staging: wlan-ng: prism2fw: fixed code style issue

Fixed checkpatch.pl warning message: line over 80 characters

Signed-off-by: Aede Symen Hoekstra <aedesymen@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# ad96f37f 08-Oct-2014 Tapasweni Pathak <tapaswenipathak@gmail.com>

staging: wlan-ng: replace kmalloc and memset with kzalloc

Replace kmalloc and memset with a single call of kzalloc in
file of wlan-ng.

Signed-off-by: Tapasweni Pathak <tapaswenipathak@gmail.com>
Reviewed-by: Josh Triplett <josh@joshtriplett.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# d41b7b74 14-Aug-2014 Artemiy Volkov <artemiyv@acm.org>

Staging: wlan-ng: Merge string literals on adjacent lines in prism2fw.c

This patch fixes the 'quoted string split across lines' checkpatch.pl
warning in prism2fw.c.

Signed-off-by: Artemiy Volkov <artemiyv@acm.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 41cb65c4 07-Aug-2014 A Raghavendra Rao <raghav3276@gmail.com>

Staging: wlan-ng: fix sparse warning in prism2fw.c

Fix the following sparse warning :

In file included from drivers/staging/wlan-ng/prism2usb.c:5:0:
drivers/staging/wlan-ng/prism2fw.c: In function
‘read_cardpda.constprop.43’:
drivers/staging/wlan-ng/prism2fw.c:792:1: warning: the frame size of
1068 bytes is larger than 1024 bytes [-Wframe-larger-than=]

The variable to 'struct p80211msg_p2req_readpda' was previously being created
on the stack, which inturn exeeded the frame size limit, resulting in a
sparse warning. This patch alloctes the memory to the structure dynamically
and the operations are left unchanged.

Signed-off-by: A Raghavendra Rao <arrao@cdac.in>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 1177ce46 01-Jul-2014 Matt Kurz <matt@ninezulu.com>

staging: wlan-ng/prism2fw.c: Add blank line after declarations

Fix checkpatch.pl warnings due to missing blank line after declarations

Signed-off-by: Matt Kurz <matt@ninezulu.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 02d9b1eb 18-May-2014 Vitaly Osipov <vitaly.osipov@gmail.com>

staging: wlan-ng: use netdev_() instead of printk()

Replaced all uses of printk() in wlan-ng with netdev_err / _warn
where a netdev exists. If a few cases where a netdev does not yet
exist, dev_ or pr_ was used.

Checkpatch complains about lines over 80 chars or split string
constants - the messages are just too long, keeping it completely
happy would make the code less readable.

Signed-off-by: Vitaly Osipov <vitaly.osipov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 4d8c1d0f 02-Mar-2014 Tugce Sirin <ztugcesirin@gmail.com>

Staging: wlan-ng: Fix Sparse warning should it be static?

This patch fixes following Sparse warning should it be static? in
staging/wlan-ng.

Signed-off-by: Tugce Sirin <ztugcesirin@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# d34602de 24-Sep-2012 Justin P. Mattock <justinmattock@gmail.com>

staging "wlan-ng" Fix typos.

Signed-off-by: Justin P. Mattock <justinmattock@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# ae24e13a 09-Sep-2012 Devendra Naga <devendra.aaru@gmail.com>

staging:wlan-ng: fix sparse warnings

drivers/staging/wlan-ng/prism2fw.c:240:5: warning: symbol 'prism2_fwapply' was not declared. Should it be static?
drivers/staging/wlan-ng/prism2fw.c:379:5: warning: symbol 'crcimage' was not declared. Should it be static?
drivers/staging/wlan-ng/prism2fw.c:443:6: warning: symbol 'free_chunks' was not declared. Should it be static?
drivers/staging/wlan-ng/prism2fw.c:465:6: warning: symbol 'free_srecs' was not declared. Should it be static?
drivers/staging/wlan-ng/prism2fw.c:492:5: warning: symbol 'mkimage' was not declared. Should it be static?
drivers/staging/wlan-ng/prism2fw.c:585:5: warning: symbol 'mkpdrlist' was not declared. Should it be static?
drivers/staging/wlan-ng/prism2fw.c:659:5: warning: symbol 'plugimage' was not declared. Should it be static?
drivers/staging/wlan-ng/prism2fw.c:767:5: warning: symbol 'read_cardpda' was not declared. Should it be static?
drivers/staging/wlan-ng/prism2fw.c:857:5: warning: symbol 'read_fwfile' was not declared. Should it be static?
drivers/staging/wlan-ng/prism2fw.c:981:5: warning: symbol 'writeimage' was not declared. Should it be static?
drivers/staging/wlan-ng/prism2fw.c:1133:5: warning: symbol 'validate_identity' was not declared. Should it be static?

Signed-off-by: Devendra Naga <devendra.aaru@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 023aeaa4 09-Sep-2012 Devendra Naga <devendra.aaru@gmail.com>

staging:wlan-ng: slove sparse warnings

drivers/staging/wlan-ng/prism2fw.c:127:18: warning: symbol 's3data' was not declared. Should it be static?
drivers/staging/wlan-ng/prism2fw.c:130:14: warning: symbol 'ns3plug' was not declared. Should it be static?
drivers/staging/wlan-ng/prism2fw.c:131:18: warning: symbol 's3plug' was not declared. Should it be static?
drivers/staging/wlan-ng/prism2fw.c:134:14: warning: symbol 'ns3crc' was not declared. Should it be static?
drivers/staging/wlan-ng/prism2fw.c:135:17: warning: symbol 's3crc' was not declared. Should it be static?
drivers/staging/wlan-ng/prism2fw.c:138:14: warning: symbol 'ns3info' was not declared. Should it be static?
drivers/staging/wlan-ng/prism2fw.c:139:18: warning: symbol 's3info' was not declared. Should it be static?
drivers/staging/wlan-ng/prism2fw.c:142:5: warning: symbol 'startaddr' was not declared. Should it be static?
drivers/staging/wlan-ng/prism2fw.c:145:14: warning: symbol 'nfchunks' was not declared. Should it be static?
drivers/staging/wlan-ng/prism2fw.c:146:17: warning: symbol 'fchunk' was not declared. Should it be static?
drivers/staging/wlan-ng/prism2fw.c:154:12: warning: symbol 'pda' was not declared. Should it be static?
drivers/staging/wlan-ng/prism2fw.c:155:21: warning: symbol 'nicid' was not declared. Should it be static?
drivers/staging/wlan-ng/prism2fw.c:156:20: warning: symbol 'rfid' was not declared. Should it be static?
drivers/staging/wlan-ng/prism2fw.c:157:20: warning: symbol 'macid' was not declared. Should it be static?
drivers/staging/wlan-ng/prism2fw.c:158:20: warning: symbol 'priid' was not declared. Should it be static?

Signed-off-by: Devendra Naga <devendra.aaru@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# c90e3e80 24-Jun-2012 Randy Dunlap <rdunlap@infradead.org>

staging: reduce stack usage in prism2fw.c

Fix frame size (stack usage) warning by allocating and freeing
pointers to the data.

drivers/staging/wlan-ng/prism2fw.c:1115:1: warning: the frame size of 4288 bytes is larger than 2048 bytes

Signed-off-by: Randy Dunlap <rdunlap@xenotime.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# cf66823d 05-Jun-2012 Devendra Naga <devendra.aaru@gmail.com>

staging/wlan-ng: prsim2fw.c coding style cleanup

this patch fixes the coding style problems found by using checkpatch.pl

drivers/staging/wlan-ng/prism2fw.c:175: ERROR: "foo * bar" should be "foo *bar"
drivers/staging/wlan-ng/prism2fw.c:210: WARNING: line over 80 characters
drivers/staging/wlan-ng/prism2fw.c:596: WARNING: line over 80 characters
drivers/staging/wlan-ng/prism2fw.c:658: ERROR: "foo * bar" should be "foo *bar"

Signed-off-by: Devendra Naga <devendra.aaru@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 23567c75 05-Jun-2011 Joseph Salisbury <salisbury.joseph@googlemail.com>

Staging: wlan-ng: fix brace coding style issue in prism2fw.c

This is a patch to the prism2fw.c file that fixes up a brace
warning found by the checkpatch.pl tool.

Signed-off-by: Joseph Salisbury <salisbury.joseph@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>


# a6f9c48f 12-Mar-2011 Ilia Mirkin <imirkin@alum.mit.edu>

staging: wlan-ng: Remove NULL check before kfree

This patch was generated by the following semantic patch:
// <smpl>
@@ expression E; @@
- if (E != NULL) { kfree(E); }
+ kfree(E);

@@ expression E; @@
- if (E != NULL) { kfree(E); E = NULL; }
+ kfree(E);
+ E = NULL;
// </smpl>

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>


# 3d049431 02-Aug-2010 Edgardo Hames <ehames@gmail.com>

Staging: wlan-ng: remove typedef in p80211hdr.h

This patch removes the only typedef in p80211hdr.h.

Signed-off-by: Edgardo Hames <ehames@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>


# b6bb56e6 02-Aug-2010 Edgardo Hames <ehames@gmail.com>

Staging: wlan-ng: fix checkpatch issues in headers.

This patch fix errors and warnings reported by checkpatch
in p80211meta.h and p80211metstruct.h.

Signed-off-by: Edgardo Hames <ehames@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>


# e0264418 21-Jul-2010 Edgardo Hames <ehames@gmail.com>

Staging: wlan-ng: removed typedef from prism2fw.c

Removed multiple typedef and fixed long lines.

Signed-off-by: Edgardo Hames <ehames@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>


# 7a6cb0d5 13-May-2010 Julia Lawall <julia@diku.dk>

Staging: Use kcalloc or kzalloc

Use kcalloc or kzalloc rather than the combination of kmalloc and memset.

The semantic patch that makes this change is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@@
expression x,y,flags;
statement S;
type T;
@@

x =
- kmalloc
+ kcalloc
(
- y * sizeof(T),
+ y, sizeof(T),
flags);
if (x == NULL) S
-memset(x, 0, y * sizeof(T));

@@
expression x,size,flags;
statement S;
@@

-x = kmalloc(size,flags);
+x = kzalloc(size,flags);
if (x == NULL) S
-memset(x, 0, size);
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>


# a05d08c4 11-May-2010 Zachary Richey <zr.public@gmail.com>

Staging: wlan-ng: Fixed non static functions in prism2fw.c

Fixed non static functions in prism2fw.c

Signed-off-by: Zachary Richey <zr.public@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>


# 5a0e3ad6 24-Mar-2010 Tejun Heo <tj@kernel.org>

include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h

percpu.h is included by sched.h and module.h and thus ends up being
included when building most .c files. percpu.h includes slab.h which
in turn includes gfp.h making everything defined by the two files
universally available and complicating inclusion dependencies.

percpu.h -> slab.h dependency is about to be removed. Prepare for
this change by updating users of gfp and slab facilities include those
headers directly instead of assuming availability. As this conversion
needs to touch large number of source files, the following script is
used as the basis of conversion.

http://userweb.kernel.org/~tj/misc/slabh-sweep.py

The script does the followings.

* Scan files for gfp and slab usages and update includes such that
only the necessary includes are there. ie. if only gfp is used,
gfp.h, if slab is used, slab.h.

* When the script inserts a new include, it looks at the include
blocks and try to put the new include such that its order conforms
to its surrounding. It's put in the include block which contains
core kernel includes, in the same order that the rest are ordered -
alphabetical, Christmas tree, rev-Xmas-tree or at the end if there
doesn't seem to be any matching order.

* If the script can't find a place to put a new include (mostly
because the file doesn't have fitting include block), it prints out
an error message indicating which .h file needs to be added to the
file.

The conversion was done in the following steps.

1. The initial automatic conversion of all .c files updated slightly
over 4000 files, deleting around 700 includes and adding ~480 gfp.h
and ~3000 slab.h inclusions. The script emitted errors for ~400
files.

2. Each error was manually checked. Some didn't need the inclusion,
some needed manual addition while adding it to implementation .h or
embedding .c file was more appropriate for others. This step added
inclusions to around 150 files.

3. The script was run again and the output was compared to the edits
from #2 to make sure no file was left behind.

4. Several build tests were done and a couple of problems were fixed.
e.g. lib/decompress_*.c used malloc/free() wrappers around slab
APIs requiring slab.h to be added manually.

5. The script was run on all .h files but without automatically
editing them as sprinkling gfp.h and slab.h inclusions around .h
files could easily lead to inclusion dependency hell. Most gfp.h
inclusion directives were ignored as stuff from gfp.h was usually
wildly available and often used in preprocessor macros. Each
slab.h inclusion directive was examined and added manually as
necessary.

6. percpu.h was updated not to include slab.h.

7. Build test were done on the following configurations and failures
were fixed. CONFIG_GCOV_KERNEL was turned off for all tests (as my
distributed build env didn't work with gcov compiles) and a few
more options had to be turned off depending on archs to make things
build (like ipr on powerpc/64 which failed due to missing writeq).

* x86 and x86_64 UP and SMP allmodconfig and a custom test config.
* powerpc and powerpc64 SMP allmodconfig
* sparc and sparc64 SMP allmodconfig
* ia64 SMP allmodconfig
* s390 SMP allmodconfig
* alpha SMP allmodconfig
* um on x86_64 SMP allmodconfig

8. percpu.h modifications were reverted so that it could be applied as
a separate patch and serve as bisection point.

Given the fact that I had only a couple of failures from tests on step
6, I'm fairly confident about the coverage of this conversion patch.
If there is a breakage, it's likely to be something in one of the arch
headers which should be easily discoverable easily on most builds of
the specific arch.

Signed-off-by: Tejun Heo <tj@kernel.org>
Guess-its-ok-by: Christoph Lameter <cl@linux-foundation.org>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Lee Schermerhorn <Lee.Schermerhorn@hp.com>


# ef1a0ed7 18-Feb-2010 Andrew Elwell <andrew.elwell@gmail.com>

Staging: wlan-ng - checkpatch.pl fixups

Basic fixups in the staging/wlan-ng directory.
(First kernel patch - thanks to FOSDEM talk)

Signed-off-by: Andrew Elwell <Andrew.Elwell@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>


# 83a0f9bc 25-Feb-2010 Randy Dunlap <randy.dunlap@oracle.com>

Staging: fix wlan-ng printk format warning

Fix prism2fw.c printk format warning:

drivers/staging/wlan-ng/prism2fw.c:209: warning: format '%d' expects type 'int', but argument 3 has type 'size_t'

Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>


# 5dd8acc8 14-Feb-2010 Svenne Krap <svenne@krap.dk>

Staging: wlan-ng: multiple safe style cleanups

Cleanups as suggested by checkpatch.pl utiltiy.
.o's from before and after cleanup have matching SHA1s.

Signed-off-by: Svenne Krap <svenne@krap.dk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>


# 5d929a71 13-Jan-2010 Ben Hutchings <ben@decadent.org.uk>

staging: declare MODULE_FIRMWARE in various drivers

Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>


# 4068fe8b 09-Dec-2009 Julia Lawall <julia@diku.dk>

Staging: wlan-ng: fix Correct size given to memset

Memset should be given the size of the structure, not the size of the pointer.

The semantic patch that makes this change is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@@
type T;
T *x;
expression E;
@@

memset(x, E, sizeof(
+ *
x))
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>


# d8950599 19-Aug-2009 Karl Relton <karllinuxtest.relton@ntlworld.com>

Staging: wlan-ng: Convert firmware loading to load binary ihex format

Convert prism2_usb firmware loading to load firmware in pre-compiled
binary 'ihex' format rather than ascii 'srec' format. This moves the
srec processing and sorting of records out of kernel space into a
pre-compiler. The driver now just works with the binary image, but
still does the 'pda plugging' of that image at runtime, as required
by the prism hardware.

Some Notes:

- The firmware is now expected to be in the same 'ihex' (.fw) format
used by other drivers.

- The now driver assumes the data records are already sorted into ascending
address order.

- Plug and crc records are still recognised by special address locations
as in original srec processing.

- The srec S7 start address record is assumed to have been converted
into a data record with another special address location (0xff400000),
with the original start address being stored as a 4 byte data word
(little endian).

Signed-off-by: Karl Relton <karllinuxtest.relton@ntlworld.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>


# 297f06ce 10-Jun-2009 Mithlesh Thukral <mithlesh@linsyssoft.com>

staging: wlan-ng: scripts/checkpatch.pl error fixes.

scripts/checkpatch.pl error fixes. This is a TODO item.
This patch fixes most of the errors reported by checkpatch.pl in
wlan-ng directory of staging tree.

Signed-off-by: Mithlesh Thukral <mithlesh@linsyssoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>


# 75f49e07 25-May-2009 Mithlesh Thukral <mithlesh@linsyssoft.com>

Staging: wlan-ng: Lindent cleanups

Lindent script cleanups in wlan-ng driver in the staging tree.
This is a item in the TODO list.

Signed-off-by: Mithlesh Thukral <mithlesh@linsyssoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>


# 76e3e7c4 17-Apr-2009 Karl Relton <karllinuxtest.relton@ntlworld.com>

Staging: wlan-ng: Move firmware loading into driver

Move prism2 firmware loading from userspace into driver, using linux
request_firmware(). Firmware is now loaded (if available) on device
probing, before it is registered as a netdevice and advertised to userspace.

Signed-off-by: Karl Relton <karllinuxtest.relton@ntlworld.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>