Tilman Schmidt <[EMAIL PROTECTED]> 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. ------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642 _______________________________________________ linux-usb-devel@lists.sourceforge.net To unsubscribe, use the last form field at: https://lists.sourceforge.net/lists/listinfo/linux-usb-devel