10 #include <linux/netdevice.h>
15 #define HDLCDRV_MAGIC 0x5ac6e778
16 #define HDLCDRV_HDLCBUFFER 32
17 #define HDLCDRV_BITBUFFER 256
18 #undef HDLCDRV_LOOPBACK
22 #define HDLCDRV_MAXFLEN 400
59 buf->
buffer[buf->
wr] = (bits >> 8) & 0xff;
164 spin_unlock_irqrestore(&hb->
lock, flags);
176 ret = (hb->
rd == hb->
wr);
177 spin_unlock_irqrestore(&hb->
lock, flags);
190 if (hb->
rd == hb->
wr)
194 val = hb->
buf[hb->
rd];
197 spin_unlock_irqrestore(&hb->
lock, flags);
211 if (newp != hb->
rd) {
212 hb->
buf[hb->
wr] = val & 0xffff;
215 spin_unlock_irqrestore(&hb->
lock, flags);
220 static inline void hdlcdrv_putbits(
struct hdlcdrv_state *
s,
unsigned int bits)
222 hdlcdrv_hbuf_put(&s->
hdlcrx.hbuf, bits);
225 static inline unsigned int hdlcdrv_getbits(
struct hdlcdrv_state *
s)
229 if (hdlcdrv_hbuf_empty(&s->
hdlctx.hbuf)) {
230 if (s->
hdlctx.calibrate > 0)
236 ret = hdlcdrv_hbuf_get(&s->
hdlctx.hbuf);
237 #ifdef HDLCDRV_LOOPBACK
238 hdlcdrv_hbuf_put(&s->
hdlcrx.hbuf, ret);
243 static inline void hdlcdrv_channelbit(
struct hdlcdrv_state *s,
unsigned int bit)
250 static inline void hdlcdrv_setdcd(
struct hdlcdrv_state *s,
int dcd)
266 unsigned int privsize,
const char *ifname,
267 unsigned int baseaddr,
unsigned int irq,