mirror of
git://nv-tegra.nvidia.com/kernel/nvethernetrm.git
synced 2025-12-24 18:42:16 +03:00
Update doxygen comments for functions with below info - Use Algorithm inside @note - All numberical usages(like 1),2)..) with '-' - Add API group, Classification and Traceability note sections for all external interface functions. Bug 200671362 Change-Id: I762df388659f4be75952b7050c7ae03489a086b8 Signed-off-by: Nagarjuna Kristam <nkristam@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/c/kernel/nvethernetrm/+/2407423 Reviewed-on: https://git-master.nvidia.com/r/c/kernel/nvethernetrm/+/2422284 Reviewed-by: automaticguardword <automaticguardword@nvidia.com> Reviewed-by: Rakesh Goyal <rgoyal@nvidia.com> Reviewed-by: Mahesh Patil <maheshp@nvidia.com> Reviewed-by: Bhadram Varka <vbhadram@nvidia.com> Reviewed-by: Bitan Biswas <bbiswas@nvidia.com> Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: Rakesh Goyal <rgoyal@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com> GVS: Gerrit_Virtual_Submit
115 lines
4.1 KiB
C
115 lines
4.1 KiB
C
/*
|
|
* Copyright (c) 2018-2020, NVIDIA CORPORATION. All rights reserved.
|
|
*
|
|
* Permission is hereby granted, free of charge, to any person obtaining a
|
|
* copy of this software and associated documentation files (the "Software"),
|
|
* to deal in the Software without restriction, including without limitation
|
|
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
|
* and/or sell copies of the Software, and to permit persons to whom the
|
|
* Software is furnished to do so, subject to the following conditions:
|
|
*
|
|
* The above copyright notice and this permission notice shall be included in
|
|
* all copies or substantial portions of the Software.
|
|
*
|
|
* 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.
|
|
*/
|
|
|
|
#ifndef OSD_H
|
|
#define OSD_H
|
|
|
|
/**
|
|
* @brief osd_usleep_range - sleep in micro seconds
|
|
*
|
|
* @param[in] umin: Minimum time in usecs to sleep
|
|
* @param[in] umax: Maximum time in usecs to sleep
|
|
*/
|
|
void osd_usleep_range(unsigned long umin, unsigned long umax);
|
|
/**
|
|
* @brief osd_msleep - sleep in milli seconds
|
|
*
|
|
* @param[in] msec: time in milli seconds
|
|
*/
|
|
void osd_msleep(unsigned int msec);
|
|
/**
|
|
* @brief osd_udelay - delay in micro seconds
|
|
*
|
|
* @param[in] usec: time in usec
|
|
*/
|
|
void osd_udelay(unsigned long usec);
|
|
/**
|
|
* @brief osd_receive_packet - Handover received packet to network stack.
|
|
*
|
|
* @note
|
|
* Algorithm:
|
|
* - Unmap the DMA buffer address (not needed if buffers are
|
|
* allocated statically).
|
|
* - Refill the Rx ring based on threshold.
|
|
* - Consume the flag information and take decision to hand over the packet
|
|
* and related information to OS network stack.
|
|
*
|
|
* @param[in] priv: OSD private data structure.
|
|
* @param[in] rxring: Pointer to DMA channel Rx ring.
|
|
* @param[in] chan: DMA Rx channel number.
|
|
* @param[in] dma_buf_len: Rx DMA buffer length.
|
|
* @param[in] rxpkt_cx: Received packet context.
|
|
* @param[in] rx_pkt_swcx: Received packet sw context.
|
|
*
|
|
* @pre Rx completion need to make sure that Rx descriptors processed properly.
|
|
*/
|
|
void osd_receive_packet(void *priv, void *rxring, unsigned int chan,
|
|
unsigned int dma_buf_len, void *rxpkt_cx,
|
|
void *rx_pkt_swcx);
|
|
|
|
/**
|
|
* @brief osd_transmit_complete - Transmit completion routine.
|
|
*
|
|
* @note
|
|
* Algorithm:
|
|
* - Unmap and free the buffer DMA address and buffer (not needed if buffers
|
|
* are allocated statically).
|
|
* - Time stamp will be updated to stack if available.
|
|
*
|
|
* @param[in] priv: OSD private data structure.
|
|
* @param[in] buffer: Buffer address to free.
|
|
* @param[in] dmaaddr: DMA address to unmap.
|
|
* @param[in] len: Length of data.
|
|
* @param[in] txdone_pkt_cx: Pointer to struct which has tx done status info.
|
|
* This struct has flags to indicate tx error, whether DMA address
|
|
* is mapped from paged/linear buffer, Time stamp availability,
|
|
* if TS available txdone_pkt_cx->ns stores the time stamp.
|
|
* Below are the valid bit maps set for txdone_pkt_cx->flags
|
|
* OSI_TXDONE_CX_PAGED_BUF OSI_BIT(0)
|
|
* OSI_TXDONE_CX_ERROR OSI_BIT(1)
|
|
* OSI_TXDONE_CX_TS OSI_BIT(2)
|
|
*
|
|
* @pre Tx completion need to make sure that Tx descriptors processed properly.
|
|
*/
|
|
void osd_transmit_complete(void *priv, void *buffer, unsigned long dmaaddr,
|
|
unsigned int len, void *txdone_pkt_cx);
|
|
/**
|
|
* @brief osd_log - OSD logging function
|
|
*
|
|
* @param[in] priv: OSD private data
|
|
* @param[in] func: function name
|
|
* @param[in] line: line number
|
|
* @param[in] level: log level
|
|
* @param[in] type: error type
|
|
* @param[in] err: error string
|
|
* @param[in] loga: error additional information
|
|
*
|
|
*/
|
|
void osd_log(void *priv,
|
|
const char *func,
|
|
unsigned int line,
|
|
unsigned int level,
|
|
unsigned int type,
|
|
const char *err,
|
|
unsigned long long loga);
|
|
#endif
|