Commit Graph

248 Commits (7e005f79791dcd58436c88ded4a7f5aed1b82147)

Author SHA1 Message Date
Eilon Greenstein c4ff7cbf88 bnx2x: Adding FW mailbox mutex
DCC commands are not protected with the RTNL lock, so a mutex should be added

Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-10-15 00:18:27 -07:00
Eilon Greenstein f34d28ea01 bnx2x: Changing the Disabled state to a flag
When working with DCC, a function can be disabled or enabled (virtual link down
or up). Using the function state introduced some race conditions with the
load/unload flow.
Using a separate flag to indicate that the function is disabled.

Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-10-15 00:18:08 -07:00
Eilon Greenstein b015e3d112 bnx2x: Allowing 0 as initial fairness value
Value of zero was used to disable the fairness mechanism. Though the code
(driver and FW) allowed changing the value at run time, it did not allow to do
that if the mechanism was disabled to begin with.
Fixed the FW to allow turning on and off the mechanism at run time. Fixed the
code to read the value from the chip at the right sequence.
Without this fix, if the initial value was set to zero, traffic could not run on
the interface.

Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-10-15 00:17:20 -07:00
Michael Chan 993ac7b518 bnx2x: Add main CNIC interface functions.
Add the main CNIC registration, callback, MAC addr. setup functions.

Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: Shmulik Ravid - Rabinovitz <shmulikr@broadcom.com>
Acked-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-10-11 23:30:14 -07:00
Michael Chan 37b091bacb bnx2x: Add hw init code to support iSCSI.
Add code to initialize hardware blocks used for iSCSI.

Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: Shmulik Ravid - Rabinovitz <shmulikr@broadcom.com>
Acked-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-10-11 23:30:13 -07:00
Michael Chan e665bfda5b bnx2x: Refactor MAC address setup code.
For iSCSI MAC address setup in later patches.

Signed-off-by: Shmulik Ravid - Rabinovitz <shmulikr@broadcom.com>
Signed-off-by: Michael Chan <mchan@broadcom.com>
Acked-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-10-11 23:30:11 -07:00
Michael Chan 2891290219 bnx2x: Refactor bnx2x_sp_post().
Some of the SPQ (slow-path queue) operations will be used
by the cnic code in later patches.

Signed-off-by: Shmulik Ravid - Rabinovitz <shmulikr@broadcom.com>
Signed-off-by: Michael Chan <mchan@broadcom.com>
Acked-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-10-11 23:30:09 -07:00
Ben Hutchings 15f0a394c6 net: Convert ethtool {get_stats, self_test}_count() ops to get_sset_count()
These string query operations were supposed to be replaced by the
generic get_sset_count() starting in 2007.  Convert the remaining
implementations.

Also remove calls to these operations to initialise drvinfo->n_stats.
The ethtool core code already does that.

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Acked-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-10-05 00:10:10 -07:00
Stephen Hemminger 0fc0b732ea netdev: drivers should make ethtool_ops const
No need to put ethtool_ops in data, they should be const.

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-09-02 01:03:33 -07:00
Stephen Hemminger 61357325f3 netdev: convert bulk of drivers to netdev_tx_t
In a couple of cases collapse some extra code like:
   int retval = NETDEV_TX_OK;
   ...
   return retval;
into
   return NETDEV_TX_OK;

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-09-01 01:14:07 -07:00
Eilon Greenstein c458bc50e3 bnx2x: update version to 1.52.1
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-08-12 23:03:02 -07:00
Eilon Greenstein ab6ad5a487 bnx2x: Whitespaces and comments
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-08-12 23:03:01 -07:00
Eilon Greenstein 573f203574 bnx2x: Re-factor the initialization code
Moving the code to a more logical place and beautifying it. No real change in
behavior.

