Commit Graph

11998 Commits (2f47690ed42a85820783dee7f16ae47edadf8fad)

Author SHA1 Message Date
Jouni Malinen fa77533e2e mac80211_hwsim: Report driver as MFP capable
mac80211_hwsim has no problems with MFP, so report it as MFP capable.

Signed-off-by: Jouni Malinen <jouni.malinen@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-01-29 16:00:10 -05:00
Jouni Malinen 0ced0e176a ath9k: Setup MFP options for CCMP
Configure hardware CCMP for management frame protection and use
software crypto when needed.

Signed-off-by: Jouni Malinen <jouni.malinen@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-01-29 16:00:10 -05:00
Jouni Malinen ca470b2902 ath9k: Fix set_key error codes
Return -EOPNOTSUPP if the algorithm is not supported and -ENOSPC if
there is no room in the key cache. This avoids KERN_ERR printk in
mac80211 for "errors" that are actually expected to happen in normal
operating conditions.

Signed-off-by: Jouni Malinen <jouni.malinen@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-01-29 16:00:09 -05:00
Jouni Malinen 3cfcf6ac6d mac80211: 802.11w - Use BIP (AES-128-CMAC)
Add mechanism for managing BIP keys (IGTK) and integrate BIP into the
TX/RX paths.

Signed-off-by: Jouni Malinen <j@w1.fi>
Acked-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-01-29 16:00:03 -05:00
Johannes Berg 4be8c3873e mac80211: extend/document powersave API
This modifies hardware flags for powersave to support three different
flags:
 * IEEE80211_HW_SUPPORTS_PS - indicates general PS support
 * IEEE80211_HW_PS_NULLFUNC_STACK - indicates nullfunc sending in software
 * IEEE80211_HW_SUPPORTS_DYNAMIC_PS - indicates dynamic PS on the device

It also adds documentation for all this which explains how to set the
various flags.

Additionally, it fixes a few things:
 * a spot where && was used to test flags
 * enable CONF_PS only when associated again

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-01-29 15:59:58 -05:00
Christian Lamparter acbaf32e94 p54: return NETDEV_TX_OK in p54_tx and fix sparse warnings
This patch addresses all recent comments from Johannes Berg:

