| To: | jt@xxxxxxxxxx |
|---|---|
| Subject: | Re: [RFC] Wireless extensions rethink |
| From: | Jeff Garzik <jgarzik@xxxxxxxxx> |
| Date: | Wed, 16 Jun 2004 19:06:13 -0400 |
| Cc: | Gertjan van Wingerde <gwingerde@xxxxxxx>, sfeldma@xxxxxxxxx, netdev@xxxxxxxxxxx, jkmaline@xxxxxxxxx |
| In-reply-to: | <20040616223316.GA29618@bougret.hpl.hp.com> |
| References: | <C6F5CF431189FA4CBAEC9E7DD5441E0103AF626C@orsmsx402.amr.corp.intel.com> <40CF263E.70009@home.nl> <1087377197.25912.54.camel@sfeldma-mobl2.dsl-verizon.net> <40D08769.3070106@home.nl> <20040616204248.GA23617@bougret.hpl.hp.com> <40D0BD5B.201@pobox.com> <20040616223316.GA29618@bougret.hpl.hp.com> |
| Sender: | netdev-bounce@xxxxxxxxxxx |
| User-agent: | Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6) Gecko/20040510 |
Jean Tourrilhes wrote:
That doesn't help anything. Wrappers add code, while not solving the following problems... You want to expose a _specific_, fine-grained API to the driver. That is by definition the smallest interface one can design for the low-level driver. Anything else requires "additional work" -- from simple type-casting to real code. The three major problems of the current WE iw_handler interface specifically are, 1) uses array, rather than a structure of function pointers. This makes assignment of values _very_ easy to screw up. 2) type-opaque interfaces break C compiler pointer analysis. This prevents alias optimization from working well, and also breaks checkers like the Stanford checker and sparse. C gave the world a type system, we should use it. :) 3) Uses and stores offsets to driver-private structures in generic code (iw_handler_def). See #2 for pointer chasing/aliasing problems related to doing stuff like this. Further, this is a massive layer / object lifetime violation. The generic/core code should never need to know about a structure declared in a low-level driver. That's backwards from the way information should flow. It's not Jeff's weird personal preference that iw_handler be killed... type-opaque interfaces cause real problems. A good C programmer should very, very rarely use type-casting. Jeff |
| Previous by Date: | Re: [RFC] Wireless extensions rethink, Scott Feldman |
|---|---|
| Next by Date: | Re: IPsec and Path MTU, Herbert Xu |
| Previous by Thread: | Re: [RFC] Wireless extensions rethink, Jean Tourrilhes |
| Next by Thread: | Re: [RFC] Wireless extensions rethink, Jean Tourrilhes |
| Indexes: | [Date] [Thread] [Top] [All Lists] |