Lines Matching defs:tgt

103 			      "Rpt-tgt rspbuf %p: PCI DMA Mapping Failed\n",
152 struct snic_tgt *tgt = container_of(work, struct snic_tgt, scan_work);
153 struct Scsi_Host *shost = dev_to_shost(&tgt->dev);
156 SNIC_HOST_INFO(shost, "Scanning Target id 0x%x\n", tgt->id);
157 scsi_scan_target(&tgt->dev,
158 tgt->channel,
159 tgt->scsi_tgt_id,
164 tgt->flags &= ~SNIC_TGT_SCAN_PENDING;
175 struct snic_tgt *tgt = NULL;
178 tgt = list_entry(cur, struct snic_tgt, list);
179 if (tgt->id == le32_to_cpu(tgtid->tgt_id))
180 return tgt;
181 tgt = NULL;
184 return tgt;
193 struct snic_tgt *tgt = dev_to_tgt(dev);
195 SNIC_HOST_INFO(snic_tgt_to_shost(tgt),
197 tgt->id,
200 SNIC_BUG_ON(!list_empty(&tgt->list));
201 kfree(tgt);
210 struct snic_tgt *tgt = container_of(work, struct snic_tgt, del_work);
211 struct Scsi_Host *shost = snic_tgt_to_shost(tgt);
213 if (tgt->flags & SNIC_TGT_SCAN_PENDING)
217 scsi_block_targets(shost, &tgt->dev);
220 snic_tgt_scsi_abort_io(tgt);
223 scsi_target_unblock(&tgt->dev, SDEV_TRANSPORT_OFFLINE);
226 scsi_remove_target(&tgt->dev); /* ?? */
227 device_del(&tgt->dev);
228 put_device(&tgt->dev);
237 struct snic_tgt *tgt = NULL;
241 tgt = snic_tgt_lookup(snic, tgtid);
242 if (tgt) {
244 return tgt;
247 tgt = kzalloc(sizeof(*tgt), GFP_KERNEL);
248 if (!tgt) {
252 return tgt;
255 INIT_LIST_HEAD(&tgt->list);
256 tgt->id = le32_to_cpu(tgtid->tgt_id);
257 tgt->channel = 0;
260 tgt->tdata.typ = le16_to_cpu(tgtid->tgt_type);
265 tgt->tdata.disc_id = 0;
266 tgt->state = SNIC_TGT_STAT_INIT;
267 device_initialize(&tgt->dev);
268 tgt->dev.parent = get_device(&snic->shost->shost_gendev);
269 tgt->dev.release = snic_tgt_dev_release;
270 INIT_WORK(&tgt->scan_work, snic_scsi_scan_tgt);
271 INIT_WORK(&tgt->del_work, snic_tgt_del);
272 switch (tgt->tdata.typ) {
274 dev_set_name(&tgt->dev, "snic_das_tgt:%d:%d-%d",
275 snic->shost->host_no, tgt->channel, tgt->id);
279 dev_set_name(&tgt->dev, "snic_san_tgt:%d:%d-%d",
280 snic->shost->host_no, tgt->channel, tgt->id);
285 dev_set_name(&tgt->dev, "snic_das_tgt:%d:%d-%d",
286 snic->shost->host_no, tgt->channel, tgt->id);
291 list_add_tail(&tgt->list, &snic->disc.tgt_list);
292 tgt->scsi_tgt_id = snic->disc.nxt_tgt_id++;
293 tgt->state = SNIC_TGT_STAT_ONLINE;
298 tgt->id, snic_tgt_type_to_str(tgt->tdata.typ));
300 ret = device_add(&tgt->dev);
308 list_del(&tgt->list);
310 put_device(&tgt->dev);
311 tgt = NULL;
313 return tgt;
316 SNIC_HOST_INFO(snic->shost, "Scanning %s.\n", dev_name(&tgt->dev));
318 scsi_queue_work(snic->shost, &tgt->scan_work);
320 return tgt;
329 struct snic_tgt *tgt = NULL;
363 tgt = snic_tgt_create(snic, &tgtid[i]);
364 if (!tgt) {
367 SNIC_HOST_ERR(snic->shost, "Failed to create tgt.\n");
533 struct snic_tgt *tgt = NULL;
543 tgt = list_entry(cur, struct snic_tgt, list);
544 tgt->state = SNIC_TGT_STAT_DEL;
545 list_del_init(&tgt->list);
546 SNIC_HOST_INFO(snic->shost, "Tgt %d q'ing for del\n", tgt->id);
547 queue_work(snic_glob->event_q, &tgt->del_work);
548 tgt = NULL;