aboutsummaryrefslogtreecommitdiff
path: root/drivers/net/wireless/rt2x00
AgeCommit message (Collapse)AuthorFilesLines
2013-07-03drivers: avoid format strings in names passed to alloc_workqueue()Kees Cook1-1/+1
For the workqueue creation interfaces that do not expect format strings, make sure they cannot accidently be parsed that way. Additionally, clean up calls made with a single parameter that would be handled as a format string. Many callers are passing potentially dynamic string content, so use "%s" in those cases to avoid any potential accidents. Signed-off-by: Kees Cook <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2013-06-27rt2x00: rt2800lib: fix default TX power check for RT55xxGabor Juhos1-1/+1
The code writes the default_power2 value into the TX field of the RFCSR50 register, however the condition in the if statement uses default_power1. Due to this, wrong TX power value might be written into the register. Use the correct value in the condition to fix the issue. Compile tested only. Signed-off-by: Gabor Juhos <[email protected]> Cc: [email protected] # 3.10 Acked-by: Gertjan van Wingerde <[email protected]> Signed-off-by: John W. Linville <[email protected]>
2013-06-27rt2x00: rt2800lib: turn on tertiary PAs/LNAs for 3T/3R devicesGabor Juhos1-12/+35
The 3T/3R devices are using the tertiary PAs/LNAs however those are never turned on. Fix the code to turn on those on for such devices. Also modify the code to use switch statements to improve readability. Signed-off-by: Gabor Juhos <[email protected]> Acked-by: Gertjan van Wingerde <[email protected]> Signed-off-by: John W. Linville <[email protected]>
2013-06-27rt2x00: rt2800lib: turn on secondary PAs/LNAs for 3T/3R devicesGabor Juhos1-4/+4
The secondary PAs/LNAs are turned on only for 2T/2R devices, however these are used for 3T/3R devices as well. Always turn those on if the device uses more than one tx/rx chains. Signed-off-by: Gabor Juhos <[email protected]> Acked-by: Stanislaw Gruszka <[email protected]> Acked-by: Gertjan van Wingerde <[email protected]> Signed-off-by: John W. Linville <[email protected]>
2013-06-27rt2x00: rt2800: increase EEPROM_SIZE to 512 bytesGabor Juhos1-1/+1
Ralink 3T chipsets are using a different EEPROM layout than the others. The EEPROM on these devices contain more data than the others which does not fit into 272 byte which the rt2800 driver actually uses. The Ralink reference driver defines EEPROM_SIZE to 512/1024 bytes for PCI/USB devices respectively. Increase the EEPROM_SIZE constant to 512 bytes, in order to make room for EEPROM data of 3T devices. Signed-off-by: Gabor Juhos <[email protected]> Acked-by: Helmut Schaa <[email protected]> Acked-by: Stanislaw Gruszka <[email protected]> Acked-by: Gertjan van Wingerde <[email protected]> Signed-off-by: John W. Linville <[email protected]>
2013-06-24rt2x00: rt2800: unify [RT]XWI_SIZE definesGabor Juhos3-11/+13
Use common names instead of chip specific ones. The patch contains no functional changes, but it makes it easier to add support for further descriptor sizes. Signed-off-by: Gabor Juhos <[email protected]> Acked-by: Stanislaw Gruszka <[email protected]> Acked-by: Gertjan van Wingerde <[email protected]> Signed-off-by: John W. Linville <[email protected]>
2013-06-24rt2x00: rt2800pci: don't use TXWI_DESC_SIZE directlyGabor Juhos1-2/+3
Different chipsets may use different TXWI descriptor size. Instead of using a hardcoded value, use the 'queue->winfo_size' which holds the correct value for a given device. Signed-off-by: Gabor Juhos <[email protected]> Acked-by: Stanislaw Gruszka <[email protected]> Acked-by: Gertjan van Wingerde <[email protected]> Signed-off-by: John W. Linville <[email protected]>
2013-06-24rt2x00: read 5GHz TX power values from the correct offsetGabor Juhos3-4/+6
The current code uses the same index value both for the channel information array and for the TX power table. The index starts from 14, however the index of the TX power table must start from zero. Fix it, in order to get the correct TX power value for a given channel. The changes in rt61pci.c and rt73usb.c are compile tested only. Signed-off-by: Gabor Juhos <[email protected]> Cc: [email protected] Acked-by: Stanislaw Gruszka <[email protected]> Acked-by: Gertjan van Wingerde <[email protected]> Signed-off-by: John W. Linville <[email protected]>
2013-06-18Merge branch 'master' of ↵John W. Linville1-11/+18
git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless
2013-06-12rt2x00: rt2800usb: nuke rt2800usb_ops_5592Gabor Juhos1-24/+5
It is exactly the same like the generic rt2800usb_ops. Remove the duplicate and use the generic ops for all devices. Signed-off-by: Gabor Juhos <[email protected]> Acked-by: Gertjan van Wingerde <[email protected]> Signed-off-by: John W. Linville <[email protected]>
2013-06-12rt2x00: move extra_tx_headroom field from rt2x00_ops to rt2x00_devGabor Juhos10-14/+22
The extra_tx_headroom field of struct rt2x00_ops indicates the extra TX headroom size required for a given device. This data is redundant, the value can be computed from the desc_size and winfo_size fields of the TX queues. Move the extra_tx_headroom field to struct rt2x00_dev, compute its value in the probe routine and use the cached value in the rest of the code. Signed-off-by: Gabor Juhos <[email protected]> Acked-by: Stanislaw Gruszka <[email protected]> Acked-by: Gertjan van Wingerde <[email protected]> Signed-off-by: John W. Linville <[email protected]>
2013-06-12rt2x00: remove data_queue_desc structGabor Juhos3-64/+1
If the queue_init callback is implemented by a driver it gets used instead of the data_queue_desc based initialization. The queue_init callback is implemented for each drivers now, so the old initialization method is not used anymore. Remove the unused data_queue_desc structure and all of the related code. Signed-off-by: Gabor Juhos <[email protected]> Acked-by: Stanislaw Gruszka <[email protected]> Acked-by: Gertjan van Wingerde <[email protected]> Signed-off-by: John W. Linville <[email protected]>
2013-06-12rt2x00: rt2500usb: implement queue_init callbackGabor Juhos1-28/+37
The generic rt2x00 code has been changed to allow the drivers toimplement dynamic data_queue initialization. Remove the static data queue descriptor structures and implement the queue_init callback instead. Compile tested only. Signed-off-by: Gabor Juhos <[email protected]> Acked-by: Stanislaw Gruszka <[email protected]> Acked-by: Gertjan van Wingerde <[email protected]> Signed-off-by: John W. Linville <[email protected]>
2013-06-12rt2x00: rt61pci: implement queue_init callbackGabor Juhos1-21/+33
The generic rt2x00 code has been changed to allow the drivers toimplement dynamic data_queue initialization. Remove the static data queue descriptor structures and implement the queue_init callback instead. Signed-off-by: Gabor Juhos <[email protected]> Tested-by: Jakub Kicinski <[email protected]> Acked-by: Stanislaw Gruszka <[email protected]> Acked-by: Gertjan van Wingerde <[email protected]> Signed-off-by: John W. Linville <[email protected]>
2013-06-12rt2x00: rt2500pci: implement queue_init callbackGabor Juhos1-28/+37
The generic rt2x00 code has been changed to allow the drivers toimplement dynamic data_queue initialization. Remove the static data queue descriptor structures and implement the queue_init callback instead. Compile tested only. Signed-off-by: Gabor Juhos <[email protected]> Acked-by: Stanislaw Gruszka <[email protected]> Acked-by: Gertjan van Wingerde <[email protected]> Signed-off-by: John W. Linville <[email protected]>
2013-06-12rt2x00: rt2400pci: implement queue_init callbackGabor Juhos1-28/+37
The generic rt2x00 code has been changed to allow the drivers toimplement dynamic data_queue initialization. Remove the static data queue descriptor structures and implement the queue_init callback instead. Compile tested only. Signed-off-by: Gabor Juhos <[email protected]> Acked-by: Stanislaw Gruszka <[email protected]> Acked-by: Gertjan van Wingerde <[email protected]> Signed-off-by: John W. Linville <[email protected]>
2013-06-12rt2x00: rt73usb: implement queue_init callbackGabor Juhos1-21/+33
The generic rt2x00 code has been changed to allow the drivers toimplement dynamic data_queue initialization. Remove the static data queue descriptor structures and implement the queue_init callback instead. Signed-off-by: Gabor Juhos <[email protected]> Acked-by: Stanislaw Gruszka <[email protected]> Acked-by: Gertjan van Wingerde <[email protected]> Signed-off-by: John W. Linville <[email protected]>
2013-06-12rt2x00: rt2800pci: implement queue_init callbackGabor Juhos1-24/+36
The generic rt2x00 code has been changed to allow the drivers toimplement dynamic data_queue initialization. Remove the static data queue descriptor structures and implement the queue_init callback instead. Signed-off-by: Gabor Juhos <[email protected]> Acked-by: Stanislaw Gruszka <[email protected]> Acked-by: Gertjan van Wingerde <[email protected]> Signed-off-by: John W. Linville <[email protected]>
2013-06-12rt2x00: rt2800usb: implement queue_init callbackGabor Juhos1-52/+48
The generic rt2x00 code has been changed to allow the drivers toimplement dynamic data_queue initialization. Remove the static data queue descriptor structures and implement the queue_init callback instead. The actual chipset is already known when the callback is used. This allows us to use a single callback for all supported devices. Signed-off-by: Gabor Juhos <[email protected]> Acked-by: Stanislaw Gruszka <[email protected]> Acked-by: Gertjan van Wingerde <[email protected]> Signed-off-by: John W. Linville <[email protected]>
2013-06-12rt2x00: add queue_init callback to rt2x00_opsGabor Juhos2-9/+14
The driver uses static data structures for initializing specific fields of a given data queue. These static queue data descriptor structures are containing values which related to a given chipset. Even though the values are chip specific, the actual selection of the used structure is based on device specific vendor/product identifiers. This approach works, but it is not always reliable. Sometimes the vendor and/or device IDs of the PCI and USB devices contains improper values which makes it impossible to select the correct structure for such devices. The patch adds a new callback to tr2x00_ops which is called after the chipset detection is finished. This allows the drivers to do dynamic initialization of the data_queue structure for a given queue based on the actual chipset. After each driver implements the queue_init callback, the data_queue_desc structure will be removed. Signed-off-by: Gabor Juhos <[email protected]> Acked-by: Stanislaw Gruszka <[email protected]> Acked-by: Gertjan van Wingerde <[email protected]> Signed-off-by: John W. Linville <[email protected]>
2013-06-12rt2x00: rt2x00queue: setup queue->threshold from queue->limitGabor Juhos1-1/+2
Use the queue->limit value instead of the qdesc->entry_num to compute the threshold. The two source values are the same and the data queue descriptor structure will be removed by a later patch. Also separate the computation from the rest of the init code to make further changes easier. Signed-off-by: Gabor Juhos <[email protected]> Acked-by: Stanislaw Gruszka <[email protected]> Acked-by: Gertjan van Wingerde <[email protected]> Signed-off-by: John W. Linville <[email protected]>
2013-06-12rt2x00: rt2x00dev: use rt2x00dev->bcn->limitGabor Juhos1-1/+1
The beacon data queue is initialized already, so fetch the number of the queue entries from that instead of using the entry_num field of the data queue descriptor. The two values are the same, and the use of the rt2x00dev->bcn->limit value allows us to get rid of a superfluous pointer dereference. Signed-off-by: Gabor Juhos <[email protected]> Acked-by: Stanislaw Gruszka <[email protected]> Acked-by: Gertjan van Wingerde <[email protected]> Signed-off-by: John W. Linville <[email protected]>
2013-06-12rt2x00: rt2x00queue: remove qdesc parameter of rt2x00queue_alloc_entriesGabor Juhos1-7/+5
The qdesc parameter is not used anymore, so remove that. Signed-off-by: Gabor Juhos <[email protected]> Acked-by: Stanislaw Gruszka <[email protected]> Acked-by: Gertjan van Wingerde <[email protected]> Signed-off-by: John W. Linville <[email protected]>
2013-06-12rt2x00: rt2x00queue: add priv_size field to struct data_queueGabor Juhos2-2/+5
Add a new field into struct data_queue and store the size of the per-queue_entry private data in that. Additionally, use the new field in the rt2x00queue_alloc_entries function to compute the size of the queue entries for a given queue. The patch does not change the current behaviour but makes it possible to remove the queue_desc parameter of the rt2x00queue_alloc_entries function. That will be done by a subsequent patch. Signed-off-by: Gabor Juhos <[email protected]> Acked-by: Stanislaw Gruszka <[email protected]> Acked-by: Gertjan van Wingerde <[email protected]> Signed-off-by: John W. Linville <[email protected]>
2013-06-12rt2800: fix RT5390 & RT3290 TX power settings regressionStanislaw Gruszka1-11/+18
My change: commit cee2c7315f60beeff6137ee59e99acc77d636eeb Author: Stanislaw Gruszka <[email protected]> Date: Fri Oct 5 13:44:09 2012 +0200 rt2800: use BBP_R1 for setting tx power unfortunately does not work well with RT5390 and RT3290 chips as they require different temperature compensation TX power settings (TSSI tuning). Since that commit make wireless connection very unstable on those chips, restore previous behavior to fix regression. Once we implement proper TSSI tuning on 5390/3290 we can restore back setting TX power by BBP_R1 register for those chips. Reported-and-tested-by: Mike Romberg <[email protected]> Cc: [email protected] Signed-off-by: Stanislaw Gruszka <[email protected]> Acked-by: Gertjan van Wingerde <[email protected]> Signed-off-by: John W. Linville <[email protected]>
2013-06-10rt2x00: rt2x00queue: initialize data_queue fields earlierGabor Juhos1-6/+38
Support for rt2800 device is broken since my 'rt2x00: rt2x00dev: use rt2x00dev->tx->limit' patch. The changelog of that commit says that the TX data queue is initialized already when the rt2x00lib_probe_hw() function is called. However as Jakub noticed it, this statement is not correct. The queue->limit field is initialized in the rt2x00queue_alloc_entries routine and that is not yet called when rt2x00lib_probe_hw() runs. Because the value of tx->limit contains zero, the driver tries to allocate a kernel fifo with zero size and kfifo_alloc rejects that with -EINVAL. PCI: Enabling device 0000:01:00.0 (0000 -> 0002) ieee80211 phy1: rt2x00_set_rt: Info - RT chipset 3071, rev 021c detected ieee80211 phy1: rt2x00_set_rf: Info - RF chipset 0008 detected ieee80211 phy1: rt2x00lib_probe_dev: Error - Failed to initialize hw rt2800pci: probe of 0000:01:00.0 failed with error -22 Move the data_queue field initialization from the rt2x00queue_alloc_entries routine into the rt2x00queue_init function. The initialization code is not strictly related to the allocation, and the change ensures that the queue_data fields can be used in the probe routines. The patch also introduces a helper function in order to be able to get the correct data_queue_desc structure for a given queue. This helper is only needed temporarily and it will be removed later. Reported-by: Jakub Kicinski <[email protected]> Signed-off-by: Gabor Juhos <[email protected]> Signed-off-by: John W. Linville <[email protected]>
2013-05-24rt2800: move 53xx specific bbp initializationStanislaw Gruszka1-42/+41
Signed-off-by: Stanislaw Gruszka <[email protected]> Acked-by: Helmut Schaa <[email protected]> Acked-by: Gertjan van Wingerde <[email protected]> Signed-off-by: John W. Linville <[email protected]>
2013-05-24rt2800: move 3290 specific bbp initializationStanislaw Gruszka1-23/+23
Signed-off-by: Stanislaw Gruszka <[email protected]> Acked-by: Helmut Schaa <[email protected]> Acked-by: Gertjan van Wingerde <[email protected]> Signed-off-by: John W. Linville <[email protected]>
2013-05-24rt2800: move 3352 specific bbp initializationStanislaw Gruszka1-22/+20
Signed-off-by: Stanislaw Gruszka <[email protected]> Acked-by: Helmut Schaa <[email protected]> Acked-by: Gertjan van Wingerde <[email protected]> Signed-off-by: John W. Linville <[email protected]>
2013-05-24rt2800: initialize BBP_R108 on proper subroutinesStanislaw Gruszka1-17/+24
Create helper function and move initialization to subroutines. Signed-off-by: Stanislaw Gruszka <[email protected]> Acked-by: Helmut Schaa <[email protected]> Acked-by: Gertjan van Wingerde <[email protected]> Signed-off-by: John W. Linville <[email protected]>
2013-05-24rt2800: initialize BBP_R104 on 3352 subroutineStanislaw Gruszka1-3/+2
Signed-off-by: Stanislaw Gruszka <[email protected]> Acked-by: Helmut Schaa <[email protected]> Acked-by: Gertjan van Wingerde <[email protected]> Signed-off-by: John W. Linville <[email protected]>
2013-05-24rt2800: initialize BBP_R134 & BBP_R135 on 53xx subroutineStanislaw Gruszka1-5/+5
Signed-off-by: Stanislaw Gruszka <[email protected]> Acked-by: Helmut Schaa <[email protected]> Acked-by: Gertjan van Wingerde <[email protected]> Signed-off-by: John W. Linville <[email protected]>
2013-05-24rt2800: initialize BBP_R128 on proper subroutinesStanislaw Gruszka1-5/+4
Signed-off-by: Stanislaw Gruszka <[email protected]> Acked-by: Helmut Schaa <[email protected]> Acked-by: Gertjan van Wingerde <[email protected]> Signed-off-by: John W. Linville <[email protected]>
2013-05-24rt2800: initialize BBP_R120 on 3352 subroutineStanislaw Gruszka1-3/+2
Signed-off-by: Stanislaw Gruszka <[email protected]> Acked-by: Helmut Schaa <[email protected]> Acked-by: Gertjan van Wingerde <[email protected]> Signed-off-by: John W. Linville <[email protected]>
2013-05-24rt2800: initialize BBP_R106 on all subroutines (except 5592)Stanislaw Gruszka1-10/+21
Signed-off-by: Stanislaw Gruszka <[email protected]> Acked-by: Helmut Schaa <[email protected]> Acked-by: Gertjan van Wingerde <[email protected]> Signed-off-by: John W. Linville <[email protected]>
2013-05-24rt2800: initialize BBP_R105 on all subroutines (except 5592)Stanislaw Gruszka1-12/+16
Signed-off-by: Stanislaw Gruszka <[email protected]> Acked-by: Helmut Schaa <[email protected]> Acked-by: Gertjan van Wingerde <[email protected]> Signed-off-by: John W. Linville <[email protected]>
2013-05-24rt2800: initialize BBP_R104 on proper subroutinesStanislaw Gruszka1-6/+6
Signed-off-by: Stanislaw Gruszka <[email protected]> Acked-by: Helmut Schaa <[email protected]> Acked-by: Gertjan van Wingerde <[email protected]> Signed-off-by: John W. Linville <[email protected]>
2013-05-24rt2800: initialize BBP_R103 on all subroutines (except 5592)Stanislaw Gruszka1-14/+24
Signed-off-by: Stanislaw Gruszka <[email protected]> Acked-by: Helmut Schaa <[email protected]> Acked-by: Gertjan van Wingerde <[email protected]> Signed-off-by: John W. Linville <[email protected]>
2013-05-24rt2800: move initialization of BBP_95 & BBP_98 to 53xx subroutineStanislaw Gruszka1-5/+5
Signed-off-by: Stanislaw Gruszka <[email protected]> Acked-by: Helmut Schaa <[email protected]> Acked-by: Gertjan van Wingerde <[email protected]> Signed-off-by: John W. Linville <[email protected]>
2013-05-24rt2800: initialize BBP_R92 on all subroutines (except 5592)Stanislaw Gruszka1-8/+16
Signed-off-by: Stanislaw Gruszka <[email protected]> Acked-by: Helmut Schaa <[email protected]> Acked-by: Gertjan van Wingerde <[email protected]> Signed-off-by: John W. Linville <[email protected]>
2013-05-24rt2800: initialize BBP_R91 on all subroutines (except 5592)Stanislaw Gruszka1-2/+16
Signed-off-by: Stanislaw Gruszka <[email protected]> Acked-by: Helmut Schaa <[email protected]> Acked-by: Gertjan van Wingerde <[email protected]> Signed-off-by: John W. Linville <[email protected]>
2013-05-24rt2800: initialize BBP_R88 on proper subroutinesStanislaw Gruszka1-4/+5
Signed-off-by: Stanislaw Gruszka <[email protected]> Acked-by: Helmut Schaa <[email protected]> Acked-by: Gertjan van Wingerde <[email protected]> Signed-off-by: John W. Linville <[email protected]>
2013-05-24rt2800: initialize BBP_R86 on all subroutines (except 5592)Stanislaw Gruszka1-8/+16
Signed-off-by: Stanislaw Gruszka <[email protected]> Acked-by: Helmut Schaa <[email protected]> Acked-by: Gertjan van Wingerde <[email protected]> Signed-off-by: John W. Linville <[email protected]>
2013-05-24rt2800: initialize BBP_R84 on all subroutines (except 5592)Stanislaw Gruszka1-9/+19
Signed-off-by: Stanislaw Gruszka <[email protected]> Acked-by: Helmut Schaa <[email protected]> Acked-by: Gertjan van Wingerde <[email protected]> Signed-off-by: John W. Linville <[email protected]>
2013-05-24rt2800: initialize BBP_R83 on all subroutines (except 5592)Stanislaw Gruszka1-7/+16
Signed-off-by: Stanislaw Gruszka <[email protected]> Acked-by: Helmut Schaa <[email protected]> Acked-by: Gertjan van Wingerde <[email protected]> Signed-off-by: John W. Linville <[email protected]>
2013-05-24rt2800: initialize BBP_R82 on all subroutines (except 5592)Stanislaw Gruszka1-1/+16
Signed-off-by: Stanislaw Gruszka <[email protected]> Acked-by: Helmut Schaa <[email protected]> Acked-by: Gertjan van Wingerde <[email protected]> Signed-off-by: John W. Linville <[email protected]>
2013-05-24rt2800: initialize BBP_R74 - BBP_R80 on all subroutines (except 5592)Stanislaw Gruszka1-26/+30
Signed-off-by: Stanislaw Gruszka <[email protected]> Acked-by: Helmut Schaa <[email protected]> Acked-by: Gertjan van Wingerde <[email protected]> Signed-off-by: John W. Linville <[email protected]>
2013-05-24rt2800: initialize BBP_R70 on all subroutines (except 5592)Stanislaw Gruszka1-2/+16
Signed-off-by: Stanislaw Gruszka <[email protected]> Acked-by: Helmut Schaa <[email protected]> Acked-by: Gertjan van Wingerde <[email protected]> Signed-off-by: John W. Linville <[email protected]>
2013-05-24rt2800: initialize BBP_R69 - BBP_R77 on proper subroutinesStanislaw Gruszka1-21/+41
Signed-off-by: Stanislaw Gruszka <[email protected]> Acked-by: Helmut Schaa <[email protected]> Acked-by: Gertjan van Wingerde <[email protected]> Signed-off-by: John W. Linville <[email protected]>
2013-05-24rt2800: initialize BBP_R68 on proper subroutinesStanislaw Gruszka1-6/+6
Signed-off-by: Stanislaw Gruszka <[email protected]> Acked-by: Helmut Schaa <[email protected]> Acked-by: Gertjan van Wingerde <[email protected]> Signed-off-by: John W. Linville <[email protected]>