DPDK logo

Elixir Cross Referencer

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
/* SPDX-License-Identifier: BSD-3-Clause
 *
 * Copyright (c) 2007-2018 Solarflare Communications Inc.
 * All rights reserved.
 */

#include "efx.h"
#include "efx_impl.h"

#if EFSYS_OPT_MON_MCDI
#include "mcdi_mon.h"
#endif

#if EFSYS_OPT_NAMES

static const char * const __efx_mon_name[] = {
	"",
	"sfx90x0",
	"sfx91x0",
	"sfx92x0"
};

		const char *
efx_mon_name(
	__in	efx_nic_t *enp)
{
	efx_nic_cfg_t *encp = &(enp->en_nic_cfg);

	EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC);

	EFSYS_ASSERT(encp->enc_mon_type != EFX_MON_INVALID);
	EFSYS_ASSERT3U(encp->enc_mon_type, <, EFX_MON_NTYPES);
	return (__efx_mon_name[encp->enc_mon_type]);
}

#endif	/* EFSYS_OPT_NAMES */

#if EFSYS_OPT_MON_MCDI
static const efx_mon_ops_t	__efx_mon_mcdi_ops = {
#if EFSYS_OPT_MON_STATS
	mcdi_mon_stats_update,		/* emo_stats_update */
	mcdi_mon_limits_update,		/* emo_limits_update */
#endif	/* EFSYS_OPT_MON_STATS */
};
#endif


	__checkReturn	efx_rc_t
efx_mon_init(
	__in		efx_nic_t *enp)
{
	efx_nic_cfg_t *encp = &(enp->en_nic_cfg);
	efx_mon_t *emp = &(enp->en_mon);
	const efx_mon_ops_t *emop;
	efx_rc_t rc;

	EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC);
	EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_PROBE);

	if (enp->en_mod_flags & EFX_MOD_MON) {
		rc = EINVAL;
		goto fail1;
	}

	enp->en_mod_flags |= EFX_MOD_MON;

	emp->em_type = encp->enc_mon_type;

	EFSYS_ASSERT(encp->enc_mon_type != EFX_MON_INVALID);
	switch (emp->em_type) {
#if EFSYS_OPT_MON_MCDI
	case EFX_MON_SFC90X0:
	case EFX_MON_SFC91X0:
	case EFX_MON_SFC92X0:
		emop = &__efx_mon_mcdi_ops;
		break;
#endif
	default:
		rc = ENOTSUP;
		goto fail2;
	}

	emp->em_emop = emop;
	return (0);

fail2:
	EFSYS_PROBE(fail2);

	emp->em_type = EFX_MON_INVALID;

	enp->en_mod_flags &= ~EFX_MOD_MON;

fail1:
	EFSYS_PROBE1(fail1, efx_rc_t, rc);

	return (rc);
}

#if EFSYS_OPT_MON_STATS

#if EFSYS_OPT_NAMES

/* START MKCONFIG GENERATED MonitorStatNamesBlock 277c17eda1a6d1a4 */
static const char * const __mon_stat_name[] = {
	"controller_temp",
	"phy_common_temp",
	"controller_cooling",
	"phy0_temp",
	"phy0_cooling",
	"phy1_temp",
	"phy1_cooling",
	"in_1v0",
	"in_1v2",
	"in_1v8",
	"in_2v5",
	"in_3v3",
	"in_12v0",
	"in_1v2a",
	"in_vref",
	"out_vaoe",
	"aoe_temp",
	"psu_aoe_temp",
	"psu_temp",
	"fan_0",
	"fan_1",
	"fan_2",
	"fan_3",
	"fan_4",
	"in_vaoe",
	"out_iaoe",
	"in_iaoe",
	"nic_power",
	"in_0v9",
	"in_i0v9",
	"in_i1v2",
	"in_0v9_adc",
	"controller_2_temp",
	"vreg_internal_temp",
	"vreg_0v9_temp",
	"vreg_1v2_temp",
	"controller_vptat",
	"controller_internal_temp",
	"controller_vptat_extadc",
	"controller_internal_temp_extadc",
	"ambient_temp",
	"airflow",
	"vdd08d_vss08d_csr",
	"vdd08d_vss08d_csr_extadc",
	"hotpoint_temp",
	"phy_power_port0",
	"phy_power_port1",
	"mum_vcc",
	"in_0v9_a",
	"in_i0v9_a",
	"vreg_0v9_a_temp",
	"in_0v9_b",
	"in_i0v9_b",
	"vreg_0v9_b_temp",
	"ccom_avreg_1v2_supply",
	"ccom_avreg_1v2_supply_extadc",
	"ccom_avreg_1v8_supply",
	"ccom_avreg_1v8_supply_extadc",
	"controller_master_vptat",
	"controller_master_internal_temp",
	"controller_master_vptat_extadc",
	"controller_master_internal_temp_extadc",
	"controller_slave_vptat",
	"controller_slave_internal_temp",
	"controller_slave_vptat_extadc",
	"controller_slave_internal_temp_extadc",
	"sodimm_vout",
	"sodimm_0_temp",
	"sodimm_1_temp",
	"phy0_vcc",
	"phy1_vcc",
	"controller_tdiode_temp",
	"board_front_temp",
	"board_back_temp",
	"in_i1v8",
	"in_i2v5",
	"in_i3v3",
	"in_i12v0",
	"in_1v3",
	"in_i1v3",
};

