]> git.neil.brown.name Git - history.git/commitdiff
Update e100 net driver:
authorScott Feldman <scott.feldman@intel.com>
Sat, 3 Aug 2002 05:38:07 +0000 (01:38 -0400)
committerDavid Mosberger <davidm@tiger.hpl.hp.com>
Sat, 3 Aug 2002 05:38:07 +0000 (01:38 -0400)
Feedback from review by Arjan @ Redhat:
o Cleanup: Removed unneccesary #ifdef/#endif wrappers for features
  already part of kernel.
o Bug fix: Added read-behind-write calls to post writes before delays.
o Cleanup: added "e100" prefix to all driver messages.
o Cleanup: removed unnecessary barrier() call because spin_unlock
  already implies a barrier.
o Cleanup: removed __NO_VERSION__
o Cleanup: fixed some spelling mistakes.
o Cleanup: removed some proprietary /proc entries.

drivers/net/e100/e100.h
drivers/net/e100/e100_config.c
drivers/net/e100/e100_eeprom.c
drivers/net/e100/e100_main.c
drivers/net/e100/e100_phy.c
drivers/net/e100/e100_proc.c
drivers/net/e100/e100_test.c

index a0446258dbc7d24268eb0b160d96ae29d9196b38..ed0dca56575951b93d3e941b8f0b40fb19a71a0b 100644 (file)
@@ -95,10 +95,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 #include <asm/io.h>
 #include <asm/unaligned.h>
 #include <asm/processor.h>
-#ifdef SIOCETHTOOL
 #include <linux/ethtool.h>
 #include <linux/inetdevice.h>
-#endif
 
 #include <linux/if.h>
 #include <asm/uaccess.h>
@@ -782,15 +780,7 @@ typedef struct _tcb_ipcb_t {
        u16 total_tcp_payload;
 } tcb_ipcb_t __attribute__ ((__packed__));
 
-#ifdef MAX_SKB_FRAGS
-#define E100_ZEROCOPY
-#endif
-
-#ifdef E100_ZEROCOPY
 #define E100_TBD_ARRAY_SIZE (2+MAX_SKB_FRAGS)
