lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20100119213214.024b7794@lxorguk.ukuu.org.uk>
Date:	Tue, 19 Jan 2010 21:32:14 +0000
From:	Alan Cox <alan@...rguk.ukuu.org.uk>
To:	"Ha, Tristram" <Tristram.Ha@...rel.Com>
Cc:	"Dave Miller" <davem@...emloft.net>, <netdev@...r.kernel.org>,
	<linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 2.6.33 1/3] net: Micrel KSZ8841/2 PCI Ethernet driver

> >> +#define PCI_VENDOR_ID_KS884X		0x16C6
> >> +#define PCI_DEVICE_ID_KS8841		0x8841
> >> +#define PCI_DEVICE_ID_KS8842		0x8842
> > 
> > Those belong in the pci device id header.
> > 
> > 
> 
> I do not quite understand your suggestion.  Do I need to put those IDs
> in one of the kernel headers?

Into include/linux/pci_ids.h

> >> +	hw->pdev = pdev;
> > 
> > 
> > If you make a private copy of pdev in your struct you should refcount
> it and use
> > pci_dev_get/pci_dev_put when you take and release the reference. 

> I do not understand how pci_dev_get/pci_dev_put work.  Does the pdev
> pointer actually change during the lifetime of the PCI driver?

No but it can go away if the device is removed. The pci_dev_get ensures
it won't go away while you have a pointer to it. and the pci_dev_put
gives up your reference.

> I also like the attribute to associate with the network device rather
> than the PCI device, as the KSZ8842 driver can create another virtual
> network device.  I tried to pass the device pointer of the network
> device to device_create_file function and the driver crashed.  I will
> investigate this matter further.

Ok
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