be2net: backport fixes for RHEL 7.2
[~emulex/tmp/compat-rdma/.git] / configure
1 #!/bin/bash
2 #
3 # Copyright (c) 2006 Mellanox Technologies. All rights reserved.
4 #
5 # This Software is licensed under one of the following licenses:
6 #
7 # 1) under the terms of the "Common Public License 1.0" a copy of which is
8 #    available from the Open Source Initiative, see
9 #    http://www.opensource.org/licenses/cpl.php.
10 #
11 # 2) under the terms of the "The BSD License" a copy of which is
12 #    available from the Open Source Initiative, see
13 #    http://www.opensource.org/licenses/bsd-license.php.
14 #
15 # 3) under the terms of the "GNU General Public License (GPL) Version 2" a
16 #    copy of which is available from the Open Source Initiative, see
17 #    http://www.opensource.org/licenses/gpl-license.php.
18 #
19 # Licensee has the right to choose one of the above licenses.
20 #
21 # Redistributions of source code must retain the above copyright
22 # notice and one of the license notices.
23 #
24 # Redistributions in binary form must reproduce both the above copyright
25 # notice, one of the license notices in the documentation
26 # and/or other materials provided with the distribution.
27 #
28 #  $Id: configure 9097 2006-08-24 06:39:09Z vlad $
29 #
30
31 usage()
32 {
33 cat << EOF
34 \`configure' configures variables for kernel modules compilation
35
36 Usage:  `basename $0` [options]
37
38     --prefix=PREFIX  for userspace components []
39     --build_root=BUILD_ROOT  root directory to build RPM packages
40     --kernel-version=VERSION  make for this kernel [$(uname -r)]
41     --modules-dir=DIR  modules directory [/lib/modules/$(uname -r)]
42     --kernel-sources=DIR  make for this kernel [/lib/modules/$(uname -r)/source]
43     --with-linux=DIR  kernel sources directory [/lib/modules/$(uname -r)/source]
44     --with-linux-obj=DIR  kernel obj directory [/lib/modules/$(uname -r)/build]
45     --skip-autoconf
46
47     Kernel modules configuration:
48
49     --with-core-mod    make CONFIG_INFINIBAND=m [no]
50     --without-core-mod   [yes]
51
52     --with-ipoib-mod    make CONFIG_INFINIBAND_IPOIB=m [no]
53     --without-ipoib-mod   [yes]
54
55     --with-ipoib-cm    make CONFIG_INFINIBAND_IPOIB_CM=y [yes]
56     --without-ipoib-cm   [no]
57
58     --with-ipoib_debug-mod    make CONFIG_INFINIBAND_IPOIB_DEBUG=y [yes]
59     --without-ipoib_debug-mod    [no]
60
61     --with-ipoib_debug_data-mod    make CONFIG_INFINIBAND_IPOIB_DEBUG_DATA=y [no]
62     --without-ipoib_debug_data-mod    [yes]
63
64     --with-sdp-mod    make CONFIG_INFINIBAND_SDP=m [no]
65     --without-sdp-mod    [yes]
66
67     --with-sdp_debug-mod    make CONFIG_INFINIBAND_SDP_DEBUG=y [yes]
68     --without-sdp_debug-mod   [no]
69
70     --with-sdp_debug_data-mod    make CONFIG_INFINIBAND_SDP_DEBUG_DATA=y [no]
71     --without-sdp_debug_data-mod    [yes]
72
73     --with-srp-mod    make CONFIG_INFINIBAND_SRP=m [no]
74     --without-srp-mod    [yes]
75
76     --with-srp-target-mod    make CONFIG_INFINIBAND_SRPT=m [no]
77     --without-srp-target-mod    [yes]
78
79     --with-user_mad-mod    make CONFIG_INFINIBAND_USER_MAD=m [no]
80     --without-user_mad-mod    [yes]
81
82     --with-user_access-mod    make CONFIG_INFINIBAND_USER_ACCESS=m [no]
83     --without-user_access-mod    [yes]
84
85     --with-addr_trans-mod    make CONFIG_INFINIBAND_ADDR_TRANS=y [no]
86     --without-addr_trans-mod    [yes]
87
88     --with-mthca-mod    make CONFIG_INFINIBAND_MTHCA=m [no]
89     --without-mthca-mod    [yes]
90
91     --with-mthca_debug-mod    make CONFIG_INFINIBAND_MTHCA_DEBUG=y [yes]
92     --without-mthca_debug-mod    [no]
93
94     --with-mlx4-mod         make CONFIG_MLX4_CORE=y CONFIG_MLX4_INFINIBAND=y [no]
95     --without-mlx4-mod      [yes]
96
97     --with-mlx5-mod         make CONFIG_MLX5_CORE=y CONFIG_MLX5_INFINIBAND=y [no]
98     --without-mlx5-mod      [yes]
99
100     --with-mlx4_core-mod         make CONFIG_MLX4_CORE=y [no]
101     --without-mlx4_core-mod      [yes]
102
103     --with-mlx5_core-mod         make CONFIG_MLX5_CORE=y [no]
104     --without-mlx5_core-mod      [yes]
105
106     --with-mlx4_en-mod         make CONFIG_MLX4_EN=y [no]
107     --without-mlx4_en-mod      [yes]
108
109     --with-mlx4_inf-mod         make CONFIG_MLX4_INFINIBAND=y [no]
110     --without-mlx4_inf-mod      [yes]
111
112     --with-mlx5_inf-mod         make CONFIG_MLX5_INFINIBAND=y [no]
113     --without-mlx5_inf-mod      [yes]
114
115     --with-mlx4_debug-mod         make CONFIG_MLX4_DEBUG=y [yes]
116     --without-mlx4_debug-mod      [no]
117
118     --with-mlx5_debug-mod         make CONFIG_MLX5_DEBUG=y [yes]
119     --without-mlx5_debug-mod      [no]
120
121     --with-ibscif-mod    make CONFIG_INFINIBAND_SCIF=m [no]
122     --without-ibscif-mod    [yes]
123
124     --with-ibp-server-mod    make CONFIG_IBP_SERVER=m [no]
125     --without-ibp-server-mod    [yes]
126
127     --with-ibp-debug-mod    make CONFIG_IBP_DEBUG=y [no]
128     --without-ibp-debug-mod    [yes]
129
130     --with-ipath_inf-mod    make CONFIG_INFINIBAND_IPATH=m [no]
131     --without-ipath_inf-mod    [yes]
132
133     --with-qib-mod    make CONFIG_INFINIBAND_QIB=m [no]
134     --without-qib-mod    [yes]
135
136     --with-iser-mod    make CONFIG_INFINIBAND_ISER=m [no]
137     --without-iser-mod    [yes]
138
139     --with-isert-mod    make CONFIG_INFINIBAND_ISERT=m [no]
140     --without-isert-mod    [yes]
141
142     --with-ehca-mod    make CONFIG_INFINIBAND_EHCA=m [no]
143     --without-ehca-mod    [yes]
144
145     --with-rds-mod    make CONFIG_RDS=m [no]
146     --without-rds-mod   [no]
147
148     --with-rds_debug-mod    make CONFIG_RDS_DEBUG=y [no]
149     --without-rds_debug-mod    [yes]
150
151     --with-madeye-mod   make CONFIG_INFINIBAND_MADEYE=m [no]
152     --without-madeye-mod    [yes]
153
154     --with-qlgc_vnic-mod    make CONFIG_INFINIBAND_QLGC_VNIC=m [no]
155     --without-qlgc_vnic-mod    [yes]
156
157     --with-qlgc_vnic_stats-mod    make CONFIG_INFINIBAND_QLGC_VNIC_STATS=y [no]
158     --without-qlgc_vnic_stats-mod    [yes]
159
160     --with-cxgb3-mod    make CONFIG_INFINIBAND_CXGB3=m [no]
161     --without-cxgb3-mod    [yes]
162
163     --with-cxgb3_debug-mod    make CONFIG_INFINIBAND_CXGB3_DEBUG=y [no]
164     --without-cxgb3_debug-mod    [yes]
165
166     --with-cxgb4-mod    make CONFIG_INFINIBAND_CXGB4=m [no]
167     --without-cxgb4-mod    [yes]
168
169     --with-nes-mod    make CONFIG_INFINIBAND_NES=m [no]
170     --without-nes-mod    [yes]
171
172     --with-ocrdma-mod    make CONFIG_INFINIBAND_OCRDMA=m [no]
173     --without-ocrdma-mod    [yes]
174     
175     --with-be2net-mod    make CONFIG_BE2NET=m [no]
176     --without-be2net-mod    [yes]
177
178     --with-nes_debug-mod    make CONFIG_INFINIBAND_NES_DEBUG=y [no]
179     --without-nes_debug-mod    [yes]
180
181     --with-memtrack  enable momory tracking [no]
182     --without-memtrack disable memory tracking [yes]
183
184     --with-debug-info  make CONFIG_DEBUG_INFO=y [yes]
185     --without-debug-info [no]
186
187     --with-nfsrdma-mod    make CONFIG_SUNRPC_XPRT_RDMA=m [no]
188     --without-nfsrdma-mod    [yes]
189
190     --help - print out options
191
192
193 EOF
194
195 #   Currently not supported options
196 #    --with-sdp-zcopy  make CONFIG_INFINIBAND_SDP_SEND_ZCOPY=y CONFIG_INFINIBAND_SDP_RECV_ZCOPY=y [no]
197 #    --without-sdp-zcopy [yes]
198 }
199
200 # Execute command w/ echo and exit if it fail
201 ex()
202 {
203         echo "$@"
204         if ! "$@"; then
205                 printf "\nFailed executing $@\n\n"
206                 exit 1
207         fi
208 }
209
210 # Compare 2 kernel versions
211 check_kerver()
212 {
213         local kver=$1
214         local min_kver=$2
215         shift 2
216
217         kver_a=$(echo -n ${kver} | cut -d '.' -f 1)
218         kver_b=$(echo -n ${kver} | cut -d '.' -f 2)
219         kver_c=$(echo -n ${kver} | cut -d '.' -f 3 | cut -d '-' -f 1 | tr -d [:alpha:][:punct:])
220
221         min_kver_a=$(echo -n ${min_kver} | cut -d '.' -f 1)
222         min_kver_b=$(echo -n ${min_kver} | cut -d '.' -f 2)
223         min_kver_c=$(echo -n ${min_kver} | cut -d '.' -f 3 | cut -d '-' -f 1 | tr -d [:alpha:][:punct:])
224
225         if [ ${kver_a} -lt ${min_kver_a} ] ||
226                 [[ ${kver_a} -eq ${min_kver_a} && ${kver_b} -lt ${min_kver_b} ]] ||
227                 [[ ${kver_a} -eq ${min_kver_a} && ${kver_b} -eq ${min_kver_b} && ${kver_c} -lt ${min_kver_c} ]]; then
228                 return 1
229         fi
230
231         return 0
232 }
233
234 function check_autofconf {
235         VAR=$1
236         VALUE=$(tac ${KSRC_OBJ}/include/*/autoconf.h | grep -m1 ${VAR} | sed -ne 's/.*\([01]\)$/\1/gp')
237
238         eval "export $VAR=$VALUE"
239 }
240
241 function add_conf {
242     COMMENT=$1
243     PARAM=${2%=*}
244     VALUE=${2#*=}
245     OICONF=${PWD}/ofed_scripts/openib.conf.tmp
246
247     touch $OICONF
248     if ! (grep -wq "^$PARAM" $OICONF > /dev/null 2>&1); then
249         echo >> "${OICONF}"
250         echo "${COMMENT}" >> "${OICONF}"
251         echo "${PARAM}=${VALUE}" >> "${OICONF}"
252     fi
253 }
254
255 main()
256 {
257         ofed_patch_params=
258         # Parsing parameters
259         while [ ! -z "$1" ]
260         do
261                 case $1 in
262                         -prefix | --prefix | --prefi | --pref | --pre | --pr | --p | -p)
263                                 shift
264                                 prefix=$1
265                                 PREFIX="--prefix ${prefix}"
266                         ;;
267                         -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=* | -p=*)
268                                 prefix=`expr "x$1" : 'x[^=]*=\(.*\)'`
269                                 PREFIX="--prefix ${prefix}"
270                         ;;
271                         -kernel-version | --kernel-version | --kern-ver | --ker-ver)
272                                 ofed_patch_params="$ofed_patch_params $1"
273                                 shift
274                                 ofed_patch_params="$ofed_patch_params $1"
275                                 KVERSION=$1
276                         ;;
277                         -kernel-version=* | --kernel-version=* | --kern-ver=* | --ker-ver=*)
278                                 ofed_patch_params="$ofed_patch_params $1"
279                                 KVERSION=`expr "x$1" : 'x[^=]*=\(.*\)'`
280                         ;;
281                         -modules-dir | --modules-dir | --mod-dir)
282                                 shift
283                                 MODULES_DIR=$1
284                         ;;
285                         -modules-dir=* | --modules-dir=* | --mod-dir=*)
286                                 MODULES_DIR=`expr "x$1" : 'x[^=]*=\(.*\)'`
287                         ;;
288                         --skip-autoconf)
289                         SKIP_AUTOCONF=1
290                         ;;
291                         --force-autogen)
292                         FORCE_AUTOGEN=1
293                         ;;
294                         -kernel-sources | --kernel-sources | --kernel-src | --kern-src | --ker-src)
295                                 shift
296                                 KSRC=$1
297                         ;;
298                         -kernel-sources=* | --kernel-sources=* | --kernel-src=* | --kern-src=* | --ker-src=*)
299                                 KSRC=`expr "x$1" : 'x[^=]*=\(.*\)'`
300                         ;;
301                         --with-linux)
302                                 shift
303                                 KSRC=$1
304                         ;;
305                         --with-linux=*)
306                                 KSRC=`expr "x$1" : 'x[^=]*=\(.*\)'`
307                         ;;
308                         --with-linux-obj)
309                                 shift
310                                 KSRC_OBJ=$1
311                         ;;
312                         --with-linux-obj=*)
313                                 KSRC_OBJ=`expr "x$1" : 'x[^=]*=\(.*\)'`
314                         ;;
315                         -with-quilt | --with-quilt)
316                                 ofed_patch_params="$ofed_patch_params $1"
317                                 if [ ! -z "$2" ] && [ "`echo -n $2 | cut -c 1`" != '-' ]; then
318                                         shift
319                                         ofed_patch_params="$ofed_patch_params $1"
320                                 fi
321                         ;;
322                         -with-quilt=* | --with-quilt=*)
323                                 ofed_patch_params="$ofed_patch_params $1"
324                         ;;
325                         --without-quilt)
326                                 ofed_patch_params="$ofed_patch_params $1"
327                         ;;
328                         -with-patchdir | --with-patchdir)
329                                 ofed_patch_params="$ofed_patch_params $1"
330                                 shift
331                                 ofed_patch_params="$ofed_patch_params $1"
332                         ;;
333                         -with-patchdir=* | --with-patchdir=*)
334                                 ofed_patch_params="$ofed_patch_params $1"
335                         ;;
336                         --without-patch)
337                                 ofed_patch_params="$ofed_patch_params $1"
338                         ;;
339                         --with-kernel-fixes)
340                                 ofed_patch_params="$ofed_patch_params $1"
341                         ;;
342                         --without-kernel-fixes)
343                                 ofed_patch_params="$ofed_patch_params $1"
344                         ;;
345                         --with-hpage-patch)
346                                 ofed_patch_params="$ofed_patch_params $1"
347                         ;;
348                         --without-hpage-patch)
349                                 ofed_patch_params="$ofed_patch_params $1"
350                         ;;
351                         --with-backport-patches)
352                                 ofed_patch_params="$ofed_patch_params $1"
353                         ;;
354                         --without-backport-patches)
355                                 ofed_patch_params="$ofed_patch_params $1"
356                         ;;
357                         --with-memtrack)
358                             CONFIG_MEMTRACK="m"
359                         ;;
360                         --without-memtrack)
361                             CONFIG_MEMTRACK=
362                         ;;
363                         --with-debug-info)
364                             CONFIG_DEBUG_INFO="y"
365                         ;;
366                         --without-debug-info)
367                             CONFIG_DEBUG_INFO=
368                         ;;
369                         --with-core-mod)
370                             CONFIG_INFINIBAND="m"
371                         ;;
372                         --without-core-mod)
373                             CONFIG_INFINIBAND=
374                         ;;
375                         --with-ipoib-mod)
376                             CONFIG_INFINIBAND_IPOIB="m"
377                             CONFIG_INFINIBAND_IPOIB_CM="y"
378                             CONFIG_INFINIBAND_IPOIB_DEBUG="y"
379                             add_conf "# Load IPoIB" "IPOIB_LOAD=yes"
380                             add_conf "# Enable IPoIB Connected Mode" "SET_IPOIB_CM=yes"
381                         ;;
382                         --without-ipoib-mod)
383                             CONFIG_INFINIBAND_IPOIB=
384                         ;;
385                         --with-ipoib-cm)
386                             CONFIG_INFINIBAND_IPOIB_CM="y"
387                         ;;
388                         --without-ipoib-cm)
389                             CONFIG_INFINIBAND_IPOIB_CM=
390                         ;;
391                         --with-ipoib_debug-mod)
392                             CONFIG_INFINIBAND_IPOIB_DEBUG="y"
393                         ;;
394                         --without-ipoib_debug-mod)
395                             CONFIG_INFINIBAND_IPOIB_DEBUG=
396                         ;;
397                         --with-ipoib_debug_data-mod)
398                             CONFIG_INFINIBAND_IPOIB_DEBUG_DATA="y"
399                         ;;
400                         --without-ipoib_debug_data-mod)
401                             CONFIG_INFINIBAND_IPOIB_DEBUG_DATA=
402                         ;;
403                         --with-sdp-mod)
404                             CONFIG_INFINIBAND_SDP="m"
405                             CONFIG_INFINIBAND_SDP_DEBUG="y"
406                             add_conf "# Load SDP module" "SDP_LOAD=yes"
407                         ;;
408                         --without-sdp-mod)
409                             CONFIG_INFINIBAND_SDP=
410                         ;;
411                         --with-sdp-zcopy)
412                             CONFIG_INFINIBAND_SDP_SEND_ZCOPY="y"
413                             CONFIG_INFINIBAND_SDP_RECV_ZCOPY="y"
414                         ;;
415                         --without-sdp-zcopy)
416                             CONFIG_INFINIBAND_SDP_SEND_ZCOPY=
417                             CONFIG_INFINIBAND_SDP_RECV_ZCOPY=
418                         ;;
419                         --with-sdp_debug-mod)
420                             CONFIG_INFINIBAND_SDP_DEBUG="y"
421                         ;;
422                         --without-sdp_debug-mod)
423                             CONFIG_INFINIBAND_SDP_DEBUG=
424                         ;;
425                         --with-sdp_debug_data-mod)
426                             CONFIG_INFINIBAND_SDP_DEBUG_DATA="y"
427                         ;;
428                         --without-sdp_debug_data-mod)
429                             CONFIG_INFINIBAND_SDP_DEBUG_DATA=
430                         ;;
431                         --with-srp-mod)
432                             CONFIG_INFINIBAND_SRP="m"
433                             CONFIG_SCSI_SRP_ATTRS="m"
434                             add_conf "# Load SRP module" "SRP_LOAD=no"
435                         ;;
436                         --without-srp-mod)
437                             CONFIG_INFINIBAND_SRP=
438                             CONFIG_SCSI_SRP_ATTRS=
439                         ;;
440                         --with-srp-target-mod)
441                             CONFIG_INFINIBAND_SRPT="m"
442                             add_conf "# Load SRP Target module" "SRPT_LOAD=no"
443                         ;;
444                         --without-srp-target-mod)
445                             CONFIG_INFINIBAND_SRPT=
446                         ;;
447                         --with-user_mad-mod)
448                             CONFIG_INFINIBAND_USER_MAD="m"
449                         ;;
450                         --without-user_mad-mod)
451                             CONFIG_INFINIBAND_USER_MAD=
452                         ;;
453                         --with-user_access-mod)
454                             CONFIG_INFINIBAND_USER_ACCESS="m"
455                             CONFIG_INFINIBAND_USER_MEM=y
456                         ;;
457                         --without-user_access-mod)
458                             CONFIG_INFINIBAND_USER_ACCESS=
459                             CONFIG_INFINIBAND_USER_MEM=
460                         ;;
461                         --with-addr_trans-mod)
462                             CONFIG_INFINIBAND_ADDR_TRANS=y
463                         ;;
464                         --without-addr_trans-mod)
465                             CONFIG_INFINIBAND_ADDR_TRANS=
466                         ;;
467                         --with-mthca-mod)
468                             CONFIG_INFINIBAND_MTHCA="m"
469                             CONFIG_INFINIBAND_MTHCA_DEBUG="y"
470                             add_conf "# Load MTHCA" "MTHCA_LOAD=yes"
471                         ;;
472                         --without-mthca-mod)
473                             CONFIG_INFINIBAND_MTHCA=
474                         ;;
475                         --with-mthca_debug-mod)
476                             CONFIG_INFINIBAND_MTHCA_DEBUG="y"
477                         ;;
478                         --without-mthca_debug-mod)
479                             CONFIG_INFINIBAND_MTHCA_DEBUG=
480                         ;;
481                         --with-mlx4-mod)
482                             CONFIG_MLX4_CORE="m"
483                             CONFIG_MLX4_INFINIBAND="m"
484                             CONFIG_MLX4_DEBUG="y"
485                             add_conf "# Load MLX4 modules" "MLX4_LOAD=yes"
486                         ;;
487                         --with-mlx5-mod)
488                             CONFIG_MLX5_CORE="m"
489                             CONFIG_MLX5_INFINIBAND="m"
490                             CONFIG_BACKPORT_LRO="m"
491                             CONFIG_MLX5_DEBUG="y"
492                             add_conf "# Load MLX5 modules" "MLX5_LOAD=yes"
493                         ;;
494                         --with-mlx4_core-mod)
495                             CONFIG_MLX4_CORE="m"
496                         ;;
497                         --without-mlx4_core-mod)
498                             CONFIG_MLX4_CORE=
499                         ;;
500                         --with-mlx5_core-mod)
501                             CONFIG_MLX5_CORE="m"
502                         ;;
503                         --without-mlx5_core-mod)
504                             CONFIG_MLX5_CORE=
505                         ;;
506                         --without-mlx4-mod)
507                             CONFIG_MLX4_CORE=
508                             CONFIG_MLX4_INFINIBAND=
509                             CONFIG_MLX4_DEBUG=
510                         ;;
511                         --without-mlx5-mod)
512                             CONFIG_MLX5_CORE=
513                             CONFIG_MLX5_INFINIBAND=
514                             CONFIG_MLX5_DEBUG=
515                         ;;
516                         --with-mlx4_en-mod)
517                             CONFIG_MLX4_CORE="m"
518                             CONFIG_MLX4_EN="m"
519                             add_conf "# Load MLX4_EN module" "MLX4_EN_LOAD=yes"
520                         ;;
521                         --without-mlx4_en-mod)
522                             CONFIG_MLX4_EN=
523                         ;;
524                         --with-mlx4_inf-mod)
525                             CONFIG_MLX4_CORE="m"
526                             CONFIG_MLX4_INFINIBAND="m"
527                         ;;
528                         --without-mlx4_inf-mod)
529                             CONFIG_MLX4_INFINIBAND=
530                         ;;
531                         --with-mlx5_inf-mod)
532                             CONFIG_MLX5_CORE="m"
533                             CONFIG_MLX5_INFINIBAND="m"
534                         ;;
535                         --without-mlx5_inf-mod)
536                             CONFIG_MLX5_INFINIBAND=
537                         ;;
538                         --with-mlx4_debug-mod)
539                             CONFIG_MLX4_DEBUG="y"
540                         ;;
541                         --without-mlx4_debug-mod)
542                             CONFIG_MLX4_DEBUG=
543                         ;;
544                         --with-mlx5_debug-mod)
545                             CONFIG_MLX5_DEBUG="y"
546                         ;;
547                         --without-mlx5_debug-mod)
548                             CONFIG_MLX5_DEBUG=
549                         ;;
550                         --with-ibscif-mod)
551                             CONFIG_INFINIBAND_SCIF="m"
552                         ;;
553                         --with-ibp-server-mod)
554                             CONFIG_IBP_SERVER="m"
555                         ;;
556                         --with-ibp-debug-mod)
557                             CONFIG_IBP_DEBUG="y"
558                         ;;
559                         --with-ipath_inf-mod)
560                             CONFIG_INFINIBAND_IPATH="m"
561                             add_conf "# Load IPATH" "IPATH_LOAD=yes"
562                         ;;
563                         --without-ipath_inf-mod)
564                             CONFIG_INFINIBAND_IPATH=
565                         ;;
566                         --with-qib-mod)
567                             CONFIG_INFINIBAND_QIB="m"
568                             add_conf "# Load QIB" "QIB_LOAD=yes"
569                             add_conf "# QIB QME BP VER" "QIB_QME_BPVER=1"
570                         ;;
571                         --without-qib-mod)
572                             CONFIG_INFINIBAND_QIB=
573                         ;;
574                         --with-iser-mod)
575                             CONFIG_INFINIBAND_ISER="m"
576                             add_conf "# Load ISER module" "ISER_LOAD=no"
577                         ;;
578                         --without-isert-mod)
579                             CONFIG_INFINIBAND_ISERT=
580                         ;;
581                         --with-iscsi-mod)
582                             CONFIG_SCSI_ISCSI_ATTRS="m"
583                             CONFIG_ISCSI_TCP="m"
584                         ;;
585                         --without-iser-mod)
586                             CONFIG_INFINIBAND_ISER=
587                             CONFIG_SCSI_ISCSI_ATTRS=
588                             CONFIG_ISCSI_TCP=
589                         ;;
590                         --with-ehca-mod)
591                             CONFIG_INFINIBAND_EHCA="m"
592                             CONFIG_INFINIBAND_EHCA_SCALING="y"
593                             add_conf "$ Load eHCA" "EHCA_LAOD=yes"
594                         ;;
595                         --without-ehca-mod)
596                             CONFIG_INFINIBAND_EHCA=
597                             CONFIG_INFINIBAND_EHCA_SCALING=
598                         ;;
599                         --with-rds-mod)
600                             CONFIG_RDS="m"
601                             CONFIG_RDS_RDMA="m"
602                             CONFIG_RDS_TCP="m"
603                             add_conf "# Load RDS module" "RDS_LOAD=no"
604                         ;;
605                         --without-rds-mod)
606                             CONFIG_RDS=
607                             CONFIG_RDS_RDMA=
608                             CONFIG_RDS_TCP=
609                         ;;
610                         --with-rds_debug-mod)
611                             CONFIG_RDS_DEBUG="y"
612                         ;;
613                         --without-rds_debug-mod)
614                             CONFIG_RDS_DEBUG=
615                         ;;
616                         --with-madeye-mod)
617                             CONFIG_INFINIBAND_MADEYE=m
618                         ;;
619                         --without-madeye-mod)
620                             CONFIG_INFINIBAND_MADEYE=
621                         ;;
622                         --with-qlgc_vnic-mod)
623                             CONFIG_INFINIBAND_QLGC_VNIC="m"
624                             add_conf "# Load QLogic VNIC module" "QLGC_VNIC_LOAD=yes"
625                         ;;
626                         --without-qlgc_vnic-mod)
627                             CONFIG_INFINIBAND_QLGC_VNIC=
628                         ;;
629                         --with-qlgc_vnic_stats-mod)
630                             CONFIG_INFINIBAND_QLGC_VNIC_STATS="y"
631                         ;;
632                         --without-qlgc_vnic_stats-mod)
633                             CONFIG_INFINIBAND_QLGC_VNIC_STATS=
634                         ;;
635                         --with-cxgb3-mod)
636                             CONFIG_INFINIBAND_CXGB3="m"
637                             CONFIG_CHELSIO_T3="m"
638                             add_conf "# Load CXGB3 modules" "CXGB3_LOAD=yes"
639                         ;;
640                         --without-cxgb3-mod)
641                             CONFIG_INFINIBAND_CXGB3=
642                             CONFIG_CHELSIO_T3=
643                         ;;
644                         --with-cxgb3_debug-mod)
645                             CONFIG_INFINIBAND_CXGB3_DEBUG="y"
646                         ;;
647                         --without-cxgb3_debug-mod)
648                             CONFIG_INFINIBAND_CXGB3_DEBUG=
649                         ;;
650                         --with-cxgb4-mod)
651                             CONFIG_INFINIBAND_CXGB4="m"
652                             CONFIG_CHELSIO_T4="m"
653                             add_conf "# Load CXGB4 modules" "CXGB4_LOAD=yes"
654                         ;;
655                         --without-cxgb4-mod)
656                             CONFIG_INFINIBAND_CXGB4=
657                             CONFIG_CHELSIO_T4=
658                         ;;
659                         --with-cxgb3i-mod)
660                             CONFIG_SCSI_CXGB3_ISCSI="m"
661                         ;;
662                         --without-cxgb3i-mod)
663                             CONFIG_SCSI_CXGB3_ISCSI=
664                         ;;
665                         --with-cxgb4i-mod)
666                             CONFIG_SCSI_CXGB4_ISCSI="m"
667                         ;;
668                         --without-cxgb4i-mod)
669                             CONFIG_SCSI_CXGB4_ISCSI=
670                         ;;
671                         --with-nes-mod)
672                             CONFIG_INFINIBAND_NES="m"
673                             add_conf "# Load NES modules" "NES_LOAD=yes"
674                         ;;
675                         --without-nes-mod)
676                             CONFIG_INFINIBAND_NES=
677                         ;;
678                         --with-nes_debug-mod)
679                             CONFIG_INFINIBAND_NES_DEBUG="y"
680                         ;;
681                         --without-nes_debug-mod)
682                             CONFIG_INFINIBAND_NES_DEBUG=
683                         ;;
684                         --with-ocrdma-mod)
685                             CONFIG_INFINIBAND_OCRDMA="m"
686                             CONFIG_BE2NET="m"
687                             add_conf "# Load OCRDMA modules" "OCRDMA_LOAD=yes"
688                         ;;
689                         --without-ocrdma-mod)
690                             CONFIG_INFINIBAND_OCRDMA=
691                         ;;
692                         --with-be2net-mod)
693                             CONFIG_BE2NET="m"
694                         ;;
695                         --without-be2net-mod)
696                             CONFIG_BE2NET=
697                         ;;
698                         --with-nfsrdma-mod)
699                             CONFIG_SUNRPC_XPRT_RDMA="m"
700                             CONFIG_SUNRPC_XPRT_RDMA_CLIENT="m"
701                             CONFIG_SUNRPC_XPRT_RDMA_SERVER="m"
702                         ;;
703                         --without-nfsrdma-mod)
704                             CONFIG_SUNRPC_XPRT_RDMA=
705                             CONFIG_SUNRPC_XPRT_RDMA_CLIENT=
706                             CONFIG_SUNRPC_XPRT_RDMA_SERVER=
707                         ;;
708                         -h | --help)
709                                 usage
710                                 exit 0
711                         ;;
712                         --with*)
713                                 echo
714                                 echo "Unsupported or unused parameter: $1"
715                                 echo
716                         ;;
717                         *)
718                                 echo
719                                 echo "Unsupported parameter $1"
720                                 echo
721                         ;;
722                 esac
723                 shift
724
725         done
726
727 #Set default values
728 KVERSION=${KVERSION:-$(uname -r)}
729 MIN_KVERSION="2.6.5"
730 MODULES_DIR=${MODULES_DIR:-/lib/modules/${KVERSION}/updates}
731 KSRC=${KSRC:-/lib/modules/${KVERSION}/source}
732 KSRC_OBJ=${KSRC_OBJ:-/lib/modules/$KVERSION/build}
733
734 ARCH=${ARCH:-$(uname -m)}
735
736 case $ARCH in
737         ppc*)
738         ARCH=powerpc
739         ;;
740         i?86)
741         ARCH=i386
742         ;;
743 esac
744
745 # Additional parameters to be passed to configure command
746 CWD=$(pwd)
747 CONFIG="configure.mk.kernel"
748
749
750 if (/bin/ls -1 $KSRC/include/*/autoconf.h 2>/dev/null | head -1 | grep -q generated); then
751     AUTOCONF_PREFIX=generated
752 else
753     AUTOCONF_PREFIX=linux
754 fi
755 mkdir -p ${CWD}/include/${AUTOCONF_PREFIX}
756 AUTOCONF_H="${CWD}/include/${AUTOCONF_PREFIX}/autoconf.h"
757
758 # disable unsupported modules on 32bit
759 if [ $ARCH != "x86_64" ]; then
760     CONFIG_INFINIBAND_IPATH=
761     CONFIG_INFINIBAND_QIB=
762 fi
763
764 SKIP_AUTOCONF=${SKIP_AUTOCONF:-0}
765 FORCE_AUTOGEN=${FORCE_AUTOGEN:-0}
766 CONFIG_MEMTRACK=${CONFIG_MEMTRACK:-''}
767 CONFIG_DEBUG_INFO=${CONFIG_DEBUG_INFO:-'y'}
768 CONFIG_INFINIBAND=${CONFIG_INFINIBAND:-''}
769 CONFIG_INFINIBAND_IPOIB=${CONFIG_INFINIBAND_IPOIB:-''}
770 CONFIG_INFINIBAND_IPOIB_CM=${CONFIG_INFINIBAND_IPOIB_CM:-''}
771 CONFIG_INFINIBAND_SDP=${CONFIG_INFINIBAND_SDP:-''}
772 CONFIG_INFINIBAND_SRP=${CONFIG_INFINIBAND_SRP:-''}
773 CONFIG_SCSI_SRP_ATTRS=${CONFIG_SCSI_SRP_ATTRS:-''}
774 CONFIG_INFINIBAND_SRPT=${CONFIG_INFINIBAND_SRPT:-''}
775
776 CONFIG_INFINIBAND_USER_MAD=${CONFIG_INFINIBAND_USER_MAD:-''}
777 CONFIG_INFINIBAND_USER_ACCESS=${CONFIG_INFINIBAND_USER_ACCESS:-''}
778 CONFIG_INFINIBAND_ADDR_TRANS=${CONFIG_INFINIBAND_ADDR_TRANS:-''}
779 CONFIG_INFINIBAND_USER_MEM=${CONFIG_INFINIBAND_USER_MEM:-''}
780 CONFIG_INFINIBAND_MTHCA=${CONFIG_INFINIBAND_MTHCA:-''}
781
782 CONFIG_MLX4_CORE=${CONFIG_MLX4_CORE:-''}
783 CONFIG_MLX5_CORE=${CONFIG_MLX5_CORE:-''}
784 CONFIG_MLX4_EN=${CONFIG_MLX4_EN:-''}
785 CONFIG_MLX4_VNIC=${CONFIG_MLX4_VNIC:-''}
786 CONFIG_MLX4_INFINIBAND=${CONFIG_MLX4_INFINIBAND:-''}
787 CONFIG_MLX5_INFINIBAND=${CONFIG_MLX5_INFINIBAND:-''}
788 CONFIG_MLX4_DEBUG=${CONFIG_MLX4_DEBUG:-''}
789 CONFIG_MLX5_DEBUG=${CONFIG_MLX4_DEBUG:-''}
790
791 CONFIG_IBP_SERVER=${CONFIG_IBP_SERVER:-''}
792 CONFIG_IBP_DEBUG=${CONFIG_IBP_DEBUG:-''}
793
794 CONFIG_INFINIBAND_SCIF=${CONFIG_INFINIBAND_SCIF:-''}
795
796 CONFIG_INFINIBAND_IPOIB_DEBUG=${CONFIG_INFINIBAND_IPOIB_DEBUG:-''}
797 CONFIG_INFINIBAND_ISER=${CONFIG_INFINIBAND_ISER:-''}
798 CONFIG_INFINIBAND_ISERT=${CONFIG_INFINIBAND_ISERT:-''}
799 CONFIG_SCSI_ISCSI_ATTRS=${CONFIG_SCSI_ISCSI_ATTRS:-''}
800 CONFIG_ISCSI_TCP=${CONFIG_ISCSI_TCP:-''}
801 CONFIG_INFINIBAND_EHCA=${CONFIG_INFINIBAND_EHCA:-''}
802 CONFIG_INFINIBAND_EHCA_SCALING=${CONFIG_INFINIBAND_EHCA_SCALING:-''}
803 CONFIG_RDS=${CONFIG_RDS:-''}
804 CONFIG_RDS_RDMA=${CONFIG_RDS_RDMA:-''}
805 CONFIG_RDS_TCP=${CONFIG_RDS_TCP:-''}
806 CONFIG_RDS_DEBUG=${CONFIG_RDS_DEBUG:-''}
807 CONFIG_INFINIBAND_MADEYE=${CONFIG_INFINIBAND_MADEYE:-''}
808 CONFIG_INFINIBAND_QLGC_VNIC=${CONFIG_INFINIBAND_QLGC_VNIC:-''}
809 CONFIG_INFINIBAND_CXGB3=${CONFIG_INFINIBAND_CXGB3:-''}
810 CONFIG_CHELSIO_T3=${CONFIG_CHELSIO_T3:-''}
811 CONFIG_INFINIBAND_CXGB4=${CONFIG_INFINIBAND_CXGB4:-''}
812 CONFIG_CHELSIO_T4=${CONFIG_CHELSIO_T4:-''}
813 CONFIG_SCSI_CXGB3_ISCSI=${CONFIG_SCSI_CXGB3_ISCSI:-''}
814 CONFIG_SCSI_CXGB4_ISCSI=${CONFIG_SCSI_CXGB4_ISCSI:-''}
815 CONFIG_INFINIBAND_NES=${CONFIG_INFINIBAND_NES:-''}
816 CONFIG_INFINIBAND_OCRDMA=${CONFIG_INFINIBAND_OCRDMA:-''}
817 CONFIG_BE2NET=${CONFIG_BE2NET:-''}
818
819 CONFIG_SUNRPC_XPRT_RDMA=${CONFIG_SUNRPC_XPRT_RDMA:-''}
820 CONFIG_SUNRPC_XPRT_RDMA_CLIENT=${CONFIG_SUNRPC_XPRT_RDMA_CLIENT:-''}
821 CONFIG_SUNRPC_XPRT_RDMA_SERVER=${CONFIG_SUNRPC_XPRT_RDMA_SERVER:-''}
822 CONFIG_SCSI_SRP_ATTRS=${CONFIG_SCSI_SRP_ATTRS:-''}
823 CONFIG_INFINIBAND_IPOIB_DEBUG_DATA=${CONFIG_INFINIBAND_IPOIB_DEBUG_DATA:-''}
824 CONFIG_INFINIBAND_SDP_SEND_ZCOPY=${CONFIG_INFINIBAND_SDP_SEND_ZCOPY:-''}
825 CONFIG_INFINIBAND_SDP_RECV_ZCOPY=${CONFIG_INFINIBAND_SDP_RECV_ZCOPY:-''}
826 CONFIG_INFINIBAND_SDP_DEBUG=${CONFIG_INFINIBAND_SDP_DEBUG:-''}
827 CONFIG_INFINIBAND_SDP_DEBUG_DATA=${CONFIG_INFINIBAND_SDP_DEBUG_DATA:-''}
828 CONFIG_INFINIBAND_IPATH=${CONFIG_INFINIBAND_IPATH:-''}
829 CONFIG_INFINIBAND_QIB=${CONFIG_INFINIBAND_QIB:-''}
830 CONFIG_INFINIBAND_MTHCA_DEBUG=${CONFIG_INFINIBAND_MTHCA_DEBUG:-''}
831 CONFIG_INFINIBAND_QLGC_VNIC_STATS=${CONFIG_INFINIBAND_QLGC_VNIC_STATS:-''}
832 CONFIG_INFINIBAND_CXGB3_DEBUG=${CONFIG_INFINIBAND_CXGB3_DEBUG:-''}
833 CONFIG_INFINIBAND_NES_DEBUG=${CONFIG_INFINIBAND_NES_DEBUG:-''}
834 CONFIG_INFINIBAND_AMSO1100=${CONFIG_INFINIBAND_AMSO1100:-''}
835 CONFIG_MLX4_EN_DCB=''
836 if [ "X${CONFIG_MLX4_EN}" == "Xm" ]; then
837     check_autofconf CONFIG_DCB
838     if [ X${CONFIG_DCB} == "X1" ]; then
839         CONFIG_MLX4_EN_DCB=y
840     fi
841 fi
842
843         # Check for minimal supported kernel version
844         if ! check_kerver ${KVERSION} ${MIN_KVERSION}; then
845                 echo "Kernel version ${KVERSION} is less then supported kernel ${MIN_KVERSION}. Exiting..."
846                 exit 1
847         fi
848
849         if [ ! -e .backports_applied ]; then
850                 echo ".backports_applied does not exist. running ofed_patch.sh"
851                 ex ${CWD}/ofed_scripts/ofed_patch.sh ${ofed_patch_params}
852         fi
853
854         if [[ ! -e .xeon_phi_applied && "X$CONFIG_IBP_SERVER" == "Xm" ]]; then
855                 echo ".xeon_phi_applied does not exist. running ofed-patch.sh for xeon-phi"
856                 ex ${CWD}/ofed_scripts/ofed_patch.sh --with-patchdir=tech-preview/xeon-phi
857                 touch .xeon_phi_applied
858         fi
859
860         # Create configure.mk
861         /bin/rm -f ${CWD}/${CONFIG}
862         cat >> ${CWD}/${CONFIG} << EOFCONFIG
863 # Current working directory
864 CWD=${CWD}
865
866 # Kernel level
867 KVERSION=${KVERSION}
868 ARCH=${ARCH}
869 MODULES_DIR=${MODULES_DIR}
870 KSRC=${KSRC}
871 KSRC_OBJ=${KSRC_OBJ}
872 KLIB_BUILD=${KSRC_OBJ}
873
874 AUTOCONF_H=${AUTOCONF_H}
875
876 WITH_MAKE_PARAMS=${WITH_MAKE_PARAMS}
877
878 CONFIG_MEMTRACK=${CONFIG_MEMTRACK}
879 CONFIG_DEBUG_INFO=${CONFIG_DEBUG_INFO}
880 CONFIG_INFINIBAND=${CONFIG_INFINIBAND}
881 CONFIG_INFINIBAND_IPOIB=${CONFIG_INFINIBAND_IPOIB}
882 CONFIG_INFINIBAND_IPOIB_CM=${CONFIG_INFINIBAND_IPOIB_CM}
883 CONFIG_INFINIBAND_SDP=${CONFIG_INFINIBAND_SDP}
884 CONFIG_INFINIBAND_SRP=${CONFIG_INFINIBAND_SRP}
885 CONFIG_SCSI_SRP_ATTRS=${CONFIG_SCSI_SRP_ATTRS}
886 CONFIG_INFINIBAND_SRPT=${CONFIG_INFINIBAND_SRPT}
887
888 CONFIG_INFINIBAND_USER_MAD=${CONFIG_INFINIBAND_USER_MAD}
889 CONFIG_INFINIBAND_USER_ACCESS=${CONFIG_INFINIBAND_USER_ACCESS}
890 CONFIG_INFINIBAND_ADDR_TRANS=${CONFIG_INFINIBAND_ADDR_TRANS}
891 CONFIG_INFINIBAND_USER_MEM=${CONFIG_INFINIBAND_USER_MEM}
892 CONFIG_INFINIBAND_MTHCA=${CONFIG_INFINIBAND_MTHCA}
893
894 CONFIG_MLX4_CORE=${CONFIG_MLX4_CORE}
895 CONFIG_MLX5_CORE=${CONFIG_MLX5_CORE}
896 CONFIG_MLX4_EN=${CONFIG_MLX4_EN}
897 CONFIG_MLX4_EN_DCB=${CONFIG_MLX4_EN_DCB}
898 CONFIG_MLX4_INFINIBAND=${CONFIG_MLX4_INFINIBAND}
899 CONFIG_MLX5_INFINIBAND=${CONFIG_MLX5_INFINIBAND}
900 CONFIG_MLX4_DEBUG=${CONFIG_MLX4_DEBUG}
901 CONFIG_MLX5_DEBUG=${CONFIG_MLX5_DEBUG}
902
903 CONFIG_IBP_SERVER=${CONFIG_IBP_SERVER}
904 CONFIG_IBP_DEBUG=${CONFIG_IBP_DEBUG}
905
906 CONFIG_INFINIBAND_SCIF=${CONFIG_INFINIBAND_SCIF}
907
908 CONFIG_INFINIBAND_IPOIB_DEBUG=${CONFIG_INFINIBAND_IPOIB_DEBUG}
909 CONFIG_INFINIBAND_ISERT=${CONFIG_INFINIBAND_ISERT}
910 CONFIG_INFINIBAND_ISER=${CONFIG_INFINIBAND_ISER}
911 CONFIG_SCSI_ISCSI_ATTRS=${CONFIG_SCSI_ISCSI_ATTRS}
912 CONFIG_ISCSI_TCP=${CONFIG_ISCSI_TCP}
913 CONFIG_INFINIBAND_EHCA=${CONFIG_INFINIBAND_EHCA}
914 CONFIG_INFINIBAND_EHCA_SCALING=${CONFIG_INFINIBAND_EHCA_SCALING}
915 CONFIG_RDS=${CONFIG_RDS}
916 CONFIG_RDS_RDMA=${CONFIG_RDS_RDMA}
917 CONFIG_RDS_TCP=${CONFIG_RDS_TCP}
918 CONFIG_RDS_DEBUG=${CONFIG_RDS_DEBUG}
919 CONFIG_INFINIBAND_MADEYE=${CONFIG_INFINIBAND_MADEYE}
920 CONFIG_INFINIBAND_QLGC_VNIC=${CONFIG_INFINIBAND_QLGC_VNIC}
921 CONFIG_INFINIBAND_CXGB3=${CONFIG_INFINIBAND_CXGB3}
922 CONFIG_CHELSIO_T3=${CONFIG_CHELSIO_T3}
923 CONFIG_INFINIBAND_CXGB4=${CONFIG_INFINIBAND_CXGB4}
924 CONFIG_CHELSIO_T4=${CONFIG_CHELSIO_T4}
925 CONFIG_SCSI_CXGB3_ISCSI=${CONFIG_SCSI_CXGB3_ISCSI}
926 CONFIG_SCSI_CXGB4_ISCSI=${CONFIG_SCSI_CXGB4_ISCSI}
927 CONFIG_INFINIBAND_NES=${CONFIG_INFINIBAND_NES}
928 CONFIG_INFINIBAND_OCRDMA=${CONFIG_INFINIBAND_OCRDMA}
929 CONFIG_BE2NET=${CONFIG_BE2NET}
930
931 CONFIG_SUNRPC_XPRT_RDMA=${CONFIG_SUNRPC_XPRT_RDMA}
932 CONFIG_SUNRPC_XPRT_RDMA_CLIENT=${CONFIG_SUNRPC_XPRT_RDMA_CLIENT}
933 CONFIG_SUNRPC_XPRT_RDMA_SERVER=${CONFIG_SUNRPC_XPRT_RDMA_SERVER}
934
935
936 CONFIG_INFINIBAND_IPOIB_DEBUG_DATA=${CONFIG_INFINIBAND_IPOIB_DEBUG_DATA}
937 CONFIG_INFINIBAND_SDP_SEND_ZCOPY=${CONFIG_INFINIBAND_SDP_SEND_ZCOPY}
938 CONFIG_INFINIBAND_SDP_RECV_ZCOPY=${CONFIG_INFINIBAND_SDP_RECV_ZCOPY}
939 CONFIG_INFINIBAND_SDP_DEBUG=${CONFIG_INFINIBAND_SDP_DEBUG}
940 CONFIG_INFINIBAND_SDP_DEBUG_DATA=${CONFIG_INFINIBAND_SDP_DEBUG_DATA}
941 CONFIG_INFINIBAND_IPATH=${CONFIG_INFINIBAND_IPATH}
942 CONFIG_INFINIBAND_QIB=${CONFIG_INFINIBAND_QIB}
943 CONFIG_INFINIBAND_MTHCA_DEBUG=${CONFIG_INFINIBAND_MTHCA_DEBUG}
944 CONFIG_INFINIBAND_QLGC_VNIC_STATS=${CONFIG_INFINIBAND_QLGC_VNIC_STATS}
945 CONFIG_INFINIBAND_CXGB3_DEBUG=${CONFIG_INFINIBAND_CXGB3_DEBUG}
946 CONFIG_INFINIBAND_NES_DEBUG=${CONFIG_INFINIBAND_NES_DEBUG}
947 CONFIG_INFINIBAND_AMSO1100=${CONFIG_INFINIBAND_AMSO1100}
948 CONFIG_MLX4_EN_DCB=${CONFIG_MLX4_EN_DCB}
949
950 EOFCONFIG
951         echo "Created ${CONFIG}:"
952         cat ${CWD}/${CONFIG}
953
954 # Create autoconf.h
955 if [ "X${CONFIG_MEMTRACK}" == "Xm" ]; then
956         DEFINE_MEMTRACK="#undef CONFIG_MEMTRACK\n#define CONFIG_MEMTRACK 1"
957 else
958         DEFINE_MEMTRACK="#undef CONFIG_MEMTRACK"
959 fi
960 if [ "X${CONFIG_DEBUG_INFO}" == "Xy" ]; then
961         DEFINE_DEBUG_INFO="#undef CONFIG_DEBUG_INFO\n#define CONFIG_DEBUG_INFO 1"
962 else
963         DEFINE_DEBUG_INFO="#undef CONFIG_DEBUG_INFO"
964 fi
965 if [ "X${CONFIG_INFINIBAND}" == "Xm" ]; then
966         DEFINE_INFINIBAND="#undef CONFIG_INFINIBAND\n#define CONFIG_INFINIBAND 1"
967 else
968         DEFINE_INFINIBAND="#undef CONFIG_INFINIBAND"
969 fi
970 if [ "X${CONFIG_INFINIBAND_IPOIB}" == "Xm" ]; then
971         DEFINE_INFINIBAND_IPOIB="#undef CONFIG_INFINIBAND_IPOIB\n#define CONFIG_INFINIBAND_IPOIB 1"
972 else
973         DEFINE_INFINIBAND_IPOIB="#undef CONFIG_INFINIBAND_IPOIB"
974 fi
975 if [ "X${CONFIG_INFINIBAND_IPOIB_CM}" == "Xy" ]; then
976         DEFINE_INFINIBAND_IPOIB_CM="#undef CONFIG_INFINIBAND_IPOIB_CM\n#define CONFIG_INFINIBAND_IPOIB_CM 1"
977 else
978         DEFINE_INFINIBAND_IPOIB_CM="#undef CONFIG_INFINIBAND_IPOIB_CM"
979 fi
980 if [ "X${CONFIG_INFINIBAND_SDP}" == "Xm" ]; then
981         DEFINE_INFINIBAND_SDP="#undef CONFIG_INFINIBAND_SDP\n#define CONFIG_INFINIBAND_SDP 1"
982 else
983         DEFINE_INFINIBAND_SDP="#undef CONFIG_INFINIBAND_SDP"
984 fi
985 if [ "X${CONFIG_INFINIBAND_SRP}" == "Xm" ]; then
986         DEFINE_INFINIBAND_SRP="#undef CONFIG_INFINIBAND_SRP\n#define CONFIG_INFINIBAND_SRP 1"
987 else
988         DEFINE_INFINIBAND_SRP="#undef CONFIG_INFINIBAND_SRP"
989 fi
990 if [ "X${CONFIG_SCSI_SRP_ATTRS}" == "Xm" ]; then
991         DEFINE_SCSI_SRP_ATTRS="#undef CONFIG_SCSI_SRP_ATTRS\n#define CONFIG_SCSI_SRP_ATTRS 1"
992 else
993         DEFINE_SCSI_SRP_ATTRS="/* CONFIG_SCSI_SRP_ATTRS is not set */"
994 fi
995 if [ "X${CONFIG_INFINIBAND_SRPT}" == "Xm" ]; then
996         DEFINE_INFINIBAND_SRPT="#undef CONFIG_INFINIBAND_SRPT\n#define CONFIG_INFINIBAND_SRPT 1"
997 else
998         DEFINE_INFINIBAND_SRPT="#undef CONFIG_INFINIBAND_SRP"
999 fi
1000 if [ "X${CONFIG_INFINIBAND_USER_MAD}" == "Xm" ]; then
1001         DEFINE_INFINIBAND_USER_MAD="#undef CONFIG_INFINIBAND_USER_MAD\n#define CONFIG_INFINIBAND_USER_MAD 1"
1002 else
1003         DEFINE_INFINIBAND_USER_MAD="#undef CONFIG_INFINIBAND_USER_MAD"
1004 fi
1005 if [ "X${CONFIG_INFINIBAND_USER_ACCESS}" == "Xm" ]; then
1006         DEFINE_INFINIBAND_USER_ACCESS="#undef CONFIG_INFINIBAND_USER_ACCESS\n#define CONFIG_INFINIBAND_USER_ACCESS 1"
1007 else
1008         DEFINE_INFINIBAND_USER_ACCESS="#undef CONFIG_INFINIBAND_USER_ACCESS"
1009 fi
1010 if [ "X${CONFIG_INFINIBAND_ADDR_TRANS}" == "Xy" ]; then
1011         DEFINE_INFINIBAND_ADDR_TRANS="#undef CONFIG_INFINIBAND_ADDR_TRANS\n#define CONFIG_INFINIBAND_ADDR_TRANS 1"
1012 else
1013         DEFINE_INFINIBAND_ADDR_TRANS="#undef CONFIG_INFINIBAND_ADDR_TRANS"
1014 fi
1015 if [ "X${CONFIG_INFINIBAND_USER_MEM}" == "Xy" ]; then
1016         DEFINE_INFINIBAND_USER_MEM="#undef CONFIG_INFINIBAND_USER_MEM\n#define CONFIG_INFINIBAND_USER_MEM 1"
1017 else
1018         DEFINE_INFINIBAND_USER_MEM="#undef CONFIG_INFINIBAND_USER_MEM"
1019 fi
1020 if [ "X${CONFIG_INFINIBAND_MTHCA}" == "Xm" ]; then
1021         DEFINE_INFINIBAND_MTHCA="#undef CONFIG_INFINIBAND_MTHCA\n#define CONFIG_INFINIBAND_MTHCA 1"
1022 else
1023         DEFINE_INFINIBAND_MTHCA="#undef CONFIG_INFINIBAND_MTHCA"
1024 fi
1025 if [ "X${CONFIG_MLX4_CORE}" == "Xm" ]; then
1026         DEFINE_MLX4_CORE="#undef CONFIG_MLX4_CORE\n#define CONFIG_MLX4_CORE 1"
1027 else
1028         DEFINE_MLX4_CORE="#undef CONFIG_MLX4_CORE"
1029 fi
1030 if [ "X${CONFIG_MLX5_CORE}" == "Xm" ]; then
1031         DEFINE_MLX5_CORE="#undef CONFIG_MLX5_CORE\n#define CONFIG_MLX5_CORE 1"
1032 else
1033         DEFINE_MLX4_CORE="#undef CONFIG_MLX5_CORE"
1034 fi
1035 if [ "X${CONFIG_MLX4_EN}" == "Xm" ]; then
1036         DEFINE_MLX4_EN="#undef CONFIG_MLX4_EN\n#define CONFIG_MLX4_EN 1"
1037 else
1038         DEFINE_MLX4_EN="#undef CONFIG_MLX4_EN"
1039 fi
1040 if [ "X${CONFIG_MLX4_EN_DCB}" == "Xy" ]; then
1041         DEFINE_MLX4_EN="#undef CONFIG_MLX4_EN_DCB\n#define CONFIG_MLX4_EN_DCB 1"
1042 else
1043         DEFINE_MLX4_EN="#undef CONFIG_MLX4_EN_DCB"
1044 fi
1045 if [ "X${CONFIG_MLX4_INFINIBAND}" == "Xm" ]; then
1046         DEFINE_MLX4_INFINIBAND="#undef CONFIG_MLX4_INFINIBAND\n#define CONFIG_MLX4_INFINIBAND 1"
1047 else
1048         DEFINE_MLX4_INFINIBAND="#undef CONFIG_MLX4_INFINIBAND"
1049 fi
1050 if [ "X${CONFIG_MLX5_INFINIBAND}" == "Xm" ]; then
1051         DEFINE_MLX5_INFINIBAND="#undef CONFIG_MLX5_INFINIBAND\n#define CONFIG_MLX5_INFINIBAND 1"
1052 else
1053         DEFINE_MLX5_INFINIBAND="#undef CONFIG_MLX5_INFINIBAND"
1054 fi
1055 if [ "X${CONFIG_MLX4_DEBUG}" == "Xy" ]; then
1056         DEFINE_MLX4_DEBUG="#undef CONFIG_MLX4_DEBUG\n#define CONFIG_MLX4_DEBUG 1"
1057 else
1058         DEFINE_MLX4_DEBUG="#undef CONFIG_MLX4_DEBUG"
1059 fi
1060 if [ "X${CONFIG_MLX5_DEBUG}" == "Xy" ]; then
1061         DEFINE_MLX5_DEBUG="#undef CONFIG_MLX5_DEBUG\n#define CONFIG_MLX5_DEBUG 1"
1062 else
1063         DEFINE_MLX5_DEBUG="#undef CONFIG_MLX5_DEBUG"
1064 fi
1065 if [ "X${CONFIG_IBP_SERVER}" == "Xm" ]; then
1066         DEFINE_IBP_SERVER="#undef CONFIG_IBP_SERVER\n#define CONFIG_IBP_SERVER 1"
1067 else
1068         DEFINE_IBP_SERVER="#undef CONFIG_IBP_SERVER"
1069 fi
1070 if [ "X${CONFIG_IBP_DRV_DEBUG}" == "Xy" ]; then
1071         DEFINE_IBP_DEBUG="#undef CONFIG_IBP_DEBUG\n#define CONFIG_IBP_DEBUG 1"
1072 else
1073         DEFINE_IBP_DEBUG="#undef CONFIG_IBP_DEBUG"
1074 fi
1075 if [ "X${CONFIG_INFINIBAND_SCIF}" == "Xm" ]; then
1076         DEFINE_INFINIBAND_SCIF="#undef CONFIG_INFINIBAND_SCIF\n#define CONFIG_INFINIBAND_SCIF 1"
1077 else
1078         DEFINE_INFINIBAND_SCIF="#undef CONFIG_INFINIBAND_SCIF"
1079 fi
1080 if [ "X${CONFIG_INFINIBAND_IPOIB_DEBUG}" == "Xy" ]; then
1081         DEFINE_INFINIBAND_IPOIB_DEBUG="#undef CONFIG_INFINIBAND_IPOIB_DEBUG\n#define CONFIG_INFINIBAND_IPOIB_DEBUG 1"
1082 else
1083         DEFINE_INFINIBAND_IPOIB_DEBUG="#undef CONFIG_INFINIBAND_IPOIB_DEBUG"
1084 fi
1085 if [ "X${CONFIG_INFINIBAND_ISER}" == "Xm" ]; then
1086         DEFINE_INFINIBAND_ISER="#undef CONFIG_INFINIBAND_ISER\n#define CONFIG_INFINIBAND_ISER 1"
1087         DEFINE_SCSI_ISCSI_ATTRS="#undef CONFIG_SCSI_ISCSI_ATTRS\n#define CONFIG_SCSI_ISCSI_ATTRS 1"
1088         DEFINE_ISCSI_TCP="#undef CONFIG_ISCSI_TCP\n#define CONFIG_ISCSI_TCP 1"
1089 else
1090         DEFINE_INFINIBAND_ISER="#undef CONFIG_INFINIBAND_ISER"
1091         DEFINE_SCSI_ISCSI_ATTRS="#undef CONFIG_SCSI_ISCSI_ATTRS"
1092         DEFINE_ISCSI_TCP="#undef CONFIG_ISCSI_TCP"
1093 fi
1094 if [ "X${CONFIG_INFINIBAND_ISERT}" == "Xm" ]; then
1095         DEFINE_INFINIBAND_ISERT="#undef CONFIG_INFINIBAND_ISERT\n#define CONFIG_INFINIBAND_ISERT 1"
1096 else
1097         DEFINE_INFINIBAND_ISERT="#undef CONFIG_INFINIBAND_ISERT"
1098 fi
1099 if [ "X${CONFIG_INFINIBAND_EHCA}" == "Xm" ]; then
1100         DEFINE_INFINIBAND_EHCA="#undef CONFIG_INFINIBAND_EHCA\n#define CONFIG_INFINIBAND_EHCA 1"
1101 else
1102         DEFINE_INFINIBAND_EHCA="#undef CONFIG_INFINIBAND_EHCA"
1103 fi
1104 if [ "X${CONFIG_INFINIBAND_EHCA_SCALING}" == "Xy" ]; then
1105         DEFINE_INFINIBAND_EHCA_SCALING="#undef CONFIG_INFINIBAND_EHCA_SCALING\n#define CONFIG_INFINIBAND_EHCA_SCALING 1"
1106 else
1107         DEFINE_INFINIBAND_EHCA_SCALING="#undef CONFIG_INFINIBAND_EHCA_SCALING"
1108 fi
1109 if [ "X${CONFIG_RDS}" == "Xm" ]; then
1110         DEFINE_RDS="#undef CONFIG_RDS\n#define CONFIG_RDS 1"
1111         DEFINE_RDS_RDMA="#undef CONFIG_RDS_RDMA\n#define CONFIG_RDS_RDMA 1"
1112         DEFINE_RDS_TCP="#undef CONFIG_RDS_TCP\n#define CONFIG_RDS_TCP 1"
1113 else
1114         DEFINE_RDS="#undef CONFIG_RDS"
1115         DEFINE_RDS_RDMA="#undef CONFIG_RDS_RDMA"
1116         DEFINE_RDS_TCP="#undef CONFIG_RDS_TCP"
1117 fi
1118 if [ "X${CONFIG_RDS_DEBUG}" == "Xy" ]; then
1119         DEFINE_RDS_DEBUG="#undef CONFIG_RDS_DEBUG\n#define CONFIG_RDS_DEBUG 1"
1120 else
1121         DEFINE_RDS_DEBUG="#undef CONFIG_RDS_DEBUG"
1122 fi
1123 if [ "X${CONFIG_INFINIBAND_MADEYE}" == "Xm" ]; then
1124         DEFINE_INFINIBAND_MADEYE="#undef CONFIG_INFINIBAND_MADEYE\n#define CONFIG_INFINIBAND_MADEYE 1"
1125 else
1126         DEFINE_INFINIBAND_MADEYE="#undef CONFIG_INFINIBAND_MADEYE"
1127 fi
1128 if [ "X${CONFIG_INFINIBAND_IPOIB_DEBUG_DATA}" == "Xy" ]; then
1129         DEFINE_INFINIBAND_IPOIB_DEBUG_DATA="#undef CONFIG_INFINIBAND_IPOIB_DEBUG_DATA\n#define CONFIG_INFINIBAND_IPOIB_DEBUG_DATA 1"
1130 else
1131         DEFINE_INFINIBAND_IPOIB_DEBUG_DATA="#undef CONFIG_INFINIBAND_IPOIB_DEBUG_DATA"
1132 fi
1133 if [ "X${CONFIG_INFINIBAND_SDP_SEND_ZCOPY}" == "Xy" ]; then
1134         DEFINE_INFINIBAND_SDP_SEND_ZCOPY="#undef CONFIG_INFINIBAND_SDP_SEND_ZCOPY\n#define CONFIG_INFINIBAND_SDP_SEND_ZCOPY 1"
1135 else
1136         DEFINE_INFINIBAND_SDP_SEND_ZCOPY="#undef CONFIG_INFINIBAND_SDP_SEND_ZCOPY"
1137 fi
1138 if [ "X${CONFIG_INFINIBAND_SDP_RECV_ZCOPY}" == "Xy" ]; then
1139         DEFINE_INFINIBAND_SDP_RECV_ZCOPY="#undef CONFIG_INFINIBAND_SDP_RECV_ZCOPY\n#define CONFIG_INFINIBAND_SDP_RECV_ZCOPY 1"
1140 else
1141         DEFINE_INFINIBAND_SDP_RECV_ZCOPY="#undef CONFIG_INFINIBAND_SDP_RECV_ZCOPY"
1142 fi
1143 if [ "X${CONFIG_INFINIBAND_SDP_DEBUG}" == "Xy" ]; then
1144         DEFINE_INFINIBAND_SDP_DEBUG="#undef CONFIG_INFINIBAND_SDP_DEBUG\n#define CONFIG_INFINIBAND_SDP_DEBUG 1"
1145 else
1146         DEFINE_INFINIBAND_SDP_DEBUG="#undef CONFIG_INFINIBAND_SDP_DEBUG"
1147 fi
1148 if [ "X${CONFIG_INFINIBAND_SDP_DEBUG_DATA}" == "Xy" ]; then
1149         DEFINE_INFINIBAND_SDP_DEBUG_DATA="#undef CONFIG_INFINIBAND_SDP_DEBUG_DATA\n#define CONFIG_INFINIBAND_SDP_DEBUG_DATA 1"
1150 else
1151         DEFINE_INFINIBAND_SDP_DEBUG_DATA="#undef CONFIG_INFINIBAND_SDP_DEBUG_DATA"
1152 fi
1153 if [ "X${CONFIG_INFINIBAND_IPATH}" == "Xm" ]; then
1154         DEFINE_INFINIBAND_IPATH="#undef CONFIG_INFINIBAND_IPATH\n#define CONFIG_INFINIBAND_IPATH 1"
1155 else
1156         DEFINE_INFINIBAND_IPATH="#undef CONFIG_INFINIBAND_IPATH"
1157 fi
1158 if [ "X${CONFIG_INFINIBAND_QIB}" == "Xm" ]; then
1159         DEFINE_INFINIBAND_QIB="#undef CONFIG_INFINIBAND_QIB\n#define CONFIG_INFINIBAND_QIB 1"
1160 else
1161         DEFINE_INFINIBAND_QIB="#undef CONFIG_INFINIBAND_QIB"
1162 fi
1163 if [ "X${CONFIG_INFINIBAND_MTHCA_DEBUG}" == "Xy" ]; then
1164         DEFINE_INFINIBAND_MTHCA_DEBUG="#undef CONFIG_INFINIBAND_MTHCA_DEBUG\n#define CONFIG_INFINIBAND_MTHCA_DEBUG 1"
1165 else
1166         DEFINE_INFINIBAND_MTHCA_DEBUG="#undef CONFIG_INFINIBAND_MTHCA_DEBUG"
1167 fi
1168 if [ "X${CONFIG_INFINIBAND_QLGC_VNIC}" == "Xm" ]; then
1169         DEFINE_INFINIBAND_QLGC_VNIC="#undef CONFIG_INFINIBAND_QLGC_VNIC\n#define CONFIG_INFINIBAND_QLGC_VNIC 1"
1170 else
1171         DEFINE_INFINIBAND_QLGC_VNIC="#undef CONFIG_INFINIBAND_QLGC_VNIC"
1172 fi
1173 if [ "X${CONFIG_INFINIBAND_QLGC_VNIC_STATS}" == "Xy" ]; then
1174         DEFINE_INFINIBAND_QLGC_VNIC_STATS="#undef CONFIG_INFINIBAND_QLGC_VNIC_STATS\n#define CONFIG_INFINIBAND_QLGC_VNIC_STATS 1"
1175 else
1176         DEFINE_INFINIBAND_QLGC_VNIC_STATS="#undef CONFIG_INFINIBAND_QLGC_VNIC_STATS"
1177 fi
1178 if [ "X${CONFIG_INFINIBAND_CXGB3}" == "Xm" ]; then
1179         DEFINE_INFINIBAND_CXGB3="#undef CONFIG_INFINIBAND_CXGB3\n#define CONFIG_INFINIBAND_CXGB3 1"
1180 else
1181         DEFINE_INFINIBAND_CXGB3="#undef CONFIG_INFINIBAND_CXGB3"
1182 fi
1183 if [ "X${CONFIG_INFINIBAND_CXGB3_DEBUG}" == "Xy" ]; then
1184         DEFINE_INFINIBAND_CXGB3_DEBUG="#undef CONFIG_INFINIBAND_CXGB3_DEBUG\n#define CONFIG_INFINIBAND_CXGB3_DEBUG 1"
1185 else
1186         DEFINE_INFINIBAND_CXGB3_DEBUG="#undef CONFIG_INFINIBAND_CXGB3_DEBUG"
1187 fi
1188 if [ "X${CONFIG_CHELSIO_T3}" == "Xm" ]; then
1189         DEFINE_CHELSIO_T3="#undef CONFIG_CHELSIO_T3\n#define CONFIG_CHELSIO_T3 1"
1190 else
1191         DEFINE_CHELSIO_T3="#undef CONFIG_CHELSIO_T3"
1192 fi
1193 if [ "X${CONFIG_INFINIBAND_CXGB4}" == "Xm" ]; then
1194         DEFINE_INFINIBAND_CXGB4="#undef CONFIG_INFINIBAND_CXGB4\n#define CONFIG_INFINIBAND_CXGB4 1"
1195 else
1196         DEFINE_INFINIBAND_CXGB4="#undef CONFIG_INFINIBAND_CXGB4"
1197 fi
1198 if [ "X${CONFIG_CHELSIO_T4}" == "Xm" ]; then
1199         DEFINE_CHELSIO_T4="#undef CONFIG_CHELSIO_T4\n#define CONFIG_CHELSIO_T4 1"
1200 else
1201         DEFINE_CHELSIO_T4="#undef CONFIG_CHELSIO_T4"
1202 fi
1203 if [ "X${CONFIG_SCSI_CXGB3_ISCSI}" == "Xm" ]; then
1204         DEFINE_SCSI_CXGB3_ISCSI="#undef CONFIG_SCSI_CXGB3_ISCSI\n#define CONFIG_SCSI_CXGB3_ISCSI 1"
1205 else
1206         DEFINE_SCSI_CXGB3_ISCSI="#undef CONFIG_SCSI_CXGB3_ISCSI"
1207 fi
1208 if [ "X${CONFIG_SCSI_CXGB4_ISCSI}" == "Xm" ]; then
1209         DEFINE_SCSI_CXGB4_ISCSI="#undef CONFIG_SCSI_CXGB4_ISCSI\n#define CONFIG_SCSI_CXGB4_ISCSI 1"
1210 else
1211         DEFINE_SCSI_CXGB4_ISCSI="#undef CONFIG_SCSI_CXGB4_ISCSI"
1212 fi
1213 if [ "X${CONFIG_INFINIBAND_NES}" == "Xm" ]; then
1214         DEFINE_INFINIBAND_NES="#undef CONFIG_INFINIBAND_NES\n#define CONFIG_INFINIBAND_NES 1"
1215 else
1216         DEFINE_INFINIBAND_NES="#undef CONFIG_INFINIBAND_NES"
1217 fi
1218 if [ "X${CONFIG_INFINIBAND_OCRDMA}" == "Xm" ]; then
1219         DEFINE_INFINIBAND_OCRDMA="#undef CONFIG_INFINIBAND_OCRDMA\n#define CONFIG_INFINIBAND_OCRDMA 1"
1220 else
1221         DEFINE_INFINIBAND_OCRDMA="#undef CONFIG_INFINIBAND_OCRDMA"
1222 fi
1223 if [ "X${CONFIG_BE2NET}" == "Xm" ]; then
1224         DEFINE_BE2NET="#undef CONFIG_BE2NET\n#define CONFIG_BE2NET 1"
1225 else
1226         DEFINE_BE2NET="#undef CONFIG_BE2NET"
1227 fi
1228 if [ "X${CONFIG_INFINIBAND_NES_DEBUG}" == "Xy" ]; then
1229         DEFINE_INFINIBAND_NES_DEBUG="#undef CONFIG_INFINIBAND_NES_DEBUG\n#define CONFIG_INFINIBAND_NES_DEBUG 1"
1230 else
1231         DEFINE_INFINIBAND_NES_DEBUG="#undef CONFIG_INFINIBAND_NES_DEBUG"
1232 fi
1233 if [ "X${CONFIG_INFINIBAND_AMSO1100}" == "Xm" ]; then
1234         DEFINE_INFINIBAND_AMSO1100="#undef CONFIG_INFINIBAND_AMSO1100\n#define CONFIG_INFINIBAND_AMSO1100 1"
1235 else
1236         DEFINE_INFINIBAND_AMSO1100="#undef CONFIG_INFINIBAND_AMSO1100"
1237 fi
1238 if [ "X${CONFIG_MLX4_EN_DCB}" == "Xy" ]; then
1239         DEFINE_MLX4_EN_DCB="#undef CONFIG_MLX4_EN_DCB\n#define CONFIG_MLX4_EN_DCB 1"
1240 else
1241         DEFINE_MLX4_EN_DCB="#undef CONFIG_MLX4_EN_DCB"
1242 fi
1243 if [ "X${CONFIG_SUNRPC_XPRT_RDMA}" == "Xm" ]; then
1244         DEFINE_SUNRPC_XPRT_RDMA="#undef CONFIG_SUNRPC_XPRT_RDMA\n#define CONFIG_SUNRPC_XPRT_RDMA 1"
1245 else
1246         DEFINE_SUNRPC_XPRT_RDMA="/* CONFIG_SUNRPC_XPRT_RDMA is not set */"
1247 fi
1248 if [ "X${CONFIG_SUNRPC_XPRT_RDMA_CLIENT}" == "Xm" ]; then
1249         DEFINE_SUNRPC_XPRT_RDMA_CLIENT="#undef CONFIG_SUNRPC_XPRT_RDMA_CLIENT\n#define CONFIG_SUNRPC_XPRT_RDMA_CLIENT 1"
1250 else
1251         DEFINE_SUNRPC_XPRT_RDMA_CLIENT="/* CONFIG_SUNRPC_XPRT_RDMA_CLIENT is not set */"
1252 fi
1253 if [ "X${CONFIG_SUNRPC_XPRT_RDMA_SERVER}" == "Xm" ]; then
1254         DEFINE_SUNRPC_XPRT_RDMA_SERVER="#undef CONFIG_SUNRPC_XPRT_RDMA_SERVER\n#define CONFIG_SUNRPC_XPRT_RDMA_SERVER 1"
1255 else
1256         DEFINE_SUNRPC_XPRT_RDMA_SERVER="/* CONFIG_SUNRPC_XPRT_RDMA_SERVER is not set */"
1257 fi
1258
1259 cat > ${AUTOCONF_H} << EOFAUTOCONF
1260 #ifndef __OFED_BUILD__
1261 #include_next <$AUTOCONF_PREFIX/autoconf.h>
1262 $(echo -e "${DEFINE_INFINIBAND}" | grep -v undef)
1263 $(echo -e "${DEFINE_INFINIBAND_IPOIB}" | grep -v undef)
1264 $(echo -e "${DEFINE_INFINIBAND_IPOIB_CM}" | grep -v undef)
1265 $(echo -e "${DEFINE_INFINIBAND_SDP}" | grep -v undef)
1266 $(echo -e "${DEFINE_INFINIBAND_SRP}" | grep -v undef)
1267 $(echo -e "${DEFINE_SCSI_SRP_ATTRS}" | grep -v undef)
1268 $(echo -e "${DEFINE_INFINIBAND_SRPT}" | grep -v undef)
1269
1270 $(echo -e "${DEFINE_INFINIBAND_USER_MAD}" | grep -v undef)
1271 $(echo -e "${DEFINE_INFINIBAND_USER_ACCESS}" | grep -v undef)
1272 $(echo -e "${DEFINE_INFINIBAND_ADDR_TRANS}" | grep -v undef)
1273 $(echo -e "${DEFINE_INFINIBAND_USER_MEM}" | grep -v undef)
1274 $(echo -e "${DEFINE_INFINIBAND_MTHCA}" | grep -v undef)
1275 $(echo -e "${DEFINE_INFINIBAND_QLGC_VNIC}" | grep -v undef)
1276 $(echo -e "${DEFINE_INFINIBAND_CXGB3}" | grep -v undef)
1277 $(echo -e "${DEFINE_CHELSIO_T3}" | grep -v undef)
1278 $(echo -e "${DEFINE_INFINIBAND_CXGB4}" | grep -v undef)
1279 $(echo -e "${DEFINE_CHELSIO_T4}" | grep -v undef)
1280 $(echo -e "${DEFINE_INFINIBAND_NES}" | grep -v undef)
1281 $(echo -e "${DEFINE_INFINIBAND_OCRDMA}" | grep -v undef)
1282 $(echo -e "${DEFINE_BE2NET}" | grep -v undef)
1283
1284 $(echo -e "${DEFINE_SUNRPC_XPRT_RDMA}" | grep -v undef)
1285 $(echo -e "${DEFINE_SUNRPC_XPRT_RDMA_CLIENT}" | grep -v undef)
1286 $(echo -e "${DEFINE_SUNRPC_XPRT_RDMA_SERVER}" | grep -v undef)
1287
1288 $(echo -e "${DEFINE_INFINIBAND_IPOIB_DEBUG}" | grep -v undef)
1289 $(echo -e "${DEFINE_INFINIBAND_ISERT}" | grep -v undef)
1290 $(echo -e "${DEFINE_INFINIBAND_ISER}" | grep -v undef)
1291 $(echo -e "${DEFINE_SCSI_ISCSI_ATTRS}" | grep -v undef)
1292 $(echo -e "${DEFINE_ISCSI_TCP}" | grep -v undef)
1293 $(echo -e "${DEFINE_INFINIBAND_EHCA}" | grep -v undef)
1294 $(echo -e "${DEFINE_RDS}" | grep -v undef)
1295 $(echo -e "${DEFINE_RDS_RDMA}" | grep -v undef)
1296 $(echo -e "${DEFINE_RDS_TCP}" | grep -v undef)
1297 $(echo -e "${DEFINE_RDS_DEBUG}" | grep -v undef)
1298 $(echo -e "${DEFINE_INFINIBAND_QLGC_VNIC_STATS}" | grep -v undef)
1299 $(echo -e "${DEFINE_INFINIBAND_CXGB3_DEBUG}" | grep -v undef)
1300 $(echo -e "${DEFINE_INFINIBAND_NES_DEBUG}" | grep -v undef)
1301
1302 $(echo -e "${DEFINE_MLX4_CORE}" | grep -v undef)
1303 $(echo -e "${DEFINE_MLX5_CORE}" | grep -v undef)
1304 $(echo -e "${DEFINE_MLX4_EN}" | grep -v undef)
1305 $(echo -e "${DEFINE_MLX4_INFINIBAND}" | grep -v undef)
1306 $(echo -e "${DEFINE_MLX5_INFINIBAND}" | grep -v undef)
1307 $(echo -e "${DEFINE_MLX4_ETHERNET}" | grep -v undef)
1308 $(echo -e "${DEFINE_MLX4_DEBUG}" | grep -v undef)
1309 $(echo -e "${DEFINE_MLX5_DEBUG}" | grep -v undef)
1310
1311 $(echo -e "${DEFINE_IBP_SERVER}" | grep -v undef)
1312 $(echo -e "${DEFINE_IBP_DEBUG}" | grep -v undef)
1313
1314 $(echo -e "${DEFINE_INFINIBAND_SCIF}" | grep -v undef)
1315
1316 $(echo -e "${DEFINE_INFINIBAND_IPOIB_DEBUG_DATA}" | grep -v undef)
1317 $(echo -e "${DEFINE_INFINIBAND_SDP_SEND_ZCOPY}" | grep -v undef)
1318 $(echo -e "${DEFINE_INFINIBAND_SDP_RECV_ZCOPY}" | grep -v undef)
1319 $(echo -e "${DEFINE_INFINIBAND_SDP_DEBUG}" | grep -v undef)
1320 $(echo -e "${DEFINE_INFINIBAND_SDP_DEBUG_DATA}" | grep -v undef)
1321 $(echo -e "${DEFINE_INFINIBAND_IPATH}" | grep -v undef)
1322 $(echo -e "${DEFINE_INFINIBAND_QIB}" | grep -v undef)
1323 $(echo -e "${DEFINE_INFINIBAND_MTHCA_DEBUG}" | grep -v undef)
1324 $(echo -e "${DEFINE_INFINIBAND_MADEYE}" | grep -v undef)
1325 $(echo -e "${DEFINE_INFINIBAND_AMSO1100}" | grep -v undef)
1326 #else
1327 #undef CONFIG_MEMTRACK
1328 #undef CONFIG_DEBUG_INFO
1329 #undef CONFIG_INFINIBAND
1330 #undef CONFIG_INFINIBAND_IPOIB
1331 #undef CONFIG_INFINIBAND_IPOIB_CM
1332 #undef CONFIG_INFINIBAND_SDP
1333 #undef CONFIG_INFINIBAND_SRP
1334 #undef CONFIG_INFINIBAND_SRPT
1335 #undef CONFIG_SCSI_SRP_ATTRS
1336
1337 #undef CONFIG_INFINIBAND_USER_MAD
1338 #undef CONFIG_INFINIBAND_USER_ACCESS
1339 #undef CONFIG_INFINIBAND_ADDR_TRANS
1340 #undef CONFIG_INFINIBAND_USER_MEM
1341 #undef CONFIG_INFINIBAND_MTHCA
1342
1343 #undef CONFIG_MLX4_CORE
1344 #undef CONFIG_MLX5_CORE
1345 #undef CONFIG_MLX4_DEBUG
1346 #undef CONFIG_MLX5_DEBUG
1347 #undef CONFIG_MLX4_EN
1348 #undef CONFIG_MLX4_EN_DCB
1349 #undef CONFIG_MLX4_INFINIBAND
1350 #undef CONFIG_MLX5_INFINIBAND
1351
1352 #undef CONFIG_IBP_SERVER
1353 #undef CONFIG_IBP_DEBUG
1354
1355 #undef CONFIG_INFINIBAND_SCIF
1356
1357 #undef CONFIG_INFINIBAND_IPOIB_DEBUG
1358 #undef CONFIG_INFINIBAND_ISER
1359 #undef CONFIG_INFINIBAND_ISERT
1360 #undef CONFIG_INFINIBAND_EHCA
1361 #undef CONFIG_INFINIBAND_EHCA_SCALING
1362 #undef CONFIG_RDS
1363 #undef CONFIG_RDS_RDMA
1364 #undef CONFIG_RDS_TCP
1365 #undef CONFIG_RDS_DEBUG
1366 #undef CONFIG_INFINIBAND_MADEYE
1367 #undef CONFIG_INFINIBAND_QLGC_VNIC
1368 #undef CONFIG_INFINIBAND_QLGC_VNIC_STATS
1369 #undef CONFIG_INFINIBAND_CXGB3
1370 #undef CONFIG_INFINIBAND_CXGB3_DEBUG
1371 #undef CONFIG_CHELSIO_T3
1372 #undef CONFIG_INFINIBAND_CXGB4
1373 #undef CONFIG_CHELSIO_T4
1374 #undef CONFIG_SCSI_CXGB3_ISCSI
1375 #undef CONFIG_SCSI_CXGB4_ISCSI
1376 #undef CONFIG_INFINIBAND_NES
1377 #undef CONFIG_INFINIBAND_NES_DEBUG
1378 #undef CONFIG_INFINIBAND_OCRDMA
1379 #undef CONFIG_BE2NET
1380
1381 #undef CONFIG_SUNRPC_XPRT_RDMA
1382 #undef CONFIG_SUNRPC_XPRT_RDMA_CLIENT
1383 #undef CONFIG_SUNRPC_XPRT_RDMA_SERVER
1384
1385
1386 #undef CONFIG_INFINIBAND_IPOIB_DEBUG_DATA
1387 #undef CONFIG_INFINIBAND_SDP_SEND_ZCOPY
1388 #undef CONFIG_INFINIBAND_SDP_RECV_ZCOPY
1389 #undef CONFIG_INFINIBAND_SDP_DEBUG
1390 #undef CONFIG_INFINIBAND_SDP_DEBUG_DATA
1391 #undef CONFIG_INFINIBAND_IPATH
1392 #undef CONFIG_INFINIBAND_QIB
1393 #undef CONFIG_INFINIBAND_MTHCA_DEBUG
1394 #undef CONFIG_INFINIBAND_AMSO1100
1395 #undef CONFIG_MLX4_EN_DCB
1396
1397 $(echo -e "${DEFINE_INFINIBAND}")
1398 $(echo -e "${DEFINE_INFINIBAND_IPOIB}")
1399 $(echo -e "${DEFINE_INFINIBAND_IPOIB_CM}")
1400 $(echo -e "${DEFINE_INFINIBAND_SDP}")
1401 $(echo -e "${DEFINE_INFINIBAND_SRP}")
1402 $(echo -e "${DEFINE_INFINIBAND_SRPT}")
1403
1404 $(echo -e "${DEFINE_INFINIBAND_USER_MAD}")
1405 $(echo -e "${DEFINE_INFINIBAND_USER_ACCESS}")
1406 $(echo -e "${DEFINE_INFINIBAND_ADDR_TRANS}")
1407 $(echo -e "${DEFINE_INFINIBAND_USER_MEM}")
1408 $(echo -e "${DEFINE_INFINIBAND_MTHCA}")
1409 $(echo -e "${DEFINE_INFINIBAND_QLGC_VNIC}")
1410 $(echo -e "${DEFINE_INFINIBAND_CXGB3}")
1411 $(echo -e "${DEFINE_CHELSIO_T3}")
1412 $(echo -e "${DEFINE_INFINIBAND_CXGB4}")
1413 $(echo -e "${DEFINE_CHELSIO_T4}")
1414 $(echo -e "${DEFINE_INFINIBAND_NES}")
1415 $(echo -e "${DEFINE_INFINIBAND_OCRDMA}")
1416 $(echo -e "${DEFINE_BE2NET}")
1417
1418 $(echo -e "${DEFINE_SUNRPC_XPRT_RDMA}")
1419 $(echo -e "${DEFINE_SUNRPC_XPRT_RDMA_CLIENT}")
1420 $(echo -e "${DEFINE_SUNRPC_XPRT_RDMA_SERVER}")
1421
1422 $(echo -e "${DEFINE_INFINIBAND_IPOIB_DEBUG}")
1423 $(echo -e "${DEFINE_INFINIBAND_ISERT}")
1424 $(echo -e "${DEFINE_INFINIBAND_ISER}")
1425 $(echo -e "${DEFINE_SCSI_ISCSI_ATTRS}")
1426 $(echo -e "${DEFINE_ISCSI_TCP}")
1427 $(echo -e "${DEFINE_INFINIBAND_EHCA}")
1428 $(echo -e "${DEFINE_RDS}")
1429 $(echo -e "${DEFINE_RDS_RDMA}")
1430 $(echo -e "${DEFINE_RDS_TCP}")
1431 $(echo -e "${DEFINE_RDS_DEBUG}")
1432 $(echo -e "${DEFINE_INFINIBAND_QLGC_VNIC_STATS}")
1433 $(echo -e "${DEFINE_INFINIBAND_CXGB3_DEBUG}")
1434 $(echo -e "${DEFINE_INFINIBAND_NES_DEBUG}")
1435
1436 $(echo -e "${DEFINE_MLX4_CORE}")
1437 $(echo -e "${DEFINE_MLX5_CORE}")
1438 $(echo -e "${DEFINE_MLX4_EN}")
1439 $(echo -e "${DEFINE_MLX4_INFINIBAND}")
1440 $(echo -e "${DEFINE_MLX5_INFINIBAND}")
1441 $(echo -e "${DEFINE_MLX4_ETHERNET}")
1442 $(echo -e "${DEFINE_MLX4_DEBUG}")
1443 $(echo -e "${DEFINE_MLX5_DEBUG}")
1444
1445 $(echo -e "${DEFINE_IBP_SERVER}")
1446 $(echo -e "${DEFINE_IBP_DEBUG}")
1447
1448 $(echo -e "${DEFINE_INFINIBAND_SCIF}")
1449
1450 $(echo -e "${DEFINE_INFINIBAND_IPOIB_DEBUG_DATA}")
1451 $(echo -e "${DEFINE_INFINIBAND_SDP_SEND_ZCOPY}")
1452 $(echo -e "${DEFINE_INFINIBAND_SDP_RECV_ZCOPY}")
1453 $(echo -e "${DEFINE_INFINIBAND_SDP_DEBUG}")
1454 $(echo -e "${DEFINE_INFINIBAND_SDP_DEBUG_DATA}")
1455 $(echo -e "${DEFINE_INFINIBAND_IPATH}")
1456 $(echo -e "${DEFINE_INFINIBAND_QIB}")
1457 $(echo -e "${DEFINE_INFINIBAND_MTHCA_DEBUG}")
1458 $(echo -e "${DEFINE_INFINIBAND_MADEYE}")
1459 $(echo -e "${DEFINE_INFINIBAND_AMSO1100}")
1460 $(echo -e "${DEFINE_MLX4_EN_DCB}")
1461 #endif
1462
1463 EOFAUTOCONF
1464
1465         echo "Created ${AUTOCONF_H}:"
1466         cat ${AUTOCONF_H}
1467
1468         if [ ! -x compat/autogen.sh ]; then
1469             exit 0
1470         fi
1471
1472         if [ $SKIP_AUTOCONF -eq 0 ]; then
1473                 cd compat
1474                 if [[ ! -x configure || $FORCE_AUTOGEN -eq 1 ]]; then
1475                         ex ./autogen.sh
1476                 fi
1477                 ex ./configure --with-linux-obj=$KSRC_OBJ --with-linux=$KSRC
1478         fi
1479 }
1480
1481 main $@