What about a patch like this:
That would move interface configuration out of private ioctl range,
making it universal for all types of interfaces (now, we have different
configuration mechanisms even between different HDLC cards).
Of course, *_protocol and *_physical struct for other type of interfaces
would be added here. If a data portion is longer than 16 bytes
(say, encryption table or firmware image), a pointer to the data
and data length would be passed.
Please don't apply this patch yet - it's just a RFC :-)
--- linux-2.4.orig/include/linux/if.h Wed Mar 28 12:42:17 2001
+++ linux-2.4/include/linux/if.h Wed Mar 28 16:31:59 2001
@@ -66,6 +66,32 @@
/* 3 bytes spare */
};
+
+struct hdlc_physical /* 10 bytes */
+{
+ unsigned int interface;
+ unsigned int clock_rate;
+ unsigned short clock_type;
+};
+
+
+struct hdlc_protocol /* 4 bytes */
+{
+ unsigned int proto;
+};
+
+
+struct fr_protocol /* 12 bytes */
+{
+ unsigned short lmi_type;
+ unsigned short t391;
+ unsigned short t392;
+ unsigned short n391;
+ unsigned short n392;
+ unsigned short n393;
+};
+
+
/*
* Interface request structure used for socket
* ioctl's. All interface ioctl's must have parameter
@@ -95,6 +121,9 @@
char ifru_slave[IFNAMSIZ]; /* Just fits the size */
char ifru_newname[IFNAMSIZ];
char * ifru_data;
+ struct hdlc_physical hdlc_phy;
+ struct hdlc_protocol hdlc_proto;
+ struct fr_protocol fr_proto;
} ifr_ifru;
};
--- linux-2.4.orig/include/linux/sockios.h Sun Nov 12 04:02:40 2000
+++ linux-2.4/include/linux/sockios.h Wed Mar 28 16:35:23 2001
@@ -76,6 +76,12 @@
#define SIOCSIFDIVERT 0x8945 /* Set frame diversion options */
#define SIOCETHTOOL 0x8946 /* Ethtool interface */
+#define SIOCSHDLC_PHY 0x8947 /* set physical HDLC iface */
+#define SIOCGHDLC_PHY 0x8948 /* get physical HDLC iface */
+#define SIOCSHDLC_PROTO 0x8949 /* set HDLC protocol */
+#define SIOCGHDLC_PROTO 0x894A /* get HDLC protocol */
+#define SIOCSFR_PROTO 0x894B /* set Frame-Relay protocol */
+#define SIOCGFR_PROTO 0x894C /* get Frame-Relay protocol */
/* ARP cache control calls. */
/* 0x8950 - 0x8952 * obsolete calls, don't re-use */
-- Krzysztof Halasa Network Administrator - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/