diff options
Diffstat (limited to 'drivers/net/wan')
29 files changed, 121 insertions, 92 deletions
diff --git a/drivers/net/wan/cosa.c b/drivers/net/wan/cosa.c index 8e25ca7080c7..f0bd70fb650c 100644 --- a/drivers/net/wan/cosa.c +++ b/drivers/net/wan/cosa.c | |||
| @@ -297,8 +297,8 @@ static ssize_t cosa_write(struct file *file, | |||
| 297 | static unsigned int cosa_poll(struct file *file, poll_table *poll); | 297 | static unsigned int cosa_poll(struct file *file, poll_table *poll); |
| 298 | static int cosa_open(struct inode *inode, struct file *file); | 298 | static int cosa_open(struct inode *inode, struct file *file); |
| 299 | static int cosa_release(struct inode *inode, struct file *file); | 299 | static int cosa_release(struct inode *inode, struct file *file); |
| 300 | static int cosa_chardev_ioctl(struct inode *inode, struct file *file, | 300 | static long cosa_chardev_ioctl(struct file *file, unsigned int cmd, |
| 301 | unsigned int cmd, unsigned long arg); | 301 | unsigned long arg); |
| 302 | #ifdef COSA_FASYNC_WORKING | 302 | #ifdef COSA_FASYNC_WORKING |
| 303 | static int cosa_fasync(struct inode *inode, struct file *file, int on); | 303 | static int cosa_fasync(struct inode *inode, struct file *file, int on); |
| 304 | #endif | 304 | #endif |
| @@ -309,7 +309,7 @@ static const struct file_operations cosa_fops = { | |||
| 309 | .read = cosa_read, | 309 | .read = cosa_read, |
| 310 | .write = cosa_write, | 310 | .write = cosa_write, |
| 311 | .poll = cosa_poll, | 311 | .poll = cosa_poll, |
| 312 | .ioctl = cosa_chardev_ioctl, | 312 | .unlocked_ioctl = cosa_chardev_ioctl, |
| 313 | .open = cosa_open, | 313 | .open = cosa_open, |
| 314 | .release = cosa_release, | 314 | .release = cosa_release, |
| 315 | #ifdef COSA_FASYNC_WORKING | 315 | #ifdef COSA_FASYNC_WORKING |
| @@ -811,7 +811,7 @@ static ssize_t cosa_read(struct file *file, | |||
| 811 | cosa_enable_rx(chan); | 811 | cosa_enable_rx(chan); |
| 812 | spin_lock_irqsave(&cosa->lock, flags); | 812 | spin_lock_irqsave(&cosa->lock, flags); |
| 813 | add_wait_queue(&chan->rxwaitq, &wait); | 813 | add_wait_queue(&chan->rxwaitq, &wait); |
| 814 | while(!chan->rx_status) { | 814 | while (!chan->rx_status) { |
| 815 | current->state = TASK_INTERRUPTIBLE; | 815 | current->state = TASK_INTERRUPTIBLE; |
| 816 | spin_unlock_irqrestore(&cosa->lock, flags); | 816 | spin_unlock_irqrestore(&cosa->lock, flags); |
| 817 | schedule(); | 817 | schedule(); |
| @@ -896,7 +896,7 @@ static ssize_t cosa_write(struct file *file, | |||
| 896 | 896 | ||
| 897 | spin_lock_irqsave(&cosa->lock, flags); | 897 | spin_lock_irqsave(&cosa->lock, flags); |
| 898 | add_wait_queue(&chan->txwaitq, &wait); | 898 | add_wait_queue(&chan->txwaitq, &wait); |
| 899 | while(!chan->tx_status) { | 899 | while (!chan->tx_status) { |
| 900 | current->state = TASK_INTERRUPTIBLE; | 900 | current->state = TASK_INTERRUPTIBLE; |
| 901 | spin_unlock_irqrestore(&cosa->lock, flags); | 901 | spin_unlock_irqrestore(&cosa->lock, flags); |
| 902 | schedule(); | 902 | schedule(); |
| @@ -1153,7 +1153,7 @@ static int cosa_ioctl_common(struct cosa_data *cosa, | |||
| 1153 | struct channel_data *channel, unsigned int cmd, unsigned long arg) | 1153 | struct channel_data *channel, unsigned int cmd, unsigned long arg) |
| 1154 | { | 1154 | { |
| 1155 | void __user *argp = (void __user *)arg; | 1155 | void __user *argp = (void __user *)arg; |
| 1156 | switch(cmd) { | 1156 | switch (cmd) { |
| 1157 | case COSAIORSET: /* Reset the device */ | 1157 | case COSAIORSET: /* Reset the device */ |
| 1158 | if (!capable(CAP_NET_ADMIN)) | 1158 | if (!capable(CAP_NET_ADMIN)) |
| 1159 | return -EACCES; | 1159 | return -EACCES; |
| @@ -1205,12 +1205,18 @@ static int cosa_net_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd) | |||
| 1205 | return hdlc_ioctl(dev, ifr, cmd); | 1205 | return hdlc_ioctl(dev, ifr, cmd); |
| 1206 | } | 1206 | } |
| 1207 | 1207 | ||
| 1208 | static int cosa_chardev_ioctl(struct inode *inode, struct file *file, | 1208 | static long cosa_chardev_ioctl(struct file *file, unsigned int cmd, |
| 1209 | unsigned int cmd, unsigned long arg) | 1209 | unsigned long arg) |
| 1210 | { | 1210 | { |
| 1211 | struct channel_data *channel = file->private_data; | 1211 | struct channel_data *channel = file->private_data; |
| 1212 | struct cosa_data *cosa = channel->cosa; | 1212 | struct cosa_data *cosa; |
| 1213 | return cosa_ioctl_common(cosa, channel, cmd, arg); | 1213 | long ret; |
| 1214 | |||
| 1215 | lock_kernel(); | ||
| 1216 | cosa = channel->cosa; | ||
| 1217 | ret = cosa_ioctl_common(cosa, channel, cmd, arg); | ||
| 1218 | unlock_kernel(); | ||
| 1219 | return ret; | ||
| 1214 | } | 1220 | } |
| 1215 | 1221 | ||
| 1216 | 1222 | ||
| @@ -1698,7 +1704,7 @@ static inline void tx_interrupt(struct cosa_data *cosa, int status) | |||
| 1698 | spin_unlock_irqrestore(&cosa->lock, flags); | 1704 | spin_unlock_irqrestore(&cosa->lock, flags); |
| 1699 | return; | 1705 | return; |
| 1700 | } | 1706 | } |
| 1701 | while(1) { | 1707 | while (1) { |
| 1702 | cosa->txchan++; | 1708 | cosa->txchan++; |
| 1703 | i++; | 1709 | i++; |
| 1704 | if (cosa->txchan >= cosa->nchannels) | 1710 | if (cosa->txchan >= cosa->nchannels) |
| @@ -2004,7 +2010,7 @@ again: | |||
| 2004 | static void debug_status_in(struct cosa_data *cosa, int status) | 2010 | static void debug_status_in(struct cosa_data *cosa, int status) |
| 2005 | { | 2011 | { |
| 2006 | char *s; | 2012 | char *s; |
| 2007 | switch(status & SR_CMD_FROM_SRP_MASK) { | 2013 | switch (status & SR_CMD_FROM_SRP_MASK) { |
| 2008 | case SR_UP_REQUEST: | 2014 | case SR_UP_REQUEST: |
| 2009 | s = "RX_REQ"; | 2015 | s = "RX_REQ"; |
| 2010 | break; | 2016 | break; |
diff --git a/drivers/net/wan/dlci.c b/drivers/net/wan/dlci.c index 15d353f268b5..421d0715310e 100644 --- a/drivers/net/wan/dlci.c +++ b/drivers/net/wan/dlci.c | |||
| @@ -77,7 +77,7 @@ static int dlci_header(struct sk_buff *skb, struct net_device *dev, | |||
| 77 | dlp = netdev_priv(dev); | 77 | dlp = netdev_priv(dev); |
| 78 | 78 | ||
| 79 | hdr.control = FRAD_I_UI; | 79 | hdr.control = FRAD_I_UI; |
| 80 | switch(type) | 80 | switch (type) |
| 81 | { | 81 | { |
| 82 | case ETH_P_IP: | 82 | case ETH_P_IP: |
| 83 | hdr.IP_NLPID = FRAD_P_IP; | 83 | hdr.IP_NLPID = FRAD_P_IP; |
| @@ -130,7 +130,7 @@ static void dlci_receive(struct sk_buff *skb, struct net_device *dev) | |||
| 130 | dev->stats.rx_errors++; | 130 | dev->stats.rx_errors++; |
| 131 | } | 131 | } |
| 132 | else | 132 | else |
| 133 | switch(hdr->IP_NLPID) | 133 | switch (hdr->IP_NLPID) |
| 134 | { | 134 | { |
| 135 | case FRAD_P_PADDING: | 135 | case FRAD_P_PADDING: |
| 136 | if (hdr->NLPID != FRAD_P_SNAP) | 136 | if (hdr->NLPID != FRAD_P_SNAP) |
| @@ -208,7 +208,7 @@ static int dlci_config(struct net_device *dev, struct dlci_conf __user *conf, in | |||
| 208 | 208 | ||
| 209 | if (!get) | 209 | if (!get) |
| 210 | { | 210 | { |
| 211 | if(copy_from_user(&config, conf, sizeof(struct dlci_conf))) | 211 | if (copy_from_user(&config, conf, sizeof(struct dlci_conf))) |
| 212 | return -EFAULT; | 212 | return -EFAULT; |
| 213 | if (config.flags & ~DLCI_VALID_FLAGS) | 213 | if (config.flags & ~DLCI_VALID_FLAGS) |
| 214 | return(-EINVAL); | 214 | return(-EINVAL); |
| @@ -222,7 +222,7 @@ static int dlci_config(struct net_device *dev, struct dlci_conf __user *conf, in | |||
| 222 | 222 | ||
| 223 | if (get) | 223 | if (get) |
| 224 | { | 224 | { |
| 225 | if(copy_to_user(conf, &dlp->config, sizeof(struct dlci_conf))) | 225 | if (copy_to_user(conf, &dlp->config, sizeof(struct dlci_conf))) |
| 226 | return -EFAULT; | 226 | return -EFAULT; |
| 227 | } | 227 | } |
| 228 | 228 | ||
| @@ -238,7 +238,7 @@ static int dlci_dev_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd) | |||
| 238 | 238 | ||
| 239 | dlp = netdev_priv(dev); | 239 | dlp = netdev_priv(dev); |
| 240 | 240 | ||
| 241 | switch(cmd) | 241 | switch (cmd) |
| 242 | { | 242 | { |
| 243 | case DLCI_GET_SLAVE: | 243 | case DLCI_GET_SLAVE: |
| 244 | if (!*(short *)(dev->dev_addr)) | 244 | if (!*(short *)(dev->dev_addr)) |
| @@ -417,7 +417,7 @@ static int dlci_ioctl(unsigned int cmd, void __user *arg) | |||
| 417 | if (!capable(CAP_NET_ADMIN)) | 417 | if (!capable(CAP_NET_ADMIN)) |
| 418 | return(-EPERM); | 418 | return(-EPERM); |
| 419 | 419 | ||
| 420 | if(copy_from_user(&add, arg, sizeof(struct dlci_add))) | 420 | if (copy_from_user(&add, arg, sizeof(struct dlci_add))) |
| 421 | return -EFAULT; | 421 | return -EFAULT; |
| 422 | 422 | ||
| 423 | switch (cmd) | 423 | switch (cmd) |
| @@ -426,7 +426,7 @@ static int dlci_ioctl(unsigned int cmd, void __user *arg) | |||
| 426 | err = dlci_add(&add); | 426 | err = dlci_add(&add); |
| 427 | 427 | ||
| 428 | if (!err) | 428 | if (!err) |
| 429 | if(copy_to_user(arg, &add, sizeof(struct dlci_add))) | 429 | if (copy_to_user(arg, &add, sizeof(struct dlci_add))) |
| 430 | return -EFAULT; | 430 | return -EFAULT; |
| 431 | break; | 431 | break; |
| 432 | 432 | ||
diff --git a/drivers/net/wan/dscc4.c b/drivers/net/wan/dscc4.c index 07d00b4cf48a..a4859f7a7cc0 100644 --- a/drivers/net/wan/dscc4.c +++ b/drivers/net/wan/dscc4.c | |||
| @@ -89,6 +89,7 @@ | |||
| 89 | #include <linux/pci.h> | 89 | #include <linux/pci.h> |
| 90 | #include <linux/kernel.h> | 90 | #include <linux/kernel.h> |
| 91 | #include <linux/mm.h> | 91 | #include <linux/mm.h> |
| 92 | #include <linux/slab.h> | ||
| 92 | 93 | ||
| 93 | #include <asm/system.h> | 94 | #include <asm/system.h> |
| 94 | #include <asm/cache.h> | 95 | #include <asm/cache.h> |
| @@ -1128,7 +1129,7 @@ done: | |||
| 1128 | init_timer(&dpriv->timer); | 1129 | init_timer(&dpriv->timer); |
| 1129 | dpriv->timer.expires = jiffies + 10*HZ; | 1130 | dpriv->timer.expires = jiffies + 10*HZ; |
| 1130 | dpriv->timer.data = (unsigned long)dev; | 1131 | dpriv->timer.data = (unsigned long)dev; |
| 1131 | dpriv->timer.function = &dscc4_timer; | 1132 | dpriv->timer.function = dscc4_timer; |
| 1132 | add_timer(&dpriv->timer); | 1133 | add_timer(&dpriv->timer); |
| 1133 | netif_carrier_on(dev); | 1134 | netif_carrier_on(dev); |
| 1134 | 1135 | ||
| @@ -2050,7 +2051,7 @@ static int __init dscc4_setup(char *str) | |||
| 2050 | __setup("dscc4.setup=", dscc4_setup); | 2051 | __setup("dscc4.setup=", dscc4_setup); |
| 2051 | #endif | 2052 | #endif |
| 2052 | 2053 | ||
| 2053 | static struct pci_device_id dscc4_pci_tbl[] = { | 2054 | static DEFINE_PCI_DEVICE_TABLE(dscc4_pci_tbl) = { |
| 2054 | { PCI_VENDOR_ID_SIEMENS, PCI_DEVICE_ID_SIEMENS_DSCC4, | 2055 | { PCI_VENDOR_ID_SIEMENS, PCI_DEVICE_ID_SIEMENS_DSCC4, |
| 2055 | PCI_ANY_ID, PCI_ANY_ID, }, | 2056 | PCI_ANY_ID, PCI_ANY_ID, }, |
| 2056 | { 0,} | 2057 | { 0,} |
diff --git a/drivers/net/wan/farsync.c b/drivers/net/wan/farsync.c index beda387f2fc7..e087b9a6daaa 100644 --- a/drivers/net/wan/farsync.c +++ b/drivers/net/wan/farsync.c | |||
| @@ -20,6 +20,7 @@ | |||
| 20 | #include <linux/version.h> | 20 | #include <linux/version.h> |
| 21 | #include <linux/pci.h> | 21 | #include <linux/pci.h> |
| 22 | #include <linux/sched.h> | 22 | #include <linux/sched.h> |
| 23 | #include <linux/slab.h> | ||
| 23 | #include <linux/ioport.h> | 24 | #include <linux/ioport.h> |
| 24 | #include <linux/init.h> | 25 | #include <linux/init.h> |
| 25 | #include <linux/if.h> | 26 | #include <linux/if.h> |
| @@ -528,7 +529,7 @@ static int fst_debug_mask = { FST_DEBUG }; | |||
| 528 | /* | 529 | /* |
| 529 | * PCI ID lookup table | 530 | * PCI ID lookup table |
| 530 | */ | 531 | */ |
| 531 | static struct pci_device_id fst_pci_dev_id[] __devinitdata = { | 532 | static DEFINE_PCI_DEVICE_TABLE(fst_pci_dev_id) = { |
| 532 | {PCI_VENDOR_ID_FARSITE, PCI_DEVICE_ID_FARSITE_T2P, PCI_ANY_ID, | 533 | {PCI_VENDOR_ID_FARSITE, PCI_DEVICE_ID_FARSITE_T2P, PCI_ANY_ID, |
| 533 | PCI_ANY_ID, 0, 0, FST_TYPE_T2P}, | 534 | PCI_ANY_ID, 0, 0, FST_TYPE_T2P}, |
| 534 | 535 | ||
| @@ -1346,8 +1347,8 @@ do_bottom_half_tx(struct fst_card_info *card) | |||
| 1346 | 1347 | ||
| 1347 | dev = port_to_dev(port); | 1348 | dev = port_to_dev(port); |
| 1348 | while (!(FST_RDB(card, txDescrRing[pi][port->txpos].bits) & | 1349 | while (!(FST_RDB(card, txDescrRing[pi][port->txpos].bits) & |
| 1349 | DMA_OWN) | 1350 | DMA_OWN) && |
| 1350 | && !(card->dmatx_in_progress)) { | 1351 | !(card->dmatx_in_progress)) { |
| 1351 | /* | 1352 | /* |
| 1352 | * There doesn't seem to be a txdone event per-se | 1353 | * There doesn't seem to be a txdone event per-se |
| 1353 | * We seem to have to deduce it, by checking the DMA_OWN | 1354 | * We seem to have to deduce it, by checking the DMA_OWN |
| @@ -1379,8 +1380,8 @@ do_bottom_half_tx(struct fst_card_info *card) | |||
| 1379 | */ | 1380 | */ |
| 1380 | FST_WRW(card, txDescrRing[pi][port->txpos].bcnt, | 1381 | FST_WRW(card, txDescrRing[pi][port->txpos].bcnt, |
| 1381 | cnv_bcnt(skb->len)); | 1382 | cnv_bcnt(skb->len)); |
| 1382 | if ((skb->len < FST_MIN_DMA_LEN) | 1383 | if ((skb->len < FST_MIN_DMA_LEN) || |
| 1383 | || (card->family == FST_FAMILY_TXP)) { | 1384 | (card->family == FST_FAMILY_TXP)) { |
| 1384 | /* Enqueue the packet with normal io */ | 1385 | /* Enqueue the packet with normal io */ |
| 1385 | memcpy_toio(card->mem + | 1386 | memcpy_toio(card->mem + |
| 1386 | BUF_OFFSET(txBuffer[pi] | 1387 | BUF_OFFSET(txBuffer[pi] |
| @@ -2030,8 +2031,8 @@ fst_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd) | |||
| 2030 | /* Sanity check the parameters. We don't support partial writes | 2031 | /* Sanity check the parameters. We don't support partial writes |
| 2031 | * when going over the top | 2032 | * when going over the top |
| 2032 | */ | 2033 | */ |
| 2033 | if (wrthdr.size > FST_MEMSIZE || wrthdr.offset > FST_MEMSIZE | 2034 | if (wrthdr.size > FST_MEMSIZE || wrthdr.offset > FST_MEMSIZE || |
| 2034 | || wrthdr.size + wrthdr.offset > FST_MEMSIZE) { | 2035 | wrthdr.size + wrthdr.offset > FST_MEMSIZE) { |
| 2035 | return -ENXIO; | 2036 | return -ENXIO; |
| 2036 | } | 2037 | } |
| 2037 | 2038 | ||
diff --git a/drivers/net/wan/hd64570.c b/drivers/net/wan/hd64570.c index 80114c93bae7..4dde2ea4a189 100644 --- a/drivers/net/wan/hd64570.c +++ b/drivers/net/wan/hd64570.c | |||
| @@ -37,7 +37,6 @@ | |||
| 37 | #include <linux/module.h> | 37 | #include <linux/module.h> |
| 38 | #include <linux/netdevice.h> | 38 | #include <linux/netdevice.h> |
| 39 | #include <linux/skbuff.h> | 39 | #include <linux/skbuff.h> |
| 40 | #include <linux/slab.h> | ||
| 41 | #include <linux/string.h> | 40 | #include <linux/string.h> |
| 42 | #include <linux/types.h> | 41 | #include <linux/types.h> |
| 43 | #include <asm/io.h> | 42 | #include <asm/io.h> |
diff --git a/drivers/net/wan/hd64572.c b/drivers/net/wan/hd64572.c index 84f01373e11f..aad9ed45c254 100644 --- a/drivers/net/wan/hd64572.c +++ b/drivers/net/wan/hd64572.c | |||
| @@ -37,7 +37,6 @@ | |||
| 37 | #include <linux/module.h> | 37 | #include <linux/module.h> |
| 38 | #include <linux/netdevice.h> | 38 | #include <linux/netdevice.h> |
| 39 | #include <linux/skbuff.h> | 39 | #include <linux/skbuff.h> |
| 40 | #include <linux/slab.h> | ||
| 41 | #include <linux/string.h> | 40 | #include <linux/string.h> |
| 42 | #include <linux/types.h> | 41 | #include <linux/types.h> |
| 43 | #include <asm/io.h> | 42 | #include <asm/io.h> |
diff --git a/drivers/net/wan/hdlc.c b/drivers/net/wan/hdlc.c index cc07236ea734..9937bbab938d 100644 --- a/drivers/net/wan/hdlc.c +++ b/drivers/net/wan/hdlc.c | |||
| @@ -57,7 +57,7 @@ static int hdlc_rcv(struct sk_buff *skb, struct net_device *dev, | |||
| 57 | { | 57 | { |
| 58 | struct hdlc_device *hdlc = dev_to_hdlc(dev); | 58 | struct hdlc_device *hdlc = dev_to_hdlc(dev); |
| 59 | 59 | ||
| 60 | if (dev_net(dev) != &init_net) { | 60 | if (!net_eq(dev_net(dev), &init_net)) { |
| 61 | kfree_skb(skb); | 61 | kfree_skb(skb); |
| 62 | return 0; | 62 | return 0; |
| 63 | } | 63 | } |
| @@ -102,7 +102,7 @@ static int hdlc_device_event(struct notifier_block *this, unsigned long event, | |||
| 102 | unsigned long flags; | 102 | unsigned long flags; |
| 103 | int on; | 103 | int on; |
| 104 | 104 | ||
| 105 | if (dev_net(dev) != &init_net) | 105 | if (!net_eq(dev_net(dev), &init_net)) |
| 106 | return NOTIFY_DONE; | 106 | return NOTIFY_DONE; |
| 107 | 107 | ||
| 108 | if (!(dev->priv_flags & IFF_WAN_HDLC)) | 108 | if (!(dev->priv_flags & IFF_WAN_HDLC)) |
diff --git a/drivers/net/wan/hdlc_cisco.c b/drivers/net/wan/hdlc_cisco.c index f1bff98acd1f..ee7083fbea50 100644 --- a/drivers/net/wan/hdlc_cisco.c +++ b/drivers/net/wan/hdlc_cisco.c | |||
| @@ -20,7 +20,6 @@ | |||
| 20 | #include <linux/poll.h> | 20 | #include <linux/poll.h> |
| 21 | #include <linux/rtnetlink.h> | 21 | #include <linux/rtnetlink.h> |
| 22 | #include <linux/skbuff.h> | 22 | #include <linux/skbuff.h> |
| 23 | #include <linux/slab.h> | ||
| 24 | 23 | ||
| 25 | #undef DEBUG_HARD_HEADER | 24 | #undef DEBUG_HARD_HEADER |
| 26 | 25 | ||
| @@ -141,7 +140,7 @@ static __be16 cisco_type_trans(struct sk_buff *skb, struct net_device *dev) | |||
| 141 | data->address != CISCO_UNICAST) | 140 | data->address != CISCO_UNICAST) |
| 142 | return cpu_to_be16(ETH_P_HDLC); | 141 | return cpu_to_be16(ETH_P_HDLC); |
| 143 | 142 | ||
| 144 | switch(data->protocol) { | 143 | switch (data->protocol) { |
| 145 | case cpu_to_be16(ETH_P_IP): | 144 | case cpu_to_be16(ETH_P_IP): |
| 146 | case cpu_to_be16(ETH_P_IPX): | 145 | case cpu_to_be16(ETH_P_IPX): |
| 147 | case cpu_to_be16(ETH_P_IPV6): | 146 | case cpu_to_be16(ETH_P_IPV6): |
| @@ -190,7 +189,7 @@ static int cisco_rx(struct sk_buff *skb) | |||
| 190 | cisco_data = (struct cisco_packet*)(skb->data + sizeof | 189 | cisco_data = (struct cisco_packet*)(skb->data + sizeof |
| 191 | (struct hdlc_header)); | 190 | (struct hdlc_header)); |
| 192 | 191 | ||
| 193 | switch(ntohl (cisco_data->type)) { | 192 | switch (ntohl (cisco_data->type)) { |
| 194 | case CISCO_ADDR_REQ: /* Stolen from syncppp.c :-) */ | 193 | case CISCO_ADDR_REQ: /* Stolen from syncppp.c :-) */ |
| 195 | in_dev = dev->ip_ptr; | 194 | in_dev = dev->ip_ptr; |
| 196 | addr = 0; | 195 | addr = 0; |
| @@ -245,8 +244,8 @@ static int cisco_rx(struct sk_buff *skb) | |||
| 245 | 244 | ||
| 246 | dev_kfree_skb_any(skb); | 245 | dev_kfree_skb_any(skb); |
| 247 | return NET_RX_SUCCESS; | 246 | return NET_RX_SUCCESS; |
| 248 | } /* switch(keepalive type) */ | 247 | } /* switch (keepalive type) */ |
| 249 | } /* switch(protocol) */ | 248 | } /* switch (protocol) */ |
| 250 | 249 | ||
| 251 | printk(KERN_INFO "%s: Unsupported protocol %x\n", dev->name, | 250 | printk(KERN_INFO "%s: Unsupported protocol %x\n", dev->name, |
| 252 | ntohs(data->protocol)); | 251 | ntohs(data->protocol)); |
diff --git a/drivers/net/wan/hdlc_fr.c b/drivers/net/wan/hdlc_fr.c index 840cff72a0f1..0e52993e2079 100644 --- a/drivers/net/wan/hdlc_fr.c +++ b/drivers/net/wan/hdlc_fr.c | |||
| @@ -182,7 +182,7 @@ static inline pvc_device* find_pvc(hdlc_device *hdlc, u16 dlci) | |||
| 182 | if (pvc->dlci == dlci) | 182 | if (pvc->dlci == dlci) |
| 183 | return pvc; | 183 | return pvc; |
| 184 | if (pvc->dlci > dlci) | 184 | if (pvc->dlci > dlci) |
| 185 | return NULL; /* the listed is sorted */ | 185 | return NULL; /* the list is sorted */ |
| 186 | pvc = pvc->next; | 186 | pvc = pvc->next; |
| 187 | } | 187 | } |
| 188 | 188 | ||
| @@ -1214,10 +1214,10 @@ static int fr_ioctl(struct net_device *dev, struct ifreq *ifr) | |||
| 1214 | return 0; | 1214 | return 0; |
| 1215 | 1215 | ||
| 1216 | case IF_PROTO_FR: | 1216 | case IF_PROTO_FR: |
| 1217 | if(!capable(CAP_NET_ADMIN)) | 1217 | if (!capable(CAP_NET_ADMIN)) |
| 1218 | return -EPERM; | 1218 | return -EPERM; |
| 1219 | 1219 | ||
| 1220 | if(dev->flags & IFF_UP) | 1220 | if (dev->flags & IFF_UP) |
| 1221 | return -EBUSY; | 1221 | return -EBUSY; |
| 1222 | 1222 | ||
| 1223 | if (copy_from_user(&new_settings, fr_s, size)) | 1223 | if (copy_from_user(&new_settings, fr_s, size)) |
| @@ -1263,7 +1263,7 @@ static int fr_ioctl(struct net_device *dev, struct ifreq *ifr) | |||
| 1263 | if (dev_to_hdlc(dev)->proto != &proto) /* Different proto */ | 1263 | if (dev_to_hdlc(dev)->proto != &proto) /* Different proto */ |
| 1264 | return -EINVAL; | 1264 | return -EINVAL; |
| 1265 | 1265 | ||
| 1266 | if(!capable(CAP_NET_ADMIN)) | 1266 | if (!capable(CAP_NET_ADMIN)) |
| 1267 | return -EPERM; | 1267 | return -EPERM; |
| 1268 | 1268 | ||
| 1269 | if (copy_from_user(&pvc, ifr->ifr_settings.ifs_ifsu.fr_pvc, | 1269 | if (copy_from_user(&pvc, ifr->ifr_settings.ifs_ifsu.fr_pvc, |
diff --git a/drivers/net/wan/hdlc_ppp.c b/drivers/net/wan/hdlc_ppp.c index b9b9d6b01c0b..941f053e650e 100644 --- a/drivers/net/wan/hdlc_ppp.c +++ b/drivers/net/wan/hdlc_ppp.c | |||
| @@ -628,9 +628,15 @@ static void ppp_stop(struct net_device *dev) | |||
| 628 | ppp_cp_event(dev, PID_LCP, STOP, 0, 0, 0, NULL); | 628 | ppp_cp_event(dev, PID_LCP, STOP, 0, 0, 0, NULL); |
| 629 | } | 629 | } |
| 630 | 630 | ||
| 631 | static void ppp_close(struct net_device *dev) | ||
| 632 | { | ||
| 633 | ppp_tx_flush(); | ||
| 634 | } | ||
| 635 | |||
| 631 | static struct hdlc_proto proto = { | 636 | static struct hdlc_proto proto = { |
| 632 | .start = ppp_start, | 637 | .start = ppp_start, |
| 633 | .stop = ppp_stop, | 638 | .stop = ppp_stop, |
| 639 | .close = ppp_close, | ||
| 634 | .type_trans = ppp_type_trans, | 640 | .type_trans = ppp_type_trans, |
| 635 | .ioctl = ppp_ioctl, | 641 | .ioctl = ppp_ioctl, |
| 636 | .netif_rx = ppp_rx, | 642 | .netif_rx = ppp_rx, |
diff --git a/drivers/net/wan/hdlc_raw.c b/drivers/net/wan/hdlc_raw.c index 19f51fdd5522..5dc153e8a29d 100644 --- a/drivers/net/wan/hdlc_raw.c +++ b/drivers/net/wan/hdlc_raw.c | |||
| @@ -20,7 +20,6 @@ | |||
| 20 | #include <linux/poll.h> | 20 | #include <linux/poll.h> |
| 21 | #include <linux/rtnetlink.h> | 21 | #include <linux/rtnetlink.h> |
| 22 | #include <linux/skbuff.h> | 22 | #include <linux/skbuff.h> |
| 23 | #include <linux/slab.h> | ||
| 24 | 23 | ||
| 25 | 24 | ||
| 26 | static int raw_ioctl(struct net_device *dev, struct ifreq *ifr); | 25 | static int raw_ioctl(struct net_device *dev, struct ifreq *ifr); |
diff --git a/drivers/net/wan/hdlc_raw_eth.c b/drivers/net/wan/hdlc_raw_eth.c index 1b30fcc24145..05c9b0b96239 100644 --- a/drivers/net/wan/hdlc_raw_eth.c +++ b/drivers/net/wan/hdlc_raw_eth.c | |||
| @@ -11,6 +11,7 @@ | |||
| 11 | 11 | ||
| 12 | #include <linux/errno.h> | 12 | #include <linux/errno.h> |
| 13 | #include <linux/etherdevice.h> | 13 | #include <linux/etherdevice.h> |
| 14 | #include <linux/gfp.h> | ||
| 14 | #include <linux/hdlc.h> | 15 | #include <linux/hdlc.h> |
| 15 | #include <linux/if_arp.h> | 16 | #include <linux/if_arp.h> |
| 16 | #include <linux/inetdevice.h> | 17 | #include <linux/inetdevice.h> |
| @@ -21,7 +22,6 @@ | |||
| 21 | #include <linux/poll.h> | 22 | #include <linux/poll.h> |
| 22 | #include <linux/rtnetlink.h> | 23 | #include <linux/rtnetlink.h> |
| 23 | #include <linux/skbuff.h> | 24 | #include <linux/skbuff.h> |
| 24 | #include <linux/slab.h> | ||
| 25 | 25 | ||
| 26 | static int raw_eth_ioctl(struct net_device *dev, struct ifreq *ifr); | 26 | static int raw_eth_ioctl(struct net_device *dev, struct ifreq *ifr); |
| 27 | 27 | ||
diff --git a/drivers/net/wan/hdlc_x25.c b/drivers/net/wan/hdlc_x25.c index aa9248f8eb1a..c7adbb79f7cc 100644 --- a/drivers/net/wan/hdlc_x25.c +++ b/drivers/net/wan/hdlc_x25.c | |||
| @@ -10,6 +10,7 @@ | |||
| 10 | */ | 10 | */ |
| 11 | 11 | ||
| 12 | #include <linux/errno.h> | 12 | #include <linux/errno.h> |
| 13 | #include <linux/gfp.h> | ||
| 13 | #include <linux/hdlc.h> | 14 | #include <linux/hdlc.h> |
| 14 | #include <linux/if_arp.h> | 15 | #include <linux/if_arp.h> |
| 15 | #include <linux/inetdevice.h> | 16 | #include <linux/inetdevice.h> |
| @@ -21,7 +22,6 @@ | |||
| 21 | #include <linux/poll.h> | 22 | #include <linux/poll.h> |
| 22 | #include <linux/rtnetlink.h> | 23 | #include <linux/rtnetlink.h> |
| 23 | #include <linux/skbuff.h> | 24 | #include <linux/skbuff.h> |
| 24 | #include <linux/slab.h> | ||
| 25 | #include <net/x25device.h> | 25 | #include <net/x25device.h> |
| 26 | 26 | ||
| 27 | static int x25_ioctl(struct net_device *dev, struct ifreq *ifr); | 27 | static int x25_ioctl(struct net_device *dev, struct ifreq *ifr); |
| @@ -202,10 +202,10 @@ static int x25_ioctl(struct net_device *dev, struct ifreq *ifr) | |||
| 202 | return 0; /* return protocol only, no settable parameters */ | 202 | return 0; /* return protocol only, no settable parameters */ |
| 203 | 203 | ||
| 204 | case IF_PROTO_X25: | 204 | case IF_PROTO_X25: |
| 205 | if(!capable(CAP_NET_ADMIN)) | 205 | if (!capable(CAP_NET_ADMIN)) |
| 206 | return -EPERM; | 206 | return -EPERM; |
| 207 | 207 | ||
| 208 | if(dev->flags & IFF_UP) | 208 | if (dev->flags & IFF_UP) |
| 209 | return -EBUSY; | 209 | return -EBUSY; |
| 210 | 210 | ||
| 211 | result=hdlc->attach(dev, ENCODING_NRZ,PARITY_CRC16_PR1_CCITT); | 211 | result=hdlc->attach(dev, ENCODING_NRZ,PARITY_CRC16_PR1_CCITT); |
diff --git a/drivers/net/wan/hostess_sv11.c b/drivers/net/wan/hostess_sv11.c index 15002c3d0d95..48edc5f4dac8 100644 --- a/drivers/net/wan/hostess_sv11.c +++ b/drivers/net/wan/hostess_sv11.c | |||
| @@ -30,6 +30,7 @@ | |||
| 30 | #include <linux/delay.h> | 30 | #include <linux/delay.h> |
| 31 | #include <linux/hdlc.h> | 31 | #include <linux/hdlc.h> |
| 32 | #include <linux/ioport.h> | 32 | #include <linux/ioport.h> |
| 33 | #include <linux/slab.h> | ||
| 33 | #include <net/arp.h> | 34 | #include <net/arp.h> |
| 34 | 35 | ||
| 35 | #include <asm/irq.h> | 36 | #include <asm/irq.h> |
| @@ -218,7 +219,7 @@ static struct z8530_dev *sv11_init(int iobase, int irq) | |||
| 218 | /* We want a fast IRQ for this device. Actually we'd like an even faster | 219 | /* We want a fast IRQ for this device. Actually we'd like an even faster |
| 219 | IRQ ;) - This is one driver RtLinux is made for */ | 220 | IRQ ;) - This is one driver RtLinux is made for */ |
| 220 | 221 | ||
| 221 | if (request_irq(irq, &z8530_interrupt, IRQF_DISABLED, | 222 | if (request_irq(irq, z8530_interrupt, IRQF_DISABLED, |
| 222 | "Hostess SV11", sv) < 0) { | 223 | "Hostess SV11", sv) < 0) { |
| 223 | printk(KERN_WARNING "hostess: IRQ %d already in use.\n", irq); | 224 | printk(KERN_WARNING "hostess: IRQ %d already in use.\n", irq); |
| 224 | goto err_irq; | 225 | goto err_irq; |
diff --git a/drivers/net/wan/ixp4xx_hss.c b/drivers/net/wan/ixp4xx_hss.c index c705046d8615..0c2cdde686a0 100644 --- a/drivers/net/wan/ixp4xx_hss.c +++ b/drivers/net/wan/ixp4xx_hss.c | |||
| @@ -18,6 +18,7 @@ | |||
| 18 | #include <linux/kernel.h> | 18 | #include <linux/kernel.h> |
| 19 | #include <linux/platform_device.h> | 19 | #include <linux/platform_device.h> |
| 20 | #include <linux/poll.h> | 20 | #include <linux/poll.h> |
| 21 | #include <linux/slab.h> | ||
| 21 | #include <mach/npe.h> | 22 | #include <mach/npe.h> |
| 22 | #include <mach/qmgr.h> | 23 | #include <mach/qmgr.h> |
| 23 | 24 | ||
diff --git a/drivers/net/wan/lapbether.c b/drivers/net/wan/lapbether.c index d1e3c673e9b2..98e2f99903d7 100644 --- a/drivers/net/wan/lapbether.c +++ b/drivers/net/wan/lapbether.c | |||
| @@ -24,6 +24,7 @@ | |||
| 24 | #include <linux/types.h> | 24 | #include <linux/types.h> |
| 25 | #include <linux/socket.h> | 25 | #include <linux/socket.h> |
| 26 | #include <linux/in.h> | 26 | #include <linux/in.h> |
| 27 | #include <linux/slab.h> | ||
| 27 | #include <linux/kernel.h> | 28 | #include <linux/kernel.h> |
| 28 | #include <linux/string.h> | 29 | #include <linux/string.h> |
| 29 | #include <linux/net.h> | 30 | #include <linux/net.h> |
diff --git a/drivers/net/wan/lmc/lmc_main.c b/drivers/net/wan/lmc/lmc_main.c index 7ea71b33d2e9..b27850377121 100644 --- a/drivers/net/wan/lmc/lmc_main.c +++ b/drivers/net/wan/lmc/lmc_main.c | |||
| @@ -77,7 +77,7 @@ | |||
| 77 | 77 | ||
| 78 | static int LMC_PKT_BUF_SZ = 1542; | 78 | static int LMC_PKT_BUF_SZ = 1542; |
| 79 | 79 | ||
| 80 | static struct pci_device_id lmc_pci_tbl[] = { | 80 | static DEFINE_PCI_DEVICE_TABLE(lmc_pci_tbl) = { |
| 81 | { PCI_VENDOR_ID_DEC, PCI_DEVICE_ID_DEC_TULIP_FAST, | 81 | { PCI_VENDOR_ID_DEC, PCI_DEVICE_ID_DEC_TULIP_FAST, |
| 82 | PCI_VENDOR_ID_LMC, PCI_ANY_ID }, | 82 | PCI_VENDOR_ID_LMC, PCI_ANY_ID }, |
| 83 | { PCI_VENDOR_ID_DEC, PCI_DEVICE_ID_DEC_TULIP_FAST, | 83 | { PCI_VENDOR_ID_DEC, PCI_DEVICE_ID_DEC_TULIP_FAST, |
| @@ -927,7 +927,7 @@ static int __devinit lmc_init_one(struct pci_dev *pdev, | |||
| 927 | sc->lmc_media = &lmc_t1_media; | 927 | sc->lmc_media = &lmc_t1_media; |
| 928 | break; | 928 | break; |
| 929 | default: | 929 | default: |
| 930 | printk(KERN_WARNING "%s: LMC UNKOWN CARD!\n", dev->name); | 930 | printk(KERN_WARNING "%s: LMC UNKNOWN CARD!\n", dev->name); |
| 931 | break; | 931 | break; |
| 932 | } | 932 | } |
| 933 | 933 | ||
| @@ -1028,7 +1028,7 @@ static int lmc_open(struct net_device *dev) | |||
| 1028 | lmc_softreset (sc); | 1028 | lmc_softreset (sc); |
| 1029 | 1029 | ||
| 1030 | /* Since we have to use PCI bus, this should work on x86,alpha,ppc */ | 1030 | /* Since we have to use PCI bus, this should work on x86,alpha,ppc */ |
| 1031 | if (request_irq (dev->irq, &lmc_interrupt, IRQF_SHARED, dev->name, dev)){ | 1031 | if (request_irq (dev->irq, lmc_interrupt, IRQF_SHARED, dev->name, dev)){ |
| 1032 | printk(KERN_WARNING "%s: could not get irq: %d\n", dev->name, dev->irq); | 1032 | printk(KERN_WARNING "%s: could not get irq: %d\n", dev->name, dev->irq); |
| 1033 | lmc_trace(dev, "lmc_open irq failed out"); | 1033 | lmc_trace(dev, "lmc_open irq failed out"); |
| 1034 | return -EAGAIN; | 1034 | return -EAGAIN; |
diff --git a/drivers/net/wan/lmc/lmc_media.c b/drivers/net/wan/lmc/lmc_media.c index f327674fc93a..5920c996fcdf 100644 --- a/drivers/net/wan/lmc/lmc_media.c +++ b/drivers/net/wan/lmc/lmc_media.c | |||
| @@ -6,7 +6,6 @@ | |||
| 6 | #include <linux/ptrace.h> | 6 | #include <linux/ptrace.h> |
| 7 | #include <linux/errno.h> | 7 | #include <linux/errno.h> |
| 8 | #include <linux/ioport.h> | 8 | #include <linux/ioport.h> |
| 9 | #include <linux/slab.h> | ||
| 10 | #include <linux/interrupt.h> | 9 | #include <linux/interrupt.h> |
| 11 | #include <linux/in.h> | 10 | #include <linux/in.h> |
| 12 | #include <linux/if_arp.h> | 11 | #include <linux/if_arp.h> |
diff --git a/drivers/net/wan/lmc/lmc_proto.c b/drivers/net/wan/lmc/lmc_proto.c index 044a48175c42..f600075e84a2 100644 --- a/drivers/net/wan/lmc/lmc_proto.c +++ b/drivers/net/wan/lmc/lmc_proto.c | |||
| @@ -25,7 +25,6 @@ | |||
| 25 | #include <linux/ptrace.h> | 25 | #include <linux/ptrace.h> |
| 26 | #include <linux/errno.h> | 26 | #include <linux/errno.h> |
| 27 | #include <linux/ioport.h> | 27 | #include <linux/ioport.h> |
| 28 | #include <linux/slab.h> | ||
| 29 | #include <linux/interrupt.h> | 28 | #include <linux/interrupt.h> |
| 30 | #include <linux/in.h> | 29 | #include <linux/in.h> |
| 31 | #include <linux/if_arp.h> | 30 | #include <linux/if_arp.h> |
diff --git a/drivers/net/wan/n2.c b/drivers/net/wan/n2.c index 58c66819f39b..5394b51bdb2f 100644 --- a/drivers/net/wan/n2.c +++ b/drivers/net/wan/n2.c | |||
| @@ -376,7 +376,7 @@ static int __init n2_run(unsigned long io, unsigned long irq, | |||
| 376 | } | 376 | } |
| 377 | card->io = io; | 377 | card->io = io; |
| 378 | 378 | ||
| 379 | if (request_irq(irq, &sca_intr, 0, devname, card)) { | 379 | if (request_irq(irq, sca_intr, 0, devname, card)) { |
| 380 | printk(KERN_ERR "n2: could not allocate IRQ\n"); | 380 | printk(KERN_ERR "n2: could not allocate IRQ\n"); |
| 381 | n2_destroy_card(card); | 381 | n2_destroy_card(card); |
| 382 | return(-EBUSY); | 382 | return(-EBUSY); |
diff --git a/drivers/net/wan/pc300_drv.c b/drivers/net/wan/pc300_drv.c index 79dabc557bd3..3f744c643094 100644 --- a/drivers/net/wan/pc300_drv.c +++ b/drivers/net/wan/pc300_drv.c | |||
| @@ -228,6 +228,7 @@ static char rcsid[] = | |||
| 228 | #include <linux/etherdevice.h> | 228 | #include <linux/etherdevice.h> |
| 229 | #include <linux/spinlock.h> | 229 | #include <linux/spinlock.h> |
| 230 | #include <linux/if.h> | 230 | #include <linux/if.h> |
| 231 | #include <linux/slab.h> | ||
| 231 | #include <net/arp.h> | 232 | #include <net/arp.h> |
| 232 | 233 | ||
| 233 | #include <asm/io.h> | 234 | #include <asm/io.h> |
| @@ -251,7 +252,7 @@ static char rcsid[] = | |||
| 251 | #undef PC300_DEBUG_RX | 252 | #undef PC300_DEBUG_RX |
| 252 | #undef PC300_DEBUG_OTHER | 253 | #undef PC300_DEBUG_OTHER |
| 253 | 254 | ||
| 254 | static struct pci_device_id cpc_pci_dev_id[] __devinitdata = { | 255 | static DEFINE_PCI_DEVICE_TABLE(cpc_pci_dev_id) = { |
| 255 | /* PC300/RSV or PC300/X21, 2 chan */ | 256 | /* PC300/RSV or PC300/X21, 2 chan */ |
| 256 | {0x120e, 0x300, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0x300}, | 257 | {0x120e, 0x300, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0x300}, |
| 257 | /* PC300/RSV or PC300/X21, 1 chan */ | 258 | /* PC300/RSV or PC300/X21, 1 chan */ |
| @@ -514,8 +515,8 @@ static int dma_buf_read(pc300_t * card, int ch, struct sk_buff *skb) | |||
| 514 | RX_BD_ADDR(ch, chan->rx_first_bd)); | 515 | RX_BD_ADDR(ch, chan->rx_first_bd)); |
| 515 | while ((status = cpc_readb(&ptdescr->status)) & DST_OSB) { | 516 | while ((status = cpc_readb(&ptdescr->status)) & DST_OSB) { |
| 516 | nchar = cpc_readw(&ptdescr->len); | 517 | nchar = cpc_readw(&ptdescr->len); |
| 517 | if ((status & (DST_OVR | DST_CRC | DST_RBIT | DST_SHRT | DST_ABT)) | 518 | if ((status & (DST_OVR | DST_CRC | DST_RBIT | DST_SHRT | DST_ABT)) || |
| 518 | || (nchar > BD_DEF_LEN)) { | 519 | (nchar > BD_DEF_LEN)) { |
| 519 | 520 | ||
| 520 | if (nchar > BD_DEF_LEN) | 521 | if (nchar > BD_DEF_LEN) |
| 521 | status |= DST_RBIT; | 522 | status |= DST_RBIT; |
| @@ -1428,8 +1429,7 @@ static void falc_update_stats(pc300_t * card, int ch) | |||
| 1428 | 1429 | ||
| 1429 | if (((conf->media == IF_IFACE_T1) && | 1430 | if (((conf->media == IF_IFACE_T1) && |
| 1430 | (cpc_readb(falcbase + F_REG(FRS1, ch)) & FRS1_LLBAD) && | 1431 | (cpc_readb(falcbase + F_REG(FRS1, ch)) & FRS1_LLBAD) && |
| 1431 | (!(cpc_readb(falcbase + F_REG(FRS1, ch)) & FRS1_PDEN))) | 1432 | (!(cpc_readb(falcbase + F_REG(FRS1, ch)) & FRS1_PDEN))) || |
| 1432 | || | ||
| 1433 | ((conf->media == IF_IFACE_E1) && | 1433 | ((conf->media == IF_IFACE_E1) && |
| 1434 | (cpc_readb(falcbase + F_REG(RSP, ch)) & RSP_LLBAD))) { | 1434 | (cpc_readb(falcbase + F_REG(RSP, ch)) & RSP_LLBAD))) { |
| 1435 | pfalc->prbs = 2; | 1435 | pfalc->prbs = 2; |
| @@ -2285,8 +2285,8 @@ static void falc_e1_intr(pc300_t * card, int ch) | |||
| 2285 | if (gis & GIS_ISR1) { | 2285 | if (gis & GIS_ISR1) { |
| 2286 | isr1 = cpc_readb(falcbase + F_REG(FISR1, ch)); | 2286 | isr1 = cpc_readb(falcbase + F_REG(FISR1, ch)); |
| 2287 | if (isr1 & FISR1_XMB) { | 2287 | if (isr1 & FISR1_XMB) { |
| 2288 | if ((pfalc->xmb_cause & 2) | 2288 | if ((pfalc->xmb_cause & 2) && |
| 2289 | && pfalc->multiframe_mode) { | 2289 | pfalc->multiframe_mode) { |
| 2290 | if (cpc_readb (falcbase + F_REG(FRS0, ch)) & | 2290 | if (cpc_readb (falcbase + F_REG(FRS0, ch)) & |
| 2291 | (FRS0_LOS | FRS0_AIS | FRS0_LFA)) { | 2291 | (FRS0_LOS | FRS0_AIS | FRS0_LFA)) { |
| 2292 | cpc_writeb(falcbase + F_REG(XSP, ch), | 2292 | cpc_writeb(falcbase + F_REG(XSP, ch), |
| @@ -2639,9 +2639,9 @@ static int cpc_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd) | |||
| 2639 | !(cpc_readb (scabase + M_REG(CTL, ch)) & CTL_DTR); | 2639 | !(cpc_readb (scabase + M_REG(CTL, ch)) & CTL_DTR); |
| 2640 | /* There is no DSR in HD64572 */ | 2640 | /* There is no DSR in HD64572 */ |
| 2641 | } | 2641 | } |
| 2642 | if (!arg | 2642 | if (!arg || |
| 2643 | || copy_to_user(arg, &pc300status, sizeof(pc300status_t))) | 2643 | copy_to_user(arg, &pc300status, sizeof(pc300status_t))) |
| 2644 | return -EINVAL; | 2644 | return -EINVAL; |
| 2645 | return 0; | 2645 | return 0; |
| 2646 | } | 2646 | } |
| 2647 | 2647 | ||
diff --git a/drivers/net/wan/pc300too.c b/drivers/net/wan/pc300too.c index 60ece54bdd94..c7ab3becd261 100644 --- a/drivers/net/wan/pc300too.c +++ b/drivers/net/wan/pc300too.c | |||
| @@ -481,7 +481,7 @@ static int __devinit pc300_pci_init_one(struct pci_dev *pdev, | |||
| 481 | 481 | ||
| 482 | 482 | ||
| 483 | 483 | ||
| 484 | static struct pci_device_id pc300_pci_tbl[] __devinitdata = { | 484 | static DEFINE_PCI_DEVICE_TABLE(pc300_pci_tbl) = { |
| 485 | { PCI_VENDOR_ID_CYCLADES, PCI_DEVICE_ID_PC300_RX_1, PCI_ANY_ID, | 485 | { PCI_VENDOR_ID_CYCLADES, PCI_DEVICE_ID_PC300_RX_1, PCI_ANY_ID, |
| 486 | PCI_ANY_ID, 0, 0, 0 }, | 486 | PCI_ANY_ID, 0, 0, 0 }, |
| 487 | { PCI_VENDOR_ID_CYCLADES, PCI_DEVICE_ID_PC300_RX_2, PCI_ANY_ID, | 487 | { PCI_VENDOR_ID_CYCLADES, PCI_DEVICE_ID_PC300_RX_2, PCI_ANY_ID, |
diff --git a/drivers/net/wan/pci200syn.c b/drivers/net/wan/pci200syn.c index f1340faaf022..e2cff64a446a 100644 --- a/drivers/net/wan/pci200syn.c +++ b/drivers/net/wan/pci200syn.c | |||
| @@ -417,7 +417,7 @@ static int __devinit pci200_pci_init_one(struct pci_dev *pdev, | |||
| 417 | 417 | ||
| 418 | 418 | ||
| 419 | 419 | ||
| 420 | static struct pci_device_id pci200_pci_tbl[] __devinitdata = { | 420 | static DEFINE_PCI_DEVICE_TABLE(pci200_pci_tbl) = { |
| 421 | { PCI_VENDOR_ID_PLX, PCI_DEVICE_ID_PLX_9050, PCI_VENDOR_ID_PLX, | 421 | { PCI_VENDOR_ID_PLX, PCI_DEVICE_ID_PLX_9050, PCI_VENDOR_ID_PLX, |
| 422 | PCI_DEVICE_ID_PLX_PCI200SYN, 0, 0, 0 }, | 422 | PCI_DEVICE_ID_PLX_PCI200SYN, 0, 0, 0 }, |
| 423 | { 0, } | 423 | { 0, } |
diff --git a/drivers/net/wan/sbni.c b/drivers/net/wan/sbni.c index 1cc24a45f003..cff13a9597cd 100644 --- a/drivers/net/wan/sbni.c +++ b/drivers/net/wan/sbni.c | |||
| @@ -43,7 +43,6 @@ | |||
| 43 | #include <linux/fcntl.h> | 43 | #include <linux/fcntl.h> |
| 44 | #include <linux/ioport.h> | 44 | #include <linux/ioport.h> |
| 45 | #include <linux/interrupt.h> | 45 | #include <linux/interrupt.h> |
| 46 | #include <linux/slab.h> | ||
| 47 | #include <linux/string.h> | 46 | #include <linux/string.h> |
| 48 | #include <linux/errno.h> | 47 | #include <linux/errno.h> |
| 49 | #include <linux/netdevice.h> | 48 | #include <linux/netdevice.h> |
| @@ -195,9 +194,9 @@ static unsigned int netcard_portlist[ ] __initdata = { | |||
| 195 | static inline int __init | 194 | static inline int __init |
| 196 | sbni_isa_probe( struct net_device *dev ) | 195 | sbni_isa_probe( struct net_device *dev ) |
| 197 | { | 196 | { |
| 198 | if( dev->base_addr > 0x1ff | 197 | if( dev->base_addr > 0x1ff && |
| 199 | && request_region( dev->base_addr, SBNI_IO_EXTENT, dev->name ) | 198 | request_region( dev->base_addr, SBNI_IO_EXTENT, dev->name ) && |
| 200 | && sbni_probe1( dev, dev->base_addr, dev->irq ) ) | 199 | sbni_probe1( dev, dev->base_addr, dev->irq ) ) |
| 201 | 200 | ||
| 202 | return 0; | 201 | return 0; |
| 203 | else { | 202 | else { |
| @@ -286,8 +285,8 @@ static int __init sbni_init(struct net_device *dev) | |||
| 286 | 285 | ||
| 287 | for( i = 0; netcard_portlist[ i ]; ++i ) { | 286 | for( i = 0; netcard_portlist[ i ]; ++i ) { |
| 288 | int ioaddr = netcard_portlist[ i ]; | 287 | int ioaddr = netcard_portlist[ i ]; |
| 289 | if( request_region( ioaddr, SBNI_IO_EXTENT, dev->name ) | 288 | if( request_region( ioaddr, SBNI_IO_EXTENT, dev->name ) && |
| 290 | && sbni_probe1( dev, ioaddr, 0 )) | 289 | sbni_probe1( dev, ioaddr, 0 )) |
| 291 | return 0; | 290 | return 0; |
| 292 | } | 291 | } |
| 293 | 292 | ||
| @@ -306,9 +305,9 @@ sbni_pci_probe( struct net_device *dev ) | |||
| 306 | unsigned long pci_ioaddr; | 305 | unsigned long pci_ioaddr; |
| 307 | u16 subsys; | 306 | u16 subsys; |
| 308 | 307 | ||
| 309 | if( pdev->vendor != SBNI_PCI_VENDOR | 308 | if( pdev->vendor != SBNI_PCI_VENDOR && |
| 310 | && pdev->device != SBNI_PCI_DEVICE ) | 309 | pdev->device != SBNI_PCI_DEVICE ) |
| 311 | continue; | 310 | continue; |
| 312 | 311 | ||
| 313 | pci_ioaddr = pci_resource_start( pdev, 0 ); | 312 | pci_ioaddr = pci_resource_start( pdev, 0 ); |
| 314 | pci_irq_line = pdev->irq; | 313 | pci_irq_line = pdev->irq; |
| @@ -977,8 +976,8 @@ check_fhdr( u32 ioaddr, u32 *framelen, u32 *frameno, u32 *ack, | |||
| 977 | *ack = *framelen & FRAME_ACK_MASK; | 976 | *ack = *framelen & FRAME_ACK_MASK; |
| 978 | *is_first = (*framelen & FRAME_FIRST) != 0; | 977 | *is_first = (*framelen & FRAME_FIRST) != 0; |
| 979 | 978 | ||
| 980 | if( (*framelen &= FRAME_LEN_MASK) < 6 | 979 | if( (*framelen &= FRAME_LEN_MASK) < 6 || |
| 981 | || *framelen > SBNI_MAX_FRAME - 3 ) | 980 | *framelen > SBNI_MAX_FRAME - 3 ) |
| 982 | return 0; | 981 | return 0; |
| 983 | 982 | ||
| 984 | value = inb( ioaddr + DAT ); | 983 | value = inb( ioaddr + DAT ); |
| @@ -1173,10 +1172,10 @@ sbni_open( struct net_device *dev ) | |||
| 1173 | if( dev->base_addr < 0x400 ) { /* ISA only */ | 1172 | if( dev->base_addr < 0x400 ) { /* ISA only */ |
| 1174 | struct net_device **p = sbni_cards; | 1173 | struct net_device **p = sbni_cards; |
| 1175 | for( ; *p && p < sbni_cards + SBNI_MAX_NUM_CARDS; ++p ) | 1174 | for( ; *p && p < sbni_cards + SBNI_MAX_NUM_CARDS; ++p ) |
| 1176 | if( (*p)->irq == dev->irq | 1175 | if( (*p)->irq == dev->irq && |
| 1177 | && ((*p)->base_addr == dev->base_addr + 4 | 1176 | ((*p)->base_addr == dev->base_addr + 4 || |
| 1178 | || (*p)->base_addr == dev->base_addr - 4) | 1177 | (*p)->base_addr == dev->base_addr - 4) && |
| 1179 | && (*p)->flags & IFF_UP ) { | 1178 | (*p)->flags & IFF_UP ) { |
| 1180 | 1179 | ||
| 1181 | ((struct net_local *) (netdev_priv(*p))) | 1180 | ((struct net_local *) (netdev_priv(*p))) |
| 1182 | ->second = dev; | 1181 | ->second = dev; |
diff --git a/drivers/net/wan/sdla.c b/drivers/net/wan/sdla.c index 2b15a7e40d5b..31c41af2246d 100644 --- a/drivers/net/wan/sdla.c +++ b/drivers/net/wan/sdla.c | |||
| @@ -1457,7 +1457,7 @@ got_type: | |||
| 1457 | } | 1457 | } |
| 1458 | 1458 | ||
| 1459 | err = -EAGAIN; | 1459 | err = -EAGAIN; |
| 1460 | if (request_irq(dev->irq, &sdla_isr, 0, dev->name, dev)) | 1460 | if (request_irq(dev->irq, sdla_isr, 0, dev->name, dev)) |
| 1461 | goto fail; | 1461 | goto fail; |
| 1462 | 1462 | ||
| 1463 | if (flp->type == SDLA_S507) { | 1463 | if (flp->type == SDLA_S507) { |
diff --git a/drivers/net/wan/sealevel.c b/drivers/net/wan/sealevel.c index 0c525e24b247..e91457d6023e 100644 --- a/drivers/net/wan/sealevel.c +++ b/drivers/net/wan/sealevel.c | |||
| @@ -23,6 +23,7 @@ | |||
| 23 | #include <linux/hdlc.h> | 23 | #include <linux/hdlc.h> |
| 24 | #include <linux/ioport.h> | 24 | #include <linux/ioport.h> |
| 25 | #include <linux/init.h> | 25 | #include <linux/init.h> |
| 26 | #include <linux/slab.h> | ||
| 26 | #include <net/arp.h> | 27 | #include <net/arp.h> |
| 27 | 28 | ||
| 28 | #include <asm/irq.h> | 29 | #include <asm/irq.h> |
| @@ -84,8 +85,7 @@ static int sealevel_open(struct net_device *d) | |||
| 84 | * Link layer up. | 85 | * Link layer up. |
| 85 | */ | 86 | */ |
| 86 | 87 | ||
| 87 | switch (unit) | 88 | switch (unit) { |
| 88 | { | ||
| 89 | case 0: | 89 | case 0: |
| 90 | err = z8530_sync_dma_open(d, slvl->chan); | 90 | err = z8530_sync_dma_open(d, slvl->chan); |
| 91 | break; | 91 | break; |
| @@ -133,8 +133,7 @@ static int sealevel_close(struct net_device *d) | |||
| 133 | hdlc_close(d); | 133 | hdlc_close(d); |
| 134 | netif_stop_queue(d); | 134 | netif_stop_queue(d); |
| 135 | 135 | ||
| 136 | switch (unit) | 136 | switch (unit) { |
| 137 | { | ||
| 138 | case 0: | 137 | case 0: |
| 139 | z8530_sync_dma_close(d, slvl->chan); | 138 | z8530_sync_dma_close(d, slvl->chan); |
| 140 | break; | 139 | break; |
| @@ -266,7 +265,7 @@ static __init struct slvl_board *slvl_init(int iobase, int irq, | |||
| 266 | /* We want a fast IRQ for this device. Actually we'd like an even faster | 265 | /* We want a fast IRQ for this device. Actually we'd like an even faster |
| 267 | IRQ ;) - This is one driver RtLinux is made for */ | 266 | IRQ ;) - This is one driver RtLinux is made for */ |
| 268 | 267 | ||
| 269 | if (request_irq(irq, &z8530_interrupt, IRQF_DISABLED, | 268 | if (request_irq(irq, z8530_interrupt, IRQF_DISABLED, |
| 270 | "SeaLevel", dev) < 0) { | 269 | "SeaLevel", dev) < 0) { |
| 271 | printk(KERN_WARNING "sealevel: IRQ %d already in use.\n", irq); | 270 | printk(KERN_WARNING "sealevel: IRQ %d already in use.\n", irq); |
| 272 | goto err_request_irq; | 271 | goto err_request_irq; |
| @@ -342,8 +341,7 @@ static void __exit slvl_shutdown(struct slvl_board *b) | |||
| 342 | 341 | ||
| 343 | z8530_shutdown(&b->board); | 342 | z8530_shutdown(&b->board); |
| 344 | 343 | ||
| 345 | for (u = 0; u < 2; u++) | 344 | for (u = 0; u < 2; u++) { |
| 346 | { | ||
| 347 | struct net_device *d = b->dev[u].chan->netdevice; | 345 | struct net_device *d = b->dev[u].chan->netdevice; |
| 348 | unregister_hdlc_device(d); | 346 | unregister_hdlc_device(d); |
| 349 | free_netdev(d); | 347 | free_netdev(d); |
| @@ -391,7 +389,7 @@ static int __init slvl_init_module(void) | |||
| 391 | 389 | ||
| 392 | static void __exit slvl_cleanup_module(void) | 390 | static void __exit slvl_cleanup_module(void) |
| 393 | { | 391 | { |
| 394 | if(slvl_unit) | 392 | if (slvl_unit) |
| 395 | slvl_shutdown(slvl_unit); | 393 | slvl_shutdown(slvl_unit); |
| 396 | } | 394 | } |
| 397 | 395 | ||
diff --git a/drivers/net/wan/wanxl.c b/drivers/net/wan/wanxl.c index daee8a0624ee..541c700dceef 100644 --- a/drivers/net/wan/wanxl.c +++ b/drivers/net/wan/wanxl.c | |||
| @@ -814,7 +814,7 @@ static int __devinit wanxl_pci_init_one(struct pci_dev *pdev, | |||
| 814 | return 0; | 814 | return 0; |
| 815 | } | 815 | } |
| 816 | 816 | ||
| 817 | static struct pci_device_id wanxl_pci_tbl[] __devinitdata = { | 817 | static DEFINE_PCI_DEVICE_TABLE(wanxl_pci_tbl) = { |
| 818 | { PCI_VENDOR_ID_SBE, PCI_DEVICE_ID_SBE_WANXL100, PCI_ANY_ID, | 818 | { PCI_VENDOR_ID_SBE, PCI_DEVICE_ID_SBE_WANXL100, PCI_ANY_ID, |
| 819 | PCI_ANY_ID, 0, 0, 0 }, | 819 | PCI_ANY_ID, 0, 0, 0 }, |
| 820 | { PCI_VENDOR_ID_SBE, PCI_DEVICE_ID_SBE_WANXL200, PCI_ANY_ID, | 820 | { PCI_VENDOR_ID_SBE, PCI_DEVICE_ID_SBE_WANXL200, PCI_ANY_ID, |
diff --git a/drivers/net/wan/x25_asy.c b/drivers/net/wan/x25_asy.c index 27945049c9e1..80d5c5834a0b 100644 --- a/drivers/net/wan/x25_asy.c +++ b/drivers/net/wan/x25_asy.c | |||
| @@ -33,6 +33,8 @@ | |||
| 33 | #include <linux/lapb.h> | 33 | #include <linux/lapb.h> |
| 34 | #include <linux/init.h> | 34 | #include <linux/init.h> |
| 35 | #include <linux/rtnetlink.h> | 35 | #include <linux/rtnetlink.h> |
| 36 | #include <linux/compat.h> | ||
| 37 | #include <linux/slab.h> | ||
| 36 | #include "x25_asy.h" | 38 | #include "x25_asy.h" |
| 37 | 39 | ||
| 38 | #include <net/x25device.h> | 40 | #include <net/x25device.h> |
| @@ -656,8 +658,8 @@ static void x25_asy_unesc(struct x25_asy *sl, unsigned char s) | |||
| 656 | 658 | ||
| 657 | switch (s) { | 659 | switch (s) { |
| 658 | case X25_END: | 660 | case X25_END: |
| 659 | if (!test_and_clear_bit(SLF_ERROR, &sl->flags) | 661 | if (!test_and_clear_bit(SLF_ERROR, &sl->flags) && |
| 660 | && sl->rcount > 2) | 662 | sl->rcount > 2) |
| 661 | x25_asy_bump(sl); | 663 | x25_asy_bump(sl); |
| 662 | clear_bit(SLF_ESCAPE, &sl->flags); | 664 | clear_bit(SLF_ESCAPE, &sl->flags); |
| 663 | sl->rcount = 0; | 665 | sl->rcount = 0; |
| @@ -705,6 +707,21 @@ static int x25_asy_ioctl(struct tty_struct *tty, struct file *file, | |||
| 705 | } | 707 | } |
| 706 | } | 708 | } |
| 707 | 709 | ||
| 710 | #ifdef CONFIG_COMPAT | ||
| 711 | static long x25_asy_compat_ioctl(struct tty_struct *tty, struct file *file, | ||
| 712 | unsigned int cmd, unsigned long arg) | ||
| 713 | { | ||
| 714 | switch (cmd) { | ||
| 715 | case SIOCGIFNAME: | ||
| 716 | case SIOCSIFHWADDR: | ||
| 717 | return x25_asy_ioctl(tty, file, cmd, | ||
| 718 | (unsigned long)compat_ptr(arg)); | ||
| 719 | } | ||
| 720 | |||
| 721 | return -ENOIOCTLCMD; | ||
| 722 | } | ||
| 723 | #endif | ||
| 724 | |||
| 708 | static int x25_asy_open_dev(struct net_device *dev) | 725 | static int x25_asy_open_dev(struct net_device *dev) |
| 709 | { | 726 | { |
| 710 | struct x25_asy *sl = netdev_priv(dev); | 727 | struct x25_asy *sl = netdev_priv(dev); |
| @@ -754,6 +771,9 @@ static struct tty_ldisc_ops x25_ldisc = { | |||
| 754 | .open = x25_asy_open_tty, | 771 | .open = x25_asy_open_tty, |
| 755 | .close = x25_asy_close_tty, | 772 | .close = x25_asy_close_tty, |
| 756 | .ioctl = x25_asy_ioctl, | 773 | .ioctl = x25_asy_ioctl, |
| 774 | #ifdef CONFIG_COMPAT | ||
| 775 | .compat_ioctl = x25_asy_compat_ioctl, | ||
| 776 | #endif | ||
| 757 | .receive_buf = x25_asy_receive_buf, | 777 | .receive_buf = x25_asy_receive_buf, |
| 758 | .write_wakeup = x25_asy_write_wakeup, | 778 | .write_wakeup = x25_asy_write_wakeup, |
| 759 | }; | 779 | }; |
diff --git a/drivers/net/wan/z85230.c b/drivers/net/wan/z85230.c index 0be7ec7299db..fbf5e843d48c 100644 --- a/drivers/net/wan/z85230.c +++ b/drivers/net/wan/z85230.c | |||
| @@ -47,6 +47,7 @@ | |||
| 47 | #include <linux/hdlc.h> | 47 | #include <linux/hdlc.h> |
| 48 | #include <linux/ioport.h> | 48 | #include <linux/ioport.h> |
| 49 | #include <linux/init.h> | 49 | #include <linux/init.h> |
| 50 | #include <linux/gfp.h> | ||
| 50 | #include <asm/dma.h> | 51 | #include <asm/dma.h> |
| 51 | #include <asm/io.h> | 52 | #include <asm/io.h> |
| 52 | #define RT_LOCK | 53 | #define RT_LOCK |
