Commit Graph

243950 Commits

Author SHA1 Message Date
Rafał Miłecki
3c35c84a70 ssb: cc: use correct min_msk for 0x4312
Default min_msk on my 0x4312 is 0x80000CBB, not 0xCBB. Now we follow
specs and wl (noticed in MMIO dumps).

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-04-25 14:50:13 -04:00
Rafał Miłecki
9be1cb39c6 ssb: pci: trivial: correct amount of maximum retries
Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-04-25 14:50:13 -04:00
Vasanthakumar Thiagarajan
bca04689a2 ath9k_hw: Enable AR9340 support
AR9340 is a AR9003 family built-in 2x2 wmac of ar934x SOCs. It is single band
in ar9341 SOC and dual band in ar9344/ar9342 SOCs.

Signed-off-by: Vasanthakumar Thiagarajan <vasanth@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-04-25 14:50:13 -04:00
Vasanthakumar Thiagarajan
79d1d2b8a3 ath9k_hw: Disable INTR_HOST1_FATAL to avoid interrupt strom with ar9430
Signed-off-by: Vasanthakumar Thiagarajan <vasanth@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-04-25 14:50:13 -04:00
Vasanthakumar Thiagarajan
ecb1d385ad ath9k_hw: Assign macversion based on devid for built-in wmac
Signed-off-by: Vasanthakumar Thiagarajan <vasanth@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-04-25 14:50:12 -04:00
Vasanthakumar Thiagarajan
247eee0e4e ath9k: Add AR9340 platform id to id table
Signed-off-by: Vasanthakumar Thiagarajan <vasanth@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-04-25 14:50:12 -04:00
Vasanthakumar Thiagarajan
5d48ae78cf ath9k_hw: Read iq calibration data only for active chains
Signed-off-by: Vasanthakumar Thiagarajan <vasanth@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-04-25 14:50:12 -04:00
Vasanthakumar Thiagarajan
2976bc5ebf ath9k_hw: Configure chain switch table and attenuation control only for active chains
Signed-off-by: Vasanthakumar Thiagarajan <vasanth@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-04-25 14:50:12 -04:00
Vasanthakumar Thiagarajan
2be7bfe0b4 ath9k_hw: Enable byte Tx/Rx data swap for AR9340
Signed-off-by: Vasanthakumar Thiagarajan <vasanth@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-04-25 14:50:11 -04:00
Vasanthakumar Thiagarajan
a969c09184 ath9k_hw: Configure tuning capacitance value for AR9340 as well
Signed-off-by: Vasanthakumar Thiagarajan <vasanth@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-04-25 14:50:11 -04:00
Vasanthakumar Thiagarajan
3594beae70 ath9k_hw: Skip internal regulator configuration for AR9340
Signed-off-by: Vasanthakumar Thiagarajan <vasanth@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-04-25 14:50:11 -04:00
Vasanthakumar Thiagarajan
160b7fb4a0 ath9k_hw: Don't configure AR_CH0_THERM for AR9340
Signed-off-by: Vasanthakumar Thiagarajan <vasanth@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-04-25 14:50:11 -04:00
Vasanthakumar Thiagarajan
66953d4385 ath9k_hw: Fix register offset AR_PHY_65NM_CH0_THERM for AR9340
Signed-off-by: Vasanthakumar Thiagarajan <vasanth@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-04-25 14:50:10 -04:00
Vasanthakumar Thiagarajan
e758ff8f7f ath9k_hw: Clean up rx/tx chain configuration before AGC/IQ cal
Use hw supported chains instead of hard coded values.

