unofficial pcmcia patch for 2.1.25

nsd@bbc.com
Thu, 6 Feb 1997 16:39:24 GMT


Hi,

Here's a patch to pcmcia-cs-2.9.1 for use with 2.1.25 kernels. It probably
will also work with 2.1.2[34] kernels but not with earlier ones.

Please note that this is an unofficial patch, and that I expect David Hinds'
changes to differ significantly from mine. Please also note that I don't
fully understand my changes, so although they allow me to use my LinkSys
ethernet card and Megahertz modem, they may not work for you and conceivably
could damage your computer.

Nick Duffek
nsd@bbc.com

diff -u -r pcmcia-cs-2.9.1/modules/Makefile pcmcia-cs-2.9.1.nsd/modules/Makefile
--- pcmcia-cs-2.9.1/modules/Makefile Tue Nov 26 02:21:58 1996
+++ pcmcia-cs-2.9.1.nsd/modules/Makefile Fri Jan 17 22:05:45 1997
@@ -10,7 +10,7 @@
CFLAGS = -O2 -Wall -Wstrict-prototypes -Winline -pipe
endif

-CPPFLAGS = $(PCDEBUG) -D__KERNEL__ -DMODULE -I../include -I$(LINUX)/include -I$(LINUX)
+CPPFLAGS = $(PCDEBUG) -D__KERNEL__ -DMODULE -DEXPORT_SYMTAB -I../include -I$(LINUX)/include -I$(LINUX)
COFLAGS = -kv

# For files in kernel source tree, so that we can override config flags
diff -u -r pcmcia-cs-2.9.1/modules/cs.c pcmcia-cs-2.9.1.nsd/modules/cs.c
--- pcmcia-cs-2.9.1/modules/cs.c Sat Jan 4 16:09:40 1997
+++ pcmcia-cs-2.9.1.nsd/modules/cs.c Fri Jan 17 22:04:51 1997
@@ -6,6 +6,7 @@

======================================================================*/

+#include <linux/autoconf.h>
#include <pcmcia/config.h>
#include <pcmcia/k_compat.h>

@@ -47,18 +48,10 @@
"Linux PCMCIA Card Services " CS_RELEASE;

#undef CONFIG_MODVERSIONS
-static struct symbol_table cs_symtab = {
-#include <linux/symtab_begin.h>
-#if (LINUX_VERSION_CODE >= VERSION(1,3,0))
-#undef X
-#define X(sym) { (void *)&sym, SYMBOL_NAME_STR(sym) }
-#endif
- X(register_ss_entry),
- X(unregister_ss_entry),
- X(CardServices),
- X(MTDHelperEntry),
-#include <linux/symtab_end.h>
-};
+EXPORT_SYMBOL(register_ss_entry);
+EXPORT_SYMBOL(unregister_ss_entry);
+EXPORT_SYMBOL(CardServices);
+EXPORT_SYMBOL(MTDHelperEntry);

/*====================================================================*/

@@ -2004,7 +1997,6 @@
#ifdef CONFIG_APM
apm_register_callback(&handle_apm_event);
#endif
- register_symtab(&cs_symtab);
return 0;
}

diff -u -r pcmcia-cs-2.9.1/modules/ds.c pcmcia-cs-2.9.1.nsd/modules/ds.c
--- pcmcia-cs-2.9.1/modules/ds.c Sat Jan 4 16:09:40 1997
+++ pcmcia-cs-2.9.1.nsd/modules/ds.c Tue Feb 4 11:59:54 1997
@@ -6,6 +6,7 @@

======================================================================*/

+#include <linux/autoconf.h>
#include <pcmcia/config.h>
#include <pcmcia/k_compat.h>

@@ -19,6 +20,7 @@
#include <linux/sched.h>
#include <linux/timer.h>
#include <linux/ioctl.h>
+#include <linux/poll.h>

#include <asm/segment.h>

@@ -45,8 +47,7 @@
char *buf, U_FS_SIZE_T count);
static FS_SIZE_T ds_write(struct inode *inode, struct file *file,
CONST char *buf, U_FS_SIZE_T count);
-static int ds_select(struct inode *inode, struct file *file,
- int sel_type, select_table *wait);
+static unsigned int ds_poll(struct file *file, poll_table *wait);
static int ds_ioctl(struct inode * inode, struct file * file,
u_int cmd, u_long arg);
static int ds_open(struct inode * inode, struct file * file);
@@ -109,7 +110,7 @@
ds_read, /* read */
ds_write, /* write */
NULL, /* readdir */
- ds_select, /* select */
+ ds_poll, /* poll */
ds_ioctl, /* ioctl */
NULL, /* mmap */
ds_open, /* open */
@@ -118,18 +119,10 @@
};

#undef CONFIG_MODVERSIONS
-static struct symbol_table ds_symtab = {
-#include <linux/symtab_begin.h>
-#if (LINUX_VERSION_CODE >= VERSION(1,3,0))
-#undef X
-#define X(sym) { (void *)&sym, SYMBOL_NAME_STR(sym) }
-#endif
- X(register_pcmcia_driver),
- X(unregister_pcmcia_driver),
- X(bind_request),
- X(bind_mtd),
-#include <linux/symtab_end.h>
-};
+EXPORT_SYMBOL(register_pcmcia_driver);
+EXPORT_SYMBOL(unregister_pcmcia_driver);
+EXPORT_SYMBOL(bind_request);
+EXPORT_SYMBOL(bind_mtd);

/*====================================================================*/

@@ -626,29 +619,26 @@

/*====================================================================*/

-static int ds_select(struct inode *inode, struct file *file,
- int sel_type, select_table *wait)
+static unsigned int ds_poll(struct file *file, poll_table *wait)
{
- socket_t i = MINOR(inode->i_rdev);
+ socket_t i = MINOR(file->f_inode->i_rdev);
socket_info_t *s;
user_info_t *user;

#ifdef PCMCIA_DEBUG
if (pc_debug > 1)
- printk(KERN_DEBUG "ds_select(socket %d)\n", i);
+ printk(KERN_DEBUG "ds_poll(socket %d)\n", i);
#endif

if ((i >= sockets) || (sockets == 0))
- return -ENODEV;
+ return POLLERR;
s = &socket_table[i];
user = file->private_data;
if (CHECK_USER(user))
- return -EIO;
- if (sel_type != SEL_IN)
- return 0;
+ return POLLERR;
+ poll_wait(&s->queue, wait);
if (!queue_empty(user))
- return 1;
- select_wait(&s->queue, wait);
+ return POLLIN | POLLRDNORM;
return 0;
} /* ds_select */

@@ -884,7 +874,6 @@
"Driver Services\n");
else
major_dev = i;
- register_symtab(&ds_symtab);

return 0;
}
diff -u -r pcmcia-cs-2.9.1/modules/pcmem_cs.c pcmcia-cs-2.9.1.nsd/modules/pcmem_cs.c
--- pcmcia-cs-2.9.1/modules/pcmem_cs.c Sat Jan 4 16:09:40 1997
+++ pcmcia-cs-2.9.1.nsd/modules/pcmem_cs.c Tue Feb 4 12:59:26 1997
@@ -103,8 +103,8 @@

/*====================================================================*/

-static int pcmem_lseek(struct inode *inode, struct file *file,
- off_t offset, int orig);
+static long long pcmem_lseek(struct inode *inode, struct file *file,
+ long long offset, int orig);
static int pcmem_ioctl(struct inode *inode, struct file *file,
u_int cmd, u_long arg);
static FS_SIZE_T pcmem_read(struct inode *inode, struct file *file,
@@ -527,8 +527,8 @@

======================================================================*/

-static int pcmem_lseek(struct inode *inode, struct file *file,
- off_t offset, int orig)
+static long long pcmem_lseek(struct inode *inode, struct file *file,
+ long long offset, int orig)
{
dev_link_t *link;
pcmem_dev_t *dev;