Skip to content

Commit 3c0d2a4

Browse files
groecktorvalds
authored andcommitted
net: 6pack: Fix tx timeout and slot time
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: https://www.linux-ax25.org/wiki/6PACK Defining a value dependent on HZ doesn't really make sense, and presumably comes from the (very historical) situation where HZ was originally 100. Note that the SIXP_SLOTTIME use explicitly is about 10ms granularity: mod_timer(&sp->tx_t, jiffies + ((when + 1) * HZ) / 100); and the SIXP_TXDELAY walue is sent as a byte over the wire. Signed-off-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent 040b890 commit 3c0d2a4

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/net/hamradio/6pack.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,9 @@
6868
#define SIXP_DAMA_OFF 0
6969

7070
/* default level 2 parameters */
71-
#define SIXP_TXDELAY (HZ/4) /* in 1 s */
71+
#define SIXP_TXDELAY 25 /* 250 ms */
7272
#define SIXP_PERSIST 50 /* in 256ths */
73-
#define SIXP_SLOTTIME (HZ/10) /* in 1 s */
73+
#define SIXP_SLOTTIME 10 /* 100 ms */
7474
#define SIXP_INIT_RESYNC_TIMEOUT (3*HZ/2) /* in 1 s */
7575
#define SIXP_RESYNC_TIMEOUT 5*HZ /* in 1 s */
7676

0 commit comments

Comments
 (0)