Signed-off-by: Vasanthakumar Thiagarajan <vasanth@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-04-25 14:50:10 -04:00
Vasanthakumar Thiagarajan
17869f4fe9 ath9k_hw: Configure RF channel freqency for AR9340
Signed-off-by: Vasanthakumar Thiagarajan <vasanth@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-04-25 14:50:10 -04:00
Vasanthakumar Thiagarajan
d1395d85fa ath9k_hw: Read spur frequency information from eeprom for AR9340
Signed-off-by: Vasanthakumar Thiagarajan <vasanth@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-04-25 14:50:09 -04:00
Vasanthakumar Thiagarajan
d7fd52a80f ath9k_hw: Initialize tx and rx gain table from initvals.h for ar9340
Signed-off-by: Vasanthakumar Thiagarajan <vasanth@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-04-25 14:50:09 -04:00
Vasanthakumar Thiagarajan
070c4d509b ath9k_hw: Don't do ani initialization for AR9340
Signed-off-by: Vasanthakumar Thiagarajan <vasanth@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-04-25 14:50:09 -04:00
Vasanthakumar Thiagarajan
d89baac8b4 ath9k_hw: Initialize mode registers from initvals.h for AR9340
Signed-off-by: Vasanthakumar Thiagarajan <vasanth@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-04-25 14:50:09 -04:00
Vasanthakumar Thiagarajan
9aa5a8d5fd ath9k_hw: Add initvals.h for ar9340
Signed-off-by: Vasanthakumar Thiagarajan <vasanth@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-04-25 14:50:09 -04:00
Vasanthakumar Thiagarajan
0b488ac6ec ath9k_hw: Configure pll control register accordingly for AR9340
Signed-off-by: Vasanthakumar Thiagarajan <vasanth@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-04-25 14:50:08 -04:00
Vasanthakumar Thiagarajan
f2f5f2a1ce ath9k_hw: Get AHB clock information from ath9k_platform_data
Add a bool in ath9k_platform_data to pass AHB clock speed information.
Driver needs this to configure PLL on some SOCs.

Signed-off-by: Vasanthakumar Thiagarajan <vasanth@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-04-25 14:50:08 -04:00
Vasanthakumar Thiagarajan
35d5f56125 ath9k_hw: Take care of few host interface register changes for AR9340
Signed-off-by: Vasanthakumar Thiagarajan <vasanth@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-04-25 14:50:08 -04:00
Vasanthakumar Thiagarajan
b99a7be47d ath9k_hw: Define devid and mac version for AR9340
Signed-off-by: Vasanthakumar Thiagarajan <vasanth@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-04-25 14:50:07 -04:00
John W. Linville
534f0e2928 Merge branch 'wireless-next-2.6' of git://git.kernel.org/pub/scm/linux/kernel/git/iwlwifi/iwlwifi-2.6 2011-04-25 14:42:51 -04:00
John W. Linville
e55034e978 Merge branch 'for-linville' of git://git.kernel.org/pub/scm/linux/kernel/git/luca/wl12xx 2011-04-25 14:36:35 -04:00
Johannes Berg
4cd2bf76a4 iwlagn: remove hw_ready variable
This variable is only ever checked right after
the function that sets it, but the same function
will also return the status, so we can pass it
through instead of checking hw_ready later.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2011-04-22 10:21:23 -07:00
Johannes Berg
dbf28e21ca iwlagn: combine firmware code/data
On new hardware, ucode images always come in
pairs: code and data. Therefore, combine the
variables into an appropriate struct and use
that when both code and data are needed.

Also, combine allocation and copying so that
we have less code in total.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2011-04-22 10:21:18 -07:00
Johannes Berg
ca7966c88e iwlagn: implement synchronous firmware load
The current firmware loading mechanism in
iwlwifi is very hard to follow, and thus
hard to maintain. To make it easier, make
the firmware loading synchronous.

For now, as a side effect, this removes a
number of retry possibilities we had. It
isn't typical for this to fail, but if it
does happen we restart from scratch which
this also makes easier to do should it be
necessary.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2011-04-22 10:18:48 -07:00
Johannes Berg
e74fe2330a iwlagn: leave notification waits on firmware errors
When the firmware encounters an error while the
driver is waiting for a notification, it will
never get that notification. Therefore, instead
of timing out, bail out on errors when waiting
for notifications.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2011-04-22 10:03:03 -07:00
Johannes Berg
a8674a1efc iwlagn: make iwlagn_wait_notification return error code
We're unlikely to care about the actual time spent
waiting, so make the function return an error code
which is less error prone in coding new uses.

