mwl8787: support choosing right pre-tbtt delay

Since (e.g.) the SDIO bus may need to do some sleeping
after pre-TBTT events and it does this on a work queue,
indicate the expected work queue delay.

Signed-off-by: Thomas Pedersen <thomas@cozybit.com>
mwl8787: dont set IEEE80211_CONF_PS for mesh ps

This flag is meant for managed STA ps mode, and it changes meanings
depending on what the driver implements.  Most drivers we use will
go to sleep as soon as IEEE80211_CONF_PS bit is set, and consequently
they will ignore any mesh traffic (whereas with mesh PS we want to
put them to sleep only after we get their power saving state from
a beacon).

Signed-off-by: Bob Copeland <me@bobcopeland.com>
mac80211: hardcode a fudge factor for mesh awake window

We could ask the driver for this but I'm not convinced
mac80211 should own this timer anyway.

Signed-off-by: Bob Copeland <me@bobcopeland.com>
mwl8787: add a debugfs entry to turn on and off the radio

Allow killing the radio without affecting the interface for simulated
path healing tests.
mac80211: mesh: only get tsf if we need it

The local TSF is used to compute the timing offset between
mesh peers on beacon reception.  However, asking the card for
the TSF is not very accurate, so we prefer to use rx->mactime.
In the latter case, calling drv_get_tsf() just adds more delay
into the RX path, so skip it if we can.

Signed-off-by: Bob Copeland <me@bobcopeland.com>
mac80211: fix a warning I added.

Signed-off-by: Bob Copeland <me@bobcopeland.com>
mac80211,mwl8787: teach mac80211 what the wakeup delay is

Signed-off-by: Bob Copeland <me@bobcopeland.com>
mac80211: add missing le64_to_cpu()

Don't think it matters on arm/intel gear but sparse complained.

Signed-off-by: Bob Copeland <me@bobcopeland.com>
mwl8787: use kstrtoint_from_user instead of sscanf on user buf

This adds proper error checking and fixes:

drivers/net/wireless/mwl8787/debugfs.c:51:16: warning: incorrect type in
argument 1 (different address spaces)
drivers/net/wireless/mwl8787/debugfs.c:51:16:    expected char const
*<noident>
drivers/net/wireless/mwl8787/debugfs.c:51:16:    got char const
[noderef] <asn:1>*ubuf

Signed-off-by: Bob Copeland <me@bobcopeland.com>
mwl8787: send fw dtim period when enabling beacon

Signed-off-by: Bob Copeland <me@bobcopeland.com>