iPXE
Functions | Variables
vxge_main.c File Reference
#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.
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 : pointer to the device structure.
static void vxge_close (struct net_device *dev)
 vxge_close : device pointer.
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 : structure containing the PCI related information of the device.
static void vxge_remove (struct pci_device *pdev)
 vxge_remove - Free the PCI device : structure containing the PCI related information of the device.

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

Function Documentation

FILE_LICENCE ( GPL2_ONLY  )
static int is_vxge_card_up ( struct vxgedev *  vdev) [inline, static]

Definition at line 51 of file vxge_main.c.

Referenced by vxge_close(), vxge_poll(), vxge_reset_all_vpaths(), and vxge_xmit().

{
        return test_bit(__VXGE_STATE_CARD_UP, vdev->state);
}
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, memset(), net_device::name, netdev, netdev_tx_complete(), netdev_tx_complete_err(), and NULL.

Referenced by vxge_hw_vpath_poll_tx().

{
        struct net_device *netdev;
        struct io_buffer *tx_iob = NULL;

        vxge_trace();

        netdev = fifo_hw->vpathh->hldev->ndev;

        tx_iob = (struct io_buffer *)(intptr_t)txdp->host_control;

        if (tcode == VXGE_HW_FIFO_T_CODE_OK) {
                netdev_tx_complete(netdev, tx_iob);
        } else {
                netdev_tx_complete_err(netdev, tx_iob, -EINVAL);
                vxge_debug(VXGE_ERR, "%s: transmit failed, tcode %d\n",
                                netdev->name, tcode);
        }

        memset(txdp, 0, sizeof(struct vxge_hw_fifo_txd));

        return VXGE_HW_OK;
}
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, vxge_hw_vpath_recover_from_reset(), and vxge_hw_vpath_reset().

Referenced by vxge_close().

{
        enum vxge_hw_status status = VXGE_HW_OK;
        struct __vxge_hw_virtualpath *vpath;

        vxge_trace();

        vpath = vdev->vpath.vpathh;

        if (vpath) {
                if ((status = vxge_hw_vpath_reset(vpath)) == VXGE_HW_OK) {
                        if (is_vxge_card_up(vdev) &&
                                (status = vxge_hw_vpath_recover_from_reset(
                                        vpath)) != VXGE_HW_OK) {
                                vxge_debug(VXGE_ERR, "vxge_hw_vpath_recover_"
                                        "from_reset failed\n");
                                return status;
                        } else {
                                status = __vxge_hw_vpath_reset_check(vpath);
                                if (status != VXGE_HW_OK) {
                                        vxge_debug(VXGE_ERR,
                                        "__vxge_hw_vpath_reset_check error\n");
                                        return status;
                                }
                        }
                } else {
                        vxge_debug(VXGE_ERR, "vxge_hw_vpath_reset failed\n");
                        return status;
                }
        }
        return status;
}
void vxge_close_vpaths ( struct vxgedev *  vdev)

Definition at line 125 of file vxge_main.c.

References NULL, and vxge_hw_vpath_close().

Referenced by vxge_close(), vxge_open(), and vxge_open_vpaths().

{

        if (vdev->vpath.vpathh && vdev->vpath.is_open)
                vxge_hw_vpath_close(vdev->vpath.vpathh);

        vdev->vpath.is_open = 0;
        vdev->vpath.vpathh = NULL;
}
int vxge_open_vpaths ( struct vxgedev *  vdev)

Definition at line 136 of file vxge_main.c.

References pci_get_drvdata(), status, vxge_close_vpaths(), and vxge_hw_vpath_open().

Referenced by vxge_open().

{
        enum vxge_hw_status status;
        struct __vxge_hw_device *hldev;

        hldev = (struct __vxge_hw_device  *)pci_get_drvdata(vdev->pdev);

        vdev->vpath.vpathh = &hldev->virtual_path;
        vdev->vpath.fifo.ndev = vdev->ndev;
        vdev->vpath.fifo.pdev = vdev->pdev;
        vdev->vpath.fifo.fifoh = &hldev->virtual_path.fifoh;
        vdev->vpath.ring.ndev = vdev->ndev;
        vdev->vpath.ring.pdev = vdev->pdev;
        vdev->vpath.ring.ringh = &hldev->virtual_path.ringh;

        status = vxge_hw_vpath_open(vdev->devh, &vdev->vpath);
        if (status == VXGE_HW_OK) {
                vdev->vpath.is_open = 1;
        } else {
                vxge_debug(VXGE_ERR,
                        "%s: vpath: %d failed to open "
                        "with status: %d\n",
                        vdev->ndev->name, vdev->vpath.device_id,
                        status);
                vxge_close_vpaths(vdev);
                return status;
        }

        hldev->vpaths_deployed |= vxge_mBIT(vdev->vpath.vpathh->vp_id);

        return VXGE_HW_OK;
}
static int vxge_xmit ( struct net_device dev,
struct io_buffer iobuf 
) [static]

Functions that implement the iPXE driver API.

vxge_xmit : the socket buffer containing the Tx data. : 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, is_vxge_card_up(), net_device::name, netdev_link_ok(), netdev_priv(), NULL, txdp, vxge_hw_fifo_free_txdl_get(), vxge_hw_fifo_txdl_buffer_set(), and vxge_hw_fifo_txdl_post().

{
        struct vxge_fifo *fifo = NULL;
        struct vxgedev *vdev = NULL;
        struct __vxge_hw_fifo *fifoh;
        struct vxge_hw_fifo_txd *txdp;

        vxge_trace();

        vdev = (struct vxgedev *)netdev_priv(dev);

        if (!is_vxge_card_up(vdev)) {
                vxge_debug(VXGE_ERR,
                        "%s: vdev not initialized\n", dev->name);
                return -EIO;
        }

        if (!netdev_link_ok(dev)) {
                vxge_debug(VXGE_ERR,
                        "%s: Link down, transmit failed\n", dev->name);
                return -ENETDOWN;
        }

        fifo = &vdev->vpath.fifo;
        fifoh = fifo->fifoh;

        txdp = vxge_hw_fifo_free_txdl_get(fifoh);
        if (!txdp) {
                vxge_debug(VXGE_ERR,
                        "%s: Out of tx descriptors\n", dev->name);
                return -ENOBUFS;
        }

        vxge_debug(VXGE_XMIT, "%s: %s:%d fifoh offset= %d\n",
                dev->name, __func__, __LINE__, fifoh->sw_offset);

        vxge_hw_fifo_txdl_buffer_set(fifoh, txdp, iobuf);

        vxge_hw_fifo_txdl_post(fifoh, txdp);

        return 0;
}
static void vxge_poll ( struct net_device ndev) [static]

Definition at line 231 of file vxge_main.c.

References is_vxge_card_up(), netdev_priv(), pci_get_drvdata(), vxge_hw_device_begin_irq(), vxge_hw_vpath_poll_rx(), and vxge_hw_vpath_poll_tx().

{
        struct __vxge_hw_device  *hldev;
        struct vxgedev *vdev;

        vxge_debug(VXGE_POLL, "%s:%d \n", __func__, __LINE__);

        vdev = (struct vxgedev *)netdev_priv(ndev);
        hldev = (struct __vxge_hw_device *)pci_get_drvdata(vdev->pdev);

        if (!is_vxge_card_up(vdev))
                return;

        /* process alarm and acknowledge the interrupts */
        vxge_hw_device_begin_irq(hldev);

        vxge_hw_vpath_poll_tx(&hldev->virtual_path.fifoh);

        vxge_hw_vpath_poll_rx(&hldev->virtual_path.ringh);
}
static void vxge_irq ( struct net_device *netdev  __unused,
int  action 
) [static]

Definition at line 258 of file vxge_main.c.

References netdev, netdev_priv(), pci_get_drvdata(), vxge_hw_device_mask_all(), and vxge_hw_device_unmask_all().

{
        struct __vxge_hw_device  *hldev;
        struct vxgedev *vdev;

        vxge_debug(VXGE_INFO,
                "%s:%d action(%d)\n", __func__, __LINE__, action);

        vdev = (struct vxgedev *)netdev_priv(netdev);
        hldev = (struct __vxge_hw_device *)pci_get_drvdata(vdev->pdev);

        switch (action) {
        case DISABLE:
                vxge_hw_device_mask_all(hldev);
                break;
        default:
                vxge_hw_device_unmask_all(hldev);
                break;
        }
}
int vxge_open ( struct net_device dev)

