30 #include <rtnet_rtpc.h> 31 #include <rtmac/rtmac_disc.h> 34 #define RTMAC_TYPE_TDMA 0x0001 36 #define TDMA_MAGIC 0x3A0D4D0A 38 #define TDMA_FLAG_CALIBRATED 1 39 #define TDMA_FLAG_RECEIVED_SYNC 2 40 #define TDMA_FLAG_MASTER 3 41 #define TDMA_FLAG_BACKUP_MASTER 4 42 #define TDMA_FLAG_ATTACHED 5 43 #define TDMA_FLAG_BACKUP_ACTIVE 6 45 #define DEFAULT_SLOT 0 46 #define DEFAULT_NRT_SLOT 1 49 #define WAIT_ON_SYNC -1 51 #define BACKUP_SYNC -3 52 #define XMIT_REQ_CAL -4 53 #define XMIT_RPL_CAL -5 60 struct list_head entry;
62 unsigned int ref_count;
66 #define SLOT_JOB(job) ((struct tdma_slot *)(job)) 76 struct rtskb_prio_queue *queue;
77 struct rtskb_prio_queue local_queue;
81 #define REQUEST_CAL_JOB(job) ((struct tdma_request_cal *)(job)) 83 struct tdma_request_cal {
86 struct tdma_priv *tdma;
90 unsigned int cal_rounds;
96 #define REPLY_CAL_JOB(job) ((struct tdma_reply_cal *)(job)) 98 struct tdma_reply_cal {
103 struct rtskb *reply_rtskb;
108 struct rtnet_device *rtdev;
109 char device_name[32];
113 #ifdef ALIGN_RTOS_TASK 114 __u8 __align[(ALIGN_RTOS_TASK -
115 ((
sizeof(
unsigned int) +
116 sizeof(
struct rtnet_device *) +
118 ) & (ALIGN_RTOS_TASK-1))
119 ) & (ALIGN_RTOS_TASK-1)];
121 rtdm_task_t worker_task;
122 rtdm_event_t worker_wakeup;
123 rtdm_event_t xmit_event;
124 rtdm_event_t sync_event;
127 unsigned int cal_rounds;
129 u64 current_cycle_start;
130 u64 master_packet_delay_ns;
133 struct tdma_job sync_job;
134 struct tdma_job *first_job;
135 struct tdma_job *current_job;
136 volatile unsigned int job_list_revision;
138 unsigned int max_slot_id;
139 struct tdma_slot **slot_table;
141 struct rt_proc_call *calibration_call;
142 unsigned char master_hw_addr[MAX_ADDR_LEN];
146 #ifdef CONFIG_XENO_DRIVERS_NET_TDMA_MASTER 147 struct rtskb_pool cal_rtskb_pool;
152 #ifdef CONFIG_XENO_OPT_VFILE 153 struct list_head list_entry;
158 extern struct rtmac_disc tdma_disc;
160 #define print_jobs() do { \ 161 struct tdma_job *entry; \ 162 rtdm_printk("%s:%d - ", __FUNCTION__, __LINE__); \ 163 list_for_each_entry(entry, &tdma->first_job->entry, entry) \ 164 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