Commit a3139c59 authored by Samuel Ortiz's avatar Samuel Ortiz Committed by John W. Linville
Browse files

iwl3945: Remove DRV_NAME dependenies



As DRV_NAME is defined in 2 different header files, including both is not
possible.
This patch defines this constant from iwl3945-base.c and iwl-agn.c. It also
redefines the IWL_ERROR and IWL_WARNING macros to use dev_printk, as the
IWL_DEBUG_* macros do.

Signed-off-by: default avatarSamuel Ortiz <samuel.ortiz@intel.com>
Acked-by: default avatarAbhijeet Kolekar <abhijeet.kolekar@intel.com>
Signed-off-by: default avatarReinette Chatre <reinette.chatre@intel.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 40b8ec0b
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -43,7 +43,6 @@
/* Hardware specific file defines the PCI IDs table for that hardware module */
extern struct pci_device_id iwl3945_hw_card_ids[];

#define DRV_NAME	"iwl3945"
#include "iwl-csr.h"
#include "iwl-prph.h"
#include "iwl-3945-hw.h"
+4 −2
Original line number Diff line number Diff line
@@ -902,7 +902,6 @@ static s32 iwl4965_get_tx_atten_grp(u16 channel)
	    channel <= CALIB_IWL_TX_ATTEN_GR4_LCH)
		return CALIB_CH_GROUP_4;

	IWL_ERROR("Can't find txatten group for channel %d.\n", channel);
	return -1;
}

@@ -1319,8 +1318,11 @@ static int iwl4965_fill_txpower_tbl(struct iwl_priv *priv, u8 band, u16 channel,
	/* get txatten group, used to select 1) thermal txpower adjustment
	 *   and 2) mimo txpower balance between Tx chains. */
	txatten_grp = iwl4965_get_tx_atten_grp(channel);
	if (txatten_grp < 0)
	if (txatten_grp < 0) {
		IWL_ERROR("Can't find txatten group for channel %d.\n",
			  channel);
		return -EINVAL;
	}

	IWL_DEBUG_TXPOWER("channel %d belongs to txatten group %d\n",
			  channel, txatten_grp);
+2 −1
Original line number Diff line number Diff line
@@ -40,10 +40,11 @@
 * be #ifdef'd out once the driver is stable and folks aren't actively
 * making changes
 */
int iwl_agn_check_rxon_cmd(struct iwl_rxon_cmd *rxon)
int iwl_agn_check_rxon_cmd(struct iwl_priv *priv)
{
	int error = 0;
	int counter = 1;
	struct iwl_rxon_cmd *rxon = &priv->staging_rxon;

	if (rxon->flags & RXON_FLG_BAND_24G_MSK) {
		error |= le32_to_cpu(rxon->flags &
+6 −3
Original line number Diff line number Diff line
@@ -475,7 +475,8 @@ static u32 rate_n_flags_from_tbl(struct iwl_scale_tbl_info *tbl,

	} else if (is_Ht(tbl->lq_type)) {
		if (index > IWL_LAST_OFDM_RATE) {
			IWL_ERROR("invalid HT rate index %d\n", index);
			printk(KERN_ERR RS_NAME": Invalid HT rate index %d\n",
			       index);
			index = IWL_LAST_OFDM_RATE;
		}
		rate_n_flags = RATE_MCS_HT_MSK;
@@ -487,7 +488,8 @@ static u32 rate_n_flags_from_tbl(struct iwl_scale_tbl_info *tbl,
		else
			rate_n_flags |=	iwl_rates[index].plcp_mimo3;
	} else {
		IWL_ERROR("Invalid tbl->lq_type %d\n", tbl->lq_type);
		printk(KERN_ERR RS_NAME": Invalid tbl->lq_type %d\n",
		       tbl->lq_type);
	}

	rate_n_flags |= ((tbl->ant_type << RATE_MCS_ANT_POS) &
@@ -507,7 +509,8 @@ static u32 rate_n_flags_from_tbl(struct iwl_scale_tbl_info *tbl,
			rate_n_flags |= RATE_MCS_GF_MSK;
			if (is_siso(tbl->lq_type) && tbl->is_SGI) {
				rate_n_flags &= ~RATE_MCS_SGI_MSK;
				IWL_ERROR("GF was set with SGI:SISO\n");
				printk(KERN_ERR RS_NAME
				       ": GF was set with SGI:SISO\n");
			}
		}
	}
+6 −5
Original line number Diff line number Diff line
@@ -44,6 +44,8 @@

#include <asm/div64.h>

#define DRV_NAME        "iwlagn"

#include "iwl-eeprom.h"
#include "iwl-dev.h"
#include "iwl-core.h"
@@ -61,9 +63,7 @@

/*
 * module name, copyright, version, etc.
 * NOTE: DRV_NAME is defined in iwlwifi.h for use by iwl-debug.h and printk
 */

#define DRV_DESCRIPTION	"Intel(R) Wireless WiFi Link AGN driver for Linux"

#ifdef CONFIG_IWLWIFI_DEBUG
@@ -179,7 +179,7 @@ static int iwl_commit_rxon(struct iwl_priv *priv)
	 * 5000, but will not damage 4965 */
	priv->staging_rxon.flags |= RXON_FLG_SELF_CTS_EN;

	ret = iwl_agn_check_rxon_cmd(&priv->staging_rxon);
	ret = iwl_agn_check_rxon_cmd(priv);
	if (ret) {
		IWL_ERROR("Invalid RXON configuration.  Not committing.\n");
		return -EINVAL;
@@ -4077,13 +4077,14 @@ static int __init iwl_init(void)

	ret = iwlagn_rate_control_register();
	if (ret) {
		IWL_ERROR("Unable to register rate control algorithm: %d\n", ret);
		printk(KERN_ERR DRV_NAME
		       "Unable to register rate control algorithm: %d\n", ret);
		return ret;
	}

	ret = pci_register_driver(&iwl_driver);
	if (ret) {
		IWL_ERROR("Unable to initialize PCI module\n");
		printk(KERN_ERR DRV_NAME "Unable to initialize PCI module\n");
		goto error_register;
	}

Loading