-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Bartlomiej Zolnierkiewicz
committed
Oct 13, 2008
1 parent
1ddf183
commit e2e5062
Showing
7 changed files
with
74 additions
and
51 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
--- | ||
refs/heads/master: b9103da463f72d03c513acdb18f1aebd7931ed1e | ||
refs/heads/master: f87904898e91923a91b925078ac933f05076c7fd |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#ifndef __IDE_DISK_H | ||
#define __IDE_DISK_H | ||
|
||
struct ide_disk_obj { | ||
ide_drive_t *drive; | ||
ide_driver_t *driver; | ||
struct gendisk *disk; | ||
struct kref kref; | ||
unsigned int openers; /* protected by BKL for now */ | ||
}; | ||
|
||
#define ide_disk_g(disk) \ | ||
container_of((disk)->private_data, struct ide_disk_obj, driver) | ||
|
||
/* ide-disk.c */ | ||
ide_decl_devset(address); | ||
ide_decl_devset(multcount); | ||
ide_decl_devset(nowerr); | ||
ide_decl_devset(wcache); | ||
ide_decl_devset(acoustic); | ||
|
||
/* ide-disk_ioctl.c */ | ||
int ide_disk_ioctl(struct inode *, struct file *, unsigned int, unsigned long); | ||
|
||
#endif /* __IDE_DISK_H */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
#include <linux/kernel.h> | ||
#include <linux/ide.h> | ||
#include <linux/hdreg.h> | ||
|
||
#include "ide-disk.h" | ||
|
||
static const struct ide_ioctl_devset ide_disk_ioctl_settings[] = { | ||
{ HDIO_GET_ADDRESS, HDIO_SET_ADDRESS, &ide_devset_address }, | ||
{ HDIO_GET_MULTCOUNT, HDIO_SET_MULTCOUNT, &ide_devset_multcount }, | ||
{ HDIO_GET_NOWERR, HDIO_SET_NOWERR, &ide_devset_nowerr }, | ||
{ HDIO_GET_WCACHE, HDIO_SET_WCACHE, &ide_devset_wcache }, | ||
{ HDIO_GET_ACOUSTIC, HDIO_SET_ACOUSTIC, &ide_devset_acoustic }, | ||
{ 0 } | ||
}; | ||
|
||
int ide_disk_ioctl(struct inode *inode, struct file *file, | ||
unsigned int cmd, unsigned long arg) | ||
{ | ||
struct block_device *bdev = inode->i_bdev; | ||
struct ide_disk_obj *idkp = ide_disk_g(bdev->bd_disk); | ||
ide_drive_t *drive = idkp->drive; | ||
int err; | ||
|
||
err = ide_setting_ioctl(drive, bdev, cmd, arg, ide_disk_ioctl_settings); | ||
if (err != -EOPNOTSUPP) | ||
return err; | ||
|
||
return generic_ide_ioctl(drive, file, bdev, cmd, arg); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters