Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 279b05d4 authored by Wey-Yi Guy's avatar Wey-Yi Guy Committed by John W. Linville
Browse files

iwlwifi: clean up unused NL80211_IFTYPE_MONITOR for Monitor mode



This patch clean up the code for NL80211_IFTYPE_MONITOR mode,
priv->iw_mode is set in add_interface, but add_interface is never called
for monitor mode.
The only way mac80211 informs us about monitor mode is through
configuring filter; since iw_mode will never set to
NL80211_IFTYPE_MONITOR, modify and remove all the code refer to
NL80211_IFTYPE_MONITOR and replace with iwl_is_monitor_mode() function
call.

Signed-off-by: default avatarWey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: default avatarReinette Chatre <reinette.chatre@intel.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 86ddbf62
Loading
Loading
Loading
Loading
+0 −2
Original line number Original line Diff line number Diff line
@@ -2001,8 +2001,6 @@ static int iwl_mac_start(struct ieee80211_hw *hw)


out:
out:
	priv->is_open = 1;
	priv->is_open = 1;
	/* default to MONITOR mode */
	priv->iw_mode = NL80211_IFTYPE_MONITOR;
	IWL_DEBUG_MAC80211(priv, "leave\n");
	IWL_DEBUG_MAC80211(priv, "leave\n");
	return 0;
	return 0;
}
}
+2 −6
Original line number Original line Diff line number Diff line
@@ -904,10 +904,11 @@ static u8 iwl_count_chain_bitmap(u32 chain_bitmap)
 * never called for monitor mode. The only way mac80211 informs us about
 * never called for monitor mode. The only way mac80211 informs us about
 * monitor mode is through configuring filters (call to configure_filter).
 * monitor mode is through configuring filters (call to configure_filter).
 */
 */
static bool iwl_is_monitor_mode(struct iwl_priv *priv)
bool iwl_is_monitor_mode(struct iwl_priv *priv)
{
{
	return !!(priv->staging_rxon.filter_flags & RXON_FILTER_PROMISC_MSK);
	return !!(priv->staging_rxon.filter_flags & RXON_FILTER_PROMISC_MSK);
}
}
EXPORT_SYMBOL(iwl_is_monitor_mode);


/**
/**
 * iwl_set_rxon_chain - Set up Rx chain usage in "staging" RXON image
 * iwl_set_rxon_chain - Set up Rx chain usage in "staging" RXON image
@@ -1071,11 +1072,6 @@ void iwl_connection_init_rx_config(struct iwl_priv *priv, int mode)
						  RXON_FILTER_ACCEPT_GRP_MSK;
						  RXON_FILTER_ACCEPT_GRP_MSK;
		break;
		break;


	case NL80211_IFTYPE_MONITOR:
		priv->staging_rxon.dev_type = RXON_DEV_TYPE_SNIFFER;
		priv->staging_rxon.filter_flags = RXON_FILTER_PROMISC_MSK |
		    RXON_FILTER_CTL2HOST_MSK | RXON_FILTER_ACCEPT_GRP_MSK;
		break;
	default:
	default:
		IWL_ERR(priv, "Unsupported interface type %d\n", mode);
		IWL_ERR(priv, "Unsupported interface type %d\n", mode);
		break;
		break;
+1 −0
Original line number Original line Diff line number Diff line
@@ -267,6 +267,7 @@ int iwl_setup_mac(struct iwl_priv *priv);
int iwl_set_hw_params(struct iwl_priv *priv);
int iwl_set_hw_params(struct iwl_priv *priv);
int iwl_init_drv(struct iwl_priv *priv);
int iwl_init_drv(struct iwl_priv *priv);
void iwl_uninit_drv(struct iwl_priv *priv);
void iwl_uninit_drv(struct iwl_priv *priv);
bool iwl_is_monitor_mode(struct iwl_priv *priv);
void iwl_post_associate(struct iwl_priv *priv);
void iwl_post_associate(struct iwl_priv *priv);
void iwl_bss_info_changed(struct ieee80211_hw *hw,
void iwl_bss_info_changed(struct ieee80211_hw *hw,
				     struct ieee80211_vif *vif,
				     struct ieee80211_vif *vif,
+0 −7
Original line number Original line Diff line number Diff line
@@ -1102,13 +1102,6 @@ void iwl_rx_reply_rx(struct iwl_priv *priv,
	if (rx_start->phy_flags & RX_RES_PHY_FLAGS_SHORT_PREAMBLE_MSK)
	if (rx_start->phy_flags & RX_RES_PHY_FLAGS_SHORT_PREAMBLE_MSK)
		rx_status.flag |= RX_FLAG_SHORTPRE;
		rx_status.flag |= RX_FLAG_SHORTPRE;


	/* Take shortcut when only in monitor mode */
	if (priv->iw_mode == NL80211_IFTYPE_MONITOR) {
		iwl_pass_packet_to_mac80211(priv, include_phy,
						 rxb, &rx_status);
		return;
	}

	network_packet = iwl_is_network_packet(priv, header);
	network_packet = iwl_is_network_packet(priv, header);
	if (network_packet) {
	if (network_packet) {
		priv->last_rx_rssi = rx_status.signal;
		priv->last_rx_rssi = rx_status.signal;
+1 −1
Original line number Original line Diff line number Diff line
@@ -747,7 +747,7 @@ static void iwl_bg_request_scan(struct work_struct *data)


	scan->tx_cmd.len = cpu_to_le16(cmd_len);
	scan->tx_cmd.len = cpu_to_le16(cmd_len);


	if (priv->iw_mode == NL80211_IFTYPE_MONITOR)
	if (iwl_is_monitor_mode(priv))
		scan->filter_flags = RXON_FILTER_PROMISC_MSK;
		scan->filter_flags = RXON_FILTER_PROMISC_MSK;


	scan->filter_flags |= (RXON_FILTER_ACCEPT_GRP_MSK |
	scan->filter_flags |= (RXON_FILTER_ACCEPT_GRP_MSK |
Loading