All of lore.kernel.org
 help / color / mirror / Atom feed
From: Brian Gix <brian.gix@intel.com>
To: linux-bluetooth@vger.kernel.org
Cc: johan.hedberg@gmail.com, inga.stotland@intel.com,
	marcel@holtmann.org, brian.gix@intel.com
Subject: [PATCH BlueZ v3 23/30] mesh: Clean-up Comment style
Date: Fri, 14 Dec 2018 16:26:17 -0800	[thread overview]
Message-ID: <20181215002624.9313-24-brian.gix@intel.com> (raw)
In-Reply-To: <20181215002624.9313-1-brian.gix@intel.com>

---
 mesh/friend.c | 76 +++++++++++++++++++++++++++++------------------------------
 1 file changed, 38 insertions(+), 38 deletions(-)

diff --git a/mesh/friend.c b/mesh/friend.c
index 9ce499463..d17fde084 100644
--- a/mesh/friend.c
+++ b/mesh/friend.c
@@ -34,7 +34,7 @@
 #include "mesh/net.h"
 #include "mesh/crypto.h"
 #include "mesh/model.h"
-#include "mesh/display.h"
+#include "mesh/util.h"
 
 #include "mesh/friend.h"
 
@@ -78,7 +78,7 @@ static void response_timeout(struct l_timeout *timeout, void *user_data)
 	struct frnd_negotiation *neg = user_data;
 
 	/* LPN did not choose us */
-	l_info("Did not win negotiation for %4.4x", neg->low_power_node);
+	l_debug("Did not win negotiation for %4.4x", neg->low_power_node);
 
 	net_key_unref(neg->key_id);
 	l_queue_remove(frnd_negotiations, neg);
