Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c96c31e4 authored by Joe Perches's avatar Joe Perches Committed by John W. Linville
Browse files

drivers/net/wireless: Use wiphy_<level>



Standardize the logging macros used.

Signed-off-by: default avatarJoe Perches <joe@perches.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent e1db74fc
Loading
Loading
Loading
Loading
+24 −29
Original line number Diff line number Diff line
@@ -373,8 +373,8 @@ static void adm8211_interrupt_rci(struct ieee80211_hw *dev)
		pktlen = status & RDES0_STATUS_FL;
		if (pktlen > RX_PKT_SIZE) {
			if (net_ratelimit())
				printk(KERN_DEBUG "%s: frame too long (%d)\n",
				       wiphy_name(dev->wiphy), pktlen);
				wiphy_debug(dev->wiphy, "frame too long (%d)\n",
					    pktlen);
			pktlen = RX_PKT_SIZE;
		}

@@ -457,7 +457,7 @@ static irqreturn_t adm8211_interrupt(int irq, void *dev_id)
#define ADM8211_INT(x)						\
do {								\
	if (unlikely(stsr & ADM8211_STSR_ ## x))		\
		printk(KERN_DEBUG "%s: " #x "\n", wiphy_name(dev->wiphy)); \
		wiphy_debug(dev->wiphy, "%s\n", #x);		\
} while (0)

	struct ieee80211_hw *dev = dev_id;
@@ -570,9 +570,9 @@ static int adm8211_write_bbp(struct ieee80211_hw *dev, u8 addr, u8 data)
	}

	if (timeout == 0) {
		printk(KERN_DEBUG "%s: adm8211_write_bbp(%d,%d) failed"
		       " prewrite (reg=0x%08x)\n",
		       wiphy_name(dev->wiphy), addr, data, reg);
		wiphy_debug(dev->wiphy,
			    "adm8211_write_bbp(%d,%d) failed prewrite (reg=0x%08x)\n",
			    addr, data, reg);
		return -ETIMEDOUT;
	}

@@ -605,9 +605,9 @@ static int adm8211_write_bbp(struct ieee80211_hw *dev, u8 addr, u8 data)
	if (timeout == 0) {
		ADM8211_CSR_WRITE(BBPCTL, ADM8211_CSR_READ(BBPCTL) &
				  ~ADM8211_BBPCTL_WR);
		printk(KERN_DEBUG "%s: adm8211_write_bbp(%d,%d) failed"
		       " postwrite (reg=0x%08x)\n",
		       wiphy_name(dev->wiphy), addr, data, reg);
		wiphy_debug(dev->wiphy,
			    "adm8211_write_bbp(%d,%d) failed postwrite (reg=0x%08x)\n",
			    addr, data, reg);
		return -ETIMEDOUT;
	}

@@ -675,8 +675,8 @@ static int adm8211_rf_set_channel(struct ieee80211_hw *dev, unsigned int chan)
		break;

	default:
		printk(KERN_DEBUG "%s: unsupported transceiver type %d\n",
		       wiphy_name(dev->wiphy), priv->transceiver_type);
		wiphy_debug(dev->wiphy, "unsupported transceiver type %d\n",
			    priv->transceiver_type);
		break;
	}

@@ -732,8 +732,8 @@ static int adm8211_rf_set_channel(struct ieee80211_hw *dev, unsigned int chan)

	/* Nothing to do for ADMtek BBP */
	} else if (priv->bbp_type != ADM8211_TYPE_ADMTEK)
		printk(KERN_DEBUG "%s: unsupported BBP type %d\n",
		       wiphy_name(dev->wiphy), priv->bbp_type);
		wiphy_debug(dev->wiphy, "unsupported bbp type %d\n",
			    priv->bbp_type);

	ADM8211_RESTORE();

@@ -1027,13 +1027,12 @@ static int adm8211_hw_init_bbp(struct ieee80211_hw *dev)
			break;

		default:
			printk(KERN_DEBUG "%s: unsupported transceiver %d\n",
			       wiphy_name(dev->wiphy), priv->transceiver_type);
			wiphy_debug(dev->wiphy, "unsupported transceiver %d\n",
				    priv->transceiver_type);
			break;
		}
	} else
		printk(KERN_DEBUG "%s: unsupported BBP %d\n",
		       wiphy_name(dev->wiphy), priv->bbp_type);
		wiphy_debug(dev->wiphy, "unsupported bbp %d\n", priv->bbp_type);

	ADM8211_CSR_WRITE(SYNRF, 0);

@@ -1509,15 +1508,13 @@ static int adm8211_start(struct ieee80211_hw *dev)
	/* Power up MAC and RF chips */
	retval = adm8211_hw_reset(dev);
	if (retval) {
		printk(KERN_ERR "%s: hardware reset failed\n",
		       wiphy_name(dev->wiphy));
		wiphy_err(dev->wiphy, "hardware reset failed\n");
		goto fail;
	}

	retval = adm8211_init_rings(dev);
	if (retval) {
		printk(KERN_ERR "%s: failed to initialize rings\n",
		       wiphy_name(dev->wiphy));
		wiphy_err(dev->wiphy, "failed to initialize rings\n");
		goto fail;
	}

@@ -1528,8 +1525,7 @@ static int adm8211_start(struct ieee80211_hw *dev)
	retval = request_irq(priv->pdev->irq, adm8211_interrupt,
			     IRQF_SHARED, "adm8211", dev);
	if (retval) {
		printk(KERN_ERR "%s: failed to register IRQ handler\n",
		       wiphy_name(dev->wiphy));
		wiphy_err(dev->wiphy, "failed to register irq handler\n");
		goto fail;
	}

@@ -1906,9 +1902,8 @@ static int __devinit adm8211_probe(struct pci_dev *pdev,
		goto err_free_eeprom;
	}

	printk(KERN_INFO "%s: hwaddr %pM, Rev 0x%02x\n",
	       wiphy_name(dev->wiphy), dev->wiphy->perm_addr,
	       pdev->revision);
	wiphy_info(dev->wiphy, "hwaddr %pm, rev 0x%02x\n",
		   dev->wiphy->perm_addr, pdev->revision);

	return 0;

+67 −72
Original line number Diff line number Diff line
@@ -658,8 +658,8 @@ static int at76_get_hw_config(struct at76_priv *priv)
exit:
	kfree(hwcfg);
	if (ret < 0)
		printk(KERN_ERR "%s: cannot get HW Config (error %d)\n",
		       wiphy_name(priv->hw->wiphy), ret);
		wiphy_err(priv->hw->wiphy, "cannot get hw config (error %d)\n",
			  ret);

	return ret;
}
@@ -794,8 +794,9 @@ static int at76_wait_completion(struct at76_priv *priv, int cmd)
	do {
		status = at76_get_cmd_status(priv->udev, cmd);
		if (status < 0) {
			printk(KERN_ERR "%s: at76_get_cmd_status failed: %d\n",
			       wiphy_name(priv->hw->wiphy), status);
			wiphy_err(priv->hw->wiphy,
				  "at76_get_cmd_status failed: %d\n",
				  status);
			break;
		}

@@ -810,9 +811,8 @@ static int at76_wait_completion(struct at76_priv *priv, int cmd)

		schedule_timeout_interruptible(HZ / 10);	/* 100 ms */
		if (time_after(jiffies, timeout)) {
			printk(KERN_ERR
			       "%s: completion timeout for command %d\n",
			       wiphy_name(priv->hw->wiphy), cmd);
			wiphy_err(priv->hw->wiphy,
				  "completion timeout for command %d\n", cmd);
			status = -ETIMEDOUT;
			break;
		}
@@ -833,9 +833,9 @@ static int at76_set_mib(struct at76_priv *priv, struct set_mib_buffer *buf)

	ret = at76_wait_completion(priv, CMD_SET_MIB);
	if (ret != CMD_STATUS_COMPLETE) {
		printk(KERN_INFO
		       "%s: set_mib: at76_wait_completion failed "
		       "with %d\n", wiphy_name(priv->hw->wiphy), ret);
		wiphy_info(priv->hw->wiphy,
			   "set_mib: at76_wait_completion failed with %d\n",
			   ret);
		ret = -EIO;
	}

@@ -855,8 +855,8 @@ static int at76_set_radio(struct at76_priv *priv, int enable)

	ret = at76_set_card_command(priv->udev, cmd, NULL, 0);
	if (ret < 0)
		printk(KERN_ERR "%s: at76_set_card_command(%d) failed: %d\n",
		       wiphy_name(priv->hw->wiphy), cmd, ret);
		wiphy_err(priv->hw->wiphy,
			  "at76_set_card_command(%d) failed: %d\n", cmd, ret);
	else
		ret = 1;

@@ -876,8 +876,8 @@ static int at76_set_pm_mode(struct at76_priv *priv)

	ret = at76_set_mib(priv, &priv->mib_buf);
	if (ret < 0)
		printk(KERN_ERR "%s: set_mib (pm_mode) failed: %d\n",
		       wiphy_name(priv->hw->wiphy), ret);
		wiphy_err(priv->hw->wiphy, "set_mib (pm_mode) failed: %d\n",
			  ret);

	return ret;
}
@@ -893,8 +893,8 @@ static int at76_set_preamble(struct at76_priv *priv, u8 type)

	ret = at76_set_mib(priv, &priv->mib_buf);
	if (ret < 0)
		printk(KERN_ERR "%s: set_mib (preamble) failed: %d\n",
		       wiphy_name(priv->hw->wiphy), ret);
		wiphy_err(priv->hw->wiphy, "set_mib (preamble) failed: %d\n",
			  ret);

	return ret;
}
@@ -910,8 +910,8 @@ static int at76_set_frag(struct at76_priv *priv, u16 size)

	ret = at76_set_mib(priv, &priv->mib_buf);
	if (ret < 0)
		printk(KERN_ERR "%s: set_mib (frag threshold) failed: %d\n",
		       wiphy_name(priv->hw->wiphy), ret);
		wiphy_err(priv->hw->wiphy,
			  "set_mib (frag threshold) failed: %d\n", ret);

	return ret;
}
@@ -927,8 +927,7 @@ static int at76_set_rts(struct at76_priv *priv, u16 size)

	ret = at76_set_mib(priv, &priv->mib_buf);
	if (ret < 0)
		printk(KERN_ERR "%s: set_mib (rts) failed: %d\n",
		       wiphy_name(priv->hw->wiphy), ret);
		wiphy_err(priv->hw->wiphy, "set_mib (rts) failed: %d\n", ret);

	return ret;
}
@@ -944,8 +943,8 @@ static int at76_set_autorate_fallback(struct at76_priv *priv, int onoff)

	ret = at76_set_mib(priv, &priv->mib_buf);
	if (ret < 0)
		printk(KERN_ERR "%s: set_mib (autorate fallback) failed: %d\n",
		       wiphy_name(priv->hw->wiphy), ret);
		wiphy_err(priv->hw->wiphy,
			  "set_mib (autorate fallback) failed: %d\n", ret);

	return ret;
}
@@ -963,8 +962,8 @@ static void at76_dump_mib_mac_addr(struct at76_priv *priv)
	ret = at76_get_mib(priv->udev, MIB_MAC_ADDR, m,
			   sizeof(struct mib_mac_addr));
	if (ret < 0) {
		printk(KERN_ERR "%s: at76_get_mib (MAC_ADDR) failed: %d\n",
		       wiphy_name(priv->hw->wiphy), ret);
		wiphy_err(priv->hw->wiphy,
			  "at76_get_mib (mac_addr) failed: %d\n", ret);
		goto exit;
	}

