History log of /linux-master/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_init.c
Revision Date Author Comments
# f8dd2412 07-Dec-2023 Justin Stitt <justinstitt@google.com>

qlcnic: replace deprecated strncpy with strscpy

strncpy() is deprecated for use on NUL-terminated destination strings
[1] and as such we should prefer more robust and less ambiguous string
interfaces.

We expect fw_info->fw_file_name to be NUL-terminated based on its use
within _request_firmware_prepare() wherein `name` refers to it:
| if (firmware_request_builtin_buf(firmware, name, dbuf, size)) {
| dev_dbg(device, "using built-in %s\n", name);
| return 0; /* assigned */
| }
... and with firmware_request_builtin() also via `name`:
| if (strcmp(name, b_fw->name) == 0) {

There is no evidence that NUL-padding is required.

Additionally replace size macro (QLC_FW_FILE_NAME_LEN) with
sizeof(fw_info->fw_file_name) to more directly tie the maximum buffer
size to the destination buffer:

Considering the above, a suitable replacement is `strscpy` [2] due to
the fact that it guarantees NUL-termination on the destination buffer
without unnecessarily NUL-padding.

Link: https://www.kernel.org/doc/html/latest/process/deprecated.html#strncpy-on-nul-terminated-strings [1]
Link: https://manpages.debian.org/testing/linux-manual-4.8/strscpy.9.en.html [2]
Link: https://github.com/KSPP/linux/issues/90
Cc: linux-hardening@vger.kernel.org
Signed-off-by: Justin Stitt <justinstitt@google.com>
Reviewed-by: Kees Cook <keescook@chromium.org>
Signed-off-by: David S. Miller <davem@davemloft.net>


# 13a7c896 22-Dec-2022 Daniil Tatianin <d-tatianin@yandex-team.ru>

qlcnic: prevent ->dcb use-after-free on qlcnic_dcb_enable() failure

adapter->dcb would get silently freed inside qlcnic_dcb_enable() in
case qlcnic_dcb_attach() would return an error, which always happens
under OOM conditions. This would lead to use-after-free because both
of the existing callers invoke qlcnic_dcb_get_info() on the obtained
pointer, which is potentially freed at that point.

Propagate errors from qlcnic_dcb_enable(), and instead free the dcb
pointer at callsite using qlcnic_dcb_free(). This also removes the now
unused qlcnic_clear_dcb_ops() helper, which was a simple wrapper around
kfree() also causing memory leaks for partially initialized dcb.

Found by Linux Verification Center (linuxtesting.org) with the SVACE
static analysis tool.

Fixes: 3c44bba1d270 ("qlcnic: Disable DCB operations from SR-IOV VFs")
Reviewed-by: Michal Swiatkowski <michal.swiatkowski@linux.intel.com>
Signed-off-by: Daniil Tatianin <d-tatianin@yandex-team.ru>
Signed-off-by: David S. Miller <davem@davemloft.net>


# a72dc199 08-Jan-2022 Christophe JAILLET <christophe.jaillet@wanadoo.fr>

qlcnic: Simplify DMA setting

As stated in [1], dma_set_mask() with a 64-bit mask will never fail if
dev->dma_mask is non-NULL.
So, if it fails, the 32 bits case will also fail for the same reason.

So qlcnic_set_dma_mask(), (in qlcnic_main.c) can be simplified a lot and
inlined directly in its only caller.

If dma_set_mask_and_coherent() succeeds, 'pci_using_dac' is known to be 1.
So it can be removed from all the calling chain.

qlcnic_setup_netdev() can finally be simplified as-well.

[1]: https://lkml.org/lkml/2021/6/7/398

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Link: https://lore.kernel.org/r/4996ab0337d62ec6a54b2edf234cd5ced4b4d7ad.1641649611.git.christophe.jaillet@wanadoo.fr
Signed-off-by: Jakub Kicinski <kuba@kernel.org>


# 666eb96d 09-Sep-2021 Colin Ian King <colin.king@canonical.com>

qlcnic: Remove redundant initialization of variable ret

The variable ret is being initialized with a value that is never read, it
is being updated later on. The assignment is redundant and can be removed.

Addresses-Coverity: ("Unused value")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: David S. Miller <davem@davemloft.net>


# 9f2e6fb6 16-May-2021 Yang Shen <shenyang39@huawei.com>

net: calxeda: Fix wrong function name in comments

Fixes the following W=1 kernel build warning(s):

drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_init.c:761: warning: expecting prototype for qlcnic_83xx_idc_cold_state(). Prototype was for qlcnic_83xx_idc_cold_state_handler() instead
drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_vnic.c:192: warning: expecting prototype for qlcnic_83xx_vnic_opmode(). Prototype was for qlcnic_83xx_config_vnic_opmode() instead

Cc: Shahed Shaikh <shshaikh@marvell.com>
Cc: Manish Chopra <manishc@marvell.com>
Signed-off-by: Yang Shen <shenyang39@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>


# 3beb9be1 12-Nov-2020 Zhang Changzhong <zhangchangzhong@huawei.com>

qlcnic: fix error return code in qlcnic_83xx_restart_hw()

Fix to return a negative error code from the error handling
case instead of 0, as done elsewhere in this function.

Fixes: 3ced0a88cd4c ("qlcnic: Add support to run firmware POST")
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Zhang Changzhong <zhangchangzhong@huawei.com>
Link: https://lore.kernel.org/r/1605248186-16013-1-git-send-email-zhangchangzhong@huawei.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>


# 004b26b8 08-Sep-2020 Thomas Gleixner <tglx@linutronix.de>

net/qlcnic: Convert to SPDX license identifiers

All files in this driver directory contain the following notice:

See LICENSE.qlcnic for copyright and licensing details.

LICENSE.qlacnic can be found in
Documentation/networking/device_drivers/qlogic/. The file contains:

- A copyright notice

This copyright notice is redundant as all files contain the same
copyright notice already

- A license notice

You may modify and redistribute the device driver code under the
GNU General Public License (a copy of which is attached hereto as
Exhibit A) published by the Free Software Foundation (version 2).

This can be replaced with the corresponding SPDX license identifier
(GPL-2.0-only) in the source files which reference this license
file.

- The full GPLv2 license text

A redundant copy of LICENSES/preferred/GPL-2.0

Remove the notices and add the SPDX license identifier GPL-2.0-only to the
source files.

Finally remove the now redundant LICENSE.qlcnic file.

Reviewed-by: Richard Fontana <rfontana@redhat.com>
Reviewed-by: Jilayne Lovejoy <opensource@jilayne.com>
Reviewed-by: Alexios Zavras <alexios.zavras@intel.com>
Acked-by: Igor Russkikh <irusskikh@marvell.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Lukas Bulwahn <lukas.bulwahn@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 78c6bc2b 14-Jul-2020 Jakub Kicinski <kuba@kernel.org>

qlcnic: convert to new udp_tunnel_nic infra

Straightforward conversion to new infra, 1 VxLAN port, handler
may sleep.

Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>


# bcaeb886 26-Mar-2020 Xu Wang <vulab@iscas.ac.cn>

qlcnic: Fix bad kzalloc null test

In qlcnic_83xx_get_reset_instruction_template, the variable
of null test is bad, so correct it.

Signed-off-by: Xu Wang <vulab@iscas.ac.cn>
Signed-off-by: David S. Miller <davem@davemloft.net>


# 22e98449 22-Jan-2020 Manish Chopra <manishc@marvell.com>

qlcnic: Fix CPU soft lockup while collecting firmware dump

Driver while collecting firmware dump takes longer time to
collect/process some of the firmware dump entries/memories.
Bigger capture masks makes it worse as it results in larger
amount of data being collected and results in CPU soft lockup.
Place cond_resched() in some of the driver flows that are
expectedly time consuming to relinquish the CPU to avoid CPU
soft lockup panic.

Signed-off-by: Shahed Shaikh <shshaikh@marvell.com>
Tested-by: Yonggen Xu <Yonggen.Xu@dell.com>
Signed-off-by: Manish Chopra <manishc@marvell.com>
Signed-off-by: David S. Miller <davem@davemloft.net>


# 5e44f8e2 16-Jun-2016 Alexander Duyck <aduyck@mirantis.com>

qlcnic: Replace ndo_add/del_vxlan_port with ndo_add/del_udp_enc_port

This change replaces the network device operations for adding or removing a
VXLAN port with operations that are more generically defined to be used for
any UDP offload port but provide a type. As such by just adding a line to
verify that the offload type is VXLAN we can maintain the same
functionality.

Signed-off-by: Alexander Duyck <aduyck@mirantis.com>
Signed-off-by: David S. Miller <davem@davemloft.net>


# 0e90ad9b 07-Aug-2015 Shahed Shaikh <shahed.shaikh@qlogic.com>

qlcnic: Don't use kzalloc unncecessarily for allocating large chunk of memory

Driver allocates a large chunk of temporary buffer using kzalloc
to copy FW image. As there is no real need of this memory to be
physically contiguous, use vzalloc instead.

Signed-off-by: Shahed Shaikh <shahed.shaikh@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>


# 15f1bb1f 29-Jul-2015 Shahed Shaikh <shahed.shaikh@qlogic.com>

qlcnic: Fix corruption while copying

Use proper typecasting while performing byte-by-byte copy

Signed-off-by: Shahed Shaikh <shahed.shaikh@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>


# dbedd44e 06-Mar-2015 Joe Perches <joe@perches.com>

ethernet: codespell comment spelling fixes

To test a checkpatch spelling patch, I ran codespell against
drivers/net/ethernet/.

$ git ls-files drivers/net/ethernet/ | \
while read file ; do \
codespell -w $file; \
done

I removed a false positive in e1000_hw.h

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: David S. Miller <davem@davemloft.net>


# 4324414f 22-Sep-2014 Sony Chacko <sony.chacko@qlogic.com>

qlcnic: Use qlcnic_83xx_flash_read32() API instead of lockless version of the API.

In qlcnic_83xx_setup_idc_parameters() routine use qlcnic_83xx_flash_read32() API
which takes flash lock internally instead of the lockless version
qlcnic_83xx_lockless_flash_read32().

Signed-off-by: Sony Chacko <sony.chacko@qlogic.com>
Signed-off-by: Manish Chopra <manish.chopra@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>


# 3ced0a88 26-Aug-2014 Shahed Shaikh <shahed.shaikh@qlogic.com>

qlcnic: Add support to run firmware POST

This patch adds support to run Power On Self Test (POST) for 83xx adapters.
POST can be run in 3 different speed modes :
i) Fast mode (takes about 690 ms)
ii) Medium mode (takes about 2930 ms)
iii) Slow mode (takes about 7500 ms)

