Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 78950
b: refs/heads/master
c: 092427b
h: refs/heads/master
v: v3
  • Loading branch information
Jeff Garzik authored and David S. Miller committed Jan 28, 2008
1 parent 06e9787 commit 0018468
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 18 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 4790654c71b250018ecc234f6b9f1ed96a55572d
refs/heads/master: 092427be8cef341c957a93ec2469890501a09bff
31 changes: 14 additions & 17 deletions trunk/drivers/net/r6040.c
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,12 @@
#include <linux/ethtool.h>
#include <linux/crc32.h>
#include <linux/spinlock.h>
#include <linux/bitops.h>
#include <linux/io.h>
#include <linux/irq.h>
#include <linux/uaccess.h>

#include <asm/processor.h>
#include <asm/bitops.h>
#include <asm/io.h>
#include <asm/irq.h>
#include <asm/uaccess.h>

#define DRV_NAME "r6040"
#define DRV_VERSION "0.16"
Expand Down Expand Up @@ -181,7 +181,7 @@ static char version[] __devinitdata = KERN_INFO DRV_NAME
": RDC R6040 NAPI net driver,"
"version "DRV_VERSION " (" DRV_RELDATE ")\n";

static int phy_table[] = { PHY1_ADDR, PHY2_ADDR};
static int phy_table[] = { PHY1_ADDR, PHY2_ADDR };

/* Read a word data from PHY Chip */
static int phy_read(void __iomem *ioaddr, int phy_addr, int reg)
Expand Down Expand Up @@ -771,24 +771,17 @@ r6040_start_xmit(struct sk_buff *skb, struct net_device *dev)
struct r6040_descriptor *descptr;
void __iomem *ioaddr = lp->base;
unsigned long flags;
int ret;

if (!skb) /* NULL skb directly return */
return ret;

if (skb->len >= MAX_BUF_SIZE) { /* Packet too long, drop it */
dev_kfree_skb(skb);
return ret;
}
int ret = NETDEV_TX_OK;

/* Critical Section */
spin_lock_irqsave(&lp->lock, flags);

/* TX resource check */
if (!lp->tx_free_desc) {
spin_unlock_irqrestore(&lp->lock, flags);
netif_stop_queue(dev);
printk(KERN_ERR DRV_NAME ": no tx descriptor\n");
ret = 1;
ret = NETDEV_TX_BUSY;
return ret;
}

Expand Down Expand Up @@ -916,7 +909,7 @@ static int netdev_get_settings(struct net_device *dev, struct ethtool_cmd *cmd)

spin_lock_irq(&rp->lock);
rc = mii_ethtool_gset(&rp->mii_if, cmd);
spin_unlock_irq(&rp->mii_if);
spin_unlock_irq(&rp->lock);

return rc;
}
Expand Down Expand Up @@ -973,6 +966,11 @@ static int __devinit r6040_init_one(struct pci_dev *pdev,
"not supported by the card\n");
return -ENODEV;
}
if (pci_set_consistent_dma_mask(pdev, DMA_32BIT_MASK)) {
printk(KERN_ERR DRV_NAME "32-bit PCI DMA addresses"
"not supported by the card\n");
return -ENODEV;
}

/* IO Size check */
if (pci_resource_len(pdev, 0) < io_size) {
Expand Down Expand Up @@ -1006,7 +1004,6 @@ static int __devinit r6040_init_one(struct pci_dev *pdev,
}

/* Init system & device */
dev->base_addr = (unsigned long)ioaddr;
lp->base = ioaddr;
dev->irq = pdev->irq;

Expand Down
3 changes: 3 additions & 0 deletions trunk/include/linux/pci_ids.h
Original file line number Diff line number Diff line change
Expand Up @@ -2110,6 +2110,9 @@
#define PCI_DEVICE_ID_HERC_WIN 0x5732
#define PCI_DEVICE_ID_HERC_UNI 0x5832

#define PCI_VENDOR_ID_RDC 0x17f3
#define PCI_DEVICE_ID_RDC_R6040 0x6040

#define PCI_VENDOR_ID_SITECOM 0x182d
#define PCI_DEVICE_ID_SITECOM_DC105V2 0x3069

Expand Down

0 comments on commit 0018468

Please sign in to comment.