aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/layerscape/patches-5.4/701-net-0408-sdk_fman-fix-CONFIG_COMPAT-leak-during-headers-insta.patch
blob: bff431c52d05d904aebfae4906557002f8b2e14f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
From 7837219f354524f6c2c9332a6a5aa616c28f53a9 Mon Sep 17 00:00:00 2001
From: Yangbo Lu <yangbo.lu@nxp.com>
Date: Thu, 20 Aug 2020 18:38:49 +0800
Subject: [PATCH] sdk_fman: fix CONFIG_COMPAT leak during headers installing

This patch is to fix CONFIG_COMPAT leak during headers installing
by replacing CONFIG_COMPAT kernel option with FM_COMPAT instead.

Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
---
 .../net/ethernet/freescale/sdk_fman/ncsw_config.mk |  5 ++
 include/uapi/linux/fmd/Peripherals/fm_ioctls.h     | 16 ++---
 include/uapi/linux/fmd/Peripherals/fm_pcd_ioctls.h | 72 +++++++++++-----------
 .../uapi/linux/fmd/Peripherals/fm_port_ioctls.h    | 14 ++---
 .../uapi/linux/fmd/Peripherals/fm_test_ioctls.h    |  4 +-
 5 files changed, 58 insertions(+), 53 deletions(-)

--- a/drivers/net/ethernet/freescale/sdk_fman/ncsw_config.mk
+++ b/drivers/net/ethernet/freescale/sdk_fman/ncsw_config.mk
@@ -44,6 +44,11 @@ ifdef CONFIG_FMAN_ARM
 ccflags-y += -I$(FMAN)/inc/integrations/LS1043
 endif
 
+# FM_COMPAT is used in kernel headers in case of kernel option leaking
+ifeq ("$(CONFIG_COMPAT)", "y")
+ccflags-y += -DFM_COMPAT
+endif
+
 ccflags-y += -I$(FMAN)/src/inc
 ccflags-y += -I$(FMAN)/src/inc/system
 ccflags-y += -I$(FMAN)/src/inc/wrapper
--- a/include/uapi/linux/fmd/Peripherals/fm_ioctls.h
+++ b/include/uapi/linux/fmd/Peripherals/fm_ioctls.h
@@ -434,7 +434,7 @@ typedef struct ioc_fm_ctrl_mon_counters_
 
  @Retval        Handle to FM VSP object, or NULL for Failure.
 *//***************************************************************************/
-#if defined(CONFIG_COMPAT)
+#if defined(FM_COMPAT)
 #define FM_IOC_VSP_CONFIG_COMPAT                             _IOWR(FM_IOC_TYPE_BASE, FM_IOC_NUM(8), ioc_compat_fm_vsp_params_t)
 #endif
 #define FM_IOC_VSP_CONFIG                                    _IOWR(FM_IOC_TYPE_BASE, FM_IOC_NUM(8), ioc_fm_vsp_params_t)
@@ -448,7 +448,7 @@ typedef struct ioc_fm_ctrl_mon_counters_
 
  @Return        E_OK on success; Error code otherwise.
 *//***************************************************************************/
-#if defined(CONFIG_COMPAT)
+#if defined(FM_COMPAT)
 #define FM_IOC_VSP_INIT_COMPAT                               _IOW(FM_IOC_TYPE_BASE, FM_IOC_NUM(9), ioc_compat_fm_obj_t)
 #endif
 #define FM_IOC_VSP_INIT                                      _IOW(FM_IOC_TYPE_BASE, FM_IOC_NUM(9), ioc_fm_obj_t)
@@ -464,7 +464,7 @@ typedef struct ioc_fm_ctrl_mon_counters_
 
  @Return        E_OK on success; Error code otherwise.
 *//***************************************************************************/
-#if defined(CONFIG_COMPAT)
+#if defined(FM_COMPAT)
 #define FM_IOC_VSP_FREE_COMPAT                               _IOW(FM_IOC_TYPE_BASE, FM_IOC_NUM(10), ioc_compat_fm_obj_t)
 #endif
 #define FM_IOC_VSP_FREE                                      _IOW(FM_IOC_TYPE_BASE, FM_IOC_NUM(10), ioc_fm_obj_t)
@@ -482,7 +482,7 @@ typedef struct ioc_fm_ctrl_mon_counters_
 
  @Cautions      Allowed only following FM_VSP_Config() and before FM_VSP_Init().
 *//***************************************************************************/
-#if defined(CONFIG_COMPAT)
+#if defined(FM_COMPAT)
 #define FM_IOC_VSP_CONFIG_POOL_DEPLETION_COMPAT              _IOW(FM_IOC_TYPE_BASE, FM_IOC_NUM(11), ioc_compat_fm_buf_pool_depletion_params_t)
 #endif
 #define FM_IOC_VSP_CONFIG_POOL_DEPLETION                     _IOW(FM_IOC_TYPE_BASE, FM_IOC_NUM(11), ioc_fm_buf_pool_depletion_params_t)
@@ -512,7 +512,7 @@ typedef struct ioc_fm_ctrl_mon_counters_
 
  @Cautions      Allowed only following FM_VSP_Config() and before FM_VSP_Init().
 *//***************************************************************************/
-#if defined(CONFIG_COMPAT)
+#if defined(FM_COMPAT)
 #define FM_IOC_VSP_CONFIG_BUFFER_PREFIX_CONTENT_COMPAT       _IOW(FM_IOC_TYPE_BASE, FM_IOC_NUM(12), ioc_compat_fm_buffer_prefix_content_params_t)
 #endif
 #define FM_IOC_VSP_CONFIG_BUFFER_PREFIX_CONTENT              _IOW(FM_IOC_TYPE_BASE, FM_IOC_NUM(12), ioc_fm_buffer_prefix_content_params_t)
@@ -530,7 +530,7 @@ typedef struct ioc_fm_ctrl_mon_counters_
 
  @Cautions      Allowed only following FM_VSP_Config() and before FM_VSP_Init().
 *//***************************************************************************/
-#if defined(CONFIG_COMPAT)
+#if defined(FM_COMPAT)
 #define FM_IOC_VSP_CONFIG_NO_SG_COMPAT                     _IOW(FM_IOC_TYPE_BASE, FM_IOC_NUM(13), ioc_compat_fm_vsp_config_no_sg_params_t)
 #endif
 #define FM_IOC_VSP_CONFIG_NO_SG                            _IOW(FM_IOC_TYPE_BASE, FM_IOC_NUM(13), ioc_fm_vsp_config_no_sg_params_t)
@@ -554,7 +554,7 @@ typedef struct ioc_fm_ctrl_mon_counters_
 
  @Cautions      Allowed only following FM_VSP_Init().
 *//***************************************************************************/
-#if defined(CONFIG_COMPAT)
+#if defined(FM_COMPAT)
 #define FM_IOC_VSP_GET_BUFFER_PRS_RESULT_COMPAT            _IOWR(FM_IOC_TYPE_BASE, FM_IOC_NUM(14), ioc_compat_fm_vsp_prs_result_params_t)
 #endif
 #define FM_IOC_VSP_GET_BUFFER_PRS_RESULT                   _IOWR(FM_IOC_TYPE_BASE, FM_IOC_NUM(14), ioc_fm_vsp_prs_result_params_t)
@@ -612,7 +612,7 @@ typedef struct ioc_fm_ctrl_mon_counters_
 
  @Cautions      Allowed only following FM_Init().
 *//***************************************************************************/
-#if defined(CONFIG_COMPAT)
+#if defined(FM_COMPAT)
 #define FM_IOC_CTRL_MON_GET_COUNTERS_COMPAT                _IOW(FM_IOC_TYPE_BASE, FM_IOC_NUM(17), ioc_compat_fm_ctrl_mon_counters_params_t)
 #endif
 #define FM_IOC_CTRL_MON_GET_COUNTERS                       _IOW(FM_IOC_TYPE_BASE, FM_IOC_NUM(17), ioc_fm_ctrl_mon_counters_params_t)
--- a/include/uapi/linux/fmd/Peripherals/fm_pcd_ioctls.h
+++ b/include/uapi/linux/fmd/Peripherals/fm_pcd_ioctls.h
@@ -312,7 +312,7 @@ typedef struct ioc_fm_pcd_kg_dflt_value_
 
  @Cautions      Allowed only when PCD is disabled.
 *//***************************************************************************/
-#if defined(CONFIG_COMPAT)
+#if defined(FM_COMPAT)
 #define FM_PCD_IOC_PRS_LOAD_SW_COMPAT  _IOW(FM_IOC_TYPE_BASE, FM_PCD_IOC_NUM(3), ioc_compat_fm_pcd_prs_sw_params_t)
 #endif
 #define FM_PCD_IOC_PRS_LOAD_SW  _IOW(FM_IOC_TYPE_BASE, FM_PCD_IOC_NUM(3), ioc_fm_pcd_prs_sw_params_t)
@@ -385,7 +385,7 @@ typedef struct ioc_fm_pcd_kg_dflt_value_
 
  @Cautions      Allowed only following FM_PCD_Init() & FM_PCD_KgSchemeSet().
 *//***************************************************************************/
-#if defined(CONFIG_COMPAT)
+#if defined(FM_COMPAT)
 #define FM_PCD_IOC_KG_SCHEME_GET_CNTR_COMPAT  _IOR(FM_IOC_TYPE_BASE, FM_PCD_IOC_NUM(4), ioc_compat_fm_pcd_kg_scheme_spc_t)
 #endif
 #define FM_PCD_IOC_KG_SCHEME_GET_CNTR  _IOR(FM_IOC_TYPE_BASE, FM_PCD_IOC_NUM(4), ioc_fm_pcd_kg_scheme_spc_t)
@@ -2413,7 +2413,7 @@ typedef struct ioc_fm_pcd_cc_tbl_get_sta
  @Cautions      Allowed only following FM_PCD_MatchTableSet().
 *//***************************************************************************/
 
-#if defined(CONFIG_COMPAT)
+#if defined(FM_COMPAT)
 #define FM_PCD_IOC_MATCH_TABLE_GET_KEY_STAT_COMPAT   _IOWR(FM_IOC_TYPE_BASE, FM_PCD_IOC_NUM(12), ioc_compat_fm_pcd_cc_tbl_get_stats_t)
 #endif
 #define FM_PCD_IOC_MATCH_TABLE_GET_KEY_STAT  _IOWR(FM_IOC_TYPE_BASE, FM_PCD_IOC_NUM(12), ioc_fm_pcd_cc_tbl_get_stats_t)
@@ -2439,7 +2439,7 @@ typedef struct ioc_fm_pcd_cc_tbl_get_sta
  @Cautions      Allowed only following FM_PCD_MatchTableSet().
 *//***************************************************************************/
 