vxge_open : 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 EPERM, net_device::name, netdev_link_down(), netdev_link_up(), netdev_priv(), pci_get_drvdata(), ret, set_bit(), status, vxge_close_vpaths(), vxge_hw_device_intr_enable(), vxge_hw_vpath_enable(), vxge_hw_vpath_mtu_set(), vxge_hw_vpath_rx_doorbell_init(), vxge_open_vpaths(), and wmb.

{
        enum vxge_hw_status status;
        struct vxgedev *vdev;
        struct __vxge_hw_device *hldev;
        int ret = 0;

        vxge_debug(VXGE_INFO, "%s: %s:%d\n",
                        VXGE_DRIVER_NAME, __func__, __LINE__);

        vdev = (struct vxgedev *)netdev_priv(dev);
        hldev = (struct __vxge_hw_device *)pci_get_drvdata(vdev->pdev);

        /* make sure you have link off by default every time Nic is
         * initialized */
        netdev_link_down(dev);

        /* Open VPATHs */
        status = vxge_open_vpaths(vdev);
        if (status != VXGE_HW_OK) {
                vxge_debug(VXGE_ERR, "%s: fatal: Vpath open failed\n",
                                VXGE_DRIVER_NAME);
                ret = -EPERM;
                goto out0;
        }

        vdev->mtu = VXGE_HW_DEFAULT_MTU;
        /* set initial mtu before enabling the device */
        status = vxge_hw_vpath_mtu_set(vdev->vpath.vpathh, vdev->mtu);
        if (status != VXGE_HW_OK) {
                vxge_debug(VXGE_ERR,
                        "%s: fatal: can not set new MTU\n", dev->name);
                ret = -EPERM;
                goto out2;
        }
        vxge_debug(VXGE_INFO,
                "%s: MTU is %d\n", vdev->ndev->name, vdev->mtu);

        set_bit(__VXGE_STATE_CARD_UP, vdev->state);

        wmb();

        if (vxge_hw_device_link_state_get(vdev->devh) == VXGE_HW_LINK_UP) {
                netdev_link_up(vdev->ndev);
                vxge_debug(VXGE_INFO, "%s: Link Up\n", vdev->ndev->name);
        }

        vxge_hw_device_intr_enable(hldev);

        vxge_hw_vpath_enable(vdev->vpath.vpathh);
        wmb();
        vxge_hw_vpath_rx_doorbell_init(vdev->vpath.vpathh);

        goto out0;

out2:
        vxge_close_vpaths(vdev);
out0:
        vxge_debug(VXGE_INFO, "%s: %s:%d  Exiting...\n",
                                dev->name, __func__, __LINE__);
        return ret;
}
static void vxge_close ( struct net_device dev) [static]

vxge_close : 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 clear_bit(), is_vxge_card_up(), net_device::name, netdev_link_down(), netdev_priv(), pci_get_drvdata(), vxge_close_vpaths(), vxge_hw_device_intr_disable(), vxge_hw_device_unmask_all(), vxge_hw_vpath_set_zero_rx_frm_len(), and vxge_reset_all_vpaths().

{
        struct vxgedev *vdev;
        struct __vxge_hw_device *hldev;

        vxge_debug(VXGE_INFO, "%s: %s:%d\n",
                dev->name, __func__, __LINE__);

        vdev = (struct vxgedev *)netdev_priv(dev);
        hldev = (struct __vxge_hw_device *)pci_get_drvdata(vdev->pdev);

        if (!is_vxge_card_up(vdev))
                return;

        clear_bit(__VXGE_STATE_CARD_UP, vdev->state);

        vxge_hw_vpath_set_zero_rx_frm_len(hldev);

        netdev_link_down(vdev->ndev);
        vxge_debug(VXGE_INFO, "%s: Link Down\n", vdev->ndev->name);

        /* Note that at this point xmit() is stopped by upper layer */
        vxge_hw_device_intr_disable(hldev);

        /* Multi function shares INTA, hence we should
         * leave it in enabled state
         */
        if (is_mf(hldev->hw_info.function_mode))
                vxge_hw_device_unmask_all(hldev);

        vxge_reset_all_vpaths(vdev);

        vxge_close_vpaths(vdev);

        vxge_debug(VXGE_INFO,
                "%s: %s:%d  Exiting...\n", dev->name, __func__, __LINE__);
}
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(), net_device::dev, ENODEV, ETH_ALEN, net_device::hw_addr, memcpy(), memset(), netdev_init(), netdev_priv(), netdev_put(), NULL, register_netdev(), ret, and vxge_operations.

