Commit Graph

17836 Commits (753cdc3304f0612766a81cddab9d8af01fcf8218)

Author SHA1 Message Date
H Hartley Sweeten 753cdc3304 drivers/net/igbvf/netdev.c: use %pM to shown MAC address
Use the %pM kernel extension to display the MAC address.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-12-29 20:02:29 -08:00
H Hartley Sweeten 557b0bbd62 drivers/net/lib82596.c: use %pM to shown MAC address
Use the %pM kernel extension to display the MAC address.

The only difference in the output is that the MAC address is
shown in the usual colon-separated hex notation instead of
space-separated.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-12-29 20:01:46 -08:00
Octavian Purdila bf9ae5386b llc: use dev_hard_header
Using dev_hard_header allows us to use LLC with VLANs and potentially
other Ethernet/TokernRing specific encapsulations. It also removes code
duplication between LLC and Ethernet/TokenRing core code.

Signed-off-by: Octavian Purdila <opurdila@ixiacom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-12-26 20:38:23 -08:00
David S. Miller d346f49d0b Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-next-2.6 2009-12-25 16:34:56 -08:00
Scott Feldman d87fd25d5a enic: whitespace cleanup; #define cleanup; more verbose err msg
Some misc changes to cleanup whitespace issues and fix/remove some #define
HW defintions.

1) fix some whitespace issues
2) more verbose err msg when resources aren't available to configure vnic
3) remove unused #define
4) fix RSS #define rss hash types

Signed-off-by: Vasanthy Kolluri <vkolluri@cisco.com>
Signed-off-by: Scott Feldman <scofeldm@cisco.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-12-23 21:03:42 -08:00
Scott Feldman 7c84459911 enic: feature add: add ethtool -c/C support
Only rx_usec and tx_usec options for ethtool -C are settable as those
are the only settings that make sense to HW.  Adds driver reporting of
intr coalescing timer value in usec units rather than HW units.

Signed-off-by: Vasanthy Kolluri <vkolluri@cisco.com>
Signed-off-by: Scott Feldman <scofeldm@cisco.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-12-23 21:03:41 -08:00
Scott Feldman bd2496229e enic: Bug fix: align desc ring sizes to 32 descs
Previous driver was aligning ring sizes to 16 descs, but hardware actually
wants desc ring sizes to be aligned to 32 descs.

Signed-off-by: Vasanthy Kolluri <vkolluri@cisco.com>
Signed-off-by: Scott Feldman <scofeldm@cisco.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-12-23 21:03:41 -08:00
Scott Feldman 9959a18556 enic: minimize pkt filter updates to firmware
In set_multicast(), only push pkt filter changes down to firmware if
pkt filter actually changes.

Signed-off-by: Vasanthy Kolluri <vkolluri@cisco.com>
Signed-off-by: Scott Feldman <scofeldm@cisco.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-12-23 21:03:40 -08:00
Scott Feldman 2d6ddced5c enic: Bug fix: try harder to fill Rx ring on skb allocation failures
During dev->open(), make sure we get at least one skb on the Rx ring.
Otherwise abort the interface load.  Also, if we get skb allocation
failures in NAPI poll while trying to replenish the ring, try again
later so we don't end up starving out the Rx ring completely.

Signed-off-by: Vasanthy Kolluri <vkolluri@cisco.com>
Signed-off-by: Scott Feldman <scofeldm@cisco.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-12-23 21:03:40 -08:00
Scott Feldman b3d18d191b enic: Bug fix: use safe queue shutdown in dev->stop
Fix dev->stop shutdown bug where driver was stopping xmit queue and then
disabling intrs.  Fix is to disable intrs first and then stop the xmit
queue, otherwise an interrupt could cause the queue to be rewoken.  Also,
no need to explicitly do queue servicing because queues are cleaned and
reset back to initial state at end of dev->stop.  Servicing queues also
had the side-effect of also rewakening the xmit queue, which is not what
we want.

Signed-off-by: Vasanthy Kolluri <vkolluri@cisco.com>
Signed-off-by: Scott Feldman <scofeldm@cisco.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-12-23 21:03:39 -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
David S. Miller b4de921ae6 Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6 2009-12-23 14:09:17 -08:00
Stefani Seibold 9842c38e91 kfifo: fix warn_unused_result
Fix the "ignoring return value of '...', declared with attribute
warn_unused_result" compiler warning in several users of the new kfifo
API.

It removes the __must_check attribute from kfifo_in() and
kfifo_in_locked() which must not necessary performed.

Fix the allocation bug in the nozomi driver file, by moving out the
kfifo_alloc from the interrupt handler into the probe function.

Fix the kfifo_out() and kfifo_out_locked() users to handle a unexpected
end of fifo.

Signed-off-by: Stefani Seibold <stefani@seibold.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-12-22 14:17:56 -08:00
Stefani Seibold 7acd72eb85 kfifo: rename kfifo_put... into kfifo_in... and kfifo_get... into kfifo_out...
rename kfifo_put...  into kfifo_in...  to prevent miss use of old non in
kernel-tree drivers

ditto for kfifo_get...  -> kfifo_out...

Improve the prototypes of kfifo_in and kfifo_out to make the kerneldoc
annotations more readable.

Add mini "howto porting to the new API" in kfifo.h

Signed-off-by: Stefani Seibold <stefani@seibold.net>
Acked-by: Greg Kroah-Hartman <gregkh@suse.de>
Acked-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Acked-by: Andi Kleen <ak@linux.intel.com>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-12-22 14:17:56 -08:00
Stefani Seibold e64c026dd0 kfifo: cleanup namespace
change name of __kfifo_* functions to kfifo_*, because the prefix __kfifo
should be reserved for internal functions only.

Signed-off-by: Stefani Seibold <stefani@seibold.net>
Acked-by: Greg Kroah-Hartman <gregkh@suse.de>
Acked-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Acked-by: Andi Kleen <ak@linux.intel.com>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-12-22 14:17:56 -08:00
Stefani Seibold c1e13f2567 kfifo: move out spinlock
Move the pointer to the spinlock out of struct kfifo.  Most users in
tree do not actually use a spinlock, so the few exceptions now have to
call kfifo_{get,put}_locked, which takes an extra argument to a
spinlock.

Signed-off-by: Stefani Seibold <stefani@seibold.net>
Acked-by: Greg Kroah-Hartman <gregkh@suse.de>
Acked-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Acked-by: Andi Kleen <ak@linux.intel.com>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-12-22 14:17:56 -08:00
Stefani Seibold 4546548789 kfifo: move struct kfifo in place
This is a new generic kernel FIFO implementation.

The current kernel fifo API is not very widely used, because it has to
many constrains.  Only 17 files in the current 2.6.31-rc5 used it.
FIFO's are like list's a very basic thing and a kfifo API which handles
the most use case would save a lot of development time and memory
resources.

I think this are the reasons why kfifo is not in use:

 - The API is to simple, important functions are missing
 - A fifo can be only allocated dynamically
 - There is a requirement of a spinlock whether you need it or not
 - There is no support for data records inside a fifo

So I decided to extend the kfifo in a more generic way without blowing up
the API to much.  The new API has the following benefits:

 - Generic usage: For kernel internal use and/or device driver.
 - Provide an API for the most use case.
 - Slim API: The whole API provides 25 functions.
 - Linux style habit.
 - DECLARE_KFIFO, DEFINE_KFIFO and INIT_KFIFO Macros
 - Direct copy_to_user from the fifo and copy_from_user into the fifo.
 - The kfifo itself is an in place member of the using data structure, this save an
   indirection access and does not waste the kernel allocator.
 - Lockless access: if only one reader and one writer is active on the fifo,
   which is the common use case, no additional locking is necessary.
 - Remove spinlock - give the user the freedom of choice what kind of locking to use if
   one is required.
 - Ability to handle records. Three type of records are supported:
   - Variable length records between 0-255 bytes, with a record size
     field of 1 bytes.
   - Variable length records between 0-65535 bytes, with a record size
     field of 2 bytes.
   - Fixed size records, which no record size field.
 - Preserve memory resource.
 - Performance!
 - Easy to use!

This patch:

Since most users want to have the kfifo as part of another object,
reorganize the code to allow including struct kfifo in another data
structure.  This requires changing the kfifo_alloc and kfifo_init
prototypes so that we pass an existing kfifo pointer into them.  This
patch changes the implementation and all existing users.

[akpm@linux-foundation.org: fix warning]
Signed-off-by: Stefani Seibold <stefani@seibold.net>
Acked-by: Greg Kroah-Hartman <gregkh@suse.de>
Acked-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Acked-by: Andi Kleen <ak@linux.intel.com>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-12-22 14:17:55 -08:00
Sujith b6ce5c3300 ath9k: Fix TX poll routine
Disable the TX hang monitoring routine when doing a scan.
Monitoring for a hung situation is not really necessary during
a scan run.

Cc: stable@kernel.org
Signed-off-by: Sujith <Sujith.Manoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-12-22 13:56:14 -05:00
Sujith 05c78d6d3e ath9k: Remove ANI lock
Cancel/restart the ANI timer directly.
With this patch, the ANI lock can be removed.

Signed-off-by: Sujith <Sujith.Manoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-12-22 13:56:12 -05:00
Sujith 0ce024cbcd ath9k: Clarify Interrupt mitigation
ath9k currently supports only RX interrupt
mitigation.

Signed-off-by: Sujith <Sujith.Manoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-12-22 13:56:10 -05:00
Emese Revfy 45d5d80598 iwlwifi: Constify struct iwl_ops
Signed-off-by: Emese Revfy <re.emese@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-12-22 13:56:09 -05:00
Johannes Berg ba37a3d039 iwlwifi: use new mac80211 SMPS
Instead of hard-coding the SM PS mode per hardware,
this makes iwlwifi support the new mac80211 API for
controlling the SM PS mode.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-12-22 13:56:07 -05:00
Stefan Seyfried 11466f1342 zd1211rw: improve ejecting of fake CDROM
The zd1211rw always assumed that the storage device is at endpoint 1,
but there are devices (Spairon Homelink 1202) that are at endpoint 0.
Try both, starting with 1 to make sure to not break existing setups.

Signed-off-by: Stefan Seyfried <seife@sphairon.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-12-22 13:56:05 -05:00
Stefan Seyfried 5b6e2f12ed ar9170usb: add Sphairon Homelink 1202 USB ID
Signed-off-by: Stefan Seyfried <seife@sphairon.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-12-22 13:56:03 -05:00
Luis R. Rodriguez c755ad34ab ath9k: add MCS rate index back to debufs rcstat
Speaking of 802.11n rates in terms of Mbps doesn't really developers
and is just useful for users. To aid debugging add the MCS index back
and an HT20/HT40 mode.

New screenshot:

    HT    MCS   Rate    Success    Retries   XRetries        PER
                6.0:          0          0          0          0
                9.0:          0          0          0          0
               12.0:         26        260          0         49
               18.0:         80        804          2         58
               24.0:          0          0          0          0
               36.0:          0          0          0          0
               48.0:          0          0          0          0
               54.0:          0          0          0          0
  HT20      0   6.5:       1368      13660          0         48
  HT20      1  13.0:          0          0          0          0
  HT20      2  19.5:          0          0          0          0
  HT20      3  26.0:          0          0          0          0
  HT20      4  39.0:          0          0          0          0
  HT20      5  52.0:         55        578         14         43
  HT20      6  58.5:         29        306          8         69
  HT20      7  65.0:         21        210          0         67
  HT20      8  13.0:         21        210          0         56
  HT20      9  26.0:          0          0          0          0
  HT20     10  39.0:          0          0          0          0
  HT20     11  52.0:          0          0          0          0
  HT20     12  78.0:          0          0          0          0
  HT20     13 104.0:          0          0          0          0
  HT20     14 117.0:          0          0          0          0
  HT20     15 130.0:         27        290         10         55
  HT40      0  13.5:         79        687         16         17
  HT40      1  27.5:         60        409         10         17
  HT40      2  40.5:         56        381         21         25
  HT40      3  54.0:         44        302         21         18
  HT40      4  81.5:         19        171          2         14
  HT40      5 108.0:          0          0          0          0
  HT40      6 121.5:          0          0          0          0
  HT40      7 135.0:          0          0          0          0
  HT40      7 150.0:          0          0          0          0
  HT40      8  27.0:          0          0          0          0
  HT40      9  54.0:          0          0          0          0
  HT40     10  81.0:          0          0          0          0
  HT40     11 108.0:         11        100          0         18
  HT40     12 162.0:         23        200          0         22
  HT40     13 216.0:         61        580          0         35
  HT40     14 243.0:         37        271          0         66
  HT40     15 270.0:         65        217          2         73
  HT40     15 300.0:          0          0          0          0

Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-12-22 13:55:56 -05:00
Jouni Malinen 265dc7f096 mac80211_hwsim: Check all local addresses for TX Ack status
Since mac80211_hwsim supports multiple virtual interfaces, we need to
iterate through all active interfaces when figuring out whether there
is a match during TX Ack status checking. This fixes TX status
reporting for cases where secondary interfaces are used.

