File: swlibs-004-ioctl

package info (click to toggle)
glide 2002.04.10ds1-11
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 59,552 kB
  • ctags: 59,883
  • sloc: ansic: 290,125; asm: 23,305; sh: 8,117; pascal: 3,854; makefile: 1,301; perl: 168
file content (78 lines) | stat: -rw-r--r-- 2,838 bytes parent folder | download | duplicates (6)
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
Status: applied

Index: b/swlibs/newpci/pcilib/fxlinux.c
===================================================================
--- a/swlibs/newpci/pcilib/fxlinux.c
+++ b/swlibs/newpci/pcilib/fxlinux.c
@@ -129,7 +129,7 @@ pciFetchRegisterLinux( FxU32 cmd, FxU32 
   default:
     return 0;
   }
-  if (ioctl(linuxDevFd, _IOR('3', 3, sizeof(struct pioData)), &desc)==-1)
+  if (ioctl(linuxDevFd, _IOR('3', 3, struct pioData), &desc)==-1)
     return 0;
   switch (size) {
   case 1:
@@ -153,7 +153,7 @@ pciUpdateRegisterLinux(FxU32 cmd, FxU32 
   desc.size=size;
   desc.device=device;
   desc.value=&data;
-  if (ioctl(linuxDevFd, _IOW('3', 4, sizeof(struct pioData)), &desc)==-1)
+  if (ioctl(linuxDevFd, _IOW('3', 4, struct pioData), &desc)==-1)
     return FXFALSE;
   return FXTRUE;
 }
@@ -253,7 +253,7 @@ pciPortInByteLinux(unsigned short port) 
   desc.size=sizeof(tmp);
   desc.value=&tmp;
   /* fprintf(stderr, "Read byte desc at %x tmp at %x\n", &desc, &tmp); */
-  ioctl(linuxDevFd, _IOR(0, 0, sizeof(struct pioData)), &desc);
+  ioctl(linuxDevFd, _IOR(0, 0, struct pioData), &desc);
   /* fprintf(stderr, "Got byte %d versus %d\n", tmp, inb(port)); */
   return tmp;
 }
@@ -273,7 +273,7 @@ pciPortInWordLinux(unsigned short port) 
   desc.size=sizeof(tmp);
   desc.value=&tmp;
   /* fprintf(stderr, "Read word desc at %x tmp at %x\n", &desc, &tmp); */
-  ioctl(linuxDevFd, _IOR(0, 0, sizeof(struct pioData)), &desc);
+  ioctl(linuxDevFd, _IOR(0, 0, struct pioData), &desc);
   /* fprintf(stderr, "Got word %d versus %d\n", tmp, inw(port)); */
   return tmp;
 }
@@ -293,7 +293,7 @@ pciPortInLongLinux(unsigned short port) 
   desc.size=sizeof(tmp);
   desc.value=&tmp;
   /* fprintf(stderr, "Read long desc at %x tmp at %x\n", &desc, &tmp); */
-  ioctl(linuxDevFd, _IOR(0, 0, sizeof(struct pioData)), &desc);
+  ioctl(linuxDevFd, _IOR(0, 0, struct pioData), &desc);
   /* fprintf(stderr, "Got long %x versus %x\n", tmp, inl(port)); */
   return tmp;
 }
@@ -311,7 +311,7 @@ pciPortOutByteLinux(unsigned short port,
   desc.port=port;
   desc.size=sizeof(data);
   desc.value=&data;
-  return ioctl(linuxDevFd, _IOW(0, 1, sizeof(struct pioData)), &desc)!=-1;
+  return ioctl(linuxDevFd, _IOW(0, 1, struct pioData), &desc)!=-1;
 }
 
 static FxBool 
@@ -327,7 +327,7 @@ pciPortOutWordLinux(unsigned short port,
   desc.port=port;
   desc.size=sizeof(data);
   desc.value=&data;
-  return ioctl(linuxDevFd, _IOW(0, 1, sizeof(struct pioData)), &desc)!=-1;
+  return ioctl(linuxDevFd, _IOW(0, 1, struct pioData), &desc)!=-1;
 }
 
 static FxBool 
@@ -343,7 +343,7 @@ pciPortOutLongLinux(unsigned short port,
   desc.port=port;
   desc.size=sizeof(data);
   desc.value=&data;
-  return ioctl(linuxDevFd, _IOW(0, 1, sizeof(struct pioData)), &desc)!=-1;
+  return ioctl(linuxDevFd, _IOW(0, 1, struct pioData), &desc)!=-1;
 }
 
 static FxBool