Blame view

include/linux/if_ec.h 1.54 KB
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
1
2
3
4
5
6
  /* Definitions for Econet sockets. */
  
  #ifndef __LINUX_IF_EC
  #define __LINUX_IF_EC
  
  /* User visible stuff. Glibc provides its own but libc5 folk will use these */
d94d9fee9   Eric Dumazet   net: cleanup incl...
7
  struct ec_addr {
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
8
9
10
    unsigned char station;		/* Station number.  */
    unsigned char net;			/* Network number.  */
  };
d94d9fee9   Eric Dumazet   net: cleanup incl...
11
  struct sockaddr_ec {
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
    unsigned short sec_family;
    unsigned char port;			/* Port number.  */
    unsigned char cb;			/* Control/flag byte.  */
    unsigned char type;			/* Type of message.  */
    struct ec_addr addr;
    unsigned long cookie;
  };
  
  #define ECTYPE_PACKET_RECEIVED		0	/* Packet received */
  #define ECTYPE_TRANSMIT_STATUS		0x10	/* Transmit completed, 
  						   low nibble holds status */
  
  #define ECTYPE_TRANSMIT_OK		1
  #define ECTYPE_TRANSMIT_NOT_LISTENING	2
  #define ECTYPE_TRANSMIT_NET_ERROR	3
  #define ECTYPE_TRANSMIT_NO_CLOCK	4
  #define ECTYPE_TRANSMIT_LINE_JAMMED	5
  #define ECTYPE_TRANSMIT_NOT_PRESENT	6
  
  #ifdef __KERNEL__
  
  #define EC_HLEN				6
  
  /* This is what an Econet frame looks like on the wire. */
d94d9fee9   Eric Dumazet   net: cleanup incl...
36
  struct ec_framehdr {
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
    unsigned char dst_stn;
    unsigned char dst_net;
    unsigned char src_stn;
    unsigned char src_net;
    unsigned char cb;
    unsigned char port;
  };
  
  struct econet_sock {
    /* struct sock has to be the first member of econet_sock */
    struct sock	sk;
    unsigned char cb;
    unsigned char port;
    unsigned char station;
    unsigned char net;
    unsigned short num;
  };
  
  static inline struct econet_sock *ec_sk(const struct sock *sk)
  {
  	return (struct econet_sock *)sk;
  }
d94d9fee9   Eric Dumazet   net: cleanup incl...
59
  struct ec_device {
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
60
61
62
63
64
65
    unsigned char station, net;		/* Econet protocol address */
  };
  
  #endif
  
  #endif