dect
/
linux-2.6
Archived
13
0
Fork 0
Commit Graph

336 Commits

Author SHA1 Message Date
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
Ivo van Doorn b86af631b8 rt2x00: Release rt2x00 2.1.0
Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-02-29 15:37:01 -05:00
Ivo van Doorn 8f5fa7f044 rt2x00: Fix rate initialization
Fix typo in rate initialization. This fixes the WARN_ON()
in net/wireless/util.cpp:83

Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-02-29 15:37:00 -05:00
Ivo van Doorn 3b640f21af rt2x00: Enable LED class support for rt2500usb/rt73usb
Add kerneldoc for vendor request functions in rt2x00usb.
Add asynchroneous vendor request function in rt2x00usb.

With the availability of the asynchroneuous vendor request
we can now enable LED class support for rt2500usb and rt73usb.
Since LED handling is not important, it doesn't really matter
if a register call fails (This solution is better then no
LED class support at all).

Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-02-29 15:37:00 -05:00
Ivo van Doorn a9450b70a7 rt2x00: Make use of MAC80211_LED_TRIGGERS
Make use of the led triggers provided by mac80211 to control
the led status. This can be enabled through a per-driver
configuration option which will automatically enable the
generic handler in rt2x00lib.

This has been enabled for rt2500usb and rt73usb for the moment
since the led class will call set_brightness in irq context which
will not work correctly with the usb drivers who need to sleep.

Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-02-29 15:37:00 -05:00
Ivo van Doorn f2a3c7f5c8 rt2x00: Use ieee80211_channel_to_frequency()
No need to perform the calculation ourselves when
wireless provides a helper function for it.

Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-02-29 15:19:38 -05:00
Ivo van Doorn f5507ce90b rt2x00: Remove HWMODE_{A,B,G}
rt2500usb initialized the SIFS and EIFS without using the
values coming from rt2x000lib. After this is fixed HWMODE_{A,B,G}
is now unused and can be removed in favour of the ieee80211_band
enumeration which could still be usefull later.

Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-02-29 15:19:38 -05:00
Ivo van Doorn 70e2fed4ec rt2x00: Rate structure overhaul
Recent changes to the rate structure registration broke rt2x00,
the hw_value was reduced from 32bits to 16bits while rt2x00 used
the full 32bits. However the way rt2x00 used the value was inflexible
and needed to be changed anyway.

This patch creates a array containing information for each rate,
the hw_value passed to mac80211 is the index value for that array
including a field to indicate if short preamble should be enabled.

Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-02-29 15:19:38 -05:00
Johannes Berg 8318d78a44 cfg80211 API for channels/bitrates, mac80211 and driver conversion
This patch creates new cfg80211 wiphy API for channel and bitrate
registration and converts mac80211 and drivers to the new API. The
old mac80211 API is completely ripped out. All drivers (except ath5k)
are updated to the new API, in many cases I expect that optimisations
can be done.

Along with the regulatory code I've also ripped out the
IEEE80211_HW_DEFAULT_REG_DOMAIN_CONFIGURED flag, I believe it to be
unnecessary if the hardware simply gives us whatever channels it wants
to support and we then enable/disable them as required, which is pretty
much required for travelling.

Additionally, the patch adds proper "basic" rate handling for STA
mode interface, AP mode interface will have to have new API added
to allow userspace to set the basic rate set, currently it'll be
empty... However, the basic rate handling will need to be moved to
the BSS conf stuff.

I do expect there to be bugs in this, especially wrt. transmit
power handling where I'm basically clueless about how it should work.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-02-29 15:19:32 -05:00
Ivo van Doorn 10b6b80145 rt2x00: Fix queue index handling
When Q_INDEX is increased, the queue->length should be increased,
only when Q_INDEX_DONE is increased should queue_length be descreased.

Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-02-29 15:19:29 -05:00
Ivo van Doorn 5957da4c6e rt2x00: Move beacon and atim queue defines into rt2x00
As Johannes Berg indicated the BEACON and AFTER_BEACON
queue indeces in mac80211 should be removed because they
are too hardware specific. This patch adds the queue index
defines into rt2x00queue.h and removes the dependency of
the defines inside mac80211.h.

Also move rt2x00pci_beacon_update() into rt2400pci and
rt2500pci individually since it is no longer a generic
function since rt61 and rt2800 no longer use that.

Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-02-29 15:19:29 -05:00
Ivo van Doorn 091ed315ef rt2x00: Initialize QID from queue->qid
The QID_MGMT is assigned to the beacon and atim queue
during initialization. This means we don't need a seperate
check in write_tx_desc()..

Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-02-29 15:19:28 -05:00
Ivo van Doorn 871ff6ed64 rt2x00: Remove TX_MGMT queue usage
rt73usb doesn't have a 5th queue, correctly initialize hw->queues
rt61pci had a 5th queue but was removed recently, correctly initialize
hw->queues and remove the last remnants.

Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-02-29 15:19:28 -05:00
Ivo van Doorn 6bb40dd13b rt2x00: Add per-interface structure
Rework the interface handling. Delete the interface structure
and replace it with a per-interface structure. This changes the
way rt2x00 handles the active interface drastically.

Copy ieee80211_bss_conf to the this rt2x00_intf structure during
the bss_info_changed() callback function. This will allow us to
reference it later, and removes the requirement for the device flag
SHORT_PREAMBLE flag which is interface specific.