To run POST, firmware file with name "83xx_post_fw.bin" should be present under
/lib/firmware directory. load_fw_file module parameter is used to specify
POST operation and its speed mode.
load_fw_file = 2 : Fast mode
load_fw_file = 3 : Medium mode
load_fw_file = 4 : Slow mode

Signed-off-by: Shahed Shaikh <shahed.shaikh@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>


# 40e2b8ed 26-Aug-2014 Shahed Shaikh <shahed.shaikh@qlogic.com>

qlcnic: Add support for 0x8830 device ID

Signed-off-by: Shahed Shaikh <shahed.shaikh@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>


# 3d8623e6 18-Aug-2014 Shahed Shaikh <shahed.shaikh@qlogic.com>

qlcnic: Fix endianess issue in firmware load from file operation

Firmware binary file is in little endian. On big-endian architecture, while
writing this binary FW file to adapters memory, writel() swaps the data resulting into
corruption of FW image. So, swap the data before writing into adapters memory.

Signed-off-by: Shahed Shaikh <shahed.shaikh@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>


# 8d37ba02 09-May-2014 Shahed Shaikh <shahed.shaikh@qlogic.com>

qlcnic: Collect firmware dump using DMA on 82xx adapters

o Add support to collect RDMEM section of firmware dump
using PEX DMA method.
o This patch uses most of the code used for PEX DMA support
on 83xx series adapters and some refactoring.

