OpenCores
URL https://opencores.org/ocsvn/sata_controller_core/sata_controller_core/trunk

Subversion Repositories sata_controller_core

[/] [sata_controller_core/] [trunk/] [sata2_driver_v1_00_a/] [sata_drv.h] - Blame information for rev 17

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 14 bhuang2
/*
2
 * sata_drv.h
3
 *
4
 * Definitions for the SATA device driver
5
 *
6
 * Author: Bin Huang  <bin.arthur@gmail.com>
7
 *
8
 * 2012 (c) Reconfigurable Computing System Lab at University of North
9
 * Carolina at Charlotte. This file is licensed under
10
 * the terms of the GNU General Public License version 2. This program
11
 * is licensed "as is" without any warranty of any kind, whether express
12
 * or implied. The code originally comes from the book "Linux Device
13
 * Drivers" by Alessandro Rubini and Jonathan Corbet, published
14
 * by O'Reilly & Associates.
15
 */
16
 
17
#include <linux/ioctl.h>
18
#include "sata_cfg.h"
19
 
20
#define DRIVER_NAME "sata"
21
 
22
/*
23
 * Minor number and partition management.
24
 */
25 16 bhuang2
#define SATA_MINORS     16
26 14 bhuang2
#define MINOR_SHIFT     4
27
#define DEVNUM(kdevnum) (MINOR(kdev_t_to_nr(kdevnum)) >> MINOR_SHIFT
28
 
29
/*
30
 * The internal representation of our device.
31
 */
32
struct sata_dev {
33 17 bhuang2
        unsigned long long size;        /* Device size in sectors */
34 14 bhuang2
        short users;                    /* How many users */
35
        short media_change;             /* Flag a media change? */
36
        spinlock_t lock;                /* For mutual exclusion */
37
        struct request_queue *queue;    /* The device request queue */
38
        struct gendisk *gd;             /* The gendisk structure */
39
        SATA_core_t *scp;               /* SATA Core Slave Registers */
40
};
41
 
42
 
43
#define HARDSECT_SIZE           512
44
 
45
/*
46
 * N_SECTORS:
47
 * 409600 -> 200MB
48
 * 819200 -> 400MB
49
 */
50
#define N_SECTORS               2097152 //1024MB
51
 
52
/*
53
 * We can tweak our hardware sector size, but the kernel talks to us
54
 * in terms of small sectors, always.
55
 */
56
#define KERNEL_SECTOR_SIZE      512
57
 
58
#define SECTOR_SHIFT            9

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.