-#else
-#define E100_TBD_ARRAY_SIZE 2
-#endif /*E100_ZEROCOPY */
 
 /* Transmit Command Block (TCB)*/
 struct _tcb_t {
@@ -811,19 +801,15 @@ struct _tcb_t {
         */
        tbd_t *tbd_ptr;
 
-#ifdef E100_ZEROCOPY
        u32 tcb_tbd_dflt_ptr;   /* TBD address for non-segmented packet */
        u32 tcb_tbd_expand_ptr; /* TBD address for segmented packet */
-#endif                         /*E100_ZEROCOPY */
 
        struct sk_buff *tcb_skb;        /* the associated socket buffer */
        dma_addr_t tcb_phys;    /* phys addr of the TCB */
 } __attribute__ ((__packed__));
 
-#ifndef _TCB_T_
 #define _TCB_T_
 typedef struct _tcb_t tcb_t;
-#endif
 
 /* Receive Frame Descriptor (RFD) - will be using the simple model*/
 struct _rfd_t {
@@ -844,10 +830,8 @@ struct _rfd_t {
 
 } __attribute__ ((__packed__));
 
-#ifndef _RFD_T_
 #define _RFD_T_
 typedef struct _rfd_t rfd_t;
-#endif
 
 /* Receive Buffer Descriptor (RBD)*/
 typedef struct _rbd_t {
@@ -909,14 +893,12 @@ struct cfg_params {
        int PollingMaxWork;
        u32 b_params;
 };
-#ifdef ETHTOOL_TEST 
 struct ethtool_lpbk_data{
         dma_addr_t dma_handle;
         tcb_t *tcb;
         rfd_t *rfd;
 
 };
-#endif
 
 struct e100_private {
        u32 flags;              /* board management flags */
@@ -1012,23 +994,16 @@ struct e100_private {
 
        struct tasklet_struct polling_tasklet;
 
-#ifdef ETHTOOL_GWOL
        /* WOL params for ethtool */
        u32 wolsupported;
        u32 wolopts;
        u16 ip_lbytes;
-#endif
-#ifdef ETHTOOL_TEST 
        struct ethtool_lpbk_data loopback;
-#endif
-#ifdef ETHTOOL_PHYS_ID
        struct timer_list blink_timer;  /* led blink timer id */
-#endif
 
 #ifdef CONFIG_PM
        u32 pci_state[16];
 #endif
-
 };
 
 #define E100_AUTONEG        0
@@ -1056,8 +1031,6 @@ extern void e100_deisolate_driver(struct e100_private *bdp,
 extern unsigned char e100_hw_reset_recover(struct e100_private *bdp,
                                           u32 reset_cmd);
 
-#ifdef ETHTOOL_TEST
-
 #define ROM_TEST_FAIL          0x01
 #define REGISTER_TEST_FAIL     0x02
 #define SELF_TEST_FAIL         0x04
@@ -1073,6 +1046,5 @@ enum test_offsets {
        E100_LPBK_PHY_FAIL,
        E100_MAX_TEST_RES
 };
-#endif
 
 #endif
index cb5d372c1cd7de12628d96f424ea04b428311e68..d90ab621f93b5661072af295bfa0655f450790fe 100644 (file)
@@ -535,7 +535,6 @@ e100_config_long_rx(struct e100_private *bdp, unsigned char enable)
        }
 }
 
-#ifdef ETHTOOL_GWOL
 /**
  * e100_config_wol
  * @bdp: atapter's private data struct
@@ -560,7 +559,6 @@ e100_config_wol(struct e100_private *bdp)
 
        spin_unlock_bh(&(bdp->config_lock));
 }
-#endif
 
 /**
  * e100_config_loopback_mode
@@ -587,7 +585,7 @@ e100_config_loopback_mode(struct e100_private *bdp, u8 mode)
                config_byte = CB_CFIG_LOOPBACK_EXTERNAL;
                break;
        default:
-               printk(KERN_NOTICE "e100_config_loopback_mode: "
+               printk(KERN_NOTICE "e100: e100_config_loopback_mode: "
                       "Invalid argument 'mode': %d\n", mode);
                goto exit;
        }
index 5062699b9d24ab05643ba4a134557b4315f1a91f..58eeeac32d9d26856a303648659851846aa95f16 100644 (file)
@@ -145,8 +145,6 @@ eeprom_set_semaphore(struct e100_private *adapter)
                data |= SCB_GCR2_EEPROM_ACCESS_SEMAPHORE;
                writeb(data, &CSR_GENERAL_CONTROL2_FIELD(adapter));
 
-               barrier();
-
                // Check to see if this bit set or not.
                data = readb(&CSR_GENERAL_CONTROL2_FIELD(adapter));
 
@@ -224,6 +222,7 @@ e100_eeprom_size(struct e100_private *adapter)
                x &= ~EEDI;     // address consists of all zeros
 
                writew(x, &CSR_EEPROM_CONTROL_FIELD(adapter));
+               readw(&(adapter->scb->scb_status));
                udelay(EEPROM_STALL_TIME);
                raise_clock(adapter, &x);
                lower_clock(adapter, &x);
index 4f0c0ae2185658a2620f4c64ad0953fa1da0a35d..8746842f09525fa4a742890a151df048ec98ee26 100644 (file)
@@ -116,9 +116,7 @@ Portions (C) 2002 Red Hat, Inc. under the terms of the GNU GPL v2.
  *
  * 2.0.30       5/30/02
  */
-
-#undef __NO_VERSION__
-
 #include <linux/config.h>
 #include <net/checksum.h>
 #include <linux/tcp.h>
@@ -129,11 +127,7 @@ Portions (C) 2002 Red Hat, Inc. under the terms of the GNU GPL v2.
 #include "e100_phy.h"
 #include "e100_vendor.h"
 
-#ifndef CONFIG_PROC_FS
-#undef E100_CONFIG_PROC_FS
-#endif
-
-#ifdef E100_CONFIG_PROC_FS
+#ifdef CONFIG_PROC_FS
 extern int e100_create_proc_subdir(struct e100_private *);
 extern void e100_remove_proc_subdir(struct e100_private *);
 #else
@@ -141,41 +135,24 @@ extern void e100_remove_proc_subdir(struct e100_private *);
 #define e100_remove_proc_subdir(X) do {} while(0)
 #endif
 
-#ifdef SIOCETHTOOL
-#define E100_ETHTOOL_IOCTL
-#endif
-#ifdef E100_ETHTOOL_IOCTL
 static int e100_do_ethtool_ioctl(struct net_device *, struct ifreq *);
 static void e100_get_speed_duplex_caps(struct e100_private *);
 static int e100_ethtool_get_settings(struct net_device *, struct ifreq *);
 static int e100_ethtool_set_settings(struct net_device *, struct ifreq *);
 
-#ifdef ETHTOOL_GDRVINFO
 static int e100_ethtool_get_drvinfo(struct net_device *, struct ifreq *);
-#endif
-#ifdef ETHTOOL_GEEPROM
 static int e100_ethtool_eeprom(struct net_device *, struct ifreq *);
 
 #define E100_EEPROM_MAGIC 0x1234
-#endif
-#ifdef ETHTOOL_GLINK
 static int e100_ethtool_glink(struct net_device *, struct ifreq *);
-#endif
-#ifdef ETHTOOL_NWAY_RST
 static int e100_ethtool_nway_rst(struct net_device *, struct ifreq *);
-#endif
-#ifdef ETHTOOL_GWOL
 static int e100_ethtool_wol(struct net_device *, struct ifreq *);
 static unsigned char e100_setup_filter(struct e100_private *bdp);
 static void e100_do_wol(struct pci_dev *pcid, struct e100_private *bdp);
 static u16 e100_get_ip_lbytes(struct net_device *dev);
 extern void e100_config_wol(struct e100_private *bdp);
-#endif
-#ifdef ETHTOOL_TEST
 extern u32 e100_run_diag(struct net_device *dev, u64 *test_info, u32 flags);
 static int e100_ethtool_test(struct net_device *, struct ifreq *);
-#endif
-#ifdef ETHTOOL_GSTRINGS
 static int e100_ethtool_gstrings(struct net_device *, struct ifreq *);
 static char *test_strings[] = {
        "E100_EEPROM_TEST_FAIL",
@@ -187,19 +164,10 @@ static char *test_strings[] = {
        "E100_LPBK_PHY_FAIL"
 };
 
-#endif
-#ifdef ETHTOOL_PHYS_ID
 static int e100_ethtool_led_blink(struct net_device *, struct ifreq *);
-#endif
-#endif /*E100_ETHTOOL_IOCTL */
 
-#ifdef SIOCGMIIPHY
-#define E100_MII_IOCTL
-#endif
-#ifdef E100_MII_IOCTL
 #include <linux/mii.h>
 static int e100_mii_ioctl(struct net_device *, struct ifreq *, int);
-#endif /*E100_MII_IOCTL */
 
 static unsigned char e100_delayed_exec_non_cu_cmd(struct e100_private *,
                                                  nxmit_cb_entry_t *);
@@ -457,7 +425,7 @@ static inline void
 e100_exec_cmd(struct e100_private *bdp, u8 cmd_low)
 {
        writeb(cmd_low, &(bdp->scb->scb_cmd_low));
-       readw(&(bdp->scb->scb_status)); /* flashes last write, read-safe */
+       readw(&(bdp->scb->scb_status)); /* flushes last write, read-safe */
 }
 
 /**
@@ -512,7 +480,7 @@ inline unsigned char
 e100_wait_exec_simple(struct e100_private *bdp, u8 scb_cmd_low)
 {
        if (!e100_wait_scb(bdp)) {
-               printk(KERN_DEBUG "%s e100_wait_exec_simple: Wait failed\n",
+               printk(KERN_DEBUG "e100: %s: e100_wait_exec_simple: failed\n",
                       bdp->device->name);
                return false;
        }
@@ -524,7 +492,7 @@ void
 e100_exec_cmplx(struct e100_private *bdp, u32 phys_addr, u8 cmd)
 {
        writel(phys_addr, &(bdp->scb->scb_gen_ptr));
-       readw(&(bdp->scb->scb_status)); /* flashes last write, read-safe */
+       readw(&(bdp->scb->scb_status)); /* flushes last write, read-safe */
        e100_exec_cmd(bdp, cmd);
 }
 
@@ -612,7 +580,7 @@ e100_found1(struct pci_dev *pcid, const struct pci_device_id *ent)
 
        dev = alloc_etherdev(sizeof (struct e100_private));
        if (dev == NULL) {
-               printk(KERN_ERR "Not able to alloc etherdev struct\n");
+               printk(KERN_ERR "e100: Not able to alloc etherdev struct\n");
                rc = -ENODEV;
                goto out;
        }
@@ -681,22 +649,21 @@ e100_found1(struct pci_dev *pcid, const struct pci_device_id *ent)
        } else {
                bdp->rfd_size = 16;
        }
-
        e100_check_options(e100nics, bdp);
 
        if (!e100_init(bdp)) {
-               printk(KERN_ERR "Failed to initialize e100, instance #%d\n",
+               printk(KERN_ERR "e100: Failed to initialize, instance #%d\n",
                       e100nics);
                rc = -ENODEV;
                goto err_pci;
        }
 
-       /* Check if checksum is valid */
+       /* Check if checksum is valid */
        cal_checksum = e100_eeprom_calculate_chksum(bdp);
        read_checksum = e100_eeprom_read(bdp, (bdp->eeprom_size - 1));
        if (cal_checksum != read_checksum) {
                 printk(KERN_ERR "e100: Corrupted EERPROM on instance #%d\n",
-                                              e100nics);
+                      e100nics);
                 rc = -ENODEV;
                 goto err_pci;
        }
@@ -710,16 +677,12 @@ e100_found1(struct pci_dev *pcid, const struct pci_device_id *ent)
        dev->set_multicast_list = &e100_set_multi;
        dev->set_mac_address = &e100_set_mac;
        dev->do_ioctl = &e100_ioctl;
-#ifdef E100_ZEROCOPY
        if (bdp->flags & USE_IPCB) {
                dev->features |= NETIF_F_SG | NETIF_F_IP_CSUM;
        }
-#endif
        e100nics++;
 
-#ifdef E100_ETHTOOL_IOCTL
        e100_get_speed_duplex_caps(bdp);
-#endif /*E100_ETHTOOL_IOCTL */
 
        if ((rc = register_netdev(dev)) != 0) {
                goto err_pci;
@@ -727,7 +690,8 @@ e100_found1(struct pci_dev *pcid, const struct pci_device_id *ent)
 
        bdp->device_type = ent->driver_data;
        printk(KERN_NOTICE
-              "%s: %s\n", bdp->device->name, e100_get_brand_msg(bdp));
+              "e100: %s: %s\n", 
+              bdp->device->name, e100_get_brand_msg(bdp));
        e100_print_brd_conf(bdp);
        bdp->id_string = e100_get_brand_msg(bdp);
        e100_get_mdix_status(bdp);
@@ -742,11 +706,10 @@ e100_found1(struct pci_dev *pcid, const struct pci_device_id *ent)
        }
 
        if (e100_create_proc_subdir(bdp) < 0) {
-               printk(KERN_ERR "Failed to create proc directory for %s\n",
+               printk(KERN_ERR "e100: Failed to create proc dir for %s\n",
                       bdp->device->name);
        }
 
-#ifdef ETHTOOL_GWOL
        /* Disabling all WOLs as initialization */
        bdp->wolsupported = bdp->wolopts = 0;
        if (bdp->rev_id >= D101A4_REV_ID) {
@@ -755,7 +718,6 @@ e100_found1(struct pci_dev *pcid, const struct pci_device_id *ent)
                        bdp->wolsupported |= WAKE_UCAST | WAKE_ARP;
                bdp->wolopts = WAKE_MAGIC;
        }
-#endif
 
        printk(KERN_NOTICE "\n");
 
@@ -817,7 +779,6 @@ e100_remove1(struct pci_dev *pcid)
                bdp->non_tx_command_state = E100_NON_TX_IDLE;
        }
 
-#ifdef ETHTOOL_GWOL
        /* Set up wol options and enable PME if wol is enabled */
        if (bdp->wolopts) {
                e100_do_wol(pcid, bdp);
@@ -827,7 +788,6 @@ e100_remove1(struct pci_dev *pcid)
                /* If system powers down, device is switched from D1 to D3 */
                pci_set_power_state(pcid, 1);
        }
-#endif
 
        e100_clear_structs(dev);
 
@@ -885,9 +845,10 @@ void __devinit
 e100_check_options(int board, struct e100_private *bdp)
 {
        if (board >= E100_MAX_NIC) {
-               printk(KERN_NOTICE "No configuration available for board #%d\n",
+               printk(KERN_NOTICE 
+                      "e100: No configuration available for board #%d\n",
                       board);
-               printk(KERN_NOTICE "Using defaults for all values\n");
+               printk(KERN_NOTICE "e100: Using defaults for all values\n");
                board = E100_MAX_NIC;
        }
 
@@ -968,13 +929,14 @@ e100_set_int_option(int *option, int val, int min, int max, int default_val,
 
        } else if ((val < min) || (val > max)) {
                printk(KERN_NOTICE
-                      "Invalid %s specified (%i). Valid range is %i-%i\n",
+                      "e100: Invalid %s specified (%i). "
+                      "Valid range is %i-%i\n",
                       name, val, min, max);
-               printk(KERN_NOTICE "Using default %s of %i\n", name,
+               printk(KERN_NOTICE "e100: Using default %s of %i\n", name,
                       default_val);
                *option = default_val;
        } else {
-               printk(KERN_INFO "Using specified %s of %i\n", name, val);
+               printk(KERN_INFO "e100: Using specified %s of %i\n", name, val);
                *option = val;
        }
 }
@@ -1002,15 +964,16 @@ e100_set_bool_option(struct e100_private *bdp, int val, u32 mask,
 
        } else if ((val != true) && (val != false)) {
                printk(KERN_NOTICE
-                      "Invalid %s specified (%i). Valid values are %i/%i\n",
+                      "e100: Invalid %s specified (%i). "
+                      "Valid values are %i/%i\n",
                       name, val, false, true);
-               printk(KERN_NOTICE "Using default %s of %i\n", name,
+               printk(KERN_NOTICE "e100: Using default %s of %i\n", name,
                       default_val);
 
                if (default_val)
                        bdp->params.b_params |= mask;
        } else {
-               printk(KERN_INFO "Using specified %s of %i\n", name, val);
+               printk(KERN_INFO "e100: Using specified %s of %i\n", name, val);
                if (val)
                        bdp->params.b_params |= mask;
        }
@@ -1096,9 +1059,7 @@ e100_close(struct net_device *dev)
        bdp->intr_mask = SCB_INT_MASK;
        e100_isolate_driver(bdp);
 
-#ifdef ETHTOOL_GWOL
        bdp->ip_lbytes = e100_get_ip_lbytes(dev);
-#endif
        free_irq(dev->irq, dev);
        e100_clear_pools(bdp);
 
@@ -1259,7 +1220,8 @@ e100_set_multi_exec(struct net_device *dev)
        }
 
        if (!e100_exec_non_cu_cmd(bdp, cmd)) {
-               printk(KERN_WARNING "%s: Multicast setup failed\n", dev->name);
+               printk(KERN_WARNING "e100: %s: Multicast setup failed\n", 
+                      dev->name);
        }
 }
 
@@ -1308,19 +1270,15 @@ e100_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
 
        switch (cmd) {
 
-#ifdef E100_ETHTOOL_IOCTL
        case SIOCETHTOOL:
                return e100_do_ethtool_ioctl(dev, ifr);
                break;
-#endif /*E100_ETHTOOL_IOCTL */
 
-#ifdef E100_MII_IOCTL
        case SIOCGMIIPHY:       /* Get address of MII PHY in use. */
        case SIOCGMIIREG:       /* Read MII PHY register. */
        case SIOCSMIIREG:       /* Write to MII PHY register. */
                return e100_mii_ioctl(dev, ifr, cmd);
                break;
-#endif /*E100_MII_IOCTL */
 
        default:
                return -EOPNOTSUPP;
@@ -1347,7 +1305,7 @@ e100_init(struct e100_private *bdp)
        e100_sw_init(bdp);
 
        if (!e100_selftest(bdp, NULL, NULL)) {
-               printk(KERN_ERR "selftest failed\n");
+               printk(KERN_ERR "e100: selftest failed\n");
                return false;
        }
 
@@ -1357,7 +1315,7 @@ e100_init(struct e100_private *bdp)
        e100_rd_pwa_no(bdp);
 
        if (!e100_hw_init(bdp, PORT_SOFTWARE_RESET)) {
-               printk(KERN_ERR "hw init failed\n");
+               printk(KERN_ERR "e100: hw init failed\n");
                return false;
        }
        e100_dis_intr(bdp);
@@ -1523,7 +1481,6 @@ e100_setup_tcb_pool(tcb_t *head, unsigned int qlen, struct e100_private *bdp)
                                cpu_to_le32(pcurr_tcb->tcb_phys + 0x10);
                }
 
-#ifdef E100_ZEROCOPY
                if (bdp->flags & IS_BACHELOR) {
                        pcurr_tcb->tcb_tbd_expand_ptr =
                                cpu_to_le32(pcurr_tcb->tcb_phys + 0x20);
@@ -1532,7 +1489,6 @@ e100_setup_tcb_pool(tcb_t *head, unsigned int qlen, struct e100_private *bdp)
                                cpu_to_le32(pcurr_tcb->tcb_phys + 0x10);
                }
                pcurr_tcb->tcb_tbd_dflt_ptr = pcurr_tcb->tcb_tbd_ptr;
-#endif
 
                if (bdp->flags & USE_IPCB) {
                        pcurr_tcb->tbd_ptr = &(pcurr_tcb->tcbu.tbd_array[1]);
@@ -1593,7 +1549,7 @@ e100_alloc_space(struct e100_private *bdp)
 
 err:
        printk(KERN_ERR
-              "%s - Failed to allocate memory\n", e100_short_driver_name);
+              "e100: Failed to allocate memory\n");
        return -ENOMEM;
 }
 
@@ -1955,6 +1911,7 @@ e100intr(int irq, void *dev_inst, struct pt_regs *regs)
        e100_dis_intr(bdp);
 
        writew(intr_status, &bdp->scb->scb_status);     /* ack intrs */
+       readw(&bdp->scb->scb_status);
 
        /* the device is closed, don't continue or else bad things may happen. */
        if (!netif_running(dev)) {
@@ -2009,7 +1966,6 @@ static void inline
 e100_tx_skb_free(struct e100_private *bdp, tcb_t *tcb)
 {
        if (tcb->tcb_skb) {
-#ifdef E100_ZEROCOPY
                int i;
                tbd_t *tbd_arr = tcb->tbd_ptr;
                int frags = skb_shinfo(tcb->tcb_skb)->nr_frags;
@@ -2020,11 +1976,6 @@ e100_tx_skb_free(struct e100_private *bdp, tcb_t *tcb)
                                         le16_to_cpu(tbd_arr->tbd_buf_cnt),
                                         PCI_DMA_TODEVICE);
                }
-#else
-               pci_unmap_single(bdp->pdev,
-                                le32_to_cpu((tcb->tbd_ptr)->tbd_buf_addr),
-                                tcb->tcb_skb->len, PCI_DMA_TODEVICE);
-#endif
                dev_kfree_skb_irq(tcb->tcb_skb);
                tcb->tcb_skb = NULL;
        }
@@ -2267,7 +2218,6 @@ e100_refresh_txthld(struct e100_private *bdp)
        }                       /* end underrun check */
 }
 
