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

4.104.114.84.95
Last change on this file since 1c36c3e4 was 11bbeb9, checked in by Joel Sherrill <joel.sherrill@…>, on 10/28/02 at 13:57:06

2002-10-28 Eugeny S. Mints <Eugeny.Mints@…>

  • New files: New directory ide/, ide/Makefile.am, ide/ide_ctrl_cfg.h, ide/ide_ctrl_io.h, ide/ide_ctrl.h:
  • configure.ac, Makefile.am: Modified to reflect changes above.
  • 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.OARcorp.com/rtems/license.html.
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_CUSTOM                /* BSP specific driver */
30} ide_ctrl_devs_t;
31
32/*
33 * Each driver for a particular controller have to provide following
34 * functions in such a structure. The only field which should not be NULL
35 * is contInit.
36 */
37typedef struct ide_ctrl_fns_s {
38    boolean           (*ctrl_probe)(int minor); /* probe routine */
39    void              (*ctrl_initialize)(int minor);
40    int               (*ctrl_control)(int minor, unsigned32 command,
41                                      void *arg);
42    /*
43     * Functions which allow read/write registers of a particular controller.
44     * (these functions may be used from ide_controller_read_register,
45     * ide_controller_write_register)
46     */
47    void    (*ctrl_reg_read)(int minor, int regist, unsigned16 *value);
48    void    (*ctrl_reg_write)(int minor, int regist, unsigned16 value);
49   
50    /*
51     * The function allows to escape overhead for read/write register
52     * functions calls
53     */
54    void  (*ctrl_read_block)(int minor, unsigned16 block_size,
55                             blkdev_sg_buffer *bufs, rtems_unsigned32 *cbuf,
56                             rtems_unsigned32 *pos);
57    void  (*ctrl_write_block)(int minor, unsigned16 block_size,
58                              blkdev_sg_buffer *bufs, rtems_unsigned32 *cbuf,
59                              rtems_unsigned32 *pos);
60   
61    rtems_status_code (*ctrl_config_io_speed)(int minor,
62                                              unsigned8 modes_available);
63} ide_ctrl_fns_t;
64
65/*
66 * IDE Controller configuration. Table of such configurations is provided
67 * by BSP
68 */
69typedef struct ide_controller_bsp_table_s {
70    char                *name;  /* device name */
71    ide_ctrl_devs_t      type;  /* chip type */
72    ide_ctrl_fns_t      *fns;   /* pointer to the set of driver routines */
73    boolean              (*probe)(int minor); /* probe routine */
74    unsigned8            status; /* initialized/non initialized. Should be set
75                                  * to zero by static initialization 
76                                  */
77    unsigned32           port1; /* port number for the port of the device */
78    rtems_boolean        int_driven; /* interrupt/poll driven */
79    rtems_vector_number  int_vec; /* the interrupt vector of the device */
80    void                *params;  /* contains either device specific data or a
81                                   * pointer to s device specific information
82                                   * table
83                                   */
84} ide_controller_bsp_table_t;
85
86/* IDE controllers Table */
87extern ide_controller_bsp_table_t    IDE_Controller_Table[];
88
89/* Number of rows in IDE_Controller_Table */
90extern unsigned long                 IDE_Controller_Count;
91
92
93#define IDE_CTRL_MAX_MINOR_NUMBER   4
94
95#define IDE_CTRL_NON_INITIALIZED    0
96#define IDE_CTRL_INITIALIZED        1
97
98#ifdef __cplusplus
99}
100#endif
101
102
103#endif /* __IDE_CTRL_CFG_H__ */
104
105
106
Note: See TracBrowser for help on using the repository browser.