Skip to contentSkip to conversation

Configuring Synchronous Interfaces in Linux

RFC-2 Stuart Lynne 6 participants 10 messages Dec 5, 2000 – Mar 19, 2001

lore
Share & tools
lore
#0 lore raw
Quoted 7 lines

I have a vested interest in how this all turns out. I own a Packet Over SONET device driver for our OC-12 and OC-48 NICs that I currently pass all parameters to the driver via arguments on the insmod. To avoid lengthy commands, we provide the common defaults. We accept some basic ifconfig input, but with SONET/SDH and chip specific items that needed to be controlled, ifconfig did not seem the way to go.

Ditto, we have an adsl driver that we setup by overloading various otherwise unused options in ifconfig (mem_start, io_addr etc) to do this. Cheaper and faster than writing yet another ioctl using device configuration agent, but distasteful non the less.

Some generic way to pass configuration data using a generic configuration agent to network (and other) drivers would be interesting.

Quoted 5 lines
Quoted 5 lines
Quoted 3 lines

I'm willing to go for this implementation, but I wanted to know first:
- whether ifconfig is the right place to do it;
- where I should create the new ioctl's to handle these new parameters.

I think a new ioctl would be sensible. There is a lot to go in it.

Signature · 8 lines
                                            __O 
Fireplug - a Lineo company                _-\<,_ 
PGP Fingerprint: 28 E2 A0 15 99 62 9A 00 (_)/ (_) 88 EC A3 EE 2D 1C 15 68
Stuart Lynne <[email protected]>         www.lineo.com         604-461-7532
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
Please read the FAQ at http://www.tux.org/lkml/
#1 lore raw
Quoted 4 lines

Ditto, we have an adsl driver that we setup by overloading various otherwise unused options in ifconfig (mem_start, io_addr etc) to do this. Cheaper and faster than writing yet another ioctl using device configuration agent, but distasteful non the less.

Generic is not always good , thats why we have SIOCDEVPRIVATE. One thing Im pondering is if we should make the hardware config ioctl take a hardware type ident with each struct. That would help make all the ethernet agree, all the wan agree, all the ADSL agree without making a nasty mess.

Quoted 1 line

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected]
Please read the FAQ at http://www.tux.org/lkml/

#2 lore raw
Quoted 8 lines · Alan Cox
Quoted 4 lines

Ditto, we have an adsl driver that we setup by overloading various otherwise unused options in ifconfig (mem_start, io_addr etc) to do this. Cheaper and faster than writing yet another ioctl using device configuration agent, but distasteful non the less.

Generic is not always good , thats why we have SIOCDEVPRIVATE. One thing Im pondering is if we should make the hardware config ioctl take a hardware type ident with each struct. That would help make all the ethernet agree, all the wan agree, all the ADSL agree without making a nasty mess.

Id be up for that, but its hard to standardize on IOCTLs without people publishing their drivers, as long as people hide their code we dont know what everyone else is doing config interface wise...

Lets see the code, people...

-Dan

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected]
Please read the FAQ at http://www.tux.org/lkml/

#3 lore raw
In reply to Alan Cox
Quoted 10 lines · Dan Hollis
Quoted 8 lines · Alan Cox
Quoted 4 lines

Ditto, we have an adsl driver that we setup by overloading various otherwise unused options in ifconfig (mem_start, io_addr etc) to do this. Cheaper and faster than writing yet another ioctl using device configuration agent, but distasteful non the less.

Generic is not always good , thats why we have SIOCDEVPRIVATE. One thing Im pondering is if we should make the hardware config ioctl take a hardware type ident with each struct. That would help make all the ethernet agree, all the wan agree, all the ADSL agree without making a nasty mess.

Quoted 5 lines

Id be up for that, but its hard to standardize on IOCTLs without people publishing their drivers, as long as people hide their code we dont know what everyone else is doing config interface wise...

Lets see the code, people...

We are trying to get permission from the customer to release it.

Signature · 8 lines
                                            __O 
Fireplug - a Lineo company                _-\<,_ 
PGP Fingerprint: 28 E2 A0 15 99 62 9A 00 (_)/ (_) 88 EC A3 EE 2D 1C 15 68
Stuart Lynne <[email protected]>         www.lineo.com         604-461-7532
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
Please read the FAQ at http://www.tux.org/lkml/
#4 lore raw
In reply to Alan Cox
Quoted 4 lines · Alan Cox

Generic is not always good , thats why we have SIOCDEVPRIVATE. One thing Im pondering is if we should make the hardware config ioctl take a hardware type ident with each struct. That would help make all the ethernet agree, all the wan agree, all the ADSL agree without making a nasty mess.

What's wrong with returning -Exxx error code when the user requests unsupported interface or function?

I think we should just #define possible values in standard include file and make ifconfig/ip use it. We can add additional media types as required.

2.5 task IMHO.

I think we need few ioctl calls: get + set media (int argument), get + set speed (probably two - RX and TX), etc.
In my 2.4 HDLC stuff - to be published :-( - there something like that (in private ioctl range, of course).

Signature · 6 lines
Krzysztof Halasa
Network Administrator
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
Please read the FAQ at http://www.tux.org/lkml/
#5 lore raw
Quoted 4 lines

I think we need few ioctl calls: get + set media (int argument), get + set speed (probably two - RX and TX), etc.
In my 2.4 HDLC stuff - to be published :-( - there something like that (in private ioctl range, of course).

I think we are agreeing

I'm saying use something like

	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;
	}

Alan

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected]
Please read the FAQ at http://www.tux.org/lkml/

#6 lore raw
Quoted 10 lines · Alan Cox
Quoted 5 lines

