Re: Annoying problem with udev
On 30/11/2010 19:12, Frans van Berckel wrote:
On Tue, 2010-11-30 at 18:37 +0000, Richard Mortimer wrote:
That is basically the idea but it does need a few tweaks to the
surrounding function. Given that you can compile/test I will try to
knock up a patch later tonight or tomorrow.
Sure Richard , I am willing to do so. Having the 2.6.34 in view now.
http://git.kernel.org/?p=linux/kernel/git/stable/linux-2.6.34.y.git;a=blob_plain;f=drivers/net/cassini.c;hb=HEAD
http://git.kernel.org/?p=linux/kernel/git/stable/linux-2.6.34.y.git;a=blob_plain;f=drivers/net/cassini.h;hb=HEAD
Hi,
Attached are two patches to apply against the files from 2.6.34 that you
reference above. Sorry they are just in context diff format (as I
mentioned I don't have a git tree handy at the moment) but you should be
able to apply them direct in the driver/net directory using
patch -p0 < cassini.c.diff
patch -p0 < cassini.h.diff
I haven't compile tested so it may need a tweak or two (I may have got
the wrong include files for of.h and friends).
Lets hope this is on the right lines.
Regards
Richard
Thanks,
Frans van Berckel
--- cassini.h.orig 2010-11-30 22:11:39.000000000 +0000
+++ cassini.h 2010-11-30 22:24:54.000000000 +0000
@@ -2872,6 +2872,9 @@
dma_addr_t block_dvma, tx_tiny_dvma[N_TX_RINGS];
struct pci_dev *pdev;
struct net_device *dev;
+#if defined(CONFIG_PPC_PMAC) || defined(CONFIG_SPARC)
+ struct device_node *of_node;
+#endif
/* Firmware Info */
u16 fw_load_addr;
--- cassini.c.orig 2010-11-30 22:11:33.000000000 +0000
+++ cassini.c 2010-11-30 22:44:06.000000000 +0000
@@ -82,6 +82,10 @@
#include <linux/highmem.h>
#include <linux/list.h>
#include <linux/dma-mapping.h>
+#if defined(CONFIG_SPARC) || defined(CONFIG_PPC_PMAC)
+#include <linux/of.h>
+#include <linux/of_device.h>
+#endif
#include <linux/netdevice.h>
#include <linux/etherdevice.h>
@@ -3374,6 +3378,16 @@
if (found & VPD_FOUND_MAC)
goto done;
+#if defined(CONFIG_SPARC) || defined(CONFIG_PPC_PMAC)
+ const unsigned char *addr;
+
+ addr = of_get_property(cas->of_node, "local-mac-address", NULL);
+ if (addr != NULL) {
+ memcpy(dev_addr, addr, 6);
+ goto done;
+ }
+#endif
+
/* Sun MAC prefix then 3 random bytes. */
pr_info("MAC address not found in ROM VPD\n");
dev_addr[0] = 0x08;
@@ -5043,6 +5057,10 @@
cp->msg_enable = (cassini_debug < 0) ? CAS_DEF_MSG_ENABLE :
cassini_debug;
+#if defined(CONFIG_PPC_PMAC) || defined(CONFIG_SPARC)
+ cp->of_node = pci_device_to_OF_node(pdev);
+#endif
+
cp->link_transition = LINK_TRANSITION_UNKNOWN;
cp->link_transition_jiffies_valid = 0;
Reply to: