mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* Problems with Recent Patches to IDE Driver
@ 2010-08-13 14:41 Jon E
  2010-08-15 20:28 ` Alan Cox
  0 siblings, 1 reply; 4+ messages in thread
From: Jon E @ 2010-08-13 14:41 UTC (permalink / raw)
  To: linux-kernel



Hi,
 
We manufacture an interface board for our product that utilizes the IDE interface.  A couple of patches were made (back in 2008, kernel 2.6.30 series) to the IDE driver code that are now causing us some grief as we port our driver from kernel 2.6.15 to 2.6.32 (FC5 to Ubuntu LL).
 
1. Refer to http://git.kernel.org/?p=linux/kernel/git/stable/linux-2.6.30.y.git;a=commit;h=dafd01cc14a38690c87981eb2670d9c95f799ffd
 
A change was made to include/linux/hdreg.h that wrapped the WIN_xx macros in #ifndef/#endif __KERNEL__.  Our code utilized those macros and now no longer builds.
 
The area of code in oiur driver modules that's affected:

...
        // If writing to Audio card, indicate which Audio Channel
        if ((!reading) && (!DMAIPData))
        {
            outb(to_channel(CardAndChannel), LCYL_REG);
        }
        outb(reading ? WIN_READDMA : WIN_WRITEDMA, COMMAND_REG);
    case ide_dma_begin:
        outb(inb(dma_base)|1, dma_base); // start DMA 
        return 0;
    case ide_dma_end: // returns 1 on error, 0 otherwise 
...
 
The driver is built as a kernel module.  I'm not defining __KERNEL__ in my Makefile but the make process is picking up __KERNEL__ from /lib/modules/2.6.32-24-generic/build/Makefile and so, the compile fails thus:
 
ideDriver.c: In function ‘DmaProc’:
ideDriver.c:4208: error: ‘WIN_READDMA’ undeclared (first use in this function)
ideDriver.c:4208: error: (Each undeclared identifier is reported only once
ideDriver.c:4208: error: for each function it appears in.)
ideDriver.c:4208: error: ‘WIN_WRITEDMA’ undeclared (first use in this function)
ideDriver.o] Error 1
 
2. Refer to http://git.kernel.org/?p=linux/kernel/git/stable/linux-2.6.30.y.git;a=commitdiff;h=18de10170df31d34b342612f1c896a16a52f0a5c
 
It seems that the ide_hwifs master data array has been removed from ide.h.  We're using this array in our code and I'm not sure how to code around the fact that it's no longer present.
 
Our code:
 
    for (h = 0; h < MAX_HWIFS; ++h)
    {
        ide_hwif_t *hwif = &ide_hwifs[h];
        if (hwif->major == IDEMajor[whichController])
        {
            IDEDrive = &hwif->drives[0];
            break;
        }
    }
 
I've googled for some answers but it seems there are no suggested workarounds for these problems.  Perhaps someone reading this can offer some suggestions?
 
Thanks,
Jon 		 	   		  

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2010-08-18 13:50 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-08-13 14:41 Problems with Recent Patches to IDE Driver Jon E
2010-08-15 20:28 ` Alan Cox
2010-08-16 14:50   ` Jon E
2010-08-18 13:50     ` Jon E

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®