Linux wireless drivers development
 help / color / mirror / Atom feed
From: Johannes Berg <johannes@sipsolutions.net>
To: Arik Nemtsov <arik@wizery.com>
Cc: linux-wireless@vger.kernel.org, Kalyan C Gaddam <chakkal@iit.edu>
Subject: Re: [PATCH 1/5] nl80211: support sending TDLS commands/frames
Date: Tue, 27 Sep 2011 13:43:45 +0200	[thread overview]
Message-ID: <1317123825.4082.15.camel@jlt3.sipsolutions.net> (raw)
In-Reply-To: <1317034493-5300-2-git-send-email-arik@wizery.com> (sfid-20110926_125509_597206_8931C85C)

On Mon, 2011-09-26 at 13:54 +0300, Arik Nemtsov wrote:

> @@ -876,6 +884,8 @@ static int nl80211_send_wiphy(struct sk_buff *msg, u32 pid, u32 seq, int flags,
>  	}
>  	CMD(set_channel, SET_CHANNEL);
>  	CMD(set_wds_peer, SET_WDS_PEER);
> +	CMD(tdls_mgmt, TDLS_MGMT);

Should that maybe depend on the TLDS_EXTERNAL_SETUP flag to avoid
inconsistencies? Especially with mac80211 drivers?

> +	CMD(tdls_oper, TDLS_OPER);

and maybe not advertise that if TDLS isn't support -- in particular so
that mac80211 drivers don't advertise it even though mac80211 might have
the hook.

> +static int nl80211_tdls_mgmt(struct sk_buff *skb, struct genl_info *info)
> +{
> +	struct cfg80211_registered_device *rdev = info->user_ptr[0];
> +	struct net_device *dev = info->user_ptr[1];
> +	u8 action_code, dialog_token;
> +	u16 status_code;
> +	u8 *peer;
> +
> +	if (!rdev->ops->tdls_mgmt)
> +		return -EOPNOTSUPP;
> +
> +	if (!info->attrs[NL80211_ATTR_TDLS_ACTION] ||
> +	    !info->attrs[NL80211_ATTR_STATUS_CODE] ||
> +	    !info->attrs[NL80211_ATTR_TDLS_DIALOG_TOKEN] ||
> +	    !info->attrs[NL80211_ATTR_IE] ||
> +	    !info->attrs[NL80211_ATTR_MAC])
> +		return -EINVAL;
> +
> +	peer = nla_data(info->attrs[NL80211_ATTR_MAC]);
> +	action_code = nla_get_u8(info->attrs[NL80211_ATTR_TDLS_ACTION]);
> +	status_code = nla_get_u16(info->attrs[NL80211_ATTR_STATUS_CODE]);
> +	dialog_token = nla_get_u8(info->attrs[NL80211_ATTR_TDLS_DIALOG_TOKEN]);
> +
> +	return rdev->ops->tdls_mgmt(&rdev->wiphy, dev, peer, action_code,
> +				    dialog_token, status_code,
> +				    nla_data(info->attrs[NL80211_ATTR_IE]),
> +				    nla_len(info->attrs[NL80211_ATTR_IE]));
> +}

Shouldn't that return an error if TDLS_EXTERNAL_SETUP isn't set? At
least for some operations?


> +static int nl80211_tdls_oper(struct sk_buff *skb, struct genl_info *info)
> +{
> +	struct cfg80211_registered_device *rdev = info->user_ptr[0];
> +	struct net_device *dev = info->user_ptr[1];
> +	enum nl80211_tdls_operation operation;
> +	u8 *peer;
> +
> +	if (!rdev->ops->tdls_oper)
> +		return -EOPNOTSUPP;
> +
> +	if (!info->attrs[NL80211_ATTR_TDLS_OPERATION] ||
> +	    !info->attrs[NL80211_ATTR_MAC])
> +		return -EINVAL;
> +
> +	operation = nla_get_u8(info->attrs[NL80211_ATTR_TDLS_OPERATION]);
> +	peer = nla_data(info->attrs[NL80211_ATTR_MAC]);
> +
> +	return rdev->ops->tdls_oper(&rdev->wiphy, dev, peer, operation);
> +}

Ditto here, if TDLS isn't supported it needs to return an error I think,
and if TLDS needs external setup it needs to return errors for the setup
operations I think?

johannes


  reply	other threads:[~2011-09-27 11:43 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-09-26 10:54 [PATCH 0/5] TDLS support for nl80211/mac80211 drivers Arik Nemtsov
2011-09-26 10:54 ` [PATCH 1/5] nl80211: support sending TDLS commands/frames Arik Nemtsov
2011-09-27 11:43   ` Johannes Berg [this message]
2011-09-26 10:54 ` [PATCH 2/5] mac80211: standardize adding supported rates IEs Arik Nemtsov
2011-09-27 11:46   ` Johannes Berg
2011-09-27 21:08     ` Arik Nemtsov
2011-09-26 10:54 ` [PATCH 3/5] mac80211: handle TDLS high-level commands and frames Arik Nemtsov
2011-09-27 11:50   ` Johannes Berg
2011-09-27 21:12     ` Arik Nemtsov
2011-09-26 10:54 ` [PATCH 4/5] nl80211/mac80211: allow adding TDLS peers as stations Arik Nemtsov
2011-09-27 11:55   ` Johannes Berg
2011-09-27 21:24     ` Arik Nemtsov
2011-09-26 10:54 ` [PATCH 5/5] mac80211: data path modification for TDLS peers Arik Nemtsov

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=1317123825.4082.15.camel@jlt3.sipsolutions.net \
    --to=johannes@sipsolutions.net \
    --cc=arik@wizery.com \
    --cc=chakkal@iit.edu \
    --cc=linux-wireless@vger.kernel.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox