提交 2ba45384 编写于 作者: L Luciano Coelho 提交者: Johannes Berg

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: NLuciano Coelho <luciano.coelho@intel.com>
Signed-off-by: NJohannes Berg <johannes.berg@intel.com>
上级 a2db2ed3
...@@ -1117,6 +1117,8 @@ struct ieee80211_conf { ...@@ -1117,6 +1117,8 @@ struct ieee80211_conf {
* Function (TSF) timer when the frame containing the channel switch * Function (TSF) timer when the frame containing the channel switch
* announcement was received. This is simply the rx.mactime parameter * announcement was received. This is simply the rx.mactime parameter
* the driver passed into mac80211. * the driver passed into mac80211.
* @device_timestamp: arbitrary timestamp for the device, this is the
* rx.device_timestamp parameter the driver passed to mac80211.
* @block_tx: Indicates whether transmission must be blocked before the * @block_tx: Indicates whether transmission must be blocked before the
* scheduled channel switch, as indicated by the AP. * scheduled channel switch, as indicated by the AP.
* @chandef: the new channel to switch to * @chandef: the new channel to switch to
...@@ -1124,6 +1126,7 @@ struct ieee80211_conf { ...@@ -1124,6 +1126,7 @@ struct ieee80211_conf {
*/ */
struct ieee80211_channel_switch { struct ieee80211_channel_switch {
u64 timestamp; u64 timestamp;
u32 device_timestamp;
bool block_tx; bool block_tx;
struct cfg80211_chan_def chandef; struct cfg80211_chan_def chandef;
u8 count; u8 count;
......
...@@ -1046,7 +1046,8 @@ static void ieee80211_chswitch_timer(unsigned long data) ...@@ -1046,7 +1046,8 @@ static void ieee80211_chswitch_timer(unsigned long data)
static void static void
ieee80211_sta_process_chanswitch(struct ieee80211_sub_if_data *sdata, ieee80211_sta_process_chanswitch(struct ieee80211_sub_if_data *sdata,
u64 timestamp, struct ieee802_11_elems *elems, u64 timestamp, u32 device_timestamp,
struct ieee802_11_elems *elems,
bool beacon) bool beacon)
{ {
struct ieee80211_local *local = sdata->local; struct ieee80211_local *local = sdata->local;
...@@ -1154,6 +1155,7 @@ ieee80211_sta_process_chanswitch(struct ieee80211_sub_if_data *sdata, ...@@ -1154,6 +1155,7 @@ ieee80211_sta_process_chanswitch(struct ieee80211_sub_if_data *sdata,
/* use driver's channel switch callback */ /* use driver's channel switch callback */
struct ieee80211_channel_switch ch_switch = { struct ieee80211_channel_switch ch_switch = {
.timestamp = timestamp, .timestamp = timestamp,
.device_timestamp = device_timestamp,
.block_tx = csa_ie.mode, .block_tx = csa_ie.mode,
.chandef = csa_ie.chandef, .chandef = csa_ie.chandef,
.count = csa_ie.count, .count = csa_ie.count,
...@@ -3203,6 +3205,7 @@ static void ieee80211_rx_mgmt_beacon(struct ieee80211_sub_if_data *sdata, ...@@ -3203,6 +3205,7 @@ static void ieee80211_rx_mgmt_beacon(struct ieee80211_sub_if_data *sdata,
ieee80211_rx_bss_info(sdata, mgmt, len, rx_status, &elems); ieee80211_rx_bss_info(sdata, mgmt, len, rx_status, &elems);
ieee80211_sta_process_chanswitch(sdata, rx_status->mactime, ieee80211_sta_process_chanswitch(sdata, rx_status->mactime,
rx_status->device_timestamp,
&elems, true); &elems, true);
if (!(ifmgd->flags & IEEE80211_STA_DISABLE_WMM) && if (!(ifmgd->flags & IEEE80211_STA_DISABLE_WMM) &&
...@@ -3334,8 +3337,9 @@ void ieee80211_sta_rx_queued_mgmt(struct ieee80211_sub_if_data *sdata, ...@@ -3334,8 +3337,9 @@ void ieee80211_sta_rx_queued_mgmt(struct ieee80211_sub_if_data *sdata,
break; break;
ieee80211_sta_process_chanswitch(sdata, ieee80211_sta_process_chanswitch(sdata,
rx_status->mactime, rx_status->mactime,
&elems, false); rx_status->device_timestamp,
&elems, false);
} else if (mgmt->u.action.category == WLAN_CATEGORY_PUBLIC) { } else if (mgmt->u.action.category == WLAN_CATEGORY_PUBLIC) {
ies_len = skb->len - ies_len = skb->len -
offsetof(struct ieee80211_mgmt, offsetof(struct ieee80211_mgmt,
...@@ -3356,8 +3360,9 @@ void ieee80211_sta_rx_queued_mgmt(struct ieee80211_sub_if_data *sdata, ...@@ -3356,8 +3360,9 @@ void ieee80211_sta_rx_queued_mgmt(struct ieee80211_sub_if_data *sdata,
&mgmt->u.action.u.ext_chan_switch.data; &mgmt->u.action.u.ext_chan_switch.data;
ieee80211_sta_process_chanswitch(sdata, ieee80211_sta_process_chanswitch(sdata,
rx_status->mactime, rx_status->mactime,
&elems, false); rx_status->device_timestamp,
&elems, false);
} }
break; break;
} }
......
...@@ -995,6 +995,7 @@ TRACE_EVENT(drv_channel_switch, ...@@ -995,6 +995,7 @@ TRACE_EVENT(drv_channel_switch,
LOCAL_ENTRY LOCAL_ENTRY
CHANDEF_ENTRY CHANDEF_ENTRY
__field(u64, timestamp) __field(u64, timestamp)
__field(u32, device_timestamp)
__field(bool, block_tx) __field(bool, block_tx)
__field(u8, count) __field(u8, count)
), ),
...@@ -1003,6 +1004,7 @@ TRACE_EVENT(drv_channel_switch, ...@@ -1003,6 +1004,7 @@ TRACE_EVENT(drv_channel_switch,
LOCAL_ASSIGN; LOCAL_ASSIGN;
CHANDEF_ASSIGN(&ch_switch->chandef) CHANDEF_ASSIGN(&ch_switch->chandef)
__entry->timestamp = ch_switch->timestamp; __entry->timestamp = ch_switch->timestamp;
__entry->device_timestamp = ch_switch->device_timestamp;
__entry->block_tx = ch_switch->block_tx; __entry->block_tx = ch_switch->block_tx;
__entry->count = ch_switch->count; __entry->count = ch_switch->count;
), ),
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册