-#ifdef E100_ZEROCOPY
 /**
  * e100_pseudo_hdr_csum - compute IP pseudo-header checksum
  * @ip: points to the header of the IP packet
@@ -2293,7 +2243,6 @@ e100_pseudo_hdr_csum(const struct iphdr *ip)
 
        return FOLD_CSUM(pseudo);
 }
-#endif /* E100_ZEROCOPY */
 
 /**
  * e100_prepare_xmit_buff - prepare a buffer for transmission
@@ -2333,7 +2282,6 @@ e100_prepare_xmit_buff(struct e100_private *bdp, struct sk_buff *skb)
 
        tcb->tcb_skb = skb;
 
-#ifdef E100_ZEROCOPY
        if (skb->ip_summed == CHECKSUM_HW) {
                const struct iphdr *ip = skb->nh.iph;
 
@@ -2398,12 +2346,6 @@ e100_prepare_xmit_buff(struct e100_private *bdp, struct sk_buff *skb)
                tcb->tcb_tbd_num = skb_shinfo(skb)->nr_frags + 1;
                tcb->tcb_tbd_ptr = tcb->tcb_tbd_expand_ptr;
        }
-#else
-       (tcb->tbd_ptr)->tbd_buf_addr =
-               cpu_to_le32(pci_map_single(bdp->pdev, skb->data,
-                                          skb->len, PCI_DMA_TODEVICE));
-       (tcb->tbd_ptr)->tbd_buf_cnt = cpu_to_le16(skb->len);
-#endif
 
        /* clear the S-BIT on the previous tcb */
        prev_tcb = bdp->tcb_pool.data;
