lkml.org 
[lkml]   [2006]   [Feb]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 6/9] isdn4linux: Siemens Gigaset drivers - procfs interface
Tilman Schmidt <tilman@imap.cc> wrote:
>
> > - You did the ringbuffer the wrong way. Don't constrain the head and
> > tail to be within 0..MAX_EVENTS. Instead, just let them wrap right up to
> > 0xffffffff. Apply the masking when you actually _use_ them.
> >
> > That way, empty is (head == tail) and full is (tail - head == MAX_EVENTS).
>
> Interesting idea. I have to admit it's rather new to me. I have always
> done ringbuffers the way they are done in the Gigaset driver now. Can
> you point me to some example code done the way you propose, so I can
> familiarize myself with its advantages?

Pretty much all the Becker-derived net drivers do this - Say,
vortex_private.cur_tx, .cur_tx. Also include/linux/circ_buf.h and its
various users.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2006-02-15 04:26    [W:0.044 / U:1.864 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site