iPXE
efx_hunt.h
Go to the documentation of this file.
00001 /**************************************************************************
00002  *
00003  * GPL net driver for Solarflare network cards
00004  *
00005  * Written by Shradha Shah <sshah@solarflare.com>
00006  *
00007  * Copyright 2012-2017 Solarflare Communications Inc.
00008  *
00009  * This program is free software; you can redistribute it and/or
00010  * modify it under the terms of the GNU General Public License as
00011  * published by the Free Software Foundation; either version 2 of the
00012  * License, or any later version.
00013  *
00014  * You can also choose to distribute this program under the terms of
00015  * the Unmodified Binary Distribution Licence (as given in the file
00016  * COPYING.UBDL), provided that you have satisfied its requirements.
00017  *
00018  ***************************************************************************/
00019 
00020 #ifndef EFX_HUNT_H
00021 #define EFX_HUNT_H
00022 
00023 #include "efx_common.h"
00024 
00025 FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
00026 
00027 /**************************************************************************
00028  *
00029  * Hardware data structures and sizing
00030  *
00031  ***************************************************************************/
00032 
00033 #define EFX_EV_SIZE(_nevs)     ((_nevs) * sizeof(efx_qword_t))
00034 #define EFX_EVQ_NBUFS(_nevs)    (EFX_EV_SIZE(_nevs) / EFX_BUF_ALIGN)
00035 
00036 #define EFX_RXQ_SIZE(_ndescs)   ((_ndescs) * sizeof(efx_qword_t))
00037 #define EFX_RXQ_NBUFS(_ndescs)  (EFX_RXQ_SIZE(_ndescs) / EFX_BUF_ALIGN)
00038 
00039 #define EFX_TXQ_SIZE(_ndescs)   ((_ndescs) * sizeof(efx_qword_t))
00040 #define EFX_TXQ_NBUFS(_ndescs)  (EFX_TXQ_SIZE(_ndescs) / EFX_BUF_ALIGN)
00041 
00042 /** MCDI request structure */
00043 struct efx_mcdi_req_s {
00044         unsigned int    emr_cmd;
00045         efx_dword_t     *emr_in_buf;
00046         size_t          emr_in_length;
00047         int             emr_rc;
00048         efx_dword_t     *emr_out_buf;
00049         size_t          emr_out_length;
00050         size_t          emr_out_length_used;
00051 };
00052 
00053 /*******************************************************************************
00054  *
00055  *
00056  * Hardware API
00057  *
00058  *
00059  ******************************************************************************/
00060 
00061 extern void efx_hunt_free_special_buffer(void *buf, int bytes);
00062 
00063 /* Data path entry points */
00064 extern int efx_hunt_transmit(struct net_device *netdev, struct io_buffer *iob);
00065 extern void efx_hunt_poll(struct net_device *netdev);
00066 extern void efx_hunt_irq(struct net_device *netdev, int enable);
00067 
00068 /* Initialisation */
00069 extern int efx_hunt_ev_init(struct net_device *netdev, dma_addr_t *dma_addr);
00070 extern int efx_hunt_rx_init(struct net_device *netdev, dma_addr_t *dma_addr);
00071 extern int efx_hunt_tx_init(struct net_device *netdev, dma_addr_t *dma_addr);
00072 extern int efx_hunt_open(struct net_device *netdev);
00073 extern void efx_hunt_close(struct net_device *netdev);
00074 
00075 #endif /* EFX_HUNT_H */