aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/hamradio/hdlcdrv.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/hamradio/hdlcdrv.c')
-rw-r--r--drivers/net/hamradio/hdlcdrv.c13
1 files changed, 2 insertions, 11 deletions
diff --git a/drivers/net/hamradio/hdlcdrv.c b/drivers/net/hamradio/hdlcdrv.c
index 452873e7c68f..f5a17ad9d3d6 100644
--- a/drivers/net/hamradio/hdlcdrv.c
+++ b/drivers/net/hamradio/hdlcdrv.c
@@ -56,6 +56,7 @@
56#include <linux/if_arp.h> 56#include <linux/if_arp.h>
57#include <linux/skbuff.h> 57#include <linux/skbuff.h>
58#include <linux/hdlcdrv.h> 58#include <linux/hdlcdrv.h>
59#include <linux/random.h>
59#include <net/ax25.h> 60#include <net/ax25.h>
60#include <asm/uaccess.h> 61#include <asm/uaccess.h>
61 62
@@ -371,16 +372,6 @@ static void start_tx(struct net_device *dev, struct hdlcdrv_state *s)
371 372
372/* ---------------------------------------------------------------------- */ 373/* ---------------------------------------------------------------------- */
373 374
374static unsigned short random_seed;
375
376static inline unsigned short random_num(void)
377{
378 random_seed = 28629 * random_seed + 157;
379 return random_seed;
380}
381
382/* ---------------------------------------------------------------------- */
383
384void hdlcdrv_arbitrate(struct net_device *dev, struct hdlcdrv_state *s) 375void hdlcdrv_arbitrate(struct net_device *dev, struct hdlcdrv_state *s)
385{ 376{
386 if (!s || s->magic != HDLCDRV_MAGIC || s->hdlctx.ptt || !s->skb) 377 if (!s || s->magic != HDLCDRV_MAGIC || s->hdlctx.ptt || !s->skb)
@@ -396,7 +387,7 @@ void hdlcdrv_arbitrate(struct net_device *dev, struct hdlcdrv_state *s)
396 if ((--s->hdlctx.slotcnt) > 0) 387 if ((--s->hdlctx.slotcnt) > 0)
397 return; 388 return;
398 s->hdlctx.slotcnt = s->ch_params.slottime; 389 s->hdlctx.slotcnt = s->ch_params.slottime;
399 if ((random_num() % 256) > s->ch_params.ppersist) 390 if ((random32() % 256) > s->ch_params.ppersist)
400 return; 391 return;
401 start_tx(dev, s); 392 start_tx(dev, s);
402} 393}