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

Commit 7c2cde2e authored by Stanislaw Gruszka's avatar Stanislaw Gruszka
Browse files

iwlegacy: partial rxon context cleanup

parent dcae1c64
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -342,7 +342,7 @@ void il3945_rs_rate_init(struct il_priv *il, struct ieee80211_sta *sta, u8 sta_i
	int i;

	D_INFO("enter\n");
	if (sta_id == il->contexts[IL_RXON_CTX_BSS].bcast_sta_id)
	if (sta_id == il->ctx.bcast_sta_id)
		goto out;

	psta = (struct il3945_sta_priv *) sta->drv_priv;
@@ -936,7 +936,7 @@ void il3945_rate_scale_init(struct ieee80211_hw *hw, s32 sta_id)

	rcu_read_lock();

	sta = ieee80211_find_sta(il->contexts[IL_RXON_CTX_BSS].vif,
	sta = ieee80211_find_sta(il->ctx.vif,
				 il->stations[sta_id].sta.sta.addr);
	if (!sta) {
		D_RATE("Unable to find station to initialize rate scaling.\n");
@@ -953,7 +953,7 @@ void il3945_rate_scale_init(struct ieee80211_hw *hw, s32 sta_id)
	switch (il->band) {
	case IEEE80211_BAND_2GHZ:
		/* TODO: this always does G, not a regression */
		if (il->contexts[IL_RXON_CTX_BSS].active.flags &
		if (il->ctx.active.flags &
						RXON_FLG_TGG_PROTECT_MSK) {
			rs_sta->tgg = 1;
			rs_sta->expected_tpt = il3945_expected_tpt_g_prot;
+15 −15
Original line number Diff line number Diff line
@@ -253,7 +253,7 @@ int il3945_rs_next_rate(struct il_priv *il, int rate)
		break;
	case IEEE80211_BAND_2GHZ:
		if (!(il->_3945.sta_supp_rates & IL_OFDM_RATES_MASK) &&
		    il_is_associated(il, IL_RXON_CTX_BSS)) {
		    il_is_associated(il)) {
			if (rate == IL_RATE_11M_INDEX)
				next_rate = IL_RATE_5M_INDEX;
		}
@@ -1374,7 +1374,7 @@ static int il3945_send_tx_power(struct il_priv *il)
	int rate_idx, i;
	const struct il_channel_info *ch_info = NULL;
	struct il3945_txpowertable_cmd txpower = {
		.channel = il->contexts[IL_RXON_CTX_BSS].active.channel,
		.channel = il->ctx.active.channel,
	};
	u16 chan;

@@ -1382,7 +1382,7 @@ static int il3945_send_tx_power(struct il_priv *il)
		      "TX Power requested while scanning!\n"))
		return -EAGAIN;

	chan = le16_to_cpu(il->contexts[IL_RXON_CTX_BSS].active.channel);
	chan = le16_to_cpu(il->ctx.active.channel);

	txpower.band = (il->band == IEEE80211_BAND_5GHZ) ? 0 : 1;
	ch_info = il_get_channel_info(il, il->band, chan);
@@ -1734,9 +1734,9 @@ int il3945_commit_rxon(struct il_priv *il, struct il_rxon_context *ctx)
	 * il3945_rxon_assoc_cmd which is used to reconfigure filter
	 * and other flags for the current radio configuration. */
	if (!il_full_rxon_required(il,
			&il->contexts[IL_RXON_CTX_BSS])) {
			&il->ctx)) {
		rc = il_send_rxon_assoc(il,
					 &il->contexts[IL_RXON_CTX_BSS]);
					 &il->ctx);
		if (rc) {
			IL_ERR("Error setting RXON_ASSOC "
				  "configuration (%d).\n", rc);
@@ -1756,7 +1756,7 @@ int il3945_commit_rxon(struct il_priv *il, struct il_rxon_context *ctx)
	 * an RXON_ASSOC and the new config wants the associated mask enabled,
	 * we must clear the associated from the active configuration
	 * before we apply the new config */
	if (il_is_associated(il, IL_RXON_CTX_BSS) && new_assoc) {
	if (il_is_associated(il) && new_assoc) {
		D_INFO("Toggling associated bit on current RXON\n");
		active_rxon->filter_flags &= ~RXON_FILTER_ASSOC_MSK;

@@ -1768,7 +1768,7 @@ int il3945_commit_rxon(struct il_priv *il, struct il_rxon_context *ctx)
		active_rxon->reserved5 = 0;
		rc = il_send_cmd_pdu(il, REPLY_RXON,
				      sizeof(struct il3945_rxon_cmd),
				      &il->contexts[IL_RXON_CTX_BSS].active);
				      &il->ctx.active);

		/* If the mask clearing failed then we set
		 * active_rxon back to what it was previously */
@@ -1779,9 +1779,9 @@ int il3945_commit_rxon(struct il_priv *il, struct il_rxon_context *ctx)
			return rc;
		}
		il_clear_ucode_stations(il,
					 &il->contexts[IL_RXON_CTX_BSS]);
					 &il->ctx);
		il_restore_stations(il,
					 &il->contexts[IL_RXON_CTX_BSS]);
					 &il->ctx);
	}

	D_INFO("Sending RXON\n"
@@ -1814,9 +1814,9 @@ int il3945_commit_rxon(struct il_priv *il, struct il_rxon_context *ctx)

	if (!new_assoc) {
		il_clear_ucode_stations(il,
					 &il->contexts[IL_RXON_CTX_BSS]);
					 &il->ctx);
		il_restore_stations(il,
					&il->contexts[IL_RXON_CTX_BSS]);
					&il->ctx);
	}

	/* If we issue a new RXON command which required a tune then we must
@@ -2252,7 +2252,7 @@ static u16 il3945_build_addsta_hcmd(const struct il_addsta_cmd *cmd,
static int il3945_add_bssid_station(struct il_priv *il,
				     const u8 *addr, u8 *sta_id_r)
{
	struct il_rxon_context *ctx = &il->contexts[IL_RXON_CTX_BSS];
	struct il_rxon_context *ctx = &il->ctx;
	int ret;
	u8 sta_id;
	unsigned long flags;
@@ -2346,7 +2346,7 @@ int il3945_init_hw_rate_table(struct il_priv *il)
		 * 1M CCK rates */

		if (!(il->_3945.sta_supp_rates & IL_OFDM_RATES_MASK) &&
		    il_is_associated(il, IL_RXON_CTX_BSS)) {
		    il_is_associated(il)) {

			index = IL_FIRST_CCK_RATE;
			for (i = IL_RATE_6M_INDEX_TABLE;
@@ -2401,7 +2401,7 @@ int il3945_hw_set_hw_params(struct il_priv *il)
	il->hw_params.max_rxq_size = RX_QUEUE_SIZE;
	il->hw_params.max_rxq_log = RX_QUEUE_SIZE_LOG;
	il->hw_params.max_stations = IL3945_STATION_COUNT;
	il->contexts[IL_RXON_CTX_BSS].bcast_sta_id = IL3945_BROADCAST_ID;
	il->ctx.bcast_sta_id = IL3945_BROADCAST_ID;

	il->sta_key_max_num = STA_KEY_MAX_NUM;

@@ -2422,7 +2422,7 @@ unsigned int il3945_hw_get_beacon_cmd(struct il_priv *il,
	memset(tx_beacon_cmd, 0, sizeof(*tx_beacon_cmd));

	tx_beacon_cmd->tx.sta_id =
		il->contexts[IL_RXON_CTX_BSS].bcast_sta_id;
		il->ctx.bcast_sta_id;
	tx_beacon_cmd->tx.stop_time.life_time = TX_CMD_LIFE_TIME_INFINITE;

	frame_size = il3945_fill_beacon_frame(il,
+1 −1
Original line number Diff line number Diff line
@@ -820,7 +820,7 @@ void il4965_chain_noise_calibration(struct il_priv *il, void *stat_resp)
	unsigned long flags;
	struct statistics_rx_non_phy *rx_info;

	struct il_rxon_context *ctx = &il->contexts[IL_RXON_CTX_BSS];
	struct il_rxon_context *ctx = &il->ctx;

	if (il->disable_chain_noise_cal)
		return;
+2 −2
Original line number Diff line number Diff line
@@ -782,7 +782,7 @@ int il4965_request_scan(struct il_priv *il, struct ieee80211_vif *vif)
		.flags = CMD_SIZE_HUGE,
	};
	struct il_scan_cmd *scan;
	struct il_rxon_context *ctx = &il->contexts[IL_RXON_CTX_BSS];
	struct il_rxon_context *ctx = &il->ctx;
	u32 rate_flags = 0;
	u16 cmd_len;
	u16 rx_chain = 0;
@@ -866,7 +866,7 @@ int il4965_request_scan(struct il_priv *il, struct ieee80211_vif *vif)
	case IEEE80211_BAND_2GHZ:
		scan->flags = RXON_FLG_BAND_24G_MSK | RXON_FLG_AUTO_DETECT_MSK;
		chan_mod = le32_to_cpu(
			il->contexts[IL_RXON_CTX_BSS].active.flags &
			il->ctx.active.flags &
						RXON_FLG_CHANNEL_MODE_MSK)
				       >> RXON_FLG_CHANNEL_MODE_POS;
		if (chan_mod == CHANNEL_MODE_PURE_40) {
+2 −2
Original line number Diff line number Diff line
@@ -277,7 +277,7 @@ int il4965_tx_skb(struct il_priv *il, struct sk_buff *skb)
	struct il_device_cmd *out_cmd;
	struct il_cmd_meta *out_meta;
	struct il_tx_cmd *tx_cmd;
	struct il_rxon_context *ctx = &il->contexts[IL_RXON_CTX_BSS];
	struct il_rxon_context *ctx = &il->ctx;
	int txq_id;
	dma_addr_t phys_addr;
	dma_addr_t txcmd_phys;
@@ -1041,7 +1041,7 @@ int il4965_txq_check_empty(struct il_priv *il,
	struct il_tid_data *tid_data = &il->stations[sta_id].tid[tid];
	struct il_rxon_context *ctx;

	ctx = &il->contexts[il->stations[sta_id].ctxid];
	ctx = &il->ctx;

	lockdep_assert_held(&il->sta_lock);

Loading