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

Commit e1623446 authored by Tomas Winkler's avatar Tomas Winkler Committed by John W. Linville
Browse files

iwlwifi: don't use implicit priv in IWL_DEBUG



Call IWL_DEBUG macro with explicit priv argument.

Signed-off-by: default avatarTomas Winkler <tomas.winkler@intel.com>
Acked-by: default avatarSamuel Ortiz <samuel.ortiz@intel.com>
Signed-off-by: default avatarReinette Chatre <reinette.chatre@intel.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 450154e4
Loading
Loading
Loading
Loading
+3 −3
Original line number Original line Diff line number Diff line
@@ -137,7 +137,7 @@ static int iwl3945_led_off(struct iwl_priv *priv, int led_id)
		.off = 0,
		.off = 0,
		.interval = IWL_DEF_LED_INTRVL
		.interval = IWL_DEF_LED_INTRVL
	};
	};
	IWL_DEBUG_LED("led off %d\n", led_id);
	IWL_DEBUG_LED(priv, "led off %d\n", led_id);
	return iwl_send_led_cmd(priv, &led_cmd);
	return iwl_send_led_cmd(priv, &led_cmd);
}
}


@@ -174,7 +174,7 @@ static void iwl3945_led_brightness_set(struct led_classdev *led_cdev,
	case LED_FULL:
	case LED_FULL:
		if (led->type == IWL_LED_TRG_ASSOC) {
		if (led->type == IWL_LED_TRG_ASSOC) {
			priv->allow_blinking = 1;
			priv->allow_blinking = 1;
			IWL_DEBUG_LED("MAC is  associated\n");
			IWL_DEBUG_LED(priv, "MAC is  associated\n");
		}
		}
		if (led->led_on)
		if (led->led_on)
			led->led_on(priv, IWL_LED_LINK);
			led->led_on(priv, IWL_LED_LINK);
@@ -182,7 +182,7 @@ static void iwl3945_led_brightness_set(struct led_classdev *led_cdev,
	case LED_OFF:
	case LED_OFF:
		if (led->type == IWL_LED_TRG_ASSOC) {
		if (led->type == IWL_LED_TRG_ASSOC) {
			priv->allow_blinking = 0;
			priv->allow_blinking = 0;
			IWL_DEBUG_LED("MAC is disassociated\n");
			IWL_DEBUG_LED(priv, "MAC is disassociated\n");
		}
		}
		if (led->led_off)
		if (led->led_off)
			led->led_off(priv, IWL_LED_LINK);
			led->led_off(priv, IWL_LED_LINK);
+37 −37
Original line number Original line Diff line number Diff line
@@ -197,7 +197,7 @@ static int iwl3945_rate_scale_flush_windows(struct iwl3945_rs_sta *rs_sta)
		spin_lock_irqsave(&rs_sta->lock, flags);
		spin_lock_irqsave(&rs_sta->lock, flags);
		if (time_after(jiffies, rs_sta->win[i].stamp +
		if (time_after(jiffies, rs_sta->win[i].stamp +
			       IWL_RATE_WIN_FLUSH)) {
			       IWL_RATE_WIN_FLUSH)) {
			IWL_DEBUG_RATE("flushing %d samples of rate "
			IWL_DEBUG_RATE(priv, "flushing %d samples of rate "
				       "index %d\n",
				       "index %d\n",
				       rs_sta->win[i].counter, i);
				       rs_sta->win[i].counter, i);
			iwl3945_clear_window(&rs_sta->win[i]);
			iwl3945_clear_window(&rs_sta->win[i]);
@@ -221,7 +221,7 @@ static void iwl3945_bg_rate_scale_flush(unsigned long data)
	unsigned long flags;
	unsigned long flags;
	u32 packet_count, duration, pps;
	u32 packet_count, duration, pps;


	IWL_DEBUG_RATE("enter\n");
	IWL_DEBUG_RATE(priv, "enter\n");


	unflushed = iwl3945_rate_scale_flush_windows(rs_sta);
	unflushed = iwl3945_rate_scale_flush_windows(rs_sta);


@@ -236,7 +236,7 @@ static void iwl3945_bg_rate_scale_flush(unsigned long data)
		duration =
		duration =
		    jiffies_to_msecs(jiffies - rs_sta->last_partial_flush);
		    jiffies_to_msecs(jiffies - rs_sta->last_partial_flush);


		IWL_DEBUG_RATE("Tx'd %d packets in %dms\n",
		IWL_DEBUG_RATE(priv, "Tx'd %d packets in %dms\n",
			       packet_count, duration);
			       packet_count, duration);


		/* Determine packets per second */
		/* Determine packets per second */
@@ -256,7 +256,7 @@ static void iwl3945_bg_rate_scale_flush(unsigned long data)


		rs_sta->flush_time = msecs_to_jiffies(duration);
		rs_sta->flush_time = msecs_to_jiffies(duration);


		IWL_DEBUG_RATE("new flush period: %d msec ave %d\n",
		IWL_DEBUG_RATE(priv, "new flush period: %d msec ave %d\n",
			       duration, packet_count);
			       duration, packet_count);


		mod_timer(&rs_sta->rate_scale_flush, jiffies +
		mod_timer(&rs_sta->rate_scale_flush, jiffies +
@@ -274,7 +274,7 @@ static void iwl3945_bg_rate_scale_flush(unsigned long data)


	spin_unlock_irqrestore(&rs_sta->lock, flags);
	spin_unlock_irqrestore(&rs_sta->lock, flags);


	IWL_DEBUG_RATE("leave\n");
	IWL_DEBUG_RATE(priv, "leave\n");
}
}


/**
/**
@@ -293,7 +293,7 @@ static void iwl3945_collect_tx_data(struct iwl3945_rs_sta *rs_sta,
	struct iwl_priv *priv __maybe_unused = rs_sta->priv;
	struct iwl_priv *priv __maybe_unused = rs_sta->priv;


	if (!retries) {
	if (!retries) {
		IWL_DEBUG_RATE("leave: retries == 0 -- should be at least 1\n");
		IWL_DEBUG_RATE(priv, "leave: retries == 0 -- should be at least 1\n");
		return;
		return;
	}
	}


@@ -347,7 +347,7 @@ static void rs_rate_init(void *priv_r, struct ieee80211_supported_band *sband,
	struct iwl_priv *priv = (struct iwl_priv *)priv_r;
	struct iwl_priv *priv = (struct iwl_priv *)priv_r;
	int i;
	int i;


	IWL_DEBUG_RATE("enter\n");
	IWL_DEBUG_RATE(priv, "enter\n");


	/* TODO: what is a good starting rate for STA? About middle? Maybe not
	/* TODO: what is a good starting rate for STA? About middle? Maybe not
	 * the lowest or the highest rate.. Could consider using RSSI from
	 * the lowest or the highest rate.. Could consider using RSSI from
@@ -370,7 +370,7 @@ static void rs_rate_init(void *priv_r, struct ieee80211_supported_band *sband,
	}
	}




	IWL_DEBUG_RATE("leave\n");
	IWL_DEBUG_RATE(priv, "leave\n");
}
}


static void *rs_alloc(struct ieee80211_hw *hw, struct dentry *debugfsdir)
static void *rs_alloc(struct ieee80211_hw *hw, struct dentry *debugfsdir)
@@ -396,11 +396,11 @@ static void *rs_alloc_sta(void *iwl_priv, struct ieee80211_sta *sta, gfp_t gfp)
	 *	as well just put all the information there.
	 *	as well just put all the information there.
	 */
	 */


	IWL_DEBUG_RATE("enter\n");
	IWL_DEBUG_RATE(priv, "enter\n");


	rs_sta = kzalloc(sizeof(struct iwl3945_rs_sta), gfp);
	rs_sta = kzalloc(sizeof(struct iwl3945_rs_sta), gfp);
	if (!rs_sta) {
	if (!rs_sta) {
		IWL_DEBUG_RATE("leave: ENOMEM\n");
		IWL_DEBUG_RATE(priv, "leave: ENOMEM\n");
		return NULL;
		return NULL;
	}
	}


@@ -428,7 +428,7 @@ static void *rs_alloc_sta(void *iwl_priv, struct ieee80211_sta *sta, gfp_t gfp)
	for (i = 0; i < IWL_RATE_COUNT_3945; i++)
	for (i = 0; i < IWL_RATE_COUNT_3945; i++)
		iwl3945_clear_window(&rs_sta->win[i]);
		iwl3945_clear_window(&rs_sta->win[i]);


	IWL_DEBUG_RATE("leave\n");
	IWL_DEBUG_RATE(priv, "leave\n");


	return rs_sta;
	return rs_sta;
}
}
@@ -442,10 +442,10 @@ static void rs_free_sta(void *iwl_priv, struct ieee80211_sta *sta,


	psta->rs_sta = NULL;
	psta->rs_sta = NULL;


	IWL_DEBUG_RATE("enter\n");
	IWL_DEBUG_RATE(priv, "enter\n");
	del_timer_sync(&rs_sta->rate_scale_flush);
	del_timer_sync(&rs_sta->rate_scale_flush);
	kfree(rs_sta);
	kfree(rs_sta);
	IWL_DEBUG_RATE("leave\n");
	IWL_DEBUG_RATE(priv, "leave\n");
}
}




@@ -466,18 +466,18 @@ static void rs_tx_status(void *priv_rate, struct ieee80211_supported_band *sband
	struct iwl3945_rs_sta *rs_sta = priv_sta;
	struct iwl3945_rs_sta *rs_sta = priv_sta;
	struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb);
	struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb);


	IWL_DEBUG_RATE("enter\n");
	IWL_DEBUG_RATE(priv, "enter\n");


	retries = info->status.rates[0].count;
	retries = info->status.rates[0].count;


	first_index = sband->bitrates[info->status.rates[0].idx].hw_value;
	first_index = sband->bitrates[info->status.rates[0].idx].hw_value;
	if ((first_index < 0) || (first_index >= IWL_RATE_COUNT_3945)) {
	if ((first_index < 0) || (first_index >= IWL_RATE_COUNT_3945)) {
		IWL_DEBUG_RATE("leave: Rate out of bounds: %d\n", first_index);
		IWL_DEBUG_RATE(priv, "leave: Rate out of bounds: %d\n", first_index);
		return;
		return;
	}
	}


	if (!priv_sta) {
	if (!priv_sta) {
		IWL_DEBUG_RATE("leave: No STA priv data to update!\n");
		IWL_DEBUG_RATE(priv, "leave: No STA priv data to update!\n");
		return;
		return;
	}
	}


