aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/libata.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/libata.h')
-rw-r--r--include/linux/libata.h32
1 files changed, 16 insertions, 16 deletions
diff --git a/include/linux/libata.h b/include/linux/libata.h
index 634b5aa0a615..00a8a5738858 100644
--- a/include/linux/libata.h
+++ b/include/linux/libata.h
@@ -202,7 +202,7 @@ struct ata_ioports {
202struct ata_probe_ent { 202struct ata_probe_ent {
203 struct list_head node; 203 struct list_head node;
204 struct device *dev; 204 struct device *dev;
205 struct ata_port_operations *port_ops; 205 const struct ata_port_operations *port_ops;
206 Scsi_Host_Template *sht; 206 Scsi_Host_Template *sht;
207 struct ata_ioports port[ATA_MAX_PORTS]; 207 struct ata_ioports port[ATA_MAX_PORTS];
208 unsigned int n_ports; 208 unsigned int n_ports;
@@ -225,7 +225,7 @@ struct ata_host_set {
225 void __iomem *mmio_base; 225 void __iomem *mmio_base;
226 unsigned int n_ports; 226 unsigned int n_ports;
227 void *private_data; 227 void *private_data;
228 struct ata_port_operations *ops; 228 const struct ata_port_operations *ops;
229 struct ata_port * ports[0]; 229 struct ata_port * ports[0];
230}; 230};
231 231
@@ -294,7 +294,7 @@ struct ata_device {
294 294
295struct ata_port { 295struct ata_port {
296 struct Scsi_Host *host; /* our co-allocated scsi host */ 296 struct Scsi_Host *host; /* our co-allocated scsi host */
297 struct ata_port_operations *ops; 297 const struct ata_port_operations *ops;
298 unsigned long flags; /* ATA_FLAG_xxx */ 298 unsigned long flags; /* ATA_FLAG_xxx */
299 unsigned int id; /* unique id req'd by scsi midlyr */ 299 unsigned int id; /* unique id req'd by scsi midlyr */
300 unsigned int port_no; /* unique port #; from zero */ 300 unsigned int port_no; /* unique port #; from zero */
@@ -341,10 +341,10 @@ struct ata_port_operations {
341 void (*set_piomode) (struct ata_port *, struct ata_device *); 341 void (*set_piomode) (struct ata_port *, struct ata_device *);
342 void (*set_dmamode) (struct ata_port *, struct ata_device *); 342 void (*set_dmamode) (struct ata_port *, struct ata_device *);
343 343
344 void (*tf_load) (struct ata_port *ap, struct ata_taskfile *tf); 344 void (*tf_load) (struct ata_port *ap, const struct ata_taskfile *tf);
345 void (*tf_read) (struct ata_port *ap, struct ata_taskfile *tf); 345 void (*tf_read) (struct ata_port *ap, struct ata_taskfile *tf);
346 346
347 void (*exec_command)(struct ata_port *ap, struct ata_taskfile *tf); 347 void (*exec_command)(struct ata_port *ap, const struct ata_taskfile *tf);
348 u8 (*check_status)(struct ata_port *ap); 348 u8 (*check_status)(struct ata_port *ap);
349 u8 (*check_altstatus)(struct ata_port *ap); 349 u8 (*check_altstatus)(struct ata_port *ap);
350 u8 (*check_err)(struct ata_port *ap); 350 u8 (*check_err)(struct ata_port *ap);
@@ -385,7 +385,7 @@ struct ata_port_info {
385 unsigned long pio_mask; 385 unsigned long pio_mask;
386 unsigned long mwdma_mask; 386 unsigned long mwdma_mask;
387 unsigned long udma_mask; 387 unsigned long udma_mask;
388 struct ata_port_operations *port_ops; 388 const struct ata_port_operations *port_ops;
389}; 389};
390 390
391struct ata_timing { 391struct ata_timing {
@@ -413,7 +413,7 @@ extern int ata_pci_init_one (struct pci_dev *pdev, struct ata_port_info **port_i
413 unsigned int n_ports); 413 unsigned int n_ports);
414extern void ata_pci_remove_one (struct pci_dev *pdev); 414extern void ata_pci_remove_one (struct pci_dev *pdev);
415#endif /* CONFIG_PCI */ 415#endif /* CONFIG_PCI */
416extern int ata_device_add(struct ata_probe_ent *ent); 416extern int ata_device_add(const struct ata_probe_ent *ent);
417extern void ata_host_set_remove(struct ata_host_set *host_set); 417extern void ata_host_set_remove(struct ata_host_set *host_set);
418extern int ata_scsi_detect(Scsi_Host_Template *sht); 418extern int ata_scsi_detect(Scsi_Host_Template *sht);
419extern int ata_scsi_ioctl(struct scsi_device *dev, int cmd, void __user *arg); 419extern int ata_scsi_ioctl(struct scsi_device *dev, int cmd, void __user *arg);
@@ -426,16 +426,16 @@ extern int ata_ratelimit(void);
426/* 426/*
427 * Default driver ops implementations 427 * Default driver ops implementations
428 */ 428 */
429extern void ata_tf_load(struct ata_port *ap, struct ata_taskfile *tf); 429extern void ata_tf_load(struct ata_port *ap, const struct ata_taskfile *tf);
430extern void ata_tf_read(struct ata_port *ap, struct ata_taskfile *tf); 430extern void ata_tf_read(struct ata_port *ap, struct ata_taskfile *tf);
431extern void ata_tf_to_fis(struct ata_taskfile *tf, u8 *fis, u8 pmp); 431extern void ata_tf_to_fis(const struct ata_taskfile *tf, u8 *fis, u8 pmp);
432extern void ata_tf_from_fis(u8 *fis, struct ata_taskfile *tf); 432extern void ata_tf_from_fis(const u8 *fis, struct ata_taskfile *tf);
433extern void ata_noop_dev_select (struct ata_port *ap, unsigned int device); 433extern void ata_noop_dev_select (struct ata_port *ap, unsigned int device);
434extern void ata_std_dev_select (struct ata_port *ap, unsigned int device); 434extern void ata_std_dev_select (struct ata_port *ap, unsigned int device);
435extern u8 ata_check_status(struct ata_port *ap); 435extern u8 ata_check_status(struct ata_port *ap);
436extern u8 ata_altstatus(struct ata_port *ap); 436extern u8 ata_altstatus(struct ata_port *ap);
437extern u8 ata_chk_err(struct ata_port *ap); 437extern u8 ata_chk_err(struct ata_port *ap);
438extern void ata_exec_command(struct ata_port *ap, struct ata_taskfile *tf); 438extern void ata_exec_command(struct ata_port *ap, const struct ata_taskfile *tf);
439extern int ata_port_start (struct ata_port *ap); 439extern int ata_port_start (struct ata_port *ap);
440extern void ata_port_stop (struct ata_port *ap); 440extern void ata_port_stop (struct ata_port *ap);
441extern void ata_host_stop (struct ata_host_set *host_set); 441extern void ata_host_stop (struct ata_host_set *host_set);
@@ -446,8 +446,8 @@ extern void ata_sg_init_one(struct ata_queued_cmd *qc, void *buf,
446 unsigned int buflen); 446 unsigned int buflen);
447extern void ata_sg_init(struct ata_queued_cmd *qc, struct scatterlist *sg, 447extern void ata_sg_init(struct ata_queued_cmd *qc, struct scatterlist *sg,
448 unsigned int n_elem); 448 unsigned int n_elem);
449extern unsigned int ata_dev_classify(struct ata_taskfile *tf); 449extern unsigned int ata_dev_classify(const struct ata_taskfile *tf);
450extern void ata_dev_id_string(u16 *id, unsigned char *s, 450extern void ata_dev_id_string(const u16 *id, unsigned char *s,
451 unsigned int ofs, unsigned int len); 451 unsigned int ofs, unsigned int len);
452extern void ata_dev_config(struct ata_port *ap, unsigned int i); 452extern void ata_dev_config(struct ata_port *ap, unsigned int i);
453extern void ata_bmdma_setup (struct ata_queued_cmd *qc); 453extern void ata_bmdma_setup (struct ata_queued_cmd *qc);
@@ -502,7 +502,7 @@ struct pci_bits {
502extern void ata_pci_host_stop (struct ata_host_set *host_set); 502extern void ata_pci_host_stop (struct ata_host_set *host_set);
503extern struct ata_probe_ent * 503extern struct ata_probe_ent *
504ata_pci_init_native_mode(struct pci_dev *pdev, struct ata_port_info **port, int portmask); 504ata_pci_init_native_mode(struct pci_dev *pdev, struct ata_port_info **port, int portmask);
505extern int pci_test_config_bits(struct pci_dev *pdev, struct pci_bits *bits); 505extern int pci_test_config_bits(struct pci_dev *pdev, const struct pci_bits *bits);
506 506
507#endif /* CONFIG_PCI */ 507#endif /* CONFIG_PCI */
508 508
@@ -512,7 +512,7 @@ static inline unsigned int ata_tag_valid(unsigned int tag)
512 return (tag < ATA_MAX_QUEUE) ? 1 : 0; 512 return (tag < ATA_MAX_QUEUE) ? 1 : 0;
513} 513}
514 514
515static inline unsigned int ata_dev_present(struct ata_device *dev) 515static inline unsigned int ata_dev_present(const struct ata_device *dev)
516{ 516{
517 return ((dev->class == ATA_DEV_ATA) || 517 return ((dev->class == ATA_DEV_ATA) ||
518 (dev->class == ATA_DEV_ATAPI)); 518 (dev->class == ATA_DEV_ATAPI));
@@ -711,7 +711,7 @@ static inline unsigned int sata_dev_present(struct ata_port *ap)
711 return ((scr_read(ap, SCR_STATUS) & 0xf) == 0x3) ? 1 : 0; 711 return ((scr_read(ap, SCR_STATUS) & 0xf) == 0x3) ? 1 : 0;
712} 712}
713 713
714static inline int ata_try_flush_cache(struct ata_device *dev) 714static inline int ata_try_flush_cache(const struct ata_device *dev)
715{ 715{
716 return ata_id_wcache_enabled(dev->id) || 716 return ata_id_wcache_enabled(dev->id) ||
717 ata_id_has_flush(dev->id) || 717 ata_id_has_flush(dev->id) ||