Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
linux
Commits
3da972f0
Commit
3da972f0
authored
Dec 26, 2004
by
Jeff Garzik
Browse files
Options
Browse Files
Download
Plain Diff
Merge pobox.com:/garz/repo/netdev-2.6/hp100
into pobox.com:/garz/repo/net-drivers-2.6
parents
82331045
6e7ec4ed
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
36 additions
and
29 deletions
+36
-29
drivers/net/hp100.c
drivers/net/hp100.c
+36
-29
No files found.
drivers/net/hp100.c
View file @
3da972f0
...
@@ -280,8 +280,14 @@ static void hp100_RegisterDump(struct net_device *dev);
...
@@ -280,8 +280,14 @@ static void hp100_RegisterDump(struct net_device *dev);
* address - Jean II */
* address - Jean II */
static
inline
dma_addr_t
virt_to_whatever
(
struct
net_device
*
dev
,
u32
*
ptr
)
static
inline
dma_addr_t
virt_to_whatever
(
struct
net_device
*
dev
,
u32
*
ptr
)
{
{
return
((
u_long
)
ptr
)
+
struct
hp100_private
*
lp
=
netdev_priv
(
dev
);
((
struct
hp100_private
*
)
(
dev
->
priv
))
->
whatever_offset
;
return
((
u_long
)
ptr
)
+
lp
->
whatever_offset
;
}
static
inline
u_int
pdl_map_data
(
struct
hp100_private
*
lp
,
void
*
data
)
{
return
pci_map_single
(
lp
->
pci_dev
,
data
,
MAX_ETHER_SIZE
,
PCI_DMA_FROMDEVICE
);
}
}
/* TODO: This function should not really be needed in a good design... */
/* TODO: This function should not really be needed in a good design... */
...
@@ -631,7 +637,7 @@ static int __init hp100_probe1(struct net_device *dev, int ioaddr,
...
@@ -631,7 +637,7 @@ static int __init hp100_probe1(struct net_device *dev, int ioaddr,
}
}
/* Initialise the "private" data structure for this card. */
/* Initialise the "private" data structure for this card. */
lp
=
(
struct
hp100_private
*
)
dev
->
priv
;
lp
=
netdev_priv
(
dev
)
;
spin_lock_init
(
&
lp
->
lock
);
spin_lock_init
(
&
lp
->
lock
);
strlcpy
(
lp
->
id
,
eid
,
HP100_SIG_LEN
);
strlcpy
(
lp
->
id
,
eid
,
HP100_SIG_LEN
);
...
@@ -781,7 +787,7 @@ static int __init hp100_probe1(struct net_device *dev, int ioaddr,
...
@@ -781,7 +787,7 @@ static int __init hp100_probe1(struct net_device *dev, int ioaddr,
static
void
hp100_hwinit
(
struct
net_device
*
dev
)
static
void
hp100_hwinit
(
struct
net_device
*
dev
)
{
{
int
ioaddr
=
dev
->
base_addr
;
int
ioaddr
=
dev
->
base_addr
;
struct
hp100_private
*
lp
=
(
struct
hp100_private
*
)
dev
->
priv
;
struct
hp100_private
*
lp
=
netdev_priv
(
dev
)
;
#ifdef HP100_DEBUG_B
#ifdef HP100_DEBUG_B
hp100_outw
(
0x4202
,
TRACE
);
hp100_outw
(
0x4202
,
TRACE
);
...
@@ -875,7 +881,7 @@ static void hp100_hwinit(struct net_device *dev)
...
@@ -875,7 +881,7 @@ static void hp100_hwinit(struct net_device *dev)
static
void
hp100_mmuinit
(
struct
net_device
*
dev
)
static
void
hp100_mmuinit
(
struct
net_device
*
dev
)
{
{
int
ioaddr
=
dev
->
base_addr
;
int
ioaddr
=
dev
->
base_addr
;
struct
hp100_private
*
lp
=
(
struct
hp100_private
*
)
dev
->
priv
;
struct
hp100_private
*
lp
=
netdev_priv
(
dev
)
;
int
i
;
int
i
;
#ifdef HP100_DEBUG_B
#ifdef HP100_DEBUG_B
...
@@ -1053,7 +1059,7 @@ static void hp100_mmuinit(struct net_device *dev)
...
@@ -1053,7 +1059,7 @@ static void hp100_mmuinit(struct net_device *dev)
static
int
hp100_open
(
struct
net_device
*
dev
)
static
int
hp100_open
(
struct
net_device
*
dev
)
{
{
struct
hp100_private
*
lp
=
(
struct
hp100_private
*
)
dev
->
priv
;
struct
hp100_private
*
lp
=
netdev_priv
(
dev
)
;
#ifdef HP100_DEBUG_B
#ifdef HP100_DEBUG_B
int
ioaddr
=
dev
->
base_addr
;
int
ioaddr
=
dev
->
base_addr
;
#endif
#endif
...
@@ -1093,7 +1099,7 @@ static int hp100_open(struct net_device *dev)
...
@@ -1093,7 +1099,7 @@ static int hp100_open(struct net_device *dev)
static
int
hp100_close
(
struct
net_device
*
dev
)
static
int
hp100_close
(
struct
net_device
*
dev
)
{
{
int
ioaddr
=
dev
->
base_addr
;
int
ioaddr
=
dev
->
base_addr
;
struct
hp100_private
*
lp
=
(
struct
hp100_private
*
)
dev
->
priv
;
struct
hp100_private
*
lp
=
netdev_priv
(
dev
)
;
#ifdef HP100_DEBUG_B
#ifdef HP100_DEBUG_B
hp100_outw
(
0x4205
,
TRACE
);
hp100_outw
(
0x4205
,
TRACE
);
...
@@ -1126,7 +1132,7 @@ static int hp100_close(struct net_device *dev)
...
@@ -1126,7 +1132,7 @@ static int hp100_close(struct net_device *dev)
*/
*/
static
void
hp100_init_pdls
(
struct
net_device
*
dev
)
static
void
hp100_init_pdls
(
struct
net_device
*
dev
)
{
{
struct
hp100_private
*
lp
=
(
struct
hp100_private
*
)
dev
->
priv
;
struct
hp100_private
*
lp
=
netdev_priv
(
dev
)
;
hp100_ring_t
*
ringptr
;
hp100_ring_t
*
ringptr
;
u_int
*
pageptr
;
/* Warning : increment by 4 - Jean II */
u_int
*
pageptr
;
/* Warning : increment by 4 - Jean II */
int
i
;
int
i
;
...
@@ -1273,7 +1279,8 @@ static int hp100_build_rx_pdl(hp100_ring_t * ringptr,
...
@@ -1273,7 +1279,8 @@ static int hp100_build_rx_pdl(hp100_ring_t * ringptr,
/* Conversion to new PCI API : map skbuf data to PCI bus.
/* Conversion to new PCI API : map skbuf data to PCI bus.
* Doc says it's OK for EISA as well - Jean II */
* Doc says it's OK for EISA as well - Jean II */
ringptr
->
pdl
[
0
]
=
0x00020000
;
/* Write PDH */
ringptr
->
pdl
[
0
]
=
0x00020000
;
/* Write PDH */
ringptr
->
pdl
[
3
]
=
((
u_int
)
pci_map_single
(((
struct
hp100_private
*
)
(
dev
->
priv
))
->
pci_dev
,
ringptr
->
skb
->
data
,
MAX_ETHER_SIZE
,
PCI_DMA_FROMDEVICE
));
ringptr
->
pdl
[
3
]
=
pdl_map_data
(
netdev_priv
(
dev
),
ringptr
->
skb
->
data
);
ringptr
->
pdl
[
4
]
=
MAX_ETHER_SIZE
;
/* Length of Data */
ringptr
->
pdl
[
4
]
=
MAX_ETHER_SIZE
;
/* Length of Data */
#ifdef HP100_DEBUG_BM
#ifdef HP100_DEBUG_BM
...
@@ -1310,7 +1317,7 @@ static void hp100_rxfill(struct net_device *dev)
...
@@ -1310,7 +1317,7 @@ static void hp100_rxfill(struct net_device *dev)
{
{
int
ioaddr
=
dev
->
base_addr
;
int
ioaddr
=
dev
->
base_addr
;
struct
hp100_private
*
lp
=
(
struct
hp100_private
*
)
dev
->
priv
;
struct
hp100_private
*
lp
=
netdev_priv
(
dev
)
;
hp100_ring_t
*
ringptr
;
hp100_ring_t
*
ringptr
;
#ifdef HP100_DEBUG_B
#ifdef HP100_DEBUG_B
...
@@ -1351,7 +1358,7 @@ static void hp100_rxfill(struct net_device *dev)
...
@@ -1351,7 +1358,7 @@ static void hp100_rxfill(struct net_device *dev)
static
void
hp100_BM_shutdown
(
struct
net_device
*
dev
)
static
void
hp100_BM_shutdown
(
struct
net_device
*
dev
)
{
{
int
ioaddr
=
dev
->
base_addr
;
int
ioaddr
=
dev
->
base_addr
;
struct
hp100_private
*
lp
=
(
struct
hp100_private
*
)
dev
->
priv
;
struct
hp100_private
*
lp
=
netdev_priv
(
dev
)
;
unsigned
long
time
;
unsigned
long
time
;
#ifdef HP100_DEBUG_B
#ifdef HP100_DEBUG_B
...
@@ -1432,7 +1439,7 @@ static void hp100_BM_shutdown(struct net_device *dev)
...
@@ -1432,7 +1439,7 @@ static void hp100_BM_shutdown(struct net_device *dev)
static
int
hp100_check_lan
(
struct
net_device
*
dev
)
static
int
hp100_check_lan
(
struct
net_device
*
dev
)
{
{
struct
hp100_private
*
lp
=
(
struct
hp100_private
*
)
dev
->
priv
;
struct
hp100_private
*
lp
=
netdev_priv
(
dev
)
;
if
(
lp
->
lan_type
<
0
)
{
/* no LAN type detected yet? */
if
(
lp
->
lan_type
<
0
)
{
/* no LAN type detected yet? */
hp100_stop_interface
(
dev
);
hp100_stop_interface
(
dev
);
...
@@ -1458,7 +1465,7 @@ static int hp100_start_xmit_bm(struct sk_buff *skb, struct net_device *dev)
...
@@ -1458,7 +1465,7 @@ static int hp100_start_xmit_bm(struct sk_buff *skb, struct net_device *dev)
unsigned
long
flags
;
unsigned
long
flags
;
int
i
,
ok_flag
;
int
i
,
ok_flag
;
int
ioaddr
=
dev
->
base_addr
;
int
ioaddr
=
dev
->
base_addr
;
struct
hp100_private
*
lp
=
(
struct
hp100_private
*
)
dev
->
priv
;
struct
hp100_private
*
lp
=
netdev_priv
(
dev
)
;
hp100_ring_t
*
ringptr
;
hp100_ring_t
*
ringptr
;
#ifdef HP100_DEBUG_B
#ifdef HP100_DEBUG_B
...
@@ -1576,7 +1583,7 @@ static int hp100_start_xmit_bm(struct sk_buff *skb, struct net_device *dev)
...
@@ -1576,7 +1583,7 @@ static int hp100_start_xmit_bm(struct sk_buff *skb, struct net_device *dev)
*/
*/
static
void
hp100_clean_txring
(
struct
net_device
*
dev
)
static
void
hp100_clean_txring
(
struct
net_device
*
dev
)
{
{
struct
hp100_private
*
lp
=
(
struct
hp100_private
*
)
dev
->
priv
;
struct
hp100_private
*
lp
=
netdev_priv
(
dev
)
;
int
ioaddr
=
dev
->
base_addr
;
int
ioaddr
=
dev
->
base_addr
;
int
donecount
;
int
donecount
;
...
@@ -1615,7 +1622,7 @@ static int hp100_start_xmit(struct sk_buff *skb, struct net_device *dev)
...
@@ -1615,7 +1622,7 @@ static int hp100_start_xmit(struct sk_buff *skb, struct net_device *dev)
int
i
,
ok_flag
;
int
i
,
ok_flag
;
int
ioaddr
=
dev
->
base_addr
;
int
ioaddr
=
dev
->
base_addr
;
u_short
val
;
u_short
val
;
struct
hp100_private
*
lp
=
(
struct
hp100_private
*
)
dev
->
priv
;
struct
hp100_private
*
lp
=
netdev_priv
(
dev
)
;
#ifdef HP100_DEBUG_B
#ifdef HP100_DEBUG_B
hp100_outw
(
0x4212
,
TRACE
);
hp100_outw
(
0x4212
,
TRACE
);
...
@@ -1755,7 +1762,7 @@ static void hp100_rx(struct net_device *dev)
...
@@ -1755,7 +1762,7 @@ static void hp100_rx(struct net_device *dev)
{
{
int
packets
,
pkt_len
;
int
packets
,
pkt_len
;
int
ioaddr
=
dev
->
base_addr
;
int
ioaddr
=
dev
->
base_addr
;
struct
hp100_private
*
lp
=
(
struct
hp100_private
*
)
dev
->
priv
;
struct
hp100_private
*
lp
=
netdev_priv
(
dev
)
;
u_int
header
;
u_int
header
;
struct
sk_buff
*
skb
;
struct
sk_buff
*
skb
;
...
@@ -1864,7 +1871,7 @@ static void hp100_rx(struct net_device *dev)
...
@@ -1864,7 +1871,7 @@ static void hp100_rx(struct net_device *dev)
static
void
hp100_rx_bm
(
struct
net_device
*
dev
)
static
void
hp100_rx_bm
(
struct
net_device
*
dev
)
{
{
int
ioaddr
=
dev
->
base_addr
;
int
ioaddr
=
dev
->
base_addr
;
struct
hp100_private
*
lp
=
(
struct
hp100_private
*
)
dev
->
priv
;
struct
hp100_private
*
lp
=
netdev_priv
(
dev
)
;
hp100_ring_t
*
ptr
;
hp100_ring_t
*
ptr
;
u_int
header
;
u_int
header
;
int
pkt_len
;
int
pkt_len
;
...
@@ -1973,7 +1980,7 @@ static struct net_device_stats *hp100_get_stats(struct net_device *dev)
...
@@ -1973,7 +1980,7 @@ static struct net_device_stats *hp100_get_stats(struct net_device *dev)
{
{
unsigned
long
flags
;
unsigned
long
flags
;
int
ioaddr
=
dev
->
base_addr
;
int
ioaddr
=
dev
->
base_addr
;
struct
hp100_private
*
lp
=
(
struct
hp100_private
*
)
dev
->
priv
;
struct
hp100_private
*
lp
=
netdev_priv
(
dev
)
;
#ifdef HP100_DEBUG_B
#ifdef HP100_DEBUG_B
hp100_outw
(
0x4215
,
TRACE
);
hp100_outw
(
0x4215
,
TRACE
);
...
@@ -1991,7 +1998,7 @@ static void hp100_update_stats(struct net_device *dev)
...
@@ -1991,7 +1998,7 @@ static void hp100_update_stats(struct net_device *dev)
{
{
int
ioaddr
=
dev
->
base_addr
;
int
ioaddr
=
dev
->
base_addr
;
u_short
val
;
u_short
val
;
struct
hp100_private
*
lp
=
(
struct
hp100_private
*
)
dev
->
priv
;
struct
hp100_private
*
lp
=
netdev_priv
(
dev
)
;
#ifdef HP100_DEBUG_B
#ifdef HP100_DEBUG_B
hp100_outw
(
0x4216
,
TRACE
);
hp100_outw
(
0x4216
,
TRACE
);
...
@@ -2017,7 +2024,7 @@ static void hp100_misc_interrupt(struct net_device *dev)
...
@@ -2017,7 +2024,7 @@ static void hp100_misc_interrupt(struct net_device *dev)
#ifdef HP100_DEBUG_B
#ifdef HP100_DEBUG_B
int
ioaddr
=
dev
->
base_addr
;
int
ioaddr
=
dev
->
base_addr
;
#endif
#endif
struct
hp100_private
*
lp
=
(
struct
hp100_private
*
)
dev
->
priv
;
struct
hp100_private
*
lp
=
netdev_priv
(
dev
)
;
#ifdef HP100_DEBUG_B
#ifdef HP100_DEBUG_B
int
ioaddr
=
dev
->
base_addr
;
int
ioaddr
=
dev
->
base_addr
;
...
@@ -2061,7 +2068,7 @@ static void hp100_set_multicast_list(struct net_device *dev)
...
@@ -2061,7 +2068,7 @@ static void hp100_set_multicast_list(struct net_device *dev)
{
{
unsigned
long
flags
;
unsigned
long
flags
;
int
ioaddr
=
dev
->
base_addr
;
int
ioaddr
=
dev
->
base_addr
;
struct
hp100_private
*
lp
=
(
struct
hp100_private
*
)
dev
->
priv
;
struct
hp100_private
*
lp
=
netdev_priv
(
dev
)
;
#ifdef HP100_DEBUG_B
#ifdef HP100_DEBUG_B
hp100_outw
(
0x4218
,
TRACE
);
hp100_outw
(
0x4218
,
TRACE
);
...
@@ -2191,7 +2198,7 @@ static void hp100_set_multicast_list(struct net_device *dev)
...
@@ -2191,7 +2198,7 @@ static void hp100_set_multicast_list(struct net_device *dev)
static
irqreturn_t
hp100_interrupt
(
int
irq
,
void
*
dev_id
,
struct
pt_regs
*
regs
)
static
irqreturn_t
hp100_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
hp100_private
*
lp
=
(
struct
hp100_private
*
)
dev
->
priv
;
struct
hp100_private
*
lp
=
netdev_priv
(
dev
)
;
int
ioaddr
;
int
ioaddr
;
u_int
val
;
u_int
val
;
...
@@ -2322,7 +2329,7 @@ static void hp100_start_interface(struct net_device *dev)
...
@@ -2322,7 +2329,7 @@ static void hp100_start_interface(struct net_device *dev)
{
{
unsigned
long
flags
;
unsigned
long
flags
;
int
ioaddr
=
dev
->
base_addr
;
int
ioaddr
=
dev
->
base_addr
;
struct
hp100_private
*
lp
=
(
struct
hp100_private
*
)
dev
->
priv
;
struct
hp100_private
*
lp
=
netdev_priv
(
dev
)
;
#ifdef HP100_DEBUG_B
#ifdef HP100_DEBUG_B
hp100_outw
(
0x4220
,
TRACE
);
hp100_outw
(
0x4220
,
TRACE
);
...
@@ -2381,7 +2388,7 @@ static void hp100_start_interface(struct net_device *dev)
...
@@ -2381,7 +2388,7 @@ static void hp100_start_interface(struct net_device *dev)
static
void
hp100_stop_interface
(
struct
net_device
*
dev
)
static
void
hp100_stop_interface
(
struct
net_device
*
dev
)
{
{
struct
hp100_private
*
lp
=
(
struct
hp100_private
*
)
dev
->
priv
;
struct
hp100_private
*
lp
=
netdev_priv
(
dev
)
;
int
ioaddr
=
dev
->
base_addr
;
int
ioaddr
=
dev
->
base_addr
;
u_int
val
;
u_int
val
;
...
@@ -2442,7 +2449,7 @@ static int hp100_sense_lan(struct net_device *dev)
...
@@ -2442,7 +2449,7 @@ static int hp100_sense_lan(struct net_device *dev)
{
{
int
ioaddr
=
dev
->
base_addr
;
int
ioaddr
=
dev
->
base_addr
;
u_short
val_VG
,
val_10
;
u_short
val_VG
,
val_10
;
struct
hp100_private
*
lp
=
(
struct
hp100_private
*
)
dev
->
priv
;
struct
hp100_private
*
lp
=
netdev_priv
(
dev
)
;
#ifdef HP100_DEBUG_B
#ifdef HP100_DEBUG_B
hp100_outw
(
0x4223
,
TRACE
);
hp100_outw
(
0x4223
,
TRACE
);
...
@@ -2488,7 +2495,7 @@ static int hp100_sense_lan(struct net_device *dev)
...
@@ -2488,7 +2495,7 @@ static int hp100_sense_lan(struct net_device *dev)
static
int
hp100_down_vg_link
(
struct
net_device
*
dev
)
static
int
hp100_down_vg_link
(
struct
net_device
*
dev
)
{
{
struct
hp100_private
*
lp
=
(
struct
hp100_private
*
)
dev
->
priv
;
struct
hp100_private
*
lp
=
netdev_priv
(
dev
)
;
int
ioaddr
=
dev
->
base_addr
;
int
ioaddr
=
dev
->
base_addr
;
unsigned
long
time
;
unsigned
long
time
;
long
savelan
,
newlan
;
long
savelan
,
newlan
;
...
@@ -2604,7 +2611,7 @@ static int hp100_down_vg_link(struct net_device *dev)
...
@@ -2604,7 +2611,7 @@ static int hp100_down_vg_link(struct net_device *dev)
static
int
hp100_login_to_vg_hub
(
struct
net_device
*
dev
,
u_short
force_relogin
)
static
int
hp100_login_to_vg_hub
(
struct
net_device
*
dev
,
u_short
force_relogin
)
{
{
int
ioaddr
=
dev
->
base_addr
;
int
ioaddr
=
dev
->
base_addr
;
struct
hp100_private
*
lp
=
(
struct
hp100_private
*
)
dev
->
priv
;
struct
hp100_private
*
lp
=
netdev_priv
(
dev
)
;
u_short
val
=
0
;
u_short
val
=
0
;
unsigned
long
time
;
unsigned
long
time
;
int
startst
;
int
startst
;
...
@@ -2775,7 +2782,7 @@ static int hp100_login_to_vg_hub(struct net_device *dev, u_short force_relogin)
...
@@ -2775,7 +2782,7 @@ static int hp100_login_to_vg_hub(struct net_device *dev, u_short force_relogin)
static
void
hp100_cascade_reset
(
struct
net_device
*
dev
,
u_short
enable
)
static
void
hp100_cascade_reset
(
struct
net_device
*
dev
,
u_short
enable
)
{
{
int
ioaddr
=
dev
->
base_addr
;
int
ioaddr
=
dev
->
base_addr
;
struct
hp100_private
*
lp
=
(
struct
hp100_private
*
)
dev
->
priv
;
struct
hp100_private
*
lp
=
netdev_priv
(
dev
)
;
#ifdef HP100_DEBUG_B
#ifdef HP100_DEBUG_B
hp100_outw
(
0x4226
,
TRACE
);
hp100_outw
(
0x4226
,
TRACE
);
...
@@ -2836,7 +2843,7 @@ void hp100_RegisterDump(struct net_device *dev)
...
@@ -2836,7 +2843,7 @@ void hp100_RegisterDump(struct net_device *dev)
static
void
cleanup_dev
(
struct
net_device
*
d
)
static
void
cleanup_dev
(
struct
net_device
*
d
)
{
{
struct
hp100_private
*
p
=
(
struct
hp100_private
*
)
d
->
priv
;
struct
hp100_private
*
p
=
netdev_priv
(
d
)
;
unregister_netdev
(
d
);
unregister_netdev
(
d
);
release_region
(
d
->
base_addr
,
HP100_REGION_SIZE
);
release_region
(
d
->
base_addr
,
HP100_REGION_SIZE
);
...
...
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