@@ -511,7 +511,7 @@ static void rs_tx_status(void *priv_rate, struct ieee80211_supported_band *sband
		iwl3945_collect_tx_data(rs_sta,
		iwl3945_collect_tx_data(rs_sta,
				    &rs_sta->win[scale_rate_index],
				    &rs_sta->win[scale_rate_index],
				    0, current_count, scale_rate_index);
				    0, current_count, scale_rate_index);
		IWL_DEBUG_RATE("Update rate %d for %d retries.\n",
		IWL_DEBUG_RATE(priv, "Update rate %d for %d retries.\n",
			       scale_rate_index, current_count);
			       scale_rate_index, current_count);


		retries -= current_count;
		retries -= current_count;
@@ -521,7 +521,7 @@ static void rs_tx_status(void *priv_rate, struct ieee80211_supported_band *sband




	/* Update the last index window with success/failure based on ACK */
	/* Update the last index window with success/failure based on ACK */
	IWL_DEBUG_RATE("Update rate %d with %s.\n",
	IWL_DEBUG_RATE(priv, "Update rate %d with %s.\n",
		       last_index,
		       last_index,
		       (info->flags & IEEE80211_TX_STAT_ACK) ?
		       (info->flags & IEEE80211_TX_STAT_ACK) ?
		       "success" : "failure");
		       "success" : "failure");
@@ -546,7 +546,7 @@ static void rs_tx_status(void *priv_rate, struct ieee80211_supported_band *sband


	spin_unlock_irqrestore(&rs_sta->lock, flags);
	spin_unlock_irqrestore(&rs_sta->lock, flags);


	IWL_DEBUG_RATE("leave\n");
	IWL_DEBUG_RATE(priv, "leave\n");


	return;
	return;
}
}
@@ -596,7 +596,7 @@ static u16 iwl3945_get_adjacent_rate(struct iwl3945_rs_sta *rs_sta,
			break;
			break;
		if (rate_mask & (1 << low))
		if (rate_mask & (1 << low))
			break;
			break;
		IWL_DEBUG_RATE("Skipping masked lower rate: %d\n", low);
		IWL_DEBUG_RATE(priv, "Skipping masked lower rate: %d\n", low);
	}
	}


	high = index;
	high = index;
@@ -609,7 +609,7 @@ static u16 iwl3945_get_adjacent_rate(struct iwl3945_rs_sta *rs_sta,
			break;
			break;
		if (rate_mask & (1 << high))
		if (rate_mask & (1 << high))
			break;
			break;
		IWL_DEBUG_RATE("Skipping masked higher rate: %d\n", high);
		IWL_DEBUG_RATE(priv, "Skipping masked higher rate: %d\n", high);
	}
	}


	return (high << 8) | low;
	return (high << 8) | low;
@@ -655,7 +655,7 @@ static void rs_get_rate(void *priv_r, struct ieee80211_sta *sta,
	struct iwl_priv *priv = (struct iwl_priv *)priv_r;
	struct iwl_priv *priv = (struct iwl_priv *)priv_r;
	struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb);
	struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb);


	IWL_DEBUG_RATE("enter\n");
	IWL_DEBUG_RATE(priv, "enter\n");


	if (sta)
	if (sta)
		rate_mask = sta->supp_rates[sband->band];
		rate_mask = sta->supp_rates[sband->band];
