source: drsdaq/VME/struck/sis1100/V2.02/test.orig/check_3100_ident.c@ 22

Last change on this file since 22 was 22, checked in by ogrimm, 16 years ago
First commit of drsdaq program
File size: 1.6 KB
Line 
1/*
2 * $ZEL$
3 */
4
5#include "test_3100.h"
6
7static void
8print_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
23int
24check_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}
Note: See TracBrowser for help on using the repository browser.