History log of /freebsd-10-stable/sys/dev/hptmv/
Revision Date Author Comments
(<<< Hide modified files)
(Show modified files >>>)
315813 23-Mar-2017 mav

MFC r311305 (by asomers):
Always null-terminate ccb_pathinq.(sim_vid|hba_vid|dev_name)

The sim_vid, hba_vid, and dev_name fields of struct ccb_pathinq are
fixed-length strings. AFAICT the only place they're read is in
sbin/camcontrol/camcontrol.c, which assumes they'll be null-terminated.
However, the kernel doesn't null-terminate them. A bunch of copy-pasted code
uses strncpy to write them, and doesn't guarantee null-termination. For at
least 4 drivers (mpr, mps, ciss, and hyperv), the hba_vid field actually
overflows. You can see the result by doing "camcontrol negotiate da0 -v".

This change null-terminates those fields everywhere they're set in the
kernel. It also shortens a few strings to ensure they'll fit within the
16-character field.

PR: 215474
Reported by: Coverity
CID: 1009997 1010000 1010001 1010002 1010003 1010004 1010005
CID: 1331519 1010006 1215097 1010007 1288967 1010008 1306000
CID: 1211924 1010009 1010010 1010011 1010012 1010013 1010014
CID: 1147190 1010017 1010016 1010018 1216435 1010020 1010021
CID: 1010022 1009666 1018185 1010023 1010025 1010026 1010027
CID: 1010028 1010029 1010030 1010031 1010033 1018186 1018187
CID: 1010035 1010036 1010042 1010041 1010040 1010039


/freebsd-10-stable/sys/cam/cam_xpt.c
/freebsd-10-stable/sys/cam/ctl/ctl_frontend_cam_sim.c
/freebsd-10-stable/sys/cam/scsi/scsi_low.c
/freebsd-10-stable/sys/dev/aac/aac_cam.c
/freebsd-10-stable/sys/dev/aacraid/aacraid_cam.c
/freebsd-10-stable/sys/dev/advansys/advansys.c
/freebsd-10-stable/sys/dev/advansys/adwcam.c
/freebsd-10-stable/sys/dev/aha/aha.c
/freebsd-10-stable/sys/dev/ahb/ahb.c
/freebsd-10-stable/sys/dev/ahci/ahci.c
/freebsd-10-stable/sys/dev/ahci/ahciem.c
/freebsd-10-stable/sys/dev/aic/aic.c
/freebsd-10-stable/sys/dev/aic7xxx/aic79xx_osm.c
/freebsd-10-stable/sys/dev/aic7xxx/aic7xxx_osm.c
/freebsd-10-stable/sys/dev/amr/amr_cam.c
/freebsd-10-stable/sys/dev/arcmsr/arcmsr.c
/freebsd-10-stable/sys/dev/ata/ata-all.c
/freebsd-10-stable/sys/dev/buslogic/bt.c
/freebsd-10-stable/sys/dev/ciss/ciss.c
/freebsd-10-stable/sys/dev/dpt/dpt_scsi.c
/freebsd-10-stable/sys/dev/esp/ncr53c9x.c
/freebsd-10-stable/sys/dev/firewire/sbp.c
/freebsd-10-stable/sys/dev/firewire/sbp_targ.c
/freebsd-10-stable/sys/dev/hpt27xx/hpt27xx_osm_bsd.c
/freebsd-10-stable/sys/dev/hptiop/hptiop.c
entry.c
/freebsd-10-stable/sys/dev/hptnr/hptnr_osm_bsd.c
/freebsd-10-stable/sys/dev/hptrr/hptrr_osm_bsd.c
/freebsd-10-stable/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c
/freebsd-10-stable/sys/dev/iir/iir.c
/freebsd-10-stable/sys/dev/isci/isci_controller.c
/freebsd-10-stable/sys/dev/iscsi_initiator/isc_cam.c
/freebsd-10-stable/sys/dev/isp/isp_freebsd.c
/freebsd-10-stable/sys/dev/mfi/mfi_cam.c
/freebsd-10-stable/sys/dev/mly/mly.c
/freebsd-10-stable/sys/dev/mpr/mpr_sas.c
/freebsd-10-stable/sys/dev/mps/mps_sas.c
/freebsd-10-stable/sys/dev/mpt/mpt_cam.c
/freebsd-10-stable/sys/dev/mrsas/mrsas_cam.c
/freebsd-10-stable/sys/dev/mvs/mvs.c
/freebsd-10-stable/sys/dev/pms/freebsd/driver/ini/src/agtiapi.c
/freebsd-10-stable/sys/dev/ppbus/vpo.c
/freebsd-10-stable/sys/dev/siis/siis.c
/freebsd-10-stable/sys/dev/sym/sym_hipd.c
/freebsd-10-stable/sys/dev/trm/trm.c
/freebsd-10-stable/sys/dev/twa/tw_osl_cam.c
/freebsd-10-stable/sys/dev/tws/tws_cam.c
/freebsd-10-stable/sys/dev/virtio/scsi/virtio_scsi.c
/freebsd-10-stable/sys/powerpc/ps3/ps3cdrom.c
/freebsd-10-stable/sys/powerpc/pseries/phyp_vscsi.c
312398 18-Jan-2017 marius

MFC: r296135

Replace several bus_alloc_resource() calls with bus_alloc_resource_any()

Most of these are BARs, and we allocate them in their entirety. The one
outlier in this is amdsbwd(4), which calls bus_set_resource() prior.

303172 22-Jul-2016 sbruno

MFC r298231
hptmv(4) Fix potential buffer overflow in hpt_set_info.

While here, adjust some whitespace and yeild some useful debug info.

This is untested on this hardware, testing requests to -scsi went
unanswered.

267457 14-Jun-2014 delphij

MFC r267368:

Apply vendor fixes to the High Point drivers:

- Don't call xpt_free_path() in os_query_remove_device() and
always return TRUE.
- Update os_buildsgl() to support build logical SG table which
will be used by lower RAID module.
- Return CAM_SEL_TIMEOUTstatus for SCSIcommand failed as target
missing.

Many thanks to HighPoint for providing this driver update.

Submitted by: Steve Chang
Reviewed by: mav

256281 10-Oct-2013 gjb

Copy head (r256279) to stable/10 as part of the 10.0-RELEASE cycle.

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation


255871 25-Sep-2013 scottl

Re-do r255853. Along with adding back the API/ABI changes from the
original, this hides the contents of cam_compat.h from ktrace/kdump/truss,
avoiding problems there. There are no user-servicable parts in there, so
no need for those tools to be groping around in there.

Approved by: re


255865 25-Sep-2013 gjb

Revert r255853 pending fixes to build errors in usr.bin/kdump

Approved by: re (implicit)


255853 24-Sep-2013 scottl

Update the CAM API for FreeBSD 10:

- Remove the timeout_ch field. It's been deprecated since FreeBSD 7.0;
MPSAFE drivers should be managing their own timeout storage. The
remaining non-MPSAFE drivers have been modified to also manage their own
storage, and should be considered for updating to MPSAFE (or removal)
during the FreeBSD 10.x lifecycle.

- Add fields related to soft timeouts and quality of service, to be used
in upcoming work.

- Add room for more flags in the CCB header and path_inq structures.

- Begin support for extended 64-bit LUNs.

- Bump the CAM version number to 0x18, but add compat shims. Tested with
camcontrol and smartctl.

Reviewed by: nathanw, ken, kib
Approved by: re
Obtained from: Netflix


250460 10-May-2013 eadler

Fxi a bunch of typos.

PR: misc/174625
Submitted by: Jeremy Chadwick <jdc@koitsu.org>


249849 24-Apr-2013 mav

Move hptmv and mpt drivers shutdown a bit later to the SHUTDOWN_PRI_LAST
stage of shutdown_post_sync. That should allow CAM to do final cache flush
at the SHUTDOWN_PRI_DEFAULT without using polling magic.

MFC after: 3 days


246713 12-Feb-2013 kib

Reform the busdma API so that new types may be added without modifying
every architecture's busdma_machdep.c. It is done by unifying the
bus_dmamap_load_buffer() routines so that they may be called from MI
code. The MD busdma is then given a chance to do any final processing
in the complete() callback.

The cam changes unify the bus_dmamap_load* handling in cam drivers.

The arm and mips implementations are updated to track virtual
addresses for sync(). Previously this was done in a type specific
way. Now it is done in a generic way by recording the list of
virtuals in the map.

