firefly-linux-kernel-4.4.55.git
16 years agoFix e100 on systems that have cache incoherent DMA
David Acker [Thu, 8 Nov 2007 18:17:41 +0000 (10:17 -0800)]
Fix e100 on systems that have cache incoherent DMA

On the systems that have cache incoherent DMA, including ARM, there
is a race condition between software allocating a new receive buffer
and hardware writing into a buffer.  The two race on touching the last
Receive Frame Descriptor (RFD).  It has its el-bit set and its next
link equal to 0.  When hardware encounters this buffer it attempts to
write data to it and then update Status Word bits and Actual Count in
the RFD.  At the same time software may try to clear the el-bit and
set the link address to a new buffer.

Since the entire RFD is once cache-line, the two write operations can
collide.  This can lead to the receive unit stalling or interpreting
random memory as its receive area.

The fix is to set the el-bit on and the size to 0 on the next to last
buffer in the chain.  When the hardware encounters this buffer it stops
and does not write to it at all.  The hardware issues an RNR interrupt
with the receive unit in the No Resources state.  Software can write
to the tail of the list because it knows hardware will stop on the
previous descriptor that was marked as the end of list.

Once it has a new next to last buffer prepared, it can clear the el-bit
and set the size on the previous one.  The race on this buffer is safe
since the link already points to a valid next buffer and the software
can handle the race setting the size (assuming aligned 16 bit writes
are atomic with respect to the DMA read). If the hardware sees the
el-bit cleared without the size set, it will move on to the next buffer
and skip this one.  If it sees the size set but the el-bit still set,
it will complete that buffer and then RNR interrupt and wait.

Signed-off-by: David Acker <dacker@roinet.com>
Signed-off-by: Auke Kok <auke-jan.h.kok@intel.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
16 years agosundance: SIOCDEVPRIVATE pollution
Francois Romieu [Thu, 1 Nov 2007 07:52:13 +0000 (00:52 -0700)]
sundance: SIOCDEVPRIVATE pollution

To quote one of my favorite contemporary author:
[include/linux/sockios.h]
 *      THESE IOCTLS ARE _DEPRECATED_ AND WILL DISAPPEAR IN 2.5.X -DaveM
 */

#define SIOCDEVPRIVATE  0x89F0  /* to 89FF */

[...]

Gentoo's snmpd trips up over this code when trying to figure if the driver
supports the non-SIOCDEVPRIVATE API or not.  One can argue over its choice
of heuristic but there no reason to make ioctl more ugly than needed.

Signed-off-by: Francois Romieu <romieu@fr.zoreil.com>
Cc: Jesse Huang <jesse@icplus.com.tw>
Tested-by: Volker Sauer <vsauer@dvs.tu-darmstadt.de>
Cc: Jeff Garzik <jeff@garzik.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
16 years agodrivers/net/netxen/: cleanups
Adrian Bunk [Mon, 5 Nov 2007 17:07:31 +0000 (18:07 +0100)]
drivers/net/netxen/: cleanups

This patch contains the following cleanups:
- static functions in .c files shouldn't be marked inline
- make needlessly global code static
- #if 0 unused code

Signed-off-by: Adrian Bunk <bunk@kernel.org>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
16 years agoixgbe: Fix copper PHY initialization code
Auke Kok [Wed, 31 Oct 2007 22:22:10 +0000 (15:22 -0700)]
ixgbe: Fix copper PHY initialization code

While cleaning up the internal API focussing on Fiber and CX4 code
we found that I had broken the copper PHY initialization code. This
patch restores the PHY-specific code. This is mostly uninteresting
since no copper PHY boards are yet available. The changes have been
tested against Fiber only as I do not even have copper PHY versions
of 82598 macs.

This change actually cleans up the API code a bit more and we
lose some initialization code. A few PHY link detection helper
lines of code have been snuck into this patch, as well as a
read flush where it was suspected that this might cause issues.

Signed-off-by: Auke Kok <auke-jan.h.kok@intel.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
16 years agoe1000/e1000e: Move PCI-Express device IDs over to e1000e
Auke Kok [Wed, 31 Oct 2007 22:22:05 +0000 (15:22 -0700)]
e1000/e1000e: Move PCI-Express device IDs over to e1000e

e1000e will from now on support the PCI-Express adapters that
previously were supported by e1000. This support means better
performance and easier debugging from now on for both the old
PCI-X/PCI hardware and PCI-Express adapters.

This patch also moves 3 recently merged device IDs over to e1000e
that are identical to quad-port versions of already existing
dual port versions. With this last bit every former e1000 pci-e
device should work now with e1000e.

Here is a brief list of which gigabit driver to use with which
adapter:

  e1000:
82540 -> 82547

  e1000e:
82571 -> 82573
ich8, ich9       (82562 or 82566)
es2lan           (80003eslan)

  igb: (not yet merged, only available from e1000.sf.net)
82575

Signed-off-by: Auke Kok <auke-jan.h.kok@intel.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
16 years agoe1000e: Disable L1 ASPM power savings for 82573 mobile variants
Auke Kok [Wed, 31 Oct 2007 22:22:00 +0000 (15:22 -0700)]
e1000e: Disable L1 ASPM power savings for 82573 mobile variants

L1 ASPM link (pci-e link power savings) has significant benefits
(~1W savings when link is active) but unfortunately does not work
correctly on any of the chipsets that have 82573 on mobile platforms
which causes various nuisances:
 - eeprom reads return garbage information leading to bad eeprom
   checksums
 - long ping times (up to 2 seconds)
 - complete system hangs (freeze/lockup)

A lot of T60 owners have been plagued by this, but other mobile
solutions also suffer from these symptoms.

Disabling L1 ASPM before we activate the PCI-E link fixes all of
these issues at the cost of some power consumption.

Remove a workaround RDTR adjustment that is no longer needed with
this new one.

Signed-off-by: Auke Kok <auke-jan.h.kok@intel.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
16 years agoe1000e: alternate MAC address support
Bill Hayes [Wed, 31 Oct 2007 22:21:52 +0000 (15:21 -0700)]
e1000e: alternate MAC address support

Port alternate MAC address support from the sourceforge
e1000 driver to the upstream e1000e driver.

