aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/scsi/megaraid/Makefile1
-rw-r--r--drivers/scsi/megaraid/megaraid_sas_base.c (renamed from drivers/scsi/megaraid/megaraid_sas.c)46
2 files changed, 24 insertions, 23 deletions
diff --git a/drivers/scsi/megaraid/Makefile b/drivers/scsi/megaraid/Makefile
index f469915b97c3..6613a2ceea03 100644
--- a/drivers/scsi/megaraid/Makefile
+++ b/drivers/scsi/megaraid/Makefile
@@ -1,3 +1,4 @@
1obj-$(CONFIG_MEGARAID_MM) += megaraid_mm.o 1obj-$(CONFIG_MEGARAID_MM) += megaraid_mm.o
2obj-$(CONFIG_MEGARAID_MAILBOX) += megaraid_mbox.o 2obj-$(CONFIG_MEGARAID_MAILBOX) += megaraid_mbox.o
3obj-$(CONFIG_MEGARAID_SAS) += megaraid_sas.o 3obj-$(CONFIG_MEGARAID_SAS) += megaraid_sas.o
4megaraid_sas-objs := megaraid_sas_base.o
diff --git a/drivers/scsi/megaraid/megaraid_sas.c b/drivers/scsi/megaraid/megaraid_sas_base.c
index 7451bc096a01..427f0f795947 100644
--- a/drivers/scsi/megaraid/megaraid_sas.c
+++ b/drivers/scsi/megaraid/megaraid_sas_base.c
@@ -167,7 +167,7 @@ megasas_return_cmd(struct megasas_instance *instance, struct megasas_cmd *cmd)
167 167
168 168
169/** 169/**
170* The following functions are defined for xscale 170* The following functions are defined for xscale
171* (deviceid : 1064R, PERC5) controllers 171* (deviceid : 1064R, PERC5) controllers
172*/ 172*/
173 173
@@ -210,7 +210,7 @@ megasas_read_fw_status_reg_xscale(struct megasas_register_set __iomem * regs)
210 * megasas_clear_interrupt_xscale - Check & clear interrupt 210 * megasas_clear_interrupt_xscale - Check & clear interrupt
211 * @regs: MFI register set 211 * @regs: MFI register set
212 */ 212 */
213static int 213static int
214megasas_clear_intr_xscale(struct megasas_register_set __iomem * regs) 214megasas_clear_intr_xscale(struct megasas_register_set __iomem * regs)
215{ 215{
216 u32 status; 216 u32 status;
@@ -243,7 +243,7 @@ megasas_clear_intr_xscale(struct megasas_register_set __iomem * regs)
243 * @frame_count : Number of frames for the command 243 * @frame_count : Number of frames for the command
244 * @regs : MFI register set 244 * @regs : MFI register set
245 */ 245 */
246static inline void 246static inline void
247megasas_fire_cmd_xscale(struct megasas_instance *instance, 247megasas_fire_cmd_xscale(struct megasas_instance *instance,
248 dma_addr_t frame_phys_addr, 248 dma_addr_t frame_phys_addr,
249 u32 frame_count, 249 u32 frame_count,
@@ -326,12 +326,12 @@ static struct megasas_instance_template megasas_instance_template_xscale = {
326}; 326};
327 327
328/** 328/**
329* This is the end of set of functions & definitions specific 329* This is the end of set of functions & definitions specific
330* to xscale (deviceid : 1064R, PERC5) controllers 330* to xscale (deviceid : 1064R, PERC5) controllers
331*/ 331*/
332 332
333/** 333/**
334* The following functions are defined for ppc (deviceid : 0x60) 334* The following functions are defined for ppc (deviceid : 0x60)
335* controllers 335* controllers
336*/ 336*/
337 337
@@ -343,7 +343,7 @@ static inline void
343megasas_enable_intr_ppc(struct megasas_register_set __iomem * regs) 343megasas_enable_intr_ppc(struct megasas_register_set __iomem * regs)
344{ 344{
345 writel(0xFFFFFFFF, &(regs)->outbound_doorbell_clear); 345 writel(0xFFFFFFFF, &(regs)->outbound_doorbell_clear);
346 346
347 writel(~0x80000000, &(regs)->outbound_intr_mask); 347 writel(~0x80000000, &(regs)->outbound_intr_mask);
348 348
349 /* Dummy readl to force pci flush */ 349 /* Dummy readl to force pci flush */
@@ -377,7 +377,7 @@ megasas_read_fw_status_reg_ppc(struct megasas_register_set __iomem * regs)
377 * megasas_clear_interrupt_ppc - Check & clear interrupt 377 * megasas_clear_interrupt_ppc - Check & clear interrupt
378 * @regs: MFI register set 378 * @regs: MFI register set
379 */ 379 */
380static int 380static int
381megasas_clear_intr_ppc(struct megasas_register_set __iomem * regs) 381megasas_clear_intr_ppc(struct megasas_register_set __iomem * regs)
382{ 382{
383 u32 status; 383 u32 status;
@@ -406,7 +406,7 @@ megasas_clear_intr_ppc(struct megasas_register_set __iomem * regs)
406 * @frame_count : Number of frames for the command 406 * @frame_count : Number of frames for the command
407 * @regs : MFI register set 407 * @regs : MFI register set
408 */ 408 */
409static inline void 409static inline void
410megasas_fire_cmd_ppc(struct megasas_instance *instance, 410megasas_fire_cmd_ppc(struct megasas_instance *instance,
411 dma_addr_t frame_phys_addr, 411 dma_addr_t frame_phys_addr,
412 u32 frame_count, 412 u32 frame_count,
@@ -414,7 +414,7 @@ megasas_fire_cmd_ppc(struct megasas_instance *instance,
414{ 414{
415 unsigned long flags; 415 unsigned long flags;
416 spin_lock_irqsave(&instance->hba_lock, flags); 416 spin_lock_irqsave(&instance->hba_lock, flags);
417 writel((frame_phys_addr | (frame_count<<1))|1, 417 writel((frame_phys_addr | (frame_count<<1))|1,
418 &(regs)->inbound_queue_port); 418 &(regs)->inbound_queue_port);
419 spin_unlock_irqrestore(&instance->hba_lock, flags); 419 spin_unlock_irqrestore(&instance->hba_lock, flags);
420} 420}
@@ -441,7 +441,7 @@ megasas_check_reset_ppc(struct megasas_instance *instance,
441 return 0; 441 return 0;
442} 442}
443static struct megasas_instance_template megasas_instance_template_ppc = { 443static struct megasas_instance_template megasas_instance_template_ppc = {
444 444
445 .fire_cmd = megasas_fire_cmd_ppc, 445 .fire_cmd = megasas_fire_cmd_ppc,
446 .enable_intr = megasas_enable_intr_ppc, 446 .enable_intr = megasas_enable_intr_ppc,
447 .disable_intr = megasas_disable_intr_ppc, 447 .disable_intr = megasas_disable_intr_ppc,
@@ -754,7 +754,7 @@ static struct megasas_instance_template megasas_instance_template_gen2 = {
754/** 754/**
755 * megasas_issue_polled - Issues a polling command 755 * megasas_issue_polled - Issues a polling command
756 * @instance: Adapter soft state 756 * @instance: Adapter soft state
757 * @cmd: Command packet to be issued 757 * @cmd: Command packet to be issued
758 * 758 *
759 * For polling, MFI requires the cmd_status to be set to 0xFF before posting. 759 * For polling, MFI requires the cmd_status to be set to 0xFF before posting.
760 */ 760 */
@@ -1242,9 +1242,9 @@ megasas_build_ldio(struct megasas_instance *instance, struct scsi_cmnd *scp,
1242/** 1242/**
1243 * megasas_is_ldio - Checks if the cmd is for logical drive 1243 * megasas_is_ldio - Checks if the cmd is for logical drive
1244 * @scmd: SCSI command 1244 * @scmd: SCSI command
1245 * 1245 *
1246 * Called by megasas_queue_command to find out if the command to be queued 1246 * Called by megasas_queue_command to find out if the command to be queued
1247 * is a logical drive command 1247 * is a logical drive command
1248 */ 1248 */
1249static inline int megasas_is_ldio(struct scsi_cmnd *cmd) 1249static inline int megasas_is_ldio(struct scsi_cmnd *cmd)
1250{ 1250{
@@ -2000,8 +2000,8 @@ megasas_complete_int_cmd(struct megasas_instance *instance,
2000 * @instance: Adapter soft state 2000 * @instance: Adapter soft state
2001 * @cmd: Cmd that was issued to abort another cmd 2001 * @cmd: Cmd that was issued to abort another cmd
2002 * 2002 *
2003 * The megasas_issue_blocked_abort_cmd() function waits on abort_cmd_wait_q 2003 * The megasas_issue_blocked_abort_cmd() function waits on abort_cmd_wait_q
2004 * after it issues an abort on a previously issued command. This function 2004 * after it issues an abort on a previously issued command. This function
2005 * wakes up all functions waiting on the same wait queue. 2005 * wakes up all functions waiting on the same wait queue.
2006 */ 2006 */
2007static void 2007static void
@@ -2021,7 +2021,7 @@ megasas_complete_abort(struct megasas_instance *instance,
2021 * megasas_complete_cmd - Completes a command 2021 * megasas_complete_cmd - Completes a command
2022 * @instance: Adapter soft state 2022 * @instance: Adapter soft state
2023 * @cmd: Command to be completed 2023 * @cmd: Command to be completed
2024 * @alt_status: If non-zero, use this value as status to 2024 * @alt_status: If non-zero, use this value as status to
2025 * SCSI mid-layer instead of the value returned 2025 * SCSI mid-layer instead of the value returned
2026 * by the FW. This should be used if caller wants 2026 * by the FW. This should be used if caller wants
2027 * an alternate status (as in the case of aborted 2027 * an alternate status (as in the case of aborted
@@ -2476,8 +2476,8 @@ megasas_transition_to_ready(struct megasas_instance* instance)
2476 fw_state = instance->instancet->read_fw_status_reg(instance->reg_set) & MFI_STATE_MASK; 2476 fw_state = instance->instancet->read_fw_status_reg(instance->reg_set) & MFI_STATE_MASK;
2477 2477
2478 if (fw_state != MFI_STATE_READY) 2478 if (fw_state != MFI_STATE_READY)
2479 printk(KERN_INFO "megasas: Waiting for FW to come to ready" 2479 printk(KERN_INFO "megasas: Waiting for FW to come to ready"
2480 " state\n"); 2480 " state\n");
2481 2481
2482 while (fw_state != MFI_STATE_READY) { 2482 while (fw_state != MFI_STATE_READY) {
2483 2483
@@ -2590,7 +2590,7 @@ megasas_transition_to_ready(struct megasas_instance* instance)
2590 * The cur_state should not last for more than max_wait secs 2590 * The cur_state should not last for more than max_wait secs
2591 */ 2591 */
2592 for (i = 0; i < (max_wait * 1000); i++) { 2592 for (i = 0; i < (max_wait * 1000); i++) {
2593 fw_state = instance->instancet->read_fw_status_reg(instance->reg_set) & 2593 fw_state = instance->instancet->read_fw_status_reg(instance->reg_set) &
2594 MFI_STATE_MASK ; 2594 MFI_STATE_MASK ;
2595 curr_abs_state = 2595 curr_abs_state =
2596 instance->instancet->read_fw_status_reg(instance->reg_set); 2596 instance->instancet->read_fw_status_reg(instance->reg_set);
@@ -2610,7 +2610,7 @@ megasas_transition_to_ready(struct megasas_instance* instance)
2610 return -ENODEV; 2610 return -ENODEV;
2611 } 2611 }
2612 } 2612 }
2613 printk(KERN_INFO "megasas: FW now in Ready state\n"); 2613 printk(KERN_INFO "megasas: FW now in Ready state\n");
2614 2614
2615 return 0; 2615 return 0;
2616} 2616}
@@ -3290,7 +3290,7 @@ static int megasas_init_mfi(struct megasas_instance *instance)
3290 * does not exceed max cmds that the FW can support 3290 * does not exceed max cmds that the FW can support
3291 */ 3291 */
3292 instance->max_fw_cmds = instance->max_fw_cmds-1; 3292 instance->max_fw_cmds = instance->max_fw_cmds-1;
3293 instance->max_num_sge = (instance->instancet->read_fw_status_reg(reg_set) & 0xFF0000) >> 3293 instance->max_num_sge = (instance->instancet->read_fw_status_reg(reg_set) & 0xFF0000) >>
3294 0x10; 3294 0x10;
3295 /* 3295 /*
3296 * Create a pool of commands 3296 * Create a pool of commands
@@ -3733,7 +3733,7 @@ fail_set_dma_mask:
3733/** 3733/**
3734 * megasas_probe_one - PCI hotplug entry point 3734 * megasas_probe_one - PCI hotplug entry point
3735 * @pdev: PCI device structure 3735 * @pdev: PCI device structure
3736 * @id: PCI ids of supported hotplugged adapter 3736 * @id: PCI ids of supported hotplugged adapter
3737 */ 3737 */
3738static int __devinit 3738static int __devinit
3739megasas_probe_one(struct pci_dev *pdev, const struct pci_device_id *id) 3739megasas_probe_one(struct pci_dev *pdev, const struct pci_device_id *id)
@@ -5165,7 +5165,7 @@ err_dcf_attr_ver:
5165 pci_unregister_driver(&megasas_pci_driver); 5165 pci_unregister_driver(&megasas_pci_driver);
5166err_pcidrv: 5166err_pcidrv:
5167 unregister_chrdev(megasas_mgmt_majorno, "megaraid_sas_ioctl"); 5167 unregister_chrdev(megasas_mgmt_majorno, "megaraid_sas_ioctl");
5168 return rval; 5168 return rval;
5169} 5169}
5170 5170
5171/** 5171/**