Cleanup encryption implementation

This commit cleans up the encryption implementation by removing
unnecessary stuff like the en_state and the encrypt parameter.

Signed-off-by: Olof Johansson <dev@skyshaper.net>
Cleanup includes

Removing unused includes

Signed-off-by: Olof Johansson <dev@skyshaper.net>
Merge pull request #61 from Coi-l/enc

Cleanup encryption implementation
Merge pull request #62 from Coi-l/cleanup

Cleanup includes
Configure dtim_period dynamicly

Before dtim period was hardcoded to 2. Change it dynamically
based on AP configuration.

Signed-off-by: Eugene Krasnikov <k.eugene.e@gmail.com>
Fix build after cleanup

Patch a0e6bc39479c78e7ed3dbd2a384bde52d5be65b0 broke
build.

Signed-off-by: Eugene Krasnikov <k.eugene.e@gmail.com>
Add BMPS support

In BMPS mode the chip can turn off the radio in order to save power.

Signed-off-by: Eugene Krasnikov <k.eugene.e@gmail.com>
Signed-off-by: Pontus Fuchs <pontus.fuchs@gmail.com>
Add WOW support

On host suspend put HW in BMPS mode.

Signed-off-by: Eugene Krasnikov <k.eugene.e@gmail.com>
Add missed beacon support

In BMPS mode if FW lost connection to AP it will report
WCN36XX_HAL_MISSED_BEACON_IND. Notify mac8021 about connection
lost in this case.

Signed-off-by: Eugene Krasnikov <k.eugene.e@gmail.com>
Merge pull request #64 from KrasnikovEugene/bmps

 Initial WoW support
Handle join failure

In case join fails driver leaves hardware in joined state.
That will cause different side effects like next join will
always fail and scan does not work properly. As a fix just
delete bss  in case join failed.

Signed-off-by: Eugene Krasnikov <k.eugene.e@gmail.com>
Do not forget to remove sta in AP mode

In AP mode sometimes HW remained misconfigured because of
previous sta was not removed.

Signed-off-by: Eugene Krasnikov <k.eugene.e@gmail.com>
Do not encrypt EAPOL keys

Keys are coming in data frames. So do not encrypt
data packets until key exchange is finished.

Signed-off-by: Eugene Krasnikov <k.eugene.e@gmail.com>
Configure correct AID and sta_index in AP mode

Encrypted AP mode was not working because of misconfiguration.

Signed-off-by: Eugene Krasnikov <k.eugene.e@gmail.com>
Synchronize smd commands

Add protection to smd api to make sure all smd
commands are sent sequentially.

Signed-off-by: Eugene Krasnikov <k.eugene.e@gmail.com>
Merge pull request #65 from KrasnikovEugene/ap_en

Support encryption in AP mode
Merge pull request #66 from KrasnikovEugene/smd_sync

Synchronize smd commands
Merge pull request #67 from Coi-l/master

Backports patch and instructions