diff options
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/atm/zatm.c | 4 | ||||
-rw-r--r-- | drivers/block/cryptoloop.c | 6 | ||||
-rw-r--r-- | drivers/md/dm-crypt.c | 7 | ||||
-rw-r--r-- | drivers/net/sungem.c | 1 | ||||
-rw-r--r-- | drivers/net/sungem.h | 2 | ||||
-rw-r--r-- | drivers/net/tg3.c | 28 | ||||
-rw-r--r-- | drivers/net/tun.c | 15 | ||||
-rw-r--r-- | drivers/net/wireless/airo.c | 5 |
8 files changed, 44 insertions, 24 deletions
diff --git a/drivers/atm/zatm.c b/drivers/atm/zatm.c index c4b75ecf9460..55959e4d1cb7 100644 --- a/drivers/atm/zatm.c +++ b/drivers/atm/zatm.c | |||
@@ -417,9 +417,9 @@ printk("dummy: 0x%08lx, 0x%08lx\n",dummy[0],dummy[1]); | |||
417 | chan = (here[3] & uPD98401_AAL5_CHAN) >> | 417 | chan = (here[3] & uPD98401_AAL5_CHAN) >> |
418 | uPD98401_AAL5_CHAN_SHIFT; | 418 | uPD98401_AAL5_CHAN_SHIFT; |
419 | if (chan < zatm_dev->chans && zatm_dev->rx_map[chan]) { | 419 | if (chan < zatm_dev->chans && zatm_dev->rx_map[chan]) { |
420 | int pos = ZATM_VCC(vcc)->pool; | 420 | int pos; |
421 | |||
422 | vcc = zatm_dev->rx_map[chan]; | 421 | vcc = zatm_dev->rx_map[chan]; |
422 | pos = ZATM_VCC(vcc)->pool; | ||
423 | if (skb == zatm_dev->last_free[pos]) | 423 | if (skb == zatm_dev->last_free[pos]) |
424 | zatm_dev->last_free[pos] = NULL; | 424 | zatm_dev->last_free[pos] = NULL; |
425 | skb_unlink(skb, zatm_dev->pool + pos); | 425 | skb_unlink(skb, zatm_dev->pool + pos); |
diff --git a/drivers/block/cryptoloop.c b/drivers/block/cryptoloop.c index 5be6f998d8c5..3d4261c39f16 100644 --- a/drivers/block/cryptoloop.c +++ b/drivers/block/cryptoloop.c | |||
@@ -57,9 +57,11 @@ cryptoloop_init(struct loop_device *lo, const struct loop_info64 *info) | |||
57 | mode = strsep(&cmsp, "-"); | 57 | mode = strsep(&cmsp, "-"); |
58 | 58 | ||
59 | if (mode == NULL || strcmp(mode, "cbc") == 0) | 59 | if (mode == NULL || strcmp(mode, "cbc") == 0) |
60 | tfm = crypto_alloc_tfm(cipher, CRYPTO_TFM_MODE_CBC); | 60 | tfm = crypto_alloc_tfm(cipher, CRYPTO_TFM_MODE_CBC | |
61 | CRYPTO_TFM_REQ_MAY_SLEEP); | ||
61 | else if (strcmp(mode, "ecb") == 0) | 62 | else if (strcmp(mode, "ecb") == 0) |
62 | tfm = crypto_alloc_tfm(cipher, CRYPTO_TFM_MODE_ECB); | 63 | tfm = crypto_alloc_tfm(cipher, CRYPTO_TFM_MODE_ECB | |
64 | CRYPTO_TFM_REQ_MAY_SLEEP); | ||
63 | if (tfm == NULL) | 65 | if (tfm == NULL) |
64 | return -EINVAL; | 66 | return -EINVAL; |
65 | 67 | ||
diff --git a/drivers/md/dm-crypt.c b/drivers/md/dm-crypt.c index d0a4bab220e5..b82bc3150476 100644 --- a/drivers/md/dm-crypt.c +++ b/drivers/md/dm-crypt.c | |||
@@ -144,7 +144,7 @@ static int crypt_iv_essiv_ctr(struct crypt_config *cc, struct dm_target *ti, | |||
144 | } | 144 | } |
145 | 145 | ||
146 | /* Hash the cipher key with the given hash algorithm */ | 146 | /* Hash the cipher key with the given hash algorithm */ |
147 | hash_tfm = crypto_alloc_tfm(opts, 0); | 147 | hash_tfm = crypto_alloc_tfm(opts, CRYPTO_TFM_REQ_MAY_SLEEP); |
148 | if (hash_tfm == NULL) { | 148 | if (hash_tfm == NULL) { |
149 | ti->error = PFX "Error initializing ESSIV hash"; | 149 | ti->error = PFX "Error initializing ESSIV hash"; |
150 | return -EINVAL; | 150 | return -EINVAL; |
@@ -172,7 +172,8 @@ static int crypt_iv_essiv_ctr(struct crypt_config *cc, struct dm_target *ti, | |||
172 | 172 | ||
173 | /* Setup the essiv_tfm with the given salt */ | 173 | /* Setup the essiv_tfm with the given salt */ |
174 | essiv_tfm = crypto_alloc_tfm(crypto_tfm_alg_name(cc->tfm), | 174 | essiv_tfm = crypto_alloc_tfm(crypto_tfm_alg_name(cc->tfm), |
175 | CRYPTO_TFM_MODE_ECB); | 175 | CRYPTO_TFM_MODE_ECB | |
176 | CRYPTO_TFM_REQ_MAY_SLEEP); | ||
176 | if (essiv_tfm == NULL) { | 177 | if (essiv_tfm == NULL) { |
177 | ti->error = PFX "Error allocating crypto tfm for ESSIV"; | 178 | ti->error = PFX "Error allocating crypto tfm for ESSIV"; |
178 | kfree(salt); | 179 | kfree(salt); |
@@ -587,7 +588,7 @@ static int crypt_ctr(struct dm_target *ti, unsigned int argc, char **argv) | |||
587 | goto bad1; | 588 | goto bad1; |
588 | } | 589 | } |
589 | 590 | ||
590 | tfm = crypto_alloc_tfm(cipher, crypto_flags); | 591 | tfm = crypto_alloc_tfm(cipher, crypto_flags | CRYPTO_TFM_REQ_MAY_SLEEP); |
591 | if (!tfm) { | 592 | if (!tfm) { |
592 | ti->error = PFX "Error allocating crypto tfm"; | 593 | ti->error = PFX "Error allocating crypto tfm"; |
593 | goto bad1; | 594 | goto bad1; |
diff --git a/drivers/net/sungem.c b/drivers/net/sungem.c index 2608e7a3d214..3f67a42e8503 100644 --- a/drivers/net/sungem.c +++ b/drivers/net/sungem.c | |||
@@ -948,6 +948,7 @@ static irqreturn_t gem_interrupt(int irq, void *dev_id, struct pt_regs *regs) | |||
948 | u32 gem_status = readl(gp->regs + GREG_STAT); | 948 | u32 gem_status = readl(gp->regs + GREG_STAT); |
949 | 949 | ||
950 | if (gem_status == 0) { | 950 | if (gem_status == 0) { |
951 | netif_poll_enable(dev); | ||
951 | spin_unlock_irqrestore(&gp->lock, flags); | 952 | spin_unlock_irqrestore(&gp->lock, flags); |
952 | return IRQ_NONE; | 953 | return IRQ_NONE; |
953 | } | 954 | } |
diff --git a/drivers/net/sungem.h b/drivers/net/sungem.h index 7143fd7cf3f8..ff8ae5f79970 100644 --- a/drivers/net/sungem.h +++ b/drivers/net/sungem.h | |||
@@ -1020,7 +1020,7 @@ struct gem { | |||
1020 | 1020 | ||
1021 | struct gem_init_block *init_block; | 1021 | struct gem_init_block *init_block; |
1022 | struct sk_buff *rx_skbs[RX_RING_SIZE]; | 1022 | struct sk_buff *rx_skbs[RX_RING_SIZE]; |
1023 | struct sk_buff *tx_skbs[RX_RING_SIZE]; | 1023 | struct sk_buff *tx_skbs[TX_RING_SIZE]; |
1024 | dma_addr_t gblock_dvma; | 1024 | dma_addr_t gblock_dvma; |
1025 | 1025 | ||
1026 | struct pci_dev *pdev; | 1026 | struct pci_dev *pdev; |
diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c index af8263a1580e..3faf62310f84 100644 --- a/drivers/net/tg3.c +++ b/drivers/net/tg3.c | |||
@@ -66,8 +66,8 @@ | |||
66 | 66 | ||
67 | #define DRV_MODULE_NAME "tg3" | 67 | #define DRV_MODULE_NAME "tg3" |
68 | #define PFX DRV_MODULE_NAME ": " | 68 | #define PFX DRV_MODULE_NAME ": " |
69 | #define DRV_MODULE_VERSION "3.37" | 69 | #define DRV_MODULE_VERSION "3.38" |
70 | #define DRV_MODULE_RELDATE "August 25, 2005" | 70 | #define DRV_MODULE_RELDATE "September 1, 2005" |
71 | 71 | ||
72 | #define TG3_DEF_MAC_MODE 0 | 72 | #define TG3_DEF_MAC_MODE 0 |
73 | #define TG3_DEF_RX_MODE 0 | 73 | #define TG3_DEF_RX_MODE 0 |
@@ -121,12 +121,9 @@ | |||
121 | TG3_RX_RCB_RING_SIZE(tp)) | 121 | TG3_RX_RCB_RING_SIZE(tp)) |
122 | #define TG3_TX_RING_BYTES (sizeof(struct tg3_tx_buffer_desc) * \ | 122 | #define TG3_TX_RING_BYTES (sizeof(struct tg3_tx_buffer_desc) * \ |
123 | TG3_TX_RING_SIZE) | 123 | TG3_TX_RING_SIZE) |
124 | #define TX_RING_GAP(TP) \ | ||
125 | (TG3_TX_RING_SIZE - (TP)->tx_pending) | ||
126 | #define TX_BUFFS_AVAIL(TP) \ | 124 | #define TX_BUFFS_AVAIL(TP) \ |
127 | (((TP)->tx_cons <= (TP)->tx_prod) ? \ | 125 | ((TP)->tx_pending - \ |
128 | (TP)->tx_cons + (TP)->tx_pending - (TP)->tx_prod : \ | 126 | (((TP)->tx_prod - (TP)->tx_cons) & (TG3_TX_RING_SIZE - 1))) |
129 | (TP)->tx_cons - (TP)->tx_prod - TX_RING_GAP(TP)) | ||
130 | #define NEXT_TX(N) (((N) + 1) & (TG3_TX_RING_SIZE - 1)) | 127 | #define NEXT_TX(N) (((N) + 1) & (TG3_TX_RING_SIZE - 1)) |
131 | 128 | ||
132 | #define RX_PKT_BUF_SZ (1536 + tp->rx_offset + 64) | 129 | #define RX_PKT_BUF_SZ (1536 + tp->rx_offset + 64) |
@@ -2880,9 +2877,13 @@ static void tg3_tx(struct tg3 *tp) | |||
2880 | 2877 | ||
2881 | tp->tx_cons = sw_idx; | 2878 | tp->tx_cons = sw_idx; |
2882 | 2879 | ||
2883 | if (netif_queue_stopped(tp->dev) && | 2880 | if (unlikely(netif_queue_stopped(tp->dev))) { |
2884 | (TX_BUFFS_AVAIL(tp) > TG3_TX_WAKEUP_THRESH)) | 2881 | spin_lock(&tp->tx_lock); |
2885 | netif_wake_queue(tp->dev); | 2882 | if (netif_queue_stopped(tp->dev) && |
2883 | (TX_BUFFS_AVAIL(tp) > TG3_TX_WAKEUP_THRESH)) | ||
2884 | netif_wake_queue(tp->dev); | ||
2885 | spin_unlock(&tp->tx_lock); | ||
2886 | } | ||
2886 | } | 2887 | } |
2887 | 2888 | ||
2888 | /* Returns size of skb allocated or < 0 on error. | 2889 | /* Returns size of skb allocated or < 0 on error. |
@@ -3198,9 +3199,7 @@ static int tg3_poll(struct net_device *netdev, int *budget) | |||
3198 | 3199 | ||
3199 | /* run TX completion thread */ | 3200 | /* run TX completion thread */ |
3200 | if (sblk->idx[0].tx_consumer != tp->tx_cons) { | 3201 | if (sblk->idx[0].tx_consumer != tp->tx_cons) { |
3201 | spin_lock(&tp->tx_lock); | ||
3202 | tg3_tx(tp); | 3202 | tg3_tx(tp); |
3203 | spin_unlock(&tp->tx_lock); | ||
3204 | } | 3203 | } |
3205 | 3204 | ||
3206 | /* run RX thread, within the bounds set by NAPI. | 3205 | /* run RX thread, within the bounds set by NAPI. |
@@ -3716,8 +3715,11 @@ static int tg3_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
3716 | tw32_tx_mbox((MAILBOX_SNDHOST_PROD_IDX_0 + TG3_64BIT_REG_LOW), entry); | 3715 | tw32_tx_mbox((MAILBOX_SNDHOST_PROD_IDX_0 + TG3_64BIT_REG_LOW), entry); |
3717 | 3716 | ||
3718 | tp->tx_prod = entry; | 3717 | tp->tx_prod = entry; |
3719 | if (TX_BUFFS_AVAIL(tp) <= (MAX_SKB_FRAGS + 1)) | 3718 | if (TX_BUFFS_AVAIL(tp) <= (MAX_SKB_FRAGS + 1)) { |
3720 | netif_stop_queue(dev); | 3719 | netif_stop_queue(dev); |
3720 | if (TX_BUFFS_AVAIL(tp) > TG3_TX_WAKEUP_THRESH) | ||
3721 | netif_wake_queue(tp->dev); | ||
3722 | } | ||
3721 | 3723 | ||
3722 | out_unlock: | 3724 | out_unlock: |
3723 | mmiowb(); | 3725 | mmiowb(); |
diff --git a/drivers/net/tun.c b/drivers/net/tun.c index effab0b9adca..50b8c6754b1e 100644 --- a/drivers/net/tun.c +++ b/drivers/net/tun.c | |||
@@ -18,6 +18,9 @@ | |||
18 | /* | 18 | /* |
19 | * Changes: | 19 | * Changes: |
20 | * | 20 | * |
21 | * Mike Kershaw <dragorn@kismetwireless.net> 2005/08/14 | ||
22 | * Add TUNSETLINK ioctl to set the link encapsulation | ||
23 | * | ||
21 | * Mark Smith <markzzzsmith@yahoo.com.au> | 24 | * Mark Smith <markzzzsmith@yahoo.com.au> |
22 | * Use random_ether_addr() for tap MAC address. | 25 | * Use random_ether_addr() for tap MAC address. |
23 | * | 26 | * |
@@ -612,6 +615,18 @@ static int tun_chr_ioctl(struct inode *inode, struct file *file, | |||
612 | DBG(KERN_INFO "%s: owner set to %d\n", tun->dev->name, tun->owner); | 615 | DBG(KERN_INFO "%s: owner set to %d\n", tun->dev->name, tun->owner); |
613 | break; | 616 | break; |
614 | 617 | ||
618 | case TUNSETLINK: | ||
619 | /* Only allow setting the type when the interface is down */ | ||
620 | if (tun->dev->flags & IFF_UP) { | ||
621 | DBG(KERN_INFO "%s: Linktype set failed because interface is up\n", | ||
622 | tun->dev->name); | ||
623 | return -EBUSY; | ||
624 | } else { | ||
625 | tun->dev->type = (int) arg; | ||
626 | DBG(KERN_INFO "%s: linktype set to %d\n", tun->dev->name, tun->dev->type); | ||
627 | } | ||
628 | break; | ||
629 | |||
615 | #ifdef TUN_DEBUG | 630 | #ifdef TUN_DEBUG |
616 | case TUNSETDEBUG: | 631 | case TUNSETDEBUG: |
617 | tun->debug = arg; | 632 | tun->debug = arg; |
diff --git a/drivers/net/wireless/airo.c b/drivers/net/wireless/airo.c index abac1e40154b..dbcb5a8a2194 100644 --- a/drivers/net/wireless/airo.c +++ b/drivers/net/wireless/airo.c | |||
@@ -1308,7 +1308,7 @@ static int micsetup(struct airo_info *ai) { | |||
1308 | int i; | 1308 | int i; |
1309 | 1309 | ||
1310 | if (ai->tfm == NULL) | 1310 | if (ai->tfm == NULL) |
1311 | ai->tfm = crypto_alloc_tfm("aes", 0); | 1311 | ai->tfm = crypto_alloc_tfm("aes", CRYPTO_TFM_REQ_MAY_SLEEP); |
1312 | 1312 | ||
1313 | if (ai->tfm == NULL) { | 1313 | if (ai->tfm == NULL) { |
1314 | printk(KERN_ERR "airo: failed to load transform for AES\n"); | 1314 | printk(KERN_ERR "airo: failed to load transform for AES\n"); |
@@ -2410,8 +2410,7 @@ void stop_airo_card( struct net_device *dev, int freeres ) | |||
2410 | } | 2410 | } |
2411 | } | 2411 | } |
2412 | #ifdef MICSUPPORT | 2412 | #ifdef MICSUPPORT |
2413 | if (ai->tfm) | 2413 | crypto_free_tfm(ai->tfm); |
2414 | crypto_free_tfm(ai->tfm); | ||
2415 | #endif | 2414 | #endif |
2416 | del_airo_dev( dev ); | 2415 | del_airo_dev( dev ); |
2417 | free_netdev( dev ); | 2416 | free_netdev( dev ); |