Commit Graph

86569 Commits

Author SHA1 Message Date
Johannes Berg 2485f7105f mac80211: clarify use of TX status/RX callbacks
This patch clarifies the use of the irqsafe vs. non-irq-safe
functions and their respective locking requirements.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-02-29 15:41:58 -05:00
Pavel Roskin 38c07b430b ath5k: fix all endian issues reported by sparse
Changes-licensed-under: ISC
Signed-off-by: Pavel Roskin <proski@gnu.org>
Acked-by: Luis R. Rodriguez <mcgrof@winlab.rutgers.edu>
Acked-by: Nick Kossifidis <mickflemm@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-02-29 15:41:56 -05:00
Ivo van Doorn e6084239d3 rt2x00: Release rt2x00 2.1.3
Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-02-29 15:41:54 -05:00
Ivo van Doorn 1497074ad7 rt2x00: Check for 5GHz band in link tuner
Fix a typo in the link tuner where accidently the
2GHz band was checked instead of the 5GHz band.
This forced the link tuner to work in an invalid
range for the currently active band.

Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-02-29 15:41:52 -05:00
Florian Fainelli 58e3073983 p54: print unknown eeprom fields
This patch allows p54common to print the
uknown EEPROM fields, which can help
when debugging/testing devices.

Signed-off-by: Florian Fainelli <florian.fainelli@telecomint.eu>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-02-29 15:41:50 -05:00
Johannes Berg 9a89c839f7 adm8211: fix cfg80211 band API conversion
Insert a missing band assignment.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-02-29 15:41:48 -05:00
Michael Buesch 8f300ae5b8 b43legacy: Fix nondebug build
Fix a typo.

Signed-off-by: Michael Buesch <mb@bu3sch.de>
Acked-by: Stefano Brivio <stefano.brivio@polimi.it>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-02-29 15:41:45 -05:00
Aurelien Jarno 28de57d1a9 ssb: Add CHIPCO IRQ access functions
This patch adds functions to setup and read the CHIPCO IRQ.

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Signed-off-by: Michael Buesch <mb@bu3sch.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-02-29 15:41:43 -05:00
Johannes Berg fba4a1e637 mac80211: fix IBSS code
This patch fixes two errors introduced by

    commit 19d35612f3cd7f60dd9174c0100584e21f5a1025
    Author: Bruno Randolf <bruno@thinktube.com>
    Date:   Mon Feb 18 11:21:36 2008 +0900

        mac80211: enable IBSS merging

The first error is an endianness problem that sparse found and
the second is a build failure when CONFIG_MAC80211_IBSS_DEBUG
is not set.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Cc: Bruno Randolf <bruno@thinktube.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-02-29 15:41:41 -05:00
Johannes Berg f3af89d1aa mac80211: fix debugfs_sta print_mac() warning
When print_mac() was marked as __pure to avoid emitting a function
call in pr_debug() scenarios, a warning in this code surfaced since
it relies on the fact that the buffer is modified and doesn't use
the return value. This patch makes it use the return value instead.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Reported-by: Harvey Harrison <harvey.harrison@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-02-29 15:41:38 -05:00
Johannes Berg 665e8aafb4 mac80211: Disallow concurrent IBSS/STA mode interfaces
Disallow having more than one IBSS interface up at any time
because of beacon distribution issues, and for now also disallow
having more than one IBSS/STA interface up at the same time
because we use the master interface's BSS struct which would
be completely corrupted when we have more than one up.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-02-29 15:41:36 -05:00
Johannes Berg 43ba7e958f mac80211: atomically check whether STA exists already
When a STA structure is added, it is often checked whether it
already exists before adding it. This, however, isn't done
atomically so there is a race condition that could lead to two
STA structures being added with the same MAC address. This
patch changes sta_info_add() to return an ERR_PTR in case
of failure and adds the failure mode -EEXIST when the STA
already exists.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Cc: Luis Carlos Cobo <luisca@cozybit.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-02-29 15:41:34 -05:00
Johannes Berg d46e144b65 mac80211: rework TX filtered frame code
This reworks the code for TX filtered frames, splitting it out to
a new function to handle those cases, making the clear instruction
a flag and renaming a few things to be easier to understand and
less Atheros hardware specific. Finally, it also makes the comments
explain more.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-02-29 15:41:32 -05:00
Pavel Roskin d97cf01576 mac80211: fix incorrect use of CONFIG_MAC80211_IBSS_DEBUG
Configuration variables are only available to the preprocessor

Signed-off-by: Pavel Roskin <proski@gnu.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-02-29 15:37:27 -05:00
Johannes Berg c2976ab005 p54: fix sparse warnings
This fixes a few sparse warnings in p54.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-02-29 15:37:27 -05:00
Johannes Berg e63e3fa7bd adm8211: fix sparse warnings
Both of these seem to be actual errors, the first is just wrong
and the second is my mistake introduced by the cfg80211 API
update.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-02-29 15:37:27 -05:00
Michael Buesch ffc7689dda ssb: Add support for 8bit register access
This adds support for 8bit wide register reads/writes.
This is needed in order to support the gigabit ethernet core.

Signed-off-by: Michael Buesch <mb@bu3sch.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-02-29 15:37:26 -05:00
Johannes Berg 004c872e78 mac80211: consolidate TIM handling code
This consolidates all TIM handling code to avoid re-introducing
errors with the bitmap/set_tim order and to reduce code. While
reading the code I noticed a possible problem so I also added
a comment about that.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-02-29 15:37:26 -05:00
Johannes Berg 836341a704 mac80211: remove sta TIM flag, fix expiry TIM handling
The TIM flag that is kept in each station's info is completely
useless, there's no code (aside from the debugfs display code)
checking it, hence it can be removed. While doing that, I noticed
that the TIM handling is broken when buffered frames expire, so
fix that.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-02-29 15:37:26 -05:00
Johannes Berg d2259243a1 mac80211: invoke set_tim() callback after setting own TIM info
Drivers should be allowed to simply get a complete new beacon when
set_tim() is invoked (and set_tim() is required for drivers that
just want a beacon template!), so we need to update our own TIM
bitmap before calling set_tim() so that getting the beacon will
now get an already updated beacon.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-02-29 15:37:26 -05:00
Roel Kluin 013b73faff wireless: Convert to list_for_each_entry_rcu()
Convert list_for_each_rcu() to list_for_each_entry_rcu()

Signed-off-by: Roel Kluin <12o3l@tiscali.nl>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-02-29 15:37:25 -05:00
Tomas Winkler b46b4ee034 wireless: update US regulatory domain
This patch adds channels to US regulatory domain

Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-02-29 15:37:25 -05:00
Ivo van Doorn 2533d5f800 rt2x00: Release rt2x00 2.1.2
Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-02-29 15:37:25 -05:00
Ivo van Doorn ce359f90d3 rt2x00: Fix MAC address defines in rt61pci
The MAC address offset defines were incorrect because
the byte offset was used instead of word index. This
bug had no affect on normal operations since these
defines weren't used. (EEPROM_MAC_ADDR_0 was used
to read 6 bytes from).

Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-02-29 15:37:25 -05:00
Gertjan van Wingerde 47ac268336 rt2x00: Fix hw mode registration with mac80211.
The supported_bands field of struct hw_mode_spec now represents a bitfield,
so bitfield operators need to be tested with when setting the band data.

The current code generates the following warning:

[176624.986244] WARNING: at /usr/local/src/incoming/compat-wireless-2.6/net/wireless/core.c:269 wiphy_register()
[176624.986249] Pid: 12548, comm: modprobe Tainted: P        2.6.24.2#4
[176624.986251]
[176624.986251] Call Trace:
[176624.986277]  [<ffffffff881c56bf>] :cfg80211:wiphy_register+0x17f/0x1a0
[176624.986282]  [<ffffffff881ddf80>] :rt61pci:rt61pci_eepromregister_write+0x0/0x80
[176624.986302]  [<ffffffff88b7e4bc>] :mac80211:ieee80211_register_hw+0x2c/0x2b0
[176624.986310]  [<ffffffff881cdc80>] :rt2x00lib:rt2x00lib_probe_dev+0x350/0x3f0
[176624.986318]  [<ffffffff881d74b9>] :rt2x00pci:rt2x00pci_probe+0x149/0x200
[176624.986325]  [<ffffffff8030c858>] pci_device_probe+0xf8/0x170
[176624.986331]  [<ffffffff803594fc>] driver_probe_device+0x9c/0x1c0
[176624.986335]  [<ffffffff80359700>] __driver_attach+0x0/0xb0
[176624.986337]  [<ffffffff803597a5>] __driver_attach+0xa5/0xb0
[176624.986341]  [<ffffffff8035877d>] bus_for_each_dev+0x4d/0x80
[176624.986347]  [<ffffffff80358b8c>] bus_add_driver+0xac/0x210
[176624.986351]  [<ffffffff8030cad3>] __pci_register_driver+0x73/0xc0
[176624.986357]  [<ffffffff8025689e>] sys_init_module+0x18e/0x1a20
[176624.986374]  [<ffffffff8020c42e>] system_call+0x7e/0x83

