Merge changes from vendor driver 1.1.4:

v1.1.4 2015-06-09
   * Fix a bug that FailLED was not initialized properly.
  v1.1.3 2015-05-19
   * Support Report Luns command.
  v1.1.2 2015-05-05
   * Fix a bug that report wrong physical sector size for 512e HDD.

Many thanks to HighPoint for continued support of FreeBSD!

This driver update is intended for 10.2-RELEASE.

Submitted by:	Steve Chang
MFC after:	3 days
This commit is contained in:
Xin LI 2015-06-25 06:15:08 +00:00
parent e44053b76b
commit 7d379626b1
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=284792
8 changed files with 17559 additions and 17505 deletions

View File

@ -3,6 +3,16 @@ Copyright (C) 2015 HighPoint Technologies, Inc. All rights reserved.
#############################################################################
Revision History:
v1.1.4 2015-06-09
* Fix a bug that FailLED was not initialized properly.
v1.1.3 2015-05-19
* Support Report Luns command.
v1.1.2 2015-05-05
* Fix a bug that report wrong physical sector size for 512e HDD.
v1.1.1 2015-03-26
* Support 4Kn drive.
* Change the SCSI target ID of the disk to be the index of physical connetion to the HBA.
@ -57,7 +67,7 @@ Revision History:
2) Extract the driver files under the kernel source tree:
# cd /usr/src/sys/
# tar xvzf /your/path/to/hptnr-freebsd-src-v1.0-130701.tgz
# tar xvzf /your/path/to/HPTNR_FreeBSD_Src_1.x.x_xx_xx_xx.tgz
3) Update the kernel configuration file to include the HighPoint source.
Assume the configure file is GENERIC, and new kernel configure file is
@ -79,8 +89,8 @@ Revision History:
compile-with "uudecode < $S/dev/hptnr/i386-elf.hptnr_lib.o.uu" \
no-implicit-rule
dev/hptnr/os_bsd.c optional hptnr
dev/hptnr/osm_bsd.c optional hptnr
dev/hptnr/hptnr_os_bsd.c optional hptnr
dev/hptnr/hptnr_osm_bsd.c optional hptnr
dev/hptnr/hptnr_config.c optional hptnr
For amd64 system, edit /usr/src/sys/conf/files.amd64 and append the lines
@ -91,13 +101,13 @@ Revision History:
compile-with "uudecode < $S/dev/hptnr/amd64-elf.hptnr_lib.o.uu" \
no-implicit-rule
dev/hptnr/os_bsd.c optional hptnr
dev/hptnr/osm_bsd.c optional hptnr
dev/hptnr/hptnr_os_bsd.c optional hptnr
dev/hptnr/hptnr_osm_bsd.c optional hptnr
dev/hptnr/hptnr_config.c optional hptnr
6) Rebuild and install the kernel:
a) for FreeBSD 5.x-i386/6.x-i386/7.x-i386/8.x-i386/9.x-i386:
a) for FreeBSD 5.x-i386/6.x-i386/7.x-i386/8.x-i386/9.x-i386/10.x-i386:
# cd /usr/src/sys/i386/conf/
# /usr/sbin/config MYKERNEL
@ -106,7 +116,7 @@ Revision History:
# make
# make install
b) for FreeBSD 5.x-amd64/6.x-amd64/7.x-amd64/8.x-amd64/9.x-amd64:
b) for FreeBSD 5.x-amd64/6.x-amd64/7.x-amd64/8.x-amd64/9.x-amd64/10.x-amd64:
# cd /usr/src/sys/amd64/conf/
# /usr/sbin/config MYKERNEL
@ -139,7 +149,7 @@ Revision History:
2) Extract the driver files under the kernel source tree:
# cd /usr/src/sys/
# tar xvzf /your/path/to/hptnr-freebsd-src-v1.0-111213.tgz
# tar xvzf /your/path/to/HPTNR_FreeBSD_Src_1.x.x_xx_xx_xx.tgz
4) Build the driver module:
@ -153,7 +163,7 @@ Revision History:
# cp hptnr.ko /modules/
For FreeBSD 5.x/6.x/7.x/8.x/9.x:
For FreeBSD 5.x/6.x/7.x/8.x/9.x/10.x:
# cp hptnr.ko /boot/kernel/
@ -179,7 +189,7 @@ Revision History:
/modules/hptnr.ko text=0xf571 data=0x2c8+0x254
ok boot
For FreeBSD 5.x/6.x/7.x/8.x/9.x, you can select 6 on the boot menu to get a loader
For FreeBSD 5.x/6.x/7.x/8.x/9.x/10.x, you can select 6 on the boot menu to get a loader
prompt.
7) You can add a below line into /boot/defaults/loader.conf to load the

