4 * Copyright (C) 2007 Sony Computer Entertainment Inc.
5 * Copyright 2007 Sony Corp.
7 * This program is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License as published
9 * by the Free Software Foundation; version 2 of the License.
11 * This program is distributed in the hope that it will be useful, but
12 * WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * General Public License for more details.
16 * You should have received a copy of the GNU General Public License along
17 * with this program; if not, write to the Free Software Foundation, Inc.,
18 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
21 #ifndef _ASM_POWERPC_PS3STOR_H_
22 #define _ASM_POWERPC_PS3STOR_H_
24 #include <linux/interrupt.h>
29 struct ps3_storage_region
{
35 struct ps3_storage_device
{
36 struct ps3_system_bus_device sbd
;
38 struct ps3_dma_region dma_region
;
44 struct completion done
;
46 unsigned long bounce_size
;
49 dma_addr_t bounce_dma
;
51 unsigned int num_regions
;
52 unsigned long accessible_regions
;
53 unsigned int region_idx
; /* first accessible region */
54 struct ps3_storage_region regions
[0]; /* Must be last */
57 static inline struct ps3_storage_device
*to_ps3_storage_device(struct device
*dev
)
59 return container_of(dev
, struct ps3_storage_device
, sbd
.core
);
62 extern int ps3stor_setup(struct ps3_storage_device
*dev
,
63 irq_handler_t handler
);
64 extern void ps3stor_teardown(struct ps3_storage_device
*dev
);
65 extern u64
ps3stor_read_write_sectors(struct ps3_storage_device
*dev
, u64 lpar
,
66 u64 start_sector
, u64 sectors
,
68 extern u64
ps3stor_send_command(struct ps3_storage_device
*dev
, u64 cmd
,
69 u64 arg1
, u64 arg2
, u64 arg3
, u64 arg4
);
71 #endif /* _ASM_POWERPC_PS3STOR_H_ */