Referenced by vxge_probe().

{
        struct net_device *ndev;
        struct vxgedev *vdev;
        int ret = 0;

        *vdev_out = NULL;

        ndev = alloc_etherdev(sizeof(struct vxgedev));
        if (ndev == NULL) {
                vxge_debug(VXGE_ERR, "%s : device allocation failed\n",
                                __func__);
                ret = -ENODEV;
                goto _out0;
        }

        vxge_debug(VXGE_INFO, "%s:%d  netdev registering\n",
                __func__, __LINE__);
        vdev = netdev_priv(ndev);
        memset(vdev, 0, sizeof(struct vxgedev));

        vdev->ndev = ndev;
        vdev->devh = hldev;
        vdev->pdev = hldev->pdev;

        ndev->dev = &vdev->pdev->dev;
        /* Associate vxge-specific network operations operations with
         * generic network device layer */
        netdev_init(ndev, &vxge_operations);

        memcpy(ndev->hw_addr,
                (u8 *)hldev->hw_info.mac_addrs[hldev->first_vp_id], ETH_ALEN);

        if (register_netdev(ndev)) {
                vxge_debug(VXGE_ERR, "%s : device registration failed!\n",
                        __func__);
                ret = -ENODEV;
                goto _out2;
        }

        /* Leave link state as off at this point, when the link change
         * interrupt comes the state will be automatically changed to
         * the right state.
         */

        vxge_debug(VXGE_INFO, "%s: Ethernet device registered\n",
                VXGE_DRIVER_NAME);

        *vdev_out = vdev;

        return ret;
_out2:
        netdev_put(ndev);
_out0:
        return ret;
}
void vxge_device_unregister ( struct __vxge_hw_device *  hldev)

Definition at line 468 of file vxge_main.c.

References netdev_nullify(), netdev_put(), and unregister_netdev().

Referenced by vxge_remove().

{
        struct net_device *ndev;

        ndev = hldev->ndev;

        unregister_netdev(ndev);
        netdev_nullify(ndev);
        netdev_put(ndev);

        vxge_debug(VXGE_INFO, "%s: ethernet device unregistered\n",
                                VXGE_DRIVER_NAME);
}
static int vxge_probe ( struct pci_device pdev) [static]

vxge_probe : structure containing the PCI related information of the device.

: 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(), pci_device::device, EACCES, EINVAL, ENODEV, ETH_ALEN, eth_ntoa(), ioremap(), iounmap(), memcpy(), NULL, PCI_ARGS, pci_bar_size(), pci_bar_start(), PCI_BASE_ADDRESS_0, PCI_FMT, pci_read_config_byte(), PCI_REVISION, pci_set_drvdata(), printf(), ret, revision, status, vxge_device_register(), vxge_func_mode_names, vxge_hw_device_hw_info_get(), vxge_hw_device_initialize(), vxge_hw_device_terminate(), vxge_hw_get_func_mode(), and vxge_hw_vpath_strip_fcs_check().

