Thread (5 messages) flat view 5 messages, 3 authors, 2016-03-12

Re: [PATCH net v3.16]r8169: Not enable/disable bus mastering when is enabled on BIOS

From: Sergei Shtylyov <hidden>
Date: 2016-03-12 19:09:35

Hello.

On 03/12/2016 09:33 AM, Corcodel Marian wrote:
quoted hunk ↗ jump to hunk
  This patch not enable/disable bus mastering when is enabled on BIOS..
  pci_disable_device function also disable bus mastering for, disable bus mastering
   is dedicate function.

Signed-off-by: Corcodel Marian <redacted>
---
  drivers/net/ethernet/realtek/r8169.c | 29 ++++++++++++++++++++++++++---
  1 file changed, 26 insertions(+), 3 deletions(-)
diff --git a/drivers/net/ethernet/realtek/r8169.c b/drivers/net/ethernet/realtek/r8169.c
index 02aec96..ec555e7 100644
--- a/drivers/net/ethernet/realtek/r8169.c
+++ b/drivers/net/ethernet/realtek/r8169.c
[...]
quoted hunk ↗ jump to hunk
@@ -7103,7 +7120,13 @@ rtl_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)

  	rtl_ack_events(tp, 0xffff);

-	pci_set_master(pdev);
+	pci_read_config_word(pdev, PCI_COMMAND, &cmd);
+	if (cmd & PCI_COMMAND_MASTER)
+		tp->bios_support = true;
+	else {
    Documentation/CodingStyle requites {} on all branches of the *if* 
statement if at least one branch has them.
+		tp->bios_support = false;
+		pci_set_master(pdev);
+	}

  	/*
  	 * Pretend we are using VLANs; This bypasses a nasty bug where
MBR, Sergei
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help