/*
* This file and its contents are supplied under the terms of the
* Common Development and Distribution License ("CDDL"), version 1.0.
* You may only use this file in accordance with the terms of version
* 1.0 of the CDDL.
*
* A full copy of the text of the CDDL should have accompanied this
* source. A copy of the CDDL is also available via the Internet at
*/
/*
* Copyright 2015 OmniTI Computer Consulting, Inc. All rights reserved.
* Copyright 2016 Joyent, Inc.
*/
#include "i40e_sw.h"
#include "i40e_type.h"
#include "i40e_alloc.h"
#include "i40e_osdep.h"
/* ARGSUSED */
{
return (I40E_SUCCESS);
}
/* ARGSUSED */
{
return (I40E_SUCCESS);
}
/* ARGSUSED */
{
int rc;
/*
* Because we need to honor the specified alignment, we need to
* dynamically construct the attributes. We save the alignment for
* debugging purposes.
*/
if (rc != DDI_SUCCESS) {
"code: %d", rc);
/*
* Swallow unknown errors and treat them like we do
* DDI_DMA_NORESOURCES, in other words, a memory error.
*/
if (rc == DDI_DMA_BADATTR)
return (I40E_ERR_PARAM);
return (I40E_ERR_NO_MEMORY);
}
if (rc != DDI_SUCCESS) {
"memory for common code", size);
return (I40E_ERR_NO_MEMORY);
}
&cookie, &cookie_num);
if (rc != DDI_DMA_MAPPED) {
switch (rc) {
case DDI_DMA_INUSE:
return (I40E_ERR_NOT_READY);
case DDI_DMA_TOOBIG:
return (I40E_ERR_INVALID_SIZE);
case DDI_DMA_NOMAPPING:
case DDI_DMA_NORESOURCES:
default:
return (I40E_ERR_NO_MEMORY);
}
}
/*
* Lint doesn't like this because the common code gives us a uint64_t as
* input, but the common code then asks us to assign it to a size_t. So
* lint's right, but in this case there isn't much we can do.
*/
return (I40E_SUCCESS);
}
/* ARGSUSED */
{
}
}
}
/*
* Watch out for sloppiness.
*/
return (I40E_SUCCESS);
}
/*
* The common code wants to initialize its 'spinlocks' here, aka adaptive
* mutexes. At this time these are only used to maintain the adminq's data and
* as such it will only be used outside of interrupt context and even then,
* we're not going to actually end up ever doing anything above lock level and
* up in doing stuff with high level interrupts.
*/
void
{
}
void
{
}
void
{
}
void
{
}
{
int status;
/* locate the pci-e capability block */
&pcie_cap);
if (status != DDI_SUCCESS) {
"capability block: %d",
status);
return (B_FALSE);
}
pcie_cap + PCIE_LINKSTS);
return (B_TRUE);
}
/* ARGSUSED */
void
{
}