aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
Diffstat (limited to 'net')
-rw-r--r--net/mac802154/ieee802154_i.h1
-rw-r--r--net/mac802154/iface.c12
2 files changed, 12 insertions, 1 deletions
diff --git a/net/mac802154/ieee802154_i.h b/net/mac802154/ieee802154_i.h
index 7cebc9844c00..1086a9d96f8f 100644
--- a/net/mac802154/ieee802154_i.h
+++ b/net/mac802154/ieee802154_i.h
@@ -84,6 +84,7 @@ struct ieee802154_sub_if_data {
84 __le16 pan_id; 84 __le16 pan_id;
85 __le16 short_addr; 85 __le16 short_addr;
86 __le64 extended_addr; 86 __le64 extended_addr;
87 bool promisuous_mode;
87 88
88 struct ieee802154_mac_params mac_params; 89 struct ieee802154_mac_params mac_params;
89 90
diff --git a/net/mac802154/iface.c b/net/mac802154/iface.c
index c0bf5f9b9953..f7a6f83301e2 100644
--- a/net/mac802154/iface.c
+++ b/net/mac802154/iface.c
@@ -196,6 +196,12 @@ static int mac802154_wpan_open(struct net_device *dev)
196 196
197 mutex_lock(&phy->pib_lock); 197 mutex_lock(&phy->pib_lock);
198 198
199 if (local->hw.flags & IEEE802154_HW_PROMISCUOUS) {
200 rc = drv_set_promiscuous_mode(local, sdata->promisuous_mode);
201 if (rc < 0)
202 goto out;
203 }
204
199 if (local->hw.flags & IEEE802154_HW_TXPOWER) { 205 if (local->hw.flags & IEEE802154_HW_TXPOWER) {
200 rc = drv_set_tx_power(local, sdata->mac_params.transmit_power); 206 rc = drv_set_tx_power(local, sdata->mac_params.transmit_power);
201 if (rc < 0) 207 if (rc < 0)
@@ -382,7 +388,7 @@ static const struct net_device_ops mac802154_wpan_ops = {
382}; 388};
383 389
384static const struct net_device_ops mac802154_monitor_ops = { 390static const struct net_device_ops mac802154_monitor_ops = {
385 .ndo_open = mac802154_slave_open, 391 .ndo_open = mac802154_wpan_open,
386 .ndo_stop = mac802154_slave_close, 392 .ndo_stop = mac802154_slave_close,
387 .ndo_start_xmit = ieee802154_monitor_start_xmit, 393 .ndo_start_xmit = ieee802154_monitor_start_xmit,
388}; 394};
@@ -434,6 +440,8 @@ void mac802154_wpan_setup(struct net_device *dev)
434 sdata->pan_id = cpu_to_le16(IEEE802154_PANID_BROADCAST); 440 sdata->pan_id = cpu_to_le16(IEEE802154_PANID_BROADCAST);
435 sdata->short_addr = cpu_to_le16(IEEE802154_ADDR_BROADCAST); 441 sdata->short_addr = cpu_to_le16(IEEE802154_ADDR_BROADCAST);
436 442
443 sdata->promisuous_mode = false;
444
437 mac802154_llsec_init(&sdata->sec); 445 mac802154_llsec_init(&sdata->sec);
438} 446}
439 447
@@ -453,4 +461,6 @@ void mac802154_monitor_setup(struct net_device *dev)
453 461
454 sdata = IEEE802154_DEV_TO_SUB_IF(dev); 462 sdata = IEEE802154_DEV_TO_SUB_IF(dev);
455 sdata->type = IEEE802154_DEV_MONITOR; 463 sdata->type = IEEE802154_DEV_MONITOR;
464
465 sdata->promisuous_mode = true;
456} 466}