diff options
-rw-r--r-- | drivers/staging/cw1200/ap.c | 32 | ||||
-rw-r--r-- | drivers/staging/cw1200/wsm.h | 9 |
2 files changed, 36 insertions, 5 deletions
diff --git a/drivers/staging/cw1200/ap.c b/drivers/staging/cw1200/ap.c index edcd4af885a..908725ab5fe 100644 --- a/drivers/staging/cw1200/ap.c +++ b/drivers/staging/cw1200/ap.c @@ -163,7 +163,37 @@ void cw1200_bss_info_changed(struct ieee80211_hw *dev, } /* TODO: BSS_CHANGED_IBSS */ - /* TODO: BSS_CHANGED_ARP_FILTER */ + + if (changed & BSS_CHANGED_ARP_FILTER) { + struct wsm_arp_ipv4_filter filter = {0}; + int i; + + ap_printk(KERN_DEBUG "[STA] BSS_CHANGED_ARP_FILTER " + "enabled: %d, cnt: %d\n", + info->arp_filter_enabled, + info->arp_addr_cnt); + + if (info->arp_filter_enabled) + filter.enable = __cpu_to_le32(1); + + /* Currently only one IP address is supported by firmware. + * In case of more IPs arp filtering will be disabled. */ + if (info->arp_addr_cnt > 0 && + info->arp_addr_cnt <= WSM_MAX_ARP_IP_ADDRTABLE_ENTRIES) { + for(i=0; i<info->arp_addr_cnt;i++) { + filter.ipv4Address[i] = info->arp_addr_list[i]; + ap_printk(KERN_DEBUG "[STA] addr[%d]: 0x%X\n", + i, filter.ipv4Address[i]); + } + } else + filter.enable = 0; + + ap_printk(KERN_DEBUG "[STA] arp ip filter enable: %d\n", + __le32_to_cpu(filter.enable)); + + if (wsm_set_arp_ipv4_filter(priv, &filter)) + WARN_ON(1); + } if (changed & BSS_CHANGED_BEACON_ENABLED) priv->enable_beacon = info->enable_beacon; diff --git a/drivers/staging/cw1200/wsm.h b/drivers/staging/cw1200/wsm.h index 76b9253fa94..97989a01f1c 100644 --- a/drivers/staging/cw1200/wsm.h +++ b/drivers/staging/cw1200/wsm.h @@ -374,6 +374,7 @@ struct cw1200_common; /* 4.10 ArpIpAddressesTable */ #define WSM_MIB_ID_ARP_IP_ADDRESSES_TABLE 0x1001 +#define WSM_MAX_ARP_IP_ADDRTABLE_ENTRIES 1 /* 4.11 TemplateFrame */ #define WSM_MIB_ID_TEMPLATE_FRAME 0x1002 @@ -1471,13 +1472,13 @@ static inline int wsm_set_multicast_filter(struct cw1200_common *priv, } /* IPv4 filtering - 4.10 */ -struct wsm_ipv4_filter { +struct wsm_arp_ipv4_filter { __le32 enable; - u8 ipv4Address[4]; + __be32 ipv4Address[WSM_MAX_ARP_IP_ADDRTABLE_ENTRIES]; } __packed; -static inline int wsm_set_ipv4_arp_filter(struct cw1200_common *priv, - struct wsm_ipv4_filter *fp) +static inline int wsm_set_arp_ipv4_filter(struct cw1200_common *priv, + struct wsm_arp_ipv4_filter *fp) { return wsm_write_mib(priv, WSM_MIB_ID_ARP_IP_ADDRESSES_TABLE, fp, sizeof(*fp)); |