@@ -177,13 +177,13 @@ void friend_request(struct mesh_net *net, uint16_t src,
 	uint8_t minCache = (minReq >> 0) & 7;
 	int32_t rsp_delay;
 
-	l_info("RSSI of Request: %d dbm", rssi);
-	l_info("Delay: %d ms", delay);
-	l_info("Poll Timeout of Request: %d ms", timeout * 100);
-	l_info("Previous Friend: %4.4x", prev);
-	l_info("Num Elem: %2.2x", num_ele);
-	l_info("Cache Requested: %d", cache_size(minCache));
-	l_info("Cache to offer: %d", frnd_cache_size);
+	l_debug("RSSI of Request: %d dbm", rssi);
+	l_debug("Delay: %d ms", delay);
+	l_debug("Poll Timeout of Request: %d ms", timeout * 100);
+	l_debug("Previous Friend: %4.4x", prev);
+	l_debug("Num Elem: %2.2x", num_ele);
+	l_debug("Cache Requested: %d", cache_size(minCache));
+	l_debug("Cache to offer: %d", frnd_cache_size);
 
 	/* Determine our own suitability before
 	 * deciding to participate in negotiation
@@ -224,7 +224,7 @@ void friend_request(struct mesh_net *net, uint16_t src,
 	 * of 1, bit zero and additional 0.5
 	 */
 	rsp_delay = -(rssi * scaling[rssiScale]);
-	l_info("RSSI Factor: %d ms", rsp_delay / 10);
+	l_debug("RSSI Factor: %d ms", rsp_delay / 10);
 
 	/* Relay Window (Positive Factor, larger values == more time)
 	 * Scaling factor 0-3 == multiplier of 1.0 - 2.5
@@ -232,7 +232,7 @@ void friend_request(struct mesh_net *net, uint16_t src,
 	 * of 1, bit zero and additional 0.5
 	 */
 	rsp_delay += frnd_relay_window * scaling[winScale];
-	l_info("Win Size Factor: %d ms",
+	l_debug("Win Size Factor: %d ms",
 			(frnd_relay_window * scaling[winScale]) / 10);
 
 	/* Normalize to ms */
@@ -244,7 +244,7 @@ void friend_request(struct mesh_net *net, uint16_t src,
 	else if (rsp_delay > MAX_RESP_DELAY)
 		rsp_delay = MAX_RESP_DELAY;
 
-	l_info("Total Response Delay: %d ms", rsp_delay);
+	l_debug("Total Response Delay: %d ms", rsp_delay);
 
 	/* Add in 100ms delay before start of "Offer Period" */
 	rsp_delay += RESPONSE_DELAY;
@@ -261,7 +261,7 @@ void friend_clear_confirm(struct mesh_net *net, uint16_t src,
 	struct frnd_negotiation *neg = l_queue_remove_if(frnd_negotiations,
 					match_by_lpn, L_UINT_TO_PTR(lpn));
 
-	l_info("Friend Clear confirmed %4.4x (cnt %4.4x)", lpn, lpnCounter);
+	l_debug("Friend Clear confirmed %4.4x (cnt %4.4x)", lpn, lpnCounter);
 
 	if (!neg)
 		return;
@@ -276,7 +276,7 @@ static void friend_poll_timeout(struct l_timeout *timeout, void *user_data)
 	struct mesh_friend *frnd = user_data;
 
 	if (mesh_friend_clear(frnd->net, frnd))
-		l_info("Friend Poll Timeout %4.4x", frnd->dst);
+		l_debug("Friend Poll Timeout %4.4x", frnd->dst);
 
 	l_timeout_remove(frnd->timeout);
 	frnd->timeout = NULL;
@@ -343,7 +343,7 @@ void friend_clear(struct mesh_net *net, uint16_t src, uint16_t lpn,
 			return;
 	}
 
-	l_info("Friend Cleared %4.4x (%4.4x)", lpn, lpnCounter);
+	l_debug("Friend Cleared %4.4x (%4.4x)", lpn, lpnCounter);
 
 	l_put_be16(lpn, msg + 1);
 	l_put_be16(lpnCounter, msg + 3);
@@ -369,11 +369,11 @@ static void clear_retry(struct l_timeout *timeout, void *user_data)
 
 	if (secs && ((secs << 1) < neg->poll_timeout/10)) {
 		neg->receive_delay++;
-		l_info("Try FRND_CLR again in %d seconds (total timeout %d)",
+		l_debug("Try FRND_CLR again in %d seconds (total timeout %d)",
 						secs, neg->poll_timeout/10);
 		l_timeout_modify(neg->timeout, secs);
 	} else {
-		l_info("FRND_CLR timed out %d", secs);
+		l_debug("FRND_CLR timed out %d", secs);
 		l_timeout_remove(timeout);
 		l_queue_remove(frnd_negotiations, neg);
 		l_free(neg);
@@ -407,7 +407,7 @@ static void friend_delay_rsp(struct l_timeout *timeout, void *user_data)
 
 			seqZero &= SEQ_ZERO_MASK;
 
-			l_info("Fwd ACK pkt %6.6x-%8.8x",
+			l_debug("Fwd ACK pkt %6.6x-%8.8x",
 					pkt->u.one[0].seq,
 					pkt->iv_index);
 
@@ -420,7 +420,7 @@ static void friend_delay_rsp(struct l_timeout *timeout, void *user_data)
 
 
 		} else {
-			l_info("Fwd CTL pkt %6.6x-%8.8x",
+			l_debug("Fwd CTL pkt %6.6x-%8.8x",
 					pkt->u.one[0].seq,
 					pkt->iv_index);
 
@@ -442,7 +442,7 @@ static void friend_delay_rsp(struct l_timeout *timeout, void *user_data)
 		else
 			len = pkt->last_len;
 
-		l_info("Fwd FRND pkt %6.6x",
+		l_debug("Fwd FRND pkt %6.6x",
 				pkt->u.s12[pkt->cnt_out].seq);
 
 		print_packet("Frnd-Msg", pkt->u.s12[pkt->cnt_out].data, len);
@@ -462,7 +462,7 @@ static void friend_delay_rsp(struct l_timeout *timeout, void *user_data)
 update:
 	/* No More Data -- send Update message with md = false */
 	net_seq = mesh_net_get_seq_num(net);
-	l_info("Fwd FRND UPDATE %6.6x with MD == 0", net_seq);
+	l_debug("Fwd FRND UPDATE %6.6x with MD == 0", net_seq);
 
 	frnd->last = frnd->seq;
 	mesh_net_get_snb_state(net, upd + 1, &iv_index);
@@ -488,7 +488,7 @@ void friend_poll(struct mesh_net *net, uint16_t src, bool seq,
 	if (neg && !neg->clearing) {
 		uint8_t msg[5] = { NET_OP_FRND_CLEAR };
 
-		l_info("Won negotiation for %4.4x", neg->low_power_node);
+		l_debug("Won negotiation for %4.4x", neg->low_power_node);
 
 		/* This call will clean-up and replace if already friends */
 		frnd = mesh_friend_new(net, src, neg->num_ele,
@@ -695,7 +695,7 @@ void frnd_offer(struct mesh_net *net, uint16_t src, uint8_t window,
 {
 	struct frnd_offers *offer;
 
-	l_info("RSSI of Offer: %d dbm", l_rssi);
+	l_debug("RSSI of Offer: %d dbm", l_rssi);
 
 	/* Ignore RFU window value 0 */
 	if (window == 0)
@@ -735,7 +735,7 @@ static void frnd_negotiated_to(struct l_timeout *timeout, void *user_data)
 {
 	struct mesh_net *net = user_data;
 
-	l_info("frnd_negotiated_to");
+	l_debug("frnd_negotiated_to");
 	if (!mesh_net_get_friend(net)) {
 		l_timeout_remove(poll_period_to);
 		poll_period_to = NULL;
@@ -776,7 +776,7 @@ void frnd_poll(struct mesh_net *net, bool retry)
 		seq = !seq;
 		mesh_net_set_frnd_seq(net, seq);
 	} else if (!(poll_cnt--)) {
-		l_info("Lost Friendship with %4.4x", old_friend);
+		l_debug("Lost Friendship with %4.4x", old_friend);
 		l_timeout_remove(poll_period_to);
 		poll_period_to = NULL;
 		frnd_poll_cancel(net);
@@ -790,7 +790,7 @@ void frnd_poll(struct mesh_net *net, bool retry)
 	if (poll_retry_to)
 		l_timeout_remove(poll_retry_to);
 
-	l_info("TX-FRIEND POLL %d", seq);
+	l_debug("TX-FRIEND POLL %d", seq);
 	msg[1] = seq;
 	net_seq = mesh_net_get_seq_num(net);
 	mesh_net_transport_send(net, key_id, true,
@@ -858,7 +858,7 @@ static void req_timeout(struct l_timeout *timeout, void *user_data)
 		l_free(best);
 		return;
 	} else if (!best) {
-		l_info("No Offers Received");
+		l_debug("No Offers Received");
 		return;
 	}
 
@@ -884,7 +884,7 @@ static void req_timeout(struct l_timeout *timeout, void *user_data)
 
 old_keys_only:
 
-	l_info("Winning offer %4.4x RSSI: %ddb Window: %dms Cache sz: %d",
+	l_debug("Winning offer %4.4x RSSI: %ddb Window: %dms Cache sz: %d",
 			best->src, best->local_rssi,
 			best->window, best->cache);
 
@@ -930,23 +930,23 @@ void frnd_request_friend(struct mesh_net *net, uint8_t cache,
 		offers = l_queue_new();
 
 	msg[n++] = NET_OP_FRND_REQUEST;
-	msg[n] = cache & 0x07;		// MinRequirements - Cache
-	msg[n++] |= (offer_delay & 0x0f) << 3;	// Offer Delay
-	poll_period_ms = (timeout * 300) / 4; // 3/4 of the time in ms
-	l_put_be32(timeout, msg + n);	// PollTimeout
-	msg[n++] = delay;		// ReceiveDelay
+	msg[n] = cache & 0x07;		/* MinRequirements - Cache */
+	msg[n++] |= (offer_delay & 0x0f) << 3;	/* Offer Delay */
+	poll_period_ms = (timeout * 300) / 4; /* 3/4 of the time in ms */
+	l_put_be32(timeout, msg + n);	/* PollTimeout */
+	msg[n++] = delay;		/* ReceiveDelay */
 	n += 3;
-	l_put_be16(old_friend, msg + n);	// PreviousAddress
+	l_put_be16(old_friend, msg + n);	/* PreviousAddress */
 	n += 2;
-	msg[n++] = mesh_net_get_num_ele(net);	// NumElements
-	l_put_be16(cnt + 1, msg + n);	// Next counter
+	msg[n++] = mesh_net_get_num_ele(net);	/* NumElements */
+	l_put_be16(cnt + 1, msg + n);	/* Next counter */
 	n += 2;
 	print_packet("Tx-NET_OP_FRND_REQUEST", msg, n);
 	mesh_net_transport_send(net, 0, false,
 			mesh_net_get_iv_index(net), 0,
 			0, 0, FRIENDS_ADDRESS,
 			msg, n);
-	l_timeout_create_ms(1000, req_timeout, net, NULL); // 1000 ms
+	l_timeout_create_ms(1000, req_timeout, net, NULL); /* 1000 ms */
 	mesh_net_set_friend(net, 0);
 	cnt++;
 }
@@ -1036,7 +1036,7 @@ void frnd_key_refresh(struct mesh_net *net, uint8_t phase)
 	case 0:
 	case 3:
 		if (new_lpn_id) {
-			l_info("LPN Retiring KeySet %d", lpn_key_id);
+			l_debug("LPN Retiring KeySet %d", lpn_key_id);
 			net_key_unref(lpn_key_id);
 			lpn_key_id = new_lpn_id;
 		}
-- 
2.14.5


  parent reply	other threads:[~2018-12-15  0:26 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-15  0:25 [PATCH BlueZ v3 00/30] Major rewrite for Multi-Node and DBus Brian Gix
2018-12-15  0:25 ` [PATCH BlueZ v3 01/30] mesh: Staging for Mesh DBus API rewrite Brian Gix
2018-12-15  0:25 ` [PATCH BlueZ v3 02/30] mesh: Delete obsolete files Brian Gix
2018-12-15  0:25 ` [PATCH BlueZ v3 03/30] mesh: Utilities for DBus support Brian Gix
2018-12-15  0:25 ` [PATCH BlueZ v3 04/30] mesh: Internal errors Brian Gix
2018-12-15  0:25 ` [PATCH BlueZ v3 05/30] mesh: Re-write storage for Multiple Nodes Brian Gix
2018-12-15  0:26 ` [PATCH BlueZ v3 06/30] mesh: Rewrite Node handling for multiple nodes Brian Gix
2018-12-15  0:26 ` [PATCH BlueZ v3 07/30] mesh: Rewite Network layer " Brian Gix
2018-12-15  0:26 ` [PATCH BlueZ v3 08/30] mesh: Direction agnostic PB-Adv implimentation Brian Gix
2018-12-15  0:26 ` [PATCH BlueZ v3 09/30] mesh: Acceptor side provisioning implimentation Brian Gix
2018-12-15  0:26 ` [PATCH BlueZ v3 10/30] mesh: Initiator " Brian Gix
2018-12-15  0:26 ` [PATCH BlueZ v3 11/30] mesh: Rewrite Controler interface for full init Brian Gix
2018-12-15  0:26 ` [PATCH BlueZ v3 12/30] mesh: Unchanged variables set to const Brian Gix
2018-12-15  0:26 ` [PATCH BlueZ v3 13/30] mesh: centralize generic utilities Brian Gix
2018-12-15  0:26 ` [PATCH BlueZ v3 14/30] mesh: re-arrange provisioning for DBus API Brian Gix
2018-12-15  0:26 ` [PATCH BlueZ v3 15/30] mesh: Re-architect " Brian Gix
2018-12-15  0:26 ` [PATCH BlueZ v3 16/30] mesh: Make config model handle multiple nodes Brian Gix
2018-12-15  0:26 ` [PATCH BlueZ v3 17/30] mesh: Multi node Config Server model Brian Gix
2018-12-15  0:26 ` [PATCH BlueZ v3 18/30] mesh: restructure I/O for multiple nodes Brian Gix
2018-12-15  0:26 ` [PATCH BlueZ v3 19/30] mesh: Restrusture DB to support " Brian Gix
2018-12-15  0:26 ` [PATCH BlueZ v3 20/30] mesh: restructure model services for " Brian Gix
2018-12-15  0:26 ` [PATCH BlueZ v3 21/30] mesh: DBUS interface for Provisioning Agent Brian Gix
2018-12-15  0:26 ` [PATCH BlueZ v3 22/30] mesh: restructure App Key storage Brian Gix
2018-12-15  0:26 ` Brian Gix [this message]
2018-12-15  0:26 ` [PATCH BlueZ v3 24/30] mesh: Update for DBus API and multi-node support Brian Gix
2018-12-15  0:26 ` [PATCH BlueZ v3 25/30] mesh: Add default location for Mesh Node storage Brian Gix
2018-12-15  0:26 ` [PATCH BlueZ v3 26/30] mesh: Add structural changes for mesh Brian Gix
2018-12-15  0:26 ` [PATCH BlueZ v3 27/30] mesh: Sample Provisioning Agent Brian Gix
2018-12-15  0:26 ` [PATCH BlueZ v3 28/30] mesh: Sample On/Off Client and Server Brian Gix
2018-12-15  0:26 ` [PATCH BlueZ v3 29/30] mesh: Sample Mesh Joiner (provision acceptor) Brian Gix
2018-12-15  0:26 ` [PATCH BlueZ v3 30/30] mesh: Enable building Mesh Daemon Brian Gix
2018-12-17 18:42 ` [PATCH BlueZ v3 00/30] Major rewrite for Multi-Node and DBus Gix, Brian
2018-12-18  8:16   ` Szymon Janc
2018-12-18  9:14     ` Szymon Janc
2018-12-18 13:47       ` Marcel Holtmann
2018-12-18 15:08     ` Gix, Brian
2018-12-18 16:26       ` Marcel Holtmann
2018-12-18 16:50         ` Gix, Brian
2018-12-18 17:12           ` Marcel Holtmann
2018-12-19 13:02       ` Szymon Janc

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20181215002624.9313-24-brian.gix@intel.com \
    --to=brian.gix@intel.com \
    --cc=inga.stotland@intel.com \
    --cc=johan.hedberg@gmail.com \
    --cc=linux-bluetooth@vger.kernel.org \
    --cc=marcel@holtmann.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.