aboutsummaryrefslogtreecommitdiffstats
path: root/net/wireless/nl80211.c
diff options
context:
space:
mode:
authorArend van Spriel <arend@broadcom.com>2013-01-08 04:17:27 -0500
committerJohannes Berg <johannes.berg@intel.com>2013-01-16 17:20:32 -0500
commit1c18f1452a772dfe884ed25677bddb3ecaf9c43a (patch)
tree0ab3f13bca9b6245db5f43304cf8e7c951477e42 /net/wireless/nl80211.c
parent3b1c5a5307fb5277f395efdcf330c064d79df07d (diff)
nl80211: allow user-space to set address for P2P_DEVICE
As per email discussion Jouni Malinen pointed out that: "P2P message exchanges can be executed on the current operating channel of any operation (both P2P and non-P2P station). These can be on 5 GHz and even on 60 GHz (so yes, you _can_ do GO Negotiation on 60 GHz). As an example, it would be possible to receive a GO Negotiation Request frame on a 5 GHz only radio and then to complete GO Negotiation on that band. This can happen both when connected to a P2P group (through client discoverability mechanism) and when connected to a legacy AP (assuming the station receive Probe Request frame from full scan in the beginning of P2P device discovery)." This means that P2P messages can be sent over different radio devices. However, these should use the same P2P device address so it should be able to provision this from user-space. This patch adds a parameter for this to struct vif_params which should only be used during creation of the P2P device interface. Cc: Jouni Malinen <j@w1.fi> Cc: Greg Goldman <ggoldman@broadcom.com> Cc: Jithu Jance <jithu@broadcom.com> Signed-off-by: Arend van Spriel <arend@broadcom.com> [add error checking] Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/wireless/nl80211.c')
-rw-r--r--net/wireless/nl80211.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
index 1a7a710fe9bf..d543cf152100 100644
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -2079,6 +2079,13 @@ static int nl80211_new_interface(struct sk_buff *skb, struct genl_info *info)
2079 !(rdev->wiphy.interface_modes & (1 << type))) 2079 !(rdev->wiphy.interface_modes & (1 << type)))
2080 return -EOPNOTSUPP; 2080 return -EOPNOTSUPP;
2081 2081
2082 if (type == NL80211_IFTYPE_P2P_DEVICE && info->attrs[NL80211_ATTR_MAC]) {
2083 nla_memcpy(params.macaddr, info->attrs[NL80211_ATTR_MAC],
2084 ETH_ALEN);
2085 if (!is_valid_ether_addr(params.macaddr))
2086 return -EADDRNOTAVAIL;
2087 }
2088
2082 if (info->attrs[NL80211_ATTR_4ADDR]) { 2089 if (info->attrs[NL80211_ATTR_4ADDR]) {
2083 params.use_4addr = !!nla_get_u8(info->attrs[NL80211_ATTR_4ADDR]); 2090 params.use_4addr = !!nla_get_u8(info->attrs[NL80211_ATTR_4ADDR]);
2084 err = nl80211_valid_4addr(rdev, NULL, params.use_4addr, type); 2091 err = nl80211_valid_4addr(rdev, NULL, params.use_4addr, type);