]> git.saurik.com Git - apple/xnu.git/blobdiff - bsd/net/pktsched/pktsched_tcq.h
xnu-4903.270.47.tar.gz
[apple/xnu.git] / bsd / net / pktsched / pktsched_tcq.h
index 91c2f71e8f85f1b95d293c4d8bf8589130cee1b9..1939b72a427a26de105ba6ab454e1773d75bebcf 100644 (file)
@@ -27,7 +27,7 @@
  */
 
 #ifndef _NET_PKTSCHED_PKTSCHED_TCQ_H_
  */
 
 #ifndef _NET_PKTSCHED_PKTSCHED_TCQ_H_
-#define        _NET_PKTSCHED_PKTSCHED_TCQ_H_
+#define _NET_PKTSCHED_PKTSCHED_TCQ_H_
 
 #ifdef PRIVATE
 #include <net/pktsched/pktsched.h>
 
 #ifdef PRIVATE
 #include <net/pktsched/pktsched.h>
 extern "C" {
 #endif
 
 extern "C" {
 #endif
 
-#define        TCQ_MAXPRI      4       /* upper limit of the number of priorities */
+#define TCQ_MAXPRI      4       /* upper limit of the number of priorities */
 
 /* tcq class flags */
 
 /* tcq class flags */
-#define        TQCF_RED                0x0001  /* use RED */
-#define        TQCF_ECN                0x0002  /* use ECN with RED/BLUE/SFB */
-#define        TQCF_RIO                0x0004  /* use RIO */
-#define        TQCF_CLEARDSCP          0x0010  /* clear diffserv codepoint */
-#define        TQCF_BLUE               0x0100  /* use BLUE */
-#define        TQCF_SFB                0x0200  /* use SFB */
-#define        TQCF_FLOWCTL            0x0400  /* enable flow control advisories */
-#define        TQCF_DEFAULTCLASS       0x1000  /* default class */
-#define        TQCF_DELAYBASED         0x2000  /* queue sizing is delay based */
+#define TQCF_RED                0x0001  /* use RED */
+#define TQCF_ECN                0x0002  /* use ECN with RED/BLUE/SFB */
+#define TQCF_RIO                0x0004  /* use RIO */
+#define TQCF_CLEARDSCP          0x0010  /* clear diffserv codepoint */
+#define TQCF_BLUE               0x0100  /* use BLUE */
+#define TQCF_SFB                0x0200  /* use SFB */
+#define TQCF_FLOWCTL            0x0400  /* enable flow control advisories */
+#define TQCF_DEFAULTCLASS       0x1000  /* default class */
+#define TQCF_DELAYBASED         0x2000  /* queue sizing is delay based */
 #ifdef BSD_KERNEL_PRIVATE
 #ifdef BSD_KERNEL_PRIVATE
-#define        TQCF_LAZY               0x10000000 /* on-demand resource allocation */
+#define TQCF_LAZY               0x10000000 /* on-demand resource allocation */
 #endif /* BSD_KERNEL_PRIVATE */
 
 #endif /* BSD_KERNEL_PRIVATE */
 
-#define        TQCF_USERFLAGS                                                  \
-       (TQCF_RED | TQCF_ECN | TQCF_RIO | TQCF_CLEARDSCP | TQCF_BLUE |  \
+#define TQCF_USERFLAGS                                                  \
+       (TQCF_RED | TQCF_ECN | TQCF_RIO | TQCF_CLEARDSCP | TQCF_BLUE |  \
        TQCF_SFB | TQCF_FLOWCTL | TQCF_DEFAULTCLASS)
 
 #ifdef BSD_KERNEL_PRIVATE
        TQCF_SFB | TQCF_FLOWCTL | TQCF_DEFAULTCLASS)
 
 #ifdef BSD_KERNEL_PRIVATE
-#define        TQCF_BITS \
+#define TQCF_BITS \
        "\020\1RED\2ECN\3RIO\5CLEARDSCP\11BLUE\12SFB\13FLOWCTL\15DEFAULT" \
        "\35LAZY"
 #else
        "\020\1RED\2ECN\3RIO\5CLEARDSCP\11BLUE\12SFB\13FLOWCTL\15DEFAULT" \
        "\35LAZY"
 #else
-#define        TQCF_BITS \
+#define TQCF_BITS \
        "\020\1RED\2ECN\3RIO\5CLEARDSCP\11BLUE\12SFB\13FLOWCTL"
 #endif /* !BSD_KERNEL_PRIVATE */
 
 struct tcq_classstats {
        "\020\1RED\2ECN\3RIO\5CLEARDSCP\11BLUE\12SFB\13FLOWCTL"
 #endif /* !BSD_KERNEL_PRIVATE */
 
 struct tcq_classstats {
-       u_int32_t               class_handle;
-       u_int32_t               priority;
+       u_int32_t               class_handle;
+       u_int32_t               priority;
 
 
-       u_int32_t               qlength;
-       u_int32_t               qlimit;
-       u_int32_t               period;
-       struct pktcntr          xmitcnt;  /* transmitted packet counter */
-       struct pktcntr          dropcnt;  /* dropped packet counter */
+       u_int32_t               qlength;
+       u_int32_t               qlimit;
+       u_int32_t               period;
+       struct pktcntr          xmitcnt;  /* transmitted packet counter */
+       struct pktcntr          dropcnt;  /* dropped packet counter */
 
        /* RED, RIO, BLUE, SFB related info */
 
        /* RED, RIO, BLUE, SFB related info */
-       classq_type_t           qtype;
+       classq_type_t           qtype;
        union {
                /* RIO has 3 red stats */
        union {
                /* RIO has 3 red stats */
-               struct red_stats        red[RIO_NDROPPREC];
-               struct blue_stats       blue;
-               struct sfb_stats        sfb;
+               struct red_stats        red[RIO_NDROPPREC];
+               struct blue_stats       blue;
+               struct sfb_stats        sfb;
        };
        };
-       classq_state_t          qstate;
+       classq_state_t          qstate;
 };
 
 #ifdef BSD_KERNEL_PRIVATE
 struct tcq_class {
 };
 
 #ifdef BSD_KERNEL_PRIVATE
 struct tcq_class {
-       u_int32_t       cl_handle;      /* class handle */
-       class_queue_t   cl_q;           /* class queue structure */
-       u_int32_t       cl_qflags;      /* class queue flags */
+       u_int32_t       cl_handle;      /* class handle */
+       class_queue_t   cl_q;           /* class queue structure */
+       u_int32_t       cl_qflags;      /* class queue flags */
        union {
        union {
-               void            *ptr;
-               struct sfb      *sfb;   /* SFB state */
+               void            *ptr;
+               struct sfb      *sfb;   /* SFB state */
        } cl_qalg;
        } cl_qalg;
-       int32_t         cl_pri;         /* priority */
-       u_int32_t       cl_flags;       /* class flags */
-       struct tcq_if   *cl_tif;        /* back pointer to tif */
+       int32_t         cl_pri;         /* priority */
+       u_int32_t       cl_flags;       /* class flags */
+       struct tcq_if   *cl_tif;        /* back pointer to tif */
 
        /* statistics */
 
        /* statistics */
-       u_int32_t       cl_period;      /* backlog period */
-       struct pktcntr  cl_xmitcnt;     /* transmitted packet counter */
-       struct pktcntr  cl_dropcnt;     /* dropped packet counter */
+       u_int32_t       cl_period;      /* backlog period */
+       struct pktcntr  cl_xmitcnt;     /* transmitted packet counter */
+       struct pktcntr  cl_dropcnt;     /* dropped packet counter */
 };
 
 };
 
-#define        cl_sfb  cl_qalg.sfb
+#define cl_sfb  cl_qalg.sfb
 
 /*
  * tcq interface state
  */
 struct tcq_if {
 
 /*
  * tcq interface state
  */
 struct tcq_if {
-       struct ifclassq         *tif_ifq;       /* backpointer to ifclassq */
-       int                     tif_maxpri;     /* max priority in use */
-       u_int32_t               tif_throttle;   /* throttling level */
-       struct tcq_class        *tif_default;   /* default class */
-       struct tcq_class        *tif_classes[TCQ_MAXPRI]; /* classes */
+       struct ifclassq         *tif_ifq;       /* backpointer to ifclassq */
+       int                     tif_maxpri;     /* max priority in use */
+       u_int32_t               tif_throttle;   /* throttling level */
+       struct tcq_class        *tif_default;   /* default class */
+       struct tcq_class        *tif_classes[TCQ_MAXPRI]; /* classes */
 };
 
 };
 
-#define        TCQIF_IFP(_tif)         ((_tif)->tif_ifq->ifcq_ifp)
+#define TCQIF_IFP(_tif)         ((_tif)->tif_ifq->ifcq_ifp)
 
 struct if_ifclassq_stats;
 
 
 struct if_ifclassq_stats;