cregit-Linux how code gets into the kernel

Release 4.11 drivers/net/ethernet/cisco/enic/vnic_cq.c

/*
 * Copyright 2008-2010 Cisco Systems, Inc.  All rights reserved.
 * Copyright 2007 Nuova Systems, Inc.  All rights reserved.
 *
 * This program is free software; you may redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; version 2 of the License.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
 * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
 * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
 * SOFTWARE.
 *
 */

#include <linux/kernel.h>
#include <linux/errno.h>
#include <linux/types.h>
#include <linux/pci.h>

#include "vnic_dev.h"
#include "vnic_cq.h"
#include "enic.h"


void vnic_cq_free(struct vnic_cq *cq) { vnic_dev_free_desc_ring(cq->vdev, &cq->ring); cq->ctrl = NULL; }

Contributors

PersonTokensPropCommitsCommitProp
Scott Feldman28100.00%1100.00%
Total28100.00%1100.00%


int vnic_cq_alloc(struct vnic_dev *vdev, struct vnic_cq *cq, unsigned int index, unsigned int desc_count, unsigned int desc_size) { int err; cq->index = index; cq->vdev = vdev; cq->ctrl = vnic_dev_get_res(vdev, RES_TYPE_CQ, index); if (!cq->ctrl) { vdev_err(vdev, "Failed to hook CQ[%d] resource\n", index); return -EINVAL; } err = vnic_dev_alloc_desc_ring(vdev, &cq->ring, desc_count, desc_size); if (err) return err; return 0; }

Contributors

PersonTokensPropCommitsCommitProp
Scott Feldman10097.09%133.33%
Joe Perches21.94%133.33%
Govindarajulu Varadarajan10.97%133.33%
Total103100.00%3100.00%


void vnic_cq_init(struct vnic_cq *cq, unsigned int flow_control_enable, unsigned int color_enable, unsigned int cq_head, unsigned int cq_tail, unsigned int cq_tail_color, unsigned int interrupt_enable, unsigned int cq_entry_enable, unsigned int cq_message_enable, unsigned int interrupt_offset, u64 cq_message_addr) { u64 paddr; paddr = (u64)cq->ring.base_addr | VNIC_PADDR_TARGET; writeq(paddr, &cq->ctrl->ring_base); iowrite32(cq->ring.desc_count, &cq->ctrl->ring_size); iowrite32(flow_control_enable, &cq->ctrl->flow_control_enable); iowrite32(color_enable, &cq->ctrl->color_enable); iowrite32(cq_head, &cq->ctrl->cq_head); iowrite32(cq_tail, &cq->ctrl->cq_tail); iowrite32(cq_tail_color, &cq->ctrl->cq_tail_color); iowrite32(interrupt_enable, &cq->ctrl->interrupt_enable); iowrite32(cq_entry_enable, &cq->ctrl->cq_entry_enable); iowrite32(cq_message_enable, &cq->ctrl->cq_message_enable); iowrite32(interrupt_offset, &cq->ctrl->interrupt_offset); writeq(cq_message_addr, &cq->ctrl->cq_message_addr); cq->interrupt_offset = interrupt_offset; }

Contributors

PersonTokensPropCommitsCommitProp
Scott Feldman21397.26%150.00%
Vasanthy Kolluri62.74%150.00%
Total219100.00%2100.00%


void vnic_cq_clean(struct vnic_cq *cq) { cq->to_clean = 0; cq->last_color = 0; iowrite32(0, &cq->ctrl->cq_head); iowrite32(0, &cq->ctrl->cq_tail); iowrite32(1, &cq->ctrl->cq_tail_color); vnic_dev_clear_desc_ring(&cq->ring); }

Contributors

PersonTokensPropCommitsCommitProp
Scott Feldman66100.00%1100.00%
Total66100.00%1100.00%


Overall Contributors

PersonTokensPropCommitsCommitProp
Scott Feldman42597.03%120.00%
Vasanthy Kolluri71.60%240.00%
Govindarajulu Varadarajan40.91%120.00%
Joe Perches20.46%120.00%
Total438100.00%5100.00%
Information contained on this website is for historical information purposes only and does not indicate or represent copyright ownership.
Created with cregit.