summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2013-10-07 08:00:36 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2013-10-07 08:00:36 +0200
commit01f37a992fa54669c01674d61ade04e0e50464b1 (patch)
treea4931b19293f2c27353ebee8b0c746f03d994108 /include
parent71fbdfbb1321de894f6938f5e471f86d728eab2e (diff)
parent7ccaaf71fe84f090b359d8d21e76aaff84d295f0 (diff)
downloadbarebox-01f37a992fa54669c01674d61ade04e0e50464b1.tar.gz
barebox-01f37a992fa54669c01674d61ade04e0e50464b1.tar.xz
Merge branch 'for-next/net'
Conflicts: arch/arm/boards/animeo_ip/init.c
Diffstat (limited to 'include')
-rw-r--r--include/local_mac_address.h42
-rw-r--r--include/net/designware.h1
-rw-r--r--include/net/smc91111.h14
3 files changed, 57 insertions, 0 deletions
diff --git a/include/local_mac_address.h b/include/local_mac_address.h
new file mode 100644
index 0000000000..3d1ec66b1f
--- /dev/null
+++ b/include/local_mac_address.h
@@ -0,0 +1,42 @@
+/*
+ * Copyright (C) 2012 Jean-Christophe PLAGNIOL-VILLARD <plagnio@jcrosoft.com>
+ *
+ * Under GPLv2 only
+ */
+
+#ifndef __LOCAL_MAC_ADDRESS_H__
+#define __LOCAL_MAC_ADDRESS_H__
+
+#include <net.h>
+
+/**
+ * local_mac_address_register - use random number with fix
+ * OUI provided device to provide an Ethernet address
+ * @ethid: ethernet device id
+ * @oui: Ethernet OUI (3 bytes)
+ *
+ * Generate a local Ethernet address (MAC) that is not multicast using a 1-wire id.
+ */
+static inline int local_mac_address_register(int ethid, char * oui)
+{
+ char addr[6];
+ int nb_oui = 3;
+ int i;
+
+ if (!oui)
+ return -EINVAL;
+
+ random_ether_addr(addr);
+
+ for (i = 0; i < nb_oui; i++)
+ addr[i] = oui[i];
+
+ addr[0] &= 0xfe; /* clear multicast bit */
+ addr[0] |= 0x02; /* set local assignment bit (IEEE802) */
+
+ eth_register_ethaddr(ethid, addr);
+
+ return 0;
+}
+
+#endif /* __LOCAL_MAC_ADDRESS_H__ */
diff --git a/include/net/designware.h b/include/net/designware.h
index 3f31c97610..7a7a26abfd 100644
--- a/include/net/designware.h
+++ b/include/net/designware.h
@@ -7,6 +7,7 @@ struct dwc_ether_platform_data {
int phy_addr;
phy_interface_t interface;
void (*fix_mac_speed)(int speed);
+ bool enh_desc; /* use Alternate/Enhanced Descriptor configurations */
};
#endif
diff --git a/include/net/smc91111.h b/include/net/smc91111.h
new file mode 100644
index 0000000000..0b2d49bb19
--- /dev/null
+++ b/include/net/smc91111.h
@@ -0,0 +1,14 @@
+/*
+ * Copyright (C) 2013 Jean-Christophe PLAGNIOL-VILLARD <plagnio@jcrosoft.com>
+ *
+ * Under GPLv2 only
+ */
+
+#ifndef __SMC91111_H__
+#define __SMC91111_H__
+
+struct smc91c111_pdata {
+ int qemu_fixup;
+};
+
+#endif /* __SMC91111_H__ */