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 <sshah@solarflare.com>
6  *
7  * Copyright 2012-2017 Solarflare Communications Inc.
8  *
9  * This program is free software; you can redistribute it and/or
10  * modify it under the terms of the GNU General Public License as
11  * published by the Free Software Foundation; either version 2 of the
12  * License, or any later version.
13  *
14  * You can also choose to distribute this program under the terms of
15  * the Unmodified Binary Distribution Licence (as given in the file
16  * COPYING.UBDL), provided that you have satisfied its requirements.
17  *
18  ***************************************************************************/
19 
20 #ifndef EFX_HUNT_H
21 #define EFX_HUNT_H
22 
23 #include "efx_common.h"
24 
25 FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
26 
27 /**************************************************************************
28  *
29  * Hardware data structures and sizing
30  *
31  ***************************************************************************/
32 
33 #define EFX_EV_SIZE(_nevs) ((_nevs) * sizeof(efx_qword_t))
34 #define EFX_EVQ_NBUFS(_nevs) (EFX_EV_SIZE(_nevs) / EFX_BUF_ALIGN)
35 
36 #define EFX_RXQ_SIZE(_ndescs) ((_ndescs) * sizeof(efx_qword_t))
37 #define EFX_RXQ_NBUFS(_ndescs) (EFX_RXQ_SIZE(_ndescs) / EFX_BUF_ALIGN)
38 
39 #define EFX_TXQ_SIZE(_ndescs) ((_ndescs) * sizeof(efx_qword_t))
40 #define EFX_TXQ_NBUFS(_ndescs) (EFX_TXQ_SIZE(_ndescs) / EFX_BUF_ALIGN)
41 
42 /** MCDI request structure */
44  unsigned int emr_cmd;
46  size_t emr_in_length;
47  int emr_rc;
51 };
52 
53 /*******************************************************************************
54  *
55  *
56  * Hardware API
57  *
58  *
59  ******************************************************************************/
60 
61 extern void efx_hunt_free_special_buffer(void *buf, int bytes);
62 
63 /* Data path entry points */
64 extern int efx_hunt_transmit(struct net_device *netdev, struct io_buffer *iob);
65 extern void efx_hunt_poll(struct net_device *netdev);
66 extern void efx_hunt_irq(struct net_device *netdev, int enable);
67 
68 /* Initialisation */
69 extern int efx_hunt_ev_init(struct net_device *netdev, dma_addr_t *dma_addr);
70 extern int efx_hunt_rx_init(struct net_device *netdev, dma_addr_t *dma_addr);
71 extern int efx_hunt_tx_init(struct net_device *netdev, dma_addr_t *dma_addr);
72 extern int efx_hunt_open(struct net_device *netdev);
73 extern void efx_hunt_close(struct net_device *netdev);
74 
75 #endif /* EFX_HUNT_H */
size_t emr_in_length
Definition: efx_hunt.h:46
int efx_hunt_ev_init(struct net_device *netdev, dma_addr_t *dma_addr)
Definition: efx_hunt.c:294
int efx_hunt_open(struct net_device *netdev)
Definition: efx_hunt.c:465
efx_dword_t * emr_out_buf
Definition: efx_hunt.h:48
void efx_hunt_poll(struct net_device *netdev)
Definition: efx_hunt.c:404
size_t emr_out_length_used
Definition: efx_hunt.h:50
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:270
size_t emr_out_length
Definition: efx_hunt.h:49
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:155
efx_dword_t * emr_in_buf
Definition: efx_hunt.h:45
FILE_LICENCE(GPL2_OR_LATER_OR_UBDL)
unsigned int emr_cmd
Definition: efx_hunt.h:44
A network device.
Definition: netdevice.h:348
void efx_hunt_irq(struct net_device *netdev, int enable)
Definition: efx_hunt.c:443
int efx_hunt_transmit(struct net_device *netdev, struct io_buffer *iob)
Definition: efx_hunt.c:100
void efx_hunt_close(struct net_device *netdev)
Definition: efx_hunt.c:486
void efx_hunt_free_special_buffer(void *buf, int bytes)
Definition: efx_hunt.c:38
uint8_t bytes[64]
Definition: ib_mad.h:16
MCDI request structure.
Definition: efx_hunt.h:43
A persistent I/O buffer.
Definition: iobuf.h:32