Signed-off-by: Vladislav Zolotarov <vladz@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-08-12 23:02:59 -07:00
Eilon Greenstein e4ed711337 bnx2x: Using PCI_DEVICE macro
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-08-12 23:02:58 -07:00
Eilon Greenstein 0fc5d0094d bnx2x: Adding explicit casting
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-08-12 23:02:58 -07:00
Eilon Greenstein 659bc5c4f2 bnx2x: Using macro for phy address
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-08-12 23:02:57 -07:00
Eilon Greenstein 8924665a7d bnx2x: Missing smp_wmb for statistics state machine
Signed-off-by: Vladislav Zolotarov <vladz@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-08-12 23:02:55 -07:00
Eilon Greenstein 54016b260e bnx2x: Check unzip return code
Without this check, when running out of memory, we will see PSOD's in
bnx2x_init_fill() when doing a memset().  This is because at that time,
bp->gunzip_buf is not pointing to a valid allocated space.

Signed-off-by: Benjamin Li <benli@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-08-12 23:02:53 -07:00
Eilon Greenstein 5ff7b6d4c1 bnx2x: Remove the init_dmae field from bp
Moved the dmae_command from the heap to the stack.  This will save 56
bytes per bnx2x structure.   As a side benefit, we can also reduce the
time the dmae_mutex is held.  This is because do we not need to hold
this mutex when setting up the dmae command.  The memory where is dmae
command is stored is not a shared resource and doesn not need to be
protected.

Signed-off-by: Benjamin Li <benli@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-08-12 23:02:53 -07:00
Eilon Greenstein 0d28e49a26 bnx2x: Updating regdump_len at drvinfo
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-08-12 23:02:52 -07:00
Eilon Greenstein 938cf5416d bnx2x: Move printing of version from probe to the init
Move printing of version from probe to the init function
Rather then checking if this is the first module probe call to print
the version of the driver only once, the statement is moved to the init
function of the module where init is only called once

Signed-off-by: Benjamin Li <benli@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-08-12 23:02:51 -07:00
Eilon Greenstein 37f9ce6231 bnx2x: Combine get_pcie_width and get_pcie_speed
The functions bnx2x_get_pcie_width() and bnx2x_get_pcie_speed() were
combined into bnx2x_get_pcie_width_speed() so that there is only
1 PCI read to PCICFG_OFFSET + PCICFG_LINK_CONTROL rather then 2 reads.

Signed-off-by: Benjamin Li <benli@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-08-12 23:02:50 -07:00
Eilon Greenstein e3553b29c6 bnx2x: Stop loading if error condition detected
Signed-off-by: Benjamin Li <benli@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-08-12 23:02:48 -07:00
Eilon Greenstein df4770de03 bnx2x: Calling pci_set_drvdata earlier
In case of error, bnx2x_init_dev calls pci_set_drvdata(pdev, NULL)

Signed-off-by: Yitchak Gertner <gertner@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-08-12 23:02:45 -07:00
Eilon Greenstein a18f512882 bnx2x: Configurable pause scheme
When a given ring is running out of space, the FW can send pause towards the
network. When working with multi-queues, when one queue is getting out of space
it can block all other queues. The preferred scheme is to send pause frames only
when running out of the shared internal chip buffers and if a given queue cannot
place a packet on the host, it will drop it. Since some users might want to work
in drop-less mode, allowing changing the behavior as a module parameter.

Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-08-12 23:02:42 -07:00
Eilon Greenstein a119a06934 bnx2x: Adding Likely directive
Signed-off-by: Vladislav Zolotarov <vladz@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-08-12 23:02:41 -07:00
Eilon Greenstein 619e7a66b5 bnx2x: Prefetch the page containing the BD descriptor
Signed-off-by: Vladislav Zolotarov <vladz@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-08-12 23:02:39 -07:00
Eilon Greenstein 6fe49bb978 bnx2x: Reporting host statistics to management FW
This is required for NCSI statistics

Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-08-12 23:02:38 -07:00
Eilon Greenstein f57a60256d bnx2x: Supporting PHY FW upgrade
There are 3 operations that the driver needs to support to allow applications to
access the PHY FW (on top of the MDC/MDIO access). Since those are essentially
nvram access commands, adding them to the ethtool -E interface.

Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-08-12 23:02:32 -07:00
Eilon Greenstein 01cd452846 bnx2x: MDC/MDIO CL45 IOCTLs
As suggested by Ben Hutchings <bhutchings@solarflare.com>, using the MDC/MDIO
IOCTL

Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-08-12 23:02:29 -07:00
Eilon Greenstein 0c59327043 bnx2x: Advertize flow control normally in MF mode
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-08-12 23:02:15 -07:00
Eilon Greenstein 2691d51d72 bnx2x: Supporting Device Control Channel
In multi-function mode, the FW can receive special management control commands
to set the Min/Max BW and the the function link state

Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-08-12 23:02:12 -07:00
Eilon Greenstein ca00392cb8 bnx2x: Using the new FW
The new FW improves the packets per second rate. It required a lot of change in
the FW which implies many changes in the driver to support it. It is now also
possible for the driver to use a separate MSI-X vector for Rx and Tx - this also
add some to the complicity of this change.

