@@ -25,9 +25,10 @@ MODULE_DESCRIPTION("GPIB driver for Agilent 82357A/B usb adapters");
25
25
static struct usb_interface * agilent_82357a_driver_interfaces [MAX_NUM_82357A_INTERFACES ];
26
26
static DEFINE_MUTEX (agilent_82357a_hotplug_lock ); // protect board insertion and removal
27
27
28
- static unsigned int agilent_82357a_update_status (gpib_board_t * board , unsigned int clear_mask );
28
+ static unsigned int agilent_82357a_update_status (struct gpib_board * board ,
29
+ unsigned int clear_mask );
29
30
30
- static int agilent_82357a_take_control_internal (gpib_board_t * board , int synchronous );
31
+ static int agilent_82357a_take_control_internal (struct gpib_board * board , int synchronous );
31
32
32
33
static void agilent_82357a_bulk_complete (struct urb * urb )
33
34
{
@@ -419,10 +420,10 @@ static int agilent_82357a_abort(struct agilent_82357a_priv *a_priv, int flush)
419
420
}
420
421
421
422
// interface functions
422
- int agilent_82357a_command (gpib_board_t * board , uint8_t * buffer , size_t length ,
423
+ int agilent_82357a_command (struct gpib_board * board , uint8_t * buffer , size_t length ,
423
424
size_t * bytes_written );
424
425
425
- static int agilent_82357a_read (gpib_board_t * board , uint8_t * buffer , size_t length , int * end ,
426
+ static int agilent_82357a_read (struct gpib_board * board , uint8_t * buffer , size_t length , int * end ,
426
427
size_t * nbytes )
427
428
{
428
429
int retval ;
@@ -533,8 +534,10 @@ static int agilent_82357a_read(gpib_board_t *board, uint8_t *buffer, size_t leng
533
534
return retval ;
534
535
}
535
536
536
- static ssize_t agilent_82357a_generic_write (gpib_board_t * board , uint8_t * buffer , size_t length ,
537
- int send_commands , int send_eoi , size_t * bytes_written )
537
+ static ssize_t agilent_82357a_generic_write (struct gpib_board * board ,
538
+ uint8_t * buffer , size_t length ,
539
+ int send_commands , int send_eoi ,
540
+ size_t * bytes_written )
538
541
{
539
542
int retval ;
540
543
struct agilent_82357a_priv * a_priv = board -> private_data ;
@@ -672,19 +675,19 @@ static ssize_t agilent_82357a_generic_write(gpib_board_t *board, uint8_t *buffer
672
675
return 0 ;
673
676
}
674
677
675
- static int agilent_82357a_write (gpib_board_t * board , uint8_t * buffer , size_t length ,
676
- int send_eoi , size_t * bytes_written )
678
+ static int agilent_82357a_write (struct gpib_board * board , uint8_t * buffer ,
679
+ size_t length , int send_eoi , size_t * bytes_written )
677
680
{
678
681
return agilent_82357a_generic_write (board , buffer , length , 0 , send_eoi , bytes_written );
679
682
}
680
683
681
- int agilent_82357a_command (gpib_board_t * board , uint8_t * buffer , size_t length ,
684
+ int agilent_82357a_command (struct gpib_board * board , uint8_t * buffer , size_t length ,
682
685
size_t * bytes_written )
683
686
{
684
687
return agilent_82357a_generic_write (board , buffer , length , 1 , 0 , bytes_written );
685
688
}
686
689
687
- int agilent_82357a_take_control_internal (gpib_board_t * board , int synchronous )
690
+ int agilent_82357a_take_control_internal (struct gpib_board * board , int synchronous )
688
691
{
689
692
struct agilent_82357a_priv * a_priv = board -> private_data ;
690
693
struct usb_device * usb_dev = interface_to_usbdev (a_priv -> bus_interface );
@@ -703,7 +706,7 @@ int agilent_82357a_take_control_internal(gpib_board_t *board, int synchronous)
703
706
return retval ;
704
707
}
705
708
706
- static int agilent_82357a_take_control (gpib_board_t * board , int synchronous )
709
+ static int agilent_82357a_take_control (struct gpib_board * board , int synchronous )
707
710
{
708
711
struct agilent_82357a_priv * a_priv = board -> private_data ;
709
712
const int timeout = 10 ;
@@ -732,7 +735,7 @@ static int agilent_82357a_take_control(gpib_board_t *board, int synchronous)
732
735
return 0 ;
733
736
}
734
737
735
- static int agilent_82357a_go_to_standby (gpib_board_t * board )
738
+ static int agilent_82357a_go_to_standby (struct gpib_board * board )
736
739
{
737
740
struct agilent_82357a_priv * a_priv = board -> private_data ;
738
741
struct usb_device * usb_dev ;
@@ -752,7 +755,8 @@ static int agilent_82357a_go_to_standby(gpib_board_t *board)
752
755
}
753
756
754
757
//FIXME should change prototype to return int
755
- static void agilent_82357a_request_system_control (gpib_board_t * board , int request_control )
758
+ static void agilent_82357a_request_system_control (struct gpib_board * board ,
759
+ int request_control )
756
760
{
757
761
struct agilent_82357a_priv * a_priv = board -> private_data ;
758
762
struct usb_device * usb_dev ;
@@ -784,7 +788,7 @@ static void agilent_82357a_request_system_control(gpib_board_t *board, int reque
784
788
return ;// retval;
785
789
}
786
790
787
- static void agilent_82357a_interface_clear (gpib_board_t * board , int assert )
791
+ static void agilent_82357a_interface_clear (struct gpib_board * board , int assert )
788
792
{
789
793
struct agilent_82357a_priv * a_priv = board -> private_data ;
790
794
struct usb_device * usb_dev ;
@@ -806,7 +810,7 @@ static void agilent_82357a_interface_clear(gpib_board_t *board, int assert)
806
810
dev_err (& usb_dev -> dev , "write_registers() returned error\n" );
807
811
}
808
812
809
- static void agilent_82357a_remote_enable (gpib_board_t * board , int enable )
813
+ static void agilent_82357a_remote_enable (struct gpib_board * board , int enable )
810
814
{
811
815
struct agilent_82357a_priv * a_priv = board -> private_data ;
812
816
struct usb_device * usb_dev ;
@@ -828,7 +832,8 @@ static void agilent_82357a_remote_enable(gpib_board_t *board, int enable)
828
832
return ;// 0;
829
833
}
830
834
831
- static int agilent_82357a_enable_eos (gpib_board_t * board , uint8_t eos_byte , int compare_8_bits )
835
+ static int agilent_82357a_enable_eos (struct gpib_board * board , uint8_t eos_byte ,
836
+ int compare_8_bits )
832
837
{
833
838
struct agilent_82357a_priv * a_priv = board -> private_data ;
834
839
@@ -842,14 +847,15 @@ static int agilent_82357a_enable_eos(gpib_board_t *board, uint8_t eos_byte, int
842
847
return 0 ;
843
848
}
844
849
845
- static void agilent_82357a_disable_eos (gpib_board_t * board )
850
+ static void agilent_82357a_disable_eos (struct gpib_board * board )
846
851
{
847
852
struct agilent_82357a_priv * a_priv = board -> private_data ;
848
853
849
854
a_priv -> eos_mode &= ~REOS ;
850
855
}
851
856
852
- static unsigned int agilent_82357a_update_status (gpib_board_t * board , unsigned int clear_mask )
857
+ static unsigned int agilent_82357a_update_status (struct gpib_board * board ,
858
+ unsigned int clear_mask )
853
859
{
854
860
struct agilent_82357a_priv * a_priv = board -> private_data ;
855
861
struct usb_device * usb_dev ;
@@ -911,7 +917,7 @@ static unsigned int agilent_82357a_update_status(gpib_board_t *board, unsigned i
911
917
return board -> status ;
912
918
}
913
919
914
- static int agilent_82357a_primary_address (gpib_board_t * board , unsigned int address )
920
+ static int agilent_82357a_primary_address (struct gpib_board * board , unsigned int address )
915
921
{
916
922
struct agilent_82357a_priv * a_priv = board -> private_data ;
917
923
struct usb_device * usb_dev = interface_to_usbdev (a_priv -> bus_interface );
@@ -932,14 +938,15 @@ static int agilent_82357a_primary_address(gpib_board_t *board, unsigned int addr
932
938
return retval ;
933
939
}
934
940
935
- static int agilent_82357a_secondary_address (gpib_board_t * board , unsigned int address , int enable )
941
+ static int agilent_82357a_secondary_address (struct gpib_board * board ,
942
+ unsigned int address , int enable )
936
943
{
937
944
if (enable )
938
945
return - EOPNOTSUPP ;
939
946
return 0 ;
940
947
}
941
948
942
- static int agilent_82357a_parallel_poll (gpib_board_t * board , uint8_t * result )
949
+ static int agilent_82357a_parallel_poll (struct gpib_board * board , uint8_t * result )
943
950
{
944
951
struct agilent_82357a_priv * a_priv = board -> private_data ;
945
952
struct usb_device * usb_dev ;
@@ -981,37 +988,37 @@ static int agilent_82357a_parallel_poll(gpib_board_t *board, uint8_t *result)
981
988
return 0 ;
982
989
}
983
990
984
- static void agilent_82357a_parallel_poll_configure (gpib_board_t * board , uint8_t config )
991
+ static void agilent_82357a_parallel_poll_configure (struct gpib_board * board , uint8_t config )
985
992
{
986
993
//board can only be system controller
987
994
return ;// 0;
988
995
}
989
996
990
- static void agilent_82357a_parallel_poll_response (gpib_board_t * board , int ist )
997
+ static void agilent_82357a_parallel_poll_response (struct gpib_board * board , int ist )
991
998
{
992
999
//board can only be system controller
993
1000
return ;// 0;
994
1001
}
995
1002
996
- static void agilent_82357a_serial_poll_response (gpib_board_t * board , uint8_t status )
1003
+ static void agilent_82357a_serial_poll_response (struct gpib_board * board , uint8_t status )
997
1004
{
998
1005
//board can only be system controller
999
1006
return ;// 0;
1000
1007
}
1001
1008
1002
- static uint8_t agilent_82357a_serial_poll_status (gpib_board_t * board )
1009
+ static uint8_t agilent_82357a_serial_poll_status (struct gpib_board * board )
1003
1010
{
1004
1011
//board can only be system controller
1005
1012
return 0 ;
1006
1013
}
1007
1014
1008
- static void agilent_82357a_return_to_local (gpib_board_t * board )
1015
+ static void agilent_82357a_return_to_local (struct gpib_board * board )
1009
1016
{
1010
1017
//board can only be system controller
1011
1018
return ;// 0;
1012
1019
}
1013
1020
1014
- static int agilent_82357a_line_status (const gpib_board_t * board )
1021
+ static int agilent_82357a_line_status (const struct gpib_board * board )
1015
1022
{
1016
1023
struct agilent_82357a_priv * a_priv = board -> private_data ;
1017
1024
struct usb_device * usb_dev ;
@@ -1064,7 +1071,7 @@ static unsigned short nanosec_to_fast_talker_bits(unsigned int *nanosec)
1064
1071
return bits ;
1065
1072
}
1066
1073
1067
- static unsigned int agilent_82357a_t1_delay (gpib_board_t * board , unsigned int nanosec )
1074
+ static unsigned int agilent_82357a_t1_delay (struct gpib_board * board , unsigned int nanosec )
1068
1075
{
1069
1076
struct agilent_82357a_priv * a_priv = board -> private_data ;
1070
1077
struct usb_device * usb_dev ;
@@ -1084,7 +1091,7 @@ static unsigned int agilent_82357a_t1_delay(gpib_board_t *board, unsigned int na
1084
1091
1085
1092
static void agilent_82357a_interrupt_complete (struct urb * urb )
1086
1093
{
1087
- gpib_board_t * board = urb -> context ;
1094
+ struct gpib_board * board = urb -> context ;
1088
1095
struct agilent_82357a_priv * a_priv = board -> private_data ;
1089
1096
struct usb_device * usb_dev = interface_to_usbdev (a_priv -> bus_interface );
1090
1097
int retval ;
@@ -1122,7 +1129,7 @@ static void agilent_82357a_interrupt_complete(struct urb *urb)
1122
1129
dev_err (& usb_dev -> dev , "failed to resubmit interrupt urb\n" );
1123
1130
}
1124
1131
1125
- static int agilent_82357a_setup_urbs (gpib_board_t * board )
1132
+ static int agilent_82357a_setup_urbs (struct gpib_board * board )
1126
1133
{
1127
1134
struct agilent_82357a_priv * a_priv = board -> private_data ;
1128
1135
struct usb_device * usb_dev ;
@@ -1186,7 +1193,7 @@ static void agilent_82357a_release_urbs(struct agilent_82357a_priv *a_priv)
1186
1193
}
1187
1194
}
1188
1195
1189
- static int agilent_82357a_allocate_private (gpib_board_t * board )
1196
+ static int agilent_82357a_allocate_private (struct gpib_board * board )
1190
1197
{
1191
1198
struct agilent_82357a_priv * a_priv ;
1192
1199
@@ -1201,14 +1208,14 @@ static int agilent_82357a_allocate_private(gpib_board_t *board)
1201
1208
return 0 ;
1202
1209
}
1203
1210
1204
- static void agilent_82357a_free_private (gpib_board_t * board )
1211
+ static void agilent_82357a_free_private (struct gpib_board * board )
1205
1212
{
1206
1213
kfree (board -> private_data );
1207
1214
board -> private_data = NULL ;
1208
1215
}
1209
1216
1210
1217
#define INIT_NUM_REG_WRITES 18
1211
- static int agilent_82357a_init (gpib_board_t * board )
1218
+ static int agilent_82357a_init (struct gpib_board * board )
1212
1219
{
1213
1220
struct agilent_82357a_priv * a_priv = board -> private_data ;
1214
1221
struct usb_device * usb_dev = interface_to_usbdev (a_priv -> bus_interface );
@@ -1298,7 +1305,7 @@ static inline int agilent_82357a_device_match(struct usb_interface *interface,
1298
1305
return 1 ;
1299
1306
}
1300
1307
1301
- static int agilent_82357a_attach (gpib_board_t * board , const gpib_board_config_t * config )
1308
+ static int agilent_82357a_attach (struct gpib_board * board , const gpib_board_config_t * config )
1302
1309
{
1303
1310
int retval ;
1304
1311
int i ;
@@ -1374,7 +1381,7 @@ static int agilent_82357a_attach(gpib_board_t *board, const gpib_board_config_t
1374
1381
return retval ;
1375
1382
}
1376
1383
1377
- static int agilent_82357a_go_idle (gpib_board_t * board )
1384
+ static int agilent_82357a_go_idle (struct gpib_board * board )
1378
1385
{
1379
1386
struct agilent_82357a_priv * a_priv = board -> private_data ;
1380
1387
struct usb_device * usb_dev = interface_to_usbdev (a_priv -> bus_interface );
@@ -1403,7 +1410,7 @@ static int agilent_82357a_go_idle(gpib_board_t *board)
1403
1410
return 0 ;
1404
1411
}
1405
1412
1406
- static void agilent_82357a_detach (gpib_board_t * board )
1413
+ static void agilent_82357a_detach (struct gpib_board * board )
1407
1414
{
1408
1415
struct agilent_82357a_priv * a_priv ;
1409
1416
@@ -1511,7 +1518,7 @@ static void agilent_82357a_driver_disconnect(struct usb_interface *interface)
1511
1518
1512
1519
for (i = 0 ; i < MAX_NUM_82357A_INTERFACES ; ++ i ) {
1513
1520
if (agilent_82357a_driver_interfaces [i ] == interface ) {
1514
- gpib_board_t * board = usb_get_intfdata (interface );
1521
+ struct gpib_board * board = usb_get_intfdata (interface );
1515
1522
1516
1523
if (board ) {
1517
1524
struct agilent_82357a_priv * a_priv = board -> private_data ;
@@ -1547,7 +1554,7 @@ static int agilent_82357a_driver_suspend(struct usb_interface *interface, pm_mes
1547
1554
1548
1555
for (i = 0 ; i < MAX_NUM_82357A_INTERFACES ; ++ i ) {
1549
1556
if (agilent_82357a_driver_interfaces [i ] == interface ) {
1550
- gpib_board_t * board = usb_get_intfdata (interface );
1557
+ struct gpib_board * board = usb_get_intfdata (interface );
1551
1558
1552
1559
if (board ) {
1553
1560
struct agilent_82357a_priv * a_priv = board -> private_data ;
@@ -1583,7 +1590,7 @@ static int agilent_82357a_driver_suspend(struct usb_interface *interface, pm_mes
1583
1590
static int agilent_82357a_driver_resume (struct usb_interface * interface )
1584
1591
{
1585
1592
struct usb_device * usb_dev = interface_to_usbdev (interface );
1586
- gpib_board_t * board ;
1593
+ struct gpib_board * board ;
1587
1594
int i , retval ;
1588
1595
1589
1596
mutex_lock (& agilent_82357a_hotplug_lock );
0 commit comments