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
7e85ed71
Commit
7e85ed71
authored
May 09, 2003
by
Chas Williams
Committed by
David S. Miller
May 09, 2003
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[ATM]: HE and IPHASE driver fixes.
parent
ad6d8606
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
30 additions
and
16 deletions
+30
-16
drivers/atm/he.c
drivers/atm/he.c
+26
-12
drivers/atm/iphase.c
drivers/atm/iphase.c
+4
-4
No files found.
drivers/atm/he.c
View file @
7e85ed71
...
...
@@ -362,43 +362,56 @@ he_find_vcc(struct he_dev *he_dev, unsigned cid)
static
int
__devinit
he_init_one
(
struct
pci_dev
*
pci_dev
,
const
struct
pci_device_id
*
pci_ent
)
{
struct
atm_dev
*
atm_dev
;
struct
he_dev
*
he_dev
;
struct
atm_dev
*
atm_dev
=
NULL
;
struct
he_dev
*
he_dev
=
NULL
;
int
err
=
0
;
printk
(
KERN_INFO
"he: %s
\n
"
,
version
);
if
(
pci_enable_device
(
pci_dev
))
return
-
EIO
;
if
(
pci_set_dma_mask
(
pci_dev
,
HE_DMA_MASK
)
!=
0
)
{
if
(
pci_set_dma_mask
(
pci_dev
,
HE_DMA_MASK
)
!=
0
)
{
printk
(
KERN_WARNING
"he: no suitable dma available
\n
"
);
return
-
EIO
;
err
=
-
EIO
;
goto
init_one_failure
;
}
atm_dev
=
atm_dev_register
(
DEV_LABEL
,
&
he_ops
,
-
1
,
0
);
if
(
!
atm_dev
)
return
-
ENODEV
;
if
(
!
atm_dev
)
{
err
=
-
ENODEV
;
goto
init_one_failure
;
}
pci_set_drvdata
(
pci_dev
,
atm_dev
);
he_dev
=
(
struct
he_dev
*
)
kmalloc
(
sizeof
(
struct
he_dev
),
GFP_KERNEL
);
if
(
!
he_dev
)
return
-
ENOMEM
;
if
(
!
he_dev
)
{
err
=
-
ENOMEM
;
goto
init_one_failure
;
}
memset
(
he_dev
,
0
,
sizeof
(
struct
he_dev
));
he_dev
->
pci_dev
=
pci_dev
;
he_dev
->
atm_dev
=
atm_dev
;
he_dev
->
atm_dev
->
dev_data
=
he_dev
;
HE_DEV
(
atm_dev
)
=
he_dev
;
he_dev
->
number
=
atm_dev
->
number
;
/* was devs */
he_dev
->
number
=
atm_dev
->
number
;
if
(
he_start
(
atm_dev
))
{
atm_dev_deregister
(
atm_dev
);
he_stop
(
he_dev
);
kfree
(
he_dev
)
;
return
-
ENODEV
;
err
=
-
ENODEV
;
goto
init_one_failure
;
}
he_dev
->
next
=
NULL
;
if
(
he_devs
)
he_dev
->
next
=
he_devs
;
he_devs
=
he_dev
;
return
0
;
init_one_failure:
if
(
atm_dev
)
atm_dev_deregister
(
atm_dev
);
if
(
he_dev
)
kfree
(
he_dev
);
pci_disable_device
(
pci_dev
);
return
err
;
}
static
void
__devexit
...
...
@@ -417,6 +430,7 @@ he_remove_one (struct pci_dev *pci_dev)
kfree
(
he_dev
);
pci_set_drvdata
(
pci_dev
,
NULL
);
pci_disable_device
(
pci_dev
);
}
...
...
drivers/atm/iphase.c
View file @
7e85ed71
...
...
@@ -2777,7 +2777,7 @@ static int ia_ioctl(struct atm_dev *dev, unsigned int cmd, void *arg)
if
(
!
capable
(
CAP_NET_ADMIN
))
return
-
EPERM
;
tmps
=
(
u16
*
)
ia_cmds
.
buf
;
for
(
i
=
0
;
i
<
0x80
;
i
+=
2
,
tmps
++
)
if
(
put_user
(
*
(
u16
*
)(
iadev
->
seg_reg
+
i
),
tmps
))
return
-
EFAULT
;
if
(
put_user
(
(
u16
)(
readl
(
iadev
->
seg_reg
+
i
)
&
0xffff
),
tmps
))
return
-
EFAULT
;
ia_cmds
.
status
=
0
;
ia_cmds
.
len
=
0x80
;
break
;
...
...
@@ -2785,7 +2785,7 @@ static int ia_ioctl(struct atm_dev *dev, unsigned int cmd, void *arg)
if
(
!
capable
(
CAP_NET_ADMIN
))
return
-
EPERM
;
tmps
=
(
u16
*
)
ia_cmds
.
buf
;
for
(
i
=
0
;
i
<
0x80
;
i
+=
2
,
tmps
++
)
if
(
put_user
(
*
(
u16
*
)(
iadev
->
reass_reg
+
i
),
tmps
))
return
-
EFAULT
;
if
(
put_user
(
(
u16
)(
readl
(
iadev
->
reass_reg
+
i
)
&
0xffff
),
tmps
))
return
-
EFAULT
;
ia_cmds
.
status
=
0
;
ia_cmds
.
len
=
0x80
;
break
;
...
...
@@ -2802,10 +2802,10 @@ static int ia_ioctl(struct atm_dev *dev, unsigned int cmd, void *arg)
rfL
=
&
regs_local
->
rfredn
;
/* Copy real rfred registers into the local copy */
for
(
i
=
0
;
i
<
(
sizeof
(
rfredn_t
))
/
4
;
i
++
)
((
u_int
*
)
rfL
)[
i
]
=
((
u_int
*
)
iadev
->
reass_reg
)[
i
]
&
0xffff
;
((
u_int
*
)
rfL
)[
i
]
=
readl
(
iadev
->
reass_reg
+
i
)
&
0xffff
;
/* Copy real ffred registers into the local copy */
for
(
i
=
0
;
i
<
(
sizeof
(
ffredn_t
))
/
4
;
i
++
)
((
u_int
*
)
ffL
)[
i
]
=
((
u_int
*
)
iadev
->
seg_reg
)[
i
]
&
0xffff
;
((
u_int
*
)
ffL
)[
i
]
=
readl
(
iadev
->
seg_reg
+
i
)
&
0xffff
;
if
(
copy_to_user
(
ia_cmds
.
buf
,
regs_local
,
sizeof
(
ia_regs_t
)))
{
kfree
(
regs_local
);
...
...
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