summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2010-07-16mac80211: improve error checking if WEP fails to initmaster-2010-07-16John W. Linville
Do this by poisoning the values of wep_tx_tfm and wep_rx_tfm if either crypto allocation fails. Reported-by: Stanislaw Gruszka <sgruszka@redhat.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-07-16orinoco_usb: potential null dereferenceDan Carpenter
Smatch complains that "upriv->read_urb" gets dereferenced before checking for NULL. It turns out that it's possible for "upriv->read_urb" to be NULL so I added checks around the dereferences. Also I remove an "if (upriv->bap_buf != NULL)" check because "kfree(NULL) is OK. Signed-off-by: Dan Carpenter <error27@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-07-16ath9k_hw: Fix AR9003 MPDU delimeter CRC check for middle subframesLuis R. Rodriguez
An A-MPDU may contain several subframes each containing its own CRC for the data. Each subframe also has a respective CRC for the MPDU length and 4 reserved bits (aka delimeter CRC). AR9003 will ACK frames that have a valid data CRC but have failed to pass the CRC for the MPDU length, if and only if the subframe is not the last subframe in an A-MPDU and if an OFDM phy OFDM reset error has been caught. Discarding those subframes results in packet loss under heavy stress conditions, an example being UDP video. Since the frames are ACK'd by hardware we need to let these frames through and process them as valid frames. Cc: Tushit Jain <tushit.jain@atheros.com> Cc: Kyungwan Nam <kyungwan.nam@atheros.com> Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-07-16mac80211: skip HT parsing if HW does not support HTChristian Lamparter
This patch will also fix the odd freeze which occurred when minstrel_ht connects to an 802.11n network with legacy hardware. Signed-off-by: Christian Lamparter <chunkeey@googlemail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-07-16ath9k_htc: make ath9k_htc_tx_aggr_oper() staticLuis R. Rodriguez
This fixes this sparse complaint: CHECK drivers/net/wireless/ath/ath9k/htc_drv_main.c drivers/net/wireless/ath/ath9k/htc_drv_main.c:441:5: warning: symbol 'ath9k_htc_tx_aggr_oper' was not declared. Should it be static? Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-07-14iwlwifi: convert new uses of __attribute__ ((packed)) to __packedmaster-2010-07-14John W. Linville
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-07-14libertas: convert new uses of __attribute__ ((packed)) to __packedJohn W. Linville
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-07-14ath5k: clean up rxlink handlingBruno Randolf
There were a few places where the sc->rxlink pointer was set to NULL "just in case". This helps nothing - quite to the contrary it is problematic since it can create self-linked rx descriptors in the middle of the list of receive buffers. Here is an example how this could happen (thanks Bob!): cpu 0: cpu 1: ath5k_rx_stop ath5k_tasklet_rx sc->rxlink = NULL; /* just in case */ // following doesn't link used // buffer to prev. ath5k_rxbuf_setup() In the case of ath5k_rx_stop() and ath5k_stop_locked() buffers/descriptors are not changed so rxlink should not be changed as well. In ath5k_intr() we seem to try to work around a hardware bug, as the comment (which is copied 1:1 from the HAL) suggests. I don't see how this could help. Also the HAL does not set rxlink in this case (So where does this code come from? It has been there since the first import of ath5k). Changed to just increment a statistics counter. After this patch rxlink is only set to NULL before we initialize rx descriptors and updated when the descriptors are linked together. Signed-off-by: Bruno Randolf <br1@einfach.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-07-14ath5k: disable tasklets during resetBob Copeland
Based on a patch from Bruno Randolf, attempting useful work while we are resetting the chip just leads to interface lockups and bad descriptor data, and possibly DMAing to freed buffers. Let's suspend all tasklets while reprogramming the registers in the card to avoid such problems. In the future we can convert the tasklets to threaded interrupt handlers to simplify things. Signed-off-by: Bob Copeland <me@bobcopeland.com> Acked-by: Bruno Randolf <br1@einfach.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-07-14ath5k: move reset to mac80211 workqueueBob Copeland
We currently trigger a reset via a tasklet when certain error conditions are detected so that the card will (eventually) restart. Unfortunately this makes locking complicated since reset can also be called in process context (e.g. for channel change). Currently nothing protects against concurrent resets, which can be the source of corruption bugs. Reset takes too long to spinlock the whole thing, so this patch moves deferred resets into the mac80211 workqueue to enable use of sc->lock mutex. Signed-off-by: Bob Copeland <me@bobcopeland.com> Acked-by: Bruno Randolf <br1@einfach.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-07-14ath9k_hw: remove initvals for hardware which was never soldFelix Fietkau
According to documentation, The following chip revisions were never sold: - AR9280 v1.0 - AR9285 v1.0 - AR9285 v1.1 - AR9287 v1.0 Removing initvals specific to these chip revisions saves around 30k in binary size (tested on MIPS). Signed-off-by: Felix Fietkau <nbd@openwrt.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-07-14wireless: airo: delete netdev from list after it is freedKulikov Vasiliy
We must call del_airo_dev() before free_netdev() since we call add_airo_dev() exactly after alloc_netdev(). Signed-off-by: Kulikov Vasiliy <segooon@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-07-14cfg80211: don't get expired BSSesJohannes Berg
When kernel-internal users use cfg80211_get_bss() to get a reference to a BSS struct, they may end up getting one that would have been removed from the list if there had been any userspace access to the list. This leads to inconsistencies and problems. Fix it by making cfg80211_get_bss() ignore BSSes that cfg80211_bss_expire() would remove. Fixes http://bugzilla.intellinuxwireless.org/show_bug.cgi?id=2180 Cc: stable@kernel.org Reported-by: Jiajia Zheng <jiajia.zheng@intel.com> Tested-by: Jiajia Zheng <jiajia.zheng@intel.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-07-14ath9k: another fix for the A-MPDU buffer leakFelix Fietkau
The patch 'ath9k: fix a buffer leak in A-MPDU completion' addressed the issue of running out of buffers/descriptors in the tx path if a STA is deleted while tx status feedback is still pending. The remaining issue is that the skbs of the buffers are not reclaimed, leaving a memory leak. This patch fixes this issue by running the buffers through ath_tx_complete_buf(), ensuring that the pending frames counter is also updated. Signed-off-by: Felix Fietkau <nbd@openwrt.org> Cc: stable@kernel.org Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-07-14drivers/net/wireless: Remove unnecessary casts of private_dataJoe Perches
Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-07-14ath9k: fix panic while cleaning up virtaul wifisRajkumar Manoharan
num_sec_wiphy means max secondary wifis that the driver can accomudate. So cancelling wiphy work should be based on the presence of secondary wifis. Signed-off-by: Rajkumar Manoharan <rmanoharan@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-07-14ath9k: remove unneeded calculation of minimal calibration powerPavel Roskin
Remove tMinCalPower from ath9k_hw_set_def_power_cal_table(), as it's never used. Remove corresponding arguments of the functions calculating that value. Original patch by Prarit Bhargava <prarit@redhat.com> Signed-off-by: Pavel Roskin <proski@gnu.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-07-14ath9k: Fix the LED behaviour in idle unassociated state.Vivek Natarajan
LED should be ON when the radio is put into FULL SLEEP mode during the idle unassociated state. Signed-off-by: Vivek Natarajan <vnatarajan@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-07-13Merge branch 'master' of ↵master-2010-07-13John W. Linville
git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-2.6
2010-07-12p54: update MAINTAINERSmaster-2010-07-12Christian Lamparter
Michael has been out of the scene for a while now, but despite Michael's absence, p54 is still maintained. Cc: Michael Wu <aluminum.tape@gmail.com> Cc: Larry Finger <Larry.Finger@lwfinger.net> Cc: Luis R. Rodriguez <lrodriguez@atheros.com> Signed-off-by: Christian Lamparter <chunkeey@googlemail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-07-12ath9k: merge noisefloor load implementationsFelix Fietkau
AR5008+ and AR9003 currently use two separate implementations of the ath9k_hw_loadnf function. There are three main differences: - PHY registers for AR9003 are different - AR9003 always uses 3 chains, earlier versions are more selective - The AR9003 variant contains a fix for NF load timeouts This patch merges the two implementations into one, storing the register array in the ath_hw struct. The fix for NF load timeouts is not just relevant for AR9003, but also important for earlier hardware, so it's better to just keep one common implementation. Signed-off-by: Felix Fietkau <nbd@openwrt.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-07-12ath9k: validate the TID in the tx status informationFelix Fietkau
Occasionally the hardware can send out tx status information with the wrong TID. In that case, the BA status cannot be trusted and the aggregate must be retransmitted. Signed-off-by: Felix Fietkau <nbd@openwrt.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-07-12ath9k_hw: report the TID in the tx status on AR5008-AR9002Felix Fietkau
Signed-off-by: Felix Fietkau <nbd@openwrt.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-07-12ath9k_hw: prevent a fast channel change after a rx DMA stuck issueFelix Fietkau
If the receive path gets stuck, a full hardware reset is necessary to recover from it. If this happens during a scan, the whole scan might fail, as each channel change bypasses the full reset sequence. Fix this by resetting the fast channel change flag if stopping the receive path fails. This will reduce the number of error messages that look like this: ath: DMA failed to stop in 10 ms AR_CR=0x00000024 AR_DIAG_SW=0x40000020 Signed-off-by: Felix Fietkau <nbd@openwrt.org> Cc: stable@kernel.org Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-07-12ath9k_hw: fix an off-by-one error in the PDADC boundaries calculationFelix Fietkau
PDADC values were only generated for values surrounding the target index, however not for the target index itself, leading to a minor error in the generated curve. Signed-off-by: Felix Fietkau <nbd@openwrt.org> Cc: stable@kernel.org Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-07-12ath9k_hw: fix a sign error in the IQ calibration codeFelix Fietkau
Signed-off-by: Felix Fietkau <nbd@openwrt.org> Cc: stable@kernel.org Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-07-12ath9k_hw: fix antenna diversity on AR9285Felix Fietkau
On AR9285, the antenna switch configuration register uses more than just 16 bits. Because of an arbitrary mask applied to the EEPROM value that stores this configuration, diversity was broken in some cases, leading to a significant degradation in signal strength. Fix this by changing the callback to return a 32 bit value and remove the arbitrary mask. Signed-off-by: Felix Fietkau <nbd@openwrt.org> Cc: stable@kernel.org Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-07-12rt2x00: Move driver callback functions into the ops structureIvo van Doorn
All callback functions are gathered in rt2x00dev->ops except for the callback functions which are used in rt2800lib to acces rt2800pci/usb. Move the priv pointer from rt2x00dev to rt2x00dev->ops and rename it to drv to make it obvious that it is the driver callback structure. Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-07-12rt2x00: Move common firmware loading into rt2800libIvo van Doorn
Large parts of the firmware initialization are shared between rt2800pci and rt2800usb. Move this code into rt2800lib. Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-07-12rt2x00: Add missing TSF sync mode for AP operationHelmut Schaa
Currently rt2x00 uses the TSF_SYNC_BEACON mode for all beaconing interface types. However, TSF_SYNC_BEACON is meant for IBSS networks and thus implements TSF merging in the hardware. Rename TSF_SYNC_BEACON to TSF_SYNC_ADHOC to better express its purpose and introduce the missing TSF sync mode TSF_SYNC_AP_NONE which should be used for beaconing modes that don't need TSF merging. Signed-off-by: Helmut Schaa <helmut.schaa@googlemail.com> Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-07-12rt2x00: Don't initialize beacon interval to 0 on rt2800 devicesHelmut Schaa
Activating the TBTT interrupt when a beacon interval of 0 is configured results in an interrupt storm causing the machine to hang. Hence, initialize the beacon interval to a reasonable default of 100TUs. Signed-off-by: Helmut Schaa <helmut.schaa@googlemail.com> Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-07-12rt2x00: Remove set_tim callback from PCI driversHelmut Schaa
Using the set_tim callback without managing the DTIM count and the broad- and multicast buffering in hw, fw or the driver results in wrong DTIM count values being sent out in beacons. Since all PCI drivers fetch new beacons periodically and hence get an updated TIM we can just remove the set_tim callback from these. The rt2x00 USB drivers don't update the beacon periodically and thus rely on the set_tim callback to get a correct TIM for beacon transmission. USB devices still suffer from the DTIM count being wrong under some circumstances but removing the set_tim callback from these would cause more harm then good. Signed-off-by: Helmut Schaa <helmut.schaa@googlemail.com> Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-07-12rt2x00: Use separate mac80211_ops for rt2800pci and rt2800usbHelmut Schaa
Use separate mac80211_ops for rt2800pci and rt2800usb in preparation for further fixes. This shouldn't introduce functional changes. Signed-off-by: Helmut Schaa <helmut.schaa@googlemail.com> Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-07-12rt2x00: Use pretbtt irq for fetching beacons on rt2800pciHelmut Schaa
Updating the beacon on pre tbtt instead of beacondone allows much lower latency in regard to TIM updates. Hence, use the pre tbtt interrupt for updating the beacon in rt2800pci (older devices don't provide a pre tbtt interrupt). Also, add a new driver flag to indicate if a driver has pre tbtt support or not and implement the according behavior in rt2x00lib. Signed-off-by: Helmut Schaa <helmut.schaa@googlemail.com> Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-07-12rt2x00: Implement broad- and multicast bufferingHelmut Schaa
Although mac80211 buffers broad- and mutlicast frames for us in AP mode we still have to send them out after a DTIM beacon. Implement this behavior by sending out the buffered frames when the beacondone interrupt is processed. Signed-off-by: Helmut Schaa <helmut.schaa@googlemail.com> Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-07-12rt2x00: Allow beacon update without scheduling a workHelmut Schaa
Since all rt2x00 PCI drivers use threaded interrupts now we don't need to schedule a work just to update the beacon. The only place where the beacon still gets updated in atomic context is from the set_tim callback. Hence, move the work scheduling there. Signed-off-by: Helmut Schaa <helmut.schaa@googlemail.com> Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-07-12rt2x00: Convert rt2x00 to use threaded interruptsHelmut Schaa
Use threaded interrupts for all rt2x00 PCI devices. This has several generic advantages: - Reduce the time we spend in hard irq context - Use non-atmic mac80211 functions for rx/tx Furthermore implementing broad- and multicast buffering will be much easier in process context while maintaining low latency and updating the beacon just before transmission (pre tbtt interrupt) can also be done in process context. Signed-off-by: Helmut Schaa <helmut.schaa@googlemail.com> Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-07-12rt2x00: Make rt2800_write_beacon only export to GPLIvo van Doorn
rt2800_write_beacon is the only function which uses EXPORT_SYMBOL instead of EXPORT_SYMBOL_GPL. All symbols in rt2x00 should however use the GPL restricted export. Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com> Acked-by: Gertjan van Wingerde <gwingerde@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-07-12rt2x00: Implement watchdog monitoringIvo van Doorn
Implement watchdog monitoring for USB devices (PCI support can be added later). This will determine if URBs being uploaded to the hardware are actually returning. Both rt2500usb and rt2800usb have shown that URBs being uploaded can remain hanging without being released by the hardware. By using this watchdog, a queue can be reset when this occurs. For rt2800usb it has been tested that the connection is preserved even though this interruption. Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-07-12rt2x00: Fix vgc_level_reg handlingIvo van Doorn
Currently vgc_level_reg and vgc_level are equal to eachother, while the purpose of vgc_level_reg is the value last written to the register and is remembered through link tuning resets. The vgc_level is the currently active level, which is reset during link tuning resets. The usage of these variables depends on the drivers, some drivers need both, while others need only one of the two. Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-07-12rt2x00: Disable link tuning while scanningIvo van Doorn
While scanning the link tuner must be disabled. Otherwise it will interfere with receiving all beacons for each channel due to changing sensitivity levels. Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-07-12rt2x00: Rename CONFIG_DISABLE_LINK_TUNINGIvo van Doorn
Rename CONFIG_DISABLE_LINK_TUNING to DRIVER_SUPPORT_LINK_TUNING Link tuning support is not only based on EEPROM decisions, but also if the device actually supports it. Currently only rt2500usb doesn't support link tuning because of hardware problems. But rt2800usb is also suspected of having problems with link tuning. Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-07-12rt2x00: Convert AGC value from descriptor to RSSI (dBm)Ivo van Doorn
The RSSI values in the RXWI descriptor aren't true RSSI values. Instead they are more like the AGC values similar to rt61pci. And as such, it needs the same conversion before it can be passed to rt2x00lib/mac80211. This requires the struct queue_entry to be passed to rt2800_process_rxwi rather then the skb structure which is contained in the queue_entry. This is required to obtain the lna_gain information from the rt2x00_dev structure. This fixes connection problems when using wpa_supplicant which would try to connect to the worst AP's rather then the best ones. Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-07-12rt2x00: Limit txpower by eeprom valuesHelmut Schaa
Limit the txpower per rate by the approriate values in the eeprom. This avoids too high txpower values resulting in bad tx performance. Signed-off-by: Helmut Schaa <helmut.schaa@googlemail.com> Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-07-12hostap: fixup strlen() mathDan Carpenter
In hostap_add_interface() we do: sprintf(dev->name, "%s%s", prefix, name); dev->name has IFNAMSIZ (16) characters. prefix is local->dev->name. name is "wds%d" strlen() returns the number of characters in the string not counting the NULL so if we have a string with 11 characters we get "12345678901wds%d" which is 16 characters and a NULL so we're past the end of the array. Signed-off-by: Dan Carpenter <error27@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-07-12adm8211: fix memory leakKulikov Vasiliy
We must free priv->eeprom allocated in adm8211_read_eeprom(). Signed-off-by: Kulikov Vasiliy <segooon@gmail.com> Acked-by: Luis R. Rodriguez <lrodriguez@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-07-12prism54: call BUG_ON() earlierDan Carpenter
This test is off by one because strlen() doesn't include the NULL terminator. Signed-off-by: Dan Carpenter <error27@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-07-12wl1271: use __packed annotationLuciano Coelho
This patch changes __attribute__ ((packed)) annotations to __packed in wl1271 code that was introduced in a recent patch in wireless-testing. Cc: Stephen Rothwell <sfr@canb.auug.org.au> Signed-off-by: Luciano Coelho <luciano.coelho@nokia.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-07-12libertas: Added support for host sleep featureAmitkumar Karwar
Existing "ethtool -s ethX wol X" command configures hostsleep parameters, but those are activated only during suspend/resume, there is no way to configure host sleep without actual suspend. This patch adds debugfs command to enable/disable host sleep based on already configured host sleep parameters using wol command. Signed-off-by: Amitkumar Karwar <akarwar@marvell.com> Signed-off-by: Kiran Divekar <dkiran@marvell.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-07-12cfg80211: ignore spurious deauthJohannes Berg
Ever since mac80211/drivers are no longer fully in charge of keeping track of the auth status, trying to make them do so will fail. Instead of warning and reporting the deauthentication to userspace, cfg80211 must simply ignore it so that spurious deauthentications, e.g. before starting authentication, aren't seen by userspace as actual deauthentications. Cc: stable@kernel.org Reported-by: Paul Stewart <pstew@google.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>