📄 nop.c
字号:
/*************************************************************************** nop.c - Do nothing ------------------- begin : 2004 authors : Linus Gasser emails : linus.gasser@epfl.ch ***************************************************************************//*************************************************************************** Changes ------- date - name - description 04-01-05 - ineiti - start **************************************************************************//*************************************************************************** * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * ***************************************************************************//** * Do nothing but return some time to wait - Useful for debugging the * dispatcher */#define DBG_LVL 0#include "system.h"#include "debugging.h"#include "memory.h"#include "sdb.h"#include "antenna.h"swr_ant_param_t *params[ MAX_ANTENNAS ];int antennas;/** * @short Initialises an antenna's channel */int swr_ant_ch_init( swr_ant_param_t *p ) { if ( antennas < MAX_ANTENNAS ){ params[ antennas ] = p; return antennas++; } else { PR_DBG( 0, "Asking for too many antennas\n" ); return -1; }}/** * @short Deletes an antenna's channel */void swr_ant_ch_free( int nbr_ant ) { if ( !antennas ){ PR_DBG( 0, "There are no antennas to be freed\n" ); } if ( nbr_ant != --antennas ){ PR_DBG( 0, "Out of order freeing.\n" ); }}/** * @short Starts the channel */void swr_ant_ch_start( void ) { // Well, there's nothing to do, really ;)}/** * @short Stops the channel */void swr_ant_ch_stop( void ) {}/** * @short IOs the antenna */int swr_ant_ch_io( int block ) { PR_DBG( 2, "Returning 100000us\n" ); return 100000;}int swr_ant_ch_reconfig( int nbr_ant ){ return 0;}int swr_ant_rf_get_gains( int nbr_ant, int *tx_pa, int *tx_med, int *tx_if, int *rx_if ) { return 0;}int swr_ant_rf_set_gains( int nbr_ant, int tx_pa, int tx_med, int tx_if, int rx_if ) { return 0;}int swr_emul_init( void ){ antennas = 0; return 0;}void swr_emul_exit( void ){ if ( antennas > 0 ){ PR_DBG( 0, "Hmm, still some antennas left...\n" ); }}module_init( swr_emul_init );module_exit( swr_emul_exit );EXPORT_SYMBOL(swr_ant_ch_init);EXPORT_SYMBOL(swr_ant_ch_free);EXPORT_SYMBOL(swr_ant_ch_start);EXPORT_SYMBOL(swr_ant_ch_stop);EXPORT_SYMBOL(swr_ant_ch_io);EXPORT_SYMBOL(swr_ant_ch_reconfig);EXPORT_SYMBOL(swr_ant_rf_set_gains);EXPORT_SYMBOL(swr_ant_rf_get_gains);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -