Skip to content

Commit

Permalink
iwlagn: add debug for mac80211 callback
Browse files Browse the repository at this point in the history
Add IWL_DEBUG_MAC80211 debug for all mac80211 callback function

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
  • Loading branch information
Wey-Yi Guy authored and John W. Linville committed Oct 14, 2011
1 parent ef082cb commit 770c72c
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 9 deletions.
4 changes: 3 additions & 1 deletion drivers/net/wireless/iwlwifi/iwl-agn-rxon.c
Original file line number Diff line number Diff line change
Expand Up @@ -539,7 +539,7 @@ int iwlagn_mac_config(struct ieee80211_hw *hw, u32 changed)
const struct iwl_channel_info *ch_info;
int ret = 0;

IWL_DEBUG_MAC80211(priv, "changed %#x", changed);
IWL_DEBUG_MAC80211(priv, "enter: changed %#x", changed);

mutex_lock(&priv->shrd->mutex);

Expand Down Expand Up @@ -657,6 +657,8 @@ int iwlagn_mac_config(struct ieee80211_hw *hw, u32 changed)
}
out:
mutex_unlock(&priv->shrd->mutex);
IWL_DEBUG_MAC80211(priv, "leave\n");

return ret;
}

Expand Down
3 changes: 3 additions & 0 deletions drivers/net/wireless/iwlwifi/iwl-agn-sta.c
Original file line number Diff line number Diff line change
Expand Up @@ -685,6 +685,8 @@ void iwlagn_mac_sta_notify(struct ieee80211_hw *hw,
struct iwl_station_priv *sta_priv = (void *)sta->drv_priv;
int sta_id;

IWL_DEBUG_MAC80211(priv, "enter\n");

switch (cmd) {
case STA_NOTIFY_SLEEP:
WARN_ON(!sta_priv->client);
Expand All @@ -704,4 +706,5 @@ void iwlagn_mac_sta_notify(struct ieee80211_hw *hw,
default:
break;
}
IWL_DEBUG_MAC80211(priv, "leave\n");
}
32 changes: 26 additions & 6 deletions drivers/net/wireless/iwlwifi/iwl-agn.c
Original file line number Diff line number Diff line change
Expand Up @@ -1855,6 +1855,7 @@ static void iwlagn_mac_set_rekey_data(struct ieee80211_hw *hw,
if (iwlagn_mod_params.sw_crypto)
return;

IWL_DEBUG_MAC80211(priv, "enter\n");
mutex_lock(&priv->shrd->mutex);

if (priv->contexts[IWL_RXON_CTX_BSS].vif != vif)
Expand All @@ -1867,6 +1868,7 @@ static void iwlagn_mac_set_rekey_data(struct ieee80211_hw *hw,

out:
mutex_unlock(&priv->shrd->mutex);
IWL_DEBUG_MAC80211(priv, "leave\n");
}

struct wowlan_key_data {
Expand Down Expand Up @@ -2034,6 +2036,7 @@ static int iwlagn_mac_suspend(struct ieee80211_hw *hw,
if (WARN_ON(!wowlan))
return -EINVAL;

IWL_DEBUG_MAC80211(priv, "enter\n");
mutex_lock(&priv->shrd->mutex);

/* Don't attempt WoWLAN when not associated, tear down instead. */
Expand Down Expand Up @@ -2203,6 +2206,8 @@ static int iwlagn_mac_suspend(struct ieee80211_hw *hw,
out:
mutex_unlock(&priv->shrd->mutex);
kfree(key_data.rsc_tsc);
IWL_DEBUG_MAC80211(priv, "leave\n");

return ret;
}

Expand All @@ -2215,6 +2220,7 @@ static int iwlagn_mac_resume(struct ieee80211_hw *hw)
u32 base, status = 0xffffffff;
int ret = -EIO;

IWL_DEBUG_MAC80211(priv, "enter\n");
mutex_lock(&priv->shrd->mutex);

iwl_write32(bus(priv), CSR_UCODE_DRV_GP1_CLR,
Expand Down Expand Up @@ -2260,6 +2266,7 @@ static int iwlagn_mac_resume(struct ieee80211_hw *hw)
iwlagn_set_rxon_chain(priv, ctx);

mutex_unlock(&priv->shrd->mutex);
IWL_DEBUG_MAC80211(priv, "leave\n");

ieee80211_resume_disconnect(vif);

Expand Down Expand Up @@ -2402,6 +2409,7 @@ static int iwlagn_mac_ampdu_action(struct ieee80211_hw *hw,
if (!(priv->cfg->sku & EEPROM_SKU_CAP_11N_ENABLE))
return -EACCES;

IWL_DEBUG_MAC80211(priv, "enter\n");
mutex_lock(&priv->shrd->mutex);

switch (action) {
Expand Down Expand Up @@ -2492,7 +2500,7 @@ static int iwlagn_mac_ampdu_action(struct ieee80211_hw *hw,
break;
}
mutex_unlock(&priv->shrd->mutex);

IWL_DEBUG_MAC80211(priv, "leave\n");
return ret;
}

Expand All @@ -2504,10 +2512,10 @@ static int iwlagn_mac_sta_add(struct ieee80211_hw *hw,
struct iwl_station_priv *sta_priv = (void *)sta->drv_priv;
struct iwl_vif_priv *vif_priv = (void *)vif->drv_priv;
bool is_ap = vif->type == NL80211_IFTYPE_STATION;
int ret;
int ret = 0;
u8 sta_id;

IWL_DEBUG_INFO(priv, "received request to add station %pM\n",
IWL_DEBUG_MAC80211(priv, "received request to add station %pM\n",
sta->addr);
mutex_lock(&priv->shrd->mutex);
IWL_DEBUG_INFO(priv, "proceeding to add station %pM\n",
Expand All @@ -2524,8 +2532,7 @@ static int iwlagn_mac_sta_add(struct ieee80211_hw *hw,
IWL_ERR(priv, "Unable to add station %pM (%d)\n",
sta->addr, ret);
/* Should we return success if return code is EEXIST ? */
mutex_unlock(&priv->shrd->mutex);
return ret;
goto out;
}

sta_priv->sta_id = sta_id;
Expand All @@ -2534,9 +2541,11 @@ static int iwlagn_mac_sta_add(struct ieee80211_hw *hw,
IWL_DEBUG_INFO(priv, "Initializing rate scaling for station %pM\n",
sta->addr);
iwl_rs_rate_init(priv, sta, sta_id);
out:
mutex_unlock(&priv->shrd->mutex);
IWL_DEBUG_MAC80211(priv, "leave\n");

return 0;
return ret;
}

static void iwlagn_mac_channel_switch(struct ieee80211_hw *hw,
Expand Down Expand Up @@ -2767,6 +2776,7 @@ static int iwl_mac_remain_on_channel(struct ieee80211_hw *hw,
if (!(ctx->interface_modes & BIT(NL80211_IFTYPE_P2P_CLIENT)))
return -EOPNOTSUPP;

IWL_DEBUG_MAC80211(priv, "enter\n");
mutex_lock(&priv->shrd->mutex);

if (test_bit(STATUS_SCAN_HW, &priv->shrd->status)) {
Expand Down Expand Up @@ -2810,6 +2820,7 @@ static int iwl_mac_remain_on_channel(struct ieee80211_hw *hw,

out:
mutex_unlock(&priv->shrd->mutex);
IWL_DEBUG_MAC80211(priv, "leave\n");

return err;
}
Expand All @@ -2821,10 +2832,12 @@ static int iwl_mac_cancel_remain_on_channel(struct ieee80211_hw *hw)
if (!(priv->shrd->valid_contexts & BIT(IWL_RXON_CTX_PAN)))
return -EOPNOTSUPP;

IWL_DEBUG_MAC80211(priv, "enter\n");
mutex_lock(&priv->shrd->mutex);
iwl_scan_cancel_timeout(priv, priv->hw_roc_duration);
iwlagn_disable_roc(priv);
mutex_unlock(&priv->shrd->mutex);
IWL_DEBUG_MAC80211(priv, "leave\n");

return 0;
}
Expand All @@ -2838,6 +2851,7 @@ static int iwl_mac_tx_sync(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
int ret;
u8 sta_id;

IWL_DEBUG_MAC80211(priv, "enter\n");
mutex_lock(&priv->shrd->mutex);

if (iwl_is_associated_ctx(ctx)) {
Expand Down Expand Up @@ -2871,6 +2885,8 @@ static int iwl_mac_tx_sync(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
iwl_remove_station(priv, sta_id, bssid);
out:
mutex_unlock(&priv->shrd->mutex);
IWL_DEBUG_MAC80211(priv, "leave\n");

return ret;
}

Expand All @@ -2883,6 +2899,7 @@ static void iwl_mac_finish_tx_sync(struct ieee80211_hw *hw,
struct iwl_vif_priv *vif_priv = (void *)vif->drv_priv;
struct iwl_rxon_context *ctx = vif_priv->ctx;

IWL_DEBUG_MAC80211(priv, "enter\n");
mutex_lock(&priv->shrd->mutex);

if (iwl_is_associated_ctx(ctx))
Expand All @@ -2893,6 +2910,7 @@ static void iwl_mac_finish_tx_sync(struct ieee80211_hw *hw,
/* no need to commit */
out:
mutex_unlock(&priv->shrd->mutex);
IWL_DEBUG_MAC80211(priv, "leave\n");
}

/*****************************************************************************
Expand Down Expand Up @@ -3054,6 +3072,7 @@ static void iwl_mac_rssi_callback(struct ieee80211_hw *hw,
{
struct iwl_priv *priv = hw->priv;

IWL_DEBUG_MAC80211(priv, "enter\n");
mutex_lock(&priv->shrd->mutex);

if (priv->cfg->bt_params &&
Expand All @@ -3070,6 +3089,7 @@ static void iwl_mac_rssi_callback(struct ieee80211_hw *hw,
}

mutex_unlock(&priv->shrd->mutex);
IWL_DEBUG_MAC80211(priv, "leave\n");
}

static int iwl_mac_set_tim(struct ieee80211_hw *hw,
Expand Down
4 changes: 4 additions & 0 deletions drivers/net/wireless/iwlwifi/iwl-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -1662,6 +1662,8 @@ int iwl_mac_change_interface(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
u32 interface_modes;
int err;

IWL_DEBUG_MAC80211(priv, "enter\n");

newtype = ieee80211_iftype_p2p(newtype, newp2p);

mutex_lock(&priv->shrd->mutex);
Expand Down Expand Up @@ -1729,6 +1731,8 @@ int iwl_mac_change_interface(struct ieee80211_hw *hw, struct ieee80211_vif *vif,

out:
mutex_unlock(&priv->shrd->mutex);
IWL_DEBUG_MAC80211(priv, "leave\n");

return err;
}

Expand Down
6 changes: 4 additions & 2 deletions drivers/net/wireless/iwlwifi/iwl-sta.c
Original file line number Diff line number Diff line change
Expand Up @@ -823,8 +823,8 @@ int iwl_mac_sta_remove(struct ieee80211_hw *hw,
struct iwl_station_priv *sta_priv = (void *)sta->drv_priv;
int ret;

IWL_DEBUG_INFO(priv, "received request to remove station %pM\n",
sta->addr);
IWL_DEBUG_MAC80211(priv, "enter: received request to remove "
"station %pM\n", sta->addr);
mutex_lock(&priv->shrd->mutex);
IWL_DEBUG_INFO(priv, "proceeding to remove station %pM\n",
sta->addr);
Expand All @@ -833,5 +833,7 @@ int iwl_mac_sta_remove(struct ieee80211_hw *hw,
IWL_ERR(priv, "Error removing station %pM\n",
sta->addr);
mutex_unlock(&priv->shrd->mutex);
IWL_DEBUG_MAC80211(priv, "leave\n");

return ret;
}

0 comments on commit 770c72c

Please sign in to comment.