lib8390.c (e7fee115bf2cc418cc607a01bb62678eb8c720e9) lib8390.c (2b2706aaaefee49ba0030bc679865db178e89e11)
1/* 8390.c: A general NS8390 ethernet driver core for linux. */
2/*
3 Written 1992-94 by Donald Becker.
4
5 Copyright 1993 United States Government as represented by the
6 Director, National Security Agency.
7
8 This software may be used and distributed according to the terms

--- 36 unchanged lines hidden (view full) ---

45 Hayato Fujiwara : Add m32r support.
46 Paul Gortmaker : use skb_padto() instead of stack scratch area
47
48 Sources:
49 The National Semiconductor LAN Databook, and the 3Com 3c503 databook.
50
51 */
52
1/* 8390.c: A general NS8390 ethernet driver core for linux. */
2/*
3 Written 1992-94 by Donald Becker.
4
5 Copyright 1993 United States Government as represented by the
6 Director, National Security Agency.
7
8 This software may be used and distributed according to the terms

--- 36 unchanged lines hidden (view full) ---

45 Hayato Fujiwara : Add m32r support.
46 Paul Gortmaker : use skb_padto() instead of stack scratch area
47
48 Sources:
49 The National Semiconductor LAN Databook, and the 3Com 3c503 databook.
50
51 */
52
53#include <linux/build_bug.h>
53#include <linux/module.h>
54#include <linux/kernel.h>
55#include <linux/jiffies.h>
56#include <linux/fs.h>
57#include <linux/types.h>
58#include <linux/string.h>
59#include <linux/bitops.h>
60#include <linux/uaccess.h>

--- 952 unchanged lines hidden (view full) ---

1013{
1014 unsigned long e8390_base = dev->base_addr;
1015 struct ei_device *ei_local = netdev_priv(dev);
1016 int i;
1017 int endcfg = ei_local->word16
1018 ? (0x48 | ENDCFG_WTS | (ei_local->bigendian ? ENDCFG_BOS : 0))
1019 : 0x48;
1020
54#include <linux/module.h>
55#include <linux/kernel.h>
56#include <linux/jiffies.h>
57#include <linux/fs.h>
58#include <linux/types.h>
59#include <linux/string.h>
60#include <linux/bitops.h>
61#include <linux/uaccess.h>

--- 952 unchanged lines hidden (view full) ---

1014{
1015 unsigned long e8390_base = dev->base_addr;
1016 struct ei_device *ei_local = netdev_priv(dev);
1017 int i;
1018 int endcfg = ei_local->word16
1019 ? (0x48 | ENDCFG_WTS | (ei_local->bigendian ? ENDCFG_BOS : 0))
1020 : 0x48;
1021
1021 if (sizeof(struct e8390_pkt_hdr) != 4)
1022 panic("8390.c: header struct mispacked\n");
1022 BUILD_BUG_ON(sizeof(struct e8390_pkt_hdr) != 4);
1023 /* Follow National Semi's recommendations for initing the DP83902. */
1024 ei_outb_p(E8390_NODMA+E8390_PAGE0+E8390_STOP, e8390_base+E8390_CMD); /* 0x21 */
1025 ei_outb_p(endcfg, e8390_base + EN0_DCFG); /* 0x48 or 0x49 */
1026 /* Clear the remote byte count registers. */
1027 ei_outb_p(0x00, e8390_base + EN0_RCNTLO);
1028 ei_outb_p(0x00, e8390_base + EN0_RCNTHI);
1029 /* Set to monitor and loopback mode -- this is vital!. */
1030 ei_outb_p(E8390_RXOFF, e8390_base + EN0_RXCR); /* 0x20 */

--- 60 unchanged lines hidden ---
1023 /* Follow National Semi's recommendations for initing the DP83902. */
1024 ei_outb_p(E8390_NODMA+E8390_PAGE0+E8390_STOP, e8390_base+E8390_CMD); /* 0x21 */
1025 ei_outb_p(endcfg, e8390_base + EN0_DCFG); /* 0x48 or 0x49 */
1026 /* Clear the remote byte count registers. */
1027 ei_outb_p(0x00, e8390_base + EN0_RCNTLO);
1028 ei_outb_p(0x00, e8390_base + EN0_RCNTHI);
1029 /* Set to monitor and loopback mode -- this is vital!. */
1030 ei_outb_p(E8390_RXOFF, e8390_base + EN0_RXCR); /* 0x20 */

--- 60 unchanged lines hidden ---