Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 368465
b: refs/heads/master
c: 506a81e
h: refs/heads/master
i:
  368463: 65e7660
v: v3
  • Loading branch information
Johannes Berg committed Mar 6, 2013
1 parent 40290aa commit c261ef2
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 8 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: b1f553c7484b983aac20c107b9766804b69cf73f
refs/heads/master: 506a81e6ba1148a4435dec95651cd93874c2b7cf
25 changes: 18 additions & 7 deletions trunk/drivers/net/wireless/iwlwifi/mvm/mac-ctxt.c
Original file line number Diff line number Diff line change
Expand Up @@ -855,10 +855,10 @@ int iwl_mvm_mac_ctxt_beacon_changed(struct iwl_mvm *mvm,
*/
static void iwl_mvm_mac_ctxt_cmd_fill_ap(struct iwl_mvm *mvm,
struct ieee80211_vif *vif,
struct iwl_mac_data_ap *ctxt_ap)
struct iwl_mac_data_ap *ctxt_ap,
bool add)
{
struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif);
u32 curr_dev_time;

ctxt_ap->bi = cpu_to_le32(vif->bss_conf.beacon_int);
ctxt_ap->bi_reciprocal =
Expand All @@ -870,10 +870,19 @@ static void iwl_mvm_mac_ctxt_cmd_fill_ap(struct iwl_mvm *mvm,
vif->bss_conf.dtim_period));

ctxt_ap->mcast_qid = cpu_to_le32(vif->cab_queue);
curr_dev_time = iwl_read_prph(mvm->trans, DEVICE_SYSTEM_TIME_REG);
ctxt_ap->beacon_time = cpu_to_le32(curr_dev_time);

ctxt_ap->beacon_tsf = cpu_to_le64(curr_dev_time);
/*
* Only read the system time when the MAC is being added, when we
* just modify the MAC then we should keep the time -- the firmware
* can otherwise have a "jumping" TBTT.
*/
if (add)
mvmvif->ap_beacon_time =
iwl_read_prph(mvm->trans, DEVICE_SYSTEM_TIME_REG);

ctxt_ap->beacon_time = cpu_to_le32(mvmvif->ap_beacon_time);

ctxt_ap->beacon_tsf = 0; /* unused */

/* TODO: Assume that the beacon id == mac context id */
ctxt_ap->beacon_template = cpu_to_le32(mvmvif->id);
Expand All @@ -894,7 +903,8 @@ static int iwl_mvm_mac_ctxt_cmd_ap(struct iwl_mvm *mvm,
cmd.filter_flags |= cpu_to_le32(MAC_FILTER_IN_PROBE_REQUEST);

/* Fill the data specific for ap mode */
iwl_mvm_mac_ctxt_cmd_fill_ap(mvm, vif, &cmd.ap);
iwl_mvm_mac_ctxt_cmd_fill_ap(mvm, vif, &cmd.ap,
action == FW_CTXT_ACTION_ADD);

return iwl_mvm_mac_ctxt_send_cmd(mvm, &cmd);
}
Expand All @@ -911,7 +921,8 @@ static int iwl_mvm_mac_ctxt_cmd_go(struct iwl_mvm *mvm,
iwl_mvm_mac_ctxt_cmd_common(mvm, vif, &cmd, action);

/* Fill the data specific for GO mode */
iwl_mvm_mac_ctxt_cmd_fill_ap(mvm, vif, &cmd.go.ap);
iwl_mvm_mac_ctxt_cmd_fill_ap(mvm, vif, &cmd.go.ap,
action == FW_CTXT_ACTION_ADD);

cmd.go.ctwin = cpu_to_le32(vif->bss_conf.p2p_ctwindow);
cmd.go.opp_ps_enabled = cpu_to_le32(!!vif->bss_conf.p2p_oppps);
Expand Down
2 changes: 2 additions & 0 deletions trunk/drivers/net/wireless/iwlwifi/mvm/mvm.h
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,8 @@ struct iwl_mvm_vif {
bool uploaded;
bool ap_active;

u32 ap_beacon_time;

enum iwl_tsf_id tsf_id;

/*
Expand Down

0 comments on commit c261ef2

Please sign in to comment.