+ {
+ char * buffer = kmalloc(512, GFP_KERNEL|__GFP_DMA);
+ struct POSTSTATUS {
+ u32 Post_Command;
+ u32 Post_Address;
+ } * post = kmalloc(sizeof(struct POSTSTATUS), GFP_KERNEL);
+ dma_addr_t paddr = pci_map_single(dev->pdev, post, sizeof(struct POSTSTATUS), 2);
+ dma_addr_t baddr = pci_map_single(dev->pdev, buffer, 512, 1);
+ u32 status = -1;
+ int ret = -2;
+
+ memset(buffer, 0, 512);
+ post->Post_Command = cpu_to_le32(COMMAND_POST_RESULTS);
+ post->Post_Address = cpu_to_le32(baddr);
+ rkt_writel(dev, MUnit.IMRx[0], cpu_to_le32(paddr));
+ rkt_sync_cmd(dev, COMMAND_POST_RESULTS, baddr, &status);
+ pci_unmap_single(dev->pdev, paddr, sizeof(struct POSTSTATUS),2);
+ kfree(post);
+ if ((buffer[0] == '0') && (buffer[1] == 'x')) {
+ ret = (buffer[2] <= '9') ? (buffer[2] - '0') : (buffer[2] - 'A' + 10);
+ ret <<= 4;
+ ret += (buffer[3] <= '9') ? (buffer[3] - '0') : (buffer[3] - 'A' + 10);
+ }
+ pci_unmap_single(dev->pdev, baddr, 512, 1);
+ kfree(buffer);
+ return ret;
+ }