Lines Matching refs:h
112 static int hp_sw_tur(struct scsi_device *sdev, struct hp_sw_dh_data *h) in hp_sw_tur() argument
128 req->sense = h->sense; in hp_sw_tur()
135 ret = tur_done(sdev, h->sense); in hp_sw_tur()
143 h->path_state = HP_SW_PATH_ACTIVE; in hp_sw_tur()
151 h->path_state = HP_SW_PATH_PASSIVE; in hp_sw_tur()
203 struct hp_sw_dh_data *h = req->end_io_data; in start_stop_endio() local
208 sdev_printk(KERN_WARNING, h->sdev, in start_stop_endio()
216 err = start_done(h->sdev, h->sense); in start_stop_endio()
219 if (--h->retry_cnt) { in start_stop_endio()
221 err = hp_sw_start_stop(h); in start_stop_endio()
230 if (h->callback_fn) { in start_stop_endio()
231 h->callback_fn(h->callback_data, err); in start_stop_endio()
232 h->callback_fn = h->callback_data = NULL; in start_stop_endio()
244 static int hp_sw_start_stop(struct hp_sw_dh_data *h) in hp_sw_start_stop() argument
248 req = blk_get_request(h->sdev->request_queue, WRITE, GFP_ATOMIC); in hp_sw_start_stop()
259 req->sense = h->sense; in hp_sw_start_stop()
262 req->end_io_data = h; in hp_sw_start_stop()
270 struct hp_sw_dh_data *h = get_hp_sw_data(sdev); in hp_sw_prep_fn() local
273 if (h->path_state != HP_SW_PATH_ACTIVE) { in hp_sw_prep_fn()
295 struct hp_sw_dh_data *h = get_hp_sw_data(sdev); in hp_sw_activate() local
297 ret = hp_sw_tur(sdev, h); in hp_sw_activate()
299 if (ret == SCSI_DH_OK && h->path_state == HP_SW_PATH_PASSIVE) { in hp_sw_activate()
300 h->retry_cnt = h->retries; in hp_sw_activate()
301 h->callback_fn = fn; in hp_sw_activate()
302 h->callback_data = data; in hp_sw_activate()
303 ret = hp_sw_start_stop(h); in hp_sw_activate()
306 h->callback_fn = h->callback_data = NULL; in hp_sw_activate()
345 struct hp_sw_dh_data *h; in hp_sw_bus_attach() local
348 h = kzalloc(sizeof(*h), GFP_KERNEL); in hp_sw_bus_attach()
349 if (!h) in hp_sw_bus_attach()
351 h->path_state = HP_SW_PATH_UNINITIALIZED; in hp_sw_bus_attach()
352 h->retries = HP_SW_RETRIES; in hp_sw_bus_attach()
353 h->sdev = sdev; in hp_sw_bus_attach()
355 ret = hp_sw_tur(sdev, h); in hp_sw_bus_attach()
356 if (ret != SCSI_DH_OK || h->path_state == HP_SW_PATH_UNINITIALIZED) in hp_sw_bus_attach()
360 HP_SW_NAME, h->path_state == HP_SW_PATH_ACTIVE? in hp_sw_bus_attach()
362 return &h->dh_data; in hp_sw_bus_attach()
364 kfree(h); in hp_sw_bus_attach()
370 struct hp_sw_dh_data *h = get_hp_sw_data(sdev); in hp_sw_bus_detach() local
372 kfree(h); in hp_sw_bus_detach()