~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/arch/powerpc/include/asm/hvsi.h

Version: ~ [ linux-6.11.5 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.58 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.114 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.169 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.228 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.284 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.322 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.9 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /* SPDX-License-Identifier: GPL-2.0 */
  2 #ifndef _HVSI_H
  3 #define _HVSI_H
  4 
  5 #define VS_DATA_PACKET_HEADER           0xff
  6 #define VS_CONTROL_PACKET_HEADER        0xfe
  7 #define VS_QUERY_PACKET_HEADER          0xfd
  8 #define VS_QUERY_RESPONSE_PACKET_HEADER 0xfc
  9 
 10 /* control verbs */
 11 #define VSV_SET_MODEM_CTL    1 /* to service processor only */
 12 #define VSV_MODEM_CTL_UPDATE 2 /* from service processor only */
 13 #define VSV_CLOSE_PROTOCOL   3
 14 
 15 /* query verbs */
 16 #define VSV_SEND_VERSION_NUMBER 1
 17 #define VSV_SEND_MODEM_CTL_STATUS 2
 18 
 19 /* yes, these masks are not consecutive. */
 20 #define HVSI_TSDTR 0x01
 21 #define HVSI_TSCD  0x20
 22 
 23 #define HVSI_MAX_OUTGOING_DATA 12
 24 #define HVSI_VERSION 1
 25 
 26 struct hvsi_header {
 27         uint8_t  type;
 28         uint8_t  len;
 29         __be16 seqno;
 30 } __attribute__((packed));
 31 
 32 struct hvsi_data {
 33         struct hvsi_header hdr;
 34         uint8_t  data[HVSI_MAX_OUTGOING_DATA];
 35 } __attribute__((packed));
 36 
 37 struct hvsi_control {
 38         struct hvsi_header hdr;
 39         __be16 verb;
 40         /* optional depending on verb: */
 41         __be32 word;
 42         __be32 mask;
 43 } __attribute__((packed));
 44 
 45 struct hvsi_query {
 46         struct hvsi_header hdr;
 47         __be16 verb;
 48 } __attribute__((packed));
 49 
 50 struct hvsi_query_response {
 51         struct hvsi_header hdr;
 52         __be16 verb;
 53         __be16 query_seqno;
 54         union {
 55                 uint8_t  version;
 56                 __be32 mctrl_word;
 57         } u;
 58 } __attribute__((packed));
 59 
 60 /* hvsi lib struct definitions */
 61 #define HVSI_INBUF_SIZE         255
 62 struct tty_struct;
 63 struct hvsi_priv {
 64         unsigned int    inbuf_len;      /* data in input buffer */
 65         unsigned char   inbuf[HVSI_INBUF_SIZE];
 66         unsigned int    inbuf_cur;      /* Cursor in input buffer */
 67         size_t          inbuf_pktlen;   /* packet length from cursor */
 68         atomic_t        seqno;          /* packet sequence number */
 69         unsigned int    opened:1;       /* driver opened */
 70         unsigned int    established:1;  /* protocol established */
 71         unsigned int    is_console:1;   /* used as a kernel console device */
 72         unsigned int    mctrl_update:1; /* modem control updated */
 73         unsigned short  mctrl;          /* modem control */
 74         struct tty_struct *tty;         /* tty structure */
 75         ssize_t (*get_chars)(uint32_t termno, u8 *buf, size_t count);
 76         ssize_t (*put_chars)(uint32_t termno, const u8 *buf, size_t count);
 77         uint32_t        termno;
 78 };
 79 
 80 /* hvsi lib functions */
 81 struct hvc_struct;
 82 extern void hvsilib_init(struct hvsi_priv *pv,
 83                          ssize_t (*get_chars)(uint32_t termno, u8 *buf,
 84                                               size_t count),
 85                          ssize_t (*put_chars)(uint32_t termno, const u8 *buf,
 86                                               size_t count),
 87                          int termno, int is_console);
 88 extern int hvsilib_open(struct hvsi_priv *pv, struct hvc_struct *hp);
 89 extern void hvsilib_close(struct hvsi_priv *pv, struct hvc_struct *hp);
 90 extern int hvsilib_read_mctrl(struct hvsi_priv *pv);
 91 extern int hvsilib_write_mctrl(struct hvsi_priv *pv, int dtr);
 92 extern void hvsilib_establish(struct hvsi_priv *pv);
 93 extern ssize_t hvsilib_get_chars(struct hvsi_priv *pv, u8 *buf, size_t count);
 94 extern ssize_t hvsilib_put_chars(struct hvsi_priv *pv, const u8 *buf,
 95                                  size_t count);
 96 
 97 #endif /* _HVSI_H */
 98 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

sflogo.php