Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 41545
b: refs/heads/master
c: 7628b0a
h: refs/heads/master
i:
  41543: 7c6f8ba
v: v3
  • Loading branch information
Samuel Thibault authored and Jeff Garzik committed Dec 2, 2006
1 parent b28f88c commit d04a9d6
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 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: 88041b79f864dcd7f95e1d594eba683244dd968a
refs/heads/master: 7628b0a8c01a02966d2228bdf741ddedb128e8f8
9 changes: 8 additions & 1 deletion trunk/drivers/net/tulip/dmfe.c
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ struct rx_desc {
struct dmfe_board_info {
u32 chip_id; /* Chip vendor/Device ID */
u32 chip_revision; /* Chip revision */
struct DEVICE *next_dev; /* next device */
struct DEVICE *dev; /* net device */
struct pci_dev *pdev; /* PCI device */
spinlock_t lock;

Expand Down Expand Up @@ -399,6 +399,8 @@ static int __devinit dmfe_init_one (struct pci_dev *pdev,
/* Init system & device */
db = netdev_priv(dev);

db->dev = dev;

/* Allocate Tx/Rx descriptor memory */
db->desc_pool_ptr = pci_alloc_consistent(pdev, sizeof(struct tx_desc) * DESC_ALL_CNT + 0x20, &db->desc_pool_dma_ptr);
db->buf_pool_ptr = pci_alloc_consistent(pdev, TX_BUF_ALLOC * TX_DESC_CNT + 4, &db->buf_pool_dma_ptr);
Expand Down Expand Up @@ -426,6 +428,7 @@ static int __devinit dmfe_init_one (struct pci_dev *pdev,
dev->poll_controller = &poll_dmfe;
#endif
dev->ethtool_ops = &netdev_ethtool_ops;
netif_carrier_off(db->dev);
spin_lock_init(&db->lock);

pci_read_config_dword(pdev, 0x50, &pci_pmr);
Expand Down Expand Up @@ -1050,6 +1053,7 @@ static void netdev_get_drvinfo(struct net_device *dev,

static const struct ethtool_ops netdev_ethtool_ops = {
.get_drvinfo = netdev_get_drvinfo,
.get_link = ethtool_op_get_link,
};

/*
Expand Down Expand Up @@ -1144,6 +1148,7 @@ static void dmfe_timer(unsigned long data)
/* Link Failed */
DMFE_DBUG(0, "Link Failed", tmp_cr12);
db->link_failed = 1;
netif_carrier_off(db->dev);

/* For Force 10/100M Half/Full mode: Enable Auto-Nego mode */
/* AUTO or force 1M Homerun/Longrun don't need */
Expand All @@ -1166,6 +1171,8 @@ static void dmfe_timer(unsigned long data)
if ( (db->media_mode & DMFE_AUTO) &&
dmfe_sense_speed(db) )
db->link_failed = 1;
else
netif_carrier_on(db->dev);
dmfe_process_mode(db);
/* SHOW_MEDIA_TYPE(db->op_mode); */
}
Expand Down

0 comments on commit d04a9d6

Please sign in to comment.