From 627dfd23c0a52dc8a5f8b9c2cdaaa6681154f948 Mon Sep 17 00:00:00 2001 From: patacongo Date: Fri, 12 Sep 2008 00:39:12 +0000 Subject: Standardizing ioctls git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@912 42af7a65-404d-4744-a932-0658087f49c3 --- nuttx/include/net/ethernet.h | 10 +++++----- nuttx/include/net/if.h | 10 +++++----- nuttx/include/net/ioctls.h | 39 ++++++++++++++++++++------------------- 3 files changed, 30 insertions(+), 29 deletions(-) (limited to 'nuttx/include/net') 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 * * 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 /**************************************************************************** - * 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 * * 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 /**************************************************************************** - * 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 * * Redistribution and use in source and binary forms, with or without @@ -40,32 +40,33 @@ * Included Files ****************************************************************************/ +#include /* _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 -- cgit v1.2.3