Lines Matching refs:fd
91 int fd;
98 fd = open(fn, O_RDONLY);
100 if (fd >= 0)
101 return fd;
111 static int get_reg(int fd, int fn, off_t off)
119 ret = ioctl(fd, DS_ACCESS_CONFIGURATION_REGISTER, &arg);
127 static int dump_option(int fd, int fn, int mfc)
129 int v = get_reg(fd, fn, CISREG_COR);
146 static void dump_status(int fd, int fn)
148 int v = get_reg(fd, fn, CISREG_CCSR);
162 static void dump_pin(int fd, int fn)
164 int v = get_reg(fd, fn, CISREG_PRR);
179 static void dump_copy(int fd, int fn)
181 int v = get_reg(fd, fn, CISREG_SCR);
189 static void dump_ext_status(int fd, int fn)
191 int v = get_reg(fd, fn, CISREG_ESR);
201 static void dump_all(int fd, int fn, int mfc, u_int mask)
205 if (dump_option(fd, fn, mfc) != 0)
209 dump_status(fd, fn);
211 dump_pin(fd, fn);
213 dump_copy(fd, fn);
215 dump_ext_status(fd, fn);
217 addr = get_reg(fd, fn, CISREG_IOBASE_0);
218 addr += get_reg(fd, fn, CISREG_IOBASE_1) << 8;
222 printf(" IO size = %d\n", get_reg(fd, fn, CISREG_IOSIZE));
235 int i, j, nfn, fd, ret;
248 fd = open_sock(i);
249 if (fd < 0) break;
255 if (ioctl(fd, DS_GET_FIRST_TUPLE, &arg) == 0) {
256 ioctl(fd, DS_GET_TUPLE_DATA, &arg);
257 ioctl(fd, DS_PARSE_TUPLE, &arg);
262 ret = ioctl(fd, DS_GET_FIRST_TUPLE, &arg);
273 if (ioctl(fd, DS_GET_NEXT_TUPLE, &arg) != 0) {
277 ioctl(fd, DS_GET_TUPLE_DATA, &arg);
278 ioctl(fd, DS_PARSE_TUPLE, &arg);
283 dump_all(fd, j, (nfn > 1), mask);