Mac OS 9
OpenTransportKernel.h
Go to the documentation of this file.
1 
21 #ifndef __OPENTRANSPORTKERNEL__
22 #define __OPENTRANSPORTKERNEL__
23 
24 #ifdef OTKERNEL
25 #if !OTKERNEL
26 #error OpenTransportModule.h can only be used by kernel code.
27 #endif /* !OTKERNEL */
28 
29 #endif /* defined(OTKERNEL) */
30 
31 #define OTKERNEL 1
37 #ifndef __OPENTRANSPORTPROTOCOL__
38 #include <OpenTransportProtocol.h>
39 #endif
40 
41 #ifndef __NAMEREGISTRY__
42 #include <NameRegistry.h>
43 #endif
44 
45 #if PRAGMA_ONCE
46 #pragma once
47 #endif
48 
49 #ifdef __cplusplus
50 extern "C"
51 {
52 #endif
53 
54 #if PRAGMA_IMPORT
55 #pragma import on
56 #endif
57 
58 #if PRAGMA_STRUCT_ALIGN
59 #pragma options align = mac68k
60 #elif PRAGMA_STRUCT_PACKPUSH
61 #pragma pack(push, 2)
62 #elif PRAGMA_STRUCT_PACK
63 #pragma pack(2)
64 #endif
65 
66 #if defined(__MWERKS__) && TARGET_CPU_68K
67 #pragma push
68 #pragma pointers_in_D0
69 #endif
70 
71 /* ***** From the Mentat "mistream.h" ******/
72 
79 #define enableok(q) ((q)->q_flag &= ~QNOENB)
80 
82 #define noenable(q) ((q)->q_flag |= QNOENB)
83 
85 #define OTHERQ(q) (((q)->q_flag & QREADR) ? WR(q) : RD(q))
86 
88 #define RD(q) (&q[-1])
89 
91 #define WR(q) (&q[1])
92 
93 #if CALL_NOT_IN_CARBON
102  mblk_t *
103  allocb(OTByteCount size, OTInt32 pri);
104 
105 #endif /* CALL_NOT_IN_CARBON */
106 
107  typedef CALLBACK_API_C(void, allocbiProc)(char *arg);
108 #if CALL_NOT_IN_CARBON
117  mblk_t *
118  allocbi(OTByteCount size, OTInt32 pri, allocbiProc pfv, char *arg,
119  unsigned char *base);
120 
129  queue_t *
130  allocq(void);
131 
140  OTInt32
141  adjmsg(mblk_t *mp, OTInt32 len_param);
142 
151  queue_t *
153 
162  OTInt32
164 
173  OTInt32
175 
184  OTInt32
185  bufcall(OTByteCount memNeeded, OTInt32 pri, bufcallp_t proc, long context);
186 
195  OTInt32
197 
206  OTInt32
208 
217  mblk_t *
219 
228  mblk_t *
230 
239  mblk_t *
241 
250  mblk_t *
252 
261  mblk_t *
262  esballoc(unsigned char *base, OTByteCount size, OTInt32 pri, frtn_t *freeInfo);
263 
272  mblk_t *
273  esballoca(unsigned char *base, OTByteCount size, OTInt32 pri, frtn_t *freeInfo);
274 
275 #endif /* CALL_NOT_IN_CARBON */
276 
277  typedef CALLBACK_API_C(void, esbbcallProc)(long arg);
278 #if CALL_NOT_IN_CARBON
287  OTInt32
288  esbbcall(OTInt32 pri, esbbcallProc func, long arg);
289 
298  void
299  flushband(queue_t *q, OTUInt8Param pri, OTInt32 flag);
300 
309  void
310  flushq(queue_t *q, OTInt32 flag);
311 
320  void
322 
331  void
333 
342  OTInt32
344 
353  OTInt32
355 
364  admin_t
365  getadmin(OTUInt16Param mid);
366 
375  unsigned short
376  getmid(char *name);
377 
386  mblk_t *
388 
397  OTInt32
398  insq(queue_t *q, mblk_t *emp, mblk_t *nmp);
399 
408  void
409  linkb(mblk_t *mp1, mblk_t *mp2);
410 
411 #endif /* CALL_NOT_IN_CARBON */
412 
413  typedef CALLBACK_API_C(void, mpnotifyProc)(char *arg);
414 #if CALL_NOT_IN_CARBON
423  OTInt32
424  mpnotify(mblk_t *mp, mpnotifyProc pfv, char *arg);
425 
434  OTInt32
435  msgdsize(const mblk_t *mp);
436 
445  mblk_t *
446  msgpullup(mblk_t *mp, OTInt32 len);
447 
456  OTInt32
457  pullupmsg(mblk_t *mp, OTInt32 len);
458 
467  OTInt32
469 
478  OTInt32
480 
489  OTInt32
490  putctl(queue_t *q, OTInt32 mType);
491 
500  OTInt32
501  putnextctl(queue_t *q, OTInt32 mType);
502 
511  OTInt32
512  putctl1(queue_t *q, OTInt32 mType, OTInt32 c);
513 
522  OTInt32
523  putnextctl1(queue_t *q, OTInt32 mType, OTInt32 c);
524 
533  OTInt32
534  putctl2(queue_t *q, OTInt32 mType, OTInt32 c1, OTInt32 c2);
535 
536 #endif /* CALL_NOT_IN_CARBON */
537 
538 #ifndef puthere
539 #if CALL_NOT_IN_CARBON
548  OTInt32
550 
551 #endif /* CALL_NOT_IN_CARBON */
552 
553 #endif /* !defined(puthere) */
554 
555 #if CALL_NOT_IN_CARBON
564  OTInt32
566 
575  OTInt32
577 
578 #endif /* CALL_NOT_IN_CARBON */
579 
580 #if CALL_NOT_IN_CARBON
589  void
591 
600  void
602 
611  void
613 
622  OTInt32
624 
633  OTInt32
635 
644  mblk_t *
646 
655  void
657 
658  /* prototype for strlog in "strlog.h" section, below */
667  OTInt32
668  strqget(queue_t *q, qfields_t what, OTUInt8Param pri, long *valp);
669 
678  OTInt32
679  strqset(queue_t *q, qfields_t what, OTUInt8Param pri, long val);
680 
689  OTInt32
690  testb(OTByteCount size, OTInt32 pri);
691 
700  void
701  unbufcall(OTInt32 id);
702 
711  void
712  unfreezestr(queue_t *q, OTInt32 oldpri);
713 
722  mblk_t *
724 
725  /* ***** From the Mentat "strlog.h" ******/
726 
735  OTInt32
736  strlog(OTInt32 mid, OTInt32 sid, OTInt32 level, OTUInt32 flags, char *fmt, ...);
737 
738  /* ***** Printing Functions ******/
739 
740 #endif /* CALL_NOT_IN_CARBON */
741 
742  enum
743  {
744  kOTPrintOnly = 0,
745  kOTPrintThenStop = 1
746  };
747 
748 #if CALL_NOT_IN_CARBON
757  OTInt32
758  OTKernelPrintf(OTInt32 toDo, char *fmt, ...);
759 
760 #endif /* CALL_NOT_IN_CARBON */
761 
762  enum
763  {
764  CE_CONT = 0, /* Does kOTPrintOnly */
765  CE_NOTE = 0, /* Just print */
766  CE_WARN = 1, /* Does kOTPrintThenStop */
767  CE_PANIC = 2 /* Does System Error 107 */
768  };
769 
770 #if CALL_NOT_IN_CARBON
779  void
780  cmn_err(OTInt32 errType, char *fmt, ...);
781 
790  OTInt32
791  mi_sprintf(char *buf, char *fmt, ...);
792 
793  /* Create sprintf and printf functions that will work in STREAM modules.*/
794 
795 #define sprintf mi_sprintf
796 #define printf OTKernelPrintf
797 
798  /* ***** FIIK ******/
799 
800  /* ��� useful header comment please ���*/
801 
807 #endif /* CALL_NOT_IN_CARBON */
808 
809  typedef long OTError;
810 
811 #define GetEError(v) ((OTUnixErr)(((v) >> 16) & 0xffff))
812 #define GetXTIError(v) ((OTXTIErr)((v) & 0xffff))
813 #define MakeTPIEError(e) ((OTError)(((((UInt16)(e)) << 16) | TSYSERR)))
814 #define MakeDLPIEError(e) ((OTError)(((((UInt16)(e)) << 16) | DL_SYSERR)))
815 #define MakeXTIError(xti) ((OTError)(xti))
816 #define MakeOTError(xti, e) ((OTError)((xti) | ((UInt16)(e)) << 16))
817 
818 #if CALL_NOT_IN_CARBON
827  OSStatus
829 
830  /* ***** STREAMS Plug-in Interface *****/
831 
839 #endif /* CALL_NOT_IN_CARBON */
840 
841  enum
842  {
843  SQLVL_QUEUE = 1,
844  SQLVL_QUEUEPAIR = 2,
845  SQLVL_MODULE = 3,
846  SQLVL_GLOBAL = 4,
847  SQLVL_DEFAULT = 3
848  };
849 
850  /* The install_info structure.*/
851 
853  {
854  streamtab *install_str; /* Streamtab pointer. */
855  UInt32 install_flags;
856  UInt32 install_sqlvl; /* Synchronization level. */
857  char *install_buddy; /* Shared writer list buddy */
858  long ref_load; /* Set to 0 */
859  UInt32 ref_count; /* set to 0 */
860  };
861  typedef struct install_info install_info;
862  /* Flags used in the install_flags field*/
863  enum
864  {
865  kOTModIsDriver = 0x00000001,
866  kOTModIsModule = 0x00000002,
867  kOTModNoWriter = 0x00000010,
868  kOTModUpperIsTPI = 0x00001000,
869  kOTModUpperIsDLPI = 0x00002000,
870  kOTModLowerIsTPI = 0x00004000,
871  kOTModLowerIsDLPI = 0x00008000,
872  kOTModGlobalContext =
873  0x00800000, /* This flag says you don't want per-context globals*/
874  kOTModUsesInterrupts =
875  0x08000000, /* This flag is only valid if kOTModIsDriver is set and the
876  driver is a PCI-card driver using the Name Registry*/
877  kOTModIsComplexDriver =
878  0x20000000, /* This flag is only valid if kOTModIsDriver is set.*/
879  kOTModIsFilter =
880  0x40000000 /* This flag is only valid if kOTModIsModule is set.*/
881  };
882 
883  /* Typedef for the GetOTInstallInfo function*/
884 
890  typedef CALLBACK_API_C(install_info *, GetOTInstallInfoProcPtr)(void);
891  /* Typedef for the InitStreamModule function*/
903  typedef CALLBACK_API_C(Boolean, InitStreamModuleProcPtr)(void *portInfo);
904  /* Typedef for the TerminateStreamModule function*/
911  typedef CALLBACK_API_C(void, TerminateStreamModuleProcPtr)(void *portInfo);
912 /* Equates for shared library prefixes*/
913 
917 #define kOTModuleInterfaceID kOTModulePrefix "StrmMod"
918 
919  /* ***** Majors and Minors ******/
920 
921  /* Functions for dealing with major and minor device numbers*/
922 
923  typedef UInt16 major_t;
924  typedef UInt16 minor_t;
925 
926 /* major part of a device */
927 #define getmajor(x) ((major_t)(((unsigned long)(x) >> 16) & 0xffff))
928 
929 /* minor part of a device */
930 #define getminor(x) ((minor_t)((x) & 0xffff))
931 
932 /* make a device number */
933 #define makedev(x, y) ((dev_t)((((dev_t)(x)) << 16) | ((y) & 0xffff)))
934 
935 #define getemajor getmajor
936 #define geteminor getminor
937 #define makedevice makedev
938 
939 #define etoimajor(majnum) (majnum)
940 #define itoemajor(majnum, j) (majnum)
941 
948  enum
949  {
950  kFirstMinorNumber = 10
951  };
952 
953  /* ***** Logging Macros ******/
954 
955 #if CALL_NOT_IN_CARBON
964  void
965  OTStrlog(queue_t *q, OTInt32 lvl, OTInt32 flags, const char *str);
966 
967  /* These are enums for the level value*/
968 
969 #endif /* CALL_NOT_IN_CARBON */
970 
971  enum
972  {
973  kOTLvlFatal = 0,
974  kOTLvlNonfatal = 1,
975  kOTLvlExtFatal = 2,
976  kOTLvlExtNonfatal = 3,
977  kOTLvlUserErr = 4,
978  kOTLvlInfoErr = 5,
979  kOTLvlInfoOnly = 6
980  };
981 
982 #define STRLOG(q, lvl, flags, str) OTStrlog(q, lvl, flags, str)
983 
984 #if OTDEBUG
985 #define STRLOG1(q, lvl, flags, str) OTStrlog(q, lvl, flags, str)
986 #else
987 #define STRLOG1(q, lvl, flags, str)
988 #endif
989 
990 #if OTDEBUG > 1 || OTDEBUG > 1
991 #define STRLOG2(q, lvl, flags, str) OTStrlog(q, lvl, flags, str)
992 #else
993 #define STRLOG2(q, lvl, flags, str)
994 #endif
995 
996  /* ***** TPI Additions ******/
997 
1006  enum
1007  {
1008  T_TIMER_REQ = 80, /* Timer event */
1009  T_MIB_REQ = 81, /* Request module's MIB */
1010  T_MIB_ACK = 82, /* The module's MIB is available */
1011 
1012  T_PRIVATE_REQ = 90 /* The first private request available */
1013  };
1014 
1015  struct T_MIB_req
1016  {
1017  long PRIM_type; /* Always T_MIB_REQ */
1018  };
1019  typedef struct T_MIB_req T_MIB_req;
1020  struct T_MIB_ack
1021  {
1022  long PRIM_type; /* Always T_MIB_ACK */
1023  long MIB_length; /* MIB length */
1024  long MIB_offset; /* MIB Offset */
1025  };
1026  typedef struct T_MIB_ack T_MIB_ack;
1028  {
1029  long PRIM_type; /* Always T_TIMER_REQ */
1030  union
1031  {
1032  long USER_long;
1033  void *USER_ptr;
1034  } USER_data;
1035  };
1036  typedef struct T_stream_timer T_stream_timer;
1037  /* ***** Kernel Port Stuff ******/
1048  {
1049  OTLink fLink;
1050  char *fPortName;
1051  char *fModuleName;
1052  char *fResourceInfo;
1053  char *fSlotID;
1054  struct TPortRecord *fAlias;
1055  ItemCount fNumChildren;
1056  OTPortRef *fChildPorts;
1057  UInt32 fPortFlags;
1058  UInt32 fInfoFlags;
1059  UInt32 fCapabilities;
1060  OTPortRef fRef;
1061  streamtab *fStreamtab;
1062  void *fContext;
1063  void *fExtra;
1064  };
1065  typedef struct TPortRecord TPortRecord;
1066 /* Port utilities*/
1078 #if CALL_NOT_IN_CARBON
1087  OSStatus
1088  OTRegisterPort(OTPortRecord *portInfo, void *ref);
1089 
1105  OSStatus
1106  OTUnregisterPort(const char *portName, void **refPtr);
1107 
1108  /* Change the state of the port.*/
1117  OSStatus
1119 
1120  /* Find the TPortRecord for a given Port Name*/
1129  TPortRecord *
1130  OTFindPort(const char *portName);
1131 
1132  /* Find the "nth" TPortRecord*/
1141  TPortRecord *
1142  OTGetIndexedPort(OTItemCount index);
1143 
1156  TPortRecord *
1158 
1159  /* Other ways of finding the port*/
1168  TPortRecord *
1170 
1179  TPortRecord *
1181 
1182  /* ***** Port Scanners ******/
1183 
1184  /* Shared library definitions*/
1185 
1192 #define kOTPortScannerPrefix "ot:pScnr$"
1198 #define kOTPortScannerInterfaceID kOTKernelPrefix "pScnr"
1199 #define kOTPseudoPortScannerInterfaceID kOTKernelPrefix "ppScnr"
1200 #define kOTCompatPortScannerInterfaceID kOTKernelPrefix "cpScnr"
1201 
1202 #define kOTPortScannerCFMTag kOTKernelPrefix "pScnr"
1203 #define kOTPseudoPortScannerCFMTag kOTKernelPrefix "ppScnr"
1204 #define kOTCompatPortScannerCFMTag kOTKernelPrefix "cpScnr"
1205 
1206  /* OTScanPorts entry point.*/
1207 
1208  /* Your port-scanning function must be exported by the name "OTScanPorts".*/
1209 
1210 #define kOTScanPortsID "OTScanPorts"
1211  /* Selectors for the scanType parameter to PortScanProcPtr.*/
1212 
1213 #endif /* CALL_NOT_IN_CARBON */
1214 
1215  enum
1216  {
1217  kOTInitialScan = 0,
1218  kOTScanAfterSleep = 1
1219  };
1220 
1221  /* PortScanProcPtr is the typedef for the scanning function.*/
1222 
1223  typedef CALLBACK_API_C(void, PortScanProcPtr)(UInt32 scanType);
1229 #if CALL_NOT_IN_CARBON
1238  void *
1239  OTAllocPortMem(OTByteCount size);
1240 
1249  void
1250  OTFreePortMem(void *mem);
1251 
1252  /* ***** Interrupt Control Functions *****/
1253 
1254 #endif /* CALL_NOT_IN_CARBON */
1255 
1256 #if TARGET_CPU_68K
1264  typedef UInt8 MPS_INTR_STATE;
1265 /* Disable interrupts and save the state*/
1266 #if OTDEBUG
1267 #if CALL_NOT_IN_CARBON
1276 #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
1277 #pragma parameter mps_intr_disable(__A0)
1278 #endif
1279  void
1280  mps_intr_disable(MPS_INTR_STATE *oldState)
1281  THIRTEENWORDINLINE(0x40C0, 0xE040, 0x007C, 0x0600, 0x027C, 0xFEFF, 0x1080,
1282  0x0200, 0x0070, 0x0C00, 0x0070, 0x6602, 0xA9FF);
1283 
1284 #endif /* CALL_NOT_IN_CARBON */
1285 
1286 #else
1287 #if CALL_NOT_IN_CARBON
1296 #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
1297 #pragma parameter mps_intr_disable(__A0)
1298 #endif
1299  void
1300  mps_intr_disable(MPS_INTR_STATE *oldState);
1301 
1302 #endif /* CALL_NOT_IN_CARBON */
1303 
1304 #endif /* OTDEBUG */
1305 
1319 /* Enable interrupts from the saved state*/
1320 #if OTDEBUG
1321 #if CALL_NOT_IN_CARBON
1330 #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
1331 #pragma parameter mps_intr_enable(__A0)
1332 #endif
1333  void
1334  mps_intr_enable(MPS_INTR_STATE *oldState)
1335  WORDINLINE(0x40C0, 0x0240, 0x0700, 0x0C40, 0x0600, 0x6702, 0xA9FF, 0x1010,
1336  0x0200, 0x0070, 0x0C00, 0x0070, 0x6602, 0xA9FF, 0x1010, 0xE140,
1337  0x46C0);
1338 
1339 #endif /* CALL_NOT_IN_CARBON */
1340 
1341 #else
1342 #if CALL_NOT_IN_CARBON
1351 #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
1352 #pragma parameter mps_intr_enable(__A0)
1353 #endif
1354  void
1355  mps_intr_enable(MPS_INTR_STATE *oldState);
1356 
1357 #endif /* CALL_NOT_IN_CARBON */
1358 
1359 #endif /* OTDEBUG */
1360 
1380 #else
1381 typedef UInt8 MPS_INTR_STATE;
1382 #if CALL_NOT_IN_CARBON
1391 void mps_intr_disable(MPS_INTR_STATE *oldState);
1392 
1401 void mps_intr_enable(MPS_INTR_STATE *oldState);
1402 
1403 #endif /* CALL_NOT_IN_CARBON */
1404 
1405 #endif /* TARGET_CPU_68K */
1406 
1407  /* ***** Timer Functions ******/
1408  enum
1409  {
1410  kOTMinimumTimerValue = 8 /* 8 milliseconds is the minimum timeout value*/
1411  };
1412 
1413 #if CALL_NOT_IN_CARBON
1422  mblk_t *
1423  mi_timer_alloc(queue_t *q, OTByteCount size);
1424 
1433  void
1435 
1444  void
1445  mi_timer(mblk_t *mp, unsigned long milliSeconds);
1446 
1455  Boolean
1457 
1466  Boolean
1468 
1477  mblk_t *
1479 
1480  /* ***** Driver Deferred Task Extras ******/
1481 
1494  Boolean
1496 
1497  /* ***** Driver Memory Routines ******/
1498 
1511 #endif /* CALL_NOT_IN_CARBON */
1512 
1513  typedef CALLBACK_API_C(void, EsbFreeProcPtr)(char *arg);
1520 #if CALL_NOT_IN_CARBON
1529  mblk_t *
1530  OTAllocMsg(void *buf, OTByteCount size, EsbFreeProcPtr func, void *arg);
1531 
1545  void *
1546  OTAllocMem(OTByteCount size);
1547 
1556  void
1557  OTFreeMem(void *mem);
1558 
1567  void *
1568  OTReallocMem(void *ptr, OTByteCount newSize);
1569 
1575 #define calloc (DONT_CALL * THIS_FUNCTION)
1576 #define malloc (DONT_CALL * THIS_FUNCTION)
1577 #define realloc (DONT_CALL * THIS_FUNCTION)
1578 #define free (DONT_CALL * THIS_FUNCTION)
1579 
1580  /* ***** Kernel Memory Utilities ******/
1581 
1590  OTInt32
1591  mi_bcmp(const char *first, const char *second, OTByteCount nBytes);
1592 
1593  /* Standard STREAMS memory utilities.*/
1594 
1595 #define bcopy(s, d, l) OTMemcpy(d, s, l)
1596 #define bzero(d, l) OTMemzero(d, (OTByteCount)(l))
1597 #define bcmp(s, d, l) mi_bcmp(s, d, l)
1598 
1605 #define BCOPY(s, d, l) bcopy((const char *)(s), (char *)(d), l)
1606 #define BZERO(d, l) bzero((char *)(d), l)
1607 #define BCMP(s, d, l) mi_bcmp((const char *)(s), (const char *)(d), l)
1608 
1609  /*******************************************************************************
1610  ** Some helpful utilites from Mentat
1611  ********************************************************************************/
1612  /* Routines to calculate various sizes of STREAM messages*/
1613 
1614 #define HEAD_SIZE(mp) ((mp)->b_rptr - (mp)->b_datap->db_base)
1615 #define TAIL_SIZE(mp) ((mp)->b_datap->db_lim - (mp)->b_wptr)
1616 #define MBLK_SIZE(mp) ((mp)->b_wptr - (mp)->b_rptr)
1617 #define DBLK_SIZE(mp) ((mp)->b_datap->db_lim - (mp)->b_datap->db_base)
1618 
1619  /* Useful macros for STREAMS copy in and out.*/
1620 
1621 #define MI_COPY_IN 1
1622 #define MI_COPY_OUT 2
1623 #define MI_COPY_DIRECTION(mp) (((UInt8 *)&(mp)->b_cont->b_prev)[0])
1624 #define MI_COPY_COUNT(mp) (((UInt8 *)&(mp)->b_cont->b_prev)[1])
1625 #define MI_COPY_RVAL(mp) (*(OTInt32 *)&(mp)->b_cont->b_next)
1626 #define MI_COPY_CASE(dir, cnt) ((OTInt32)(((cnt) << 2) | dir))
1627 #define MI_COPY_STATE(mp) \
1628  ((OTInt32)MI_COPY_CASE(MI_COPY_DIRECTION(mp), MI_COPY_COUNT(mp)))
1629 
1630 #endif /* CALL_NOT_IN_CARBON */
1631 
1632  typedef CALLBACK_API_C(void, OTWriterProcPtr)(queue_t *q, mblk_t *mp);
1633 #if CALL_NOT_IN_CARBON
1642  void
1643  mps_become_writer(queue_t *q, mblk_t *mp, OTWriterProcPtr proc);
1644 
1653  OTInt32
1654  drv_priv(cred *credp);
1655 
1664  queue_t *
1665  mi_allocq(streamtab *st);
1666 
1675  mblk_t *
1676  mi_tpi_ack_alloc(mblk_t *mp, OTByteCount size, long primType);
1677 
1686  mblk_t *
1687  mi_tpi_conn_con(mblk_t *trailer_mp, char *src, OTByteCount src_length,
1688  char *opt, OTByteCount opt_length);
1689 
1698  mblk_t *
1699  mi_tpi_conn_ind(mblk_t *trailer_mp, char *src, OTByteCount src_length,
1700  char *opt, OTByteCount opt_length, OTInt32 seqnum);
1701 
1710  mblk_t *
1711  mi_tpi_conn_req(mblk_t *trailer_mp, char *dest, OTByteCount dest_length,
1712  char *opt, OTByteCount opt_length);
1713 
1722  mblk_t *
1723  mi_tpi_data_ind(mblk_t *trailer_mp, OTInt32 flags, long ptype);
1724 
1733  mblk_t *
1734  mi_tpi_data_req(mblk_t *trailer_mp, OTInt32 flags, long pttype);
1735 
1744  mblk_t *
1745  mi_tpi_discon_ind(mblk_t *trailer_mp, OTInt32 reason, OTInt32 seqnum);
1746 
1755  mblk_t *
1756  mi_tpi_discon_req(mblk_t *trailer_mp, OTInt32 seqnum);
1757 
1766  mblk_t *
1767  mi_tpi_err_ack_alloc(mblk_t *mp, OTInt32 tlierr, OTInt32 unixerr);
1768 
1777  mblk_t *
1778  mi_tpi_exdata_ind(mblk_t *trailer_mp, OTInt32 flags, long ptype);
1779 
1788  mblk_t *
1789  mi_tpi_exdata_req(mblk_t *trailer_mp, OTInt32 flags, long ptype);
1790 
1799  mblk_t *
1801 
1810  mblk_t *
1812 
1821  mblk_t *
1823 
1832  mblk_t *
1834 
1843  mblk_t *
1844  mi_tpi_uderror_ind(char *dest, OTByteCount dest_length, char *opt,
1845  OTByteCount opt_length, OTInt32 error);
1846 
1855  mblk_t *
1856  mi_tpi_unitdata_ind(mblk_t *trailer_mp, char *src, OTByteCount src_length,
1857  char *opt, OTByteCount opt_length);
1858 
1867  mblk_t *
1868  mi_tpi_unitdata_req(mblk_t *trailer_mp, char *dst, OTByteCount dst_length,
1869  char *opt, OTByteCount opt_length);
1870 
1879  mblk_t *
1880  mi_reuse_proto(mblk_t *toReuse, OTByteCount sizeDesired,
1881  OTBooleanParam keepOnError);
1882 
1891  mblk_t *
1892  mi_reallocb(mblk_t *old_mp, OTByteCount new_size);
1893 
1902  Boolean
1903  mi_set_sth_hiwat(queue_t *q, OTByteCount size);
1904 
1913  Boolean
1914  mi_set_sth_lowat(queue_t *q, OTByteCount size);
1915 
1924  Boolean
1925  mi_set_sth_maxblk(queue_t *q, OTByteCount size);
1926 
1935  Boolean
1936  mi_set_sth_wroff(queue_t *q, OTByteCount size);
1937 
1946  UInt8 *
1947  mi_offset_param(mblk_t *mp, long offset, long len);
1948 
1957  UInt8 *
1958  mi_offset_paramc(mblk_t *mp, long offset, long len);
1959 
1968  char *
1969  mi_open_detached(char **mi_opp_orig, OTByteCount size, dev_t *devp);
1970 
1979  OTInt32
1980  mi_open_comm(char **mi_opp_orig, OTByteCount size, queue_t *q, dev_t *dev,
1981  OTInt32 flag, OTInt32 sflag, cred_t *credp);
1982 
1991  OTInt32
1992  mi_close_comm(char **mi_opp_orig, queue_t *q);
1993 
2002  void
2003  mi_bufcall(queue_t *q, OTByteCount size, OTInt32 pri);
2004 
2013  void
2014  mi_detach(queue_t *q, char *ptr);
2015 
2024  void
2025  mi_close_detached(char **mi_opp_orig, char *ptr);
2026 
2035  char *
2036  mi_next_ptr(char *ptr);
2037 
2046  void
2047  mi_copyin(queue_t *q, mblk_t *mp, char *uaddr, OTByteCount len);
2048 
2057  void
2059 
2068  mblk_t *
2069  mi_copyout_alloc(queue_t *q, mblk_t *mp, char *uaddr, OTByteCount len);
2070 
2079  void
2080  mi_copy_done(queue_t *q, mblk_t *mp, OTInt32 err);
2081 
2090  void
2091  mi_copy_set_rval(mblk_t *mp, OTInt32 rval);
2092 
2101  OTInt32
2103 
2104  /* ***** PCI-Specific Stuff*/
2105 
2106  /* This is the cookie that is passed to your STREAM Module.*/
2107 
2108 #endif /* CALL_NOT_IN_CARBON */
2109 
2110  struct OTPCIInfo
2111  {
2112  RegEntryID fTheID;
2113  void *fConfigurationInfo;
2114  ByteCount fConfigurationLength;
2115  };
2116  typedef struct OTPCIInfo OTPCIInfo;
2117  /* Driver Description*/
2143 #define OTPCIServiceType(devType, framingFlags, isTPI, isDLPI) \
2144  ((devType << 16) | (((framingFlags) & 0xff) << 8) | (isTPI ? 2 : 0) | \
2145  (isDLPI ? 1 : 0))
2146 
2155  typedef CALLBACK_API_C(OTResult, ValidateHardwareProcPtr)(OTPCIInfo *param);
2161  enum
2162  {
2163  kOTPCINoErrorStayLoaded = 1
2164  };
2165 
2171 #define kDescriptorProperty "driver-descriptor"
2172 #define kDriverProperty "driver,AAPL,MacOS,PowerPC"
2173 #define kDriverPtrProperty "driver-ptr"
2174 #define kSlotProperty "AAPL,slot-name"
2175 
2182  enum
2183  {
2184  kMaxServices = 20
2185  };
2186 
2187  /*******************************************************************************
2188  ** Everything below here is C++ ONLY
2189  ********************************************************************************/
2190 
2191 #ifdef __cplusplus
2192 } // Terminate C definitions
2193 
2194 /* -------------------------------------------------------------------------
2195  TStreamQueue class
2196 
2197  This class is just a convenient interface to the queue structure
2198  ------------------------------------------------------------------------- */
2199 
2200 class TStreamQueue : public queue
2201 {
2202 public:
2203  void EnableQueue();
2204 };
2205 
2206 /* -------------------------------------------------------------------------
2207  Inline methods for TStreamQueue
2208  ------------------------------------------------------------------------- */
2209 
2210 inline void TStreamQueue::EnableQueue()
2211 {
2212  if (q_flag & QNOENB)
2213  {
2214  enableok(this);
2215  if (q_first)
2216  qenable(this);
2217  }
2218 }
2219 
2220 /* -------------------------------------------------------------------------
2221  Class TStreamMessage
2222 
2223  This class is a C++ interface to the mblk_t structure defined in STREAMS
2224  ------------------------------------------------------------------------- */
2225 //
2226 // The maximum stream buffer size is the largest OTByteCount that
2227 // doesn't look negative if interpreted as a signed number
2228 //
2229 enum
2230 {
2231  kMaxStreamBufferSize = (((OTByteCount)-1L) >> 1)
2232 };
2233 
2234 class TStreamMessage : public msgb
2235 {
2236 private:
2237  void *operator new(OTByteCount) { return NULL; }
2238 
2239 public:
2240  void *operator new(OTByteCount, OTByteCount size)
2241  {
2242  return (TStreamMessage *)allocb(size, 0);
2243  }
2244  void *operator new(OTByteCount, void *buf, OTByteCount size,
2245  EsbFreeProcPtr func, void *arg)
2246  {
2247  return OTAllocMsg(buf, size, func, arg);
2248  }
2249  void operator delete(void *ptr)
2250  {
2251  if (ptr != NULL)
2252  freemsg((mblk_t *)ptr);
2253  }
2254 
2255  void Reset(OTByteCount = 0);
2256  void ResetWithLeader(OTByteCount);
2257 
2258  void FreeData();
2259  TStreamMessage *RemoveData();
2260  void AppendData(TStreamMessage *data);
2261 
2262  OTByteCount GetSize() const;
2263  OTByteCount GetDataSize() const;
2264  OTByteCount GetMessageDataSize() const;
2265  void SetDataSize(OTByteCount);
2266 
2267  void SetType(UInt8);
2268  UInt8 GetType() const;
2269  TStreamMessage *GetNextBlock() const;
2270  TStreamMessage *ReuseMessage(OTByteCount newSize,
2271  OTBooleanParam keepOnFailure);
2272 
2273  void SetNextBlock(TStreamMessage *);
2274  char *GetDataPointer() const;
2275  Boolean IsReuseable(OTByteCount size) const;
2276 
2277  void HideBytesAtFront(OTByteCount);
2278  void HideBytesAtEnd(OTByteCount);
2279  //
2280  // The following functions ignore non-M_DATA blocks.
2281  //
2282  const TStreamMessage *_MDECL GetBlockAt(OTByteCount &offset) const;
2283  const void *_MDECL GetPointerTo(OTByteCount offset, OTByteCount *len) const;
2284  const void *_MDECL GetPointerTo(OTByteCount offset, OTByteCount *len,
2285  void *bfr) const;
2286  //
2287  // This function makes a non-shared copy of any initial non-M_DATA block, and
2288  // then makes shared copies of the requested data. It only assumes 1 leading
2289  // non-M_DATA block, but will skip any other non-M_DATA blocks while
2290  // searching for data to copy.
2291  //
2292  TStreamMessage *_MDECL MakeSharedCopy(OTByteCount offset = 0,
2293  OTByteCount len = kMaxStreamBufferSize);
2294 
2295  Boolean _MDECL HasData() const;
2296  Boolean _MDECL WriteData(void *buf, OTByteCount len);
2297  //
2298  // These hide/remove the part of the data already read.
2299  //
2300  TStreamMessage *_MDECL ReadData(void *buf, OTByteCount *len);
2301  OTByteCount _MDECL ReadControl(void *buf, OTByteCount len);
2302 };
2303 
2304 /* -------------------------------------------------------------------------
2305  Inline methods for TStreamMessage
2306  ------------------------------------------------------------------------- */
2307 
2308 inline void TStreamMessage::Reset(OTByteCount size)
2309 {
2310  b_rptr = b_datap->db_base;
2311  b_wptr = b_rptr + size;
2312 }
2313 
2314 inline OTByteCount OTLengthWithLeader(OTByteCount size)
2315 {
2316  return (size + 3) & ~3;
2317 }
2318 
2319 inline void TStreamMessage::ResetWithLeader(OTByteCount size)
2320 {
2321  b_rptr = b_datap->db_lim - OTLengthWithLeader(size);
2322  b_wptr = b_rptr + size;
2323 }
2324 
2325 inline void TStreamMessage::FreeData()
2326 {
2327  if (b_cont)
2328  {
2329  freemsg(b_cont);
2330  b_cont = NULL;
2331  }
2332 }
2333 
2334 inline TStreamMessage *TStreamMessage::RemoveData()
2335 {
2336  TStreamMessage *temp = (TStreamMessage *)b_cont;
2337  b_cont = NULL;
2338  return temp;
2339 }
2340 
2341 inline void TStreamMessage::AppendData(TStreamMessage *mp) { linkb(this, mp); }
2342 
2343 inline OTByteCount TStreamMessage::GetSize() const
2344 {
2345  return b_datap->db_lim - b_datap->db_base;
2346 }
2347 
2348 inline OTByteCount TStreamMessage::GetDataSize() const
2349 {
2350  return b_wptr - b_rptr;
2351 }
2352 
2353 inline OTByteCount TStreamMessage::GetMessageDataSize() const
2354 {
2355  return (b_cont == NULL) ? (b_datap->db_type == M_DATA ? (b_wptr - b_rptr) : 0)
2356  : msgdsize(this);
2357 }
2358 
2359 inline void TStreamMessage::SetDataSize(OTByteCount size)
2360 {
2361  b_wptr = b_rptr + size;
2362 }
2363 
2364 inline void TStreamMessage::SetType(UInt8 type) { b_datap->db_type = type; }
2365 
2366 inline unsigned char TStreamMessage::GetType() const
2367 {
2368  return b_datap->db_type;
2369 }
2370 
2371 inline TStreamMessage *TStreamMessage::GetNextBlock() const
2372 {
2373  return (TStreamMessage *)b_cont;
2374 }
2375 
2376 inline void TStreamMessage::SetNextBlock(TStreamMessage *mp)
2377 {
2378  b_cont = (mblk_t *)mp;
2379 }
2380 
2381 inline char *TStreamMessage::GetDataPointer() const { return (char *)b_rptr; }
2382 
2383 inline Boolean TStreamMessage::IsReuseable(OTByteCount size) const
2384 {
2385  return (b_datap->db_ref == 1 && GetSize() >= size);
2386 }
2387 
2388 inline void TStreamMessage::HideBytesAtFront(OTByteCount len)
2389 {
2390  adjmsg(this, len);
2391 }
2392 
2393 inline void TStreamMessage::HideBytesAtEnd(OTByteCount len)
2394 {
2395  adjmsg(this, -len);
2396 }
2397 
2398 inline TStreamMessage *
2399 TStreamMessage::ReuseMessage(OTByteCount newSize,
2400  OTBooleanParam keepOnFailure)
2401 {
2402  return (TStreamMessage *)mi_reuse_proto(this, newSize, keepOnFailure);
2403 }
2404 
2405 /* -------------------------------------------------------------------------
2406  TTimerMessage class
2407 
2408  This class implements an interface to the STREAM environment timer
2409  facilities. A TTimerMessage will be placed on the queue of your choice
2410  when it's timer expires.
2411  ------------------------------------------------------------------------- */
2412 
2413 #if TARGET_CPU_PPC
2414 #define TIMER_BUG 1
2415 #else
2416 #define TIMER_BUG 0
2417 #endif
2418 
2419 class TTimerMessage : public TStreamMessage
2420 {
2421 #if TIMER_BUG
2422 private:
2423 #else
2424 public:
2425 #endif
2426  inline void *operator new(OTByteCount, queue_t *q)
2427  {
2428  return mi_timer_alloc(q, sizeof(T_stream_timer));
2429  }
2430  inline void *operator new(OTByteCount, queue_t *q, OTByteCount extra)
2431  {
2432  return mi_timer_alloc(q, extra + sizeof(T_stream_timer));
2433  }
2434 
2435  inline void operator delete(void *ptr)
2436  {
2437  if (ptr != NULL)
2438  mi_timer_free((mblk_t *)ptr);
2439  }
2440 
2441 public:
2442  Boolean IsValid();
2443  TTimerMessage *ChangeQueue(TStreamQueue *newQ, TTimerMessage *newMP);
2444  Boolean Cancel();
2445  void Schedule(OTTimeout time);
2446 
2447 private:
2448  inline void *operator new(OTByteCount) { return 0; }
2449 };
2450 
2451 inline TTimerMessage *NewTimerMsg(queue_t *q, OTByteCount extra = 0)
2452 {
2453  return (TTimerMessage *)mi_timer_alloc(q, sizeof(T_stream_timer) + extra);
2454 }
2455 
2456 inline void FreeTimerMsg(TTimerMessage *msg) { mi_timer_free(msg); }
2457 
2458 /* -------------------------------------------------------------------------
2459  Inline methods for TStreamTimer
2460  ------------------------------------------------------------------------- */
2461 
2462 inline Boolean TTimerMessage::IsValid() { return mi_timer_valid(this); }
2463 
2464 inline TTimerMessage *TTimerMessage::ChangeQueue(TStreamQueue *q,
2465  TTimerMessage *newMP)
2466 {
2467  return ((TTimerMessage *)mi_timer_q_switch(this, q, newMP));
2468 }
2469 
2470 inline Boolean TTimerMessage::Cancel() { return mi_timer_cancel(this); }
2471 
2472 inline void TTimerMessage::Schedule(OTTimeout time)
2473 {
2474  ((T_stream_timer *)b_rptr)->PRIM_type = T_TIMER_REQ;
2475  mi_timer(this, (unsigned long)time);
2476 }
2477 
2478 extern "C"
2479 { // resume C definitions
2480 #endif /* __cplusplus */
2481 
2482 #if defined(__MWERKS__) && TARGET_CPU_68K
2483 #pragma pop
2484 #endif
2485 
2486 #if PRAGMA_STRUCT_ALIGN
2487 #pragma options align = reset
2488 #elif PRAGMA_STRUCT_PACKPUSH
2489 #pragma pack(pop)
2490 #elif PRAGMA_STRUCT_PACK
2491 #pragma pack()
2492 #endif
2493 
2494 #ifdef PRAGMA_IMPORT_OFF
2495 #pragma import off
2496 #elif PRAGMA_IMPORT
2497 #pragma import reset
2498 #endif
2499 
2500 #ifdef __cplusplus
2501 }
2502 #endif
2503 
2504 #endif /* __OPENTRANSPORTKERNEL__ */
#define NULL
Definition: MacTypes.h:61
unsigned char Boolean
Definition: MacTypes.h:318
NameRegistry Interfaces.
OSStatus OTUnregisterPort(const char *portName, void **refPtr)
void * OTAllocMem(OTByteCount size)
OTInt32 mpnotify(mblk_t *mp, mpnotifyProc pfv, char *arg)
mblk_t * mi_tpi_discon_ind(mblk_t *trailer_mp, OTInt32 reason, OTInt32 seqnum)
OSStatus OTRegisterPort(OTPortRecord *portInfo, void *ref)
void mi_copy_done(queue_t *q, mblk_t *mp, OTInt32 err)
mblk_t * getq(queue_t *q)
mblk_t * mi_tpi_unitdata_ind(mblk_t *trailer_mp, char *src, OTByteCount src_length, char *opt, OTByteCount opt_length)
OTInt32 mi_sprintf(char *buf, char *fmt,...)
mblk_t * esballoca(unsigned char *base, OTByteCount size, OTInt32 pri, frtn_t *freeInfo)
OTInt32 insq(queue_t *q, mblk_t *emp, mblk_t *nmp)
OTInt32 strqget(queue_t *q, qfields_t what, OTUInt8Param pri, long *valp)
mblk_t * mi_tpi_err_ack_alloc(mblk_t *mp, OTInt32 tlierr, OTInt32 unixerr)
OTInt32 adjmsg(mblk_t *mp, OTInt32 len_param)
OTInt32 bcanput(queue_t *q, OTUInt8Param pri)
UInt8 * mi_offset_paramc(mblk_t *mp, long offset, long len)
void mps_become_writer(queue_t *q, mblk_t *mp, OTWriterProcPtr proc)
TPortRecord * OTGetIndexedPort(OTItemCount index)
mblk_t * mi_copyout_alloc(queue_t *q, mblk_t *mp, char *uaddr, OTByteCount len)
void OTFreePortMem(void *mem)
mblk_t * mi_tpi_data_ind(mblk_t *trailer_mp, OTInt32 flags, long ptype)
OTInt32 putctl1(queue_t *q, OTInt32 mType, OTInt32 c)
void mi_close_detached(char **mi_opp_orig, char *ptr)
OTInt32 mi_open_comm(char **mi_opp_orig, OTByteCount size, queue_t *q, dev_t *dev, OTInt32 flag, OTInt32 sflag, cred_t *credp)
OTInt32 esbbcall(OTInt32 pri, esbbcallProc func, long arg)
OTInt32 putctl(queue_t *q, OTInt32 mType)
char * mi_next_ptr(char *ptr)
void unbufcall(OTInt32 id)
unsigned short getmid(char *name)
mblk_t * mi_tpi_ack_alloc(mblk_t *mp, OTByteCount size, long primType)
void unfreezestr(queue_t *q, OTInt32 oldpri)
Boolean OTScheduleDriverDeferredTask(long dtCookie)
void flushq(queue_t *q, OTInt32 flag)
mblk_t * mi_tpi_uderror_ind(char *dest, OTByteCount dest_length, char *opt, OTByteCount opt_length, OTInt32 error)
OTInt32 msgdsize(const mblk_t *mp)
OTInt32 freeq(queue_t *q)
mblk_t * dupb(mblk_t *mp)
mblk_t * mi_tpi_discon_req(mblk_t *trailer_mp, OTInt32 seqnum)
OTInt32 freezestr(queue_t *q)
OTInt32 putq(queue_t *q, mblk_t *mp)
mblk_t * mi_tpi_exdata_ind(mblk_t *trailer_mp, OTInt32 flags, long ptype)
void mps_intr_disable(MPS_INTR_STATE *oldState)
OTInt32 putctl2(queue_t *q, OTInt32 mType, OTInt32 c1, OTInt32 c2)
OTInt32 bufcall(OTByteCount memNeeded, OTInt32 pri, bufcallp_t proc, long context)
OTInt32 pullupmsg(mblk_t *mp, OTInt32 len)
void mps_intr_enable(MPS_INTR_STATE *oldState)
mblk_t * mi_tpi_ok_ack_alloc(mblk_t *mp)
void freemsg(mblk_t *mp)
OTInt32 bcanputnext(queue_t *q, OTUInt8Param pri)
void mi_timer(mblk_t *mp, unsigned long milliSeconds)
mblk_t * copyb(mblk_t *mp)
OTInt32 putnextctl1(queue_t *q, OTInt32 mType, OTInt32 c)
queue_t * mi_allocq(streamtab *st)
OTInt32 strqset(queue_t *q, qfields_t what, OTUInt8Param pri, long val)
OTInt32 putbq(queue_t *q, mblk_t *mp)
void * OTReallocMem(void *ptr, OTByteCount newSize)
mblk_t * unlinkb(mblk_t *mp)
mblk_t * allocbi(OTByteCount size, OTInt32 pri, allocbiProc pfv, char *arg, unsigned char *base)
UInt8 * mi_offset_param(mblk_t *mp, long offset, long len)
TPortRecord * OTFindPortConflict(OTPortRef ref)
mblk_t * mi_tpi_conn_req(mblk_t *trailer_mp, char *dest, OTByteCount dest_length, char *opt, OTByteCount opt_length)
OTInt32 canput(queue_t *q)
void mi_copy_set_rval(mblk_t *mp, OTInt32 rval)
OTInt32 puthere(queue_t *q, mblk_t *mp)
mblk_t * rmvb(mblk_t *mp, mblk_t *bp)
queue_t * allocq(void)
mblk_t * allocb(OTByteCount size, OTInt32 pri)
mblk_t * mi_tpi_data_req(mblk_t *trailer_mp, OTInt32 flags, long pttype)
OTInt32 mi_copy_state(queue_t *q, mblk_t *mp, mblk_t **mpp)
OTInt32 strlog(OTInt32 mid, OTInt32 sid, OTInt32 level, OTUInt32 flags, char *fmt,...)
mblk_t * mi_timer_alloc(queue_t *q, OTByteCount size)
mblk_t * mi_tpi_ordrel_ind(void)
void qenable(queue_t *q)
mblk_t * mi_reuse_proto(mblk_t *toReuse, OTByteCount sizeDesired, OTBooleanParam keepOnError)
Boolean mi_timer_valid(mblk_t *mp)
mblk_t * mi_tpi_ordrel_req(void)
void mi_copyout(queue_t *q, mblk_t *mp)
Boolean mi_set_sth_wroff(queue_t *q, OTByteCount size)
OTInt32 putnext(queue_t *q, mblk_t *mp)
OTInt32 testb(OTByteCount size, OTInt32 pri)
Boolean mi_timer_cancel(mblk_t *mp)
OTInt32 drv_priv(cred *credp)
void linkb(mblk_t *mp1, mblk_t *mp2)
void rmvq(queue_t *q, mblk_t *mp)
mblk_t * mi_tpi_exdata_req(mblk_t *trailer_mp, OTInt32 flags, long ptype)
Boolean mi_set_sth_maxblk(queue_t *q, OTByteCount size)
mblk_t * mi_tpi_unitdata_req(mblk_t *trailer_mp, char *dst, OTByteCount dst_length, char *opt, OTByteCount opt_length)
void * OTAllocPortMem(OTByteCount size)
void OTFreeMem(void *mem)
void flushband(queue_t *q, OTUInt8Param pri, OTInt32 flag)
OTInt32 OTKernelPrintf(OTInt32 toDo, char *fmt,...)
mblk_t * msgpullup(mblk_t *mp, OTInt32 len)
Boolean mi_set_sth_hiwat(queue_t *q, OTByteCount size)
char * mi_open_detached(char **mi_opp_orig, OTByteCount size, dev_t *devp)
TPortRecord * OTFindPort(const char *portName)
OSStatus OTErrorToOSStatus(OTError err)
#define enableok(q)
Definition: OpenTransportKernel.h:79
void mi_bufcall(queue_t *q, OTByteCount size, OTInt32 pri)
queue_t * backq(queue_t *q)
mblk_t * esballoc(unsigned char *base, OTByteCount size, OTInt32 pri, frtn_t *freeInfo)
void cmn_err(OTInt32 errType, char *fmt,...)
void OTStrlog(queue_t *q, OTInt32 lvl, OTInt32 flags, const char *str)
admin_t getadmin(OTUInt16Param mid)
void freeb(mblk_t *mp)
OTInt32 qreply(queue_t *q, mblk_t *mp)
OTInt32 canputnext(queue_t *q)
OTInt32 put(queue_t *q, mblk_t *mp)
mblk_t * mi_tpi_conn_con(mblk_t *trailer_mp, char *src, OTByteCount src_length, char *opt, OTByteCount opt_length)
mblk_t * mi_tpi_conn_ind(mblk_t *trailer_mp, char *src, OTByteCount src_length, char *opt, OTByteCount opt_length, OTInt32 seqnum)
mblk_t * OTAllocMsg(void *buf, OTByteCount size, EsbFreeProcPtr func, void *arg)
mblk_t * copymsg(mblk_t *mp)
OTInt32 putnextctl(queue_t *q, OTInt32 mType)
OSStatus OTChangePortState(OTPortRef portRef, OTEventCode theChange, OTResult why)
typedef CALLBACK_API_C(install_info *, GetOTInstallInfoProcPtr)(void)
void qprocson(queue_t *q)
long OTError
Definition: OpenTransportKernel.h:809
OTInt32 mi_bcmp(const char *first, const char *second, OTByteCount nBytes)
void qprocsoff(queue_t *q)
mblk_t * mi_tpi_info_req(void)
void mi_detach(queue_t *q, char *ptr)
Boolean mi_set_sth_lowat(queue_t *q, OTByteCount size)
mblk_t * dupmsg(mblk_t *mp)
mblk_t * mi_timer_q_switch(mblk_t *mp, queue_t *q, mblk_t *new_mp)
void mi_copyin(queue_t *q, mblk_t *mp, char *uaddr, OTByteCount len)
mblk_t * mi_reallocb(mblk_t *old_mp, OTByteCount new_size)
OTInt32 mi_close_comm(char **mi_opp_orig, queue_t *q)
TPortRecord * OTFindPortByDev(dev_t dev)
OTInt32 qsize(queue_t *q)
TPortRecord * OTFindPortByRef(OTPortRef ref)
void mi_timer_free(mblk_t *mp)
Definitions likely to be used by low-level protocol stack implementation.
UInt32 dev_t
Definition: OpenTransportProtocol.h:137
SInt32 queue_t
Definition: OpenTransportProtocol.h:457
#define _MDECL
Definition: OpenTransport.h:223
UInt32 OTPortRef
Definition: OpenTransport.h:1203
UInt8 OTUInt8Param
Definition: OpenTransport.h:195
UInt32 OTEventCode
Definition: OpenTransport.h:678
SInt32 OTResult
Definition: OpenTransport.h:510
Definition: OpenTransportKernel.h:2111
Definition: OpenTransport.h:1404
Definition: NameRegistry.h:62
Definition: OpenTransportKernel.h:1048
Definition: OpenTransportKernel.h:1021
Definition: OpenTransportKernel.h:1016
Definition: OpenTransportKernel.h:1028
Definition: OpenTransportProtocol.h:155
Definition: OpenTransportProtocol.h:171
Definition: OpenTransportKernel.h:853
Definition: OpenTransportProtocol.h:205