X-Git-Url: https://git.saurik.com/apple/xnu.git/blobdiff_plain/378393581903b274cb7a4d18e0d978071a6b592d..e2fac8b15b12a7979f72090454d850e612fc5b13:/bsd/netat/atp.h diff --git a/bsd/netat/atp.h b/bsd/netat/atp.h index 421c265f0..dda3669a9 100644 --- a/bsd/netat/atp.h +++ b/bsd/netat/atp.h @@ -1,23 +1,29 @@ /* * Copyright (c) 2000 Apple Computer, Inc. All rights reserved. * - * @APPLE_LICENSE_HEADER_START@ + * @APPLE_OSREFERENCE_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. + * 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. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. * - * This Original Code and all software distributed under the License are - * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * 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@ + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ */ /* * @@ -79,13 +85,22 @@ #define ATP_XO_8MIN 4 typedef struct { +#if BYTE_ORDER == BIG_ENDIAN unsigned cmd : 2, xo : 1, eom : 1, sts : 1, xo_relt : 3; +#endif +#if BYTE_ORDER == LITTLE_ENDIAN + unsigned xo_relt : 3, + sts : 1, + eom : 1, + xo : 1, + cmd : 2; +#endif u_char bitmap; - ua_short tid; + ua_short tid; ua_long user_bytes; u_char data[ATP_DATA_SIZE]; } at_atp_t; @@ -290,6 +305,9 @@ struct atp_socket { * transaction control block (local context at requester end) */ +struct atp_trans; +typedef void (*atp_tmo_func)(struct atp_trans *); + struct atp_trans { struct atp_trans_q tr_list; /* trans list */ struct atp_state *tr_queue; /* state data structure */ @@ -311,7 +329,7 @@ struct atp_trans { at_net tr_local_net; gbuf_t *tr_bdsp; /* bds structure pointer */ unsigned int tr_tmo_delta; - void (*tr_tmo_func)(); + atp_tmo_func tr_tmo_func; struct atp_trans *tr_tmo_next; struct atp_trans *tr_tmo_prev; atlock_t tr_lock; @@ -419,14 +437,13 @@ extern struct atp_rcb* atp_rcb_data; extern struct atp_state* atp_state_data; extern struct atp_trans_qhead atp_trans_abort; /* aborting trans list */ -extern void atp_req_timeout(); -extern void atp_rcb_timer(); -extern void atp_x_done(); -extern struct atp_rcb *atp_rcb_alloc(); -extern struct atp_trans *atp_trans_alloc(); #endif /* ATP_DECLARE */ /* prototypes */ +void atp_rcb_timer(struct atp_trans *); +struct atp_rcb *atp_rcb_alloc(struct atp_state *); +struct atp_trans *atp_trans_alloc(struct atp_state *); + void atp_send_req(gref_t *, gbuf_t *); void atp_drop_req(gref_t *, gbuf_t *); void atp_send_rsp(gref_t *, gbuf_t *, int); @@ -449,13 +466,18 @@ void atp_reply(struct atp_rcb *); void atp_rcb_free(struct atp_rcb *); void atp_send_replies(struct atp_state *, struct atp_rcb *); void atp_dequeue_atp(struct atp_state *); -int atp_iocack(struct atp_state *, gbuf_t *); +void atp_iocack(struct atp_state *, gbuf_t *); void atp_req_ind(struct atp_state *, gbuf_t *); -int atp_iocnak(struct atp_state *, gbuf_t *, int); +void atp_iocnak(struct atp_state *, gbuf_t *, int); void atp_trp_timer(void *, int); -void atp_timout(void (*func)(), struct atp_trans *, int); -void atp_untimout(void (*func)(), struct atp_trans *); +void atp_timout(atp_tmo_func, struct atp_trans *, int); +void atp_untimout(atp_tmo_func, struct atp_trans *); int atp_tid(struct atp_state *); +void atp_init(void); +void atp_link(void); +void atp_unlink(void); +int atp_input(gbuf_t *); +void atp_delete_free_clusters(void *); #endif /* KERNEL_PRIVATE */ #endif /* __APPLE_API_OBSOLETE */