Report on compiling 2.1.26

Dale R. Worley (worley@ariadne.com)
Thu, 13 Feb 1997 14:28:32 -0500


I've just made a reasonably clean compile of 2.1.26 with "everything"
configured in (no modules, though). This is the list of problems I
noticed. Some of the problems I can't fix (for instance, much of the
ISDN code hasn't been updated to take into account recent kernel
changes), but the ones for which I could make real fixes, I've
included patches below.

1. arch/i386/kernel/time.c

Some code regarding lost_ticks and USECS_PER_JIFFY wasn't suppressed
when CONFIG_APM was set. Also, I marked some #endif's to tell what
the matching #ifdef's were testing on.

2. drivers/ap1000/{apfddi.c,apfddi.h,bif.c}

The structure enet_statistics has been replaced by net_device_stats.
(I think.)

3. drivers/isdn/{isdn_audio.c,isdn_common.c,isdn_net.c,isdn_ppp.c,isdn_tty.c,
pcbit/capi.c,pcbit/layer2.c}

The 'free', 'lock', and 'len' fields of struct sk_buff no longer exist.

4. drivers/isdn/{isdn_common.c,isdn_ppp.c}

select_wait seems to have been replaced by a 'poll' function, but the
details of how to replace the one with the other are unclear.

5. drivers/isdn/isdn_net.c

The 'header_cache_bind' field is no longer in struct device.

6. drivers/net/cs89x0.c

Missing final */ on a comment.

7. drivers/net/cs89x0.c

"FAULT" used instead of "EFAULT".

8. drivers/net/cs89x0.c

Extra newline damaging a #define.

9. drivers/net/sdla.c

Unknown function amemcpy() used.

10. drivers/sound/lowlevel/aci.c

Use of get_user not updated for new interface.

11. net/802/fddi.c

ETH_P_8022 used instead of ETH_P_802_2.

12. scripts/Configure

Cause defaulted values to be output when they are used.

Extraneous backslash prevents integer answers from being accepted.

----------------------------------------------------------------------
diff -u arch/i386/kernel/time.c.orig arch/i386/kernel/time.c
--- arch/i386/kernel/time.c.orig Wed Feb 12 09:17:44 1997
+++ arch/i386/kernel/time.c Wed Feb 12 09:19:44 1997
@@ -128,7 +128,7 @@

return edx;
}
-#endif
+#endif /* !CONFIG_APM */

/* This function must be called with interrupts disabled
* It was inspired by Steve McCanne's microtime-i386 for BSD. -- jrs
@@ -265,12 +265,14 @@
*tv = xtime;
tv->tv_usec += do_gettimeoffset();

+#ifndef CONFIG_APM
/*
* xtime is atomically updated in timer_bh. lost_ticks is
* nonzero if the timer bottom half hasnt executed yet.
*/
if (lost_ticks)
tv->tv_usec += USECS_PER_JIFFY;
+#endif /* !CONFIG_APM */

restore_flags(flags);

@@ -422,7 +424,7 @@
"=d" (last_timer_cc.high));
timer_interrupt(irq, NULL, regs);
}
-#endif
+#endif /* !CONFIG_APM */

/* Converts Gregorian date to seconds since 1970-01-01 00:00:00.
* Assumes input in normal date format, i.e. 1980-12-31 23:59:59
@@ -530,6 +532,6 @@
"=d" (init_timer_cc.high));
irq0.handler = pentium_timer_interrupt;
}
-#endif
+#endif /* !CONFIG_APM */
setup_x86_irq(0, &irq0);
}
diff -u drivers/ap1000/apfddi.c.orig drivers/ap1000/apfddi.c
--- drivers/ap1000/apfddi.c.orig Mon Feb 10 09:53:17 1997
+++ drivers/ap1000/apfddi.c Mon Feb 10 10:44:13 1997
@@ -126,7 +126,7 @@
static u_char apfddi_saddr[6] = { 0x42, 0x9a, 0x08, 0x6e, 0x11, 0x41 };

struct device *apfddi_device = NULL;
-struct enet_statistics *apfddi_stats = NULL;
+struct net_device_stats *apfddi_stats = NULL;

volatile struct apfddi_queue *apfddi_queue_top = NULL;

