aboutsummaryrefslogtreecommitdiff
path: root/drivers/net/wireless/rt2x00/rt2400pci.c
AgeCommit message (Collapse)AuthorFilesLines
2008-03-13rt2x00: Only disable beaconing just before beacon updateIvo van Doorn1-7/+13
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 <[email protected]> Signed-off-by: John W. Linville <[email protected]>
2008-02-29rt2x00: Cleanup mode registrationIvo van Doorn1-2/+2
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 <[email protected]> Signed-off-by: John W. Linville <[email protected]>
2008-02-29rt2x00: Remove reset_tsf()Ivo van Doorn1-9/+0
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 <[email protected]> Signed-off-by: John W. Linville <[email protected]>
2008-02-29rt2x00: Fix Descriptor DMA initializationIvo van Doorn1-8/+13
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 <[email protected]> Signed-off-by: John W. Linville <[email protected]>
2008-02-29rt2x00: Don't report driver generated frames to tx_status()Ivo van Doorn1-0/+1
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 <[email protected]>. Signed-off-by: Ivo van Doorn <[email protected]> Signed-off-by: John W. Linville <[email protected]>
2008-02-29rt2x00: Make rt2x00 less verboseIvo van Doorn1-4/+0
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 <[email protected]> Signed-off-by: John W. Linville <[email protected]>
2008-02-29rt2x00: Make use of MAC80211_LED_TRIGGERSIvo van Doorn1-40/+48
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 <[email protected]> Signed-off-by: John W. Linville <[email protected]>
2008-02-29rt2x00: Move beacon and atim queue defines into rt2x00Ivo van Doorn1-5/+48
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 <[email protected]> Signed-off-by: John W. Linville <[email protected]>
2008-02-29rt2x00: Add per-interface structureIvo van Doorn1-41/+43
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 <[email protected]> Signed-off-by: John W. Linville <[email protected]>
2008-02-29rt2x00: Queue handling overhaulIvo van Doorn1-87/+117
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 <[email protected]> Signed-off-by: John W. Linville <[email protected]>
2008-02-29rt2x00: Update copyright noticeIvo van Doorn1-1/+1
Signed-off-by: Ivo van Doorn <[email protected]> Signed-off-by: John W. Linville <[email protected]>
2008-02-28rt2x00: Add link tuner safe RX toggle statesIvo van Doorn1-1/+5
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 <[email protected]> Signed-off-by: John W. Linville <[email protected]>
2008-01-28mac80211: add unified BSS configurationJohannes Berg1-1/+1
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 <[email protected]> Signed-off-by: Johannes Berg <[email protected]> Signed-off-by: John W. Linville <[email protected]>
2008-01-28rt2x00: Move init_txring and init_rxring into rt2x00libIvo van Doorn1-56/+27
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 <[email protected]> Signed-off-by: John W. Linville <[email protected]>
2008-01-28rt2x00: Determine MY_BSS from descriptorIvo van Doorn1-0/+1
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 <[email protected]> Signed-off-by: John W. Linville <[email protected]>
2008-01-28rt2x00: Cleanup write_tx_desc() argumentsIvo van Doorn1-4/+4
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 <[email protected]> Signed-off-by: John W. Linville <[email protected]>
2008-01-28rt2x00: Move packet filter flagsIvo van Doorn1-6/+2
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 <[email protected]> Signed-off-by: John W. Linville <[email protected]>
2008-01-28rt2x00: Only set the TBCN flag when the interface is configured to send beacons.Ivo van Doorn1-1/+1
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 <[email protected]> Signed-off-by: Ivo van Doorn <[email protected]> Signed-off-by: John W. Linville <[email protected]>
2008-01-28rt2x00: Extend PLCP descriptor definition for rt2400pciIvo van Doorn1-28/+12
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 <[email protected]> Signed-off-by: John W. Linville <[email protected]>
2008-01-28rt2x00: Replace DRV_NAME with KBUILD_MODNAMEIvo van Doorn1-7/+2
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 <[email protected]> Signed-off-by: John W. Linville <[email protected]>
2008-01-28rt2x00: Move duplicate code into rt2x00pci_txdone()Ivo van Doorn1-19/+1
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 <[email protected]> Signed-off-by: John W. Linville <[email protected]>
2008-01-28rt2x00: Correctly set ACK bit in tx descriptorsMattias Nissler1-1/+1
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 <[email protected]> Signed-off-by: Ivo van Doorn <[email protected]> Signed-off-by: John W. Linville <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2008-01-28rt2x00: Remove data_desc structureIvo van Doorn1-5/+5
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 <[email protected]> Signed-off-by: John W. Linville <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2008-01-28rt2x00: Unconstify rt2x00devAdam Baker1-6/+6
Some register accesses need rt2x00dev to be non-const they all need modifying so the prototype is consistent. Signed-off-by: Adam Baker <[email protected]> Signed-off-by: Ivo van Doorn <[email protected]> Signed-off-by: John W. Linville <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2008-01-28[PATCH] rt2x00: Cleanup if-statementsIvo van Doorn1-18/+10
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 <[email protected]> Signed-off-by: John W. Linville <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2008-01-28[PATCH] rt2x00: SW diversity should default to antenna BIvo van Doorn1-2/+14
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 <[email protected]> Signed-off-by: John W. Linville <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2008-01-28[PATCH] rt2x00: Correctly translate mac80211 antenna setup to rt2x00Ivo van Doorn1-8/+17
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 <[email protected]> Signed-off-by: John W. Linville <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2008-01-28[PATCH] rt2x00: Move quality statistics into seperate structureIvo van Doorn1-5/+6
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 <[email protected]> Signed-off-by: John W. Linville <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2007-10-10[PATCH] rt2x00: Reorganize configuration handlerIvo van Doorn1-78/+54
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 <[email protected]> Signed-off-by: John W. Linville <[email protected]>
2007-10-10[PATCH] rt2x00: get_duration expects values in 100kbsIvo van Doorn1-1/+1
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 <[email protected]> Signed-off-by: John W. Linville <[email protected]>
2007-10-10[PATCH] rt2x00: Move TSF sync values into rt2x00configIvo van Doorn1-9/+3
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 <[email protected]> Signed-off-by: John W. Linville <[email protected]>
2007-10-10[PATCH] rt2x00: Fix rfkill handlingIvo van Doorn1-2/+4
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 <[email protected]> Signed-off-by: John W. Linville <[email protected]>
2007-10-10[PATCH] rt2x00: Don't use changed_flags inside configure_packet_filterIvo van Doorn1-2/+2
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 <[email protected]> Signed-off-by: John W. Linville <[email protected]>
2007-10-10[PATCH] rt2x00: Remove duplicate code in MAC & BSSID handlingIvo van Doorn1-22/+8
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 <[email protected]> Signed-off-by: John W. Linville <[email protected]>
2007-10-10[PATCH] rt2x00: Reorganize rt2x00dev->flagsIvo van Doorn1-2/+2
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 <[email protected]> Signed-off-by: John W. Linville <[email protected]>
2007-10-10[PATCH] mac80211: revamp interface and filter configurationJohannes Berg1-70/+85
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 <[email protected]> Signed-off-by: Michael Wu <[email protected]> Signed-off-by: Larry Finger <[email protected]> Signed-off-by: Ivo van Doorn <[email protected]> Signed-off-by: John W. Linville <[email protected]>
2007-10-10[NET]: Introduce and use print_mac() and DECLARE_MAC_BUF()Joe Perches1-1/+3
This is nicer than the MAC_FMT stuff. Signed-off-by: Joe Perches <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2007-10-10[RT2x00]: add driver for Ralink wireless hardwareIvo van Doorn1-0/+1689
Signed-off-by: Ivo van Doorn <[email protected]> Signed-off-by: John W. Linville <[email protected]> Signed-off-by: David S. Miller <[email protected]>