Signed-off-by: Bill Hayes <bill.hayes@hp.com>
Signed-off-by: Auke Kok <auke-jan.h.kok@intel.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
16 years ago[netdrvr] ibmlana: move away from legacy MCA API
Jeff Garzik [Mon, 5 Nov 2007 02:53:26 +0000 (21:53 -0500)]
[netdrvr] ibmlana: move away from legacy MCA API

Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
16 years ago[netdrvr] ibmlana: modularization cleanup
Jeff Garzik [Mon, 5 Nov 2007 02:52:49 +0000 (21:52 -0500)]
[netdrvr] ibmlana: modularization cleanup

* move alloc_netdev() call, register_netdev() call, and associated failure
  cleanup into ibmlana_probe()

* move per-net_device cleanup into ibmlana_remove_one()

Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
16 years ago[netdrvr] irq handler minor cleanups in several drivers
Jeff Garzik [Mon, 29 Oct 2007 09:46:16 +0000 (05:46 -0400)]
[netdrvr] irq handler minor cleanups in several drivers

* use irq_handler_t where appropriate

* no need to use 'irq' function arg, its already stored in a data struct

* rename irq handler 'irq' argument to 'dummy', where the function
  has been analyzed and proven not to use its first argument.

* remove always-false "dev_id == NULL" test from irq handlers

* remove pointless casts from void*

* declance: irq argument is not const

* add KERN_xxx printk prefix

* fix minor whitespace weirdness

Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
16 years agohamradio/scc: kill unnecessary use of 'irq' function arg
Jeff Garzik [Mon, 29 Oct 2007 09:20:44 +0000 (05:20 -0400)]
hamradio/scc: kill unnecessary use of 'irq' function arg

Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
16 years agosk98lin: kill bogus check and convert to use ARRAY_SIZE()
Alejandro Martinez Ruiz [Thu, 18 Oct 2007 08:22:02 +0000 (10:22 +0200)]
sk98lin: kill bogus check and convert to use ARRAY_SIZE()

This converts uses of ARRAY_SIZE(), and while at it also kills
unreachable code as far as I can say. I can't tell what was the author
trying to do with the following check. First we have:

PNMI_STATIC const SK_PNMI_STATADDR
StatAddr[SK_PNMI_MAX_IDX][SK_PNMI_MAC_TYPES];

and then a check goes like this:

if (SK_PNMI_MAX_IDX !=
   (sizeof(StatAddr) / (sizeof(SK_PNMI_STATADDR) * SK_PNMI_MAC_TYPES)))

with the second line being just ARRAY_SIZE(StatAddr), which will always
return SK_PNMI_MAX_IDX, rendering the check useless.

Signed-off-by: Alejandro Martinez Ruiz <alex@flawedcode.org>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
16 years agonetdev: ARRAY_SIZE() cleanups
Alejandro Martinez Ruiz [Thu, 18 Oct 2007 08:16:33 +0000 (10:16 +0200)]
netdev: ARRAY_SIZE() cleanups

Convert array size calculations to use ARRAY_SIZE().

Signed-off-by: Alejandro Martinez Ruiz <alex@flawedcode.org>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
16 years agonetdev: use ARRAY_SIZE() instead of sizeof(array) / ETH_GSTRING_LEN
Alejandro Martinez Ruiz [Thu, 18 Oct 2007 08:00:15 +0000 (10:00 +0200)]
netdev: use ARRAY_SIZE() instead of sizeof(array) / ETH_GSTRING_LEN

Using ARRAY_SIZE() on arrays of the form array[][K] makes it unnecessary
to know the value of K when checking its size.

Signed-off-by: Alejandro Martinez Ruiz <alex@flawedcode.org>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
16 years agowireless: fix '!x & y' typo's
Roel Kluin [Fri, 26 Oct 2007 19:51:26 +0000 (21:51 +0200)]
wireless: fix '!x & y' typo's

Fix priority mistakes similar to '!x & y'

Signed-off-by: Roel Kluin <12o3l@tiscali.nl>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
16 years agolibertas: move wlan_*_association_work from header to c file
Holger Schurig [Fri, 26 Oct 2007 08:12:14 +0000 (10:12 +0200)]
libertas: move wlan_*_association_work from header to c file

Move wlan_postpone_association_work() and wlan_cancel_association_work()
from a assoc.h file to the sole user, into wext.c.

Renamed those two functions to to libertas_XXX as well.

Signed-off-by: Holger Schurig <hs4233@mail.mn-solutions.de>
Acked-by: Dan Williams <dcbw@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
16 years agoiwlwifi: disable interrupts before calling request_irq
Jes Sorensen [Fri, 26 Oct 2007 14:10:39 +0000 (16:10 +0200)]
iwlwifi: disable interrupts before calling request_irq

Disable interrupts in the iwl4965 before calling request_irq() for
the case that the previous OS or the BIOS left a pending interrupt in
the chip. This behavior has been observed on some laptops such as T61
Thinkpads and Toshiba Portege R500

Signed-off-by: Jes Sorensen <jes@sgi.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
16 years agoP54: use temporary variables to reduce size of generated code
Dmitry Torokhov [Fri, 2 Nov 2007 05:55:36 +0000 (01:55 -0400)]
P54: use temporary variables to reduce size of generated code

When there are 2 linked structures, using a temporary variable to hold a pointer
to the often used structure usually produces better code (smaller and faster)
since compiler does not have to constantly re-fetch data from the first structure.

Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
16 years agoPrism54: Convert mgmt_sem to the mutex API
Matthias Kaehlcke [Mon, 5 Nov 2007 08:41:01 +0000 (09:41 +0100)]
Prism54: Convert mgmt_sem to the mutex API

Signed-off-by: Matthias Kaehlcke <matthias.kaehlcke@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
16 years agoorinoco: more reliable scan handling
Dan Williams [Thu, 11 Oct 2007 03:56:25 +0000 (23:56 -0400)]
orinoco: more reliable scan handling

Bring scan result handling more in line with drivers like ipw.  Scan
results are aggregated and a BSS dropped after 15 seconds if no beacon
is received.  This allows the driver to interact better with userspace
where more than one process may request scans or results at any time.

