Commit 4b9844f5 authored by Emmanuel Grumbach's avatar Emmanuel Grumbach Committed by Wey-Yi Guy

iwlwifi: don't use shared for the logger any more

Each modules will hold a pointer to struct device instead.
Signed-off-by: default avatarEmmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: default avatarWey-Yi Guy <wey-yi.w.guy@intel.com>
parent 93faaeea
...@@ -1509,6 +1509,7 @@ static struct iwl_op_mode *iwl_op_mode_dvm_start(struct iwl_trans *trans, ...@@ -1509,6 +1509,7 @@ static struct iwl_op_mode *iwl_op_mode_dvm_start(struct iwl_trans *trans,
priv = IWL_OP_MODE_GET_DVM(op_mode); priv = IWL_OP_MODE_GET_DVM(op_mode);
priv->shrd = trans->shrd; priv->shrd = trans->shrd;
priv->trans = trans; priv->trans = trans;
priv->dev = trans->dev;
priv->cfg = cfg; priv->cfg = cfg;
priv->fw = fw; priv->fw = fw;
......
...@@ -481,7 +481,7 @@ do { \ ...@@ -481,7 +481,7 @@ do { \
if (!iwl_is_rfkill((m))) \ if (!iwl_is_rfkill((m))) \
IWL_ERR(m, fmt, ##args); \ IWL_ERR(m, fmt, ##args); \
else \ else \
__iwl_err(trans(m)->dev, true, \ __iwl_err((m)->dev, true, \
!iwl_have_debug_level(IWL_DL_RADIO), \ !iwl_have_debug_level(IWL_DL_RADIO), \
fmt, ##args); \ fmt, ##args); \
} while (0) } while (0)
...@@ -491,7 +491,7 @@ do { \ ...@@ -491,7 +491,7 @@ do { \
if (!iwl_is_rfkill((m))) \ if (!iwl_is_rfkill((m))) \
IWL_ERR(m, fmt, ##args); \ IWL_ERR(m, fmt, ##args); \
else \ else \
__iwl_err(trans(m)->dev, true, true, fmt, ##args); \ __iwl_err((m)->dev, true, true, fmt, ##args); \
} while (0) } while (0)
#endif /* CONFIG_IWLWIFI_DEBUG */ #endif /* CONFIG_IWLWIFI_DEBUG */
......
...@@ -41,10 +41,10 @@ void __iwl_info(struct device *dev, const char *fmt, ...); ...@@ -41,10 +41,10 @@ void __iwl_info(struct device *dev, const char *fmt, ...);
void __iwl_crit(struct device *dev, const char *fmt, ...); void __iwl_crit(struct device *dev, const char *fmt, ...);
/* No matter what is m (priv, bus, trans), this will work */ /* No matter what is m (priv, bus, trans), this will work */
#define IWL_ERR(m, f, a...) __iwl_err(trans(m)->dev, false, false, f, ## a) #define IWL_ERR(m, f, a...) __iwl_err((m)->dev, false, false, f, ## a)
#define IWL_WARN(m, f, a...) __iwl_warn(trans(m)->dev, f, ## a) #define IWL_WARN(m, f, a...) __iwl_warn((m)->dev, f, ## a)
#define IWL_INFO(m, f, a...) __iwl_info(trans(m)->dev, f, ## a) #define IWL_INFO(m, f, a...) __iwl_info((m)->dev, f, ## a)
#define IWL_CRIT(m, f, a...) __iwl_crit(trans(m)->dev, f, ## a) #define IWL_CRIT(m, f, a...) __iwl_crit((m)->dev, f, ## a)
#if defined(CONFIG_IWLWIFI_DEBUG) || defined(CONFIG_IWLWIFI_DEVICE_TRACING) #if defined(CONFIG_IWLWIFI_DEBUG) || defined(CONFIG_IWLWIFI_DEVICE_TRACING)
void __iwl_dbg(struct device *dev, void __iwl_dbg(struct device *dev,
...@@ -65,9 +65,9 @@ do { \ ...@@ -65,9 +65,9 @@ do { \
} while (0) } while (0)
#define IWL_DEBUG(m, level, fmt, args...) \ #define IWL_DEBUG(m, level, fmt, args...) \
__iwl_dbg(trans(m)->dev, level, false, __func__, fmt, ##args) __iwl_dbg((m)->dev, level, false, __func__, fmt, ##args)
#define IWL_DEBUG_LIMIT(m, level, fmt, args...) \ #define IWL_DEBUG_LIMIT(m, level, fmt, args...) \
__iwl_dbg(trans(m)->dev, level, true, __func__, fmt, ##args) __iwl_dbg((m)->dev, level, true, __func__, fmt, ##args)
#ifdef CONFIG_IWLWIFI_DEBUG #ifdef CONFIG_IWLWIFI_DEBUG
#define iwl_print_hex_dump(m, level, p, len) \ #define iwl_print_hex_dump(m, level, p, len) \
......
...@@ -761,6 +761,7 @@ struct iwl_priv { ...@@ -761,6 +761,7 @@ struct iwl_priv {
/*data shared among all the driver's layers */ /*data shared among all the driver's layers */
struct iwl_shared *shrd; struct iwl_shared *shrd;
struct iwl_trans *trans; struct iwl_trans *trans;
struct device *dev; /* for debug prints only */
const struct iwl_cfg *cfg; const struct iwl_cfg *cfg;
const struct iwl_fw *fw; const struct iwl_fw *fw;
const struct iwl_lib_ops *lib; const struct iwl_lib_ops *lib;
......
...@@ -80,6 +80,7 @@ ...@@ -80,6 +80,7 @@
* @shrd: pointer to common shared structure * @shrd: pointer to common shared structure
* @op_mode: the running op_mode * @op_mode: the running op_mode
* @trans: transport layer * @trans: transport layer
* @dev: for debug prints only
* @cfg: configuration struct * @cfg: configuration struct
* @fw_index: firmware revision to try loading * @fw_index: firmware revision to try loading
* @firmware_name: composite filename of ucode file to load * @firmware_name: composite filename of ucode file to load
...@@ -91,6 +92,7 @@ struct iwl_drv { ...@@ -91,6 +92,7 @@ struct iwl_drv {
struct iwl_shared *shrd; struct iwl_shared *shrd;
struct iwl_op_mode *op_mode; struct iwl_op_mode *op_mode;
struct iwl_trans *trans; struct iwl_trans *trans;
struct device *dev;
const struct iwl_cfg *cfg; const struct iwl_cfg *cfg;
int fw_index; /* firmware we're trying to load */ int fw_index; /* firmware we're trying to load */
...@@ -898,6 +900,7 @@ struct iwl_drv *iwl_drv_start(struct iwl_shared *shrd, ...@@ -898,6 +900,7 @@ struct iwl_drv *iwl_drv_start(struct iwl_shared *shrd,
/* For printing only - temporary until we change the logger */ /* For printing only - temporary until we change the logger */
drv->shrd = shrd; drv->shrd = shrd;
drv->trans = trans; drv->trans = trans;
drv->dev = trans->dev;
drv->cfg = cfg; drv->cfg = cfg;
init_completion(&drv->request_firmware_complete); init_completion(&drv->request_firmware_complete);
......
...@@ -65,14 +65,13 @@ ...@@ -65,14 +65,13 @@
#include <linux/string.h> #include <linux/string.h>
#include "iwl-debug.h" #include "iwl-debug.h"
#include "iwl-shared.h"
#include "iwl-dev.h" #include "iwl-dev.h"
#include "iwl-phy-db.h" #include "iwl-phy-db.h"
#define CHANNEL_NUM_SIZE 4 /* num of channels in calib_ch size */ #define CHANNEL_NUM_SIZE 4 /* num of channels in calib_ch size */
struct iwl_phy_db *iwl_phy_db_init(struct iwl_shared *shrd) struct iwl_phy_db *iwl_phy_db_init(struct device *dev)
{ {
struct iwl_phy_db *phy_db = kzalloc(sizeof(struct iwl_phy_db), struct iwl_phy_db *phy_db = kzalloc(sizeof(struct iwl_phy_db),
GFP_KERNEL); GFP_KERNEL);
...@@ -80,7 +79,7 @@ struct iwl_phy_db *iwl_phy_db_init(struct iwl_shared *shrd) ...@@ -80,7 +79,7 @@ struct iwl_phy_db *iwl_phy_db_init(struct iwl_shared *shrd)
if (!phy_db) if (!phy_db)
return phy_db; return phy_db;
phy_db->shrd = shrd; phy_db->dev = dev;
/* TODO: add default values of the phy db. */ /* TODO: add default values of the phy db. */
return phy_db; return phy_db;
......
...@@ -96,7 +96,7 @@ struct iwl_phy_db { ...@@ -96,7 +96,7 @@ struct iwl_phy_db {
u32 channel_size; u32 channel_size;
/* for an access to the logger */ /* for an access to the logger */
const struct iwl_shared *shrd; struct device *dev;
}; };
enum iwl_phy_db_section_type { enum iwl_phy_db_section_type {
...@@ -114,7 +114,7 @@ struct iwl_phy_db_chg_txp { ...@@ -114,7 +114,7 @@ struct iwl_phy_db_chg_txp {
__le16 max_channel_idx; __le16 max_channel_idx;
} __packed; } __packed;
struct iwl_phy_db *iwl_phy_db_init(struct iwl_shared *shrd); struct iwl_phy_db *iwl_phy_db_init(struct device *dev);
void iwl_phy_db_free(struct iwl_phy_db *phy_db); void iwl_phy_db_free(struct iwl_phy_db *phy_db);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment