1 /*
2 * This file and its contents are supplied under the terms of the
3 * Common Development and Distribution License ("CDDL"), version 1.0.
4 * You may only use this file in accordance with the terms of version
5 * 1.0 of the CDDL.
6 *
7 * A full copy of the text of the CDDL should have accompanied this
8 * source. A copy of the CDDL is also available via the Internet at
9 * http://www.illumos.org/license/CDDL.
10 */
11
12 /*
13 * Copyright 2015 OmniTI Computer Consulting, Inc. All rights reserved.
14 */
15
16 /*
17 * Interrupt servicing routines (i.e. ones registered with
18 * ddi_intr_add_handler()) and their support functions.
19 */
20
21 #include "i40e_sw.h"
22
23 #if 0 /* Rewhack... */
24 static inline void
25 i40e_intr_rx_work(i40e_rx_ring_t *rx_ring, i40e_t *i40e)
26 {
27 mblk_t *mp;
28
29 mutex_enter(&rx_ring->rxr_lock);
30 mp = i40e_ring_rx(rx_ring, i40e, I40E_POLL_NULL);
31 mutex_exit(&rx_ring->rxr_lock);
32
33 if (mp == NULL)
34 return;
35
36 mac_rx_ring(i40e->i40e_mac_hdl, rx_ring->rxr_ring_handle, mp,
37 rx_ring->rxr_gen_num);
38 }
39
40 static inline void
41 i40e_intr_tx_work(i40e_tx_ring_t *tx_ring)
42 {
43 i40e_t *i40e = tx_ring->txr_i40e;
44
45 /* XXX KEBE SAYS FILL ME IN */
46 i40e_log(i40e, "Nuke me...");
47 }
48 #endif /* rewhack */
49
50 static inline void
51 i40e_intr_adminq_work(i40e_t *i40e)
52 {
53 /* XXX KEBE SAYS FILL ME IN!!! */
54 i40e_notice(i40e, "ADMINq interrupt!");
55 }
56
57 uint_t
58 i40e_intr_msix(void *arg1, void *arg2)
59 {
60 i40e_t *i40e = (i40e_t *)arg1;
61 int vector_idx = (int)(uintptr_t)arg2;
62 #if 0
63 i40e_intr_vector_t *vector = &i40e->i40e_vector_map[vector_idx];
64 struct i40e_hw *hw = &i40e->i40e_hw_space;
65 int ring_idx;
66 uint32_t reg, mask;
67 #endif
68
69 if (vector_idx == 0) {
70 /* Got adminq interrupt. */
71 i40e_intr_adminq_work(i40e);
72 goto done;
73 }
74
75 i40e_notice(i40e, "rx/tx interrupt, vector %d\n", vector_idx);
76
77 done:
78 /* XXX KEBE SAYS RE-ENABLE THIS SPECIFIC INTERRUPT! */
79 return (DDI_INTR_CLAIMED);
80 }
81
82 uint_t
83 i40e_intr_msi(void *arg1, void *arg2)
84 {
85 /* XXX KEBE SAYS FILL ME IN... */
86 return (DDI_INTR_CLAIMED);
87 }
88
89 uint_t
90 i40e_intr_legacy(void *arg1, void *arg2)
91 {
92 /* XXX KEBE SAYS FILL ME IN... */
93 return (DDI_INTR_CLAIMED);
94 }