-#if defined(CONFIG_COMPAT)
+#if defined(FM_COMPAT)
 #define FM_PCD_IOC_MATCH_TABLE_GET_MISS_STAT_COMPAT   _IOWR(FM_IOC_TYPE_BASE, FM_PCD_IOC_NUM(13), ioc_compat_fm_pcd_cc_tbl_get_stats_t)
 #endif
 #define FM_PCD_IOC_MATCH_TABLE_GET_MISS_STAT  _IOWR(FM_IOC_TYPE_BASE, FM_PCD_IOC_NUM(13), ioc_fm_pcd_cc_tbl_get_stats_t)
@@ -2463,7 +2463,7 @@ typedef struct ioc_fm_pcd_cc_tbl_get_sta
  @Cautions      Allowed only following FM_PCD_HashTableSet().
 *//***************************************************************************/
 
-#if defined(CONFIG_COMPAT)
+#if defined(FM_COMPAT)
 #define FM_PCD_IOC_HASH_TABLE_GET_MISS_STAT_COMPAT   _IOWR(FM_IOC_TYPE_BASE, FM_PCD_IOC_NUM(14), ioc_compat_fm_pcd_cc_tbl_get_stats_t)
 #endif
 #define FM_PCD_IOC_HASH_TABLE_GET_MISS_STAT  _IOWR(FM_IOC_TYPE_BASE, FM_PCD_IOC_NUM(14), ioc_fm_pcd_cc_tbl_get_stats_t)
@@ -2511,7 +2511,7 @@ typedef struct ioc_fm_pcd_cc_tbl_get_sta
 
  @Return        0 on success; Error code otherwise.
 *//***************************************************************************/
-#if defined(CONFIG_COMPAT)
+#if defined(FM_COMPAT)
 #define FM_PCD_IOC_NET_ENV_CHARACTERISTICS_SET_COMPAT   _IOWR(FM_IOC_TYPE_BASE, FM_PCD_IOC_NUM(20), ioc_compat_fm_pcd_net_env_params_t)
 #endif
 #define FM_PCD_IOC_NET_ENV_CHARACTERISTICS_SET  _IOWR(FM_IOC_TYPE_BASE, FM_PCD_IOC_NUM(20), ioc_fm_pcd_net_env_params_t)
@@ -2525,7 +2525,7 @@ typedef struct ioc_fm_pcd_cc_tbl_get_sta
 
  @Return        0 on success; Error code otherwise.
 *//***************************************************************************/
-#if defined(CONFIG_COMPAT)
+#if defined(FM_COMPAT)
 #define FM_PCD_IOC_NET_ENV_CHARACTERISTICS_DELETE_COMPAT  _IOW(FM_IOC_TYPE_BASE, FM_PCD_IOC_NUM(21), ioc_compat_fm_obj_t)
 #endif
 #define FM_PCD_IOC_NET_ENV_CHARACTERISTICS_DELETE   _IOW(FM_IOC_TYPE_BASE, FM_PCD_IOC_NUM(21), ioc_fm_obj_t)
@@ -2544,7 +2544,7 @@ typedef struct ioc_fm_pcd_cc_tbl_get_sta
 
  @Return        0 on success; Error code otherwise.
 *//***************************************************************************/
-#if defined(CONFIG_COMPAT)
+#if defined(FM_COMPAT)
 #define FM_PCD_IOC_KG_SCHEME_SET_COMPAT     _IOWR(FM_IOC_TYPE_BASE, FM_PCD_IOC_NUM(24), ioc_compat_fm_pcd_kg_scheme_params_t)
 #endif
 #define FM_PCD_IOC_KG_SCHEME_SET    _IOWR(FM_IOC_TYPE_BASE, FM_PCD_IOC_NUM(24), ioc_fm_pcd_kg_scheme_params_t)
@@ -2558,7 +2558,7 @@ typedef struct ioc_fm_pcd_cc_tbl_get_sta
 
  @Return        0 on success; Error code otherwise.
 *//***************************************************************************/
-#if defined(CONFIG_COMPAT)
+#if defined(FM_COMPAT)
 #define FM_PCD_IOC_KG_SCHEME_DELETE_COMPAT  _IOW(FM_IOC_TYPE_BASE, FM_PCD_IOC_NUM(25), ioc_compat_fm_obj_t)
 #endif
 #define FM_PCD_IOC_KG_SCHEME_DELETE     _IOW(FM_IOC_TYPE_BASE, FM_PCD_IOC_NUM(25), ioc_fm_obj_t)
@@ -2575,7 +2575,7 @@ typedef struct ioc_fm_pcd_cc_tbl_get_sta
 
  @Return        0 on success; Error code otherwise.
 *//***************************************************************************/
-#if defined(CONFIG_COMPAT)
+#if defined(FM_COMPAT)
 #define FM_PCD_IOC_CC_ROOT_BUILD_COMPAT _IOWR(FM_IOC_TYPE_BASE, FM_PCD_IOC_NUM(26), compat_uptr_t)
 #endif
 #define FM_PCD_IOC_CC_ROOT_BUILD    _IOWR(FM_IOC_TYPE_BASE, FM_PCD_IOC_NUM(26), void *) /* workaround ...*/
@@ -2587,7 +2587,7 @@ typedef struct ioc_fm_pcd_cc_tbl_get_sta
 
  @Param[in]     ioc_fm_obj_t - The id of a CC tree.
 *//***************************************************************************/
-#if defined(CONFIG_COMPAT)
+#if defined(FM_COMPAT)
 #define FM_PCD_IOC_CC_ROOT_DELETE_COMPAT    _IOW(FM_IOC_TYPE_BASE, FM_PCD_IOC_NUM(27), ioc_compat_fm_obj_t)
 #endif
 #define FM_PCD_IOC_CC_ROOT_DELETE    _IOW(FM_IOC_TYPE_BASE, FM_PCD_IOC_NUM(27), ioc_fm_obj_t)
@@ -2604,7 +2604,7 @@ typedef struct ioc_fm_pcd_cc_tbl_get_sta
 
  @Return        0 on success; Error code otherwise.
 *//***************************************************************************/
-#if defined(CONFIG_COMPAT)
+#if defined(FM_COMPAT)
 #define FM_PCD_IOC_MATCH_TABLE_SET_COMPAT    _IOWR(FM_IOC_TYPE_BASE, FM_PCD_IOC_NUM(28), compat_uptr_t)
 #endif
 #define FM_PCD_IOC_MATCH_TABLE_SET    _IOWR(FM_IOC_TYPE_BASE, FM_PCD_IOC_NUM(28), void *) /* workaround ...*/
@@ -2618,7 +2618,7 @@ typedef struct ioc_fm_pcd_cc_tbl_get_sta
 
  @Return        0 on success; Error code otherwise.
 *//***************************************************************************/
-#if defined(CONFIG_COMPAT)
+#if defined(FM_COMPAT)
 #define FM_PCD_IOC_MATCH_TABLE_DELETE_COMPAT    _IOW(FM_IOC_TYPE_BASE, FM_PCD_IOC_NUM(29), ioc_compat_fm_obj_t)
 #endif
 #define FM_PCD_IOC_MATCH_TABLE_DELETE   _IOW(FM_IOC_TYPE_BASE, FM_PCD_IOC_NUM(29), ioc_fm_obj_t)
@@ -2634,7 +2634,7 @@ typedef struct ioc_fm_pcd_cc_tbl_get_sta
 
  @Cautions      Allowed only following FM_PCD_CcRootBuild().
 *//***************************************************************************/
-#if defined(CONFIG_COMPAT)
+#if defined(FM_COMPAT)
 #define FM_PCD_IOC_CC_ROOT_MODIFY_NEXT_ENGINE_COMPAT   _IOW(FM_IOC_TYPE_BASE, FM_PCD_IOC_NUM(30), ioc_compat_fm_pcd_cc_tree_modify_next_engine_params_t)
 #endif
 #define FM_PCD_IOC_CC_ROOT_MODIFY_NEXT_ENGINE   _IOW(FM_IOC_TYPE_BASE, FM_PCD_IOC_NUM(30), ioc_fm_pcd_cc_tree_modify_next_engine_params_t)
@@ -2650,7 +2650,7 @@ typedef struct ioc_fm_pcd_cc_tbl_get_sta
 
  @Cautions      Allowed only following FM_PCD_MatchTableSet().
 *//***************************************************************************/
-#if defined(CONFIG_COMPAT)
+#if defined(FM_COMPAT)
 #define FM_PCD_IOC_MATCH_TABLE_MODIFY_NEXT_ENGINE_COMPAT   _IOW(FM_IOC_TYPE_BASE, FM_PCD_IOC_NUM(31), ioc_compat_fm_pcd_cc_node_modify_next_engine_params_t)
 #endif
 #define FM_PCD_IOC_MATCH_TABLE_MODIFY_NEXT_ENGINE   _IOW(FM_IOC_TYPE_BASE, FM_PCD_IOC_NUM(31), ioc_fm_pcd_cc_node_modify_next_engine_params_t)
@@ -2666,7 +2666,7 @@ typedef struct ioc_fm_pcd_cc_tbl_get_sta
 
  @Cautions      Allowed only following FM_PCD_MatchTableSet().
 *//***************************************************************************/
-#if defined(CONFIG_COMPAT)
+#if defined(FM_COMPAT)
 #define FM_PCD_IOC_MATCH_TABLE_MODIFY_MISS_NEXT_ENGINE_COMPAT   _IOW(FM_IOC_TYPE_BASE, FM_PCD_IOC_NUM(32), ioc_compat_fm_pcd_cc_node_modify_next_engine_params_t)
 #endif
 #define FM_PCD_IOC_MATCH_TABLE_MODIFY_MISS_NEXT_ENGINE _IOW(FM_IOC_TYPE_BASE, FM_PCD_IOC_NUM(32), ioc_fm_pcd_cc_node_modify_next_engine_params_t)
@@ -2684,7 +2684,7 @@ typedef struct ioc_fm_pcd_cc_tbl_get_sta
  @Cautions      Allowed only after FM_PCD_MatchTableSet() has been called for this
                 node and for all of the nodes that lead to it.
 *//***************************************************************************/
-#if defined(CONFIG_COMPAT)
+#if defined(FM_COMPAT)
 #define FM_PCD_IOC_MATCH_TABLE_REMOVE_KEY_COMPAT    _IOW(FM_IOC_TYPE_BASE, FM_PCD_IOC_NUM(33), ioc_compat_fm_pcd_cc_node_remove_key_params_t)
 #endif
 #define FM_PCD_IOC_MATCH_TABLE_REMOVE_KEY   _IOW(FM_IOC_TYPE_BASE, FM_PCD_IOC_NUM(33), ioc_fm_pcd_cc_node_remove_key_params_t)
@@ -2705,7 +2705,7 @@ typedef struct ioc_fm_pcd_cc_tbl_get_sta
  @Cautions      Allowed only after FM_PCD_MatchTableSet() has been called for this
                 node and for all of the nodes that lead to it.
 *//***************************************************************************/
-#if defined(CONFIG_COMPAT)
+#if defined(FM_COMPAT)
 #define FM_PCD_IOC_MATCH_TABLE_ADD_KEY_COMPAT   _IOW(FM_IOC_TYPE_BASE, FM_PCD_IOC_NUM(34), ioc_compat_fm_pcd_cc_node_modify_key_and_next_engine_params_t)
 #endif
 #define FM_PCD_IOC_MATCH_TABLE_ADD_KEY  _IOW(FM_IOC_TYPE_BASE, FM_PCD_IOC_NUM(34), ioc_fm_pcd_cc_node_modify_key_and_next_engine_params_t)
@@ -2722,7 +2722,7 @@ typedef struct ioc_fm_pcd_cc_tbl_get_sta
  @Cautions      Allowed only following FM_PCD_MatchTableSet() not only of the relevnt node but also
                 the node that points to this node
 *//***************************************************************************/
-#if defined(CONFIG_COMPAT)
+#if defined(FM_COMPAT)
 #define FM_PCD_IOC_MATCH_TABLE_MODIFY_KEY_AND_NEXT_ENGINE_COMPAT    _IOW(FM_IOC_TYPE_BASE, FM_PCD_IOC_NUM(35), ioc_compat_fm_pcd_cc_node_modify_key_and_next_engine_params_t)
 #endif
 #define FM_PCD_IOC_MATCH_TABLE_MODIFY_KEY_AND_NEXT_ENGINE   _IOW(FM_IOC_TYPE_BASE, FM_PCD_IOC_NUM(35), ioc_fm_pcd_cc_node_modify_key_and_next_engine_params_t)
@@ -2739,7 +2739,7 @@ typedef struct ioc_fm_pcd_cc_tbl_get_sta
  @Cautions      Allowed only after FM_PCD_MatchTableSet() has been called for this
                 node and for all of the nodes that lead to it.
 *//***************************************************************************/
-#if defined(CONFIG_COMPAT)
+#if defined(FM_COMPAT)
 #define FM_PCD_IOC_MATCH_TABLE_MODIFY_KEY_COMPAT    _IOW(FM_IOC_TYPE_BASE, FM_PCD_IOC_NUM(36), ioc_compat_fm_pcd_cc_node_modify_key_params_t)
 #endif
 #define FM_PCD_IOC_MATCH_TABLE_MODIFY_KEY   _IOW(FM_IOC_TYPE_BASE, FM_PCD_IOC_NUM(36), ioc_fm_pcd_cc_node_modify_key_params_t)
@@ -2766,7 +2766,7 @@ typedef struct ioc_fm_pcd_cc_tbl_get_sta
 
  @Return        0 on success; Error code otherwise.
 *//***************************************************************************/
-#if defined(CONFIG_COMPAT)
+#if defined(FM_COMPAT)
 #define FM_PCD_IOC_HASH_TABLE_SET_COMPAT _IOWR(FM_IOC_TYPE_BASE, FM_PCD_IOC_NUM(37), ioc_compat_fm_pcd_hash_table_params_t)
 #endif
 #define FM_PCD_IOC_HASH_TABLE_SET _IOWR(FM_IOC_TYPE_BASE, FM_PCD_IOC_NUM(37), ioc_fm_pcd_hash_table_params_t)
@@ -2784,7 +2784,7 @@ typedef struct ioc_fm_pcd_cc_tbl_get_sta
 
  @Cautions      Allowed only following FM_PCD_HashTableSet().
 *//***************************************************************************/
-#if defined(CONFIG_COMPAT)
+#if defined(FM_COMPAT)
 #define FM_PCD_IOC_HASH_TABLE_DELETE_COMPAT _IOW(FM_IOC_TYPE_BASE, FM_PCD_IOC_NUM(37), ioc_compat_fm_obj_t)
 #endif
 #define FM_PCD_IOC_HASH_TABLE_DELETE _IOW(FM_IOC_TYPE_BASE, FM_PCD_IOC_NUM(37), ioc_fm_obj_t)
@@ -2803,7 +2803,7 @@ typedef struct ioc_fm_pcd_cc_tbl_get_sta
 
  @Cautions      Allowed only following FM_PCD_HashTableSet().
 *//***************************************************************************/
-#if defined(CONFIG_COMPAT)
+#if defined(FM_COMPAT)
 #define FM_PCD_IOC_HASH_TABLE_ADD_KEY_COMPAT _IOW(FM_IOC_TYPE_BASE, FM_PCD_IOC_NUM(39), ioc_compat_fm_pcd_hash_table_add_key_params_t)
 #endif
 #define FM_PCD_IOC_HASH_TABLE_ADD_KEY _IOW(FM_IOC_TYPE_BASE, FM_PCD_IOC_NUM(39), ioc_fm_pcd_hash_table_add_key_params_t)
@@ -2820,7 +2820,7 @@ typedef struct ioc_fm_pcd_cc_tbl_get_sta
 
  @Cautions      Allowed only following FM_PCD_HashTableSet().
 *//***************************************************************************/
