linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] net: 6pack: Fix tx timeout and slot time
@ 2021-09-09  3:57 Guenter Roeck
  2021-09-09 11:34 ` David Miller
  0 siblings, 1 reply; 5+ messages in thread
From: Guenter Roeck @ 2021-09-09  3:57 UTC (permalink / raw)
  To: Andreas Koensgen
  Cc: David S . Miller, Jakub Kicinski, linux-hams, netdev,
	linux-kernel, Guenter Roeck

tx timeout and slot time are currently specified in units of HZ.
On Alpha, HZ is defined as 1024. When building alpha:allmodconfig,
this results in the following error message.

drivers/net/hamradio/6pack.c: In function 'sixpack_open':
drivers/net/hamradio/6pack.c:71:41: error:
	unsigned conversion from 'int' to 'unsigned char'
	changes value from '256' to '0'

In the 6PACK protocol, tx timeout is specified in units of 10 ms
and transmitted over the wire. Defining a value dependent on HZ
doesn't really make sense. Assume that the intent was to set tx
timeout and slot time based on a HZ value of 100 and use constants
instead of values depending on HZ for SIXP_TXDELAY and SIXP_SLOTTIME.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
---
No idea if this is correct or even makes sense. Compile tested only.

 drivers/net/hamradio/6pack.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/hamradio/6pack.c b/drivers/net/hamradio/6pack.c
index 8fe8887d506a..6192244b304a 100644
--- a/drivers/net/hamradio/6pack.c
+++ b/drivers/net/hamradio/6pack.c
@@ -68,9 +68,9 @@
 #define SIXP_DAMA_OFF		0
 
 /* default level 2 parameters */
-#define SIXP_TXDELAY			(HZ/4)	/* in 1 s */
+#define SIXP_TXDELAY			25	/* 250 ms */
 #define SIXP_PERSIST			50	/* in 256ths */
-#define SIXP_SLOTTIME			(HZ/10)	/* in 1 s */
+#define SIXP_SLOTTIME			10	/* 100 ms */
 #define SIXP_INIT_RESYNC_TIMEOUT	(3*HZ/2) /* in 1 s */
 #define SIXP_RESYNC_TIMEOUT		5*HZ	/* in 1 s */
 
-- 
2.33.0


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2021-09-09 16:44 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-09  3:57 [PATCH] net: 6pack: Fix tx timeout and slot time Guenter Roeck
2021-09-09 11:34 ` David Miller
2021-09-09 14:53   ` Guenter Roeck
2021-09-09 15:27     ` David Miller
2021-09-09 16:44       ` Guenter Roeck

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).