Signed-off-by: Jouni Malinen <jouni.malinen@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-12-22 13:55:54 -05:00
Joe Perches d80050c4c3 iwmc3200wifi: Avoid an offset calculation for each management frame.
Determine the offset at compile time.

Signed-off-by: Joe Perches <joe@perches.com>
Acked-by: Zhu Yi <yi.zhu@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-12-22 13:44:03 -05:00
Holger Schurig 48631de921 libertas: remove priv->ratebitmap
Used to be a write-only-variable :-)

Signed-off-by: Holger Schurig <holgerschurig@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-12-22 13:44:03 -05:00
Holger Schurig 0e78ff8fcc libertas: remove priv->capability
This variable was once set to WLAN_CAPABILITY_SHORT_PREAMBLE and
there's no code that could change the variable to something else.
Therefore it seems this is not necessary :-)

Signed-off-by: Holger Schurig <holgerschurig@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-12-22 13:44:03 -05:00
Holger Schurig 4143a23de0 libertas: make mesh configurable
Mostly for the embedded people that know beforehand that they don't need
MESH at all and want to save some bytes, but also helpful for the upcoming
cfg80211 transition.

   text    data     bss     dec     hex filename
 114264    2308     140  116712   1c7e8 libertas.ko   with mesh
 105026    2000     140  107166   1a29e libertas.ko   without mesh
 --------------------------------------------------
  -9238    -308           -9546

Signed-off-by: Holger Schurig <holgerschurig@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-12-22 13:44:02 -05:00
Holger Schurig 602114ae59 libertas: add access functions for mesh open/connect status
Signed-off-by: Holger Schurig <holgerschurig@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-12-22 13:38:29 -05:00
Holger Schurig e4da1a81a9 libertas: move mesh SSID initialization into mesh.c
Signed-off-by: Holger Schurig <holgerschurig@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-12-22 13:38:29 -05:00
Holger Schurig cd74468b8c libertas: decouple mesh and rtap
While it's might be technically true that only MESH-enabled firmwares
are also RTAP-enabled, I like to have this decoupled.

Signed-off-by: Holger Schurig <holgerschurig@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-12-22 13:37:13 -05:00
Holger Schurig 55e1ff9244 libertas: move mesh-related definitions into mesh.h
Signed-off-by: Holger Schurig <holgerschurig@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-12-22 13:37:13 -05:00
Holger Schurig d6ede678c1 libertas: remove mesh_autostart_enabled and sync_channel
mesh_autostart_enabled was nowhere set. Rumor is that this is used in the
OLPC tree, but they never did submit their code upstream.

After removing this code, it turned out that the sync_channel stuff is now
also unused, so get rid of that as well.

Signed-off-by: Holger Schurig <holgerschurig@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-12-22 13:37:12 -05:00
Holger Schurig c24ef46e6b libertas: use priv->mesh_tlv instead of priv->mesh_fw_ver
Both variables contained the same information (no mesh, old mesh, new mesh).
So we can get rid of one variable.

Also move the mesh-version test from cmd.c into mesh.c.

Signed-off-by: Holger Schurig <holgerschurig@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-12-22 13:37:12 -05:00
Johannes Berg 8b73d13a21 mac80211_hwsim: implement ampdu action
Not that we actually ever aggregate anything, but
it could potentially be useful anyhow to simulate
aggregation sessions.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-12-22 13:31:17 -05:00
Johannes Berg 0f78231bff mac80211: enable spatial multiplexing powersave
Enable spatial multiplexing in mac80211 by telling the
driver what to do and, where necessary, sending action
frames to the AP to update the requested SMPS mode.

Also includes a trivial implementation for hwsim that
just logs the requested mode.

For now, the userspace interface is in debugfs only,
and let you toggle the requested mode at any time.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-12-22 13:31:16 -05:00
Zhu Yi 18974b5b0b iwmc3200wifi: rx aggregation support
When the device receives an A-MSDU frame (indicated by flag
IWM_RX_TICKET_AMSDU_MSK), use ieee80211_amsdu_to_8023s to convert
it to a list of 802.3 frames and handled them to upper layer.

