Search Linux Wireless

[PATCH] zd1211rw-mac80211: debug output for mac80211 ops

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Ulrich Kunitz <kune@xxxxxxxxxxxxxx>

This patch adds debug output to mac80211 operations. This is
intended to sort out the issues with the interface semantics.

Notify that zd_op_tx() doesn't output debug messages to prevent
the flooding of log files.

Signed-off-by: Ulrich Kunitz <kune@xxxxxxxxxxxxxx>
Signed-off-by: Daniel Drake <dsd@xxxxxxxxxx>
---
 drivers/net/wireless/zd1211rw-mac80211/zd_mac.c |   53 +++++++++++++++++-----
 1 files changed, 41 insertions(+), 12 deletions(-)

diff --git a/drivers/net/wireless/zd1211rw-mac80211/zd_mac.c b/drivers/net/wireless/zd1211rw-mac80211/zd_mac.c
index 257d033..2a1be76 100644
--- a/drivers/net/wireless/zd1211rw-mac80211/zd_mac.c
+++ b/drivers/net/wireless/zd1211rw-mac80211/zd_mac.c
@@ -213,6 +213,8 @@ static int zd_op_open(struct ieee80211_hw *hw)
 	struct zd_usb *usb = &chip->usb;
 	int r;
 
+	dev_dbg_f(zd_mac_dev(mac), "start\n");
+
 	if (!usb->initialized) {
 		r = zd_usb_init_hw(usb);
 		if (r)
@@ -249,6 +251,7 @@ static int zd_op_open(struct ieee80211_hw *hw)
 		goto disable_rxtx;
 
 	housekeeping_enable(mac);
+	dev_dbg_f(zd_mac_dev(mac), "return 0\n");
 	return 0;
 disable_rxtx:
 	zd_chip_disable_rxtx(chip);
@@ -257,6 +260,7 @@ disable_radio:
 disable_int:
 	zd_chip_disable_int(chip);
 out:
+	dev_dbg_f(zd_mac_dev(mac), "return %d\n", r);
 	return r;
 }
 
@@ -297,6 +301,8 @@ static int zd_op_stop(struct ieee80211_hw *hw)
 	struct sk_buff *skb;
 	struct sk_buff_head *ack_wait_queue = &mac->ack_wait_queue;
 
+	dev_dbg_f(zd_mac_dev(mac), "start \n");
+
 	/* The order here deliberately is a little different from the open()
 	 * method, since we need to make sure there is no opportunity for RX
 	 * frames to be processed by mac80211 after we have stopped it.
@@ -313,6 +319,7 @@ static int zd_op_stop(struct ieee80211_hw *hw)
 	while ((skb = skb_dequeue(ack_wait_queue)))
 		kfree_tx_skb(skb);
 
+	dev_dbg_f(zd_mac_dev(mac), "return 0\n");
 	return 0;
 }
 
@@ -584,17 +591,20 @@ static int zd_op_tx(struct ieee80211_hw *hw, struct sk_buff *skb,
 
 	r = fill_ctrlset(mac, skb, control);
 	if (r)
-		return r;
+		goto out;
 
 	r = init_tx_skb_control_block(skb, hw, control);
 	if (r)
-		return r;
+		goto out;
 	r = zd_usb_tx(&mac->chip.usb, skb);
 	if (r) {
 		clear_tx_skb_control_block(skb);
-		return r;
+		goto out;
 	}
-	return 0;
+
+	r = 0;
+out:
+	return r;
 }
 
 struct zd_rt_hdr {
@@ -711,11 +721,16 @@ int zd_mac_rx(struct ieee80211_hw *hw, const u8 *buffer, unsigned int length)
 static int zd_op_add_interface(struct ieee80211_hw *hw,
 				struct ieee80211_if_init_conf *conf)
 {
+	int r;
 	struct zd_mac *mac = zd_hw_mac(hw);
 
+	dev_dbg_f(zd_mac_dev(mac), "start\n");
+
 	/* NOTE: using IEEE80211_IF_TYPE_MGMT to indicate no mode selected */
-	if (mac->type != IEEE80211_IF_TYPE_MGMT)
-		return -1;
+	if (mac->type != IEEE80211_IF_TYPE_MGMT) {
+		r = -1;
+		goto out;
+	 }
 
 	switch (conf->type) {
 	case IEEE80211_IF_TYPE_MNTR:
@@ -723,12 +738,14 @@ static int zd_op_add_interface(struct ieee80211_hw *hw,
 		mac->type = conf->type;
 		break;
 	default:
-		return -EOPNOTSUPP;
+		r = -EOPNOTSUPP;
+		goto out;
 	}
 
-	mac->hwaddr = conf->mac_addr;
-
-	return 0;
+	r = 0;
+out:
+	dev_dbg_f(zd_mac_dev(mac), "return %d\n", r);
+	return r;
 }
 
 static void zd_op_remove_interface(struct ieee80211_hw *hw,
@@ -740,8 +757,13 @@ static void zd_op_remove_interface(struct ieee80211_hw *hw,
 
 static int zd_op_config(struct ieee80211_hw *hw, struct ieee80211_conf *conf)
 {
+	int r;
 	struct zd_mac *mac = zd_hw_mac(hw);
-	return zd_chip_set_channel(&mac->chip, conf->channel);
+
+	dev_dbg_f(zd_mac_dev(mac), "start\n");
+	r = zd_chip_set_channel(&mac->chip, conf->channel);
+	dev_dbg_f(zd_mac_dev(mac), "return %d\n", r);
+	return r;
 }
 
 static int zd_op_config_interface(struct ieee80211_hw *hw, int if_id,
@@ -749,9 +771,12 @@ static int zd_op_config_interface(struct ieee80211_hw *hw, int if_id,
 {
 	struct zd_mac *mac = zd_hw_mac(hw);
 
-	mac->associated = is_valid_ether_addr(conf->bssid);
+	dev_dbg_f(zd_mac_dev(mac), "start\n");
 
+	mac->associated = is_valid_ether_addr(conf->bssid);
 	/* TODO: do hardware bssid filtering */
+
+	dev_dbg_f(zd_mac_dev(mac), "return 0\n");
 	return 0;
 }
 
@@ -775,6 +800,8 @@ static void zd_op_set_multicast_list(struct ieee80211_hw *hw,
 	struct zd_mac *mac = zd_hw_mac(hw);
 	unsigned long flags;
 
+	dev_dbg_f(zd_mac_dev(mac), "start\n");
+
 	if ((dev_flags & (IFF_PROMISC|IFF_ALLMULTI)) ||
 	     has_monitor_interfaces(mac))
 	{
@@ -794,6 +821,8 @@ static void zd_op_set_multicast_list(struct ieee80211_hw *hw,
 	mac->multicast_hash = hash;
 	spin_unlock_irqrestore(&mac->lock, flags);
 	queue_work(zd_workqueue, &mac->set_multicast_hash_work);
+
+	dev_dbg_f(zd_mac_dev(mac), "return\n");
 }
 
 static const struct ieee80211_ops zd_ops = {
-- 
1.5.2.4

-
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]
  Powered by Linux