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
Kirill Smelkov
linux
Commits
3b1d74fa
Commit
3b1d74fa
authored
May 18, 2004
by
Scott Feldman
Committed by
Jeff Garzik
May 18, 2004
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[PATCH] e100: netdev->priv to netdev_priv()
* Convert all netdev->priv references to the fancy new netdev_priv().
parent
f05ed6c1
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
39 additions
and
39 deletions
+39
-39
drivers/net/e100.c
drivers/net/e100.c
+39
-39
No files found.
drivers/net/e100.c
View file @
3b1d74fa
...
...
@@ -158,7 +158,7 @@
#define DRV_NAME "e100"
#define DRV_VERSION "3.0.1
7
"
#define DRV_VERSION "3.0.1
8
"
#define DRV_DESCRIPTION "Intel(R) PRO/100 Network Driver"
#define DRV_COPYRIGHT "Copyright(c) 1999-2004 Intel Corporation"
#define PFX DRV_NAME ": "
...
...
@@ -868,12 +868,12 @@ static u16 mdio_ctrl(struct nic *nic, u32 addr, u32 dir, u32 reg, u16 data)
static
int
mdio_read
(
struct
net_device
*
netdev
,
int
addr
,
int
reg
)
{
return
mdio_ctrl
(
netdev
->
priv
,
addr
,
mdi_read
,
reg
,
0
);
return
mdio_ctrl
(
netdev
_priv
(
netdev
)
,
addr
,
mdi_read
,
reg
,
0
);
}
static
void
mdio_write
(
struct
net_device
*
netdev
,
int
addr
,
int
reg
,
int
data
)
{
mdio_ctrl
(
netdev
->
priv
,
addr
,
mdi_write
,
reg
,
data
);
mdio_ctrl
(
netdev
_priv
(
netdev
)
,
addr
,
mdi_write
,
reg
,
data
);
}
static
void
e100_get_defaults
(
struct
nic
*
nic
)
...
...
@@ -1099,7 +1099,7 @@ static void e100_multi(struct nic *nic, struct cb *cb, struct sk_buff *skb)
static
void
e100_set_multicast_list
(
struct
net_device
*
netdev
)
{
struct
nic
*
nic
=
netdev
->
priv
;
struct
nic
*
nic
=
netdev
_priv
(
netdev
)
;
DPRINTK
(
HW
,
DEBUG
,
"mc_count=%d, flags=0x%04X
\n
"
,
netdev
->
mc_count
,
netdev
->
flags
);
...
...
@@ -1252,7 +1252,7 @@ static inline void e100_xmit_prepare(struct nic *nic, struct cb *cb,
static
int
e100_xmit_frame
(
struct
sk_buff
*
skb
,
struct
net_device
*
netdev
)
{
struct
nic
*
nic
=
netdev
->
priv
;
struct
nic
*
nic
=
netdev
_priv
(
netdev
)
;
int
err
;
if
(
nic
->
flags
&
ich_10h_workaround
)
{
...
...
@@ -1546,7 +1546,7 @@ static int e100_rx_alloc_list(struct nic *nic)
static
irqreturn_t
e100_intr
(
int
irq
,
void
*
dev_id
,
struct
pt_regs
*
regs
)
{
struct
net_device
*
netdev
=
dev_id
;
struct
nic
*
nic
=
netdev
->
priv
;
struct
nic
*
nic
=
netdev
_priv
(
netdev
)
;
u8
stat_ack
=
readb
(
&
nic
->
csr
->
scb
.
stat_ack
);
DPRINTK
(
INTR
,
DEBUG
,
"stat_ack = 0x%02X
\n
"
,
stat_ack
);
...
...
@@ -1578,7 +1578,7 @@ static irqreturn_t e100_intr(int irq, void *dev_id, struct pt_regs *regs)
#ifdef CONFIG_E100_NAPI
static
int
e100_poll
(
struct
net_device
*
netdev
,
int
*
budget
)
{
struct
nic
*
nic
=
netdev
->
priv
;
struct
nic
*
nic
=
netdev
_priv
(
netdev
)
;
unsigned
int
work_to_do
=
min
(
netdev
->
quota
,
*
budget
);
unsigned
int
work_done
=
0
;
int
tx_cleaned
;
...
...
@@ -1603,7 +1603,7 @@ static int e100_poll(struct net_device *netdev, int *budget)
#ifdef CONFIG_NET_POLL_CONTROLLER
static
void
e100_netpoll
(
struct
net_device
*
netdev
)
{
struct
nic
*
nic
=
netdev
->
priv
;
struct
nic
*
nic
=
netdev
_priv
(
netdev
)
;
e100_disable_irq
(
nic
);
e100_intr
(
nic
->
pdev
->
irq
,
netdev
,
NULL
);
e100_enable_irq
(
nic
);
...
...
@@ -1612,13 +1612,13 @@ static void e100_netpoll(struct net_device *netdev)
static
struct
net_device_stats
*
e100_get_stats
(
struct
net_device
*
netdev
)
{
struct
nic
*
nic
=
netdev
->
priv
;
struct
nic
*
nic
=
netdev
_priv
(
netdev
)
;
return
&
nic
->
net_stats
;
}
static
int
e100_set_mac_address
(
struct
net_device
*
netdev
,
void
*
p
)
{
struct
nic
*
nic
=
netdev
->
priv
;
struct
nic
*
nic
=
netdev
_priv
(
netdev
)
;
struct
sockaddr
*
addr
=
p
;
if
(
!
is_valid_ether_addr
(
addr
->
sa_data
))
...
...
@@ -1690,12 +1690,12 @@ static void e100_down(struct nic *nic)
static
void
e100_tx_timeout
(
struct
net_device
*
netdev
)
{
struct
nic
*
nic
=
netdev
->
priv
;
struct
nic
*
nic
=
netdev
_priv
(
netdev
)
;
DPRINTK
(
TX_ERR
,
DEBUG
,
"scb.status=0x%02X
\n
"
,
readb
(
&
nic
->
csr
->
scb
.
status
));
e100_down
(
netdev
->
priv
);
e100_up
(
netdev
->
priv
);
e100_down
(
netdev
_priv
(
netdev
)
);
e100_up
(
netdev
_priv
(
netdev
)
);
}
static
int
e100_loopback_test
(
struct
nic
*
nic
,
enum
loopback
loopback_mode
)
...
...
@@ -1771,13 +1771,13 @@ static void e100_blink_led(unsigned long data)
static
int
e100_get_settings
(
struct
net_device
*
netdev
,
struct
ethtool_cmd
*
cmd
)
{
struct
nic
*
nic
=
netdev
->
priv
;
struct
nic
*
nic
=
netdev
_priv
(
netdev
)
;
return
mii_ethtool_gset
(
&
nic
->
mii
,
cmd
);
}
static
int
e100_set_settings
(
struct
net_device
*
netdev
,
struct
ethtool_cmd
*
cmd
)
{
struct
nic
*
nic
=
netdev
->
priv
;
struct
nic
*
nic
=
netdev
_priv
(
netdev
)
;
int
err
;
mdio_write
(
netdev
,
nic
->
mii
.
phy_id
,
MII_BMCR
,
BMCR_RESET
);
...
...
@@ -1790,7 +1790,7 @@ static int e100_set_settings(struct net_device *netdev, struct ethtool_cmd *cmd)
static
void
e100_get_drvinfo
(
struct
net_device
*
netdev
,
struct
ethtool_drvinfo
*
info
)
{
struct
nic
*
nic
=
netdev
->
priv
;
struct
nic
*
nic
=
netdev
_priv
(
netdev
)
;
strcpy
(
info
->
driver
,
DRV_NAME
);
strcpy
(
info
->
version
,
DRV_VERSION
);
strcpy
(
info
->
fw_version
,
"N/A"
);
...
...
@@ -1799,7 +1799,7 @@ static void e100_get_drvinfo(struct net_device *netdev,
static
int
e100_get_regs_len
(
struct
net_device
*
netdev
)
{
struct
nic
*
nic
=
netdev
->
priv
;
struct
nic
*
nic
=
netdev
_priv
(
netdev
)
;
#define E100_PHY_REGS 0x1C
#define E100_REGS_LEN 1 + E100_PHY_REGS + \
sizeof(nic->mem->dump_buf) / sizeof(u32)
...
...
@@ -1809,7 +1809,7 @@ static int e100_get_regs_len(struct net_device *netdev)
static
void
e100_get_regs
(
struct
net_device
*
netdev
,
struct
ethtool_regs
*
regs
,
void
*
p
)
{
struct
nic
*
nic
=
netdev
->
priv
;
struct
nic
*
nic
=
netdev
_priv
(
netdev
)
;
u32
*
buff
=
p
;
int
i
;
...
...
@@ -1830,14 +1830,14 @@ static void e100_get_regs(struct net_device *netdev,
static
void
e100_get_wol
(
struct
net_device
*
netdev
,
struct
ethtool_wolinfo
*
wol
)
{
struct
nic
*
nic
=
netdev
->
priv
;
struct
nic
*
nic
=
netdev
_priv
(
netdev
)
;
wol
->
supported
=
(
nic
->
mac
>=
mac_82558_D101_A4
)
?
WAKE_MAGIC
:
0
;
wol
->
wolopts
=
(
nic
->
flags
&
wol_magic
)
?
WAKE_MAGIC
:
0
;
}
static
int
e100_set_wol
(
struct
net_device
*
netdev
,
struct
ethtool_wolinfo
*
wol
)
{
struct
nic
*
nic
=
netdev
->
priv
;
struct
nic
*
nic
=
netdev
_priv
(
netdev
)
;
if
(
wol
->
wolopts
!=
WAKE_MAGIC
&&
wol
->
wolopts
!=
0
)
return
-
EOPNOTSUPP
;
...
...
@@ -1855,31 +1855,31 @@ static int e100_set_wol(struct net_device *netdev, struct ethtool_wolinfo *wol)
static
u32
e100_get_msglevel
(
struct
net_device
*
netdev
)
{
struct
nic
*
nic
=
netdev
->
priv
;
struct
nic
*
nic
=
netdev
_priv
(
netdev
)
;
return
nic
->
msg_enable
;
}
static
void
e100_set_msglevel
(
struct
net_device
*
netdev
,
u32
value
)
{
struct
nic
*
nic
=
netdev
->
priv
;
struct
nic
*
nic
=
netdev
_priv
(
netdev
)
;
nic
->
msg_enable
=
value
;
}
static
int
e100_nway_reset
(
struct
net_device
*
netdev
)
{
struct
nic
*
nic
=
netdev
->
priv
;
struct
nic
*
nic
=
netdev
_priv
(
netdev
)
;
return
mii_nway_restart
(
&
nic
->
mii
);
}
static
u32
e100_get_link
(
struct
net_device
*
netdev
)
{
struct
nic
*
nic
=
netdev
->
priv
;
struct
nic
*
nic
=
netdev
_priv
(
netdev
)
;
return
mii_link_ok
(
&
nic
->
mii
);
}
static
int
e100_get_eeprom_len
(
struct
net_device
*
netdev
)
{
struct
nic
*
nic
=
netdev
->
priv
;
struct
nic
*
nic
=
netdev
_priv
(
netdev
)
;
return
nic
->
eeprom_wc
<<
1
;
}
...
...
@@ -1887,7 +1887,7 @@ static int e100_get_eeprom_len(struct net_device *netdev)
static
int
e100_get_eeprom
(
struct
net_device
*
netdev
,
struct
ethtool_eeprom
*
eeprom
,
u8
*
bytes
)
{
struct
nic
*
nic
=
netdev
->
priv
;
struct
nic
*
nic
=
netdev
_priv
(
netdev
)
;
eeprom
->
magic
=
E100_EEPROM_MAGIC
;
memcpy
(
bytes
,
&
((
u8
*
)
nic
->
eeprom
)[
eeprom
->
offset
],
eeprom
->
len
);
...
...
@@ -1898,7 +1898,7 @@ static int e100_get_eeprom(struct net_device *netdev,
static
int
e100_set_eeprom
(
struct
net_device
*
netdev
,
struct
ethtool_eeprom
*
eeprom
,
u8
*
bytes
)
{
struct
nic
*
nic
=
netdev
->
priv
;
struct
nic
*
nic
=
netdev
_priv
(
netdev
)
;
if
(
eeprom
->
magic
!=
E100_EEPROM_MAGIC
)
return
-
EINVAL
;
...
...
@@ -1912,7 +1912,7 @@ static int e100_set_eeprom(struct net_device *netdev,
static
void
e100_get_ringparam
(
struct
net_device
*
netdev
,
struct
ethtool_ringparam
*
ring
)
{
struct
nic
*
nic
=
netdev
->
priv
;
struct
nic
*
nic
=
netdev
_priv
(
netdev
)
;
struct
param_range
*
rfds
=
&
nic
->
params
.
rfds
;
struct
param_range
*
cbs
=
&
nic
->
params
.
cbs
;
...
...
@@ -1929,7 +1929,7 @@ static void e100_get_ringparam(struct net_device *netdev,
static
int
e100_set_ringparam
(
struct
net_device
*
netdev
,
struct
ethtool_ringparam
*
ring
)
{
struct
nic
*
nic
=
netdev
->
priv
;
struct
nic
*
nic
=
netdev
_priv
(
netdev
)
;
struct
param_range
*
rfds
=
&
nic
->
params
.
rfds
;
struct
param_range
*
cbs
=
&
nic
->
params
.
cbs
;
...
...
@@ -1962,7 +1962,7 @@ static int e100_diag_test_count(struct net_device *netdev)
static
void
e100_diag_test
(
struct
net_device
*
netdev
,
struct
ethtool_test
*
test
,
u64
*
data
)
{
struct
nic
*
nic
=
netdev
->
priv
;
struct
nic
*
nic
=
netdev
_priv
(
netdev
)
;
int
i
;
memset
(
data
,
0
,
E100_TEST_LEN
*
sizeof
(
u64
));
...
...
@@ -1983,7 +1983,7 @@ static void e100_diag_test(struct net_device *netdev,
static
int
e100_phys_id
(
struct
net_device
*
netdev
,
u32
data
)
{
struct
nic
*
nic
=
netdev
->
priv
;
struct
nic
*
nic
=
netdev
_priv
(
netdev
)
;
if
(
!
data
||
data
>
(
u32
)(
MAX_SCHEDULE_TIMEOUT
/
HZ
))
data
=
(
u32
)(
MAX_SCHEDULE_TIMEOUT
/
HZ
);
...
...
@@ -2019,7 +2019,7 @@ static int e100_get_stats_count(struct net_device *netdev)
static
void
e100_get_ethtool_stats
(
struct
net_device
*
netdev
,
struct
ethtool_stats
*
stats
,
u64
*
data
)
{
struct
nic
*
nic
=
netdev
->
priv
;
struct
nic
*
nic
=
netdev
_priv
(
netdev
)
;
int
i
;
for
(
i
=
0
;
i
<
E100_NET_STATS_LEN
;
i
++
)
...
...
@@ -2074,7 +2074,7 @@ static struct ethtool_ops e100_ethtool_ops = {
static
int
e100_do_ioctl
(
struct
net_device
*
netdev
,
struct
ifreq
*
ifr
,
int
cmd
)
{
struct
nic
*
nic
=
netdev
->
priv
;
struct
nic
*
nic
=
netdev
_priv
(
netdev
)
;
struct
mii_ioctl_data
*
mii
=
(
struct
mii_ioctl_data
*
)
&
ifr
->
ifr_data
;
return
generic_mii_ioctl
(
&
nic
->
mii
,
mii
,
cmd
,
NULL
);
...
...
@@ -2098,7 +2098,7 @@ static void e100_free(struct nic *nic)
static
int
e100_open
(
struct
net_device
*
netdev
)
{
struct
nic
*
nic
=
netdev
->
priv
;
struct
nic
*
nic
=
netdev
_priv
(
netdev
)
;
int
err
=
0
;
netif_carrier_off
(
netdev
);
...
...
@@ -2109,7 +2109,7 @@ static int e100_open(struct net_device *netdev)
static
int
e100_close
(
struct
net_device
*
netdev
)
{
e100_down
(
netdev
->
priv
);
e100_down
(
netdev
_priv
(
netdev
)
);
return
0
;
}
...
...
@@ -2145,7 +2145,7 @@ static int __devinit e100_probe(struct pci_dev *pdev,
netdev
->
poll_controller
=
e100_netpoll
;
#endif
nic
=
netdev
->
priv
;
nic
=
netdev
_priv
(
netdev
)
;
nic
->
netdev
=
netdev
;
nic
->
pdev
=
pdev
;
nic
->
msg_enable
=
(
1
<<
debug
)
-
1
;
...
...
@@ -2259,7 +2259,7 @@ static void __devexit e100_remove(struct pci_dev *pdev)
struct
net_device
*
netdev
=
pci_get_drvdata
(
pdev
);
if
(
netdev
)
{
struct
nic
*
nic
=
netdev
->
priv
;
struct
nic
*
nic
=
netdev
_priv
(
netdev
)
;
unregister_netdev
(
netdev
);
e100_free
(
nic
);
iounmap
(
nic
->
csr
);
...
...
@@ -2274,7 +2274,7 @@ static void __devexit e100_remove(struct pci_dev *pdev)
static
int
e100_suspend
(
struct
pci_dev
*
pdev
,
u32
state
)
{
struct
net_device
*
netdev
=
pci_get_drvdata
(
pdev
);
struct
nic
*
nic
=
netdev
->
priv
;
struct
nic
*
nic
=
netdev
_priv
(
netdev
)
;
if
(
netif_running
(
netdev
))
e100_down
(
nic
);
...
...
@@ -2292,7 +2292,7 @@ static int e100_suspend(struct pci_dev *pdev, u32 state)
static
int
e100_resume
(
struct
pci_dev
*
pdev
)
{
struct
net_device
*
netdev
=
pci_get_drvdata
(
pdev
);
struct
nic
*
nic
=
netdev
->
priv
;
struct
nic
*
nic
=
netdev
_priv
(
netdev
)
;
pci_set_power_state
(
pdev
,
0
);
pci_restore_state
(
pdev
,
nic
->
pm_state
);
...
...
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