Skip to contentSkip to conversation

PATCH: Allow per driver taskfile filters

PATCH Alan Cox 2 participants 5 messages Nov 5, 2004 – Nov 6, 2004 libata

lore
Share & tools
lore

Alan Cox

author
#0 lore raw

This is needed for the IT8212 merge

include/linux/ide.h +4 -0
diff --exclude-from /usr/src/exclude -u --new-file --recursive linux.vanilla-2.6.10rc1/include/linux/ide.h linux-2.6.10rc1/include/linux/ide.h
@@ -794,6 +795,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 */
@@ -856,6 +858,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);
@@ -1374,6 +1378,7 @@
 extern ide_startstop_t task_out_intr(ide_drive_t *);
 
 extern int ide_raw_taskfile(ide_drive_t *, ide_task_t *, u8 *);
+extern int ide_diag_taskfile(ide_drive_t *, ide_task_t *, unsigned long, u8 *);
 
 int ide_taskfile_ioctl(ide_drive_t *, unsigned int, unsigned long);
 int ide_cmd_ioctl(ide_drive_t *, unsigned int, unsigned long);
drivers/ide/ide.c +1 -0
diff --exclude-from /usr/src/exclude -u --new-file --recursive linux.vanilla-2.6.10rc1/drivers/ide/ide.c linux-2.6.10rc1/drivers/ide/ide.c
@@ -678,6 +678,7 @@
 	hwif->maskproc			= tmp_hwif->maskproc;
 	hwif->quirkproc			= tmp_hwif->quirkproc;
 	hwif->busproc			= tmp_hwif->busproc;
+	hwif->raw_taskfile		= tmp_hwif->raw_taskfile;
 
 	hwif->ata_input_data		= tmp_hwif->ata_input_data;
 	hwif->ata_output_data		= tmp_hwif->ata_output_data;
drivers/ide/ide-taskfile.c +5 -1
diff --exclude-from /usr/src/exclude -u --new-file --recursive linux.vanilla-2.6.10rc1/drivers/ide/ide-taskfile.c linux-2.6.10rc1/drivers/ide/ide-taskfile.c
@@ -511,7 +511,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);
#1 lore raw

This covers ide_raw_taskfile() calls, what with do_rw_taskfile() ones and HDIO_DRIVE_[CMD,TASK,TASKFILE] ioctls?

Quoted 1 line · Alan Cox

This is needed for the IT8212 merge

BTW IT8212 is (also) a real hardware RAID and it really deserves
its own driver in the future (can share code with libata).

What is missing in libata to handle it?

Quoted 57 lines

diff --exclude-from /usr/src/exclude -u --new-file --recursive linux.vanilla-2.6.10rc1/include/linux/ide.h linux-2.6.10rc1/include/linux/ide.h

include/linux/ide.h +4 -0
@@ -794,6 +795,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 */
@@ -856,6 +858,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);
@@ -1374,6 +1378,7 @@
 extern ide_startstop_t task_out_intr(ide_drive_t *);
 
 extern int ide_raw_taskfile(ide_drive_t *, ide_task_t *, u8 *);
+extern int ide_diag_taskfile(ide_drive_t *, ide_task_t *, unsigned long, u8 *);
 
 int ide_taskfile_ioctl(ide_drive_t *, unsigned int, unsigned long);
 int ide_cmd_ioctl(ide_drive_t *, unsigned int, unsigned long);

diff --exclude-from /usr/src/exclude -u --new-file --recursive linux.vanilla-2.6.10rc1/drivers/ide/ide.c linux-2.6.10rc1/drivers/ide/ide.c

drivers/ide/ide.c +1 -0
@@ -678,6 +678,7 @@
 	hwif->maskproc			= tmp_hwif->maskproc;
 	hwif->quirkproc			= tmp_hwif->quirkproc;
 	hwif->busproc			= tmp_hwif->busproc;
+	hwif->raw_taskfile		= tmp_hwif->raw_taskfile;
 
 	hwif->ata_input_data		= tmp_hwif->ata_input_data;
 	hwif->ata_output_data		= tmp_hwif->ata_output_data;

diff --exclude-from /usr/src/exclude -u --new-file --recursive linux.vanilla-2.6.10rc1/drivers/ide/ide-taskfile.c linux-2.6.10rc1/drivers/ide/ide-taskfile.c

drivers/ide/ide-taskfile.c +5 -1
@@ -511,7 +511,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);
author
#2 lore raw
Quoted 2 lines · Bartlomiej Zolnierkiewicz

This covers ide_raw_taskfile() calls, what with do_rw_taskfile() ones and HDIO_DRIVE_[CMD,TASK,TASKFILE] ioctls?

do_rw_taskfile could be filtered. I'm not clear if filtering the HDIO ones
is the right thing to do

Quoted 4 lines

BTW IT8212 is (also) a real hardware RAID and it really deserves
its own driver in the future (can share code with libata).

What is missing in libata to handle it?

ATAPI, working blacklists, testing, the same as to move every other driver over. When the rest move it can.

#3 lore raw
Quoted 8 lines · Alan Cox
Quoted 2 lines · Bartlomiej Zolnierkiewicz

This covers ide_raw_taskfile() calls, what with do_rw_taskfile() ones and HDIO_DRIVE_[CMD,TASK,TASKFILE] ioctls?

do_rw_taskfile could be filtered. I'm not clear if filtering the HDIO ones
is the right thing to do

Quoted 7 lines
Quoted 4 lines

BTW IT8212 is (also) a real hardware RAID and it really deserves
its own driver in the future (can share code with libata).

What is missing in libata to handle it?

ATAPI, working blacklists, testing, the same as to move every other driver over. When the rest move it can.

* ATAPI is done and working (both PIO and DMA)
* half of the blacklists is a crap (but I don't know which half :( )

BTW this is a _new_ driver so it is much easier to move

author
#4 lore raw
Quoted 4 lines · Bartlomiej Zolnierkiewicz

* ATAPI is done and working (both PIO and DMA)
* half of the blacklists is a crap (but I don't know which half :( )

BTW this is a _new_ driver so it is much easier to move

Its not on my schedule. Someone else can do it, but I'd suggest instead that they spend their time helping Jeff get stuff like the Marvell driver up and running first. Good to hear ATAPI now works with the SATA stuff.

Alan