aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pci
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/pci')
-rw-r--r--drivers/pci/msi.c16
-rw-r--r--drivers/pci/msi.h2
2 files changed, 8 insertions, 10 deletions
diff --git a/drivers/pci/msi.c b/drivers/pci/msi.c
index b1a60e0a1ee3..7011c5d95e5e 100644
--- a/drivers/pci/msi.c
+++ b/drivers/pci/msi.c
@@ -244,11 +244,11 @@ void __read_msi_msg(struct msi_desc *entry, struct msi_msg *msg)
244 int pos = dev->msi_cap; 244 int pos = dev->msi_cap;
245 u16 data; 245 u16 data;
246 246
247 pci_read_config_dword(dev, msi_lower_address_reg(pos), 247 pci_read_config_dword(dev, pos + PCI_MSI_ADDRESS_LO,
248 &msg->address_lo); 248 &msg->address_lo);
249 if (entry->msi_attrib.is_64) { 249 if (entry->msi_attrib.is_64) {
250 pci_read_config_dword(dev, msi_upper_address_reg(pos), 250 pci_read_config_dword(dev, pos + PCI_MSI_ADDRESS_HI,
251 &msg->address_hi); 251 &msg->address_hi);
252 pci_read_config_word(dev, msi_data_reg(pos, 1), &data); 252 pci_read_config_word(dev, msi_data_reg(pos, 1), &data);
253 } else { 253 } else {
254 msg->address_hi = 0; 254 msg->address_hi = 0;
@@ -304,11 +304,11 @@ void __write_msi_msg(struct msi_desc *entry, struct msi_msg *msg)
304 msgctl |= entry->msi_attrib.multiple << 4; 304 msgctl |= entry->msi_attrib.multiple << 4;
305 pci_write_config_word(dev, pos + PCI_MSI_FLAGS, msgctl); 305 pci_write_config_word(dev, pos + PCI_MSI_FLAGS, msgctl);
306 306
307 pci_write_config_dword(dev, msi_lower_address_reg(pos), 307 pci_write_config_dword(dev, pos + PCI_MSI_ADDRESS_LO,
308 msg->address_lo); 308 msg->address_lo);
309 if (entry->msi_attrib.is_64) { 309 if (entry->msi_attrib.is_64) {
310 pci_write_config_dword(dev, msi_upper_address_reg(pos), 310 pci_write_config_dword(dev, pos + PCI_MSI_ADDRESS_HI,
311 msg->address_hi); 311 msg->address_hi);
312 pci_write_config_word(dev, msi_data_reg(pos, 1), 312 pci_write_config_word(dev, msi_data_reg(pos, 1),
313 msg->data); 313 msg->data);
314 } else { 314 } else {
diff --git a/drivers/pci/msi.h b/drivers/pci/msi.h
index 6aa7b1903796..e5b87d60cb95 100644
--- a/drivers/pci/msi.h
+++ b/drivers/pci/msi.h
@@ -6,8 +6,6 @@
6#ifndef MSI_H 6#ifndef MSI_H
7#define MSI_H 7#define MSI_H
8 8
9#define msi_lower_address_reg(base) (base + PCI_MSI_ADDRESS_LO)
10#define msi_upper_address_reg(base) (base + PCI_MSI_ADDRESS_HI)
11#define msi_data_reg(base, is64bit) \ 9#define msi_data_reg(base, is64bit) \
12 (base + ((is64bit == 1) ? PCI_MSI_DATA_64 : PCI_MSI_DATA_32)) 10 (base + ((is64bit == 1) ? PCI_MSI_DATA_64 : PCI_MSI_DATA_32))
13#define msi_mask_reg(base, is64bit) \ 11#define msi_mask_reg(base, is64bit) \