]> git.saurik.com Git - apple/xnu.git/blobdiff - bsd/netat/adsp_stream.c
xnu-517.3.15.tar.gz
[apple/xnu.git] / bsd / netat / adsp_stream.c
index 8dd2ec37434efa34f6660506bada4eda145a01a1..2eea18fd428c1dbc37b9474dc7357da66aeecb75 100644 (file)
@@ -3,19 +3,22 @@
  *
  * @APPLE_LICENSE_HEADER_START@
  * 
- * The contents of this file constitute Original Code as defined in and
- * are subject to the Apple Public Source License Version 1.1 (the
- * "License").  You may not use this file except in compliance with the
- * License.  Please obtain a copy of the License at
- * http://www.apple.com/publicsource and read it before using this file.
+ * Copyright (c) 1999-2003 Apple Computer, Inc.  All Rights Reserved.
  * 
- * This Original Code and all software distributed under the License are
- * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER
+ * This file contains Original Code and/or Modifications of Original Code
+ * as defined in and that are subject to the Apple Public Source License
+ * Version 2.0 (the 'License'). You may not use this file except in
+ * compliance with the License. Please obtain a copy of the License at
+ * http://www.opensource.apple.com/apsl/ and read it before using this
+ * file.
+ * 
+ * The Original Code and all software distributed under the License are
+ * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
  * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
  * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT.  Please see the
- * License for the specific language governing rights and limitations
- * under the License.
+ * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
+ * Please see the License for the specific language governing rights and
+ * limitations under the License.
  * 
  * @APPLE_LICENSE_HEADER_END@
  */
@@ -339,7 +342,12 @@ int adsp_wput(gref, mp)
        int s;
        gbuf_t *xm;
        ioc_t *iocbp;
-       CCBPtr sp = (CCBPtr)gbuf_rptr(((gbuf_t *)gref->info));
+       CCBPtr sp;
+       
+       if (gref->info)
+               sp = (CCBPtr)gbuf_rptr(((gbuf_t *)gref->info));
+       else
+               sp = 0;
 
        if (gbuf_type(mp) == MSG_IOCTL) {
                iocbp = (ioc_t *)gbuf_rptr(mp);
@@ -419,7 +427,7 @@ int adsp_wput(gref, mp)
                case DDP_IOC_GET_CFG:
                        /* respond to an DDP_IOC_GET_CFG sent on an adsp fd */
                        if (((xm = gbuf_cont(mp)) == NULL) &&
-                           (xm = gbuf_alloc(sizeof(at_inet_t), PRI_MED)) == NULL) {
+                           (xm = gbuf_alloc(sizeof(ddp_addr_t), PRI_MED)) == NULL) {
                            iocbp->ioc_rval = -1;
                            adsp_iocnak(gref, mp, ENOBUFS);
                            return 0;
@@ -535,7 +543,7 @@ adspAssignSocket(gref, flag)
        int s;
 
        sMax = flag ? DDP_SOCKET_LAST-46 : DDP_SOCKET_LAST-6;
-       sMin = DDP_SOCKET_1st_DYNAMIC-64;
+       sMin = DDP_SOCKET_1st_DYNAMIC;
 
        ATDISABLE(s, adspall_lock);
        for (inputC=255, sVal=sMax; sVal >= sMin; sVal--) {