Signed-off-by: Dan Williams <dcbw@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
16 years agob43: consistent naming for ieee80211_ops
Michael Buesch [Sun, 28 Oct 2007 15:29:32 +0000 (16:29 +0100)]
b43: consistent naming for ieee80211_ops

Use a consistent naming scheme for the ops.

Signed-off-by: Michael Buesch <mb@bu3sch.de>
Cc: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
16 years agob43: Use the retry limit parameters from mac80211
Michael Buesch [Sun, 28 Oct 2007 15:19:44 +0000 (16:19 +0100)]
b43: Use the retry limit parameters from mac80211

Use the limits provided by mac80211.

Signed-off-by: Michael Buesch <mb@bu3sch.de>
Cc: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
16 years agob43: Dereference of wl->current_dev must be protected by wl->mutex
Michael Buesch [Sun, 28 Oct 2007 14:59:58 +0000 (15:59 +0100)]
b43: Dereference of wl->current_dev must be protected by wl->mutex

Put all access to wl->current_dev under protection of the mutex.

Signed-off-by: Michael Buesch <mb@bu3sch.de>
Cc: Larry Finger <larry.finger@lwfinger.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
16 years agob43legacy: Remove set_key callback
Michael Buesch [Sun, 28 Oct 2007 20:08:51 +0000 (21:08 +0100)]
b43legacy: Remove set_key callback

We don't need the set_key callback, as we don't do hw crypto.

Signed-off-by: Michael Buesch <mb@bu3sch.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
16 years agob43legacy: Rewrite pwork locking
Larry Finger [Thu, 11 Oct 2007 05:05:57 +0000 (00:05 -0500)]
b43legacy: Rewrite pwork locking

Implement much easier and more lightweight locking for
the periodic work. This also removes the last big busywait
loop and replaces it by a sleeping loop.

This patch for b43legacy is patterned aftar the same patch
for b43 by Michael Buesch <mb@bu3sch.de>.

Signed-off-by: Larry Finger <larry.finger@lwfinger.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
16 years agob43legacy: Use input-polldev for the rfkill switch
Larry Finger [Thu, 11 Oct 2007 03:48:17 +0000 (22:48 -0500)]
b43legacy: Use input-polldev for the rfkill switch

This removes the direct call to rfkill on an rfkill event
and replaces it with an input device. This way userspace is also
notified about the event.

This patch is the port to b43legacy of a patch for b43 by Michael Buesch
<mb@bu3sch.de>.

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
16 years agob43legacy: RF-kill support
Larry Finger [Thu, 11 Oct 2007 03:44:22 +0000 (22:44 -0500)]
b43legacy: RF-kill support

This adds full support for the RFKILL button and the RFKILL LED trigger.

This is a port to b43legacy of a patch by Michael Buesch <mb@bu3sch.de>
for b43.

Signed-off-by: Larry Finger<Larry.Finger@lwfinger.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
16 years agob43legacy: LED triggers support
Larry Finger [Sat, 13 Oct 2007 04:04:51 +0000 (23:04 -0500)]
b43legacy: LED triggers support

Drive the LEDs through the generic LED triggers.

The patch to b43 by Michael Buesch <mb@bu3sch.de> has been ported to b43legacy.

Signed-off-by: Larry Finger <larry.finger@lwfinger.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
16 years agoiwlwifi: cleanup Kconfig and ifdefs to split 3945 and 4965
Christoph Hellwig [Thu, 25 Oct 2007 09:15:51 +0000 (17:15 +0800)]
iwlwifi: cleanup Kconfig and ifdefs to split 3945 and 4965

Currently the iwl3945 & iwl4965 drivers share some common Kconfig
symbols.  This split it up into options for the individual drivers
and gets rid of all the CONFIG_IWLWIFI cruft.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Zhu Yi <yi.zhu@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
16 years agoiwlwifi: keep 3945 and 4965 headers separate
Christoph Hellwig [Thu, 25 Oct 2007 09:15:50 +0000 (17:15 +0800)]
iwlwifi: keep 3945 and 4965 headers separate

The iwl3945 and iwl4965 devices share some common structure, but with a
lot of difference split all over.  Currently the two drivers share a lot
of headers and use ugly preprocessor magic to manage the difference.

This patch keeps two entirely separate copies of the headers to get rid
of these hacks an ease future development.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Zhu Yi <yi.zhu@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
16 years agoiwlwifi: mark more functions/variables static
Christoph Hellwig [Thu, 25 Oct 2007 09:15:49 +0000 (17:15 +0800)]
iwlwifi: mark more functions/variables static

mark more functions/variables static

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Zhu Yi <yi.zhu@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
16 years agoiwlwifi: Update iwlwifi version stamp to 1.1.19
Zhu Yi [Thu, 25 Oct 2007 09:15:48 +0000 (17:15 +0800)]
iwlwifi: Update iwlwifi version stamp to 1.1.19

Signed-off-by: Zhu Yi <yi.zhu@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
16 years agoiwlwifi: Update iwlwifi version stamp to 1.1.18
Zhu Yi [Thu, 25 Oct 2007 09:15:44 +0000 (17:15 +0800)]
iwlwifi: Update iwlwifi version stamp to 1.1.18

Signed-off-by: Zhu Yi <yi.zhu@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
16 years agoiwl4965: exclude 60M rate from probe request
mabbas [Thu, 25 Oct 2007 09:15:42 +0000 (17:15 +0800)]
iwl4965: exclude 60M rate from probe request

This patch do the following 2 things:
1. Make sure we don't add rate 60M part of supported rate in proble request,
   some AP does not like that.
2. It is wrong to set priv->active_rate in this function, this will set
   it to all avialable rates which might overwrite the mode supported rate.
   priv->active_rate should be set by only from iwl_set_rate.

Signed-off-by: Mohamed Abbas <mabbas@linux.intel.com>
Signed-off-by: Zhu Yi <yi.zhu@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
16 years agoiwlwifi: Renames struct fw_image_desc to struct fw_desc
Tomas Winkler [Thu, 25 Oct 2007 09:15:41 +0000 (17:15 +0800)]
iwlwifi: Renames struct fw_image_desc to struct fw_desc

This patche shortens the name of struct fw_image_desc to be struct
fw_desc.

Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Zhu Yi <yi.zhu@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
16 years agoiwlwifi: add 5965 SCD registers to iwl-prph.h
Emmanuel Grumbach [Thu, 25 Oct 2007 09:15:40 +0000 (17:15 +0800)]
iwlwifi: add 5965 SCD registers to iwl-prph.h

This patch adds SCD registers for 5965

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
16 years agoiwlwifi: move 3945 SCD registers to iwl-prph.h
Emmanuel Grumbach [Thu, 25 Oct 2007 09:15:39 +0000 (17:15 +0800)]
iwlwifi: move 3945 SCD registers to iwl-prph.h

This patch moves 3945 SCD registers to iwl-prph.h. These registers
are assigned from the periphery bus

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Zhu Yi <yi.zhu@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
16 years agoiwlwifi-ht: move 4965 SCD registers to iwl-prph.h
Emmanuel Grumbach [Thu, 25 Oct 2007 09:15:38 +0000 (17:15 +0800)]
iwlwifi-ht: move 4965 SCD registers to iwl-prph.h

This patch moves 4965 SCD registers to iwl-prph.h. These registers
are assigned from the periphery bus

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Zhu Yi <yi.zhu@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
16 years agoiwlwifi: replacing wording restricted to nic access in iwl-io
Tomas Winkler [Thu, 25 Oct 2007 09:15:37 +0000 (17:15 +0800)]
iwlwifi: replacing wording restricted to nic access in iwl-io

This patch replaces wording 'restricted' with more appropriate 'nic access'
NIC access is grabbed to prevent NIC entering power save mode
General cleanup of iwl-io.h

Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
16 years agoiwlwifi: rename restricted_mem to targ_mem
Tomas Winkler [Thu, 25 Oct 2007 09:15:36 +0000 (17:15 +0800)]
iwlwifi: rename restricted_mem to targ_mem

This patch renames restricted_mem suffix with more proper
name targ_mem for function accessing memory on the nic in target mode

Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
16 years agoiwlwifi: replace restricted_reg with prph
Tomas Winkler [Thu, 25 Oct 2007 09:15:35 +0000 (17:15 +0800)]
iwlwifi: replace restricted_reg with prph

This patch renames restricted_reg suffix with more proper
name prhp for function accessing registers on the periphery bus.

Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
16 years agoiwlwifi: accept up to 4K frame size on Rx side to fit A-MSDU frame
mabbas [Thu, 25 Oct 2007 09:15:34 +0000 (17:15 +0800)]
iwlwifi: accept up to 4K frame size on Rx side to fit A-MSDU frame

The driver drops any Rx frame larger than 2332 bytes, but with A-MSDU
frame, it could be up to 4K. This patch makes sure we can process larger
A-MSDU frame.

Signed-off-by: Mohamed Abbas <mabbas@linux.intel.com>
Signed-off-by: Zhu Yi <yi.zhu@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
16 years agoiwlwifi: using PCI_DEVICE macro
Tomas Winkler [Thu, 25 Oct 2007 09:15:32 +0000 (17:15 +0800)]
iwlwifi: using PCI_DEVICE macro

PCI_DEVICE macro is more concise when using defualt values
in device definitions

Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Zhu Yi <yi.zhu@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
16 years agoiwlwifi: remove cck_power_index_compensation
Tomas Winkler [Thu, 25 Oct 2007 09:15:31 +0000 (17:15 +0800)]
iwlwifi: remove cck_power_index_compensation

cck_power_index_compensation variable was never used

Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Zhu Yi <yi.zhu@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
16 years agoiwlwifi: remove late null-check and duplicate bug_on
Ian Schram [Thu, 25 Oct 2007 09:15:30 +0000 (17:15 +0800)]
iwlwifi: remove late null-check and duplicate bug_on

These pieces of code appear to be useless. The BUG_ON is also performed in
iwl_send_cmd_async.

Serious karma would be needed to enter iwl_ativate_qos with a null priv.
I had a deja vu when patching this, but for the life of me I couldn't track
down a similar patch.

Signed-off-by: Ian Schram <ischram@telenet.be>
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Zhu Yi <yi.zhu@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
16 years agoiwlwifi: Beautify by removing superfluous newlines and code
Ian Schram [Thu, 25 Oct 2007 09:15:29 +0000 (17:15 +0800)]
iwlwifi: Beautify by removing superfluous newlines and code

Moving code around, lindent, and whatnot created several places where
there appeared to be an 75 column "rule" instead of 80. This patch removes
those that I can spot, hopefully increasing readability.

Signed-off-by: Ian Schram <ischram@telenet.be>
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Zhu Yi <yi.zhu@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
16 years agoiwlwifi: Two comments in iwl-3945.c were longer than 80 columns
Ian Schram [Thu, 25 Oct 2007 09:15:28 +0000 (17:15 +0800)]
iwlwifi: Two comments in iwl-3945.c were longer than 80 columns

This patch shorten two comments lines in iwl-3945.c

Signed-off-by: Ian Schram <ischram@telenet.be>
Signed-off-by: Zhu Yi <yi.zhu@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
16 years agoiwlwifi: remove cck_flag from iwl_driver_hw_info
Tomas Winkler [Thu, 25 Oct 2007 09:15:27 +0000 (17:15 +0800)]
iwlwifi: remove cck_flag from iwl_driver_hw_info

This patch remove cck_flag from iwl_driver_hw_info, this flag
is unused after spliting the iwl-base.c

Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Zhu Yi <yi.zhu@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
16 years agoiwlwifi: add TGN flag to qos parameters
Tomas Winkler [Thu, 25 Oct 2007 09:15:26 +0000 (17:15 +0800)]
iwlwifi: add TGN flag to qos parameters

This patch adds TGN flag to QoS parameters. This flag governs enablement of
NAV shortening with CF-End and filters in 4 or 8K RX AMSDU packets

Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Zhu Yi <yi.zhu@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
16 years agoiwlwifi: rs-4965 fix return values
Tomas Winkler [Thu, 25 Oct 2007 09:15:25 +0000 (17:15 +0800)]
iwlwifi: rs-4965 fix return values

