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
e07b9e8f
Commit
e07b9e8f
authored
Mar 12, 2004
by
Randy Dunlap
Committed by
Jeff Garzik
Mar 12, 2004
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[PATCH] use netdev_priv() in drivers/net/ (others)
parent
b88af452
Changes
19
Show whitespace changes
Inline
Side-by-side
Showing
19 changed files
with
241 additions
and
241 deletions
+241
-241
drivers/net/amd8111e.c
drivers/net/amd8111e.c
+28
-28
drivers/net/ariadne.c
drivers/net/ariadne.c
+7
-7
drivers/net/at1700.c
drivers/net/at1700.c
+11
-11
drivers/net/atari_bionet.c
drivers/net/atari_bionet.c
+6
-6
drivers/net/atp.c
drivers/net/atp.c
+13
-13
drivers/net/bmac.c
drivers/net/bmac.c
+22
-22
drivers/net/cs89x0.c
drivers/net/cs89x0.c
+20
-20
drivers/net/eth16i.c
drivers/net/eth16i.c
+9
-9
drivers/net/fec.c
drivers/net/fec.c
+27
-27
drivers/net/gt96100eth.c
drivers/net/gt96100eth.c
+21
-21
drivers/net/mac89x0.c
drivers/net/mac89x0.c
+7
-7
drivers/net/ni5010.c
drivers/net/ni5010.c
+6
-6
drivers/net/rrunner.c
drivers/net/rrunner.c
+16
-16
drivers/net/sb1000.c
drivers/net/sb1000.c
+7
-7
drivers/net/sb1250-mac.c
drivers/net/sb1250-mac.c
+11
-11
drivers/net/seeq8005.c
drivers/net/seeq8005.c
+7
-7
drivers/net/sgiseeq.c
drivers/net/sgiseeq.c
+8
-8
drivers/net/sk_g16.c
drivers/net/sk_g16.c
+9
-9
drivers/net/smc9194.c
drivers/net/smc9194.c
+6
-6
No files found.
drivers/net/amd8111e.c
View file @
e07b9e8f
...
@@ -174,7 +174,7 @@ This is the mii register read function provided to the mii interface.
...
@@ -174,7 +174,7 @@ This is the mii register read function provided to the mii interface.
*/
*/
static
int
amd8111e_mdio_read
(
struct
net_device
*
dev
,
int
phy_id
,
int
reg_num
)
static
int
amd8111e_mdio_read
(
struct
net_device
*
dev
,
int
phy_id
,
int
reg_num
)
{
{
struct
amd8111e_priv
*
lp
=
dev
->
priv
;
struct
amd8111e_priv
*
lp
=
netdev_priv
(
dev
)
;
unsigned
int
reg_val
;
unsigned
int
reg_val
;
amd8111e_read_phy
(
lp
,
phy_id
,
reg_num
,
&
reg_val
);
amd8111e_read_phy
(
lp
,
phy_id
,
reg_num
,
&
reg_val
);
...
@@ -187,7 +187,7 @@ This is the mii register write function provided to the mii interface.
...
@@ -187,7 +187,7 @@ This is the mii register write function provided to the mii interface.
*/
*/
static
void
amd8111e_mdio_write
(
struct
net_device
*
dev
,
int
phy_id
,
int
reg_num
,
int
val
)
static
void
amd8111e_mdio_write
(
struct
net_device
*
dev
,
int
phy_id
,
int
reg_num
,
int
val
)
{
{
struct
amd8111e_priv
*
lp
=
dev
->
priv
;
struct
amd8111e_priv
*
lp
=
netdev_priv
(
dev
)
;
amd8111e_write_phy
(
lp
,
phy_id
,
reg_num
,
val
);
amd8111e_write_phy
(
lp
,
phy_id
,
reg_num
,
val
);
}
}
...
@@ -197,7 +197,7 @@ This function will set PHY speed. During initialization sets the original speed
...
@@ -197,7 +197,7 @@ This function will set PHY speed. During initialization sets the original speed
*/
*/
static
void
amd8111e_set_ext_phy
(
struct
net_device
*
dev
)
static
void
amd8111e_set_ext_phy
(
struct
net_device
*
dev
)
{
{
struct
amd8111e_priv
*
lp
=
(
struct
amd8111e_priv
*
)
dev
->
priv
;
struct
amd8111e_priv
*
lp
=
netdev_priv
(
dev
)
;
u32
bmcr
,
advert
,
tmp
;
u32
bmcr
,
advert
,
tmp
;
/* Determine mii register values to set the speed */
/* Determine mii register values to set the speed */
...
@@ -239,7 +239,7 @@ all transmit and receive skbuffs.
...
@@ -239,7 +239,7 @@ all transmit and receive skbuffs.
*/
*/
static
int
amd8111e_free_skbs
(
struct
net_device
*
dev
)
static
int
amd8111e_free_skbs
(
struct
net_device
*
dev
)
{
{
struct
amd8111e_priv
*
lp
=
(
struct
amd8111e_priv
*
)
dev
->
priv
;
struct
amd8111e_priv
*
lp
=
netdev_priv
(
dev
)
;
struct
sk_buff
*
rx_skbuff
;
struct
sk_buff
*
rx_skbuff
;
int
i
;
int
i
;
...
@@ -272,7 +272,7 @@ This will set the receive buffer length corresponding to the mtu size of network
...
@@ -272,7 +272,7 @@ This will set the receive buffer length corresponding to the mtu size of network
*/
*/
static
inline
void
amd8111e_set_rx_buff_len
(
struct
net_device
*
dev
)
static
inline
void
amd8111e_set_rx_buff_len
(
struct
net_device
*
dev
)
{
{
struct
amd8111e_priv
*
lp
=
dev
->
priv
;
struct
amd8111e_priv
*
lp
=
netdev_priv
(
dev
)
;
unsigned
int
mtu
=
dev
->
mtu
;
unsigned
int
mtu
=
dev
->
mtu
;
if
(
mtu
>
ETH_DATA_LEN
){
if
(
mtu
>
ETH_DATA_LEN
){
...
@@ -290,7 +290,7 @@ This function will free all the previously allocated buffers, determine new rece
...
@@ -290,7 +290,7 @@ This function will free all the previously allocated buffers, determine new rece
*/
*/
static
int
amd8111e_init_ring
(
struct
net_device
*
dev
)
static
int
amd8111e_init_ring
(
struct
net_device
*
dev
)
{
{
struct
amd8111e_priv
*
lp
=
(
struct
amd8111e_priv
*
)
dev
->
priv
;
struct
amd8111e_priv
*
lp
=
netdev_priv
(
dev
)
;
int
i
;
int
i
;
lp
->
rx_idx
=
lp
->
tx_idx
=
0
;
lp
->
rx_idx
=
lp
->
tx_idx
=
0
;
...
@@ -371,7 +371,7 @@ static int amd8111e_set_coalesce(struct net_device * dev, enum coal_mode cmod)
...
@@ -371,7 +371,7 @@ static int amd8111e_set_coalesce(struct net_device * dev, enum coal_mode cmod)
unsigned
int
timeout
;
unsigned
int
timeout
;
unsigned
int
event_count
;
unsigned
int
event_count
;
struct
amd8111e_priv
*
lp
=
dev
->
priv
;
struct
amd8111e_priv
*
lp
=
netdev_priv
(
dev
)
;
void
*
mmio
=
lp
->
mmio
;
void
*
mmio
=
lp
->
mmio
;
struct
amd8111e_coalesce_conf
*
coal_conf
=
&
lp
->
coal_conf
;
struct
amd8111e_coalesce_conf
*
coal_conf
=
&
lp
->
coal_conf
;
...
@@ -429,7 +429,7 @@ This function initializes the device registers and starts the device.
...
@@ -429,7 +429,7 @@ This function initializes the device registers and starts the device.
*/
*/
static
int
amd8111e_restart
(
struct
net_device
*
dev
)
static
int
amd8111e_restart
(
struct
net_device
*
dev
)
{
{
struct
amd8111e_priv
*
lp
=
(
struct
amd8111e_priv
*
)
dev
->
priv
;
struct
amd8111e_priv
*
lp
=
netdev_priv
(
dev
)
;
void
*
mmio
=
lp
->
mmio
;
void
*
mmio
=
lp
->
mmio
;
int
i
,
reg_val
;
int
i
,
reg_val
;
...
@@ -663,7 +663,7 @@ This function will free all the transmit skbs that are actually transmitted by t
...
@@ -663,7 +663,7 @@ This function will free all the transmit skbs that are actually transmitted by t
*/
*/
static
int
amd8111e_tx
(
struct
net_device
*
dev
)
static
int
amd8111e_tx
(
struct
net_device
*
dev
)
{
{
struct
amd8111e_priv
*
lp
=
dev
->
priv
;
struct
amd8111e_priv
*
lp
=
netdev_priv
(
dev
)
;
int
tx_index
=
lp
->
tx_complete_idx
&
TX_RING_DR_MOD_MASK
;
int
tx_index
=
lp
->
tx_complete_idx
&
TX_RING_DR_MOD_MASK
;
int
status
;
int
status
;
/* Complete all the transmit packet */
/* Complete all the transmit packet */
...
@@ -705,7 +705,7 @@ This function will check the ownership of receive buffers and descriptors. It wi
...
@@ -705,7 +705,7 @@ This function will check the ownership of receive buffers and descriptors. It wi
*/
*/
static
int
amd8111e_rx
(
struct
net_device
*
dev
)
static
int
amd8111e_rx
(
struct
net_device
*
dev
)
{
{
struct
amd8111e_priv
*
lp
=
dev
->
priv
;
struct
amd8111e_priv
*
lp
=
netdev_priv
(
dev
)
;
struct
sk_buff
*
skb
,
*
new_skb
;
struct
sk_buff
*
skb
,
*
new_skb
;
int
rx_index
=
lp
->
rx_idx
&
RX_RING_DR_MOD_MASK
;
int
rx_index
=
lp
->
rx_idx
&
RX_RING_DR_MOD_MASK
;
int
min_pkt_len
,
status
;
int
min_pkt_len
,
status
;
...
@@ -809,7 +809,7 @@ This function will indicate the link status to the kernel.
...
@@ -809,7 +809,7 @@ This function will indicate the link status to the kernel.
*/
*/
static
int
amd8111e_link_change
(
struct
net_device
*
dev
)
static
int
amd8111e_link_change
(
struct
net_device
*
dev
)
{
{
struct
amd8111e_priv
*
lp
=
dev
->
priv
;
struct
amd8111e_priv
*
lp
=
netdev_priv
(
dev
)
;
int
status0
,
speed
;
int
status0
,
speed
;
/* read the link change */
/* read the link change */
...
@@ -871,7 +871,7 @@ This function reads the mib registers and returns the hardware statistics. It u
...
@@ -871,7 +871,7 @@ This function reads the mib registers and returns the hardware statistics. It u
*/
*/
static
struct
net_device_stats
*
amd8111e_get_stats
(
struct
net_device
*
dev
)
static
struct
net_device_stats
*
amd8111e_get_stats
(
struct
net_device
*
dev
)
{
{
struct
amd8111e_priv
*
lp
=
dev
->
priv
;
struct
amd8111e_priv
*
lp
=
netdev_priv
(
dev
)
;
void
*
mmio
=
lp
->
mmio
;
void
*
mmio
=
lp
->
mmio
;
unsigned
long
flags
;
unsigned
long
flags
;
/* struct net_device_stats *prev_stats = &lp->prev_stats; */
/* struct net_device_stats *prev_stats = &lp->prev_stats; */
...
@@ -966,7 +966,7 @@ according to the datarate and the packet rate.
...
@@ -966,7 +966,7 @@ according to the datarate and the packet rate.
*/
*/
static
int
amd8111e_calc_coalesce
(
struct
net_device
*
dev
)
static
int
amd8111e_calc_coalesce
(
struct
net_device
*
dev
)
{
{
struct
amd8111e_priv
*
lp
=
dev
->
priv
;
struct
amd8111e_priv
*
lp
=
netdev_priv
(
dev
)
;
struct
amd8111e_coalesce_conf
*
coal_conf
=
&
lp
->
coal_conf
;
struct
amd8111e_coalesce_conf
*
coal_conf
=
&
lp
->
coal_conf
;
int
tx_pkt_rate
;
int
tx_pkt_rate
;
int
rx_pkt_rate
;
int
rx_pkt_rate
;
...
@@ -1102,7 +1102,7 @@ static irqreturn_t amd8111e_interrupt(int irq, void *dev_id, struct pt_regs *reg
...
@@ -1102,7 +1102,7 @@ static irqreturn_t amd8111e_interrupt(int irq, void *dev_id, struct pt_regs *reg
{
{
struct
net_device
*
dev
=
(
struct
net_device
*
)
dev_id
;
struct
net_device
*
dev
=
(
struct
net_device
*
)
dev_id
;
struct
amd8111e_priv
*
lp
=
dev
->
priv
;
struct
amd8111e_priv
*
lp
=
netdev_priv
(
dev
)
;
void
*
mmio
=
lp
->
mmio
;
void
*
mmio
=
lp
->
mmio
;
unsigned
int
intr0
;
unsigned
int
intr0
;
unsigned
int
handled
=
1
;
unsigned
int
handled
=
1
;
...
@@ -1158,7 +1158,7 @@ This function closes the network interface and updates the statistics so that mo
...
@@ -1158,7 +1158,7 @@ This function closes the network interface and updates the statistics so that mo
*/
*/
static
int
amd8111e_close
(
struct
net_device
*
dev
)
static
int
amd8111e_close
(
struct
net_device
*
dev
)
{
{
struct
amd8111e_priv
*
lp
=
dev
->
priv
;
struct
amd8111e_priv
*
lp
=
netdev_priv
(
dev
)
;
netif_stop_queue
(
dev
);
netif_stop_queue
(
dev
);
spin_lock_irq
(
&
lp
->
lock
);
spin_lock_irq
(
&
lp
->
lock
);
...
@@ -1185,7 +1185,7 @@ static int amd8111e_close(struct net_device * dev)
...
@@ -1185,7 +1185,7 @@ static int amd8111e_close(struct net_device * dev)
*/
*/
static
int
amd8111e_open
(
struct
net_device
*
dev
)
static
int
amd8111e_open
(
struct
net_device
*
dev
)
{
{
struct
amd8111e_priv
*
lp
=
(
struct
amd8111e_priv
*
)
dev
->
priv
;
struct
amd8111e_priv
*
lp
=
netdev_priv
(
dev
)
;
if
(
dev
->
irq
==
0
||
request_irq
(
dev
->
irq
,
amd8111e_interrupt
,
SA_SHIRQ
,
if
(
dev
->
irq
==
0
||
request_irq
(
dev
->
irq
,
amd8111e_interrupt
,
SA_SHIRQ
,
dev
->
name
,
dev
))
dev
->
name
,
dev
))
...
@@ -1231,7 +1231,7 @@ This function will queue the transmit packets to the descriptors and will trigge
...
@@ -1231,7 +1231,7 @@ This function will queue the transmit packets to the descriptors and will trigge
static
int
amd8111e_start_xmit
(
struct
sk_buff
*
skb
,
struct
net_device
*
dev
)
static
int
amd8111e_start_xmit
(
struct
sk_buff
*
skb
,
struct
net_device
*
dev
)
{
{
struct
amd8111e_priv
*
lp
=
dev
->
priv
;
struct
amd8111e_priv
*
lp
=
netdev_priv
(
dev
)
;
int
tx_index
;
int
tx_index
;
unsigned
long
flags
;
unsigned
long
flags
;
...
@@ -1338,7 +1338,7 @@ list to the device.
...
@@ -1338,7 +1338,7 @@ list to the device.
static
void
amd8111e_set_multicast_list
(
struct
net_device
*
dev
)
static
void
amd8111e_set_multicast_list
(
struct
net_device
*
dev
)
{
{
struct
dev_mc_list
*
mc_ptr
;
struct
dev_mc_list
*
mc_ptr
;
struct
amd8111e_priv
*
lp
=
dev
->
priv
;
struct
amd8111e_priv
*
lp
=
netdev_priv
(
dev
)
;
u32
mc_filter
[
2
]
;
u32
mc_filter
[
2
]
;
int
i
,
bit_num
;
int
i
,
bit_num
;
if
(
dev
->
flags
&
IFF_PROMISC
){
if
(
dev
->
flags
&
IFF_PROMISC
){
...
@@ -1388,7 +1388,7 @@ This function handles all the ethtool ioctls. It gives driver info, gets/sets d
...
@@ -1388,7 +1388,7 @@ This function handles all the ethtool ioctls. It gives driver info, gets/sets d
static
int
amd8111e_ethtool_ioctl
(
struct
net_device
*
dev
,
void
*
useraddr
)
static
int
amd8111e_ethtool_ioctl
(
struct
net_device
*
dev
,
void
*
useraddr
)
{
{
struct
amd8111e_priv
*
lp
=
dev
->
priv
;
struct
amd8111e_priv
*
lp
=
netdev_priv
(
dev
)
;
struct
pci_dev
*
pci_dev
=
lp
->
pci_dev
;
struct
pci_dev
*
pci_dev
=
lp
->
pci_dev
;
u32
ethcmd
;
u32
ethcmd
;
...
@@ -1510,7 +1510,7 @@ static int amd8111e_ethtool_ioctl(struct net_device* dev, void* useraddr)
...
@@ -1510,7 +1510,7 @@ static int amd8111e_ethtool_ioctl(struct net_device* dev, void* useraddr)
static
int
amd8111e_ioctl
(
struct
net_device
*
dev
,
struct
ifreq
*
ifr
,
int
cmd
)
static
int
amd8111e_ioctl
(
struct
net_device
*
dev
,
struct
ifreq
*
ifr
,
int
cmd
)
{
{
struct
mii_ioctl_data
*
data
=
(
struct
mii_ioctl_data
*
)
&
ifr
->
ifr_data
;
struct
mii_ioctl_data
*
data
=
(
struct
mii_ioctl_data
*
)
&
ifr
->
ifr_data
;
struct
amd8111e_priv
*
lp
=
dev
->
priv
;
struct
amd8111e_priv
*
lp
=
netdev_priv
(
dev
)
;
int
err
;
int
err
;
u32
mii_regval
;
u32
mii_regval
;
...
@@ -1554,7 +1554,7 @@ This function changes the mtu of the device. It restarts the device to initiali
...
@@ -1554,7 +1554,7 @@ This function changes the mtu of the device. It restarts the device to initiali
*/
*/
int
amd8111e_change_mtu
(
struct
net_device
*
dev
,
int
new_mtu
)
int
amd8111e_change_mtu
(
struct
net_device
*
dev
,
int
new_mtu
)
{
{
struct
amd8111e_priv
*
lp
=
dev
->
priv
;
struct
amd8111e_priv
*
lp
=
netdev_priv
(
dev
)
;
int
err
;
int
err
;
if
((
new_mtu
<
AMD8111E_MIN_MTU
)
||
(
new_mtu
>
AMD8111E_MAX_MTU
))
if
((
new_mtu
<
AMD8111E_MIN_MTU
)
||
(
new_mtu
>
AMD8111E_MAX_MTU
))
...
@@ -1584,7 +1584,7 @@ int amd8111e_change_mtu(struct net_device *dev, int new_mtu)
...
@@ -1584,7 +1584,7 @@ int amd8111e_change_mtu(struct net_device *dev, int new_mtu)
#if AMD8111E_VLAN_TAG_USED
#if AMD8111E_VLAN_TAG_USED
static
void
amd8111e_vlan_rx_register
(
struct
net_device
*
dev
,
struct
vlan_group
*
grp
)
static
void
amd8111e_vlan_rx_register
(
struct
net_device
*
dev
,
struct
vlan_group
*
grp
)
{
{
struct
amd8111e_priv
*
lp
=
dev
->
priv
;
struct
amd8111e_priv
*
lp
=
netdev_priv
(
dev
)
;
spin_lock_irq
(
&
lp
->
lock
);
spin_lock_irq
(
&
lp
->
lock
);
lp
->
vlgrp
=
grp
;
lp
->
vlgrp
=
grp
;
spin_unlock_irq
(
&
lp
->
lock
);
spin_unlock_irq
(
&
lp
->
lock
);
...
@@ -1592,7 +1592,7 @@ static void amd8111e_vlan_rx_register(struct net_device *dev, struct vlan_group
...
@@ -1592,7 +1592,7 @@ static void amd8111e_vlan_rx_register(struct net_device *dev, struct vlan_group
static
void
amd8111e_vlan_rx_kill_vid
(
struct
net_device
*
dev
,
unsigned
short
vid
)
static
void
amd8111e_vlan_rx_kill_vid
(
struct
net_device
*
dev
,
unsigned
short
vid
)
{
{
struct
amd8111e_priv
*
lp
=
dev
->
priv
;
struct
amd8111e_priv
*
lp
=
netdev_priv
(
dev
)
;
spin_lock_irq
(
&
lp
->
lock
);
spin_lock_irq
(
&
lp
->
lock
);
if
(
lp
->
vlgrp
)
if
(
lp
->
vlgrp
)
lp
->
vlgrp
->
vlan_devices
[
vid
]
=
NULL
;
lp
->
vlgrp
->
vlan_devices
[
vid
]
=
NULL
;
...
@@ -1623,7 +1623,7 @@ static int amd8111e_enable_link_change(struct amd8111e_priv* lp)
...
@@ -1623,7 +1623,7 @@ static int amd8111e_enable_link_change(struct amd8111e_priv* lp)
static
void
amd8111e_tx_timeout
(
struct
net_device
*
dev
)
static
void
amd8111e_tx_timeout
(
struct
net_device
*
dev
)
{
{
struct
amd8111e_priv
*
lp
=
dev
->
priv
;
struct
amd8111e_priv
*
lp
=
netdev_priv
(
dev
)
;
int
err
;
int
err
;
printk
(
KERN_ERR
"%s: transmit timed out, resetting
\n
"
,
printk
(
KERN_ERR
"%s: transmit timed out, resetting
\n
"
,
...
@@ -1637,7 +1637,7 @@ static void amd8111e_tx_timeout(struct net_device *dev)
...
@@ -1637,7 +1637,7 @@ static void amd8111e_tx_timeout(struct net_device *dev)
static
int
amd8111e_suspend
(
struct
pci_dev
*
pci_dev
,
u32
state
)
static
int
amd8111e_suspend
(
struct
pci_dev
*
pci_dev
,
u32
state
)
{
{
struct
net_device
*
dev
=
pci_get_drvdata
(
pci_dev
);
struct
net_device
*
dev
=
pci_get_drvdata
(
pci_dev
);
struct
amd8111e_priv
*
lp
=
dev
->
priv
;
struct
amd8111e_priv
*
lp
=
netdev_priv
(
dev
)
;
if
(
!
netif_running
(
dev
))
if
(
!
netif_running
(
dev
))
return
0
;
return
0
;
...
@@ -1680,7 +1680,7 @@ static int amd8111e_suspend(struct pci_dev *pci_dev, u32 state)
...
@@ -1680,7 +1680,7 @@ static int amd8111e_suspend(struct pci_dev *pci_dev, u32 state)
static
int
amd8111e_resume
(
struct
pci_dev
*
pci_dev
)
static
int
amd8111e_resume
(
struct
pci_dev
*
pci_dev
)
{
{
struct
net_device
*
dev
=
pci_get_drvdata
(
pci_dev
);
struct
net_device
*
dev
=
pci_get_drvdata
(
pci_dev
);
struct
amd8111e_priv
*
lp
=
dev
->
priv
;
struct
amd8111e_priv
*
lp
=
netdev_priv
(
dev
)
;
if
(
!
netif_running
(
dev
))
if
(
!
netif_running
(
dev
))
return
0
;
return
0
;
...
@@ -1719,7 +1719,7 @@ static void __devexit amd8111e_remove_one(struct pci_dev *pdev)
...
@@ -1719,7 +1719,7 @@ static void __devexit amd8111e_remove_one(struct pci_dev *pdev)
}
}
static
void
amd8111e_config_ipg
(
struct
net_device
*
dev
)
static
void
amd8111e_config_ipg
(
struct
net_device
*
dev
)
{
{
struct
amd8111e_priv
*
lp
=
dev
->
priv
;
struct
amd8111e_priv
*
lp
=
netdev_priv
(
dev
)
;
struct
ipg_info
*
ipg_data
=
&
lp
->
ipg_data
;
struct
ipg_info
*
ipg_data
=
&
lp
->
ipg_data
;
void
*
mmio
=
lp
->
mmio
;
void
*
mmio
=
lp
->
mmio
;
unsigned
int
prev_col_cnt
=
ipg_data
->
col_cnt
;
unsigned
int
prev_col_cnt
=
ipg_data
->
col_cnt
;
...
@@ -1841,7 +1841,7 @@ static int __devinit amd8111e_probe_one(struct pci_dev *pdev,
...
@@ -1841,7 +1841,7 @@ static int __devinit amd8111e_probe_one(struct pci_dev *pdev,
dev
->
vlan_rx_kill_vid
=
amd8111e_vlan_rx_kill_vid
;
dev
->
vlan_rx_kill_vid
=
amd8111e_vlan_rx_kill_vid
;
#endif
#endif
lp
=
dev
->
priv
;
lp
=
netdev_priv
(
dev
)
;
lp
->
pci_dev
=
pdev
;
lp
->
pci_dev
=
pdev
;
lp
->
amd8111e_net_dev
=
dev
;
lp
->
amd8111e_net_dev
=
dev
;
lp
->
pm_cap
=
pm_cap
;
lp
->
pm_cap
=
pm_cap
;
...
...
drivers/net/ariadne.c
View file @
e07b9e8f
...
@@ -184,7 +184,7 @@ static int __devinit ariadne_init_one(struct zorro_dev *z,
...
@@ -184,7 +184,7 @@ static int __devinit ariadne_init_one(struct zorro_dev *z,
}
}
SET_MODULE_OWNER
(
dev
);
SET_MODULE_OWNER
(
dev
);
priv
=
dev
->
priv
;
priv
=
netdev_priv
(
dev
)
;
r1
->
name
=
dev
->
name
;
r1
->
name
=
dev
->
name
;
r2
->
name
=
dev
->
name
;
r2
->
name
=
dev
->
name
;
...
@@ -333,7 +333,7 @@ static int ariadne_open(struct net_device *dev)
...
@@ -333,7 +333,7 @@ static int ariadne_open(struct net_device *dev)
static
void
ariadne_init_ring
(
struct
net_device
*
dev
)
static
void
ariadne_init_ring
(
struct
net_device
*
dev
)
{
{
struct
ariadne_private
*
priv
=
(
struct
ariadne_private
*
)
dev
->
priv
;
struct
ariadne_private
*
priv
=
netdev_priv
(
dev
)
;
volatile
struct
lancedata
*
lancedata
=
(
struct
lancedata
*
)
dev
->
mem_start
;
volatile
struct
lancedata
*
lancedata
=
(
struct
lancedata
*
)
dev
->
mem_start
;
int
i
;
int
i
;
...
@@ -379,7 +379,7 @@ static void ariadne_init_ring(struct net_device *dev)
...
@@ -379,7 +379,7 @@ static void ariadne_init_ring(struct net_device *dev)
static
int
ariadne_close
(
struct
net_device
*
dev
)
static
int
ariadne_close
(
struct
net_device
*
dev
)
{
{
struct
ariadne_private
*
priv
=
(
struct
ariadne_private
*
)
dev
->
priv
;
struct
ariadne_private
*
priv
=
netdev_priv
(
dev
)
;
volatile
struct
Am79C960
*
lance
=
(
struct
Am79C960
*
)
dev
->
base_addr
;
volatile
struct
Am79C960
*
lance
=
(
struct
Am79C960
*
)
dev
->
base_addr
;
netif_stop_queue
(
dev
);
netif_stop_queue
(
dev
);
...
@@ -434,7 +434,7 @@ static irqreturn_t ariadne_interrupt(int irq, void *data, struct pt_regs *fp)
...
@@ -434,7 +434,7 @@ static irqreturn_t ariadne_interrupt(int irq, void *data, struct pt_regs *fp)
if
(
!
(
lance
->
RDP
&
INTR
))
/* Check if any interrupt has been */
if
(
!
(
lance
->
RDP
&
INTR
))
/* Check if any interrupt has been */
return
IRQ_NONE
;
/* generated by the board. */
return
IRQ_NONE
;
/* generated by the board. */
priv
=
(
struct
ariadne_private
*
)
dev
->
priv
;
priv
=
netdev_priv
(
dev
)
;
boguscnt
=
10
;
boguscnt
=
10
;
while
((
csr0
=
lance
->
RDP
)
&
(
ERR
|
RINT
|
TINT
)
&&
--
boguscnt
>=
0
)
{
while
((
csr0
=
lance
->
RDP
)
&
(
ERR
|
RINT
|
TINT
)
&&
--
boguscnt
>=
0
)
{
...
@@ -589,7 +589,7 @@ static void ariadne_tx_timeout(struct net_device *dev)
...
@@ -589,7 +589,7 @@ static void ariadne_tx_timeout(struct net_device *dev)
static
int
ariadne_start_xmit
(
struct
sk_buff
*
skb
,
struct
net_device
*
dev
)
static
int
ariadne_start_xmit
(
struct
sk_buff
*
skb
,
struct
net_device
*
dev
)
{
{
struct
ariadne_private
*
priv
=
(
struct
ariadne_private
*
)
dev
->
priv
;
struct
ariadne_private
*
priv
=
netdev_priv
(
dev
)
;
volatile
struct
Am79C960
*
lance
=
(
struct
Am79C960
*
)
dev
->
base_addr
;
volatile
struct
Am79C960
*
lance
=
(
struct
Am79C960
*
)
dev
->
base_addr
;
int
entry
;
int
entry
;
unsigned
long
flags
;
unsigned
long
flags
;
...
@@ -697,7 +697,7 @@ static int ariadne_start_xmit(struct sk_buff *skb, struct net_device *dev)
...
@@ -697,7 +697,7 @@ static int ariadne_start_xmit(struct sk_buff *skb, struct net_device *dev)
static
int
ariadne_rx
(
struct
net_device
*
dev
)
static
int
ariadne_rx
(
struct
net_device
*
dev
)
{
{
struct
ariadne_private
*
priv
=
(
struct
ariadne_private
*
)
dev
->
priv
;
struct
ariadne_private
*
priv
=
netdev_priv
(
dev
)
;
int
entry
=
priv
->
cur_rx
%
RX_RING_SIZE
;
int
entry
=
priv
->
cur_rx
%
RX_RING_SIZE
;
int
i
;
int
i
;
...
@@ -787,7 +787,7 @@ static int ariadne_rx(struct net_device *dev)
...
@@ -787,7 +787,7 @@ static int ariadne_rx(struct net_device *dev)
static
struct
net_device_stats
*
ariadne_get_stats
(
struct
net_device
*
dev
)
static
struct
net_device_stats
*
ariadne_get_stats
(
struct
net_device
*
dev
)
{
{
struct
ariadne_private
*
priv
=
(
struct
ariadne_private
*
)
dev
->
priv
;
struct
ariadne_private
*
priv
=
netdev_priv
(
dev
)
;
volatile
struct
Am79C960
*
lance
=
(
struct
Am79C960
*
)
dev
->
base_addr
;
volatile
struct
Am79C960
*
lance
=
(
struct
Am79C960
*
)
dev
->
base_addr
;
short
saved_addr
;
short
saved_addr
;
unsigned
long
flags
;
unsigned
long
flags
;
...
...
drivers/net/at1700.c
View file @
e07b9e8f
...
@@ -241,7 +241,7 @@ static int irq;
...
@@ -241,7 +241,7 @@ static int irq;
static
void
cleanup_card
(
struct
net_device
*
dev
)
static
void
cleanup_card
(
struct
net_device
*
dev
)
{
{
#ifdef CONFIG_MCA
#ifdef CONFIG_MCA
struct
net_local
*
lp
=
dev
->
priv
;
struct
net_local
*
lp
=
netdev_priv
(
dev
)
;
if
(
lp
->
mca_slot
)
if
(
lp
->
mca_slot
)
mca_mark_as_unused
(
lp
->
mca_slot
);
mca_mark_as_unused
(
lp
->
mca_slot
);
#endif
#endif
...
@@ -319,7 +319,7 @@ static int __init at1700_probe1(struct net_device *dev, int ioaddr)
...
@@ -319,7 +319,7 @@ static int __init at1700_probe1(struct net_device *dev, int ioaddr)
char
at1700_irqmap
[
8
]
=
{
3
,
4
,
5
,
9
,
10
,
11
,
14
,
15
};
char
at1700_irqmap
[
8
]
=
{
3
,
4
,
5
,
9
,
10
,
11
,
14
,
15
};
unsigned
int
i
,
irq
,
is_fmv18x
=
0
,
is_at1700
=
0
;
unsigned
int
i
,
irq
,
is_fmv18x
=
0
,
is_at1700
=
0
;
int
slot
,
ret
=
-
ENODEV
;
int
slot
,
ret
=
-
ENODEV
;
struct
net_local
*
lp
=
dev
->
priv
;
struct
net_local
*
lp
=
netdev_priv
(
dev
)
;
#ifndef CONFIG_X86_PC9800
#ifndef CONFIG_X86_PC9800
if
(
!
request_region
(
ioaddr
,
AT1700_IO_EXTENT
,
dev
->
name
))
if
(
!
request_region
(
ioaddr
,
AT1700_IO_EXTENT
,
dev
->
name
))
...
@@ -618,7 +618,7 @@ static int __init read_eeprom(long ioaddr, int location)
...
@@ -618,7 +618,7 @@ static int __init read_eeprom(long ioaddr, int location)
static
int
net_open
(
struct
net_device
*
dev
)
static
int
net_open
(
struct
net_device
*
dev
)
{
{
struct
net_local
*
lp
=
(
struct
net_local
*
)
dev
->
priv
;
struct
net_local
*
lp
=
netdev_priv
(
dev
)
;
int
ioaddr
=
dev
->
base_addr
;
int
ioaddr
=
dev
->
base_addr
;
/* Set the configuration register 0 to 32K 100ns. byte-wide memory, 16 bit
/* Set the configuration register 0 to 32K 100ns. byte-wide memory, 16 bit
...
@@ -649,7 +649,7 @@ static int net_open(struct net_device *dev)
...
@@ -649,7 +649,7 @@ static int net_open(struct net_device *dev)
static
void
net_tx_timeout
(
struct
net_device
*
dev
)
static
void
net_tx_timeout
(
struct
net_device
*
dev
)
{
{
struct
net_local
*
lp
=
(
struct
net_local
*
)
dev
->
priv
;
struct
net_local
*
lp
=
netdev_priv
(
dev
)
;
int
ioaddr
=
dev
->
base_addr
;
int
ioaddr
=
dev
->
base_addr
;
printk
(
"%s: transmit timed out with status %04x, %s?
\n
"
,
dev
->
name
,
printk
(
"%s: transmit timed out with status %04x, %s?
\n
"
,
dev
->
name
,
...
@@ -683,7 +683,7 @@ static void net_tx_timeout (struct net_device *dev)
...
@@ -683,7 +683,7 @@ static void net_tx_timeout (struct net_device *dev)
static
int
net_send_packet
(
struct
sk_buff
*
skb
,
struct
net_device
*
dev
)
static
int
net_send_packet
(
struct
sk_buff
*
skb
,
struct
net_device
*
dev
)
{
{
struct
net_local
*
lp
=
(
struct
net_local
*
)
dev
->
priv
;
struct
net_local
*
lp
=
netdev_priv
(
dev
)
;
int
ioaddr
=
dev
->
base_addr
;
int
ioaddr
=
dev
->
base_addr
;
short
length
=
ETH_ZLEN
<
skb
->
len
?
skb
->
len
:
ETH_ZLEN
;
short
length
=
ETH_ZLEN
<
skb
->
len
?
skb
->
len
:
ETH_ZLEN
;
short
len
=
skb
->
len
;
short
len
=
skb
->
len
;
...
@@ -748,7 +748,7 @@ net_interrupt(int irq, void *dev_id, struct pt_regs *regs)
...
@@ -748,7 +748,7 @@ net_interrupt(int irq, void *dev_id, struct pt_regs *regs)
}
}
ioaddr
=
dev
->
base_addr
;
ioaddr
=
dev
->
base_addr
;
lp
=
(
struct
net_local
*
)
dev
->
priv
;
lp
=
netdev_priv
(
dev
)
;
spin_lock
(
&
lp
->
lock
);
spin_lock
(
&
lp
->
lock
);
...
@@ -808,7 +808,7 @@ net_interrupt(int irq, void *dev_id, struct pt_regs *regs)
...
@@ -808,7 +808,7 @@ net_interrupt(int irq, void *dev_id, struct pt_regs *regs)
static
void
static
void
net_rx
(
struct
net_device
*
dev
)
net_rx
(
struct
net_device
*
dev
)
{
{
struct
net_local
*
lp
=
(
struct
net_local
*
)
dev
->
priv
;
struct
net_local
*
lp
=
netdev_priv
(
dev
)
;
int
ioaddr
=
dev
->
base_addr
;
int
ioaddr
=
dev
->
base_addr
;
int
boguscount
=
5
;
int
boguscount
=
5
;
...
@@ -891,7 +891,7 @@ net_rx(struct net_device *dev)
...
@@ -891,7 +891,7 @@ net_rx(struct net_device *dev)
/* The inverse routine to net_open(). */
/* The inverse routine to net_open(). */
static
int
net_close
(
struct
net_device
*
dev
)
static
int
net_close
(
struct
net_device
*
dev
)
{
{
struct
net_local
*
lp
=
(
struct
net_local
*
)
dev
->
priv
;
struct
net_local
*
lp
=
netdev_priv
(
dev
)
;
int
ioaddr
=
dev
->
base_addr
;
int
ioaddr
=
dev
->
base_addr
;
netif_stop_queue
(
dev
);
netif_stop_queue
(
dev
);
...
@@ -919,7 +919,7 @@ static int net_close(struct net_device *dev)
...
@@ -919,7 +919,7 @@ static int net_close(struct net_device *dev)
static
struct
net_device_stats
*
static
struct
net_device_stats
*
net_get_stats
(
struct
net_device
*
dev
)
net_get_stats
(
struct
net_device
*
dev
)
{
{
struct
net_local
*
lp
=
(
struct
net_local
*
)
dev
->
priv
;
struct
net_local
*
lp
=
netdev_priv
(
dev
)
;
return
&
lp
->
stats
;
return
&
lp
->
stats
;
}
}
...
@@ -931,7 +931,7 @@ static void
...
@@ -931,7 +931,7 @@ static void
set_rx_mode
(
struct
net_device
*
dev
)
set_rx_mode
(
struct
net_device
*
dev
)
{
{
int
ioaddr
=
dev
->
base_addr
;
int
ioaddr
=
dev
->
base_addr
;
struct
net_local
*
lp
=
(
struct
net_local
*
)
dev
->
priv
;
struct
net_local
*
lp
=
netdev_priv
(
dev
)
;
unsigned
char
mc_filter
[
8
];
/* Multicast hash filter */
unsigned
char
mc_filter
[
8
];
/* Multicast hash filter */
unsigned
long
flags
;
unsigned
long
flags
;
int
i
;
int
i
;
...
...
drivers/net/atari_bionet.c
View file @
e07b9e8f
...
@@ -408,7 +408,7 @@ struct net_device * __init bionet_probe(int unit)
...
@@ -408,7 +408,7 @@ struct net_device * __init bionet_probe(int unit)
*/
*/
static
int
static
int
bionet_open
(
struct
net_device
*
dev
)
{
bionet_open
(
struct
net_device
*
dev
)
{
struct
net_local
*
lp
=
(
struct
net_local
*
)
dev
->
priv
;
struct
net_local
*
lp
=
netdev_priv
(
dev
)
;
if
(
bionet_debug
>
0
)
if
(
bionet_debug
>
0
)
printk
(
"bionet_open
\n
"
);
printk
(
"bionet_open
\n
"
);
...
@@ -433,7 +433,7 @@ bionet_open(struct net_device *dev) {
...
@@ -433,7 +433,7 @@ bionet_open(struct net_device *dev) {
static
int
static
int
bionet_send_packet
(
struct
sk_buff
*
skb
,
struct
net_device
*
dev
)
{
bionet_send_packet
(
struct
sk_buff
*
skb
,
struct
net_device
*
dev
)
{
struct
net_local
*
lp
=
(
struct
net_local
*
)
dev
->
priv
;
struct
net_local
*
lp
=
netdev_priv
(
dev
)
;
unsigned
long
flags
;
unsigned
long
flags
;
/* Block a timer-based transmit from overlapping. This could better be
/* Block a timer-based transmit from overlapping. This could better be
...
@@ -499,7 +499,7 @@ bionet_send_packet(struct sk_buff *skb, struct net_device *dev) {
...
@@ -499,7 +499,7 @@ bionet_send_packet(struct sk_buff *skb, struct net_device *dev) {
*/
*/
static
void
static
void
bionet_poll_rx
(
struct
net_device
*
dev
)
{
bionet_poll_rx
(
struct
net_device
*
dev
)
{
struct
net_local
*
lp
=
(
struct
net_local
*
)
dev
->
priv
;
struct
net_local
*
lp
=
netdev_priv
(
dev
)
;
int
boguscount
=
10
;
int
boguscount
=
10
;
int
pkt_len
,
status
;
int
pkt_len
,
status
;
unsigned
long
flags
;
unsigned
long
flags
;
...
@@ -601,7 +601,7 @@ bionet_poll_rx(struct net_device *dev) {
...
@@ -601,7 +601,7 @@ bionet_poll_rx(struct net_device *dev) {
static
void
static
void
bionet_tick
(
unsigned
long
data
)
{
bionet_tick
(
unsigned
long
data
)
{
struct
net_device
*
dev
=
(
struct
net_device
*
)
data
;
struct
net_device
*
dev
=
(
struct
net_device
*
)
data
;
struct
net_local
*
lp
=
(
struct
net_local
*
)
dev
->
priv
;
struct
net_local
*
lp
=
netdev_priv
(
dev
)
;
if
(
bionet_debug
>
0
&&
(
lp
->
open_time
++
&
7
)
==
8
)
if
(
bionet_debug
>
0
&&
(
lp
->
open_time
++
&
7
)
==
8
)
printk
(
"bionet_tick: %ld
\n
"
,
lp
->
open_time
);
printk
(
"bionet_tick: %ld
\n
"
,
lp
->
open_time
);
...
@@ -616,7 +616,7 @@ bionet_tick(unsigned long data) {
...
@@ -616,7 +616,7 @@ bionet_tick(unsigned long data) {
*/
*/
static
int
static
int
bionet_close
(
struct
net_device
*
dev
)
{
bionet_close
(
struct
net_device
*
dev
)
{
struct
net_local
*
lp
=
(
struct
net_local
*
)
dev
->
priv
;
struct
net_local
*
lp
=
netdev_priv
(
dev
)
;
if
(
bionet_debug
>
0
)
if
(
bionet_debug
>
0
)
printk
(
"bionet_close, open_time=%ld
\n
"
,
lp
->
open_time
);
printk
(
"bionet_close, open_time=%ld
\n
"
,
lp
->
open_time
);
...
@@ -638,7 +638,7 @@ bionet_close(struct net_device *dev) {
...
@@ -638,7 +638,7 @@ bionet_close(struct net_device *dev) {
*/
*/
static
struct
net_device_stats
*
net_get_stats
(
struct
net_device
*
dev
)
static
struct
net_device_stats
*
net_get_stats
(
struct
net_device
*
dev
)
{
{
struct
net_local
*
lp
=
(
struct
net_local
*
)
dev
->
priv
;
struct
net_local
*
lp
=
netdev_priv
(
dev
)
;
return
&
lp
->
stats
;
return
&
lp
->
stats
;
}
}
...
...
drivers/net/atp.c
View file @
e07b9e8f
...
@@ -335,7 +335,7 @@ static int __init atp_probe1(long ioaddr)
...
@@ -335,7 +335,7 @@ static int __init atp_probe1(long ioaddr)
/* Reset the ethernet hardware and activate the printer pass-through. */
/* Reset the ethernet hardware and activate the printer pass-through. */
write_reg_high
(
ioaddr
,
CMR1
,
CMR1h_RESET
|
CMR1h_MUX
);
write_reg_high
(
ioaddr
,
CMR1
,
CMR1h_RESET
|
CMR1h_MUX
);
lp
=
(
struct
net_local
*
)
dev
->
priv
;
lp
=
netdev_priv
(
dev
)
;
lp
->
chip_type
=
RTL8002
;
lp
->
chip_type
=
RTL8002
;
lp
->
addr_mode
=
CMR2h_Normal
;
lp
->
addr_mode
=
CMR2h_Normal
;
spin_lock_init
(
&
lp
->
lock
);
spin_lock_init
(
&
lp
->
lock
);
...
@@ -432,7 +432,7 @@ static unsigned short __init eeprom_op(long ioaddr, u32 cmd)
...
@@ -432,7 +432,7 @@ static unsigned short __init eeprom_op(long ioaddr, u32 cmd)
*/
*/
static
int
net_open
(
struct
net_device
*
dev
)
static
int
net_open
(
struct
net_device
*
dev
)
{
{
struct
net_local
*
lp
=
(
struct
net_local
*
)
dev
->
priv
;
struct
net_local
*
lp
=
netdev_priv
(
dev
)
;
int
ret
;
int
ret
;
/* The interrupt line is turned off (tri-stated) when the device isn't in
/* The interrupt line is turned off (tri-stated) when the device isn't in
...
@@ -458,7 +458,7 @@ static int net_open(struct net_device *dev)
...
@@ -458,7 +458,7 @@ static int net_open(struct net_device *dev)
the hardware may have been temporarily detached. */
the hardware may have been temporarily detached. */
static
void
hardware_init
(
struct
net_device
*
dev
)
static
void
hardware_init
(
struct
net_device
*
dev
)
{
{
struct
net_local
*
lp
=
(
struct
net_local
*
)
dev
->
priv
;
struct
net_local
*
lp
=
netdev_priv
(
dev
)
;
long
ioaddr
=
dev
->
base_addr
;
long
ioaddr
=
dev
->
base_addr
;
int
i
;
int
i
;
...
@@ -541,7 +541,7 @@ static void write_packet(long ioaddr, int length, unsigned char *packet, int pad
...
@@ -541,7 +541,7 @@ static void write_packet(long ioaddr, int length, unsigned char *packet, int pad
static
void
tx_timeout
(
struct
net_device
*
dev
)
static
void
tx_timeout
(
struct
net_device
*
dev
)
{
{
struct
net_local
*
np
=
(
struct
net_local
*
)
dev
->
priv
;
struct
net_local
*
np
=
netdev_priv
(
dev
)
;
long
ioaddr
=
dev
->
base_addr
;
long
ioaddr
=
dev
->
base_addr
;
printk
(
KERN_WARNING
"%s: Transmit timed out, %s?
\n
"
,
dev
->
name
,
printk
(
KERN_WARNING
"%s: Transmit timed out, %s?
\n
"
,
dev
->
name
,
...
@@ -557,7 +557,7 @@ static void tx_timeout(struct net_device *dev)
...
@@ -557,7 +557,7 @@ static void tx_timeout(struct net_device *dev)
static
int
atp_send_packet
(
struct
sk_buff
*
skb
,
struct
net_device
*
dev
)
static
int
atp_send_packet
(
struct
sk_buff
*
skb
,
struct
net_device
*
dev
)
{
{
struct
net_local
*
lp
=
(
struct
net_local
*
)
dev
->
priv
;
struct
net_local
*
lp
=
netdev_priv
(
dev
)
;
long
ioaddr
=
dev
->
base_addr
;
long
ioaddr
=
dev
->
base_addr
;
int
length
;
int
length
;
unsigned
long
flags
;
unsigned
long
flags
;
...
@@ -611,7 +611,7 @@ atp_interrupt(int irq, void *dev_instance, struct pt_regs * regs)
...
@@ -611,7 +611,7 @@ atp_interrupt(int irq, void *dev_instance, struct pt_regs * regs)
return
IRQ_NONE
;
return
IRQ_NONE
;
}
}
ioaddr
=
dev
->
base_addr
;
ioaddr
=
dev
->
base_addr
;
lp
=
(
struct
net_local
*
)
dev
->
priv
;
lp
=
netdev_priv
(
dev
)
;
spin_lock
(
&
lp
->
lock
);
spin_lock
(
&
lp
->
lock
);
...
@@ -726,7 +726,7 @@ static void atp_timed_checker(unsigned long data)
...
@@ -726,7 +726,7 @@ static void atp_timed_checker(unsigned long data)
{
{
struct
net_device
*
dev
=
(
struct
net_device
*
)
data
;
struct
net_device
*
dev
=
(
struct
net_device
*
)
data
;
long
ioaddr
=
dev
->
base_addr
;
long
ioaddr
=
dev
->
base_addr
;
struct
net_local
*
lp
=
(
struct
net_local
*
)
dev
->
priv
;
struct
net_local
*
lp
=
netdev_priv
(
dev
)
;
int
tickssofar
=
jiffies
-
lp
->
last_rx_time
;
int
tickssofar
=
jiffies
-
lp
->
last_rx_time
;
int
i
;
int
i
;
...
@@ -740,7 +740,7 @@ static void atp_timed_checker(unsigned long data)
...
@@ -740,7 +740,7 @@ static void atp_timed_checker(unsigned long data)
for
(
i
=
0
;
i
<
6
;
i
++
)
for
(
i
=
0
;
i
<
6
;
i
++
)
if
(
read_cmd_byte
(
ioaddr
,
PAR0
+
i
)
!=
atp_timed_dev
->
dev_addr
[
i
])
if
(
read_cmd_byte
(
ioaddr
,
PAR0
+
i
)
!=
atp_timed_dev
->
dev_addr
[
i
])
{
{
struct
net_local
*
lp
=
(
struct
net_local
*
)
atp_timed_dev
->
priv
;
struct
net_local
*
lp
=
netdev_priv
(
atp_timed_dev
)
;
write_reg_byte
(
ioaddr
,
PAR0
+
i
,
atp_timed_dev
->
dev_addr
[
i
]);
write_reg_byte
(
ioaddr
,
PAR0
+
i
,
atp_timed_dev
->
dev_addr
[
i
]);
if
(
i
==
2
)
if
(
i
==
2
)
lp
->
stats
.
tx_errors
++
;
lp
->
stats
.
tx_errors
++
;
...
@@ -762,7 +762,7 @@ static void atp_timed_checker(unsigned long data)
...
@@ -762,7 +762,7 @@ static void atp_timed_checker(unsigned long data)
/* We have a good packet(s), get it/them out of the buffers. */
/* We have a good packet(s), get it/them out of the buffers. */
static
void
net_rx
(
struct
net_device
*
dev
)
static
void
net_rx
(
struct
net_device
*
dev
)
{
{
struct
net_local
*
lp
=
(
struct
net_local
*
)
dev
->
priv
;
struct
net_local
*
lp
=
netdev_priv
(
dev
)
;
long
ioaddr
=
dev
->
base_addr
;
long
ioaddr
=
dev
->
base_addr
;
struct
rx_header
rx_head
;
struct
rx_header
rx_head
;
...
@@ -838,7 +838,7 @@ static void read_block(long ioaddr, int length, unsigned char *p, int data_mode)
...
@@ -838,7 +838,7 @@ static void read_block(long ioaddr, int length, unsigned char *p, int data_mode)
static
int
static
int
net_close
(
struct
net_device
*
dev
)
net_close
(
struct
net_device
*
dev
)
{
{
struct
net_local
*
lp
=
(
struct
net_local
*
)
dev
->
priv
;
struct
net_local
*
lp
=
netdev_priv
(
dev
)
;
long
ioaddr
=
dev
->
base_addr
;
long
ioaddr
=
dev
->
base_addr
;
netif_stop_queue
(
dev
);
netif_stop_queue
(
dev
);
...
@@ -863,7 +863,7 @@ net_close(struct net_device *dev)
...
@@ -863,7 +863,7 @@ net_close(struct net_device *dev)
static
struct
net_device_stats
*
static
struct
net_device_stats
*
net_get_stats
(
struct
net_device
*
dev
)
net_get_stats
(
struct
net_device
*
dev
)
{
{
struct
net_local
*
lp
=
(
struct
net_local
*
)
dev
->
priv
;
struct
net_local
*
lp
=
netdev_priv
(
dev
)
;
return
&
lp
->
stats
;
return
&
lp
->
stats
;
}
}
...
@@ -873,7 +873,7 @@ net_get_stats(struct net_device *dev)
...
@@ -873,7 +873,7 @@ net_get_stats(struct net_device *dev)
static
void
set_rx_mode_8002
(
struct
net_device
*
dev
)
static
void
set_rx_mode_8002
(
struct
net_device
*
dev
)
{
{
struct
net_local
*
lp
=
(
struct
net_local
*
)
dev
->
priv
;
struct
net_local
*
lp
=
netdev_priv
(
dev
)
;
long
ioaddr
=
dev
->
base_addr
;
long
ioaddr
=
dev
->
base_addr
;
if
(
dev
->
mc_count
>
0
||
(
dev
->
flags
&
(
IFF_ALLMULTI
|
IFF_PROMISC
)))
{
if
(
dev
->
mc_count
>
0
||
(
dev
->
flags
&
(
IFF_ALLMULTI
|
IFF_PROMISC
)))
{
...
@@ -890,7 +890,7 @@ static void set_rx_mode_8002(struct net_device *dev)
...
@@ -890,7 +890,7 @@ static void set_rx_mode_8002(struct net_device *dev)
static
void
set_rx_mode_8012
(
struct
net_device
*
dev
)
static
void
set_rx_mode_8012
(
struct
net_device
*
dev
)
{
{
struct
net_local
*
lp
=
(
struct
net_local
*
)
dev
->
priv
;
struct
net_local
*
lp
=
netdev_priv
(
dev
)
;
long
ioaddr
=
dev
->
base_addr
;
long
ioaddr
=
dev
->
base_addr
;
unsigned
char
new_mode
,
mc_filter
[
8
];
/* Multicast hash filter */
unsigned
char
new_mode
,
mc_filter
[
8
];
/* Multicast hash filter */
int
i
;
int
i
;
...
...
drivers/net/bmac.c
View file @
e07b9e8f
...
@@ -226,7 +226,7 @@ volatile unsigned short bmread(struct net_device *dev, unsigned long reg_offset
...
@@ -226,7 +226,7 @@ volatile unsigned short bmread(struct net_device *dev, unsigned long reg_offset
static
void
static
void
bmac_enable_and_reset_chip
(
struct
net_device
*
dev
)
bmac_enable_and_reset_chip
(
struct
net_device
*
dev
)
{
{
struct
bmac_data
*
bp
=
(
struct
bmac_data
*
)
dev
->
priv
;
struct
bmac_data
*
bp
=
netdev_priv
(
dev
)
;
volatile
struct
dbdma_regs
*
rd
=
bp
->
rx_dma
;
volatile
struct
dbdma_regs
*
rd
=
bp
->
rx_dma
;
volatile
struct
dbdma_regs
*
td
=
bp
->
tx_dma
;
volatile
struct
dbdma_regs
*
td
=
bp
->
tx_dma
;
...
@@ -310,7 +310,7 @@ bmac_mif_write(struct net_device *dev, unsigned int addr, unsigned int val)
...
@@ -310,7 +310,7 @@ bmac_mif_write(struct net_device *dev, unsigned int addr, unsigned int val)
static
void
static
void
bmac_init_registers
(
struct
net_device
*
dev
)
bmac_init_registers
(
struct
net_device
*
dev
)
{
{
struct
bmac_data
*
bp
=
(
struct
bmac_data
*
)
dev
->
priv
;
struct
bmac_data
*
bp
=
netdev_priv
(
dev
)
;
volatile
unsigned
short
regValue
;
volatile
unsigned
short
regValue
;
unsigned
short
*
pWord16
;
unsigned
short
*
pWord16
;
int
i
;
int
i
;
...
@@ -405,7 +405,7 @@ bmac_enable_interrupts(struct net_device *dev)
...
@@ -405,7 +405,7 @@ bmac_enable_interrupts(struct net_device *dev)
static
void
static
void
bmac_start_chip
(
struct
net_device
*
dev
)
bmac_start_chip
(
struct
net_device
*
dev
)
{
{
struct
bmac_data
*
bp
=
(
struct
bmac_data
*
)
dev
->
priv
;
struct
bmac_data
*
bp
=
netdev_priv
(
dev
)
;
volatile
struct
dbdma_regs
*
rd
=
bp
->
rx_dma
;
volatile
struct
dbdma_regs
*
rd
=
bp
->
rx_dma
;
unsigned
short
oldConfig
;
unsigned
short
oldConfig
;
...
@@ -425,7 +425,7 @@ static void
...
@@ -425,7 +425,7 @@ static void
bmac_init_phy
(
struct
net_device
*
dev
)
bmac_init_phy
(
struct
net_device
*
dev
)
{
{
unsigned
int
addr
;
unsigned
int
addr
;
struct
bmac_data
*
bp
=
(
struct
bmac_data
*
)
dev
->
priv
;
struct
bmac_data
*
bp
=
netdev_priv
(
dev
)
;
printk
(
KERN_DEBUG
"phy registers:"
);
printk
(
KERN_DEBUG
"phy registers:"
);
for
(
addr
=
0
;
addr
<
32
;
++
addr
)
{
for
(
addr
=
0
;
addr
<
32
;
++
addr
)
{
...
@@ -458,7 +458,7 @@ static void bmac_init_chip(struct net_device *dev)
...
@@ -458,7 +458,7 @@ static void bmac_init_chip(struct net_device *dev)
static
int
bmac_suspend
(
struct
macio_dev
*
mdev
,
u32
state
)
static
int
bmac_suspend
(
struct
macio_dev
*
mdev
,
u32
state
)
{
{
struct
net_device
*
dev
=
macio_get_drvdata
(
mdev
);
struct
net_device
*
dev
=
macio_get_drvdata
(
mdev
);
struct
bmac_data
*
bp
=
dev
->
priv
;
struct
bmac_data
*
bp
=
netdev_priv
(
dev
);
unsigned
long
flags
;
unsigned
long
flags
;
unsigned
short
config
;
unsigned
short
config
;
int
i
;
int
i
;
...
@@ -508,7 +508,7 @@ static int bmac_suspend(struct macio_dev *mdev, u32 state)
...
@@ -508,7 +508,7 @@ static int bmac_suspend(struct macio_dev *mdev, u32 state)
static
int
bmac_resume
(
struct
macio_dev
*
mdev
)
static
int
bmac_resume
(
struct
macio_dev
*
mdev
)
{
{
struct
net_device
*
dev
=
macio_get_drvdata
(
mdev
);
struct
net_device
*
dev
=
macio_get_drvdata
(
mdev
);
struct
bmac_data
*
bp
=
dev
->
priv
;
struct
bmac_data
*
bp
=
netdev_priv
(
dev
);
/* see if this is enough */
/* see if this is enough */
if
(
bp
->
opened
)
if
(
bp
->
opened
)
...
@@ -525,7 +525,7 @@ static int bmac_resume(struct macio_dev *mdev)
...
@@ -525,7 +525,7 @@ static int bmac_resume(struct macio_dev *mdev)
static
int
bmac_set_address
(
struct
net_device
*
dev
,
void
*
addr
)
static
int
bmac_set_address
(
struct
net_device
*
dev
,
void
*
addr
)
{
{
struct
bmac_data
*
bp
=
(
struct
bmac_data
*
)
dev
->
priv
;
struct
bmac_data
*
bp
=
netdev_priv
(
dev
)
;
unsigned
char
*
p
=
addr
;
unsigned
char
*
p
=
addr
;
unsigned
short
*
pWord16
;
unsigned
short
*
pWord16
;
unsigned
long
flags
;
unsigned
long
flags
;
...
@@ -550,7 +550,7 @@ static int bmac_set_address(struct net_device *dev, void *addr)
...
@@ -550,7 +550,7 @@ static int bmac_set_address(struct net_device *dev, void *addr)
static
inline
void
bmac_set_timeout
(
struct
net_device
*
dev
)
static
inline
void
bmac_set_timeout
(
struct
net_device
*
dev
)
{
{
struct
bmac_data
*
bp
=
(
struct
bmac_data
*
)
dev
->
priv
;
struct
bmac_data
*
bp
=
netdev_priv
(
dev
)
;
unsigned
long
flags
;
unsigned
long
flags
;
spin_lock_irqsave
(
&
bp
->
lock
,
flags
);
spin_lock_irqsave
(
&
bp
->
lock
,
flags
);
...
@@ -656,7 +656,7 @@ bmac_init_rx_ring(struct bmac_data *bp)
...
@@ -656,7 +656,7 @@ bmac_init_rx_ring(struct bmac_data *bp)
static
int
bmac_transmit_packet
(
struct
sk_buff
*
skb
,
struct
net_device
*
dev
)
static
int
bmac_transmit_packet
(
struct
sk_buff
*
skb
,
struct
net_device
*
dev
)
{
{
struct
bmac_data
*
bp
=
(
struct
bmac_data
*
)
dev
->
priv
;
struct
bmac_data
*
bp
=
netdev_priv
(
dev
)
;
volatile
struct
dbdma_regs
*
td
=
bp
->
tx_dma
;
volatile
struct
dbdma_regs
*
td
=
bp
->
tx_dma
;
int
i
;
int
i
;
...
@@ -692,7 +692,7 @@ static int rxintcount;
...
@@ -692,7 +692,7 @@ static int rxintcount;
static
irqreturn_t
bmac_rxdma_intr
(
int
irq
,
void
*
dev_id
,
struct
pt_regs
*
regs
)
static
irqreturn_t
bmac_rxdma_intr
(
int
irq
,
void
*
dev_id
,
struct
pt_regs
*
regs
)
{
{
struct
net_device
*
dev
=
(
struct
net_device
*
)
dev_id
;
struct
net_device
*
dev
=
(
struct
net_device
*
)
dev_id
;
struct
bmac_data
*
bp
=
(
struct
bmac_data
*
)
dev
->
priv
;
struct
bmac_data
*
bp
=
netdev_priv
(
dev
)
;
volatile
struct
dbdma_regs
*
rd
=
bp
->
rx_dma
;
volatile
struct
dbdma_regs
*
rd
=
bp
->
rx_dma
;
volatile
struct
dbdma_cmd
*
cp
;
volatile
struct
dbdma_cmd
*
cp
;
int
i
,
nb
,
stat
;
int
i
,
nb
,
stat
;
...
@@ -769,7 +769,7 @@ static int txintcount;
...
@@ -769,7 +769,7 @@ static int txintcount;
static
irqreturn_t
bmac_txdma_intr
(
int
irq
,
void
*
dev_id
,
struct
pt_regs
*
regs
)
static
irqreturn_t
bmac_txdma_intr
(
int
irq
,
void
*
dev_id
,
struct
pt_regs
*
regs
)
{
{
struct
net_device
*
dev
=
(
struct
net_device
*
)
dev_id
;
struct
net_device
*
dev
=
(
struct
net_device
*
)
dev_id
;
struct
bmac_data
*
bp
=
(
struct
bmac_data
*
)
dev
->
priv
;
struct
bmac_data
*
bp
=
netdev_priv
(
dev
)
;
volatile
struct
dbdma_cmd
*
cp
;
volatile
struct
dbdma_cmd
*
cp
;
int
stat
;
int
stat
;
unsigned
long
flags
;
unsigned
long
flags
;
...
@@ -822,7 +822,7 @@ static irqreturn_t bmac_txdma_intr(int irq, void *dev_id, struct pt_regs *regs)
...
@@ -822,7 +822,7 @@ static irqreturn_t bmac_txdma_intr(int irq, void *dev_id, struct pt_regs *regs)
static
struct
net_device_stats
*
bmac_stats
(
struct
net_device
*
dev
)
static
struct
net_device_stats
*
bmac_stats
(
struct
net_device
*
dev
)
{
{
struct
bmac_data
*
p
=
(
struct
bmac_data
*
)
dev
->
priv
;
struct
bmac_data
*
p
=
netdev_priv
(
dev
)
;
return
&
p
->
stats
;
return
&
p
->
stats
;
}
}
...
@@ -995,7 +995,7 @@ bmac_remove_multi(struct net_device *dev,
...
@@ -995,7 +995,7 @@ bmac_remove_multi(struct net_device *dev,
static
void
bmac_set_multicast
(
struct
net_device
*
dev
)
static
void
bmac_set_multicast
(
struct
net_device
*
dev
)
{
{
struct
dev_mc_list
*
dmi
;
struct
dev_mc_list
*
dmi
;
struct
bmac_data
*
bp
=
(
struct
bmac_data
*
)
dev
->
priv
;
struct
bmac_data
*
bp
=
netdev_priv
(
dev
)
;
int
num_addrs
=
dev
->
mc_count
;
int
num_addrs
=
dev
->
mc_count
;
unsigned
short
rx_cfg
;
unsigned
short
rx_cfg
;
int
i
;
int
i
;
...
@@ -1086,7 +1086,7 @@ static int miscintcount;
...
@@ -1086,7 +1086,7 @@ static int miscintcount;
static
irqreturn_t
bmac_misc_intr
(
int
irq
,
void
*
dev_id
,
struct
pt_regs
*
regs
)
static
irqreturn_t
bmac_misc_intr
(
int
irq
,
void
*
dev_id
,
struct
pt_regs
*
regs
)
{
{
struct
net_device
*
dev
=
(
struct
net_device
*
)
dev_id
;
struct
net_device
*
dev
=
(
struct
net_device
*
)
dev_id
;
struct
bmac_data
*
bp
=
(
struct
bmac_data
*
)
dev
->
priv
;
struct
bmac_data
*
bp
=
netdev_priv
(
dev
)
;
unsigned
int
status
=
bmread
(
dev
,
STATUS
);
unsigned
int
status
=
bmread
(
dev
,
STATUS
);
if
(
miscintcount
++
<
10
)
{
if
(
miscintcount
++
<
10
)
{
XXDEBUG
((
"bmac_misc_intr
\n
"
));
XXDEBUG
((
"bmac_misc_intr
\n
"
));
...
@@ -1232,7 +1232,7 @@ bmac_get_station_address(struct net_device *dev, unsigned char *ea)
...
@@ -1232,7 +1232,7 @@ bmac_get_station_address(struct net_device *dev, unsigned char *ea)
static
void
bmac_reset_and_enable
(
struct
net_device
*
dev
)
static
void
bmac_reset_and_enable
(
struct
net_device
*
dev
)
{
{
struct
bmac_data
*
bp
=
dev
->
priv
;
struct
bmac_data
*
bp
=
netdev_priv
(
dev
)
;
unsigned
long
flags
;
unsigned
long
flags
;
struct
sk_buff
*
skb
;
struct
sk_buff
*
skb
;
unsigned
char
*
data
;
unsigned
char
*
data
;
...
@@ -1288,7 +1288,7 @@ static int __devinit bmac_probe(struct macio_dev *mdev, const struct of_match *m
...
@@ -1288,7 +1288,7 @@ static int __devinit bmac_probe(struct macio_dev *mdev, const struct of_match *m
return
-
ENOMEM
;
return
-
ENOMEM
;
}
}
bp
=
(
struct
bmac_data
*
)
dev
->
priv
;
bp
=
netdev_priv
(
dev
)
;
SET_MODULE_OWNER
(
dev
);
SET_MODULE_OWNER
(
dev
);
SET_NETDEV_DEV
(
dev
,
&
mdev
->
ofdev
.
dev
);
SET_NETDEV_DEV
(
dev
,
&
mdev
->
ofdev
.
dev
);
macio_set_drvdata
(
mdev
,
dev
);
macio_set_drvdata
(
mdev
,
dev
);
...
@@ -1408,7 +1408,7 @@ static int __devinit bmac_probe(struct macio_dev *mdev, const struct of_match *m
...
@@ -1408,7 +1408,7 @@ static int __devinit bmac_probe(struct macio_dev *mdev, const struct of_match *m
static
int
bmac_open
(
struct
net_device
*
dev
)
static
int
bmac_open
(
struct
net_device
*
dev
)
{
{
struct
bmac_data
*
bp
=
(
struct
bmac_data
*
)
dev
->
priv
;
struct
bmac_data
*
bp
=
netdev_priv
(
dev
)
;
/* XXDEBUG(("bmac: enter open\n")); */
/* XXDEBUG(("bmac: enter open\n")); */
/* reset the chip */
/* reset the chip */
bp
->
opened
=
1
;
bp
->
opened
=
1
;
...
@@ -1420,7 +1420,7 @@ static int bmac_open(struct net_device *dev)
...
@@ -1420,7 +1420,7 @@ static int bmac_open(struct net_device *dev)
static
int
bmac_close
(
struct
net_device
*
dev
)
static
int
bmac_close
(
struct
net_device
*
dev
)
{
{
struct
bmac_data
*
bp
=
(
struct
bmac_data
*
)
dev
->
priv
;
struct
bmac_data
*
bp
=
netdev_priv
(
dev
)
;
volatile
struct
dbdma_regs
*
rd
=
bp
->
rx_dma
;
volatile
struct
dbdma_regs
*
rd
=
bp
->
rx_dma
;
volatile
struct
dbdma_regs
*
td
=
bp
->
tx_dma
;
volatile
struct
dbdma_regs
*
td
=
bp
->
tx_dma
;
unsigned
short
config
;
unsigned
short
config
;
...
@@ -1469,7 +1469,7 @@ static int bmac_close(struct net_device *dev)
...
@@ -1469,7 +1469,7 @@ static int bmac_close(struct net_device *dev)
static
void
static
void
bmac_start
(
struct
net_device
*
dev
)
bmac_start
(
struct
net_device
*
dev
)
{
{
struct
bmac_data
*
bp
=
dev
->
priv
;
struct
bmac_data
*
bp
=
netdev_priv
(
dev
)
;
int
i
;
int
i
;
struct
sk_buff
*
skb
;
struct
sk_buff
*
skb
;
unsigned
long
flags
;
unsigned
long
flags
;
...
@@ -1495,7 +1495,7 @@ bmac_start(struct net_device *dev)
...
@@ -1495,7 +1495,7 @@ bmac_start(struct net_device *dev)
static
int
static
int
bmac_output
(
struct
sk_buff
*
skb
,
struct
net_device
*
dev
)
bmac_output
(
struct
sk_buff
*
skb
,
struct
net_device
*
dev
)
{
{
struct
bmac_data
*
bp
=
dev
->
priv
;
struct
bmac_data
*
bp
=
netdev_priv
(
dev
)
;
skb_queue_tail
(
bp
->
queue
,
skb
);
skb_queue_tail
(
bp
->
queue
,
skb
);
bmac_start
(
dev
);
bmac_start
(
dev
);
return
0
;
return
0
;
...
@@ -1504,7 +1504,7 @@ bmac_output(struct sk_buff *skb, struct net_device *dev)
...
@@ -1504,7 +1504,7 @@ bmac_output(struct sk_buff *skb, struct net_device *dev)
static
void
bmac_tx_timeout
(
unsigned
long
data
)
static
void
bmac_tx_timeout
(
unsigned
long
data
)
{
{
struct
net_device
*
dev
=
(
struct
net_device
*
)
data
;
struct
net_device
*
dev
=
(
struct
net_device
*
)
data
;
struct
bmac_data
*
bp
=
(
struct
bmac_data
*
)
dev
->
priv
;
struct
bmac_data
*
bp
=
netdev_priv
(
dev
)
;
volatile
struct
dbdma_regs
*
td
=
bp
->
tx_dma
;
volatile
struct
dbdma_regs
*
td
=
bp
->
tx_dma
;
volatile
struct
dbdma_regs
*
rd
=
bp
->
rx_dma
;
volatile
struct
dbdma_regs
*
rd
=
bp
->
rx_dma
;
volatile
struct
dbdma_cmd
*
cp
;
volatile
struct
dbdma_cmd
*
cp
;
...
@@ -1630,7 +1630,7 @@ bmac_proc_info(char *buffer, char **start, off_t offset, int length)
...
@@ -1630,7 +1630,7 @@ bmac_proc_info(char *buffer, char **start, off_t offset, int length)
static
int
__devexit
bmac_remove
(
struct
macio_dev
*
mdev
)
static
int
__devexit
bmac_remove
(
struct
macio_dev
*
mdev
)
{
{
struct
net_device
*
dev
=
macio_get_drvdata
(
mdev
);
struct
net_device
*
dev
=
macio_get_drvdata
(
mdev
);
struct
bmac_data
*
bp
=
dev
->
priv
;
struct
bmac_data
*
bp
=
netdev_priv
(
dev
)
;
unregister_netdev
(
dev
);
unregister_netdev
(
dev
);
...
...
drivers/net/cs89x0.c
View file @
e07b9e8f
...
@@ -399,7 +399,7 @@ get_eeprom_cksum(int off, int len, int *buffer)
...
@@ -399,7 +399,7 @@ get_eeprom_cksum(int off, int len, int *buffer)
static
int
__init
static
int
__init
cs89x0_probe1
(
struct
net_device
*
dev
,
int
ioaddr
,
int
modular
)
cs89x0_probe1
(
struct
net_device
*
dev
,
int
ioaddr
,
int
modular
)
{
{
struct
net_local
*
lp
=
(
struct
net_local
*
)
dev
->
priv
;
struct
net_local
*
lp
=
netdev_priv
(
dev
)
;
static
unsigned
version_printed
;
static
unsigned
version_printed
;
int
i
;
int
i
;
unsigned
rev_type
=
0
;
unsigned
rev_type
=
0
;
...
@@ -735,7 +735,7 @@ printk("PP_addr=0x%x\n", inw(ioaddr + ADD_PORT));
...
@@ -735,7 +735,7 @@ printk("PP_addr=0x%x\n", inw(ioaddr + ADD_PORT));
static
void
static
void
get_dma_channel
(
struct
net_device
*
dev
)
get_dma_channel
(
struct
net_device
*
dev
)
{
{
struct
net_local
*
lp
=
(
struct
net_local
*
)
dev
->
priv
;
struct
net_local
*
lp
=
netdev_priv
(
dev
)
;
if
(
lp
->
dma
)
{
if
(
lp
->
dma
)
{
dev
->
dma
=
lp
->
dma
;
dev
->
dma
=
lp
->
dma
;
...
@@ -757,7 +757,7 @@ get_dma_channel(struct net_device *dev)
...
@@ -757,7 +757,7 @@ get_dma_channel(struct net_device *dev)
static
void
static
void
write_dma
(
struct
net_device
*
dev
,
int
chip_type
,
int
dma
)
write_dma
(
struct
net_device
*
dev
,
int
chip_type
,
int
dma
)
{
{
struct
net_local
*
lp
=
(
struct
net_local
*
)
dev
->
priv
;
struct
net_local
*
lp
=
netdev_priv
(
dev
)
;
if
((
lp
->
isa_config
&
ANY_ISA_DMA
)
==
0
)
if
((
lp
->
isa_config
&
ANY_ISA_DMA
)
==
0
)
return
;
return
;
if
(
chip_type
==
CS8900
)
{
if
(
chip_type
==
CS8900
)
{
...
@@ -770,7 +770,7 @@ write_dma(struct net_device *dev, int chip_type, int dma)
...
@@ -770,7 +770,7 @@ write_dma(struct net_device *dev, int chip_type, int dma)
static
void
static
void
set_dma_cfg
(
struct
net_device
*
dev
)
set_dma_cfg
(
struct
net_device
*
dev
)
{
{
struct
net_local
*
lp
=
(
struct
net_local
*
)
dev
->
priv
;
struct
net_local
*
lp
=
netdev_priv
(
dev
)
;
if
(
lp
->
use_dma
)
{
if
(
lp
->
use_dma
)
{
if
((
lp
->
isa_config
&
ANY_ISA_DMA
)
==
0
)
{
if
((
lp
->
isa_config
&
ANY_ISA_DMA
)
==
0
)
{
...
@@ -793,7 +793,7 @@ set_dma_cfg(struct net_device *dev)
...
@@ -793,7 +793,7 @@ set_dma_cfg(struct net_device *dev)
static
int
static
int
dma_bufcfg
(
struct
net_device
*
dev
)
dma_bufcfg
(
struct
net_device
*
dev
)
{
{
struct
net_local
*
lp
=
(
struct
net_local
*
)
dev
->
priv
;
struct
net_local
*
lp
=
netdev_priv
(
dev
)
;
if
(
lp
->
use_dma
)
if
(
lp
->
use_dma
)
return
(
lp
->
isa_config
&
ANY_ISA_DMA
)
?
RX_DMA_ENBL
:
0
;
return
(
lp
->
isa_config
&
ANY_ISA_DMA
)
?
RX_DMA_ENBL
:
0
;
else
else
...
@@ -804,7 +804,7 @@ static int
...
@@ -804,7 +804,7 @@ static int
dma_busctl
(
struct
net_device
*
dev
)
dma_busctl
(
struct
net_device
*
dev
)
{
{
int
retval
=
0
;
int
retval
=
0
;
struct
net_local
*
lp
=
(
struct
net_local
*
)
dev
->
priv
;
struct
net_local
*
lp
=
netdev_priv
(
dev
)
;
if
(
lp
->
use_dma
)
{
if
(
lp
->
use_dma
)
{
if
(
lp
->
isa_config
&
ANY_ISA_DMA
)
if
(
lp
->
isa_config
&
ANY_ISA_DMA
)
retval
|=
RESET_RX_DMA
;
/* Reset the DMA pointer */
retval
|=
RESET_RX_DMA
;
/* Reset the DMA pointer */
...
@@ -820,7 +820,7 @@ dma_busctl(struct net_device *dev)
...
@@ -820,7 +820,7 @@ dma_busctl(struct net_device *dev)
static
void
static
void
dma_rx
(
struct
net_device
*
dev
)
dma_rx
(
struct
net_device
*
dev
)
{
{
struct
net_local
*
lp
=
(
struct
net_local
*
)
dev
->
priv
;
struct
net_local
*
lp
=
netdev_priv
(
dev
)
;
struct
sk_buff
*
skb
;
struct
sk_buff
*
skb
;
int
status
,
length
;
int
status
,
length
;
unsigned
char
*
bp
=
lp
->
rx_dma_ptr
;
unsigned
char
*
bp
=
lp
->
rx_dma_ptr
;
...
@@ -882,7 +882,7 @@ dma_rx(struct net_device *dev)
...
@@ -882,7 +882,7 @@ dma_rx(struct net_device *dev)
void
__init
reset_chip
(
struct
net_device
*
dev
)
void
__init
reset_chip
(
struct
net_device
*
dev
)
{
{
struct
net_local
*
lp
=
(
struct
net_local
*
)
dev
->
priv
;
struct
net_local
*
lp
=
netdev_priv
(
dev
)
;
int
ioaddr
=
dev
->
base_addr
;
int
ioaddr
=
dev
->
base_addr
;
int
reset_start_time
;
int
reset_start_time
;
...
@@ -912,7 +912,7 @@ void __init reset_chip(struct net_device *dev)
...
@@ -912,7 +912,7 @@ void __init reset_chip(struct net_device *dev)
static
void
static
void
control_dc_dc
(
struct
net_device
*
dev
,
int
on_not_off
)
control_dc_dc
(
struct
net_device
*
dev
,
int
on_not_off
)
{
{
struct
net_local
*
lp
=
(
struct
net_local
*
)
dev
->
priv
;
struct
net_local
*
lp
=
netdev_priv
(
dev
)
;
unsigned
int
selfcontrol
;
unsigned
int
selfcontrol
;
int
timenow
=
jiffies
;
int
timenow
=
jiffies
;
/* control the DC to DC convertor in the SelfControl register.
/* control the DC to DC convertor in the SelfControl register.
...
@@ -940,7 +940,7 @@ control_dc_dc(struct net_device *dev, int on_not_off)
...
@@ -940,7 +940,7 @@ control_dc_dc(struct net_device *dev, int on_not_off)
static
int
static
int
detect_tp
(
struct
net_device
*
dev
)
detect_tp
(
struct
net_device
*
dev
)
{
{
struct
net_local
*
lp
=
(
struct
net_local
*
)
dev
->
priv
;
struct
net_local
*
lp
=
netdev_priv
(
dev
)
;
int
timenow
=
jiffies
;
int
timenow
=
jiffies
;
int
fdx
;
int
fdx
;
...
@@ -1055,7 +1055,7 @@ send_test_pkt(struct net_device *dev)
...
@@ -1055,7 +1055,7 @@ send_test_pkt(struct net_device *dev)
static
int
static
int
detect_aui
(
struct
net_device
*
dev
)
detect_aui
(
struct
net_device
*
dev
)
{
{
struct
net_local
*
lp
=
(
struct
net_local
*
)
dev
->
priv
;
struct
net_local
*
lp
=
netdev_priv
(
dev
)
;
if
(
net_debug
>
1
)
printk
(
"%s: Attempting AUI
\n
"
,
dev
->
name
);
if
(
net_debug
>
1
)
printk
(
"%s: Attempting AUI
\n
"
,
dev
->
name
);
control_dc_dc
(
dev
,
0
);
control_dc_dc
(
dev
,
0
);
...
@@ -1071,7 +1071,7 @@ detect_aui(struct net_device *dev)
...
@@ -1071,7 +1071,7 @@ detect_aui(struct net_device *dev)
static
int
static
int
detect_bnc
(
struct
net_device
*
dev
)
detect_bnc
(
struct
net_device
*
dev
)
{
{
struct
net_local
*
lp
=
(
struct
net_local
*
)
dev
->
priv
;
struct
net_local
*
lp
=
netdev_priv
(
dev
)
;
if
(
net_debug
>
1
)
printk
(
"%s: Attempting BNC
\n
"
,
dev
->
name
);
if
(
net_debug
>
1
)
printk
(
"%s: Attempting BNC
\n
"
,
dev
->
name
);
control_dc_dc
(
dev
,
1
);
control_dc_dc
(
dev
,
1
);
...
@@ -1117,7 +1117,7 @@ write_irq(struct net_device *dev, int chip_type, int irq)
...
@@ -1117,7 +1117,7 @@ write_irq(struct net_device *dev, int chip_type, int irq)
static
int
static
int
net_open
(
struct
net_device
*
dev
)
net_open
(
struct
net_device
*
dev
)
{
{
struct
net_local
*
lp
=
(
struct
net_local
*
)
dev
->
priv
;
struct
net_local
*
lp
=
netdev_priv
(
dev
)
;
int
result
=
0
;
int
result
=
0
;
int
i
;
int
i
;
int
ret
;
int
ret
;
...
@@ -1358,7 +1358,7 @@ static void net_timeout(struct net_device *dev)
...
@@ -1358,7 +1358,7 @@ static void net_timeout(struct net_device *dev)
static
int
net_send_packet
(
struct
sk_buff
*
skb
,
struct
net_device
*
dev
)
static
int
net_send_packet
(
struct
sk_buff
*
skb
,
struct
net_device
*
dev
)
{
{
struct
net_local
*
lp
=
(
struct
net_local
*
)
dev
->
priv
;
struct
net_local
*
lp
=
netdev_priv
(
dev
)
;
if
(
net_debug
>
3
)
{
if
(
net_debug
>
3
)
{
printk
(
"%s: sent %d byte packet of type %x
\n
"
,
printk
(
"%s: sent %d byte packet of type %x
\n
"
,
...
@@ -1419,7 +1419,7 @@ static irqreturn_t net_interrupt(int irq, void *dev_id, struct pt_regs * regs)
...
@@ -1419,7 +1419,7 @@ static irqreturn_t net_interrupt(int irq, void *dev_id, struct pt_regs * regs)
int
handled
=
0
;
int
handled
=
0
;
ioaddr
=
dev
->
base_addr
;
ioaddr
=
dev
->
base_addr
;
lp
=
(
struct
net_local
*
)
dev
->
priv
;
lp
=
netdev_priv
(
dev
)
;
/* we MUST read all the events out of the ISQ, otherwise we'll never
/* we MUST read all the events out of the ISQ, otherwise we'll never
get interrupted again. As a consequence, we can't have any limit
get interrupted again. As a consequence, we can't have any limit
...
@@ -1517,7 +1517,7 @@ count_rx_errors(int status, struct net_local *lp)
...
@@ -1517,7 +1517,7 @@ count_rx_errors(int status, struct net_local *lp)
static
void
static
void
net_rx
(
struct
net_device
*
dev
)
net_rx
(
struct
net_device
*
dev
)
{
{
struct
net_local
*
lp
=
(
struct
net_local
*
)
dev
->
priv
;
struct
net_local
*
lp
=
netdev_priv
(
dev
)
;
struct
sk_buff
*
skb
;
struct
sk_buff
*
skb
;
int
status
,
length
;
int
status
,
length
;
...
@@ -1573,7 +1573,7 @@ static void release_dma_buff(struct net_local *lp)
...
@@ -1573,7 +1573,7 @@ static void release_dma_buff(struct net_local *lp)
static
int
static
int
net_close
(
struct
net_device
*
dev
)
net_close
(
struct
net_device
*
dev
)
{
{
struct
net_local
*
lp
=
(
struct
net_local
*
)
dev
->
priv
;
struct
net_local
*
lp
=
netdev_priv
(
dev
)
;
netif_stop_queue
(
dev
);
netif_stop_queue
(
dev
);
...
@@ -1600,7 +1600,7 @@ net_close(struct net_device *dev)
...
@@ -1600,7 +1600,7 @@ net_close(struct net_device *dev)
static
struct
net_device_stats
*
static
struct
net_device_stats
*
net_get_stats
(
struct
net_device
*
dev
)
net_get_stats
(
struct
net_device
*
dev
)
{
{
struct
net_local
*
lp
=
(
struct
net_local
*
)
dev
->
priv
;
struct
net_local
*
lp
=
netdev_priv
(
dev
)
;
unsigned
long
flags
;
unsigned
long
flags
;
spin_lock_irqsave
(
&
lp
->
lock
,
flags
);
spin_lock_irqsave
(
&
lp
->
lock
,
flags
);
...
@@ -1614,7 +1614,7 @@ net_get_stats(struct net_device *dev)
...
@@ -1614,7 +1614,7 @@ net_get_stats(struct net_device *dev)
static
void
set_multicast_list
(
struct
net_device
*
dev
)
static
void
set_multicast_list
(
struct
net_device
*
dev
)
{
{
struct
net_local
*
lp
=
(
struct
net_local
*
)
dev
->
priv
;
struct
net_local
*
lp
=
netdev_priv
(
dev
)
;
unsigned
long
flags
;
unsigned
long
flags
;
spin_lock_irqsave
(
&
lp
->
lock
,
flags
);
spin_lock_irqsave
(
&
lp
->
lock
,
flags
);
...
@@ -1758,7 +1758,7 @@ init_module(void)
...
@@ -1758,7 +1758,7 @@ init_module(void)
dev
->
irq
=
irq
;
dev
->
irq
=
irq
;
dev
->
base_addr
=
io
;
dev
->
base_addr
=
io
;
lp
=
dev
->
priv
;
lp
=
netdev_priv
(
dev
)
;
#if ALLOW_DMA
#if ALLOW_DMA
if
(
use_dma
)
{
if
(
use_dma
)
{
...
...
drivers/net/eth16i.c
View file @
e07b9e8f
...
@@ -486,7 +486,7 @@ struct net_device * __init eth16i_probe(int unit)
...
@@ -486,7 +486,7 @@ struct net_device * __init eth16i_probe(int unit)
static
int
__init
eth16i_probe1
(
struct
net_device
*
dev
,
int
ioaddr
)
static
int
__init
eth16i_probe1
(
struct
net_device
*
dev
,
int
ioaddr
)
{
{
struct
eth16i_local
*
lp
=
dev
->
priv
;
struct
eth16i_local
*
lp
=
netdev_priv
(
dev
)
;
static
unsigned
version_printed
;
static
unsigned
version_printed
;
int
retval
;
int
retval
;
...
@@ -950,7 +950,7 @@ static void eth16i_eeprom_cmd(int ioaddr, unsigned char command)
...
@@ -950,7 +950,7 @@ static void eth16i_eeprom_cmd(int ioaddr, unsigned char command)
static
int
eth16i_open
(
struct
net_device
*
dev
)
static
int
eth16i_open
(
struct
net_device
*
dev
)
{
{
struct
eth16i_local
*
lp
=
(
struct
eth16i_local
*
)
dev
->
priv
;
struct
eth16i_local
*
lp
=
netdev_priv
(
dev
)
;
int
ioaddr
=
dev
->
base_addr
;
int
ioaddr
=
dev
->
base_addr
;
/* Powerup the chip */
/* Powerup the chip */
...
@@ -986,7 +986,7 @@ static int eth16i_open(struct net_device *dev)
...
@@ -986,7 +986,7 @@ static int eth16i_open(struct net_device *dev)
static
int
eth16i_close
(
struct
net_device
*
dev
)
static
int
eth16i_close
(
struct
net_device
*
dev
)
{
{
struct
eth16i_local
*
lp
=
(
struct
eth16i_local
*
)
dev
->
priv
;
struct
eth16i_local
*
lp
=
netdev_priv
(
dev
)
;
int
ioaddr
=
dev
->
base_addr
;
int
ioaddr
=
dev
->
base_addr
;
eth16i_reset
(
dev
);
eth16i_reset
(
dev
);
...
@@ -1012,7 +1012,7 @@ static int eth16i_close(struct net_device *dev)
...
@@ -1012,7 +1012,7 @@ static int eth16i_close(struct net_device *dev)
static
void
eth16i_timeout
(
struct
net_device
*
dev
)
static
void
eth16i_timeout
(
struct
net_device
*
dev
)
{
{
struct
eth16i_local
*
lp
=
(
struct
eth16i_local
*
)
dev
->
priv
;
struct
eth16i_local
*
lp
=
netdev_priv
(
dev
)
;
int
ioaddr
=
dev
->
base_addr
;
int
ioaddr
=
dev
->
base_addr
;
/*
/*
If we get here, some higher level has decided that
If we get here, some higher level has decided that
...
@@ -1053,7 +1053,7 @@ static void eth16i_timeout(struct net_device *dev)
...
@@ -1053,7 +1053,7 @@ static void eth16i_timeout(struct net_device *dev)
static
int
eth16i_tx
(
struct
sk_buff
*
skb
,
struct
net_device
*
dev
)
static
int
eth16i_tx
(
struct
sk_buff
*
skb
,
struct
net_device
*
dev
)
{
{
struct
eth16i_local
*
lp
=
(
struct
eth16i_local
*
)
dev
->
priv
;
struct
eth16i_local
*
lp
=
netdev_priv
(
dev
)
;
int
ioaddr
=
dev
->
base_addr
;
int
ioaddr
=
dev
->
base_addr
;
int
status
=
0
;
int
status
=
0
;
ushort
length
=
skb
->
len
;
ushort
length
=
skb
->
len
;
...
@@ -1130,7 +1130,7 @@ static int eth16i_tx(struct sk_buff *skb, struct net_device *dev)
...
@@ -1130,7 +1130,7 @@ static int eth16i_tx(struct sk_buff *skb, struct net_device *dev)
static
void
eth16i_rx
(
struct
net_device
*
dev
)
static
void
eth16i_rx
(
struct
net_device
*
dev
)
{
{
struct
eth16i_local
*
lp
=
(
struct
eth16i_local
*
)
dev
->
priv
;
struct
eth16i_local
*
lp
=
netdev_priv
(
dev
)
;
int
ioaddr
=
dev
->
base_addr
;
int
ioaddr
=
dev
->
base_addr
;
int
boguscount
=
MAX_RX_LOOP
;
int
boguscount
=
MAX_RX_LOOP
;
...
@@ -1232,7 +1232,7 @@ static irqreturn_t eth16i_interrupt(int irq, void *dev_id, struct pt_regs *regs)
...
@@ -1232,7 +1232,7 @@ static irqreturn_t eth16i_interrupt(int irq, void *dev_id, struct pt_regs *regs)
int
handled
=
0
;
int
handled
=
0
;
ioaddr
=
dev
->
base_addr
;
ioaddr
=
dev
->
base_addr
;
lp
=
(
struct
eth16i_local
*
)
dev
->
priv
;
lp
=
netdev_priv
(
dev
)
;
/* Turn off all interrupts from adapter */
/* Turn off all interrupts from adapter */
outw
(
ETH16I_INTR_OFF
,
ioaddr
+
TX_INTR_REG
);
outw
(
ETH16I_INTR_OFF
,
ioaddr
+
TX_INTR_REG
);
...
@@ -1340,7 +1340,7 @@ static void eth16i_skip_packet(struct net_device *dev)
...
@@ -1340,7 +1340,7 @@ static void eth16i_skip_packet(struct net_device *dev)
static
void
eth16i_reset
(
struct
net_device
*
dev
)
static
void
eth16i_reset
(
struct
net_device
*
dev
)
{
{
struct
eth16i_local
*
lp
=
(
struct
eth16i_local
*
)
dev
->
priv
;
struct
eth16i_local
*
lp
=
netdev_priv
(
dev
)
;
int
ioaddr
=
dev
->
base_addr
;
int
ioaddr
=
dev
->
base_addr
;
if
(
eth16i_debug
>
1
)
if
(
eth16i_debug
>
1
)
...
@@ -1372,7 +1372,7 @@ static void eth16i_multicast(struct net_device *dev)
...
@@ -1372,7 +1372,7 @@ static void eth16i_multicast(struct net_device *dev)
static
struct
net_device_stats
*
eth16i_get_stats
(
struct
net_device
*
dev
)
static
struct
net_device_stats
*
eth16i_get_stats
(
struct
net_device
*
dev
)
{
{
struct
eth16i_local
*
lp
=
(
struct
eth16i_local
*
)
dev
->
priv
;
struct
eth16i_local
*
lp
=
netdev_priv
(
dev
)
;
return
&
lp
->
stats
;
return
&
lp
->
stats
;
}
}
...
...
drivers/net/fec.c
View file @
e07b9e8f
...
@@ -269,7 +269,7 @@ fec_enet_start_xmit(struct sk_buff *skb, struct net_device *dev)
...
@@ -269,7 +269,7 @@ fec_enet_start_xmit(struct sk_buff *skb, struct net_device *dev)
volatile
fec_t
*
fecp
;
volatile
fec_t
*
fecp
;
volatile
cbd_t
*
bdp
;
volatile
cbd_t
*
bdp
;
fep
=
dev
->
priv
;
fep
=
netdev_priv
(
dev
)
;
fecp
=
(
volatile
fec_t
*
)
dev
->
base_addr
;
fecp
=
(
volatile
fec_t
*
)
dev
->
base_addr
;
if
(
!
fep
->
link
)
{
if
(
!
fep
->
link
)
{
...
@@ -349,7 +349,7 @@ fec_enet_start_xmit(struct sk_buff *skb, struct net_device *dev)
...
@@ -349,7 +349,7 @@ fec_enet_start_xmit(struct sk_buff *skb, struct net_device *dev)
static
void
static
void
fec_timeout
(
struct
net_device
*
dev
)
fec_timeout
(
struct
net_device
*
dev
)
{
{
struct
fec_enet_private
*
fep
=
dev
->
priv
;
struct
fec_enet_private
*
fep
=
netdev_priv
(
dev
)
;
printk
(
"%s: transmit timed out.
\n
"
,
dev
->
name
);
printk
(
"%s: transmit timed out.
\n
"
,
dev
->
name
);
fep
->
stats
.
tx_errors
++
;
fep
->
stats
.
tx_errors
++
;
...
@@ -445,7 +445,7 @@ fec_enet_tx(struct net_device *dev)
...
@@ -445,7 +445,7 @@ fec_enet_tx(struct net_device *dev)
volatile
cbd_t
*
bdp
;
volatile
cbd_t
*
bdp
;
struct
sk_buff
*
skb
;
struct
sk_buff
*
skb
;
fep
=
dev
->
priv
;
fep
=
netdev_priv
(
dev
)
;
spin_lock
(
&
fep
->
lock
);
spin_lock
(
&
fep
->
lock
);
bdp
=
fep
->
dirty_tx
;
bdp
=
fep
->
dirty_tx
;
...
@@ -524,7 +524,7 @@ fec_enet_rx(struct net_device *dev)
...
@@ -524,7 +524,7 @@ fec_enet_rx(struct net_device *dev)
ushort
pkt_len
;
ushort
pkt_len
;
__u8
*
data
;
__u8
*
data
;
fep
=
dev
->
priv
;
fep
=
netdev_priv
(
dev
)
;
fecp
=
(
volatile
fec_t
*
)
dev
->
base_addr
;
fecp
=
(
volatile
fec_t
*
)
dev
->
base_addr
;
/* First, grab all of the stats for the incoming packet.
/* First, grab all of the stats for the incoming packet.
...
@@ -645,7 +645,7 @@ fec_enet_mii(struct net_device *dev)
...
@@ -645,7 +645,7 @@ fec_enet_mii(struct net_device *dev)
mii_list_t
*
mip
;
mii_list_t
*
mip
;
uint
mii_reg
;
uint
mii_reg
;
fep
=
(
struct
fec_enet_private
*
)
dev
->
priv
;
fep
=
netdev_priv
(
dev
)
;
ep
=
fec_hwp
;
ep
=
fec_hwp
;
mii_reg
=
ep
->
fec_mii_data
;
mii_reg
=
ep
->
fec_mii_data
;
...
@@ -675,7 +675,7 @@ mii_queue(struct net_device *dev, int regval, void (*func)(uint, struct net_devi
...
@@ -675,7 +675,7 @@ mii_queue(struct net_device *dev, int regval, void (*func)(uint, struct net_devi
/* Add PHY address to register command.
/* Add PHY address to register command.
*/
*/
fep
=
dev
->
priv
;
fep
=
netdev_priv
(
dev
)
;
regval
|=
fep
->
phy_addr
<<
23
;
regval
|=
fep
->
phy_addr
<<
23
;
retval
=
0
;
retval
=
0
;
...
@@ -720,7 +720,7 @@ static void mii_do_cmd(struct net_device *dev, const phy_cmd_t *c)
...
@@ -720,7 +720,7 @@ static void mii_do_cmd(struct net_device *dev, const phy_cmd_t *c)
static
void
mii_parse_sr
(
uint
mii_reg
,
struct
net_device
*
dev
)
static
void
mii_parse_sr
(
uint
mii_reg
,
struct
net_device
*
dev
)
{
{
struct
fec_enet_private
*
fep
=
dev
->
priv
;
struct
fec_enet_private
*
fep
=
netdev_priv
(
dev
)
;
volatile
uint
*
s
=
&
(
fep
->
phy_status
);
volatile
uint
*
s
=
&
(
fep
->
phy_status
);
*
s
&=
~
(
PHY_STAT_LINK
|
PHY_STAT_FAULT
|
PHY_STAT_ANC
);
*
s
&=
~
(
PHY_STAT_LINK
|
PHY_STAT_FAULT
|
PHY_STAT_ANC
);
...
@@ -735,7 +735,7 @@ static void mii_parse_sr(uint mii_reg, struct net_device *dev)
...
@@ -735,7 +735,7 @@ static void mii_parse_sr(uint mii_reg, struct net_device *dev)
static
void
mii_parse_cr
(
uint
mii_reg
,
struct
net_device
*
dev
)
static
void
mii_parse_cr
(
uint
mii_reg
,
struct
net_device
*
dev
)
{
{
struct
fec_enet_private
*
fep
=
dev
->
priv
;
struct
fec_enet_private
*
fep
=
netdev_priv
(
dev
)
;
volatile
uint
*
s
=
&
(
fep
->
phy_status
);
volatile
uint
*
s
=
&
(
fep
->
phy_status
);
*
s
&=
~
(
PHY_CONF_ANE
|
PHY_CONF_LOOP
);
*
s
&=
~
(
PHY_CONF_ANE
|
PHY_CONF_LOOP
);
...
@@ -748,7 +748,7 @@ static void mii_parse_cr(uint mii_reg, struct net_device *dev)
...
@@ -748,7 +748,7 @@ static void mii_parse_cr(uint mii_reg, struct net_device *dev)
static
void
mii_parse_anar
(
uint
mii_reg
,
struct
net_device
*
dev
)
static
void
mii_parse_anar
(
uint
mii_reg
,
struct
net_device
*
dev
)
{
{
struct
fec_enet_private
*
fep
=
dev
->
priv
;
struct
fec_enet_private
*
fep
=
netdev_priv
(
dev
)
;
volatile
uint
*
s
=
&
(
fep
->
phy_status
);
volatile
uint
*
s
=
&
(
fep
->
phy_status
);
*
s
&=
~
(
PHY_CONF_SPMASK
);
*
s
&=
~
(
PHY_CONF_SPMASK
);
...
@@ -774,7 +774,7 @@ static void mii_parse_anar(uint mii_reg, struct net_device *dev)
...
@@ -774,7 +774,7 @@ static void mii_parse_anar(uint mii_reg, struct net_device *dev)
static
void
mii_parse_lxt970_csr
(
uint
mii_reg
,
struct
net_device
*
dev
)
static
void
mii_parse_lxt970_csr
(
uint
mii_reg
,
struct
net_device
*
dev
)
{
{
struct
fec_enet_private
*
fep
=
dev
->
priv
;
struct
fec_enet_private
*
fep
=
netdev_priv
(
dev
)
;
volatile
uint
*
s
=
&
(
fep
->
phy_status
);
volatile
uint
*
s
=
&
(
fep
->
phy_status
);
*
s
&=
~
(
PHY_STAT_SPMASK
);
*
s
&=
~
(
PHY_STAT_SPMASK
);
...
@@ -841,7 +841,7 @@ static phy_info_t phy_info_lxt970 = {
...
@@ -841,7 +841,7 @@ static phy_info_t phy_info_lxt970 = {
static
void
mii_parse_lxt971_sr2
(
uint
mii_reg
,
struct
net_device
*
dev
)
static
void
mii_parse_lxt971_sr2
(
uint
mii_reg
,
struct
net_device
*
dev
)
{
{
struct
fec_enet_private
*
fep
=
dev
->
priv
;
struct
fec_enet_private
*
fep
=
netdev_priv
(
dev
)
;
volatile
uint
*
s
=
&
(
fep
->
phy_status
);
volatile
uint
*
s
=
&
(
fep
->
phy_status
);
*
s
&=
~
(
PHY_STAT_SPMASK
|
PHY_STAT_LINK
|
PHY_STAT_ANC
);
*
s
&=
~
(
PHY_STAT_SPMASK
|
PHY_STAT_LINK
|
PHY_STAT_ANC
);
...
@@ -919,7 +919,7 @@ static phy_info_t phy_info_lxt971 = {
...
@@ -919,7 +919,7 @@ static phy_info_t phy_info_lxt971 = {
static
void
mii_parse_qs6612_pcr
(
uint
mii_reg
,
struct
net_device
*
dev
)
static
void
mii_parse_qs6612_pcr
(
uint
mii_reg
,
struct
net_device
*
dev
)
{
{
struct
fec_enet_private
*
fep
=
dev
->
priv
;
struct
fec_enet_private
*
fep
=
netdev_priv
(
dev
)
;
volatile
uint
*
s
=
&
(
fep
->
phy_status
);
volatile
uint
*
s
=
&
(
fep
->
phy_status
);
*
s
&=
~
(
PHY_STAT_SPMASK
);
*
s
&=
~
(
PHY_STAT_SPMASK
);
...
@@ -983,7 +983,7 @@ static phy_info_t phy_info_qs6612 = {
...
@@ -983,7 +983,7 @@ static phy_info_t phy_info_qs6612 = {
static
void
mii_parse_am79c874_dr
(
uint
mii_reg
,
struct
net_device
*
dev
)
static
void
mii_parse_am79c874_dr
(
uint
mii_reg
,
struct
net_device
*
dev
)
{
{
struct
fec_enet_private
*
fep
=
dev
->
priv
;
struct
fec_enet_private
*
fep
=
netdev_priv
(
dev
)
;
volatile
uint
*
s
=
&
(
fep
->
phy_status
);
volatile
uint
*
s
=
&
(
fep
->
phy_status
);
*
s
&=
~
(
PHY_STAT_SPMASK
|
PHY_STAT_ANC
);
*
s
&=
~
(
PHY_STAT_SPMASK
|
PHY_STAT_ANC
);
...
@@ -1280,7 +1280,7 @@ static void __inline__ fec_uncache(unsigned long addr)
...
@@ -1280,7 +1280,7 @@ static void __inline__ fec_uncache(unsigned long addr)
static
void
mii_display_status
(
struct
net_device
*
dev
)
static
void
mii_display_status
(
struct
net_device
*
dev
)
{
{
struct
fec_enet_private
*
fep
=
dev
->
priv
;
struct
fec_enet_private
*
fep
=
netdev_priv
(
dev
)
;
volatile
uint
*
s
=
&
(
fep
->
phy_status
);
volatile
uint
*
s
=
&
(
fep
->
phy_status
);
if
(
!
fep
->
link
&&
!
fep
->
old_link
)
{
if
(
!
fep
->
link
&&
!
fep
->
old_link
)
{
...
@@ -1316,7 +1316,7 @@ static void mii_display_status(struct net_device *dev)
...
@@ -1316,7 +1316,7 @@ static void mii_display_status(struct net_device *dev)
static
void
mii_display_config
(
struct
net_device
*
dev
)
static
void
mii_display_config
(
struct
net_device
*
dev
)
{
{
struct
fec_enet_private
*
fep
=
dev
->
priv
;
struct
fec_enet_private
*
fep
=
netdev_priv
(
dev
)
;
volatile
uint
*
s
=
&
(
fep
->
phy_status
);
volatile
uint
*
s
=
&
(
fep
->
phy_status
);
printk
(
"%s: config: auto-negotiation "
,
dev
->
name
);
printk
(
"%s: config: auto-negotiation "
,
dev
->
name
);
...
@@ -1347,7 +1347,7 @@ static void mii_display_config(struct net_device *dev)
...
@@ -1347,7 +1347,7 @@ static void mii_display_config(struct net_device *dev)
static
void
mii_relink
(
struct
net_device
*
dev
)
static
void
mii_relink
(
struct
net_device
*
dev
)
{
{
struct
fec_enet_private
*
fep
=
dev
->
priv
;
struct
fec_enet_private
*
fep
=
netdev_priv
(
dev
)
;
int
duplex
;
int
duplex
;
fep
->
link
=
(
fep
->
phy_status
&
PHY_STAT_LINK
)
?
1
:
0
;
fep
->
link
=
(
fep
->
phy_status
&
PHY_STAT_LINK
)
?
1
:
0
;
...
@@ -1372,7 +1372,7 @@ static void mii_relink(struct net_device *dev)
...
@@ -1372,7 +1372,7 @@ static void mii_relink(struct net_device *dev)
static
void
mii_queue_relink
(
uint
mii_reg
,
struct
net_device
*
dev
)
static
void
mii_queue_relink
(
uint
mii_reg
,
struct
net_device
*
dev
)
{
{
struct
fec_enet_private
*
fep
=
dev
->
priv
;
struct
fec_enet_private
*
fep
=
netdev_priv
(
dev
)
;
INIT_WORK
(
&
fep
->
phy_task
,
(
void
*
)
mii_relink
,
dev
);
INIT_WORK
(
&
fep
->
phy_task
,
(
void
*
)
mii_relink
,
dev
);
schedule_work
(
&
fep
->
phy_task
);
schedule_work
(
&
fep
->
phy_task
);
...
@@ -1380,7 +1380,7 @@ static void mii_queue_relink(uint mii_reg, struct net_device *dev)
...
@@ -1380,7 +1380,7 @@ static void mii_queue_relink(uint mii_reg, struct net_device *dev)
static
void
mii_queue_config
(
uint
mii_reg
,
struct
net_device
*
dev
)
static
void
mii_queue_config
(
uint
mii_reg
,
struct
net_device
*
dev
)
{
{
struct
fec_enet_private
*
fep
=
dev
->
priv
;
struct
fec_enet_private
*
fep
=
netdev_priv
(
dev
)
;
INIT_WORK
(
&
fep
->
phy_task
,
(
void
*
)
mii_display_config
,
dev
);
INIT_WORK
(
&
fep
->
phy_task
,
(
void
*
)
mii_display_config
,
dev
);
schedule_work
(
&
fep
->
phy_task
);
schedule_work
(
&
fep
->
phy_task
);
...
@@ -1403,7 +1403,7 @@ mii_discover_phy3(uint mii_reg, struct net_device *dev)
...
@@ -1403,7 +1403,7 @@ mii_discover_phy3(uint mii_reg, struct net_device *dev)
struct
fec_enet_private
*
fep
;
struct
fec_enet_private
*
fep
;
int
i
;
int
i
;
fep
=
dev
->
priv
;
fep
=
netdev_priv
(
dev
)
;
fep
->
phy_id
|=
(
mii_reg
&
0xffff
);
fep
->
phy_id
|=
(
mii_reg
&
0xffff
);
printk
(
"fec: PHY @ 0x%x, ID 0x%08x"
,
fep
->
phy_addr
,
fep
->
phy_id
);
printk
(
"fec: PHY @ 0x%x, ID 0x%08x"
,
fep
->
phy_addr
,
fep
->
phy_id
);
...
@@ -1431,7 +1431,7 @@ mii_discover_phy(uint mii_reg, struct net_device *dev)
...
@@ -1431,7 +1431,7 @@ mii_discover_phy(uint mii_reg, struct net_device *dev)
volatile
fec_t
*
fecp
;
volatile
fec_t
*
fecp
;
uint
phytype
;
uint
phytype
;
fep
=
dev
->
priv
;
fep
=
netdev_priv
(
dev
)
;
fecp
=
fec_hwp
;
fecp
=
fec_hwp
;
if
(
fep
->
phy_addr
<
32
)
{
if
(
fep
->
phy_addr
<
32
)
{
...
@@ -1466,7 +1466,7 @@ mii_link_interrupt(int irq, void * dev_id, struct pt_regs * regs)
...
@@ -1466,7 +1466,7 @@ mii_link_interrupt(int irq, void * dev_id, struct pt_regs * regs)
#endif
#endif
{
{
struct
net_device
*
dev
=
dev_id
;
struct
net_device
*
dev
=
dev_id
;
struct
fec_enet_private
*
fep
=
dev
->
priv
;
struct
fec_enet_private
*
fep
=
netdev_priv
(
dev
)
;
fec_phy_ack_intr
();
fec_phy_ack_intr
();
...
@@ -1482,7 +1482,7 @@ mii_link_interrupt(int irq, void * dev_id, struct pt_regs * regs)
...
@@ -1482,7 +1482,7 @@ mii_link_interrupt(int irq, void * dev_id, struct pt_regs * regs)
static
int
static
int
fec_enet_open
(
struct
net_device
*
dev
)
fec_enet_open
(
struct
net_device
*
dev
)
{
{
struct
fec_enet_private
*
fep
=
dev
->
priv
;
struct
fec_enet_private
*
fep
=
netdev_priv
(
dev
)
;
/* I should reset the ring buffers here, but I don't yet know
/* I should reset the ring buffers here, but I don't yet know
* a simple way to do that.
* a simple way to do that.
...
@@ -1531,7 +1531,7 @@ fec_enet_close(struct net_device *dev)
...
@@ -1531,7 +1531,7 @@ fec_enet_close(struct net_device *dev)
static
struct
net_device_stats
*
fec_enet_get_stats
(
struct
net_device
*
dev
)
static
struct
net_device_stats
*
fec_enet_get_stats
(
struct
net_device
*
dev
)
{
{
struct
fec_enet_private
*
fep
=
(
struct
fec_enet_private
*
)
dev
->
priv
;
struct
fec_enet_private
*
fep
=
netdev_priv
(
dev
)
;
return
&
fep
->
stats
;
return
&
fep
->
stats
;
}
}
...
@@ -1557,7 +1557,7 @@ static void set_multicast_list(struct net_device *dev)
...
@@ -1557,7 +1557,7 @@ static void set_multicast_list(struct net_device *dev)
unsigned
int
i
,
j
,
bit
,
data
,
crc
;
unsigned
int
i
,
j
,
bit
,
data
,
crc
;
unsigned
char
hash
;
unsigned
char
hash
;
fep
=
(
struct
fec_enet_private
*
)
dev
->
priv
;
fep
=
netdev_priv
(
dev
)
;
ep
=
fec_hwp
;
ep
=
fec_hwp
;
if
(
dev
->
flags
&
IFF_PROMISC
)
{
if
(
dev
->
flags
&
IFF_PROMISC
)
{
...
@@ -1643,7 +1643,7 @@ fec_set_mac_address(struct net_device *dev)
...
@@ -1643,7 +1643,7 @@ fec_set_mac_address(struct net_device *dev)
*/
*/
int
__init
fec_enet_init
(
struct
net_device
*
dev
)
int
__init
fec_enet_init
(
struct
net_device
*
dev
)
{
{
struct
fec_enet_private
*
fep
=
dev
->
priv
;
struct
fec_enet_private
*
fep
=
netdev_priv
(
dev
)
;
unsigned
long
mem_addr
;
unsigned
long
mem_addr
;
volatile
cbd_t
*
bdp
;
volatile
cbd_t
*
bdp
;
cbd_t
*
cbd_base
;
cbd_t
*
cbd_base
;
...
@@ -1807,7 +1807,7 @@ fec_restart(struct net_device *dev, int duplex)
...
@@ -1807,7 +1807,7 @@ fec_restart(struct net_device *dev, int duplex)
fecp
=
fec_hwp
;
fecp
=
fec_hwp
;
fep
=
dev
->
priv
;
fep
=
netdev_priv
(
dev
)
;
/* Whack a reset. We should wait for this.
/* Whack a reset. We should wait for this.
*/
*/
...
@@ -1924,7 +1924,7 @@ fec_stop(struct net_device *dev)
...
@@ -1924,7 +1924,7 @@ fec_stop(struct net_device *dev)
struct
fec_enet_private
*
fep
;
struct
fec_enet_private
*
fep
;
fecp
=
fec_hwp
;
fecp
=
fec_hwp
;
fep
=
dev
->
priv
;
fep
=
netdev_priv
(
dev
)
;
fecp
->
fec_x_cntrl
=
0x01
;
/* Graceful transmit stop */
fecp
->
fec_x_cntrl
=
0x01
;
/* Graceful transmit stop */
...
...
drivers/net/gt96100eth.c
View file @
e07b9e8f
...
@@ -277,7 +277,7 @@ read_MII(int phy_addr, u32 reg)
...
@@ -277,7 +277,7 @@ read_MII(int phy_addr, u32 reg)
static
void
static
void
dump_tx_desc
(
int
dbg_lvl
,
struct
net_device
*
dev
,
int
i
)
dump_tx_desc
(
int
dbg_lvl
,
struct
net_device
*
dev
,
int
i
)
{
{
struct
gt96100_private
*
gp
=
(
struct
gt96100_private
*
)
dev
->
priv
;
struct
gt96100_private
*
gp
=
netdev_priv
(
dev
)
;
gt96100_td_t
*
td
=
&
gp
->
tx_ring
[
i
];
gt96100_td_t
*
td
=
&
gp
->
tx_ring
[
i
];
dbg
(
dbg_lvl
,
"Tx descriptor at 0x%08lx:
\n
"
,
virt_to_phys
(
td
));
dbg
(
dbg_lvl
,
"Tx descriptor at 0x%08lx:
\n
"
,
virt_to_phys
(
td
));
...
@@ -292,7 +292,7 @@ dump_tx_desc(int dbg_lvl, struct net_device *dev, int i)
...
@@ -292,7 +292,7 @@ dump_tx_desc(int dbg_lvl, struct net_device *dev, int i)
static
void
static
void
dump_rx_desc
(
int
dbg_lvl
,
struct
net_device
*
dev
,
int
i
)
dump_rx_desc
(
int
dbg_lvl
,
struct
net_device
*
dev
,
int
i
)
{
{
struct
gt96100_private
*
gp
=
(
struct
gt96100_private
*
)
dev
->
priv
;
struct
gt96100_private
*
gp
=
netdev_priv
(
dev
)
;
gt96100_rd_t
*
rd
=
&
gp
->
rx_ring
[
i
];
gt96100_rd_t
*
rd
=
&
gp
->
rx_ring
[
i
];
dbg
(
dbg_lvl
,
"Rx descriptor at 0x%08lx:
\n
"
,
virt_to_phys
(
rd
));
dbg
(
dbg_lvl
,
"Rx descriptor at 0x%08lx:
\n
"
,
virt_to_phys
(
rd
));
...
@@ -332,7 +332,7 @@ write_MII(int phy_addr, u32 reg, u16 data)
...
@@ -332,7 +332,7 @@ write_MII(int phy_addr, u32 reg, u16 data)
static void
static void
dump_tx_ring(struct net_device *dev)
dump_tx_ring(struct net_device *dev)
{
{
struct gt96100_private *gp =
(struct gt96100_private *)dev->priv
;
struct gt96100_private *gp =
netdev_priv(dev)
;
int i;
int i;
dbg(0, "%s: txno/txni/cnt=%d/%d/%d\n", __FUNCTION__,
dbg(0, "%s: txno/txni/cnt=%d/%d/%d\n", __FUNCTION__,
...
@@ -345,7 +345,7 @@ dump_tx_ring(struct net_device *dev)
...
@@ -345,7 +345,7 @@ dump_tx_ring(struct net_device *dev)
static void
static void
dump_rx_ring(struct net_device *dev)
dump_rx_ring(struct net_device *dev)
{
{
struct gt96100_private *gp =
(struct gt96100_private *)dev->priv
;
struct gt96100_private *gp =
netdev_priv(dev)
;
int i;
int i;
dbg(0, "%s: rxno=%d\n", __FUNCTION__, gp->rx_next_out);
dbg(0, "%s: rxno=%d\n", __FUNCTION__, gp->rx_next_out);
...
@@ -359,7 +359,7 @@ static void
...
@@ -359,7 +359,7 @@ static void
dump_MII
(
int
dbg_lvl
,
struct
net_device
*
dev
)
dump_MII
(
int
dbg_lvl
,
struct
net_device
*
dev
)
{
{
int
i
,
val
;
int
i
,
val
;
struct
gt96100_private
*
gp
=
(
struct
gt96100_private
*
)
dev
->
priv
;
struct
gt96100_private
*
gp
=
netdev_priv
(
dev
)
;
if
(
dbg_lvl
<=
GT96100_DEBUG
)
{
if
(
dbg_lvl
<=
GT96100_DEBUG
)
{
for
(
i
=
0
;
i
<
7
;
i
++
)
{
for
(
i
=
0
;
i
<
7
;
i
++
)
{
...
@@ -419,7 +419,7 @@ dump_skb(int dbg_lvl, struct net_device *dev, struct sk_buff *skb)
...
@@ -419,7 +419,7 @@ dump_skb(int dbg_lvl, struct net_device *dev, struct sk_buff *skb)
static
int
static
int
gt96100_add_hash_entry
(
struct
net_device
*
dev
,
unsigned
char
*
addr
)
gt96100_add_hash_entry
(
struct
net_device
*
dev
,
unsigned
char
*
addr
)
{
{
struct
gt96100_private
*
gp
=
(
struct
gt96100_private
*
)
dev
->
priv
;
struct
gt96100_private
*
gp
=
netdev_priv
(
dev
)
;
//u16 hashResult, stmp;
//u16 hashResult, stmp;
//unsigned char ctmp, hash_ea[6];
//unsigned char ctmp, hash_ea[6];
u32
tblEntry1
,
tblEntry0
,
*
tblEntryAddr
;
u32
tblEntry1
,
tblEntry0
,
*
tblEntryAddr
;
...
@@ -544,7 +544,7 @@ update_stats(struct gt96100_private *gp)
...
@@ -544,7 +544,7 @@ update_stats(struct gt96100_private *gp)
static
void
static
void
abort
(
struct
net_device
*
dev
,
u32
abort_bits
)
abort
(
struct
net_device
*
dev
,
u32
abort_bits
)
{
{
struct
gt96100_private
*
gp
=
(
struct
gt96100_private
*
)
dev
->
priv
;
struct
gt96100_private
*
gp
=
netdev_priv
(
dev
)
;
int
timedout
=
100
;
// wait up to 100 msec for hard stop to complete
int
timedout
=
100
;
// wait up to 100 msec for hard stop to complete
dbg
(
3
,
"%s
\n
"
,
__FUNCTION__
);
dbg
(
3
,
"%s
\n
"
,
__FUNCTION__
);
...
@@ -582,7 +582,7 @@ abort(struct net_device *dev, u32 abort_bits)
...
@@ -582,7 +582,7 @@ abort(struct net_device *dev, u32 abort_bits)
static
void
static
void
hard_stop
(
struct
net_device
*
dev
)
hard_stop
(
struct
net_device
*
dev
)
{
{
struct
gt96100_private
*
gp
=
(
struct
gt96100_private
*
)
dev
->
priv
;
struct
gt96100_private
*
gp
=
netdev_priv
(
dev
)
;
dbg
(
3
,
"%s
\n
"
,
__FUNCTION__
);
dbg
(
3
,
"%s
\n
"
,
__FUNCTION__
);
...
@@ -598,7 +598,7 @@ hard_stop(struct net_device *dev)
...
@@ -598,7 +598,7 @@ hard_stop(struct net_device *dev)
static
void
static
void
enable_ether_irq
(
struct
net_device
*
dev
)
enable_ether_irq
(
struct
net_device
*
dev
)
{
{
struct
gt96100_private
*
gp
=
(
struct
gt96100_private
*
)
dev
->
priv
;
struct
gt96100_private
*
gp
=
netdev_priv
(
dev
)
;
u32
intMask
;
u32
intMask
;
/*
/*
* route ethernet interrupt to GT_SERINT0 for port 0,
* route ethernet interrupt to GT_SERINT0 for port 0,
...
@@ -631,7 +631,7 @@ enable_ether_irq(struct net_device *dev)
...
@@ -631,7 +631,7 @@ enable_ether_irq(struct net_device *dev)
static
void
static
void
disable_ether_irq
(
struct
net_device
*
dev
)
disable_ether_irq
(
struct
net_device
*
dev
)
{
{
struct
gt96100_private
*
gp
=
(
struct
gt96100_private
*
)
dev
->
priv
;
struct
gt96100_private
*
gp
=
netdev_priv
(
dev
)
;
u32
intMask
;
u32
intMask
;
int
intr_mask_reg
=
(
gp
->
port_num
==
0
)
?
int
intr_mask_reg
=
(
gp
->
port_num
==
0
)
?
GT96100_SERINT0_MASK
:
GT96100_INT0_HIGH_MASK
;
GT96100_SERINT0_MASK
:
GT96100_INT0_HIGH_MASK
;
...
@@ -745,7 +745,7 @@ gt96100_probe1(int port_num)
...
@@ -745,7 +745,7 @@ gt96100_probe1(int port_num)
goto
out1
;
goto
out1
;
}
}
gp
=
dev
->
priv
;
gp
=
netdev_priv
(
dev
)
;
memset
(
gp
,
0
,
sizeof
(
*
gp
));
// clear it
memset
(
gp
,
0
,
sizeof
(
*
gp
));
// clear it
...
@@ -839,7 +839,7 @@ gt96100_probe1(int port_num)
...
@@ -839,7 +839,7 @@ gt96100_probe1(int port_num)
static
void
static
void
reset_tx
(
struct
net_device
*
dev
)
reset_tx
(
struct
net_device
*
dev
)
{
{
struct
gt96100_private
*
gp
=
(
struct
gt96100_private
*
)
dev
->
priv
;
struct
gt96100_private
*
gp
=
netdev_priv
(
dev
)
;
int
i
;
int
i
;
abort
(
dev
,
sdcmrAT
);
abort
(
dev
,
sdcmrAT
);
...
@@ -877,7 +877,7 @@ reset_tx(struct net_device *dev)
...
@@ -877,7 +877,7 @@ reset_tx(struct net_device *dev)
static
void
static
void
reset_rx
(
struct
net_device
*
dev
)
reset_rx
(
struct
net_device
*
dev
)
{
{
struct
gt96100_private
*
gp
=
(
struct
gt96100_private
*
)
dev
->
priv
;
struct
gt96100_private
*
gp
=
netdev_priv
(
dev
)
;
int
i
;
int
i
;
abort
(
dev
,
sdcmrAR
);
abort
(
dev
,
sdcmrAR
);
...
@@ -934,7 +934,7 @@ gt96100_check_tx_consistent(struct gt96100_private *gp)
...
@@ -934,7 +934,7 @@ gt96100_check_tx_consistent(struct gt96100_private *gp)
static
int
static
int
gt96100_init
(
struct
net_device
*
dev
)
gt96100_init
(
struct
net_device
*
dev
)
{
{
struct
gt96100_private
*
gp
=
(
struct
gt96100_private
*
)
dev
->
priv
;
struct
gt96100_private
*
gp
=
netdev_priv
(
dev
)
;
u32
tmp
;
u32
tmp
;
u16
mii_reg
;
u16
mii_reg
;
...
@@ -1115,7 +1115,7 @@ gt96100_close(struct net_device *dev)
...
@@ -1115,7 +1115,7 @@ gt96100_close(struct net_device *dev)
static
int
static
int
gt96100_tx
(
struct
sk_buff
*
skb
,
struct
net_device
*
dev
)
gt96100_tx
(
struct
sk_buff
*
skb
,
struct
net_device
*
dev
)
{
{
struct
gt96100_private
*
gp
=
(
struct
gt96100_private
*
)
dev
->
priv
;
struct
gt96100_private
*
gp
=
netdev_priv
(
dev
)
;
unsigned
long
flags
;
unsigned
long
flags
;
int
nextIn
;
int
nextIn
;
...
@@ -1187,7 +1187,7 @@ gt96100_tx(struct sk_buff *skb, struct net_device *dev)
...
@@ -1187,7 +1187,7 @@ gt96100_tx(struct sk_buff *skb, struct net_device *dev)
static
int
static
int
gt96100_rx
(
struct
net_device
*
dev
,
u32
status
)
gt96100_rx
(
struct
net_device
*
dev
,
u32
status
)
{
{
struct
gt96100_private
*
gp
=
(
struct
gt96100_private
*
)
dev
->
priv
;
struct
gt96100_private
*
gp
=
netdev_priv
(
dev
)
;
struct
sk_buff
*
skb
;
struct
sk_buff
*
skb
;
int
pkt_len
,
nextOut
,
cdp
;
int
pkt_len
,
nextOut
,
cdp
;
gt96100_rd_t
*
rd
;
gt96100_rd_t
*
rd
;
...
@@ -1296,7 +1296,7 @@ gt96100_rx(struct net_device *dev, u32 status)
...
@@ -1296,7 +1296,7 @@ gt96100_rx(struct net_device *dev, u32 status)
static
void
static
void
gt96100_tx_complete
(
struct
net_device
*
dev
,
u32
status
)
gt96100_tx_complete
(
struct
net_device
*
dev
,
u32
status
)
{
{
struct
gt96100_private
*
gp
=
(
struct
gt96100_private
*
)
dev
->
priv
;
struct
gt96100_private
*
gp
=
netdev_priv
(
dev
)
;
int
nextOut
,
cdp
;
int
nextOut
,
cdp
;
gt96100_td_t
*
td
;
gt96100_td_t
*
td
;
u32
cmdstat
;
u32
cmdstat
;
...
@@ -1385,7 +1385,7 @@ static irqreturn_t
...
@@ -1385,7 +1385,7 @@ static irqreturn_t
gt96100_interrupt
(
int
irq
,
void
*
dev_id
,
struct
pt_regs
*
regs
)
gt96100_interrupt
(
int
irq
,
void
*
dev_id
,
struct
pt_regs
*
regs
)
{
{
struct
net_device
*
dev
=
(
struct
net_device
*
)
dev_id
;
struct
net_device
*
dev
=
(
struct
net_device
*
)
dev_id
;
struct
gt96100_private
*
gp
=
(
struct
gt96100_private
*
)
dev
->
priv
;
struct
gt96100_private
*
gp
=
netdev_priv
(
dev
)
;
u32
status
;
u32
status
;
int
handled
=
0
;
int
handled
=
0
;
...
@@ -1486,7 +1486,7 @@ gt96100_interrupt(int irq, void *dev_id, struct pt_regs *regs)
...
@@ -1486,7 +1486,7 @@ gt96100_interrupt(int irq, void *dev_id, struct pt_regs *regs)
static
void
static
void
gt96100_tx_timeout
(
struct
net_device
*
dev
)
gt96100_tx_timeout
(
struct
net_device
*
dev
)
{
{
struct
gt96100_private
*
gp
=
(
struct
gt96100_private
*
)
dev
->
priv
;
struct
gt96100_private
*
gp
=
netdev_priv
(
dev
)
;
unsigned
long
flags
;
unsigned
long
flags
;
spin_lock_irqsave
(
&
gp
->
lock
,
flags
);
spin_lock_irqsave
(
&
gp
->
lock
,
flags
);
...
@@ -1511,7 +1511,7 @@ gt96100_tx_timeout(struct net_device *dev)
...
@@ -1511,7 +1511,7 @@ gt96100_tx_timeout(struct net_device *dev)
static
void
static
void
gt96100_set_rx_mode
(
struct
net_device
*
dev
)
gt96100_set_rx_mode
(
struct
net_device
*
dev
)
{
{
struct
gt96100_private
*
gp
=
(
struct
gt96100_private
*
)
dev
->
priv
;
struct
gt96100_private
*
gp
=
netdev_priv
(
dev
)
;
unsigned
long
flags
;
unsigned
long
flags
;
//struct dev_mc_list *mcptr;
//struct dev_mc_list *mcptr;
...
@@ -1555,7 +1555,7 @@ gt96100_set_rx_mode(struct net_device *dev)
...
@@ -1555,7 +1555,7 @@ gt96100_set_rx_mode(struct net_device *dev)
static
struct
net_device_stats
*
static
struct
net_device_stats
*
gt96100_get_stats
(
struct
net_device
*
dev
)
gt96100_get_stats
(
struct
net_device
*
dev
)
{
{
struct
gt96100_private
*
gp
=
(
struct
gt96100_private
*
)
dev
->
priv
;
struct
gt96100_private
*
gp
=
netdev_priv
(
dev
)
;
unsigned
long
flags
;
unsigned
long
flags
;
dbg
(
3
,
"%s: dev=%p
\n
"
,
__FUNCTION__
,
dev
);
dbg
(
3
,
"%s: dev=%p
\n
"
,
__FUNCTION__
,
dev
);
...
...
drivers/net/mac89x0.c
View file @
e07b9e8f
...
@@ -225,7 +225,7 @@ struct net_device * __init mac89x0_probe(int unit)
...
@@ -225,7 +225,7 @@ struct net_device * __init mac89x0_probe(int unit)
goto
out
;
goto
out
;
/* Initialize the net_device structure. */
/* Initialize the net_device structure. */
lp
=
(
struct
net_local
*
)
dev
->
priv
;
lp
=
netdev_priv
(
dev
)
;
/* Fill in the 'dev' fields. */
/* Fill in the 'dev' fields. */
dev
->
base_addr
=
ioaddr
;
dev
->
base_addr
=
ioaddr
;
...
@@ -328,7 +328,7 @@ void __init reset_chip(struct net_device *dev)
...
@@ -328,7 +328,7 @@ void __init reset_chip(struct net_device *dev)
static
int
static
int
net_open
(
struct
net_device
*
dev
)
net_open
(
struct
net_device
*
dev
)
{
{
struct
net_local
*
lp
=
(
struct
net_local
*
)
dev
->
priv
;
struct
net_local
*
lp
=
netdev_priv
(
dev
)
;
int
i
;
int
i
;
/* Disable the interrupt for now */
/* Disable the interrupt for now */
...
@@ -392,7 +392,7 @@ net_send_packet(struct sk_buff *skb, struct net_device *dev)
...
@@ -392,7 +392,7 @@ net_send_packet(struct sk_buff *skb, struct net_device *dev)
if
(
test_and_set_bit
(
0
,
(
void
*
)
&
dev
->
tbusy
)
!=
0
)
if
(
test_and_set_bit
(
0
,
(
void
*
)
&
dev
->
tbusy
)
!=
0
)
printk
(
"%s: Transmitter access conflict.
\n
"
,
dev
->
name
);
printk
(
"%s: Transmitter access conflict.
\n
"
,
dev
->
name
);
else
{
else
{
struct
net_local
*
lp
=
(
struct
net_local
*
)
dev
->
priv
;
struct
net_local
*
lp
=
netdev_priv
(
dev
)
;
unsigned
long
flags
;
unsigned
long
flags
;
if
(
net_debug
>
3
)
if
(
net_debug
>
3
)
...
@@ -446,7 +446,7 @@ static irqreturn_t net_interrupt(int irq, void *dev_id, struct pt_regs * regs)
...
@@ -446,7 +446,7 @@ static irqreturn_t net_interrupt(int irq, void *dev_id, struct pt_regs * regs)
dev
->
interrupt
=
1
;
dev
->
interrupt
=
1
;
ioaddr
=
dev
->
base_addr
;
ioaddr
=
dev
->
base_addr
;
lp
=
(
struct
net_local
*
)
dev
->
priv
;
lp
=
netdev_priv
(
dev
)
;
/* we MUST read all the events out of the ISQ, otherwise we'll never
/* we MUST read all the events out of the ISQ, otherwise we'll never
get interrupted again. As a consequence, we can't have any limit
get interrupted again. As a consequence, we can't have any limit
...
@@ -505,7 +505,7 @@ static irqreturn_t net_interrupt(int irq, void *dev_id, struct pt_regs * regs)
...
@@ -505,7 +505,7 @@ static irqreturn_t net_interrupt(int irq, void *dev_id, struct pt_regs * regs)
static
void
static
void
net_rx
(
struct
net_device
*
dev
)
net_rx
(
struct
net_device
*
dev
)
{
{
struct
net_local
*
lp
=
(
struct
net_local
*
)
dev
->
priv
;
struct
net_local
*
lp
=
netdev_priv
(
dev
)
;
struct
sk_buff
*
skb
;
struct
sk_buff
*
skb
;
int
status
,
length
;
int
status
,
length
;
...
@@ -571,7 +571,7 @@ net_close(struct net_device *dev)
...
@@ -571,7 +571,7 @@ net_close(struct net_device *dev)
static
struct
net_device_stats
*
static
struct
net_device_stats
*
net_get_stats
(
struct
net_device
*
dev
)
net_get_stats
(
struct
net_device
*
dev
)
{
{
struct
net_local
*
lp
=
(
struct
net_local
*
)
dev
->
priv
;
struct
net_local
*
lp
=
netdev_priv
(
dev
)
;
unsigned
long
flags
;
unsigned
long
flags
;
local_irq_save
(
flags
);
local_irq_save
(
flags
);
...
@@ -585,7 +585,7 @@ net_get_stats(struct net_device *dev)
...
@@ -585,7 +585,7 @@ net_get_stats(struct net_device *dev)
static
void
set_multicast_list
(
struct
net_device
*
dev
)
static
void
set_multicast_list
(
struct
net_device
*
dev
)
{
{
struct
net_local
*
lp
=
(
struct
net_local
*
)
dev
->
priv
;
struct
net_local
*
lp
=
netdev_priv
(
dev
)
;
if
(
dev
->
flags
&
IFF_PROMISC
)
if
(
dev
->
flags
&
IFF_PROMISC
)
{
{
...
...
drivers/net/ni5010.c
View file @
e07b9e8f
...
@@ -309,7 +309,7 @@ static int __init ni5010_probe1(struct net_device *dev, int ioaddr)
...
@@ -309,7 +309,7 @@ static int __init ni5010_probe1(struct net_device *dev, int ioaddr)
PRINTK2
((
KERN_DEBUG
"%s: I/O #9 passed!
\n
"
,
dev
->
name
));
PRINTK2
((
KERN_DEBUG
"%s: I/O #9 passed!
\n
"
,
dev
->
name
));
/* DMA is not supported (yet?), so no use detecting it */
/* DMA is not supported (yet?), so no use detecting it */
lp
=
(
struct
ni5010_local
*
)
dev
->
priv
;
lp
=
netdev_priv
(
dev
)
;
spin_lock_init
(
&
lp
->
lock
);
spin_lock_init
(
&
lp
->
lock
);
...
@@ -484,7 +484,7 @@ static irqreturn_t ni5010_interrupt(int irq, void *dev_id, struct pt_regs *regs)
...
@@ -484,7 +484,7 @@ static irqreturn_t ni5010_interrupt(int irq, void *dev_id, struct pt_regs *regs)
PRINTK2
((
KERN_DEBUG
"%s: entering ni5010_interrupt
\n
"
,
dev
->
name
));
PRINTK2
((
KERN_DEBUG
"%s: entering ni5010_interrupt
\n
"
,
dev
->
name
));
ioaddr
=
dev
->
base_addr
;
ioaddr
=
dev
->
base_addr
;
lp
=
(
struct
ni5010_local
*
)
dev
->
priv
;
lp
=
netdev_priv
(
dev
)
;
spin_lock
(
&
lp
->
lock
);
spin_lock
(
&
lp
->
lock
);
status
=
inb
(
IE_ISTAT
);
status
=
inb
(
IE_ISTAT
);
...
@@ -527,7 +527,7 @@ static void dump_packet(void *buf, int len)
...
@@ -527,7 +527,7 @@ static void dump_packet(void *buf, int len)
/* We have a good packet, get it out of the buffer. */
/* We have a good packet, get it out of the buffer. */
static
void
ni5010_rx
(
struct
net_device
*
dev
)
static
void
ni5010_rx
(
struct
net_device
*
dev
)
{
{
struct
ni5010_local
*
lp
=
(
struct
ni5010_local
*
)
dev
->
priv
;
struct
ni5010_local
*
lp
=
netdev_priv
(
dev
)
;
int
ioaddr
=
dev
->
base_addr
;
int
ioaddr
=
dev
->
base_addr
;
unsigned
char
rcv_stat
;
unsigned
char
rcv_stat
;
struct
sk_buff
*
skb
;
struct
sk_buff
*
skb
;
...
@@ -592,7 +592,7 @@ static void ni5010_rx(struct net_device *dev)
...
@@ -592,7 +592,7 @@ static void ni5010_rx(struct net_device *dev)
static
int
process_xmt_interrupt
(
struct
net_device
*
dev
)
static
int
process_xmt_interrupt
(
struct
net_device
*
dev
)
{
{
struct
ni5010_local
*
lp
=
(
struct
ni5010_local
*
)
dev
->
priv
;
struct
ni5010_local
*
lp
=
netdev_priv
(
dev
)
;
int
ioaddr
=
dev
->
base_addr
;
int
ioaddr
=
dev
->
base_addr
;
int
xmit_stat
;
int
xmit_stat
;
...
@@ -651,7 +651,7 @@ static int ni5010_close(struct net_device *dev)
...
@@ -651,7 +651,7 @@ static int ni5010_close(struct net_device *dev)
closed. */
closed. */
static
struct
net_device_stats
*
ni5010_get_stats
(
struct
net_device
*
dev
)
static
struct
net_device_stats
*
ni5010_get_stats
(
struct
net_device
*
dev
)
{
{
struct
ni5010_local
*
lp
=
(
struct
ni5010_local
*
)
dev
->
priv
;
struct
ni5010_local
*
lp
=
netdev_priv
(
dev
)
;
PRINTK2
((
KERN_DEBUG
"%s: entering ni5010_get_stats
\n
"
,
dev
->
name
));
PRINTK2
((
KERN_DEBUG
"%s: entering ni5010_get_stats
\n
"
,
dev
->
name
));
...
@@ -693,7 +693,7 @@ static void ni5010_set_multicast_list(struct net_device *dev)
...
@@ -693,7 +693,7 @@ static void ni5010_set_multicast_list(struct net_device *dev)
static
void
hardware_send_packet
(
struct
net_device
*
dev
,
char
*
buf
,
int
length
,
int
pad
)
static
void
hardware_send_packet
(
struct
net_device
*
dev
,
char
*
buf
,
int
length
,
int
pad
)
{
{
struct
ni5010_local
*
lp
=
(
struct
ni5010_local
*
)
dev
->
priv
;
struct
ni5010_local
*
lp
=
netdev_priv
(
dev
)
;
int
ioaddr
=
dev
->
base_addr
;
int
ioaddr
=
dev
->
base_addr
;
unsigned
long
flags
;
unsigned
long
flags
;
unsigned
int
buf_offs
;
unsigned
int
buf_offs
;
...
...
drivers/net/rrunner.c
View file @
e07b9e8f
...
@@ -108,7 +108,7 @@ static int __devinit rr_init_one(struct pci_dev *pdev,
...
@@ -108,7 +108,7 @@ static int __devinit rr_init_one(struct pci_dev *pdev,
goto
out2
;
goto
out2
;
}
}
rrpriv
=
(
struct
rr_private
*
)
dev
->
priv
;
rrpriv
=
netdev_priv
(
dev
)
;
SET_MODULE_OWNER
(
dev
);
SET_MODULE_OWNER
(
dev
);
SET_NETDEV_DEV
(
dev
,
&
pdev
->
dev
);
SET_NETDEV_DEV
(
dev
,
&
pdev
->
dev
);
...
@@ -236,7 +236,7 @@ static void __devexit rr_remove_one (struct pci_dev *pdev)
...
@@ -236,7 +236,7 @@ static void __devexit rr_remove_one (struct pci_dev *pdev)
struct
net_device
*
dev
=
pci_get_drvdata
(
pdev
);
struct
net_device
*
dev
=
pci_get_drvdata
(
pdev
);
if
(
dev
)
{
if
(
dev
)
{
struct
rr_private
*
rr
=
dev
->
priv
;
struct
rr_private
*
rr
=
netdev_priv
(
dev
)
;
if
(
!
(
readl
(
&
rr
->
regs
->
HostCtrl
)
&
NIC_HALTED
)){
if
(
!
(
readl
(
&
rr
->
regs
->
HostCtrl
)
&
NIC_HALTED
)){
printk
(
KERN_ERR
"%s: trying to unload running NIC
\n
"
,
printk
(
KERN_ERR
"%s: trying to unload running NIC
\n
"
,
...
@@ -308,7 +308,7 @@ static int rr_reset(struct net_device *dev)
...
@@ -308,7 +308,7 @@ static int rr_reset(struct net_device *dev)
u32
start_pc
;
u32
start_pc
;
int
i
;
int
i
;
rrpriv
=
(
struct
rr_private
*
)
dev
->
priv
;
rrpriv
=
netdev_priv
(
dev
)
;
regs
=
rrpriv
->
regs
;
regs
=
rrpriv
->
regs
;
rr_load_firmware
(
dev
);
rr_load_firmware
(
dev
);
...
@@ -524,7 +524,7 @@ static int __init rr_init(struct net_device *dev)
...
@@ -524,7 +524,7 @@ static int __init rr_init(struct net_device *dev)
u32
sram_size
,
rev
;
u32
sram_size
,
rev
;
int
i
;
int
i
;
rrpriv
=
(
struct
rr_private
*
)
dev
->
priv
;
rrpriv
=
netdev_priv
(
dev
)
;
regs
=
rrpriv
->
regs
;
regs
=
rrpriv
->
regs
;
rev
=
readl
(
&
regs
->
FwRev
);
rev
=
readl
(
&
regs
->
FwRev
);
...
@@ -595,7 +595,7 @@ static int rr_init1(struct net_device *dev)
...
@@ -595,7 +595,7 @@ static int rr_init1(struct net_device *dev)
int
ecode
=
0
;
int
ecode
=
0
;
short
i
;
short
i
;
rrpriv
=
(
struct
rr_private
*
)
dev
->
priv
;
rrpriv
=
netdev_priv
(
dev
)
;
regs
=
rrpriv
->
regs
;
regs
=
rrpriv
->
regs
;
spin_lock_irqsave
(
&
rrpriv
->
lock
,
flags
);
spin_lock_irqsave
(
&
rrpriv
->
lock
,
flags
);
...
@@ -761,7 +761,7 @@ static u32 rr_handle_event(struct net_device *dev, u32 prodidx, u32 eidx)
...
@@ -761,7 +761,7 @@ static u32 rr_handle_event(struct net_device *dev, u32 prodidx, u32 eidx)
struct
rr_regs
*
regs
;
struct
rr_regs
*
regs
;
u32
tmp
;
u32
tmp
;
rrpriv
=
(
struct
rr_private
*
)
dev
->
priv
;
rrpriv
=
netdev_priv
(
dev
)
;
regs
=
rrpriv
->
regs
;
regs
=
rrpriv
->
regs
;
while
(
prodidx
!=
eidx
){
while
(
prodidx
!=
eidx
){
...
@@ -960,7 +960,7 @@ static u32 rr_handle_event(struct net_device *dev, u32 prodidx, u32 eidx)
...
@@ -960,7 +960,7 @@ static u32 rr_handle_event(struct net_device *dev, u32 prodidx, u32 eidx)
static
void
rx_int
(
struct
net_device
*
dev
,
u32
rxlimit
,
u32
index
)
static
void
rx_int
(
struct
net_device
*
dev
,
u32
rxlimit
,
u32
index
)
{
{
struct
rr_private
*
rrpriv
=
(
struct
rr_private
*
)
dev
->
priv
;
struct
rr_private
*
rrpriv
=
netdev_priv
(
dev
)
;
struct
rr_regs
*
regs
=
rrpriv
->
regs
;
struct
rr_regs
*
regs
=
rrpriv
->
regs
;
do
{
do
{
...
@@ -1052,7 +1052,7 @@ static irqreturn_t rr_interrupt(int irq, void *dev_id, struct pt_regs *ptregs)
...
@@ -1052,7 +1052,7 @@ static irqreturn_t rr_interrupt(int irq, void *dev_id, struct pt_regs *ptregs)
struct
net_device
*
dev
=
(
struct
net_device
*
)
dev_id
;
struct
net_device
*
dev
=
(
struct
net_device
*
)
dev_id
;
u32
prodidx
,
rxindex
,
eidx
,
txcsmr
,
rxlimit
,
txcon
;
u32
prodidx
,
rxindex
,
eidx
,
txcsmr
,
rxlimit
,
txcon
;
rrpriv
=
(
struct
rr_private
*
)
dev
->
priv
;
rrpriv
=
netdev_priv
(
dev
)
;
regs
=
rrpriv
->
regs
;
regs
=
rrpriv
->
regs
;
if
(
!
(
readl
(
&
regs
->
HostCtrl
)
&
RR_INT
))
if
(
!
(
readl
(
&
regs
->
HostCtrl
)
&
RR_INT
))
...
@@ -1133,7 +1133,7 @@ static irqreturn_t rr_interrupt(int irq, void *dev_id, struct pt_regs *ptregs)
...
@@ -1133,7 +1133,7 @@ static irqreturn_t rr_interrupt(int irq, void *dev_id, struct pt_regs *ptregs)
static
void
rr_timer
(
unsigned
long
data
)
static
void
rr_timer
(
unsigned
long
data
)
{
{
struct
net_device
*
dev
=
(
struct
net_device
*
)
data
;
struct
net_device
*
dev
=
(
struct
net_device
*
)
data
;
struct
rr_private
*
rrpriv
=
(
struct
rr_private
*
)
dev
->
priv
;
struct
rr_private
*
rrpriv
=
netdev_priv
(
dev
)
;
struct
rr_regs
*
regs
=
rrpriv
->
regs
;
struct
rr_regs
*
regs
=
rrpriv
->
regs
;
unsigned
long
flags
;
unsigned
long
flags
;
...
@@ -1160,7 +1160,7 @@ static void rr_timer(unsigned long data)
...
@@ -1160,7 +1160,7 @@ static void rr_timer(unsigned long data)
static
int
rr_open
(
struct
net_device
*
dev
)
static
int
rr_open
(
struct
net_device
*
dev
)
{
{
struct
rr_private
*
rrpriv
=
(
struct
rr_private
*
)
dev
->
priv
;
struct
rr_private
*
rrpriv
=
netdev_priv
(
dev
)
;
struct
pci_dev
*
pdev
=
rrpriv
->
pci_dev
;
struct
pci_dev
*
pdev
=
rrpriv
->
pci_dev
;
struct
rr_regs
*
regs
;
struct
rr_regs
*
regs
;
int
ecode
=
0
;
int
ecode
=
0
;
...
@@ -1296,7 +1296,7 @@ static void rr_dump(struct net_device *dev)
...
@@ -1296,7 +1296,7 @@ static void rr_dump(struct net_device *dev)
short
i
;
short
i
;
int
len
;
int
len
;
rrpriv
=
(
struct
rr_private
*
)
dev
->
priv
;
rrpriv
=
netdev_priv
(
dev
)
;
regs
=
rrpriv
->
regs
;
regs
=
rrpriv
->
regs
;
printk
(
"%s: dumping NIC TX rings
\n
"
,
dev
->
name
);
printk
(
"%s: dumping NIC TX rings
\n
"
,
dev
->
name
);
...
@@ -1361,7 +1361,7 @@ static int rr_close(struct net_device *dev)
...
@@ -1361,7 +1361,7 @@ static int rr_close(struct net_device *dev)
netif_stop_queue
(
dev
);
netif_stop_queue
(
dev
);
rrpriv
=
(
struct
rr_private
*
)
dev
->
priv
;
rrpriv
=
netdev_priv
(
dev
)
;
regs
=
rrpriv
->
regs
;
regs
=
rrpriv
->
regs
;
/*
/*
...
@@ -1418,7 +1418,7 @@ static int rr_close(struct net_device *dev)
...
@@ -1418,7 +1418,7 @@ static int rr_close(struct net_device *dev)
static
int
rr_start_xmit
(
struct
sk_buff
*
skb
,
struct
net_device
*
dev
)
static
int
rr_start_xmit
(
struct
sk_buff
*
skb
,
struct
net_device
*
dev
)
{
{
struct
rr_private
*
rrpriv
=
(
struct
rr_private
*
)
dev
->
priv
;
struct
rr_private
*
rrpriv
=
netdev_priv
(
dev
)
;
struct
rr_regs
*
regs
=
rrpriv
->
regs
;
struct
rr_regs
*
regs
=
rrpriv
->
regs
;
struct
ring_ctrl
*
txctrl
;
struct
ring_ctrl
*
txctrl
;
unsigned
long
flags
;
unsigned
long
flags
;
...
@@ -1488,7 +1488,7 @@ static struct net_device_stats *rr_get_stats(struct net_device *dev)
...
@@ -1488,7 +1488,7 @@ static struct net_device_stats *rr_get_stats(struct net_device *dev)
{
{
struct
rr_private
*
rrpriv
;
struct
rr_private
*
rrpriv
;
rrpriv
=
(
struct
rr_private
*
)
dev
->
priv
;
rrpriv
=
netdev_priv
(
dev
)
;
return
(
&
rrpriv
->
stats
);
return
(
&
rrpriv
->
stats
);
}
}
...
@@ -1511,7 +1511,7 @@ static int rr_load_firmware(struct net_device *dev)
...
@@ -1511,7 +1511,7 @@ static int rr_load_firmware(struct net_device *dev)
u32
p2len
,
p2size
,
nr_seg
,
revision
,
io
,
sram_size
;
u32
p2len
,
p2size
,
nr_seg
,
revision
,
io
,
sram_size
;
struct
eeprom
*
hw
=
NULL
;
struct
eeprom
*
hw
=
NULL
;
rrpriv
=
(
struct
rr_private
*
)
dev
->
priv
;
rrpriv
=
netdev_priv
(
dev
)
;
regs
=
rrpriv
->
regs
;
regs
=
rrpriv
->
regs
;
if
(
dev
->
flags
&
IFF_UP
)
if
(
dev
->
flags
&
IFF_UP
)
...
@@ -1614,7 +1614,7 @@ static int rr_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
...
@@ -1614,7 +1614,7 @@ static int rr_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
unsigned
int
i
;
unsigned
int
i
;
int
error
=
-
EOPNOTSUPP
;
int
error
=
-
EOPNOTSUPP
;
rrpriv
=
dev
->
priv
;
rrpriv
=
netdev_priv
(
dev
)
;
switch
(
cmd
){
switch
(
cmd
){
case
SIOCRRGFW
:
case
SIOCRRGFW
:
...
...
drivers/net/sb1000.c
View file @
e07b9e8f
...
@@ -746,7 +746,7 @@ sb1000_rx(struct net_device *dev)
...
@@ -746,7 +746,7 @@ sb1000_rx(struct net_device *dev)
int
ioaddr
,
ns
;
int
ioaddr
,
ns
;
unsigned
int
skbsize
;
unsigned
int
skbsize
;
struct
sk_buff
*
skb
;
struct
sk_buff
*
skb
;
struct
sb1000_private
*
lp
=
(
struct
sb1000_private
*
)
dev
->
priv
;
struct
sb1000_private
*
lp
=
netdev_priv
(
dev
)
;
struct
net_device_stats
*
stats
=
&
lp
->
stats
;
struct
net_device_stats
*
stats
=
&
lp
->
stats
;
/* SB1000 frame constants */
/* SB1000 frame constants */
...
@@ -905,7 +905,7 @@ sb1000_error_dpc(struct net_device *dev)
...
@@ -905,7 +905,7 @@ sb1000_error_dpc(struct net_device *dev)
char
*
name
;
char
*
name
;
unsigned
char
st
[
5
];
unsigned
char
st
[
5
];
int
ioaddr
[
2
];
int
ioaddr
[
2
];
struct
sb1000_private
*
lp
=
(
struct
sb1000_private
*
)
dev
->
priv
;
struct
sb1000_private
*
lp
=
netdev_priv
(
dev
)
;
const
unsigned
char
Command0
[
6
]
=
{
0x80
,
0x26
,
0x00
,
0x00
,
0x00
,
0x00
};
const
unsigned
char
Command0
[
6
]
=
{
0x80
,
0x26
,
0x00
,
0x00
,
0x00
,
0x00
};
const
int
ErrorDpcCounterInitialize
=
200
;
const
int
ErrorDpcCounterInitialize
=
200
;
...
@@ -932,7 +932,7 @@ sb1000_open(struct net_device *dev)
...
@@ -932,7 +932,7 @@ sb1000_open(struct net_device *dev)
{
{
char
*
name
;
char
*
name
;
int
ioaddr
[
2
],
status
;
int
ioaddr
[
2
],
status
;
struct
sb1000_private
*
lp
=
(
struct
sb1000_private
*
)
dev
->
priv
;
struct
sb1000_private
*
lp
=
netdev_priv
(
dev
)
;
const
unsigned
short
FirmwareVersion
[]
=
{
0x01
,
0x01
};
const
unsigned
short
FirmwareVersion
[]
=
{
0x01
,
0x01
};
ioaddr
[
0
]
=
dev
->
base_addr
;
ioaddr
[
0
]
=
dev
->
base_addr
;
...
@@ -998,7 +998,7 @@ static int sb1000_dev_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
...
@@ -998,7 +998,7 @@ static int sb1000_dev_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
short
PID
[
4
];
short
PID
[
4
];
int
ioaddr
[
2
],
status
,
frequency
;
int
ioaddr
[
2
],
status
,
frequency
;
unsigned
int
stats
[
5
];
unsigned
int
stats
[
5
];
struct
sb1000_private
*
lp
=
(
struct
sb1000_private
*
)
dev
->
priv
;
struct
sb1000_private
*
lp
=
netdev_priv
(
dev
)
;
if
(
!
(
dev
&&
dev
->
flags
&
IFF_UP
))
if
(
!
(
dev
&&
dev
->
flags
&
IFF_UP
))
return
-
ENODEV
;
return
-
ENODEV
;
...
@@ -1092,7 +1092,7 @@ static irqreturn_t sb1000_interrupt(int irq, void *dev_id, struct pt_regs *regs)
...
@@ -1092,7 +1092,7 @@ static irqreturn_t sb1000_interrupt(int irq, void *dev_id, struct pt_regs *regs)
unsigned
char
st
;
unsigned
char
st
;
int
ioaddr
[
2
];
int
ioaddr
[
2
];
struct
net_device
*
dev
=
(
struct
net_device
*
)
dev_id
;
struct
net_device
*
dev
=
(
struct
net_device
*
)
dev_id
;
struct
sb1000_private
*
lp
=
(
struct
sb1000_private
*
)
dev
->
priv
;
struct
sb1000_private
*
lp
=
netdev_priv
(
dev
)
;
const
unsigned
char
Command0
[
6
]
=
{
0x80
,
0x2c
,
0x00
,
0x00
,
0x00
,
0x00
};
const
unsigned
char
Command0
[
6
]
=
{
0x80
,
0x2c
,
0x00
,
0x00
,
0x00
,
0x00
};
const
unsigned
char
Command1
[
6
]
=
{
0x80
,
0x2e
,
0x00
,
0x00
,
0x00
,
0x00
};
const
unsigned
char
Command1
[
6
]
=
{
0x80
,
0x2e
,
0x00
,
0x00
,
0x00
,
0x00
};
...
@@ -1148,7 +1148,7 @@ static irqreturn_t sb1000_interrupt(int irq, void *dev_id, struct pt_regs *regs)
...
@@ -1148,7 +1148,7 @@ static irqreturn_t sb1000_interrupt(int irq, void *dev_id, struct pt_regs *regs)
static
struct
net_device_stats
*
sb1000_stats
(
struct
net_device
*
dev
)
static
struct
net_device_stats
*
sb1000_stats
(
struct
net_device
*
dev
)
{
{
struct
sb1000_private
*
lp
=
(
struct
sb1000_private
*
)
dev
->
priv
;
struct
sb1000_private
*
lp
=
netdev_priv
(
dev
)
;
return
&
lp
->
stats
;
return
&
lp
->
stats
;
}
}
...
@@ -1156,7 +1156,7 @@ static int sb1000_close(struct net_device *dev)
...
@@ -1156,7 +1156,7 @@ static int sb1000_close(struct net_device *dev)
{
{
int
i
;
int
i
;
int
ioaddr
[
2
];
int
ioaddr
[
2
];
struct
sb1000_private
*
lp
=
(
struct
sb1000_private
*
)
dev
->
priv
;
struct
sb1000_private
*
lp
=
netdev_priv
(
dev
)
;
if
(
sb1000_debug
>
2
)
if
(
sb1000_debug
>
2
)
printk
(
KERN_DEBUG
"%s: Shutting down sb1000.
\n
"
,
dev
->
name
);
printk
(
KERN_DEBUG
"%s: Shutting down sb1000.
\n
"
,
dev
->
name
);
...
...
drivers/net/sb1250-mac.c
View file @
e07b9e8f
...
@@ -2080,7 +2080,7 @@ static int sbmac_set_duplex(struct sbmac_softc *s,sbmac_duplex_t duplex,sbmac_fc
...
@@ -2080,7 +2080,7 @@ static int sbmac_set_duplex(struct sbmac_softc *s,sbmac_duplex_t duplex,sbmac_fc
static
irqreturn_t
sbmac_intr
(
int
irq
,
void
*
dev_instance
,
struct
pt_regs
*
rgs
)
static
irqreturn_t
sbmac_intr
(
int
irq
,
void
*
dev_instance
,
struct
pt_regs
*
rgs
)
{
{
struct
net_device
*
dev
=
(
struct
net_device
*
)
dev_instance
;
struct
net_device
*
dev
=
(
struct
net_device
*
)
dev_instance
;
struct
sbmac_softc
*
sc
=
(
struct
sbmac_softc
*
)
(
dev
->
pri
v
);
struct
sbmac_softc
*
sc
=
netdev_priv
(
de
v
);
uint64_t
isr
;
uint64_t
isr
;
int
handled
=
0
;
int
handled
=
0
;
...
@@ -2150,7 +2150,7 @@ static irqreturn_t sbmac_intr(int irq,void *dev_instance,struct pt_regs *rgs)
...
@@ -2150,7 +2150,7 @@ static irqreturn_t sbmac_intr(int irq,void *dev_instance,struct pt_regs *rgs)
********************************************************************* */
********************************************************************* */
static
int
sbmac_start_tx
(
struct
sk_buff
*
skb
,
struct
net_device
*
dev
)
static
int
sbmac_start_tx
(
struct
sk_buff
*
skb
,
struct
net_device
*
dev
)
{
{
struct
sbmac_softc
*
sc
=
(
struct
sbmac_softc
*
)
dev
->
priv
;
struct
sbmac_softc
*
sc
=
netdev_priv
(
dev
)
;
/* lock eth irq */
/* lock eth irq */
spin_lock_irq
(
&
sc
->
sbm_lock
);
spin_lock_irq
(
&
sc
->
sbm_lock
);
...
@@ -2374,7 +2374,7 @@ static int sbmac_init(struct net_device *dev, int idx)
...
@@ -2374,7 +2374,7 @@ static int sbmac_init(struct net_device *dev, int idx)
int
i
;
int
i
;
int
err
;
int
err
;
sc
=
(
struct
sbmac_softc
*
)
dev
->
priv
;
sc
=
netdev_priv
(
dev
)
;
/* Determine controller base address */
/* Determine controller base address */
...
@@ -2454,7 +2454,7 @@ static int sbmac_init(struct net_device *dev, int idx)
...
@@ -2454,7 +2454,7 @@ static int sbmac_init(struct net_device *dev, int idx)
static
int
sbmac_open
(
struct
net_device
*
dev
)
static
int
sbmac_open
(
struct
net_device
*
dev
)
{
{
struct
sbmac_softc
*
sc
=
(
struct
sbmac_softc
*
)
dev
->
priv
;
struct
sbmac_softc
*
sc
=
netdev_priv
(
dev
)
;
if
(
debug
>
1
)
{
if
(
debug
>
1
)
{
printk
(
KERN_DEBUG
"%s: sbmac_open() irq %d.
\n
"
,
dev
->
name
,
dev
->
irq
);
printk
(
KERN_DEBUG
"%s: sbmac_open() irq %d.
\n
"
,
dev
->
name
,
dev
->
irq
);
...
@@ -2609,7 +2609,7 @@ static int sbmac_mii_poll(struct sbmac_softc *s,int noisy)
...
@@ -2609,7 +2609,7 @@ static int sbmac_mii_poll(struct sbmac_softc *s,int noisy)
static
void
sbmac_timer
(
unsigned
long
data
)
static
void
sbmac_timer
(
unsigned
long
data
)
{
{
struct
net_device
*
dev
=
(
struct
net_device
*
)
data
;
struct
net_device
*
dev
=
(
struct
net_device
*
)
data
;
struct
sbmac_softc
*
sc
=
(
struct
sbmac_softc
*
)
dev
->
priv
;
struct
sbmac_softc
*
sc
=
netdev_priv
(
dev
)
;
int
next_tick
=
HZ
;
int
next_tick
=
HZ
;
int
mii_status
;
int
mii_status
;
...
@@ -2655,7 +2655,7 @@ static void sbmac_timer(unsigned long data)
...
@@ -2655,7 +2655,7 @@ static void sbmac_timer(unsigned long data)
static
void
sbmac_tx_timeout
(
struct
net_device
*
dev
)
static
void
sbmac_tx_timeout
(
struct
net_device
*
dev
)
{
{
struct
sbmac_softc
*
sc
=
(
struct
sbmac_softc
*
)
dev
->
priv
;
struct
sbmac_softc
*
sc
=
netdev_priv
(
dev
)
;
spin_lock_irq
(
&
sc
->
sbm_lock
);
spin_lock_irq
(
&
sc
->
sbm_lock
);
...
@@ -2673,7 +2673,7 @@ static void sbmac_tx_timeout (struct net_device *dev)
...
@@ -2673,7 +2673,7 @@ static void sbmac_tx_timeout (struct net_device *dev)
static
struct
net_device_stats
*
sbmac_get_stats
(
struct
net_device
*
dev
)
static
struct
net_device_stats
*
sbmac_get_stats
(
struct
net_device
*
dev
)
{
{
struct
sbmac_softc
*
sc
=
(
struct
sbmac_softc
*
)
dev
->
priv
;
struct
sbmac_softc
*
sc
=
netdev_priv
(
dev
)
;
unsigned
long
flags
;
unsigned
long
flags
;
spin_lock_irqsave
(
&
sc
->
sbm_lock
,
flags
);
spin_lock_irqsave
(
&
sc
->
sbm_lock
,
flags
);
...
@@ -2691,7 +2691,7 @@ static void sbmac_set_rx_mode(struct net_device *dev)
...
@@ -2691,7 +2691,7 @@ static void sbmac_set_rx_mode(struct net_device *dev)
{
{
unsigned
long
flags
;
unsigned
long
flags
;
int
msg_flag
=
0
;
int
msg_flag
=
0
;
struct
sbmac_softc
*
sc
=
(
struct
sbmac_softc
*
)
dev
->
priv
;
struct
sbmac_softc
*
sc
=
netdev_priv
(
dev
)
;
spin_lock_irqsave
(
&
sc
->
sbm_lock
,
flags
);
spin_lock_irqsave
(
&
sc
->
sbm_lock
,
flags
);
if
((
dev
->
flags
^
sc
->
sbm_devflags
)
&
IFF_PROMISC
)
{
if
((
dev
->
flags
^
sc
->
sbm_devflags
)
&
IFF_PROMISC
)
{
...
@@ -2726,7 +2726,7 @@ static void sbmac_set_rx_mode(struct net_device *dev)
...
@@ -2726,7 +2726,7 @@ static void sbmac_set_rx_mode(struct net_device *dev)
static
int
sbmac_mii_ioctl
(
struct
net_device
*
dev
,
struct
ifreq
*
rq
,
int
cmd
)
static
int
sbmac_mii_ioctl
(
struct
net_device
*
dev
,
struct
ifreq
*
rq
,
int
cmd
)
{
{
struct
sbmac_softc
*
sc
=
(
struct
sbmac_softc
*
)
dev
->
priv
;
struct
sbmac_softc
*
sc
=
netdev_priv
(
dev
)
;
u16
*
data
=
(
u16
*
)
&
rq
->
ifr_data
;
u16
*
data
=
(
u16
*
)
&
rq
->
ifr_data
;
unsigned
long
flags
;
unsigned
long
flags
;
int
retval
;
int
retval
;
...
@@ -2762,7 +2762,7 @@ static int sbmac_mii_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
...
@@ -2762,7 +2762,7 @@ static int sbmac_mii_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
static
int
sbmac_close
(
struct
net_device
*
dev
)
static
int
sbmac_close
(
struct
net_device
*
dev
)
{
{
struct
sbmac_softc
*
sc
=
(
struct
sbmac_softc
*
)
dev
->
priv
;
struct
sbmac_softc
*
sc
=
netdev_priv
(
dev
)
;
unsigned
long
flags
;
unsigned
long
flags
;
int
irq
;
int
irq
;
...
@@ -2911,7 +2911,7 @@ sbmac_cleanup_module(void)
...
@@ -2911,7 +2911,7 @@ sbmac_cleanup_module(void)
for
(
idx
=
0
;
idx
<
MAX_UNITS
;
idx
++
)
{
for
(
idx
=
0
;
idx
<
MAX_UNITS
;
idx
++
)
{
dev
=
dev_sbmac
[
idx
];
dev
=
dev_sbmac
[
idx
];
if
(
!
dev
)
{
if
(
!
dev
)
{
struct
sbmac_softc
*
sc
=
dev
->
priv
;
struct
sbmac_softc
*
sc
=
netdev_priv
(
dev
)
;
unregister_netdev
(
dev
);
unregister_netdev
(
dev
);
sbmac_uninitctx
(
sc
);
sbmac_uninitctx
(
sc
);
free_netdev
(
dev
);
free_netdev
(
dev
);
...
...
drivers/net/seeq8005.c
View file @
e07b9e8f
...
@@ -357,7 +357,7 @@ static int __init seeq8005_probe1(struct net_device *dev, int ioaddr)
...
@@ -357,7 +357,7 @@ static int __init seeq8005_probe1(struct net_device *dev, int ioaddr)
*/
*/
static
int
seeq8005_open
(
struct
net_device
*
dev
)
static
int
seeq8005_open
(
struct
net_device
*
dev
)
{
{
struct
net_local
*
lp
=
(
struct
net_local
*
)
dev
->
priv
;
struct
net_local
*
lp
=
netdev_priv
(
dev
)
;
{
{
int
irqval
=
request_irq
(
dev
->
irq
,
&
seeq8005_interrupt
,
0
,
"seeq8005"
,
dev
);
int
irqval
=
request_irq
(
dev
->
irq
,
&
seeq8005_interrupt
,
0
,
"seeq8005"
,
dev
);
...
@@ -390,7 +390,7 @@ static void seeq8005_timeout(struct net_device *dev)
...
@@ -390,7 +390,7 @@ static void seeq8005_timeout(struct net_device *dev)
static
int
seeq8005_send_packet
(
struct
sk_buff
*
skb
,
struct
net_device
*
dev
)
static
int
seeq8005_send_packet
(
struct
sk_buff
*
skb
,
struct
net_device
*
dev
)
{
{
struct
net_local
*
lp
=
(
struct
net_local
*
)
dev
->
priv
;
struct
net_local
*
lp
=
netdev_priv
(
dev
)
;
short
length
=
skb
->
len
;
short
length
=
skb
->
len
;
unsigned
char
*
buf
;
unsigned
char
*
buf
;
...
@@ -424,7 +424,7 @@ static irqreturn_t seeq8005_interrupt(int irq, void *dev_id, struct pt_regs * re
...
@@ -424,7 +424,7 @@ static irqreturn_t seeq8005_interrupt(int irq, void *dev_id, struct pt_regs * re
int
handled
=
0
;
int
handled
=
0
;
ioaddr
=
dev
->
base_addr
;
ioaddr
=
dev
->
base_addr
;
lp
=
(
struct
net_local
*
)
dev
->
priv
;
lp
=
netdev_priv
(
dev
)
;
status
=
inw
(
SEEQ_STATUS
);
status
=
inw
(
SEEQ_STATUS
);
do
{
do
{
...
@@ -462,7 +462,7 @@ static irqreturn_t seeq8005_interrupt(int irq, void *dev_id, struct pt_regs * re
...
@@ -462,7 +462,7 @@ static irqreturn_t seeq8005_interrupt(int irq, void *dev_id, struct pt_regs * re
/* We have a good packet(s), get it/them out of the buffers. */
/* We have a good packet(s), get it/them out of the buffers. */
static
void
seeq8005_rx
(
struct
net_device
*
dev
)
static
void
seeq8005_rx
(
struct
net_device
*
dev
)
{
{
struct
net_local
*
lp
=
(
struct
net_local
*
)
dev
->
priv
;
struct
net_local
*
lp
=
netdev_priv
(
dev
)
;
int
boguscount
=
10
;
int
boguscount
=
10
;
int
pkt_hdr
;
int
pkt_hdr
;
int
ioaddr
=
dev
->
base_addr
;
int
ioaddr
=
dev
->
base_addr
;
...
@@ -561,7 +561,7 @@ static void seeq8005_rx(struct net_device *dev)
...
@@ -561,7 +561,7 @@ static void seeq8005_rx(struct net_device *dev)
/* The inverse routine to net_open(). */
/* The inverse routine to net_open(). */
static
int
seeq8005_close
(
struct
net_device
*
dev
)
static
int
seeq8005_close
(
struct
net_device
*
dev
)
{
{
struct
net_local
*
lp
=
(
struct
net_local
*
)
dev
->
priv
;
struct
net_local
*
lp
=
netdev_priv
(
dev
)
;
int
ioaddr
=
dev
->
base_addr
;
int
ioaddr
=
dev
->
base_addr
;
lp
->
open_time
=
0
;
lp
->
open_time
=
0
;
...
@@ -583,7 +583,7 @@ static int seeq8005_close(struct net_device *dev)
...
@@ -583,7 +583,7 @@ static int seeq8005_close(struct net_device *dev)
closed. */
closed. */
static
struct
net_device_stats
*
seeq8005_get_stats
(
struct
net_device
*
dev
)
static
struct
net_device_stats
*
seeq8005_get_stats
(
struct
net_device
*
dev
)
{
{
struct
net_local
*
lp
=
(
struct
net_local
*
)
dev
->
priv
;
struct
net_local
*
lp
=
netdev_priv
(
dev
)
;
return
&
lp
->
stats
;
return
&
lp
->
stats
;
}
}
...
@@ -618,7 +618,7 @@ static void set_multicast_list(struct net_device *dev)
...
@@ -618,7 +618,7 @@ static void set_multicast_list(struct net_device *dev)
void
seeq8005_init
(
struct
net_device
*
dev
,
int
startp
)
void
seeq8005_init
(
struct
net_device
*
dev
,
int
startp
)
{
{
struct
net_local
*
lp
=
(
struct
net_local
*
)
dev
->
priv
;
struct
net_local
*
lp
=
netdev_priv
(
dev
)
;
int
ioaddr
=
dev
->
base_addr
;
int
ioaddr
=
dev
->
base_addr
;
int
i
;
int
i
;
...
...
drivers/net/sgiseeq.c
View file @
e07b9e8f
...
@@ -151,7 +151,7 @@ static inline void seeq_load_eaddr(struct net_device *dev,
...
@@ -151,7 +151,7 @@ static inline void seeq_load_eaddr(struct net_device *dev,
static
int
seeq_init_ring
(
struct
net_device
*
dev
)
static
int
seeq_init_ring
(
struct
net_device
*
dev
)
{
{
struct
sgiseeq_private
*
sp
=
(
struct
sgiseeq_private
*
)
dev
->
priv
;
struct
sgiseeq_private
*
sp
=
netdev_priv
(
dev
)
;
volatile
struct
sgiseeq_init_block
*
ib
=
&
sp
->
srings
;
volatile
struct
sgiseeq_init_block
*
ib
=
&
sp
->
srings
;
int
i
;
int
i
;
...
@@ -423,7 +423,7 @@ static inline void sgiseeq_tx(struct net_device *dev, struct sgiseeq_private *sp
...
@@ -423,7 +423,7 @@ static inline void sgiseeq_tx(struct net_device *dev, struct sgiseeq_private *sp
static
irqreturn_t
sgiseeq_interrupt
(
int
irq
,
void
*
dev_id
,
struct
pt_regs
*
regs
)
static
irqreturn_t
sgiseeq_interrupt
(
int
irq
,
void
*
dev_id
,
struct
pt_regs
*
regs
)
{
{
struct
net_device
*
dev
=
(
struct
net_device
*
)
dev_id
;
struct
net_device
*
dev
=
(
struct
net_device
*
)
dev_id
;
struct
sgiseeq_private
*
sp
=
(
struct
sgiseeq_private
*
)
dev
->
priv
;
struct
sgiseeq_private
*
sp
=
netdev_priv
(
dev
)
;
struct
hpc3_ethregs
*
hregs
=
sp
->
hregs
;
struct
hpc3_ethregs
*
hregs
=
sp
->
hregs
;
struct
sgiseeq_regs
*
sregs
=
sp
->
sregs
;
struct
sgiseeq_regs
*
sregs
=
sp
->
sregs
;
...
@@ -445,7 +445,7 @@ static irqreturn_t sgiseeq_interrupt(int irq, void *dev_id, struct pt_regs *regs
...
@@ -445,7 +445,7 @@ static irqreturn_t sgiseeq_interrupt(int irq, void *dev_id, struct pt_regs *regs
static
int
sgiseeq_open
(
struct
net_device
*
dev
)
static
int
sgiseeq_open
(
struct
net_device
*
dev
)
{
{
struct
sgiseeq_private
*
sp
=
(
struct
sgiseeq_private
*
)
dev
->
priv
;
struct
sgiseeq_private
*
sp
=
netdev_priv
(
dev
)
;
struct
sgiseeq_regs
*
sregs
=
sp
->
sregs
;
struct
sgiseeq_regs
*
sregs
=
sp
->
sregs
;
int
err
=
init_seeq
(
dev
,
sp
,
sregs
);
int
err
=
init_seeq
(
dev
,
sp
,
sregs
);
...
@@ -459,7 +459,7 @@ static int sgiseeq_open(struct net_device *dev)
...
@@ -459,7 +459,7 @@ static int sgiseeq_open(struct net_device *dev)
static
int
sgiseeq_close
(
struct
net_device
*
dev
)
static
int
sgiseeq_close
(
struct
net_device
*
dev
)
{
{
struct
sgiseeq_private
*
sp
=
(
struct
sgiseeq_private
*
)
dev
->
priv
;
struct
sgiseeq_private
*
sp
=
netdev_priv
(
dev
)
;
struct
sgiseeq_regs
*
sregs
=
sp
->
sregs
;
struct
sgiseeq_regs
*
sregs
=
sp
->
sregs
;
netif_stop_queue
(
dev
);
netif_stop_queue
(
dev
);
...
@@ -472,7 +472,7 @@ static int sgiseeq_close(struct net_device *dev)
...
@@ -472,7 +472,7 @@ static int sgiseeq_close(struct net_device *dev)
static
inline
int
sgiseeq_reset
(
struct
net_device
*
dev
)
static
inline
int
sgiseeq_reset
(
struct
net_device
*
dev
)
{
{
struct
sgiseeq_private
*
sp
=
(
struct
sgiseeq_private
*
)
dev
->
priv
;
struct
sgiseeq_private
*
sp
=
netdev_priv
(
dev
)
;
struct
sgiseeq_regs
*
sregs
=
sp
->
sregs
;
struct
sgiseeq_regs
*
sregs
=
sp
->
sregs
;
int
err
;
int
err
;
...
@@ -494,7 +494,7 @@ void sgiseeq_my_reset(void)
...
@@ -494,7 +494,7 @@ void sgiseeq_my_reset(void)
static
int
sgiseeq_start_xmit
(
struct
sk_buff
*
skb
,
struct
net_device
*
dev
)
static
int
sgiseeq_start_xmit
(
struct
sk_buff
*
skb
,
struct
net_device
*
dev
)
{
{
struct
sgiseeq_private
*
sp
=
(
struct
sgiseeq_private
*
)
dev
->
priv
;
struct
sgiseeq_private
*
sp
=
netdev_priv
(
dev
)
;
struct
hpc3_ethregs
*
hregs
=
sp
->
hregs
;
struct
hpc3_ethregs
*
hregs
=
sp
->
hregs
;
unsigned
long
flags
;
unsigned
long
flags
;
struct
sgiseeq_tx_desc
*
td
;
struct
sgiseeq_tx_desc
*
td
;
...
@@ -560,7 +560,7 @@ static void timeout(struct net_device *dev)
...
@@ -560,7 +560,7 @@ static void timeout(struct net_device *dev)
static
struct
net_device_stats
*
sgiseeq_get_stats
(
struct
net_device
*
dev
)
static
struct
net_device_stats
*
sgiseeq_get_stats
(
struct
net_device
*
dev
)
{
{
struct
sgiseeq_private
*
sp
=
(
struct
sgiseeq_private
*
)
dev
->
priv
;
struct
sgiseeq_private
*
sp
=
netdev_priv
(
dev
)
;
return
&
sp
->
stats
;
return
&
sp
->
stats
;
}
}
...
@@ -710,7 +710,7 @@ static void __exit sgiseeq_exit(void)
...
@@ -710,7 +710,7 @@ static void __exit sgiseeq_exit(void)
struct
net_device
*
next
,
*
dev
=
root_sgiseeq_dev
;
struct
net_device
*
next
,
*
dev
=
root_sgiseeq_dev
;
while
(
dev
)
{
while
(
dev
)
{
sp
=
(
struct
sgiseeq_private
*
)
dev
->
priv
;
sp
=
netdev_priv
(
dev
)
;
next
=
sp
->
next_module
;
next
=
sp
->
next_module
;
unregister_netdev
(
dev
);
unregister_netdev
(
dev
);
free_irq
(
dev
->
irq
,
dev
);
free_irq
(
dev
->
irq
,
dev
);
...
...
drivers/net/sk_g16.c
View file @
e07b9e8f
...
@@ -650,7 +650,7 @@ int __init SK_probe(struct net_device *dev, short ioaddr)
...
@@ -650,7 +650,7 @@ int __init SK_probe(struct net_device *dev, short ioaddr)
int
sk_addr_flag
=
0
;
/* SK ADDR correct? 1 - no, 0 - yes */
int
sk_addr_flag
=
0
;
/* SK ADDR correct? 1 - no, 0 - yes */
unsigned
int
rom_addr
;
/* used to store RAM address used for POS_ADDR */
unsigned
int
rom_addr
;
/* used to store RAM address used for POS_ADDR */
struct
priv
*
p
=
dev
->
priv
;
/* SK_G16 private structure */
struct
priv
*
p
=
netdev_priv
(
dev
);
/* SK_G16 private structure */
if
(
inb
(
SK_POS0
)
!=
SK_IDLOW
||
inb
(
SK_POS1
)
!=
SK_IDHIGH
)
if
(
inb
(
SK_POS0
)
!=
SK_IDLOW
||
inb
(
SK_POS1
)
!=
SK_IDHIGH
)
return
-
ENODEV
;
return
-
ENODEV
;
...
@@ -869,7 +869,7 @@ static int SK_open(struct net_device *dev)
...
@@ -869,7 +869,7 @@ static int SK_open(struct net_device *dev)
int
irqtab
[]
=
SK_IRQS
;
int
irqtab
[]
=
SK_IRQS
;
struct
priv
*
p
=
(
struct
priv
*
)
dev
->
priv
;
struct
priv
*
p
=
netdev_priv
(
dev
)
;
PRINTK
((
"## %s: At beginning of SK_open(). CSR0: %#06x
\n
"
,
PRINTK
((
"## %s: At beginning of SK_open(). CSR0: %#06x
\n
"
,
SK_NAME
,
SK_read_reg
(
CSR0
)));
SK_NAME
,
SK_read_reg
(
CSR0
)));
...
@@ -1023,7 +1023,7 @@ static int SK_lance_init(struct net_device *dev, unsigned short mode)
...
@@ -1023,7 +1023,7 @@ static int SK_lance_init(struct net_device *dev, unsigned short mode)
{
{
int
i
;
int
i
;
unsigned
long
flags
;
unsigned
long
flags
;
struct
priv
*
p
=
(
struct
priv
*
)
dev
->
priv
;
struct
priv
*
p
=
netdev_priv
(
dev
);
struct
tmd
*
tmdp
;
struct
tmd
*
tmdp
;
struct
rmd
*
rmdp
;
struct
rmd
*
rmdp
;
...
@@ -1196,7 +1196,7 @@ static void SK_timeout(struct net_device *dev)
...
@@ -1196,7 +1196,7 @@ static void SK_timeout(struct net_device *dev)
static
int
SK_send_packet
(
struct
sk_buff
*
skb
,
struct
net_device
*
dev
)
static
int
SK_send_packet
(
struct
sk_buff
*
skb
,
struct
net_device
*
dev
)
{
{
struct
priv
*
p
=
(
struct
priv
*
)
dev
->
priv
;
struct
priv
*
p
=
netdev_priv
(
dev
)
;
struct
tmd
*
tmdp
;
struct
tmd
*
tmdp
;
static
char
pad
[
64
];
static
char
pad
[
64
];
...
@@ -1285,7 +1285,7 @@ static irqreturn_t SK_interrupt(int irq, void *dev_id, struct pt_regs * regs)
...
@@ -1285,7 +1285,7 @@ static irqreturn_t SK_interrupt(int irq, void *dev_id, struct pt_regs * regs)
{
{
int
csr0
;
int
csr0
;
struct
net_device
*
dev
=
dev_id
;
struct
net_device
*
dev
=
dev_id
;
struct
priv
*
p
=
(
struct
priv
*
)
dev
->
priv
;
struct
priv
*
p
=
netdev_priv
(
dev
)
;
PRINTK2
((
"## %s: SK_interrupt(). status: %#06x
\n
"
,
PRINTK2
((
"## %s: SK_interrupt(). status: %#06x
\n
"
,
...
@@ -1355,7 +1355,7 @@ static void SK_txintr(struct net_device *dev)
...
@@ -1355,7 +1355,7 @@ static void SK_txintr(struct net_device *dev)
{
{
int
tmdstat
;
int
tmdstat
;
struct
tmd
*
tmdp
;
struct
tmd
*
tmdp
;
struct
priv
*
p
=
(
struct
priv
*
)
dev
->
priv
;
struct
priv
*
p
=
netdev_priv
(
dev
)
;
PRINTK2
((
"## %s: SK_txintr() status: %#06x
\n
"
,
PRINTK2
((
"## %s: SK_txintr() status: %#06x
\n
"
,
...
@@ -1469,7 +1469,7 @@ static void SK_rxintr(struct net_device *dev)
...
@@ -1469,7 +1469,7 @@ static void SK_rxintr(struct net_device *dev)
struct
rmd
*
rmdp
;
struct
rmd
*
rmdp
;
int
rmdstat
;
int
rmdstat
;
struct
priv
*
p
=
(
struct
priv
*
)
dev
->
priv
;
struct
priv
*
p
=
netdev_priv
(
dev
)
;
PRINTK2
((
"## %s: SK_rxintr(). CSR0: %#06x
\n
"
,
PRINTK2
((
"## %s: SK_rxintr(). CSR0: %#06x
\n
"
,
SK_NAME
,
SK_read_reg
(
CSR0
)));
SK_NAME
,
SK_read_reg
(
CSR0
)));
...
@@ -1653,7 +1653,7 @@ static int SK_close(struct net_device *dev)
...
@@ -1653,7 +1653,7 @@ static int SK_close(struct net_device *dev)
static
struct
net_device_stats
*
SK_get_stats
(
struct
net_device
*
dev
)
static
struct
net_device_stats
*
SK_get_stats
(
struct
net_device
*
dev
)
{
{
struct
priv
*
p
=
(
struct
priv
*
)
dev
->
priv
;
struct
priv
*
p
=
netdev_priv
(
dev
)
;
PRINTK
((
"## %s: SK_get_stats(). CSR0: %#06x
\n
"
,
PRINTK
((
"## %s: SK_get_stats(). CSR0: %#06x
\n
"
,
SK_NAME
,
SK_read_reg
(
CSR0
)));
SK_NAME
,
SK_read_reg
(
CSR0
)));
...
@@ -2030,7 +2030,7 @@ void __init SK_print_ram(struct net_device *dev)
...
@@ -2030,7 +2030,7 @@ void __init SK_print_ram(struct net_device *dev)
{
{
int
i
;
int
i
;
struct
priv
*
p
=
(
struct
priv
*
)
dev
->
priv
;
struct
priv
*
p
=
netdev_priv
(
dev
)
;
printk
(
"## %s: RAM Details.
\n
"
printk
(
"## %s: RAM Details.
\n
"
"## RAM at %#08x tmdhead: %#08x rmdhead: %#08x initblock: %#08x
\n
"
,
"## RAM at %#08x tmdhead: %#08x rmdhead: %#08x initblock: %#08x
\n
"
,
...
...
drivers/net/smc9194.c
View file @
e07b9e8f
...
@@ -465,7 +465,7 @@ static void smc_setmulticast( int ioaddr, int count, struct dev_mc_list * addrs
...
@@ -465,7 +465,7 @@ static void smc_setmulticast( int ioaddr, int count, struct dev_mc_list * addrs
*/
*/
static
int
smc_wait_to_send_packet
(
struct
sk_buff
*
skb
,
struct
net_device
*
dev
)
static
int
smc_wait_to_send_packet
(
struct
sk_buff
*
skb
,
struct
net_device
*
dev
)
{
{
struct
smc_local
*
lp
=
(
struct
smc_local
*
)
dev
->
priv
;
struct
smc_local
*
lp
=
netdev_priv
(
dev
)
;
unsigned
short
ioaddr
=
dev
->
base_addr
;
unsigned
short
ioaddr
=
dev
->
base_addr
;
word
length
;
word
length
;
unsigned
short
numPages
;
unsigned
short
numPages
;
...
@@ -576,7 +576,7 @@ static int smc_wait_to_send_packet( struct sk_buff * skb, struct net_device * de
...
@@ -576,7 +576,7 @@ static int smc_wait_to_send_packet( struct sk_buff * skb, struct net_device * de
*/
*/
static
void
smc_hardware_send_packet
(
struct
net_device
*
dev
)
static
void
smc_hardware_send_packet
(
struct
net_device
*
dev
)
{
{
struct
smc_local
*
lp
=
(
struct
smc_local
*
)
dev
->
priv
;
struct
smc_local
*
lp
=
netdev_priv
(
dev
)
;
byte
packet_no
;
byte
packet_no
;
struct
sk_buff
*
skb
=
lp
->
saved_skb
;
struct
sk_buff
*
skb
=
lp
->
saved_skb
;
word
length
;
word
length
;
...
@@ -1150,7 +1150,7 @@ static irqreturn_t smc_interrupt(int irq, void * dev_id, struct pt_regs * regs)
...
@@ -1150,7 +1150,7 @@ static irqreturn_t smc_interrupt(int irq, void * dev_id, struct pt_regs * regs)
{
{
struct
net_device
*
dev
=
dev_id
;
struct
net_device
*
dev
=
dev_id
;
int
ioaddr
=
dev
->
base_addr
;
int
ioaddr
=
dev
->
base_addr
;
struct
smc_local
*
lp
=
(
struct
smc_local
*
)
dev
->
priv
;
struct
smc_local
*
lp
=
netdev_priv
(
dev
)
;
byte
status
;
byte
status
;
word
card_stats
;
word
card_stats
;
...
@@ -1274,7 +1274,7 @@ static irqreturn_t smc_interrupt(int irq, void * dev_id, struct pt_regs * regs)
...
@@ -1274,7 +1274,7 @@ static irqreturn_t smc_interrupt(int irq, void * dev_id, struct pt_regs * regs)
*/
*/
static
void
smc_rcv
(
struct
net_device
*
dev
)
static
void
smc_rcv
(
struct
net_device
*
dev
)
{
{
struct
smc_local
*
lp
=
(
struct
smc_local
*
)
dev
->
priv
;
struct
smc_local
*
lp
=
netdev_priv
(
dev
)
;
int
ioaddr
=
dev
->
base_addr
;
int
ioaddr
=
dev
->
base_addr
;
int
packet_number
;
int
packet_number
;
word
status
;
word
status
;
...
@@ -1401,7 +1401,7 @@ static void smc_rcv(struct net_device *dev)
...
@@ -1401,7 +1401,7 @@ static void smc_rcv(struct net_device *dev)
static
void
smc_tx
(
struct
net_device
*
dev
)
static
void
smc_tx
(
struct
net_device
*
dev
)
{
{
int
ioaddr
=
dev
->
base_addr
;
int
ioaddr
=
dev
->
base_addr
;
struct
smc_local
*
lp
=
(
struct
smc_local
*
)
dev
->
priv
;
struct
smc_local
*
lp
=
netdev_priv
(
dev
)
;
byte
saved_packet
;
byte
saved_packet
;
byte
packet_no
;
byte
packet_no
;
word
tx_status
;
word
tx_status
;
...
@@ -1474,7 +1474,7 @@ static int smc_close(struct net_device *dev)
...
@@ -1474,7 +1474,7 @@ static int smc_close(struct net_device *dev)
. This may be called with the card open or closed.
. This may be called with the card open or closed.
.-------------------------------------------------------------*/
.-------------------------------------------------------------*/
static
struct
net_device_stats
*
smc_query_statistics
(
struct
net_device
*
dev
)
{
static
struct
net_device_stats
*
smc_query_statistics
(
struct
net_device
*
dev
)
{
struct
smc_local
*
lp
=
(
struct
smc_local
*
)
dev
->
priv
;
struct
smc_local
*
lp
=
netdev_priv
(
dev
)
;
return
&
lp
->
stats
;
return
&
lp
->
stats
;
}
}
...
...
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