Cc: Johannes Berg <johannes@sipsolutions.net>
Acked-by: Samuel Ortiz <samuel@sortiz.org>
Signed-off-by: Zhu Yi <yi.zhu@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-12-22 13:31:16 -05:00
Gertjan van Wingerde e54be4e735 rt2x00: Fix trimming of L2 padded frames.
Ensure that frames without payload are properly trimmed in
rt2x00queue_insert_l2pad.

This should fix the bug reported by Benoit Papillault in:
http://marc.info/?l=linux-wireless&m=125974773006734&w=2

Signed-off-by: Gertjan van Wingerde <gwingerde@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-12-21 18:56:41 -05:00
Benoit Papillault 5de42f9eea rt2x00: Fix rt2800usb RX frame format and as such L2PAD
According to Ralink source code, the RX frame format is RXINFO + RXWI +
802.11 frame + RXD, including various padding. Before this patch, we
were using RXD + RXWI + 802.11 frame, so RXD was not correct.

Doing this, we fix the L2PAD bit which is now correctly set on received
frames.

Signed-off-by: Benoit Papillault <benoit.papillault@free.fr>
Acked-by: Ivo van Doorn <ivdoorn@gmail.com>
Acked-by: Gertjan van Wingerde <gwingerde@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-12-21 18:56:39 -05:00
Benoit PAPILLAULT 9c8427d9de rt2x00: Disable RX aggregation for rt2800usb
RX aggregation is a way to receive multiple 802.11 frames in one RX buffer.
However, we don't know yet how to handle this case in rt2800usb_fill_rxdone
and this has probably no impact on RX performance as well, so we disable it

Signed-off-by: Benoit Papillault <benoit.papillault@free.fr>
Acked-by: Gertjan van Wingerde <gwingerde@gmail.com>
Acked-by: Ivo van Doorn <ivdoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-12-21 18:56:37 -05:00
Gertjan van Wingerde b734083349 rt2x00: Only remove L2 padding in received frames if there is payload.
L2 padding will only be present when there is actual payload present.

Signed-off-by: Gertjan van Wingerde <gwingerde@gmail.com>
Acked-by: Ivo van Doorn <ivdoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-12-21 18:56:36 -05:00
Gertjan van Wingerde 2e331462fc rt2x00: Reorganize L2 padding inserting function.
Simplify the rt2x00queue_insert_l2pad function by handling the alignment
operations one by one. Do not special case special circumstances.
Basically first perform header alignment, and then perform payload alignment
(if any payload does exist). This results in a properly aligned skb.

The end result is better readable code, with better results, as now L2 padding
is inserted only when a payload is actually present in the frame.

Signed-off-by: Gertjan van Wingerde <gwingerde@gmail.com>
Acked-by: Ivo van Doorn <ivdoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-12-21 18:56:34 -05:00
Gertjan van Wingerde 354e39dbb1 rt2x00: Remove SKBDESC_L2_PADDED flag.
With the improved L2 padding code, this flag is no longer necessary, as the
rt2x00queue_remove_l2pad is capable of detecting by itself if L2 padding is
applied.
For received frames the RX descriptor flag is still being checked.

Signed-off-by: Gertjan van Wingerde <gwingerde@gmail.com>
Acked-by: Ivo van Doorn <ivdoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-12-21 18:56:32 -05:00
Gertjan van Wingerde 77e73d1849 rt2x00: Further L2 padding fixes.
Fix a couple of more bugs in the L2 padding code:
1. Compute the amount of L2 padding correctly (in 3 places).
2. Trim the skb correctly when the L2 padding has been applied.

Also introduce a central macro the compute the L2 padding size.

Signed-off-by: Gertjan van Wingerde <gwingerde@gmail.com>
Acked-by: Ivo van Doorn <ivdoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-12-21 18:56:30 -05:00
Alban Browaeys 1398d4580e rt2x00 : trim the skb after having the l2pad removed.
Otherwise we end up truncating the skb before removing the l2pad
thus we might have the truncated part become garbage while getting
it back in remove_l2pad.
For the same issue: remove the skb_trim from the rt2800 fill_rxdone
(it is done after l2pad removal in rt2x00lib_rxdone).

Signed-off-by: Alban Browaeys <prahal@yahoo.com>
Acked-by: Gertjan van Wingerde <gwingerde@gmail.com>
Acked-by: Ivo van Doorn <ivdoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-12-21 18:56:29 -05:00