]> git.saurik.com Git - apple/xnu.git/blobdiff - bsd/netat/adsp_Open.c
xnu-792.24.17.tar.gz
[apple/xnu.git] / bsd / netat / adsp_Open.c
index f68b624e3fac0d63eb738d189b2756c2e7277371..d73e2ee94f0c40dabf2a22236e7efb5512b5a502 100644 (file)
@@ -47,6 +47,7 @@
 #include <netat/adsp.h>
 #include <netat/adsp_internal.h>
 
+extern atlock_t adspgen_lock;
 
 /*
  * NextCID
  */
 unsigned short NextCID()
 {
+       int s;
        unsigned short num;
        register CCB *queue;
 
        while (1) {
+           ATDISABLE(s, adspgen_lock);         /* Disable interrupts */
            num = ++adspGlobal.lastCID;
            /* qfind_w below is in 68K assembly */
            /* point to the first element */
@@ -74,6 +77,7 @@ unsigned short NextCID()
                        break;
                    queue = queue->ccbLink;
            }
+           ATENABLE(s, adspgen_lock);
            if (queue == (CCBPtr)NULL)
                break;  
        }
@@ -237,7 +241,7 @@ int adspOpen(sp, pb)                /* (DSPPBPtr pb) */
     if (ocMode == ocEstablish) { /* Only set these if establish mode */
        sp->recvSeq = pb->u.openParams.recvSeq;
        sp->attnRecvSeq = pb->u.openParams.attnRecvSeq;
-       UAS_ASSIGN_HTON(sp->f.CID, sp->locCID); /* Preset the CID in the ADSP header */
+       UAS_ASSIGN(sp->f.CID, sp->locCID); /* Preset the CID in the ADSP header */
        /* This is done elsewhere for all other modes */
        InsertTimerElem(&adspGlobal.slowTimers, &sp->ProbeTimer, 
                        sp->probeInterval);