00001 #ifndef ioc_routines_h
00002 #define ioc_routines_h
00003
00004
00005 #include <acbdef.h>
00006 #include <adpdef.h>
00007 #include <busarraydef.h>
00008 #include <ccbdef.h>
00009 #include <cdrpdef.h>
00010 #include <config_table.h>
00011 #include <crabdef.h>
00012 #include <cramdef.h>
00013 #include <crctxdef.h>
00014 #include <crbdef.h>
00015 #include <ddbdef.h>
00016 #include <ddtdef.h>
00017 #include <diobmdef.h>
00018 #include <dptdef.h>
00019 #include <dtndef.h>
00020 #include <far_pointers.h>
00021 #include <fdtdef.h>
00022 #include <idbdef.h>
00023 #include <irpdef.h>
00024 #include <iosbdef.h>
00025 #include <kpbdef.h>
00026 #include <mtldef.h>
00027 #include <pcbdef.h>
00028 #include <ptedef.h>
00029 #include <sbdef.h>
00030 #include <scqdef.h>
00031 #include <ucbdef.h>
00032 #include <wcbdef.h>
00033 #include <scsidef.h>
00034 #include <wwiddef.h>
00035
00036 int ioc_add_adp (struct _adp *parent_adp, struct _adp *new_adp, int ba_index);
00037 int ioc_add_device_type (const char *, const int32, struct _ucb *, struct _dtn **);
00038 int ioc_allocate_ccb (int16 *chan_p, struct _ccb **ccb_p);
00039 int ioc_allocate_cram (struct _cram **cram_p, struct _idb *idb, struct _ucb *ucb, struct _adp *adp);
00040 int ioc_alloc_adp (long long *adp, int adptype, int hose, int bustype, int nodecount);
00041 int ioc_alloc_cnt_res (struct _crab *crab, struct _crctx *crctx, long long cntxt1, long long cntxt2, long long cntxt3);
00042 int ioc_alloc_crab (int itemcnt, int gran, struct _crab **crab_p);
00043 int ioc_alloc_crctx (struct _crab *crab, struct _crctx **crctx_p, int flck);
00044 void ioc_std_altreqcom (int iost1, int iost2, struct _cdrp *cdrp,
00045 struct _irp **irp_p, struct _ucb **ucb_p);
00046 int ioc_std_ascwwid_to_binwwid(char *strptr, int len, char *result, int *reslen);
00047 int ioc_std_binwwid_to_ascwwid(struct _wwid *wwid_ptr, char *wwid_string, int inlen, int *retlen);
00048 int ioc_std_broadcast (int msglen, void *msg_p, struct _ucb *ucb);
00049 void ioc_std_bufpost (struct _pcb *pcb, struct _irp *irp);
00050 void ioc_std_cancelio (int chan, struct _irp *irp, struct _pcb *pcb, struct _ucb *ucb);
00051 int ioc_cancel_cnt_res (struct _crab *crab, struct _crctx *crctx, int resume);
00052 int ioc_cancel_cnt_res_nosync (struct _crab *crab, struct _crctx *crctx, int resume);
00053 int ioc_change_device_type (const char *, const int32, struct _ucb *, struct _dtn **);
00054 int ioc_chan_to_ccb (int16 chan, struct _ccb **ccb_p);
00055 int ioc_std_check_hwm (struct _irp *irp);
00056 int ioc_std_chkmbxquota (struct _pcb *pcb, struct _ucb *ucb, int quo);
00057 int ioc_std_chkucbquota (struct _pcb *pcb, struct _ucb *ucb);
00058 int ioc_std_clone_ucb (struct _ucb *tmpl_ucb, struct _ucb **new_ucb);
00059 void ioc_std_closebufwind (struct _ucb *ucb);
00060 int ioc_std_conbrdcst (int msglen, void *msg_p);
00061 int ioc_std_copy_ucb (struct _ucb *src_ucb, struct _ucb **new_ucb);
00062 int ioc_cram_cmd (int cmdidx, int byteoffset, struct _adp *adp, struct _cram *cram,
00063 unsigned long long *iohandle);
00064 int ioc_cram_io (struct _cram *cram);
00065 int ioc_cram_queue (struct _cram *cram);
00066 int ioc_cram_wait (struct _cram *cram);
00067 int ioc_create_ccb_table (int num_chan);
00068 int ioc_std_create_diobm (const struct _pte_PQ va_pte, const uint32 pte_count,
00069 const uint32 flags,
00070 struct _pte **svapte_p, struct _diobm **diobm_p);
00071 int ioc_std_create_ucb (struct _pcb *pcb, struct _ucb *ucb, struct _ucb **new_ucb_p);
00072 void ioc_std_credit_ucb (struct _ucb *ucb);
00073 int ioc_ctrl_init (struct _crb *crb, struct _ddb *ddb);
00074 void ioc_std_cvtlogphy (int lbn, struct _irp *irp, struct _ucb *ucb);
00075 int ioc_std_cvt_devnam (int buflen, char *buf, int form, struct _ucb *ucb,
00076 int32 *outlen_p );
00077 int ioc_std_dalloc_dev (struct _pcb *pcb, struct _ucb *ucb);
00078 int ioc_std_dalloc_dmt (struct _pcb *pcb, struct _ucb *ucb);
00079 void ioc_std_ddt_cancel_intercept (int chan, struct _irp *irp, struct _pcb *pcb, struct _ucb *ucb, int reason);
00080 int ioc_deallocate_ccb (struct _ccb *ccb);
00081 int ioc_deallocate_cram (struct _cram *cram);
00082 int ioc_dealloc_cnt_res (struct _crab *crab, struct _crctx *crctx);
00083 int ioc_dealloc_cnt_res_nosync (struct _crab *crab, struct _crctx *crctx);
00084 int ioc_dealloc_crab (struct _crab *crab);
00085 int ioc_dealloc_crctx (struct _crctx *crctx);
00086 void ioc_std_debit_ucb (struct _ucb *ucb, struct _pcb *pcb);
00087 void ioc_std_delete_ucb (struct _ucb *ucb);
00088 void ioc_std_diagbufill (int driver_param, struct _ucb *ucb);
00089 int ioc_std_dismount (int flags, struct _pcb *pcb, struct _mtl *mtl);
00090 int ioc_std_errcnt_value (struct _ucb *ucb);
00091 int ioc_std_fill_diobm (struct _diobm *const diobm, const struct _pte_PQ va_pte,
00092 const uint32 pte_count, const uint32 flags,
00093 struct _pte **svapte_p);
00094 void *ioc_std_filspt (struct _ucb *ucb);
00095 void ioc_std_free_ucb (struct _ucb *ucb);
00096 int ioc_std_getbyte (void *sva, struct _ucb *ucb, void **sva_p);
00097 int ioc_get_device_type (struct _ucb *, struct _dtn **);
00098 int ioc_get_page80_wwid (struct _inquiry_data *inq_data, struct _page80 *pg80_data,
00099 struct _sn_wwid *wwid);
00100 int ioc_get_page83_wwid (struct _page83 *pg83_data, struct _wwid *wwid);
00101 int ioc_get_udid (struct _devid *devid_data, int *udid_p);
00102 void ioc_std_hwm_end (struct _pcb *pcb, struct _irp *irp);
00103 void *ioc_std_initbufwind (struct _ucb *ucb);
00104 int ioc_init_cram (struct _adp *adp, struct _cram *cram);
00105 int ioc_init_crctx (struct _crab *crab, struct _crctx *crctx, int flck);
00106 void ioc_std_initiate (struct _irp *irp, struct _ucb *ucb);
00107 void ioc_std_initiate_lck_rel (struct _irp *irp, struct _ucb *ucb);
00108 void ioc_std_initiate_new_io (struct _irp *irp, struct _ucb *ucb);
00109 int ioc_kp_reqchan (struct _kpb *kpb, int pri);
00110 int ioc_kp_wfikpch (struct _kpb *kpb, int tmo, int newipl);
00111 int ioc_kp_wfirlch (struct _kpb *kpb, int tmo, int newipl);
00112 void ioc_std_last_chan (int chan, struct _pcb *pcb, struct _ucb *ucb);
00113 void ioc_std_last_chan_ambx (struct _pcb *pcb, struct _ucb *ucb);
00114 int ioc_std_link_ucb (struct _ucb *ucb);
00115 int ioc_load_map (struct _adp *adp, struct _crctx *crctx, struct _pte *svapte, int boff,
00116 void **dma_addr_p);
00117 int ioc_std_lock_dev (int lockmode, void *lock_val_p, struct _pcb *pcb, struct _ucb *ucb,
00118 int32 *lockid_p);
00119 int ioc_map_io (struct _adp *adp, int node, unsigned long long *phys_offset, int num_bytes,
00120 int attr, unsigned long long *iohandle);
00121 int ioc_std_mapvblk (unsigned int vbn, unsigned int numbytes,
00122 struct _wcb *wcb, struct _irp *irp, struct _ucb *ucb,
00123 uint32 *lbn_p, uint32 *notmapped_p, struct _ucb **new_ucb_p);
00124 void ioc_std_mntver (struct _irp *irp, struct _ucb *ucb);
00125 void *ioc_std_movfruser (void *sysbuf, int numbytes, struct _ucb *ucb, void **sysbuf_p);
00126 void *ioc_std_movfruser1 (void *sysbuf, int numbytes, struct _ucb *ucb, void *sva, void **sysbuf_p);
00127 void *ioc_std_movfruser2 (void *sysbuf, int numbytes, struct _ucb *ucb, void *sva, void **sysbuf_p);
00128 void *ioc_std_movtouser (void *sysbuf, int numbytes, struct _ucb *ucb, void **sysbuf_p);
00129 void *ioc_std_movtouser1 (void *sysbuf, int numbytes, struct _ucb *ucb, void *sva, void **sysbuf_p);
00130 void *ioc_std_movtouser2 (void *sysbuf, int numbytes, struct _ucb *ucb, void *sva, void **sysbuf_p);
00131 int ioc_node_data (struct _crb *crb, int func, void *buf_p);
00132 int ioc_node_function (struct _crb *crb, int func, ...);
00133 int ioc_std_opcnt_value (struct _ucb *ucb);
00134 int ioc_std_parsdevnam (int devnamlen, char *devnam, int flags,
00135 int32 *unit_p, int32 *scslen_p, int32 *devnamlen_p,
00136 char **devnam_p, int32 *flags_p);
00137 void ioc_std_post_irp (struct _irp *irp);
00138 int ioc_std_pre_simreqcom (int pri, int efn, struct _acb *acb);
00139 int ioc_std_primitive_reqchanh (struct _irp *irp, struct _ucb *ucb, struct _idb **idb_p);
00140 int ioc_std_primitive_reqchanl (struct _irp *irp, struct _ucb *ucb, struct _idb **idb_p);
00141 void ioc_std_primitive_wfikpch (struct _irp *irp, long long fr4, struct _ucb *ucb,
00142 int tmo, int restore_ipl);
00143 void ioc_std_primitive_wfirlch (struct _irp *irp, long long fr4, struct _ucb *ucb,
00144 int tmo, int restore_ipl);
00145
00146 #ifdef __x86_64__
00147 int ioc_std_ptetopfn (struct _pte_PQ pte);
00148 #else
00149 int ioc_std_ptetopfn (struct _pte *pte);
00150 #endif
00151
00152
00153 void *ioc_std_putbyte (void *sva, char data, struct _ucb *ucb);
00154 int ioc_std_q_internal_irp(struct _irp *irp, struct _ucb *ucb, IOSB_PQ iosb, VOID_PQ mbz);
00155 void ioc_std_qnxtseg (struct _irp *irp, struct _pcb *pcb, struct _ucb *ucb, struct _ucb **ucb_p);
00156 void ioc_std_qnxtseg1 (int vbn, int bcnt, struct _wcb *wcb,
00157 struct _irp *irp, struct _pcb *pcb, struct _ucb *ucb, struct _ucb **ucb_p);
00158 int ioc_read_io (struct _adp *adp, unsigned long long *iohandle, int offset,
00159 int length, void *data_p);
00160 int ioc_read_pci_config (struct _adp *adp, int pci_node, int offset,
00161 int length, int *data_p);
00162 int ioc_reallocate_ccb (int16 chan, struct _ccb **ccb_p);
00163 void ioc_std_relchan (struct _ucb *ucb);
00164 int ioc_std_release_diobm (struct _diobm *const diobm);
00165 int ioc_remove_device_type (struct _ucb *ucb);
00166 void ioc_std_reqcom (int iost1, int iost2, struct _ucb *ucb);
00167 void ioc_std_reqcom_local (struct _cdrp *cdrp);
00168 int ioc_reserve_scb (int count, int min_vec, int max_vec, int align,
00169 int32 *resvec_p);
00170 void ioc_return (void);
00171 int ioc_return_success (void);
00172 int ioc_return_unsupported (void);
00173 int ioc_scan_ccb (int32 **context_p, struct _ccb **ccb_p);
00174 int ioc_std_scan_iodb (struct _ucb *ucb, struct _ddb *ddb, struct _ucb **ucb_p, struct _ddb **ddb_p);
00175 int ioc_std_scan_iodb_2p (int path, struct _ucb *ucb, struct _ddb *ddb,
00176 int32 *path_p, struct _ucb **ucb_p, struct _ddb **ddb_p);
00177 int ioc_std_scan_iodb_usrctx (int ctx, int unit, struct _ucb *ucb, struct _ddb *ddb,
00178 int32 *ctx_p, int32 *unit_p, struct _ucb **ucb_p, struct _ddb **ddb_p);
00179 int ioc_scsipath_connect (struct _scq *scq);
00180 int ioc_std_search (VOID_PQ descr_p, int flags, void *lock_val_p,
00181 struct _ucb **ucb_p, struct _ddb **ddb_p, struct _sb **sb_p);
00182 int ioc_std_searchall (VOID_PQ descr_p, struct _ucb **ucb_p, struct _ddb **ddb_p, struct _sb **sb_p);
00183 int ioc_std_searchcont (int unit, int scslen, struct _ucb *ucb, struct _ddb *ddb, struct _sb *sb,
00184 int devnamlen, char *devnam, int flags,
00185 struct _ucb **ucb_p, struct _ddb **ddb_p, struct _sb **sb_p, void **lock_val_p);
00186 int ioc_std_searchdev (VOID_PQ descr_p, struct _ucb **ucb_p, struct _ddb **ddb_p, struct _sb **sb_p);
00187 int ioc_std_searchint (int unit, int scslen, int devnamlen, char *devnam,
00188 int flags, struct _ucb **ucb_p, struct _ddb **ddb_p, struct _sb **sb_p,
00189 void **lock_val_p);
00190 int ioc_search_device_type (const char *, const int32, struct _dtn **);
00191 int ioc_std_sensedisk (struct _irp *irp, struct _pcb *pcb, struct _ucb *ucb, struct _ccb *ccb);
00192 void ioc_setup_ucb_dipl (struct _ucb *ucb);
00193 void ioc_std_sever_ucb (struct _ucb *ucb);
00194 int ioc_std_simreqcom (VOID_PQ iosb, int pri, int efn, int32 iost[2],
00195 struct _acb *acb, int acmode);
00196 int ioc_sndopcfao (unsigned int opc_msg_code, unsigned int opc_class_mask, ... );
00197 long long ioc_sva_to_pa (void *svapte, long long *pa, int buflen, int32 *retlen_p);
00198 int ioc_std_svapte_in_buf (struct _irp *irp, VOID_PQ va, struct _pte **svapte_p);
00199 long long ioc_svapte_to_pa (void *svapte, int boff, long long *pa, int buflen,
00200 int32 *retlen_p, void **nxtsvapte_p);
00201 int ioc_std_testunit (int unit, int devtype, struct _ucb *ucb, int flags,
00202 void *lock_val_p, struct _ucb **ucb_p, int32 *flags_p);
00203 void ioc_std_threadcrb (struct _crb *crb);
00204 int ioc_std_trandevnam (VOID_PQ descr_p, int flags, char *buf,
00205 int32 *outlen, void **out_p);
00206 struct _adp *ioc_tr_to_adp (int tr);
00207 int ioc_unit_init (struct _ucb *ucb);
00208 int ioc_std_unlock_dev (struct _ucb *ucb);
00209 int ioc_unmap_io (struct _adp *adp, unsigned long long *iohandle);
00210 int ioc_unreserve_scb (int count, int32 vector_list[]);
00211 int ioc_std_update_dev_wwid_list (struct _wwid *wwid_ptr, char *devnam);
00212 VOID_PQ ioc_std_va_to_pa (VOID_PQ va, VOID_PPQ pa_p);
00213 int ioc_verify_chan (unsigned short int chan, struct _ccb **ccb_p);
00214 void ioc_std_wakacp (struct _ucb *ucb, struct _irp *irp);
00215 int ioc_write_io (struct _adp *adp, unsigned long long *iohandle, int offset,
00216 int length, void *data_p);
00217 int ioc_write_pci_config (struct _adp *adp, int pci_node, int offset,
00218 int length, int wdata);
00219 int ioc_std_getsyi_cpu_specific (int getsyi_code, unsigned char *buffer,
00220 int *buffer_length);
00221
00222 void ioc_reqcom(int iosb1, int iosb2, struct _ucb * u);
00223 ioc_bufpost(struct _irp * i);
00224 void ioc_initiate(struct _irp * i, struct _ucb * u);
00225 extern int ioc_searchdev(struct return_values *r, void * devnam);
00226 int ioc_search(struct return_values *r, void * devnam);
00227 int ioc_ffchan(unsigned short int *chan);
00228 int ioc_verify_chan(unsigned short int chan, struct _ccb ** ccbp);
00229 int ioc_scan_iodb_usrctx(struct _ddb **d);
00230 void ioc_wfikpch(void * nextfunc, void * timeoutfunc, struct _irp * i, unsigned long fr4, struct _ucb * u, int timeout, int oldipl);
00231 int ioc_std_clone_mscp_ucb (struct _ucb *tmpl_ucb, struct _ucb **new_ucb);
00232 int ioc_delete_ucb();
00233
00234 #endif
00235
00236