diff options
author | Juuso Oikarinen <juuso.oikarinen@nokia.com> | 2010-07-08 10:50:02 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2010-07-08 16:35:51 -0400 |
commit | ca52a5ebbb7caff2995214a6ca41a36c5210b0bd (patch) | |
tree | c48e2df660fe2bcf187dc6d818c406ce1221ab2a | |
parent | e6b190ff3c2f4e4859502c41fa17b5c595e82000 (diff) |
wl1271: Update hardware ARP filtering configuration handling
The interface for hardware ARP configuration changed in the mac80211. Change
driver accordingly.
Signed-off-by: Juuso Oikarinen <juuso.oikarinen@nokia.com>
Reviewed-by: Teemu Paasikivi <ext-teemu.3.paasikivi@nokia.com>
Signed-off-by: Luciano Coelho <luciano.coelho@nokia.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r-- | drivers/net/wireless/wl12xx/wl1271_acx.c | 10 | ||||
-rw-r--r-- | drivers/net/wireless/wl12xx/wl1271_acx.h | 2 | ||||
-rw-r--r-- | drivers/net/wireless/wl12xx/wl1271_main.c | 61 |
3 files changed, 19 insertions, 54 deletions
diff --git a/drivers/net/wireless/wl12xx/wl1271_acx.c b/drivers/net/wireless/wl12xx/wl1271_acx.c index b45ebbcf6c4a..bb245f05af49 100644 --- a/drivers/net/wireless/wl12xx/wl1271_acx.c +++ b/drivers/net/wireless/wl12xx/wl1271_acx.c | |||
@@ -1075,12 +1075,12 @@ out: | |||
1075 | return ret; | 1075 | return ret; |
1076 | } | 1076 | } |
1077 | 1077 | ||
1078 | int wl1271_acx_arp_ip_filter(struct wl1271 *wl, u8 mode, u8 *address) | 1078 | int wl1271_acx_arp_ip_filter(struct wl1271 *wl, bool enable, __be32 address) |
1079 | { | 1079 | { |
1080 | struct wl1271_acx_arp_filter *acx; | 1080 | struct wl1271_acx_arp_filter *acx; |
1081 | int ret; | 1081 | int ret; |
1082 | 1082 | ||
1083 | wl1271_debug(DEBUG_ACX, "acx arp ip filter, mode: %d", mode); | 1083 | wl1271_debug(DEBUG_ACX, "acx arp ip filter, enable: %d", enable); |
1084 | 1084 | ||
1085 | acx = kzalloc(sizeof(*acx), GFP_KERNEL); | 1085 | acx = kzalloc(sizeof(*acx), GFP_KERNEL); |
1086 | if (!acx) { | 1086 | if (!acx) { |
@@ -1089,10 +1089,10 @@ int wl1271_acx_arp_ip_filter(struct wl1271 *wl, u8 mode, u8 *address) | |||
1089 | } | 1089 | } |
1090 | 1090 | ||
1091 | acx->version = ACX_IPV4_VERSION; | 1091 | acx->version = ACX_IPV4_VERSION; |
1092 | acx->enable = mode; | 1092 | acx->enable = enable; |
1093 | 1093 | ||
1094 | if (mode != ACX_ARP_DISABLE) | 1094 | if (enable == true) |
1095 | memcpy(acx->address, address, ACX_IPV4_ADDR_SIZE); | 1095 | memcpy(acx->address, &address, ACX_IPV4_ADDR_SIZE); |
1096 | 1096 | ||
1097 | ret = wl1271_cmd_configure(wl, ACX_ARP_IP_FILTER, | 1097 | ret = wl1271_cmd_configure(wl, ACX_ARP_IP_FILTER, |
1098 | acx, sizeof(*acx)); | 1098 | acx, sizeof(*acx)); |
diff --git a/drivers/net/wireless/wl12xx/wl1271_acx.h b/drivers/net/wireless/wl12xx/wl1271_acx.h index 6a6f3e3ebf34..d915683fb645 100644 --- a/drivers/net/wireless/wl12xx/wl1271_acx.h +++ b/drivers/net/wireless/wl12xx/wl1271_acx.h | |||
@@ -1117,7 +1117,7 @@ int wl1271_acx_init_mem_config(struct wl1271 *wl); | |||
1117 | int wl1271_acx_init_rx_interrupt(struct wl1271 *wl); | 1117 | int wl1271_acx_init_rx_interrupt(struct wl1271 *wl); |
1118 | int wl1271_acx_smart_reflex(struct wl1271 *wl); | 1118 | int wl1271_acx_smart_reflex(struct wl1271 *wl); |
1119 | int wl1271_acx_bet_enable(struct wl1271 *wl, bool enable); | 1119 | int wl1271_acx_bet_enable(struct wl1271 *wl, bool enable); |
1120 | int wl1271_acx_arp_ip_filter(struct wl1271 *wl, u8 mode, u8 *address); | 1120 | int wl1271_acx_arp_ip_filter(struct wl1271 *wl, bool enable, __be32 address); |
1121 | int wl1271_acx_pm_config(struct wl1271 *wl); | 1121 | int wl1271_acx_pm_config(struct wl1271 *wl); |
1122 | int wl1271_acx_keep_alive_mode(struct wl1271 *wl, bool enable); | 1122 | int wl1271_acx_keep_alive_mode(struct wl1271 *wl, bool enable); |
1123 | int wl1271_acx_keep_alive_config(struct wl1271 *wl, u8 index, u8 tpl_valid); | 1123 | int wl1271_acx_keep_alive_config(struct wl1271 *wl, u8 index, u8 tpl_valid); |
diff --git a/drivers/net/wireless/wl12xx/wl1271_main.c b/drivers/net/wireless/wl12xx/wl1271_main.c index 3a648963fbed..15c99dd76774 100644 --- a/drivers/net/wireless/wl12xx/wl1271_main.c +++ b/drivers/net/wireless/wl12xx/wl1271_main.c | |||
@@ -1312,53 +1312,6 @@ struct wl1271_filter_params { | |||
1312 | u8 mc_list[ACX_MC_ADDRESS_GROUP_MAX][ETH_ALEN]; | 1312 | u8 mc_list[ACX_MC_ADDRESS_GROUP_MAX][ETH_ALEN]; |
1313 | }; | 1313 | }; |
1314 | 1314 | ||
1315 | static int wl1271_op_configure_arp_filter(struct ieee80211_hw *hw, | ||
1316 | struct ieee80211_vif *vif, | ||
1317 | struct in_ifaddr *ifa_list) | ||
1318 | { | ||
1319 | struct wl1271 *wl = hw->priv; | ||
1320 | int ret = 0; | ||
1321 | |||
1322 | WARN_ON(vif != wl->vif); | ||
1323 | |||
1324 | /* disable filtering if there are multiple addresses */ | ||
1325 | if (ifa_list && ifa_list->ifa_next) | ||
1326 | ifa_list = NULL; | ||
1327 | |||
1328 | mutex_lock(&wl->mutex); | ||
1329 | |||
1330 | if (wl->state == WL1271_STATE_OFF) | ||
1331 | goto out; | ||
1332 | |||
1333 | WARN_ON(wl->bss_type != BSS_TYPE_STA_BSS); | ||
1334 | |||
1335 | ret = wl1271_ps_elp_wakeup(wl, false); | ||
1336 | if (ret < 0) | ||
1337 | goto out; | ||
1338 | |||
1339 | if (ifa_list) { | ||
1340 | ret = wl1271_cmd_build_arp_reply(wl, &ifa_list->ifa_address); | ||
1341 | if (ret < 0) | ||
1342 | goto out_sleep; | ||
1343 | ret = wl1271_acx_arp_ip_filter(wl, ACX_ARP_FILTER_AND_REPLY, | ||
1344 | (u8 *)&ifa_list->ifa_address); | ||
1345 | if (ret < 0) | ||
1346 | goto out_sleep; | ||
1347 | } else { | ||
1348 | ret = wl1271_acx_arp_ip_filter(wl, ACX_ARP_DISABLE, NULL); | ||
1349 | if (ret < 0) | ||
1350 | goto out_sleep; | ||
1351 | } | ||
1352 | |||
1353 | out_sleep: | ||
1354 | wl1271_ps_elp_sleep(wl); | ||
1355 | |||
1356 | out: | ||
1357 | mutex_unlock(&wl->mutex); | ||
1358 | |||
1359 | return ret; | ||
1360 | } | ||
1361 | |||
1362 | static u64 wl1271_op_prepare_multicast(struct ieee80211_hw *hw, | 1315 | static u64 wl1271_op_prepare_multicast(struct ieee80211_hw *hw, |
1363 | struct netdev_hw_addr_list *mc_list) | 1316 | struct netdev_hw_addr_list *mc_list) |
1364 | { | 1317 | { |
@@ -1869,6 +1822,19 @@ static void wl1271_op_bss_info_changed(struct ieee80211_hw *hw, | |||
1869 | } | 1822 | } |
1870 | } | 1823 | } |
1871 | 1824 | ||
1825 | if (changed & BSS_CHANGED_ARP_FILTER) { | ||
1826 | __be32 addr = bss_conf->arp_addr_list[0]; | ||
1827 | WARN_ON(wl->bss_type != BSS_TYPE_STA_BSS); | ||
1828 | |||
1829 | if (bss_conf->arp_addr_cnt == 1 && bss_conf->arp_filter_enabled) | ||
1830 | ret = wl1271_acx_arp_ip_filter(wl, true, addr); | ||
1831 | else | ||
1832 | ret = wl1271_acx_arp_ip_filter(wl, false, addr); | ||
1833 | |||
1834 | if (ret < 0) | ||
1835 | goto out_sleep; | ||
1836 | } | ||
1837 | |||
1872 | if (do_join) { | 1838 | if (do_join) { |
1873 | ret = wl1271_join(wl, set_assoc); | 1839 | ret = wl1271_join(wl, set_assoc); |
1874 | if (ret < 0) { | 1840 | if (ret < 0) { |
@@ -2174,7 +2140,6 @@ static const struct ieee80211_ops wl1271_ops = { | |||
2174 | .add_interface = wl1271_op_add_interface, | 2140 | .add_interface = wl1271_op_add_interface, |
2175 | .remove_interface = wl1271_op_remove_interface, | 2141 | .remove_interface = wl1271_op_remove_interface, |
2176 | .config = wl1271_op_config, | 2142 | .config = wl1271_op_config, |
2177 | .configure_arp_filter = wl1271_op_configure_arp_filter, | ||
2178 | .prepare_multicast = wl1271_op_prepare_multicast, | 2143 | .prepare_multicast = wl1271_op_prepare_multicast, |
2179 | .configure_filter = wl1271_op_configure_filter, | 2144 | .configure_filter = wl1271_op_configure_filter, |
2180 | .tx = wl1271_op_tx, | 2145 | .tx = wl1271_op_tx, |