-#if defined(CONFIG_COMPAT)
+#if defined(FM_COMPAT)
 #define FM_PCD_IOC_HASH_TABLE_REMOVE_KEY_COMPAT _IOW(FM_IOC_TYPE_BASE, FM_PCD_IOC_NUM(40), ioc_compat_fm_pcd_hash_table_remove_key_params_t)
 #endif
 #define FM_PCD_IOC_HASH_TABLE_REMOVE_KEY _IOW(FM_IOC_TYPE_BASE, FM_PCD_IOC_NUM(40), ioc_fm_pcd_hash_table_remove_key_params_t)
@@ -2836,7 +2836,7 @@ typedef struct ioc_fm_pcd_cc_tbl_get_sta
 
  @Return        0 on success; Error code otherwise.
 *//***************************************************************************/
-#if defined(CONFIG_COMPAT)
+#if defined(FM_COMPAT)
 #define FM_PCD_IOC_PLCR_PROFILE_SET_COMPAT     _IOWR(FM_IOC_TYPE_BASE, FM_PCD_IOC_NUM(41), ioc_compat_fm_pcd_plcr_profile_params_t)
 #endif
 #define FM_PCD_IOC_PLCR_PROFILE_SET     _IOWR(FM_IOC_TYPE_BASE, FM_PCD_IOC_NUM(41), ioc_fm_pcd_plcr_profile_params_t)
@@ -2851,7 +2851,7 @@ typedef struct ioc_fm_pcd_cc_tbl_get_sta
 
  @Return        0 on success; Error code otherwise.
 *//***************************************************************************/
-#if defined(CONFIG_COMPAT)
+#if defined(FM_COMPAT)
 #define FM_PCD_IOC_PLCR_PROFILE_DELETE_COMPAT   _IOW(FM_IOC_TYPE_BASE, FM_PCD_IOC_NUM(41), ioc_compat_fm_obj_t)
 #endif
 #define FM_PCD_IOC_PLCR_PROFILE_DELETE  _IOW(FM_IOC_TYPE_BASE, FM_PCD_IOC_NUM(41), ioc_fm_obj_t)
@@ -2867,7 +2867,7 @@ typedef struct ioc_fm_pcd_cc_tbl_get_sta
 
  @Return        A handle to the initialized object on success; NULL code otherwise.
 *//***************************************************************************/
-#if defined(CONFIG_COMPAT)
+#if defined(FM_COMPAT)
 #define FM_PCD_IOC_MANIP_NODE_SET_COMPAT    _IOWR(FM_IOC_TYPE_BASE, FM_PCD_IOC_NUM(43), ioc_compat_fm_pcd_manip_params_t)
 #endif
 #define FM_PCD_IOC_MANIP_NODE_SET   _IOWR(FM_IOC_TYPE_BASE, FM_PCD_IOC_NUM(43), ioc_fm_pcd_manip_params_t)
@@ -2887,7 +2887,7 @@ typedef struct ioc_fm_pcd_cc_tbl_get_sta
 
  @Cautions      Allowed only following FM_PCD_ManipNodeSet().
 *//***************************************************************************/
-#if defined(CONFIG_COMPAT)
+#if defined(FM_COMPAT)
 #define FM_PCD_IOC_MANIP_NODE_REPLACE_COMPAT    FM_PCD_IOC_MANIP_NODE_SET_COMPAT
 #endif
 #define FM_PCD_IOC_MANIP_NODE_REPLACE           FM_PCD_IOC_MANIP_NODE_SET
@@ -2903,7 +2903,7 @@ typedef struct ioc_fm_pcd_cc_tbl_get_sta
 
  @Cautions      Allowed only following FM_PCD_ManipNodeSet().
 *//***************************************************************************/
-#if defined(CONFIG_COMPAT)
+#if defined(FM_COMPAT)
 #define FM_PCD_IOC_MANIP_NODE_DELETE_COMPAT _IOW(FM_IOC_TYPE_BASE, FM_PCD_IOC_NUM(44), ioc_compat_fm_obj_t)
 #endif
 #define FM_PCD_IOC_MANIP_NODE_DELETE    _IOW(FM_IOC_TYPE_BASE, FM_PCD_IOC_NUM(44), ioc_fm_obj_t)
@@ -2920,7 +2920,7 @@ typedef struct ioc_fm_pcd_cc_tbl_get_sta
 
  @Cautions      Allowed only following FM_PCD_ManipNodeSet().
 *//***************************************************************************/
-#if defined(CONFIG_COMPAT)
+#if defined(FM_COMPAT)
 #define FM_PCD_IOC_MANIP_GET_STATS_COMPAT  _IOWR(FM_IOC_TYPE_BASE, FM_PCD_IOC_NUM(50), ioc_compat_fm_pcd_manip_get_stats_t)
 #endif
 #define FM_PCD_IOC_MANIP_GET_STATS   _IOWR(FM_IOC_TYPE_BASE, FM_PCD_IOC_NUM(50), ioc_fm_pcd_manip_get_stats_t)
@@ -2953,7 +2953,7 @@ typedef struct ioc_fm_pcd_cc_tbl_get_sta
 
  @Cautions      Allowed only following FM_PCD_Init().
 *//***************************************************************************/
-#if defined(CONFIG_COMPAT)
+#if defined(FM_COMPAT)
 #define FM_PCD_IOC_FRM_REPLIC_GROUP_SET_COMPAT _IOWR(FM_IOC_TYPE_BASE, FM_PCD_IOC_NUM(46), ioc_compat_fm_pcd_frm_replic_group_params_t)
 #endif
 #define FM_PCD_IOC_FRM_REPLIC_GROUP_SET _IOWR(FM_IOC_TYPE_BASE, FM_PCD_IOC_NUM(46), ioc_fm_pcd_frm_replic_group_params_t)
