]> git.saurik.com Git - apple/xnu.git/blobdiff - bsd/netat/atp_alloc.c
xnu-1699.32.7.tar.gz
[apple/xnu.git] / bsd / netat / atp_alloc.c
index 6ff87fe503f485f8d3ac89a747097603a990f1e4..cf9a4375c011727b04249432264e35b8df4da174 100644 (file)
@@ -1,5 +1,5 @@
 /*
 /*
- * Copyright (c) 2000 Apple Computer, Inc. All rights reserved.
+ * Copyright (c) 2000-2006 Apple Computer, Inc. All rights reserved.
  *
  * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
  * 
  *
  * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
  * 
@@ -58,7 +58,8 @@
 
 gbuf_t *atp_resource_m = 0;
 extern caddr_t atp_free_cluster_list;
 
 gbuf_t *atp_resource_m = 0;
 extern caddr_t atp_free_cluster_list;
-extern void atp_delete_free_clusters();
+extern struct atp_rcb_qhead atp_need_rel;
+
 
 struct atp_trans *atp_trans_alloc(atp)
 struct  atp_state *atp;
 
 struct atp_trans *atp_trans_alloc(atp)
 struct  atp_state *atp;
@@ -68,7 +69,8 @@ struct  atp_state *atp;
        register struct atp_trans *trp, *trp_array;
 
        if (atp_trans_free_list == 0) {
        register struct atp_trans *trp, *trp_array;
 
        if (atp_trans_free_list == 0) {
-               if ((m = gbuf_alloc(TRPS_PER_BLK*sizeof(struct atp_trans),PRI_HI)) == 0)
+               if ((m = gbuf_alloc_wait(TRPS_PER_BLK*sizeof(struct atp_trans),
+                   atp == NULL)) == 0)
                        return (struct atp_trans *)0;
                bzero(gbuf_rptr(m), TRPS_PER_BLK*sizeof(struct atp_trans));
                trp_array = (struct atp_trans *)gbuf_rptr(m);
                        return (struct atp_trans *)0;
                bzero(gbuf_rptr(m), TRPS_PER_BLK*sizeof(struct atp_trans));
                trp_array = (struct atp_trans *)gbuf_rptr(m);
@@ -156,8 +158,6 @@ register struct atp_rcb *rcbp;
        rcbp->rc_queue = 0;
 
        if (rcbp->rc_timestamp) {
        rcbp->rc_queue = 0;
 
        if (rcbp->rc_timestamp) {
-               extern struct atp_rcb_qhead atp_need_rel;
-
                rcbp->rc_timestamp = 0;
                ATP_Q_REMOVE(atp_need_rel, rcbp, rc_tlist);
                rcbp->rc_tlist.prev = NULL;
                rcbp->rc_timestamp = 0;
                ATP_Q_REMOVE(atp_need_rel, rcbp, rc_tlist);
                rcbp->rc_tlist.prev = NULL;
@@ -171,7 +171,7 @@ register struct atp_rcb *rcbp;
                        rcbp->rc_snd[i] = 0;
        }
        if (atp_free_cluster_list)
                        rcbp->rc_snd[i] = 0;
        }
        if (atp_free_cluster_list)
-               atp_delete_free_clusters();
+               atp_delete_free_clusters(NULL);
        if (rc_state != RCB_UNQUEUED) {
                if (rc_state == RCB_PENDING) {
                        ATP_Q_REMOVE(atp->atp_attached, rcbp, rc_list);
        if (rc_state != RCB_UNQUEUED) {
                if (rc_state == RCB_PENDING) {
                        ATP_Q_REMOVE(atp->atp_attached, rcbp, rc_list);