Drivers receive the option to give the maximum number of virtual
interfaces the device can handle. Virtual interface support:
rt2400pci: 1 sta or 1 ap, * monitor interfaces
rt2500pci: 1 sta or 1 ap, * monitor interfaces
rt2500usb: 1 sta or 1 ap, * monitor interfaces
rt61pci: 1 sta or 4 ap, * monitor interfaces
rt73usb: 1 sta or 4 ap, * monitor interfaces

At the moment none of the drivers support AP and STA interfaces
simultaneously, this is a hardware limitation so future support
will be very unlikely.

Each interface structure receives its dedicated beacon entry,
with this we can easily work with beaconing while multiple master
mode interfaces are currently active.

The configuration handlers for the MAC, BSSID and type are
often called together since they all belong to the interface
configuration. Merge the 3 configuration calls and cleanup
the API between rt2x00lib and the drivers. While we are cleaning
up the interface configuration anyway, we might as well clean up
the configuration handler as well.

Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-02-29 15:19:28 -05:00
Ivo van Doorn 9404ef34e4 rt2x00: Driver requiring firmware should select crc algo
The driver should select what CRC algorithm is required
when performing a checksum on the firmware.

rt61pci & rt73usb require crc-itu-t
rt2800pci & rt2800usb require crc-ccitt

Legacy 2800pci/usb driver uses crc-itu-t + bit order reversion,
but that is just inefficient especially since the end result is
the same as a different algorithm which is also available as library. ;)

Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-02-29 15:19:28 -05:00
Ivo van Doorn adfdbb79c0 rt2x00: Enable master and adhoc mode again
This will enable the creation of master mode and adhoc
interfaces again. This does not mean the issues surrounding
beaconing have been resolved, but this will make testing
easier and perhaps we can discover which cards are actually
working and which ones not.

Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-02-29 15:19:28 -05:00
Ivo van Doorn 3b3618ad51 rt2x00: Fix tx parameter initialization
Check if the aifs, cw_min and cw_max are above 0
when determining if the default should be used.
Tor aifs a negative number is used to determine
if the default should be used or not.

Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-02-29 15:19:27 -05:00
Adam Baker d7bafff3f9 rt2x00: don't write past the end when writing short descriptors on rt61
The space allocated in the skb for a descriptor is only 24 bytes when
setting up beacons in rt61 so make sure we don't write to the descriptor
words beyond that and corrupt the beacon packet.

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:19:27 -05:00
Ivo van Doorn 181d6902b6 rt2x00: Queue handling overhaul
This introduces a big queue handling overhaul, this also
renames "ring" to "queues".

Move queue handling into rt2x00queue.c and the matching header,
use Kerneldoc to improve rt2x00 library documentation.

Access to the queues is now protected under a spinlock, this
to prevent race conditions which could corrupt the indexing
system of the queue.

Each queue entry allocates x bytes for driver/device specific data,
this cleans up the queue structure significantly and improves
code readability.

rt2500usb no longer needs 2 entries in the beacon queue to correctly
send out the guardian byte. This is now handled in the entry specific
structure.

rt61 and rt73 now use the correct descriptor size for beacon frames,
since this data is written into the registers not the entire TXD
descriptor was used but instead of a subset of it named TXINFO.

Finally this also fixes numerous other bugs related to incorrect
beacon handling or beacon related code.

Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-02-29 15:19:27 -05:00
Ivo van Doorn 811aa9cad1 rt2x00: Update copyright notice
Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-02-29 15:19:22 -05:00
Ivo van Doorn 53b3f8e47a rt2x00: Fix rt2x00lib_reset_link_tuner()
rt2x00lib_reset_link_tuner() can be called from within
the link tuner itself. This means that it should
_not_ call rt2x00lib_stop_link_tuner() since that will
cause the thread to hang.

Reorder the things that should be done during a
link tuner reset and during a link tuner start.

Also make antenna tuning the last step of the link
tuner since it could possibly reset some statistical
information which we need for average calculation.

Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-02-28 09:13:10 -05:00
Ivo van Doorn 05253c93fe rt2x00: Don't switch to antenna with low rssi
When rssi_a > rssi_b is true and the current antenna
was already antenna A, then rt2x00 incorrectly jumped
to antenna B.

Also don't configure the antenna when there has been
no change in the antenna setup.

Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-02-28 09:13:09 -05:00
Ivo van Doorn 61667d8d5b rt2x00: Add link tuner safe RX toggle states
This adds 2 new states which both are used to toggle
the RX. These new states are required for usage
inside the link tuner thread, because the normal
RX toggling will stop the link tuner thread.
While it is possible that the link tuner thread itself
is the caller of the RX toggle (when using software
antenna diversity).

Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-02-28 09:13:09 -05:00
Ivo van Doorn b290d43361 rt2x00: Fix antenna diversity
Fix 2 issues in antenna diversity selection.

1) the following statement will always return true.
	if ((rssi_curr - rssi_old) > -5 || (rssi_curr - rssi_old) < 5)
It is cleaner to check if the absolute value is smaller then 5.

2) Only enable software diversity when default antenna setup
indicates support for it. Don't select it when the hardware
does not indicate support for it...

Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-02-28 09:13:09 -05:00
Ivo van Doorn db433febba rt2x00: Add new USB ID to rt2500usb
Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-02-15 13:44:18 -05:00
John W. Linville 4bdb0fba9e rt61pci: fix-up merge damage
A subtle merge error was introduced after re-queueing a patch for 2.6.24
instead of 2.6.25...

Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2008-01-31 19:26:33 -08:00
Andrew Morton 73738001ac drivers/net/wireless/rt2x00/rt2x00usb.c: fix uninitialized var warning
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-01-28 15:10:12 -08:00
Ivo van Doorn 89539ebe2f rt2x00: Fix queue_idx initialization
For TX rings the queue_idx should start at
IEEE80211_TX_QUEUE_DATA0 and for each followup
ring this index needs to be increased.

For the RX ring the queue_idx should be set
to 0. We don't need to initialize the tx_params.

Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-01-28 15:09:48 -08:00
Ivo van Doorn 40561b8426 rt2x00: Data and desc pointer initialization
rt2500usb and rt73usb data and desc pointer initialization
was incorrect because it was using uninitialized variables
to determine the length.

In addition rt2500usb used skb_pull and removed the ieee80211
from each received frame instead of using skb_trim to remove
the device descriptor from the frame.

