mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Krzysztof Halasa <khc@pm.waw.pl>
To: <linux-kernel@vger.kernel.org>
Cc: Jeff Garzik <garzik@havoc.gtf.org>
Subject: Re: SIOCDEVICE ?
Date: 03 Feb 2002 02:44:14 +0100	[thread overview]
Message-ID: <m3it9fmj9t.fsf@defiant.pm.waw.pl> (raw)
In-Reply-To: <200201311304.FAA00344@adam.yggdrasil.com> <20020131181241.A3524@fafner.intra.cogenit.fr> <m3665iqhqn.fsf@defiant.pm.waw.pl> <20020202154424.A5845@fafner.intra.cogenit.fr> <20020202154348.A26147@havoc.gtf.org>
In-Reply-To: <20020202154348.A26147@havoc.gtf.org>

Jeff Garzik <garzik@havoc.gtf.org> writes:

> The correction would perhaps define a real command as needed...

What about details? You want one ioctl = one command again? I'm confused.

> > SIOCDEVICE, yes. That's my attempt to create an ioctl interface for
> > controlling devices. It's defined by the hdlc patch, discussed about
> > a year (?) ago here. Yes, I think I should post a note here.
> 
> This too seems way too generic for including in the kernel.
> 
> 
> What data is passed through the following structure?
> 
> Untyped data has the same problems as I listed for SIOCDEVPRIVATE:
> 
> > struct if_settings
> > {
> >       unsigned int type;      /* Type of physical device or protocol */
> >       unsigned int data_length; /* device/protocol data length */
> >       void * data;            /* pointer to data, ignored if length = 0 */
> > };

It depends on the value of "type", enumerated in include/linux/if.h.
For example, IF_IFACE_V35 uses sync_serial_settings struct, while
IF_PROTO_CISCO uses cisco_proto. The structures are defined in
linux/include/hdlc.h (those related to HDLC protos and sync serial
interfaces of course).

The "data_length" is here for protection - as we have to use structs
of different sizes with different protos etc.


You may think of this as of a union of structs. I don't like real union
as its size would be the size of largest struct (large crypto key
comes to mind).

> It adds undiscussed networking changed which I very much doubt DaveM
> would approve of, and I do not approve of:  SIOCDEVICE is far too
> generic for inclusion, and it adds a structure for passing untyped
> data which is very definitely non-portable.

I don't see any non-portable things here (what is it exactly?).

I don't say this is ideal, the requirement of middle ifreq structure
(required by netdev ioctls) isn't the most elegant.

About discussions: last discussion I remember ended with:

	struct 
	{
		u16 media_group;
		union
		{
			struct hdlc_physical ...
			struct hdlc_bitstream
			struct hdlc_protocol
			struct fr_protocol
			struct eth_physical
			struct atm_physical
			struct dsl_physical
			struct dsl_bitstream
			struct tr_physical
			struct wireless_physical
			struct wireless_80211
			struct wireless_auth
		} config;
	}
(see a thread with message dated 7 Dec 2000 by Alan Cox
(Message-ID <E1441je-0002T3-00@the-village.bc.nu>). I think there was
no serious objections, and the SIOCDEVICE is just that, with the union
replaced by individual structs (to save memory and permit future extensions
without breaking binary compatibility), and the whole thing moved to ifreq
to avoid 3rd level of indirection.


>From my point of view, the following ifreq would be better (sort of):

struct ifreq 
{
        char ifrn_name[IFNAMSIZ];    /* if name, e.g. "en0" */
        unsigned int type;           /* or media_group */
        variable_size_struct defined_by_type;/* not a pointer but real struct*/
};

i.e. something like sockaddr structures. I don't even hope anyone would
accept it.
-- 
Krzysztof Halasa
Network Administrator

      parent reply	other threads:[~2002-02-03  1:46 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-01-31 13:04 linux-2.4.3/drivers/net/wan/dscc4.c does not compile Adam J. Richter
2002-01-31 17:12 ` Francois Romieu
2002-01-31 22:26   ` Krzysztof Halasa
2002-02-02 14:44     ` SIOCDEVICE ? Francois Romieu
2002-02-02 19:14       ` Krzysztof Halasa
2002-02-02 23:57         ` Jeff Garzik
2002-02-02 20:43       ` Jeff Garzik
2002-02-02 22:18         ` Francois Romieu
2002-02-03  0:40           ` Alan Cox
2002-02-03 14:19             ` Francois Romieu
2002-02-03  1:44         ` Krzysztof Halasa [this message]

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=m3it9fmj9t.fsf@defiant.pm.waw.pl \
    --to=khc@pm.waw.pl \
    --cc=garzik@havoc.gtf.org \
    --cc=linux-kernel@vger.kernel.org \
    /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®