X-Git-Url: https://git.saurik.com/apple/xnu.git/blobdiff_plain/de355530ae67247cbd0da700edb3a2a1dae884c2..c0fea4742e91338fffdcf79f86a7c1d5e2b97eb1:/bsd/netat/adsp_RxData.c?ds=inline diff --git a/bsd/netat/adsp_RxData.c b/bsd/netat/adsp_RxData.c index 94d7f64d9..02d732044 100644 --- a/bsd/netat/adsp_RxData.c +++ b/bsd/netat/adsp_RxData.c @@ -107,20 +107,18 @@ void CheckRecvSeq(sp, f) /* (CCBPtr sp, ADSP_FRAMEPtr f) */ register CCBPtr sp; register ADSP_FRAMEPtr f; { - int s; int pktNextRecvSeq; int sendWdwSeq; int eom; int hlen; register gbuf_t *mp; - ATDISABLE(s, sp->lock); if (f->descriptor & ADSP_ACK_REQ_BIT) { /* He wants an Ack */ sp->sendDataAck = 1; sp->callSend = 1; } - pktNextRecvSeq = netdw(UAL_VALUE(f->pktNextRecvSeq)); /* Local copy */ + pktNextRecvSeq = UAL_VALUE_NTOH(f->pktNextRecvSeq); /* Local copy */ /* * Make sure the sequence number corresponds to reality -- i.e. for @@ -235,7 +233,7 @@ void CheckRecvSeq(sp, f) /* (CCBPtr sp, ADSP_FRAMEPtr f) */ sp->callSend = 1; noack: - sendWdwSeq = netw(UAS_VALUE(f->pktRecvWdw)) - 1 + pktNextRecvSeq; + sendWdwSeq = UAS_VALUE_NTOH(f->pktRecvWdw) - 1 + pktNextRecvSeq; if (GT(sendWdwSeq, sp->sendWdwSeq)) /* Don't make send window smaller */ { @@ -243,7 +241,6 @@ noack: /* if we can send more data */ sp->sendWdwSeq = sendWdwSeq; } - ATENABLE(s, sp->lock); } /* @@ -269,7 +266,7 @@ int RXData(sp, mp, f, len) /* (CCBPtr sp, ADSP_FRAMEPtr f, word len) */ ADSP_FRAMEPtr f; int len; { - int s, offset; + int offset; int PktFirstByteSeq; short cnt; char eom; @@ -287,14 +284,12 @@ int RXData(sp, mp, f, len) /* (CCBPtr sp, ADSP_FRAMEPtr f, word len) */ trace_mbufs(D_M_ADSP, " mp", mp); - PktFirstByteSeq = netdw(UAL_VALUE(f->pktFirstByteSeq)); /* Local copy */ + PktFirstByteSeq = UAL_VALUE_NTOH(f->pktFirstByteSeq); /* Local copy */ - ATDISABLE(s, sp->lock); if (GT(PktFirstByteSeq, sp->recvSeq)) /* missed a packet (out of order) */ { if (sp->badSeqCnt++ > sp->badSeqCnt) /* Need to send rexmit advice */ sp->sendCtl |= B_CTL_RETRANSMIT; - ATENABLE(s, sp->lock); CheckRecvSeq(sp, f); /* Will set send ACK flag if requested */ CheckReadQueue(sp); gbuf_freem(mp); @@ -307,7 +302,6 @@ int RXData(sp, mp, f, len) /* (CCBPtr sp, ADSP_FRAMEPtr f, word len) */ } if (LTE(PktFirstByteSeq + len + eom, sp->recvSeq)) { /* duplicate data? */ - ATENABLE(s, sp->lock); CheckRecvSeq(sp, f); /* Will set send ACK flag if requested */ CheckReadQueue(sp); gbuf_freem(mp); @@ -335,7 +329,7 @@ int RXData(sp, mp, f, len) /* (CCBPtr sp, ADSP_FRAMEPtr f, word len) */ { sp->rData = 1; /* Not empty any more */ - if ((sp->rpb)->ioc == mp) { + if ((sp->rpb)->ioc == (caddr_t)mp) { dPrintf(D_M_ADSP, D_L_TRACE, ("RXData: (pb->ioc == mp) no stored data\n")); KERNEL_DEBUG(DBG_ADSP_RCV, 4, sp, sp->rpb, 0, 0); @@ -382,7 +376,6 @@ int RXData(sp, mp, f, len) /* (CCBPtr sp, ADSP_FRAMEPtr f, word len) */ * doing anything that might take a long while */ - ATENABLE(s, sp->lock); CheckRecvSeq(sp, f); /* Will set send ACK flag if requested */ CheckReadQueue(sp); KERNEL_DEBUG(DBG_ADSP_RCV, 5, sp, sp->rbuf_mb, 0, 0);