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
f3da3d88
Commit
f3da3d88
authored
Nov 23, 2007
by
Linus Torvalds
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Import 2.3.36pre5
parent
eab2ce74
Changes
31
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
31 changed files
with
2752 additions
and
2912 deletions
+2752
-2912
Documentation/Configure.help
Documentation/Configure.help
+9
-5
drivers/net/arcnet/arc-rawmode.c
drivers/net/arcnet/arc-rawmode.c
+115
-123
drivers/net/arcnet/arc-rimi.c
drivers/net/arcnet/arc-rimi.c
+29
-34
drivers/net/arcnet/arcnet.c
drivers/net/arcnet/arcnet.c
+703
-790
drivers/net/arcnet/com20020-isa.c
drivers/net/arcnet/com20020-isa.c
+91
-101
drivers/net/arcnet/com20020-pci.c
drivers/net/arcnet/com20020-pci.c
+74
-77
drivers/net/arcnet/com20020.c
drivers/net/arcnet/com20020.c
+208
-225
drivers/net/arcnet/com90io.c
drivers/net/arcnet/com90io.c
+21
-30
drivers/net/arcnet/com90xx.c
drivers/net/arcnet/com90xx.c
+464
-510
drivers/net/arcnet/rfc1051.c
drivers/net/arcnet/rfc1051.c
+155
-168
drivers/net/arcnet/rfc1201.c
drivers/net/arcnet/rfc1201.c
+414
-462
drivers/pci/pci.c
drivers/pci/pci.c
+1
-1
drivers/pcmcia/cardbus.c
drivers/pcmcia/cardbus.c
+44
-38
drivers/pcmcia/cistpl.c
drivers/pcmcia/cistpl.c
+1
-1
drivers/pcmcia/cs.c
drivers/pcmcia/cs.c
+2
-1
drivers/pcmcia/i82365.c
drivers/pcmcia/i82365.c
+1
-1
drivers/pcmcia/pci_socket.c
drivers/pcmcia/pci_socket.c
+1
-1
drivers/pcmcia/pci_socket.h
drivers/pcmcia/pci_socket.h
+2
-0
drivers/pcmcia/yenta.c
drivers/pcmcia/yenta.c
+187
-71
drivers/pcmcia/yenta.h
drivers/pcmcia/yenta.h
+15
-40
drivers/usb/Config.in
drivers/usb/Config.in
+1
-1
drivers/usb/procusb
drivers/usb/procusb
+0
-41
fs/namei.c
fs/namei.c
+1
-77
include/linux/arcdevice.h
include/linux/arcdevice.h
+104
-109
include/linux/fs.h
include/linux/fs.h
+85
-0
include/linux/mm.h
include/linux/mm.h
+9
-0
include/linux/tty.h
include/linux/tty.h
+3
-0
include/pcmcia/ss.h
include/pcmcia/ss.h
+1
-2
kernel/ksyms.c
kernel/ksyms.c
+8
-0
mm/filemap.c
mm/filemap.c
+2
-2
net/bridge/br.c
net/bridge/br.c
+1
-1
No files found.
Documentation/Configure.help
View file @
f3da3d88
...
@@ -7878,22 +7878,26 @@ CONFIG_USB_UHCI
...
@@ -7878,22 +7878,26 @@ CONFIG_USB_UHCI
The
Universal
Host
Controller
Interface
is
a
standard
by
Intel
for
The
Universal
Host
Controller
Interface
is
a
standard
by
Intel
for
accessing
the
USB
hardware
in
the
PC
(
which
is
also
called
the
USB
accessing
the
USB
hardware
in
the
PC
(
which
is
also
called
the
USB
host
controller
).
If
your
USB
host
controller
conforms
to
this
host
controller
).
If
your
USB
host
controller
conforms
to
this
standard
,
say
Y
.
All
recent
boards
with
Intel
PCI
chipsets
conform
standard
,
say
Y
.
All
recent
boards
with
Intel
PCI
chipsets
(
like
to
this
standard
.
If
unsure
,
say
Y
.
intel
430
TX
,
440F
X
,
440L
X
,
440
BX
,
i810
,
i820
)
conform
to
this
standard
.
Also
all
VIA
PCI
chipsets
(
like
VIA
VP2
,
VP3
,
MVP3
,
Apollo
Pro
,
Apollo
Pro
II
or
Apollo
Pro
133
).
If
unsure
,
say
Y
.
This
code
is
also
available
as
a
module
(
=
code
which
can
be
This
code
is
also
available
as
a
module
(
=
code
which
can
be
inserted
in
and
removed
from
the
running
kernel
whenever
you
want
).
inserted
in
and
removed
from
the
running
kernel
whenever
you
want
).
The
module
will
be
called
usb
-
uhci
.
o
.
If
you
want
to
compile
it
as
a
The
module
will
be
called
usb
-
uhci
.
o
.
If
you
want
to
compile
it
as
a
module
,
say
M
here
and
read
Documentation
/
modules
.
txt
.
module
,
say
M
here
and
read
Documentation
/
modules
.
txt
.
OHCI
-
HCD
(
Compaq
,
iMacs
,
OPTi
,
SiS
,
and
others
)
support
?
OHCI
-
HCD
(
Compaq
,
iMacs
,
OPTi
,
SiS
,
ALi
,
and
others
)
support
?
CONFIG_USB_OHCI_HCD
CONFIG_USB_OHCI_HCD
The
Open
Host
Controller
Interface
is
a
standard
by
The
Open
Host
Controller
Interface
is
a
standard
by
Compaq
/
Microsoft
/
National
for
accessing
the
USB
PC
hardware
(
also
Compaq
/
Microsoft
/
National
for
accessing
the
USB
PC
hardware
(
also
called
USB
host
controller
).
If
your
USB
host
controller
conforms
called
USB
host
controller
).
If
your
USB
host
controller
conforms
to
this
standard
,
say
Y
.
The
USB
host
controllers
on
most
to
this
standard
,
say
Y
.
The
USB
host
controllers
on
most
non
-
Intel
architectures
and
on
several
x86
compatibles
with
non
-
Intel
architectures
and
on
several
x86
compatibles
with
non
-
Intel
non
-
Intel
chipsets
conform
to
this
standard
.
chipsets
-
like
SiS
(
aktual
610
,
610
and
so
on
)
or
ALi
(
ALi
IV
,
ALi
V
,
Aladin
Pro
..)
-
conform
to
this
standard
.
You
may
want
to
read
the
file
drivers
/
usb
/
README
.
ohci_hcd
.
You
may
want
to
read
the
file
drivers
/
usb
/
README
.
ohci_hcd
.
...
...
drivers/net/arcnet/arc-rawmode.c
View file @
f3da3d88
...
@@ -23,6 +23,7 @@
...
@@ -23,6 +23,7 @@
*
*
* **********************
* **********************
*/
*/
#include <linux/module.h>
#include <linux/module.h>
#include <linux/config.h>
/* for CONFIG_INET */
#include <linux/config.h>
/* for CONFIG_INET */
#include <linux/init.h>
#include <linux/init.h>
...
@@ -43,7 +44,8 @@ static int prepare_tx(struct net_device *dev, struct archdr *pkt, int length,
...
@@ -43,7 +44,8 @@ static int prepare_tx(struct net_device *dev, struct archdr *pkt, int length,
int
bufnum
);
int
bufnum
);
struct
ArcProto
rawmode_proto
=
{
struct
ArcProto
rawmode_proto
=
{
'r'
,
'r'
,
XMTU
,
XMTU
,
rx
,
rx
,
...
@@ -90,7 +92,7 @@ void cleanup_module(void)
...
@@ -90,7 +92,7 @@ void cleanup_module(void)
static
void
rx
(
struct
net_device
*
dev
,
int
bufnum
,
static
void
rx
(
struct
net_device
*
dev
,
int
bufnum
,
struct
archdr
*
pkthdr
,
int
length
)
struct
archdr
*
pkthdr
,
int
length
)
{
{
struct
arcnet_local
*
lp
=
(
struct
arcnet_local
*
)
dev
->
priv
;
struct
arcnet_local
*
lp
=
(
struct
arcnet_local
*
)
dev
->
priv
;
struct
sk_buff
*
skb
;
struct
sk_buff
*
skb
;
struct
archdr
*
pkt
=
pkthdr
;
struct
archdr
*
pkt
=
pkthdr
;
int
ofs
;
int
ofs
;
...
@@ -103,17 +105,15 @@ static void rx(struct net_device *dev, int bufnum,
...
@@ -103,17 +105,15 @@ static void rx(struct net_device *dev, int bufnum,
ofs
=
256
-
length
;
ofs
=
256
-
length
;
skb
=
alloc_skb
(
length
+
ARC_HDR_SIZE
,
GFP_ATOMIC
);
skb
=
alloc_skb
(
length
+
ARC_HDR_SIZE
,
GFP_ATOMIC
);
if
(
skb
==
NULL
)
if
(
skb
==
NULL
)
{
{
BUGMSG
(
D_NORMAL
,
"Memory squeeze, dropping packet.
\n
"
);
BUGMSG
(
D_NORMAL
,
"Memory squeeze, dropping packet.
\n
"
);
lp
->
stats
.
rx_dropped
++
;
lp
->
stats
.
rx_dropped
++
;
return
;
return
;
}
}
skb_put
(
skb
,
length
+
ARC_HDR_SIZE
);
skb_put
(
skb
,
length
+
ARC_HDR_SIZE
);
skb
->
dev
=
dev
;
skb
->
dev
=
dev
;
pkt
=
(
struct
archdr
*
)
skb
->
data
;
pkt
=
(
struct
archdr
*
)
skb
->
data
;
skb
->
mac
.
raw
=
skb
->
data
;
skb
->
mac
.
raw
=
skb
->
data
;
skb_pull
(
skb
,
ARC_HDR_SIZE
);
skb_pull
(
skb
,
ARC_HDR_SIZE
);
...
@@ -141,7 +141,7 @@ static int build_header(struct sk_buff *skb, unsigned short type,
...
@@ -141,7 +141,7 @@ static int build_header(struct sk_buff *skb, unsigned short type,
{
{
struct
net_device
*
dev
=
skb
->
dev
;
struct
net_device
*
dev
=
skb
->
dev
;
int
hdr_size
=
ARC_HDR_SIZE
;
int
hdr_size
=
ARC_HDR_SIZE
;
struct
archdr
*
pkt
=
(
struct
archdr
*
)
skb_push
(
skb
,
hdr_size
);
struct
archdr
*
pkt
=
(
struct
archdr
*
)
skb_push
(
skb
,
hdr_size
);
/*
/*
* Set the source hardware address.
* Set the source hardware address.
...
@@ -154,8 +154,7 @@ static int build_header(struct sk_buff *skb, unsigned short type,
...
@@ -154,8 +154,7 @@ static int build_header(struct sk_buff *skb, unsigned short type,
/* see linux/net/ethernet/eth.c to see where I got the following */
/* see linux/net/ethernet/eth.c to see where I got the following */
if
(
dev
->
flags
&
(
IFF_LOOPBACK
|
IFF_NOARP
))
if
(
dev
->
flags
&
(
IFF_LOOPBACK
|
IFF_NOARP
))
{
{
/*
/*
* FIXME: fill in the last byte of the dest ipaddr here to better
* FIXME: fill in the last byte of the dest ipaddr here to better
* comply with RFC1051 in "noarp" mode.
* comply with RFC1051 in "noarp" mode.
...
@@ -163,7 +162,6 @@ static int build_header(struct sk_buff *skb, unsigned short type,
...
@@ -163,7 +162,6 @@ static int build_header(struct sk_buff *skb, unsigned short type,
pkt
->
hard
.
dest
=
0
;
pkt
->
hard
.
dest
=
0
;
return
hdr_size
;
return
hdr_size
;
}
}
/* otherwise, just fill it in and go! */
/* otherwise, just fill it in and go! */
pkt
->
hard
.
dest
=
daddr
;
pkt
->
hard
.
dest
=
daddr
;
...
@@ -174,7 +172,7 @@ static int build_header(struct sk_buff *skb, unsigned short type,
...
@@ -174,7 +172,7 @@ static int build_header(struct sk_buff *skb, unsigned short type,
static
int
prepare_tx
(
struct
net_device
*
dev
,
struct
archdr
*
pkt
,
int
length
,
static
int
prepare_tx
(
struct
net_device
*
dev
,
struct
archdr
*
pkt
,
int
length
,
int
bufnum
)
int
bufnum
)
{
{
struct
arcnet_local
*
lp
=
(
struct
arcnet_local
*
)
dev
->
priv
;
struct
arcnet_local
*
lp
=
(
struct
arcnet_local
*
)
dev
->
priv
;
struct
arc_hardware
*
hard
=
&
pkt
->
hard
;
struct
arc_hardware
*
hard
=
&
pkt
->
hard
;
int
ofs
;
int
ofs
;
...
@@ -183,25 +181,19 @@ static int prepare_tx(struct net_device *dev, struct archdr *pkt, int length,
...
@@ -183,25 +181,19 @@ static int prepare_tx(struct net_device *dev, struct archdr *pkt, int length,
length
-=
ARC_HDR_SIZE
;
/* hard header is not included in packet length */
length
-=
ARC_HDR_SIZE
;
/* hard header is not included in packet length */
if
(
length
>
XMTU
)
if
(
length
>
XMTU
)
{
{
/* should never happen! other people already check for this. */
/* should never happen! other people already check for this. */
BUGMSG
(
D_NORMAL
,
"Bug! prepare_tx with size %d (> %d)
\n
"
,
BUGMSG
(
D_NORMAL
,
"Bug! prepare_tx with size %d (> %d)
\n
"
,
length
,
XMTU
);
length
,
XMTU
);
length
=
XMTU
;
length
=
XMTU
;
}
}
if
(
length
>
MinTU
)
{
if
(
length
>
MinTU
)
{
hard
->
offset
[
0
]
=
0
;
hard
->
offset
[
0
]
=
0
;
hard
->
offset
[
1
]
=
ofs
=
512
-
length
;
hard
->
offset
[
1
]
=
ofs
=
512
-
length
;
}
}
else
if
(
length
>
MTU
)
{
else
if
(
length
>
MTU
)
{
hard
->
offset
[
0
]
=
0
;
hard
->
offset
[
0
]
=
0
;
hard
->
offset
[
1
]
=
ofs
=
512
-
length
-
3
;
hard
->
offset
[
1
]
=
ofs
=
512
-
length
-
3
;
}
}
else
else
hard
->
offset
[
0
]
=
ofs
=
256
-
length
;
hard
->
offset
[
0
]
=
ofs
=
256
-
length
;
lp
->
hw
.
copy_to_card
(
dev
,
bufnum
,
0
,
hard
,
ARC_HDR_SIZE
);
lp
->
hw
.
copy_to_card
(
dev
,
bufnum
,
0
,
hard
,
ARC_HDR_SIZE
);
...
...
drivers/net/arcnet/arc-rimi.c
View file @
f3da3d88
...
@@ -43,12 +43,12 @@
...
@@ -43,12 +43,12 @@
static
int
arcrimi_probe
(
struct
net_device
*
dev
);
static
int
arcrimi_probe
(
struct
net_device
*
dev
);
static
int
arcrimi_found
(
struct
net_device
*
dev
);
static
int
arcrimi_found
(
struct
net_device
*
dev
);
static
void
arcrimi_command
(
struct
net_device
*
dev
,
int
command
);
static
void
arcrimi_command
(
struct
net_device
*
dev
,
int
command
);
static
int
arcrimi_status
(
struct
net_device
*
dev
);
static
int
arcrimi_status
(
struct
net_device
*
dev
);
static
void
arcrimi_setmask
(
struct
net_device
*
dev
,
int
mask
);
static
void
arcrimi_setmask
(
struct
net_device
*
dev
,
int
mask
);
static
int
arcrimi_reset
(
struct
net_device
*
dev
,
int
really_reset
);
static
int
arcrimi_reset
(
struct
net_device
*
dev
,
int
really_reset
);
static
void
arcrimi_openclose
(
struct
net_device
*
dev
,
bool
open
);
static
void
arcrimi_openclose
(
struct
net_device
*
dev
,
bool
open
);
static
void
arcrimi_copy_to_card
(
struct
net_device
*
dev
,
int
bufnum
,
int
offset
,
static
void
arcrimi_copy_to_card
(
struct
net_device
*
dev
,
int
bufnum
,
int
offset
,
void
*
buf
,
int
count
);
void
*
buf
,
int
count
);
static
void
arcrimi_copy_from_card
(
struct
net_device
*
dev
,
int
bufnum
,
int
offset
,
static
void
arcrimi_copy_from_card
(
struct
net_device
*
dev
,
int
bufnum
,
int
offset
,
void
*
buf
,
int
count
);
void
*
buf
,
int
count
);
...
@@ -97,18 +97,15 @@ static int __init arcrimi_probe(struct net_device *dev)
...
@@ -97,18 +97,15 @@ static int __init arcrimi_probe(struct net_device *dev)
"must specify the shmem and irq!
\n
"
);
"must specify the shmem and irq!
\n
"
);
return
-
ENODEV
;
return
-
ENODEV
;
}
}
if
(
check_mem_region
(
dev
->
mem_start
,
BUFFER_SIZE
))
{
if
(
check_mem_region
(
dev
->
mem_start
,
BUFFER_SIZE
))
{
BUGMSG
(
D_NORMAL
,
"Card memory already allocated
\n
"
);
BUGMSG
(
D_NORMAL
,
"Card memory already allocated
\n
"
);
return
-
ENODEV
;
return
-
ENODEV
;
}
}
if
(
dev
->
dev_addr
[
0
]
==
0
)
{
if
(
dev
->
dev_addr
[
0
]
==
0
)
{
BUGMSG
(
D_NORMAL
,
"You need to specify your card's station "
BUGMSG
(
D_NORMAL
,
"You need to specify your card's station "
"ID!
\n
"
);
"ID!
\n
"
);
return
-
ENODEV
;
return
-
ENODEV
;
}
}
return
arcrimi_found
(
dev
);
return
arcrimi_found
(
dev
);
}
}
...
@@ -178,7 +175,6 @@ static int __init arcrimi_found(struct net_device *dev)
...
@@ -178,7 +175,6 @@ static int __init arcrimi_found(struct net_device *dev)
BUGMSG
(
D_NORMAL
,
"Can't remap device memory!
\n
"
);
BUGMSG
(
D_NORMAL
,
"Can't remap device memory!
\n
"
);
goto
err_free_dev_priv
;
goto
err_free_dev_priv
;
}
}
/* Fill in the fields of the device structure with generic
/* Fill in the fields of the device structure with generic
* values.
* values.
*/
*/
...
@@ -198,9 +194,9 @@ static int __init arcrimi_found(struct net_device *dev)
...
@@ -198,9 +194,9 @@ static int __init arcrimi_found(struct net_device *dev)
return
0
;
return
0
;
err_free_dev_priv:
err_free_dev_priv:
kfree
(
dev
->
priv
);
kfree
(
dev
->
priv
);
err_free_irq:
err_free_irq:
free_irq
(
dev
->
irq
,
dev
);
free_irq
(
dev
->
irq
,
dev
);
return
-
EIO
;
return
-
EIO
;
}
}
...
@@ -222,10 +218,9 @@ static int arcrimi_reset(struct net_device *dev, int really_reset)
...
@@ -222,10 +218,9 @@ static int arcrimi_reset(struct net_device *dev, int really_reset)
BUGMSG
(
D_INIT
,
"Resetting %s (status=%02Xh)
\n
"
,
dev
->
name
,
ASTATUS
());
BUGMSG
(
D_INIT
,
"Resetting %s (status=%02Xh)
\n
"
,
dev
->
name
,
ASTATUS
());
if
(
really_reset
)
{
if
(
really_reset
)
{
writeb
(
TESTvalue
,
ioaddr
-
0x800
);
/* fake reset */
writeb
(
TESTvalue
,
ioaddr
-
0x800
);
/* fake reset */
return
0
;
return
0
;
}
}
ACOMMAND
(
CFLAGScmd
|
RESETclear
);
/* clear flags & end reset */
ACOMMAND
(
CFLAGScmd
|
RESETclear
);
/* clear flags & end reset */
ACOMMAND
(
CFLAGScmd
|
CONFIGclear
);
ACOMMAND
(
CFLAGScmd
|
CONFIGclear
);
...
@@ -273,7 +268,7 @@ static void arcrimi_copy_to_card(struct net_device *dev, int bufnum, int offset,
...
@@ -273,7 +268,7 @@ static void arcrimi_copy_to_card(struct net_device *dev, int bufnum, int offset,
void
*
buf
,
int
count
)
void
*
buf
,
int
count
)
{
{
struct
arcnet_local
*
lp
=
(
struct
arcnet_local
*
)
dev
->
priv
;
struct
arcnet_local
*
lp
=
(
struct
arcnet_local
*
)
dev
->
priv
;
void
*
memaddr
=
lp
->
mem_start
+
0x800
+
bufnum
*
512
+
offset
;
void
*
memaddr
=
lp
->
mem_start
+
0x800
+
bufnum
*
512
+
offset
;
TIME
(
"memcpy_toio"
,
count
,
memcpy_toio
(
memaddr
,
buf
,
count
));
TIME
(
"memcpy_toio"
,
count
,
memcpy_toio
(
memaddr
,
buf
,
count
));
}
}
...
@@ -282,7 +277,7 @@ static void arcrimi_copy_from_card(struct net_device *dev, int bufnum, int offse
...
@@ -282,7 +277,7 @@ static void arcrimi_copy_from_card(struct net_device *dev, int bufnum, int offse
void
*
buf
,
int
count
)
void
*
buf
,
int
count
)
{
{
struct
arcnet_local
*
lp
=
(
struct
arcnet_local
*
)
dev
->
priv
;
struct
arcnet_local
*
lp
=
(
struct
arcnet_local
*
)
dev
->
priv
;
void
*
memaddr
=
lp
->
mem_start
+
0x800
+
bufnum
*
512
+
offset
;
void
*
memaddr
=
lp
->
mem_start
+
0x800
+
bufnum
*
512
+
offset
;
TIME
(
"memcpy_fromio"
,
count
,
memcpy_fromio
(
buf
,
memaddr
,
count
));
TIME
(
"memcpy_fromio"
,
count
,
memcpy_fromio
(
buf
,
memaddr
,
count
));
}
}
...
@@ -360,7 +355,7 @@ static int __init arcrimi_setup(char *s)
...
@@ -360,7 +355,7 @@ static int __init arcrimi_setup(char *s)
return
1
;
return
1
;
dev
=
alloc_bootmem
(
sizeof
(
struct
net_device
)
+
10
);
dev
=
alloc_bootmem
(
sizeof
(
struct
net_device
)
+
10
);
memset
(
dev
,
0
,
sizeof
(
struct
net_device
)
+
10
);
memset
(
dev
,
0
,
sizeof
(
struct
net_device
)
+
10
);
dev
->
name
=
(
char
*
)
(
dev
+
1
);
dev
->
name
=
(
char
*
)
(
dev
+
1
);
dev
->
init
=
arcrimi_probe
;
dev
->
init
=
arcrimi_probe
;
switch
(
ints
[
0
])
{
switch
(
ints
[
0
])
{
...
...
drivers/net/arcnet/arcnet.c
View file @
f3da3d88
This diff is collapsed.
Click to expand it.
drivers/net/arcnet/com20020-isa.c
View file @
f3da3d88
...
@@ -60,31 +60,24 @@ static int __init com20020isa_probe(struct net_device *dev)
...
@@ -60,31 +60,24 @@ static int __init com20020isa_probe(struct net_device *dev)
BUGLVL
(
D_NORMAL
)
printk
(
VERSION
);
BUGLVL
(
D_NORMAL
)
printk
(
VERSION
);
ioaddr
=
dev
->
base_addr
;
ioaddr
=
dev
->
base_addr
;
if
(
!
ioaddr
)
if
(
!
ioaddr
)
{
{
BUGMSG
(
D_NORMAL
,
"No autoprobe (yet) for IO mapped cards; you "
BUGMSG
(
D_NORMAL
,
"No autoprobe (yet) for IO mapped cards; you "
"must specify the base address!
\n
"
);
"must specify the base address!
\n
"
);
return
-
ENODEV
;
return
-
ENODEV
;
}
}
if
(
check_region
(
ioaddr
,
ARCNET_TOTAL_SIZE
))
{
if
(
check_region
(
ioaddr
,
ARCNET_TOTAL_SIZE
))
{
BUGMSG
(
D_NORMAL
,
"IO region %xh-%xh already allocated.
\n
"
,
BUGMSG
(
D_NORMAL
,
"IO region %xh-%xh already allocated.
\n
"
,
ioaddr
,
ioaddr
+
ARCNET_TOTAL_SIZE
-
1
);
ioaddr
,
ioaddr
+
ARCNET_TOTAL_SIZE
-
1
);
return
-
ENXIO
;
return
-
ENXIO
;
}
}
if
(
ASTATUS
()
==
0xFF
)
{
if
(
ASTATUS
()
==
0xFF
)
{
BUGMSG
(
D_NORMAL
,
"IO address %x empty
\n
"
,
ioaddr
);
BUGMSG
(
D_NORMAL
,
"IO address %x empty
\n
"
,
ioaddr
);
return
-
ENODEV
;
return
-
ENODEV
;
}
}
if
(
com20020_check
(
dev
))
if
(
com20020_check
(
dev
))
return
-
ENODEV
;
return
-
ENODEV
;
if
(
!
dev
->
irq
)
if
(
!
dev
->
irq
)
{
{
/* if we do this, we're sure to get an IRQ since the
/* if we do this, we're sure to get an IRQ since the
* card has just reset and the NORXflag is on until
* card has just reset and the NORXflag is on until
* we tell it to start receiving.
* we tell it to start receiving.
...
@@ -97,22 +90,19 @@ static int __init com20020isa_probe(struct net_device *dev)
...
@@ -97,22 +90,19 @@ static int __init com20020isa_probe(struct net_device *dev)
outb
(
0
,
_INTMASK
);
outb
(
0
,
_INTMASK
);
dev
->
irq
=
probe_irq_off
(
airqmask
);
dev
->
irq
=
probe_irq_off
(
airqmask
);
if
(
dev
->
irq
<=
0
)
if
(
dev
->
irq
<=
0
)
{
{
BUGMSG
(
D_INIT_REASONS
,
"Autoprobe IRQ failed first time
\n
"
);
BUGMSG
(
D_INIT_REASONS
,
"Autoprobe IRQ failed first time
\n
"
);
airqmask
=
probe_irq_on
();
airqmask
=
probe_irq_on
();
outb
(
NORXflag
,
_INTMASK
);
outb
(
NORXflag
,
_INTMASK
);
udelay
(
5
);
udelay
(
5
);
outb
(
0
,
_INTMASK
);
outb
(
0
,
_INTMASK
);
dev
->
irq
=
probe_irq_off
(
airqmask
);
dev
->
irq
=
probe_irq_off
(
airqmask
);
if
(
dev
->
irq
<=
0
)
if
(
dev
->
irq
<=
0
)
{
{
BUGMSG
(
D_NORMAL
,
"Autoprobe IRQ failed.
\n
"
);
BUGMSG
(
D_NORMAL
,
"Autoprobe IRQ failed.
\n
"
);
return
-
ENODEV
;
return
-
ENODEV
;
}
}
}
}
}
}
return
com20020_found
(
dev
,
0
);
return
com20020_found
(
dev
,
0
);
}
}
...
@@ -209,8 +199,8 @@ static int __init com20020isa_setup(char *s)
...
@@ -209,8 +199,8 @@ static int __init com20020isa_setup(char *s)
return
1
;
return
1
;
dev
=
alloc_bootmem
(
sizeof
(
struct
net_device
)
+
sizeof
(
struct
arcnet_local
)
+
10
);
dev
=
alloc_bootmem
(
sizeof
(
struct
net_device
)
+
sizeof
(
struct
arcnet_local
)
+
10
);
memset
(
dev
,
0
,
sizeof
(
struct
net_device
)
+
sizeof
(
struct
arcnet_local
)
+
10
);
memset
(
dev
,
0
,
sizeof
(
struct
net_device
)
+
sizeof
(
struct
arcnet_local
)
+
10
);
lp
=
dev
->
priv
=
(
struct
arcnet_local
*
)
(
dev
+
1
);
lp
=
dev
->
priv
=
(
struct
arcnet_local
*
)
(
dev
+
1
);
dev
->
name
=
(
char
*
)
(
lp
+
1
);
dev
->
name
=
(
char
*
)
(
lp
+
1
);
dev
->
init
=
com20020isa_probe
;
dev
->
init
=
com20020isa_probe
;
switch
(
ints
[
0
])
{
switch
(
ints
[
0
])
{
...
...
drivers/net/arcnet/com20020-pci.c
View file @
f3da3d88
...
@@ -43,7 +43,8 @@
...
@@ -43,7 +43,8 @@
#define VERSION "arcnet: COM20020 PCI support\n"
#define VERSION "arcnet: COM20020 PCI support\n"
#ifdef MODULE
#ifdef MODULE
static
struct
net_device
*
cards
[
16
];
#define MAX_CARDS 16
static
struct
net_device
*
cards
[
MAX_CARDS
];
static
int
numcards
;
static
int
numcards
;
#endif
#endif
...
@@ -68,8 +69,7 @@ static int __init com20020pci_probe(char *name_template, int node, int backplane
...
@@ -68,8 +69,7 @@ static int __init com20020pci_probe(char *name_template, int node, int backplane
BUGLVL
(
D_NORMAL
)
printk
(
VERSION
);
BUGLVL
(
D_NORMAL
)
printk
(
VERSION
);
while
((
pdev
=
pci_find_device
(
0x1571
,
0xa004
,
pdev
)))
while
((
pdev
=
pci_find_device
(
0x1571
,
0xa004
,
pdev
)))
{
{
if
(
pci_enable_device
(
pdev
))
if
(
pci_enable_device
(
pdev
))
continue
;
continue
;
dev
=
dev_alloc
(
name_template
?
:
"arc%d"
,
&
err
);
dev
=
dev_alloc
(
name_template
?
:
"arc%d"
,
&
err
);
...
@@ -92,26 +92,24 @@ static int __init com20020pci_probe(char *name_template, int node, int backplane
...
@@ -92,26 +92,24 @@ static int __init com20020pci_probe(char *name_template, int node, int backplane
BUGMSG
(
D_INIT
,
"PCI BIOS reports a device at %Xh, IRQ %d
\n
"
,
BUGMSG
(
D_INIT
,
"PCI BIOS reports a device at %Xh, IRQ %d
\n
"
,
ioaddr
,
dev
->
irq
);
ioaddr
,
dev
->
irq
);
if
(
check_region
(
ioaddr
,
ARCNET_TOTAL_SIZE
))
if
(
check_region
(
ioaddr
,
ARCNET_TOTAL_SIZE
))
{
{
BUGMSG
(
D_INIT
,
"IO region %xh-%xh already allocated.
\n
"
,
BUGMSG
(
D_INIT
,
"IO region %xh-%xh already allocated.
\n
"
,
ioaddr
,
ioaddr
+
ARCNET_TOTAL_SIZE
-
1
);
ioaddr
,
ioaddr
+
ARCNET_TOTAL_SIZE
-
1
);
continue
;
continue
;
}
}
if
(
ASTATUS
()
==
0xFF
)
{
if
(
ASTATUS
()
==
0xFF
)
{
BUGMSG
(
D_NORMAL
,
"IO address %Xh was reported by PCI BIOS, "
BUGMSG
(
D_NORMAL
,
"IO address %Xh was reported by PCI BIOS, "
"but seems empty!
\n
"
,
ioaddr
);
"but seems empty!
\n
"
,
ioaddr
);
continue
;
continue
;
}
}
if
(
com20020_check
(
dev
))
if
(
com20020_check
(
dev
))
continue
;
continue
;
if
(
!
com20020_found
(
dev
,
SA_SHIRQ
))
if
(
!
com20020_found
(
dev
,
SA_SHIRQ
))
{
{
#ifdef MODULE
#ifdef MODULE
if
(
numcards
==
MAX_CARDS
)
printk
(
KERN_WARNING
"com20020pci: Too many cards. Ignoring.
\n
"
);
else
cards
[
numcards
++
]
=
dev
;
cards
[
numcards
++
]
=
dev
;
#endif
#endif
gotone
++
;
gotone
++
;
...
@@ -148,8 +146,7 @@ void cleanup_module(void)
...
@@ -148,8 +146,7 @@ void cleanup_module(void)
struct
net_device
*
dev
;
struct
net_device
*
dev
;
int
count
;
int
count
;
for
(
count
=
0
;
count
<
numcards
;
count
++
)
for
(
count
=
0
;
count
<
numcards
;
count
++
)
{
{
dev
=
cards
[
count
];
dev
=
cards
[
count
];
if
(
dev
->
start
)
if
(
dev
->
start
)
...
...
drivers/net/arcnet/com20020.c
View file @
f3da3d88
...
@@ -46,12 +46,12 @@ static char *clockrates[] =
...
@@ -46,12 +46,12 @@ static char *clockrates[] =
"156.25 Kb/s"
,
"Reserved"
,
"Reserved"
,
"156.25 Kb/s"
,
"Reserved"
,
"Reserved"
,
"Reserved"
};
"Reserved"
};
static
void
com20020_command
(
struct
net_device
*
dev
,
int
command
);
static
void
com20020_command
(
struct
net_device
*
dev
,
int
command
);
static
int
com20020_status
(
struct
net_device
*
dev
);
static
int
com20020_status
(
struct
net_device
*
dev
);
static
void
com20020_setmask
(
struct
net_device
*
dev
,
int
mask
);
static
void
com20020_setmask
(
struct
net_device
*
dev
,
int
mask
);
static
int
com20020_reset
(
struct
net_device
*
dev
,
int
really_reset
);
static
int
com20020_reset
(
struct
net_device
*
dev
,
int
really_reset
);
static
void
com20020_openclose
(
struct
net_device
*
dev
,
bool
open
);
static
void
com20020_openclose
(
struct
net_device
*
dev
,
bool
open
);
static
void
com20020_copy_to_card
(
struct
net_device
*
dev
,
int
bufnum
,
static
void
com20020_copy_to_card
(
struct
net_device
*
dev
,
int
bufnum
,
int
offset
,
void
*
buf
,
int
count
);
int
offset
,
void
*
buf
,
int
count
);
static
void
com20020_copy_from_card
(
struct
net_device
*
dev
,
int
bufnum
,
static
void
com20020_copy_from_card
(
struct
net_device
*
dev
,
int
bufnum
,
int
offset
,
void
*
buf
,
int
count
);
int
offset
,
void
*
buf
,
int
count
);
...
@@ -108,12 +108,10 @@ int __init com20020_check(struct net_device *dev)
...
@@ -108,12 +108,10 @@ int __init com20020_check(struct net_device *dev)
status
=
ASTATUS
();
status
=
ASTATUS
();
if
((
status
&
0x99
)
!=
(
NORXflag
|
TXFREEflag
|
RESETflag
))
if
((
status
&
0x99
)
!=
(
NORXflag
|
TXFREEflag
|
RESETflag
))
{
{
BUGMSG
(
D_NORMAL
,
"status invalid (%Xh).
\n
"
,
status
);
BUGMSG
(
D_NORMAL
,
"status invalid (%Xh).
\n
"
,
status
);
return
-
ENODEV
;
return
-
ENODEV
;
}
}
BUGMSG
(
D_INIT_REASONS
,
"status after reset: %X
\n
"
,
status
);
BUGMSG
(
D_INIT_REASONS
,
"status after reset: %X
\n
"
,
status
);
/* Enable TX */
/* Enable TX */
...
@@ -130,13 +128,11 @@ int __init com20020_check(struct net_device *dev)
...
@@ -130,13 +128,11 @@ int __init com20020_check(struct net_device *dev)
outb
(
0
|
RDDATAflag
|
AUTOINCflag
,
_ADDR_HI
);
outb
(
0
|
RDDATAflag
|
AUTOINCflag
,
_ADDR_HI
);
outb
(
0
,
_ADDR_LO
);
outb
(
0
,
_ADDR_LO
);
if
((
status
=
inb
(
_MEMDATA
))
!=
TESTvalue
)
if
((
status
=
inb
(
_MEMDATA
))
!=
TESTvalue
)
{
{
BUGMSG
(
D_NORMAL
,
"Signature byte not found (%02Xh != D1h).
\n
"
,
BUGMSG
(
D_NORMAL
,
"Signature byte not found (%02Xh != D1h).
\n
"
,
status
);
status
);
return
-
ENODEV
;
return
-
ENODEV
;
}
}
return
0
;
return
0
;
}
}
...
@@ -150,7 +146,7 @@ int __init com20020_found(struct net_device *dev, int shared)
...
@@ -150,7 +146,7 @@ int __init com20020_found(struct net_device *dev, int shared)
/* Initialize the rest of the device structure. */
/* Initialize the rest of the device structure. */
lp
=
(
struct
arcnet_local
*
)
dev
->
priv
;
lp
=
(
struct
arcnet_local
*
)
dev
->
priv
;
lp
->
hw
.
command
=
com20020_command
;
lp
->
hw
.
command
=
com20020_command
;
lp
->
hw
.
status
=
com20020_status
;
lp
->
hw
.
status
=
com20020_status
;
...
@@ -183,12 +179,10 @@ int __init com20020_found(struct net_device *dev, int shared)
...
@@ -183,12 +179,10 @@ int __init com20020_found(struct net_device *dev, int shared)
/* reserve the irq */
/* reserve the irq */
if
(
request_irq
(
dev
->
irq
,
&
arcnet_interrupt
,
shared
,
if
(
request_irq
(
dev
->
irq
,
&
arcnet_interrupt
,
shared
,
"arcnet (COM20020)"
,
dev
))
"arcnet (COM20020)"
,
dev
))
{
{
BUGMSG
(
D_NORMAL
,
"Can't get IRQ %d!
\n
"
,
dev
->
irq
);
BUGMSG
(
D_NORMAL
,
"Can't get IRQ %d!
\n
"
,
dev
->
irq
);
return
-
ENODEV
;
return
-
ENODEV
;
}
}
/* reserve the I/O region - guaranteed to work by check_region */
/* reserve the I/O region - guaranteed to work by check_region */
request_region
(
ioaddr
,
ARCNET_TOTAL_SIZE
,
"arcnet (COM20020)"
);
request_region
(
ioaddr
,
ARCNET_TOTAL_SIZE
,
"arcnet (COM20020)"
);
dev
->
base_addr
=
ioaddr
;
dev
->
base_addr
=
ioaddr
;
...
@@ -201,19 +195,15 @@ int __init com20020_found(struct net_device *dev, int shared)
...
@@ -201,19 +195,15 @@ int __init com20020_found(struct net_device *dev, int shared)
if
(
lp
->
timeout
!=
3
)
if
(
lp
->
timeout
!=
3
)
BUGMSG
(
D_NORMAL
,
"Using extended timeout value of %d.
\n
"
,
lp
->
timeout
);
BUGMSG
(
D_NORMAL
,
"Using extended timeout value of %d.
\n
"
,
lp
->
timeout
);
if
(
lp
->
setup
)
if
(
lp
->
setup
)
{
{
BUGMSG
(
D_NORMAL
,
"Using CKP %d - data rate %s.
\n
"
,
BUGMSG
(
D_NORMAL
,
"Using CKP %d - data rate %s.
\n
"
,
lp
->
setup
>>
1
,
clockrates
[
lp
->
setup
>>
1
]);
lp
->
setup
>>
1
,
clockrates
[
lp
->
setup
>>
1
]);
}
}
if
(
!
dev
->
init
&&
register_netdev
(
dev
))
{
if
(
!
dev
->
init
&&
register_netdev
(
dev
))
{
free_irq
(
dev
->
irq
,
dev
);
free_irq
(
dev
->
irq
,
dev
);
release_region
(
ioaddr
,
ARCNET_TOTAL_SIZE
);
release_region
(
ioaddr
,
ARCNET_TOTAL_SIZE
);
return
-
EIO
;
return
-
EIO
;
}
}
return
0
;
return
0
;
}
}
...
@@ -228,7 +218,7 @@ int __init com20020_found(struct net_device *dev, int shared)
...
@@ -228,7 +218,7 @@ int __init com20020_found(struct net_device *dev, int shared)
*/
*/
static
int
com20020_reset
(
struct
net_device
*
dev
,
int
really_reset
)
static
int
com20020_reset
(
struct
net_device
*
dev
,
int
really_reset
)
{
{
struct
arcnet_local
*
lp
=
(
struct
arcnet_local
*
)
dev
->
priv
;
struct
arcnet_local
*
lp
=
(
struct
arcnet_local
*
)
dev
->
priv
;
short
ioaddr
=
dev
->
base_addr
;
short
ioaddr
=
dev
->
base_addr
;
u_char
inbyte
;
u_char
inbyte
;
...
@@ -239,25 +229,21 @@ static int com20020_reset(struct net_device *dev, int really_reset)
...
@@ -239,25 +229,21 @@ static int com20020_reset(struct net_device *dev, int really_reset)
/* power-up defaults */
/* power-up defaults */
SETCONF
(
lp
->
config
);
SETCONF
(
lp
->
config
);
if
(
really_reset
)
if
(
really_reset
)
{
{
/* reset the card */
/* reset the card */
ARCRESET
;
ARCRESET
;
mdelay
(
RESETtime
*
2
);
/* COM20020 seems to be slower sometimes */
mdelay
(
RESETtime
*
2
);
/* COM20020 seems to be slower sometimes */
}
}
/* clear flags & end reset */
/* clear flags & end reset */
ACOMMAND
(
CFLAGScmd
|
RESETclear
|
CONFIGclear
);
ACOMMAND
(
CFLAGScmd
|
RESETclear
|
CONFIGclear
);
/* verify that the ARCnet signature byte is present */
/* verify that the ARCnet signature byte is present */
com20020_copy_from_card
(
dev
,
0
,
0
,
&
inbyte
,
1
);
com20020_copy_from_card
(
dev
,
0
,
0
,
&
inbyte
,
1
);
if
(
inbyte
!=
TESTvalue
)
if
(
inbyte
!=
TESTvalue
)
{
{
BUGMSG
(
D_NORMAL
,
"reset failed: TESTvalue not present.
\n
"
);
BUGMSG
(
D_NORMAL
,
"reset failed: TESTvalue not present.
\n
"
);
return
1
;
return
1
;
}
}
/* enable extended (512-byte) packets */
/* enable extended (512-byte) packets */
ACOMMAND
(
CONFIGcmd
|
EXTconf
);
ACOMMAND
(
CONFIGcmd
|
EXTconf
);
...
@@ -289,13 +275,12 @@ static int com20020_status(struct net_device *dev)
...
@@ -289,13 +275,12 @@ static int com20020_status(struct net_device *dev)
static
void
com20020_openclose
(
struct
net_device
*
dev
,
bool
open
)
static
void
com20020_openclose
(
struct
net_device
*
dev
,
bool
open
)
{
{
struct
arcnet_local
*
lp
=
(
struct
arcnet_local
*
)
dev
->
priv
;
struct
arcnet_local
*
lp
=
(
struct
arcnet_local
*
)
dev
->
priv
;
int
ioaddr
=
dev
->
base_addr
;
int
ioaddr
=
dev
->
base_addr
;
if
(
open
)
if
(
open
)
MOD_INC_USE_COUNT
;
MOD_INC_USE_COUNT
;
else
else
{
{
/* disable transmitter */
/* disable transmitter */
lp
->
config
&=
~
TXENcfg
;
lp
->
config
&=
~
TXENcfg
;
SETCONF
(
lp
->
config
);
SETCONF
(
lp
->
config
);
...
@@ -317,16 +302,14 @@ static void com20020_set_mc_list(struct net_device *dev)
...
@@ -317,16 +302,14 @@ static void com20020_set_mc_list(struct net_device *dev)
struct
arcnet_local
*
lp
=
dev
->
priv
;
struct
arcnet_local
*
lp
=
dev
->
priv
;
int
ioaddr
=
dev
->
base_addr
;
int
ioaddr
=
dev
->
base_addr
;
if
((
dev
->
flags
&
IFF_PROMISC
)
&&
(
dev
->
flags
&
IFF_UP
))
if
((
dev
->
flags
&
IFF_PROMISC
)
&&
(
dev
->
flags
&
IFF_UP
))
{
/* Enable promiscuous mode */
{
/* Enable promiscuous mode */
if
(
!
(
lp
->
setup
&
PROMISCset
))
if
(
!
(
lp
->
setup
&
PROMISCset
))
BUGMSG
(
D_NORMAL
,
"Setting promiscuous flag...
\n
"
);
BUGMSG
(
D_NORMAL
,
"Setting promiscuous flag...
\n
"
);
REGSETUP
;
REGSETUP
;
SETCONF
(
lp
->
config
);
SETCONF
(
lp
->
config
);
lp
->
setup
|=
PROMISCset
;
lp
->
setup
|=
PROMISCset
;
outb
(
lp
->
setup
,
_SETUP
);
outb
(
lp
->
setup
,
_SETUP
);
}
}
else
else
/* Disable promiscuous mode, use normal mode */
/* Disable promiscuous mode, use normal mode */
{
{
if
((
lp
->
setup
&
PROMISCset
))
if
((
lp
->
setup
&
PROMISCset
))
...
@@ -348,7 +331,7 @@ static void com20020_set_mc_list(struct net_device *dev)
...
@@ -348,7 +331,7 @@ static void com20020_set_mc_list(struct net_device *dev)
SETCONF(lp->config);
SETCONF(lp->config);
BUGMSG(D_EXTRA, "New NextID detected: %X\n", inb(ioaddr + 7));
BUGMSG(D_EXTRA, "New NextID detected: %X\n", inb(ioaddr + 7));
}
}
*/
*/
#ifdef MODULE
#ifdef MODULE
...
...
drivers/net/arcnet/com90io.c
View file @
f3da3d88
...
@@ -43,12 +43,12 @@
...
@@ -43,12 +43,12 @@
/* Internal function declarations */
/* Internal function declarations */
static
int
com90io_found
(
struct
net_device
*
dev
);
static
int
com90io_found
(
struct
net_device
*
dev
);
static
void
com90io_command
(
struct
net_device
*
dev
,
int
command
);
static
void
com90io_command
(
struct
net_device
*
dev
,
int
command
);
static
int
com90io_status
(
struct
net_device
*
dev
);
static
int
com90io_status
(
struct
net_device
*
dev
);
static
void
com90io_setmask
(
struct
net_device
*
dev
,
int
mask
);
static
void
com90io_setmask
(
struct
net_device
*
dev
,
int
mask
);
static
int
com90io_reset
(
struct
net_device
*
dev
,
int
really_reset
);
static
int
com90io_reset
(
struct
net_device
*
dev
,
int
really_reset
);
static
void
com90io_openclose
(
struct
net_device
*
dev
,
bool
open
);
static
void
com90io_openclose
(
struct
net_device
*
dev
,
bool
open
);
static
void
com90io_copy_to_card
(
struct
net_device
*
dev
,
int
bufnum
,
int
offset
,
static
void
com90io_copy_to_card
(
struct
net_device
*
dev
,
int
bufnum
,
int
offset
,
void
*
buf
,
int
count
);
void
*
buf
,
int
count
);
static
void
com90io_copy_from_card
(
struct
net_device
*
dev
,
int
bufnum
,
int
offset
,
static
void
com90io_copy_from_card
(
struct
net_device
*
dev
,
int
bufnum
,
int
offset
,
void
*
buf
,
int
count
);
void
*
buf
,
int
count
);
...
@@ -108,6 +108,7 @@ static void put_buffer_byte(struct net_device *dev, unsigned offset, u_char datu
...
@@ -108,6 +108,7 @@ static void put_buffer_byte(struct net_device *dev, unsigned offset, u_char datu
outb
(
datum
,
_MEMDATA
);
outb
(
datum
,
_MEMDATA
);
}
}
#endif
#endif
...
@@ -162,18 +163,15 @@ static int __init com90io_probe(struct net_device *dev)
...
@@ -162,18 +163,15 @@ static int __init com90io_probe(struct net_device *dev)
"must specify the base address!
\n
"
);
"must specify the base address!
\n
"
);
return
-
ENODEV
;
return
-
ENODEV
;
}
}
if
(
check_region
(
ioaddr
,
ARCNET_TOTAL_SIZE
))
{
if
(
check_region
(
ioaddr
,
ARCNET_TOTAL_SIZE
))
{
BUGMSG
(
D_INIT_REASONS
,
"IO check_region %x-%x failed.
\n
"
,
BUGMSG
(
D_INIT_REASONS
,
"IO check_region %x-%x failed.
\n
"
,
ioaddr
,
ioaddr
+
ARCNET_TOTAL_SIZE
-
1
);
ioaddr
,
ioaddr
+
ARCNET_TOTAL_SIZE
-
1
);
return
-
ENXIO
;
return
-
ENXIO
;
}
}
if
(
ASTATUS
()
==
0xFF
)
{
if
(
ASTATUS
()
==
0xFF
)
{
BUGMSG
(
D_INIT_REASONS
,
"IO address %x empty
\n
"
,
ioaddr
);
BUGMSG
(
D_INIT_REASONS
,
"IO address %x empty
\n
"
,
ioaddr
);
return
-
ENODEV
;
return
-
ENODEV
;
}
}
inb
(
_RESET
);
inb
(
_RESET
);
mdelay
(
RESETtime
);
mdelay
(
RESETtime
);
...
@@ -183,7 +181,6 @@ static int __init com90io_probe(struct net_device *dev)
...
@@ -183,7 +181,6 @@ static int __init com90io_probe(struct net_device *dev)
BUGMSG
(
D_INIT_REASONS
,
"Status invalid (%Xh).
\n
"
,
status
);
BUGMSG
(
D_INIT_REASONS
,
"Status invalid (%Xh).
\n
"
,
status
);
return
-
ENODEV
;
return
-
ENODEV
;
}
}
BUGMSG
(
D_INIT_REASONS
,
"Status after reset: %X
\n
"
,
status
);
BUGMSG
(
D_INIT_REASONS
,
"Status after reset: %X
\n
"
,
status
);
ACOMMAND
(
CFLAGScmd
|
RESETclear
|
CONFIGclear
);
ACOMMAND
(
CFLAGScmd
|
RESETclear
|
CONFIGclear
);
...
@@ -196,7 +193,6 @@ static int __init com90io_probe(struct net_device *dev)
...
@@ -196,7 +193,6 @@ static int __init com90io_probe(struct net_device *dev)
BUGMSG
(
D_INIT_REASONS
,
"Eternal reset (status=%Xh)
\n
"
,
status
);
BUGMSG
(
D_INIT_REASONS
,
"Eternal reset (status=%Xh)
\n
"
,
status
);
return
-
ENODEV
;
return
-
ENODEV
;
}
}
outb
((
0x16
|
IOMAPflag
)
&
~
ENABLE16flag
,
_CONFIG
);
outb
((
0x16
|
IOMAPflag
)
&
~
ENABLE16flag
,
_CONFIG
);
/* Read first loc'n of memory */
/* Read first loc'n of memory */
...
@@ -209,7 +205,6 @@ static int __init com90io_probe(struct net_device *dev)
...
@@ -209,7 +205,6 @@ static int __init com90io_probe(struct net_device *dev)
" (%Xh instead).
\n
"
,
status
);
" (%Xh instead).
\n
"
,
status
);
return
-
ENODEV
;
return
-
ENODEV
;
}
}
if
(
!
dev
->
irq
)
{
if
(
!
dev
->
irq
)
{
/*
/*
* if we do this, we're sure to get an IRQ since the
* if we do this, we're sure to get an IRQ since the
...
@@ -228,7 +223,6 @@ static int __init com90io_probe(struct net_device *dev)
...
@@ -228,7 +223,6 @@ static int __init com90io_probe(struct net_device *dev)
return
-
ENODEV
;
return
-
ENODEV
;
}
}
}
}
return
com90io_found
(
dev
);
return
com90io_found
(
dev
);
}
}
...
@@ -246,7 +240,6 @@ static int __init com90io_found(struct net_device *dev)
...
@@ -246,7 +240,6 @@ static int __init com90io_found(struct net_device *dev)
BUGMSG
(
D_NORMAL
,
"Can't get IRQ %d!
\n
"
,
dev
->
irq
);
BUGMSG
(
D_NORMAL
,
"Can't get IRQ %d!
\n
"
,
dev
->
irq
);
return
-
ENODEV
;
return
-
ENODEV
;
}
}
/* Reserve the I/O region - guaranteed to work by check_region */
/* Reserve the I/O region - guaranteed to work by check_region */
request_region
(
dev
->
base_addr
,
ARCNET_TOTAL_SIZE
,
"arcnet (COM90xx-IO)"
);
request_region
(
dev
->
base_addr
,
ARCNET_TOTAL_SIZE
,
"arcnet (COM90xx-IO)"
);
...
@@ -308,7 +301,6 @@ static int com90io_reset(struct net_device *dev, int really_reset)
...
@@ -308,7 +301,6 @@ static int com90io_reset(struct net_device *dev, int really_reset)
inb
(
_RESET
);
inb
(
_RESET
);
mdelay
(
RESETtime
);
mdelay
(
RESETtime
);
}
}
/* Set the thing to IO-mapped, 8-bit mode */
/* Set the thing to IO-mapped, 8-bit mode */
lp
->
config
=
(
0x1C
|
IOMAPflag
)
&
~
ENABLE16flag
;
lp
->
config
=
(
0x1C
|
IOMAPflag
)
&
~
ENABLE16flag
;
SETCONF
();
SETCONF
();
...
@@ -321,7 +313,6 @@ static int com90io_reset(struct net_device *dev, int really_reset)
...
@@ -321,7 +313,6 @@ static int com90io_reset(struct net_device *dev, int really_reset)
BUGMSG
(
D_NORMAL
,
"reset failed: TESTvalue not present.
\n
"
);
BUGMSG
(
D_NORMAL
,
"reset failed: TESTvalue not present.
\n
"
);
return
1
;
return
1
;
}
}
/* enable extended (512-byte) packets */
/* enable extended (512-byte) packets */
ACOMMAND
(
CONFIGcmd
|
EXTconf
);
ACOMMAND
(
CONFIGcmd
|
EXTconf
);
...
@@ -364,14 +355,14 @@ static void com90io_openclose(struct net_device *dev, int open)
...
@@ -364,14 +355,14 @@ static void com90io_openclose(struct net_device *dev, int open)
static
void
com90io_copy_to_card
(
struct
net_device
*
dev
,
int
bufnum
,
int
offset
,
static
void
com90io_copy_to_card
(
struct
net_device
*
dev
,
int
bufnum
,
int
offset
,
void
*
buf
,
int
count
)
void
*
buf
,
int
count
)
{
{
TIME
(
"put_whole_buffer"
,
count
,
put_whole_buffer
(
dev
,
bufnum
*
512
+
offset
,
count
,
buf
));
TIME
(
"put_whole_buffer"
,
count
,
put_whole_buffer
(
dev
,
bufnum
*
512
+
offset
,
count
,
buf
));
}
}
static
void
com90io_copy_from_card
(
struct
net_device
*
dev
,
int
bufnum
,
int
offset
,
static
void
com90io_copy_from_card
(
struct
net_device
*
dev
,
int
bufnum
,
int
offset
,
void
*
buf
,
int
count
)
void
*
buf
,
int
count
)
{
{
TIME
(
"get_whole_buffer"
,
count
,
get_whole_buffer
(
dev
,
bufnum
*
512
+
offset
,
count
,
buf
));
TIME
(
"get_whole_buffer"
,
count
,
get_whole_buffer
(
dev
,
bufnum
*
512
+
offset
,
count
,
buf
));
}
}
...
@@ -445,7 +436,7 @@ static int __init com90io_setup(char *s)
...
@@ -445,7 +436,7 @@ static int __init com90io_setup(char *s)
return
1
;
return
1
;
dev
=
alloc_bootmem
(
sizeof
(
struct
net_device
)
+
10
);
dev
=
alloc_bootmem
(
sizeof
(
struct
net_device
)
+
10
);
memset
(
dev
,
0
,
sizeof
(
struct
net_device
)
+
10
);
memset
(
dev
,
0
,
sizeof
(
struct
net_device
)
+
10
);
dev
->
name
=
(
char
*
)
(
dev
+
1
);
dev
->
name
=
(
char
*
)
(
dev
+
1
);
dev
->
init
=
com90io_probe
;
dev
->
init
=
com90io_probe
;
switch
(
ints
[
0
])
{
switch
(
ints
[
0
])
{
...
...
drivers/net/arcnet/com90xx.c
View file @
f3da3d88
This diff is collapsed.
Click to expand it.
drivers/net/arcnet/rfc1051.c
View file @
f3da3d88
...
@@ -44,7 +44,8 @@ static int prepare_tx(struct net_device *dev, struct archdr *pkt, int length,
...
@@ -44,7 +44,8 @@ static int prepare_tx(struct net_device *dev, struct archdr *pkt, int length,
int
bufnum
);
int
bufnum
);
struct
ArcProto
rfc1051_proto
=
{
struct
ArcProto
rfc1051_proto
=
{
's'
,
's'
,
XMTU
-
RFC1051_HDR_SIZE
,
XMTU
-
RFC1051_HDR_SIZE
,
rx
,
rx
,
...
@@ -90,8 +91,8 @@ void cleanup_module(void)
...
@@ -90,8 +91,8 @@ void cleanup_module(void)
*/
*/
static
unsigned
short
type_trans
(
struct
sk_buff
*
skb
,
struct
net_device
*
dev
)
static
unsigned
short
type_trans
(
struct
sk_buff
*
skb
,
struct
net_device
*
dev
)
{
{
struct
arcnet_local
*
lp
=
(
struct
arcnet_local
*
)
dev
->
priv
;
struct
arcnet_local
*
lp
=
(
struct
arcnet_local
*
)
dev
->
priv
;
struct
archdr
*
pkt
=
(
struct
archdr
*
)
skb
->
data
;
struct
archdr
*
pkt
=
(
struct
archdr
*
)
skb
->
data
;
struct
arc_rfc1051
*
soft
=
&
pkt
->
soft
.
rfc1051
;
struct
arc_rfc1051
*
soft
=
&
pkt
->
soft
.
rfc1051
;
int
hdr_size
=
ARC_HDR_SIZE
+
RFC1051_HDR_SIZE
;
int
hdr_size
=
ARC_HDR_SIZE
+
RFC1051_HDR_SIZE
;
...
@@ -101,16 +102,13 @@ static unsigned short type_trans(struct sk_buff *skb, struct net_device *dev)
...
@@ -101,16 +102,13 @@ static unsigned short type_trans(struct sk_buff *skb, struct net_device *dev)
if
(
pkt
->
hard
.
dest
==
0
)
if
(
pkt
->
hard
.
dest
==
0
)
skb
->
pkt_type
=
PACKET_BROADCAST
;
skb
->
pkt_type
=
PACKET_BROADCAST
;
else
if
(
dev
->
flags
&
IFF_PROMISC
)
else
if
(
dev
->
flags
&
IFF_PROMISC
)
{
{
/* if we're not sending to ourselves :) */
/* if we're not sending to ourselves :) */
if
(
pkt
->
hard
.
dest
!=
dev
->
dev_addr
[
0
])
if
(
pkt
->
hard
.
dest
!=
dev
->
dev_addr
[
0
])
skb
->
pkt_type
=
PACKET_OTHERHOST
;
skb
->
pkt_type
=
PACKET_OTHERHOST
;
}
}
/* now return the protocol number */
/* now return the protocol number */
switch
(
soft
->
proto
)
switch
(
soft
->
proto
)
{
{
case
ARC_P_IP_RFC1051
:
case
ARC_P_IP_RFC1051
:
return
htons
(
ETH_P_IP
);
return
htons
(
ETH_P_IP
);
case
ARC_P_ARP_RFC1051
:
case
ARC_P_ARP_RFC1051
:
...
@@ -130,7 +128,7 @@ static unsigned short type_trans(struct sk_buff *skb, struct net_device *dev)
...
@@ -130,7 +128,7 @@ static unsigned short type_trans(struct sk_buff *skb, struct net_device *dev)
static
void
rx
(
struct
net_device
*
dev
,
int
bufnum
,
static
void
rx
(
struct
net_device
*
dev
,
int
bufnum
,
struct
archdr
*
pkthdr
,
int
length
)
struct
archdr
*
pkthdr
,
int
length
)
{
{
struct
arcnet_local
*
lp
=
(
struct
arcnet_local
*
)
dev
->
priv
;
struct
arcnet_local
*
lp
=
(
struct
arcnet_local
*
)
dev
->
priv
;
struct
sk_buff
*
skb
;
struct
sk_buff
*
skb
;
struct
archdr
*
pkt
=
pkthdr
;
struct
archdr
*
pkt
=
pkthdr
;
int
ofs
;
int
ofs
;
...
@@ -143,17 +141,15 @@ static void rx(struct net_device *dev, int bufnum,
...
@@ -143,17 +141,15 @@ static void rx(struct net_device *dev, int bufnum,
ofs
=
256
-
length
;
ofs
=
256
-
length
;
skb
=
alloc_skb
(
length
+
ARC_HDR_SIZE
,
GFP_ATOMIC
);
skb
=
alloc_skb
(
length
+
ARC_HDR_SIZE
,
GFP_ATOMIC
);
if
(
skb
==
NULL
)
if
(
skb
==
NULL
)
{
{
BUGMSG
(
D_NORMAL
,
"Memory squeeze, dropping packet.
\n
"
);
BUGMSG
(
D_NORMAL
,
"Memory squeeze, dropping packet.
\n
"
);
lp
->
stats
.
rx_dropped
++
;
lp
->
stats
.
rx_dropped
++
;
return
;
return
;
}
}
skb_put
(
skb
,
length
+
ARC_HDR_SIZE
);
skb_put
(
skb
,
length
+
ARC_HDR_SIZE
);
skb
->
dev
=
dev
;
skb
->
dev
=
dev
;
pkt
=
(
struct
archdr
*
)
skb
->
data
;
pkt
=
(
struct
archdr
*
)
skb
->
data
;
/* up to sizeof(pkt->soft) has already been copied from the card */
/* up to sizeof(pkt->soft) has already been copied from the card */
memcpy
(
pkt
,
pkthdr
,
sizeof
(
struct
archdr
));
memcpy
(
pkt
,
pkthdr
,
sizeof
(
struct
archdr
));
...
@@ -176,14 +172,13 @@ static int build_header(struct sk_buff *skb, unsigned short type,
...
@@ -176,14 +172,13 @@ static int build_header(struct sk_buff *skb, unsigned short type,
uint8_t
daddr
)
uint8_t
daddr
)
{
{
struct
net_device
*
dev
=
skb
->
dev
;
struct
net_device
*
dev
=
skb
->
dev
;
struct
arcnet_local
*
lp
=
(
struct
arcnet_local
*
)
dev
->
priv
;
struct
arcnet_local
*
lp
=
(
struct
arcnet_local
*
)
dev
->
priv
;
int
hdr_size
=
ARC_HDR_SIZE
+
RFC1051_HDR_SIZE
;
int
hdr_size
=
ARC_HDR_SIZE
+
RFC1051_HDR_SIZE
;
struct
archdr
*
pkt
=
(
struct
archdr
*
)
skb_push
(
skb
,
hdr_size
);
struct
archdr
*
pkt
=
(
struct
archdr
*
)
skb_push
(
skb
,
hdr_size
);
struct
arc_rfc1051
*
soft
=
&
pkt
->
soft
.
rfc1051
;
struct
arc_rfc1051
*
soft
=
&
pkt
->
soft
.
rfc1051
;
/* set the protocol ID according to RFC1051 */
/* set the protocol ID according to RFC1051 */
switch
(
type
)
switch
(
type
)
{
{
case
ETH_P_IP
:
case
ETH_P_IP
:
soft
->
proto
=
ARC_P_IP_RFC1051
;
soft
->
proto
=
ARC_P_IP_RFC1051
;
break
;
break
;
...
@@ -210,8 +205,7 @@ static int build_header(struct sk_buff *skb, unsigned short type,
...
@@ -210,8 +205,7 @@ static int build_header(struct sk_buff *skb, unsigned short type,
/* see linux/net/ethernet/eth.c to see where I got the following */
/* see linux/net/ethernet/eth.c to see where I got the following */
if
(
dev
->
flags
&
(
IFF_LOOPBACK
|
IFF_NOARP
))
if
(
dev
->
flags
&
(
IFF_LOOPBACK
|
IFF_NOARP
))
{
{
/*
/*
* FIXME: fill in the last byte of the dest ipaddr here to better
* FIXME: fill in the last byte of the dest ipaddr here to better
* comply with RFC1051 in "noarp" mode.
* comply with RFC1051 in "noarp" mode.
...
@@ -219,7 +213,6 @@ static int build_header(struct sk_buff *skb, unsigned short type,
...
@@ -219,7 +213,6 @@ static int build_header(struct sk_buff *skb, unsigned short type,
pkt
->
hard
.
dest
=
0
;
pkt
->
hard
.
dest
=
0
;
return
hdr_size
;
return
hdr_size
;
}
}
/* otherwise, just fill it in and go! */
/* otherwise, just fill it in and go! */
pkt
->
hard
.
dest
=
daddr
;
pkt
->
hard
.
dest
=
daddr
;
...
@@ -230,7 +223,7 @@ static int build_header(struct sk_buff *skb, unsigned short type,
...
@@ -230,7 +223,7 @@ static int build_header(struct sk_buff *skb, unsigned short type,
static
int
prepare_tx
(
struct
net_device
*
dev
,
struct
archdr
*
pkt
,
int
length
,
static
int
prepare_tx
(
struct
net_device
*
dev
,
struct
archdr
*
pkt
,
int
length
,
int
bufnum
)
int
bufnum
)
{
{
struct
arcnet_local
*
lp
=
(
struct
arcnet_local
*
)
dev
->
priv
;
struct
arcnet_local
*
lp
=
(
struct
arcnet_local
*
)
dev
->
priv
;
struct
arc_hardware
*
hard
=
&
pkt
->
hard
;
struct
arc_hardware
*
hard
=
&
pkt
->
hard
;
int
ofs
;
int
ofs
;
...
@@ -239,25 +232,19 @@ static int prepare_tx(struct net_device *dev, struct archdr *pkt, int length,
...
@@ -239,25 +232,19 @@ static int prepare_tx(struct net_device *dev, struct archdr *pkt, int length,
length
-=
ARC_HDR_SIZE
;
/* hard header is not included in packet length */
length
-=
ARC_HDR_SIZE
;
/* hard header is not included in packet length */
if
(
length
>
XMTU
)
if
(
length
>
XMTU
)
{
{
/* should never happen! other people already check for this. */
/* should never happen! other people already check for this. */
BUGMSG
(
D_NORMAL
,
"Bug! prepare_tx with size %d (> %d)
\n
"
,
BUGMSG
(
D_NORMAL
,
"Bug! prepare_tx with size %d (> %d)
\n
"
,
length
,
XMTU
);
length
,
XMTU
);
length
=
XMTU
;
length
=
XMTU
;
}
}
if
(
length
>
MinTU
)
{
if
(
length
>
MinTU
)
{
hard
->
offset
[
0
]
=
0
;
hard
->
offset
[
0
]
=
0
;
hard
->
offset
[
1
]
=
ofs
=
512
-
length
;
hard
->
offset
[
1
]
=
ofs
=
512
-
length
;
}
}
else
if
(
length
>
MTU
)
{
else
if
(
length
>
MTU
)
{
hard
->
offset
[
0
]
=
0
;
hard
->
offset
[
0
]
=
0
;
hard
->
offset
[
1
]
=
ofs
=
512
-
length
-
3
;
hard
->
offset
[
1
]
=
ofs
=
512
-
length
-
3
;
}
}
else
else
hard
->
offset
[
0
]
=
ofs
=
256
-
length
;
hard
->
offset
[
0
]
=
ofs
=
256
-
length
;
lp
->
hw
.
copy_to_card
(
dev
,
bufnum
,
0
,
hard
,
ARC_HDR_SIZE
);
lp
->
hw
.
copy_to_card
(
dev
,
bufnum
,
0
,
hard
,
ARC_HDR_SIZE
);
...
...
drivers/net/arcnet/rfc1201.c
View file @
f3da3d88
This diff is collapsed.
Click to expand it.
drivers/pci/pci.c
View file @
f3da3d88
...
@@ -672,7 +672,7 @@ struct pci_dev * __init pci_scan_slot(struct pci_dev *temp)
...
@@ -672,7 +672,7 @@ struct pci_dev * __init pci_scan_slot(struct pci_dev *temp)
first_dev
=
dev
;
first_dev
=
dev
;
}
}
DBG
(
"PCI: %02x:%02x [%04x/%04x] %06x %02x
\n
"
,
bus
->
number
,
dev
->
devfn
,
dev
->
vendor
,
dev
->
device
,
class
,
hdr_type
);
DBG
(
"PCI: %02x:%02x [%04x/%04x] %06x %02x
\n
"
,
bus
->
number
,
dev
->
devfn
,
dev
->
vendor
,
dev
->
device
,
dev
->
class
,
hdr_type
);
/*
/*
* Put it into the global PCI device chain. It's used to
* Put it into the global PCI device chain. It's used to
...
...
drivers/pcmcia/cardbus.c
View file @
f3da3d88
...
@@ -185,8 +185,8 @@ int cb_setup_cis_mem(socket_info_t *s, int space)
...
@@ -185,8 +185,8 @@ int cb_setup_cis_mem(socket_info_t *s, int space)
/* Not configured? Then set up temporary map */
/* Not configured? Then set up temporary map */
br
=
(
space
==
7
)
?
CB_ROM_BASE
:
CB_BAR
(
space
-
1
);
br
=
(
space
==
7
)
?
CB_ROM_BASE
:
CB_BAR
(
space
-
1
);
pci_writel
(
s
->
cap
.
c
ardbus
,
0
,
br
,
0xffffffff
);
pci_writel
(
s
->
cap
.
c
b_dev
->
subordinate
->
number
,
0
,
br
,
0xffffffff
);
pci_readl
(
s
->
cap
.
c
ardbus
,
0
,
br
,
&
sz
);
pci_readl
(
s
->
cap
.
c
b_dev
->
subordinate
->
number
,
0
,
br
,
&
sz
);
sz
&=
PCI_BASE_ADDRESS_MEM_MASK
;
sz
&=
PCI_BASE_ADDRESS_MEM_MASK
;
sz
=
FIND_FIRST_BIT
(
sz
);
sz
=
FIND_FIRST_BIT
(
sz
);
if
(
sz
<
PAGE_SIZE
)
sz
=
PAGE_SIZE
;
if
(
sz
<
PAGE_SIZE
)
sz
=
PAGE_SIZE
;
...
@@ -199,8 +199,8 @@ int cb_setup_cis_mem(socket_info_t *s, int space)
...
@@ -199,8 +199,8 @@ int cb_setup_cis_mem(socket_info_t *s, int space)
s
->
cb_cis_virt
=
ioremap
(
base
,
sz
);
s
->
cb_cis_virt
=
ioremap
(
base
,
sz
);
DEBUG
(
1
,
" phys 0x%08lx-0x%08lx, virt 0x%08lx
\n
"
,
DEBUG
(
1
,
" phys 0x%08lx-0x%08lx, virt 0x%08lx
\n
"
,
base
,
base
+
sz
-
1
,
(
u_long
)
s
->
cb_cis_virt
);
base
,
base
+
sz
-
1
,
(
u_long
)
s
->
cb_cis_virt
);
pci_writel
(
s
->
cap
.
c
ardbus
,
0
,
br
,
base
|
1
);
pci_writel
(
s
->
cap
.
c
b_dev
->
subordinate
->
number
,
0
,
br
,
base
|
1
);
pci_writeb
(
s
->
cap
.
c
ardbus
,
0
,
PCI_COMMAND
,
PCI_COMMAND_MEMORY
);
pci_writeb
(
s
->
cap
.
c
b_dev
->
subordinate
->
number
,
0
,
PCI_COMMAND
,
PCI_COMMAND_MEMORY
);
m
->
map
=
0
;
m
->
flags
=
MAP_ACTIVE
;
m
->
map
=
0
;
m
->
flags
=
MAP_ACTIVE
;
m
->
start
=
base
;
m
->
stop
=
base
+
sz
-
1
;
m
->
start
=
base
;
m
->
stop
=
base
+
sz
-
1
;
s
->
ss_entry
->
set_bridge
(
s
->
sock
,
m
);
s
->
ss_entry
->
set_bridge
(
s
->
sock
,
m
);
...
@@ -228,8 +228,8 @@ void cb_release_cis_mem(socket_info_t *s)
...
@@ -228,8 +228,8 @@ void cb_release_cis_mem(socket_info_t *s)
CB_ROM_BASE
:
CB_BAR
(
s
->
cb_cis_space
-
1
);
CB_ROM_BASE
:
CB_BAR
(
s
->
cb_cis_space
-
1
);
m
->
map
=
0
;
m
->
flags
=
0
;
m
->
map
=
0
;
m
->
flags
=
0
;
s
->
ss_entry
->
set_bridge
(
s
->
sock
,
m
);
s
->
ss_entry
->
set_bridge
(
s
->
sock
,
m
);
pci_writeb
(
s
->
cap
.
c
ardbus
,
0
,
PCI_COMMAND
,
0
);
pci_writeb
(
s
->
cap
.
c
b_dev
->
subordinate
->
number
,
0
,
PCI_COMMAND
,
0
);
pci_writel
(
s
->
cap
.
c
ardbus
,
0
,
br
,
0
);
pci_writel
(
s
->
cap
.
c
b_dev
->
subordinate
->
number
,
0
,
br
,
0
);
release_mem_region
(
m
->
start
,
m
->
stop
-
m
->
start
+
1
);
release_mem_region
(
m
->
start
,
m
->
stop
-
m
->
start
+
1
);
m
->
start
=
0
;
m
->
start
=
0
;
}
}
...
@@ -249,7 +249,7 @@ void read_cb_mem(socket_info_t *s, u_char fn, int space,
...
@@ -249,7 +249,7 @@ void read_cb_mem(socket_info_t *s, u_char fn, int space,
if
(
space
==
0
)
{
if
(
space
==
0
)
{
if
(
addr
+
len
>
0x100
)
goto
fail
;
if
(
addr
+
len
>
0x100
)
goto
fail
;
for
(;
len
;
addr
++
,
ptr
++
,
len
--
)
for
(;
len
;
addr
++
,
ptr
++
,
len
--
)
pci_readb
(
s
->
cap
.
c
ardbus
,
fn
,
addr
,
(
u_char
*
)
ptr
);
pci_readb
(
s
->
cap
.
c
b_dev
->
subordinate
->
number
,
fn
,
addr
,
(
u_char
*
)
ptr
);
}
else
{
}
else
{
if
(
cb_setup_cis_mem
(
s
,
space
)
!=
0
)
goto
fail
;
if
(
cb_setup_cis_mem
(
s
,
space
)
!=
0
)
goto
fail
;
if
(
space
==
7
)
{
if
(
space
==
7
)
{
...
@@ -278,57 +278,62 @@ void read_cb_mem(socket_info_t *s, u_char fn, int space,
...
@@ -278,57 +278,62 @@ void read_cb_mem(socket_info_t *s, u_char fn, int space,
int
cb_alloc
(
socket_info_t
*
s
)
int
cb_alloc
(
socket_info_t
*
s
)
{
{
struct
pci_bus
*
bus
;
struct
pci_dev
tmp
;
struct
pci_dev
tmp
;
u_short
vend
,
v
,
dev
;
u_short
vend
,
v
,
dev
;
u_char
i
,
hdr
,
fn
,
bus
=
s
->
cap
.
cardbus
;
u_char
i
,
hdr
,
fn
;
cb_config_t
*
c
;
cb_config_t
*
c
;
bus
=
s
->
cap
.
cb_dev
->
subordinate
;
memset
(
&
tmp
,
0
,
sizeof
(
tmp
));
memset
(
&
tmp
,
0
,
sizeof
(
tmp
));
tmp
.
bus
=
s
->
cap
.
cb_
bus
;
tmp
.
devfn
=
0
;
tmp
.
bus
=
bus
;
tmp
.
devfn
=
0
;
printk
(
"bus=%p, number=%d
\n
"
,
bus
,
bus
->
number
);
pci_read_config_word
(
&
tmp
,
PCI_VENDOR_ID
,
&
vend
);
pci_read_config_word
(
&
tmp
,
PCI_VENDOR_ID
,
&
vend
);
pci_read_config_word
(
&
tmp
,
PCI_DEVICE_ID
,
&
dev
);
pci_read_config_word
(
&
tmp
,
PCI_DEVICE_ID
,
&
dev
);
printk
(
KERN_INFO
"cs: cb_alloc(bus %d): vendor 0x%04x, "
printk
(
KERN_INFO
"cs: cb_alloc(bus %d): vendor 0x%04x, "
"device 0x%04x
\n
"
,
bus
,
vend
,
dev
);
"device 0x%04x
\n
"
,
bus
->
number
,
vend
,
dev
);
pci_read_config_byte
(
&
tmp
,
PCI_HEADER_TYPE
,
&
hdr
);
pci_read_config_byte
(
&
tmp
,
PCI_HEADER_TYPE
,
&
hdr
);
fn
=
1
;
if
(
hdr
&
0x80
)
{
if
(
hdr
&
0x80
)
{
/* Count functions */
do
{
for
(
fn
=
0
;
fn
<
8
;
fn
++
)
{
tmp
.
devfn
=
fn
;
tmp
.
devfn
=
fn
;
pci_read_config_word
(
&
tmp
,
PCI_VENDOR_ID
,
&
v
);
pci_read_config_word
(
&
tmp
,
PCI_VENDOR_ID
,
&
v
);
if
(
v
!=
vend
)
break
;
if
(
v
!=
vend
)
break
;
fn
++
;
}
while
(
fn
<
8
);
}
}
}
else
fn
=
1
;
s
->
functions
=
fn
;
s
->
functions
=
fn
;
c
=
kmalloc
(
fn
*
sizeof
(
struct
cb_config_t
),
GFP_ATOMIC
);
c
=
kmalloc
(
fn
*
sizeof
(
struct
cb_config_t
),
GFP_ATOMIC
);
if
(
!
c
)
return
CS_OUT_OF_RESOURCE
;
if
(
!
c
)
return
CS_OUT_OF_RESOURCE
;
memset
(
c
,
0
,
fn
*
sizeof
(
struct
cb_config_t
));
memset
(
c
,
0
,
fn
*
sizeof
(
struct
cb_config_t
));
s
->
cb_config
=
c
;
for
(
i
=
0
;
i
<
fn
;
i
++
)
{
for
(
i
=
0
;
i
<
fn
;
i
++
)
{
c
[
i
].
dev
.
bus
=
s
->
cap
.
cb_bus
;
struct
pci_dev
*
dev
=
&
c
[
i
].
dev
;
c
[
i
].
dev
.
devfn
=
i
;
dev
->
bus
=
bus
;
dev
->
devfn
=
i
;
if
(
i
<
fn
-
1
)
{
if
(
i
<
fn
-
1
)
{
c
[
i
].
dev
.
sibling
=
c
[
i
].
dev
.
next
=
&
c
[
i
+
1
].
dev
;
dev
->
sibling
=
dev
->
next
=
&
c
[
i
+
1
].
dev
;
}
}
dev
->
vendor
=
vend
;
pci_read_config_word
(
dev
,
PCI_DEVICE_ID
,
&
dev
->
device
);
pci_read_config_dword
(
dev
,
PCI_CLASS_REVISION
,
&
dev
->
class
);
dev
->
class
>>=
8
;
dev
->
hdr_type
=
hdr
;
#ifdef CONFIG_PROC_FS
pci_proc_attach_device
(
dev
);
#endif
}
}
s
->
cap
.
cb_bus
->
devices
=
&
c
[
0
].
dev
;
/* Link into PCI device chain */
/* Link into PCI device chain */
bus
->
devices
=
&
c
[
0
].
dev
;
c
[
fn
-
1
].
dev
.
next
=
pci_devices
;
c
[
fn
-
1
].
dev
.
next
=
pci_devices
;
pci_devices
=
&
c
[
0
].
dev
;
pci_devices
=
&
c
[
0
].
dev
;
for
(
i
=
0
;
i
<
fn
;
i
++
)
{
s
->
cb_config
=
c
;
c
[
i
].
dev
.
vendor
=
vend
;
pci_readw
(
bus
,
i
,
PCI_DEVICE_ID
,
&
c
[
i
].
dev
.
device
);
pci_readl
(
bus
,
i
,
PCI_CLASS_REVISION
,
&
c
[
i
].
dev
.
class
);
c
[
i
].
dev
.
class
>>=
8
;
c
[
i
].
dev
.
hdr_type
=
hdr
;
#ifdef CONFIG_PROC_FS
pci_proc_attach_device
(
&
c
[
i
].
dev
);
#endif
}
return
CS_SUCCESS
;
return
CS_SUCCESS
;
}
}
...
@@ -336,6 +341,7 @@ int cb_alloc(socket_info_t *s)
...
@@ -336,6 +341,7 @@ int cb_alloc(socket_info_t *s)
void
cb_free
(
socket_info_t
*
s
)
void
cb_free
(
socket_info_t
*
s
)
{
{
cb_config_t
*
c
=
s
->
cb_config
;
cb_config_t
*
c
=
s
->
cb_config
;
struct
pci_bus
*
bus
=
s
->
cap
.
cb_dev
->
subordinate
;
if
(
c
)
{
if
(
c
)
{
struct
pci_dev
**
p
;
struct
pci_dev
**
p
;
...
@@ -343,7 +349,7 @@ void cb_free(socket_info_t *s)
...
@@ -343,7 +349,7 @@ void cb_free(socket_info_t *s)
p
=
&
pci_devices
;
p
=
&
pci_devices
;
while
(
*
p
)
{
while
(
*
p
)
{
struct
pci_dev
*
dev
=
*
p
;
struct
pci_dev
*
dev
=
*
p
;
if
(
dev
->
bus
!=
s
->
cap
.
cb_
bus
)
{
if
(
dev
->
bus
!=
bus
)
{
p
=
&
dev
->
next
;
p
=
&
dev
->
next
;
continue
;
continue
;
}
}
...
@@ -352,10 +358,10 @@ void cb_free(socket_info_t *s)
...
@@ -352,10 +358,10 @@ void cb_free(socket_info_t *s)
pci_proc_detach_device
(
dev
);
pci_proc_detach_device
(
dev
);
#endif
#endif
}
}
s
->
cap
.
cb_
bus
->
devices
=
NULL
;
bus
->
devices
=
NULL
;
kfree
(
s
->
cb_config
);
kfree
(
s
->
cb_config
);
s
->
cb_config
=
NULL
;
s
->
cb_config
=
NULL
;
printk
(
KERN_INFO
"cs: cb_free(bus %d)
\n
"
,
s
->
cap
.
c
ardbus
);
printk
(
KERN_INFO
"cs: cb_free(bus %d)
\n
"
,
s
->
cap
.
c
b_dev
->
subordinate
->
number
);
}
}
}
}
...
@@ -375,11 +381,11 @@ int cb_config(socket_info_t *s)
...
@@ -375,11 +381,11 @@ int cb_config(socket_info_t *s)
{
{
cb_config_t
*
c
=
s
->
cb_config
;
cb_config_t
*
c
=
s
->
cb_config
;
u_char
fn
=
s
->
functions
;
u_char
fn
=
s
->
functions
;
u_char
i
,
j
,
bus
=
s
->
cap
.
c
ardbus
,
*
name
;
u_char
i
,
j
,
bus
=
s
->
cap
.
c
b_dev
->
subordinate
->
number
,
*
name
;
u_int
sz
,
align
,
m
,
mask
[
3
],
num
[
3
],
base
[
3
];
u_int
sz
,
align
,
m
,
mask
[
3
],
num
[
3
],
base
[
3
];
int
irq
,
try
,
ret
;
int
irq
,
try
,
ret
;
printk
(
KERN_INFO
"cs: cb_config(bus %d)
\n
"
,
s
->
cap
.
c
ardbus
);
printk
(
KERN_INFO
"cs: cb_config(bus %d)
\n
"
,
s
->
cap
.
c
b_dev
->
subordinate
->
number
);
/* Determine IO and memory space needs */
/* Determine IO and memory space needs */
num
[
B_IO
]
=
num
[
B_M1
]
=
num
[
B_M2
]
=
0
;
num
[
B_IO
]
=
num
[
B_M1
]
=
num
[
B_M2
]
=
0
;
...
@@ -524,7 +530,7 @@ void cb_release(socket_info_t *s)
...
@@ -524,7 +530,7 @@ void cb_release(socket_info_t *s)
{
{
cb_config_t
*
c
=
s
->
cb_config
;
cb_config_t
*
c
=
s
->
cb_config
;
DEBUG
(
0
,
"cs: cb_release(bus %d)
\n
"
,
s
->
cap
.
c
ardbus
);
DEBUG
(
0
,
"cs: cb_release(bus %d)
\n
"
,
s
->
cap
.
c
b_dev
->
subordinate
->
number
);
if
(
s
->
win
[
0
].
size
>
0
)
if
(
s
->
win
[
0
].
size
>
0
)
release_mem_region
(
s
->
win
[
0
].
base
,
s
->
win
[
0
].
size
);
release_mem_region
(
s
->
win
[
0
].
base
,
s
->
win
[
0
].
size
);
...
@@ -556,7 +562,7 @@ void cb_release(socket_info_t *s)
...
@@ -556,7 +562,7 @@ void cb_release(socket_info_t *s)
void
cb_enable
(
socket_info_t
*
s
)
void
cb_enable
(
socket_info_t
*
s
)
{
{
u_char
i
,
j
,
bus
=
s
->
cap
.
c
ardbus
;
u_char
i
,
j
,
bus
=
s
->
cap
.
c
b_dev
->
subordinate
->
number
;
cb_config_t
*
c
=
s
->
cb_config
;
cb_config_t
*
c
=
s
->
cb_config
;
DEBUG
(
0
,
"cs: cb_enable(bus %d)
\n
"
,
bus
);
DEBUG
(
0
,
"cs: cb_enable(bus %d)
\n
"
,
bus
);
...
@@ -630,7 +636,7 @@ void cb_disable(socket_info_t *s)
...
@@ -630,7 +636,7 @@ void cb_disable(socket_info_t *s)
u_char
i
;
u_char
i
;
cb_bridge_map
m
=
{
0
,
0
,
0
,
0xffff
};
cb_bridge_map
m
=
{
0
,
0
,
0
,
0xffff
};
DEBUG
(
0
,
"cs: cb_disable(bus %d)
\n
"
,
s
->
cap
.
c
ardbus
);
DEBUG
(
0
,
"cs: cb_disable(bus %d)
\n
"
,
s
->
cap
.
c
b_dev
->
subordinate
->
number
);
/* Turn off bridge windows */
/* Turn off bridge windows */
if
(
s
->
cb_cis_map
.
start
)
if
(
s
->
cb_cis_map
.
start
)
...
...
drivers/pcmcia/cistpl.c
View file @
f3da3d88
...
@@ -367,7 +367,7 @@ int pcmcia_get_first_tuple(client_handle_t handle, tuple_t *tuple)
...
@@ -367,7 +367,7 @@ int pcmcia_get_first_tuple(client_handle_t handle, tuple_t *tuple)
#ifdef CONFIG_CARDBUS
#ifdef CONFIG_CARDBUS
if
(
s
->
state
&
SOCKET_CARDBUS
)
{
if
(
s
->
state
&
SOCKET_CARDBUS
)
{
u_int
ptr
;
u_int
ptr
;
pcibios_read_config_dword
(
s
->
cap
.
c
ardbus
,
0
,
0x28
,
&
ptr
);
pcibios_read_config_dword
(
s
->
cap
.
c
b_dev
->
subordinate
->
number
,
0
,
0x28
,
&
ptr
);
tuple
->
CISOffset
=
ptr
&
~
7
;
tuple
->
CISOffset
=
ptr
&
~
7
;
SPACE
(
tuple
->
Flags
)
=
(
ptr
&
7
);
SPACE
(
tuple
->
Flags
)
=
(
ptr
&
7
);
}
else
}
else
...
...
drivers/pcmcia/cs.c
View file @
f3da3d88
...
@@ -46,6 +46,7 @@
...
@@ -46,6 +46,7 @@
#include <linux/delay.h>
#include <linux/delay.h>
#include <linux/proc_fs.h>
#include <linux/proc_fs.h>
#include <linux/compile.h>
#include <linux/compile.h>
#include <linux/pci.h>
#include <asm/system.h>
#include <asm/system.h>
#include <asm/irq.h>
#include <asm/irq.h>
...
@@ -994,7 +995,7 @@ int pcmcia_get_configuration_info(client_handle_t handle,
...
@@ -994,7 +995,7 @@ int pcmcia_get_configuration_info(client_handle_t handle,
config
->
Function
=
fn
;
config
->
Function
=
fn
;
config
->
Vcc
=
s
->
socket
.
Vcc
;
config
->
Vcc
=
s
->
socket
.
Vcc
;
config
->
Vpp1
=
config
->
Vpp2
=
s
->
socket
.
Vpp
;
config
->
Vpp1
=
config
->
Vpp2
=
s
->
socket
.
Vpp
;
config
->
Option
=
s
->
cap
.
c
ardbus
;
config
->
Option
=
s
->
cap
.
c
b_dev
->
subordinate
->
number
;
if
(
s
->
cb_config
)
{
if
(
s
->
cb_config
)
{
config
->
Attributes
=
CONF_VALID_CLIENT
;
config
->
Attributes
=
CONF_VALID_CLIENT
;
config
->
IntType
=
INT_CARDBUS
;
config
->
IntType
=
INT_CARDBUS
;
...
...
drivers/pcmcia/i82365.c
View file @
f3da3d88
...
@@ -1615,7 +1615,7 @@ static void __init add_cb_bridge(int type, struct pci_dev *dev0)
...
@@ -1615,7 +1615,7 @@ static void __init add_cb_bridge(int type, struct pci_dev *dev0)
break
;
break
;
}
}
request_mem_region
(
s
->
cb_phys
,
0x1000
,
"i82365"
);
request_mem_region
(
s
->
cb_phys
,
0x1000
,
"i82365"
);
s
->
cap
.
cb_
bus
=
dev
->
subordinate
;
s
->
cap
.
cb_
dev
=
dev
;
add_socket
(
0
,
0
,
type
);
add_socket
(
0
,
0
,
type
);
}
}
if
(
ns
==
0
)
return
;
if
(
ns
==
0
)
return
;
...
...
drivers/pcmcia/pci_socket.c
View file @
f3da3d88
...
@@ -30,7 +30,7 @@
...
@@ -30,7 +30,7 @@
static
struct
pci_simple_probe_entry
controller_list
[]
=
{
static
struct
pci_simple_probe_entry
controller_list
[]
=
{
{
PCI_VENDOR_ID_TI
,
PCI_DEVICE_ID_TI_1225
,
0
,
0
,
&
yenta_operations
},
{
PCI_VENDOR_ID_TI
,
PCI_DEVICE_ID_TI_1225
,
0
,
0
,
&
yenta_operations
},
{
0x1180
,
0x0475
,
0
,
0
,
&
yenta
_operations
},
{
0x1180
,
0x0475
,
0
,
0
,
&
ricoh
_operations
},
{
0
,
0
,
0
,
0
,
NULL
}
{
0
,
0
,
0
,
0
,
NULL
}
};
};
...
...
drivers/pcmcia/pci_socket.h
View file @
f3da3d88
...
@@ -36,3 +36,5 @@ struct pci_socket_ops {
...
@@ -36,3 +36,5 @@ struct pci_socket_ops {
};
};
extern
struct
pci_socket_ops
yenta_operations
;
extern
struct
pci_socket_ops
yenta_operations
;
extern
struct
pci_socket_ops
ricoh_operations
;
drivers/pcmcia/yenta.c
View file @
f3da3d88
This diff is collapsed.
Click to expand it.
drivers/pcmcia/yenta.h
View file @
f3da3d88
...
@@ -4,35 +4,6 @@
...
@@ -4,35 +4,6 @@
#include <asm/io.h>
#include <asm/io.h>
#include "pci_socket.h"
#include "pci_socket.h"
/*
* Generate easy-to-use ways of reading a cardbus sockets
* regular memory space ("cb_xxx"), configuration space
* ("config_xxx") and compatibility space ("exca_xxxx")
*/
#define cb_readb(sock,reg) readb((sock)->base + (reg))
#define cb_readw(sock,reg) readw((sock)->base + (reg))
#define cb_readl(sock,reg) readl((sock)->base + (reg))
#define cb_writeb(sock,reg,val) writeb((val), (sock)->base + (reg))
#define cb_writew(sock,reg,val) writew((val), (sock)->base + (reg))
#define cb_writel(sock,reg,val) writel((val), (sock)->base + (reg))
#define config_readb(sock,offset) ({ __u8 __val; pci_read_config_byte((sock)->dev, (offset), &__val); __val; })
#define config_readw(sock,offset) ({ __u16 __val; pci_read_config_word((sock)->dev, (offset), &__val); __val; })
#define config_readl(sock,offset) ({ __u32 __val; pci_read_config_dword((sock)->dev, (offset), &__val); __val; })
#define config_writeb(sock,offset,val) pci_write_config_byte((sock)->dev, (offset), (val))
#define config_writew(sock,offset,val) pci_write_config_word((sock)->dev, (offset), (val))
#define config_writel(sock,offset,val) pci_write_config_dword((sock)->dev, (offset), (val))
#define exca_readb(sock,reg) cb_readb((sock),(reg)+0x0800)
#define exca_readw(sock,reg) cb_readw((sock),(reg)+0x0800)
#define exca_readl(sock,reg) cb_readl((sock),(reg)+0x0800)
#define exca_writeb(sock,reg,val) cb_writeb((sock),(reg)+0x0800,(val))
#define exca_writew(sock,reg,val) cb_writew((sock),(reg)+0x0800,(val))
#define exca_writel(sock,reg,val) cb_writel((sock),(reg)+0x0800,(val))
#define CB_SOCKET_EVENT 0x00
#define CB_SOCKET_EVENT 0x00
#define CB_CSTSEVENT 0x00000001
/* Card status event */
#define CB_CSTSEVENT 0x00000001
/* Card status event */
#define CB_CD1EVENT 0x00000002
/* Card detect 1 change event */
#define CB_CD1EVENT 0x00000002
/* Card detect 1 change event */
...
@@ -81,17 +52,20 @@
...
@@ -81,17 +52,20 @@
#define CB_CVSTEST 0x00004000
/* Card VS test */
#define CB_CVSTEST 0x00004000
/* Card VS test */
#define CB_SOCKET_CONTROL 0x10
#define CB_SOCKET_CONTROL 0x10
#define CB_VPPCTRL 0
/* Shift for Vpp */
#define CB_SC_VPP_MASK 0x00000007
#define CB_VCCCTRL 4
/* Shift for Vcc */
#define CB_SC_VPP_OFF 0x00000000
#define CB_STOPCLK 0x00000080
/* CLKRUN can slow CB clock when idle */
#define CB_SC_VPP_12V 0x00000001
#define CB_SC_VPP_5V 0x00000002
#define CB_PWRBITS 0x7
#define CB_SC_VPP_3V 0x00000003
#define CB_PWROFF 0x0
#define CB_SC_VPP_XV 0x00000004
#define CB_PWR12V 0x1
/* Only valid for Vpp */
#define CB_SC_VPP_YV 0x00000005
#define CB_PWR5V 0x2
#define CB_SC_VCC_MASK 0x00000070
#define CB_PWR3V 0x3
#define CB_SC_VCC_OFF 0x00000000
#define CB_PWRXV 0x4
#define CB_SC_VCC_5V 0x00000020
#define CB_PWRYV 0x5
#define CB_SC_VCC_3V 0x00000030
#define CB_SC_VCC_XV 0x00000040
#define CB_SC_VCC_YV 0x00000050
#define CB_SC_CCLK_STOP 0x00000080
#define CB_SOCKET_POWER 0x20
#define CB_SOCKET_POWER 0x20
#define CB_SKTACCES 0x02000000
/* A PC card access has occurred (clear on read) */
#define CB_SKTACCES 0x02000000
/* A PC card access has occurred (clear on read) */
...
@@ -115,6 +89,7 @@
...
@@ -115,6 +89,7 @@
#define CB_BRIDGE_PREFETCH0 0x00000100
#define CB_BRIDGE_PREFETCH0 0x00000100
#define CB_BRIDGE_PREFETCH1 0x00000200
#define CB_BRIDGE_PREFETCH1 0x00000200
#define CB_BRIDGE_POSTEN 0x00000400
#define CB_BRIDGE_POSTEN 0x00000400
#define CB_LEGACY_MODE_BASE 0x44
/*
/*
* ExCA area extensions in Yenta
* ExCA area extensions in Yenta
...
...
drivers/usb/Config.in
View file @
f3da3d88
...
@@ -10,7 +10,7 @@ comment 'USB Controllers'
...
@@ -10,7 +10,7 @@ comment 'USB Controllers'
dep_tristate ' UHCI (Intel PIIX4, VIA, and others) support' CONFIG_USB_UHCI \
dep_tristate ' UHCI (Intel PIIX4, VIA, and others) support' CONFIG_USB_UHCI \
$CONFIG_USB
$CONFIG_USB
dep_tristate ' OHCI-HCD (Compaq, iMacs, OPTi, SiS, and others) support' \
dep_tristate ' OHCI-HCD (Compaq, iMacs, OPTi, SiS,
ALi,
and others) support' \
CONFIG_USB_OHCI_HCD $CONFIG_USB
CONFIG_USB_OHCI_HCD $CONFIG_USB
comment 'Miscellaneous USB options'
comment 'Miscellaneous USB options'
...
...
drivers/usb/procusb
deleted
100644 → 0
View file @
eab2ce74
#!/usr/bin/perl
# Reads /proc/bus/usb/devices and selectively lists and/or
# interprets it.
$DEVFILENAME
=
"
/proc/bus/usb/devices
";
$PROGNAME
=
$0
;
$TAGS
=
$ARGV
[
0
];
# save user TAGS
if
(
length
(
$TAGS
)
==
0
)
{
print
"
usage:
$PROGNAME
tags
\n
";
print
"
where 'tags' can be any number of 'TDPCIE' or 'A(LL)'
\n
";
exit
1
;
}
$ALL
=
(
$TAGS
=~
/all/i
)
||
(
$TAGS
=~
/a/i
);
# TBD: Check that $TAGS is valid.
if
(
!
$ALL
)
{
}
if
(
!
open
(
DEVNUM
,
"
<
$DEVFILENAME
"))
{
print
"
$PROGNAME
: cannot open '
$DEVFILENAME
'
\n
";
exit
1
;
}
while
(
$line
=
<
DEVNUM
>
)
# read a text line from DEVNUM
{
if
((
$ALL
)
||
(
$line
=~
/^[$TAGS]:/i
))
# any of TAGS at beg. of line?
{
print
"
$line
";
# still has newline char on it
# TBD: add more/paging functionality.
}
}
# end while DEVNUM
close
(
DEVNUM
);
# END.
fs/namei.c
View file @
f3da3d88
...
@@ -17,6 +17,7 @@
...
@@ -17,6 +17,7 @@
#include <linux/smp_lock.h>
#include <linux/smp_lock.h>
#include <linux/quotaops.h>
#include <linux/quotaops.h>
#include <linux/pagemap.h>
#include <linux/pagemap.h>
#include <linux/dcache.h>
#include <asm/uaccess.h>
#include <asm/uaccess.h>
#include <asm/unaligned.h>
#include <asm/unaligned.h>
...
@@ -550,83 +551,6 @@ static inline int may_create(struct inode *dir, struct dentry *child) {
...
@@ -550,83 +551,6 @@ static inline int may_create(struct inode *dir, struct dentry *child) {
return
permission
(
dir
,
MAY_WRITE
|
MAY_EXEC
);
return
permission
(
dir
,
MAY_WRITE
|
MAY_EXEC
);
}
}
static
inline
struct
dentry
*
get_parent
(
struct
dentry
*
dentry
)
{
return
dget
(
dentry
->
d_parent
);
}
static
inline
void
unlock_dir
(
struct
dentry
*
dir
)
{
up
(
&
dir
->
d_inode
->
i_sem
);
dput
(
dir
);
}
/*
* We need to do a check-parent every time
* after we have locked the parent - to verify
* that the parent is still our parent and
* that we are still hashed onto it..
*
* This is requied in case two processes race
* on removing (or moving) the same entry: the
* parent lock will serialize them, but the
* other process will be too late..
*/
#define check_parent(dir, dentry) \
((dir) == (dentry)->d_parent && !list_empty(&dentry->d_hash))
/*
* Locking the parent is needed to:
* - serialize directory operations
* - make sure the parent doesn't change from
* under us in the middle of an operation.
*
* NOTE! Right now we'd rather use a "struct inode"
* for this, but as I expect things to move toward
* using dentries instead for most things it is
* probably better to start with the conceptually
* better interface of relying on a path of dentries.
*/
static
inline
struct
dentry
*
lock_parent
(
struct
dentry
*
dentry
)
{
struct
dentry
*
dir
=
dget
(
dentry
->
d_parent
);
down
(
&
dir
->
d_inode
->
i_sem
);
return
dir
;
}
/*
* Whee.. Deadlock country. Happily there are only two VFS
* operations that do this..
*/
static
inline
void
double_lock
(
struct
dentry
*
d1
,
struct
dentry
*
d2
)
{
struct
semaphore
*
s1
=
&
d1
->
d_inode
->
i_sem
;
struct
semaphore
*
s2
=
&
d2
->
d_inode
->
i_sem
;
if
(
s1
!=
s2
)
{
if
((
unsigned
long
)
s1
<
(
unsigned
long
)
s2
)
{
struct
semaphore
*
tmp
=
s2
;
s2
=
s1
;
s1
=
tmp
;
}
down
(
s1
);
}
down
(
s2
);
}
static
inline
void
double_unlock
(
struct
dentry
*
d1
,
struct
dentry
*
d2
)
{
struct
semaphore
*
s1
=
&
d1
->
d_inode
->
i_sem
;
struct
semaphore
*
s2
=
&
d2
->
d_inode
->
i_sem
;
up
(
s1
);
if
(
s1
!=
s2
)
up
(
s2
);
dput
(
d1
);
dput
(
d2
);
}
/*
/*
* Special case: O_CREAT|O_EXCL implies O_NOFOLLOW for security
* Special case: O_CREAT|O_EXCL implies O_NOFOLLOW for security
* reasons.
* reasons.
...
...
include/linux/arcdevice.h
View file @
f3da3d88
...
@@ -22,7 +22,7 @@
...
@@ -22,7 +22,7 @@
#ifdef __KERNEL__
#ifdef __KERNEL__
#ifndef bool
#ifndef bool
#
define bool int
#define bool int
#endif
#endif
...
@@ -176,24 +176,22 @@ extern int arcnet_debug;
...
@@ -176,24 +176,22 @@ extern int arcnet_debug;
/* information needed to define an encapsulation driver */
/* information needed to define an encapsulation driver */
struct
ArcProto
struct
ArcProto
{
{
char
suffix
;
/* a for RFC1201, e for ether-encap, etc. */
char
suffix
;
/* a for RFC1201, e for ether-encap, etc. */
int
mtu
;
/* largest possible packet */
int
mtu
;
/* largest possible packet */
void
(
*
rx
)(
struct
net_device
*
dev
,
int
bufnum
,
void
(
*
rx
)
(
struct
net_device
*
dev
,
int
bufnum
,
struct
archdr
*
pkthdr
,
int
length
);
struct
archdr
*
pkthdr
,
int
length
);
int
(
*
build_header
)(
struct
sk_buff
*
skb
,
unsigned
short
ethproto
,
int
(
*
build_header
)
(
struct
sk_buff
*
skb
,
unsigned
short
ethproto
,
uint8_t
daddr
);
uint8_t
daddr
);
/* these functions return '1' if the skb can now be freed */
/* these functions return '1' if the skb can now be freed */
int
(
*
prepare_tx
)(
struct
net_device
*
dev
,
struct
archdr
*
pkt
,
int
length
,
int
(
*
prepare_tx
)
(
struct
net_device
*
dev
,
struct
archdr
*
pkt
,
int
length
,
int
bufnum
);
int
bufnum
);
int
(
*
continue_tx
)(
struct
net_device
*
dev
,
int
bufnum
);
int
(
*
continue_tx
)
(
struct
net_device
*
dev
,
int
bufnum
);
};
};
extern
struct
ArcProto
*
arc_proto_map
[
256
],
extern
struct
ArcProto
*
arc_proto_map
[
256
],
*
arc_proto_default
,
*
arc_bcast_proto
;
*
arc_proto_default
,
*
arc_bcast_proto
;
extern
struct
ArcProto
arc_proto_null
;
extern
struct
ArcProto
arc_proto_null
;
...
@@ -201,8 +199,7 @@ extern struct ArcProto arc_proto_null;
...
@@ -201,8 +199,7 @@ extern struct ArcProto arc_proto_null;
* "Incoming" is information needed for each address that could be sending
* "Incoming" is information needed for each address that could be sending
* to us. Mostly for partially-received split packets.
* to us. Mostly for partially-received split packets.
*/
*/
struct
Incoming
struct
Incoming
{
{
struct
sk_buff
*
skb
;
/* packet data buffer */
struct
sk_buff
*
skb
;
/* packet data buffer */
uint16_t
sequence
;
/* sequence number of assembly */
uint16_t
sequence
;
/* sequence number of assembly */
uint8_t
lastpacket
,
/* number of last packet (from 1) */
uint8_t
lastpacket
,
/* number of last packet (from 1) */
...
@@ -211,8 +208,7 @@ struct Incoming
...
@@ -211,8 +208,7 @@ struct Incoming
/* only needed for RFC1201 */
/* only needed for RFC1201 */
struct
Outgoing
struct
Outgoing
{
{
struct
ArcProto
*
proto
;
/* protocol driver that owns this:
struct
ArcProto
*
proto
;
/* protocol driver that owns this:
* if NULL, no packet is pending.
* if NULL, no packet is pending.
*/
*/
...
@@ -225,8 +221,7 @@ struct Outgoing
...
@@ -225,8 +221,7 @@ struct Outgoing
};
};
struct
arcnet_local
struct
arcnet_local
{
{
struct
net_device_stats
stats
;
struct
net_device_stats
stats
;
uint8_t
config
,
/* current value of CONFIG register */
uint8_t
config
,
/* current value of CONFIG register */
...
@@ -283,16 +278,16 @@ struct arcnet_local
...
@@ -283,16 +278,16 @@ struct arcnet_local
/* hardware-specific functions */
/* hardware-specific functions */
struct
{
struct
{
void
(
*
command
)
(
struct
net_device
*
dev
,
int
cmd
);
void
(
*
command
)
(
struct
net_device
*
dev
,
int
cmd
);
int
(
*
status
)
(
struct
net_device
*
dev
);
int
(
*
status
)
(
struct
net_device
*
dev
);
void
(
*
intmask
)
(
struct
net_device
*
dev
,
int
mask
);
void
(
*
intmask
)
(
struct
net_device
*
dev
,
int
mask
);
bool
(
*
reset
)
(
struct
net_device
*
dev
,
bool
really_reset
);
bool
(
*
reset
)
(
struct
net_device
*
dev
,
bool
really_reset
);
void
(
*
open_close
)(
struct
net_device
*
dev
,
bool
open
);
void
(
*
open_close
)
(
struct
net_device
*
dev
,
bool
open
);
void
(
*
open_close_ll
)(
struct
net_device
*
dev
,
bool
open
);
void
(
*
open_close_ll
)
(
struct
net_device
*
dev
,
bool
open
);
void
(
*
copy_to_card
)(
struct
net_device
*
dev
,
int
bufnum
,
int
offset
,
void
(
*
copy_to_card
)
(
struct
net_device
*
dev
,
int
bufnum
,
int
offset
,
void
*
buf
,
int
count
);
void
*
buf
,
int
count
);
void
(
*
copy_from_card
)(
struct
net_device
*
dev
,
int
bufnum
,
int
offset
,
void
(
*
copy_from_card
)
(
struct
net_device
*
dev
,
int
bufnum
,
int
offset
,
void
*
buf
,
int
count
);
void
*
buf
,
int
count
);
}
hw
;
}
hw
;
...
@@ -311,13 +306,13 @@ struct arcnet_local
...
@@ -311,13 +306,13 @@ struct arcnet_local
#if ARCNET_DEBUG_MAX & D_SKB
#if ARCNET_DEBUG_MAX & D_SKB
void
arcnet_dump_skb
(
struct
net_device
*
dev
,
struct
sk_buff
*
skb
,
char
*
desc
);
void
arcnet_dump_skb
(
struct
net_device
*
dev
,
struct
sk_buff
*
skb
,
char
*
desc
);
#else
#else
#
define arcnet_dump_skb(dev,skb,desc) ;
#define arcnet_dump_skb(dev,skb,desc) ;
#endif
#endif
#if (ARCNET_DEBUG_MAX & D_RX) || (ARCNET_DEBUG_MAX & D_TX)
#if (ARCNET_DEBUG_MAX & D_RX) || (ARCNET_DEBUG_MAX & D_TX)
void
arcnet_dump_packet
(
struct
net_device
*
dev
,
int
bufnum
,
char
*
desc
);
void
arcnet_dump_packet
(
struct
net_device
*
dev
,
int
bufnum
,
char
*
desc
);
#else
#else
#
define arcnet_dump_packet(dev, bufnum, desc) ;
#define arcnet_dump_packet(dev, bufnum, desc) ;
#endif
#endif
void
arcnet_unregister_proto
(
struct
ArcProto
*
proto
);
void
arcnet_unregister_proto
(
struct
ArcProto
*
proto
);
...
...
include/linux/fs.h
View file @
f3da3d88
...
@@ -996,6 +996,91 @@ extern int generic_buffer_fdatasync(struct inode *inode, unsigned long start_idx
...
@@ -996,6 +996,91 @@ extern int generic_buffer_fdatasync(struct inode *inode, unsigned long start_idx
extern
int
inode_change_ok
(
struct
inode
*
,
struct
iattr
*
);
extern
int
inode_change_ok
(
struct
inode
*
,
struct
iattr
*
);
extern
void
inode_setattr
(
struct
inode
*
,
struct
iattr
*
);
extern
void
inode_setattr
(
struct
inode
*
,
struct
iattr
*
);
/*
* Common dentry functions for inclusion in the VFS
* or in other stackable file systems. Some of these
* functions were in linux/fs/ C (VFS) files.
*
*/
/*
* We need to do a check-parent every time
* after we have locked the parent - to verify
* that the parent is still our parent and
* that we are still hashed onto it..
*
* This is required in case two processes race
* on removing (or moving) the same entry: the
* parent lock will serialize them, but the
* other process will be too late..
*/
#define check_parent(dir, dentry) \
((dir) == (dentry)->d_parent && !list_empty(&dentry->d_hash))
/*
* Locking the parent is needed to:
* - serialize directory operations
* - make sure the parent doesn't change from
* under us in the middle of an operation.
*
* NOTE! Right now we'd rather use a "struct inode"
* for this, but as I expect things to move toward
* using dentries instead for most things it is
* probably better to start with the conceptually
* better interface of relying on a path of dentries.
*/
static
inline
struct
dentry
*
lock_parent
(
struct
dentry
*
dentry
)
{
struct
dentry
*
dir
=
dget
(
dentry
->
d_parent
);
down
(
&
dir
->
d_inode
->
i_sem
);
return
dir
;
}
static
inline
struct
dentry
*
get_parent
(
struct
dentry
*
dentry
)
{
return
dget
(
dentry
->
d_parent
);
}
static
inline
void
unlock_dir
(
struct
dentry
*
dir
)
{
up
(
&
dir
->
d_inode
->
i_sem
);
dput
(
dir
);
}
/*
* Whee.. Deadlock country. Happily there are only two VFS
* operations that does this..
*/
static
inline
void
double_lock
(
struct
dentry
*
d1
,
struct
dentry
*
d2
)
{
struct
semaphore
*
s1
=
&
d1
->
d_inode
->
i_sem
;
struct
semaphore
*
s2
=
&
d2
->
d_inode
->
i_sem
;
if
(
s1
!=
s2
)
{
if
((
unsigned
long
)
s1
<
(
unsigned
long
)
s2
)
{
struct
semaphore
*
tmp
=
s2
;
s2
=
s1
;
s1
=
tmp
;
}
down
(
s1
);
}
down
(
s2
);
}
static
inline
void
double_unlock
(
struct
dentry
*
d1
,
struct
dentry
*
d2
)
{
struct
semaphore
*
s1
=
&
d1
->
d_inode
->
i_sem
;
struct
semaphore
*
s2
=
&
d2
->
d_inode
->
i_sem
;
up
(
s1
);
if
(
s1
!=
s2
)
up
(
s2
);
dput
(
d1
);
dput
(
d2
);
}
#endif
/* __KERNEL__ */
#endif
/* __KERNEL__ */
#endif
/* _LINUX_FS_H */
#endif
/* _LINUX_FS_H */
include/linux/mm.h
View file @
f3da3d88
...
@@ -438,6 +438,15 @@ extern unsigned long page_unuse(struct page *);
...
@@ -438,6 +438,15 @@ extern unsigned long page_unuse(struct page *);
extern
int
shrink_mmap
(
int
,
int
);
extern
int
shrink_mmap
(
int
,
int
);
extern
void
truncate_inode_pages
(
struct
inode
*
,
loff_t
);
extern
void
truncate_inode_pages
(
struct
inode
*
,
loff_t
);
/* generic vm_area_ops exported for stackable file systems */
extern
int
filemap_swapout
(
struct
page
*
page
,
struct
file
*
file
);
extern
pte_t
filemap_swapin
(
struct
vm_area_struct
*
vma
,
unsigned
long
offset
,
unsigned
long
entry
);
extern
int
filemap_sync
(
struct
vm_area_struct
*
vma
,
unsigned
long
address
,
size_t
size
,
unsigned
int
flags
);
extern
struct
page
*
filemap_nopage
(
struct
vm_area_struct
*
area
,
unsigned
long
address
,
int
no_share
);
/*
/*
* GFP bitmasks..
* GFP bitmasks..
*/
*/
...
...
include/linux/tty.h
View file @
f3da3d88
...
@@ -117,6 +117,9 @@ extern struct screen_info screen_info;
...
@@ -117,6 +117,9 @@ extern struct screen_info screen_info;
#define VIDEO_TYPE_PMAC 0x60
/* PowerMacintosh frame buffer. */
#define VIDEO_TYPE_PMAC 0x60
/* PowerMacintosh frame buffer. */
#define VIDEO_TYPE_SGI 0x70
/* Various SGI graphics hardware */
#define VIDEO_TYPE_MIPS_G364 0x71
/* MIPS Magnum 4000 G364 video */
/*
/*
* This character is the same as _POSIX_VDISABLE: it cannot be used as
* This character is the same as _POSIX_VDISABLE: it cannot be used as
* a c_cc[] character, but indicates that a particular special character
* a c_cc[] character, but indicates that a particular special character
...
...
include/pcmcia/ss.h
View file @
f3da3d88
...
@@ -52,8 +52,7 @@ typedef struct socket_cap_t {
...
@@ -52,8 +52,7 @@ typedef struct socket_cap_t {
u_int
irq_mask
;
u_int
irq_mask
;
u_int
map_size
;
u_int
map_size
;
u_char
pci_irq
;
u_char
pci_irq
;
u_char
cardbus
;
struct
pci_dev
*
cb_dev
;
struct
pci_bus
*
cb_bus
;
struct
bus_operations
*
bus
;
struct
bus_operations
*
bus
;
}
socket_cap_t
;
}
socket_cap_t
;
...
...
kernel/ksyms.c
View file @
f3da3d88
...
@@ -225,6 +225,13 @@ EXPORT_SYMBOL(page_readlink);
...
@@ -225,6 +225,13 @@ EXPORT_SYMBOL(page_readlink);
EXPORT_SYMBOL
(
page_follow_link
);
EXPORT_SYMBOL
(
page_follow_link
);
EXPORT_SYMBOL
(
block_symlink
);
EXPORT_SYMBOL
(
block_symlink
);
/* for stackable file systems (lofs, wrapfs, etc.) */
EXPORT_SYMBOL
(
add_to_page_cache
);
EXPORT_SYMBOL
(
filemap_nopage
);
EXPORT_SYMBOL
(
filemap_swapout
);
EXPORT_SYMBOL
(
filemap_sync
);
EXPORT_SYMBOL
(
remove_inode_page
);
#if !defined(CONFIG_NFSD) && defined(CONFIG_NFSD_MODULE)
#if !defined(CONFIG_NFSD) && defined(CONFIG_NFSD_MODULE)
EXPORT_SYMBOL
(
do_nfsservctl
);
EXPORT_SYMBOL
(
do_nfsservctl
);
#endif
#endif
...
@@ -450,4 +457,5 @@ EXPORT_SYMBOL(get_fast_time);
...
@@ -450,4 +457,5 @@ EXPORT_SYMBOL(get_fast_time);
/* library functions */
/* library functions */
EXPORT_SYMBOL
(
strnicmp
);
EXPORT_SYMBOL
(
strnicmp
);
/* init task, for moving kthread roots - ought to export a function ?? */
EXPORT_SYMBOL
(
init_task_union
);
EXPORT_SYMBOL
(
init_task_union
);
mm/filemap.c
View file @
f3da3d88
...
@@ -1298,7 +1298,7 @@ asmlinkage ssize_t sys_sendfile(int out_fd, int in_fd, off_t *offset, size_t cou
...
@@ -1298,7 +1298,7 @@ asmlinkage ssize_t sys_sendfile(int out_fd, int in_fd, off_t *offset, size_t cou
* it in the page cache, and handles the special cases reasonably without
* it in the page cache, and handles the special cases reasonably without
* having a lot of duplicated code.
* having a lot of duplicated code.
*/
*/
st
atic
st
ruct
page
*
filemap_nopage
(
struct
vm_area_struct
*
area
,
struct
page
*
filemap_nopage
(
struct
vm_area_struct
*
area
,
unsigned
long
address
,
int
no_share
)
unsigned
long
address
,
int
no_share
)
{
{
int
error
;
int
error
;
...
@@ -1595,7 +1595,7 @@ static inline int filemap_sync_pmd_range(pgd_t * pgd,
...
@@ -1595,7 +1595,7 @@ static inline int filemap_sync_pmd_range(pgd_t * pgd,
return
error
;
return
error
;
}
}
static
int
filemap_sync
(
struct
vm_area_struct
*
vma
,
unsigned
long
address
,
int
filemap_sync
(
struct
vm_area_struct
*
vma
,
unsigned
long
address
,
size_t
size
,
unsigned
int
flags
)
size_t
size
,
unsigned
int
flags
)
{
{
pgd_t
*
dir
;
pgd_t
*
dir
;
...
...
net/bridge/br.c
View file @
f3da3d88
...
@@ -87,7 +87,7 @@
...
@@ -87,7 +87,7 @@
#include <linux/rtnetlink.h>
#include <linux/rtnetlink.h>
#include <net/br.h>
#include <net/br.h>
#include <linux/proc_fs.h>
#include <linux/proc_fs.h>
#include <linux/
br
.h>
#include <linux/
delay
.h>
#ifndef min
#ifndef min
#define min(a, b) (((a) <= (b)) ? (a) : (b))
#define min(a, b) (((a) <= (b)) ? (a) : (b))
...
...
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