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
6ce9fa37
Commit
6ce9fa37
authored
Oct 19, 2004
by
Jeff Garzik
Browse files
Options
Browse Files
Download
Plain Diff
Merge pobox.com:/garz/repo/netdev-2.6/ne3210
into pobox.com:/garz/repo/netdev-2.6/viro-old-eth
parents
52d31911
4b87f02e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
17 deletions
+17
-17
drivers/net/ne3210.c
drivers/net/ne3210.c
+17
-17
No files found.
drivers/net/ne3210.c
View file @
6ce9fa37
...
...
@@ -174,18 +174,17 @@ static int __init ne3210_eisa_probe (struct device *device)
printk
(
"%dkB memory at physical address %#lx
\n
"
,
NE3210_STOP_PG
/
4
,
phys_mem
);
dev
->
mem_start
=
(
unsigned
long
)
ioremap
(
phys_mem
,
NE3210_STOP_PG
*
0x100
);
if
(
dev
->
mem_start
==
0
)
{
ei_status
.
mem
=
ioremap
(
phys_mem
,
NE3210_STOP_PG
*
0x100
);
if
(
!
ei_status
.
mem
)
{
printk
(
KERN_ERR
"ne3210.c: Unable to remap card memory !!
\n
"
);
printk
(
KERN_ERR
"ne3210.c: Driver NOT installed.
\n
"
);
retval
=
-
EAGAIN
;
goto
out4
;
}
printk
(
"ne3210.c: remapped %dkB card memory to virtual address %#lx
\n
"
,
NE3210_STOP_PG
/
4
,
dev
->
mem_start
);
dev
->
mem_end
=
ei_status
.
rmem_end
=
dev
->
mem_start
+
(
NE3210_STOP_PG
-
NE3210_START_PG
)
*
256
;
ei_status
.
rmem_start
=
dev
->
mem_start
+
TX_PAGES
*
256
;
printk
(
"ne3210.c: remapped %dkB card memory to virtual address %p
\n
"
,
NE3210_STOP_PG
/
4
,
ei_status
.
mem
);
dev
->
mem_start
=
(
unsigned
long
)
ei_status
.
mem
;
dev
->
mem_end
=
dev
->
mem_start
+
(
NE3210_STOP_PG
-
NE3210_START_PG
)
*
256
;
/* The 8390 offset is zero for the NE3210 */
dev
->
base_addr
=
ioaddr
;
...
...
@@ -219,7 +218,7 @@ static int __init ne3210_eisa_probe (struct device *device)
return
0
;
out5:
iounmap
(
(
void
*
)
dev
->
mem_start
);
iounmap
(
ei_status
.
mem
);
out4:
release_mem_region
(
phys_mem
,
NE3210_STOP_PG
*
0x100
);
out3:
...
...
@@ -240,7 +239,7 @@ static int __devexit ne3210_eisa_remove (struct device *device)
unsigned
long
ioaddr
=
to_eisa_device
(
device
)
->
base_addr
;
unregister_netdev
(
dev
);
iounmap
(
(
void
*
)
dev
->
mem_start
);
iounmap
(
ei_status
.
mem
);
release_mem_region
(
ei_status
.
priv
,
NE3210_STOP_PG
*
0x100
);
free_irq
(
dev
->
irq
,
dev
);
release_region
(
ioaddr
+
NE3210_CFG1
,
NE3210_CFG_EXTENT
);
...
...
@@ -288,7 +287,7 @@ static void ne3210_reset_8390(struct net_device *dev)
static
void
ne3210_get_8390_hdr
(
struct
net_device
*
dev
,
struct
e8390_pkt_hdr
*
hdr
,
int
ring_page
)
{
unsigned
long
hdr_start
=
dev
->
mem_start
+
((
ring_page
-
NE3210_START_PG
)
<<
8
);
void
__iomem
*
hdr_start
=
ei_status
.
mem
+
((
ring_page
-
NE3210_START_PG
)
<<
8
);
memcpy_fromio
(
hdr
,
hdr_start
,
sizeof
(
struct
e8390_pkt_hdr
));
hdr
->
count
=
(
hdr
->
count
+
3
)
&
~
3
;
/* Round up allocation. */
}
...
...
@@ -302,24 +301,25 @@ ne3210_get_8390_hdr(struct net_device *dev, struct e8390_pkt_hdr *hdr, int ring_
static
void
ne3210_block_input
(
struct
net_device
*
dev
,
int
count
,
struct
sk_buff
*
skb
,
int
ring_offset
)
{
unsigned
long
xfer_start
=
dev
->
mem_start
+
ring_offset
-
(
NE3210_START_PG
<<
8
)
;
void
__iomem
*
start
=
ei_status
.
mem
+
ring_offset
-
NE3210_START_PG
*
256
;
if
(
xfer_start
+
count
>
ei_status
.
rmem_end
)
{
if
(
ring_offset
+
count
>
NE3210_STOP_PG
*
256
)
{
/* Packet wraps over end of ring buffer. */
int
semi_count
=
ei_status
.
rmem_end
-
xfer_star
t
;
memcpy_fromio
(
skb
->
data
,
xfer_
start
,
semi_count
);
int
semi_count
=
NE3210_STOP_PG
*
256
-
ring_offse
t
;
memcpy_fromio
(
skb
->
data
,
start
,
semi_count
);
count
-=
semi_count
;
memcpy_fromio
(
skb
->
data
+
semi_count
,
ei_status
.
rmem_start
,
count
);
memcpy_fromio
(
skb
->
data
+
semi_count
,
ei_status
.
mem
+
TX_PAGES
*
256
,
count
);
}
else
{
/* Packet is in one chunk. */
memcpy_fromio
(
skb
->
data
,
xfer_
start
,
count
);
memcpy_fromio
(
skb
->
data
,
start
,
count
);
}
}
static
void
ne3210_block_output
(
struct
net_device
*
dev
,
int
count
,
const
unsigned
char
*
buf
,
int
start_page
)
{
unsigned
long
shmem
=
dev
->
mem_start
+
((
start_page
-
NE3210_START_PG
)
<<
8
);
void
__iomem
*
shmem
=
ei_status
.
mem
+
((
start_page
-
NE3210_START_PG
)
<<
8
);
count
=
(
count
+
3
)
&
~
3
;
/* Round up to doubleword */
memcpy_toio
(
shmem
,
buf
,
count
);
...
...
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