Lines Matching refs:pos
95 pci_read_data(struct pci_dev *d, void *buf, int pos, int len) in pci_read_data() argument
97 if (pos & (len-1)) in pci_read_data()
98 d->access->error("Unaligned read: pos=%02x, len=%d", pos, len); 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()
101 else if (!d->methods->read(d, pos, buf, len)) in pci_read_data()
106 pci_read_byte(struct pci_dev *d, int pos) in pci_read_byte() argument
109 pci_read_data(d, &buf, pos, 1); in pci_read_byte()
114 pci_read_word(struct pci_dev *d, int pos) in pci_read_word() argument
117 pci_read_data(d, &buf, pos, 2); in pci_read_word()
122 pci_read_long(struct pci_dev *d, int pos) in pci_read_long() argument
125 pci_read_data(d, &buf, pos, 4); in pci_read_long()
130 pci_read_block(struct pci_dev *d, int pos, byte *buf, int len) in pci_read_block() argument
132 return d->methods->read(d, pos, buf, len); in pci_read_block()
136 pci_read_vpd(struct pci_dev *d, int pos, byte *buf, int len) in pci_read_vpd() argument
138 return d->methods->read_vpd ? d->methods->read_vpd(d, pos, buf, len) : 0; in pci_read_vpd()
142 pci_write_data(struct pci_dev *d, void *buf, int pos, int len) in pci_write_data() argument
144 if (pos & (len-1)) in pci_write_data()
145 d->access->error("Unaligned write: pos=%02x,len=%d", pos, len); 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()
152 pci_write_byte(struct pci_dev *d, int pos, byte data) in pci_write_byte() argument
154 return pci_write_data(d, &data, pos, 1); in pci_write_byte()
158 pci_write_word(struct pci_dev *d, int pos, word data) in pci_write_word() argument
161 return pci_write_data(d, &buf, pos, 2); in pci_write_word()
165 pci_write_long(struct pci_dev *d, int pos, u32 data) in pci_write_long() argument
168 return pci_write_data(d, &buf, pos, 4); in pci_write_long()
172 pci_write_block(struct pci_dev *d, int pos, byte *buf, int len) in pci_write_block() argument
174 if (pos < d->cache_len) in pci_write_block()
176 int l = (pos + len >= d->cache_len) ? (d->cache_len - pos) : len; in pci_write_block()
177 memcpy(d->cache + pos, buf, l); in pci_write_block()
179 return d->methods->write(d, pos, buf, len); in pci_write_block()