Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
linux
Commits
7628b0a8
Commit
7628b0a8
authored
Nov 30, 2006
by
Samuel Thibault
Committed by
Jeff Garzik
Dec 02, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
drivers/net/tulip/dmfe: support basic carrier detection
Signed-off-by:
Jeff Garzik
<
jeff@garzik.org
>
parent
88041b79
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
1 deletion
+8
-1
drivers/net/tulip/dmfe.c
drivers/net/tulip/dmfe.c
+8
-1
No files found.
drivers/net/tulip/dmfe.c
View file @
7628b0a8
...
@@ -187,7 +187,7 @@ struct rx_desc {
...
@@ -187,7 +187,7 @@ struct rx_desc {
struct
dmfe_board_info
{
struct
dmfe_board_info
{
u32
chip_id
;
/* Chip vendor/Device ID */
u32
chip_id
;
/* Chip vendor/Device ID */
u32
chip_revision
;
/* Chip revision */
u32
chip_revision
;
/* Chip revision */
struct
DEVICE
*
next_dev
;
/* nex
t device */
struct
DEVICE
*
dev
;
/* ne
t device */
struct
pci_dev
*
pdev
;
/* PCI device */
struct
pci_dev
*
pdev
;
/* PCI device */
spinlock_t
lock
;
spinlock_t
lock
;
...
@@ -399,6 +399,8 @@ static int __devinit dmfe_init_one (struct pci_dev *pdev,
...
@@ -399,6 +399,8 @@ static int __devinit dmfe_init_one (struct pci_dev *pdev,
/* Init system & device */
/* Init system & device */
db
=
netdev_priv
(
dev
);
db
=
netdev_priv
(
dev
);
db
->
dev
=
dev
;
/* Allocate Tx/Rx descriptor memory */
/* 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
->
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
);
db
->
buf_pool_ptr
=
pci_alloc_consistent
(
pdev
,
TX_BUF_ALLOC
*
TX_DESC_CNT
+
4
,
&
db
->
buf_pool_dma_ptr
);
...
@@ -426,6 +428,7 @@ static int __devinit dmfe_init_one (struct pci_dev *pdev,
...
@@ -426,6 +428,7 @@ static int __devinit dmfe_init_one (struct pci_dev *pdev,
dev
->
poll_controller
=
&
poll_dmfe
;
dev
->
poll_controller
=
&
poll_dmfe
;
#endif
#endif
dev
->
ethtool_ops
=
&
netdev_ethtool_ops
;
dev
->
ethtool_ops
=
&
netdev_ethtool_ops
;
netif_carrier_off
(
db
->
dev
);
spin_lock_init
(
&
db
->
lock
);
spin_lock_init
(
&
db
->
lock
);
pci_read_config_dword
(
pdev
,
0x50
,
&
pci_pmr
);
pci_read_config_dword
(
pdev
,
0x50
,
&
pci_pmr
);
...
@@ -1050,6 +1053,7 @@ static void netdev_get_drvinfo(struct net_device *dev,
...
@@ -1050,6 +1053,7 @@ static void netdev_get_drvinfo(struct net_device *dev,
static
const
struct
ethtool_ops
netdev_ethtool_ops
=
{
static
const
struct
ethtool_ops
netdev_ethtool_ops
=
{
.
get_drvinfo
=
netdev_get_drvinfo
,
.
get_drvinfo
=
netdev_get_drvinfo
,
.
get_link
=
ethtool_op_get_link
,
};
};
/*
/*
...
@@ -1144,6 +1148,7 @@ static void dmfe_timer(unsigned long data)
...
@@ -1144,6 +1148,7 @@ static void dmfe_timer(unsigned long data)
/* Link Failed */
/* Link Failed */
DMFE_DBUG
(
0
,
"Link Failed"
,
tmp_cr12
);
DMFE_DBUG
(
0
,
"Link Failed"
,
tmp_cr12
);
db
->
link_failed
=
1
;
db
->
link_failed
=
1
;
netif_carrier_off
(
db
->
dev
);
/* For Force 10/100M Half/Full mode: Enable Auto-Nego mode */
/* For Force 10/100M Half/Full mode: Enable Auto-Nego mode */
/* AUTO or force 1M Homerun/Longrun don't need */
/* AUTO or force 1M Homerun/Longrun don't need */
...
@@ -1166,6 +1171,8 @@ static void dmfe_timer(unsigned long data)
...
@@ -1166,6 +1171,8 @@ static void dmfe_timer(unsigned long data)
if
(
(
db
->
media_mode
&
DMFE_AUTO
)
&&
if
(
(
db
->
media_mode
&
DMFE_AUTO
)
&&
dmfe_sense_speed
(
db
)
)
dmfe_sense_speed
(
db
)
)
db
->
link_failed
=
1
;
db
->
link_failed
=
1
;
else
netif_carrier_on
(
db
->
dev
);
dmfe_process_mode
(
db
);
dmfe_process_mode
(
db
);
/* SHOW_MEDIA_TYPE(db->op_mode); */
/* SHOW_MEDIA_TYPE(db->op_mode); */
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment