aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2013-01-14 10:39:07 -0500
committerJohannes Berg <johannes.berg@intel.com>2013-01-18 15:20:34 -0500
commit0f19b41e223d787251c59137e61fc5145c13d1c4 (patch)
tree32715057d43ecb8a35b36f97320225f12094de70 /net/mac80211
parentde5fad815703b5b24bc4726cd71422929537d259 (diff)
mac80211: remove ARP filter enable/disable logic
Depending on the driver, having ARP filtering for some addresses may be possible. Remove the logic that tracks whether ARP filter is enabled or not and give the driver the total number of addresses instead of the length of the list so it can make its own decision. Reviewed-by: Luciano Coelho <coelho@ti.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/mac80211')
-rw-r--r--net/mac80211/ieee80211_i.h2
-rw-r--r--net/mac80211/iface.c3
-rw-r--r--net/mac80211/main.c16
-rw-r--r--net/mac80211/mlme.c8
-rw-r--r--net/mac80211/trace.h13
5 files changed, 15 insertions, 27 deletions
diff --git a/net/mac80211/ieee80211_i.h b/net/mac80211/ieee80211_i.h
index 0fa44a965ad9..b1fed5491ed6 100644
--- a/net/mac80211/ieee80211_i.h
+++ b/net/mac80211/ieee80211_i.h
@@ -747,8 +747,6 @@ struct ieee80211_sub_if_data {
747 struct work_struct work; 747 struct work_struct work;
748 struct sk_buff_head skb_queue; 748 struct sk_buff_head skb_queue;
749 749
750 bool arp_filter_state;
751
752 u8 needed_rx_chains; 750 u8 needed_rx_chains;
753 enum ieee80211_smps_mode smps_mode; 751 enum ieee80211_smps_mode smps_mode;
754 752
diff --git a/net/mac80211/iface.c b/net/mac80211/iface.c
index 06fac2991d40..0a36dc6346bb 100644
--- a/net/mac80211/iface.c
+++ b/net/mac80211/iface.c
@@ -1574,9 +1574,6 @@ int ieee80211_if_add(struct ieee80211_local *local, const char *name,
1574 /* initialise type-independent data */ 1574 /* initialise type-independent data */
1575 sdata->wdev.wiphy = local->hw.wiphy; 1575 sdata->wdev.wiphy = local->hw.wiphy;
1576 sdata->local = local; 1576 sdata->local = local;
1577#ifdef CONFIG_INET
1578 sdata->arp_filter_state = true;
1579#endif
1580 1577
1581 for (i = 0; i < IEEE80211_FRAGMENT_MAX; i++) 1578 for (i = 0; i < IEEE80211_FRAGMENT_MAX; i++)
1582 skb_queue_head_init(&sdata->fragments[i].skb_list); 1579 skb_queue_head_init(&sdata->fragments[i].skb_list);
diff --git a/net/mac80211/main.c b/net/mac80211/main.c
index 39cfe8f10ad2..baf9720c1876 100644
--- a/net/mac80211/main.c
+++ b/net/mac80211/main.c
@@ -349,27 +349,19 @@ static int ieee80211_ifa_changed(struct notifier_block *nb,
349 349
350 /* Copy the addresses to the bss_conf list */ 350 /* Copy the addresses to the bss_conf list */
351 ifa = idev->ifa_list; 351 ifa = idev->ifa_list;
352 while (c < IEEE80211_BSS_ARP_ADDR_LIST_LEN && ifa) { 352 while (ifa) {
353 bss_conf->arp_addr_list[c] = ifa->ifa_address; 353 if (c < IEEE80211_BSS_ARP_ADDR_LIST_LEN)
354 bss_conf->arp_addr_list[c] = ifa->ifa_address;
354 ifa = ifa->ifa_next; 355 ifa = ifa->ifa_next;
355 c++; 356 c++;
356 } 357 }
357 358
358 /* If not all addresses fit the list, disable filtering */
359 if (ifa) {
360 sdata->arp_filter_state = false;
361 c = 0;
362 } else {
363 sdata->arp_filter_state = true;
364 }
365 bss_conf->arp_addr_cnt = c; 359 bss_conf->arp_addr_cnt = c;
366 360
367 /* Configure driver only if associated (which also implies it is up) */ 361 /* Configure driver only if associated (which also implies it is up) */
368 if (ifmgd->associated) { 362 if (ifmgd->associated)
369 bss_conf->arp_filter_enabled = sdata->arp_filter_state;
370 ieee80211_bss_info_change_notify(sdata, 363 ieee80211_bss_info_change_notify(sdata,
371 BSS_CHANGED_ARP_FILTER); 364 BSS_CHANGED_ARP_FILTER);
372 }
373 365
374 mutex_unlock(&ifmgd->mtx); 366 mutex_unlock(&ifmgd->mtx);
375 367
diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c
index e930175771ff..2d9ef20cd38d 100644
--- a/net/mac80211/mlme.c
+++ b/net/mac80211/mlme.c
@@ -1465,10 +1465,8 @@ static void ieee80211_set_associated(struct ieee80211_sub_if_data *sdata,
1465 bss_info_changed |= BSS_CHANGED_CQM; 1465 bss_info_changed |= BSS_CHANGED_CQM;
1466 1466
1467 /* Enable ARP filtering */ 1467 /* Enable ARP filtering */
1468 if (bss_conf->arp_filter_enabled != sdata->arp_filter_state) { 1468 if (bss_conf->arp_addr_cnt)
1469 bss_conf->arp_filter_enabled = sdata->arp_filter_state;
1470 bss_info_changed |= BSS_CHANGED_ARP_FILTER; 1469 bss_info_changed |= BSS_CHANGED_ARP_FILTER;
1471 }
1472 1470
1473 ieee80211_bss_info_change_notify(sdata, bss_info_changed); 1471 ieee80211_bss_info_change_notify(sdata, bss_info_changed);
1474 1472
@@ -1582,10 +1580,8 @@ static void ieee80211_set_disassoc(struct ieee80211_sub_if_data *sdata,
1582 cancel_work_sync(&local->dynamic_ps_enable_work); 1580 cancel_work_sync(&local->dynamic_ps_enable_work);
1583 1581
1584 /* Disable ARP filtering */ 1582 /* Disable ARP filtering */
1585 if (sdata->vif.bss_conf.arp_filter_enabled) { 1583 if (sdata->vif.bss_conf.arp_addr_cnt)
1586 sdata->vif.bss_conf.arp_filter_enabled = false;
1587 changed |= BSS_CHANGED_ARP_FILTER; 1584 changed |= BSS_CHANGED_ARP_FILTER;
1588 }
1589 1585
1590 sdata->vif.bss_conf.qos = false; 1586 sdata->vif.bss_conf.qos = false;
1591 changed |= BSS_CHANGED_QOS; 1587 changed |= BSS_CHANGED_QOS;
diff --git a/net/mac80211/trace.h b/net/mac80211/trace.h
index 9341b9359b66..e9f95913c6f0 100644
--- a/net/mac80211/trace.h
+++ b/net/mac80211/trace.h
@@ -347,8 +347,11 @@ TRACE_EVENT(drv_bss_info_changed,
347 __field(s32, cqm_rssi_hyst); 347 __field(s32, cqm_rssi_hyst);
348 __field(u32, channel_width); 348 __field(u32, channel_width);
349 __field(u32, channel_cfreq1); 349 __field(u32, channel_cfreq1);
350 __dynamic_array(u32, arp_addr_list, info->arp_addr_cnt); 350 __dynamic_array(u32, arp_addr_list,
351 __field(bool, arp_filter_enabled); 351 info->arp_addr_cnt > IEEE80211_BSS_ARP_ADDR_LIST_LEN ?
352 IEEE80211_BSS_ARP_ADDR_LIST_LEN :
353 info->arp_addr_cnt);
354 __field(int, arp_addr_cnt);
352 __field(bool, qos); 355 __field(bool, qos);
353 __field(bool, idle); 356 __field(bool, idle);
354 __field(bool, ps); 357 __field(bool, ps);
@@ -384,9 +387,11 @@ TRACE_EVENT(drv_bss_info_changed,
384 __entry->cqm_rssi_hyst = info->cqm_rssi_hyst; 387 __entry->cqm_rssi_hyst = info->cqm_rssi_hyst;
385 __entry->channel_width = info->chandef.width; 388 __entry->channel_width = info->chandef.width;
386 __entry->channel_cfreq1 = info->chandef.center_freq1; 389 __entry->channel_cfreq1 = info->chandef.center_freq1;
390 __entry->arp_addr_cnt = info->arp_addr_cnt;
387 memcpy(__get_dynamic_array(arp_addr_list), info->arp_addr_list, 391 memcpy(__get_dynamic_array(arp_addr_list), info->arp_addr_list,
388 sizeof(u32) * info->arp_addr_cnt); 392 sizeof(u32) * (info->arp_addr_cnt > IEEE80211_BSS_ARP_ADDR_LIST_LEN ?
389 __entry->arp_filter_enabled = info->arp_filter_enabled; 393 IEEE80211_BSS_ARP_ADDR_LIST_LEN :
394 info->arp_addr_cnt));
390 __entry->qos = info->qos; 395 __entry->qos = info->qos;
391 __entry->idle = info->idle; 396 __entry->idle = info->idle;
392 __entry->ps = info->ps; 397 __entry->ps = info->ps;