Commit e9bd5bcd authored by Steve deRosier's avatar Steve deRosier Committed by John W. Linville

libertastf: add configurable debug messages

Add the same type of configurable debug messages to libertas_tf as
already exist in the libertas driver.  This has facilitated creation
of a interface specification and will facilitate future development
of this driver.
Signed-off-by: default avatarSteve deRosier <steve@cozybit.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 9a8b424e
...@@ -38,6 +38,12 @@ config LIBERTAS_THINFIRM ...@@ -38,6 +38,12 @@ config LIBERTAS_THINFIRM
---help--- ---help---
A library for Marvell Libertas 8xxx devices using thinfirm. A library for Marvell Libertas 8xxx devices using thinfirm.
config LIBERTAS_THINFIRM_DEBUG
bool "Enable full debugging output in the Libertas thin firmware module."
depends on LIBERTAS_THINFIRM
---help---
Debugging support.
config LIBERTAS_THINFIRM_USB config LIBERTAS_THINFIRM_USB
tristate "Marvell Libertas 8388 USB 802.11b/g cards with thin firmware" tristate "Marvell Libertas 8388 USB 802.11b/g cards with thin firmware"
depends on LIBERTAS_THINFIRM && USB depends on LIBERTAS_THINFIRM && USB
......
This diff is collapsed.
/**
* This header file contains global constant/enum definitions,
* global variable declaration.
*/
#ifndef _LBS_DEB_DEFS_H_
#define _LBS_DEB_EFS_H_
#ifndef DRV_NAME
#define DRV_NAME "libertas_tf"
#endif
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
#include <linux/spinlock.h>
#ifdef CONFIG_LIBERTAS_THINFIRM_DEBUG
#define DEBUG
#define PROC_DEBUG
#endif
#define LBTF_DEB_ENTER 0x00000001
#define LBTF_DEB_LEAVE 0x00000002
#define LBTF_DEB_MAIN 0x00000004
#define LBTF_DEB_NET 0x00000008
#define LBTF_DEB_MESH 0x00000010
#define LBTF_DEB_WEXT 0x00000020
#define LBTF_DEB_IOCTL 0x00000040
#define LBTF_DEB_SCAN 0x00000080
#define LBTF_DEB_ASSOC 0x00000100
#define LBTF_DEB_JOIN 0x00000200
#define LBTF_DEB_11D 0x00000400
#define LBTF_DEB_DEBUGFS 0x00000800
#define LBTF_DEB_ETHTOOL 0x00001000
#define LBTF_DEB_HOST 0x00002000
#define LBTF_DEB_CMD 0x00004000
#define LBTF_DEB_RX 0x00008000
#define LBTF_DEB_TX 0x00010000
#define LBTF_DEB_USB 0x00020000
#define LBTF_DEB_CS 0x00040000
#define LBTF_DEB_FW 0x00080000
#define LBTF_DEB_THREAD 0x00100000
#define LBTF_DEB_HEX 0x00200000
#define LBTF_DEB_SDIO 0x00400000
#define LBTF_DEB_MACOPS 0x00800000
extern unsigned int lbtf_debug;
#ifdef DEBUG
#define LBTF_DEB_LL(grp, grpnam, fmt, args...) \
do { if ((lbtf_debug & (grp)) == (grp)) \
printk(KERN_DEBUG DRV_NAME grpnam "%s: " fmt, \
in_interrupt() ? " (INT)" : "", ## args); } while (0)
#else
#define LBTF_DEB_LL(grp, grpnam, fmt, args...) do {} while (0)
#endif
#define lbtf_deb_enter(grp) \
LBTF_DEB_LL(grp | LBTF_DEB_ENTER, " enter", "%s()\n", __func__);
#define lbtf_deb_enter_args(grp, fmt, args...) \
LBTF_DEB_LL(grp | LBTF_DEB_ENTER, " enter", "%s(" fmt ")\n", __func__, ## args);
#define lbtf_deb_leave(grp) \
LBTF_DEB_LL(grp | LBTF_DEB_LEAVE, " leave", "%s()\n", __func__);
#define lbtf_deb_leave_args(grp, fmt, args...) \
LBTF_DEB_LL(grp | LBTF_DEB_LEAVE, " leave", "%s(), " fmt "\n", \
__func__, ##args);
#define lbtf_deb_main(fmt, args...) LBTF_DEB_LL(LBTF_DEB_MAIN, " main", fmt, ##args)
#define lbtf_deb_net(fmt, args...) LBTF_DEB_LL(LBTF_DEB_NET, " net", fmt, ##args)
#define lbtf_deb_mesh(fmt, args...) LBTF_DEB_LL(LBTF_DEB_MESH, " mesh", fmt, ##args)
#define lbtf_deb_wext(fmt, args...) LBTF_DEB_LL(LBTF_DEB_WEXT, " wext", fmt, ##args)
#define lbtf_deb_ioctl(fmt, args...) LBTF_DEB_LL(LBTF_DEB_IOCTL, " ioctl", fmt, ##args)
#define lbtf_deb_scan(fmt, args...) LBTF_DEB_LL(LBTF_DEB_SCAN, " scan", fmt, ##args)
#define lbtf_deb_assoc(fmt, args...) LBTF_DEB_LL(LBTF_DEB_ASSOC, " assoc", fmt, ##args)
#define lbtf_deb_join(fmt, args...) LBTF_DEB_LL(LBTF_DEB_JOIN, " join", fmt, ##args)
#define lbtf_deb_11d(fmt, args...) LBTF_DEB_LL(LBTF_DEB_11D, " 11d", fmt, ##args)
#define lbtf_deb_debugfs(fmt, args...) LBTF_DEB_LL(LBTF_DEB_DEBUGFS, " debugfs", fmt, ##args)
#define lbtf_deb_ethtool(fmt, args...) LBTF_DEB_LL(LBTF_DEB_ETHTOOL, " ethtool", fmt, ##args)
#define lbtf_deb_host(fmt, args...) LBTF_DEB_LL(LBTF_DEB_HOST, " host", fmt, ##args)
#define lbtf_deb_cmd(fmt, args...) LBTF_DEB_LL(LBTF_DEB_CMD, " cmd", fmt, ##args)
#define lbtf_deb_rx(fmt, args...) LBTF_DEB_LL(LBTF_DEB_RX, " rx", fmt, ##args)
#define lbtf_deb_tx(fmt, args...) LBTF_DEB_LL(LBTF_DEB_TX, " tx", fmt, ##args)
#define lbtf_deb_fw(fmt, args...) LBTF_DEB_LL(LBTF_DEB_FW, " fw", fmt, ##args)
#define lbtf_deb_usb(fmt, args...) LBTF_DEB_LL(LBTF_DEB_USB, " usb", fmt, ##args)
#define lbtf_deb_usbd(dev, fmt, args...) LBTF_DEB_LL(LBTF_DEB_USB, " usbd", "%s:" fmt, dev_name(dev), ##args)
#define lbtf_deb_cs(fmt, args...) LBTF_DEB_LL(LBTF_DEB_CS, " cs", fmt, ##args)
#define lbtf_deb_thread(fmt, args...) LBTF_DEB_LL(LBTF_DEB_THREAD, " thread", fmt, ##args)
#define lbtf_deb_sdio(fmt, args...) LBTF_DEB_LL(LBTF_DEB_SDIO, " thread", fmt, ##args)
#define lbtf_deb_macops(fmt, args...) LBTF_DEB_LL(LBTF_DEB_MACOPS, " thread", fmt, ##args)
#ifdef DEBUG
static inline void lbtf_deb_hex(unsigned int grp, const char *prompt, u8 *buf, int len)
{
char newprompt[32];
if (len &&
(lbtf_debug & LBTF_DEB_HEX) &&
(lbtf_debug & grp)) {
snprintf(newprompt, sizeof(newprompt), DRV_NAME " %s: ", prompt);
print_hex_dump_bytes(prompt, DUMP_PREFIX_NONE, buf, len);
}
}
#else
#define lbtf_deb_hex(grp, prompt, buf, len) do {} while (0)
#endif
#endif
This diff is collapsed.
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
* the Free Software Foundation; either version 2 of the License, or (at * the Free Software Foundation; either version 2 of the License, or (at
* your option) any later version. * your option) any later version.
*/ */
#include "deb_defs.h"
#include "libertas_tf.h" #include "libertas_tf.h"
#include "linux/etherdevice.h" #include "linux/etherdevice.h"
...@@ -16,7 +17,17 @@ ...@@ -16,7 +17,17 @@
#define LBTF_FW_VER_MAX 0x0584ffff #define LBTF_FW_VER_MAX 0x0584ffff
#define QOS_CONTROL_LEN 2 #define QOS_CONTROL_LEN 2
static const char lbtf_driver_version[] = "THINFIRM-USB8388-" DRIVER_RELEASE_VERSION; /* Module parameters */
unsigned int lbtf_debug;
EXPORT_SYMBOL_GPL(lbtf_debug);
module_param_named(libertas_tf_debug, lbtf_debug, int, 0644);
static const char lbtf_driver_version[] = "THINFIRM-USB8388-" DRIVER_RELEASE_VERSION
#ifdef DEBUG
"-dbg"
#endif
"";
struct workqueue_struct *lbtf_wq; struct workqueue_struct *lbtf_wq;
static const struct ieee80211_channel lbtf_channels[] = { static const struct ieee80211_channel lbtf_channels[] = {
...@@ -79,6 +90,9 @@ static void lbtf_cmd_work(struct work_struct *work) ...@@ -79,6 +90,9 @@ static void lbtf_cmd_work(struct work_struct *work)
{ {
struct lbtf_private *priv = container_of(work, struct lbtf_private, struct lbtf_private *priv = container_of(work, struct lbtf_private,
cmd_work); cmd_work);
lbtf_deb_enter(LBTF_DEB_CMD);
spin_lock_irq(&priv->driver_lock); spin_lock_irq(&priv->driver_lock);
/* command response? */ /* command response? */
if (priv->cmd_response_rxed) { if (priv->cmd_response_rxed) {
...@@ -106,11 +120,16 @@ static void lbtf_cmd_work(struct work_struct *work) ...@@ -106,11 +120,16 @@ static void lbtf_cmd_work(struct work_struct *work)
priv->cmd_timed_out = 0; priv->cmd_timed_out = 0;
spin_unlock_irq(&priv->driver_lock); spin_unlock_irq(&priv->driver_lock);
if (!priv->fw_ready) if (!priv->fw_ready) {
lbtf_deb_leave_args(LBTF_DEB_CMD, "fw not ready");
return; return;
}
/* Execute the next command */ /* Execute the next command */
if (!priv->cur_cmd) if (!priv->cur_cmd)
lbtf_execute_next_command(priv); lbtf_execute_next_command(priv);
lbtf_deb_leave(LBTF_DEB_CMD);
} }
/** /**
...@@ -124,6 +143,7 @@ static int lbtf_setup_firmware(struct lbtf_private *priv) ...@@ -124,6 +143,7 @@ static int lbtf_setup_firmware(struct lbtf_private *priv)
{ {
int ret = -1; int ret = -1;
lbtf_deb_enter(LBTF_DEB_FW);
/* /*
* Read priv address from HW * Read priv address from HW
*/ */
...@@ -139,6 +159,7 @@ static int lbtf_setup_firmware(struct lbtf_private *priv) ...@@ -139,6 +159,7 @@ static int lbtf_setup_firmware(struct lbtf_private *priv)
ret = 0; ret = 0;
done: done:
lbtf_deb_leave_args(LBTF_DEB_FW, "ret: %d", ret);
return ret; return ret;
} }
...@@ -150,6 +171,7 @@ static void command_timer_fn(unsigned long data) ...@@ -150,6 +171,7 @@ static void command_timer_fn(unsigned long data)
{ {
struct lbtf_private *priv = (struct lbtf_private *)data; struct lbtf_private *priv = (struct lbtf_private *)data;
unsigned long flags; unsigned long flags;
lbtf_deb_enter(LBTF_DEB_CMD);
spin_lock_irqsave(&priv->driver_lock, flags); spin_lock_irqsave(&priv->driver_lock, flags);
...@@ -166,10 +188,12 @@ static void command_timer_fn(unsigned long data) ...@@ -166,10 +188,12 @@ static void command_timer_fn(unsigned long data)
queue_work(lbtf_wq, &priv->cmd_work); queue_work(lbtf_wq, &priv->cmd_work);
out: out:
spin_unlock_irqrestore(&priv->driver_lock, flags); spin_unlock_irqrestore(&priv->driver_lock, flags);
lbtf_deb_leave(LBTF_DEB_CMD);
} }
static int lbtf_init_adapter(struct lbtf_private *priv) static int lbtf_init_adapter(struct lbtf_private *priv)
{ {
lbtf_deb_enter(LBTF_DEB_MAIN);
memset(priv->current_addr, 0xff, ETH_ALEN); memset(priv->current_addr, 0xff, ETH_ALEN);
mutex_init(&priv->lock); mutex_init(&priv->lock);
...@@ -186,13 +210,16 @@ static int lbtf_init_adapter(struct lbtf_private *priv) ...@@ -186,13 +210,16 @@ static int lbtf_init_adapter(struct lbtf_private *priv)
if (lbtf_allocate_cmd_buffer(priv)) if (lbtf_allocate_cmd_buffer(priv))
return -1; return -1;
lbtf_deb_leave(LBTF_DEB_MAIN);
return 0; return 0;
} }
static void lbtf_free_adapter(struct lbtf_private *priv) static void lbtf_free_adapter(struct lbtf_private *priv)
{ {
lbtf_deb_enter(LBTF_DEB_MAIN);
lbtf_free_cmd_buffer(priv); lbtf_free_cmd_buffer(priv);
del_timer(&priv->command_timer); del_timer(&priv->command_timer);
lbtf_deb_leave(LBTF_DEB_MAIN);
} }
static int lbtf_op_tx(struct ieee80211_hw *hw, struct sk_buff *skb) static int lbtf_op_tx(struct ieee80211_hw *hw, struct sk_buff *skb)
...@@ -219,14 +246,18 @@ static void lbtf_tx_work(struct work_struct *work) ...@@ -219,14 +246,18 @@ static void lbtf_tx_work(struct work_struct *work)
struct sk_buff *skb = NULL; struct sk_buff *skb = NULL;
int err; int err;
lbtf_deb_enter(LBTF_DEB_MACOPS | LBTF_DEB_TX);
if ((priv->vif->type == NL80211_IFTYPE_AP) && if ((priv->vif->type == NL80211_IFTYPE_AP) &&
(!skb_queue_empty(&priv->bc_ps_buf))) (!skb_queue_empty(&priv->bc_ps_buf)))
skb = skb_dequeue(&priv->bc_ps_buf); skb = skb_dequeue(&priv->bc_ps_buf);
else if (priv->skb_to_tx) { else if (priv->skb_to_tx) {
skb = priv->skb_to_tx; skb = priv->skb_to_tx;
priv->skb_to_tx = NULL; priv->skb_to_tx = NULL;
} else } else {
lbtf_deb_leave(LBTF_DEB_MACOPS | LBTF_DEB_TX);
return; return;
}
len = skb->len; len = skb->len;
info = IEEE80211_SKB_CB(skb); info = IEEE80211_SKB_CB(skb);
...@@ -234,6 +265,7 @@ static void lbtf_tx_work(struct work_struct *work) ...@@ -234,6 +265,7 @@ static void lbtf_tx_work(struct work_struct *work)
if (priv->surpriseremoved) { if (priv->surpriseremoved) {
dev_kfree_skb_any(skb); dev_kfree_skb_any(skb);
lbtf_deb_leave(LBTF_DEB_MACOPS | LBTF_DEB_TX);
return; return;
} }
...@@ -247,6 +279,7 @@ static void lbtf_tx_work(struct work_struct *work) ...@@ -247,6 +279,7 @@ static void lbtf_tx_work(struct work_struct *work)
ETH_ALEN); ETH_ALEN);
txpd->tx_packet_length = cpu_to_le16(len); txpd->tx_packet_length = cpu_to_le16(len);
txpd->tx_packet_location = cpu_to_le32(sizeof(struct txpd)); txpd->tx_packet_location = cpu_to_le32(sizeof(struct txpd));
lbtf_deb_hex(LBTF_DEB_TX, "TX Data", skb->data, min_t(unsigned int, skb->len, 100));
BUG_ON(priv->tx_skb); BUG_ON(priv->tx_skb);
spin_lock_irq(&priv->driver_lock); spin_lock_irq(&priv->driver_lock);
priv->tx_skb = skb; priv->tx_skb = skb;
...@@ -255,7 +288,9 @@ static void lbtf_tx_work(struct work_struct *work) ...@@ -255,7 +288,9 @@ static void lbtf_tx_work(struct work_struct *work)
if (err) { if (err) {
dev_kfree_skb_any(skb); dev_kfree_skb_any(skb);
priv->tx_skb = NULL; priv->tx_skb = NULL;
pr_err("TX error: %d", err);
} }
lbtf_deb_leave(LBTF_DEB_MACOPS | LBTF_DEB_TX);
} }
static int lbtf_op_start(struct ieee80211_hw *hw) static int lbtf_op_start(struct ieee80211_hw *hw)
...@@ -264,6 +299,8 @@ static int lbtf_op_start(struct ieee80211_hw *hw) ...@@ -264,6 +299,8 @@ static int lbtf_op_start(struct ieee80211_hw *hw)
void *card = priv->card; void *card = priv->card;
int ret = -1; int ret = -1;
lbtf_deb_enter(LBTF_DEB_MACOPS);
if (!priv->fw_ready) if (!priv->fw_ready)
/* Upload firmware */ /* Upload firmware */
if (priv->hw_prog_firmware(card)) if (priv->hw_prog_firmware(card))
...@@ -284,10 +321,12 @@ static int lbtf_op_start(struct ieee80211_hw *hw) ...@@ -284,10 +321,12 @@ static int lbtf_op_start(struct ieee80211_hw *hw)
} }
printk(KERN_INFO "libertastf: Marvell WLAN 802.11 thinfirm adapter\n"); printk(KERN_INFO "libertastf: Marvell WLAN 802.11 thinfirm adapter\n");
lbtf_deb_leave(LBTF_DEB_MACOPS);
return 0; return 0;
err_prog_firmware: err_prog_firmware:
priv->hw_reset_device(card); priv->hw_reset_device(card);
lbtf_deb_leave_args(LBTF_DEB_MACOPS, "error programing fw; ret=%d", ret);
return ret; return ret;
} }
...@@ -298,6 +337,9 @@ static void lbtf_op_stop(struct ieee80211_hw *hw) ...@@ -298,6 +337,9 @@ static void lbtf_op_stop(struct ieee80211_hw *hw)
struct sk_buff *skb; struct sk_buff *skb;
struct cmd_ctrl_node *cmdnode; struct cmd_ctrl_node *cmdnode;
lbtf_deb_enter(LBTF_DEB_MACOPS);
/* Flush pending command nodes */ /* Flush pending command nodes */
spin_lock_irqsave(&priv->driver_lock, flags); spin_lock_irqsave(&priv->driver_lock, flags);
list_for_each_entry(cmdnode, &priv->cmdpendingq, list) { list_for_each_entry(cmdnode, &priv->cmdpendingq, list) {
...@@ -314,6 +356,7 @@ static void lbtf_op_stop(struct ieee80211_hw *hw) ...@@ -314,6 +356,7 @@ static void lbtf_op_stop(struct ieee80211_hw *hw)
priv->radioon = RADIO_OFF; priv->radioon = RADIO_OFF;
lbtf_set_radio_control(priv); lbtf_set_radio_control(priv);
lbtf_deb_leave(LBTF_DEB_MACOPS);
return; return;
} }
...@@ -321,6 +364,7 @@ static int lbtf_op_add_interface(struct ieee80211_hw *hw, ...@@ -321,6 +364,7 @@ static int lbtf_op_add_interface(struct ieee80211_hw *hw,
struct ieee80211_vif *vif) struct ieee80211_vif *vif)
{ {
struct lbtf_private *priv = hw->priv; struct lbtf_private *priv = hw->priv;
lbtf_deb_enter(LBTF_DEB_MACOPS);
if (priv->vif != NULL) if (priv->vif != NULL)
return -EOPNOTSUPP; return -EOPNOTSUPP;
...@@ -338,6 +382,7 @@ static int lbtf_op_add_interface(struct ieee80211_hw *hw, ...@@ -338,6 +382,7 @@ static int lbtf_op_add_interface(struct ieee80211_hw *hw,
return -EOPNOTSUPP; return -EOPNOTSUPP;
} }
lbtf_set_mac_address(priv, (u8 *) vif->addr); lbtf_set_mac_address(priv, (u8 *) vif->addr);
lbtf_deb_leave(LBTF_DEB_MACOPS);
return 0; return 0;
} }
...@@ -345,6 +390,7 @@ static void lbtf_op_remove_interface(struct ieee80211_hw *hw, ...@@ -345,6 +390,7 @@ static void lbtf_op_remove_interface(struct ieee80211_hw *hw,
struct ieee80211_vif *vif) struct ieee80211_vif *vif)
{ {
struct lbtf_private *priv = hw->priv; struct lbtf_private *priv = hw->priv;
lbtf_deb_enter(LBTF_DEB_MACOPS);
if (priv->vif->type == NL80211_IFTYPE_AP || if (priv->vif->type == NL80211_IFTYPE_AP ||
priv->vif->type == NL80211_IFTYPE_MESH_POINT) priv->vif->type == NL80211_IFTYPE_MESH_POINT)
...@@ -352,17 +398,20 @@ static void lbtf_op_remove_interface(struct ieee80211_hw *hw, ...@@ -352,17 +398,20 @@ static void lbtf_op_remove_interface(struct ieee80211_hw *hw,
lbtf_set_mode(priv, LBTF_PASSIVE_MODE); lbtf_set_mode(priv, LBTF_PASSIVE_MODE);
lbtf_set_bssid(priv, 0, NULL); lbtf_set_bssid(priv, 0, NULL);
priv->vif = NULL; priv->vif = NULL;
lbtf_deb_leave(LBTF_DEB_MACOPS);
} }
static int lbtf_op_config(struct ieee80211_hw *hw, u32 changed) static int lbtf_op_config(struct ieee80211_hw *hw, u32 changed)
{ {
struct lbtf_private *priv = hw->priv; struct lbtf_private *priv = hw->priv;
struct ieee80211_conf *conf = &hw->conf; struct ieee80211_conf *conf = &hw->conf;
lbtf_deb_enter(LBTF_DEB_MACOPS);
if (conf->channel->center_freq != priv->cur_freq) { if (conf->channel->center_freq != priv->cur_freq) {
priv->cur_freq = conf->channel->center_freq; priv->cur_freq = conf->channel->center_freq;
lbtf_set_channel(priv, conf->channel->hw_value); lbtf_set_channel(priv, conf->channel->hw_value);
} }
lbtf_deb_leave(LBTF_DEB_MACOPS);
return 0; return 0;
} }
...@@ -395,11 +444,16 @@ static void lbtf_op_configure_filter(struct ieee80211_hw *hw, ...@@ -395,11 +444,16 @@ static void lbtf_op_configure_filter(struct ieee80211_hw *hw,
{ {
struct lbtf_private *priv = hw->priv; struct lbtf_private *priv = hw->priv;
int old_mac_control = priv->mac_control; int old_mac_control = priv->mac_control;
lbtf_deb_enter(LBTF_DEB_MACOPS);
changed_flags &= SUPPORTED_FIF_FLAGS; changed_flags &= SUPPORTED_FIF_FLAGS;
*new_flags &= SUPPORTED_FIF_FLAGS; *new_flags &= SUPPORTED_FIF_FLAGS;
if (!changed_flags) if (!changed_flags) {
lbtf_deb_leave(LBTF_DEB_MACOPS);
return; return;
}
if (*new_flags & (FIF_PROMISC_IN_BSS)) if (*new_flags & (FIF_PROMISC_IN_BSS))
priv->mac_control |= CMD_ACT_MAC_PROMISCUOUS_ENABLE; priv->mac_control |= CMD_ACT_MAC_PROMISCUOUS_ENABLE;
...@@ -425,6 +479,8 @@ static void lbtf_op_configure_filter(struct ieee80211_hw *hw, ...@@ -425,6 +479,8 @@ static void lbtf_op_configure_filter(struct ieee80211_hw *hw,
if (priv->mac_control != old_mac_control) if (priv->mac_control != old_mac_control)
lbtf_set_mac_control(priv); lbtf_set_mac_control(priv);
lbtf_deb_leave(LBTF_DEB_MACOPS);
} }
static void lbtf_op_bss_info_changed(struct ieee80211_hw *hw, static void lbtf_op_bss_info_changed(struct ieee80211_hw *hw,
...@@ -434,6 +490,7 @@ static void lbtf_op_bss_info_changed(struct ieee80211_hw *hw, ...@@ -434,6 +490,7 @@ static void lbtf_op_bss_info_changed(struct ieee80211_hw *hw,
{ {
struct lbtf_private *priv = hw->priv; struct lbtf_private *priv = hw->priv;
struct sk_buff *beacon; struct sk_buff *beacon;
lbtf_deb_enter(LBTF_DEB_MACOPS);
if (changes & (BSS_CHANGED_BEACON | BSS_CHANGED_BEACON_INT)) { if (changes & (BSS_CHANGED_BEACON | BSS_CHANGED_BEACON_INT)) {
switch (priv->vif->type) { switch (priv->vif->type) {
...@@ -464,6 +521,8 @@ static void lbtf_op_bss_info_changed(struct ieee80211_hw *hw, ...@@ -464,6 +521,8 @@ static void lbtf_op_bss_info_changed(struct ieee80211_hw *hw,
priv->preamble = CMD_TYPE_LONG_PREAMBLE; priv->preamble = CMD_TYPE_LONG_PREAMBLE;
lbtf_set_radio_control(priv); lbtf_set_radio_control(priv);
} }
lbtf_deb_leave(LBTF_DEB_MACOPS);
} }
static const struct ieee80211_ops lbtf_ops = { static const struct ieee80211_ops lbtf_ops = {
...@@ -486,6 +545,8 @@ int lbtf_rx(struct lbtf_private *priv, struct sk_buff *skb) ...@@ -486,6 +545,8 @@ int lbtf_rx(struct lbtf_private *priv, struct sk_buff *skb)
unsigned int flags; unsigned int flags;
struct ieee80211_hdr *hdr; struct ieee80211_hdr *hdr;
lbtf_deb_enter(LBTF_DEB_RX);
prxpd = (struct rxpd *) skb->data; prxpd = (struct rxpd *) skb->data;
stats.flag = 0; stats.flag = 0;
...@@ -516,7 +577,15 @@ int lbtf_rx(struct lbtf_private *priv, struct sk_buff *skb) ...@@ -516,7 +577,15 @@ int lbtf_rx(struct lbtf_private *priv, struct sk_buff *skb)
} }
memcpy(IEEE80211_SKB_RXCB(skb), &stats, sizeof(stats)); memcpy(IEEE80211_SKB_RXCB(skb), &stats, sizeof(stats));
lbtf_deb_rx("rx data: skb->len-sizeof(RxPd) = %d-%zd = %zd\n",
skb->len, sizeof(struct rxpd), skb->len - sizeof(struct rxpd));
lbtf_deb_hex(LBTF_DEB_RX, "RX Data", skb->data,
min_t(unsigned int, skb->len, 100));
ieee80211_rx_irqsafe(priv->hw, skb); ieee80211_rx_irqsafe(priv->hw, skb);
lbtf_deb_leave(LBTF_DEB_RX);
return 0; return 0;
} }
EXPORT_SYMBOL_GPL(lbtf_rx); EXPORT_SYMBOL_GPL(lbtf_rx);
...@@ -533,6 +602,8 @@ struct lbtf_private *lbtf_add_card(void *card, struct device *dmdev) ...@@ -533,6 +602,8 @@ struct lbtf_private *lbtf_add_card(void *card, struct device *dmdev)
struct ieee80211_hw *hw; struct ieee80211_hw *hw;
struct lbtf_private *priv = NULL; struct lbtf_private *priv = NULL;
lbtf_deb_enter(LBTF_DEB_MAIN);
hw = ieee80211_alloc_hw(sizeof(struct lbtf_private), &lbtf_ops); hw = ieee80211_alloc_hw(sizeof(struct lbtf_private), &lbtf_ops);
if (!hw) if (!hw)
goto done; goto done;
...@@ -575,6 +646,7 @@ struct lbtf_private *lbtf_add_card(void *card, struct device *dmdev) ...@@ -575,6 +646,7 @@ struct lbtf_private *lbtf_add_card(void *card, struct device *dmdev)
priv = NULL; priv = NULL;
done: done:
lbtf_deb_leave_args(LBTF_DEB_MAIN, "priv %p", priv);
return priv; return priv;
} }
EXPORT_SYMBOL_GPL(lbtf_add_card); EXPORT_SYMBOL_GPL(lbtf_add_card);
...@@ -584,6 +656,8 @@ int lbtf_remove_card(struct lbtf_private *priv) ...@@ -584,6 +656,8 @@ int lbtf_remove_card(struct lbtf_private *priv)
{ {
struct ieee80211_hw *hw = priv->hw; struct ieee80211_hw *hw = priv->hw;
lbtf_deb_enter(LBTF_DEB_MAIN);
priv->surpriseremoved = 1; priv->surpriseremoved = 1;
del_timer(&priv->command_timer); del_timer(&priv->command_timer);
lbtf_free_adapter(priv); lbtf_free_adapter(priv);
...@@ -591,6 +665,7 @@ int lbtf_remove_card(struct lbtf_private *priv) ...@@ -591,6 +665,7 @@ int lbtf_remove_card(struct lbtf_private *priv)
ieee80211_unregister_hw(hw); ieee80211_unregister_hw(hw);
ieee80211_free_hw(hw); ieee80211_free_hw(hw);
lbtf_deb_leave(LBTF_DEB_MAIN);
return 0; return 0;
} }
EXPORT_SYMBOL_GPL(lbtf_remove_card); EXPORT_SYMBOL_GPL(lbtf_remove_card);
...@@ -649,17 +724,21 @@ EXPORT_SYMBOL_GPL(lbtf_bcn_sent); ...@@ -649,17 +724,21 @@ EXPORT_SYMBOL_GPL(lbtf_bcn_sent);
static int __init lbtf_init_module(void) static int __init lbtf_init_module(void)
{ {
lbtf_deb_enter(LBTF_DEB_MAIN);
lbtf_wq = create_workqueue("libertastf"); lbtf_wq = create_workqueue("libertastf");
if (lbtf_wq == NULL) { if (lbtf_wq == NULL) {
printk(KERN_ERR "libertastf: couldn't create workqueue\n"); printk(KERN_ERR "libertastf: couldn't create workqueue\n");
return -ENOMEM; return -ENOMEM;
} }
lbtf_deb_leave(LBTF_DEB_MAIN);
return 0; return 0;
} }
static void __exit lbtf_exit_module(void) static void __exit lbtf_exit_module(void)
{ {
lbtf_deb_enter(LBTF_DEB_MAIN);
destroy_workqueue(lbtf_wq); destroy_workqueue(lbtf_wq);
lbtf_deb_leave(LBTF_DEB_MAIN);
} }
module_init(lbtf_init_module); module_init(lbtf_init_module);
......
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