source: rtems/c/src/libchip/ide/ide_ctrl_cfg.h @ a3d3d9a

4.104.114.84.95
Last change on this file since a3d3d9a was a3d3d9a, checked in by Ralf Corsepius <ralf.corsepius@…>, on Apr 20, 2004 at 10:43:39 AM

Remove stray white spaces.

  • Property mode set to 100644
File size: 3.5 KB
Line 
1/*
2 * ide_ctrl_cfg.h
3 *
4 * LibChip library IDE controller header file - structuers used for
5 * configuration and plugin interface definition.
6 *
7 * Copyright (C) 2002 OKTET Ltd., St.-Petersburg, Russia
8 * Author: Eugeny S. Mints <Eugeny.Mints@oktet.ru>
9 *
10 * The license and distribution terms for this file may be
11 * found in the file LICENSE in this distribution or at
12 * http://www.rtems.com/license/LICENSE.
13 *
14 * $Id$
15 */
16#ifndef __IDE_CTRL_CFG_H__
17#define __IDE_CTRL_CFG_H__
18
19#ifdef __cplusplus
20extern "C" {
21#endif
22
23#include <rtems/blkdev.h>
24
25/*
26 * Avaible drivers for IDE controllers
27 */
28typedef enum {
29    IDE_STD,
30    IDE_CUSTOM                /* BSP specific driver */
31} ide_ctrl_devs_t;
32
33/*
34 * Each driver for a particular controller have to provide following
35 * functions in such a structure. The only field which should not be NULL
36 * is contInit.
37 */
38typedef struct ide_ctrl_fns_s {
39    boolean           (*ctrl_probe)(int minor); /* probe routine */
40    void              (*ctrl_initialize)(int minor);
41    int               (*ctrl_control)(int minor, uint32_t   command,
42                                      void *arg);
43    /*
44     * Functions which allow read/write registers of a particular controller.
45     * (these functions may be used from ide_controller_read_register,
46     * ide_controller_write_register)
47     */
48    void    (*ctrl_reg_read)(int minor, int regist, uint16_t   *value);
49    void    (*ctrl_reg_write)(int minor, int regist, uint16_t   value);
50
51    /*
52     * The function allows to escape overhead for read/write register
53     * functions calls
54     */
55    void  (*ctrl_read_block)(int minor, uint16_t   block_size,
56                             blkdev_sg_buffer *bufs, uint32_t   *cbuf,
57                             uint32_t   *pos);
58    void  (*ctrl_write_block)(int minor, uint16_t   block_size,
59                              blkdev_sg_buffer *bufs, uint32_t   *cbuf,
60                              uint32_t   *pos);
61
62    rtems_status_code (*ctrl_config_io_speed)(int minor,
63                                              uint8_t   modes_available);
64} ide_ctrl_fns_t;
65
66/*
67 * IDE Controller configuration. Table of such configurations is provided
68 * by BSP
69 */
70typedef struct ide_controller_bsp_table_s {
71    char                *name;  /* device name */
72    ide_ctrl_devs_t      type;  /* chip type */
73    ide_ctrl_fns_t      *fns;   /* pointer to the set of driver routines */
74    boolean              (*probe)(int minor); /* general probe routine */
75    uint8_t              status; /* initialized/non initialized. Should be set
76                                  * to zero by static initialization
77                                  */
78    uint32_t             port1; /* port number for the port of the device */
79    rtems_boolean        int_driven; /* interrupt/poll driven */
80    rtems_vector_number  int_vec; /* the interrupt vector of the device */
81    void                *params;  /* contains either device specific data or a
82                                   * pointer to s device specific information
83                                   * table
84                                   */
85} ide_controller_bsp_table_t;
86
87/* IDE controllers Table */
88extern ide_controller_bsp_table_t    IDE_Controller_Table[];
89
90/* Number of rows in IDE_Controller_Table */
91extern unsigned long                 IDE_Controller_Count;
92
93
94#define IDE_CTRL_MAX_MINOR_NUMBER   4
95
96#define IDE_CTRL_NON_INITIALIZED    0
97#define IDE_CTRL_INITIALIZED        1
98
99#ifdef __cplusplus
100}
101#endif
102
103
104#endif /* __IDE_CTRL_CFG_H__ */
Note: See TracBrowser for help on using the repository browser.