File: topology.h

package info (click to toggle)
coriander 1.0.1-3.1
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 1,376 kB
  • ctags: 943
  • sloc: ansic: 10,305; sh: 3,030; makefile: 131
file content (97 lines) | stat: -rw-r--r-- 2,758 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
/* $Id: topology.h,v 1.4 2004/11/24 05:39:18 ddouxchamps Exp $
 *
 * topology.c - Linux IEEE-1394 topology map fetching routine.
 * This routine serves as a temporary replacement for the
 * raw1394GetTopologyMap routine found in version 0.2 of libraw1394.
 * Written 8.12.1999 by Andreas Micklei
 * adapted for integration within Coriander by Damien Douxchamps
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software Foundation,
 * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 */


#ifndef __TOPOLOGY_H__
#define __TOPOLOGY_H__

#define SHIFT_START	30
#define WIDTH_START	2
#define SHIFT_PHY_ID	24
#define WIDTH_PHY_ID	6
#define SHIFT_CONT	23
#define WIDTH_CONT	1
#define SHIFT_L		22
#define WIDTH_L		1
#define SHIFT_GAP_CNT	16
#define WIDTH_GAP_CNT	6
#define SHIFT_SP	14
#define WIDTH_SP	2
#define SHIFT_DEL	12
#define WIDTH_DEL	2
#define SHIFT_C		11
#define WIDTH_C		1
#define SHIFT_PWR	8
#define WIDTH_PWR	3
#define SHIFT_P0	6
#define WIDTH_P0	2
#define SHIFT_P1	4
#define WIDTH_P1	2
#define SHIFT_P2	2
#define WIDTH_P2	2
#define SHIFT_I		1
#define WIDTH_I		1
#define SHIFT_M		0
#define WIDTH_M		1

#define SHIFT_N		20
#define WIDTH_N		3
#define SHIFT_RSV	18
#define WIDTH_RSV	2
#define SHIFT_PA	16
#define WIDTH_PA	2
#define SHIFT_PB	14
#define WIDTH_PB	2
#define SHIFT_PC	12
#define WIDTH_PC	2
#define SHIFT_PD	10
#define WIDTH_PD	2
#define SHIFT_PE	8
#define WIDTH_PE	2
#define SHIFT_PF	6
#define WIDTH_PF	2
#define SHIFT_PG	4
#define WIDTH_PG	2
#define SHIFT_PH	2
#define WIDTH_PH	2
#define SHIFT_R		1
#define WIDTH_R		1

int decode_selfid(SelfIdPacket_t *selfid, unsigned int *selfid_raw);

unsigned int bit_extract(unsigned int shift, unsigned int width, unsigned int i);

void decode_selfid_zero(SelfIdPacket_t *p, unsigned int i);

void decode_selfid_more(SelfIdPacket_t *p, unsigned int i);

RAW1394topologyMap *raw1394GetTopologyMap(raw1394handle_t handle);

int cooked1394_read(raw1394handle_t handle, nodeid_t node, nodeaddr_t addr,
                 size_t length, quadlet_t *buffer);

int cooked1394_write(raw1394handle_t handle, nodeid_t node, nodeaddr_t addr,
                  size_t length, quadlet_t *data);

#endif // __TOPOLOGY_H__