@@ -666,7 +666,7 @@ static void rs_get_rate(void *priv_r, struct ieee80211_sta *sta,
	if ((fc & IEEE80211_FCTL_FTYPE) != IEEE80211_FTYPE_DATA ||
	if ((fc & IEEE80211_FCTL_FTYPE) != IEEE80211_FTYPE_DATA ||
	    is_multicast_ether_addr(hdr->addr1) ||
	    is_multicast_ether_addr(hdr->addr1) ||
	    !sta || !priv_sta) {
	    !sta || !priv_sta) {
		IWL_DEBUG_RATE("leave: No STA priv data to update!\n");
		IWL_DEBUG_RATE(priv, "leave: No STA priv data to update!\n");
		if (!rate_mask)
		if (!rate_mask)
			info->control.rates[0].idx =
			info->control.rates[0].idx =
					rate_lowest_index(sband, NULL);
					rate_lowest_index(sband, NULL);
@@ -693,7 +693,7 @@ static void rs_get_rate(void *priv_r, struct ieee80211_sta *sta,
		u8 sta_id = iwl3945_hw_find_station(priv, hdr->addr1);
		u8 sta_id = iwl3945_hw_find_station(priv, hdr->addr1);


		if (sta_id == IWL_INVALID_STATION) {
		if (sta_id == IWL_INVALID_STATION) {
			IWL_DEBUG_RATE("LQ: ADD station %pm\n",
			IWL_DEBUG_RATE(priv, "LQ: ADD station %pm\n",
				       hdr->addr1);
				       hdr->addr1);
			sta_id = iwl3945_add_station(priv,
			sta_id = iwl3945_add_station(priv,
				    hdr->addr1, 0, CMD_ASYNC);
				    hdr->addr1, 0, CMD_ASYNC);
@@ -728,7 +728,7 @@ static void rs_get_rate(void *priv_r, struct ieee80211_sta *sta,
	     (window->success_counter < IWL_RATE_MIN_SUCCESS_TH))) {
	     (window->success_counter < IWL_RATE_MIN_SUCCESS_TH))) {
		spin_unlock_irqrestore(&rs_sta->lock, flags);
		spin_unlock_irqrestore(&rs_sta->lock, flags);


		IWL_DEBUG_RATE("Invalid average_tpt on rate %d: "
		IWL_DEBUG_RATE(priv, "Invalid average_tpt on rate %d: "
			       "counter: %d, success_counter: %d, "
			       "counter: %d, success_counter: %d, "
			       "expected_tpt is %sNULL\n",
			       "expected_tpt is %sNULL\n",
			       index,
			       index,
@@ -761,7 +761,7 @@ static void rs_get_rate(void *priv_r, struct ieee80211_sta *sta,
	scale_action = 1;
	scale_action = 1;


	if ((window->success_ratio < IWL_RATE_DECREASE_TH) || !current_tpt) {
	if ((window->success_ratio < IWL_RATE_DECREASE_TH) || !current_tpt) {
		IWL_DEBUG_RATE("decrease rate because of low success_ratio\n");
		IWL_DEBUG_RATE(priv, "decrease rate because of low success_ratio\n");
		scale_action = -1;
		scale_action = -1;
	} else if ((low_tpt == IWL_INVALID_VALUE) &&
	} else if ((low_tpt == IWL_INVALID_VALUE) &&
		   (high_tpt == IWL_INVALID_VALUE))
		   (high_tpt == IWL_INVALID_VALUE))
@@ -769,7 +769,7 @@ static void rs_get_rate(void *priv_r, struct ieee80211_sta *sta,
	else if ((low_tpt != IWL_INVALID_VALUE) &&
	else if ((low_tpt != IWL_INVALID_VALUE) &&
		 (high_tpt != IWL_INVALID_VALUE) &&
		 (high_tpt != IWL_INVALID_VALUE) &&
		 (low_tpt < current_tpt) && (high_tpt < current_tpt)) {
		 (low_tpt < current_tpt) && (high_tpt < current_tpt)) {
		IWL_DEBUG_RATE("No action -- low [%d] & high [%d] < "
		IWL_DEBUG_RATE(priv, "No action -- low [%d] & high [%d] < "
			       "current_tpt [%d]\n",
			       "current_tpt [%d]\n",
			       low_tpt, high_tpt, current_tpt);
			       low_tpt, high_tpt, current_tpt);
		scale_action = 0;
		scale_action = 0;
@@ -778,14 +778,14 @@ static void rs_get_rate(void *priv_r, struct ieee80211_sta *sta,
			if (high_tpt > current_tpt)
			if (high_tpt > current_tpt)
				scale_action = 1;
				scale_action = 1;
			else {
			else {
				IWL_DEBUG_RATE
				IWL_DEBUG_RATE(priv,
				    ("decrease rate because of high tpt\n");
				    "decrease rate because of high tpt\n");
				scale_action = -1;
				scale_action = -1;
			}
			}
		} else if (low_tpt != IWL_INVALID_VALUE) {
		} else if (low_tpt != IWL_INVALID_VALUE) {
			if (low_tpt > current_tpt) {
			if (low_tpt > current_tpt) {
				IWL_DEBUG_RATE
				IWL_DEBUG_RATE(priv,
				    ("decrease rate because of low tpt\n");
				    "decrease rate because of low tpt\n");
				scale_action = -1;
				scale_action = -1;
			} else
			} else
				scale_action = 1;
				scale_action = 1;
@@ -797,7 +797,7 @@ static void rs_get_rate(void *priv_r, struct ieee80211_sta *sta,
			scale_action = 0;
			scale_action = 0;
	} else if (scale_action == 1) {
	} else if (scale_action == 1) {
		if (window->success_ratio < IWL_SUCCESS_UP_TH) {
		if (window->success_ratio < IWL_SUCCESS_UP_TH) {
			IWL_DEBUG_RATE("No action -- success_ratio [%d] < "
			IWL_DEBUG_RATE(priv, "No action -- success_ratio [%d] < "
			       "SUCCESS UP\n", window->success_ratio);
			       "SUCCESS UP\n", window->success_ratio);
			scale_action = 0;
			scale_action = 0;
		}
		}
@@ -820,7 +820,7 @@ static void rs_get_rate(void *priv_r, struct ieee80211_sta *sta,
		break;
		break;
	}
	}


	IWL_DEBUG_RATE("Selected %d (action %d) - low %d high %d\n",
	IWL_DEBUG_RATE(priv, "Selected %d (action %d) - low %d high %d\n",
		       index, scale_action, low, high);
		       index, scale_action, low, high);


 out:
 out:
@@ -832,7 +832,7 @@ static void rs_get_rate(void *priv_r, struct ieee80211_sta *sta,
	else
	else
		info->control.rates[0].idx = rs_sta->last_txrate_idx;
		info->control.rates[0].idx = rs_sta->last_txrate_idx;


	IWL_DEBUG_RATE("leave: %d\n", index);
	IWL_DEBUG_RATE(priv, "leave: %d\n", index);
}
}


#ifdef CONFIG_MAC80211_DEBUGFS
#ifdef CONFIG_MAC80211_DEBUGFS
@@ -915,7 +915,7 @@ void iwl3945_rate_scale_init(struct ieee80211_hw *hw, s32 sta_id)
	struct ieee80211_sta *sta;
	struct ieee80211_sta *sta;
	struct iwl3945_sta_priv *psta;
	struct iwl3945_sta_priv *psta;


	IWL_DEBUG_RATE("enter\n");
	IWL_DEBUG_RATE(priv, "enter\n");


	rcu_read_lock();
	rcu_read_lock();


@@ -955,11 +955,11 @@ void iwl3945_rate_scale_init(struct ieee80211_hw *hw, s32 sta_id)
	if (rssi == 0)
	if (rssi == 0)
		rssi = IWL_MIN_RSSI_VAL;
		rssi = IWL_MIN_RSSI_VAL;


	IWL_DEBUG(IWL_DL_INFO | IWL_DL_RATE, "Network RSSI: %d\n", rssi);
	IWL_DEBUG_RATE(priv, "Network RSSI: %d\n", rssi);


	rs_sta->start_rate = iwl3945_get_rate_index_by_rssi(rssi, priv->band);
	rs_sta->start_rate = iwl3945_get_rate_index_by_rssi(rssi, priv->band);


	IWL_DEBUG_RATE("leave: rssi %d assign rate index: "
	IWL_DEBUG_RATE(priv, "leave: rssi %d assign rate index: "
		       "%d (plcp 0x%x)\n", rssi, rs_sta->start_rate,
		       "%d (plcp 0x%x)\n", rssi, rs_sta->start_rate,
		       iwl3945_rates[rs_sta->start_rate].plcp);
		       iwl3945_rates[rs_sta->start_rate].plcp);
	rcu_read_unlock();
	rcu_read_unlock();
+54 −55
Original line number Original line Diff line number Diff line
@@ -170,7 +170,7 @@ void iwl3945_disable_events(struct iwl_priv *priv)
	iwl_release_nic_access(priv);
	iwl_release_nic_access(priv);


	if (IWL_EVT_DISABLE && (array_size == IWL_EVT_DISABLE_SIZE)) {
	if (IWL_EVT_DISABLE && (array_size == IWL_EVT_DISABLE_SIZE)) {
		IWL_DEBUG_INFO("Disabling selected uCode log events at 0x%x\n",
		IWL_DEBUG_INFO(priv, "Disabling selected uCode log events at 0x%x\n",
			       disable_ptr);
			       disable_ptr);
		ret = iwl_grab_nic_access(priv);
		ret = iwl_grab_nic_access(priv);
		for (i = 0; i < IWL_EVT_DISABLE_SIZE; i++)
		for (i = 0; i < IWL_EVT_DISABLE_SIZE; i++)
@@ -180,9 +180,9 @@ void iwl3945_disable_events(struct iwl_priv *priv)


		iwl_release_nic_access(priv);
		iwl_release_nic_access(priv);
	} else {
	} else {
		IWL_DEBUG_INFO("Selected uCode log events may be disabled\n");
		IWL_DEBUG_INFO(priv, "Selected uCode log events may be disabled\n");
		IWL_DEBUG_INFO("  by writing \"1\"s into disable bitmap\n");
		IWL_DEBUG_INFO(priv, "  by writing \"1\"s into disable bitmap\n");
		IWL_DEBUG_INFO("  in SRAM at 0x%x, size %d u32s\n",
		IWL_DEBUG_INFO(priv, "  in SRAM at 0x%x, size %d u32s\n",
			       disable_ptr, array_size);
			       disable_ptr, array_size);
	}
	}


@@ -338,11 +338,11 @@ static void iwl3945_rx_reply_tx(struct iwl_priv *priv,
	info->flags |= ((status & TX_STATUS_MSK) == TX_STATUS_SUCCESS) ?
	info->flags |= ((status & TX_STATUS_MSK) == TX_STATUS_SUCCESS) ?
				IEEE80211_TX_STAT_ACK : 0;
				IEEE80211_TX_STAT_ACK : 0;


	IWL_DEBUG_TX("Tx queue %d Status %s (0x%08x) plcp rate %d retries %d\n",
	IWL_DEBUG_TX(priv, "Tx queue %d Status %s (0x%08x) plcp rate %d retries %d\n",
			txq_id, iwl3945_get_tx_fail_reason(status), status,
			txq_id, iwl3945_get_tx_fail_reason(status), status,
			tx_resp->rate, tx_resp->failure_frame);
			tx_resp->rate, tx_resp->failure_frame);


	IWL_DEBUG_TX_REPLY("Tx queue reclaim %d\n", index);
	IWL_DEBUG_TX_REPLY(priv, "Tx queue reclaim %d\n", index);
	iwl3945_tx_queue_reclaim(priv, txq_id, index);
	iwl3945_tx_queue_reclaim(priv, txq_id, index);


	if (iwl_check_bits(status, TX_ABORT_REQUIRED_MSK))
	if (iwl_check_bits(status, TX_ABORT_REQUIRED_MSK))
@@ -362,7 +362,7 @@ static void iwl3945_rx_reply_tx(struct iwl_priv *priv,
void iwl3945_hw_rx_statistics(struct iwl_priv *priv, struct iwl_rx_mem_buffer *rxb)
void iwl3945_hw_rx_statistics(struct iwl_priv *priv, struct iwl_rx_mem_buffer *rxb)
{
{
	struct iwl_rx_packet *pkt = (void *)rxb->skb->data;
	struct iwl_rx_packet *pkt = (void *)rxb->skb->data;
	IWL_DEBUG_RX("Statistics notification received (%d vs %d).\n",
	IWL_DEBUG_RX(priv, "Statistics notification received (%d vs %d).\n",
		     (int)sizeof(struct iwl3945_notif_statistics),
		     (int)sizeof(struct iwl3945_notif_statistics),
		     le32_to_cpu(pkt->len));
		     le32_to_cpu(pkt->len));


@@ -496,13 +496,13 @@ static void _iwl3945_dbg_report_frame(struct iwl_priv *priv,
		 * MAC addresses show just the last byte (for brevity),
		 * MAC addresses show just the last byte (for brevity),
		 *    but you can hack it to show more, if you'd like to. */
		 *    but you can hack it to show more, if you'd like to. */
		if (dataframe)
		if (dataframe)
			IWL_DEBUG_RX("%s: mhd=0x%04x, dst=0x%02x, "
			IWL_DEBUG_RX(priv, "%s: mhd=0x%04x, dst=0x%02x, "
				     "len=%u, rssi=%d, chnl=%d, rate=%d, \n",
				     "len=%u, rssi=%d, chnl=%d, rate=%d, \n",
				     title, le16_to_cpu(fc), header->addr1[5],
				     title, le16_to_cpu(fc), header->addr1[5],
				     length, rssi, channel, rate);
				     length, rssi, channel, rate);
		else {
		else {
			/* src/dst addresses assume managed mode */
			/* src/dst addresses assume managed mode */
			IWL_DEBUG_RX("%s: 0x%04x, dst=0x%02x, "
			IWL_DEBUG_RX(priv, "%s: 0x%04x, dst=0x%02x, "
				     "src=0x%02x, rssi=%u, tim=%lu usec, "
				     "src=0x%02x, rssi=%u, tim=%lu usec, "
				     "phy=0x%02x, chnl=%d\n",
				     "phy=0x%02x, chnl=%d\n",
				     title, le16_to_cpu(fc), header->addr1[5],
				     title, le16_to_cpu(fc), header->addr1[5],
@@ -563,14 +563,14 @@ static void iwl3945_pass_packet_to_mac80211(struct iwl_priv *priv,


	/* We received data from the HW, so stop the watchdog */
	/* We received data from the HW, so stop the watchdog */
	if (unlikely((len + IWL39_RX_FRAME_SIZE) > skb_tailroom(rxb->skb))) {
	if (unlikely((len + IWL39_RX_FRAME_SIZE) > skb_tailroom(rxb->skb))) {
		IWL_DEBUG_DROP("Corruption detected!\n");
		IWL_DEBUG_DROP(priv, "Corruption detected!\n");
		return;
		return;
	}
	}


	/* We only process data packets if the interface is open */
	/* We only process data packets if the interface is open */
	if (unlikely(!priv->is_open)) {
	if (unlikely(!priv->is_open)) {
		IWL_DEBUG_DROP_LIMIT
		IWL_DEBUG_DROP_LIMIT(priv,
		    ("Dropping packet while interface is not open.\n");
			"Dropping packet while interface is not open.\n");
		return;
		return;
	}
	}


@@ -626,15 +626,14 @@ static void iwl3945_rx_reply_rx(struct iwl_priv *priv,
		rx_status.flag |= RX_FLAG_SHORTPRE;
		rx_status.flag |= RX_FLAG_SHORTPRE;


	if ((unlikely(rx_stats->phy_count > 20))) {
	if ((unlikely(rx_stats->phy_count > 20))) {
		IWL_DEBUG_DROP
		IWL_DEBUG_DROP(priv, "dsp size out of range [0,20]: %d/n",
		    ("dsp size out of range [0,20]: "
				rx_stats->phy_count);
		     "%d/n", rx_stats->phy_count);
		return;
		return;
	}
	}


	if (!(rx_end->status & RX_RES_STATUS_NO_CRC32_ERROR)
	if (!(rx_end->status & RX_RES_STATUS_NO_CRC32_ERROR)
	    || !(rx_end->status & RX_RES_STATUS_NO_RXE_OVERFLOW)) {
	    || !(rx_end->status & RX_RES_STATUS_NO_RXE_OVERFLOW)) {
		IWL_DEBUG_RX("Bad CRC or FIFO: 0x%08X.\n", rx_end->status);
		IWL_DEBUG_RX(priv, "Bad CRC or FIFO: 0x%08X.\n", rx_end->status);
		return;
		return;
	}
	}


@@ -673,7 +672,7 @@ static void iwl3945_rx_reply_rx(struct iwl_priv *priv,
	}
	}




	IWL_DEBUG_STATS("Rssi %d noise %d qual %d sig_avg %d noise_diff %d\n",
	IWL_DEBUG_STATS(priv, "Rssi %d noise %d qual %d sig_avg %d noise_diff %d\n",
			rx_status.signal, rx_status.noise, rx_status.qual,
			rx_status.signal, rx_status.noise, rx_status.qual,
			rx_stats_sig_avg, rx_stats_noise_diff);
			rx_stats_sig_avg, rx_stats_noise_diff);


@@ -681,7 +680,7 @@ static void iwl3945_rx_reply_rx(struct iwl_priv *priv,


	network_packet = iwl3945_is_network_packet(priv, header);
	network_packet = iwl3945_is_network_packet(priv, header);


	IWL_DEBUG_STATS_LIMIT("[%c] %d RSSI:%d Signal:%u, Noise:%u, Rate:%u\n",
	IWL_DEBUG_STATS_LIMIT(priv, "[%c] %d RSSI:%d Signal:%u, Noise:%u, Rate:%u\n",
			      network_packet ? '*' : ' ',
			      network_packet ? '*' : ' ',
			      le16_to_cpu(rx_hdr->channel),
			      le16_to_cpu(rx_hdr->channel),
			      rx_status.signal, rx_status.signal,
			      rx_status.signal, rx_status.signal,
@@ -799,7 +798,7 @@ u8 iwl3945_hw_find_station(struct iwl_priv *priv, const u8 *addr)
			goto out;
			goto out;
		}
		}


	IWL_DEBUG_INFO("can not find STA %pM (total %d)\n",
	IWL_DEBUG_INFO(priv, "can not find STA %pM (total %d)\n",
		       addr, priv->num_stations);
		       addr, priv->num_stations);
 out:
 out:
	spin_unlock_irqrestore(&priv->sta_lock, flags);
	spin_unlock_irqrestore(&priv->sta_lock, flags);
@@ -874,7 +873,7 @@ void iwl3945_hw_build_tx_cmd_rate(struct iwl_priv *priv, struct iwl_cmd *cmd,
	/* CCK */
	/* CCK */
	tx->supp_rates[1] = (rate_mask & 0xF);
	tx->supp_rates[1] = (rate_mask & 0xF);


	IWL_DEBUG_RATE("Tx sta id: %d, rate: %d (plcp), flags: 0x%4X "
	IWL_DEBUG_RATE(priv, "Tx sta id: %d, rate: %d (plcp), flags: 0x%4X "
		       "cck/ofdm mask: 0x%x/0x%x\n", sta_id,
		       "cck/ofdm mask: 0x%x/0x%x\n", sta_id,
		       tx->rate, le32_to_cpu(tx->tx_flags),
		       tx->rate, le32_to_cpu(tx->tx_flags),
		       tx->supp_rates[1], tx->supp_rates[0]);
		       tx->supp_rates[1], tx->supp_rates[0]);
@@ -899,7 +898,7 @@ u8 iwl3945_sync_sta(struct iwl_priv *priv, int sta_id, u16 tx_rate, u8 flags)


	iwl_send_add_sta(priv,
	iwl_send_add_sta(priv,
			 (struct iwl_addsta_cmd *)&station->sta, flags);
			 (struct iwl_addsta_cmd *)&station->sta, flags);
	IWL_DEBUG_RATE("SCALE sync station %d to rate %d\n",
	IWL_DEBUG_RATE(priv, "SCALE sync station %d to rate %d\n",
			sta_id, tx_rate);
			sta_id, tx_rate);
	return sta_id;
	return sta_id;
}
}
@@ -1080,7 +1079,7 @@ static int iwl3945_apm_init(struct iwl_priv *priv)
	iwl_poll_direct_bit(priv, CSR_GP_CNTRL,
	iwl_poll_direct_bit(priv, CSR_GP_CNTRL,
			    CSR_GP_CNTRL_REG_FLAG_MAC_CLOCK_READY, 25000);
			    CSR_GP_CNTRL_REG_FLAG_MAC_CLOCK_READY, 25000);
	if (ret < 0) {
	if (ret < 0) {
		IWL_DEBUG_INFO("Failed to init the card\n");
		IWL_DEBUG_INFO(priv, "Failed to init the card\n");
		goto out;
		goto out;
	}
	}


@@ -1112,31 +1111,31 @@ static void iwl3945_nic_config(struct iwl_priv *priv)
	spin_lock_irqsave(&priv->lock, flags);
	spin_lock_irqsave(&priv->lock, flags);


	if (rev_id & PCI_CFG_REV_ID_BIT_RTP)
	if (rev_id & PCI_CFG_REV_ID_BIT_RTP)
		IWL_DEBUG_INFO("RTP type \n");
		IWL_DEBUG_INFO(priv, "RTP type \n");
	else if (rev_id & PCI_CFG_REV_ID_BIT_BASIC_SKU) {
	else if (rev_id & PCI_CFG_REV_ID_BIT_BASIC_SKU) {
		IWL_DEBUG_INFO("3945 RADIO-MB type\n");
		IWL_DEBUG_INFO(priv, "3945 RADIO-MB type\n");
		iwl_set_bit(priv, CSR_HW_IF_CONFIG_REG,
		iwl_set_bit(priv, CSR_HW_IF_CONFIG_REG,
			    CSR39_HW_IF_CONFIG_REG_BIT_3945_MB);
			    CSR39_HW_IF_CONFIG_REG_BIT_3945_MB);
	} else {
	} else {
		IWL_DEBUG_INFO("3945 RADIO-MM type\n");
		IWL_DEBUG_INFO(priv, "3945 RADIO-MM type\n");
		iwl_set_bit(priv, CSR_HW_IF_CONFIG_REG,
		iwl_set_bit(priv, CSR_HW_IF_CONFIG_REG,
			    CSR39_HW_IF_CONFIG_REG_BIT_3945_MM);
			    CSR39_HW_IF_CONFIG_REG_BIT_3945_MM);
	}
	}


	if (EEPROM_SKU_CAP_OP_MODE_MRC == eeprom->sku_cap) {
	if (EEPROM_SKU_CAP_OP_MODE_MRC == eeprom->sku_cap) {
		IWL_DEBUG_INFO("SKU OP mode is mrc\n");
		IWL_DEBUG_INFO(priv, "SKU OP mode is mrc\n");
		iwl_set_bit(priv, CSR_HW_IF_CONFIG_REG,
		iwl_set_bit(priv, CSR_HW_IF_CONFIG_REG,
			    CSR39_HW_IF_CONFIG_REG_BIT_SKU_MRC);
			    CSR39_HW_IF_CONFIG_REG_BIT_SKU_MRC);
	} else
	} else
		IWL_DEBUG_INFO("SKU OP mode is basic\n");
		IWL_DEBUG_INFO(priv, "SKU OP mode is basic\n");


	if ((eeprom->board_revision & 0xF0) == 0xD0) {
	if ((eeprom->board_revision & 0xF0) == 0xD0) {
		IWL_DEBUG_INFO("3945ABG revision is 0x%X\n",
		IWL_DEBUG_INFO(priv, "3945ABG revision is 0x%X\n",
			       eeprom->board_revision);
			       eeprom->board_revision);
		iwl_set_bit(priv, CSR_HW_IF_CONFIG_REG,
		iwl_set_bit(priv, CSR_HW_IF_CONFIG_REG,
			    CSR39_HW_IF_CONFIG_REG_BIT_BOARD_TYPE);
			    CSR39_HW_IF_CONFIG_REG_BIT_BOARD_TYPE);
	} else {
	} else {
		IWL_DEBUG_INFO("3945ABG revision is 0x%X\n",
		IWL_DEBUG_INFO(priv, "3945ABG revision is 0x%X\n",
			       eeprom->board_revision);
			       eeprom->board_revision);
		iwl_clear_bit(priv, CSR_HW_IF_CONFIG_REG,
		iwl_clear_bit(priv, CSR_HW_IF_CONFIG_REG,
			      CSR39_HW_IF_CONFIG_REG_BIT_BOARD_TYPE);
			      CSR39_HW_IF_CONFIG_REG_BIT_BOARD_TYPE);
@@ -1145,10 +1144,10 @@ static void iwl3945_nic_config(struct iwl_priv *priv)
	if (eeprom->almgor_m_version <= 1) {
	if (eeprom->almgor_m_version <= 1) {
		iwl_set_bit(priv, CSR_HW_IF_CONFIG_REG,
		iwl_set_bit(priv, CSR_HW_IF_CONFIG_REG,
			    CSR39_HW_IF_CONFIG_REG_BITS_SILICON_TYPE_A);
			    CSR39_HW_IF_CONFIG_REG_BITS_SILICON_TYPE_A);
		IWL_DEBUG_INFO("Card M type A version is 0x%X\n",
		IWL_DEBUG_INFO(priv, "Card M type A version is 0x%X\n",
			       eeprom->almgor_m_version);
			       eeprom->almgor_m_version);
	} else {
	} else {
		IWL_DEBUG_INFO("Card M type B version is 0x%X\n",
		IWL_DEBUG_INFO(priv, "Card M type B version is 0x%X\n",
			       eeprom->almgor_m_version);
			       eeprom->almgor_m_version);
		iwl_set_bit(priv, CSR_HW_IF_CONFIG_REG,
		iwl_set_bit(priv, CSR_HW_IF_CONFIG_REG,
			    CSR39_HW_IF_CONFIG_REG_BITS_SILICON_TYPE_B);
			    CSR39_HW_IF_CONFIG_REG_BITS_SILICON_TYPE_B);
@@ -1156,10 +1155,10 @@ static void iwl3945_nic_config(struct iwl_priv *priv)
	spin_unlock_irqrestore(&priv->lock, flags);
	spin_unlock_irqrestore(&priv->lock, flags);


	if (eeprom->sku_cap & EEPROM_SKU_CAP_SW_RF_KILL_ENABLE)
	if (eeprom->sku_cap & EEPROM_SKU_CAP_SW_RF_KILL_ENABLE)
		IWL_DEBUG_RF_KILL("SW RF KILL supported in EEPROM.\n");
		IWL_DEBUG_RF_KILL(priv, "SW RF KILL supported in EEPROM.\n");


	if (eeprom->sku_cap & EEPROM_SKU_CAP_HW_RF_KILL_ENABLE)
	if (eeprom->sku_cap & EEPROM_SKU_CAP_HW_RF_KILL_ENABLE)
		IWL_DEBUG_RF_KILL("HW RF KILL supported in EEPROM.\n");
		IWL_DEBUG_RF_KILL(priv, "HW RF KILL supported in EEPROM.\n");
}
}


int iwl3945_hw_nic_init(struct iwl_priv *priv)
int iwl3945_hw_nic_init(struct iwl_priv *priv)
@@ -1177,7 +1176,7 @@ int iwl3945_hw_nic_init(struct iwl_priv *priv)
	rc = pci_read_config_byte(priv->pci_dev, PCI_REVISION_ID, &rev_id);
	rc = pci_read_config_byte(priv->pci_dev, PCI_REVISION_ID, &rev_id);
	if (rc)
	if (rc)
		return rc;
		return rc;
	IWL_DEBUG_INFO("HW Revision ID = 0x%X\n", rev_id);
	IWL_DEBUG_INFO(priv, "HW Revision ID = 0x%X\n", rev_id);


	rc = priv->cfg->ops->lib->apm_ops.set_pwr_src(priv, IWL_PWR_SRC_VMAIN);
	rc = priv->cfg->ops->lib->apm_ops.set_pwr_src(priv, IWL_PWR_SRC_VMAIN);
	if(rc)
	if(rc)
@@ -1286,7 +1285,7 @@ static int iwl3945_apm_stop_master(struct iwl_priv *priv)


out:
out:
	spin_unlock_irqrestore(&priv->lock, flags);
	spin_unlock_irqrestore(&priv->lock, flags);
	IWL_DEBUG_INFO("stop master\n");
	IWL_DEBUG_INFO(priv, "stop master\n");


	return ret;
	return ret;
}
}
@@ -1391,7 +1390,7 @@ static int iwl3945_hw_reg_txpower_get_temperature(struct iwl_priv *priv)


	/* driver's okay range is -260 to +25.
	/* driver's okay range is -260 to +25.
	 *   human readable okay range is 0 to +285 */
	 *   human readable okay range is 0 to +285 */
	IWL_DEBUG_INFO("Temperature: %d\n", temperature + IWL_TEMP_CONVERT);
	IWL_DEBUG_INFO(priv, "Temperature: %d\n", temperature + IWL_TEMP_CONVERT);


	/* handle insane temp reading */
	/* handle insane temp reading */
	if (iwl3945_hw_reg_temp_out_of_range(temperature)) {
	if (iwl3945_hw_reg_temp_out_of_range(temperature)) {
@@ -1428,20 +1427,20 @@ static int is_temp_calib_needed(struct iwl_priv *priv)


	/* get absolute value */
	/* get absolute value */
	if (temp_diff < 0) {
	if (temp_diff < 0) {
		IWL_DEBUG_POWER("Getting cooler, delta %d,\n", temp_diff);
		IWL_DEBUG_POWER(priv, "Getting cooler, delta %d,\n", temp_diff);
		temp_diff = -temp_diff;
		temp_diff = -temp_diff;
	} else if (temp_diff == 0)
	} else if (temp_diff == 0)
		IWL_DEBUG_POWER("Same temp,\n");
		IWL_DEBUG_POWER(priv, "Same temp,\n");
	else
	else
		IWL_DEBUG_POWER("Getting warmer, delta %d,\n", temp_diff);
		IWL_DEBUG_POWER(priv, "Getting warmer, delta %d,\n", temp_diff);


	/* if we don't need calibration, *don't* update last_temperature */
	/* if we don't need calibration, *don't* update last_temperature */
	if (temp_diff < IWL_TEMPERATURE_LIMIT_TIMER) {
	if (temp_diff < IWL_TEMPERATURE_LIMIT_TIMER) {
		IWL_DEBUG_POWER("Timed thermal calib not needed\n");
		IWL_DEBUG_POWER(priv, "Timed thermal calib not needed\n");
		return 0;
		return 0;
	}
	}


	IWL_DEBUG_POWER("Timed thermal calib needed\n");
	IWL_DEBUG_POWER(priv, "Timed thermal calib needed\n");


	/* assume that caller will actually do calib ...
	/* assume that caller will actually do calib ...
	 *   update the "last temperature" value */
	 *   update the "last temperature" value */
@@ -1710,7 +1709,7 @@ static int iwl3945_send_tx_power(struct iwl_priv *priv)
	}
	}


	if (!is_channel_valid(ch_info)) {
	if (!is_channel_valid(ch_info)) {
		IWL_DEBUG_POWER("Not calling TX_PWR_TABLE_CMD on "
		IWL_DEBUG_POWER(priv, "Not calling TX_PWR_TABLE_CMD on "
				"non-Tx channel.\n");
				"non-Tx channel.\n");
		return 0;
		return 0;
	}
	}
@@ -1723,7 +1722,7 @@ static int iwl3945_send_tx_power(struct iwl_priv *priv)
		txpower.power[i].tpc = ch_info->power_info[i].tpc;
		txpower.power[i].tpc = ch_info->power_info[i].tpc;
		txpower.power[i].rate = iwl3945_rates[rate_idx].plcp;
		txpower.power[i].rate = iwl3945_rates[rate_idx].plcp;


		IWL_DEBUG_POWER("ch %d:%d rf %d dsp %3d rate code 0x%02x\n",
		IWL_DEBUG_POWER(priv, "ch %d:%d rf %d dsp %3d rate code 0x%02x\n",
				le16_to_cpu(txpower.channel),
				le16_to_cpu(txpower.channel),
				txpower.band,
				txpower.band,
				txpower.power[i].tpc.tx_gain,
				txpower.power[i].tpc.tx_gain,
@@ -1736,7 +1735,7 @@ static int iwl3945_send_tx_power(struct iwl_priv *priv)
		txpower.power[i].tpc = ch_info->power_info[i].tpc;
		txpower.power[i].tpc = ch_info->power_info[i].tpc;
		txpower.power[i].rate = iwl3945_rates[rate_idx].plcp;
		txpower.power[i].rate = iwl3945_rates[rate_idx].plcp;


		IWL_DEBUG_POWER("ch %d:%d rf %d dsp %3d rate code 0x%02x\n",
		IWL_DEBUG_POWER(priv, "ch %d:%d rf %d dsp %3d rate code 0x%02x\n",
				le16_to_cpu(txpower.channel),
				le16_to_cpu(txpower.channel),
				txpower.band,
				txpower.band,
				txpower.power[i].tpc.tx_gain,
				txpower.power[i].tpc.tx_gain,
@@ -1927,12 +1926,12 @@ int iwl3945_hw_reg_set_txpower(struct iwl_priv *priv, s8 power)
	u8 i;
	u8 i;


	if (priv->tx_power_user_lmt == power) {
	if (priv->tx_power_user_lmt == power) {
		IWL_DEBUG_POWER("Requested Tx power same as current "
		IWL_DEBUG_POWER(priv, "Requested Tx power same as current "
				"limit: %ddBm.\n", power);
				"limit: %ddBm.\n", power);
		return 0;
		return 0;
	}
	}


	IWL_DEBUG_POWER("Setting upper limit clamp to %ddBm.\n", power);
	IWL_DEBUG_POWER(priv, "Setting upper limit clamp to %ddBm.\n", power);
	priv->tx_power_user_lmt = power;
	priv->tx_power_user_lmt = power;


	/* set up new Tx powers for each and every channel, 2.4 and 5.x */
	/* set up new Tx powers for each and every channel, 2.4 and 5.x */
@@ -2042,7 +2041,7 @@ static u16 iwl3945_hw_reg_get_ch_grp_index(struct iwl_priv *priv,
	} else
	} else
		group_index = 0;	/* 2.4 GHz, group 0 */
		group_index = 0;	/* 2.4 GHz, group 0 */


	IWL_DEBUG_POWER("Chnl %d mapped to grp %d\n", ch_info->channel,
	IWL_DEBUG_POWER(priv, "Chnl %d mapped to grp %d\n", ch_info->channel,
			group_index);
			group_index);
	return group_index;
	return group_index;
}
}
@@ -2109,7 +2108,7 @@ static void iwl3945_hw_reg_init_channel_groups(struct iwl_priv *priv)
	struct iwl3945_eeprom *eeprom = (struct iwl3945_eeprom *)priv->eeprom;
	struct iwl3945_eeprom *eeprom = (struct iwl3945_eeprom *)priv->eeprom;
	const struct iwl3945_eeprom_txpower_group *group;
	const struct iwl3945_eeprom_txpower_group *group;


	IWL_DEBUG_POWER("Initializing factory calib info from EEPROM\n");
	IWL_DEBUG_POWER(priv, "Initializing factory calib info from EEPROM\n");


	for (i = 0; i < IWL_NUM_TX_CALIB_GROUPS; i++) {
	for (i = 0; i < IWL_NUM_TX_CALIB_GROUPS; i++) {
		s8 *clip_pwrs;	/* table of power levels for each rate */
		s8 *clip_pwrs;	/* table of power levels for each rate */
@@ -2225,7 +2224,7 @@ int iwl3945_txpower_set_from_eeprom(struct iwl_priv *priv)
				eeprom->groups[ch_info->group_index].
				eeprom->groups[ch_info->group_index].
				temperature);
				temperature);


		IWL_DEBUG_POWER("Delta index for channel %d: %d [%d]\n",
		IWL_DEBUG_POWER(priv, "Delta index for channel %d: %d [%d]\n",
				ch_info->channel, delta_index, temperature +
				ch_info->channel, delta_index, temperature +
				IWL_TEMP_CONVERT);
				IWL_TEMP_CONVERT);


@@ -2410,7 +2409,7 @@ int iwl3945_init_hw_rate_table(struct iwl_priv *priv)


	switch (priv->band) {
	switch (priv->band) {
	case IEEE80211_BAND_5GHZ:
	case IEEE80211_BAND_5GHZ:
		IWL_DEBUG_RATE("Select A mode rate scale\n");
		IWL_DEBUG_RATE(priv, "Select A mode rate scale\n");
		/* If one of the following CCK rates is used,
		/* If one of the following CCK rates is used,
		 * have it fall back to the 6M OFDM rate */
		 * have it fall back to the 6M OFDM rate */
		for (i = IWL_RATE_1M_INDEX_TABLE;
		for (i = IWL_RATE_1M_INDEX_TABLE;
@@ -2428,7 +2427,7 @@ int iwl3945_init_hw_rate_table(struct iwl_priv *priv)
		break;
		break;


	case IEEE80211_BAND_2GHZ:
	case IEEE80211_BAND_2GHZ:
		IWL_DEBUG_RATE("Select B/G mode rate scale\n");
		IWL_DEBUG_RATE(priv, "Select B/G mode rate scale\n");
		/* If an OFDM rate is used, have it fall back to the
		/* If an OFDM rate is used, have it fall back to the
		 * 1M CCK rates */
		 * 1M CCK rates */


@@ -2553,7 +2552,7 @@ static int iwl3945_verify_bsm(struct iwl_priv *priv)
	u32 reg;
	u32 reg;
	u32 val;
	u32 val;


	IWL_DEBUG_INFO("Begin verify bsm\n");
	IWL_DEBUG_INFO(priv, "Begin verify bsm\n");


	/* verify BSM SRAM contents */
	/* verify BSM SRAM contents */
	val = iwl_read_prph(priv, BSM_WR_DWCOUNT_REG);
	val = iwl_read_prph(priv, BSM_WR_DWCOUNT_REG);
@@ -2571,7 +2570,7 @@ static int iwl3945_verify_bsm(struct iwl_priv *priv)
		}
		}
	}
	}


	IWL_DEBUG_INFO("BSM bootstrap uCode image OK\n");
	IWL_DEBUG_INFO(priv, "BSM bootstrap uCode image OK\n");


	return 0;
	return 0;
}
}
@@ -2648,7 +2647,7 @@ static int iwl3945_load_bsm(struct iwl_priv *priv)
	u32 done;
	u32 done;
	u32 reg_offset;
	u32 reg_offset;


	IWL_DEBUG_INFO("Begin load bsm\n");
	IWL_DEBUG_INFO(priv, "Begin load bsm\n");


	/* make sure bootstrap program is no larger than BSM's SRAM size */
	/* make sure bootstrap program is no larger than BSM's SRAM size */
	if (len > IWL39_MAX_BSM_SIZE)
	if (len > IWL39_MAX_BSM_SIZE)
@@ -2705,7 +2704,7 @@ static int iwl3945_load_bsm(struct iwl_priv *priv)
		udelay(10);
		udelay(10);
	}
	}
	if (i < 100)
	if (i < 100)
		IWL_DEBUG_INFO("BSM write complete, poll %d iterations\n", i);
		IWL_DEBUG_INFO(priv, "BSM write complete, poll %d iterations\n", i);
	else {
	else {
		IWL_ERR(priv, "BSM write did not complete!\n");
		IWL_ERR(priv, "BSM write did not complete!\n");
		return -EIO;
		return -EIO;
+63 −63

File changed.

Preview size limit exceeded, changes collapsed.

+27 −27
Original line number Original line Diff line number Diff line
@@ -84,7 +84,7 @@ static int iwl5000_apm_stop_master(struct iwl_priv *priv)
				  CSR_RESET_REG_FLAG_MASTER_DISABLED, 100);
				  CSR_RESET_REG_FLAG_MASTER_DISABLED, 100);


	spin_unlock_irqrestore(&priv->lock, flags);
	spin_unlock_irqrestore(&priv->lock, flags);
	IWL_DEBUG_INFO("stop master\n");
	IWL_DEBUG_INFO(priv, "stop master\n");


	return 0;
	return 0;
}
}
@@ -118,7 +118,7 @@ static int iwl5000_apm_init(struct iwl_priv *priv)
	ret = iwl_poll_direct_bit(priv, CSR_GP_CNTRL,
	ret = iwl_poll_direct_bit(priv, CSR_GP_CNTRL,
			CSR_GP_CNTRL_REG_FLAG_MAC_CLOCK_READY, 25000);
			CSR_GP_CNTRL_REG_FLAG_MAC_CLOCK_READY, 25000);
	if (ret < 0) {
	if (ret < 0) {
		IWL_DEBUG_INFO("Failed to init the card\n");
		IWL_DEBUG_INFO(priv, "Failed to init the card\n");
		return ret;
		return ret;
	}
	}


@@ -186,7 +186,7 @@ static int iwl5000_apm_reset(struct iwl_priv *priv)
	ret = iwl_poll_direct_bit(priv, CSR_GP_CNTRL,
	ret = iwl_poll_direct_bit(priv, CSR_GP_CNTRL,
			CSR_GP_CNTRL_REG_FLAG_MAC_CLOCK_READY, 25000);
			CSR_GP_CNTRL_REG_FLAG_MAC_CLOCK_READY, 25000);
	if (ret < 0) {
	if (ret < 0) {
		IWL_DEBUG_INFO("Failed to init the card\n");
		IWL_DEBUG_INFO(priv, "Failed to init the card\n");
		goto out;
		goto out;
	}
	}


@@ -338,7 +338,7 @@ static void iwl5000_gain_computation(struct iwl_priv *priv,
			data->delta_gain_code[i] |= (1 << 2);
			data->delta_gain_code[i] |= (1 << 2);
	}
	}


	IWL_DEBUG_CALIB("Delta gains: ANT_B = %d  ANT_C = %d\n",
	IWL_DEBUG_CALIB(priv, "Delta gains: ANT_B = %d  ANT_C = %d\n",
			data->delta_gain_code[1], data->delta_gain_code[2]);
			data->delta_gain_code[1], data->delta_gain_code[2]);


	if (!data->radio_write) {
	if (!data->radio_write) {
@@ -387,7 +387,7 @@ static void iwl5000_chain_noise_reset(struct iwl_priv *priv)
			IWL_ERR(priv,
			IWL_ERR(priv,
				"Could not send REPLY_PHY_CALIBRATION_CMD\n");
				"Could not send REPLY_PHY_CALIBRATION_CMD\n");
		data->state = IWL_CHAIN_NOISE_ACCUMULATE;
		data->state = IWL_CHAIN_NOISE_ACCUMULATE;
		IWL_DEBUG_CALIB("Run chain_noise_calibrate\n");
		IWL_DEBUG_CALIB(priv, "Run chain_noise_calibrate\n");
	}
	}
}
}


@@ -518,7 +518,7 @@ static void iwl5000_rx_calib_result(struct iwl_priv *priv,
static void iwl5000_rx_calib_complete(struct iwl_priv *priv,
static void iwl5000_rx_calib_complete(struct iwl_priv *priv,
			       struct iwl_rx_mem_buffer *rxb)
			       struct iwl_rx_mem_buffer *rxb)
{
{
	IWL_DEBUG_INFO("Init. calibration is completed, restarting fw.\n");
	IWL_DEBUG_INFO(priv, "Init. calibration is completed, restarting fw.\n");
	queue_work(priv->workqueue, &priv->restart);
	queue_work(priv->workqueue, &priv->restart);
}
}


@@ -586,7 +586,7 @@ static int iwl5000_load_given_ucode(struct iwl_priv *priv,
	if (ret)
	if (ret)
		return ret;
		return ret;


	IWL_DEBUG_INFO("INST uCode section being loaded...\n");
	IWL_DEBUG_INFO(priv, "INST uCode section being loaded...\n");
	ret = wait_event_interruptible_timeout(priv->wait_command_queue,
	ret = wait_event_interruptible_timeout(priv->wait_command_queue,
					priv->ucode_write_complete, 5 * HZ);
					priv->ucode_write_complete, 5 * HZ);
	if (ret == -ERESTARTSYS) {
	if (ret == -ERESTARTSYS) {
@@ -606,7 +606,7 @@ static int iwl5000_load_given_ucode(struct iwl_priv *priv,
	if (ret)
	if (ret)
		return ret;
		return ret;


	IWL_DEBUG_INFO("DATA uCode section being loaded...\n");
	IWL_DEBUG_INFO(priv, "DATA uCode section being loaded...\n");


	ret = wait_event_interruptible_timeout(priv->wait_command_queue,
	ret = wait_event_interruptible_timeout(priv->wait_command_queue,
				priv->ucode_write_complete, 5 * HZ);
				priv->ucode_write_complete, 5 * HZ);
@@ -631,20 +631,20 @@ static int iwl5000_load_ucode(struct iwl_priv *priv)


	/* check whether init ucode should be loaded, or rather runtime ucode */
	/* check whether init ucode should be loaded, or rather runtime ucode */
	if (priv->ucode_init.len && (priv->ucode_type == UCODE_NONE)) {
	if (priv->ucode_init.len && (priv->ucode_type == UCODE_NONE)) {
		IWL_DEBUG_INFO("Init ucode found. Loading init ucode...\n");
		IWL_DEBUG_INFO(priv, "Init ucode found. Loading init ucode...\n");
		ret = iwl5000_load_given_ucode(priv,
		ret = iwl5000_load_given_ucode(priv,
			&priv->ucode_init, &priv->ucode_init_data);
			&priv->ucode_init, &priv->ucode_init_data);
		if (!ret) {
		if (!ret) {
			IWL_DEBUG_INFO("Init ucode load complete.\n");
			IWL_DEBUG_INFO(priv, "Init ucode load complete.\n");
			priv->ucode_type = UCODE_INIT;
			priv->ucode_type = UCODE_INIT;
		}
		}
	} else {
	} else {
		IWL_DEBUG_INFO("Init ucode not found, or already loaded. "
		IWL_DEBUG_INFO(priv, "Init ucode not found, or already loaded. "
			"Loading runtime ucode...\n");
			"Loading runtime ucode...\n");
		ret = iwl5000_load_given_ucode(priv,
		ret = iwl5000_load_given_ucode(priv,
			&priv->ucode_code, &priv->ucode_data);
			&priv->ucode_code, &priv->ucode_data);
		if (!ret) {
		if (!ret) {
			IWL_DEBUG_INFO("Runtime ucode load complete.\n");
			IWL_DEBUG_INFO(priv, "Runtime ucode load complete.\n");
			priv->ucode_type = UCODE_RT;
			priv->ucode_type = UCODE_RT;
		}
		}
	}
	}
@@ -660,7 +660,7 @@ static void iwl5000_init_alive_start(struct iwl_priv *priv)
	if (priv->card_alive_init.is_valid != UCODE_VALID_OK) {
	if (priv->card_alive_init.is_valid != UCODE_VALID_OK) {
		/* We had an error bringing up the hardware, so take it
		/* We had an error bringing up the hardware, so take it
		 * all the way back down so we can try again */
		 * all the way back down so we can try again */
		IWL_DEBUG_INFO("Initialize Alive failed.\n");
		IWL_DEBUG_INFO(priv, "Initialize Alive failed.\n");
		goto restart;
		goto restart;
	}
	}


@@ -670,7 +670,7 @@ static void iwl5000_init_alive_start(struct iwl_priv *priv)
	if (iwl_verify_ucode(priv)) {
	if (iwl_verify_ucode(priv)) {
		/* Runtime instruction load was bad;
		/* Runtime instruction load was bad;
		 * take it all the way back down so we can try again */
		 * take it all the way back down so we can try again */
		IWL_DEBUG_INFO("Bad \"initialize\" uCode load.\n");
		IWL_DEBUG_INFO(priv, "Bad \"initialize\" uCode load.\n");
		goto restart;
		goto restart;
	}
	}


@@ -713,7 +713,7 @@ static void iwl5000_tx_queue_set_status(struct iwl_priv *priv,


	txq->sched_retry = scd_retry;
	txq->sched_retry = scd_retry;


	IWL_DEBUG_INFO("%s %s Queue %d on AC %d\n",
	IWL_DEBUG_INFO(priv, "%s %s Queue %d on AC %d\n",
		       active ? "Activate" : "Deactivate",
		       active ? "Activate" : "Deactivate",
		       scd_retry ? "BA" : "AC", txq_id, tx_fifo_id);
		       scd_retry ? "BA" : "AC", txq_id, tx_fifo_id);
}
}
@@ -1151,7 +1151,7 @@ static int iwl5000_tx_status_reply_tx(struct iwl_priv *priv,
	u16 seq;
	u16 seq;


	if (agg->wait_for_ba)
	if (agg->wait_for_ba)
		IWL_DEBUG_TX_REPLY("got tx response w/o block-ack\n");
		IWL_DEBUG_TX_REPLY(priv, "got tx response w/o block-ack\n");


	agg->frame_count = tx_resp->frame_count;
	agg->frame_count = tx_resp->frame_count;
	agg->start_idx = start_idx;
	agg->start_idx = start_idx;
@@ -1165,7 +1165,7 @@ static int iwl5000_tx_status_reply_tx(struct iwl_priv *priv,
		idx = start_idx;
		idx = start_idx;


		/* FIXME: code repetition */
		/* FIXME: code repetition */
		IWL_DEBUG_TX_REPLY("FrameCnt = %d, StartIdx=%d idx=%d\n",
		IWL_DEBUG_TX_REPLY(priv, "FrameCnt = %d, StartIdx=%d idx=%d\n",
				   agg->frame_count, agg->start_idx, idx);
				   agg->frame_count, agg->start_idx, idx);


		info = IEEE80211_SKB_CB(priv->txq[txq_id].txb[idx].skb[0]);
		info = IEEE80211_SKB_CB(priv->txq[txq_id].txb[idx].skb[0]);
@@ -1177,9 +1177,9 @@ static int iwl5000_tx_status_reply_tx(struct iwl_priv *priv,


		/* FIXME: code repetition end */
		/* FIXME: code repetition end */


		IWL_DEBUG_TX_REPLY("1 Frame 0x%x failure :%d\n",
		IWL_DEBUG_TX_REPLY(priv, "1 Frame 0x%x failure :%d\n",
				    status & 0xff, tx_resp->failure_frame);
				    status & 0xff, tx_resp->failure_frame);
		IWL_DEBUG_TX_REPLY("Rate Info rate_n_flags=%x\n", rate_n_flags);
		IWL_DEBUG_TX_REPLY(priv, "Rate Info rate_n_flags=%x\n", rate_n_flags);


		agg->wait_for_ba = 0;
		agg->wait_for_ba = 0;
	} else {
	} else {
@@ -1199,7 +1199,7 @@ static int iwl5000_tx_status_reply_tx(struct iwl_priv *priv,
				      AGG_TX_STATE_ABORT_MSK))
				      AGG_TX_STATE_ABORT_MSK))
				continue;
				continue;


			IWL_DEBUG_TX_REPLY("FrameCnt = %d, txq_id=%d idx=%d\n",
			IWL_DEBUG_TX_REPLY(priv, "FrameCnt = %d, txq_id=%d idx=%d\n",
					   agg->frame_count, txq_id, idx);
					   agg->frame_count, txq_id, idx);


			hdr = iwl_tx_queue_get_hdr(priv, txq_id, idx);
			hdr = iwl_tx_queue_get_hdr(priv, txq_id, idx);
@@ -1214,7 +1214,7 @@ static int iwl5000_tx_status_reply_tx(struct iwl_priv *priv,
				return -1;
				return -1;
			}
			}


			IWL_DEBUG_TX_REPLY("AGG Frame i=%d idx %d seq=%d\n",
			IWL_DEBUG_TX_REPLY(priv, "AGG Frame i=%d idx %d seq=%d\n",
					   i, idx, SEQ_TO_SN(sc));
					   i, idx, SEQ_TO_SN(sc));


			sh = idx - start;
			sh = idx - start;
@@ -1232,13 +1232,13 @@ static int iwl5000_tx_status_reply_tx(struct iwl_priv *priv,
				sh = 0;
				sh = 0;
			}
			}
			bitmap |= 1ULL << sh;
			bitmap |= 1ULL << sh;
			IWL_DEBUG_TX_REPLY("start=%d bitmap=0x%llx\n",
			IWL_DEBUG_TX_REPLY(priv, "start=%d bitmap=0x%llx\n",
					   start, (unsigned long long)bitmap);
					   start, (unsigned long long)bitmap);
		}
		}


		agg->bitmap = bitmap;
		agg->bitmap = bitmap;
		agg->start_idx = start;
		agg->start_idx = start;
		IWL_DEBUG_TX_REPLY("Frames %d start_idx=%d bitmap=0x%llx\n",
		IWL_DEBUG_TX_REPLY(priv, "Frames %d start_idx=%d bitmap=0x%llx\n",
				   agg->frame_count, agg->start_idx,
				   agg->frame_count, agg->start_idx,
				   (unsigned long long)agg->bitmap);
				   (unsigned long long)agg->bitmap);


@@ -1291,7 +1291,7 @@ static void iwl5000_rx_reply_tx(struct iwl_priv *priv,


		if (txq->q.read_ptr != (scd_ssn & 0xff)) {
		if (txq->q.read_ptr != (scd_ssn & 0xff)) {
			index = iwl_queue_dec_wrap(scd_ssn & 0xff, txq->q.n_bd);
			index = iwl_queue_dec_wrap(scd_ssn & 0xff, txq->q.n_bd);
			IWL_DEBUG_TX_REPLY("Retry scheduler reclaim "
			IWL_DEBUG_TX_REPLY(priv, "Retry scheduler reclaim "
					"scd_ssn=%d idx=%d txq=%d swq=%d\n",
					"scd_ssn=%d idx=%d txq=%d swq=%d\n",
					scd_ssn , index, txq_id, txq->swq_id);
					scd_ssn , index, txq_id, txq->swq_id);


@@ -1318,7 +1318,7 @@ static void iwl5000_rx_reply_tx(struct iwl_priv *priv,
					le32_to_cpu(tx_resp->rate_n_flags),
					le32_to_cpu(tx_resp->rate_n_flags),
					info);
					info);


		IWL_DEBUG_TX_REPLY("TXQ %d status %s (0x%08x) rate_n_flags "
		IWL_DEBUG_TX_REPLY(priv, "TXQ %d status %s (0x%08x) rate_n_flags "
				   "0x%x retries %d\n",
				   "0x%x retries %d\n",
				   txq_id,
				   txq_id,
				   iwl_get_tx_fail_reason(status), status,
				   iwl_get_tx_fail_reason(status), status,
@@ -1389,7 +1389,7 @@ static int iwl5000_send_rxon_assoc(struct iwl_priv *priv)
	    (rxon1->acquisition_data == rxon2->acquisition_data) &&
	    (rxon1->acquisition_data == rxon2->acquisition_data) &&
	    (rxon1->rx_chain == rxon2->rx_chain) &&
	    (rxon1->rx_chain == rxon2->rx_chain) &&
	    (rxon1->ofdm_basic_rates == rxon2->ofdm_basic_rates)) {
	    (rxon1->ofdm_basic_rates == rxon2->ofdm_basic_rates)) {
		IWL_DEBUG_INFO("Using current RXON_ASSOC.  Not resending.\n");
		IWL_DEBUG_INFO(priv, "Using current RXON_ASSOC.  Not resending.\n");
		return 0;
		return 0;
	}
	}


@@ -1465,7 +1465,7 @@ static int iwl5000_calc_rssi(struct iwl_priv *priv,
	max_rssi = max_t(u32, rssi_a, rssi_b);
	max_rssi = max_t(u32, rssi_a, rssi_b);
	max_rssi = max_t(u32, max_rssi, rssi_c);
	max_rssi = max_t(u32, max_rssi, rssi_c);


	IWL_DEBUG_STATS("Rssi In A %d B %d C %d Max %d AGC dB %d\n",
	IWL_DEBUG_STATS(priv, "Rssi In A %d B %d C %d Max %d AGC dB %d\n",
		rssi_a, rssi_b, rssi_c, max_rssi, agc);
		rssi_a, rssi_b, rssi_c, max_rssi, agc);


	/* dBm = max_rssi dB - agc dB - constant.
	/* dBm = max_rssi dB - agc dB - constant.
Loading