diff options
Diffstat (limited to 'drivers/net/sfc/falcon.h')
-rw-r--r-- | drivers/net/sfc/falcon.h | 80 |
1 files changed, 52 insertions, 28 deletions
diff --git a/drivers/net/sfc/falcon.h b/drivers/net/sfc/falcon.h index 464c2747260f..875b58e94e8e 100644 --- a/drivers/net/sfc/falcon.h +++ b/drivers/net/sfc/falcon.h | |||
@@ -30,6 +30,14 @@ static inline int efx_nic_rev(struct efx_nic *efx) | |||
30 | return efx->type->revision; | 30 | return efx->type->revision; |
31 | } | 31 | } |
32 | 32 | ||
33 | extern u32 efx_nic_fpga_ver(struct efx_nic *efx); | ||
34 | |||
35 | /* NIC has two interlinked PCI functions for the same port. */ | ||
36 | static inline bool efx_nic_is_dual_func(struct efx_nic *efx) | ||
37 | { | ||
38 | return efx_nic_rev(efx) < EFX_REV_FALCON_B0; | ||
39 | } | ||
40 | |||
33 | /** | 41 | /** |
34 | * struct falcon_board_type - board operations and type information | 42 | * struct falcon_board_type - board operations and type information |
35 | * @id: Board type id, as found in NVRAM | 43 | * @id: Board type id, as found in NVRAM |
@@ -108,49 +116,65 @@ extern struct efx_nic_type falcon_b0_nic_type; | |||
108 | extern void falcon_probe_board(struct efx_nic *efx, u16 revision_info); | 116 | extern void falcon_probe_board(struct efx_nic *efx, u16 revision_info); |
109 | 117 | ||
110 | /* TX data path */ | 118 | /* TX data path */ |
111 | extern int falcon_probe_tx(struct efx_tx_queue *tx_queue); | 119 | extern int efx_nic_probe_tx(struct efx_tx_queue *tx_queue); |
112 | extern void falcon_init_tx(struct efx_tx_queue *tx_queue); | 120 | extern void efx_nic_init_tx(struct efx_tx_queue *tx_queue); |
113 | extern void falcon_fini_tx(struct efx_tx_queue *tx_queue); | 121 | extern void efx_nic_fini_tx(struct efx_tx_queue *tx_queue); |
114 | extern void falcon_remove_tx(struct efx_tx_queue *tx_queue); | 122 | extern void efx_nic_remove_tx(struct efx_tx_queue *tx_queue); |
115 | extern void falcon_push_buffers(struct efx_tx_queue *tx_queue); | 123 | extern void efx_nic_push_buffers(struct efx_tx_queue *tx_queue); |
116 | 124 | ||
117 | /* RX data path */ | 125 | /* RX data path */ |
118 | extern int falcon_probe_rx(struct efx_rx_queue *rx_queue); | 126 | extern int efx_nic_probe_rx(struct efx_rx_queue *rx_queue); |
119 | extern void falcon_init_rx(struct efx_rx_queue *rx_queue); | 127 | extern void efx_nic_init_rx(struct efx_rx_queue *rx_queue); |
120 | extern void falcon_fini_rx(struct efx_rx_queue *rx_queue); | 128 | extern void efx_nic_fini_rx(struct efx_rx_queue *rx_queue); |
121 | extern void falcon_remove_rx(struct efx_rx_queue *rx_queue); | 129 | extern void efx_nic_remove_rx(struct efx_rx_queue *rx_queue); |
122 | extern void falcon_notify_rx_desc(struct efx_rx_queue *rx_queue); | 130 | extern void efx_nic_notify_rx_desc(struct efx_rx_queue *rx_queue); |
123 | 131 | ||
124 | /* Event data path */ | 132 | /* Event data path */ |
125 | extern int falcon_probe_eventq(struct efx_channel *channel); | 133 | extern int efx_nic_probe_eventq(struct efx_channel *channel); |
126 | extern void falcon_init_eventq(struct efx_channel *channel); | 134 | extern void efx_nic_init_eventq(struct efx_channel *channel); |
127 | extern void falcon_fini_eventq(struct efx_channel *channel); | 135 | extern void efx_nic_fini_eventq(struct efx_channel *channel); |
128 | extern void falcon_remove_eventq(struct efx_channel *channel); | 136 | extern void efx_nic_remove_eventq(struct efx_channel *channel); |
129 | extern int falcon_process_eventq(struct efx_channel *channel, int rx_quota); | 137 | extern int efx_nic_process_eventq(struct efx_channel *channel, int rx_quota); |
130 | extern void falcon_eventq_read_ack(struct efx_channel *channel); | 138 | extern void efx_nic_eventq_read_ack(struct efx_channel *channel); |
131 | 139 | ||
132 | /* MAC/PHY */ | 140 | /* MAC/PHY */ |
133 | extern void falcon_drain_tx_fifo(struct efx_nic *efx); | 141 | extern void falcon_drain_tx_fifo(struct efx_nic *efx); |
134 | extern void falcon_reconfigure_mac_wrapper(struct efx_nic *efx); | 142 | extern void falcon_reconfigure_mac_wrapper(struct efx_nic *efx); |
143 | extern int efx_nic_rx_xoff_thresh, efx_nic_rx_xon_thresh; | ||
135 | 144 | ||
136 | /* Interrupts and test events */ | 145 | /* Interrupts and test events */ |
137 | extern int falcon_init_interrupt(struct efx_nic *efx); | 146 | extern int efx_nic_init_interrupt(struct efx_nic *efx); |
138 | extern void falcon_enable_interrupts(struct efx_nic *efx); | 147 | extern void efx_nic_enable_interrupts(struct efx_nic *efx); |
139 | extern void falcon_generate_test_event(struct efx_channel *channel, | 148 | extern void efx_nic_generate_test_event(struct efx_channel *channel, |
140 | unsigned int magic); | 149 | unsigned int magic); |
141 | extern void falcon_generate_interrupt(struct efx_nic *efx); | 150 | extern void efx_nic_generate_interrupt(struct efx_nic *efx); |
142 | extern void falcon_disable_interrupts(struct efx_nic *efx); | 151 | extern void efx_nic_disable_interrupts(struct efx_nic *efx); |
143 | extern void falcon_fini_interrupt(struct efx_nic *efx); | 152 | extern void efx_nic_fini_interrupt(struct efx_nic *efx); |
144 | 153 | extern irqreturn_t efx_nic_fatal_interrupt(struct efx_nic *efx); | |
145 | #define FALCON_IRQ_MOD_RESOLUTION 5 | 154 | extern irqreturn_t falcon_legacy_interrupt_a1(int irq, void *dev_id); |
155 | extern void falcon_irq_ack_a1(struct efx_nic *efx); | ||
156 | |||
157 | #define EFX_IRQ_MOD_RESOLUTION 5 | ||
146 | 158 | ||
147 | /* Global Resources */ | 159 | /* Global Resources */ |
148 | extern int falcon_flush_queues(struct efx_nic *efx); | 160 | extern int efx_nic_flush_queues(struct efx_nic *efx); |
149 | extern void falcon_start_nic_stats(struct efx_nic *efx); | 161 | extern void falcon_start_nic_stats(struct efx_nic *efx); |
150 | extern void falcon_stop_nic_stats(struct efx_nic *efx); | 162 | extern void falcon_stop_nic_stats(struct efx_nic *efx); |
151 | extern int falcon_reset_xaui(struct efx_nic *efx); | 163 | extern int falcon_reset_xaui(struct efx_nic *efx); |
164 | extern void efx_nic_init_common(struct efx_nic *efx); | ||
165 | |||
166 | int efx_nic_alloc_buffer(struct efx_nic *efx, struct efx_buffer *buffer, | ||
167 | unsigned int len); | ||
168 | void efx_nic_free_buffer(struct efx_nic *efx, struct efx_buffer *buffer); | ||
152 | 169 | ||
153 | /* Tests */ | 170 | /* Tests */ |
171 | struct efx_nic_register_test { | ||
172 | unsigned address; | ||
173 | efx_oword_t mask; | ||
174 | }; | ||
175 | extern int efx_nic_test_registers(struct efx_nic *efx, | ||
176 | const struct efx_nic_register_test *regs, | ||
177 | size_t n_regs); | ||
154 | 178 | ||
155 | /************************************************************************** | 179 | /************************************************************************** |
156 | * | 180 | * |
@@ -186,8 +210,8 @@ extern int falcon_reset_xaui(struct efx_nic *efx); | |||
186 | #define MAC_DATA_LBN 0 | 210 | #define MAC_DATA_LBN 0 |
187 | #define MAC_DATA_WIDTH 32 | 211 | #define MAC_DATA_WIDTH 32 |
188 | 212 | ||
189 | extern void falcon_generate_event(struct efx_channel *channel, | 213 | extern void efx_nic_generate_event(struct efx_channel *channel, |
190 | efx_qword_t *event); | 214 | efx_qword_t *event); |
191 | 215 | ||
192 | extern void falcon_poll_xmac(struct efx_nic *efx); | 216 | extern void falcon_poll_xmac(struct efx_nic *efx); |
193 | 217 | ||