diff options
author | Xin LI <delphij@FreeBSD.org> | 2009-04-07 16:38:25 +0000 |
---|---|---|
committer | Xin LI <delphij@FreeBSD.org> | 2009-04-07 16:38:25 +0000 |
commit | 6447075520f86044aa98703cd2ff206a6897e9a9 (patch) | |
tree | 9183bf09fd6f0d8e1af06cb8a8fae4e4e12d601b /sys/dev/hptmv/vdevice.h | |
parent | 0ca89d198640c3efbe9fde8a8a502a3200bb4a36 (diff) | |
download | src-6447075520f86044aa98703cd2ff206a6897e9a9.tar.gz src-6447075520f86044aa98703cd2ff206a6897e9a9.zip |
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
Notes
Notes:
svn path=/head/; revision=190809
Diffstat (limited to 'sys/dev/hptmv/vdevice.h')
-rw-r--r-- | sys/dev/hptmv/vdevice.h | 60 |
1 files changed, 32 insertions, 28 deletions
diff --git a/sys/dev/hptmv/vdevice.h b/sys/dev/hptmv/vdevice.h index 8d06f1032109..e0bddc7d1e6e 100644 --- a/sys/dev/hptmv/vdevice.h +++ b/sys/dev/hptmv/vdevice.h @@ -35,20 +35,20 @@ typedef struct _VDevice { - UCHAR VDeviceType; - UCHAR vf_bootmark: 1; /* is boot device? */ - UCHAR vf_bootable: 1; /* has active partition */ - UCHAR vf_online: 1; /* is usable? */ - UCHAR vf_cache_disk: 1; /* Cache enabled */ + UCHAR VDeviceType; + UCHAR vf_bootmark: 1; /* is boot device? */ + UCHAR vf_bootable: 1; /* has active partition */ + UCHAR vf_online: 1; /* is usable? */ + UCHAR vf_cache_disk: 1; /* Cache enabled */ UCHAR vf_format_v2: 1; /* old array block */ UCHAR vf_freed: 1; /* memory free */ - UCHAR reserve1; - UCHAR bSerialNumber; /* valid if pParent!=0 */ + UCHAR reserve1; + UCHAR bSerialNumber; /* valid if pParent!=0 */ - PVDevice pParent; /* parent array */ + PVDevice pParent; /* parent array */ PVBus pVBus; /* vbus this device located. Must not be NULL. */ - LBA_T VDeviceCapacity; /* number of blocks */ + LBA_T VDeviceCapacity; /* number of blocks */ LBA_T LockedLba; USHORT LockedSectors; @@ -58,16 +58,16 @@ typedef struct _VDevice void *QuiesceArg; void (* HPTLIBAPI flush_callback)(_VBUS_ARG void *arg); void *flush_callback_arg; - + #if defined(_RAID5N_) struct stripe **CacheEntry; struct range_lock *range_lock; #endif - void (* HPTLIBAPI pfnSendCommand)(_VBUS_ARG PCommand pCmd); /* call this to send a command to a VDevice */ - void (* HPTLIBAPI pfnDeviceFailed)(_VBUS_ARG PVDevice pVDev); /* call this when a VDevice failed */ - + void (* HPTLIBAPI pfnSendCommand)(_VBUS_ARG PCommand pCmd); /* call this to send a command to a VDevice */ + void (* HPTLIBAPI pfnDeviceFailed)(_VBUS_ARG PVDevice pVDev); /* call this when a VDevice failed */ + union { #ifdef SUPPORT_ARRAY RaidArray array; @@ -85,10 +85,10 @@ typedef struct _VDevice /* * bUserDeviceMode */ -#define MEMBER_NOT_SET_MODE 0x5F +#define MEMBER_NOT_SET_MODE 0x5F -/* - * arrayType +/* + * arrayType */ #define VD_SPARE 0 #define VD_REMOVABLE 1 @@ -120,10 +120,10 @@ void HPTLIBAPI fSingleDiskFailed(_VBUS_ARG PVDevice pVDev); typedef struct _VBus { /* pVDevice[] may be non-continuous */ - PVDevice pVDevice[MAX_VDEVICE_PER_VBUS]; + PVDevice pVDevice[MAX_VDEVICE_PER_VBUS]; - UINT nInstances; - PChipInstance pChipInstance[MAX_CHIP_IN_VBUS]; + UINT nInstances; + PChipInstance pChipInstance[MAX_CHIP_IN_VBUS]; void * OsExt; /* for OS private use */ @@ -176,16 +176,20 @@ typedef struct _VBus { for(i = 0; i < MAX_VDEVICE_PER_VBUS; i++) \ if ((pVDev=pVBus->pVDevice[i])==0) continue; else -#define FOR_EACH_DEV_ON_ALL_VBUS(pVBus, pVDev, i) \ + +#define FOR_EACH_VBUS(pVBus) \ for(pVBus = gVBus; pVBus < &gVBus[MAX_VBUS]; pVBus++) \ - for(i = 0; i < MAX_VDEVICE_PER_VBUS; i++) \ - if ((pVDev=pVBus->pVDevice[i])==0) continue; else #define FOR_EACH_ARRAY_ON_ALL_VBUS(pVBus, pArray, i) \ for(pVBus = gVBus; pVBus < &gVBus[MAX_VBUS]; pVBus++) \ for(i = 0; i < MAX_ARRAY_PER_VBUS; i++) \ if ((pArray=((PVDevice)&pVBus->_ArrayTables[i*ARRAY_VDEV_SIZE]))->u.array.dArStamp==0) continue; else +#define FOR_EACH_DEV_ON_ALL_VBUS(pVBus, pVDev, i) \ + FOR_EACH_VBUS(pVBus) \ + for(i = 0; i < MAX_VDEVICE_PER_VBUS; i++) \ + if ((pVDev=pVBus->pVDevice[i])==0) continue; else + /*************************************************************************** * Description: the functions called by IDE layer ***************************************************************************/ @@ -196,10 +200,10 @@ void HPTLIBAPI IdeRegisterDevice(PDevice pDev); #endif /*************************************************************************** - * Description: the functions OS must provided + * Description: the functions OS must provided ***************************************************************************/ -void OsSetDeviceTable(PDevice pDevice, PIDENTIFY_DATA pIdentify); +void HPTLIBAPI OsSetDeviceTable(PDevice pDevice, PIDENTIFY_DATA pIdentify); /* * allocate and free data structure @@ -240,12 +244,12 @@ void VBus_Config(PVBus pVBus, char *str); #endif #pragma pack(1) -struct fdisk_partition_table +struct fdisk_partition_table { UCHAR bootid; /* bootable? 0=no, 128=yes */ UCHAR beghead; /* beginning head number */ UCHAR begsect; /* beginning sector number */ - UCHAR begcyl; /* 10 bit nmbr, with high 2 bits put in begsect */ + UCHAR begcyl; /* 10 bit nmbr, with high 2 bits put in begsect */ UCHAR systid; /* Operating System type indicator code */ UCHAR endhead; /* ending head number */ UCHAR endsect; /* ending sector number */ @@ -254,7 +258,7 @@ struct fdisk_partition_table ULONG numsect; /* number of sectors in partition */ }; -typedef struct _Master_Boot_Record +typedef struct _Master_Boot_Record { UCHAR bootinst[446]; /* space to hold actual boot code */ struct fdisk_partition_table parts[4]; @@ -278,5 +282,5 @@ typedef struct _TIME_RECORD { #endif #endif -#pragma pack() +#pragma pack() #endif |