@@ -2463,12 +2405,12 @@ e100_start_cu(struct e100_private *bdp, tcb_t *tcb)
                // The last command was a non_tx CU command
                if (!e100_wait_cus_idle(bdp))
                        printk(KERN_DEBUG
-                              "%s cu_start: timeout waiting for cu\n",
+                              "e100: %s: cu_start: timeout waiting for cu\n",
                               bdp->device->name);
                if (!e100_wait_exec_cmplx(bdp, (u32) (tcb->tcb_phys),
                                          SCB_CUC_START)) {
                        printk(KERN_DEBUG
-                              "%s cu_start: timeout waiting for scb\n",
+                              "e100: %s: cu_start: timeout waiting for scb\n",
                               bdp->device->name);
                        e100_exec_cmplx(bdp, (u32) (tcb->tcb_phys),
                                        SCB_CUC_START);
@@ -2584,7 +2526,8 @@ e100_setup_iaaddr(struct e100_private *bdp, u8 *eaddr)
 
        res = e100_exec_non_cu_cmd(bdp, cmd);
        if (!res)
-               printk(KERN_WARNING "%s IA setup failed\n", bdp->device->name);
+               printk(KERN_WARNING "e100: %s: IA setup failed\n", 
+                      bdp->device->name);
 
 exit:
        return res;
@@ -2630,7 +2573,8 @@ e100_start_ru(struct e100_private *bdp)
 
        if (!e100_wait_exec_cmplx(bdp, rx_struct->dma_addr, SCB_RUC_START)) {
                printk(KERN_DEBUG
-                      "%s start_ru: wait_scb failed\n", bdp->device->name);
+                      "e100: %s: start_ru: wait_scb failed\n", 
+                      bdp->device->name);
                e100_exec_cmplx(bdp, rx_struct->dma_addr, SCB_RUC_START);
        }
        if (bdp->next_cu_cmd == RESUME_NO_WAIT) {
@@ -3213,9 +3157,8 @@ e100_pci_setup(struct pci_dev *pcid, struct e100_private *bdp)
        bdp->scb = (scb_t *) ioremap_nocache(dev->mem_start, sizeof (scb_t));
 
        if (!bdp->scb) {
-               printk(KERN_ERR "%s - %s: Failed to map PCI address 0x%lX\n",
-                      e100_short_driver_name, dev->name,
-                      pci_resource_start(pcid, 0));
+               printk(KERN_ERR "e100: %s: Failed to map PCI address 0x%lX\n",
+                      dev->name, pci_resource_start(pcid, 0));
                rc = -ENOMEM;
                goto err_region;
        }
@@ -3313,7 +3256,8 @@ e100_hw_reset_recover(struct e100_private *bdp, u32 reset_cmd)
 
                if (!e100_setup_iaaddr(bdp, bdp->device->dev_addr)) {
                        printk(KERN_ERR
-                              "e100_hw_reset_recover: setup iaaddr failed\n");
+                              "e100: e100_hw_reset_recover: "
+                              "setup iaaddr failed\n");
                        return false;
                }
 