@@ -2969,7 +2969,7 @@ typedef struct ioc_fm_pcd_cc_tbl_get_sta
 
  @Cautions      Allowed only following FM_PCD_FrmReplicSetGroup().
 *//***************************************************************************/
-#if defined(CONFIG_COMPAT)
+#if defined(FM_COMPAT)
 #define FM_PCD_IOC_FRM_REPLIC_GROUP_DELETE_COMPAT _IOWR(FM_IOC_TYPE_BASE, FM_PCD_IOC_NUM(47), ioc_compat_fm_obj_t)
 #endif
 #define FM_PCD_IOC_FRM_REPLIC_GROUP_DELETE _IOWR(FM_IOC_TYPE_BASE, FM_PCD_IOC_NUM(47), ioc_fm_obj_t)
@@ -2987,7 +2987,7 @@ typedef struct ioc_fm_pcd_cc_tbl_get_sta
 
  @Cautions      Allowed only following FM_PCD_FrmReplicSetGroup() of this group.
 *//***************************************************************************/
-#if defined(CONFIG_COMPAT)
+#if defined(FM_COMPAT)
 #define FM_PCD_IOC_FRM_REPLIC_MEMBER_ADD_COMPAT _IOWR(FM_IOC_TYPE_BASE, FM_PCD_IOC_NUM(48), ioc_compat_fm_pcd_frm_replic_member_params_t)
 #endif
 #define FM_PCD_IOC_FRM_REPLIC_MEMBER_ADD _IOWR(FM_IOC_TYPE_BASE, FM_PCD_IOC_NUM(48), ioc_fm_pcd_frm_replic_member_params_t)
@@ -3004,7 +3004,7 @@ typedef struct ioc_fm_pcd_cc_tbl_get_sta
 
  @Cautions      Allowed only following FM_PCD_FrmReplicSetGroup() of this group.
 *//***************************************************************************/
-#if defined(CONFIG_COMPAT)
+#if defined(FM_COMPAT)
 #define FM_PCD_IOC_FRM_REPLIC_MEMBER_REMOVE_COMPAT _IOWR(FM_IOC_TYPE_BASE, FM_PCD_IOC_NUM(49), ioc_compat_fm_pcd_frm_replic_member_t)
 #endif
 #define FM_PCD_IOC_FRM_REPLIC_MEMBER_REMOVE _IOWR(FM_IOC_TYPE_BASE, FM_PCD_IOC_NUM(49), ioc_fm_pcd_frm_replic_member_t)
@@ -3021,7 +3021,7 @@ typedef struct ioc_fm_pcd_cc_tbl_get_sta
 
  @Return        0 on success; Error code otherwise.
 *//***************************************************************************/
-#if defined(CONFIG_COMPAT)
+#if defined(FM_COMPAT)
 #define FM_PCD_IOC_STATISTICS_SET_NODE_COMPAT _IOWR(FM_IOC_TYPE_BASE, FM_PCD_IOC_NUM(45), void *)
 #endif
 #define FM_PCD_IOC_STATISTICS_SET_NODE _IOWR(FM_IOC_TYPE_BASE, FM_PCD_IOC_NUM(45), void *)
@@ -3029,7 +3029,7 @@ typedef struct ioc_fm_pcd_cc_tbl_get_sta
 #endif /* FM_CAPWAP_SUPPORT */
 
 #ifdef NCSW_BACKWARD_COMPATIBLE_API
-#if defined(CONFIG_COMPAT)
+#if defined(FM_COMPAT)
 #define FM_PCD_IOC_SET_NET_ENV_CHARACTERISTICS_COMPAT \
                                                 FM_PCD_IOC_NET_ENV_CHARACTERISTICS_SET_COMPAT
 #define FM_PCD_IOC_DELETE_NET_ENV_CHARACTERISTICS_COMPAT \
--- a/include/uapi/linux/fmd/Peripherals/fm_port_ioctls.h
+++ b/include/uapi/linux/fmd/Peripherals/fm_port_ioctls.h
@@ -589,7 +589,7 @@ typedef struct ioc_fm_port_pcd_fqids_par
 
  @Return        0 on success; error code otherwise.
 *//***************************************************************************/
-#if defined(CONFIG_COMPAT)
+#if defined(FM_COMPAT)
 #define FM_PORT_IOC_SET_PCD_COMPAT _IOW(FM_IOC_TYPE_BASE, FM_PORT_IOC_NUM(20), ioc_compat_fm_port_pcd_params_t)
 #endif
 #define FM_PORT_IOC_SET_PCD _IOW(FM_IOC_TYPE_BASE, FM_PORT_IOC_NUM(20), ioc_fm_port_pcd_params_t)
@@ -674,7 +674,7 @@ typedef struct ioc_fm_port_pcd_fqids_par
 
  @Return        0 on success; error code otherwise.
 *//***************************************************************************/
-#if defined(CONFIG_COMPAT)
+#if defined(FM_COMPAT)
 #define FM_PORT_IOC_PCD_KG_MODIFY_INITIAL_SCHEME_COMPAT _IOW(FM_IOC_TYPE_BASE, FM_PORT_IOC_NUM(26), ioc_compat_fm_pcd_kg_scheme_select_t)
 #endif
 #define FM_PORT_IOC_PCD_KG_MODIFY_INITIAL_SCHEME _IOW(FM_IOC_TYPE_BASE, FM_PORT_IOC_NUM(26), ioc_fm_pcd_kg_scheme_select_t)
