Changeset 2174c66 in rtems


Ignore:
Timestamp:
Aug 30, 2011, 1:07:21 PM (10 years ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
4.11, 5, master
Children:
839dc97e
Parents:
37c0ccb2
Message:

2011-08-30 Peter Dufault <dufault@…>

  • libchip/network/smc91111.c: Modify to support the MPC5554 using new exceptions. Fix where the networking status is being dumped to a single thousand-character line. Add support for when the chip loaded it's MAC address from a serial chip at reset (the SMC91111_ENADDR_IS_SETUP option). Call lan91cxx_start() every time the the device is initialized. Without this change the chip can not be "upped" once it has been downed.
  • c/src/libchip/network/smc91111.h: Change the "#ifdef expression" to "#if expression".
  • c/src/libchip/network/smc91111exp.h: Add support for new exceptions.
Location:
c/src
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • c/src/ChangeLog

    r37c0ccb2 r2174c66  
     12011-08-30      Peter Dufault <dufault@hda.com>
     2
     3        * libchip/network/smc91111.c: Modify to support the MPC5554 using new
     4        exceptions.  Fix where the networking status is being dumped to a
     5        single thousand-character line.  Add support for when the chip loaded
     6        it's MAC address from a serial chip at reset (the
     7        SMC91111_ENADDR_IS_SETUP option).  Call lan91cxx_start() every time
     8        the the device is initialized.  Without this change the chip can not
     9        be "upped" once it has been downed.
     10        * c/src/libchip/network/smc91111.h: Change the "#ifdef expression" to
     11        "#if expression".
     12        * c/src/libchip/network/smc91111exp.h: Add support for new exceptions.
     13
    1142011-07-11      Sebastian Huber <sebastian.huber@embedded-brains.de>
    215
  • c/src/libchip/network/smc91111.c

    r37c0ccb2 r2174c66  
    66#include <errno.h>
    77
     8#include <bsp.h>
     9
    810/*
    9  *  This driver currently only supports architectures with the old style
    10  *  exception processing.  The following checks try to keep this
    11  *  from being compiled on systems which can't support this driver.
     11 *  This driver currently only supports SPARC with the old style
     12 *  exception processing and the Phytec Phycore MPC5554.
     13 *  This test keeps it from being compiled on systems which haven't been
     14 *  tested.
    1215 *
    13  *  NOTE: As of 28 September 2005, this has only been tested on the SPARC,
    14  *        so that is all it is enabled for.
    1516 */
    1617
    17 #if defined(__sparc__)
     18#if defined(__sparc__) || defined(HAS_SMC91111)
    1819  #define SMC91111_SUPPORTED
    1920#endif
    2021
    2122#if defined(SMC91111_SUPPORTED)
    22 
    23 #include <bsp.h>
    2423
    2524#include <stdlib.h>
     
    2827#include <rtems/error.h>
    2928#include <rtems/rtems_bsdnet.h>
     29#include <rtems/irq-extension.h>
    3030
    3131#include <sys/param.h>
     
    5555/*#define DEBUG (-1 & ~(16))*/
    5656#define DEBUG (0)
     57/*#define DEBUG (1)*/
    5758
    5859#include "smc91111config.h"
    5960#include <libchip/smc91111.h>
    6061
     62#ifdef _OLD_EXCEPTIONS
    6163#if defined(__m68k__)
    6264extern m68k_isr_entry set_vector( rtems_isr_entry, rtems_vector_number, int );
    6365#else
    6466extern rtems_isr_entry set_vector( rtems_isr_entry, rtems_vector_number, int );
     67#endif
     68#else
     69#include <rtems/irq-extension.h>
    6570#endif
    6671
     
    796801static void smc91111_stats(struct lan91cxx_priv_data *priv)
    797802{
    798         printf("tx_good             :%-8d", priv->stats.tx_good);
    799         printf("tx_max_collisions   :%-8d", priv->stats.tx_max_collisions);
    800         printf("tx_late_collisions  :%-8d", priv->stats.tx_late_collisions);
    801         printf("tx_underrun         :%-8d", priv->stats.tx_underrun);
    802         printf("tx_carrier_loss     :%-8d", priv->stats.tx_carrier_loss);
    803         printf("tx_deferred         :%-8d", priv->stats.tx_deferred);
    804         printf("tx_sqetesterrors    :%-8d", priv->stats.tx_sqetesterrors);
    805         printf("tx_single_collisions:%-8d", priv->stats.tx_single_collisions);
    806         printf("tx_mult_collisions  :%-8d", priv->stats.tx_mult_collisions);
    807         printf("tx_total_collisions :%-8d", priv->stats.tx_total_collisions);
    808         printf("rx_good             :%-8d", priv->stats.rx_good);
    809         printf("rx_crc_errors       :%-8d", priv->stats.rx_crc_errors);
    810         printf("rx_align_errors     :%-8d", priv->stats.rx_align_errors);
    811         printf("rx_resource_errors  :%-8d", priv->stats.rx_resource_errors);
    812         printf("rx_overrun_errors   :%-8d", priv->stats.rx_overrun_errors);
    813         printf("rx_collisions       :%-8d", priv->stats.rx_collisions);
    814         printf("rx_short_frames     :%-8d", priv->stats.rx_short_frames);
    815         printf("rx_too_long_frames  :%-8d", priv->stats.rx_too_long_frames);
    816         printf("rx_symbol_errors    :%-8d", priv->stats.rx_symbol_errors);
    817         printf("interrupts          :%-8d", priv->stats.interrupts);
    818         printf("rx_count            :%-8d", priv->stats.rx_count);
    819         printf("rx_deliver          :%-8d", priv->stats.rx_deliver);
    820         printf("rx_resource         :%-8d", priv->stats.rx_resource);
    821         printf("rx_restart          :%-8d", priv->stats.rx_restart);
    822         printf("tx_count            :%-8d", priv->stats.tx_count);
    823         printf("tx_complete         :%-8d", priv->stats.tx_complete);
    824         printf("tx_dropped          :%-8d", priv->stats.tx_dropped);
     803        printf("tx_good             :%-8d\n", priv->stats.tx_good);
     804        printf("tx_max_collisions   :%-8d\n", priv->stats.tx_max_collisions);
     805        printf("tx_late_collisions  :%-8d\n", priv->stats.tx_late_collisions);
     806        printf("tx_underrun         :%-8d\n", priv->stats.tx_underrun);
     807        printf("tx_carrier_loss     :%-8d\n", priv->stats.tx_carrier_loss);
     808        printf("tx_deferred         :%-8d\n", priv->stats.tx_deferred);
     809        printf("tx_sqetesterrors    :%-8d\n", priv->stats.tx_sqetesterrors);
     810        printf("tx_single_collisions:%-8d\n", priv->stats.tx_single_collisions);
     811        printf("tx_mult_collisions  :%-8d\n", priv->stats.tx_mult_collisions);
     812        printf("tx_total_collisions :%-8d\n", priv->stats.tx_total_collisions);
     813        printf("rx_good             :%-8d\n", priv->stats.rx_good);
     814        printf("rx_crc_errors       :%-8d\n", priv->stats.rx_crc_errors);
     815        printf("rx_align_errors     :%-8d\n", priv->stats.rx_align_errors);
     816        printf("rx_resource_errors  :%-8d\n", priv->stats.rx_resource_errors);
     817        printf("rx_overrun_errors   :%-8d\n", priv->stats.rx_overrun_errors);
     818        printf("rx_collisions       :%-8d\n", priv->stats.rx_collisions);
     819        printf("rx_short_frames     :%-8d\n", priv->stats.rx_short_frames);
     820        printf("rx_too_long_frames  :%-8d\n", priv->stats.rx_too_long_frames);
     821        printf("rx_symbol_errors    :%-8d\n", priv->stats.rx_symbol_errors);
     822        printf("interrupts          :%-8d\n", priv->stats.interrupts);
     823        printf("rx_count            :%-8d\n", priv->stats.rx_count);
     824        printf("rx_deliver          :%-8d\n", priv->stats.rx_deliver);
     825        printf("rx_resource         :%-8d\n", priv->stats.rx_resource);
     826        printf("rx_restart          :%-8d\n", priv->stats.rx_restart);
     827        printf("tx_count            :%-8d\n", priv->stats.tx_count);
     828        printf("tx_complete         :%-8d\n", priv->stats.tx_complete);
     829        printf("tx_dropped          :%-8d\n", priv->stats.tx_dropped);
    825830}
    826831
     
    949954                memcpy(cpd->arpcom.ac_enaddr, config->hardware_address, ETHER_ADDR_LEN);
    950955        } else {
     956#ifdef SMC91111_ENADDR_IS_SETUP
     957        /* The address was put in the chip at reset time.  Retrieve it. */
     958        int i;
     959        for (i = 0; i < sizeof(cpd->enaddr); i += 2) {
     960            unsigned short r = get_reg(cpd, LAN91CXX_IA01 + i / 2);
     961            cpd->arpcom.ac_enaddr[i] = r;
     962            cpd->arpcom.ac_enaddr[i+1] = r >> 8;
     963        }
     964#else
    951965                /* dummy default address */
    952966                cpd->arpcom.ac_enaddr[0] = 0x12;
     
    956970                cpd->arpcom.ac_enaddr[4] = 0x16;
    957971                cpd->arpcom.ac_enaddr[5] = 0x17;
     972#endif
    958973        }
    959974
     
    10211036                cpd->txDaemonTid =
    10221037                    rtems_bsdnet_newproc("DCtx", 4096, smc91111_txDaemon, cpd);
     1038        } else {
     1039                lan91cxx_start(ifp);
    10231040        }
    10241041
     
    10561073
    10571074        /* install interrupt vector */
     1075#ifdef _OLD_EXCEPTIONS
    10581076        db_printf("Install lan91cxx irqvector at %d\n", cpd->config.vector);
    10591077        set_vector(lan91cxx_interrupt_handler, cpd->config.vector, 1);
     1078#else
     1079    {
     1080        int r;
     1081        if ((r = rtems_interrupt_handler_install(cpd->config.vector,
     1082        cpd->config.info,
     1083        cpd->config.options,
     1084        cpd->config.interrupt_wrapper,
     1085        cpd->config.arg) )) {
     1086                printf("rtems_interrupt_handler_install returned %d.\n", r);
     1087                return 0;
     1088        }
     1089    }
     1090#endif
    10601091
    10611092        /* Reset chip */
     
    16231654}
    16241655
    1625 #endif
    1626 
    16271656#if 0
    16281657void lan91cxx_print_bank(int bank){
     
    16451674}
    16461675#endif
     1676
     1677#endif
  • c/src/libchip/network/smc91111.h

    r37c0ccb2 r2174c66  
    452452    /*rtems_interrupt_enable(Irql);*/
    453453
    454 #ifdef DEBUG & 32
     454#if DEBUG & 32
    455455    while ((c = dbg->reg) != -1) {
    456456      if (c == regno) {
     
    475475    uint32_t              Irql;
    476476
    477 #ifdef DEBUG & 32
     477#if DEBUG & 32
    478478    while ((c = dbg->reg) != -1) {
    479479      if (c == regno) {
  • c/src/libchip/network/smc91111exp.h

    r37c0ccb2 r2174c66  
    1313  unsigned int              ctl_rfduplx;
    1414  unsigned int              ctl_autoneg;
     15#ifndef _OLD_EXCEPTIONS
     16  /* New arguments for the Interrupt Manager Extension:
     17   */
     18  const char *              info;
     19  rtems_option              options;
     20  rtems_interrupt_handler   interrupt_wrapper;
     21  void *                    arg;
     22#endif
    1523} scmv91111_configuration_t;
    1624
Note: See TracChangeset for help on using the changeset viewer.