aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/mesh.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/scsi/mesh.c')
-rw-r--r--drivers/scsi/mesh.c23
1 files changed, 15 insertions, 8 deletions
diff --git a/drivers/scsi/mesh.c b/drivers/scsi/mesh.c
index f852421002e..683fc7ae4b8 100644
--- a/drivers/scsi/mesh.c
+++ b/drivers/scsi/mesh.c
@@ -18,7 +18,6 @@
18 * - retry arbitration if lost (unless higher levels do this for us) 18 * - retry arbitration if lost (unless higher levels do this for us)
19 * - power down the chip when no device is detected 19 * - power down the chip when no device is detected
20 */ 20 */
21#include <linux/config.h>
22#include <linux/module.h> 21#include <linux/module.h>
23#include <linux/kernel.h> 22#include <linux/kernel.h>
24#include <linux/delay.h> 23#include <linux/delay.h>
@@ -1269,7 +1268,7 @@ static void set_dma_cmds(struct mesh_state *ms, struct scsi_cmnd *cmd)
1269 if (cmd->use_sg > 0) { 1268 if (cmd->use_sg > 0) {
1270 int nseg; 1269 int nseg;
1271 total = 0; 1270 total = 0;
1272 scl = (struct scatterlist *) cmd->buffer; 1271 scl = (struct scatterlist *) cmd->request_buffer;
1273 off = ms->data_ptr; 1272 off = ms->data_ptr;
1274 nseg = pci_map_sg(ms->pdev, scl, cmd->use_sg, 1273 nseg = pci_map_sg(ms->pdev, scl, cmd->use_sg,
1275 cmd->sc_data_direction); 1274 cmd->sc_data_direction);
@@ -1757,16 +1756,23 @@ static void set_mesh_power(struct mesh_state *ms, int state)
1757 pmac_call_feature(PMAC_FTR_MESH_ENABLE, macio_get_of_node(ms->mdev), 0, 0); 1756 pmac_call_feature(PMAC_FTR_MESH_ENABLE, macio_get_of_node(ms->mdev), 0, 0);
1758 msleep(10); 1757 msleep(10);
1759 } 1758 }
1760} 1759}
1761 1760
1762 1761
1763#ifdef CONFIG_PM 1762#ifdef CONFIG_PM
1764static int mesh_suspend(struct macio_dev *mdev, pm_message_t state) 1763static int mesh_suspend(struct macio_dev *mdev, pm_message_t mesg)
1765{ 1764{
1766 struct mesh_state *ms = (struct mesh_state *)macio_get_drvdata(mdev); 1765 struct mesh_state *ms = (struct mesh_state *)macio_get_drvdata(mdev);
1767 unsigned long flags; 1766 unsigned long flags;
1768 1767
1769 if (state.event == mdev->ofdev.dev.power.power_state.event || state.event < 2) 1768 switch (mesg.event) {
1769 case PM_EVENT_SUSPEND:
1770 case PM_EVENT_FREEZE:
1771 break;
1772 default:
1773 return 0;
1774 }
1775 if (mesg.event == mdev->ofdev.dev.power.power_state.event)
1770 return 0; 1776 return 0;
1771 1777
1772 scsi_block_requests(ms->host); 1778 scsi_block_requests(ms->host);
@@ -1781,7 +1787,7 @@ static int mesh_suspend(struct macio_dev *mdev, pm_message_t state)
1781 disable_irq(ms->meshintr); 1787 disable_irq(ms->meshintr);
1782 set_mesh_power(ms, 0); 1788 set_mesh_power(ms, 0);
1783 1789
1784 mdev->ofdev.dev.power.power_state = state; 1790 mdev->ofdev.dev.power.power_state = mesg;
1785 1791
1786 return 0; 1792 return 0;
1787} 1793}
@@ -1851,7 +1857,8 @@ static int mesh_probe(struct macio_dev *mdev, const struct of_device_id *match)
1851{ 1857{
1852 struct device_node *mesh = macio_get_of_node(mdev); 1858 struct device_node *mesh = macio_get_of_node(mdev);
1853 struct pci_dev* pdev = macio_get_pci_dev(mdev); 1859 struct pci_dev* pdev = macio_get_pci_dev(mdev);
1854 int tgt, *cfp, minper; 1860 int tgt, minper;
1861 const int *cfp;
1855 struct mesh_state *ms; 1862 struct mesh_state *ms;
1856 struct Scsi_Host *mesh_host; 1863 struct Scsi_Host *mesh_host;
1857 void *dma_cmd_space; 1864 void *dma_cmd_space;
@@ -1940,7 +1947,7 @@ static int mesh_probe(struct macio_dev *mdev, const struct of_device_id *match)
1940 ms->tgts[tgt].current_req = NULL; 1947 ms->tgts[tgt].current_req = NULL;
1941 } 1948 }
1942 1949
1943 if ((cfp = (int *) get_property(mesh, "clock-frequency", NULL))) 1950 if ((cfp = get_property(mesh, "clock-frequency", NULL)))
1944 ms->clk_freq = *cfp; 1951 ms->clk_freq = *cfp;
1945 else { 1952 else {
1946 printk(KERN_INFO "mesh: assuming 50MHz clock frequency\n"); 1953 printk(KERN_INFO "mesh: assuming 50MHz clock frequency\n");