Signed-off-by: Gertjan van Wingerde <gwingerde@kpnplanet.nl>
Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-02-29 15:37:24 -05:00
Ivo van Doorn 47b10cd137 rt2x00: Remove async vendor request calls from rt2x00usb
The async vendor requests are a ugly hack which is not working correctly.
The proper fix for the scheduling while atomic issue is finding out why
we can't use led classes for USB drivers and fix that.

Just replace all async calls with the regular ones and print an
error for the disallowed LED configuration attempts. That will
help in determining which led class is causing the problem.

Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-02-29 15:37:24 -05:00
Ivo van Doorn 31562e802a rt2x00: Cleanup mode registration
Don't wildly pass any number for num_rates to rt2x00lib,
instead pass which type of rates are supported (CCK, OFDM).
Same for num_modes but then for the 2GHZ and 5GHZ band.

This makes the interface look much nicer and makes
extending it later easier.

Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-02-29 15:37:23 -05:00
Ivo van Doorn de99ff82cd rt2x00: Rename dscape -> mac80211
The dscape stack was renamed to mac80211 a long time ago,
we are long overdue with fixing all comments to reflect this.

Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-02-29 15:37:23 -05:00
Ivo van Doorn ef8f66cd1d rt2x00: Remove reset_tsf()
Specifications indicate the TSF registers are read-only,
so there is no point in writing 0 to those registers.

As far as I know there isn't another way to reset the
TSF registers. So removing these callbacks will notify
mac80211 about the lack of support.

Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-02-29 15:37:23 -05:00
Ivo van Doorn 30b3a23c25 rt2x00: Fix Descriptor DMA initialization
As Adam Baker reported the DMA address for the
descriptor base was incorrectly initialized in
the PCI drivers.

Instead of the DMA base for the descriptor, the
DMA base for the data was passed resulting in a
broken TX/RX state for PCI drivers.

Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-02-29 15:37:22 -05:00
Ivo van Doorn e542239f63 rt2x00: Filter ACK_CTS based on FIF_CONTROL
The ACK_CTS frame is a control frame, this means
dropping the frame depends on the FIF_CONTROL flag
for filtering.

This also fixes an obvious typo in register definition.

Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-02-29 15:37:22 -05:00
Ivo van Doorn baf26a7eae rt2x00: Don't report driver generated frames to tx_status()
This adds a new flag for the skb_frame_desc structure which is used to tag
rts/cts frames that are generated by the driver. Through the tag we can
recognize frames we have generated ourselves, so we don't report their tx
status to mac80211.

This patch is based on the original patch 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-02-29 15:37:22 -05:00
Ivo van Doorn ac1aa7e4f3 rt2x00: Send frames out with configured TX power
mac80211 sends the txpower to use during config(),
we already store it in the rt2x00_dev structure.
When writing the descriptor correctly initialize
the txpower field with this value to make sure
all frames are send out with the correct tx power.

Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-02-29 15:37:22 -05:00
Ivo van Doorn d3f5feaa51 rt2x00: Release rt2x00 2.1.1
Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-02-29 15:37:21 -05:00
Ivo van Doorn 330e3f95b3 rt2x00: Kill guardian urb during disable_radio
When the radio is being disabled we should also
kill the guardian urb which could still be pending
in the device.

Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-02-29 15:37:21 -05:00
Ivo van Doorn c1aa3dc7ac rt2x00: Cleanup Makefile
Simplify the way rt2x00 assigns new objects to the
rt2x00lib module. This saves a few if statements
and overall does this looks much nicer.

Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-02-29 15:37:21 -05:00
Ivo van Doorn 8f539276ee rt2x00: Fix queue->qid initialization
As Adam Baker reported the queue->qid was not initialized
correctly. The QID_AC_BE was assigned to the RX ring.

This will move the queue initialization into a seperate function
and makes sure that all queues are initialized directly with the
correct qids.

Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-02-29 15:37:21 -05:00
Ivo van Doorn 647d0ca905 rt2x00: Fix skbdesc->data_len initialization
skbdesc->data_len was not initialized correctly
in rt2x00pci, rt2x00usb, rt2500usb and rt73usb.

The value was set to queue->data_size which
means that the incorrect frame size was pased
to the upper layers.

Correctly base the value on either the skb->len,
or the rx frame size passed to the driver by the
device.

Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-02-29 15:37:20 -05:00
Ivo van Doorn 417f412f2d rt2x00: Fix typo in debug statement
The second eeprom recovery message is about
the RSSI offset for ieee802.11 A.

Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-02-29 15:37:20 -05:00
Ivo van Doorn 68598d294b rt2x00: Add queue statistics to debugfs
Rename "frame" folder to "queue" folder,
add extra file to this folder which contains
statistics about all hardware queues. This will
help debugging and spotting problems in the
queue indexing system.

Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-02-29 15:37:20 -05:00
Ivo van Doorn e44df9296a rt2x00: Fix scheduling while atomic errors in usb drivers
Call rt2x00_config_intf() outside of the spinlock context since
the call will sleep for USB drivers. By using the ieee80211_if_conf
values as arguments we make keep access tp rt2x00_intf thread safe
even without the lock.

Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-02-29 15:37:19 -05:00
Ivo van Doorn 21795094e2 rt2x00: make csr_cache and csr_addr an union
The csr_cache and csr_addr pointers are both the same size
and they are never used both by the same driver. This makes
them a nice candidate for an union.
We could merge into 1 pointer, but that would either upset sparse,
or require a lot of __force casts.

Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-02-29 15:37:19 -05:00
Ivo van Doorn f590f48e87 rt2x00: Select CONFIG_NEW_LEDS
Select CONFIG_NEW_LEDS before selecting the other LED config
options. This fixes a link error when NEW_LEDS was disabled.

Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-02-29 15:37:19 -05:00
Adam Baker 231be4e92c rt2x00: correct address calc for queue private data
When calculating the offset to add to the queue entry base to get the
individual entry's private data area the base address must be treated
as a char * not a struct queue_entry so we can do byte oriented
pointer arithmetic with it.

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-02-29 15:37:18 -05:00
Ivo van Doorn 16938a24ae rt2x00: Remove MGMT ring initialization
Remove the last remnants of the MGMT ring initialization
from rt61pci.ko

Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-02-29 15:37:18 -05:00
Ivo van Doorn 25fd893db2 rt2x00: Make rt2x00 less verbose
Remove the debug messages regarding initialization from
EEPROM. The values are vendor specific, and are not really
needed for debug purposes. If they ever become usefull we
still have access to them through debugfs which also
prints the exact same values...

Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-02-29 15:37:18 -05:00
Ivo van Doorn 9c9dd2c9a4 rt2x00: Fix invalid DMA free
Be more strict when using the queue_entry_priv_pci_rx
and queue_entry_priv_pci_tx structures. Only use a
particular type that matches the queue type.

When freeing the DMA the priv_tx->data and priv_tx->dma
was used. This is incorrect since the start of the DMA
was in fact the priv_tx->desc pointer. Instead of
recalculating the dma_addr_t for the DMA start this
patch will swap the data and descriptor part of the
allocated memory.

Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-02-29 15:37:17 -05:00
Randy Dunlap 0d84d78db5 wireless: rt2x00: fix driver menu indenting
Michael Büker <m.bueker@berlin.de> reports that the RT2x00 drivers
are not indented as they should be, so use proper dependencies to make
them be indented as expected.

Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
Ack-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-02-29 15:37:17 -05:00
Matthias Kaehlcke f948db5de5 prism54: Convert wpa_sem in a mutex
The semaphore wpa_sem is used as mutex, convert it to the mutex API

Signed-off-by: Matthias Kaehlcke <matthias@kaehlcke.net>
Acked-by: Luis R. Rodriguez <mcgrof@winlab.rutgers.edu>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-02-29 15:37:17 -05:00
Matthias Kaehlcke f8139218b3 prism54: Convert stats_sem in a mutex
The semaphore stats_sem is used as mutex, convert it to the mutex API

Signed-off-by: Matthias Kaehlcke <matthias@kaehlcke.net>
Acked-by: Luis R. Rodriguez <mcgrof@winlab.rutgers.edu>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-02-29 15:37:17 -05:00