1st: (reference http://marc.info/?l=linux-wireless&m=123124685019631 )
>First off: all those should return NETDEV_TX_OK/BUSY.
>iwl-agn: returns 0 (== NETDEV_TX_OK, but still should be changed)
>[...]
>p54: same (some paths)

2nd:
> due to your PS patch ("p54: power save management"), please run sparse:
> make C=2 CF=-D__CHECK_ENDIAN__ M=...
> +drivers/net/wireless/p54/p54common.c:1753:8: warning: incorrect type in assignment (different base types)
> +drivers/net/wireless/p54/p54common.c:1769:29: warning: incorrect type in assignment (different base types)
The cpu_to_le16 ended up in the wrong line... Sorry!

Signed-off-by: Christian Lamparter <chunkeey@web.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-01-29 15:59:57 -05:00
Ivo van Doorn 64d7468143 rt2x00: Only register rfkill input when key is present
rt2x00 should only register the RFKILL input device when the hardware indicated
the key was present.

Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-01-29 15:59:57 -05:00
Johannes Berg 4797938c5d mac80211: clean up channel type config
The channel_type really doesn't need to be the only member in
a new structure, so remove the struct. Additionally, remove
the _CONF_CHANGE_HT flag and use _CONF_CHANGE_CHANNEL when the
channel type changes, since that's enough of a change to require
reprogramming the hardware anyway.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-01-29 15:59:55 -05:00
David Kilroy 47166791b7 orinoco: Remove unused variable rx_data
Probably something leftover from experimentation with tasklets. Now the
structure declaration orinoco_rx_data can be relocated to orinoco.c

Signed-off-by: David Kilroy <kilroyd@googlemail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-01-29 15:59:54 -05:00
Nick Kossifidis 8465676241 ath5k: Minor QCU updates
* Sync qcu.c with legacy-hal
* Add some more comments
* Set QCU mask to save power (QCU mask controls which QCUs are attached
  to each DCU, we do a 1:1 mapping)

TODO: Use max QCU from EEPROM, further sync with legacy-hal and sam's
hal and a few more minor fixes.

I think after this we are ready to implement WME on the driver
part. Anyone interested ?

Signed-Off-by: Nick Kossifidis <mickflemm@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-01-29 15:59:53 -05:00
Ivo van Doorn cca3e99861 rt2x00: Replace RFKILL with INPUT
As discussed on linux-wireless rt2x00 does not offer a true RFKILL key,
for that reason RFKILL support should be entirely removed.

The key which is attached to the hardware should be treated as normal
input device instead. Implement input_poll_dev support to poll the device
frequently. When the key status has changed report it as a SW event.

Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-01-29 15:59:47 -05:00
Vasanthakumar Thiagarajan c97c92d927 ath9k: Enable Bluetooth Coexistence support
Signed-off-by: Vasanthakumar Thiagarajan <vasanth@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-01-29 15:59:46 -05:00
Bob Copeland 7d96920488 ath5k: fix off-by-one in gpio checks
Sanity checks against AR5K_NUM_GPIO were all broken.  This doesn't
currently cause any problems since we only use the first four gpios.

Changes-licensed-under: ISC

Reported-by: Andreas Mohr <andi@lisas.de>
Signed-off-by: Bob Copeland <me@bobcopeland.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-01-29 15:59:45 -05:00
Bob Copeland 63649b6cf0 ath5k: support LEDs on Acer Aspire One netbook
Add vendor ID for Foxconn and use it to set the ath5k LED gpio and
polarity for Acer branded laptops.

base.c:
Changes-licensed-under: 3-Clause-BSD

Reported-by: Maxim Levitsky <maximlevitsky@gmail.com>
Tested-by: Maxim Levitsky <maximlevitsky@gmail.com>
Tested-by: Andreas Mohr <andi@lisas.de>
Signed-off-by: Bob Copeland <me@bobcopeland.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-01-29 15:59:45 -05:00
Christian Lamparter 2b8d4e2eea p54: power save management
This patch implements dynamic power save feature for p54.

Signed-off-by: Christian Lamparter <chunkeey@web.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-01-29 15:59:44 -05:00
Christian Lamparter 51eed9923d p54: implement FIF_OTHER_BSS filter setting
According to STMicroelectronics' LMAC documentation, the P54_FILTER_TYPE_TRANSPARENT flag
"configures the receive frame filter to pass all frames without regard to type and address matching."

Signed-off-by: Christian Lamparter <chunkeey@web.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-01-29 15:59:44 -05:00
Christian Lamparter 78eb7484fa p54: enable rx/tx antenna diversity by eeprom bits
Respect all documented bits in the eeprom about the device diversity features.

Signed-off-by: Christian Lamparter <chunkeey@web.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-01-29 15:59:43 -05:00
Gabor Juhos 295834fe36 ath9k: use signed format to print HAL status
Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-01-29 15:59:43 -05:00
Johannes Berg dc822b5db4 mac80211: clean up set_key callback
The set_key callback now seems rather odd, passing a MAC address
instead of a station struct, and a local address instead of a
vif struct. Change that.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Acked-by: Bob Copeland <me@bobcopeland.com> [ath5k]
Acked-by: Ivo van Doorn <ivdoorn@gmail.com> [rt2x00]
Acked-by: Christian Lamparter <chunkeey@web.de> [p54]
Tested-by: Kalle Valo <kalle.valo@nokia.com> [iwl3945]
Tested-by: Samuel Ortiz <samuel@sortiz.org> [iwl3945]
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-01-29 15:59:42 -05:00
Michael Buesch c557289cb8 b43: Change schedule for old-fw support removal
The scheduled date for the removal of old fw support was in July 2008.
However, we're not going to remove the support unless it causes a major
headache. So change the schedule from "July 2008" to "when it causes headaches".

Signed-off-by: Michael Buesch <mb@bu3sch.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-01-29 15:59:41 -05:00
Christian Lamparter 98a8d1a8f2 p54: regulatory domain hints
This patch adds a sub-routine that parses the default country eeprom entry
and forwards the obtained Alpha2 identifier to the regulatory sub-system.

Note: I dropped the p54 specific regdomain<->alpha2 conversion code for now.
But it will be added as soon as there's the common library function is ready.

Signed-off-by: Christian Lamparter <chunkeey@web.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-01-29 15:59:40 -05:00
Christian Lamparter e365f16046 p54: prevent upload of wrong firmwares
This patch will prevent anyone to upload a firmware which was not designed for his device.

There's still a catch:
There is no easy way to detect if a firmware is for PCI or for USB (1st Gen),
because they all share the same LM86 identifier.

Signed-off-by: Christian Lamparter <chunkeey@web.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-01-29 15:59:39 -05:00
Christian Lamparter 6982869d99 p54usb: utilize usb_reset_device for 3887
Sometimes on unload or reboot the 3887 USB devices become stuck.
<usual log entry>
kernel: usbcore: registered new interface driver p54usb
kernel: usb 2-10: (p54usb) reset failed! (-110)
kernel: p54usb: probe of 2-10:1.0 failed with error -110
[...]

and a physical unplug and replug was necessary.
However we should be able to do this in software as well,
without any user interaction.

Signed-off-by: Christian Lamparter <chunkeey@web.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-01-29 15:59:39 -05:00
Michael Buesch 6b1c7c6760 b43/ssb: Add SPROM8 extraction and LP-PHY detection
This adds detection code for the LP-PHY and SPROM
extraction code for version 8, which is needed by the LP-PHY and
newer N-PHY.

Signed-off-by: Michael Buesch <mb@bu3sch.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-01-29 15:59:38 -05:00
Johannes Berg bb519bee07 b43: detect N PHY revision/radio
Does nothing unless you enable the hidden N PHY config.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-01-29 15:59:38 -05:00
Senthil Balasubramanian cb33c4126b ath9k: INI update for Atheros AR9280 and AR9285 chipset.
Signed-off-by: Senthil Balasubramanian <senthilkumar@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-01-29 15:59:37 -05:00
Johannes Berg 92d6128e17 ssb/b43: add new N PHY device
This is used on my macbook. N PHY, obviously nothing works
yet, but we can detect the chip with this patch.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-01-29 15:59:37 -05:00
Luis R. Rodriguez a085ff718c ath9k: fix sparse warnings
Fix sparse warnings:

drivers/net/wireless/ath9k/hw.c:1850:17: warning: symbol 'tmp' shadows an earlier one
drivers/net/wireless/ath9k/hw.c:1713:6: originally declared here
drivers/net/wireless/ath9k/hw.c:2051:17: warning: symbol 'tmp' shadows an earlier one
drivers/net/wireless/ath9k/hw.c:1961:6: originally declared here

drivers/net/wireless/ath9k/eeprom.c:195:6: warning: symbol 'ath9k_fill_eeprom' was not declared. Should it be static?
drivers/net/wireless/ath9k/eeprom.c:463:5: warning: symbol 'ath9k_check_eeprom' was not declared. Should it be static?
drivers/net/wireless/ath9k/eeprom.c:1219:6: warning: symbol 'ath9k_hw_set_def_power_per_rate_table' was not declared. Should it be static?
drivers/net/wireless/ath9k/eeprom.c:1510:6: warning: symbol 'ath9k_hw_set_4k_power_per_rate_table' was not declared. Should it be static?
drivers/net/wireless/ath9k/eeprom.c:2007:5: warning: symbol 'ath9k_set_txpower' was not declared. Should it be static?
drivers/net/wireless/ath9k/eeprom.c:2106:6: warning: symbol 'ath9k_set_addac' was not declared. Should it be static?
drivers/net/wireless/ath9k/eeprom.c:2543:6: warning: symbol 'ath9k_eeprom_set_board_values' was not declared. Should it be static?
drivers/net/wireless/ath9k/eeprom.c:2606:5: warning: symbol 'ath9k_get_eeprom_antenna_cfg' was not declared. Should it be static?
drivers/net/wireless/ath9k/eeprom.c:2622:4: warning: symbol 'ath9k_hw_get_4k_num_ant_config' was not declared. Should it be static?
drivers/net/wireless/ath9k/eeprom.c:2628:4: warning: symbol 'ath9k_hw_get_def_num_ant_config' was not declared. Should it be static?
drivers/net/wireless/ath9k/eeprom.c:2647:4: warning: symbol 'ath9k_get_num_ant_config' was not declared. Should it be static?
drivers/net/wireless/ath9k/eeprom.c:2790:5: warning: symbol 'ath9k_get_eeprom' was not declared. Should it be static?

drivers/net/wireless/ath9k/calib.c:962:30: warning: symbol 'iq_cal_multi_sample' was not declared. Should it be static?
drivers/net/wireless/ath9k/calib.c:969:30: warning: symbol 'iq_cal_single_sample' was not declared. Should it be static?
drivers/net/wireless/ath9k/calib.c:976:30: warning: symbol 'adc_gain_cal_multi_sample' was not declared. Should it be static?
drivers/net/wireless/ath9k/calib.c:983:30: warning: symbol 'adc_gain_cal_single_sample' was not declared. Should it be static?
drivers/net/wireless/ath9k/calib.c:990:30: warning: symbol 'adc_dc_cal_multi_sample' was not declared. Should it be static?
drivers/net/wireless/ath9k/calib.c:997:30: warning: symbol 'adc_dc_cal_single_sample' was not declared. Should it be static?
drivers/net/wireless/ath9k/calib.c:1004:30: warning: symbol 'adc_init_dc_cal' 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>
2009-01-29 15:59:35 -05:00
Luis R. Rodriguez c0d7c7af0a ath9k: remove superfluous check on changing channel
When we try to change the channel in ath9k its because
either the configuration indicates we *have* changed
channels or HT configuration has changed. In both cases
we want to do a reset. Either way mac80211 will inform us
when we want to actually change the channel so trust those
calls.

Although in the patch it may seem as I am doing more code
changes I am not, all I am doing is removing the initial
branch conditional and shifting the code to the left.

Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-01-29 15:59:35 -05:00
Luis R. Rodriguez 0de57d991b ath9k: remove ath9k_hw_check_chan()
The only check we care about in ath9k_hw_check_chan() is
the internal regulatory check so use that.

Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-01-29 15:59:34 -05:00
Luis R. Rodriguez 4febf7b8f4 ath9k: remove ath9k_hw_chan2wmode()
The only left users are for timing for ACK timeout, slotime and
CTS timeout. We currently use an array CLOCK_RATE to keep
these values per mode and since as only will use A and G
we can depend on the band to get the appropriate values.

We note that we should be using a different clock rate value
for CCK, we can do this in separate patch, currently this is
being disregarded and should only affect when we want to
change the default ACK/CTS timeout or slot time and stuck
with using using 802.11b.

Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-01-29 15:59:34 -05:00
Luis R. Rodriguez e56db71846 ath9k: remove mode specific default noise floor values
The NOISE_FLOOR array we have is mode specific, and the only
possible indexed values are A, B and G. The mode routine only
can return G or A, so this is band specific. Then since the
values for A and G (5ghz or 2ghz) are the same (-96) we simply
remove the array and use a static value.

If we later determine we want to use special values for
HT configurations we can use the new mac80211 conf_is_ht*()
helpers.

Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-01-29 15:59:33 -05:00
Luis R. Rodriguez 38b33707a1 ath9k: Make ANI CCK and OFDM error triggers band specific
The CCK and OFDM ANI error triggers are not mode specific but rather
band specific so just make use of the already available band from
ieee80211_conf.

Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-01-29 15:59:33 -05:00
Luis R. Rodriguez de27e64e5e iwlwifi: make use of conf_is_ht*() helpers
Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Acked-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-01-29 15:59:32 -05:00
Luis R. Rodriguez ecf70441a3 ath9k: make use of conf_is_ht*() in the rest of the driver
Use shiny new conf_is_ht*() helpers, we can later remove ht.enabled if
desired.

Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-01-29 15:59:31 -05:00
Luis R. Rodriguez c9e27d94f5 ath9k: use ieee80211_conf on ath9k_hw_iscal_supported()
ath9k_hw_iscal_supported() just needs to be aware of your band
and if HT20 is being used so lets abandon our internal channel,
HT appended values and internal mode values and use ieee80211_conf
which already carries this information. This works as calibration
is being done for the currently configured channel.

Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-01-29 15:59:31 -05:00
Luis R. Rodriguez 76061abbbb ath9k: make request to get the noisefloor threshold band specific
Lets make the request to get the current noise floor threshold
from the EEPROM band specific as it is band specific, not mode
specific.

This also adds a backpointer on the private channel structure
back to the ieee80211_channel structure as this is now needed during
ath9k_hw_getnf().

Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-01-29 15:59:30 -05:00
Luis R. Rodriguez ae8d2858c5 ath9k: consolidate arguments on hw reset
HW reset calls pass the same variables or structs
which we can obtain easily from ah. Although this also applies
during channel changes as we will keep around the ath9k_channel
passed as an argument for now.

We now also now propagate the hw reset errors down.

Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-01-29 15:59:29 -05:00
Luis R. Rodriguez ce111badf5 ath9k: Rename ath_setcurmode() to ath_cache_conf_rate()
ath_setcurmode() is a bit misleading, all we are doing is
caching the rate for the corresponding configuration we
are using.

Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-01-29 15:59:29 -05:00
Luis R. Rodriguez 96742256ab ath9k: remove cache of rate preference when using 11g protection
No need to cache when we want to use 2Mbit/s for all protection
frames for 802.11g as we can determine that dynamically on
ath_buf_set_rate() itself.

Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-01-29 15:59:28 -05:00
Luis R. Rodriguez 030bb495c0 ath9k: use hw->conf on ath_setcurmode()
We don't need to use our own mode for setting the
the routine tries to do, in fact lets remove ath_chan2mode() now as
we can simply use the currently set band and the HT configuration
provided by mac80211 through the ieee80211_conf. This works on
changing channels as well as the internal ath9k_channel we use is
based on the ieee80211_channel in the config.

Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-01-29 15:59:28 -05:00
Winkler, Tomas 51af3d3fbb iwl3945: use rx queue management infrastructure from iwlcore
This patch uses rx queue alloc free and reset function from iwlcore.
This should fix the regression reported by Kalle Valo.

Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Zhu Yi <yi.zhu@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-01-29 15:59:27 -05:00
Winkler, Tomas e52119c50d iwl3945: use iwl3945_tx_cmd instead of iwl_tx_cmd
The patch replaces iwl_tx_cmd with iwl3945_tx_cmd to complete
transitions introduced by "iwlwifi: use iwl_cmd instead
of iwl3945_cmd"

Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Zhu Yi <yi.zhu@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-01-29 15:59:26 -05:00
Samuel Ortiz c496294efe iwl3945: switch to the iwl-core send_card_state routine
Switch iwl3945 to use iwl-core:send_card_state routine.

Signed-off-by: Samuel Ortiz <samuel.ortiz@intel.com>
Signed-off-by: Abhijeet Kolekar <abhijeet.kolekar@intel.com>
Signed-off-by: Zhu Yi <yi.zhu@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-01-29 15:59:25 -05:00
Samuel Ortiz 188cf6c73a iwl3945: sync tx queue data structure with iwlagn
We are now using the iwl_tx_queue for iwl3945. To reach that goal, we
included the 3945 specific tfd frame structure to iwl_tx_queue. This
has no effect on the current iwlagn code.

Signed-off-by: Samuel Ortiz <samuel.ortiz@intel.com>
Signed-off-by: Abhijeet Kolekar <abhijeet.kolekar@intel.com>
Signed-off-by: Zhu Yi <yi.zhu@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-01-29 15:59:24 -05:00
Kolekar, Abhijeet 42427b4e43 iwl3945: adding utils ops
The patch implements iwl_hcmd_utils_ops for 3945.

Signed-off-by: Samuel Ortiz <samuel.ortiz@intel.com>
Signed-off-by: Abhijeet Kolekar <abhijeet.kolekar@intel.com>
Signed-off-by: Zhu Yi <yi.zhu@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-01-29 15:59:24 -05:00
Winkler, Tomas dbb6654c41 iwl3945: rearrange 3945 tfd
This patch moves 3945 TFD structures to iwl-3945-fh.h. It renames them
similarly to AGN naming. This patch also eliminates iwl3945_tx_info and
fixes endianity issue in iwl3945_tx_skb and iwl3945_enqueue_hcmd caused
by ugly casting.

Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Zhu Yi <yi.zhu@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-01-29 15:59:23 -05:00
Winkler, Tomas 8cd812bcda iwl3945: use iwl_rb_status
This patch makes use of iwl_rb_status also in 3945. The structure
for 3945 is not the same but since only closed_rb_num filed is used
in both cases there is no reason to duplicate it.

Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Zhu Yi <yi.zhu@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-01-29 15:59:23 -05:00
Kolekar, Abhijeet cbba18c6e3 iwl3945: use iwl_get_hw_mode
Use iwl_get_hw_mode for 3945.

Signed-off-by: Abhijeet Kolekar <abhijeet.kolekar@intel.com>
Signed-off-by: Zhu Yi <yi.zhu@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-01-29 15:59:22 -05:00
Kolekar, Abhijeet d552bfb652 iwl3945: release resources before shutting down
Release resource before shutting down and notify upper stack.

Signed-off-by: Abhijeet Kolekar <abhijeet.kolekar@intel.com>
Signed-off-by: Zhu Yi <yi.zhu@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-01-29 15:59:22 -05:00
Kolekar, Abhijeet 90a30a021e iwl3945: simplify iwl3945_pci_probe
The patch simplifies iwl3945_pci_probe. It also uses apm_ops for apm init.

Signed-off-by: Abhijeet Kolekar <abhijeet.kolekar@intel.com>
Signed-off-by: Zhu Yi <yi.zhu@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-01-29 15:59:21 -05:00
Kolekar, Abhijeet 854682ed28 iwl3945: add set_pwr_src
The patch adds 3945 iwl_lib_ops->set_pwr_src to the driver

Signed-off-by: Abhijeet Kolekar <abhijeet.kolekar@intel.com>
Signed-off-by: Zhu Yi <yi.zhu@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-01-29 15:59:20 -05:00
Kolekar, Abhijeet 01ec616d8c iwl3945: add apm ops
The patch adds 3945 iwl_lib_ops->apm_ops to the driver.

Signed-off-by: Abhijeet Kolekar <abhijeet.kolekar@intel.com>
Signed-off-by: Zhu Yi <yi.zhu@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-01-29 15:59:20 -05:00
Kolekar, Abhijeet 0164b9b45d iwl3945: add load ucode op
The patch adds 3945 iwl_lib_ops->load_ucode to the driver.

Signed-off-by: Abhijeet Kolekar <abhijeet.kolekar@intel.com>
Signed-off-by: Zhu Yi <yi.zhu@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-01-29 15:59:19 -05:00
Kolekar, Abhijeet 775a6e27bf iwl3945: cleanup and remove duplicate code
The patch removes the following duplicate structures:

	iwl3945_is_alive
	iwl3945_is_ready
	iwl3945_is_init
	iwl3945_is_rfkill_sw
	iwl3945_is_rfkill
	iwl3945_reset_qos

Signed-off-by: Abhijeet Kolekar <abhijeet.kolekar@intel.com>
Signed-off-by: Zhu Yi <yi.zhu@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-01-29 15:59:19 -05:00
Kolekar, Abhijeet df878d8f01 iwl3945: use iwl_mod_params for 3945
Use iwl_mod_params for 3945.

Signed-off-by: Abhijeet Kolekar <abhijeet.kolekar@intel.com>
Signed-off-by: Zhu Yi <yi.zhu@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-01-29 15:59:18 -05:00
Winkler, Tomas c2d79b488a iwlwifi: use iwl_cmd instead of iwl3945_cmd
This patch makes use of iwl_cmd instead of iwl3945_cmd and related
structures which were just the same.

Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Zhu Yi <yi.zhu@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-01-29 15:59:18 -05:00
Winkler, Tomas 15b1687cb4 iwlwifi: replace IWL_ERROR with IWL_ERR
IWL_ERR doesn't use hidden priv pointer.

Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Zhu Yi <yi.zhu@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-01-29 15:59:17 -05:00
Winkler, Tomas 39aadf8c29 iwlwifi: replace IWL_WARNING with IWL_WARN
IWL_WARN doesn't use hidden priv pointer.

Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Zhu Yi <yi.zhu@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-01-29 15:59:16 -05:00
Tomas Winkler 978785a389 iwlwifi: clean up printing
Use IWL_ macros where possible to unify debug output usage.
Define new unconditional printouts IWL_ERR, IWL_WARN, IWL_INFO,
and IWL_CRIT which don't use hidden priv pointer.

Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Zhu Yi <yi.zhu@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-01-29 15:59:15 -05:00
Zhu Yi 146846aed5 iwlwifi: add more comments to IWL_DL_xx
This adds more comments to IWL_DL_xx macros.

Signed-off-by: Zhu Yi <yi.zhu@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-01-29 15:59:14 -05:00
Abhijeet Kolekar 5d49f498a2 iwl3945: use iwl-io.h and delete iwl-3945-io.h
The patch deletes iwl-3945-io.h and uses iwl-io.h functions.

Signed-off-by: Abhijeet Kolekar <abhijeet.kolekar@intel.com>
Signed-off-by: Zhu Yi <yi.zhu@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-01-29 15:59:14 -05:00
Abhijeet Kolekar 4a8a43222d iwl3945: replaces iwl3945_priv with iwl_priv
The patch replaces iwl3945_priv to iwl_priv. It adds 3945 specific
data members to iwl_priv.

Signed-off-by: Abhijeet Kolekar <abhijeet.kolekar@intel.com>
Signed-off-by: Zhu Yi <yi.zhu@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-01-29 15:59:13 -05:00
Abhijeet Kolekar f2c7e52100 iwl3945: rename iwl3945_priv variables
The patch renames iwl3945 specific variables in iwl3945_priv
structure. iwl3945_priv structure differs with iwl_priv structure
with these variables. Goal of this patch is to make transition from
iwl3945_priv to iwl_priv smoothly.

Signed-off-by: Abhijeet Kolekar <abhijeet.kolekar@intel.com>
Signed-off-by: Zhu Yi <yi.zhu@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-01-29 15:59:11 -05:00
Abhijeet Kolekar 3832ec9dc9 iwl3945: use iwl_hw_params in iwl3945_priv
The patch makes changed necessary to use iwl_hw_params to
replace iwl3945_driver_hw_info.

Signed-off-by: Abhijeet Kolekar <abhijeet.kolekar@intel.com>
Signed-off-by: Zhu Yi <yi.zhu@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-01-29 15:59:10 -05:00
Abhijeet Kolekar cc2f362c36 iwl3945: use iwl_rx_queue in iwl3945
The patch replaces iwl3945_rx_queue with iwl_rx_queue.

Signed-off-by: Abhijeet Kolekar <abhijeet.kolekar@intel.com>
Signed-off-by: Zhu Yi <yi.zhu@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-01-29 15:59:09 -05:00
Abhijeet Kolekar 6100b58806 iwl3945: use iwl_rx_mem_buffer
The patch replaces iwl3945_rx_mem_buffer with iwl_rx_mem_buffer.

Signed-off-by: Abhijeet Kolekar <abhijeet.kolekar@intel.com>
Signed-off-by: Zhu Yi <yi.zhu@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-01-29 15:59:08 -05:00
Wu Fengguang d2bf55839a iwlwifi: beautify code
This patch beautifies macros in iwl-debug.h.

Signed-off-by: Wu Fengguang <fengguang.wu@intel.com>
Signed-off-by: Zhu Yi <yi.zhu@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-01-29 15:59:07 -05:00
Kolekar, Abhijeet b5323d3663 iwl3945: replace iwl3945_broadcast_addr with iwl_bcast_addr
The patch replaces iwl3945_broadcast_addr with iwl_bcast_addr for 3945.

Signed-off-by: Abhijeet Kolekar <abhijeet.kolekar@intel.com>
Signed-off-by: Zhu Yi <yi.zhu@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-01-29 15:59:07 -05:00
Kolekar, Abhijeet a78fe754e0 iwl3945: remove duplicate structures from iwl-3945.h
The patch renames and deletes duplicate structure from iwl-3945.h.
The following structures are renamed with iwlwifi counterparts:

	1) iwl3945_ac_qos
	2) iwl3945_ucode
	3) iwl3945_qos_capabity

Signed-off-by: Abhijeet Kolekar <abhijeet.kolekar@intel.com>
Signed-off-by: Zhu Yi <yi.zhu@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-01-29 15:59:06 -05:00
Kolekar, Abhijeet 85d4149533 iwl3945: move structures from iwl-3945.h to iwl-dev.h
The patch moves few structres from iwl-3945.h to iwl-dev.h.

Signed-off-by: Abhijeet Kolekar <abhijeet.kolekar@intel.com>
Signed-off-by: Zhu Yi <yi.zhu@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-01-29 15:59:05 -05:00
Kolekar, Abhijeet c0f20d9141 iwl3945: replace iwl_3945_cfg with iwl_cfg
The patch replaces iwl_3945_cfg with iwl_cfg for 3945.

Signed-off-by: Abhijeet Kolekar <abhijeet.kolekar@intel.com>
Signed-off-by: Zhu Yi <yi.zhu@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-01-29 15:59:04 -05:00
Kolekar, Abhijeet 5747d47fb4 iwl3945: include iwl-core.h
Use iwl-core.h instead of iwl-3945-core.h.

Signed-off-by: Abhijeet Kolekar <abhijeet.kolekar@intel.com>
Signed-off-by: Zhu Yi <yi.zhu@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-01-29 15:59:03 -05:00
Kolekar, Abhijeet eaa686c37d iwl3945: Change IWLWIFI_VERSION constant name
Change IWLWIFI_VERSION to IWL3945_VERSION.

Signed-off-by: Abhijeet Kolekar <abhijeet.kolekar@intel.com>
Signed-off-by: Zhu Yi <yi.zhu@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-01-29 15:59:02 -05:00
Winkler, Tomas 6d6498947d iwlwifi: emliminate iwl3945_mac_get_stats mac80211 handler
This patch removes empty iwl3945_mac_get_stats mac80211 handler.

Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Zhu Yi <yi.zhu@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-01-29 15:59:02 -05:00
Samuel Ortiz d20b3c65f2 iwl3945: iwl3945_queue and iwl3945_channel_info replacement
This patch replaces the queue and channel info 3945 structures with the iwl
ones.

The initial goal was to replace the channel info structure. Once we do that,
and then include iwl-dev.h instead of iwl-3945.h, we still get build errors
due to several routines and macro redefinitions. This is why this patch also
includes:
- TFD39_MAX_PAYLOAD definition for 3945.
- CMD_SIZE, CMD_HUGE, CMD_SKB duplication removal.
- iwl3945_queue replacement in order to also get rid of the duplicated
get_cmd_index routine.

Getting rid of any of those needs the iwl-dev.h inclusion which then creates
build errors due to definitions duplication. This is why we include all those
in the same patch.

Signed-off-by: Samuel Ortiz <samuel.ortiz@intel.com>
Signed-off-by: Abhijeet Kolekar <abhijeet.kolekar@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-01-29 15:59:01 -05:00
Samuel Ortiz 1125eff3ae iwl3945: Remove power related definitions from 3945 code
Most of the power (not TX power, but power management) structures and
definitions are duplicated accross iwl-power.h and iwl-3945.h. We should try
to only use the iwl header.

Signed-off-by: Samuel Ortiz <samuel.ortiz@intel.com>
Acked-by: Abhijeet Kolekar <abhijeet.kolekar@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-01-29 15:58:59 -05:00
Samuel Ortiz b5b83239e7 iwl3945: Getting rid of iwl-3945-led.h
The duplicated LED definitions prevent one from including iwl-dev.h from the
3945 specific C files.
Moreover, we are sharing many definitions between iwl-3945-led.h and
iwl-led.h, so let's just use the iwl one. Note that this file will get more
cleanups once we share a common iwl_priv structure.

Signed-off-by: Samuel Ortiz <samuel.ortiz@intel.com>
Acked-by: Abhijeet Kolekar <abhijeet.kolekar@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-01-29 15:58:59 -05:00
Samuel Ortiz d9829a67f9 iwl3945: Use iwl-agn-rs.h rates definitions.
A lot of rate relates definition are shared between iwl-3945-rs.h and
iwl-agn-rs.h. Let's just use the agn version, and add the 3945 specific
constants there.

Signed-off-by: Samuel Ortiz <samuel.ortiz@intel.com>
Signed-off-by: Abhijeet Kolekar <abhijeet.kolekar@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-01-29 15:58:58 -05:00
Samuel Ortiz 250bdd216c iwl3945: Have consistant and not redefined HW constants
SRAM addresses are different for 3945, 4065, and 5000, let's give them
different names.
Also, the RSSI_OFFSET is different for 3945 and 4965, thus they should be
named differently.

Signed-off-by: Samuel Ortiz <samuel.ortiz@intel.com>
Signed-off-by: Abhijeet Kolekar <abhijeet.kolekar@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-01-29 15:58:57 -05:00
Samuel Ortiz 0f741d9992 iwl3945: Getting rid of iwl3945_eeprom_channel
The corresponding iwl structure is identical.

Signed-off-by: Samuel Ortiz <samuel.ortiz@intel.com>
Signed-off-by: Abhijeet Kolekar <abhijeet.kolekar@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-01-29 15:58:57 -05:00
Samuel Ortiz a3139c5956 iwl3945: Remove DRV_NAME dependenies
As DRV_NAME is defined in 2 different header files, including both is not
possible.
This patch defines this constant from iwl3945-base.c and iwl-agn.c. It also
redefines the IWL_ERROR and IWL_WARNING macros to use dev_printk, as the
IWL_DEBUG_* macros do.

Signed-off-by: Samuel Ortiz <samuel.ortiz@intel.com>
Acked-by: Abhijeet Kolekar <abhijeet.kolekar@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-01-29 15:58:56 -05:00
Samuel Ortiz 40b8ec0bfa iwl3945: Getting rid of iwl-3945-debug.h
At the cost of adding a debug_level field to iwl3945_priv, we are now able to
get rid of iwl-3945-debug.h, and use iwl-debug.h instead.

Signed-off-by: Samuel Ortiz <samuel.ortiz@intel.com>
Signed-off-by: Abhijeet Kolekar <abhijeet.kolekar@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-01-29 15:58:55 -05:00
Tomas Winkler 3d24a9f790 iwlwifi: 3945 remove iwl-3945-commands.h
This patch remove iwl-3945-commands.h
eliminating duplicated and moving all definitions to iwl-commands.h

Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Acked-by: Samuel Ortiz <sameo@linux.intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-01-29 15:58:54 -05:00
Tomas Winkler 28afaf9139 iwlwifi: 3945 drop usage of union tsf
This patch replaces union tsf with u64
This also allows to use iwl_error_res
and iwl_rxon_time_cmd instead of 3945 structures

Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Acked-by: Samuel Ortiz <sameo@linux.intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-01-29 15:58:54 -05:00
Tomas Winkler 4c897253cc iwlwifi: 3945 remove duplicated code from iwl-3945-commands.h
This patch remove trivial (renames) commands and defines
from iwl-3945-commands.h

Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Acked-by: Samuel Ortiz <sameo@linux.intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-01-29 15:58:53 -05:00
Tomas Winkler 600c0e11ea iwlwifi: use iwl-commands.h also in 3945
This patch uses iwl-commands.h also for iwl3945
more clean ups are required but this get to stage where it
compiles cleanly.
Most massive changes are in spectrum and power managment.

Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Acked-by: Samuel Ortiz <sameo@linux.intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-01-29 15:58:53 -05:00
Winkler, Tomas b936d9be05 iwlwifi: 3945 remove current_rate from station entry.
This patch removes current_rate from station_entry it was write only
variable

Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Acked-by: Samuel Ortiz <sameo@linux.intel.com>
Signed-off-by: Abhijeet Kolekar <abhijeet.kolekar@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-01-29 15:58:52 -05:00
Tomas Winkler 69d00d2722 iwlwifi: 3945 unfold iwl-3945-commands.h
This patch unfolds includes of iwl-3945-commands.h

Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Acked-by: Samuel Ortiz <sameo@linux.intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-01-29 15:58:51 -05:00
Tomas Winkler bddadf86fb iwlwifi: 3945 extract flow handler definitions into iwl-3945-fh.h
This patch moves 3945 definitions into iwl-3945-fh.h
It renames FH_ to FH39 to help inclusion of 3945 into iwlcore
framework

Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Acked-by: Samuel Ortiz <sameo@linux.intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-01-29 15:58:50 -05:00
David Kilroy 9ee677c227 wireless: Add channel/frequency conversions to ieee80211.h
Added mappings for FHSS, DSSS and OFDM channels - with macros to point
HR DSSS and ERP to the DSSS mappings. Currently just static inline
functions.

Use the new functions in the older fullmac drivers. This eliminates a
number of const static buffers and removes a couple of range checks that
are now redundant.

Signed-off-by: David Kilroy <kilroyd@googlemail.com>
Acked-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Acked-by: Richard Farina <sidhayn@gmail.com>
Acked-by: Jeroen Vreeken <pe1rxq@amsat.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-01-29 15:58:46 -05:00
Nick Kossifidis eaee7cc2c1 ath5k: More EEPROM code updates
* Don't scale power values on RF5111 EEPROMs because they get out of
  bounds (power is u8, so multiplying power by 50 is too much and there
  is no reason to do so -we don't do it on other chips anyway-). HAL
  does it as a technique to handle 0.5 dbm steps but i believe it's not
  the right thing to do and certainly not the right place to do it. We
  'll work this out on interpolation code for all chips (0.5 or 0.25
  steps etc) in a generic way.