I think we need few ioctl calls: get + set media (int argument), get + set speed (probably two - RX and TX), etc.
In my 2.4 HDLC stuff - to be published :-( - there something like that (in private ioctl range, of course).

I think we are agreeing

I'm saying use something like

Quoted 10 lines
        struct
        {
                u16 media_group;
                union
                {
                        struct hdlc_physical ...
                        struct hdlc_bitstream
                        struct hdlc_protocol
                        struct fr_protocol
                        struct eth_physical

Not yet another one for eth... We now have ethtool for this. And a generic netdevice::set_config wrapper can be created that simply calls the ethtool ioctl with the proper info and locking.

Jeff

Signature · 7 lines
Jeff Garzik         |
Building 1024       | These are not the J's you're lookin' for.
MandrakeSoft        | It's an old Jedi mind trick.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
Please read the FAQ at http://www.tux.org/lkml/
#7 lore raw
Quoted 7 lines
Quoted 3 lines

struct hdlc_protocol
struct fr_protocol
struct eth_physical

Not yet another one for eth... We now have ethtool for this. And a generic netdevice::set_config wrapper can be created that simply calls the ethtool ioctl with the proper info and locking.

There I disagree. I would do it the other way up. Post 2.4 you make the ethtool ioctl simply build an eth_physical and run in that way. Right now the ethtool stuff is a bit hackish and cannot handle upcoming real world situations such as setting the cryptokey for onboard crypto on ethernet cards, or handling devices that present themselves as ethernet but are not at the physical layer being remotely honest about it.

Alan

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected]
Please read the FAQ at http://www.tux.org/lkml/

#8 lore raw

parport0 problem

I can't print and I found this in the logs:

Dec  9 16:10:49 ozob kernel: parport0: Nibble timeout at event 9 (0 bytes) 
Dec  9 16:11:29 ozob last message repeated 4 times
Dec  9 16:12:39 ozob last message repeated 7 times
Dec  9 16:13:40 ozob last message repeated 6 times

If I reboot, then I can print for a while and then this repeats.

Can anyone tell me what this means and what to do about it?

kernel: 2.4.0-test12-pre7 (same problem with pre3)
cpu: intel 686
printer: hp4500
kernel setup:
CONFIG_PARPORT=y
CONFIG_PARPORT_PC=y CONFIG_PARPORT_PC_FIFO=y CONFIG_PARPORT_PC_SUPERIO=y
# CONFIG_PARPORT_AMIGA is not set
# CONFIG_PARPORT_MFC3 is not set
# CONFIG_PARPORT_ATARI is not set
# CONFIG_PARPORT_SUNBPP is not set
# CONFIG_PARPORT_OTHER is not set CONFIG_PARPORT_1284=y

CONFIG_PRINTER=y

I can supply any information necessary.

Thanks,

::::: Gene Imes http://www.ozob.net :::::

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected]
Please read the FAQ at http://www.tux.org/lkml/

#9 lore raw
In reply to Alan Cox
Quoted 16 lines · Alan Cox

I think we are agreeing

I'm saying use something like

	struct 
	{
		u16 media_group;
		union
		{
			struct hdlc_physical ...
			struct hdlc_bitstream
			struct hdlc_protocol
			struct fr_protocol
			struct eth_physical
			struct atm_physical
Quoted 8 lines
			struct dsl_physical
			struct dsl_bitstream
			struct tr_physical
			struct wireless_physical
			struct wireless_80211
			struct wireless_auth
		} config;
	}

I think union like this is fine.

We currently have:
ioctl(sock, COMMAND, ifreq*)

where ifreq is defined in include/linux/if.h and is 16 bytes long:

struct ifreq {
        {
                char    ifrn_name[IFNAMSIZ];    /* if name, e.g. "en0" */
        } ifr_ifrn;

        union {
                struct  sockaddr ifru_addr;
                struct  sockaddr ifru_dstaddr;
                struct  sockaddr ifru_broadaddr;
                struct  sockaddr ifru_netmask;
                struct  sockaddr ifru_hwaddr;
                short   ifru_flags;
                int     ifru_ivalue;
                int     ifru_mtu;
                struct  ifmap ifru_map;
                char    ifru_slave[IFNAMSIZ];   /* Just fits the size */
                char    ifru_newname[IFNAMSIZ];
                char *  ifru_data;
        }

I understand we can put a config structure address in ifru_data - but do we really need another level?
Wouldn't it be better put config structs there (in the union)?

It would then read:

struct ifreq {
        {
                char    ifrn_name[IFNAMSIZ];    /* if name, e.g. "en0" */
        } ifr_ifrn;

        union {
                struct  sockaddr ifru_addr;
                struct  sockaddr ifru_dstaddr;
                struct  sockaddr ifru_broadaddr;
                struct  sockaddr ifru_netmask;
                struct  sockaddr ifru_hwaddr;
                short   ifru_flags;
                int     ifru_ivalue;
                int     ifru_mtu;
                struct  ifmap ifru_map;
                char    ifru_slave[IFNAMSIZ];   /* Just fits the size */
                char    ifru_newname[IFNAMSIZ];
                char *  ifru_data;
		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
        }

while I'd put "media_group" in ioctl command code:
#define SIOCSHDLC_PHY ...
#define SIOCGHDLC_PHY ... /* get */ #define SIOCSFR ...
#define SIOCSETH_PHY ...
#define SIOCSATM...

A possible problem is if the struct gets longer - we would have to recompile all utils using it. Doing that before distributions start using 2.4 as a kernel for general use would save us (we can use pointers in such cases as well, as some operations - downloading firmware or crypto keys - may have very long data areas).

What do you think about it?

Signature · 2 lines
Krzysztof Halasa
Network Administrator