@@ -632,6 +632,50 @@ static int efx_ef100_get_phys_port_id(struct efx_nic *efx,
632
632
return 0 ;
633
633
}
634
634
635
+ static int efx_ef100_irq_test_generate (struct efx_nic * efx )
636
+ {
637
+ MCDI_DECLARE_BUF (inbuf , MC_CMD_TRIGGER_INTERRUPT_IN_LEN );
638
+
639
+ BUILD_BUG_ON (MC_CMD_TRIGGER_INTERRUPT_OUT_LEN != 0 );
640
+
641
+ MCDI_SET_DWORD (inbuf , TRIGGER_INTERRUPT_IN_INTR_LEVEL , efx -> irq_level );
642
+ return efx_mcdi_rpc_quiet (efx , MC_CMD_TRIGGER_INTERRUPT ,
643
+ inbuf , sizeof (inbuf ), NULL , 0 , NULL );
644
+ }
645
+
646
+ #define EFX_EF100_TEST 1
647
+
648
+ static void efx_ef100_ev_test_generate (struct efx_channel * channel )
649
+ {
650
+ MCDI_DECLARE_BUF (inbuf , MC_CMD_DRIVER_EVENT_IN_LEN );
651
+ struct efx_nic * efx = channel -> efx ;
652
+ efx_qword_t event ;
653
+ int rc ;
654
+
655
+ EFX_POPULATE_QWORD_2 (event ,
656
+ ESF_GZ_E_TYPE , ESE_GZ_EF100_EV_DRIVER ,
657
+ ESF_GZ_DRIVER_DATA , EFX_EF100_TEST );
658
+
659
+ MCDI_SET_DWORD (inbuf , DRIVER_EVENT_IN_EVQ , channel -> channel );
660
+
661
+ /* MCDI_SET_QWORD is not appropriate here since EFX_POPULATE_* has
662
+ * already swapped the data to little-endian order.
663
+ */
664
+ memcpy (MCDI_PTR (inbuf , DRIVER_EVENT_IN_DATA ), & event .u64 [0 ],
665
+ sizeof (efx_qword_t ));
666
+
667
+ rc = efx_mcdi_rpc (efx , MC_CMD_DRIVER_EVENT , inbuf , sizeof (inbuf ),
668
+ NULL , 0 , NULL );
669
+ if (rc && (rc != - ENETDOWN ))
670
+ goto fail ;
671
+
672
+ return ;
673
+
674
+ fail :
675
+ WARN_ON (true);
676
+ netif_err (efx , hw , efx -> net_dev , "%s: failed rc=%d\n" , __func__ , rc );
677
+ }
678
+
635
679
static unsigned int ef100_check_caps (const struct efx_nic * efx ,
636
680
u8 flag , u32 offset )
637
681
{
@@ -668,6 +712,7 @@ const struct efx_nic_type ef100_pf_nic_type = {
668
712
.mcdi_poll_reboot = ef100_mcdi_poll_reboot ,
669
713
.mcdi_reboot_detected = ef100_mcdi_reboot_detected ,
670
714
.irq_enable_master = efx_port_dummy_op_void ,
715
+ .irq_test_generate = efx_ef100_irq_test_generate ,
671
716
.irq_disable_non_ev = efx_port_dummy_op_void ,
672
717
.push_irq_moderation = efx_channel_dummy_op_void ,
673
718
.min_interrupt_mode = EFX_INT_MODE_MSIX ,
@@ -684,6 +729,7 @@ const struct efx_nic_type ef100_pf_nic_type = {
684
729
.irq_handle_msi = ef100_msi_interrupt ,
685
730
.ev_process = ef100_ev_process ,
686
731
.ev_read_ack = ef100_ev_read_ack ,
732
+ .ev_test_generate = efx_ef100_ev_test_generate ,
687
733
.tx_probe = ef100_tx_probe ,
688
734
.tx_init = ef100_tx_init ,
689
735
.tx_write = ef100_tx_write ,
@@ -722,6 +768,7 @@ const struct efx_nic_type ef100_pf_nic_type = {
722
768
.rx_restore_rss_contexts = efx_mcdi_rx_restore_rss_contexts ,
723
769
724
770
.reconfigure_mac = ef100_reconfigure_mac ,
771
+ .test_nvram = efx_new_mcdi_nvram_test_all ,
725
772
.describe_stats = ef100_describe_stats ,
726
773
.start_stats = efx_mcdi_mac_start_stats ,
727
774
.update_stats = ef100_update_stats ,
0 commit comments