patch-2.0.24 linux/drivers/net/net_init.c
Next file: linux/drivers/net/ni65.c
Previous file: linux/drivers/net/defxx.h
Back to the patch index
Back to the overall index
- Lines: 85
- Date:
Wed Oct 30 03:42:40 1996
- Orig file:
v2.0.23/linux/drivers/net/net_init.c
- Orig date:
Sat Jun 29 12:00:46 1996
diff -u --recursive --new-file v2.0.23/linux/drivers/net/net_init.c linux/drivers/net/net_init.c
@@ -21,7 +21,12 @@
Changed 29/10/95, Alan Cox to pass sockaddr's around for mac addresses.
- 14/06/96 - Paul Gortmaker: Add generic eth_change_mtu() function.
+ 14/06/96 - Paul Gortmaker: Add generic eth_change_mtu() function.
+
+ August 12, 1996 - Lawrence V. Stefani: Added fddi_change_mtu() and
+ fddi_setup() functions.
+ Sept. 10, 1996 - Lawrence V. Stefani: Increased hard_header_len to
+ include 3 pad bytes.
*/
#include <linux/config.h>
@@ -34,6 +39,7 @@
#include <linux/string.h>
#include <linux/netdevice.h>
#include <linux/etherdevice.h>
+#include <linux/fddidevice.h>
#include <linux/trdevice.h>
#include <linux/if_arp.h>
#ifdef CONFIG_NET_ALIAS
@@ -154,6 +160,18 @@
return 0;
}
+#ifdef CONFIG_FDDI
+
+static int fddi_change_mtu(struct device *dev, int new_mtu)
+ {
+ if ((new_mtu < FDDI_K_SNAP_HLEN) || (new_mtu > FDDI_K_SNAP_DLEN))
+ return(-EINVAL);
+ dev->mtu = new_mtu;
+ return(0);
+ }
+
+#endif
+
void ether_setup(struct device *dev)
{
int i;
@@ -228,6 +246,43 @@
dev->pa_mask = 0;
dev->pa_alen = 4;
}
+
+#endif
+
+#ifdef CONFIG_FDDI
+
+void fddi_setup(struct device *dev)
+ {
+ int i;
+
+ /*
+ * Fill in the fields of the device structure with FDDI-generic values.
+ * This should be in a common file instead of per-driver.
+ */
+ for (i=0; i < DEV_NUMBUFFS; i++)
+ skb_queue_head_init(&dev->buffs[i]);
+
+ dev->change_mtu = fddi_change_mtu;
+ dev->hard_header = fddi_header;
+ dev->rebuild_header = fddi_rebuild_header;
+
+ dev->type = ARPHRD_FDDI;
+ dev->hard_header_len = FDDI_K_SNAP_HLEN+3; /* Assume 802.2 SNAP hdr len + 3 pad bytes */
+ dev->mtu = FDDI_K_SNAP_DLEN; /* Assume max payload of 802.2 SNAP frame */
+ dev->addr_len = FDDI_K_ALEN;
+ dev->tx_queue_len = 100; /* Long queues on FDDI */
+
+ memset(dev->broadcast, 0xFF, FDDI_K_ALEN);
+
+ /* New-style flags */
+ dev->flags = IFF_BROADCAST | IFF_MULTICAST;
+ dev->family = AF_INET;
+ dev->pa_addr = 0;
+ dev->pa_brdaddr = 0;
+ dev->pa_mask = 0;
+ dev->pa_alen = 4;
+ return;
+ }
#endif
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov