aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/hamradio/baycom_epp.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/hamradio/baycom_epp.c')
-rw-r--r--drivers/net/hamradio/baycom_epp.c13
1 files changed, 2 insertions, 11 deletions
diff --git a/drivers/net/hamradio/baycom_epp.c b/drivers/net/hamradio/baycom_epp.c
index 153b6dc80af4..84aa2117c0ee 100644
--- a/drivers/net/hamradio/baycom_epp.c
+++ b/drivers/net/hamradio/baycom_epp.c
@@ -52,6 +52,7 @@
52#include <linux/hdlcdrv.h> 52#include <linux/hdlcdrv.h>
53#include <linux/baycom.h> 53#include <linux/baycom.h>
54#include <linux/jiffies.h> 54#include <linux/jiffies.h>
55#include <linux/random.h>
55#include <net/ax25.h> 56#include <net/ax25.h>
56#include <asm/uaccess.h> 57#include <asm/uaccess.h>
57 58
@@ -433,16 +434,6 @@ static void encode_hdlc(struct baycom_state *bc)
433 434
434/* ---------------------------------------------------------------------- */ 435/* ---------------------------------------------------------------------- */
435 436
436static unsigned short random_seed;
437
438static inline unsigned short random_num(void)
439{
440 random_seed = 28629 * random_seed + 157;
441 return random_seed;
442}
443
444/* ---------------------------------------------------------------------- */
445
446static int transmit(struct baycom_state *bc, int cnt, unsigned char stat) 437static int transmit(struct baycom_state *bc, int cnt, unsigned char stat)
447{ 438{
448 struct parport *pp = bc->pdev->port; 439 struct parport *pp = bc->pdev->port;
@@ -464,7 +455,7 @@ static int transmit(struct baycom_state *bc, int cnt, unsigned char stat)
464 if ((--bc->hdlctx.slotcnt) > 0) 455 if ((--bc->hdlctx.slotcnt) > 0)
465 return 0; 456 return 0;
466 bc->hdlctx.slotcnt = bc->ch_params.slottime; 457 bc->hdlctx.slotcnt = bc->ch_params.slottime;
467 if ((random_num() % 256) > bc->ch_params.ppersist) 458 if ((random32() % 256) > bc->ch_params.ppersist)
468 return 0; 459 return 0;
469 } 460 }
470 } 461 }