iPXE
efx_hunt.h
Go to the documentation of this file.
1 /**************************************************************************
2  *
3  * GPL net driver for Solarflare network cards
4  *
5  * Written by Shradha Shah, maintained by <pre-boot-drivers@xilinx.com>
6  *
7  * Copyright 2012-2019 Solarflare Communications Inc.
8  * Copyright 2019-2020 Xilinx Inc.
9  *
10  * This program is free software; you can redistribute it and/or
11  * modify it under the terms of the GNU General Public License as
12  * published by the Free Software Foundation; either version 2 of the
13  * License, or any later version.
14  *
15  * You can also choose to distribute this program under the terms of
16  * the Unmodified Binary Distribution Licence (as given in the file
17  * COPYING.UBDL), provided that you have satisfied its requirements.
18  *
19  ***************************************************************************/
20 
21 #ifndef EFX_HUNT_H
22 #define EFX_HUNT_H
23 
24 #include "efx_common.h"
25 
26 FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
27 
28 /**************************************************************************
29  *
30  * Hardware data structures and sizing
31  *
32  ***************************************************************************/
33 
34 #define EFX_EV_SIZE(_nevs) ((_nevs) * sizeof(efx_qword_t))
35 #define EFX_EVQ_NBUFS(_nevs) (EFX_EV_SIZE(_nevs) / EFX_BUF_ALIGN)
36 
37 #define EFX_RXQ_SIZE(_ndescs) ((_ndescs) * sizeof(efx_qword_t))
38 #define EFX_RXQ_NBUFS(_ndescs) (EFX_RXQ_SIZE(_ndescs) / EFX_BUF_ALIGN)
39 
40 #define EFX_TXQ_SIZE(_ndescs) ((_ndescs) * sizeof(efx_qword_t))
41 #define EFX_TXQ_NBUFS(_ndescs) (EFX_TXQ_SIZE(_ndescs) / EFX_BUF_ALIGN)
42 
43 /** MCDI request structure */
45  unsigned int emr_cmd;
47  size_t emr_in_length;
48  int emr_rc;
52 };
53 
54 /*******************************************************************************
55  *
56  *
57  * Hardware API
58  *
59  *
60  ******************************************************************************/
61 
62 extern void efx_hunt_free_special_buffer(void *buf, int bytes);
63 
64 /* Data path entry points */
65 extern int efx_hunt_transmit(struct net_device *netdev, struct io_buffer *iob);
66 extern void efx_hunt_poll(struct net_device *netdev);
67 extern void efx_hunt_irq(struct net_device *netdev, int enable);
68 
69 /* Initialisation */
70 extern int efx_hunt_ev_init(struct net_device *netdev, dma_addr_t *dma_addr);
71 extern int efx_hunt_rx_init(struct net_device *netdev, dma_addr_t *dma_addr);
72 extern int efx_hunt_tx_init(struct net_device *netdev, dma_addr_t *dma_addr);
73 extern int efx_hunt_open(struct net_device *netdev);
74 extern void efx_hunt_close(struct net_device *netdev);
75 
76 #endif /* EFX_HUNT_H */
size_t emr_in_length
Definition: efx_hunt.h:47
int efx_hunt_ev_init(struct net_device *netdev, dma_addr_t *dma_addr)
Definition: efx_hunt.c:295
int efx_hunt_open(struct net_device *netdev)
Definition: efx_hunt.c:466
efx_dword_t * emr_out_buf
Definition: efx_hunt.h:49
void efx_hunt_poll(struct net_device *netdev)
Definition: efx_hunt.c:405
size_t emr_out_length_used
Definition: efx_hunt.h:51
unsigned long dma_addr_t
Definition: bnx2.h:20
A doubleword (4 byte) datatype - little-endian in HW.
Definition: efx_bitfield.h:87
int efx_hunt_rx_init(struct net_device *netdev, dma_addr_t *dma_addr)
Definition: efx_hunt.c:271
size_t emr_out_length
Definition: efx_hunt.h:50
static struct net_device * netdev
Definition: gdbudp.c:52
int efx_hunt_tx_init(struct net_device *netdev, dma_addr_t *dma_addr)
Definition: efx_hunt.c:156
efx_dword_t * emr_in_buf
Definition: efx_hunt.h:46
FILE_LICENCE(GPL2_OR_LATER_OR_UBDL)
unsigned int emr_cmd
Definition: efx_hunt.h:45
A network device.
Definition: netdevice.h:352
void efx_hunt_irq(struct net_device *netdev, int enable)
Definition: efx_hunt.c:444
int efx_hunt_transmit(struct net_device *netdev, struct io_buffer *iob)
Definition: efx_hunt.c:101
void efx_hunt_close(struct net_device *netdev)
Definition: efx_hunt.c:487
void efx_hunt_free_special_buffer(void *buf, int bytes)
Definition: efx_hunt.c:39
uint8_t bytes[64]
Definition: ib_mad.h:16
MCDI request structure.
Definition: efx_hunt.h:44
A persistent I/O buffer.
Definition: iobuf.h:33