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
99b4fa86
Commit
99b4fa86
authored
Dec 05, 2002
by
Linus Torvalds
Browse files
Options
Browse Files
Download
Plain Diff
Merge
bk://linuxusb.bkbits.net/pnp-2.5
into home.transmeta.com:/home/torvalds/v2.5/linux
parents
8115f435
78abb0ee
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
25 additions
and
13 deletions
+25
-13
drivers/scsi/aacraid/aachba.c
drivers/scsi/aacraid/aachba.c
+6
-11
drivers/scsi/aacraid/aacraid.h
drivers/scsi/aacraid/aacraid.h
+15
-0
drivers/scsi/aacraid/linit.c
drivers/scsi/aacraid/linit.c
+4
-2
No files found.
drivers/scsi/aacraid/aachba.c
View file @
99b4fa86
...
...
@@ -33,18 +33,12 @@
#include <linux/completion.h>
#include <asm/semaphore.h>
#include <asm/uaccess.h>
#define MAJOR_NR SCSI_DISK0_MAJOR
/* For DEVICE_NR() */
#include <linux/blk.h>
#include "scsi.h"
#include "hosts.h"
#include "aacraid.h"
#warning this is broken
#define N_SD_MAJORS 8
#define SD_MAJOR_MASK (N_SD_MAJORS - 1)
#define DEVICE_NR(device) (((major(device) & SD_MAJOR_MASK) << (8 - 4)) + (minor(device) >> 4))
/* SCSI Commands */
/* TODO: dmb - use the ones defined in include/scsi/scsi.h */
...
...
@@ -567,7 +561,7 @@ static void read_callback(void *context, struct fib * fibptr)
scsicmd
->
use_sg
,
scsi_to_pci_dma_dir
(
scsicmd
->
sc_data_direction
));
else
if
(
scsicmd
->
request_bufflen
)
pci_unmap_single
(
dev
->
pdev
,
(
dma_addr_t
)(
unsigned
long
)
scsicmd
->
SCp
.
ptr
,
pci_unmap_single
(
dev
->
pdev
,
scsicmd
->
SCp
.
dma_handle
,
scsicmd
->
request_bufflen
,
scsi_to_pci_dma_dir
(
scsicmd
->
sc_data_direction
));
readreply
=
(
struct
aac_read_reply
*
)
fib_data
(
fibptr
);
...
...
@@ -611,7 +605,7 @@ static void write_callback(void *context, struct fib * fibptr)
scsicmd
->
use_sg
,
scsi_to_pci_dma_dir
(
scsicmd
->
sc_data_direction
));
else
if
(
scsicmd
->
request_bufflen
)
pci_unmap_single
(
dev
->
pdev
,
(
dma_addr_t
)(
unsigned
long
)
scsicmd
->
SCp
.
ptr
,
pci_unmap_single
(
dev
->
pdev
,
scsicmd
->
SCp
.
dma_handle
,
scsicmd
->
request_bufflen
,
scsi_to_pci_dma_dir
(
scsicmd
->
sc_data_direction
));
...
...
@@ -1225,7 +1219,8 @@ static void aac_srb_callback(void *context, struct fib * fibptr)
scsicmd
->
use_sg
,
scsi_to_pci_dma_dir
(
scsicmd
->
sc_data_direction
));
else
if
(
scsicmd
->
request_bufflen
)
pci_unmap_single
(
dev
->
pdev
,
(
ulong
)
scsicmd
->
SCp
.
ptr
,
scsicmd
->
request_bufflen
,
pci_unmap_single
(
dev
->
pdev
,
scsicmd
->
SCp
.
dma_handle
,
scsicmd
->
request_bufflen
,
scsi_to_pci_dma_dir
(
scsicmd
->
sc_data_direction
));
/*
...
...
@@ -1516,7 +1511,7 @@ static unsigned long aac_build_sg(Scsi_Cmnd* scsicmd, struct sgmap* psg)
psg
->
count
=
cpu_to_le32
(
1
);
psg
->
sg
[
0
].
addr
=
cpu_to_le32
(
addr
);
psg
->
sg
[
0
].
count
=
cpu_to_le32
(
scsicmd
->
request_bufflen
);
scsicmd
->
SCp
.
ptr
=
(
void
*
)
addr
;
scsicmd
->
SCp
.
dma_handle
=
addr
;
byte_count
=
scsicmd
->
request_bufflen
;
}
return
byte_count
;
...
...
@@ -1577,7 +1572,7 @@ static unsigned long aac_build_sg64(Scsi_Cmnd* scsicmd, struct sgmap64* psg)
psg
->
sg
[
0
].
addr
[
1
]
=
(
u32
)(
le_addr
>>
32
);
psg
->
sg
[
0
].
addr
[
0
]
=
(
u32
)(
le_addr
&
0xffffffff
);
psg
->
sg
[
0
].
count
=
cpu_to_le32
(
scsicmd
->
request_bufflen
);
scsicmd
->
SCp
.
ptr
=
(
void
*
)
addr
;
scsicmd
->
SCp
.
dma_handle
=
addr
;
byte_count
=
scsicmd
->
request_bufflen
;
}
return
byte_count
;
...
...
drivers/scsi/aacraid/aacraid.h
View file @
99b4fa86
...
...
@@ -1369,6 +1369,21 @@ static inline struct hw_fib *addr2fib(u32 addr)
return
(
struct
hw_fib
*
)
addr
;
}
/**
* Convert capacity to cylinders
* accounting for the fact capacity could be a 64 bit value
*
*/
static
inline
u32
cap_to_cyls
(
sector_t
capacity
,
u32
divisor
)
{
#ifdef CONFIG_LBD
do_div
(
capacity
,
divisor
);
#else
capacity
/=
divisor
;
#endif
return
(
u32
)
capacity
;
}
const
char
*
aac_driverinfo
(
struct
Scsi_Host
*
);
struct
fib
*
fib_alloc
(
struct
aac_dev
*
dev
);
int
fib_setup
(
struct
aac_dev
*
dev
);
...
...
drivers/scsi/aacraid/linit.c
View file @
99b4fa86
...
...
@@ -443,7 +443,8 @@ static int aac_biosparm(struct scsi_device *sdev, struct block_device *bdev,
param
->
sectors
=
32
;
}
param
->
cylinders
=
capacity
/
(
param
->
heads
*
param
->
sectors
);
param
->
cylinders
=
cap_to_cyls
(
capacity
,
(
param
->
heads
*
param
->
sectors
));
/*
* Read the partition table block
...
...
@@ -497,7 +498,8 @@ static int aac_biosparm(struct scsi_device *sdev, struct block_device *bdev,
end_sec
=
first
->
end_sector
&
0x3f
;
}
param
->
cylinders
=
capacity
/
(
param
->
heads
*
param
->
sectors
);
param
->
cylinders
=
cap_to_cyls
(
capacity
,
(
param
->
heads
*
param
->
sectors
));
if
(
num
<
4
&&
end_sec
==
param
->
sectors
)
{
...
...
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