Signed-off-by: Shahed Shaikh <shahed.shaikh@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>


# c65762fc 25-Apr-2014 Sucheta Chakraborty <sucheta.chakraborty@qlogic.com>

qlcnic: Add driver logs in error path.

Signed-off-by: Sucheta Chakraborty <sucheta.chakraborty@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>


# 7b546842 14-Apr-2014 Shahed Shaikh <shahed.shaikh@qlogic.com>

qlcnic: Fix max ring count calculation

Do not read max rings count from qlcnic_get_nic_info(). Use driver defined
values for 82xx adapters. In case of 83xx adapters, use minimum of firmware
provided and driver defined values.

Signed-off-by: Shahed Shaikh <shahed.shaikh@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>


# 4d52e1e8 14-Apr-2014 Sucheta Chakraborty <sucheta.chakraborty@qlogic.com>

qlcnic: Fix to send INIT_NIC_FUNC as first mailbox.

o INIT_NIC_FUNC should be first mailbox sent. Sending DCB capability and
parameter query commands after that command.

Signed-off-by: Sucheta Chakraborty <sucheta.chakraborty@qlogic.com>
Signed-off-by: Shahed Shaikh <shahed.shaikh@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>


# 463518a0 14-Apr-2014 Sucheta Chakraborty <sucheta.chakraborty@qlogic.com>

