aboutsummaryrefslogtreecommitdiffstats
path: root/net/wireless/nl80211.c
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2012-06-27 03:23:48 -0400
committerJohannes Berg <johannes.berg@intel.com>2012-06-27 11:55:11 -0400
commitdfb89c56add259b72a9c68d6b2846c1cd8c4e4b6 (patch)
tree02a9c8a2995cb7f13b4461837cdf1e14648b1afb /net/wireless/nl80211.c
parentcc45ae547b960b805ee0b201b3807e93a0060472 (diff)
cfg80211: don't allow WoWLAN support without CONFIG_PM
When CONFIG_PM is disabled, no device can possibly support WoWLAN since it can't go to sleep to start with. Due to this, mac80211 had even rejected the hardware registration. By making all the code and data for WoWLAN depend on CONFIG_PM we can promote this runtime error to a compile-time error. Add #ifdef around all WoWLAN code to remove it in systems that don't need it as they never suspend. Cc: Kalle Valo <kvalo@qca.qualcomm.com> Acked-by: Luciano Coelho <coelho@ti.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/wireless/nl80211.c')
-rw-r--r--net/wireless/nl80211.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
index 234ff3bbd104..067c9fe02a7f 100644
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -1112,6 +1112,7 @@ static int nl80211_send_wiphy(struct sk_buff *msg, u32 pid, u32 seq, int flags,
1112 nla_nest_end(msg, nl_ifs); 1112 nla_nest_end(msg, nl_ifs);
1113 } 1113 }
1114 1114
1115#ifdef CONFIG_PM
1115 if (dev->wiphy.wowlan.flags || dev->wiphy.wowlan.n_patterns) { 1116 if (dev->wiphy.wowlan.flags || dev->wiphy.wowlan.n_patterns) {
1116 struct nlattr *nl_wowlan; 1117 struct nlattr *nl_wowlan;
1117 1118
@@ -1152,6 +1153,7 @@ static int nl80211_send_wiphy(struct sk_buff *msg, u32 pid, u32 seq, int flags,
1152 1153
1153 nla_nest_end(msg, nl_wowlan); 1154 nla_nest_end(msg, nl_wowlan);
1154 } 1155 }
1156#endif
1155 1157
1156 if (nl80211_put_iftypes(msg, NL80211_ATTR_SOFTWARE_IFTYPES, 1158 if (nl80211_put_iftypes(msg, NL80211_ATTR_SOFTWARE_IFTYPES,
1157 dev->wiphy.software_iftypes)) 1159 dev->wiphy.software_iftypes))
@@ -6276,6 +6278,7 @@ static int nl80211_leave_mesh(struct sk_buff *skb, struct genl_info *info)
6276 return cfg80211_leave_mesh(rdev, dev); 6278 return cfg80211_leave_mesh(rdev, dev);
6277} 6279}
6278 6280
6281#ifdef CONFIG_PM
6279static int nl80211_get_wowlan(struct sk_buff *skb, struct genl_info *info) 6282static int nl80211_get_wowlan(struct sk_buff *skb, struct genl_info *info)
6280{ 6283{
6281 struct cfg80211_registered_device *rdev = info->user_ptr[0]; 6284 struct cfg80211_registered_device *rdev = info->user_ptr[0];
@@ -6504,6 +6507,7 @@ static int nl80211_set_wowlan(struct sk_buff *skb, struct genl_info *info)
6504 kfree(new_triggers.patterns); 6507 kfree(new_triggers.patterns);
6505 return err; 6508 return err;
6506} 6509}
6510#endif
6507 6511
6508static int nl80211_set_rekey_data(struct sk_buff *skb, struct genl_info *info) 6512static int nl80211_set_rekey_data(struct sk_buff *skb, struct genl_info *info)
6509{ 6513{
@@ -7158,6 +7162,7 @@ static struct genl_ops nl80211_ops[] = {
7158 .internal_flags = NL80211_FLAG_NEED_NETDEV_UP | 7162 .internal_flags = NL80211_FLAG_NEED_NETDEV_UP |
7159 NL80211_FLAG_NEED_RTNL, 7163 NL80211_FLAG_NEED_RTNL,
7160 }, 7164 },
7165#ifdef CONFIG_PM
7161 { 7166 {
7162 .cmd = NL80211_CMD_GET_WOWLAN, 7167 .cmd = NL80211_CMD_GET_WOWLAN,
7163 .doit = nl80211_get_wowlan, 7168 .doit = nl80211_get_wowlan,
@@ -7174,6 +7179,7 @@ static struct genl_ops nl80211_ops[] = {
7174 .internal_flags = NL80211_FLAG_NEED_WIPHY | 7179 .internal_flags = NL80211_FLAG_NEED_WIPHY |
7175 NL80211_FLAG_NEED_RTNL, 7180 NL80211_FLAG_NEED_RTNL,
7176 }, 7181 },
7182#endif
7177 { 7183 {
7178 .cmd = NL80211_CMD_SET_REKEY_OFFLOAD, 7184 .cmd = NL80211_CMD_SET_REKEY_OFFLOAD,
7179 .doit = nl80211_set_rekey_data, 7185 .doit = nl80211_set_rekey_data,