mutex_destroy(&wilc->hif_cs);
mutex_destroy(&wilc->rxq_cs);
+ mutex_destroy(&wilc->cfg_cmd_lock);
mutex_destroy(&wilc->txq_add_to_head_cs);
}
mutex_init(&wl->hif_cs);
mutex_init(&wl->rxq_cs);
+ mutex_init(&wl->cfg_cmd_lock);
spin_lock_init(&wl->txq_spinlock);
mutex_init(&wl->txq_add_to_head_cs);
int ret_size;
struct wilc *wilc = vif->wilc;
- if (wilc->cfg_frame_in_use)
- return 0;
+ mutex_lock(&wilc->cfg_cmd_lock);
if (start)
wilc->cfg_frame_offset = 0;
offset += ret_size;
wilc->cfg_frame_offset = offset;
- if (!commit)
+ if (!commit) {
+ mutex_unlock(&wilc->cfg_cmd_lock);
return ret_size;
+ }
netdev_dbg(vif->ndev, "%s: seqno[%d]\n", __func__, wilc->cfg_seq_no);
- wilc->cfg_frame_in_use = 1;
if (wilc_wlan_cfg_commit(vif, WILC_CFG_SET, drv_handler))
ret_size = 0;
ret_size = 0;
}
- wilc->cfg_frame_in_use = 0;
wilc->cfg_frame_offset = 0;
wilc->cfg_seq_no += 1;
+ mutex_unlock(&wilc->cfg_cmd_lock);
return ret_size;
}
int ret_size;
struct wilc *wilc = vif->wilc;
- if (wilc->cfg_frame_in_use)
- return 0;
+ mutex_lock(&wilc->cfg_cmd_lock);
if (start)
wilc->cfg_frame_offset = 0;
offset += ret_size;
wilc->cfg_frame_offset = offset;
- if (!commit)
+ if (!commit) {
+ mutex_unlock(&wilc->cfg_cmd_lock);
return ret_size;
-
- wilc->cfg_frame_in_use = 1;
+ }
if (wilc_wlan_cfg_commit(vif, WILC_CFG_QUERY, drv_handler))
ret_size = 0;
netdev_dbg(vif->ndev, "%s: Timed Out\n", __func__);
ret_size = 0;
}
- wilc->cfg_frame_in_use = 0;
wilc->cfg_frame_offset = 0;
wilc->cfg_seq_no += 1;
+ mutex_unlock(&wilc->cfg_cmd_lock);
return ret_size;
}