diff options
author | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2007-05-09 18:01:10 -0400 |
---|---|---|
committer | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2007-05-09 18:01:10 -0400 |
commit | 1497943ee692aa7519fa972d0e3a339649bf3a96 (patch) | |
tree | dc70ee9731f66dd323ddb397380b62c0c2977add /include | |
parent | ecfd80e4a514123070b4cfb674b817ba75055df2 (diff) |
ide: split off ioctl handling from IDE settings (v2)
* do write permission and min/max checks in ide_procset_t functions
* ide-disk.c: drive->id is always available so cleanup "multcount" setting
accordingly
* ide-disk.c: "address" setting was incorrectly defined as type TYPE_INTA,
fix it by using type TYPE_BYTE and updating ide_drive_t->adressing field,
the bug didn't trigger because this IDE setting uses custom ->set function
* ide.c: add set_ksettings() for handling HDIO_SET_KEEPSETTINGS ioctl
* ide.c: add set_unmaskirq() for handling HDIO_SET_UNMASKINTR ioctl
* handle ioctls directly in generic_ide_ioclt() and idedisk_ioctl()
instead of using IDE settings to deal with them
* remove no longer needed ide_find_setting_by_ioctl() and {read,write}_ioctl
fields from ide_settings_t, also remove now unused TYPE_INTA handling
v2:
* add missing EXPORT_SYMBOL_GPL(ide_setting_sem) needed now for ide-disk
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/ide.h | 16 |
1 files changed, 4 insertions, 12 deletions
diff --git a/include/linux/ide.h b/include/linux/ide.h index 697c39dd66a1..591a0b55e31c 100644 --- a/include/linux/ide.h +++ b/include/linux/ide.h | |||
@@ -601,16 +601,11 @@ typedef struct ide_drive_s { | |||
601 | unsigned remap_0_to_1 : 1; /* 0=noremap, 1=remap 0->1 (for EZDrive) */ | 601 | unsigned remap_0_to_1 : 1; /* 0=noremap, 1=remap 0->1 (for EZDrive) */ |
602 | unsigned blocked : 1; /* 1=powermanagment told us not to do anything, so sleep nicely */ | 602 | unsigned blocked : 1; /* 1=powermanagment told us not to do anything, so sleep nicely */ |
603 | unsigned vdma : 1; /* 1=doing PIO over DMA 0=doing normal DMA */ | 603 | unsigned vdma : 1; /* 1=doing PIO over DMA 0=doing normal DMA */ |
604 | unsigned addressing; /* : 3; | ||
605 | * 0=28-bit | ||
606 | * 1=48-bit | ||
607 | * 2=48-bit doing 28-bit | ||
608 | * 3=64-bit | ||
609 | */ | ||
610 | unsigned scsi : 1; /* 0=default, 1=ide-scsi emulation */ | 604 | unsigned scsi : 1; /* 0=default, 1=ide-scsi emulation */ |
611 | unsigned sleeping : 1; /* 1=sleeping & sleep field valid */ | 605 | unsigned sleeping : 1; /* 1=sleeping & sleep field valid */ |
612 | unsigned post_reset : 1; | 606 | unsigned post_reset : 1; |
613 | 607 | ||
608 | u8 addressing; /* 0=28-bit, 1=48-bit, 2=48-bit doing 28-bit */ | ||
614 | u8 quirk_list; /* considered quirky, set for a specific host */ | 609 | u8 quirk_list; /* considered quirky, set for a specific host */ |
615 | u8 init_speed; /* transfer rate set at boot */ | 610 | u8 init_speed; /* transfer rate set at boot */ |
616 | u8 current_speed; /* current transfer rate set */ | 611 | u8 current_speed; /* current transfer rate set */ |
@@ -870,9 +865,8 @@ typedef struct hwgroup_s { | |||
870 | */ | 865 | */ |
871 | 866 | ||
872 | #define TYPE_INT 0 | 867 | #define TYPE_INT 0 |
873 | #define TYPE_INTA 1 | 868 | #define TYPE_BYTE 1 |
874 | #define TYPE_BYTE 2 | 869 | #define TYPE_SHORT 2 |
875 | #define TYPE_SHORT 3 | ||
876 | 870 | ||
877 | #define SETTING_READ (1 << 0) | 871 | #define SETTING_READ (1 << 0) |
878 | #define SETTING_WRITE (1 << 1) | 872 | #define SETTING_WRITE (1 << 1) |
@@ -882,8 +876,6 @@ typedef int (ide_procset_t)(ide_drive_t *, int); | |||
882 | typedef struct ide_settings_s { | 876 | typedef struct ide_settings_s { |
883 | char *name; | 877 | char *name; |
884 | int rw; | 878 | int rw; |
885 | int read_ioctl; | ||
886 | int write_ioctl; | ||
887 | int data_type; | 879 | int data_type; |
888 | int min; | 880 | int min; |
889 | int max; | 881 | int max; |
@@ -896,7 +888,7 @@ typedef struct ide_settings_s { | |||
896 | } ide_settings_t; | 888 | } ide_settings_t; |
897 | 889 | ||
898 | extern struct semaphore ide_setting_sem; | 890 | extern struct semaphore ide_setting_sem; |
899 | extern int ide_add_setting(ide_drive_t *drive, const char *name, int rw, int read_ioctl, int write_ioctl, int data_type, int min, int max, int mul_factor, int div_factor, void *data, ide_procset_t *set); | 891 | int ide_add_setting(ide_drive_t *, const char *, int, int, int, int, int, int, void *, ide_procset_t *set); |
900 | extern ide_settings_t *ide_find_setting_by_name(ide_drive_t *drive, char *name); | 892 | extern ide_settings_t *ide_find_setting_by_name(ide_drive_t *drive, char *name); |
901 | extern int ide_read_setting(ide_drive_t *t, ide_settings_t *setting); | 893 | extern int ide_read_setting(ide_drive_t *t, ide_settings_t *setting); |
902 | extern int ide_write_setting(ide_drive_t *drive, ide_settings_t *setting, int val); | 894 | extern int ide_write_setting(ide_drive_t *drive, ide_settings_t *setting, int val); |