@@ -254,7 +254,7 @@
static void apfddi_interrupt(int irq, void *dev_id, struct pt_regs *regs);
static int apfddi_xmit(struct sk_buff *skb, struct device *dev);
int apfddi_rx(struct mac_buf *mbuf);
-static struct enet_statistics *apfddi_get_stats(struct device *dev);
+static struct net_device_stats *apfddi_get_stats(struct device *dev);
#if APFDDI_DEBUG
void dump_packet(char *action, char *buf, int len, int seq);
#endif
@@ -496,11 +496,11 @@
dev->stop = apfddi_stop;
dev->hard_start_xmit = apfddi_xmit;
dev->get_stats = apfddi_get_stats;
- dev->priv = kmalloc(sizeof(struct enet_statistics), GFP_ATOMIC);
+ dev->priv = kmalloc(sizeof(struct net_device_stats), GFP_ATOMIC);
if (dev->priv == NULL)
return -ENOMEM;
- memset(dev->priv, 0, sizeof(struct enet_statistics));
- apfddi_stats = (struct enet_statistics *)apfddi_device->priv;
+ memset(dev->priv, 0, sizeof(struct net_device_stats));
+ apfddi_stats = (struct net_device_stats *)apfddi_device->priv;

/* Initialise the fddi device structure */
for (i = 0; i < DEV_NUMBUFFS; i++)
@@ -692,9 +692,9 @@
/*
* Return statistics of fddi driver.
*/
-static struct enet_statistics *apfddi_get_stats(struct device *dev)
+static struct net_device_stats *apfddi_get_stats(struct device *dev)
{
- return((struct enet_statistics *)dev->priv);
+ return((struct net_device_stats *)dev->priv);
}


diff -u drivers/ap1000/apfddi.h.orig drivers/ap1000/apfddi.h
--- drivers/ap1000/apfddi.h.orig Mon Feb 10 09:53:17 1997
+++ drivers/ap1000/apfddi.h Mon Feb 10 10:44:13 1997
@@ -138,5 +138,5 @@
void set_cf_join(int on);

extern struct device *apfddi_device;
-extern struct enet_statistics *apfddi_stats;
+extern struct net_device_stats *apfddi_stats;

diff -u drivers/ap1000/bif.c.orig drivers/ap1000/bif.c
--- drivers/ap1000/bif.c.orig Mon Feb 10 09:53:18 1997
+++ drivers/ap1000/bif.c Mon Feb 10 10:44:13 1997
@@ -46,14 +46,14 @@
#define BIF_MTU 10240

static struct device *bif_device = 0;
-static struct enet_statistics *bif_stats = 0;
+static struct net_device_stats *bif_stats = 0;

int bif_init(struct device *dev);
int bif_open(struct device *dev);
static int bif_xmit(struct sk_buff *skb, struct device *dev);
int bif_rx(struct sk_buff *skb);
int bif_stop(struct device *dev);
-static struct enet_statistics *bif_get_stats(struct device *dev);
+static struct net_device_stats *bif_get_stats(struct device *dev);