All things said - after this patch, practically all performance matrixes show
improvement.
Though Vladislav Zolotarov is not signed on this patch, he did most of the job
and deserves credit for that.

Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-08-12 22:53:28 -07:00
David S. Miller aa11d958d1 Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
Conflicts:
	arch/microblaze/include/asm/socket.h
2009-08-12 17:44:53 -07:00
Dean Nelson 07ce50e434 bnx2x: return PCI_ERS_RESULT_DISCONNECT on permanent failure
PCI drivers that implement the struct pci_error_handlers' error_detected
callback should return PCI_ERS_RESULT_DISCONNECT if the state passed in is
pci_channel_io_perm_failure. This patch fixes the issue for bnx2x.

Signed-off-by: Dean Nelson <dnelson@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-08-01 23:11:53 -07:00
Eilon Greenstein 573dd788cc bnx2x: Version 1.48.114-1
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-07-30 12:19:28 -07:00
Eilon Greenstein 7d0446c234 bnx2x: WoL only with current MAC address
In some cases with 57711E, depending on the functions unload sequence, other
functions MAC address could have been used to wake the system as well. Make sure
to block all but the current function if WoL is required by changing the mode
to single function WoL.

Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-07-30 12:19:25 -07:00
Eilon Greenstein c1f1a06f92 bnx2x: Self-test kills management traffic
Self test used to play with the management FIFO possibly while management was
running...

Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-07-30 12:19:21 -07:00
Eilon Greenstein 581ce43d26 bnx2x: Receive traffic that maches management filtering rules
Due to lack of configuration, if the BMC configures the chip to pass all
broadcast/multicast traffic to it, the host will not receive it. On top of
fixing it, also make sure that in promiscuous mode, the host will receive the
management traffic as well.

Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-07-30 12:19:20 -07:00
Eric Dumazet 7d073c68a4 bnx2x: Dont update vlan_features in bnx2x_set_tso()
Patrick said : "vlan_features doesn't need to be updated, the resulting
dev->features of the VLAN device is computed as the intersection of
dev->features and dev->vlan_features."

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Acked-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-07-26 19:25:45 -07:00
Eilon Greenstein e8834a63bd bnx2x: Version 1.48.113-1
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-07-21 11:18:32 -07:00
Eilon Greenstein 4d295db0ef bnx2x: Supporting BCM8727 PHY
Adding support for BCM8727 - a dual port SFP+ PHY. That includes verification of
the optic module vendor and part number - the list of approved modules resides
on the nvram and the module is verified by the FW. Since not all users would
like to use this verification feature, it can be disabled. The default behavior
is to issue a warning if the module is not approved, but still allow using it -
but it is also possible to disable the link if the module is not approved.

Signed-off-by: Yaniv Rosner <yanivr@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-07-21 11:18:30 -07:00
Eilon Greenstein 5316bc0b9a bnx2x: Update vlan_features
As noted by Or Gerlitz <ogerlitz@Voltaire.com>, the vlan_features was not
updated

Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-07-21 11:18:29 -07:00
Eilon Greenstein e15107065d bnx2x: SMP-safe inter_sem
Signed-off-by: Vlad Zolotarov <vladz@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-07-21 11:18:29 -07:00
Eilon Greenstein 37dbbf32a0 bnx2x: Adding some mmiowb
Signed-off-by: Vlad Zolotarov <vladz@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-07-21 11:18:28 -07:00
Eilon Greenstein eb8da205a6 bnx2x: Fan failure early detection
Check if fan failure happened before the driver was loaded and notify the user

Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-07-21 11:18:27 -07:00
Eilon Greenstein fd4ef40d59 bnx2x: Fan failure
Setup fan failure for different PHY types or according to nvram settings

Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-07-21 11:18:26 -07:00
Eilon Greenstein 279abdf59c bnx2x: Stop management traffic in loopback test
Since management traffic cannot go on the wire while configured to loopback,
simply stop it to avoid race condition when the MAC is set to loopback in the
middle of a packet

Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-07-21 11:18:26 -07:00
Joe Perches ad361c9884 Remove multiple KERN_ prefixes from printk formats
Commit 5fd29d6ccb ("printk: clean up
handling of log-levels and newlines") changed printk semantics.  printk
lines with multiple KERN_<level> prefixes are no longer emitted as
before the patch.

<level> is now included in the output on each additional use.

Remove all uses of multiple KERN_<level>s in formats.

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-07-08 10:30:03 -07:00
Eilon Greenstein 1e9d998759 bnx2x: Fix the maximal values of coalescing timeouts.
This patch properly defines the maximum values for rx/tx coalescing timeouts.

Signed-off-by: Vlad Zolotarov <vladz@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-07-05 18:03:23 -07:00
Eilon Greenstein 3799cf47e3 bnx2x: Disable HC coalescing when setting timeout to zero.
Problem reported by Flavio Leitner <fleitner@redhat.com>:
When setting rx/tx coalescing timeout to the values less than 12 traffic was
stopped.

The FW supports coalescing in 12us granularity, and so value of less then 12
should be interpreted as disabling coalescing

Signed-off-by: Vlad Zolotarov <vladz@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-07-05 18:03:20 -07:00
Naohiro Ooiwa 01e5329814 bnx2x: Fix the behavior of ethtool when ONBOOT=no
This is the same fix as commit
7959ea254e ("bnx2: Fix the behavior of
ethtool when ONBOOT=no"), but for bnx2x:

--------------------
    When configure in ifcfg-eth* is ONBOOT=no,
    the behavior of ethtool command is wrong.
    
        # grep ONBOOT /etc/sysconfig/network-scripts/ifcfg-eth2
        ONBOOT=no
        # ethtool eth2 | tail -n1
                Link detected: yes
    
    I think "Link detected" should be "no".
--------------------

Signed-off-by: Naohiro Ooiwa <nooiwa@miraclelinux.com>
Acked-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-06-30 12:44:19 -07:00
Eric Dumazet 28679751a9 net: dont update dev->trans_start in 10GB drivers
Followup of commits 9d21493b4b
and 08baf56108
(net: tx scalability works : trans_start)
(net: txq_trans_update() helper)

Now that core network takes care of trans_start updates, dont do it
in drivers themselves, if possible. Multi queue drivers can
avoid one cache miss (on dev->trans_start) in their start_xmit()
handler.

Exceptions are NETIF_F_LLTX drivers (vxge & tehuti)

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-05-29 01:46:26 -07:00
Stanislaw Gruszka 17cb4006bc bnx2x: do not return negative number of received packages
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Acked-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-05-08 14:52:04 -07:00
Stanislaw Gruszka dd21ca6de7 bnx2x: free workqueue when driver fail to register
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Acked-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-05-08 14:52:03 -07:00
Vladislav Zolotarov 56ed4351c2 bnx2x: driver version 1.48.105-1
Signed-off-by: Vladislav Zolotarov <vladz@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-04-27 03:28:25 -07:00
Vladislav Zolotarov 94a78b79cb bnx2x: Separated FW from the source.
>From now on FW will be downloaded from the binary file using request_firmware.

There will be different files for every supported chip. Currently 57710 (e1) and
57711 (e1h).

File names have the following format: bnx2x-<chip version>-<FW version>.fw.
ihex versions of current FW files are submitted in the next patch.

Each binary file has a header in the following format:


struct bnx2x_fw_file_section {
	__be32 len;
	__be32 offset;
}

struct bnx2x_fw_file_hdr {
	struct bnx2x_fw_file_section init_ops;
	struct bnx2x_fw_file_section init_ops_offsets;
	struct bnx2x_fw_file_section init_data;
	struct bnx2x_fw_file_section tsem_int_table_data;
	struct bnx2x_fw_file_section tsem_pram_data;
	struct bnx2x_fw_file_section usem_int_table_data;
	struct bnx2x_fw_file_section usem_pram_data;
	struct bnx2x_fw_file_section csem_int_table_data;
	struct bnx2x_fw_file_section csem_pram_data;
	struct bnx2x_fw_file_section xsem_int_table_data;
	struct bnx2x_fw_file_section xsem_pram_data;
	struct bnx2x_fw_file_section fw_version;
}

Each bnx2x_fw_file_section contains the length and the offset of the appropriate
section in the binary file. Values are stored in the big endian format.

Data types of arrays:

init_data            __be32
init_ops_offsets     __be16
XXsem_pram_data         u8
XXsem_int_table_data    u8
init_ops             struct raw_op {
                          u8   op;
			__be24 offset;
                        __be32 data;
		     }
fw_version              u8

>From now boundaries of a specific initialization stage are stored in
init_ops_offsets array instead of being defined by separate macroes. The index 
in init_ops_offsets is calculated by BLOCK_OPS_IDX macro:

#define BLOCK_OPS_IDX(block, stage, end) \
       (2*(((block)*STAGE_IDX_MAX) + (stage)) + (end))

Security:

In addition to sanity check of array boundaries bnx2x will check a FW version.
Additional checks might be added in the future.

Signed-off-by: Vladislav Zolotarov <vladz@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-04-27 03:27:43 -07:00
Yang Hongyang 284901a90a dma-mapping: replace all DMA_32BIT_MASK macro with DMA_BIT_MASK(32)
Replace all DMA_32BIT_MASK macro with DMA_BIT_MASK(32)

Signed-off-by: Yang Hongyang<yanghy@cn.fujitsu.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-04-07 08:31:11 -07:00
Yang Hongyang 6a35528a83 dma-mapping: replace all DMA_64BIT_MASK macro with DMA_BIT_MASK(64)
Replace all DMA_64BIT_MASK macro with DMA_BIT_MASK(64)

Signed-off-by: Yang Hongyang<yanghy@cn.fujitsu.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-04-07 08:31:10 -07:00
Eilon Greenstein c1accad323 bnx2x: Version update
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-03-02 22:32:49 -08:00
Eilon Greenstein 0a64ea5748 bnx2x: Register dump
Adding "ethtool -d" support. Due to the complexity of the FW and HW, there are a
lot of different regions in the chip - to keep the code as clean as possible,
the ranges were put in an H file. Some areas cannot be read if the driver is
running - so by default, the driver will not access those areas - but any
programmer facing a problem will be able to easily manipulate the driver to
extract full dump. The full dump can also be used with kernel dump modules in
case of kernel panic.

Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-03-02 22:32:48 -08:00
Eilon Greenstein c3eefaf676 bnx2x: Debug prints
Add the FP index to relevant debug prints and simply beautify some others

Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-03-02 22:32:48 -08:00
Eilon Greenstein c016201c5c bnx2x: Whitespace
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-03-02 22:32:46 -08:00
Eilon Greenstein 762d5f6c95 bnx2x: Calling tx disable unconditionally
On unload, the FW assumes that no packets will be sent after the driver sends
the FW stop command. To ensure that, the driver must always call
netif_tx_disable

Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-03-02 22:32:42 -08:00
Eilon Greenstein 490c3c9bf9 bnx2x: Using DMA engine
Using DMA engine (DMAE) to initialize large consecutive memories in the chip

Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-03-02 22:32:41 -08:00
Eilon Greenstein 2059aba7e4 bnx2x: Missing module parameter description
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-03-02 22:32:40 -08:00
Eilon Greenstein 8534f32c2f bnx2x: napi_poll budget check
Check the napi_poll budget only when updating it. Also add a comment to explain
the rmb

Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-03-02 22:32:39 -08:00
Eilon Greenstein 7961f79123 bnx2x: Unlimited Tx interrupt work
The Tx interrupt is very short and there is no need to limit it to a budget

Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-03-02 22:32:39 -08:00
Eilon Greenstein 161197853d bnx2x: Add rmb to read status block indices on load
Add rmb to read status block indices on load

Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-03-02 22:32:38 -08:00
Eilon Greenstein 6044735d8d bnx2x: Reduce the likelihood of smb_mb
As the comment explains, this smb_mb is needed only if the queue is stopped
(which is unlikely) so the barrier can be moved to that location

Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-03-02 22:32:38 -08:00
Eilon Greenstein 98589bb109 bnx2x: Remove redundant smb_mb on unload
As noted by Ben Hutchings <bhutchings@solarflare.com>, these smb_mb are not
needed

Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-03-02 22:32:36 -08:00
Eilon Greenstein 2b1440230a bnx2x: Version
And updating the year

Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-02-15 23:32:01 -08:00
Eilon Greenstein 356e23850b bnx2x: Clean-up
Whitespaces, empty lines, 80 columns, indentations and removing redundant
parenthesis

Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-02-15 23:31:58 -08:00
Eilon Greenstein f537225142 bnx2x: Comments and prints
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-02-15 23:31:57 -08:00
Eilon Greenstein 9898f86d39 bnx2x: Re-arrange module parameters
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-02-15 23:31:56 -08:00
Eilon Greenstein 359d8b1599 bnx2x: Moving includes
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-02-15 23:31:55 -08:00
Eilon Greenstein 8440d2b636 bnx2x: Driver dump
Re-arrange the driver debug print to support the Tx multi-queue and add support
for debug prints at the end of the ring (when start<end)

Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-02-15 23:31:55 -08:00
Eilon Greenstein 4781bfad73 bnx2x: Sparse endianity annotation
Resolving the majority of the issues, but there are still some left for future
patches.

Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-02-15 23:31:53 -08:00
Eilon Greenstein 0626b89971 bnx2x: Removing redundant macros
Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-02-15 23:31:51 -08:00
Eilon Greenstein b5bf9068eb bnx2x: Loopback in diag mode
When loading in diag mode, set the device to loopback instead of normal link and
then changing it to loopback mode

Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-02-15 23:31:50 -08:00
Eilon Greenstein 3ce2c3f9a3 bnx2x: Using nvram default WoL config
The driver default WoL setting is set to the nvram default value

Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-02-15 23:31:47 -08:00
Eilon Greenstein 3e5b510eb8 bnx2x: smp_mb and not just smp_rmb
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-02-15 23:31:46 -08:00
Eilon Greenstein 8b3a0f0ba3 bnx2x: Increasing FW timeout
When enabling many debug prints, it can take a while before processing an event.
To ease the debug process, allow bigger timeout before giving up

Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-02-15 23:31:45 -08:00
Eilon Greenstein 36e552ab1a bnx2x: Returning EBUSY in debug mode as well
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-02-15 23:31:45 -08:00
Eilon Greenstein 8d5726c404 bnx2x: Manual setting for MRRS
Allows better debug capabilities if the user wants to force an MRRS value

Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-02-15 23:31:42 -08:00
Eilon Greenstein c2c8b03e20 bnx2x: Pre emphasis configuration
Supporting non-default pre-emphasis settings for the internal and some external
PHYs

Signed-off-by: Yaniv Rosner <yanivr@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-02-15 23:31:41 -08:00
Eilon Greenstein 2857718528 bnx2x: Supporting BCM8481 PHY
Signed-off-by: Yaniv Rosner <yanivr@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-02-15 23:31:29 -08:00
Eilon Greenstein 46c6a67495 bnx2x: PHY lock list
Some dual port PHY require HW lock since they are used by both interfaces
(different driver instances). Since this list is getting longer, update a
parameter at load time instead of calculating it on runtime

Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-02-15 23:31:26 -08:00
Eilon Greenstein 589abe3a0f bnx2x: Supporting BCM8726 PHY
Also adding the ability to recognize the optic module and disable it if it is
not authorized for safety reasons - since this feature might upset some users
which are willing to take the risk, it is optional and can be disabled by
setting an nvram bit (or a trivial driver patch to set this bit).
This dual port PHY requires special handling if the ports are swapped.

Signed-off-by: Yaniv Rosner <yanivr@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-02-15 23:31:24 -08:00
Eilon Greenstein 4acac6a53a bnx2x: GPIO accessories
A GPIO is used with the 8726 PHY. Adding the GPIO related functions in this

Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-02-15 23:31:20 -08:00
Eilon Greenstein 87942b4678 bnx2x: Removing redundant device parameters
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-02-15 23:31:18 -08:00
Eilon Greenstein 35b19ba51c bnx2x: Removing the board type
There are too many different board types and this field is not scalable.
Removing it and making decisions according to other fields

Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-02-15 23:31:15 -08:00
Eilon Greenstein 1c06328c03 bnx2x: Flow control enhancement
Setting better HW thresholds and enabling FW capabilities for better
enforcement. Also set the HW to more efficiently use the internal buffers if
this is a single port design

Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-02-15 23:31:15 -08:00
Eilon Greenstein 8a1c38d17d bnx2x: BW shaper enhancements
Some of the configuration can be set when loading the device and shouldn't be
re-calculated after each link up indication since it is not dependent on the
link speed

Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-02-15 23:31:14 -08:00
Eilon Greenstein 748e543974 bnx2x: Moving skb_record_rx_queue
Should be called for all incoming packets and not just for GRO packets

Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-02-15 23:31:13 -08:00
Eilon Greenstein de832a55d2 bnx2x: Per queue statistics
Re-ordering the statistics to enhance readability and adding per queue
statistics (available via ethtool -S)

Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-02-15 23:31:12 -08:00
Eilon Greenstein d3d4f49527 bnx2x: Removing microcode assertion check
This check is unreliable since latest MC can issue warnings on rare occasions
which are not fatal errors

Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-02-15 23:31:10 -08:00
Eilon Greenstein f1ef27ef42 bnx2x: Disabling interrupts after iSCSI-boot
Before initializing the chip after iSCSI boot, the interrupts of the function
that was used to boot must be disabled. That means that the driver needs to set
the chip as if it is the iSCSI PCI function - this bug is exposed only with MSI

Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-02-15 23:31:09 -08:00
Eilon Greenstein 0f00846deb bnx2x: System-page alignment
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-02-15 23:31:08 -08:00
Eilon Greenstein 8badd27aa0 bnx2x: MSI support
Enabling MSI on top of MSI-X and INTA. Also changing the module parameter to
allow choosing INTA or MSI even when MSI-X is available. The default status
block should not be reversed for endianity. Since MSI can issue
re-configuration, the interrupt disable function now requires mmiowb

Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-02-15 23:31:05 -08:00