public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Krzysztof Halasa <khc@pm.waw.pl>
To: Francois Romieu <romieu@cogenit.fr>
Cc: linux-kernel@vger.kernel.org, davem@redhat.com,
	torvalds@transmeta.com, jgarzik@mandrakesoft.com
Subject: Re: [PATCH] HDLC patch for 2.5.5 (0/3)
Date: 18 Feb 2002 13:09:19 +0100	[thread overview]
Message-ID: <m3zo27outs.fsf@defiant.pm.waw.pl> (raw)
In-Reply-To: <20020217193005.B14629@se1.cogenit.fr>
In-Reply-To: <20020217193005.B14629@se1.cogenit.fr>

Hi,

Francois Romieu <romieu@cogenit.fr> writes:

> [0/3]:

Looks ok for me.

> - SIOCDEVICE -> SIOCWANDEV conversion

But I wonder if that's what we really want. IIRC, the conclusion was
that we need a uniform interface for both LAN and WAN (with the ETHTOOL
being replaced eventually by it). That was why I changed it to "DEVICE"
the first time (for me personally, there is no problem with that).

> [1/3]:
> - struct if_settings in struct ifreq becomes struct if_settings *;
> - anonymous data pointer in struct if_settings is now a pointer to a
>   union of struct containing l2 parameters. These structs can be of
>   arbitrary size. So far, hdlc_settings is the only one available;

These two are IMHO bad :-(
The union would then be as big as the largest struct.
What's worse, the size would change when we add larger struct (i.e.
new protocol), causing binary incompatibility. With my patch, if we
add a new protocol (struct), existing utils would work.

The whole
+struct hdlc_settings {
+	union {
+		raw_hdlc_proto		raw_hdlc;
+		cisco_proto		cisco;
+		fr_proto		fr;
+		fr_proto_pvc		fr_pvc;
+		sync_serial_settings	sync;
+		te1_settings		te1;
+	} hdlcs_hdlcu;
+};
idea is IMHO bad - we need a variable size, separate structures for
separate protocols/interfaces. I think we should avoid a union at all costs.

Creating the new ioctl.h file seem ok to me.


Remember that i.e. sync_serial_settings are not related to any HDLC
protocol - that's just a physical interface which could be used for
things like SDLC, transparent transmissions etc. - or even for async
things (the synchronous interface can work in async mode as well).

> [2/3]:
> - conversion of drivers/net/wan/hdlc_xxx.c files.
> 
> [3/3]:
> - some device are converted (c101.c/dscc4.c/farsync.c/n2.c).

IMHO we could wait with the real code until the interface is stable.

> Remarks:
> - As hdlc_{raw/cisco/fr/x25} doesn't need knowledge of struct ifreq, I would 
> happily pass them a pointer to a struct if_settings. This way the 2 stage 
> ioctl would be clearer imho.

Yes. The previous implementation depends on dev->do_ioctl and the
whole "PRIVATE" ioctls idea. When it's dead, we no longer require the
cmd/ifreq/etc.
-- 
Krzysztof Halasa
Network Administrator

  parent reply	other threads:[~2002-02-18 12:13 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-02-17 18:30 [PATCH] HDLC patch for 2.5.5 (0/3) Francois Romieu
2002-02-17 23:22 ` Jeff Garzik
2002-02-20  1:32   ` Linus Torvalds
2002-02-20 12:15     ` Jeff Garzik
2002-02-21 23:52       ` Krzysztof Halasa
2002-02-22  0:57         ` Jeff Garzik
2002-02-18 12:09 ` Krzysztof Halasa [this message]
2002-02-18 13:34   ` Francois Romieu
2002-02-19 11:02     ` Krzysztof Halasa
2002-02-20 13:39       ` Francois Romieu
2002-02-20 13:51         ` Jeff Garzik
2002-02-20 23:15           ` [PATCH] HDLC patch for 2.5.5 (updated) Francois Romieu

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=m3zo27outs.fsf@defiant.pm.waw.pl \
    --to=khc@pm.waw.pl \
    --cc=davem@redhat.com \
    --cc=jgarzik@mandrakesoft.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=romieu@cogenit.fr \
    --cc=torvalds@transmeta.com \
    /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