1 | /*
|
---|
2 | * $ZEL$
|
---|
3 | */
|
---|
4 |
|
---|
5 | #include "test_3100.h"
|
---|
6 |
|
---|
7 | static void
|
---|
8 | print_ident(struct sis1100_ident_dev* ident)
|
---|
9 | {
|
---|
10 | printf(" hw_type =%2d ", ident->hw_type);
|
---|
11 | switch (ident->hw_type) {
|
---|
12 | case 1: printf(" (PCI/PLX)"); break;
|
---|
13 | case 2: printf(" (VME)"); break;
|
---|
14 | case 3: printf(" (CAMAC/FERA)"); break;
|
---|
15 | case 4: printf(" (LVD/SCSI)"); break;
|
---|
16 | }
|
---|
17 | printf("\n");
|
---|
18 | printf(" hw_version=%2d\n", ident->hw_version);
|
---|
19 | printf(" fw_type =%2d\n", ident->fw_type);
|
---|
20 | printf(" fw_version=%2d\n", ident->fw_version);
|
---|
21 | }
|
---|
22 |
|
---|
23 | int
|
---|
24 | check_IDENT(struct path* path)
|
---|
25 | {
|
---|
26 | if (ioctl(path->p, SIS1100_IDENT, &path->ident)<0) {
|
---|
27 | printf("ioctl(%s, SIS1100_IDENT): %s\n", path->name, strerror(errno));
|
---|
28 | return -1;
|
---|
29 | }
|
---|
30 | switch (path->type) {
|
---|
31 | case sis1100_subdev_remote:
|
---|
32 | printf("Local Interface:\n");
|
---|
33 | print_ident(&path->ident.local);
|
---|
34 | if (path->ident.remote_ok) {
|
---|
35 | printf("Remote Interface:\n");
|
---|
36 | print_ident(&path->ident.remote);
|
---|
37 | printf(" remote interface o%sline\n",
|
---|
38 | path->ident.remote_online?"n":"ff");
|
---|
39 | } else
|
---|
40 | printf("no remote interface\n");
|
---|
41 | break;
|
---|
42 | #if MAJORVERSION >= 2
|
---|
43 | case sis1100_subdev_ctrl: {
|
---|
44 | u_int32_t val;
|
---|
45 | if (path->map) {
|
---|
46 | /* read first word */
|
---|
47 | val=path->map[0];
|
---|
48 | printf("subdev_ctrl: map[0]=0x%08x\n", val);
|
---|
49 | path->map[0]=0x12345678;
|
---|
50 | val=path->map[0];
|
---|
51 | printf("subdev_ctrl: map[0]=0x%08x\n", val);
|
---|
52 | }
|
---|
53 | }
|
---|
54 | break;
|
---|
55 | #endif
|
---|
56 | }
|
---|
57 |
|
---|
58 | return 0;
|
---|
59 | }
|
---|