@@ -691,7 +691,7 @@ typedef struct ioc_fm_port_pcd_fqids_par
 
  @Return        0 on success; error code otherwise.
 *//***************************************************************************/
-#if defined(CONFIG_COMPAT)
+#if defined(FM_COMPAT)
 #define FM_PORT_IOC_PCD_PLCR_MODIFY_INITIAL_PROFILE_COMPAT _IOW(FM_IOC_TYPE_BASE, FM_PORT_IOC_NUM(27), ioc_compat_fm_obj_t)
 #endif
 #define FM_PORT_IOC_PCD_PLCR_MODIFY_INITIAL_PROFILE _IOW(FM_IOC_TYPE_BASE, FM_PORT_IOC_NUM(27), ioc_fm_obj_t)
@@ -708,7 +708,7 @@ typedef struct ioc_fm_port_pcd_fqids_par
 
  @Cautions      Allowed only following FM_PORT_SetPCD() and FM_PORT_DetachPCD()
 *//***************************************************************************/
-#if defined(CONFIG_COMPAT)
+#if defined(FM_COMPAT)
 #define FM_PORT_IOC_PCD_CC_MODIFY_TREE_COMPAT _IOW(FM_IOC_TYPE_BASE, FM_PORT_IOC_NUM(28), ioc_compat_fm_obj_t)
 #endif
 #define FM_PORT_IOC_PCD_CC_MODIFY_TREE _IOW(FM_IOC_TYPE_BASE, FM_PORT_IOC_NUM(28), ioc_fm_obj_t)
@@ -726,7 +726,7 @@ typedef struct ioc_fm_port_pcd_fqids_par
 
  @Cautions      Allowed only following FM_PORT_SetPCD().
 *//***************************************************************************/
-#if defined(CONFIG_COMPAT)
+#if defined(FM_COMPAT)
 #define FM_PORT_IOC_PCD_KG_BIND_SCHEMES_COMPAT _IOW(FM_IOC_TYPE_BASE, FM_PORT_IOC_NUM(30), ioc_compat_fm_pcd_port_schemes_params_t)
 #endif
 #define FM_PORT_IOC_PCD_KG_BIND_SCHEMES _IOW(FM_IOC_TYPE_BASE, FM_PORT_IOC_NUM(30), ioc_fm_pcd_port_schemes_params_t)
@@ -744,7 +744,7 @@ typedef struct ioc_fm_port_pcd_fqids_par
 
  @Cautions      Allowed only following FM_PORT_SetPCD().
 *//***************************************************************************/
-#if defined(CONFIG_COMPAT)
+#if defined(FM_COMPAT)
 #define FM_PORT_IOC_PCD_KG_UNBIND_SCHEMES_COMPAT _IOW(FM_IOC_TYPE_BASE, FM_PORT_IOC_NUM(31), ioc_compat_fm_pcd_port_schemes_params_t)
 #endif
 #define FM_PORT_IOC_PCD_KG_UNBIND_SCHEMES _IOW(FM_IOC_TYPE_BASE, FM_PORT_IOC_NUM(31), ioc_fm_pcd_port_schemes_params_t)
@@ -917,7 +917,7 @@ typedef struct ioc_fm_port_vsp_alloc_par
  @Cautions      Allowed only following FM_PORT_Init(), and before FM_PORT_SetPCD()
                 and also before FM_PORT_Enable() (i.e. the port should be disabled).
 *//***************************************************************************/
-#if defined(CONFIG_COMPAT)
+#if defined(FM_COMPAT)
 #define FM_PORT_IOC_VSP_ALLOC_COMPAT _IOW(FM_IOC_TYPE_BASE, FM_PORT_IOC_NUM(38), ioc_compat_fm_port_vsp_alloc_params_t)
 #endif
 #define FM_PORT_IOC_VSP_ALLOC _IOW(FM_IOC_TYPE_BASE, FM_PORT_IOC_NUM(38), ioc_fm_port_vsp_alloc_params_t)
--- a/include/uapi/linux/fmd/Peripherals/fm_test_ioctls.h
+++ b/include/uapi/linux/fmd/Peripherals/fm_test_ioctls.h
@@ -90,7 +90,7 @@ typedef struct ioc_fmt_buff_context_t {
     uint8_t         fm_time_stamp[FM_TIME_STAMP_MAX];
 } ioc_fmt_buff_context_t;
 
-#if defined(__KERNEL__) && defined(CONFIG_COMPAT)
+#if defined(__KERNEL__) && defined(FM_COMPAT)
 typedef struct ioc_fmt_compat_buff_context_t {
     compat_uptr_t         p_user_priv;
     uint8_t               fm_prs_res[FM_PRS_MAX];
@@ -109,7 +109,7 @@ typedef struct ioc_fmt_buff_desc_t {
     ioc_fmt_buff_context_t buff_context;
 } ioc_fmt_buff_desc_t;
 
-#if defined(__KERNEL__) && defined(CONFIG_COMPAT)
+#if defined(__KERNEL__) && defined(FM_COMPAT)
 typedef struct ioc_fmt_compat_buff_desc_t {
     uint32_t                qid;
     compat_uptr_t           p_data;