2 * Copyright (C) 2012-2013 Samsung Electronics Co., Ltd.
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License
6 * as published by the Free Software Foundation; either version 2
7 * of the License, or (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
19 /************************************************************************/
21 /* PROJECT : exFAT & FAT12/16/32 File System */
22 /* FILE : exfat_blkdev.h */
23 /* PURPOSE : Header File for exFAT Block Device Driver Glue Layer */
25 /*----------------------------------------------------------------------*/
28 /*----------------------------------------------------------------------*/
29 /* REVISION HISTORY (Ver 0.9) */
31 /* - 2010.11.15 [Joosun Hahn] : first writing */
33 /************************************************************************/
35 #ifndef _EXFAT_BLKDEV_H
36 #define _EXFAT_BLKDEV_H
38 #include "exfat_config.h"
39 #include "exfat_global.h"
43 #endif /* __cplusplus */
45 /*----------------------------------------------------------------------*/
46 /* Constant & Macro Definitions (Non-Configurable) */
47 /*----------------------------------------------------------------------*/
49 /*----------------------------------------------------------------------*/
50 /* Type Definitions */
51 /*----------------------------------------------------------------------*/
53 typedef struct __BD_INFO_T
{
54 INT32 sector_size
; // in bytes
55 INT32 sector_size_bits
;
56 INT32 sector_size_mask
;
57 INT32 num_sectors
; // total number of sectors in this block device
58 BOOL opened
; // opened or not
61 /*----------------------------------------------------------------------*/
62 /* External Variable Declarations */
63 /*----------------------------------------------------------------------*/
65 /*----------------------------------------------------------------------*/
66 /* External Function Declarations */
67 /*----------------------------------------------------------------------*/
69 INT32
bdev_init(void);
70 INT32
bdev_shutdown(void);
71 INT32
bdev_open(struct super_block
*sb
);
72 INT32
bdev_close(struct super_block
*sb
);
73 INT32
bdev_read(struct super_block
*sb
, UINT32 secno
, struct buffer_head
**bh
, UINT32 num_secs
, INT32 read
);
74 INT32
bdev_write(struct super_block
*sb
, UINT32 secno
, struct buffer_head
*bh
, UINT32 num_secs
, INT32 sync
);
75 INT32
bdev_sync(struct super_block
*sb
);
79 #endif /* __cplusplus */
81 #endif /* _EXFAT_BLKDEV_H */
83 /* end of exfat_blkdev.h */