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
fb62897b
Commit
fb62897b
authored
Aug 21, 2004
by
Guennadi Liakhovetski
Committed by
James Bottomley
Aug 21, 2004
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[PATCH] tmscsim: remove unused / redundant bios_param
Signed-off-by:
James Bottomley
<
James.Bottomley@SteelEye.com
>
parent
b7ba569e
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
135 deletions
+0
-135
drivers/scsi/tmscsim.c
drivers/scsi/tmscsim.c
+0
-135
No files found.
drivers/scsi/tmscsim.c
View file @
fb62897b
...
...
@@ -999,140 +999,6 @@ static int DC390_queue_command(struct scsi_cmnd *cmd,
return
1
;
}
/* We ignore mapping problems, as we expect everybody to respect
* valid partition tables. Waiting for complaints ;-) */
#ifdef CONFIG_SCSI_DC390T_TRADMAP
/*
* The next function, partsize(), is copied from scsicam.c.
*
* This is ugly code duplication, but I didn't find another way to solve it:
* We want to respect the partition table and if it fails, we apply the
* DC390 BIOS heuristic. Too bad, just calling scsicam_bios_param() doesn't do
* the job, because we don't know, whether the values returned are from
* the part. table or determined by setsize(). Unfortunately the setsize()
* values differ from the ones chosen by the DC390 BIOS.
*
* Looking forward to seeing suggestions for a better solution! KG, 98/10/14
*/
#include <asm/unaligned.h>
/*
* Function : static int partsize(unsigned char *buf, unsigned long
* capacity,unsigned int *cyls, unsigned int *hds, unsigned int *secs);
*
* Purpose : to determine the BIOS mapping used to create the partition
* table, storing the results in *cyls, *hds, and *secs
*
* Returns : -1 on failure, 0 on success.
*
*/
static
int
partsize
(
unsigned
char
*
buf
,
unsigned
long
capacity
,
unsigned
int
*
cyls
,
unsigned
int
*
hds
,
unsigned
int
*
secs
)
{
struct
partition
*
p
,
*
largest
=
NULL
;
int
i
,
largest_cyl
;
int
cyl
,
ext_cyl
,
end_head
,
end_cyl
,
end_sector
;
unsigned
int
logical_end
,
physical_end
,
ext_physical_end
;
if
(
*
(
unsigned
short
*
)
(
buf
+
64
)
==
0xAA55
)
{
for
(
largest_cyl
=
-
1
,
p
=
(
struct
partition
*
)
buf
,
i
=
0
;
i
<
4
;
++
i
,
++
p
)
{
if
(
!
p
->
sys_ind
)
continue
;
cyl
=
p
->
cyl
+
((
p
->
sector
&
0xc0
)
<<
2
);
if
(
cyl
>
largest_cyl
)
{
largest_cyl
=
cyl
;
largest
=
p
;
}
}
}
if
(
largest
)
{
end_cyl
=
largest
->
end_cyl
+
((
largest
->
end_sector
&
0xc0
)
<<
2
);
end_head
=
largest
->
end_head
;
end_sector
=
largest
->
end_sector
&
0x3f
;
physical_end
=
end_cyl
*
(
end_head
+
1
)
*
end_sector
+
end_head
*
end_sector
+
end_sector
;
/* This is the actual _sector_ number at the end */
logical_end
=
get_unaligned
(
&
largest
->
start_sect
)
+
get_unaligned
(
&
largest
->
nr_sects
);
/* This is for >1023 cylinders */
ext_cyl
=
(
logical_end
-
(
end_head
*
end_sector
+
end_sector
))
/
(
end_head
+
1
)
/
end_sector
;
ext_physical_end
=
ext_cyl
*
(
end_head
+
1
)
*
end_sector
+
end_head
*
end_sector
+
end_sector
;
if
((
logical_end
==
physical_end
)
||
(
end_cyl
==
1023
&&
ext_physical_end
==
logical_end
))
{
*
secs
=
end_sector
;
*
hds
=
end_head
+
1
;
*
cyls
=
capacity
/
((
end_head
+
1
)
*
end_sector
);
return
0
;
}
}
return
-
1
;
}
/***********************************************************************
* Function:
* DC390_bios_param
*
* Description:
* Return the disk geometry for the given SCSI device.
* Respect the partition table, otherwise try own heuristic
*
* Note:
* In contrary to other externally callable funcs (DC390_), we don't lock
***********************************************************************/
static
int
DC390_bios_param
(
struct
scsi_device
*
sdev
,
struct
block_device
*
bdev
,
sector_t
capacity
,
int
geom
[])
{
int
heads
,
sectors
,
cylinders
;
struct
dc390_acb
*
pACB
=
(
struct
dc390_acb
*
)
sdev
->
host
->
hostdata
;
int
ret_code
=
-
1
;
int
size
=
capacity
;
unsigned
char
*
buf
;
if
((
buf
=
scsi_bios_ptable
(
bdev
)))
{
/* try to infer mapping from partition table */
ret_code
=
partsize
(
buf
,
(
unsigned
long
)
size
,
(
unsigned
int
*
)
geom
+
2
,
(
unsigned
int
*
)
geom
+
0
,
(
unsigned
int
*
)
geom
+
1
);
kfree
(
buf
);
}
if
(
ret_code
==
-
1
)
{
heads
=
64
;
sectors
=
32
;
cylinders
=
size
/
(
heads
*
sectors
);
if
(
(
pACB
->
Gmode2
&
GREATER_1G
)
&&
(
cylinders
>
1024
)
)
{
heads
=
255
;
sectors
=
63
;
cylinders
=
size
/
(
heads
*
sectors
);
}
geom
[
0
]
=
heads
;
geom
[
1
]
=
sectors
;
geom
[
2
]
=
cylinders
;
}
return
(
0
);
}
#else
static
int
DC390_bios_param
(
struct
scsi_device
*
sdev
,
struct
block_device
*
bdev
,
sector_t
capacity
,
int
geom
[])
{
return
scsicam_bios_param
(
bdev
,
capacity
,
geom
);
}
#endif
static
void
dc390_dumpinfo
(
struct
dc390_acb
*
pACB
,
struct
dc390_dcb
*
pDCB
,
struct
dc390_srb
*
pSRB
)
{
struct
pci_dev
*
pdev
;
...
...
@@ -1632,7 +1498,6 @@ static struct scsi_host_template driver_template = {
.
queuecommand
=
DC390_queue_command
,
.
eh_abort_handler
=
DC390_abort
,
.
eh_bus_reset_handler
=
DC390_bus_reset
,
.
bios_param
=
DC390_bios_param
,
.
can_queue
=
42
,
.
this_id
=
7
,
.
sg_tablesize
=
SG_ALL
,
...
...
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