{
        struct __vxge_hw_device  *hldev;
        enum vxge_hw_status status;
        int ret = 0;
        u64 vpath_mask = 0;
        struct vxgedev *vdev;
        int i;
        u8 revision, titan1;
        u32 function_mode;
        unsigned long mmio_start, mmio_len;
        void *bar0;
        struct vxge_hw_device_hw_info hw_info;
        struct vxge_hw_device_version *fw_version;

        vxge_debug(VXGE_INFO, "vxge_probe for device " PCI_FMT "\n",
                        PCI_ARGS(pdev));

        pci_read_config_byte(pdev, PCI_REVISION, &revision);
        titan1 = is_titan1(pdev->device, revision);

        mmio_start = pci_bar_start(pdev, PCI_BASE_ADDRESS_0);
        mmio_len   = pci_bar_size(pdev, PCI_BASE_ADDRESS_0);
        vxge_debug(VXGE_INFO, "mmio_start: %#08lx, mmio_len: %#08lx\n",
                        mmio_start, mmio_len);

        /* sets the bus master */
        adjust_pci_device(pdev);

        bar0 = ioremap(mmio_start, mmio_len);
        if (!bar0) {
                vxge_debug(VXGE_ERR,
                        "%s : cannot remap io memory bar0\n", __func__);
                ret = -ENODEV;
                goto _exit0;
        }

        status = vxge_hw_device_hw_info_get(pdev, bar0, &hw_info);
        if (status != VXGE_HW_OK) {
                vxge_debug(VXGE_ERR,
                        "%s: Reading of hardware info failed.\n",
                        VXGE_DRIVER_NAME);
                ret = -EINVAL;
                goto _exit1;
        }

        if (hw_info.func_id != 0) {
                /* Non zero function, So do not load the driver */
                iounmap(bar0);
                pci_set_drvdata(pdev, NULL);
                return -EINVAL;
        }


        vpath_mask = hw_info.vpath_mask;
        if (vpath_mask == 0) {
                vxge_debug(VXGE_ERR,
                        "%s: No vpaths available in device\n",
                        VXGE_DRIVER_NAME);
                ret = -EINVAL;
                goto _exit1;
        }
        vxge_debug(VXGE_INFO,
                "%s:%d  Vpath mask = %llx\n", __func__, __LINE__,
                (unsigned long long)vpath_mask);

        fw_version = &hw_info.fw_version;
        /* fail the driver loading if firmware is incompatible */
        if ((fw_version->major != VXGE_CERT_FW_VER_MAJOR) ||
                (fw_version->minor < VXGE_CERT_FW_VER_MINOR)) {
                printf("%s: Adapter's current firmware version: %d.%d.%d\n",
                        VXGE_DRIVER_NAME, fw_version->major,
                        fw_version->minor, fw_version->build);

                printf("%s: Upgrade firmware to version %d.%d.%d\n",
                        VXGE_DRIVER_NAME, VXGE_CERT_FW_VER_MAJOR,
                        VXGE_CERT_FW_VER_MINOR, VXGE_CERT_FW_VER_BUILD);

                ret = -EACCES;
                goto _exit1;
        }

        status = vxge_hw_device_initialize(&hldev, bar0, pdev, titan1);
        if (status != VXGE_HW_OK) {
                vxge_debug(VXGE_ERR,
                        "Failed to initialize device (%d)\n", status);
                        ret = -EINVAL;
                        goto _exit1;
        }
        memcpy(&hldev->hw_info, &hw_info,
                sizeof(struct vxge_hw_device_hw_info));

        /* find the vpath id of the first available one */
        for (i = 0; i < VXGE_HW_MAX_VIRTUAL_PATHS; i++)
                if (vpath_mask & vxge_mBIT(i)) {
                        hldev->first_vp_id = i;
                        break;
                }
        /* if FCS stripping is not disabled in MAC fail driver load */
        if (vxge_hw_vpath_strip_fcs_check(hldev, vpath_mask) != VXGE_HW_OK) {
                vxge_debug(VXGE_ERR,
                        "%s: FCS stripping is not disabled in MAC"
                        " failing driver load\n", VXGE_DRIVER_NAME);
                ret = -EINVAL;
                goto _exit2;
        }

        /* Read function mode */
        status = vxge_hw_get_func_mode(hldev, &function_mode);
        if (status != VXGE_HW_OK)
                goto _exit2;

        hldev->hw_info.function_mode = function_mode;

        /* set private device info */
        pci_set_drvdata(pdev, hldev);

        if (vxge_device_register(hldev, &vdev)) {
                ret = -EINVAL;
                goto _exit2;
        }

        /* set private HW device info */
        hldev->ndev = vdev->ndev;
        hldev->vdev = vdev;
        hldev->pdev = pdev;
        vdev->mtu = VXGE_HW_DEFAULT_MTU;
        vdev->bar0 = bar0;
        vdev->titan1 = titan1;
        /* Virtual Path count */
        vdev->vpath.device_id = hldev->first_vp_id;
        vdev->vpath.vdev = vdev;
        memcpy((u8 *)vdev->vpath.macaddr,
                        (u8 *)hldev->hw_info.mac_addrs[hldev->first_vp_id],
                        ETH_ALEN);

        hldev->hw_info.serial_number[VXGE_HW_INFO_LEN - 1] = '\0';
        hldev->hw_info.product_desc[VXGE_HW_INFO_LEN - 1] = '\0';
        hldev->hw_info.part_number[VXGE_HW_INFO_LEN - 1] = '\0';

        vxge_debug(VXGE_INFO, "%s: Neterion %s Server Adapter\n",
                VXGE_DRIVER_NAME, hldev->hw_info.product_desc);
        vxge_debug(VXGE_INFO, "%s: SERIAL NUMBER: %s\n",
                VXGE_DRIVER_NAME, hldev->hw_info.serial_number);
        vxge_debug(VXGE_INFO, "%s: PART NUMBER: %s\n",
                VXGE_DRIVER_NAME, hldev->hw_info.part_number);
        vxge_debug(VXGE_INFO, "%s: MAC ADDR: %s\n",
                VXGE_DRIVER_NAME, eth_ntoa(vdev->vpath.macaddr));
        vxge_debug(VXGE_INFO,
                "%s: Firmware version : %s Date : %s\n", VXGE_DRIVER_NAME,
                hldev->hw_info.fw_version.version,
                hldev->hw_info.fw_date.date);
        vxge_debug(VXGE_INFO, "%s: %s Enabled\n",
                        VXGE_DRIVER_NAME, vxge_func_mode_names[function_mode]);

        vxge_debug(VXGE_INFO, "%s: %s:%d  Probe Exiting...\n",
                VXGE_DRIVER_NAME, __func__, __LINE__);

        return 0;

_exit2:
        vxge_hw_device_terminate(hldev);
_exit1:
        iounmap(bar0);
_exit0:
        pci_set_drvdata(pdev, NULL);
        printf("%s: WARNING!! Driver loading failed!!\n",
                VXGE_DRIVER_NAME);

        return ret;
}
static void vxge_remove ( struct pci_device pdev) [static]

vxge_remove - Free the PCI device : 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 iounmap(), netdev_priv(), NULL, pci_get_drvdata(), pci_set_drvdata(), vxge_device_unregister(), and vxge_hw_device_terminate().

{
        struct __vxge_hw_device  *hldev;
        struct vxgedev *vdev = NULL;
        struct net_device *ndev;

        vxge_debug(VXGE_INFO,
                "%s:%d\n", __func__, __LINE__);
        hldev = (struct __vxge_hw_device  *) pci_get_drvdata(pdev);
        if (hldev == NULL)
                return;

        ndev = hldev->ndev;
        vdev = netdev_priv(ndev);

        iounmap(vdev->bar0);

        vxge_device_unregister(hldev);

        vxge_debug(VXGE_INFO,
                "%s:%d  Device unregistered\n", __func__, __LINE__);

        vxge_hw_device_terminate(hldev);
        pci_set_drvdata(pdev, NULL);
}

Variable Documentation

char* vxge_func_mode_names[] [static]
Initial value:
 {
        "Single Function - 1 func, 17 vpath",
        "Multi Function 8 - 8 func, 2 vpath per func",
        "SRIOV 17 - 17 VF, 1 vpath per VF",
        "WLPEX/SharedIO 17 - 17 VH, 1 vpath/func/hierarchy",
        "WLPEX/SharedIO 8 - 8 VH, 2 vpath/func/hierarchy",
        "Multi Function 17 - 17 func, 1 vpath per func",
        "SRIOV 8 - 1 PF, 7 VF, 2 vpath per VF",
        "SRIOV 4 - 1 PF, 3 VF, 4 vpath per VF",
        "Multi Function 2 - 2 func, 8 vpath per func",
        "Multi Function 4 - 4 func, 4 vpath per func",
        "WLPEX/SharedIO 4 - 17 func, 1 vpath per func (PCIe ARI)",
        "Multi Function 8 - For ESX DirectIO - 8 func, 2 vpath per func",
}

Definition at line 36 of file vxge_main.c.

Referenced by vxge_probe().

static struct net_device_operations vxge_operations [static]
Initial value:
 {
        .open           = vxge_open,
        .close          = vxge_close,
        .transmit       = vxge_xmit,
        .poll           = vxge_poll,
        .irq            = vxge_irq,
}

Definition at line 402 of file vxge_main.c.

Referenced by vxge_device_register().

struct pci_device_id vxge_main_nics[] [static]
Initial value:
 {
        
        PCI_ID(0x17d5, 0x5833, "vxge-x3100", "Neterion X3100 Series", 0),
}

Definition at line 708 of file vxge_main.c.

struct pci_driver vxge_driver __pci_driver
Initial value:
 {
        .ids = vxge_main_nics,
        .id_count = (sizeof(vxge_main_nics) / sizeof(vxge_main_nics[0])),
        .probe = vxge_probe,
        .remove = vxge_remove,
}

Definition at line 713 of file vxge_main.c.