aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/sfc/falcon.h
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/sfc/falcon.h')
-rw-r--r--drivers/net/sfc/falcon.h80
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
33extern u32 efx_nic_fpga_ver(struct efx_nic *efx);
34
35/* NIC has two interlinked PCI functions for the same port. */
36static 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;
108extern void falcon_probe_board(struct efx_nic *efx, u16 revision_info); 116extern void falcon_probe_board(struct efx_nic *efx, u16 revision_info);
109 117
110/* TX data path */ 118/* TX data path */
111extern int falcon_probe_tx(struct efx_tx_queue *tx_queue); 119extern int efx_nic_probe_tx(struct efx_tx_queue *tx_queue);
112extern void falcon_init_tx(struct efx_tx_queue *tx_queue); 120extern void efx_nic_init_tx(struct efx_tx_queue *tx_queue);
113extern void falcon_fini_tx(struct efx_tx_queue *tx_queue); 121extern void efx_nic_fini_tx(struct efx_tx_queue *tx_queue);
114extern void falcon_remove_tx(struct efx_tx_queue *tx_queue); 122extern void efx_nic_remove_tx(struct efx_tx_queue *tx_queue);
115extern void falcon_push_buffers(struct efx_tx_queue *tx_queue); 123extern void efx_nic_push_buffers(struct efx_tx_queue *tx_queue);
116 124
117/* RX data path */ 125/* RX data path */
118extern int falcon_probe_rx(struct efx_rx_queue *rx_queue); 126extern int efx_nic_probe_rx(struct efx_rx_queue *rx_queue);
119extern void falcon_init_rx(struct efx_rx_queue *rx_queue); 127extern void efx_nic_init_rx(struct efx_rx_queue *rx_queue);
120extern void falcon_fini_rx(struct efx_rx_queue *rx_queue); 128extern void efx_nic_fini_rx(struct efx_rx_queue *rx_queue);
121extern void falcon_remove_rx(struct efx_rx_queue *rx_queue); 129extern void efx_nic_remove_rx(struct efx_rx_queue *rx_queue);
122extern void falcon_notify_rx_desc(struct efx_rx_queue *rx_queue); 130extern void efx_nic_notify_rx_desc(struct efx_rx_queue *rx_queue);
123 131
124/* Event data path */ 132/* Event data path */
125extern int falcon_probe_eventq(struct efx_channel *channel); 133extern int efx_nic_probe_eventq(struct efx_channel *channel);
126extern void falcon_init_eventq(struct efx_channel *channel); 134extern void efx_nic_init_eventq(struct efx_channel *channel);
127extern void falcon_fini_eventq(struct efx_channel *channel); 135extern void efx_nic_fini_eventq(struct efx_channel *channel);
128extern void falcon_remove_eventq(struct efx_channel *channel); 136extern void efx_nic_remove_eventq(struct efx_channel *channel);
129extern int falcon_process_eventq(struct efx_channel *channel, int rx_quota); 137extern int efx_nic_process_eventq(struct efx_channel *channel, int rx_quota);
130extern void falcon_eventq_read_ack(struct efx_channel *channel); 138extern void efx_nic_eventq_read_ack(struct efx_channel *channel);
131 139
132/* MAC/PHY */ 140/* MAC/PHY */
133extern void falcon_drain_tx_fifo(struct efx_nic *efx); 141extern void falcon_drain_tx_fifo(struct efx_nic *efx);
134extern void falcon_reconfigure_mac_wrapper(struct efx_nic *efx); 142extern void falcon_reconfigure_mac_wrapper(struct efx_nic *efx);
143extern int efx_nic_rx_xoff_thresh, efx_nic_rx_xon_thresh;
135 144
136/* Interrupts and test events */ 145/* Interrupts and test events */
137extern int falcon_init_interrupt(struct efx_nic *efx); 146extern int efx_nic_init_interrupt(struct efx_nic *efx);
138extern void falcon_enable_interrupts(struct efx_nic *efx); 147extern void efx_nic_enable_interrupts(struct efx_nic *efx);
139extern void falcon_generate_test_event(struct efx_channel *channel, 148extern void efx_nic_generate_test_event(struct efx_channel *channel,
140 unsigned int magic); 149 unsigned int magic);
141extern void falcon_generate_interrupt(struct efx_nic *efx); 150extern void efx_nic_generate_interrupt(struct efx_nic *efx);
142extern void falcon_disable_interrupts(struct efx_nic *efx); 151extern void efx_nic_disable_interrupts(struct efx_nic *efx);
143extern void falcon_fini_interrupt(struct efx_nic *efx); 152extern void efx_nic_fini_interrupt(struct efx_nic *efx);
144 153extern irqreturn_t efx_nic_fatal_interrupt(struct efx_nic *efx);
145#define FALCON_IRQ_MOD_RESOLUTION 5 154extern irqreturn_t falcon_legacy_interrupt_a1(int irq, void *dev_id);
155extern 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 */
148extern int falcon_flush_queues(struct efx_nic *efx); 160extern int efx_nic_flush_queues(struct efx_nic *efx);
149extern void falcon_start_nic_stats(struct efx_nic *efx); 161extern void falcon_start_nic_stats(struct efx_nic *efx);
150extern void falcon_stop_nic_stats(struct efx_nic *efx); 162extern void falcon_stop_nic_stats(struct efx_nic *efx);
151extern int falcon_reset_xaui(struct efx_nic *efx); 163extern int falcon_reset_xaui(struct efx_nic *efx);
164extern void efx_nic_init_common(struct efx_nic *efx);
165
166int efx_nic_alloc_buffer(struct efx_nic *efx, struct efx_buffer *buffer,
167 unsigned int len);
168void efx_nic_free_buffer(struct efx_nic *efx, struct efx_buffer *buffer);
152 169
153/* Tests */ 170/* Tests */
171struct efx_nic_register_test {
172 unsigned address;
173 efx_oword_t mask;
174};
175extern 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
189extern void falcon_generate_event(struct efx_channel *channel, 213extern void efx_nic_generate_event(struct efx_channel *channel,
190 efx_qword_t *event); 214 efx_qword_t *event);
191 215
192extern void falcon_poll_xmac(struct efx_nic *efx); 216extern void falcon_poll_xmac(struct efx_nic *efx);
193 217