aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
Diffstat (limited to 'net')
-rw-r--r--net/mac802154/ieee802154_i.h3
-rw-r--r--net/mac802154/iface.c11
-rw-r--r--net/mac802154/rx.c4
3 files changed, 10 insertions, 8 deletions
diff --git a/net/mac802154/ieee802154_i.h b/net/mac802154/ieee802154_i.h
index 748dc5afe367..931f8516cee6 100644
--- a/net/mac802154/ieee802154_i.h
+++ b/net/mac802154/ieee802154_i.h
@@ -79,7 +79,6 @@ struct ieee802154_sub_if_data {
79 struct ieee802154_local *local; 79 struct ieee802154_local *local;
80 struct net_device *dev; 80 struct net_device *dev;
81 81
82 int type;
83 unsigned long state; 82 unsigned long state;
84 char name[IFNAMSIZ]; 83 char name[IFNAMSIZ];
85 84
@@ -103,6 +102,8 @@ struct ieee802154_sub_if_data {
103 struct mutex sec_mtx; 102 struct mutex sec_mtx;
104 103
105 struct mac802154_llsec sec; 104 struct mac802154_llsec sec;
105 /* must be last, dynamically sized area in this! */
106 struct ieee802154_vif vif;
106}; 107};
107 108
108#define MAC802154_CHAN_NONE 0xff /* No channel is assigned */ 109#define MAC802154_CHAN_NONE 0xff /* No channel is assigned */
diff --git a/net/mac802154/iface.c b/net/mac802154/iface.c
index 2e2638e72ae8..764ce496fdc3 100644
--- a/net/mac802154/iface.c
+++ b/net/mac802154/iface.c
@@ -136,10 +136,11 @@ static int mac802154_slave_open(struct net_device *dev)
136 136
137 ASSERT_RTNL(); 137 ASSERT_RTNL();
138 138
139 if (sdata->type == IEEE802154_DEV_WPAN) { 139 if (sdata->vif.type == IEEE802154_DEV_WPAN) {
140 mutex_lock(&sdata->local->iflist_mtx); 140 mutex_lock(&sdata->local->iflist_mtx);
141 list_for_each_entry(subif, &sdata->local->interfaces, list) { 141 list_for_each_entry(subif, &sdata->local->interfaces, list) {
142 if (subif != sdata && subif->type == sdata->type && 142 if (subif != sdata &&
143 subif->vif.type == sdata->vif.type &&
143 ieee802154_sdata_running(subif)) { 144 ieee802154_sdata_running(subif)) {
144 mutex_unlock(&sdata->local->iflist_mtx); 145 mutex_unlock(&sdata->local->iflist_mtx);
145 return -EBUSY; 146 return -EBUSY;
@@ -397,7 +398,7 @@ static int
397ieee802154_setup_sdata(struct ieee802154_sub_if_data *sdata, int type) 398ieee802154_setup_sdata(struct ieee802154_sub_if_data *sdata, int type)
398{ 399{
399 /* set some type-dependent values */ 400 /* set some type-dependent values */
400 sdata->type = type; 401 sdata->vif.type = type;
401 402
402 get_random_bytes(&sdata->bsn, 1); 403 get_random_bytes(&sdata->bsn, 1);
403 get_random_bytes(&sdata->dsn, 1); 404 get_random_bytes(&sdata->dsn, 1);
@@ -447,8 +448,8 @@ ieee802154_if_add(struct ieee802154_local *local, const char *name,
447 448
448 ASSERT_RTNL(); 449 ASSERT_RTNL();
449 450
450 ndev = alloc_netdev(sizeof(*sdata), name, NET_NAME_UNKNOWN, 451 ndev = alloc_netdev(sizeof(*sdata) + local->hw.vif_data_size, name,
451 ieee802154_if_setup); 452 NET_NAME_UNKNOWN, ieee802154_if_setup);
452 if (!ndev) 453 if (!ndev)
453 return ERR_PTR(-ENOMEM); 454 return ERR_PTR(-ENOMEM);
454 455
diff --git a/net/mac802154/rx.c b/net/mac802154/rx.c
index 95961cccc253..4b54cf33e562 100644
--- a/net/mac802154/rx.c
+++ b/net/mac802154/rx.c
@@ -208,7 +208,7 @@ __ieee802154_rx_handle_packet(struct ieee802154_local *local,
208 } 208 }
209 209
210 list_for_each_entry_rcu(sdata, &local->interfaces, list) { 210 list_for_each_entry_rcu(sdata, &local->interfaces, list) {
211 if (sdata->type != IEEE802154_DEV_WPAN || 211 if (sdata->vif.type != IEEE802154_DEV_WPAN ||
212 !netif_running(sdata->dev)) 212 !netif_running(sdata->dev))
213 continue; 213 continue;
214 214
@@ -233,7 +233,7 @@ ieee802154_monitors_rx(struct ieee802154_local *local, struct sk_buff *skb)
233 skb->protocol = htons(ETH_P_IEEE802154); 233 skb->protocol = htons(ETH_P_IEEE802154);
234 234
235 list_for_each_entry_rcu(sdata, &local->interfaces, list) { 235 list_for_each_entry_rcu(sdata, &local->interfaces, list) {
236 if (sdata->type != IEEE802154_DEV_MONITOR) 236 if (sdata->vif.type != IEEE802154_DEV_MONITOR)
237 continue; 237 continue;
238 238
239 if (!ieee802154_sdata_running(sdata)) 239 if (!ieee802154_sdata_running(sdata))