This patch cleans up style of 'return' of rate scale 4965 functions.
It renames return name variables rc to ret, change functions to void if no
meaningful value was returned it add return of -EINVAL for checks of wrong
arguments.

Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Zhu Yi <yi.zhu@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
16 years agoiwlwifi: renaming last_used and first_empty
Tomas Winkler [Thu, 25 Oct 2007 09:15:24 +0000 (17:15 +0800)]
iwlwifi: renaming last_used and first_empty

This patch renames queue pointers to write_ptr and read_ptr
instead of  first_empty and last_used. This is closer to technical
terminology we everyday use

Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
16 years agoiwlwifi: rename iwl_eeprom_aqcuire_semaphore to _acquire_
Ian Schram [Thu, 25 Oct 2007 09:15:23 +0000 (17:15 +0800)]
iwlwifi: rename iwl_eeprom_aqcuire_semaphore to _acquire_

Correct the spelling of aqcuire.

Signed-off-by: Ian Schram <ischram@telenet.be>
Signed-off-by: Zhu Yi <yi.zhu@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
16 years agoiwlwifi: fix various spelling and typos
Ian Schram [Thu, 25 Oct 2007 09:15:22 +0000 (17:15 +0800)]
iwlwifi: fix various spelling and typos

Fixing various spelling errors and typos. Mostly in comments. In total
27 words were corrected, some of which occurred more than ones.

Signed-Of-By: Ian Schram <ischram@telenet.be>
Signed-off-by: Zhu Yi <yi.zhu@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
16 years agoiwlwifi: Add erp_ie_changed hanlder
Tomas Winkler [Mon, 15 Oct 2007 22:50:25 +0000 (00:50 +0200)]
iwlwifi: Add erp_ie_changed hanlder

This patch adds erp_ie_changed handler to iwl4956

Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
16 years agort2x00: Release rt2x00 2.0.12
Ivo van Doorn [Sat, 27 Oct 2007 11:44:08 +0000 (13:44 +0200)]
rt2x00: Release rt2x00 2.0.12

Version bump.

Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years agort2x00: Correctly set ACK bit in tx descriptors
Mattias Nissler [Sat, 27 Oct 2007 11:43:49 +0000 (13:43 +0200)]
rt2x00: Correctly set ACK bit in tx descriptors

Add a flag to struct txdata_entry_desc that specifies whether an ack for the
frame is to be expected. Use this flag to set the ACK bit in the tx descriptor.
Previously, the ACK bit could be set incorrectly on CTS-to-self frames, so they
caused retries and were reported to be failed in the txdone handlers.

Signed-off-by: Mattias Nissler <mattias.nissler@gmx.de>
Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years agort2x00: Place mutex around USB register access
Adam Baker [Sat, 27 Oct 2007 11:43:29 +0000 (13:43 +0200)]
rt2x00: Place mutex around USB register access

There is a buffer, csr_cache which is used to hold copies of data being passed
to the USB stack which can get corrupted if multiple threads attempt to access
CSR registers simultaneously. There is also the possibility if multiple
threads try to access BBP or RF registers for the multiple USB operations
needed to get interleaved leading to incorrect results. This patch introduces
a mutex to prevent such simultaneous access. The interleaved access problem
may also affect the PCI devices but if so that will be handled in a follow-up
patch.

Signed-off-by: Adam Baker <linux@baker-net.org.uk>
Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years agort2x00: Remove data_desc structure
Ivo van Doorn [Thu, 24 Jan 2008 08:48:03 +0000 (00:48 -0800)]
rt2x00: Remove data_desc structure

Coverty indicated that data_desc with a single
element array is bad coding style. This removes
the structure and forces everybody to use __le32.

Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years agort2x00: Rework rt73 antenna selection
Mattias Nissler [Sat, 27 Oct 2007 11:42:37 +0000 (13:42 +0200)]
rt2x00: Rework rt73 antenna selection

This patch changes rt73 antenna selection to what I believe is the correct way.
It also fixes a small selection bug that switched the antennas by accident.

Signed-off-by: Mattias Nissler <mattias.nissler@gmx.de>
Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years agort2x00: Remove unused variables
Ivo van Doorn [Sat, 27 Oct 2007 11:42:18 +0000 (13:42 +0200)]
rt2x00: Remove unused variables

With the updated antenna setup the following
variables are no longer used.

Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years agort2x00: Rework rt61 antenna selection.
Mattias Nissler [Sat, 27 Oct 2007 11:41:53 +0000 (13:41 +0200)]
rt2x00: Rework rt61 antenna selection.

This patch changes rt61 antenna selection again. It helps at least with the
rt61 pci card in my box, I hope I haven't broken behaviour on other RF chips.
RF 2529 antenna setup is incomplete, we need to at code for diversity when we
figure out how it is done properly.

Signed-off-by: Mattias Nissler <mattias.nissler@gmx.de>
Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years agort2x00: Unconstify rt2x00dev
Adam Baker [Sat, 27 Oct 2007 11:41:25 +0000 (13:41 +0200)]
rt2x00: Unconstify rt2x00dev

Some register accesses need rt2x00dev to be non-const
they all need modifying so the prototype is consistent.

Signed-off-by: Adam Baker <linux@baker-net.org.uk>
Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years agort2x00: Detect initial rfkill state on register
Ivo van Doorn [Sat, 27 Oct 2007 11:40:51 +0000 (13:40 +0200)]
rt2x00: Detect initial rfkill state on register

When registering rfkill, make sure a initial
poll event is directly executed to detect the initial
rfkill state and send the event to the rfkill layer.

Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years agort2x00: Input-polldev requires input device
Ivo van Doorn [Sat, 27 Oct 2007 11:40:25 +0000 (13:40 +0200)]
rt2x00: Input-polldev requires input device

input-polldev requires a correctly allocated
and initialized input device to be set for the
input_polled_dev->input field.
Failure to do that will prevent correct polling
of the device.

Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years agort2x00: Split rt61/rt73 antenna selection into RX and TX antenna
Ivo van Doorn [Sat, 27 Oct 2007 11:39:57 +0000 (13:39 +0200)]
rt2x00: Split rt61/rt73 antenna selection into RX and TX antenna

Based on investigation of the legacy drivers, I have made the
following assumptions of the antenna setup:
 - R77 is the TX antenna configuration
 - RF2529 fetches default antenna selection from NIC eeprom word

With these assumptions we can change the antenna configuration
to correctly read both antenna setup values and correctly
configure the antenna. And we can now also configure the antenna
for RF2529 without a double antenna.

Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years agort2x00: Disable RX when switching antenna
Ivo van Doorn [Sat, 27 Oct 2007 11:39:28 +0000 (13:39 +0200)]
rt2x00: Disable RX when switching antenna

Antenna switching will be ignored when RX is enabled
during the switch. Make sure we disable the RX during
the switch and don't forget to reenable it later.

Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years ago[PATCH] rt2x00: Release rt2x00 2.0.11
Ivo van Doorn [Sat, 13 Oct 2007 14:27:16 +0000 (16:27 +0200)]
[PATCH] rt2x00: Release rt2x00 2.0.11

Version bump.

Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years ago[PATCH] rt2x00: Fix antenna selection.
Mattias Nissler [Sat, 13 Oct 2007 14:26:57 +0000 (16:26 +0200)]
[PATCH] rt2x00: Fix antenna selection.

In the config() handler, make sure that we do configure an antenna if the
current active antenna is uninitialized. Furthermore, don't overwrite the
active antenna with bogus values if we didn't touch the antenna setup.

Signed-off-by: Mattias Nissler <mattias.nissler@gmx.de>
Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years ago[PATCH] rt2x00: Cleanup if-statements
Ivo van Doorn [Sat, 13 Oct 2007 14:26:42 +0000 (16:26 +0200)]
[PATCH] rt2x00: Cleanup if-statements

Cleanup if-statements for simple 1/0 register field values.

This also fixes a endian bug in rt2500usb when working
with the PHY_CSR2 initialization. As well as a bug
in the enabling of the LED in rt73usb.

Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years ago[PATCH] rt2x00: Implement SW diversity
Ivo van Doorn [Sat, 13 Oct 2007 14:26:36 +0000 (16:26 +0200)]
[PATCH] rt2x00: Implement SW diversity

When mac80211 indicates that the default antenna setup
should be used _and_ that this default setup is SW_DIVERSITY.

This requires sampling and storing the RSSI per antenna
and check once every 2 seconds to determine if the RSSI
has changed significantly. Once this is the case we should sample
the other antenna for a short period and evaluate if
we need to swap antenna or not.

Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years ago[PATCH] rt2x00: Remove rt2x00_clear_link
Ivo van Doorn [Sat, 13 Oct 2007 14:26:32 +0000 (16:26 +0200)]
[PATCH] rt2x00: Remove rt2x00_clear_link

rt2x00_clear_link() was becoming too large for statically inline,
also it was used on a single location and shouldn't really be
used anywhere else. So move the entire code into the function
rt2x00lib_start_link_tuner()

Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years ago[PATCH] rt2x00: SW diversity should default to antenna B
Ivo van Doorn [Sat, 13 Oct 2007 14:26:27 +0000 (16:26 +0200)]
[PATCH] rt2x00: SW diversity should default to antenna B

Although ANTENNA_SW_DIVERSITY should never be send
to the driver, we should still handle it to prevent bugs.
But instead of defaulting to ANTENNA_HW_DIVERSITY we
should default to ANTENNA_B instead.

Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years ago[PATCH] rt2x00: Correctly translate mac80211 antenna setup to rt2x00
Ivo van Doorn [Sat, 13 Oct 2007 14:26:23 +0000 (16:26 +0200)]
[PATCH] rt2x00: Correctly translate mac80211 antenna setup to rt2x00

mac80211 has 3 values for the antenna setup:
 0 - default
 1 - use antenna 1
 2 - use antenna 2

This means that rt2x00 should store the default value
from the EEPROM somwhere and use that when mac80211 indicates
that the antenna setup is 0.
This also implies that rt2x00 should no longer write the
hw->config.antenna_sel_* values based on the EEPROM input.

This also adds the basis in rt2x00lib for correct software
diversity handling. By default rt2x00lib will now configure
antenna B instead of hardware diversity.

Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years ago[PATCH] rt2x00: Use enum defines
Ivo van Doorn [Sat, 13 Oct 2007 14:26:18 +0000 (16:26 +0200)]
[PATCH] rt2x00: Use enum defines

When setting the default EEPROM values use
the values from the enums instead of "magic" values.

Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years ago[PATCH] rt2x00: Move quality statistics into seperate structure
Ivo van Doorn [Sat, 13 Oct 2007 14:26:12 +0000 (16:26 +0200)]
[PATCH] rt2x00: Move quality statistics into seperate structure

Move all link quality statistics variables into
the link_qual structure. This cleans up the link
structure and allows us to use it for more then
just statistics.

Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years ago[BRIDGE]: Remove unused include of a header file in ebtables.c
Rami Rosen [Fri, 18 Jan 2008 13:38:31 +0000 (05:38 -0800)]
[BRIDGE]: Remove unused include of a header file in ebtables.c

In net/bridge/netfilter/ebtables.c,
- remove unused include of a header file (linux/tty.h) and remove the
  corresponding comment above it.

Signed-off-by: Rami Rosen <ramirose@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years ago[SCTP]: Fix build warning in sctp_sf_do_5_1C_ack().
David S. Miller [Fri, 18 Jan 2008 12:47:58 +0000 (04:47 -0800)]
[SCTP]: Fix build warning in sctp_sf_do_5_1C_ack().

Reported by Andrew Morton.

net/sctp/sm_statefuns.c: In function 'sctp_sf_do_5_1C_ack':
net/sctp/sm_statefuns.c:484: warning: 'error' may be used uninitialized in this function

Signed-off-by: David S. Miller <davem@davemloft.net>
16 years ago[NETNS][DST]: Add the network namespace pointer in dst_ops
Daniel Lezcano [Fri, 18 Jan 2008 11:58:07 +0000 (03:58 -0800)]
[NETNS][DST]: Add the network namespace pointer in dst_ops

The network namespace pointer can be stored into the dst_ops structure.
This is usefull when there are multiple instances of the dst_ops for a
protocol. When there are no several instances, this field will be never
used in the protocol. So there is no impact for the protocols which do
implement the network namespaces.

Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years ago[NETNS][DST] dst: pass the dst_ops as parameter to the gc functions
Daniel Lezcano [Fri, 18 Jan 2008 11:56:57 +0000 (03:56 -0800)]
[NETNS][DST] dst: pass the dst_ops as parameter to the gc functions