Signed-Off-by: Nick Kossifidis <mickflemm@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-01-29 15:58:46 -05:00
Winkler, Tomas b306b82c58 iwlwifi: kill retry_rate sysfs for iwlagn
This patch kills retry_rate in sysfs for iwlagn. It's not used.

Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Zhu Yi <yi.zhu@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-01-29 15:58:45 -05:00
Winkler, Tomas 2ddfa129bb iwlwifi: move sysfs status entry to debugfs
This patch moves priv->status sysfs entry to debugfs. It is for
debugging only anyway.

Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Zhu Yi <yi.zhu@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-01-29 15:58:44 -05:00
Christian Lamparter 29701e5abf p54: enable proper frame injection
This patch enables frame injection in monitor mode for all p54 devices.
As a result, any user can finally use the aircrack-ng suite out of the box.

e.g:
aireplay-ng --test wlan0
Trying broadcast probe requests...
Injection is working!
Found 1 AP

Trying directed probe requests...
XX:XX:XX:XX:XX:XX - channel: i - 'SSID'
Ping (min/avg/max): 1.536ms/3.193ms/4.377ms Power: 193.00
30/30: 100%

Signed-off-by: Christian Lamparter <chunkeey@web.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-01-29 15:58:44 -05:00
Christian Lamparter a15bd00543 p54: label queues with their corresponding names
This patch introduce new shiny named labels for our 8 (4 - on old firmware) queues.

Signed-off-by: Christian Lamparter <chunkeey@web.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-01-29 15:58:43 -05:00
Nick Kossifidis 0ea9c00c9d ath5k: Update EEPROM code
*Read misc2...6 values from eeprom since we want to use them (fixes
 wrong power calibration info offset on RF2413+ chips)