File diff suppressed because it is too large Load Diff

View File

@ -198,7 +198,9 @@ typedef struct _HIM_DEVICE_CONFIG
{
HPT_U64 capacity;
HPT_U32 logical_sector_size;
HPT_U8 logicalsectors_per_physicalsector;
HPT_U16 lowest_aligned;
DEVICE_FLAGS flags;
HPT_U8 path_id;

View File

@ -46,7 +46,7 @@ int init_config(void)
const char driver_name[] = "hptnr";
const char driver_name_long[] = "R750/DC7280 controller driver";
const char driver_ver[] = "v1.1.1";
const char driver_ver[] = "v1.1.4";
int osm_max_targets = 0xff;

View File

@ -621,7 +621,7 @@ static void hpt_scsi_io(PVBUS_EXT vbus_ext, union ccb *ccb)
PassthroughCmd *passthru;
if (mIsArray(vd->type)) {
ccb->ccb_h.status = CAM_PATH_INVALID;
ccb->ccb_h.status = CAM_REQ_INVALID;
break;
}
@ -757,7 +757,7 @@ static void hpt_scsi_io(PVBUS_EXT vbus_ext, union ccb *ccb)
return;
error:
ldm_free_cmds(pCmd);
ccb->ccb_h.status = CAM_PATH_INVALID;
ccb->ccb_h.status = CAM_REQ_INVALID;
break;
}
@ -916,6 +916,14 @@ static void hpt_scsi_io(PVBUS_EXT vbus_ext, union ccb *ccb)
break;
}
case REPORT_LUNS:
{
HPT_U8 *rbuf = ccb->csio.data_ptr;
memset(rbuf, 0, 16);
rbuf[3] = 8;
ccb->ccb_h.status = CAM_REQ_CMP;
break;
}
case SERVICE_ACTION_IN:
{
HPT_U8 *rbuf = ccb->csio.data_ptr;
@ -954,6 +962,12 @@ static void hpt_scsi_io(PVBUS_EXT vbus_ext, union ccb *ccb)
rbuf[10] = 2 << sector_size_shift;
rbuf[11] = 0;
if(!mIsArray(vd->type)){
rbuf[13] = vd->u.raw.logicalsectors_per_physicalsector;
rbuf[14] = (HPT_U8)((vd->u.raw.lowest_aligned >> 8) & 0x3f);
rbuf[15] = (HPT_U8)(vd->u.raw.lowest_aligned);
}
ccb->ccb_h.status = CAM_REQ_CMP;
break;
}
@ -1067,7 +1081,7 @@ static void hpt_scsi_io(PVBUS_EXT vbus_ext, union ccb *ccb)
}
default:
ccb->ccb_h.status = CAM_SEL_TIMEOUT;
ccb->ccb_h.status = CAM_REQ_INVALID;
break;
}

File diff suppressed because it is too large Load Diff

View File

@ -244,7 +244,8 @@ typedef struct hpt_raw_disk
__HPT_RAW_LBA real_capacity;
__HPT_RAW_LBA head_position;
HPT_U32 logical_sector_size;
HPT_U8 logicalsectors_per_physicalsector;
HPT_U16 lowest_aligned;
HPT_U16 max_sectors_per_cmd;
HPT_U8 max_queue_depth;
HPT_U8 user_select_mode;

View File

@ -153,7 +153,10 @@ void os_pci_writel(void *osext, HPT_U8 offset, HPT_U32 value);
#define MAX_PCI_BUS_NUMBER 0xff
#define MAX_PCI_DEVICE_NUMBER 32
#define MAX_PCI_FUNC_NUMBER 1
HPT_U8 pcicfg_read_byte (HPT_U8 bus, HPT_U8 dev, HPT_U8 func, HPT_U8 reg);
HPT_U32 pcicfg_read_dword(HPT_U8 bus, HPT_U8 dev, HPT_U8 func, HPT_U8 reg);
void pcicfg_write_byte (HPT_U8 bus, HPT_U8 dev, HPT_U8 func, HPT_U8 reg, HPT_U8 v);
void pcicfg_write_dword(HPT_U8 bus, HPT_U8 dev, HPT_U8 func, HPT_U8 reg, HPT_U32 v);
void *os_map_pci_bar(