qlcnic: Fix panic due to uninitialzed delayed_work struct in use.

o AEN event was being received before initializing delayed_work struct
and handlers for it. This was resulting in crash. This patch fixes it.

Signed-off-by: Sucheta Chakraborty <sucheta.chakraborty@qlogic.com>
Signed-off-by: Shahed Shaikh <shahed.shaikh@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>


# 7f1f6056 01-Apr-2014 Shahed Shaikh <shahed.shaikh@qlogic.com>

qlcnic: Fix build failure due to undefined reference to `vxlan_get_rx_port'

Commit 2b3d7b758c687("qlcnic: Add VXLAN Rx offload support") uses
vxlan_get_rx_port() which caused build failure when VXLAN=m.

This patch fixes the build failure by adding dependency on VXLAN
in Kconfig of qlcnic module and use vxlan_get_rx_port() and support
code accordingly.

Signed-off-by: Shahed Shaikh <shahed.shaikh@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>


# 4e2e865d 24-Mar-2014 Joe Perches <joe@perches.com>

qlcnic: Remove casts of pointer to same type

Casting a pointer to a pointer of the same type is pointless,
so remove these unnecessary casts.

Done via coccinelle script:

$ cat typecast_2.cocci
@@
type T;
T *foo;
@@

- (T *)foo
+ foo

Signed-off-by: Joe Perches <joe@perches.com>
Acked-by: Shahed Shaikh <shahed.shaikh@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>


# 2b3d7b75 21-Mar-2014 Shahed Shaikh <shahed.shaikh@qlogic.com>

qlcnic: Add VXLAN Rx offload support

This patch adds Rx checksum offload support for VXLAN.
Implements .ndo_{add|del}_vxlan_port netdev ops.
Adapter supports only one VXLAN port, so program adapter with
very first UDP port which VXLAN driver is listening to.

Signed-off-by: Shahed Shaikh <shahed.shaikh@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>


# 95b3890a 23-Jan-2014 Himanshu Madhani <himanshu.madhani@qlogic.com>

qlcnic: Enhance Tx timeout debugging.

o Dump each Tx queue details with all descriptors, queue indices
and Tx queue stats to imporve data colletion in situations
where Tx timeout occurs.

Signed-off-by: Himanshu Madhani <himanshu.madhani@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>


# 72ebe349 23-Jan-2014 Sucheta Chakraborty <sucheta.chakraborty@qlogic.com>

qlcnic: Use bool for rx_mac_learn.

o Use boolean type instead of u8.

Signed-off-by: Sucheta Chakraborty <sucheta.chakraborty@qlogic.com>
Signed-off-by: Jitendra Kalsaria <jitendra.kalsaria@qlogic.com>
Signed-off-by: Himanshu Madhani <himanshu.madhani@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>


# 21041400 16-Jan-2014 stephen hemminger <stephen@networkplumber.org>

qlcnic: make local functions static

Functions only used in one file should be static.
Found by running make namespacecheck

Compile tested only.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Signed-off-by: David S. Miller <davem@davemloft.net>


# b3f7de83 10-Jan-2014 Sucheta Chakraborty <sucheta.chakraborty@qlogic.com>

qlcnic: Do MAC learning for SRIOV PF.

o MAC learning will be done for SRIOV PF to help program VLAN filters
onto adapter. This will help VNIC traffic to flow through without
flooding traffic.

Signed-off-by: Sucheta Chakraborty <sucheta.chakraborty@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>


# 9b0fff2a 17-Dec-2013 Sucheta Chakraborty <sucheta.chakraborty@qlogic.com>

qlcnic: Refactor initialize nic code path.

o Change function name from qlcnic_83xx_register_nic_idc_func to
qlcnic_83xx_initialize_nic

Signed-off-by: Sucheta Chakraborty <sucheta.chakraborty@qlogic.com>
Signed-off-by: Manish Chopra <manish.chopra@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>


# 3c44bba1 17-Dec-2013 Sucheta Chakraborty <sucheta.chakraborty@qlogic.com>

qlcnic: Disable DCB operations from SR-IOV VFs.

o These operations will be supported only through PFs (SR-IOV and non-SR-IOV).

Signed-off-by: Sucheta Chakraborty <sucheta.chakraborty@qlogic.com>
Signed-off-by: Manish Chopra <manish.chopra@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>


# 30fa15f6 16-Dec-2013 Manish Chopra <manish.chopra@qlogic.com>

qlcnic: Allow firmware dump collection when auto firmware recovery is disabled

o Allow driver to collect firmware dump, during a forced firmware dump
operation, when auto firmware recovery is disabled. Also, during this
operation, driver should not allow reset recovery to be performed.

Signed-off-by: Manish Chopra <manish.chopra@qlogic.com>
Signed-off-by: Himanshu Madhani <himanshu.madhani@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>


# 3fc38e26 16-Dec-2013 Manish Chopra <manish.chopra@qlogic.com>

qlcnic: Fix memory allocation

o Use vzalloc() instead of kzalloc() for allocation of
bootloader size memory. kzalloc() may fail to allocate
the size of bootloader

Signed-off-by: Manish Chopra <manish.chopra@qlogic.com>
Signed-off-by: Himanshu Madhani <himanshu.madhani@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>


# f9566265 16-Dec-2013 Himanshu Madhani <himanshu.madhani@qlogic.com>

qlcnic: Fix TSS/RSS ring validation logic.

o TSS/RSS ring validation does not take into account that either
of these ring values can be 0. This patch fixes this validation
and would fail set_channel operation if any of these ring value
is 0. This regression was added as part of commit id
34e8c406fda5b5a9d2e126a92bab84cd28e3b5fa ("qlcnic: refactor Tx/SDS
ring calculation and validation in driver.")

Signed-off-by: Himanshu Madhani <himanshu.madhani@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>


# 18afc102 04-Nov-2013 Himanshu Madhani <himanshu.madhani@qlogic.com>

qlcnic: Enable multiple Tx queue support for 83xx/84xx Series adapters.

o 83xx and 84xx firmware is capable of multiple Tx queues.
This patch will enable multiple Tx queues for 83xx/84xx
series adapters. Max number of Tx queues supported will be 8.

Signed-off-by: Himanshu Madhani <himanshu.madhani@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>


# 34e8c406 04-Nov-2013 Himanshu Madhani <himanshu.madhani@qlogic.com>

qlcnic: refactor Tx/SDS ring calculation and validation in driver.

o Current driver has duplicate code for validating user input
for changing Tx/SDS rings using set_channel ethtool interface.
This patch removes duplicate code and refactored Tx/SDS ring
validation for 82xx/83xx/84xx series adapter.
o Refactored code now calculates maximum Tx/Rx ring driver can
support based on Default, NPAR and SRIOV PF/VF mode of driver.

Signed-off-by: Himanshu Madhani <himanshu.madhani@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>


# 78ea2d97 04-Nov-2013 Sucheta Chakraborty <sucheta.chakraborty@qlogic.com>

qlcnic: Register netdev in FAILED state for 83xx/84xx

o Without failing probe, register netdev when device is in FAILED state.
o Device will come up with minimum functionality and allow diagnostics and
repair of the adapter.

Signed-off-by: Sucheta Chakraborty <sucheta.chakraborty@qlogic.com>
Signed-off-by: Himanshu Madhani <himanshu.madhani@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>


# 1de899d3 17-Oct-2013 Sucheta Chakraborty <sucheta.chakraborty@qlogic.com>

qlcnic: dcb code cleanup and refactoring.

o Move dcb specific function definitions to dcb files.
o Move dcb specific variables to qlcnic_dcb structure.

Signed-off-by: Sucheta Chakraborty <sucheta.chakraborty@qlogic.com>
Signed-off-by: Himanshu Madhani <himanshu.madhani@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>


# 891e71b1b 17-Oct-2013 Pratik Pujar <pratik.pujar@qlogic.com>

qlcnic: Firmware dump collection when auto recovery is disabled.

o Allow collecting the firmware dump of halted firmware when auto
recovery is disabled.

Signed-off-by: Pratik Pujar <pratik.pujar@qlogic.com>
Signed-off-by: Himanshu Madhani <himanshu.madhani@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>


# 35dafcb0 30-Aug-2013 Sony Chacko <sony.chacko@qlogic.com>

qlcnic: Add support for per port eswitch configuration

There is an embedded switch per physical port on the adapter.
Add support for enabling and disabling the embedded switch
on per port basis.

Signed-off-by: Sony Chacko <sony.chacko@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>


# 7000078a 30-Aug-2013 Pratik Pujar <pratik.pujar@qlogic.com>

qlcnic: Restructuring of qlc_83xx_fw_info structure.

o Removed unused and unnecessary members from qlc_83xx_fw_info
structure.
o Made fw_info member of qlcnic_hardware_context as a pointer to
qlc_83xx_fw_info structure.
o Added a member fw_file_name to qlc_83xx_fw_info structure which
will hold the name of firmware image file name.

Signed-off-by: Pratik Pujar <pratik.pujar@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>


# 9ce226fa 30-Aug-2013 Pratik Pujar <pratik.pujar@qlogic.com>

qlcnic: Add AER support for 83xx adapter

Signed-off-by: Pratik Pujar <pratik.pujar@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>


# 60dcbcb0 30-Aug-2013 Manish Chopra <manish.chopra@qlogic.com>

qlcnic: Remove inline keyword

o Remove inline keyword from function prototypes wherever it is not appropriate.

Signed-off-by: Manish Chopra <manish.chopra@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>


# 14d385b9 23-Aug-2013 Sucheta Chakraborty <sucheta.chakraborty@qlogic.com>

qlcnic: dcb: Query adapter DCB capabilities.

o Query adapter DCB capabilities and populate local data structures
with relevant information.

o Add QLCNIC_DCB to Kconfig for enabling/disabling DCB.

Signed-off-by: Sucheta Chakraborty <sucheta.chakraborty@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>


# aa4a1f7d 21-Aug-2013 Himanshu Madhani <himanshu.madhani@qlogic.com>

qlcnic: Enable Tx queue changes using ethtool for 82xx Series adapter.

o using ethtool {set|get}_channel option, user can change number
of Tx queues for 82xx Series adapter.
o updated ethtool -S <ethX> option to display stats from each Tx queue.

Signed-off-by: Himanshu Madhani <himanshu.madhani@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>


# fef349ce 16-Aug-2013 Pratik Pujar <pratik.pujar@qlogic.com>

qlcnic: Add support for 84xx adapters to load firmware from file

o Use appropriate firmware image file name based on device IDs.

Signed-off-by: Pratik Pujar <pratik.pujar@qlogic.com>
Signed-off-by: Himanshu Madhani <himanshu.madhani@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>


# b5acb255 15-Aug-2013 Manish Chopra <manish.chopra@qlogic.com>

qlcnic: Fix driver initialization for 83xx adapters

o Load firmware from file before setting up interrupts.

Signed-off-by: Manish Chopra <manish.chopra@qlogic.com>
Signed-off-by: Sucheta Chakraborty <sucheta.chakraborty@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>


# 24866d15 15-Aug-2013 Himanshu Madhani <himanshu.madhani@qlogic.com>

qlcnic: Fix set driver version command

Driver was issuing set driver version command through all
functions in the adapter. Fix the driver to issue set driver
version once per adapter, through function 0.

Signed-off-by: Himanshu Madhani <himanshu.madhani@qlogic.com>
Signed-off-by: Sucheta Chakraborty <sucheta.chakraborty@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>


# 4bd8e738 02-Aug-2013 Himanshu Madhani <himanshu.madhani@qlogic.com>

qlcnic: Fix for flash update failure on 83xx adapter

Flash update routine was improperly checking register read API return value.
Modify register read API and perform proper error check.

Signed-off-by: Himanshu Madhani <himanshu.madhani@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>


# 068a8d19 01-Aug-2013 Manish Chopra <manish.chopra@qlogic.com>

qlcnic: Replace poll mode mailbox interface with interrupt based mailbox interface

Signed-off-by: Manish Chopra <manish.chopra@qlogic.com>
Signed-off-by: Himanshu Madhani <himanshu.madhani@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>


# e5c4e6c6 01-Aug-2013 Manish Chopra <manish.chopra@qlogic.com>

qlcnic: Interrupt based driver firmware mailbox mechanism

o Driver firmware mailbox interface was operating in polling mode
because of limitations with the earlier versions of 83xx adapter firmware.
These issues are resolved and we are implementing interrupt based mailbox
mechanism.

o Data structures and API's for interrupt mode mailbox mechanism.

Signed-off-by: Manish Chopra <manish.chopra@qlogic.com>
Signed-off-by: Himanshu Madhani <himanshu.madhani@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>


# c70a3175 26-Jul-2013 Jitendra Kalsaria <jitendra.kalsaria@qlogic.com>

qlcnic: Fix initialization of work function.

Work function needs to be initialized before we participate in
inter device communication (IDC).

Signed-off-by: Jitendra Kalsaria <jitendra.kalsaria@qlogic.com>
Signed-off-by: Himanshu Madhani <himanshu.madhani@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>


# 486a5bc7 22-Jun-2013 Rajesh Borundia <rajesh.borundia@qlogic.com>

qlcnic: Add support for 83xx suspend and resume.

o Implement shutdown and resume handlers for 83xx.
o Refactor 82xx shutdown and resume handlers.

Signed-off-by: Rajesh Borundia <rajesh.borundia@qlogic.com>
Signed-off-by: Jitendra Kalsaria <jitendra.kalsaria@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>


# 8af3f33d 22-Jun-2013 Pratik Pujar <pratik.pujar@qlogic.com>

qlcnic: Add support for 'set driver version' in 83XX

Issue 'set driver version' during driver load and after reset recovery
to notify the driver version to the firmware.

Signed-off-by: Pratik Pujar <pratik.pujar@qlogic.com>
Signed-off-by: Jitendra Kalsaria <jitendra.kalsaria@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>


# b6b4316c 22-Jun-2013 Shahed Shaikh <shahed.shaikh@qlogic.com>

qlcnic: Handle qlcnic_alloc_mbx_args() failure

qlcnic_alloc_mbx_args() may fail due to failure in memory allocation.
This patch checks for failure of qlcnic_alloc_mbx_args() to avoid
potential invalid memory access.

Signed-off-by: Shahed Shaikh <shahed.shaikh@qlogic.com>
Signed-off-by: Jitendra Kalsaria <jitendra.kalsaria@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>


# 099907fa 23-May-2013 Sony Chacko <sony.chacko@qlogic.com>

qlcnic: modify reset recovery path in diag mode

Provide diagnostics routines enough time to unwind before
proceeding with reset recovery.

Signed-off-by: Sony Chacko <sony.chacko@qlogic.com>
Signed-off-by: Shahed Shaikh <shahed.shaikh@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>


# 0ce54ce4 21-May-2013 Sony Chacko <sony.chacko@qlogic.com>

qlcnic: remove netdev->trans_start updates within the driver

Code is removed because netdev->trans_start updates made by the driver
will be ignored by the kernel.

Signed-off-by: Sony Chacko <sony.chacko@qlogic.com>
Signed-off-by: Shahed Shaikh <shahed.shaikh@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>


# 536faa61 09-May-2013 Sony Chacko <sony.chacko@qlogic.com>

qlcnic: Fix reset recovery after transmit timeout

o When transmit timeout happens, recovery attempt should start with
adapter soft reset. If soft reset fails to resume traffic, firmware
dump will be collected and driver will perform a hard reset of the
adapter. Reset recovery on 83xx was failing after a hard reset.
This patch fixes that issue.

Signed-off-by: Sony Chacko <sony.chacko@qlogic.com>
Signed-off-by: Shahed Shaikh <shahed.shaikh@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>


# c0d79cd0 23-Apr-2013 Manish Chopra <manish.chopra@qlogic.com>

qlcnic: Take EPORT out of reset sequence before disabling PAUSE

o Disabling PAUSE requires access to EPORT registers,
which may cause a wedge, if EPORT is in reset.

Signed-off-by: Manish Chopra <manish.chopra@qlogic.com>
Signed-off-by: Shahed Shaikh <shahed.shaikh@qlogic.com>
Signed-off-by: Jitendra Kalsaria <jitendra.kalsaria@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>


# f036e4f4 19-Apr-2013 Rajesh Borundia <rajesh.borundia@qlogic.com>

qlcnic: VF reset recovery implementation.

o Implement recovery mechanism for VF to recover from
adapter resets.

Signed-off-by: Manish Chopra <manish.chopra@qlogic.com>
Signed-off-by: Sucheta Chakraborty <sucheta.chakraborty@qlogic.com>
Signed-off-by: Rajesh Borundia <rajesh.borundia@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>


# f8468331 28-Mar-2013 Rajesh Borundia <rajesh.borundia@qlogic.com>

qlcnic: SR-IOV VF probe

o Add PCI device entry for VF.
o Add HW operations for VF.

Signed-off-by: Manish Chopra <manish.chopra@qlogic.com>
Signed-off-by: Sucheta Chakraborty <sucheta.chakraborty@qlogic.com>
Signed-off-by: Rajesh Borundia <rajesh.borundia@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>


# 02feda17 28-Mar-2013 Rajesh Borundia <rajesh.borundia@qlogic.com>

qlcnic: Support SR-IOV enable and disable

o Add QLCNIC_SRIOV to Kconfig.
o Provide PCI sysfs hooks to enable and disable SR-IOV.
o Allow enabling only when CONFIG_QLCNIC_SRIOV is defined.
o qlcnic_sriov_pf.c has all the PF related SR-IOV
functionality.
o qlcnic_sriov_common.c has VF functionality and SR-IOV
functionality which is common between VF and PF.
o qlcnic_sriov.h is a common header file for SR-IOV defines.

Signed-off-by: Manish Chopra <manish.chopra@qlogic.com>
Signed-off-by: Sucheta Chakraborty <sucheta.chakraborty@qlogic.com>
Signed-off-by: Rajesh Borundia <rajesh.borundia@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>


# a96227e6 08-Mar-2013 Shahed Shaikh <shahed.shaikh@qlogic.com>

qlcnic: Fix endian issues in 83xx driver

o Split mailbox structure elements on boundary of adapter
register size i.e. 32bit.
o Shuffle the position of structure elements based on CPU endianness.

Signed-off-by: Shahed Shaikh <shahed.shaikh@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>


# 8e29965d 21-Feb-2013 Manish Chopra <manish.chopra@qlogic.com>

qlcnic: Fix configure interrupts for 83xx adapter types

Signed-off-by: Manish Chopra <manish.chopra@qlogic.com>
Signed-off-by: Jitendra Kalsaria <jitendra.kalsaria@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>


# d5fcff04 09-Feb-2013 Himanshu Madhani <himanshu.madhani@qlogic.com>

qlcnic: fix initialize NIC mailbox command

Register for firmware based Inter Driver Communication (IDC) using initialize
NIC as the first mailbox command

Signed-off-by: Himanshu Madhani <himanshu.madhani@qlogic.com>
Signed-off-by: Jitendra Kalsaria <jitendra.kalsaria@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>


# 577ae39d 03-Feb-2013 Jitendra Kalsaria <jitendra.kalsaria@qlogic.com>

qlcnic: Updating copyright information.

We recently refactored the driver source, this patch will take care of
updating copyright date and adding it to newly added files.

Signed-off-by: Jitendra Kalsaria <jitendra.kalsaria@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>


# b2adaca9 03-Feb-2013 Joe Perches <joe@perches.com>

ethernet: Remove unnecessary alloc/OOM messages, alloc cleanups

alloc failures already get standardized OOM
messages and a dump_stack.

Convert kzalloc's with multiplies to kcalloc.
Convert kmalloc's with multiplies to kmalloc_array.
Fix a few whitespace defects.
Convert a constant 6 to ETH_ALEN.
Use parentheses around sizeof.
Convert vmalloc/memset to vzalloc.
Remove now unused size variables.

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: David S. Miller <davem@davemloft.net>


# 4e60ac46 31-Dec-2012 Sony Chacko <sony.chacko@qlogic.com>

qlcnic: 83xx register dump routines

Add 83xx register dump routines
Update 82xx register dump routines

Signed-off-by: Anirban Chakraborty <anirban.chakraborty@qlogic.com>
Signed-off-by: Rajesh Borundia <rajesh.borundia@qlogic.com>
Signed-off-by: Sritej Velaga <sritej.velaga@qlogic.com>
Signed-off-by: Sony Chacko <sony.chacko@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>


# d71170fb 31-Dec-2012 Sony Chacko <sony.chacko@qlogic.com>

qlcnic: enable 83xx virtual NIC mode

Enable 83xx virtual NIC mode

Signed-off-by: Rajesh Borundia <rajesh.borundia@qlogic.com>
Signed-off-by: Sony Chacko <sony.chacko@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>


# 81d0aeb0 31-Dec-2012 Sony Chacko <sony.chacko@qlogic.com>

qlcnic: flash template based firmware reset recovery

Flash template provides instructions to stop, restart and initalize the
firmware. These instructions are abstracted as a series of read, write and
poll operations on hardware registers. Register information and operation
specifics are not exposed to the driver. Driver reads the template from
flash and executes the instructions located at pre-defined offsets.

Template based firmware reset recovery and initialization mechanism minimize
driver changes as firmware evolves.

Signed-off-by: Sony Chacko <sony.chacko@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>


# 629263ac 31-Dec-2012 Sony Chacko <sony.chacko@qlogic.com>

qlcnic: 83xx CNA inter driver communication mechanism

Inter Driver Communication (IDC) module.
CNA function drivers(ISCSI, FCOE and NIC) which shares the adapter
relies on IDC mechanism for gracefull shut down, restart and
firmware error recovery.

Signed-off-by: Rajesh Borundia <rajesh.borundia@qlogic.com>
Signed-off-by: Sucheta Chakraborty <sucheta.chakraborty@qlogic.com>
Signed-off-by: Sony Chacko <sony.chacko@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>