Finally this also fixes the descriptor override when 4 byte
aligning occured. We still need a completely valid descriptor
when using the TX/RX dumping capabilities in debugfs.

Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-01-28 15:09:47 -08:00
Johannes Berg 471b3efdfc mac80211: add unified BSS configuration
This patch (based on Ron Rindjunsky's) creates a framework for
a unified way to pass BSS configuration to drivers that require
the information, e.g. for implementing power save mode.

This patch introduces new ieee80211_bss_conf structure that is
passed to the driver via the new bss_info_changed() callback
when the BSS configuration changes.

This new BSS configuration infrastructure adds the following
new features:
 * drivers are notified of their association AID
 * drivers are notified of association status

and replaces the erp_ie_changed() callback. The patch also does
the relevant driver updates for the latter change.

Signed-off-by: Ron Rindjunsky <ron.rindjunsky@intel.com>
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-01-28 15:09:43 -08:00
Johannes Berg 32bfd35d4b mac80211: dont use interface indices in drivers
This patch gets rid of the if_id stuff where possible in favour of
a new per-virtual-interface structure "struct ieee80211_vif". This
structure is located at the end of the per-interface structure and
contains a variable length driver-use data area.

This has two advantages:
 * removes the need to look up interfaces by if_id, this is better
   for working with network namespaces and performance
 * allows drivers to store and retrieve per-interface data without
   having to allocate own lists/hash tables

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-01-28 15:09:36 -08:00
Ivo van Doorn 93d2334f37 rt2x00: Release rt2x00 2.0.14
Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-01-28 15:09:29 -08:00
Ivo van Doorn 7d1de80644 rt2x00: Correctly initialize data and desc pointer
rt2500usb and rt73usb store the descriptor in different
places. This means we should move the initialization of
the 2 pointers to the driver callback function fill_rxdone().

Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-01-28 15:09:28 -08:00
Ivo van Doorn 837e7f247a rt2x00: Move init_txring and init_rxring into rt2x00lib
Prior to enabling the radio rt2x00lib should go through all
rings and for each entry should call the callback function
init_txentry() and init_rxentry().

Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-01-28 15:09:27 -08:00
Ivo van Doorn 7e56d38d5d rt2x00: Determine MY_BSS from descriptor
Use the MY_BSS descriptor field to determine if the
received frame belongs to the same BSS as the interface.
This can be used by rxdone to determine if the frame
should be updated or not.

Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-01-28 15:09:27 -08:00
Ivo van Doorn dd3193e1c2 rt2x00: Cleanup write_tx_desc() arguments
Send the skb structure with write_tx_desc() and use
the skbdesc structure to read all information about
the frame. This saves several arguments in the function
definition and it is easier to send more information
later as well.

Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-01-28 15:09:26 -08:00
Ivo van Doorn 3c4f2085e5 rt2x00: Move packet filter flags
The packet filter flags don't belong in the interface structure
because they are device based instead of interface based.
So move the filter fields out of struct interface and into rt2x00_dev.

Additionally we shouldn't change the filter based on the working
mode, if such a thing is needed than mac80211 should have done that.

Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-01-28 15:09:25 -08:00
Ivo van Doorn e37ea2135b rt2x00: Move start() and stop() handlers into rt2x00lib.c
suspend & resume was broken since it called rt2x00mac_start()
and rt2x00mac_stop() which would fail to execute because the
DEVICE_PRESENT flag was not set.

Move the start and stop handlers into rt2x00lib.c which are called
from rt2x00mac_start() and rt2x00mac_stop() after they have checked
the DEVICE_PRESENT flag, while suspend and resume handlers can
directly call those functions.

Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-01-28 15:09:24 -08:00
Ivo van Doorn 042671040d rt2x00: Store queue idx and entry idx in data_ring and data_entry
Store the queue idx inside structure data_ring
Store the entry idx inside structure data_entry
This saves us a few calls to ARRAY_INDEX() which is now unused.

Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-01-28 15:09:24 -08:00
Ivo van Doorn 3867705bb7 rt2x00: Only set the TBCN flag when the interface is configured to send beacons.
These flags used to be fixed to one in rt2500pci_config_type, which
caused the beacon timer interrupt to fire. This would lead to
rt2x00lib_beacondone adding work which called
rt2x00lib_beacondone_scheduled which called ieee80211_beacon_get which
printed an error about not having any beacon data.

With this patch, these interrupts are only generated when the interface
is configured to send beacons.

Signed-off-by: Matthijs Kooijman <matthijs@stdin.nl>
Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-01-28 15:09:23 -08:00
Ivo van Doorn 1230cb83f4 rt2x00: Always call ieee80211_stop_queue() when return NETDEV_TX_BUSY
Apparently it was possible that ieee80211_stop_queue() was not full while
NETDEV_TX_BUSY was being reported back. I think that is what causing the WARN_ON().
This moves all calls to ieee80211_stop_queue() in rt2x00mac.c where it is easier
to determine if the queue should be halted.

Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-01-28 15:09:22 -08:00
Ivo van Doorn 3e34c6dcb3 rt2x00: Fix chipset debugfs file
Initialize blob->data before moving the data pointer
Initialize blob->size based on blob->data size

This fixes the empty chipset file in debugfs.

Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-01-28 15:09:21 -08:00
John W. Linville 2b1ea591f6 rt2x00: correct "skb_buff" typo
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2008-01-28 15:05:54 -08:00
Ivo van Doorn 5a6012e105 rt2x00: Release rt2x00 2.0.13
Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-01-28 15:05:11 -08:00
Ivo van Doorn b3a78b4e2a rt2x00: Cleanup rfkill
The label exit_free_polldev is no longer used and can be removed.
input_free_polled_device() also calls input_free_device(), so
don't call it seperatly.

Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-01-28 15:05:11 -08:00
Larry Finger 6f8a4da17e rt2x00: Remove redundant code in rfkill setup
In rt2x00rfkill.c, routine input_allocate_device() is called even though
input_allocate_polled_device(), which was just called, includes a call to
that routine. This patch, which has not been tested, removes the redundant code.

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-01-28 15:05:10 -08:00
Mattias Nissler 61af43c56b rt2x00: Only update rssi average approximation on receiving beacon frames.
Restrict rssi average updating to beacon frames of the bssid the
interface is
associated with. Without this restriction, strong signals belonging to other
BSS, e.g. beacon frames coming from a nearby AP, would cause incorrectly high
rssi approximation values. This would then cause the link tuner to reduce
sensitivity, resulting in transmissions from the BSS associated to to be
missed.

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-01-28 15:05:09 -08:00
Ivo van Doorn d28c2561fb rt2x00: Use IEEE80211_IF_TYPE_INVALID directly
No need to use a seperate define INVALID_INTERFACE while
we can use IEEE80211_IF_TYPE_INVALID directly.

Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-01-28 15:05:09 -08:00
Ivo van Doorn 4d8dd66c16 rt2x00: Add TX/RX frame dumping facility
This adds TX/RX frame dumping capabilities through debugfs.
The intention is that with this approach debugging of rt2x00 is
simplified since _all_ frames going in and out of the device
are send to debugfs as well along with additional information
like the hardware descriptor.

Based on the patch by Mattias Nissler.
Mattias also has some tools that will make the dumped frames
available to wireshark: http://www-user.rhrk.uni-kl.de/~nissler/rt2x00/

Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-01-28 15:05:08 -08:00
Ivo van Doorn 08992f7fb1 rt2x00: Add skb descriptor
Use the skb->cb field to add a frame description that can be used
to transfer information passed each rt2x00 layer. This reduces the
required arguments for rt2x00lib_write_tx_desc().

Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2008-01-28 15:05:07 -08:00
Ivo van Doorn 22c96c28b4 rt2x00: Add chipset version to chipset debugfs entry
The chipset debugfs entry already indicates it is about the chipset,
it only makes sense to also display the chipset version in there.

Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-01-28 15:05:06 -08:00
Ivo van Doorn 91921a4e9b rt2x00: Move register value/offset files into new folder
Cleanup debugfs interface by moving the csr/bbp/rf/eeprom value/offset
entries into the "register" folder.

Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-01-28 15:05:06 -08:00
Ivo van Doorn 49da2605e2 rt2x00: Extend PLCP descriptor definition for rt2400pci
Extend word field definitions for the PLCP words
in the TX descriptor to contain the BBP fields as well.
This will remove rt2400pci_write_tx_desc() from the
checkstack script.

Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-01-28 15:05:05 -08:00
Ivo van Doorn 2360157c41 rt2x00: Replace DRV_NAME with KBUILD_MODNAME
DRV_NAME was always set to the KBUILD_MODNAME value,
lets clean everything up by removing DRV_NAME and just
use KBUILD_MODNAME directly.

Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-01-28 15:05:04 -08:00
Ivo van Doorn 3957ccb56e rt2x00: Move duplicate code into rt2x00pci_txdone()
rt2400pci, rt2500pci and rt61 require different
txdone handling, but the code that pushes the frame
upstream and cleans up the entry is identical to
all of them.
This will create the function rt2x00pci_txdone()
to remove the duplicate code.

Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-01-28 15:04:40 -08:00
Ivo van Doorn a3c7aa58df rt2x00: Release rt2x00 2.0.12
Version bump.

Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2008-01-28 15:03:05 -08:00
Mattias Nissler 2700f8b048 rt2x00: Correctly set ACK bit in tx descriptors
Add a flag to struct txdata_entry_desc that specifies whether an ack for the
frame is to be expected. Use this flag to set the ACK bit in the tx descriptor.
Previously, the ACK bit could be set incorrectly on CTS-to-self frames, so they
caused retries and were reported to be failed in the txdone handlers.

Signed-off-by: Mattias Nissler <mattias.nissler@gmx.de>
Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2008-01-28 15:03:04 -08:00
Adam Baker 3d82346c5d rt2x00: Place mutex around USB register access
There is a buffer, csr_cache which is used to hold copies of data being passed
to the USB stack which can get corrupted if multiple threads attempt to access
CSR registers simultaneously. There is also the possibility if multiple
threads try to access BBP or RF registers for the multiple USB operations
needed to get interleaved leading to incorrect results. This patch introduces
a mutex to prevent such simultaneous access. The interleaved access problem
may also affect the PCI devices but if so that will be handled in a follow-up
patch.

Signed-off-by: Adam Baker <linux@baker-net.org.uk>
Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2008-01-28 15:03:03 -08:00
Ivo van Doorn 4bd7c452a4 rt2x00: Remove data_desc structure
Coverty indicated that data_desc with a single
element array is bad coding style. This removes
the structure and forces everybody to use __le32.

Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2008-01-28 15:03:03 -08:00
Mattias Nissler 2676c94d4e rt2x00: Rework rt73 antenna selection
This patch changes rt73 antenna selection to what I believe is the correct way.
It also fixes a small selection bug that switched the antennas by accident.

Signed-off-by: Mattias Nissler <mattias.nissler@gmx.de>
Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2008-01-28 15:03:01 -08:00
Ivo van Doorn 50794638dc rt2x00: Remove unused variables
With the updated antenna setup the following
variables are no longer used.

Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2008-01-28 15:03:01 -08:00
Mattias Nissler acaa410d06 rt2x00: Rework rt61 antenna selection.
This patch changes rt61 antenna selection again. It helps at least with the
rt61 pci card in my box, I hope I haven't broken behaviour on other RF chips.
RF 2529 antenna setup is incomplete, we need to at code for diversity when we
figure out how it is done properly.

Signed-off-by: Mattias Nissler <mattias.nissler@gmx.de>
Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2008-01-28 15:03:00 -08:00
Adam Baker 0e14f6d3e0 rt2x00: Unconstify rt2x00dev
Some register accesses need rt2x00dev to be non-const
they all need modifying so the prototype is consistent.

Signed-off-by: Adam Baker <linux@baker-net.org.uk>
Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2008-01-28 15:02:59 -08:00
Ivo van Doorn d9890b8f45 rt2x00: Detect initial rfkill state on register
When registering rfkill, make sure a initial
poll event is directly executed to detect the initial
rfkill state and send the event to the rfkill layer.

Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2008-01-28 15:02:58 -08:00
Ivo van Doorn 4300beb47d rt2x00: Input-polldev requires input device
input-polldev requires a correctly allocated
and initialized input device to be set for the
input_polled_dev->input field.
Failure to do that will prevent correct polling
of the device.

Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2008-01-28 15:02:58 -08:00
Ivo van Doorn e4cd2ff89f rt2x00: Split rt61/rt73 antenna selection into RX and TX antenna
Based on investigation of the legacy drivers, I have made the
following assumptions of the antenna setup:
 - R77 is the TX antenna configuration
 - RF2529 fetches default antenna selection from NIC eeprom word

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

Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2008-01-28 15:02:57 -08:00
Ivo van Doorn e25c4bb913 rt2x00: Disable RX when switching antenna
Antenna switching will be ignored when RX is enabled
during the switch. Make sure we disable the RX during
the switch and don't forget to reenable it later.

Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2008-01-28 15:02:56 -08:00
Ivo van Doorn 2d68de3efa [PATCH] rt2x00: Release rt2x00 2.0.11
Version bump.

Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2008-01-28 15:02:55 -08:00
Mattias Nissler 16b1951f53 [PATCH] rt2x00: Fix antenna selection.
In the config() handler, make sure that we do configure an antenna if the
current active antenna is uninitialized. Furthermore, don't overwrite the
active antenna with bogus values if we didn't touch the antenna setup.

Signed-off-by: Mattias Nissler <mattias.nissler@gmx.de>
Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2008-01-28 15:02:54 -08:00
Ivo van Doorn ddc827f93a [PATCH] rt2x00: Cleanup if-statements
Cleanup if-statements for simple 1/0 register field values.

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

Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2008-01-28 15:02:54 -08:00
Ivo van Doorn 69f81a2cac [PATCH] rt2x00: Implement SW diversity
When mac80211 indicates that the default antenna setup
should be used _and_ that this default setup is SW_DIVERSITY.

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

Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2008-01-28 15:02:53 -08:00
Ivo van Doorn 8de8c5162b [PATCH] rt2x00: Remove rt2x00_clear_link
rt2x00_clear_link() was becoming too large for statically inline,
also it was used on a single location and shouldn't really be
used anywhere else. So move the entire code into the function
rt2x00lib_start_link_tuner()

Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2008-01-28 15:02:52 -08:00
Ivo van Doorn 39e75857d0 [PATCH] rt2x00: SW diversity should default to antenna B
Although ANTENNA_SW_DIVERSITY should never be send
to the driver, we should still handle it to prevent bugs.
But instead of defaulting to ANTENNA_HW_DIVERSITY we
should default to ANTENNA_B instead.

Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2008-01-28 15:02:52 -08:00
Ivo van Doorn addc81bd42 [PATCH] rt2x00: Correctly translate mac80211 antenna setup to rt2x00
mac80211 has 3 values for the antenna setup:
 0 - default
 1 - use antenna 1
 2 - use antenna 2

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

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

Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2008-01-28 15:02:51 -08:00
Ivo van Doorn 362f3b6bfb [PATCH] rt2x00: Use enum defines
When setting the default EEPROM values use
the values from the enums instead of "magic" values.

Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2008-01-28 15:02:50 -08:00
Ivo van Doorn ebcf26dae9 [PATCH] rt2x00: Move quality statistics into seperate structure
Move all link quality statistics variables into
the link_qual structure. This cleans up the link
structure and allows us to use it for more then
just statistics.

Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2008-01-28 15:02:49 -08:00
Ivo van Doorn d101f6496d rt2x00: Fix ieee80211 payload alignment
As Johannes Berg indicated, the NET_IP_ALIGN doesn't
need to be used for ieee80211 frames. This means we
can simplify the alignment calculation to just
use the result of the header size modulus 4 as frame
alignment.

Furthermore we shouldn't use NET_IP_ALIGN in rt2x00usb
because it could be 0 on some architectures and we absolutely
need to have 2 bytes reserved for possible aligning.

Signed-off-by: Ivo van Doorn<IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-01-16 12:53:32 -05:00
Ivo van Doorn c5d0dc5f0d rt2x00: Put 802.11 data on 4 byte boundary
Check the size of the ieee80211 header during rxdone
and make sure the data behind the ieee80211 header
is placed on a 4 byte boundary.

Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-01-10 16:18:25 -05:00
Ivo van Doorn dd87145d2c rt2x00: Corectly initialize rt2500usb MAC
mac is a pointer, obviously we shouldn't use the address
of a pointer as MAC address.

Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-01-10 16:18:24 -05:00
Mattias Nissler 62bc060b8e rt2x00: Allow rt61 to catch up after a missing tx report
Sometimes it happens in the tx path that an entry given to the hardware isn't
reported in the txdone handler. This ultimately led to the dreaded "non-free
entry in the non-full queue" message and the stopping of the tx queue. Work
around this issue by allowing the driver to also clear out previos entries in
the txdone handler.

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-01-10 16:18:24 -05:00
Ivo van Doorn b242e891c2 rt2x00: Request usb_maxpacket() once
The usb max packet size won't change during the
device's presence. We should store it in a
variable inside rt2x00dev and use that.
This should also fix a division error when the
device is being hot-unplugged while a frame is
being send out.

Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2007-11-18 18:47:37 -08:00
David S. Miller d06fc1d9b5 Merge branch 'fixes-davem' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-2.6 2007-11-14 19:44:02 -08:00
Ivo van Doorn 755a957d40 rt2x00: Fix chipset revision validation
The validation of the chipset revision was broken
since for rt2500usb and rt73usb different registers
should be read. When rt2500usb was loaded for a rt73
device it would false think the chipset was correct
because the wrong register was read and validated.

This has been fixed by expanding the check to also
see if the first 4 bits of the revision is not-0
(When reading the wrong register offset the returned
value is usually 0 which can be interpreted as invalid)

Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2007-11-14 21:21:15 -05:00
Ivo van Doorn 453a3fb9bd rt2x00: Block adhoc & master mode
rt2x00 is broken when it comes down to adhoc and master mode.
The main problem is the beaconing, which is completely failing.
Untill a solution has been found, both beacon requiring modes
must be disabled to prevent numerous bug reports.

Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2007-11-10 04:25:11 -05:00
Anton Blanchard b239bd7598 [PATCH] rt2x00: jiffies_round -> jiffies_round_relative
When rounding a relative timeout we need to use round_jiffies_relative().

Signed-off-by: Anton Blanchard <anton@samba.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2007-10-25 22:05:36 -04:00
Ivo van Doorn 1f06862e11 [PATCH] rt2x00: Add new rt73usb USB ID
Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2007-10-18 16:20:59 -04:00
Mattias Nissler db15178755 [PATCH] rt2x00: Fix residual check in PLCP calculations.
Because rt2x00 implements the residual calculation different from what the
legacy code does (i.e. scaled values), we need to adjust the residual check.
Again, we are only mimicking the behaviour of the ralink driver without
actually knowing what we do :-(

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>
2007-10-18 16:19:04 -04:00
Ivo van Doorn 515ea2492c [PATCH] rt2x00: Release 2.0.10
Version bump

Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2007-10-10 16:55:17 -07:00
Ivo van Doorn c22eb87b57 [PATCH] rt2x00: Allways memset memory obtained from skb_push()
When skb_push() is used we should memset the memory before
usage. This will prevent bugs which could occur when the
data is treated as TX descriptor.

Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2007-10-10 16:55:17 -07:00
Ivo van Doorn 37894473fb [PATCH] rt2x00: Clean disabling of rt73usb_get_tsf
By defining rt73usb_get_tsf to NULL we only
have 1 location that needs to be edited
when rt73usb_get_tsf can be enabled again.
This also reduces the number of #ifdefs in
the code which is also a "good thing"

Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2007-10-10 16:55:16 -07:00
Ivo van Doorn 5c58ee51ff [PATCH] rt2x00: Reorganize configuration handler
Reorganize configuration handling by creating a extra
structure which contains precalculated values based
on the mac80211 values which are usefull for all
individual drivers.

This also fixes the preamble configuration problem,
up untill now preamble was never configured since
by default the rate->val value was used when changing
the mode.
Now rate->val will only be used to set the basic rate mask.
The preamble configuration will now be done correctly
through the erp_ie_changed callback function.

Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2007-10-10 16:55:15 -07:00
Ivo van Doorn 4f5af6eb3d [PATCH] rt2x00: Small optimizations
Make some small optimizations by removing
some simple if-statements.

Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2007-10-10 16:55:15 -07:00
Ivo van Doorn 5cbf830e13 [PATCH] rt2x00: Pass dev_state to rt2x00lib_toggle_rx
Directly pass a value from the enum dev_state with rt2x00lib_toggle_rx,
this will save us a ? : statement, and it is clearer then passing a 1 0
argument.

Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2007-10-10 16:55:14 -07:00
Ivo van Doorn dd9fa2d21a [PATCH] rt2x00: Add get_tx_data_len callback function
The TX datalen must always be converted to a value rt73 and rt2500usb
understand. Both require to use a different size then skb->len.
First off this is required because the descriptor must be added,
but the second is because the value must be a multiple of either 2 or 4,
and it should not be a multiple of the USB packetmax

Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2007-10-10 16:55:13 -07:00
Ivo van Doorn 9ee8f57e0a [PATCH] rt2x00: Cut lines down to 80 characters
rt61pci contained 1 line of 88 characters width,
this needs to be cut down.

Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2007-10-10 16:55:13 -07:00
Ivo van Doorn a137e202b0 [PATCH] rt2x00: get_duration expects values in 100kbs
get_duration expects all speeds to be passed in 100kbs,
this means that passing 2 is incorrect and should be raised to 20

Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2007-10-10 16:55:12 -07:00
Ivo van Doorn feb24691e3 [PATCH] rt2x00: Move TSF sync values into rt2x00config
All drivers use the same values for TSF sync,
this will move the value determination into rt2x00config.c,
and the definition for the values to rt2x00reg.h

Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2007-10-10 16:55:12 -07:00
Ivo van Doorn 81873e9ccd [PATCH] rt2x00: Fix rfkill handling
As reported by Modestas Vainius, enabling rkfill in 1 driver and
disabling it in a second could cause a NULL pointer exception when
the rfkill-disabled driver still sets the CONFIG_SUPPORT_HW_BUTTON flag.

Furthermore, rfkill expects the timeout as a value in milliseconds
instead of jiffies. Also increase the timeout to a second,
since this 250ms would be overkill.

Also the flag DEVICE_ENABLED_RADIO_HW is causing problems
for devices which do not support the hardware button
while rfkill is enabled in the driver.

To remidy this we should inverse the flag and its meaning,
rename the flag to DEVICE_DISABLED_RADIO_HW this means that
by default the radio is enabled by the hardware button (if present)
and can only be disabled explicitely.

Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2007-10-10 16:55:11 -07:00
Ivo van Doorn 5886d0dbf5 [PATCH] rt2x00: Don't use changed_flags inside configure_packet_filter
We shouldn't use changed_flags when configuring the packet filter,
we work directly with the total_flags which is safe enough since
we already check if something has changed after we applied our
packet filtering flag rules.
Also make sure that when the packet filter is scheduled, the
rt2x00dev->interface.filter is cleared to make sure the drivers
will update the packet filter instead of failing at the check:
*total_flags == rt2x00dev->interface.filter

Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2007-10-10 16:55:10 -07:00
Ivo van Doorn 483272f5ee [PATCH] rt2x00: Move rt2x00dev flags into enumeration
By putting the flags into a enumeration we can
make it easier maintable since we don't have to
assign numbers for each flag. This makes it easier
to insert and remove flags.

Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2007-10-10 16:55:10 -07:00
Ivo van Doorn 6d7f9877a6 [PATCH] rt2x00: Store "STARTED" state during suspend
Store the started state into a new flag DEVICE_STARTED_SUSPEND
and set this when suspending while the device was started.
We can't check for is_interface_present() since only mac80211
knows if there are monitor interfaces present.

Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2007-10-10 16:55:09 -07:00
Ivo van Doorn 3a84732a5c [PATCH] rt2x00: Remove radio check from rt2x00lib_toggle_rx
Don't check if the radio is enabled in rt2x00lib_toggle_rx,
this is required since the link tuner should be disabled
when shutting down the device. The remaining calls inside the
rt2x00lib_toggle_rx handler should deliver no problems when
called while the radio is done.

Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2007-10-10 16:55:08 -07:00
Ivo van Doorn 4abee4bbd7 [PATCH] rt2x00: Remove duplicate code in MAC & BSSID handling
The various drivers contained duplicate code to handle the
MAC and BSSID initialization correctly. This moves the
address copy to little endian variables to rt2x00config.

Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2007-10-10 16:55:08 -07:00
Johannes Berg a289755250 [MAC80211]: add "invalid" interface type
Since I cannot convince the lazy driver authors (hello Michael)
to stop (ab)using the MGMT interface type internally in their
drivers, this patch introduces a new _INVALID type especially
for their use and changes all affected drivers to use it.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2007-10-10 16:54:15 -07:00
Ivo van Doorn 3a1532f2f8 [PATCH] rt2x00: Release rt2x00 2.0.9
Version bump

Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2007-10-10 16:53:07 -07:00
Ivo van Doorn fdd0abc817 [PATCH] rt2x00: Fix panic on rmmod with rfkill enabled
When ieee80211_hw.config indicates that the radio
is enabled and is configuring options that require
the link tuner to be restarted the link tuner will
cause a kernel panic when rfkill has indicated the
radio was in fact disabled.

Signed-off-by: Modestas Vainius <modestas@vainius.eu>
Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2007-10-10 16:53:06 -07:00
Ivo van Doorn dcf5475bc8 [PATCH] rt2x00: Fix obvious typo in comment
Signed-off-by: Modestas Vainius <modestas@vainius.eu>
Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2007-10-10 16:53:06 -07:00
Ivo van Doorn 25ab002f94 [PATCH] rt2x00: Stop link tuning when radio is down
As pointed out by Modestas Vainius the link tuner
could continue working while the radio is already
down. This because at the start of disable_radio
the ENABLED_RADIO flag is cleared and causes the
toggle_rx to skip the stop_link_tuner() call.
This will add a check to the start of the link tuner
which will automatically stop the link tuner when the
radio is disabled.

Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2007-10-10 16:53:05 -07:00
Ivo van Doorn 3e30968e55 [PATCH] rt2x00: make rt2x00lib_stop_link_tuner() reentrant with link_tuner work
Calling cancel_delayed_work_sync() unconditionally won't hurt
and it will avoid race conditions when another CPU is already
executing link_tuner work.

Signed-off-by: Modestas Vainius <modestas@vainius.eu>
Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2007-10-10 16:53:04 -07:00
Ivo van Doorn 643b252123 rt2x00: Add rt2x00dev->flags to debugfs
Loosely based on the patch by Matthijs Kooijman,
this will add the dev_flags entry into debugfs which
will display rt2x00dev->flags.
This will allow easier debugging of flag handling.

Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2007-10-10 16:53:04 -07:00
Ivo van Doorn 066cb637b1 [PATCH] rt2x00: Reorganize rt2x00dev->flags
The rt2x00dev->flags has become a chaos over time,
this will reorganize the flags by renaming, deleting, adding
and properly implement the flags.

Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2007-10-10 16:53:03 -07:00
Ivo van Doorn 12dadb9009 [PATCH] rt2x00: Correctly identify rt2561turbo
Apparently rt2561s actually has PCI ID 0x0301
and rt2561 actually has PCI ID 0x0302.
Where rt2561s supports Turbo.

Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2007-10-10 16:53:03 -07:00
Ivo van Doorn e9136550eb [PATCH] rt2x00: Increase rt2x00usb_vendor_request timeout.
By increasing the timeout for rt2x00usb_vendor_request,
we should limit the number of loops required to send
a signal to the device succefully.
500ms timeout is specified by the Ralink legacy drivers
for rt2500usb. For rt73usb 1000ms is specified, but that
includes the timeout for the firmware which is already
specified in a different define.

Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2007-10-10 16:53:02 -07:00
Ivo van Doorn 2484591049 [PATCH] rt2x00: Make *_beacon_update static
Make rt61pci_beacon_update and rt73usb_beacon_update static,
they are only used inside their own source file and then only
for setting it as callback funtion for mac80211.

Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2007-10-10 16:53:02 -07:00
Ivo van Doorn 725d99d466 [PATCH] rt2x00: Correct error in calculating rssi for link tuner
The call to rt2x00lib_precalculate_link_signal resets link.rx_success
which is needed when calculating the average rssi for the link
tuner. Change the call order so the link tuner runs first as it
doesn't need the result of the precalculate.

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>
2007-10-10 16:53:01 -07:00
Johannes Berg 4150c57212 [PATCH] mac80211: revamp interface and filter configuration
Drivers are currently supposed to keep track of monitor
interfaces if they allow so-called "hard" monitor, and
they are also supposed to keep track of multicast etc.

This patch changes that, replaces the set_multicast_list()
callback with a new configure_filter() callback that takes
filter flags (FIF_*) instead of interface flags (IFF_*).
For a driver, this means it should open the filter as much
as necessary to get all frames requested by the filter flags.
Accordingly, the filter flags are named "positively", e.g.
FIF_ALLMULTI.

Multicast filtering is a bit special in that drivers that
have no multicast address filters need to allow multicast
frames through when either the FIF_ALLMULTI flag is set or
when the mc_count value is positive.

At the same time, drivers are no longer notified about
monitor interfaces at all, this means they now need to
implement the start() and stop() callbacks and the new
change_filter_flags() callback. Also, the start()/stop()
ordering changed, start() is now called *before* any
add_interface() as it really should be, and stop() after
any remove_interface().

The patch also changes the behaviour of setting the bssid
to multicast for scanning when IEEE80211_HW_NO_PROBE_FILTERING
is set; the IEEE80211_HW_NO_PROBE_FILTERING flag is removed
and the filter flag FIF_BCN_PRBRESP_PROMISC introduced.
This is a lot more efficient for hardware like b43 that
supports it and other hardware can still set the BSSID
to all-ones.

Driver modifications by Johannes Berg (b43 & iwlwifi), Michael Wu
(rtl8187, adm8211, and p54), Larry Finger (b43legacy), and
Ivo van Doorn (rt2x00).

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: Michael Wu <flamingice@sourmilk.net>
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2007-10-10 16:52:57 -07:00
Joe Perches 0795af5729 [NET]: Introduce and use print_mac() and DECLARE_MAC_BUF()
This is nicer than the MAC_FMT stuff.

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2007-10-10 16:51:42 -07:00
Ivo van Doorn 95ea36275f [RT2x00]: add driver for Ralink wireless hardware
Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2007-10-10 16:51:39 -07:00