20
20
#include "cfg80211.h"
21
21
#include "main.h"
22
22
#include "11n.h"
23
+ #include "wmm.h"
23
24
24
25
static char * reg_alpha2 ;
25
26
module_param (reg_alpha2 , charp , 0 );
@@ -3259,7 +3260,7 @@ static int mwifiex_cfg80211_suspend(struct wiphy *wiphy,
3259
3260
{
3260
3261
struct mwifiex_adapter * adapter = mwifiex_cfg80211_get_adapter (wiphy );
3261
3262
struct mwifiex_ds_hs_cfg hs_cfg ;
3262
- int i , ret = 0 ;
3263
+ int i , ret = 0 , retry_num = 10 ;
3263
3264
struct mwifiex_private * priv ;
3264
3265
3265
3266
for (i = 0 ; i < adapter -> priv_num ; i ++ ) {
@@ -3269,6 +3270,21 @@ static int mwifiex_cfg80211_suspend(struct wiphy *wiphy,
3269
3270
3270
3271
mwifiex_cancel_all_pending_cmd (adapter );
3271
3272
3273
+ for (i = 0 ; i < adapter -> priv_num ; i ++ ) {
3274
+ priv = adapter -> priv [i ];
3275
+ if (priv && priv -> netdev )
3276
+ mwifiex_stop_net_dev_queue (priv -> netdev , adapter );
3277
+ }
3278
+
3279
+ for (i = 0 ; i < retry_num ; i ++ ) {
3280
+ if (!mwifiex_wmm_lists_empty (adapter ) ||
3281
+ !mwifiex_bypass_txlist_empty (adapter ) ||
3282
+ !skb_queue_empty (& adapter -> tx_data_q ))
3283
+ usleep_range (10000 , 15000 );
3284
+ else
3285
+ break ;
3286
+ }
3287
+
3272
3288
if (!wowlan ) {
3273
3289
mwifiex_dbg (adapter , ERROR ,
3274
3290
"None of the WOWLAN triggers enabled\n" );
@@ -3321,12 +3337,18 @@ static int mwifiex_cfg80211_suspend(struct wiphy *wiphy,
3321
3337
static int mwifiex_cfg80211_resume (struct wiphy * wiphy )
3322
3338
{
3323
3339
struct mwifiex_adapter * adapter = mwifiex_cfg80211_get_adapter (wiphy );
3324
- struct mwifiex_private * priv =
3325
- mwifiex_get_priv (adapter , MWIFIEX_BSS_ROLE_STA );
3340
+ struct mwifiex_private * priv ;
3326
3341
struct mwifiex_ds_wakeup_reason wakeup_reason ;
3327
3342
struct cfg80211_wowlan_wakeup wakeup_report ;
3328
3343
int i ;
3329
3344
3345
+ for (i = 0 ; i < adapter -> priv_num ; i ++ ) {
3346
+ priv = adapter -> priv [i ];
3347
+ if (priv && priv -> netdev )
3348
+ mwifiex_wake_up_net_dev_queue (priv -> netdev , adapter );
3349
+ }
3350
+
3351
+ priv = mwifiex_get_priv (adapter , MWIFIEX_BSS_ROLE_STA );
3330
3352
mwifiex_get_wakeup_reason (priv , HostCmd_ACT_GEN_GET , MWIFIEX_SYNC_CMD ,
3331
3353
& wakeup_reason );
3332
3354
memset (& wakeup_report , 0 , sizeof (struct cfg80211_wowlan_wakeup ));
0 commit comments