aboutsummaryrefslogtreecommitdiffstats
path: root/include/net/ieee802154_netdev.h
diff options
context:
space:
mode:
authorWerner Almesberger <werner@almesberger.net>2013-04-04 02:32:35 -0400
committerDavid S. Miller <davem@davemloft.net>2013-04-08 12:00:16 -0400
commit56aa091d60a63fee83d2c894edb69b7c159966c7 (patch)
treedc831be70fe1bbb665da2c97ba57d6e5ce509e84 /include/net/ieee802154_netdev.h
parentd87c8c6d1562f12df101c5b9857170d110e7353a (diff)
ieee802154/nl-mac.c: make some MLME operations optional
Check for NULL before calling the following operations from "struct ieee802154_mlme_ops": assoc_req, assoc_resp, disassoc_req, start_req, and scan_req. This fixes a current oops where those functions are called but not implemented. It also updates the documentation to clarify that they are now optional by design. If a call to an unimplemented function is attempted, the kernel returns EOPNOTSUPP via netlink. The following operations are still required: get_phy, get_pan_id, get_short_addr, and get_dsn. Note that the places where this patch changes the initialization of "ret" should not affect the rest of the code since "ret" was always set (again) before returning its value. Signed-off-by: Werner Almesberger <werner@almesberger.net> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net/ieee802154_netdev.h')
-rw-r--r--include/net/ieee802154_netdev.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/include/net/ieee802154_netdev.h b/include/net/ieee802154_netdev.h
index 642f94c0fa2f..8196d5d40359 100644
--- a/include/net/ieee802154_netdev.h
+++ b/include/net/ieee802154_netdev.h
@@ -85,6 +85,8 @@ struct wpan_phy;
85 * Use wpan_wpy_put to put that reference. 85 * Use wpan_wpy_put to put that reference.
86 */ 86 */
87struct ieee802154_mlme_ops { 87struct ieee802154_mlme_ops {
88 /* The following fields are optional (can be NULL). */
89
88 int (*assoc_req)(struct net_device *dev, 90 int (*assoc_req)(struct net_device *dev,
89 struct ieee802154_addr *addr, 91 struct ieee802154_addr *addr,
90 u8 channel, u8 page, u8 cap); 92 u8 channel, u8 page, u8 cap);
@@ -101,6 +103,8 @@ struct ieee802154_mlme_ops {
101 int (*scan_req)(struct net_device *dev, 103 int (*scan_req)(struct net_device *dev,
102 u8 type, u32 channels, u8 page, u8 duration); 104 u8 type, u32 channels, u8 page, u8 duration);
103 105
106 /* The fields below are required. */
107
104 struct wpan_phy *(*get_phy)(const struct net_device *dev); 108 struct wpan_phy *(*get_phy)(const struct net_device *dev);
105 109
106 /* 110 /*