/** * struct stm_data - STM device description and callbacks * @name: device name * @stm: internal structure, only used by stm class code * @sw_start: first STP master available to software * @sw_end: last STP master available to software * @sw_nchannels: number of STP channels per master * @sw_mmiosz: size of one channel's IO space, for mmap, optional * @hw_override: masters in the STP stream will not match the ones * assigned by software, but are up to the STM hardware * @packet: callback that sends an STP packet * @mmio_addr: mmap callback, optional * @link: called when a new stm_source gets linked to us, optional * @unlink: likewise for unlinking, again optional * @set_options: set device-specific options on a channel * * Fill out this structure before calling stm_register_device() to create * an STM device and stm_unregister_device() to destroy it. It will also be * passed back to @packet(), @mmio_addr(), @link(), @unlink() and @set_options() * callbacks. * * Normally, an STM device will have a range of masters available to software * and the rest being statically assigned to various hardware trace sources. * The former is defined by the range [@sw_start..@sw_end] of the device * description. That is, the lowest master that can be allocated to software * writers is @sw_start and data from this writer will appear is @sw_start * master in the STP stream. * * The @packet callback should adhere to the following rules: * 1) it must return the number of bytes it consumed from the payload; * 2) therefore, if it sent a packet that does not have payload (like FLAG), * it must return zero; * 3) if it does not support the requested packet type/flag combination, * it must return -ENOTSUPP. * * The @unlink callback is called when there are no more active writers so * that the master/channel can be quiesced.
*/ struct stm_data { constchar *name; struct stm_device *stm; unsignedint sw_start; unsignedint sw_end; unsignedint sw_nchannels; unsignedint sw_mmiosz; unsignedint hw_override;
ssize_t (*packet)(struct stm_data *, unsignedint, unsignedint, unsignedint, unsignedint, unsignedint, constunsignedchar *);
phys_addr_t (*mmio_addr)(struct stm_data *, unsignedint, unsignedint, unsignedint); int (*link)(struct stm_data *, unsignedint, unsignedint); void (*unlink)(struct stm_data *, unsignedint, unsignedint); long (*set_options)(struct stm_data *, unsignedint, unsignedint, unsignedint, unsignedlong);
};
/** * struct stm_source_data - STM source device description and callbacks * @name: device name, will be used for policy lookup * @src: internal structure, only used by stm class code * @nr_chans: number of channels to allocate * @type: type of STM source driver represented by stm_source_type * @link: called when this source gets linked to an STM device * @unlink: called when this source is about to get unlinked from its STM * * Fill in this structure before calling stm_source_register_device() to * register a source device. Also pass it to unregister and write calls.
*/ struct stm_source_data { constchar *name; struct stm_source_device *src; unsignedint percpu; unsignedint nr_chans; unsignedint type; int (*link)(struct stm_source_data *data); void (*unlink)(struct stm_source_data *data);
};
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung ist noch experimentell.