summaryrefslogtreecommitdiff
path: root/nuttx/include/net
diff options
context:
space:
mode:
authorpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2008-09-12 00:39:12 +0000
committerpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2008-09-12 00:39:12 +0000
commit627dfd23c0a52dc8a5f8b9c2cdaaa6681154f948 (patch)
tree6b3408019f1b382bfb8289a4767860eeb19c5466 /nuttx/include/net
parent616b655dea1a96593abea5ff590dacbaedfa52ed (diff)
downloadpx4-nuttx-627dfd23c0a52dc8a5f8b9c2cdaaa6681154f948.tar.gz
px4-nuttx-627dfd23c0a52dc8a5f8b9c2cdaaa6681154f948.tar.bz2
px4-nuttx-627dfd23c0a52dc8a5f8b9c2cdaaa6681154f948.zip
Standardizing ioctls
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@912 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/include/net')
-rw-r--r--nuttx/include/net/ethernet.h10
-rw-r--r--nuttx/include/net/if.h10
-rw-r--r--nuttx/include/net/ioctls.h39
3 files changed, 30 insertions, 29 deletions
diff --git a/nuttx/include/net/ethernet.h b/nuttx/include/net/ethernet.h
index 116f1c516..92a810c90 100644
--- a/nuttx/include/net/ethernet.h
+++ b/nuttx/include/net/ethernet.h
@@ -1,7 +1,7 @@
/****************************************************************************
- * net/ethernet.h
+ * include/net/ethernet.h
*
- * Copyright (C) 2007 Gregory Nutt. All rights reserved.
+ * Copyright (C) 2007, 2008 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
*
* Redistribution and use in source and binary forms, with or without
@@ -14,7 +14,7 @@
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
- * 3. Neither the name Gregory Nutt nor the names of its contributors may be
+ * 3. Neither the name NuttX nor the names of its contributors may be
* used to endorse or promote products derived from this software
* without specific prior written permission.
*
@@ -43,13 +43,13 @@
#include <sys/types.h>
/****************************************************************************
- * Definitions
+ * Pre-Processor Definitions
****************************************************************************/
#define ETHER_ADDR_LEN 6
/****************************************************************************
- * Type Definitions
+ * Public Type Definitions
****************************************************************************/
struct ether_addr
diff --git a/nuttx/include/net/if.h b/nuttx/include/net/if.h
index 7d8ea6007..cd3a23c89 100644
--- a/nuttx/include/net/if.h
+++ b/nuttx/include/net/if.h
@@ -1,7 +1,7 @@
/****************************************************************************
- * net/if.h
+ * include/net/if.h
*
- * Copyright (C) 2007 Gregory Nutt. All rights reserved.
+ * Copyright (C) 2007, 2008 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
*
* Redistribution and use in source and binary forms, with or without
@@ -14,7 +14,7 @@
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
- * 3. Neither the name Gregory Nutt nor the names of its contributors may be
+ * 3. Neither the name NuttX nor the names of its contributors may be
* used to endorse or promote products derived from this software
* without specific prior written permission.
*
@@ -43,7 +43,7 @@
#include <sys/socket.h>
/****************************************************************************
- * Definitions
+ * Pre-Processor Definitions
****************************************************************************/
/* Sizing parameters */
@@ -52,7 +52,7 @@
#define IFHWADDRLEN 6
/****************************************************************************
- * Type Definitions
+ * Public Type Definitions
****************************************************************************/
struct ifreq
diff --git a/nuttx/include/net/ioctls.h b/nuttx/include/net/ioctls.h
index 785c7d4f2..2395c1787 100644
--- a/nuttx/include/net/ioctls.h
+++ b/nuttx/include/net/ioctls.h
@@ -1,7 +1,7 @@
/****************************************************************************
- * net/ioctls.h
+ * include/net/ioctls.h
*
- * Copyright (C) 2007 Gregory Nutt. All rights reserved.
+ * Copyright (C) 2007, 2008 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
*
* Redistribution and use in source and binary forms, with or without
@@ -40,32 +40,33 @@
* Included Files
****************************************************************************/
+#include <nuttx/ioctl.h> /* _SIOCBASE, etc. */
+
/****************************************************************************
* Definitions
****************************************************************************/
/* These are ioctl commands to use with a socket FD. At present, commnads
- * are accepted onloy to set/get IP addresses, broadcast address, network
+ * are accepted only to set/get IP addresses, broadcast address, network
* masks, and hardware address, and a few others
*/
-#define _SIOCBASE (0x8900)
-#define _SIOCMASK (0x00ff)
-#define _SIOCVALID(c) (((c) & ~_SIOCMASK) == _SIOCBASE)
+#define _SIOCVALID(c) (_IOC_TYPE(c)==_SIOCBASE)
+#define _SIOC(nr) _IOC(_SIOCBASE,nr)
-#define SIOCGIFADDR (_SIOCBASE|0x0001) /* Get IP address */
-#define SIOCSIFADDR (_SIOCBASE|0x0002) /* Set IP address */
-#define SIOCGIFDSTADDR (_SIOCBASE|0x0003) /* Get P-to-P address */
-#define SIOCSIFDSTADDR (_SIOCBASE|0x0004) /* Set P-to-P address */
-#define SIOCGIFBRDADDR (_SIOCBASE|0x0005) /* Get broadcast IP address */
-#define SIOCSIFBRDADDR (_SIOCBASE|0x0006) /* Set broadcast IP address */
-#define SIOCGIFNETMASK (_SIOCBASE|0x0007) /* Get network mask */
-#define SIOCSIFNETMASK (_SIOCBASE|0x0008) /* Set network mask */
-#define SIOCGIFMTU (_SIOCBASE|0x0009) /* Get MTU size */
-#define SIOCGIFHWADDR (_SIOCBASE|0x000a) /* Get hardware address */
-#define SIOCSIFHWADDR (_SIOCBASE|0x000b) /* Set hardware address */
-#define SIOCDIFADDR (_SIOCBASE|0x000c) /* Delete IP address */
-#define SIOCGIFCOUNT (_SIOCBASE|0x000d) /* Get number of devices */
+#define SIOCGIFADDR _SIOC(0x0001) /* Get IP address */
+#define SIOCSIFADDR _SIOC(0x0002) /* Set IP address */
+#define SIOCGIFDSTADDR _SIOC(0x0003) /* Get P-to-P address */
+#define SIOCSIFDSTADDR _SIOC(0x0004) /* Set P-to-P address */
+#define SIOCGIFBRDADDR _SIOC(0x0005) /* Get broadcast IP address */
+#define SIOCSIFBRDADDR _SIOC(0x0006) /* Set broadcast IP address */
+#define SIOCGIFNETMASK _SIOC(0x0007) /* Get network mask */
+#define SIOCSIFNETMASK _SIOC(0x0008) /* Set network mask */
+#define SIOCGIFMTU _SIOC(0x0009) /* Get MTU size */
+#define SIOCGIFHWADDR _SIOC(0x000a) /* Get hardware address */
+#define SIOCSIFHWADDR _SIOC(0x000b) /* Set hardware address */
+#define SIOCDIFADDR _SIOC(0x000c) /* Delete IP address */
+#define SIOCGIFCOUNT _SIOC(0x000d) /* Get number of devices */
/****************************************************************************
* Type Definitions