2 * $Id: buffer.c,v 1.1 1999/01/22 21:05:14 mj Exp $
4 * The PCI Library -- Buffered Access
6 * Copyright (c) 1997--1999 Martin Mares <mj@atrey.karlin.mff.cuni.cz>
8 * Can be freely distributed and used under the terms of the GNU GPL.
19 buff_read(struct pci_dev *d, int pos, byte *buf, int len)
21 memcpy(buf, (byte *)d->aux + pos, len);
26 buff_write(struct pci_dev *d, int UNUSED pos, byte * UNUSED buf, int UNUSED len)
28 d->access->error("buffer: Writing to configuration space not supported.");
32 static struct pci_methods pm_buffer = {
35 NULL, /* Shall not be called */
36 NULL, /* No init nor cleanup */
38 NULL, /* No scanning */
39 pci_generic_fill_info,
43 NULL /* cleanup_dev */
47 pci_setup_buffer(struct pci_dev *d, byte *buf)
49 if (d->methods->cleanup_dev)
50 d->methods->cleanup_dev(d);
51 d->methods = &pm_buffer;