net: wireless: bcmdhd: Report proper mcs rate mask

Setting proper mcs rate mask allows to connect in 802.11n-only mode

Change-Id: Iffd47a60c92a74d29e42d81d79fa64463f5895c5
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
net: wireless: bcmdhd: Add ROAM setting per platform from Makefle

Change-Id: Ia6bc3025e3641cb6b91022ab1c9976c0f6ad16a4
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
cpufreq: interactiver governor: Add a time view concept

CPUFreq governors are always a tradeoff between power vs performance.
For low power UCs we want to have a less reponsive cpufreq governor that
does not respond or react to each load pick.
However when scrolling on the screen or during webbrowsing we need a more
responsive governor that interact or esponse to each load variation.

To detect which kind of application we have, we'll rely on the history of
the load. if the the average over the load history is high that means we
need to be more responsive so we change the governor paramters in that
direction.
if the average over the load history is low thatmeans we are in low power
UCs so we change the governor parameter to be less responsive

Change-Id: Ifd55ac4cfbc1bd9eded4ae603b158054c6169e8c
Signed-off-by: Nicole Chalhoub <n-chalhoub@ti.com>
Signed-off-by: Taras Kondratiuk <taras@ti.com>
(cherry picked from commit c9d2e290d40f629306ba4cd020be1d71ed5e1d23)

Conflicts:

	drivers/cpufreq/cpufreq_interactive.c
cpufreq: interactive governor: Fix not uniform buf filling & memory corruption

Each CPU has it's own load history buffer, but all they use shared
<history_load_index> variable, this lead to not uniform filling
of the cpu's circular buffers. Only about half of buffer is updated
during each buffer rewriting cycle that obligate governor to use
outdated data during freq tuning.

Moreover access to <history_load_index> variable is not atomic, that
create race conditions. Simultaneous increment could cause situation
where such check:

        if (++history_load_index == sampling_periods)
                history_load_index = 0;

not safe and buffer overflow will not be prevented. That will lead
to memory corruption.

To avoid such problems this patch move buffer-index variable to
<cpufreq_interactive_cpuinfo> structure, which is separate for each CPU.
Also, buffer overflow checking will be paranoidly changed.

Change-Id: I333a4462be17816372a7a57529811d87930058c0
Signed-off-by: Leonid Iziumtsev <x0153368@ti.com>
(cherry picked from commit befb3fe3e38d88bc1872d99748c246c26406315d)
cpufreq: interactive: take idle notifications only when active

Register an idle notifier only when the governor is active.  Also
short-circuit work of idle end if the governor is not enabled.

Signed-off-by: Sam Leffler <sleffler@chromium.org>
Change-Id: I4cae36dd2e7389540d337d74745ffbaa0131870f
cpufreq: interactive: keep freezer happy when not current governor

Fix a problem where the hung task mechanism was deeming the interactive
clock boost thread as hung.  This was because the thread is created at
module init but never run/woken up until needed.  If the governor is not
being used this can be forever.  To workaround this explicitly wake up
the thread once all the necessary data structures are initialized.  The
latter required some minor code shuffle.

Signed-off-by: Sam Leffler <sleffler@chromium.org>
Change-Id: Ie2c058dd75dcb6460ea10e7ac997e46baf66b1fe

Conflicts:

	drivers/cpufreq/cpufreq_interactive.c
cpufreq: interactive: handle speed up and down in the realtime task

Not useful to have a separate, non-realtime workqueue for speed down
events, avoid priority inversion for speed up events.

Change-Id: Iddcd05545245c847aa1bbe0b8790092914c813d2
Signed-off-by: Todd Poynor <toddpoynor@google.com>

Conflicts:

	drivers/cpufreq/cpufreq_interactive.c
cpufreq: interactive: remove input_boost handling

Now handled in userspace Power HAL instead.

Change-Id: I78a4a2fd471308bfcd785bbefcc65fede27314cf
Signed-off-by: Todd Poynor <toddpoynor@google.com>
Update Linux 3.0.43
Update
Revert "Update"

This reverts commit 6081ebcca1ec5ffe2cec4cdd57df900598f2b0ea.
Merge testing
Update Linux 3.0.43
Buile error fix
net: wireless: bcmdhd: Update wifi stack ps state if was changed

Change-Id: Ib1ee0b6ee05077d1ed6cfb578b6384dfc9787c81
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>

Conflicts:

	drivers/net/wireless/bcmdhd/wl_cfg80211.h
net: wireless: bcmdhd: Add print when power-save mode is OFF

Change-Id: Idc72198b2d59c76dd45ba918cef982bcd7b570ab
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
net: wireless: bcmdhd: Adjust roaming treshold to -65 dB

Change-Id: I88bb0cf759ee4262f31f054ef2dd5fc6258e8628
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
timekeeping: fix 32-bit overflow in get_monotonic_boottime

get_monotonic_boottime adds three nanonsecond values stored
in longs, followed by an s64.  If the long values are all
close to 1e9 the first three additions can overflow and
become negative when added to the s64.  Cast the first
value to s64 so that all additions are 64 bit.

Change-Id: Ic996d8b6fbef0b72f2d027b0d8ef5259b5c1a540
Signed-off-by: Colin Cross <ccross@android.com>
cpufreq: interactive: change frequency up/down kernel thread priority. Now it has more priority than any user thread which should boost interactivity.

Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
cpufreq: interactive: add input_boost_freq entry. This entry is the frequency which the CPU will be boosted when the screen is touched. It's user configurable from userspace and it needs to match the entries in the frequency table.

Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>