On Fri, 2012-03-02 at 13:04 -0800, Javier Cardona wrote: > @@ -667,6 +679,19 @@ static void mac80211_hwsim_tx(struct ieee80211_hw *hw, struct sk_buff *skb) > bool ack; > struct ieee80211_tx_info *txi; > u32 _pid; > + struct ieee80211_hdr *hdr = (struct ieee80211_hdr *) skb->data; > + struct mac80211_hwsim_data *data = hw->priv; > + __le64 *tsfpos; > + u16 fc = le16_to_cpu(hdr->frame_control); > + u16 fctypes = fc & (IEEE80211_FCTL_FTYPE | IEEE80211_FCTL_STYPE); > + > + if (fctypes == (IEEE80211_FTYPE_MGMT | IEEE80211_STYPE_PROBE_RESP) || > + fctypes == (IEEE80211_FTYPE_MGMT | IEEE80211_STYPE_BEACON)) { > + struct ieee80211_hdr_3addr *hdr3 = > + (struct ieee80211_hdr_3addr *) skb->data; > + tsfpos = (__le64 *) (hdr3 + 1); > + put_unaligned(__mac80211_hwsim_get_tsf(data), tsfpos); > + } And here, you can do the same with struct ieee80211_mgmt and don't even need the struct ieee80211_hdr * variable then. Also, you should use ieee80211_is_beacon() and ieee80211_is_probe_req(). Sorry for the incoherent review! johannes -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html