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
0ba34de2
Commit
0ba34de2
authored
Mar 01, 2005
by
Jeff Garzik
Browse files
Options
Browse Files
Download
Plain Diff
Merge pobox.com:/garz/repo/linux-2.6
into pobox.com:/garz/repo/net-drivers-2.6
parents
1274fcd6
eb6840cf
Changes
15
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
355 additions
and
117 deletions
+355
-117
drivers/net/e1000/e1000.h
drivers/net/e1000/e1000.h
+3
-0
drivers/net/e1000/e1000_ethtool.c
drivers/net/e1000/e1000_ethtool.c
+6
-5
drivers/net/e1000/e1000_hw.c
drivers/net/e1000/e1000_hw.c
+46
-42
drivers/net/e1000/e1000_hw.h
drivers/net/e1000/e1000_hw.h
+9
-2
drivers/net/e1000/e1000_main.c
drivers/net/e1000/e1000_main.c
+224
-25
drivers/net/ixgb/ixgb.h
drivers/net/ixgb/ixgb.h
+2
-1
drivers/net/ixgb/ixgb_ee.c
drivers/net/ixgb/ixgb_ee.c
+11
-5
drivers/net/ixgb/ixgb_ee.h
drivers/net/ixgb/ixgb_ee.h
+2
-1
drivers/net/ixgb/ixgb_ethtool.c
drivers/net/ixgb/ixgb_ethtool.c
+4
-1
drivers/net/ixgb/ixgb_hw.c
drivers/net/ixgb/ixgb_hw.c
+1
-1
drivers/net/ixgb/ixgb_hw.h
drivers/net/ixgb/ixgb_hw.h
+1
-1
drivers/net/ixgb/ixgb_ids.h
drivers/net/ixgb/ixgb_ids.h
+1
-1
drivers/net/ixgb/ixgb_main.c
drivers/net/ixgb/ixgb_main.c
+43
-30
drivers/net/ixgb/ixgb_osdep.h
drivers/net/ixgb/ixgb_osdep.h
+1
-1
drivers/net/ixgb/ixgb_param.c
drivers/net/ixgb/ixgb_param.c
+1
-1
No files found.
drivers/net/e1000/e1000.h
View file @
0ba34de2
...
@@ -138,6 +138,7 @@ struct e1000_adapter;
...
@@ -138,6 +138,7 @@ struct e1000_adapter;
#define E1000_RX_BUFFER_WRITE 16
/* Must be power of 2 */
#define E1000_RX_BUFFER_WRITE 16
/* Must be power of 2 */
#define AUTO_ALL_MODES 0
#define AUTO_ALL_MODES 0
#define E1000_EEPROM_82544_APM 0x0004
#define E1000_EEPROM_APME 0x0400
#define E1000_EEPROM_APME 0x0400
#ifndef E1000_MASTER_SLAVE
#ifndef E1000_MASTER_SLAVE
...
@@ -209,6 +210,7 @@ struct e1000_adapter {
...
@@ -209,6 +210,7 @@ struct e1000_adapter {
/* TX */
/* TX */
struct
e1000_desc_ring
tx_ring
;
struct
e1000_desc_ring
tx_ring
;
struct
e1000_buffer
previous_buffer_info
;
spinlock_t
tx_lock
;
spinlock_t
tx_lock
;
uint32_t
txd_cmd
;
uint32_t
txd_cmd
;
uint32_t
tx_int_delay
;
uint32_t
tx_int_delay
;
...
@@ -222,6 +224,7 @@ struct e1000_adapter {
...
@@ -222,6 +224,7 @@ struct e1000_adapter {
uint32_t
tx_fifo_size
;
uint32_t
tx_fifo_size
;
atomic_t
tx_fifo_stall
;
atomic_t
tx_fifo_stall
;
boolean_t
pcix_82544
;
boolean_t
pcix_82544
;
boolean_t
detect_tx_hung
;
/* RX */
/* RX */
struct
e1000_desc_ring
rx_ring
;
struct
e1000_desc_ring
rx_ring
;
...
...
drivers/net/e1000/e1000_ethtool.c
View file @
0ba34de2
...
@@ -1310,7 +1310,7 @@ e1000_run_loopback_test(struct e1000_adapter *adapter)
...
@@ -1310,7 +1310,7 @@ e1000_run_loopback_test(struct e1000_adapter *adapter)
struct
e1000_desc_ring
*
txdr
=
&
adapter
->
test_tx_ring
;
struct
e1000_desc_ring
*
txdr
=
&
adapter
->
test_tx_ring
;
struct
e1000_desc_ring
*
rxdr
=
&
adapter
->
test_rx_ring
;
struct
e1000_desc_ring
*
rxdr
=
&
adapter
->
test_rx_ring
;
struct
pci_dev
*
pdev
=
adapter
->
pdev
;
struct
pci_dev
*
pdev
=
adapter
->
pdev
;
int
i
;
int
i
,
ret_val
;
E1000_WRITE_REG
(
&
adapter
->
hw
,
RDT
,
rxdr
->
count
-
1
);
E1000_WRITE_REG
(
&
adapter
->
hw
,
RDT
,
rxdr
->
count
-
1
);
...
@@ -1330,11 +1330,12 @@ e1000_run_loopback_test(struct e1000_adapter *adapter)
...
@@ -1330,11 +1330,12 @@ e1000_run_loopback_test(struct e1000_adapter *adapter)
rxdr
->
buffer_info
[
i
].
length
,
rxdr
->
buffer_info
[
i
].
length
,
PCI_DMA_FROMDEVICE
);
PCI_DMA_FROMDEVICE
);
if
(
!
e1000_check_lbtest_frame
(
rxdr
->
buffer_info
[
i
++
].
skb
,
1024
))
ret_val
=
e1000_check_lbtest_frame
(
rxdr
->
buffer_info
[
i
].
skb
,
return
0
;
1024
);
}
while
(
i
<
64
);
i
++
;
}
while
(
ret_val
!=
0
&&
i
<
64
);
return
13
;
return
ret_val
;
}
}
static
int
static
int
...
...
drivers/net/e1000/e1000_hw.c
View file @
0ba34de2
...
@@ -1572,7 +1572,8 @@ e1000_phy_force_speed_duplex(struct e1000_hw *hw)
...
@@ -1572,7 +1572,8 @@ e1000_phy_force_speed_duplex(struct e1000_hw *hw)
if
(
mii_status_reg
&
MII_SR_LINK_STATUS
)
break
;
if
(
mii_status_reg
&
MII_SR_LINK_STATUS
)
break
;
msec_delay
(
100
);
msec_delay
(
100
);
}
}
if
((
i
==
0
)
&&
(
hw
->
phy_type
==
e1000_phy_m88
))
{
if
((
i
==
0
)
&&
(
hw
->
phy_type
==
e1000_phy_m88
))
{
/* We didn't get link. Reset the DSP and wait again for link. */
/* We didn't get link. Reset the DSP and wait again for link. */
ret_val
=
e1000_phy_reset_dsp
(
hw
);
ret_val
=
e1000_phy_reset_dsp
(
hw
);
if
(
ret_val
)
{
if
(
ret_val
)
{
...
@@ -2503,7 +2504,7 @@ e1000_read_phy_reg(struct e1000_hw *hw,
...
@@ -2503,7 +2504,7 @@ e1000_read_phy_reg(struct e1000_hw *hw,
}
}
}
}
ret_val
=
e1000_read_phy_reg_ex
(
hw
,
IGP01E1000_PHY_PAGE_SELECT
&
reg_addr
,
ret_val
=
e1000_read_phy_reg_ex
(
hw
,
MAX_PHY_REG_ADDRESS
&
reg_addr
,
phy_data
);
phy_data
);
return
ret_val
;
return
ret_val
;
...
@@ -2609,7 +2610,7 @@ e1000_write_phy_reg(struct e1000_hw *hw,
...
@@ -2609,7 +2610,7 @@ e1000_write_phy_reg(struct e1000_hw *hw,
}
}
}
}
ret_val
=
e1000_write_phy_reg_ex
(
hw
,
IGP01E1000_PHY_PAGE_SELECT
&
reg_addr
,
ret_val
=
e1000_write_phy_reg_ex
(
hw
,
MAX_PHY_REG_ADDRESS
&
reg_addr
,
phy_data
);
phy_data
);
return
ret_val
;
return
ret_val
;
...
@@ -2955,8 +2956,7 @@ e1000_phy_m88_get_info(struct e1000_hw *hw,
...
@@ -2955,8 +2956,7 @@ e1000_phy_m88_get_info(struct e1000_hw *hw,
/* Check polarity status */
/* Check polarity status */
ret_val
=
e1000_check_polarity
(
hw
,
&
polarity
);
ret_val
=
e1000_check_polarity
(
hw
,
&
polarity
);
if
(
ret_val
)
if
(
ret_val
)
return
ret_val
;
return
ret_val
;
phy_info
->
cable_polarity
=
polarity
;
phy_info
->
cable_polarity
=
polarity
;
ret_val
=
e1000_read_phy_reg
(
hw
,
M88E1000_PHY_SPEC_STATUS
,
&
phy_data
);
ret_val
=
e1000_read_phy_reg
(
hw
,
M88E1000_PHY_SPEC_STATUS
,
&
phy_data
);
...
@@ -2966,9 +2966,9 @@ e1000_phy_m88_get_info(struct e1000_hw *hw,
...
@@ -2966,9 +2966,9 @@ e1000_phy_m88_get_info(struct e1000_hw *hw,
phy_info
->
mdix_mode
=
(
phy_data
&
M88E1000_PSSR_MDIX
)
>>
phy_info
->
mdix_mode
=
(
phy_data
&
M88E1000_PSSR_MDIX
)
>>
M88E1000_PSSR_MDIX_SHIFT
;
M88E1000_PSSR_MDIX_SHIFT
;
if
(
phy_data
&
M88E1000_PSSR_1000MBS
)
{
if
((
phy_data
&
M88E1000_PSSR_SPEED
)
==
M88E1000_PSSR_1000MBS
)
{
/* Cable Length Estimation and Local/Remote Receiver Informat
o
ion
/* Cable Length Estimation and Local/Remote Receiver Information
* are only valid at 1000 Mbps
* are only valid at 1000 Mbps
.
*/
*/
phy_info
->
cable_length
=
((
phy_data
&
M88E1000_PSSR_CABLE_LENGTH
)
>>
phy_info
->
cable_length
=
((
phy_data
&
M88E1000_PSSR_CABLE_LENGTH
)
>>
M88E1000_PSSR_CABLE_LENGTH_SHIFT
);
M88E1000_PSSR_CABLE_LENGTH_SHIFT
);
...
@@ -4639,41 +4639,44 @@ e1000_get_bus_info(struct e1000_hw *hw)
...
@@ -4639,41 +4639,44 @@ e1000_get_bus_info(struct e1000_hw *hw)
{
{
uint32_t
status
;
uint32_t
status
;
if
(
hw
->
mac_type
<
e1000_82543
)
{
switch
(
hw
->
mac_type
)
{
case
e1000_82542_rev2_0
:
case
e1000_82542_rev2_1
:
hw
->
bus_type
=
e1000_bus_type_unknown
;
hw
->
bus_type
=
e1000_bus_type_unknown
;
hw
->
bus_speed
=
e1000_bus_speed_unknown
;
hw
->
bus_speed
=
e1000_bus_speed_unknown
;
hw
->
bus_width
=
e1000_bus_width_unknown
;
hw
->
bus_width
=
e1000_bus_width_unknown
;
return
;
break
;
}
default:
status
=
E1000_READ_REG
(
hw
,
STATUS
);
status
=
E1000_READ_REG
(
hw
,
STATUS
);
hw
->
bus_type
=
(
status
&
E1000_STATUS_PCIX_MODE
)
?
hw
->
bus_type
=
(
status
&
E1000_STATUS_PCIX_MODE
)
?
e1000_bus_type_pcix
:
e1000_bus_type_pci
;
e1000_bus_type_pcix
:
e1000_bus_type_pci
;
if
(
hw
->
device_id
==
E1000_DEV_ID_82546EB_QUAD_COPPER
)
{
if
(
hw
->
device_id
==
E1000_DEV_ID_82546EB_QUAD_COPPER
)
{
hw
->
bus_speed
=
(
hw
->
bus_type
==
e1000_bus_type_pci
)
?
hw
->
bus_speed
=
(
hw
->
bus_type
==
e1000_bus_type_pci
)
?
e1000_bus_speed_66
:
e1000_bus_speed_120
;
e1000_bus_speed_66
:
e1000_bus_speed_120
;
}
else
if
(
hw
->
bus_type
==
e1000_bus_type_pci
)
{
}
else
if
(
hw
->
bus_type
==
e1000_bus_type_pci
)
{
hw
->
bus_speed
=
(
status
&
E1000_STATUS_PCI66
)
?
hw
->
bus_speed
=
(
status
&
E1000_STATUS_PCI66
)
?
e1000_bus_speed_66
:
e1000_bus_speed_33
;
e1000_bus_speed_66
:
e1000_bus_speed_33
;
}
else
{
}
else
{
switch
(
status
&
E1000_STATUS_PCIX_SPEED
)
{
switch
(
status
&
E1000_STATUS_PCIX_SPEED
)
{
case
E1000_STATUS_PCIX_SPEED_66
:
case
E1000_STATUS_PCIX_SPEED_66
:
hw
->
bus_speed
=
e1000_bus_speed_66
;
hw
->
bus_speed
=
e1000_bus_speed_66
;
break
;
break
;
case
E1000_STATUS_PCIX_SPEED_100
:
case
E1000_STATUS_PCIX_SPEED_100
:
hw
->
bus_speed
=
e1000_bus_speed_100
;
hw
->
bus_speed
=
e1000_bus_speed_100
;
break
;
break
;
case
E1000_STATUS_PCIX_SPEED_133
:
case
E1000_STATUS_PCIX_SPEED_133
:
hw
->
bus_speed
=
e1000_bus_speed_133
;
hw
->
bus_speed
=
e1000_bus_speed_133
;
break
;
break
;
default:
default:
hw
->
bus_speed
=
e1000_bus_speed_reserved
;
hw
->
bus_speed
=
e1000_bus_speed_reserved
;
break
;
break
;
}
}
}
hw
->
bus_width
=
(
status
&
E1000_STATUS_BUS64
)
?
e1000_bus_width_64
:
e1000_bus_width_32
;
break
;
}
}
hw
->
bus_width
=
(
status
&
E1000_STATUS_BUS64
)
?
e1000_bus_width_64
:
e1000_bus_width_32
;
}
}
/******************************************************************************
/******************************************************************************
* Reads a value from one of the devices registers using port I/O (as opposed
* Reads a value from one of the devices registers using port I/O (as opposed
...
@@ -4738,6 +4741,7 @@ e1000_get_cable_length(struct e1000_hw *hw,
...
@@ -4738,6 +4741,7 @@ e1000_get_cable_length(struct e1000_hw *hw,
uint16_t
agc_value
=
0
;
uint16_t
agc_value
=
0
;
uint16_t
cur_agc
,
min_agc
=
IGP01E1000_AGC_LENGTH_TABLE_SIZE
;
uint16_t
cur_agc
,
min_agc
=
IGP01E1000_AGC_LENGTH_TABLE_SIZE
;
uint16_t
i
,
phy_data
;
uint16_t
i
,
phy_data
;
uint16_t
cable_length
;
DEBUGFUNC
(
"e1000_get_cable_length"
);
DEBUGFUNC
(
"e1000_get_cable_length"
);
...
@@ -4749,10 +4753,11 @@ e1000_get_cable_length(struct e1000_hw *hw,
...
@@ -4749,10 +4753,11 @@ e1000_get_cable_length(struct e1000_hw *hw,
&
phy_data
);
&
phy_data
);
if
(
ret_val
)
if
(
ret_val
)
return
ret_val
;
return
ret_val
;
cable_length
=
(
phy_data
&
M88E1000_PSSR_CABLE_LENGTH
)
>>
M88E1000_PSSR_CABLE_LENGTH_SHIFT
;
/* Convert the enum value to ranged values */
/* Convert the enum value to ranged values */
switch
((
phy_data
&
M88E1000_PSSR_CABLE_LENGTH
)
>>
switch
(
cable_length
)
{
M88E1000_PSSR_CABLE_LENGTH_SHIFT
)
{
case
e1000_cable_length_50
:
case
e1000_cable_length_50
:
*
min_length
=
0
;
*
min_length
=
0
;
*
max_length
=
e1000_igp_cable_length_50
;
*
max_length
=
e1000_igp_cable_length_50
;
...
@@ -4919,8 +4924,7 @@ e1000_check_downshift(struct e1000_hw *hw)
...
@@ -4919,8 +4924,7 @@ e1000_check_downshift(struct e1000_hw *hw)
return
ret_val
;
return
ret_val
;
hw
->
speed_downgraded
=
(
phy_data
&
IGP01E1000_PLHR_SS_DOWNGRADE
)
?
1
:
0
;
hw
->
speed_downgraded
=
(
phy_data
&
IGP01E1000_PLHR_SS_DOWNGRADE
)
?
1
:
0
;
}
}
else
if
(
hw
->
phy_type
==
e1000_phy_m88
)
{
else
if
(
hw
->
phy_type
==
e1000_phy_m88
)
{
ret_val
=
e1000_read_phy_reg
(
hw
,
M88E1000_PHY_SPEC_STATUS
,
ret_val
=
e1000_read_phy_reg
(
hw
,
M88E1000_PHY_SPEC_STATUS
,
&
phy_data
);
&
phy_data
);
if
(
ret_val
)
if
(
ret_val
)
...
...
drivers/net/e1000/e1000_hw.h
View file @
0ba34de2
...
@@ -369,6 +369,7 @@ int32_t e1000_set_d3_lplu_state(struct e1000_hw *hw, boolean_t active);
...
@@ -369,6 +369,7 @@ int32_t e1000_set_d3_lplu_state(struct e1000_hw *hw, boolean_t active);
#define E1000_DEV_ID_82546GB_SERDES 0x107B
#define E1000_DEV_ID_82546GB_SERDES 0x107B
#define E1000_DEV_ID_82546GB_PCIE 0x108A
#define E1000_DEV_ID_82546GB_PCIE 0x108A
#define E1000_DEV_ID_82547EI 0x1019
#define E1000_DEV_ID_82547EI 0x1019
#define NODE_ADDRESS_SIZE 6
#define NODE_ADDRESS_SIZE 6
#define ETH_LENGTH_OF_ADDRESS 6
#define ETH_LENGTH_OF_ADDRESS 6
...
@@ -1734,6 +1735,9 @@ struct e1000_hw {
...
@@ -1734,6 +1735,9 @@ struct e1000_hw {
#define PHY_1000T_STATUS 0x0A
/* 1000Base-T Status Reg */
#define PHY_1000T_STATUS 0x0A
/* 1000Base-T Status Reg */
#define PHY_EXT_STATUS 0x0F
/* Extended Status Reg */
#define PHY_EXT_STATUS 0x0F
/* Extended Status Reg */
#define MAX_PHY_REG_ADDRESS 0x1F
/* 5 bit address bus (0-0x1F) */
#define MAX_PHY_MULTI_PAGE_REG 0xF
/* Registers equal on all pages */
/* M88E1000 Specific Registers */
/* M88E1000 Specific Registers */
#define M88E1000_PHY_SPEC_CTRL 0x10
/* PHY Specific Control Register */
#define M88E1000_PHY_SPEC_CTRL 0x10
/* PHY Specific Control Register */
#define M88E1000_PHY_SPEC_STATUS 0x11
/* PHY Specific Status Register */
#define M88E1000_PHY_SPEC_STATUS 0x11
/* PHY Specific Status Register */
...
@@ -1794,8 +1798,7 @@ struct e1000_hw {
...
@@ -1794,8 +1798,7 @@ struct e1000_hw {
#define IGP01E1000_ANALOG_REGS_PAGE 0x20C0
#define IGP01E1000_ANALOG_REGS_PAGE 0x20C0
#define MAX_PHY_REG_ADDRESS 0x1F
/* 5 bit address bus (0-0x1F) */
#define MAX_PHY_MULTI_PAGE_REG 0xF
/*Registers that are equal on all pages*/
/* PHY Control Register */
/* PHY Control Register */
#define MII_CR_SPEED_SELECT_MSB 0x0040
/* bits 6,13: 10=1000, 01=100, 00=10 */
#define MII_CR_SPEED_SELECT_MSB 0x0040
/* bits 6,13: 10=1000, 01=100, 00=10 */
#define MII_CR_COLL_TEST_ENABLE 0x0080
/* Collision test enable */
#define MII_CR_COLL_TEST_ENABLE 0x0080
/* Collision test enable */
...
@@ -2098,7 +2101,11 @@ struct e1000_hw {
...
@@ -2098,7 +2101,11 @@ struct e1000_hw {
#define IGP01E1000_ANALOG_FUSE_FINE_1 0x0080
#define IGP01E1000_ANALOG_FUSE_FINE_1 0x0080
#define IGP01E1000_ANALOG_FUSE_FINE_10 0x0500
#define IGP01E1000_ANALOG_FUSE_FINE_10 0x0500
/* Bit definitions for valid PHY IDs. */
/* Bit definitions for valid PHY IDs. */
/* I = Integrated
* E = External
*/
#define M88E1000_E_PHY_ID 0x01410C50
#define M88E1000_E_PHY_ID 0x01410C50
#define M88E1000_I_PHY_ID 0x01410C30
#define M88E1000_I_PHY_ID 0x01410C30
#define M88E1011_I_PHY_ID 0x01410C20
#define M88E1011_I_PHY_ID 0x01410C20
...
...
drivers/net/e1000/e1000_main.c
View file @
0ba34de2
This diff is collapsed.
Click to expand it.
drivers/net/ixgb/ixgb.h
View file @
0ba34de2
/*******************************************************************************
/*******************************************************************************
Copyright(c) 1999 - 200
4
Intel Corporation. All rights reserved.
Copyright(c) 1999 - 200
5
Intel Corporation. All rights reserved.
This program is free software; you can redistribute it and/or modify it
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the Free
under the terms of the GNU General Public License as published by the Free
...
@@ -176,6 +176,7 @@ struct ixgb_adapter {
...
@@ -176,6 +176,7 @@ struct ixgb_adapter {
uint64_t
hw_csum_tx_error
;
uint64_t
hw_csum_tx_error
;
uint32_t
tx_int_delay
;
uint32_t
tx_int_delay
;
boolean_t
tx_int_delay_enable
;
boolean_t
tx_int_delay_enable
;
boolean_t
detect_tx_hung
;
/* RX */
/* RX */
struct
ixgb_desc_ring
rx_ring
;
struct
ixgb_desc_ring
rx_ring
;
...
...
drivers/net/ixgb/ixgb_ee.c
View file @
0ba34de2
/*******************************************************************************
/*******************************************************************************
Copyright(c) 1999 - 200
4
Intel Corporation. All rights reserved.
Copyright(c) 1999 - 200
5
Intel Corporation. All rights reserved.
This program is free software; you can redistribute it and/or modify it
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the Free
under the terms of the GNU General Public License as published by the Free
...
@@ -372,11 +372,11 @@ ixgb_update_eeprom_checksum(struct ixgb_hw *hw)
...
@@ -372,11 +372,11 @@ ixgb_update_eeprom_checksum(struct ixgb_hw *hw)
*
*
*****************************************************************************/
*****************************************************************************/
void
void
ixgb_write_eeprom
(
struct
ixgb_hw
*
hw
,
ixgb_write_eeprom
(
struct
ixgb_hw
*
hw
,
uint16_t
offset
,
uint16_t
data
)
uint16_t
offset
,
uint16_t
data
)
{
{
/* Prepare the EEPROM for writing */
struct
ixgb_ee_map_type
*
ee_map
=
(
struct
ixgb_ee_map_type
*
)
hw
->
eeprom
;
/* Prepare the EEPROM for writing */
ixgb_setup_eeprom
(
hw
);
ixgb_setup_eeprom
(
hw
);
/* Send the 9-bit EWEN (write enable) command to the EEPROM (5-bit opcode
/* Send the 9-bit EWEN (write enable) command to the EEPROM (5-bit opcode
...
@@ -410,6 +410,9 @@ ixgb_write_eeprom(struct ixgb_hw *hw,
...
@@ -410,6 +410,9 @@ ixgb_write_eeprom(struct ixgb_hw *hw,
/* Done with writing */
/* Done with writing */
ixgb_cleanup_eeprom
(
hw
);
ixgb_cleanup_eeprom
(
hw
);
/* clear the init_ctrl_reg_1 to signify that the cache is invalidated */
ee_map
->
init_ctrl_reg_1
=
EEPROM_ICW1_SIGNATURE_CLEAR
;
return
;
return
;
}
}
...
@@ -478,6 +481,9 @@ ixgb_get_eeprom_data(struct ixgb_hw *hw)
...
@@ -478,6 +481,9 @@ ixgb_get_eeprom_data(struct ixgb_hw *hw)
if
(
checksum
!=
(
uint16_t
)
EEPROM_SUM
)
{
if
(
checksum
!=
(
uint16_t
)
EEPROM_SUM
)
{
DEBUGOUT
(
"ixgb_ee: Checksum invalid.
\n
"
);
DEBUGOUT
(
"ixgb_ee: Checksum invalid.
\n
"
);
/* clear the init_ctrl_reg_1 to signify that the cache is
* invalidated */
ee_map
->
init_ctrl_reg_1
=
EEPROM_ICW1_SIGNATURE_CLEAR
;
return
(
FALSE
);
return
(
FALSE
);
}
}
...
...
drivers/net/ixgb/ixgb_ee.h
View file @
0ba34de2
/*******************************************************************************
/*******************************************************************************
Copyright(c) 1999 - 200
4
Intel Corporation. All rights reserved.
Copyright(c) 1999 - 200
5
Intel Corporation. All rights reserved.
This program is free software; you can redistribute it and/or modify it
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the Free
under the terms of the GNU General Public License as published by the Free
...
@@ -63,6 +63,7 @@
...
@@ -63,6 +63,7 @@
#define EEPROM_ICW1_SIGNATURE_MASK 0xC000
#define EEPROM_ICW1_SIGNATURE_MASK 0xC000
#define EEPROM_ICW1_SIGNATURE_VALID 0x4000
#define EEPROM_ICW1_SIGNATURE_VALID 0x4000
#define EEPROM_ICW1_SIGNATURE_CLEAR 0x0000
/* For checksumming, the sum of all words in the EEPROM should equal 0xBABA. */
/* For checksumming, the sum of all words in the EEPROM should equal 0xBABA. */
#define EEPROM_SUM 0xBABA
#define EEPROM_SUM 0xBABA
...
...
drivers/net/ixgb/ixgb_ethtool.c
View file @
0ba34de2
/*******************************************************************************
/*******************************************************************************
Copyright(c) 1999 - 200
4
Intel Corporation. All rights reserved.
Copyright(c) 1999 - 200
5
Intel Corporation. All rights reserved.
This program is free software; you can redistribute it and/or modify it
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the Free
under the terms of the GNU General Public License as published by the Free
...
@@ -63,6 +63,7 @@ static struct ixgb_stats ixgb_gstrings_stats[] = {
...
@@ -63,6 +63,7 @@ static struct ixgb_stats ixgb_gstrings_stats[] = {
{
"tx_dropped"
,
IXGB_STAT
(
net_stats
.
tx_dropped
)},
{
"tx_dropped"
,
IXGB_STAT
(
net_stats
.
tx_dropped
)},
{
"multicast"
,
IXGB_STAT
(
net_stats
.
multicast
)},
{
"multicast"
,
IXGB_STAT
(
net_stats
.
multicast
)},
{
"collisions"
,
IXGB_STAT
(
net_stats
.
collisions
)},
{
"collisions"
,
IXGB_STAT
(
net_stats
.
collisions
)},
/* { "rx_length_errors", IXGB_STAT(net_stats.rx_length_errors) }, */
/* { "rx_length_errors", IXGB_STAT(net_stats.rx_length_errors) }, */
{
"rx_over_errors"
,
IXGB_STAT
(
net_stats
.
rx_over_errors
)},
{
"rx_over_errors"
,
IXGB_STAT
(
net_stats
.
rx_over_errors
)},
{
"rx_crc_errors"
,
IXGB_STAT
(
net_stats
.
rx_crc_errors
)},
{
"rx_crc_errors"
,
IXGB_STAT
(
net_stats
.
rx_crc_errors
)},
...
@@ -98,6 +99,7 @@ static int
...
@@ -98,6 +99,7 @@ static int
ixgb_get_settings
(
struct
net_device
*
netdev
,
struct
ethtool_cmd
*
ecmd
)
ixgb_get_settings
(
struct
net_device
*
netdev
,
struct
ethtool_cmd
*
ecmd
)
{
{
struct
ixgb_adapter
*
adapter
=
netdev
->
priv
;
struct
ixgb_adapter
*
adapter
=
netdev
->
priv
;
ecmd
->
supported
=
(
SUPPORTED_10000baseT_Full
|
SUPPORTED_FIBRE
);
ecmd
->
supported
=
(
SUPPORTED_10000baseT_Full
|
SUPPORTED_FIBRE
);
ecmd
->
advertising
=
(
SUPPORTED_10000baseT_Full
|
SUPPORTED_FIBRE
);
ecmd
->
advertising
=
(
SUPPORTED_10000baseT_Full
|
SUPPORTED_FIBRE
);
ecmd
->
port
=
PORT_FIBRE
;
ecmd
->
port
=
PORT_FIBRE
;
...
@@ -119,6 +121,7 @@ static int
...
@@ -119,6 +121,7 @@ static int
ixgb_set_settings
(
struct
net_device
*
netdev
,
struct
ethtool_cmd
*
ecmd
)
ixgb_set_settings
(
struct
net_device
*
netdev
,
struct
ethtool_cmd
*
ecmd
)
{
{
struct
ixgb_adapter
*
adapter
=
netdev
->
priv
;
struct
ixgb_adapter
*
adapter
=
netdev
->
priv
;
if
(
ecmd
->
autoneg
==
AUTONEG_ENABLE
||
if
(
ecmd
->
autoneg
==
AUTONEG_ENABLE
||
ecmd
->
speed
+
ecmd
->
duplex
!=
SPEED_10000
+
DUPLEX_FULL
)
ecmd
->
speed
+
ecmd
->
duplex
!=
SPEED_10000
+
DUPLEX_FULL
)
return
-
EINVAL
;
return
-
EINVAL
;
...
...
drivers/net/ixgb/ixgb_hw.c
View file @
0ba34de2
/*******************************************************************************
/*******************************************************************************
Copyright(c) 1999 - 200
4
Intel Corporation. All rights reserved.
Copyright(c) 1999 - 200
5
Intel Corporation. All rights reserved.
This program is free software; you can redistribute it and/or modify it
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the Free
under the terms of the GNU General Public License as published by the Free
...
...
drivers/net/ixgb/ixgb_hw.h
View file @
0ba34de2
/*******************************************************************************
/*******************************************************************************
Copyright(c) 1999 - 200
4
Intel Corporation. All rights reserved.
Copyright(c) 1999 - 200
5
Intel Corporation. All rights reserved.
This program is free software; you can redistribute it and/or modify it
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the Free
under the terms of the GNU General Public License as published by the Free
...
...
drivers/net/ixgb/ixgb_ids.h
View file @
0ba34de2
/*******************************************************************************
/*******************************************************************************
Copyright(c) 1999 - 200
4
Intel Corporation. All rights reserved.
Copyright(c) 1999 - 200
5
Intel Corporation. All rights reserved.
This program is free software; you can redistribute it and/or modify it
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the Free
under the terms of the GNU General Public License as published by the Free
...
...
drivers/net/ixgb/ixgb_main.c
View file @
0ba34de2
/*******************************************************************************
/*******************************************************************************
Copyright(c) 1999 - 200
4
Intel Corporation. All rights reserved.
Copyright(c) 1999 - 200
5
Intel Corporation. All rights reserved.
This program is free software; you can redistribute it and/or modify it
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the Free
under the terms of the GNU General Public License as published by the Free
...
@@ -29,6 +29,9 @@
...
@@ -29,6 +29,9 @@
#include "ixgb.h"
#include "ixgb.h"
/* Change Log
/* Change Log
* 1.0.88 01/05/05
* - include fix to the condition that determines when to quit NAPI - Robert Olsson
* - use netif_poll_{disable/enable} to synchronize between NAPI and i/f up/down
* 1.0.84 10/26/04
* 1.0.84 10/26/04
* - reset buffer_info->dma in Tx resource cleanup logic
* - reset buffer_info->dma in Tx resource cleanup logic
* 1.0.83 10/12/04
* 1.0.83 10/12/04
...
@@ -38,13 +41,14 @@
...
@@ -38,13 +41,14 @@
char
ixgb_driver_name
[]
=
"ixgb"
;
char
ixgb_driver_name
[]
=
"ixgb"
;
char
ixgb_driver_string
[]
=
"Intel(R) PRO/10GbE Network Driver"
;
char
ixgb_driver_string
[]
=
"Intel(R) PRO/10GbE Network Driver"
;
#ifndef CONFIG_IXGB_NAPI
#ifndef CONFIG_IXGB_NAPI
#define DRIVERNAPI
#define DRIVERNAPI
#else
#else
#define DRIVERNAPI "-NAPI"
#define DRIVERNAPI "-NAPI"
#endif
#endif
char
ixgb_driver_version
[]
=
"1.0.
87
-k2"
DRIVERNAPI
;
char
ixgb_driver_version
[]
=
"1.0.
90
-k2"
DRIVERNAPI
;
char
ixgb_copyright
[]
=
"Copyright (c) 1999-200
4
Intel Corporation."
;
char
ixgb_copyright
[]
=
"Copyright (c) 1999-200
5
Intel Corporation."
;
/* ixgb_pci_tbl - PCI Device ID Table
/* ixgb_pci_tbl - PCI Device ID Table
*
*
...
@@ -292,6 +296,9 @@ ixgb_up(struct ixgb_adapter *adapter)
...
@@ -292,6 +296,9 @@ ixgb_up(struct ixgb_adapter *adapter)
mod_timer
(
&
adapter
->
watchdog_timer
,
jiffies
);
mod_timer
(
&
adapter
->
watchdog_timer
,
jiffies
);
ixgb_irq_enable
(
adapter
);
ixgb_irq_enable
(
adapter
);
#ifdef CONFIG_IXGB_NAPI
netif_poll_enable
(
netdev
);
#endif
return
0
;
return
0
;
}
}
...
@@ -309,6 +316,9 @@ ixgb_down(struct ixgb_adapter *adapter, boolean_t kill_watchdog)
...
@@ -309,6 +316,9 @@ ixgb_down(struct ixgb_adapter *adapter, boolean_t kill_watchdog)
#endif
#endif
if
(
kill_watchdog
)
if
(
kill_watchdog
)
del_timer_sync
(
&
adapter
->
watchdog_timer
);
del_timer_sync
(
&
adapter
->
watchdog_timer
);
#ifdef CONFIG_IXGB_NAPI
netif_poll_disable
(
netdev
);
#endif
adapter
->
link_speed
=
0
;
adapter
->
link_speed
=
0
;
adapter
->
link_duplex
=
0
;
adapter
->
link_duplex
=
0
;
netif_carrier_off
(
netdev
);
netif_carrier_off
(
netdev
);
...
@@ -709,14 +719,8 @@ ixgb_configure_tx(struct ixgb_adapter *adapter)
...
@@ -709,14 +719,8 @@ ixgb_configure_tx(struct ixgb_adapter *adapter)
IXGB_WRITE_REG
(
hw
,
TDH
,
0
);
IXGB_WRITE_REG
(
hw
,
TDH
,
0
);
IXGB_WRITE_REG
(
hw
,
TDT
,
0
);
IXGB_WRITE_REG
(
hw
,
TDT
,
0
);
/* don't set up txdctl, it induces performance problems if
/* don't set up txdctl, it induces performance problems if configured
* configured incorrectly
* incorrectly */
txdctl = TXDCTL_PTHRESH_DEFAULT; // prefetch txds below this threshold
txdctl |= (TXDCTL_HTHRESH_DEFAULT // only prefetch if there are this many ready
<< IXGB_TXDCTL_HTHRESH_SHIFT);
IXGB_WRITE_REG (hw, TXDCTL, txdctl);
*/
/* Set the Tx Interrupt Delay register */
/* Set the Tx Interrupt Delay register */
IXGB_WRITE_REG
(
hw
,
TIDV
,
adapter
->
tx_int_delay
);
IXGB_WRITE_REG
(
hw
,
TIDV
,
adapter
->
tx_int_delay
);
...
@@ -849,10 +853,17 @@ ixgb_configure_rx(struct ixgb_adapter *adapter)
...
@@ -849,10 +853,17 @@ ixgb_configure_rx(struct ixgb_adapter *adapter)
IXGB_WRITE_REG
(
hw
,
RDH
,
0
);
IXGB_WRITE_REG
(
hw
,
RDH
,
0
);
IXGB_WRITE_REG
(
hw
,
RDT
,
0
);
IXGB_WRITE_REG
(
hw
,
RDT
,
0
);
/* burst 16 or burst when RXT0*/
/* set up pre-fetching of receive buffers so we get some before we
rxdctl
=
RXDCTL_WTHRESH_DEFAULT
<<
IXGB_RXDCTL_WTHRESH_SHIFT
* run out (default hardware behavior is to run out before fetching
|
RXDCTL_HTHRESH_DEFAULT
<<
IXGB_RXDCTL_HTHRESH_SHIFT
* more). This sets up to fetch if HTHRESH rx descriptors are avail
|
RXDCTL_PTHRESH_DEFAULT
<<
IXGB_RXDCTL_PTHRESH_SHIFT
;
* and the descriptors in hw cache are below PTHRESH. This avoids
* the hardware behavior of fetching <=512 descriptors in a single
* burst that pre-empts all other activity, usually causing fifo
* overflows. */
/* use WTHRESH to burst write 16 descriptors or burst when RXT0 */
rxdctl
=
RXDCTL_WTHRESH_DEFAULT
<<
IXGB_RXDCTL_WTHRESH_SHIFT
|
RXDCTL_HTHRESH_DEFAULT
<<
IXGB_RXDCTL_HTHRESH_SHIFT
|
RXDCTL_PTHRESH_DEFAULT
<<
IXGB_RXDCTL_PTHRESH_SHIFT
;
IXGB_WRITE_REG
(
hw
,
RXDCTL
,
rxdctl
);
IXGB_WRITE_REG
(
hw
,
RXDCTL
,
rxdctl
);
/* Enable Receive Checksum Offload for TCP and UDP */
/* Enable Receive Checksum Offload for TCP and UDP */
...
@@ -1094,7 +1105,6 @@ ixgb_watchdog(unsigned long data)
...
@@ -1094,7 +1105,6 @@ ixgb_watchdog(unsigned long data)
struct
ixgb_adapter
*
adapter
=
(
struct
ixgb_adapter
*
)
data
;
struct
ixgb_adapter
*
adapter
=
(
struct
ixgb_adapter
*
)
data
;
struct
net_device
*
netdev
=
adapter
->
netdev
;
struct
net_device
*
netdev
=
adapter
->
netdev
;
struct
ixgb_desc_ring
*
txdr
=
&
adapter
->
tx_ring
;
struct
ixgb_desc_ring
*
txdr
=
&
adapter
->
tx_ring
;
unsigned
int
i
;
ixgb_check_for_link
(
&
adapter
->
hw
);
ixgb_check_for_link
(
&
adapter
->
hw
);
...
@@ -1137,12 +1147,8 @@ ixgb_watchdog(unsigned long data)
...
@@ -1137,12 +1147,8 @@ ixgb_watchdog(unsigned long data)
}
}
}
}
/* Early detection of hung controller */
/* Force detection of hung controller every watchdog period */
i
=
txdr
->
next_to_clean
;
adapter
->
detect_tx_hung
=
TRUE
;
if
(
txdr
->
buffer_info
[
i
].
dma
&&
time_after
(
jiffies
,
txdr
->
buffer_info
[
i
].
time_stamp
+
HZ
)
&&
!
(
IXGB_READ_REG
(
&
adapter
->
hw
,
STATUS
)
&
IXGB_STATUS_TXOFF
))
netif_stop_queue
(
netdev
);
/* generate an interrupt to force clean up of any stragglers */
/* generate an interrupt to force clean up of any stragglers */
IXGB_WRITE_REG
(
&
adapter
->
hw
,
ICS
,
IXGB_INT_TXDW
);
IXGB_WRITE_REG
(
&
adapter
->
hw
,
ICS
,
IXGB_INT_TXDW
);
...
@@ -1668,20 +1674,16 @@ ixgb_clean(struct net_device *netdev, int *budget)
...
@@ -1668,20 +1674,16 @@ ixgb_clean(struct net_device *netdev, int *budget)
int
work_to_do
=
min
(
*
budget
,
netdev
->
quota
);
int
work_to_do
=
min
(
*
budget
,
netdev
->
quota
);
int
tx_cleaned
;
int
tx_cleaned
;
int
work_done
=
0
;
int
work_done
=
0
;
if
(
!
netif_carrier_ok
(
netdev
))
goto
quit_polling
;
tx_cleaned
=
ixgb_clean_tx_irq
(
adapter
);
tx_cleaned
=
ixgb_clean_tx_irq
(
adapter
);
ixgb_clean_rx_irq
(
adapter
,
&
work_done
,
work_to_do
);
ixgb_clean_rx_irq
(
adapter
,
&
work_done
,
work_to_do
);
*
budget
-=
work_done
;
*
budget
-=
work_done
;
netdev
->
quota
-=
work_done
;
netdev
->
quota
-=
work_done
;
/* if no Tx cleanup and not enough Rx work done, exit the polling mode */
/* if no Tx and not enough Rx work done, exit the polling mode */
if
((
!
tx_cleaned
&&
(
work_done
<
work_to_do
))
||
if
((
!
tx_cleaned
&&
(
work_done
==
0
))
||
!
netif_running
(
netdev
))
{
!
netif_running
(
netdev
))
{
netif_rx_complete
(
netdev
);
quit_polling:
netif_rx_complete
(
netdev
);
ixgb_irq_enable
(
adapter
);
ixgb_irq_enable
(
adapter
);
return
0
;
return
0
;
}
}
...
@@ -1742,6 +1744,17 @@ ixgb_clean_tx_irq(struct ixgb_adapter *adapter)
...
@@ -1742,6 +1744,17 @@ ixgb_clean_tx_irq(struct ixgb_adapter *adapter)
}
}
spin_unlock
(
&
adapter
->
tx_lock
);
spin_unlock
(
&
adapter
->
tx_lock
);
if
(
adapter
->
detect_tx_hung
)
{
/* detect a transmit hang in hardware, this serializes the
* check with the clearing of time_stamp and movement of i */
adapter
->
detect_tx_hung
=
FALSE
;
if
(
tx_ring
->
buffer_info
[
i
].
dma
&&
time_after
(
jiffies
,
tx_ring
->
buffer_info
[
i
].
time_stamp
+
HZ
)
&&
!
(
IXGB_READ_REG
(
&
adapter
->
hw
,
STATUS
)
&
IXGB_STATUS_TXOFF
))
netif_stop_queue
(
netdev
);
}
return
cleaned
;
return
cleaned
;
}
}
...
...
drivers/net/ixgb/ixgb_osdep.h
View file @
0ba34de2
/*******************************************************************************
/*******************************************************************************
Copyright(c) 1999 - 200
4
Intel Corporation. All rights reserved.
Copyright(c) 1999 - 200
5
Intel Corporation. All rights reserved.
This program is free software; you can redistribute it and/or modify it
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the Free
under the terms of the GNU General Public License as published by the Free
...
...
drivers/net/ixgb/ixgb_param.c
View file @
0ba34de2
/*******************************************************************************
/*******************************************************************************
Copyright(c) 1999 - 200
4
Intel Corporation. All rights reserved.
Copyright(c) 1999 - 200
5
Intel Corporation. All rights reserved.
This program is free software; you can redistribute it and/or modify it
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the Free
under the terms of the GNU General Public License as published by the Free
...
...
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