From 14a5ce03d67ace568958398066d693825a1f2727 Mon Sep 17 00:00:00 2001 From: Alan Cox Date: Fri, 23 Nov 2007 15:11:39 -0500 Subject: [PATCH] Import 2.0.34pre4 --- Documentation/Changes | 39 +++- Documentation/Configure.help | 7 + Documentation/cdrom/ide-cd | 11 +- Documentation/networking/ip_dynaddr.txt | 39 +++- Makefile | 2 +- arch/alpha/defconfig | 2 - arch/i386/defconfig | 2 - arch/i386/kernel/vm86.c | 2 +- drivers/char/Config.in | 1 + drivers/char/apm_bios.c | 48 ++++- drivers/net/arcnet.c | 2 +- drivers/net/hp100.c | 246 +++++++++++++++++----- drivers/net/sk_g16.c | 12 +- drivers/scsi/scsi_ioctl.c | 5 + drivers/scsi/sr_ioctl.c | 31 +-- drivers/sound/.defines | 118 ----------- drivers/sound/Config.in | 258 +----------------------- drivers/sound/local.h | 45 ----- fs/dquot.c | 9 +- fs/filesystems.c | 3 + fs/nls.c | 2 + include/linux/bios32.h | 4 +- include/linux/iso_fs_i.h | 9 +- include/linux/modversions.h | 30 --- include/scsi/scsi.h | 2 + kernel/sched.c | 3 +- kernel/sys.c | 2 +- net/ipv4/arp.c | 2 +- net/ipv4/igmp.c | 7 +- net/ipv4/ip_masq.c | 24 ++- net/ipv4/ip_output.c | 35 +++- net/ipv4/tcp_output.c | 4 +- scripts/lxdialog/checklist.c | 11 +- 33 files changed, 422 insertions(+), 595 deletions(-) delete mode 100644 drivers/sound/.defines delete mode 100644 drivers/sound/local.h delete mode 100644 include/linux/modversions.h diff --git a/Documentation/Changes b/Documentation/Changes index 25bce10c4a29..efb08999a284 100644 --- a/Documentation/Changes +++ b/Documentation/Changes @@ -40,11 +40,21 @@ http://jf.gee.kyoto-u.ac.jp/JF/v2.0/Changes-2.0.html ni arimasu. Voyez le site http://www.linux-kheops.com/traduc/kernels/ pour la traduction francaise (merci, David Bourgin). (French translation) -Last updated: August 14, 1997. -Current Author: Chris Ricker (gt1355b@prism.gatech.edu). + Per quelli che preferiscono avere una versione in Italiano di questo +documento, si consulti la traduzione di Giovanni Bortolozzo reperibile a +http://www.pluto.linux.it/ildp/kernel/Changes-2.0.html (Italian +translation). + + The most current version should always be available from +http://cyberbuzz.gatech.edu/kaboom/linux/ as well. + +Last updated: February 16, 1998. +Current Author: Chris Ricker (kaboom@gatech.edu). -Current Releases -**************** +Current Releases (the latest necessary for basic functionality, not +******************************************************************* + + necessarily the latest and greatest) - Kernel modules 2.0.0 - PPP daemon 2.2.0f @@ -372,6 +382,12 @@ ip_masq_irc.o) if you are going to use FTP or IRC in combination with masquerading. You'll need to get ftp://ftp.xos.nl/pub/linux/ipfwadm/ipfwadm-2.3.0.tar.gz to use this. + To enable IP forwarding, you may need to + + echo 1 > /proc/sys/net/ipv4/ip_forwarding + + as well. + ISDN support ============ @@ -587,6 +603,14 @@ compiled on them. If you need (or want) to compile your own copy, you'll need to get the latest version, currently available at ftp://tsx-11.mit.edu/pub/linux/packages/ext2fs/e2fsprogs-1.06.tar.gz. +FlagShip and /dev/full +====================== + + The behavior of /dev/full changed with kernel 2.0.31. In addition to +improving system security, the change broke executables created by the +FlagShip database compiler. Fixes can be found at http://www.fship.com +via the "What's New" or "Support" buttons. + How to know the version of the installed programs ************************************************* @@ -725,8 +749,7 @@ same directory that works well for many people. Please send info about any other packages that 2.0.x "broke" or about any new features of 2.0.x that require extra or new packages for use to -Chris Ricker (gt1355b@prism.gatech.edu). I generate this from a -modified texinfo setup, so you don't need to bother generating a diff -against the current version before you send the additional information -to me. +Chris Ricker . I generate this from a modified +texinfo setup, so you don't need to bother generating a diff against +the current version before you send the additional information to me. diff --git a/Documentation/Configure.help b/Documentation/Configure.help index fa589d01c2f8..a005d5064718 100644 --- a/Documentation/Configure.help +++ b/Documentation/Configure.help @@ -3814,6 +3814,13 @@ CONFIG_APM_POWER_OFF (e.g., with the halt(8) command). As with the other APM options, this option may not work reliably with some APM BIOS implementations. +Ignore multiple suspend/standby events +CONFIG_APM_IGNORE_MULTIPLE_SUSPEND + This option is necessary on the Thinkpad 560, but should work on all + other laptops. When the APM BIOS returns multiple suspend or standby + events while one is already being processed they will be ignored. + Without this the Thinkpad 560 has troubles with apmd, and pcmcia-cs. + Watchdog Timer Support CONFIG_WATCHDOG If you enable this option and create a character special file diff --git a/Documentation/cdrom/ide-cd b/Documentation/cdrom/ide-cd index 22842fbd0e94..e78f81178f4f 100644 --- a/Documentation/cdrom/ide-cd +++ b/Documentation/cdrom/ide-cd @@ -277,7 +277,16 @@ b. Timeout/IRQ errors. there are hardware problems with the interrupt setup; they apparently don't use interrupts. - + - If you own a Pioneer DR-A24X, you _will_ get nasty error messages + on boot such as "irq timeout: status=0x50 { DriveReady SeekComplete }" + The Pioneer DR-A24X cdrom drives are fairly popular these days. + Unfortunatly, these drives seem to become very confused when we perform + the standard Linux ATA disk drive probe. If you own one of these drives, + you can bypass the ATA probing which confuses these cdrom drives, by + adding `append="hdX=noprobe hdX=cdrom"' to your lilo.conf file and runing + lilo (again where X is the drive letter corresponding to where your drive + is installed (see section 2)) + c. System hangups. - If the system locks up when you try to access the cdrom, the most diff --git a/Documentation/networking/ip_dynaddr.txt b/Documentation/networking/ip_dynaddr.txt index 45f3c1268e86..70815dafb518 100644 --- a/Documentation/networking/ip_dynaddr.txt +++ b/Documentation/networking/ip_dynaddr.txt @@ -1,10 +1,10 @@ -IP dynamic address hack-port v0.03 -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +IP dynamic address hack-port v0.03-rst +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ This stuff allows diald ONESHOT connections to get established by dynamically changing packet source address (and socket's if local procs). It is implemented for TCP diald-box connections(1) and IP_MASQuerading(2). -If enabled[*] and forwarding interface has changed: +If enabled[*] and forwarding interface address has changed: 1) Socket (and packet) source address is rewritten ON RETRANSMISSIONS while in SYN_SENT state (diald-box processes). 2) Out-bounded MASQueraded source address changes ON OUTPUT (when @@ -16,14 +16,39 @@ This is specially helpful for auto dialup links (diald), where the going up. So, the *same* (local AND masqueraded) connections requests that bring the link up will be able to get established. +If you enable the RST-provoking mode, then the source address will +be changed, even if the socket is established. This means we send +an incorrect packet out, which causes the remote host to kill our +socket. This is the desired behaviour, because such a socket is +doomed anyway, and the earlier it dies, the better. This prevents +the dial-on-demand connection from being kept up by a dead connection, +and tells the application that the connection was lost. + [*] At boot, by default no address rewriting is attempted. - To enable: + +The values for the ip_dynaddr sysctl are: + + 1: To enable: + 2: To enable verbosity: + 4: To enable RST-provoking: + +Flags can be combined by adding them. Common settings +would be: + + To switch off special handling of dynamic addresses (default) + # echo 0 > /proc/sys/net/ipv4/ip_dynaddr + To enable rewriting in quiet mode: # echo 1 > /proc/sys/net/ipv4/ip_dynaddr - To enable verbose mode: + To enable rewriting in verbose mode: + # echo 3 > /proc/sys/net/ipv4/ip_dynaddr + (for backwards compatibility you can also use) # echo 2 > /proc/sys/net/ipv4/ip_dynaddr - To disable (default) - # echo 0 > /proc/sys/net/ipv4/ip_dynaddr + To enable quiet RST-provoking mode: + # echo 5 > /proc/sys/net/ipv4/ip_dynaddr + To enable verbose RST-provoking mode: + # echo 7 > /proc/sys/net/ipv4/ip_dynaddr Enjoy! -- Juanjo +(with RST-provoking mode by Erik Corry ) diff --git a/Makefile b/Makefile index 413eb9c42199..5300782c5d95 100644 --- a/Makefile +++ b/Makefile @@ -38,7 +38,7 @@ CPP =$(CC) -E AR =$(CROSS_COMPILE)ar NM =$(CROSS_COMPILE)nm STRIP =$(CROSS_COMPILE)strip -MAKE =make -j3 +MAKE =make all: do-it-all diff --git a/arch/alpha/defconfig b/arch/alpha/defconfig index 118edbd92557..9f33eeaa45af 100644 --- a/arch/alpha/defconfig +++ b/arch/alpha/defconfig @@ -146,7 +146,6 @@ CONFIG_SCSI_QLOGIC_ISP=y CONFIG_NETDEVICES=y CONFIG_DUMMY=m # CONFIG_EQUALIZER is not set -# CONFIG_DLCI is not set # CONFIG_PLIP is not set # CONFIG_PPP is not set # CONFIG_SLIP is not set @@ -162,7 +161,6 @@ CONFIG_DE4X5=y # CONFIG_DEC_ELCP is not set # CONFIG_DGRS is not set # CONFIG_NET_POCKET is not set -# CONFIG_GIGAETHER is not set # CONFIG_TR is not set # CONFIG_FDDI is not set # CONFIG_ARCNET is not set diff --git a/arch/i386/defconfig b/arch/i386/defconfig index 1e6d733934e3..b568a45b0e85 100644 --- a/arch/i386/defconfig +++ b/arch/i386/defconfig @@ -101,7 +101,6 @@ CONFIG_SKB_LARGE=y CONFIG_NETDEVICES=y CONFIG_DUMMY=m # CONFIG_EQUALIZER is not set -# CONFIG_DLCI is not set # CONFIG_PLIP is not set # CONFIG_PPP is not set # CONFIG_SLIP is not set @@ -117,7 +116,6 @@ CONFIG_EL3=y # CONFIG_NET_ISA is not set # CONFIG_NET_EISA is not set # CONFIG_NET_POCKET is not set -# CONFIG_GIGAETHER is not set # CONFIG_TR is not set # CONFIG_FDDI is not set # CONFIG_ARCNET is not set diff --git a/arch/i386/kernel/vm86.c b/arch/i386/kernel/vm86.c index 96a51512e6ab..d217994a432e 100644 --- a/arch/i386/kernel/vm86.c +++ b/arch/i386/kernel/vm86.c @@ -104,7 +104,7 @@ static void mark_screen_rdonly(struct task_struct * tsk) -static do_vm86_irq_handling(int subfunction, int irqnumber); +static int do_vm86_irq_handling(int subfunction, int irqnumber); static void do_sys_vm86(struct kernel_vm86_struct *info, struct task_struct *tsk); asmlinkage int sys_vm86old(struct vm86_struct * v86) diff --git a/drivers/char/Config.in b/drivers/char/Config.in index a339033498a9..a6e3464c4f44 100644 --- a/drivers/char/Config.in +++ b/drivers/char/Config.in @@ -57,6 +57,7 @@ if [ "$CONFIG_APM" = "y" ]; then bool ' Make CPU Idle calls when idle' CONFIG_APM_CPU_IDLE bool ' Enable console blanking using APM' CONFIG_APM_DISPLAY_BLANK bool ' Power off on shutdown' CONFIG_APM_POWER_OFF + bool ' Ignore multiple suspend' CONFIG_APM_IGNORE_MULTIPLE_SUSPEND fi bool 'Watchdog Timer Support' CONFIG_WATCHDOG if [ "$CONFIG_WATCHDOG" != "n" ]; then diff --git a/drivers/char/apm_bios.c b/drivers/char/apm_bios.c index b255a78fcfd0..04a7b1311a41 100644 --- a/drivers/char/apm_bios.c +++ b/drivers/char/apm_bios.c @@ -124,6 +124,11 @@ extern unsigned long get_cmos_time(void); * problems have been reported when using this option with gpm (if you'd * like to debug this, please do so). * + * CONFIG_APM_IGNORE_MULTIPLE_SUSPEND: The IBM TP560 bios seems to insist + * on returning multiple suspend/standby events whenever one occurs. We + * really only need one at a time, so just ignore any beyond the first. + * This is probably safe on most laptops. + * * If you are debugging the APM support for your laptop, note that code for * all of these options is contained in this file, so you can #define or * #undef these on the next line to avoid recompiling the whole kernel. @@ -330,6 +335,9 @@ static int clock_slowed = 0; #endif static int suspends_pending = 0; static int standbys_pending = 0; +#ifdef CONFIG_APM_IGNORE_MULTIPLE_SUSPEND +static int waiting_for_resume = 0; +#endif static long clock_cmos_diff; static int got_clock_diff = 0; @@ -586,8 +594,15 @@ static int queue_event(apm_event_t event, struct apm_bios_struct *sender) if (as == sender) continue; as->event_head = (as->event_head + 1) % APM_MAX_EVENTS; - if (as->event_head == as->event_tail) + if (as->event_head == as->event_tail) { + static int notified; + + if (notified == 0) { + printk( "apm_bios: an event queue overflowed\n" ); + notified = 1; + } as->event_tail = (as->event_tail + 1) % APM_MAX_EVENTS; + } as->events[as->event_head] = event; if (!as->suser) continue; @@ -692,9 +707,23 @@ static void check_events(void) apm_event_t event; while ((event = get_event()) != 0) { +#ifdef APM_DEBUG + if (event <= NR_APM_EVENT_NAME) + printk("APM BIOS received %s notify\n", + apm_event_name[event - 1]); + else + printk("APM BIOS received unknown event 0x%02x\n", + event); +#endif switch (event) { case APM_SYS_STANDBY: case APM_USER_STANDBY: +#ifdef CONFIG_APM_IGNORE_MULTIPLE_SUSPEND + if (waiting_for_resume) { + return; + } + waiting_for_resume = 1; +#endif send_event(event, APM_STANDBY_RESUME, NULL); if (standbys_pending <= 0) standby(); @@ -707,6 +736,12 @@ static void check_events(void) break; #endif case APM_SYS_SUSPEND: +#ifdef CONFIG_APM_IGNORE_MULTIPLE_SUSPEND + if (waiting_for_resume) { + return; + } + waiting_for_resume = 1; +#endif send_event(event, APM_NORMAL_RESUME, NULL); if (suspends_pending <= 0) suspend(); @@ -715,6 +750,9 @@ static void check_events(void) case APM_NORMAL_RESUME: case APM_CRITICAL_RESUME: case APM_STANDBY_RESUME: +#ifdef CONFIG_APM_IGNORE_MULTIPLE_SUSPEND + waiting_for_resume = 0; +#endif set_time(); send_event(event, 0, NULL); break; @@ -732,14 +770,6 @@ static void check_events(void) suspend(); break; } -#ifdef APM_DEBUG - if (event <= NR_APM_EVENT_NAME) - printk("APM BIOS received %s notify\n", - apm_event_name[event - 1]); - else - printk("APM BIOS received unknown event 0x%02x\n", - event); -#endif } } diff --git a/drivers/net/arcnet.c b/drivers/net/arcnet.c index 2e18e2d5b069..ef8ab74b1d38 100644 --- a/drivers/net/arcnet.c +++ b/drivers/net/arcnet.c @@ -373,7 +373,7 @@ int arcnet_debug = ARCNET_DEBUG; /* macros to simplify debug checking */ #define BUGLVL(x) if ((ARCNET_DEBUG_MAX)&arcnet_debug&(x)) -#define BUGMSG2(x,msg,args...) BUGLVL(x) printk(msg, ## args) +#define BUGMSG2(x,msg,args...) do{BUGLVL(x) printk(msg, ## args);}while(0) #define BUGMSG(x,msg,args...) BUGMSG2(x,"%s%6s: " msg, \ x==D_NORMAL ? KERN_WARNING : \ x<=D_INIT_REASONS ? KERN_INFO : KERN_DEBUG , \ diff --git a/drivers/net/hp100.c b/drivers/net/hp100.c index 34064348bfaf..0f1bdd3c72d5 100644 --- a/drivers/net/hp100.c +++ b/drivers/net/hp100.c @@ -2,7 +2,7 @@ ** hp100.c ** HP CASCADE Architecture Driver for 100VG-AnyLan Network Adapters ** -** $Id: hp100.c,v 1.54 1997/06/12 10:37:07 perex Exp perex $ +** $Id: hp100.c,v 1.56 1998/03/04 15:23:59 perex Exp perex $ ** ** Based on the HP100 driver written by Jaroslav Kysela ** Extended for new busmaster capable chipsets by @@ -17,6 +17,7 @@ ** -- HP J2973 10 Mbit/s PCI 10base-T ** -- HP J2573 10/100 ISA ** -- Compex ReadyLink ENET100-VG4 10/100 Mbit/s PCI / EISA +** -- Compex FreedomLine 100/VG 10/100 Mbit/s ISA / EISA / PCI ** ** but it should also work with the other CASCADE based adapters. ** @@ -27,6 +28,7 @@ ** - To reduce interrupt load in busmaster, one could switch off ** the interrupts that are used to refill the queues whenever the ** queues are filled up to more than a certain threshold. +** - some updates for EISA version of card ** ** ** This source/code is public free; you can distribute it and/or modify @@ -34,6 +36,18 @@ ** Free Software Foundation) either version two of this License, or any ** later version. ** +** 1.55 -> 1.56 +** - removed printk in misc. interrupt and update statistics to allow +** monitoring of card status +** - timing changes in xmit routines, relogin to 100VG hub added when +** driver does reset +** - included fix for Compex FreedomLine PCI adapter +** +** 1.54 -> 1.55 +** - fixed bad initialization in init_module +** - added Compex FreedomLine adapter +** - some fixes in card initialization +** ** 1.53 -> 1.54 ** - added hardware multicast filter support (doesn't work) ** - little changes in hp100_sense_lan routine @@ -115,6 +129,12 @@ typedef struct net_device_stats hp100_stats_t; #ifndef PCI_DEVICE_ID_COMPEX_ENET100VG4 #define PCI_DEVICE_ID_COMPEX_ENET100VG4 0x0112 #endif +#ifndef PCI_VENDOR_ID_COMPEX2 +#define PCI_VENDOR_ID_COMPEX2 0x101a +#endif +#ifndef PCI_DEVICE_ID_COMPEX2_100VG +#define PCI_DEVICE_ID_COMPEX2_100VG 0x0005 +#endif #define HP100_REGION_SIZE 0x20 /* for ioports */ @@ -141,11 +161,17 @@ struct hp100_eisa_id { u_char bus; }; +struct hp100_pci_id { + u_short vendor; + u_short device; +}; + struct hp100_private { struct hp100_eisa_id *id; u_short chip; u_short soft_model; u_int memory_size; + u_int virt_memory_size; u_short rx_ratio; /* 1 - 99 */ u_short priority_tx; /* != 0 - priority tx */ u_short mode; /* PIO, Shared Mem or Busmaster */ @@ -213,10 +239,35 @@ static struct hp100_eisa_id hp100_eisa_ids[] = { /* 10/100 EISA card from Compex */ { 0x0103180e, "ReadyLink ENET100-VG4", HP100_BUS_EISA }, + /* 10/100 EISA card from Compex - FreedomLine (sq5bpf) */ + /* Note: plhbrod@mbox.vol.cz reported that same ID have ISA */ + /* version of adapter, too... */ + { 0x0104180e, "FreedomLine 100/VG", HP100_BUS_EISA }, + + /* 10/100 PCI card from Compex - FreedomLine + * + * I think this card doesn't like aic7178 scsi controller, but + * I haven't tested this much. It works fine on diskless machines. + * Jacek Lipkowski + */ + { 0x021211f6, "FreedomLine 100/VG", HP100_BUS_PCI }, + /* 10/100 PCI card from Compex (J2585A compatible) */ { 0x011211f6, "ReadyLink ENET100-VG4", HP100_BUS_PCI } + }; +#define HP100_EISA_IDS_SIZE (sizeof(hp100_eisa_ids)/sizeof(struct hp100_eisa_id)) + +static struct hp100_pci_id hp100_pci_ids[] = { + { PCI_VENDOR_ID_HP, PCI_DEVICE_ID_HP_J2585A }, + { PCI_VENDOR_ID_HP, PCI_DEVICE_ID_HP_J2585B }, + { PCI_VENDOR_ID_COMPEX, PCI_DEVICE_ID_COMPEX_ENET100VG4 }, + { PCI_VENDOR_ID_COMPEX2, PCI_DEVICE_ID_COMPEX2_100VG } +}; + +#define HP100_PCI_IDS_SIZE (sizeof(hp100_pci_ids)/sizeof(struct hp100_pci_id)) + static int hp100_rx_ratio = HP100_DEFAULT_RX_RATIO; static int hp100_priority_tx = HP100_DEFAULT_PRIORITY_TX; static int hp100_mode = 1; @@ -238,13 +289,14 @@ static int hp100_start_xmit( struct sk_buff *skb, struct device *dev ); static int hp100_start_xmit_bm (struct sk_buff *skb, struct device *dev ); static void hp100_rx( struct device *dev ); static hp100_stats_t *hp100_get_stats( struct device *dev ); +static void hp100_misc_interrupt( struct device *dev ); static void hp100_update_stats( struct device *dev ); static void hp100_clear_stats( int ioaddr ); static void hp100_set_multicast_list( struct device *dev); static void hp100_interrupt( int irq, void *dev_id, struct pt_regs *regs ); static void hp100_start_interface( struct device *dev ); static void hp100_stop_interface( struct device *dev ); -static void hp100_load_eeprom( struct device *dev ); +static void hp100_load_eeprom( struct device *dev, u_short ioaddr ); static int hp100_sense_lan( struct device *dev ); static int hp100_login_to_vg_hub( struct device *dev, u_short force_relogin ); static int hp100_down_vg_link( struct device *dev ); @@ -272,7 +324,7 @@ static void wait( void ) * These functions should - if possible - avoid doing write operations * since this could cause problems when the card is not installed. */ - + __initfunc(int hp100_probe( struct device *dev )) { int base_addr = dev ? dev -> base_addr : 0; @@ -322,17 +374,16 @@ __initfunc(int hp100_probe( struct device *dev )) { u_char pci_bus, pci_device_fn; u_short pci_command; + int pci_id_index; - if ((pcibios_find_device( PCI_VENDOR_ID_HP, PCI_DEVICE_ID_HP_J2585A, - pci_index, &pci_bus, - &pci_device_fn ) != 0 ) && - (pcibios_find_device( PCI_VENDOR_ID_HP, PCI_DEVICE_ID_HP_J2585B, - pci_index, &pci_bus, - &pci_device_fn ) != 0 ) && - (pcibios_find_device( PCI_VENDOR_ID_COMPEX, PCI_DEVICE_ID_COMPEX_ENET100VG4, - pci_index, &pci_bus, - &pci_device_fn ) != 0 ) ) break; + for ( pci_id_index = 0; pci_id_index < HP100_PCI_IDS_SIZE; pci_id_index++ ) + if ( pcibios_find_device( hp100_pci_ids[ pci_id_index ].vendor, + hp100_pci_ids[ pci_id_index ].device, + pci_index, &pci_bus, + &pci_device_fn ) == 0 ) goto __pci_found; + break; + __pci_found: pcibios_read_config_dword( pci_bus, pci_device_fn, PCI_BASE_ADDRESS_0, &ioaddr ); @@ -342,6 +393,15 @@ __initfunc(int hp100_probe( struct device *dev )) pcibios_read_config_word( pci_bus, pci_device_fn, PCI_COMMAND, &pci_command ); + if ( !( pci_command & PCI_COMMAND_IO ) ) + { +#ifdef HP100_DEBUG + printk( "hp100: %s: PCI I/O Bit has not been set. Setting...\n", dev->name ); +#endif + pci_command |= PCI_COMMAND_IO; + pcibios_write_config_word( pci_bus, pci_device_fn, + PCI_COMMAND, pci_command ); + } if ( !( pci_command & PCI_COMMAND_MASTER ) ) { #ifdef HP100_DEBUG @@ -386,7 +446,7 @@ __initfunc(static int hp100_probe1( struct device *dev, int ioaddr, u_char bus, u_char uc, uc_1; u_int eisa_id; u_int chip; - u_int memory_size = 0; + u_int memory_size = 0, virt_memory_size = 0; u_short local_mode, lsw; short mem_mapped; u_int *mem_ptr_phys, *mem_ptr_virt; @@ -443,14 +503,18 @@ __initfunc(static int hp100_probe1( struct device *dev, int ioaddr, u_char bus, return -ENODEV; } - for ( i=0; i= sizeof( hp100_eisa_ids ) / sizeof( struct hp100_eisa_id ) ) - { + if ( i >= HP100_EISA_IDS_SIZE ) { + for ( i = 0; i < HP100_EISA_IDS_SIZE; i++) + if ( ( hp100_eisa_ids[ i ].id & 0xf0ffffff ) == ( eisa_id & 0xf0ffffff ) ) + break; + if ( i >= HP100_EISA_IDS_SIZE ) { printk( "hp100_probe: %s: card at port 0x%x isn't known (id = 0x%x)\n", dev -> name, ioaddr, eisa_id ); - return -ENODEV; + return -ENODEV; } + } eid = &hp100_eisa_ids[ i ]; if ( ( eid->id & 0x0f000000 ) < ( eisa_id & 0x0f000000 ) ) { @@ -468,7 +532,13 @@ __initfunc(static int hp100_probe1( struct device *dev, int ioaddr, u_char bus, return -EIO; } - /* Determine driver operation mode + /* Make sure, that all registers are correctly updated... */ + + hp100_load_eeprom( dev, ioaddr ); + wait(); + + /* + * Determine driver operation mode * * Use the variable "hp100_mode" upon insmod or as kernel parameter to * force driver modes: @@ -478,6 +548,22 @@ __initfunc(static int hp100_probe1( struct device *dev, int ioaddr, u_char bus, * hp100_mode=4 -> same as 1, but re-set the enable bit on the card. */ + /* + * LSW values: + * 0x2278 -> J2585B, PnP shared memory mode + * 0x2270 -> J2585B, shared memory mode, 0xdc000 + * 0xa23c -> J2585B, I/O mapped mode + * 0x2240 -> EISA COMPEX, BusMaster (Shasta Chip) + * 0x2220 -> EISA HP, I/O (Shasta Chip) + * 0x2260 -> EISA HP, BusMaster (Shasta Chip) + */ + +#if 0 + local_mode = 0x2270; + hp100_outw(0xfefe,OPTION_LSW); + hp100_outw(local_mode|HP100_SET_LB|HP100_SET_HB,OPTION_LSW); +#endif + /* hp100_mode value maybe used in future by another card */ local_mode=hp100_mode; if ( local_mode < 1 || local_mode > 4 ) @@ -536,7 +622,8 @@ __initfunc(static int hp100_probe1( struct device *dev, int ioaddr, u_char bus, else { #ifdef HP100_DEBUG - printk("hp100: %s: Card not configured for BM or BM not supported with this card. Trying shared memory mode.\n", dev->name); + printk("hp100: %s: Card not configured for BM or BM not supported with this card.\n", dev->name ); + printk("hp100: %s: Trying shared memory mode.\n", dev->name); #endif /* In this case, try shared memory mode */ local_mode=2; @@ -554,6 +641,7 @@ __initfunc(static int hp100_probe1( struct device *dev, int ioaddr, u_char bus, mem_mapped = (( hp100_inw( OPTION_LSW ) & ( HP100_MEM_EN ) ) != 0); mem_ptr_phys = mem_ptr_virt = NULL; memory_size = (8192<<( (hp100_inb(SRAM)>>5)&0x07)); + virt_memory_size = 0; /* For memory mapped or busmaster mode, we want the memory address */ if ( mem_mapped || (local_mode==1)) @@ -574,21 +662,21 @@ __initfunc(static int hp100_probe1( struct device *dev, int ioaddr, u_char bus, /* However in slave mode we need to remap high (>1GB) card memory */ if(local_mode!=1) /* = not busmaster */ { - if ( bus == HP100_BUS_PCI ) + if ( bus == HP100_BUS_PCI && mem_ptr_phys >= (u_int *)0x100000 ) { /* We try with smaller memory sizes, if ioremap fails */ - for(; memory_size>16383; memory_size=memory_size/2) + for(virt_memory_size = memory_size; virt_memory_size>16383; virt_memory_size>>=1) { - if((mem_ptr_virt=ioremap((u_long)mem_ptr_phys,memory_size))==NULL) + if((mem_ptr_virt=ioremap((u_long)mem_ptr_phys,virt_memory_size))==NULL) { #ifdef HP100_DEBUG - printk( "hp100: %s: ioremap for 0x%x bytes high PCI memory at 0x%lx failed\n", dev->name, memory_size, (u_long)mem_ptr_phys ); + printk( "hp100: %s: ioremap for 0x%x bytes high PCI memory at 0x%lx failed\n", dev->name, virt_memory_size, (u_long)mem_ptr_phys ); #endif } else { #ifdef HP100_DEBUG - printk( "hp100: %s: remapped 0x%x bytes high PCI memory at 0x%lx to 0x%lx.\n", dev->name, memory_size, (u_long)mem_ptr_phys, (u_long)mem_ptr_virt); + printk( "hp100: %s: remapped 0x%x bytes high PCI memory at 0x%lx to 0x%lx.\n", dev->name, virt_memory_size, (u_long)mem_ptr_phys, (u_long)mem_ptr_virt); #endif break; } @@ -598,7 +686,7 @@ __initfunc(static int hp100_probe1( struct device *dev, int ioaddr, u_char bus, { printk("hp100: %s: Failed to ioremap the PCI card memory. Will have to use i/o mapped mode.\n", dev->name); local_mode=3; - memory_size = (8192<<( (hp100_inb(SRAM)>>5)&0x07) ); + virt_memory_size = 0; } } } @@ -637,6 +725,7 @@ __initfunc(static int hp100_probe1( struct device *dev, int ioaddr, u_char bus, dev->base_addr = ioaddr; lp->memory_size = memory_size; + lp->virt_memory_size = virt_memory_size; lp->rx_ratio = hp100_rx_ratio; /* can be conf'd with insmod */ /* memory region for programmed i/o */ @@ -724,7 +813,8 @@ __initfunc(static int hp100_probe1( struct device *dev, int ioaddr, u_char bus, if ( lp->mode==2 ) /* memory mapped */ { printk( "hp100: %s: Memory area at 0x%lx-0x%lx", - dev->name,(u_long)mem_ptr_phys,(u_long)mem_ptr_phys+(u_long)lp->memory_size ); + dev->name,(u_long)mem_ptr_phys, + ((u_long)mem_ptr_phys+(mem_ptr_phys>(u_int *)0x100000?(u_long)lp->memory_size:16*1024))-1 ); if ( mem_ptr_virt ) printk( " (virtual base 0x%lx)", (u_long)mem_ptr_virt ); printk( ".\n" ); @@ -786,7 +876,7 @@ static void hp100_hwinit( struct device *dev ) } /* Initiate EEPROM reload */ - hp100_load_eeprom( dev ); + hp100_load_eeprom( dev, 0 ); wait(); @@ -1447,6 +1537,7 @@ static void hp100_BM_shutdown( struct device *dev ) /* tx function for busmaster mode */ static int hp100_start_xmit_bm( struct sk_buff *skb, struct device *dev ) { + unsigned long flags; int i, ok_flag; int ioaddr = dev->base_addr; struct hp100_private *lp = (struct hp100_private *)dev->priv; @@ -1459,7 +1550,9 @@ static int hp100_start_xmit_bm( struct sk_buff *skb, struct device *dev ) if ( skb==NULL ) { +#ifndef LINUX_2_1 dev_tint( dev ); +#endif return 0; } @@ -1473,7 +1566,7 @@ static int hp100_start_xmit_bm( struct sk_buff *skb, struct device *dev ) printk("hp100: %s: start_xmit_bm: No TX PDL available.\n", dev->name); #endif /* not waited long enough since last tx? */ - if ( jiffies - dev->trans_start < HZ/10 ) return -EAGAIN; + if ( jiffies - dev->trans_start < HZ ) return -EAGAIN; if ( lp->lan_type < 0 ) /* no LAN type detected yet? */ { @@ -1519,6 +1612,8 @@ static int hp100_start_xmit_bm( struct sk_buff *skb, struct device *dev ) { printk( "hp100: %s: interface reset\n", dev->name ); hp100_stop_interface( dev ); + if ( lp->lan_type == HP100_LAN_100 ) + lp->hub_status = hp100_login_to_vg_hub( dev, FALSE ); hp100_start_interface( dev ); } } @@ -1531,6 +1626,7 @@ static int hp100_start_xmit_bm( struct sk_buff *skb, struct device *dev ) * we have to turn int's off before modifying this, otherwise * a tx_pdl_cleanup could occur at the same time */ + save_flags( flags ); cli(); ringptr=lp->txrtail; lp->txrtail=ringptr->next; @@ -1557,7 +1653,7 @@ static int hp100_start_xmit_bm( struct sk_buff *skb, struct device *dev ) hp100_outl( ringptr->pdl_paddr, TX_PDA_L ); /* Low Prio. Queue */ lp->txrcommit++; - sti(); + restore_flags( flags ); /* Update statistics */ lp->stats.tx_packets++; @@ -1606,7 +1702,11 @@ static void hp100_clean_txring( struct device *dev ) hp100_inb(TX_PDL), donecount); #endif +#ifdef LINUX_2_1 + dev_kfree_skb( lp->txrhead->skb ); +#else dev_kfree_skb( lp->txrhead->skb, FREE_WRITE ); +#endif lp->txrhead->skb=(void *)NULL; lp->txrhead=lp->txrhead->next; lp->txrcommit--; @@ -1627,6 +1727,16 @@ static int hp100_start_xmit( struct sk_buff *skb, struct device *dev ) printk("hp100: %s: start_xmit\n", dev->name); #endif + if ( skb==NULL ) + { +#ifndef LINUX_2_1 + dev_tint( dev ); +#endif + return 0; + } + + if ( skb->len <= 0 ) return 0; + if ( lp->lan_type < 0 ) /* no LAN type detected yet? */ { hp100_stop_interface( dev ); @@ -1649,7 +1759,7 @@ static int hp100_start_xmit( struct sk_buff *skb, struct device *dev ) printk( "hp100: %s: start_xmit: tx free mem = 0x%x\n", dev->name, i ); #endif /* not waited long enough since last failed tx try? */ - if ( jiffies - dev->trans_start < HZ/2 ) + if ( jiffies - dev->trans_start < HZ ) { #ifdef HP100_DEBUG printk("hp100: %s: trans_start timing problem\n", dev->name); @@ -1686,6 +1796,8 @@ static int hp100_start_xmit( struct sk_buff *skb, struct device *dev ) { printk( "hp100: %s: interface reset\n", dev->name ); hp100_stop_interface( dev ); + if ( lp->lan_type == HP100_LAN_100 ) + lp->hub_status = hp100_login_to_vg_hub( dev, FALSE ); hp100_start_interface( dev ); udelay(1000); } @@ -1721,13 +1833,14 @@ static int hp100_start_xmit( struct sk_buff *skb, struct device *dev ) if ( lp->mem_ptr_virt ) /* high pci memory was remapped */ { /* Note: The J2585B needs alignment to 32bits here! */ - memcpy( lp->mem_ptr_virt, skb->data, ( skb->len +3 ) & ~3 ); + memcpy( lp->mem_ptr_virt, skb->data, ( skb->len + 3 ) & ~3 ); if ( !ok_flag ) memset( lp->mem_ptr_virt, 0, HP100_MIN_PACKET_SIZE - skb->len ); } else { - memcpy_toio( lp->mem_ptr_phys, skb->data, skb->len ); + /* Note: The J2585B needs alignment to 32bits here! */ + memcpy_toio( lp->mem_ptr_phys, skb->data, (skb->len + 3) & ~3 ); if ( !ok_flag ) memset_io( lp->mem_ptr_phys, 0, HP100_MIN_PACKET_SIZE - skb->len ); } @@ -1749,7 +1862,11 @@ static int hp100_start_xmit( struct sk_buff *skb, struct device *dev ) dev->trans_start=jiffies; hp100_ints_on(); +#ifdef LINUX_2_1 + dev_kfree_skb( skb ); +#else dev_kfree_skb( skb, FREE_WRITE ); +#endif #ifdef HP100_DEBUG_TX printk( "hp100: %s: start_xmit: end\n", dev->name ); @@ -1814,7 +1931,7 @@ static void hp100_rx( struct device *dev ) else /* programmed i/o */ header = hp100_inl( DATA32 ); - pkt_len = header & HP100_PKT_LEN_MASK; + pkt_len = ((header & HP100_PKT_LEN_MASK) + 3) & ~3; #ifdef HP100_DEBUG_RX printk( "hp100: %s: rx: new packet - length=%d, errors=0x%x, dest=0x%x\n", @@ -1824,10 +1941,6 @@ static void hp100_rx( struct device *dev ) #endif /* Now we allocate the skb and transfer the data into it. */ - /* NOTE! This (and the skb_put() below) depends on the skb-functions - * allocating more than asked (notably, aligning the request up to - * the next 16-byte length). - */ skb = dev_alloc_skb( pkt_len ); if ( skb == NULL ) /* Not enough memory->drop packet */ { @@ -1849,13 +1962,13 @@ static void hp100_rx( struct device *dev ) if ( lp->mode==2 ) { if ( lp->mem_ptr_virt ) - memcpy( ptr, lp->mem_ptr_virt, ( pkt_len + 3 ) & ~3 ); + memcpy( ptr, lp->mem_ptr_virt, pkt_len ); /* Note alignment to 32bit transfers */ else - memcpy_fromio( ptr, lp->mem_ptr_phys, ( pkt_len + 3 ) & ~3 ); + memcpy_fromio( ptr, lp->mem_ptr_phys, pkt_len ); } else /* io mapped */ - insl( ioaddr + HP100_REG_DATA32, ptr, ( pkt_len + 3 ) >> 2 ); + insl( ioaddr + HP100_REG_DATA32, ptr, pkt_len >> 2 ); skb->protocol = eth_type_trans( skb, dev ); @@ -1987,7 +2100,11 @@ static void hp100_rx_bm( struct device *dev ) printk("hp100: %s: rx_bm: Received bad packet (length=%d)\n",dev->name,pkt_len); #endif if(ptr->skb!=NULL) +#ifdef LINUX_2_1 + dev_kfree_skb( ptr->skb ); +#else dev_kfree_skb( ptr->skb, FREE_READ ); +#endif lp->stats.rx_errors++; } @@ -2055,20 +2172,37 @@ static void hp100_update_stats( struct device *dev ) hp100_page( PERFORMANCE ); } +static void hp100_misc_interrupt( struct device *dev ) +{ + struct hp100_private *lp = (struct hp100_private *)dev->priv; + +#ifdef HP100_DEBUG_B + hp100_outw( 0x4216, TRACE ); + printk("hp100: %s: misc_interrupt\n", dev->name); +#endif + + /* Note: Statistics counters clear when read. */ + lp->stats.rx_errors++; + lp->stats.tx_errors++; +} + static void hp100_clear_stats( int ioaddr ) { + unsigned long flags; + #ifdef HP100_DEBUG_B hp100_outw( 0x4217, TRACE ); printk("hp100: %s: clear_stats\n", dev->name); #endif + save_flags( flags ); cli(); hp100_page( MAC_CTRL ); /* get all statistics bytes */ hp100_inw( DROPPED ); hp100_inb( CRC ); hp100_inb( ABORT ); hp100_page( PERFORMANCE ); - sti(); + restore_flags( flags ); } @@ -2080,8 +2214,9 @@ static void hp100_clear_stats( int ioaddr ) * Set or clear the multicast filter for this adapter. */ -static void hp100_set_multicast_list( struct device *dev) +static void hp100_set_multicast_list( struct device *dev ) { + unsigned long flags; int ioaddr = dev->base_addr; struct hp100_private *lp = (struct hp100_private *)dev->priv; @@ -2090,6 +2225,7 @@ static void hp100_set_multicast_list( struct device *dev) printk("hp100: %s: set_mc_list\n", dev->name); #endif + save_flags( flags ); cli(); hp100_ints_off(); hp100_page( MAC_CTRL ); @@ -2223,7 +2359,7 @@ static void hp100_set_multicast_list( struct device *dev) hp100_page( PERFORMANCE ); hp100_ints_on(); - sti(); + restore_flags( flags ); } @@ -2354,12 +2490,15 @@ static void hp100_interrupt( int irq, void *dev_id, struct pt_regs *regs ) */ if ( val & HP100_MISC_ERROR ) /* New for J2585B */ { +#ifdef HP100_DEBUG_IRQ printk("hp100: %s: Misc. Error Interrupt - Check cabling.\n", dev->name); +#endif if(lp->mode==1) { hp100_clean_txring( dev ); hp100_rxfill( dev ); } + hp100_misc_interrupt( dev ); } dev->interrupt = 0; @@ -2373,6 +2512,7 @@ static void hp100_interrupt( int irq, void *dev_id, struct pt_regs *regs ) static void hp100_start_interface( struct device *dev ) { + unsigned long flags; int ioaddr = dev->base_addr; struct hp100_private *lp = (struct hp100_private *)dev->priv; @@ -2381,6 +2521,7 @@ static void hp100_start_interface( struct device *dev ) printk("hp100: %s: hp100_start_interface\n",dev->name); #endif + save_flags( flags ); cli(); /* Ensure the adapter does not want to request an interrupt when */ @@ -2430,8 +2571,9 @@ static void hp100_start_interface( struct device *dev ) } /* Enable MAC Tx and RX, set MAC modes, ... */ - /* Note: This function also turns on the interrupts. */ hp100_set_multicast_list( dev ); + + restore_flags( flags ); } @@ -2473,10 +2615,10 @@ static void hp100_stop_interface( struct device *dev ) } -static void hp100_load_eeprom( struct device *dev ) +static void hp100_load_eeprom( struct device *dev, u_short probe_ioaddr ) { int i; - int ioaddr = dev->base_addr; + int ioaddr = probe_ioaddr > 0 ? probe_ioaddr : dev->base_addr; #ifdef HP100_DEBUG_B hp100_outw( 0x4222, TRACE ); @@ -2915,14 +3057,13 @@ static struct device *hp100_devlist[5] = { NULL, NULL, NULL, NULL, NULL }; int init_module( void ) { - int i; - int ret = 0; + int i, cards; if (hp100_port == 0 && !EISA_bus && !pcibios_present()) printk("hp100: You should not use auto-probing with insmod!\n"); /* Loop on all possible base addresses */ - i = -1; + i = -1; cards = 0; while((hp100_port[++i] != -1) && (i < 5)) { /* Create device and set basics args */ @@ -2939,11 +3080,12 @@ int init_module( void ) /* Note: if dev->priv is mallocated, there is no way to fail */ kfree_s(hp100_devlist[i], sizeof(struct device)); hp100_devlist[i] = (struct device *) NULL; - ret = -EIO; } + else + cards++; } /* Loop over all devices */ - return ret; + return cards > 0 ? 0 : -ENODEV; } void cleanup_module( void ) diff --git a/drivers/net/sk_g16.c b/drivers/net/sk_g16.c index 696acafefc30..f07b6e4ba03d 100644 --- a/drivers/net/sk_g16.c +++ b/drivers/net/sk_g16.c @@ -778,17 +778,17 @@ int SK_probe(struct device *dev, short ioaddr) dev->dev_addr[4], dev->dev_addr[5]); - /* Grab the I/O Port region */ - request_region(ioaddr, ETHERCARD_TOTAL_SIZE,"sk_g16"); - - /* Initialize device structure */ - /* Allocate memory for private structure */ p = dev->priv = (void *) kmalloc(sizeof(struct priv), GFP_KERNEL); - if (p == NULL) + if (p == NULL) { + printk("%s: ERROR - no memory for driver data!\n", dev->name); return -ENOMEM; + } memset((char *) dev->priv, 0, sizeof(struct priv)); /* clear memory */ + /* Grab the I/O Port region */ + request_region(ioaddr, ETHERCARD_TOTAL_SIZE,"sk_g16"); + /* Assign our Device Driver functions */ dev->open = &SK_open; diff --git a/drivers/scsi/scsi_ioctl.c b/drivers/scsi/scsi_ioctl.c index ce385eba2d66..e0a649462209 100644 --- a/drivers/scsi/scsi_ioctl.c +++ b/drivers/scsi/scsi_ioctl.c @@ -348,6 +348,11 @@ int scsi_ioctl (Scsi_Device *dev, int cmd, void *arg) (unsigned long *) arg); put_user( dev->host->unique_id, (unsigned long *) arg+1); return 0; + case SCSI_IOCTL_GET_BUS_NUMBER: + result = verify_area(VERIFY_WRITE, (void *) arg, sizeof(int)); + if (result) return result; + put_user( dev->host->host_no, (int *) arg); + return 0; case SCSI_IOCTL_TAGGED_ENABLE: if(!suser()) return -EACCES; if(!dev->tagged_supported) return -EINVAL; diff --git a/drivers/scsi/sr_ioctl.c b/drivers/scsi/sr_ioctl.c index f483b89bd438..be62eb8cd33c 100644 --- a/drivers/scsi/sr_ioctl.c +++ b/drivers/scsi/sr_ioctl.c @@ -523,35 +523,8 @@ int sr_ioctl(struct inode * inode, struct file * file, unsigned int cmd, unsigne case CDROMREADRAW: case CDROMREADMODE1: case CDROMREADMODE2: - { - unsigned char *raw; - struct cdrom_msf msf; - int blocksize, lba, rc; - - if (cmd == CDROMREADMODE1) - blocksize = CD_FRAMESIZE; /* 2048 */ - else if (cmd == CDROMREADMODE2) - blocksize = CD_FRAMESIZE_RAW0; /* 2336 */ - else - /* some SCSI drives do not allow this one */ - blocksize = CD_FRAMESIZE_RAW; /* 2352 */ - - if (copy_from_user(&msf,(void*)arg,sizeof(msf))) - return -EFAULT; - if (!(raw = scsi_malloc(2048+512))) - return -ENOMEM; - - lba = (((msf.cdmsf_min0 * CD_SECS) + msf.cdmsf_sec0) - * CD_FRAMES + msf.cdmsf_frame0) - CD_BLOCK_OFFSET; - rc = sr_read_sector(target, lba, blocksize, raw); - if (!rc) - if (copy_to_user((void*)arg, raw, blocksize)) - rc = -EFAULT; - - scsi_free(raw,2048+512); - return rc; - } - + return -EINVAL; + /* block-copy from ../block/sbpcd.c with some adjustments... */ case CDROMMULTISESSION: /* tell start-of-last-session to user */ { diff --git a/drivers/sound/.defines b/drivers/sound/.defines deleted file mode 100644 index b42573cd05fa..000000000000 --- a/drivers/sound/.defines +++ /dev/null @@ -1,118 +0,0 @@ -# Computer generated file. Please don't edit - -ifdef CONFIG_PSS -CONFIG_MPU_EMU=y -endif - -ifdef CONFIG_SSCAPE -CONFIG_MPU_EMU=y -endif - -ifdef CONFIG_CS4232 -CONFIG_MPU_EMU=y -endif - -ifdef CONFIG_MAUI -CONFIG_MPU_EMU=y -endif - -ifdef CONFIG_PSS -CONFIG_AD1848=y -endif - -ifdef CONFIG_GUS16 -CONFIG_AD1848=y -endif - -ifdef CONFIG_GUSMAX -CONFIG_AD1848=y -endif - -ifdef CONFIG_MSS -CONFIG_AD1848=y -endif - -ifdef CONFIG_SSCAPE -CONFIG_AD1848=y -endif - -ifdef CONFIG_TRIX -CONFIG_AD1848=y -endif - -ifdef CONFIG_MAD16 -CONFIG_AD1848=y -endif - -ifdef CONFIG_CS4232 -CONFIG_AD1848=y -endif - -ifdef CONFIG_SB -CONFIG_SBDSP=y -endif - -ifdef CONFIG_TRIX -CONFIG_SBDSP=y -endif - -ifdef CONFIG_MAD16 -CONFIG_SBDSP=y -endif - -ifdef CONFIG_SB -CONFIG_UART401=y -endif - -ifdef CONFIG_TRIX -CONFIG_UART401=y -endif - -ifdef CONFIG_MAD16 -CONFIG_UART401=y -endif - -ifdef CONFIG_PAS -CONFIG_SEQUENCER=y -endif - -ifdef CONFIG_SB -CONFIG_SEQUENCER=y -endif - -ifdef CONFIG_ADLIB -CONFIG_SEQUENCER=y -endif - -ifdef CONFIG_GUS -CONFIG_SEQUENCER=y -endif - -ifdef CONFIG_MPU401 -CONFIG_SEQUENCER=y -endif - -ifdef CONFIG_PSS -CONFIG_SEQUENCER=y -endif - -ifdef CONFIG_SSCAPE -CONFIG_SEQUENCER=y -endif - -ifdef CONFIG_TRIX -CONFIG_SEQUENCER=y -endif - -ifdef CONFIG_MAD16 -CONFIG_SEQUENCER=y -endif - -ifdef CONFIG_CS4232 -CONFIG_SEQUENCER=y -endif - -ifdef CONFIG_MAUI -CONFIG_SEQUENCER=y -endif - diff --git a/drivers/sound/Config.in b/drivers/sound/Config.in index b160c29e591e..b1bc3607904b 100644 --- a/drivers/sound/Config.in +++ b/drivers/sound/Config.in @@ -1,251 +1,15 @@ -bool 'ProAudioSpectrum 16 support' CONFIG_PAS -bool 'Sound Blaster (SB, SBPro, SB16, clones) support' CONFIG_SB -bool 'Generic OPL2/OPL3 FM synthesizer support' CONFIG_ADLIB -bool 'Gravis Ultrasound support' CONFIG_GUS -bool 'MPU-401 support (NOT for SB16)' CONFIG_MPU401 -bool '6850 UART Midi support' CONFIG_UART6850 -bool 'PSS (ECHO-ADI2111) support' CONFIG_PSS -bool '16 bit sampling option of GUS (_NOT_ GUS MAX)' CONFIG_GUS16 -bool 'GUS MAX support' CONFIG_GUSMAX -bool 'Microsoft Sound System support' CONFIG_MSS -bool 'Ensoniq SoundScape support' CONFIG_SSCAPE -bool 'MediaTrix AudioTrix Pro support' CONFIG_TRIX -bool 'Support for MAD16 and/or Mozart based cards' CONFIG_MAD16 -bool 'Support for Crystal CS4232 based (PnP) cards' CONFIG_CS4232 -bool 'Support for Turtle Beach Wave Front (Maui, Tropez) synthesizers' CONFIG_MAUI -bool '/dev/dsp and /dev/audio support' CONFIG_AUDIO -bool 'MIDI interface support' CONFIG_MIDI -bool 'FM synthesizer (YM3812/OPL-3) support' CONFIG_YM3812 - -if [ "$CONFIG_SB" = "y" ]; then -hex 'I/O base for SB Check from manual of the card' SBC_BASE 220 -fi - -if [ "$CONFIG_SB" = "y" ]; then -int 'Sound Blaster IRQ Check from manual of the card' SBC_IRQ 7 -fi - -if [ "$CONFIG_SB" = "y" ]; then -int 'Sound Blaster DMA 0, 1 or 3' SBC_DMA 1 -fi - -if [ "$CONFIG_SB" = "y" ]; then -int 'Sound Blaster 16 bit DMA (_REQUIRED_for SB16, Jazz16, SMW) 5, 6 or 7 (use 1 for 8 bit cards)' SB_DMA2 5 -fi - -if [ "$CONFIG_SB" = "y" ]; then -hex 'MPU401 I/O base of SB16, Jazz16 and ES1688 Check from manual of the card' SB_MPU_BASE 0 -fi - -if [ "$CONFIG_SB" = "y" ]; then -int 'SB MPU401 IRQ (Jazz16, SM Wave and ES1688) Use -1 with SB16' SB_MPU_IRQ -1 -fi - -if [ "$CONFIG_PAS" = "y" ]; then -int 'PAS16 IRQ 3, 4, 5, 7, 9, 10, 11, 12, 14 or 15' PAS_IRQ 10 -fi - -if [ "$CONFIG_PAS" = "y" ]; then -int 'PAS16 DMA 0, 1, 3, 5, 6 or 7' PAS_DMA 3 -fi - -if [ "$CONFIG_GUS" = "y" ]; then -hex 'I/O base for GUS 210, 220, 230, 240, 250 or 260' GUS_BASE 220 -fi - -if [ "$CONFIG_GUS" = "y" ]; then -int 'GUS IRQ 3, 5, 7, 9, 11, 12 or 15' GUS_IRQ 15 -fi - -if [ "$CONFIG_GUS" = "y" ]; then -int 'GUS DMA 1, 3, 5, 6 or 7' GUS_DMA 6 -fi - -if [ "$CONFIG_GUS" = "y" ]; then -int 'Second DMA channel for GUS 1, 3, 5, 6 or 7' GUS_DMA2 -1 -fi - -if [ "$CONFIG_GUS16" = "y" ]; then -hex 'I/O base for the 16 bit daughtercard of GUS 530, 604, E80 or F40' GUS16_BASE 530 -fi - -if [ "$CONFIG_GUS16" = "y" ]; then -int 'GUS 16 bit daughtercard IRQ 3, 4, 5, 7, or 9' GUS16_IRQ 7 -fi - -if [ "$CONFIG_GUS16" = "y" ]; then -int 'GUS DMA 0, 1 or 3' GUS16_DMA 3 -fi - -if [ "$CONFIG_MPU401" = "y" ]; then -hex 'I/O base for MPU401 Check from manual of the card' MPU_BASE 330 -fi - -if [ "$CONFIG_MPU401" = "y" ]; then -int 'MPU401 IRQ Check from manual of the card' MPU_IRQ 9 -fi - -if [ "$CONFIG_MAUI" = "y" ]; then -hex 'I/O base for Maui 210, 230, 260, 290, 300, 320, 338 or 330' MAUI_BASE 330 -fi - -if [ "$CONFIG_MAUI" = "y" ]; then -int 'Maui IRQ 5, 9, 12 or 15' MAUI_IRQ 9 -fi - -if [ "$CONFIG_UART6850" = "y" ]; then -hex 'I/O base for UART 6850 MIDI port (Unknown)' U6850_BASE 0 -fi - -if [ "$CONFIG_UART6850" = "y" ]; then -int 'UART6850 IRQ (Unknown)' U6850_IRQ -1 -fi - -if [ "$CONFIG_PSS" = "y" ]; then -hex 'PSS I/O base 220 or 240' PSS_BASE 220 -fi - -if [ "$CONFIG_PSS" = "y" ]; then -hex 'PSS audio I/O base 530, 604, E80 or F40' PSS_MSS_BASE 530 -fi - -if [ "$CONFIG_PSS" = "y" ]; then -int 'PSS audio IRQ 7, 9, 10 or 11' PSS_MSS_IRQ 11 -fi - -if [ "$CONFIG_PSS" = "y" ]; then -int 'PSS audio DMA 0, 1 or 3' PSS_MSS_DMA 3 -fi - -if [ "$CONFIG_PSS" = "y" ]; then -hex 'PSS MIDI I/O base ' PSS_MPU_BASE 330 -fi - -if [ "$CONFIG_PSS" = "y" ]; then -int 'PSS MIDI IRQ 3, 4, 5, 7 or 9' PSS_MPU_IRQ 9 -fi - -if [ "$CONFIG_MSS" = "y" ]; then -hex 'MSS/WSS I/O base 530, 604, E80 or F40' MSS_BASE 530 -fi - -if [ "$CONFIG_MSS" = "y" ]; then -int 'MSS/WSS IRQ 7, 9, 10 or 11' MSS_IRQ 11 -fi - -if [ "$CONFIG_MSS" = "y" ]; then -int 'MSS/WSS DMA 0, 1 or 3' MSS_DMA 3 -fi - -if [ "$CONFIG_SSCAPE" = "y" ]; then -hex 'SoundScape MIDI I/O base 320, 330, 340 or 350' SSCAPE_BASE 330 -fi - -if [ "$CONFIG_SSCAPE" = "y" ]; then -int 'SoundScape MIDI IRQ ' SSCAPE_IRQ 9 -fi - -if [ "$CONFIG_SSCAPE" = "y" ]; then -int 'SoundScape initialization DMA 0, 1 or 3' SSCAPE_DMA 3 -fi - -if [ "$CONFIG_SSCAPE" = "y" ]; then -hex 'SoundScape audio I/O base 534, 608, E84 or F44' SSCAPE_MSS_BASE 534 -fi - -if [ "$CONFIG_SSCAPE" = "y" ]; then -int 'SoundScape audio IRQ 7, 9, 10 or 11' SSCAPE_MSS_IRQ 11 -fi - -if [ "$CONFIG_TRIX" = "y" ]; then -hex 'AudioTrix audio I/O base 530, 604, E80 or F40' TRIX_BASE 530 -fi - -if [ "$CONFIG_TRIX" = "y" ]; then -int 'AudioTrix audio IRQ 7, 9, 10 or 11' TRIX_IRQ 11 -fi - -if [ "$CONFIG_TRIX" = "y" ]; then -int 'AudioTrix audio DMA 0, 1 or 3' TRIX_DMA 0 -fi - -if [ "$CONFIG_TRIX" = "y" ]; then -int 'AudioTrix second (duplex) DMA 0, 1 or 3' TRIX_DMA2 3 -fi - -if [ "$CONFIG_TRIX" = "y" ]; then -hex 'AudioTrix MIDI I/O base 330, 370, 3B0 or 3F0' TRIX_MPU_BASE 330 -fi - -if [ "$CONFIG_TRIX" = "y" ]; then -int 'AudioTrix MIDI IRQ 3, 4, 5, 7 or 9' TRIX_MPU_IRQ 9 -fi - -if [ "$CONFIG_TRIX" = "y" ]; then -hex 'AudioTrix SB I/O base 220, 210, 230, 240, 250, 260 or 270' TRIX_SB_BASE 220 -fi - -if [ "$CONFIG_TRIX" = "y" ]; then -int 'AudioTrix SB IRQ 3, 4, 5 or 7' TRIX_SB_IRQ 7 -fi - -if [ "$CONFIG_TRIX" = "y" ]; then -int 'AudioTrix SB DMA 1 or 3' TRIX_SB_DMA 1 -fi - -if [ "$CONFIG_CS4232" = "y" ]; then -hex 'CS4232 audio I/O base 530, 604, E80 or F40' CS4232_BASE 530 -fi - -if [ "$CONFIG_CS4232" = "y" ]; then -int 'CS4232 audio IRQ 5, 7, 9, 11, 12 or 15' CS4232_IRQ 11 -fi - -if [ "$CONFIG_CS4232" = "y" ]; then -int 'CS4232 audio DMA 0, 1 or 3' CS4232_DMA 0 -fi - -if [ "$CONFIG_CS4232" = "y" ]; then -int 'CS4232 second (duplex) DMA 0, 1 or 3' CS4232_DMA2 3 -fi - -if [ "$CONFIG_CS4232" = "y" ]; then -hex 'CS4232 MIDI I/O base 330, 370, 3B0 or 3F0' CS4232_MPU_BASE 330 -fi - -if [ "$CONFIG_CS4232" = "y" ]; then -int 'CS4232 MIDI IRQ 5, 7, 9, 11, 12 or 15' CS4232_MPU_IRQ 9 -fi - -if [ "$CONFIG_MAD16" = "y" ]; then -hex 'MAD16 audio I/O base 530, 604, E80 or F40' MAD16_BASE 530 -fi - -if [ "$CONFIG_MAD16" = "y" ]; then -int 'MAD16 audio IRQ 7, 9, 10 or 11' MAD16_IRQ 11 -fi - -if [ "$CONFIG_MAD16" = "y" ]; then -int 'MAD16 audio DMA 0, 1 or 3' MAD16_DMA 3 -fi - -if [ "$CONFIG_MAD16" = "y" ]; then -int 'MAD16 second (duplex) DMA 0, 1 or 3' MAD16_DMA2 0 -fi - -if [ "$CONFIG_MAD16" = "y" ]; then -hex 'MAD16 MIDI I/O base 300, 310, 320 or 330 (0 disables)' MAD16_MPU_BASE 330 -fi - -if [ "$CONFIG_MAD16" = "y" ]; then -int 'MAD16 MIDI IRQ 5, 7, 9 or 10' MAD16_MPU_IRQ 9 -fi - -if [ "$CONFIG_AUDIO" = "y" ]; then -int 'Audio DMA buffer size 4096, 16384, 32768 or 65536' DSP_BUFFSIZE 65536 -fi # -$MAKE -C drivers/sound kernelconfig || exit 1 +# Sound driver configuration +# +#-------- +# There is another config script which is compatible with rest of +# the kernel. It can be activated by running 'make mkscript' in this +# directory. Please note that this is an _experimental_ feature which +# doesn't work with all cards (PSS, SM Wave, AudioTrix Pro, Maui). +#-------- +# +$MAKE -C drivers/sound config || exit 1 + bool 'Additional low level drivers' CONFIG_LOWLEVEL_SOUND if [ "$CONFIG_LOWLEVEL_SOUND" = "y" ]; then diff --git a/drivers/sound/local.h b/drivers/sound/local.h deleted file mode 100644 index 69b539675e81..000000000000 --- a/drivers/sound/local.h +++ /dev/null @@ -1,45 +0,0 @@ -/* Computer generated file. Please don't edit! */ - -#define KERNEL_COMPATIBLE_CONFIG - -#define SELECTED_SOUND_OPTIONS 0x00000000 - -#if \ - defined(CONFIG_PSS) || defined(CONFIG_SSCAPE) || \ - defined(CONFIG_CS4232) || defined(CONFIG_MAUI) -# define CONFIG_MPU_EMU -#endif - -#if \ - defined(CONFIG_PSS) || defined(CONFIG_GUS16) || \ - defined(CONFIG_GUSMAX) || defined(CONFIG_MSS) || \ - defined(CONFIG_SSCAPE) || defined(CONFIG_TRIX) || \ - defined(CONFIG_MAD16) || defined(CONFIG_CS4232) -# define CONFIG_AD1848 -#endif - -#if \ - defined(CONFIG_SB) || defined(CONFIG_TRIX) || \ - defined(CONFIG_MAD16) -# define CONFIG_SBDSP -#endif - -#if \ - defined(CONFIG_SB) || defined(CONFIG_TRIX) || \ - defined(CONFIG_MAD16) -# define CONFIG_UART401 -#endif - -#if \ - defined(CONFIG_PAS) || defined(CONFIG_SB) || \ - defined(CONFIG_ADLIB) || defined(CONFIG_GUS) || \ - defined(CONFIG_MPU401) || defined(CONFIG_PSS) || \ - defined(CONFIG_SSCAPE) || defined(CONFIG_TRIX) || \ - defined(CONFIG_MAD16) || defined(CONFIG_CS4232) || \ - defined(CONFIG_MAUI) -# define CONFIG_SEQUENCER -#endif - -#define SOUND_CONFIG_DATE "Sun Mar 8 23:17:14 GMT 1998" -#define SOUND_CONFIG_BY "root" -#define SOUND_UNAME_A "Linux roadrunner.swansea.linux.org.uk 2.1.88 #7 Thu Mar 5 01:09:39 GMT 1998 i586 unknown" diff --git a/fs/dquot.c b/fs/dquot.c index d389028719b6..a13dfefa5bb7 100644 --- a/fs/dquot.c +++ b/fs/dquot.c @@ -231,8 +231,13 @@ static void write_dquot(struct dquot *dquot) unlock_dquot(dquot); return; } - } else - filp->f_pos = dqoff(dquot->dq_id); + } + else + { + int p = dqoff(dquot->dq_id); + if(p>=0) + filp->f_pos = p; + } fs = get_fs(); set_fs(KERNEL_DS); if (filp->f_op->write(filp->f_inode, filp, diff --git a/fs/filesystems.c b/fs/filesystems.c index 84fcb62554db..054ee6b32099 100644 --- a/fs/filesystems.c +++ b/fs/filesystems.c @@ -9,6 +9,9 @@ #include #include +#ifdef CONFIG_NLS +#include +#endif #include #include #include diff --git a/fs/nls.c b/fs/nls.c index 8b10e10b75fd..74af3d021fa6 100644 --- a/fs/nls.c +++ b/fs/nls.c @@ -208,8 +208,10 @@ struct nls_table *find_nls(char *charset) struct nls_table *load_nls(char *charset) { struct nls_table *nls; +#ifdef CONFIG_KERNELD char buf[40]; int ret; +#endif nls = find_nls(charset); if (nls) { diff --git a/include/linux/bios32.h b/include/linux/bios32.h index d3632092a6d5..7944a53fe40c 100644 --- a/include/linux/bios32.h +++ b/include/linux/bios32.h @@ -54,8 +54,8 @@ extern int pcibios_write_config_byte (unsigned char bus, unsigned char dev_fn, unsigned char where, unsigned char val); extern int pcibios_write_config_word (unsigned char bus, unsigned char dev_fn, unsigned char where, unsigned short val); -extern pcibios_write_config_dword (unsigned char bus, unsigned char dev_fn, - unsigned char where, unsigned int val); +extern int pcibios_write_config_dword (unsigned char bus, unsigned char dev_fn, + unsigned char where, unsigned int val); extern const char *pcibios_strerror (int error); #endif /* BIOS32_H */ diff --git a/include/linux/iso_fs_i.h b/include/linux/iso_fs_i.h index 3f808d2e3bb5..dd63cab2df9a 100644 --- a/include/linux/iso_fs_i.h +++ b/include/linux/iso_fs_i.h @@ -1,18 +1,11 @@ #ifndef _ISO_FS_I #define _ISO_FS_I -struct extent_str -{ - struct extent_str *next; - unsigned int extent[2]; - unsigned int extent_size[2]; -}; - /* * iso fs inode data in memory */ struct iso_inode_info { - struct extent_str *i_first_extent; + unsigned int i_first_extent; unsigned int i_backlink; unsigned char i_file_format; unsigned long i_next_section_ino; diff --git a/include/linux/modversions.h b/include/linux/modversions.h deleted file mode 100644 index 1103f939de1b..000000000000 --- a/include/linux/modversions.h +++ /dev/null @@ -1,30 +0,0 @@ -#ifdef MODVERSIONS -#undef CONFIG_MODVERSIONS -#define CONFIG_MODVERSIONS -#ifndef _set_ver -#define _set_ver(sym,vers) sym ## _R ## vers -#endif -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#undef CONFIG_MODVERSIONS -#endif diff --git a/include/scsi/scsi.h b/include/scsi/scsi.h index f48f02c2e7e4..c503aeec0801 100644 --- a/include/scsi/scsi.h +++ b/include/scsi/scsi.h @@ -180,6 +180,8 @@ /* Used to obtain the host number of a device. */ #define SCSI_IOCTL_PROBE_HOST 0x5385 +/* Used to get the bus number for a device */ +#define SCSI_IOCTL_GET_BUS_NUMBER 0x5386 /* * Overrides for Emacs so that we follow Linus's tabbing style. diff --git a/kernel/sched.c b/kernel/sched.c index efcfc99daf68..ea89dc58717a 100644 --- a/kernel/sched.c +++ b/kernel/sched.c @@ -1547,7 +1547,8 @@ asmlinkage int sys_sched_yield(void) { cli(); move_last_runqueue(current); - current->counter = 0; + if (current->counter) + current->counter--; need_resched = 1; sti(); return 0; diff --git a/kernel/sys.c b/kernel/sys.c index 93432ec8c3f7..fe5eaaf5f7d4 100644 --- a/kernel/sys.c +++ b/kernel/sys.c @@ -171,7 +171,7 @@ asmlinkage int sys_prof(void) #endif extern void hard_reset_now(void); -extern asmlinkage sys_kill(int, int); +extern asmlinkage int sys_kill(int, int); /* * Reboot system call: for obvious reasons only root may call it, diff --git a/net/ipv4/arp.c b/net/ipv4/arp.c index 68fd21737d54..607975952d5c 100644 --- a/net/ipv4/arp.c +++ b/net/ipv4/arp.c @@ -739,7 +739,7 @@ static int arp_force_expire(void) unsigned long now = jiffies; int result = 0; - static last_index; + static int last_index; if (ARP_LOCKED()) return 0; diff --git a/net/ipv4/igmp.c b/net/ipv4/igmp.c index a116f46e8380..f80d7ab98ca0 100644 --- a/net/ipv4/igmp.c +++ b/net/ipv4/igmp.c @@ -64,6 +64,9 @@ * Alexey Kuznetsov: Wrong group leaving behaviour, backport * fix from pending 2.1.x patches. * Alan Cox: Forget to enable FDDI support earlier. + * Elena Apolinario Fdez de Sousa,: IGMP Leave Messages must be sent to + * Juan-Mariano de Goyeneche the "all routers" group, not the group + * group being left. */ @@ -424,7 +427,9 @@ void ip_mc_filter_del(struct device *dev, unsigned long addr) extern __inline__ void igmp_group_dropped(struct ip_mc_list *im) { del_timer(&im->timer); - igmp_send_report(im->interface, im->multiaddr, IGMP_HOST_LEAVE_MESSAGE); + /* It seems we have to send Leave Messages to 224.0.0.2 and not to + the group itself, to remain RFC 2236 compliant... (jmel) */ + igmp_send_report(im->interface, IGMP_ALL_ROUTER, IGMP_HOST_LEAVE_MESSAGE); ip_mc_filter_del(im->interface, im->multiaddr); } diff --git a/net/ipv4/ip_masq.c b/net/ipv4/ip_masq.c index 4e94903371f6..6c485e45842e 100644 --- a/net/ipv4/ip_masq.c +++ b/net/ipv4/ip_masq.c @@ -762,13 +762,16 @@ int ip_fw_masquerade(struct sk_buff **skb_ptr, struct device *dev) ip_masq_set_expire(ms,0); /* - * If sysctl !=0 and no pkt has been received yet - * in this tunnel and routing iface address has changed... - * "You are welcome, diald". + * If sysctl & 3 and either + * no pkt has been received yet + * or + * sysctl & 4 + * in this tunnel ... + * "You are welcome, diald, ipppd, pppd-3.3...". */ - if ( sysctl_ip_dynaddr && ms->flags & IP_MASQ_F_NO_REPLY && dev->pa_addr != ms->maddr) { + if ( (sysctl_ip_dynaddr & 3) && (ms->flags & IP_MASQ_F_NO_REPLY || sysctl_ip_dynaddr & 4) && dev->pa_addr != ms->maddr) { unsigned long flags; - if (sysctl_ip_dynaddr > 1) { + if (sysctl_ip_dynaddr & 2) { printk(KERN_INFO "ip_fw_masquerade(): change maddr from %s", in_ntoa(ms->maddr)); printk(" to %s\n", in_ntoa(dev->pa_addr)); @@ -971,11 +974,14 @@ int ip_fw_masq_icmp(struct sk_buff **skb_p, struct device *dev) /* Rewrite source address */ /* - * If sysctl !=0 and no pkt has been received yet - * in this tunnel and routing iface address has changed... - * "You are welcome, diald". + * If sysctl & 3 and either + * no pkt has been received yet + * or + * sysctl & 4 + * in this tunnel ... + * "You are welcome, diald, ipppd, pppd-3.3...". */ - if ( sysctl_ip_dynaddr && ms->flags & IP_MASQ_F_NO_REPLY && dev->pa_addr != ms->maddr) { + if ( (sysctl_ip_dynaddr & 3) && (ms->flags & IP_MASQ_F_NO_REPLY || sysctl_ip_dynaddr & 4) && dev->pa_addr != ms->maddr) { unsigned long flags; #ifdef DEBUG_CONFIG_IP_MASQUERADE printk(KERN_INFO "ip_fw_masq_icmp(): change masq.addr %s", diff --git a/net/ipv4/ip_output.c b/net/ipv4/ip_output.c index 88d93aba454d..e5324f54e587 100644 --- a/net/ipv4/ip_output.c +++ b/net/ipv4/ip_output.c @@ -28,6 +28,8 @@ * output firewall rules) * Elliot Poger : Added support for SO_BINDTODEVICE. * Juan Jose Ciarlante: sk/skb source address rewriting + * Elena Apolinario Fdez de Sousa,:ipmr_forward never received multicast + * Juan-Mariano de Goyeneche traffic generated locally. */ #include @@ -69,7 +71,9 @@ /* * Allows dynamic re-writing of packet's addresses. - * if value > 1, be verbose about addr rewriting. + * value & 3 do rewrite + * value & 2 be verbose + * value & 4 rewrite connected sockets too * Currently implemented: * tcp_output.c if sk->state!=TCP_SYN_SENT * ip_masq.c if no packet has been received by tunnel @@ -79,7 +83,8 @@ int sysctl_ip_dynaddr = 0; /* * Very Promisc source address re-assignation. * ONLY acceptable if socket is NOT connected yet. - * Caller already checked sysctl_ip_dynaddr != 0 and consistent sk->state + * Caller already checked sysctl_ip_dynaddr & 3 and EITHER + * sysctl_ip_dynaddr & 4 OR consistent sk->state * (TCP_SYN_SENT for tcp, udp-connect sockets are set TCP_ESTABLISHED) */ @@ -107,12 +112,12 @@ int ip_rewrite_addrs (struct sock *sk, struct sk_buff *skb, struct device *dev) } /* - * Be verbose if sysctl value > 1 + * Be verbose if sysctl value & 2 */ - if (sysctl_ip_dynaddr > 1) { + if (sysctl_ip_dynaddr & 2) { printk(KERN_INFO "ip_rewrite_addrs(): shifting saddr from %s", in_ntoa(skb->saddr)); - printk(" to %s\n", in_ntoa(new_saddr)); + printk(" to %s (state %d)\n", in_ntoa(new_saddr), sk->state); } iph = skb->ip_hdr; @@ -121,7 +126,7 @@ int ip_rewrite_addrs (struct sock *sk, struct sk_buff *skb, struct device *dev) iph->saddr = new_saddr; skb->saddr = new_saddr; ip_send_check(iph); - } else if (sysctl_ip_dynaddr > 1) { + } else if (sysctl_ip_dynaddr & 2) { printk(KERN_WARNING "ip_rewrite_addrs(): skb already changed (???).\n"); return 0; } @@ -134,7 +139,7 @@ int ip_rewrite_addrs (struct sock *sk, struct sk_buff *skb, struct device *dev) sk->saddr = new_saddr; sk->rcv_saddr = new_saddr; sk->prot->rehash(sk); - } else if (sysctl_ip_dynaddr > 1) + } else if (sysctl_ip_dynaddr & 2) printk(KERN_NOTICE "ip_rewrite_addrs(): no change needed for sock\n"); return 1; } @@ -996,6 +1001,22 @@ int ip_build_xmit(struct sock *sk, if (MULTICAST(daddr) && !(dev->flags&IFF_LOOPBACK)) { +#ifdef CONFIG_IP_MROUTE + /* We need this so that mrouted "hears" packets sent from the + same host it is running on... (jmel) */ + if (mroute_socket&&(iph->protocol!=IPPROTO_IGMP)) + { + if((skb->ip_hdr->daddr&htonl(0xFFFFFF00))!=htonl(0xE0000000)) + { + struct sk_buff* skb2=skb_clone(skb, GFP_ATOMIC); + if(skb2) + { + skb2->free=1; + ipmr_forward(skb2, 0); + } + } + } +#endif /* * Loop back any frames. The check for IGMP_ALL_HOSTS is because * you are always magically a member of this group. diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c index 756b9f7eae0a..b9076be5ee3a 100644 --- a/net/ipv4/tcp_output.c +++ b/net/ipv4/tcp_output.c @@ -546,7 +546,7 @@ void tcp_do_retransmit(struct sock *sk, int all) struct sk_buff *skb2 = sk->write_queue.next; while (skb2 && skb2->dev == skb->dev) { skb2->raddr=rt->rt_gateway; - if (sk->state == TCP_SYN_SENT && sysctl_ip_dynaddr) + if (sysctl_ip_dynaddr & 4 || (sk->state == TCP_SYN_SENT && sysctl_ip_dynaddr & 3)) ip_rewrite_addrs (sk, skb2, dev); skb_pull(skb2,((unsigned char *)skb2->ip_hdr)-skb2->data); skb2->dev = dev; @@ -572,7 +572,7 @@ void tcp_do_retransmit(struct sock *sk, int all) } } skb->raddr=rt->rt_gateway; - if (skb->dev !=dev && sk->state == TCP_SYN_SENT && sysctl_ip_dynaddr) + if ((skb->dev !=dev || skb->dev->pa_addr != skb->ip_hdr->saddr) && (sysctl_ip_dynaddr & 4 || (sk->state == TCP_SYN_SENT && sysctl_ip_dynaddr & 3))) ip_rewrite_addrs(sk, skb, dev); skb->dev=dev; skb->arp=1; diff --git a/scripts/lxdialog/checklist.c b/scripts/lxdialog/checklist.c index b986b3a2edcd..ad6102070dd1 100644 --- a/scripts/lxdialog/checklist.c +++ b/scripts/lxdialog/checklist.c @@ -188,9 +188,16 @@ dialog_checklist (const char *title, const char *prompt, int height, int width, check_x = (list_width - check_x) / 2; item_x = check_x + 4; + if (choice >= list_height) { + scroll = choice - list_height + 1; + choice -= scroll; + } + /* Print the list */ - for (i = 0; i < max_choice; i++) - print_item (list, items[i * 3 + 1], status[i], i, i == choice); + for (i = 0; i < max_choice; i++) { + print_item (list, items[(scroll+i) * 3 + 1], + status[i+scroll], i, i == choice); + } wnoutrefresh (list); -- 2.39.5