Home
last modified time | relevance | path

Searched refs:len (Results 1 – 25 of 34) sorted by relevance

12

/pciutils/lib/
H A Di386-ports.c143 if (len != 1 && len != 2 && len != 4) in conf1_read()
144 return pci_generic_block_read(d, pos, buf, len); in conf1_read()
149 switch (len) in conf1_read()
175 if (len != 1 && len != 2 && len != 4) in conf1_write()
176 return pci_generic_block_write(d, pos, buf, len); in conf1_write()
181 switch (len) in conf1_write()
237 if (len != 1 && len != 2 && len != 4) in conf2_read()
238 return pci_generic_block_read(d, pos, buf, len); in conf2_read()
243 switch (len) in conf2_read()
273 if (len != 1 && len != 2 && len != 4) in conf2_write()
[all …]
H A Daccess.c97 if (pos & (len-1)) in pci_read_data()
99 if (pos + len <= d->cache_len) in pci_read_data()
100 memcpy(buf, d->cache + pos, len); in pci_read_data()
102 memset(buf, 0xff, len); in pci_read_data()
132 return d->methods->read(d, pos, buf, len); in pci_read_block()
144 if (pos & (len-1)) in pci_write_data()
146 if (pos + len <= d->cache_len) in pci_write_data()
147 memcpy(d->cache + pos, buf, len); in pci_write_data()
148 return d->methods->write(d, pos, buf, len); in pci_write_data()
176 int l = (pos + len >= d->cache_len) ? (d->cache_len - pos) : len; in pci_write_block()
[all …]
H A Dinit.c54 if (len != sizeof(info)) in get_current_module_handle()
261 int len = strlen(s) + 1; in pci_strdup() local
263 memcpy(t, s, len); in pci_strdup()
299 size_t len; in pci_init_name_list_path() local
333 else if (len == 0) in pci_init_name_list_path()
348 len -= 2; in pci_init_name_list_path()
349 path[len] = '\0'; in pci_init_name_list_path()
372 len += 4; in pci_init_name_list_path()
373 path[len] = '\0'; in pci_init_name_list_path()
386 len = strlen(exe_path); in pci_init_name_list_path()
[all …]
H A Ddump.c19 int len, allocated; member
40 dd->allocated = len; in dump_alloc_data()
41 dd->len = 0; in dump_alloc_data()
42 memset(dd->data, 0xff, len); in dump_alloc_data()
65 int len, mn, bn, dn, fn, i, j; in dump_init() local
82 len = z - buf + 1; in dump_init()
93 else if (!len) in dump_init()
119 if (i > dd->len) in dump_init()
120 dd->len = i; in dump_init()
158 if (pos + len > dd->len) in dump_read()
[all …]
H A Dnbsd-libpci.c68 nbsd_read(struct pci_dev *d, int pos, byte *buf, int len) in nbsd_read() argument
73 if (!(len == 1 || len == 2 || len == 4)) in nbsd_read()
74 return pci_generic_block_read(d, pos, buf, len); in nbsd_read()
85 switch (len) in nbsd_read()
101 nbsd_write(struct pci_dev *d, int pos, byte *buf, int len) in nbsd_write() argument
106 if (!(len == 1 || len == 2 || len == 4)) in nbsd_write()
107 return pci_generic_block_write(d, pos, buf, len); in nbsd_write()
120 if (len != 4) in nbsd_write()
126 switch (len) in nbsd_write()
H A Dobsd-device.c58 obsd_read(struct pci_dev *d, int pos, byte *buf, int len) in obsd_read() argument
67 if (!(len == 1 || len == 2 || len == 4)) in obsd_read()
68 return pci_generic_block_read(d, pos, buf, len); in obsd_read()
88 switch (len) in obsd_read()
104 obsd_write(struct pci_dev *d, int pos, byte *buf, int len) in obsd_write() argument
108 if (!(len == 1 || len == 2 || len == 4)) in obsd_write()
109 return pci_generic_block_write(d, pos, buf, len); in obsd_write()
119 pi.pi_width = len; in obsd_write()
121 switch (len) in obsd_write()
H A Ddarwin.c112 darwin_read(struct pci_dev *d, int pos, byte *buf, int len) in darwin_read() argument
114 if (!(len == 1 || len == 2 || len == 4)) in darwin_read()
115 return pci_generic_block_read(d, pos, buf, len); in darwin_read()
121 param.bitWidth = len * 8; in darwin_read()
140 switch (len) in darwin_read()
156 darwin_write(struct pci_dev *d, int pos, byte *buf, int len) in darwin_write() argument
158 if (!(len == 1 || len == 2 || len == 4)) in darwin_write()
159 return pci_generic_block_write(d, pos, buf, len); in darwin_write()
165 param.bitWidth = len * 8; in darwin_write()
176 switch (len) in darwin_write()
H A Dsylixos-device.c65 sylixos_read(struct pci_dev *d, int pos, byte *buf, int len) in sylixos_read() argument
72 if (!(len == 1 || len == 2 || len == 4)) in sylixos_read()
73 return pci_generic_block_read(d, pos, buf, len); in sylixos_read()
78 switch (len) in sylixos_read()
106 sylixos_write(struct pci_dev *d, int pos, byte *buf, int len) in sylixos_write() argument
113 if (!(len == 1 || len == 2 || len == 4)) in sylixos_write()
114 return pci_generic_block_write(d, pos, buf, len); in sylixos_write()
119 switch (len) in sylixos_write()
H A Dgeneric.c217 pci_generic_block_op(struct pci_dev *d, int pos, byte *buf, int len, in pci_generic_block_op() argument
218 int (*r)(struct pci_dev *d, int pos, byte *buf, int len)) in pci_generic_block_op()
220 if ((pos & 1) && len >= 1) in pci_generic_block_op()
224 pos++; buf++; len--; in pci_generic_block_op()
226 if ((pos & 3) && len >= 2) in pci_generic_block_op()
230 pos += 2; buf += 2; len -= 2; in pci_generic_block_op()
232 while (len >= 4) in pci_generic_block_op()
236 pos += 4; buf += 4; len -= 4; in pci_generic_block_op()
238 if (len >= 2) in pci_generic_block_op()
242 pos += 2; buf += 2; len -= 2; in pci_generic_block_op()
[all …]
H A Daix-device.c129 int len; in aix_detect() local
144 len = strlen(buf); in aix_detect()
145 while (buf[len-1] == '\n' || buf[len-1] == '\r') in aix_detect()
146 len--; in aix_detect()
147 buf[len] = '\0'; /* clobber the newline */ in aix_detect()
149 name = (char *) pci_malloc(a, len + 1); in aix_detect()
217 aix_read(struct pci_dev *d, int pos, byte *buf, int len) in aix_read() argument
222 if (d->domain || pos + len > 256) in aix_read()
227 mdio.md_size = len; in aix_read()
244 if (d->domain || pos + len > 256) in aix_write()
[all …]
H A Dmmio-ports.c296 conf1_ext_read(struct pci_dev *d, int pos, byte *buf, int len) in conf1_ext_read() argument
306 if (len != 1 && len != 2 && len != 4) in conf1_ext_read()
307 return pci_generic_block_read(d, pos, buf, len); in conf1_ext_read()
318 switch (len) in conf1_ext_read()
335 conf1_read(struct pci_dev *d, int pos, byte *buf, int len) in conf1_read() argument
340 return conf1_ext_read(d, pos, buf, len); in conf1_read()
354 if (len != 1 && len != 2 && len != 4) in conf1_ext_write()
355 return pci_generic_block_write(d, pos, buf, len); in conf1_ext_write()
366 switch (len) in conf1_ext_write()
394 conf1_write(struct pci_dev *d, int pos, byte *buf, int len) in conf1_write() argument
[all …]
H A Dfbsd-device.c248 fbsd_read(struct pci_dev *d, int pos, byte *buf, int len) in fbsd_read() argument
258 if (!(len == 1 || len == 2 || len == 4)) in fbsd_read()
259 return pci_generic_block_read(d, pos, buf, len); in fbsd_read()
275 pi.pi_width = len; in fbsd_read()
284 switch (len) in fbsd_read()
300 fbsd_write(struct pci_dev *d, int pos, byte *buf, int len) in fbsd_write() argument
310 if (!(len == 1 || len == 2 || len == 4)) in fbsd_write()
311 return pci_generic_block_write(d, pos, buf, len); in fbsd_write()
327 pi.pi_width = len; in fbsd_write()
329 switch (len) in fbsd_write()
H A Dwin32-cfgmgr32.c236 for (i = 0; i < len; i++) in fmt_validate()
246 int i, len; in seq_xdigit_validate() local
248 len = strlen(s); in seq_xdigit_validate()
249 if (len < min*mult || len % mult) in seq_xdigit_validate()
252 for (i = 0; i < len; i++) in seq_xdigit_validate()
599 if (len >= 4 && strcasecmp(driver + len - 4, ".vxd") == 0) in driver_cmp()
600 len -= 4; in driver_cmp()
617 int len; in get_driver_path_for_regkey() local
721 noext = driver_ptr && (len < 4 || driver_ptr[len-4] != '.'); in get_driver_path_for_regkey()
1323 int len; in fill_data_from_string() local
[all …]
H A Dhurd.c216 hurd_read(struct pci_dev *d, int pos, byte * buf, int len) in hurd_read() argument
223 if (len > 4) in hurd_read()
224 return pci_generic_block_read(d, pos, buf, len); in hurd_read()
227 err = pci_conf_read(device_port, pos, &data, &nread, len); in hurd_read()
231 if (nread > (size_t) len) /* Sanity check for bogus server. */ in hurd_read()
241 return !err && nread == (size_t) len; in hurd_read()
250 hurd_write(struct pci_dev *d, int pos, byte * buf, int len) in hurd_write() argument
256 if (len > 4) in hurd_write()
257 return pci_generic_block_write(d, pos, buf, len); in hurd_write()
259 err = pci_conf_write(device_port, pos, (char *) buf, len, &nwrote); in hurd_write()
[all …]
H A Decam.c127 while (len-- > 0) in calculate_checksum()
236 size_t len; in find_rsdp_address() local
249 len = strlen(buf); in find_rsdp_address()
250 while (len > 0 && buf[len-1] == '\n') in find_rsdp_address()
251 buf[--len] = '\0'; in find_rsdp_address()
293 len = sizeof(ulnum); in find_rsdp_address()
304 len = sizeof(ulnum); in find_rsdp_address()
1143 if (len != 1 && len != 2 && len != 4)
1149 switch (len)
1173 if (len != 1 && len != 2 && len != 4)
[all …]
H A Dwin32-sysdbg.c246 win32_sysdbg_read(struct pci_dev *d, int pos, byte *buf, int len) in win32_sysdbg_read() argument
251 if ((unsigned int)d->domain > 0 || (unsigned int)pos > 255 || (unsigned int)(pos+len) > 256) in win32_sysdbg_read()
254 status = win32_sysdbg_pci_bus_data(FALSE, d->bus, d->dev, d->func, pos, buf, len, &ret_len); in win32_sysdbg_read()
255 if (status < 0 || ret_len != (unsigned int)len) in win32_sysdbg_read()
262 win32_sysdbg_write(struct pci_dev *d, int pos, byte *buf, int len) in win32_sysdbg_write() argument
267 if ((unsigned int)d->domain > 0 || (unsigned int)pos > 255 || (unsigned int)(pos+len) > 256) in win32_sysdbg_write()
270 status = win32_sysdbg_pci_bus_data(TRUE, d->bus, d->dev, d->func, pos, buf, len, &ret_len); in win32_sysdbg_write()
271 if (status < 0 || ret_len != (unsigned int)len) in win32_sysdbg_write()
H A Drt-thread-smart-dm.c163 rt_thread_smart_dm_read(struct pci_dev *d, int pos, byte *buf, int len) in rt_thread_smart_dm_read() argument
170 res = pread(fd, buf, len, pos); in rt_thread_smart_dm_read()
176 else if (res != len) in rt_thread_smart_dm_read()
182 rt_thread_smart_dm_write(struct pci_dev *d, int pos, byte *buf, int len) in rt_thread_smart_dm_write() argument
189 res = pwrite(fd, buf, len, pos); in rt_thread_smart_dm_write()
195 else if (res != len) in rt_thread_smart_dm_write()
197 …d->access->warning("%s: tried to write %d bytes at %d, but only %d succeeded", __func__, len, pos,… in rt_thread_smart_dm_write()
H A Dnames-parse.c28 size_t len; in pci_open() local
34 len = strlen(a->id_file_name); in pci_open()
35 if (len < 3 || memcmp(a->id_file_name + len - 3, ".gz", 3) != 0) in pci_open()
37 new_name = malloc(len - 2); in pci_open()
38 memcpy(new_name, a->id_file_name, len - 3); in pci_open()
39 new_name[len - 3] = 0; in pci_open()
H A Dproc.c169 proc_read(struct pci_dev *d, int pos, byte *buf, int len) in proc_read() argument
176 res = pread(fd, buf, len, pos); in proc_read()
182 else if (res != len) in proc_read()
188 proc_write(struct pci_dev *d, int pos, byte *buf, int len) in proc_write() argument
195 res = pwrite(fd, buf, len, pos); in proc_write()
201 else if (res != len) in proc_write()
203 …d->access->warning("proc_write: tried to write %d bytes at %d, but only %d succeeded", len, pos, r… in proc_write()
H A Dwin32-helpers.c134 DWORD len; in win32_strerror() local
142len = format_message_from_system(win32_error_id, MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US), buf… in win32_strerror()
143 if (!len) in win32_strerror()
144len = format_message_from_system(win32_error_id, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), buffer… in win32_strerror()
147 if (len && buffer[len-1] == '\n') in win32_strerror()
148 buffer[--len] = '\0'; in win32_strerror()
149 if (len && buffer[len-1] == '\r') in win32_strerror()
150 buffer[--len] = '\0'; in win32_strerror()
151 if (len && buffer[len-1] == '.') in win32_strerror()
152 buffer[--len] = '\0'; in win32_strerror()
[all …]
H A Dinternal.h68 int (*read)(struct pci_dev *, int pos, byte *buf, int len);
69 int (*write)(struct pci_dev *, int pos, byte *buf, int len);
70 int (*read_vpd)(struct pci_dev *, int pos, byte *buf, int len);
80 int pci_generic_block_read(struct pci_dev *, int pos, byte *buf, int len);
81 int pci_generic_block_write(struct pci_dev *, int pos, byte *buf, int len);
84 int pci_emulated_read(struct pci_dev *d, int pos, byte *buf, int len);
H A Dsysfs.c543 static int sysfs_read(struct pci_dev *d, int pos, byte *buf, int len) in sysfs_read() argument
550 res = pread(fd, buf, len, pos); in sysfs_read()
556 else if (res != len) in sysfs_read()
561 static int sysfs_write(struct pci_dev *d, int pos, byte *buf, int len) in sysfs_write() argument
568 res = pwrite(fd, buf, len, pos); in sysfs_write()
574 else if (res != len) in sysfs_write()
576 …d->access->warning("sysfs_write: tried to write %d bytes at %d, but only %d succeeded", len, pos, … in sysfs_write()
582 static int sysfs_read_vpd(struct pci_dev *d, int pos, byte *buf, int len) in sysfs_read_vpd() argument
589 res = pread(fd, buf, len, pos); in sysfs_read_vpd()
595 else if (res != len) in sysfs_read_vpd()
/pciutils/
H A Dls-vpd.c58 print_vpd_string(const byte *buf, word len) in print_vpd_string() argument
60 while (len--) in print_vpd_string()
65 else if (!ch && !len) in print_vpd_string()
75 print_vpd_binary(const byte *buf, word len) in print_vpd_binary() argument
78 for (i = 0; i < len; i++) in print_vpd_binary()
87 read_vpd(struct device *d, int pos, byte *buf, int len, byte *csum) in read_vpd() argument
89 if (!pci_read_vpd(d->dev, pos, buf, len)) in read_vpd()
91 while (len--) in read_vpd()
H A Dlspci.c92 unsigned int end = pos+len; in config_fetch()
96 pos++, len--; in config_fetch()
97 while (pos+len <= d->config_bufsize && len && d->present[pos+len-1]) in config_fetch()
98 len--; in config_fetch()
99 if (!len) in config_fetch()
173 while (len) in check_conf_range()
177 pos++, len--; in check_conf_range()
417 if (!pos && !flg && !len) in show_bases()
489 show_size(len); in show_bases()
505 if (!rom && !flg && !len) in show_rom()
[all …]
H A Dls-ecaps.c876 if (rev >= 1 && len >= PCI_CXL_DEV_LEN) in dvsec_cxl_device()
950 if (len > PCI_CXL_DEV_LEN_REV2) in dvsec_cxl_device()
960 if (len < PCI_CXL_PORT_EXT_LEN) in dvsec_cxl_port()
994 if (pos + 7 >= where + len) in dvsec_cxl_register_locator()
1139 if (len != PCI_CXL_FB_MOD_TS_DATA) in dvsec_cxl_flex_bus()
1143 if (len != PCI_CXL_FB_PORT_CAP2) in dvsec_cxl_flex_bus()
1214 if (len > PCI_CXL_FB_LEN) in dvsec_cxl_flex_bus()
1266 if (!config_fetch(d, where, len)) in cap_dvsec_cxl()
1281 dvsec_cxl_port(d, where, len); in cap_dvsec_cxl()
1324 u16 len = BITS(hdr, 20, 12); in cap_dvsec() local
[all …]

12