netisr.h 3.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. /* $OpenBSD: netisr.h,v 1.42 2015/07/20 21:16:39 rzalamena Exp $ */
  2. /* $NetBSD: netisr.h,v 1.12 1995/08/12 23:59:24 mycroft Exp $ */
  3. /*
  4. * Copyright (c) 1980, 1986, 1989, 1993
  5. * The Regents of the University of California. All rights reserved.
  6. *
  7. * Redistribution and use in source and binary forms, with or without
  8. * modification, are permitted provided that the following conditions
  9. * are met:
  10. * 1. Redistributions of source code must retain the above copyright
  11. * notice, this list of conditions and the following disclaimer.
  12. * 2. Redistributions in binary form must reproduce the above copyright
  13. * notice, this list of conditions and the following disclaimer in the
  14. * documentation and/or other materials provided with the distribution.
  15. * 3. Neither the name of the University nor the names of its contributors
  16. * may be used to endorse or promote products derived from this software
  17. * without specific prior written permission.
  18. *
  19. * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
  20. * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  21. * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  22. * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
  23. * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  24. * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  25. * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  26. * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  27. * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  28. * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  29. * SUCH DAMAGE.
  30. *
  31. * @(#)netisr.h 8.1 (Berkeley) 6/10/93
  32. */
  33. #ifndef _NET_NETISR_H_
  34. #define _NET_NETISR_H_
  35. /*
  36. * The networking code runs off software interrupts.
  37. *
  38. * You can switch into the network by doing splsoftnet() and return by splx().
  39. * The software interrupt level for the network is higher than the software
  40. * level for the clock (so you can enter the network in routines called
  41. * at timeout time).
  42. */
  43. /*
  44. * Each ``pup-level-1'' input queue has a bit in a ``netisr'' status
  45. * word which is used to de-multiplex a single software
  46. * interrupt used for scheduling the network code to calls
  47. * on the lowest level routine of each protocol.
  48. */
  49. #define NETISR_IP 2 /* same as AF_INET */
  50. #define NETISR_TX 3 /* for if_snd processing */
  51. #define NETISR_PFSYNC 5 /* for pfsync "immediate" tx */
  52. #define NETISR_ARP 18 /* same as AF_LINK */
  53. #define NETISR_IPV6 24 /* same as AF_INET6 */
  54. #define NETISR_ISDN 26 /* same as AF_E164 */
  55. #define NETISR_PPP 28 /* for PPP processing */
  56. #define NETISR_BRIDGE 29 /* for bridge processing */
  57. #define NETISR_PPPOE 30 /* for pppoe processing */
  58. #ifndef _LOCORE
  59. #ifdef _KERNEL
  60. extern int netisr; /* scheduling bits for network */
  61. void nettxintr(void);
  62. void arpintr(void);
  63. void ipintr(void);
  64. void ip6intr(void);
  65. void pppintr(void);
  66. void bridgeintr(void);
  67. void pppoeintr(void);
  68. void pfsyncintr(void);
  69. #include <machine/atomic.h>
  70. extern void *netisr_intr;
  71. #define schednetisr(anisr) \
  72. do { \
  73. atomic_setbits_int(&netisr, (1 << (anisr))); \
  74. softintr_schedule(netisr_intr); \
  75. } while (/* CONSTCOND */0)
  76. void netisr_init(void);
  77. #endif /* _KERNEL */
  78. #endif /*_LOCORE */
  79. #endif /* _NET_NETISR_H_ */