Skip to contentSkip to conversation

forcedeth: Addition of new device id

PATCH In review Ayaz Abdulla 3 participants 5 messages Jun 3, 2009

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 2/2 forcedeth: Addition of new device id

This patch adds support for new ethernet device in the MCP89 chipset.

drivers/net/forcedeth.c +6 -1
@@ -6149,7 +6149,8 @@
 	for (i = 0;i <= np->register_size/sizeof(u32); i++)
 		writel(np->saved_config_space[i], base+i*sizeof(u32));
 
-	pci_write_config_dword(pdev, NV_MSI_PRIV_OFFSET, NV_MSI_PRIV_VALUE);
+	if (np->device_id != PCI_DEVICE_ID_NVIDIA_NVENET_40)
+		pci_write_config_dword(pdev, NV_MSI_PRIV_OFFSET, NV_MSI_PRIV_VALUE);
 
 	/* restore phy state, including autoneg */
 	phy_init(dev);
@@ -6353,6 +6354,10 @@
 		PCI_DEVICE(PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NVENET_39),
 		.driver_data = DEV_NEED_LINKTIMER|DEV_HAS_LARGEDESC|DEV_HAS_CHECKSUM|DEV_HAS_HIGH_DMA|DEV_HAS_MSI|DEV_HAS_POWER_CNTRL|DEV_HAS_PAUSEFRAME_TX_V3|DEV_HAS_STATISTICS_V3|DEV_HAS_TEST_EXTENDED|DEV_HAS_CORRECT_MACADDR|DEV_HAS_COLLISION_FIX|DEV_NEED_TX_LIMIT|DEV_HAS_GEAR_MODE,
 	},
+	{	/* MCP89 Ethernet Controller */
+		PCI_DEVICE(PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NVENET_40),
+		.driver_data = DEV_NEED_LINKTIMER|DEV_HAS_LARGEDESC|DEV_HAS_CHECKSUM|DEV_HAS_HIGH_DMA|DEV_HAS_MSI|DEV_HAS_POWER_CNTRL|DEV_HAS_PAUSEFRAME_TX_V3|DEV_HAS_STATISTICS_V3|DEV_HAS_TEST_EXTENDED|DEV_HAS_CORRECT_MACADDR|DEV_HAS_COLLISION_FIX|DEV_NEED_TX_LIMIT|DEV_HAS_GEAR_MODE,
+	},
 	{0,},
 };
 
maintainer
#2 lore raw

From: Andrew Morton <[email protected]>
Date: Wed, 3 Jun 2009 13:25:09 -0700

Quoted 9 lines
Quoted 4 lines · On Tue, 02 Jun 2009 15:18:50 -0400 Ayaz Abdulla <[email protected]> wrote:

This patch adds support for new ethernet device in the MCP89 chipset.

It's best to combine these two patches into one, IMO.

Andrew, we do not add new entries to pci_ids.h any more.

Just use the constant directly when using it in the driver ID table.

#3 lore raw
Quoted 6 lines · On Wed, 03 Jun 2009 14:26:47 -0700 (PDT) David Miller <[email protected]>…

From: Andrew Morton <[email protected]>
Date: Wed, 3 Jun 2009 13:25:09 -0700

Quoted 3 lines

On Tue, 02 Jun 2009 15:18:50 -0400
Ayaz Abdulla <[email protected]> wrote:

Quoted 8 lines
Quoted 6 lines
Quoted 4 lines

This patch adds support for new ethernet device in the MCP89 chipset.

It's best to combine these two patches into one, IMO.

Andrew, we do not add new entries to pci_ids.h any more.

Lots of people are still changing it. I believe that the approach we've been taking is: if the driver presently uses pci_ids.h and you're adding a new ID then go for it. But new drivers should use a private site for the IDs. And patches which switch old drivers from pci_ids over to a private site are approved of.

Quoted 2 lines

Just use the constant directly when using it in the driver ID table.

Well OK, but that means that forcedeth has most of its PCI IDs enumerated in pci_ids.h, but others hardwired in forcedeth.c.

IOW, Ayaz owes us a "[patch] forcedeth: remove PCI IDs from pci_ids.h" ;)

maintainer
#4 lore raw

From: Andrew Morton <[email protected]>
Date: Wed, 3 Jun 2009 14:52:38 -0700

Quoted 6 lines
Quoted 1 line · On Wed, 03 Jun 2009 14:26:47 -0700 (PDT) David Miller <[email protected]>…

Andrew, we do not add new entries to pci_ids.h any more.

Lots of people are still changing it.

Not enough policing, that's all. Even I let one slip in recently, but that was an oversight rather than something I did on purpose. :-)

Quoted 5 lines

I believe that the approach we've been taking is: if the driver presently uses pci_ids.h and you're adding a new ID then go for it. But new drivers should use a private site for the IDs. And patches which switch old drivers from pci_ids over to a private site are approved of.

I think it's silly to let use continue even in those situations. If it's in a header file, it's so that it can (at least potentially) be used in multiple places. That is not the situation we are handling here, such defines are always used in exactly one place, the driver ID table.