Also, while at it, mark __must_check.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2011-04-22 10:02:55 -07:00
Johannes Berg
09f18afe76 iwlagn: extend notification wait function
A notification wait function is called with the
command, but currently has no way of passing
data back to the caller -- fix that by adding a
void pointer to the function that can be used
between the caller and the function.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2011-04-22 10:02:47 -07:00
Johannes Berg
3e14c1fd75 iwlagn: refactor up path
Starting the device consists of many things,
refactor out enabling the hardware and also
return -ERFKILL when the rfkill signal is
found to be asserted (which makes more sense
anyway, but is also required now to make the
__iwl_up function return right away.)

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2011-04-22 10:02:39 -07:00
Johannes Berg
bc4f8adac6 iwlagn: refactor down path
The iwl_down path really consists of multiple things,
refactor out the hardware resetting (including, of
course, related software state like irqs).

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2011-04-22 10:02:34 -07:00
Johannes Berg
1a10f43313 iwlagn: clean up some exit code
There's no point in running through iwl_down()
when we never registered with mac80211, as it
just cleans up internal structures that were
never initialised in this case. Therefore we
can also remove the special handling for this
case from __iwl_down().

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2011-04-22 10:02:26 -07:00
Johannes Berg
e46f6538c2 iwlagn: simplify error table reading
The current code to read the error table header
just hardcodes all the offsets, which is a bit
hard to understand. We can read in the entire
header (as much as we need) into a structure,
and then take the data from there, which makes
it easier to understand. To read a bigger blob
we also don't need to grab NIC access for each
word read, making the code more efficient.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2011-04-22 10:02:19 -07:00
Johannes Berg
73b48099cc mac80211: explain padding in place of rate field
Apparently this was confusing still ... add a
note that the byte is needed as padding.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-04-19 15:40:09 -04:00
Ivo van Doorn
0ed7b3c044 rt2x00: Implement get_antenna and set_antenna callback functions
Implement the get_antenna and set_antenna callback functions, which will
allow clients to control the antenna for all non-11n hardware (Antenna handling
in rt2800 is still a bit magical, so we can't use the set_antenna for those drivers
yet).

To best support the set_antenna callback some modifications are needed in the
diversity handling. We should never look at the default antenna settings to determine
if software diversity is enabled. Instead we should set the diversity flag when
possible, which will allow the link_tuner to automatically pick up the tuning.

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>
2011-04-19 15:40:07 -04:00
Ivo van Doorn
e7dee44426 rt2x00: Implement get_ringparam callback function
With the get_ringparam callback function we can export ring parameters
to ethtool through the mac80211 interface.

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>
2011-04-19 15:40:04 -04:00
Ivo van Doorn
8d0a2dcfb6 rt2x00: Optimize register access in rt2800usb
All register reads/writes in rt2800usb were previously done with
rt2800_register_read/rt2800_register_write. These however indirectly
call rt2x00usb_register_read/rt2x00usb_register_write which adds an
additional overhead of at least one call and several move instructions
to each register access.

Replacing the calls to rt2800_register_read/rt2800_register_write with
direct calls to rt2x00usb_register_read/rt2x00usb_register_write gets
rid of quite a number of instructions in the drivers hotpaths (IRQ
handling and txdone handling).

For consistency replace all references to rt2800_register_read/write
with the rt2x00usb_register_read/write variants.

Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-04-19 15:40:02 -04:00
Helmut Schaa
9a8199961b rt2x00: Optimize register access in rt2800pci
All register reads/writes in rt2800pci were previously done with
rt2800_register_read/rt2800_register_write. These however indirectly
call rt2x00pci_register_read/rt2x00pci_register_write which adds an
additional overhead of at least one call and several move instructions
to each register access.

Replacing the calls to rt2800_register_read/rt2800_register_write with
direct calls to rt2x00pci_register_read/rt2x00pci_register_write gets
rid of quite a number of instructions in the drivers hotpaths (IRQ
handling and txdone handling).

For consistency replace all references to rt2800_register_read/write
with the rt2x00pci_register_read/write variants.

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>
2011-04-19 15:39:59 -04:00
Gertjan van Wingerde
46a01ec00d rt2x00: Merge rt2x00ht.c contents in other files.
The two functions that are in rt2x00ht.c can be much better placed
closer to the places where the call-sites of these functions are (one
in rt2x00config.c and one in rt2x00queue.c) allowing us to make these
functions static.
Also, conditional compilations doesn't seem to be necessary anymore as
802.11n support is quite common nowadays.

This makes the code a bit easier readable and searchable.

Signed-off-by: Gertjan van Wingerde <gwingerde@gmail.com>
Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-04-19 15:39:56 -04:00
Gertjan van Wingerde
ea81966ccc rt2x00: Enable support for RT53xx PCI devices by default.
Code seems to be feature-complete, so no reason to not enable
these devices by default.

Also, remove the sentence about the support for these devices being
non-functional.

Signed-off-by: Gertjan van Wingerde <gwingerde@gmail.com>
Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-04-19 15:39:54 -04:00
Gertjan van Wingerde
ccd3caa451 rt2x00: RT33xx device support is no longer experimental.
The rt33xx devices support for both PCI and USB devices has been in
the tree for a couple of months now, and seems to be functional and
not in a worse shape than the support for rt28xx and rt30xx devices.

No longer mark it as experimental and enable the support for these
devices by default.

Signed-off-by: Gertjan van Wingerde <gwingerde@gmail.com>
Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-04-19 15:39:51 -04:00
Gertjan van Wingerde
87a3b89f34 rt2x00: Add USB IDs.
Add USB IDs that are listed in the latest Ralink Windows and/or Linux drivers.

Signed-off-by: Gertjan van Wingerde <gwingerde@gmail.com>
Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-04-19 15:39:48 -04:00
Gertjan van Wingerde
e01ae27f8c rt2x00: Allow dynamic addition of PCI/USB IDs.
Both USB and PCI drivers allow a system administrator to dynamically add
USB/PCI IDs to the device table that a driver supports via the
/sys/bus/{usb,pci,pci_express}/drivers/<driver-name>/new_id files.

However, for the rt2x00 drivers using this method currently crashes the
system with a NULL pointer failure.

This is due to the set-up of rt2x00 where the probe functions require a
rt2x00_ops structure in the driver_info field of the probed device. As
this field is empty for the dynamically added devices this fails for
these devices.

Fix this by introducing driver-specific probe wrappers that do nothing
but calling the bus-specific probe functions with the rt2x00_ops structure
as an argument, rather than depending on the driver_info field.

Signed-off-by: Gertjan van Wingerde <gwingerde@gmail.com>
Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-04-19 15:39:45 -04:00
Gertjan van Wingerde
ce2919c9ff rt2x00: Linksys WUSB600N rev2 is a RT3572 device.
Move the USB ID entry from the unknown devices to the list of RT35xx based
devices.

Signed-off-by: Gertjan van Wingerde <gwingerde@gmail.com>
Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-04-19 15:39:43 -04:00
Helmut Schaa
7a5a681a7d rt2x00: Always inline rt2x00pci_enable_interrupt
This allows the compiler to perform the necessary bitfield calculations
during compile time instead of run time and thus reduces the number of
instructions to run during each tasklet invocation. This should improve
performance in the RX hotpath.

This comes at the cost of a slight increase in the module size (for
example rt2800pci):

Before:
   text    data     bss     dec     hex filename
  14133     832       4   14969    3a79 drivers/net/wireless/rt2x00/rt2800pci.ko

After:
   text    data     bss     dec     hex filename
  14149     832       4   14985    3a89 drivers/net/wireless/rt2x00/rt2800pci.ko

Signed-off-by: Helmut Schaa <helmut.schaa@googlemail.com>
Acked-by: Gertjan van Wingerde <gwingerde@gmail.com>
Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-04-19 15:39:40 -04:00
Ivo van Doorn
152a599274 rt2x00: Decrease association time for USB devices
When powersaving is enabled, assocaition times are very high
(for WPA2 networks, the time can easily be around the 3 seconds).

This is caused, because the flushing of the queues takes
too much time. Without the flushing callback mac80211 assumes
a timeout of 100ms while scanning. Limit all flush waiting
loops to the same maximum.

We can apply this maximum by passing the drop status to the
driver, which makes sure the driver performs extra actions
during the waiting for the queue to become empty.

After these changes, association times fall within the
healthy range of ~0.6 seconds with powersaving enabled.
The difference between association time between powersaving
enabled and disabled is now only ~0.1 second (which can also
be due to the measuring method).

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>
2011-04-19 15:39:37 -04:00
Johannes Stezenbach
f0187a1987 rt2800usb: add timer to handle TX_STA_FIFO
TX status is reported by the hardware when a packet has been
sent (or after TX failed after possible retries), which is some
time after the DMA completion.  Since the rt2800usb hardware can
not signal interrupts we have to use a timer, otherwise the
TX status would only be read by the next packet's TX DMA
completion, or by the watchdog thread.

Signed-off-by: Johannes Stezenbach <js@sig21.net>
Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-04-19 15:39:35 -04:00