VERSION = 2
PATCHLEVEL = 1
-SUBLEVEL = 91
+SUBLEVEL = 92
ARCH := $(shell uname -m | sed -e s/i.86/i386/ -e s/sun4u/sparc64/)
@$(MAKEBOOT) BOOTIMAGE=bzImage install
archclean:
+ rm -f .kernel_offset.lds
@$(MAKEBOOT) clean
archdep:
#include <linux/fs.h>
#include <linux/stat.h>
#include <linux/errno.h>
+#include <linux/file.h>
#include <asm/segment.h>
#include <asm/uaccess.h>
#endif
blksize_size[MAJOR_NR] = nbd_blksizes;
blk_size[MAJOR_NR] = nbd_sizes;
- blk_dev[MAJOR_NR].request_fn = DEVICE_REQUEST;
+ blk_dev[MAJOR_NR].request_fn = do_nbd_request;
for (i = 0; i < MAX_NBD; i++) {
nbd_dev[i].refcnt = 0;
nbd_dev[i].file = NULL;
}
if ((tty->driver.type == TTY_DRIVER_TYPE_SERIAL) &&
(tty->driver.subtype == SERIAL_TYPE_CALLOUT)) {
- printk("Warning, %s opened, is a deprecated tty "
+ printk(KERN_INFO "Warning, %s opened, is a deprecated tty "
"callout device\n", tty_name(tty, buf));
}
return 0;
* Dynamic PPP devices by Jim Freeman <jfree@caldera.com>.
* ppp_tty_receive ``noisy-raise-bug'' fixed by Ove Ewerlid <ewerlid@syscon.uu.se>
*
- * ==FILEVERSION 980123==
+ * ==FILEVERSION 980319==
*
* NOTE TO MAINTAINERS:
* If you modify this file at all, please set the number above to the
(*ppp->sc_rcomp->incomp) (ppp->sc_rc_state,
data, count);
}
+ } else if (proto == PPP_COMP && (ppp->flags & SC_DEBUG)) {
+ printk(KERN_DEBUG "ppp: frame not decompressed: "
+ "flags=%x, count=%d, sc_rc_state=%p\n",
+ ppp->flags, count, ppp->sc_rc_state);
}
/*
* Process the uncompressed frame.
}
break;
}
+ if (ppp->flags & SC_DEBUG)
+ printk(KERN_DEBUG "ppp_proto_ccp: %s code %d, flags=%x\n",
+ (rcvd? "rcvd": "sent"), CCP_CODE(dp), ppp->flags);
restore_flags(flags);
}
(control == PPP_UI) &&
(proto != PPP_LCP) &&
(proto != PPP_CCP)) {
- new_data = kmalloc (ppp->mtu, GFP_ATOMIC);
+ new_data = kmalloc (ppp->mtu + PPP_HDRLEN, GFP_ATOMIC);
if (new_data == NULL) {
- if (ppp->flags & SC_DEBUG)
- printk (KERN_ERR
- "ppp_dev_xmit_frame: no memory\n");
+ printk (KERN_ERR "ppp_dev_xmit_frame: no memory\n");
return 1;
}
new_count = (*ppp->sc_xcomp->compress)
- (ppp->sc_xc_state, data, new_data, count, ppp->mtu);
+ (ppp->sc_xc_state, data, new_data, count,
+ ppp->mtu + PPP_HDRLEN);
if (new_count > 0 && (ppp->flags & SC_CCP_UP)) {
ppp_dev_xmit_lower (ppp, buf, new_data, new_count, 0);
}
/*
- * Process the BSD compression IOCTL event for the tty device.
+ * Process the set-compression ioctl.
*/
static int
save_flags(flags);
cli();
- ppp->flags &= ~(SC_COMP_RUN | SC_DECOMP_RUN);
+ ppp->flags &= ~(data.transmit? SC_COMP_RUN: SC_DECOMP_RUN);
restore_flags(flags);
cp = find_compressor (ccp_option[0]);
unsigned int param2, unsigned long param3)
{
struct ppp *ppp = tty2ppp (tty);
- register int temp_i = 0;
+ register int temp_i = 0, oldflags;
int error = 0;
+ unsigned long flags;
/*
* Verify the status of the PPP device.
*/
if (error != 0)
break;
temp_i &= SC_MASK;
- temp_i |= (ppp->flags & ~SC_MASK);
- if ((ppp->flags & SC_CCP_OPEN) &&
- (temp_i & SC_CCP_OPEN) == 0)
- ppp_ccp_closed (ppp);
+ if ((ppp->flags & SC_CCP_OPEN) && (temp_i & SC_CCP_OPEN) == 0)
+ ppp_ccp_closed(ppp);
- if ((ppp->flags | temp_i) & SC_DEBUG)
+ save_flags(flags);
+ cli();
+ oldflags = ppp->flags;
+ ppp->flags = temp_i |= (ppp->flags & ~SC_MASK);
+ restore_flags(flags);
+ if ((oldflags | temp_i) & SC_DEBUG)
printk (KERN_INFO
"ppp_tty_ioctl: set flags to %x\n", temp_i);
- ppp->flags = temp_i;
break;
/*
* Set the compression mode
/*
- * ==FILEVERSION 971001==
+ * ==FILEVERSION 980319==
*
* ppp_deflate.c - interface the zlib procedures for Deflate compression
* and decompression (as used by gzip) to the PPP code.
struct ppp_deflate_state *state;
int w_size;
- MOD_INC_USE_COUNT;
- if (opt_len != CILEN_DEFLATE || options[0] != CI_DEFLATE
+ if (opt_len != CILEN_DEFLATE
+ || (options[0] != CI_DEFLATE && options[0] != CI_DEFLATE_DRAFT)
|| options[1] != CILEN_DEFLATE
|| DEFLATE_METHOD(options[2]) != DEFLATE_METHOD_VAL
|| options[3] != DEFLATE_CHK_SEQUENCE)
- goto out_fail;
+ return NULL;
w_size = DEFLATE_SIZE(options[2]);
if (w_size < DEFLATE_MIN_SIZE || w_size > DEFLATE_MAX_SIZE)
- goto out_fail;
+ return NULL;
state = (struct ppp_deflate_state *) kmalloc(sizeof(*state), GFP_KERNEL);
if (state == NULL)
- goto out_fail;
+ return NULL;
+ MOD_INC_USE_COUNT;
memset (state, 0, sizeof (struct ppp_deflate_state));
state->strm.next_in = NULL;
state->strm.zalloc = zalloc_init;
out_free:
z_comp_free(state);
-out_fail:
MOD_DEC_USE_COUNT;
return NULL;
}
{
struct ppp_deflate_state *state = (struct ppp_deflate_state *) arg;
- if (opt_len < CILEN_DEFLATE || options[0] != CI_DEFLATE
+ if (opt_len < CILEN_DEFLATE
+ || (options[0] != CI_DEFLATE && options[0] != CI_DEFLATE_DRAFT)
|| options[1] != CILEN_DEFLATE
|| DEFLATE_METHOD(options[2]) != DEFLATE_METHOD_VAL
|| DEFLATE_SIZE(options[2]) != state->w_size
int isize, osize;
{
struct ppp_deflate_state *state = (struct ppp_deflate_state *) arg;
- int r, proto, off, olen;
+ int r, proto, off, olen, oavail;
unsigned char *wptr;
/*
wptr += PPP_HDRLEN;
wptr[0] = state->seqno >> 8;
wptr[1] = state->seqno;
- wptr += 2;
+ wptr += DEFLATE_OVHD;
+ olen = PPP_HDRLEN + DEFLATE_OVHD;
state->strm.next_out = wptr;
- state->strm.avail_out = osize - (PPP_HDRLEN + 2);
+ state->strm.avail_out = oavail = osize - olen;
++state->seqno;
off = (proto > 0xff) ? 2 : 3; /* skip 1st proto byte if 0 */
state->strm.next_in = rptr;
state->strm.avail_in = (isize - off);
- olen = 0;
for (;;) {
r = deflate(&state->strm, Z_PACKET_FLUSH);
if (r != Z_OK) {
if (state->debug)
- printk(KERN_DEBUG "z_compress: deflate returned %d (%s)\n",
- r, (state->strm.msg? state->strm.msg: ""));
+ printk(KERN_ERR
+ "z_compress: deflate returned %d\n", r);
break;
}
if (state->strm.avail_out == 0) {
- olen += osize;
+ olen += oavail;
state->strm.next_out = NULL;
- state->strm.avail_out = 1000000;
+ state->strm.avail_out = oavail = 1000000;
} else {
break; /* all done */
}
}
- if (olen < osize)
- olen += osize - state->strm.avail_out;
+ olen += oavail - state->strm.avail_out;
/*
* See if we managed to reduce the size of the packet.
struct ppp_deflate_state *state;
int w_size;
- MOD_INC_USE_COUNT;
- if (opt_len != CILEN_DEFLATE || options[0] != CI_DEFLATE
+ if (opt_len != CILEN_DEFLATE
+ || (options[0] != CI_DEFLATE && options[0] != CI_DEFLATE_DRAFT)
|| options[1] != CILEN_DEFLATE
|| DEFLATE_METHOD(options[2]) != DEFLATE_METHOD_VAL
|| options[3] != DEFLATE_CHK_SEQUENCE)
- goto out_fail;
+ return NULL;
w_size = DEFLATE_SIZE(options[2]);
if (w_size < DEFLATE_MIN_SIZE || w_size > DEFLATE_MAX_SIZE)
- goto out_fail;
+ return NULL;
state = (struct ppp_deflate_state *) kmalloc(sizeof(*state), GFP_KERNEL);
if (state == NULL)
- goto out_fail;
+ return NULL;
+
+ MOD_INC_USE_COUNT;
memset (state, 0, sizeof (struct ppp_deflate_state));
state->w_size = w_size;
state->strm.next_out = NULL;
out_free:
z_decomp_free(state);
-out_fail:
MOD_DEC_USE_COUNT;
return NULL;
}
{
struct ppp_deflate_state *state = (struct ppp_deflate_state *) arg;
- if (opt_len < CILEN_DEFLATE || options[0] != CI_DEFLATE
+ if (opt_len < CILEN_DEFLATE
+ || (options[0] != CI_DEFLATE && options[0] != CI_DEFLATE_DRAFT)
|| options[1] != CILEN_DEFLATE
|| DEFLATE_METHOD(options[2]) != DEFLATE_METHOD_VAL
|| DEFLATE_SIZE(options[2]) != state->w_size
}
}
- if (decode_proto)
+ if (decode_proto) {
+ if (state->debug)
+ printk(KERN_DEBUG "z_decompress%d: didn't get proto\n",
+ state->unit);
return DECOMP_ERROR;
+ }
olen = osize + overflow - state->strm.avail_out;
state->stats.unc_bytes += olen;
z_comp_stats, /* decomp_stat */
};
+struct compressor ppp_deflate_draft = {
+ CI_DEFLATE_DRAFT, /* compress_proto */
+ z_comp_alloc, /* comp_alloc */
+ z_comp_free, /* comp_free */
+ z_comp_init, /* comp_init */
+ z_comp_reset, /* comp_reset */
+ z_compress, /* compress */
+ z_comp_stats, /* comp_stat */
+ z_decomp_alloc, /* decomp_alloc */
+ z_decomp_free, /* decomp_free */
+ z_decomp_init, /* decomp_init */
+ z_decomp_reset, /* decomp_reset */
+ z_decompress, /* decompress */
+ z_incomp, /* incomp */
+ z_comp_stats, /* decomp_stat */
+};
+
#ifdef MODULE
/*************************************************************
* Module support routines
if (answer == 0)
printk (KERN_INFO
"PPP Deflate Compression module registered\n");
+ ppp_register_compressor(&ppp_deflate_draft);
return answer;
}
if (MOD_IN_USE)
printk (KERN_INFO
"Deflate Compression module busy, remove delayed\n");
- else
+ else {
ppp_unregister_compressor (&ppp_deflate);
+ ppp_unregister_compressor (&ppp_deflate_draft);
+ }
}
#endif
count -= c;
mark_buffer_uptodate(bh, 1);
mark_buffer_dirty(bh, 0);
+
+ /* Mark the buffer untouched if we'll move on to the next one.. */
+ if (!(pos & (sb->s_blocksize-1)))
+ clear_bit(BH_Touched, &bh->b_state);
+
if (filp->f_flags & O_SYNC)
bufferlist[buffercount++] = bh;
else
#define SC_REJ_COMP_TCP 0x00000020 /* reject TCP (VJ) comp. on input */
#define SC_CCP_OPEN 0x00000040 /* Look at CCP packets */
#define SC_CCP_UP 0x00000080 /* May send/recv compressed packets */
-#define SC_ENABLE_IP 0x00000100 /* IP packets may be exchanged */
#define SC_COMP_RUN 0x00001000 /* compressor has been inited */
#define SC_DECOMP_RUN 0x00002000 /* decompressor has been inited */
#define SC_DEBUG 0x00010000 /* enable debug messages */
#define SC_LOG_OUTPKT 0x00040000 /* log contents of pkts sent */
#define SC_LOG_RAWIN 0x00080000 /* log all chars received */
#define SC_LOG_FLUSH 0x00100000 /* log all chars flushed */
-#define SC_MASK 0x0fE0ffff /* bits that user can change */
+#define SC_MASK 0x0f0000ff /* bits that user can change */
/* state bits */
-#define SC_ESCAPED 0x80000000 /* saw a PPP_ESCAPE */
-#define SC_FLUSH 0x40000000 /* flush input until next PPP_FLAG */
-#define SC_VJ_RESET 0x20000000 /* Need to reset the VJ decompressor */
#define SC_XMIT_BUSY 0x10000000 /* ppp_write_wakeup is active */
#define SC_RCV_ODDP 0x08000000 /* have rcvd char with odd parity */
#define SC_RCV_EVNP 0x04000000 /* have rcvd char with even parity */
* OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS,
* OR MODIFICATIONS.
*
- * $Id: ppp-comp.h,v 1.7 1995/05/01 01:43:37 paulus Exp $
+ * $Id: ppp-comp.h,v 1.6 1997/11/27 06:04:44 paulus Exp $
*/
/*
- * ==FILEVERSION 971024==
+ * ==FILEVERSION 980319==
*
* NOTE TO MAINTAINERS:
* If you modify this file at all, please set the above date.
* Definitions for Deflate.
*/
-#define CI_DEFLATE 24 /* config option for Deflate */
+#define CI_DEFLATE 26 /* config option for Deflate */
+#define CI_DEFLATE_DRAFT 24 /* value used in original draft RFC */
#define CILEN_DEFLATE 4 /* length of its config option */
#define DEFLATE_MIN_SIZE 8
if(skb->tail>skb->end)
{
__label__ here;
-#if 1
- printk(KERN_DEBUG "skbput: over: %p:tail=%p:end=%p:len=%u\n",
- &&here, skb->tail, skb->end, len);
-#else
panic(skb_put_errstr,&&here,len);
-#endif
here: ;
}
return tmp;
*/
int kmod_unload_delay = 60;
char modprobe_path[256] = "/sbin/modprobe";
+static int kmod_running = 0;
static char module_name[64] = "";
static char * argv[] = { "modprobe", "-k", module_name, NULL, };
static char * envp[] = { "HOME=/", "TERM=linux", NULL, };
current->pgrp = 1;
sprintf(current->comm, "kmod");
sigfillset(¤t->blocked);
+ kmod_running = 1;
/*
This is the main kmod_thread loop. It first sleeps, then
the module into module_name. Once that is done, wake up
kmod_thread.
*/
+ if(!kmod_running)
+ return 0;
+
strncpy(module_name, name, sizeof(module_name));
module_name[sizeof(module_name)-1] = '\0';
wake_up(&kmod_queue);
{
int retval = 0;
unsigned long flags;
- struct free_area_struct * list = NULL;
+ struct free_area_struct * list;
+
+ /*
+ * If we have more than 25% of all memory free,
+ * consider it to be good enough for anything.
+ */
+ if (nr_free_pages > num_physpages >> 2)
+ return nr+1;
list = free_area + NR_MEM_LISTS;
spin_lock_irqsave(&page_alloc_lock, flags);
unsigned char ctl[sizeof(struct cmsghdr) + 20]; /* 20 is size of ipv6_pktinfo */
unsigned char *ctl_buf = ctl;
struct msghdr msg_sys;
- int err, total_len;
+ int err, ctl_len, total_len;
lock_kernel();
err = verify_iovec(&msg_sys, iov, address, VERIFY_READ);
if (err < 0)
goto out;
-
total_len=err;
sock = sockfd_lookup(fd, &err);
if (!sock)
goto out_freeiov;
- if (msg_sys.msg_controllen)
+ ctl_len = msg_sys.msg_controllen;
+ if (ctl_len)
{
- if (msg_sys.msg_controllen > sizeof(ctl))
+ if (ctl_len > sizeof(ctl))
{
/* Suggested by the Advanced Sockets API for IPv6 draft:
* Limit the msg_controllen size by the SO_SNDBUF size.
* SMP machines you have a race to fix here.
*/
err = -ENOBUFS;
- ctl_buf = sock_kmalloc(sock->sk, msg_sys.msg_controllen,
- GFP_KERNEL);
+ ctl_buf = sock_kmalloc(sock->sk, ctl_len, GFP_KERNEL);
if (ctl_buf == NULL)
- goto failed2;
+ goto out_put;
}
err = -EFAULT;
- if (copy_from_user(ctl_buf, msg_sys.msg_control,
- msg_sys.msg_controllen))
- goto failed;
+ if (copy_from_user(ctl_buf, msg_sys.msg_control, ctl_len))
+ goto out_freectl;
msg_sys.msg_control = ctl_buf;
}
msg_sys.msg_flags = flags;
msg_sys.msg_flags |= MSG_DONTWAIT;
err = sock_sendmsg(sock, &msg_sys, total_len);
-failed:
+out_freectl:
if (ctl_buf != ctl)
- sock_kfree_s(sock->sk, ctl_buf, msg_sys.msg_controllen);
-failed2:
+ sock_kfree_s(sock->sk, ctl_buf, ctl_len);
+out_put:
sockfd_put(sock);
out_freeiov:
if (msg_sys.msg_iov != iov)