diff options
Diffstat (limited to 'drivers/net/qlcnic/qlcnic_init.c')
-rw-r--r-- | drivers/net/qlcnic/qlcnic_init.c | 93 |
1 files changed, 0 insertions, 93 deletions
diff --git a/drivers/net/qlcnic/qlcnic_init.c b/drivers/net/qlcnic/qlcnic_init.c index c5ea2f4eb980..6d0ec6c7f225 100644 --- a/drivers/net/qlcnic/qlcnic_init.c +++ b/drivers/net/qlcnic/qlcnic_init.c | |||
@@ -1690,99 +1690,6 @@ qlcnic_post_rx_buffers_nodb(struct qlcnic_adapter *adapter, | |||
1690 | spin_unlock(&rds_ring->lock); | 1690 | spin_unlock(&rds_ring->lock); |
1691 | } | 1691 | } |
1692 | 1692 | ||
1693 | static void dump_skb(struct sk_buff *skb) | ||
1694 | { | ||
1695 | int i; | ||
1696 | unsigned char *data = skb->data; | ||
1697 | |||
1698 | for (i = 0; i < skb->len; i++) { | ||
1699 | printk("%02x ", data[i]); | ||
1700 | if ((i & 0x0f) == 8) | ||
1701 | printk("\n"); | ||
1702 | } | ||
1703 | } | ||
1704 | |||
1705 | static struct qlcnic_rx_buffer * | ||
1706 | qlcnic_process_rcv_diag(struct qlcnic_adapter *adapter, | ||
1707 | struct qlcnic_host_sds_ring *sds_ring, | ||
1708 | int ring, u64 sts_data0) | ||
1709 | { | ||
1710 | struct qlcnic_recv_context *recv_ctx = &adapter->recv_ctx; | ||
1711 | struct qlcnic_rx_buffer *buffer; | ||
1712 | struct sk_buff *skb; | ||
1713 | struct qlcnic_host_rds_ring *rds_ring; | ||
1714 | int index, length, cksum, pkt_offset; | ||
1715 | |||
1716 | if (unlikely(ring >= adapter->max_rds_rings)) | ||
1717 | return NULL; | ||
1718 | |||
1719 | rds_ring = &recv_ctx->rds_rings[ring]; | ||
1720 | |||
1721 | index = qlcnic_get_sts_refhandle(sts_data0); | ||
1722 | if (unlikely(index >= rds_ring->num_desc)) | ||
1723 | return NULL; | ||
1724 | |||
1725 | buffer = &rds_ring->rx_buf_arr[index]; | ||
1726 | |||
1727 | length = qlcnic_get_sts_totallength(sts_data0); | ||
1728 | cksum = qlcnic_get_sts_status(sts_data0); | ||
1729 | pkt_offset = qlcnic_get_sts_pkt_offset(sts_data0); | ||
1730 | |||
1731 | skb = qlcnic_process_rxbuf(adapter, rds_ring, index, cksum); | ||
1732 | if (!skb) | ||
1733 | return buffer; | ||
1734 | |||
1735 | if (length > rds_ring->skb_size) | ||
1736 | skb_put(skb, rds_ring->skb_size); | ||
1737 | else | ||
1738 | skb_put(skb, length); | ||
1739 | |||
1740 | if (pkt_offset) | ||
1741 | skb_pull(skb, pkt_offset); | ||
1742 | |||
1743 | if (!qlcnic_check_loopback_buff(skb->data)) | ||
1744 | adapter->diag_cnt++; | ||
1745 | else | ||
1746 | dump_skb(skb); | ||
1747 | |||
1748 | dev_kfree_skb_any(skb); | ||
1749 | adapter->stats.rx_pkts++; | ||
1750 | adapter->stats.rxbytes += length; | ||
1751 | |||
1752 | return buffer; | ||
1753 | } | ||
1754 | |||
1755 | void | ||
1756 | qlcnic_process_rcv_ring_diag(struct qlcnic_host_sds_ring *sds_ring) | ||
1757 | { | ||
1758 | struct qlcnic_adapter *adapter = sds_ring->adapter; | ||
1759 | struct status_desc *desc; | ||
1760 | struct qlcnic_rx_buffer *rxbuf; | ||
1761 | u64 sts_data0; | ||
1762 | |||
1763 | int opcode, ring, desc_cnt; | ||
1764 | u32 consumer = sds_ring->consumer; | ||
1765 | |||
1766 | desc = &sds_ring->desc_head[consumer]; | ||
1767 | sts_data0 = le64_to_cpu(desc->status_desc_data[0]); | ||
1768 | |||
1769 | if (!(sts_data0 & STATUS_OWNER_HOST)) | ||
1770 | return; | ||
1771 | |||
1772 | desc_cnt = qlcnic_get_sts_desc_cnt(sts_data0); | ||
1773 | opcode = qlcnic_get_sts_opcode(sts_data0); | ||
1774 | |||
1775 | ring = qlcnic_get_sts_type(sts_data0); | ||
1776 | rxbuf = qlcnic_process_rcv_diag(adapter, sds_ring, | ||
1777 | ring, sts_data0); | ||
1778 | |||
1779 | desc->status_desc_data[0] = cpu_to_le64(STATUS_OWNER_PHANTOM); | ||
1780 | consumer = get_next_index(consumer, sds_ring->num_desc); | ||
1781 | |||
1782 | sds_ring->consumer = consumer; | ||
1783 | writel(consumer, sds_ring->crb_sts_consumer); | ||
1784 | } | ||
1785 | |||
1786 | void | 1693 | void |
1787 | qlcnic_fetch_mac(struct qlcnic_adapter *adapter, u32 off1, u32 off2, | 1694 | qlcnic_fetch_mac(struct qlcnic_adapter *adapter, u32 off1, u32 off2, |
1788 | u8 alt_mac, u8 *mac) | 1695 | u8 alt_mac, u8 *mac) |