30 #include <rtnet_rtpc.h> 31 #include <rtmac/rtmac_disc.h> 33 #define RTMAC_TYPE_TDMA 0x0001 35 #define TDMA_MAGIC 0x3A0D4D0A 37 #define TDMA_FLAG_CALIBRATED 1 38 #define TDMA_FLAG_RECEIVED_SYNC 2 39 #define TDMA_FLAG_MASTER 3 40 #define TDMA_FLAG_BACKUP_MASTER 4 41 #define TDMA_FLAG_ATTACHED 5 42 #define TDMA_FLAG_BACKUP_ACTIVE 6 44 #define DEFAULT_SLOT 0 45 #define DEFAULT_NRT_SLOT 1 48 #define WAIT_ON_SYNC -1 50 #define BACKUP_SYNC -3 51 #define XMIT_REQ_CAL -4 52 #define XMIT_RPL_CAL -5 57 struct list_head entry;
59 unsigned int ref_count;
62 #define SLOT_JOB(job) ((struct tdma_slot *)(job)) 72 struct rtskb_prio_queue *queue;
73 struct rtskb_prio_queue local_queue;
76 #define REQUEST_CAL_JOB(job) ((struct tdma_request_cal *)(job)) 78 struct tdma_request_cal {
81 struct tdma_priv *tdma;
85 unsigned int cal_rounds;
90 #define REPLY_CAL_JOB(job) ((struct tdma_reply_cal *)(job)) 92 struct tdma_reply_cal {
97 struct rtskb *reply_rtskb;
102 struct rtnet_device *rtdev;
103 char device_name[32];
107 #ifdef ALIGN_RTOS_TASK 108 __u8 __align[(ALIGN_RTOS_TASK -
109 ((
sizeof(
unsigned int) +
sizeof(
struct rtnet_device *) +
111 (ALIGN_RTOS_TASK - 1))) &
112 (ALIGN_RTOS_TASK - 1)];
114 rtdm_task_t worker_task;
115 rtdm_event_t worker_wakeup;
116 rtdm_event_t xmit_event;
117 rtdm_event_t sync_event;
120 unsigned int cal_rounds;
122 u64 current_cycle_start;
123 u64 master_packet_delay_ns;
126 struct tdma_job sync_job;
127 struct tdma_job *first_job;
128 struct tdma_job *current_job;
129 volatile unsigned int job_list_revision;
131 unsigned int max_slot_id;
132 struct tdma_slot **slot_table;
134 struct rt_proc_call *calibration_call;
135 unsigned char master_hw_addr[MAX_ADDR_LEN];
139 #ifdef CONFIG_XENO_DRIVERS_NET_TDMA_MASTER 140 struct rtskb_pool cal_rtskb_pool;
145 #ifdef CONFIG_XENO_OPT_VFILE 146 struct list_head list_entry;
150 extern struct rtmac_disc tdma_disc;
152 #define print_jobs() \ 154 struct tdma_job *entry; \ 155 rtdm_printk("%s:%d - ", __FUNCTION__, __LINE__); \ 156 list_for_each_entry (entry, &tdma->first_job->entry, entry) \ 157 rtdm_printk("%d ", entry->id); \ ipipe_spinlock_t rtdm_lock_t
Lock variable.
Definition: driver.h:551
int64_t nanosecs_rel_t
RTDM type for representing relative intervals.
Definition: rtdm.h:49
Real-Time Driver Model for Xenomai, driver API header.
RTDM device.
Definition: driver.h:338
RTDM driver.
Definition: driver.h:249