s = kmalloc (sizeof (struct soc), GFP_KERNEL);
s = kzalloc (sizeof (struct soc), GFP_KERNEL);
static inline void soc_init(struct sbus_dev *sdev, int no){	unsigned char tmp[60];	int propl;	struct soc *s;	static int version_printed = 0;	soc_hw_cq cq[8];	int size, i;	int irq;		s = kmalloc (sizeof (struct soc), GFP_KERNEL);	if (s == NULL)		return;	memset (s, 0, sizeof(struct soc));	spin_lock_init(&s->lock);	s->soc_no = no;	SOD(("socs %08lx soc_intr %08lx soc_hw_enque %08x\n",	     (long)socs, (long)soc_intr, (long)soc_hw_enque))		if (version_printed++ == 0)		printk (version);	s->port[0].fc.module = THIS_MODULE;	s->port[1].fc.module = THIS_MODULE;	s->next = socs;	socs = s;	s->port[0].fc.dev = sdev;	s->port[1].fc.dev = sdev;	s->port[0].s = s;	s->port[1].s = s;	s->port[0].fc.next = &s->port[1].fc;	/* World Wide Name of SOC */	propl = prom_getproperty (sdev->prom_node, "soc-wwn", tmp, sizeof(tmp));	if (propl != sizeof (fc_wwn)) {		s->wwn.naaid = NAAID_IEEE;		s->wwn.lo = 0x12345678;	} else		memcpy (&s->wwn, tmp, sizeof (fc_wwn));			propl = prom_getproperty (sdev->prom_node, "port-wwns", tmp, sizeof(tmp));	if (propl != 2 * sizeof (fc_wwn)) {		s->port[0].fc.wwn_nport.naaid = NAAID_IEEE_EXT;		s->port[0].fc.wwn_nport.hi = s->wwn.hi;		s->port[0].fc.wwn_nport.lo = s->wwn.lo;		s->port[1].fc.wwn_nport.naaid = NAAID_IEEE_EXT;		s->port[1].fc.wwn_nport.nportid = 1;		s->port[1].fc.wwn_nport.hi = s->wwn.hi;		s->port[1].fc.wwn_nport.lo = s->wwn.lo;	} else {		memcpy (&s->port[0].fc.wwn_nport, tmp, sizeof (fc_wwn));		memcpy (&s->port[1].fc.wwn_nport, tmp + sizeof (fc_wwn), sizeof (fc_wwn));	}	memcpy (&s->port[0].fc.wwn_node, &s->wwn, sizeof (fc_wwn));	memcpy (&s->port[1].fc.wwn_node, &s->wwn, sizeof (fc_wwn));	SOD(("Got wwns %08x%08x ports %08x%08x and %08x%08x\n", 	     *(u32 *)&s->port[0].fc.wwn_nport, s->port[0].fc.wwn_nport.lo,	     *(u32 *)&s->port[0].fc.wwn_nport, s->port[0].fc.wwn_nport.lo,	     *(u32 *)&s->port[1].fc.wwn_nport, s->port[1].fc.wwn_nport.lo))			s->port[0].fc.sid = 1;	s->port[1].fc.sid = 17;	s->port[0].fc.did = 2;	s->port[1].fc.did = 18;		s->port[0].fc.reset = soc_reset;	s->port[1].fc.reset = soc_reset;		if (sdev->num_registers == 1) {		/* Probably SunFire onboard SOC */		s->xram = sbus_ioremap(&sdev->resource[0], 0,				       0x10000UL, "soc xram");		s->regs = sbus_ioremap(&sdev->resource[0], 0x10000UL,				       0x10UL, "soc regs");	} else {		/* Probably SOC sbus card */		s->xram = sbus_ioremap(&sdev->resource[1], 0,				       sdev->reg_addrs[1].reg_size, "soc xram");		s->regs = sbus_ioremap(&sdev->resource[2], 0,				       sdev->reg_addrs[2].reg_size, "soc regs");	}		soc_init_bursts(s, sdev);		SOD(("Disabling SOC\n"))		soc_disable (s);		irq = sdev->irqs[0];	if (request_irq (irq, soc_intr, SA_SHIRQ, "SOC", (void *)s)) {		soc_printk ("Cannot order irq %d to go\n", irq);		socs = s->next;		return;	}	SOD(("SOC uses IRQ%s\n", __irq_itoa(irq)))		s->port[0].fc.irq = irq;	s->port[1].fc.irq = irq;		sprintf (s->port[0].fc.name, "soc%d port A", no);	sprintf (s->port[1].fc.name, "soc%d port B", no);	s->port[0].flags = SOC_FC_HDR | SOC_PORT_A;	s->port[1].flags = SOC_FC_HDR | SOC_PORT_B;	s->port[1].mask = (1 << 11);		s->port[0].fc.hw_enque = soc_hw_enque;	s->port[1].fc.hw_enque = soc_hw_enque;		soc_download_fw (s);		SOD(("Downloaded firmware\n"))	/* Now setup xram circular queues */	memset (cq, 0, sizeof(cq));		size = (SOC_CQ_REQ0_SIZE + SOC_CQ_REQ1_SIZE) * sizeof(soc_req);	s->req_cpu = sbus_alloc_consistent(sdev, size, &s->req_dvma);	s->req[0].pool = s->req_cpu;	cq[0].address = s->req_dvma;	s->req[1].pool = s->req[0].pool + SOC_CQ_REQ0_SIZE;		s->req[0].hw_cq = (soc_hw_cq __iomem *)(s->xram + SOC_CQ_REQ_OFFSET);	s->req[1].hw_cq = (soc_hw_cq __iomem *)(s->xram + SOC_CQ_REQ_OFFSET + sizeof(soc_hw_cq));	s->rsp[0].hw_cq = (soc_hw_cq __iomem *)(s->xram + SOC_CQ_RSP_OFFSET);	s->rsp[1].hw_cq = (soc_hw_cq __iomem *)(s->xram + SOC_CQ_RSP_OFFSET + sizeof(soc_hw_cq));		cq[1].address = cq[0].address + (SOC_CQ_REQ0_SIZE * sizeof(soc_req));	cq[4].address = 1;	cq[5].address = 1;	cq[0].last = SOC_CQ_REQ0_SIZE - 1;	cq[1].last = SOC_CQ_REQ1_SIZE - 1;	cq[4].last = SOC_CQ_RSP0_SIZE - 1;	cq[5].last = SOC_CQ_RSP1_SIZE - 1;	for (i = 0; i < 8; i++)		cq[i].seqno = 1;		s->req[0].last = SOC_CQ_REQ0_SIZE - 1;	s->req[1].last = SOC_CQ_REQ1_SIZE - 1;	s->rsp[0].last = SOC_CQ_RSP0_SIZE - 1;	s->rsp[1].last = SOC_CQ_RSP1_SIZE - 1;		s->req[0].seqno = 1;	s->req[1].seqno = 1;	s->rsp[0].seqno = 1;	s->rsp[1].seqno = 1;	xram_copy_to (s->xram + SOC_CQ_REQ_OFFSET, cq, sizeof(cq));		/* Make our sw copy of SOC service parameters */	xram_copy_from (s->serv_params, s->xram + 0x140, sizeof (s->serv_params));		s->port[0].fc.common_svc = (common_svc_parm *)s->serv_params;	s->port[0].fc.class_svcs = (svc_parm *)(s->serv_params + 0x20);	s->port[1].fc.common_svc = (common_svc_parm *)&s->serv_params;	s->port[1].fc.class_svcs = (svc_parm *)(s->serv_params + 0x20);		soc_enable (s);		SOD(("Enabled SOC\n"))}