*Initialize num_piers to 0 for RF2413 chips (note that we read 2GHz
 frequency piers while reading mode sections, we have to ignore them
 -usualy they are 0xff anyway but during my tests i got a 1 on b mode
 with no data- and use the newer eemap.

*Add some more comments (please forgive my poor English ;-( ) and
 some minor code cleanup

*Tested on 2425 and 2112 and has the same data with ath_info (i
 wrote some debug code on debug.c to print everything like ath_info
 but i haven't tested it yet on 5111 and it's full of > 80 col lines,
 if anyone wants to play with it let me know).

Signed-Off-by: Nick Kossifidis <mickflemm@gmail.com>
Acked-by: Felix Fietkau <nbd@openwrt.org>

Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-01-29 15:58:42 -05:00
Ivo van Doorn 754be3098b rt2x00: Release rt2x00 2.3.0
Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-01-29 15:58:42 -05:00
Ivo van Doorn b30dd5c043 rt2x00: Introduce RXDONE_SIGNAL_MASK mask
Improve error message reporting when a frame was received
with unknown rate. Instead of using the boolean check if
the frame is supposed to be a PLCP value or not, we should
add a new mask (RXDONE_SIGNAL_MASK) which returns the type
identification for a signal value (i.e. PLCP). At the moment
we only have 2 different types, but more will arrive when
support for 11n is added.

Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-01-29 15:58:41 -05:00
Ivo van Doorn 2bdb35c7ff rt2x00: Allow drivers to pass the noise value during rxdone
Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-01-29 15:58:41 -05:00
Ivo van Doorn 076f9582a6 rt2x00: Remove ENTRY_TXD_OFDM_RATE
The flag ENTRY_TXD_OFDM_RATE isn't flexible enough
to indicate which rate modulation should be used for
a frame. This will become a problem when 11n support
is added.

Remove the flag and replace it with an enum value which
can better indicate the exact rate modulation.

Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-01-29 15:58:40 -05:00
Ivo van Doorn 7b40982e23 rt2x00: Move code into seperate functions
Some functions have grown rapidly in size over the last time,
some of those functions (like the rt2x00queue_create_tx_descriptor)
will further increase in size soon, so it is best to start cutting
it into logical pieces.

Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-01-29 15:58:39 -05:00
Ivo van Doorn 91581b6272 rt2x00: Split EEPROM_NIC_TX_RX_FIXED
The 2 bits in EEPROM_NIC_TX_RX_FIXED each influence
a different antenna. We might as well split the
definition and directly read the correct bit.

Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-01-29 15:58:38 -05:00
Ivo van Doorn ce292a6402 rt2x00: Implement WDS support
WDS support should be very easy to handle, mac80211 handles
everything for us, so all that is needed is to set the
support flags and handle it in the add_interface() callback.

Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-01-29 15:58:38 -05:00
Ivo van Doorn 3f787bd6d5 rt2x00: Rename CONFIG_CRYPTO_COPY_IV
CONFIG_CRYPTO_COPY_IV is a bad name since it is part
of the driver requirements instead of a configuration option.

Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-01-29 15:58:37 -05:00
Ivo van Doorn 7396faf4f3 rt2x00: Add RFKILL support to rt2500usb and rt73usb
Some very rare Ralink USB hardware exists which features
the RFKILL switch on the USB stick.
This patch adds the EEPROM check function to see if RFKILL
is supported and the polling function to rt2500usb and
rt73usb in order to support RFKILL for that hardware.

Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-01-29 15:58:37 -05:00
Andrey Yurovsky a07dbea210 rt2x00: Add mesh support
This adds initial support for Mesh Point mode.  For this we tell mac80211 that
we support NL80211_IFTYPE_MESH_POINT.  We also need to send beacons.  mac80211
will configure our RX filter accordingly.

Signed-off-by: Andrey Yurovsky <andrey@cozybit.com>
Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-01-29 15:58:35 -05:00
Ivo van Doorn 5352ff6510 rt2x00: Restrict interface between rt2x00link and drivers
Restrict drivers to only access link_qual structure during
link tuning. The contents of these fields are for the drivers
and all fields are allowed to be changed to values the driver
considers correct.

This means that some fields need to be moved outside of this
structure to restrict access only to rt2x00link itself.
This allows some code to be moved outside of the rt2x00.h header
and into rt2x00link.c.

Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-01-29 15:58:35 -05:00
Ivo van Doorn eb20b4e8a6 rt2x00: Reduce calls to bbp_read()
The link_tuner() function will always call bbp_read()
at the start of the function. Because this is an
indirect register access has some costs attached
to it (especially for USB hardware).

We already store the value read from the register
into the vgc_level value inside the link structure.
Instead of reading from the register we can read that
field directly and base the tuner on that value.

This reduces the time the registers are locked with
the csr_mutex and speeds up the link_tuner processing.

Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-01-29 15:58:34 -05:00
Ivo van Doorn 84e3196ff8 rt2x00: Move link tuning into seperate file
Move link and antenna tuning into a seperate file named rt2x00link.c,
this makes the interface to the link tuner a lot cleaner.

Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-01-29 15:58:34 -05:00
Ivo van Doorn 7d7f19ccb7 rt2x00: Implement Powersaving
Listen to IEEE80211_CONF_PS to determine if the device
should drop into powersaving mode. This feature depends
on the dynamic power save functionality in mac80211.

Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-01-29 15:58:34 -05:00
Michael Buesch 3ebbbb56a1 b43: Use 64bit atomic register access for TSF
On modern b43 devices with core rev >=3, the hardware guarantees us an
atomic 64bit read/write of the TSF, if we access the lower 32bits first.

Signed-off-by: Michael Buesch <mb@bu3sch.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-01-29 15:58:33 -05:00
Michael Buesch e808e586b7 b43: Fixup set_key handling
This fixes the key handling for mac80211's new key->flags.
It also adds TX locking to the set_key handler and adds a comment why this is required.
This doesn't fix any known bugs.

Signed-off-by: Michael Buesch <mb@bu3sch.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-01-29 15:58:33 -05:00
Divy Le Ray cb0bc20595 cxgb3: Notify fatal errors
Set up a notification mechanism to inform upper layer modules
(iWARP, iSCSI) of a chip reset due to an EEH event or a fatal error.

Signed-off-by: Divy Le Ray <divy@chelsio.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-26 22:21:59 -08:00
Steve Glendinning 1373c0fdbc smsc911x: leave RX_STOP interrupt permanently enabled
smsc911x_set_multicast_list currently performs the only non-atomic
read-modify-write of INT_EN.  This patch permanently enables the
RXSTOP_INT interrupt, and changes the ISR to only conditionally run the
multicast filter workaround code.

Signed-off-by: Steve Glendinning <steve.glendinning@smsc.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-26 21:33:16 -08:00
Magnus Damm a528079e01 smc91x: struct net_device_ops
Convert the smc91x driver to use struct net_device_ops.

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-26 21:32:25 -08:00
Kay Sievers db1d7bf70f net: struct device - replace bus_id with dev_name(), dev_set_name()
Signed-off-by: Kay Sievers <kay.sievers@vrfy.org>
Acked-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-26 21:12:58 -08:00
Cyrill Gorcunov 3617aa485c net: pppoe - stop using proc internals
Alexey Dobriyan pointed that using PDE_NET outside the
proc code is plain bogus (thanks Alexey!). Fix it.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-26 21:11:02 -08:00
Alexey Dobriyan cbec6605cf pppol2tp: stop using proc internals
PDE_NET usage in driver code is a sign and, indeed, switching
to seq_open_net/seq_release_net saves code and fixes bogus things, like
user triggerabble BUG_ON(!net) after maybe_get_net, and NULLifying ->private.

Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-26 21:10:08 -08:00
Don Skidmore 1e336d0fc9 ixgbe: add support KX/KX4 device
And support for the KX/KX4 mezzanine card.  Device id 0x10B6.

Signed-off-by: Don Skidmore <donald.c.skidmore@intel.com>
Signed-off-by: Peter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-26 20:57:51 -08:00
Don Skidmore 5b9c3cdd55 ixgbe: fix slow load times on 82598 nics
Load times for NICs that use i2c to communicate with the phy were taking
~4.5 sec per port.  This fix first checks to see if the link is already
up before calling get_link_capabilities, since if it is we don't need
query the phy for link state.

Signed-off-by: Don Skidmore <donald.c.skidmore@intel.com>
Signed-off-by: Peter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-26 20:57:17 -08:00
David S. Miller 3eacdf58c2 Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6 2009-01-26 17:43:16 -08:00
Linus Torvalds 5376071069 Merge master.kernel.org:/home/rmk/linux-2.6-arm
* master.kernel.org:/home/rmk/linux-2.6-arm: (22 commits)
  [ARM] fix section-based ioremap
  [NET] am79c961a: fix spin_lock usage
  [ARM] omap: usb: thou shalt not provide empty release functions
  [ARM] omap: watchdog: allow OMAP watchdog driver on OMAP34xx platforms
  [ARM] 5369/1: omap mmc: Add new omap hsmmc controller for 2430 and 34xx, v3
  [ARM] clkdev: fix clock matching
  [ARM] 5370/1: at91: fix rm9200 watchdog
  [ARM] 5368/1: arch/arm/mach-davinci/usb.c buildfix
  [ARM] 5365/1: s3cmci: Use new include path of dma.h
  [ARM] fix StrongARM-11x0 page copy implementation
  [ARM] omap: ensure OMAP drivers pass a struct device to clk_get()
  ARM: OMAP: Fix compile for h3 MMC
  ARM: OMAP: Remove unused platform devices, v3
  ARM: OMAP: Fix ASoC by enabling writes to XCCR and RCCR McBSP registers, v3
  ARM: OMAP: Fix OSK ASoC by registering I2C board info for tlvaic23
  ARM: OMAP: remove duplicated #include's
  ARM: OMAP: Fix DMA CCR programming for request line > 63, v3
  ARM: OMAP: Fix gpio.c compile on 15xx with CONFIG_DEBUGFS
  ARM: OMAP: Fix compile for beagle
  ARM: OMAP: Fix gpio by switching to generic gpio calls, v2
  ...
2009-01-26 15:12:47 -08:00
Anton Vorontsov cd1f55a5b4 gianfar: Revive VLAN support
commit 77ecaf2d5a ("gianfar: Fix VLAN
HW feature related frame/buffer size calculation") wrongly removed
priv->vlgrp assignment, and now priv->vlgrp is always NULL.

This patch fixes the issue, plus fixes following sparse warning
introduced by the same commit:
gianfar.c:1406:13: warning: context imbalance in 'gfar_vlan_rx_register' - wrong count at exit

gfar_vlan_rx_register() checks for "if (old_grp == grp)" and tries
to return w/o dropping the lock.

According to net/8021q/vlan.c VLAN core issues rx_register() callback:
1. In register_vlan_dev() only on a newly created group;
2. In unregister_vlan_dev() only if the group becomes empty.

Thus the check in the gianfar driver isn't needed.

Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com>
Acked-by: Andy Fleming <afleming@freescale.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-26 14:33:23 -08:00
Vladislav Zolotarov e8b5fc514d bnx2x: tx_has_work should not wait for FW
The current tx_has_work waited until all packets sent by the driver
are marked as completed by the FW. This is too greedy and it causes
the bnx2x_poll to spin in vain. The driver should only check that all
packets FW already completed are freed - only in unload flow the
driver should make sure that transmit queue is empty

Signed-off-by: Vladislav Zolotarov <vladz@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-26 12:36:42 -08:00
Dhananjay Phadke 32ec803348 netxen: reduce memory footprint
o reduce rx ring size from 8192 to 4096.
o cut down old huge lro buffers.

Signed-off-by: Dhananjay Phadke <dhananjay@netxen.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-26 12:35:19 -08:00
Dhananjay Phadke cdff103649 netxen: fix vlan tso/checksum offload
o set netdev->vlan_features appropriately.
o fix tso descriptor initialization for vlan case.

Signed-off-by: Dhananjay Phadke <dhananjay@netxen.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-26 12:34:57 -08:00
Jesse Brandeburg 78272bbab8 e1000e: workaround hw errata
There is a hardware errata in some revisions of the 82574 that needs
to be worked around in the driver by setting a register bit at init.

If this bit is not set A0 versions of the 82574 can generate
tx hangs.

Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Signed-off-by: Bruce Allan <bruce.w.allan@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-26 12:16:26 -08:00
David S. Miller 71be7a3602 Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-2.6 2009-01-25 21:36:34 -08:00
David S. Miller dd0a251c8e com0020: Add missing symbol export for com20020_netdev_ops.
Thanks to Stephen Rothwell.

Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-25 21:17:25 -08:00
Alex Williamson e918085aaf virtio_net: Fix MAX_PACKET_LEN to support 802.1Q VLANs
802.1Q expanded the maximum ethernet frame size by 4 bytes for the
VLAN tag.  We're not taking this into account in virtio_net, which
means the buffers we provide to the backend in the virtqueue RX ring
aren't big enough to hold a full MTU VLAN packet.  For QEMU/KVM,
this results in the backend exiting with a packet truncation error.

Signed-off-by: Alex Williamson <alex.williamson@hp.com>
Acked-by: Mark McLoughlin <markmc@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-25 18:06:26 -08:00
Steve Glendinning 150a7fcc5c smsc95xx: fix function prototype of async callback
smsc95xx_async_cmd_callback doesn't currently match usb_complete_t, so
there's a cast to force the square peg into the round hole.  This patch
fixes this properly.

Signed-off-by: Steve Glendinning <steve.glendinning@smsc.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-25 17:54:46 -08:00
Steve Glendinning 01a1ac472f smsc95xx: remove unused completion struct
Oliver Neukum spotted the useless complete() in our async callback.  On
closer inspection, the entire completion struct is unused.  This patch
removes it.

Signed-off-by: Steve Glendinning <steve.glendinning@smsc.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-25 17:53:58 -08:00
Uwe Kleine-König fb22d72782 [NET] am79c961a: fix spin_lock usage
spin_lock functions take a pointer to the lock, not the lock itself.
This error was noticed by compiling ebsa110_defconfig for linux-rt where
the locking functions obviously are more picky about their arguments.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Cc: Roel Kluin <12o3l@tiscali.nl>
Cc: Steven Rostedt <srostedt@redhat.com>
Cc: netdev@vger.kernel.org
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2009-01-24 23:21:33 +00:00
Larry Finger 2fcbab044a rtl8187: Add termination packet to prevent stall
The RTL8187 and RTL8187B devices can stall unless an explicit termination
packet is sent.

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-01-23 15:38:36 -05:00
Abbas, Mohamed c338ba3ca5 iwlwifi: fix rs_get_rate WARN_ON()
In ieee80211_sta structure there is u64 supp_rates[IEEE80211_NUM_BANDS]
this is filled with all support rate from assoc_resp.  If we associate
with G-band AP only supp_rates of G-band will be set the other band
supp_rates will be set to 0. If the user type this command
this will cause mac80211 to set to new channel, mac80211
does not disassociate in setting new channel, so the active
band is now A-band. then in handling the new essid mac80211 will
kick in the assoc steps which involve sending disassociation frame.
in this mac80211 will WARN_ON sta->supp_rates[A_BAND] == 0.

This fixes:
http://www.intellinuxwireless.org/bugzilla/show_bug.cgi?id=1822
http://www.kerneloops.org/searchweek.php?search=rs_get_rate

Signed-off-by: mohamed abbas <mohamed.abbas@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-01-23 15:38:36 -05:00
Christian Lamparter b4068a8049 p54usb: fix packet loss with first generation devices
Artur Skawina confirmed that the first generation devices needs the same
URB_ZERO_PACKET flag, in oder to finish the pending transfer properly.
The second generation has been successfully fixed by
"p54usb: fix random traffic stalls (LM87)" (43af18f06d5)

Signed-off-by: Christian Lamparter <chunkeey@web.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-01-23 15:38:35 -05:00
Jesse Brandeburg 92af3e95e4 e1000e: drop lltx, remove unnecessary lock
LLTX is deprecated and complicated, don't use it.  It was observed by Don Ash
<donash4@gmail.com> that e1000e was acquiring this lock in the NAPI cleanup
path.  This is obviously a bug, as this is a leftover from when e1000
supported multiple tx queues and fake netdevs.

another user reported this to us and tested routing with the 2.6.27 kernel and
this patch and reported a 3.5 % improvement in packets forwarded in a
multi-port test on 82571 parts.

Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Signed-off-by: Bruce Allan <bruce.w.allan@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-22 23:38:12 -08:00
Steve Glendinning c64d2a9afb phy: Add suspend/resume support to SMSC PHYs
All supported SMSC PHYs implement the standard "power down" bit 11 of
BMCR, so this patch adds support using the generic genphy_{suspend,resume}
functions.

Signed-off-by: Steve Glendinning <steve.glendinning@smsc.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-22 14:07:43 -08:00
Florian Fainelli 5ef3041e4a au1000: reorder functions
This patch reorders functions so that we do longer need
forward declarations.

Signed-off-by: Florian Fainelli <florian@openwrt.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-22 14:06:25 -08:00
Cyrill Gorcunov e35fac80ed net: pppoe - get rid of DECLARE_MAC_BUF
While was playing with PPP namespaces I occasionally brought
back DECLARE_MAC_BUF which is not needed (we have %pM here).
Fix it.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-22 13:52:26 -08:00
Anton Vorontsov 6f051069d8 phylib: Fix oops in suspend/resume paths
Suspend/resume routines check for phydrv != NULL, but that is
wrong because "phydrv" comes from container_of(drv). If drv is NULL,
then container_of(drv) will return non-NULL result, and the checks
won't work.

The Freescale TBI PHYs are driver-less, so "drv" is NULL, and that
leads to the following oops:

Unable to handle kernel paging request for data at address 0xffffffe4
Faulting instruction address: 0xc0215554
Oops: Kernel access of bad area, sig: 11 [#1]
[...]
NIP [c0215554] mdio_bus_suspend+0x34/0x70
LR [c01cc508] suspend_device+0x258/0x2bc
Call Trace:
[cfad3da0] [cfad3db8] 0xcfad3db8 (unreliable)
[cfad3db0] [c01cc508] suspend_device+0x258/0x2bc
[cfad3dd0] [c01cc62c] dpm_suspend+0xc0/0x140
[cfad3e20] [c01cc6f4] device_suspend+0x48/0x5c
[cfad3e40] [c0068dd8] suspend_devices_and_enter+0x8c/0x148
[cfad3e60] [c00690f8] enter_state+0x100/0x118
[cfad3e80] [c00691c0] state_store+0xb0/0xe4
[cfad3ea0] [c018c938] kobj_attr_store+0x24/0x3c
[cfad3eb0] [c00ea9a8] flush_write_buffer+0x58/0x7c
[cfad3ed0] [c00eadf0] sysfs_write_file+0x58/0xa0
[cfad3ef0] [c009e810] vfs_write+0xb4/0x16c
[cfad3f10] [c009ed40] sys_write+0x4c/0x90
[cfad3f40] [c0014954] ret_from_syscall+0x0/0x38
[...]

This patch fixes the issue, plus removes unneeded parentheses
and fixes indentation level in mdio_bus_suspend().

Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-22 13:51:24 -08:00
Eilon Greenstein 5422a22573 bnx2x: Version
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-22 13:47:13 -08:00
Eilon Greenstein 3910c8ae44 bnx2x: loopback test failure
A link change interrupt might be queued and activated after the loopback was set
and it will cause the loopback to fail. The PHY lock should be kept until the
loopback test is over.

That implies that the bnx2x_test_link should used within the loopback function
and not bnx2x_wait_for_link since that function also takes the PHY link

Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-22 13:47:12 -08:00
Eilon Greenstein 5650d9d4cb bnx2x: Missing rmb when waiting for FW response
Waiting for the FW to response requires a memory barrier

Signed-off-by: Michal Kalderon <michals@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-22 13:47:12 -08:00
Eilon Greenstein 7cde1c8b79 bnx2x: Calling napi_del
rmmod might hang without this patch since the reference counter is not going
down

Signed-off-by: Yitchak Gertner <gertner@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-22 13:47:11 -08:00
Eilon Greenstein 6eccabb301 bnx2x: Carrier off first call
Call carrier off should not be called after register_netdev since after
register netdev open can be called at any time followed by an interrupt that
will set it to carrier_on and the probe will resume control and set it to off

Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-22 13:45:06 -08:00
Eilon Greenstein 2dfe0e1fec bnx2x: Handling load failures
Failures on load were not handled correctly - separate the flow to handle

different failures

Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-22 13:45:06 -08:00
Eilon Greenstein e94d8af3da bnx2x: Disable napi
Calling napi disabled unconditionally at netif stop

Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-22 13:45:05 -08:00
Eilon Greenstein 81f75bbf67 bnx2x: Reset HW before use
To avoid complications, make sure that the HW is in reset (as it should be)
before trying to take it out of reset. In normal flows, the HW is indeed in rest
so this should have no effect

Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-22 13:45:05 -08:00