Archived
14
0
Fork 0
Commit graph

2252 commits

Author SHA1 Message Date
John W. Linville
53f36d70f0 iwlwifi/Kconfg: make IWLWIFI_LEDS invisible
Select IWLWIFI_LEDS automatically when either IWL3945_LEDS or
IWL4965_LEDS is selected.  This avoids potential misconfigurations
which lead to build failures for iwl-led.c.

Cc: Miles Lane <miles.lane@gmail.com>
Cc: reinette.chatre@intel.com
Signed-off-by: John w. Linville <linville@tuxdriver.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-04-08 16:44:39 -04:00
Johannes Berg
a0b484fee7 iwlwifi: fix some warnings
This fixes all kinds of warnings in iwlwifi.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-04-08 16:43:50 -04:00
John W. Linville
16788599a9 drivers/net/wireless/iwlwifi/iwl-debugfs.c: fix another '%llu' warning
drivers/net/wireless/iwlwifi/iwl-debugfs.c: In function ‘iwl_dbgfs_stations_read’:
drivers/net/wireless/iwlwifi/iwl-debugfs.c:247: warning: format ‘%llu’ expects type ‘long long unsigned int’, but argument 4 has type ‘u64’

Cc: Reinette Chatre <reinette.chatre@intel.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-04-08 15:05:57 -04:00
Denys Vlasenko
2aee82de52 wavelan_cs: stop inlining largish static functions
Hi John,

Can you please take a look at this patch?

drivers/net/wireless/wavelan_cs.c has unusually large number
of static inline functions - 27.

I looked through them and 20 of them do not seem to warrant inlining.
Some are really big; others call mdelay(1) or busy-wait for a bit
to be set in a hardware register - it's pointless
to optimize such functions for speed.

This patch removes "inline" from these static function
(regardless of number of callsites - gcc nowadays auto-inlines
statics with one callsite).

Size difference for 32bit x86:

   text    data     bss     dec     hex filename
  17020     372       8   17400    43f8 linux-2.6-ALLYES/drivers/net/wireless/wavelan_cs.o
  14032     356       8   14396    383c linux-2.6.inline-ALLYES/drivers/net/wireless/wavelan_cs.o

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
--
vda
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-04-08 15:05:57 -04:00
Luis R. Rodriguez
7b463ced63 prism54: set carrier flags correctly
> prism54 should set the carrier flags correctly when it thinks the
> link can be used.

Agreed, so sure, this is OK but I rather we turn the carrier on
or off *before* sending an event, like this.

Signed-off-by: Roy Marples <uberlord@gentoo.org>
Signed-off-by: Luis R. Rodriguez <mcgrof@winlab.rutgers.edu>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-04-08 15:05:57 -04:00
Michael Buesch
8fe2b65a18 ssb: Turn suspend/resume upside down
Turn the SSB bus suspend mechanism upside down.
Instead of deciding by an internal reference count when to suspend/resume,
let the parent bus call us in their suspend/resume routine.

Signed-off-by: Michael Buesch <mb@bu3sch.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-04-08 15:05:57 -04:00
Michael Buesch
5100d5ac81 b43: Add PIO support for PCMCIA devices
This adds PIO support back (D'oh!) for PCMCIA devices.
This is a complete rewrite of the old PIO code. It does actually work
and we get reasonable performance out of it on a modern machine.
On a PowerBook G4 I get a few MBit for TX and a few more for RX.
So it doesn't work as well as DMA (of course), but it's a _lot_ faster
than the old PIO code (only got a few kBit with that).

The limiting factor is the host CPU speed. So it will generate 100%
CPU usage when the network interface is heavily loaded. A voluntary preemption
point in the RX path makes sure Desktop Latency isn't hurt.

PIO is needed for 16bit PCMCIA devices, as we really don't want to poke with
the braindead DMA mechanisms on PCMCIA sockets. Additionally, not all
PCMCIA sockets do actually support DMA in 16bit mode (mine doesn't).

Signed-off-by: Michael Buesch <mb@bu3sch.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-04-08 15:05:56 -04:00
Tomas Winkler
3109ece111 iwlwifi: Eliminate association from beacon
This patch removes association from beacon
using bss_info_change handler for association

Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-04-08 15:05:56 -04:00
Tomas Winkler
98952d5dec iwlwifi: eliminate conf_ht
This patch eliminates the use of conf_ht in iwlwifi driver, replacing it
with bss_info_changed.

Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Ron Rindjunsky <ron.rindjunsky@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-04-08 15:05:56 -04:00
Abhijeet Kolekar
7981a35ed0 iwlwifi: fix n-band association problem
This patch enables the IWL4965_HT flag (n-band) in Kconfig.
Removed the "depends on n" from Kconfig for config IWL4965_HT

Signed-off-by: Abhijeet Kolekar <abhijeet.kolekar@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-04-07 22:19:29 -04:00
Daniel Drake
3f2eeac979 ipw2200: set MAC address on radiotap interface
Commit bada339ba2 enforces that all
interfaces have a valid MAC address before they are brought up.

ipw2200 does not assign a MAC address to it's radiotap interface, meaning
that the radiotap interface cannot be brought up in 2.6.24.
https://bugs.gentoo.org/show_bug.cgi?id=215714

Fix this by copying the MAC address from the real interface.

Signed-off-by: Daniel Drake <dsd@gentoo.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-04-07 22:19:29 -04:00
Holger Schurig
877cb0d4af libertas: fix mode initialization problem
After moving lbs_find_best_network_ssid() from scan.c to assoc.c gcc was
able to deduce that new_mode might stay uninitialized.

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>
2008-04-07 22:19:28 -04:00
David S. Miller
e1ec1b8ccd Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6
Conflicts:

	drivers/net/s2io.c
2008-04-02 22:35:23 -07:00
John W. Linville
06501d29ad wireless: fix various printk warnings on ia64 (and others)
drivers/net/wireless/ath5k/base.c: In function `ath5k_check_ibss_tsf':
drivers/net/wireless/ath5k/base.c:1740: warning: long long unsigned int format, u64 arg (arg 5)
drivers/net/wireless/ath5k/base.c:1740: warning: long long unsigned int format, u64 arg (arg 6)
drivers/net/wireless/ath5k/base.c:1740: warning: long long int format, u64 arg (arg 7)
drivers/net/wireless/ath5k/base.c:1740: warning: long long unsigned int format, u64 arg (arg 8)
drivers/net/wireless/ath5k/base.c:1757: warning: long long unsigned int format, u64 arg (arg 5)
drivers/net/wireless/ath5k/base.c:1757: warning: long long unsigned int format, u64 arg (arg 6)
drivers/net/wireless/iwlwifi/iwl4965-base.c: In function `iwl4965_tx_status_reply_tx':
drivers/net/wireless/iwlwifi/iwl4965-base.c:3105: warning: long long unsigned int format, u64 arg (arg 6)
drivers/net/wireless/iwlwifi/iwl-4965.c: In function `iwl4965_rx_reply_rx':
drivers/net/wireless/iwlwifi/iwl-4965.c:3978: warning: long long unsigned int format, u64 arg (arg 7)

Cc: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-04-01 17:38:47 -04:00
Ivo van Doorn
a2e1d52a32 rt2x00: Remove MAC80211_LEDS dependency
Implement triggers inside rt2x00 itself based
on input from mac80211. This replaces the method
of using the mac80211 trigger events which do
not work for USB drivers due to the scheduling
requirement.

After this patch RT2500USB_LEDS and RT73USB_LEDS
no longer need to be tagged as broken since they
now support LED handling again without having to
check for in_atomic().

Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-04-01 17:14:09 -04:00
Ivo van Doorn
e0b005fa14 rt2x00: TO_DS filter depends on intf_ap_count
The TO_DS filter does not only depend on the FIF_PROMISC_IN_BSS flag
provided by mac80211, but also on the intf_ap_count count.
This makes sense, since when Master mode is active, we should all frames
that are send to the active AP (the device itself).

This means that when an interface is added we should force the
packet filter to be updated during the next mac80211 call of
configure_filter() to make sure the intf_ap_count field is checked.

Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-04-01 17:14:08 -04:00
Ivo van Doorn
bc5213f468 rt2x00: Invert scheduled packet_filter check
Invert the check for scheduling the packet_filter configuration.
When DRIVER_REQUIRE_SCHEDULED is not set we should immediately
configure the the filter.

This fixes the 'infinite calls to rt2x00mc_configure_filter'
bug reported by Bas Hulsken.

Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-04-01 17:13:20 -04:00
Tomas Winkler
e5472978ef iwlwifi: Fix synchronous host command
This patch replaces static variable from send_cmd_sync
with flag in priv->status. It was used for reentrance protection
but clearly made it impossible to stuck more cards into the same machine

In addition it force check of return values of synchronous commands
commands that doesn't requires return value async commands have to be used

Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Yi Zhu <yi.zhu@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-04-01 17:13:19 -04:00
Tomas Winkler
a571ea4eb3 iwlwifi: LED initialize before registering
This patch initialize all fields in led before registering it
This fixes oops on initialization

Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-04-01 17:13:19 -04:00
Ron Rindjunsky
c4f552321f iwlwifi: unregister to upper stack before releasing resources
This patch fixes an early release of driver's resources before upper stack
was notified that low-level driver shuts down.

Signed-off-by: Ron Rindjunsky <ron.rindjunsky@intel.com>
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-04-01 17:13:19 -04:00
Reinette Chatre
897e1cf29e iwlwifi: move rate registration to module load
Having rate registration during module load enables the use of
error checking as well as reliable registration/unregistration
pairing. Previously this was not possible as rate registration
was done during _probe where _probe could be run for more than
one device on the system.

Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-04-01 17:13:19 -04:00
Mohamed Abbas
0359facc7b iwlwifi: fix race condition during driver unload
This patch fixed the OOPS when load the driver while rf-kill is on then
unload the driver right after load. a race condition caused the interupt
handler to schedule the tasklet which will run right after the driver pci_remove
causing invalid poiter OOPS.

Signed-off-by: Mohamed Abbas <mabbas@linux.intel.com>
Signed-off-by: Joonwoo Park <joonwpark81@gmail.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-04-01 17:13:18 -04:00
Mohamed Abbas
ad97edd2f5 iwlwifi: hook iwlwifi with Linux rfkill
This patch hook IWL with Linux rfkill.

Signed-off-by: Mohamed Abbas <mabbas@linux.intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-04-01 17:13:18 -04:00
Mohamed Abbas
c8381fdcab iwlwifi: add notification infrastructure to iwlcore
This patch add notification function to be called by low level
iwl driver to notify iwlcore with current state. This function
will call iwlcore subsystem with the new state. This will
help make the code more consistent and easy to extend. For example
the rf-kill need to know when the driver in init, start, stop or
remove state. Instead doing the same call in 3945 and 4965, we
just do it from this function.

Signed-off-by: Mohamed Abbas <mabbas@linux.intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-04-01 17:13:18 -04:00
John W. Linville
3480a58a90 rt2x00: fixup some non-functional merge errors
These small changes restore the rt2x00 sources to the way Ivo intended.

Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-04-01 17:13:17 -04:00
Holger Schurig
04850a47aa libertas: don't depend on IEEE80211
Runtime-wise we only need escape_ssid from the deprecated IEEE80211
subsystem. However, it's easy to provide our own copy.

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>
2008-04-01 17:13:17 -04:00
Holger Schurig
f539f2efe9 libertas: convert sleep/wake config direct commands
Confirm sleep event: they come very regularly, eventually several times per
second. Therefore we want to send the config command as fast as possible.
The old code pre-set the command in priv->lbs_ps_confirm_sleep. However, the
byte sequence to be sent to the hardware is the same for all interfaces. So
this patch make this an extern structure, initialized at module load time.

Config wake event: normal conversion to a direct command. However, I don't know
how to trigger a "HOST AWAKE" event from the firmware, so this part is
untested.

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>
2008-04-01 17:13:17 -04:00
Holger Schurig
7460f5a690 libertas: convert CMD_802_11_EEPROM_ACCESS to a direct command
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>
2008-04-01 17:13:16 -04:00
Holger Schurig
2af9f039a1 libertas: convert CMD_802_11_MAC_ADDRESS to a direct command
* directly call lbs_cmd_with_response()
* only overwrite priv->current_addr once the firmware call succeeded

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>
2008-04-01 17:13:16 -04:00
Al Viro
717ddc0ebd endianness annotations: drivers/net/wireless/rtl8180_dev.c
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-04-01 17:13:16 -04:00
Michael Buesch
e645890115 b43: Fix PCMCIA IRQ routing
This fixes the IRQ routing on PCMCIA devices.
With this patch the card will finally be able to receive IRQs.

Signed-off-by: Michael Buesch <mb@bu3sch.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-04-01 15:44:08 -04:00
Michael Buesch
539e6f8cff b43: Add DMA mapping failure messages
This adds messages for some DMA mapping failures.
These are useful for debugging DMA address problems, as they appear
on x86_64 machines with IOMMU enabled.

Signed-off-by: Michael Buesch <mb@bu3sch.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-04-01 15:44:08 -04:00
David S. Miller
8e8e43843b Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6
Conflicts:

	drivers/net/usb/rndis_host.c
	drivers/net/wireless/b43/dma.c
	net/ipv6/ndisc.c
2008-03-27 18:48:56 -07:00
Holger Schurig
e5225b3973 libertas: reduce debug output
This patch tries to make dmesg logs between different runs easier
to compare by

* removing the jiffies (use CONFIG_PRINTK_TIME if you need
  timing)
* remove the line numbers, they change with each applied patch

It also changes the deprecated __FUNCTION__ to __func__ to make
checkpatch.pl happy.

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>
2008-03-27 16:08:08 -04:00
John W. Linville
8dd62822dd prism54: correct thinko in "prism54: Convert stats_sem in a mutex"
mutex_trylock has different return code semantics than down_trylock...

Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-03-27 16:03:22 -04:00
Ron Rindjunsky
cee24a3e58 mac80211: A-MPDU MLME use dynamic allocation
This patch alters the A-MPDU MLME in sta_info to use dynamic allocation,
thus drastically improving memory usage - from a constant ~2 Kbyte in
the previous (static) allocation to a lower limit of ~200 Byte and an upper
limit of ~2 Kbyte.

Signed-off-by: Ron Rindjunsky <ron.rindjunsky@intel.com>
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-03-27 16:03:20 -04:00
Holger Schurig
7d57961183 libertas: the compact flash driver is no longer experimental
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>
2008-03-27 16:03:19 -04:00
Holger Schurig
62436138c8 libertas: remove CMD_802_11_PWR_CFG
This has nowhere been used. Note: in the firmware manual this was
documented as CMD_802_11_PA_CFG. If we ever need it, we can/should
re-implement it as a direct command.

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>
2008-03-27 16:03:19 -04:00
Holger Schurig
c2b310a73b libertas: kill useless #define LBS_MONITOR_OFF 0
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>
2008-03-27 16:03:19 -04:00
Tomas Winkler
69dc5d9da5 iwlwifi: iwl_priv - clean up in types of members
This patch fix types of is_open and iw_mode members
of iwl_priv sturct

Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-03-27 16:03:18 -04:00
Emmanuel Grumbach
0472f887e0 iwlwifi: allow a default callback for ASYNC host commands
This patch provides a default callback for ASYNC host commands instead
of calling to BUG_ON. Most of the callbacks are now just empty functions

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>
2008-03-27 16:03:18 -04:00
Tomas Winkler
775ea378fa iwlwifi: improve NIC i/o debug prints information
This patch gives the function's caller name in case NIC
access reference count was not used by it.

Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Ron Rindjunsky <ron.rindjunsky@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-03-27 16:03:17 -04:00
Tomas Winkler
3395f6e9cf iwlwifi: rename iwl-4965-io.h to iwl-io.h
This patch renames iwl-4965-io.h back to iw-io.h
it also remove 4965 from all functions it supplies

Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-03-27 16:03:17 -04:00
Mohamed Abbas
ab53d8af67 iwlwifi: Add led support
This patch add LEDS support to 3965 and 4965 drivers. It is based on
led trigger and class. For our drivers we needed to avoid two things.
1- We receive led trigger on/off on each Rx\Tx frame. In our driver
    we can not call led command like that. In this driver once driver
    receive a start of traffic it call the led command to start blinking
    then we count all bytes of Tx and Rx frame, after two second we count the
    blink rate of last two second then id blink rate changed we call the led
     commands
2- Since we can call led command very often, we make sure we call the
    led command after we receive the statistics notification so
    we don't need to wake up the ucode id it is in sleep state.
    This patch was tested with 4965 and 3945.

Signed-off-by: Mohamed Abbas <mabbas@linux.intel.com>
Signed-off-by: Ian Schram<ischram@telenet.be>
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-03-27 16:03:16 -04:00
John W. Linville
e0e0a67e44 iwlwifi: do not register bands with no supported channels
Otherwise, b/g-only devices fail in wiphy_register.

Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-03-27 15:51:21 -04:00
Ivo van Doorn
9896322ae1 rt2x00: Ignore set_state(STATE_SLEEP) failure
Some hardware never seem to accept the "goto sleep" command, since the legacy
drivers don't have suspend and resume handlers the entire code for it was
basically a educated guess (based on the "enable radio" code).
This patch will only print a warning when the "goto sleep" command fails, and
just continues as usual. Perhaps that means the device will not reach a sleep
state and consumes more power then it should, but it is equally possible it
simply needs some seconds longer to sleep. Anyway, by making the command
non-fatal it will not block the rest of the suspend procedure.

Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-03-27 14:51:39 -04:00
Julia Lawall
ebd9302842 drivers/net/wireless/iwlwifi/iwl-4965.c: correct use of ! and &
In commit e6bafba5b4, a bug was fixed that
involved converting !x & y to !(x & y).  The code below shows the same
pattern, and thus should perhaps be fixed in the same way.

This is not tested and clearly changes the semantics, so it is only
something to consider.

The semantic patch that makes this change is as follows:
(http://www.emn.fr/x-info/coccinelle/)

// <smpl>
@@ expression E1,E2; @@
(
  !E1 & !E2
|
- !E1 & E2
+ !(E1 & E2)
)
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Cc: Tomas Winkler <tomas.winkler@intel.com>
Cc: Guy Cohen <guy.cohen@intel.com>
Cc: Reinette Chatre <reinette.chatre@intel.com>
Cc: Zhu Yi <yi.zhu@intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-03-27 14:51:39 -04:00
Holger Schurig
dd1f635fe0 libertas: fix spinlock recursion bug
This fixes a bug detected by CONFIG_DEBUG_SPINLOCK:

if_cs_get_int_status() is only called from lbs_thread(), via
priv->hw_get_int_status. However, lbs_thread() has already taken the
priv->driver_lock. So it's a fault to take the same lock again here.

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>
2008-03-27 14:28:30 -04:00
Ivo van Doorn
3a643d244f rt2x00: Fix in_atomic() usage
rt73usb and rt2500usb used in_atomic to determine
if a configuration step should be rescheduled or not.
Since in_atomic() is not a valid method to determine
if sleeping is allowed we should fix the way this is handled
by adding a new flag to rt2x00.

In addition mark LED class support for the drivers broken
since that also uses the broken in_atomic() method but
so far no solution exists to have LED triggers work only
in scheduled context.

Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-03-25 16:42:00 -04:00
Ivo van Doorn
866a050384 rt2x00: Fix rate detection for invalid signals
It has been observed on rt2500pci hardware that some
frames received with signal 0x0C do not have the OFDM
flag set.

Signals can have 2 meanings:
 1) The PLCP value
 2) The bitrate * 10

For rt2500pci (1) is for frames received with a OFDM rate,
and (2) is for frames received with a CCK rate.
But 0x0C is a invalid bitrate value but is a valid PLCP
value for 54Mbs (obvious OFDM rate).
This means that it is possible that the hardware does not
set the OFDM bit correctly under all circumstances.
This results in rt2x00 failing to detect the rate and
mac80211 triggering a WARN_ON() and dropping the frame.

To bypass this, print a warning when such a frame is received,
and reset the rate to the lowest supported rate for the current band.

Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-03-25 16:42:00 -04:00
Michael Buesch
c01f9c6f1d b43: Don't compile N-PHY code when N-PHY is disabled
There's no need to compile the N-PHY support code, when the
N-PHY support is disabled in Kconfig.

Signed-off-by: Michael Buesch <mb@bu3sch.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-03-25 16:41:59 -04:00
Assaf Krauss
1ea8739648 iwlwifi: Completing the parameter packaging
This patch completes the changes regarding the packaging of user
parameters.

Signed-off-by: Assaf Krauss <assaf.krauss@intel.com>
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-03-25 16:41:58 -04:00
Al Viro
83f7d57c37 ipw2200 annotations and fixes
a) a bunch of printks in error-handling assums that ->status is
big-endian.
b) bitfields trouble
c) missing annotations

NB: a bunch of structs is declared packed for no good reason, AFAICS.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Acked-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-03-25 16:41:58 -04:00
Ivo van Doorn
19d30e0299 rt2x00: Add dev_flags to rx descriptor
The rxdone_entry_desc structure contains 3 fields
which are always 1 or 0. We can safe 8 bytes by
replacing them with a single dev_flags fields which
contain the flags for those settings.

Additionally we can remove the OFDM flag since it
is no longer used since the introduction of the
SIGNAL_PLCP flag.

Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-03-25 16:41:58 -04:00
Tomas Winkler
857485c0c4 iwlwifi: move host command sending functions to core module
1. Host command sending functions moved from iwl4965-base.c to iwl-hcmd.c
in iwlcore module
2. enqueue_hcmd function currently stays in iwl4965-base.c. It is invoked
   through the new 'utils' field in priv's ops.

Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Assaf Krauss <assaf.krauss@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-03-25 16:41:55 -04:00
Assaf Krauss
8622e7058a iwlwifi: rename iwl4965_get_channel_info to iwl_get_channel_info
iwl4965_get_channel_info was moved to iwlcore module
4965 needs to be stripped off

Signed-off-by: Assaf Krauss <assaf.krauss@intel.com>
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-03-25 16:41:54 -04:00
Tomas Winkler
410e088d53 iwlwifi: iwl3945 remove 4965 commands
This patch removes 4965 host commands from iwl-3945-commands.h

Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-03-25 16:41:54 -04:00
Emmanuel Grumbach
ab885f8c45 iwlwifi-2.6: enables RX TKIP decryption in HW
This patch enables RX TKIP decryption in HW.

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>
2008-03-25 16:41:53 -04:00
Emmanuel Grumbach
2bc750899f iwlwifi-2.6: enables HW TKIP encryption
This patch add support for TKIP encryption (TX) in HW.

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>
2008-03-25 16:41:53 -04:00
Emmanuel Grumbach
17e476b8db iwlwifi-2.6: RX status translation to old scheme
This patch adds translation for the RX status of an incoming packet.
The incoming status has to be translated to the old scheme in order to know
if the decryption has been done, MIC failure has occured, TTAK is valid etc...
This translation is mandatory for all RX packets when using 5300 and for
all HT packets using 4965.

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>
2008-03-25 16:41:52 -04:00
Emmanuel Grumbach
deb09c435e iwlwifi-2.6: Cleans up set_key flow
This patch cleans up the set_key flow. Rxon with hw encryption bit set is
not sent upon each call to set_key. Separation is made between global key
(WEP) and dynamic key (TKIP + CCMP and WEP in some cases).

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>
2008-03-25 16:41:52 -04:00
Assaf Krauss
bf85ea4fbe iwlwifi: Probe Flow - Extracting hw and priv init
1. Extracting hw and priv initialization from probe function.
2. Moving some initialization functions to core module.

Signed-off-by: Assaf Krauss <assaf.krauss@intel.com>
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-03-25 16:41:51 -04:00
Assaf Krauss
1d0a082d38 iwlwifi: Probe Flow - Performing allocation in a separate function
Performing allocation in a separate function (previously handled in
'probe')

Signed-off-by: Assaf Krauss <assaf.krauss@intel.com>
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-03-25 16:41:51 -04:00
Assaf Krauss
00acbc9135 iwlwifi: Packing all 4965 parameters
This patch defines a package struct for iwlwifi parameters, and uses a
single instance of this struct to group all iwl4965 module parameters
together.

Signed-off-by: Assaf Krauss <assaf.krauss@intel.com>
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-03-25 16:41:51 -04:00
Assaf Krauss
316c30d9dd iwlwifi: Re-ordering probe flow (4965)
This patch re-orders the iwl4965_pci_probe function.

Signed-off-by: Assaf Krauss <assaf.krauss@intel.com>
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-03-25 16:41:50 -04:00
Reinette Chatre
99f7d39bb0 iwlwifi: remove macros containing offsets from eeprom struct
A user needing to access these fields can use offsetof() for
access. The comments still contain the offset to assist with
debugging.

Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
CC: Michael Buesch <mb@bu3sch.de>
Signed-off-by: Assaf Krauss <assaf.krauss@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-03-25 16:41:50 -04:00
Holger Schurig
ff829ae016 libertas: store rssi as an u32
Don't store an (hardware base) u8 value in bss_descriptor, but just an
unsigned int (RSSI is really unsigned). Compilers generate more efficent
code for ints than for bytes.

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>
2008-03-25 16:41:50 -04:00
Holger Schurig
e98a88dd33 libertas: remove lots of unused stuff
This removes many unused function parameters as well as some not-implemented
functions, e.g. CMD_802_11_GET_STATS. The silly lbs_set_cmd_ctrl_node()
function is now also gone.

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>
2008-03-25 16:41:49 -04:00
Holger Schurig
d4ff0ef635 libertas: misc power saving adjusts
* firmware for the CF card supports power saving
* the driver currenly only accept "iwconfig ethX power on|off", so
  I fixed what the range wext ioctl reports.
* initialize value/flags in lbs_get_power()
* get rid of unused parameter psmode in lbs_ps_confirm_sleep()
* some minor debug output tweaks

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>
2008-03-25 16:41:49 -04:00
Holger Schurig
c49c3b77c8 libertas: convert GET_LOG to a direct command
Now uses __lbs_cmd() to get the "log" (it's actually more a snapshot of
various counters, not a sequential log). Besides the "mechanical" convertion
the patch add the following logical changes:

* Removes the priv->logmsg variable, it was only used in one place anyway,
  also don't blindly get the counters when associating. Getting the
  counters then the user asks via WEXT for them is good enought.
* don't set wstats.discard.fragment with log.rxfrag, because the latter is
  a counter for successfully received packets, not for fragmented packets.

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>
2008-03-25 16:41:48 -04:00
Holger Schurig
c97329e21f libertas: fix scheduling while atomic bug in CMD_MAC_CONTROL
The old code incorrectly used lbs_cmd_with_response() and now uses
lbs_cmd_async().

While there I noticed that there is no real useful return values for
asynchronous command functions, so I made the function "void".

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>
2008-03-25 16:41:48 -04:00
Holger Schurig
8db4a2b986 libertas: make a handy lbs_cmd_async() command
This uses a static lbs_cmd_async_callback function, which is a
noop. Just setting the callback argument to __lbs_cmd_async()
to NULL won't work, because then the cmdnode wouldn't be
released.

This also makes __lbs_cmd_async() a static method, which is
now only used by lbs_cmd() and lbs_cmd_async().

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>
2008-03-25 16:41:48 -04:00
Tomas Winkler
712b6cf57a iwlwifi: Add debugfs to iwl core
This patch adds debugfs support to iwl core
currently only iwl4965 is supported

Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-03-25 16:41:47 -04:00
Tomas Winkler
19758bef09 iwlwifi: Add TX/RX statistcs to driver
This patch supports collecting of TX and RX statistics in the driver.

Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-03-25 16:41:47 -04:00
Tomas Winkler
c79dd5b5bc iwlwifi: rename struct iwl4965_priv to struct iwl_priv
This patch renames iwl4965_priv to iwl_priv. iwl_priv  will
be shared by more hw.

Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-03-25 16:41:47 -04:00
Tomas Winkler
0a6857e70d iwlwifi: rename iwl-4965-debug.h back to iwl-debug.h
This patch removes iwl-4965-debug.h to iwl-debug.h
It will be used by more NICs

Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-03-25 16:41:46 -04:00
Max Stepanov
8236e183fc iwlwifi: Bug fix, CCMP with HW encryption with AGG
This patch fixes a bug in security. Enables CCMP HW encryption with
aggregations.

Signed-off-by: Max Stepanov <max.stepanov@intel.com>
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-03-25 16:41:46 -04:00
Holger Schurig
56ca84c61b libertas: remove some unused commands
Neither CMD_802_11_PAIRWISE_TSC nor CMD_802_11_GROUP_TSC is used or
documented. It might have something to do with TKIP sequence counters,
but that's just an educated guess. Remove all occurences of them.

CMD_CODE_DNLD is also neither used nor documented.

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>
2008-03-25 16:41:45 -04:00
Holger Schurig
d9e9778c2a libertas: rename packetfilter to mac_control
The CMD_MAC_CONTROL can be used for other things than just filtering
packets, e.g. to enable and disable WMM. This uses the same term mac_control
for the define, the function and the shadow value in struct lbs_private.

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>
2008-03-25 16:41:45 -04:00
Holger Schurig
835d3ac5e8 libertas: convert CMD_MAC_CONTROL to a direct command
convert CMD_MAC_CONTROL to a direct command

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>
2008-03-25 16:41:45 -04:00
Michael Buesch
7a193a5df7 b43: Remove irqs_disabled() sanity checks
Remove all irqs_disabled() sanity checks, as they are not safe on
a RT-enabled kernel and will trigger bogus warnings.

Signed-off-by: Michael Buesch <mb@bu3sch.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-03-24 19:25:09 -04:00
Michael Buesch
ffa9256aaa b43: Fix DMA mapping leakage
This fixes a DMA mapping leakage in the case where we reject a DMA
buffer because of its address.

Signed-off-by: Michael Buesch <mb@bu3sch.de>
Cc: Christian Casteyde <casteyde.christian@free.fr>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-03-24 19:25:09 -04:00
Reinette Chatre
c83dbf687f iwlwifi: fix __devexit_p points to __devexit functions
The iwlxxxx_pci_remove functions are not needed when drivers are not
compiled as modules - they can thus be discarded at kernel link time.
This is already captured by having them as __devexit_p in the pci_driver
struct - these are supposed to be pointers to __devexit functions, but was not.
This is now fixed.

This problem was reported by Toralf Forster when testing the compilation of
2.6.25-rc6.

Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
CC: Toralf Forster <toralf.foerster@gmx.de>
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-03-24 19:25:08 -04:00
John W. Linville
9fe0a8c838 arlan: fix warning when PROC_FS=n
drivers/net/wireless/arlan-proc.c:1216: warning: 'arlan_root_table' defined but not used

Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-03-24 19:25:08 -04:00
Rick Farrington
a9f46786ec iwlwifi: mac start synchronization issue
This patch fixes a synchronization problem on the 4965 and 3945 with the
mac start callback routine.  The problem is that this function exits BEFORE the
'xxx_alive_start' has completed.  This can lead to a problem if a
subsequent MAC callback attempts to issue a firmware command.

Signed-off-by: Rick Farrington <rickdic@hotmail.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-03-24 19:25:08 -04:00
Al Viro
ea995abfed wavelan_cs arm fix
Even when all fields are unsigned char, struct still might have
alignment > 1.  Does so on arm, unless you explicitly say that
it's packed...

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-03-24 19:25:07 -04:00
Masakazu Mokuno
0a74892b6d rt2x00: Add id for Corega CG-WLUSB2GPX
This adds the id for Corega CG-WLUSB2GPX.

Signed-off-by: Masakazu Mokuno <mokuno@sm.sony.co.jp>
Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-03-24 19:25:07 -04:00
Pascal Terjan
7c44b6e922 iwlwifi: fix a typo in Kconfig message
Signed-off-by: Pascal Terjan <pterjan@mandriva.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-03-24 19:25:07 -04:00
Andrew Morton
247df4548f [RT2X00] drivers/net/wireless/rt2x00/rt2x00dev.c: remove dead code, fix warning
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
2008-03-18 17:15:58 -07:00
David S. Miller
577f99c1d0 Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6
Conflicts:

	drivers/net/wireless/rt2x00/rt2x00dev.c
	net/8021q/vlan_dev.c
2008-03-18 00:37:55 -07:00
Reinette Chatre
26c0f03f6b iwlwifi: fix bug to show hidden APs during scan
Indirect scanning ('iwlist scan') should report information about
hidden APs. When an AP is hidden it does not respond to active scanning,
we thus have to use passive scanning to locate these APs.

This fixes http://bughost.org/bugzilla/show_bug.cgi?id=1499

Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Tested-by: Bill Moss <bmoss@clemson.edu>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-03-13 19:32:33 -04:00
Tomas Winkler
35cdeaf410 iwlwifi: change rate number to a constant
This patch moves a number to an understandable define

Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Ron Rindjunsky <ron.rindjunsky@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-03-13 19:32:33 -04:00
Tomas Winkler
0310ae721d iwlwifi: Fix endianity in debug print
This patch fix debug print out endianity issue for bitmap
Since u64 and le64 variables are casted to unsigned long long,
after patch 'wireless: correct warnings from using '%llx' for type 'u64'
also bitmaps need to be converted to native endianity

Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-03-13 19:32:33 -04:00
Assaf Krauss
6bc913bd96 iwlwifi: Use eeprom form iwlcore
This patch puts in use eeprom from iwlcore module

Signed-off-by: Assaf Krauss <assaf.krauss@intel.com>
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-03-13 19:32:32 -04:00
Reinette Chatre
eb7ae89cb0 iwlwifi: update copyright year
Also fix a copy and paste error in header of iwl-core.c. This file
is not dual licensed.

Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-03-13 19:32:32 -04:00
Tomas Winkler
a4062b8fd2 iwlwifi: Use sta_bcast_id variable instead of BROADCAST_ID constant
This patch removes iwlYYY_BROADCAST_ID from run time usage.
hw_setting.sta_bcast_id is used instead.

Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-03-13 19:32:32 -04:00
Ivo van Doorn
8ed0985407 rt2x00: Only strip preamble bit in rt2400pci
Only rt2400pci can have the preamble bit set in the PLCP value,
for all other drivers it should not be cleared since that will
conflict with the plcp values for OFDM rates.

Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-03-13 19:32:31 -04:00
Ivo van Doorn
f0e62e46c3 rt2x00: Release rt2x00 2.1.4
Version bump to 2.1.4

Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-03-13 19:32:31 -04:00
Ivo van Doorn
89993890ae rt2x00: Fix rt2400pci signal
After sampling hundreds of RX frame descriptors,
the results were conclusive:
- The Ralink documentation regarding the SIGNAL and RSSI are wrong.

It turns out that of the 5 BBR registers, we should not use BBR0 and BBR1
for SIGNAL and RSSI respectively, but actually BBR1 and BBR2.
BBR0 does show values, but the exact meaning remains unclear,
but they cannot be translated into a SIGNAL or RSSI field.
BBR3, BBR4 and BBR5 are always 0, so their meaning is unknown.

As it turns out, the reported SIGNAL is the PLCP value, this
in contradiction to what was expected looking at rt2500pci which
only reported the PLCP values for OFDM rates and bitrate values
for CCK rates.

This means we should let the driver raise the flag about the contents
of the SIGNAL field so rt2x00lib can always do the right thing based
on what the driver reports.

Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-03-13 19:32:31 -04:00
Ivo van Doorn
dac37d7208 rt2x00: Fix RX DMA ring initialization
Due to a terrible typo the RX DMA base address
was initialized to the beacon base address.
Obviously bad things happen with bugs like that....

Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-03-13 19:32:30 -04:00
Ivo van Doorn
aa776721b4 rt2x00: Fix basic rate initialization
The basic rate which is configured in the register
should not match all supported rates, but only the _basic_ rates.

Fix this by adding a new flag to the rt2x00_rate structure
and whenever the mode is changed, loop over all available rates
for that band to get the basic rate mask.

Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-03-13 19:31:42 -04:00
Ivo van Doorn
fd3c91c5e5 rt2x00: Always enable TSF ticking
Whatever mode we are in, according to the legacy drivers
we should always enable TSF ticking/counting.
We should also always enable the TBCN/TBTT field,
this field is only disabled during beacon regeneration.

Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-03-13 19:31:41 -04:00
Ivo van Doorn
72fa559bf4 rt2x00: Make rt2x00leds_register return void
rt2x00dev isn't interested in the rt2x00leds_register() value
anyway. So lets make it return void to even prevent people from
assuming there is anybody interested in the returnvalue.

Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-03-13 19:31:41 -04:00
Ivo van Doorn
7281037943 rt2x00: Rename config_preamble() to config_erp()
Rename config_preamble() to config_erp() and cleanup argument
list by putting it all into a single structure.
This will make the function more meaningful and easier to
expand later. This second option is mostly intended to make
the patch "mac80211: proper short-slot handling" from Johannes Berg
easier to apply for rt2x00.

Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-03-13 16:02:36 -04:00
Ivo van Doorn
e4030a2f40 rt2x00: Check IEEE80211_TXCTL_SEND_AFTER_DTIM flag
When mac sets the IEEE80211_TXCTL_SEND_AFTER_DTIM flag, we should
check if the ATIM queue is available in the driver and put the
frame in that queue for proper behavior (send frame after beacon interval).
Unfortunately not all drivers have this ATIM queue, and will lack
this feature for now.

Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-03-13 16:02:36 -04:00
Ivo van Doorn
a4fe07d913 rt2x00: Start bugging when rt2x00lib doesn't filter SW diversity
rt2x00lib should filter SW diversity out before sending any configuration
changes to the driver. When rt2x00lib fails to do this, it is important
that such events are reported because it _must_ be fixed.
So upgrading the error level to a BUG_ON() which will make sure
this bug gets noticed whenever it happens.

Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-03-13 16:02:36 -04:00
Ivo van Doorn
a7f3a06cbb rt2x00: Move firmware checksumming to driver
rt2x00lib depended on 2 crc algorithms because rt61/rt73
use a different algorithm then rt2800. This means that
even when only 1 algorithm was needed, the dependency was
still present for both.
By moving the checksum generation to the driver we can clean
up 2 annoying flags (which indicated which checksum was required)
and move the dependency to where it belongs: the driver.

Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-03-13 16:02:36 -04:00
Ivo van Doorn
5f46c4d053 rt2x00: Upgrade queue->lock to use irqsave
The queue->lock could be grabbed from interrupt context,
which could lead to lockdep panic like this:

kernel: ======================================================
kernel: [ INFO: soft-safe -> soft-unsafe lock order detected ]
kernel: 2.6.25-0.95.rc4.fc9 #1
kernel: ------------------------------------------------------
kernel: rt2500pci/1251 [HC0[0]:SC0[1]:HE1:SE0] is trying to acquire:
kernel:  (&queue->lock){--..}, at: [<ffffffff88213339>] rt2x00queue_get_entry+0x5a/0x81 [rt2x00lib]
kernel:
kernel: and this task is already holding:
kernel:  (_xmit_IEEE80211){-...}, at: [<ffffffff8122e9a3>] __qdisc_run+0x84/0x1a9
kernel: which would create a new lock dependency:
kernel:  (_xmit_IEEE80211){-...} -> (&queue->lock){--..}
kernel:
kernel: but this new dependency connects a soft-irq-safe lock:
kernel:  (_xmit_ETHER){-+..}
kernel: ... which became soft-irq-safe at:
kernel:   [<ffffffffffffffff>] 0xffffffffffffffff
kernel:
kernel: to a soft-irq-unsafe lock:
kernel:  (&queue->lock){--..}
kernel: ... which became soft-irq-unsafe at:
kernel: ...  [<ffffffff810545a2>] __lock_acquire+0x62d/0xd63
kernel:   [<ffffffff81054d36>] lock_acquire+0x5e/0x78
kernel:   [<ffffffff812a1497>] _spin_lock+0x26/0x53
kernel:   [<ffffffff88212f98>] rt2x00queue_reset+0x16/0x40 [rt2x00lib]
kernel:   [<ffffffff88212fd4>] rt2x00queue_alloc_entries+0x12/0xab [rt2x00lib]
kernel:   [<ffffffff88213091>] rt2x00queue_initialize+0x24/0xf2 [rt2x00lib]
kernel:   [<ffffffff88212036>] rt2x00lib_start+0x3b/0xd4 [rt2x00lib]
kernel:   [<ffffffff88212609>] rt2x00mac_start+0x18/0x1a [rt2x00lib]
kernel:   [<ffffffff881b9a4b>] ieee80211_open+0x1f3/0x46d [mac80211]
kernel:   [<ffffffff8121d980>] dev_open+0x4d/0x8b
kernel:   [<ffffffff8121d41e>] dev_change_flags+0xaf/0x172
kernel:   [<ffffffff81224fc2>] do_setlink+0x276/0x338
kernel:   [<ffffffff81225198>] rtnl_setlink+0x114/0x116
kernel:   [<ffffffff812262fc>] rtnetlink_rcv_msg+0x1d8/0x1f9
kernel:   [<ffffffff8123649a>] netlink_rcv_skb+0x3e/0xac
kernel:   [<ffffffff8122611a>] rtnetlink_rcv+0x29/0x33
kernel:   [<ffffffff81235eed>] netlink_unicast+0x1fe/0x26b
kernel:   [<ffffffff81236224>] netlink_sendmsg+0x2ca/0x2dd
kernel:   [<ffffffff812103b3>] sock_sendmsg+0xfd/0x120
kernel:   [<ffffffff812105a8>] sys_sendmsg+0x1d2/0x23c
kernel:   [<ffffffff8100c1c7>] tracesys+0xdc/0xe1
kernel:   [<ffffffffffffffff>] 0xffffffffffffffff

This can be fixed by using the irqsave/irqrestore versions
during the queue->lock handling.

Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-03-13 16:02:35 -04:00
Luis Correia
61191fb272 rt2x00: Fix trivial log message
Fix trivial log message.

Signed-off-by: Luis Correia <luis.f.correia@gmail.com>
Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-03-13 16:02:35 -04:00
Adam Baker
fd07e06380 rt2x00:correct rx packet length for USB devices
When fixing up the packet alignment, if we had to add 2 bytes to the front of
the skb we need to remember to take them off the end afterwards. This fixes
reception of encrypted packets which were otherwise failing with an invalid
ICV.

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>
2008-03-13 16:02:35 -04:00
Ivo van Doorn
8af244ccb1 rt2x00: Only disable beaconing just before beacon update
We should not write 0 to the beacon sync register during
config_intf() since that will clear out the beacon interval
and forces the beacon to be send out at the lowest interval.
(reported by Mattias Nissler).

The side effect of the same bug was that while working with
multiple virtual AP interfaces a change for any of those
interfaces would disable beaconing untill an beacon update
was provided.

This is resolved by only updating the TSF_SYNC value during
config_intf(). In update_beacon() we disable beaconing
temporarily to prevent fake beacons to be transmitted.
Finally kick_tx_queue() will enable beaconing again.

Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-03-13 16:02:35 -04:00
Ivo van Doorn
3976ae6c2b rt2x00: Use skbdesc fields for descriptor initialization
In rt2x00lib_write_tx_desc() the skb->data and skb->len fields
were incorrectly used. For USB drivers both of those values
contain invalid data (skb->data points to the device descriptor,
skb->len contains the frame _and_ descriptor length).

Instead of using the skbuffer fields we should use the skbdesc
fields which are correctly initialized and contain all the data
that we need.

Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-03-13 16:02:34 -04:00
Mattias Nissler
2ae23854dc rt2x00: Don't use unitialized rxdesc->size
rxdesc->size is unitialized before the desriptor has been read.
Move the truncation of the sk buffer to the moment all variables
have been initialized.

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>
2008-03-13 16:02:34 -04:00
Ivo van Doorn
2d1be5b0d1 rt2x00: Don't use uninitialized desc_len
skbdesc->desc_len is uninitialized at the start
of the function. So it is a _bad_ idea to use it...

Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-03-13 16:02:34 -04:00
Mattias Nissler
95db4d4d5f rt2x00: Use the correct size when copying the control info in txdone
The sizeof() operator was incorrectly applied to the pointer, not the struct.

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>
2008-03-13 16:02:34 -04:00
Mattias Nissler
92f5ac6320 rt2x00: Initialize TX control field in data entries
In the TX path, the driver didn't copy the TX control data structure. Thus, it
was invalid in the TX done handler, causing serious trouble and misbehaviour.

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>
2008-03-13 16:02:33 -04:00
Ivo van Doorn
f855c10b6e rt2x00: Align RX descriptor to 4 bytes
Some architectures give problems when reading
RX frame descriptor words when the descriptor
is not aligned on a 4 byte boundrary.

Due to optimalizations for the ieee80211 payload
4 byte alignment, it is no longer guarenteed
that the descriptor is placed on the 4 byte
boundrary (In fact, for rt73usb it is absolutely
never aligned to 4 bytes, for rt2500usb it depends
on the length of the payload).

This will copy the descriptor to a 4 byte aligned
location before it is read for the first time.
This will also move the payload data alignment
in rt2x00usb (instead of inside the driver) where
it has always belonged.

Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-03-13 16:02:33 -04:00
Harvey Harrison
40e024de93 b43: pull out helpers for writing noise table
Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-03-13 16:02:33 -04:00
Jussi Kivilinna
461b3f2aa3 rndis_wlan: cleanup, rename structure members
Rename members of ndis_80211_* structures to match the style of
the rest of the code.

Signed-off-by: Jussi Kivilinna <jussi.kivilinna@mbnet.fi>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-03-13 16:02:33 -04:00
Jussi Kivilinna
1e41e1d277 rndis_wlan: cleanup, rename and reorder enums and structures
Rename enums and structures to ndis_80211_* for greater readability.
Also change order so that enumerations are presented first.

Signed-off-by: Jussi Kivilinna <jussi.kivilinna@mbnet.fi>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-03-13 16:02:32 -04:00
Joe Perches
e9010e2fdf drivers/net/wireless/ath5k - convert == (true|false) to simple logical tests
(test == true) is not nice.

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-03-13 16:02:32 -04:00
Holger Schurig
52933d815b libertas: implement SSID scanning for SIOCSIWSCAN
After my bit scan re-writing the SIOCSIWSCAN wext ioctl no longer supported
scanning for a specific SSID. However, wpa_supplicant is a possible user of
this ioctl, so here is code that add's this.

While passing, removed even more of the debugfs-based scanning. You can (and
should) the SIOCSIWSCAN to ask for scans, so there is no need for
proprietary interfaces for scanning. And, besides, the scan result couldn't
be used further, e.g. not for associating.

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>
2008-03-13 16:02:32 -04:00
Adrian Bunk
2079fcdc06 the scheduled bcm43xx removal
Signed-off-by: Adrian Bunk <bunk@kernel.org>
Cc: <Larry.Finger@lwfinger.net>
Cc: <stefano.brivio@polimi.it>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-03-13 16:01:04 -04:00
Adrian Bunk
affe0a0218 make b43_mac_{enable,suspend}() static
b43_mac_{enable,suspend}() can now become static.

Signed-off-by: Adrian Bunk <bunk@kernel.org>
Acked-by: Michael Buesch <mb@bu3sch.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-03-13 16:01:04 -04:00
Ivo van Doorn
1682fe6de2 rt2x00: Add suspend/resume handlers to rt2x00rfkill
Add suspend/resume handlers to rt2x00rfkill to have it stop
the input-polldev and prevent it from calling rt2x00 during
suspend period. This could lead to a NULL pointer fault when
rt2x00 suspended, but polldev send a request, because
the csr_addr is NULL.

Also don't let the rfkill allocation/registration block
the initialization of the entire device. Just print a warning
and continue as if nothing happened.

Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-03-13 15:57:26 -04:00
Pavel Roskin
f50e4a8494 ath5k: disable irq handling in ath5k_hw_detach()
Once ah has been freed, it may not be accessed.  Set ATH_STAT_INVALID
bit to make the interrupt handler return IRQ_NONE without accessing ah.

This fixes oops on unload with CONFIG_DEBUG_SHIRQ enabled.

Signed-off-by: Pavel Roskin <proski@gnu.org>
Acked-by: Nick Kossifidis <mickflemm@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-03-13 15:57:25 -04:00
Harvey Harrison
5abdc49d6e b43: phy.c fix typo in register write
Commit 61bca6eb85 b43: rewrite A PHY initialization
has a typo, the result of the register read should be masked, not the
register offset.

Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com>
Signed-off-by: Michael Buesch <mb@bu3sch.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-03-13 15:57:25 -04:00
Jan Slupski
43557e15c2 prism54: support for 124a:4025 - another version of IOGear GWU513 802.11g
Add support to p54usb driver for apparently another version of IOGear GWU513
802.11g USB network card that uses GW3887IK chipset and is recognized as
"124a:4025 AirVast" by lsusb.

Cc: Michael Wu <flamingice@sourmilk.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-03-13 15:57:22 -04:00
Ivo van Doorn
445815d7ea rt2x00: Add new D-Link USB ID
Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-03-11 15:13:41 -04:00
Adam Baker
fbb0a27a8a rt2x00: never disable multicast because it disables broadcast too
On rt73 and rt61 disabling reception of multicast packets also disables
broadcast traffic which we never want to do. Therefore we should never
disable multicast.

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>
2008-03-11 15:13:40 -04:00
Sebastian Siewior
5f0547c281 libertas: fix the 'compare command with itself' properly
|libertas: Invalid CMD_RESP 8012 to command 50!

The special case got mixed up in 8a96df80b3.

Signed-off-by: Sebastian Siewior <bigeasy@linutronix.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-03-11 15:13:40 -04:00
Reinette Chatre
deedf50430 iwlwifi: fix potential lock inversion deadlock
This is a change to a previous patch ("iwlwifi: 3945 split tx_complete
to command and packet function") to ensure we do not have hardirq safe
locks (priv->lock in this case) depend on hardirq unsafe locks.

We only call iwl3945_tx_queue_reclaim while in a tasklet so we have to use
the irqsafe version of the function.

Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-03-07 17:25:26 -05:00
John W. Linville
f868f4e196 wireless: correct warnings from using '%llx' for type 'u64'
drivers/net/wireless/ath5k/debug.c: In function 'read_file_tsf': drivers/net/wireless/ath5k/debug.c:203: warning: format '%016llx'
expects type 'long long unsigned int', but argument 4 has type 'u64' drivers/net/wireless/ath5k/debug.c:203: warning: format '%016llx'
expects type 'long long unsigned int', but argument 4 has type 'u64' drivers/net/wireless/ath5k/debug.c: In function 'read_file_beacon':
drivers/net/wireless/ath5k/debug.c:274: warning: format '%016llx' expects type 'long long unsigned int', but argument 4 has type 'u64'
drivers/net/wireless/ath5k/debug.c:274: warning: format '%016llx' expects type 'long long unsigned int', but argument 4 has type 'u64'

drivers/net/wireless/iwlwifi/iwl-4965.c: In function 'iwl4965_tx_status_reply_compressed_ba':
drivers/net/wireless/iwlwifi/iwl-4965.c:3907: warning: format '%llx' expects type 'long long unsigned int', but argument 4 has type 'u64'
drivers/net/wireless/iwlwifi/iwl-4965.c: In function 'iwl4965_rx_reply_compressed_ba':
drivers/net/wireless/iwlwifi/iwl-4965.c:4039: warning: format '%llx' expects type 'long long unsigned int', but argument 6 has type '__le64'
drivers/net/wireless/iwlwifi/iwl-4965.c:4046: warning: format '%llx' expects type 'long long unsigned int', but argument 5 has type 'u64'
drivers/net/wireless/iwlwifi/iwl4965-base.c: In function 'iwl4965_tx_status_reply_tx':
drivers/net/wireless/iwlwifi/iwl4965-base.c:3661: warning: format '%llx' expects type 'long long unsigned int', but argument 6 has type 'u64'

Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-03-07 17:09:52 -05:00
Bruno Randolf
6ba81c2c98 ath5k: work around wrong beacon rx timestamp in IBSS mode
atheros hardware has a problem with the rx timestamp of some IBSS beacons when
they caused a TSF update (they have the same BSSID).

the rx timestamp is wrong especially if the beacon frames get bigger than 78
byte (at least on AR5213 and AR5414 hardware). in that case ath5k_extend_tsf()
will assume a rs_tstamp overflow and give us a timestamp too far in the past
which will cause mac80211 to merge IBSS on every beacon (which is not necessary
since the BSSID already matches). but in this case we know that the HW must
have synced to the beacons TSF and the rx timestamp must be later than that so
we can adjust mactime accordingly.

also rename the function to ath5k_check_ibss_tsf() and change comments, since
"hw merge" is better described as a TSF update.

drivers/net/wireless/ath5k/base.c:      Changes-licensed-under: 3-Clause-BSD

Signed-off-by: Bruno Randolf <bruno@thinktube.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-03-07 16:07:50 -05:00
Bruno Randolf
e14296caba ath5k: add notes about rx timestamp
add comments about the fact that we don't know when exactly the atheros
hardware takes the RX timestamp.

drivers/net/wireless/ath5k/base.c:      Changes-licensed-under: 3-Clause-BSD

Signed-off-by: Bruno Randolf <bruno@thinktube.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-03-07 16:07:50 -05:00
Bruno Randolf
b47f407bef ath5k: move rx and tx status structures out of hardware descriptor
move ath5k_tx_status and ath5k_rx_status structures out of the hardware
descriptor since they are not accessed by the hardware at all. they just
contain converted information from the hardware descriptor. since they are only
used in the rx and tx tasklets there is also no use to keep them for each
descriptor.

drivers/net/wireless/ath5k/ath5k.h:     Changes-licensed-under: ISC
drivers/net/wireless/ath5k/base.c:      Changes-licensed-under: 3-Clause-BSD
drivers/net/wireless/ath5k/debug.c:     Changes-licensed-under: GPL
drivers/net/wireless/ath5k/debug.h:     Changes-licensed-under: GPL
drivers/net/wireless/ath5k/hw.c:        Changes-licensed-under: ISC

Signed-off-by: Bruno Randolf <bruno@thinktube.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-03-07 16:07:49 -05:00
Bruno Randolf
19fd6e5510 ath5k: struct ath5k_desc cleanups
* make struct ath5k_desc clearer by directly including unions of structures,
  which correspond to the hardware descriptors of different HW versions (5210
  and 5212). before they were casted at onto ath5k_desc at different points
  (e.g.  ds_hw[2]).

* rename some structures and variable names to make their use clearer, e.g.
  struct ath5k_hw_4w_tx_desc to ath5k_hw_4w_tx_ctl.

* substitute "old" with "5210" and "new" with "5212" (eg. rename
  ath5k_hw_proc_new_rx_status() to ath5k_hw_proc_5212_rx_status()) because old
  and new are relative and we might have a newer structure at some point.

* unify structs ath5k_hw_old_rx_status and ath5k_hw_new_rx_status into one
  ath5k_hw_rx_status, because they only differ in the flags and masks.

drivers/net/wireless/ath5k/ath5k.h:     Changes-licensed-under: ISC
drivers/net/wireless/ath5k/debug.c:     Changes-licensed-under: GPL
drivers/net/wireless/ath5k/hw.c:        Changes-licensed-under: ISC
drivers/net/wireless/ath5k/hw.h:        Changes-licensed-under: ISC

Signed-off-by: Bruno Randolf <bruno@thinktube.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-03-07 16:07:49 -05:00
Ron Rindjunsky
b095d03a7d iwlwifi: grab NIC access when disabling aggregations
This patch grabs NIC access inside iwl4965_tx_queue_agg_disable, instead of the
caller doing it.
The caller must still hold priv->lock when calling the function.

Signed-off-by: Max Stepanov <max.stepanov@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Ron Rindjunsky <ron.rindjunsky@intel.com>
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-03-07 16:03:02 -05:00
Tomas Winkler
91c066f27b iwlwifi: 3945 split tx_complete to command and packet function
This patch
1. removes cmd completion from iwl3945_tx_queue_reclaim
and creates iwl3945_cmd_queue_reclaim.
1. removes 11n relevant elements from this function
2. removes call to ieee80211_tx_status_irqsafe
and uses ieee80211_tx_status only

Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-03-07 16:03:02 -05:00
Tomas Winkler
28447f3cfd iwlwifi: Fix 3945 rate scaling
This patch fix 3945 rate scaling after cfg80211 rate/band changes

Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-03-07 16:03:01 -05:00
Tomas Winkler
c54b679ddc iwlwifi: queue functions cleanup
This patch moves
1. iwl_queue_inc_wrap and int iwl_queue_dec_wrap
into  iwl-helpers.h these two functions are identical to common
for both iwl3956 and iwl4965
2. renames x2_queue_used to iwl3945_x2_queue_used
3. exports iwl3945_queue_space out of iwl3964-base.c

Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-03-07 16:03:01 -05:00
Assaf Krauss
34cf6ff6dd iwlwifi: Moving EEPROM handling in iwlcore module
This patch move EEPROM code into iwl core module

Signed-off-by: Assaf Krauss <assaf.krauss@intel.com>
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-03-07 16:03:01 -05:00
Tomas Winkler
df48c3235c iwlwifi: add iwl-core module
This patch adds iwl-core module to iwlwifi driver.
This module will contain common code and infrastracture for iwlwifi
driver

Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-03-07 16:03:01 -05:00
Tomas Winkler
f4d6082d53 iwlwifi: fix locking unbalance in 4965 rate scale
This patch fixes locking unbalance after adding rcu locking
for sta

Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-03-07 16:03:01 -05:00
Emmanuel Grumbach
b716bb918f iwlwifi: Cancel scanning upon association
This patch cancels an ongoing HW scan upon association. Not doing this
resulted in instability in association.

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>
2008-03-07 16:03:00 -05:00
Tomas Winkler
4bf775cdc0 iwlwifi: Take the fw file name from the iwl_cfg.
This patch adds fw_name to iwl_cfg. This allows run time selection
of needed fw/ucode file

Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-03-07 16:03:00 -05:00
Tomas Winkler
82b9a12131 iwlwifi: add struct iwl_cfg
This patch introduces struct iwl_cfg. struct iwl_cfg defines static
configuration for each device type and sku. It is passed as driver_data
to the bus probe function.
This patch also introduce new common header file iwl-core.h
which will represent core functionality of iwlwifi driver

3945ABG uses separate iwl-3945-dev.h header file for now

Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-03-07 16:03:00 -05:00
Tomas Winkler
750fe63966 iwlwifi: Move HBUS address to iwl-csr.h
HBUS is accessed through CSR registers
moved to iwl-csr.h

Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-03-07 16:03:00 -05:00
Tomas Winkler
6f83eaa170 iwlwifi: extract iwl-csr.h
This patch extract CSR Register definition into separate
header files as most of the definition are commons to both
3945 and 4965.

Definitions specific for 3945 and 4965 are properly prefixed

Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-03-07 16:03:00 -05:00
Ron Rindjunsky
4c424e4cc7 iwlwifi: use mac80211_tx_control_flags
This patch makes use of the new mac80211_tx_control_flags and tx_rate to
pass Tx data, regular and 11n, from the HW tx response into the rate scaling.

Signed-off-by: Ron Rindjunsky <ron.rindjunsky@intel.com>
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-03-07 16:03:00 -05:00