source: drsdaq/VME/struck/sis1100/V2.02/test.orig/check_3100_rw.c@ 23

Last change on this file since 23 was 22, checked in by ogrimm, 16 years ago
First commit of drsdaq program
File size: 1.9 KB
Line 
1/*
2 * $ZEL$
3 */
4
5#include "test_3100.h"
6
7/*
8static int
9check_rw_remote(struct path* path)
10{
11 struct vmespace space;
12 int res, size;
13
14 printf("testing sdram over VME\n");
15 if (vme_probe(path, VMESTART)) return 0;
16
17 space.am=0x9;
18 space.datasize=4;
19 space.swap=1;
20 space.mapit=0;
21 space.mindmalen=-1;
22 res=ioctl(path->p, SIS1100_SETVMESPACE, &space);
23 if (res) {
24 printf("SETVMESPACE(%s): %s\n", path->name, strerror(errno));
25 return -1;
26 }
27 if (check_rw_single(path, VMESTART, 10000)<0) return -1;
28
29 space.am=0xb;
30 res=ioctl(path->p, SIS1100_SETVMESPACE, &space);
31 if (res) {
32 printf("SETVMESPACE(%s): %s\n", path->name, strerror(errno));
33 return -1;
34 }
35 size=1;
36 while (check_rw_block(path, VMESTART, size)>=0) {
37 printf(".");
38 fflush(stdout);
39 size<<=4;
40 }
41 printf("OK.\n");
42 return 0;
43}
44*/
45
46static int
47check_rw_ram(struct path* path)
48{
49 printf("testing sdram\n");
50 if (check_rw_single(path, 0, 1000)<0) return -1;
51 if (check_r_block(path, 0, bufsize)<0) return -1;
52 if (check_w_block(path, 0, bufsize)<0) return -1;
53 printf("OK.\n");
54 return 0;
55}
56
57static int
58check_rw_ctrl(struct path* path)
59{
60 return 0;
61}
62
63static int
64check_rw_dsp(struct path* path)
65{
66 return 0;
67}
68
69int
70check_rw(struct path* path)
71{
72 int res;
73 switch (path->type) {
74 case sis1100_subdev_remote:
75 /*if ((res=check_rw_remote(path))<0) return res;*/
76 break;
77 case sis1100_subdev_ram:
78 if ((res=check_rw_ram(path))<0) return res;
79 break;
80#if MAJORVERSION >= 2
81 case sis1100_subdev_ctrl:
82 if ((res=check_rw_ctrl(path))<0) return res;
83 break;
84#endif
85 case sis1100_subdev_dsp:
86 if ((res=check_rw_dsp(path))<0) return res;
87 break;
88 default:
89 printf("check_rw: %s has unknown type %d\n",
90 path->name, path->type);
91 return -1;
92 }
93 return 0;
94}
95
Note: See TracBrowser for help on using the repository browser.