Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 111939
b: refs/heads/master
c: 60719ff
h: refs/heads/master
i:
  111937: ceff792
  111935: 625964b
v: v3
  • Loading branch information
Johannes Berg authored and John W. Linville committed Sep 24, 2008
1 parent 8959ac1 commit 83c327b
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 4 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 133b822638ff01eb1e32e1917b197c40ed095ddd
refs/heads/master: 60719ffd721f6764b7d07ca188c0d944a4330b69
6 changes: 4 additions & 2 deletions trunk/include/net/cfg80211.h
Original file line number Diff line number Diff line change
Expand Up @@ -363,11 +363,13 @@ struct wiphy;
* wireless extensions but this is subject to reevaluation as soon as this
* code is used more widely and we have a first user without wext.
*
* @add_virtual_intf: create a new virtual interface with the given name
* @add_virtual_intf: create a new virtual interface with the given name,
* must set the struct wireless_dev's iftype.
*
* @del_virtual_intf: remove the virtual interface determined by ifindex.
*
* @change_virtual_intf: change type of virtual interface
* @change_virtual_intf: change type/configuration of virtual interface,
* keep the struct wireless_dev's iftype updated.
*
* @add_key: add a key with the given parameters. @mac_addr will be %NULL
* when adding a group key.
Expand Down
2 changes: 2 additions & 0 deletions trunk/include/net/wireless.h
Original file line number Diff line number Diff line change
Expand Up @@ -223,9 +223,11 @@ struct wiphy {
* the netdev.)
*
* @wiphy: pointer to hardware description
* @iftype: interface type
*/
struct wireless_dev {
struct wiphy *wiphy;
enum nl80211_iftype iftype;

/* private to the generic wireless code */
struct list_head list;
Expand Down
1 change: 1 addition & 0 deletions trunk/net/mac80211/iface.c
Original file line number Diff line number Diff line change
Expand Up @@ -625,6 +625,7 @@ static void ieee80211_setup_sdata(struct ieee80211_sub_if_data *sdata,
/* and set some type-dependent values */
sdata->vif.type = type;
sdata->dev->hard_start_xmit = ieee80211_subif_start_xmit;
sdata->wdev.iftype = type;

/* only monitor differs */
sdata->dev->type = ARPHRD_ETHER;
Expand Down
2 changes: 2 additions & 0 deletions trunk/net/wireless/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -384,6 +384,8 @@ static int cfg80211_netdev_notifier_call(struct notifier_block * nb,

rdev = wiphy_to_dev(dev->ieee80211_ptr->wiphy);

WARN_ON(dev->ieee80211_ptr->iftype == NL80211_IFTYPE_UNSPECIFIED);

switch (state) {
case NETDEV_REGISTER:
mutex_lock(&rdev->devlist_mtx);
Expand Down
6 changes: 5 additions & 1 deletion trunk/net/wireless/nl80211.c
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ static int nl80211_send_iface(struct sk_buff *msg, u32 pid, u32 seq, int flags,

NLA_PUT_U32(msg, NL80211_ATTR_IFINDEX, dev->ifindex);
NLA_PUT_STRING(msg, NL80211_ATTR_IFNAME, dev->name);
/* TODO: interface type */
NLA_PUT_U32(msg, NL80211_ATTR_IFTYPE, dev->ieee80211_ptr->iftype);
return genlmsg_end(msg, hdr);

nla_put_failure:
Expand Down Expand Up @@ -453,6 +453,10 @@ static int nl80211_set_interface(struct sk_buff *skb, struct genl_info *info)
&flags);
err = drv->ops->change_virtual_intf(&drv->wiphy, ifindex,
type, err ? NULL : &flags, &params);

dev = __dev_get_by_index(&init_net, ifindex);
WARN_ON(!dev || (!err && dev->ieee80211_ptr->iftype != type));

rtnl_unlock();

unlock:
Expand Down

0 comments on commit 83c327b

Please sign in to comment.