[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#322734: patch?



I just took a quick glance, and that patch does seem
to be in Linus's Git Tree, and possibly a release.
I'll poke further, but thats probably reason enough
to put it into the Debian kernels. Well, that and
it solving your problem.

Jurij, any objections, this is pretty much your corner of the feild?

On Mon, Sep 19, 2005 at 10:38:59AM -0400, Clint Adams wrote:
> I haven't tested this.
> 
> diff -ur linux-2.6.13/drivers/net/sungem.c linux-2.6.13.2/drivers/net/sungem.c
> --- linux-2.6.13/drivers/net/sungem.c	2005-08-28 19:41:01.000000000 -0400
> +++ linux-2.6.13.2/drivers/net/sungem.c	2005-09-16 21:02:12.000000000 -0400
> @@ -2816,7 +2816,7 @@
>  
>  #if (!defined(__sparc__) && !defined(CONFIG_PPC_PMAC))
>  /* Fetch MAC address from vital product data of PCI ROM. */
> -static void find_eth_addr_in_vpd(void __iomem *rom_base, int len, unsigned char *dev_addr)
> +static int find_eth_addr_in_vpd(void __iomem *rom_base, int len, unsigned char *dev_addr)
>  {
>  	int this_offset;
>  
> @@ -2837,35 +2837,27 @@
>  
>  		for (i = 0; i < 6; i++)
>  			dev_addr[i] = readb(p + i);
> -		break;
> +		return 1;
>  	}
> +	return 0;
>  }
>  
>  static void get_gem_mac_nonobp(struct pci_dev *pdev, unsigned char *dev_addr)
>  {
> -	u32 rom_reg_orig;
> -	void __iomem *p;
> -
> -	if (pdev->resource[PCI_ROM_RESOURCE].parent == NULL) {
> -		if (pci_assign_resource(pdev, PCI_ROM_RESOURCE) < 0)
> -			goto use_random;
> -	}
> -
> -	pci_read_config_dword(pdev, pdev->rom_base_reg, &rom_reg_orig);
> -	pci_write_config_dword(pdev, pdev->rom_base_reg,
> -			       rom_reg_orig | PCI_ROM_ADDRESS_ENABLE);
> +	size_t size;
> +	void __iomem *p = pci_map_rom(pdev, &size);
>  
> -	p = ioremap(pci_resource_start(pdev, PCI_ROM_RESOURCE), (64 * 1024));
> -	if (p != NULL && readb(p) == 0x55 && readb(p + 1) == 0xaa)
> -		find_eth_addr_in_vpd(p, (64 * 1024), dev_addr);
> +	if (p) {
> +			int found;
>  
> -	if (p != NULL)
> -		iounmap(p);
> -
> -	pci_write_config_dword(pdev, pdev->rom_base_reg, rom_reg_orig);
> -	return;
> +		found = readb(p) == 0x55 &&
> +			readb(p + 1) == 0xaa &&
> +			find_eth_addr_in_vpd(p, (64 * 1024), dev_addr);
> +		pci_unmap_rom(pdev, p);
> +		if (found)
> +			return;
> +	}
>  
> -use_random:
>  	/* Sun MAC prefix then 3 random bytes. */
>  	dev_addr[0] = 0x08;
>  	dev_addr[1] = 0x00;
> 
> 
> -- 
> To UNSUBSCRIBE, email to debian-kernel-REQUEST@lists.debian.org
> with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org

-- 
Horms



Reply to: