summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2014-03-07 09:25:44 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2014-03-07 09:25:44 +0100
commit144358e0aa102c84968443460c508eb3d65ccc90 (patch)
tree01b9aafde793d1124976ecd2bae090b9b978f8a3 /include
parente358922a74b01e6272c77caf01bc78a8295cc7d7 (diff)
parent86f681abec4f8485d2e95537e0d59a8d9ab6b546 (diff)
downloadbarebox-144358e0aa102c84968443460c508eb3d65ccc90.tar.gz
barebox-144358e0aa102c84968443460c508eb3d65ccc90.tar.xz
Merge branch 'for-next/nfs'
Conflicts: defaultenv/defaultenv-2-base/bin/ifup
Diffstat (limited to 'include')
-rw-r--r--include/byteorder.h24
-rw-r--r--include/common.h3
-rw-r--r--include/fs.h6
-rw-r--r--include/net.h22
4 files changed, 46 insertions, 9 deletions
diff --git a/include/byteorder.h b/include/byteorder.h
new file mode 100644
index 0000000000..4b255a5fab
--- /dev/null
+++ b/include/byteorder.h
@@ -0,0 +1,24 @@
+#ifndef __BYTEORDER_H__
+#define __BYTEORDER_H__
+
+/*
+ * The standard macros for converting between host and network byte order are
+ * badly named. So ntohl converts 32 bits even on architectures where a long is
+ * 64 bit wide although the 'l' suffix suggests that it's working on longs.
+ *
+ * So this file introduces variants that use the bitcount as suffix instead of
+ * 's' or 'l'.
+ */
+
+#include <asm/byteorder.h>
+
+#define ntoh16(x) __be16_to_cpu(x)
+#define hton16(x) __cpu_to_be16(x)
+
+#define ntoh32(x) __be32_to_cpu(x)
+#define hton32(x) __cpu_to_be32(x)
+
+#define ntoh64(x) __be64_to_cpu(x)
+#define hton64(x) __cpu_to_be64(x)
+
+#endif /* __BYTEORDER_H__ */
diff --git a/include/common.h b/include/common.h
index 293f5041af..6987b4f16d 100644
--- a/include/common.h
+++ b/include/common.h
@@ -92,8 +92,7 @@ void __noreturn panic(const char *fmt, ...);
char *size_human_readable(unsigned long long size);
-/* common/main.c */
-int run_command (const char *cmd, int flag);
+int run_command(const char *cmd);
int readline (const char *prompt, char *buf, int len);
/* common/memsize.c */
diff --git a/include/fs.h b/include/fs.h
index 856e00abb0..073641c747 100644
--- a/include/fs.h
+++ b/include/fs.h
@@ -99,6 +99,7 @@ struct fs_device_d {
char *path;
struct device_d *parent_device;
struct list_head list;
+ char *options;
};
#define drv_to_fs_driver(d) container_of(d, struct fs_driver_d, drv)
@@ -140,7 +141,8 @@ int closedir(DIR *dir);
int symlink(const char *pathname, const char *newpath);
int readlink(const char *path, char *buf, size_t bufsiz);
-int mount (const char *device, const char *fsname, const char *path);
+int mount (const char *device, const char *fsname, const char *path,
+ const char *fsoptions);
int umount(const char *pathname);
/* not-so-standard functions */
@@ -197,7 +199,7 @@ int unlink_recursive(const char *path, char **failedpath);
int fsdev_open_cdev(struct fs_device_d *fsdev);
const char *cdev_get_mount_path(struct cdev *cdev);
-const char *cdev_mount_default(struct cdev *cdev);
+const char *cdev_mount_default(struct cdev *cdev, const char *fsoptions);
void mount_all(void);
#endif /* __FS_H */
diff --git a/include/net.h b/include/net.h
index a4cfec7123..3b800b78f0 100644
--- a/include/net.h
+++ b/include/net.h
@@ -269,11 +269,18 @@ static inline IPaddr_t net_read_ip(void *from)
}
/* return uint32 *in network byteorder* */
-static inline uint32_t net_read_uint32(uint32_t *from)
+static inline uint32_t net_read_uint32(void *from)
{
- ulong l;
- memcpy((void*)&l, (void*)from, sizeof(l));
- return l;
+ uint32_t tmp;
+ memcpy(&tmp, from, sizeof(tmp));
+ return tmp;
+}
+
+static inline uint64_t net_read_uint64(void *from)
+{
+ uint64_t tmp;
+ memcpy(&tmp, from, sizeof(tmp));
+ return tmp;
}
/* write IP *in network byteorder* */
@@ -397,7 +404,7 @@ typedef void rx_handler_f(void *ctx, char *packet, unsigned int len);
void eth_set_current(struct eth_device *eth);
struct eth_device *eth_get_current(void);
-struct eth_device *eth_get_byname(char *name);
+struct eth_device *eth_get_byname(const char *name);
/**
* net_receive - Pass a received packet from an ethernet driver to the protocol stack
@@ -450,4 +457,9 @@ int net_icmp_send(struct net_connection *con, int len);
void led_trigger_network(enum led_trigger trigger);
+#define IFUP_FLAG_FORCE (1 << 0)
+
+int ifup(const char *name, unsigned flags);
+int ifup_all(unsigned flags);
+
#endif /* __NET_H__ */