Commit Graph

350 Commits

Author SHA1 Message Date
Tejun Heo 5a0e3ad6af 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>
2010-03-30 22:02:32 +09:00
Amit Kumar Salecha 48c11a59c4 netxen: update version to 4.0.73
Signed-off-by: Amit Kumar Salecha <amit.salecha@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2010-03-26 11:49:22 -07:00
Amit Kumar Salecha afbe5cd6c4 netxen: added sanity check for pci map
Signed-off-by: Amit Kumar Salecha <amit.salecha@qlogic.com>

Return value of ioremap is not checked, NULL check added.

Signed-off-by: Amit Kumar Salecha <amit.salecha@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2010-03-26 11:49:22 -07:00
Amit Kumar Salecha 77c553900c netxen: fix warning in ioaddr for NX3031 chip
Signed-off-by: Amit Kumar Salecha <amit.salecha@qlogic.com>

crb_intr_mask/crb_sts_consumer is predefined for NX2031 not for
NX3031. For NX3031, these values get defined in rx context creation.
Signed-off-by: David S. Miller <davem@davemloft.net>
2010-03-26 11:49:21 -07:00
Amit Kumar Salecha bb2792e038 netxen: fix bios version calculation
Bios sub version from unified fw image is calculated incorrect.

Signed-off-by: Amit Kumar Salecha <amit.salecha@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2010-03-26 11:49:21 -07:00
Eric W. Biederman 688328c7ec netxen: The driver doesn't work on NX_P3_B1 so cause probe to fail.
I haven't been able to get link up on a NX_P3_B1 since 2.6.31.  The
driver complains about a firmware hang instead.  When I asked I was
told rev 0x41 was a preproduction rev.  So disable support in the
driver so no one is surprised the code doesn't work.

Signed-off-by: Eric W. Biederman <ebiederm@aristanetworks.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2010-03-22 20:32:38 -07:00
Jiri Pirko f9dcbcc9e3 net: convert multiple drivers to use netdev_for_each_mc_addr, part5 V2
removed some needless checks and also corrected bug in lp486e (dmi was passed
instead of dmi->dmi_addr)

Signed-off-by: Jiri Pirko <jpirko@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2010-02-26 02:07:30 -08:00
Jiri Pirko 4cd24eaf0c net: use netdev_mc_count and netdev_mc_empty when appropriate
This patch replaces dev->mc_count in all drivers (hopefully I didn't miss
anything). Used spatch and did small tweaks and conding style changes when
it was suitable.

Jirka

Signed-off-by: Jiri Pirko <jpirko@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2010-02-12 11:38:58 -08:00
David S. Miller 9c119ba54c Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6 2010-02-03 19:38:22 -08:00
Amit Kumar Salecha e15eec2805 netxen: protect resource cleanup by rtnl lock
o context resources can be in used, while resource cleanup is in progress,
  during fw recover.
o Null pointer execption can occur in send_cmd_desc, if fw recovery
  module frees tx ring without rtnl lock.
o Same applies to ethtool register dump.

Signed-off-by: Amit Kumar Salecha <amit.salecha@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2010-02-03 19:15:24 -08:00
Amit Kumar Salecha 41f3e0b1f5 netxen: fix tx timeout recovery for NX2031 chip
For NX2031, first try to scrub interrupt before requesting firmware
reset. Return statement was missing after scrubbbing interrupt.

Signed-off-by: Vernon Mauery <vernux@us.ibm.com>
Signed-off-by: Amit Kumar Salecha <amit.salecha@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2010-02-03 19:15:24 -08:00
Amit Kumar Salecha 1954dc1177 netxen: fix sparse warning
Signed-off-by: Amit Kumar Salecha <amit.salecha@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2010-01-15 01:37:25 -08:00
Amit Kumar Salecha 4d21fef426 netxen: fix license header
GNU General Public License is in file "COPYING".

Signed-off-by: Amit Kumar Salecha <amit.salecha@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2010-01-15 01:37:25 -08:00
Amit Kumar Salecha c070395009 netxen: fix endianness intr coalesce
Before sending Interrupt coalesce parameters to device,
convert them in little endian.

Signed-off-by: Amit Kumar Salecha <amit.salecha@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2010-01-15 01:37:24 -08:00
Amit Kumar Salecha a03d245199 netxen: fix endianness read mac address
In netxen_read_mac_addr, mac_addr should be declared
u64 instead of __le64, used by host only.

