cregit-Linux how code gets into the kernel

Release 4.16 drivers/net/ethernet/chelsio/cxgb4/cudbg_common.c

/*
 *  Copyright (C) 2017 Chelsio Communications.  All rights reserved.
 *
 *  This program is free software; you can redistribute it and/or modify it
 *  under the terms and conditions of the GNU General Public License,
 *  version 2, as published by the Free Software Foundation.
 *
 *  This program is distributed in the hope it will be useful, but WITHOUT
 *  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 *  FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
 *  more details.
 *
 *  The full GNU General Public License is included in this distribution in
 *  the file called "COPYING".
 *
 */

#include "cxgb4.h"
#include "cudbg_if.h"
#include "cudbg_lib_common.h"


int cudbg_get_buff(struct cudbg_init *pdbg_init, struct cudbg_buffer *pdbg_buff, u32 size, struct cudbg_buffer *pin_buff) { u32 offset; offset = pdbg_buff->offset; if (offset + size > pdbg_buff->size) return CUDBG_STATUS_NO_MEM; if (pdbg_init->compress_type != CUDBG_COMPRESSION_NONE) { if (size > pdbg_init->compress_buff_size) return CUDBG_STATUS_NO_MEM; pin_buff->data = (char *)pdbg_init->compress_buff; pin_buff->offset = 0; pin_buff->size = size; return 0; } pin_buff->data = (char *)pdbg_buff->data + offset; pin_buff->offset = offset; pin_buff->size = size; return 0; }

Contributors

PersonTokensPropCommitsCommitProp
Rahul Lakkireddy122100.00%2100.00%
Total122100.00%2100.00%


void cudbg_put_buff(struct cudbg_init *pdbg_init, struct cudbg_buffer *pin_buff) { /* Clear compression buffer for re-use */ if (pdbg_init->compress_type != CUDBG_COMPRESSION_NONE) memset(pdbg_init->compress_buff, 0, pdbg_init->compress_buff_size); pin_buff->data = NULL; pin_buff->offset = 0; pin_buff->size = 0; }

Contributors

PersonTokensPropCommitsCommitProp
Rahul Lakkireddy55100.00%2100.00%
Total55100.00%2100.00%


void cudbg_update_buff(struct cudbg_buffer *pin_buff, struct cudbg_buffer *pout_buff) { /* We already write to buffer provided by ethool, so just * increment offset to next free space. */ pout_buff->offset += pin_buff->size; }

Contributors

PersonTokensPropCommitsCommitProp
Rahul Lakkireddy24100.00%1100.00%
Total24100.00%1100.00%


Overall Contributors

PersonTokensPropCommitsCommitProp
Rahul Lakkireddy211100.00%2100.00%
Total211100.00%2100.00%
Information contained on this website is for historical information purposes only and does not indicate or represent copyright ownership.
Created with cregit.