memset(fc->posmap, 0, sizeof(fcp_posmap)+p->len); 
static void fcp_report_map_done(fc_channel *fc, int i, int status){	fcp_cmnd *fcmd;	fc_hdr *fch;	unsigned char j;	ls *l = (ls *)fc->ls;	fc_al_posmap *p;		FCD(("Report map done %d %d\n", i, status))	switch (status) {	case FC_STATUS_OK: /* Ok, let's have a fun on a loop */		dma_unmap_single (fc->dev, l->fcmds[i].cmd, 3 * sizeof(logi),				  DMA_BIDIRECTIONAL);		p = (fc_al_posmap *)(l->logi + 3 * i);#ifdef FCDEBUG		{		u32 *u = (u32 *)p;		FCD(("%08x\n", u[0]))		u ++;		FCD(("%08x.%08x.%08x.%08x.%08x.%08x.%08x.%08x\n", u[0],u[1],u[2],u[3],u[4],u[5],u[6],u[7]))		}#endif				if ((p->magic & 0xffff0000) != FC_AL_LILP || !p->len) {			printk ("FC: Bad magic from REPORT_AL_MAP on %s - %08x\n", fc->name, p->magic);			fc->state = FC_STATE_OFFLINE;		} else {			fc->posmap = (fcp_posmap *)kmalloc(sizeof(fcp_posmap)+p->len, GFP_KERNEL);			if (!fc->posmap) {				printk("FC: Not enough memory, offlining channel\n");				fc->state = FC_STATE_OFFLINE;			} else {				int k;				memset(fc->posmap, 0, sizeof(fcp_posmap)+p->len);				/* FIXME: This is where SOCAL transfers our AL-PA.				   Keep it here till we found out what other cards do... */				fc->sid = (p->magic & 0xff);				for (i = 0; i < p->len; i++)					if (p->alpa[i] == fc->sid)						break;				k = p->len;				if (i == p->len)					i = 0;				else {					p->len--;					i++;				}				fc->posmap->len = p->len;				for (j = 0; j < p->len; j++) {					if (i == k) i = 0;					fc->posmap->list[j] = p->alpa[i++];				}				fc->state = FC_STATE_ONLINE;			}		}		printk ("%s: ONLINE\n", fc->name);		if (atomic_dec_and_test (&l->todo))			up(&l->sem);		break;	case FC_STATUS_POINTTOPOINT: /* We're Point-to-Point, no AL... */		FCD(("SID %d DID %d\n", fc->sid, fc->did))		fcmd = l->fcmds + i;		dma_unmap_single(fc->dev, fcmd->cmd, 3 * sizeof(logi),				 DMA_BIDIRECTIONAL);		fch = &fcmd->fch;		memset(l->logi + 3 * i, 0, 3 * sizeof(logi));		FILL_FCHDR_RCTL_DID(fch, R_CTL_ELS_REQ, FS_FABRIC_F_PORT);		FILL_FCHDR_SID(fch, 0);		FILL_FCHDR_TYPE_FCTL(fch, TYPE_EXTENDED_LS, F_CTL_FIRST_SEQ | F_CTL_SEQ_INITIATIVE);		FILL_FCHDR_SEQ_DF_SEQ(fch, 0, 0, 0);		FILL_FCHDR_OXRX(fch, 0xffff, 0xffff);		fch->param = 0;		l->logi [3 * i].code = LS_FLOGI;		fcmd->cmd = dma_map_single (fc->dev, l->logi + 3 * i, 3 * sizeof(logi),					    DMA_BIDIRECTIONAL);		fcmd->rsp = fcmd->cmd + sizeof(logi);		fcmd->cmdlen = sizeof(logi);		fcmd->rsplen = sizeof(logi);		fcmd->data = (dma_addr_t)NULL;		fcmd->class = FC_CLASS_SIMPLE;		fcmd->proto = TYPE_EXTENDED_LS;		if (fc->hw_enque (fc, fcmd))			printk ("FC: Cannot enque FLOGI packet on %s\n", fc->name);		break;	case FC_STATUS_ERR_OFFLINE:		fc->state = FC_STATE_MAYBEOFFLINE;		FCD (("FC is offline %d\n", l->grace[i]))		break;	default:		printk ("FLOGI failed for %s with status %d\n", fc->name, status);		/* Do some sort of error recovery here */		break;	}}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/49d0c6039dd36791cad36624e68bce5fe011bf12/fc.c/clean/drivers/fc4/fc.c