Signed-off-by: Amit Kumar Salecha <amit.salecha@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2010-01-15 01:37:24 -08:00
David S. Miller d4a66e752d Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
Conflicts:
	drivers/net/benet/be_cmds.h
	include/linux/sysctl.h
2010-01-10 22:55:03 -08:00
Amit Kumar Salecha c651a8c160 netxen: update version to 4.0.72
Signed-off-by: Amit Kumar Salecha <amit.salecha@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2010-01-08 00:35:28 -08:00
Amit Kumar Salecha d49c964097 netxen: fix set mac addr
o If tx and rx resources are not available, during set mac request.
  Then this request wont be passed to firmware and it will be added to
  driver mac list and will never make it to firmware.
  So if resources are not available, don't add it to driver mac list.

Signed-off-by: Amit Kumar Salecha <amit.salecha@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2010-01-08 00:35:28 -08:00
Amit Kumar Salecha 581e8ae49e netxen: fix smatch warning
o Fix pointless assignments

Signed-off-by: Amit Kumar Salecha <amit.salecha@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2010-01-08 00:35:27 -08:00
Amit Kumar Salecha 011f4ea097 netxen: fix tx ring memory leak
o While unloading driver or resetting the context, tx ring was not
  getting free.

Signed-off-by: Amit Kumar Salecha <amit.salecha@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2010-01-08 00:35:27 -08:00
Alexey Dobriyan a3aa18842a drivers/net/: use DEFINE_PCI_DEVICE_TABLE()
Use DEFINE_PCI_DEVICE_TABLE() so we get place PCI ids table into correct section
in every case.

Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2010-01-07 23:54:26 -08:00
Sucheta Chakraborty a4b751d872 netxen: fix ethtool link test
o Fix ethtool link test for NX3031 chip.
o Remove unused code from phy interrupt callback

Signed-off-by: Sucheta Chakraborty <sucheta.chakraborty@qlogic.com>
Signed-off-by: Amit Kumar Salecha <amit.salecha@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2010-01-03 22:06:16 -08:00
Sucheta Chakraborty 2d2cf34681 netxen: fix ethtool register dump
o Dump registers such as tx ring and rx ring counter, firmware state,
  niu regs, etc. which can be useful for debugging purpose.

Signed-off-by: Sucheta Chakraborty <sucheta.chakraborty@qlogic.com>
Signed-off-by: Amit Kumar Salecha <amit.salecha@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2010-01-03 22:06:16 -08:00
Amit Kumar Salecha 7ef8a2127a netxen: fix unified fw size check
o Unified firmware image size can be < 1 MB

Signed-off-by: Amit Kumar Salecha <amit.salecha@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-12-23 14:13:27 -08:00
Amit Kumar Salecha e87ad55393 netxen: support pci error handlers
o Support pci error detection and recovery.
o Refactor suspend and resume code, to share with io_error_detected,
  and slot_reset callbacks
o NX_NEED_AER device state added, to synchronize with firmware
  recovery.

Signed-off-by: Amit Kumar Salecha <amit.salecha@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-12-23 14:13:27 -08:00
Amit Kumar Salecha 6a808c6c02 netxen: fix tx timeout recovery
o In case of tx timeout, firmare may be healthy, but some pci-func may
  see no response from it. Force firmware reset, if some pci-func
  explicitly requests so.

Signed-off-by: Amit Kumar Salecha <amit.salecha@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-12-23 14:13:26 -08:00
Amit Kumar Salecha bc86fcbac0 netxen: minor suspend resume fixes
o pci device should be disable at the end and it should be enable first.
o Interface should be attached(netif_device_attach()) irrespective
  of its state.

Signed-off-by: Amit Kumar Salecha <amit.salecha@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-12-23 14:13:26 -08:00
Stephen Hemminger afdafff130 netxen: use module parameter correctly
Netxen driver is doing this bogus thing to create a control file.
This fails if device doesn't exist, and overall is a bad way to do
the module parameter. Rather than fix borked code, just rewrite.
Just using a writeable module parameter of 0/1 is the correct way

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-12-18 20:13:35 -08:00
Dhananjay Phadke 634d7df89a netxen: fix firmware type check
Unified firmware image may not contain MN type of firmware.
Driver should fall back to NOMN firmware type instead
of going to flash.

Signed-off-by: Dhananjay Phadke <dhananjay@netxen.com>
Signed-off-by: Amit Kumar Salecha <amit.salecha@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-12-08 20:37:46 -08:00
Amit Kumar Salecha f2251f668e netxen:fix napi intr enable check
o netif_running() check for enabling interrupt at end of napi poll is
  not enough to cover firmwar recovery. Instead test __NX_DEV_UP bit.
o Avoid re-entry into to netxen_nic_down() with __NX_DEV_UP bit check.

Acked-by: Dhananjay Phadke <dhananjay.phadke@qlogic.com>
Signed-off-by: Amit Kumar Salecha <amit.salecha@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-12-08 20:37:45 -08:00
Amit Kumar Salecha 6f7714196b netxen: protect device reset by rtnl_lock
o To prevent race conditions with other reset events.
  During suspend/resume and firmware recovery, acquire rtnl_lock,
  while changing interface state.

Acked-by: Dhananjay Phadke <dhananjay.phadke@qlogic.com>
Signed-off-by: Amit Kumar Salecha <amit.salecha@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-12-08 20:37:45 -08:00
Joe Perches 8e95a2026f drivers/net: Move && and || to end of previous line
Only files where David Miller is the primary git-signer.
wireless, wimax, ixgbe, etc are not modified.

Compile tested x86 allyesconfig only
Not all files compiled (not x86 compatible)

Added a few > 80 column lines, which I ignored.
Existing checkpatch complaints ignored.

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-12-03 13:18:01 -08:00
Amit Kumar Salecha 8f9b3f6994 netxen: fix failure cases for fw hang recovery
Handle few corner cases in firmware hang detection and recovery:

o Don't mark device state as READY, till handshake with
  firmware is done.
o During probe, if start_firmware fails, restore reference
  count.
o Don't increment refernce count, if start_firmware fails
  during firmware reset.
o Clear __NX_RESETTING bit, incase of fatal error or tempeature
  reaches critical limit so that pci remove() doesn't poll on
  this bit.

Signed-off-by: Amit Kumar Salecha <amit.salecha@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-12-02 19:57:18 -08:00
Narender Kumar f58dbd7320 netxen : fix debug tools access for NX2031
Driver maps only some part of the MMIO bar 0 in case of
NX2031. This is sufficient for tx and rx by the driver.
When debug tools need to access resources in
unmapped regions, driver needs to map these on the fly
in order to complete read/write request.

Signed-off-by: Narender Kumar <narender.kumar@qlogic.com>
Signed-off-by: Dhananjay Phadke <dhananjay.phadke@qlogic.com>
Signed-off-by: Amit Kumar Salecha <amit.salecha@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-12-02 19:57:18 -08:00
Amit Kumar Salecha e7473f12be netxen: fix merge 9b963e5d0e
Patch "fix memory initialization:5d521fd36de4e61" didn't got merge.

Signed-off-by: Amit Kumar Salecha <amit.salecha@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-11-29 21:54:55 -08:00
David S. Miller 9b963e5d0e Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
Conflicts:
	drivers/ieee802154/fakehard.c
	drivers/net/e1000e/ich8lan.c
	drivers/net/e1000e/phy.c
	drivers/net/netxen/netxen_nic_init.c
	drivers/net/wireless/ath/ath9k/main.c
2009-11-29 00:57:15 -08:00
Narender Kumar 5d09e534bb netxen : fix BOND_MODE_TLB/ALB mode.
o Along with netdev->perm_addr, mac address will be
  maintained in device private structure.

o Device limitation: We need to set mac address when ever
  interface comes up.

In ALB/TAL mode, bonding driver calls set_mac for all slave with bond mac address.
But bonding driver set netdev->dev_addr field to its original value,
after enslaving interfaces.

When ever active slave changes, it swap dev_addr of inactive slave with active.
Yet it doesn't notify driver about change in netdev->dev_addr.

As netxen driver need to set mac addr when ever interface comes up,
it can't rely on netdev->dev_addr field. Specially in case of bonding mode ALB/TLB.

Signed-off-by: Narender Kumar <narender.kumar@qlogic.com>
Signed-off-by: Amit Kumar Salecha <amit.salecha@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-11-21 11:37:37 -08:00
Narender Kumar a7483b0afa netxen: fix promisc for NX2031.
Kernel crashes, if promisc mode set without disabling rx queue.
Before changing mode in NX2031 chip, wait till rx queue drains.

Signed-off-by: Narender Kumar <narender.kumar@qlogic.com>
Signed-off-by: Amit Kumar Salecha <amit.salecha@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-11-21 11:37:35 -08:00
Amit Kumar Salecha 5d521fd36d netxen: fix memory initialization
Avoid resetting memory during initialization, skip this memory
block during driver probe.

Signed-off-by: Amit Kumar Salecha <amit@netxen.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-11-21 11:37:32 -08:00
Amit Kumar Salecha eb6d02133c netxen: remove PCI IDs of CNA device
Remove PCI vendor and device IDs for QLE8240 and QLE8242
CNA devices. CNA devices will have separate driver.

Signed-off-by: Amit Kumar Salecha <amit.salecha@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-11-20 10:00:17 -08:00
Dhananjay Phadke c70948105d netxen: update version to 4.0.65
Signed-off-by: Dhananjay Phadke <dhananjay@netxen.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-10-28 04:11:10 -07:00
Dhananjay Phadke 7e8e5d9718 netxen: module firmware hints
Add MODULE_FIRMWARE hints for various firmware file types,
required by different chip revisions.

Signed-off-by: Dhananjay Phadke <dhananjay@netxen.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-10-28 04:11:10 -07:00
Dhananjay Phadke c25c0b9b33 netxen: update module info
Update module info with QLogic signature.

Signed-off-by: Dhananjay Phadke <dhananjay@netxen.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-10-28 04:11:04 -07:00
Dhananjay Phadke f0e08fac06 netxen: add PCI IDs for new chip
Add PCI vendor and device IDs for QLE8240 and QLE8242
CNA devices.

Signed-off-by: Dhananjay Phadke <dhananjay@netxen.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-10-28 04:10:18 -07:00
Dhananjay Phadke a9ac07deeb netxen: refactor indirect register access
Refactor code to calculate and set indirect access
window for control registers in 2MB address space
(NX3031 or newer). Use void __iomem * data type for
absolute pci addresses.

Signed-off-by: Dhananjay Phadke <dhananjay@netxen.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-10-28 04:10:17 -07:00
Amit Kumar Salecha f50330f90b netxen: support for new firmware file format
Add support for extracting firmware from a unified
file format which embeds firmware images for all chip
revisions. Fallback to orginal file formats if new
image is not found.

Signed-off-by: Amit Kumar Salecha <amit@netxen.com>
Signed-off-by: Dhananjay Phadke <dhananjay@netxen.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-10-28 04:10:16 -07:00
Randy Dunlap 0531d7b851 netxen: fix builds for SYSFS=n or MODULES=n
When CONFIG_MODULES=n:
drivers/net/netxen/netxen_nic_main.c:2751: error: dereferencing pointer to incomplete type
drivers/net/netxen/netxen_nic_main.c:2764: error: dereferencing pointer to incomplete type

Also needs addition of <linux/sysfs.h> for sysfs function prototypes or
stubs when CONFIG_SYSFS=n.

Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
Acked-by: Dhananjay Phadke <dhananjay@netxen.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-10-28 02:36:24 -07:00
David S. Miller cfadf853f6 Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
Conflicts:
	drivers/net/sh_eth.c
2009-10-27 01:03:26 -07:00
Dhananjay Phadke 0dc6d9cbe7 netxen: avoid undue board config check
Old code assumed board config version in the flash to be 1.
When this will get changed by tools, driver just refuses to
attach. This is unnecessary since driver does not have to
parse board config structure directly (maintained by firmware).

Signed-off-by: Dhananjay Phadke <dhananjay@netxen.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-10-22 18:27:50 -07:00
Amit Kumar Salecha ff8a306d63 netxen: fix tx timeout handling on firmware hang
Clear NX_RESETING bit in netxen_tx_timeout_task() so that
the firmware watchdog task can catch need_reset request
from tx timeout.

Signed-off-by: Amit Kumar Salecha <amit.salecha@qlogic.com>
Signed-off-by: Dhananjay Phadke <dhananjay@netxen.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-10-22 18:27:50 -07:00