Lines Matching refs:l

146 	ls *l = (ls *)data;  in fcp_login_timeout()  local
148 up(&l->sem); in fcp_login_timeout()
156 ls *l = (ls *)fc->ls; in fcp_login_done() local
159 if (i < l->count) { in fcp_login_done()
168 fcmd = l->fcmds + i; in fcp_login_done()
169 plogi = l->logi + 3 * i; in fcp_login_done()
178 fcmd->token += l->count; in fcp_login_done()
199 FCD (("FC is offline %d\n", l->grace[i])) in fcp_login_done()
207 i -= l->count; in fcp_login_done()
214 plogi = l->logi + 3 * i; in fcp_login_done()
215 dma_unmap_single (fc->dev, l->fcmds[i].cmd, 3 * sizeof(logi), in fcp_login_done()
229 if (atomic_dec_and_test (&l->todo)) in fcp_login_done()
230 up(&l->sem); in fcp_login_done()
234 dma_unmap_single (fc->dev, l->fcmds[i].cmd, 3 * sizeof(logi), in fcp_login_done()
237 if (atomic_dec_and_test (&l->todo)) in fcp_login_done()
238 up(&l->sem); in fcp_login_done()
253 ls *l = (ls *)fc->ls; in fcp_report_map_done() local
259 dma_unmap_single (fc->dev, l->fcmds[i].cmd, 3 * sizeof(logi), in fcp_report_map_done()
261 p = (fc_al_posmap *)(l->logi + 3 * i); in fcp_report_map_done()
303 if (atomic_dec_and_test (&l->todo)) in fcp_report_map_done()
304 up(&l->sem); in fcp_report_map_done()
308 fcmd = l->fcmds + i; in fcp_report_map_done()
312 memset(l->logi + 3 * i, 0, 3 * sizeof(logi)); in fcp_report_map_done()
319 l->logi [3 * i].code = LS_FLOGI; in fcp_report_map_done()
320 fcmd->cmd = dma_map_single (fc->dev, l->logi + 3 * i, 3 * sizeof(logi), in fcp_report_map_done()
333 FCD (("FC is offline %d\n", l->grace[i])) in fcp_report_map_done()
481 ls *l = (ls *)fc->ls; in fcp_receive_solicited() local
482 int i = (token >= l->count) ? token - l->count : token; in fcp_receive_solicited()
485 if ((unsigned)i < l->count && l->fcmds[i].fc == fc) { in fcp_receive_solicited()
499 lse *l = (lse *)fcmd->ls; in fcp_receive_solicited() local
501 l->status = status; in fcp_receive_solicited()
502 up (&l->sem); in fcp_receive_solicited()
508 lso *l = (lso *)fc->ls; in fcp_receive_solicited() local
510 if ((unsigned)token < l->count && l->fcmds[token].fc == fc) { in fcp_receive_solicited()
514 if (atomic_dec_and_test (&l->todo)) in fcp_receive_solicited()
515 up(&l->sem); in fcp_receive_solicited()
541 ls *l; in fcp_initialize() local
546 l = kmalloc(sizeof (ls) + count, GFP_KERNEL); in fcp_initialize()
547 if (!l) { in fcp_initialize()
551 memset (l, 0, sizeof(ls) + count); in fcp_initialize()
552 l->magic = LSMAGIC; in fcp_initialize()
553 l->count = count; in fcp_initialize()
555 init_MUTEX_LOCKED(&l->sem); in fcp_initialize()
556 l->timer.function = fcp_login_timeout; in fcp_initialize()
557 l->timer.data = (unsigned long)l; in fcp_initialize()
558 atomic_set (&l->todo, count); in fcp_initialize()
559 l->logi = kmalloc (count * 3 * sizeof(logi), GFP_KERNEL); in fcp_initialize()
560 l->fcmds = kmalloc (count * sizeof(fcp_cmnd), GFP_KERNEL); in fcp_initialize()
561 if (!l->logi || !l->fcmds) { in fcp_initialize()
562 if (l->logi) kfree (l->logi); in fcp_initialize()
563 if (l->fcmds) kfree (l->fcmds); in fcp_initialize()
564 kfree (l); in fcp_initialize()
568 memset (l->logi, 0, count * 3 * sizeof(logi)); in fcp_initialize()
569 memset (l->fcmds, 0, count * sizeof(fcp_cmnd)); in fcp_initialize()
577 fcmd = l->fcmds + i; in fcp_initialize()
579 fc->ls = (void *)l; in fcp_initialize()
581 fcmd->cmd = dma_map_single (fc->dev, l->logi + 3 * i, 3 * sizeof(logi), in fcp_initialize()
595 if (!l->grace[i]) { in fcp_initialize()
596 l->grace[i]++; in fcp_initialize()
601 dma_unmap_single (fc->dev, l->fcmds[i].cmd, 3 * sizeof(logi), FC_DMA_BIDIRECTIONAL); in fcp_initialize()
602 if (atomic_dec_and_test (&l->todo)) in fcp_initialize()
617 fcmd = l->fcmds + i; in fcp_initialize()
626 l->logi [3 * i].code = LS_FLOGI; in fcp_initialize()
627 fcmd->cmd = dma_map_single (fc->dev, l->logi + 3 * i, 3 * sizeof(logi), FC_DMA_BIDIRECTIONAL); in fcp_initialize()
639 l->timer.expires = jiffies + 5 * HZ; in fcp_initialize()
640 add_timer(&l->timer); in fcp_initialize()
642 down(&l->sem); in fcp_initialize()
643 if (!atomic_read(&l->todo)) { in fcp_initialize()
655 default: dma_unmap_single (fc->dev, l->fcmds[i].cmd, 3 * sizeof(logi), FC_DMA_BIDIRECTIONAL); in fcp_initialize()
659 del_timer(&l->timer); in fcp_initialize()
660 kfree (l->logi); in fcp_initialize()
661 kfree (l->fcmds); in fcp_initialize()
662 kfree (l); in fcp_initialize()
671 lso l; in fcp_forceoffline() local
673 memset (&l, 0, sizeof(lso)); in fcp_forceoffline()
674 l.count = count; in fcp_forceoffline()
675 l.magic = LSOMAGIC; in fcp_forceoffline()
677 init_MUTEX_LOCKED(&l.sem); in fcp_forceoffline()
678 l.timer.function = fcp_login_timeout; in fcp_forceoffline()
679 l.timer.data = (unsigned long)&l; in fcp_forceoffline()
680 atomic_set (&l.todo, count); in fcp_forceoffline()
681 l.fcmds = kmalloc (count * sizeof(fcp_cmnd), GFP_KERNEL); in fcp_forceoffline()
682 if (!l.fcmds) { in fcp_forceoffline()
683 kfree (l.fcmds); in fcp_forceoffline()
687 memset (l.fcmds, 0, count * sizeof(fcp_cmnd)); in fcp_forceoffline()
691 fcmd = l.fcmds + i; in fcp_forceoffline()
693 fc->ls = (void *)&l; in fcp_forceoffline()
705 l.timer.expires = jiffies + 5 * HZ; in fcp_forceoffline()
706 add_timer(&l.timer); in fcp_forceoffline()
707 down(&l.sem); in fcp_forceoffline()
708 del_timer(&l.timer); in fcp_forceoffline()
712 kfree (l.fcmds); in fcp_forceoffline()
1054 lse l; in fc_do_els() local
1076 memset (&l, 0, sizeof(lse)); in fc_do_els()
1077 l.magic = LSEMAGIC; in fc_do_els()
1078 init_MUTEX_LOCKED(&l.sem); in fc_do_els()
1079 l.timer.function = fcp_login_timeout; in fc_do_els()
1080 l.timer.data = (unsigned long)&l; in fc_do_els()
1081 l.status = FC_STATUS_TIMED_OUT; in fc_do_els()
1082 fcmd->ls = (void *)&l; in fc_do_els()
1089 l.timer.expires = jiffies + 5 * HZ; in fc_do_els()
1090 add_timer(&l.timer); in fc_do_els()
1091 down(&l.sem); in fc_do_els()
1092 del_timer(&l.timer); in fc_do_els()
1093 if (l.status != FC_STATUS_TIMED_OUT) break; in fc_do_els()
1103 return l.status; in fc_do_els()
1108 logi *l; in fc_do_plogi() local
1111 l = (logi *)kmalloc(2 * sizeof(logi), GFP_KERNEL); in fc_do_plogi()
1112 if (!l) return -ENOMEM; in fc_do_plogi()
1113 memset(l, 0, 2 * sizeof(logi)); in fc_do_plogi()
1114 l->code = LS_PLOGI; in fc_do_plogi()
1115 memcpy (&l->nport_wwn, &fc->wwn_nport, sizeof(fc_wwn)); in fc_do_plogi()
1116 memcpy (&l->node_wwn, &fc->wwn_node, sizeof(fc_wwn)); in fc_do_plogi()
1117 memcpy (&l->common, fc->common_svc, sizeof(common_svc_parm)); in fc_do_plogi()
1118 memcpy (&l->class1, fc->class_svcs, 3*sizeof(svc_parm)); in fc_do_plogi()
1119 status = fc_do_els(fc, alpa, l, sizeof(logi)); in fc_do_plogi()
1121 if (l[1].code == LS_ACC) { in fc_do_plogi()
1123 u32 *u = (u32 *)&l[1].nport_wwn; in fc_do_plogi()
1127 memcpy(nport, &l[1].nport_wwn, sizeof(fc_wwn)); in fc_do_plogi()
1128 memcpy(node, &l[1].node_wwn, sizeof(fc_wwn)); in fc_do_plogi()
1132 kfree(l); in fc_do_plogi()