aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211/rx.c
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2014-01-07 10:23:24 -0500
committerJohannes Berg <johannes.berg@intel.com>2014-01-07 10:23:24 -0500
commit3c2723f503e8decc420b377a3215089a7980cf08 (patch)
treebe12ca0fa6b1b296857a2ce307af6dce4e711293 /net/mac80211/rx.c
parent40791942ec6befaad04073ed97adb8ab04ab43f3 (diff)
mac80211: clean up prepare_for_handlers() return value
Using an int with 0/1 is not very common, make the function return a bool instead with the same values (false/true). Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/mac80211/rx.c')
-rw-r--r--net/mac80211/rx.c36
1 files changed, 18 insertions, 18 deletions
diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c
index 8cb20d7ff637..c24ca0d0f469 100644
--- a/net/mac80211/rx.c
+++ b/net/mac80211/rx.c
@@ -3076,8 +3076,8 @@ void ieee80211_release_reorder_timeout(struct sta_info *sta, int tid)
3076 3076
3077/* main receive path */ 3077/* main receive path */
3078 3078
3079static int prepare_for_handlers(struct ieee80211_rx_data *rx, 3079static bool prepare_for_handlers(struct ieee80211_rx_data *rx,
3080 struct ieee80211_hdr *hdr) 3080 struct ieee80211_hdr *hdr)
3081{ 3081{
3082 struct ieee80211_sub_if_data *sdata = rx->sdata; 3082 struct ieee80211_sub_if_data *sdata = rx->sdata;
3083 struct sk_buff *skb = rx->skb; 3083 struct sk_buff *skb = rx->skb;
@@ -3088,29 +3088,29 @@ static int prepare_for_handlers(struct ieee80211_rx_data *rx,
3088 switch (sdata->vif.type) { 3088 switch (sdata->vif.type) {
3089 case NL80211_IFTYPE_STATION: 3089 case NL80211_IFTYPE_STATION:
3090 if (!bssid && !sdata->u.mgd.use_4addr) 3090 if (!bssid && !sdata->u.mgd.use_4addr)
3091 return 0; 3091 return false;
3092 if (!multicast && 3092 if (!multicast &&
3093 !ether_addr_equal(sdata->vif.addr, hdr->addr1)) { 3093 !ether_addr_equal(sdata->vif.addr, hdr->addr1)) {
3094 if (!(sdata->dev->flags & IFF_PROMISC) || 3094 if (!(sdata->dev->flags & IFF_PROMISC) ||
3095 sdata->u.mgd.use_4addr) 3095 sdata->u.mgd.use_4addr)
3096 return 0; 3096 return false;
3097 status->rx_flags &= ~IEEE80211_RX_RA_MATCH; 3097 status->rx_flags &= ~IEEE80211_RX_RA_MATCH;
3098 } 3098 }
3099 break; 3099 break;
3100 case NL80211_IFTYPE_ADHOC: 3100 case NL80211_IFTYPE_ADHOC:
3101 if (!bssid) 3101 if (!bssid)
3102 return 0; 3102 return false;
3103 if (ether_addr_equal(sdata->vif.addr, hdr->addr2) || 3103 if (ether_addr_equal(sdata->vif.addr, hdr->addr2) ||
3104 ether_addr_equal(sdata->u.ibss.bssid, hdr->addr2)) 3104 ether_addr_equal(sdata->u.ibss.bssid, hdr->addr2))
3105 return 0; 3105 return false;
3106 if (ieee80211_is_beacon(hdr->frame_control)) { 3106 if (ieee80211_is_beacon(hdr->frame_control)) {
3107 return 1; 3107 return true;
3108 } else if (!ieee80211_bssid_match(bssid, sdata->u.ibss.bssid)) { 3108 } else if (!ieee80211_bssid_match(bssid, sdata->u.ibss.bssid)) {
3109 return 0; 3109 return false;
3110 } else if (!multicast && 3110 } else if (!multicast &&
3111 !ether_addr_equal(sdata->vif.addr, hdr->addr1)) { 3111 !ether_addr_equal(sdata->vif.addr, hdr->addr1)) {
3112 if (!(sdata->dev->flags & IFF_PROMISC)) 3112 if (!(sdata->dev->flags & IFF_PROMISC))
3113 return 0; 3113 return false;
3114 status->rx_flags &= ~IEEE80211_RX_RA_MATCH; 3114 status->rx_flags &= ~IEEE80211_RX_RA_MATCH;
3115 } else if (!rx->sta) { 3115 } else if (!rx->sta) {
3116 int rate_idx; 3116 int rate_idx;
@@ -3126,7 +3126,7 @@ static int prepare_for_handlers(struct ieee80211_rx_data *rx,
3126 if (!multicast && 3126 if (!multicast &&
3127 !ether_addr_equal(sdata->vif.addr, hdr->addr1)) { 3127 !ether_addr_equal(sdata->vif.addr, hdr->addr1)) {
3128 if (!(sdata->dev->flags & IFF_PROMISC)) 3128 if (!(sdata->dev->flags & IFF_PROMISC))
3129 return 0; 3129 return false;
3130 3130
3131 status->rx_flags &= ~IEEE80211_RX_RA_MATCH; 3131 status->rx_flags &= ~IEEE80211_RX_RA_MATCH;
3132 } 3132 }
@@ -3135,7 +3135,7 @@ static int prepare_for_handlers(struct ieee80211_rx_data *rx,
3135 case NL80211_IFTYPE_AP: 3135 case NL80211_IFTYPE_AP:
3136 if (!bssid) { 3136 if (!bssid) {
3137 if (!ether_addr_equal(sdata->vif.addr, hdr->addr1)) 3137 if (!ether_addr_equal(sdata->vif.addr, hdr->addr1))
3138 return 0; 3138 return false;
3139 } else if (!ieee80211_bssid_match(bssid, sdata->vif.addr)) { 3139 } else if (!ieee80211_bssid_match(bssid, sdata->vif.addr)) {
3140 /* 3140 /*
3141 * Accept public action frames even when the 3141 * Accept public action frames even when the
@@ -3145,26 +3145,26 @@ static int prepare_for_handlers(struct ieee80211_rx_data *rx,
3145 */ 3145 */
3146 if (!multicast && 3146 if (!multicast &&
3147 !ether_addr_equal(sdata->vif.addr, hdr->addr1)) 3147 !ether_addr_equal(sdata->vif.addr, hdr->addr1))
3148 return 0; 3148 return false;
3149 if (ieee80211_is_public_action(hdr, skb->len)) 3149 if (ieee80211_is_public_action(hdr, skb->len))
3150 return 1; 3150 return true;
3151 if (!ieee80211_is_beacon(hdr->frame_control)) 3151 if (!ieee80211_is_beacon(hdr->frame_control))
3152 return 0; 3152 return false;
3153 status->rx_flags &= ~IEEE80211_RX_RA_MATCH; 3153 status->rx_flags &= ~IEEE80211_RX_RA_MATCH;
3154 } 3154 }
3155 break; 3155 break;
3156 case NL80211_IFTYPE_WDS: 3156 case NL80211_IFTYPE_WDS:
3157 if (bssid || !ieee80211_is_data(hdr->frame_control)) 3157 if (bssid || !ieee80211_is_data(hdr->frame_control))
3158 return 0; 3158 return false;
3159 if (!ether_addr_equal(sdata->u.wds.remote_addr, hdr->addr2)) 3159 if (!ether_addr_equal(sdata->u.wds.remote_addr, hdr->addr2))
3160 return 0; 3160 return false;
3161 break; 3161 break;
3162 case NL80211_IFTYPE_P2P_DEVICE: 3162 case NL80211_IFTYPE_P2P_DEVICE:
3163 if (!ieee80211_is_public_action(hdr, skb->len) && 3163 if (!ieee80211_is_public_action(hdr, skb->len) &&
3164 !ieee80211_is_probe_req(hdr->frame_control) && 3164 !ieee80211_is_probe_req(hdr->frame_control) &&
3165 !ieee80211_is_probe_resp(hdr->frame_control) && 3165 !ieee80211_is_probe_resp(hdr->frame_control) &&
3166 !ieee80211_is_beacon(hdr->frame_control)) 3166 !ieee80211_is_beacon(hdr->frame_control))
3167 return 0; 3167 return false;
3168 if (!ether_addr_equal(sdata->vif.addr, hdr->addr1) && 3168 if (!ether_addr_equal(sdata->vif.addr, hdr->addr1) &&
3169 !multicast) 3169 !multicast)
3170 status->rx_flags &= ~IEEE80211_RX_RA_MATCH; 3170 status->rx_flags &= ~IEEE80211_RX_RA_MATCH;
@@ -3175,7 +3175,7 @@ static int prepare_for_handlers(struct ieee80211_rx_data *rx,
3175 break; 3175 break;
3176 } 3176 }
3177 3177
3178 return 1; 3178 return true;
3179} 3179}
3180 3180
3181/* 3181/*