@@ -116,8 +116,8 @@ static struct usbcan_data {
116
116
uint32_t assigned_id ;
117
117
118
118
// Data from physical canbus interface
119
- uint32_t pull_pos , push_pos ;
120
- struct canbus_msg queue [32 ];
119
+ uint32_t canhw_pull_pos , canhw_push_pos ;
120
+ struct canbus_msg canhw_queue [32 ];
121
121
} UsbCan ;
122
122
123
123
enum {
@@ -139,16 +139,16 @@ void
139
139
canbus_process_data (struct canbus_msg * msg )
140
140
{
141
141
// Add to admin command queue
142
- uint32_t pushp = UsbCan .push_pos ;
143
- if (pushp - UsbCan .pull_pos >= ARRAY_SIZE (UsbCan .queue ))
142
+ uint32_t pushp = UsbCan .canhw_push_pos ;
143
+ if (pushp - UsbCan .canhw_pull_pos >= ARRAY_SIZE (UsbCan .canhw_queue ))
144
144
// No space - drop message
145
145
return ;
146
146
if (UsbCan .assigned_id && (msg -> id & ~1 ) == UsbCan .assigned_id )
147
147
// Id reserved for local
148
148
return ;
149
- uint32_t pos = pushp % ARRAY_SIZE (UsbCan .queue );
150
- memcpy (& UsbCan .queue [pos ], msg , sizeof (* msg ));
151
- UsbCan .push_pos = pushp + 1 ;
149
+ uint32_t pos = pushp % ARRAY_SIZE (UsbCan .canhw_queue );
150
+ memcpy (& UsbCan .canhw_queue [pos ], msg , sizeof (* msg ));
151
+ UsbCan .canhw_push_pos = pushp + 1 ;
152
152
usb_notify_bulk_out ();
153
153
}
154
154
@@ -167,24 +167,24 @@ send_frame(struct canbus_msg *msg)
167
167
168
168
// Send any pending hw frames to host
169
169
static void
170
- drain_hw_queue (void )
170
+ drain_canhw_queue (void )
171
171
{
172
- uint32_t pull_pos = UsbCan .pull_pos ;
172
+ uint32_t pull_pos = UsbCan .canhw_pull_pos ;
173
173
for (;;) {
174
- uint32_t push_pos = readl (& UsbCan .push_pos );
174
+ uint32_t push_pos = readl (& UsbCan .canhw_push_pos );
175
175
if (push_pos == pull_pos ) {
176
176
// No more data to send
177
177
UsbCan .usb_send_busy = 0 ;
178
178
return ;
179
179
}
180
- uint32_t pos = pull_pos % ARRAY_SIZE (UsbCan .queue );
181
- int ret = send_frame (& UsbCan .queue [pos ]);
180
+ uint32_t pos = pull_pos % ARRAY_SIZE (UsbCan .canhw_queue );
181
+ int ret = send_frame (& UsbCan .canhw_queue [pos ]);
182
182
if (ret < 0 ) {
183
183
// USB is busy - retry later
184
184
UsbCan .usb_send_busy = 1 ;
185
185
return ;
186
186
}
187
- UsbCan .pull_pos = pull_pos = pull_pos + 1 ;
187
+ UsbCan .canhw_pull_pos = pull_pos = pull_pos + 1 ;
188
188
}
189
189
}
190
190
@@ -195,7 +195,7 @@ usbcan_task(void)
195
195
return ;
196
196
197
197
// Send any pending hw frames to host
198
- drain_hw_queue ();
198
+ drain_canhw_queue ();
199
199
200
200
for (;;) {
201
201
// See if previous host frame needs to be transmitted
0 commit comments