@@ -25,13 +25,13 @@ MODULE_LICENSE("GPL");
25
25
MODULE_DESCRIPTION ("GPIB driver for Agilent 82350b" );
26
26
27
27
static int read_transfer_counter (struct agilent_82350b_priv * a_priv );
28
- static unsigned short read_and_clear_event_status (gpib_board_t * board );
28
+ static unsigned short read_and_clear_event_status (struct gpib_board * board );
29
29
static void set_transfer_counter (struct agilent_82350b_priv * a_priv , int count );
30
- static int agilent_82350b_write (gpib_board_t * board , uint8_t * buffer , size_t length , int send_eoi ,
31
- size_t * bytes_written );
30
+ static int agilent_82350b_write (struct gpib_board * board , uint8_t * buffer ,
31
+ size_t length , int send_eoi , size_t * bytes_written );
32
32
33
- static int agilent_82350b_accel_read (gpib_board_t * board , uint8_t * buffer , size_t length , int * end ,
34
- size_t * bytes_read )
33
+ static int agilent_82350b_accel_read (struct gpib_board * board , uint8_t * buffer ,
34
+ size_t length , int * end , size_t * bytes_read )
35
35
36
36
{
37
37
struct agilent_82350b_priv * a_priv = board -> private_data ;
@@ -130,7 +130,7 @@ static int agilent_82350b_accel_read(gpib_board_t *board, uint8_t *buffer, size_
130
130
return 0 ;
131
131
}
132
132
133
- static int translate_wait_return_value (gpib_board_t * board , int retval )
133
+ static int translate_wait_return_value (struct gpib_board * board , int retval )
134
134
135
135
{
136
136
struct agilent_82350b_priv * a_priv = board -> private_data ;
@@ -145,8 +145,9 @@ static int translate_wait_return_value(gpib_board_t *board, int retval)
145
145
return 0 ;
146
146
}
147
147
148
- static int agilent_82350b_accel_write (gpib_board_t * board , uint8_t * buffer , size_t length ,
149
- int send_eoi , size_t * bytes_written )
148
+ static int agilent_82350b_accel_write (struct gpib_board * board , uint8_t * buffer ,
149
+ size_t length , int send_eoi ,
150
+ size_t * bytes_written )
150
151
{
151
152
struct agilent_82350b_priv * a_priv = board -> private_data ;
152
153
struct tms9914_priv * tms_priv = & a_priv -> tms9914_priv ;
@@ -227,7 +228,7 @@ static int agilent_82350b_accel_write(gpib_board_t *board, uint8_t *buffer, size
227
228
return 0 ;
228
229
}
229
230
230
- static unsigned short read_and_clear_event_status (gpib_board_t * board )
231
+ static unsigned short read_and_clear_event_status (struct gpib_board * board )
231
232
{
232
233
struct agilent_82350b_priv * a_priv = board -> private_data ;
233
234
unsigned long flags ;
@@ -245,7 +246,7 @@ static irqreturn_t agilent_82350b_interrupt(int irq, void *arg)
245
246
{
246
247
int tms9914_status1 = 0 , tms9914_status2 = 0 ;
247
248
int event_status ;
248
- gpib_board_t * board = arg ;
249
+ struct gpib_board * board = arg ;
249
250
struct agilent_82350b_priv * a_priv = board -> private_data ;
250
251
unsigned long flags ;
251
252
irqreturn_t retval = IRQ_NONE ;
@@ -272,7 +273,7 @@ static irqreturn_t agilent_82350b_interrupt(int irq, void *arg)
272
273
return retval ;
273
274
}
274
275
275
- static void agilent_82350b_detach (gpib_board_t * board );
276
+ static void agilent_82350b_detach (struct gpib_board * board );
276
277
277
278
static int read_transfer_counter (struct agilent_82350b_priv * a_priv )
278
279
{
@@ -296,50 +297,50 @@ static void set_transfer_counter(struct agilent_82350b_priv *a_priv, int count)
296
297
}
297
298
298
299
// wrappers for interface functions
299
- static int agilent_82350b_read (gpib_board_t * board , uint8_t * buffer , size_t length , int * end ,
300
- size_t * bytes_read )
301
-
300
+ static int agilent_82350b_read (struct gpib_board * board , uint8_t * buffer ,
301
+ size_t length , int * end , size_t * bytes_read )
302
302
{
303
303
struct agilent_82350b_priv * priv = board -> private_data ;
304
304
305
305
return tms9914_read (board , & priv -> tms9914_priv , buffer , length , end , bytes_read );
306
306
}
307
307
308
- static int agilent_82350b_write (gpib_board_t * board , uint8_t * buffer , size_t length , int send_eoi ,
309
- size_t * bytes_written )
308
+ static int agilent_82350b_write (struct gpib_board * board , uint8_t * buffer ,
309
+ size_t length , int send_eoi , size_t * bytes_written )
310
310
311
311
{
312
312
struct agilent_82350b_priv * priv = board -> private_data ;
313
313
314
314
return tms9914_write (board , & priv -> tms9914_priv , buffer , length , send_eoi , bytes_written );
315
315
}
316
316
317
- static int agilent_82350b_command (gpib_board_t * board , uint8_t * buffer , size_t length ,
318
- size_t * bytes_written )
317
+ static int agilent_82350b_command (struct gpib_board * board , uint8_t * buffer ,
318
+ size_t length , size_t * bytes_written )
319
319
320
320
{
321
321
struct agilent_82350b_priv * priv = board -> private_data ;
322
322
323
323
return tms9914_command (board , & priv -> tms9914_priv , buffer , length , bytes_written );
324
324
}
325
325
326
- static int agilent_82350b_take_control (gpib_board_t * board , int synchronous )
326
+ static int agilent_82350b_take_control (struct gpib_board * board , int synchronous )
327
327
328
328
{
329
329
struct agilent_82350b_priv * priv = board -> private_data ;
330
330
331
331
return tms9914_take_control_workaround (board , & priv -> tms9914_priv , synchronous );
332
332
}
333
333
334
- static int agilent_82350b_go_to_standby (gpib_board_t * board )
334
+ static int agilent_82350b_go_to_standby (struct gpib_board * board )
335
335
336
336
{
337
337
struct agilent_82350b_priv * priv = board -> private_data ;
338
338
339
339
return tms9914_go_to_standby (board , & priv -> tms9914_priv );
340
340
}
341
341
342
- static void agilent_82350b_request_system_control (gpib_board_t * board , int request_control )
342
+ static void agilent_82350b_request_system_control (struct gpib_board * board ,
343
+ int request_control )
343
344
344
345
{
345
346
struct agilent_82350b_priv * a_priv = board -> private_data ;
@@ -357,99 +358,105 @@ static void agilent_82350b_request_system_control(gpib_board_t *board, int reque
357
358
tms9914_request_system_control (board , & a_priv -> tms9914_priv , request_control );
358
359
}
359
360
360
- static void agilent_82350b_interface_clear (gpib_board_t * board , int assert )
361
+ static void agilent_82350b_interface_clear (struct gpib_board * board , int assert )
361
362
362
363
{
363
364
struct agilent_82350b_priv * priv = board -> private_data ;
364
365
365
366
tms9914_interface_clear (board , & priv -> tms9914_priv , assert );
366
367
}
367
368
368
- static void agilent_82350b_remote_enable (gpib_board_t * board , int enable )
369
+ static void agilent_82350b_remote_enable (struct gpib_board * board , int enable )
369
370
{
370
371
struct agilent_82350b_priv * priv = board -> private_data ;
371
372
372
373
tms9914_remote_enable (board , & priv -> tms9914_priv , enable );
373
374
}
374
375
375
- static int agilent_82350b_enable_eos (gpib_board_t * board , uint8_t eos_byte , int compare_8_bits )
376
+ static int agilent_82350b_enable_eos (struct gpib_board * board , uint8_t eos_byte ,
377
+ int compare_8_bits )
376
378
{
377
379
struct agilent_82350b_priv * priv = board -> private_data ;
378
380
379
381
return tms9914_enable_eos (board , & priv -> tms9914_priv , eos_byte , compare_8_bits );
380
382
}
381
383
382
- static void agilent_82350b_disable_eos (gpib_board_t * board )
384
+ static void agilent_82350b_disable_eos (struct gpib_board * board )
383
385
{
384
386
struct agilent_82350b_priv * priv = board -> private_data ;
385
387
386
388
tms9914_disable_eos (board , & priv -> tms9914_priv );
387
389
}
388
390
389
- static unsigned int agilent_82350b_update_status (gpib_board_t * board , unsigned int clear_mask )
391
+ static unsigned int agilent_82350b_update_status (struct gpib_board * board ,
392
+ unsigned int clear_mask )
390
393
{
391
394
struct agilent_82350b_priv * priv = board -> private_data ;
392
395
393
396
return tms9914_update_status (board , & priv -> tms9914_priv , clear_mask );
394
397
}
395
398
396
- static int agilent_82350b_primary_address (gpib_board_t * board , unsigned int address )
399
+ static int agilent_82350b_primary_address (struct gpib_board * board ,
400
+ unsigned int address )
397
401
{
398
402
struct agilent_82350b_priv * priv = board -> private_data ;
399
403
400
404
return tms9914_primary_address (board , & priv -> tms9914_priv , address );
401
405
}
402
406
403
- static int agilent_82350b_secondary_address (gpib_board_t * board , unsigned int address , int enable )
407
+ static int agilent_82350b_secondary_address (struct gpib_board * board ,
408
+ unsigned int address , int enable )
404
409
{
405
410
struct agilent_82350b_priv * priv = board -> private_data ;
406
411
407
412
return tms9914_secondary_address (board , & priv -> tms9914_priv , address , enable );
408
413
}
409
414
410
- static int agilent_82350b_parallel_poll (gpib_board_t * board , uint8_t * result )
415
+ static int agilent_82350b_parallel_poll (struct gpib_board * board , uint8_t * result )
411
416
{
412
417
struct agilent_82350b_priv * priv = board -> private_data ;
413
418
414
419
return tms9914_parallel_poll (board , & priv -> tms9914_priv , result );
415
420
}
416
421
417
- static void agilent_82350b_parallel_poll_configure (gpib_board_t * board , uint8_t config )
422
+ static void agilent_82350b_parallel_poll_configure (struct gpib_board * board ,
423
+ uint8_t config )
418
424
{
419
425
struct agilent_82350b_priv * priv = board -> private_data ;
420
426
421
427
tms9914_parallel_poll_configure (board , & priv -> tms9914_priv , config );
422
428
}
423
429
424
- static void agilent_82350b_parallel_poll_response (gpib_board_t * board , int ist )
430
+ static void agilent_82350b_parallel_poll_response (struct gpib_board * board , int ist )
425
431
{
426
432
struct agilent_82350b_priv * priv = board -> private_data ;
427
433
428
434
tms9914_parallel_poll_response (board , & priv -> tms9914_priv , ist );
429
435
}
430
436
431
- static void agilent_82350b_serial_poll_response (gpib_board_t * board , uint8_t status )
437
+ static void agilent_82350b_serial_poll_response (struct gpib_board * board , uint8_t status )
432
438
{
433
439
struct agilent_82350b_priv * priv = board -> private_data ;
434
440
435
441
tms9914_serial_poll_response (board , & priv -> tms9914_priv , status );
436
442
}
437
443
438
- static uint8_t agilent_82350b_serial_poll_status (gpib_board_t * board )
444
+ static uint8_t agilent_82350b_serial_poll_status (struct gpib_board * board )
439
445
{
440
446
struct agilent_82350b_priv * priv = board -> private_data ;
441
447
442
448
return tms9914_serial_poll_status (board , & priv -> tms9914_priv );
443
449
}
444
450
445
- static int agilent_82350b_line_status (const gpib_board_t * board )
451
+ static int agilent_82350b_line_status (const struct gpib_board * board )
446
452
{
447
453
struct agilent_82350b_priv * priv = board -> private_data ;
448
454
449
455
return tms9914_line_status (board , & priv -> tms9914_priv );
450
456
}
451
457
452
- static unsigned int agilent_82350b_t1_delay (gpib_board_t * board , unsigned int nanosec )
458
+ static unsigned int agilent_82350b_t1_delay (struct gpib_board * board ,
459
+ unsigned int nanosec )
453
460
{
454
461
struct agilent_82350b_priv * a_priv = board -> private_data ;
455
462
static const int nanosec_per_clock = 30 ;
@@ -464,28 +471,29 @@ static unsigned int agilent_82350b_t1_delay(gpib_board_t *board, unsigned int na
464
471
return value * nanosec_per_clock ;
465
472
}
466
473
467
- static void agilent_82350b_return_to_local (gpib_board_t * board )
474
+ static void agilent_82350b_return_to_local (struct gpib_board * board )
468
475
{
469
476
struct agilent_82350b_priv * priv = board -> private_data ;
470
477
471
478
tms9914_return_to_local (board , & priv -> tms9914_priv );
472
479
}
473
480
474
- static int agilent_82350b_allocate_private (gpib_board_t * board )
481
+ static int agilent_82350b_allocate_private (struct gpib_board * board )
475
482
{
476
483
board -> private_data = kzalloc (sizeof (struct agilent_82350b_priv ), GFP_KERNEL );
477
484
if (!board -> private_data )
478
485
return - ENOMEM ;
479
486
return 0 ;
480
487
}
481
488
482
- static void agilent_82350b_free_private (gpib_board_t * board )
489
+ static void agilent_82350b_free_private (struct gpib_board * board )
483
490
{
484
491
kfree (board -> private_data );
485
492
board -> private_data = NULL ;
486
493
}
487
494
488
- static int init_82350a_hardware (gpib_board_t * board , const gpib_board_config_t * config )
495
+ static int init_82350a_hardware (struct gpib_board * board ,
496
+ const gpib_board_config_t * config )
489
497
{
490
498
struct agilent_82350b_priv * a_priv = board -> private_data ;
491
499
static const unsigned int firmware_length = 5302 ;
@@ -550,7 +558,7 @@ static int init_82350a_hardware(gpib_board_t *board, const gpib_board_config_t *
550
558
return 0 ;
551
559
}
552
560
553
- static int test_sram (gpib_board_t * board )
561
+ static int test_sram (struct gpib_board * board )
554
562
555
563
{
556
564
struct agilent_82350b_priv * a_priv = board -> private_data ;
@@ -579,7 +587,8 @@ static int test_sram(gpib_board_t *board)
579
587
return 0 ;
580
588
}
581
589
582
- static int agilent_82350b_generic_attach (gpib_board_t * board , const gpib_board_config_t * config ,
590
+ static int agilent_82350b_generic_attach (struct gpib_board * board ,
591
+ const gpib_board_config_t * config ,
583
592
int use_fifos )
584
593
585
594
{
@@ -721,17 +730,19 @@ static int agilent_82350b_generic_attach(gpib_board_t *board, const gpib_board_c
721
730
return 0 ;
722
731
}
723
732
724
- static int agilent_82350b_unaccel_attach (gpib_board_t * board , const gpib_board_config_t * config )
733
+ static int agilent_82350b_unaccel_attach (struct gpib_board * board ,
734
+ const gpib_board_config_t * config )
725
735
{
726
736
return agilent_82350b_generic_attach (board , config , 0 );
727
737
}
728
738
729
- static int agilent_82350b_accel_attach (gpib_board_t * board , const gpib_board_config_t * config )
739
+ static int agilent_82350b_accel_attach (struct gpib_board * board ,
740
+ const gpib_board_config_t * config )
730
741
{
731
742
return agilent_82350b_generic_attach (board , config , 1 );
732
743
}
733
744
734
- static void agilent_82350b_detach (gpib_board_t * board )
745
+ static void agilent_82350b_detach (struct gpib_board * board )
735
746
{
736
747
struct agilent_82350b_priv * a_priv = board -> private_data ;
737
748
struct tms9914_priv * tms_priv ;
0 commit comments