Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Typedefs | Enumerations | Functions | Variables
device.h File Reference
#include <asm/ccwdev.h>
#include <linux/atomic.h>
#include <linux/wait.h>
#include <linux/notifier.h>
#include <linux/kernel_stat.h>
#include "io_sch.h"

Go to the source code of this file.

Typedefs

typedef voidfsm_func_t )(struct ccw_device *, enum dev_event)
 

Enumerations

enum  dev_state {
  DEV_STATE_UNINIT, DEV_STATE_INIT, DEV_STATE_ERR, STATE_DEEP_SLEEP = 0,
  STATE_SLEEP = 1, STATE_STANDBY = 2, STATE_AWAKE = 3, STATE_RADIO_ON,
  STATE_RADIO_OFF, STATE_RADIO_IRQ_ON, STATE_RADIO_IRQ_OFF, DEV_STATE_NOT_OPER,
  DEV_STATE_SENSE_PGID, DEV_STATE_SENSE_ID, DEV_STATE_OFFLINE, DEV_STATE_VERIFY,
  DEV_STATE_ONLINE, DEV_STATE_W4SENSE, DEV_STATE_DISBAND_PGID, DEV_STATE_BOXED,
  DEV_STATE_TIMEOUT_KILL, DEV_STATE_QUIESCE, DEV_STATE_DISCONNECTED, DEV_STATE_DISCONNECTED_SENSE_ID,
  DEV_STATE_CMFCHANGE, DEV_STATE_CMFUPDATE, DEV_STATE_STEAL_LOCK, NR_DEV_STATES
}
 
enum  dev_event {
  DEV_EVENT_NOTOPER, DEV_EVENT_INTERRUPT, DEV_EVENT_TIMEOUT, DEV_EVENT_VERIFY,
  NR_DEV_EVENTS
}
 

Functions

int __init io_subchannel_init (void)
 
void io_subchannel_recog_done (struct ccw_device *cdev)
 
void io_subchannel_init_config (struct subchannel *sch)
 
int ccw_device_cancel_halt_clear (struct ccw_device *)
 
int ccw_device_is_orphan (struct ccw_device *)
 
void ccw_device_recognition (struct ccw_device *)
 
int ccw_device_online (struct ccw_device *)
 
int ccw_device_offline (struct ccw_device *)
 
void ccw_device_update_sense_data (struct ccw_device *)
 
int ccw_device_test_sense_data (struct ccw_device *)
 
void ccw_device_schedule_sch_unregister (struct ccw_device *)
 
int ccw_purge_blacklisted (void)
 
void ccw_device_sched_todo (struct ccw_device *cdev, enum cdev_todo todo)
 
struct ccw_deviceget_ccwdev_by_dev_id (struct ccw_dev_id *dev_id)
 
void ccw_device_accumulate_irb (struct ccw_device *, struct irb *)
 
void ccw_device_accumulate_basic_sense (struct ccw_device *, struct irb *)
 
int ccw_device_accumulate_and_sense (struct ccw_device *, struct irb *)
 
int ccw_device_do_sense (struct ccw_device *, struct irb *)
 
int lpm_adjust (int lpm, int mask)
 
void ccw_request_start (struct ccw_device *)
 
int ccw_request_cancel (struct ccw_device *cdev)
 
void ccw_request_handler (struct ccw_device *cdev)
 
void ccw_request_timeout (struct ccw_device *cdev)
 
void ccw_request_notoper (struct ccw_device *cdev)
 
void ccw_device_sense_id_start (struct ccw_device *)
 
void ccw_device_sense_id_done (struct ccw_device *, int)
 
void ccw_device_verify_start (struct ccw_device *)
 
void ccw_device_verify_done (struct ccw_device *, int)
 
void ccw_device_disband_start (struct ccw_device *)
 
void ccw_device_disband_done (struct ccw_device *, int)
 
void ccw_device_stlck_start (struct ccw_device *, void *, void *, void *)
 
void ccw_device_stlck_done (struct ccw_device *, void *, int)
 
int ccw_device_call_handler (struct ccw_device *)
 
int ccw_device_stlck (struct ccw_device *)
 
void ccw_device_trigger_reprobe (struct ccw_device *)
 
void ccw_device_kill_io (struct ccw_device *)
 
int ccw_device_notify (struct ccw_device *, int)
 
void ccw_device_set_disconnected (struct ccw_device *cdev)
 
void ccw_device_set_notoper (struct ccw_device *cdev)
 
void ccw_device_set_timeout (struct ccw_device *, int)
 
struct subchannel_id ccw_device_get_subchannel_id (struct ccw_device *)
 
void retry_set_schib (struct ccw_device *cdev)
 
void cmf_retry_copy_block (struct ccw_device *)
 
int cmf_reenable (struct ccw_device *)
 
int ccw_set_cmf (struct ccw_device *cdev, int enable)
 

Variables

fsm_func_tdev_jumptable [NR_DEV_STATES][NR_DEV_EVENTS]
 
wait_queue_head_t ccw_device_init_wq
 
atomic_t ccw_device_init_count
 
struct device_attribute dev_attr_cmb_enable
 

Typedef Documentation

typedef void( fsm_func_t)(struct ccw_device *, enum dev_event)

Definition at line 54 of file device.h.

Enumeration Type Documentation

enum dev_event
Enumerator:
DEV_EVENT_NOTOPER 
DEV_EVENT_INTERRUPT 
DEV_EVENT_TIMEOUT 
DEV_EVENT_VERIFY 
NR_DEV_EVENTS 

Definition at line 40 of file device.h.

enum dev_state
Enumerator:
DEV_STATE_UNINIT 
DEV_STATE_INIT 
DEV_STATE_ERR 
STATE_DEEP_SLEEP 
STATE_SLEEP 
STATE_STANDBY 
STATE_AWAKE 
STATE_RADIO_ON 
STATE_RADIO_OFF 
STATE_RADIO_IRQ_ON 
STATE_RADIO_IRQ_OFF 
DEV_STATE_NOT_OPER 
DEV_STATE_SENSE_PGID 
DEV_STATE_SENSE_ID 
DEV_STATE_OFFLINE 
DEV_STATE_VERIFY 
DEV_STATE_ONLINE 
DEV_STATE_W4SENSE 
DEV_STATE_DISBAND_PGID 
DEV_STATE_BOXED 
DEV_STATE_TIMEOUT_KILL 
DEV_STATE_QUIESCE 
DEV_STATE_DISCONNECTED 
DEV_STATE_DISCONNECTED_SENSE_ID 
DEV_STATE_CMFCHANGE 
DEV_STATE_CMFUPDATE 
DEV_STATE_STEAL_LOCK 
NR_DEV_STATES 

Definition at line 14 of file device.h.

Function Documentation

int ccw_device_accumulate_and_sense ( struct ccw_device ,
struct irb  
)

Definition at line 379 of file device_status.c.

void ccw_device_accumulate_basic_sense ( struct ccw_device ,
struct irb  
)

Definition at line 346 of file device_status.c.

void ccw_device_accumulate_irb ( struct ccw_device ,
struct irb  
)

Definition at line 191 of file device_status.c.

int ccw_device_call_handler ( struct ccw_device )

Definition at line 419 of file device_ops.c.

int ccw_device_cancel_halt_clear ( struct ccw_device )

Definition at line 136 of file device_fsm.c.

void ccw_device_disband_done ( struct ccw_device ,
int   
)

Definition at line 597 of file device_fsm.c.

void ccw_device_disband_start ( struct ccw_device cdev)

ccw_device_disband_start - disband pathgroup : ccw device

Execute a SET PGID channel program on to disband a previously established pathgroup. When finished, call ccw_device_disband_done with a return code specifying the result.

Definition at line 510 of file device_pgid.c.

int ccw_device_do_sense ( struct ccw_device ,
struct irb  
)

Definition at line 309 of file device_status.c.

struct subchannel_id ccw_device_get_subchannel_id ( struct ccw_device )
read

Definition at line 2041 of file device.c.

int ccw_device_is_orphan ( struct ccw_device )

Definition at line 292 of file device.c.

void ccw_device_kill_io ( struct ccw_device )

Definition at line 883 of file device_fsm.c.

int ccw_device_notify ( struct ccw_device cdev,
int  event 
)

ccw_device_notify() - inform the device's driver about an event : device for which an event occurred : event that occurred

Returns: -EINVAL if the device is offline or has no driver. -EOPNOTSUPP if the device's driver has no notifier registered. NOTIFY_OK if the driver wants to keep the device. NOTIFY_BAD if the driver doesn't want to keep the device.

Definition at line 329 of file device_fsm.c.

int ccw_device_offline ( struct ccw_device )

Definition at line 617 of file device_fsm.c.

int ccw_device_online ( struct ccw_device )

Definition at line 574 of file device_fsm.c.

void ccw_device_recognition ( struct ccw_device )

Definition at line 431 of file device_fsm.c.

void ccw_device_sched_todo ( struct ccw_device cdev,
enum cdev_todo  todo 
)

ccw_device_sched_todo - schedule ccw device operation : ccw device

Todo:
: todo

Schedule the operation identified by

Todo:
to be performed on the slow path workqueue. Do nothing if another operation with higher priority is already scheduled. Needs to be called with ccwdev lock held.

Definition at line 2103 of file device.c.

void ccw_device_schedule_sch_unregister ( struct ccw_device )
void ccw_device_sense_id_done ( struct ccw_device ,
int   
)

Definition at line 303 of file device_fsm.c.

void ccw_device_sense_id_start ( struct ccw_device cdev)

ccw_device_sense_id_start - perform SENSE ID : ccw device

Execute a SENSE ID channel program on to update its sense id information. When finished, call ccw_device_sense_id_done with a return code specifying the result.

Definition at line 198 of file device_id.c.

void ccw_device_set_disconnected ( struct ccw_device cdev)

Definition at line 1365 of file device.c.

void ccw_device_set_notoper ( struct ccw_device cdev)

Definition at line 1376 of file device.c.

void ccw_device_set_timeout ( struct ccw_device ,
int   
)

Definition at line 111 of file device_fsm.c.

int ccw_device_stlck ( struct ccw_device )

Definition at line 521 of file device_ops.c.

void ccw_device_stlck_done ( struct ccw_device ,
void ,
int   
)

Definition at line 510 of file device_ops.c.

void ccw_device_stlck_start ( struct ccw_device cdev,
void data,
void buf1,
void buf2 
)

ccw_device_stlck_start - perform unconditional release : ccw device : data pointer to be passed to ccw_device_stlck_done : data pointer used in channel program : data pointer used in channel program

Execute a channel program on to release an existing PGID reservation. When finished, call ccw_device_stlck_done with a return code specifying the result.

Definition at line 564 of file device_pgid.c.

int ccw_device_test_sense_data ( struct ccw_device )

Definition at line 191 of file device_fsm.c.

void ccw_device_trigger_reprobe ( struct ccw_device )

Definition at line 921 of file device_fsm.c.

void ccw_device_update_sense_data ( struct ccw_device )

Definition at line 182 of file device_fsm.c.

void ccw_device_verify_done ( struct ccw_device ,
int   
)

Definition at line 517 of file device_fsm.c.

void ccw_device_verify_start ( struct ccw_device cdev)

ccw_device_verify_start - perform path verification : ccw device

Perform an I/O on each available channel path to to determine which paths are operational. The resulting path mask is stored in sch->vpm. If device options specify pathgrouping, establish a pathgroup for the operational paths. When finished, call ccw_device_verify_done with a return code specifying the result.

Definition at line 460 of file device_pgid.c.

int ccw_purge_blacklisted ( void  )

ccw_purge_blacklisted - purge unused, blacklisted devices

Unregister all ccw devices that are offline and on the blacklist.

Definition at line 1358 of file device.c.

int ccw_request_cancel ( struct ccw_device cdev)

ccw_request_cancel - cancel running I/O request : ccw device

Cancel the I/O request specified by cdev->req. Return non-zero if request has already finished, zero otherwise.

Definition at line 150 of file ccwreq.c.

void ccw_request_handler ( struct ccw_device cdev)

ccw_request_handler - interrupt handler for I/O request procedure. : ccw device

Handle interrupt during I/O request procedure.

Definition at line 253 of file ccwreq.c.

void ccw_request_notoper ( struct ccw_device cdev)

ccw_request_notoper - notoper handler for I/O request procedure : ccw device

Handle notoper during I/O request procedure.

Definition at line 364 of file ccwreq.c.

void ccw_request_start ( struct ccw_device cdev)

ccw_request_start - perform I/O request : ccw device

Perform the I/O request specified by cdev->req.

Definition at line 119 of file ccwreq.c.

void ccw_request_timeout ( struct ccw_device cdev)

ccw_request_timeout - timeout handler for I/O request procedure : ccw device

Handle timeout during I/O request procedure.

Definition at line 325 of file ccwreq.c.

int ccw_set_cmf ( struct ccw_device cdev,
int  enable 
)

Definition at line 1205 of file cmf.c.

int cmf_reenable ( struct ccw_device )

Definition at line 1292 of file cmf.c.

void cmf_retry_copy_block ( struct ccw_device )

Definition at line 401 of file cmf.c.

struct ccw_device* get_ccwdev_by_dev_id ( struct ccw_dev_id dev_id)
read

get_ccwdev_by_dev_id() - obtain device from a ccw device id : id of the device to be searched

This function searches all devices attached to the ccw bus for a device matching . Returns: If a device is found its reference count is increased and returned; else NULL is returned.

Definition at line 707 of file device.c.

int __init io_subchannel_init ( void  )

Definition at line 190 of file device.c.

void io_subchannel_init_config ( struct subchannel sch)

Definition at line 1029 of file device.c.

void io_subchannel_recog_done ( struct ccw_device cdev)

Definition at line 891 of file device.c.

int lpm_adjust ( int  lpm,
int  mask 
)

lpm_adjust - adjust path mask : path mask to adjust : mask of available paths

Shift right until and have at least one bit in common or until is zero. Return the resulting lpm.

Definition at line 29 of file ccwreq.c.

void retry_set_schib ( struct ccw_device cdev)

Definition at line 280 of file cmf.c.

Variable Documentation

atomic_t ccw_device_init_count

Definition at line 141 of file device.c.

wait_queue_head_t ccw_device_init_wq

Definition at line 140 of file device.c.

struct device_attribute dev_attr_cmb_enable

Definition at line 1016 of file device_fsm.c.