aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/cs89x0.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/cs89x0.c')
-rw-r--r--drivers/net/cs89x0.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/net/cs89x0.c b/drivers/net/cs89x0.c
index 3eee666a9cd2..55445f980f9c 100644
--- a/drivers/net/cs89x0.c
+++ b/drivers/net/cs89x0.c
@@ -1524,6 +1524,7 @@ static void net_timeout(struct net_device *dev)
1524static int net_send_packet(struct sk_buff *skb, struct net_device *dev) 1524static int net_send_packet(struct sk_buff *skb, struct net_device *dev)
1525{ 1525{
1526 struct net_local *lp = netdev_priv(dev); 1526 struct net_local *lp = netdev_priv(dev);
1527 unsigned long flags;
1527 1528
1528 if (net_debug > 3) { 1529 if (net_debug > 3) {
1529 printk("%s: sent %d byte packet of type %x\n", 1530 printk("%s: sent %d byte packet of type %x\n",
@@ -1535,7 +1536,7 @@ static int net_send_packet(struct sk_buff *skb, struct net_device *dev)
1535 ask the chip to start transmitting before the 1536 ask the chip to start transmitting before the
1536 whole packet has been completely uploaded. */ 1537 whole packet has been completely uploaded. */
1537 1538
1538 spin_lock_irq(&lp->lock); 1539 spin_lock_irqsave(&lp->lock, flags);
1539 netif_stop_queue(dev); 1540 netif_stop_queue(dev);
1540 1541
1541 /* initiate a transmit sequence */ 1542 /* initiate a transmit sequence */
@@ -1549,13 +1550,13 @@ static int net_send_packet(struct sk_buff *skb, struct net_device *dev)
1549 * we're waiting for TxOk, so return 1 and requeue this packet. 1550 * we're waiting for TxOk, so return 1 and requeue this packet.
1550 */ 1551 */
1551 1552
1552 spin_unlock_irq(&lp->lock); 1553 spin_unlock_irqrestore(&lp->lock, flags);
1553 if (net_debug) printk("cs89x0: Tx buffer not free!\n"); 1554 if (net_debug) printk("cs89x0: Tx buffer not free!\n");
1554 return NETDEV_TX_BUSY; 1555 return NETDEV_TX_BUSY;
1555 } 1556 }
1556 /* Write the contents of the packet */ 1557 /* Write the contents of the packet */
1557 writewords(dev->base_addr, TX_FRAME_PORT,skb->data,(skb->len+1) >>1); 1558 writewords(dev->base_addr, TX_FRAME_PORT,skb->data,(skb->len+1) >>1);
1558 spin_unlock_irq(&lp->lock); 1559 spin_unlock_irqrestore(&lp->lock, flags);
1559 lp->stats.tx_bytes += skb->len; 1560 lp->stats.tx_bytes += skb->len;
1560 dev->trans_start = jiffies; 1561 dev->trans_start = jiffies;
1561 dev_kfree_skb (skb); 1562 dev_kfree_skb (skb);
/* * linux/fs/nfsd/nfs4recover.c * * Copyright (c) 2004 The Regents of the University of Michigan. * All rights reserved. * * Andy Adamson <andros@citi.umich.edu> * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. Neither the name of the University nor the names of its * contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * */ #include <linux/err.h> #include <linux/sunrpc/svc.h> #include <linux/nfsd/nfsd.h> #include <linux/nfs4.h> #include <linux/nfsd/state.h> #include <linux/nfsd/xdr4.h> #include <linux/param.h> #include <linux/file.h> #include <linux/namei.h> #include <asm/uaccess.h> #include <linux/scatterlist.h> #include <linux/crypto.h> #include <linux/sched.h> #include <linux/mount.h> #define NFSDDBG_FACILITY NFSDDBG_PROC /* Globals */ static struct nameidata rec_dir; static int rec_dir_init = 0; static void nfs4_save_user(uid_t *saveuid, gid_t *savegid) { *saveuid = current->fsuid; *savegid = current->fsgid; current->fsuid = 0; current->fsgid = 0; } static void nfs4_reset_user(uid_t saveuid, gid_t savegid) { current->fsuid = saveuid; current->fsgid = savegid; } static void md5_to_hex(char *out, char *md5) { int i; for (i=0; i<16; i++) { unsigned char c = md5[i]; *out++ = '0' + ((c&0xf0)>>4) + (c>=0xa0)*('a'-'9'-1); *out++ = '0' + (c&0x0f) + ((c&0x0f)>=0x0a)*('a'-'9'-1); } *out = '\0'; } __be32 nfs4_make_rec_clidname(char *dname, struct xdr_netobj *clname) { struct xdr_netobj cksum; struct hash_desc desc; struct scatterlist sg; __be32 status = nfserr_resource; dprintk("NFSD: nfs4_make_rec_clidname for %.*s\n", clname->len, clname->data); desc.flags = CRYPTO_TFM_REQ_MAY_SLEEP; desc.tfm = crypto_alloc_hash("md5", 0, CRYPTO_ALG_ASYNC); if (IS_ERR(desc.tfm)) goto out_no_tfm; cksum.len = crypto_hash_digestsize(desc.tfm); cksum.data = kmalloc(cksum.len, GFP_KERNEL); if (cksum.data == NULL) goto out; sg_init_one(&sg, clname->data, clname->len); if (crypto_hash_digest(&desc, &sg, sg.length, cksum.data)) goto out; md5_to_hex(dname, cksum.data); kfree(cksum.data); status = nfs_ok; out: crypto_free_hash(desc.tfm); out_no_tfm: return status; } static void nfsd4_sync_rec_dir(void) { mutex_lock(&rec_dir.path.dentry->d_inode->i_mutex); nfsd_sync_dir(rec_dir.path.dentry); mutex_unlock(&rec_dir.path.dentry->d_inode->i_mutex); } int nfsd4_create_clid_dir(struct nfs4_client *clp) { char *dname = clp->cl_recdir; struct dentry *dentry; uid_t uid; gid_t gid; int status; dprintk("NFSD: nfsd4_create_clid_dir for \"%s\"\n", dname); if (!rec_dir_init || clp->cl_firststate) return 0; nfs4_save_user(&uid, &gid); /* lock the parent */ mutex_lock(&rec_dir.path.dentry->d_inode->i_mutex); dentry = lookup_one_len(dname, rec_dir.path.dentry, HEXDIR_LEN-1); if (IS_ERR(dentry)) { status = PTR_ERR(dentry); goto out_unlock; } status = -EEXIST; if (dentry->d_inode) { dprintk("NFSD: nfsd4_create_clid_dir: DIRECTORY EXISTS\n"); goto out_put; } status = mnt_want_write(rec_dir.path.mnt); if (status) goto out_put; status = vfs_mkdir(rec_dir.path.dentry->d_inode, dentry, S_IRWXU); mnt_drop_write(rec_dir.path.mnt); out_put: dput(dentry); out_unlock: mutex_unlock(&rec_dir.path.dentry->d_inode->i_mutex); if (status == 0) { clp->cl_firststate = 1; nfsd4_sync_rec_dir(); } nfs4_reset_user(uid, gid); dprintk("NFSD: nfsd4_create_clid_dir returns %d\n", status); return status; } typedef int (recdir_func)(struct dentry *, struct dentry *); struct dentry_list { struct dentry *dentry; struct list_head list; };