Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 300547
b: refs/heads/master
c: 2d5fb62
h: refs/heads/master
i:
  300545: 004100b
  300543: 2e7f62b
v: v3
  • Loading branch information
Francois Romieu committed Apr 7, 2012
1 parent 47b2a30 commit 1c2c4bb
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 35 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: ea8f2ed0f1b943e499e760feced4038f95b2b71f
refs/heads/master: 2d5fb6283cb921a1f66454f8a603aaa973cbc24b
40 changes: 6 additions & 34 deletions trunk/drivers/net/ethernet/adaptec/starfire.c
Original file line number Diff line number Diff line change
Expand Up @@ -114,15 +114,6 @@ static int rx_copybreak /* = 0 */;
#define DMA_BURST_SIZE 128
#endif

/* Used to pass the media type, etc.
Both 'options[]' and 'full_duplex[]' exist for driver interoperability.
The media type is usually passed in 'options[]'.
These variables are deprecated, use ethtool instead. -Ion
*/
#define MAX_UNITS 8 /* More are supported, limit only on options */
static int options[MAX_UNITS] = {0, };
static int full_duplex[MAX_UNITS] = {0, };

/* Operational parameters that are set at compile time. */

/* The "native" ring sizes are either 256 or 2048.
Expand Down Expand Up @@ -192,17 +183,13 @@ module_param(debug, int, 0);
module_param(rx_copybreak, int, 0);
module_param(intr_latency, int, 0);
module_param(small_frames, int, 0);
module_param_array(options, int, NULL, 0);
module_param_array(full_duplex, int, NULL, 0);
module_param(enable_hw_cksum, int, 0);
MODULE_PARM_DESC(max_interrupt_work, "Maximum events handled per interrupt");
MODULE_PARM_DESC(mtu, "MTU (all boards)");
MODULE_PARM_DESC(debug, "Debug level (0-6)");
MODULE_PARM_DESC(rx_copybreak, "Copy breakpoint for copy-only-tiny-frames");
MODULE_PARM_DESC(intr_latency, "Maximum interrupt latency, in microseconds");
MODULE_PARM_DESC(small_frames, "Maximum size of receive frames that bypass interrupt latency (0,64,128,256,512)");
MODULE_PARM_DESC(options, "Deprecated: Bits 0-3: media type, bit 17: full duplex");
MODULE_PARM_DESC(full_duplex, "Deprecated: Forced full-duplex setting (0/1)");
MODULE_PARM_DESC(enable_hw_cksum, "Enable/disable hardware cksum support (0/1)");

/*
Expand Down Expand Up @@ -657,10 +644,10 @@ static const struct net_device_ops netdev_ops = {
static int __devinit starfire_init_one(struct pci_dev *pdev,
const struct pci_device_id *ent)
{
struct device *d = &pdev->dev;
struct netdev_private *np;
int i, irq, option, chip_idx = ent->driver_data;
int i, irq, chip_idx = ent->driver_data;
struct net_device *dev;
static int card_idx = -1;
long ioaddr;
void __iomem *base;
int drv_flags, io_size;
Expand All @@ -673,15 +660,13 @@ static int __devinit starfire_init_one(struct pci_dev *pdev,
printk(version);
#endif

card_idx++;

if (pci_enable_device (pdev))
return -EIO;

ioaddr = pci_resource_start(pdev, 0);
io_size = pci_resource_len(pdev, 0);
if (!ioaddr || ((pci_resource_flags(pdev, 0) & IORESOURCE_MEM) == 0)) {
printk(KERN_ERR DRV_NAME " %d: no PCI MEM resources, aborting\n", card_idx);
dev_err(d, "no PCI MEM resources, aborting\n");
return -ENODEV;
}

Expand All @@ -694,14 +679,14 @@ static int __devinit starfire_init_one(struct pci_dev *pdev,
irq = pdev->irq;

if (pci_request_regions (pdev, DRV_NAME)) {
printk(KERN_ERR DRV_NAME " %d: cannot reserve PCI resources, aborting\n", card_idx);
dev_err(d, "cannot reserve PCI resources, aborting\n");
goto err_out_free_netdev;
}

base = ioremap(ioaddr, io_size);
if (!base) {
printk(KERN_ERR DRV_NAME " %d: cannot remap %#x @ %#lx, aborting\n",
card_idx, io_size, ioaddr);
dev_err(d, "cannot remap %#x @ %#lx, aborting\n",
io_size, ioaddr);
goto err_out_free_res;
}

Expand Down Expand Up @@ -769,19 +754,6 @@ static int __devinit starfire_init_one(struct pci_dev *pdev,

drv_flags = netdrv_tbl[chip_idx].drv_flags;

option = card_idx < MAX_UNITS ? options[card_idx] : 0;

/* The lower four bits are the media type. */
if (option & 0x200)
np->mii_if.full_duplex = 1;

if (card_idx < MAX_UNITS && full_duplex[card_idx] > 0)
np->mii_if.full_duplex = 1;

if (np->mii_if.full_duplex)
np->mii_if.force_media = 1;
else
np->mii_if.force_media = 0;
np->speed100 = 1;

/* timer resolution is 128 * 0.8us */
Expand Down

0 comments on commit 1c2c4bb

Please sign in to comment.