/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2014 QLogic Corporation
* The contents of this file are subject to the terms of the
* QLogic End User License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the License at
* See the License for the specific language governing permissions
* and limitations under the License.
*/
/*
*/
#include "bnxe.h"
{
DMA_ATTR_V0, /* dma_attr_version */
0, /* dma_attr_addr_lo */
0xffffffffffffffff, /* dma_attr_addr_hi */
0xffffffffffffffff, /* dma_attr_count_max */
BNXE_DMA_ALIGNMENT, /* dma_attr_align */
0xffffffff, /* dma_attr_burstsizes */
1, /* dma_attr_minxfer */
0xffffffffffffffff, /* dma_attr_maxxfer */
0xffffffffffffffff, /* dma_attr_seg */
1, /* dma_attr_sgllen */
1, /* dma_attr_granular */
0, /* dma_attr_flags */
};
int idx,
{
/* return bytes from reclaimed list to LM */
while (pLmPkt)
{
}
{
}
#if 0
/*
* Don't post buffers if we don't have too many free buffers and there are a
* lot of buffers already posted.
*/
{
return;
}
/*
* Don't post buffers if there aren't really that many to post yet.
*/
{
return;
}
#endif
}
{
(void)pUM;
return ALIGN_VALUE_TO_WORD_BOUNDARY(descSize);
}
{
}
{
{
/*
* Oh my! The free_arg data got corrupted. Log a message and leak this
* packet. We don't decrement the 'up in the stack count' since we
* can't be sure this packet really was a packet we previously sent up.
*/
return;
}
{
/*
* The stack is freeing a packet that was from a previous plumb of
* the interface.
*/
}
else
{
/* post packets when a bunch are ready */
{
}
if (s_list_entry_cnt(&doneRxQ))
{
}
}
}
int cliIdx)
{
switch (cliIdx)
{
case LM_CLI_IDX_FCOE:
for (i = 0; i < 5; i++)
{
{
break;
}
/* twiddle our thumbs for one second */
}
if (cnt)
{
return B_FALSE;
}
break;
case LM_CLI_IDX_NDIS:
tot = 0;
{
for (i = 0; i < 5; i++)
{
{
break;
}
/* twiddle our thumbs for one second */
}
}
if (tot)
{
return B_FALSE;
}
break;
default:
break;
}
return B_TRUE;
}
/* numBytes is only valid when polling is TRUE */
int idx,
int numBytes)
{
int ofldFlags;
int procBytes = 0;
/* get the list of packets received */
/* grab any waiting packets */
/* put any new packets at the end of the queue */
/* now complete the ramrods */
if (s_list_entry_cnt(&rxList) == 0)
{
return NULL;
}
notCopiedCount = 0;
/* send the packets up the stack */
while (1)
{
{
break;
}
{
/* XXX increment error stat? */
continue;
}
{
/* When polling an rx ring we can only process up to numBytes */
{
/* continue to process this packet */
}
else
{
/* put this packet not processed back on the list (front) */
break;
}
}
0,
if (pUM->fmCapabilities &&
{
}
if (forceCopy ||
{
{
pRxQ->rxDiscards++;
continue;
}
/* copy the packet into the new mblk */
dataCopied = B_TRUE;
goto BnxeRxRingProcess_sendup;
}
{
/*
* If the hardware is out of receive buffers and we are on the last
* receive packet then drop the packet. We do this because we might
* not be able to allocate any new receive buffers before the ISR
* completes. If this happens, the driver will enter an infinite
* interrupt loop where the hardware is requesting rx buffers the
* driver cannot allocate. To prevent a system livelock we leave
* one buffer perpetually available. Note that we do this after
* giving the double copy code a chance to claim the packet.
*/
/* FIXME
* Make sure to add one more to the rx packet descriptor count
* before allocating them.
*/
pRxQ->rxDiscards++;
continue;
}
/*
* If we got here then the packet wasn't copied so we need to create a
* new mblk_t which references the lm_packet_t buffer.
*/
{
pRxQ->rxDiscards++;
continue;
}
/*
* Check if the checksum was offloaded so we can pass the result to
* the stack.
*/
ofldFlags = 0;
{
}
{
}
if (ofldFlags != 0)
{
}
/*
* If the packet data was copied into a new recieve buffer then put this
* descriptor in a list to be reclaimed later. If not, then increment a
* counter so we can track how many of our descriptors are held by the
* stack.
*/
if (dataCopied == B_TRUE)
{
}
else
{
}
{
}
else
{
}
#if 0
"<- FCoE L2 RX <-" : "<- L2 RX <-",
#endif
}
if (head)
{
if (notCopiedCount)
{
/* track all non-copied packets that will be held by the stack */
}
/* pass the mblk chain up the stack */
{
/* XXX NEED TO ADD STATS FOR RX PATH UPCALLS */
{
/* XXX verify fcoe frees all packets on success or error */
{
}
else
{
/* FCoE isn't bound? Reclaim the chain... */
}
}
else
{
head,
#else
head);
#endif
}
}
}
{
/* put the packets not processed back on the list (front) */
}
if (s_list_entry_cnt(&reclaimList))
{
}
}
/*
* Dumping packets simply moves all packets from the waiting queue to the free
* queue. Note that the packets are not posted back to the LM.
*/
int idx)
{
}
/*
* Aborting packets stops all rx processing by dumping the currently waiting
* packets and aborting all the rx descriptors currently posted in the LM.
*/
int idx)
{
}
int cliIdx)
{
int idx;
switch (cliIdx)
{
case LM_CLI_IDX_FCOE:
break;
case LM_CLI_IDX_NDIS:
{
}
break;
default:
break;
}
}
int idx,
{
int rc;
NULL,
{
return -1;
}
NULL,
&length,
{
return -1;
}
NULL,
NULL,
&cookie,
&count)) != DDI_DMA_MAPPED)
{
return -1;
}
return 0;
}
int idx)
{
return 0;
}
int cliIdx)
{
int idx;
switch (cliIdx)
{
case LM_CLI_IDX_FCOE:
break;
case LM_CLI_IDX_NDIS:
{
}
break;
default:
break;
}
return 0;
}
int idx)
{
int postCnt, i;
/* allocate the packet descriptors */
for (i = 0;
i++)
{
KM_NOSLEEP)) == NULL)
{
break; /* continue without error */
}
{
break; /* continue without error */
}
}
{
postCnt);
}
return 0;
}
int cliIdx)
{
int idx;
/* set the rx buffer signature for this plumb */
switch (cliIdx)
{
case LM_CLI_IDX_FCOE:
break;
case LM_CLI_IDX_NDIS:
{
}
break;
default:
break;
}
return 0;
}
int idx)
{
if (s_list_entry_cnt(&tmpList) !=
{
}
/*
* Back out all the packets in the "available for hardware use" queue.
* Free the buffers associated with the descriptors as we go.
*/
while (1)
{
{
break;
}
}
}
int cliIdx)
{
int idx;
/* reset the signature for this unplumb */
switch (cliIdx)
{
case LM_CLI_IDX_FCOE:
break;
case LM_CLI_IDX_NDIS:
{
}
break;
default:
break;
}
}