aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLuciano Coelho <luciano.coelho@intel.com>2014-10-08 02:48:35 -0400
committerJohannes Berg <johannes.berg@intel.com>2014-10-09 05:30:08 -0400
commit2ba45384e5426b9a4aeb77656dce0bf3250ce54e (patch)
treeecb6921c85ad60f21c7cb10b5210e15f6cfee9f8
parenta2db2ed3fb7d35ff2405d08fc012a5db8ddb36e0 (diff)
mac80211: add device_timestamp to the ieee80211_channel_switch struct
Some devices may need the device timestamp in order to synchronize the channel switch. To pass this value back to the driver, add it to the channel switch structure and copy the device_timestamp value received in the rx info structure into it. Signed-off-by: Luciano Coelho <luciano.coelho@intel.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
-rw-r--r--include/net/mac80211.h3
-rw-r--r--net/mac80211/mlme.c15
-rw-r--r--net/mac80211/trace.h2
3 files changed, 15 insertions, 5 deletions
diff --git a/include/net/mac80211.h b/include/net/mac80211.h
index 0ad1f47d2dc7..ec0a5b07055b 100644
--- a/include/net/mac80211.h
+++ b/include/net/mac80211.h
@@ -1117,6 +1117,8 @@ struct ieee80211_conf {
1117 * Function (TSF) timer when the frame containing the channel switch 1117 * Function (TSF) timer when the frame containing the channel switch
1118 * announcement was received. This is simply the rx.mactime parameter 1118 * announcement was received. This is simply the rx.mactime parameter
1119 * the driver passed into mac80211. 1119 * the driver passed into mac80211.
1120 * @device_timestamp: arbitrary timestamp for the device, this is the
1121 * rx.device_timestamp parameter the driver passed to mac80211.
1120 * @block_tx: Indicates whether transmission must be blocked before the 1122 * @block_tx: Indicates whether transmission must be blocked before the
1121 * scheduled channel switch, as indicated by the AP. 1123 * scheduled channel switch, as indicated by the AP.
1122 * @chandef: the new channel to switch to 1124 * @chandef: the new channel to switch to
@@ -1124,6 +1126,7 @@ struct ieee80211_conf {
1124 */ 1126 */
1125struct ieee80211_channel_switch { 1127struct ieee80211_channel_switch {
1126 u64 timestamp; 1128 u64 timestamp;
1129 u32 device_timestamp;
1127 bool block_tx; 1130 bool block_tx;
1128 struct cfg80211_chan_def chandef; 1131 struct cfg80211_chan_def chandef;
1129 u8 count; 1132 u8 count;
diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c
index 2de88704278b..f2e048fa250c 100644
--- a/net/mac80211/mlme.c
+++ b/net/mac80211/mlme.c
@@ -1046,7 +1046,8 @@ static void ieee80211_chswitch_timer(unsigned long data)
1046 1046
1047static void 1047static void
1048ieee80211_sta_process_chanswitch(struct ieee80211_sub_if_data *sdata, 1048ieee80211_sta_process_chanswitch(struct ieee80211_sub_if_data *sdata,
1049 u64 timestamp, struct ieee802_11_elems *elems, 1049 u64 timestamp, u32 device_timestamp,
1050 struct ieee802_11_elems *elems,
1050 bool beacon) 1051 bool beacon)
1051{ 1052{
1052 struct ieee80211_local *local = sdata->local; 1053 struct ieee80211_local *local = sdata->local;
@@ -1154,6 +1155,7 @@ ieee80211_sta_process_chanswitch(struct ieee80211_sub_if_data *sdata,
1154 /* use driver's channel switch callback */ 1155 /* use driver's channel switch callback */
1155 struct ieee80211_channel_switch ch_switch = { 1156 struct ieee80211_channel_switch ch_switch = {
1156 .timestamp = timestamp, 1157 .timestamp = timestamp,
1158 .device_timestamp = device_timestamp,
1157 .block_tx = csa_ie.mode, 1159 .block_tx = csa_ie.mode,
1158 .chandef = csa_ie.chandef, 1160 .chandef = csa_ie.chandef,
1159 .count = csa_ie.count, 1161 .count = csa_ie.count,
@@ -3203,6 +3205,7 @@ static void ieee80211_rx_mgmt_beacon(struct ieee80211_sub_if_data *sdata,
3203 ieee80211_rx_bss_info(sdata, mgmt, len, rx_status, &elems); 3205 ieee80211_rx_bss_info(sdata, mgmt, len, rx_status, &elems);
3204 3206
3205 ieee80211_sta_process_chanswitch(sdata, rx_status->mactime, 3207 ieee80211_sta_process_chanswitch(sdata, rx_status->mactime,
3208 rx_status->device_timestamp,
3206 &elems, true); 3209 &elems, true);
3207 3210
3208 if (!(ifmgd->flags & IEEE80211_STA_DISABLE_WMM) && 3211 if (!(ifmgd->flags & IEEE80211_STA_DISABLE_WMM) &&
@@ -3334,8 +3337,9 @@ void ieee80211_sta_rx_queued_mgmt(struct ieee80211_sub_if_data *sdata,
3334 break; 3337 break;
3335 3338
3336 ieee80211_sta_process_chanswitch(sdata, 3339 ieee80211_sta_process_chanswitch(sdata,
3337 rx_status->mactime, 3340 rx_status->mactime,
3338 &elems, false); 3341 rx_status->device_timestamp,
3342 &elems, false);
3339 } else if (mgmt->u.action.category == WLAN_CATEGORY_PUBLIC) { 3343 } else if (mgmt->u.action.category == WLAN_CATEGORY_PUBLIC) {
3340 ies_len = skb->len - 3344 ies_len = skb->len -
3341 offsetof(struct ieee80211_mgmt, 3345 offsetof(struct ieee80211_mgmt,
@@ -3356,8 +3360,9 @@ void ieee80211_sta_rx_queued_mgmt(struct ieee80211_sub_if_data *sdata,
3356 &mgmt->u.action.u.ext_chan_switch.data; 3360 &mgmt->u.action.u.ext_chan_switch.data;
3357 3361
3358 ieee80211_sta_process_chanswitch(sdata, 3362 ieee80211_sta_process_chanswitch(sdata,
3359 rx_status->mactime, 3363 rx_status->mactime,
3360 &elems, false); 3364 rx_status->device_timestamp,
3365 &elems, false);
3361 } 3366 }
3362 break; 3367 break;
3363 } 3368 }
diff --git a/net/mac80211/trace.h b/net/mac80211/trace.h
index 38fae7ebe984..853c440218d4 100644
--- a/net/mac80211/trace.h
+++ b/net/mac80211/trace.h
@@ -995,6 +995,7 @@ TRACE_EVENT(drv_channel_switch,
995 LOCAL_ENTRY 995 LOCAL_ENTRY
996 CHANDEF_ENTRY 996 CHANDEF_ENTRY
997 __field(u64, timestamp) 997 __field(u64, timestamp)
998 __field(u32, device_timestamp)
998 __field(bool, block_tx) 999 __field(bool, block_tx)
999 __field(u8, count) 1000 __field(u8, count)
1000 ), 1001 ),
@@ -1003,6 +1004,7 @@ TRACE_EVENT(drv_channel_switch,
1003 LOCAL_ASSIGN; 1004 LOCAL_ASSIGN;
1004 CHANDEF_ASSIGN(&ch_switch->chandef) 1005 CHANDEF_ASSIGN(&ch_switch->chandef)
1005 __entry->timestamp = ch_switch->timestamp; 1006 __entry->timestamp = ch_switch->timestamp;
1007 __entry->device_timestamp = ch_switch->device_timestamp;
1006 __entry->block_tx = ch_switch->block_tx; 1008 __entry->block_tx = ch_switch->block_tx;
1007 __entry->count = ch_switch->count; 1009 __entry->count = ch_switch->count;
1008 ), 1010 ),