Commit bb0d0927 authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] ppc64: fix to viopath.c

From: Anton Blanchard <anton@samba.org>

From: Olaf Hering and Nathan Lynch:

Fix a couple of nasty lurking bugs in viopath.c and add information
required to know if the iseries_veth module should be loaded on legacy
iSeries systems.
parent 55d130a5
......@@ -190,6 +190,8 @@ static unsigned char e2a(unsigned char x)
static int proc_viopath_show(struct seq_file *m, void *v)
{
char *buf;
u16 vlanMap;
int vlanIndex;
dma_addr_t handle;
HvLpEvent_Rc hvrc;
DECLARE_MUTEX_LOCKED(Semaphore);
......@@ -216,12 +218,18 @@ static int proc_viopath_show(struct seq_file *m, void *v)
down(&Semaphore);
dma_unmap_single(iSeries_vio_dev, handle, PAGE_SIZE, DMA_FROM_DEVICE);
kfree(buf);
vlanMap = HvLpConfig_getVirtualLanIndexMap();
vlanIndex = 0;
while (vlanMap != 0){
if (vlanMap & 0x8000)
vlanIndex++;;
vlanMap = vlanMap << 1;
}
buf[PAGE_SIZE] = '\0';
buf[PAGE_SIZE-1] = '\0';
seq_printf(m, "%s", buf);
seq_printf(m, "AVAILABLE_VETH=%d\n", vlanIndex );
seq_printf(m, "SRLNBR=%c%c%c%c%c%c%c\n",
e2a(xItExtVpdPanel.mfgID[2]),
e2a(xItExtVpdPanel.mfgID[3]),
......@@ -231,6 +239,9 @@ static int proc_viopath_show(struct seq_file *m, void *v)
e2a(xItExtVpdPanel.systemSerial[4]),
e2a(xItExtVpdPanel.systemSerial[5]));
dma_unmap_single(iSeries_vio_dev, handle, PAGE_SIZE, DMA_FROM_DEVICE);
kfree(buf);
return 0;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment