📄 disi.h
字号:
/* modem control signals supported by the channel is written to arg. A *//* set bit indicates that the particular control line is supported by *//* the channel. No callback is made. The modem control lines are *//* encoded as follows: *//*---------------------------------------------------------------------*/#define SIOCMQRY 0x00000005#define SIOCMDTR 0x00000001 /* data terminal ready */#define SIOCMRTS 0x00000002 /* request to send*/#define SIOCMCTS 0x00000004 /* clear to send */#define SIOCMDCD 0x00000008 /* data carrier detect*/#define SIOCMRI 0x00000010 /* ring indicator*/#define SIOCMDSR 0x00000020 /* data set ready */#define SIOCMCLK 0x00000040 /* clock (indicates synch)*//*---------------------------------------------------------------------*//* NOTE: The interface is a DTE therefore DTR and RTS are outputs and *//* CTS, RI, DSR and DCD are inputs. *//*---------------------------------------------------------------------*//*---------------------------------------------------------------------*//* SIOCMGET is used to get the settings of the modem controls. arg is *//* a pointer to a long int. The current state of the modem control *//* lines is fetched and stored at arg. SIOCMGET uses same encoding as *//* SIOCMQRY. Bits pertaining to control lines not supported by the *//* channel, and the SIOCMCLK bit, will be cleared. No callback is made.*//*---------------------------------------------------------------------*/#define SIOCMGET 0x00000006/*---------------------------------------------------------------------*//* SIOCMPUT is used to set the modem controls of the channel. arg is a *//* pointer to a long int containing a new set of modem control lines. *//* The modem control lines are turned on or off, depending on whether *//* their respective bits are set or clear. SIOCMPUT uses same encoding *//* as SIOCMQRY. Bits pertaining to control lines not supported by the *//* channel, and the bit, have no effect. No callback is made. *//*---------------------------------------------------------------------*/#define SIOCMPUT 0x00000007/*---------------------------------------------------------------------*//* SIOCFLGET Get the current state of the flags defined by the *//* UartCfg structure and in arg a pointer to a unsigned long. This *//* call will have no effect when the channel is being used in sync *//* (HDLC) mode. *//*---------------------------------------------------------------------*/#define SIOCFLGET 0x00000008/*---------------------------------------------------------------------*//* SIOFLPUT arg is a pointer to a long int containing a new set of *//* flags (defined by the flag element in the uart_cfg structure). The *//* flags for the channel will be set to these new settings. This call *//* will have no effect when the channel is being used in sync (HDLC) *//* mode. The effect is immediate. No call back is made. *//*---------------------------------------------------------------------*/#define SIOCFLPUT 0x00000009/*---------------------------------------------------------------------*//* SIOCXFGET The current XOFF character is written to the long int *//* pointed to by arg. No callback is made. *//*---------------------------------------------------------------------*/#define SIOCXFGET 0x0000000A/*---------------------------------------------------------------------*//* SIOCXFPUT arg is a pointer to a long int containing a new XOFF *//* character to be used. The effect is immediate. No callback is made. *//*---------------------------------------------------------------------*/#define SIOCXFPUT 0x0000000B/*---------------------------------------------------------------------*//* SIOCXNGET The current XON character is written to the long int *//* pointed to by arg. No callback is made. *//*---------------------------------------------------------------------*/#define SIOCXNGET 0x0000000C/*---------------------------------------------------------------------*//* SIOCXNPUT arg is a pointer to a long int containing a new XON *//* character to be used. The effect is immediate. No callback is made. *//*---------------------------------------------------------------------*/#define SIOCXNPUT 0x0000000D/*---------------------------------------------------------------------*//* SIOCREPLENISH This command will cause the receive buffer pool *//* (if any) to be replenished. Note: this call need only be used if *//* the hdwflags passed in the SerialOpen call had the SIOCHDWRXPOOL *//* bit set. *//*---------------------------------------------------------------------*/#define SIOCREPLENISH 0x0000000E/*---------------------------------------------------------------------*//* SIOCGBAUD The baud rate of the channel is written to the long int *//* pointed to by arg. *//*---------------------------------------------------------------------*/#define SIOCGBAUD 0x0000000F/*---------------------------------------------------------------------*//* SIOCSBAUD arg is a pointer to a long int containing a new baud rate *//* of the channel. The effect is immediate. No call back is made. *//* Baud is set to the actual desired baud rate. If that baud rate *//* cannot be supported by the lower level device dependent code then *//* an error will be returned and the open or Ioctl will fail. *//* Error code is SIOCBADBAUD. *//*---------------------------------------------------------------------*/#define SIOCSBAUD 0x00000010/*---------------------------------------------------------------------*//* SIOCGCSIZE The character size in bits is written to the long int *//* pointed to by arg. *//*---------------------------------------------------------------------*/#define SIOCGCSIZE 0x00000011/*---------------------------------------------------------------------*//* SIOCSCSIZE arg is a pointer to a long int containing a new *//* character size in bits. The effect is immediate. No call back is *//* made. *//*---------------------------------------------------------------------*/#define SIOCSCSIZE 0x00000012/*---------------------------------------------------------------------*//* SIOCSACTIVATE Activate the channel. This used to enable data *//* transfer. A call-back is made when the channel becomes active *//* (begins to receive data). *//*---------------------------------------------------------------------*/#define SIOCSACTIVATE 0x00000013/*---------------------------------------------------------------------*//* SIOCSDEACTIVATE Deactivate the channel. Sets the signals to *//* deactivate it. *//*---------------------------------------------------------------------*/#define SIOCSDEACTIVATE 0x00000014/*---------------------------------------------------------------------*//* SIOCTXFLUSH Flush all characters in the transmit and receive queues *//* for the channel. A call-back will be made when all characters are *//* discarded. *//*---------------------------------------------------------------------*/#define SIOCTXFLUSH 0x00000015/*---------------------------------------------------------------------*//* SIOCRXFLUSH Flush all characters from the receiver. A call back will*//* be made when the flush is complete. *//*---------------------------------------------------------------------*/#define SIOCRXFLUSH 0x00000016/*---------------------------------------------------------------------*//* SIOCRXSTOP This will be used when the Upper Level *//* Serial Driver needs to stop the flow of characters received. *//*---------------------------------------------------------------------*/#define SIOCRXSTOP 0x00000017/*---------------------------------------------------------------------*//* SIOCRXSTART This will be used when the Upper Level Serial *//* Driver wants to continue to receive characters. *//*---------------------------------------------------------------------*/#define SIOCRXSTART 0x00000018/*---------------------------------------------------------------------*//* SIOCNUMBER Used to get the number of channels the driver controls. *//*---------------------------------------------------------------------*/#define SIOCNUMBER 0x00000019/*---------------------------------------------------------------------*//* SerialClose *//*---------------------------------------------------------------------*/long SerialClose( Lid lid /* Lower layer reference */);/*---------------------------------------------------------------------*//* This call is used to terminate a connection on a serial channel. *//* The SerialClose call will return the channel to its default state. *//* lid is the lower level reference pointer that was acquired during *//* SerialOpen operation for the channel that is to be closed. *//*---------------------------------------------------------------------*//*---------------------------------------------------------------------*//* User Call-back functions *//* *//* Following are the prototypes of the call-back functions that should *//* be provided by the user of the driver. Pointers to these functions *//* are passed in the ChannelCfg structure during the SerialOpen of the *//* channel to the device dependent lower level code. Note: these calls *//* must be callable from an interrupt so it is important that they do *//* not block within the call. The prototypes for these calls are *//* supplied here a comments because the user may name these calls as *//* what ever they would like. (address to the functions are passed in *//* the SerialOpen call. *//*---------------------------------------------------------------------*//*---------------------------------------------------------------------*//* *//* static void UDataInd( *//* Uid uid; Upper layer reference *//* mblk_t * mbp; Message block pointer *//* unsigned long b_flags; status pertaining to this block *//* ); *//* *//* UDataInd is called during an interrupt by the device dependent *//* lower level code to indicate reception of data to the upper level *//* serial driver. uid is the upper level serial driver's reference *//* pointer passed to the serial driver during the SerialOpen of the *//* channel the data is being received on. mbp is pointer to message *//* block that will contain the data received by the channel. b_flags *//* are the status flags associated with this message block. *//* *//* UDataInd should unblock any function that is waiting for data from *//* this channel. If the SerialOpen call argument hdwflags had the *//* SIOCHDWRXPOOL bit set then the lower level code has a receive buffer*//* pool. This pool will need replenishing through the use of a call to *//* SerialIoctl with the command SIOCREPLENISH. It is the *//* responsibility of the user supplied functions in the upper layer *//* serial driver code to make the SerialIoctl to do this. *//* *//* It is also the responsibility of the upper level serial driver to *//* free the message block (pointed to by mbp) when it is emptied. *//* *//* b_flags can be one of the following: *//*---------------------------------------------------------------------*/#define SIOCOK 0x00000000 /* Rx received with out error */#define SIOCLGFRAME 0x00000001 /* Frame with exceeding length */#define SIOCCONTROL 0x00000002 /* Control Character Received */#define SIOCMARK 0x00000004 /* Idle Line Condition */#define SIOCBREAKR 0x00000008 /* Break Received */#define SIOCFRAMING 0x00000010 /* Framing Error */#define SIOCPARITY 0x00000020 /* Parity Error */#define SIOCOVERRUN 0x00000040 /* Overrun of buffers */#define SIOCCDLOST 0x00000080 /* Carrier Detect Lost *//*---------------------------------------------------------------------*//* *//* static void UExpInd( *//* Uid uid; Upper layer reference *//* unsigned long exp; Exception type *//* char *arg; Argument pointer *//* ); *//* *//* UExpInd is called by the device dependent lower level code to *//* indicate an exception condition to the upper level serial driver. *//* uid is upper level serial driver's reference pointer passed to *//* the driver during the SerialOpen of the channel. exp is type of *//* exception and arg points to information that can be passed for *//* exception condition. *//* *//* Exceptions can be one of the following: *//* SIOCBREAK Break Received *//* SIOCFRAMING Framing Error no stop bit */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -