/* simplified initializers for struct ccw_device: * CCW_DEVICE and CCW_DEVICE_DEVTYPE initialize one
* entry in your MODULE_DEVICE_TABLE and set the match_flag correctly */ #define CCW_DEVICE(cu, cum) \
.cu_type=(cu), .cu_model=(cum), \
.match_flags=(CCW_DEVICE_ID_MATCH_CU_TYPE \
| (cum ? CCW_DEVICE_ID_MATCH_CU_MODEL : 0))
/* scan through an array of device ids and return the first * entry that matches the device. * * the array must end with an entry containing zero match_flags
*/ staticinlineconststruct ccw_device_id *
ccw_device_id_match(conststruct ccw_device_id *array, conststruct ccw_device_id *match)
{ conststruct ccw_device_id *id = array;
for (id = array; id->match_flags; id++) { if ((id->match_flags & CCW_DEVICE_ID_MATCH_CU_TYPE)
&& (id->cu_type != match->cu_type)) continue;
if ((id->match_flags & CCW_DEVICE_ID_MATCH_CU_MODEL)
&& (id->cu_model != match->cu_model)) continue;
if ((id->match_flags & CCW_DEVICE_ID_MATCH_DEVICE_TYPE)
&& (id->dev_type != match->dev_type)) continue;
if ((id->match_flags & CCW_DEVICE_ID_MATCH_DEVICE_MODEL)
&& (id->dev_model != match->dev_model)) continue;
return id;
}
return NULL;
}
/** * struct ccw_device - channel attached device * @ccwlock: pointer to device lock * @id: id of this device * @drv: ccw driver for this device * @dev: embedded device structure * @online: online status of device * @handler: interrupt handler * * @handler is a member of the device rather than the driver since a driver * can have different interrupt handlers for different ccw devices * (multi-subchannel drivers).
*/ struct ccw_device {
spinlock_t *ccwlock; /* private: */ struct ccw_device_private *private; /* cio private information */ struct mutex reg_mutex; /* public: */ struct ccw_device_id id; struct ccw_driver *drv; struct device dev; int online; void (*handler) (struct ccw_device *, unsignedlong, struct irb *);
};
/* * Possible events used by the path_event notifier.
*/ #define PE_NONE 0x0 #define PE_PATH_GONE 0x1 /* A path is no longer available. */ #define PE_PATH_AVAILABLE 0x2 /* A path has become available and
was successfully verified. */ #define PE_PATHGROUP_ESTABLISHED 0x4 /* A pathgroup was reset and had
to be established again. */ #define PE_PATH_FCES_EVENT 0x8 /* The FCES Status of a path has
* changed. */
/* * Possible CIO actions triggered by the unit check handler.
*/ enum uc_todo {
UC_TODO_RETRY,
UC_TODO_RETRY_ON_NEW_PATH,
UC_TODO_STOP
};
/** * struct ccw_driver - device driver for channel attached devices * @ids: ids supported by this driver * @probe: function called on probe * @remove: function called on remove * @set_online: called when setting device online * @set_offline: called when setting device offline * @notify: notify driver of device state changes * @path_event: notify driver of channel path events * @shutdown: called at device shutdown * @uc_handler: callback for unit check handler * @driver: embedded device driver structure * @int_class: interruption class to use for accounting interrupts
*/ struct ccw_driver { struct ccw_device_id *ids; int (*probe) (struct ccw_device *); void (*remove) (struct ccw_device *); int (*set_online) (struct ccw_device *); int (*set_offline) (struct ccw_device *); int (*notify) (struct ccw_device *, int); void (*path_event) (struct ccw_device *, int *); void (*shutdown) (struct ccw_device *); enum uc_todo (*uc_handler) (struct ccw_device *, struct irb *); struct device_driver driver; enum interruption_class int_class;
};
/* devices drivers call these during module load and unload. * When a driver is registered, its probe method is called
* when new devices for its type pop up */ externint ccw_driver_register (struct ccw_driver *driver); externvoid ccw_driver_unregister (struct ccw_driver *driver); externint ccw_device_set_options_mask(struct ccw_device *, unsignedlong); externint ccw_device_set_options(struct ccw_device *, unsignedlong); externvoid ccw_device_clear_options(struct ccw_device *, unsignedlong); int ccw_device_is_pathgroup(struct ccw_device *cdev); int ccw_device_is_multipath(struct ccw_device *cdev);
/* Allow for i/o completion notification after primary interrupt status. */ #define CCWDEV_EARLY_NOTIFICATION 0x0001 /* Report all interrupt conditions. */ #define CCWDEV_REPORT_ALL 0x0002 /* Try to perform path grouping. */ #define CCWDEV_DO_PATHGROUP 0x0004 /* Allow forced onlining of boxed devices. */ #define CCWDEV_ALLOW_FORCE 0x0008 /* Try to use multipath mode. */ #define CCWDEV_DO_MULTIPATH 0x0010
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 und die Messung sind noch experimentell.