From 52b61fe27949995298d716960e068fa0520973f3 Mon Sep 17 00:00:00 2001 From: Alan Cox Date: Fri, 23 Nov 2007 15:22:43 -0500 Subject: [PATCH] Linux 2.2.18pre19 o Fix transproxy socket lookup (Val Henson) o Add ICS1893 PHY to the SiS900 driver (Lei-Chun Chang) o Fix documentation error in matroxfb (Vsevolod Sipakov) o Update IDE floppy maintainer (Paul Bristow) o Fix remaining cmos locking (Paul Gortmaker) o Fix sparc bitfield/compiler bits on sound (Dave Miller) o Update Pegasus USB driver (Petko Manolov) o Networking updates - move divert header (Andi Kleen) o Add ETH_P_ATM* defines (Matti Aarnio) o Fix one more missing GFP_KERNEL/sk->allocation (Dave Miller) o Fix ISDN multilink handler bug (Kai Germaschewski) o Fix ymfpci unload cases (Kai Germaschewski) --- CREDITS | 5 ++ Documentation/fb/matroxfb.txt | 2 +- MAINTAINERS | 9 +- Makefile | 2 +- drivers/char/nvram.c | 62 +++++++------ drivers/isdn/isdn_ppp.c | 50 ++++++----- drivers/net/Space.c | 2 +- drivers/sound/ymfpci.c | 7 ++ drivers/usb/pegasus.c | 148 ++++++++++++++------------------ include/asm-i386/floppy.h | 19 +++- include/{net => linux}/divert.h | 0 include/linux/if_ether.h | 4 + include/linux/netdevice.h | 5 +- include/linux/soundcard.h | 6 +- net/core/dev.c | 2 +- net/core/dv.c | 2 +- net/ipv4/af_inet.c | 4 +- net/ipv4/arp.c | 2 +- net/ipv4/devinet.c | 2 +- net/ipv4/ipconfig.c | 2 +- net/ipv4/tcp_ipv4.c | 15 +++- net/ipv4/tcp_output.c | 4 +- net/netsyms.c | 2 +- net/packet/af_packet.c | 4 +- 24 files changed, 204 insertions(+), 156 deletions(-) rename include/{net => linux}/divert.h (100%) diff --git a/CREDITS b/CREDITS index e17bc79c03be..87c7253d18b4 100644 --- a/CREDITS +++ b/CREDITS @@ -317,6 +317,11 @@ S: 19. Wellington Road S: Lancaster, LA1 4DN S: UK, England +N: Paul Bristow +E: paul@paulbristow.net +W: http://paulbristow.net/linux +D: ide-floppy maintainer + N: Andries Brouwer E: aeb@cwi.nl D: random Linux hacker diff --git a/Documentation/fb/matroxfb.txt b/Documentation/fb/matroxfb.txt index 6506273eac7e..e2a816ee4e9e 100644 --- a/Documentation/fb/matroxfb.txt +++ b/Documentation/fb/matroxfb.txt @@ -105,7 +105,7 @@ problem and not mine, but I'm not sure. Configuration ============= -You can pass kernel command line options to vesafb with +You can pass kernel command line options to matroxfb with `video=matrox:option1,option2:value2,option3' (multiple options should be separated by comma, values are separated from options by `:'). Accepted options: diff --git a/MAINTAINERS b/MAINTAINERS index 3bfccb96a219..471fd8e98c40 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -478,12 +478,19 @@ M: axboe@suse.de L: linux-kernel@vger.kernel.org S: Maintained -IDE/ATAPI TAPE/FLOPPY DRIVERS +IDE/ATAPI TAPE DRIVERS P: Gadi Oxman M: Gadi Oxman L: linux-kernel@vger.kernel.org S: Maintained +IDE/ATAPI FLOPPY DRIVERS +P: Paul Bristow +M: Paul Bristow +W: http://paulbristow.net/linux +L: linux-kernel@vger.kernel.org +S: Maintained + IP FIREWALL P: Paul Russell M: Paul.Russell@rustcorp.com.au diff --git a/Makefile b/Makefile index b1851f24f449..1e210bbb96d6 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,7 @@ VERSION = 2 PATCHLEVEL = 2 SUBLEVEL = 18 -EXTRAVERSION = pre18 +EXTRAVERSION = pre19 ARCH := $(shell uname -m | sed -e s/i.86/i386/ -e s/sun4u/sparc64/ -e s/arm.*/arm/ -e s/sa110/arm/) diff --git a/drivers/char/nvram.c b/drivers/char/nvram.c index f29aae5be748..0a7d9c69551e 100644 --- a/drivers/char/nvram.c +++ b/drivers/char/nvram.c @@ -25,9 +25,10 @@ * the kernel and is not a module. Since the functions are used by some Atari * drivers, this is the case on the Atari. * + * 1.0a Paul Gortmaker: use rtc_lock, fix get/put_user in cli bugs. */ -#define NVRAM_VERSION "1.0" +#define NVRAM_VERSION "1.0a" #include #include @@ -78,10 +79,12 @@ #define mach_set_checksum atari_set_checksum #define mach_proc_infos atari_proc_infos +static spinlock_t rtc_lock; /* optimized away; no SMP m68K */ + #endif /* Note that *all* calls to CMOS_READ and CMOS_WRITE must be done with - * interrupts disabled. Due to the index-port/data-port design of the RTC, we + * rtc_lock held. Due to the index-port/data-port design of the RTC, we * don't want two different things trying to get to it at once. (e.g. the * periodic 11 min sync from time.c vs. this driver.) */ @@ -233,23 +236,28 @@ static ssize_t nvram_read(struct file * file, unsigned long flags; unsigned i = *ppos; char *tmp = buf; + int checksum; if (i != *ppos) return -EINVAL; - save_flags(flags); - cli(); - - if (!nvram_check_checksum_int()) { - restore_flags(flags); + spin_lock_irqsave(&rtc_lock, flags); + checksum = nvram_check_checksum_int(); + spin_unlock_irqrestore(&rtc_lock, flags); + + if (!checksum) return( -EIO ); - } for( ; count-- > 0 && i < NVRAM_BYTES; ++i, ++tmp ) - put_user( nvram_read_int(i), tmp ); + { + int val; + spin_lock_irqsave(&rtc_lock, flags); + val = nvram_read_int(i); + spin_unlock_irqrestore(&rtc_lock, flags); + put_user( val, tmp ); + } *ppos = i; - restore_flags(flags); return( tmp - buf ); } @@ -260,26 +268,31 @@ static ssize_t nvram_write(struct file * file, unsigned i = *ppos; const char *tmp = buf; char c; + int checksum; if (i != *ppos) return -EINVAL; - save_flags(flags); - cli(); - - if (!nvram_check_checksum_int()) { - restore_flags(flags); + spin_lock_irqsave(&rtc_lock, flags); + checksum = nvram_check_checksum_int(); + spin_unlock_irqrestore(&rtc_lock, flags); + + if (!checksum) return( -EIO ); - } for( ; count-- > 0 && i < NVRAM_BYTES; ++i, ++tmp ) { get_user( c, tmp ); + spin_lock_irqsave(&rtc_lock, flags); nvram_write_int( c, i ); + spin_unlock_irqrestore(&rtc_lock, flags); } + + spin_lock_irqsave(&rtc_lock, flags); nvram_set_checksum_int(); + spin_unlock_irqrestore(&rtc_lock, flags); + *ppos = i; - restore_flags(flags); return( tmp - buf ); } @@ -295,14 +308,13 @@ static int nvram_ioctl( struct inode *inode, struct file *file, if (!capable(CAP_SYS_ADMIN)) return( -EACCES ); - save_flags(flags); - cli(); + spin_lock_irqsave(&rtc_lock, flags); for( i = 0; i < NVRAM_BYTES; ++i ) nvram_write_int( 0, i ); nvram_set_checksum_int(); - restore_flags(flags); + spin_unlock_irqrestore(&rtc_lock, flags); return( 0 ); case NVRAM_SETCKS: /* just set checksum, contents unchanged @@ -311,10 +323,9 @@ static int nvram_ioctl( struct inode *inode, struct file *file, if (!capable(CAP_SYS_ADMIN)) return( -EACCES ); - save_flags(flags); - cli(); + spin_lock_irqsave(&rtc_lock, flags); nvram_set_checksum_int(); - restore_flags(flags); + spin_unlock_irqrestore(&rtc_lock, flags); return( 0 ); default: @@ -363,11 +374,10 @@ static int nvram_read_proc( char *buffer, char **start, off_t offset, int i, len = 0; off_t begin = 0; - save_flags(flags); - cli(); + spin_lock_irqsave(&rtc_lock, flags); for( i = 0; i < NVRAM_BYTES; ++i ) contents[i] = nvram_read_int( i ); - restore_flags(flags); + spin_unlock_irqrestore(&rtc_lock, flags); *eof = mach_proc_infos( contents, buffer, &len, &begin, offset, size ); diff --git a/drivers/isdn/isdn_ppp.c b/drivers/isdn/isdn_ppp.c index 3684c1f59d0f..24e073d6e146 100644 --- a/drivers/isdn/isdn_ppp.c +++ b/drivers/isdn/isdn_ppp.c @@ -958,12 +958,18 @@ void isdn_ppp_receive(isdn_net_dev * net_dev, isdn_net_local * lp, struct sk_buf if(is->debug & 0x10) printk(KERN_DEBUG "received single link compressed frame\n"); skb = isdn_ppp_decompress(skb,is,NULL,proto); - if(!skb) + if(!skb) { + printk(KERN_DEBUG "ippp: dropping LINK_COMP frame!\n"); return; + } proto = isdn_ppp_strip_proto(skb); + } else { + skb = isdn_ppp_decompress(skb,is,NULL,proto); + if(!skb) { + printk(KERN_DEBUG "ippp: dropping uncompressed frame!\n"); + return; + } } - else - isdn_ppp_decompress(skb,is,NULL,proto); } if (proto == PPP_MP) { @@ -1001,11 +1007,11 @@ isdn_ppp_push_higher(isdn_net_dev * net_dev, isdn_net_local * lp, struct sk_buff } if(proto == PPP_COMP) { - if(!lp->master) + if(!lp->master) { skb = isdn_ppp_decompress(skb,is,is,proto); - else + } else { skb = isdn_ppp_decompress(skb,is,ippp_table[((isdn_net_local *) (lp->master->priv))->ppp_slot],proto); - + } if(!skb) { printk(KERN_DEBUG "ippp: compressed frame discarded!\n"); return; @@ -1017,11 +1023,17 @@ isdn_ppp_push_higher(isdn_net_dev * net_dev, isdn_net_local * lp, struct sk_buff isdn_ppp_frame_log("R-Decomp", skb->data, skb->len, 32,is->unit,lp->ppp_slot); } } - else if(is->compflags & SC_DECOMP_ON) { /* If decomp is ON */ - if(!lp->master) - isdn_ppp_decompress(skb,is,is,proto); - else - isdn_ppp_decompress(skb,is,ippp_table[((isdn_net_local *) (lp->master->priv))->ppp_slot],proto); + else if (is->compflags & SC_DECOMP_ON) { /* If decomp is ON */ + if(!lp->master) { + skb = isdn_ppp_decompress(skb,is,is,proto); + } else { + skb = isdn_ppp_decompress(skb,is,ippp_table[((isdn_net_local *) (lp->master->priv))->ppp_slot],proto); + } + + if(!skb) { + printk(KERN_DEBUG "ippp: compressed frame discarded!\n"); + return; + } } switch (proto) { @@ -2371,14 +2383,12 @@ static struct sk_buff *isdn_ppp_decompress(struct sk_buff *skb,struct ippp_struc * single link decompression */ if(!is->link_decompressor) { - printk(KERN_ERR "ippp: no link decompressor defined!\n"); - dev_kfree_skb(skb); - return NULL; + printk(KERN_DEBUG "ippp: no link decompressor defined!\n"); + return skb; } if(!is->link_decomp_stat) { printk(KERN_DEBUG "ippp: no link decompressor data allocated\n"); - dev_kfree_skb(skb); - return NULL; + return skb; } stat = is->link_decomp_stat; ipc = is->link_decompressor; @@ -2389,14 +2399,12 @@ static struct sk_buff *isdn_ppp_decompress(struct sk_buff *skb,struct ippp_struc * 'normal' or bundle-compression */ if(!master->decompressor) { - printk(KERN_ERR "ippp: no decompressor defined!\n"); - dev_kfree_skb(skb); - return NULL; + printk(KERN_DEBUG "ippp: no decompressor defined!\n"); + return skb; } if(!master->decomp_stat) { printk(KERN_DEBUG "ippp: no decompressor data allocated\n"); - dev_kfree_skb(skb); - return NULL; + return skb; } stat = master->decomp_stat; ipc = master->decompressor; diff --git a/drivers/net/Space.c b/drivers/net/Space.c index 229c1d26f877..8d41896bf976 100644 --- a/drivers/net/Space.c +++ b/drivers/net/Space.c @@ -31,7 +31,7 @@ #include #include #include -#include +#include #define NEXT_DEV NULL diff --git a/drivers/sound/ymfpci.c b/drivers/sound/ymfpci.c index 865f5914b66d..d18b96d3df14 100644 --- a/drivers/sound/ymfpci.c +++ b/drivers/sound/ymfpci.c @@ -2289,6 +2289,7 @@ ymf_install(struct pci_dev *pcidev, int instance, int devx) /* register /dev/dsp */ if ((codec->dev_audio = register_sound_dsp(&ymf_fops, -1)) < 0) { printk(KERN_ERR "ymfpci%d: unable to register dsp\n", codec->inst); + free_irq(codec->irq, codec); ymfpci_free(codec); return -ENODEV; } @@ -2298,6 +2299,7 @@ ymf_install(struct pci_dev *pcidev, int instance, int devx) */ if ((err = ymf_ac97_init(codec, 0)) != 0) { unregister_sound_dsp(codec->dev_audio); + free_irq(codec->irq, codec); ymfpci_free(codec); return err; } @@ -2333,6 +2335,10 @@ ymfpci_free(ymfpci_t *codec) iounmap((void *)codec->reg_area_virt); if (codec->work_ptr) kfree(codec->work_ptr); + if (codec->ac97_codec[0]) { + unregister_sound_mixer(codec->ac97_codec[0]->dev_mixer); + kfree(codec->ac97_codec[0]); + } kfree(codec); } @@ -2386,6 +2392,7 @@ void cleanup_module (void) while (ymf_devs){ next = ymf_devs->next; + free_irq(ymf_devs->irq, ymf_devs); ymfpci_free(ymf_devs); ymf_devs = next; } diff --git a/drivers/usb/pegasus.c b/drivers/usb/pegasus.c index c8b82c8ff9c8..02c1eff8056a 100644 --- a/drivers/usb/pegasus.c +++ b/drivers/usb/pegasus.c @@ -19,6 +19,8 @@ ** interrupt context used. Please let me know how it ** behaves. Pegasus II support added since this version. ** TODO: suppressing HCD warnings spewage on disconnect. +** v0.4.13 Ethernet address is now set at probe(), not at open() +** time as this seems to break dhcpd. */ /* @@ -48,7 +50,7 @@ #include -static const char *version = __FILE__ ": v0.4.10 2000/09/25 (C) 1999-2000 Petko Manolov (petkan@dce.bg)"; +static const char *version = __FILE__ ": v0.4.13 2000/10/13 (C) 1999-2000 Petko Manolov (petkan@dce.bg)"; #define PEGASUS_USE_INTR @@ -87,6 +89,7 @@ static const char *version = __FILE__ ": v0.4.10 2000/09/25 (C) 1999-2000 Petko #define PEGASUS_RX_BUSY 0x00000008 #define CTRL_URB_RUNNING 0x00000010 #define CTRL_URB_SLEEP 0x00000020 +#define PEGASUS_UNPLUG 0x00000040 #define ETH_REGS_CHANGE 0x40000000 #define ETH_REGS_CHANGED 0x80000000 @@ -96,12 +99,6 @@ static const char *version = __FILE__ ": v0.4.10 2000/09/25 (C) 1999-2000 Petko #define REG_TIMEOUT (HZ) #define PEGASUS_TX_TIMEOUT (HZ*10) -#ifdef PEGASUS_USE_INTR -# define INTR_IVAL 0x80 -#else -# define INTR_IVAL 0 -#endif - #define TX_UNDERRUN 0x80 #define EXCESSIVE_COL 0x40 #define LATE_COL 0x20 @@ -146,6 +143,7 @@ typedef struct pegasus { struct net_device_stats stats; unsigned flags; unsigned features; + int intr_interval; struct urb ctrl_urb, rx_urb, tx_urb, intr_urb; devrequest dr; wait_queue_head_t ctrl_wait; @@ -185,13 +183,14 @@ static struct usb_eth_dev usb_dev_id[] = { {"MELCO/BUFFALO LUA-TX", 0x0411, 0x0001, DEFAULT_GPIO_RESET}, {"D-Link DSB-650TX", 0x2001, 0x4001, LINKSYS_GPIO_RESET}, {"D-Link DSB-650TX", 0x2001, 0x4002, LINKSYS_GPIO_RESET}, - {"D-Link DSB-650TX(PNA)", 0x2001, 0x4003, DEFAULT_GPIO_RESET}, + {"D-Link DSB-650TX(PNA)", 0x2001, 0x4003, + HAS_HOME_PNA | DEFAULT_GPIO_RESET}, {"D-Link DSB-650", 0x2001, 0xabc1, DEFAULT_GPIO_RESET}, {"D-Link DU-E10", 0x07b8, 0xabc1, DEFAULT_GPIO_RESET}, {"D-Link DU-E100", 0x07b8, 0x4002, DEFAULT_GPIO_RESET}, {"Linksys USB10TX", 0x066b, 0x2202, LINKSYS_GPIO_RESET}, {"Linksys USB100TX", 0x066b, 0x2203, LINKSYS_GPIO_RESET}, - {"Linksys USB100TX", 0x066b, 0x2204, LINKSYS_GPIO_RESET}, + {"Linksys USB100TX", 0x066b, 0x2204, HAS_HOME_PNA | LINKSYS_GPIO_RESET}, {"Linksys USB Ethernet Adapter", 0x066b, 0x2206, LINKSYS_GPIO_RESET}, {"SMC 202 USB Ethernet", 0x0707, 0x0200, DEFAULT_GPIO_RESET}, {"ADMtek AN986 \"Pegasus\" USB Ethernet (eval board)", 0x07a6, 0x0986, @@ -211,7 +210,7 @@ static int update_eth_regs_async( pegasus_t * ); /* Aargh!!! I _really_ hate such tweaks */ static void ctrl_callback( urb_t *urb ) { - pegasus_t *pegasus = urb->context; + pegasus_t *pegasus = urb->context; if ( !pegasus ) return; @@ -262,11 +261,11 @@ static int get_registers(pegasus_t *pegasus, __u16 indx, __u16 size, void *data) if ( (ret = usb_submit_urb( &pegasus->ctrl_urb )) ) { err( __FUNCTION__ " BAD CTRLs %d", ret); - return ret; + goto out; } pegasus->flags |= CTRL_URB_SLEEP; interruptible_sleep_on( &pegasus->ctrl_wait ); - +out: return ret; } @@ -421,7 +420,7 @@ static int read_eprom_word( pegasus_t *pegasus, __u8 index, __u16 *retdata ) return -1; } - +#ifdef PEGASUS_WRITE_EEPROM static inline void enable_eprom_write( pegasus_t *pegasus ) { __u8 tmp; @@ -463,40 +462,24 @@ static int write_eprom_word( pegasus_t *pegasus, __u8 index, __u16 data ) warn( __FUNCTION__ " failed" ); return -1; } +#endif /* PEGASUS_WRITE_EEPROM */ - -static void set_intr_interval( pegasus_t *pegasus ) +static inline void get_node_id( pegasus_t *pegasus, __u8 *id ) { - __u16 d; - __u8 tmp; + int i; - read_eprom_word( pegasus, 4, &d ); - ((__u8 *)&d)[1] = INTR_IVAL; - write_eprom_word( pegasus, 4, d ); - get_registers( pegasus, EthCtrl2, 1, &tmp ); - set_register( pegasus, EthCtrl2, tmp | EPROM_LOAD ); - udelay( 10000 ); - set_register( pegasus, EthCtrl2, tmp ); -#ifdef PEGASUS_DUMP_EEPROM - { int i; - for ( i=0; i < 0x40; i++ ) { - read_eprom_word( pegasus, i, &d ); - printk( "eepromword %02x-%04x, ", i, d ); - } - printk( "\n" ); - } -#endif + for (i = 0; i < 3; i++) + read_eprom_word( pegasus, i, (__u16 *)&id[i*2]); } -static inline int get_node_id( pegasus_t *pegasus, __u8 *id ) +static void set_ethernet_addr( pegasus_t *pegasus ) { - int i; + __u8 node_id[6]; - for (i = 0; i < 3; i++) - if ( read_eprom_word( pegasus, i, (__u16 *)&id[i*2]) ) - return 1; - return 0; + get_node_id(pegasus, node_id); + set_registers( pegasus, EthID, sizeof(node_id), node_id ); + memcpy( pegasus->net->dev_addr, node_id, sizeof(node_id) ); } @@ -529,15 +512,10 @@ static inline int reset_mac( pegasus_t *pegasus ) static int enable_net_traffic( struct net_device *dev, struct usb_device *usb ) { __u16 linkpart, bmsr; - __u8 node_id[6]; __u8 data[4]; pegasus_t *pegasus = dev->priv; - if ( get_node_id(pegasus, node_id) ) - return 1; - set_registers( pegasus, EthID, sizeof(node_id), node_id ); - memcpy( dev->dev_addr, node_id, sizeof(node_id) ); if ( read_phy_word(pegasus, pegasus->phy, MII_BMSR, &bmsr) ) return 2; if ( !(bmsr & 0x20) && !loopback ) @@ -654,7 +632,7 @@ static void write_bulk_callback( struct urb *urb ) netif_wake_queue( pegasus->net ); } - +#ifdef PEGASUS_USE_INTR static void intr_callback( struct urb *urb ) { pegasus_t *pegasus = urb->context; @@ -685,7 +663,7 @@ static void intr_callback( struct urb *urb ) info("intr status %d", urb->status); } } - +#endif static void pegasus_tx_timeout( struct net_device *net ) { @@ -710,8 +688,6 @@ static int pegasus_start_xmit( struct sk_buff *skb, struct net_device *net ) int res; netif_stop_queue( net ); - if ( !(pegasus->flags & PEGASUS_RUNNING) ) - return 0; ((__u16 *)pegasus->tx_buff)[0] = skb->len; memcpy(pegasus->tx_buff+2, skb->data, skb->len); @@ -751,26 +727,44 @@ static inline void disable_net_traffic( pegasus_t *pegasus ) } +static inline void get_interrupt_interval( pegasus_t *pegasus ) +{ + __u8 data[2]; + + read_eprom_word( pegasus, 4, (__u16 *)data ); + pegasus->intr_interval = data[1]; +} + + static int pegasus_open(struct net_device *net) { pegasus_t *pegasus = (pegasus_t *)net->priv; int res; + MOD_INC_USE_COUNT; if ( (res = enable_net_traffic(net, pegasus->usb)) ) { err("can't enable_net_traffic() - %d", res); + MOD_DEC_USE_COUNT; return -EIO; } + FILL_BULK_URB( &pegasus->rx_urb, pegasus->usb, + usb_rcvbulkpipe(pegasus->usb, 1), + pegasus->rx_buff, PEGASUS_MAX_MTU, + read_bulk_callback, pegasus ); if ( (res = usb_submit_urb(&pegasus->rx_urb)) ) warn( __FUNCTION__ " failed rx_urb %d", res ); #ifdef PEGASUS_USE_INTR + get_interrupt_interval( pegasus ); + FILL_INT_URB( &pegasus->intr_urb, pegasus->usb, + usb_rcvintpipe(pegasus->usb, 3), + pegasus->intr_buff, sizeof(pegasus->intr_buff), + intr_callback, pegasus, pegasus->intr_interval ); if ( (res = usb_submit_urb(&pegasus->intr_urb)) ) warn( __FUNCTION__ " failed intr_urb %d", res); -#endif +#endif netif_start_queue( net ); pegasus->flags |= PEGASUS_RUNNING; - MOD_INC_USE_COUNT; - return 0; } @@ -779,9 +773,10 @@ static int pegasus_close( struct net_device *net ) { pegasus_t *pegasus = net->priv; - netif_stop_queue( net ); pegasus->flags &= ~PEGASUS_RUNNING; - disable_net_traffic( pegasus ); + netif_stop_queue( net ); + if ( !(pegasus->flags & PEGASUS_UNPLUG) ) + disable_net_traffic( pegasus ); usb_unlink_urb( &pegasus->rx_urb ); usb_unlink_urb( &pegasus->tx_urb ); @@ -904,13 +899,24 @@ static void * pegasus_probe( struct usb_device *dev, unsigned int ifnum ) err("out of memory allocating device structure"); return NULL; } + + usb_inc_dev_use( dev ); memset(pegasus, 0, sizeof(struct pegasus)); + init_MUTEX( &pegasus-> ctrl_sem ); + init_waitqueue_head( &pegasus->ctrl_wait ); - net = init_etherdev(0, 0); + net = init_etherdev( NULL, 0 ); + if ( !net ) { + kfree( pegasus ); + return NULL; + } + + pegasus->usb = dev; + pegasus->net = net; net->priv = pegasus; net->open = pegasus_open; net->stop = pegasus_close; -#if 0 +#if LINUX_VERSION_CODE > KERNEL_VERSION(2,3,48) net->watchdog_timeo = PEGASUS_TX_TIMEOUT; net->tx_timeout = pegasus_tx_timeout; #endif @@ -920,22 +926,6 @@ static void * pegasus_probe( struct usb_device *dev, unsigned int ifnum ) net->get_stats = pegasus_netdev_stats; net->mtu = PEGASUS_MTU; - init_MUTEX( &pegasus-> ctrl_sem ); - init_waitqueue_head( &pegasus->ctrl_wait ); - - pegasus->usb = dev; - pegasus->net = net; - - FILL_BULK_URB( &pegasus->rx_urb, dev, usb_rcvbulkpipe(dev, 1), - pegasus->rx_buff, PEGASUS_MAX_MTU, - read_bulk_callback, pegasus ); - FILL_BULK_URB( &pegasus->tx_urb, dev, usb_sndbulkpipe(dev, 2), - pegasus->tx_buff, PEGASUS_MAX_MTU, - write_bulk_callback, pegasus ); - FILL_INT_URB( &pegasus->intr_urb, dev, usb_rcvintpipe(dev, 3), - pegasus->intr_buff, 8, intr_callback, - pegasus, INTR_IVAL ); - pegasus->features = usb_dev_id[dev_indx].private; if ( reset_mac(pegasus) ) { err("can't reset MAC"); @@ -945,19 +935,19 @@ static void * pegasus_probe( struct usb_device *dev, unsigned int ifnum ) return NULL; } + set_ethernet_addr( pegasus ); + if ( pegasus->features & PEGASUS_II ) { info( "setup Pegasus II specific registers" ); setup_pegasus_II( pegasus ); } - + pegasus->phy = mii_phy_probe( pegasus ); if ( !pegasus->phy ) { warn( "can't locate MII phy, using default" ); pegasus->phy = 1; } - set_intr_interval( pegasus ); - info( "%s: %s", net->name, usb_dev_id[dev_indx].name ); return pegasus; @@ -973,15 +963,9 @@ static void pegasus_disconnect( struct usb_device *dev, void *ptr ) return; } - netif_stop_queue( pegasus->net ); - if ( pegasus->flags & PEGASUS_RUNNING ) { - pegasus->flags &= ~PEGASUS_RUNNING; - usb_unlink_urb( &pegasus->rx_urb ); - usb_unlink_urb( &pegasus->tx_urb ); - usb_unlink_urb( &pegasus->ctrl_urb ); - usb_unlink_urb( &pegasus->intr_urb ); - } + pegasus->flags |= PEGASUS_UNPLUG; unregister_netdev( pegasus->net ); + usb_dec_dev_use( dev ); kfree( pegasus ); pegasus = NULL; } diff --git a/include/asm-i386/floppy.h b/include/asm-i386/floppy.h index b941776f53d0..5728dbb77ee5 100644 --- a/include/asm-i386/floppy.h +++ b/include/asm-i386/floppy.h @@ -285,8 +285,23 @@ struct fd_routine_l { static int FDC1 = 0x3f0; static int FDC2 = -1; -#define FLOPPY0_TYPE ((CMOS_READ(0x10) >> 4) & 15) -#define FLOPPY1_TYPE (CMOS_READ(0x10) & 15) +#define FLOPPY0_TYPE ({ \ + unsigned long flags; \ + unsigned char val; \ + spin_lock_irqsave(&rtc_lock, flags); \ + val = (CMOS_READ(0x10) >> 4) & 15; \ + spin_unlock_irqrestore(&rtc_lock, flags); \ + val; \ +}) + +#define FLOPPY1_TYPE ({ \ + unsigned long flags; \ + unsigned char val; \ + spin_lock_irqsave(&rtc_lock, flags); \ + val = CMOS_READ(0x10) & 15; \ + spin_unlock_irqrestore(&rtc_lock, flags); \ + val; \ +}) #define N_FDC 2 #define N_DRIVE 8 diff --git a/include/net/divert.h b/include/linux/divert.h similarity index 100% rename from include/net/divert.h rename to include/linux/divert.h diff --git a/include/linux/if_ether.h b/include/linux/if_ether.h index 99bb97fa253e..9e605bfb55c5 100644 --- a/include/linux/if_ether.h +++ b/include/linux/if_ether.h @@ -56,6 +56,10 @@ #define ETH_P_AARP 0x80F3 /* Appletalk AARP */ #define ETH_P_IPX 0x8137 /* IPX over DIX */ #define ETH_P_IPV6 0x86DD /* IPv6 over bluebook */ +#define ETH_P_ATMMPOA 0x884c /* MultiProtocol Over ATM */ +#define ETH_P_ATMFATE 0x8884 /* Frame-based ATM Transport + * over Ethernet + */ /* * Non DIX types. Won't clash for 1500 types. diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index 2de251a0a2dc..a469ff74f1d8 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h @@ -30,9 +30,6 @@ #include #include #include -#ifdef __KERNEL__ -#include -#endif #include @@ -42,6 +39,8 @@ #endif #endif +struct divert_blk; + /* * For future expansion when we will have different priorities. */ diff --git a/include/linux/soundcard.h b/include/linux/soundcard.h index 2d5128dc4314..2485b2a37d8b 100644 --- a/include/linux/soundcard.h +++ b/include/linux/soundcard.h @@ -76,8 +76,8 @@ */ #ifndef _SIOWR -#if defined(_IOWR) && (defined(_AIX) || (!defined(sun) && !defined(sparc) && !defined(__INCioctlh) && !defined(__Lynx__))) -/* Use already defined ioctl defines if they exist (except with Sun) */ +#if defined(_IOWR) && (defined(_AIX) || (!defined(sun) && !defined(sparc) && !defined(__sparc__) && !defined(__INCioctlh) && !defined(__Lynx__))) +/* Use already defined ioctl defines if they exist (except with Sun or Sparc) */ #define SIOCPARM_MASK IOCPARM_MASK #define SIOC_VOID IOC_VOID #define SIOC_OUT IOC_OUT @@ -179,7 +179,7 @@ typedef struct seq_event_rec { * Some big endian/little endian handling macros */ -#if defined(_AIX) || defined(AIX) || defined(sparc) || defined(HPPA) || defined(PPC) +#if defined(_AIX) || defined(AIX) || defined(sparc) || defined(__sparc__) || defined(HPPA) || defined(PPC) /* Big endian machines */ # define _PATCHKEY(id) (0xfd00|id) # define AFMT_S16_NE AFMT_S16_BE diff --git a/net/core/dev.c b/net/core/dev.c index 1badc08fdfc3..d7f2e31fe36b 100644 --- a/net/core/dev.c +++ b/net/core/dev.c @@ -85,7 +85,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/net/core/dv.c b/net/core/dv.c index 0ebc0e37b735..8bb0921a8847 100644 --- a/net/core/dv.c +++ b/net/core/dv.c @@ -36,7 +36,7 @@ #include #include #include -#include +#include #include const char sysctl_divert_version[32]="0.461"; /* Current version */ diff --git a/net/ipv4/af_inet.c b/net/ipv4/af_inet.c index 8e1fc7531ea4..d9f69c095b89 100644 --- a/net/ipv4/af_inet.c +++ b/net/ipv4/af_inet.c @@ -5,7 +5,7 @@ * * PF_INET protocol family socket handler. * - * Version: $Id: af_inet.c,v 1.87.2.10 2000/09/20 01:47:40 davem Exp $ + * Version: $Id: af_inet.c,v 1.87.2.11 2000/10/24 21:28:46 davem Exp $ * * Authors: Ross Biro, * Fred N. van Kempen, @@ -111,7 +111,7 @@ #endif #ifdef CONFIG_NET_DIVERT -#include +#include #endif /* CONFIG_NET_DIVERT */ #ifdef CONFIG_KMOD diff --git a/net/ipv4/arp.c b/net/ipv4/arp.c index 62c02cc39f0a..eda37cbc1e1e 100644 --- a/net/ipv4/arp.c +++ b/net/ipv4/arp.c @@ -1,6 +1,6 @@ /* linux/net/inet/arp.c * - * Version: $Id: arp.c,v 1.77.2.6 2000/05/27 04:46:43 davem Exp $ + * Version: $Id: arp.c,v 1.77.2.7 2000/10/29 11:41:15 davem Exp $ * * Copyright (C) 1994 by Florian La Roche * diff --git a/net/ipv4/devinet.c b/net/ipv4/devinet.c index 833334cfa570..9e18bce68498 100644 --- a/net/ipv4/devinet.c +++ b/net/ipv4/devinet.c @@ -1,7 +1,7 @@ /* * NET3 IP device support routines. * - * Version: $Id: devinet.c,v 1.28.2.3 1999/12/14 10:32:42 davem Exp $ + * Version: $Id: devinet.c,v 1.28.2.4 2000/10/29 11:41:15 davem Exp $ * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License diff --git a/net/ipv4/ipconfig.c b/net/ipv4/ipconfig.c index f5c806c79485..39ca89ed2678 100644 --- a/net/ipv4/ipconfig.c +++ b/net/ipv4/ipconfig.c @@ -1,5 +1,5 @@ /* - * $Id: ipconfig.c,v 1.20.2.1 1999/06/28 11:33:27 davem Exp $ + * $Id: ipconfig.c,v 1.20.2.3 2000/09/07 03:55:40 davem Exp $ * * Automatic Configuration of IP -- use DHCP, BOOTP, RARP, or * user-supplied information to configure own IP address and routes. diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c index f27ebfebbf97..ca927423a260 100644 --- a/net/ipv4/tcp_ipv4.c +++ b/net/ipv4/tcp_ipv4.c @@ -5,7 +5,7 @@ * * Implementation of the Transmission Control Protocol(TCP). * - * Version: $Id: tcp_ipv4.c,v 1.175.2.16 2000/06/28 04:54:17 davem Exp $ + * Version: $Id: tcp_ipv4.c,v 1.175.2.17 2000/10/31 22:42:58 davem Exp $ * * IPv4 specific functions * @@ -1909,8 +1909,17 @@ do_rewrite: static struct sock * tcp_v4_get_sock(struct sk_buff *skb, struct tcphdr *th) { - return tcp_v4_lookup(skb->nh.iph->saddr, th->source, - skb->nh.iph->daddr, th->dest, skb->dev->ifindex); +#ifdef CONFIG_IP_TRANSPARENT_PROXY + if (IPCB(skb)->redirport) + return tcp_v4_proxy_lookup(th->dest, skb->nh.iph->saddr, + th->source, skb->nh.iph->daddr, + skb->dev, IPCB(skb)->redirport, + skb->dev->ifindex); + else +#endif + return tcp_v4_lookup(skb->nh.iph->saddr, th->source, + skb->nh.iph->daddr, th->dest, + skb->dev->ifindex); } static void v4_addr2sockaddr(struct sock *sk, struct sockaddr * uaddr) diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c index b5a2b6bfdab3..8508d0ab7211 100644 --- a/net/ipv4/tcp_output.c +++ b/net/ipv4/tcp_output.c @@ -5,7 +5,7 @@ * * Implementation of the Transmission Control Protocol(TCP). * - * Version: $Id: tcp_output.c,v 1.108.2.9 2000/09/02 01:27:51 davem Exp $ + * Version: $Id: tcp_output.c,v 1.108.2.10 2000/10/29 01:52:21 davem Exp $ * * Authors: Ross Biro, * Fred N. van Kempen, @@ -195,7 +195,7 @@ void tcp_send_skb(struct sock *sk, struct sk_buff *skb, int force_queue) TCP_SKB_CB(skb)->when = tcp_time_stamp; tp->snd_nxt = TCP_SKB_CB(skb)->end_seq; tp->packets_out++; - tcp_transmit_skb(sk, skb_clone(skb, GFP_KERNEL)); + tcp_transmit_skb(sk, skb_clone(skb, sk->allocation)); if(!tcp_timer_is_set(sk, TIME_RETRANS)) tcp_reset_xmit_timer(sk, TIME_RETRANS, tp->rto); } else { diff --git a/net/netsyms.c b/net/netsyms.c index d2cd79ac31a3..b6832191020c 100644 --- a/net/netsyms.c +++ b/net/netsyms.c @@ -34,7 +34,7 @@ #endif #ifdef CONFIG_NET_DIVERT -#include +#include #endif /* CONFIG_NET_DIVERT */ #ifdef CONFIG_INET diff --git a/net/packet/af_packet.c b/net/packet/af_packet.c index 736a8900af02..5915ef9c4db7 100644 --- a/net/packet/af_packet.c +++ b/net/packet/af_packet.c @@ -5,7 +5,7 @@ * * PACKET - implements raw packet sockets. * - * Version: $Id: af_packet.c,v 1.19.2.2 2000/09/20 01:47:40 davem Exp $ + * Version: $Id: af_packet.c,v 1.19.2.3 2000/10/24 21:28:47 davem Exp $ * * Authors: Ross Biro, * Fred N. van Kempen, @@ -73,7 +73,7 @@ #endif #ifdef CONFIG_NET_DIVERT -#include +#include #endif /* CONFIG_NET_DIVERT */ #ifdef CONFIG_DLCI -- 2.39.5