Submitted by: jeff (sponsored by EMC/Isilon)
Reviewed by: kan (previous version), scottl,
mjacob (isp(4), no objections for target mode changes)
Discussed with: ian (arm changes)
Tested by: marius (sparc64), mips (jmallet), isci(4) on x86 (jharris),
amd64 (Fabian Keil <freebsd-listen@fabiankeil.de>)


240210 07-Sep-2012 delphij

It seems that what the code really meant is that when a write is completed,
do a BUS_DMASYNC_POSTWRITE over the DMA map. The way it currently is would
only do POSTREAD for read transactions.

Submitted by: Sascha Wildner
MFC after: 1 month


236379 01-Jun-2012 eadler

Adding missing dependancies for loading hptiop(4), hptmv(4) and isp(4) as modules.

PR: kern/166239
Submitted by: Pavel Timofeev <timp87@gmail.com>
Discussed on: -stable, -scsi
Reviewed by: scottl
No objection from: mjacob
Approved by: cperciva
MFC after: 3 days


232854 12-Mar-2012 scottl

Convert a number of drivers to obtaining their parent DMA tag from their
PCI device attachment.


230133 15-Jan-2012 uqs

Remove spurious 8bit chars, turning files into plain ASCII.


227912 23-Nov-2011 marius

- Just use cam_calc_geometry(9) on newer version of FreeBSD rather than
duplicating it.
- In hptmv(4) and hptrr(4) use __FBSDID and DEVMETHOD_END.


219819 21-Mar-2011 jeff

- Merge changes to the base system to support OFED. These include
a wider arg2 for sysctl, updates to vlan code, IFT_INFINIBAND,
and other miscellaneous small features.


209341 19-Jun-2010 mav

Report transport type in XPT_PATH_INQ.

MFC after: 3 days


201758 07-Jan-2010 mbr

Remove extraneous semicolons, no functional changes.

Submitted by: Marc Balmer <marc@msys.ch>
MFC after: 1 week


194900 24-Jun-2009 mav

MFp4:
Remove unused ATAPI definitions, conflicting with ata.h.

Submitted by: scottl


190863 09-Apr-2009 delphij

Use DEVICE_SHUTDOWN(9) mechanism for shutdown handler.

Suggested by: jhb


190810 07-Apr-2009 delphij

When multiple cards are present, register a shutdown handler for each card
instead of just register one for the first adapter. Without doing this
there would be some data loss upon shutdown because data could be ignored
when flushing to disk.

MFC after: 3 days


190809 07-Apr-2009 delphij

Update driver to vendor's version 1.16 plus some local changes:

- override_kernel_driver() has been removed since this is an
in-tree version of driver.
- __DATE__ and __TIME__ removed from version string to make
binary update builders happy.
- Utilize pause(9) for __FreeBSDversion >= 700033 (redo 167086).
- Utilize kproc_suspend_check() for __FreeBSDversion >= 800002.
(redo 172836).
- Don't read past end of pVDevice (redo 143787).
- Make sure that controller and channel are initialized (redo 169823).
- Don't include cam/cam_xpt_periph.h (redo 158177).

MFC After: 3 days


172836 20-Oct-2007 julian

Rename the kthread_xxx (e.g. kthread_create()) calls
to kproc_xxx as they actually make whole processes.
Thos makes way for us to add REAL kthread_create() and friends
that actually make theads. it turns out that most of these
calls actually end up being moved back to the thread version
when it's added. but we need to make this cosmetic change first.

I'd LOVE to do this rename in 7.0 so that we can eventually MFC the
new kthread_xxx() calls.


170872 17-Jun-2007 scottl

Prepare for future integration between CAM and newbus. xpt_bus_register
now takes a device_t to be the parent of the bus that is being created.
Most SIMs have been updated with a reasonable argument, but a few exceptions
just pass NULL for now. This argument isn't used yet and the newbus
integration likely won't be ready until after 7.0-RELEASE.


169823 21-May-2007 mjacob

Perhaps a better fix- make the called function do the (possible never reached)
initialization. Do a token amount of style cleanup.

Poked by: bde


169798 20-May-2007 mjacob

Make gcc 4.2 happy by initiatlizing controller && channel prior
to a call to a function which *might* then initialize them.

MFC after: 3 days


168752 15-Apr-2007 scottl

Remove Giant from CAM. Drivers (SIMs) now register a mutex that CAM will
use to synchornize and protect all data objects that are used for that
SIM. Drivers that are not yet MPSAFE register Giant and operate as
usual. RIght now, no drivers are MPSAFE, though a few will be changed
in the coming week as this work settles down.

