Home
last modified time | relevance | path

Searched refs:pos (Results 1 – 25 of 29) sorted by relevance

12

/pciutils/lib/
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()
109 pci_read_data(d, &buf, pos, 1); in pci_read_byte()
117 pci_read_data(d, &buf, pos, 2); in pci_read_word()
125 pci_read_data(d, &buf, pos, 4); in pci_read_long()
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()
174 if (pos < d->cache_len) in pci_write_block()
[all …]
H A Di386-ports.c137 int addr = 0xcfc + (pos&3); in conf1_read()
140 if (d->domain || pos >= 256) in conf1_read()
144 return pci_generic_block_read(d, pos, buf, len); in conf1_read()
169 int addr = 0xcfc + (pos&3); in conf1_write()
172 if (d->domain || pos >= 256) in conf1_write()
176 return pci_generic_block_write(d, pos, buf, len); in conf1_write()
228 int addr = 0xc000 | (d->dev << 8) | pos; in conf2_read()
230 if (d->domain || pos >= 256) in conf2_read()
238 return pci_generic_block_read(d, pos, buf, len); in conf2_read()
264 int addr = 0xc000 | (d->dev << 8) | pos; in conf2_write()
[all …]
H A Dgeneric.c220 if ((pos & 1) && len >= 1) in pci_generic_block_op()
222 if (!r(d, pos, buf, 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()
228 if (!r(d, pos, buf, 2)) in pci_generic_block_op()
230 pos += 2; buf += 2; len -= 2; in pci_generic_block_op()
234 if (!r(d, pos, buf, 4)) in pci_generic_block_op()
236 pos += 4; buf += 4; len -= 4; in pci_generic_block_op()
240 if (!r(d, pos, buf, 2)) in pci_generic_block_op()
242 pos += 2; buf += 2; len -= 2; in pci_generic_block_op()
[all …]
H A Dnbsd-libpci.c68 nbsd_read(struct pci_dev *d, int pos, byte *buf, int len) in nbsd_read() argument
74 return pci_generic_block_read(d, pos, buf, len); in nbsd_read()
76 if (d->domain || pos >= 4096) in nbsd_read()
79 shift = 8*(pos % 4); in nbsd_read()
80 pos &= ~3; in nbsd_read()
82 if (pcibus_conf_read(d->access->fd, d->bus, d->dev, d->func, pos, &val) < 0) in nbsd_read()
101 nbsd_write(struct pci_dev *d, int pos, byte *buf, int len) in nbsd_write() argument
107 return pci_generic_block_write(d, pos, buf, len); in nbsd_write()
109 if (d->domain || pos >= 256) in nbsd_write()
118 shift = 8*(pos % 4); in nbsd_write()
[all …]
H A Dmmio-ports.c303 if (pos >= 4096) in conf1_ext_read()
307 return pci_generic_block_read(d, pos, buf, len); in conf1_ext_read()
315 …physmem_writel(0x80000000 | ((pos & 0xf00) << 16) | ((d->bus & 0xff) << 16) | (PCI_DEVFN(d->dev, d… in conf1_ext_read()
335 conf1_read(struct pci_dev *d, int pos, byte *buf, int len) in conf1_read() argument
337 if (pos >= 256) in conf1_read()
340 return conf1_ext_read(d, pos, buf, len); in conf1_read()
351 if (pos >= 4096) in conf1_ext_write()
355 return pci_generic_block_write(d, pos, buf, len); in conf1_ext_write()
363 …physmem_writel(0x80000000 | ((pos & 0xf00) << 16) | ((d->bus & 0xff) << 16) | (PCI_DEVFN(d->dev, d… in conf1_ext_write()
396 if (pos >= 256) in conf1_write()
[all …]
H A Dsylixos-device.c65 sylixos_read(struct pci_dev *d, int pos, byte *buf, int len) in sylixos_read() argument
73 return pci_generic_block_read(d, pos, buf, len); in sylixos_read()
75 if (pos >= 256) in sylixos_read()
81 ret = pciConfigInByte(d->bus, d->dev, d->func, pos, &data_byte); in sylixos_read()
88 ret = pciConfigInWord(d->bus, d->dev, d->func, pos, &data_word); in sylixos_read()
95 ret = pciConfigInDword(d->bus, d->dev, d->func, pos, &data_dword); in sylixos_read()
106 sylixos_write(struct pci_dev *d, int pos, byte *buf, int len) in sylixos_write() argument
114 return pci_generic_block_write(d, pos, buf, len); in sylixos_write()
116 if (pos >= 256) in sylixos_write()
123 ret = pciConfigOutByte(d->bus, d->dev, d->func, pos, data_byte); in sylixos_write()
[all …]
H A Dobsd-device.c58 obsd_read(struct pci_dev *d, int pos, byte *buf, int len) in obsd_read() argument
68 return pci_generic_block_read(d, pos, buf, len); in obsd_read()
70 if (d->domain || pos >= 256) in obsd_read()
77 pi.pi_reg = pos - (pos % 4); in obsd_read()
91 buf[0] = (u8) u.u8[pos % 4]; in obsd_read()
94 ((u16 *) buf)[0] = letoh16(u.u16[(pos % 4) / 2]); in obsd_read()
104 obsd_write(struct pci_dev *d, int pos, byte *buf, int len) in obsd_write() argument
109 return pci_generic_block_write(d, pos, buf, len); in obsd_write()
111 if (d->domain || pos >= 256) in obsd_write()
118 pi.pi_reg = pos; in obsd_write()
H A Dpci.h187 u8 pci_read_byte(struct pci_dev *, int pos) PCI_ABI;
188 u16 pci_read_word(struct pci_dev *, int pos) PCI_ABI;
189 u32 pci_read_long(struct pci_dev *, int pos) PCI_ABI;
190 int pci_read_vpd(struct pci_dev *d, int pos, u8 *buf, int len) PCI_ABI;
191 int pci_write_byte(struct pci_dev *, int pos, u8 data) PCI_ABI;
192 int pci_write_word(struct pci_dev *, int pos, u16 data) PCI_ABI;
193 int pci_write_long(struct pci_dev *, int pos, u32 data) PCI_ABI;
196 int pci_read_block(struct pci_dev *, int pos, u8 *buf, int len) PCI_ABI;
197 int pci_write_block(struct pci_dev *, int pos, u8 *buf, int len) PCI_ABI;
H A Demulated.c75 pci_emulated_read(struct pci_dev *d, int pos, byte *buf, int len) in pci_emulated_read() argument
81 if (pos >= 64) in pci_emulated_read()
85 return pci_generic_block_read(d, pos, buf, len); in pci_emulated_read()
92 switch (pos & ~3) in pci_emulated_read()
122 …if ((pos & ~3) == PCI_BASE_ADDRESS_1 && (ht == PCI_HEADER_TYPE_NORMAL || ht == PCI_HEADER_TYPE_BRI… in pci_emulated_read()
126 switch (pos & ~3) in pci_emulated_read()
150 switch (pos & ~3) in pci_emulated_read()
216 switch (pos & ~3) in pci_emulated_read()
293 val = (val >> (8 * (pos & 3))) & ((1 << (len * 8)) - 1); in pci_emulated_read()
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()
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()
H A Dfbsd-device.c248 fbsd_read(struct pci_dev *d, int pos, byte *buf, int len) in fbsd_read() argument
259 return pci_generic_block_read(d, pos, buf, len); in fbsd_read()
261 if (pos >= 4096) in fbsd_read()
274 pi.pi_reg = pos; in fbsd_read()
300 fbsd_write(struct pci_dev *d, int pos, byte *buf, int len) in fbsd_write() argument
311 return pci_generic_block_write(d, pos, buf, len); in fbsd_write()
313 if (pos >= 4096) in fbsd_write()
326 pi.pi_reg = pos; in fbsd_write()
H A Ddarwin.c112 darwin_read(struct pci_dev *d, int pos, byte *buf, int len) in darwin_read() argument
115 return pci_generic_block_read(d, pos, buf, len); in darwin_read()
125 param.address.pci.offset = pos; in darwin_read()
156 darwin_write(struct pci_dev *d, int pos, byte *buf, int len) in darwin_write() argument
159 return pci_generic_block_write(d, pos, buf, len); in darwin_write()
169 param.address.pci.offset = pos; in darwin_write()
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 Daix-device.c217 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()
226 mdio.md_addr = (ulong) pos; in aix_read()
239 aix_write(struct pci_dev *d, int pos, byte *buf, int len) in aix_write() argument
244 if (d->domain || pos + len > 256) in aix_write()
248 mdio.md_addr = (ulong) pos; in aix_write()
H A Dhurd.c216 hurd_read(struct pci_dev *d, int pos, byte * buf, int len) in hurd_read() argument
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()
250 hurd_write(struct pci_dev *d, int pos, byte * buf, int len) in hurd_write() argument
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()
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()
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()
197 …cess->warning("%s: tried to write %d bytes at %d, but only %d succeeded", __func__, len, pos, res); in rt_thread_smart_dm_write()
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()
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()
203 …access->warning("proc_write: tried to write %d bytes at %d, but only %d succeeded", len, pos, res); in proc_write()
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()
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()
576 …ccess->warning("sysfs_write: tried to write %d bytes at %d, but only %d succeeded", len, pos, res); 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()
H A Decam.c810 mmap_reg(struct pci_access *a, int w, int domain, u8 bus, u8 dev, u8 func, int pos, volatile void *… argument
855 offset = ((dev & 0x1f) << 15) | ((func & 0x7) << 12) | (pos & 0xfff);
1136 ecam_read(struct pci_dev *d, int pos, byte *buf, int len) argument
1140 if (pos >= 4096)
1144 return pci_generic_block_read(d, pos, buf, len);
1146 if (!mmap_reg(d->access, 0, d->domain, d->bus, d->dev, d->func, pos, &reg))
1166 ecam_write(struct pci_dev *d, int pos, byte *buf, int len) argument
1170 if (pos >= 4096)
1174 return pci_generic_block_read(d, pos, buf, len);
1176 if (!mmap_reg(d->access, 1, d->domain, d->bus, d->dev, d->func, pos, &reg))
H A Ddump.c146 dump_read(struct pci_dev *d, int pos, byte *buf, int len) in dump_read() argument
158 if (pos + len > dd->len) in dump_read()
160 memcpy(buf, dd->data + pos, len); in dump_read()
165 dump_write(struct pci_dev *d UNUSED, int pos UNUSED, byte *buf UNUSED, int len UNUSED) in dump_write()
H A Daos-expansion.c171 aos_expansion_read(struct pci_dev *d, int pos, byte *buf, int len) in aos_expansion_read() argument
178 *ptr = ((struct PCIDevice *)(d->backend_data))->ReadConfigByte(pos + i); in aos_expansion_read()
188 aos_expansion_write(struct pci_dev *d, int pos, byte *buf, int len) in aos_expansion_write() argument
196 ((struct PCIDevice *)(d->backend_data))->WriteConfigByte(pos + i, *ptr); in aos_expansion_write()
H A Dnames-hash.c35 unsigned int pos; in id_alloc() local
50 pos = buck->full; in id_alloc()
52 return (byte *)buck + pos; in id_alloc()
/pciutils/
H A Dlspci.c92 unsigned int end = pos+len; in config_fetch()
95 while (pos < d->config_bufsize && len && d->present[pos]) 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()
112 result = pci_read_block(d->dev, pos, d->config + pos, len); in config_fetch()
174 if (!d->present[pos]) in check_conf_range()
177 pos++, len--; in check_conf_range()
184 return d->config[pos]; in get_conf_byte()
191 return d->config[pos] | (d->config[pos+1] << 8); in get_conf_word()
198 return d->config[pos] | in get_conf_long()
[all …]
H A Dlspci.h56 int config_fetch(struct device *d, unsigned int pos, unsigned int len);
57 u32 get_conf_long(struct device *d, unsigned int pos);
58 word get_conf_word(struct device *d, unsigned int pos);
59 byte get_conf_byte(struct device *d, unsigned int pos);
H A Dls-ecaps.c558 int pos = where + PCI_VC_RES_CAP + 12*i; in cap_vc() local
564 if (!config_fetch(d, pos, 12)) in cap_vc()
569 rcap = get_conf_long(d, pos); in cap_vc()
570 rctrl = get_conf_long(d, pos+4); in cap_vc()
571 rstatus = get_conf_word(d, pos+10); in cap_vc()
629 if (!config_fetch(d, pos, PCI_RCLINK_LINK_SIZE)) in cap_rclink()
634 desc = get_conf_long(d, pos + PCI_RCLINK_LINK_DESC); in cap_rclink()
993 int pos = where + PCI_CXL_RL_BLOCK1_LO + 8*i; in dvsec_cxl_register_locator() local
994 if (pos + 7 >= where + len) in dvsec_cxl_register_locator()
997 u32 lo = get_conf_long(d, pos); in dvsec_cxl_register_locator()
[all …]

12