68445c9451944efe2f2afec5802239eba05c2528
[multipath-tools/.git] / libmultipath / hwtable.c
1 #include <stdio.h>
2
3 #include "checkers.h"
4 #include "vector.h"
5 #include "defaults.h"
6 #include "structs.h"
7 #include "config.h"
8 #include "pgpolicies.h"
9 #include "prio.h"
10 #include "hwtable.h"
11
12 /*
13  * Tuning suggestions on these parameters should go to
14  * dm-devel@redhat.com (subscribers-only, see README)
15  *
16  * You are welcome to claim maintainership over a controller
17  * family. Please mail the currently enlisted maintainer and
18  * the upstream package maintainer.
19  *
20  * Please, use the TEMPLATE below to add new hardware.
21  *
22  * WARNING:
23  *
24  * Devices with a proprietary handler must also be included in
25  * the kernel side. Currently at drivers/scsi/scsi_dh.c
26  *
27  * Moreover, if a device needs a special treatment by the SCSI
28  * subsystem it should be included in drivers/scsi/scsi_devinfo.c
29  */
30
31 #if 0
32         /*
33          * Copy this TEMPLATE to add new hardware.
34          *
35          * Keep only mandatory(.vendor and .product) and modified attributes.
36          * Attributes with default values must be removed.
37          * .vendor, .product, .revision and .bl_product are POSIX Extended regex.
38          *
39          * COMPANY_NAME
40          *
41          * Maintainer: NAME <email>
42          */
43         {
44                 /* Product Name */
45                 .vendor        = "VENDOR",
46                 .product       = "PRODUCT",
47                 .revision      = "REVISION",
48                 .bl_product    = "BL_PRODUCT",
49                 .pgpolicy      = FAILOVER,
50                 .uid_attribute = "ID_SERIAL",
51                 .selector      = "service-time 0",
52                 .checker_name  = TUR,
53                 .alias_prefix  = "mpath",
54                 .features      = "0",
55                 .hwhandler     = "0",
56                 .prio_name     = PRIO_CONST,
57                 .prio_args     = "",
58                 .pgfailback    = -FAILBACK_MANUAL,
59                 .rr_weight     = RR_WEIGHT_NONE,
60                 .no_path_retry = NO_PATH_RETRY_UNDEF,
61                 .minio         = 1000,
62                 .minio_rq      = 1,
63                 .flush_on_last_del = FLUSH_DISABLED,
64                 .user_friendly_names = USER_FRIENDLY_NAMES_OFF,
65                 .fast_io_fail  = 5,
66                 .dev_loss      = 600,
67                 .retain_hwhandler = RETAIN_HWHANDLER_ON,
68                 .detect_prio   = DETECT_PRIO_ON,
69                 .detect_checker = DETECT_CHECKER_ON,
70                 .deferred_remove = DEFERRED_REMOVE_OFF,
71                 .delay_watch_checks = DELAY_CHECKS_OFF,
72                 .delay_wait_checks = DELAY_CHECKS_OFF,
73                 .skip_kpartx   = SKIP_KPARTX_OFF,
74                 .max_sectors_kb = MAX_SECTORS_KB_UNDEF,
75                 .ghost_delay   = GHOST_DELAY_OFF,
76         },
77 #endif
78
79 static struct hwentry default_hw[] = {
80         /*
81          * Generic NVMe devices
82          *
83          * Due to the parsing logic in find_hwe(), generic entries
84          * have to be put on top of this list, and more specific ones
85          * below.
86          */
87         {
88                 /* Generic NVMe */
89                 .vendor        = "NVME",
90                 .product       = ".*",
91                 .uid_attribute = DEFAULT_NVME_UID_ATTRIBUTE,
92                 .checker_name  = NONE,
93                 .retain_hwhandler = RETAIN_HWHANDLER_OFF,
94         },
95         /*
96          * Apple
97          *
98          * Maintainer: Shyam Sundar <g.shyamsundar@yahoo.co.in>
99          */
100         {
101                 /* Xserve RAID */
102                 .vendor        = "APPLE",
103                 .product       = "Xserve RAID",
104                 .pgpolicy      = MULTIBUS,
105         },
106         /*
107          * HPE
108          */
109         {
110                 /* 3PAR */
111                 .vendor        = "3PARdata",
112                 .product       = "VV",
113                 .pgpolicy      = GROUP_BY_PRIO,
114                 .pgfailback    = -FAILBACK_IMMEDIATE,
115                 .hwhandler     = "1 alua",
116                 .prio_name     = PRIO_ALUA,
117                 .no_path_retry = 18,
118                 .fast_io_fail  = 10,
119                 .dev_loss      = MAX_DEV_LOSS_TMO,
120         },
121         {
122                 /* RA8000 / ESA12000 */
123                 .vendor        = "DEC",
124                 .product       = "HSG80",
125                 .no_path_retry = NO_PATH_RETRY_QUEUE,
126                 .hwhandler     = "1 hp_sw",
127                 .pgpolicy      = GROUP_BY_PRIO,
128                 .checker_name  = HP_SW,
129                 .prio_name     = PRIO_HP_SW,
130         },
131         {
132                 /* VIRTUAL ARRAY 7400 */
133                 .vendor        = "HP",
134                 .product       = "A6189A",
135                 .pgpolicy      = MULTIBUS,
136                 .no_path_retry = 12,
137         },
138         {
139                 /* MSA 1000/1500 and EVA 3000/5000, with old firmware */
140                 .vendor        = "(COMPAQ|HP)",
141                 .product       = "(MSA|HSV)1[01]0",
142                 .hwhandler     = "1 hp_sw",
143                 .pgpolicy      = GROUP_BY_PRIO,
144                 .no_path_retry = 12,
145                 .checker_name  = HP_SW,
146                 .prio_name     = PRIO_HP_SW,
147         },
148         {
149                 /* MSA 1000/1500 with new firmware */
150                 .vendor        = "(COMPAQ|HP)",
151                 .product       = "MSA VOLUME",
152                 .pgpolicy      = GROUP_BY_PRIO,
153                 .pgfailback    = -FAILBACK_IMMEDIATE,
154                 .no_path_retry = 12,
155                 .prio_name     = PRIO_ALUA,
156         },
157         {
158                 /* EVA 3000/5000 with new firmware, EVA 4000/6000/8000 */
159                 .vendor        = "(COMPAQ|HP)",
160                 .product       = "(HSV1[01]1|HSV2[01]0|HSV3[046]0|HSV4[05]0)",
161                 .pgpolicy      = GROUP_BY_PRIO,
162                 .pgfailback    = -FAILBACK_IMMEDIATE,
163                 .no_path_retry = 12,
164                 .prio_name     = PRIO_ALUA,
165         },
166         {
167                 /* MSA2000 family with old firmware */
168                 .vendor        = "HP",
169                 .product       = "(MSA2[02]12fc|MSA2012i)",
170                 .pgpolicy      = MULTIBUS,
171                 .no_path_retry = 18,
172         },
173         {
174                 /* MSA2000 family with new firmware */
175                 .vendor        = "HP",
176                 .product       = "(MSA2012sa|MSA23(12|24)(fc|i|sa)|MSA2000s VOLUME)",
177                 .pgpolicy      = GROUP_BY_PRIO,
178                 .pgfailback    = -FAILBACK_IMMEDIATE,
179                 .no_path_retry = 18,
180                 .prio_name     = PRIO_ALUA,
181         },
182         {
183                 /* MSA 1040, 1050, 2040 and 2050 families */
184                 .vendor        = "HP",
185                 .product       = "MSA [12]0[45]0 SA[NS]",
186                 .pgpolicy      = GROUP_BY_PRIO,
187                 .pgfailback    = -FAILBACK_IMMEDIATE,
188                 .no_path_retry = 18,
189                 .prio_name     = PRIO_ALUA,
190         },
191         {
192                 /* SAN Virtualization Services Platform */
193                 .vendor        = "HP",
194                 .product       = "HSVX700",
195                 .hwhandler     = "1 alua",
196                 .pgpolicy      = GROUP_BY_PRIO,
197                 .pgfailback    = -FAILBACK_IMMEDIATE,
198                 .no_path_retry = 12,
199                 .prio_name     = PRIO_ALUA,
200         },
201         {
202                 /* Smart Array */
203                 .vendor        = "HP",
204                 .product       = "LOGICAL VOLUME",
205                 .pgpolicy      = MULTIBUS,
206                 .no_path_retry = 12,
207         },
208         {
209                 /* P2000 family */
210                 .vendor        = "HP",
211                 .product       = "(P2000 G3 FC|P2000G3 FC/iSCSI|P2000 G3 SAS|P2000 G3 iSCSI)",
212                 .pgpolicy      = GROUP_BY_PRIO,
213                 .pgfailback    = -FAILBACK_IMMEDIATE,
214                 .no_path_retry = 18,
215                 .prio_name     = PRIO_ALUA,
216         },
217         {
218                 /* StoreVirtual 4000 and 3200 families */
219                 .vendor        = "LEFTHAND",
220                 .product       = "(P4000|iSCSIDisk|FCDISK)",
221                 .pgpolicy      = GROUP_BY_PRIO,
222                 .pgfailback    = -FAILBACK_IMMEDIATE,
223                 .no_path_retry = 18,
224                 .prio_name     = PRIO_ALUA,
225         },
226         {
227                 /* Nimble Storage */
228                 .vendor        = "Nimble",
229                 .product       = "Server",
230                 .hwhandler     = "1 alua",
231                 .pgpolicy      = GROUP_BY_PRIO,
232                 .pgfailback    = -FAILBACK_IMMEDIATE,
233                 .prio_name     = PRIO_ALUA,
234                 .no_path_retry = NO_PATH_RETRY_QUEUE,
235         },
236                 /* SGI */
237         {
238                 /* Total Performance 9100 */
239                 .vendor        = "SGI",
240                 .product       = "TP9100",
241                 .pgpolicy      = MULTIBUS,
242         },
243         {
244                 /* Total Performance family */
245                 .vendor        = "SGI",
246                 .product       = "TP9[3457]00",
247                 .bl_product    = "Universal Xport",
248                 .pgpolicy      = GROUP_BY_PRIO,
249                 .checker_name  = RDAC,
250                 .features      = "2 pg_init_retries 50",
251                 .hwhandler     = "1 rdac",
252                 .prio_name     = PRIO_RDAC,
253                 .pgfailback    = -FAILBACK_IMMEDIATE,
254                 .no_path_retry = 30,
255         },
256         {
257                 /* (RDAC) InfiniteStorage */
258                 .vendor        = "SGI",
259                 .product       = "IS",
260                 .bl_product    = "Universal Xport",
261                 .pgpolicy      = GROUP_BY_PRIO,
262                 .checker_name  = RDAC,
263                 .features      = "2 pg_init_retries 50",
264                 .hwhandler     = "1 rdac",
265                 .prio_name     = PRIO_RDAC,
266                 .pgfailback    = -FAILBACK_IMMEDIATE,
267                 .no_path_retry = 30,
268         },
269         {
270                 /* (DDN) InfiniteStorage */
271                 .vendor        = "SGI",
272                 .product       = "^DD[46]A-",
273                 .pgpolicy      = GROUP_BY_PRIO,
274                 .pgfailback    = -FAILBACK_IMMEDIATE,
275                 .prio_name     = PRIO_ALUA,
276                 .no_path_retry = 30,
277         },
278         /*
279          * DataDirect Networks
280          */
281         {
282                 /* SAN DataDirector */
283                 .vendor        = "DDN",
284                 .product       = "SAN DataDirector",
285                 .pgpolicy      = MULTIBUS,
286         },
287         {
288                 /* EF3010 */
289                 .vendor        = "DDN",
290                 .product       = "^EF3010",
291                 .pgpolicy      = MULTIBUS,
292                 .no_path_retry = 30,
293         },
294         {
295                 /* EF3015 / S2A and SFA families */
296                 .vendor        = "DDN",
297                 .product       = "^(EF3015|S2A|SFA)",
298                 .pgpolicy      = GROUP_BY_PRIO,
299                 .pgfailback    = -FAILBACK_IMMEDIATE,
300                 .prio_name     = PRIO_ALUA,
301                 .no_path_retry = 30,
302         },
303         {
304                 /*
305                  * Nexenta COMSTAR
306                  *
307                  * Maintainer: Yacine Kheddache <yacine@alyseo.com>
308                  */
309                 .vendor        = "NEXENTA",
310                 .product       = "COMSTAR",
311                 .pgpolicy      = GROUP_BY_SERIAL,
312                 .no_path_retry = 30,
313         },
314         /*
315          * Dell EMC
316          */
317         {
318                 /* Symmetrix / DMX / VMAX / PowerMax */
319                 .vendor        = "EMC",
320                 .product       = "SYMMETRIX",
321                 .pgpolicy      = MULTIBUS,
322                 .no_path_retry = 6,
323         },
324         {
325                 /* DGC CLARiiON CX/AX / VNX and Unity */
326                 .vendor        = "^DGC",
327                 .product       = "^(RAID|DISK|VRAID)",
328                 .bl_product    = "LUNZ",
329                 .hwhandler     = "1 emc",
330                 .pgpolicy      = GROUP_BY_PRIO,
331                 .pgfailback    = -FAILBACK_IMMEDIATE,
332                 .no_path_retry = (300 / DEFAULT_CHECKINT),
333                 .checker_name  = EMC_CLARIION,
334                 .prio_name     = PRIO_EMC,
335         },
336         {
337                 /* Invista / VPLEX */
338                 .vendor        = "EMC",
339                 .product       = "Invista",
340                 .bl_product    = "LUNZ",
341                 .pgpolicy      = MULTIBUS,
342                 .no_path_retry = 5,
343         },
344         {
345                 /* XtremIO */
346                 .vendor        = "XtremIO",
347                 .product       = "XtremApp",
348                 .pgpolicy      = MULTIBUS,
349         },
350         {
351                 /*
352                  * SC Series, formerly Compellent
353                  *
354                  * Maintainer: Sean McGinnis <sean_mcginnis@dell.com>
355                  */
356                 .vendor        = "COMPELNT",
357                 .product       = "Compellent Vol",
358                 .pgpolicy      = MULTIBUS,
359                 .no_path_retry = NO_PATH_RETRY_QUEUE,
360         },
361         {
362                 /* MD Series */
363                 .vendor        = "DELL",
364                 .product       = "^MD3",
365                 .bl_product    = "Universal Xport",
366                 .pgpolicy      = GROUP_BY_PRIO,
367                 .checker_name  = RDAC,
368                 .features      = "2 pg_init_retries 50",
369                 .hwhandler     = "1 rdac",
370                 .prio_name     = PRIO_RDAC,
371                 .pgfailback    = -FAILBACK_IMMEDIATE,
372                 .no_path_retry = 30,
373         },
374         {
375                 /* EMC PowerMax NVMe */
376                 .vendor        = "NVME",
377                 .product       = "^EMC PowerMax_",
378                 .pgpolicy      = MULTIBUS,
379         },
380         /*
381          * Fujitsu
382          */
383         {
384                 /* CentricStor Virtual Tape */
385                 .vendor        = "FSC",
386                 .product       = "CentricStor",
387                 .pgpolicy      = GROUP_BY_SERIAL,
388         },
389         {
390                 /* ETERNUS family */
391                 .vendor        = "FUJITSU",
392                 .product       = "ETERNUS_DX(H|L|M|400|8000)",
393                 .pgpolicy      = GROUP_BY_PRIO,
394                 .pgfailback    = -FAILBACK_IMMEDIATE,
395                 .no_path_retry = 10,
396                 .prio_name     = PRIO_ALUA,
397         },
398         {
399                 /* FibreCAT S80 */
400                 .vendor        = "(EUROLOGC|EuroLogc)",
401                 .product       = "FC2502",
402                 .pgpolicy      = MULTIBUS,
403         },
404         {
405                 /* ETERNUS 2000, 3000 and 4000 */
406                 .vendor        = "FUJITSU",
407                 .product       = "E[234]000",
408                 .pgpolicy      = GROUP_BY_PRIO,
409                 .pgfailback    = -FAILBACK_IMMEDIATE,
410                 .no_path_retry = 10,
411                 .prio_name     = PRIO_ALUA,
412         },
413         {
414                 /* ETERNUS 6000 and 8000 */
415                 .vendor        = "FUJITSU",
416                 .product       = "E[68]000",
417                 .pgpolicy      = MULTIBUS,
418                 .no_path_retry = 10,
419         },
420         /*
421          * Hitachi Vantara
422          *
423          * Maintainer: Matthias Rudolph <Matthias.Rudolph@hitachivantara.com>
424          */
425         {
426                 /* USP-V, HUS VM, VSP, VSP G1X00 and VSP GX00 families / HP XP */
427                 .vendor        = "(HITACHI|HP)",
428                 .product       = "^OPEN-",
429                 .pgpolicy      = MULTIBUS,
430         },
431         {
432                 /* AMS other than AMS 2000 */
433                 .vendor        = "HITACHI",
434                 .product       = "^DF",
435                 .no_path_retry = NO_PATH_RETRY_QUEUE,
436                 .pgpolicy      = GROUP_BY_PRIO,
437                 .pgfailback    = -FAILBACK_IMMEDIATE,
438                 .prio_name     = PRIO_HDS,
439         },
440         {
441                 /* AMS 2000 and HUS 100 families */
442                 .vendor        = "HITACHI",
443                 .product       = "^DF600F",
444                 .pgpolicy      = MULTIBUS,
445         },
446         /*
447          * IBM
448          *
449          * Maintainer: Hannes Reinecke <hare@suse.de>
450          */
451         {
452                 /* ProFibre 4000R */
453                 .vendor        = "IBM",
454                 .product       = "ProFibre 4000R",
455                 .pgpolicy      = MULTIBUS,
456         },
457         {
458                 /* DS4300 / FAStT600 */
459                 .vendor        = "IBM",
460                 .product       = "^1722-600",
461                 .bl_product    = "Universal Xport",
462                 .pgpolicy      = GROUP_BY_PRIO,
463                 .checker_name  = RDAC,
464                 .features      = "2 pg_init_retries 50",
465                 .hwhandler     = "1 rdac",
466                 .prio_name     = PRIO_RDAC,
467                 .pgfailback    = -FAILBACK_IMMEDIATE,
468                 .no_path_retry = 30,
469         },
470         {
471                 /* DS4100 / FAStT100 */
472                 .vendor        = "IBM",
473                 .product       = "^1724",
474                 .bl_product    = "Universal Xport",
475                 .pgpolicy      = GROUP_BY_PRIO,
476                 .checker_name  = RDAC,
477                 .features      = "2 pg_init_retries 50",
478                 .hwhandler     = "1 rdac",
479                 .prio_name     = PRIO_RDAC,
480                 .pgfailback    = -FAILBACK_IMMEDIATE,
481                 .no_path_retry = 30,
482         },
483         {
484                 /* DS3000 / DS3200 / DS3300 / DS3400 / Boot DS */
485                 .vendor        = "IBM",
486                 .product       = "^1726",
487                 .bl_product    = "Universal Xport",
488                 .pgpolicy      = GROUP_BY_PRIO,
489                 .checker_name  = RDAC,
490                 .features      = "2 pg_init_retries 50",
491                 .hwhandler     = "1 rdac",
492                 .prio_name     = PRIO_RDAC,
493                 .pgfailback    = -FAILBACK_IMMEDIATE,
494                 .no_path_retry = 30,
495         },
496         {
497                 /* DS4400 / DS4500 / FAStT700 / FAStT900 */
498                 .vendor        = "IBM",
499                 .product       = "^1742",
500                 .bl_product    = "Universal Xport",
501                 .pgpolicy      = GROUP_BY_PRIO,
502                 .checker_name  = RDAC,
503                 .features      = "2 pg_init_retries 50",
504                 .hwhandler     = "1 rdac",
505                 .prio_name     = PRIO_RDAC,
506                 .pgfailback    = -FAILBACK_IMMEDIATE,
507                 .no_path_retry = 30,
508         },
509         {
510                 /* DS3500 / DS3512 / DS3524 */
511                 .vendor        = "IBM",
512                 .product       = "^1746",
513                 .bl_product    = "Universal Xport",
514                 .pgpolicy      = GROUP_BY_PRIO,
515                 .checker_name  = RDAC,
516                 .features      = "2 pg_init_retries 50",
517                 .hwhandler     = "1 rdac",
518                 .prio_name     = PRIO_RDAC,
519                 .pgfailback    = -FAILBACK_IMMEDIATE,
520                 .no_path_retry = 30,
521         },
522         {
523                 /* DCS3860 */
524                 .vendor        = "IBM",
525                 .product       = "^1813",
526                 .bl_product    = "Universal Xport",
527                 .pgpolicy      = GROUP_BY_PRIO,
528                 .checker_name  = RDAC,
529                 .features      = "2 pg_init_retries 50",
530                 .hwhandler     = "1 rdac",
531                 .prio_name     = PRIO_RDAC,
532                 .pgfailback    = -FAILBACK_IMMEDIATE,
533                 .no_path_retry = 30,
534         },
535         {
536                 /* DS3950 / DS4200 / DS4700 / DS5020 */
537                 .vendor        = "IBM",
538                 .product       = "^1814",
539                 .bl_product    = "Universal Xport",
540                 .pgpolicy      = GROUP_BY_PRIO,
541                 .checker_name  = RDAC,
542                 .features      = "2 pg_init_retries 50",
543                 .hwhandler     = "1 rdac",
544                 .prio_name     = PRIO_RDAC,
545                 .pgfailback    = -FAILBACK_IMMEDIATE,
546                 .no_path_retry = 30,
547         },
548         {
549                 /* DS4800 */
550                 .vendor        = "IBM",
551                 .product       = "^1815",
552                 .bl_product    = "Universal Xport",
553                 .pgpolicy      = GROUP_BY_PRIO,
554                 .checker_name  = RDAC,
555                 .features      = "2 pg_init_retries 50",
556                 .hwhandler     = "1 rdac",
557                 .prio_name     = PRIO_RDAC,
558                 .pgfailback    = -FAILBACK_IMMEDIATE,
559                 .no_path_retry = 30,
560         },
561         {
562                 /* DS5000 / DS5100 / DS5300 / DCS3700 */
563                 .vendor        = "IBM",
564                 .product       = "^1818",
565                 .bl_product    = "Universal Xport",
566                 .pgpolicy      = GROUP_BY_PRIO,
567                 .checker_name  = RDAC,
568                 .features      = "2 pg_init_retries 50",
569                 .hwhandler     = "1 rdac",
570                 .prio_name     = PRIO_RDAC,
571                 .pgfailback    = -FAILBACK_IMMEDIATE,
572                 .no_path_retry = 30,
573         },
574         {
575                 /* Netfinity Fibre Channel RAID Controller Unit */
576                 .vendor        = "IBM",
577                 .product       = "^3526",
578                 .bl_product    = "Universal Xport",
579                 .pgpolicy      = GROUP_BY_PRIO,
580                 .checker_name  = RDAC,
581                 .features      = "2 pg_init_retries 50",
582                 .hwhandler     = "1 rdac",
583                 .prio_name     = PRIO_RDAC,
584                 .pgfailback    = -FAILBACK_IMMEDIATE,
585                 .no_path_retry = 30,
586         },
587         {
588                 /* FAStT200 and FAStT500 */
589                 .vendor        = "IBM",
590                 .product       = "^(3542|3552)",
591                 .bl_product    = "Universal Xport",
592                 .pgpolicy      = GROUP_BY_PRIO,
593                 .checker_name  = RDAC,
594                 .features      = "2 pg_init_retries 50",
595                 .hwhandler     = "1 rdac",
596                 .prio_name     = PRIO_RDAC,
597                 .pgfailback    = -FAILBACK_IMMEDIATE,
598                 .no_path_retry = 30,
599         },
600         {
601                 /* Enterprise Storage Server(ESS) / Shark family */
602                 .vendor        = "IBM",
603                 .product       = "^2105",
604                 .no_path_retry = NO_PATH_RETRY_QUEUE,
605                 .pgpolicy      = MULTIBUS,
606         },
607         {
608                 /* DS6000 / DS6800 */
609                 .vendor        = "IBM",
610                 .product       = "^1750500",
611                 .no_path_retry = NO_PATH_RETRY_QUEUE,
612                 .pgpolicy      = GROUP_BY_PRIO,
613                 .pgfailback    = -FAILBACK_IMMEDIATE,
614                 .prio_name     = PRIO_ALUA,
615         },
616         {
617                 /* DS8000 family */
618                 .vendor        = "IBM",
619                 .product       = "^2107900",
620                 .no_path_retry = NO_PATH_RETRY_QUEUE,
621                 .pgpolicy      = MULTIBUS,
622         },
623         {
624                 /* Storwize family / SAN Volume Controller / Flex System V7000 / FlashSystem V840/V9000/9100 */
625                 .vendor        = "IBM",
626                 .product       = "^2145",
627                 .no_path_retry = NO_PATH_RETRY_QUEUE,
628                 .pgpolicy      = GROUP_BY_PRIO,
629                 .pgfailback    = -FAILBACK_IMMEDIATE,
630                 .prio_name     = PRIO_ALUA,
631         },
632         {
633                 /* PAV DASD ECKD */
634                 .vendor        = "IBM",
635                 .product       = "S/390 DASD ECKD",
636                 .bl_product    = "S/390",
637                 .uid_attribute = "ID_UID",
638                 .no_path_retry = NO_PATH_RETRY_QUEUE,
639                 .pgpolicy      = MULTIBUS,
640                 .checker_name  = DIRECTIO,
641         },
642         {
643                 /* PAV DASD FBA */
644                 .vendor        = "IBM",
645                 .product       = "S/390 DASD FBA",
646                 .bl_product    = "S/390",
647                 .uid_attribute = "ID_UID",
648                 .no_path_retry = NO_PATH_RETRY_QUEUE,
649                 .pgpolicy      = MULTIBUS,
650                 .checker_name  = DIRECTIO,
651         },
652         {
653                 /* Power RAID */
654                 .vendor        = "IBM",
655                 .product       = "^IPR",
656                 .no_path_retry = NO_PATH_RETRY_QUEUE,
657                 .hwhandler     = "1 alua",
658                 .pgpolicy      = GROUP_BY_PRIO,
659                 .pgfailback    = -FAILBACK_IMMEDIATE,
660                 .prio_name     = PRIO_ALUA,
661         },
662         {
663                 /* SAS RAID Controller Module (RSSM) */
664                 .vendor        = "IBM",
665                 .product       = "1820N00",
666                 .pgpolicy      = GROUP_BY_PRIO,
667                 .pgfailback    = -FAILBACK_IMMEDIATE,
668                 .no_path_retry = NO_PATH_RETRY_QUEUE,
669                 .prio_name     = PRIO_ALUA,
670         },
671         {
672                 /* XIV Storage System / FlashSystem A9000/A9000R */
673                 .vendor        = "(XIV|IBM)",
674                 .product       = "(NEXTRA|2810XIV)",
675                 .no_path_retry = NO_PATH_RETRY_QUEUE,
676                 .pgpolicy      = MULTIBUS,
677         },
678         {
679                 /* TMS RamSan / FlashSystem 710/720/810/820/840/900 */
680                 .vendor        = "(TMS|IBM)",
681                 .product       = "(RamSan|FlashSystem)",
682                 .pgpolicy      = MULTIBUS,
683         },
684         {
685                 /* (DDN) DCS9900, SONAS 2851-DR1 */
686                 .vendor        = "IBM",
687                 .product       = "^(DCS9900|2851)",
688                 .pgpolicy      = GROUP_BY_PRIO,
689                 .pgfailback    = -FAILBACK_IMMEDIATE,
690                 .prio_name     = PRIO_ALUA,
691                 .no_path_retry = 30,
692         },
693                 /*
694                  * IBM Power Virtual SCSI Devices
695                  *
696                  * Maintainer: Brian King <brking@linux.vnet.ibm.com>
697                  */
698         {
699                 /* AIX VDASD */
700                 .vendor        = "AIX",
701                 .product       = "VDASD",
702                 .pgpolicy      = MULTIBUS,
703                 .no_path_retry = (300 / DEFAULT_CHECKINT),
704         },
705         {
706                 /* 3303 NVDISK */
707                 .vendor        = "IBM",
708                 .product       = "3303[ ]+NVDISK",
709                 .no_path_retry = (300 / DEFAULT_CHECKINT),
710         },
711         {
712                 /* AIX NVDISK */
713                 .vendor        = "AIX",
714                 .product       = "NVDISK",
715                 .hwhandler     = "1 alua",
716                 .pgpolicy      = GROUP_BY_PRIO,
717                 .pgfailback    = -FAILBACK_IMMEDIATE,
718                 .no_path_retry = (300 / DEFAULT_CHECKINT),
719                 .prio_name     = PRIO_ALUA,
720         },
721         /*
722          * Lenovo
723          */
724         {
725                 /*
726                  * DE Series
727                  *
728                  * Maintainer: NetApp RDAC team <ng-eseries-upstream-maintainers@netapp.com>
729                  */
730                 .vendor        = "LENOVO",
731                 .product       = "DE_Series",
732                 .bl_product    = "Universal Xport",
733                 .pgpolicy      = GROUP_BY_PRIO,
734                 .checker_name  = RDAC,
735                 .features      = "2 pg_init_retries 50",
736                 .hwhandler     = "1 rdac",
737                 .prio_name     = PRIO_RDAC,
738                 .pgfailback    = -FAILBACK_IMMEDIATE,
739                 .no_path_retry = 30,
740         },
741         /*
742          * NetApp
743          */
744         {
745                 /*
746                  * ONTAP family
747                  *
748                  * Maintainer: Martin George <marting@netapp.com>
749                  */
750                 .vendor        = "NETAPP",
751                 .product       = "LUN",
752                 .features      = "2 pg_init_retries 50",
753                 .no_path_retry = NO_PATH_RETRY_QUEUE,
754                 .pgpolicy      = GROUP_BY_PRIO,
755                 .pgfailback    = -FAILBACK_IMMEDIATE,
756                 .flush_on_last_del = FLUSH_ENABLED,
757                 .dev_loss      = MAX_DEV_LOSS_TMO,
758                 .prio_name     = PRIO_ONTAP,
759                 .user_friendly_names = USER_FRIENDLY_NAMES_OFF,
760         },
761         {
762                 /*
763                  * SANtricity(RDAC) family
764                  *
765                  * Maintainer: NetApp RDAC team <ng-eseries-upstream-maintainers@netapp.com>
766                  */
767                 .vendor        = "(NETAPP|LSI|ENGENIO)",
768                 .product       = "INF-01-00",
769                 .bl_product    = "Universal Xport",
770                 .pgpolicy      = GROUP_BY_PRIO,
771                 .checker_name  = RDAC,
772                 .features      = "2 pg_init_retries 50",
773                 .hwhandler     = "1 rdac",
774                 .prio_name     = PRIO_RDAC,
775                 .pgfailback    = -FAILBACK_IMMEDIATE,
776                 .no_path_retry = 30,
777         },
778         {
779                 /*
780                  * SolidFir family
781                  *
782                  * Maintainer: PJ Waskiewicz <pj.waskiewicz@netapp.com>
783                  */
784                 .vendor        = "SolidFir",
785                 .product       = "SSD SAN",
786                 .pgpolicy      = MULTIBUS,
787                 .no_path_retry = 24,
788         },
789         {
790                 /*
791                  * NVMe-FC namespace devices: MULTIBUS, queueing preferred
792                  *
793                  * The hwtable is searched backwards, so place this after "Generic NVMe"
794                  */
795                 .vendor        = "NVME",
796                 .product       = "^NetApp ONTAP Controller",
797                 .pgpolicy      = MULTIBUS,
798                 .no_path_retry = NO_PATH_RETRY_QUEUE,
799         },
800         /*
801          * NEC
802          */
803         {
804                 /* M-Series */
805                 .vendor        = "NEC",
806                 .product       = "DISK ARRAY",
807                 .hwhandler     = "1 alua",
808                 .pgpolicy      = GROUP_BY_PRIO,
809                 .pgfailback    = -FAILBACK_IMMEDIATE,
810                 .prio_name     = PRIO_ALUA,
811         },
812         /*
813          * Oracle
814          */
815                 /*
816                  * Pillar Data / Oracle FS
817                  *
818                  * Maintainer: Srinivasan Ramani <srinivas.ramani@oracle.com>
819                  */
820         {
821                 /* Axiom */
822                 .vendor        = "^Pillar",
823                 .product       = "^Axiom",
824                 .pgpolicy      = GROUP_BY_PRIO,
825                 .pgfailback    = -FAILBACK_IMMEDIATE,
826                 .prio_name     = PRIO_ALUA,
827         },
828         {
829                 /* FS */
830                 .vendor        = "^Oracle",
831                 .product       = "^Oracle FS",
832                 .pgpolicy      = GROUP_BY_PRIO,
833                 .pgfailback    = -FAILBACK_IMMEDIATE,
834                 .prio_name     = PRIO_ALUA,
835         },
836                 /* Sun - StorageTek */
837         {
838                 /* B210, B220, B240 and B280 */
839                 .vendor        = "STK",
840                 .product       = "BladeCtlr",
841                 .bl_product    = "Universal Xport",
842                 .pgpolicy      = GROUP_BY_PRIO,
843                 .checker_name  = RDAC,
844                 .features      = "2 pg_init_retries 50",
845                 .hwhandler     = "1 rdac",
846                 .prio_name     = PRIO_RDAC,
847                 .pgfailback    = -FAILBACK_IMMEDIATE,
848                 .no_path_retry = 30,
849         },
850         {
851                 /* 9176, D173, D178, D210, D220, D240 and D280 */
852                 .vendor        = "STK",
853                 .product       = "OPENstorage",
854                 .bl_product    = "Universal Xport",
855                 .pgpolicy      = GROUP_BY_PRIO,
856                 .checker_name  = RDAC,
857                 .features      = "2 pg_init_retries 50",
858                 .hwhandler     = "1 rdac",
859                 .prio_name     = PRIO_RDAC,
860                 .pgfailback    = -FAILBACK_IMMEDIATE,
861                 .no_path_retry = 30,
862         },
863         {
864                 /* 6540 */
865                 .vendor        = "STK",
866                 .product       = "FLEXLINE 380",
867                 .bl_product    = "Universal Xport",
868                 .pgpolicy      = GROUP_BY_PRIO,
869                 .checker_name  = RDAC,
870                 .features      = "2 pg_init_retries 50",
871                 .hwhandler     = "1 rdac",
872                 .prio_name     = PRIO_RDAC,
873                 .pgfailback    = -FAILBACK_IMMEDIATE,
874                 .no_path_retry = 30,
875         },
876         {
877                 /* (Dot Hill) 3120, 3310, 3320, 3510 and 3511 */
878                 .vendor        = "SUN",
879                 .product       = "StorEdge 3",
880                 .pgpolicy      = MULTIBUS,
881         },
882         {
883                 /* 6580 and 6780 */
884                 .vendor        = "SUN",
885                 .product       = "STK6580_6780",
886                 .bl_product    = "Universal Xport",
887                 .pgpolicy      = GROUP_BY_PRIO,
888                 .checker_name  = RDAC,
889                 .features      = "2 pg_init_retries 50",
890                 .hwhandler     = "1 rdac",
891                 .prio_name     = PRIO_RDAC,
892                 .pgfailback    = -FAILBACK_IMMEDIATE,
893                 .no_path_retry = 30,
894         },
895         {
896                 /* 6130 / 6140 */
897                 .vendor        = "SUN",
898                 .product       = "CSM[12]00_R",
899                 .bl_product    = "Universal Xport",
900                 .pgpolicy      = GROUP_BY_PRIO,
901                 .checker_name  = RDAC,
902                 .features      = "2 pg_init_retries 50",
903                 .hwhandler     = "1 rdac",
904                 .prio_name     = PRIO_RDAC,
905                 .pgfailback    = -FAILBACK_IMMEDIATE,
906                 .no_path_retry = 30,
907         },
908         {
909                 /* 2500 / 2510 / 2530 / 2540 */
910                 .vendor        = "SUN",
911                 .product       = "LCSM100_[IEFS]",
912                 .bl_product    = "Universal Xport",
913                 .pgpolicy      = GROUP_BY_PRIO,
914                 .checker_name  = RDAC,
915                 .features      = "2 pg_init_retries 50",
916                 .hwhandler     = "1 rdac",
917                 .prio_name     = PRIO_RDAC,
918                 .pgfailback    = -FAILBACK_IMMEDIATE,
919                 .no_path_retry = 30,
920         },
921         {
922                 /* 6180 */
923                 .vendor        = "SUN",
924                 .product       = "SUN_6180",
925                 .bl_product    = "Universal Xport",
926                 .pgpolicy      = GROUP_BY_PRIO,
927                 .checker_name  = RDAC,
928                 .features      = "2 pg_init_retries 50",
929                 .hwhandler     = "1 rdac",
930                 .prio_name     = PRIO_RDAC,
931                 .pgfailback    = -FAILBACK_IMMEDIATE,
932                 .no_path_retry = 30,
933         },
934         {
935                 /* ArrayStorage */
936                 .vendor        = "SUN",
937                 .product       = "ArrayStorage",
938                 .bl_product    = "Universal Xport",
939                 .pgpolicy      = GROUP_BY_PRIO,
940                 .checker_name  = RDAC,
941                 .features      = "2 pg_init_retries 50",
942                 .hwhandler     = "1 rdac",
943                 .prio_name     = PRIO_RDAC,
944                 .pgfailback    = -FAILBACK_IMMEDIATE,
945                 .no_path_retry = 30,
946         },
947         {
948                 /* ZFS Storage Appliances */
949                 .vendor        = "SUN",
950                 .product       = "(Sun Storage|ZFS Storage|COMSTAR)",
951                 .pgpolicy      = GROUP_BY_PRIO,
952                 .pgfailback    = -FAILBACK_IMMEDIATE,
953                 .prio_name     = PRIO_ALUA,
954                 .no_path_retry = 30,
955         },
956         /*
957          * Pivot3
958          *
959          * Maintainer: Bart Brooks <bartb@pivot3.com>
960          */
961         {
962                 /* Raige */
963                 .vendor        = "PIVOT3",
964                 .product       = "RAIGE VOLUME",
965                 .no_path_retry = NO_PATH_RETRY_QUEUE,
966                 .pgpolicy      = MULTIBUS,
967         },
968         {
969                 /* NexGen / vSTAC */
970                 .vendor        = "(NexGen|Pivot3)",
971                 .product       = "(TierStore|vSTAC)",
972                 .pgpolicy      = GROUP_BY_PRIO,
973                 .pgfailback    = -FAILBACK_IMMEDIATE,
974                 .prio_name     = PRIO_ALUA,
975                 .no_path_retry = NO_PATH_RETRY_QUEUE,
976         },
977         /*
978          * Intel
979          */
980         {
981                 /* Multi-Flex */
982                 .vendor        = "(Intel|INTEL)",
983                 .product       = "Multi-Flex",
984                 .bl_product    = "VTrak V-LUN",
985                 .hwhandler     = "1 alua",
986                 .pgpolicy      = GROUP_BY_PRIO,
987                 .pgfailback    = -FAILBACK_IMMEDIATE,
988                 .no_path_retry = NO_PATH_RETRY_QUEUE,
989                 .prio_name     = PRIO_ALUA,
990         },
991         /*
992          * Linux-IO Target
993          */
994         {
995                 /* Linux-IO Target */
996                 .vendor        = "(LIO-ORG|SUSE)",
997                 .product       = "RBD",
998                 .hwhandler     = "1 alua",
999                 .pgpolicy      = GROUP_BY_PRIO,
1000                 .pgfailback    = -FAILBACK_IMMEDIATE,
1001                 .no_path_retry = 12,
1002                 .prio_name     = PRIO_ALUA,
1003         },
1004         /*
1005          * DataCore
1006          */
1007         {
1008                 /* SANmelody */
1009                 .vendor        = "DataCore",
1010                 .product       = "SANmelody",
1011                 .pgpolicy      = GROUP_BY_PRIO,
1012                 .pgfailback    = -FAILBACK_IMMEDIATE,
1013                 .no_path_retry = NO_PATH_RETRY_QUEUE,
1014                 .prio_name     = PRIO_ALUA,
1015         },
1016         {
1017                 /* SANsymphony */
1018                 .vendor        = "DataCore",
1019                 .product       = "Virtual Disk",
1020                 .pgpolicy      = GROUP_BY_PRIO,
1021                 .pgfailback    = -FAILBACK_IMMEDIATE,
1022                 .no_path_retry = NO_PATH_RETRY_QUEUE,
1023                 .prio_name     = PRIO_ALUA,
1024         },
1025         /*
1026          * Pure Storage
1027          */
1028         {
1029                 /* FlashArray */
1030                 .vendor        = "PURE",
1031                 .product       = "FlashArray",
1032                 .pgpolicy      = MULTIBUS,
1033         },
1034         /*
1035          * Huawei
1036          */
1037         {
1038                 /* OceanStor V3 */
1039                 .vendor        = "HUAWEI",
1040                 .product       = "XSG1",
1041                 .pgpolicy      = GROUP_BY_PRIO,
1042                 .prio_name     = PRIO_ALUA,
1043         },
1044         /*
1045          * Kove
1046          */
1047         {
1048                 /* XPD */
1049                 .vendor        = "KOVE",
1050                 .product       = "XPD",
1051                 .pgpolicy      = MULTIBUS,
1052         },
1053         /*
1054          * Infinidat
1055          *
1056          * Maintainer: Arnon Yaari <arnony@infinidat.com>
1057          */
1058         {
1059                 /* InfiniBox */
1060                 .vendor        = "NFINIDAT",
1061                 .product       = "InfiniBox",
1062                 .pgpolicy      = GROUP_BY_PRIO,
1063                 .pgfailback    = 30,
1064                 .prio_name     = PRIO_ALUA,
1065                 .selector      = "round-robin 0",
1066                 .rr_weight     = RR_WEIGHT_PRIO,
1067                 .no_path_retry = NO_PATH_RETRY_FAIL,
1068                 .minio         = 1,
1069                 .minio_rq      = 1,
1070                 .flush_on_last_del = FLUSH_ENABLED,
1071                 .fast_io_fail  = 15,
1072                 .dev_loss      = 15,
1073         },
1074         /*
1075          * Kaminario
1076          */
1077         {
1078                 /* K2 */
1079                 .vendor        = "KMNRIO",
1080                 .product       = "K2",
1081                 .pgpolicy      = MULTIBUS,
1082         },
1083         /*
1084          * Western Digital (Tegile Systems)
1085          */
1086         {
1087                 /* IntelliFlash */
1088                 .vendor        = "TEGILE",
1089                 .product       = "(ZEBI-(FC|ISCSI)|INTELLIFLASH)",
1090                 .hwhandler     = "1 alua",
1091                 .pgpolicy      = GROUP_BY_PRIO,
1092                 .pgfailback    = -FAILBACK_IMMEDIATE,
1093                 .prio_name     = PRIO_ALUA,
1094                 .no_path_retry = 10,
1095         },
1096         /*
1097          * Imation/Nexsan
1098          */
1099         {
1100                 /* E-Series */
1101                 .vendor        = "NEXSAN",
1102                 .product       = "NXS-B0",
1103                 .pgpolicy      = GROUP_BY_PRIO,
1104                 .pgfailback    = -FAILBACK_IMMEDIATE,
1105                 .prio_name     = PRIO_ALUA,
1106                 .no_path_retry = 15,
1107         },
1108         {
1109                 /* SATABeast / SATABoy */
1110                 .vendor        = "NEXSAN",
1111                 .product       = "SATAB",
1112                 .pgpolicy      = GROUP_BY_PRIO,
1113                 .pgfailback    = -FAILBACK_IMMEDIATE,
1114                 .prio_name     = PRIO_ALUA,
1115                 .no_path_retry = 15,
1116         },
1117         {
1118                 /* NST / UNITY */
1119                 .vendor        = "Nexsan",
1120                 .product       = "(NestOS|NST5000)",
1121                 .hwhandler     = "1 alua",
1122                 .pgpolicy      = GROUP_BY_PRIO,
1123                 .pgfailback    = -FAILBACK_IMMEDIATE,
1124                 .prio_name     = PRIO_ALUA,
1125                 .no_path_retry = 30,
1126         },
1127         /*
1128          * Violin Systems
1129          */
1130         {
1131                 /* 3000 / 6000 Series */
1132                 .vendor        = "VIOLIN",
1133                 .product       = "SAN ARRAY$",
1134                 .pgpolicy      = GROUP_BY_SERIAL,
1135                 .no_path_retry = 30,
1136         },
1137         {
1138                 /* 3000 / 6000 Series - ALUA mode */
1139                 .vendor        = "VIOLIN",
1140                 .product       = "SAN ARRAY ALUA",
1141                 .hwhandler     = "1 alua",
1142                 .pgpolicy      = GROUP_BY_PRIO,
1143                 .pgfailback    = -FAILBACK_IMMEDIATE,
1144                 .prio_name     = PRIO_ALUA,
1145                 .no_path_retry = 30,
1146         },
1147         {
1148                 /* FSP 7000 family */
1149                 .vendor        = "VIOLIN",
1150                 .product       = "CONCERTO ARRAY",
1151                 .pgpolicy      = MULTIBUS,
1152                 .no_path_retry = 30,
1153         },
1154                 /* Xiotech */
1155         {
1156                 /* Intelligent Storage Elements family */
1157                 .vendor        = "(XIOTECH|XIOtech)",
1158                 .product       = "ISE",
1159                 .pgpolicy      = MULTIBUS,
1160                 .no_path_retry = 12,
1161         },
1162         {
1163                 /* iglu blaze family */
1164                 .vendor        = "(XIOTECH|XIOtech)",
1165                 .product       = "IGLU DISK",
1166                 .pgpolicy      = MULTIBUS,
1167                 .no_path_retry = 30,
1168         },
1169         {
1170                 /* Magnitude family */
1171                 .vendor        = "(XIOTECH|XIOtech)",
1172                 .product       = "Magnitude",
1173                 .pgpolicy      = MULTIBUS,
1174                 .no_path_retry = 30,
1175         },
1176         /*
1177          * Promise Technology
1178          */
1179         {
1180                 /* VTrak family */
1181                 .vendor        = "Promise",
1182                 .product       = "VTrak",
1183                 .bl_product    = "VTrak V-LUN",
1184                 .hwhandler     = "1 alua",
1185                 .pgpolicy      = GROUP_BY_PRIO,
1186                 .pgfailback    = -FAILBACK_IMMEDIATE,
1187                 .prio_name     = PRIO_ALUA,
1188                 .no_path_retry = 30,
1189         },
1190         {
1191                 /* Vess family */
1192                 .vendor        = "Promise",
1193                 .product       = "Vess",
1194                 .bl_product    = "Vess V-LUN",
1195                 .hwhandler     = "1 alua",
1196                 .pgpolicy      = GROUP_BY_PRIO,
1197                 .pgfailback    = -FAILBACK_IMMEDIATE,
1198                 .prio_name     = PRIO_ALUA,
1199                 .no_path_retry = 30,
1200         },
1201         /*
1202          * Infortrend Technology
1203          */
1204         {
1205                 /* EonStor / ESVA */
1206                 .vendor        = "^IFT",
1207                 .product       = ".*",
1208                 .pgpolicy      = GROUP_BY_PRIO,
1209                 .pgfailback    = -FAILBACK_IMMEDIATE,
1210                 .prio_name     = PRIO_ALUA,
1211                 .no_path_retry = 30,
1212         },
1213         /*
1214          * Seagate Technology (Dot Hill Systems)
1215          */
1216         {
1217                 /* SANnet family */
1218                 .vendor        = "DotHill",
1219                 .product       = "SANnet",
1220                 .pgpolicy      = MULTIBUS,
1221                 .no_path_retry = 30,
1222         },
1223         {
1224                 /* R/Evolution family */
1225                 .vendor        = "DotHill",
1226                 .product       = "R/Evo",
1227                 .pgpolicy      = GROUP_BY_PRIO,
1228                 .pgfailback    = -FAILBACK_IMMEDIATE,
1229                 .prio_name     = PRIO_ALUA,
1230                 .no_path_retry = 30,
1231         },
1232         {
1233                 /* AssuredSAN family */
1234                 .vendor        = "DotHill",
1235                 .product       = "^DH",
1236                 .pgpolicy      = GROUP_BY_PRIO,
1237                 .pgfailback    = -FAILBACK_IMMEDIATE,
1238                 .prio_name     = PRIO_ALUA,
1239                 .no_path_retry = 30,
1240         },
1241         /*
1242          * AccelStor
1243          */
1244         {
1245                 /* NeoSapphire */
1246                 .vendor        = "AStor",
1247                 .product       = "NeoSapphire",
1248                 .pgpolicy      = MULTIBUS,
1249                 .no_path_retry = 30,
1250         },
1251         /*
1252          * INSPUR
1253          */
1254         {
1255                 /* AS5300/AS5500 G2 */
1256                 .vendor        = "INSPUR",
1257                 .product       = "MCS",
1258                 .pgpolicy      = GROUP_BY_PRIO,
1259                 .pgfailback    = -FAILBACK_IMMEDIATE,
1260                 .prio_name     = PRIO_ALUA,
1261         },
1262         /*
1263          * EOL
1264          */
1265         {
1266                 /* NULL */
1267                 .vendor        = NULL,
1268                 .product       = NULL,
1269         },
1270 };
1271
1272 int setup_default_hwtable(vector hw)
1273 {
1274         int r = 0;
1275         struct hwentry * hwe = default_hw;
1276
1277         while (hwe->vendor) {
1278                 r += store_hwe(hw, hwe);
1279                 hwe++;
1280         }
1281         return r;
1282 }