1 /* SPDX-License-Identifier: GPL-2.0 */
2 
3 /***************************************************************************
4  *    copyright            : (C) 2002 by Frank Mori Hess
5  ***************************************************************************/
6 
7 #include "nec7210.h"
8 #include "gpibP.h"
9 #include "plx9050.h"
10 
11 struct cec_priv  {
12 	struct nec7210_priv nec7210_priv;
13 	struct pci_dev *pci_device;
14 	// base address for plx9052 pci chip
15 	unsigned long plx_iobase;
16 	unsigned int irq;
17 };
18 
19 // interface functions
20 int cec_read(gpib_board_t *board, uint8_t *buffer, size_t length, int *end, size_t *bytes_read);
21 int cec_write(gpib_board_t *board, uint8_t *buffer, size_t length, int send_eoi,
22 	      size_t *bytes_written);
23 int cec_command(gpib_board_t *board, uint8_t *buffer, size_t length, size_t *bytes_written);
24 int cec_take_control(gpib_board_t *board, int synchronous);
25 int cec_go_to_standby(gpib_board_t *board);
26 void cec_request_system_control(gpib_board_t *board, int request_control);
27 void cec_interface_clear(gpib_board_t *board, int assert);
28 void cec_remote_enable(gpib_board_t *board, int enable);
29 int cec_enable_eos(gpib_board_t *board, uint8_t eos_byte, int compare_8_bits);
30 void cec_disable_eos(gpib_board_t *board);
31 unsigned int cec_update_status(gpib_board_t *board, unsigned int clear_mask);
32 int cec_primary_address(gpib_board_t *board, unsigned int address);
33 int cec_secondary_address(gpib_board_t *board, unsigned int address, int enable);
34 int cec_parallel_poll(gpib_board_t *board, uint8_t *result);
35 void cec_parallel_poll_configure(gpib_board_t *board, uint8_t configuration);
36 void cec_parallel_poll_response(gpib_board_t *board, int ist);
37 void cec_serial_poll_response(gpib_board_t *board, uint8_t status);
38 void cec_return_to_local(gpib_board_t *board);
39 
40 // interrupt service routines
41 irqreturn_t cec_interrupt(int irq, void *arg);
42 
43 // utility functions
44 void cec_free_private(gpib_board_t *board);
45 int cec_generic_attach(gpib_board_t *board);
46 void cec_init(struct cec_priv *priv, const gpib_board_t *board);
47 
48 // offset between consecutive nec7210 registers
49 static const int cec_reg_offset = 1;
50