24
24
MODULE_LICENSE ("GPL" );
25
25
MODULE_DESCRIPTION ("GPIB Driver for Fluke cda devices" );
26
26
27
- static int fluke_attach_holdoff_all (gpib_board_t * board , const gpib_board_config_t * config );
28
- static int fluke_attach_holdoff_end (gpib_board_t * board , const gpib_board_config_t * config );
29
- static void fluke_detach (gpib_board_t * board );
30
- static int fluke_config_dma (gpib_board_t * board , int output );
31
- static irqreturn_t fluke_gpib_internal_interrupt (gpib_board_t * board );
27
+ static int fluke_attach_holdoff_all (struct gpib_board * board , const gpib_board_config_t * config );
28
+ static int fluke_attach_holdoff_end (struct gpib_board * board , const gpib_board_config_t * config );
29
+ static void fluke_detach (struct gpib_board * board );
30
+ static int fluke_config_dma (struct gpib_board * board , int output );
31
+ static irqreturn_t fluke_gpib_internal_interrupt (struct gpib_board * board );
32
32
33
33
static struct platform_device * fluke_gpib_pdev ;
34
34
@@ -54,136 +54,137 @@ static void fluke_locking_write_byte(struct nec7210_priv *nec_priv, uint8_t byte
54
54
}
55
55
56
56
// wrappers for interface functions
57
- static int fluke_read (gpib_board_t * board , uint8_t * buffer , size_t length , int * end ,
57
+ static int fluke_read (struct gpib_board * board , uint8_t * buffer , size_t length , int * end ,
58
58
size_t * bytes_read )
59
59
{
60
60
struct fluke_priv * priv = board -> private_data ;
61
61
62
62
return nec7210_read (board , & priv -> nec7210_priv , buffer , length , end , bytes_read );
63
63
}
64
64
65
- static int fluke_write (gpib_board_t * board , uint8_t * buffer , size_t length ,
65
+ static int fluke_write (struct gpib_board * board , uint8_t * buffer , size_t length ,
66
66
int send_eoi , size_t * bytes_written )
67
67
{
68
68
struct fluke_priv * priv = board -> private_data ;
69
69
70
70
return nec7210_write (board , & priv -> nec7210_priv , buffer , length , send_eoi , bytes_written );
71
71
}
72
72
73
- static int fluke_command (gpib_board_t * board , uint8_t * buffer , size_t length , size_t * bytes_written )
73
+ static int fluke_command (struct gpib_board * board , uint8_t * buffer ,
74
+ size_t length , size_t * bytes_written )
74
75
{
75
76
struct fluke_priv * priv = board -> private_data ;
76
77
77
78
return nec7210_command (board , & priv -> nec7210_priv , buffer , length , bytes_written );
78
79
}
79
80
80
- static int fluke_take_control (gpib_board_t * board , int synchronous )
81
+ static int fluke_take_control (struct gpib_board * board , int synchronous )
81
82
{
82
83
struct fluke_priv * priv = board -> private_data ;
83
84
84
85
return nec7210_take_control (board , & priv -> nec7210_priv , synchronous );
85
86
}
86
87
87
- static int fluke_go_to_standby (gpib_board_t * board )
88
+ static int fluke_go_to_standby (struct gpib_board * board )
88
89
{
89
90
struct fluke_priv * priv = board -> private_data ;
90
91
91
92
return nec7210_go_to_standby (board , & priv -> nec7210_priv );
92
93
}
93
94
94
- static void fluke_request_system_control (gpib_board_t * board , int request_control )
95
+ static void fluke_request_system_control (struct gpib_board * board , int request_control )
95
96
{
96
97
struct fluke_priv * priv = board -> private_data ;
97
98
struct nec7210_priv * nec_priv = & priv -> nec7210_priv ;
98
99
99
100
nec7210_request_system_control (board , nec_priv , request_control );
100
101
}
101
102
102
- static void fluke_interface_clear (gpib_board_t * board , int assert )
103
+ static void fluke_interface_clear (struct gpib_board * board , int assert )
103
104
{
104
105
struct fluke_priv * priv = board -> private_data ;
105
106
106
107
nec7210_interface_clear (board , & priv -> nec7210_priv , assert );
107
108
}
108
109
109
- static void fluke_remote_enable (gpib_board_t * board , int enable )
110
+ static void fluke_remote_enable (struct gpib_board * board , int enable )
110
111
{
111
112
struct fluke_priv * priv = board -> private_data ;
112
113
113
114
nec7210_remote_enable (board , & priv -> nec7210_priv , enable );
114
115
}
115
116
116
- static int fluke_enable_eos (gpib_board_t * board , uint8_t eos_byte , int compare_8_bits )
117
+ static int fluke_enable_eos (struct gpib_board * board , uint8_t eos_byte , int compare_8_bits )
117
118
{
118
119
struct fluke_priv * priv = board -> private_data ;
119
120
120
121
return nec7210_enable_eos (board , & priv -> nec7210_priv , eos_byte , compare_8_bits );
121
122
}
122
123
123
- static void fluke_disable_eos (gpib_board_t * board )
124
+ static void fluke_disable_eos (struct gpib_board * board )
124
125
{
125
126
struct fluke_priv * priv = board -> private_data ;
126
127
127
128
nec7210_disable_eos (board , & priv -> nec7210_priv );
128
129
}
129
130
130
- static unsigned int fluke_update_status (gpib_board_t * board , unsigned int clear_mask )
131
+ static unsigned int fluke_update_status (struct gpib_board * board , unsigned int clear_mask )
131
132
{
132
133
struct fluke_priv * priv = board -> private_data ;
133
134
134
135
return nec7210_update_status (board , & priv -> nec7210_priv , clear_mask );
135
136
}
136
137
137
- static int fluke_primary_address (gpib_board_t * board , unsigned int address )
138
+ static int fluke_primary_address (struct gpib_board * board , unsigned int address )
138
139
{
139
140
struct fluke_priv * priv = board -> private_data ;
140
141
141
142
return nec7210_primary_address (board , & priv -> nec7210_priv , address );
142
143
}
143
144
144
- static int fluke_secondary_address (gpib_board_t * board , unsigned int address , int enable )
145
+ static int fluke_secondary_address (struct gpib_board * board , unsigned int address , int enable )
145
146
{
146
147
struct fluke_priv * priv = board -> private_data ;
147
148
148
149
return nec7210_secondary_address (board , & priv -> nec7210_priv , address , enable );
149
150
}
150
151
151
- static int fluke_parallel_poll (gpib_board_t * board , uint8_t * result )
152
+ static int fluke_parallel_poll (struct gpib_board * board , uint8_t * result )
152
153
{
153
154
struct fluke_priv * priv = board -> private_data ;
154
155
155
156
return nec7210_parallel_poll (board , & priv -> nec7210_priv , result );
156
157
}
157
158
158
- static void fluke_parallel_poll_configure (gpib_board_t * board , uint8_t configuration )
159
+ static void fluke_parallel_poll_configure (struct gpib_board * board , uint8_t configuration )
159
160
{
160
161
struct fluke_priv * priv = board -> private_data ;
161
162
162
163
nec7210_parallel_poll_configure (board , & priv -> nec7210_priv , configuration );
163
164
}
164
165
165
- static void fluke_parallel_poll_response (gpib_board_t * board , int ist )
166
+ static void fluke_parallel_poll_response (struct gpib_board * board , int ist )
166
167
{
167
168
struct fluke_priv * priv = board -> private_data ;
168
169
169
170
nec7210_parallel_poll_response (board , & priv -> nec7210_priv , ist );
170
171
}
171
172
172
- static void fluke_serial_poll_response (gpib_board_t * board , uint8_t status )
173
+ static void fluke_serial_poll_response (struct gpib_board * board , uint8_t status )
173
174
{
174
175
struct fluke_priv * priv = board -> private_data ;
175
176
176
177
nec7210_serial_poll_response (board , & priv -> nec7210_priv , status );
177
178
}
178
179
179
- static uint8_t fluke_serial_poll_status (gpib_board_t * board )
180
+ static uint8_t fluke_serial_poll_status (struct gpib_board * board )
180
181
{
181
182
struct fluke_priv * priv = board -> private_data ;
182
183
183
184
return nec7210_serial_poll_status (board , & priv -> nec7210_priv );
184
185
}
185
186
186
- static void fluke_return_to_local (gpib_board_t * board )
187
+ static void fluke_return_to_local (struct gpib_board * board )
187
188
{
188
189
struct fluke_priv * priv = board -> private_data ;
189
190
struct nec7210_priv * nec_priv = & priv -> nec7210_priv ;
@@ -193,7 +194,7 @@ static void fluke_return_to_local(gpib_board_t *board)
193
194
write_byte (nec_priv , AUX_RTL , AUXMR );
194
195
}
195
196
196
- static int fluke_line_status (const gpib_board_t * board )
197
+ static int fluke_line_status (const struct gpib_board * board )
197
198
{
198
199
int status = VALID_ALL ;
199
200
int bsr_bits ;
@@ -223,7 +224,7 @@ static int fluke_line_status(const gpib_board_t *board)
223
224
return status ;
224
225
}
225
226
226
- static unsigned int fluke_t1_delay (gpib_board_t * board , unsigned int nano_sec )
227
+ static unsigned int fluke_t1_delay (struct gpib_board * board , unsigned int nano_sec )
227
228
{
228
229
struct fluke_priv * e_priv = board -> private_data ;
229
230
struct nec7210_priv * nec_priv = & e_priv -> nec7210_priv ;
@@ -240,7 +241,7 @@ static unsigned int fluke_t1_delay(gpib_board_t *board, unsigned int nano_sec)
240
241
return retval ;
241
242
}
242
243
243
- static int lacs_or_read_ready (gpib_board_t * board )
244
+ static int lacs_or_read_ready (struct gpib_board * board )
244
245
{
245
246
const struct fluke_priv * e_priv = board -> private_data ;
246
247
const struct nec7210_priv * nec_priv = & e_priv -> nec7210_priv ;
@@ -256,7 +257,7 @@ static int lacs_or_read_ready(gpib_board_t *board)
256
257
/* Wait until it is possible for a read to do something useful. This
257
258
* is not essential, it only exists to prevent RFD holdoff from being released pointlessly.
258
259
*/
259
- static int wait_for_read (gpib_board_t * board )
260
+ static int wait_for_read (struct gpib_board * board )
260
261
{
261
262
struct fluke_priv * e_priv = board -> private_data ;
262
263
struct nec7210_priv * nec_priv = & e_priv -> nec7210_priv ;
@@ -313,7 +314,7 @@ static int source_handshake_is_sids_or_sgns(struct fluke_priv *e_priv)
313
314
* If the chip is SGNS it is probably waiting for a a byte to
314
315
* be written to it.
315
316
*/
316
- static int wait_for_data_out_ready (gpib_board_t * board )
317
+ static int wait_for_data_out_ready (struct gpib_board * board )
317
318
{
318
319
struct fluke_priv * e_priv = board -> private_data ;
319
320
struct nec7210_priv * nec_priv = & e_priv -> nec7210_priv ;
@@ -332,7 +333,7 @@ static int wait_for_data_out_ready(gpib_board_t *board)
332
333
return retval ;
333
334
}
334
335
335
- static int wait_for_sids_or_sgns (gpib_board_t * board )
336
+ static int wait_for_sids_or_sgns (struct gpib_board * board )
336
337
{
337
338
struct fluke_priv * e_priv = board -> private_data ;
338
339
struct nec7210_priv * nec_priv = & e_priv -> nec7210_priv ;
@@ -353,7 +354,7 @@ static int wait_for_sids_or_sgns(gpib_board_t *board)
353
354
354
355
static void fluke_dma_callback (void * arg )
355
356
{
356
- gpib_board_t * board = arg ;
357
+ struct gpib_board * board = arg ;
357
358
struct fluke_priv * e_priv = board -> private_data ;
358
359
struct nec7210_priv * nec_priv = & e_priv -> nec7210_priv ;
359
360
unsigned long flags ;
@@ -370,7 +371,7 @@ static void fluke_dma_callback(void *arg)
370
371
spin_unlock_irqrestore (& board -> spinlock , flags );
371
372
}
372
373
373
- static int fluke_dma_write (gpib_board_t * board , uint8_t * buffer , size_t length ,
374
+ static int fluke_dma_write (struct gpib_board * board , uint8_t * buffer , size_t length ,
374
375
size_t * bytes_written )
375
376
{
376
377
struct fluke_priv * e_priv = board -> private_data ;
@@ -455,7 +456,7 @@ static int fluke_dma_write(gpib_board_t *board, uint8_t *buffer, size_t length,
455
456
return retval ;
456
457
}
457
458
458
- static int fluke_accel_write (gpib_board_t * board , uint8_t * buffer , size_t length ,
459
+ static int fluke_accel_write (struct gpib_board * board , uint8_t * buffer , size_t length ,
459
460
int send_eoi , size_t * bytes_written )
460
461
{
461
462
struct fluke_priv * e_priv = board -> private_data ;
@@ -543,7 +544,7 @@ static int fluke_get_dma_residue(struct dma_chan *chan, dma_cookie_t cookie)
543
544
return state .residue ;
544
545
}
545
546
546
- static int fluke_dma_read (gpib_board_t * board , uint8_t * buffer ,
547
+ static int fluke_dma_read (struct gpib_board * board , uint8_t * buffer ,
547
548
size_t length , int * end , size_t * bytes_read )
548
549
{
549
550
struct fluke_priv * e_priv = board -> private_data ;
@@ -656,7 +657,7 @@ static int fluke_dma_read(gpib_board_t *board, uint8_t *buffer,
656
657
return retval ;
657
658
}
658
659
659
- static int fluke_accel_read (gpib_board_t * board , uint8_t * buffer , size_t length ,
660
+ static int fluke_accel_read (struct gpib_board * board , uint8_t * buffer , size_t length ,
660
661
int * end , size_t * bytes_read )
661
662
{
662
663
struct fluke_priv * e_priv = board -> private_data ;
@@ -786,7 +787,7 @@ static gpib_interface_t fluke_interface = {
786
787
.return_to_local = fluke_return_to_local ,
787
788
};
788
789
789
- irqreturn_t fluke_gpib_internal_interrupt (gpib_board_t * board )
790
+ irqreturn_t fluke_gpib_internal_interrupt (struct gpib_board * board )
790
791
{
791
792
int status0 , status1 , status2 ;
792
793
struct fluke_priv * priv = board -> private_data ;
@@ -823,7 +824,7 @@ irqreturn_t fluke_gpib_internal_interrupt(gpib_board_t *board)
823
824
824
825
static irqreturn_t fluke_gpib_interrupt (int irq , void * arg )
825
826
{
826
- gpib_board_t * board = arg ;
827
+ struct gpib_board * board = arg ;
827
828
unsigned long flags ;
828
829
irqreturn_t retval ;
829
830
@@ -833,7 +834,7 @@ static irqreturn_t fluke_gpib_interrupt(int irq, void *arg)
833
834
return retval ;
834
835
}
835
836
836
- static int fluke_allocate_private (gpib_board_t * board )
837
+ static int fluke_allocate_private (struct gpib_board * board )
837
838
{
838
839
struct fluke_priv * priv ;
839
840
@@ -850,7 +851,7 @@ static int fluke_allocate_private(gpib_board_t *board)
850
851
return 0 ;
851
852
}
852
853
853
- static void fluke_generic_detach (gpib_board_t * board )
854
+ static void fluke_generic_detach (struct gpib_board * board )
854
855
{
855
856
if (board -> private_data ) {
856
857
struct fluke_priv * e_priv = board -> private_data ;
@@ -862,7 +863,7 @@ static void fluke_generic_detach(gpib_board_t *board)
862
863
}
863
864
864
865
// generic part of attach functions shared by all cb7210 boards
865
- static int fluke_generic_attach (gpib_board_t * board )
866
+ static int fluke_generic_attach (struct gpib_board * board )
866
867
{
867
868
struct fluke_priv * e_priv ;
868
869
struct nec7210_priv * nec_priv ;
@@ -882,7 +883,7 @@ static int fluke_generic_attach(gpib_board_t *board)
882
883
return 0 ;
883
884
}
884
885
885
- static int fluke_config_dma (gpib_board_t * board , int output )
886
+ static int fluke_config_dma (struct gpib_board * board , int output )
886
887
{
887
888
struct fluke_priv * e_priv = board -> private_data ;
888
889
struct dma_slave_config config ;
@@ -907,7 +908,7 @@ static int fluke_config_dma(gpib_board_t *board, int output)
907
908
return dmaengine_slave_config (e_priv -> dma_channel , & config );
908
909
}
909
910
910
- static int fluke_init (struct fluke_priv * e_priv , gpib_board_t * board , int handshake_mode )
911
+ static int fluke_init (struct fluke_priv * e_priv , struct gpib_board * board , int handshake_mode )
911
912
{
912
913
struct nec7210_priv * nec_priv = & e_priv -> nec7210_priv ;
913
914
@@ -942,7 +943,7 @@ static bool gpib_dma_channel_filter(struct dma_chan *chan, void *filter_param)
942
943
return chan -> chan_id == 0 ;
943
944
}
944
945
945
- static int fluke_attach_impl (gpib_board_t * board , const gpib_board_config_t * config ,
946
+ static int fluke_attach_impl (struct gpib_board * board , const gpib_board_config_t * config ,
946
947
unsigned int handshake_mode )
947
948
{
948
949
struct fluke_priv * e_priv ;
@@ -1048,17 +1049,17 @@ static int fluke_attach_impl(gpib_board_t *board, const gpib_board_config_t *con
1048
1049
return fluke_init (e_priv , board , handshake_mode );
1049
1050
}
1050
1051
1051
- int fluke_attach_holdoff_all (gpib_board_t * board , const gpib_board_config_t * config )
1052
+ int fluke_attach_holdoff_all (struct gpib_board * board , const gpib_board_config_t * config )
1052
1053
{
1053
1054
return fluke_attach_impl (board , config , HR_HLDA );
1054
1055
}
1055
1056
1056
- int fluke_attach_holdoff_end (gpib_board_t * board , const gpib_board_config_t * config )
1057
+ int fluke_attach_holdoff_end (struct gpib_board * board , const gpib_board_config_t * config )
1057
1058
{
1058
1059
return fluke_attach_impl (board , config , HR_HLDE );
1059
1060
}
1060
1061
1061
- void fluke_detach (gpib_board_t * board )
1062
+ void fluke_detach (struct gpib_board * board )
1062
1063
{
1063
1064
struct fluke_priv * e_priv = board -> private_data ;
1064
1065
struct nec7210_priv * nec_priv ;
0 commit comments