Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751983AbdHFRHC (ORCPT ); Sun, 6 Aug 2017 13:07:02 -0400 Received: from mail.kapsi.fi ([91.232.154.25]:60450 "EHLO mail.kapsi.fi" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751820AbdHFRG5 (ORCPT ); Sun, 6 Aug 2017 13:06:57 -0400 From: Mikko Rapeli To: linux-kernel@vger.kernel.org, linux-api@vger.kernel.org Cc: Mikko Rapeli , Frans Klaver , David Miller , "Dmitry V. Levin" , Jonas Gorski Subject: [PATCH v06 34/36] uapi: break dependency loop between and Date: Sun, 6 Aug 2017 18:44:25 +0200 Message-Id: <20170806164428.2273-35-mikko.rapeli@iki.fi> X-Mailer: git-send-email 2.13.3 In-Reply-To: <20170806164428.2273-1-mikko.rapeli@iki.fi> References: <20170806164428.2273-1-mikko.rapeli@iki.fi> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-SA-Exim-Connect-IP: 2003:6c:cd28:d400:219:d2ff:fe03:c7a9 X-SA-Exim-Mail-From: mikko.rapeli@iki.fi X-SA-Exim-Scanned: No (on mail.kapsi.fi); SAEximRunCond expanded to false Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 3998 Lines: 128 Name structs in linux/hdlc/ioctl.h and forward declare and use them in linux/if.h. Then include linux/if.h in linux/hdlc/ioctl.h to fix user space compilation problem: hdlc/ioctl.h:73:14: error: ‘IFNAMSIZ’ undeclared here (not in a function) char master[IFNAMSIZ]; /* Name of master FRAD device */ ^~~~~~~~ This approach for suggested by Frans Klaver in lkml message . Signed-off-by: Mikko Rapeli Cc: Frans Klaver Cc: David Miller --- include/uapi/linux/hdlc/ioctl.h | 17 +++++++++-------- include/uapi/linux/if.h | 23 ++++++++++++++++------- 2 files changed, 25 insertions(+), 15 deletions(-) diff --git a/include/uapi/linux/hdlc/ioctl.h b/include/uapi/linux/hdlc/ioctl.h index 04bc0274a189..717d3edef7d1 100644 --- a/include/uapi/linux/hdlc/ioctl.h +++ b/include/uapi/linux/hdlc/ioctl.h @@ -1,6 +1,7 @@ #ifndef __HDLC_IOCTL_H__ #define __HDLC_IOCTL_H__ +#include #define GENERIC_HDLC_VERSION 4 /* For synchronization with sethdlc utility */ @@ -36,25 +37,25 @@ #ifndef __ASSEMBLY__ -typedef struct { +typedef struct sync_serial_settings { unsigned int clock_rate; /* bits per second */ unsigned int clock_type; /* internal, external, TX-internal etc. */ unsigned short loopback; } sync_serial_settings; /* V.35, V.24, X.21 */ -typedef struct { +typedef struct te1_settings { unsigned int clock_rate; /* bits per second */ unsigned int clock_type; /* internal, external, TX-internal etc. */ unsigned short loopback; unsigned int slot_map; } te1_settings; /* T1, E1 */ -typedef struct { +typedef struct raw_hdlc_proto { unsigned short encoding; unsigned short parity; } raw_hdlc_proto; -typedef struct { +typedef struct fr_proto { unsigned int t391; unsigned int t392; unsigned int n391; @@ -64,16 +65,16 @@ typedef struct { unsigned short dce; /* 1 for DCE (network side) operation */ } fr_proto; -typedef struct { +typedef struct fr_proto_pvc { unsigned int dlci; } fr_proto_pvc; /* for creating/deleting FR PVCs */ -typedef struct { +typedef struct fr_proto_pvc_info { unsigned int dlci; char master[IFNAMSIZ]; /* Name of master FRAD device */ -}fr_proto_pvc_info; /* for returning PVC information only */ +} fr_proto_pvc_info; /* for returning PVC information only */ -typedef struct { +typedef struct cisco_proto { unsigned int interval; unsigned int timeout; } cisco_proto; diff --git a/include/uapi/linux/if.h b/include/uapi/linux/if.h index 259617a551f2..b57d9cd08ac9 100644 --- a/include/uapi/linux/if.h +++ b/include/uapi/linux/if.h @@ -34,6 +34,15 @@ #define IFALIASZ 256 #include +/* Forward declarations to break dependency loop with */ +struct sync_serial_settings; +struct ae1_settings; +struct raw_hdlc_proto; +struct fr_proto; +struct fr_proto_pvc; +struct fr_proto_pvc_info; +struct cisco_proto; + /* For glibc compatibility. An empty enum does not compile. */ #if __UAPI_DEF_IF_NET_DEVICE_FLAGS_LOWER_UP_DORMANT_ECHO != 0 || \ __UAPI_DEF_IF_NET_DEVICE_FLAGS != 0 @@ -206,15 +215,15 @@ struct if_settings { unsigned int size; /* Size of the data allocated by the caller */ union { /* {atm/eth/dsl}_settings anyone ? */ - raw_hdlc_proto __user *raw_hdlc; - cisco_proto __user *cisco; - fr_proto __user *fr; - fr_proto_pvc __user *fr_pvc; - fr_proto_pvc_info __user *fr_pvc_info; + struct raw_hdlc_proto __user *raw_hdlc; + struct cisco_proto __user *cisco; + struct fr_proto __user *fr; + struct fr_proto_pvc __user *fr_pvc; + struct fr_proto_pvc_info __user *fr_pvc_info; /* interface settings */ - sync_serial_settings __user *sync; - te1_settings __user *te1; + struct sync_serial_settings __user *sync; + struct te1_settings __user *te1; } ifs_ifsu; }; -- 2.13.3