@@ -992,8 +991,8 @@ static void at76_dump_mib_mac_wep(struct at76_priv *priv)
	ret = at76_get_mib(priv->udev, MIB_MAC_WEP, m,
			   sizeof(struct mib_mac_wep));
	if (ret < 0) {
		printk(KERN_ERR "%s: at76_get_mib (MAC_WEP) failed: %d\n",
		       wiphy_name(priv->hw->wiphy), ret);
		wiphy_err(priv->hw->wiphy,
			  "at76_get_mib (mac_wep) failed: %d\n", ret);
		goto exit;
	}

@@ -1029,8 +1028,8 @@ static void at76_dump_mib_mac_mgmt(struct at76_priv *priv)
	ret = at76_get_mib(priv->udev, MIB_MAC_MGMT, m,
			   sizeof(struct mib_mac_mgmt));
	if (ret < 0) {
		printk(KERN_ERR "%s: at76_get_mib (MAC_MGMT) failed: %d\n",
		       wiphy_name(priv->hw->wiphy), ret);
		wiphy_err(priv->hw->wiphy,
			  "at76_get_mib (mac_mgmt) failed: %d\n", ret);
		goto exit;
	}

@@ -1065,8 +1064,8 @@ static void at76_dump_mib_mac(struct at76_priv *priv)

	ret = at76_get_mib(priv->udev, MIB_MAC, m, sizeof(struct mib_mac));
	if (ret < 0) {
		printk(KERN_ERR "%s: at76_get_mib (MAC) failed: %d\n",
		       wiphy_name(priv->hw->wiphy), ret);
		wiphy_err(priv->hw->wiphy,
			  "at76_get_mib (mac) failed: %d\n", ret);
		goto exit;
	}

@@ -1102,8 +1101,8 @@ static void at76_dump_mib_phy(struct at76_priv *priv)

	ret = at76_get_mib(priv->udev, MIB_PHY, m, sizeof(struct mib_phy));
	if (ret < 0) {
		printk(KERN_ERR "%s: at76_get_mib (PHY) failed: %d\n",
		       wiphy_name(priv->hw->wiphy), ret);
		wiphy_err(priv->hw->wiphy,
			  "at76_get_mib (phy) failed: %d\n", ret);
		goto exit;
	}

@@ -1135,8 +1134,8 @@ static void at76_dump_mib_local(struct at76_priv *priv)

	ret = at76_get_mib(priv->udev, MIB_LOCAL, m, sizeof(struct mib_local));
	if (ret < 0) {
		printk(KERN_ERR "%s: at76_get_mib (LOCAL) failed: %d\n",
		       wiphy_name(priv->hw->wiphy), ret);
		wiphy_err(priv->hw->wiphy,
			  "at76_get_mib (local) failed: %d\n", ret);
		goto exit;
	}

@@ -1161,8 +1160,8 @@ static void at76_dump_mib_mdomain(struct at76_priv *priv)
	ret = at76_get_mib(priv->udev, MIB_MDOMAIN, m,
			   sizeof(struct mib_mdomain));
	if (ret < 0) {
		printk(KERN_ERR "%s: at76_get_mib (MDOMAIN) failed: %d\n",
		       wiphy_name(priv->hw->wiphy), ret);
		wiphy_err(priv->hw->wiphy,
			  "at76_get_mib (mdomain) failed: %d\n", ret);
		goto exit;
	}

@@ -1233,16 +1232,16 @@ static int at76_submit_rx_urb(struct at76_priv *priv)
	struct sk_buff *skb = priv->rx_skb;

	if (!priv->rx_urb) {
		printk(KERN_ERR "%s: %s: priv->rx_urb is NULL\n",
		       wiphy_name(priv->hw->wiphy), __func__);
		wiphy_err(priv->hw->wiphy, "%s: priv->rx_urb is null\n",
			  __func__);
		return -EFAULT;
	}

	if (!skb) {
		skb = dev_alloc_skb(sizeof(struct at76_rx_buffer));
		if (!skb) {
			printk(KERN_ERR "%s: cannot allocate rx skbuff\n",
			       wiphy_name(priv->hw->wiphy));
			wiphy_err(priv->hw->wiphy,
				  "cannot allocate rx skbuff\n");
			ret = -ENOMEM;
			goto exit;
		}
@@ -1261,15 +1260,14 @@ static int at76_submit_rx_urb(struct at76_priv *priv)
			at76_dbg(DBG_DEVSTART,
				 "usb_submit_urb returned -ENODEV");
		else
			printk(KERN_ERR "%s: rx, usb_submit_urb failed: %d\n",
			       wiphy_name(priv->hw->wiphy), ret);
			wiphy_err(priv->hw->wiphy,
				  "rx, usb_submit_urb failed: %d\n", ret);
	}

exit:
	if (ret < 0 && ret != -ENODEV)
		printk(KERN_ERR "%s: cannot submit rx urb - please unload the "
		       "driver and/or power cycle the device\n",
		       wiphy_name(priv->hw->wiphy));
		wiphy_err(priv->hw->wiphy,
			  "cannot submit rx urb - please unload the driver and/or power cycle the device\n");

	return ret;
}
@@ -1438,8 +1436,8 @@ static int at76_startup_device(struct at76_priv *priv)
	ret = at76_set_card_command(priv->udev, CMD_STARTUP, &priv->card_config,
				    sizeof(struct at76_card_config));
	if (ret < 0) {
		printk(KERN_ERR "%s: at76_set_card_command failed: %d\n",
		       wiphy_name(priv->hw->wiphy), ret);
		wiphy_err(priv->hw->wiphy, "at76_set_card_command failed: %d\n",
			  ret);
		return ret;
	}

@@ -1504,8 +1502,8 @@ static void at76_work_set_promisc(struct work_struct *work)

	ret = at76_set_mib(priv, &priv->mib_buf);
	if (ret < 0)
		printk(KERN_ERR "%s: set_mib (promiscuous_mode) failed: %d\n",
		       wiphy_name(priv->hw->wiphy), ret);
		wiphy_err(priv->hw->wiphy,
			  "set_mib (promiscuous_mode) failed: %d\n", ret);

	mutex_unlock(&priv->mtx);
}
@@ -1668,16 +1666,16 @@ static int at76_join(struct at76_priv *priv)
				    sizeof(struct at76_req_join));

	if (ret < 0) {
		printk(KERN_ERR "%s: at76_set_card_command failed: %d\n",
		       wiphy_name(priv->hw->wiphy), ret);
		wiphy_err(priv->hw->wiphy, "at76_set_card_command failed: %d\n",
			  ret);
		return 0;
	}

	ret = at76_wait_completion(priv, CMD_JOIN);
	at76_dbg(DBG_MAC80211, "%s: CMD_JOIN returned: 0x%02x", __func__, ret);
	if (ret != CMD_STATUS_COMPLETE) {
		printk(KERN_ERR "%s: at76_wait_completion failed: %d\n",
		       wiphy_name(priv->hw->wiphy), ret);
		wiphy_err(priv->hw->wiphy, "at76_wait_completion failed: %d\n",
			  ret);
		return 0;
	}

@@ -1745,8 +1743,8 @@ static int at76_mac80211_tx(struct ieee80211_hw *hw, struct sk_buff *skb)
	at76_dbg(DBG_MAC80211, "%s()", __func__);

	if (priv->tx_urb->status == -EINPROGRESS) {
		printk(KERN_ERR "%s: %s called while tx urb is pending\n",
		       wiphy_name(priv->hw->wiphy), __func__);
		wiphy_err(priv->hw->wiphy,
			  "%s called while tx urb is pending\n", __func__);
		return NETDEV_TX_BUSY;
	}

@@ -1794,12 +1792,11 @@ static int at76_mac80211_tx(struct ieee80211_hw *hw, struct sk_buff *skb)
			  submit_len, at76_mac80211_tx_callback, priv);
	ret = usb_submit_urb(priv->tx_urb, GFP_ATOMIC);
	if (ret) {
		printk(KERN_ERR "%s: error in tx submit urb: %d\n",
		       wiphy_name(priv->hw->wiphy), ret);
		wiphy_err(priv->hw->wiphy, "error in tx submit urb: %d\n", ret);
		if (ret == -EINVAL)
			printk(KERN_ERR
			       "%s: -EINVAL: tx urb %p hcpriv %p complete %p\n",
			       wiphy_name(priv->hw->wiphy), priv->tx_urb,
			wiphy_err(priv->hw->wiphy,
				  "-einval: tx urb %p hcpriv %p complete %p\n",
				  priv->tx_urb,
				  priv->tx_urb->hcpriv, priv->tx_urb->complete);
	}

@@ -1817,8 +1814,8 @@ static int at76_mac80211_start(struct ieee80211_hw *hw)

	ret = at76_submit_rx_urb(priv);
	if (ret < 0) {
		printk(KERN_ERR "%s: open: submit_rx_urb failed: %d\n",
		       wiphy_name(priv->hw->wiphy), ret);
		wiphy_err(priv->hw->wiphy, "open: submit_rx_urb failed: %d\n",
			  ret);
		goto error;
	}

@@ -2316,13 +2313,11 @@ static int at76_init_new_device(struct at76_priv *priv,

	priv->mac80211_registered = 1;

	printk(KERN_INFO "%s: USB %s, MAC %pM, firmware %d.%d.%d-%d\n",
	       wiphy_name(priv->hw->wiphy),
	wiphy_info(priv->hw->wiphy, "usb %s, mac %pm, firmware %d.%d.%d-%d\n",
		   dev_name(&interface->dev), priv->mac_addr,
		   priv->fw_version.major, priv->fw_version.minor,
		   priv->fw_version.patch, priv->fw_version.build);
	printk(KERN_INFO "%s: regulatory domain 0x%02x: %s\n",
	       wiphy_name(priv->hw->wiphy),
	wiphy_info(priv->hw->wiphy, "regulatory domain 0x%02x: %s\n",
		   priv->regulatory_domain, priv->domain->name);

exit:
@@ -2485,7 +2480,7 @@ static void at76_disconnect(struct usb_interface *interface)
	if (!priv)
		return;

	printk(KERN_INFO "%s: disconnecting\n", wiphy_name(priv->hw->wiphy));
	wiphy_info(priv->hw->wiphy, "disconnecting\n");
	at76_delete_device(priv);
	dev_printk(KERN_INFO, &interface->dev, "disconnected\n");
}
+3 −4
Original line number Diff line number Diff line
@@ -48,8 +48,7 @@ int ar9170_write_mem(struct ar9170 *ar, const __le32 *data, size_t len)

	err = ar->exec_cmd(ar, AR9170_CMD_WMEM, len, (u8 *) data, 0, NULL);
	if (err)
		printk(KERN_DEBUG "%s: writing memory failed\n",
		       wiphy_name(ar->hw->wiphy));
		wiphy_debug(ar->hw->wiphy, "writing memory failed\n");
	return err;
}

@@ -67,8 +66,8 @@ int ar9170_write_reg(struct ar9170 *ar, const u32 reg, const u32 val)
	err = ar->exec_cmd(ar, AR9170_CMD_WREG, sizeof(buf),
			   (u8 *) buf, 0, NULL);
	if (err)
		printk(KERN_DEBUG "%s: writing reg %#x (val %#x) failed\n",
		       wiphy_name(ar->hw->wiphy), reg, val);
		wiphy_debug(ar->hw->wiphy, "writing reg %#x (val %#x) failed\n",
			    reg, val);
	return err;
}

+2 −2
Original line number Diff line number Diff line
@@ -133,8 +133,8 @@ static int ar9170_register_led(struct ar9170 *ar, int i, char *name,
	err = led_classdev_register(wiphy_dev(ar->hw->wiphy),
				    &ar->leds[i].l);
	if (err)
		printk(KERN_ERR "%s: failed to register %s LED (%d).\n",
		       wiphy_name(ar->hw->wiphy), ar->leds[i].name, err);
		wiphy_err(ar->hw->wiphy, "failed to register %s LED (%d).\n",
			  ar->leds[i].name, err);
	else
		ar->leds[i].registered = true;

+80 −92
Original line number Diff line number Diff line
@@ -198,9 +198,10 @@ static void ar9170_print_txheader(struct ar9170 *ar, struct sk_buff *skb)
	struct ar9170_tx_info *arinfo = (void *) txinfo->rate_driver_data;
	struct ieee80211_hdr *hdr = (void *) txc->frame_data;

	printk(KERN_DEBUG "%s: => FRAME [skb:%p, q:%d, DA:[%pM] s:%d "
	wiphy_debug(ar->hw->wiphy,
		    "=> FRAME [skb:%p, q:%d, DA:[%pM] s:%d "
		    "mac_ctrl:%04x, phy_ctrl:%08x, timeout:[%d ms]]\n",
	       wiphy_name(ar->hw->wiphy), skb, skb_get_queue_mapping(skb),
		    skb, skb_get_queue_mapping(skb),
		    ieee80211_get_DA(hdr), ar9170_get_seq_h(hdr),
		    le16_to_cpu(txc->mac_control), le32_to_cpu(txc->phy_control),
		    jiffies_to_msecs(arinfo->timeout - jiffies));
@@ -213,8 +214,8 @@ static void __ar9170_dump_txqueue(struct ar9170 *ar,
	int i = 0;

	printk(KERN_DEBUG "---[ cut here ]---\n");
	printk(KERN_DEBUG "%s: %d entries in queue.\n",
	       wiphy_name(ar->hw->wiphy), skb_queue_len(queue));
	wiphy_debug(ar->hw->wiphy, "%d entries in queue.\n",
		    skb_queue_len(queue));

	skb_queue_walk(queue, skb) {
		printk(KERN_DEBUG "index:%d =>\n", i++);
@@ -244,13 +245,12 @@ static void __ar9170_dump_txstats(struct ar9170 *ar)
{
	int i;

	printk(KERN_DEBUG "%s: QoS queue stats\n",
	       wiphy_name(ar->hw->wiphy));
	wiphy_debug(ar->hw->wiphy, "qos queue stats\n");

	for (i = 0; i < __AR9170_NUM_TXQ; i++)
		printk(KERN_DEBUG "%s: queue:%d limit:%d len:%d waitack:%d "
		       " stopped:%d\n", wiphy_name(ar->hw->wiphy), i,
		       ar->tx_stats[i].limit, ar->tx_stats[i].len,
		wiphy_debug(ar->hw->wiphy,
			    "queue:%d limit:%d len:%d waitack:%d stopped:%d\n",
			    i, ar->tx_stats[i].limit, ar->tx_stats[i].len,
			    skb_queue_len(&ar->tx_status[i]),
			    ieee80211_queue_stopped(ar->hw, i));
}
@@ -274,8 +274,8 @@ static void ar9170_recycle_expired(struct ar9170 *ar,

		if (time_is_before_jiffies(arinfo->timeout)) {
#ifdef AR9170_QUEUE_DEBUG
			printk(KERN_DEBUG "%s: [%ld > %ld] frame expired => "
			       "recycle\n", wiphy_name(ar->hw->wiphy),
			wiphy_debug(ar->hw->wiphy,
				    "[%ld > %ld] frame expired => recycle\n",
				    jiffies, arinfo->timeout);
			ar9170_print_txheader(ar, skb);
#endif /* AR9170_QUEUE_DEBUG */
@@ -317,8 +317,8 @@ static void ar9170_tx_status(struct ar9170 *ar, struct sk_buff *skb,
		break;

	default:
		printk(KERN_ERR "%s: invalid tx_status response (%x).\n",
		       wiphy_name(ar->hw->wiphy), tx_status);
		wiphy_err(ar->hw->wiphy,
			  "invalid tx_status response (%x)\n", tx_status);
		break;
	}

@@ -339,8 +339,7 @@ void ar9170_tx_callback(struct ar9170 *ar, struct sk_buff *skb)

	if (ar->tx_stats[queue].len < AR9170_NUM_TX_LIMIT_SOFT) {
#ifdef AR9170_QUEUE_STOP_DEBUG
		printk(KERN_DEBUG "%s: wake queue %d\n",
		       wiphy_name(ar->hw->wiphy), queue);
		wiphy_debug(ar->hw->wiphy, "wake queue %d\n", queue);
		__ar9170_dump_txstats(ar);
#endif /* AR9170_QUEUE_STOP_DEBUG */
		ieee80211_wake_queue(ar->hw, queue);
@@ -387,9 +386,9 @@ static struct sk_buff *ar9170_get_queued_skb(struct ar9170 *ar,

		if (mac && compare_ether_addr(ieee80211_get_DA(hdr), mac)) {
#ifdef AR9170_QUEUE_DEBUG
			printk(KERN_DEBUG "%s: skip frame => DA %pM != %pM\n",
			       wiphy_name(ar->hw->wiphy), mac,
			       ieee80211_get_DA(hdr));
			wiphy_debug(ar->hw->wiphy,
				    "skip frame => da %pm != %pm\n",
				    mac, ieee80211_get_DA(hdr));
			ar9170_print_txheader(ar, skb);
#endif /* AR9170_QUEUE_DEBUG */
			continue;
@@ -400,8 +399,8 @@ static struct sk_buff *ar9170_get_queued_skb(struct ar9170 *ar,

		if ((rate != AR9170_TX_INVALID_RATE) && (r != rate)) {
#ifdef AR9170_QUEUE_DEBUG
			printk(KERN_DEBUG "%s: skip frame => rate %d != %d\n",
			       wiphy_name(ar->hw->wiphy), rate, r);
			wiphy_debug(ar->hw->wiphy,
				    "skip frame => rate %d != %d\n", rate, r);
			ar9170_print_txheader(ar, skb);
#endif /* AR9170_QUEUE_DEBUG */
			continue;
@@ -413,9 +412,9 @@ static struct sk_buff *ar9170_get_queued_skb(struct ar9170 *ar,
	}

#ifdef AR9170_QUEUE_DEBUG
	printk(KERN_ERR "%s: ESS:[%pM] does not have any "
			"outstanding frames in queue.\n",
			wiphy_name(ar->hw->wiphy), mac);
	wiphy_err(ar->hw->wiphy,
		  "ESS:[%pM] does not have any outstanding frames in queue.\n",
		  mac);
	__ar9170_dump_txqueue(ar, queue);
#endif /* AR9170_QUEUE_DEBUG */
	spin_unlock_irqrestore(&queue->lock, flags);
@@ -444,8 +443,8 @@ static void ar9170_tx_janitor(struct work_struct *work)

	for (i = 0; i < __AR9170_NUM_TXQ; i++) {
#ifdef AR9170_QUEUE_DEBUG
		printk(KERN_DEBUG "%s: garbage collector scans queue:%d\n",
		       wiphy_name(ar->hw->wiphy), i);
		wiphy_debug(ar->hw->wiphy, "garbage collector scans queue:%d\n",
			    i);
		ar9170_dump_txqueue(ar, &ar->tx_pending[i]);
		ar9170_dump_txqueue(ar, &ar->tx_status[i]);
#endif /* AR9170_QUEUE_DEBUG */
@@ -495,8 +494,9 @@ void ar9170_handle_command_response(struct ar9170 *ar, void *buf, u32 len)
		u32 q = (phy & AR9170_TX_PHY_QOS_MASK) >>
			AR9170_TX_PHY_QOS_SHIFT;
#ifdef AR9170_QUEUE_DEBUG
		printk(KERN_DEBUG "%s: recv tx_status for %pM, p:%08x, q:%d\n",
		       wiphy_name(ar->hw->wiphy), cmd->tx_status.dst, phy, q);
		wiphy_debug(ar->hw->wiphy,
			    "recv tx_status for %pm, p:%08x, q:%d\n",
			    cmd->tx_status.dst, phy, q);
#endif /* AR9170_QUEUE_DEBUG */

		skb = ar9170_get_queued_skb(ar, cmd->tx_status.dst,
@@ -582,7 +582,7 @@ void ar9170_handle_command_response(struct ar9170 *ar, void *buf, u32 len)
		break;

	default:
		printk(KERN_INFO "received unhandled event %x\n", cmd->type);
		pr_info("received unhandled event %x\n", cmd->type);
		print_hex_dump_bytes("dump:", DUMP_PREFIX_NONE, buf, len);
		break;
	}
@@ -675,9 +675,9 @@ static int ar9170_rx_mac_status(struct ar9170 *ar,
		/* TODO: update netdevice's RX dropped/errors statistics */

		if (ar9170_nag_limiter(ar))
			printk(KERN_DEBUG "%s: received frame with "
			       "suspicious error code (%#x).\n",
			       wiphy_name(ar->hw->wiphy), error);
			wiphy_debug(ar->hw->wiphy,
				    "received frame with suspicious error code (%#x).\n",
				    error);

		return -EINVAL;
	}
@@ -704,8 +704,8 @@ static int ar9170_rx_mac_status(struct ar9170 *ar,
			break;
		default:
			if (ar9170_nag_limiter(ar))
				printk(KERN_ERR "%s: invalid plcp cck rate "
				       "(%x).\n", wiphy_name(ar->hw->wiphy),
				wiphy_err(ar->hw->wiphy,
					  "invalid plcp cck rate (%x).\n",
					  head->plcp[0]);
			return -EINVAL;
		}
@@ -740,8 +740,8 @@ static int ar9170_rx_mac_status(struct ar9170 *ar,
			break;
		default:
			if (ar9170_nag_limiter(ar))
				printk(KERN_ERR "%s: invalid plcp ofdm rate "
				       "(%x).\n", wiphy_name(ar->hw->wiphy),
				wiphy_err(ar->hw->wiphy,
					  "invalid plcp ofdm rate (%x).\n",
					  head->plcp[0]);
			return -EINVAL;
		}
@@ -761,8 +761,7 @@ static int ar9170_rx_mac_status(struct ar9170 *ar,

	default:
		if (ar9170_nag_limiter(ar))
			printk(KERN_ERR "%s: invalid modulation\n",
			       wiphy_name(ar->hw->wiphy));
			wiphy_err(ar->hw->wiphy, "invalid modulation\n");
		return -EINVAL;
	}

@@ -863,8 +862,8 @@ static void ar9170_handle_mpdu(struct ar9170 *ar, u8 *buf, int len)
			ar->rx_mpdu.has_plcp = true;
		} else {
			if (ar9170_nag_limiter(ar))
				printk(KERN_ERR "%s: plcp info is clipped.\n",
				       wiphy_name(ar->hw->wiphy));
				wiphy_err(ar->hw->wiphy,
					  "plcp info is clipped.\n");
			return ;
		}
		break;
@@ -877,8 +876,8 @@ static void ar9170_handle_mpdu(struct ar9170 *ar, u8 *buf, int len)
			phy = (void *)(buf + mpdu_len);
		} else {
			if (ar9170_nag_limiter(ar))
				printk(KERN_ERR "%s: frame tail is clipped.\n",
				       wiphy_name(ar->hw->wiphy));
				wiphy_err(ar->hw->wiphy,
					  "frame tail is clipped.\n");
			return ;
		}

@@ -888,9 +887,8 @@ static void ar9170_handle_mpdu(struct ar9170 *ar, u8 *buf, int len)
			if (!ar9170_nag_limiter(ar))
				return ;

			printk(KERN_ERR "%s: rx stream did not start "
					"with a first_mpdu frame tag.\n",
			       wiphy_name(ar->hw->wiphy));
			wiphy_err(ar->hw->wiphy,
				  "rx stream did not start with a first_mpdu frame tag.\n");

			return ;
		}
@@ -954,8 +952,8 @@ void ar9170_rx(struct ar9170 *ar, struct sk_buff *skb)
			if (!ar->rx_failover_missing) {
				/* this is no "short read". */
				if (ar9170_nag_limiter(ar)) {
					printk(KERN_ERR "%s: missing tag!\n",
					       wiphy_name(ar->hw->wiphy));
					wiphy_err(ar->hw->wiphy,
						  "missing tag!\n");
					goto err_telluser;
				} else
					goto err_silent;
@@ -963,9 +961,8 @@ void ar9170_rx(struct ar9170 *ar, struct sk_buff *skb)

			if (ar->rx_failover_missing > tlen) {
				if (ar9170_nag_limiter(ar)) {
					printk(KERN_ERR "%s: possible multi "
					       "stream corruption!\n",
					       wiphy_name(ar->hw->wiphy));
					wiphy_err(ar->hw->wiphy,
						  "possible multi stream corruption!\n");
					goto err_telluser;
				} else
					goto err_silent;
@@ -997,9 +994,8 @@ void ar9170_rx(struct ar9170 *ar, struct sk_buff *skb)
			if (ar->rx_failover_missing) {
				/* TODO: handle double stream corruption. */
				if (ar9170_nag_limiter(ar)) {
					printk(KERN_ERR "%s: double rx stream "
					       "corruption!\n",
						wiphy_name(ar->hw->wiphy));
					wiphy_err(ar->hw->wiphy,
						  "double rx stream corruption!\n");
					goto err_telluser;
				} else
					goto err_silent;
@@ -1042,9 +1038,9 @@ void ar9170_rx(struct ar9170 *ar, struct sk_buff *skb)

	if (tlen) {
		if (net_ratelimit())
			printk(KERN_ERR "%s: %d bytes of unprocessed "
					"data left in rx stream!\n",
			       wiphy_name(ar->hw->wiphy), tlen);
			wiphy_err(ar->hw->wiphy,
				  "%d bytes of unprocessed data left in rx stream!\n",
				  tlen);

		goto err_telluser;
	}
@@ -1052,10 +1048,9 @@ void ar9170_rx(struct ar9170 *ar, struct sk_buff *skb)
	return ;

err_telluser:
	printk(KERN_ERR "%s: damaged RX stream data [want:%d, "
			"data:%d, rx:%d, pending:%d ]\n",
	       wiphy_name(ar->hw->wiphy), clen, wlen, tlen,
	       ar->rx_failover_missing);
	wiphy_err(ar->hw->wiphy,
		  "damaged RX stream data [want:%d, data:%d, rx:%d, pending:%d ]\n",
		  clen, wlen, tlen, ar->rx_failover_missing);

	if (ar->rx_failover_missing)
		print_hex_dump_bytes("rxbuf:", DUMP_PREFIX_OFFSET,
@@ -1065,9 +1060,8 @@ void ar9170_rx(struct ar9170 *ar, struct sk_buff *skb)
	print_hex_dump_bytes("stream:", DUMP_PREFIX_OFFSET,
			     skb->data, skb->len);

	printk(KERN_ERR "%s: please check your hardware and cables, if "
			"you see this message frequently.\n",
	       wiphy_name(ar->hw->wiphy));
	wiphy_err(ar->hw->wiphy,
		  "If you see this message frequently, please check your hardware and cables.\n");

err_silent:
	if (ar->rx_failover_missing) {
@@ -1384,10 +1378,10 @@ static void ar9170_tx(struct ar9170 *ar)

		if (remaining_space < frames) {
#ifdef AR9170_QUEUE_DEBUG
			printk(KERN_DEBUG "%s: tx quota reached queue:%d, "
			wiphy_debug(ar->hw->wiphy,
				    "tx quota reached queue:%d, "
				    "remaining slots:%d, needed:%d\n",
			       wiphy_name(ar->hw->wiphy), i, remaining_space,
			       frames);
				    i, remaining_space, frames);
#endif /* AR9170_QUEUE_DEBUG */
			frames = remaining_space;
		}
@@ -1396,18 +1390,14 @@ static void ar9170_tx(struct ar9170 *ar)
		ar->tx_stats[i].count += frames;
		if (ar->tx_stats[i].len >= ar->tx_stats[i].limit) {
#ifdef AR9170_QUEUE_DEBUG
			printk(KERN_DEBUG "%s: queue %d full\n",
			       wiphy_name(ar->hw->wiphy), i);

			printk(KERN_DEBUG "%s: stuck frames: ===>\n",
			       wiphy_name(ar->hw->wiphy));
			wiphy_debug(ar->hw->wiphy, "queue %d full\n", i);
			wiphy_debug(ar->hw->wiphy, "stuck frames: ===>\n");
			ar9170_dump_txqueue(ar, &ar->tx_pending[i]);
			ar9170_dump_txqueue(ar, &ar->tx_status[i]);
#endif /* AR9170_QUEUE_DEBUG */

#ifdef AR9170_QUEUE_STOP_DEBUG
			printk(KERN_DEBUG "%s: stop queue %d\n",
			       wiphy_name(ar->hw->wiphy), i);
			wiphy_debug(ar->hw->wiphy, "stop queue %d\n", i);
			__ar9170_dump_txstats(ar);
#endif /* AR9170_QUEUE_STOP_DEBUG */
			ieee80211_stop_queue(ar->hw, i);
@@ -1435,8 +1425,7 @@ static void ar9170_tx(struct ar9170 *ar)
					  msecs_to_jiffies(AR9170_TX_TIMEOUT);

#ifdef AR9170_QUEUE_DEBUG
			printk(KERN_DEBUG "%s: send frame q:%d =>\n",
			       wiphy_name(ar->hw->wiphy), i);
			wiphy_debug(ar->hw->wiphy, "send frame q:%d =>\n", i);
			ar9170_print_txheader(ar, skb);
#endif /* AR9170_QUEUE_DEBUG */

@@ -1453,26 +1442,25 @@ static void ar9170_tx(struct ar9170 *ar)
		}

#ifdef AR9170_QUEUE_DEBUG
		printk(KERN_DEBUG "%s: ar9170_tx report for queue %d\n",
		       wiphy_name(ar->hw->wiphy), i);
		wiphy_debug(ar->hw->wiphy,
			    "ar9170_tx report for queue %d\n", i);

		printk(KERN_DEBUG "%s: unprocessed pending frames left:\n",
		       wiphy_name(ar->hw->wiphy));
		wiphy_debug(ar->hw->wiphy,
			    "unprocessed pending frames left:\n");
		ar9170_dump_txqueue(ar, &ar->tx_pending[i]);
#endif /* AR9170_QUEUE_DEBUG */

		if (unlikely(frames_failed)) {
#ifdef AR9170_QUEUE_DEBUG
			printk(KERN_DEBUG "%s: frames failed %d =>\n",
			       wiphy_name(ar->hw->wiphy), frames_failed);
			wiphy_debug(ar->hw->wiphy,
				    "frames failed %d =>\n", frames_failed);
#endif /* AR9170_QUEUE_DEBUG */

			spin_lock_irqsave(&ar->tx_stats_lock, flags);
			ar->tx_stats[i].len -= frames_failed;
			ar->tx_stats[i].count -= frames_failed;
#ifdef AR9170_QUEUE_STOP_DEBUG
			printk(KERN_DEBUG "%s: wake queue %d\n",
			       wiphy_name(ar->hw->wiphy), i);
			wiphy_debug(ar->hw->wiphy, "wake queue %d\n", i);
			__ar9170_dump_txstats(ar);
#endif /* AR9170_QUEUE_STOP_DEBUG */
			ieee80211_wake_queue(ar->hw, i);
Loading