Staging driver updates for 6.14-rc1

Here's the pretty small staging driver tree update for 6.14-rc1.  Not
 much happened this development cycle:
   - deleted some unused ioctl code from the rtl8723bs driver
   - gpib driver cleanups and fixes
   - other tiny minor coding style fixes.
 
 All of these have been in linux-next for a while with no reported
 issues.
 
 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
 -----BEGIN PGP SIGNATURE-----
 
 iG0EABECAC0WIQT0tgzFv3jCIUoxPcsxR9QN2y37KQUCZ5fHXw8cZ3JlZ0Brcm9h
 aC5jb20ACgkQMUfUDdst+ylD8ACfdoCGlfuBqxC+aVli7OBNAvyM85MAnjrY9MKP
 kU82tZAVrVFOls72NQb9
 =MU0Q
 -----END PGP SIGNATURE-----

Merge tag 'staging-6.14-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging

Pull staging driver updates from Greg KH:
 "Here's the pretty small staging driver tree update for 6.14-rc1. Not
  much happened this development cycle:

   - deleted some unused ioctl code from the rtl8723bs driver

   - gpib driver cleanups and fixes

   - other tiny minor coding style fixes.

  All of these have been in linux-next for a while with no reported
  issues"

* tag 'staging-6.14-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging: (38 commits)
  staging: gpib: Agilent usb code cleanup
  staging: gpib: Fix NULL pointer dereference in detach
  staging: gpib: Fix inadvertent negative shift
  staging: gpib: fix prefixing 0x with decimal output
  staging: gpib: Use C99 syntax and make static
  staging: gpib: Avoid plain integers as NULL pointers
  staging: gpib: Use __user for user space pointers
  staging: gpib: Use __iomem attribute for io addresses
  staging: gpib: Add missing mutex unlock in ni usb driver
  staging: gpib: Add missing mutex unlock in agilent usb driver
  staging: gpib: Modernize gpib_interface_t initialization and make static
  staging: gpib: Remove commented-out debug code
  staging: rtl8723bs: Remove ioctl interface
  staging: gpib: tnt4882: Handle gpib_register_driver() errors
  staging: gpib: pc2: Handle gpib_register_driver() errors
  staging: gpib: ni_usb: Handle gpib_register_driver() errors
  staging: gpib: lpvo_usb: Return error value from gpib_register_driver()
  staging: gpib: ines: Handle gpib_register_driver() errors
  staging: gpib: hp_82341: Handle gpib_register_driver() errors
  staging: gpib: hp_82335: Return error value from gpib_register_driver()
  ...
This commit is contained in:
Linus Torvalds 2025-01-27 16:43:27 -08:00
commit 125ca74546
43 changed files with 1850 additions and 2908 deletions

View File

@ -6,6 +6,7 @@
#include <linux/init.h>
#include <linux/spi/spi.h>
#include <linux/delay.h>
#include <linux/string_choices.h>
#include "fbtft.h"
@ -162,7 +163,7 @@ static int set_gamma(struct fbtft_par *par, u32 *curves)
static int blank(struct fbtft_par *par, bool on)
{
fbtft_par_dbg(DEBUG_BLANK, par, "(%s=%s)\n",
__func__, on ? "true" : "false");
__func__, str_true_false(on));
if (on)
write_reg(par, 0xAE);
else

View File

