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

TOMOYO Linux Cross Reference
Linux/include/linux/isdn/capiutil.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 /* $Id: capiutil.h,v 1.5.6.2 2001/09/23 22:24:33 kai Exp $
  2  *
  3  * CAPI 2.0 defines & types
  4  *
  5  * From CAPI 2.0 Development Kit AVM 1995 (msg.c)
  6  * Rewritten for Linux 1996 by Carsten Paeth <calle@calle.de>
  7  *
  8  * This software may be used and distributed according to the terms
  9  * of the GNU General Public License, incorporated herein by reference.
 10  *
 11  */
 12 
 13 #ifndef __CAPIUTIL_H__
 14 #define __CAPIUTIL_H__
 15 
 16 #include <asm/types.h>
 17 
 18 #define CAPIMSG_BASELEN         8
 19 #define CAPIMSG_U8(m, off)      (m[off])
 20 #define CAPIMSG_U16(m, off)     (m[off]|(m[(off)+1]<<8))
 21 #define CAPIMSG_U32(m, off)     (m[off]|(m[(off)+1]<<8)|(m[(off)+2]<<16)|(m[(off)+3]<<24))
 22 #define CAPIMSG_LEN(m)          CAPIMSG_U16(m,0)
 23 #define CAPIMSG_APPID(m)        CAPIMSG_U16(m,2)
 24 #define CAPIMSG_COMMAND(m)      CAPIMSG_U8(m,4)
 25 #define CAPIMSG_SUBCOMMAND(m)   CAPIMSG_U8(m,5)
 26 #define CAPIMSG_CMD(m)          (((m[4])<<8)|(m[5]))
 27 #define CAPIMSG_MSGID(m)        CAPIMSG_U16(m,6)
 28 #define CAPIMSG_CONTROLLER(m)   (m[8] & 0x7f)
 29 #define CAPIMSG_CONTROL(m)      CAPIMSG_U32(m, 8)
 30 #define CAPIMSG_NCCI(m)         CAPIMSG_CONTROL(m)
 31 #define CAPIMSG_DATALEN(m)      CAPIMSG_U16(m,16) /* DATA_B3_REQ */
 32 
 33 static inline void capimsg_setu8(void *m, int off, __u8 val)
 34 {
 35         ((__u8 *)m)[off] = val;
 36 }
 37 
 38 static inline void capimsg_setu16(void *m, int off, __u16 val)
 39 {
 40         ((__u8 *)m)[off] = val & 0xff;
 41         ((__u8 *)m)[off+1] = (val >> 8) & 0xff;
 42 }
 43 
 44 static inline void capimsg_setu32(void *m, int off, __u32 val)
 45 {
 46         ((__u8 *)m)[off] = val & 0xff;
 47         ((__u8 *)m)[off+1] = (val >> 8) & 0xff;
 48         ((__u8 *)m)[off+2] = (val >> 16) & 0xff;
 49         ((__u8 *)m)[off+3] = (val >> 24) & 0xff;
 50 }
 51 
 52 #define CAPIMSG_SETLEN(m, len)          capimsg_setu16(m, 0, len)
 53 #define CAPIMSG_SETAPPID(m, applid)     capimsg_setu16(m, 2, applid)
 54 #define CAPIMSG_SETCOMMAND(m,cmd)       capimsg_setu8(m, 4, cmd)
 55 #define CAPIMSG_SETSUBCOMMAND(m, cmd)   capimsg_setu8(m, 5, cmd)
 56 #define CAPIMSG_SETMSGID(m, msgid)      capimsg_setu16(m, 6, msgid)
 57 #define CAPIMSG_SETCONTROL(m, contr)    capimsg_setu32(m, 8, contr)
 58 #define CAPIMSG_SETDATALEN(m, len)      capimsg_setu16(m, 16, len)
 59 
 60 #endif                          /* __CAPIUTIL_H__ */
 61 

~ [ 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