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. - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
- References:
- [PATCH 0/9] isdn4linux: add drivers for Siemens Gigaset ISDN DECT PABX
- From: Hansjoerg Lipp <[email protected]>
- [PATCH 1/9] isdn4linux: Siemens Gigaset drivers - Kconfigs and Makefiles
- From: Hansjoerg Lipp <[email protected]>
- [PATCH 2/9] isdn4linux: Siemens Gigaset drivers - common module
- From: Hansjoerg Lipp <[email protected]>
- [PATCH 3/9] isdn4linux: Siemens Gigaset drivers - event layer
- From: Hansjoerg Lipp <[email protected]>
- [PATCH 4/9] isdn4linux: Siemens Gigaset drivers - isdn4linux interface
- From: Hansjoerg Lipp <[email protected]>
- [PATCH 5/9] isdn4linux: Siemens Gigaset drivers - tty interface
- From: Hansjoerg Lipp <[email protected]>
- [PATCH 6/9] isdn4linux: Siemens Gigaset drivers - procfs interface
- From: Hansjoerg Lipp <[email protected]>
- Re: [PATCH 6/9] isdn4linux: Siemens Gigaset drivers - procfs interface
- From: Andrew Morton <[email protected]>
- Re: [PATCH 6/9] isdn4linux: Siemens Gigaset drivers - procfs interface
- From: Tilman Schmidt <[email protected]>
- [PATCH 0/9] isdn4linux: add drivers for Siemens Gigaset ISDN DECT PABX
- Prev by Date: Re: [PATCH 1/9] isdn4linux: Siemens Gigaset drivers - Kconfigs and Makefiles
- Next by Date: Re: Trap flag handling change in 2.6.10-bk5 broke Kylix debugger
- Previous by thread: Re: [PATCH 6/9] isdn4linux: Siemens Gigaset drivers - procfs interface
- Next by thread: Re: [PATCH 6/9] isdn4linux: Siemens Gigaset drivers - procfs interface
- Index(es):