rt2x00: zero-out rx_status

In commit 'mac80211: support radiotap vendor namespace RX data'
new fields were added to 'struct ieee80211_rx_status' and those
fileds must be zeroed. However the rt2x00 driver stores driver
specific data in the cb array of the rx skbs, so the fields
might contain garbage and this can cause unexpected behaviour.

The rt2x00 driver from the compat-wireless-2012-12-01
tarball caused the following warning:

  WARNING: at
  /devel/ramips/build_dir/target-mipsel_r2_uClibc-0.9.33.2/linux-ramips_rt305x/
  compat-wireless-2012-12-01/net/mac80211/rx.c:115 ieee80211_rx_irqsafe+0x274/0xbcc
  [mac80211]()
  Modules linked in: dwc_otg ledtrig_usbdev nf_nat_irc
  nf_nat_ftp nf_conntrack_irc nf_conntrack_ftp ipt_MASQUERADE
  iptable_nat nf_nat pppoe xt_conntrack xt_CT xt_NOTRACK iptable_raw
  xt_state nf_conntrack_ipv4 nf_defrag_ipv4 nf_conntrack pppox
  ipt_REJECT xt_TCPMSS xt_comment xt_multiport xt_mac xt_limit
  iptable_mangle iptable_filter ip_tables xt_tcpudp x_tables ppp_async
  ppp_generic slhc rt2800pci(O) rt2800lib(O) rt2x00soc(O) rt2x00pci(O)
  rt2x00lib(O) mac80211(O) usbcore usb_common nls_base crc_itu_t
  crc_ccitt eeprom_93cx6 cfg80211(O) compat(O) arc4 aes_generic
  crypto_blkcipher cryptomgr aead crypto_hash crypto_algapi leds_gpio
  button_hotplug(O) gpio_keys_polled input_polldev input_core
  Call Trace:
  [<801e96b4>] dump_stack+0x8/0x34
  [<80010a9c>] warn_slowpath_common+0x78/0xa4
  [<80010ae0>] warn_slowpath_null+0x18/0x24
  [<80a9710c>] ieee80211_rx_irqsafe+0x274/0xbcc [mac80211]

The patch ensures that each field gets initialized with
zeroes.

Cc: <users@rt2x00.serialmonkey.com>
Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
Acked-by: Gertjan van Wingerde <gwingerde@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
wireless: fix Atheros drivers compilation

Bug introduced in commit:
wireless: allow Atheros card to not depend on ath.ko

Commit in question changed CONFIG_ATH_COMMON to CONFIG_ATH_CARDS as
"Atheros card" indication in drivers/net/wireless/ath/Kconfig but it
is used also by drivers/net/wireless/Makefile

If there are only Atheros cards that do not require ATH_COMMON, whole
Makefile for Atheros cards was not executed; and as result, driver
won't compile in this case.

Change in CONFIG_ option name should be reflected in the
drivers/net/wireless/Makefile

Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>
Tested-by: Kalle Valo <kvalo@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
mac80211_hwsim: use tasklet_hrtimer for beacon timers

For testing various timing-sensitive protocols (power
save, etc.), a beacon accuracy of jiffies is not
sufficient. A tasklet_hrtimer is used for the beacon since
it runs the callback in soft-IRQ context with hrtimer
resolution.

Also handle BSS_CHANGED_BEACON_ENABLED for hwsim.

Signed-off-by: Thomas Pedersen <thomas@cozybit.com>

v3:
	Handle CHANGED_BEACON_ENABLED (Johannes)
	Move get/set_tsf() timebase changes into this
	patch (Johannes)
	use tasklet_hrtimer instead of tasklet + hrtimer
mac80211_hwsim: beacon at beacon interval

A beacon period starts at TSF time 0. Spoof this by
rounding the starting beacon time to a multiple of the
beacon interval.

Signed-off-by: Thomas Pedersen <thomas@cozybit.com>

v3:

	use mac80211_get_tsf() instead of cpu->le->cpu
	conversion (Johannes)
mac80211_hwsim: emulate proper beaconing

What this means:

1) Fill in beacon timestamp for the monitor interface, and
   don't make the timestamp adjustment so contrived.
2) Change beacon time in response to TSF adjustment. This
   means hwsim PHYs can now be told to beacon offset
   (Toffset) from each other in time by adjusting the TSF.
3) PHY TSF offset adjustments are cumulative. i.e. +1000,
   then -1000 should not result in a TSF with offset -1000.

Per-station Toffset tracking has been tested, and beacons
are transmitted shortly after TBTT as shown in the
timestamp.

Signed-off-by: Thomas Pedersen <thomas@cozybit.com>

v3:
	endian bug (Johannes)
mac80211: RMC buckets are just list heads

The array of rmc_entrys is redundant since only the
list_head is used. Make this an array of list_heads
instead and save ~6k per vif at runtime :D

Signed-off-by: Thomas Pedersen <thomas@cozybit.com>