The garbage collection function receive the dst_ops structure as
parameter. This is useful for the next incoming patchset because it
will need the dst_ops (there will be several instances) and the
network namespace pointer (contained in the dst_ops).

The protocols which do not take care of the namespaces will not be
impacted by this change (expect for the function signature), they do
just ignore the parameter.

Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years ago[IPV4] FIB_HASH: Reduce memory needs and speedup lookups
Eric Dumazet [Fri, 18 Jan 2008 11:33:26 +0000 (03:33 -0800)]
[IPV4] FIB_HASH: Reduce memory needs and speedup lookups

Currently, sizeof(struct fib_alias) is 24 or 48 bytes on 32/64 bits
arches.

Because of SLAB_HWCACHE_ALIGN requirement, these are rounded to 32 and
64 bytes respectively.

This patch moves rcu to the end of fib_alias, and conditionally
defines it only for CONFIG_IP_FIB_TRIE.

We also remove SLAB_HWCACHE_ALIGN requirement for fib_alias and
fib_node objects because it is not necessary.

(BTW SLUB currently denies it for objects smaller than
cache_line_size() / 2, but not SLAB)

Finally, sizeof(fib_alias) go back to 16 and 32 bytes.

Then, we can embed one fib_alias on each fib_node, to favor locality.
Most of the time access to the fib_alias will be free because one
cache line contains both the list head (fn_alias) and (one of) the
list element.

Signed-off-by: Eric Dumazet <dada1@cosmosbay.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years ago[FIB]: Fix rcu_dereference() abuses in fib_trie.c
Eric Dumazet [Fri, 18 Jan 2008 11:31:36 +0000 (03:31 -0800)]
[FIB]: Fix rcu_dereference() abuses in fib_trie.c

node_parent() and tnode_get_child() currently use rcu_dereference().

These functions are called from both
- readers only paths (where rcu_dereference() is needed), and
- writer path (where rcu_dereference() is not needed)

To make explicit where rcu_dereference() is really needed, I
introduced new node_parent_rcu() and tnode_get_child_rcu() functions
which use rcu_dereference(), while node_parent() and tnode_get_child()
dont use it.

Then I changed calling sites where rcu_dereference() was really needed
to call the _rcu() variants.

This should have no impact but for alpha architecture, and may help
future sparse checks.

Signed-off-by: Eric Dumazet <dada1@cosmosbay.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years ago[ROSE]: Supress sparse warnings
Eric Dumazet [Tue, 15 Jan 2008 11:30:35 +0000 (03:30 -0800)]
[ROSE]: Supress sparse warnings

  CHECK   net/rose/af_rose.c
net/rose/af_rose.c:125:11: warning: expensive signed divide
net/rose/af_rose.c:976:46: warning: expensive signed divide
net/rose/af_rose.c:1379:13: warning: context imbalance in 'rose_info_start' - wrong count at exit
net/rose/af_rose.c:1406:13: warning: context imbalance in 'rose_info_stop' - unexpected unlock
  CHECK   net/rose/rose_in.c
net/rose/rose_in.c:185:25: warning: expensive signed divide
  CHECK   net/rose/rose_route.c
net/rose/rose_route.c:997:46: warning: expensive signed divide
net/rose/rose_route.c:1070:13: warning: context imbalance in 'rose_node_start' - wrong count at exit
net/rose/rose_route.c:1093:13: warning: context imbalance in 'rose_node_stop' - unexpected unlock
net/rose/rose_route.c:1146:13: warning: context imbalance in 'rose_neigh_start' - wrong count at exit
net/rose/rose_route.c:1169:13: warning: context imbalance in 'rose_neigh_stop' - unexpected unlock
net/rose/rose_route.c:1229:13: warning: context imbalance in 'rose_route_start' - wrong count at exit
net/rose/rose_route.c:1252:13: warning: context imbalance in 'rose_route_stop' - unexpected unlock

Signed-off-by: Eric Dumazet <dada1@cosmosbay.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years ago[ATM]: Suppress some sparse warnings
Eric Dumazet [Tue, 15 Jan 2008 11:29:50 +0000 (03:29 -0800)]
[ATM]: Suppress some sparse warnings

  CHECK   net/atm/br2684.c
net/atm/br2684.c:665:13: warning: context imbalance in 'br2684_seq_start' - wrong count at exit
net/atm/br2684.c:676:13: warning: context imbalance in 'br2684_seq_stop' - unexpected unlock
  CHECK   net/atm/lec.c
net/atm/lec.c:196:23: warning: expensive signed divide
  CHECK   net/atm/proc.c
net/atm/proc.c:151:14: warning: context imbalance in 'vcc_seq_start' - wrong count at exit
net/atm/proc.c:154:13: warning: context imbalance in 'vcc_seq_stop' - unexpected unlock

Signed-off-by: Eric Dumazet <dada1@cosmosbay.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years ago[APPLETALK]: Annotations to clear sparse warnings
Eric Dumazet [Tue, 15 Jan 2008 11:28:43 +0000 (03:28 -0800)]
[APPLETALK]: Annotations to clear sparse warnings

  CHECK   net/appletalk/aarp.c
net/appletalk/aarp.c:951:14: warning: context imbalance in 'aarp_seq_start' - wrong count at exit
net/appletalk/aarp.c:977:13: warning: context imbalance in 'aarp_seq_stop' - unexpected unlock
  CHECK   net/appletalk/atalk_proc.c
net/appletalk/atalk_proc.c:34:11: warning: context imbalance in 'atalk_seq_interface_start' - wrong count at exit
net/appletalk/atalk_proc.c:54:13: warning: context imbalance in 'atalk_seq_interface_stop' - unexpected unlock
net/appletalk/atalk_proc.c:93:11: warning: context imbalance in 'atalk_seq_route_start' - wrong count at exit
net/appletalk/atalk_proc.c:113:13: warning: context imbalance in 'atalk_seq_route_stop' - unexpected unlock
net/appletalk/atalk_proc.c:161:11: warning: context imbalance in 'atalk_seq_socket_start' - wrong count at exit
net/appletalk/atalk_proc.c:178:13: warning: context imbalance in 'atalk_seq_socket_stop' - unexpected unlock

