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

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

libertas: Convert lbs_pr_<level> to pr_<level>



Use the standard pr_<level> functions eases grep a bit.

Added a few missing terminating newlines to messages.
Coalesced long formats.

Signed-off-by: default avatarJoe Perches <joe@perches.com>
Acked-by: default avatarDan Williams <dcbw@redhat.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 9fcce61c
Loading
Loading
Loading
Loading
+8 −7
Original line number Original line Diff line number Diff line
@@ -6,6 +6,8 @@
 *
 *
 */
 */


#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt

#include <linux/sched.h>
#include <linux/sched.h>
#include <linux/wait.h>
#include <linux/wait.h>
#include <linux/slab.h>
#include <linux/slab.h>
@@ -1322,8 +1324,7 @@ static int lbs_cfg_connect(struct wiphy *wiphy, struct net_device *dev,
		sme->ssid, sme->ssid_len,
		sme->ssid, sme->ssid_len,
		WLAN_CAPABILITY_ESS, WLAN_CAPABILITY_ESS);
		WLAN_CAPABILITY_ESS, WLAN_CAPABILITY_ESS);
	if (!bss) {
	if (!bss) {
		lbs_pr_err("assoc: bss %pM not in scan results\n",
		pr_err("assoc: bss %pM not in scan results\n", sme->bssid);
			   sme->bssid);
		ret = -ENOENT;
		ret = -ENOENT;
		goto done;
		goto done;
	}
	}
@@ -1380,7 +1381,7 @@ static int lbs_cfg_connect(struct wiphy *wiphy, struct net_device *dev,
		lbs_enable_rsn(priv, sme->crypto.cipher_group != 0);
		lbs_enable_rsn(priv, sme->crypto.cipher_group != 0);
		break;
		break;
	default:
	default:
		lbs_pr_err("unsupported cipher group 0x%x\n",
		pr_err("unsupported cipher group 0x%x\n",
		       sme->crypto.cipher_group);
		       sme->crypto.cipher_group);
		ret = -ENOTSUPP;
		ret = -ENOTSUPP;
		goto done;
		goto done;
@@ -1499,7 +1500,7 @@ static int lbs_cfg_add_key(struct wiphy *wiphy, struct net_device *netdev,
				     params->key, params->key_len);
				     params->key, params->key_len);
		break;
		break;
	default:
	default:
		lbs_pr_err("unhandled cipher 0x%x\n", params->cipher);
		pr_err("unhandled cipher 0x%x\n", params->cipher);
		ret = -ENOTSUPP;
		ret = -ENOTSUPP;
		break;
		break;
	}
	}
@@ -2127,13 +2128,13 @@ int lbs_cfg_register(struct lbs_private *priv)


	ret = wiphy_register(wdev->wiphy);
	ret = wiphy_register(wdev->wiphy);
	if (ret < 0)
	if (ret < 0)
		lbs_pr_err("cannot register wiphy device\n");
		pr_err("cannot register wiphy device\n");


	priv->wiphy_registered = true;
	priv->wiphy_registered = true;


	ret = register_netdev(priv->dev);
	ret = register_netdev(priv->dev);
	if (ret)
	if (ret)
		lbs_pr_err("cannot register network device\n");
		pr_err("cannot register network device\n");


	INIT_DELAYED_WORK(&priv->scan_work, lbs_scan_worker);
	INIT_DELAYED_WORK(&priv->scan_work, lbs_scan_worker);


+18 −18
Original line number Original line Diff line number Diff line
@@ -3,6 +3,8 @@
 * It prepares command and sends it to firmware when it is ready.
 * It prepares command and sends it to firmware when it is ready.
 */
 */


#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt

#include <linux/kfifo.h>
#include <linux/kfifo.h>
#include <linux/sched.h>
#include <linux/sched.h>
#include <linux/slab.h>
#include <linux/slab.h>
@@ -110,7 +112,7 @@ int lbs_update_hw_spec(struct lbs_private *priv)
	 * CF card    firmware 5.0.16p0:   cap 0x00000303
	 * CF card    firmware 5.0.16p0:   cap 0x00000303
	 * USB dongle firmware 5.110.17p2: cap 0x00000303
	 * USB dongle firmware 5.110.17p2: cap 0x00000303
	 */
	 */
	lbs_pr_info("%pM, fw %u.%u.%up%u, cap 0x%08x\n",
	pr_info("%pM, fw %u.%u.%up%u, cap 0x%08x\n",
		cmd.permanentaddr,
		cmd.permanentaddr,
		priv->fwrelease >> 24 & 0xff,
		priv->fwrelease >> 24 & 0xff,
		priv->fwrelease >> 16 & 0xff,
		priv->fwrelease >> 16 & 0xff,
@@ -141,7 +143,7 @@ int lbs_update_hw_spec(struct lbs_private *priv)
	/* if it's unidentified region code, use the default (USA) */
	/* if it's unidentified region code, use the default (USA) */
	if (i >= MRVDRV_MAX_REGION_CODE) {
	if (i >= MRVDRV_MAX_REGION_CODE) {
		priv->regioncode = 0x10;
		priv->regioncode = 0x10;
		lbs_pr_info("unidentified region code; using the default (USA)\n");
		pr_info("unidentified region code; using the default (USA)\n");
	}
	}


	if (priv->current_addr[0] == 0xff)
	if (priv->current_addr[0] == 0xff)
@@ -211,7 +213,7 @@ int lbs_host_sleep_cfg(struct lbs_private *priv, uint32_t criteria,
					(uint8_t *)&cmd_config.wol_conf,
					(uint8_t *)&cmd_config.wol_conf,
					sizeof(struct wol_config));
					sizeof(struct wol_config));
	} else {
	} else {
		lbs_pr_info("HOST_SLEEP_CFG failed %d\n", ret);
		pr_info("HOST_SLEEP_CFG failed %d\n", ret);
	}
	}


	return ret;
	return ret;
@@ -314,7 +316,7 @@ static int lbs_wait_for_ds_awake(struct lbs_private *priv)
	if (priv->is_deep_sleep) {
	if (priv->is_deep_sleep) {
		if (!wait_event_interruptible_timeout(priv->ds_awake_q,
		if (!wait_event_interruptible_timeout(priv->ds_awake_q,
					!priv->is_deep_sleep, (10 * HZ))) {
					!priv->is_deep_sleep, (10 * HZ))) {
			lbs_pr_err("ds_awake_q: timer expired\n");
			pr_err("ds_awake_q: timer expired\n");
			ret = -1;
			ret = -1;
		}
		}
	}
	}
@@ -339,7 +341,7 @@ int lbs_set_deep_sleep(struct lbs_private *priv, int deep_sleep)
				netif_carrier_off(priv->dev);
				netif_carrier_off(priv->dev);
			}
			}
		} else {
		} else {
			lbs_pr_err("deep sleep: already enabled\n");
			pr_err("deep sleep: already enabled\n");
		}
		}
	} else {
	} else {
		if (priv->is_deep_sleep) {
		if (priv->is_deep_sleep) {
@@ -349,8 +351,7 @@ int lbs_set_deep_sleep(struct lbs_private *priv, int deep_sleep)
			if (!ret) {
			if (!ret) {
				ret = lbs_wait_for_ds_awake(priv);
				ret = lbs_wait_for_ds_awake(priv);
				if (ret)
				if (ret)
					lbs_pr_err("deep sleep: wakeup"
					pr_err("deep sleep: wakeup failed\n");
							"failed\n");
			}
			}
		}
		}
	}
	}
@@ -384,8 +385,8 @@ int lbs_set_host_sleep(struct lbs_private *priv, int host_sleep)
			ret = lbs_host_sleep_cfg(priv, priv->wol_criteria,
			ret = lbs_host_sleep_cfg(priv, priv->wol_criteria,
					(struct wol_config *)NULL);
					(struct wol_config *)NULL);
			if (ret) {
			if (ret) {
				lbs_pr_info("Host sleep configuration failed: "
				pr_info("Host sleep configuration failed: %d\n",
						"%d\n", ret);
					ret);
				return ret;
				return ret;
			}
			}
			if (priv->psstate == PS_STATE_FULL_POWER) {
			if (priv->psstate == PS_STATE_FULL_POWER) {
@@ -395,19 +396,19 @@ int lbs_set_host_sleep(struct lbs_private *priv, int host_sleep)
						sizeof(cmd),
						sizeof(cmd),
						lbs_ret_host_sleep_activate, 0);
						lbs_ret_host_sleep_activate, 0);
				if (ret)
				if (ret)
					lbs_pr_info("HOST_SLEEP_ACTIVATE "
					pr_info("HOST_SLEEP_ACTIVATE failed: %d\n",
							"failed: %d\n", ret);
						ret);
			}
			}


			if (!wait_event_interruptible_timeout(
			if (!wait_event_interruptible_timeout(
						priv->host_sleep_q,
						priv->host_sleep_q,
						priv->is_host_sleep_activated,
						priv->is_host_sleep_activated,
						(10 * HZ))) {
						(10 * HZ))) {
				lbs_pr_err("host_sleep_q: timer expired\n");
				pr_err("host_sleep_q: timer expired\n");
				ret = -1;
				ret = -1;
			}
			}
		} else {
		} else {
			lbs_pr_err("host sleep: already enabled\n");
			pr_err("host sleep: already enabled\n");
		}
		}
	} else {
	} else {
		if (priv->is_host_sleep_activated)
		if (priv->is_host_sleep_activated)
@@ -1007,7 +1008,7 @@ static void lbs_submit_command(struct lbs_private *priv,
	ret = priv->hw_host_to_card(priv, MVMS_CMD, (u8 *) cmd, cmdsize);
	ret = priv->hw_host_to_card(priv, MVMS_CMD, (u8 *) cmd, cmdsize);


	if (ret) {
	if (ret) {
		lbs_pr_info("DNLD_CMD: hw_host_to_card failed: %d\n", ret);
		pr_info("DNLD_CMD: hw_host_to_card failed: %d\n", ret);
		/* Let the timer kick in and retry, and potentially reset
		/* Let the timer kick in and retry, and potentially reset
		   the whole thing if the condition persists */
		   the whole thing if the condition persists */
		timeo = HZ/4;
		timeo = HZ/4;
@@ -1276,7 +1277,7 @@ int lbs_execute_next_command(struct lbs_private *priv)
	spin_lock_irqsave(&priv->driver_lock, flags);
	spin_lock_irqsave(&priv->driver_lock, flags);


	if (priv->cur_cmd) {
	if (priv->cur_cmd) {
		lbs_pr_alert( "EXEC_NEXT_CMD: already processing command!\n");
		pr_alert( "EXEC_NEXT_CMD: already processing command!\n");
		spin_unlock_irqrestore(&priv->driver_lock, flags);
		spin_unlock_irqrestore(&priv->driver_lock, flags);
		ret = -1;
		ret = -1;
		goto done;
		goto done;
@@ -1438,7 +1439,7 @@ static void lbs_send_confirmsleep(struct lbs_private *priv)
	ret = priv->hw_host_to_card(priv, MVMS_CMD, (u8 *) &confirm_sleep,
	ret = priv->hw_host_to_card(priv, MVMS_CMD, (u8 *) &confirm_sleep,
		sizeof(confirm_sleep));
		sizeof(confirm_sleep));
	if (ret) {
	if (ret) {
		lbs_pr_alert("confirm_sleep failed\n");
		pr_alert("confirm_sleep failed\n");
		goto out;
		goto out;
	}
	}


@@ -1664,8 +1665,7 @@ int __lbs_cmd(struct lbs_private *priv, uint16_t command,
	spin_lock_irqsave(&priv->driver_lock, flags);
	spin_lock_irqsave(&priv->driver_lock, flags);
	ret = cmdnode->result;
	ret = cmdnode->result;
	if (ret)
	if (ret)
		lbs_pr_info("PREP_CMD: command 0x%04x failed: %d\n",
		pr_info("PREP_CMD: command 0x%04x failed: %d\n", command, ret);
			    command, ret);


	__lbs_cleanup_and_insert_cmd(priv, cmdnode);
	__lbs_cleanup_and_insert_cmd(priv, cmdnode);
	spin_unlock_irqrestore(&priv->driver_lock, flags);
	spin_unlock_irqrestore(&priv->driver_lock, flags);
+17 −12
Original line number Original line Diff line number Diff line
@@ -2,6 +2,9 @@
 * This file contains the handling of command
 * This file contains the handling of command
 * responses as well as events generated by firmware.
 * responses as well as events generated by firmware.
 */
 */

#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt

#include <linux/slab.h>
#include <linux/slab.h>
#include <linux/delay.h>
#include <linux/delay.h>
#include <linux/sched.h>
#include <linux/sched.h>
@@ -85,15 +88,17 @@ int lbs_process_command_response(struct lbs_private *priv, u8 *data, u32 len)
	lbs_deb_hex(LBS_DEB_CMD, "CMD_RESP", (void *) resp, len);
	lbs_deb_hex(LBS_DEB_CMD, "CMD_RESP", (void *) resp, len);


	if (resp->seqnum != priv->cur_cmd->cmdbuf->seqnum) {
	if (resp->seqnum != priv->cur_cmd->cmdbuf->seqnum) {
		lbs_pr_info("Received CMD_RESP with invalid sequence %d (expected %d)\n",
		pr_info("Received CMD_RESP with invalid sequence %d (expected %d)\n",
			    le16_to_cpu(resp->seqnum), le16_to_cpu(priv->cur_cmd->cmdbuf->seqnum));
			le16_to_cpu(resp->seqnum),
			le16_to_cpu(priv->cur_cmd->cmdbuf->seqnum));
		spin_unlock_irqrestore(&priv->driver_lock, flags);
		spin_unlock_irqrestore(&priv->driver_lock, flags);
		ret = -1;
		ret = -1;
		goto done;
		goto done;
	}
	}
	if (respcmd != CMD_RET(curcmd) &&
	if (respcmd != CMD_RET(curcmd) &&
	    respcmd != CMD_RET_802_11_ASSOCIATE && curcmd != CMD_802_11_ASSOCIATE) {
	    respcmd != CMD_RET_802_11_ASSOCIATE && curcmd != CMD_802_11_ASSOCIATE) {
		lbs_pr_info("Invalid CMD_RESP %x to command %x!\n", respcmd, curcmd);
		pr_info("Invalid CMD_RESP %x to command %x!\n",
			respcmd, curcmd);
		spin_unlock_irqrestore(&priv->driver_lock, flags);
		spin_unlock_irqrestore(&priv->driver_lock, flags);
		ret = -1;
		ret = -1;
		goto done;
		goto done;
@@ -102,7 +107,7 @@ int lbs_process_command_response(struct lbs_private *priv, u8 *data, u32 len)
	if (resp->result == cpu_to_le16(0x0004)) {
	if (resp->result == cpu_to_le16(0x0004)) {
		/* 0x0004 means -EAGAIN. Drop the response, let it time out
		/* 0x0004 means -EAGAIN. Drop the response, let it time out
		   and be resubmitted */
		   and be resubmitted */
		lbs_pr_info("Firmware returns DEFER to command %x. Will let it time out...\n",
		pr_info("Firmware returns DEFER to command %x. Will let it time out...\n",
			le16_to_cpu(resp->command));
			le16_to_cpu(resp->command));
		spin_unlock_irqrestore(&priv->driver_lock, flags);
		spin_unlock_irqrestore(&priv->driver_lock, flags);
		ret = -1;
		ret = -1;
@@ -314,28 +319,28 @@ int lbs_process_event(struct lbs_private *priv, u32 event)
		lbs_deb_cmd("EVENT: ADHOC beacon lost\n");
		lbs_deb_cmd("EVENT: ADHOC beacon lost\n");
		break;
		break;
	case MACREG_INT_CODE_RSSI_LOW:
	case MACREG_INT_CODE_RSSI_LOW:
		lbs_pr_alert("EVENT: rssi low\n");
		pr_alert("EVENT: rssi low\n");
		break;
		break;
	case MACREG_INT_CODE_SNR_LOW:
	case MACREG_INT_CODE_SNR_LOW:
		lbs_pr_alert("EVENT: snr low\n");
		pr_alert("EVENT: snr low\n");
		break;
		break;
	case MACREG_INT_CODE_MAX_FAIL:
	case MACREG_INT_CODE_MAX_FAIL:
		lbs_pr_alert("EVENT: max fail\n");
		pr_alert("EVENT: max fail\n");
		break;
		break;
	case MACREG_INT_CODE_RSSI_HIGH:
	case MACREG_INT_CODE_RSSI_HIGH:
		lbs_pr_alert("EVENT: rssi high\n");
		pr_alert("EVENT: rssi high\n");
		break;
		break;
	case MACREG_INT_CODE_SNR_HIGH:
	case MACREG_INT_CODE_SNR_HIGH:
		lbs_pr_alert("EVENT: snr high\n");
		pr_alert("EVENT: snr high\n");
		break;
		break;


	case MACREG_INT_CODE_MESH_AUTO_STARTED:
	case MACREG_INT_CODE_MESH_AUTO_STARTED:
		/* Ignore spurious autostart events */
		/* Ignore spurious autostart events */
		lbs_pr_info("EVENT: MESH_AUTO_STARTED (ignoring)\n");
		pr_info("EVENT: MESH_AUTO_STARTED (ignoring)\n");
		break;
		break;


	default:
	default:
		lbs_pr_alert("EVENT: unknown event id %d\n", event);
		pr_alert("EVENT: unknown event id %d\n", event);
		break;
		break;
	}
	}


+4 −2
Original line number Original line Diff line number Diff line
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt

#include <linux/dcache.h>
#include <linux/dcache.h>
#include <linux/debugfs.h>
#include <linux/debugfs.h>
#include <linux/delay.h>
#include <linux/delay.h>
@@ -151,13 +153,13 @@ static ssize_t lbs_host_sleep_write(struct file *file,
		ret = lbs_set_host_sleep(priv, 0);
		ret = lbs_set_host_sleep(priv, 0);
	else if (host_sleep == 1) {
	else if (host_sleep == 1) {
		if (priv->wol_criteria == EHS_REMOVE_WAKEUP) {
		if (priv->wol_criteria == EHS_REMOVE_WAKEUP) {
			lbs_pr_info("wake parameters not configured");
			pr_info("wake parameters not configured\n");
			ret = -EINVAL;
			ret = -EINVAL;
			goto out_unlock;
			goto out_unlock;
		}
		}
		ret = lbs_set_host_sleep(priv, 1);
		ret = lbs_set_host_sleep(priv, 1);
	} else {
	} else {
		lbs_pr_err("invalid option\n");
		pr_err("invalid option\n");
		ret = -EINVAL;
		ret = -EINVAL;
	}
	}


+0 −7
Original line number Original line Diff line number Diff line
@@ -89,13 +89,6 @@ do { if ((lbs_debug & (grp)) == (grp)) \
#define lbs_deb_spi(fmt, args...)       LBS_DEB_LL(LBS_DEB_SPI, " spi", fmt, ##args)
#define lbs_deb_spi(fmt, args...)       LBS_DEB_LL(LBS_DEB_SPI, " spi", fmt, ##args)
#define lbs_deb_cfg80211(fmt, args...)  LBS_DEB_LL(LBS_DEB_CFG80211, " cfg80211", fmt, ##args)
#define lbs_deb_cfg80211(fmt, args...)  LBS_DEB_LL(LBS_DEB_CFG80211, " cfg80211", fmt, ##args)


#define lbs_pr_info(format, args...) \
	printk(KERN_INFO DRV_NAME": " format, ## args)
#define lbs_pr_err(format, args...) \
	printk(KERN_ERR DRV_NAME": " format, ## args)
#define lbs_pr_alert(format, args...) \
	printk(KERN_ALERT DRV_NAME": " format, ## args)

#ifdef DEBUG
#ifdef DEBUG
static inline void lbs_deb_hex(unsigned int grp, const char *prompt, u8 *buf, int len)
static inline void lbs_deb_hex(unsigned int grp, const char *prompt, u8 *buf, int len)
{
{
Loading