eCosPro® Reference Manual
Prev | Chapter 21. Hardware Driver Interface | Next

# Disk Channel Structure

Each physical disk connected to a controller is represented by a disk channel. Each channel is defined with the following macro:

    DISK_CHANNEL(l, funs, dev_priv, controller, mbr_supp, max_part_num )

Arguments

l

  The "C" label for this structure.

funs

  The set of interface functions (see below).

`dev_priv`

  A placeholder for any device specific data for this channel.

`controller`

  Pointer to controller to which this disk channel is attached.

`mbr_supp`

  Does this disk support partitioning.

`max_part_num`

  The maximum number of partitions to be supported.

The interface from the hardware independent driver into the hardware interface module is contained in the `funs` table. This is defined by the DISK_FUNS macro.

If the space for the channel has been allocated elsewhere, the following macro may be used to initialise it:

    DISK_CHANNEL_INIT(dc, funs, dev_priv, controller, disk_info, part_dev_tab, part_chan_tab, part_tab, mbr_supp, max_part_num )

The arguments are as for DISK_CHANNEL() except for the following:

Arguments

dc

  The name of an object of type disk_channel. This object will be initialised by the macro.

disk_info

  The name of an object of type disk_info.

part_dev_tab

  The name of an array of objects of type struct cyg_devtab_entry. The number of array members must equal max_part_num, plus one.

part_chan_tab

  The name of an array of objects of type disk_channel. The number of array members must equal max_part_num.

part_tab

  The name of an array of objects of type cyg_disk_partition_t. The number of array members must equal max_part_num.

Prev | Home | Next
Disk Controller Structure | Up | Disk Functions Structure