The driver API has changed, so all CAM drivers will need to be recompiled.
The userland API has not changed, so tools like camcontrol do not need to
be recompiled.


167086 27-Feb-2007 jhb

Use pause() rather than tsleep() on stack variables and function pointers.


166901 23-Feb-2007 piso

o break newbus api: add a new argument of type driver_filter_t to
bus_setup_intr()

o add an int return code to all fast handlers

o retire INTR_FAST/IH_FAST

For more info: http://docs.freebsd.org/cgi/getmsg.cgi?fetch=465712+0+current/freebsd-current

Reviewed by: many
Approved by: re@


165774 04-Jan-2007 jhb

- Use a regular mutex rather than a spin mutex. This driver doesn't need
a spin mutex since it doesn't have an INTR_FAST interrupt handler.
Beyond that the driver is still under Giant anyway.
- Remove unneeded locking during attach across operations that can't be
called with locks held (such as bus_dma_tag_create()).

MFC after: 1 week
Not objected to by: scottl


158651 16-May-2006 phk

Since DELAY() was moved, most <machine/clock.h> #includes have been
unnecessary.


158177 30-Apr-2006 scottl

Remove some header polution.


153072 04-Dec-2005 ru

Fix -Wundef.


152374 13-Nov-2005 schweikh

Don't augment the DRIVER_VERSION "v1.12" with __DATE__ and __TIME__.
This is the only file of > 1700 files in a buildkernel here doing that.
It makes reproducible builds (same source => same binary) impossible.

Spotted by: devel/ccache


149878 08-Sep-2005 scottl

Fix a typo that broke LINT.


149871 07-Sep-2005 scottl

Import new version of the HPTMV driver from Highpoint. The major change
here is the support for amd64, as well as possible support for PAE. Many
thanks to Highpoint for continuing to support FreeBSD.

Obtained from: Steve Chang @ Highpoint
MFC After: 3 days.


146734 29-May-2005 nyan

Remove bus_{mem,p}io.h and related code for a micro-optimization on i386
and amd64. The optimization is a trivial on recent machines.

Reviewed by: -arch (imp, marcel, dfr)


144371 31-Mar-2005 sam

check copyin return value (and while we're at it copyout too)

Noticed by: Coverity Prevent analysis tool


144264 29-Mar-2005 sam

plug resource leak

Noticed by: Coverity Prevent analysis tool


143787 18-Mar-2005 das

Don't read past the end of pVDevice[]. (Previously, we would iterate
twice as many times as there were entries in the array.)

Spotted by: Ted Unangst using the Coverity Prevent static analysis tool
Reviewed by: scottl


143786 18-Mar-2005 das

Don't write past the end of the VendorId field (and into the ProductId
field).

Spotted by: Ted Unangst using the Coverity Prevent static analysis tool
Reviewed by: scottl


143039 02-Mar-2005 scottl

Clean up the botching of the previous repo-copy. Reference the included
headers from the correct location.

Submitted by: Tai-hwa Liang


142988 02-Mar-2005 scottl

Move all of the hptmv files to /sys/dev/hptmv so that they won't be mistaken
for being on a CVS vendor branch. The files were moved via a repo-copy.


142731 28-Feb-2005 obrien

Add FreeBSD ID.


142409 25-Feb-2005 sam

avoid sneaky double free

Noticed by: Coverity Prevent analysis tool
Reviewed by: scottl


142358 24-Feb-2005 sam

plug resource leak

Noticed by: Coverity Prevent analysis tool
Reviewed by: scottl


139749 06-Jan-2005 imp

Start each of the license/copyright comments with /*-, minor shuffle of lines


139044 19-Dec-2004 njl

Move launching the worker thread from a SYSINIT to the first device's
attach. This fixes the previous behavior where systems without hptmv
hardware always had a worker thread running.


136862 24-Oct-2004 scottl

Fix some warnings that only triggered in LINT.


136857 24-Oct-2004 scottl

Embed the correct name.


136856 24-Oct-2004 scottl

Clean up some messy Makefile stuff so that this can be built into the
kernel.


136849 24-Oct-2004 scottl

Import the HighPoint RocketRAID 182x driver. Thanks to HighPoint for
providing the original driver, and thanks to IronSystems for providing
hardware for testing.