Lines Matching defs:cdev
31 * @cdev: device for which the options are to be set
39 int ccw_device_set_options_mask(struct ccw_device *cdev, unsigned long flags)
47 cdev->private->options.fast = (flags & CCWDEV_EARLY_NOTIFICATION) != 0;
48 cdev->private->options.repall = (flags & CCWDEV_REPORT_ALL) != 0;
49 cdev->private->options.pgroup = (flags & CCWDEV_DO_PATHGROUP) != 0;
50 cdev->private->options.force = (flags & CCWDEV_ALLOW_FORCE) != 0;
51 cdev->private->options.mpath = (flags & CCWDEV_DO_MULTIPATH) != 0;
57 * @cdev: device for which the options are to be set
64 int ccw_device_set_options(struct ccw_device *cdev, unsigned long flags)
72 cdev->private->options.repall) ||
74 cdev->private->options.fast))
76 cdev->private->options.fast |= (flags & CCWDEV_EARLY_NOTIFICATION) != 0;
77 cdev->private->options.repall |= (flags & CCWDEV_REPORT_ALL) != 0;
78 cdev->private->options.pgroup |= (flags & CCWDEV_DO_PATHGROUP) != 0;
79 cdev->private->options.force |= (flags & CCWDEV_ALLOW_FORCE) != 0;
80 cdev->private->options.mpath |= (flags & CCWDEV_DO_MULTIPATH) != 0;
86 * @cdev: device for which the options are to be cleared
91 void ccw_device_clear_options(struct ccw_device *cdev, unsigned long flags)
93 cdev->private->options.fast &= (flags & CCWDEV_EARLY_NOTIFICATION) == 0;
94 cdev->private->options.repall &= (flags & CCWDEV_REPORT_ALL) == 0;
95 cdev->private->options.pgroup &= (flags & CCWDEV_DO_PATHGROUP) == 0;
96 cdev->private->options.force &= (flags & CCWDEV_ALLOW_FORCE) == 0;
97 cdev->private->options.mpath &= (flags & CCWDEV_DO_MULTIPATH) == 0;
102 * @cdev: ccw device
106 int ccw_device_is_pathgroup(struct ccw_device *cdev)
108 return cdev->private->flags.pgroup;
114 * @cdev: ccw device
118 int ccw_device_is_multipath(struct ccw_device *cdev)
120 return cdev->private->flags.mpath;
126 * @cdev: target ccw device
129 * ccw_device_clear() calls csch on @cdev's subchannel.
137 int ccw_device_clear(struct ccw_device *cdev, unsigned long intparm)
142 if (!cdev || !cdev->dev.parent)
144 sch = to_subchannel(cdev->dev.parent);
147 if (cdev->private->state == DEV_STATE_NOT_OPER)
149 if (cdev->private->state != DEV_STATE_ONLINE &&
150 cdev->private->state != DEV_STATE_W4SENSE)
155 cdev->private->intparm = intparm;
161 * @cdev: target ccw device
164 * @cdev's interrupt handler. Allows a device driver to associate
191 int ccw_device_start_timeout_key(struct ccw_device *cdev, struct ccw1 *cpa,
198 if (!cdev || !cdev->dev.parent)
200 sch = to_subchannel(cdev->dev.parent);
203 if (cdev->private->state == DEV_STATE_NOT_OPER)
205 if (cdev->private->state == DEV_STATE_VERIFY ||
206 cdev->private->flags.doverify) {
208 if (!cdev->private->flags.fake_irb) {
209 cdev->private->flags.fake_irb = FAKE_CMD_IRB;
210 cdev->private->intparm = intparm;
216 if (cdev->private->state != DEV_STATE_ONLINE ||
232 cdev->private->intparm = intparm;
234 ccw_device_set_timeout(cdev, expires);
238 dev_fsm_event(cdev, DEV_EVENT_VERIFY);
246 * @cdev: target ccw device
249 * @cdev's interrupt handler. Allows a device driver to associate
271 int ccw_device_start_key(struct ccw_device *cdev, struct ccw1 *cpa,
275 return ccw_device_start_timeout_key(cdev, cpa, intparm, lpm, key,
281 * @cdev: target ccw device
284 * @cdev's interrupt handler. Allows a device driver to associate
305 int ccw_device_start(struct ccw_device *cdev, struct ccw1 *cpa,
308 return ccw_device_start_key(cdev, cpa, intparm, lpm,
314 * @cdev: target ccw device
317 * @cdev's interrupt handler. Allows a device driver to associate
343 int ccw_device_start_timeout(struct ccw_device *cdev, struct ccw1 *cpa,
347 return ccw_device_start_timeout_key(cdev, cpa, intparm, lpm,
355 * @cdev: target ccw device
358 * ccw_device_halt() calls hsch on @cdev's subchannel.
370 int ccw_device_halt(struct ccw_device *cdev, unsigned long intparm)
375 if (!cdev || !cdev->dev.parent)
377 sch = to_subchannel(cdev->dev.parent);
380 if (cdev->private->state == DEV_STATE_NOT_OPER)
382 if (cdev->private->state != DEV_STATE_ONLINE &&
383 cdev->private->state != DEV_STATE_W4SENSE)
388 cdev->private->intparm = intparm;
394 * @cdev: target ccw device
396 * ccw_device_resume() calls rsch on @cdev's subchannel.
405 int ccw_device_resume(struct ccw_device *cdev)
409 if (!cdev || !cdev->dev.parent)
411 sch = to_subchannel(cdev->dev.parent);
414 if (cdev->private->state == DEV_STATE_NOT_OPER)
416 if (cdev->private->state != DEV_STATE_ONLINE ||
424 * @cdev: ccw device to inspect
436 struct ciw *ccw_device_get_ciw(struct ccw_device *cdev, __u32 ct)
440 if (cdev->private->flags.esid == 0)
443 if (cdev->private->dma_area->senseid.ciw[ciw_cnt].ct == ct)
444 return cdev->private->dma_area->senseid.ciw + ciw_cnt;
450 * @cdev: ccw device to be queried
455 __u8 ccw_device_get_path_mask(struct ccw_device *cdev)
459 if (!cdev->dev.parent)
462 sch = to_subchannel(cdev->dev.parent);
468 * @cdev: device to obtain the descriptor for
474 struct channel_path_desc_fmt0 *ccw_device_get_chp_desc(struct ccw_device *cdev,
480 sch = to_subchannel(cdev->dev.parent);
488 * @cdev: device to obtain the utility strings for
494 u8 *ccw_device_get_util_str(struct ccw_device *cdev, int chp_idx)
496 struct subchannel *sch = to_subchannel(cdev->dev.parent);
518 * @cdev: device to obtain the id for
521 void ccw_device_get_id(struct ccw_device *cdev, struct ccw_dev_id *dev_id)
523 *dev_id = cdev->private->dev_id;
529 * @cdev: ccw device on which to perform the start function
539 int ccw_device_tm_start_timeout_key(struct ccw_device *cdev, struct tcw *tcw,
546 sch = to_subchannel(cdev->dev.parent);
549 if (cdev->private->state == DEV_STATE_VERIFY) {
551 if (!cdev->private->flags.fake_irb) {
552 cdev->private->flags.fake_irb = FAKE_TM_IRB;
553 cdev->private->intparm = intparm;
559 if (cdev->private->state != DEV_STATE_ONLINE)
569 cdev->private->intparm = intparm;
571 ccw_device_set_timeout(cdev, expires);
579 * @cdev: ccw device on which to perform the start function
588 int ccw_device_tm_start_key(struct ccw_device *cdev, struct tcw *tcw,
591 return ccw_device_tm_start_timeout_key(cdev, tcw, intparm, lpm, key, 0);
597 * @cdev: ccw device on which to perform the start function
605 int ccw_device_tm_start(struct ccw_device *cdev, struct tcw *tcw,
608 return ccw_device_tm_start_key(cdev, tcw, intparm, lpm,
615 * @cdev: ccw device on which to perform the start function
624 int ccw_device_tm_start_timeout(struct ccw_device *cdev, struct tcw *tcw,
627 return ccw_device_tm_start_timeout_key(cdev, tcw, intparm, lpm,
634 * @cdev: ccw device for which the max data count is accumulated
640 int ccw_device_get_mdc(struct ccw_device *cdev, u8 mask)
642 struct subchannel *sch = to_subchannel(cdev->dev.parent);
680 * @cdev: ccw device on which to perform the interrogate function
685 int ccw_device_tm_intrg(struct ccw_device *cdev)
687 struct subchannel *sch = to_subchannel(cdev->dev.parent);
691 if (cdev->private->state != DEV_STATE_ONLINE)
702 * @cdev: device to obtain the id for
705 void ccw_device_get_schid(struct ccw_device *cdev, struct subchannel_id *schid)
707 struct subchannel *sch = to_subchannel(cdev->dev.parent);
715 * @cdev: device on which PNSO is performed
725 int ccw_device_pnso(struct ccw_device *cdev,
731 ccw_device_get_schid(cdev, &schid);
738 * @cdev: device to obtain the CSSID for
741 int ccw_device_get_cssid(struct ccw_device *cdev, u8 *cssid)
743 struct device *sch_dev = cdev->dev.parent;
754 * @cdev: device to obtain the MIF-image ID for
757 int ccw_device_get_iid(struct ccw_device *cdev, u8 *iid)
759 struct device *sch_dev = cdev->dev.parent;
770 * @cdev: device to obtain the Channel Path ID for
774 int ccw_device_get_chpid(struct ccw_device *cdev, int chp_idx, u8 *chpid)
776 struct subchannel *sch = to_subchannel(cdev->dev.parent);
792 * @cdev: device to obtain the Channel ID for
796 int ccw_device_get_chid(struct ccw_device *cdev, int chp_idx, u16 *chid)
803 rc = ccw_device_get_chpid(cdev, chp_idx, &cssid_chpid.id);
826 void *ccw_device_dma_zalloc(struct ccw_device *cdev, size_t size)
830 if (!get_device(&cdev->dev))
832 addr = cio_gp_dma_zalloc(cdev->private->dma_pool, &cdev->dev, size);
834 put_device(&cdev->dev);
839 void ccw_device_dma_free(struct ccw_device *cdev, void *cpu_addr, size_t size)
843 cio_gp_dma_free(cdev->private->dma_pool, cpu_addr, size);
844 put_device(&cdev->dev);