⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 tc.h

📁 AT91RM9200的定时器驱动(linux2.4内核)
💻 H
字号:
/* *  AT91RM9200 PERFTEST driver for use for high speed packet sending/receiving * *		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. */#ifndef AT91_PERFTEST#define AT91_PERFTEST#include "pmla.h"  /* poor man's logic analyzer */struct perftest_packet  {  unsigned int us_pr;  /* Transmit/Receive Pointer Register copy */  unsigned int us_cr;  /* Transmit/Receive Counter Register copy */};#define AT91_PERFTEST_SPEED 3686400  /* in bits per second */#define AT91_PERFTEST_MAX_PACKET_SZ (AT91_PERFTEST_SPEED / 10)  /* in bytes per second *//* the number of pages we need to que per read/write */#define AT91_PERFTEST_MAX_PAGES ((((PAGE_SIZE * 2) - 2 + AT91_PERFTEST_MAX_PACKET_SZ) / PAGE_SIZE) + 2)/* Calculation of time-out duration: (US_RTOR Value) * (Bit Period) */#define AT91_PERFTEST_RX_TIMEOUT (5 * 10)  /* 5 bytes @ 10 bits/byte */struct perftest_frame  {  struct perftest_packet packet[AT91_PERFTEST_MAX_PAGES];  struct perftest_packet *p_head;  struct perftest_packet *p_tail_int;  wait_queue_head_t waitque;  /* wait que for read/write to complete */  struct kiobuf *kiobuf;  /* 1 kiobuf for each receive/xmit */  spinlock_t lock1;  /* some spinlocks for saving/restoring interrupt levels */  };struct perftest_local  {  AT91PS_PERFTEST pPerftest;  /* base address of PERFTEST */  int irq;  /* interrupt number for this PERFTEST */  struct perftest_frame rx;  int rx_cntr;  /* count how many char's actually received before timeout */  struct perftest_frame tx;//  spinlock_t lock1;  /* some spinlocks for saving/restoring interrupt levels */  PMLA pmla;  /* software logic analyzer */};#endif

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -