Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 203520
b: refs/heads/master
c: ca52a5e
h: refs/heads/master
v: v3
  • Loading branch information
Juuso Oikarinen authored and John W. Linville committed Jul 8, 2010
1 parent d7b61be commit 5fa32d9
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 55 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: e6b190ff3c2f4e4859502c41fa17b5c595e82000
refs/heads/master: ca52a5ebbb7caff2995214a6ca41a36c5210b0bd
10 changes: 5 additions & 5 deletions trunk/drivers/net/wireless/wl12xx/wl1271_acx.c
Original file line number Diff line number Diff line change
Expand Up @@ -1075,12 +1075,12 @@ int wl1271_acx_bet_enable(struct wl1271 *wl, bool enable)
return ret;
}

int wl1271_acx_arp_ip_filter(struct wl1271 *wl, u8 mode, u8 *address)
int wl1271_acx_arp_ip_filter(struct wl1271 *wl, bool enable, __be32 address)
{
struct wl1271_acx_arp_filter *acx;
int ret;

wl1271_debug(DEBUG_ACX, "acx arp ip filter, mode: %d", mode);
wl1271_debug(DEBUG_ACX, "acx arp ip filter, enable: %d", enable);

acx = kzalloc(sizeof(*acx), GFP_KERNEL);
if (!acx) {
Expand All @@ -1089,10 +1089,10 @@ int wl1271_acx_arp_ip_filter(struct wl1271 *wl, u8 mode, u8 *address)
}

acx->version = ACX_IPV4_VERSION;
acx->enable = mode;
acx->enable = enable;

if (mode != ACX_ARP_DISABLE)
memcpy(acx->address, address, ACX_IPV4_ADDR_SIZE);
if (enable == true)
memcpy(acx->address, &address, ACX_IPV4_ADDR_SIZE);

ret = wl1271_cmd_configure(wl, ACX_ARP_IP_FILTER,
acx, sizeof(*acx));
Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/net/wireless/wl12xx/wl1271_acx.h
Original file line number Diff line number Diff line change
Expand Up @@ -1117,7 +1117,7 @@ int wl1271_acx_init_mem_config(struct wl1271 *wl);
int wl1271_acx_init_rx_interrupt(struct wl1271 *wl);
int wl1271_acx_smart_reflex(struct wl1271 *wl);
int wl1271_acx_bet_enable(struct wl1271 *wl, bool enable);
int wl1271_acx_arp_ip_filter(struct wl1271 *wl, u8 mode, u8 *address);
int wl1271_acx_arp_ip_filter(struct wl1271 *wl, bool enable, __be32 address);
int wl1271_acx_pm_config(struct wl1271 *wl);
int wl1271_acx_keep_alive_mode(struct wl1271 *wl, bool enable);
int wl1271_acx_keep_alive_config(struct wl1271 *wl, u8 index, u8 tpl_valid);
Expand Down
61 changes: 13 additions & 48 deletions trunk/drivers/net/wireless/wl12xx/wl1271_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1312,53 +1312,6 @@ struct wl1271_filter_params {
u8 mc_list[ACX_MC_ADDRESS_GROUP_MAX][ETH_ALEN];
};

static int wl1271_op_configure_arp_filter(struct ieee80211_hw *hw,
struct ieee80211_vif *vif,
struct in_ifaddr *ifa_list)
{
struct wl1271 *wl = hw->priv;
int ret = 0;

WARN_ON(vif != wl->vif);

/* disable filtering if there are multiple addresses */
if (ifa_list && ifa_list->ifa_next)
ifa_list = NULL;

mutex_lock(&wl->mutex);

if (wl->state == WL1271_STATE_OFF)
goto out;

WARN_ON(wl->bss_type != BSS_TYPE_STA_BSS);

ret = wl1271_ps_elp_wakeup(wl, false);
if (ret < 0)
goto out;

if (ifa_list) {
ret = wl1271_cmd_build_arp_reply(wl, &ifa_list->ifa_address);
if (ret < 0)
goto out_sleep;
ret = wl1271_acx_arp_ip_filter(wl, ACX_ARP_FILTER_AND_REPLY,
(u8 *)&ifa_list->ifa_address);
if (ret < 0)
goto out_sleep;
} else {
ret = wl1271_acx_arp_ip_filter(wl, ACX_ARP_DISABLE, NULL);
if (ret < 0)
goto out_sleep;
}

out_sleep:
wl1271_ps_elp_sleep(wl);

out:
mutex_unlock(&wl->mutex);

return ret;
}

static u64 wl1271_op_prepare_multicast(struct ieee80211_hw *hw,
struct netdev_hw_addr_list *mc_list)
{
Expand Down Expand Up @@ -1869,6 +1822,19 @@ static void wl1271_op_bss_info_changed(struct ieee80211_hw *hw,
}
}

if (changed & BSS_CHANGED_ARP_FILTER) {
__be32 addr = bss_conf->arp_addr_list[0];
WARN_ON(wl->bss_type != BSS_TYPE_STA_BSS);

if (bss_conf->arp_addr_cnt == 1 && bss_conf->arp_filter_enabled)
ret = wl1271_acx_arp_ip_filter(wl, true, addr);
else
ret = wl1271_acx_arp_ip_filter(wl, false, addr);

if (ret < 0)
goto out_sleep;
}

if (do_join) {
ret = wl1271_join(wl, set_assoc);
if (ret < 0) {
Expand Down Expand Up @@ -2174,7 +2140,6 @@ static const struct ieee80211_ops wl1271_ops = {
.add_interface = wl1271_op_add_interface,
.remove_interface = wl1271_op_remove_interface,
.config = wl1271_op_config,
.configure_arp_filter = wl1271_op_configure_arp_filter,
.prepare_multicast = wl1271_op_prepare_multicast,
.configure_filter = wl1271_op_configure_filter,
.tx = wl1271_op_tx,
Expand Down

0 comments on commit 5fa32d9

Please sign in to comment.