[PATCH v5] ath10k: set MAC timestamp in management Rx frame
Peter Oh
poh at codeaurora.org
Tue Mar 1 09:54:43 PST 2016
On 02/29/2016 10:33 AM, Michal Kazior wrote:
> On 26 February 2016 at 20:03, Peter Oh <poh at qca.qualcomm.com> wrote:
>> Check and set Rx MAC timestamp when firmware indicates it.
>> Firmware adds it in Rx beacon frame only at this moment.
>> Driver and mac80211 may utilize it to detect such clockdrift
>> or beacon collision and use the result for beacon collision
>> avoidance.
>>
>> Signed-off-by: Peter Oh <poh at qca.qualcomm.com>
>> ---
> [...]
>> + if (rx_status & WMI_RX_STATUS_EXT_INFO) {
>> + status->mactime =
>> + __le32_to_cpu(arg.ext_info.rx_mac_timestamp_l32) |
>> +
>> (u64)__le32_to_cpu(arg.ext_info.rx_mac_timestamp_u32)
>> + << 32;
>> + status->flag |= RX_FLAG_MACTIME_END;
>> + }
>> /* Hardware can Rx CCK rates on 5GHz. In that case phy_mode is set
>> to
>> * MODE_11B. This means phy_mode is not a reliable source for the
>> band
>> * of mgmt rx.
>> diff --git a/drivers/net/wireless/ath/ath10k/wmi.h
>> b/drivers/net/wireless/ath/ath10k/wmi.h
>> index 4d3cbc4..f209d51 100644
>> --- a/drivers/net/wireless/ath/ath10k/wmi.h
>> +++ b/drivers/net/wireless/ath/ath10k/wmi.h
>> @@ -3037,11 +3037,18 @@ struct wmi_10_4_mgmt_rx_event {
>> u8 buf[0];
>> } __packed;
>>
>> +struct wmi_mgmt_rx_ext_info {
>> + __le32 rx_mac_timestamp_l32;
>> + __le32 rx_mac_timestamp_u32;
> Oh.. I feel bad for noticing this so late.
review is always appreciated.
> I think this can be
> represented with a mere __le64 and then accessed via le64_to_cpu().
sent new patch based on your comment.
Thanks,
Peter
More information about the ath10k
mailing list