@@ -3343,7 +3287,7 @@ e100_deisolate_driver(struct e100_private *bdp, u8 recover, u8 full_init)
        if (full_init) {
                e100_sw_reset(bdp, PORT_SOFTWARE_RESET);
                if (!e100_hw_reset_recover(bdp, PORT_SOFTWARE_RESET))
-                       printk(KERN_ERR "e100_deisolate_driver:"
+                       printk(KERN_ERR "e100: e100_deisolate_driver:"
                               " HW SOFTWARE reset recover failed\n");
        }
 
@@ -3357,7 +3301,7 @@ e100_deisolate_driver(struct e100_private *bdp, u8 recover, u8 full_init)
                        e100_sw_reset(bdp, PORT_SELECTIVE_RESET);
 
                        if (!e100_hw_reset_recover(bdp, PORT_SELECTIVE_RESET)) {
-                               printk(KERN_ERR "e100_deisolate_driver:"
+                               printk(KERN_ERR "e100: e100_deisolate_driver:"
                                       " HW reset recover failed\n");
                        }
                }
@@ -3380,7 +3324,6 @@ e100_deisolate_driver(struct e100_private *bdp, u8 recover, u8 full_init)
        bdp->driver_isolated = false;
 }
 
-#ifdef E100_ETHTOOL_IOCTL
 static int
 e100_do_ethtool_ioctl(struct net_device *dev, struct ifreq *ifr)
 {
@@ -3397,48 +3340,32 @@ e100_do_ethtool_ioctl(struct net_device *dev, struct ifreq *ifr)
        case ETHTOOL_SSET:
                rc = e100_ethtool_set_settings(dev, ifr);
                break;
-#ifdef ETHTOOL_GDRVINFO
        case ETHTOOL_GDRVINFO:
                rc = e100_ethtool_get_drvinfo(dev, ifr);
                break;
-#endif
-#ifdef ETHTOOL_NWAY_RST
        case ETHTOOL_NWAY_RST:
                rc = e100_ethtool_nway_rst(dev, ifr);
                break;
-#endif
-#ifdef ETHTOOL_GLINK
        case ETHTOOL_GLINK:
                rc = e100_ethtool_glink(dev, ifr);
                break;
-#endif
-#ifdef ETHTOOL_GEEPROM
        case ETHTOOL_GEEPROM:
        case ETHTOOL_SEEPROM:
                rc = e100_ethtool_eeprom(dev, ifr);
                break;
-#endif
-#ifdef ETHTOOL_GWOL
        case ETHTOOL_GWOL:
        case ETHTOOL_SWOL:
                rc = e100_ethtool_wol(dev, ifr);
                break;
-#endif
-#ifdef ETHTOOL_TEST
        case ETHTOOL_TEST:
                rc = e100_ethtool_test(dev, ifr);
                break;
-#endif
-#ifdef ETHTOOL_GSTRINGS
        case ETHTOOL_GSTRINGS:
                rc = e100_ethtool_gstrings(dev,ifr);
                break;
-#endif
-#ifdef ETHTOOL_PHYS_ID
        case ETHTOOL_PHYS_ID:
                rc = e100_ethtool_led_blink(dev,ifr);
                break;
-#endif
        default:
                break;
        }                       //switch
@@ -3576,7 +3503,6 @@ e100_ethtool_set_settings(struct net_device *dev, struct ifreq *ifr)
        return 0;
 }
 
-#ifdef ETHTOOL_GLINK
 static int
 e100_ethtool_glink(struct net_device *dev, struct ifreq *ifr)
 {
@@ -3595,9 +3521,7 @@ e100_ethtool_glink(struct net_device *dev, struct ifreq *ifr)
 
        return 0;
 }
-#endif
 
-#ifdef ETHTOOL_TEST
 static int
 e100_ethtool_test(struct net_device *dev, struct ifreq *ifr)
 {
@@ -3625,9 +3549,7 @@ exit:
        kfree(info);
        return rc;
 }
-#endif
 
-#ifdef ETHTOOL_NWAY_RST
 static int
 e100_ethtool_nway_rst(struct net_device *dev, struct ifreq *ifr)
 {
@@ -3646,9 +3568,7 @@ e100_ethtool_nway_rst(struct net_device *dev, struct ifreq *ifr)
        }
        return 0;
 }
-#endif
 
-#ifdef ETHTOOL_GDRVINFO
 static int
 e100_ethtool_get_drvinfo(struct net_device *dev, struct ifreq *ifr)
 {
@@ -3665,20 +3585,14 @@ e100_ethtool_get_drvinfo(struct net_device *dev, struct ifreq *ifr)
                sizeof (info.fw_version) - 1);
        strncpy(info.bus_info, bdp->pdev->slot_name,
                sizeof (info.bus_info) - 1);
-#ifdef ETHTOOL_GEEPROM
        info.eedump_len = (bdp->eeprom_size << 1);      
-#endif
-#ifdef ETHTOOL_TEST
        info.testinfo_len = E100_MAX_TEST_RES;
-#endif
        if (copy_to_user(ifr->ifr_data, &info, sizeof (info)))
                return -EFAULT;
 
        return 0;
 }
-#endif //ETHTOOL_GDRVINFO
 
-#ifdef ETHTOOL_GEEPROM
 static int
 e100_ethtool_eeprom(struct net_device *dev, struct ifreq *ifr)
 {
@@ -3750,9 +3664,7 @@ e100_ethtool_eeprom(struct net_device *dev, struct ifreq *ifr)
        }
        return 0;
 }
-#endif
 
-#ifdef ETHTOOL_PHYS_ID
 #define E100_BLINK_INTERVAL    (HZ/4)
 /**
  * e100_led_control
@@ -3835,7 +3747,6 @@ e100_ethtool_led_blink(struct net_device *dev, struct ifreq *ifr)
 
        return 0;
 }
-#endif
 
 static inline int __devinit
 e100_10BaseT_adapter(struct e100_private *bdp)
@@ -3884,7 +3795,6 @@ e100_get_speed_duplex_caps(struct e100_private *bdp)
 
 }
 
-#ifdef ETHTOOL_GWOL
 static unsigned char
 e100_setup_filter(struct e100_private *bdp)
 {
@@ -3917,7 +3827,7 @@ e100_setup_filter(struct e100_private *bdp)
 
        res = e100_exec_non_cu_cmd(bdp, cmd);
        if (!res)
-               printk(KERN_WARNING "%s Filter setup failed\n",
+               printk(KERN_WARNING "e100: %s: Filter setup failed\n",
                       bdp->device->name);
 
 exit:
@@ -3934,9 +3844,9 @@ e100_do_wol(struct pci_dev *pcid, struct e100_private *bdp)
                if (bdp->wolopts & (WAKE_UCAST | WAKE_ARP))
                        if (!e100_setup_filter(bdp))
                                printk(KERN_ERR
-                                      "e100_config WOL options failed\n");
+                                      "e100: WOL options failed\n");
        } else {
-               printk(KERN_ERR "e100_config WOL failed\n");
+               printk(KERN_ERR "e100config WOL failed\n");
        }
 }
 
@@ -3998,9 +3908,6 @@ e100_ethtool_wol(struct net_device *dev, struct ifreq *ifr)
        return res;
 }
 
-#endif
-
-#ifdef ETHTOOL_GSTRINGS
 static int e100_ethtool_gstrings(struct net_device *dev, struct ifreq *ifr)
 {
        struct ethtool_gstrings info;
@@ -4043,10 +3950,7 @@ static int e100_ethtool_gstrings(struct net_device *dev, struct ifreq *ifr)
        kfree(strings);
        return 0;
 }
-#endif
-#endif /*E100_ETHTOOL_IOCTL */
 
-#ifdef E100_MII_IOCTL
 static int
 e100_mii_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
 {
@@ -4083,7 +3987,6 @@ e100_mii_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
        }
        return 0;
 }
-#endif //E100_MII_IOCTL
 
 nxmit_cb_entry_t *
 e100_alloc_non_tx_cmd(struct e100_private *bdp)
@@ -4272,7 +4175,6 @@ e100_suspend(struct pci_dev *pcid, u32 state)
        pci_save_state(pcid, bdp->pci_state);
 
        /* If wol is enabled */
-#ifdef ETHTOOL_GWOL
        if (bdp->wolopts) {
                bdp->ip_lbytes = e100_get_ip_lbytes(netdev);
                e100_do_wol(pcid, bdp);
@@ -4283,10 +4185,6 @@ e100_suspend(struct pci_dev *pcid, u32 state)
                pci_disable_device(pcid);
                pci_set_power_state(pcid, state);
        }
-#else
-       pci_disable_device(pcid);
-       pci_set_power_state(pcid, state);
-#endif
 
        return 0;
 }
@@ -4307,11 +4205,9 @@ e100_resume(struct pci_dev *pcid)
                recover = true;
        }
 
-#ifdef ETHTOOL_GWOL
        if (bdp->wolopts & (WAKE_UCAST | WAKE_ARP)) {
                full_init = true;
        }
-#endif
 
        e100_deisolate_driver(bdp, recover, full_init);
 
index 4fccffb3035e988992a772dcf31549ea4482980c..e4b8c0efec67a33125014cdf8399f72bd964df83 100644 (file)
@@ -100,6 +100,7 @@ e100_mdi_write(struct e100_private *bdp, u32 reg_addr, u32 phy_addr, u16 data)
        temp_val = (((u32) data) | (reg_addr << 16) |
                    (phy_addr << 21) | (MDI_WRITE << 26));
        writel(temp_val, &bdp->scb->scb_mdi_cntrl);
+       readw(&bdp->scb->scb_status);
 
        /* wait 20usec before checking status */
        udelay(20);
@@ -144,6 +145,7 @@ e100_mdi_read(struct e100_private *bdp, u32 reg_addr, u32 phy_addr, u16 *data)
        /* Issue the read command to the MDI control register. */
        temp_val = ((reg_addr << 16) | (phy_addr << 21) | (MDI_READ << 26));
        writel(temp_val, &bdp->scb->scb_mdi_cntrl);
+       readw(&bdp->scb->scb_status);
 
        /* wait 20usec before checking status */
        udelay(20);
@@ -267,21 +269,22 @@ e100_phy_specific_setup(struct e100_private *bdp)
                case E100_AUTONEG:
                        /* The adapter can't autoneg. so set to 10/HALF */
                        printk(KERN_INFO
-                              "503 serial component detected which "
+                              "e100: 503 serial component detected which "
                               "cannot autonegotiate\n");
                        printk(KERN_INFO
-                              "speed/duplex forced to 10Mbps / Half duplex\n");
+                              "e100: speed/duplex forced to "
+                              "10Mbps / Half duplex\n");
                        bdp->params.e100_speed_duplex = E100_SPEED_10_HALF;
                        break;
 
                case E100_SPEED_100_HALF:
                case E100_SPEED_100_FULL:
                        printk(KERN_ERR
-                              "503 serial component detected which does not "
-                              "support 100Mbps\n");
+                              "e100: 503 serial component detected "
+                              "which does not support 100Mbps\n");
                        printk(KERN_ERR
-                              "Change the forced speed/duplex to a supported "
-                              "setting\n");
+                              "e100: Change the forced speed/duplex "
+                              "to a supported setting\n");
                        return false;
                }
 
@@ -298,7 +301,7 @@ e100_phy_specific_setup(struct e100_private *bdp)
                if ((bdp->params.e100_speed_duplex != E100_AUTONEG) &&
                    (bdp->params.e100_speed_duplex != E100_SPEED_100_FULL)) {
                        /* just inform user about 100 full */
-                       printk(KERN_ERR "NC3133 NIC can only run "
+                       printk(KERN_ERR "e100: NC3133 NIC can only run "
                               "at 100Mbps full duplex\n");
                }
 
index 82540446a12e0b39c5ced418ba5a791d7602352d..fd029e1b0150392a7c46a83a5586eb93efdb1568 100644 (file)
@@ -91,11 +91,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
 #include <linux/config.h>
 
-#ifndef CONFIG_PROC_FS
-#undef E100_CONFIG_PROC_FS
-#endif
-
-#ifdef E100_CONFIG_PROC_FS
+#ifdef CONFIG_PROC_FS
 #include "e100.h"
 /* MDI sleep time is at least 50 ms, in jiffies */
 #define MDI_SLEEP_TIME ((HZ / 20) + 1)
@@ -115,8 +111,6 @@ extern void e100_mdi_write(struct e100_private *, u32, u32, u16);
 static void e100_proc_cleanup(void);
 static unsigned char e100_init_proc_dir(void);
 
-#define E100_EOU
-
 #define ADAPTERS_PROC_DIR "PRO_LAN_Adapters"
 #define WRITE_BUF_MAX_LEN 20   
 #define READ_BUF_MAX_LEN  256
@@ -342,337 +336,6 @@ read_info(char *page, char **start, off_t off, int count, int *eof, void *data)
        return generic_read(page, start, off, count, eof, len);
 }
 