/* END MKCONFIG GENERATED MonitorStatNamesBlock */

					const char *
efx_mon_stat_name(
	__in				efx_nic_t *enp,
	__in				efx_mon_stat_t id)
{
	_NOTE(ARGUNUSED(enp))
	EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC);

	EFSYS_ASSERT3U(id, <, EFX_MON_NSTATS);
	return (__mon_stat_name[id]);
}

typedef struct _stat_description_t {
	efx_mon_stat_t	stat;
	const char	*desc;
} stat_description_t;

/* START MKCONFIG GENERATED MonitorStatDescriptionsBlock f072138f16d2e1f8 */
static const char *__mon_stat_description[] = {
	MC_CMD_SENSOR_CONTROLLER_TEMP_ENUM_STR,
	MC_CMD_SENSOR_PHY_COMMON_TEMP_ENUM_STR,
	MC_CMD_SENSOR_CONTROLLER_COOLING_ENUM_STR,
	MC_CMD_SENSOR_PHY0_TEMP_ENUM_STR,
	MC_CMD_SENSOR_PHY0_COOLING_ENUM_STR,
	MC_CMD_SENSOR_PHY1_TEMP_ENUM_STR,
	MC_CMD_SENSOR_PHY1_COOLING_ENUM_STR,
	MC_CMD_SENSOR_IN_1V0_ENUM_STR,
	MC_CMD_SENSOR_IN_1V2_ENUM_STR,
	MC_CMD_SENSOR_IN_1V8_ENUM_STR,
	MC_CMD_SENSOR_IN_2V5_ENUM_STR,
	MC_CMD_SENSOR_IN_3V3_ENUM_STR,
	MC_CMD_SENSOR_IN_12V0_ENUM_STR,
	MC_CMD_SENSOR_IN_1V2A_ENUM_STR,
	MC_CMD_SENSOR_IN_VREF_ENUM_STR,
	MC_CMD_SENSOR_OUT_VAOE_ENUM_STR,
	MC_CMD_SENSOR_AOE_TEMP_ENUM_STR,
	MC_CMD_SENSOR_PSU_AOE_TEMP_ENUM_STR,
	MC_CMD_SENSOR_PSU_TEMP_ENUM_STR,
	MC_CMD_SENSOR_FAN_0_ENUM_STR,
	MC_CMD_SENSOR_FAN_1_ENUM_STR,
	MC_CMD_SENSOR_FAN_2_ENUM_STR,
	MC_CMD_SENSOR_FAN_3_ENUM_STR,
	MC_CMD_SENSOR_FAN_4_ENUM_STR,
	MC_CMD_SENSOR_IN_VAOE_ENUM_STR,
	MC_CMD_SENSOR_OUT_IAOE_ENUM_STR,
	MC_CMD_SENSOR_IN_IAOE_ENUM_STR,
	MC_CMD_SENSOR_NIC_POWER_ENUM_STR,
	MC_CMD_SENSOR_IN_0V9_ENUM_STR,
	MC_CMD_SENSOR_IN_I0V9_ENUM_STR,
	MC_CMD_SENSOR_IN_I1V2_ENUM_STR,
	MC_CMD_SENSOR_IN_0V9_ADC_ENUM_STR,
	MC_CMD_SENSOR_CONTROLLER_2_TEMP_ENUM_STR,
	MC_CMD_SENSOR_VREG_INTERNAL_TEMP_ENUM_STR,
	MC_CMD_SENSOR_VREG_0V9_TEMP_ENUM_STR,
	MC_CMD_SENSOR_VREG_1V2_TEMP_ENUM_STR,
	MC_CMD_SENSOR_CONTROLLER_VPTAT_ENUM_STR,
	MC_CMD_SENSOR_CONTROLLER_INTERNAL_TEMP_ENUM_STR,
	MC_CMD_SENSOR_CONTROLLER_VPTAT_EXTADC_ENUM_STR,
	MC_CMD_SENSOR_CONTROLLER_INTERNAL_TEMP_EXTADC_ENUM_STR,
	MC_CMD_SENSOR_AMBIENT_TEMP_ENUM_STR,
	MC_CMD_SENSOR_AIRFLOW_ENUM_STR,
	MC_CMD_SENSOR_VDD08D_VSS08D_CSR_ENUM_STR,
	MC_CMD_SENSOR_VDD08D_VSS08D_CSR_EXTADC_ENUM_STR,
	MC_CMD_SENSOR_HOTPOINT_TEMP_ENUM_STR,
	MC_CMD_SENSOR_PHY_POWER_PORT0_ENUM_STR,
	MC_CMD_SENSOR_PHY_POWER_PORT1_ENUM_STR,
	MC_CMD_SENSOR_MUM_VCC_ENUM_STR,
	MC_CMD_SENSOR_IN_0V9_A_ENUM_STR,
	MC_CMD_SENSOR_IN_I0V9_A_ENUM_STR,
	MC_CMD_SENSOR_VREG_0V9_A_TEMP_ENUM_STR,
	MC_CMD_SENSOR_IN_0V9_B_ENUM_STR,
	MC_CMD_SENSOR_IN_I0V9_B_ENUM_STR,
	MC_CMD_SENSOR_VREG_0V9_B_TEMP_ENUM_STR,
	MC_CMD_SENSOR_CCOM_AVREG_1V2_SUPPLY_ENUM_STR,
	MC_CMD_SENSOR_CCOM_AVREG_1V2_SUPPLY_EXTADC_ENUM_STR,
	MC_CMD_SENSOR_CCOM_AVREG_1V8_SUPPLY_ENUM_STR,
	MC_CMD_SENSOR_CCOM_AVREG_1V8_SUPPLY_EXTADC_ENUM_STR,
	MC_CMD_SENSOR_CONTROLLER_MASTER_VPTAT_ENUM_STR,
	MC_CMD_SENSOR_CONTROLLER_MASTER_INTERNAL_TEMP_ENUM_STR,
	MC_CMD_SENSOR_CONTROLLER_MASTER_VPTAT_EXTADC_ENUM_STR,
	MC_CMD_SENSOR_CONTROLLER_MASTER_INTERNAL_TEMP_EXTADC_ENUM_STR,
	MC_CMD_SENSOR_CONTROLLER_SLAVE_VPTAT_ENUM_STR,
	MC_CMD_SENSOR_CONTROLLER_SLAVE_INTERNAL_TEMP_ENUM_STR,
	MC_CMD_SENSOR_CONTROLLER_SLAVE_VPTAT_EXTADC_ENUM_STR,
	MC_CMD_SENSOR_CONTROLLER_SLAVE_INTERNAL_TEMP_EXTADC_ENUM_STR,
	MC_CMD_SENSOR_SODIMM_VOUT_ENUM_STR,
	MC_CMD_SENSOR_SODIMM_0_TEMP_ENUM_STR,
	MC_CMD_SENSOR_SODIMM_1_TEMP_ENUM_STR,
	MC_CMD_SENSOR_PHY0_VCC_ENUM_STR,
	MC_CMD_SENSOR_PHY1_VCC_ENUM_STR,
	MC_CMD_SENSOR_CONTROLLER_TDIODE_TEMP_ENUM_STR,
	MC_CMD_SENSOR_BOARD_FRONT_TEMP_ENUM_STR,
	MC_CMD_SENSOR_BOARD_BACK_TEMP_ENUM_STR,
	MC_CMD_SENSOR_IN_I1V8_ENUM_STR,
	MC_CMD_SENSOR_IN_I2V5_ENUM_STR,
	MC_CMD_SENSOR_IN_I3V3_ENUM_STR,
	MC_CMD_SENSOR_IN_I12V0_ENUM_STR,
	MC_CMD_SENSOR_IN_1V3_ENUM_STR,
	MC_CMD_SENSOR_IN_I1V3_ENUM_STR,
};

/* END MKCONFIG GENERATED MonitorStatDescriptionsBlock */

					const char *
efx_mon_stat_description(
	__in				efx_nic_t *enp,
	__in				efx_mon_stat_t id)
{
	_NOTE(ARGUNUSED(enp))
	EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC);

	EFSYS_ASSERT3U(id, <, EFX_MON_NSTATS);
	return (__mon_stat_description[id]);
}

#endif	/* EFSYS_OPT_NAMES */

/* START MKCONFIG GENERATED MonitorMcdiMappingBlock 173eee0a5599996a */
	__checkReturn			boolean_t
efx_mon_mcdi_to_efx_stat(
	__in				int mcdi_index,
	__out				efx_mon_stat_t *statp)
{

	if ((mcdi_index % (MC_CMD_SENSOR_PAGE0_NEXT + 1)) ==
	    MC_CMD_SENSOR_PAGE0_NEXT) {
		*statp = EFX_MON_NSTATS;
		return (B_FALSE);
	}

	switch (mcdi_index) {
	case MC_CMD_SENSOR_IN_I0V9:
		*statp = EFX_MON_STAT_IN_I0V9;
		break;
	case MC_CMD_SENSOR_CONTROLLER_SLAVE_VPTAT_EXTADC:
		*statp = EFX_MON_STAT_CONTROLLER_SLAVE_VPTAT_EXTADC;
		break;
	case MC_CMD_SENSOR_CONTROLLER_SLAVE_VPTAT:
		*statp = EFX_MON_STAT_CONTROLLER_SLAVE_VPTAT;
		break;
	case MC_CMD_SENSOR_PSU_TEMP:
		*statp = EFX_MON_STAT_PSU_TEMP;
		break;
	case MC_CMD_SENSOR_FAN_2:
		*statp = EFX_MON_STAT_FAN_2;
		break;
	case MC_CMD_SENSOR_CONTROLLER_INTERNAL_TEMP_EXTADC:
		*statp = EFX_MON_STAT_CONTROLLER_INTERNAL_TEMP_EXTADC;
		break;
	case MC_CMD_SENSOR_BOARD_BACK_TEMP:
		*statp = EFX_MON_STAT_BOARD_BACK_TEMP;
		break;
	case MC_CMD_SENSOR_IN_1V3:
		*statp = EFX_MON_STAT_IN_1V3;
		break;
	case MC_CMD_SENSOR_CONTROLLER_TDIODE_TEMP:
		*statp = EFX_MON_STAT_CONTROLLER_TDIODE_TEMP;
		break;
	case MC_CMD_SENSOR_IN_2V5:
		*statp = EFX_MON_STAT_IN_2V5;
		break;
	case MC_CMD_SENSOR_PHY_COMMON_TEMP:
		*statp = EFX_MON_STAT_PHY_COMMON_TEMP;
		break;
	case MC_CMD_SENSOR_PHY1_TEMP:
		*statp = EFX_MON_STAT_PHY1_TEMP;
		break;
	case MC_CMD_SENSOR_VREG_INTERNAL_TEMP:
		*statp = EFX_MON_STAT_VREG_INTERNAL_TEMP;
		break;
	case MC_CMD_SENSOR_IN_1V0:
		*statp = EFX_MON_STAT_IN_1V0;
		break;
	case MC_CMD_SENSOR_FAN_1:
		*statp = EFX_MON_STAT_FAN_1;
		break;
	case MC_CMD_SENSOR_IN_1V2:
		*statp = EFX_MON_STAT_IN_1V2;
		break;
	case MC_CMD_SENSOR_FAN_3:
		*statp = EFX_MON_STAT_FAN_3;
		break;
	case MC_CMD_SENSOR_IN_1V2A:
		*statp = EFX_MON_STAT_IN_1V2A;
		break;
	case MC_CMD_SENSOR_SODIMM_0_TEMP:
		*statp = EFX_MON_STAT_SODIMM_0_TEMP;
		break;
	case MC_CMD_SENSOR_IN_1V8:
		*statp = EFX_MON_STAT_IN_1V8;
		break;
	case MC_CMD_SENSOR_IN_VREF:
		*statp = EFX_MON_STAT_IN_VREF;
		break;
	case MC_CMD_SENSOR_SODIMM_VOUT:
		*statp = EFX_MON_STAT_SODIMM_VOUT;
		break;
	case MC_CMD_SENSOR_CCOM_AVREG_1V2_SUPPLY:
		*statp = EFX_MON_STAT_CCOM_AVREG_1V2_SUPPLY;
		break;
	case MC_CMD_SENSOR_IN_I1V2:
		*statp = EFX_MON_STAT_IN_I1V2;
		break;
	case MC_CMD_SENSOR_IN_I1V3:
		*statp = EFX_MON_STAT_IN_I1V3;
		break;
	case MC_CMD_SENSOR_AIRFLOW:
		*statp = EFX_MON_STAT_AIRFLOW;
		break;
	case MC_CMD_SENSOR_HOTPOINT_TEMP:
		*statp = EFX_MON_STAT_HOTPOINT_TEMP;
		break;
	case MC_CMD_SENSOR_VDD08D_VSS08D_CSR:
		*statp = EFX_MON_STAT_VDD08D_VSS08D_CSR;
		break;
	case MC_CMD_SENSOR_AOE_TEMP:
		*statp = EFX_MON_STAT_AOE_TEMP;
		break;
	case MC_CMD_SENSOR_IN_I1V8:
		*statp = EFX_MON_STAT_IN_I1V8;
		break;
	case MC_CMD_SENSOR_IN_I2V5:
		*statp = EFX_MON_STAT_IN_I2V5;
		break;
	case MC_CMD_SENSOR_PHY1_COOLING:
		*statp = EFX_MON_STAT_PHY1_COOLING;
		break;
	case MC_CMD_SENSOR_CCOM_AVREG_1V8_SUPPLY_EXTADC:
		*statp = EFX_MON_STAT_CCOM_AVREG_1V8_SUPPLY_EXTADC;
		break;
	case MC_CMD_SENSOR_IN_0V9_ADC:
		*statp = EFX_MON_STAT_IN_0V9_ADC;
		break;
	case MC_CMD_SENSOR_VREG_0V9_A_TEMP:
		*statp = EFX_MON_STAT_VREG_0V9_A_TEMP;
		break;
	case MC_CMD_SENSOR_CONTROLLER_MASTER_VPTAT:
		*statp = EFX_MON_STAT_CONTROLLER_MASTER_VPTAT;
		break;
	case MC_CMD_SENSOR_PHY0_VCC:
		*statp = EFX_MON_STAT_PHY0_VCC;
		break;
	case MC_CMD_SENSOR_PHY0_COOLING:
		*statp = EFX_MON_STAT_PHY0_COOLING;
		break;
	case MC_CMD_SENSOR_PSU_AOE_TEMP:
		*statp = EFX_MON_STAT_PSU_AOE_TEMP;
		break;
	case MC_CMD_SENSOR_VREG_0V9_TEMP:
		*statp = EFX_MON_STAT_VREG_0V9_TEMP;
		break;
	case MC_CMD_SENSOR_IN_I0V9_A:
		*statp = EFX_MON_STAT_IN_I0V9_A;
		break;
	case MC_CMD_SENSOR_IN_I3V3:
		*statp = EFX_MON_STAT_IN_I3V3;
		break;
	case MC_CMD_SENSOR_BOARD_FRONT_TEMP:
		*statp = EFX_MON_STAT_BOARD_FRONT_TEMP;
		break;
	case MC_CMD_SENSOR_OUT_VAOE:
		*statp = EFX_MON_STAT_OUT_VAOE;
		break;
	case MC_CMD_SENSOR_VDD08D_VSS08D_CSR_EXTADC:
		*statp = EFX_MON_STAT_VDD08D_VSS08D_CSR_EXTADC;
		break;
	case MC_CMD_SENSOR_IN_I12V0:
		*statp = EFX_MON_STAT_IN_I12V0;
		break;
	case MC_CMD_SENSOR_PHY_POWER_PORT1:
		*statp = EFX_MON_STAT_PHY_POWER_PORT1;
		break;
	case MC_CMD_SENSOR_PHY_POWER_PORT0:
		*statp = EFX_MON_STAT_PHY_POWER_PORT0;
		break;
	case MC_CMD_SENSOR_CONTROLLER_SLAVE_INTERNAL_TEMP_EXTADC:
		*statp = EFX_MON_STAT_CONTROLLER_SLAVE_INTERNAL_TEMP_EXTADC;
		break;
	case MC_CMD_SENSOR_CONTROLLER_MASTER_INTERNAL_TEMP:
		*statp = EFX_MON_STAT_CONTROLLER_MASTER_INTERNAL_TEMP;
		break;
	case MC_CMD_SENSOR_CONTROLLER_TEMP:
		*statp = EFX_MON_STAT_CONTROLLER_TEMP;
		break;
	case MC_CMD_SENSOR_IN_IAOE:
		*statp = EFX_MON_STAT_IN_IAOE;
		break;
	case MC_CMD_SENSOR_IN_VAOE:
		*statp = EFX_MON_STAT_IN_VAOE;
		break;
	case MC_CMD_SENSOR_CONTROLLER_MASTER_VPTAT_EXTADC:
		*statp = EFX_MON_STAT_CONTROLLER_MASTER_VPTAT_EXTADC;
		break;
	case MC_CMD_SENSOR_CCOM_AVREG_1V8_SUPPLY:
		*statp = EFX_MON_STAT_CCOM_AVREG_1V8_SUPPLY;
		break;
	case MC_CMD_SENSOR_PHY1_VCC:
		*statp = EFX_MON_STAT_PHY1_VCC;
		break;
	case MC_CMD_SENSOR_CONTROLLER_COOLING:
		*statp = EFX_MON_STAT_CONTROLLER_COOLING;
		break;
	case MC_CMD_SENSOR_AMBIENT_TEMP:
		*statp = EFX_MON_STAT_AMBIENT_TEMP;
		break;
	case MC_CMD_SENSOR_IN_3V3:
		*statp = EFX_MON_STAT_IN_3V3;
		break;
	case MC_CMD_SENSOR_PHY0_TEMP:
		*statp = EFX_MON_STAT_PHY0_TEMP;
		break;
	case MC_CMD_SENSOR_SODIMM_1_TEMP:
		*statp = EFX_MON_STAT_SODIMM_1_TEMP;
		break;
	case MC_CMD_SENSOR_MUM_VCC:
		*statp = EFX_MON_STAT_MUM_VCC;
		break;
	case MC_CMD_SENSOR_VREG_0V9_B_TEMP:
		*statp = EFX_MON_STAT_VREG_0V9_B_TEMP;
		break;
	case MC_CMD_SENSOR_CONTROLLER_SLAVE_INTERNAL_TEMP:
		*statp = EFX_MON_STAT_CONTROLLER_SLAVE_INTERNAL_TEMP;
		break;
	case MC_CMD_SENSOR_FAN_4:
		*statp = EFX_MON_STAT_FAN_4;
		break;
	case MC_CMD_SENSOR_CONTROLLER_2_TEMP:
		*statp = EFX_MON_STAT_CONTROLLER_2_TEMP;
		break;
	case MC_CMD_SENSOR_CCOM_AVREG_1V2_SUPPLY_EXTADC:
		*statp = EFX_MON_STAT_CCOM_AVREG_1V2_SUPPLY_EXTADC;
		break;
	case MC_CMD_SENSOR_IN_0V9_A:
		*statp = EFX_MON_STAT_IN_0V9_A;
		break;
	case MC_CMD_SENSOR_CONTROLLER_VPTAT_EXTADC:
		*statp = EFX_MON_STAT_CONTROLLER_VPTAT_EXTADC;
		break;
	case MC_CMD_SENSOR_IN_0V9:
		*statp = EFX_MON_STAT_IN_0V9;
		break;
	case MC_CMD_SENSOR_IN_I0V9_B:
		*statp = EFX_MON_STAT_IN_I0V9_B;
		break;
	case MC_CMD_SENSOR_NIC_POWER:
		*statp = EFX_MON_STAT_NIC_POWER;
		break;
	case MC_CMD_SENSOR_IN_12V0:
		*statp = EFX_MON_STAT_IN_12V0;
		break;
	case MC_CMD_SENSOR_OUT_IAOE:
		*statp = EFX_MON_STAT_OUT_IAOE;
		break;
	case MC_CMD_SENSOR_CONTROLLER_VPTAT:
		*statp = EFX_MON_STAT_CONTROLLER_VPTAT;
		break;
	case MC_CMD_SENSOR_CONTROLLER_MASTER_INTERNAL_TEMP_EXTADC:
		*statp = EFX_MON_STAT_CONTROLLER_MASTER_INTERNAL_TEMP_EXTADC;
		break;
	case MC_CMD_SENSOR_CONTROLLER_INTERNAL_TEMP:
		*statp = EFX_MON_STAT_CONTROLLER_INTERNAL_TEMP;
		break;
	case MC_CMD_SENSOR_FAN_0:
		*statp = EFX_MON_STAT_FAN_0;
		break;
	case MC_CMD_SENSOR_VREG_1V2_TEMP:
		*statp = EFX_MON_STAT_VREG_1V2_TEMP;
		break;
	case MC_CMD_SENSOR_IN_0V9_B:
		*statp = EFX_MON_STAT_IN_0V9_B;
		break;
	default:
		*statp = EFX_MON_NSTATS;
		break;
	};

	if (*statp == EFX_MON_NSTATS)
		goto fail1;

	return (B_TRUE);

fail1:
	EFSYS_PROBE1(fail1, boolean_t, B_TRUE);
	return (B_FALSE);
};

/* END MKCONFIG GENERATED MonitorMcdiMappingBlock */

/* START MKCONFIG GENERATED MonitorStatisticUnitsBlock 2d447c656cc2d01d */
	__checkReturn			boolean_t
efx_mon_get_stat_unit(
	__in				efx_mon_stat_t stat,
	__out				efx_mon_stat_unit_t *unitp)
{
	switch (stat) {
	case EFX_MON_STAT_IN_1V0:
	case EFX_MON_STAT_IN_1V2:
	case EFX_MON_STAT_IN_1V8:
	case EFX_MON_STAT_IN_2V5:
	case EFX_MON_STAT_IN_3V3:
	case EFX_MON_STAT_IN_12V0:
	case EFX_MON_STAT_IN_1V2A:
	case EFX_MON_STAT_IN_VREF:
	case EFX_MON_STAT_OUT_VAOE:
	case EFX_MON_STAT_IN_VAOE:
	case EFX_MON_STAT_IN_0V9:
	case EFX_MON_STAT_IN_0V9_ADC:
	case EFX_MON_STAT_CONTROLLER_VPTAT_EXTADC:
	case EFX_MON_STAT_VDD08D_VSS08D_CSR:
	case EFX_MON_STAT_VDD08D_VSS08D_CSR_EXTADC:
	case EFX_MON_STAT_MUM_VCC:
	case EFX_MON_STAT_IN_0V9_A:
	case EFX_MON_STAT_IN_0V9_B:
	case EFX_MON_STAT_CCOM_AVREG_1V2_SUPPLY:
	case EFX_MON_STAT_CCOM_AVREG_1V2_SUPPLY_EXTADC:
	case EFX_MON_STAT_CCOM_AVREG_1V8_SUPPLY:
	case EFX_MON_STAT_CCOM_AVREG_1V8_SUPPLY_EXTADC:
	case EFX_MON_STAT_CONTROLLER_MASTER_VPTAT:
	case EFX_MON_STAT_CONTROLLER_MASTER_VPTAT_EXTADC:
	case EFX_MON_STAT_CONTROLLER_SLAVE_VPTAT:
	case EFX_MON_STAT_CONTROLLER_SLAVE_VPTAT_EXTADC:
	case EFX_MON_STAT_SODIMM_VOUT:
	case EFX_MON_STAT_PHY0_VCC:
	case EFX_MON_STAT_PHY1_VCC:
	case EFX_MON_STAT_IN_1V3:
		*unitp = EFX_MON_STAT_UNIT_VOLTAGE_MV;
		break;
	case EFX_MON_STAT_CONTROLLER_TEMP:
	case EFX_MON_STAT_PHY_COMMON_TEMP:
	case EFX_MON_STAT_PHY0_TEMP:
	case EFX_MON_STAT_PHY1_TEMP:
	case EFX_MON_STAT_AOE_TEMP:
	case EFX_MON_STAT_PSU_AOE_TEMP:
	case EFX_MON_STAT_PSU_TEMP:
	case EFX_MON_STAT_CONTROLLER_2_TEMP:
	case EFX_MON_STAT_VREG_INTERNAL_TEMP:
	case EFX_MON_STAT_VREG_0V9_TEMP:
	case EFX_MON_STAT_VREG_1V2_TEMP:
	case EFX_MON_STAT_CONTROLLER_VPTAT:
	case EFX_MON_STAT_CONTROLLER_INTERNAL_TEMP:
	case EFX_MON_STAT_CONTROLLER_INTERNAL_TEMP_EXTADC:
	case EFX_MON_STAT_AMBIENT_TEMP:
	case EFX_MON_STAT_HOTPOINT_TEMP:
	case EFX_MON_STAT_VREG_0V9_A_TEMP:
	case EFX_MON_STAT_VREG_0V9_B_TEMP:
	case EFX_MON_STAT_CONTROLLER_MASTER_INTERNAL_TEMP:
	case EFX_MON_STAT_CONTROLLER_MASTER_INTERNAL_TEMP_EXTADC:
	case EFX_MON_STAT_CONTROLLER_SLAVE_INTERNAL_TEMP:
	case EFX_MON_STAT_CONTROLLER_SLAVE_INTERNAL_TEMP_EXTADC:
	case EFX_MON_STAT_SODIMM_0_TEMP:
	case EFX_MON_STAT_SODIMM_1_TEMP:
	case EFX_MON_STAT_CONTROLLER_TDIODE_TEMP:
	case EFX_MON_STAT_BOARD_FRONT_TEMP:
	case EFX_MON_STAT_BOARD_BACK_TEMP:
		*unitp = EFX_MON_STAT_UNIT_TEMP_C;
		break;
	case EFX_MON_STAT_CONTROLLER_COOLING:
	case EFX_MON_STAT_PHY0_COOLING:
	case EFX_MON_STAT_PHY1_COOLING:
	case EFX_MON_STAT_AIRFLOW:
	case EFX_MON_STAT_PHY_POWER_PORT0:
	case EFX_MON_STAT_PHY_POWER_PORT1:
		*unitp = EFX_MON_STAT_UNIT_BOOL;
		break;
	case EFX_MON_STAT_NIC_POWER:
		*unitp = EFX_MON_STAT_UNIT_POWER_W;
		break;
	case EFX_MON_STAT_OUT_IAOE:
	case EFX_MON_STAT_IN_IAOE:
	case EFX_MON_STAT_IN_I0V9:
	case EFX_MON_STAT_IN_I1V2:
	case EFX_MON_STAT_IN_I0V9_A:
	case EFX_MON_STAT_IN_I0V9_B:
	case EFX_MON_STAT_IN_I1V8:
	case EFX_MON_STAT_IN_I2V5:
	case EFX_MON_STAT_IN_I3V3:
	case EFX_MON_STAT_IN_I12V0:
	case EFX_MON_STAT_IN_I1V3:
		*unitp = EFX_MON_STAT_UNIT_CURRENT_MA;
		break;
	case EFX_MON_STAT_FAN_0:
	case EFX_MON_STAT_FAN_1:
	case EFX_MON_STAT_FAN_2:
	case EFX_MON_STAT_FAN_3:
	case EFX_MON_STAT_FAN_4:
		*unitp = EFX_MON_STAT_UNIT_RPM;
		break;
	default:
		*unitp = EFX_MON_STAT_UNIT_UNKNOWN;
		break;
	};

	if (*unitp == EFX_MON_STAT_UNIT_UNKNOWN)
		goto fail1;

	return (B_TRUE);

fail1:
	EFSYS_PROBE1(fail1, boolean_t, B_TRUE);
	return (B_FALSE);
};

