Skip to content
Browse files

[testudo] bring the GPIB driver up to date

Signed-off-by: Christopher Hall <hsw@openmoko.com>
  • Loading branch information...
1 parent 60c4d45 commit e64d7bc47d24bff59db7a4b3ecfcd925d4cf5f19 @hxw hxw committed
View
9 testudo/linux-gpib-svn/.gitignore
@@ -44,9 +44,18 @@ lib/ibConfLex.h
lib/ibConfYacc.c
lib/ibConfYacc.h
+util/linux_flags/Module.markers
util/linux_flags/fake.c
util/linux_flags/fake.ko
util/linux_flags/fake.mod.c
util/linux_flags/flags
test/libgpib_test
+
+modules.order
+
+m4/libtool.m4
+m4/ltoptions.m4
+m4/ltsugar.m4
+m4/ltversion.m4
+m4/lt~obsolete.m4
View
244 testudo/linux-gpib-svn/ChangeLog
@@ -1,3 +1,247 @@
+2009-10-06 17:56 fmhess
+
+ * [r1549] ChangeLog: Updated ChangeLog for 3.2.14 with "svn2cl -i"
+
+2009-10-06 17:52 fmhess
+
+ * [r1548] configure.ac: bumped library age too.
+
+2009-10-06 17:49 fmhess
+
+ * [r1547] configure.ac: Bumped version.
+
+2009-10-06 15:53 fmhess
+
+ * [r1546] drivers/gpib/tnt4882/mite.c: Fix problem with ioremapping
+ wrong size of io memory.
+
+2009-09-23 13:31 fmhess
+
+ * [r1545] drivers/gpib/sys/ibinit.c: We don't need daemonize any
+ more.
+
+2009-09-22 20:14 fmhess
+
+ * [r1544] drivers/gpib/cb7210/cb7210_cs.c,
+ drivers/gpib/ines/ines_cs.c, drivers/gpib/tnt4882/tnt4882_cs.c:
+ Change pcmcia drivers from IRQ_TYPE_EXCLUSIVE to
+ IRQ_TYPE_DYNAMIC_SHARING
+
+2009-09-22 16:07 fmhess
+
+ * [r1543] lib/ibConfYacc.y: Fix some infinite loops that could
+ occur on parsing a gpib.conf with syntax errors.
+ Emit warnings for old gpib.conf files that don't put an "="
+ before boolean
+ values.
+
+2009-09-21 20:43 fmhess
+
+ * [r1542] drivers/gpib/cb7210/cb7210_cs.c,
+ drivers/gpib/ines/ines_cs.c, drivers/gpib/tnt4882/tnt4882_cs.c:
+ Fix null dereference on removal of pcmcia board that was
+ never configured with gpib_config.
+
+2009-09-20 02:36 fmhess
+
+ * [r1540] ChangeLog: Updated ChangeLog with "svn2cl -i"
+
+2009-09-20 01:40 fmhess
+
+ * [r1539] configure.ac: Bumped version.
+
+2009-09-20 01:39 fmhess
+
+ * [r1538] m4/tcl.m4: Added fixed version of tcl.m4 from Debian
+ Lenny, which doesn't
+ exit when tcl is not found.
+
+2009-09-16 19:15 fmhess
+
+ * [r1536] ChangeLog: Updated ChangeLog with "svn2cl -i"
+
+2009-09-16 19:07 fmhess
+
+ * [r1535] Makefile.am: Clean up a few files from distribution
+ tarball.
+
+2009-09-16 18:45 fmhess
+
+ * [r1534] doc/linux-gpib.sgml: Using docbook version 4.5 now
+
+2009-09-16 18:03 fmhess
+
+ * [r1533] configure.ac: Bumped version for 3.2.12 release.
+
+2009-09-16 17:30 fmhess
+
+ * [r1532] language/Makefile.am: Clean up language/perl/Makefile
+ when distclean target it used.
+
+2009-09-16 17:21 fmhess
+
+ * [r1531] drivers/gpib/cb7210/cb7210_cs.c,
+ drivers/gpib/include/pcmcia,
+ drivers/gpib/include/pcmcia/cistpl.h,
+ drivers/gpib/ines/ines_cs.c, drivers/gpib/tnt4882/tnt4882_cs.c:
+ Fixed some PCMCIA compilation problems against 2.6.31 kernel.
+
+2009-09-16 17:20 fmhess
+
+ * [r1530] drivers/gpib/include/amcc5920.h: Fixed some compile
+ warnings.
+
+2009-09-16 17:08 fmhess
+
+ * [r1529] drivers/gpib/sys/osfuncs.c: Added missing include.
+
+2009-09-16 15:23 fmhess
+
+ * [r1528] drivers/gpib/agilent_82357a/agilent_82357a.c,
+ drivers/gpib/ni_usb/ni_usb_gpib.c: Replaced some info() calls
+ with pr_info().
+
+2009-06-08 18:12 fmhess
+
+ * [r1527] configure.ac, language/tcl/Makefile.am, m4/tcl.m4: Fix
+ for TCL detection with Debian Lenny.
+
+2009-06-08 17:36 fmhess
+
+ * [r1526] lib/gpib_config/gpib_config.c: Fixed reading of base
+ address from config file.
+
+2009-03-12 15:25 fmhess
+
+ * [r1525] drivers/gpib/tnt4882/mite.c: Fix reference counting for
+ mite pci devices.
+
+2009-03-12 14:37 fmhess
+
+ * [r1524] lib/gpib_config/gpib_config.c: Removed spurious newline.
+
+2009-03-12 14:24 fmhess
+
+ * [r1523] lib/gpib_config/gpib_config.c: Added --device-file
+ command line option to gpib_config, to make
+ it able to use the tempnode variable when called from a udev
+ rule.
+
+2009-03-07 14:22 fmhess
+
+ * [r1522] drivers/gpib/sys/osinit.c: Patch from Ken McIvor
+ <mcivor@iit.edu>:
+
+ We've heard via a Debian bug report that the module-init-tools
+ authors
+ are pushing to eliminate as many files as possible from `/etc/
+ modprobe.d':
+
+ http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=518241
+
+ The attached patch uses the MODULE_ALIAS_CHARDEV_MAJOR() macro to
+ establish a built-in alias to the gpib_common module, as per
+ their
+ recommendation. I've tested it against Debian "sid" without the
+ `/etc/
+ modprobe.d/gpib' file and everything appears to work fine.
+
+2009-01-24 14:49 fmhess
+
+ * [r1521] drivers/gpib/sys/ibinit.c: Don't give a NULL name string
+ to kthread_run.
+
+2009-01-24 14:30 fmhess
+
+ * [r1520] drivers/gpib/sys/ibinit.c: Make sure autospoll_task is
+ not an error code before using
+ it in iboffline.
+
+2008-12-23 04:54 fmhess
+
+ * [r1519] drivers/gpib/include/gpib_types.h,
+ drivers/gpib/sys/ibinit.c, drivers/gpib/sys/osinit.c: Fixed
+ compilation on 2.6.27 kernel by switching autospoll thread over
+ to
+ use linux/kthread.h. Compiles, otherwise untested.
+
+2008-11-22 02:05 fmhess
+
+ * [r1518] drivers/gpib/ni_usb/ni_usb_gpib.c: Fix for bogus warning
+ from David Farrell <davidjf2001@yahoo.com>
+
+2008-11-03 16:29 fmhess
+
+ * [r1517] doc/linux-gpib.sgml, drivers/gpib/ni_usb/ni_usb_gpib.c,
+ drivers/gpib/ni_usb/ni_usb_gpib.h: Added support for measurement
+ computing usb-488
+
+2008-09-19 02:26 fmhess
+
+ * [r1516] language/python/Gpib.py, language/python/gpibinter.c:
+ Patch from Dan Lenski <dlenski@gmail.com>:
+
+ * fixed error handling to get errno from the right place
+ * __doc__ strings for every function (modeled on the ones Keith
+ had written)
+ * a few function names made less terse:
+ cmd->command
+ tmo->timeout
+ trg->trigger
+ * integer constants for IbaXXXX and IbcXXXX added to the module
+ * all functions--that don't have something else useful to
+ return--return
+ ibsta, just like the C versions
+ * the read() function now puts its result directly into the
+ Python output
+ string, with /no copying/ from a C string to a Python string.
+ This should
+ improve efficiency of large and/or frequent reads.
+
+2008-09-18 00:56 fmhess
+
+ * [r1515] language/python/Makefile.am: Patch from "Benjamin M.
+ Schwartz" <bmschwar@fas.harvard.edu> which makes
+ install of python bindings respect prefix and DESTDIR.
+
+2008-09-16 04:30 fmhess
+
+ * [r1514] language/python/gpibinter.c: Patch from Dan Lenski
+ <dlenski@gmail.com> which undoes accidental
+ rename of module from gpib to _gpib.
+
+2008-09-14 12:58 fmhess
+
+ * [r1513] drivers/gpib/tnt4882/tnt4882_cs.c: Added device id for
+ pcmcia-gpib+
+
+2008-09-14 03:35 fmhess
+
+ * [r1512] language/python/Gpib.py, language/python/gpibinter.c:
+ Decided not to split eos_mode into flags/character in python
+ binding.
+
+2008-09-13 23:58 fmhess
+
+ * [r1511] drivers/gpib/tnt4882/tnt4882_cs.c: Fixed null pointer
+ dereference when an attempt is made to configure
+ an ni pcmcia board that doesn't exist.
+
+2008-09-13 23:21 fmhess
+
+ * [r1510] AUTHORS, language/python/Gpib.py,
+ language/python/gpibinter.c: Update to python binding based on
+ patches from Keith Dart <dart@google.com>
+ and Dan Lenski <dlenski@gmail.com>, and my own changes.
+
+2008-08-31 20:17 fmhess
+
+ * [r1509] doc/linux-gpib.sgml: Updated copyright dates.
+
+2008-08-31 19:34 fmhess
+
+ * [r1507] ChangeLog: Regenerated changed log with "svn2cl -i"
+
2008-08-31 19:10 fmhess
* [r1506] configure.ac: Bumped version for 3.2.11 release.
View
3 testudo/linux-gpib-svn/Makefile.am
@@ -23,5 +23,8 @@ dist-hook:
-find $(distdir) \( -name '*~' -o -name '.#*' \) -exec $(RM) \{\} \;
$(RM) $(distdir)/util/linux_flags/fake.*
$(RM) $(distdir)/util/linux_flags/.*.cmd
+ $(RM) $(distdir)/util/linux_flags/flags
+ $(RM) $(distdir)/util/linux_flags/Module.*
+ $(RM) $(distdir)/util/linux_flags/modules.order
$(RM) -r $(distdir)/util/linux_flags/.tmp_versions
View
1 testudo/linux-gpib-svn/NEWS
@@ -0,0 +1 @@
+automake requires this file
View
9 testudo/linux-gpib-svn/configure.ac
@@ -1,7 +1,7 @@
dnl Process this file with autoconf to produce a configure script.
-AC_INIT([linux-gpib], [3.2.11])
+AC_INIT([linux-gpib], [3.2.14])
# libtool version: current:revision:age
#
# If the library source code has changed at all since the last update, then
@@ -15,7 +15,7 @@ AC_INIT([linux-gpib], [3.2.11])
#
# If any interfaces have been removed since the last public release, then set
# age to 0.
-GPIB_SO_VERSION=1:5:1
+GPIB_SO_VERSION=1:7:1
AC_CONFIG_SRCDIR([drivers/gpib/sys/osfuncs.c])
AM_INIT_AUTOMAKE
AM_MAINTAINER_MODE
@@ -138,7 +138,10 @@ AM_CHECK_PYTHON_HEADERS([],[BIND_PYTHON=no;AC_MSG_NOTICE([python headers not fou
AC_CHECK_HEADER([libguile.h],[],[BIND_GUILE="no";AC_MSG_NOTICE([libguile headers not found, disabling guile binding])])
if test "$BIND_TCL" != "no"; then
-AC_CHECK_HEADER([$TCL_INC_DIR/tcl.h],[],[BIND_TCL="no";AC_MSG_NOTICE([TCL headers not found, disabling TCL binding])])
+SAVE_CPPFLAGS=$CPPFLAGS
+CPPFLAGS="$CPPFLAGS $TCL_INCLUDE_SPEC"
+AC_CHECK_HEADER([tcl.h],[],[BIND_TCL="no";AC_MSG_NOTICE([TCL headers not found, disabling TCL binding])])
+CPPFLAGS=$SAVE_CPPFLAGS
fi
if test "$PHP_CONFIG" != "no"; then
View
2 testudo/linux-gpib-svn/doc/linux-gpib.sgml
@@ -1,4 +1,4 @@
-<!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook V4.2//EN"
+<!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook V4.5//EN"
[
<!ENTITY version SYSTEM "gpib_version.txt">
<!ENTITY license SYSTEM "fdl.xml">
View
5 testudo/linux-gpib-svn/drivers/gpib/agilent_82357a/agilent_82357a.c
@@ -19,6 +19,7 @@
#define _GNU_SOURCE
+#include <linux/kernel.h>
#include <linux/module.h>
#include "agilent_82357a.h"
#include "gpibP.h"
@@ -1540,7 +1541,7 @@ static int __init agilent_82357a_init_module(void)
{
int i;
- info("agilent_82357a_gpib driver loading");
+ 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);
@@ -1551,7 +1552,7 @@ static int __init agilent_82357a_init_module(void)
static void __exit agilent_82357a_exit_module(void)
{
- info("agilent_82357a_gpib driver unloading");
+ pr_info("agilent_82357a_gpib driver unloading");
// printk("%s: enter\n", __FUNCTION__);
gpib_unregister_driver(&agilent_82357a_gpib_interface);
usb_deregister(&agilent_82357a_bus_driver);
View
51 testudo/linux-gpib-svn/drivers/gpib/cb7210/cb7210_cs.c
@@ -60,23 +60,23 @@ static int pc_debug = PCMCIA_DEBUG;
/*====================================================================*/
-static int first_tuple(client_handle_t handle, tuple_t *tuple, cisparse_t *parse)
+static int first_tuple(struct pcmcia_device * handle, tuple_t *tuple, cisparse_t *parse)
{
int i;
i = pcmcia_get_first_tuple(handle, tuple);
- if (i != CS_SUCCESS) return i;
+ if (i != 0) return i;
i = pcmcia_get_tuple_data(handle, tuple);
- if (i != CS_SUCCESS) return i;
- return pcmcia_parse_tuple(handle, tuple, parse);
+ if (i != 0) return i;
+ return PCMCIA_PARSE_TUPLE(tuple, parse);
}
-static int next_tuple(client_handle_t handle, tuple_t *tuple, cisparse_t *parse)
+static int next_tuple(struct pcmcia_device * handle, tuple_t *tuple, cisparse_t *parse)
{
int i;
i = pcmcia_get_next_tuple(handle, tuple);
- if (i != CS_SUCCESS) return i;
+ if (i != 0) return i;
i = pcmcia_get_tuple_data(handle, tuple);
- if (i != CS_SUCCESS) return i;
- return pcmcia_parse_tuple(handle, tuple, parse);
+ if (i != 0) return i;
+ return PCMCIA_PARSE_TUPLE(tuple, parse);
}
/*====================================================================*/
@@ -123,7 +123,7 @@ static struct pcmcia_device *curr_dev = NULL;
structure. We allocate them in the card's private data structure,
because they generally can't be allocated dynamically.
*/
-
+
typedef struct local_info_t {
struct pcmcia_device *p_dev;
gpib_board_t *dev;
@@ -168,7 +168,7 @@ static int cb_gpib_probe( struct pcmcia_device *link )
link->io.IOAddrLines = 10;
/* Interrupt setup */
- link->irq.Attributes = IRQ_TYPE_EXCLUSIVE;
+ link->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING;
link->irq.IRQInfo1 = IRQ_INFO2_VALID|IRQ_LEVEL_ID;
link->irq.Handler = NULL;
link->irq.Instance = NULL;
@@ -205,7 +205,8 @@ static void cb_gpib_remove( struct pcmcia_device *link )
printk("dev_node still registered ???");
//unregister_netdev(dev);
}
- cb_pcmcia_detach(info->dev);
+ if(info->dev)
+ cb_pcmcia_detach(info->dev);
cb_gpib_release(link);
//free_netdev(dev);
@@ -222,7 +223,7 @@ static void cb_gpib_remove( struct pcmcia_device *link )
/*@*/
static void cb_gpib_config( struct pcmcia_device *link )
{
- client_handle_t handle;
+ struct pcmcia_device * handle;
tuple_t tuple;
cisparse_t parse;
local_info_t *dev;
@@ -240,17 +241,17 @@ static void cb_gpib_config( struct pcmcia_device *link )
do {
tuple.DesiredTuple = CISTPL_CONFIG;
i = pcmcia_get_first_tuple(handle, &tuple);
- if (i != CS_SUCCESS) break;
+ if (i != 0) break;
tuple.TupleData = buf;
tuple.TupleDataMax = 64;
tuple.TupleOffset = 0;
i = pcmcia_get_tuple_data(handle, &tuple);
- if (i != CS_SUCCESS) break;
- i = pcmcia_parse_tuple(handle, &tuple, &parse);
- if (i != CS_SUCCESS) break;
+ if (i != 0) break;
+ i = PCMCIA_PARSE_TUPLE(&tuple, &parse);
+ if (i != 0) break;
link->conf.ConfigBase = parse.config.base;
} while (0);
- if (i != CS_SUCCESS) {
+ if (i != 0) {
cs_error(link, ParseTuple, i);
return;
}
@@ -262,7 +263,7 @@ static void cb_gpib_config( struct pcmcia_device *link )
tuple.DesiredTuple = CISTPL_MANFID;
tuple.Attributes = TUPLE_RETURN_COMMON;
- if( first_tuple(handle,&tuple,&parse) == CS_SUCCESS ) {
+ if( first_tuple(handle,&tuple,&parse) == 0 ) {
dev->manfid = parse.manfid.manf;
dev->cardid = parse.manfid.card;
DEBUG(0,"gpib_cs: manufacturer: 0x%x card: 0x%x\n", dev->manfid,dev->cardid);
@@ -271,7 +272,7 @@ static void cb_gpib_config( struct pcmcia_device *link )
tuple.DesiredTuple = CISTPL_CFTABLE_ENTRY;
tuple.Attributes = 0;
- if( first_tuple(handle,&tuple,&parse) == CS_SUCCESS ) {
+ if( first_tuple(handle,&tuple,&parse) == 0 ) {
while(1) {
if( parse.cftable_entry.io.nwin > 0) {
link->io.BasePort1 = parse.cftable_entry.io.win[0].base;
@@ -280,7 +281,7 @@ static void cb_gpib_config( struct pcmcia_device *link )
link->io.NumPorts2 = 0;
link->conf.ConfigIndex = parse.cftable_entry.index;
i = pcmcia_request_io(link, &link->io);
- if (i == CS_SUCCESS) {
+ if (i == 0) {
DEBUG(0, "gpib_cs: base=0x%x len=%d registered\n",
parse.cftable_entry.io.win[0].base,
parse.cftable_entry.io.win[0].len
@@ -288,11 +289,11 @@ static void cb_gpib_config( struct pcmcia_device *link )
break;
}
}
- if ( next_tuple(handle,&tuple,&parse) != CS_SUCCESS ) break;
+ if ( next_tuple(handle,&tuple,&parse) != 0 ) break;
}
- if (i != CS_SUCCESS) {
+ if (i != 0) {
cs_error(link, RequestIO, i);
}
} else {
@@ -304,7 +305,7 @@ static void cb_gpib_config( struct pcmcia_device *link )
actually assign a handler to the interrupt.
*/
i = pcmcia_request_irq(link, &link->irq);
- if (i != CS_SUCCESS) {
+ if (i != 0) {
cs_error(link, RequestIRQ, i);
break;
}
@@ -316,7 +317,7 @@ static void cb_gpib_config( struct pcmcia_device *link )
the I/O windows and the interrupt mapping.
*/
i = pcmcia_request_configuration(link, &link->conf);
- if (i != CS_SUCCESS) {
+ if (i != 0) {
cs_error(link, RequestConfiguration, i);
break;
}
@@ -336,7 +337,7 @@ static void cb_gpib_config( struct pcmcia_device *link )
After a card is removed, gpib_release() will unregister the net
device, and release the PCMCIA configuration. If the device is
still open, this will be postponed until it is closed.
-
+
======================================================================*/
static void cb_gpib_release( struct pcmcia_device *link )
View
8 testudo/linux-gpib-svn/drivers/gpib/include/amcc5920.h
@@ -35,7 +35,7 @@ enum amcc_incsr_bits
static const int bits_per_region = 8;
-extern inline uint32_t amcc_wait_state_bits(unsigned int region, unsigned int num_wait_states)
+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 );
};
@@ -48,17 +48,17 @@ enum amcc_prefetch_bits
PREFETCH_LARGE = 0x18,
};
-extern inline uint32_t amcc_prefetch_bits(unsigned int region, enum amcc_prefetch_bits prefetch)
+static inline uint32_t amcc_prefetch_bits(unsigned int region, enum amcc_prefetch_bits prefetch)
{
return prefetch << ( --region * bits_per_region );
};
-extern inline uint32_t amcc_PTADR_mode_bit(unsigned int region)
+static inline uint32_t amcc_PTADR_mode_bit(unsigned int region)
{
return 0x80 << ( --region * bits_per_region);
};
-extern inline uint32_t amcc_disable_write_fifo_bit(unsigned int region)
+static inline uint32_t amcc_disable_write_fifo_bit(unsigned int region)
{
return 0x20 << ( --region * bits_per_region);
};
View
39 testudo/linux-gpib-svn/drivers/gpib/include/pcmcia/cistpl.h
@@ -0,0 +1,39 @@
+/*
+ * pcmcia/cistpl.h compatibility header
+ */
+/*
+ Copyright (C) 2005-2006 Ian Abbott
+ Copyright (C) 2009 Frank Mori Hess <fmhess@users.sourceforge.net>
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+*/
+
+#ifndef __COMPAT_PCMCIA_CISTPL_H_
+#define __COMPAT_PCMCIA_CISTPL_H_
+
+#include_next <pcmcia/cistpl.h>
+
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,28)
+
+/* pcmcia_parse_tuple() macro only has 2 params for 2.6.28 and later. */
+#define PCMCIA_PARSE_TUPLE(tuple, parse) pccard_parse_tuple(tuple, parse)
+
+#else
+
+#define PCMCIA_PARSE_TUPLE(tuple, parse) pcmcia_parse_tuple(tuple, parse)
+
+#endif
+
+#endif // __COMPAT_PCMCIA_CISTPL_H_
View
51 testudo/linux-gpib-svn/drivers/gpib/ines/ines_cs.c
@@ -46,25 +46,25 @@ static int pc_debug = PCMCIA_DEBUG;
#define DEBUG(n, args...)
#endif
-static int first_tuple(client_handle_t handle, tuple_t *tuple,
+static int first_tuple(struct pcmcia_device * handle, tuple_t *tuple,
cisparse_t *parse)
{
int i;
i = pcmcia_get_first_tuple(handle, tuple);
- if (i != CS_SUCCESS) return i;
+ if (i != 0) return i;
i = pcmcia_get_tuple_data(handle, tuple);
- if (i != CS_SUCCESS) return i;
- return pcmcia_parse_tuple(handle, tuple, parse);
+ if (i != 0) return i;
+ return PCMCIA_PARSE_TUPLE(tuple, parse);
}
-static int next_tuple(client_handle_t handle, tuple_t *tuple,
+static int next_tuple(struct pcmcia_device * handle, tuple_t *tuple,
cisparse_t *parse)
{
int i;
i = pcmcia_get_next_tuple(handle, tuple);
- if (i != CS_SUCCESS) return i;
+ if (i != 0) return i;
i = pcmcia_get_tuple_data(handle, tuple);
- if (i != CS_SUCCESS) return i;
- return pcmcia_parse_tuple(handle, tuple, parse);
+ if (i != 0) return i;
+ return PCMCIA_PARSE_TUPLE(tuple, parse);
}
/*
@@ -155,7 +155,7 @@ static int ines_gpib_probe( struct pcmcia_device *link )
link->io.IOAddrLines = 5;
/* Interrupt setup */
- link->irq.Attributes = IRQ_TYPE_EXCLUSIVE;
+ link->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING;
link->irq.IRQInfo1 = IRQ_INFO2_VALID | IRQ_PULSE_ID;
link->irq.Handler = NULL;
@@ -189,7 +189,8 @@ static void ines_gpib_remove( struct pcmcia_device *link )
printk("dev_node still registered ???");
//unregister_netdev(dev);
}
- ines_pcmcia_detach(info->dev);
+ if(info->dev)
+ ines_pcmcia_detach(info->dev);
ines_gpib_release(link);
//free_netdev(dev);
@@ -223,18 +224,18 @@ static void ines_gpib_config( struct pcmcia_device *link )
do {
tuple.DesiredTuple = CISTPL_CONFIG;
i = pcmcia_get_first_tuple(link, &tuple);
- if (i != CS_SUCCESS) break;
+ if (i != 0) break;
tuple.TupleData = buf;
tuple.TupleDataMax = 64;
tuple.TupleOffset = 0;
i = pcmcia_get_tuple_data(link, &tuple);
- if (i != CS_SUCCESS) break;
- i = pcmcia_parse_tuple(link, &tuple, &parse);
- if (i != CS_SUCCESS) break;
+ if (i != 0) break;
+ i = PCMCIA_PARSE_TUPLE(&tuple, &parse);
+ if (i != 0) break;
link->conf.ConfigBase = parse.config.base;
link->conf.Present = parse.config.rmask[0];
} while (0);
- if (i != CS_SUCCESS) {
+ if (i != 0) {
cs_error(link, ParseTuple, i);
return;
}
@@ -246,7 +247,7 @@ static void ines_gpib_config( struct pcmcia_device *link )
*/
tuple.DesiredTuple = CISTPL_MANFID;
tuple.Attributes = TUPLE_RETURN_COMMON;
- if( first_tuple(link,&tuple,&parse) == CS_SUCCESS ) {
+ if( first_tuple(link,&tuple,&parse) == 0 ) {
dev->manfid = parse.manfid.manf;
dev->cardid = parse.manfid.card;
printk(KERN_DEBUG "ines_cs: manufacturer: 0x%x card: 0x%x\n",
@@ -256,7 +257,7 @@ static void ines_gpib_config( struct pcmcia_device *link )
tuple.DesiredTuple = CISTPL_CFTABLE_ENTRY;
tuple.Attributes = 0;
- if( first_tuple(link,&tuple,&parse) == CS_SUCCESS ) {
+ if( first_tuple(link,&tuple,&parse) == 0 ) {
while(1) {
if( parse.cftable_entry.io.nwin > 0) {
link->io.BasePort1 = parse.cftable_entry.io.win[0].base;
@@ -264,17 +265,17 @@ static void ines_gpib_config( struct pcmcia_device *link )
link->io.BasePort2 = 0;
link->io.NumPorts2 = 0;
i = pcmcia_request_io(link, &link->io);
- if (i == CS_SUCCESS) {
+ if (i == 0) {
printk( KERN_DEBUG "ines_cs: base=0x%x len=%d registered\n",
link->io.BasePort1, link->io.NumPorts1 );
link->conf.ConfigIndex = parse.cftable_entry.index;
break;
}
}
- if ( next_tuple(link,&tuple,&parse) != CS_SUCCESS ) break;
+ if ( next_tuple(link,&tuple,&parse) != 0 ) break;
}
- if (i != CS_SUCCESS) {
+ if (i != 0) {
cs_error(link, RequestIO, i);
}
} else {
@@ -291,14 +292,14 @@ static void ines_gpib_config( struct pcmcia_device *link )
req.Size=0x1000;
req.AccessSpeed=250;
i= pcmcia_request_window(&link, &req, &link->win);
- if (i != CS_SUCCESS) {
+ if (i != 0) {
cs_error(link, RequestWindow, i);
break;
}
mem.CardOffset=0;
mem.Page=0;
i= pcmcia_map_mem_page(link->win, &mem);
- if (i != CS_SUCCESS) {
+ if (i != 0) {
cs_error(link, MapMemPage, i);
break;
}
@@ -314,7 +315,7 @@ static void ines_gpib_config( struct pcmcia_device *link )
if (link->conf.Attributes & CONF_ENABLE_IRQ)
{
i = pcmcia_request_irq(link, &link->irq);
- if (i != CS_SUCCESS) {
+ if (i != 0) {
cs_error(link, RequestIRQ, i);
}
printk(KERN_DEBUG "ines_cs: IRQ_Line=%d\n",link->irq.AssignedIRQ);
@@ -325,12 +326,12 @@ static void ines_gpib_config( struct pcmcia_device *link )
the I/O windows and the interrupt mapping.
*/
i = pcmcia_request_configuration(link, &link->conf);
- if (i != CS_SUCCESS) {
+ if (i != 0) {
cs_error(link, RequestConfiguration, i);
}
/* If any step failed, release any partially configured state */
- if (i != CS_SUCCESS) {
+ if (i != 0) {
ines_gpib_release(link);
return;
}
View
5 testudo/linux-gpib-svn/drivers/gpib/ni_usb/ni_usb_gpib.c
@@ -17,6 +17,7 @@
* *
***************************************************************************/
+#include <linux/kernel.h>
#include <linux/module.h>
#include "ni_usb_gpib.h"
#include "gpibP.h"
@@ -2236,7 +2237,7 @@ static int __init ni_usb_init_module(void)
{
int i;
- info("ni_usb_gpib driver loading");
+ pr_info("ni_usb_gpib driver loading");
for(i = 0; i < MAX_NUM_NI_USB_INTERFACES; i++)
ni_usb_driver_interfaces[i] = NULL;
usb_register(&ni_usb_bus_driver);
@@ -2247,7 +2248,7 @@ static int __init ni_usb_init_module(void)
static void __exit ni_usb_exit_module(void)
{
- info("ni_usb_gpib driver unloading");
+ pr_info("ni_usb_gpib driver unloading");
// printk("%s: enter\n", __FUNCTION__);
gpib_unregister_driver(&ni_usb_gpib_interface);
usb_deregister(&ni_usb_bus_driver);
View
2 testudo/linux-gpib-svn/drivers/gpib/sys/ibinit.c
@@ -30,8 +30,6 @@ static int autospoll_thread(void *board_void)
/* This thread doesn't need any user-level access,
* so get rid of all our resources..
*/
- /* set our name for identification purposes */
- daemonize("gpib%d_autospoll", board->minor);
allow_signal(SIGKILL);
GPIB_DPRINTK("entering autospoll thread\n" );
View
1 testudo/linux-gpib-svn/drivers/gpib/sys/osfuncs.c
@@ -20,6 +20,7 @@
#include <linux/fcntl.h>
#include <linux/kmod.h>
+#include <linux/smp_lock.h>
#include <linux/vmalloc.h>
static int board_type_ioctl(gpib_file_private_t *file_priv, gpib_board_t *board, unsigned long arg);
View
6 testudo/linux-gpib-svn/drivers/gpib/tnt4882/mite.c
@@ -92,7 +92,6 @@ void mite_init(void)
int mite_setup(struct mite_struct *mite)
{
- unsigned long length;
u32 addr;
if(pci_enable_device(mite->pcidev))
@@ -108,7 +107,7 @@ int mite_setup(struct mite_struct *mite)
};
addr = pci_resource_start(mite->pcidev, 0);
mite->mite_phys_addr = addr;
- mite->mite_io_addr = ioremap(addr, PCI_MITE_SIZE);
+ mite->mite_io_addr = ioremap(addr, pci_resource_len(mite->pcidev, 0));
if(!mite->mite_io_addr)
{
printk("mite: failed to remap mite io memory address.\n");
@@ -117,8 +116,7 @@ int mite_setup(struct mite_struct *mite)
printk("mite: 0x%08lx mapped to %p\n", mite->mite_phys_addr, mite->mite_io_addr);
addr = pci_resource_start(mite->pcidev, 1);
mite->daq_phys_addr=addr;
- length = PCI_DAQ_SIZE;
- mite->daq_io_addr = ioremap(mite->daq_phys_addr, length);
+ mite->daq_io_addr = ioremap(mite->daq_phys_addr, pci_resource_len(mite->pcidev, 1));
if(!mite->daq_io_addr)
{
printk("mite: failed to remap daq io memory address.\n");
View
37 testudo/linux-gpib-svn/drivers/gpib/tnt4882/tnt4882_cs.c
@@ -114,7 +114,7 @@ static int ni_gpib_probe(struct pcmcia_device *link)
/* Initialize the dev_link_t structure */
/* Interrupt setup */
- link->irq.Attributes = IRQ_TYPE_EXCLUSIVE;
+ link->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING;
link->irq.IRQInfo1 = IRQ_INFO2_VALID|IRQ_LEVEL_ID;
link->irq.Handler = NULL;
@@ -154,7 +154,8 @@ static void ni_gpib_remove(struct pcmcia_device *link)
printk("dev_node still registered ???");
//unregister_netdev(dev);
}
- ni_pcmcia_detach(info->dev);
+ if(info->dev)
+ ni_pcmcia_detach(info->dev);
ni_gpib_release(link);
//free_netdev(dev);
@@ -180,7 +181,6 @@ static void ni_gpib_config(struct pcmcia_device *link)
cisparse_t parse;
int last_fn, last_ret;
u_char buf[64];
- config_info_t conf;
win_req_t req;
memreq_t map;
cistpl_cftable_entry_t dflt = { 0 };
@@ -197,14 +197,13 @@ static void ni_gpib_config(struct pcmcia_device *link)
tuple.TupleOffset = 0;
CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(link, &tuple));
CS_CHECK(GetTupleData, pcmcia_get_tuple_data(link, &tuple));
- CS_CHECK(ParseTuple, pcmcia_parse_tuple(link, &tuple, &parse));
+ CS_CHECK(ParseTuple, PCMCIA_PARSE_TUPLE(&tuple, &parse));
link->conf.ConfigBase = parse.config.base;
link->conf.Present = parse.config.rmask[0];
/* Configure card */
- CS_CHECK( GetConfigurationInfo, pcmcia_get_configuration_info(link, &conf) );
- /*
+ /*
In this loop, we scan the CIS for configuration table entries,
each of which describes a valid card configuration, including
voltage, IO window, memory window, and interrupt settings.
@@ -218,17 +217,17 @@ static void ni_gpib_config(struct pcmcia_device *link)
*/
tuple.DesiredTuple = CISTPL_CFTABLE_ENTRY;
CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(link, &tuple));
- while (1)
+ while (1)
{
cistpl_cftable_entry_t *cfg = &(parse.cftable_entry);
CS_CHECK(GetTupleData, pcmcia_get_tuple_data(link, &tuple));
- CS_CHECK(ParseTuple, pcmcia_parse_tuple(link, &tuple, &parse));
+ CS_CHECK(ParseTuple, PCMCIA_PARSE_TUPLE(&tuple, &parse));
if (cfg->flags & CISTPL_CFTABLE_DEFAULT) dflt = *cfg;
if (cfg->index == 0) goto next_entry;
link->conf.ConfigIndex = cfg->index;
/* Does this card need audio output? */
- if (cfg->flags & CISTPL_CFTABLE_AUDIO)
+ if (cfg->flags & CISTPL_CFTABLE_AUDIO)
{
link->conf.Attributes |= CONF_ENABLE_SPKR;
link->conf.Status = CCSR_AUDIO_ENA;
@@ -237,10 +236,10 @@ static void ni_gpib_config(struct pcmcia_device *link)
/* Do we need to allocate an interrupt? */
if (cfg->irq.IRQInfo1 || dflt.irq.IRQInfo1)
link->conf.Attributes |= CONF_ENABLE_IRQ;
-
+
/* IO window settings */
link->io.NumPorts1 = link->io.NumPorts2 = 0;
- if ((cfg->io.nwin > 0) || (dflt.io.nwin > 0))
+ if ((cfg->io.nwin > 0) || (dflt.io.nwin > 0))
{
cistpl_io_t *io = (cfg->io.nwin) ? &cfg->io : &dflt.io;
link->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO;
@@ -251,7 +250,7 @@ static void ni_gpib_config(struct pcmcia_device *link)
link->io.IOAddrLines = io->flags & CISTPL_IO_LINES_MASK;
link->io.BasePort1 = io->win[0].base;
link->io.NumPorts1 = io->win[0].len;
- if (io->nwin > 1)
+ if (io->nwin > 1)
{
link->io.Attributes2 = link->io.Attributes1;
link->io.BasePort2 = io->win[1].base;
@@ -259,19 +258,19 @@ static void ni_gpib_config(struct pcmcia_device *link)
}
/* This reserves IO space but doesn't actually enable it */
last_ret = pcmcia_request_io(link, &link->io);
- if(last_ret != CS_SUCCESS)
+ if(last_ret != 0)
{
goto next_entry;
}
}
-
+
/*
Now set up a common memory window, if needed. There is room
in the dev_link_t structure for one memory window handle,
but if the base addresses need to be saved, or if multiple
windows are needed, the info should go in the private data
structure for this device.
-
+
Note that the memory window base is a physical address, and
needs to be mapped to virtual space with ioremap() before it
is used.
@@ -287,15 +286,15 @@ static void ni_gpib_config(struct pcmcia_device *link)
req.Size = 0x1000;
req.AccessSpeed = 0;
link->win = (window_handle_t)link;
- if(pcmcia_request_window(&link, &req, &link->win) != CS_SUCCESS)
+ if(pcmcia_request_window(&link, &req, &link->win) != 0)
goto next_entry;
map.Page = 0; map.CardOffset = mem->win[0].card_addr;
- if(pcmcia_map_mem_page(link->win, &map) != CS_SUCCESS)
+ if(pcmcia_map_mem_page(link->win, &map) != 0)
goto next_entry;
}
/* If we got this far, we're cool! */
break;
-
+
next_entry:
CS_CHECK( GetNextTuple, pcmcia_get_next_tuple(link, &tuple));
}
@@ -462,7 +461,7 @@ int ni_pcmcia_attach(gpib_board_t *board, gpib_board_config_t config)
tnt4882_private_t *tnt_priv;
nec7210_private_t *nec_priv;
int isr_flags = IRQF_SHARED;
-
+
DEBUG(0, "ni_pcmcia_attach(0x%p)\n", board);
if( curr_dev == NULL )
View
8 testudo/linux-gpib-svn/language/Makefile.am
@@ -17,9 +17,11 @@ PERL_DIST = perl/Changes perl/LinuxGpib.pm perl/LinuxGpib.xs \
if BIND_PERL
ALL_PERL = all-perl
CLEAN_PERL = clean-perl
+DISTCLEAN_PERL = distclean-perl
else
ALL_PERL =
CLEAN_PERL =
+DISTCLEAN_PERL =
endif
if BIND_PYTHON
@@ -50,6 +52,8 @@ all-local: $(ALL_PERL)
clean-local: $(CLEAN_PERL)
+distclean-local: $(DISTCLEAN_PERL)
+
.PHONY: all-perl
all-perl: perl/Makefile
-$(MAKE) -C perl all
@@ -58,5 +62,9 @@ all-perl: perl/Makefile
clean-perl: perl/Makefile
-$(MAKE) -C perl clean
+.PHONY: distclean-perl
+distclean-perl:
+ $(RM) perl/Makefile
+
perl/Makefile:
-(cd perl && $(PERL) Makefile.PL)
View
3 testudo/linux-gpib-svn/language/tcl/Makefile.am
@@ -15,8 +15,9 @@ libgpib_tcl_la_SOURCES = ibCmds.c
TCL_CONFIG = $(TCL_BIN_DIR)/tclConfig.sh
TCL_LIB_SPEC = `$(SHELL) -c '. $(TCL_CONFIG); eval echo $${TCL_LIB_SPEC};'`
+TCL_INC = `$(SHELL) -c '. $(TCL_CONFIG); eval echo $${TCL_INCLUDE_SPEC};'`
#fix tcl directory for version independence
-libgpib_tcl_la_CFLAGS = $(LIBGPIB_CFLAGS) -I$(TCL_INC_DIR)
+libgpib_tcl_la_CFLAGS = $(LIBGPIB_CFLAGS) $(TCL_INC)
libgpib_tcl_la_LDFLAGS = -release $(VERSION) $(LIBGPIB_LDFLAGS) $(TCL_LIB_SPEC)
View
6 testudo/linux-gpib-svn/lib/gpib_config/gpib_config.c
@@ -35,7 +35,7 @@ typedef struct
unsigned int minor;
char *board_type;
int irq;
- uint64_t iobase;
+ unsigned long iobase;
int dma;
int pci_bus;
int pci_slot;
@@ -171,7 +171,7 @@ static int parse_options( int argc, char *argv[], parsed_options_t *settings )
memset(settings, 0, sizeof(parsed_options_t));
settings->irq = -1;
- settings->iobase = -1;
+ settings->iobase = (unsigned long)-1;
settings->dma = -1;
settings->pci_bus = -1;
settings->pci_slot = -1;
@@ -434,7 +434,7 @@ int main( int argc, char *argv[] )
}
if( options.irq < 0 )
options.irq = board->irq;
- if( options.iobase < 0 )
+ if( options.iobase == (unsigned long)-1 )
options.iobase = board->base;
if( options.dma < 0 )
options.dma = board->dma;
View
21 testudo/linux-gpib-svn/lib/ibConfYacc.y
@@ -104,6 +104,11 @@ int parse_gpib_conf( const char *filename, ibConf_t *configs, unsigned int confi
return retval;
}
+static void gpib_conf_warn_missing_equals()
+{
+ fprintf(stderr, "WARNING: omitting \"=\" before a boolean value in gpib config file is deprecated.\n");
+}
+
%}
%pure_parser
@@ -144,7 +149,7 @@ char cval;
current_config( parse_arg )->is_interface = 1;
if( ++( priv(parse_arg)->config_index ) >= priv(parse_arg)->configs_length )
{
- fprintf(stderr, " too many devices in config file\n");
+ fprintf(stderr, "too many devices in config file\n");
YYERROR;
}
}
@@ -165,15 +170,15 @@ char cval;
| error
{
fprintf(stderr, "parameter error on line %i of %s\n", @1.first_line, DEFAULT_CONFIG_FILE);
- YYERROR;
+ YYABORT;
}
;
statement: T_PAD '=' T_NUMBER { current_config( parse_arg )->defaults.pad = $3;}
| T_SAD '=' T_NUMBER { current_config( parse_arg )->defaults.sad = $3 - sad_offset;}
| T_EOSBYTE '=' T_NUMBER { current_config( parse_arg )->defaults.eos = $3;}
- | T_REOS T_BOOL { current_config( parse_arg )->defaults.eos_flags |= $2 * REOS;}
- | T_BIN T_BOOL { current_config( parse_arg )->defaults.eos_flags |= $2 * BIN;}
+ | T_REOS T_BOOL { gpib_conf_warn_missing_equals(); current_config( parse_arg )->defaults.eos_flags |= $2 * REOS;}
+ | T_BIN T_BOOL { gpib_conf_warn_missing_equals(); current_config( parse_arg )->defaults.eos_flags |= $2 * BIN;}
| T_REOS '=' T_BOOL { current_config( parse_arg )->defaults.eos_flags |= $3 * REOS;}
| T_XEOS '=' T_BOOL { current_config( parse_arg )->defaults.eos_flags |= $3 * XEOS;}
| T_BIN '=' T_BOOL { current_config( parse_arg )->defaults.eos_flags |= $3 * BIN;}
@@ -185,7 +190,7 @@ char cval;
| T_DMA '=' T_NUMBER { current_board( parse_arg )->dma = $3; }
| T_PCI_BUS '=' T_NUMBER { current_board( parse_arg )->pci_bus = $3; }
| T_PCI_SLOT '=' T_NUMBER { current_board( parse_arg )->pci_slot = $3; }
- | T_MASTER T_BOOL { current_board( parse_arg )->is_system_controller = $2; }
+ | T_MASTER T_BOOL { gpib_conf_warn_missing_equals(); current_board( parse_arg )->is_system_controller = $2; }
| T_MASTER '=' T_BOOL { current_board( parse_arg )->is_system_controller = $3; }
| T_BOARD_TYPE '=' T_STRING
{
@@ -215,7 +220,7 @@ char cval;
| error
{
fprintf(stderr, "option error on line %i of config file\n", @1.first_line );
- YYERROR;
+ YYABORT;
}
;
@@ -224,10 +229,10 @@ char cval;
| T_SAD '=' T_NUMBER { current_config( parse_arg )->defaults.sad = $3 - sad_offset; }
| T_INIT_S '=' T_STRING { strncpy(current_config( parse_arg )->init_string,$3,60); }
| T_EOSBYTE '=' T_NUMBER { current_config( parse_arg )->defaults.eos = $3; }
- | T_REOS T_BOOL { current_config( parse_arg )->defaults.eos_flags |= $2 * REOS;}
+ | T_REOS T_BOOL { gpib_conf_warn_missing_equals(); current_config( parse_arg )->defaults.eos_flags |= $2 * REOS;}
| T_REOS '=' T_BOOL { current_config( parse_arg )->defaults.eos_flags |= $3 * REOS;}
| T_XEOS '=' T_BOOL { current_config( parse_arg )->defaults.eos_flags |= $3 * XEOS;}
- | T_BIN T_BOOL { current_config( parse_arg )->defaults.eos_flags |= $2 * BIN; }
+ | T_BIN T_BOOL { gpib_conf_warn_missing_equals(); current_config( parse_arg )->defaults.eos_flags |= $2 * BIN; }
| T_BIN '=' T_BOOL { current_config( parse_arg )->defaults.eos_flags |= $3 * BIN; }
| T_EOT '=' T_BOOL { current_config( parse_arg )->defaults.send_eoi = $3;}
| T_AUTOPOLL { current_config( parse_arg )->flags |= CN_AUTOPOLL; }
View
1,693 testudo/linux-gpib-svn/m4/tcl.m4
1,233 additions, 460 deletions not shown because the diff is too large. Please use a local Git client to view these changes.
View
1 testudo/linux-gpib-svn/util/linux_flags/Makefile
@@ -23,3 +23,4 @@ flags:
echo LINUX_LD="$(LD) $(LDFLAGS) $(LDFLAGS_MODULE)" >>$(obj)/flags
echo LINUX_AS="$(AS)" >>$(obj)/flags
echo LINUX_MODLIB="$(MODLIB)" >>$(obj)/flags
+

0 comments on commit e64d7bc

Please sign in to comment.
Something went wrong with that request. Please try again.