iPXE
|
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <ipxe/io.h>
#include <errno.h>
#include <byteswap.h>
#include <ipxe/pci.h>
#include <ipxe/malloc.h>
#include <ipxe/if_ether.h>
#include <ipxe/ethernet.h>
#include <ipxe/iobuf.h>
#include <ipxe/netdevice.h>
#include <ipxe/timer.h>
#include <nic.h>
#include "vxge_main.h"
#include "vxge_reg.h"
Go to the source code of this file.
Functions | |
FILE_LICENCE (GPL2_ONLY) | |
static int | is_vxge_card_up (struct vxgedev *vdev) |
enum vxge_hw_status | vxge_xmit_compl (struct __vxge_hw_fifo *fifo_hw, struct vxge_hw_fifo_txd *txdp, enum vxge_hw_fifo_tcode tcode) |
enum vxge_hw_status | vxge_reset_all_vpaths (struct vxgedev *vdev) |
void | vxge_close_vpaths (struct vxgedev *vdev) |
int | vxge_open_vpaths (struct vxgedev *vdev) |
static int | vxge_xmit (struct net_device *dev, struct io_buffer *iobuf) |
Functions that implement the iPXE driver API. More... | |
static void | vxge_poll (struct net_device *ndev) |
static void | vxge_irq (struct net_device *netdev __unused, int action) |
int | vxge_open (struct net_device *dev) |
vxge_open @dev: pointer to the device structure. More... | |
static void | vxge_close (struct net_device *dev) |
vxge_close @dev: device pointer. More... | |
int | vxge_device_register (struct __vxge_hw_device *hldev, struct vxgedev **vdev_out) |
void | vxge_device_unregister (struct __vxge_hw_device *hldev) |
static int | vxge_probe (struct pci_device *pdev) |
vxge_probe @pdev : structure containing the PCI related information of the device. More... | |
static void | vxge_remove (struct pci_device *pdev) |
vxge_remove - Free the PCI device @pdev: structure containing the PCI related information of the device. More... | |
Variables | |
static char * | vxge_func_mode_names [] |
static struct net_device_operations | vxge_operations |
static struct pci_device_id | vxge_main_nics [] |
struct pci_driver vxge_driver | __pci_driver |
FILE_LICENCE | ( | GPL2_ONLY | ) |
|
inlinestatic |
Definition at line 51 of file vxge_main.c.
References __VXGE_STATE_CARD_UP, vxgedev::state, and test_bit.
Referenced by vxge_close(), vxge_poll(), vxge_reset_all_vpaths(), and vxge_xmit().
enum vxge_hw_status vxge_xmit_compl | ( | struct __vxge_hw_fifo * | fifo_hw, |
struct vxge_hw_fifo_txd * | txdp, | ||
enum vxge_hw_fifo_tcode | tcode | ||
) |
Definition at line 65 of file vxge_main.c.
References EINVAL, __vxge_hw_virtualpath::hldev, memset(), net_device::name, __vxge_hw_device::ndev, netdev, netdev_tx_complete(), netdev_tx_complete_err(), NULL, txdp, __vxge_hw_fifo::vpathh, vxge_debug, VXGE_ERR, VXGE_HW_FIFO_T_CODE_OK, VXGE_HW_OK, and vxge_trace.
Referenced by vxge_hw_vpath_poll_tx().
enum vxge_hw_status vxge_reset_all_vpaths | ( | struct vxgedev * | vdev | ) |
Definition at line 91 of file vxge_main.c.
References __vxge_hw_vpath_reset_check(), is_vxge_card_up(), status, vxgedev::vpath, vxge_vpath::vpathh, vxge_debug, VXGE_ERR, VXGE_HW_OK, vxge_hw_vpath_recover_from_reset(), vxge_hw_vpath_reset(), and vxge_trace.
Referenced by vxge_close().
void vxge_close_vpaths | ( | struct vxgedev * | vdev | ) |
Definition at line 125 of file vxge_main.c.
References vxge_vpath::is_open, NULL, vxgedev::vpath, vxge_vpath::vpathh, and vxge_hw_vpath_close().
Referenced by vxge_close(), vxge_open(), and vxge_open_vpaths().
int vxge_open_vpaths | ( | struct vxgedev * | vdev | ) |
Definition at line 136 of file vxge_main.c.
References vxgedev::devh, vxge_vpath::device_id, vxge_vpath::fifo, vxge_fifo::fifoh, __vxge_hw_virtualpath::fifoh, vxge_vpath::is_open, net_device::name, vxge_fifo::ndev, vxge_ring::ndev, vxgedev::ndev, pci_get_drvdata(), vxge_fifo::pdev, vxge_ring::pdev, vxgedev::pdev, vxge_vpath::ring, vxge_ring::ringh, __vxge_hw_virtualpath::ringh, status, __vxge_hw_device::vdev, __vxge_hw_device::virtual_path, __vxge_hw_virtualpath::vp_id, vxgedev::vpath, vxge_vpath::vpathh, __vxge_hw_device::vpaths_deployed, vxge_close_vpaths(), vxge_debug, VXGE_ERR, VXGE_HW_OK, vxge_hw_vpath_open(), and vxge_mBIT.
Referenced by vxge_open().
|
static |
Functions that implement the iPXE driver API.
vxge_xmit @skb : the socket buffer containing the Tx data. @dev : device pointer.
This function is the Tx entry point of the driver. Neterion NIC supports certain protocol assist features on Tx side, namely CSO, S/G, LSO.
Definition at line 180 of file vxge_main.c.
References EIO, ENETDOWN, ENOBUFS, vxge_vpath::fifo, vxge_fifo::fifoh, if(), is_vxge_card_up(), net_device::name, netdev_link_ok(), NULL, net_device::priv, __vxge_hw_fifo::sw_offset, txdp, vxgedev::vpath, vxge_debug, VXGE_ERR, vxge_hw_fifo_free_txdl_get(), vxge_hw_fifo_txdl_buffer_set(), vxge_hw_fifo_txdl_post(), vxge_trace, and VXGE_XMIT.
|
static |
Definition at line 231 of file vxge_main.c.
References __vxge_hw_virtualpath::fifoh, is_vxge_card_up(), vxgedev::ndev, pci_get_drvdata(), vxgedev::pdev, net_device::priv, __vxge_hw_virtualpath::ringh, __vxge_hw_device::virtual_path, vxge_debug, vxge_hw_device_begin_irq(), vxge_hw_vpath_poll_rx(), vxge_hw_vpath_poll_tx(), and VXGE_POLL.
|
static |
Definition at line 258 of file vxge_main.c.
References DISABLE, netdev, pci_get_drvdata(), vxgedev::pdev, net_device::priv, vxge_debug, vxge_hw_device_mask_all(), vxge_hw_device_unmask_all(), and VXGE_INFO.
int vxge_open | ( | struct net_device * | dev | ) |
vxge_open @dev: pointer to the device structure.
This function is the open entry point of the driver. It mainly calls a function to allocate Rx buffers and inserts them into the buffer descriptors and then enables the Rx part of the NIC. Return value: '0' on success and an appropriate (-)ve integer as defined in errno.h file on failure.
Definition at line 290 of file vxge_main.c.
References __VXGE_STATE_CARD_UP, vxgedev::devh, EPERM, vxgedev::mtu, net_device::name, vxgedev::ndev, netdev_link_down(), netdev_link_up(), pci_get_drvdata(), vxgedev::pdev, net_device::priv, set_bit(), vxgedev::state, status, __vxge_hw_device::vdev, vxgedev::vpath, vxge_vpath::vpathh, vxge_close_vpaths(), vxge_debug, VXGE_DRIVER_NAME, VXGE_ERR, VXGE_HW_DEFAULT_MTU, vxge_hw_device_intr_enable(), vxge_hw_device_link_state_get(), VXGE_HW_LINK_UP, VXGE_HW_OK, vxge_hw_vpath_enable(), vxge_hw_vpath_mtu_set(), vxge_hw_vpath_rx_doorbell_init(), VXGE_INFO, vxge_open_vpaths(), and wmb().
|
static |
vxge_close @dev: device pointer.
This is the stop entry point of the driver. It needs to undo exactly whatever was done by the open entry point, thus it's usually referred to as the close function.Among other things this function mainly stops the Rx side of the NIC and frees all the Rx buffers in the Rx rings. Return value: '0' on success and an appropriate (-)ve integer as defined in errno.h file on failure.
Definition at line 364 of file vxge_main.c.
References __VXGE_STATE_CARD_UP, clear_bit(), vxge_hw_device_hw_info::function_mode, __vxge_hw_device::hw_info, is_mf, is_vxge_card_up(), net_device::name, vxgedev::ndev, netdev_link_down(), pci_get_drvdata(), vxgedev::pdev, net_device::priv, vxgedev::state, __vxge_hw_device::vdev, vxge_close_vpaths(), vxge_debug, vxge_hw_device_intr_disable(), vxge_hw_device_unmask_all(), vxge_hw_vpath_set_zero_rx_frm_len(), VXGE_INFO, and vxge_reset_all_vpaths().
int vxge_device_register | ( | struct __vxge_hw_device * | hldev, |
struct vxgedev ** | vdev_out | ||
) |
Definition at line 404 of file vxge_main.c.
References alloc_etherdev(), pci_device::dev, net_device::dev, vxgedev::devh, ENODEV, ETH_ALEN, __vxge_hw_device::first_vp_id, net_device::hw_addr, __vxge_hw_device::hw_info, memcpy(), memset(), vxgedev::ndev, netdev_init(), netdev_put(), NULL, vxgedev::pdev, __vxge_hw_device::pdev, net_device::priv, register_netdev(), vxge_debug, VXGE_DRIVER_NAME, VXGE_ERR, VXGE_INFO, and vxge_operations.
Referenced by vxge_probe().
void vxge_device_unregister | ( | struct __vxge_hw_device * | hldev | ) |
Definition at line 468 of file vxge_main.c.
References __vxge_hw_device::ndev, netdev_nullify(), netdev_put(), unregister_netdev(), vxge_debug, VXGE_DRIVER_NAME, and VXGE_INFO.
Referenced by vxge_remove().
|
static |
vxge_probe @pdev : structure containing the PCI related information of the device.
@id: List of PCI devices supported by the driver listed in vxge_id_table. Description: This function is called when a new PCI device gets detected and initializes it. Return value: returns 0 on success and negative on failure.
Definition at line 494 of file vxge_main.c.
References adjust_pci_device(), vxgedev::bar0, vxge_hw_device_version::build, vxge_hw_device_date::date, pci_device::device, vxge_vpath::device_id, EACCES, EINVAL, ENODEV, ETH_ALEN, eth_ntoa(), __vxge_hw_device::first_vp_id, vxge_hw_device_hw_info::func_id, vxge_hw_device_hw_info::function_mode, vxge_hw_device_hw_info::fw_date, vxge_hw_device_hw_info::fw_version, __vxge_hw_device::hw_info, iounmap(), is_titan1, vxge_hw_device_version::major, memcpy(), vxge_hw_device_version::minor, vxgedev::mtu, vxgedev::ndev, __vxge_hw_device::ndev, NULL, vxge_hw_device_hw_info::part_number, PCI_ARGS, pci_bar_size(), pci_bar_start(), PCI_BASE_ADDRESS_0, PCI_FMT, pci_ioremap(), pci_read_config_byte(), PCI_REVISION, pci_set_drvdata(), __vxge_hw_device::pdev, printf(), vxge_hw_device_hw_info::product_desc, revision, vxge_hw_device_hw_info::serial_number, status, vxgedev::titan1, vxge_vpath::vdev, __vxge_hw_device::vdev, vxge_hw_device_version::version, vxgedev::vpath, vxge_hw_device_hw_info::vpath_mask, VXGE_CERT_FW_VER_BUILD, VXGE_CERT_FW_VER_MAJOR, VXGE_CERT_FW_VER_MINOR, vxge_debug, vxge_device_register(), VXGE_DRIVER_NAME, VXGE_ERR, vxge_func_mode_names, VXGE_HW_DEFAULT_MTU, vxge_hw_device_hw_info_get(), vxge_hw_device_initialize(), vxge_hw_device_terminate(), vxge_hw_get_func_mode(), VXGE_HW_INFO_LEN, VXGE_HW_MAX_VIRTUAL_PATHS, VXGE_HW_OK, vxge_hw_vpath_strip_fcs_check(), VXGE_INFO, and vxge_mBIT.
|
static |
vxge_remove - Free the PCI device @pdev: structure containing the PCI related information of the device.
Description: This function is called by the Pci subsystem to release a PCI device and free up all resource held up by the device.
Definition at line 673 of file vxge_main.c.
References vxgedev::bar0, iounmap(), __vxge_hw_device::ndev, NULL, pci_get_drvdata(), pci_set_drvdata(), __vxge_hw_device::pdev, net_device::priv, __vxge_hw_device::vdev, vxge_debug, vxge_device_unregister(), vxge_hw_device_terminate(), and VXGE_INFO.
|
static |
Definition at line 36 of file vxge_main.c.
Referenced by vxge_probe().
|
static |
Definition at line 402 of file vxge_main.c.
Referenced by vxge_device_register().
|
static |
Definition at line 708 of file vxge_main.c.
struct pci_driver vxge_driver __pci_driver |
Definition at line 713 of file vxge_main.c.