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
26FILE_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 */
53
54/*******************************************************************************
55 *
56 *
57 * Hardware API
58 *
59 *
60 ******************************************************************************/
61
62extern void efx_hunt_free_special_buffer(void *buf, int bytes);
63
64/* Data path entry points */
65extern int efx_hunt_transmit(struct net_device *netdev, struct io_buffer *iob);
66extern void efx_hunt_poll(struct net_device *netdev);
67extern void efx_hunt_irq(struct net_device *netdev, int enable);
68
69/* Initialisation */
70extern int efx_hunt_ev_init(struct net_device *netdev, dma_addr_t *dma_addr);
71extern int efx_hunt_rx_init(struct net_device *netdev, dma_addr_t *dma_addr);
72extern int efx_hunt_tx_init(struct net_device *netdev, dma_addr_t *dma_addr);
73extern int efx_hunt_open(struct net_device *netdev);
74extern void efx_hunt_close(struct net_device *netdev);
75
76#endif /* EFX_HUNT_H */
union efx_dword efx_dword_t
A doubleword (4 byte) datatype - little-endian in HW.
void efx_hunt_free_special_buffer(void *buf, int bytes)
Definition efx_hunt.c:40
int efx_hunt_open(struct net_device *netdev)
Definition efx_hunt.c:467
void efx_hunt_close(struct net_device *netdev)
Definition efx_hunt.c:488
int efx_hunt_ev_init(struct net_device *netdev, dma_addr_t *dma_addr)
Definition efx_hunt.c:296
int efx_hunt_rx_init(struct net_device *netdev, dma_addr_t *dma_addr)
Definition efx_hunt.c:272
void efx_hunt_poll(struct net_device *netdev)
Definition efx_hunt.c:406
int efx_hunt_transmit(struct net_device *netdev, struct io_buffer *iob)
Definition efx_hunt.c:102
void efx_hunt_irq(struct net_device *netdev, int enable)
Definition efx_hunt.c:445
int efx_hunt_tx_init(struct net_device *netdev, dma_addr_t *dma_addr)
Definition efx_hunt.c:157
#define dma_addr_t
static struct net_device * netdev
Definition gdbudp.c:53
#define FILE_LICENCE(_licence)
Declare a particular licence as applying to a file.
Definition compiler.h:896
uint8_t bytes[64]
Definition ib_mad.h:5
MCDI request structure.
Definition efx_hunt.h:44
size_t emr_out_length
Definition efx_hunt.h:50
efx_dword_t * emr_in_buf
Definition efx_hunt.h:46
size_t emr_out_length_used
Definition efx_hunt.h:51
size_t emr_in_length
Definition efx_hunt.h:47
efx_dword_t * emr_out_buf
Definition efx_hunt.h:49
unsigned int emr_cmd
Definition efx_hunt.h:45
A persistent I/O buffer.
Definition iobuf.h:38
A network device.
Definition netdevice.h:353