Skip to content

Commit

Permalink
iwl3945: Getting rid of iwl-3945-debug.h
Browse files Browse the repository at this point in the history
At the cost of adding a debug_level field to iwl3945_priv, we are now able to
get rid of iwl-3945-debug.h, and use iwl-debug.h instead.

Signed-off-by: Samuel Ortiz <samuel.ortiz@intel.com>
Signed-off-by: Abhijeet Kolekar <abhijeet.kolekar@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
  • Loading branch information
Samuel Ortiz authored and John W. Linville committed Jan 29, 2009
1 parent 3d24a9f commit 40b8ec0
Show file tree
Hide file tree
Showing 7 changed files with 59 additions and 227 deletions.
167 changes: 0 additions & 167 deletions drivers/net/wireless/iwlwifi/iwl-3945-debug.h

This file was deleted.

2 changes: 1 addition & 1 deletion drivers/net/wireless/iwlwifi/iwl-3945-io.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@

#include <linux/io.h>

#include "iwl-3945-debug.h"
#include "iwl-debug.h"

/*
* IO, register, and NIC memory access functions
Expand Down
13 changes: 11 additions & 2 deletions drivers/net/wireless/iwlwifi/iwl-3945-rs.c
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ struct iwl3945_rate_scale_data {

struct iwl3945_rs_sta {
spinlock_t lock;
struct iwl3945_priv *priv;
s32 *expected_tpt;
unsigned long last_partial_flush;
unsigned long last_flush;
Expand Down Expand Up @@ -182,6 +183,7 @@ static int iwl3945_rate_scale_flush_windows(struct iwl3945_rs_sta *rs_sta)
int unflushed = 0;
int i;
unsigned long flags;
struct iwl3945_priv *priv = rs_sta->priv;

/*
* For each rate, if we have collected data on that rate
Expand Down Expand Up @@ -214,6 +216,7 @@ static int iwl3945_rate_scale_flush_windows(struct iwl3945_rs_sta *rs_sta)
static void iwl3945_bg_rate_scale_flush(unsigned long data)
{
struct iwl3945_rs_sta *rs_sta = (void *)data;
struct iwl3945_priv *priv = rs_sta->priv;
int unflushed = 0;
unsigned long flags;
u32 packet_count, duration, pps;
Expand Down Expand Up @@ -287,6 +290,7 @@ static void iwl3945_collect_tx_data(struct iwl3945_rs_sta *rs_sta,
{
unsigned long flags;
s32 fail_count;
struct iwl3945_priv *priv = rs_sta->priv;

if (!retries) {
IWL_DEBUG_RATE("leave: retries == 0 -- should be at least 1\n");
Expand Down Expand Up @@ -380,10 +384,11 @@ static void rs_free(void *priv)
return;
}

static void *rs_alloc_sta(void *priv, struct ieee80211_sta *sta, gfp_t gfp)
static void *rs_alloc_sta(void *iwl_priv, struct ieee80211_sta *sta, gfp_t gfp)
{
struct iwl3945_rs_sta *rs_sta;
struct iwl3945_sta_priv *psta = (void *) sta->drv_priv;
struct iwl3945_priv *priv = iwl_priv;
int i;

/*
Expand All @@ -403,6 +408,8 @@ static void *rs_alloc_sta(void *priv, struct ieee80211_sta *sta, gfp_t gfp)

spin_lock_init(&rs_sta->lock);

rs_sta->priv = priv;

rs_sta->start_rate = IWL_RATE_INVALID;

/* default to just 802.11b */
Expand All @@ -426,11 +433,12 @@ static void *rs_alloc_sta(void *priv, struct ieee80211_sta *sta, gfp_t gfp)
return rs_sta;
}

static void rs_free_sta(void *priv, struct ieee80211_sta *sta,
static void rs_free_sta(void *iwl_priv, struct ieee80211_sta *sta,
void *priv_sta)
{
struct iwl3945_sta_priv *psta = (void *) sta->drv_priv;
struct iwl3945_rs_sta *rs_sta = priv_sta;
struct iwl3945_priv *priv = rs_sta->priv;

psta->rs_sta = NULL;

Expand Down Expand Up @@ -548,6 +556,7 @@ static u16 iwl3945_get_adjacent_rate(struct iwl3945_rs_sta *rs_sta,
{
u8 high = IWL_RATE_INVALID;
u8 low = IWL_RATE_INVALID;
struct iwl3945_priv *priv = rs_sta->priv;

/* 802.11A walks to the next literal adjacent rate in
* the rate table */
Expand Down
4 changes: 2 additions & 2 deletions drivers/net/wireless/iwlwifi/iwl-3945.c
Original file line number Diff line number Diff line change
Expand Up @@ -542,7 +542,7 @@ static void iwl3945_dbg_report_frame(struct iwl3945_priv *priv,
}
}
if (print_dump)
iwl3945_print_hex_dump(IWL_DL_RX, data, length);
iwl_print_hex_dump(priv, IWL_DL_RX, data, length);
}
#else
static inline void iwl3945_dbg_report_frame(struct iwl3945_priv *priv,
Expand Down Expand Up @@ -708,7 +708,7 @@ static void iwl3945_rx_reply_rx(struct iwl3945_priv *priv,
rx_status.noise, rx_status.rate_idx);

#ifdef CONFIG_IWL3945_DEBUG
if (iwl3945_debug_level & (IWL_DL_RX))
if (priv->debug_level & (IWL_DL_RX))
/* Set "1" to report good data frames in groups of 100 */
iwl3945_dbg_report_frame(priv, pkt, header, 1);
#endif
Expand Down
3 changes: 2 additions & 1 deletion drivers/net/wireless/iwlwifi/iwl-3945.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ extern struct pci_device_id iwl3945_hw_card_ids[];
#include "iwl-csr.h"
#include "iwl-prph.h"
#include "iwl-3945-hw.h"
#include "iwl-3945-debug.h"
#include "iwl-debug.h"
#include "iwl-3945-led.h"

/* Highest firmware API version supported */
Expand Down Expand Up @@ -889,6 +889,7 @@ struct iwl3945_priv {

#ifdef CONFIG_IWL3945_DEBUG
/* debugging info */
u32 debug_level;
u32 framecnt_to_us;
atomic_t restrict_refcnt;
#endif
Expand Down
2 changes: 2 additions & 0 deletions drivers/net/wireless/iwlwifi/iwl-debug.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@
#ifndef __iwl_debug_h__
#define __iwl_debug_h__

struct iwl_priv;

#ifdef CONFIG_IWLWIFI_DEBUG
#define IWL_DEBUG(level, fmt, args...) \
do { if (priv->debug_level & (level)) \
Expand Down
Loading

0 comments on commit 40b8ec0

Please sign in to comment.