/* END MKCONFIG GENERATED MonitorStatisticUnitsBlock */

/* START MKCONFIG GENERATED MonitorStatisticPortsBlock 1719b751d842534f */
	__checkReturn			boolean_t
efx_mon_get_stat_portmap(
	__in				efx_mon_stat_t stat,
	__out				efx_mon_stat_portmask_t *maskp)
{

	switch (stat) {
	case EFX_MON_STAT_PHY1_TEMP:
	case EFX_MON_STAT_PHY1_COOLING:
	case EFX_MON_STAT_PHY_POWER_PORT1:
		*maskp = EFX_MON_STAT_PORTMAP_PORT1;
		break;
	case EFX_MON_STAT_CONTROLLER_TEMP:
	case EFX_MON_STAT_PHY_COMMON_TEMP:
	case EFX_MON_STAT_CONTROLLER_COOLING:
	case EFX_MON_STAT_IN_1V0:
	case EFX_MON_STAT_IN_1V2:
	case EFX_MON_STAT_IN_1V8:
	case EFX_MON_STAT_IN_2V5:
	case EFX_MON_STAT_IN_3V3:
	case EFX_MON_STAT_IN_12V0:
	case EFX_MON_STAT_IN_1V2A:
	case EFX_MON_STAT_IN_VREF:
	case EFX_MON_STAT_OUT_VAOE:
	case EFX_MON_STAT_AOE_TEMP:
	case EFX_MON_STAT_PSU_AOE_TEMP:
	case EFX_MON_STAT_PSU_TEMP:
	case EFX_MON_STAT_FAN_0:
	case EFX_MON_STAT_FAN_1:
	case EFX_MON_STAT_FAN_2:
	case EFX_MON_STAT_FAN_3:
	case EFX_MON_STAT_FAN_4:
	case EFX_MON_STAT_IN_VAOE:
	case EFX_MON_STAT_OUT_IAOE:
	case EFX_MON_STAT_IN_IAOE:
	case EFX_MON_STAT_NIC_POWER:
	case EFX_MON_STAT_IN_0V9:
	case EFX_MON_STAT_IN_I0V9:
	case EFX_MON_STAT_IN_I1V2:
	case EFX_MON_STAT_IN_0V9_ADC:
	case EFX_MON_STAT_CONTROLLER_2_TEMP:
	case EFX_MON_STAT_VREG_INTERNAL_TEMP:
	case EFX_MON_STAT_VREG_0V9_TEMP:
	case EFX_MON_STAT_VREG_1V2_TEMP:
	case EFX_MON_STAT_CONTROLLER_VPTAT:
	case EFX_MON_STAT_CONTROLLER_INTERNAL_TEMP:
	case EFX_MON_STAT_CONTROLLER_VPTAT_EXTADC:
	case EFX_MON_STAT_CONTROLLER_INTERNAL_TEMP_EXTADC:
	case EFX_MON_STAT_AMBIENT_TEMP:
	case EFX_MON_STAT_AIRFLOW:
	case EFX_MON_STAT_VDD08D_VSS08D_CSR:
	case EFX_MON_STAT_VDD08D_VSS08D_CSR_EXTADC:
	case EFX_MON_STAT_HOTPOINT_TEMP:
	case EFX_MON_STAT_MUM_VCC:
	case EFX_MON_STAT_IN_0V9_A:
	case EFX_MON_STAT_IN_I0V9_A:
	case EFX_MON_STAT_VREG_0V9_A_TEMP:
	case EFX_MON_STAT_IN_0V9_B:
	case EFX_MON_STAT_IN_I0V9_B:
	case EFX_MON_STAT_VREG_0V9_B_TEMP:
	case EFX_MON_STAT_CCOM_AVREG_1V2_SUPPLY:
	case EFX_MON_STAT_CCOM_AVREG_1V2_SUPPLY_EXTADC:
	case EFX_MON_STAT_CCOM_AVREG_1V8_SUPPLY:
	case EFX_MON_STAT_CCOM_AVREG_1V8_SUPPLY_EXTADC:
	case EFX_MON_STAT_CONTROLLER_MASTER_VPTAT:
	case EFX_MON_STAT_CONTROLLER_MASTER_INTERNAL_TEMP:
	case EFX_MON_STAT_CONTROLLER_MASTER_VPTAT_EXTADC:
	case EFX_MON_STAT_CONTROLLER_MASTER_INTERNAL_TEMP_EXTADC:
	case EFX_MON_STAT_CONTROLLER_SLAVE_VPTAT:
	case EFX_MON_STAT_CONTROLLER_SLAVE_INTERNAL_TEMP:
	case EFX_MON_STAT_CONTROLLER_SLAVE_VPTAT_EXTADC:
	case EFX_MON_STAT_CONTROLLER_SLAVE_INTERNAL_TEMP_EXTADC:
	case EFX_MON_STAT_SODIMM_VOUT:
	case EFX_MON_STAT_SODIMM_0_TEMP:
	case EFX_MON_STAT_SODIMM_1_TEMP:
	case EFX_MON_STAT_PHY0_VCC:
	case EFX_MON_STAT_PHY1_VCC:
	case EFX_MON_STAT_CONTROLLER_TDIODE_TEMP:
	case EFX_MON_STAT_BOARD_FRONT_TEMP:
	case EFX_MON_STAT_BOARD_BACK_TEMP:
	case EFX_MON_STAT_IN_I1V8:
	case EFX_MON_STAT_IN_I2V5:
	case EFX_MON_STAT_IN_I3V3:
	case EFX_MON_STAT_IN_I12V0:
	case EFX_MON_STAT_IN_1V3:
	case EFX_MON_STAT_IN_I1V3:
		*maskp = EFX_MON_STAT_PORTMAP_ALL;
		break;
	case EFX_MON_STAT_PHY0_TEMP:
	case EFX_MON_STAT_PHY0_COOLING:
	case EFX_MON_STAT_PHY_POWER_PORT0:
		*maskp = EFX_MON_STAT_PORTMAP_PORT0;
		break;
	default:
		*maskp = EFX_MON_STAT_PORTMAP_UNKNOWN;
		break;
	};

	if (*maskp == EFX_MON_STAT_PORTMAP_UNKNOWN)
		goto fail1;

	return (B_TRUE);

fail1:
	EFSYS_PROBE1(fail1, boolean_t, B_TRUE);
	return (B_FALSE);
};

/* END MKCONFIG GENERATED MonitorStatisticPortsBlock */

	__checkReturn			efx_rc_t
efx_mon_stats_update(
	__in				efx_nic_t *enp,
	__in				efsys_mem_t *esmp,
	__inout_ecount(EFX_MON_NSTATS)	efx_mon_stat_value_t *values)
{
	efx_mon_t *emp = &(enp->en_mon);
	const efx_mon_ops_t *emop = emp->em_emop;

	EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC);
	EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_MON);

	return (emop->emo_stats_update(enp, esmp, values));
}

	__checkReturn			efx_rc_t
efx_mon_limits_update(
	__in				efx_nic_t *enp,
	__inout_ecount(EFX_MON_NSTATS)	efx_mon_stat_limits_t *values)
{
	efx_mon_t *emp = &(enp->en_mon);
	const efx_mon_ops_t *emop = emp->em_emop;

	EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC);
	EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_MON);

	return (emop->emo_limits_update(enp, values));
}

#endif	/* EFSYS_OPT_MON_STATS */

		void
efx_mon_fini(
	__in	efx_nic_t *enp)
{
	efx_mon_t *emp = &(enp->en_mon);

	EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC);
	EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_PROBE);
	EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_MON);

	emp->em_emop = NULL;

	emp->em_type = EFX_MON_INVALID;

	enp->en_mod_flags &= ~EFX_MOD_MON;
}