亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? antenna.c

?? 軟件無線電的平臺
?? C
?? 第 1 頁 / 共 2 頁
字號:
/***************************************************************************             antenna.c  -  The antenna-implementation                            -------------------    begin                :  2002    authors              :  Linus Gasser    emails               :  linus.gasser@epfl.ch ***************************************************************************//***************************************************************************                                 Changes                                 ------- date - name - description 02-10-01 - ineiti - create 02-12-11 - ineiti - Changed from a DMA-packed thing to a most general                     antenna. 03/08/18 - ineiti - changed dispatch-thread to FIFO-scheduling with                     priority 1 04/01/07 - ineiti - fixed race-condition while initialising the dispatcher                     and starting it. 04/03/29 - ineiti - deleted thread_join on exiting the dispatcher, because                     this doesn't seem to be possible 04/06/01 - ineiti - only one thread that works on all channels. This                     fixes problems with multi-threading and assures		     a more neat handling of MIMO situations  **************************************************************************//*************************************************************************** *                                                                         * *   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.                                   * *                                                                         * ***************************************************************************//** * This is an interface to different channel-implementations. */#define DBG_LVL 0#define EXPORT_SYMTAB#include "system.h"#include "debugging.h"#include "memory.h"#include "antenna.h"#include "sdb.h"typedef struct {  pthread_t thread;  void *stack;  pthread_cond_t cond;  pthread_mutex_t mutex;  int slot_len;  int state;  int offset;  int ch_id[MAX_ANTENNAS];  swr_sdb_id notify_sdb[MAX_ANTENNAS];}dispatch_t;#define STATE_EXIT 0#define STATE_STOPPED 1#define STATE_RUNNING 2// The dispatcher threaddispatch_t disp_thread;// The array of the antenna-parametersswr_ant_param_t params[ MAX_ANTENNAS ];// How many antennas are initialised alreadyint initialised_antennas;/** * @short The dispatcher thread */void *ant_dispatch( void* arg ) {  dispatch_t *this = &disp_thread;  int nbr_ant, wait, blocks, slots;  swr_ant_notify_t *notify;  swr_usr_msg_t *msg;  struct sched_param p;  // Make this a FIFO-realtime thread.  p.sched_priority = 1;  pthread_setschedparam (pthread_self(), SCHED_FIFO, &p);  // Initialising  PR_DBG( 2, "Dispatcher started, initialising\n" );  wait = blocks = this->offset = slots = 0;  // The main loop, once for each slot  do {    // Do the transmission, whatever it is, and wait for the next slot    if ( wait > 0 ) {      PR_DBG( 4, "Dispatcher is going to sleep for %i us\n",	      wait );      usleep( wait );    } else {      PR_DBG( 4, "Not waiting\n" );    }    if ( this->state == STATE_STOPPED ) {      // Go to sleep      PR_DBG( 4, "Dispatcher is waiting for further instructions\n" );      pthread_mutex_lock( &this->mutex );      pthread_cond_signal( &this->cond );      pthread_cond_wait( &this->cond, &this->mutex );      pthread_mutex_unlock( &this->mutex );      PR_DBG( 4, "Dispatcher is going to do %i\n", this->state );    }    // Perhaps we have to quit    if ( this->state == STATE_EXIT ) {      PR_DBG( 4, "Going to exit\n" );      break;    }    // Notify all queues    for ( nbr_ant=0; nbr_ant<initialised_antennas; nbr_ant++ ){      swr_sdb_id notify_sdb = this->notify_sdb[nbr_ant];       if ( notify_sdb >= 0 ) {	PR_DBG( 4, "Notifying queue %i\n", nbr_ant );	msg = swr_malloc( sizeof( swr_usr_msg_t ) );	strcpy( msg->id, "ANT" );	notify = swr_malloc( sizeof( swr_ant_notify_t ) );	notify->blocks = blocks + this->offset;	notify->slots = slots;	notify->slot_begin = ( notify->blocks % params[ nbr_ant ].frame_blocks ) *	  DAQ_DMA_BLOCK_SIZE_BYTES;	msg->data = notify;	PR_DBG( 4, "Sending to id %i: slot %i, blocks %i, offset %i\n",		notify_sdb, slots, blocks, this->offset );	swr_sdb_send_msg( this->notify_sdb[nbr_ant], SUBS_MSG_USER, msg, -1 );	PR_DBG( 4, "Sent message to %i\n", notify_sdb );      }    }    // The time up to the next slot    blocks += this->slot_len;    slots++;    // Get the time in us to wait for the next slot to pass    PR_DBG( 4, "How long do we have to wait?\n" );    wait = swr_ant_ch_io( blocks + this->offset );    PR_DBG( 4, "Finished while-loop and will wait for %i\n", wait );  } while ( this->state != STATE_EXIT );  PR_DBG( 3, "Byebye from the dispatcher\n" );  return NULL;}// The space we allocate for each thread#define THREAD_STACK_SIZE 16384/** * Initialises an antenna */int swr_ant_init( swr_sdb_id notify_sdb ) {  pthread_attr_t attr;  int id, ch;  if ( ( id = swr_ant_ch_init( params + initialised_antennas ) ) < 0 ) {    PR_DBG( 0, "Failed to initialise an antenna\n" );    return -1;  }  ch = initialised_antennas++;  disp_thread.ch_id[ch] = id;  disp_thread.notify_sdb[ch] = notify_sdb;  if ( !ch ){    // We have to initialise the thread    if ( disp_thread.state != STATE_EXIT ) {      PR_DBG( 0, "Dispatcher %i already exists\n", initialised_antennas );      initialised_antennas--;      return -1;    }    #ifndef REDHAT_TLS    // Initialisation of the dispatcher-thread, needs it's own    // stack.    disp_thread.stack = swr_malloc( THREAD_STACK_SIZE );    if ( !disp_thread.stack )      goto start_dma_err_stack;#endif        pthread_attr_init( &attr );#ifndef REDHAT_TLS    pthread_attr_setstackaddr( &attr, disp_thread.stack );    pthread_attr_setstacksize( &attr, THREAD_STACK_SIZE );#endif        pthread_attr_setfp_np( &attr, 1 );    disp_thread.state = STATE_STOPPED;    disp_thread.offset = 0;    pthread_cond_init( &disp_thread.cond, NULL );    pthread_mutex_init( &disp_thread.mutex, NULL );        pthread_mutex_lock( &disp_thread.mutex );#ifndef REDHAT_TLS    if ( pthread_create( &disp_thread.thread, &attr, ant_dispatch, 			 NULL ) < 0 )#else    if ( pthread_create( &disp_thread.thread, NULL, ant_dispatch, 			 NULL ) < 0 )#endif	      goto start_dma_err_pthread;        pthread_attr_destroy( &attr );        // Wait for the thread to sleep with cond_wait    pthread_cond_wait( &disp_thread.cond, &disp_thread.mutex );    pthread_mutex_unlock( &disp_thread.mutex );  }  return id;   start_dma_err_pthread:  PR_DBG( 0, "Couldn't start ch_dispatch\n" );  pthread_attr_destroy( &attr );#ifndef REDHAT_TLS  swr_free( disp_thread.stack ); start_dma_err_stack:#endif    swr_ant_ch_free( ch );  PR_DBG( 0, "Error\n" );  return -1;}/** * @short Deletes an antenna */int swr_ant_free( int nbr_ant ) {//  swr_ant_stop();  if ( nbr_ant >= MAX_ANTENNAS ) {    PR_DBG( 0, "Asked for antenna %i, but only %i are available\n",            nbr_ant, MAX_ANTENNAS );    return -1;  }  if ( disp_thread.state == STATE_EXIT ) {    PR_DBG( 0, "Can't stop dispatcher: not initialised\n" );    return -1;  }  if ( !--initialised_antennas ){    // It's the last antenna, exit the dispatcher    PR_DBG( 2, "Exit dispatcher\n" );    // First we have to stop the thread    pthread_mutex_lock( &disp_thread.mutex );    disp_thread.state = STATE_EXIT;    pthread_cond_signal( &disp_thread.cond );    pthread_mutex_unlock( &disp_thread.mutex );    PR_DBG( 2, "Dispatcher stopped\n" );    // Then wait for it to finish    pthread_cancel( disp_thread.thread );    //  pthread_join( disp_thread.thread, NULL );    PR_DBG( 2, "Thread cancelled (but not joined)\n" );    // And stop the channel    swr_ant_ch_free( nbr_ant );    PR_DBG( 1, "Stopped Channel\n" );    // Free the mutex and conditional    pthread_mutex_destroy( &disp_thread.mutex );    pthread_cond_destroy( &disp_thread.cond );#ifndef REDHAT_TLS    // Then do some cleaning-up    swr_free( disp_thread.stack );#endif  } else {    PR_DBG( 1, "Cleaned up one antenna\n" );  }  return 0;}/** * @short Starts the antenna */int swr_ant_start( int blocks_per_frame ) {  int nbr_ant;  swr_ant_param_t *ant;  PR_DBG( 1, "Starting antennas\n" );  // Put the dispatcher in running state

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日韩成人伦理电影在线观看| 天天影视色香欲综合网老头| 欧美一区二区日韩| 日本道在线观看一区二区| av在线免费不卡| 99久久99久久精品免费看蜜桃| 国产不卡高清在线观看视频| 国产91精品入口| 不卡av在线网| 色呦呦一区二区三区| 色综合久久久久久久| 色狠狠桃花综合| 欧美日韩国产综合久久| 91精品国产综合久久福利软件| 欧美精品高清视频| 欧美一区二区免费| 26uuu久久综合| 国产午夜亚洲精品理论片色戒| 欧美韩国日本不卡| 亚洲精品伦理在线| 性久久久久久久| 久久精品国产秦先生| 国产伦精品一区二区三区在线观看 | 精品一区二区三区av| 蜜臀av性久久久久蜜臀aⅴ| 亚洲444eee在线观看| 日本欧美加勒比视频| 国产成人免费xxxxxxxx| 不卡欧美aaaaa| 欧美日韩一级二级| 久久久www免费人成精品| 国产精品久久久久一区| 五月婷婷激情综合| 国产一区美女在线| 色播五月激情综合网| 欧美大片国产精品| 1024精品合集| 久久国产麻豆精品| 91高清视频在线| 精品成人佐山爱一区二区| 自拍偷拍国产亚洲| 久久国产精品99久久人人澡| 色综合一区二区| 亚洲精品一线二线三线| 亚洲福中文字幕伊人影院| 国产一区二区在线免费观看| 91在线视频免费观看| 精品国一区二区三区| 亚洲裸体在线观看| 国产成人在线网站| 91精品国产手机| 亚洲精品国产a久久久久久| 国产麻豆午夜三级精品| 91麻豆精品国产91久久久久久久久| 中文字幕av一区二区三区免费看| 午夜精品一区二区三区免费视频 | 一本一本久久a久久精品综合麻豆| 91精品欧美一区二区三区综合在| 亚洲四区在线观看| 国产精品一卡二卡| 欧美电视剧免费全集观看| 一区二区三区四区国产精品| 成人亚洲精品久久久久软件| 久久在线免费观看| 久久99精品久久久久久动态图 | 偷窥国产亚洲免费视频| 91天堂素人约啪| 国产精品区一区二区三区| 国产在线观看免费一区| 日韩欧美在线不卡| 日韩综合一区二区| 欧美日韩高清一区二区三区| 一区二区三区精品视频在线| 99在线视频精品| 中文字幕第一区二区| 国产成人久久精品77777最新版本| 91精品欧美福利在线观看| 亚洲尤物视频在线| 欧美日韩一区国产| 五月激情六月综合| 91麻豆精品国产自产在线观看一区 | 国产电影一区二区三区| 日韩精品中文字幕一区二区三区| 亚洲.国产.中文慕字在线| 欧美午夜精品一区二区蜜桃| 一区二区三区在线观看视频 | 美女在线视频一区| 欧美电视剧免费全集观看| 狠狠色丁香久久婷婷综合_中| 精品福利一二区| 成人国产精品免费观看| 亚洲精品成人精品456| 欧美体内she精高潮| 日本午夜一区二区| 久久久久99精品国产片| av在线一区二区三区| 亚洲午夜成aⅴ人片| 日韩一区二区三区在线| 国产精品一区免费在线观看| 国产视频一区在线播放| 色综合视频在线观看| 五月激情六月综合| 久久久不卡网国产精品二区| 91免费精品国自产拍在线不卡 | 91精品国产欧美一区二区成人 | 成人国产精品免费观看| 亚洲国产精品天堂| 久久久国产午夜精品| 91麻豆免费在线观看| 免费成人在线影院| 国产精品第四页| 91精品国产综合久久香蕉麻豆| 国产一区二区三区不卡在线观看 | 国产精品久久精品日日| 欧美日韩国产高清一区| 丁香五精品蜜臀久久久久99网站| 一区二区三区四区高清精品免费观看| 欧美男女性生活在线直播观看| 精品一区二区三区不卡| 亚洲午夜视频在线观看| 久久精品一二三| 欧美三区在线观看| 国产成人精品午夜视频免费| 亚洲最新在线观看| 国产精品丝袜一区| 欧美一区日本一区韩国一区| voyeur盗摄精品| 国产乱码精品一品二品| 亚洲mv大片欧洲mv大片精品| 国产亚洲综合色| 日韩一区二区不卡| 色欧美乱欧美15图片| 成人午夜又粗又硬又大| 九色综合国产一区二区三区| 亚洲国产精品麻豆| 国产精品盗摄一区二区三区| 久久免费看少妇高潮| 欧美一区二区观看视频| 欧美三区在线视频| 在线观看免费一区| 91浏览器在线视频| av网站免费线看精品| 国产精品69久久久久水密桃| 精品一区二区综合| 日本网站在线观看一区二区三区| 亚洲蜜臀av乱码久久精品| 国产精品久久久久久妇女6080| 精品国产亚洲在线| 欧美电视剧在线看免费| 日韩午夜电影在线观看| 69堂精品视频| 91精品国产美女浴室洗澡无遮挡| 在线精品视频免费观看| 91黄色激情网站| 欧美色图在线观看| 欧美综合一区二区三区| 色网站国产精品| 欧美色视频在线| 欧美日产在线观看| 日韩免费视频一区二区| 精品国产成人系列| 精品裸体舞一区二区三区| 精品国产乱码久久久久久蜜臀 | 亚洲欧美日韩国产另类专区| 国产精品久久精品日日| 亚洲人成亚洲人成在线观看图片| 亚洲免费av高清| 亚洲成av人片一区二区三区| 日韩黄色小视频| 老司机午夜精品| 国产精品乡下勾搭老头1| 波多野结衣中文一区| 91老师片黄在线观看| 欧美喷水一区二区| 精品少妇一区二区三区日产乱码| www一区二区| 亚洲人精品午夜| 青青草原综合久久大伊人精品优势 | 午夜天堂影视香蕉久久| 日韩av电影天堂| 国产精品一区二区三区网站| 国产成人免费在线观看不卡| 色婷婷国产精品| 日韩一卡二卡三卡四卡| 久久精品欧美一区二区三区麻豆| 国产精品久久影院| 亚洲国产va精品久久久不卡综合| 日本不卡一二三| www.日韩av| 日韩欧美高清一区| 亚洲人成网站影音先锋播放| 久久成人免费电影| 91视频一区二区| 欧美一区三区二区| 亚洲精品欧美专区| 久久不见久久见中文字幕免费| 91丝袜美腿高跟国产极品老师| 欧美一区二区三区的| 亚洲欧美色一区| 黑人精品欧美一区二区蜜桃 |