summaryrefslogtreecommitdiff
path: root/drivers/net/wireless/iwlwifi/mvm/mac80211.c
diff options
context:
space:
mode:
authorEliad Peller <eliad@wizery.com>2014-01-08 10:11:12 +0200
committerEmmanuel Grumbach <emmanuel.grumbach@intel.com>2014-02-03 22:23:36 +0200
commitde06a59e36662f6adf2a5248f219ea0a1d42ed5b (patch)
tree57e1431b7c6d08fb37e7fdd12393a8706f4e73e5 /drivers/net/wireless/iwlwifi/mvm/mac80211.c
parent2ee8f021dd805a89395e503f373ad89541869fa9 (diff)
iwlwifi: mvm: add bcast_filtering debugfs entries
Allow reading and setting bcast filtering configuration through debugfs. By default, mvm->bcast_filters is used for setting the bcast filtering configuration (these filters will be configured for each associated station). For testing purposes, allow overriding this configuration, and setting the bcast filtering configuration manually. The following debugfs keys can be used: * bcast_filtering/override - use debugfs values instead of default configuration * bcast_filtering/filters - set filters (+ attributes) * bcast_filtering/macs - per-mac bcast filtering configuration (policy + attached filters) Signed-off-by: Eliad Peller <eliadx.peller@intel.com> Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Diffstat (limited to 'drivers/net/wireless/iwlwifi/mvm/mac80211.c')
-rw-r--r--drivers/net/wireless/iwlwifi/mvm/mac80211.c43
1 files changed, 31 insertions, 12 deletions
diff --git a/drivers/net/wireless/iwlwifi/mvm/mac80211.c b/drivers/net/wireless/iwlwifi/mvm/mac80211.c
index b3f6c2b292ac..67c0dfcc7285 100644
--- a/drivers/net/wireless/iwlwifi/mvm/mac80211.c
+++ b/drivers/net/wireless/iwlwifi/mvm/mac80211.c
@@ -1045,32 +1045,51 @@ static void iwl_mvm_bcast_filter_iterator(void *_data, u8 *mac,
}
}
-static int iwl_mvm_configure_bcast_filter(struct iwl_mvm *mvm,
- struct ieee80211_vif *vif)
+bool iwl_mvm_bcast_filter_build_cmd(struct iwl_mvm *mvm,
+ struct iwl_bcast_filter_cmd *cmd)
{
- /* initialize cmd to pass broadcasts on all vifs */
- struct iwl_bcast_filter_cmd cmd = {
- .disable = 0,
- .max_bcast_filters = ARRAY_SIZE(cmd.filters),
- .max_macs = ARRAY_SIZE(cmd.macs),
- };
struct iwl_bcast_iter_data iter_data = {
.mvm = mvm,
- .cmd = &cmd,
+ .cmd = cmd,
};
- if (!(mvm->fw->ucode_capa.flags & IWL_UCODE_TLV_FLAGS_BCAST_FILTERING))
- return 0;
+ memset(cmd, 0, sizeof(*cmd));
+ cmd->max_bcast_filters = ARRAY_SIZE(cmd->filters);
+ cmd->max_macs = ARRAY_SIZE(cmd->macs);
+
+#ifdef CONFIG_IWLWIFI_DEBUGFS
+ /* use debugfs filters/macs if override is configured */
+ if (mvm->dbgfs_bcast_filtering.override) {
+ memcpy(cmd->filters, &mvm->dbgfs_bcast_filtering.cmd.filters,
+ sizeof(cmd->filters));
+ memcpy(cmd->macs, &mvm->dbgfs_bcast_filtering.cmd.macs,
+ sizeof(cmd->macs));
+ return true;
+ }
+#endif
/* if no filters are configured, do nothing */
if (!mvm->bcast_filters)
- return 0;
+ return false;
/* configure and attach these filters for each associated sta vif */
ieee80211_iterate_active_interfaces(
mvm->hw, IEEE80211_IFACE_ITER_NORMAL,
iwl_mvm_bcast_filter_iterator, &iter_data);
+ return true;
+}
+static int iwl_mvm_configure_bcast_filter(struct iwl_mvm *mvm,
+ struct ieee80211_vif *vif)
+{
+ struct iwl_bcast_filter_cmd cmd;
+
+ if (!(mvm->fw->ucode_capa.flags & IWL_UCODE_TLV_FLAGS_BCAST_FILTERING))
+ return 0;
+
+ if (!iwl_mvm_bcast_filter_build_cmd(mvm, &cmd))
+ return 0;
+
return iwl_mvm_send_cmd_pdu(mvm, BCAST_FILTER_CMD, CMD_SYNC,
sizeof(cmd), &cmd);
}