-#ifdef E100_EOU
-#ifdef MODULE
-/**********************
- *  parameter entries
- **********************/
-static int
-read_int_param(char *page, char *name, char *desc, int def, int min, int max)
-{
-       int len;
-
-       len = sprintf(page, "Name: %s\n", name);
-       len += sprintf(page + len, "Description: %s\n", desc);
-       len += sprintf(page + len, "Default_Value: %d\n", def);
-       len += sprintf(page + len, "Type: Range\n");
-       len += sprintf(page + len, "Min: %d\n", min);
-       len += sprintf(page + len, "Max: %d\n", max);
-       len += sprintf(page + len, "Step:1\n");
-       len += sprintf(page + len, "Radix: dec\n");
-
-       return len;
-}
-
-static int
-read_bool_param(char *page, char *name, char *desc, int def)
-{
-       int len;
-
-       len = sprintf(page, "Name: %s\n", name);
-       len += sprintf(page + len, "Description: %s\n", desc);
-       len += sprintf(page + len, "Default_Value: %d\n", def);
-       len += sprintf(page + len, "Type: Enum\n");
-       len += sprintf(page + len, "0: Off\n");
-       len += sprintf(page + len, "1: On\n");
-
-       return len;
-}
-
-static int
-read_speed_duplex_def(char *page, char **start, off_t off,
-                     int count, int *eof, void *data)
-{
-       int len;
-
-       len = sprintf(page, "Name: Speed and Duplex\n");
-       len += sprintf(page + len, "Description: Sets the adapter's "
-                      "speed and duplex mode\n");
-       len += sprintf(page + len, "Default_Value: 0\n");
-       len += sprintf(page + len, "Type: Enum\n");
-       len += sprintf(page + len, "0: Auto-Negotiate\n");
-       len += sprintf(page + len, "1: 10 Mbps / Half Duplex\n");
-       len += sprintf(page + len, "2: 10 Mbps / Full Duplex\n");
-       len += sprintf(page + len, "3: 100 Mbps / Half Duplex\n");
-       len += sprintf(page + len, "4: 100 Mbps / Full Duplex\n");
-
-       return generic_read(page, start, off, count, eof, len);
-}
-
-static int
-read_tx_desc_def(char *page, char **start, off_t off,
-                int count, int *eof, void *data)
-{
-       int len;
-
-       len = read_int_param(page, "Transmit Descriptors",
-                            "Sets the number of Tx descriptors "
-                            "available for the adapter",
-                            E100_DEFAULT_TCB, E100_MIN_TCB, E100_MAX_TCB);
-       return generic_read(page, start, off, count, eof, len);
-}
-
-static int
-read_rx_desc_def(char *page, char **start, off_t off,
-                int count, int *eof, void *data)
-{
-       int len;
-
-       len = read_int_param(page, "Receive Descriptors",
-                            "Sets the number of Rx descriptors "
-                            "available for the adapter",
-                            E100_DEFAULT_RFD, E100_MIN_RFD, E100_MAX_RFD);
-       return generic_read(page, start, off, count, eof, len);
-}
-
-static int
-read_ber_def(char *page, char **start, off_t off,
-            int count, int *eof, void *data)
-{
-       int len;
-
-       len = read_int_param(page, "Bit Error Rate",
-                            "Sets the value for the BER correction algorithm",
-                            E100_DEFAULT_BER, 0, ZLOCK_MAX_ERRORS);
-
-       return generic_read(page, start, off, count, eof, len);
-}
-
-static int
-read_xsum_rx_def(char *page, char **start, off_t off,
-                int count, int *eof, void *data)
-{
-       int len;
-
-       len = read_bool_param(page, "RX Checksum",
-                             "Setting this value to \"On\" enables "
-                             "receive checksum", E100_DEFAULT_XSUM);
-
-       return generic_read(page, start, off, count, eof, len);
-}
-
-static int
-read_ucode_def(char *page, char **start, off_t off,
-              int count, int *eof, void *data)
-{
-       int len;
-
-       len = read_bool_param(page, "Microcode",
-                             "Setting this value to \"On\" enables "
-                             "the adapter's microcode", E100_DEFAULT_UCODE);
-
-       return generic_read(page, start, off, count, eof, len);
-}
-
-static int
-read_bundle_small_def(char *page, char **start, off_t off,
-                     int count, int *eof, void *data)
-{
-       int len;
-
-       len = read_bool_param(page, "Bundle Small Frames",
-                             "Setting this value to \"On\" enables "
-                             "interrupt bundling of small frames",
-                             E100_DEFAULT_BUNDLE_SMALL_FR);
-
-       return generic_read(page, start, off, count, eof, len);
-}
-
-static int
-read_fc_def(char *page, char **start, off_t off,
-           int count, int *eof, void *data)
-{
-       int len;
-
-       len = read_bool_param(page, "Flow Control",
-                             "Setting this value to \"On\" enables processing "
-                             "flow-control packets", E100_DEFAULT_FC);
-
-       return generic_read(page, start, off, count, eof, len);
-}
-
-static int
-read_rcv_cong_def(char *page, char **start, off_t off,
-                 int count, int *eof, void *data)
-{
-       int len;
-
-       len = read_bool_param(page, "Receive Congestion Control",
-                             "Setting this value to \"On\" enables switching "
-                             "to polling mode on receive",
-                             E100_DEFAULT_RX_CONGESTION_CONTROL);
-
-       return generic_read(page, start, off, count, eof, len);
-}
-
-static int
-read_poll_max_def(char *page, char **start, off_t off,
-                 int count, int *eof, void *data)
-{
-       struct e100_private *bdp = data;
-
-       int len;
-
-       len = read_int_param(page, "Maximum Polling Work",
-                            "Sets the max number of RX packets processed"
-                            " by single polling function call",
-                            bdp->params.RxDescriptors, 1, E100_MAX_RFD);
-
-       return generic_read(page, start, off, count, eof, len);
-}
-
-static int
-read_int_delay_def(char *page, char **start, off_t off,
-                  int count, int *eof, void *data)
-{
-       int len;
-
-       len = read_int_param(page, "CPU Saver Interrupt Delay",
-                            "Sets the value for CPU saver's interrupt delay",
-                            E100_DEFAULT_CPUSAVER_INTERRUPT_DELAY, 0x0,
-                            0xFFFF);
-
-       return generic_read(page, start, off, count, eof, len);
-}
-
-static int
-read_bundle_max_def(char *page, char **start, off_t off,
-                   int count, int *eof, void *data)
-{
-       int len;
-
-       len = read_int_param(page, "CPU Saver Maximum Bundle",
-                            "Sets CPU saver's maximum value",
-                            E100_DEFAULT_CPUSAVER_BUNDLE_MAX, 0x1, 0xFFFF);
-
-       return generic_read(page, start, off, count, eof, len);
-}
-
-static int
-read_ifs_def(char *page, char **start, off_t off,
-            int count, int *eof, void *data)
-{
-       int len;
-
-       len = read_bool_param(page, "IFS",
-                             "Setting this value to \"On\" enables "
-                             "the adaptive IFS algorithm", E100_DEFAULT_IFS);
-
-       return generic_read(page, start, off, count, eof, len);
-}
-
-static int
-read_xsum_rx_val(char *page, char **start, off_t off,
-                int count, int *eof, void *data)
-{
-       struct e100_private *bdp = data;
-       unsigned long val;
-
-       val = (bdp->params.b_params & PRM_XSUMRX) ? 1 : 0;
-       return read_ulong(page, start, off, count, eof, val);
-}
-
-static int
-read_ucode_val(char *page, char **start, off_t off,
-              int count, int *eof, void *data)
-{
-       struct e100_private *bdp = data;
-       unsigned long val;
-
-       val = (bdp->params.b_params & PRM_UCODE) ? 1 : 0;
-       return read_ulong(page, start, off, count, eof, val);
-}
-
-static int
-read_fc_val(char *page, char **start, off_t off,
-           int count, int *eof, void *data)
-{
-       struct e100_private *bdp = data;
-       unsigned long val;
-
-       val = (bdp->params.b_params & PRM_FC) ? 1 : 0;
-       return read_ulong(page, start, off, count, eof, val);
-}
-
-static int
-read_ifs_val(char *page, char **start, off_t off,
-            int count, int *eof, void *data)
-{
-       struct e100_private *bdp = data;
-       unsigned long val;
-
-       val = (bdp->params.b_params & PRM_IFS) ? 1 : 0;
-       return read_ulong(page, start, off, count, eof, val);
-}
-
-static int
-read_bundle_small_val(char *page, char **start, off_t off,
-                     int count, int *eof, void *data)
-{
-       struct e100_private *bdp = data;
-       unsigned long val;
-
-       val = (bdp->params.b_params & PRM_BUNDLE_SMALL) ? 1 : 0;
-       return read_ulong(page, start, off, count, eof, val);
-}
-
-static int
-read_rcv_cong_val(char *page, char **start, off_t off,
-                 int count, int *eof, void *data)
-{
-       struct e100_private *bdp = data;
-       unsigned long val;
-
-       val = (bdp->params.b_params & PRM_RX_CONG) ? 1 : 0;
-       return read_ulong(page, start, off, count, eof, val);
-}
-
-static int
-read_gen_prm(char *page, char **start, off_t off,
-            int count, int *eof, void *data)
-{
-       int val = 0;
-
-       if (data)
-               val = *((int *) data);
-
-       return read_ulong(page, start, off, count, eof, (unsigned long) val);
-}
-
-static e100_proc_entry e100_proc_params[] = { 
-       /* definitions */
-       {"e100_speed_duplex.def", read_speed_duplex_def, 0, 0},
-       {"RxDescriptors.def",     read_rx_desc_def,      0, 0},
-       {"TxDescriptors.def",     read_tx_desc_def,      0, 0},
-       {"XsumRX.def",            read_xsum_rx_def,      0, 0},
-       {"ucode.def",             read_ucode_def,        0, 0},
-       {"BundleSmallFr.def",     read_bundle_small_def, 0, 0},
-       {"IntDelay.def",          read_int_delay_def,    0, 0},
-       {"BundleMax.def",         read_bundle_max_def,   0, 0},
-       {"ber.def",               read_ber_def,          0, 0},
-       {"flow_control.def",      read_fc_def,           0, 0},
-       {"IFS.def",               read_ifs_def,          0, 0},
-       {"RxCongestionControl.def", read_rcv_cong_def,   0, 0},
-       {"PollingMaxWork.def",      read_poll_max_def,   0, 0},
-       /* values */
-       {"e100_speed_duplex.val", read_gen_prm, 0, bdp_prm_off(e100_speed_duplex)},
-       {"RxDescriptors.val",     read_gen_prm, 0, bdp_prm_off(RxDescriptors)},
-       {"TxDescriptors.val",     read_gen_prm, 0, bdp_prm_off(TxDescriptors)},
-       {"XsumRX.val",            read_xsum_rx_val,      0, 0},
-       {"ucode.val",             read_ucode_val,        0, 0},
-       {"BundleSmallFr.val",     read_bundle_small_val, 0, 0},
-       {"IntDelay.val",          read_gen_prm, 0, bdp_prm_off(IntDelay)},
-       {"BundleMax.val",         read_gen_prm, 0, bdp_prm_off(BundleMax)},
-       {"ber.val",               read_gen_prm, 0, bdp_prm_off(ber)},
-       {"flow_control.val",      read_fc_val,           0, 0},
-       {"IFS.val",               read_ifs_val,          0, 0},
-       {"RxCongestionControl.val", read_rcv_cong_val,   0, 0},
-       {"PollingMaxWork.val",      read_gen_prm, 0, bdp_prm_off(PollingMaxWork)},
-       {"", 0, 0, 0}
-};
-#endif  /* MODULE */
-#endif /* E100_EOU */
-
 static struct proc_dir_entry * __devinit
 create_proc_rw(char *name, void *data, struct proc_dir_entry *parent,
               read_proc_t * read_proc, write_proc_t * write_proc)
@@ -699,60 +362,6 @@ create_proc_rw(char *name, void *data, struct proc_dir_entry *parent,
        return pdep;
 }
 
-#ifdef E100_EOU
-#ifdef MODULE
-static int __devinit
-create_proc_param_subdir(struct e100_private *bdp,
-                        struct proc_dir_entry *dev_dir)
-{
-       struct proc_dir_entry *param_dir;
-       e100_proc_entry *pe;
-       void *data;
-
-       param_dir = create_proc_entry("LoadParameters", S_IFDIR, dev_dir);
-       if (!param_dir)
-               return -ENOMEM;
-
-       for (pe = e100_proc_params; pe->name[0]; pe++) {
-
-               data = ((char *) bdp) + pe->offset;
-
-               if (!(create_proc_rw(pe->name, data, param_dir,
-                                    pe->read_proc, pe->write_proc))) {
-                       return -ENOMEM;
-               }
-       }
-
-       return 0;
-}
-
-static void
-remove_proc_param_subdir(struct proc_dir_entry *parent)
-{
-       struct proc_dir_entry *de;
-       e100_proc_entry *pe;
-       int len;
-
-       len = strlen("LoadParameters");
-
-       for (de = parent->subdir; de; de = de->next) {
-               if ((de->namelen == len) &&
-                   (!memcmp(de->name, "LoadParameters", len)))
-                       break;
-       }
-
-       if (!de)
-               return;
-
-       for (pe = e100_proc_params; pe->name[0]; pe++) {
-               remove_proc_entry(pe->name, de);
-       }
-
-       remove_proc_entry("LoadParameters", parent);
-}
-#endif /* MODULE */
-#endif
-
 void
 e100_remove_proc_subdir(struct e100_private *bdp)
 {
@@ -777,11 +386,6 @@ e100_remove_proc_subdir(struct e100_private *bdp)
                        remove_proc_entry(pe->name, bdp->proc_parent);
                }
 
-#ifdef E100_EOU                
-#ifdef MODULE
-               remove_proc_param_subdir(bdp->proc_parent);
-#endif
-#endif         
                remove_proc_entry(bdp->device->name, adapters_proc_dir);
                bdp->proc_parent = NULL;
        }
@@ -842,15 +446,6 @@ e100_create_proc_subdir(struct e100_private *bdp)
                }
        }
 
-#ifdef E100_EOU        
-#ifdef MODULE
-       if (create_proc_param_subdir(bdp, dev_dir)) {
-               e100_remove_proc_subdir(bdp);
-               return -ENOMEM;
-       }
-#endif
-#endif 
-
        return 0;
 }
 
index b2fcf25ea88bbee575407da5d1b824ed9ce1cbd7..3afac1730f55bf44712ec91e1a545dfb936f87cd 100644 (file)
@@ -72,7 +72,6 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
 #include "e100.h"
 #include "e100_config.h"
-#ifdef ETHTOOL_TEST
 
 extern u16 e100_eeprom_read(struct e100_private *, u16);
 extern int e100_wait_exec_cmplx(struct e100_private *, u32,u8);
@@ -380,11 +379,11 @@ e100_diag_loopback_cu_ru_exec(struct e100_private *bdp)
 {
        /*load CU & RU base */ 
        if (!e100_wait_exec_cmplx(bdp, 0, SCB_CUC_LOAD_BASE))
-               printk("@@@ SCB_CUC_LOAD_BASE failed\n");
+               printk("e100: SCB_CUC_LOAD_BASE failed\n");
        if(!e100_wait_exec_cmplx(bdp, 0, SCB_RUC_LOAD_BASE))
-               printk("@@@ SCB_RUC_LOAD_BASE failed!\n");
+               printk("e100: SCB_RUC_LOAD_BASE failed!\n");
        if(!e100_wait_exec_cmplx(bdp, bdp->loopback.dma_handle, SCB_RUC_START))
-               printk("@@@ SCB_RUC_START failed!\n");
+               printk("e100: SCB_RUC_START failed!\n");
 
        bdp->next_cu_cmd = START_WAIT;
        e100_start_cu(bdp, bdp->loopback.tcb);
@@ -457,5 +456,3 @@ e100_diag_loopback_free (struct e100_private *bdp)
                            bdp->loopback.dma_handle);
 }
 
-#endif
-