From: Krzysztof Halasa <khc@intrepid.pm.waw.pl>
To: <linux-kernel@vger.kernel.org>
Cc: Francois Romieu <romieu@cogenit.fr>
Subject: Re: RFC: configuring net interfaces
Date: 03 Apr 2001 15:07:01 +0200 [thread overview]
Message-ID: <m3g0fq9loq.fsf@intrepid.pm.waw.pl> (raw)
In-Reply-To: <Pine.LNX.3.96.1010401165413.28121X-100000@mandrakesoft.mandrakesoft.com> <m31yrbce2m.fsf@intrepid.pm.waw.pl> <20010403102734.A27344@se1.cogenit.fr>
In-Reply-To: Francois Romieu's message of "Tue, 3 Apr 2001 10:27:34 +0200"
Francois Romieu <romieu@cogenit.fr> writes:
> > I think we should separate two things there:
> > - the place (files) where SIOCxxx values are defined
> > - the way we use ioctl call.
>
> (1) and (2) may be related:
> no sub-ioctl (2) + scattered files (1) = *ouch*
Sure.
> Variant:
> struct sub_req sub;
>
> sub.fr_protocol.t391 = 20;
> sub.fr_protocol.n293 = 5;
> sub.sub_ioctl = SIOC_SET_FR_PROTO_PARAMETERS;
> ifreq.name = "qwe0";
> ifreq.data = ⊂
> ioctl(s, SIOC_FR_PROTO, &ifreq);
Yes, it's a little nicer than my second variant. But it's still more
complicated than the first one and I'm not sure if doing that is worth it
> struc sub_req {
> int sub_ioctl;
... as we lose 4 bytes here (currently the union of structs in ifreq
is limited to 16 bytes)
> union {
> struct fr_protocol fr_prot;
> ...
> struct xx_protocol xx_prot;
> }
> }
What might be actually better than my first variant, is a variable-length
data:
struct ifreq {
char name[16];
union {
...
struct {
int sub_command;
int data_length;
void *data;
}
}ifru;
}
... while "data" would be fr_protocol, eth_physical etc.
It's (of course) more complicated, but there is a gain:
- we can have different size requests (from 0 bytes to, say, 100KB)
- we split SIOC namespace into domains
- the core ioctl handler can still "verify" data area for the underlying
driver
--
Krzysztof Halasa
Network Administrator
next prev parent reply other threads:[~2001-04-03 19:42 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <m3itkuq6xt.fsf@intrepid.pm.waw.pl>
2001-03-28 21:24 ` Ivan Passos
2001-03-29 0:11 ` Jeff Garzik
2001-03-28 21:53 ` Ivan Passos
2001-03-29 11:29 ` Krzysztof Halasa
2001-03-30 5:43 ` Jeff Garzik
2001-03-31 22:41 ` Krzysztof Halasa
2001-04-01 22:18 ` Jeff Garzik
2001-04-02 19:10 ` Krzysztof Halasa
2001-04-03 8:27 ` Francois Romieu
2001-04-03 13:07 ` Krzysztof Halasa [this message]
2001-04-04 8:18 ` Francois Romieu
2001-03-29 11:24 ` Krzysztof Halasa
[not found] ` <20010328182729.A16067@se1.cogenit.fr>
2001-03-28 23:03 ` Krzysztof Halasa
2001-03-29 0:13 ` Paul Fulghum
2001-03-29 10:34 ` Krzysztof Halasa
2001-03-29 9:25 ` Francois Romieu
2001-03-29 11:07 ` Krzysztof Halasa
2001-03-29 14:55 ` Paul Fulghum
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=m3g0fq9loq.fsf@intrepid.pm.waw.pl \
--to=khc@intrepid.pm.waw.pl \
--cc=linux-kernel@vger.kernel.org \
--cc=romieu@cogenit.fr \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®