All of lore.kernel.org
 help / color / mirror / Atom feed
From: Johannes Berg <johannes@sipsolutions.net>
To: Javier Cardona <javier@cozybit.com>
Cc: "John W. Linville" <linville@tuxdriver.com>,
	devel@lists.open80211s.org, linux-wireless@vger.kernel.org
Subject: Re: [PATCHv3 1/2] mac80211_hwsim:  Add tsf to beacons, probe responses and radiotap header.
Date: Fri, 02 Mar 2012 22:43:18 +0100	[thread overview]
Message-ID: <1330724598.9652.4.camel@jlt3.sipsolutions.net> (raw)
In-Reply-To: <1330722280-28879-1-git-send-email-javier@cozybit.com> (sfid-20120302_220506_374722_1B6412A4)

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


  parent reply	other threads:[~2012-03-02 21:43 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-02 21:04 [PATCHv3 1/2] mac80211_hwsim: Add tsf to beacons, probe responses and radiotap header Javier Cardona
2012-03-02 21:04 ` [PATCHv3 2/2] mac80211: Modify tsf via debugfs in mesh interfaces Javier Cardona
2012-03-02 21:11   ` Johannes Berg
2012-03-02 21:17     ` Javier Cardona
2012-03-02 21:10 ` [PATCHv3 1/2] mac80211_hwsim: Add tsf to beacons, probe responses and radiotap header Johannes Berg
2012-03-02 21:39 ` Johannes Berg
2012-03-02 21:43 ` Johannes Berg [this message]
2012-03-02 21:46   ` Javier Cardona

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1330724598.9652.4.camel@jlt3.sipsolutions.net \
    --to=johannes@sipsolutions.net \
    --cc=devel@lists.open80211s.org \
    --cc=javier@cozybit.com \
    --cc=linux-wireless@vger.kernel.org \
    --cc=linville@tuxdriver.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.