Subject: Re: [PATCH 1/4] mac80211-hwsim: notify user-space about channel change.

From: Sergei Shtylyov <[email-masked]>
Date: Sun, 05 Apr 2015 17:16:14 +0300

Hello.

On 4/4/2015 12:12 AM, [email-masked] wrote:

> From: Ben Greear <[email-masked]>

> The goal is to allow the user-space application to properly
> filter packets before sending them down to the kernel.  This
> should more closely mimic what a real piece of hardware would
> do.

> Signed-off-by: Ben Greear <[email-masked]>
> ---
>   drivers/net/wireless/mac80211_hwsim.c | 48 +++++++++++++++++++++++++++++++++++
>   drivers/net/wireless/mac80211_hwsim.h |  6 +++++
>   2 files changed, 54 insertions(+)

> diff --git a/drivers/net/wireless/mac80211_hwsim.c b/drivers/net/wireless/mac80211_hwsim.c
> index 8908be6..d0e88b2 100644
> --- a/drivers/net/wireless/mac80211_hwsim.c
> +++ b/drivers/net/wireless/mac80211_hwsim.c
> @@ -871,6 +871,52 @@ static bool hwsim_ps_rx_ok(struct mac80211_hwsim_data *data,
>   	return true;
>   }
>
> +static void mac80211_hwsim_check_nl_notify(struct mac80211_hwsim_data *data)
> +{
> +	struct sk_buff *skb;
> +	u32 center_freq = 0;
> +	u32 _portid;
> +	void *msg_head;
> +
> +	/* wmediumd mode check */
> +	_portid = ACCESS_ONCE(wmediumd_portid);
> +

    I don't think empty line is needed here...

> +	if (!_portid)
> +		return;
> +
> +	skb = genlmsg_new(GENLMSG_DEFAULT_SIZE, GFP_ATOMIC);
> +	if (skb == NULL)

    Hm, have you run this thru scripts/checkpatch.pl? It should have 
recommended using '!skb' instead (which would have been only consistent with 
your previous code).

> +		goto err_print;
> +
> +	msg_head = genlmsg_put(skb, 0, 0, &hwsim_genl_family, 0,
> +			       HWSIM_CMD_NOTIFY);
> +	if (msg_head == NULL) {

    Same here.

[...]

WBR, Sergei