Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ebc71647 authored by Francois Romieu's avatar Francois Romieu Committed by David S. Miller
Browse files

sis190: add cmos ram access code for the SiS19x/968 chipset pair

More work is needed to handle correctly the PHY of the new devices
when connected to a 10Mb link but this change already helps some
users as is.

Fix for:
http://bugzilla.kernel.org/show_bug.cgi?id=9467



Signed-off-by: default avatarFrancois Romieu <romieu@fr.zoreil.com>
Cc: K.M. Liu <kmliu@sis.com.tw>
Cc: J. Gleacher <jgleacher@yahoo.com>
Cc: Alexandre Penasso Teixeira <alexandre@keepsoftware.com>
Cc: Arliton Rocha <arliton@gmail.com>
Cc: Juan Jose Pablos <juanjo@apertus.es>
Cc: Wipat Srutiprom <wipat.s@psu.ac.th>
parent f945fa7a
Loading
Loading
Loading
Loading
+9 −6
Original line number Original line Diff line number Diff line
@@ -1549,28 +1549,31 @@ static int __devinit sis190_get_mac_addr_from_eeprom(struct pci_dev *pdev,
}
}


/**
/**
 *	sis190_get_mac_addr_from_apc - Get MAC address for SiS965 model
 *	sis190_get_mac_addr_from_apc - Get MAC address for SiS96x model
 *	@pdev: PCI device
 *	@pdev: PCI device
 *	@dev:  network device to get address for
 *	@dev:  network device to get address for
 *
 *
 *	SiS965 model, use APC CMOS RAM to store MAC address.
 *	SiS96x model, use APC CMOS RAM to store MAC address.
 *	APC CMOS RAM is accessed through ISA bridge.
 *	APC CMOS RAM is accessed through ISA bridge.
 *	MAC address is read into @net_dev->dev_addr.
 *	MAC address is read into @net_dev->dev_addr.
 */
 */
static int __devinit sis190_get_mac_addr_from_apc(struct pci_dev *pdev,
static int __devinit sis190_get_mac_addr_from_apc(struct pci_dev *pdev,
						  struct net_device *dev)
						  struct net_device *dev)
{
{
	static const u16 __devinitdata ids[] = { 0x0965, 0x0966, 0x0968 };
	struct sis190_private *tp = netdev_priv(dev);
	struct sis190_private *tp = netdev_priv(dev);
	struct pci_dev *isa_bridge;
	struct pci_dev *isa_bridge;
	u8 reg, tmp8;
	u8 reg, tmp8;
	int i;
	unsigned int i;


	net_probe(tp, KERN_INFO "%s: Read MAC address from APC.\n",
	net_probe(tp, KERN_INFO "%s: Read MAC address from APC.\n",
		  pci_name(pdev));
		  pci_name(pdev));


	isa_bridge = pci_get_device(PCI_VENDOR_ID_SI, 0x0965, NULL);
	for (i = 0; i < ARRAY_SIZE(ids); i++) {
	if (!isa_bridge)
		isa_bridge = pci_get_device(PCI_VENDOR_ID_SI, ids[i], NULL);
		isa_bridge = pci_get_device(PCI_VENDOR_ID_SI, 0x0966, NULL);
		if (isa_bridge)
			break;
	}


	if (!isa_bridge) {
	if (!isa_bridge) {
		net_probe(tp, KERN_INFO "%s: Can not find ISA bridge.\n",
		net_probe(tp, KERN_INFO "%s: Can not find ISA bridge.\n",