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

4.104.114.84.95
Last change on this file since 83c5fc1 was 94365d9, checked in by Joel Sherrill <joel.sherrill@…>, on 09/04/03 at 18:53:19

2003-09-04 Joel Sherrill <joel@…>

  • ide/ata.c, ide/ata.h, ide/ata_internal.h, ide/ide_controller.c, ide/ide_ctrl.h, ide/ide_ctrl_cfg.h, ide/ide_ctrl_io.h, network/cs8900.c, network/cs8900.c.bsp, network/cs8900.h, network/dec21140.c, network/elnk.c, network/open_eth.c, network/sonic.c, network/sonic.h, rtc/icm7170.c, rtc/icm7170.h, rtc/icm7170_reg.c, rtc/icm7170_reg2.c, rtc/icm7170_reg4.c, rtc/icm7170_reg8.c, rtc/m48t08.c, rtc/m48t08.h, rtc/m48t08_reg.c, rtc/m48t08_reg2.c, rtc/m48t08_reg4.c, rtc/m48t08_reg8.c, rtc/rtc.h, rtc/rtcprobe.c, serial/mc68681.c, serial/mc68681.h, serial/mc68681_p.h, serial/mc68681_reg.c, serial/mc68681_reg2.c, serial/mc68681_reg4.c, serial/mc68681_reg8.c, serial/serial.h, serial/z85c30.c, serial/z85c30.h, serial/z85c30_p.h, serial/z85c30_reg.c: URL for license changed.
  • 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, unsigned32 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, unsigned16 *value);
49    void    (*ctrl_reg_write)(int minor, int regist, unsigned16 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, unsigned16 block_size,
56                             blkdev_sg_buffer *bufs, rtems_unsigned32 *cbuf,
57                             rtems_unsigned32 *pos);
58    void  (*ctrl_write_block)(int minor, unsigned16 block_size,
59                              blkdev_sg_buffer *bufs, rtems_unsigned32 *cbuf,
60                              rtems_unsigned32 *pos);
61   
62    rtems_status_code (*ctrl_config_io_speed)(int minor,
63                                              unsigned8 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    unsigned8            status; /* initialized/non initialized. Should be set
76                                  * to zero by static initialization 
77                                  */
78    unsigned32           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__ */
105
106
107
Note: See TracBrowser for help on using the repository browser.