xnu-1228.tar.gz
[apple/xnu.git] / bsd / netat / adsp_Packet.c
index 41f13cd65bd6ac404132d4adc6729bf8a9a349c0..c73d82e581206368b9b77bd76c1c142e23bf9e9a 100644 (file)
@@ -73,6 +73,8 @@ extern at_ifaddr_t *ifID_home;
  * OUTPUTS:
  *    none
  */
+static void GleanSession(CCBPtr);
+
 static void GleanSession(sp)           /* (CCBPtr sp) */
     CCBPtr sp;
 {
@@ -398,6 +400,7 @@ typedef struct {
  * request/ack/req+ack/deny packet.
  *
  */
+static boolean MatchStream(CCBPtr, MATCHPtr);
 
 static boolean
 MatchStream(sp, m)             /* (CCBPtr sp, MATCHPtr m) */
@@ -502,6 +505,8 @@ MatchStream(sp, m)          /* (CCBPtr sp, MATCHPtr m) */
  *
  */
 
+static boolean MatchListener(CCBPtr, MATCHPtr);
+
 static boolean MatchListener(sp, m) /* (CCBPtr sp, MATCHPtr m) */
     CCBPtr sp;
     MATCHPtr m;
@@ -531,14 +536,13 @@ static boolean MatchListener(sp, m) /* (CCBPtr sp, MATCHPtr m) */
  * OUTPUTS:
  *    Returns 1 if packet was ignored
  */
-static int RXConnection(gref, spPtr, f, len, addr, dsoc) 
-    /* (CCBPtr *spPtr, ADSP_FRAMEPtr f, word len, AddrUnion addr, byte dsoc) */
-    gref_t *gref;                      /* READ queue */
-    CCBPtr *spPtr;
-    ADSP_FRAMEPtr f;
-    int len;
-    AddrUnion addr;
-    unsigned char dsoc;
+static int RXConnection(
+    __unused gref_t *gref,                     /* READ queue */
+    CCBPtr *spPtr,
+    ADSP_FRAMEPtr f,
+    int len,
+    AddrUnion addr,
+    unsigned char dsoc)
 {
     CCBPtr sp;
     ADSP_OPEN_DATAPtr op;
@@ -588,7 +592,7 @@ static int RXConnection(gref, spPtr, f, len, addr, dsoc)
     /*
      * See if we can find a stream that knows what to do with this packet
      */
-    if ((sp = (CCBPtr)qfind_m(AT_ADSP_STREAMS, &m, (ProcPtr)MatchStream)) == 0)
+    if ((sp = (CCBPtr)qfind_m((CCB *)AT_ADSP_STREAMS, &m, (ProcPtr)MatchStream)) == 0)
     {
        struct adspcmd *p;
        struct adspcmd *n;
@@ -599,12 +603,12 @@ static int RXConnection(gref, spPtr, f, len, addr, dsoc)
        if ((f->descriptor & ADSP_CONTROL_MASK) != (byte)ADSP_CTL_OREQ)
            return 1;
 
-       if ((sp = (CCBPtr)qfind_m(AT_ADSP_STREAMS, &m, 
+       if ((sp = (CCBPtr)qfind_m((CCB *)AT_ADSP_STREAMS, &m, 
                                  (ProcPtr)MatchListener)) == 0)
            return 1;
 
        p = (struct adspcmd *)&sp->opb;
-       while (n = (struct adspcmd *)p->qLink) /* Hunt down list of listens */
+       while ((n = (struct adspcmd *)p->qLink)) /* Hunt down list of listens */
        {
            /* Check address filter */
            if (((n->u.openParams.filterAddress.net == 0) ||
@@ -675,7 +679,7 @@ static int RXConnection(gref, spPtr, f, len, addr, dsoc)
     if (m.t->action & A_COMPLETE) { /* Need to complete open param blk */
         RemoveTimerElem(&adspGlobal.slowTimers, &sp->ProbeTimer);
                        
-       if (pb = sp->opb) {
+       if ((pb = sp->opb)) {
            sp->opb = 0;
            pb->u.openParams.localCID = sp->locCID;
            pb->u.openParams.remoteCID = sp->remCID;
@@ -747,7 +751,7 @@ int adspPacket(gref, mp)
 
     dsoc = ddp->ddpx_dest;
 
-    if (sp = (CCBPtr)FindSender(f, a))
+    if ((sp = (CCBPtr)FindSender(f, a)))
        GleanSession(sp);
 
     if (f->descriptor & ADSP_ATTENTION_BIT) { /* ATTN packet */
@@ -821,7 +825,7 @@ int adspPacket(gref, mp)
     if (mp)
        gbuf_freem(mp);
 
-checksend:                     /* incoming data was not ignored */
+       /* incoming data was not ignored */
     if (sp && sp->callSend)    /* If we have a stream & we need to send */
        CheckSend(sp);