Return to BSD News archive
Xref: sserve comp.os.386bsd.misc:3060 comp.os.linux.misc:21216 Path: sserve!newshost.anu.edu.au!harbinger.cc.monash.edu.au!msuinfo!agate!howland.reston.ans.net!gatech!newsxfer.itd.umich.edu!newsrelay.iastate.edu!news.iastate.edu!ponderous.cc.iastate.edu!michaelv From: michaelv@iastate.edu (Michael L. VanLoon) Newsgroups: comp.os.386bsd.misc,comp.os.linux.misc Subject: Re: source of TCP/IP (was I hope this wont ignite a major flame ...) Date: 6 Aug 94 05:19:07 GMT Organization: Iowa State University, Ames, Iowa Lines: 57 Message-ID: <michaelv.776150347@ponderous.cc.iastate.edu> References: <31od8d$15l@fw.novatel.ca> <31pc9l$ctp@oscar.agcs.com> <deeken.775988151@iti.informatik.th-darmstadt.de> <31ukgh$eao@oscar.agcs.com> NNTP-Posting-Host: ponderous.cc.iastate.edu In <31ukgh$eao@oscar.agcs.com> robertsw@agcs.com (Wallace Roberts) writes: >deeken@iti.informatik.th-darmstadt.de (Hannes Deeken) writes: >>Sure, you can figure out what these number means, if you have >>the manuals. >isn't that what i wrote? "you are expected to have the h/w manuals >handy." Why do you assume a hardware manual should be necessary to maintain already functioning code? If I had to look up everything all the time, it would make me very unproductive. How do you tell if the magic numbers are linux-specific or hardware-specific? And, if they're not hardware-specific, then I shouldn't need a hardware manual to figure that out. >the numbers used in masking usually are cumulative, i.e., each bit has a >meaning. do you expect the guy writing the driver to spell out each bit >for you, then inclusive or them all together so you won't have to hurt >yourself? Uh, yes. I think that's what he was asking for. Why does that seem so hard? Take a look at the NetBSD hardware register headers some time. It's really not that tough to do, and it sure makes reading (and adding to) the code much easier. Why should I have to keep remembering whether CCRO was 0x22 or 0x23, when I can just use CCR0? >>Ever heard of the '#define' directive available with the C preprocessor? >ever hear of the "death of a thousand #define's?" if you #define each >bit's meaning, then or them all together, things can get unwieldy in a >hurry: >rx_status &= (PWR_BIT | TST_BIT | OH_BIT | HS_BIT | DTR_BIT | RXD_BIT | TXD_BIT | BUTT_BIT); What's so bad about that? How many times are you going to need a line like that? How about a little formatting: rx_status &= ( PWR_BIT | TST_BIT | OH_BIT | HS_BIT | DTR_BIT | RXD_BIT | TXD_BIT | BUTT_BIT ); Don't look so bad to me. >mere mortal. you are not worthy to lick the sweat from my balls. Yet, it sounds like it would be more satisfying than reading your code. ;-) -- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Michael L. VanLoon Iowa State University Computation Center michaelv@iastate.edu Project Vincent Systems Staff Free your mind and your machine -- NetBSD free Un*x for PC/Mac/Amiga/etc. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -