The Design and Implementation of the FreeBSD Operating System, Second Edition
Now available: The Design and Implementation of the FreeBSD Operating System (Second Edition)


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]

FreeBSD/Linux Kernel Cross Reference
sys/dev/hfa/fore_timer.c

Version: -  FREEBSD  -  FREEBSD-13-STABLE  -  FREEBSD-13-0  -  FREEBSD-12-STABLE  -  FREEBSD-12-0  -  FREEBSD-11-STABLE  -  FREEBSD-11-0  -  FREEBSD-10-STABLE  -  FREEBSD-10-0  -  FREEBSD-9-STABLE  -  FREEBSD-9-0  -  FREEBSD-8-STABLE  -  FREEBSD-8-0  -  FREEBSD-7-STABLE  -  FREEBSD-7-0  -  FREEBSD-6-STABLE  -  FREEBSD-6-0  -  FREEBSD-5-STABLE  -  FREEBSD-5-0  -  FREEBSD-4-STABLE  -  FREEBSD-3-STABLE  -  FREEBSD22  -  l41  -  OPENBSD  -  linux-2.6  -  MK84  -  PLAN9  -  xnu-8792 
SearchContext: -  none  -  3  -  10 

    1 /*-
    2  * ===================================
    3  * HARP  |  Host ATM Research Platform
    4  * ===================================
    5  *
    6  * This Host ATM Research Platform ("HARP") file (the "Software") is
    7  * made available by Network Computing Services, Inc. ("NetworkCS")
    8  * "AS IS".  NetworkCS does not provide maintenance, improvements or
    9  * support of any kind.
   10  *
   11  * NETWORKCS MAKES NO WARRANTIES OR REPRESENTATIONS, EXPRESS OR IMPLIED,
   12  * INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF MERCHANTABILITY
   13  * AND FITNESS FOR A PARTICULAR PURPOSE, AS TO ANY ELEMENT OF THE
   14  * SOFTWARE OR ANY SUPPORT PROVIDED IN CONNECTION WITH THIS SOFTWARE.
   15  * In no event shall NetworkCS be responsible for any damages, including
   16  * but not limited to consequential damages, arising from or relating to
   17  * any use of the Software or related support.
   18  *
   19  * Copyright 1994-1998 Network Computing Services, Inc.
   20  *
   21  * Copies of this Software may be made, however, the above copyright
   22  * notice must be reproduced on all copies.
   23  */
   24 
   25 #include <sys/cdefs.h>
   26 __FBSDID("$FreeBSD$");
   27 
   28 /*
   29  * FORE Systems 200-Series Adapter Support
   30  * ---------------------------------------
   31  *
   32  * Timer processing
   33  *
   34  */
   35 
   36 #include <sys/param.h>
   37 #include <sys/systm.h>
   38 #include <sys/socket.h>
   39 #include <sys/socketvar.h>
   40 #include <net/if.h>
   41 #include <netatm/port.h>
   42 #include <netatm/queue.h>
   43 #include <netatm/atm.h>
   44 #include <netatm/atm_sys.h>
   45 #include <netatm/atm_sap.h>
   46 #include <netatm/atm_cm.h>
   47 #include <netatm/atm_if.h>
   48 #include <netatm/atm_stack.h>
   49 #include <netatm/atm_pcb.h>
   50 #include <netatm/atm_var.h>
   51 #include <dev/pci/pcivar.h>
   52 #include <dev/hfa/fore.h>
   53 #include <dev/hfa/fore_aali.h>
   54 #include <dev/hfa/fore_slave.h>
   55 #include <dev/hfa/fore_stats.h>
   56 #include <dev/hfa/fore_var.h>
   57 #include <dev/hfa/fore_include.h>
   58 
   59 #ifndef lint
   60 __RCSID("@(#) $FreeBSD$");
   61 #endif
   62 
   63 
   64 /*
   65  * Process a Fore timer tick
   66  * 
   67  * This function is called every FORE_TIME_TICK seconds in order to update
   68  * all of the unit watchdog timers.  
   69  *
   70  * Called at splnet.
   71  *
   72  * Arguments:
   73  *      tip     pointer to fore timer control block
   74  *
   75  * Returns:
   76  *      none
   77  *
   78  */
   79 void
   80 fore_timeout(tip)
   81         struct atm_time *tip;
   82 {
   83         Fore_unit       *fup;
   84         int             i;
   85 
   86 
   87         /*
   88          * Schedule next timeout
   89          */
   90         atm_timeout(&fore_timer, ATM_HZ * FORE_TIME_TICK, fore_timeout);
   91 
   92         /*
   93          * Run through all units, updating each active timer.
   94          * If an expired timer is found, notify that unit.
   95          */
   96         for (i = 0; i < fore_nunits; i++) {
   97 
   98                 if ((fup = fore_units[i]) == NULL)
   99                         continue;
  100 
  101                 /*
  102                  * Decrement timer, if it's active
  103                  */
  104                 if (fup->fu_timer && (--fup->fu_timer == 0)) {
  105 
  106                         /*
  107                          * Timeout occurred - go check out the queues
  108                          */
  109                         ATM_DEBUG0("fore_timeout\n");
  110                         DEVICE_LOCK((Cmn_unit *)fup);
  111                         fore_watchdog(fup);
  112                         DEVICE_UNLOCK((Cmn_unit *)fup);
  113                 }
  114         }
  115 }
  116 

Cache object: b907ae2d54483c0abc1aae1bc2c10d1c


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]


This page is part of the FreeBSD/Linux Linux Kernel Cross-Reference, and was automatically generated using a modified version of the LXR engine.