static int bif_hard_header(struct sk_buff *skb, struct device *dev,
unsigned short type, void *daddr,
@@ -128,11 +128,11 @@
dev->open = bif_open;
dev->flags = IFF_NOARP; /* Don't use ARP on this device */
dev->family = AF_INET;
- dev->priv = kmalloc(sizeof(struct enet_statistics), GFP_KERNEL);
+ dev->priv = kmalloc(sizeof(struct net_device_stats), GFP_KERNEL);
if (dev->priv == NULL)
return -ENOMEM;
- memset(dev->priv, 0, sizeof(struct enet_statistics));
- bif_stats = (struct enet_statistics *)bif_device->priv;
+ memset(dev->priv, 0, sizeof(struct net_device_stats));
+ bif_stats = (struct net_device_stats *)bif_device->priv;


dev->stop = bif_stop;
@@ -282,8 +282,8 @@
/*
* Return statistics of bif driver.
*/
-static struct enet_statistics *bif_get_stats(struct device *dev)
+static struct net_device_stats *bif_get_stats(struct device *dev)
{
- return((struct enet_statistics *)dev->priv);
+ return((struct net_device_stats *)dev->priv);
}

diff -u drivers/net/cs89x0.c.orig drivers/net/cs89x0.c
--- drivers/net/cs89x0.c.orig Mon Feb 10 10:31:22 1997
+++ drivers/net/cs89x0.c Mon Feb 10 19:25:54 1997
@@ -1179,4 +1179,4 @@
* c-indent-level: 8
* tab-width: 8
* End:
- *
+ */
diff -u drivers/net/dlci.c.orig drivers/net/dlci.c
--- drivers/net/dlci.c.orig Mon Feb 10 18:20:48 1997
+++ drivers/net/dlci.c Mon Feb 10 18:20:54 1997
@@ -296,7 +296,7 @@
if (!get)
{
if(copy_from_user(&config, conf, sizeof(struct dlci_conf)))
- return -FAULT;
+ return -EFAULT;
if (config.flags & ~DLCI_VALID_FLAGS)
return(-EINVAL);
memcpy(&dlp->config, &config, sizeof(struct dlci_conf));
diff -u drivers/net/ni52.c.orig drivers/net/ni52.c
--- drivers/net/ni52.c.orig Mon Feb 10 17:24:09 1997
+++ drivers/net/ni52.c Mon Feb 10 17:24:12 1997
@@ -164,8 +164,7 @@
#define DELAY_18(); { __delay( (loops_per_sec>>18)+1 ); }

/* wait for command with timeout: */
-#define WAIT_4_SCB_CMD()
-{ int i; \
+#define WAIT_4_SCB_CMD() { int i; \
for(i=0;i<16384;i++) { \
if(!p->scb->cmd_cuc) break; \
DELAY_18(); \
diff -u drivers/sound/lowlevel/aci.c.orig drivers/sound/lowlevel/aci.c
--- drivers/sound/lowlevel/aci.c.orig Fri Oct 25 06:06:35 1996
+++ drivers/sound/lowlevel/aci.c Mon Feb 10 20:29:35 1997
@@ -292,7 +292,7 @@
int vol, ret;
unsigned param;

- param = get_user((int *) arg);
+ get_user(param, (int *) arg);
/* left channel */
vol = param & 0xff;
if (vol > 100) vol = 100;
@@ -318,8 +318,12 @@

/* handle solo mode control */
if (cmd == SOUND_MIXER_PRIVATE1) {
- if (get_user((int *) arg) >= 0) {
- aci_solo = !!get_user((int *) arg);
+ int temp;
+
+ get_user(temp, (int *) arg);
+ if (temp >= 0) {
+ get_user(temp, (int *) arg);
+ aci_solo = !!temp;
if (write_cmd(0xd2, aci_solo)) return -EIO;
} else if (aci_version >= 0xb0) {
if ((status = read_general_status()) < 0) return -EIO;
@@ -332,6 +336,8 @@
if (cmd & IOC_IN)
/* read and write */
switch (cmd & 0xff) {
+ int temp;
+
case SOUND_MIXER_VOLUME:
return setvolume(arg, 0x01, 0x00);
case SOUND_MIXER_CD:
@@ -349,7 +355,8 @@
case SOUND_MIXER_LINE2: /* AUX2 */
return setvolume(arg, 0x3e, 0x36);
case SOUND_MIXER_IGAIN: /* MIC pre-amp */
- vol = get_user((int *) arg) & 0xff;
+ get_user(temp, (int *) arg);
+ vol = temp & 0xff;
if (vol > 100) vol = 100;
vol = SCALE(100, 3, vol);
if (write_cmd(0x03, vol)) return -EIO;
diff -u net/802/fddi.c.orig net/802/fddi.c
--- net/802/fddi.c.orig Tue Feb 11 09:46:35 1997
+++ net/802/fddi.c Tue Feb 11 09:46:38 1997
@@ -131,7 +131,7 @@
if(fddi->hdr.llc_8022_1.dsap==0xe0)
{
skb_pull(skb, FDDI_K_8022_HLEN-3);
- type=htons(ETH_P_8022);
+ type=htons(ETH_P_802_2);
}
else
{
diff -u net/802/p8022.c.orig net/802/p8022.c
--- net/802/p8022.c.orig Mon Feb 10 10:35:16 1997
+++ net/802/p8022.c Tue Feb 11 09:48:12 1997
@@ -80,7 +80,7 @@

static struct packet_type p8022_packet_type =
{
- 0, /* MUTTER ntohs(ETH_P_8022),*/
+ 0, /* MUTTER ntohs(ETH_P_802_2),*/
NULL, /* All devices */
p8022_rcv,
NULL,
diff -u scripts/Configure.orig scripts/Configure
--- scripts/Configure.orig Mon Feb 10 10:35:20 1997
+++ scripts/Configure Tue Feb 11 08:50:22 1997
@@ -108,7 +108,7 @@
#
function readln () {
if [ "$DEFAULT" = "-d" -a -n "$3" ]; then
- echo "$1"
+ echo "$1$2 [defaulted]"
ans=$2
else
echo -n "$1"
@@ -288,7 +288,7 @@
def=${old:-$3}
while :; do
readln "$1 ($2) [$def] " "$def" "$old"
- if expr "$ans" : '0$\|-\?[1-9][0-9]*$' > /dev/null; then
+ if expr "$ans" : '0$\|-?[1-9][0-9]*$' > /dev/null; then
define_int "$2" "$ans"
break
else
----------------------------------------------------------------------
Dale

--
Dale R. Worley					Ariadne Internet Services
Voice: +1 617-899-7949   Fax: +1 617-899-7946	E-mail: worley@ariadne.com
"Internet-based electronic commerce solutions to real business problems."