Signed-off-by: Eric Dumazet <dada1@cosmosbay.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years ago[NETFILTER]: nf_conntrack: make print_conntrack function optional for l4protos
Patrick McHardy [Tue, 15 Jan 2008 07:49:37 +0000 (23:49 -0800)]
[NETFILTER]: nf_conntrack: make print_conntrack function optional for l4protos

Allows to remove five empty implementations.

Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years ago[NETFILTER]: nf_conntrack: remove print_conntrack function from l3protos
Patrick McHardy [Tue, 15 Jan 2008 07:49:17 +0000 (23:49 -0800)]
[NETFILTER]: nf_conntrack: remove print_conntrack function from l3protos

Its unused and unlikely to ever be used.

Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years ago[NETFILTER]: nf_conntrack: clean up a few header files
Patrick McHardy [Tue, 15 Jan 2008 07:48:57 +0000 (23:48 -0800)]
[NETFILTER]: nf_conntrack: clean up a few header files

- Remove declarations of non-existing variables and functions
- Move helper init/cleanup function declarations to nf_conntrack_helper.h
- Remove unneeded __nf_conntrack_attach declaration and make it static

Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years ago[NETFILTER]: kill nf_sysctl.c
Patrick McHardy [Tue, 15 Jan 2008 07:48:39 +0000 (23:48 -0800)]
[NETFILTER]: kill nf_sysctl.c

Since there now is generic support for shared sysctl paths, the only
remains are the net/netfilter and net/ipv4/netfilter paths. Move them
to net/netfilter/core.c and net/ipv4/netfilter.c and kill nf_sysctl.c.

Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years ago[NETFILTER]: nf_conntrack_sctp: remove timeout indirection
Patrick McHardy [Tue, 15 Jan 2008 07:48:17 +0000 (23:48 -0800)]
[NETFILTER]: nf_conntrack_sctp: remove timeout indirection

Instead of keeping pointers to the timeout values in a table, simply
put the timeout values in the table directly.

Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years ago[NETFILTER]: nf_conntrack_sctp: replace magic value by symbolic constant
Patrick McHardy [Tue, 15 Jan 2008 07:48:02 +0000 (23:48 -0800)]
[NETFILTER]: nf_conntrack_sctp: replace magic value by symbolic constant

Use SCTP_CHUNK_FLAG_T instead of 0x1.

Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years ago[NETFILTER]: nf_conntrack_sctp: remove unused ttag field from conntrack data
Patrick McHardy [Tue, 15 Jan 2008 07:47:44 +0000 (23:47 -0800)]
[NETFILTER]: nf_conntrack_sctp: remove unused ttag field from conntrack data

Spotted by Pablo Neira Ayuso <pablo@netfilter.org>.

Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years ago[NETFILTER]: nf_conntrack_sctp: don't take sctp_lock once per chunk
Patrick McHardy [Tue, 15 Jan 2008 07:47:25 +0000 (23:47 -0800)]
[NETFILTER]: nf_conntrack_sctp: don't take sctp_lock once per chunk

Don't take and release the lock once per SCTP chunk, simply hold it
the entire time while iterating through the chunks.

Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years ago[NETFILTER]: nf_conntrack_sctp: rename "newconntrack" variable
Patrick McHardy [Tue, 15 Jan 2008 07:47:09 +0000 (23:47 -0800)]
[NETFILTER]: nf_conntrack_sctp: rename "newconntrack" variable

The name is misleading, it holds the new connection state, so rename it
to "newstate". Also rename "oldsctpstate" to "oldstate" for consistency.

Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years ago[NETFILTER]: nf_conntrack_sctp: consolidate sctp_packet() error paths
Patrick McHardy [Tue, 15 Jan 2008 07:46:52 +0000 (23:46 -0800)]
[NETFILTER]: nf_conntrack_sctp: consolidate sctp_packet() error paths

Consolidate error paths and use proper symbolic return value instead
of magic values.

Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years ago[NETFILTER]: nf_conntrack_sctp: reduce line length further
Patrick McHardy [Tue, 15 Jan 2008 07:46:37 +0000 (23:46 -0800)]
[NETFILTER]: nf_conntrack_sctp: reduce line length further

Eliminate a few lines over 80 characters by using a local variable to
hold the conntrack direction instead of using CTINFO2DIR everywhere.

Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years ago[NETFILTER]: nf_conntrack_sctp: reduce line length
Patrick McHardy [Tue, 15 Jan 2008 07:46:20 +0000 (23:46 -0800)]
[NETFILTER]: nf_conntrack_sctp: reduce line length

Reduce the length of some overly long lines by renaming all
"conntrack" variables to "ct".

Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years ago[NETFILTER]: nf_conntrack_sctp: use proper types for bitops
Patrick McHardy [Tue, 15 Jan 2008 07:46:05 +0000 (23:46 -0800)]
[NETFILTER]: nf_conntrack_sctp: use proper types for bitops

Use unsigned long instead of char for the bitmap and removed lots
of casts.

Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years ago[NETFILTER]: nf_conntrack_sctp: basic cleanups
Patrick McHardy [Tue, 15 Jan 2008 07:45:48 +0000 (23:45 -0800)]
[NETFILTER]: nf_conntrack_sctp: basic cleanups

Reindent switch cases properly, get rid of weird constructs like "!(x == y)",
put logical operations on the end of the line instead of the next line, get
rid of superfluous braces.

Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years ago[NETFILTER]: nf_conntrack_tcp: remove timeout indirection
Patrick McHardy [Tue, 15 Jan 2008 07:45:32 +0000 (23:45 -0800)]
[NETFILTER]: nf_conntrack_tcp: remove timeout indirection

Instead of keeping pointers to the timeout values in a table, simply
put the timeout values in the table directly.

Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years ago[NETFILTER]: nf_conntrack_{tcp,sctp}: shrink state table
Patrick McHardy [Tue, 15 Jan 2008 07:45:11 +0000 (23:45 -0800)]
[NETFILTER]: nf_conntrack_{tcp,sctp}: shrink state table

The TCP and SCTP conntrack state transition tables only holds
small numbers, but gcc uses 4 byte per entry for the enum. Switching
to an u8 reduces the size from 480 to 120 bytes for TCP and from
576 to 144 bytes for SCTP.

Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>