@ -30,11 +30,8 @@ int agilent_82350b_accel_read(gpib_board_t *board, uint8_t *buffer, size_t lengt
unsigned short event_status;
int i, num_fifo_bytes;
//hardware doesn't support checking for end-of-string character when using fifo
if (tms_priv->eos_flags & REOS) {
//pr_info("ag-rd: using tms9914 read for REOS %x EOS %x\n",tms_priv->eos_flags,
// tms_priv->eos);
if (tms_priv->eos_flags & REOS)
return tms9914_read(board, tms_priv, buffer, length, end, bytes_read);
}
clear_bit(DEV_CLEAR_BN, &tms_priv->state);
@ -811,15 +808,15 @@ void agilent_82350b_detach(gpib_board_t *board)
if (a_priv->gpib_base) {
tms9914_board_reset(tms_priv);
if (a_priv->misc_base)
iounmap((void *)a_priv->misc_base);
iounmap(a_priv->misc_base);
if (a_priv->borg_base)
iounmap((void *)a_priv->borg_base);
iounmap(a_priv->borg_base);
if (a_priv->sram_base)
iounmap((void *)a_priv->sram_base);
iounmap(a_priv->sram_base);
if (a_priv->gpib_base)
iounmap((void *)a_priv->gpib_base);
iounmap(a_priv->gpib_base);
if (a_priv->plx_base)
iounmap((void *)a_priv->plx_base);
iounmap(a_priv->plx_base);
pci_release_regions(a_priv->pci_device);
}
if (a_priv->pci_device)
@ -828,58 +825,58 @@ void agilent_82350b_detach(gpib_board_t *board)
agilent_82350b_free_private(board);
}
gpib_interface_t agilent_82350b_unaccel_interface = {
name: "agilent_82350b_unaccel",
attach : agilent_82350b_unaccel_attach,
detach : agilent_82350b_detach,
read : agilent_82350b_read,
write : agilent_82350b_write,
command : agilent_82350b_command,
request_system_control : agilent_82350b_request_system_control,
take_control : agilent_82350b_take_control,
go_to_standby : agilent_82350b_go_to_standby,
interface_clear : agilent_82350b_interface_clear,
remote_enable : agilent_82350b_remote_enable,
enable_eos : agilent_82350b_enable_eos,
disable_eos : agilent_82350b_disable_eos,
parallel_poll : agilent_82350b_parallel_poll,
parallel_poll_configure : agilent_82350b_parallel_poll_configure,
parallel_poll_response : agilent_82350b_parallel_poll_response,
local_parallel_poll_mode : NULL, // XXX
line_status : agilent_82350b_line_status,
update_status : agilent_82350b_update_status,
primary_address : agilent_82350b_primary_address,
secondary_address : agilent_82350b_secondary_address,
serial_poll_response : agilent_82350b_serial_poll_response,
t1_delay : agilent_82350b_t1_delay,
return_to_local : agilent_82350b_return_to_local,
static gpib_interface_t agilent_82350b_unaccel_interface = {
.name = "agilent_82350b_unaccel",
.attach = agilent_82350b_unaccel_attach,
.detach = agilent_82350b_detach,
.read = agilent_82350b_read,
.write = agilent_82350b_write,
.command = agilent_82350b_command,
.request_system_control = agilent_82350b_request_system_control,
.take_control = agilent_82350b_take_control,
.go_to_standby = agilent_82350b_go_to_standby,
.interface_clear = agilent_82350b_interface_clear,
.remote_enable = agilent_82350b_remote_enable,
.enable_eos = agilent_82350b_enable_eos,
.disable_eos = agilent_82350b_disable_eos,
.parallel_poll = agilent_82350b_parallel_poll,
.parallel_poll_configure = agilent_82350b_parallel_poll_configure,
.parallel_poll_response = agilent_82350b_parallel_poll_response,
.local_parallel_poll_mode = NULL, // XXX
.line_status = agilent_82350b_line_status,
.update_status = agilent_82350b_update_status,
.primary_address = agilent_82350b_primary_address,
.secondary_address = agilent_82350b_secondary_address,
.serial_poll_response = agilent_82350b_serial_poll_response,
.t1_delay = agilent_82350b_t1_delay,
.return_to_local = agilent_82350b_return_to_local,
};
gpib_interface_t agilent_82350b_interface = {
name: "agilent_82350b",
attach : agilent_82350b_accel_attach,
detach : agilent_82350b_detach,
read : agilent_82350b_accel_read,
write : agilent_82350b_accel_write,
command : agilent_82350b_command,
request_system_control : agilent_82350b_request_system_control,
take_control : agilent_82350b_take_control,
go_to_standby : agilent_82350b_go_to_standby,
interface_clear : agilent_82350b_interface_clear,
remote_enable : agilent_82350b_remote_enable,
enable_eos : agilent_82350b_enable_eos,
disable_eos : agilent_82350b_disable_eos,
parallel_poll : agilent_82350b_parallel_poll,
parallel_poll_configure : agilent_82350b_parallel_poll_configure,
parallel_poll_response : agilent_82350b_parallel_poll_response,
local_parallel_poll_mode : NULL, // XXX
line_status : agilent_82350b_line_status,
update_status : agilent_82350b_update_status,
primary_address : agilent_82350b_primary_address,
secondary_address : agilent_82350b_secondary_address,
serial_poll_response : agilent_82350b_serial_poll_response,
t1_delay : agilent_82350b_t1_delay,
return_to_local : agilent_82350b_return_to_local,
static gpib_interface_t agilent_82350b_interface = {
.name = "agilent_82350b",
.attach = agilent_82350b_accel_attach,
.detach = agilent_82350b_detach,
.read = agilent_82350b_accel_read,
.write = agilent_82350b_accel_write,
.command = agilent_82350b_command,
.request_system_control = agilent_82350b_request_system_control,
.take_control = agilent_82350b_take_control,
.go_to_standby = agilent_82350b_go_to_standby,
.interface_clear = agilent_82350b_interface_clear,
.remote_enable = agilent_82350b_remote_enable,
.enable_eos = agilent_82350b_enable_eos,
.disable_eos = agilent_82350b_disable_eos,
.parallel_poll = agilent_82350b_parallel_poll,
.parallel_poll_configure = agilent_82350b_parallel_poll_configure,
.parallel_poll_response = agilent_82350b_parallel_poll_response,
.local_parallel_poll_mode = NULL, // XXX
.line_status = agilent_82350b_line_status,
.update_status = agilent_82350b_update_status,
.primary_address = agilent_82350b_primary_address,
.secondary_address = agilent_82350b_secondary_address,
.serial_poll_response = agilent_82350b_serial_poll_response,
.t1_delay = agilent_82350b_t1_delay,
.return_to_local = agilent_82350b_return_to_local,
};
static int agilent_82350b_pci_probe(struct pci_dev *dev, const struct pci_device_id *id)
@ -910,13 +907,30 @@ static int __init agilent_82350b_init_module(void)
result = pci_register_driver(&agilent_82350b_pci_driver);
if (result) {
pr_err("agilent_82350b: pci_driver_register failed!\n");
pr_err("agilent_82350b: pci_register_driver failed: error = %d\n", result);
return result;
}
gpib_register_driver(&agilent_82350b_unaccel_interface, THIS_MODULE);
gpib_register_driver(&agilent_82350b_interface, THIS_MODULE);
result = gpib_register_driver(&agilent_82350b_unaccel_interface, THIS_MODULE);
if (result) {
pr_err("agilent_82350b: gpib_register_driver failed: error = %d\n", result);
goto err_unaccel;
}
result = gpib_register_driver(&agilent_82350b_interface, THIS_MODULE);
if (result) {
pr_err("agilent_82350b: gpib_register_driver failed: error = %d\n", result);
goto err_interface;
}
return 0;
err_interface:
gpib_unregister_driver(&agilent_82350b_unaccel_interface);
err_unaccel:
pci_unregister_driver(&agilent_82350b_pci_driver);
return result;
}
static void __exit agilent_82350b_exit_module(void)

View File

@ -45,11 +45,11 @@ enum board_model {
struct agilent_82350b_priv {
struct tms9914_priv tms9914_priv;
struct pci_dev *pci_device;
void *plx_base; //82350a only
void *gpib_base;
void *sram_base;
void *misc_base;
void *borg_base;
void __iomem *plx_base; //82350a only
void __iomem *gpib_base;
void __iomem *sram_base;
void __iomem *misc_base;
void __iomem *borg_base;
int irq;
unsigned short card_mode_bits;
unsigned short event_status_bits;
@ -60,8 +60,6 @@ struct agilent_82350b_priv {
// driver name
extern const char *driver_name;
// interfaces
extern gpib_interface_t agilent_82350b_interface;
// init functions
int agilent_82350b_unaccel_attach(gpib_board_t *board, const gpib_board_config_t *config);

View File

@ -19,7 +19,7 @@ MODULE_DESCRIPTION("GPIB driver for Agilent 82357A/B usb adapters");
#define MAX_NUM_82357A_INTERFACES 128
static struct usb_interface *agilent_82357a_driver_interfaces[MAX_NUM_82357A_INTERFACES];
DEFINE_MUTEX(agilent_82357a_hotplug_lock); // protect board insertion and removal
static DEFINE_MUTEX(agilent_82357a_hotplug_lock); // protect board insertion and removal
static unsigned int agilent_82357a_update_status(gpib_board_t *board, unsigned int clear_mask);
@ -1146,25 +1146,6 @@ static int agilent_82357a_setup_urbs(gpib_board_t *board)
return retval;
}
#ifdef RESET_USB_CONFIG
static int agilent_82357a_reset_usb_configuration(gpib_board_t *board)
{
struct agilent_82357a_priv *a_priv = board->private_data;
struct usb_device *usb_dev = interface_to_usbdev(a_priv->bus_interface);
struct usb_device *usb_dev;
int retval;
if (!a_priv->bus_interface)
return -ENODEV;
usb_dev = interface_to_usbdev(a_priv->bus_interface);
retval = usb_reset_configuration(usb_dev);
if (retval)
dev_err(&usb_dev->dev, "%s: usb_reset_configuration() returned %i\n",
__func__, retval);
return retval;
}
#endif
static void agilent_82357a_cleanup_urbs(struct agilent_82357a_priv *a_priv)
{
if (a_priv && a_priv->bus_interface) {
@ -1175,15 +1156,23 @@ static void agilent_82357a_cleanup_urbs(struct agilent_82357a_priv *a_priv)
}
};
static void agilent_82357a_release_urbs(struct agilent_82357a_priv *a_priv)
{
if (a_priv) {
usb_free_urb(a_priv->interrupt_urb);
a_priv->interrupt_urb = NULL;
kfree(a_priv->interrupt_buffer);
}
}
static int agilent_82357a_allocate_private(gpib_board_t *board)
{
struct agilent_82357a_priv *a_priv;
board->private_data = kmalloc(sizeof(struct agilent_82357a_priv), GFP_KERNEL);
board->private_data = kzalloc(sizeof(struct agilent_82357a_priv), GFP_KERNEL);
if (!board->private_data)
return -ENOMEM;
a_priv = board->private_data;
memset(a_priv, 0, sizeof(struct agilent_82357a_priv));
mutex_init(&a_priv->bulk_transfer_lock);
mutex_init(&a_priv->bulk_alloc_lock);
mutex_init(&a_priv->control_alloc_lock);
@ -1191,11 +1180,11 @@ static int agilent_82357a_allocate_private(gpib_board_t *board)
return 0;
}
static void agilent_82357a_free_private(struct agilent_82357a_priv *a_priv)
static void agilent_82357a_free_private(gpib_board_t *board)
{
usb_free_urb(a_priv->interrupt_urb);
kfree(a_priv->interrupt_buffer);
kfree(a_priv);
kfree(board->private_data);
board->private_data = NULL;
}
static int agilent_82357a_init(gpib_board_t *board)
@ -1342,16 +1331,14 @@ static int agilent_82357a_attach(gpib_board_t *board, const gpib_board_config_t
a_priv->bus_interface = agilent_82357a_driver_interfaces[i];
usb_set_intfdata(agilent_82357a_driver_interfaces[i], board);
usb_dev = interface_to_usbdev(a_priv->bus_interface);
dev_info(&usb_dev->dev,
"bus %d dev num %d attached to gpib minor %d, agilent usb interface %i\n",
usb_dev->bus->busnum, usb_dev->devnum, board->minor, i);
break;
}
}
if (i == MAX_NUM_82357A_INTERFACES) {
mutex_unlock(&agilent_82357a_hotplug_lock);
pr_err("No Agilent 82357 gpib adapters found, have you loaded its firmware?\n");
return -ENODEV;
dev_err(board->gpib_dev,
"No Agilent 82357 gpib adapters found, have you loaded its firmware?\n");
retval = -ENODEV;
goto attach_fail;
}
product_id = le16_to_cpu(interface_to_usbdev(a_priv->bus_interface)->descriptor.idProduct);
switch (product_id) {
@ -1365,20 +1352,13 @@ static int agilent_82357a_attach(gpib_board_t *board, const gpib_board_config_t
break;
default:
dev_err(&usb_dev->dev, "bug, unhandled product_id in switch?\n");
return -EIO;
retval = -EIO;
goto attach_fail;
}
#ifdef RESET_USB_CONFIG
retval = agilent_82357a_reset_usb_configuration(board);
if (retval < 0) {
mutex_unlock(&agilent_82357a_hotplug_lock);
return retval;
}
#endif
retval = agilent_82357a_setup_urbs(board);
if (retval < 0) {
mutex_unlock(&agilent_82357a_hotplug_lock);
return retval;
}
if (retval < 0)
goto attach_fail;
timer_setup(&a_priv->bulk_timer, agilent_82357a_timeout_handler, 0);
@ -1387,11 +1367,19 @@ static int agilent_82357a_attach(gpib_board_t *board, const gpib_board_config_t
retval = agilent_82357a_init(board);
if (retval < 0) {
mutex_unlock(&agilent_82357a_hotplug_lock);
return retval;
agilent_82357a_cleanup_urbs(a_priv);
agilent_82357a_release_urbs(a_priv);
goto attach_fail;
}
dev_info(&usb_dev->dev, "%s: attached\n", __func__);
dev_info(&usb_dev->dev,
"bus %d dev num %d attached to gpib minor %d, agilent usb interface %i\n",
usb_dev->bus->busnum, usb_dev->devnum, board->minor, i);
mutex_unlock(&agilent_82357a_hotplug_lock);
return retval;
attach_fail:
agilent_82357a_free_private(board);
mutex_unlock(&agilent_82357a_hotplug_lock);
return retval;
}
@ -1441,12 +1429,10 @@ static int agilent_82357a_go_idle(gpib_board_t *board)
static void agilent_82357a_detach(gpib_board_t *board)
{
struct agilent_82357a_priv *a_priv;
struct usb_device *usb_dev;
mutex_lock(&agilent_82357a_hotplug_lock);
a_priv = board->private_data;
usb_dev = interface_to_usbdev(a_priv->bus_interface);
if (a_priv) {
if (a_priv->bus_interface) {
agilent_82357a_go_idle(board);
@ -1456,40 +1442,41 @@ static void agilent_82357a_detach(gpib_board_t *board)
mutex_lock(&a_priv->bulk_alloc_lock);
mutex_lock(&a_priv->interrupt_alloc_lock);
agilent_82357a_cleanup_urbs(a_priv);
agilent_82357a_free_private(a_priv);
agilent_82357a_release_urbs(a_priv);
agilent_82357a_free_private(board);
}
dev_info(&usb_dev->dev, "%s: detached\n", __func__);
dev_info(board->gpib_dev, "%s: detached\n", __func__);
mutex_unlock(&agilent_82357a_hotplug_lock);
}
gpib_interface_t agilent_82357a_gpib_interface = {
name: "agilent_82357a",
attach : agilent_82357a_attach,
detach : agilent_82357a_detach,
read : agilent_82357a_read,
write : agilent_82357a_write,
command : agilent_82357a_command,
take_control : agilent_82357a_take_control,
go_to_standby : agilent_82357a_go_to_standby,
request_system_control : agilent_82357a_request_system_control,
interface_clear : agilent_82357a_interface_clear,
remote_enable : agilent_82357a_remote_enable,
enable_eos : agilent_82357a_enable_eos,
disable_eos : agilent_82357a_disable_eos,
parallel_poll : agilent_82357a_parallel_poll,
parallel_poll_configure : agilent_82357a_parallel_poll_configure,
parallel_poll_response : agilent_82357a_parallel_poll_response,
local_parallel_poll_mode : NULL, // XXX
line_status : agilent_82357a_line_status,
update_status : agilent_82357a_update_status,
primary_address : agilent_82357a_primary_address,
secondary_address : agilent_82357a_secondary_address,
serial_poll_response : agilent_82357a_serial_poll_response,
serial_poll_status : agilent_82357a_serial_poll_status,
t1_delay : agilent_82357a_t1_delay,
return_to_local : agilent_82357a_return_to_local,
no_7_bit_eos : 1,
skip_check_for_command_acceptors : 1
static gpib_interface_t agilent_82357a_gpib_interface = {
.name = "agilent_82357a",
.attach = agilent_82357a_attach,
.detach = agilent_82357a_detach,
.read = agilent_82357a_read,
.write = agilent_82357a_write,
.command = agilent_82357a_command,
.take_control = agilent_82357a_take_control,
.go_to_standby = agilent_82357a_go_to_standby,
.request_system_control = agilent_82357a_request_system_control,
.interface_clear = agilent_82357a_interface_clear,
.remote_enable = agilent_82357a_remote_enable,
.enable_eos = agilent_82357a_enable_eos,
.disable_eos = agilent_82357a_disable_eos,
.parallel_poll = agilent_82357a_parallel_poll,
.parallel_poll_configure = agilent_82357a_parallel_poll_configure,
.parallel_poll_response = agilent_82357a_parallel_poll_response,
.local_parallel_poll_mode = NULL, // XXX
.line_status = agilent_82357a_line_status,
.update_status = agilent_82357a_update_status,
.primary_address = agilent_82357a_primary_address,
.secondary_address = agilent_82357a_secondary_address,
.serial_poll_response = agilent_82357a_serial_poll_response,
.serial_poll_status = agilent_82357a_serial_poll_status,
.t1_delay = agilent_82357a_t1_delay,
.return_to_local = agilent_82357a_return_to_local,
.no_7_bit_eos = 1,
.skip_check_for_command_acceptors = 1
};
// Table with the USB-devices: just now only testing IDs
@ -1691,12 +1678,24 @@ static struct usb_driver agilent_82357a_bus_driver = {
static int __init agilent_82357a_init_module(void)
{
int i;
int ret;
pr_info("agilent_82357a_gpib driver loading");
for (i = 0; i < MAX_NUM_82357A_INTERFACES; ++i)
agilent_82357a_driver_interfaces[i] = NULL;
usb_register(&agilent_82357a_bus_driver);
gpib_register_driver(&agilent_82357a_gpib_interface, THIS_MODULE);
ret = usb_register(&agilent_82357a_bus_driver);
if (ret) {
pr_err("agilent_82357a: usb_register failed: error = %d\n", ret);
return ret;
}
ret = gpib_register_driver(&agilent_82357a_gpib_interface, THIS_MODULE);
if (ret) {
pr_err("agilent_82357a: gpib_register_driver failed: error = %d\n", ret);
usb_deregister(&agilent_82357a_bus_driver);
return ret;
}
return 0;
}

View File

@ -683,170 +683,170 @@ void cb7210_return_to_local(gpib_board_t *board)
write_byte(nec_priv, AUX_RTL, AUXMR);
}
gpib_interface_t cb_pci_unaccel_interface = {
name: "cbi_pci_unaccel",
attach : cb_pci_attach,
detach : cb_pci_detach,
read : cb7210_read,
write : cb7210_write,
command : cb7210_command,
take_control : cb7210_take_control,
go_to_standby : cb7210_go_to_standby,
request_system_control : cb7210_request_system_control,
interface_clear : cb7210_interface_clear,
remote_enable : cb7210_remote_enable,
enable_eos : cb7210_enable_eos,
disable_eos : cb7210_disable_eos,
parallel_poll : cb7210_parallel_poll,
parallel_poll_configure : cb7210_parallel_poll_configure,
parallel_poll_response : cb7210_parallel_poll_response,
local_parallel_poll_mode : NULL, // XXX
line_status : cb7210_line_status,
update_status : cb7210_update_status,
primary_address : cb7210_primary_address,
secondary_address : cb7210_secondary_address,
serial_poll_response : cb7210_serial_poll_response,
serial_poll_status : cb7210_serial_poll_status,
t1_delay : cb7210_t1_delay,
return_to_local : cb7210_return_to_local,
static gpib_interface_t cb_pci_unaccel_interface = {
.name = "cbi_pci_unaccel",
.attach = cb_pci_attach,
.detach = cb_pci_detach,
.read = cb7210_read,
.write = cb7210_write,
.command = cb7210_command,
.take_control = cb7210_take_control,
.go_to_standby = cb7210_go_to_standby,
.request_system_control = cb7210_request_system_control,
.interface_clear = cb7210_interface_clear,
.remote_enable = cb7210_remote_enable,
.enable_eos = cb7210_enable_eos,
.disable_eos = cb7210_disable_eos,
.parallel_poll = cb7210_parallel_poll,
.parallel_poll_configure = cb7210_parallel_poll_configure,
.parallel_poll_response = cb7210_parallel_poll_response,
.local_parallel_poll_mode = NULL, // XXX
.line_status = cb7210_line_status,
.update_status = cb7210_update_status,
.primary_address = cb7210_primary_address,
.secondary_address = cb7210_secondary_address,
.serial_poll_response = cb7210_serial_poll_response,
.serial_poll_status = cb7210_serial_poll_status,
.t1_delay = cb7210_t1_delay,
.return_to_local = cb7210_return_to_local,
};
gpib_interface_t cb_pci_accel_interface = {
name: "cbi_pci_accel",
attach : cb_pci_attach,
detach : cb_pci_detach,
read : cb7210_accel_read,
write : cb7210_accel_write,
command : cb7210_command,
take_control : cb7210_take_control,
go_to_standby : cb7210_go_to_standby,
request_system_control : cb7210_request_system_control,
interface_clear : cb7210_interface_clear,
remote_enable : cb7210_remote_enable,
enable_eos : cb7210_enable_eos,
disable_eos : cb7210_disable_eos,
parallel_poll : cb7210_parallel_poll,
parallel_poll_configure : cb7210_parallel_poll_configure,
parallel_poll_response : cb7210_parallel_poll_response,
local_parallel_poll_mode : NULL, // XXX
line_status : cb7210_line_status,
update_status : cb7210_update_status,
primary_address : cb7210_primary_address,
secondary_address : cb7210_secondary_address,
serial_poll_response : cb7210_serial_poll_response,
serial_poll_status : cb7210_serial_poll_status,
t1_delay : cb7210_t1_delay,
return_to_local : cb7210_return_to_local,
static gpib_interface_t cb_pci_accel_interface = {
.name = "cbi_pci_accel",
.attach = cb_pci_attach,
.detach = cb_pci_detach,
.read = cb7210_accel_read,
.write = cb7210_accel_write,
.command = cb7210_command,
.take_control = cb7210_take_control,
.go_to_standby = cb7210_go_to_standby,
.request_system_control = cb7210_request_system_control,
.interface_clear = cb7210_interface_clear,
.remote_enable = cb7210_remote_enable,
.enable_eos = cb7210_enable_eos,
.disable_eos = cb7210_disable_eos,
.parallel_poll = cb7210_parallel_poll,
.parallel_poll_configure = cb7210_parallel_poll_configure,
.parallel_poll_response = cb7210_parallel_poll_response,
.local_parallel_poll_mode = NULL, // XXX
.line_status = cb7210_line_status,
.update_status = cb7210_update_status,
.primary_address = cb7210_primary_address,
.secondary_address = cb7210_secondary_address,
.serial_poll_response = cb7210_serial_poll_response,
.serial_poll_status = cb7210_serial_poll_status,
.t1_delay = cb7210_t1_delay,
.return_to_local = cb7210_return_to_local,
};
gpib_interface_t cb_pci_interface = {
name: "cbi_pci",
attach : cb_pci_attach,
detach : cb_pci_detach,
read : cb7210_accel_read,
write : cb7210_accel_write,
command : cb7210_command,
take_control : cb7210_take_control,
go_to_standby : cb7210_go_to_standby,
request_system_control : cb7210_request_system_control,
interface_clear : cb7210_interface_clear,
remote_enable : cb7210_remote_enable,
enable_eos : cb7210_enable_eos,
disable_eos : cb7210_disable_eos,
parallel_poll : cb7210_parallel_poll,
parallel_poll_configure : cb7210_parallel_poll_configure,
parallel_poll_response : cb7210_parallel_poll_response,
line_status : cb7210_line_status,
update_status : cb7210_update_status,
primary_address : cb7210_primary_address,
secondary_address : cb7210_secondary_address,
serial_poll_response : cb7210_serial_poll_response,
serial_poll_status : cb7210_serial_poll_status,
t1_delay : cb7210_t1_delay,
return_to_local : cb7210_return_to_local,
static gpib_interface_t cb_pci_interface = {
.name = "cbi_pci",
.attach = cb_pci_attach,
.detach = cb_pci_detach,
.read = cb7210_accel_read,
.write = cb7210_accel_write,
.command = cb7210_command,
.take_control = cb7210_take_control,
.go_to_standby = cb7210_go_to_standby,
.request_system_control = cb7210_request_system_control,
.interface_clear = cb7210_interface_clear,
.remote_enable = cb7210_remote_enable,
.enable_eos = cb7210_enable_eos,
.disable_eos = cb7210_disable_eos,
.parallel_poll = cb7210_parallel_poll,
.parallel_poll_configure = cb7210_parallel_poll_configure,
.parallel_poll_response = cb7210_parallel_poll_response,
.line_status = cb7210_line_status,
.update_status = cb7210_update_status,
.primary_address = cb7210_primary_address,
.secondary_address = cb7210_secondary_address,
.serial_poll_response = cb7210_serial_poll_response,
.serial_poll_status = cb7210_serial_poll_status,
.t1_delay = cb7210_t1_delay,
.return_to_local = cb7210_return_to_local,
};
gpib_interface_t cb_isa_unaccel_interface = {
name: "cbi_isa_unaccel",
attach : cb_isa_attach,
detach : cb_isa_detach,
read : cb7210_read,
write : cb7210_write,
command : cb7210_command,
take_control : cb7210_take_control,
go_to_standby : cb7210_go_to_standby,
request_system_control : cb7210_request_system_control,
interface_clear : cb7210_interface_clear,
remote_enable : cb7210_remote_enable,
enable_eos : cb7210_enable_eos,
disable_eos : cb7210_disable_eos,
parallel_poll : cb7210_parallel_poll,
parallel_poll_configure : cb7210_parallel_poll_configure,
parallel_poll_response : cb7210_parallel_poll_response,
local_parallel_poll_mode : NULL, // XXX
line_status : cb7210_line_status,
update_status : cb7210_update_status,
primary_address : cb7210_primary_address,
secondary_address : cb7210_secondary_address,
serial_poll_response : cb7210_serial_poll_response,
serial_poll_status : cb7210_serial_poll_status,
t1_delay : cb7210_t1_delay,
return_to_local : cb7210_return_to_local,
static gpib_interface_t cb_isa_unaccel_interface = {
.name = "cbi_isa_unaccel",
.attach = cb_isa_attach,
.detach = cb_isa_detach,
.read = cb7210_read,
.write = cb7210_write,
.command = cb7210_command,
.take_control = cb7210_take_control,
.go_to_standby = cb7210_go_to_standby,
.request_system_control = cb7210_request_system_control,
.interface_clear = cb7210_interface_clear,
.remote_enable = cb7210_remote_enable,
.enable_eos = cb7210_enable_eos,
.disable_eos = cb7210_disable_eos,
.parallel_poll = cb7210_parallel_poll,
.parallel_poll_configure = cb7210_parallel_poll_configure,
.parallel_poll_response = cb7210_parallel_poll_response,
.local_parallel_poll_mode = NULL, // XXX
.line_status = cb7210_line_status,
.update_status = cb7210_update_status,
.primary_address = cb7210_primary_address,
.secondary_address = cb7210_secondary_address,
.serial_poll_response = cb7210_serial_poll_response,
.serial_poll_status = cb7210_serial_poll_status,
.t1_delay = cb7210_t1_delay,
.return_to_local = cb7210_return_to_local,
};
gpib_interface_t cb_isa_interface = {
name: "cbi_isa",
attach : cb_isa_attach,
detach : cb_isa_detach,
read : cb7210_accel_read,
write : cb7210_accel_write,
command : cb7210_command,
take_control : cb7210_take_control,
go_to_standby : cb7210_go_to_standby,
request_system_control : cb7210_request_system_control,
interface_clear : cb7210_interface_clear,
remote_enable : cb7210_remote_enable,
enable_eos : cb7210_enable_eos,
disable_eos : cb7210_disable_eos,
parallel_poll : cb7210_parallel_poll,
parallel_poll_configure : cb7210_parallel_poll_configure,
parallel_poll_response : cb7210_parallel_poll_response,
line_status : cb7210_line_status,
update_status : cb7210_update_status,
primary_address : cb7210_primary_address,
secondary_address : cb7210_secondary_address,
serial_poll_response : cb7210_serial_poll_response,
serial_poll_status : cb7210_serial_poll_status,
t1_delay : cb7210_t1_delay,
return_to_local : cb7210_return_to_local,
static gpib_interface_t cb_isa_interface = {
.name = "cbi_isa",
.attach = cb_isa_attach,
.detach = cb_isa_detach,
.read = cb7210_accel_read,
.write = cb7210_accel_write,
.command = cb7210_command,
.take_control = cb7210_take_control,
.go_to_standby = cb7210_go_to_standby,
.request_system_control = cb7210_request_system_control,
.interface_clear = cb7210_interface_clear,
.remote_enable = cb7210_remote_enable,
.enable_eos = cb7210_enable_eos,
.disable_eos = cb7210_disable_eos,
.parallel_poll = cb7210_parallel_poll,
.parallel_poll_configure = cb7210_parallel_poll_configure,
.parallel_poll_response = cb7210_parallel_poll_response,
.line_status = cb7210_line_status,
.update_status = cb7210_update_status,
.primary_address = cb7210_primary_address,
.secondary_address = cb7210_secondary_address,
.serial_poll_response = cb7210_serial_poll_response,
.serial_poll_status = cb7210_serial_poll_status,
.t1_delay = cb7210_t1_delay,
.return_to_local = cb7210_return_to_local,
};
gpib_interface_t cb_isa_accel_interface = {
name: "cbi_isa_accel",
attach : cb_isa_attach,
detach : cb_isa_detach,
read : cb7210_accel_read,
write : cb7210_accel_write,
command : cb7210_command,
take_control : cb7210_take_control,
go_to_standby : cb7210_go_to_standby,
request_system_control : cb7210_request_system_control,
interface_clear : cb7210_interface_clear,
remote_enable : cb7210_remote_enable,
enable_eos : cb7210_enable_eos,
disable_eos : cb7210_disable_eos,
parallel_poll : cb7210_parallel_poll,
parallel_poll_configure : cb7210_parallel_poll_configure,
parallel_poll_response : cb7210_parallel_poll_response,
local_parallel_poll_mode : NULL, // XXX
line_status : cb7210_line_status,
update_status : cb7210_update_status,
primary_address : cb7210_primary_address,
secondary_address : cb7210_secondary_address,
serial_poll_response : cb7210_serial_poll_response,
serial_poll_status : cb7210_serial_poll_status,
t1_delay : cb7210_t1_delay,
return_to_local : cb7210_return_to_local,
static gpib_interface_t cb_isa_accel_interface = {
.name = "cbi_isa_accel",
.attach = cb_isa_attach,
.detach = cb_isa_detach,
.read = cb7210_accel_read,
.write = cb7210_accel_write,
.command = cb7210_command,
.take_control = cb7210_take_control,
.go_to_standby = cb7210_go_to_standby,
.request_system_control = cb7210_request_system_control,
.interface_clear = cb7210_interface_clear,
.remote_enable = cb7210_remote_enable,
.enable_eos = cb7210_enable_eos,
.disable_eos = cb7210_disable_eos,
.parallel_poll = cb7210_parallel_poll,
.parallel_poll_configure = cb7210_parallel_poll_configure,
.parallel_poll_response = cb7210_parallel_poll_response,
.local_parallel_poll_mode = NULL, // XXX
.line_status = cb7210_line_status,
.update_status = cb7210_update_status,
.primary_address = cb7210_primary_address,
.secondary_address = cb7210_secondary_address,
.serial_poll_response = cb7210_serial_poll_response,
.serial_poll_status = cb7210_serial_poll_status,
.t1_delay = cb7210_t1_delay,
.return_to_local = cb7210_return_to_local,
};
static int cb7210_allocate_private(gpib_board_t *board)
@ -1040,8 +1040,8 @@ int cb_isa_attach(gpib_board_t *board, const gpib_board_config_t *config)
return retval;
cb_priv = board->private_data;
nec_priv = &cb_priv->nec7210_priv;
if (request_region(config->ibbase, cb7210_iosize, "cb7210") == 0) {
pr_err("gpib: ioports starting at 0x%u are already in use\n", config->ibbase);
if (!request_region(config->ibbase, cb7210_iosize, "cb7210")) {
pr_err("gpib: ioports starting at 0x%x are already in use\n", config->ibbase);
return -EIO;
}
nec_priv->iobase = config->ibbase;
@ -1351,100 +1351,94 @@ static struct pcmcia_driver cb_gpib_cs_driver = {
.resume = cb_gpib_resume,
};
int cb_pcmcia_init_module(void)
{
pcmcia_register_driver(&cb_gpib_cs_driver);
return 0;
}
void cb_pcmcia_cleanup_module(void)
{
DEBUG(0, "cb_gpib_cs: unloading\n");
pcmcia_unregister_driver(&cb_gpib_cs_driver);
}
gpib_interface_t cb_pcmcia_unaccel_interface = {
name: "cbi_pcmcia_unaccel",
attach : cb_pcmcia_attach,
detach : cb_pcmcia_detach,
read : cb7210_read,
write : cb7210_write,
command : cb7210_command,
take_control : cb7210_take_control,
go_to_standby : cb7210_go_to_standby,
request_system_control : cb7210_request_system_control,
interface_clear : cb7210_interface_clear,
remote_enable : cb7210_remote_enable,
enable_eos : cb7210_enable_eos,
disable_eos : cb7210_disable_eos,
parallel_poll : cb7210_parallel_poll,
parallel_poll_configure : cb7210_parallel_poll_configure,
parallel_poll_response : cb7210_parallel_poll_response,
local_parallel_poll_mode : NULL, // XXX
line_status : cb7210_line_status,
update_status : cb7210_update_status,
primary_address : cb7210_primary_address,
secondary_address : cb7210_secondary_address,
serial_poll_response : cb7210_serial_poll_response,
serial_poll_status : cb7210_serial_poll_status,
t1_delay : cb7210_t1_delay,
return_to_local : cb7210_return_to_local,
static gpib_interface_t cb_pcmcia_unaccel_interface = {
.name = "cbi_pcmcia_unaccel",
.attach = cb_pcmcia_attach,
.detach = cb_pcmcia_detach,
.read = cb7210_read,
.write = cb7210_write,
.command = cb7210_command,
.take_control = cb7210_take_control,
.go_to_standby = cb7210_go_to_standby,
.request_system_control = cb7210_request_system_control,
.interface_clear = cb7210_interface_clear,
.remote_enable = cb7210_remote_enable,
.enable_eos = cb7210_enable_eos,
.disable_eos = cb7210_disable_eos,
.parallel_poll = cb7210_parallel_poll,
.parallel_poll_configure = cb7210_parallel_poll_configure,
.parallel_poll_response = cb7210_parallel_poll_response,
.local_parallel_poll_mode = NULL, // XXX
.line_status = cb7210_line_status,
.update_status = cb7210_update_status,
.primary_address = cb7210_primary_address,
.secondary_address = cb7210_secondary_address,
.serial_poll_response = cb7210_serial_poll_response,
.serial_poll_status = cb7210_serial_poll_status,
.t1_delay = cb7210_t1_delay,
.return_to_local = cb7210_return_to_local,
};
gpib_interface_t cb_pcmcia_interface = {
name: "cbi_pcmcia",
attach : cb_pcmcia_attach,
detach : cb_pcmcia_detach,
read : cb7210_accel_read,
write : cb7210_accel_write,
command : cb7210_command,
take_control : cb7210_take_control,
go_to_standby : cb7210_go_to_standby,
request_system_control : cb7210_request_system_control,
interface_clear : cb7210_interface_clear,
remote_enable : cb7210_remote_enable,
enable_eos : cb7210_enable_eos,
disable_eos : cb7210_disable_eos,
parallel_poll : cb7210_parallel_poll,
parallel_poll_configure : cb7210_parallel_poll_configure,
parallel_poll_response : cb7210_parallel_poll_response,
local_parallel_poll_mode : NULL, // XXX
line_status : cb7210_line_status,
update_status : cb7210_update_status,
primary_address : cb7210_primary_address,
secondary_address : cb7210_secondary_address,
serial_poll_response : cb7210_serial_poll_response,
serial_poll_status : cb7210_serial_poll_status,
t1_delay : cb7210_t1_delay,
return_to_local : cb7210_return_to_local,
static gpib_interface_t cb_pcmcia_interface = {
.name = "cbi_pcmcia",
.attach = cb_pcmcia_attach,
.detach = cb_pcmcia_detach,
.read = cb7210_accel_read,
.write = cb7210_accel_write,
.command = cb7210_command,
.take_control = cb7210_take_control,
.go_to_standby = cb7210_go_to_standby,
.request_system_control = cb7210_request_system_control,
.interface_clear = cb7210_interface_clear,
.remote_enable = cb7210_remote_enable,
.enable_eos = cb7210_enable_eos,
.disable_eos = cb7210_disable_eos,
.parallel_poll = cb7210_parallel_poll,
.parallel_poll_configure = cb7210_parallel_poll_configure,
.parallel_poll_response = cb7210_parallel_poll_response,
.local_parallel_poll_mode = NULL, // XXX
.line_status = cb7210_line_status,
.update_status = cb7210_update_status,
.primary_address = cb7210_primary_address,
.secondary_address = cb7210_secondary_address,
.serial_poll_response = cb7210_serial_poll_response,
.serial_poll_status = cb7210_serial_poll_status,
.t1_delay = cb7210_t1_delay,
.return_to_local = cb7210_return_to_local,
};
gpib_interface_t cb_pcmcia_accel_interface = {
name: "cbi_pcmcia_accel",
attach : cb_pcmcia_attach,
detach : cb_pcmcia_detach,
read : cb7210_accel_read,
write : cb7210_accel_write,
command : cb7210_command,
take_control : cb7210_take_control,
go_to_standby : cb7210_go_to_standby,
request_system_control : cb7210_request_system_control,
interface_clear : cb7210_interface_clear,
remote_enable : cb7210_remote_enable,
enable_eos : cb7210_enable_eos,
disable_eos : cb7210_disable_eos,
parallel_poll : cb7210_parallel_poll,
parallel_poll_configure : cb7210_parallel_poll_configure,
parallel_poll_response : cb7210_parallel_poll_response,
local_parallel_poll_mode : NULL, // XXX
line_status : cb7210_line_status,
update_status : cb7210_update_status,
primary_address : cb7210_primary_address,
secondary_address : cb7210_secondary_address,
serial_poll_response : cb7210_serial_poll_response,
serial_poll_status : cb7210_serial_poll_status,
t1_delay : cb7210_t1_delay,
return_to_local : cb7210_return_to_local,
static gpib_interface_t cb_pcmcia_accel_interface = {
.name = "cbi_pcmcia_accel",
.attach = cb_pcmcia_attach,
.detach = cb_pcmcia_detach,
.read = cb7210_accel_read,
.write = cb7210_accel_write,
.command = cb7210_command,
.take_control = cb7210_take_control,
.go_to_standby = cb7210_go_to_standby,
.request_system_control = cb7210_request_system_control,
.interface_clear = cb7210_interface_clear,
.remote_enable = cb7210_remote_enable,
.enable_eos = cb7210_enable_eos,
.disable_eos = cb7210_disable_eos,
.parallel_poll = cb7210_parallel_poll,
.parallel_poll_configure = cb7210_parallel_poll_configure,
.parallel_poll_response = cb7210_parallel_poll_response,
.local_parallel_poll_mode = NULL, // XXX
.line_status = cb7210_line_status,
.update_status = cb7210_update_status,
.primary_address = cb7210_primary_address,
.secondary_address = cb7210_secondary_address,
.serial_poll_response = cb7210_serial_poll_response,
.serial_poll_status = cb7210_serial_poll_status,
.t1_delay = cb7210_t1_delay,
.return_to_local = cb7210_return_to_local,
};
int cb_pcmcia_attach(gpib_board_t *board, const gpib_board_config_t *config)
@ -1465,8 +1459,8 @@ int cb_pcmcia_attach(gpib_board_t *board, const gpib_board_config_t *config)
cb_priv = board->private_data;
nec_priv = &cb_priv->nec7210_priv;
if (request_region(curr_dev->resource[0]->start, resource_size(curr_dev->resource[0]),
"cb7210") == 0) {
if (!request_region(curr_dev->resource[0]->start, resource_size(curr_dev->resource[0]),
"cb7210")) {
pr_err("gpib: ioports starting at 0x%lx are already in use\n",
(unsigned long)curr_dev->resource[0]->start);
return -EIO;
@ -1506,32 +1500,102 @@ void cb_pcmcia_detach(gpib_board_t *board)
static int __init cb7210_init_module(void)
{
int err = 0;
int result;
int ret;
result = pci_register_driver(&cb7210_pci_driver);
if (result) {
pr_err("cb7210: pci_driver_register failed!\n");
return result;
ret = pci_register_driver(&cb7210_pci_driver);
if (ret) {
pr_err("cb7210: pci_register_driver failed: error = %d\n", ret);
return ret;
}
gpib_register_driver(&cb_pci_interface, THIS_MODULE);
gpib_register_driver(&cb_isa_interface, THIS_MODULE);
gpib_register_driver(&cb_pci_accel_interface, THIS_MODULE);
gpib_register_driver(&cb_pci_unaccel_interface, THIS_MODULE);
gpib_register_driver(&cb_isa_accel_interface, THIS_MODULE);
gpib_register_driver(&cb_isa_unaccel_interface, THIS_MODULE);
ret = gpib_register_driver(&cb_pci_interface, THIS_MODULE);
if (ret) {
pr_err("cb7210: gpib_register_driver failed: error = %d\n", ret);
goto err_pci;
}
#ifdef GPIB__PCMCIA
gpib_register_driver(&cb_pcmcia_interface, THIS_MODULE);
gpib_register_driver(&cb_pcmcia_accel_interface, THIS_MODULE);
gpib_register_driver(&cb_pcmcia_unaccel_interface, THIS_MODULE);
err += cb_pcmcia_init_module();
ret = gpib_register_driver(&cb_isa_interface, THIS_MODULE);
if (ret) {
pr_err("cb7210: gpib_register_driver failed: error = %d\n", ret);
goto err_isa;
}
ret = gpib_register_driver(&cb_pci_accel_interface, THIS_MODULE);
if (ret) {
pr_err("cb7210: gpib_register_driver failed: error = %d\n", ret);
goto err_pci_accel;
}
ret = gpib_register_driver(&cb_pci_unaccel_interface, THIS_MODULE);
if (ret) {
pr_err("cb7210: gpib_register_driver failed: error = %d\n", ret);
goto err_pci_unaccel;
}
ret = gpib_register_driver(&cb_isa_accel_interface, THIS_MODULE);
if (ret) {
pr_err("cb7210: gpib_register_driver failed: error = %d\n", ret);
goto err_isa_accel;
}
ret = gpib_register_driver(&cb_isa_unaccel_interface, THIS_MODULE);
if (ret) {
pr_err("cb7210: gpib_register_driver failed: error = %d\n", ret);
goto err_isa_unaccel;
}
#ifdef GPIB_PCMCIA
ret = gpib_register_driver(&cb_pcmcia_interface, THIS_MODULE);
if (ret) {
pr_err("cb7210: gpib_register_driver failed: error = %d\n", ret);
goto err_pcmcia;
}
ret = gpib_register_driver(&cb_pcmcia_accel_interface, THIS_MODULE);
if (ret) {
pr_err("cb7210: gpib_register_driver failed: error = %d\n", ret);
goto err_pcmcia_accel;
}
ret = gpib_register_driver(&cb_pcmcia_unaccel_interface, THIS_MODULE);
if (ret) {
pr_err("cb7210: gpib_register_driver failed: error = %d\n", ret);
goto err_pcmcia_unaccel;
}
ret = pcmcia_register_driver(&cb_gpib_cs_driver);
if (ret) {
pr_err("cb7210: pcmcia_register_driver failed: error = %d\n", ret);
goto err_pcmcia_driver;
}
#endif
if (err)
return -1;
return 0;
#ifdef GPIB_PCMCIA
err_pcmcia_driver:
gpib_unregister_driver(&cb_pcmcia_unaccel_interface);
err_pcmcia_unaccel:
gpib_unregister_driver(&cb_pcmcia_accel_interface);
err_pcmcia_accel:
gpib_unregister_driver(&cb_pcmcia_interface);
err_pcmcia:
#endif
gpib_unregister_driver(&cb_isa_unaccel_interface);
err_isa_unaccel:
gpib_unregister_driver(&cb_isa_accel_interface);
err_isa_accel:
gpib_unregister_driver(&cb_pci_unaccel_interface);
err_pci_unaccel:
gpib_unregister_driver(&cb_pci_accel_interface);
err_pci_accel:
gpib_unregister_driver(&cb_isa_interface);
err_isa:
gpib_unregister_driver(&cb_pci_interface);
err_pci:
pci_unregister_driver(&cb7210_pci_driver);
return ret;
}
static void __exit cb7210_exit_module(void)

View File

@ -36,11 +36,6 @@ struct cb7210_priv {
unsigned in_fifo_half_full : 1;
};
// interfaces
extern gpib_interface_t cb_pcmcia_interface;
extern gpib_interface_t cb_pcmcia_accel_interface;
extern gpib_interface_t cb_pcmcia_unaccel_interface;
// interrupt service routines
irqreturn_t cb_pci_interrupt(int irq, void *arg);
irqreturn_t cb7210_interrupt(int irq, void *arg);

View File

@ -16,10 +16,6 @@ struct cec_priv {
unsigned int irq;
};
// interfaces
extern gpib_interface_t cec_pci_interface;
extern gpib_interface_t cec_pcmcia_interface;
// interface functions
int cec_read(gpib_board_t *board, uint8_t *buffer, size_t length, int *end, size_t *bytes_read);
int cec_write(gpib_board_t *board, uint8_t *buffer, size_t length, int send_eoi,

View File

@ -182,32 +182,32 @@ void cec_return_to_local(gpib_board_t *board)
nec7210_return_to_local(board, &priv->nec7210_priv);
}
gpib_interface_t cec_pci_interface = {
name: "cec_pci",
attach : cec_pci_attach,
detach : cec_pci_detach,
read : cec_read,
write : cec_write,
command : cec_command,
take_control : cec_take_control,
go_to_standby : cec_go_to_standby,
request_system_control : cec_request_system_control,
interface_clear : cec_interface_clear,
remote_enable : cec_remote_enable,
enable_eos : cec_enable_eos,
disable_eos : cec_disable_eos,
parallel_poll : cec_parallel_poll,
parallel_poll_configure : cec_parallel_poll_configure,
parallel_poll_response : cec_parallel_poll_response,
local_parallel_poll_mode : NULL, // XXX
line_status : NULL, //XXX
update_status : cec_update_status,
primary_address : cec_primary_address,
secondary_address : cec_secondary_address,
serial_poll_response : cec_serial_poll_response,
serial_poll_status : cec_serial_poll_status,
t1_delay : cec_t1_delay,
return_to_local : cec_return_to_local,
static gpib_interface_t cec_pci_interface = {
.name = "cec_pci",
.attach = cec_pci_attach,
.detach = cec_pci_detach,
.read = cec_read,
.write = cec_write,
.command = cec_command,
.take_control = cec_take_control,
.go_to_standby = cec_go_to_standby,
.request_system_control = cec_request_system_control,
.interface_clear = cec_interface_clear,
.remote_enable = cec_remote_enable,
.enable_eos = cec_enable_eos,
.disable_eos = cec_disable_eos,
.parallel_poll = cec_parallel_poll,
.parallel_poll_configure = cec_parallel_poll_configure,
.parallel_poll_response = cec_parallel_poll_response,
.local_parallel_poll_mode = NULL, // XXX
.line_status = NULL, //XXX
.update_status = cec_update_status,
.primary_address = cec_primary_address,
.secondary_address = cec_secondary_address,
.serial_poll_response = cec_serial_poll_response,
.serial_poll_status = cec_serial_poll_status,
.t1_delay = cec_t1_delay,
.return_to_local = cec_return_to_local,
};
static int cec_allocate_private(gpib_board_t *board)
@ -365,11 +365,15 @@ static int __init cec_init_module(void)
result = pci_register_driver(&cec_pci_driver);
if (result) {
pr_err("cec_gpib: pci_driver_register failed!\n");
pr_err("cec_gpib: pci_register_driver failed: error = %d\n", result);
return result;
}
gpib_register_driver(&cec_pci_interface, THIS_MODULE);
result = gpib_register_driver(&cec_pci_interface, THIS_MODULE);
if (result) {
pr_err("cec_gpib: gpib_register_driver failed: error = %d\n", result);
return result;
}
return 0;
}

View File

@ -835,7 +835,7 @@ static int board_type_ioctl(gpib_file_private_t *file_priv, gpib_board_t *board,
return -EBUSY;
}
retval = copy_from_user(&cmd, (void *)arg, sizeof(board_type_ioctl_t));
retval = copy_from_user(&cmd, (void __user *)arg, sizeof(board_type_ioctl_t));
if (retval)
return retval;
@ -879,7 +879,7 @@ static int read_ioctl(gpib_file_private_t *file_priv, gpib_board_t *board,
unsigned long arg)
{
read_write_ioctl_t read_cmd;
u8 *userbuf;
u8 __user *userbuf;
unsigned long remain;
int end_flag = 0;
int retval;
@ -887,7 +887,7 @@ static int read_ioctl(gpib_file_private_t *file_priv, gpib_board_t *board,
gpib_descriptor_t *desc;
size_t nbytes;
retval = copy_from_user(&read_cmd, (void *)arg, sizeof(read_cmd));
retval = copy_from_user(&read_cmd, (void __user *)arg, sizeof(read_cmd));
if (retval)
return -EFAULT;
@ -901,7 +901,7 @@ static int read_ioctl(gpib_file_private_t *file_priv, gpib_board_t *board,
if (WARN_ON_ONCE(sizeof(userbuf) > sizeof(read_cmd.buffer_ptr)))
return -EFAULT;
userbuf = (u8 *)(unsigned long)read_cmd.buffer_ptr;
userbuf = (u8 __user *)(unsigned long)read_cmd.buffer_ptr;
userbuf += read_cmd.completed_transfer_count;
remain = read_cmd.requested_transfer_count - read_cmd.completed_transfer_count;
@ -939,7 +939,7 @@ static int read_ioctl(gpib_file_private_t *file_priv, gpib_board_t *board,
if (remain == 0 || end_flag)
read_ret = 0;
if (retval == 0)
retval = copy_to_user((void *)arg, &read_cmd, sizeof(read_cmd));
retval = copy_to_user((void __user *)arg, &read_cmd, sizeof(read_cmd));
atomic_set(&desc->io_in_progress, 0);
@ -954,7 +954,7 @@ static int command_ioctl(gpib_file_private_t *file_priv,
gpib_board_t *board, unsigned long arg)
{
read_write_ioctl_t cmd;
u8 *userbuf;
u8 __user *userbuf;
unsigned long remain;
int retval;
int fault = 0;
@ -962,7 +962,7 @@ static int command_ioctl(gpib_file_private_t *file_priv,
size_t bytes_written;
int no_clear_io_in_prog;
retval = copy_from_user(&cmd, (void *)arg, sizeof(cmd));
retval = copy_from_user(&cmd, (void __user *)arg, sizeof(cmd));
if (retval)
return -EFAULT;
@ -973,7 +973,7 @@ static int command_ioctl(gpib_file_private_t *file_priv,
if (!desc)
return -EINVAL;
userbuf = (u8 *)(unsigned long)cmd.buffer_ptr;
userbuf = (u8 __user *)(unsigned long)cmd.buffer_ptr;
userbuf += cmd.completed_transfer_count;
no_clear_io_in_prog = cmd.end;
@ -1016,7 +1016,7 @@ static int command_ioctl(gpib_file_private_t *file_priv,
cmd.completed_transfer_count = cmd.requested_transfer_count - remain;
if (fault == 0)
fault = copy_to_user((void *)arg, &cmd, sizeof(cmd));
fault = copy_to_user((void __user *)arg, &cmd, sizeof(cmd));
/*
* no_clear_io_in_prog (cmd.end) is true when io_in_progress should
@ -1038,13 +1038,13 @@ static int write_ioctl(gpib_file_private_t *file_priv, gpib_board_t *board,
unsigned long arg)
{
read_write_ioctl_t write_cmd;
u8 *userbuf;
u8 __user *userbuf;
unsigned long remain;
int retval = 0;
int fault;
gpib_descriptor_t *desc;
fault = copy_from_user(&write_cmd, (void *)arg, sizeof(write_cmd));
fault = copy_from_user(&write_cmd, (void __user *)arg, sizeof(write_cmd));
if (fault)
return -EFAULT;
@ -1055,7 +1055,7 @@ static int write_ioctl(gpib_file_private_t *file_priv, gpib_board_t *board,
if (!desc)
return -EINVAL;
userbuf = (u8 *)(unsigned long)write_cmd.buffer_ptr;
userbuf = (u8 __user *)(unsigned long)write_cmd.buffer_ptr;
userbuf += write_cmd.completed_transfer_count;
remain = write_cmd.requested_transfer_count - write_cmd.completed_transfer_count;
@ -1094,7 +1094,7 @@ static int write_ioctl(gpib_file_private_t *file_priv, gpib_board_t *board,
if (remain == 0)
retval = 0;
if (fault == 0)
fault = copy_to_user((void *)arg, &write_cmd, sizeof(write_cmd));
fault = copy_to_user((void __user *)arg, &write_cmd, sizeof(write_cmd));
atomic_set(&desc->io_in_progress, 0);
@ -1111,7 +1111,7 @@ static int status_bytes_ioctl(gpib_board_t *board, unsigned long arg)
spoll_bytes_ioctl_t cmd;
int retval;
retval = copy_from_user(&cmd, (void *)arg, sizeof(cmd));
retval = copy_from_user(&cmd, (void __user *)arg, sizeof(cmd));
if (retval)
return -EFAULT;
@ -1121,7 +1121,7 @@ static int status_bytes_ioctl(gpib_board_t *board, unsigned long arg)
else
cmd.num_bytes = num_status_bytes(device);
retval = copy_to_user((void *)arg, &cmd, sizeof(cmd));
retval = copy_to_user((void __user *)arg, &cmd, sizeof(cmd));
if (retval)
return -EFAULT;
@ -1231,7 +1231,7 @@ static int open_dev_ioctl(struct file *filep, gpib_board_t *board, unsigned long
gpib_file_private_t *file_priv = filep->private_data;
int i;
retval = copy_from_user(&open_dev_cmd, (void *)arg, sizeof(open_dev_cmd));
retval = copy_from_user(&open_dev_cmd, (void __user *)arg, sizeof(open_dev_cmd));
if (retval)
return -EFAULT;
@ -1267,7 +1267,7 @@ static int open_dev_ioctl(struct file *filep, gpib_board_t *board, unsigned long
atomic_set(&board->stuck_srq, 0);
open_dev_cmd.handle = i;
retval = copy_to_user((void *)arg, &open_dev_cmd, sizeof(open_dev_cmd));
retval = copy_to_user((void __user *)arg, &open_dev_cmd, sizeof(open_dev_cmd));
if (retval)
return -EFAULT;
@ -1280,7 +1280,7 @@ static int close_dev_ioctl(struct file *filep, gpib_board_t *board, unsigned lon
gpib_file_private_t *file_priv = filep->private_data;
int retval;
retval = copy_from_user(&cmd, (void *)arg, sizeof(cmd));
retval = copy_from_user(&cmd, (void __user *)arg, sizeof(cmd));
if (retval)
return -EFAULT;
@ -1308,7 +1308,7 @@ static int serial_poll_ioctl(gpib_board_t *board, unsigned long arg)
dev_dbg(board->gpib_dev, "pid %i, entering %s()\n", current->pid, __func__);
retval = copy_from_user(&serial_cmd, (void *)arg, sizeof(serial_cmd));
retval = copy_from_user(&serial_cmd, (void __user *)arg, sizeof(serial_cmd));
if (retval)
return -EFAULT;
@ -1317,7 +1317,7 @@ static int serial_poll_ioctl(gpib_board_t *board, unsigned long arg)
if (retval < 0)
return retval;
retval = copy_to_user((void *)arg, &serial_cmd, sizeof(serial_cmd));
retval = copy_to_user((void __user *)arg, &serial_cmd, sizeof(serial_cmd));
if (retval)
return -EFAULT;
@ -1331,7 +1331,7 @@ static int wait_ioctl(gpib_file_private_t *file_priv, gpib_board_t *board,
int retval;
gpib_descriptor_t *desc;
retval = copy_from_user(&wait_cmd, (void *)arg, sizeof(wait_cmd));
retval = copy_from_user(&wait_cmd, (void __user *)arg, sizeof(wait_cmd));
if (retval)
return -EFAULT;
@ -1344,7 +1344,7 @@ static int wait_ioctl(gpib_file_private_t *file_priv, gpib_board_t *board,
if (retval < 0)
return retval;
retval = copy_to_user((void *)arg, &wait_cmd, sizeof(wait_cmd));
retval = copy_to_user((void __user *)arg, &wait_cmd, sizeof(wait_cmd));
if (retval)
return -EFAULT;
@ -1360,7 +1360,7 @@ static int parallel_poll_ioctl(gpib_board_t *board, unsigned long arg)
if (retval < 0)
return retval;
retval = copy_to_user((void *)arg, &poll_byte, sizeof(poll_byte));
retval = copy_to_user((void __user *)arg, &poll_byte, sizeof(poll_byte));
if (retval)
return -EFAULT;
@ -1371,14 +1371,14 @@ static int online_ioctl(gpib_board_t *board, unsigned long arg)
{
online_ioctl_t online_cmd;
int retval;
void *init_data = NULL;
void __user *init_data = NULL;
board->config.init_data = NULL;
if (!capable(CAP_SYS_ADMIN))
return -EPERM;
retval = copy_from_user(&online_cmd, (void *)arg, sizeof(online_cmd));
retval = copy_from_user(&online_cmd, (void __user *)arg, sizeof(online_cmd));
if (retval)
return -EFAULT;
if (online_cmd.init_data_length > 0) {
@ -1387,7 +1387,7 @@ static int online_ioctl(gpib_board_t *board, unsigned long arg)
return -ENOMEM;
if (WARN_ON_ONCE(sizeof(init_data) > sizeof(online_cmd.init_data_ptr)))
return -EFAULT;
init_data = (void *)(unsigned long)(online_cmd.init_data_ptr);
init_data = (void __user *)(unsigned long)(online_cmd.init_data_ptr);
retval = copy_from_user(board->config.init_data, init_data,
online_cmd.init_data_length);
if (retval) {
@ -1416,7 +1416,7 @@ static int remote_enable_ioctl(gpib_board_t *board, unsigned long arg)
int enable;
int retval;
retval = copy_from_user(&enable, (void *)arg, sizeof(enable));
retval = copy_from_user(&enable, (void __user *)arg, sizeof(enable));
if (retval)
return -EFAULT;
@ -1428,7 +1428,7 @@ static int take_control_ioctl(gpib_board_t *board, unsigned long arg)
int synchronous;
int retval;
retval = copy_from_user(&synchronous, (void *)arg, sizeof(synchronous));
retval = copy_from_user(&synchronous, (void __user *)arg, sizeof(synchronous));
if (retval)
return -EFAULT;
@ -1444,7 +1444,7 @@ static int line_status_ioctl(gpib_board_t *board, unsigned long arg)
if (retval < 0)
return retval;
retval = copy_to_user((void *)arg, &lines, sizeof(lines));
retval = copy_to_user((void __user *)arg, &lines, sizeof(lines));
if (retval)
return -EFAULT;
@ -1458,7 +1458,7 @@ static int pad_ioctl(gpib_board_t *board, gpib_file_private_t *file_priv,
int retval;
gpib_descriptor_t *desc;
retval = copy_from_user(&cmd, (void *)arg, sizeof(cmd));
retval = copy_from_user(&cmd, (void __user *)arg, sizeof(cmd));
if (retval)
return -EFAULT;
@ -1494,7 +1494,7 @@ static int sad_ioctl(gpib_board_t *board, gpib_file_private_t *file_priv,
int retval;
gpib_descriptor_t *desc;
retval = copy_from_user(&cmd, (void *)arg, sizeof(cmd));
retval = copy_from_user(&cmd, (void __user *)arg, sizeof(cmd));
if (retval)
return -EFAULT;
@ -1527,7 +1527,7 @@ static int eos_ioctl(gpib_board_t *board, unsigned long arg)
eos_ioctl_t eos_cmd;
int retval;
retval = copy_from_user(&eos_cmd, (void *)arg, sizeof(eos_cmd));
retval = copy_from_user(&eos_cmd, (void __user *)arg, sizeof(eos_cmd));
if (retval)
return -EFAULT;
@ -1539,7 +1539,7 @@ static int request_service_ioctl(gpib_board_t *board, unsigned long arg)
u8 status_byte;
int retval;
retval = copy_from_user(&status_byte, (void *)arg, sizeof(status_byte));
retval = copy_from_user(&status_byte, (void __user *)arg, sizeof(status_byte));
if (retval)
return -EFAULT;
@ -1551,7 +1551,8 @@ static int request_service2_ioctl(gpib_board_t *board, unsigned long arg)
request_service2_t request_service2_cmd;
int retval;
retval = copy_from_user(&request_service2_cmd, (void *)arg, sizeof(request_service2_t));
retval = copy_from_user(&request_service2_cmd, (void __user *)arg,
sizeof(request_service2_t));
if (retval)
return -EFAULT;
@ -1567,7 +1568,7 @@ static int iobase_ioctl(gpib_board_config_t *config, unsigned long arg)
if (!capable(CAP_SYS_ADMIN))
return -EPERM;
retval = copy_from_user(&base_addr, (void *)arg, sizeof(base_addr));
retval = copy_from_user(&base_addr, (void __user *)arg, sizeof(base_addr));
if (retval)
return -EFAULT;
@ -1586,7 +1587,7 @@ static int irq_ioctl(gpib_board_config_t *config, unsigned long arg)
if (!capable(CAP_SYS_ADMIN))
return -EPERM;
retval = copy_from_user(&irq, (void *)arg, sizeof(irq));
retval = copy_from_user(&irq, (void __user *)arg, sizeof(irq));
if (retval)
return -EFAULT;
@ -1603,7 +1604,7 @@ static int dma_ioctl(gpib_board_config_t *config, unsigned long arg)
if (!capable(CAP_SYS_ADMIN))
return -EPERM;
retval = copy_from_user(&dma_channel, (void *)arg, sizeof(dma_channel));
retval = copy_from_user(&dma_channel, (void __user *)arg, sizeof(dma_channel));
if (retval)
return -EFAULT;
@ -1619,7 +1620,7 @@ static int autospoll_ioctl(gpib_board_t *board, gpib_file_private_t *file_priv,
int retval;
gpib_descriptor_t *desc;
retval = copy_from_user(&enable, (void *)arg, sizeof(enable));
retval = copy_from_user(&enable, (void __user *)arg, sizeof(enable));
if (retval)
return -EFAULT;
@ -1654,7 +1655,7 @@ static int mutex_ioctl(gpib_board_t *board, gpib_file_private_t *file_priv,
{
int retval, lock_mutex;
retval = copy_from_user(&lock_mutex, (void *)arg, sizeof(lock_mutex));
retval = copy_from_user(&lock_mutex, (void __user *)arg, sizeof(lock_mutex));
if (retval)
return -EFAULT;
@ -1698,7 +1699,7 @@ static int timeout_ioctl(gpib_board_t *board, unsigned long arg)
unsigned int timeout;
int retval;
retval = copy_from_user(&timeout, (void *)arg, sizeof(timeout));
retval = copy_from_user(&timeout, (void __user *)arg, sizeof(timeout));
if (retval)
return -EFAULT;
@ -1713,7 +1714,7 @@ static int ppc_ioctl(gpib_board_t *board, unsigned long arg)
ppoll_config_ioctl_t cmd;
int retval;
retval = copy_from_user(&cmd, (void *)arg, sizeof(cmd));
retval = copy_from_user(&cmd, (void __user *)arg, sizeof(cmd));
if (retval)
return -EFAULT;
@ -1739,7 +1740,7 @@ static int set_local_ppoll_mode_ioctl(gpib_board_t *board, unsigned long arg)
local_ppoll_mode_ioctl_t cmd;
int retval;
retval = copy_from_user(&cmd, (void *)arg, sizeof(cmd));
retval = copy_from_user(&cmd, (void __user *)arg, sizeof(cmd));
if (retval)
return -EFAULT;
@ -1759,7 +1760,7 @@ static int get_local_ppoll_mode_ioctl(gpib_board_t *board, unsigned long arg)
int retval;
cmd = board->local_ppoll_mode;
retval = copy_to_user((void *)arg, &cmd, sizeof(cmd));
retval = copy_to_user((void __user *)arg, &cmd, sizeof(cmd));
if (retval)
return -EFAULT;
@ -1773,7 +1774,7 @@ static int query_board_rsv_ioctl(gpib_board_t *board, unsigned long arg)
status = board->interface->serial_poll_status(board);
retval = copy_to_user((void *)arg, &status, sizeof(status));
retval = copy_to_user((void __user *)arg, &status, sizeof(status));
if (retval)
return -EFAULT;
@ -1796,7 +1797,7 @@ static int board_info_ioctl(const gpib_board_t *board, unsigned long arg)
info.t1_delay = board->t1_nano_sec;
info.ist = board->ist;
info.no_7_bit_eos = board->interface->no_7_bit_eos;
retval = copy_to_user((void *)arg, &info, sizeof(info));
retval = copy_to_user((void __user *)arg, &info, sizeof(info));
if (retval)
return -EFAULT;
@ -1808,7 +1809,7 @@ static int interface_clear_ioctl(gpib_board_t *board, unsigned long arg)
unsigned int usec_duration;
int retval;
retval = copy_from_user(&usec_duration, (void *)arg, sizeof(usec_duration));
retval = copy_from_user(&usec_duration, (void __user *)arg, sizeof(usec_duration));
if (retval)
return -EFAULT;
@ -1823,7 +1824,7 @@ static int select_pci_ioctl(gpib_board_config_t *config, unsigned long arg)
if (!capable(CAP_SYS_ADMIN))
return -EPERM;
retval = copy_from_user(&selection, (void *)arg, sizeof(selection));
retval = copy_from_user(&selection, (void __user *)arg, sizeof(selection));
if (retval)
return -EFAULT;
@ -1845,7 +1846,7 @@ static int select_device_path_ioctl(gpib_board_config_t *config, unsigned long a
if (!selection)
return -ENOMEM;
retval = copy_from_user(selection, (void *)arg, sizeof(select_device_path_ioctl_t));
retval = copy_from_user(selection, (void __user *)arg, sizeof(select_device_path_ioctl_t));
if (retval) {
vfree(selection);
return -EFAULT;
@ -1979,7 +1980,7 @@ static int event_ioctl(gpib_board_t *board, unsigned long arg)
user_event = event;
retval = copy_to_user((void *)arg, &user_event, sizeof(user_event));
retval = copy_to_user((void __user *)arg, &user_event, sizeof(user_event));
if (retval)
return -EFAULT;
@ -1991,7 +1992,7 @@ static int request_system_control_ioctl(gpib_board_t *board, unsigned long arg)
rsc_ioctl_t request_control;
int retval;
retval = copy_from_user(&request_control, (void *)arg, sizeof(request_control));
retval = copy_from_user(&request_control, (void __user *)arg, sizeof(request_control));
if (retval)
return -EFAULT;
@ -2011,7 +2012,7 @@ static int t1_delay_ioctl(gpib_board_t *board, unsigned long arg)
return -EIO;
}
retval = copy_from_user(&cmd, (void *)arg, sizeof(cmd));
retval = copy_from_user(&cmd, (void __user *)arg, sizeof(cmd));
if (retval)
return -EFAULT;
@ -2022,13 +2023,13 @@ static int t1_delay_ioctl(gpib_board_t *board, unsigned long arg)
return 0;
}
const struct file_operations ib_fops = {
owner: THIS_MODULE,
llseek : NULL,
unlocked_ioctl : &ibioctl,
compat_ioctl : &ibioctl,
open : &ibopen,
release : &ibclose,
static const struct file_operations ib_fops = {
.owner = THIS_MODULE,
.llseek = NULL,
.unlocked_ioctl = &ibioctl,
.compat_ioctl = &ibioctl,
.open = &ibopen,
.release = &ibclose,
};
gpib_board_t board_array[GPIB_MAX_NUM_BOARDS];
@ -2044,18 +2045,19 @@ void init_gpib_descriptor(gpib_descriptor_t *desc)
atomic_set(&desc->io_in_progress, 0);
}
void gpib_register_driver(gpib_interface_t *interface, struct module *provider_module)
int gpib_register_driver(gpib_interface_t *interface, struct module *provider_module)
{
struct gpib_interface_list_struct *entry;
entry = kmalloc(sizeof(*entry), GFP_KERNEL);
if (!entry)
return;
return -ENOMEM;
entry->interface = interface;
entry->module = provider_module;
list_add(&entry->list, &registered_drivers);
pr_info("gpib: registered %s interface\n", interface->name);
return 0;
}
EXPORT_SYMBOL(gpib_register_driver);
@ -2195,7 +2197,7 @@ static int __init gpib_common_init_module(void)
return PTR_ERR(gpib_class);
}
for (i = 0; i < GPIB_MAX_NUM_BOARDS; ++i)
board_array[i].gpib_dev = device_create(gpib_class, 0,
board_array[i].gpib_dev = device_create(gpib_class, NULL,
MKDEV(GPIB_CODE, i), NULL, "gpib%i", i);
return 0;

View File

@ -695,7 +695,7 @@ int ibwait(gpib_board_t *board, int wait_mask, int clear_mask, int set_mask,
/* make sure we only clear status bits that we are reporting */
if (*status & clear_mask || set_mask)
general_ibstatus(board, status_queue, *status & clear_mask, set_mask, 0);
general_ibstatus(board, status_queue, *status & clear_mask, set_mask, NULL);
return 0;
}

View File

@ -720,31 +720,31 @@ static int fluke_accel_read(gpib_board_t *board, uint8_t *buffer, size_t length,
return retval;
}
gpib_interface_t fluke_unaccel_interface = {
name: "fluke_unaccel",
attach : fluke_attach_holdoff_all,
detach : fluke_detach,
read : fluke_read,
write : fluke_write,
command : fluke_command,
take_control : fluke_take_control,
go_to_standby : fluke_go_to_standby,
request_system_control : fluke_request_system_control,
interface_clear : fluke_interface_clear,
remote_enable : fluke_remote_enable,
enable_eos : fluke_enable_eos,
disable_eos : fluke_disable_eos,
parallel_poll : fluke_parallel_poll,
parallel_poll_configure : fluke_parallel_poll_configure,
parallel_poll_response : fluke_parallel_poll_response,
line_status : fluke_line_status,
update_status : fluke_update_status,
primary_address : fluke_primary_address,
secondary_address : fluke_secondary_address,
serial_poll_response : fluke_serial_poll_response,
serial_poll_status : fluke_serial_poll_status,
t1_delay : fluke_t1_delay,
return_to_local : fluke_return_to_local,
static gpib_interface_t fluke_unaccel_interface = {
.name = "fluke_unaccel",
.attach = fluke_attach_holdoff_all,
.detach = fluke_detach,
.read = fluke_read,
.write = fluke_write,
.command = fluke_command,
.take_control = fluke_take_control,
.go_to_standby = fluke_go_to_standby,
.request_system_control = fluke_request_system_control,
.interface_clear = fluke_interface_clear,
.remote_enable = fluke_remote_enable,
.enable_eos = fluke_enable_eos,
.disable_eos = fluke_disable_eos,
.parallel_poll = fluke_parallel_poll,
.parallel_poll_configure = fluke_parallel_poll_configure,
.parallel_poll_response = fluke_parallel_poll_response,
.line_status = fluke_line_status,
.update_status = fluke_update_status,
.primary_address = fluke_primary_address,
.secondary_address = fluke_secondary_address,
.serial_poll_response = fluke_serial_poll_response,
.serial_poll_status = fluke_serial_poll_status,
.t1_delay = fluke_t1_delay,
.return_to_local = fluke_return_to_local,
};
/* fluke_hybrid uses dma for writes but not for reads. Added
@ -755,58 +755,58 @@ return_to_local : fluke_return_to_local,
* register just as the dma controller is also doing a read.
*/
gpib_interface_t fluke_hybrid_interface = {
name: "fluke_hybrid",
attach : fluke_attach_holdoff_all,
detach : fluke_detach,
read : fluke_read,
write : fluke_accel_write,
command : fluke_command,
take_control : fluke_take_control,
go_to_standby : fluke_go_to_standby,
request_system_control : fluke_request_system_control,
interface_clear : fluke_interface_clear,
remote_enable : fluke_remote_enable,
enable_eos : fluke_enable_eos,
disable_eos : fluke_disable_eos,
parallel_poll : fluke_parallel_poll,
parallel_poll_configure : fluke_parallel_poll_configure,
parallel_poll_response : fluke_parallel_poll_response,
line_status : fluke_line_status,
update_status : fluke_update_status,
primary_address : fluke_primary_address,
secondary_address : fluke_secondary_address,
serial_poll_response : fluke_serial_poll_response,
serial_poll_status : fluke_serial_poll_status,
t1_delay : fluke_t1_delay,
return_to_local : fluke_return_to_local,
static gpib_interface_t fluke_hybrid_interface = {
.name = "fluke_hybrid",
.attach = fluke_attach_holdoff_all,
.detach = fluke_detach,
.read = fluke_read,
.write = fluke_accel_write,
.command = fluke_command,
.take_control = fluke_take_control,
.go_to_standby = fluke_go_to_standby,
.request_system_control = fluke_request_system_control,
.interface_clear = fluke_interface_clear,
.remote_enable = fluke_remote_enable,
.enable_eos = fluke_enable_eos,
.disable_eos = fluke_disable_eos,
.parallel_poll = fluke_parallel_poll,
.parallel_poll_configure = fluke_parallel_poll_configure,
.parallel_poll_response = fluke_parallel_poll_response,
.line_status = fluke_line_status,
.update_status = fluke_update_status,
.primary_address = fluke_primary_address,
.secondary_address = fluke_secondary_address,
.serial_poll_response = fluke_serial_poll_response,
.serial_poll_status = fluke_serial_poll_status,
.t1_delay = fluke_t1_delay,
.return_to_local = fluke_return_to_local,
};
gpib_interface_t fluke_interface = {
name: "fluke",
attach : fluke_attach_holdoff_end,
detach : fluke_detach,
read : fluke_accel_read,
write : fluke_accel_write,
command : fluke_command,
take_control : fluke_take_control,
go_to_standby : fluke_go_to_standby,
request_system_control : fluke_request_system_control,
interface_clear : fluke_interface_clear,
remote_enable : fluke_remote_enable,
enable_eos : fluke_enable_eos,
disable_eos : fluke_disable_eos,
parallel_poll : fluke_parallel_poll,
parallel_poll_configure : fluke_parallel_poll_configure,
parallel_poll_response : fluke_parallel_poll_response,
line_status : fluke_line_status,
update_status : fluke_update_status,
primary_address : fluke_primary_address,
secondary_address : fluke_secondary_address,
serial_poll_response : fluke_serial_poll_response,
serial_poll_status : fluke_serial_poll_status,
t1_delay : fluke_t1_delay,
return_to_local : fluke_return_to_local,
static gpib_interface_t fluke_interface = {
.name = "fluke",
.attach = fluke_attach_holdoff_end,
.detach = fluke_detach,
.read = fluke_accel_read,
.write = fluke_accel_write,
.command = fluke_command,
.take_control = fluke_take_control,
.go_to_standby = fluke_go_to_standby,
.request_system_control = fluke_request_system_control,
.interface_clear = fluke_interface_clear,
.remote_enable = fluke_remote_enable,
.enable_eos = fluke_enable_eos,
.disable_eos = fluke_disable_eos,
.parallel_poll = fluke_parallel_poll,
.parallel_poll_configure = fluke_parallel_poll_configure,
.parallel_poll_response = fluke_parallel_poll_response,
.line_status = fluke_line_status,
.update_status = fluke_update_status,
.primary_address = fluke_primary_address,
.secondary_address = fluke_secondary_address,
.serial_poll_response = fluke_serial_poll_response,
.serial_poll_status = fluke_serial_poll_status,
.t1_delay = fluke_t1_delay,
.return_to_local = fluke_return_to_local,
};
irqreturn_t fluke_gpib_internal_interrupt(gpib_board_t *board)
@ -1155,16 +1155,38 @@ static int __init fluke_init_module(void)
result = platform_driver_register(&fluke_gpib_platform_driver);
if (result) {
pr_err("fluke_gpib: platform_driver_register failed!\n");
pr_err("fluke_gpib: platform_driver_register failed: error = %d\n", result);
return result;
}
gpib_register_driver(&fluke_unaccel_interface, THIS_MODULE);
gpib_register_driver(&fluke_hybrid_interface, THIS_MODULE);
gpib_register_driver(&fluke_interface, THIS_MODULE);
result = gpib_register_driver(&fluke_unaccel_interface, THIS_MODULE);
if (result) {
pr_err("fluke_gpib: gpib_register_driver failed: error = %d\n", result);
goto err_unaccel;
}
result = gpib_register_driver(&fluke_hybrid_interface, THIS_MODULE);
if (result) {
pr_err("fluke_gpib: gpib_register_driver failed: error = %d\n", result);
goto err_hybrid;
}
result = gpib_register_driver(&fluke_interface, THIS_MODULE);
if (result) {
pr_err("fluke_gpib: gpib_register_driver failed: error = %d\n", result);
goto err_interface;
}
pr_info("fluke_gpib\n");
return 0;
err_interface:
gpib_unregister_driver(&fluke_hybrid_interface);
err_hybrid:
gpib_unregister_driver(&fluke_unaccel_interface);
err_unaccel:
platform_driver_unregister(&fluke_gpib_platform_driver);
return result;
}
static void __exit fluke_exit_module(void)

View File

@ -21,7 +21,7 @@ struct fluke_priv {
struct dma_chan *dma_channel;
u8 *dma_buffer;
int dma_buffer_size;
void *write_transfer_counter;
void __iomem *write_transfer_counter;
};
// cb7210 specific registers and bits

View File

@ -1040,116 +1040,116 @@ static int fmh_gpib_fifo_read(gpib_board_t *board, uint8_t *buffer, size_t lengt
return retval;
}
gpib_interface_t fmh_gpib_unaccel_interface = {
name: "fmh_gpib_unaccel",
attach : fmh_gpib_attach_holdoff_all,
detach : fmh_gpib_detach,
read : fmh_gpib_read,
write : fmh_gpib_write,
command : fmh_gpib_command,
take_control : fmh_gpib_take_control,
go_to_standby : fmh_gpib_go_to_standby,
request_system_control : fmh_gpib_request_system_control,
interface_clear : fmh_gpib_interface_clear,
remote_enable : fmh_gpib_remote_enable,
enable_eos : fmh_gpib_enable_eos,
disable_eos : fmh_gpib_disable_eos,
parallel_poll : fmh_gpib_parallel_poll,
parallel_poll_configure : fmh_gpib_parallel_poll_configure,
parallel_poll_response : fmh_gpib_parallel_poll_response,
local_parallel_poll_mode : fmh_gpib_local_parallel_poll_mode,
line_status : fmh_gpib_line_status,
update_status : fmh_gpib_update_status,
primary_address : fmh_gpib_primary_address,
secondary_address : fmh_gpib_secondary_address,
serial_poll_response2 : fmh_gpib_serial_poll_response2,
serial_poll_status : fmh_gpib_serial_poll_status,
t1_delay : fmh_gpib_t1_delay,
return_to_local : fmh_gpib_return_to_local,
static gpib_interface_t fmh_gpib_unaccel_interface = {
.name = "fmh_gpib_unaccel",
.attach = fmh_gpib_attach_holdoff_all,
.detach = fmh_gpib_detach,
.read = fmh_gpib_read,
.write = fmh_gpib_write,
.command = fmh_gpib_command,
.take_control = fmh_gpib_take_control,
.go_to_standby = fmh_gpib_go_to_standby,
.request_system_control = fmh_gpib_request_system_control,
.interface_clear = fmh_gpib_interface_clear,
.remote_enable = fmh_gpib_remote_enable,
.enable_eos = fmh_gpib_enable_eos,
.disable_eos = fmh_gpib_disable_eos,
.parallel_poll = fmh_gpib_parallel_poll,
.parallel_poll_configure = fmh_gpib_parallel_poll_configure,
.parallel_poll_response = fmh_gpib_parallel_poll_response,
.local_parallel_poll_mode = fmh_gpib_local_parallel_poll_mode,
.line_status = fmh_gpib_line_status,
.update_status = fmh_gpib_update_status,
.primary_address = fmh_gpib_primary_address,
.secondary_address = fmh_gpib_secondary_address,
.serial_poll_response2 = fmh_gpib_serial_poll_response2,
.serial_poll_status = fmh_gpib_serial_poll_status,
.t1_delay = fmh_gpib_t1_delay,
.return_to_local = fmh_gpib_return_to_local,
};
gpib_interface_t fmh_gpib_interface = {
name: "fmh_gpib",
attach : fmh_gpib_attach_holdoff_end,
detach : fmh_gpib_detach,
read : fmh_gpib_accel_read,
write : fmh_gpib_accel_write,
command : fmh_gpib_command,
take_control : fmh_gpib_take_control,
go_to_standby : fmh_gpib_go_to_standby,
request_system_control : fmh_gpib_request_system_control,
interface_clear : fmh_gpib_interface_clear,
remote_enable : fmh_gpib_remote_enable,
enable_eos : fmh_gpib_enable_eos,
disable_eos : fmh_gpib_disable_eos,
parallel_poll : fmh_gpib_parallel_poll,
parallel_poll_configure : fmh_gpib_parallel_poll_configure,
parallel_poll_response : fmh_gpib_parallel_poll_response,
local_parallel_poll_mode : fmh_gpib_local_parallel_poll_mode,
line_status : fmh_gpib_line_status,
update_status : fmh_gpib_update_status,
primary_address : fmh_gpib_primary_address,
secondary_address : fmh_gpib_secondary_address,
serial_poll_response2 : fmh_gpib_serial_poll_response2,
serial_poll_status : fmh_gpib_serial_poll_status,
t1_delay : fmh_gpib_t1_delay,
return_to_local : fmh_gpib_return_to_local,
static gpib_interface_t fmh_gpib_interface = {
.name = "fmh_gpib",
.attach = fmh_gpib_attach_holdoff_end,
.detach = fmh_gpib_detach,
.read = fmh_gpib_accel_read,
.write = fmh_gpib_accel_write,
.command = fmh_gpib_command,
.take_control = fmh_gpib_take_control,
.go_to_standby = fmh_gpib_go_to_standby,
.request_system_control = fmh_gpib_request_system_control,
.interface_clear = fmh_gpib_interface_clear,
.remote_enable = fmh_gpib_remote_enable,
.enable_eos = fmh_gpib_enable_eos,
.disable_eos = fmh_gpib_disable_eos,
.parallel_poll = fmh_gpib_parallel_poll,
.parallel_poll_configure = fmh_gpib_parallel_poll_configure,
.parallel_poll_response = fmh_gpib_parallel_poll_response,
.local_parallel_poll_mode = fmh_gpib_local_parallel_poll_mode,
.line_status = fmh_gpib_line_status,
.update_status = fmh_gpib_update_status,
.primary_address = fmh_gpib_primary_address,
.secondary_address = fmh_gpib_secondary_address,
.serial_poll_response2 = fmh_gpib_serial_poll_response2,
.serial_poll_status = fmh_gpib_serial_poll_status,
.t1_delay = fmh_gpib_t1_delay,
.return_to_local = fmh_gpib_return_to_local,
};
gpib_interface_t fmh_gpib_pci_interface = {
name: "fmh_gpib_pci",
attach : fmh_gpib_pci_attach_holdoff_end,
detach : fmh_gpib_pci_detach,
read : fmh_gpib_fifo_read,
write : fmh_gpib_fifo_write,
command : fmh_gpib_command,
take_control : fmh_gpib_take_control,
go_to_standby : fmh_gpib_go_to_standby,
request_system_control : fmh_gpib_request_system_control,
interface_clear : fmh_gpib_interface_clear,
remote_enable : fmh_gpib_remote_enable,
enable_eos : fmh_gpib_enable_eos,
disable_eos : fmh_gpib_disable_eos,
parallel_poll : fmh_gpib_parallel_poll,
parallel_poll_configure : fmh_gpib_parallel_poll_configure,
parallel_poll_response : fmh_gpib_parallel_poll_response,
local_parallel_poll_mode : fmh_gpib_local_parallel_poll_mode,
line_status : fmh_gpib_line_status,
update_status : fmh_gpib_update_status,
primary_address : fmh_gpib_primary_address,
secondary_address : fmh_gpib_secondary_address,
serial_poll_response2 : fmh_gpib_serial_poll_response2,
serial_poll_status : fmh_gpib_serial_poll_status,
t1_delay : fmh_gpib_t1_delay,
return_to_local : fmh_gpib_return_to_local,
static gpib_interface_t fmh_gpib_pci_interface = {
.name = "fmh_gpib_pci",
.attach = fmh_gpib_pci_attach_holdoff_end,
.detach = fmh_gpib_pci_detach,
.read = fmh_gpib_fifo_read,
.write = fmh_gpib_fifo_write,
.command = fmh_gpib_command,
.take_control = fmh_gpib_take_control,
.go_to_standby = fmh_gpib_go_to_standby,
.request_system_control = fmh_gpib_request_system_control,
.interface_clear = fmh_gpib_interface_clear,
.remote_enable = fmh_gpib_remote_enable,
.enable_eos = fmh_gpib_enable_eos,
.disable_eos = fmh_gpib_disable_eos,
.parallel_poll = fmh_gpib_parallel_poll,
.parallel_poll_configure = fmh_gpib_parallel_poll_configure,
.parallel_poll_response = fmh_gpib_parallel_poll_response,
.local_parallel_poll_mode = fmh_gpib_local_parallel_poll_mode,
.line_status = fmh_gpib_line_status,
.update_status = fmh_gpib_update_status,
.primary_address = fmh_gpib_primary_address,
.secondary_address = fmh_gpib_secondary_address,
.serial_poll_response2 = fmh_gpib_serial_poll_response2,
.serial_poll_status = fmh_gpib_serial_poll_status,
.t1_delay = fmh_gpib_t1_delay,
.return_to_local = fmh_gpib_return_to_local,
};
gpib_interface_t fmh_gpib_pci_unaccel_interface = {
name: "fmh_gpib_pci_unaccel",
attach : fmh_gpib_pci_attach_holdoff_all,
detach : fmh_gpib_pci_detach,
read : fmh_gpib_read,
write : fmh_gpib_write,
command : fmh_gpib_command,
take_control : fmh_gpib_take_control,
go_to_standby : fmh_gpib_go_to_standby,
request_system_control : fmh_gpib_request_system_control,
interface_clear : fmh_gpib_interface_clear,
remote_enable : fmh_gpib_remote_enable,
enable_eos : fmh_gpib_enable_eos,
disable_eos : fmh_gpib_disable_eos,
parallel_poll : fmh_gpib_parallel_poll,
parallel_poll_configure : fmh_gpib_parallel_poll_configure,
parallel_poll_response : fmh_gpib_parallel_poll_response,
local_parallel_poll_mode : fmh_gpib_local_parallel_poll_mode,
line_status : fmh_gpib_line_status,
update_status : fmh_gpib_update_status,
primary_address : fmh_gpib_primary_address,
secondary_address : fmh_gpib_secondary_address,
serial_poll_response2 : fmh_gpib_serial_poll_response2,
serial_poll_status : fmh_gpib_serial_poll_status,
t1_delay : fmh_gpib_t1_delay,
return_to_local : fmh_gpib_return_to_local,
static gpib_interface_t fmh_gpib_pci_unaccel_interface = {
.name = "fmh_gpib_pci_unaccel",
.attach = fmh_gpib_pci_attach_holdoff_all,
.detach = fmh_gpib_pci_detach,
.read = fmh_gpib_read,
.write = fmh_gpib_write,
.command = fmh_gpib_command,
.take_control = fmh_gpib_take_control,
.go_to_standby = fmh_gpib_go_to_standby,
.request_system_control = fmh_gpib_request_system_control,
.interface_clear = fmh_gpib_interface_clear,
.remote_enable = fmh_gpib_remote_enable,
.enable_eos = fmh_gpib_enable_eos,
.disable_eos = fmh_gpib_disable_eos,
.parallel_poll = fmh_gpib_parallel_poll,
.parallel_poll_configure = fmh_gpib_parallel_poll_configure,
.parallel_poll_response = fmh_gpib_parallel_poll_response,
.local_parallel_poll_mode = fmh_gpib_local_parallel_poll_mode,
.line_status = fmh_gpib_line_status,
.update_status = fmh_gpib_update_status,
.primary_address = fmh_gpib_primary_address,
.secondary_address = fmh_gpib_secondary_address,
.serial_poll_response2 = fmh_gpib_serial_poll_response2,
.serial_poll_status = fmh_gpib_serial_poll_status,
.t1_delay = fmh_gpib_t1_delay,
.return_to_local = fmh_gpib_return_to_local,
};
irqreturn_t fmh_gpib_internal_interrupt(gpib_board_t *board)
@ -1692,23 +1692,54 @@ static int __init fmh_gpib_init_module(void)
result = platform_driver_register(&fmh_gpib_platform_driver);
if (result) {
pr_err("fmh_gpib: platform_driver_register failed!\n");
pr_err("fmh_gpib: platform_driver_register failed: error = %d\n", result);
return result;
}
result = pci_register_driver(&fmh_gpib_pci_driver);
if (result) {
pr_err("fmh_gpib: pci_driver_register failed!\n");
return result;
pr_err("fmh_gpib: pci_register_driver failed: error = %d\n", result);
goto err_pci_driver;
}
gpib_register_driver(&fmh_gpib_unaccel_interface, THIS_MODULE);
gpib_register_driver(&fmh_gpib_interface, THIS_MODULE);
gpib_register_driver(&fmh_gpib_pci_unaccel_interface, THIS_MODULE);
gpib_register_driver(&fmh_gpib_pci_interface, THIS_MODULE);
result = gpib_register_driver(&fmh_gpib_unaccel_interface, THIS_MODULE);
if (result) {
pr_err("fmh_gpib: gpib_register_driver failed: error = %d\n", result);
goto err_unaccel;
}
result = gpib_register_driver(&fmh_gpib_interface, THIS_MODULE);
if (result) {
pr_err("fmh_gpib: gpib_register_driver failed: error = %d\n", result);
goto err_interface;
}
result = gpib_register_driver(&fmh_gpib_pci_unaccel_interface, THIS_MODULE);
if (result) {
pr_err("fmh_gpib: gpib_register_driver failed: error = %d\n", result);
goto err_pci_unaccel;
}
result = gpib_register_driver(&fmh_gpib_pci_interface, THIS_MODULE);
if (result) {
pr_err("fmh_gpib: gpib_register_driver failed: error = %d\n", result);
goto err_pci;
}
pr_info("fmh_gpib\n");
return 0;
err_pci:
gpib_unregister_driver(&fmh_gpib_pci_unaccel_interface);
err_pci_unaccel:
gpib_unregister_driver(&fmh_gpib_interface);
err_interface:
gpib_unregister_driver(&fmh_gpib_unaccel_interface);
err_unaccel:
pci_unregister_driver(&fmh_gpib_pci_driver);
err_pci_driver:
platform_driver_unregister(&fmh_gpib_platform_driver);
return result;
}
static void __exit fmh_gpib_exit_module(void)

View File

@ -33,7 +33,7 @@ struct fmh_priv {
u8 *dma_buffer;
int dma_buffer_size;
int dma_burst_length;
void *fifo_base;
void __iomem *fifo_base;
unsigned supports_fifo_interrupts : 1;
};

View File

@ -147,7 +147,7 @@ DEFINE_LED_TRIGGER(ledtrig_gpib);
led_trigger_event(ledtrig_gpib, LED_OFF); } \
while (0)
struct gpio_desc *all_descriptors[GPIB_PINS + SN7516X_PINS];
static struct gpio_desc *all_descriptors[GPIB_PINS + SN7516X_PINS];
#define D01 all_descriptors[0]
#define D02 all_descriptors[1]
@ -175,7 +175,7 @@ struct gpio_desc *all_descriptors[GPIB_PINS + SN7516X_PINS];
/* YOGA dapter uses a global enable for the buffer chips, re-using the TE pin */
#define YOGA_ENABLE TE
int gpios_vector[] = {
static int gpios_vector[] = {
D01_pin_nr,
D02_pin_nr,
D03_pin_nr,
@ -265,7 +265,7 @@ static struct gpiod_lookup_table gpib_gpio_table_0 = {
static struct gpiod_lookup_table *lookup_tables[] = {
&gpib_gpio_table_0,
&gpib_gpio_table_1,
0
NULL
};
/* struct which defines private_data for gpio driver */
@ -1119,7 +1119,7 @@ static void release_gpios(void)
for (j = 0 ; j < NUM_PINS ; j++) {
if (all_descriptors[j]) {
gpiod_put(all_descriptors[j]);
all_descriptors[j] = 0;
all_descriptors[j] = NULL;
}
}
}
@ -1312,36 +1312,41 @@ static int bb_attach(gpib_board_t *board, const gpib_board_config_t *config)
return retval;
}
gpib_interface_t bb_interface = {
name: NAME,
attach : bb_attach,
detach : bb_detach,
read : bb_read,
write : bb_write,
command : bb_command,
take_control : bb_take_control,
go_to_standby : bb_go_to_standby,
request_system_control : bb_request_system_control,
interface_clear : bb_interface_clear,
remote_enable : bb_remote_enable,
enable_eos : bb_enable_eos,
disable_eos : bb_disable_eos,
parallel_poll : bb_parallel_poll,
parallel_poll_configure : bb_parallel_poll_configure,
parallel_poll_response : bb_parallel_poll_response,
line_status : bb_line_status,
update_status : bb_update_status,
primary_address : bb_primary_address,
secondary_address : bb_secondary_address,
serial_poll_response : bb_serial_poll_response,
serial_poll_status : bb_serial_poll_status,
t1_delay : bb_t1_delay,
return_to_local : bb_return_to_local,
static gpib_interface_t bb_interface = {
.name = NAME,
.attach = bb_attach,
.detach = bb_detach,
.read = bb_read,
.write = bb_write,
.command = bb_command,
.take_control = bb_take_control,
.go_to_standby = bb_go_to_standby,
.request_system_control = bb_request_system_control,
.interface_clear = bb_interface_clear,
.remote_enable = bb_remote_enable,
.enable_eos = bb_enable_eos,
.disable_eos = bb_disable_eos,
.parallel_poll = bb_parallel_poll,
.parallel_poll_configure = bb_parallel_poll_configure,
.parallel_poll_response = bb_parallel_poll_response,
.line_status = bb_line_status,
.update_status = bb_update_status,
.primary_address = bb_primary_address,
.secondary_address = bb_secondary_address,
.serial_poll_response = bb_serial_poll_response,
.serial_poll_status = bb_serial_poll_status,
.t1_delay = bb_t1_delay,
.return_to_local = bb_return_to_local,
};
static int __init bb_init_module(void)
{
gpib_register_driver(&bb_interface, THIS_MODULE);
int result = gpib_register_driver(&bb_interface, THIS_MODULE);
if (result) {
pr_err("gpib_bitbang: gpib_register_driver failed: error = %d\n", result);
return result;
}
dbg_printk(0, "module loaded with pin map \"%s\"%s\n",
pin_map, (sn7516x_used) ? " and SN7516x driver support" : "");

View File

@ -173,32 +173,32 @@ void hp82335_return_to_local(gpib_board_t *board)
tms9914_return_to_local(board, &priv->tms9914_priv);
}
gpib_interface_t hp82335_interface = {
name: "hp82335",
attach : hp82335_attach,
detach : hp82335_detach,
read : hp82335_read,
write : hp82335_write,
command : hp82335_command,
request_system_control : hp82335_request_system_control,
take_control : hp82335_take_control,
go_to_standby : hp82335_go_to_standby,
interface_clear : hp82335_interface_clear,
remote_enable : hp82335_remote_enable,
enable_eos : hp82335_enable_eos,
disable_eos : hp82335_disable_eos,
parallel_poll : hp82335_parallel_poll,
parallel_poll_configure : hp82335_parallel_poll_configure,
parallel_poll_response : hp82335_parallel_poll_response,
local_parallel_poll_mode : NULL, // XXX
line_status : hp82335_line_status,
update_status : hp82335_update_status,
primary_address : hp82335_primary_address,
secondary_address : hp82335_secondary_address,
serial_poll_response : hp82335_serial_poll_response,
serial_poll_status : hp82335_serial_poll_status,
t1_delay : hp82335_t1_delay,
return_to_local : hp82335_return_to_local,
static gpib_interface_t hp82335_interface = {
.name = "hp82335",
.attach = hp82335_attach,
.detach = hp82335_detach,
.read = hp82335_read,
.write = hp82335_write,
.command = hp82335_command,
.request_system_control = hp82335_request_system_control,
.take_control = hp82335_take_control,
.go_to_standby = hp82335_go_to_standby,
.interface_clear = hp82335_interface_clear,
.remote_enable = hp82335_remote_enable,
.enable_eos = hp82335_enable_eos,
.disable_eos = hp82335_disable_eos,
.parallel_poll = hp82335_parallel_poll,
.parallel_poll_configure = hp82335_parallel_poll_configure,
.parallel_poll_response = hp82335_parallel_poll_response,
.local_parallel_poll_mode = NULL, // XXX
.line_status = hp82335_line_status,
.update_status = hp82335_update_status,
.primary_address = hp82335_primary_address,
.secondary_address = hp82335_secondary_address,
.serial_poll_response = hp82335_serial_poll_response,
.serial_poll_status = hp82335_serial_poll_status,
.t1_delay = hp82335_t1_delay,
.return_to_local = hp82335_return_to_local,
};
int hp82335_allocate_private(gpib_board_t *board)
@ -326,7 +326,13 @@ void hp82335_detach(gpib_board_t *board)
static int __init hp82335_init_module(void)
{
gpib_register_driver(&hp82335_interface, THIS_MODULE);
int result = gpib_register_driver(&hp82335_interface, THIS_MODULE);
if (result) {
pr_err("hp82335: gpib_register_driver failed: error = %d\n", result);
return result;
}
return 0;
}

View File

@ -17,9 +17,6 @@ struct hp82335_priv {
unsigned long raw_iobase;
};
// interfaces
extern gpib_interface_t hp82335_interface;
// interface functions
int hp82335_read(gpib_board_t *board, uint8_t *buffer, size_t length, int *end, size_t *bytes_read);
int hp82335_write(gpib_board_t *board, uint8_t *buffer, size_t length,

View File

@ -402,59 +402,59 @@ void hp_82341_return_to_local(gpib_board_t *board)
tms9914_return_to_local(board, &priv->tms9914_priv);
}
gpib_interface_t hp_82341_unaccel_interface = {
name: "hp_82341_unaccel",
attach : hp_82341_attach,
detach : hp_82341_detach,
read : hp_82341_read,
write : hp_82341_write,
command : hp_82341_command,
request_system_control : hp_82341_request_system_control,
take_control : hp_82341_take_control,
go_to_standby : hp_82341_go_to_standby,
interface_clear : hp_82341_interface_clear,
remote_enable : hp_82341_remote_enable,
enable_eos : hp_82341_enable_eos,
disable_eos : hp_82341_disable_eos,
parallel_poll : hp_82341_parallel_poll,
parallel_poll_configure : hp_82341_parallel_poll_configure,
parallel_poll_response : hp_82341_parallel_poll_response,
local_parallel_poll_mode : NULL, // XXX
line_status : hp_82341_line_status,
update_status : hp_82341_update_status,
primary_address : hp_82341_primary_address,
secondary_address : hp_82341_secondary_address,
serial_poll_response : hp_82341_serial_poll_response,
serial_poll_status : hp_82341_serial_poll_status,
t1_delay : hp_82341_t1_delay,
return_to_local : hp_82341_return_to_local,
static gpib_interface_t hp_82341_unaccel_interface = {
.name = "hp_82341_unaccel",
.attach = hp_82341_attach,
.detach = hp_82341_detach,
.read = hp_82341_read,
.write = hp_82341_write,
.command = hp_82341_command,
.request_system_control = hp_82341_request_system_control,
.take_control = hp_82341_take_control,
.go_to_standby = hp_82341_go_to_standby,
.interface_clear = hp_82341_interface_clear,
.remote_enable = hp_82341_remote_enable,
.enable_eos = hp_82341_enable_eos,
.disable_eos = hp_82341_disable_eos,
.parallel_poll = hp_82341_parallel_poll,
.parallel_poll_configure = hp_82341_parallel_poll_configure,
.parallel_poll_response = hp_82341_parallel_poll_response,
.local_parallel_poll_mode = NULL, // XXX
.line_status = hp_82341_line_status,
.update_status = hp_82341_update_status,
.primary_address = hp_82341_primary_address,
.secondary_address = hp_82341_secondary_address,
.serial_poll_response = hp_82341_serial_poll_response,
.serial_poll_status = hp_82341_serial_poll_status,
.t1_delay = hp_82341_t1_delay,
.return_to_local = hp_82341_return_to_local,
};
gpib_interface_t hp_82341_interface = {
name: "hp_82341",
attach : hp_82341_attach,
detach : hp_82341_detach,
read : hp_82341_accel_read,
write : hp_82341_accel_write,
command : hp_82341_command,
request_system_control : hp_82341_request_system_control,
take_control : hp_82341_take_control,
go_to_standby : hp_82341_go_to_standby,
interface_clear : hp_82341_interface_clear,
remote_enable : hp_82341_remote_enable,
enable_eos : hp_82341_enable_eos,
disable_eos : hp_82341_disable_eos,
parallel_poll : hp_82341_parallel_poll,
parallel_poll_configure : hp_82341_parallel_poll_configure,
parallel_poll_response : hp_82341_parallel_poll_response,
local_parallel_poll_mode : NULL, // XXX
line_status : hp_82341_line_status,
update_status : hp_82341_update_status,
primary_address : hp_82341_primary_address,
secondary_address : hp_82341_secondary_address,
serial_poll_response : hp_82341_serial_poll_response,
t1_delay : hp_82341_t1_delay,
return_to_local : hp_82341_return_to_local,
static gpib_interface_t hp_82341_interface = {
.name = "hp_82341",
.attach = hp_82341_attach,
.detach = hp_82341_detach,
.read = hp_82341_accel_read,
.write = hp_82341_accel_write,
.command = hp_82341_command,
.request_system_control = hp_82341_request_system_control,
.take_control = hp_82341_take_control,
.go_to_standby = hp_82341_go_to_standby,
.interface_clear = hp_82341_interface_clear,
.remote_enable = hp_82341_remote_enable,
.enable_eos = hp_82341_enable_eos,
.disable_eos = hp_82341_disable_eos,
.parallel_poll = hp_82341_parallel_poll,
.parallel_poll_configure = hp_82341_parallel_poll_configure,
.parallel_poll_response = hp_82341_parallel_poll_response,
.local_parallel_poll_mode = NULL, // XXX
.line_status = hp_82341_line_status,
.update_status = hp_82341_update_status,
.primary_address = hp_82341_primary_address,
.secondary_address = hp_82341_secondary_address,
.serial_poll_response = hp_82341_serial_poll_response,
.t1_delay = hp_82341_t1_delay,
.return_to_local = hp_82341_return_to_local,
};
int hp_82341_allocate_private(gpib_board_t *board)
@ -807,8 +807,21 @@ MODULE_DEVICE_TABLE(pnp, hp_82341_pnp_table);
static int __init hp_82341_init_module(void)
{
gpib_register_driver(&hp_82341_unaccel_interface, THIS_MODULE);
gpib_register_driver(&hp_82341_interface, THIS_MODULE);
int ret;
ret = gpib_register_driver(&hp_82341_unaccel_interface, THIS_MODULE);
if (ret) {
pr_err("hp_82341: gpib_register_driver failed: error = %d\n", ret);
return ret;
}
ret = gpib_register_driver(&hp_82341_interface, THIS_MODULE);
if (ret) {
pr_err("hp_82341: gpib_register_driver failed: error = %d\n", ret);
gpib_unregister_driver(&hp_82341_unaccel_interface);
return ret;
}
return 0;
}

View File

@ -26,8 +26,6 @@ struct hp_82341_priv {
enum hp_82341_hardware_version hw_version;
};
// interfaces
extern gpib_interface_t hp_82341_interface;
// interface functions
int hp_82341_accel_read(gpib_board_t *board, uint8_t *buffer, size_t length, int *end,

View File

@ -22,7 +22,7 @@ static const int bits_per_region = 8;
static inline uint32_t amcc_wait_state_bits(unsigned int region, unsigned int num_wait_states)
{
return (num_wait_states & 0x7) << (-region * bits_per_region);
return (num_wait_states & 0x7) << (--region * bits_per_region);
};
enum amcc_prefetch_bits {

View File

@ -18,7 +18,7 @@
#include <linux/interrupt.h>
#include <linux/io.h>
void gpib_register_driver(gpib_interface_t *interface, struct module *mod);
int gpib_register_driver(gpib_interface_t *interface, struct module *mod);
void gpib_unregister_driver(gpib_interface_t *interface);
struct pci_dev *gpib_pci_get_device(const gpib_board_config_t *config, unsigned int vendor_id,
unsigned int device_id, struct pci_dev *from);

View File

@ -35,13 +35,6 @@ struct ines_priv {
u8 extend_mode_bits;
};
// interfaces
extern gpib_interface_t ines_pci_interface;
extern gpib_interface_t ines_pci_accel_interface;
extern gpib_interface_t ines_pcmcia_interface;
extern gpib_interface_t ines_pcmcia_accel_interface;
extern gpib_interface_t ines_pcmcia_unaccel_interface;
// interface functions
int ines_read(gpib_board_t *board, uint8_t *buffer, size_t length, int *end, size_t *bytes_read);
int ines_write(gpib_board_t *board, uint8_t *buffer, size_t length,

View File

@ -357,38 +357,38 @@ struct ines_pci_id {
enum ines_pci_chip pci_chip_type;
};
struct ines_pci_id pci_ids[] = {
{vendor_id: PCI_VENDOR_ID_PLX,
device_id : PCI_DEVICE_ID_PLX_9050,
subsystem_vendor_id : PCI_VENDOR_ID_PLX,
subsystem_device_id : PCI_SUBDEVICE_ID_INES_GPIB,
gpib_region : 2,
io_offset : 1,
pci_chip_type : PCI_CHIP_PLX9050,
static struct ines_pci_id pci_ids[] = {
{.vendor_id = PCI_VENDOR_ID_PLX,
.device_id = PCI_DEVICE_ID_PLX_9050,
.subsystem_vendor_id = PCI_VENDOR_ID_PLX,
.subsystem_device_id = PCI_SUBDEVICE_ID_INES_GPIB,
.gpib_region = 2,
.io_offset = 1,
.pci_chip_type = PCI_CHIP_PLX9050,
},
{vendor_id: PCI_VENDOR_ID_AMCC,
device_id : PCI_DEVICE_ID_INES_GPIB_AMCC,
subsystem_vendor_id : PCI_VENDOR_ID_AMCC,
subsystem_device_id : PCI_SUBDEVICE_ID_INES_GPIB,
gpib_region : 1,
io_offset : 1,
pci_chip_type : PCI_CHIP_AMCC5920,
{.vendor_id = PCI_VENDOR_ID_AMCC,
.device_id = PCI_DEVICE_ID_INES_GPIB_AMCC,
.subsystem_vendor_id = PCI_VENDOR_ID_AMCC,
.subsystem_device_id = PCI_SUBDEVICE_ID_INES_GPIB,
.gpib_region = 1,
.io_offset = 1,
.pci_chip_type = PCI_CHIP_AMCC5920,
},
{vendor_id: PCI_VENDOR_ID_INES_QUICKLOGIC,
device_id : PCI_DEVICE_ID_INES_GPIB_QL5030,
subsystem_vendor_id : PCI_VENDOR_ID_INES_QUICKLOGIC,
subsystem_device_id : PCI_DEVICE_ID_INES_GPIB_QL5030,
gpib_region : 1,
io_offset : 1,
pci_chip_type : PCI_CHIP_QUICKLOGIC5030,
{.vendor_id = PCI_VENDOR_ID_INES_QUICKLOGIC,
.device_id = PCI_DEVICE_ID_INES_GPIB_QL5030,
.subsystem_vendor_id = PCI_VENDOR_ID_INES_QUICKLOGIC,
.subsystem_device_id = PCI_DEVICE_ID_INES_GPIB_QL5030,
.gpib_region = 1,
.io_offset = 1,
.pci_chip_type = PCI_CHIP_QUICKLOGIC5030,
},
{vendor_id: PCI_VENDOR_ID_QUANCOM,
device_id : PCI_DEVICE_ID_QUANCOM_GPIB,
subsystem_vendor_id : -1,
subsystem_device_id : -1,
gpib_region : 0,
io_offset : 4,
pci_chip_type : PCI_CHIP_QUANCOM,
{.vendor_id = PCI_VENDOR_ID_QUANCOM,
.device_id = PCI_DEVICE_ID_QUANCOM_GPIB,
.subsystem_vendor_id = -1,
.subsystem_device_id = -1,
.gpib_region = 0,
.io_offset = 4,
.pci_chip_type = PCI_CHIP_QUANCOM,
},
};
@ -540,116 +540,116 @@ void ines_return_to_local(gpib_board_t *board)
nec7210_return_to_local(board, &priv->nec7210_priv);
}
gpib_interface_t ines_pci_unaccel_interface = {
name: "ines_pci_unaccel",
attach : ines_pci_attach,
detach : ines_pci_detach,
read : ines_read,
write : ines_write,
command : ines_command,
take_control : ines_take_control,
go_to_standby : ines_go_to_standby,
request_system_control : ines_request_system_control,
interface_clear : ines_interface_clear,
remote_enable : ines_remote_enable,
enable_eos : ines_enable_eos,
disable_eos : ines_disable_eos,
parallel_poll : ines_parallel_poll,
parallel_poll_configure : ines_parallel_poll_configure,
parallel_poll_response : ines_parallel_poll_response,
local_parallel_poll_mode : NULL, // XXX
line_status : ines_line_status,
update_status : ines_update_status,
primary_address : ines_primary_address,
secondary_address : ines_secondary_address,
serial_poll_response : ines_serial_poll_response,
serial_poll_status : ines_serial_poll_status,
t1_delay : ines_t1_delay,
return_to_local : ines_return_to_local,
static gpib_interface_t ines_pci_unaccel_interface = {
.name = "ines_pci_unaccel",
.attach = ines_pci_attach,
.detach = ines_pci_detach,
.read = ines_read,
.write = ines_write,
.command = ines_command,
.take_control = ines_take_control,
.go_to_standby = ines_go_to_standby,
.request_system_control = ines_request_system_control,
.interface_clear = ines_interface_clear,
.remote_enable = ines_remote_enable,
.enable_eos = ines_enable_eos,
.disable_eos = ines_disable_eos,
.parallel_poll = ines_parallel_poll,
.parallel_poll_configure = ines_parallel_poll_configure,
.parallel_poll_response = ines_parallel_poll_response,
.local_parallel_poll_mode = NULL, // XXX
.line_status = ines_line_status,
.update_status = ines_update_status,
.primary_address = ines_primary_address,
.secondary_address = ines_secondary_address,
.serial_poll_response = ines_serial_poll_response,
.serial_poll_status = ines_serial_poll_status,
.t1_delay = ines_t1_delay,
.return_to_local = ines_return_to_local,
};
gpib_interface_t ines_pci_interface = {
name: "ines_pci",
attach : ines_pci_accel_attach,
detach : ines_pci_detach,
read : ines_accel_read,
write : ines_accel_write,
command : ines_command,
take_control : ines_take_control,
go_to_standby : ines_go_to_standby,
request_system_control : ines_request_system_control,
interface_clear : ines_interface_clear,
remote_enable : ines_remote_enable,
enable_eos : ines_enable_eos,
disable_eos : ines_disable_eos,
parallel_poll : ines_parallel_poll,
parallel_poll_configure : ines_parallel_poll_configure,
parallel_poll_response : ines_parallel_poll_response,
local_parallel_poll_mode : NULL, // XXX
line_status : ines_line_status,
update_status : ines_update_status,
primary_address : ines_primary_address,
secondary_address : ines_secondary_address,
serial_poll_response : ines_serial_poll_response,
serial_poll_status : ines_serial_poll_status,
t1_delay : ines_t1_delay,
return_to_local : ines_return_to_local,
static gpib_interface_t ines_pci_interface = {
.name = "ines_pci",
.attach = ines_pci_accel_attach,
.detach = ines_pci_detach,
.read = ines_accel_read,
.write = ines_accel_write,
.command = ines_command,
.take_control = ines_take_control,
.go_to_standby = ines_go_to_standby,
.request_system_control = ines_request_system_control,
.interface_clear = ines_interface_clear,
.remote_enable = ines_remote_enable,
.enable_eos = ines_enable_eos,
.disable_eos = ines_disable_eos,
.parallel_poll = ines_parallel_poll,
.parallel_poll_configure = ines_parallel_poll_configure,
.parallel_poll_response = ines_parallel_poll_response,
.local_parallel_poll_mode = NULL, // XXX
.line_status = ines_line_status,
.update_status = ines_update_status,
.primary_address = ines_primary_address,
.secondary_address = ines_secondary_address,
.serial_poll_response = ines_serial_poll_response,
.serial_poll_status = ines_serial_poll_status,
.t1_delay = ines_t1_delay,
.return_to_local = ines_return_to_local,
};
gpib_interface_t ines_pci_accel_interface = {
name: "ines_pci_accel",
attach : ines_pci_accel_attach,
detach : ines_pci_detach,
read : ines_accel_read,
write : ines_accel_write,
command : ines_command,
take_control : ines_take_control,
go_to_standby : ines_go_to_standby,
request_system_control : ines_request_system_control,
interface_clear : ines_interface_clear,
remote_enable : ines_remote_enable,
enable_eos : ines_enable_eos,
disable_eos : ines_disable_eos,
parallel_poll : ines_parallel_poll,
parallel_poll_configure : ines_parallel_poll_configure,
parallel_poll_response : ines_parallel_poll_response,
local_parallel_poll_mode : NULL, // XXX
line_status : ines_line_status,
update_status : ines_update_status,
primary_address : ines_primary_address,
secondary_address : ines_secondary_address,
serial_poll_response : ines_serial_poll_response,
serial_poll_status : ines_serial_poll_status,
t1_delay : ines_t1_delay,
return_to_local : ines_return_to_local,
static gpib_interface_t ines_pci_accel_interface = {
.name = "ines_pci_accel",
.attach = ines_pci_accel_attach,
.detach = ines_pci_detach,
.read = ines_accel_read,
.write = ines_accel_write,
.command = ines_command,
.take_control = ines_take_control,
.go_to_standby = ines_go_to_standby,
.request_system_control = ines_request_system_control,
.interface_clear = ines_interface_clear,
.remote_enable = ines_remote_enable,
.enable_eos = ines_enable_eos,
.disable_eos = ines_disable_eos,
.parallel_poll = ines_parallel_poll,
.parallel_poll_configure = ines_parallel_poll_configure,
.parallel_poll_response = ines_parallel_poll_response,
.local_parallel_poll_mode = NULL, // XXX
.line_status = ines_line_status,
.update_status = ines_update_status,
.primary_address = ines_primary_address,
.secondary_address = ines_secondary_address,
.serial_poll_response = ines_serial_poll_response,
.serial_poll_status = ines_serial_poll_status,
.t1_delay = ines_t1_delay,
.return_to_local = ines_return_to_local,
};
gpib_interface_t ines_isa_interface = {
name: "ines_isa",
attach : ines_isa_attach,
detach : ines_isa_detach,
read : ines_accel_read,
write : ines_accel_write,
command : ines_command,
take_control : ines_take_control,
go_to_standby : ines_go_to_standby,
request_system_control : ines_request_system_control,
interface_clear : ines_interface_clear,
remote_enable : ines_remote_enable,
enable_eos : ines_enable_eos,
disable_eos : ines_disable_eos,
parallel_poll : ines_parallel_poll,
parallel_poll_configure : ines_parallel_poll_configure,
parallel_poll_response : ines_parallel_poll_response,
local_parallel_poll_mode : NULL, // XXX
line_status : ines_line_status,
update_status : ines_update_status,
primary_address : ines_primary_address,
secondary_address : ines_secondary_address,
serial_poll_response : ines_serial_poll_response,
serial_poll_status : ines_serial_poll_status,
t1_delay : ines_t1_delay,
return_to_local : ines_return_to_local,
static gpib_interface_t ines_isa_interface = {
.name = "ines_isa",
.attach = ines_isa_attach,
.detach = ines_isa_detach,
.read = ines_accel_read,
.write = ines_accel_write,
.command = ines_command,
.take_control = ines_take_control,
.go_to_standby = ines_go_to_standby,
.request_system_control = ines_request_system_control,
.interface_clear = ines_interface_clear,
.remote_enable = ines_remote_enable,
.enable_eos = ines_enable_eos,
.disable_eos = ines_disable_eos,
.parallel_poll = ines_parallel_poll,
.parallel_poll_configure = ines_parallel_poll_configure,
.parallel_poll_response = ines_parallel_poll_response,
.local_parallel_poll_mode = NULL, // XXX
.line_status = ines_line_status,
.update_status = ines_update_status,
.primary_address = ines_primary_address,
.secondary_address = ines_secondary_address,
.serial_poll_response = ines_serial_poll_response,
.serial_poll_status = ines_serial_poll_status,
.t1_delay = ines_t1_delay,
.return_to_local = ines_return_to_local,
};
static int ines_allocate_private(gpib_board_t *board)
@ -1122,7 +1122,7 @@ static int ines_gpib_config(struct pcmcia_device *link)
{
struct local_info *dev;
int retval;
void *virt;
void __iomem *virt;
dev = link->priv;
DEBUG(0, "%s(0x%p)\n", __func__, link);
@ -1156,7 +1156,7 @@ static int ines_gpib_config(struct pcmcia_device *link)
}
virt = ioremap(link->resource[2]->start, resource_size(link->resource[2]));
writeb((link->resource[2]->start >> 2) & 0xff, virt + 0xf0); // IOWindow base
iounmap((void *)virt);
iounmap(virt);
/*
* This actually configures the PCMCIA socket -- setting up
@ -1227,100 +1227,94 @@ static struct pcmcia_driver ines_gpib_cs_driver = {
.resume = ines_gpib_resume,
};
int ines_pcmcia_init_module(void)
{
pcmcia_register_driver(&ines_gpib_cs_driver);
return 0;
}
void ines_pcmcia_cleanup_module(void)
{
DEBUG(0, "ines_cs: unloading\n");
pcmcia_unregister_driver(&ines_gpib_cs_driver);
}
gpib_interface_t ines_pcmcia_unaccel_interface = {
name: "ines_pcmcia_unaccel",
attach : ines_pcmcia_attach,
detach : ines_pcmcia_detach,
read : ines_read,
write : ines_write,
command : ines_command,
take_control : ines_take_control,
go_to_standby : ines_go_to_standby,
request_system_control : ines_request_system_control,
interface_clear : ines_interface_clear,
remote_enable : ines_remote_enable,
enable_eos : ines_enable_eos,
disable_eos : ines_disable_eos,
parallel_poll : ines_parallel_poll,
parallel_poll_configure : ines_parallel_poll_configure,
parallel_poll_response : ines_parallel_poll_response,
local_parallel_poll_mode : NULL, // XXX
line_status : ines_line_status,
update_status : ines_update_status,
primary_address : ines_primary_address,
secondary_address : ines_secondary_address,
serial_poll_response : ines_serial_poll_response,
serial_poll_status : ines_serial_poll_status,
t1_delay : ines_t1_delay,
return_to_local : ines_return_to_local,
static gpib_interface_t ines_pcmcia_unaccel_interface = {
.name = "ines_pcmcia_unaccel",
.attach = ines_pcmcia_attach,
.detach = ines_pcmcia_detach,
.read = ines_read,
.write = ines_write,
.command = ines_command,
.take_control = ines_take_control,
.go_to_standby = ines_go_to_standby,
.request_system_control = ines_request_system_control,
.interface_clear = ines_interface_clear,
.remote_enable = ines_remote_enable,
.enable_eos = ines_enable_eos,
.disable_eos = ines_disable_eos,
.parallel_poll = ines_parallel_poll,
.parallel_poll_configure = ines_parallel_poll_configure,
.parallel_poll_response = ines_parallel_poll_response,
.local_parallel_poll_mode = NULL, // XXX
.line_status = ines_line_status,
.update_status = ines_update_status,
.primary_address = ines_primary_address,
.secondary_address = ines_secondary_address,
.serial_poll_response = ines_serial_poll_response,
.serial_poll_status = ines_serial_poll_status,
.t1_delay = ines_t1_delay,
.return_to_local = ines_return_to_local,
};
gpib_interface_t ines_pcmcia_accel_interface = {
name: "ines_pcmcia_accel",
attach : ines_pcmcia_accel_attach,
detach : ines_pcmcia_detach,
read : ines_accel_read,
write : ines_accel_write,
command : ines_command,
take_control : ines_take_control,
go_to_standby : ines_go_to_standby,
request_system_control : ines_request_system_control,
interface_clear : ines_interface_clear,
remote_enable : ines_remote_enable,
enable_eos : ines_enable_eos,
disable_eos : ines_disable_eos,
parallel_poll : ines_parallel_poll,
parallel_poll_configure : ines_parallel_poll_configure,
parallel_poll_response : ines_parallel_poll_response,
local_parallel_poll_mode : NULL, // XXX
line_status : ines_line_status,
update_status : ines_update_status,
primary_address : ines_primary_address,
secondary_address : ines_secondary_address,
serial_poll_response : ines_serial_poll_response,
serial_poll_status : ines_serial_poll_status,
t1_delay : ines_t1_delay,
return_to_local : ines_return_to_local,
static gpib_interface_t ines_pcmcia_accel_interface = {
.name = "ines_pcmcia_accel",
.attach = ines_pcmcia_accel_attach,
.detach = ines_pcmcia_detach,
.read = ines_accel_read,
.write = ines_accel_write,
.command = ines_command,
.take_control = ines_take_control,
.go_to_standby = ines_go_to_standby,
.request_system_control = ines_request_system_control,
.interface_clear = ines_interface_clear,
.remote_enable = ines_remote_enable,
.enable_eos = ines_enable_eos,
.disable_eos = ines_disable_eos,
.parallel_poll = ines_parallel_poll,
.parallel_poll_configure = ines_parallel_poll_configure,
.parallel_poll_response = ines_parallel_poll_response,
.local_parallel_poll_mode = NULL, // XXX
.line_status = ines_line_status,
.update_status = ines_update_status,
.primary_address = ines_primary_address,
.secondary_address = ines_secondary_address,
.serial_poll_response = ines_serial_poll_response,
.serial_poll_status = ines_serial_poll_status,
.t1_delay = ines_t1_delay,
.return_to_local = ines_return_to_local,
};
gpib_interface_t ines_pcmcia_interface = {
name: "ines_pcmcia",
attach : ines_pcmcia_accel_attach,
detach : ines_pcmcia_detach,
read : ines_accel_read,
write : ines_accel_write,
command : ines_command,
take_control : ines_take_control,
go_to_standby : ines_go_to_standby,
request_system_control : ines_request_system_control,
interface_clear : ines_interface_clear,
remote_enable : ines_remote_enable,
enable_eos : ines_enable_eos,
disable_eos : ines_disable_eos,
parallel_poll : ines_parallel_poll,
parallel_poll_configure : ines_parallel_poll_configure,
parallel_poll_response : ines_parallel_poll_response,
local_parallel_poll_mode : NULL, // XXX
line_status : ines_line_status,
update_status : ines_update_status,
primary_address : ines_primary_address,
secondary_address : ines_secondary_address,
serial_poll_response : ines_serial_poll_response,
serial_poll_status : ines_serial_poll_status,
t1_delay : ines_t1_delay,
return_to_local : ines_return_to_local,
static gpib_interface_t ines_pcmcia_interface = {
.name = "ines_pcmcia",
.attach = ines_pcmcia_accel_attach,
.detach = ines_pcmcia_detach,
.read = ines_accel_read,
.write = ines_accel_write,
.command = ines_command,
.take_control = ines_take_control,
.go_to_standby = ines_go_to_standby,
.request_system_control = ines_request_system_control,
.interface_clear = ines_interface_clear,
.remote_enable = ines_remote_enable,
.enable_eos = ines_enable_eos,
.disable_eos = ines_disable_eos,
.parallel_poll = ines_parallel_poll,
.parallel_poll_configure = ines_parallel_poll_configure,
.parallel_poll_response = ines_parallel_poll_response,
.local_parallel_poll_mode = NULL, // XXX
.line_status = ines_line_status,
.update_status = ines_update_status,
.primary_address = ines_primary_address,
.secondary_address = ines_secondary_address,
.serial_poll_response = ines_serial_poll_response,
.serial_poll_status = ines_serial_poll_status,
.t1_delay = ines_t1_delay,
.return_to_local = ines_return_to_local,
};
irqreturn_t ines_pcmcia_interrupt(int irq, void *arg)
@ -1348,8 +1342,8 @@ int ines_common_pcmcia_attach(gpib_board_t *board)
ines_priv = board->private_data;
nec_priv = &ines_priv->nec7210_priv;
if (request_region(curr_dev->resource[0]->start,
resource_size(curr_dev->resource[0]), "ines_gpib") == 0) {
if (!request_region(curr_dev->resource[0]->start,
resource_size(curr_dev->resource[0]), "ines_gpib")) {
pr_err("ines_gpib: ioports at 0x%lx already in use\n",
(unsigned long)(curr_dev->resource[0]->start));
return -1;
@ -1420,28 +1414,86 @@ void ines_pcmcia_detach(gpib_board_t *board)
static int __init ines_init_module(void)
{
int err = 0;
int ret;
err = pci_register_driver(&ines_pci_driver);
if (err) {
pr_err("ines_gpib: pci_driver_register failed!\n");
return err;
ret = pci_register_driver(&ines_pci_driver);
if (ret) {
pr_err("ines_gpib: pci_register_driver failed: error = %d\n", ret);
return ret;
}
ret = gpib_register_driver(&ines_pci_interface, THIS_MODULE);
if (ret) {
pr_err("ines_gpib: gpib_register_driver failed: error = %d\n", ret);
goto err_pci;
}
ret = gpib_register_driver(&ines_pci_unaccel_interface, THIS_MODULE);
if (ret) {
pr_err("ines_gpib: gpib_register_driver failed: error = %d\n", ret);
goto err_pci_unaccel;
}
ret = gpib_register_driver(&ines_pci_accel_interface, THIS_MODULE);
if (ret) {
pr_err("ines_gpib: gpib_register_driver failed: error = %d\n", ret);
goto err_pci_accel;
}
ret = gpib_register_driver(&ines_isa_interface, THIS_MODULE);
if (ret) {
pr_err("ines_gpib: gpib_register_driver failed: error = %d\n", ret);
goto err_isa;
}
gpib_register_driver(&ines_pci_interface, THIS_MODULE);
gpib_register_driver(&ines_pci_unaccel_interface, THIS_MODULE);
gpib_register_driver(&ines_pci_accel_interface, THIS_MODULE);
gpib_register_driver(&ines_isa_interface, THIS_MODULE);
#ifdef GPIB_PCMCIA
gpib_register_driver(&ines_pcmcia_interface, THIS_MODULE);
gpib_register_driver(&ines_pcmcia_unaccel_interface, THIS_MODULE);
gpib_register_driver(&ines_pcmcia_accel_interface, THIS_MODULE);
err += ines_pcmcia_init_module();
ret = gpib_register_driver(&ines_pcmcia_interface, THIS_MODULE);
if (ret) {
pr_err("ines_gpib: gpib_register_driver failed: error = %d\n", ret);
goto err_pcmcia;
}
ret = gpib_register_driver(&ines_pcmcia_unaccel_interface, THIS_MODULE);
if (ret) {
pr_err("ines_gpib: gpib_register_driver failed: error = %d\n", ret);
goto err_pcmcia_unaccel;
}
ret = gpib_register_driver(&ines_pcmcia_accel_interface, THIS_MODULE);
if (ret) {
pr_err("ines_gpib: gpib_register_driver failed: error = %d\n", ret);
goto err_pcmcia_accel;
}
ret = pcmcia_register_driver(&ines_gpib_cs_driver);
if (ret) {
pr_err("ines_gpib: pcmcia_register_driver failed: error = %d\n", ret);
goto err_pcmcia_driver;
}
#endif
if (err)
return -1;
return 0;
#ifdef GPIB_PCMCIA
err_pcmcia_driver:
gpib_unregister_driver(&ines_pcmcia_accel_interface);
err_pcmcia_accel:
gpib_unregister_driver(&ines_pcmcia_unaccel_interface);
err_pcmcia_unaccel:
gpib_unregister_driver(&ines_pcmcia_interface);
err_pcmcia:
#endif
gpib_unregister_driver(&ines_isa_interface);
err_isa:
gpib_unregister_driver(&ines_pci_accel_interface);
err_pci_accel:
gpib_unregister_driver(&ines_pci_unaccel_interface);
err_pci_unaccel:
gpib_unregister_driver(&ines_pci_interface);
err_pci:
pci_unregister_driver(&ines_pci_driver);
return ret;
}
static void __exit ines_exit_module(void)

View File

@ -10,7 +10,6 @@
/* base module includes */
#include <linux/version.h>
#include <linux/module.h>
#include <linux/sched.h>
#include <linux/init.h>
@ -25,7 +24,6 @@
#include <linux/timer.h>
#include <linux/delay.h>
#include <linux/sched/signal.h>
#include <linux/uaccess.h>
#include <linux/usb.h>
#include "gpibP.h"
@ -1133,33 +1131,33 @@ static unsigned int usb_gpib_t1_delay(gpib_board_t *board, unsigned int nano_sec
* *** module dispatch table and init/exit functions ***
*/
gpib_interface_t usb_gpib_interface = {
name: NAME,
attach : usb_gpib_attach,
detach : usb_gpib_detach,
read : usb_gpib_read,
write : usb_gpib_write,
command : usb_gpib_command,
take_control : usb_gpib_take_control,
go_to_standby : usb_gpib_go_to_standby,
request_system_control : usb_gpib_request_system_control,
interface_clear : usb_gpib_interface_clear,
remote_enable : usb_gpib_remote_enable,
enable_eos : usb_gpib_enable_eos,
disable_eos : usb_gpib_disable_eos,
parallel_poll : usb_gpib_parallel_poll,
parallel_poll_configure : usb_gpib_parallel_poll_configure,
parallel_poll_response : usb_gpib_parallel_poll_response,
local_parallel_poll_mode : NULL, // XXX
line_status : usb_gpib_line_status,
update_status : usb_gpib_update_status,
primary_address : usb_gpib_primary_address,
secondary_address : usb_gpib_secondary_address,
serial_poll_response : usb_gpib_serial_poll_response,
serial_poll_status : usb_gpib_serial_poll_status,
t1_delay : usb_gpib_t1_delay,
return_to_local : usb_gpib_return_to_local,
skip_check_for_command_acceptors : 1
static gpib_interface_t usb_gpib_interface = {
.name = NAME,
.attach = usb_gpib_attach,
.detach = usb_gpib_detach,
.read = usb_gpib_read,
.write = usb_gpib_write,
.command = usb_gpib_command,
.take_control = usb_gpib_take_control,
.go_to_standby = usb_gpib_go_to_standby,
.request_system_control = usb_gpib_request_system_control,
.interface_clear = usb_gpib_interface_clear,
.remote_enable = usb_gpib_remote_enable,
.enable_eos = usb_gpib_enable_eos,
.disable_eos = usb_gpib_disable_eos,
.parallel_poll = usb_gpib_parallel_poll,
.parallel_poll_configure = usb_gpib_parallel_poll_configure,
.parallel_poll_response = usb_gpib_parallel_poll_response,
.local_parallel_poll_mode = NULL, // XXX
.line_status = usb_gpib_line_status,
.update_status = usb_gpib_update_status,
.primary_address = usb_gpib_primary_address,
.secondary_address = usb_gpib_secondary_address,
.serial_poll_response = usb_gpib_serial_poll_response,
.serial_poll_status = usb_gpib_serial_poll_status,
.t1_delay = usb_gpib_t1_delay,
.return_to_local = usb_gpib_return_to_local,
.skip_check_for_command_acceptors = 1
};
/*
@ -1181,7 +1179,11 @@ static int usb_gpib_init_module(struct usb_interface *interface)
return rv;
if (!assigned_usb_minors) {
gpib_register_driver(&usb_gpib_interface, THIS_MODULE);
rv = gpib_register_driver(&usb_gpib_interface, THIS_MODULE);
if (rv) {
pr_err("lpvo_usb_gpib: gpib_register_driver failed: error = %d\n", rv);
goto exit;
}
} else {
/* check if minor is already registered - maybe useless, but if
* it happens the code is inconsistent somewhere
@ -1878,7 +1880,7 @@ static int skel_release(struct inode *inode, struct file *file)
* user space access to read function
*/
static ssize_t skel_read(struct file *file, char *buffer, size_t count,
static ssize_t skel_read(struct file *file, char __user *buffer, size_t count,
loff_t *ppos)
{
struct usb_skel *dev;
@ -1909,7 +1911,7 @@ static ssize_t skel_read(struct file *file, char *buffer, size_t count,
* user space access to write function
*/
static ssize_t skel_write(struct file *file, const char *user_buffer,
static ssize_t skel_write(struct file *file, const char __user *user_buffer,
size_t count, loff_t *ppos)
{
struct usb_skel *dev;

View File

@ -85,7 +85,7 @@ static void ni_usb_bulk_complete(struct urb *urb)
// printk("debug: %s: status=0x%x, error_count=%i, actual_length=%i\n", __func__,
// urb->status, urb->error_count, urb->actual_length);
up(&context->complete);
complete(&context->complete);
}
static void ni_usb_timeout_handler(struct timer_list *t)
@ -94,7 +94,7 @@ static void ni_usb_timeout_handler(struct timer_list *t)
struct ni_usb_urb_ctx *context = &ni_priv->context;
context->timed_out = 1;
up(&context->complete);
complete(&context->complete);
};
// I'm using nonblocking loosely here, it only means -EAGAIN can be returned in certain cases
@ -124,7 +124,7 @@ static int ni_usb_nonblocking_send_bulk_msg(struct ni_usb_priv *ni_priv, void *d
}
usb_dev = interface_to_usbdev(ni_priv->bus_interface);
out_pipe = usb_sndbulkpipe(usb_dev, ni_priv->bulk_out_endpoint);
sema_init(&context->complete, 0);
init_completion(&context->complete);
context->timed_out = 0;
usb_fill_bulk_urb(ni_priv->bulk_urb, usb_dev, out_pipe, data, data_length,
&ni_usb_bulk_complete, context);
@ -143,7 +143,7 @@ static int ni_usb_nonblocking_send_bulk_msg(struct ni_usb_priv *ni_priv, void *d
return retval;
}
mutex_unlock(&ni_priv->bulk_transfer_lock);
down(&context->complete); // wait for ni_usb_bulk_complete
wait_for_completion(&context->complete); // wait for ni_usb_bulk_complete
if (context->timed_out) {
usb_kill_urb(ni_priv->bulk_urb);
dev_err(&usb_dev->dev, "%s: killed urb due to timeout\n", __func__);
@ -210,7 +210,7 @@ static int ni_usb_nonblocking_receive_bulk_msg(struct ni_usb_priv *ni_priv,
}
usb_dev = interface_to_usbdev(ni_priv->bus_interface);
in_pipe = usb_rcvbulkpipe(usb_dev, ni_priv->bulk_in_endpoint);
sema_init(&context->complete, 0);
init_completion(&context->complete);
context->timed_out = 0;
usb_fill_bulk_urb(ni_priv->bulk_urb, usb_dev, in_pipe, data, data_length,
&ni_usb_bulk_complete, context);
@ -231,7 +231,7 @@ static int ni_usb_nonblocking_receive_bulk_msg(struct ni_usb_priv *ni_priv,
}
mutex_unlock(&ni_priv->bulk_transfer_lock);
if (interruptible) {
if (down_interruptible(&context->complete)) {
if (wait_for_completion_interruptible(&context->complete)) {
/* If we got interrupted by a signal while
* waiting for the usb gpib to respond, we
* should send a stop command so it will
@ -243,10 +243,10 @@ static int ni_usb_nonblocking_receive_bulk_msg(struct ni_usb_priv *ni_priv,
/* now do an uninterruptible wait, it shouldn't take long
* for the board to respond now.
*/
down(&context->complete);
wait_for_completion(&context->complete);
}
} else {
down(&context->complete);
wait_for_completion(&context->complete);
}
if (context->timed_out) {
usb_kill_urb(ni_priv->bulk_urb);
@ -783,8 +783,10 @@ static int ni_usb_write(gpib_board_t *board, uint8_t *buffer, size_t length,
}
in_data = kmalloc(in_data_length, GFP_KERNEL);
if (!in_data)
if (!in_data) {
mutex_unlock(&ni_priv->addressed_transfer_lock);
return -ENOMEM;
}
retval = ni_usb_receive_bulk_msg(ni_priv, in_data, in_data_length, &usb_bytes_read,
ni_usb_timeout_msecs(board->usec_timeout), 1);
@ -2351,33 +2353,33 @@ static void ni_usb_detach(gpib_board_t *board)
mutex_unlock(&ni_usb_hotplug_lock);
}
gpib_interface_t ni_usb_gpib_interface = {
name: "ni_usb_b",
attach : ni_usb_attach,
detach : ni_usb_detach,
read : ni_usb_read,
write : ni_usb_write,
command : ni_usb_command,
take_control : ni_usb_take_control,
go_to_standby : ni_usb_go_to_standby,
request_system_control : ni_usb_request_system_control,
interface_clear : ni_usb_interface_clear,
remote_enable : ni_usb_remote_enable,
enable_eos : ni_usb_enable_eos,
disable_eos : ni_usb_disable_eos,
parallel_poll : ni_usb_parallel_poll,
parallel_poll_configure : ni_usb_parallel_poll_configure,
parallel_poll_response : ni_usb_parallel_poll_response,
local_parallel_poll_mode : NULL, // XXX
line_status : ni_usb_line_status,
update_status : ni_usb_update_status,
primary_address : ni_usb_primary_address,
secondary_address : ni_usb_secondary_address,
serial_poll_response : ni_usb_serial_poll_response,
serial_poll_status : ni_usb_serial_poll_status,
t1_delay : ni_usb_t1_delay,
return_to_local : ni_usb_return_to_local,
skip_check_for_command_acceptors : 1
static gpib_interface_t ni_usb_gpib_interface = {
.name = "ni_usb_b",
.attach = ni_usb_attach,
.detach = ni_usb_detach,
.read = ni_usb_read,
.write = ni_usb_write,
.command = ni_usb_command,
.take_control = ni_usb_take_control,
.go_to_standby = ni_usb_go_to_standby,
.request_system_control = ni_usb_request_system_control,
.interface_clear = ni_usb_interface_clear,
.remote_enable = ni_usb_remote_enable,
.enable_eos = ni_usb_enable_eos,
.disable_eos = ni_usb_disable_eos,
.parallel_poll = ni_usb_parallel_poll,
.parallel_poll_configure = ni_usb_parallel_poll_configure,
.parallel_poll_response = ni_usb_parallel_poll_response,
.local_parallel_poll_mode = NULL, // XXX
.line_status = ni_usb_line_status,
.update_status = ni_usb_update_status,
.primary_address = ni_usb_primary_address,
.secondary_address = ni_usb_secondary_address,
.serial_poll_response = ni_usb_serial_poll_response,
.serial_poll_status = ni_usb_serial_poll_status,
.t1_delay = ni_usb_t1_delay,
.return_to_local = ni_usb_return_to_local,
.skip_check_for_command_acceptors = 1
};
// Table with the USB-devices: just now only testing IDs
@ -2619,12 +2621,23 @@ static struct usb_driver ni_usb_bus_driver = {
static int __init ni_usb_init_module(void)
{
int i;
int ret;
pr_info("ni_usb_gpib driver loading\n");
for (i = 0; i < MAX_NUM_NI_USB_INTERFACES; i++)
ni_usb_driver_interfaces[i] = NULL;
usb_register(&ni_usb_bus_driver);
gpib_register_driver(&ni_usb_gpib_interface, THIS_MODULE);
ret = usb_register(&ni_usb_bus_driver);
if (ret) {
pr_err("ni_usb_gpib: usb_register failed: error = %d\n", ret);
return ret;
}
ret = gpib_register_driver(&ni_usb_gpib_interface, THIS_MODULE);
if (ret) {
pr_err("ni_usb_gpib: gpib_register_driver failed: error = %d\n", ret);
return ret;
}
return 0;
}

View File

@ -56,7 +56,7 @@ enum hs_plus_endpoint_addresses {
};
struct ni_usb_urb_ctx {
struct semaphore complete;
struct completion complete;
unsigned timed_out : 1;
};

View File

@ -238,116 +238,116 @@ static void pc2_return_to_local(gpib_board_t *board)
nec7210_return_to_local(board, &priv->nec7210_priv);
}
gpib_interface_t pc2_interface = {
name: "pcII",
attach : pc2_attach,
detach : pc2_detach,
read : pc2_read,
write : pc2_write,
command : pc2_command,
take_control : pc2_take_control,
go_to_standby : pc2_go_to_standby,
request_system_control : pc2_request_system_control,
interface_clear : pc2_interface_clear,
remote_enable : pc2_remote_enable,
enable_eos : pc2_enable_eos,
disable_eos : pc2_disable_eos,
parallel_poll : pc2_parallel_poll,
parallel_poll_configure : pc2_parallel_poll_configure,
parallel_poll_response : pc2_parallel_poll_response,
local_parallel_poll_mode : NULL, // XXX
line_status : NULL,
update_status : pc2_update_status,
primary_address : pc2_primary_address,
secondary_address : pc2_secondary_address,
serial_poll_response : pc2_serial_poll_response,
serial_poll_status : pc2_serial_poll_status,
t1_delay : pc2_t1_delay,
return_to_local : pc2_return_to_local,
static gpib_interface_t pc2_interface = {
.name = "pcII",
.attach = pc2_attach,
.detach = pc2_detach,
.read = pc2_read,
.write = pc2_write,
.command = pc2_command,
.take_control = pc2_take_control,
.go_to_standby = pc2_go_to_standby,
.request_system_control = pc2_request_system_control,
.interface_clear = pc2_interface_clear,
.remote_enable = pc2_remote_enable,
.enable_eos = pc2_enable_eos,
.disable_eos = pc2_disable_eos,
.parallel_poll = pc2_parallel_poll,
.parallel_poll_configure = pc2_parallel_poll_configure,
.parallel_poll_response = pc2_parallel_poll_response,
.local_parallel_poll_mode = NULL, // XXX
.line_status = NULL,
.update_status = pc2_update_status,
.primary_address = pc2_primary_address,
.secondary_address = pc2_secondary_address,
.serial_poll_response = pc2_serial_poll_response,
.serial_poll_status = pc2_serial_poll_status,
.t1_delay = pc2_t1_delay,
.return_to_local = pc2_return_to_local,
};
gpib_interface_t pc2a_interface = {
name: "pcIIa",
attach : pc2a_attach,
detach : pc2a_detach,
read : pc2_read,
write : pc2_write,
command : pc2_command,
take_control : pc2_take_control,
go_to_standby : pc2_go_to_standby,
request_system_control : pc2_request_system_control,
interface_clear : pc2_interface_clear,
remote_enable : pc2_remote_enable,
enable_eos : pc2_enable_eos,
disable_eos : pc2_disable_eos,
parallel_poll : pc2_parallel_poll,
parallel_poll_configure : pc2_parallel_poll_configure,
parallel_poll_response : pc2_parallel_poll_response,
local_parallel_poll_mode : NULL, // XXX
line_status : NULL,
update_status : pc2_update_status,
primary_address : pc2_primary_address,
secondary_address : pc2_secondary_address,
serial_poll_response : pc2_serial_poll_response,
serial_poll_status : pc2_serial_poll_status,
t1_delay : pc2_t1_delay,
return_to_local : pc2_return_to_local,
static gpib_interface_t pc2a_interface = {
.name = "pcIIa",
.attach = pc2a_attach,
.detach = pc2a_detach,
.read = pc2_read,
.write = pc2_write,
.command = pc2_command,
.take_control = pc2_take_control,
.go_to_standby = pc2_go_to_standby,
.request_system_control = pc2_request_system_control,
.interface_clear = pc2_interface_clear,
.remote_enable = pc2_remote_enable,
.enable_eos = pc2_enable_eos,
.disable_eos = pc2_disable_eos,
.parallel_poll = pc2_parallel_poll,
.parallel_poll_configure = pc2_parallel_poll_configure,
.parallel_poll_response = pc2_parallel_poll_response,
.local_parallel_poll_mode = NULL, // XXX
.line_status = NULL,
.update_status = pc2_update_status,
.primary_address = pc2_primary_address,
.secondary_address = pc2_secondary_address,
.serial_poll_response = pc2_serial_poll_response,
.serial_poll_status = pc2_serial_poll_status,
.t1_delay = pc2_t1_delay,
.return_to_local = pc2_return_to_local,
};
gpib_interface_t pc2a_cb7210_interface = {
name: "pcIIa_cb7210",
attach : pc2a_cb7210_attach,
detach : pc2a_detach,
read : pc2_read,
write : pc2_write,
command : pc2_command,
take_control : pc2_take_control,
go_to_standby : pc2_go_to_standby,
request_system_control : pc2_request_system_control,
interface_clear : pc2_interface_clear,
remote_enable : pc2_remote_enable,
enable_eos : pc2_enable_eos,
disable_eos : pc2_disable_eos,
parallel_poll : pc2_parallel_poll,
parallel_poll_configure : pc2_parallel_poll_configure,
parallel_poll_response : pc2_parallel_poll_response,
local_parallel_poll_mode : NULL, // XXX
line_status : NULL, //XXX
update_status : pc2_update_status,
primary_address : pc2_primary_address,
secondary_address : pc2_secondary_address,
serial_poll_response : pc2_serial_poll_response,
serial_poll_status : pc2_serial_poll_status,
t1_delay : pc2_t1_delay,
return_to_local : pc2_return_to_local,
static gpib_interface_t pc2a_cb7210_interface = {
.name = "pcIIa_cb7210",
.attach = pc2a_cb7210_attach,
.detach = pc2a_detach,
.read = pc2_read,
.write = pc2_write,
.command = pc2_command,
.take_control = pc2_take_control,
.go_to_standby = pc2_go_to_standby,
.request_system_control = pc2_request_system_control,
.interface_clear = pc2_interface_clear,
.remote_enable = pc2_remote_enable,
.enable_eos = pc2_enable_eos,
.disable_eos = pc2_disable_eos,
.parallel_poll = pc2_parallel_poll,
.parallel_poll_configure = pc2_parallel_poll_configure,
.parallel_poll_response = pc2_parallel_poll_response,
.local_parallel_poll_mode = NULL, // XXX
.line_status = NULL, //XXX
.update_status = pc2_update_status,
.primary_address = pc2_primary_address,
.secondary_address = pc2_secondary_address,
.serial_poll_response = pc2_serial_poll_response,
.serial_poll_status = pc2_serial_poll_status,
.t1_delay = pc2_t1_delay,
.return_to_local = pc2_return_to_local,
};
gpib_interface_t pc2_2a_interface = {
name: "pcII_IIa",
attach : pc2_2a_attach,
detach : pc2_2a_detach,
read : pc2_read,
write : pc2_write,
command : pc2_command,
take_control : pc2_take_control,
go_to_standby : pc2_go_to_standby,
request_system_control : pc2_request_system_control,
interface_clear : pc2_interface_clear,
remote_enable : pc2_remote_enable,
enable_eos : pc2_enable_eos,
disable_eos : pc2_disable_eos,
parallel_poll : pc2_parallel_poll,
parallel_poll_configure : pc2_parallel_poll_configure,
parallel_poll_response : pc2_parallel_poll_response,
local_parallel_poll_mode : NULL, // XXX
line_status : NULL,
update_status : pc2_update_status,
primary_address : pc2_primary_address,
secondary_address : pc2_secondary_address,
serial_poll_response : pc2_serial_poll_response,
serial_poll_status : pc2_serial_poll_status,
t1_delay : pc2_t1_delay,
return_to_local : pc2_return_to_local,
static gpib_interface_t pc2_2a_interface = {
.name = "pcII_IIa",
.attach = pc2_2a_attach,
.detach = pc2_2a_detach,
.read = pc2_read,
.write = pc2_write,
.command = pc2_command,
.take_control = pc2_take_control,
.go_to_standby = pc2_go_to_standby,
.request_system_control = pc2_request_system_control,
.interface_clear = pc2_interface_clear,
.remote_enable = pc2_remote_enable,
.enable_eos = pc2_enable_eos,
.disable_eos = pc2_disable_eos,
.parallel_poll = pc2_parallel_poll,
.parallel_poll_configure = pc2_parallel_poll_configure,
.parallel_poll_response = pc2_parallel_poll_response,
.local_parallel_poll_mode = NULL, // XXX
.line_status = NULL,
.update_status = pc2_update_status,
.primary_address = pc2_primary_address,
.secondary_address = pc2_secondary_address,
.serial_poll_response = pc2_serial_poll_response,
.serial_poll_status = pc2_serial_poll_status,
.t1_delay = pc2_t1_delay,
.return_to_local = pc2_return_to_local,
};
static int allocate_private(gpib_board_t *board)
@ -426,7 +426,7 @@ int pc2_attach(gpib_board_t *board, const gpib_board_config_t *config)
nec_priv = &pc2_priv->nec7210_priv;
nec_priv->offset = pc2_reg_offset;
if (request_region(config->ibbase, pc2_iosize, "pc2") == 0) {
if (!request_region(config->ibbase, pc2_iosize, "pc2")) {
pr_err("gpib: ioports are already in use\n");
return -1;
}
@ -635,12 +635,42 @@ void pc2_2a_detach(gpib_board_t *board)
static int __init pc2_init_module(void)
{
gpib_register_driver(&pc2_interface, THIS_MODULE);
gpib_register_driver(&pc2a_interface, THIS_MODULE);
gpib_register_driver(&pc2a_cb7210_interface, THIS_MODULE);
gpib_register_driver(&pc2_2a_interface, THIS_MODULE);
int ret;
ret = gpib_register_driver(&pc2_interface, THIS_MODULE);
if (ret) {
pr_err("pc2_gpib: gpib_register_driver failed: error = %d\n", ret);
return ret;
}
ret = gpib_register_driver(&pc2a_interface, THIS_MODULE);
if (ret) {
pr_err("pc2_gpib: gpib_register_driver failed: error = %d\n", ret);
goto err_pc2a;
}
ret = gpib_register_driver(&pc2a_cb7210_interface, THIS_MODULE);
if (ret) {
pr_err("pc2_gpib: gpib_register_driver failed: error = %d\n", ret);
goto err_cb7210;
}
ret = gpib_register_driver(&pc2_2a_interface, THIS_MODULE);
if (ret) {
pr_err("pc2_gpib: gpib_register_driver failed: error = %d\n", ret);
goto err_pc2_2a;
}
return 0;
err_pc2_2a:
gpib_unregister_driver(&pc2a_cb7210_interface);
err_cb7210:
gpib_unregister_driver(&pc2a_interface);
err_pc2a:
gpib_unregister_driver(&pc2_interface);
return ret;
}
static void __exit pc2_exit_module(void)

View File

@ -1,4 +1,4 @@
// SPDX-License-Identifier: GPL-2
// SPDX-License-Identifier: GPL-2.0-only
/*
* Hardware driver for NI Mite PCI interface chip,

View File

@ -1,4 +1,4 @@
/* SPDX-License-Identifier: GPL-2 */
/* SPDX-License-Identifier: GPL-2.0-only */
/*
* Hardware driver for NI Mite PCI interface chip

View File

@ -116,7 +116,7 @@ static inline void tnt_paged_writeb(struct tnt4882_priv *priv, unsigned int valu
/* readb/writeb wrappers */
static inline unsigned short tnt_readb(struct tnt4882_priv *priv, unsigned long offset)
{
void *address = priv->nec7210_priv.mmiobase + offset;
void __iomem *address = priv->nec7210_priv.mmiobase + offset;
unsigned long flags;
unsigned short retval;
spinlock_t *register_lock = &priv->nec7210_priv.register_page_lock;
@ -154,7 +154,7 @@ static inline unsigned short tnt_readb(struct tnt4882_priv *priv, unsigned long
static inline void tnt_writeb(struct tnt4882_priv *priv, unsigned short value, unsigned long offset)
{
void *address = priv->nec7210_priv.mmiobase + offset;
void __iomem *address = priv->nec7210_priv.mmiobase + offset;
unsigned long flags;
spinlock_t *register_lock = &priv->nec7210_priv.register_page_lock;
@ -890,285 +890,285 @@ void tnt4882_return_to_local(gpib_board_t *board)
nec7210_return_to_local(board, &priv->nec7210_priv);
}
gpib_interface_t ni_pci_interface = {
name: "ni_pci",
attach : ni_pci_attach,
detach : ni_pci_detach,
read : tnt4882_accel_read,
write : tnt4882_accel_write,
command : tnt4882_command,
take_control : tnt4882_take_control,
go_to_standby : tnt4882_go_to_standby,
request_system_control : tnt4882_request_system_control,
interface_clear : tnt4882_interface_clear,
remote_enable : tnt4882_remote_enable,
enable_eos : tnt4882_enable_eos,
disable_eos : tnt4882_disable_eos,
parallel_poll : tnt4882_parallel_poll,
parallel_poll_configure : tnt4882_parallel_poll_configure,
parallel_poll_response : tnt4882_parallel_poll_response,
local_parallel_poll_mode : NULL, // XXX
line_status : tnt4882_line_status,
update_status : tnt4882_update_status,
primary_address : tnt4882_primary_address,
secondary_address : tnt4882_secondary_address,
serial_poll_response2 : tnt4882_serial_poll_response2,
serial_poll_status : tnt4882_serial_poll_status,
t1_delay : tnt4882_t1_delay,
return_to_local : tnt4882_return_to_local,
static gpib_interface_t ni_pci_interface = {
.name = "ni_pci",
.attach = ni_pci_attach,
.detach = ni_pci_detach,
.read = tnt4882_accel_read,
.write = tnt4882_accel_write,
.command = tnt4882_command,
.take_control = tnt4882_take_control,
.go_to_standby = tnt4882_go_to_standby,
.request_system_control = tnt4882_request_system_control,
.interface_clear = tnt4882_interface_clear,
.remote_enable = tnt4882_remote_enable,
.enable_eos = tnt4882_enable_eos,
.disable_eos = tnt4882_disable_eos,
.parallel_poll = tnt4882_parallel_poll,
.parallel_poll_configure = tnt4882_parallel_poll_configure,
.parallel_poll_response = tnt4882_parallel_poll_response,
.local_parallel_poll_mode = NULL, // XXX
.line_status = tnt4882_line_status,
.update_status = tnt4882_update_status,
.primary_address = tnt4882_primary_address,
.secondary_address = tnt4882_secondary_address,
.serial_poll_response2 = tnt4882_serial_poll_response2,
.serial_poll_status = tnt4882_serial_poll_status,
.t1_delay = tnt4882_t1_delay,
.return_to_local = tnt4882_return_to_local,
};
gpib_interface_t ni_pci_accel_interface = {
name: "ni_pci_accel",
attach : ni_pci_attach,
detach : ni_pci_detach,
read : tnt4882_accel_read,
write : tnt4882_accel_write,
command : tnt4882_command,
take_control : tnt4882_take_control,
go_to_standby : tnt4882_go_to_standby,
request_system_control : tnt4882_request_system_control,
interface_clear : tnt4882_interface_clear,
remote_enable : tnt4882_remote_enable,
enable_eos : tnt4882_enable_eos,
disable_eos : tnt4882_disable_eos,
parallel_poll : tnt4882_parallel_poll,
parallel_poll_configure : tnt4882_parallel_poll_configure,
parallel_poll_response : tnt4882_parallel_poll_response,
local_parallel_poll_mode : NULL, // XXX
line_status : tnt4882_line_status,
update_status : tnt4882_update_status,
primary_address : tnt4882_primary_address,
secondary_address : tnt4882_secondary_address,
serial_poll_response2 : tnt4882_serial_poll_response2,
serial_poll_status : tnt4882_serial_poll_status,
t1_delay : tnt4882_t1_delay,
return_to_local : tnt4882_return_to_local,
static gpib_interface_t ni_pci_accel_interface = {
.name = "ni_pci_accel",
.attach = ni_pci_attach,
.detach = ni_pci_detach,
.read = tnt4882_accel_read,
.write = tnt4882_accel_write,
.command = tnt4882_command,
.take_control = tnt4882_take_control,
.go_to_standby = tnt4882_go_to_standby,
.request_system_control = tnt4882_request_system_control,
.interface_clear = tnt4882_interface_clear,
.remote_enable = tnt4882_remote_enable,
.enable_eos = tnt4882_enable_eos,
.disable_eos = tnt4882_disable_eos,
.parallel_poll = tnt4882_parallel_poll,
.parallel_poll_configure = tnt4882_parallel_poll_configure,
.parallel_poll_response = tnt4882_parallel_poll_response,
.local_parallel_poll_mode = NULL, // XXX
.line_status = tnt4882_line_status,
.update_status = tnt4882_update_status,
.primary_address = tnt4882_primary_address,
.secondary_address = tnt4882_secondary_address,
.serial_poll_response2 = tnt4882_serial_poll_response2,
.serial_poll_status = tnt4882_serial_poll_status,
.t1_delay = tnt4882_t1_delay,
.return_to_local = tnt4882_return_to_local,
};
gpib_interface_t ni_isa_interface = {
name: "ni_isa",
attach : ni_tnt_isa_attach,
detach : ni_isa_detach,
read : tnt4882_accel_read,
write : tnt4882_accel_write,
command : tnt4882_command,
take_control : tnt4882_take_control,
go_to_standby : tnt4882_go_to_standby,
request_system_control : tnt4882_request_system_control,
interface_clear : tnt4882_interface_clear,
remote_enable : tnt4882_remote_enable,
enable_eos : tnt4882_enable_eos,
disable_eos : tnt4882_disable_eos,
parallel_poll : tnt4882_parallel_poll,
parallel_poll_configure : tnt4882_parallel_poll_configure,
parallel_poll_response : tnt4882_parallel_poll_response,
local_parallel_poll_mode : NULL, // XXX
line_status : tnt4882_line_status,
update_status : tnt4882_update_status,
primary_address : tnt4882_primary_address,
secondary_address : tnt4882_secondary_address,
serial_poll_response2 : tnt4882_serial_poll_response2,
serial_poll_status : tnt4882_serial_poll_status,
t1_delay : tnt4882_t1_delay,
return_to_local : tnt4882_return_to_local,
static gpib_interface_t ni_isa_interface = {
.name = "ni_isa",
.attach = ni_tnt_isa_attach,
.detach = ni_isa_detach,
.read = tnt4882_accel_read,
.write = tnt4882_accel_write,
.command = tnt4882_command,
.take_control = tnt4882_take_control,
.go_to_standby = tnt4882_go_to_standby,
.request_system_control = tnt4882_request_system_control,
.interface_clear = tnt4882_interface_clear,
.remote_enable = tnt4882_remote_enable,
.enable_eos = tnt4882_enable_eos,
.disable_eos = tnt4882_disable_eos,
.parallel_poll = tnt4882_parallel_poll,
.parallel_poll_configure = tnt4882_parallel_poll_configure,
.parallel_poll_response = tnt4882_parallel_poll_response,
.local_parallel_poll_mode = NULL, // XXX
.line_status = tnt4882_line_status,
.update_status = tnt4882_update_status,
.primary_address = tnt4882_primary_address,
.secondary_address = tnt4882_secondary_address,
.serial_poll_response2 = tnt4882_serial_poll_response2,
.serial_poll_status = tnt4882_serial_poll_status,
.t1_delay = tnt4882_t1_delay,
.return_to_local = tnt4882_return_to_local,
};
gpib_interface_t ni_nat4882_isa_interface = {
name: "ni_nat4882_isa",
attach : ni_nat4882_isa_attach,
detach : ni_isa_detach,
read : tnt4882_read,
write : tnt4882_write,
command : tnt4882_command_unaccel,
take_control : tnt4882_take_control,
go_to_standby : tnt4882_go_to_standby,
request_system_control : tnt4882_request_system_control,
interface_clear : tnt4882_interface_clear,
remote_enable : tnt4882_remote_enable,
enable_eos : tnt4882_enable_eos,
disable_eos : tnt4882_disable_eos,
parallel_poll : tnt4882_parallel_poll,
parallel_poll_configure : tnt4882_parallel_poll_configure,
parallel_poll_response : tnt4882_parallel_poll_response,
local_parallel_poll_mode : NULL, // XXX
line_status : tnt4882_line_status,
update_status : tnt4882_update_status,
primary_address : tnt4882_primary_address,
secondary_address : tnt4882_secondary_address,
serial_poll_response2 : tnt4882_serial_poll_response2,
serial_poll_status : tnt4882_serial_poll_status,
t1_delay : tnt4882_t1_delay,
return_to_local : tnt4882_return_to_local,
static gpib_interface_t ni_nat4882_isa_interface = {
.name = "ni_nat4882_isa",
.attach = ni_nat4882_isa_attach,
.detach = ni_isa_detach,
.read = tnt4882_read,
.write = tnt4882_write,
.command = tnt4882_command_unaccel,
.take_control = tnt4882_take_control,
.go_to_standby = tnt4882_go_to_standby,
.request_system_control = tnt4882_request_system_control,
.interface_clear = tnt4882_interface_clear,
.remote_enable = tnt4882_remote_enable,
.enable_eos = tnt4882_enable_eos,
.disable_eos = tnt4882_disable_eos,
.parallel_poll = tnt4882_parallel_poll,
.parallel_poll_configure = tnt4882_parallel_poll_configure,
.parallel_poll_response = tnt4882_parallel_poll_response,
.local_parallel_poll_mode = NULL, // XXX
.line_status = tnt4882_line_status,
.update_status = tnt4882_update_status,
.primary_address = tnt4882_primary_address,
.secondary_address = tnt4882_secondary_address,
.serial_poll_response2 = tnt4882_serial_poll_response2,
.serial_poll_status = tnt4882_serial_poll_status,
.t1_delay = tnt4882_t1_delay,
.return_to_local = tnt4882_return_to_local,
};
gpib_interface_t ni_nec_isa_interface = {
name: "ni_nec_isa",
attach : ni_nec_isa_attach,
detach : ni_isa_detach,
read : tnt4882_read,
write : tnt4882_write,
command : tnt4882_command_unaccel,
take_control : tnt4882_take_control,
go_to_standby : tnt4882_go_to_standby,
request_system_control : tnt4882_request_system_control,
interface_clear : tnt4882_interface_clear,
remote_enable : tnt4882_remote_enable,
enable_eos : tnt4882_enable_eos,
disable_eos : tnt4882_disable_eos,
parallel_poll : tnt4882_parallel_poll,
parallel_poll_configure : tnt4882_parallel_poll_configure,
parallel_poll_response : tnt4882_parallel_poll_response,
local_parallel_poll_mode : NULL, // XXX
line_status : NULL,
update_status : tnt4882_update_status,
primary_address : tnt4882_primary_address,
secondary_address : tnt4882_secondary_address,
serial_poll_response : tnt4882_serial_poll_response,
serial_poll_status : tnt4882_serial_poll_status,
t1_delay : tnt4882_t1_delay,
return_to_local : tnt4882_return_to_local,
static gpib_interface_t ni_nec_isa_interface = {
.name = "ni_nec_isa",
.attach = ni_nec_isa_attach,
.detach = ni_isa_detach,
.read = tnt4882_read,
.write = tnt4882_write,
.command = tnt4882_command_unaccel,
.take_control = tnt4882_take_control,
.go_to_standby = tnt4882_go_to_standby,
.request_system_control = tnt4882_request_system_control,
.interface_clear = tnt4882_interface_clear,
.remote_enable = tnt4882_remote_enable,
.enable_eos = tnt4882_enable_eos,
.disable_eos = tnt4882_disable_eos,
.parallel_poll = tnt4882_parallel_poll,
.parallel_poll_configure = tnt4882_parallel_poll_configure,
.parallel_poll_response = tnt4882_parallel_poll_response,
.local_parallel_poll_mode = NULL, // XXX
.line_status = NULL,
.update_status = tnt4882_update_status,
.primary_address = tnt4882_primary_address,
.secondary_address = tnt4882_secondary_address,
.serial_poll_response = tnt4882_serial_poll_response,
.serial_poll_status = tnt4882_serial_poll_status,
.t1_delay = tnt4882_t1_delay,
.return_to_local = tnt4882_return_to_local,
};
gpib_interface_t ni_isa_accel_interface = {
name: "ni_isa_accel",
attach : ni_tnt_isa_attach,
detach : ni_isa_detach,
read : tnt4882_accel_read,
write : tnt4882_accel_write,
command : tnt4882_command,
take_control : tnt4882_take_control,
go_to_standby : tnt4882_go_to_standby,
request_system_control : tnt4882_request_system_control,
interface_clear : tnt4882_interface_clear,
remote_enable : tnt4882_remote_enable,
enable_eos : tnt4882_enable_eos,
disable_eos : tnt4882_disable_eos,
parallel_poll : tnt4882_parallel_poll,
parallel_poll_configure : tnt4882_parallel_poll_configure,
parallel_poll_response : tnt4882_parallel_poll_response,
local_parallel_poll_mode : NULL, // XXX
line_status : tnt4882_line_status,
update_status : tnt4882_update_status,
primary_address : tnt4882_primary_address,
secondary_address : tnt4882_secondary_address,
serial_poll_response2 : tnt4882_serial_poll_response2,
serial_poll_status : tnt4882_serial_poll_status,
t1_delay : tnt4882_t1_delay,
return_to_local : tnt4882_return_to_local,
static gpib_interface_t ni_isa_accel_interface = {
.name = "ni_isa_accel",
.attach = ni_tnt_isa_attach,
.detach = ni_isa_detach,
.read = tnt4882_accel_read,
.write = tnt4882_accel_write,
.command = tnt4882_command,
.take_control = tnt4882_take_control,
.go_to_standby = tnt4882_go_to_standby,
.request_system_control = tnt4882_request_system_control,
.interface_clear = tnt4882_interface_clear,
.remote_enable = tnt4882_remote_enable,
.enable_eos = tnt4882_enable_eos,
.disable_eos = tnt4882_disable_eos,
.parallel_poll = tnt4882_parallel_poll,
.parallel_poll_configure = tnt4882_parallel_poll_configure,
.parallel_poll_response = tnt4882_parallel_poll_response,
.local_parallel_poll_mode = NULL, // XXX
.line_status = tnt4882_line_status,
.update_status = tnt4882_update_status,
.primary_address = tnt4882_primary_address,
.secondary_address = tnt4882_secondary_address,
.serial_poll_response2 = tnt4882_serial_poll_response2,
.serial_poll_status = tnt4882_serial_poll_status,
.t1_delay = tnt4882_t1_delay,
.return_to_local = tnt4882_return_to_local,
};
gpib_interface_t ni_nat4882_isa_accel_interface = {
name: "ni_nat4882_isa_accel",
attach : ni_nat4882_isa_attach,
detach : ni_isa_detach,
read : tnt4882_accel_read,
write : tnt4882_accel_write,
command : tnt4882_command_unaccel,
take_control : tnt4882_take_control,
go_to_standby : tnt4882_go_to_standby,
request_system_control : tnt4882_request_system_control,
interface_clear : tnt4882_interface_clear,
remote_enable : tnt4882_remote_enable,
enable_eos : tnt4882_enable_eos,
disable_eos : tnt4882_disable_eos,
parallel_poll : tnt4882_parallel_poll,
parallel_poll_configure : tnt4882_parallel_poll_configure,
parallel_poll_response : tnt4882_parallel_poll_response,
local_parallel_poll_mode : NULL, // XXX
line_status : tnt4882_line_status,
update_status : tnt4882_update_status,
primary_address : tnt4882_primary_address,
secondary_address : tnt4882_secondary_address,
serial_poll_response2 : tnt4882_serial_poll_response2,
serial_poll_status : tnt4882_serial_poll_status,
t1_delay : tnt4882_t1_delay,
return_to_local : tnt4882_return_to_local,
static gpib_interface_t ni_nat4882_isa_accel_interface = {
.name = "ni_nat4882_isa_accel",
.attach = ni_nat4882_isa_attach,
.detach = ni_isa_detach,
.read = tnt4882_accel_read,
.write = tnt4882_accel_write,
.command = tnt4882_command_unaccel,
.take_control = tnt4882_take_control,
.go_to_standby = tnt4882_go_to_standby,
.request_system_control = tnt4882_request_system_control,
.interface_clear = tnt4882_interface_clear,
.remote_enable = tnt4882_remote_enable,
.enable_eos = tnt4882_enable_eos,
.disable_eos = tnt4882_disable_eos,
.parallel_poll = tnt4882_parallel_poll,
.parallel_poll_configure = tnt4882_parallel_poll_configure,
.parallel_poll_response = tnt4882_parallel_poll_response,
.local_parallel_poll_mode = NULL, // XXX
.line_status = tnt4882_line_status,
.update_status = tnt4882_update_status,
.primary_address = tnt4882_primary_address,
.secondary_address = tnt4882_secondary_address,
.serial_poll_response2 = tnt4882_serial_poll_response2,
.serial_poll_status = tnt4882_serial_poll_status,
.t1_delay = tnt4882_t1_delay,
.return_to_local = tnt4882_return_to_local,
};
gpib_interface_t ni_nec_isa_accel_interface = {
name: "ni_nec_isa_accel",
attach : ni_nec_isa_attach,
detach : ni_isa_detach,
read : tnt4882_accel_read,
write : tnt4882_accel_write,
command : tnt4882_command_unaccel,
take_control : tnt4882_take_control,
go_to_standby : tnt4882_go_to_standby,
request_system_control : tnt4882_request_system_control,
interface_clear : tnt4882_interface_clear,
remote_enable : tnt4882_remote_enable,
enable_eos : tnt4882_enable_eos,
disable_eos : tnt4882_disable_eos,
parallel_poll : tnt4882_parallel_poll,
parallel_poll_configure : tnt4882_parallel_poll_configure,
parallel_poll_response : tnt4882_parallel_poll_response,
local_parallel_poll_mode : NULL, // XXX
line_status : NULL,
update_status : tnt4882_update_status,
primary_address : tnt4882_primary_address,
secondary_address : tnt4882_secondary_address,
serial_poll_response : tnt4882_serial_poll_response,
serial_poll_status : tnt4882_serial_poll_status,
t1_delay : tnt4882_t1_delay,
return_to_local : tnt4882_return_to_local,
static gpib_interface_t ni_nec_isa_accel_interface = {
.name = "ni_nec_isa_accel",
.attach = ni_nec_isa_attach,
.detach = ni_isa_detach,
.read = tnt4882_accel_read,
.write = tnt4882_accel_write,
.command = tnt4882_command_unaccel,
.take_control = tnt4882_take_control,
.go_to_standby = tnt4882_go_to_standby,
.request_system_control = tnt4882_request_system_control,
.interface_clear = tnt4882_interface_clear,
.remote_enable = tnt4882_remote_enable,
.enable_eos = tnt4882_enable_eos,
.disable_eos = tnt4882_disable_eos,
.parallel_poll = tnt4882_parallel_poll,
.parallel_poll_configure = tnt4882_parallel_poll_configure,
.parallel_poll_response = tnt4882_parallel_poll_response,
.local_parallel_poll_mode = NULL, // XXX
.line_status = NULL,
.update_status = tnt4882_update_status,
.primary_address = tnt4882_primary_address,
.secondary_address = tnt4882_secondary_address,
.serial_poll_response = tnt4882_serial_poll_response,
.serial_poll_status = tnt4882_serial_poll_status,
.t1_delay = tnt4882_t1_delay,
.return_to_local = tnt4882_return_to_local,
};
#ifdef GPIB_PCMCIA
gpib_interface_t ni_pcmcia_interface = {
name: "ni_pcmcia",
attach : ni_pcmcia_attach,
detach : ni_pcmcia_detach,
read : tnt4882_accel_read,
write : tnt4882_accel_write,
command : tnt4882_command,
take_control : tnt4882_take_control,
go_to_standby : tnt4882_go_to_standby,
request_system_control : tnt4882_request_system_control,
interface_clear : tnt4882_interface_clear,
remote_enable : tnt4882_remote_enable,
enable_eos : tnt4882_enable_eos,
disable_eos : tnt4882_disable_eos,
parallel_poll : tnt4882_parallel_poll,
parallel_poll_configure : tnt4882_parallel_poll_configure,
parallel_poll_response : tnt4882_parallel_poll_response,
local_parallel_poll_mode : NULL, // XXX
line_status : tnt4882_line_status,
update_status : tnt4882_update_status,
primary_address : tnt4882_primary_address,
secondary_address : tnt4882_secondary_address,
serial_poll_response : tnt4882_serial_poll_response,
serial_poll_status : tnt4882_serial_poll_status,
t1_delay : tnt4882_t1_delay,
return_to_local : tnt4882_return_to_local,
static gpib_interface_t ni_pcmcia_interface = {
.name = "ni_pcmcia",
.attach = ni_pcmcia_attach,
.detach = ni_pcmcia_detach,
.read = tnt4882_accel_read,
.write = tnt4882_accel_write,
.command = tnt4882_command,
.take_control = tnt4882_take_control,
.go_to_standby = tnt4882_go_to_standby,
.request_system_control = tnt4882_request_system_control,
.interface_clear = tnt4882_interface_clear,
.remote_enable = tnt4882_remote_enable,
.enable_eos = tnt4882_enable_eos,
.disable_eos = tnt4882_disable_eos,
.parallel_poll = tnt4882_parallel_poll,
.parallel_poll_configure = tnt4882_parallel_poll_configure,
.parallel_poll_response = tnt4882_parallel_poll_response,
.local_parallel_poll_mode = NULL, // XXX
.line_status = tnt4882_line_status,
.update_status = tnt4882_update_status,
.primary_address = tnt4882_primary_address,
.secondary_address = tnt4882_secondary_address,
.serial_poll_response = tnt4882_serial_poll_response,
.serial_poll_status = tnt4882_serial_poll_status,
.t1_delay = tnt4882_t1_delay,
.return_to_local = tnt4882_return_to_local,
};
gpib_interface_t ni_pcmcia_accel_interface = {
name: "ni_pcmcia_accel",
attach : ni_pcmcia_attach,
detach : ni_pcmcia_detach,
read : tnt4882_accel_read,
write : tnt4882_accel_write,
command : tnt4882_command,
take_control : tnt4882_take_control,
go_to_standby : tnt4882_go_to_standby,
request_system_control : tnt4882_request_system_control,
interface_clear : tnt4882_interface_clear,
remote_enable : tnt4882_remote_enable,
enable_eos : tnt4882_enable_eos,
disable_eos : tnt4882_disable_eos,
parallel_poll : tnt4882_parallel_poll,
parallel_poll_configure : tnt4882_parallel_poll_configure,
parallel_poll_response : tnt4882_parallel_poll_response,
local_parallel_poll_mode : NULL, // XXX
line_status : tnt4882_line_status,
update_status : tnt4882_update_status,
primary_address : tnt4882_primary_address,
secondary_address : tnt4882_secondary_address,
serial_poll_response : tnt4882_serial_poll_response,
serial_poll_status : tnt4882_serial_poll_status,
t1_delay : tnt4882_t1_delay,
return_to_local : tnt4882_return_to_local,
static gpib_interface_t ni_pcmcia_accel_interface = {
.name = "ni_pcmcia_accel",
.attach = ni_pcmcia_attach,
.detach = ni_pcmcia_detach,
.read = tnt4882_accel_read,
.write = tnt4882_accel_write,
.command = tnt4882_command,
.take_control = tnt4882_take_control,
.go_to_standby = tnt4882_go_to_standby,
.request_system_control = tnt4882_request_system_control,
.interface_clear = tnt4882_interface_clear,
.remote_enable = tnt4882_remote_enable,
.enable_eos = tnt4882_enable_eos,
.disable_eos = tnt4882_disable_eos,
.parallel_poll = tnt4882_parallel_poll,
.parallel_poll_configure = tnt4882_parallel_poll_configure,
.parallel_poll_response = tnt4882_parallel_poll_response,
.local_parallel_poll_mode = NULL, // XXX
.line_status = tnt4882_line_status,
.update_status = tnt4882_update_status,
.primary_address = tnt4882_primary_address,
.secondary_address = tnt4882_secondary_address,
.serial_poll_response = tnt4882_serial_poll_response,
.serial_poll_status = tnt4882_serial_poll_status,
.t1_delay = tnt4882_t1_delay,
.return_to_local = tnt4882_return_to_local,
};
#endif
@ -1516,29 +1516,109 @@ static int __init tnt4882_init_module(void)
result = pci_register_driver(&tnt4882_pci_driver);
if (result) {
pr_err("tnt4882: pci_driver_register failed!\n");
pr_err("tnt4882_gpib: pci_register_driver failed: error = %d\n", result);
return result;
}
gpib_register_driver(&ni_isa_interface, THIS_MODULE);
gpib_register_driver(&ni_isa_accel_interface, THIS_MODULE);
gpib_register_driver(&ni_nat4882_isa_interface, THIS_MODULE);
gpib_register_driver(&ni_nat4882_isa_accel_interface, THIS_MODULE);
gpib_register_driver(&ni_nec_isa_interface, THIS_MODULE);
gpib_register_driver(&ni_nec_isa_accel_interface, THIS_MODULE);
gpib_register_driver(&ni_pci_interface, THIS_MODULE);
gpib_register_driver(&ni_pci_accel_interface, THIS_MODULE);
result = gpib_register_driver(&ni_isa_interface, THIS_MODULE);
if (result) {
pr_err("tnt4882_gpib: gpib_register_driver failed: error = %d\n", result);
goto err_isa;
}
result = gpib_register_driver(&ni_isa_accel_interface, THIS_MODULE);
if (result) {
pr_err("tnt4882_gpib: gpib_register_driver failed: error = %d\n", result);
goto err_isa_accel;
}
result = gpib_register_driver(&ni_nat4882_isa_interface, THIS_MODULE);
if (result) {
pr_err("tnt4882_gpib: gpib_register_driver failed: error = %d\n", result);
goto err_nat4882_isa;
}
result = gpib_register_driver(&ni_nat4882_isa_accel_interface, THIS_MODULE);
if (result) {
pr_err("tnt4882_gpib: gpib_register_driver failed: error = %d\n", result);
goto err_nat4882_isa_accel;
}
result = gpib_register_driver(&ni_nec_isa_interface, THIS_MODULE);
if (result) {
pr_err("tnt4882_gpib: gpib_register_driver failed: error = %d\n", result);
goto err_nec_isa;
}
result = gpib_register_driver(&ni_nec_isa_accel_interface, THIS_MODULE);
if (result) {
pr_err("tnt4882_gpib: gpib_register_driver failed: error = %d\n", result);
goto err_nec_isa_accel;
}
result = gpib_register_driver(&ni_pci_interface, THIS_MODULE);
if (result) {
pr_err("tnt4882_gpib: gpib_register_driver failed: error = %d\n", result);
goto err_pci;
}
result = gpib_register_driver(&ni_pci_accel_interface, THIS_MODULE);
if (result) {
pr_err("tnt4882_gpib: gpib_register_driver failed: error = %d\n", result);
goto err_pci_accel;
}
#ifdef GPIB_PCMCIA
gpib_register_driver(&ni_pcmcia_interface, THIS_MODULE);
gpib_register_driver(&ni_pcmcia_accel_interface, THIS_MODULE);
if (init_ni_gpib_cs() < 0)
return -1;
result = gpib_register_driver(&ni_pcmcia_interface, THIS_MODULE);
if (result) {
pr_err("tnt4882_gpib: gpib_register_driver failed: error = %d\n", result);
goto err_pcmcia;
}
result = gpib_register_driver(&ni_pcmcia_accel_interface, THIS_MODULE);
if (result) {
pr_err("tnt4882_gpib: gpib_register_driver failed: error = %d\n", result);
goto err_pcmcia_accel;
}
result = init_ni_gpib_cs();
if (result) {
pr_err("tnt4882_gpib: pcmcia_register_driver failed: error = %d\n", result);
goto err_pcmcia_driver;
}
#endif
mite_init();
mite_list_devices();
return 0;
#ifdef GPIB_PCMCIA
err_pcmcia_driver:
gpib_unregister_driver(&ni_pcmcia_accel_interface);
err_pcmcia_accel:
gpib_unregister_driver(&ni_pcmcia_interface);
err_pcmcia:
#endif
gpib_unregister_driver(&ni_pci_accel_interface);
err_pci_accel:
gpib_unregister_driver(&ni_pci_interface);
err_pci:
gpib_unregister_driver(&ni_nec_isa_accel_interface);
err_nec_isa_accel:
gpib_unregister_driver(&ni_nec_isa_interface);
err_nec_isa:
gpib_unregister_driver(&ni_nat4882_isa_accel_interface);
err_nat4882_isa_accel:
gpib_unregister_driver(&ni_nat4882_isa_interface);
err_nat4882_isa:
gpib_unregister_driver(&ni_isa_accel_interface);
err_isa_accel:
gpib_unregister_driver(&ni_isa_interface);
err_isa:
pci_unregister_driver(&tnt4882_pci_driver);
return result;
}
static void __exit tnt4882_exit_module(void)
@ -1816,8 +1896,8 @@ int ni_pcmcia_attach(gpib_board_t *board, const gpib_board_config_t *config)
nec_priv->offset = atgpib_reg_offset;
DEBUG(0, "ioport1 window attributes: 0x%lx\n", curr_dev->resource[0]->flags);
if (request_region(curr_dev->resource[0]->start, resource_size(curr_dev->resource[0]),
"tnt4882") == 0) {
if (!request_region(curr_dev->resource[0]->start, resource_size(curr_dev->resource[0]),
"tnt4882")) {
pr_err("gpib: ioports starting at 0x%lx are already in use\n",
(unsigned long)curr_dev->resource[0]->start);
return -EIO;

View File

@ -48,7 +48,6 @@ r8723bs-y = \
hal/HalHWImg8723B_RF.o \
hal/HalPhyRf_8723B.o \
os_dep/ioctl_cfg80211.o \
os_dep/ioctl_linux.o \
os_dep/mlme_linux.o \
os_dep/osdep_service.o \
os_dep/os_intfs.o \

View File

@ -141,12 +141,12 @@ int rtw_init_io_priv(struct adapter *padapter, void (*set_intf_ops)(struct adapt
*/
int rtw_inc_and_chk_continual_io_error(struct dvobj_priv *dvobj)
{
int ret = false;
int value = atomic_inc_return(&dvobj->continual_io_error);
if (value > MAX_CONTINUAL_IO_ERR)
ret = true;
int error_count = atomic_inc_return(&dvobj->continual_io_error);
return ret;
if (error_count > MAX_CONTINUAL_IO_ERR)
return true;
return false;
}
/*

View File

@ -4959,7 +4959,6 @@ void _linked_info_dump(struct adapter *padapter)
rtw_hal_get_def_var(padapter, HW_DEF_RA_INFO_DUMP, &i);
}
}
rtw_hal_set_def_var(padapter, HAL_DEF_DBG_RX_INFO_DUMP, NULL);
}
}

View File

@ -1467,7 +1467,8 @@ struct xmit_buf *rtw_alloc_xmitbuf_ext(struct xmit_priv *pxmitpriv)
pxmitbuf->priv_data = NULL;
pxmitbuf->len = 0;
pxmitbuf->pdata = pxmitbuf->ptail = pxmitbuf->phead;
pxmitbuf->pdata = pxmitbuf->phead;
pxmitbuf->ptail = pxmitbuf->phead;
pxmitbuf->agg_num = 1;
if (pxmitbuf->sctx)
@ -1526,7 +1527,8 @@ struct xmit_buf *rtw_alloc_xmitbuf(struct xmit_priv *pxmitpriv)
pxmitbuf->priv_data = NULL;
pxmitbuf->len = 0;
pxmitbuf->pdata = pxmitbuf->ptail = pxmitbuf->phead;
pxmitbuf->pdata = pxmitbuf->phead;
pxmitbuf->ptail = pxmitbuf->phead;
pxmitbuf->agg_num = 0;
pxmitbuf->pg_num = 0;

View File

@ -682,14 +682,6 @@ u8 SetHalDefVar(
u8 bResult = _SUCCESS;
switch (variable) {
case HAL_DEF_DBG_RX_INFO_DUMP:
if (odm->bLinked) {
#ifdef DBG_RX_SIGNAL_DISPLAY_RAW_DATA
rtw_dump_raw_rssi_info(adapter);
#endif
}
break;
case HW_DEF_ODM_DBG_FLAG:
ODM_CmnInfoUpdate(odm, ODM_CMNINFO_DBG_COMP, *((u64 *)value));
break;
@ -879,53 +871,6 @@ void rtw_hal_check_rxfifo_full(struct adapter *adapter)
}
}
#ifdef DBG_RX_SIGNAL_DISPLAY_RAW_DATA
void rtw_dump_raw_rssi_info(struct adapter *padapter)
{
u8 isCCKrate, rf_path;
struct hal_com_data *pHalData = GET_HAL_DATA(padapter);
struct rx_raw_rssi *psample_pkt_rssi = &padapter->recvpriv.raw_rssi_info;
isCCKrate = psample_pkt_rssi->data_rate <= DESC_RATE11M;
if (isCCKrate)
psample_pkt_rssi->mimo_signal_strength[0] = psample_pkt_rssi->pwdball;
for (rf_path = 0; rf_path < pHalData->NumTotalRFPath; rf_path++) {
if (!isCCKrate) {
netdev_dbg(padapter->pnetdev, ", rx_ofdm_pwr:%d(dBm), rx_ofdm_snr:%d(dB)\n",
psample_pkt_rssi->ofdm_pwr[rf_path],
psample_pkt_rssi->ofdm_snr[rf_path]);
}
}
}
void rtw_store_phy_info(struct adapter *padapter, union recv_frame *prframe)
{
u8 isCCKrate, rf_path;
struct hal_com_data *pHalData = GET_HAL_DATA(padapter);
struct rx_pkt_attrib *pattrib = &prframe->u.hdr.attrib;
struct odm_phy_info *pPhyInfo = (PODM_PHY_INFO_T)(&pattrib->phy_info);
struct rx_raw_rssi *psample_pkt_rssi = &padapter->recvpriv.raw_rssi_info;
psample_pkt_rssi->data_rate = pattrib->data_rate;
isCCKrate = pattrib->data_rate <= DESC_RATE11M;
psample_pkt_rssi->pwdball = pPhyInfo->rx_pwd_ba11;
psample_pkt_rssi->pwr_all = pPhyInfo->recv_signal_power;
for (rf_path = 0; rf_path < pHalData->NumTotalRFPath; rf_path++) {
psample_pkt_rssi->mimo_signal_strength[rf_path] = pPhyInfo->rx_mimo_signal_strength[rf_path];
psample_pkt_rssi->mimo_signal_quality[rf_path] = pPhyInfo->rx_mimo_signal_quality[rf_path];
if (!isCCKrate) {
psample_pkt_rssi->ofdm_pwr[rf_path] = pPhyInfo->RxPwr[rf_path];
psample_pkt_rssi->ofdm_snr[rf_path] = pPhyInfo->RxSNR[rf_path];
}
}
}
#endif
static u32 Array_kfreemap[] = {
0xf8, 0xe,
0xf6, 0xc,

View File

@ -67,8 +67,4 @@ void rtl8723b_process_phy_info(struct adapter *padapter, void *prframe)
/* Check EVM */
/* */
process_link_qual(padapter, precvframe);
#ifdef DBG_RX_SIGNAL_DISPLAY_RAW_DATA
rtw_store_phy_info(padapter, prframe);
#endif
}

View File

@ -149,11 +149,6 @@ bool eqNByte(u8 *str1, u8 *str2, u32 num);
bool GetU1ByteIntegerFromStringInDecimal(char *str, u8 *in);
#ifdef DBG_RX_SIGNAL_DISPLAY_RAW_DATA
void rtw_store_phy_info(struct adapter *padapter, union recv_frame *prframe);
void rtw_dump_raw_rssi_info(struct adapter *padapter);
#endif
#define HWSET_MAX_SIZE 512
void rtw_bb_rf_gain_offset(struct adapter *padapter);

View File

@ -144,7 +144,6 @@ enum hal_def_variable {
HAL_DEF_PCI_AMD_L1_SUPPORT,
HAL_DEF_PCI_ASPM_OSC, /* Support for ASPM OSC, added by Roger, 2013.03.27. */
HAL_DEF_MACID_SLEEP, /* Support for MACID sleep */
HAL_DEF_DBG_RX_INFO_DUMP,
};
enum hal_odm_variable {

View File

@ -47,8 +47,6 @@ u32 rtw_start_drv_threads(struct adapter *padapter);
void rtw_stop_drv_threads(struct adapter *padapter);
void rtw_cancel_all_timer(struct adapter *padapter);
int rtw_ioctl(struct net_device *dev, struct ifreq *rq, int cmd);
int rtw_init_netdev_name(struct net_device *pnetdev, const char *ifname);
struct net_device *rtw_init_netdev(struct adapter *padapter);
void rtw_unregister_netdevs(struct dvobj_priv *dvobj);

View File

@ -89,21 +89,6 @@ struct phy_info {
u8 btCoexPwrAdjust;
};
#ifdef DBG_RX_SIGNAL_DISPLAY_RAW_DATA
struct rx_raw_rssi {
u8 data_rate;
u8 pwdball;
s8 pwr_all;
u8 mimo_signal_strength[4];/* in 0~100 index */
u8 mimo_signal_quality[4];
s8 ofdm_pwr[4];
u8 ofdm_snr[4];
};
#endif
struct rx_pkt_attrib {
u16 pkt_len;
u8 physt;
@ -221,9 +206,6 @@ struct recv_priv {
u8 signal_strength;
u8 signal_qual;
s8 rssi; /* translate_percentage_to_dbm(ptarget_wlan->network.PhyInfo.SignalStrength); */
#ifdef DBG_RX_SIGNAL_DISPLAY_RAW_DATA
struct rx_raw_rssi raw_rssi_info;
#endif
/* s8 rxpwdb; */
s16 noise;
/* int RxSNRdB[2]; */

File diff suppressed because it is too large Load Diff

View File

@ -407,7 +407,6 @@ static const struct net_device_ops rtw_netdev_ops = {
.ndo_select_queue = rtw_select_queue,
.ndo_set_mac_address = rtw_net_set_mac_address,
.ndo_get_stats = rtw_net_get_stats,
.ndo_do_ioctl = rtw_ioctl,
};
int rtw_init_netdev_name(struct net_device *pnetdev, const char *ifname)

View File

@ -761,8 +761,7 @@ static int tsi148_alloc_resource(struct vme_master_resource *image,
goto err_resource;
}
image->kern_base = ioremap(
image->bus_resource.start, size);
image->kern_base = ioremap(image->bus_resource.start, size);
if (!image->kern_base) {
dev_err(tsi148_bridge->parent, "Failed to remap resource\n");
retval = -ENOMEM;