Lines Matching refs:dev

34 static void *command_init(struct pci_dev *dev, int offset)  in command_init()  argument
42 err = pci_read_config_word(dev, PCI_COMMAND, &cmd->val); in command_init()
51 static int command_read(struct pci_dev *dev, int offset, u16 *value, void *data) in command_read() argument
53 int ret = pci_read_config_word(dev, offset, value); in command_read()
62 static int command_write(struct pci_dev *dev, int offset, u16 value, void *data) in command_write() argument
69 dev_data = pci_get_drvdata(dev); in command_write()
70 if (!pci_is_enabled(dev) && is_enable_cmd(value)) { in command_write()
71 dev_dbg(&dev->dev, "enable\n"); in command_write()
72 err = pci_enable_device(dev); in command_write()
77 } else if (pci_is_enabled(dev) && !is_enable_cmd(value)) { in command_write()
78 dev_dbg(&dev->dev, "disable\n"); in command_write()
79 pci_disable_device(dev); in command_write()
84 if (!dev->is_busmaster && is_master_cmd(value)) { in command_write()
85 dev_dbg(&dev->dev, "set bus master\n"); in command_write()
86 pci_set_master(dev); in command_write()
87 } else if (dev->is_busmaster && !is_master_cmd(value)) { in command_write()
88 dev_dbg(&dev->dev, "clear bus master\n"); in command_write()
89 pci_clear_master(dev); in command_write()
94 dev_dbg(&dev->dev, "enable memory-write-invalidate\n"); in command_write()
95 err = pci_set_mwi(dev); in command_write()
97 dev_warn(&dev->dev, "cannot enable memory-write-invalidate (%d)\n", in command_write()
103 dev_dbg(&dev->dev, "disable memory-write-invalidate\n"); in command_write()
104 pci_clear_mwi(dev); in command_write()
109 pci_intx(dev, !(value & PCI_COMMAND_INTX_DISABLE)); in command_write()
117 err = pci_read_config_word(dev, offset, &val); in command_write()
124 return pci_write_config_word(dev, offset, value); in command_write()
127 static int rom_write(struct pci_dev *dev, int offset, u32 value, void *data) in rom_write() argument
132 dev_warn(&dev->dev, "driver data not found\n"); in rom_write()
143 pci_read_config_dword(dev, offset, &tmpval); in rom_write()
146 pci_write_config_dword(dev, offset, bar->val); in rom_write()
160 static int bar_write(struct pci_dev *dev, int offset, u32 value, void *data) in bar_write() argument
164 const struct resource *res = dev->resource; in bar_write()
168 dev_warn(&dev->dev, "driver data not found\n"); in bar_write()
185 pci_read_config_dword(dev, offset, &tmpval); in bar_write()
188 pci_write_config_dword(dev, offset, bar->val); in bar_write()
196 static int bar_read(struct pci_dev *dev, int offset, u32 * value, void *data) in bar_read() argument
201 dev_warn(&dev->dev, "driver data not found\n"); in bar_read()
210 static void *bar_init(struct pci_dev *dev, int offset) in bar_init() argument
213 const struct resource *res = dev->resource; in bar_init()
247 static void bar_reset(struct pci_dev *dev, int offset, void *data) in bar_reset() argument
254 static void bar_release(struct pci_dev *dev, int offset, void *data) in bar_release() argument
259 static int xen_pcibk_read_vendor(struct pci_dev *dev, int offset, in xen_pcibk_read_vendor() argument
262 *value = dev->vendor; in xen_pcibk_read_vendor()
267 static int xen_pcibk_read_device(struct pci_dev *dev, int offset, in xen_pcibk_read_device() argument
270 *value = dev->device; in xen_pcibk_read_device()
275 static int interrupt_read(struct pci_dev *dev, int offset, u8 * value, in interrupt_read() argument
278 *value = (u8) dev->irq; in interrupt_read()
283 static int bist_write(struct pci_dev *dev, int offset, u8 value, void *data) in bist_write() argument
288 err = pci_read_config_byte(dev, offset, &cur_value); in bist_write()
294 err = pci_write_config_byte(dev, offset, value); in bist_write()
390 int xen_pcibk_config_header_add_fields(struct pci_dev *dev) in xen_pcibk_config_header_add_fields() argument
394 err = xen_pcibk_config_add_fields(dev, header_common); in xen_pcibk_config_header_add_fields()
398 switch (dev->hdr_type) { in xen_pcibk_config_header_add_fields()
400 err = xen_pcibk_config_add_fields(dev, header_0); in xen_pcibk_config_header_add_fields()
404 err = xen_pcibk_config_add_fields(dev, header_1); in xen_pcibk_config_header_add_fields()
409 dev_err(&dev->dev, "Unsupported header type %d!\n", in xen_pcibk_config_header_add_fields()
410 dev->hdr_type); in xen_pcibk_config_header_add_fields()