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
4175a2c1
Commit
4175a2c1
authored
Jun 17, 2004
by
Linus Torvalds
Browse files
Options
Browse Files
Download
Plain Diff
Merge
parents
839cc0e6
dbba62f3
Changes
9
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
95 additions
and
143 deletions
+95
-143
drivers/message/fusion/lsi/mpi_type.h
drivers/message/fusion/lsi/mpi_type.h
+6
-11
drivers/message/fusion/mptctl.c
drivers/message/fusion/mptctl.c
+66
-75
drivers/message/fusion/mptctl.h
drivers/message/fusion/mptctl.h
+5
-5
drivers/scsi/fd_mcs.c
drivers/scsi/fd_mcs.c
+7
-14
drivers/scsi/fdomain.c
drivers/scsi/fdomain.c
+7
-16
drivers/scsi/pcmcia/nsp_cs.c
drivers/scsi/pcmcia/nsp_cs.c
+4
-4
drivers/scsi/scsi_ioctl.c
drivers/scsi/scsi_ioctl.c
+0
-16
drivers/scsi/scsi_syms.c
drivers/scsi/scsi_syms.c
+0
-1
include/scsi/scsi_ioctl.h
include/scsi/scsi_ioctl.h
+0
-1
No files found.
drivers/message/fusion/lsi/mpi_type.h
View file @
4175a2c1
...
@@ -47,18 +47,13 @@ typedef signed short S16;
...
@@ -47,18 +47,13 @@ typedef signed short S16;
typedef
unsigned
short
U16
;
typedef
unsigned
short
U16
;
#if defined(unix) || defined(__arm) || defined(ALPHA)
typedef
int32_t
S32
;
typedef
u_int32_t
U32
;
typedef
signed
int
S32
;
typedef
unsigned
int
U32
;
#else
typedef
signed
long
S32
;
typedef
unsigned
long
U32
;
#endif
/*
* The only way crap below could work on big-endian boxen would be if it
* wasn't used at all.
*/
typedef
struct
_S64
typedef
struct
_S64
{
{
...
...
drivers/message/fusion/mptctl.c
View file @
4175a2c1
...
@@ -141,8 +141,8 @@ static int mptctl_hp_targetinfo(unsigned long arg);
...
@@ -141,8 +141,8 @@ static int mptctl_hp_targetinfo(unsigned long arg);
/*
/*
* Private function calls.
* Private function calls.
*/
*/
static
int
mptctl_do_mpt_command
(
struct
mpt_ioctl_command
karg
,
char
*
mfPtr
,
int
local
);
static
int
mptctl_do_mpt_command
(
struct
mpt_ioctl_command
karg
,
void
__user
*
mfPtr
);
static
int
mptctl_do_fw_download
(
int
ioc
,
char
*
ufwbuf
,
size_t
fwlen
);
static
int
mptctl_do_fw_download
(
int
ioc
,
char
__user
*
ufwbuf
,
size_t
fwlen
);
static
MptSge_t
*
kbuf_alloc_2_sgl
(
int
bytes
,
u32
dir
,
int
sge_offset
,
int
*
frags
,
static
MptSge_t
*
kbuf_alloc_2_sgl
(
int
bytes
,
u32
dir
,
int
sge_offset
,
int
*
frags
,
struct
buflist
**
blp
,
dma_addr_t
*
sglbuf_dma
,
MPT_ADAPTER
*
ioc
);
struct
buflist
**
blp
,
dma_addr_t
*
sglbuf_dma
,
MPT_ADAPTER
*
ioc
);
static
void
kfree_sgl
(
MptSge_t
*
sgl
,
dma_addr_t
sgl_dma
,
static
void
kfree_sgl
(
MptSge_t
*
sgl
,
dma_addr_t
sgl_dma
,
...
@@ -551,7 +551,7 @@ mptctl_ioc_reset(MPT_ADAPTER *ioc, int reset_phase)
...
@@ -551,7 +551,7 @@ mptctl_ioc_reset(MPT_ADAPTER *ioc, int reset_phase)
static
int
static
int
mptctl_ioctl
(
struct
inode
*
inode
,
struct
file
*
file
,
unsigned
int
cmd
,
unsigned
long
arg
)
mptctl_ioctl
(
struct
inode
*
inode
,
struct
file
*
file
,
unsigned
int
cmd
,
unsigned
long
arg
)
{
{
mpt_ioctl_header
*
uhdr
=
(
mpt_ioctl_head
er
*
)
arg
;
mpt_ioctl_header
__user
*
uhdr
=
(
void
__us
er
*
)
arg
;
mpt_ioctl_header
khdr
;
mpt_ioctl_header
khdr
;
int
iocnum
;
int
iocnum
;
unsigned
iocnumX
;
unsigned
iocnumX
;
...
@@ -564,7 +564,7 @@ mptctl_ioctl(struct inode *inode, struct file *file, unsigned int cmd, unsigned
...
@@ -564,7 +564,7 @@ mptctl_ioctl(struct inode *inode, struct file *file, unsigned int cmd, unsigned
if
(
copy_from_user
(
&
khdr
,
uhdr
,
sizeof
(
khdr
)))
{
if
(
copy_from_user
(
&
khdr
,
uhdr
,
sizeof
(
khdr
)))
{
printk
(
KERN_ERR
"%s::mptctl_ioctl() @%d - "
printk
(
KERN_ERR
"%s::mptctl_ioctl() @%d - "
"Unable to copy mpt_ioctl_header data @ %p
\n
"
,
"Unable to copy mpt_ioctl_header data @ %p
\n
"
,
__FILE__
,
__LINE__
,
(
void
*
)
uhdr
);
__FILE__
,
__LINE__
,
uhdr
);
return
-
EFAULT
;
return
-
EFAULT
;
}
}
ret
=
-
ENXIO
;
/* (-6) No such device or address */
ret
=
-
ENXIO
;
/* (-6) No such device or address */
...
@@ -636,7 +636,7 @@ mptctl_ioctl(struct inode *inode, struct file *file, unsigned int cmd, unsigned
...
@@ -636,7 +636,7 @@ mptctl_ioctl(struct inode *inode, struct file *file, unsigned int cmd, unsigned
static
int
mptctl_do_reset
(
unsigned
long
arg
)
static
int
mptctl_do_reset
(
unsigned
long
arg
)
{
{
struct
mpt_ioctl_diag_reset
*
urinfo
=
(
struct
mpt_ioctl_diag_reset
*
)
arg
;
struct
mpt_ioctl_diag_reset
__user
*
urinfo
=
(
void
__user
*
)
arg
;
struct
mpt_ioctl_diag_reset
krinfo
;
struct
mpt_ioctl_diag_reset
krinfo
;
MPT_ADAPTER
*
iocp
;
MPT_ADAPTER
*
iocp
;
...
@@ -645,7 +645,7 @@ static int mptctl_do_reset(unsigned long arg)
...
@@ -645,7 +645,7 @@ static int mptctl_do_reset(unsigned long arg)
if
(
copy_from_user
(
&
krinfo
,
urinfo
,
sizeof
(
struct
mpt_ioctl_diag_reset
)))
{
if
(
copy_from_user
(
&
krinfo
,
urinfo
,
sizeof
(
struct
mpt_ioctl_diag_reset
)))
{
printk
(
KERN_ERR
"%s@%d::mptctl_do_reset - "
printk
(
KERN_ERR
"%s@%d::mptctl_do_reset - "
"Unable to copy mpt_ioctl_diag_reset struct @ %p
\n
"
,
"Unable to copy mpt_ioctl_diag_reset struct @ %p
\n
"
,
__FILE__
,
__LINE__
,
(
void
*
)
urinfo
);
__FILE__
,
__LINE__
,
urinfo
);
return
-
EFAULT
;
return
-
EFAULT
;
}
}
...
@@ -684,14 +684,14 @@ static int mptctl_do_reset(unsigned long arg)
...
@@ -684,14 +684,14 @@ static int mptctl_do_reset(unsigned long arg)
static
int
static
int
mptctl_fw_download
(
unsigned
long
arg
)
mptctl_fw_download
(
unsigned
long
arg
)
{
{
struct
mpt_fw_xfer
*
ufwdl
=
(
struct
mpt_fw_xf
er
*
)
arg
;
struct
mpt_fw_xfer
__user
*
ufwdl
=
(
void
__us
er
*
)
arg
;
struct
mpt_fw_xfer
kfwdl
;
struct
mpt_fw_xfer
kfwdl
;
dctlprintk
((
KERN_INFO
"mptctl_fwdl called. mptctl_id = %xh
\n
"
,
mptctl_id
));
//tc
dctlprintk
((
KERN_INFO
"mptctl_fwdl called. mptctl_id = %xh
\n
"
,
mptctl_id
));
//tc
if
(
copy_from_user
(
&
kfwdl
,
ufwdl
,
sizeof
(
struct
mpt_fw_xfer
)))
{
if
(
copy_from_user
(
&
kfwdl
,
ufwdl
,
sizeof
(
struct
mpt_fw_xfer
)))
{
printk
(
KERN_ERR
"%s@%d::_ioctl_fwdl - "
printk
(
KERN_ERR
"%s@%d::_ioctl_fwdl - "
"Unable to copy mpt_fw_xfer struct @ %p
\n
"
,
"Unable to copy mpt_fw_xfer struct @ %p
\n
"
,
__FILE__
,
__LINE__
,
(
void
*
)
ufwdl
);
__FILE__
,
__LINE__
,
ufwdl
);
return
-
EFAULT
;
return
-
EFAULT
;
}
}
...
@@ -713,7 +713,7 @@ mptctl_fw_download(unsigned long arg)
...
@@ -713,7 +713,7 @@ mptctl_fw_download(unsigned long arg)
* -ENOMSG if FW upload returned bad status
* -ENOMSG if FW upload returned bad status
*/
*/
static
int
static
int
mptctl_do_fw_download
(
int
ioc
,
char
*
ufwbuf
,
size_t
fwlen
)
mptctl_do_fw_download
(
int
ioc
,
char
__user
*
ufwbuf
,
size_t
fwlen
)
{
{
FWDownload_t
*
dlmsg
;
FWDownload_t
*
dlmsg
;
MPT_FRAME_HDR
*
mf
;
MPT_FRAME_HDR
*
mf
;
...
@@ -842,7 +842,7 @@ mptctl_do_fw_download(int ioc, char *ufwbuf, size_t fwlen)
...
@@ -842,7 +842,7 @@ mptctl_do_fw_download(int ioc, char *ufwbuf, size_t fwlen)
if
(
copy_from_user
(
bl
->
kptr
,
ufwbuf
+
fw_bytes_copied
,
bl
->
len
))
{
if
(
copy_from_user
(
bl
->
kptr
,
ufwbuf
+
fw_bytes_copied
,
bl
->
len
))
{
printk
(
KERN_ERR
"%s@%d::_ioctl_fwdl - "
printk
(
KERN_ERR
"%s@%d::_ioctl_fwdl - "
"Unable to copy f/w buffer hunk#%d @ %p
\n
"
,
"Unable to copy f/w buffer hunk#%d @ %p
\n
"
,
__FILE__
,
__LINE__
,
n
,
(
void
*
)
ufwbuf
);
__FILE__
,
__LINE__
,
n
,
ufwbuf
);
goto
fwdl_out
;
goto
fwdl_out
;
}
}
fw_bytes_copied
+=
bl
->
len
;
fw_bytes_copied
+=
bl
->
len
;
...
@@ -1148,7 +1148,7 @@ kfree_sgl(MptSge_t *sgl, dma_addr_t sgl_dma, struct buflist *buflist, MPT_ADAPTE
...
@@ -1148,7 +1148,7 @@ kfree_sgl(MptSge_t *sgl, dma_addr_t sgl_dma, struct buflist *buflist, MPT_ADAPTE
static
int
static
int
mptctl_getiocinfo
(
unsigned
long
arg
,
unsigned
int
data_size
)
mptctl_getiocinfo
(
unsigned
long
arg
,
unsigned
int
data_size
)
{
{
struct
mpt_ioctl_iocinfo
*
uarg
=
(
struct
mpt_ioctl_iocinfo
*
)
arg
;
struct
mpt_ioctl_iocinfo
__user
*
uarg
=
(
void
__user
*
)
arg
;
struct
mpt_ioctl_iocinfo
*
karg
;
struct
mpt_ioctl_iocinfo
*
karg
;
MPT_ADAPTER
*
ioc
;
MPT_ADAPTER
*
ioc
;
struct
pci_dev
*
pdev
;
struct
pci_dev
*
pdev
;
...
@@ -1188,7 +1188,7 @@ mptctl_getiocinfo (unsigned long arg, unsigned int data_size)
...
@@ -1188,7 +1188,7 @@ mptctl_getiocinfo (unsigned long arg, unsigned int data_size)
if
(
copy_from_user
(
karg
,
uarg
,
data_size
))
{
if
(
copy_from_user
(
karg
,
uarg
,
data_size
))
{
printk
(
KERN_ERR
"%s@%d::mptctl_getiocinfo - "
printk
(
KERN_ERR
"%s@%d::mptctl_getiocinfo - "
"Unable to read in mpt_ioctl_iocinfo struct @ %p
\n
"
,
"Unable to read in mpt_ioctl_iocinfo struct @ %p
\n
"
,
__FILE__
,
__LINE__
,
(
void
*
)
uarg
);
__FILE__
,
__LINE__
,
uarg
);
kfree
(
karg
);
kfree
(
karg
);
return
-
EFAULT
;
return
-
EFAULT
;
}
}
...
@@ -1283,10 +1283,10 @@ mptctl_getiocinfo (unsigned long arg, unsigned int data_size)
...
@@ -1283,10 +1283,10 @@ mptctl_getiocinfo (unsigned long arg, unsigned int data_size)
/* Copy the data from kernel memory to user memory
/* Copy the data from kernel memory to user memory
*/
*/
if
(
copy_to_user
((
char
*
)
arg
,
karg
,
data_size
))
{
if
(
copy_to_user
((
char
__user
*
)
arg
,
karg
,
data_size
))
{
printk
(
KERN_ERR
"%s@%d::mptctl_getiocinfo - "
printk
(
KERN_ERR
"%s@%d::mptctl_getiocinfo - "
"Unable to write out mpt_ioctl_iocinfo struct @ %p
\n
"
,
"Unable to write out mpt_ioctl_iocinfo struct @ %p
\n
"
,
__FILE__
,
__LINE__
,
(
void
*
)
uarg
);
__FILE__
,
__LINE__
,
uarg
);
kfree
(
karg
);
kfree
(
karg
);
return
-
EFAULT
;
return
-
EFAULT
;
}
}
...
@@ -1308,7 +1308,7 @@ mptctl_getiocinfo (unsigned long arg, unsigned int data_size)
...
@@ -1308,7 +1308,7 @@ mptctl_getiocinfo (unsigned long arg, unsigned int data_size)
static
int
static
int
mptctl_gettargetinfo
(
unsigned
long
arg
)
mptctl_gettargetinfo
(
unsigned
long
arg
)
{
{
struct
mpt_ioctl_targetinfo
*
uarg
=
(
struct
mpt_ioctl_targetinfo
*
)
arg
;
struct
mpt_ioctl_targetinfo
__user
*
uarg
=
(
void
__user
*
)
arg
;
struct
mpt_ioctl_targetinfo
karg
;
struct
mpt_ioctl_targetinfo
karg
;
MPT_ADAPTER
*
ioc
;
MPT_ADAPTER
*
ioc
;
struct
Scsi_Host
*
sh
;
struct
Scsi_Host
*
sh
;
...
@@ -1330,7 +1330,7 @@ mptctl_gettargetinfo (unsigned long arg)
...
@@ -1330,7 +1330,7 @@ mptctl_gettargetinfo (unsigned long arg)
if
(
copy_from_user
(
&
karg
,
uarg
,
sizeof
(
struct
mpt_ioctl_targetinfo
)))
{
if
(
copy_from_user
(
&
karg
,
uarg
,
sizeof
(
struct
mpt_ioctl_targetinfo
)))
{
printk
(
KERN_ERR
"%s@%d::mptctl_gettargetinfo - "
printk
(
KERN_ERR
"%s@%d::mptctl_gettargetinfo - "
"Unable to read in mpt_ioctl_targetinfo struct @ %p
\n
"
,
"Unable to read in mpt_ioctl_targetinfo struct @ %p
\n
"
,
__FILE__
,
__LINE__
,
(
void
*
)
uarg
);
__FILE__
,
__LINE__
,
uarg
);
return
-
EFAULT
;
return
-
EFAULT
;
}
}
...
@@ -1448,21 +1448,21 @@ mptctl_gettargetinfo (unsigned long arg)
...
@@ -1448,21 +1448,21 @@ mptctl_gettargetinfo (unsigned long arg)
/* Copy part of the data from kernel memory to user memory
/* Copy part of the data from kernel memory to user memory
*/
*/
if
(
copy_to_user
((
char
*
)
arg
,
&
karg
,
if
(
copy_to_user
((
char
__user
*
)
arg
,
&
karg
,
sizeof
(
struct
mpt_ioctl_targetinfo
)))
{
sizeof
(
struct
mpt_ioctl_targetinfo
)))
{
printk
(
KERN_ERR
"%s@%d::mptctl_gettargetinfo - "
printk
(
KERN_ERR
"%s@%d::mptctl_gettargetinfo - "
"Unable to write out mpt_ioctl_targetinfo struct @ %p
\n
"
,
"Unable to write out mpt_ioctl_targetinfo struct @ %p
\n
"
,
__FILE__
,
__LINE__
,
(
void
*
)
uarg
);
__FILE__
,
__LINE__
,
uarg
);
kfree
(
pmem
);
kfree
(
pmem
);
return
-
EFAULT
;
return
-
EFAULT
;
}
}
/* Copy the remaining data from kernel memory to user memory
/* Copy the remaining data from kernel memory to user memory
*/
*/
if
(
copy_to_user
(
(
char
*
)
uarg
->
targetInfo
,
pmem
,
numBytes
))
{
if
(
copy_to_user
(
uarg
->
targetInfo
,
pmem
,
numBytes
))
{
printk
(
KERN_ERR
"%s@%d::mptctl_gettargetinfo - "
printk
(
KERN_ERR
"%s@%d::mptctl_gettargetinfo - "
"Unable to write out mpt_ioctl_targetinfo struct @ %p
\n
"
,
"Unable to write out mpt_ioctl_targetinfo struct @ %p
\n
"
,
__FILE__
,
__LINE__
,
(
void
*
)
pdata
);
__FILE__
,
__LINE__
,
pdata
);
kfree
(
pmem
);
kfree
(
pmem
);
return
-
EFAULT
;
return
-
EFAULT
;
}
}
...
@@ -1483,7 +1483,7 @@ mptctl_gettargetinfo (unsigned long arg)
...
@@ -1483,7 +1483,7 @@ mptctl_gettargetinfo (unsigned long arg)
static
int
static
int
mptctl_readtest
(
unsigned
long
arg
)
mptctl_readtest
(
unsigned
long
arg
)
{
{
struct
mpt_ioctl_test
*
uarg
=
(
struct
mpt_ioctl_test
*
)
arg
;
struct
mpt_ioctl_test
__user
*
uarg
=
(
void
__user
*
)
arg
;
struct
mpt_ioctl_test
karg
;
struct
mpt_ioctl_test
karg
;
MPT_ADAPTER
*
ioc
;
MPT_ADAPTER
*
ioc
;
int
iocnum
;
int
iocnum
;
...
@@ -1492,7 +1492,7 @@ mptctl_readtest (unsigned long arg)
...
@@ -1492,7 +1492,7 @@ mptctl_readtest (unsigned long arg)
if
(
copy_from_user
(
&
karg
,
uarg
,
sizeof
(
struct
mpt_ioctl_test
)))
{
if
(
copy_from_user
(
&
karg
,
uarg
,
sizeof
(
struct
mpt_ioctl_test
)))
{
printk
(
KERN_ERR
"%s@%d::mptctl_readtest - "
printk
(
KERN_ERR
"%s@%d::mptctl_readtest - "
"Unable to read in mpt_ioctl_test struct @ %p
\n
"
,
"Unable to read in mpt_ioctl_test struct @ %p
\n
"
,
__FILE__
,
__LINE__
,
(
void
*
)
uarg
);
__FILE__
,
__LINE__
,
uarg
);
return
-
EFAULT
;
return
-
EFAULT
;
}
}
...
@@ -1519,10 +1519,10 @@ mptctl_readtest (unsigned long arg)
...
@@ -1519,10 +1519,10 @@ mptctl_readtest (unsigned long arg)
/* Copy the data from kernel memory to user memory
/* Copy the data from kernel memory to user memory
*/
*/
if
(
copy_to_user
((
char
*
)
arg
,
&
karg
,
sizeof
(
struct
mpt_ioctl_test
)))
{
if
(
copy_to_user
((
char
__user
*
)
arg
,
&
karg
,
sizeof
(
struct
mpt_ioctl_test
)))
{
printk
(
KERN_ERR
"%s@%d::mptctl_readtest - "
printk
(
KERN_ERR
"%s@%d::mptctl_readtest - "
"Unable to write out mpt_ioctl_test struct @ %p
\n
"
,
"Unable to write out mpt_ioctl_test struct @ %p
\n
"
,
__FILE__
,
__LINE__
,
(
void
*
)
uarg
);
__FILE__
,
__LINE__
,
uarg
);
return
-
EFAULT
;
return
-
EFAULT
;
}
}
...
@@ -1543,7 +1543,7 @@ mptctl_readtest (unsigned long arg)
...
@@ -1543,7 +1543,7 @@ mptctl_readtest (unsigned long arg)
static
int
static
int
mptctl_eventquery
(
unsigned
long
arg
)
mptctl_eventquery
(
unsigned
long
arg
)
{
{
struct
mpt_ioctl_eventquery
*
uarg
=
(
struct
mpt_ioctl_eventquery
*
)
arg
;
struct
mpt_ioctl_eventquery
__user
*
uarg
=
(
void
__user
*
)
arg
;
struct
mpt_ioctl_eventquery
karg
;
struct
mpt_ioctl_eventquery
karg
;
MPT_ADAPTER
*
ioc
;
MPT_ADAPTER
*
ioc
;
int
iocnum
;
int
iocnum
;
...
@@ -1552,7 +1552,7 @@ mptctl_eventquery (unsigned long arg)
...
@@ -1552,7 +1552,7 @@ mptctl_eventquery (unsigned long arg)
if
(
copy_from_user
(
&
karg
,
uarg
,
sizeof
(
struct
mpt_ioctl_eventquery
)))
{
if
(
copy_from_user
(
&
karg
,
uarg
,
sizeof
(
struct
mpt_ioctl_eventquery
)))
{
printk
(
KERN_ERR
"%s@%d::mptctl_eventquery - "
printk
(
KERN_ERR
"%s@%d::mptctl_eventquery - "
"Unable to read in mpt_ioctl_eventquery struct @ %p
\n
"
,
"Unable to read in mpt_ioctl_eventquery struct @ %p
\n
"
,
__FILE__
,
__LINE__
,
(
void
*
)
uarg
);
__FILE__
,
__LINE__
,
uarg
);
return
-
EFAULT
;
return
-
EFAULT
;
}
}
...
@@ -1568,10 +1568,10 @@ mptctl_eventquery (unsigned long arg)
...
@@ -1568,10 +1568,10 @@ mptctl_eventquery (unsigned long arg)
/* Copy the data from kernel memory to user memory
/* Copy the data from kernel memory to user memory
*/
*/
if
(
copy_to_user
((
char
*
)
arg
,
&
karg
,
sizeof
(
struct
mpt_ioctl_eventquery
)))
{
if
(
copy_to_user
((
char
__user
*
)
arg
,
&
karg
,
sizeof
(
struct
mpt_ioctl_eventquery
)))
{
printk
(
KERN_ERR
"%s@%d::mptctl_eventquery - "
printk
(
KERN_ERR
"%s@%d::mptctl_eventquery - "
"Unable to write out mpt_ioctl_eventquery struct @ %p
\n
"
,
"Unable to write out mpt_ioctl_eventquery struct @ %p
\n
"
,
__FILE__
,
__LINE__
,
(
void
*
)
uarg
);
__FILE__
,
__LINE__
,
uarg
);
return
-
EFAULT
;
return
-
EFAULT
;
}
}
return
0
;
return
0
;
...
@@ -1581,7 +1581,7 @@ mptctl_eventquery (unsigned long arg)
...
@@ -1581,7 +1581,7 @@ mptctl_eventquery (unsigned long arg)
static
int
static
int
mptctl_eventenable
(
unsigned
long
arg
)
mptctl_eventenable
(
unsigned
long
arg
)
{
{
struct
mpt_ioctl_eventenable
*
uarg
=
(
struct
mpt_ioctl_eventenable
*
)
arg
;
struct
mpt_ioctl_eventenable
__user
*
uarg
=
(
void
__user
*
)
arg
;
struct
mpt_ioctl_eventenable
karg
;
struct
mpt_ioctl_eventenable
karg
;
MPT_ADAPTER
*
ioc
;
MPT_ADAPTER
*
ioc
;
int
iocnum
;
int
iocnum
;
...
@@ -1590,7 +1590,7 @@ mptctl_eventenable (unsigned long arg)
...
@@ -1590,7 +1590,7 @@ mptctl_eventenable (unsigned long arg)
if
(
copy_from_user
(
&
karg
,
uarg
,
sizeof
(
struct
mpt_ioctl_eventenable
)))
{
if
(
copy_from_user
(
&
karg
,
uarg
,
sizeof
(
struct
mpt_ioctl_eventenable
)))
{
printk
(
KERN_ERR
"%s@%d::mptctl_eventenable - "
printk
(
KERN_ERR
"%s@%d::mptctl_eventenable - "
"Unable to read in mpt_ioctl_eventenable struct @ %p
\n
"
,
"Unable to read in mpt_ioctl_eventenable struct @ %p
\n
"
,
__FILE__
,
__LINE__
,
(
void
*
)
uarg
);
__FILE__
,
__LINE__
,
uarg
);
return
-
EFAULT
;
return
-
EFAULT
;
}
}
...
@@ -1628,7 +1628,7 @@ mptctl_eventenable (unsigned long arg)
...
@@ -1628,7 +1628,7 @@ mptctl_eventenable (unsigned long arg)
static
int
static
int
mptctl_eventreport
(
unsigned
long
arg
)
mptctl_eventreport
(
unsigned
long
arg
)
{
{
struct
mpt_ioctl_eventreport
*
uarg
=
(
struct
mpt_ioctl_eventreport
*
)
arg
;
struct
mpt_ioctl_eventreport
__user
*
uarg
=
(
void
__user
*
)
arg
;
struct
mpt_ioctl_eventreport
karg
;
struct
mpt_ioctl_eventreport
karg
;
MPT_ADAPTER
*
ioc
;
MPT_ADAPTER
*
ioc
;
int
iocnum
;
int
iocnum
;
...
@@ -1638,7 +1638,7 @@ mptctl_eventreport (unsigned long arg)
...
@@ -1638,7 +1638,7 @@ mptctl_eventreport (unsigned long arg)
if
(
copy_from_user
(
&
karg
,
uarg
,
sizeof
(
struct
mpt_ioctl_eventreport
)))
{
if
(
copy_from_user
(
&
karg
,
uarg
,
sizeof
(
struct
mpt_ioctl_eventreport
)))
{
printk
(
KERN_ERR
"%s@%d::mptctl_eventreport - "
printk
(
KERN_ERR
"%s@%d::mptctl_eventreport - "
"Unable to read in mpt_ioctl_eventreport struct @ %p
\n
"
,
"Unable to read in mpt_ioctl_eventreport struct @ %p
\n
"
,
__FILE__
,
__LINE__
,
(
void
*
)
uarg
);
__FILE__
,
__LINE__
,
uarg
);
return
-
EFAULT
;
return
-
EFAULT
;
}
}
...
@@ -1664,10 +1664,10 @@ mptctl_eventreport (unsigned long arg)
...
@@ -1664,10 +1664,10 @@ mptctl_eventreport (unsigned long arg)
/* Copy the data from kernel memory to user memory
/* Copy the data from kernel memory to user memory
*/
*/
numBytes
=
max
*
sizeof
(
MPT_IOCTL_EVENTS
);
numBytes
=
max
*
sizeof
(
MPT_IOCTL_EVENTS
);
if
(
copy_to_user
(
(
char
*
)
uarg
->
eventData
,
ioc
->
events
,
numBytes
))
{
if
(
copy_to_user
(
uarg
->
eventData
,
ioc
->
events
,
numBytes
))
{
printk
(
KERN_ERR
"%s@%d::mptctl_eventreport - "
printk
(
KERN_ERR
"%s@%d::mptctl_eventreport - "
"Unable to write out mpt_ioctl_eventreport struct @ %p
\n
"
,
"Unable to write out mpt_ioctl_eventreport struct @ %p
\n
"
,
__FILE__
,
__LINE__
,
(
void
*
)
ioc
->
events
);
__FILE__
,
__LINE__
,
ioc
->
events
);
return
-
EFAULT
;
return
-
EFAULT
;
}
}
...
@@ -1678,7 +1678,7 @@ mptctl_eventreport (unsigned long arg)
...
@@ -1678,7 +1678,7 @@ mptctl_eventreport (unsigned long arg)
static
int
static
int
mptctl_replace_fw
(
unsigned
long
arg
)
mptctl_replace_fw
(
unsigned
long
arg
)
{
{
struct
mpt_ioctl_replace_fw
*
uarg
=
(
struct
mpt_ioctl_replace_fw
*
)
arg
;
struct
mpt_ioctl_replace_fw
__user
*
uarg
=
(
void
__user
*
)
arg
;
struct
mpt_ioctl_replace_fw
karg
;
struct
mpt_ioctl_replace_fw
karg
;
MPT_ADAPTER
*
ioc
;
MPT_ADAPTER
*
ioc
;
fw_image_t
**
fwmem
=
NULL
;
fw_image_t
**
fwmem
=
NULL
;
...
@@ -1692,7 +1692,7 @@ mptctl_replace_fw (unsigned long arg)
...
@@ -1692,7 +1692,7 @@ mptctl_replace_fw (unsigned long arg)
if
(
copy_from_user
(
&
karg
,
uarg
,
sizeof
(
struct
mpt_ioctl_replace_fw
)))
{
if
(
copy_from_user
(
&
karg
,
uarg
,
sizeof
(
struct
mpt_ioctl_replace_fw
)))
{
printk
(
KERN_ERR
"%s@%d::mptctl_replace_fw - "
printk
(
KERN_ERR
"%s@%d::mptctl_replace_fw - "
"Unable to read in mpt_ioctl_replace_fw struct @ %p
\n
"
,
"Unable to read in mpt_ioctl_replace_fw struct @ %p
\n
"
,
__FILE__
,
__LINE__
,
(
void
*
)
uarg
);
__FILE__
,
__LINE__
,
uarg
);
return
-
EFAULT
;
return
-
EFAULT
;
}
}
...
@@ -1722,7 +1722,7 @@ mptctl_replace_fw (unsigned long arg)
...
@@ -1722,7 +1722,7 @@ mptctl_replace_fw (unsigned long arg)
if
(
copy_from_user
(
fwmem
[
ii
]
->
fw
,
uarg
->
newImage
+
offset
,
fwmem
[
ii
]
->
size
))
{
if
(
copy_from_user
(
fwmem
[
ii
]
->
fw
,
uarg
->
newImage
+
offset
,
fwmem
[
ii
]
->
size
))
{
printk
(
KERN_ERR
"%s@%d::mptctl_replace_fw - "
printk
(
KERN_ERR
"%s@%d::mptctl_replace_fw - "
"Unable to read in mpt_ioctl_replace_fw image @ %p
\n
"
,
"Unable to read in mpt_ioctl_replace_fw image @ %p
\n
"
,
__FILE__
,
__LINE__
,
(
void
*
)
uarg
);
__FILE__
,
__LINE__
,
uarg
);
mpt_free_fw_memory
(
ioc
,
fwmem
);
mpt_free_fw_memory
(
ioc
,
fwmem
);
return
-
EFAULT
;
return
-
EFAULT
;
...
@@ -1767,7 +1767,7 @@ mptctl_replace_fw (unsigned long arg)
...
@@ -1767,7 +1767,7 @@ mptctl_replace_fw (unsigned long arg)
static
int
static
int
mptctl_mpt_command
(
unsigned
long
arg
)
mptctl_mpt_command
(
unsigned
long
arg
)
{
{
struct
mpt_ioctl_command
*
uarg
=
(
struct
mpt_ioctl_command
*
)
arg
;
struct
mpt_ioctl_command
__user
*
uarg
=
(
void
__user
*
)
arg
;
struct
mpt_ioctl_command
karg
;
struct
mpt_ioctl_command
karg
;
MPT_ADAPTER
*
ioc
;
MPT_ADAPTER
*
ioc
;
int
iocnum
;
int
iocnum
;
...
@@ -1778,7 +1778,7 @@ mptctl_mpt_command (unsigned long arg)
...
@@ -1778,7 +1778,7 @@ mptctl_mpt_command (unsigned long arg)
if
(
copy_from_user
(
&
karg
,
uarg
,
sizeof
(
struct
mpt_ioctl_command
)))
{
if
(
copy_from_user
(
&
karg
,
uarg
,
sizeof
(
struct
mpt_ioctl_command
)))
{
printk
(
KERN_ERR
"%s@%d::mptctl_mpt_command - "
printk
(
KERN_ERR
"%s@%d::mptctl_mpt_command - "
"Unable to read in mpt_ioctl_command struct @ %p
\n
"
,
"Unable to read in mpt_ioctl_command struct @ %p
\n
"
,
__FILE__
,
__LINE__
,
(
void
*
)
uarg
);
__FILE__
,
__LINE__
,
uarg
);
return
-
EFAULT
;
return
-
EFAULT
;
}
}
...
@@ -1789,7 +1789,7 @@ mptctl_mpt_command (unsigned long arg)
...
@@ -1789,7 +1789,7 @@ mptctl_mpt_command (unsigned long arg)
return
-
ENODEV
;
return
-
ENODEV
;
}
}
rc
=
mptctl_do_mpt_command
(
karg
,
(
char
*
)
&
uarg
->
MF
,
0
);
rc
=
mptctl_do_mpt_command
(
karg
,
&
uarg
->
MF
);
return
rc
;
return
rc
;
}
}
...
@@ -1807,7 +1807,7 @@ mptctl_mpt_command (unsigned long arg)
...
@@ -1807,7 +1807,7 @@ mptctl_mpt_command (unsigned long arg)
* -EPERM if SCSI I/O and target is untagged
* -EPERM if SCSI I/O and target is untagged
*/
*/
static
int
static
int
mptctl_do_mpt_command
(
struct
mpt_ioctl_command
karg
,
char
*
mfPtr
,
int
local
)
mptctl_do_mpt_command
(
struct
mpt_ioctl_command
karg
,
void
__user
*
mfPtr
)
{
{
MPT_ADAPTER
*
ioc
;
MPT_ADAPTER
*
ioc
;
MPT_FRAME_HDR
*
mf
=
NULL
;
MPT_FRAME_HDR
*
mf
=
NULL
;
...
@@ -1871,23 +1871,15 @@ mptctl_do_mpt_command (struct mpt_ioctl_command karg, char *mfPtr, int local)
...
@@ -1871,23 +1871,15 @@ mptctl_do_mpt_command (struct mpt_ioctl_command karg, char *mfPtr, int local)
/* Copy the request frame
/* Copy the request frame
* Reset the saved message context.
* Reset the saved message context.
* Request frame in user space
*/
*/
if
(
local
)
{
if
(
copy_from_user
(
mf
,
mfPtr
,
karg
.
dataSgeOffset
*
4
))
{
/* Request frame in kernel space
*/
memcpy
((
char
*
)
mf
,
(
char
*
)
mfPtr
,
karg
.
dataSgeOffset
*
4
);
}
else
{
/* Request frame in user space
*/
if
(
copy_from_user
((
char
*
)
mf
,
(
char
*
)
mfPtr
,
karg
.
dataSgeOffset
*
4
)){
printk
(
KERN_ERR
"%s@%d::mptctl_do_mpt_command - "
printk
(
KERN_ERR
"%s@%d::mptctl_do_mpt_command - "
"Unable to read MF from mpt_ioctl_command struct @ %p
\n
"
,
"Unable to read MF from mpt_ioctl_command struct @ %p
\n
"
,
__FILE__
,
__LINE__
,
(
void
*
)
mfPtr
);
__FILE__
,
__LINE__
,
mfPtr
);
rc
=
-
EFAULT
;
rc
=
-
EFAULT
;
goto
done_free_mem
;
goto
done_free_mem
;
}
}
}
hdr
->
MsgContext
=
cpu_to_le32
(
msgContext
);
hdr
->
MsgContext
=
cpu_to_le32
(
msgContext
);
...
@@ -2168,7 +2160,7 @@ mptctl_do_mpt_command (struct mpt_ioctl_command karg, char *mfPtr, int local)
...
@@ -2168,7 +2160,7 @@ mptctl_do_mpt_command (struct mpt_ioctl_command karg, char *mfPtr, int local)
"%s@%d::mptctl_do_mpt_command - Unable "
"%s@%d::mptctl_do_mpt_command - Unable "
"to read user data "
"to read user data "
"struct @ %p
\n
"
,
"struct @ %p
\n
"
,
__FILE__
,
__LINE__
,
(
void
*
)
karg
.
dataOutBufPtr
);
__FILE__
,
__LINE__
,
karg
.
dataOutBufPtr
);
rc
=
-
EFAULT
;
rc
=
-
EFAULT
;
goto
done_free_mem
;
goto
done_free_mem
;
}
}
...
@@ -2269,12 +2261,12 @@ mptctl_do_mpt_command (struct mpt_ioctl_command karg, char *mfPtr, int local)
...
@@ -2269,12 +2261,12 @@ mptctl_do_mpt_command (struct mpt_ioctl_command karg, char *mfPtr, int local)
}
}
if
(
sz
>
0
)
{
if
(
sz
>
0
)
{
if
(
copy_to_user
(
(
char
*
)
karg
.
replyFrameBufPtr
,
if
(
copy_to_user
(
karg
.
replyFrameBufPtr
,
&
ioc
->
ioctl
->
ReplyFrame
,
sz
)){
&
ioc
->
ioctl
->
ReplyFrame
,
sz
)){
printk
(
KERN_ERR
"%s@%d::mptctl_do_mpt_command - "
printk
(
KERN_ERR
"%s@%d::mptctl_do_mpt_command - "
"Unable to write out reply frame %p
\n
"
,
"Unable to write out reply frame %p
\n
"
,
__FILE__
,
__LINE__
,
(
void
*
)
karg
.
replyFrameBufPtr
);
__FILE__
,
__LINE__
,
karg
.
replyFrameBufPtr
);
rc
=
-
ENODATA
;
rc
=
-
ENODATA
;
goto
done_free_mem
;
goto
done_free_mem
;
}
}
...
@@ -2286,11 +2278,11 @@ mptctl_do_mpt_command (struct mpt_ioctl_command karg, char *mfPtr, int local)
...
@@ -2286,11 +2278,11 @@ mptctl_do_mpt_command (struct mpt_ioctl_command karg, char *mfPtr, int local)
if
(
ioc
->
ioctl
->
status
&
MPT_IOCTL_STATUS_SENSE_VALID
)
{
if
(
ioc
->
ioctl
->
status
&
MPT_IOCTL_STATUS_SENSE_VALID
)
{
sz
=
min
(
karg
.
maxSenseBytes
,
MPT_SENSE_BUFFER_SIZE
);
sz
=
min
(
karg
.
maxSenseBytes
,
MPT_SENSE_BUFFER_SIZE
);
if
(
sz
>
0
)
{
if
(
sz
>
0
)
{
if
(
copy_to_user
(
(
char
*
)
karg
.
senseDataPtr
,
ioc
->
ioctl
->
sense
,
sz
))
{
if
(
copy_to_user
(
karg
.
senseDataPtr
,
ioc
->
ioctl
->
sense
,
sz
))
{
printk
(
KERN_ERR
"%s@%d::mptctl_do_mpt_command - "
printk
(
KERN_ERR
"%s@%d::mptctl_do_mpt_command - "
"Unable to write sense data to user %p
\n
"
,
"Unable to write sense data to user %p
\n
"
,
__FILE__
,
__LINE__
,
__FILE__
,
__LINE__
,
(
void
*
)
karg
.
senseDataPtr
);
karg
.
senseDataPtr
);
rc
=
-
ENODATA
;
rc
=
-
ENODATA
;
goto
done_free_mem
;
goto
done_free_mem
;
}
}
...
@@ -2303,12 +2295,12 @@ mptctl_do_mpt_command (struct mpt_ioctl_command karg, char *mfPtr, int local)
...
@@ -2303,12 +2295,12 @@ mptctl_do_mpt_command (struct mpt_ioctl_command karg, char *mfPtr, int local)
if
((
ioc
->
ioctl
->
status
&
MPT_IOCTL_STATUS_COMMAND_GOOD
)
&&
if
((
ioc
->
ioctl
->
status
&
MPT_IOCTL_STATUS_COMMAND_GOOD
)
&&
(
karg
.
dataInSize
>
0
)
&&
(
bufIn
.
kptr
))
{
(
karg
.
dataInSize
>
0
)
&&
(
bufIn
.
kptr
))
{
if
(
copy_to_user
(
(
char
*
)
karg
.
dataInBufPtr
,
if
(
copy_to_user
(
karg
.
dataInBufPtr
,
bufIn
.
kptr
,
karg
.
dataInSize
))
{
bufIn
.
kptr
,
karg
.
dataInSize
))
{
printk
(
KERN_ERR
"%s@%d::mptctl_do_mpt_command - "
printk
(
KERN_ERR
"%s@%d::mptctl_do_mpt_command - "
"Unable to write data to user %p
\n
"
,
"Unable to write data to user %p
\n
"
,
__FILE__
,
__LINE__
,
__FILE__
,
__LINE__
,
(
void
*
)
karg
.
dataInBufPtr
);
karg
.
dataInBufPtr
);
rc
=
-
ENODATA
;
rc
=
-
ENODATA
;
}
}
}
}
...
@@ -2361,7 +2353,7 @@ mptctl_do_mpt_command (struct mpt_ioctl_command karg, char *mfPtr, int local)
...
@@ -2361,7 +2353,7 @@ mptctl_do_mpt_command (struct mpt_ioctl_command karg, char *mfPtr, int local)
static
int
static
int
mptctl_hp_hostinfo
(
unsigned
long
arg
,
unsigned
int
data_size
)
mptctl_hp_hostinfo
(
unsigned
long
arg
,
unsigned
int
data_size
)
{
{
hp_host_info_t
*
uarg
=
(
hp_host_info_t
*
)
arg
;
hp_host_info_t
__user
*
uarg
=
(
void
__user
*
)
arg
;
MPT_ADAPTER
*
ioc
;
MPT_ADAPTER
*
ioc
;
struct
pci_dev
*
pdev
;
struct
pci_dev
*
pdev
;
char
*
pbuf
;
char
*
pbuf
;
...
@@ -2385,7 +2377,7 @@ mptctl_hp_hostinfo(unsigned long arg, unsigned int data_size)
...
@@ -2385,7 +2377,7 @@ mptctl_hp_hostinfo(unsigned long arg, unsigned int data_size)
if
(
copy_from_user
(
&
karg
,
uarg
,
sizeof
(
hp_host_info_t
)))
{
if
(
copy_from_user
(
&
karg
,
uarg
,
sizeof
(
hp_host_info_t
)))
{
printk
(
KERN_ERR
"%s@%d::mptctl_hp_host_info - "
printk
(
KERN_ERR
"%s@%d::mptctl_hp_host_info - "
"Unable to read in hp_host_info struct @ %p
\n
"
,
"Unable to read in hp_host_info struct @ %p
\n
"
,
__FILE__
,
__LINE__
,
(
void
*
)
uarg
);
__FILE__
,
__LINE__
,
uarg
);
return
-
EFAULT
;
return
-
EFAULT
;
}
}
...
@@ -2522,11 +2514,10 @@ mptctl_hp_hostinfo(unsigned long arg, unsigned int data_size)
...
@@ -2522,11 +2514,10 @@ mptctl_hp_hostinfo(unsigned long arg, unsigned int data_size)
/* Copy the data from kernel memory to user memory
/* Copy the data from kernel memory to user memory
*/
*/
if
(
copy_to_user
((
char
*
)
arg
,
&
karg
,
if
(
copy_to_user
((
char
__user
*
)
arg
,
&
karg
,
sizeof
(
hp_host_info_t
)))
{
sizeof
(
hp_host_info_t
)))
{
printk
(
KERN_ERR
"%s@%d::mptctl_hpgethostinfo - "
printk
(
KERN_ERR
"%s@%d::mptctl_hpgethostinfo - "
"Unable to write out hp_host_info @ %p
\n
"
,
"Unable to write out hp_host_info @ %p
\n
"
,
__FILE__
,
__LINE__
,
(
void
*
)
uarg
);
__FILE__
,
__LINE__
,
uarg
);
return
-
EFAULT
;
return
-
EFAULT
;
}
}
...
@@ -2548,7 +2539,7 @@ mptctl_hp_hostinfo(unsigned long arg, unsigned int data_size)
...
@@ -2548,7 +2539,7 @@ mptctl_hp_hostinfo(unsigned long arg, unsigned int data_size)
static
int
static
int
mptctl_hp_targetinfo
(
unsigned
long
arg
)
mptctl_hp_targetinfo
(
unsigned
long
arg
)
{
{
hp_target_info_t
*
uarg
=
(
hp_target_info_t
*
)
arg
;
hp_target_info_t
__user
*
uarg
=
(
void
__user
*
)
arg
;
SCSIDevicePage0_t
*
pg0_alloc
;
SCSIDevicePage0_t
*
pg0_alloc
;
SCSIDevicePage3_t
*
pg3_alloc
;
SCSIDevicePage3_t
*
pg3_alloc
;
MPT_ADAPTER
*
ioc
;
MPT_ADAPTER
*
ioc
;
...
@@ -2565,7 +2556,7 @@ mptctl_hp_targetinfo(unsigned long arg)
...
@@ -2565,7 +2556,7 @@ mptctl_hp_targetinfo(unsigned long arg)
if
(
copy_from_user
(
&
karg
,
uarg
,
sizeof
(
hp_target_info_t
)))
{
if
(
copy_from_user
(
&
karg
,
uarg
,
sizeof
(
hp_target_info_t
)))
{
printk
(
KERN_ERR
"%s@%d::mptctl_hp_targetinfo - "
printk
(
KERN_ERR
"%s@%d::mptctl_hp_targetinfo - "
"Unable to read in hp_host_targetinfo struct @ %p
\n
"
,
"Unable to read in hp_host_targetinfo struct @ %p
\n
"
,
__FILE__
,
__LINE__
,
(
void
*
)
uarg
);
__FILE__
,
__LINE__
,
uarg
);
return
-
EFAULT
;
return
-
EFAULT
;
}
}
...
@@ -2673,10 +2664,10 @@ mptctl_hp_targetinfo(unsigned long arg)
...
@@ -2673,10 +2664,10 @@ mptctl_hp_targetinfo(unsigned long arg)
/* Copy the data from kernel memory to user memory
/* Copy the data from kernel memory to user memory
*/
*/
if
(
copy_to_user
((
char
*
)
arg
,
&
karg
,
sizeof
(
hp_target_info_t
)))
{
if
(
copy_to_user
((
char
__user
*
)
arg
,
&
karg
,
sizeof
(
hp_target_info_t
)))
{
printk
(
KERN_ERR
"%s@%d::mptctl_hp_target_info - "
printk
(
KERN_ERR
"%s@%d::mptctl_hp_target_info - "
"Unable to write out mpt_ioctl_targetinfo struct @ %p
\n
"
,
"Unable to write out mpt_ioctl_targetinfo struct @ %p
\n
"
,
__FILE__
,
__LINE__
,
(
void
*
)
uarg
);
__FILE__
,
__LINE__
,
uarg
);
return
-
EFAULT
;
return
-
EFAULT
;
}
}
...
@@ -2753,7 +2744,7 @@ compat_mptfwxfer_ioctl(unsigned int fd, unsigned int cmd,
...
@@ -2753,7 +2744,7 @@ compat_mptfwxfer_ioctl(unsigned int fd, unsigned int cmd,
kfw
.
iocnum
=
iocnum
;
kfw
.
iocnum
=
iocnum
;
kfw
.
fwlen
=
kfw32
.
fwlen
;
kfw
.
fwlen
=
kfw32
.
fwlen
;
kfw
.
bufp
=
(
void
*
)(
unsigned
long
)
kfw32
.
bufp
;
kfw
.
bufp
=
compat_ptr
(
kfw32
.
bufp
)
;
ret
=
mptctl_do_fw_download
(
kfw
.
iocnum
,
kfw
.
bufp
,
kfw
.
fwlen
);
ret
=
mptctl_do_fw_download
(
kfw
.
iocnum
,
kfw
.
bufp
,
kfw
.
fwlen
);
...
@@ -2809,7 +2800,7 @@ compat_mpt_command(unsigned int fd, unsigned int cmd,
...
@@ -2809,7 +2800,7 @@ compat_mpt_command(unsigned int fd, unsigned int cmd,
/* Pass new structure to do_mpt_command
/* Pass new structure to do_mpt_command
*/
*/
ret
=
mptctl_do_mpt_command
(
karg
,
(
char
*
)
&
uarg
->
MF
,
0
);
ret
=
mptctl_do_mpt_command
(
karg
,
&
uarg
->
MF
);
up
(
&
mptctl_syscall_sem_ioc
[
iocp
->
id
]);
up
(
&
mptctl_syscall_sem_ioc
[
iocp
->
id
]);
...
...
drivers/message/fusion/mptctl.h
View file @
4175a2c1
...
@@ -115,7 +115,7 @@
...
@@ -115,7 +115,7 @@
struct
mpt_fw_xfer
{
struct
mpt_fw_xfer
{
unsigned
int
iocnum
;
/* IOC unit number */
unsigned
int
iocnum
;
/* IOC unit number */
unsigned
int
fwlen
;
unsigned
int
fwlen
;
void
*
bufp
;
/* Pointer to firmware buffer */
void
__user
*
bufp
;
/* Pointer to firmware buffer */
};
};
#if defined(__KERNEL__) && defined(CONFIG_COMPAT)
#if defined(__KERNEL__) && defined(CONFIG_COMPAT)
...
@@ -332,10 +332,10 @@ typedef struct mpt_ioctl_replace_fw {
...
@@ -332,10 +332,10 @@ typedef struct mpt_ioctl_replace_fw {
struct
mpt_ioctl_command
{
struct
mpt_ioctl_command
{
mpt_ioctl_header
hdr
;
mpt_ioctl_header
hdr
;
int
timeout
;
/* optional (seconds) */
int
timeout
;
/* optional (seconds) */
char
*
replyFrameBufPtr
;
char
__user
*
replyFrameBufPtr
;
char
*
dataInBufPtr
;
char
__user
*
dataInBufPtr
;
char
*
dataOutBufPtr
;
char
__user
*
dataOutBufPtr
;
char
*
senseDataPtr
;
char
__user
*
senseDataPtr
;
int
maxReplyBytes
;
int
maxReplyBytes
;
int
dataInSize
;
int
dataInSize
;
int
dataOutSize
;
int
dataOutSize
;
...
...
drivers/scsi/fd_mcs.c
View file @
4175a2c1
...
@@ -87,6 +87,7 @@
...
@@ -87,6 +87,7 @@
#include <linux/delay.h>
#include <linux/delay.h>
#include <linux/mca.h>
#include <linux/mca.h>
#include <linux/spinlock.h>
#include <linux/spinlock.h>
#include <scsi/scsicam.h>
#include <linux/mca-legacy.h>
#include <linux/mca-legacy.h>
#include <asm/io.h>
#include <asm/io.h>
...
@@ -1337,23 +1338,14 @@ static int fd_mcs_bus_reset(Scsi_Cmnd * SCpnt) {
...
@@ -1337,23 +1338,14 @@ static int fd_mcs_bus_reset(Scsi_Cmnd * SCpnt) {
static
int
fd_mcs_biosparam
(
struct
scsi_device
*
disk
,
struct
block_device
*
bdev
,
static
int
fd_mcs_biosparam
(
struct
scsi_device
*
disk
,
struct
block_device
*
bdev
,
sector_t
capacity
,
int
*
info_array
)
sector_t
capacity
,
int
*
info_array
)
{
{
unsigned
char
buf
[
512
+
sizeof
(
int
)
*
2
]
;
unsigned
char
*
p
=
scsi_bios_ptable
(
bdev
)
;
int
size
=
capacity
;
int
size
=
capacity
;
int
*
sizes
=
(
int
*
)
buf
;
unsigned
char
*
data
=
(
unsigned
char
*
)
(
sizes
+
2
);
unsigned
char
do_read
[]
=
{
READ_6
,
0
,
0
,
0
,
1
,
0
};
int
retcode
;
/* BIOS >= 3.4 for MCA cards */
/* BIOS >= 3.4 for MCA cards */
/* This algorithm was provided by Future Domain (much thanks!). */
/* This algorithm was provided by Future Domain (much thanks!). */
sizes
[
0
]
=
0
;
/* zero bytes out */
if
(
p
&&
p
[
65
]
==
0xaa
&&
p
[
64
]
==
0x55
/* Partition table valid */
sizes
[
1
]
=
512
;
/* one sector in */
&&
p
[
4
])
{
/* Partition type */
memcpy
(
data
,
do_read
,
sizeof
(
do_read
));
retcode
=
kernel_scsi_ioctl
(
disk
,
SCSI_IOCTL_SEND_COMMAND
,
(
void
*
)
buf
);
if
(
!
retcode
/* SCSI command ok */
&&
data
[
511
]
==
0xaa
&&
data
[
510
]
==
0x55
/* Partition table valid */
&&
data
[
0x1c2
])
{
/* Partition type */
/* The partition table layout is as follows:
/* The partition table layout is as follows:
Start: 0x1b3h
Start: 0x1b3h
...
@@ -1383,8 +1375,8 @@ static int fd_mcs_biosparam(struct scsi_device * disk, struct block_device *bdev
...
@@ -1383,8 +1375,8 @@ static int fd_mcs_biosparam(struct scsi_device * disk, struct block_device *bdev
Future Domain algorithm, but it seemed to be a reasonable thing
Future Domain algorithm, but it seemed to be a reasonable thing
to do, especially in the Linux and BSD worlds. */
to do, especially in the Linux and BSD worlds. */
info_array
[
0
]
=
data
[
0x1c3
]
+
1
;
/* heads */
info_array
[
0
]
=
p
[
5
]
+
1
;
/* heads */
info_array
[
1
]
=
data
[
0x1c4
]
&
0x3f
;
/* sectors */
info_array
[
1
]
=
p
[
6
]
&
0x3f
;
/* sectors */
}
else
{
}
else
{
/* Note that this new method guarantees that there will always be
/* Note that this new method guarantees that there will always be
less than 1024 cylinders on a platter. This is good for drives
less than 1024 cylinders on a platter. This is good for drives
...
@@ -1403,6 +1395,7 @@ static int fd_mcs_biosparam(struct scsi_device * disk, struct block_device *bdev
...
@@ -1403,6 +1395,7 @@ static int fd_mcs_biosparam(struct scsi_device * disk, struct block_device *bdev
}
}
/* For both methods, compute the cylinders */
/* For both methods, compute the cylinders */
info_array
[
2
]
=
(
unsigned
int
)
size
/
(
info_array
[
0
]
*
info_array
[
1
]);
info_array
[
2
]
=
(
unsigned
int
)
size
/
(
info_array
[
0
]
*
info_array
[
1
]);
kfree
(
p
);
return
0
;
return
0
;
}
}
...
...
drivers/scsi/fdomain.c
View file @
4175a2c1
...
@@ -279,6 +279,7 @@
...
@@ -279,6 +279,7 @@
#include <linux/pci.h>
#include <linux/pci.h>
#include <linux/stat.h>
#include <linux/stat.h>
#include <linux/delay.h>
#include <linux/delay.h>
#include <scsi/scsicam.h>
#include <asm/io.h>
#include <asm/io.h>
#include <asm/system.h>
#include <asm/system.h>
...
@@ -1564,12 +1565,7 @@ static int fdomain_16x0_biosparam(struct scsi_device *sdev,
...
@@ -1564,12 +1565,7 @@ static int fdomain_16x0_biosparam(struct scsi_device *sdev,
sector_t
capacity
,
int
*
info_array
)
sector_t
capacity
,
int
*
info_array
)
{
{
int
drive
;
int
drive
;
unsigned
char
buf
[
512
+
sizeof
(
Scsi_Ioctl_Command
)];
Scsi_Ioctl_Command
*
sic
=
(
Scsi_Ioctl_Command
*
)
buf
;
int
size
=
capacity
;
int
size
=
capacity
;
unsigned
char
*
data
=
sic
->
data
;
unsigned
char
do_read
[]
=
{
READ_6
,
0
,
0
,
0
,
1
,
0
};
int
retcode
;
unsigned
long
offset
;
unsigned
long
offset
;
struct
drive_info
{
struct
drive_info
{
unsigned
short
cylinders
;
unsigned
short
cylinders
;
...
@@ -1657,16 +1653,10 @@ static int fdomain_16x0_biosparam(struct scsi_device *sdev,
...
@@ -1657,16 +1653,10 @@ static int fdomain_16x0_biosparam(struct scsi_device *sdev,
info_array
[
2
]
=
i
.
cylinders
;
info_array
[
2
]
=
i
.
cylinders
;
}
else
{
/* 3.4 BIOS (and up?) */
}
else
{
/* 3.4 BIOS (and up?) */
/* This algorithm was provided by Future Domain (much thanks!). */
/* This algorithm was provided by Future Domain (much thanks!). */
unsigned
char
*
p
=
scsi_bios_ptable
(
bdev
);
sic
->
inlen
=
0
;
/* zero bytes out */
if
(
p
&&
p
[
65
]
==
0xaa
&&
p
[
64
]
==
0x55
/* Partition table valid */
sic
->
outlen
=
512
;
/* one sector in */
&&
p
[
4
])
{
/* Partition type */
memcpy
(
data
,
do_read
,
sizeof
(
do_read
)
);
retcode
=
kernel_scsi_ioctl
(
sdev
,
SCSI_IOCTL_SEND_COMMAND
,
sic
);
if
(
!
retcode
/* SCSI command ok */
&&
data
[
511
]
==
0xaa
&&
data
[
510
]
==
0x55
/* Partition table valid */
&&
data
[
0x1c2
])
{
/* Partition type */
/* The partition table layout is as follows:
/* The partition table layout is as follows:
...
@@ -1697,8 +1687,8 @@ static int fdomain_16x0_biosparam(struct scsi_device *sdev,
...
@@ -1697,8 +1687,8 @@ static int fdomain_16x0_biosparam(struct scsi_device *sdev,
Future Domain algorithm, but it seemed to be a reasonable thing
Future Domain algorithm, but it seemed to be a reasonable thing
to do, especially in the Linux and BSD worlds. */
to do, especially in the Linux and BSD worlds. */
info_array
[
0
]
=
data
[
0x1c3
]
+
1
;
/* heads */
info_array
[
0
]
=
p
[
5
]
+
1
;
/* heads */
info_array
[
1
]
=
data
[
0x1c4
]
&
0x3f
;
/* sectors */
info_array
[
1
]
=
p
[
6
]
&
0x3f
;
/* sectors */
}
else
{
}
else
{
/* Note that this new method guarantees that there will always be
/* Note that this new method guarantees that there will always be
...
@@ -1718,6 +1708,7 @@ static int fdomain_16x0_biosparam(struct scsi_device *sdev,
...
@@ -1718,6 +1708,7 @@ static int fdomain_16x0_biosparam(struct scsi_device *sdev,
}
}
/* For both methods, compute the cylinders */
/* For both methods, compute the cylinders */
info_array
[
2
]
=
(
unsigned
int
)
size
/
(
info_array
[
0
]
*
info_array
[
1
]
);
info_array
[
2
]
=
(
unsigned
int
)
size
/
(
info_array
[
0
]
*
info_array
[
1
]
);
kfree
(
p
);
}
}
return
0
;
return
0
;
...
...
drivers/scsi/pcmcia/nsp_cs.c
View file @
4175a2c1
...
@@ -1936,10 +1936,10 @@ static void nsp_cs_config(dev_link_t *link)
...
@@ -1936,10 +1936,10 @@ static void nsp_cs_config(dev_link_t *link)
nsp_dbg
(
NSP_DEBUG_INIT
,
"host=0x%p"
,
host
);
nsp_dbg
(
NSP_DEBUG_INIT
,
"host=0x%p"
,
host
);
for
(
dev
=
host
->
host_queue
;
dev
!=
NULL
;
dev
=
dev
->
next
)
{
for
(
dev
=
host
->
host_queue
;
dev
!=
NULL
;
dev
=
dev
->
next
)
{
unsigned
long
arg
[
2
],
id
;
unsigned
long
id
;
kernel_scsi_ioctl
(
dev
,
SCSI_IOCTL_GET_IDLUN
,
arg
);
id
=
(
dev
->
id
&
0x0f
)
+
((
dev
->
lun
&
0x0f
)
<<
4
)
+
id
=
(
arg
[
0
]
&
0x0f
)
+
((
arg
[
0
]
>>
4
)
&
0xf0
)
+
((
dev
->
channel
&
0x0f
)
<<
8
)
+
((
arg
[
0
]
>>
8
)
&
0xf00
)
+
((
arg
[
0
]
>>
12
)
&
0xf000
);
((
dev
->
host
->
host_no
&
0x0f
)
<<
12
);
node
=
&
info
->
node
[
info
->
ndev
];
node
=
&
info
->
node
[
info
->
ndev
];
node
->
minor
=
0
;
node
->
minor
=
0
;
switch
(
dev
->
type
)
{
switch
(
dev
->
type
)
{
...
...
drivers/scsi/scsi_ioctl.c
View file @
4175a2c1
...
@@ -447,19 +447,3 @@ int scsi_ioctl(struct scsi_device *sdev, int cmd, void __user *arg)
...
@@ -447,19 +447,3 @@ int scsi_ioctl(struct scsi_device *sdev, int cmd, void __user *arg)
}
}
return
-
EINVAL
;
return
-
EINVAL
;
}
}
/*
* Just like scsi_ioctl, only callable from kernel space with no
* fs segment fiddling.
*/
int
kernel_scsi_ioctl
(
struct
scsi_device
*
sdev
,
int
cmd
,
void
*
arg
)
{
mm_segment_t
oldfs
;
int
tmp
;
oldfs
=
get_fs
();
set_fs
(
get_ds
());
tmp
=
scsi_ioctl
(
sdev
,
cmd
,
arg
);
set_fs
(
oldfs
);
return
tmp
;
}
drivers/scsi/scsi_syms.c
View file @
4175a2c1
...
@@ -54,7 +54,6 @@ EXPORT_SYMBOL(scsi_print_msg);
...
@@ -54,7 +54,6 @@ EXPORT_SYMBOL(scsi_print_msg);
EXPORT_SYMBOL
(
scsi_print_status
);
EXPORT_SYMBOL
(
scsi_print_status
);
EXPORT_SYMBOL
(
scsi_sense_key_string
);
EXPORT_SYMBOL
(
scsi_sense_key_string
);
EXPORT_SYMBOL
(
scsi_extd_sense_format
);
EXPORT_SYMBOL
(
scsi_extd_sense_format
);
EXPORT_SYMBOL
(
kernel_scsi_ioctl
);
EXPORT_SYMBOL
(
scsi_block_when_processing_errors
);
EXPORT_SYMBOL
(
scsi_block_when_processing_errors
);
EXPORT_SYMBOL
(
scsi_ioctl_send_command
);
EXPORT_SYMBOL
(
scsi_ioctl_send_command
);
EXPORT_SYMBOL
(
scsi_set_medium_removal
);
EXPORT_SYMBOL
(
scsi_set_medium_removal
);
...
...
include/scsi/scsi_ioctl.h
View file @
4175a2c1
...
@@ -41,7 +41,6 @@ typedef struct scsi_fctargaddress {
...
@@ -41,7 +41,6 @@ typedef struct scsi_fctargaddress {
}
Scsi_FCTargAddress
;
}
Scsi_FCTargAddress
;
extern
int
scsi_ioctl
(
struct
scsi_device
*
,
int
,
void
__user
*
);
extern
int
scsi_ioctl
(
struct
scsi_device
*
,
int
,
void
__user
*
);
extern
int
kernel_scsi_ioctl
(
struct
scsi_device
*
,
int
,
void
*
);
extern
int
scsi_ioctl_send_command
(
struct
scsi_device
*
,
extern
int
scsi_ioctl_send_command
(
struct
scsi_device
*
,
struct
scsi_ioctl_command
__user
*
);
struct
scsi_ioctl_command
__user
*
);
...
...
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