From: Samuel Thibault <samuel.thibault@ens-lyon.org>
To: tori@unhappy.mine.nu, jgarzik@pobox.com
Cc: linux-kernel@vger.kernel.org, akpm@osdl.org, sebastien.hinderer@loria.fr
Subject: Tulip dmfe carrier detection
Date: Fri, 10 Nov 2006 15:49:19 +0100 [thread overview]
Message-ID: <20061110144919.GI3411@implementation.labri.fr> (raw)
[-- Attachment #1: Type: text/plain, Size: 239 bytes --]
Hi,
The dmfe module lacks netif stuff for carrier detection, while the board
does report carrier status. Here is a patch.
Note: there are probably a lot more ethtool stuff that could be added,
but carrier sense is really a must.
Samuel
[-- Attachment #2: patch --]
[-- Type: text/plain, Size: 1618 bytes --]
--- drivers/net/tulip/dmfe-orig.c 2006-10-01 16:09:49.000000000 +0200
+++ drivers/net/tulip/dmfe.c 2006-11-10 15:20:55.000000000 +0100
@@ -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;
@@ -399,6 +399,8 @@ static int __devinit dmfe_init_one (stru
/* 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);
@@ -1050,6 +1052,7 @@ static void netdev_get_drvinfo(struct ne
static struct ethtool_ops netdev_ethtool_ops = {
.get_drvinfo = netdev_get_drvinfo,
+ .get_link = ethtool_op_get_link,
};
/*
@@ -1144,6 +1147,7 @@ static void dmfe_timer(unsigned long dat
/* 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 */
@@ -1166,6 +1170,8 @@ static void dmfe_timer(unsigned long dat
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); */
}
next reply other threads:[~2006-11-10 14:49 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-11-10 14:49 Samuel Thibault [this message]
2006-11-25 22:21 ` Tulip dmfe carrier detection Samuel Thibault
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20061110144919.GI3411@implementation.labri.fr \
--to=samuel.thibault@ens-lyon.org \
--cc=akpm@osdl.org \
--cc=jgarzik@pobox.com \
--cc=linux-kernel@vger.kernel.org \
--cc=sebastien.hinderer@loria.fr \
--cc=tori@unhappy.mine.nu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox