Re: PATCH: (Test) it8212 driver for 2.6.9rc3

From: Alan Cox
Date: Thu Sep 30 2004 - 17:08:54 EST


On Fri, Oct 01, 2004 at 12:01:27AM +0200, Bartlomiej Zolnierkiewicz wrote:
> > I'd prefer to keep it (there are likely to be some related devices from
> > the databook)
>
> you can add it when needed

I think its needed. I'll keep it 8)

Ok first patch then. This adds raw_taskfile as a hook allowing a driver to
filter, mangle (or indeed just throw debug) on taskfile commands being
issued. (Note - ide_diag_taskfile has always been exported just never
used by a driver and missing in the headers..)

diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla-2.6.9rc3/drivers/ide/ide-taskfile.c linux-2.6.9rc3/drivers/ide/ide-taskfile.c
--- linux.vanilla-2.6.9rc3/drivers/ide/ide-taskfile.c 2004-09-30 16:13:08.058460344 +0100
+++ linux-2.6.9rc3/drivers/ide/ide-taskfile.c 2004-09-30 22:55:55.504450104 +0100
@@ -555,7 +555,11 @@

int ide_raw_taskfile (ide_drive_t *drive, ide_task_t *args, u8 *buf)
{
- return ide_diag_taskfile(drive, args, 0, buf);
+ ide_hwif_t *hwif = HWIF(drive);
+ if(hwif->raw_taskfile)
+ return hwif->raw_taskfile(drive, args, buf);
+ else
+ return ide_diag_taskfile(drive, args, 0, buf);
}

EXPORT_SYMBOL(ide_raw_taskfile);
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla-2.6.9rc3/include/linux/ide.h linux-2.6.9rc3/include/linux/ide.h
--- linux.vanilla-2.6.9rc3/include/linux/ide.h 2004-09-30 16:13:13.182681344 +0100
+++ linux-2.6.9rc3/include/linux/ide.h 2004-09-30 22:58:15.749129672 +0100
@@ -822,6 +822,7 @@
#define IDE_CHIPSET_IS_PCI(c) ((IDE_CHIPSET_PCI_MASK >> (c)) & 1)

struct ide_pci_device_s;
+struct ide_task_s;

typedef struct hwif_s {
struct hwif_s *next; /* for linked-list in ide_hwgroup_t */
@@ -886,6 +887,8 @@
// u8 (*ratemask)(ide_drive_t *);
// /* device rate limiter */
// u8 (*ratefilter)(ide_drive_t *, u8);
+ /* allow command filter/control */
+ int (*raw_taskfile)(ide_drive_t *, struct ide_task_s *, u8 *);
#endif

void (*ata_input_data)(ide_drive_t *, void *, u32);
@@ -1426,6 +1429,7 @@
extern ide_startstop_t pre_task_out_intr(ide_drive_t *, struct request *);
extern ide_startstop_t task_out_intr(ide_drive_t *);

+extern int ide_diag_taskfile(ide_drive_t *, ide_task_t *, unsigned long, u8 *);
extern int ide_raw_taskfile(ide_drive_t *, ide_task_t *, u8 *);

int ide_taskfile_ioctl(ide_drive_t *, unsigned int, unsigned long);
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/