Author: kadesai
Date: Wed May  6 10:45:13 2015
New Revision: 282531
URL: https://svnweb.freebsd.org/changeset/base/282531

Log:
  1. All LSI namings are converted to AVAGO Tech.
  2. Fix in AEN path(suggested by John Baldwin).
  3. Fix IOCTL path w.r.t Sense key handling
  
  Reviewed by:  ambrisko
  MFC after:    2 weeks
  Sponsored by: AVAGO Technologies

Modified:
  head/sys/dev/mrsas/mrsas.c
  head/sys/dev/mrsas/mrsas.h
  head/sys/dev/mrsas/mrsas_cam.c
  head/sys/dev/mrsas/mrsas_fp.c
  head/sys/dev/mrsas/mrsas_ioctl.c
  head/sys/dev/mrsas/mrsas_ioctl.h
  head/sys/dev/mrsas/mrsas_linux.c

Modified: head/sys/dev/mrsas/mrsas.c
==============================================================================
--- head/sys/dev/mrsas/mrsas.c  Wed May  6 10:44:08 2015        (r282530)
+++ head/sys/dev/mrsas/mrsas.c  Wed May  6 10:45:13 2015        (r282531)
@@ -1,6 +1,7 @@
 /*
+ * Copyright (c) 2015, AVAGO Tech. All rights reserved. Author: Marian Choy
  * Copyright (c) 2014, LSI Corp. All rights reserved. Author: Marian Choy
- * Support: [email protected]
+ * Support: [email protected]
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
@@ -31,7 +32,7 @@
  * those of the authors and should not be interpreted as representing
  * official policies,either expressed or implied, of the FreeBSD Project.
  *
- * Send feedback to: <[email protected]> Mail to: LSI Corporation, 1621
+ * Send feedback to: <[email protected]> Mail to: AVAGO TECHNOLOGIES 
1621
  * Barber Lane, Milpitas, CA 95035 ATTN: MegaRaid FreeBSD
  *
  */
@@ -177,9 +178,9 @@ typedef struct mrsas_ident {
 }      MRSAS_CTLR_ID;
 
 MRSAS_CTLR_ID device_table[] = {
-       {0x1000, MRSAS_TBOLT, 0xffff, 0xffff, "LSI Thunderbolt SAS Controller"},
-       {0x1000, MRSAS_INVADER, 0xffff, 0xffff, "LSI Invader SAS Controller"},
-       {0x1000, MRSAS_FURY, 0xffff, 0xffff, "LSI Fury SAS Controller"},
+       {0x1000, MRSAS_TBOLT, 0xffff, 0xffff, "AVAGO Thunderbolt SAS 
Controller"},
+       {0x1000, MRSAS_INVADER, 0xffff, 0xffff, "AVAGO Invader SAS Controller"},
+       {0x1000, MRSAS_FURY, 0xffff, 0xffff, "AVAGO Fury SAS Controller"},
        {0, 0, 0, 0, NULL}
 };
 
@@ -356,7 +357,7 @@ mrsas_probe(device_t dev)
 
        if ((id = mrsas_find_ident(dev)) != NULL) {
                if (first_ctrl) {
-                       printf("LSI MegaRAID SAS FreeBSD mrsas driver version: 
%s\n",
+                       printf("AVAGO MegaRAID SAS FreeBSD mrsas driver 
version: %s\n",
                            MRSAS_VERSION);
                        first_ctrl = 0;
                }
@@ -1385,8 +1386,10 @@ mrsas_poll(struct cdev *dev, int poll_ev
        }
        if (revents == 0) {
                if (poll_events & (POLLIN | POLLRDNORM)) {
+                       mtx_lock(&sc->aen_lock);
                        sc->mrsas_poll_waiting = 1;
                        selrecord(td, &sc->mrsas_select);
+                       mtx_unlock(&sc->aen_lock);
                }
        }
        return revents;
@@ -4099,10 +4102,12 @@ mrsas_complete_aen(struct mrsas_softc *s
         */
        if ((!cmd->abort_aen) && (sc->remove_in_progress == 0)) {
                sc->mrsas_aen_triggered = 1;
+               mtx_lock(&sc->aen_lock);
                if (sc->mrsas_poll_waiting) {
                        sc->mrsas_poll_waiting = 0;
                        selwakeup(&sc->mrsas_select);
                }
+               mtx_unlock(&sc->aen_lock);
        } else
                cmd->abort_aen = 0;
 

Modified: head/sys/dev/mrsas/mrsas.h
==============================================================================
--- head/sys/dev/mrsas/mrsas.h  Wed May  6 10:44:08 2015        (r282530)
+++ head/sys/dev/mrsas/mrsas.h  Wed May  6 10:45:13 2015        (r282531)
@@ -1,6 +1,7 @@
 /*
+ * Copyright (c) 2015, AVAGO Tech. All rights reserved. Authors: Marian Choy
  * Copyright (c) 2014, LSI Corp. All rights reserved. Authors: Marian Choy
- * Support: [email protected]
+ * Support: [email protected]
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
@@ -31,7 +32,7 @@
  * those of the authors and should not be interpreted as representing
  * official policies,either expressed or implied, of the FreeBSD Project.
  *
- * Send feedback to: <[email protected]> Mail to: LSI Corporation, 1621
+ * Send feedback to: <[email protected]> Mail to: AVAGO TECHNOLOGIES, 
1621
  * Barber Lane, Milpitas, CA 95035 ATTN: MegaRaid FreeBSD
  *
  */

Modified: head/sys/dev/mrsas/mrsas_cam.c
==============================================================================
--- head/sys/dev/mrsas/mrsas_cam.c      Wed May  6 10:44:08 2015        
(r282530)
+++ head/sys/dev/mrsas/mrsas_cam.c      Wed May  6 10:45:13 2015        
(r282531)
@@ -1,6 +1,7 @@
 /*
+ * Copyright (c) 2015, AVAGO Tech. All rights reserved. Author: Marian Choy
  * Copyright (c) 2014, LSI Corp. All rights reserved. Author: Marian Choy
- * Support: [email protected]
+ * Support: [email protected]
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
@@ -322,7 +323,7 @@ mrsas_action(struct cam_sim *sim, union 
                        ccb->cpi.initiator_id = MRSAS_SCSI_INITIATOR_ID;
                        ccb->cpi.base_transfer_speed = 150000;
                        strncpy(ccb->cpi.sim_vid, "FreeBSD", SIM_IDLEN);
-                       strncpy(ccb->cpi.hba_vid, "LSI", HBA_IDLEN);
+                       strncpy(ccb->cpi.hba_vid, "AVAGO", HBA_IDLEN);
                        strncpy(ccb->cpi.dev_name, cam_sim_name(sim), 
DEV_IDLEN);
                        ccb->cpi.transport = XPORT_SPI;
                        ccb->cpi.transport_version = 2;

Modified: head/sys/dev/mrsas/mrsas_fp.c
==============================================================================
--- head/sys/dev/mrsas/mrsas_fp.c       Wed May  6 10:44:08 2015        
(r282530)
+++ head/sys/dev/mrsas/mrsas_fp.c       Wed May  6 10:45:13 2015        
(r282531)
@@ -1,6 +1,7 @@
 /*
+ * Copyright (c) 2015, AVAGO Tech. All rights reserved. Author: Marian Choy
  * Copyright (c) 2014, LSI Corp. All rights reserved. Author: Marian Choy
- * Support: [email protected]
+ * Support: [email protected]
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
@@ -31,7 +32,7 @@
  * those of the authors and should not be interpreted as representing
  * official policies,either expressed or implied, of the FreeBSD Project.
  *
- * Send feedback to: <[email protected]> Mail to: LSI Corporation, 1621
+ * Send feedback to: <[email protected]> Mail to: AVAGO TECHNOLOGIES, 
1621
  * Barber Lane, Milpitas, CA 95035 ATTN: MegaRaid FreeBSD
  *
  */
@@ -564,12 +565,12 @@ get_row_from_strip(struct mrsas_softc *s
                                else
                                        break;
                        }
-               mrsas_dprint(sc, MRSAS_PRL11, "LSI Debug : Strip 0x%llx, 
span_set_Strip 0x%llx, span_set_Row 0x%llx "
+               mrsas_dprint(sc, MRSAS_PRL11, "AVAGO Debug : Strip 0x%llx, 
span_set_Strip 0x%llx, span_set_Row 0x%llx "
                    "data width 0x%llx span offset 0x%llx\n", (unsigned long 
long)strip,
                    (unsigned long long)span_set_Strip,
                    (unsigned long long)span_set_Row,
                    (unsigned long long)span_set->span_row_data_width, 
(unsigned long long)span_offset);
-               mrsas_dprint(sc, MRSAS_PRL11, "LSI Debug : For strip 0x%llx row 
is 0x%llx\n", (unsigned long long)strip,
+               mrsas_dprint(sc, MRSAS_PRL11, "AVAGO Debug : For strip 0x%llx 
row is 0x%llx\n", (unsigned long long)strip,
                    (unsigned long long)span_set->data_row_start +
                    (unsigned long long)span_set_Row + (span_offset - 1));
                return (span_set->data_row_start + span_set_Row + (span_offset 
- 1));
@@ -629,7 +630,7 @@ get_strip_from_row(struct mrsas_softc *s
                                }
                        }
        }
-       mrsas_dprint(sc, MRSAS_PRL11, "LSI Debug - get_strip_from_row: returns 
invalid "
+       mrsas_dprint(sc, MRSAS_PRL11, "AVAGO Debug - get_strip_from_row: 
returns invalid "
            "strip for ld=%x, row=%lx\n", ld, (long unsigned int)row);
        return -1;
 }
@@ -677,13 +678,13 @@ get_arm_from_strip(struct mrsas_softc *s
                                else
                                        break;
                        }
-               mrsas_dprint(sc, MRSAS_PRL11, "LSI PRL11: get_arm_from_strip: "
+               mrsas_dprint(sc, MRSAS_PRL11, "AVAGO PRL11: get_arm_from_strip: 
"
                    "for ld=0x%x strip=0x%lx arm is  0x%x\n", ld,
                    (long unsigned int)strip, (strip_offset - span_offset));
                return (strip_offset - span_offset);
        }
 
-       mrsas_dprint(sc, MRSAS_PRL11, "LSI Debug: - get_arm_from_strip: returns 
invalid arm"
+       mrsas_dprint(sc, MRSAS_PRL11, "AVAGO Debug: - get_arm_from_strip: 
returns invalid arm"
            " for ld=%x strip=%lx\n", ld, (long unsigned int)strip);
 
        return -1;
@@ -832,7 +833,7 @@ MR_BuildRaidContext(struct mrsas_softc *
                else if (sc->UnevenSpanSupport) {
                        io_info->IoforUnevenSpan = 1;
                } else {
-                       mrsas_dprint(sc, MRSAS_PRL11, "LSI Debug: 
raid->rowDataSize is 0, but has SPAN[0] rowDataSize = 0x%0x,"
+                       mrsas_dprint(sc, MRSAS_PRL11, "AVAGO Debug: 
raid->rowDataSize is 0, but has SPAN[0] rowDataSize = 0x%0x,"
                            " but there is _NO_ UnevenSpanSupport\n",
                            MR_LdSpanPtrGet(ld, 0, map)->spanRowDataSize);
                        return FALSE;
@@ -859,13 +860,13 @@ MR_BuildRaidContext(struct mrsas_softc *
                        startlba_span = (u_int8_t)mr_spanset_get_span_block(sc, 
ld, start_row,
                            pdBlock, map, &error_code);
                        if (error_code == 1) {
-                               mrsas_dprint(sc, MRSAS_PRL11, "LSI Debug: 
return from %s %d. Send IO w/o region lock.\n",
+                               mrsas_dprint(sc, MRSAS_PRL11, "AVAGO Debug: 
return from %s %d. Send IO w/o region lock.\n",
                                    __func__, __LINE__);
                                return FALSE;
                        }
                }
                if (startlba_span == SPAN_INVALID) {
-                       mrsas_dprint(sc, MRSAS_PRL11, "LSI Debug: return from 
%s %d for row 0x%llx,"
+                       mrsas_dprint(sc, MRSAS_PRL11, "AVAGO Debug: return from 
%s %d for row 0x%llx,"
                            "start strip %llx endSrip %llx\n", __func__,
                            __LINE__, (unsigned long long)start_row,
                            (unsigned long long)start_strip,
@@ -874,12 +875,12 @@ MR_BuildRaidContext(struct mrsas_softc *
                }
                io_info->start_span = startlba_span;
                io_info->start_row = start_row;
-               mrsas_dprint(sc, MRSAS_PRL11, "LSI Debug: Check Span number 
from %s %d for row 0x%llx, "
+               mrsas_dprint(sc, MRSAS_PRL11, "AVAGO Debug: Check Span number 
from %s %d for row 0x%llx, "
                    " start strip 0x%llx endSrip 0x%llx span 0x%x\n",
                    __func__, __LINE__, (unsigned long long)start_row,
                    (unsigned long long)start_strip,
                    (unsigned long long)endStrip, startlba_span);
-               mrsas_dprint(sc, MRSAS_PRL11, "LSI Debug : 1. start_row 0x%llx 
endRow 0x%llx Start span 0x%x\n",
+               mrsas_dprint(sc, MRSAS_PRL11, "AVAGO Debug : 1. start_row 
0x%llx endRow 0x%llx Start span 0x%x\n",
                    (unsigned long long)start_row, (unsigned long long)endRow, 
startlba_span);
        } else {
                start_row = mega_div64_32(start_strip, raid->rowDataSize);
@@ -1043,7 +1044,7 @@ mr_update_span_set(MR_DRV_RAID_MAP_ALL *
                                                span_row_width +=
                                                    MR_LdSpanPtrGet(ld, count, 
map)->spanRowDataSize;
 #if SPAN_DEBUG
-                                               printf("LSI Debug span %x 
rowDataSize %x\n", count,
+                                               printf("AVAGO Debug span %x 
rowDataSize %x\n", count,
                                                    MR_LdSpanPtrGet(ld, count, 
map)->spanRowDataSize);
 #endif
                                        }
@@ -1382,7 +1383,7 @@ u_int8_t mrsas_get_best_arm_pd(struct mr
        io_info->pd_after_lb = (bestArm == arm) ? pd0:pd1;
 #if SPAN_DEBUG
        if(arm != bestArm)
-       printf("LSI Debug R1 Load balance occur - span 0x%x arm 0x%x bestArm 
0x%x "
+       printf("AVAGO Debug R1 Load balance occur - span 0x%x arm 0x%x bestArm 
0x%x "
                        "io_info->span_arm 0x%x\n",
                        span, arm, bestArm, io_info->span_arm);
 #endif

Modified: head/sys/dev/mrsas/mrsas_ioctl.c
==============================================================================
--- head/sys/dev/mrsas/mrsas_ioctl.c    Wed May  6 10:44:08 2015        
(r282530)
+++ head/sys/dev/mrsas/mrsas_ioctl.c    Wed May  6 10:45:13 2015        
(r282531)
@@ -1,6 +1,7 @@
 /*
+ * Copyright (c) 2015, AVAGO Tech. All rights reserved. Author: Marian Choy
  * Copyright (c) 2014, LSI Corp. All rights reserved. Author: Marian Choy
- * Support: [email protected]
+ * Support: [email protected]
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
@@ -31,7 +32,7 @@
  * those of the authors and should not be interpreted as representing
  * official policies,either expressed or implied, of the FreeBSD Project.
  *
- * Send feedback to: <[email protected]> Mail to: LSI Corporation, 1621
+ * Send feedback to: <[email protected]> Mail to: AVAGO TECHNOLOGIES, 
1621
  * Barber Lane, Milpitas, CA 95035 ATTN: MegaRaid FreeBSD
  *
  */
@@ -238,7 +239,7 @@ mrsas_passthru(struct mrsas_softc *sc, v
                }
                sense_ptr =
                    (unsigned long *)((unsigned long)cmd->frame + 
user_ioc->sense_off);
-               sense_ptr = ioctl_sense_mem;
+               *sense_ptr = ioctl_sense_phys_addr;
        }
        /*
         * Set the sync_cmd flag so that the ISR knows not to complete this
@@ -296,12 +297,14 @@ out:
        /*
         * Release sense buffer
         */
-       if (ioctl_sense_phys_addr)
-               bus_dmamap_unload(ioctl_sense_tag, ioctl_sense_dmamap);
-       if (ioctl_sense_mem != NULL)
-               bus_dmamem_free(ioctl_sense_tag, ioctl_sense_mem, 
ioctl_sense_dmamap);
-       if (ioctl_sense_tag != NULL)
-               bus_dma_tag_destroy(ioctl_sense_tag);
+       if (user_ioc->sense_len) {
+               if (ioctl_sense_phys_addr)
+                       bus_dmamap_unload(ioctl_sense_tag, ioctl_sense_dmamap);
+               if (ioctl_sense_mem != NULL)
+                       bus_dmamem_free(ioctl_sense_tag, ioctl_sense_mem, 
ioctl_sense_dmamap);
+               if (ioctl_sense_tag != NULL)
+                       bus_dma_tag_destroy(ioctl_sense_tag);
+       }
 
        /*
         * Release data buffers

Modified: head/sys/dev/mrsas/mrsas_ioctl.h
==============================================================================
--- head/sys/dev/mrsas/mrsas_ioctl.h    Wed May  6 10:44:08 2015        
(r282530)
+++ head/sys/dev/mrsas/mrsas_ioctl.h    Wed May  6 10:45:13 2015        
(r282531)
@@ -1,6 +1,7 @@
 /*
+ * Copyright (c) 2015, AVAGO Tech. All rights reserved. Author: Marian Choy
  * Copyright (c) 2014, LSI Corp. All rights reserved. Author: Marian Choy
- * Support: [email protected]
+ * Support: [email protected]
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
@@ -31,7 +32,7 @@
  * those of the authors and should not be interpreted as representing
  * official policies,either expressed or implied, of the FreeBSD Project.
  *
- * Send feedback to: <[email protected]> Mail to: LSI Corporation, 1621
+ * Send feedback to: <[email protected]> Mail to: AVAGO TECHNOLOGIES, 
1621
  * Barber Lane, Milpitas, CA 95035 ATTN: MegaRaid FreeBSD
  *
  */

Modified: head/sys/dev/mrsas/mrsas_linux.c
==============================================================================
--- head/sys/dev/mrsas/mrsas_linux.c    Wed May  6 10:44:08 2015        
(r282530)
+++ head/sys/dev/mrsas/mrsas_linux.c    Wed May  6 10:45:13 2015        
(r282531)
@@ -1,6 +1,7 @@
 /*
+ * Copyright (c) 2015, AVAGO Tech. All rights reserved. Author: Kashyap Desai,
  * Copyright (c) 2014, LSI Corp. All rights reserved. Author: Kashyap Desai,
- * Sibananda Sahu Support: [email protected]
+ * Sibananda Sahu Support: [email protected]
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
@@ -31,7 +32,7 @@
  * those of the authors and should not be interpreted as representing
  * official policies,either expressed or implied, of the FreeBSD Project.
  *
- * Send feedback to: <[email protected]> Mail to: LSI Corporation, 1621
+ * Send feedback to: <[email protected]> Mail to: AVAGO TECHNOLOGIES, 
1621
  * Barber Lane, Milpitas, CA 95035 ATTN: MegaRaid FreeBSD
  *
  */
_______________________________________________
[email protected] mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "[email protected]"

Reply via email to